codexui-android 0.1.88 → 0.1.90

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,92 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreadConversation-B-Ik7tFp.js","assets/ThreadConversation-BKfO22g2.css","assets/ReviewPane-Blnhnm6J.js","assets/ReviewPane-CyugWwTM.css","assets/SkillsHub-C93DMbLM.js","assets/SkillsHub-Bg1Le103.css"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();/**
3
- * @vue/shared v3.5.32
4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
- * @license MIT
6
- **/function Af(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ot={},hi=[],ro=()=>{},Wg=()=>!1,Sc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Tc=e=>e.startsWith("onUpdate:"),dn=Object.assign,xf=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},sw=Object.prototype.hasOwnProperty,Rt=(e,t)=>sw.call(e,t),Ke=Array.isArray,mi=e=>Oa(e)==="[object Map]",Mi=e=>Oa(e)==="[object Set]",jp=e=>Oa(e)==="[object Date]",et=e=>typeof e=="function",Wt=e=>typeof e=="string",Ur=e=>typeof e=="symbol",Mt=e=>e!==null&&typeof e=="object",Vg=e=>(Mt(e)||et(e))&&et(e.then)&&et(e.catch),zg=Object.prototype.toString,Oa=e=>zg.call(e),iw=e=>Oa(e).slice(8,-1),Gg=e=>Oa(e)==="[object Object]",Rf=e=>Wt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,aa=Af(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ec=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},aw=/-\w/g,Jn=Ec(e=>e.replace(aw,t=>t.slice(1).toUpperCase())),lw=/\B([A-Z])/g,as=Ec(e=>e.replace(lw,"-$1").toLowerCase()),kc=Ec(e=>e.charAt(0).toUpperCase()+e.slice(1)),Pu=Ec(e=>e?`on${kc(e)}`:""),to=(e,t)=>!Object.is(e,t),Bl=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Kg=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ic=e=>{const t=parseFloat(e);return isNaN(t)?e:t},cw=e=>{const t=Wt(e)?Number(e):NaN;return isNaN(t)?e:t};let Fp;const Cc=()=>Fp||(Fp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function To(e){if(Ke(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=Wt(r)?pw(r):To(r);if(o)for(const s in o)t[s]=o[s]}return t}else if(Wt(e)||Mt(e))return e}const uw=/;(?![^(]*\))/g,dw=/:([^]+)/,fw=/\/\*[^]*?\*\//g;function pw(e){const t={};return e.replace(fw,"").split(uw).forEach(n=>{if(n){const r=n.split(dw);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ht(e){let t="";if(Wt(e))t=e;else if(Ke(e))for(let n=0;n<e.length;n++){const r=ht(e[n]);r&&(t+=r+" ")}else if(Mt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const hw="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",mw=Af(hw);function Yg(e){return!!e||e===""}function gw(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Pi(e[r],t[r]);return n}function Pi(e,t){if(e===t)return!0;let n=jp(e),r=jp(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Ur(e),r=Ur(t),n||r)return e===t;if(n=Ke(e),r=Ke(t),n||r)return n&&r?gw(e,t):!1;if(n=Mt(e),r=Mt(t),n||r){if(!n||!r)return!1;const o=Object.keys(e).length,s=Object.keys(t).length;if(o!==s)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!Pi(e[i],t[i]))return!1}}return String(e)===String(t)}function Mf(e,t){return e.findIndex(n=>Pi(n,t))}const Jg=e=>!!(e&&e.__v_isRef===!0),le=e=>Wt(e)?e:e==null?"":Ke(e)||Mt(e)&&(e.toString===zg||!et(e.toString))?Jg(e)?le(e.value):JSON.stringify(e,Xg,2):String(e),Xg=(e,t)=>Jg(t)?Xg(e,t.value):mi(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],s)=>(n[$u(r,s)+" =>"]=o,n),{})}:Mi(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>$u(n))}:Ur(t)?$u(t):Mt(t)&&!Ke(t)&&!Gg(t)?String(t):t,$u=(e,t="")=>{var n;return Ur(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
7
- * @vue/reactivity v3.5.32
8
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
9
- * @license MIT
10
- **/let sr;class vw{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=sr,!t&&sr&&(this.index=(sr.scopes||(sr.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=sr;try{return sr=this,t()}finally{sr=n}}}on(){++this._on===1&&(this.prevScope=sr,sr=this)}off(){this._on>0&&--this._on===0&&(sr=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function yw(){return sr}let Lt;const Nu=new WeakSet;class Qg{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,sr&&sr.active&&sr.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Nu.has(this)&&(Nu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ev(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Bp(this),tv(this);const t=Lt,n=Fr;Lt=this,Fr=!0;try{return this.fn()}finally{nv(this),Lt=t,Fr=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Nf(t);this.deps=this.depsTail=void 0,Bp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Nu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Pd(this)&&this.run()}get dirty(){return Pd(this)}}let Zg=0,la,ca;function ev(e,t=!1){if(e.flags|=8,t){e.next=ca,ca=e;return}e.next=la,la=e}function Pf(){Zg++}function $f(){if(--Zg>0)return;if(ca){let t=ca;for(ca=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;la;){let t=la;for(la=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function tv(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function nv(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Nf(r),_w(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Pd(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(rv(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function rv(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ya)||(e.globalVersion=ya,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Pd(e))))return;e.flags|=2;const t=e.dep,n=Lt,r=Fr;Lt=e,Fr=!0;try{tv(e);const o=e.fn(e._value);(t.version===0||to(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Lt=n,Fr=r,nv(e),e.flags&=-3}}function Nf(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Nf(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function _w(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Fr=!0;const ov=[];function Ao(){ov.push(Fr),Fr=!1}function xo(){const e=ov.pop();Fr=e===void 0?!0:e}function Bp(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Lt;Lt=void 0;try{t()}finally{Lt=n}}}let ya=0;class bw{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Of{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Lt||!Fr||Lt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Lt)n=this.activeLink=new bw(Lt,this),Lt.deps?(n.prevDep=Lt.depsTail,Lt.depsTail.nextDep=n,Lt.depsTail=n):Lt.deps=Lt.depsTail=n,sv(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Lt.depsTail,n.nextDep=void 0,Lt.depsTail.nextDep=n,Lt.depsTail=n,Lt.deps===n&&(Lt.deps=r)}return n}trigger(t){this.version++,ya++,this.notify(t)}notify(t){Pf();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{$f()}}}function sv(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)sv(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const $d=new WeakMap,js=Symbol(""),Nd=Symbol(""),_a=Symbol("");function Nn(e,t,n){if(Fr&&Lt){let r=$d.get(e);r||$d.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Of),o.map=r,o.key=n),o.track()}}function wo(e,t,n,r,o,s){const i=$d.get(e);if(!i){ya++;return}const a=l=>{l&&l.trigger()};if(Pf(),t==="clear")i.forEach(a);else{const l=Ke(e),u=l&&Rf(n);if(l&&n==="length"){const d=Number(r);i.forEach((f,g)=>{(g==="length"||g===_a||!Ur(g)&&g>=d)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(_a)),t){case"add":l?u&&a(i.get("length")):(a(i.get(js)),mi(e)&&a(i.get(Nd)));break;case"delete":l||(a(i.get(js)),mi(e)&&a(i.get(Nd)));break;case"set":mi(e)&&a(i.get(js));break}}$f()}function ri(e){const t=Et(e);return t===e?t:(Nn(t,"iterate",_a),kr(e)?t:t.map(qr))}function Ac(e){return Nn(e=Et(e),"iterate",_a),e}function Zr(e,t){return Ro(e)?bi(Fs(e)?qr(t):t):qr(t)}const ww={__proto__:null,[Symbol.iterator](){return Ou(this,Symbol.iterator,e=>Zr(this,e))},concat(...e){return ri(this).concat(...e.map(t=>Ke(t)?ri(t):t))},entries(){return Ou(this,"entries",e=>(e[1]=Zr(this,e[1]),e))},every(e,t){return ho(this,"every",e,t,void 0,arguments)},filter(e,t){return ho(this,"filter",e,t,n=>n.map(r=>Zr(this,r)),arguments)},find(e,t){return ho(this,"find",e,t,n=>Zr(this,n),arguments)},findIndex(e,t){return ho(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ho(this,"findLast",e,t,n=>Zr(this,n),arguments)},findLastIndex(e,t){return ho(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ho(this,"forEach",e,t,void 0,arguments)},includes(...e){return Lu(this,"includes",e)},indexOf(...e){return Lu(this,"indexOf",e)},join(e){return ri(this).join(e)},lastIndexOf(...e){return Lu(this,"lastIndexOf",e)},map(e,t){return ho(this,"map",e,t,void 0,arguments)},pop(){return Zi(this,"pop")},push(...e){return Zi(this,"push",e)},reduce(e,...t){return Up(this,"reduce",e,t)},reduceRight(e,...t){return Up(this,"reduceRight",e,t)},shift(){return Zi(this,"shift")},some(e,t){return ho(this,"some",e,t,void 0,arguments)},splice(...e){return Zi(this,"splice",e)},toReversed(){return ri(this).toReversed()},toSorted(e){return ri(this).toSorted(e)},toSpliced(...e){return ri(this).toSpliced(...e)},unshift(...e){return Zi(this,"unshift",e)},values(){return Ou(this,"values",e=>Zr(this,e))}};function Ou(e,t,n){const r=Ac(e),o=r[t]();return r!==e&&!kr(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const Sw=Array.prototype;function ho(e,t,n,r,o,s){const i=Ac(e),a=i!==e&&!kr(e),l=i[t];if(l!==Sw[t]){const f=l.apply(e,s);return a?qr(f):f}let u=n;i!==e&&(a?u=function(f,g){return n.call(this,Zr(e,f),g,e)}:n.length>2&&(u=function(f,g){return n.call(this,f,g,e)}));const d=l.call(i,u,r);return a&&o?o(d):d}function Up(e,t,n,r){const o=Ac(e),s=o!==e&&!kr(e);let i=n,a=!1;o!==e&&(s?(a=r.length===0,i=function(u,d,f){return a&&(a=!1,u=Zr(e,u)),n.call(this,u,Zr(e,d),f,e)}):n.length>3&&(i=function(u,d,f){return n.call(this,u,d,f,e)}));const l=o[t](i,...r);return a?Zr(e,l):l}function Lu(e,t,n){const r=Et(e);Nn(r,"iterate",_a);const o=r[t](...n);return(o===-1||o===!1)&&jf(n[0])?(n[0]=Et(n[0]),r[t](...n)):o}function Zi(e,t,n=[]){Ao(),Pf();const r=Et(e)[t].apply(e,n);return $f(),xo(),r}const Tw=Af("__proto__,__v_isRef,__isVue"),iv=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ur));function Ew(e){Ur(e)||(e=String(e));const t=Et(this);return Nn(t,"has",e),t.hasOwnProperty(e)}class av{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?Nw:dv:s?uv:cv).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Ke(t);if(!o){let l;if(i&&(l=ww[n]))return l;if(n==="hasOwnProperty")return Ew}const a=Reflect.get(t,n,jn(t)?t:r);if((Ur(n)?iv.has(n):Tw(n))||(o||Nn(t,"get",n),s))return a;if(jn(a)){const l=i&&Rf(n)?a:a.value;return o&&Mt(l)?Ld(l):l}return Mt(a)?o?Ld(a):xc(a):a}}class lv extends av{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];const i=Ke(t)&&Rf(n);if(!this._isShallow){const u=Ro(s);if(!kr(r)&&!Ro(r)&&(s=Et(s),r=Et(r)),!i&&jn(s)&&!jn(r))return u||(s.value=r),!0}const a=i?Number(n)<t.length:Rt(t,n),l=Reflect.set(t,n,r,jn(t)?t:o);return t===Et(o)&&(a?to(r,s)&&wo(t,"set",n,r):wo(t,"add",n,r)),l}deleteProperty(t,n){const r=Rt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&wo(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return(!Ur(n)||!iv.has(n))&&Nn(t,"has",n),r}ownKeys(t){return Nn(t,"iterate",Ke(t)?"length":js),Reflect.ownKeys(t)}}class kw extends av{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Iw=new lv,Cw=new kw,Aw=new lv(!0);const Od=e=>e,El=e=>Reflect.getPrototypeOf(e);function xw(e,t,n){return function(...r){const o=this.__v_raw,s=Et(o),i=mi(s),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=o[e](...r),d=n?Od:t?bi:qr;return!t&&Nn(s,"iterate",l?Nd:js),dn(Object.create(u),{next(){const{value:f,done:g}=u.next();return g?{value:f,done:g}:{value:a?[d(f[0]),d(f[1])]:d(f),done:g}}})}}function kl(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Rw(e,t){const n={get(o){const s=this.__v_raw,i=Et(s),a=Et(o);e||(to(o,a)&&Nn(i,"get",o),Nn(i,"get",a));const{has:l}=El(i),u=t?Od:e?bi:qr;if(l.call(i,o))return u(s.get(o));if(l.call(i,a))return u(s.get(a));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!e&&Nn(Et(o),"iterate",js),o.size},has(o){const s=this.__v_raw,i=Et(s),a=Et(o);return e||(to(o,a)&&Nn(i,"has",o),Nn(i,"has",a)),o===a?s.has(o):s.has(o)||s.has(a)},forEach(o,s){const i=this,a=i.__v_raw,l=Et(a),u=t?Od:e?bi:qr;return!e&&Nn(l,"iterate",js),a.forEach((d,f)=>o.call(s,u(d),u(f),i))}};return dn(n,e?{add:kl("add"),set:kl("set"),delete:kl("delete"),clear:kl("clear")}:{add(o){const s=Et(this),i=El(s),a=Et(o),l=!t&&!kr(o)&&!Ro(o)?a:o;return i.has.call(s,l)||to(o,l)&&i.has.call(s,o)||to(a,l)&&i.has.call(s,a)||(s.add(l),wo(s,"add",l,l)),this},set(o,s){!t&&!kr(s)&&!Ro(s)&&(s=Et(s));const i=Et(this),{has:a,get:l}=El(i);let u=a.call(i,o);u||(o=Et(o),u=a.call(i,o));const d=l.call(i,o);return i.set(o,s),u?to(s,d)&&wo(i,"set",o,s):wo(i,"add",o,s),this},delete(o){const s=Et(this),{has:i,get:a}=El(s);let l=i.call(s,o);l||(o=Et(o),l=i.call(s,o)),a&&a.call(s,o);const u=s.delete(o);return l&&wo(s,"delete",o,void 0),u},clear(){const o=Et(this),s=o.size!==0,i=o.clear();return s&&wo(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=xw(o,e,t)}),n}function Lf(e,t){const n=Rw(e,t);return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(Rt(n,o)&&o in r?n:r,o,s)}const Mw={get:Lf(!1,!1)},Pw={get:Lf(!1,!0)},$w={get:Lf(!0,!1)};const cv=new WeakMap,uv=new WeakMap,dv=new WeakMap,Nw=new WeakMap;function Ow(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Lw(e){return e.__v_skip||!Object.isExtensible(e)?0:Ow(iw(e))}function xc(e){return Ro(e)?e:Df(e,!1,Iw,Mw,cv)}function fv(e){return Df(e,!1,Aw,Pw,uv)}function Ld(e){return Df(e,!0,Cw,$w,dv)}function Df(e,t,n,r,o){if(!Mt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=Lw(e);if(s===0)return e;const i=o.get(e);if(i)return i;const a=new Proxy(e,s===2?r:n);return o.set(e,a),a}function Fs(e){return Ro(e)?Fs(e.__v_raw):!!(e&&e.__v_isReactive)}function Ro(e){return!!(e&&e.__v_isReadonly)}function kr(e){return!!(e&&e.__v_isShallow)}function jf(e){return e?!!e.__v_raw:!1}function Et(e){const t=e&&e.__v_raw;return t?Et(t):e}function Dw(e){return!Rt(e,"__v_skip")&&Object.isExtensible(e)&&Kg(e,"__v_skip",!0),e}const qr=e=>Mt(e)?xc(e):e,bi=e=>Mt(e)?Ld(e):e;function jn(e){return e?e.__v_isRef===!0:!1}function N(e){return pv(e,!1)}function jw(e){return pv(e,!0)}function pv(e,t){return jn(e)?e:new Fw(e,t)}class Fw{constructor(t,n){this.dep=new Of,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Et(t),this._value=n?t:qr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||kr(t)||Ro(t);t=r?t:Et(t),to(t,n)&&(this._rawValue=t,this._value=r?t:qr(t),this.dep.trigger())}}function Be(e){return jn(e)?e.value:e}const Bw={get:(e,t,n)=>t==="__v_raw"?e:Be(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return jn(o)&&!jn(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function hv(e){return Fs(e)?e:new Proxy(e,Bw)}class Uw{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Of(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ya-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Lt!==this)return ev(this,!0),!0}get value(){const t=this.dep.track();return rv(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function qw(e,t,n=!1){let r,o;return et(e)?r=e:(r=e.get,o=e.set),new Uw(r,o,n)}const Il={},tc=new WeakMap;let Rs;function Hw(e,t=!1,n=Rs){if(n){let r=tc.get(n);r||tc.set(n,r=[]),r.push(e)}}function Ww(e,t,n=Ot){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:a,call:l}=n,u=z=>o?z:kr(z)||o===!1||o===0?So(z,1):So(z);let d,f,g,y,k=!1,A=!1;if(jn(e)?(f=()=>e.value,k=kr(e)):Fs(e)?(f=()=>u(e),k=!0):Ke(e)?(A=!0,k=e.some(z=>Fs(z)||kr(z)),f=()=>e.map(z=>{if(jn(z))return z.value;if(Fs(z))return u(z);if(et(z))return l?l(z,2):z()})):et(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){Ao();try{g()}finally{xo()}}const z=Rs;Rs=d;try{return l?l(e,3,[y]):e(y)}finally{Rs=z}}:f=ro,t&&o){const z=f,ce=o===!0?1/0:o;f=()=>So(z(),ce)}const H=yw(),R=()=>{d.stop(),H&&H.active&&xf(H.effects,d)};if(s&&t){const z=t;t=(...ce)=>{z(...ce),R()}}let O=A?new Array(e.length).fill(Il):Il;const W=z=>{if(!(!(d.flags&1)||!d.dirty&&!z))if(t){const ce=d.run();if(o||k||(A?ce.some((ne,Q)=>to(ne,O[Q])):to(ce,O))){g&&g();const ne=Rs;Rs=d;try{const Q=[ce,O===Il?void 0:A&&O[0]===Il?[]:O,y];O=ce,l?l(t,3,Q):t(...Q)}finally{Rs=ne}}}else d.run()};return a&&a(W),d=new Qg(f),d.scheduler=i?()=>i(W,!1):W,y=z=>Hw(z,!1,d),g=d.onStop=()=>{const z=tc.get(d);if(z){if(l)l(z,4);else for(const ce of z)ce();tc.delete(d)}},t?r?W(!0):O=d.run():i?i(W.bind(null,!0),!0):d.run(),R.pause=d.pause.bind(d),R.resume=d.resume.bind(d),R.stop=R,R}function So(e,t=1/0,n){if(t<=0||!Mt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,jn(e))So(e.value,t,n);else if(Ke(e))for(let r=0;r<e.length;r++)So(e[r],t,n);else if(Mi(e)||mi(e))e.forEach(r=>{So(r,t,n)});else if(Gg(e)){for(const r in e)So(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&So(e[r],t,n)}return e}/**
11
- * @vue/runtime-core v3.5.32
12
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
- * @license MIT
14
- **/function La(e,t,n,r){try{return r?e(...r):e()}catch(o){Da(o,t,n)}}function Hr(e,t,n,r){if(et(e)){const o=La(e,t,n,r);return o&&Vg(o)&&o.catch(s=>{Da(s,t,n)}),o}if(Ke(e)){const o=[];for(let s=0;s<e.length;s++)o.push(Hr(e[s],t,n,r));return o}}function Da(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Ot;if(t){let a=t.parent;const l=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const d=a.ec;if(d){for(let f=0;f<d.length;f++)if(d[f](e,l,u)===!1)return}a=a.parent}if(s){Ao(),La(s,null,10,[e,l,u]),xo();return}}Vw(e,n,o,r,i)}function Vw(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}const Yn=[];let Xr=-1;const gi=[];let Yo=null,li=0;const mv=Promise.resolve();let nc=null;function Yt(e){const t=nc||mv;return e?t.then(this?e.bind(this):e):t}function zw(e){let t=Xr+1,n=Yn.length;for(;t<n;){const r=t+n>>>1,o=Yn[r],s=ba(o);s<e||s===e&&o.flags&2?t=r+1:n=r}return t}function Ff(e){if(!(e.flags&1)){const t=ba(e),n=Yn[Yn.length-1];!n||!(e.flags&2)&&t>=ba(n)?Yn.push(e):Yn.splice(zw(t),0,e),e.flags|=1,gv()}}function gv(){nc||(nc=mv.then(yv))}function Gw(e){Ke(e)?gi.push(...e):Yo&&e.id===-1?Yo.splice(li+1,0,e):e.flags&1||(gi.push(e),e.flags|=1),gv()}function qp(e,t,n=Xr+1){for(;n<Yn.length;n++){const r=Yn[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Yn.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function vv(e){if(gi.length){const t=[...new Set(gi)].sort((n,r)=>ba(n)-ba(r));if(gi.length=0,Yo){Yo.push(...t);return}for(Yo=t,li=0;li<Yo.length;li++){const n=Yo[li];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Yo=null,li=0}}const ba=e=>e.id==null?e.flags&2?-1:1/0:e.id;function yv(e){try{for(Xr=0;Xr<Yn.length;Xr++){const t=Yn[Xr];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),La(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Xr<Yn.length;Xr++){const t=Yn[Xr];t&&(t.flags&=-2)}Xr=-1,Yn.length=0,vv(),nc=null,(Yn.length||gi.length)&&yv()}}let kn=null,_v=null;function rc(e){const t=kn;return kn=e,_v=e&&e.type.__scopeId||null,t}function At(e,t=kn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&ic(-1);const s=rc(t);let i;try{i=e(...o)}finally{rc(s),r._d&&ic(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Kn(e,t){if(kn===null)return e;const n=Nc(kn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,i,a,l=Ot]=t[o];s&&(et(s)&&(s={mounted:s,updated:s}),s.deep&&So(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Es(e,t,n,r){const o=e.dirs,s=t&&t.dirs;for(let i=0;i<o.length;i++){const a=o[i];s&&(a.oldValue=s[i].value);let l=a.dir[r];l&&(Ao(),Hr(l,n,8,[e.el,a,e,t]),xo())}}function Ul(e,t){if(En){let n=En.provides;const r=En.parent&&En.parent.provides;r===n&&(n=En.provides=Object.create(r)),n[e]=t}}function Br(e,t,n=!1){const r=zf();if(r||yi){let o=yi?yi._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&et(t)?t.call(r&&r.proxy):t}}const Kw=Symbol.for("v-scx"),Yw=()=>Br(Kw);function ct(e,t,n){return bv(e,t,n)}function bv(e,t,n=Ot){const{immediate:r,deep:o,flush:s,once:i}=n,a=dn({},n),l=t&&r||!t&&s!=="post";let u;if(wi){if(s==="sync"){const y=Yw();u=y.__watcherHandles||(y.__watcherHandles=[])}else if(!l){const y=()=>{};return y.stop=ro,y.resume=ro,y.pause=ro,y}}const d=En;a.call=(y,k,A)=>Hr(y,d,k,A);let f=!1;s==="post"?a.scheduler=y=>{zn(y,d&&d.suspense)}:s!=="sync"&&(f=!0,a.scheduler=(y,k)=>{k?y():Ff(y)}),a.augmentJob=y=>{t&&(y.flags|=4),f&&(y.flags|=2,d&&(y.id=d.uid,y.i=d))};const g=Ww(e,t,a);return wi&&(u?u.push(g):l&&g()),g}function Jw(e,t,n){const r=this.proxy,o=Wt(e)?e.includes(".")?wv(r,e):()=>r[e]:e.bind(r,r);let s;et(t)?s=t:(s=t.handler,n=t);const i=Fa(this),a=bv(o,s.bind(r),n);return i(),a}function wv(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const ks=new WeakMap,Sv=Symbol("_vte"),Tv=e=>e.__isTeleport,$s=e=>e&&(e.disabled||e.disabled===""),Xw=e=>e&&(e.defer||e.defer===""),Hp=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Wp=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Dd=(e,t)=>{const n=e&&e.to;return Wt(n)?t?t(n):null:n},Qw={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,i,a,l,u){const{mc:d,pc:f,pbc:g,o:{insert:y,querySelector:k,createText:A,createComment:H}}=u,R=$s(t.props);let{dynamicChildren:O}=t;const W=(ne,Q,me)=>{ne.shapeFlag&16&&d(ne.children,Q,me,o,s,i,a,l)},z=(ne=t)=>{const Q=$s(ne.props),me=ne.target=Dd(ne.props,k),Me=jd(me,ne,A,y);me&&(i!=="svg"&&Hp(me)?i="svg":i!=="mathml"&&Wp(me)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(me),Q||(W(ne,me,Me),sa(ne,!1)))},ce=ne=>{const Q=()=>{ks.get(ne)===Q&&(ks.delete(ne),$s(ne.props)&&(W(ne,n,ne.anchor),sa(ne,!0)),z(ne))};ks.set(ne,Q),zn(Q,s)};if(e==null){const ne=t.el=A(""),Q=t.anchor=A("");if(y(ne,n,r),y(Q,n,r),Xw(t.props)||s&&s.pendingBranch){ce(t);return}R&&(W(t,n,Q),sa(t,!0)),z()}else{t.el=e.el;const ne=t.anchor=e.anchor,Q=ks.get(e);if(Q){Q.flags|=8,ks.delete(e),ce(t);return}t.targetStart=e.targetStart;const me=t.target=e.target,Me=t.targetAnchor=e.targetAnchor,xe=$s(e.props),Oe=xe?n:me,J=xe?ne:Me;if(i==="svg"||Hp(me)?i="svg":(i==="mathml"||Wp(me))&&(i="mathml"),O?(g(e.dynamicChildren,O,Oe,o,s,i,a),Wf(e,t,!0)):l||f(e,t,Oe,J,o,s,i,a,!1),R)xe?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Cl(t,n,ne,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const de=t.target=Dd(t.props,k);de&&Cl(t,de,null,u,0)}else xe&&Cl(t,me,Me,u,1);sa(t,R)}},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:d,target:f,props:g}=e;let y=s||!$s(g);const k=ks.get(e);if(k&&(k.flags|=8,ks.delete(e),y=!1),f&&(o(u),o(d)),s&&o(l),i&16)for(let A=0;A<a.length;A++){const H=a[A];r(H,t,n,y,!!H.dynamicChildren)}},move:Cl,hydrate:Zw};function Cl(e,t,n,{o:{insert:r},m:o},s=2){s===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:u,props:d}=e,f=s===2;if(f&&r(i,t,n),(!f||$s(d))&&l&16)for(let g=0;g<u.length;g++)o(u[g],t,n,2);f&&r(a,t,n)}function Zw(e,t,n,r,o,s,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:d}},f){function g(H,R){let O=R;for(;O;){if(O&&O.nodeType===8){if(O.data==="teleport start anchor")t.targetStart=O;else if(O.data==="teleport anchor"){t.targetAnchor=O,H._lpa=t.targetAnchor&&i(t.targetAnchor);break}}O=i(O)}}function y(H,R){R.anchor=f(i(H),R,a(H),n,r,o,s)}const k=t.target=Dd(t.props,l),A=$s(t.props);if(k){const H=k._lpa||k.firstChild;t.shapeFlag&16&&(A?(y(e,t),g(k,H),t.targetAnchor||jd(k,t,d,u,a(e)===k?e:null)):(t.anchor=i(e),g(k,H),t.targetAnchor||jd(k,t,d,u),f(H&&i(H),t,k,n,r,o,s))),sa(t,A)}else A&&t.shapeFlag&16&&(y(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const ua=Qw;function sa(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function jd(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[Sv]=i,e&&(r(s,e,o),r(i,e,o)),i}const Qr=Symbol("_leaveCb"),ea=Symbol("_enterCb");function eS(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ls(()=>{e.isMounted=!0}),zs(()=>{e.isUnmounting=!0}),e}const Sr=[Function,Array],Ev={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Sr,onEnter:Sr,onAfterEnter:Sr,onEnterCancelled:Sr,onBeforeLeave:Sr,onLeave:Sr,onAfterLeave:Sr,onLeaveCancelled:Sr,onBeforeAppear:Sr,onAppear:Sr,onAfterAppear:Sr,onAppearCancelled:Sr},kv=e=>{const t=e.subTree;return t.component?kv(t.component):t},tS={name:"BaseTransition",props:Ev,setup(e,{slots:t}){const n=zf(),r=eS();return()=>{const o=t.default&&Av(t.default(),!0);if(!o||!o.length)return;const s=Iv(o),i=Et(e),{mode:a}=i;if(r.isLeaving)return Du(s);const l=Vp(s);if(!l)return Du(s);let u=Fd(l,i,r,n,f=>u=f);l.type!==Ln&&wa(l,u);let d=n.subTree&&Vp(n.subTree);if(d&&d.type!==Ln&&!Ns(d,l)&&kv(n).type!==Ln){let f=Fd(d,i,r,n);if(wa(d,f),a==="out-in"&&l.type!==Ln)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,d=void 0},Du(s);a==="in-out"&&l.type!==Ln?f.delayLeave=(g,y,k)=>{const A=Cv(r,d);A[String(d.key)]=d,g[Qr]=()=>{y(),g[Qr]=void 0,delete u.delayedLeave,d=void 0},u.delayedLeave=()=>{k(),delete u.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return s}}};function Iv(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ln){t=n;break}}return t}const nS=tS;function Cv(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Fd(e,t,n,r,o){const{appear:s,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:d,onEnterCancelled:f,onBeforeLeave:g,onLeave:y,onAfterLeave:k,onLeaveCancelled:A,onBeforeAppear:H,onAppear:R,onAfterAppear:O,onAppearCancelled:W}=t,z=String(e.key),ce=Cv(n,e),ne=(Me,xe)=>{Me&&Hr(Me,r,9,xe)},Q=(Me,xe)=>{const Oe=xe[1];ne(Me,xe),Ke(Me)?Me.every(J=>J.length<=1)&&Oe():Me.length<=1&&Oe()},me={mode:i,persisted:a,beforeEnter(Me){let xe=l;if(!n.isMounted)if(s)xe=H||l;else return;Me[Qr]&&Me[Qr](!0);const Oe=ce[z];Oe&&Ns(e,Oe)&&Oe.el[Qr]&&Oe.el[Qr](),ne(xe,[Me])},enter(Me){if(ce[z]===e)return;let xe=u,Oe=d,J=f;if(!n.isMounted)if(s)xe=R||u,Oe=O||d,J=W||f;else return;let de=!1;Me[ea]=Fe=>{de||(de=!0,Fe?ne(J,[Me]):ne(Oe,[Me]),me.delayedLeave&&me.delayedLeave(),Me[ea]=void 0)};const Re=Me[ea].bind(null,!1);xe?Q(xe,[Me,Re]):Re()},leave(Me,xe){const Oe=String(e.key);if(Me[ea]&&Me[ea](!0),n.isUnmounting)return xe();ne(g,[Me]);let J=!1;Me[Qr]=Re=>{J||(J=!0,xe(),Re?ne(A,[Me]):ne(k,[Me]),Me[Qr]=void 0,ce[Oe]===e&&delete ce[Oe])};const de=Me[Qr].bind(null,!1);ce[Oe]=e,y?Q(y,[Me,de]):de()},clone(Me){const xe=Fd(Me,t,n,r,o);return o&&o(xe),xe}};return me}function Du(e){if(ja(e))return e=rs(e),e.children=null,e}function Vp(e){if(!ja(e))return Tv(e.type)&&e.children?Iv(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&et(n.default))return n.default()}}function wa(e,t){e.shapeFlag&6&&e.component?(e.transition=t,wa(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Av(e,t=!1,n){let r=[],o=0;for(let s=0;s<e.length;s++){let i=e[s];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:s);i.type===Je?(i.patchFlag&128&&o++,r=r.concat(Av(i.children,t,a))):(t||i.type!==Ln)&&r.push(a!=null?rs(i,{key:a}):i)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function In(e,t){return et(e)?dn({name:e.name},t,{setup:e}):e}function Bf(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function zp(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const oc=new WeakMap;function da(e,t,n,r,o=!1){if(Ke(e)){e.forEach((A,H)=>da(A,t&&(Ke(t)?t[H]:t),n,r,o));return}if(vi(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&da(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Nc(r.component):r.el,i=o?null:s,{i:a,r:l}=e,u=t&&t.r,d=a.refs===Ot?a.refs={}:a.refs,f=a.setupState,g=Et(f),y=f===Ot?Wg:A=>zp(d,A)?!1:Rt(g,A),k=(A,H)=>!(H&&zp(d,H));if(u!=null&&u!==l){if(Gp(t),Wt(u))d[u]=null,y(u)&&(f[u]=null);else if(jn(u)){const A=t;k(u,A.k)&&(u.value=null),A.k&&(d[A.k]=null)}}if(et(l))La(l,a,12,[i,d]);else{const A=Wt(l),H=jn(l);if(A||H){const R=()=>{if(e.f){const O=A?y(l)?f[l]:d[l]:k()||!e.k?l.value:d[e.k];if(o)Ke(O)&&xf(O,s);else if(Ke(O))O.includes(s)||O.push(s);else if(A)d[l]=[s],y(l)&&(f[l]=d[l]);else{const W=[s];k(l,e.k)&&(l.value=W),e.k&&(d[e.k]=W)}}else A?(d[l]=i,y(l)&&(f[l]=i)):H&&(k(l,e.k)&&(l.value=i),e.k&&(d[e.k]=i))};if(i){const O=()=>{R(),oc.delete(e)};O.id=-1,oc.set(e,O),zn(O,n)}else Gp(e),R()}}}function Gp(e){const t=oc.get(e);t&&(t.flags|=8,oc.delete(e))}const Kp=e=>e.nodeType===8;Cc().requestIdleCallback;Cc().cancelIdleCallback;function rS(e,t){if(Kp(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Kp(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const vi=e=>!!e.type.__asyncLoader;function ju(e){et(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:i,suspensible:a=!0,onError:l}=e;let u=null,d,f=0;const g=()=>(f++,u=null,y()),y=()=>{let k;return u||(k=u=t().catch(A=>{if(A=A instanceof Error?A:new Error(String(A)),l)return new Promise((H,R)=>{l(A,()=>H(g()),()=>R(A),f+1)});throw A}).then(A=>k!==u&&u?u:(A&&(A.__esModule||A[Symbol.toStringTag]==="Module")&&(A=A.default),d=A,A)))};return In({name:"AsyncComponentWrapper",__asyncLoader:y,__asyncHydrate(k,A,H){let R=!1;(A.bu||(A.bu=[])).push(()=>R=!0);const O=()=>{R||H()},W=s?()=>{const z=s(O,ce=>rS(k,ce));z&&(A.bum||(A.bum=[])).push(z)}:O;d?W():y().then(()=>!A.isUnmounted&&W())},get __asyncResolved(){return d},setup(){const k=En;if(Bf(k),d)return()=>Al(d,k);const A=W=>{u=null,Da(W,k,13,!r)};if(a&&k.suspense||wi)return y().then(W=>()=>Al(W,k)).catch(W=>(A(W),()=>r?We(r,{error:W}):null));const H=N(!1),R=N(),O=N(!!o);return o&&setTimeout(()=>{O.value=!1},o),i!=null&&setTimeout(()=>{if(!H.value&&!R.value){const W=new Error(`Async component timed out after ${i}ms.`);A(W),R.value=W}},i),y().then(()=>{H.value=!0,k.parent&&ja(k.parent.vnode)&&k.parent.update()}).catch(W=>{A(W),R.value=W}),()=>{if(H.value&&d)return Al(d,k);if(R.value&&r)return We(r,{error:R.value});if(n&&!O.value)return Al(n,k)}}})}function Al(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=We(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const ja=e=>e.type.__isKeepAlive;function oS(e,t){xv(e,"a",t)}function sS(e,t){xv(e,"da",t)}function xv(e,t,n=En){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Rc(t,r,n),n){let o=n.parent;for(;o&&o.parent;)ja(o.parent.vnode)&&iS(r,t,n,o),o=o.parent}}function iS(e,t,n,r){const o=Rc(t,e,r,!0);Mc(()=>{xf(r[t],o)},n)}function Rc(e,t,n=En,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{Ao();const a=Fa(n),l=Hr(t,n,e,i);return a(),xo(),l});return r?o.unshift(s):o.push(s),s}}const Lo=e=>(t,n=En)=>{(!wi||e==="sp")&&Rc(e,(...r)=>t(...r),n)},aS=Lo("bm"),ls=Lo("m"),lS=Lo("bu"),cS=Lo("u"),zs=Lo("bum"),Mc=Lo("um"),uS=Lo("sp"),dS=Lo("rtg"),fS=Lo("rtc");function pS(e,t=En){Rc("ec",e,t)}const hS="components",Rv=Symbol.for("v-ndc");function Uf(e){return Wt(e)?mS(hS,e,!1)||e:e||Rv}function mS(e,t,n=!0,r=!1){const o=kn||En;if(o){const s=o.type;{const a=ZS(s,!1);if(a&&(a===t||a===Jn(t)||a===kc(Jn(t))))return s}const i=Yp(o[e]||s[e],t)||Yp(o.appContext[e],t);return!i&&r?s:i}}function Yp(e,t){return e&&(e[t]||e[Jn(t)]||e[kc(Jn(t))])}function Dt(e,t,n,r){let o;const s=n,i=Ke(e);if(i||Wt(e)){const a=i&&Fs(e);let l=!1,u=!1;a&&(l=!kr(e),u=Ro(e),e=Ac(e)),o=new Array(e.length);for(let d=0,f=e.length;d<f;d++)o[d]=t(l?u?bi(qr(e[d])):qr(e[d]):e[d],d,void 0,s)}else if(typeof e=="number"){o=new Array(e);for(let a=0;a<e;a++)o[a]=t(a+1,a,void 0,s)}else if(Mt(e))if(e[Symbol.iterator])o=Array.from(e,(a,l)=>t(a,l,void 0,s));else{const a=Object.keys(e);o=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const d=a[l];o[l]=t(e[d],d,l,s)}}else o=[];return o}function no(e,t,n={},r,o){if(kn.ce||kn.parent&&vi(kn.parent)&&kn.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),mt(Je,null,[We("slot",n,r)],u?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),x();const i=s&&Mv(s(n)),a=n.key||i&&i.key,l=mt(Je,{key:(a&&!Ur(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function Mv(e){return e.some(t=>Ta(t)?!(t.type===Ln||t.type===Je&&!Mv(t.children)):!0)?e:null}const Bd=e=>e?Xv(e)?Nc(e):Bd(e.parent):null,fa=dn(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Bd(e.parent),$root:e=>Bd(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>$v(e),$forceUpdate:e=>e.f||(e.f=()=>{Ff(e.update)}),$nextTick:e=>e.n||(e.n=Yt.bind(e.proxy)),$watch:e=>Jw.bind(e)}),Fu=(e,t)=>e!==Ot&&!e.__isScriptSetup&&Rt(e,t),gS={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:s,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const g=i[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(Fu(r,t))return i[t]=1,r[t];if(o!==Ot&&Rt(o,t))return i[t]=2,o[t];if(Rt(s,t))return i[t]=3,s[t];if(n!==Ot&&Rt(n,t))return i[t]=4,n[t];Ud&&(i[t]=0)}}const u=fa[t];let d,f;if(u)return t==="$attrs"&&Nn(e.attrs,"get",""),u(e);if((d=a.__cssModules)&&(d=d[t]))return d;if(n!==Ot&&Rt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,Rt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:s}=e;return Fu(o,t)?(o[t]=n,!0):r!==Ot&&Rt(r,t)?(r[t]=n,!0):Rt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:s,type:i}},a){let l;return!!(n[a]||e!==Ot&&a[0]!=="$"&&Rt(e,a)||Fu(t,a)||Rt(s,a)||Rt(r,a)||Rt(fa,a)||Rt(o.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Rt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function vS(){return yS().slots}function yS(e){const t=zf();return t.setupContext||(t.setupContext=Zv(t))}function Jp(e){return Ke(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ud=!0;function _S(e){const t=$v(e),n=e.proxy,r=e.ctx;Ud=!1,t.beforeCreate&&Xp(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:i,watch:a,provide:l,inject:u,created:d,beforeMount:f,mounted:g,beforeUpdate:y,updated:k,activated:A,deactivated:H,beforeDestroy:R,beforeUnmount:O,destroyed:W,unmounted:z,render:ce,renderTracked:ne,renderTriggered:Q,errorCaptured:me,serverPrefetch:Me,expose:xe,inheritAttrs:Oe,components:J,directives:de,filters:Re}=t;if(u&&bS(u,r,null),i)for(const we in i){const ie=i[we];et(ie)&&(r[we]=ie.bind(n))}if(o){const we=o.call(n,n);Mt(we)&&(e.data=xc(we))}if(Ud=!0,s)for(const we in s){const ie=s[we],Ie=et(ie)?ie.bind(n,n):et(ie.get)?ie.get.bind(n,n):ro,De=!et(ie)&&et(ie.set)?ie.set.bind(n):ro,Pe=oe({get:Ie,set:De});Object.defineProperty(r,we,{enumerable:!0,configurable:!0,get:()=>Pe.value,set:Ve=>Pe.value=Ve})}if(a)for(const we in a)Pv(a[we],r,n,we);if(l){const we=et(l)?l.call(n):l;Reflect.ownKeys(we).forEach(ie=>{Ul(ie,we[ie])})}d&&Xp(d,e,"c");function ve(we,ie){Ke(ie)?ie.forEach(Ie=>we(Ie.bind(n))):ie&&we(ie.bind(n))}if(ve(aS,f),ve(ls,g),ve(lS,y),ve(cS,k),ve(oS,A),ve(sS,H),ve(pS,me),ve(fS,ne),ve(dS,Q),ve(zs,O),ve(Mc,z),ve(uS,Me),Ke(xe))if(xe.length){const we=e.exposed||(e.exposed={});xe.forEach(ie=>{Object.defineProperty(we,ie,{get:()=>n[ie],set:Ie=>n[ie]=Ie,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===ro&&(e.render=ce),Oe!=null&&(e.inheritAttrs=Oe),J&&(e.components=J),de&&(e.directives=de),Me&&Bf(e)}function bS(e,t,n=ro){Ke(e)&&(e=qd(e));for(const r in e){const o=e[r];let s;Mt(o)?"default"in o?s=Br(o.from||r,o.default,!0):s=Br(o.from||r):s=Br(o),jn(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:i=>s.value=i}):t[r]=s}}function Xp(e,t,n){Hr(Ke(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Pv(e,t,n,r){let o=r.includes(".")?wv(n,r):()=>n[r];if(Wt(e)){const s=t[e];et(s)&&ct(o,s)}else if(et(e))ct(o,e.bind(n));else if(Mt(e))if(Ke(e))e.forEach(s=>Pv(s,t,n,r));else{const s=et(e.handler)?e.handler.bind(n):t[e.handler];et(s)&&ct(o,s,e)}}function $v(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,a=s.get(t);let l;return a?l=a:!o.length&&!n&&!r?l=t:(l={},o.length&&o.forEach(u=>sc(l,u,i,!0)),sc(l,t,i)),Mt(t)&&s.set(t,l),l}function sc(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&sc(e,s,n,!0),o&&o.forEach(i=>sc(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=wS[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const wS={data:Qp,props:Zp,emits:Zp,methods:ia,computed:ia,beforeCreate:Vn,created:Vn,beforeMount:Vn,mounted:Vn,beforeUpdate:Vn,updated:Vn,beforeDestroy:Vn,beforeUnmount:Vn,destroyed:Vn,unmounted:Vn,activated:Vn,deactivated:Vn,errorCaptured:Vn,serverPrefetch:Vn,components:ia,directives:ia,watch:TS,provide:Qp,inject:SS};function Qp(e,t){return t?e?function(){return dn(et(e)?e.call(this,this):e,et(t)?t.call(this,this):t)}:t:e}function SS(e,t){return ia(qd(e),qd(t))}function qd(e){if(Ke(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Vn(e,t){return e?[...new Set([].concat(e,t))]:t}function ia(e,t){return e?dn(Object.create(null),e,t):t}function Zp(e,t){return e?Ke(e)&&Ke(t)?[...new Set([...e,...t])]:dn(Object.create(null),Jp(e),Jp(t??{})):t}function TS(e,t){if(!e)return t;if(!t)return e;const n=dn(Object.create(null),e);for(const r in t)n[r]=Vn(e[r],t[r]);return n}function Nv(){return{app:null,config:{isNativeTag:Wg,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let ES=0;function kS(e,t){return function(r,o=null){et(r)||(r=dn({},r)),o!=null&&!Mt(o)&&(o=null);const s=Nv(),i=new WeakSet,a=[];let l=!1;const u=s.app={_uid:ES++,_component:r,_props:o,_container:null,_context:s,_instance:null,version:tT,get config(){return s.config},set config(d){},use(d,...f){return i.has(d)||(d&&et(d.install)?(i.add(d),d.install(u,...f)):et(d)&&(i.add(d),d(u,...f))),u},mixin(d){return s.mixins.includes(d)||s.mixins.push(d),u},component(d,f){return f?(s.components[d]=f,u):s.components[d]},directive(d,f){return f?(s.directives[d]=f,u):s.directives[d]},mount(d,f,g){if(!l){const y=u._ceVNode||We(r,o);return y.appContext=s,g===!0?g="svg":g===!1&&(g=void 0),e(y,d,g),l=!0,u._container=d,d.__vue_app__=u,Nc(y.component)}},onUnmount(d){a.push(d)},unmount(){l&&(Hr(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(d,f){return s.provides[d]=f,u},runWithContext(d){const f=yi;yi=u;try{return d()}finally{yi=f}}};return u}}let yi=null;const IS=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Jn(t)}Modifiers`]||e[`${as(t)}Modifiers`];function CS(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Ot;let o=n;const s=t.startsWith("update:"),i=s&&IS(r,t.slice(7));i&&(i.trim&&(o=n.map(d=>Wt(d)?d.trim():d)),i.number&&(o=n.map(Ic)));let a,l=r[a=Pu(t)]||r[a=Pu(Jn(t))];!l&&s&&(l=r[a=Pu(as(t))]),l&&Hr(l,e,6,o);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Hr(u,e,6,o)}}const AS=new WeakMap;function Ov(e,t,n=!1){const r=n?AS:t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let i={},a=!1;if(!et(e)){const l=u=>{const d=Ov(u,t,!0);d&&(a=!0,dn(i,d))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(Mt(e)&&r.set(e,null),null):(Ke(s)?s.forEach(l=>i[l]=null):dn(i,s),Mt(e)&&r.set(e,i),i)}function Pc(e,t){return!e||!Sc(t)?!1:(t=t.slice(2).replace(/Once$/,""),Rt(e,t[0].toLowerCase()+t.slice(1))||Rt(e,as(t))||Rt(e,t))}function eh(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:l,render:u,renderCache:d,props:f,data:g,setupState:y,ctx:k,inheritAttrs:A}=e,H=rc(e);let R,O;try{if(n.shapeFlag&4){const z=o||r,ce=z;R=eo(u.call(ce,z,d,f,y,g,k)),O=a}else{const z=t;R=eo(z.length>1?z(f,{attrs:a,slots:i,emit:l}):z(f,null)),O=t.props?a:xS(a)}}catch(z){pa.length=0,Da(z,e,1),R=We(Ln)}let W=R;if(O&&A!==!1){const z=Object.keys(O),{shapeFlag:ce}=W;z.length&&ce&7&&(s&&z.some(Tc)&&(O=RS(O,s)),W=rs(W,O,!1,!0))}return n.dirs&&(W=rs(W,null,!1,!0),W.dirs=W.dirs?W.dirs.concat(n.dirs):n.dirs),n.transition&&wa(W,n.transition),R=W,rc(H),R}const xS=e=>{let t;for(const n in e)(n==="class"||n==="style"||Sc(n))&&((t||(t={}))[n]=e[n]);return t},RS=(e,t)=>{const n={};for(const r in e)(!Tc(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function MS(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:a,patchFlag:l}=t,u=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?th(r,i,u):!!i;if(l&8){const d=t.dynamicProps;for(let f=0;f<d.length;f++){const g=d[f];if(Lv(i,r,g)&&!Pc(u,g))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?th(r,i,u):!0:!!i;return!1}function th(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const s=r[o];if(Lv(t,e,s)&&!Pc(n,s))return!0}return!1}function Lv(e,t,n){const r=e[n],o=t[n];return n==="style"&&Mt(r)&&Mt(o)?!Pi(r,o):r!==o}function PS({vnode:e,parent:t,suspense:n},r){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=r,e=o),o===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Dv={},jv=()=>Object.create(Dv),Fv=e=>Object.getPrototypeOf(e)===Dv;function $S(e,t,n,r=!1){const o={},s=jv();e.propsDefaults=Object.create(null),Bv(e,t,o,s);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=r?o:fv(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function NS(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:i}}=e,a=Et(o),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const d=e.vnode.dynamicProps;for(let f=0;f<d.length;f++){let g=d[f];if(Pc(e.emitsOptions,g))continue;const y=t[g];if(l)if(Rt(s,g))y!==s[g]&&(s[g]=y,u=!0);else{const k=Jn(g);o[k]=Hd(l,a,k,y,e,!1)}else y!==s[g]&&(s[g]=y,u=!0)}}}else{Bv(e,t,o,s)&&(u=!0);let d;for(const f in a)(!t||!Rt(t,f)&&((d=as(f))===f||!Rt(t,d)))&&(l?n&&(n[f]!==void 0||n[d]!==void 0)&&(o[f]=Hd(l,a,f,void 0,e,!0)):delete o[f]);if(s!==a)for(const f in s)(!t||!Rt(t,f))&&(delete s[f],u=!0)}u&&wo(e.attrs,"set","")}function Bv(e,t,n,r){const[o,s]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(aa(l))continue;const u=t[l];let d;o&&Rt(o,d=Jn(l))?!s||!s.includes(d)?n[d]=u:(a||(a={}))[d]=u:Pc(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(s){const l=Et(n),u=a||Ot;for(let d=0;d<s.length;d++){const f=s[d];n[f]=Hd(o,l,f,u[f],e,!Rt(u,f))}}return i}function Hd(e,t,n,r,o,s){const i=e[n];if(i!=null){const a=Rt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&et(l)){const{propsDefaults:u}=o;if(n in u)r=u[n];else{const d=Fa(o);r=u[n]=l.call(null,t),d()}}else r=l;o.ce&&o.ce._setProp(n,r)}i[0]&&(s&&!a?r=!1:i[1]&&(r===""||r===as(n))&&(r=!0))}return r}const OS=new WeakMap;function Uv(e,t,n=!1){const r=n?OS:t.propsCache,o=r.get(e);if(o)return o;const s=e.props,i={},a=[];let l=!1;if(!et(e)){const d=f=>{l=!0;const[g,y]=Uv(f,t,!0);dn(i,g),y&&a.push(...y)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!s&&!l)return Mt(e)&&r.set(e,hi),hi;if(Ke(s))for(let d=0;d<s.length;d++){const f=Jn(s[d]);nh(f)&&(i[f]=Ot)}else if(s)for(const d in s){const f=Jn(d);if(nh(f)){const g=s[d],y=i[f]=Ke(g)||et(g)?{type:g}:dn({},g),k=y.type;let A=!1,H=!0;if(Ke(k))for(let R=0;R<k.length;++R){const O=k[R],W=et(O)&&O.name;if(W==="Boolean"){A=!0;break}else W==="String"&&(H=!1)}else A=et(k)&&k.name==="Boolean";y[0]=A,y[1]=H,(A||Rt(y,"default"))&&a.push(f)}}const u=[i,a];return Mt(e)&&r.set(e,u),u}function nh(e){return e[0]!=="$"&&!aa(e)}const qf=e=>e==="_"||e==="_ctx"||e==="$stable",Hf=e=>Ke(e)?e.map(eo):[eo(e)],LS=(e,t,n)=>{if(t._n)return t;const r=At((...o)=>Hf(t(...o)),n);return r._c=!1,r},qv=(e,t,n)=>{const r=e._ctx;for(const o in e){if(qf(o))continue;const s=e[o];if(et(s))t[o]=LS(o,s,r);else if(s!=null){const i=Hf(s);t[o]=()=>i}}},Hv=(e,t)=>{const n=Hf(t);e.slots.default=()=>n},Wv=(e,t,n)=>{for(const r in t)(n||!qf(r))&&(e[r]=t[r])},DS=(e,t,n)=>{const r=e.slots=jv();if(e.vnode.shapeFlag&32){const o=t._;o?(Wv(r,t,n),n&&Kg(r,"_",o,!0)):qv(t,r)}else t&&Hv(e,t)},jS=(e,t,n)=>{const{vnode:r,slots:o}=e;let s=!0,i=Ot;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:Wv(o,t,n):(s=!t.$stable,qv(t,o)),i=t}else t&&(Hv(e,t),i={default:1});if(s)for(const a in o)!qf(a)&&i[a]==null&&delete o[a]},zn=HS;function FS(e){return BS(e)}function BS(e,t){const n=Cc();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:i,createText:a,createComment:l,setText:u,setElementText:d,parentNode:f,nextSibling:g,setScopeId:y=ro,insertStaticContent:k}=e,A=(E,I,q,Z=null,X=null,Y=null,se=void 0,pe=null,ue=!!I.dynamicChildren)=>{if(E===I)return;E&&!Ns(E,I)&&(Z=G(E),Ve(E,X,Y,!0),E=null),I.patchFlag===-2&&(ue=!1,I.dynamicChildren=null);const{type:ee,ref:Ne,shapeFlag:Se}=I;switch(ee){case $c:H(E,I,q,Z);break;case Ln:R(E,I,q,Z);break;case Uu:E==null&&O(I,q,Z,se);break;case Je:J(E,I,q,Z,X,Y,se,pe,ue);break;default:Se&1?ce(E,I,q,Z,X,Y,se,pe,ue):Se&6?de(E,I,q,Z,X,Y,se,pe,ue):(Se&64||Se&128)&&ee.process(E,I,q,Z,X,Y,se,pe,ue,je)}Ne!=null&&X?da(Ne,E&&E.ref,Y,I||E,!I):Ne==null&&E&&E.ref!=null&&da(E.ref,null,Y,E,!0)},H=(E,I,q,Z)=>{if(E==null)r(I.el=a(I.children),q,Z);else{const X=I.el=E.el;I.children!==E.children&&u(X,I.children)}},R=(E,I,q,Z)=>{E==null?r(I.el=l(I.children||""),q,Z):I.el=E.el},O=(E,I,q,Z)=>{[E.el,E.anchor]=k(E.children,I,q,Z,E.el,E.anchor)},W=({el:E,anchor:I},q,Z)=>{let X;for(;E&&E!==I;)X=g(E),r(E,q,Z),E=X;r(I,q,Z)},z=({el:E,anchor:I})=>{let q;for(;E&&E!==I;)q=g(E),o(E),E=q;o(I)},ce=(E,I,q,Z,X,Y,se,pe,ue)=>{if(I.type==="svg"?se="svg":I.type==="math"&&(se="mathml"),E==null)ne(I,q,Z,X,Y,se,pe,ue);else{const ee=E.el&&E.el._isVueCE?E.el:null;try{ee&&ee._beginPatch(),Me(E,I,X,Y,se,pe,ue)}finally{ee&&ee._endPatch()}}},ne=(E,I,q,Z,X,Y,se,pe)=>{let ue,ee;const{props:Ne,shapeFlag:Se,transition:_e,dirs:Ae}=E;if(ue=E.el=i(E.type,Y,Ne&&Ne.is,Ne),Se&8?d(ue,E.children):Se&16&&me(E.children,ue,null,Z,X,Bu(E,Y),se,pe),Ae&&Es(E,null,Z,"created"),Q(ue,E,E.scopeId,se,Z),Ne){for(const $ in Ne)$!=="value"&&!aa($)&&s(ue,$,null,Ne[$],Y,Z);"value"in Ne&&s(ue,"value",null,Ne.value,Y),(ee=Ne.onVnodeBeforeMount)&&Jr(ee,Z,E)}Ae&&Es(E,null,Z,"beforeMount");const P=US(X,_e);P&&_e.beforeEnter(ue),r(ue,I,q),((ee=Ne&&Ne.onVnodeMounted)||P||Ae)&&zn(()=>{try{ee&&Jr(ee,Z,E),P&&_e.enter(ue),Ae&&Es(E,null,Z,"mounted")}finally{}},X)},Q=(E,I,q,Z,X)=>{if(q&&y(E,q),Z)for(let Y=0;Y<Z.length;Y++)y(E,Z[Y]);if(X){let Y=X.subTree;if(I===Y||Gv(Y.type)&&(Y.ssContent===I||Y.ssFallback===I)){const se=X.vnode;Q(E,se,se.scopeId,se.slotScopeIds,X.parent)}}},me=(E,I,q,Z,X,Y,se,pe,ue=0)=>{for(let ee=ue;ee<E.length;ee++){const Ne=E[ee]=pe?bo(E[ee]):eo(E[ee]);A(null,Ne,I,q,Z,X,Y,se,pe)}},Me=(E,I,q,Z,X,Y,se)=>{const pe=I.el=E.el;let{patchFlag:ue,dynamicChildren:ee,dirs:Ne}=I;ue|=E.patchFlag&16;const Se=E.props||Ot,_e=I.props||Ot;let Ae;if(q&&Is(q,!1),(Ae=_e.onVnodeBeforeUpdate)&&Jr(Ae,q,I,E),Ne&&Es(I,E,q,"beforeUpdate"),q&&Is(q,!0),(Se.innerHTML&&_e.innerHTML==null||Se.textContent&&_e.textContent==null)&&d(pe,""),ee?xe(E.dynamicChildren,ee,pe,q,Z,Bu(I,X),Y):se||ie(E,I,pe,null,q,Z,Bu(I,X),Y,!1),ue>0){if(ue&16)Oe(pe,Se,_e,q,X);else if(ue&2&&Se.class!==_e.class&&s(pe,"class",null,_e.class,X),ue&4&&s(pe,"style",Se.style,_e.style,X),ue&8){const P=I.dynamicProps;for(let $=0;$<P.length;$++){const j=P[$],K=Se[j],ae=_e[j];(ae!==K||j==="value")&&s(pe,j,K,ae,X,q)}}ue&1&&E.children!==I.children&&d(pe,I.children)}else!se&&ee==null&&Oe(pe,Se,_e,q,X);((Ae=_e.onVnodeUpdated)||Ne)&&zn(()=>{Ae&&Jr(Ae,q,I,E),Ne&&Es(I,E,q,"updated")},Z)},xe=(E,I,q,Z,X,Y,se)=>{for(let pe=0;pe<I.length;pe++){const ue=E[pe],ee=I[pe],Ne=ue.el&&(ue.type===Je||!Ns(ue,ee)||ue.shapeFlag&198)?f(ue.el):q;A(ue,ee,Ne,null,Z,X,Y,se,!0)}},Oe=(E,I,q,Z,X)=>{if(I!==q){if(I!==Ot)for(const Y in I)!aa(Y)&&!(Y in q)&&s(E,Y,I[Y],null,X,Z);for(const Y in q){if(aa(Y))continue;const se=q[Y],pe=I[Y];se!==pe&&Y!=="value"&&s(E,Y,pe,se,X,Z)}"value"in q&&s(E,"value",I.value,q.value,X)}},J=(E,I,q,Z,X,Y,se,pe,ue)=>{const ee=I.el=E?E.el:a(""),Ne=I.anchor=E?E.anchor:a("");let{patchFlag:Se,dynamicChildren:_e,slotScopeIds:Ae}=I;Ae&&(pe=pe?pe.concat(Ae):Ae),E==null?(r(ee,q,Z),r(Ne,q,Z),me(I.children||[],q,Ne,X,Y,se,pe,ue)):Se>0&&Se&64&&_e&&E.dynamicChildren&&E.dynamicChildren.length===_e.length?(xe(E.dynamicChildren,_e,q,X,Y,se,pe),(I.key!=null||X&&I===X.subTree)&&Wf(E,I,!0)):ie(E,I,q,Ne,X,Y,se,pe,ue)},de=(E,I,q,Z,X,Y,se,pe,ue)=>{I.slotScopeIds=pe,E==null?I.shapeFlag&512?X.ctx.activate(I,q,Z,se,ue):Re(I,q,Z,X,Y,se,ue):Fe(E,I,ue)},Re=(E,I,q,Z,X,Y,se)=>{const pe=E.component=YS(E,Z,X);if(ja(E)&&(pe.ctx.renderer=je),JS(pe,!1,se),pe.asyncDep){if(X&&X.registerDep(pe,ve,se),!E.el){const ue=pe.subTree=We(Ln);R(null,ue,I,q),E.placeholder=ue.el}}else ve(pe,E,I,q,X,Y,se)},Fe=(E,I,q)=>{const Z=I.component=E.component;if(MS(E,I,q))if(Z.asyncDep&&!Z.asyncResolved){we(Z,I,q);return}else Z.next=I,Z.update();else I.el=E.el,Z.vnode=I},ve=(E,I,q,Z,X,Y,se)=>{const pe=()=>{if(E.isMounted){let{next:Se,bu:_e,u:Ae,parent:P,vnode:$}=E;{const Ue=Vv(E);if(Ue){Se&&(Se.el=$.el,we(E,Se,se)),Ue.asyncDep.then(()=>{zn(()=>{E.isUnmounted||ee()},X)});return}}let j=Se,K;Is(E,!1),Se?(Se.el=$.el,we(E,Se,se)):Se=$,_e&&Bl(_e),(K=Se.props&&Se.props.onVnodeBeforeUpdate)&&Jr(K,P,Se,$),Is(E,!0);const ae=eh(E),$e=E.subTree;E.subTree=ae,A($e,ae,f($e.el),G($e),E,X,Y),Se.el=ae.el,j===null&&PS(E,ae.el),Ae&&zn(Ae,X),(K=Se.props&&Se.props.onVnodeUpdated)&&zn(()=>Jr(K,P,Se,$),X)}else{let Se;const{el:_e,props:Ae}=I,{bm:P,m:$,parent:j,root:K,type:ae}=E,$e=vi(I);Is(E,!1),P&&Bl(P),!$e&&(Se=Ae&&Ae.onVnodeBeforeMount)&&Jr(Se,j,I),Is(E,!0);{K.ce&&K.ce._hasShadowRoot()&&K.ce._injectChildStyle(ae,E.parent?E.parent.type:void 0);const Ue=E.subTree=eh(E);A(null,Ue,q,Z,E,X,Y),I.el=Ue.el}if($&&zn($,X),!$e&&(Se=Ae&&Ae.onVnodeMounted)){const Ue=I;zn(()=>Jr(Se,j,Ue),X)}(I.shapeFlag&256||j&&vi(j.vnode)&&j.vnode.shapeFlag&256)&&E.a&&zn(E.a,X),E.isMounted=!0,I=q=Z=null}};E.scope.on();const ue=E.effect=new Qg(pe);E.scope.off();const ee=E.update=ue.run.bind(ue),Ne=E.job=ue.runIfDirty.bind(ue);Ne.i=E,Ne.id=E.uid,ue.scheduler=()=>Ff(Ne),Is(E,!0),ee()},we=(E,I,q)=>{I.component=E;const Z=E.vnode.props;E.vnode=I,E.next=null,NS(E,I.props,Z,q),jS(E,I.children,q),Ao(),qp(E),xo()},ie=(E,I,q,Z,X,Y,se,pe,ue=!1)=>{const ee=E&&E.children,Ne=E?E.shapeFlag:0,Se=I.children,{patchFlag:_e,shapeFlag:Ae}=I;if(_e>0){if(_e&128){De(ee,Se,q,Z,X,Y,se,pe,ue);return}else if(_e&256){Ie(ee,Se,q,Z,X,Y,se,pe,ue);return}}Ae&8?(Ne&16&&Ye(ee,X,Y),Se!==ee&&d(q,Se)):Ne&16?Ae&16?De(ee,Se,q,Z,X,Y,se,pe,ue):Ye(ee,X,Y,!0):(Ne&8&&d(q,""),Ae&16&&me(Se,q,Z,X,Y,se,pe,ue))},Ie=(E,I,q,Z,X,Y,se,pe,ue)=>{E=E||hi,I=I||hi;const ee=E.length,Ne=I.length,Se=Math.min(ee,Ne);let _e;for(_e=0;_e<Se;_e++){const Ae=I[_e]=ue?bo(I[_e]):eo(I[_e]);A(E[_e],Ae,q,null,X,Y,se,pe,ue)}ee>Ne?Ye(E,X,Y,!0,!1,Se):me(I,q,Z,X,Y,se,pe,ue,Se)},De=(E,I,q,Z,X,Y,se,pe,ue)=>{let ee=0;const Ne=I.length;let Se=E.length-1,_e=Ne-1;for(;ee<=Se&&ee<=_e;){const Ae=E[ee],P=I[ee]=ue?bo(I[ee]):eo(I[ee]);if(Ns(Ae,P))A(Ae,P,q,null,X,Y,se,pe,ue);else break;ee++}for(;ee<=Se&&ee<=_e;){const Ae=E[Se],P=I[_e]=ue?bo(I[_e]):eo(I[_e]);if(Ns(Ae,P))A(Ae,P,q,null,X,Y,se,pe,ue);else break;Se--,_e--}if(ee>Se){if(ee<=_e){const Ae=_e+1,P=Ae<Ne?I[Ae].el:Z;for(;ee<=_e;)A(null,I[ee]=ue?bo(I[ee]):eo(I[ee]),q,P,X,Y,se,pe,ue),ee++}}else if(ee>_e)for(;ee<=Se;)Ve(E[ee],X,Y,!0),ee++;else{const Ae=ee,P=ee,$=new Map;for(ee=P;ee<=_e;ee++){const $t=I[ee]=ue?bo(I[ee]):eo(I[ee]);$t.key!=null&&$.set($t.key,ee)}let j,K=0;const ae=_e-P+1;let $e=!1,Ue=0;const nt=new Array(ae);for(ee=0;ee<ae;ee++)nt[ee]=0;for(ee=Ae;ee<=Se;ee++){const $t=E[ee];if(K>=ae){Ve($t,X,Y,!0);continue}let bt;if($t.key!=null)bt=$.get($t.key);else for(j=P;j<=_e;j++)if(nt[j-P]===0&&Ns($t,I[j])){bt=j;break}bt===void 0?Ve($t,X,Y,!0):(nt[bt-P]=ee+1,bt>=Ue?Ue=bt:$e=!0,A($t,I[bt],q,null,X,Y,se,pe,ue),K++)}const rt=$e?qS(nt):hi;for(j=rt.length-1,ee=ae-1;ee>=0;ee--){const $t=P+ee,bt=I[$t],on=I[$t+1],tt=$t+1<Ne?on.el||zv(on):Z;nt[ee]===0?A(null,bt,q,tt,X,Y,se,pe,ue):$e&&(j<0||ee!==rt[j]?Pe(bt,q,tt,2):j--)}}},Pe=(E,I,q,Z,X=null)=>{const{el:Y,type:se,transition:pe,children:ue,shapeFlag:ee}=E;if(ee&6){Pe(E.component.subTree,I,q,Z);return}if(ee&128){E.suspense.move(I,q,Z);return}if(ee&64){se.move(E,I,q,je);return}if(se===Je){r(Y,I,q);for(let Se=0;Se<ue.length;Se++)Pe(ue[Se],I,q,Z);r(E.anchor,I,q);return}if(se===Uu){W(E,I,q);return}if(Z!==2&&ee&1&&pe)if(Z===0)pe.beforeEnter(Y),r(Y,I,q),zn(()=>pe.enter(Y),X);else{const{leave:Se,delayLeave:_e,afterLeave:Ae}=pe,P=()=>{E.ctx.isUnmounted?o(Y):r(Y,I,q)},$=()=>{Y._isLeaving&&Y[Qr](!0),Se(Y,()=>{P(),Ae&&Ae()})};_e?_e(Y,P,$):$()}else r(Y,I,q)},Ve=(E,I,q,Z=!1,X=!1)=>{const{type:Y,props:se,ref:pe,children:ue,dynamicChildren:ee,shapeFlag:Ne,patchFlag:Se,dirs:_e,cacheIndex:Ae,memo:P}=E;if(Se===-2&&(X=!1),pe!=null&&(Ao(),da(pe,null,q,E,!0),xo()),Ae!=null&&(I.renderCache[Ae]=void 0),Ne&256){I.ctx.deactivate(E);return}const $=Ne&1&&_e,j=!vi(E);let K;if(j&&(K=se&&se.onVnodeBeforeUnmount)&&Jr(K,I,E),Ne&6)at(E.component,q,Z);else{if(Ne&128){E.suspense.unmount(q,Z);return}$&&Es(E,null,I,"beforeUnmount"),Ne&64?E.type.remove(E,I,q,je,Z):ee&&!ee.hasOnce&&(Y!==Je||Se>0&&Se&64)?Ye(ee,I,q,!1,!0):(Y===Je&&Se&384||!X&&Ne&16)&&Ye(ue,I,q),Z&&ze(E)}const ae=P!=null&&Ae==null;(j&&(K=se&&se.onVnodeUnmounted)||$||ae)&&zn(()=>{K&&Jr(K,I,E),$&&Es(E,null,I,"unmounted"),ae&&(E.el=null)},q)},ze=E=>{const{type:I,el:q,anchor:Z,transition:X}=E;if(I===Je){Ge(q,Z);return}if(I===Uu){z(E);return}const Y=()=>{o(q),X&&!X.persisted&&X.afterLeave&&X.afterLeave()};if(E.shapeFlag&1&&X&&!X.persisted){const{leave:se,delayLeave:pe}=X,ue=()=>se(q,Y);pe?pe(E.el,Y,ue):ue()}else Y()},Ge=(E,I)=>{let q;for(;E!==I;)q=g(E),o(E),E=q;o(I)},at=(E,I,q)=>{const{bum:Z,scope:X,job:Y,subTree:se,um:pe,m:ue,a:ee}=E;rh(ue),rh(ee),Z&&Bl(Z),X.stop(),Y&&(Y.flags|=8,Ve(se,E,I,q)),pe&&zn(pe,I),zn(()=>{E.isUnmounted=!0},I)},Ye=(E,I,q,Z=!1,X=!1,Y=0)=>{for(let se=Y;se<E.length;se++)Ve(E[se],I,q,Z,X)},G=E=>{if(E.shapeFlag&6)return G(E.component.subTree);if(E.shapeFlag&128)return E.suspense.next();const I=g(E.anchor||E.el),q=I&&I[Sv];return q?g(q):I};let be=!1;const fe=(E,I,q)=>{let Z;E==null?I._vnode&&(Ve(I._vnode,null,null,!0),Z=I._vnode.component):A(I._vnode||null,E,I,null,null,null,q),I._vnode=E,be||(be=!0,qp(Z),vv(),be=!1)},je={p:A,um:Ve,m:Pe,r:ze,mt:Re,mc:me,pc:ie,pbc:xe,n:G,o:e};return{render:fe,hydrate:void 0,createApp:kS(fe)}}function Bu({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Is({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function US(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Wf(e,t,n=!1){const r=e.children,o=t.children;if(Ke(r)&&Ke(o))for(let s=0;s<r.length;s++){const i=r[s];let a=o[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[s]=bo(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&Wf(i,a)),a.type===$c&&(a.patchFlag===-1&&(a=o[s]=bo(a)),a.el=i.el),a.type===Ln&&!a.el&&(a.el=i.el)}}function qS(e){const t=e.slice(),n=[0];let r,o,s,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(o=n[n.length-1],e[o]<u){t[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)a=s+i>>1,e[n[a]]<u?s=a+1:i=a;u<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,i=n[s-1];s-- >0;)n[s]=i,i=t[i];return n}function Vv(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Vv(t)}function rh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function zv(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?zv(t.subTree):null}const Gv=e=>e.__isSuspense;function HS(e,t){t&&t.pendingBranch?Ke(e)?t.effects.push(...e):t.effects.push(e):Gw(e)}const Je=Symbol.for("v-fgt"),$c=Symbol.for("v-txt"),Ln=Symbol.for("v-cmt"),Uu=Symbol.for("v-stc"),pa=[];let pr=null;function x(e=!1){pa.push(pr=e?null:[])}function WS(){pa.pop(),pr=pa[pa.length-1]||null}let Sa=1;function ic(e,t=!1){Sa+=e,e<0&&pr&&t&&(pr.hasOnce=!0)}function Kv(e){return e.dynamicChildren=Sa>0?pr||hi:null,WS(),Sa>0&&pr&&pr.push(e),e}function L(e,t,n,r,o,s){return Kv(b(e,t,n,r,o,s,!0))}function mt(e,t,n,r,o){return Kv(We(e,t,n,r,o,!0))}function Ta(e){return e?e.__v_isVNode===!0:!1}function Ns(e,t){return e.type===t.type&&e.key===t.key}const Yv=({key:e})=>e??null,ql=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Wt(e)||jn(e)||et(e)?{i:kn,r:e,k:t,f:!!n}:e:null);function b(e,t=null,n=null,r=0,o=null,s=e===Je?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Yv(t),ref:t&&ql(t),scopeId:_v,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:kn};return a?(Vf(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=Wt(n)?8:16),Sa>0&&!i&&pr&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&pr.push(l),l}const We=VS;function VS(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===Rv)&&(e=Ln),Ta(e)){const a=rs(e,t,!0);return n&&Vf(a,n),Sa>0&&!s&&pr&&(a.shapeFlag&6?pr[pr.indexOf(e)]=a:pr.push(a)),a.patchFlag=-2,a}if(eT(e)&&(e=e.__vccOpts),t){t=zS(t);let{class:a,style:l}=t;a&&!Wt(a)&&(t.class=ht(a)),Mt(l)&&(jf(l)&&!Ke(l)&&(l=dn({},l)),t.style=To(l))}const i=Wt(e)?1:Gv(e)?128:Tv(e)?64:Mt(e)?4:et(e)?2:0;return b(e,t,n,r,o,i,s,!0)}function zS(e){return e?jf(e)||Fv(e)?dn({},e):e:null}function rs(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:l}=e,u=t?Jv(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Yv(u),ref:t&&t.ref?n&&s?Ke(s)?s.concat(ql(t)):[s,ql(t)]:ql(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Je?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&rs(e.ssContent),ssFallback:e.ssFallback&&rs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&wa(d,l.clone(d)),d}function Bs(e=" ",t=0){return We($c,null,e,t)}function he(e="",t=!1){return t?(x(),mt(Ln,null,e)):We(Ln,null,e)}function eo(e){return e==null||typeof e=="boolean"?We(Ln):Ke(e)?We(Je,null,e.slice()):Ta(e)?bo(e):We($c,null,String(e))}function bo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:rs(e)}function Vf(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Ke(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Vf(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Fv(t)?t._ctx=kn:o===3&&kn&&(kn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else et(t)?(t={default:t,_ctx:kn},n=32):(t=String(t),r&64?(n=16,t=[Bs(t)]):n=8);e.children=t,e.shapeFlag|=n}function Jv(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=ht([t.class,r.class]));else if(o==="style")t.style=To([t.style,r.style]);else if(Sc(o)){const s=t[o],i=r[o];i&&s!==i&&!(Ke(s)&&s.includes(i))?t[o]=s?[].concat(s,i):i:i==null&&s==null&&!Tc(o)&&(t[o]=i)}else o!==""&&(t[o]=r[o])}return t}function Jr(e,t,n,r=null){Hr(e,t,7,[n,r])}const GS=Nv();let KS=0;function YS(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||GS,s={uid:KS++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new vw(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Uv(r,o),emitsOptions:Ov(r,o),emit:null,emitted:null,propsDefaults:Ot,inheritAttrs:r.inheritAttrs,ctx:Ot,data:Ot,props:Ot,attrs:Ot,slots:Ot,refs:Ot,setupState:Ot,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=CS.bind(null,s),e.ce&&e.ce(s),s}let En=null;const zf=()=>En||kn;let ac,Wd;{const e=Cc(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};ac=t("__VUE_INSTANCE_SETTERS__",n=>En=n),Wd=t("__VUE_SSR_SETTERS__",n=>wi=n)}const Fa=e=>{const t=En;return ac(e),e.scope.on(),()=>{e.scope.off(),ac(t)}},oh=()=>{En&&En.scope.off(),ac(null)};function Xv(e){return e.vnode.shapeFlag&4}let wi=!1;function JS(e,t=!1,n=!1){t&&Wd(t);const{props:r,children:o}=e.vnode,s=Xv(e);$S(e,r,s,t),DS(e,o,n||t);const i=s?XS(e,t):void 0;return t&&Wd(!1),i}function XS(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,gS);const{setup:r}=n;if(r){Ao();const o=e.setupContext=r.length>1?Zv(e):null,s=Fa(e),i=La(r,e,0,[e.props,o]),a=Vg(i);if(xo(),s(),(a||e.sp)&&!vi(e)&&Bf(e),a){if(i.then(oh,oh),t)return i.then(l=>{sh(e,l)}).catch(l=>{Da(l,e,0)});e.asyncDep=i}else sh(e,i)}else Qv(e)}function sh(e,t,n){et(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Mt(t)&&(e.setupState=hv(t)),Qv(e)}function Qv(e,t,n){const r=e.type;e.render||(e.render=r.render||ro);{const o=Fa(e);Ao();try{_S(e)}finally{xo(),o()}}}const QS={get(e,t){return Nn(e,"get",""),e[t]}};function Zv(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,QS),slots:e.slots,emit:e.emit,expose:t}}function Nc(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(hv(Dw(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in fa)return fa[n](e)},has(t,n){return n in t||n in fa}})):e.proxy}function ZS(e,t=!0){return et(e)?e.displayName||e.name:e.name||t&&e.__name}function eT(e){return et(e)&&"__vccOpts"in e}const oe=(e,t)=>qw(e,t,wi);function Gf(e,t,n){try{ic(-1);const r=arguments.length;return r===2?Mt(t)&&!Ke(t)?Ta(t)?We(e,null,[t]):We(e,t):We(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ta(n)&&(n=[n]),We(e,t,n))}finally{ic(1)}}const tT="3.5.32";/**
15
- * @vue/runtime-dom v3.5.32
16
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
17
- * @license MIT
18
- **/let Vd;const ih=typeof window<"u"&&window.trustedTypes;if(ih)try{Vd=ih.createPolicy("vue",{createHTML:e=>e})}catch{}const ey=Vd?e=>Vd.createHTML(e):e=>e,nT="http://www.w3.org/2000/svg",rT="http://www.w3.org/1998/Math/MathML",yo=typeof document<"u"?document:null,ah=yo&&yo.createElement("template"),oT={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?yo.createElementNS(nT,e):t==="mathml"?yo.createElementNS(rT,e):n?yo.createElement(e,{is:n}):yo.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>yo.createTextNode(e),createComment:e=>yo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yo.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const i=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{ah.innerHTML=ey(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=ah.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Wo="transition",ta="animation",Ea=Symbol("_vtc"),ty={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},sT=dn({},Ev,ty),iT=e=>(e.displayName="Transition",e.props=sT,e),ny=iT((e,{slots:t})=>Gf(nS,aT(e),t)),Cs=(e,t=[])=>{Ke(e)?e.forEach(n=>n(...t)):e&&e(...t)},lh=e=>e?Ke(e)?e.some(t=>t.length>1):e.length>1:!1;function aT(e){const t={};for(const J in e)J in ty||(t[J]=e[J]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:u=i,appearToClass:d=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:y=`${n}-leave-to`}=e,k=lT(o),A=k&&k[0],H=k&&k[1],{onBeforeEnter:R,onEnter:O,onEnterCancelled:W,onLeave:z,onLeaveCancelled:ce,onBeforeAppear:ne=R,onAppear:Q=O,onAppearCancelled:me=W}=t,Me=(J,de,Re,Fe)=>{J._enterCancelled=Fe,As(J,de?d:a),As(J,de?u:i),Re&&Re()},xe=(J,de)=>{J._isLeaving=!1,As(J,f),As(J,y),As(J,g),de&&de()},Oe=J=>(de,Re)=>{const Fe=J?Q:O,ve=()=>Me(de,J,Re);Cs(Fe,[de,ve]),ch(()=>{As(de,J?l:s),mo(de,J?d:a),lh(Fe)||uh(de,r,A,ve)})};return dn(t,{onBeforeEnter(J){Cs(R,[J]),mo(J,s),mo(J,i)},onBeforeAppear(J){Cs(ne,[J]),mo(J,l),mo(J,u)},onEnter:Oe(!1),onAppear:Oe(!0),onLeave(J,de){J._isLeaving=!0;const Re=()=>xe(J,de);mo(J,f),J._enterCancelled?(mo(J,g),ph(J)):(ph(J),mo(J,g)),ch(()=>{J._isLeaving&&(As(J,f),mo(J,y),lh(z)||uh(J,r,H,Re))}),Cs(z,[J,Re])},onEnterCancelled(J){Me(J,!1,void 0,!0),Cs(W,[J])},onAppearCancelled(J){Me(J,!0,void 0,!0),Cs(me,[J])},onLeaveCancelled(J){xe(J),Cs(ce,[J])}})}function lT(e){if(e==null)return null;if(Mt(e))return[qu(e.enter),qu(e.leave)];{const t=qu(e);return[t,t]}}function qu(e){return cw(e)}function mo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Ea]||(e[Ea]=new Set)).add(t)}function As(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Ea];n&&(n.delete(t),n.size||(e[Ea]=void 0))}function ch(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let cT=0;function uh(e,t,n,r){const o=e._endId=++cT,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:a,propCount:l}=uT(e,t);if(!i)return r();const u=i+"end";let d=0;const f=()=>{e.removeEventListener(u,g),s()},g=y=>{y.target===e&&++d>=l&&f()};setTimeout(()=>{d<l&&f()},a+1),e.addEventListener(u,g)}function uT(e,t){const n=window.getComputedStyle(e),r=k=>(n[k]||"").split(", "),o=r(`${Wo}Delay`),s=r(`${Wo}Duration`),i=dh(o,s),a=r(`${ta}Delay`),l=r(`${ta}Duration`),u=dh(a,l);let d=null,f=0,g=0;t===Wo?i>0&&(d=Wo,f=i,g=s.length):t===ta?u>0&&(d=ta,f=u,g=l.length):(f=Math.max(i,u),d=f>0?i>u?Wo:ta:null,g=d?d===Wo?s.length:l.length:0);const y=d===Wo&&/\b(?:transform|all)(?:,|$)/.test(r(`${Wo}Property`).toString());return{type:d,timeout:f,propCount:g,hasTransform:y}}function dh(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>fh(n)+fh(e[r])))}function fh(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ph(e){return(e?e.ownerDocument:document).body.offsetHeight}function dT(e,t,n){const r=e[Ea];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const hh=Symbol("_vod"),fT=Symbol("_vsh"),pT=Symbol(""),hT=/(?:^|;)\s*display\s*:/;function mT(e,t,n){const r=e.style,o=Wt(n);let s=!1;if(n&&!o){if(t)if(Wt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Hl(r,a,"")}else for(const i in t)n[i]==null&&Hl(r,i,"");for(const i in n)i==="display"&&(s=!0),Hl(r,i,n[i])}else if(o){if(t!==n){const i=r[pT];i&&(n+=";"+i),r.cssText=n,s=hT.test(n)}}else t&&e.removeAttribute("style");hh in e&&(e[hh]=s?r.display:"",e[fT]&&(r.display="none"))}const mh=/\s*!important$/;function Hl(e,t,n){if(Ke(n))n.forEach(r=>Hl(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=gT(e,t);mh.test(n)?e.setProperty(as(r),n.replace(mh,""),"important"):e[r]=n}}const gh=["Webkit","Moz","ms"],Hu={};function gT(e,t){const n=Hu[t];if(n)return n;let r=Jn(t);if(r!=="filter"&&r in e)return Hu[t]=r;r=kc(r);for(let o=0;o<gh.length;o++){const s=gh[o]+r;if(s in e)return Hu[t]=s}return t}const vh="http://www.w3.org/1999/xlink";function yh(e,t,n,r,o,s=mw(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(vh,t.slice(6,t.length)):e.setAttributeNS(vh,t,n):n==null||s&&!Yg(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Ur(n)?String(n):n)}function _h(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ey(n):n);return}const s=e.tagName;if(t==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Yg(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function Qo(e,t,n,r){e.addEventListener(t,n,r)}function vT(e,t,n,r){e.removeEventListener(t,n,r)}const bh=Symbol("_vei");function yT(e,t,n,r,o=null){const s=e[bh]||(e[bh]={}),i=s[t];if(r&&i)i.value=r;else{const[a,l]=_T(t);if(r){const u=s[t]=ST(r,o);Qo(e,a,u,l)}else i&&(vT(e,a,i,l),s[t]=void 0)}}const wh=/(?:Once|Passive|Capture)$/;function _T(e){let t;if(wh.test(e)){t={};let r;for(;r=e.match(wh);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):as(e.slice(2)),t]}let Wu=0;const bT=Promise.resolve(),wT=()=>Wu||(bT.then(()=>Wu=0),Wu=Date.now());function ST(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Hr(TT(r,n.value),t,5,[r])};return n.value=e,n.attached=wT(),n}function TT(e,t){if(Ke(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const Sh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ET=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?dT(e,r,i):t==="style"?mT(e,n,r):Sc(t)?Tc(t)||yT(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):kT(e,t,r,i))?(_h(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&yh(e,t,r,i,s,t!=="value")):e._isVueCE&&(IT(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Wt(r)))?_h(e,Jn(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),yh(e,t,r,i))};function kT(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Sh(t)&&et(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Sh(t)&&Wt(n)?!1:t in e}function IT(e,t){const n=e._def.props;if(!n)return!1;const r=Jn(t);return Array.isArray(n)?n.some(o=>Jn(o)===r):Object.keys(n).some(o=>Jn(o)===r)}const Si=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ke(t)?n=>Bl(t,n):t};function CT(e){e.target.composing=!0}function Th(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Eo=Symbol("_assign");function Eh(e,t,n){return t&&(e=e.trim()),n&&(e=Ic(e)),e}const ir={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[Eo]=Si(o);const s=r||o.props&&o.props.type==="number";Qo(e,t?"change":"input",i=>{i.target.composing||e[Eo](Eh(e.value,n,s))}),(n||s)&&Qo(e,"change",()=>{e.value=Eh(e.value,n,s)}),t||(Qo(e,"compositionstart",CT),Qo(e,"compositionend",Th),Qo(e,"change",Th))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(e[Eo]=Si(i),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?Ic(e.value):e.value,l=t??"";if(a===l)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===l)||(e.value=l)}},AT={deep:!0,created(e,t,n){e[Eo]=Si(n),Qo(e,"change",()=>{const r=e._modelValue,o=ka(e),s=e.checked,i=e[Eo];if(Ke(r)){const a=Mf(r,o),l=a!==-1;if(s&&!l)i(r.concat(o));else if(!s&&l){const u=[...r];u.splice(a,1),i(u)}}else if(Mi(r)){const a=new Set(r);s?a.add(o):a.delete(o),i(a)}else i(ry(e,s))})},mounted:kh,beforeUpdate(e,t,n){e[Eo]=Si(n),kh(e,t,n)}};function kh(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(Ke(t))o=Mf(t,r.props.value)>-1;else if(Mi(t))o=t.has(r.props.value);else{if(t===n)return;o=Pi(t,ry(e,!0))}e.checked!==o&&(e.checked=o)}const n2={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=Mi(t);Qo(e,"change",()=>{const s=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?Ic(ka(i)):ka(i));e[Eo](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,Yt(()=>{e._assigning=!1})}),e[Eo]=Si(r)},mounted(e,{value:t}){Ih(e,t)},beforeUpdate(e,t,n){e[Eo]=Si(n)},updated(e,{value:t}){e._assigning||Ih(e,t)}};function Ih(e,t){const n=e.multiple,r=Ke(t);if(!(n&&!r&&!Mi(t))){for(let o=0,s=e.options.length;o<s;o++){const i=e.options[o],a=ka(i);if(n)if(r){const l=typeof a;l==="string"||l==="number"?i.selected=t.some(u=>String(u)===String(a)):i.selected=Mf(t,a)>-1}else i.selected=t.has(a);else if(Pi(ka(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ka(e){return"_value"in e?e._value:e.value}function ry(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const xT=["ctrl","shift","alt","meta"],RT={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>xT.some(n=>e[`${n}Key`]&&!t.includes(n))},pt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((o,...s)=>{for(let i=0;i<t.length;i++){const a=RT[t[i]];if(a&&a(o,t))return}return e(o,...s)}))},MT={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},en=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(o=>{if(!("key"in o))return;const s=as(o.key);if(t.some(i=>i===s||MT[i]===s))return e(o)}))},PT=dn({patchProp:ET},oT);let Ch;function $T(){return Ch||(Ch=FS(PT))}const NT=((...e)=>{const t=$T().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=LT(r);if(!o)return;const s=t._component;!et(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,OT(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function OT(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function LT(e){return Wt(e)?document.querySelector(e):e}const He=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,yt=globalThis,Us="10.48.0";function Gs(){return Oc(yt),yt}function Oc(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Us,t[Us]=t[Us]||{}}function $i(e,t,n=yt){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Us]=r[Us]||{};return o[e]||(o[e]=t())}const DT=["debug","info","warn","error","log","assert","trace"],jT="Sentry Logger ",lc={};function Do(e){if(!("console"in yt))return e();const t=yt.console,n={},r=Object.keys(lc);r.forEach(o=>{const s=lc[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function FT(){Yf().enabled=!0}function BT(){Yf().enabled=!1}function oy(){return Yf().enabled}function UT(...e){Kf("log",...e)}function qT(...e){Kf("warn",...e)}function HT(...e){Kf("error",...e)}function Kf(e,...t){He&&oy()&&Do(()=>{yt.console[e](`${jT}[${e}]:`,...t)})}function Yf(){return He?$i("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Ee={enable:FT,disable:BT,isEnabled:oy,log:UT,warn:qT,error:HT},sy=50,Vs="?",Ah=/\(error: (.*)\)/,xh=/captureMessage|captureException/;function iy(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],i=n.split(`
19
- `);for(let a=r;a<i.length;a++){let l=i[a];l.length>1024&&(l=l.slice(0,1024));const u=Ah.test(l)?l.replace(Ah,"$1"):l;if(!u.includes("Error: ")){for(const d of t){const f=d(u);if(f){s.push(f);break}}if(s.length>=sy+o)break}}return VT(s.slice(o))}}function WT(e){return Array.isArray(e)?iy(...e):e}function VT(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(xl(t).function||"")&&t.pop(),t.reverse(),xh.test(xl(t).function||"")&&(t.pop(),xh.test(xl(t).function||"")&&t.pop()),t.slice(0,sy).map(n=>({...n,filename:n.filename||xl(t).filename,function:n.function||Vs}))}function xl(e){return e[e.length-1]||{}}const Vu="<anonymous>";function Mo(e){try{return!e||typeof e!="function"?Vu:e.name||Vu}catch{return Vu}}function Rh(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function ay(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Wl={},Mh={};function cs(e,t){Wl[e]=Wl[e]||[],Wl[e].push(t)}function us(e,t){if(!Mh[e]){Mh[e]=!0;try{t()}catch(n){He&&Ee.error(`Error while instrumenting ${e}`,n)}}}function Ir(e,t){const n=e&&Wl[e];if(n)for(const r of n)try{r(t)}catch(o){He&&Ee.error(`Error while triggering instrumentation handler.
20
- Type: ${e}
21
- Name: ${Mo(r)}
22
- Error:`,o)}}let zu=null;function ly(e){const t="error";cs(t,e),us(t,zT)}function zT(){zu=yt.onerror,yt.onerror=function(e,t,n,r,o){return Ir("error",{column:r,error:o,line:n,msg:e,url:t}),zu?zu.apply(this,arguments):!1},yt.onerror.__SENTRY_INSTRUMENTED__=!0}let Gu=null;function cy(e){const t="unhandledrejection";cs(t,e),us(t,GT)}function GT(){Gu=yt.onunhandledrejection,yt.onunhandledrejection=function(e){return Ir("unhandledrejection",e),Gu?Gu.apply(this,arguments):!0},yt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const uy=Object.prototype.toString;function Lc(e){switch(uy.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Po(e,Error)}}function Ni(e,t){return uy.call(e)===`[object ${t}]`}function dy(e){return Ni(e,"ErrorEvent")}function Ph(e){return Ni(e,"DOMError")}function KT(e){return Ni(e,"DOMException")}function ko(e){return Ni(e,"String")}function Jf(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ti(e){return e===null||Jf(e)||typeof e!="object"&&typeof e!="function"}function Ia(e){return Ni(e,"Object")}function Dc(e){return typeof Event<"u"&&Po(e,Event)}function YT(e){return typeof Element<"u"&&Po(e,Element)}function JT(e){return Ni(e,"RegExp")}function Oi(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function XT(e){return Ia(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Po(e,t){try{return e instanceof t}catch{return!1}}function fy(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Xf(e){return typeof Request<"u"&&Po(e,Request)}const Qf=yt,QT=80;function Rr(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let s=0,i=0;const a=" > ",l=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||QT;for(;n&&s++<r&&(u=ZT(n,d),!(u==="html"||s>1&&i+o.length*l+u.length>=f));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function ZT(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(Qf.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=t!=null&&t.length?t.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o!=null&&o.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const s=n.className;if(s&&ko(s)){const i=s.split(/\s+/);for(const a of i)r.push(`.${a}`)}}for(const s of["aria-label","type","name","title","alt"]){const i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function Ba(){try{return Qf.document.location.href}catch{return""}}function py(e){if(!Qf.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function hr(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const o=n(r);typeof o=="function"&&hy(o,r);try{e[t]=o}catch{He&&Ee.log(`Failed to replace method "${t}" in object`,e)}}function ar(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{He&&Ee.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function hy(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,ar(e,"__sentry_original__",t)}catch{}}function Zf(e){return e.__sentry_original__}function my(e){if(Lc(e))return{message:e.message,name:e.name,stack:e.stack,...Nh(e)};if(Dc(e)){const t={type:e.type,target:$h(e.target),currentTarget:$h(e.currentTarget),...Nh(e)};return typeof CustomEvent<"u"&&Po(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function $h(e){try{return YT(e)?Rr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Nh(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function e0(e){const t=Object.keys(my(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let oi;function Ua(e){if(oi!==void 0)return oi?oi(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=yt;return t in n&&typeof n[t]=="function"?(oi=n[t],oi(e)):(oi=null,e())}function Zo(){return Ua(()=>Math.random())}function qa(){return Ua(()=>Date.now())}function zd(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Oh(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const o=e[r];try{fy(o)?n.push(ay(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Vl(e,t,n=!1){return ko(e)?JT(t)?t.test(e):ko(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function es(e,t=[],n=!1){return t.some(r=>Vl(e,r,n))}function t0(){const e=yt;return e.crypto||e.msCrypto}let Ku;function n0(){return Zo()*16}function Cr(e=t0()){try{if(e!=null&&e.randomUUID)return Ua(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Ku||(Ku="10000000100040008000"+1e11),Ku.replace(/[018]/g,t=>(t^(n0()&15)>>t/4).toString(16))}function gy(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Os(e){const{message:t,event_id:n}=e;if(t)return t;const r=gy(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Gd(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function Ei(e,t){const n=gy(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){const s={...o==null?void 0:o.data,...t.data};n.mechanism.data=s}}function Lh(e){if(r0(e))return!0;try{ar(e,"__sentry_captured__",!0)}catch{}return!1}function r0(e){try{return e.__sentry_captured__}catch{}}const vy=1e3;function Ks(){return qa()/vy}function o0(){const{performance:e}=yt;if(!(e!=null&&e.now)||!e.timeOrigin)return Ks;const t=e.timeOrigin;return()=>(t+Ua(()=>e.now()))/vy}let Dh;function tn(){return(Dh??(Dh=o0()))()}let Yu=null;function s0(){var i;const{performance:e}=yt;if(!(e!=null&&e.now))return;const t=3e5,n=Ua(()=>e.now()),r=qa(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;const s=(i=e.timing)==null?void 0:i.navigationStart;return typeof s=="number"&&Math.abs(s+n-r)<t?s:r-n}function Mr(){return Yu===null&&(Yu=s0()),Yu}function i0(e){const t=tn(),n={sid:Cr(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>l0(n)};return e&&ki(n,e),n}function ki(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||tn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Cr()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function a0(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),ki(e,n)}function l0(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Ha(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Ha(r[o],t[o],n-1));return r}function $o(){return Cr()}function Io(){return Cr().substring(16)}const Kd="_sentrySpan";function Ii(e,t){t?ar(e,Kd,t):delete e[Kd]}function cc(e){return e[Kd]}const c0=100;class oo{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:$o(),sampleRand:Zo()}}clone(){const t=new oo;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Ii(t,cc(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ki(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof oo?n.getScopeData():Ia(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:l,level:u,fingerprint:d=[],propagationContext:f,conversationId:g}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),d.length&&(this._fingerprint=d),f&&(this._propagationContext=f),g&&(this._conversationId=g),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Ii(this,void 0),this._attachments=[],this.setPropagationContext({traceId:$o(),sampleRand:Zo()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var s;const r=typeof n=="number"?n:c0;if(r<=0)return this;const o={timestamp:Ks(),...t,message:t.message?zd(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(s=this._client)==null||s.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:cc(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Ha(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||Cr();if(!this._client)return He&&Ee.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=(r==null?void 0:r.event_id)||Cr();if(!this._client)return He&&Ee.warn("No client configured on scope - will not capture message!"),o;const s=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){const r=t.event_id||(n==null?void 0:n.event_id)||Cr();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(He&&Ee.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function u0(){return $i("defaultCurrentScope",()=>new oo)}function d0(){return $i("defaultIsolationScope",()=>new oo)}const jh=e=>e instanceof Promise&&!e[yy],yy=Symbol("chained PromiseLike"),_y=(e,t,n)=>{const r=e.then(o=>(t(o),o),o=>{throw n(o),o});return jh(r)&&jh(e)?r:f0(e,r)},f0=(e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[yy]:!0}),t};class p0{constructor(t,n){let r;t?r=t:r=new oo;let o;n?o=n:o=new oo,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return Oi(r)?_y(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Ci(){const e=Gs(),t=Oc(e);return t.stack=t.stack||new p0(u0(),d0())}function h0(e){return Ci().withScope(e)}function m0(e,t){const n=Ci();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Fh(e){return Ci().withScope(()=>e(Ci().getIsolationScope()))}function g0(){return{withIsolationScope:Fh,withScope:h0,withSetScope:m0,withSetIsolationScope:(e,t)=>Fh(t),getCurrentScope:()=>Ci().getScope(),getIsolationScope:()=>Ci().getIsolationScope()}}function Li(e){const t=Oc(e);return t.acs?t.acs:g0()}function Nt(){const e=Gs();return Li(e).getCurrentScope()}function Vr(){const e=Gs();return Li(e).getIsolationScope()}function v0(){return $i("globalScope",()=>new oo)}function jc(...e){const t=Gs(),n=Li(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function Pt(){return Nt().getClient()}function y0(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||Io()};return r&&(s.parent_span_id=r),s}const Er="sentry.source",ep="sentry.sample_rate",by="sentry.previous_trace_sample_rate",No="sentry.op",Jt="sentry.origin",Ca="sentry.idle_span_finish_reason",Wa="sentry.measurement_unit",Va="sentry.measurement_value",Bh="sentry.custom_span_name",tp="sentry.profile_id",Di="sentry.exclusive_time",_0="sentry.link.type",b0="gen_ai.conversation.id",wy=0,Fc=1,cn=2;function w0(e){if(e<400&&e>=100)return{code:Fc};if(e>=400&&e<500)switch(e){case 401:return{code:cn,message:"unauthenticated"};case 403:return{code:cn,message:"permission_denied"};case 404:return{code:cn,message:"not_found"};case 409:return{code:cn,message:"already_exists"};case 413:return{code:cn,message:"failed_precondition"};case 429:return{code:cn,message:"resource_exhausted"};case 499:return{code:cn,message:"cancelled"};default:return{code:cn,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:cn,message:"unimplemented"};case 503:return{code:cn,message:"unavailable"};case 504:return{code:cn,message:"deadline_exceeded"};default:return{code:cn,message:"internal_error"}}return{code:cn,message:"internal_error"}}function Sy(e,t){e.setAttribute("http.response.status_code",t);const n=w0(t);n.message!=="unknown_error"&&e.setStatus(n)}const Ty="_sentryScope",Ey="_sentryIsolationScope";function S0(e){try{const t=yt.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function T0(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function E0(e,t,n){e&&(ar(e,Ey,S0(n)),ar(e,Ty,t))}function uc(e){const t=e;return{scope:t[Ty],isolationScope:T0(t[Ey])}}const dc="sentry-",k0=8192;function ky(e){const t=C0(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(dc)){const i=o.slice(dc.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function I0(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${dc}${r}`]=o),n),{});return A0(t)}function C0(e){if(!(!e||!ko(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Uh(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):Uh(e)}function Uh(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function A0(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${t},${s}`;return i.length>k0?(He&&Ee.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}const x0=/^o(\d+)\./,R0=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function M0(e){return e==="http"||e==="https"}function ji(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function P0(e){const t=R0.exec(e);if(!t){Do(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",i="",a=""]=t.slice(1);let l="",u=a;const d=u.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),u=d.pop()),u){const f=u.match(/^\d+/);f&&(u=f[0])}return Iy({host:s,pass:o,path:l,projectId:u,port:i,protocol:n,publicKey:r})}function Iy(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function $0(e){if(!He)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(Ee.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?M0(r)?t&&isNaN(parseInt(t,10))?(Ee.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Ee.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Ee.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function N0(e){const t=e.match(x0);return t==null?void 0:t[1]}function O0(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=N0(n)),r}function L0(e){const t=typeof e=="string"?P0(e):Iy(e);if(!(!t||!$0(t)))return t}function Aa(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const Cy=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function D0(e){if(!e)return;const t=e.match(Cy);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function j0(e,t){const n=D0(e),r=ky(t);if(!(n!=null&&n.traceId))return{traceId:$o(),sampleRand:Zo()};const o=F0(n,r);r&&(r.sample_rand=o.toString());const{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function Ay(e=$o(),t=Io(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function xy(e=$o(),t=Io(),n){return`00-${e}-${t}-${n?"01":"00"}`}function F0(e,t){const n=Aa(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=Aa(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?Zo()*r:r+Zo()*(1-r):Zo()}const Ry=0,Bc=1;let qh=!1;function B0(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:l}=St(e);return{parent_span_id:s,span_id:t,trace_id:n,data:r,op:o,status:i,origin:a,links:l}}function U0(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:St(e).parent_span_id,s=uc(e).scope,i=r?(s==null?void 0:s.getPropagationContext().propagationSpanId)||Io():t;return{parent_span_id:o,span_id:i,trace_id:n}}function q0(e){const{traceId:t,spanId:n}=e.spanContext(),r=ds(e);return Ay(t,n,r)}function H0(e){const{traceId:t,spanId:n}=e.spanContext(),r=ds(e);return xy(t,n,r)}function My(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===Bc,attributes:s,...o}))}function W0(e){if(e!=null&&e.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Bc,attributes:o}))}function qs(e){return typeof e=="number"?Hh(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Hh(e.getTime()):tn()}function Hh(e){return e>9999999999?e/1e3:e}function St(e){if(G0(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(z0(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:l}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:V0(e),start_timestamp:qs(o),timestamp:qs(i)||void 0,status:Py(a),op:r[No],origin:r[Jt],links:My(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function V0(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(t=e.parentSpanContext)==null?void 0:t.spanId:void 0}function z0(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function G0(e){return typeof e.getSpanJSON=="function"}function ds(e){const{traceFlags:t}=e.spanContext();return t===Bc}function Py(e){if(!(!e||e.code===wy))return e.code===Fc?"ok":e.message||"internal_error"}function K0(e){return!e||e.code===Fc||e.code===wy||e.message==="cancelled"?"ok":"error"}const Hs="_sentryChildSpans",Yd="_sentryRootSpan";function $y(e,t){const n=e[Yd]||e;ar(t,Yd,n),e[Hs]?e[Hs].add(t):ar(e,Hs,new Set([t]))}function Y0(e,t){e[Hs]&&e[Hs].delete(t)}function zl(e){const t=new Set;function n(r){if(!t.has(r)&&ds(r)){t.add(r);const o=r[Hs]?Array.from(r[Hs]):[];for(const s of o)n(s)}}return n(e),Array.from(t)}const Dn=J0;function J0(e){return e[Yd]||e}function lr(){const e=Gs(),t=Li(e);return t.getActiveSpan?t.getActiveSpan():cc(Nt())}function Jd(){qh||(Do(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),qh=!0)}let Wh=!1;function X0(){if(Wh)return;function e(){const t=lr(),n=t&&Dn(t);if(n){const r="internal_error";He&&Ee.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:cn,message:r})}}e.tag="sentry_tracingErrorCallback",Wh=!0,ly(e),cy(e)}function Ar(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=Pt())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Vh(e){Ee.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function xa(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(Z0(n)){if(Vl(e.description,n))return He&&Vh(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?Vl(e.description,n.name):!0,o=n.op?e.op&&Vl(e.op,n.op):!0;if(r&&o)return He&&Vh(e),!0}return!1}function Q0(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function Z0(e){return typeof e=="string"||e instanceof RegExp}const np="production",Ny="_frozenDsc";function Gl(e,t){ar(e,Ny,t)}function Oy(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||np,release:n.release,public_key:r,trace_id:e,org_id:O0(t)};return t.emit("createDsc",o),o}function Ly(e,t){const n=t.getPropagationContext();return n.dsc||Oy(n.traceId,e)}function os(e){var k;const t=Pt();if(!t)return{};const n=Dn(e),r=St(n),o=r.data,s=n.spanContext().traceState,i=(s==null?void 0:s.get("sentry.sample_rate"))??o[ep]??o[by];function a(A){return(typeof i=="number"||typeof i=="string")&&(A.sample_rate=`${i}`),A}const l=n[Ny];if(l)return a(l);const u=s==null?void 0:s.get("sentry.dsc"),d=u&&ky(u);if(d)return a(d);const f=Oy(e.spanContext().traceId,t),g=o[Er]??o["sentry.span.source"],y=r.description;return g!=="url"&&y&&(f.transaction=y),Ar()&&(f.sampled=String(ds(n)),f.sample_rand=(s==null?void 0:s.get("sentry.sample_rand"))??((k=uc(n).scope)==null?void 0:k.getPropagationContext().sampleRand.toString())),a(f),t.emit("createDsc",f,n),f}class xr{constructor(t={}){this._traceId=t.traceId||$o(),this._spanId=t.spanId||Io(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Ry}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Dy(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function _o(e,t=100,n=1/0){try{return Xd("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function jy(e,t=3,n=100*1024){const r=_o(e,t);return rE(r)>n?jy(e,t-1,n):r}function Xd(e,t,n=1/0,r=1/0,o=oE()){const[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=eE(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const l=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(l===0)return a.replace("object ","");if(s(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const y=u.toJSON();return Xd("",y,l-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let f=0;const g=my(t);for(const y in g){if(!Object.prototype.hasOwnProperty.call(g,y))continue;if(f>=r){d[y]="[MaxProperties ~]";break}const k=g[y];d[y]=Xd(y,k,l-1,r,o),f++}return i(t),d}function eE(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(fy(t))return ay(t);if(XT(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Mo(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=tE(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function tE(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function nE(e){return~-encodeURI(e).split(/%..|./).length}function rE(e){return nE(JSON.stringify(e))}function oE(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function Ys(e,t=[]){return[e,t]}function sE(e,t){const[n,r]=e;return[n,[...r,t]]}function Qd(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function iE(e,t){return Qd(e,(n,r)=>t.includes(r))}function Zd(e){const t=Oc(yt);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function aE(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Zd(r),s]:r.push(typeof s=="string"?Zd(s):s)}for(const s of n){const[i,a]=s;if(o(`
23
- ${JSON.stringify(i)}
24
- `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(_o(a))}o(l)}}return typeof r=="string"?r:lE(r)}function lE(e){const t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function cE(e){return[{type:"span"},e]}function uE(e){const t=typeof e.data=="string"?Zd(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Fy={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function dE(e){return e in Fy}function zh(e){return dE(e)?Fy[e]:e}function By(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function fE(e,t,n,r){var s;const o=(s=e.sdkProcessingMetadata)==null?void 0:s.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:ji(r)},...o&&{trace:o}}}function pE(e,t){var r,o,s,i;if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((o=e.sdk)==null?void 0:o.packages)||[],...t.packages||[]],settings:(s=e.sdk)!=null&&s.settings||t.settings?{...(i=e.sdk)==null?void 0:i.settings,...t.settings}:void 0},e}function hE(e,t,n,r){const o=By(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:ji(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Ys(s,[i])}function mE(e,t,n,r){const o=By(n),s=e.type&&e.type!=="replay_event"?e.type:"event";pE(e,n==null?void 0:n.sdk);const i=fE(e,o,r,t);return delete e.sdkProcessingMetadata,Ys(i,[[{type:s},e]])}function gE(e,t){function n(y){return!!y.trace_id&&!!y.public_key}const r=os(e[0]),o=t==null?void 0:t.getDsn(),s=t==null?void 0:t.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:ji(o)}},{beforeSendSpan:a,ignoreSpans:l}=(t==null?void 0:t.getOptions())||{},u=l!=null&&l.length?e.filter(y=>!xa(St(y),l)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const f=a?y=>{const k=St(y),A=Dy(a)?k:a(k);return A||(Jd(),k)}:St,g=[];for(const y of u){const k=f(y);k&&g.push(cE(k))}return Ys(i,g)}function vE(e){if(!He)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=St(e),{spanId:o}=e.spanContext(),s=ds(e),i=Dn(e),a=i===e,l=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){const{op:d,description:f}=St(i);u.push(`root ID: ${i.spanContext().spanId}`),d&&u.push(`root op: ${d}`),f&&u.push(`root description: ${f}`)}Ee.log(`${l}
25
- ${u.join(`
26
- `)}`)}function yE(e){if(!He)return;const{description:t="< unknown name >",op:n="< unknown op >"}=St(e),{spanId:r}=e.spanContext(),s=Dn(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;Ee.log(i)}function _E(e,t,n,r=lr()){const o=r&&Dn(r);o&&(He&&Ee.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[Va]:t,[Wa]:n}))}function Gh(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},o=r[Wa],s=r[Va];typeof o=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:o})}),t}function za(e){return e.getOptions().traceLifecycle==="stream"}const Kh=1e3;class Uc{constructor(t={}){this._traceId=t.traceId||$o(),this._spanId=t.spanId||Io(),this._startTime=t.startTimestamp||tn(),this._links=t.links,this._attributes={},this.setAttributes({[Jt]:"manual",[No]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?Bc:Ry}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=qs(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Er,"custom"),this}end(t){this._endTime||(this._endTime=qs(t),yE(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[No],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Py(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Jt],profile_id:this._attributes[tp],exclusive_time:this._attributes[Di],measurements:Gh(this._events),is_segment:this._isStandaloneSpan&&Dn(this)===this||void 0,segment_id:this._isStandaloneSpan?Dn(this).spanContext().spanId:void 0,links:My(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===Dn(this),status:K0(this._status),attributes:this._attributes,links:W0(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){He&&Ee.log("[Tracing] Adding an event to span:",t);const o=Yh(n)?n:r||tn(),s=Yh(n)?{}:n||{},i={name:t,time:qs(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=Pt();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Dn(this)))return;if(this._isStandaloneSpan){this._sampled?wE(gE([this],t)):(He&&Ee.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&za(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(uc(this).scope||Nt()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!Jh(St(this)))return;this._name||(He&&Ee.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=uc(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const s=zl(this).filter(f=>f!==this&&!bE(f)).map(f=>St(f)).filter(Jh),i=this._attributes[Er];delete this._attributes[Bh],s.forEach(f=>{delete f.data[Bh]});const a={contexts:{trace:B0(this)},spans:s.length>Kh?s.sort((f,g)=>f.start_timestamp-g.start_timestamp).slice(0,Kh):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:os(this)},request:r,...i&&{transaction_info:{source:i}}},l=Gh(this._events);return l&&Object.keys(l).length&&(He&&Ee.log("[Measurements] Adding measurements to transaction event",JSON.stringify(l,void 0,2)),a.measurements=l),a}}function Yh(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Jh(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function bE(e){return e instanceof Uc&&e.isStandaloneSpan()}function wE(e){const t=Pt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function SE(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(s){throw t(s),n(),s}return TE(o,t,n,r)}function TE(e,t,n,r){return Oi(e)?_y(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function EE(e,t,n){if(!Ar(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);const s=Aa(o);if(s===void 0)return He&&Ee.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return He&&Ee.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,s,r];const i=n<s;return i||He&&Ee.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}const kE="__SENTRY_SUPPRESS_TRACING__";function ef(e,t){const n=op();if(n.startSpan)return n.startSpan(e,t);const r=qy(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i==null?void 0:i.clone();return jc(a,()=>CE(s)(()=>{const u=Nt(),d=Hy(u,s),g=e.onlyIfParent&&!d?new xr:Uy({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return(!xE(g)||!d)&&Ii(u,g),SE(()=>t(g),()=>{const{status:y}=St(g);g.isRecording()&&(!y||y==="ok")&&g.setStatus({code:cn,message:"internal_error"})},()=>{g.end()})}))}function ss(e){const t=op();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=qy(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?i=>jc(e.scope,i):o!==void 0?i=>rp(o,i):i=>i())(()=>{const i=Nt(),a=Hy(i,o);return e.onlyIfParent&&!a?new xr:Uy({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}function rp(e,t){const n=op();return n.withActiveSpan?n.withActiveSpan(e,t):jc(r=>(Ii(r,e||void 0),t(r)))}function Uy({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ar()){const a=new xr;if(n||!e){const l={sampled:"false",sample_rate:"0",transaction:t.name,...os(a)};Gl(a,l)}return a}const o=Pt();if(AE(o,t))return sp(r)||o==null||o.recordDroppedEvent("ignored","span"),new xr({dropReason:"ignored",traceId:(e==null?void 0:e.spanContext().traceId)??r.getPropagationContext().traceId});const s=Vr();let i;if(e&&!n)i=IE(e,r,t),$y(e,i);else if(e){const a=os(e),{traceId:l,spanId:u}=e.spanContext(),d=ds(e);i=Xh({traceId:l,parentSpanId:u,...t},r,d),Gl(i,a)}else{const{traceId:a,dsc:l,parentSpanId:u,sampled:d}={...s.getPropagationContext(),...r.getPropagationContext()};i=Xh({traceId:a,parentSpanId:u,...t},r,d),l&&Gl(i,l)}return vE(i),E0(i,r,s),i}function qy(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=qs(e.startTime),delete r.startTime,r}return n}function op(){const e=Gs();return Li(e)}function Xh(e,t,n){var A;const r=Pt(),o=(r==null?void 0:r.getOptions())||{},{name:s=""}=e,i={spanAttributes:{...e.attributes},spanName:s,parentSampled:n};r==null||r.emit("beforeSampling",i,{decision:!1});const a=i.parentSampled??n,l=i.spanAttributes,u=t.getPropagationContext(),d=sp(t),[f,g,y]=d?[!1]:EE(o,{name:s,parentSampled:a,attributes:l,parentSampleRate:Aa((A=u.dsc)==null?void 0:A.sample_rate)},u.sampleRand),k=new Uc({...e,attributes:{[Er]:"custom",[ep]:g!==void 0&&y?g:void 0,...l},sampled:f});return!f&&r&&!d&&(He&&Ee.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",za(r)?"span":"transaction")),r&&r.emit("spanStart",k),k}function IE(e,t,n){const{spanId:r,traceId:o}=e.spanContext(),s=sp(t),i=s?!1:ds(e),a=i?new Uc({...n,parentSpanId:r,traceId:o,sampled:i}):new xr({traceId:o});$y(e,a);const l=Pt();return l&&(za(l)&&a instanceof xr&&(e instanceof xr&&e.dropReason?(a.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,"span")):s||(a.dropReason="sample_rate",l.recordDroppedEvent("sample_rate","span"))),l.emit("spanStart",a),n.endTimestamp&&(l.emit("spanEnd",a),l.emit("afterSpanEnd",a))),a}function Hy(e,t){if(t)return t;if(t===null)return;const n=cc(e);if(!n)return;const r=Pt();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Dn(n):n}function CE(e){return e!==void 0?t=>rp(e,t):t=>t()}function AE(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!za(e)||!(n!=null&&n.length)?!1:xa({description:t.name||"",op:((r=t.attributes)==null?void 0:r[No])||t.op},n)}function xE(e){return e instanceof xr&&e.dropReason==="ignored"}function sp(e){return e.getScopeData().sdkProcessingMetadata[kE]===!0}const Kl={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},RE="heartbeatFailed",ME="idleTimeout",PE="finalTimeout",$E="externalFinish";function Wy(e,t={}){const n=new Map;let r=!1,o,s=$E,i=!t.disableAutoFinish;const a=[],{idleTimeout:l=Kl.idleTimeout,finalTimeout:u=Kl.finalTimeout,childSpanTimeout:d=Kl.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:g=!0}=t,y=Pt();if(!y||!Ar()){const Q=new xr,me={sample_rate:"0",sampled:"false",...os(Q)};return Gl(Q,me),Q}const k=Nt(),A=lr(),H=NE(e);H.end=new Proxy(H.end,{apply(Q,me,Me){if(f&&f(H),me instanceof xr)return;const[xe,...Oe]=Me,J=xe||tn(),de=qs(J),Re=zl(H).filter(De=>De!==H),Fe=St(H);if(!Re.length||!g)return ne(de),Reflect.apply(Q,me,[de,...Oe]);const ve=y.getOptions().ignoreSpans,we=Re==null?void 0:Re.reduce((De,Pe)=>{const Ve=St(Pe);return!Ve.timestamp||ve&&xa(Ve,ve)?De:De?Math.max(De,Ve.timestamp):Ve.timestamp},void 0),ie=Fe.start_timestamp,Ie=Math.min(ie?ie+u/1e3:1/0,Math.max(ie||-1/0,Math.min(de,we||1/0)));return ne(Ie),Reflect.apply(Q,me,[Ie,...Oe])}});function R(){o&&(clearTimeout(o),o=void 0)}function O(Q){R(),o=setTimeout(()=>{!r&&n.size===0&&i&&(s=ME,H.end(Q))},l)}function W(Q){o=setTimeout(()=>{!r&&i&&(s=RE,H.end(Q))},d)}function z(Q){R(),n.set(Q,!0);const me=tn();W(me+d/1e3)}function ce(Q){if(n.has(Q)&&n.delete(Q),n.size===0){const me=tn();O(me+l/1e3)}}function ne(Q){r=!0,n.clear(),a.forEach(Re=>Re()),Ii(k,A);const me=St(H),{start_timestamp:Me}=me;if(!Me)return;me.data[Ca]||H.setAttribute(Ca,s);const Oe=me.status;(!Oe||Oe==="unknown")&&H.setStatus({code:Fc}),Ee.log(`[Tracing] Idle span "${me.op}" finished`);const J=zl(H).filter(Re=>Re!==H);let de=0;J.forEach(Re=>{Re.isRecording()&&(Re.setStatus({code:cn,message:"cancelled"}),Re.end(Q),He&&Ee.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Re,void 0,2)));const Fe=St(Re),{timestamp:ve=0,start_timestamp:we=0}=Fe,ie=we<=Q,Ie=(u+l)/1e3,De=ve-we<=Ie;if(He){const Pe=JSON.stringify(Re,void 0,2);ie?De||Ee.log("[Tracing] Discarding span since it finished after idle span final timeout",Pe):Ee.log("[Tracing] Discarding span since it happened after idle span was finished",Pe)}(!De||!ie)&&(Y0(H,Re),de++)}),de>0&&H.setAttribute("sentry.idle_span_discarded_spans",de)}return a.push(y.on("spanStart",Q=>{if(r||Q===H||St(Q).timestamp||Q instanceof Uc&&Q.isStandaloneSpan())return;zl(H).includes(Q)&&z(Q.spanContext().spanId)})),a.push(y.on("spanEnd",Q=>{r||ce(Q.spanContext().spanId)})),a.push(y.on("idleSpanEnableAutoFinish",Q=>{Q===H&&(i=!0,O(),n.size&&W())})),t.disableAutoFinish||O(),setTimeout(()=>{r||(H.setStatus({code:cn,message:"deadline_exceeded"}),s=PE,H.end())},u),H}function NE(e){const t=ss(e);return Ii(Nt(),t),He&&Ee.log("[Tracing] Started span is an idle span"),t}function OE(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;LE(e,t),r&&FE(e,r),BE(e,n),DE(e,o),jE(e,s)}function Qh(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:l,breadcrumbs:u,fingerprint:d,eventProcessors:f,attachments:g,propagationContext:y,transactionName:k,span:A}=t;na(e,"extra",n),na(e,"tags",r),na(e,"attributes",o),na(e,"user",s),na(e,"contexts",i),e.sdkProcessingMetadata=Ha(e.sdkProcessingMetadata,l,2),a&&(e.level=a),k&&(e.transactionName=k),A&&(e.span=A),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),g.length&&(e.attachments=[...e.attachments,...g]),e.propagationContext={...e.propagationContext,...y}}function na(e,t,n){e[t]=Ha(e[t],n,1)}function Vy(e,t){const n=v0().getScopeData();return e&&Qh(n,e.getScopeData()),t&&Qh(n,t.getScopeData()),n}function LE(e,t){const{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function DE(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function jE(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function FE(e,t){e.contexts={trace:U0(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:os(t),...e.sdkProcessingMetadata};const n=Dn(t),r=St(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function BE(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}const Ju=0,Zh=1,em=2;function Ga(e){return new Ra(t=>{t(e)})}function ip(e){return new Ra((t,n)=>{n(e)})}class Ra{constructor(t){this._state=Ju,this._handlers=[],this._runExecutor(t)}then(t,n){return new Ra((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Ra((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Ju)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Zh&&n[1](this._value),this._state===em&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,i)=>{if(this._state===Ju){if(Oi(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(Zh,s)},o=s=>{n(em,s)};try{t(r,o)}catch(s){o(s)}}}function UE(e,t,n,r=0){try{const o=tf(t,n,e,r);return Oi(o)?o:Ga(o)}catch(o){return ip(o)}}function tf(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return He&&s===null&&Ee.log(`Event processor "${o.id||"?"}" dropped event`),Oi(s)?s.then(i=>tf(i,t,n,r+1)):tf(s,t,n,r+1)}let go,tm,nm,Vo;function qE(e){const t=yt._sentryDebugIds,n=yt._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Vo&&r.length===tm&&o.length===nm)return Vo;tm=r.length,nm=o.length,Vo={},go||(go={});const s=(i,a)=>{for(const l of i){const u=a[l],d=go==null?void 0:go[l];if(d&&Vo&&u)Vo[d[0]]=u,go&&(go[l]=[d[0],u]);else if(u){const f=e(l);for(let g=f.length-1;g>=0;g--){const y=f[g],k=y==null?void 0:y.filename;if(k&&Vo&&go){Vo[k]=u,go[l]=[k,u];break}}}}};return t&&s(r,t),n&&s(o,n),Vo}function HE(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||Cr(),timestamp:t.timestamp||Ks()},u=n.integrations||e.integrations.map(R=>R.name);WE(l,e),GE(l,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&VE(l,e.stackParser);const d=YE(r,n.captureContext);n.mechanism&&Ei(l,n.mechanism);const f=o?o.getEventProcessors():[],g=Vy(s,d),y=[...n.attachments||[],...g.attachments];y.length&&(n.attachments=y),OE(l,g);const k=[...f,...g.eventProcessors];return(n.data&&n.data.__sentry__===!0?Ga(l):UE(k,l,n)).then(R=>(R&&zE(R),typeof i=="number"&&i>0?KE(R,i,a):R))}function WE(e,t){var a,l;const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||np,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const i=e.request;i!=null&&i.url&&s&&(i.url=zd(i.url,s)),s&&((l=(a=e.exception)==null?void 0:a.values)==null||l.forEach(u=>{u.value&&(u.value=zd(u.value,s))}))}function VE(e,t){var r,o;const n=qE(t);(o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(l=>{l.filename&&(l.debug_id=n[l.filename])})})}function zE(e){var r,o;const t={};if((o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(l=>{l.debug_id&&(l.abs_path?t[l.abs_path]=l.debug_id:l.filename&&(t[l.filename]=l.debug_id),delete l.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([s,i])=>{n.push({type:"sourcemap",code_file:s,debug_id:i})})}function GE(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function KE(e,t,n){var o,s;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:_o(i.data,t,n)}}))},...e.user&&{user:_o(e.user,t,n)},...e.contexts&&{contexts:_o(e.contexts,t,n)},...e.extra&&{extra:_o(e.extra,t,n)}};return(o=e.contexts)!=null&&o.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=_o(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>({...i,...i.data&&{data:_o(i.data,t,n)}}))),(s=e.contexts)!=null&&s.flags&&r.contexts&&(r.contexts.flags=_o(e.contexts.flags,3,n)),r}function YE(e,t){if(!t)return e;const n=e?e.clone():new oo;return n.update(t),n}function JE(e){if(e)return XE(e)?{captureContext:e}:ZE(e)?{captureContext:e}:e}function XE(e){return e instanceof oo||typeof e=="function"}const QE=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function ZE(e){return Object.keys(e).some(t=>QE.includes(t))}function ap(e,t){return Nt().captureException(e,JE(t))}function zy(e,t){return Nt().captureEvent(e,t)}function ek(e,t){Vr().setContext(e,t)}function tk(e,t){Vr().setTag(e,t)}function nk(){const e=Pt();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function rm(e){const t=Vr(),{user:n}=Vy(t,Nt()),{userAgent:r}=yt.navigator||{},o=i0({user:n,...r&&{userAgent:r},...e}),s=t.getSession();return(s==null?void 0:s.status)==="ok"&&ki(s,{status:"exited"}),Gy(),t.setSession(o),o}function Gy(){const e=Vr(),n=Nt().getSession()||e.getSession();n&&a0(n),Ky(),e.setSession()}function Ky(){const e=Vr(),t=Pt(),n=e.getSession();n&&t&&t.captureSession(n)}function Xu(e=!1){if(e){Gy();return}Ky()}const rk="7";function ok(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function sk(e){return`${ok(e)}${e.projectId}/envelope/`}function ik(e,t){const n={sentry_version:rk};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function ak(e,t,n){return t||`${sk(e)}?${ik(e,n)}`}const om=[];function lk(e){const t={};return e.forEach(n=>{const{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function ck(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return lk(r)}function uk(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Yy(e,r,n)}),n}function sm(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function Yy(e,t,n){if(n[t.name]){He&&Ee.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!om.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),om.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}He&&Ee.log(`Integration installed: ${t.name}`)}function dk(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function fk(e,t,n,r){const o={};return t!=null&&t.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=ji(r)),Ys(o,[dk(e)])}function nf(e,t){const n=t??pk(e)??[];if(n.length===0)return;const r=e.getOptions(),o=fk(n,r._metadata,r.tunnel,e.getDsn());Jy().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function pk(e){return Jy().get(e)}function Jy(){return $i("clientToLogBufferMap",()=>new WeakMap)}function hk(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function mk(e,t,n,r){const o={};return t!=null&&t.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=ji(r)),Ys(o,[hk(e)])}function Xy(e,t){const n=t??gk(e)??[];if(n.length===0)return;const r=e.getOptions(),o=mk(n,r._metadata,r.tunnel,e.getDsn());Qy().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function gk(e){return Qy().get(e)}function Qy(){return $i("clientToMetricBufferMap",()=>new WeakMap)}function Zy(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const lp=Symbol.for("SentryBufferFullError");function cp(e=100){const t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return ip(lp);const a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return Ga(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;const l=[a,new Promise(u=>Zy(setTimeout(()=>u(!1),i)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:s}}const vk=60*1e3;function yk(e,t=qa()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?vk:r-t}function _k(e,t){return e[t]||e.all||0}function bk(e,t,n=qa()){return _k(e,t)>n}function wk(e,{statusCode:t,headers:n},r=qa()){const o={...e},s=n==null?void 0:n["x-sentry-rate-limits"],i=n==null?void 0:n["retry-after"];if(s)for(const a of s.trim().split(",")){const[l,u,,,d]=a.split(":",5),f=parseInt(l,10),g=(isNaN(f)?60:f)*1e3;if(!u)o.all=r+g;else for(const y of u.split(";"))y==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[y]=r+g):o[y]=r+g}else i?o.all=r+yk(i,r):t===429&&(o.all=r+60*1e3);return o}const e_=64;function Sk(e,t,n=cp(e.bufferSize||e_)){let r={};const o=i=>n.drain(i);function s(i){const a=[];if(Qd(i,(f,g)=>{const y=zh(g);bk(r,y)?e.recordDroppedEvent("ratelimit_backoff",y):a.push(f)}),a.length===0)return Promise.resolve({});const l=Ys(i[0],a),u=f=>{if(iE(l,["client_report"])){He&&Ee.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}Qd(l,(g,y)=>{e.recordDroppedEvent(f,zh(y))})},d=()=>t({body:aE(l)}).then(f=>f.statusCode===413?(He&&Ee.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),f):(He&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&Ee.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=wk(r,f),f),f=>{throw u("network_error"),He&&Ee.error("Encountered error running transport request:",f),f});return n.add(d).then(f=>f,f=>{if(f===lp)return He&&Ee.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw f})}return{send:s,flush:o}}function Tk(e,t,n){const r=[{type:"client_report"},{timestamp:Ks(),discarded_events:e}];return Ys(t?{dsn:t}:{},[r])}function t_(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Ek(e){var l;const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=((l=e.contexts)==null?void 0:l.trace)??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i==null?void 0:i[tp],exclusive_time:i==null?void 0:i[Di],measurements:e.measurements,is_segment:!0}}function kk(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[tp]:e.profile_id},...e.exclusive_time&&{[Di]:e.exclusive_time}}}},measurements:e.measurements}}const im="Not capturing exception because it's already been captured.",am="Discarded session because of missing or non-string release",n_=Symbol.for("SentryInternalError"),r_=Symbol.for("SentryDoNotSendEventError"),Ik=5e3;function Yl(e){return{message:e,[n_]:!0}}function Qu(e){return{message:e,[r_]:!0}}function lm(e){return!!e&&typeof e=="object"&&n_ in e}function cm(e){return!!e&&typeof e=="object"&&r_ in e}function um(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,l=>{s+=r(l),s>=8e5?o(e):a||(a=!0,i=Zy(setTimeout(()=>{o(e)},Ik)))}),e.on("flush",()=>{o(e)})}class Ck{constructor(t){var r,o,s;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=cp(((r=t.transportOptions)==null?void 0:r.bufferSize)??e_),t.dsn?this._dsn=L0(t.dsn):He&&Ee.warn("No DSN provided, client will not send events."),this._dsn){const i=ak(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:i})}this._options.enableLogs=this._options.enableLogs??((o=this._options._experiments)==null?void 0:o.enableLogs),this._options.enableLogs&&um(this,"afterCaptureLog","flushLogs",Mk,nf),(this._options.enableMetrics??((s=this._options._experiments)==null?void 0:s.enableMetrics)??!0)&&um(this,"afterCaptureMetric","flushMetrics",Rk,Xy)}captureException(t,n,r){const o=Cr();if(Lh(t))return He&&Ee.log(im),o;const s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){const s={event_id:Cr(),...r},i=Jf(t)?t:String(t),a=Ti(t),l=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>l.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=Cr();if(n!=null&&n.originalException&&Lh(n.originalException))return He&&Ee.log(im),o;const s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,l=i.capturedSpanIsolationScope,u=dm(t.type);return this._process(()=>this._captureEvent(t,s,a||r,l),u),s.event_id}captureSession(t){this.sendSession(t),ki(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){nf(this);const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Yy(this,t,this._integrations),n||sm(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=mE(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=sE(r,uE(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:r=np}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){He&&Ee.warn(am);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){He&&Ee.warn(am);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=hE(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const o=`${t}:${n}`;He&&Ee.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return He&&Ee.error("Error while sending envelope:",n),{}}return He&&Ee.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=uk(this,t),sm(this,t)}_updateSessionFromEvent(t,n){var l,u;let r=n.level==="fatal",o=!1;const s=(l=n.exception)==null?void 0:l.values;if(s){o=!0,r=!1;for(const d of s)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(ki(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){const s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&(i!=null&&i.length)&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),HE(s,t,n,r,this,o).then(a=>{var u;if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...(u=a.contexts)==null?void 0:u.trace,...y0(r)},...a.contexts};const l=Ly(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=Nt(),o=Vr()){return He&&rf(t)&&Ee.log(`Captured error event \`${t_(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{He&&(cm(s)?Ee.log(s.message):lm(s)?Ee.warn(s.message):Ee.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:i}=s,a=o_(t),l=rf(t),d=`before send for type \`${t.type||"error"}\``,f=typeof i>"u"?void 0:Aa(i);if(l&&typeof f=="number"&&Zo()>f)return this.recordDroppedEvent("sample_rate","error"),ip(Qu(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const g=dm(t.type);return this._prepareEvent(t,n,r,o).then(y=>{var H;if(y===null)throw this.recordDroppedEvent("event_processor",g),Qu("An event processor returned `null`, will not send event.");if(((H=n.data)==null?void 0:H.__sentry__)===!0)return y;const A=xk(this,s,y,n);return Ak(A,d)}).then(y=>{var H;if(y===null){if(this.recordDroppedEvent("before_send",g),a){const O=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",O)}throw Qu(`${d} returned \`null\`, will not send event.`)}const k=r.getSession()||o.getSession();if(l&&k&&this._updateSessionFromEvent(k,y),a){const R=((H=y.sdkProcessingMetadata)==null?void 0:H.spanCountBeforeProcessing)||0,O=y.spans?y.spans.length:0,W=R-O;W>0&&this.recordDroppedEvent("before_send","span",W)}const A=y.transaction_info;if(a&&A&&y.transaction!==t.transaction){const R="custom";y.transaction_info={...A,source:R}}return this.sendEvent(y,n),y}).then(null,y=>{throw cm(y)||lm(y)?y:(this.captureException(y,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:y}),Yl(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
27
- Reason: ${y}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===lp&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){He&&Ee.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){He&&Ee.log("No outcomes to send");return}if(!this._dsn){He&&Ee.log("No dsn provided, will not send outcomes");return}He&&Ee.log("Sending outcomes:",t);const n=Tk(t,this._options.tunnel&&ji(this._dsn));this.sendEnvelope(n)}}function dm(e){return e==="replay_event"?"replay":e||"error"}function Ak(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Oi(e))return e.then(r=>{if(!Ia(r)&&r!==null)throw Yl(n);return r},r=>{throw Yl(`${t} rejected with ${r}`)});if(!Ia(e)&&e!==null)throw Yl(n);return e}function xk(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!Dy(t.beforeSendSpan)&&t.beforeSendSpan;let l=n;if(rf(l)&&o)return o(l,r);if(o_(l)){if(a||i){const u=Ek(l);if(i!=null&&i.length&&xa(u,i))return null;if(a){const d=a(u);d?l=Ha(n,kk(d)):Jd()}if(l.spans){const d=[],f=l.spans;for(const y of f){if(i!=null&&i.length&&xa(y,i)){Q0(f,y);continue}if(a){const k=a(y);k?d.push(k):(Jd(),d.push(y))}else d.push(y)}const g=l.spans.length-d.length;g&&e.recordDroppedEvent("before_send","span",g),l.spans=d}}if(s){if(l.spans){const u=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(l,r)}}return l}function rf(e){return e.type===void 0}function o_(e){return e.type==="transaction"}function Rk(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+s_(e.attributes)}function Mk(e){let t=0;return e.message&&(t+=e.message.length*2),t+s_(e.attributes)}function s_(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*fm(n[0]):Ti(n)?t+=fm(n):t+=100}),t}function fm(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Pk(e){return Lc(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function pm(e){return Pk(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function $k(e,t){t.debug===!0&&(He?Ee.enable():Do(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Nt().update(t.initialScope);const r=new e(t);return Nk(r),r.init(),r}function Nk(e){Nt().setClient(e)}const Ok="thismessage:/";function i_(e){return"isRelative"in e}function a_(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?Ok:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function Lk(e){if(i_(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Ws(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Dk(e){return e.split(/[?#]/,1)[0]}function ts(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let i="";if(t&&s!==-1){const a=e.slice(s+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return e}function jk(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function l_(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:Us})),o.version=Us)}function c_(e={}){const t=e.client||Pt();if(!nk()||!t)return{};const n=Gs(),r=Li(n);if(r.getTraceData)return r.getTraceData(e);const o=e.scope||Nt(),s=e.span||lr(),i=s?q0(s):Fk(o),a=s?os(s):Ly(t,o),l=I0(a);if(!Cy.test(i))return Ee.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":i,baggage:l};return e.propagateTraceparent&&(d.traceparent=s?H0(s):Bk(o)),d}function Fk(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ay(t,r,n)}function Bk(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return xy(t,r,n)}const Uk=100;function mr(e,t){const n=Pt(),r=Vr();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=Uk}=n.getOptions();if(s<=0)return;const a={timestamp:Ks(),...e},l=o?Do(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,s))}let hm;const qk="FunctionToString",mm=new WeakMap,Hk=(()=>({name:qk,setupOnce(){hm=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Zf(this),n=mm.has(Pt())&&t!==void 0?t:this;return hm.apply(n,e)}}catch{}},setup(e){mm.set(e,!0)}})),Wk=Hk,Vk=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],zk="EventFilters",Gk=(e={})=>{let t;return{name:zk,setup(n){const r=n.getOptions();t=gm(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=gm(e,s)}return Yk(n,t)?null:n}}},Kk=((e={})=>({...Gk(e),name:"InboundFilters"}));function gm(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Vk],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Yk(e,t){if(e.type){if(e.type==="transaction"&&Xk(e,t.ignoreTransactions))return He&&Ee.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
28
- Event: ${Os(e)}`),!0}else{if(Jk(e,t.ignoreErrors))return He&&Ee.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
29
- Event: ${Os(e)}`),!0;if(tI(e))return He&&Ee.warn(`Event dropped due to not having an error message, error type or stacktrace.
30
- Event: ${Os(e)}`),!0;if(Qk(e,t.denyUrls))return He&&Ee.warn(`Event dropped due to being matched by \`denyUrls\` option.
31
- Event: ${Os(e)}.
32
- Url: ${fc(e)}`),!0;if(!Zk(e,t.allowUrls))return He&&Ee.warn(`Event dropped due to not being matched by \`allowUrls\` option.
33
- Event: ${Os(e)}.
34
- Url: ${fc(e)}`),!0}return!1}function Jk(e,t){return t!=null&&t.length?t_(e).some(n=>es(n,t)):!1}function Xk(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?es(n,t):!1}function Qk(e,t){if(!(t!=null&&t.length))return!1;const n=fc(e);return n?es(n,t):!1}function Zk(e,t){if(!(t!=null&&t.length))return!0;const n=fc(e);return n?es(n,t):!0}function eI(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function fc(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(s=>{var i,a,l;return((i=s.mechanism)==null?void 0:i.parent_id)===void 0&&((l=(a=s.stacktrace)==null?void 0:a.frames)==null?void 0:l.length)}),o=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return o?eI(o):null}catch{return He&&Ee.error(`Cannot extract url for event ${Os(e)}`),null}}function tI(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function nI(e,t,n,r,o,s){var a;if(!((a=o.exception)!=null&&a.values)||!s||!Po(s.originalException,Error))return;const i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=of(e,t,r,s.originalException,n,o.exception.values,i,0))}function of(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let l=[...s];if(Po(r[o],Error)){vm(i,a,r);const u=e(t,r[o]),d=l.length;ym(u,o,d,a),l=of(e,t,n,r[o],o,[u,...l],u,d)}return u_(r)&&r.errors.forEach((u,d)=>{if(Po(u,Error)){vm(i,a,r);const f=e(t,u),g=l.length;ym(f,`errors[${d}]`,g,a),l=of(e,t,n,u,o,[f,...l],f,g)}}),l}function u_(e){return Array.isArray(e.errors)}function vm(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...u_(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function ym(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function rI(e){const t="console";cs(t,e),us(t,oI)}function oI(){"console"in yt&&DT.forEach(function(e){e in yt.console&&hr(yt.console,e,function(t){return lc[e]=t,function(...n){Ir("console",{args:n,level:e});const o=lc[e];o==null||o.apply(yt.console,n)}})})}function sI(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const iI="Dedupe",aI=(()=>{let e;return{name:iI,processEvent(t){if(t.type)return t;try{if(cI(t,e))return He&&Ee.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),lI=aI;function cI(e,t){return t?!!(uI(e,t)||dI(e,t)):!1}function uI(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!f_(e,t)||!d_(e,t))}function dI(e,t){const n=_m(t),r=_m(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!f_(e,t)||!d_(e,t))}function d_(e,t){let n=Rh(e),r=Rh(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const s=r[o],i=n[o];if(s.filename!==i.filename||s.lineno!==i.lineno||s.colno!==i.colno||s.function!==i.function)return!1}return!0}function f_(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function _m(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const fI="ConversationId",pI=(()=>({name:fI,setup(e){e.on("spanStart",t=>{const n=Nt().getScopeData(),r=Vr().getScopeData(),o=n.conversationId||r.conversationId;o&&t.setAttribute(b0,o)})}})),hI=pI;function mI(e,t,n,r,o){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,a=Ar()&&t(i);if(e.endTimestamp){const y=e.fetchData.__span;if(!y)return;const k=r[y];k&&(a&&(yI(k,e),gI(k,e,o)),delete r[y]);return}const{spanOrigin:l="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},d=!!lr(),f=a&&d?ss(bI(i,s,l)):new xr;if(e.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(e.fetchData.url)){const y=e.args[0],k={...e.args[1]||{}},A=vI(y,k,Ar()&&d?f:void 0,u);A&&(e.args[1]=k,k.headers=A)}const g=Pt();if(g){const y={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};g.emit("beforeOutgoingRequestSpan",f,y)}return f}function gI(e,t,n){var o;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(o=t.response)==null?void 0:o.headers,error:t.error})}function vI(e,t,n,r){const o=c_({span:n,propagateTraceparent:r}),s=o["sentry-trace"],i=o.baggage,a=o.traceparent;if(!s)return;const l=t.headers||(Xf(e)?e.headers:void 0);if(l)if(_I(l)){const u=new Headers(l);if(u.get("sentry-trace")||u.set("sentry-trace",s),r&&a&&!u.get("traceparent")&&u.set("traceparent",a),i){const d=u.get("baggage");d?Rl(d)||u.set("baggage",`${d},${i}`):u.set("baggage",i)}return u}else if(Array.isArray(l)){const u=[...l];l.find(f=>f[0]==="sentry-trace")||u.push(["sentry-trace",s]),r&&a&&!l.find(f=>f[0]==="traceparent")&&u.push(["traceparent",a]);const d=l.find(f=>f[0]==="baggage"&&Rl(f[1]));return i&&!d&&u.push(["baggage",i]),u}else{const u="sentry-trace"in l?l["sentry-trace"]:void 0,d="traceparent"in l?l.traceparent:void 0,f="baggage"in l?l.baggage:void 0,g=f?Array.isArray(f)?[...f]:[f]:[],y=f&&(Array.isArray(f)?f.find(A=>Rl(A)):Rl(f));i&&!y&&g.push(i);const k={...l,"sentry-trace":u??s,baggage:g.length>0?g.join(","):void 0};return r&&a&&!d&&(k.traceparent=a),k}else return{...o}}function yI(e,t){var n,r;if(t.response){Sy(e,t.response.status);const o=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(o){const s=parseInt(o);s>0&&e.setAttribute("http.response_content_length",s)}}else t.error&&e.setStatus({code:cn,message:"internal_error"});e.end()}function Rl(e){return e.split(",").some(t=>t.trim().startsWith(dc))}function _I(e){return typeof Headers<"u"&&Po(e,Headers)}function bI(e,t,n){if(e.startsWith("data:")){const s=ts(e);return{name:`${t} ${s}`,attributes:bm(e,void 0,t,n)}}const r=a_(e),o=r?Lk(r):e;return{name:`${t} ${o}`,attributes:bm(e,r,t,n)}}function bm(e,t,n,r){const o={url:ts(e),type:"fetch","http.method":n,[Jt]:r,[No]:"http.client"};return t&&(i_(t)||(o["http.url"]=ts(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function p_(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Ma=yt;function wI(){return"history"in Ma&&!!Ma.history}function SI(){if(!("fetch"in Ma))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function sf(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function TI(){var n;if(typeof EdgeRuntime=="string")return!0;if(!SI())return!1;if(sf(Ma.fetch))return!0;let e=!1;const t=Ma.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=sf(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){He&&Ee.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function h_(e,t){const n="fetch";cs(n,e),us(n,()=>m_(void 0,t))}function EI(e){const t="fetch-body-resolved";cs(t,e),us(t,()=>m_(II))}function m_(e,t=!1){t&&!TI()||hr(yt,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:i}=CI(r),a={args:r,fetchData:{method:s,url:i},startTimestamp:tn()*1e3,virtualError:o,headers:AI(r)};return e||Ir("fetch",{...a}),n.apply(yt,r).then(async l=>(e?e(l):Ir("fetch",{...a,endTimestamp:tn()*1e3,response:l}),l),l=>{Ir("fetch",{...a,endTimestamp:tn()*1e3,error:l}),Lc(l)&&l.stack===void 0&&(l.stack=o.stack,ar(l,"framesToPop",1));const u=Pt(),d=(u==null?void 0:u.getOptions().enhanceFetchErrorMessages)??"always";if(d!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{const y=new URL(a.fetchData.url).host;d==="always"?l.message=`${l.message} (${y})`:ar(l,"__sentry_fetch_url_host__",y)}catch{}throw l})}})}async function kI(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let s=!0;for(;s;){let i;try{i=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:a}=await r.read();clearTimeout(i),a&&(t(),s=!1)}catch{s=!1}finally{clearTimeout(i)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function II(e){let t;try{t=e.clone()}catch{return}kI(t,()=>{Ir("fetch-body-resolved",{endTimestamp:tn()*1e3,response:e})})}function Jl(e,t){return!!e&&typeof e=="object"&&!!e[t]}function wm(e){return typeof e=="string"?e:e?Jl(e,"url")?e.url:e.toString?e.toString():"":""}function CI(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:wm(n),method:Jl(r,"method")?String(r.method).toUpperCase():Xf(n)&&Jl(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:wm(t),method:Jl(t,"method")?String(t.method).toUpperCase():"GET"}}function AI(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Xf(t))return new Headers(t.headers)}catch{}}function xI(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function RI(){return"npm"}function MI(){return!xI()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function PI(){return typeof window<"u"&&(!MI()||$I())}function $I(){const e=yt.process;return(e==null?void 0:e.type)==="renderer"}const ut=yt;let af=0;function g_(){return af>0}function NI(){af++,setTimeout(()=>{af--})}function Ai(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{const o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(Zf(e))return e}catch{return e}const r=function(...o){try{const s=o.map(i=>Ai(i,t));return e.apply(this,s)}catch(s){throw NI(),jc(i=>{i.addEventProcessor(a=>(t.mechanism&&(Gd(a,void 0),Ei(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),ap(s)}),s}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}hy(r,e),ar(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function up(){const e=Ba(),{referrer:t}=ut.document||{},{userAgent:n}=ut.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function dp(e,t){const n=fp(e,t),r={type:FI(t),value:BI(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function OI(e,t,n,r){const o=Pt(),s=o==null?void 0:o.getOptions().normalizeDepth,i=VI(t),a={__serialized__:jy(t,s)};if(i)return{exception:{values:[dp(e,i)]},extra:a};const l={exception:{values:[{type:Dc(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:HI(t,{isUnhandledRejection:r})}]},extra:a};if(n){const u=fp(e,n);u.length&&(l.exception.values[0].stacktrace={frames:u})}return l}function Zu(e,t){return{exception:{values:[dp(e,t)]}}}function fp(e,t){const n=t.stacktrace||t.stack||"",r=DI(t),o=jI(t);try{return e(n,r,o)}catch{}return[]}const LI=/Minified React error #\d+;/i;function DI(e){return e&&LI.test(e.message)?1:0}function jI(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function v_(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function FI(e){const t=e==null?void 0:e.name;return!t&&v_(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function BI(e){const t=e==null?void 0:e.message;return v_(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?pm(t.error):pm(e):"No error message"}function UI(e,t,n,r){const o=(n==null?void 0:n.syntheticException)||void 0,s=pp(e,t,o,r);return Ei(s),s.level="error",n!=null&&n.event_id&&(s.event_id=n.event_id),Ga(s)}function qI(e,t,n="info",r,o){const s=(r==null?void 0:r.syntheticException)||void 0,i=lf(e,t,s,o);return i.level=n,r!=null&&r.event_id&&(i.event_id=r.event_id),Ga(i)}function pp(e,t,n,r,o){let s;if(dy(t)&&t.error)return Zu(e,t.error);if(Ph(t)||KT(t)){const i=t;if("stack"in t)s=Zu(e,t);else{const a=i.name||(Ph(i)?"DOMError":"DOMException"),l=i.message?`${a}: ${i.message}`:a;s=lf(e,l,n,r),Gd(s,l)}return"code"in i&&(s.tags={...s.tags,"DOMException.code":`${i.code}`}),s}return Lc(t)?Zu(e,t):Ia(t)||Dc(t)?(s=OI(e,t,n,o),Ei(s,{synthetic:!0}),s):(s=lf(e,t,n,r),Gd(s,`${t}`),Ei(s,{synthetic:!0}),s)}function lf(e,t,n,r){const o={};if(r&&n){const s=fp(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),Ei(o,{synthetic:!0})}if(Jf(t)){const{__sentry_template_string__:s,__sentry_template_values__:i}=t;return o.logentry={message:s,params:i},o}return o.message=t,o}function HI(e,{isUnhandledRejection:t}){const n=e0(e),r=t?"promise rejection":"exception";return dy(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Dc(e)?`Event \`${WI(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function WI(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function VI(e){return Object.values(e).find(t=>t instanceof Error)}class zI extends Ck{constructor(t){var d;const n=GI(t),r=ut.SENTRY_SDK_SOURCE||RI();l_(n,"browser",["browser"],r),(d=n._metadata)!=null&&d.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:o,sendClientReports:s,enableLogs:i,_experiments:a,enableMetrics:l}=this._options,u=l??(a==null?void 0:a.enableMetrics)??!0;ut.document&&(s||i||u)&&ut.document.addEventListener("visibilitychange",()=>{ut.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),i&&nf(this),u&&Xy(this))}),o&&this.on("beforeSendSession",jk)}eventFromException(t,n){return UI(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return qI(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}}function GI(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=ut.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Ka=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ze=yt,KI=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Ya=(e,t,n,r)=>{let o,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(o??0),(s||o===void 0)&&(o=t.value,t.delta=s,t.rating=KI(t.value,n),e(t)))}},Ja=(e=!0)=>{var n,r;const t=(r=(n=Ze.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Fi=()=>{const e=Ja();return(e==null?void 0:e.activationStart)??0};function ns(e,t,n){Ze.document&&Ze.addEventListener(e,t,n)}function pc(e,t,n){Ze.document&&Ze.removeEventListener(e,t,n)}let _i=-1;const y_=new Set,YI=()=>{var e,t;return((e=Ze.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=Ze.document)!=null&&t.prerendering)?0:1/0},Xl=e=>{if(JI(e)&&_i>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of y_)t();isFinite(_i)||(_i=e.type==="visibilitychange"?e.timeStamp:0,pc("prerenderingchange",Xl,!0))}},Xa=()=>{var e;if(Ze.document&&_i<0){const t=Fi();_i=(Ze.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??YI(),ns("visibilitychange",Xl,!0),ns("pagehide",Xl,!0),ns("prerenderingchange",Xl,!0)}return{get firstHiddenTime(){return _i},onHidden(t){y_.add(t)}}};function JI(e){var t;return e.type==="pagehide"||((t=Ze.document)==null?void 0:t.visibilityState)==="hidden"}const XI=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Qa=(e,t=-1)=>{var s,i;const n=Ja();let r="navigate";return n&&((s=Ze.document)!=null&&s.prerendering||Fi()>0?r="prerender":(i=Ze.document)!=null&&i.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:XI(),navigationType:r}},ed=new WeakMap;function hp(e,t){try{return ed.get(e)||ed.set(e,new t),ed.get(e)}catch{return new t}}class hc{constructor(){hc.prototype.__init.call(this),hc.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var o;if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(o=this._onAfterProcessingUnexpectedShift)==null||o.call(this,t)}}const Bi=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},mp=e=>{let t=!1;return()=>{t||(e(),t=!0)}},qc=e=>{var t;(t=Ze.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},QI=[1800,3e3],ZI=(e,t={})=>{qc(()=>{const n=Xa(),r=Qa("FCP");let o;const i=Bi("paint",a=>{for(const l of a)l.name==="first-contentful-paint"&&(i.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Fi(),0),r.entries.push(l),o(!0)))});i&&(o=Ya(e,r,QI,t.reportAllChanges))})},eC=[.1,.25],tC=(e,t={})=>{ZI(mp(()=>{var l;const n=Qa("CLS",0);let r;const o=Xa(),s=hp(t,hc),i=u=>{for(const d of u)s._processEntry(d);s._sessionValue>n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},a=Bi("layout-shift",i);a&&(r=Ya(e,n,eC,t.reportAllChanges),o.onHidden(()=>{i(a.takeRecords()),r(!0)}),(l=Ze==null?void 0:Ze.setTimeout)==null||l.call(Ze,r))}))};let __=0,td=1/0,Ml=0;const nC=e=>{e.forEach(t=>{t.interactionId&&(td=Math.min(td,t.interactionId),Ml=Math.max(Ml,t.interactionId),__=Ml?(Ml-td)/7+1:0)})};let cf;const b_=()=>cf?__:performance.interactionCount||0,rC=()=>{"interactionCount"in performance||cf||(cf=Bi("event",nC,{type:"event",buffered:!0,durationThreshold:0}))},nd=10;let w_=0;const oC=()=>b_()-w_;class mc{constructor(){mc.prototype.__init.call(this),mc.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){w_=b_(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(oC()/50));return this._longestInteractionList[t]}_processEntry(t){var o,s;if((o=this._onBeforeProcessingEntry)==null||o.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<nd||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((i,a)=>a._latency-i._latency),this._longestInteractionList.length>nd){const i=this._longestInteractionList.splice(nd);for(const a of i)this._longestInteractionMap.delete(a.id)}(s=this._onAfterProcessingINPCandidate)==null||s.call(this,r)}}}const S_=e=>{var n;const t=Ze.requestIdleCallback||Ze.setTimeout;((n=Ze.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=mp(e),ns("visibilitychange",e,{once:!0,capture:!0}),ns("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),pc("visibilitychange",e,{capture:!0}),pc("pagehide",e,{capture:!0})}))},sC=[200,500],iC=40,aC=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Xa();qc(()=>{rC();const r=Qa("INP");let o;const s=hp(t,mc),i=l=>{S_(()=>{for(const d of l)s._processEntry(d);const u=s._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,o())})},a=Bi("event",i,{durationThreshold:t.durationThreshold??iC});o=Ya(e,r,sC,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),o(!0)}))})};class lC{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const cC=[2500,4e3],uC=(e,t={})=>{qc(()=>{const n=Xa(),r=Qa("LCP");let o;const s=hp(t,lC),i=l=>{t.reportAllChanges||(l=l.slice(-1));for(const u of l)s._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-Fi(),0),r.entries=[u],o())},a=Bi("largest-contentful-paint",i);if(a){o=Ya(e,r,cC,t.reportAllChanges);const l=mp(()=>{i(a.takeRecords()),a.disconnect(),o(!0)}),u=d=>{d.isTrusted&&(S_(l),pc(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])ns(d,u,{capture:!0})}})},dC=[800,1800],uf=e=>{var t,n;(t=Ze.document)!=null&&t.prerendering?qc(()=>uf(e)):((n=Ze.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>uf(e),!0):setTimeout(e)},fC=(e,t={})=>{const n=Qa("TTFB"),r=Ya(e,n,dC,t.reportAllChanges);uf(()=>{const o=Ja();o&&(n.value=Math.max(o.responseStart-Fi(),0),n.entries=[o],r(!0))})},ha={},gc={};let T_,E_,k_,I_;function C_(e,t=!1){return Hc("cls",e,mC,T_,t)}function A_(e,t=!1){return Hc("lcp",e,gC,E_,t)}function pC(e){return Hc("ttfb",e,vC,k_)}function hC(e){return Hc("inp",e,yC,I_)}function Pa(e,t){return x_(e,t),gc[e]||(_C(e),gc[e]=!0),R_(e,t)}function Za(e,t){const n=ha[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(o){Ka&&Ee.error(`Error while triggering instrumentation handler.
35
- Type: ${e}
36
- Name: ${Mo(r)}
37
- Error:`,o)}}function mC(){return tC(e=>{Za("cls",{metric:e}),T_=e},{reportAllChanges:!0})}function gC(){return uC(e=>{Za("lcp",{metric:e}),E_=e},{reportAllChanges:!0})}function vC(){return fC(e=>{Za("ttfb",{metric:e}),k_=e})}function yC(){return aC(e=>{Za("inp",{metric:e}),I_=e})}function Hc(e,t,n,r,o=!1){x_(e,t);let s;return gc[e]||(s=n(),gc[e]=!0),r&&t({metric:r}),R_(e,t,o?s:void 0)}function _C(e){const t={};e==="event"&&(t.durationThreshold=0),Bi(e,n=>{Za(e,{entries:n})},t)}function x_(e,t){ha[e]=ha[e]||[],ha[e].push(t)}function R_(e,t,n){return()=>{n&&n();const r=ha[e];if(!r)return;const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function bC(e){return"duration"in e}const wC=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=Ze.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};ns("visibilitychange",t,{capture:!0,once:!0}),ns("pagehide",t,{capture:!0,once:!0})};function rd(e){return typeof e=="number"&&isFinite(e)}function is(e,t,n,{...r}){const o=St(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),rp(e,()=>{const s=ss({startTime:t,...r});return s&&s.end(n),s})}function gp(e){var H;const t=Pt();if(!t)return;const{name:n,transaction:r,attributes:o,startTime:s}=e,{release:i,environment:a,sendDefaultPii:l}=t.getOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),f=Nt(),g=f.getUser(),y=g!==void 0?g.email||g.id||g.ip_address:void 0;let k;try{k=f.getScopeData().contexts.profile.profile_id}catch{}const A={release:i,environment:a,user:y||void 0,profile_id:k||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(H=Ze.navigator)==null?void 0:H.userAgent,"client.address":l?"{{auto}}":void 0,...o};return ss({name:n,attributes:A,startTime:s,experimental:{standalone:!0}})}function Wc(){return Ze.addEventListener&&Ze.performance}function un(e){return e/1e3}function SC(e){let t="unknown",n="unknown",r="";for(const o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function M_(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function P_(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n),r=!0}wC(()=>{o("pagehide")});const s=e.on("beforeStartNavigationSpan",(a,l)=>{l!=null&&l.isRedirect||(o("navigation"),s(),i())}),i=e.on("afterStartPageLoadSpan",a=>{n=a.spanContext().spanId,i()})}function TC(e){let t=0,n;if(!M_("layout-shift"))return;const r=C_(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);P_(e,(o,s)=>{EC(t,n,s,o),r()})}function EC(e,t,n,r){var u;Ka&&Ee.log(`Sending CLS span (${e})`);const o=t?un((Mr()||0)+t.startTime):tn(),s=Nt().getScopeData().transactionName,i=t?Rr((u=t.sources[0])==null?void 0:u.node):"Layout shift",a={[Jt]:"auto.http.browser.cls",[No]:"ui.webvital.cls",[Di]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,f)=>{a[`cls.source.${f+1}`]=Rr(d.node)});const l=gp({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("cls",{[Wa]:"",[Va]:e}),l.end(o))}function kC(e){let t=0,n;if(!M_("largest-contentful-paint"))return;const r=A_(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);P_(e,(o,s)=>{IC(t,n,s,o),r()})}function IC(e,t,n,r){Ka&&Ee.log(`Sending LCP span (${e})`);const o=un((Mr()||0)+((t==null?void 0:t.startTime)||0)),s=Nt().getScopeData().transactionName,i=t?Rr(t.element):"Largest contentful paint",a={[Jt]:"auto.http.browser.lcp",[No]:"ui.webvital.lcp",[Di]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Rr(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const l=gp({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[Wa]:"millisecond",[Va]:e}),l.end(o))}function Tr(e){return e&&((Mr()||performance.timeOrigin)+e)/1e3}function $_(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:o}=SC(e.nextHopProtocol);t["network.protocol.version"]=o,t["network.protocol.name"]=r}return Mr()||(n=Wc())!=null&&n.timeOrigin?CC({...t,"http.request.redirect_start":Tr(e.redirectStart),"http.request.redirect_end":Tr(e.redirectEnd),"http.request.worker_start":Tr(e.workerStart),"http.request.fetch_start":Tr(e.fetchStart),"http.request.domain_lookup_start":Tr(e.domainLookupStart),"http.request.domain_lookup_end":Tr(e.domainLookupEnd),"http.request.connect_start":Tr(e.connectStart),"http.request.secure_connection_start":Tr(e.secureConnectionStart),"http.request.connection_end":Tr(e.connectEnd),"http.request.request_start":Tr(e.requestStart),"http.request.response_start":Tr(e.responseStart),"http.request.response_end":Tr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function CC(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const AC=2147483647;let Sm=0,Dr={},or,di;function xC({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=Wc();if(r&&Mr()){r.mark&&Ze.performance.mark("sentry-tracing-init");const o=t?kC(n):NC(),s=OC(),i=e?TC(n):$C();return()=>{o==null||o(),s(),i==null||i()}}return()=>{}}function RC(){Pa("longtask",({entries:e})=>{const t=lr();if(!t)return;const{op:n,start_timestamp:r}=St(t);for(const o of e){const s=un(Mr()+o.startTime),i=un(o.duration);n==="navigation"&&r&&s<r||is(t,s,s+i,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Jt]:"auto.ui.browser.metrics"}})}})}function MC(){new PerformanceObserver(t=>{const n=lr();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const o=un(Mr()+r.startTime),{start_timestamp:s,op:i}=St(n);if(i==="navigation"&&s&&o<s)continue;const a=un(r.duration),l={[Jt]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:f,sourceURL:g,sourceFunctionName:y,sourceCharPosition:k}=u;l["browser.script.invoker"]=d,l["browser.script.invoker_type"]=f,g&&(l["code.filepath"]=g),y&&(l["code.function"]=y),k!==-1&&(l["browser.script.source_char_position"]=k),is(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function PC(){Pa("event",({entries:e})=>{const t=lr();if(t){for(const n of e)if(n.name==="click"){const r=un(Mr()+n.startTime),o=un(n.duration),s={name:Rr(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Jt]:"auto.ui.browser.metrics"}},i=py(n.target);i&&(s.attributes["ui.component_name"]=i),is(t,r,r+o,s)}}})}function $C(){return C_(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Dr.cls={value:e.value,unit:""},di=t)},!0)}function NC(){return A_(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Dr.lcp={value:e.value,unit:"millisecond"},or=t)},!0)}function OC(){return pC(({metric:e})=>{e.entries[e.entries.length-1]&&(Dr.ttfb={value:e.value,unit:"millisecond"})})}function LC(e,t){const n=Wc(),r=Mr();if(!(n!=null&&n.getEntries)||!r)return;const o=un(r),s=n.getEntries(),{op:i,start_timestamp:a}=St(e);s.slice(Sm).forEach(l=>{const u=un(l.startTime),d=un(Math.max(0,l.duration));if(!(i==="navigation"&&a&&o+u<a))switch(l.entryType){case"navigation":{BC(e,l,o);break}case"mark":case"paint":case"measure":{jC(e,l,u,d,o,t.ignorePerformanceApiSpans);const f=Xa(),g=l.startTime<f.firstHiddenTime;l.name==="first-paint"&&g&&(Dr.fp={value:l.startTime,unit:"millisecond"}),l.name==="first-contentful-paint"&&g&&(Dr.fcp={value:l.startTime,unit:"millisecond"});break}case"resource":{HC(e,l,l.name,u,d,o,t.ignoreResourceSpans);break}}}),Sm=Math.max(s.length-1,0),WC(e),i==="pageload"&&(GC(Dr),t.recordClsOnPageloadSpan||delete Dr.cls,t.recordLcpOnPageloadSpan||delete Dr.lcp,Object.entries(Dr).forEach(([l,u])=>{_E(l,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",o),e.setAttribute("performance.activationStart",Fi()),VC(e,t)),or=void 0,di=void 0,Dr={}}function DC(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function jC(e,t,n,r,o,s){if(DC(t)||["mark","measure"].includes(t.entryType)&&es(t.name,s))return;const i=Ja(!1),a=un(i?i.requestStart:0),l=o+Math.max(n,a),u=o+n,d=u+r,f={[Jt]:"auto.resource.browser.metrics"};l!==u&&(f["sentry.browser.measure_happened_before_request"]=!0,f["sentry.browser.measure_start_time"]=l),FC(f,t),l<=d&&is(e,l,d,{name:t.name,op:t.entryType,attributes:f})}function FC(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,o]of Object.entries(n))if(o&&Ti(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(Ti(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function BC(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Pl(e,t,r,n)}),Pl(e,t,"secureConnection",n,"TLS/SSL"),Pl(e,t,"fetch",n,"cache"),Pl(e,t,"domainLookup",n,"DNS"),qC(e,t,n)}function Pl(e,t,n,r,o=n){const s=UC(n),i=t[s],a=t[`${n}Start`];!a||!i||is(e,r+un(a),r+un(i),{op:`browser.${o}`,name:t.name,attributes:{[Jt]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function UC(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function qC(e,t,n){const r=n+un(t.requestStart),o=n+un(t.responseEnd),s=n+un(t.responseStart);t.responseEnd&&(is(e,r,o,{op:"browser.request",name:t.name,attributes:{[Jt]:"auto.ui.browser.metrics"}}),is(e,s,o,{op:"browser.response",name:t.name,attributes:{[Jt]:"auto.ui.browser.metrics"}}))}function HC(e,t,n,r,o,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(i!=null&&i.includes(a))return;const l={[Jt]:"auto.resource.browser.metrics"},u=Ws(n);u.protocol&&(l["url.scheme"]=u.protocol.split(":").pop()),u.host&&(l["server.address"]=u.host),l["url.same_origin"]=n.includes(Ze.location.origin),zC(t,l,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...l,...$_(t)},f=s+r,g=f+o;is(e,f,g,{name:n.replace(Ze.location.origin,""),op:a,attributes:d})}function WC(e){const t=Ze.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),rd(n.rtt)&&(Dr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),rd(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),rd(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function VC(e,t){or&&t.recordLcpOnPageloadSpan&&(or.element&&e.setAttribute("lcp.element",Rr(or.element)),or.id&&e.setAttribute("lcp.id",or.id),or.url&&e.setAttribute("lcp.url",or.url.trim().slice(0,200)),or.loadTime!=null&&e.setAttribute("lcp.loadTime",or.loadTime),or.renderTime!=null&&e.setAttribute("lcp.renderTime",or.renderTime),e.setAttribute("lcp.size",or.size)),di!=null&&di.sources&&t.recordClsOnPageloadSpan&&di.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Rr(n.node)))}function zC(e,t,n){n.forEach(([r,o])=>{const s=e[r];s!=null&&(typeof s=="number"&&s<AC||typeof s=="string")&&(t[o]=s)})}function GC(e){const t=Ja(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const KC=1e3;let Tm,df,ff;function YC(e){cs("dom",e),us("dom",JC)}function JC(){if(!Ze.document)return;const e=Ir.bind(null,"dom"),t=Em(e,!0);Ze.document.addEventListener("click",t,!1),Ze.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var s,i;const o=(s=Ze[n])==null?void 0:s.prototype;(i=o==null?void 0:o.hasOwnProperty)!=null&&i.call(o,"addEventListener")&&(hr(o,"addEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const f=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=f[l]=f[l]||{refCount:0};if(!g.handler){const y=Em(e);g.handler=y,a.call(this,l,y,d)}g.refCount++}catch{}return a.call(this,l,u,d)}}),hr(o,"removeEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const f=this.__sentry_instrumentation_handlers__||{},g=f[l];g&&(g.refCount--,g.refCount<=0&&(a.call(this,l,g.handler,d),g.handler=void 0,delete f[l]),Object.keys(f).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,u,d)}}))})}function XC(e){if(e.type!==df)return!1;try{if(!e.target||e.target._sentryId!==ff)return!1}catch{}return!0}function QC(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Em(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=ZC(n);if(QC(n.type,r))return;ar(n,"_sentryCaptured",!0),r&&!r._sentryId&&ar(r,"_sentryId",Cr());const o=n.type==="keypress"?"input":n.type;XC(n)||(e({event:n,name:o,global:t}),df=n.type,ff=r?r._sentryId:void 0),clearTimeout(Tm),Tm=Ze.setTimeout(()=>{ff=void 0,df=void 0},KC)}}function ZC(e){try{return e.target}catch{return null}}let $l;function vp(e){const t="history";cs(t,e),us(t,eA)}function eA(){if(Ze.addEventListener("popstate",()=>{const t=Ze.location.href,n=$l;if($l=t,n===t)return;Ir("history",{from:n,to:t})}),!wI())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=$l,s=tA(String(r));if($l=s,o===s)return t.apply(this,n);Ir("history",{from:o,to:s})}return t.apply(this,n)}}hr(Ze.history,"pushState",e),hr(Ze.history,"replaceState",e)}function tA(e){try{return new URL(e,Ze.location.origin).toString()}catch{return e}}const Ql={};function nA(e){const t=Ql[e];if(t)return t;let n=Ze[e];if(sf(n))return Ql[e]=n.bind(Ze);const r=Ze.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s!=null&&s[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){Ka&&Ee.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(Ql[e]=n.bind(Ze))}function rA(e){Ql[e]=void 0}const fi="__sentry_xhr_v3__";function N_(e){cs("xhr",e),us("xhr",oA)}function oA(){if(!Ze.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=tn()*1e3,i=ko(r[0])?r[0].toUpperCase():void 0,a=sA(r[1]);if(!i||!a)return t.apply(n,r);n[fi]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const u=n[fi];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:tn()*1e3,startTimestamp:s,xhr:n,virtualError:o};Ir("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,f){return l(),u.apply(d,f)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,f){const[g,y]=f,k=d[fi];return k&&ko(g)&&ko(y)&&(k.request_headers[g.toLowerCase()]=y),u.apply(d,f)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[fi];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:tn()*1e3,xhr:n};return Ir("xhr",s),t.apply(n,r)}})}function sA(e){if(ko(e))return e;try{return e.toString()}catch{}}function iA(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Ka&&Ee.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
38
- `).reduce((n,r)=>{const[o,s]=r.split(": ");return s&&(n[o.toLowerCase()]=s),n},{}):{}}const od=[],Zl=new Map,si=new Map,aA=60;function lA(){if(Wc()&&Mr()){const t=cA();return()=>{t()}}return()=>{}}const pf={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function cA(){return hC(uA)}const uA=({metric:e})=>{if(e.value==null)return;const t=un(e.value);if(t>aA)return;const n=e.entries.find(k=>k.duration===e.value&&pf[k.name]);if(!n)return;const{interactionId:r}=n,o=pf[n.name],s=un(Mr()+n.startTime),i=lr(),a=i?Dn(i):void 0,l=r!=null?Zl.get(r):void 0,u=(l==null?void 0:l.span)||a,d=u?St(u).description:Nt().getScopeData().transactionName,f=(l==null?void 0:l.elementName)||Rr(n.target),g={[Jt]:"auto.http.browser.inp",[No]:`ui.interaction.${o}`,[Di]:n.duration},y=gp({name:f,transaction:d,attributes:g,startTime:s});y&&(y.addEvent("inp",{[Wa]:"millisecond",[Va]:e.value}),y.end(s+t))};function dA(){const e=Object.keys(pf);PI()&&e.forEach(o=>{Ze.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const s=o.target;if(!s)return;const i=Rr(s),a=Math.round(o.timeStamp);if(si.set(a,i),si.size>50){const l=si.keys().next().value;l!==void 0&&si.delete(l)}}function n(o){const s=Math.round(o.startTime);let i=si.get(s);if(!i)for(let a=-5;a<=5;a++){const l=si.get(s+a);if(l){i=l;break}}return i||"<unknown>"}const r=({entries:o})=>{const s=lr(),i=s&&Dn(s);o.forEach(a=>{if(!bC(a))return;const l=a.interactionId;if(l==null||Zl.has(l))return;const u=a.target?Rr(a.target):n(a);if(od.length>10){const d=od.shift();Zl.delete(d)}od.push(l),Zl.set(l,{span:i,elementName:u})})};Pa("event",r),Pa("first-input",r)}const fA=40;function pA(e,t=nA("fetch")){let n=0,r=0;async function o(s){const i=s.body.length;n+=i,r++;const a={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const l=await t(e.url,a);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw rA("fetch"),l}finally{n-=i,r--}}return Sk(e,o,cp(e.bufferSize||fA))}const gr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,hA=30,mA=50;function hf(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?Vs:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const gA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yA=/\((\S*)(?::(\d+))(?::(\d+))\)/,_A=/at (.+?) ?\(data:(.+?),/,bA=e=>{var o;const t=e.match(_A);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=gA.exec(e);if(n){const[,s,i,a]=n;return hf(s,Vs,+i,+a)}const r=vA.exec(e);if(r){if(((o=r[2])==null?void 0:o.indexOf("eval"))===0){const l=yA.exec(r[2]);l&&(r[2]=l[1],r[3]=l[2],r[4]=l[3])}const[i,a]=O_(r[1]||Vs,r[2]);return hf(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},wA=[hA,bA],SA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,TA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,EA=e=>{const t=SA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=TA.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||Vs;return[o,r]=O_(o,r),hf(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},kA=[mA,EA],IA=[wA,kA],CA=iy(...IA),O_=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Vs,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Nl=1024,AA="Breadcrumbs",xA=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:AA,setup(n){t.console&&rI($A(n)),t.dom&&YC(PA(n,t.dom)),t.xhr&&N_(NA(n)),t.fetch&&h_(OA(n)),t.history&&vp(LA(n)),t.sentry&&n.on("beforeSendEvent",MA(n))}}}),RA=xA;function MA(e){return function(n){Pt()===e&&mr({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Os(n)},{event:n})}}function PA(e,t){return function(r){if(Pt()!==e)return;let o,s,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Nl&&(gr&&Ee.warn(`\`dom.maxStringLength\` cannot exceed ${Nl}, but a value of ${a} was configured. Sentry will use ${Nl} instead.`),a=Nl),typeof i=="string"&&(i=[i]);try{const u=r.event,d=DA(u)?u.target:u;o=Rr(d,{keyAttrs:i,maxStringLength:a}),s=py(d)}catch{o="<unknown>"}if(o.length===0)return;const l={category:`ui.${r.name}`,message:o};s&&(l.data={"ui.component_name":s}),mr(l,{event:r.event,name:r.name,global:r.global})}}function $A(e){return function(n){if(Pt()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:sI(n.level),message:Oh(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Oh(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;mr(r,{input:n.args,level:n.level})}}function NA(e){return function(n){if(Pt()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[fi];if(!r||!o||!s)return;const{method:i,url:a,status_code:l,body:u}=s,d={method:i,url:a,status_code:l},f={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},g={category:"xhr",data:d,type:"http",level:p_(l)};e.emit("beforeOutgoingRequestBreadcrumb",g,f),mr(g,f)}}function OA(e){return function(n){if(Pt()!==e)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},i={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),mr(i,s)}else{const s=n.response,i={...n.fetchData,status_code:s==null?void 0:s.status},a={input:n.args,response:s,startTimestamp:r,endTimestamp:o},l={category:"fetch",data:i,type:"http",level:p_(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),mr(l,a)}}}function LA(e){return function(n){if(Pt()!==e)return;let r=n.from,o=n.to;const s=Ws(ut.location.href);let i=r?Ws(r):void 0;const a=Ws(o);i!=null&&i.path||(i=s),s.protocol===a.protocol&&s.host===a.host&&(o=a.relative),s.protocol===i.protocol&&s.host===i.host&&(r=i.relative),mr({category:"navigation",data:{from:r,to:o}})}}function DA(e){return!!e&&!!e.target}const jA="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),FA="BrowserApiErrors",BA=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:FA,setupOnce(){t.setTimeout&&hr(ut,"setTimeout",km),t.setInterval&&hr(ut,"setInterval",km),t.requestAnimationFrame&&hr(ut,"requestAnimationFrame",qA),t.XMLHttpRequest&&"XMLHttpRequest"in ut&&hr(XMLHttpRequest.prototype,"send",HA);const n=t.eventTarget;n&&(Array.isArray(n)?n:jA).forEach(o=>WA(o,t))}}}),UA=BA;function km(e){return function(...t){const n=t[0];return t[0]=Ai(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Mo(e)}`}}),e.apply(this,t)}}function qA(e){return function(t){return e.apply(this,[Ai(t,{mechanism:{data:{handler:Mo(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function HA(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&hr(n,o,function(s){const i={mechanism:{data:{handler:Mo(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=Zf(s);return a&&(i.mechanism.data.handler=Mo(a)),Ai(s,i)})}),e.apply(this,t)}}function WA(e,t){var o,s;const r=(o=ut[e])==null?void 0:o.prototype;(s=r==null?void 0:r.hasOwnProperty)!=null&&s.call(r,"addEventListener")&&(hr(r,"addEventListener",function(i){return function(a,l,u){try{VA(l)&&(l.handleEvent=Ai(l.handleEvent,{mechanism:{data:{handler:Mo(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&zA(this,a,l),i.apply(this,[a,Ai(l,{mechanism:{data:{handler:Mo(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),hr(r,"removeEventListener",function(i){return function(a,l,u){try{const d=l.__sentry_wrapped__;d&&i.call(this,a,d,u)}catch{}return i.call(this,a,l,u)}}))}function VA(e){return typeof e.handleEvent=="function"}function zA(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const GA=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof ut.document>"u"){gr&&Ee.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}rm({ignoreDuration:!0}),Xu();const n=Vr();let r=n.getUser();n.addScopeListener(o=>{const s=o.getUser();((r==null?void 0:r.id)!==(s==null?void 0:s.id)||(r==null?void 0:r.ip_address)!==(s==null?void 0:s.ip_address))&&(Xu(),r=s)}),t==="route"&&vp(({from:o,to:s})=>{o!==s&&(rm({ignoreDuration:!0}),Xu())})}}},KA="CultureContext",YA=(()=>({name:KA,preprocessEvent(e){var n;const t=XA();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})}})),JA=YA;function XA(){try{const e=ut.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const QA="GlobalHandlers",ZA=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:QA,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(tx(n),Im("onerror")),t.onunhandledrejection&&(nx(n),Im("onunhandledrejection"))}}}),ex=ZA;function tx(e){ly(t=>{const{stackParser:n,attachStacktrace:r}=L_();if(Pt()!==e||g_())return;const{msg:o,url:s,line:i,column:a,error:l}=t,u=sx(pp(n,l||o,void 0,r,!1),s,i,a);u.level="error",zy(u,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function nx(e){cy(t=>{const{stackParser:n,attachStacktrace:r}=L_();if(Pt()!==e||g_())return;const o=rx(t),s=Ti(o)?ox(o):pp(n,o,void 0,r,!0);s.level="error",zy(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function rx(e){if(Ti(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function ox(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function sx(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],i=s[0]=s[0]||{},a=i.stacktrace=i.stacktrace||{},l=a.frames=a.frames||[];return l.length===0&&l.push({colno:r,lineno:n,filename:ix(t)??Ba(),function:Vs,in_app:!0}),e}function Im(e){gr&&Ee.log(`Global Handler attached: ${e}`)}function L_(){const e=Pt();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function ix(e){if(!(!ko(e)||e.length===0))return e.startsWith("data:")?`<${ts(e,!1)}>`:e}const ax=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!ut.navigator&&!ut.location&&!ut.document)return;const t=up(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),lx="cause",cx=5,ux="LinkedErrors",dx=((e={})=>{const t=e.limit||cx,n=e.key||lx;return{name:ux,preprocessEvent(r,o,s){const i=s.getOptions();nI(dp,i.stackParser,n,t,r,o)}}}),fx=dx;function px(){return hx()?(gr&&Do(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function hx(){var o;if(typeof ut.window>"u")return!1;const e=ut;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((o=t==null?void 0:t.runtime)!=null&&o.id))return!1;const n=Ba();return!(ut===ut.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function D_(e){return[Kk(),Wk(),hI(),UA(),RA(),ex(),fx(),lI(),ax(),JA(),GA()]}function mx(e={}){const t=!e.skipBrowserExtensionCheck&&px();let n=e.defaultIntegrations==null?D_():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:WT(e.stackParser||CA),integrations:ck({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||pA};return $k(zI,r)}function gx(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function j_(e){try{return new URL(e,ut.location.origin).href}catch{return}}function vx(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function F_(e){try{return new Headers(e)}catch{return}}const Cm=new WeakMap,sd=new Map,B_={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function yx(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:o,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:l,onRequestSpanEnd:u}={...B_,...t},d=typeof s=="function"?s:k=>!0,f=k=>bx(k,a),g={},y=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(k=>(k.type==="transaction"&&k.spans&&k.spans.forEach(A=>{if(A.op==="http.client"){const H=sd.get(A.span_id);H&&(A.timestamp=H/1e3,sd.delete(A.span_id))}}),k)),o&&EI(k=>{if(k.response){const A=Cm.get(k.response);A&&k.endTimestamp&&sd.set(A,k.endTimestamp)}}),h_(k=>{const A=mI(k,d,f,g,{propagateTraceparent:y,onRequestSpanEnd:u});if(k.response&&k.fetchData.__span&&Cm.set(k.response,k.fetchData.__span),A){const H=j_(k.fetchData.url),R=H?Ws(H).host:void 0;A.setAttributes({"http.url":H?ts(H):void 0,"server.address":R}),i&&Am(A,e),l==null||l(A,{headers:k.headers})}})),r&&N_(k=>{var H;const A=wx(k,d,f,g,y,u);A&&(i&&Am(A,e),l==null||l(A,{headers:F_((H=k.xhr.__sentry_xhr_v3__)==null?void 0:H.request_headers)}))})}const _x=300;function Am(e,t){const{url:n}=St(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(za(t)){const s=e.end.bind(e);e.end=i=>{const a=i??tn();let l=!1;const u=()=>{l||(l=!0,setTimeout(o),s(a),clearTimeout(d))};r=u;const d=setTimeout(u,_x)}}const o=Pa("resource",({entries:s})=>{s.forEach(i=>{vx(i)&&i.name.endsWith(n)&&(e.setAttributes($_(i)),r())})})}function bx(e,t){const n=Ba();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}const s=r.origin===o;return t?es(r.toString(),t)||s&&es(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?es(e,t):r}}function wx(e,t,n,r,o,s){const i=e.xhr,a=i==null?void 0:i[fi];if(!i||i.__sentry_own_request__||!a)return;const{url:l,method:u}=a,d=Ar()&&t(l);if(e.endTimestamp){const R=i.__sentry_xhr_span_id__;if(!R)return;const O=r[R];O&&(d&&a.status_code!==void 0&&(Sy(O,a.status_code),O.end(),s==null||s(O,{headers:F_(iA(i)),error:e.error})),delete r[R]);return}const f=j_(l),g=Ws(f||l),y=ts(Dk(l)),k=!!lr(),A=d&&k?ss({name:`${u} ${y}`,attributes:{url:ts(l),type:"xhr","http.method":u,"http.url":f?ts(f):void 0,"server.address":g==null?void 0:g.host,[Jt]:"auto.http.browser",[No]:"http.client",...(g==null?void 0:g.search)&&{"http.query":g==null?void 0:g.search},...(g==null?void 0:g.hash)&&{"http.fragment":g==null?void 0:g.hash}}}):new xr;i.__sentry_xhr_span_id__=A.spanContext().spanId,r[i.__sentry_xhr_span_id__]=A,n(l)&&Sx(i,Ar()&&k?A:void 0,o);const H=Pt();return H&&H.emit("beforeOutgoingRequestSpan",A,e),A}function Sx(e,t,n){const{"sentry-trace":r,baggage:o,traceparent:s}=c_({span:t,propagateTraceparent:n});r&&Tx(e,r,o,s)}function Tx(e,t,n,r){var s;const o=(s=e.__sentry_xhr_v3__)==null?void 0:s.request_headers;if(!(o!=null&&o["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(o!=null&&o.traceparent)&&e.setRequestHeader("traceparent",r),n){const i=o==null?void 0:o.baggage;(!i||!gx(i))&&e.setRequestHeader("baggage",n)}}catch{}}function Ex(){ut.document?ut.document.addEventListener("visibilitychange",()=>{const e=lr();if(!e)return;const t=Dn(e);if(ut.document.hidden&&t){const n="cancelled",{op:r,status:o}=St(t);gr&&Ee.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:cn,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):gr&&Ee.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const kx=3600,U_="sentry_previous_trace",Ix="sentry.previous_trace";function Cx(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let o=r?Rx():void 0;e.on("spanStart",i=>{if(Dn(i)!==i)return;const a=Nt().getPropagationContext();o=Ax(o,i,a),r&&xx(o)});let s=!0;n&&e.on("beforeSampling",i=>{if(!o)return;const a=Nt(),l=a.getPropagationContext();if(s&&l.parentSpanId){s=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(mf(o.spanContext))},sampleRand:o.sampleRand}),i.parentSampled=mf(o.spanContext),i.parentSampleRate=o.sampleRate,i.spanAttributes={...i.spanAttributes,[by]:o.sampleRate}})}function Ax(e,t,n){const r=St(t);function o(){var a,l;try{return Number((a=n.dsc)==null?void 0:a.sample_rate)??Number((l=r.data)==null?void 0:l[ep])}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return s;const i=e.spanContext;return i.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=kx&&(gr&&Ee.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[_0]:"previous_trace"}}),t.setAttribute(Ix,`${i.traceId}-${i.spanId}-${mf(i)?1:0}`)),s)}function xx(e){try{ut.sessionStorage.setItem(U_,JSON.stringify(e))}catch(t){gr&&Ee.warn("Could not store previous trace in sessionStorage",t)}}function Rx(){var e;try{const t=(e=ut.sessionStorage)==null?void 0:e.getItem(U_);return JSON.parse(t)}catch{return}}function mf(e){return e.traceFlags===1}const Mx="BrowserTracing",Px=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function $x(){const e=ut.navigator;return e!=null&&e.userAgent?Px.test(e.userAgent):!1}const Nx={...Kl,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...B_},xm=((e={})=>{"enableElementTiming"in e&&Do(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=ut.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:i,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:u,idleTimeout:d,finalTimeout:f,childSpanTimeout:g,markBackgroundSpan:y,traceFetch:k,traceXHR:A,trackFetchStreamPerformance:H,shouldCreateSpanForRequest:R,enableHTTPTimings:O,ignoreResourceSpans:W,ignorePerformanceApiSpans:z,instrumentPageLoad:ce,instrumentNavigation:ne,detectRedirects:Q,linkPreviousTrace:me,consistentTraceSampling:Me,enableReportPageLoaded:xe,onRequestSpanStart:Oe,onRequestSpanEnd:J}={...Nx,...e},de=$x();let Re,Fe,ve;function we(ie,Ie,De=!0){const Pe=Ie.op==="pageload",Ve=Ie.name,ze=u?u(Ie):Ie,Ge=ze.attributes||{};if(Ve!==ze.name&&(Ge[Er]="custom",ze.attributes=Ge),!De){const G=Ks();ss({...ze,startTime:G}).end(G);return}t.name=ze.name,t.source=Ge[Er];const at=Wy(ze,{idleTimeout:d,finalTimeout:f,childSpanTimeout:g,disableAutoFinish:Pe,beforeSpanEnd:G=>{Re==null||Re(),LC(G,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!l,ignoreResourceSpans:W,ignorePerformanceApiSpans:z}),Pm(ie,void 0);const be=Nt(),fe=be.getPropagationContext();be.setPropagationContext({...fe,traceId:at.spanContext().traceId,sampled:ds(at),dsc:os(G)}),Pe&&(ve=void 0)},trimIdleSpanEndTimestamp:!xe});Pe&&xe&&(ve=at),Pm(ie,at);function Ye(){n&&["interactive","complete"].includes(n.readyState)&&ie.emit("idleSpanEnableAutoFinish",at)}Pe&&!xe&&n&&(n.addEventListener("readystatechange",()=>{Ye()}),Ye())}return{name:Mx,setup(ie){var De;if(de){gr&&Ee.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(X0(),Re=xC({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:l||!1,client:ie}),r&&lA(),s&&yt.PerformanceObserver&&((De=PerformanceObserver.supportedEntryTypes)!=null&&De.includes("long-animation-frame"))?MC():o&&RC(),i&&PC(),Q&&n){const Pe=()=>{Fe=tn()};addEventListener("click",Pe,{capture:!0}),addEventListener("keydown",Pe,{capture:!0,passive:!0})}function Ie(){const Pe=$a(ie);Pe&&!St(Pe).timestamp&&(gr&&Ee.log(`[Tracing] Finishing current active span with op: ${St(Pe).op}`),Pe.setAttribute(Ca,"cancelled"),Pe.end())}ie.on("startNavigationSpan",(Pe,Ve)=>{if(Pt()!==ie)return;if(Ve!=null&&Ve.isRedirect){gr&&Ee.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),we(ie,{op:"navigation.redirect",...Pe},!1);return}Fe=void 0,Ie(),Vr().setPropagationContext({traceId:$o(),sampleRand:Math.random(),propagationSpanId:Ar()?void 0:Io()});const ze=Nt();ze.setPropagationContext({traceId:$o(),sampleRand:Math.random(),propagationSpanId:Ar()?void 0:Io()}),ze.setSDKProcessingMetadata({normalizedRequest:void 0}),we(ie,{op:"navigation",...Pe,parentSpan:null,forceTransaction:!0})}),ie.on("startPageLoadSpan",(Pe,Ve={})=>{if(Pt()!==ie)return;Ie();const ze=Ve.sentryTrace||Rm("sentry-trace")||Mm("sentry-trace"),Ge=Ve.baggage||Rm("baggage")||Mm("baggage"),at=j0(ze,Ge),Ye=Nt();Ye.setPropagationContext(at),Ar()||(Ye.getPropagationContext().propagationSpanId=Io()),Ye.setSDKProcessingMetadata({normalizedRequest:up()}),we(ie,{op:"pageload",...Pe})}),ie.on("endPageloadSpan",()=>{xe&&ve&&(ve.setAttribute(Ca,"reportPageLoaded"),ve.end())})},afterAllSetup(ie){if(de)return;let Ie=Ba();if(me!=="off"&&Cx(ie,{linkPreviousTrace:me,consistentTraceSampling:Me}),ut.location){if(ce){const De=Mr();Ox(ie,{name:ut.location.pathname,startTime:De?De/1e3:void 0,attributes:{[Er]:"url",[Jt]:"auto.pageload.browser"}})}ne&&vp(({to:De,from:Pe})=>{if(Pe===void 0&&(Ie==null?void 0:Ie.indexOf(De))!==-1){Ie=void 0;return}Ie=void 0;const Ve=a_(De),ze=$a(ie),Ge=ze&&Q&&Dx(ze,Fe);q_(ie,{name:(Ve==null?void 0:Ve.pathname)||ut.location.pathname,attributes:{[Er]:"url",[Jt]:"auto.navigation.browser"}},{url:De,isRedirect:Ge})})}y&&Ex(),i&&Lx(ie,d,f,g,t),r&&dA(),yx(ie,{traceFetch:k,traceXHR:A,trackFetchStreamPerformance:H,tracePropagationTargets:ie.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:R,enableHTTPTimings:O,onRequestSpanStart:Oe,onRequestSpanEnd:J})}}});function Ox(e,t,n){e.emit("startPageLoadSpan",t,n),Nt().setTransactionName(t.name);const r=$a(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function q_(e,t,n){const{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});const s=Nt();return s.setTransactionName(t.name),r&&!o&&s.setSDKProcessingMetadata({normalizedRequest:{...up(),url:r}}),$a(e)}function Rm(e){const t=ut.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function Mm(e){var r,o,s;const t=(o=(r=ut.performance)==null?void 0:r.getEntriesByType)==null?void 0:o.call(r,"navigation")[0],n=(s=t==null?void 0:t.serverTiming)==null?void 0:s.find(i=>i.name===e);return n==null?void 0:n.description}function Lx(e,t,n,r,o){const s=ut.document;let i;const a=()=>{const l="ui.action.click",u=$a(e);if(u){const d=St(u).op;if(["navigation","pageload"].includes(d)){gr&&Ee.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(Ca,"interactionInterrupted"),i.end(),i=void 0),!o.name){gr&&Ee.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}i=Wy({name:o.name,op:l,attributes:{[Er]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",a,{capture:!0})}const H_="_sentry_idleSpan";function $a(e){return e[H_]}function Pm(e,t){ar(e,H_,t)}const $m=1.5;function Dx(e,t){const n=St(e),r=Ks(),o=n.start_timestamp;return!(r-o>$m||t&&r-t<=$m)}const W_=["activate","mount"],V_=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,jx=/(?:^|[-_])(\w)/g,Fx=e=>e.replace(jx,t=>t.toUpperCase()).replace(/[-_]/g,""),Bx="<Root>",id="<Anonymous>",Ux=(e,t)=>e.repeat(t),ma=(e,t)=>{if(!e)return id;if(e.$root===e)return Bx;if(!e.$options)return id;const n=e.$options;let r=n.name||n._componentTag||n.__name;const o=n.__file;if(!r&&o){const s=o.match(/([^/\\]+)\.vue$/);s&&(r=s[1])}return(r?`<${Fx(r)}>`:id)+(o&&t!==!1?` at ${o}`:"")},qx=e=>{if(e&&(e._isVue||e.__isVue)&&e.$parent){const t=[];let n=0;for(;e;){if(t.length>0){const o=t[t.length-1];if(o.constructor===e.constructor){n++,e=e.$parent;continue}else n>0&&(t[t.length-1]=[o,n],n=0)}t.push(e),e=e.$parent}return`
39
-
40
- found in
41
-
42
- ${t.map((o,s)=>`${(s===0?"---> ":Ux(" ",5+s*2))+(Array.isArray(o)?`${ma(o[0])}... (${o[1]} recursive calls)`:ma(o))}`).join(`
43
- `)}`}return`
44
-
45
- (found in ${ma(e)})`},Hx=(e,t)=>{const{errorHandler:n}=e.config;e.config.errorHandler=(r,o,s)=>{var u;const i=ma(o,!1),a=o?qx(o):"",l={componentName:i,lifecycleHook:s,trace:a};if((t==null?void 0:t.attachProps)!==!1&&o&&((u=o.$options)!=null&&u.propsData?l.propsData=o.$options.propsData:o.$props&&(l.propsData=o.$props)),setTimeout(()=>{ap(r,{captureContext:{contexts:{vue:l}},mechanism:{handled:!!n,type:"auto.function.vue.error_handler"}})}),typeof n=="function"&&e.config.errorHandler)n.call(e,r,o,s);else throw r}},Nm="ui.vue",Wx={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function ad(e,t,n){e.$_sentryRootComponentSpanTimer&&clearTimeout(e.$_sentryRootComponentSpanTimer),e.$_sentryRootComponentSpanTimer=setTimeout(()=>{var r;(r=e.$root)!=null&&r.$_sentryRootComponentSpan&&(e.$root.$_sentryRootComponentSpan.end(t),e.$root.$_sentryRootComponentSpan=void 0)},n)}function Vx(e,t){function n(o){return o.replace(/^<([^\s]*)>(?: at [^\s]*)?$/,"$1")}return e.some(o=>n(t)===n(o))}const zx=(e={})=>{const t=(e.hooks||[]).concat(W_).filter((o,s,i)=>i.indexOf(o)===s),n={},r=e.timeout||2e3;for(const o of t){const s=Wx[o];if(!s){V_&&Ee.warn(`Unknown hook: ${o}`);continue}for(const i of s)n[i]=function(){var g;const a=this.$root===this;a&&(this.$_sentryRootComponentSpan=this.$_sentryRootComponentSpan||ss({name:"Application Render",op:`${Nm}.render`,attributes:{[Jt]:"auto.ui.vue"},onlyIfParent:!0}),ad(this,tn(),r));const l=ma(this,!1);if(!(a||(Array.isArray(e.trackComponents)?Vx(e.trackComponents,l):e.trackComponents))){ad(this,tn(),r);return}this.$_sentryComponentSpans=this.$_sentryComponentSpans||{};const d=i===s[0],f=((g=this.$root)==null?void 0:g.$_sentryRootComponentSpan)||lr();if(d){if(f){const y=this.$_sentryComponentSpans[o];y&&y.end(),this.$_sentryComponentSpans[o]=ss({name:`Vue ${l}`,op:`${Nm}.${o}`,attributes:{[Jt]:"auto.ui.vue"},onlyIfParent:!0})}}else{const y=this.$_sentryComponentSpans[o];if(!y)return;y.end(),ad(this,tn(),r)}}}return n},Gx=yt,Kx={Vue:Gx.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:W_,timeout:2e3,trackComponents:!1}},Yx="Vue",Jx=(e={})=>({name:Yx,setup(t){const n={...Kx,...t.getOptions(),...e};if(!n.Vue&&!n.app){Do(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured. Update your `Sentry.init` call with an appropriate config option: `app` (Application Instance - Vue 3) or `Vue` (Vue Constructor - Vue 2).")});return}n.app?(Array.isArray(n.app)?n.app:[n.app]).forEach(o=>Om(o,n)):n.Vue&&Om(n.Vue,n)}}),Om=(e,t)=>{var n;V_&&((n=e._instance)==null?void 0:n.isMounted)===!0&&Do(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),t.attachErrorHandler&&Hx(e,t),Ar(t)&&e.mixin(zx(t.tracingOptions))};function Xx(e={}){const t={defaultIntegrations:[...D_(),Jx()],...e};return l_(t,"vue"),mx(t)}function Qx(e,t,n){let r=!1;const o="mode"in e;e.onError(s=>ap(s,{mechanism:{handled:!1}})),e.beforeEach((s,i,...a)=>{const l=r?void 0:Zx(),u={};for(const g of Object.keys(s.params))u[`url.path.parameter.${g}`]=s.params[g],u[`params.${g}`]=s.params[g];for(const g of Object.keys(s.query)){const y=s.query[g];y&&(u[`query.${g}`]=y)}let d=s.path,f="url";if(s.name&&t.routeLabel!=="path")d=s.name.toString(),f="custom";else if(s.matched.length>0){const g=s.matched.length-1;d=s.matched[g].path,f="route"}if(Nt().setTransactionName(d),t.instrumentPageLoad&&l&&(St(l).data[Er]!=="custom"&&(l.updateName(d),l.setAttribute(Er,f)),l.setAttributes({...u,[Jt]:"auto.pageload.vue"}),r=!0),t.instrumentNavigation&&!l&&n({name:d,op:"navigation",attributes:{...u,[Jt]:"auto.navigation.vue",[Er]:f}}),o){const g=a[0];typeof g=="function"&&g()}})}function Zx(){const e=lr(),t=e&&Dn(e);return t&&St(t).op==="pageload"?t:void 0}function e1(e={}){if(!e.router)return xm(e);const t=xm({...e,instrumentNavigation:!1}),{router:n,instrumentNavigation:r=!0,instrumentPageLoad:o=!0,routeLabel:s="name"}=e;return{...t,afterAllSetup(i){t.afterAllSetup(i),Qx(n,{routeLabel:s,instrumentNavigation:r,instrumentPageLoad:o},l=>{q_(i,l)})}}}const t1="modulepreload",n1=function(e){return"/"+e},Lm={},ld=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=i(n.map(u=>{if(u=n1(u),u in Lm)return;Lm[u]=!0;const d=u.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":t1,d||(g.as="script"),g.crossOrigin="",g.href=u,l&&g.setAttribute("nonce",l),document.head.appendChild(g),d)return new Promise((y,k)=>{g.addEventListener("load",y),g.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};/*!
46
- * vue-router v4.6.4
47
- * (c) 2025 Eduardo San Martin Morote
48
- * @license MIT
49
- */const ci=typeof document<"u";function z_(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function r1(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&z_(e.default)}const xt=Object.assign;function cd(e,t){const n={};for(const r in t){const o=t[r];n[r]=Wr(o)?o.map(e):e(o)}return n}const ga=()=>{},Wr=Array.isArray;function Dm(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const G_=/#/g,o1=/&/g,s1=/\//g,i1=/=/g,a1=/\?/g,K_=/\+/g,l1=/%5B/g,c1=/%5D/g,Y_=/%5E/g,u1=/%60/g,J_=/%7B/g,d1=/%7C/g,X_=/%7D/g,f1=/%20/g;function yp(e){return e==null?"":encodeURI(""+e).replace(d1,"|").replace(l1,"[").replace(c1,"]")}function p1(e){return yp(e).replace(J_,"{").replace(X_,"}").replace(Y_,"^")}function gf(e){return yp(e).replace(K_,"%2B").replace(f1,"+").replace(G_,"%23").replace(o1,"%26").replace(u1,"`").replace(J_,"{").replace(X_,"}").replace(Y_,"^")}function h1(e){return gf(e).replace(i1,"%3D")}function m1(e){return yp(e).replace(G_,"%23").replace(a1,"%3F")}function g1(e){return m1(e).replace(s1,"%2F")}function Na(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const v1=/\/$/,y1=e=>e.replace(v1,"");function ud(e,t,n="/"){let r,o={},s="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),s=t.slice(l,a>0?a:t.length),o=e(s.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=S1(r??t,n),{fullPath:r+s+i,path:r,query:o,hash:Na(i)}}function _1(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function jm(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function b1(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&xi(t.matched[r],n.matched[o])&&Q_(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function xi(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Q_(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!w1(e[n],t[n]))return!1;return!0}function w1(e,t){return Wr(e)?Fm(e,t):Wr(t)?Fm(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Fm(e,t){return Wr(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function S1(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(i).join("/")}const zo={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let vf=(function(e){return e.pop="pop",e.push="push",e})({}),dd=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function T1(e){if(!e)if(ci){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),y1(e)}const E1=/^[^#]+#/;function k1(e,t){return e.replace(E1,"#")+t}function I1(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Vc=()=>({left:window.scrollX,top:window.scrollY});function C1(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=I1(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Bm(e,t){return(history.state?history.state.position-t:-1)+e}const yf=new Map;function A1(e,t){yf.set(e,t)}function x1(e){const t=yf.get(e);return yf.delete(e),t}function R1(e){return typeof e=="string"||e&&typeof e=="object"}function Z_(e){return typeof e=="string"||typeof e=="symbol"}let Kt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const eb=Symbol("");Kt.MATCHER_NOT_FOUND+"",Kt.NAVIGATION_GUARD_REDIRECT+"",Kt.NAVIGATION_ABORTED+"",Kt.NAVIGATION_CANCELLED+"",Kt.NAVIGATION_DUPLICATED+"";function Ri(e,t){return xt(new Error,{type:e,[eb]:!0},t)}function vo(e,t){return e instanceof Error&&eb in e&&(t==null||!!(e.type&t))}const M1=["params","query","hash"];function P1(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of M1)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function $1(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const o=n[r].replace(K_," "),s=o.indexOf("="),i=Na(s<0?o:o.slice(0,s)),a=s<0?null:Na(o.slice(s+1));if(i in t){let l=t[i];Wr(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Um(e){let t="";for(let n in e){const r=e[n];if(n=h1(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Wr(r)?r.map(o=>o&&gf(o)):[r&&gf(r)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function N1(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Wr(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const O1=Symbol(""),qm=Symbol(""),zc=Symbol(""),_p=Symbol(""),_f=Symbol("");function ra(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Jo(e,t,n,r,o,s=i=>i()){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((a,l)=>{const u=g=>{g===!1?l(Ri(Kt.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):R1(g)?l(Ri(Kt.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&r.enterCallbacks[o]===i&&typeof g=="function"&&i.push(g),a())},d=s(()=>e.call(r&&r.instances[o],t,n,u));let f=Promise.resolve(d);e.length<3&&(f=f.then(u)),f.catch(g=>l(g))})}function fd(e,t,n,r,o=s=>s()){const s=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(z_(l)){const u=(l.__vccOpts||l)[t];u&&s.push(Jo(u,n,r,i,a,o))}else{let u=l();s.push(()=>u.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=r1(d)?d.default:d;i.mods[a]=d,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&Jo(g,n,r,i,a,o)()}))}}return s}function L1(e,t){const n=[],r=[],o=[],s=Math.max(t.matched.length,e.matched.length);for(let i=0;i<s;i++){const a=t.matched[i];a&&(e.matched.find(u=>xi(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>xi(u,l))||o.push(l))}return[n,r,o]}/*!
50
- * vue-router v4.6.4
51
- * (c) 2025 Eduardo San Martin Morote
52
- * @license MIT
53
- */let D1=()=>location.protocol+"//"+location.host;function tb(e,t){const{pathname:n,search:r,hash:o}=t,s=e.indexOf("#");if(s>-1){let i=o.includes(e.slice(s))?e.slice(s).length:1,a=o.slice(i);return a[0]!=="/"&&(a="/"+a),jm(a,"")}return jm(n,e)+r+o}function j1(e,t,n,r){let o=[],s=[],i=null;const a=({state:g})=>{const y=tb(e,location),k=n.value,A=t.value;let H=0;if(g){if(n.value=y,t.value=g,i&&i===k){i=null;return}H=A?g.position-A.position:0}else r(y);o.forEach(R=>{R(n.value,k,{delta:H,type:vf.pop,direction:H?H>0?dd.forward:dd.back:dd.unknown})})};function l(){i=n.value}function u(g){o.push(g);const y=()=>{const k=o.indexOf(g);k>-1&&o.splice(k,1)};return s.push(y),y}function d(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(xt({},g.state,{scroll:Vc()}),"")}}function f(){for(const g of s)g();s=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:l,listen:u,destroy:f}}function Hm(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?Vc():null}}function F1(e){const{history:t,location:n}=window,r={value:tb(e,n)},o={value:t.state};o.value||s(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(l,u,d){const f=e.indexOf("#"),g=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:D1()+e+l;try{t[d?"replaceState":"pushState"](u,"",g),o.value=u}catch(y){console.error(y),n[d?"replace":"assign"](g)}}function i(l,u){s(l,xt({},t.state,Hm(o.value.back,l,o.value.forward,!0),u,{position:o.value.position}),!0),r.value=l}function a(l,u){const d=xt({},o.value,t.state,{forward:l,scroll:Vc()});s(d.current,d,!0),s(l,xt({},Hm(r.value,l,null),{position:d.position+1},u),!1),r.value=l}return{location:r,state:o,push:a,replace:i}}function B1(e){e=T1(e);const t=F1(e),n=j1(e,t.state,t.location,t.replace);function r(s,i=!0){i||n.pauseListeners(),history.go(s)}const o=xt({location:"",base:e,go:r,createHref:k1.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function U1(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),B1(e)}let Ds=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var ln=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(ln||{});const q1={type:Ds.Static,value:""},H1=/[a-zA-Z0-9_]/;function W1(e){if(!e)return[[]];if(e==="/")return[[q1]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(y){throw new Error(`ERR (${n})/"${u}": ${y}`)}let n=ln.Static,r=n;const o=[];let s;function i(){s&&o.push(s),s=[]}let a=0,l,u="",d="";function f(){u&&(n===ln.Static?s.push({type:Ds.Static,value:u}):n===ln.Param||n===ln.ParamRegExp||n===ln.ParamRegExpEnd?(s.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),s.push({type:Ds.Param,value:u,regexp:d,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function g(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==ln.ParamRegExp){r=n,n=ln.EscapeNext;continue}switch(n){case ln.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=ln.Param):g();break;case ln.EscapeNext:g(),n=r;break;case ln.Param:l==="("?n=ln.ParamRegExp:H1.test(l)?g():(f(),n=ln.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case ln.ParamRegExp:l===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+l:n=ln.ParamRegExpEnd:d+=l;break;case ln.ParamRegExpEnd:f(),n=ln.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,d="";break;default:t("Unknown state");break}}return n===ln.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),o}const Wm="[^/]+?",V1={sensitive:!1,strict:!1,start:!0,end:!0};var Gn=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Gn||{});const z1=/[.+*?^${}()[\]/\\]/g;function G1(e,t){const n=xt({},V1,t),r=[];let o=n.start?"^":"";const s=[];for(const u of e){const d=u.length?[]:[Gn.Root];n.strict&&!u.length&&(o+="/");for(let f=0;f<u.length;f++){const g=u[f];let y=Gn.Segment+(n.sensitive?Gn.BonusCaseSensitive:0);if(g.type===Ds.Static)f||(o+="/"),o+=g.value.replace(z1,"\\$&"),y+=Gn.Static;else if(g.type===Ds.Param){const{value:k,repeatable:A,optional:H,regexp:R}=g;s.push({name:k,repeatable:A,optional:H});const O=R||Wm;if(O!==Wm){y+=Gn.BonusCustomRegExp;try{`${O}`}catch(z){throw new Error(`Invalid custom RegExp for param "${k}" (${O}): `+z.message)}}let W=A?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;f||(W=H&&u.length<2?`(?:/${W})`:"/"+W),H&&(W+="?"),o+=W,y+=Gn.Dynamic,H&&(y+=Gn.BonusOptional),A&&(y+=Gn.BonusRepeatable),O===".*"&&(y+=Gn.BonusWildcard)}d.push(y)}r.push(d)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=Gn.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function a(u){const d=u.match(i),f={};if(!d)return null;for(let g=1;g<d.length;g++){const y=d[g]||"",k=s[g-1];f[k.name]=y&&k.repeatable?y.split("/"):y}return f}function l(u){let d="",f=!1;for(const g of e){(!f||!d.endsWith("/"))&&(d+="/"),f=!1;for(const y of g)if(y.type===Ds.Static)d+=y.value;else if(y.type===Ds.Param){const{value:k,repeatable:A,optional:H}=y,R=k in u?u[k]:"";if(Wr(R)&&!A)throw new Error(`Provided param "${k}" is an array but it is not repeatable (* or + modifiers)`);const O=Wr(R)?R.join("/"):R;if(!O)if(H)g.length<2&&(d.endsWith("/")?d=d.slice(0,-1):f=!0);else throw new Error(`Missing required param "${k}"`);d+=O}}return d||"/"}return{re:i,score:r,keys:s,parse:a,stringify:l}}function K1(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Gn.Static+Gn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Gn.Static+Gn.Segment?1:-1:0}function nb(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const s=K1(r[n],o[n]);if(s)return s;n++}if(Math.abs(o.length-r.length)===1){if(Vm(r))return 1;if(Vm(o))return-1}return o.length-r.length}function Vm(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Y1={strict:!1,end:!0,sensitive:!1};function J1(e,t,n){const r=G1(W1(e.path),n),o=xt(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function X1(e,t){const n=[],r=new Map;t=Dm(Y1,t);function o(f){return r.get(f)}function s(f,g,y){const k=!y,A=Gm(f);A.aliasOf=y&&y.record;const H=Dm(t,f),R=[A];if("alias"in f){const z=typeof f.alias=="string"?[f.alias]:f.alias;for(const ce of z)R.push(Gm(xt({},A,{components:y?y.record.components:A.components,path:ce,aliasOf:y?y.record:A})))}let O,W;for(const z of R){const{path:ce}=z;if(g&&ce[0]!=="/"){const ne=g.record.path,Q=ne[ne.length-1]==="/"?"":"/";z.path=g.record.path+(ce&&Q+ce)}if(O=J1(z,g,H),y?y.alias.push(O):(W=W||O,W!==O&&W.alias.push(O),k&&f.name&&!Km(O)&&i(f.name)),rb(O)&&l(O),A.children){const ne=A.children;for(let Q=0;Q<ne.length;Q++)s(ne[Q],O,y&&y.children[Q])}y=y||O}return W?()=>{i(W)}:ga}function i(f){if(Z_(f)){const g=r.get(f);g&&(r.delete(f),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(f);g>-1&&(n.splice(g,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const g=eR(f,n);n.splice(g,0,f),f.record.name&&!Km(f)&&r.set(f.record.name,f)}function u(f,g){let y,k={},A,H;if("name"in f&&f.name){if(y=r.get(f.name),!y)throw Ri(Kt.MATCHER_NOT_FOUND,{location:f});H=y.record.name,k=xt(zm(g.params,y.keys.filter(W=>!W.optional).concat(y.parent?y.parent.keys.filter(W=>W.optional):[]).map(W=>W.name)),f.params&&zm(f.params,y.keys.map(W=>W.name))),A=y.stringify(k)}else if(f.path!=null)A=f.path,y=n.find(W=>W.re.test(A)),y&&(k=y.parse(A),H=y.record.name);else{if(y=g.name?r.get(g.name):n.find(W=>W.re.test(g.path)),!y)throw Ri(Kt.MATCHER_NOT_FOUND,{location:f,currentLocation:g});H=y.record.name,k=xt({},g.params,f.params),A=y.stringify(k)}const R=[];let O=y;for(;O;)R.unshift(O.record),O=O.parent;return{name:H,path:A,params:k,matched:R,meta:Z1(R)}}e.forEach(f=>s(f));function d(){n.length=0,r.clear()}return{addRoute:s,resolve:u,removeRoute:i,clearRoutes:d,getRoutes:a,getRecordMatcher:o}}function zm(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Gm(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Q1(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Q1(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Km(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Z1(e){return e.reduce((t,n)=>xt(t,n.meta),{})}function eR(e,t){let n=0,r=t.length;for(;n!==r;){const s=n+r>>1;nb(e,t[s])<0?r=s:n=s+1}const o=tR(e);return o&&(r=t.lastIndexOf(o,r-1)),r}function tR(e){let t=e;for(;t=t.parent;)if(rb(t)&&nb(e,t)===0)return t}function rb({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ym(e){const t=Br(zc),n=Br(_p),r=oe(()=>{const l=Be(e.to);return t.resolve(l)}),o=oe(()=>{const{matched:l}=r.value,{length:u}=l,d=l[u-1],f=n.matched;if(!d||!f.length)return-1;const g=f.findIndex(xi.bind(null,d));if(g>-1)return g;const y=Jm(l[u-2]);return u>1&&Jm(d)===y&&f[f.length-1].path!==y?f.findIndex(xi.bind(null,l[u-2])):g}),s=oe(()=>o.value>-1&&iR(n.params,r.value.params)),i=oe(()=>o.value>-1&&o.value===n.matched.length-1&&Q_(n.params,r.value.params));function a(l={}){if(sR(l)){const u=t[Be(e.replace)?"replace":"push"](Be(e.to)).catch(ga);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:oe(()=>r.value.href),isActive:s,isExactActive:i,navigate:a}}function nR(e){return e.length===1?e[0]:e}const rR=In({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Ym,setup(e,{slots:t}){const n=xc(Ym(e)),{options:r}=Br(zc),o=oe(()=>({[Xm(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Xm(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=t.default&&nR(t.default(n));return e.custom?s:Gf("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),oR=rR;function sR(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function iR(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!Wr(o)||o.length!==r.length||r.some((s,i)=>s.valueOf()!==o[i].valueOf()))return!1}return!0}function Jm(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Xm=(e,t,n)=>e??t??n,aR=In({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Br(_f),o=oe(()=>e.route||r.value),s=Br(qm,0),i=oe(()=>{let u=Be(s);const{matched:d}=o.value;let f;for(;(f=d[u])&&!f.components;)u++;return u}),a=oe(()=>o.value.matched[i.value]);Ul(qm,oe(()=>i.value+1)),Ul(O1,a),Ul(_f,o);const l=N();return ct(()=>[l.value,a.value,e.name],([u,d,f],[g,y,k])=>{d&&(d.instances[f]=u,y&&y!==d&&u&&u===g&&(d.leaveGuards.size||(d.leaveGuards=y.leaveGuards),d.updateGuards.size||(d.updateGuards=y.updateGuards))),u&&d&&(!y||!xi(d,y)||!g)&&(d.enterCallbacks[f]||[]).forEach(A=>A(u))},{flush:"post"}),()=>{const u=o.value,d=e.name,f=a.value,g=f&&f.components[d];if(!g)return Qm(n.default,{Component:g,route:u});const y=f.props[d],k=y?y===!0?u.params:typeof y=="function"?y(u):y:null,H=Gf(g,xt({},k,t,{onVnodeUnmounted:R=>{R.component.isUnmounted&&(f.instances[d]=null)},ref:l}));return Qm(n.default,{Component:H,route:u})||H}}});function Qm(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const lR=aR;function cR(e){const t=X1(e.routes,e),n=e.parseQuery||$1,r=e.stringifyQuery||Um,o=e.history,s=ra(),i=ra(),a=ra(),l=jw(zo);let u=zo;ci&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=cd.bind(null,G=>""+G),f=cd.bind(null,g1),g=cd.bind(null,Na);function y(G,be){let fe,je;return Z_(G)?(fe=t.getRecordMatcher(G),je=be):je=G,t.addRoute(je,fe)}function k(G){const be=t.getRecordMatcher(G);be&&t.removeRoute(be)}function A(){return t.getRoutes().map(G=>G.record)}function H(G){return!!t.getRecordMatcher(G)}function R(G,be){if(be=xt({},be||l.value),typeof G=="string"){const q=ud(n,G,be.path),Z=t.resolve({path:q.path},be),X=o.createHref(q.fullPath);return xt(q,Z,{params:g(Z.params),hash:Na(q.hash),redirectedFrom:void 0,href:X})}let fe;if(G.path!=null)fe=xt({},G,{path:ud(n,G.path,be.path).path});else{const q=xt({},G.params);for(const Z in q)q[Z]==null&&delete q[Z];fe=xt({},G,{params:f(q)}),be.params=f(be.params)}const je=t.resolve(fe,be),Xe=G.hash||"";je.params=d(g(je.params));const E=_1(r,xt({},G,{hash:p1(Xe),path:je.path})),I=o.createHref(E);return xt({fullPath:E,hash:Xe,query:r===Um?N1(G.query):G.query||{}},je,{redirectedFrom:void 0,href:I})}function O(G){return typeof G=="string"?ud(n,G,l.value.path):xt({},G)}function W(G,be){if(u!==G)return Ri(Kt.NAVIGATION_CANCELLED,{from:be,to:G})}function z(G){return Q(G)}function ce(G){return z(xt(O(G),{replace:!0}))}function ne(G,be){const fe=G.matched[G.matched.length-1];if(fe&&fe.redirect){const{redirect:je}=fe;let Xe=typeof je=="function"?je(G,be):je;return typeof Xe=="string"&&(Xe=Xe.includes("?")||Xe.includes("#")?Xe=O(Xe):{path:Xe},Xe.params={}),xt({query:G.query,hash:G.hash,params:Xe.path!=null?{}:G.params},Xe)}}function Q(G,be){const fe=u=R(G),je=l.value,Xe=G.state,E=G.force,I=G.replace===!0,q=ne(fe,je);if(q)return Q(xt(O(q),{state:typeof q=="object"?xt({},Xe,q.state):Xe,force:E,replace:I}),be||fe);const Z=fe;Z.redirectedFrom=be;let X;return!E&&b1(r,je,fe)&&(X=Ri(Kt.NAVIGATION_DUPLICATED,{to:Z,from:je}),Pe(je,je,!0,!1)),(X?Promise.resolve(X):xe(Z,je)).catch(Y=>vo(Y)?vo(Y,Kt.NAVIGATION_GUARD_REDIRECT)?Y:De(Y):ie(Y,Z,je)).then(Y=>{if(Y){if(vo(Y,Kt.NAVIGATION_GUARD_REDIRECT))return Q(xt({replace:I},O(Y.to),{state:typeof Y.to=="object"?xt({},Xe,Y.to.state):Xe,force:E}),be||Z)}else Y=J(Z,je,!0,I,Xe);return Oe(Z,je,Y),Y})}function me(G,be){const fe=W(G,be);return fe?Promise.reject(fe):Promise.resolve()}function Me(G){const be=Ge.values().next().value;return be&&typeof be.runWithContext=="function"?be.runWithContext(G):G()}function xe(G,be){let fe;const[je,Xe,E]=L1(G,be);fe=fd(je.reverse(),"beforeRouteLeave",G,be);for(const q of je)q.leaveGuards.forEach(Z=>{fe.push(Jo(Z,G,be))});const I=me.bind(null,G,be);return fe.push(I),Ye(fe).then(()=>{fe=[];for(const q of s.list())fe.push(Jo(q,G,be));return fe.push(I),Ye(fe)}).then(()=>{fe=fd(Xe,"beforeRouteUpdate",G,be);for(const q of Xe)q.updateGuards.forEach(Z=>{fe.push(Jo(Z,G,be))});return fe.push(I),Ye(fe)}).then(()=>{fe=[];for(const q of E)if(q.beforeEnter)if(Wr(q.beforeEnter))for(const Z of q.beforeEnter)fe.push(Jo(Z,G,be));else fe.push(Jo(q.beforeEnter,G,be));return fe.push(I),Ye(fe)}).then(()=>(G.matched.forEach(q=>q.enterCallbacks={}),fe=fd(E,"beforeRouteEnter",G,be,Me),fe.push(I),Ye(fe))).then(()=>{fe=[];for(const q of i.list())fe.push(Jo(q,G,be));return fe.push(I),Ye(fe)}).catch(q=>vo(q,Kt.NAVIGATION_CANCELLED)?q:Promise.reject(q))}function Oe(G,be,fe){a.list().forEach(je=>Me(()=>je(G,be,fe)))}function J(G,be,fe,je,Xe){const E=W(G,be);if(E)return E;const I=be===zo,q=ci?history.state:{};fe&&(je||I?o.replace(G.fullPath,xt({scroll:I&&q&&q.scroll},Xe)):o.push(G.fullPath,Xe)),l.value=G,Pe(G,be,fe,I),De()}let de;function Re(){de||(de=o.listen((G,be,fe)=>{if(!at.listening)return;const je=R(G),Xe=ne(je,at.currentRoute.value);if(Xe){Q(xt(Xe,{replace:!0,force:!0}),je).catch(ga);return}u=je;const E=l.value;ci&&A1(Bm(E.fullPath,fe.delta),Vc()),xe(je,E).catch(I=>vo(I,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_CANCELLED)?I:vo(I,Kt.NAVIGATION_GUARD_REDIRECT)?(Q(xt(O(I.to),{force:!0}),je).then(q=>{vo(q,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_DUPLICATED)&&!fe.delta&&fe.type===vf.pop&&o.go(-1,!1)}).catch(ga),Promise.reject()):(fe.delta&&o.go(-fe.delta,!1),ie(I,je,E))).then(I=>{I=I||J(je,E,!1),I&&(fe.delta&&!vo(I,Kt.NAVIGATION_CANCELLED)?o.go(-fe.delta,!1):fe.type===vf.pop&&vo(I,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),Oe(je,E,I)}).catch(ga)}))}let Fe=ra(),ve=ra(),we;function ie(G,be,fe){De(G);const je=ve.list();return je.length?je.forEach(Xe=>Xe(G,be,fe)):console.error(G),Promise.reject(G)}function Ie(){return we&&l.value!==zo?Promise.resolve():new Promise((G,be)=>{Fe.add([G,be])})}function De(G){return we||(we=!G,Re(),Fe.list().forEach(([be,fe])=>G?fe(G):be()),Fe.reset()),G}function Pe(G,be,fe,je){const{scrollBehavior:Xe}=e;if(!ci||!Xe)return Promise.resolve();const E=!fe&&x1(Bm(G.fullPath,0))||(je||!fe)&&history.state&&history.state.scroll||null;return Yt().then(()=>Xe(G,be,E)).then(I=>I&&C1(I)).catch(I=>ie(I,G,be))}const Ve=G=>o.go(G);let ze;const Ge=new Set,at={currentRoute:l,listening:!0,addRoute:y,removeRoute:k,clearRoutes:t.clearRoutes,hasRoute:H,getRoutes:A,resolve:R,options:e,push:z,replace:ce,go:Ve,back:()=>Ve(-1),forward:()=>Ve(1),beforeEach:s.add,beforeResolve:i.add,afterEach:a.add,onError:ve.add,isReady:Ie,install(G){G.component("RouterLink",oR),G.component("RouterView",lR),G.config.globalProperties.$router=at,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>Be(l)}),ci&&!ze&&l.value===zo&&(ze=!0,z(o.location).catch(je=>{}));const be={};for(const je in zo)Object.defineProperty(be,je,{get:()=>l.value[je],enumerable:!0});G.provide(zc,at),G.provide(_p,fv(be)),G.provide(_f,l);const fe=G.unmount;Ge.add(G),G.unmount=function(){Ge.delete(G),Ge.size<1&&(u=zo,de&&de(),de=null,l.value=zo,ze=!1,we=!1),fe()}}};function Ye(G){return G.reduce((be,fe)=>be.then(()=>Me(fe)),Promise.resolve())}return at}function uR(){return Br(zc)}function dR(e){return Br(_p)}const Zm=768;function bp(){const e=N(typeof window<"u"?window.innerWidth<Zm:!1);let t=null;function n(r){e.value=r.matches}return ls(()=>{t=window.matchMedia(`(max-width: ${Zm-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Mc(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const fR={key:0,class:"desktop-sidebar"},pR={class:"desktop-main"},eg="codex-web-local.sidebar-width.v1",hR=260,mR=620,tg=320,gR=In({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=bp();function r(u){return Math.min(mR,Math.max(hR,u))}function o(){if(typeof window>"u")return tg;const u=window.localStorage.getItem(eg),d=Number(u);return Number.isFinite(d)?r(d):tg}const s=N(o()),i=oe(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${s.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(u){typeof window>"u"||window.localStorage.setItem(eg,String(u))}function l(u){u.preventDefault();const d=u.clientX,f=s.value,g=k=>{const A=k.clientX-d;s.value=r(f+A)},y=()=>{a(s.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",y)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",y)}return(u,d)=>(x(),L("div",{class:ht(["desktop-layout",{"is-mobile":Be(n)}]),style:To(i.value)},[Be(n)?(x(),mt(ua,{key:0,to:"body"},[We(ny,{name:"drawer"},{default:At(()=>[e.isSidebarCollapsed?he("",!0):(x(),L("div",{key:0,class:"mobile-drawer-backdrop",onClick:d[1]||(d[1]=f=>u.$emit("close-sidebar"))},[b("aside",{class:"mobile-drawer",onClick:d[0]||(d[0]=pt(()=>{},["stop"]))},[no(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):he("",!0),Be(n)?he("",!0):(x(),L(Je,{key:1},[e.isSidebarCollapsed?he("",!0):(x(),L("aside",fR,[no(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?he("",!0):(x(),L("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),b("section",pR,[no(u.$slots,"content",{},void 0)])],6))}}),kt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},vR=kt(gR,[["__scopeId","data-v-4c6dbcd7"]]);function ng(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Co extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function wp(e,t){const n=ng(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const o=ng(r);return o&&typeof o.message=="string"&&o.message.length>0?o.message:t}function Oo(e,t,n){return e instanceof Co?e:e instanceof Error?new Co(e.message||t,{code:"unknown_error",method:n}):new Co(t,{code:"unknown_error",method:n})}function ob(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function yR(e,t){const n={method:e,params:t??null};return ef({name:`rpc ${e}`,op:"rpc.client"},async()=>{let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new Co(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let o=null;try{o=await r.json()}catch{o=null}if(!r.ok)throw new Co(wp(o,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const s=o;if(!s||typeof s!="object"||!("result"in s))throw new Co(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return s.result})}function _R(e){const t=ob(e);if(!t||typeof t.method!="string"||t.method.length===0)return null;const n=typeof t.atIso=="string"&&t.atIso.length>0?t.atIso:new Date().toISOString();return{method:t.method,params:t.params??null,atIso:n}}function rg(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function bR(e){if(typeof window>"u")return()=>{};let t=null,n=!1,r=null,o=0;const s=()=>{r!==null&&(window.clearTimeout(r),r=null)},i=(d,f)=>{if(n||r!==null)return;const g=Math.min(1e3*2**f,1e4);r=window.setTimeout(()=>{r=null,!n&&d()},g)},a=d=>{const f=_R(d);f&&e(f)},l=(d=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const f=new EventSource("/codex-api/events");let g=!1;f.onmessage=y=>{try{a(JSON.parse(y.data))}catch{}},f.addEventListener("ready",y=>{try{const k=y.data?JSON.parse(y.data):{ok:!0};rg(e,k)}catch{rg(e)}}),f.onerror=()=>{n||g||f.readyState===EventSource.CLOSED&&(g=!0,f.close(),i(()=>l(d+1),d))},t=()=>{g=!0,f.close()}},u=(d=0)=>{if(typeof WebSocket>"u"||n){l();return}t==null||t();const f=window.location.protocol==="https:"?"wss:":"ws:",g=new WebSocket(`${f}//${window.location.host}/codex-api/ws`);let y=!1,k=!1,A=window.setTimeout(()=>{y||n||k||(k=!0,g.close(),l())},2500);g.onopen=()=>{y=!0,s(),A!==null&&(window.clearTimeout(A),A=null),mr({category:"ws",message:"WebSocket connected",level:"info"})},g.onmessage=H=>{try{a(JSON.parse(String(H.data)))}catch{}},g.onerror=()=>{},g.onclose=()=>{if(A!==null&&(window.clearTimeout(A),A=null),!(n||k)){if(o++,mr({category:"ws",message:`WebSocket closed (attempt ${d})`,data:{totalReconnects:o},level:"warning"}),tk("ws_reconnects",o),!y){l();return}i(()=>u(d+1),d)}},t=()=>{k=!0,A!==null&&(window.clearTimeout(A),A=null),g.close()}};return typeof WebSocket<"u"?u():l(),()=>{n=!0,s(),t==null||t()}}async function wR(e){let t;try{t=await fetch("/codex-api/server-requests/respond",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(r){throw new Co(r instanceof Error?r.message:"Failed to reply to server request",{code:"network_error",method:"server-requests/respond"})}let n=null;try{n=await t.json()}catch{n=null}if(!t.ok)throw new Co(wp(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function SR(){const e=await fetch("/codex-api/server-requests/pending");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new Co(wp(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=ob(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function TR(e){const t=e.trim();return t?t.startsWith("\\\\?\\UNC\\")?`\\\\${t.slice(8)}`:t.startsWith("\\\\?\\")?t.slice(4):t:""}function Ht(e){return TR(e)}function ER(e){return/^[a-z]:[\\/]/iu.test(e)||e.startsWith("\\\\")}function kR(e){const t=Ht(e).replace(/[\\/]+/gu,"/");return ER(t)?t.toLowerCase():t}function Ms(e){const t=Ht(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<0?t:t.slice(n+1)}function pd(e){const t=Ht(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?"":t.slice(0,n)}function el(e){return Ms(e)||Ht(e)||"unknown-project"}function og(e){return new Date(e*1e3).toISOString()}function IR(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const CR=/^##\s+(.+?):\s+(.+?)\s*$/,AR=/^#\s*files mentioned by the user\s*:?\s*$/i;function xR(e){var o,s;const t=e.split(`
54
- `).findIndex(i=>AR.test(i.trim()));if(t<0)return[];const n=e.split(`
55
- `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(CR);if(!l)break;const u=(o=l[1])==null?void 0:o.trim(),d=(s=l[2])==null?void 0:s.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");u&&d&&r.push({label:u,path:d})}return r}function RR(e){const t=/(?:^|\n)\s{0,3}#{0,6}\s*my request for codex\s*:?\s*/giu,n=Array.from(e.matchAll(t));if(n.length===0)return e.trim();const r=n.at(-1);if(!r||typeof r.index!="number")return e.trim();const o=r.index+r[0].length;return e.slice(o).trim()}function MR(e){return`/codex-local-image?path=${encodeURIComponent(e)}`}function PR(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],o=[];for(const[a,l]of t.entries())l.type==="text"&&typeof l.text=="string"&&l.text.length>0&&n.push(l.text),l.type==="image"&&typeof l.url=="string"&&l.url.trim().length>0&&r.push(l.url.trim()),l.type==="localImage"&&typeof l.path=="string"&&l.path.trim().length>0&&r.push(MR(l.path.trim())),l.type!=="text"&&l.type!=="image"&&l.type!=="localImage"&&o.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:IR(l),isUnhandled:!0});const s=n.join(`
56
- `),i=xR(s);return{text:RR(s),images:r,fileAttachments:i,rawBlocks:o}}function $R(e){var s;const t=e.replace(/\r\n/g,`
57
- `).trim();if(!t)return null;const n=t.split(`
58
- `),r=[],o=[];for(const i of n){const a=i.trim();if(!a){r.length===0&&o.push("");continue}const l=a.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(l){const u=(l[1]??" ").toLowerCase(),d=(s=l[2])==null?void 0:s.trim();if(!d)continue;let f="pending";u==="x"&&(f="completed"),(u==="~"||u===">"||u==="-")&&(f="inProgress"),r.push({step:d,status:f});continue}o.push(a)}return r.length===0?null:{explanation:o.join(`
59
- `).trim()||void 0,steps:r}}function sg(e){if(!e)return 0;const t=e.replace(/\r\n/g,`
60
- `),n=t.endsWith(`
61
- `)?t.slice(0,-1):t;return n?n.split(`
62
- `).length:0}function NR(e){let t=0,n=0;for(const r of e.replace(/\r\n/g,`
63
- `).split(`
64
- `))if(r&&!(r.startsWith("+++")||r.startsWith("---")||r.startsWith("@@"))){if(r.startsWith("+")){t+=1;continue}r.startsWith("-")&&(n+=1)}return{addedLineCount:t,removedLineCount:n}}function sb(e){return e==="failed"||e==="declined"||e==="completed"?e:"inProgress"}function ib(e){const t=Array.isArray(e)?e:[],n=[];for(const r of t){const o=r,s=typeof o.path=="string"?o.path:"",i=typeof o.diff=="string"?o.diff:"",a=o.kind,l=a==null?void 0:a.type;if(!s||l!=="add"&&l!=="delete"&&l!=="update")continue;const u=l==="update"&&typeof(a==null?void 0:a.move_path)=="string"?a.move_path:null,d=l==="update"?NR(i):l==="add"?{addedLineCount:sg(i),removedLineCount:0}:{addedLineCount:0,removedLineCount:sg(i)};n.push({path:s,operation:l,movedToPath:u,diff:i,...d})}return n}function OR(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=PR(e.id,e.content),n=[];return(t.text.length>0||t.images.length>0||t.fileAttachments.length>0)&&n.push({id:e.id,role:"user",text:t.text,images:t.images,fileAttachments:t.fileAttachments.length>0?t.fileAttachments:void 0,messageType:e.type}),n.push(...t.rawBlocks),n.length===0?[]:n}if(e.type==="reasoning")return[];if(e.type==="plan"){const t=typeof e.text=="string"?e.text:"";return[{id:e.id,role:"assistant",text:t,messageType:"plan",plan:$R(t)??void 0}]}if(e.type==="commandExecution"){const t=e,n=LR(t.status),r=typeof t.command=="string"?t.command:"",o=typeof t.cwd=="string"?t.cwd:null,s=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",i=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:o,status:n,aggregatedOutput:s,exitCode:i}}]}if(e.type==="fileChange"){const t=ib(e.changes),n=sb(e.status);return t.length===0||n!=="completed"?[]:[{id:e.id,role:"system",text:"",messageType:"fileChange",fileChangeStatus:n,fileChanges:t}]}return[]}function LR(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function DR(e){const t=e,n=[t.name,t.title,e.preview];for(const r of n)if(typeof r=="string"&&r.trim().length>0)return r.trim();return""}function jR(e){const t=DR(e);return t.length>0?t:"Untitled thread"}function Sp(e){return(e==null?void 0:e.status)==="inProgress"}function FR(e){const t=e;if(t.inProgress===!0||t.status==="inProgress"||t.turnStatus==="inProgress")return!0;const r=(Array.isArray(e.turns)?e.turns:[]).at(-1);return Sp(r)}function BR(e){const t=e,n=Ht(typeof t.cwd=="string"?t.cwd:e.cwd),r=kR(n),o=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||r.includes("/.codex/worktrees/")||r.includes("/.git/worktrees/");return{id:e.id,title:jR(e),projectName:el(n),cwd:n,hasWorktree:o,createdAtIso:og(e.createdAt),updatedAtIso:og(e.updatedAt),preview:e.preview,unread:!1,inProgress:FR(e)}}function UR(e){const t=new Map;for(const n of e){const r=t.get(n.projectName);r?r.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,r])=>({projectName:n,threads:r.sort((o,s)=>new Date(s.updatedAtIso).getTime()-new Date(o.updatedAtIso).getTime())})).sort((n,r)=>{var i,a;const o=new Date(((i=n.threads[0])==null?void 0:i.updatedAtIso)??0).getTime();return new Date(((a=r.threads[0])==null?void 0:a.updatedAtIso)??0).getTime()-o})}function qR(e){const t=e.data.map(BR);return UR(t)}function Gc(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const o=t[r],s=typeof(o==null?void 0:o.id)=="string"?o.id:void 0,i=Array.isArray(o.items)?o.items:[];for(const a of i)for(const l of OR(a))n.push({...l,turnId:s,turnIndex:r})}return n}function HR(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Sp(t.at(-1))}function ab(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(Sp(r)&&typeof r.id=="string"&&r.id.trim().length>0)return r.id.trim()}return""}const WR=5e3;function hd(e){return e&&e.length>0?e:null}function md(e){return e&&e.length>0?e:null}const ig=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function ag(e,t){const n=t.trim();if(!n)return"";const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),[o="",s=""]=e.split("/",2),i=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=o&&s?`${i}\\s*/\\s*${a}`:r;return n.replace(/^[★☆*\s:|\-]+/u,"").replace(/^(sponsor|star)\s+/i,"").replace(new RegExp(`^${r}\\s*[-:|]*\\s*`,"i"),"").replace(new RegExp(`^${l}\\s*[-:|]*\\s*`,"i"),"").replace(/^(sponsor|star)\s+/i,"").trim()}function _n(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function gt(e){return typeof e=="string"&&e.length>0?e:null}function On(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function vc(e){return typeof e=="boolean"?e:null}function VR(e){return e==="payment_required"?e:null}function zR(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("payment required")||/\b402\b/.test(t)}function lg(e){const t=_n(e);if(!t)return null;const n=On(t.usedPercent??t.used_percent);if(n===null)return null;const r=On(t.windowDurationMins??t.window_minutes);return{usedPercent:n,windowDurationMins:r,windowMinutes:r,resetsAt:On(t.resetsAt??t.resets_at)}}function GR(e){const t=_n(e);if(!t)return null;const n=vc(t.hasCredits??t.has_credits),r=vc(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:gt(t.balance)}}function bf(e){const t=_n(e);if(!t)return null;const n=lg(t.primary),r=lg(t.secondary),o=GR(t.credits);return!n&&!r&&!o?null:{limitId:gt(t.limitId??t.limit_id),limitName:gt(t.limitName??t.limit_name),primary:n,secondary:r,credits:o,planType:gt(t.planType??t.plan_type)}}function lb(e,t=null){const n=_n(e);if(!n)return null;const r=gt(n.accountId),o=gt(n.quotaStatus),s=o==="loading"||o==="ready"||o==="error"?o:"idle";return r?{accountId:r,authMode:gt(n.authMode),email:gt(n.email),planType:gt(n.planType),lastRefreshedAtIso:gt(n.lastRefreshedAtIso)??"",lastActivatedAtIso:gt(n.lastActivatedAtIso),quotaSnapshot:bf(n.quotaSnapshot),quotaUpdatedAtIso:gt(n.quotaUpdatedAtIso),quotaStatus:s,quotaError:gt(n.quotaError),unavailableReason:VR(n.unavailableReason)??(zR(gt(n.quotaError))?"payment_required":null),isActive:vc(n.isActive)??r===t}:null}function cb(e){const t=_n(e);if(!t)return null;const n=_n(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=bf(n==null?void 0:n.codex);return r||bf(t.rateLimits??t.rate_limits)}async function rn(e,t){try{return await yR(e,t)}catch(n){throw Oo(n,`RPC ${e} failed`,e)}}function ub(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n={};for(let r=0;r<t.length;r+=1){const o=t[r];typeof(o==null?void 0:o.id)!="string"||o.id.length===0||(n[o.id]=r)}return n}function KR(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function YR(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}async function JR(){const e=await rn("thread/list",{archived:!1,limit:100,sortKey:"updated_at",modelProviders:[]});return qR(e)}async function XR(e){try{const t=await fetch(`/codex-api/thread-live-state?threadId=${encodeURIComponent(e)}`);return t.ok?await t.json():null}catch{return null}}function QR(e){const t=e.conversationState;if(!t||!Array.isArray(t.turns)||t.turns.length===0)return null;const n={thread:{id:e.threadId,turns:t.turns}};return{messages:Gc(n),inProgress:e.isInProgress,activeTurnId:ab(n),turnIndexByTurnId:ub(n)}}async function ZR(e){const t=await XR(e);if(t&&!t.liveStateError){const o=QR(t);if(o&&o.messages.length>0)return o}const n=await rn("thread/read",{threadId:e,includeTurns:!0});return{messages:Gc(n),inProgress:HR(n),activeTurnId:ab(n),turnIndexByTurnId:ub(n)}}async function eM(){try{return await JR()}catch(e){throw Oo(e,"Failed to load thread groups","thread/list")}}async function cg(e){try{return await ZR(e)}catch(t){throw Oo(t,`Failed to load thread ${e}`,"thread/read")}}function tM(e){const t=_n(e);if(!t)return null;const n=gt(t.key),r=typeof t.text=="string"?t.text:"",o=gt(t.kind);return!n||!o||o!=="meta"&&o!=="hunk"&&o!=="add"&&o!=="remove"&&o!=="context"?null:{key:n,kind:o,text:r,oldLine:On(t.oldLine),newLine:On(t.newLine)}}function nM(e){const t=_n(e);if(!t)return null;const n=gt(t.id),r=typeof t.header=="string"?t.header:"",o=typeof t.patch=="string"?t.patch:"";return n?{id:n,header:r,patch:o,addedLineCount:On(t.addedLineCount)??0,removedLineCount:On(t.removedLineCount)??0,oldStart:On(t.oldStart),oldLineCount:On(t.oldLineCount)??0,newStart:On(t.newStart),newLineCount:On(t.newLineCount)??0,lines:Array.isArray(t.lines)?t.lines.map(s=>tM(s)).filter(s=>s!==null):[]}:null}function rM(e){const t=_n(e);if(!t)return null;const n=gt(t.id),r=gt(t.path),o=gt(t.absolutePath),s=gt(t.operation);return!n||!r||!o||!s||s!=="add"&&s!=="delete"&&s!=="update"&&s!=="rename"?null:{id:n,path:r,absolutePath:o,previousPath:gt(t.previousPath),previousAbsolutePath:gt(t.previousAbsolutePath),operation:s,addedLineCount:On(t.addedLineCount)??0,removedLineCount:On(t.removedLineCount)??0,diff:typeof t.diff=="string"?t.diff:"",hunks:Array.isArray(t.hunks)?t.hunks.map(i=>nM(i)).filter(i=>i!==null):[]}}function db(e){const t=_n(e),n=_n(t==null?void 0:t.data),r=_n(n==null?void 0:n.summary),o=gt(n==null?void 0:n.scope)==="baseBranch"?"baseBranch":"workspace",s=gt(n==null?void 0:n.workspaceView)==="staged"?"staged":"unstaged";return{cwd:gt(n==null?void 0:n.cwd)??"",gitRoot:gt(n==null?void 0:n.gitRoot),isGitRepo:vc(n==null?void 0:n.isGitRepo)??!1,scope:o,workspaceView:s,baseBranch:gt(n==null?void 0:n.baseBranch),baseBranchOptions:Array.isArray(n==null?void 0:n.baseBranchOptions)?n.baseBranchOptions.map(i=>gt(i)).filter(i=>typeof i=="string"&&i.length>0):[],headBranch:gt(n==null?void 0:n.headBranch),mergeBaseSha:gt(n==null?void 0:n.mergeBaseSha),generatedAtIso:gt(n==null?void 0:n.generatedAtIso)??"",summary:{fileCount:On(r==null?void 0:r.fileCount)??0,addedLineCount:On(r==null?void 0:r.addedLineCount)??0,removedLineCount:On(r==null?void 0:r.removedLineCount)??0},files:Array.isArray(n==null?void 0:n.files)?n.files.map(i=>rM(i)).filter(i=>i!==null):[]}}function oM(e){var r;const t=e.trim();if(!t)return{absolutePath:null,startLine:null,endLine:null};const n=t.match(/^(.*?):(\d+)-(\d+)$/u);return n?{absolutePath:((r=n[1])==null?void 0:r.trim())||null,startLine:Number(n[2]),endLine:Number(n[3])}:{absolutePath:t||null,startLine:null,endLine:null}}function sM(e){var i;const t=e.replace(/\r\n/g,`
65
- `).trim();if(!t)return{reviewText:"",summary:"",findings:[]};const n=t.search(/\n(?:Full review comments|Review comment):\n/iu),r=n>=0?t.slice(0,n).trim():t,o=n>=0?t.slice(n).trim():"",s=[];if(o){const l=o.replace(/^(?:Full review comments|Review comment):\n*/iu,"").trim().matchAll(/^- (.+?) — (.+)\n?((?: .*(?:\n|$))*)/gmu);let u=0;for(const d of l){const f=((i=d[1])==null?void 0:i.trim())??"",g=oM(d[2]??""),y=(d[0]??"").trim(),k=(d[3]??"").split(`
66
- `).map(A=>A.replace(/^ /u,"")).join(`
67
- `).trim();s.push({id:`finding:${u}`,title:f||`Finding ${u+1}`,body:k,path:g.absolutePath?g.absolutePath.split("/").filter(Boolean).slice(-1)[0]??g.absolutePath:null,absolutePath:g.absolutePath,startLine:g.startLine,endLine:g.endLine,rawText:y}),u+=1}}return{reviewText:t,summary:r,findings:s}}function ug(e,t){const n=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let r=n.length-1;r>=0;r-=1){const o=n[r],s=Array.isArray(o==null?void 0:o.items)?o.items:[];for(let i=s.length-1;i>=0;i-=1){const a=s[i];if((a==null?void 0:a.type)!==t)continue;const l=typeof a.review=="string"?a.review.trim():"";if(l)return l}}return null}async function r2(e){const t=await rn("thread/read",{threadId:e,includeTurns:!0}),n=ug(t,"exitedReviewMode");return{enteredReviewLabel:ug(t,"enteredReviewMode"),result:n?sM(n):null}}function iM(e){return bR(e)}async function aM(e,t){await wR({id:e,...t})}async function lM(){return SR()}async function dg(){try{const e=await rn("account/rateLimits/read");return cb(e)}catch(e){throw Oo(e,"Failed to load account rate limits","account/rateLimits/read")}}function Tp(e){const t=_n(e),n=gt(t==null?void 0:t.activeAccountId),r=Array.isArray(t==null?void 0:t.accounts)?t==null?void 0:t.accounts:[];return{activeAccountId:n,importedAccountId:gt(t==null?void 0:t.importedAccountId)??void 0,accounts:r.map(o=>lb(o,n)).filter(o=>o!==null)}}async function cM(){const e=await fetch("/codex-api/accounts"),t=await e.json();if(!e.ok)throw new Error(Cn(t,"Failed to load accounts"));const n=_n(t);return Tp(n==null?void 0:n.data)}async function uM(){const e=await fetch("/codex-api/accounts/refresh",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(Cn(t,"Failed to refresh accounts"));const n=_n(t);return Tp(n==null?void 0:n.data)}async function dM(e){const t=await fetch("/codex-api/accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(Cn(n,"Failed to switch account"));const r=_n(n),o=_n(r==null?void 0:r.data),s=lb(o==null?void 0:o.account,gt(o==null?void 0:o.activeAccountId));if(!s)throw new Error("Failed to switch account");return s}async function fM(e){const t=await fetch("/codex-api/accounts/remove",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(Cn(n,"Failed to remove account"));const r=_n(n);return Tp(r==null?void 0:r.data)}async function gd(e){const t=await rn("thread/resume",{threadId:e});return{model:yc(t)}}async function pM(e){await rn("thread/archive",{threadId:e})}async function hM(e,t){await rn("thread/name/set",{threadId:e,name:t})}async function vd(e,t){const n=await rn("thread/rollback",{threadId:e,numTurns:t});return Gc(n)}async function mM(e,t,n){try{const r=await fetch("/codex-api/thread/rollback-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadId:e,turnId:t,cwd:n})});return r.ok?await r.json():{reverted:0,errors:["Server error"]}}catch{return{reverted:0,errors:["Network error"]}}}function wf(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.id;if(typeof r=="string"&&r.length>0)return r}return""}function gM(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.cwd;if(typeof r=="string"&&r.length>0)return r}return""}function yc(e){if(!e||typeof e!="object")return"";const t=e.model;return typeof t=="string"?t.trim():""}async function fg(e,t){try{const n={};typeof e=="string"&&e.trim().length>0&&(n.cwd=e.trim()),typeof t=="string"&&t.trim().length>0&&(n.model=t.trim());const r=await rn("thread/start",n),o=wf(r);if(!o)throw new Error("thread/start did not return a thread id");return{threadId:o,model:yc(r)}}catch(n){throw Oo(n,"Failed to start a new thread","thread/start")}}async function pg(e,t,n){if(arguments.length<=1)try{const r=await rn("thread/fork",{threadId:e,persistExtendedHistory:!0}),o=wf(r);if(!o)throw new Error("thread/fork did not return a thread id");return{threadId:o,cwd:gM(r),model:yc(r),messages:Gc(r)}}catch(r){throw Oo(r,`Failed to fork thread ${e}`,"thread/fork")}try{const r=e.trim();if(!r)throw new Error("thread/fork requires threadId");const o={threadId:r};typeof t=="string"&&t.trim().length>0&&(o.cwd=t.trim()),typeof n=="string"&&n.trim().length>0&&(o.model=n.trim());const s=await rn("thread/fork",o),i=wf(s);if(!i)throw new Error("thread/fork did not return a thread id");return{threadId:i,model:yc(s)}}catch(r){throw Oo(r,`Failed to fork thread ${e}`,"thread/fork")}}function vM(e){var t;if(!e)return null;try{const n=new URL(e,"http://localhost");if(n.pathname!=="/codex-local-image")return null;const r=((t=n.searchParams.get("path"))==null?void 0:t.trim())??"";return r.length>0?r:null}catch{return null}}function yM(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
68
- `;for(const r of t)n+=`
69
- ## ${r.label}: ${r.path}
70
- `;return`${n}
71
- ## My request for Codex:
72
-
73
- ${e}
74
- `}async function _M(e,t,n){var l;const r=(t==null?void 0:t.trim())??"";if(r)return{model:r,reasoningEffort:e==="plan"?hd(n):md(n)};let o=null;try{o=await pb()}catch{o=null}const s=(o==null?void 0:o.model.trim())??"";if(s)return{model:s,reasoningEffort:e==="plan"?hd(n??(o==null?void 0:o.reasoningEffort)):md(n??(o==null?void 0:o.reasoningEffort))};let i=[];try{i=await fb()}catch{i=[]}const a=((l=i.find(u=>u.trim().length>0))==null?void 0:l.trim())??"";if(a)return{model:a,reasoningEffort:e==="plan"?hd(n??(o==null?void 0:o.reasoningEffort)):md(n??(o==null?void 0:o.reasoningEffort))};throw new Error(`${e==="plan"?"Plan":"Default"} mode requires an available model. Wait for models to load and try again.`)}async function yd(e,t,n=[],r,o,s,i=[],a){var l;try{const u=(r==null?void 0:r.trim())??"",f=[{type:"text",text:yM(t,i)}];for(const A of n){const H=A.trim();if(!H)continue;const R=vM(H);if(R){f.push({type:"localImage",path:R});continue}f.push({type:"image",url:H,image_url:H})}if(s)for(const A of s)f.push({type:"skill",name:A.name,path:A.path});const g=i.map(A=>({label:A.label,path:A.path,fsPath:A.fsPath})),y={threadId:e,input:f};if(g.length>0&&(y.attachments=g),u&&(y.model=u),typeof o=="string"&&o.length>0&&(y.effort=o),a){const A=await _M(a,u,o);y.collaborationMode={mode:a,settings:{model:A.model,reasoning_effort:A.reasoningEffort,developer_instructions:null}}}const k=await rn("turn/start",y);return typeof((l=k==null?void 0:k.turn)==null?void 0:l.id)=="string"?k.turn.id.trim():""}catch(u){throw Oo(u,`Failed to start turn for thread ${e}`,"turn/start")}}async function bM(e,t){const n=e.trim(),r=(t==null?void 0:t.trim())||"";if(n)try{if(!r)throw new Error("turn/interrupt requires turnId");await rn("turn/interrupt",{threadId:n,turnId:r})}catch(o){throw Oo(o,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function wM(e){const t=e==="fast"?"fast":"standard";await rn("config/batchWrite",{edits:[{keyPath:"features.fast_mode",value:!0,mergeStrategy:"upsert"},{keyPath:"service_tier",value:t==="fast"?"fast":null,mergeStrategy:t==="fast"?"upsert":"replace"}],filePath:null,expectedVersion:null})}async function SM(){return await(await fetch("/codex-api/free-mode/status")).json()}async function hg(e){return await(await fetch("/codex-api/free-mode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enable:e})})).json()}async function mg(e){return await(await fetch("/codex-api/free-mode/custom-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e})})).json()}async function TM(e,t){return await(await fetch("/codex-api/free-mode/custom-provider",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:t})})).json()}async function fb(){const e=await rn("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}try{const n=await fetch("/codex-api/provider-models",{signal:AbortSignal.timeout(WR)});let r=null;try{r=await n.json()}catch{r=null}if(n.ok&&Array.isArray(r==null?void 0:r.data)){if(r.exclusive)return r.data.filter(o=>typeof o=="string"&&o.trim().length>0);for(const o of r.data){if(typeof o!="string")continue;const s=o.trim();!s||t.includes(s)||t.push(s)}}}catch{}return t}async function pb(){const e=await rn("config/read",{}),t=e.config.model??"",n=KR(e.config.model_reasoning_effort),r=YR(e.config.service_tier);return{model:t,reasoningEffort:n,speedMode:r}}function EM(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function kM(){try{const e=await rn("collaborationMode/list",{}),t=new Set,n=[];for(const r of e.data){const o=r.mode;o!=="default"&&o!=="plan"||t.has(o)||(t.add(o),n.push({value:o,label:EM(r.name||o)||(o==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of ig)t.has(r.value)||n.push(r);return n.sort((r,o)=>r.value===o.value?0:r.value==="default"?-1:1)}}catch{}return ig}function IM(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=s=>{if(!Array.isArray(s))return[];const i=[];for(const a of s)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},r=t.labels,o={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[s,i]of Object.entries(r)){const a=typeof s=="string"?Ht(s):"";a.length>0&&typeof i=="string"&&(o[a]=i)}return{order:n(t.order).map(s=>Ht(s)),labels:o,active:n(t.active).map(s=>Ht(s))}}async function Ps(){const e=await fetch("/codex-api/workspace-roots-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load workspace roots state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return IM(n.data)}async function CM(e,t){const n=(t??"").trim(),r=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e,baseBranch:n||void 0})}),o=await r.json();if(!r.ok||!o.data)throw new Error(o.error||"Failed to create worktree");return{...o.data,cwd:Ht(o.data.cwd),gitRoot:Ht(o.data.gitRoot)}}async function AM(e){const t=e.trim();if(!t)return[];const n=new URLSearchParams({sourceCwd:t}),r=await fetch(`/codex-api/worktree/branches?${n.toString()}`),o=await r.json();if(!r.ok)throw new Error(o.error||"Failed to load branches");const s=Array.isArray(o.data)?o.data:[],i=[],a=new Set;for(const l of s){if(!l||typeof l!="object"||Array.isArray(l))continue;const u=l,d=typeof u.value=="string"?u.value.trim():"",f=typeof u.label=="string"?u.label.trim():"";!d||a.has(d)||(a.add(d),i.push({value:d,label:f||d}))}return i}async function xM(e){const t=e.trim();if(!t)return{currentBranch:null,options:[]};const n=new URLSearchParams({cwd:t}),r=await fetch(`/codex-api/git/branches?${n.toString()}`),o=await r.json();if(!r.ok)throw new Error(o.error||"Failed to load Git branch state");const s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{},i=s.currentBranch,a=typeof i=="string"&&i.trim()?i.trim():null,l=Array.isArray(s.options)?s.options:[],u=[],d=new Set;for(const f of l){if(!f||typeof f!="object"||Array.isArray(f))continue;const g=f,y=typeof g.value=="string"?g.value.trim():"",k=typeof g.label=="string"?g.label.trim():"";!y||d.has(y)||(d.add(y),u.push({value:y,label:k||y}))}return a&&!d.has(a)&&u.unshift({value:a,label:a}),{currentBranch:a,options:u}}async function RM(e,t){var s;const n=await fetch("/codex-api/git/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e.trim(),branch:t.trim()})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to switch branch");const o=(s=r.data)==null?void 0:s.currentBranch;return typeof o=="string"&&o.trim()?o.trim():null}async function o2(e,t,n,r){const o=new URLSearchParams({cwd:e,scope:t,workspaceView:n});r&&r.trim()&&o.set("baseBranch",r.trim());const s=await fetch(`/codex-api/review/snapshot?${o.toString()}`),i=await s.json();if(!s.ok)throw new Error(Cn(i,"Failed to load review snapshot"));return db(i)}async function s2(e){const t=await fetch("/codex-api/review/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(Cn(n,"Failed to apply review action"));return db(n)}async function i2(e){const t=await fetch("/codex-api/review/git/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})}),n=await t.json();if(!t.ok)throw new Error(Cn(n,"Failed to initialize Git"))}async function a2(e,t,n,r){const o=t==="baseBranch"?{type:"baseBranch",branch:(r??"").trim()}:{type:"uncommittedChanges"};if(o.type==="baseBranch"&&!o.branch)throw new Error("Base branch is unavailable");await rn("review/start",{threadId:e,target:o,delivery:"inline"})}async function gg(){const e=await fetch("/codex-api/home-directory"),t=await e.json();if(!e.ok)throw new Error("Failed to load home directory");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function MM(e,t){const n=new URLSearchParams({path:e});(t==null?void 0:t.showHidden)===!0&&n.set("showHidden","1");const r=await fetch(`/codex-local-directories?${n.toString()}`),o=await Ep(r);if(!r.ok){const l=Cn(o,"Failed to load local directories");throw new Error(l)}const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},i=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{},a=Array.isArray(i.entries)?i.entries:[];return{path:typeof i.path=="string"?Ht(i.path):"",parentPath:typeof i.parentPath=="string"?Ht(i.parentPath):"",entries:a.flatMap(l=>{if(!l||typeof l!="object"||Array.isArray(l))return[];const u=l,d=typeof u.name=="string"?u.name.trim():"",f=typeof u.path=="string"?Ht(u.path):"";return d&&f?[{name:d,path:f}]:[]})}}async function l2(e){const t=Array.from(new Set(e.map(a=>Ht(a).trim()).filter(a=>a.length>0)));if(t.length===0)return[];const n=await fetch("/codex-api/local-paths/probe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paths:t})}),r=await Ep(n);if(!n.ok){const a=Cn(r,"Failed to probe local paths");throw new Error(a)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return(Array.isArray(s.entries)?s.entries:[]).flatMap(a=>{if(!a||typeof a!="object"||Array.isArray(a))return[];const l=a,u=typeof l.path=="string"?Ht(l.path):"";return u?[{path:u,exists:l.exists===!0,isDirectory:l.isDirectory===!0}]:[]})}async function Ep(e){const t=await e.text();if(!t)return{};try{return JSON.parse(t)}catch{throw new Error(`Expected JSON response from ${e.url||"request"}`)}}async function _d(e){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save workspace roots state")}async function bd(e,t){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,createIfMissing:(t==null?void 0:t.createIfMissing)===!0,label:(t==null?void 0:t.label)??""})}),r=await n.json();if(!n.ok){const a=Cn(r,"Failed to open project root");throw new Error(a)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return typeof s.path=="string"?Ht(s.path):""}async function PM(e){const t=await fetch("/codex-api/local-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),n=await Ep(t);if(!t.ok){const s=Cn(n,"Failed to create local directory");throw new Error(s)}const r=n&&typeof n=="object"&&!Array.isArray(n)?n:{},o=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?r.data:{};return typeof o.path=="string"?Ht(o.path):""}async function $M(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=Cn(r,"Failed to suggest project name");throw new Error(i)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return{name:typeof s.name=="string"?s.name.trim():"",path:typeof s.path=="string"?Ht(s.path):""}}async function NM(e,t,n=20){const r=e.trim();if(!r)return[];const o=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),s=await o.json();if(!o.ok){const u=Cn(s,"Failed to search files");throw new Error(u)}const i=s&&typeof s=="object"&&!Array.isArray(s)?s:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const f=u.path,g=typeof f=="string"?f.trim():"";g&&l.push({path:g})}return l}async function OM(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}async function LM(e,t){const n=await fetch("/codex-api/telegram/configure-bot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:e,allowedUserIds:t})}),r=await n.json();if(!n.ok){const o=Cn(r,"Failed to connect Telegram bot");throw new Error(o)}}async function DM(){const e=await fetch("/codex-api/telegram/config"),t=await e.json();if(!e.ok){const i=Cn(t,"Failed to load Telegram configuration");throw new Error(i)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{},o=Array.isArray(r.allowedUserIds)?r.allowedUserIds:[],s=[];for(const i of o){if(i==="*"){s.push("*");continue}typeof i=="number"&&Number.isFinite(i)&&s.push(Math.trunc(i))}return{botToken:typeof r.botToken=="string"?r.botToken:"",allowedUserIds:s}}async function jM(){const e=await fetch("/codex-api/telegram/status"),t=await e.json();if(!e.ok){const o=Cn(t,"Failed to load Telegram status");throw new Error(o)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return{configured:r.configured===!0,active:r.active===!0,mappedChats:typeof r.mappedChats=="number"?r.mappedChats:0,mappedThreads:typeof r.mappedThreads=="number"?r.mappedThreads:0,allowedUsers:typeof r.allowedUsers=="number"?r.allowedUsers:0,allowAllUsers:r.allowAllUsers===!0,lastError:typeof r.lastError=="string"?r.lastError:""}}function FM(e){const t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),r=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${r}`}async function BM(e,t=6){const n=Math.min(10,Math.max(1,Math.floor(t)));if(e.startsWith("search-")){const d=new Date;e==="search-daily"?d.setUTCDate(d.getUTCDate()-1):e==="search-weekly"?d.setUTCDate(d.getUTCDate()-7):d.setUTCDate(d.getUTCDate()-30);const f=new URLSearchParams({q:`created:>=${FM(d)}`,sort:"stars",order:"desc",per_page:String(n)}),g=await fetch(`https://api.github.com/search/repositories?${f.toString()}`,{headers:{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}});if(!g.ok)throw new Error(`Failed to fetch GitHub search projects (${g.status})`);const y=await g.json(),k=y&&typeof y=="object"&&!Array.isArray(y)?y:{},A=Array.isArray(k.items)?k.items:[],H=[];for(const R of A){if(!R||typeof R!="object"||Array.isArray(R))continue;const O=R,W=typeof O.id=="number"?O.id:0,z=typeof O.full_name=="string"?O.full_name.trim():"",ce=typeof O.html_url=="string"?O.html_url.trim():"";if(!W||!z||!ce)continue;const[ne="",Q=""]=z.split("/",2);H.push({id:W,fullName:z,owner:ne,repo:Q,url:ce,description:ag(z,typeof O.description=="string"?O.description:""),language:typeof O.language=="string"?O.language.trim():"",stars:typeof O.stargazers_count=="number"?O.stargazers_count:0})}return H}const r=e==="trending-daily"?"daily":e==="trending-weekly"?"weekly":"monthly",o=new URLSearchParams({since:r,limit:String(n)}),s=await fetch(`/codex-api/github-trending?${o.toString()}`),i=await s.json();if(!s.ok){const d=Cn(i,"Failed to fetch GitHub trending projects");throw new Error(d)}const a=i&&typeof i=="object"&&!Array.isArray(i)?i:{},l=Array.isArray(a.data)?a.data:[],u=[];for(const d of l){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d,g=typeof f.id=="number"?f.id:0,y=typeof f.fullName=="string"?f.fullName.trim():"",k=typeof f.url=="string"?f.url.trim():"";if(!g||!y||!k)continue;const[A="",H=""]=y.split("/",2);u.push({id:g,fullName:y,owner:A,repo:H,url:k,description:ag(y,typeof f.description=="string"?f.description:""),language:typeof f.language=="string"?f.language.trim():"",stars:typeof f.stars=="number"?f.stars:0})}return u}function Cn(e,t){const n=e&&typeof e=="object"&&!Array.isArray(e)?e:{},r=n.message;if(typeof r=="string"&&r.trim().length>0)return r;const o=n.error;return typeof o=="string"&&o.trim().length>0?o:t}async function UM(){try{const e=await fetch("/codex-api/thread-titles");return e.ok?(await e.json()).data??{titles:{},order:[]}:{titles:{},order:[]}}catch{return{titles:{},order:[]}}}async function wd(e,t){try{await fetch("/codex-api/thread-titles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,title:t})})}catch{}}async function qM(){try{const e=await fetch("/codex-api/thread-pins");return e.ok?(await e.json()).data??{threadIds:[]}:{threadIds:[]}}catch{return{threadIds:[]}}}async function HM(e){try{await fetch("/codex-api/thread-pins",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadIds:e})})}catch{}}async function WM(e,t){var n;try{return((n=(await rn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function VM(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await rn("skills/list",t),r=[],o=new Set;for(const s of n.data)for(const i of s.skills)!i.name||o.has(i.path)||(o.add(i.path),r.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return r}catch{return[]}}const zM=6e4;async function Sd(e){const t=new AbortController,n=setTimeout(()=>t.abort(),zM);try{const r=new FormData;r.append("file",e);const o=await fetch("/codex-api/upload-file",{method:"POST",body:r,signal:t.signal});return o.ok?(await o.json()).path??null:null}catch{return null}finally{clearTimeout(n)}}const GM={},KM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function YM(e,t){return x(),L("svg",KM,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const kp=kt(GM,[["render",YM]]),JM={},XM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function QM(e,t){return x(),L("svg",XM,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const ZM=kt(JM,[["render",QM]]),eP={},tP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function nP(e,t){return x(),L("svg",tP,[...t[0]||(t[0]=[b("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const oa=kt(eP,[["render",nP]]),rP={},oP={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function sP(e,t){return x(),L("svg",oP,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const _c=kt(rP,[["render",sP]]),iP={},aP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function lP(e,t){return x(),L("svg",aP,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const Ip=kt(iP,[["render",lP]]),cP={},uP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function dP(e,t){return x(),L("svg",uP,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const fP=kt(cP,[["render",dP]]),pP={},hP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function mP(e,t){return x(),L("svg",hP,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const ec=kt(pP,[["render",mP]]),gP={},vP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function yP(e,t){return x(),L("svg",vP,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const Td=kt(gP,[["render",yP]]),_P={key:0,class:"sidebar-menu-row-left"},bP={class:"sidebar-menu-row-main"},wP={key:1,class:"sidebar-menu-row-right"},SP={key:0,class:"sidebar-menu-row-right-default"},TP={key:1,class:"sidebar-menu-row-right-hover"},EP=In({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=vS(),r=oe(()=>!!n.left),o=oe(()=>!!n.right),s=oe(()=>!!n["right-hover"]),i=oe(()=>o.value||s.value);return(a,l)=>(x(),mt(Uf(t.as),Jv({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":s.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:At(()=>[r.value?(x(),L("span",_P,[no(a.$slots,"left",{},void 0,!0)])):he("",!0),b("span",bP,[no(a.$slots,"default",{},void 0,!0)]),i.value?(x(),L("span",wP,[o.value?(x(),L("span",SP,[no(a.$slots,"right",{},void 0,!0)])):he("",!0),s.value?(x(),L("span",TP,[no(a.$slots,"right-hover",{},void 0,!0)])):he("",!0)])):he("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),xs=kt(EP,[["__scopeId","data-v-36239f39"]]),kP={class:"thread-tree-root"},IP={key:0,class:"pinned-section"},CP={class:"thread-list"},AP=["data-menu-open"],xP={class:"thread-left-stack"},RP=["data-state"],MP=["onClick"],PP=["onClick"],$P={class:"thread-row-title-wrap"},NP={class:"thread-row-title-line"},OP={class:"thread-row-title"},LP=["data-state"],DP={class:"thread-row-time"},jP=["onClick"],FP=["aria-expanded"],BP=["data-active"],UP={key:0},qP=["data-active"],HP={key:0},WP={key:1,class:"thread-tree-no-results"},VP={key:2,class:"thread-tree-loading"},zP={key:3,class:"thread-list thread-list-global"},GP=["data-menu-open"],KP={class:"thread-left-stack"},YP=["data-state"],JP=["onClick"],XP=["onClick"],QP={class:"thread-row-title-wrap"},ZP={class:"thread-row-title-line"},e$={class:"thread-row-title"},t$=["data-state"],n$={class:"thread-row-time"},r$=["onClick"],o$=["data-project-name","data-expanded","data-dragging"],s$={class:"project-icon-stack"},i$={class:"project-icon-folder"},a$={class:"project-icon-chevron"},l$=["data-dragging-handle","onMousedown"],c$={class:"project-title"},u$={class:"project-hover-controls"},d$=["onClick"],f$=["data-open-direction"],p$=["onClick"],h$=["onClick"],m$=["onInput"],g$=["aria-label","title","onClick"],v$={key:0,class:"thread-list"},y$=["data-menu-open"],_$={class:"thread-left-stack"},b$=["data-state"],w$=["onClick"],S$=["onClick"],T$={class:"thread-row-title-wrap"},E$={class:"thread-row-title-line"},k$={class:"thread-row-title"},I$=["data-state"],C$={class:"thread-row-time"},A$=["onClick"],x$=["onClick"],R$=["data-open-direction"],M$={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},P$=["onKeydown"],$$={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},N$={class:"rename-thread-subtitle"},O$=4,vg=6,yg="codex-web-local.thread-view-mode.v1",_g="codex-web-local.collapsed-projects.v1",L$=In({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-thread-files","rename-project","rename-thread","remove-project","reorder-project","export-thread","fork-thread"],setup(e,{emit:t}){const n=e,r=t,o=N({}),s=N({});let i=!1;const a=N([]),l=N(""),u=N(""),d=N({}),f=N({}),g=N({}),y=N("actions"),k=N(""),A=N(!1),H=N(""),R=N(""),O=N(null),W=N(!1),z=N(""),ce=N(""),ne=N(null),Q=N(null),me=N(null);let Me=null,xe=null;const Oe=N(""),J=N({}),de=new Map,Re=new Map,Fe=new Map,ve=new WeakMap,we=N(null),ie=N(null),Ie=N(!1),De=N(ze()),Pe=typeof window<"u"?new ResizeObserver(T=>{for(const M of T){const m=M.target,w=ve.get(m);w&&fr(w,m)}}):null;function Ve(){if(typeof window>"u")return{};try{const T=window.localStorage.getItem(_g);if(!T)return{};const M=JSON.parse(T);return!M||typeof M!="object"||Array.isArray(M)?{}:M}catch{return{}}}function ze(){return typeof window>"u"?"project":window.localStorage.getItem(yg)==="chronological"?"chronological":"project"}s.value=Ve(),ct(s,T=>{typeof window>"u"||window.localStorage.setItem(_g,JSON.stringify(T))},{deep:!0}),ct(De,T=>{typeof window>"u"||window.localStorage.setItem(yg,T)});const Ge=oe(()=>n.searchQuery.trim().toLowerCase()),at=oe(()=>Ge.value.length>0),Ye=oe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null),G=oe(()=>new Set(a.value));function be(T){if(!at.value)return!0;if(Ye.value)return Ye.value.has(T.id);const M=Ge.value;return T.title.toLowerCase().includes(M)||T.preview.toLowerCase().includes(M)}const fe=oe(()=>at.value?n.groups.map(T=>({...T,threads:T.threads.filter(be)})).filter(T=>T.threads.length>0):n.groups),je=oe(()=>De.value==="chronological"),Xe=oe(()=>{const T=fe.value,M=[];for(const m of T)for(const w of m.threads)G.value.has(w.id)||M.push(w);return M.sort((m,w)=>{const B=new Date(m.updatedAtIso||m.createdAtIso).getTime();return new Date(w.updatedAtIso||w.createdAtIso).getTime()-B})}),E=oe(()=>{const T=new Map;for(const M of n.groups)for(const m of M.threads)T.set(m.id,m);return T});ct(a,T=>{i&&HM(T)}),ct(E,T=>{const M=a.value.filter(m=>T.has(m));M.length!==a.value.length&&(a.value=M)}),ls(async()=>{const{threadIds:T}=await qM(),M=Array.isArray(T)?T.filter(m=>typeof m=="string").map(m=>m.trim()).filter((m,w,B)=>m.length>0&&B.indexOf(m)===w):[];M.length>0&&(a.value=M),i=!0});const I=oe(()=>{const T=new Map;for(const M of n.groups)for(const m of M.threads)T.set(m.id,M.projectName);return T}),q=oe(()=>{const T=new Map;for(const M of n.groups){const m=M.threads.filter(w=>!G.value.has(w.id));T.set(M.projectName,m)}return T}),Z=oe(()=>{const T=new Map;for(const M of n.groups)for(const m of M.threads){const w=new Date(m.updatedAtIso||m.createdAtIso).getTime();T.set(m.id,w)}return T}),X=oe(()=>{const T=u.value;return T?E.value.get(T)??null:null}),Y=oe(()=>a.value.map(T=>E.value.get(T)??null).filter(T=>T!==null).filter(be)),se=oe(()=>{const T=me.value;if(!T||T.dropTargetIndexFull===null||n.groups.length===0)return null;const M=Math.max(0,Math.min(T.dropTargetIndexFull,n.groups.length)),m=M>T.fromIndex?M-1:M,w=Math.max(0,Math.min(m,n.groups.length-1));return w===T.fromIndex?null:w}),pe=oe(()=>{const M=(at.value?fe.value:n.groups).map(ot=>ot.projectName),m=me.value,w=se.value;if(!m||w===null)return M;const B=[...M],[ge]=B.splice(m.fromIndex,1);return ge?(B.splice(w,0,ge),B):M}),ue=oe(()=>{const T={};let M=0;for(const m of pe.value)T[m]=M,M+=Sn(m);return T}),ee=oe(()=>{let T=0;for(const M of pe.value)T+=Sn(M);return{height:`${Math.max(0,T)}px`}});function Ne(T){if(Number.isNaN(T))return"n/a";const M=Math.abs(Date.now()-T);if(M<6e4)return"now";const m=Math.floor(M/6e4);if(m<60)return`${m}m`;const w=Math.floor(m/60);return w<24?`${w}h`:`${Math.floor(w/24)}d`}function Se(T){const M=Z.value.get(T.id);return Ne(typeof M=="number"?M:new Date(T.updatedAtIso||T.createdAtIso).getTime())}function _e(T){return G.value.has(T)}function Ae(T){if(_e(T)){a.value=a.value.filter(M=>M!==T);return}a.value=[T,...a.value]}function P(T){r("select",T)}function $(T){r("export-thread",T),rt()}function j(T){r("fork-thread",T),rt()}function K(T){return`start new thread ${Xn(T)}`}function ae(T){r("start-new-thread",T)}function $e(T){r("browse-thread-files",T),rt()}function Ue(T,M){if(u.value===T){if(M){const m=M.relatedTarget,w=ie.value;if(m instanceof Node&&w&&w.contains(m))return}rt()}}function nt(T){return u.value===T}function rt(){u.value="",g.value={}}function $t(T){if(u.value===T){rt();return}It(),Ie.value=!1,u.value=T,Yt(()=>{Ct(T)})}function bt(T,M){T.preventDefault(),u.value=M}function on(T,M){H.value=T,R.value=M,A.value=!0,rt(),Yt(()=>{var m,w;(m=O.value)==null||m.focus(),(w=O.value)==null||w.select()})}function tt(){A.value=!1,H.value="",R.value=""}function fn(){const T=H.value,M=R.value.trim();!T||!M||(r("rename-thread",{threadId:T,title:M}),tt())}function Xt(T,M){z.value=T,ce.value=M,W.value=!0,rt()}function vr(){W.value=!1,z.value="",ce.value=""}function cr(){const T=z.value;T&&(a.value=a.value.filter(M=>M!==T),r("archive",T),vr())}function Xn(T){return n.projectDisplayNameById[T]??T}function Vt(T){return l.value===T}function It(){l.value="",y.value="actions",k.value=""}function pn(){const T=!Ie.value;T&&(It(),rt()),Ie.value=T}function jt(T){De.value=T,Ie.value=!1}function so(T){if(l.value===T){It();return}rt(),Ie.value=!1,l.value=T,y.value="actions",k.value=Xn(T),Yt(()=>{hn(T)})}function fs(T){rt(),l.value=T,y.value="rename",k.value=Xn(T),Yt(()=>{hn(T)})}function io(T){r("rename-project",{projectName:T,displayName:k.value})}function yr(T){r("remove-project",T),It()}function zr(T,M){if(!T.altKey||T.key!=="ArrowUp"&&T.key!=="ArrowDown")return;const m=n.groups.findIndex(ge=>ge.projectName===M);if(m<0)return;const w=T.key==="ArrowUp"?-1:1,B=Math.max(0,Math.min(m+w,n.groups.length-1));B!==m&&(T.preventDefault(),r("reorder-project",{projectName:M,toIndex:B}))}function bn(T){return o.value[T]===!0}function sn(T){return s.value[T]===!0}function Gr(T){o.value={...o.value,[T]:!bn(T)}}function wn(T){if(Oe.value===T){Oe.value="";return}s.value={...s.value,[T]:!sn(T)}}function Sn(T){const M=J.value[T]??0,m=me.value,B=((m==null?void 0:m.projectName)===T?m.groupHeight:null)??M,ge=sn(T)?0:vg;return Math.max(0,B+ge)}function Qn(T,M){const m=M instanceof HTMLElement?M:M&&"$el"in M&&M.$el instanceof HTMLElement?M.$el:null;if(m){Re.set(T,m);return}Re.delete(T)}function ur(T,M){const m=M instanceof HTMLElement?M:M&&"$el"in M&&M.$el instanceof HTMLElement?M.$el:null;if(m){Fe.set(T,m);return}Fe.delete(T)}function Fn(T){let M=T.parentElement;for(;M;){const m=window.getComputedStyle(M),w=m.overflowY||m.overflow;if(w==="auto"||w==="scroll"||w==="hidden"||w==="clip")return M.getBoundingClientRect();M=M.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Ut(T,M){const m=T.getBoundingClientRect(),w=Fn(T),B=6,ge=w.bottom-m.bottom,ot=m.top-w.top;return ge>=M+B?"down":ot>ge?"up":"down"}function _r(T,M){const m=Fe.get(T);if(!m)return"down";const w=Ut(m,M);return f.value={...f.value,[T]:w},w}function Zn(T){return f.value[T]??"down"}function hn(T){const M=Re.get(T);M&&(d.value={...d.value,[T]:Ut(M,112)})}function qt(T,M,m){return Math.min(Math.max(T,M),m)}function Ct(T){const M=Fe.get(T);if(!M)return;const m=ie.value,w=m==null?void 0:m.getBoundingClientRect(),B=(w==null?void 0:w.height)||(m==null?void 0:m.offsetHeight)||112,ge=(w==null?void 0:w.width)||(m==null?void 0:m.offsetWidth)||160,ot=_r(T,B),st=M.getBoundingClientRect(),dt=8,ft=4,Bt=Math.max(dt,window.innerWidth-ge-dt),Wn=qt(st.right-ge,dt,Bt),yn=qt(ot==="up"?st.top-B-ft:st.bottom+ft,dt,Math.max(dt,window.innerHeight-B-dt));g.value={left:`${Math.round(Wn)}px`,top:`${Math.round(yn)}px`}}function Tn(){const T=u.value;T&&Ct(T)}function An(){window.addEventListener("resize",Tn),document.addEventListener("scroll",Tn,!0)}function xn(){window.removeEventListener("resize",Tn),document.removeEventListener("scroll",Tn,!0)}function zt(T){const M=l.value;if(!M)return!1;const m=Re.get(M);if(!m)return!1;if((typeof T.composedPath=="function"?T.composedPath():[]).includes(m))return!0;const B=T.target;return B instanceof Node?m.contains(B):!1}function Bn(T){const M=u.value;if(!M)return!1;const m=Fe.get(M);if(!m)return!1;const w=typeof T.composedPath=="function"?T.composedPath():[];if(w.includes(m))return!0;const B=ie.value;if(B&&w.includes(B))return!0;const ge=T.target;return ge instanceof Node?!!(m.contains(ge)||B&&B.contains(ge)):!1}function Rn(T){if(Ie.value){const M=we.value,m=typeof T.composedPath=="function"?T.composedPath():[];!!M&&(m.includes(M)||T.target instanceof Node&&M.contains(T.target))||(Ie.value=!1)}l.value&&(zt(T)||It(),u.value&&(Bn(T)||rt()))}function wt(T){l.value&&!zt(T)&&It(),u.value&&!Bn(T)&&rt()}function Tt(){Ie.value&&(Ie.value=!1),l.value&&It(),u.value&&rt()}function br(){window.addEventListener("pointerdown",Rn,{capture:!0}),window.addEventListener("focusin",wt,{capture:!0}),window.addEventListener("blur",Tt)}function dr(){window.removeEventListener("pointerdown",Rn,{capture:!0}),window.removeEventListener("focusin",wt,{capture:!0}),window.removeEventListener("blur",Tt)}function fr(T,M){const m=M.getBoundingClientRect().height;if(!Number.isFinite(m)||m<=0)return;const w=J.value[T];w!==void 0&&Math.abs(w-m)<.5||(J.value={...J.value,[T]:m})}function jo(T,M){const m=de.get(T);m&&m!==M&&Pe&&Pe.unobserve(m);const w=M instanceof HTMLElement?M:M&&"$el"in M&&M.$el instanceof HTMLElement?M.$el:null;if(w){de.set(T,w),ve.set(w,T),fr(T,w),Pe==null||Pe.observe(w);return}m&&(Pe==null||Pe.unobserve(m)),de.delete(T)}function mn(T,M){if(T.button!==0||Q.value||me.value)return;const m=n.groups.findIndex(ot=>ot.projectName===M),w=de.get(M);if(m<0||!w)return;const B=w.getBoundingClientRect(),ge=sn(M)?0:vg;Q.value={projectName:M,fromIndex:m,startClientX:T.clientX,startClientY:T.clientY,pointerOffsetY:T.clientY-B.top,groupLeft:B.left,groupWidth:B.width,groupHeight:B.height,groupOuterHeight:B.height+ge},T.preventDefault(),er()}function er(){window.addEventListener("mousemove",an),window.addEventListener("mouseup",ao),window.addEventListener("keydown",Pr)}function Kr(){window.removeEventListener("mousemove",an),window.removeEventListener("mouseup",ao),window.removeEventListener("keydown",Pr)}function an(T){Me={clientX:T.clientX,clientY:T.clientY},Mn()}function ao(T){nn({clientX:T.clientX,clientY:T.clientY});const M=me.value;if(M&&se.value!==null){const m=n.groups.findIndex(w=>w.projectName===M.projectName);if(m>=0){const w=se.value;w!==m&&r("reorder-project",{projectName:M.projectName,toIndex:w})}}Ft()}function Pr(T){T.key==="Escape"&&(!Q.value&&!me.value||(T.preventDefault(),Ft()))}function Ft(){xe!==null&&(window.cancelAnimationFrame(xe),xe=null),Me=null,Q.value=null,me.value=null,Oe.value="",Kr()}function Mn(){xe===null&&(xe=window.requestAnimationFrame(()=>{if(xe=null,!Me)return;const T=Me;Me=null,nn(T)}))}function nn(T){const M=Q.value;if(!me.value&&M){const m=T.clientX-M.startClientX,w=T.clientY-M.startClientY;if(Math.hypot(m,w)<O$)return;It(),Oe.value=M.projectName,me.value={projectName:M.projectName,fromIndex:M.fromIndex,pointerOffsetY:M.pointerOffsetY,groupLeft:M.groupLeft,groupWidth:M.groupWidth,groupHeight:M.groupHeight,groupOuterHeight:M.groupOuterHeight,ghostTop:T.clientY-M.pointerOffsetY,dropTargetIndexFull:null}}me.value&&lo(T)}function lo(T){const M=me.value;if(!M)return;if(M.ghostTop=T.clientY-M.pointerOffsetY,!Un(T)){M.dropTargetIndexFull=null;return}const m=T.clientY,w=ne.value;if(!w){M.dropTargetIndexFull=null;return}const B=w.getBoundingClientRect(),ge=new Map(n.groups.map((ft,Bt)=>[ft.projectName,Bt])),ot=n.groups.map(ft=>ft.projectName).filter(ft=>ft!==M.projectName);let st=0,dt=n.groups.length;for(const ft of ot){const Bt=ge.get(ft);if(Bt===void 0)continue;const Wn=Sn(ft),yn=B.top+st+Wn/2;if(m<yn){dt=Bt;break}st+=Wn}M.dropTargetIndexFull=dt}function Un(T){const M=ne.value;if(!M)return!1;const m=M.getBoundingClientRect(),w=T.clientX>=m.left&&T.clientX<=m.right,B=T.clientY>=m.top-32&&T.clientY<=m.bottom+32;return w&&B}function qn(T){var M;return((M=me.value)==null?void 0:M.projectName)===T}function $r(T){const M=me.value,m=ue.value[T]??0,w=u.value?I.value.get(u.value)??"":"",B=l.value===T||w===T;return!M||M.projectName!==T?{position:"absolute",top:"0",left:"0",right:"0",zIndex:B?"40":"1",transform:`translate3d(0, ${m}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${M.groupLeft}px`,width:`${M.groupWidth}px`,height:`${M.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${M.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function gn(T){return q.value.get(T.projectName)??[]}function Nr(T){if(at.value)return gn(T);if(sn(T.projectName))return[];const M=gn(T);return bn(T.projectName)?M:M.slice(0,10)}function Hn(T){return at.value?!1:!sn(T.projectName)&&gn(T).length>10}function tr(T){return gn(T).length>0}function Qt(T){return!!T.pendingRequestState||T.inProgress||T.unread}function Le(T){return T.pendingRequestState==="approval"?"Awaiting approval":"Awaiting response"}function ye(T){return T.pendingRequestState==="approval"?"awaiting-approval":T.pendingRequestState==="response"?"awaiting-response":T.inProgress?"working":T.unread?"unread":"idle"}ct(()=>n.groups.map(T=>T.projectName),T=>{var B,ge;const M=((B=me.value)==null?void 0:B.projectName)??((ge=Q.value)==null?void 0:ge.projectName)??"";M&&!n.groups.some(ot=>ot.projectName===M)&&Ft();const m=new Set(T),w=Object.fromEntries(Object.entries(J.value).filter(([ot])=>m.has(ot)));Object.keys(w).length!==Object.keys(J.value).length&&(J.value=w)});const vn=oe(()=>Ie.value||l.value!==""||u.value!=="");return ct(vn,T=>{if(T){br();return}dr()}),ct(u,T=>{if(!T){xn();return}An(),Yt(()=>{Ct(T)})}),zs(()=>{for(const T of de.values())Pe==null||Pe.unobserve(T);de.clear(),Re.clear(),xn(),dr(),Ft()}),(T,M)=>(x(),L("section",kP,[Y.value.length>0?(x(),L("section",IP,[b("ul",CP,[(x(!0),L(Je,null,Dt(Y.value,m=>(x(),L("li",{key:m.id,class:"thread-row-item","data-menu-open":nt(m.id)?"true":"false"},[We(xs,{class:"thread-row","data-active":m.id===e.selectedThreadId,"data-pinned":_e(m.id),"data-menu-open":nt(m.id)?"true":"false","force-right-hover":nt(m.id),onMouseleave:w=>Ue(m.id,w),onContextmenu:w=>bt(w,m.id)},{left:At(()=>[b("span",xP,[Qt(m)?(x(),L("span",{key:0,class:"thread-status-indicator","data-state":ye(m)},null,8,RP)):he("",!0),b("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:w=>Ae(m.id)},[We(Td,{class:"thread-icon"})],8,MP)])]),right:At(()=>[b("span",DP,le(Se(m)),1)]),"right-hover":At(()=>[b("div",{ref_for:!0,ref:w=>ur(m.id,w),class:"thread-menu-wrap"},[b("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:pt(w=>$t(m.id),["stop"])},[We(oa,{class:"thread-icon"})],8,jP)],512)]),default:At(()=>[b("button",{class:"thread-main-button",type:"button",onClick:w=>P(m.id)},[b("span",$P,[b("span",NP,[b("span",OP,le(m.title),1),m.hasWorktree?(x(),mt(ec,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):he("",!0),m.pendingRequestState?(x(),L("span",{key:1,class:"thread-row-request-chip","data-state":m.pendingRequestState},le(Le(m)),9,LP)):he("",!0)])])],8,PP)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,AP))),128))])])):he("",!0),We(xs,{as:"header",class:"thread-tree-header-row"},{right:At(()=>[b("div",{ref_key:"organizeMenuWrapRef",ref:we,class:"organize-menu-wrap"},[b("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Ie.value,"aria-label":"Organize threads",title:"Organize threads",onClick:pn},[We(oa,{class:"thread-icon"})],8,FP),Ie.value?(x(),L("div",{key:0,class:"organize-menu-panel",onClick:M[2]||(M[2]=pt(()=>{},["stop"]))},[M[14]||(M[14]=b("p",{class:"organize-menu-title"},"Organize",-1)),b("button",{class:"organize-menu-item","data-active":De.value==="project",type:"button",onClick:M[0]||(M[0]=m=>jt("project"))},[M[12]||(M[12]=b("span",null,"By project",-1)),De.value==="project"?(x(),L("span",UP,"✓")):he("",!0)],8,BP),b("button",{class:"organize-menu-item","data-active":De.value==="chronological",type:"button",onClick:M[1]||(M[1]=m=>jt("chronological"))},[M[13]||(M[13]=b("span",null,"Chronological list",-1)),De.value==="chronological"?(x(),L("span",HP,"✓")):he("",!0)],8,qP)])):he("",!0)],512)]),default:At(()=>[M[15]||(M[15]=b("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),at.value&&fe.value.length===0?(x(),L("p",WP,"No matching threads")):e.isLoading&&e.groups.length===0?(x(),L("p",VP,"Loading threads...")):je.value?(x(),L("ul",zP,[(x(!0),L(Je,null,Dt(Xe.value,m=>(x(),L("li",{key:m.id,class:"thread-row-item","data-menu-open":nt(m.id)?"true":"false"},[We(xs,{class:"thread-row","data-active":m.id===e.selectedThreadId,"data-pinned":_e(m.id),"data-menu-open":nt(m.id)?"true":"false","force-right-hover":nt(m.id),onMouseleave:w=>Ue(m.id,w),onContextmenu:w=>bt(w,m.id)},{left:At(()=>[b("span",KP,[Qt(m)?(x(),L("span",{key:0,class:"thread-status-indicator","data-state":ye(m)},null,8,YP)):he("",!0),b("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:w=>Ae(m.id)},[We(Td,{class:"thread-icon"})],8,JP)])]),right:At(()=>[b("span",n$,le(Se(m)),1)]),"right-hover":At(()=>[b("div",{ref_for:!0,ref:w=>ur(m.id,w),class:"thread-menu-wrap"},[b("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:pt(w=>$t(m.id),["stop"])},[We(oa,{class:"thread-icon"})],8,r$)],512)]),default:At(()=>[b("button",{class:"thread-main-button",type:"button",onClick:w=>P(m.id)},[b("span",QP,[b("span",ZP,[b("span",e$,le(m.title),1),m.hasWorktree?(x(),mt(ec,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):he("",!0),m.pendingRequestState?(x(),L("span",{key:1,class:"thread-row-request-chip","data-state":m.pendingRequestState},le(Le(m)),9,t$)):he("",!0)])])],8,XP)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,GP))),128))])):(x(),L("div",{key:4,ref_key:"groupsContainerRef",ref:ne,class:"thread-tree-groups",style:To(ee.value)},[(x(!0),L(Je,null,Dt(fe.value,m=>(x(),L("article",{key:m.projectName,ref_for:!0,ref:w=>jo(m.projectName,w),class:"project-group","data-project-name":m.projectName,"data-expanded":!sn(m.projectName),"data-dragging":qn(m.projectName),style:To($r(m.projectName))},[We(xs,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:w=>wn(m.projectName),onKeydown:[w=>zr(w,m.projectName),en(pt(w=>wn(m.projectName),["prevent"]),["enter"]),en(pt(w=>wn(m.projectName),["prevent"]),["space"])]},{left:At(()=>[b("span",s$,[b("span",i$,[sn(m.projectName)?(x(),mt(Ip,{key:0,class:"thread-icon"})):(x(),mt(fP,{key:1,class:"thread-icon"}))]),b("span",a$,[sn(m.projectName)?(x(),mt(ZM,{key:0,class:"thread-icon"})):(x(),mt(kp,{key:1,class:"thread-icon"}))])])]),right:At(()=>[b("div",u$,[b("div",{ref_for:!0,ref:w=>Qn(m.projectName,w),class:"project-menu-wrap"},[b("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:pt(w=>so(m.projectName),["stop"])},[We(oa,{class:"thread-icon"})],8,d$),Vt(m.projectName)?(x(),L("div",{key:0,class:"project-menu-panel","data-open-direction":d.value[m.projectName]??"down",onClick:M[4]||(M[4]=pt(()=>{},["stop"]))},[y.value==="actions"?(x(),L(Je,{key:0},[b("button",{class:"project-menu-item",type:"button",onClick:w=>fs(m.projectName)}," Edit name ",8,p$),b("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:w=>yr(m.projectName)}," Remove ",8,h$)],64)):(x(),L(Je,{key:1},[M[16]||(M[16]=b("label",{class:"project-menu-label"},"Project name",-1)),Kn(b("input",{"onUpdate:modelValue":M[3]||(M[3]=w=>k.value=w),class:"project-menu-input",type:"text",onInput:w=>io(m.projectName)},null,40,m$),[[ir,k.value]])],64))],8,f$)):he("",!0)],512),b("button",{class:"thread-start-button",type:"button","aria-label":K(m.projectName),title:K(m.projectName),onClick:pt(w=>ae(m.projectName),["stop"])},[We(_c,{class:"thread-icon"})],8,g$)])]),default:At(()=>[b("span",{class:"project-main-button","data-dragging-handle":qn(m.projectName),onMousedown:pt(w=>mn(w,m.projectName),["left"])},[b("span",c$,le(Xn(m.projectName)),1)],40,l$)]),_:2},1032,["onClick","onKeydown"]),tr(m)?(x(),L("ul",v$,[(x(!0),L(Je,null,Dt(Nr(m),w=>(x(),L("li",{key:w.id,class:"thread-row-item","data-menu-open":nt(w.id)?"true":"false"},[We(xs,{class:"thread-row","data-active":w.id===e.selectedThreadId,"data-pinned":_e(w.id),"data-menu-open":nt(w.id)?"true":"false","force-right-hover":nt(w.id),onMouseleave:B=>Ue(w.id,B),onContextmenu:B=>bt(B,w.id)},{left:At(()=>[b("span",_$,[Qt(w)?(x(),L("span",{key:0,class:"thread-status-indicator","data-state":ye(w)},null,8,b$)):he("",!0),b("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:B=>Ae(w.id)},[We(Td,{class:"thread-icon"})],8,w$)])]),right:At(()=>[b("span",C$,le(Se(w)),1)]),"right-hover":At(()=>[b("div",{ref_for:!0,ref:B=>ur(w.id,B),class:"thread-menu-wrap"},[b("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:pt(B=>$t(w.id),["stop"])},[We(oa,{class:"thread-icon"})],8,A$)],512)]),default:At(()=>[b("button",{class:"thread-main-button",type:"button",onClick:B=>P(w.id)},[b("span",T$,[b("span",E$,[b("span",k$,le(w.title),1),w.hasWorktree?(x(),mt(ec,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):he("",!0),w.pendingRequestState?(x(),L("span",{key:1,class:"thread-row-request-chip","data-state":w.pendingRequestState},le(Le(w)),9,I$)):he("",!0)])])],8,S$)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,y$))),128))])):(x(),mt(xs,{key:1,as:"p",class:"project-empty-row"},{left:At(()=>[...M[17]||(M[17]=[b("span",{class:"project-empty-spacer"},null,-1)])]),default:At(()=>[M[18]||(M[18]=b("span",{class:"project-empty"},"No threads",-1))]),_:1})),Hn(m)?(x(),mt(xs,{key:2,class:"thread-show-more-row"},{left:At(()=>[...M[19]||(M[19]=[b("span",{class:"thread-show-more-spacer"},null,-1)])]),default:At(()=>[b("button",{class:"thread-show-more-button",type:"button",onClick:w=>Gr(m.projectName)},le(bn(m.projectName)?"Show less":"Show more"),9,x$)]),_:2},1024)):he("",!0)],12,o$))),128))],4)),(x(),mt(ua,{to:"body"},[X.value?(x(),L("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:ie,class:"thread-menu-panel thread-menu-panel-fixed",style:To(g.value),"data-open-direction":Zn(X.value.id),onClick:M[10]||(M[10]=pt(()=>{},["stop"]))},[b("button",{class:"thread-menu-item",type:"button",onClick:M[5]||(M[5]=m=>$e(X.value.id))}," Browse files "),b("button",{class:"thread-menu-item",type:"button",onClick:M[6]||(M[6]=m=>$(X.value.id))}," Export chat "),b("button",{class:"thread-menu-item",type:"button",onClick:M[7]||(M[7]=m=>j(X.value.id))}," Create chat fork "),b("button",{class:"thread-menu-item",type:"button",onClick:M[8]||(M[8]=m=>on(X.value.id,X.value.title))}," Rename thread "),b("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:M[9]||(M[9]=m=>Xt(X.value.id,X.value.title))}," Delete thread ")],12,R$)):he("",!0)])),(x(),mt(ua,{to:"body"},[A.value?(x(),L("div",{key:0,class:"rename-thread-overlay",onClick:pt(tt,["self"])},[b("div",M$,[M[20]||(M[20]=b("h3",{class:"rename-thread-title"},"Rename thread",-1)),M[21]||(M[21]=b("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Kn(b("input",{ref_key:"renameThreadInputRef",ref:O,"onUpdate:modelValue":M[11]||(M[11]=m=>R.value=m),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[en(pt(fn,["prevent"]),["enter"]),en(pt(tt,["prevent"]),["esc"])]},null,40,P$),[[ir,R.value]]),b("div",{class:"rename-thread-actions"},[b("button",{class:"rename-thread-button",type:"button",onClick:tt},"Cancel"),b("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:fn},"Save")])])])):he("",!0)])),(x(),mt(ua,{to:"body"},[W.value?(x(),L("div",{key:0,class:"rename-thread-overlay",onClick:pt(vr,["self"])},[b("div",$$,[M[22]||(M[22]=b("h3",{class:"rename-thread-title"},"Delete thread?",-1)),b("p",N$,' This will archive the thread "'+le(ce.value)+'". You can find it later in archived threads. ',1),b("div",{class:"rename-thread-actions"},[b("button",{class:"rename-thread-button",type:"button",onClick:vr},"Cancel"),b("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:cr},"Delete")])])])):he("",!0)]))]))}}),D$=kt(L$,[["__scopeId","data-v-24f893c5"]]),j$={class:"content-header"},F$={class:"content-leading"},B$={class:"content-title"},U$={class:"content-actions"},q$=In({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(x(),L("header",j$,[b("div",F$,[no(t.$slots,"leading",{},void 0)]),b("h1",B$,le(e.title),1),b("div",U$,[no(t.$slots,"actions",{},void 0)])]))}}),H$=kt(q$,[["__scopeId","data-v-66ee223c"]]),bg=.0025,Ed=3,wg=2,W$=256;function V$(e){var Oe;const t=N("idle"),n=N(typeof navigator<"u"&&!!((Oe=navigator.mediaDevices)!=null&&Oe.getUserMedia)),r=N(0),o=N(null);let s=null,i=null,a=[],l=null,u=null,d=null,f=null,g=[],y=!1,k=!1,A=null;function H(){A&&(A.abort(),A=null),t.value==="transcribing"&&(t.value="idle")}function R(){const J=o.value;if(!J||typeof window>"u")return;const de=J.getContext("2d");if(!de)return;const Re=Math.max(1,Math.floor(J.clientWidth)),Fe=Math.max(1,Math.floor(J.clientHeight||36)),ve=window.devicePixelRatio||1,we=Math.max(1,Math.floor(Re*ve)),ie=Math.max(1,Math.floor(Fe*ve));(J.width!==we||J.height!==ie)&&(J.width=we,J.height=ie),de.setTransform(ve,0,0,ve,0,0),de.clearRect(0,0,Re,Fe);const Ie=Math.max(12,Math.floor(Re/(Ed+wg))),De=g.slice(-Ie),Pe=Math.max(0,Ie-De.length),Ve=Fe/2,ze=getComputedStyle(J).color||"#000000";for(let Ge=0;Ge<Ie;Ge+=1){const at=De[Ge-Pe]??0,G=Math.max(.08,Math.min(1,at*18))*Ve,be=Ge*(Ed+wg);de.globalAlpha=at<=bg?.35:1,de.fillStyle=ze,de.fillRect(be,Ve-G,Ed,G*2)}de.globalAlpha=1}function O(){g=[],r.value=0,R()}function W(){d&&(d.disconnect(),d.onaudioprocess=null,d=null),u&&(u.disconnect(),u=null),l&&(l.close(),l=null),f=null}function z(J){if(typeof window>"u")return;const de=window.webkitAudioContext,Re=window.AudioContext??de;Re&&(W(),O(),l=new Re,u=l.createMediaStreamSource(J),d=l.createScriptProcessor(2048,1,1),f=performance.now(),d.onaudioprocess=Fe=>{const ve=Fe.inputBuffer.getChannelData(0);let we=0;for(let ie=0;ie<ve.length;ie+=1){const Ie=Math.abs(ve[ie]??0);we+=Ie<bg?0:Ie}g.push(we/ve.length),g.length>W$&&g.shift(),f!==null&&(r.value=Math.max(0,performance.now()-f)),R()},u.connect(d),d.connect(l.destination),R())}async function ce(){var J;if(t.value==="transcribing"&&H(),!(t.value!=="idle"||!n.value||y)){y=!0,k=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],s=new MediaRecorder(i),s.ondataavailable=de=>{de.data.size>0&&a.push(de.data)},s.onstop=()=>{var Fe;const de=a,Re=(s==null?void 0:s.mimeType)||((Fe=de[0])==null?void 0:Fe.type)||"audio/webm";Me(),me(de,Re)},z(i),s.start(250),t.value="recording",k&&ne()}catch(de){Me(),t.value="idle",(J=e.onError)==null||J.call(e,de)}finally{y=!1}}}function ne(){if(y&&t.value==="idle"){k=!0;return}if(!(t.value!=="recording"||!s)&&s.state!=="inactive"){t.value="transcribing";try{s.requestData()}catch{}s.stop()}}function Q(){k=!1,H(),Me(),t.value="idle"}async function me(J,de){var ve,we,ie,Ie,De;if(J.length===0){(ve=e.onEmpty)==null||ve.call(e),t.value="idle";return}const Re=new Blob(J,{type:de});t.value="transcribing";let Fe=null;try{const Pe=de.split(/[/;]/)[1]??"webm",Ve=new FormData;Ve.append("file",Re,`codex.${Pe}`);const ze=((we=e.getLanguage)==null?void 0:we.call(e).trim())??"";ze&&ze.toLowerCase()!=="auto"&&Ve.append("language",ze),Fe=new AbortController,A=Fe;const Ge=await fetch("/codex-api/transcribe",{method:"POST",body:Ve,signal:Fe.signal}),at=await Ge.text();let Ye=null;try{Ye=at.trim()?JSON.parse(at):null}catch{Ye=null}if(!Ge.ok){const be=(ie=Ye==null?void 0:Ye.error)==null?void 0:ie.trim(),fe=at.trim();throw new Error(be||fe||`Transcription failed: ${Ge.status}`)}const G=((Ye==null?void 0:Ye.text)??"").trim();G.length>0?e.onTranscript(G):(Ie=e.onEmpty)==null||Ie.call(e)}catch(Pe){if(Pe instanceof DOMException&&Pe.name==="AbortError")return;(De=e.onError)==null||De.call(e,Pe)}finally{Fe&&A===Fe&&(A=null),t.value==="transcribing"&&(t.value="idle")}}function Me(){W(),O(),s&&(s.ondataavailable=null,s.onstop=null,s=null),i&&(i.getTracks().forEach(J=>J.stop()),i=null),a=[]}zs(()=>{Q()});function xe(){if(t.value==="recording"){ne();return}(t.value==="idle"||t.value==="transcribing")&&ce()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:o,startRecording:ce,stopRecording:ne,toggleRecording:xe,cancel:Q}}const z$={},G$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function K$(e,t){return x(),L("svg",G$,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const Y$=kt(z$,[["render",K$]]),J$={},X$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Q$(e,t){return x(),L("svg",X$,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 3L4 14h6l-1 7l9-11h-6z"},null,-1)])])}const Z$=kt(J$,[["render",Q$]]),eN={},tN={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function nN(e,t){return x(),L("svg",tN,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const rN=kt(eN,[["render",nN]]),oN={},sN={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function iN(e,t){return x(),L("svg",sN,[...t[0]||(t[0]=[b("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),b("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const Sg=kt(oN,[["render",iN]]),aN=["disabled"],lN={class:"composer-dropdown-value"},cN={class:"composer-dropdown-menu"},uN={key:0,class:"composer-dropdown-search-wrap"},dN=["placeholder","onKeydown"],fN={class:"composer-dropdown-options",role:"listbox"},pN=["onClick"],hN={key:0,class:"composer-dropdown-empty"},mN=In({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,o=N(null),s=N(null),i=N(!1),a=N(""),l=oe(()=>{var O;const R=n.options.find(W=>W.value===n.modelValue);return R?R.label:((O=n.placeholder)==null?void 0:O.trim())||""}),u=oe(()=>n.openDirection??"down"),d=oe(()=>n.enableSearch===!0),f=oe(()=>{var R;return((R=n.searchPlaceholder)==null?void 0:R.trim())||"Quick search projects"}),g=oe(()=>{const R=a.value.trim().toLowerCase();return R?n.options.filter(O=>O.label.toLowerCase().includes(R)||O.value.toLowerCase().includes(R)):n.options});function y(){n.disabled||(i.value=!i.value)}function k(R){r("update:modelValue",R),i.value=!1,a.value=""}function A(){if(a.value.length>0){a.value="";return}i.value=!1}function H(R){if(!i.value)return;const O=o.value;if(!O)return;const W=R.target;W instanceof Node&&(O.contains(W)||(i.value=!1,a.value=""))}return ct(i,R=>{R&&d.value&&Yt(()=>{var O;return(O=s.value)==null?void 0:O.focus()})}),ls(()=>{window.addEventListener("pointerdown",H)}),zs(()=>{window.removeEventListener("pointerdown",H)}),(R,O)=>(x(),L("div",{ref_key:"rootRef",ref:o,class:"composer-dropdown"},[b("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:y},[e.selectedPrefixIcon?(x(),mt(Uf(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):he("",!0),b("span",lN,le(l.value),1),We(kp,{class:"composer-dropdown-chevron"})],8,aN),i.value?(x(),L("div",{key:0,class:ht(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":u.value==="up","composer-dropdown-menu-wrap-down":u.value==="down"}])},[b("div",cN,[d.value?(x(),L("div",uN,[Kn(b("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":O[0]||(O[0]=W=>a.value=W),class:"composer-dropdown-search-input",type:"text",placeholder:f.value,onKeydown:en(pt(A,["prevent"]),["esc"])},null,40,dN),[[ir,a.value]])])):he("",!0),b("ul",fN,[(x(!0),L(Je,null,Dt(g.value,W=>(x(),L("li",{key:W.value},[b("button",{class:ht(["composer-dropdown-option",{"is-selected":W.value===e.modelValue}]),type:"button",onClick:z=>k(W.value)},le(W.label),11,pN)]))),128)),g.value.length===0?(x(),L("li",hN," No matching projects ")):he("",!0)])])],2)):he("",!0)],512))}}),Ls=kt(mN,[["__scopeId","data-v-fce3cdfb"]]),gN=["disabled"],vN={class:"search-dropdown-value"},yN={class:"search-dropdown-search-wrap"},_N=["placeholder","onKeydown"],bN={key:0,class:"search-dropdown-list",role:"listbox"},wN=["onClick","onPointerenter"],SN={class:"search-dropdown-option-check"},TN={class:"search-dropdown-option-label"},EN={key:0,class:"search-dropdown-option-desc"},kN={key:1,class:"search-dropdown-empty"},IN=In({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,o=N(null),s=N(null),i=N(null),a=N(!1),l=N(""),u=N(0),d=oe(()=>n.openDirection??"down"),f=oe(()=>new Set(n.selectedValues)),g=oe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const z=n.options.find(ce=>ce.value===n.selectedValues[0]);return(z==null?void 0:z.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),y=oe(()=>{const z=l.value.toLowerCase().trim();return z?n.options.filter(ce=>{var ne;return ce.label.toLowerCase().includes(z)||(((ne=ce.description)==null?void 0:ne.toLowerCase().includes(z))??!1)}):n.options});function k(){const z=s.value,ce=o.value;if(!z||!ce||window.innerWidth>=640)return;const ne=ce.getBoundingClientRect();d.value==="up"?(z.style.setProperty("bottom",`${window.innerHeight-ne.top+8}px`,"important"),z.style.setProperty("top","auto","important")):(z.style.setProperty("top",`${ne.bottom+8}px`,"important"),z.style.setProperty("bottom","auto","important"))}function A(){n.disabled||(a.value=!a.value,a.value&&(l.value="",u.value=0,Yt(()=>{var z;Yt(()=>{k()}),(z=i.value)==null||z.focus()})))}function H(z){r("toggle",z.value,!f.value.has(z.value)),a.value=!1}function R(z){y.value.length!==0&&(u.value=(u.value+z+y.value.length)%y.value.length)}function O(){const z=y.value[u.value];z&&H(z)}function W(z){if(!a.value)return;const ce=o.value;if(!ce)return;const ne=z.target;ne instanceof Node&&(ce.contains(ne)||(a.value=!1))}return ct(l,()=>{u.value=0}),ls(()=>window.addEventListener("pointerdown",W)),zs(()=>window.removeEventListener("pointerdown",W)),(z,ce)=>(x(),L("div",{ref_key:"rootRef",ref:o,class:"search-dropdown"},[b("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:A},[b("span",vN,le(g.value),1),We(kp,{class:"search-dropdown-chevron"})],8,gN),a.value?(x(),L("div",{key:0,ref_key:"menuRef",ref:s,class:ht(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[b("div",yN,[Kn(b("input",{ref_key:"searchRef",ref:i,"onUpdate:modelValue":ce[0]||(ce[0]=ne=>l.value=ne),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[ce[1]||(ce[1]=en(pt(ne=>a.value=!1,["prevent"]),["escape"])),en(pt(O,["prevent"]),["enter"]),ce[2]||(ce[2]=en(pt(ne=>R(1),["prevent"]),["arrow-down"])),ce[3]||(ce[3]=en(pt(ne=>R(-1),["prevent"]),["arrow-up"]))]},null,40,_N),[[ir,l.value]])]),y.value.length>0?(x(),L("ul",bN,[(x(!0),L(Je,null,Dt(y.value,(ne,Q)=>(x(),L("li",{key:ne.value},[b("button",{class:ht(["search-dropdown-option",{"is-selected":f.value.has(ne.value),"is-highlighted":Q===u.value}]),type:"button",onClick:me=>H(ne),onPointerenter:me=>u.value=Q},[b("span",SN,le(f.value.has(ne.value)?"✓":""),1),b("span",TN,le(ne.label),1),ne.description?(x(),L("span",EN,le(ne.description),1)):he("",!0)],42,wN)]))),128))])):(x(),L("div",kN,"No results"))],2)):he("",!0)],512))}}),CN=kt(IN,[["__scopeId","data-v-3147b20f"]]),AN={class:"skill-picker-header"},xN=["onKeydown"],RN={key:0,class:"skill-picker-list",role:"listbox"},MN=["onClick","onPointerenter"],PN={class:"skill-picker-name"},$N={key:0,class:"skill-picker-desc"},NN={key:1,class:"skill-picker-empty"},ON=In({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,o=N(null),s=N(null),i=N(""),a=N(0),l=oe(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(y=>y.name.toLowerCase().includes(g)||y.description.toLowerCase().includes(g)):n.skills}),u=oe(()=>{const g={};return n.anchorBottom!=null&&(g.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(g.left=`${n.anchorLeft}px`),g});function d(g){l.value.length!==0&&(a.value=(a.value+g+l.value.length)%l.value.length)}function f(){const g=l.value[a.value];g&&r("select",g)}return ct(()=>n.visible,g=>{g&&(i.value="",a.value=0,Yt(()=>{var y;return(y=s.value)==null?void 0:y.focus()}))}),ct(i,()=>{a.value=0}),(g,y)=>e.visible?(x(),L("div",{key:0,ref_key:"rootRef",ref:o,class:"skill-picker",style:To(u.value)},[b("div",AN,[Kn(b("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":y[0]||(y[0]=k=>i.value=k),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[y[1]||(y[1]=en(pt(k=>g.$emit("close"),["prevent"]),["escape"])),en(pt(f,["prevent"]),["enter"]),y[2]||(y[2]=en(pt(k=>d(1),["prevent"]),["arrow-down"])),y[3]||(y[3]=en(pt(k=>d(-1),["prevent"]),["arrow-up"]))]},null,40,xN),[[ir,i.value]])]),l.value.length>0?(x(),L("ul",RN,[(x(!0),L(Je,null,Dt(l.value,(k,A)=>(x(),L("li",{key:k.path},[b("button",{class:ht(["skill-picker-item",{"is-highlighted":A===a.value}]),type:"button",onClick:H=>g.$emit("select",k),onPointerenter:H=>a.value=A},[b("span",PN,le(k.name),1),k.description?(x(),L("span",$N,le(k.description),1)):he("",!0)],42,MN)]))),128))])):(x(),L("div",NN,"No skills found"))],4)):he("",!0)}}),LN=kt(ON,[["__scopeId","data-v-ff3fb7dc"]]),DN={key:0,class:"thread-composer-dictation-error"},jN={key:0,class:"thread-composer-attachments"},FN=["src","alt"],BN=["aria-label","disabled","onClick"],UN={key:1,class:"thread-composer-folder-chips"},qN=["title"],HN={class:"thread-composer-folder-chip-meta"},WN=["aria-label","disabled","onClick"],VN={key:2,class:"thread-composer-file-chips"},zN=["title"],GN=["aria-label","disabled","onClick"],KN={key:3,class:"thread-composer-skill-chips"},YN={class:"thread-composer-skill-chip-name"},JN=["aria-label","onClick"],XN={key:0,class:"thread-composer-drop-overlay","aria-hidden":"true"},QN={key:1,class:"thread-composer-file-mentions"},ZN=["onMousedown"],eO={key:1,class:"thread-composer-file-mention-icon-markdown"},tO={class:"thread-composer-file-mention-text"},nO={class:"thread-composer-file-mention-name"},rO={key:0,class:"thread-composer-file-mention-dir"},oO={key:1,class:"thread-composer-file-mention-empty"},sO=["placeholder","disabled"],iO=["disabled"],aO={key:0,class:"thread-composer-attach-menu"},lO=["disabled"],cO=["disabled"],uO=["disabled"],dO={class:"thread-composer-attach-mode"},fO={class:"thread-composer-attach-mode-buttons"},pO=["disabled"],hO=["disabled"],mO=["aria-checked","aria-label","disabled"],gO={class:"thread-composer-attach-setting-copy"},vO={class:"thread-composer-attach-setting-description"},yO=["aria-checked","aria-label","disabled"],_O={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},bO={key:1,class:"thread-composer-dictation-timer"},wO=["aria-label","title","disabled"],SO=["aria-label","title","disabled"],TO={key:0,class:"thread-composer-stop-spinner","aria-hidden":"true"},EO=["aria-label","title","disabled"],kO=["disabled"],IO=["disabled"],CO=["disabled"],AO=2e3,xO="codex-web-local.thread-draft.v1.",RO=In({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},collaborationModes:{},selectedCollaborationMode:{},models:{},selectedModel:{},selectedReasoningEffort:{},selectedSpeedMode:{},skills:{},threadTokenUsage:{},codexQuota:{},isTurnInProgress:{type:Boolean},isStopPending:{type:Boolean},isInterruptingTurn:{type:Boolean},isUpdatingSpeedMode:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-collaboration-mode","update:selected-model","update:selected-reasoning-effort","update:selected-speed-mode"],setup(e,{expose:t,emit:n}){const r=e,o=n,s=N(""),i=N([]),a=N([]),l=N([]),u=N([]),d=N(""),f=N(0),g=N(null),y=N(!1),{state:k,isSupported:A,recordingDurationMs:H,waveformCanvasRef:R,startRecording:O,stopRecording:W,toggleRecording:z,cancel:ce}=V$({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:m=>{if(s.value=s.value?`${s.value}
75
- ${m}`:m,d.value="",r.dictationAutoSend!==!1){const w=r.isTurnInProgress?_e.value:"steer";$e(w);return}Yt(()=>{var w;return(w=xe.value)==null?void 0:w.focus()})},onEmpty:()=>{d.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:m=>{if(m instanceof DOMException&&m.name==="NotAllowedError"){d.value="Microphone access was denied.";return}d.value=m instanceof Error?m.message:"Dictation failed."}}),ne=N(null),Q=N(null),me=N(null),Me=N(null),xe=N(null),{isMobile:Oe}=bp(),J=N(!1),de=N(!1),Re=N(null),Fe=N(""),ve=N([]),we=N(!1),ie=N(0),Ie=N(0);let De=0,Pe=null,Ve=!1,ze=0,Ge=0;const at=typeof navigator<"u"&&/Android/i.test(navigator.userAgent);let Ye="";const G=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}];function be(m){return m.trim().replace(/^gpt/i,"GPT")}const fe=oe(()=>r.models.map(m=>({value:m,label:be(m)}))),je=oe(()=>r.selectedCollaborationMode==="plan"),Xe=oe(()=>r.selectedCollaborationMode==="plan"&&r.selectedModel.trim().length===0),E=oe(()=>r.skills??[]),I=oe(()=>a.value.map(m=>m.path)),q=oe(()=>(r.skills??[]).map(m=>({value:m.path,label:m.name,description:m.description}))),Z=oe(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId||Xe.value||f.value>0?!1:s.value.trim().length>0||i.value.length>0||l.value.length>0),X=oe(()=>s.value.trim().length>0||i.value.length>0||a.value.length>0||l.value.length>0||u.value.length>0),Y=oe(()=>{const m=new Set;for(const w of u.value)for(const B of w.filePaths)m.add(B);return l.value.filter(w=>!m.has(w.fsPath))}),se=oe(()=>r.disabled||!r.activeThreadId),pe=oe(()=>r.selectedModel.trim()==="gpt-5.4"),ue=oe(()=>r.selectedSpeedMode==="fast"&&pe.value),ee=oe(()=>se.value||r.isUpdatingSpeedMode===!0),Ne=oe(()=>r.isUpdatingSpeedMode?"Saving speed setting...":r.selectedSpeedMode==="fast"?"About 1.5x faster, with credits used at 2x":"Default speed with normal credit usage"),Se=oe(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),_e=N(Se.value),Ae=oe(()=>k.value==="recording"),P=oe(()=>k.value==="recording"?"Stop dictation":r.dictationClickToToggle?"Click to dictate":"Hold to dictate"),$=oe(()=>k.value==="idle"?d.value.trim():""),j=oe(()=>{const m=Math.max(0,Math.floor(H.value/1e3)),w=Math.floor(m/60),B=m%60;return`${w}:${String(B).padStart(2,"0")}`}),K=oe(()=>r.activeThreadId?Xe.value?"Loading models for plan mode...":"Type a message... (@ for files, / for skills)":"Select a thread to send a message"),ae=oe(()=>s.value.trim().length>0||i.value.length>0||l.value.length>0);function $e(m="steer"){var B;const w=s.value.trim();if(Z.value){if(o("submit",{text:w,imageUrls:i.value.map(ge=>ge.url),fileAttachments:[...l.value],skills:a.value.map(ge=>({name:ge.name,path:ge.path})),mode:m}),tt(r.activeThreadId),rt(),u.value=[],J.value=!1,de.value=!1,nn(),at||Oe.value){(B=xe.value)==null||B.blur();return}Yt(()=>{var ge;return(ge=xe.value)==null?void 0:ge.focus()})}}function Ue(m){_e.value=m}function nt(m){Ie.value+=1,s.value=m.text,i.value=m.imageUrls.map((w,B)=>({id:`queued-${Date.now()}-${B}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${B+1}`,url:w})),a.value=m.skills.map(w=>(r.skills??[]).find(B=>B.path===w.path)??{name:w.name,description:"",path:w.path}),l.value=m.fileAttachments.map(w=>({...w})),u.value=[],d.value="",g.value=null,f.value=0,J.value=!1,de.value=!1,nn(),Ge+=1}function rt(){nt({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function $t(m){return`${xO}${m}`}function bt(m){if(typeof window>"u")return null;const w=m.trim();if(!w)return null;try{const B=window.localStorage.getItem($t(w));if(!B)return null;const ge=JSON.parse(B);return typeof ge=="string"?{text:ge,imageUrls:[],fileAttachments:[],skills:[]}:{text:typeof ge.text=="string"?ge.text:"",imageUrls:Array.isArray(ge.imageUrls)?ge.imageUrls.filter(ot=>typeof ot=="string"):[],fileAttachments:Array.isArray(ge.fileAttachments)?ge.fileAttachments.filter(ot=>!!ot&&typeof ot.label=="string"&&typeof ot.path=="string"&&typeof ot.fsPath=="string"):[],skills:Array.isArray(ge.skills)?ge.skills.filter(ot=>!!ot&&typeof ot.name=="string"&&typeof ot.path=="string"):[]}}catch{return null}}function on(m,w){if(typeof window>"u")return;const B=m.trim();if(B)try{if(w.text.trim().length>0||w.imageUrls.length>0||w.fileAttachments.length>0||w.skills.length>0){window.localStorage.setItem($t(B),JSON.stringify(w));return}window.localStorage.removeItem($t(B))}catch{}}function tt(m){on(m,{text:"",imageUrls:[],fileAttachments:[],skills:[]})}function fn(){return{text:s.value,imageUrls:i.value.map(m=>m.url),fileAttachments:l.value.map(m=>({...m})),skills:a.value.map(m=>({name:m.name,path:m.path}))}}function Xt(){o("interrupt")}function vr(m){o("update:selected-model",m)}function cr(){o("update:selected-collaboration-mode",je.value?"default":"plan")}function Xn(m){o("update:selected-reasoning-effort",m)}function Vt(){ee.value||o("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function It(){r.dictationClickToToggle&&(d.value&&(d.value=""),z())}function pn(m){if(r.dictationClickToToggle||(m.preventDefault(),Ve))return;Ve=!0;const w=m.currentTarget;if(w)try{w.setPointerCapture(m.pointerId)}catch{}d.value&&(d.value=""),window.addEventListener("pointerup",jt),window.addEventListener("pointercancel",jt),window.addEventListener("blur",jt),O()}function jt(){r.dictationClickToToggle||Ve&&(Ve=!1,window.removeEventListener("pointerup",jt),window.removeEventListener("pointercancel",jt),window.removeEventListener("blur",jt),W())}function so(){se.value||(J.value=!J.value)}function fs(){var m;(m=Q.value)==null||m.click()}function io(){var m;(m=me.value)==null||m.click()}function yr(){var m;(m=Me.value)==null||m.click()}function zr(m){i.value=i.value.filter(w=>w.id!==m)}function bn(m){a.value=a.value.filter(w=>w.path!==m)}function sn(m){l.value=l.value.filter(w=>w.fsPath!==m)}function Gr(m){const w=u.value.find(ge=>ge.id===m);if(!w)return;const B=new Set(w.filePaths);l.value=l.value.filter(ge=>!B.has(ge.fsPath)),u.value=u.value.filter(ge=>ge.id!==m)}function wn(m){return m.total<=0?0:Math.round(m.processed/m.total*100)}function Sn(m,w){const B=m.replace(/\\/g,"/");if(l.value.some(st=>st.fsPath===B))return;const ge=B.split("/").filter(Boolean),ot=(w==null?void 0:w.trim())||ge[ge.length-1]||B;l.value=[...l.value,{label:ot,path:B,fsPath:B}]}function Qn(m){return m.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(m.name)}function ur(m){return m?Array.from(m):[]}function Fn(m){return m!==Ge?!1:(f.value+=1,!0)}function Ut(m){m===Ge&&(f.value=Math.max(0,f.value-1))}function _r(m){if(m<=0)return;const w=g.value,B=w?w.succeeded+w.failed:0;if(!w||B>=w.total){g.value={total:m,succeeded:0,failed:0};return}g.value={...w,total:w.total+m}}function Zn(m){const w=g.value;w&&(g.value={...w,succeeded:w.succeeded+(m==="success"?1:0),failed:w.failed+(m==="failure"?1:0)})}function hn(){return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function qt(m){const w=new Date,B=[w.getFullYear(),String(w.getMonth()+1).padStart(2,"0"),String(w.getDate()).padStart(2,"0"),String(w.getHours()).padStart(2,"0"),String(w.getMinutes()).padStart(2,"0"),String(w.getSeconds()).padStart(2,"0")].join("-"),ge=m.type.startsWith("image/")&&m.type.slice(6).replace(/[^a-z0-9]+/gi,"")||"png";return`pasted-image-${B}.${ge}`}function Ct(){const m=new Date;return`pasted-text-${[m.getFullYear(),String(m.getMonth()+1).padStart(2,"0"),String(m.getDate()).padStart(2,"0"),String(m.getHours()).padStart(2,"0"),String(m.getMinutes()).padStart(2,"0"),String(m.getSeconds()).padStart(2,"0")].join("-")}.txt`}function Tn(m){return m.name.trim()?m:new File([m],qt(m),{type:m.type||"image/png",lastModified:Date.now()})}async function An(m,w){if(Fn(w))try{const B=Tn(m),ge=await Sd(B);if(w!==Ge)return;if(!ge){Zn("failure");return}i.value=[...i.value,{id:hn(),name:B.name,url:`/codex-local-image?path=${encodeURIComponent(ge)}`}],Zn("success")}catch{w===Ge&&Zn("failure")}finally{Ut(w)}}async function xn(m,w){if(Fn(w))try{const B=await Sd(m);if(w!==Ge)return;if(!B){Zn("failure");return}Sn(B),Zn("success")}catch{w===Ge&&Zn("failure")}finally{Ut(w)}}function zt(m){const w=ur(m);if(w.length===0)return;_r(w.length),J.value=!1,de.value=!1,nn();const B=Ge;for(const ge of w)Qn(ge)?An(ge,B):xn(ge,B)}function Bn(){ze=0,y.value=!1}function Rn(m){return m?Array.from(m.types??[]).includes("Files"):!1}async function wt(m){if(!m||m.length===0)return;const w=Ie.value,B=Array.from(m),ot=(B[0].webkitRelativePath||B[0].name).split("/").filter(Boolean)[0]||"Folder",st=`${Date.now()}-${Math.random().toString(36).slice(2)}`;u.value=[...u.value,{id:st,name:ot,total:B.length,processed:0,filePaths:[],isUploading:!0}];const dt=ft=>{w===Ie.value&&(u.value=u.value.map(Bt=>Bt.id===st?ft(Bt):Bt))};for(const ft of B)try{const Bt=await Sd(ft);if(w!==Ie.value)return;if(Bt){const Wn=ft.webkitRelativePath||ft.name;Sn(Bt,Wn),dt(yn=>({...yn,processed:yn.processed+1,filePaths:[...yn.filePaths,Bt]}));continue}dt(Wn=>({...Wn,processed:Wn.processed+1}))}catch{dt(Bt=>({...Bt,processed:Bt.processed+1}))}dt(ft=>({...ft,isUploading:!1}))}function Tt(m){m&&(m.value="")}function br(m){const w=m.target;zt((w==null?void 0:w.files)??null),Tt(w),J.value=!1}function dr(m){const w=m.target;zt((w==null?void 0:w.files)??null),Tt(w),J.value=!1}function fr(m){const w=m.target;wt((w==null?void 0:w.files)??null),Tt(w),J.value=!1}function jo(m){se.value||!Rn(m.dataTransfer)||(m.preventDefault(),ze+=1,y.value=!0)}function mn(m){se.value||!Rn(m.dataTransfer)||(m.preventDefault(),m.dataTransfer&&(m.dataTransfer.dropEffect="copy"),y.value=!0)}function er(m){y.value&&(m.preventDefault(),ze=Math.max(0,ze-1),ze===0&&Bn())}function Kr(m){var w;se.value||!Rn(m.dataTransfer)||(m.preventDefault(),Bn(),zt(((w=m.dataTransfer)==null?void 0:w.files)??null))}function an(){!y.value&&ze===0||Bn()}function ao(m){var st,dt;if(se.value)return;const w=((st=m.clipboardData)==null?void 0:st.getData("text/plain"))??"";if(w.length>=AO){m.preventDefault();const ft=new File([w],Ct(),{type:"text/plain",lastModified:Date.now()});zt([ft]);return}const B=Array.from(((dt=m.clipboardData)==null?void 0:dt.items)??[]);if(B.length===0)return;const ge=w.length>0,ot=B.filter(ft=>ft.kind==="file"&&ft.type.startsWith("image/")).map(ft=>ft.getAsFile()).filter(ft=>ft instanceof File);ot.length!==0&&(ge||m.preventDefault(),zt(ot))}function Pr(){d.value&&(d.value="");const w=s.value.startsWith("/");w!==de.value&&(de.value=w),lo()}function Ft(m){if(we.value){if(m.key==="Escape"){m.preventDefault(),nn();return}if(m.key==="ArrowDown"){m.preventDefault(),ve.value.length>0&&(ie.value=(ie.value+1)%ve.value.length);return}if(m.key==="ArrowUp"){if(m.preventDefault(),ve.value.length>0){const B=ve.value.length;ie.value=(ie.value+B-1)%B}return}if(m.key==="Enter"||m.key==="Tab"){m.preventDefault();const B=ve.value[ie.value];B?qn(B):nn();return}}if(r.sendWithEnter!==!1?m.key==="Enter"&&!m.shiftKey:m.key==="Enter"&&(m.metaKey||m.ctrlKey)){m.preventDefault(),$e(r.isTurnInProgress?_e.value:"steer");return}if(de.value){if(m.key==="Escape"){m.preventDefault(),Mn();return}if(m.key==="ArrowDown"||m.key==="ArrowUp"){m.preventDefault();return}}}function Mn(){var m;de.value=!1,(m=xe.value)==null||m.focus()}function nn(){we.value=!1,Re.value=null,Fe.value="",ve.value=[],ie.value=0}function lo(){const m=xe.value;if(!m){nn();return}const w=m.selectionStart??s.value.length,ge=s.value.slice(0,w).match(/(^|\s)(@[^\s@]*)$/);if(!ge){nn();return}const ot=ge[2]??"",st=ot.length,dt=w-st;Re.value=dt,Fe.value=ot.slice(1),we.value=!0,Un()}async function Un(){if(!we.value)return;const m=(r.cwd??"").trim();if(!m){ve.value=[];return}Pe&&clearTimeout(Pe);const w=++De;Pe=setTimeout(async()=>{try{const B=await NM(m,Fe.value,20);if(!we.value||w!==De)return;ve.value=B,ie.value=0}catch{if(!we.value||w!==De)return;ve.value=[]}},120)}function qn(m){const w=xe.value,B=Re.value;if(B!==null&&w){const ge=w.selectionStart??s.value.length;s.value=`${s.value.slice(0,B)}${s.value.slice(ge)}`.trimEnd()}Sn(m.path),nn(),Yt(()=>w==null?void 0:w.focus())}function $r(m){ce(),nt(m),Yt(()=>{var w;return(w=xe.value)==null?void 0:w.focus()})}function gn(m){const w=m.trim();w&&(ce(),s.value.trim().length>0?s.value=`${s.value.trimEnd()}
76
- ${w}`:s.value=w,Yt(()=>{var B;return(B=xe.value)==null?void 0:B.focus()}))}function Nr(m){const w=m.lastIndexOf("/");return w<0?m:m.slice(w+1)}function Hn(m){const w=m.lastIndexOf("/");return w<=0?"":m.slice(0,w)}function tr(m){const w=Nr(m),B=w.lastIndexOf(".");return B<=0?"":w.slice(B+1).toLowerCase()}function Qt(m){const w=tr(m);return w==="ts"?"TS":w==="tsx"?"TSX":w==="js"?"JS":w==="jsx"?"JSX":w==="json"?"{}":""}function Le(m){const w=tr(m);return w.startsWith("ts")?"ts":w.startsWith("js")?"js":w==="json"?"json":"default"}function ye(m){const w=tr(m);return w==="md"||w==="mdx"}function vn(m){var w;a.value.some(B=>B.path===m.path)||(a.value=[...a.value,m]),s.value=s.value.startsWith("/")?"":s.value,de.value=!1,(w=xe.value)==null||w.focus()}function T(m,w){if(w){const B=(r.skills??[]).find(ge=>ge.path===m);B&&!a.value.some(ge=>ge.path===m)&&(a.value=[...a.value,B])}else a.value=a.value.filter(B=>B.path!==m)}function M(m){if(!J.value)return;const w=ne.value;if(!w)return;const B=m.target;!B||w.contains(B)||(J.value=!1)}return ls(()=>{document.addEventListener("click",M),window.addEventListener("drop",an),window.addEventListener("dragend",an),window.addEventListener("blur",an)}),t({hydrateDraft:$r,appendTextToDraft:gn,hasUnsavedDraft:()=>X.value}),zs(()=>{document.removeEventListener("click",M),window.removeEventListener("drop",an),window.removeEventListener("dragend",an),window.removeEventListener("blur",an),window.removeEventListener("pointerup",jt),window.removeEventListener("pointercancel",jt),window.removeEventListener("blur",jt),Pe&&clearTimeout(Pe)}),ct(()=>r.activeThreadId,m=>{ce(),Ye&&on(Ye,fn()),rt();const w=bt(m);w&&(nt(w),Pr()),Ye=m.trim()},{immediate:!0}),ct([s,i,l,a],()=>{Ye&&on(Ye,fn())},{deep:!0}),ct(()=>r.cwd,()=>{we.value&&Un()}),ct(Se,m=>{_e.value=m}),(m,w)=>(x(),L("form",{class:"thread-composer",onSubmit:w[4]||(w[4]=pt(B=>$e(e.isTurnInProgress?_e.value:"steer"),["prevent"]))},[$.value?(x(),L("p",DN,le($.value),1)):he("",!0),b("div",{class:ht(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove,"thread-composer-shell--drag-active":y.value}])},[i.value.length>0?(x(),L("div",jN,[(x(!0),L(Je,null,Dt(i.value,B=>(x(),L("div",{key:B.id,class:"thread-composer-attachment"},[b("img",{class:"thread-composer-attachment-image",src:B.url,alt:B.name||"Selected image"},null,8,FN),b("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${B.name||"image"}`,disabled:se.value,onClick:ge=>zr(B.id)}," x ",8,BN)]))),128))])):he("",!0),u.value.length>0?(x(),L("div",UN,[(x(!0),L(Je,null,Dt(u.value,B=>(x(),L("span",{key:B.id,class:"thread-composer-folder-chip"},[We(Ip,{class:"thread-composer-folder-chip-icon"}),b("span",{class:"thread-composer-folder-chip-name",title:B.name},le(B.name),9,qN),b("span",HN,[B.isUploading?(x(),L(Je,{key:0},[Bs(le(wn(B))+"% uploading ("+le(B.processed)+"/"+le(B.total)+") ",1)],64)):(x(),L(Je,{key:1},[Bs(le(B.filePaths.length)+" file"+le(B.filePaths.length===1?"":"s"),1)],64))]),b("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${B.name}`,disabled:se.value,onClick:ge=>Gr(B.id)},"×",8,WN)]))),128))])):he("",!0),Y.value.length>0?(x(),L("div",VN,[(x(!0),L(Je,null,Dt(Y.value,B=>(x(),L("span",{key:B.fsPath,class:"thread-composer-file-chip"},[We(_c,{class:"thread-composer-file-chip-icon"}),b("span",{class:"thread-composer-file-chip-name",title:B.fsPath},le(B.label),9,zN),b("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${B.label}`,disabled:se.value,onClick:ge=>sn(B.fsPath)},"×",8,GN)]))),128))])):he("",!0),a.value.length>0?(x(),L("div",KN,[(x(!0),L(Je,null,Dt(a.value,B=>(x(),L("span",{key:B.path,class:"thread-composer-skill-chip"},[b("span",YN,le(B.name),1),b("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${B.name}`,onClick:ge=>bn(B.path)},"×",8,JN)]))),128))])):he("",!0),b("div",{class:ht(["thread-composer-input-wrap",{"thread-composer-input-wrap--drag-active":y.value}]),onDragenter:jo,onDragover:mn,onDragleave:er,onDrop:Kr},[y.value?(x(),L("div",XN,[...w[5]||(w[5]=[b("span",{class:"thread-composer-drop-overlay-copy"},"Drop images or files",-1)])])):he("",!0),we.value?(x(),L("div",QN,[ve.value.length>0?(x(!0),L(Je,{key:0},Dt(ve.value,(B,ge)=>(x(),L("button",{key:B.path,class:ht(["thread-composer-file-mention-row",{"is-active":ge===ie.value}]),type:"button",onMousedown:pt(ot=>qn(B),["prevent"])},[Qt(B.path)?(x(),L("span",{key:0,class:ht(["thread-composer-file-mention-icon-badge",`is-${Le(B.path)}`])},le(Qt(B.path)),3)):ye(B.path)?(x(),L("span",eO,"↓")):(x(),mt(_c,{key:2,class:"thread-composer-file-mention-icon-file"})),b("span",tO,[b("span",nO,le(Nr(B.path)),1),Hn(B.path)?(x(),L("span",rO,le(Hn(B.path)),1)):he("",!0)])],42,ZN))),128)):(x(),L("div",oO,"No matching files"))])):he("",!0),Kn(b("textarea",{ref_key:"inputRef",ref:xe,"onUpdate:modelValue":w[0]||(w[0]=B=>s.value=B),class:"thread-composer-input",placeholder:K.value,disabled:se.value,onInput:Pr,onKeydown:Ft,onPaste:ao},null,40,sO),[[ir,s.value]]),We(LN,{skills:E.value,visible:de.value,"anchor-bottom":44,"anchor-left":0,onSelect:vn,onClose:Mn},null,8,["skills","visible"])],34),b("div",{class:ht(["thread-composer-controls",{"thread-composer-controls--recording":Ae.value}])},[b("div",{ref_key:"attachMenuRootRef",ref:ne,class:"thread-composer-attach"},[b("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:se.value,onClick:so}," + ",8,iO),J.value?(x(),L("div",aO,[b("button",{class:"thread-composer-attach-item",type:"button",disabled:se.value,onClick:fs}," Add photos & files ",8,lO),b("button",{class:"thread-composer-attach-item",type:"button",disabled:se.value,onClick:yr}," Add folder ",8,cO),b("button",{class:"thread-composer-attach-item",type:"button",disabled:se.value,onClick:io}," Take photo ",8,uO),w[9]||(w[9]=b("div",{class:"thread-composer-attach-separator"},null,-1)),b("div",dO,[w[6]||(w[6]=b("span",{class:"thread-composer-attach-mode-label"},"In-progress send",-1)),b("div",fO,[b("button",{class:ht(["thread-composer-attach-mode-button",{"is-active":_e.value==="steer"}]),type:"button",disabled:se.value,onClick:w[1]||(w[1]=B=>Ue("steer"))}," Steer ",10,pO),b("button",{class:ht(["thread-composer-attach-mode-button",{"is-active":_e.value==="queue"}]),type:"button",disabled:se.value,onClick:w[2]||(w[2]=B=>Ue("queue"))}," Queue ",10,hO)])]),w[10]||(w[10]=b("div",{class:"thread-composer-attach-separator"},null,-1)),pe.value?(x(),L("button",{key:0,class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":e.selectedSpeedMode==="fast","aria-label":`Fast mode ${e.selectedSpeedMode==="fast"?"enabled":"disabled"}`,disabled:ee.value,onClick:Vt},[b("span",gO,[w[7]||(w[7]=b("span",{class:"thread-composer-attach-setting-label"},"Fast mode",-1)),b("span",vO,le(Ne.value),1)]),b("span",{class:ht(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":ee.value}])},null,2)],8,mO)):he("",!0),b("button",{class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":je.value,"aria-label":je.value?"Disable plan mode":"Enable plan mode",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onClick:cr},[w[8]||(w[8]=b("span",{class:"thread-composer-attach-setting-copy"},[b("span",{class:"thread-composer-attach-setting-label"},"Plan mode"),b("span",{class:"thread-composer-attach-setting-description"},"Agent proposes a plan before acting")],-1)),b("span",{class:ht(["thread-composer-attach-switch",{"is-on":je.value}])},null,2)],8,yO)])):he("",!0)],512),Ae.value?he("",!0):(x(),L(Je,{key:0},[We(Ls,{class:"thread-composer-control","model-value":e.selectedModel,options:fe.value,"selected-prefix-icon":ue.value?Z$:null,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":vr},null,8,["model-value","options","selected-prefix-icon","disabled"]),We(CN,{class:"thread-composer-control",options:q.value,"selected-values":I.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:T},null,8,["options","selected-values","disabled"]),We(Ls,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:G,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Xn},null,8,["model-value","disabled"])],64)),b("div",{class:ht(["thread-composer-actions",{"thread-composer-actions--recording":Ae.value}])},[Be(k)==="recording"?(x(),L("div",_O,[b("canvas",{ref_key:"dictationWaveformCanvasRef",ref:R,class:"thread-composer-dictation-waveform"},null,512)])):he("",!0),Be(k)==="recording"?(x(),L("span",bO,le(j.value),1)):he("",!0),Be(A)?(x(),L("button",{key:2,class:ht(["thread-composer-mic",{"thread-composer-mic--active":Be(k)==="recording"}]),type:"button","aria-label":P.value,title:P.value,disabled:se.value,onClick:It,onPointerdown:pn,onPointerup:jt,onPointercancel:jt},[Be(k)==="recording"?(x(),mt(Sg,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(x(),mt(rN,{key:1,class:"thread-composer-mic-icon"}))],42,wO)):he("",!0),e.isTurnInProgress&&!ae.value?(x(),L("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":e.isStopPending?"Saving thread before stop is available":"Stop",title:e.isStopPending?"Saving thread before stop is available":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn||e.isStopPending,onClick:Xt},[e.isStopPending?(x(),L("span",TO)):(x(),mt(Sg,{key:1,class:"thread-composer-stop-icon"}))],8,SO)):(x(),L("button",{key:4,class:ht(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&_e.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&_e.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${_e.value}`:"Send",disabled:!Z.value,onClick:w[3]||(w[3]=B=>$e(e.isTurnInProgress?_e.value:"steer"))},[We(Y$,{class:"thread-composer-submit-icon"})],10,EO))],2)],2)],2),b("input",{ref_key:"photoLibraryInputRef",ref:Q,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:se.value,onChange:br},null,40,kO),b("input",{ref_key:"cameraCaptureInputRef",ref:me,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:se.value,onChange:dr},null,40,IO),b("input",{ref_key:"folderPickerInputRef",ref:Me,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:se.value,onChange:fr},null,40,CO)],32))}}),Tg=kt(RO,[["__scopeId","data-v-4dfd8383"]]),MO={key:0,class:"thread-pending-request"},PO={class:"thread-pending-request-title"},$O=["title"],NO={class:"thread-pending-request-approval"},OO={class:"thread-pending-request-options",role:"radiogroup","aria-label":"Approval choices"},LO=["aria-pressed","onClick"],DO={class:"thread-pending-request-option-index"},jO={class:"thread-pending-request-option-label"},FO={class:"thread-pending-request-footer thread-pending-request-footer--approval"},BO=["value"],UO={class:"thread-pending-request-header"},qO={class:"thread-pending-request-heading"},HO={class:"thread-pending-request-eyebrow"},WO={class:"thread-pending-request-title"},VO={key:0,class:"thread-pending-request-counter"},zO={key:0,class:"thread-pending-request-preview"},GO={class:"thread-pending-request-preview-code"},KO={key:1,class:"thread-pending-request-user-input"},YO={key:0,class:"thread-pending-request-question-description"},JO=["href"],XO={class:"thread-pending-request-question-title"},QO={key:0},ZO={key:0,class:"thread-pending-request-question-text"},eL={key:1,class:"thread-pending-request-input-wrap"},tL=["type","value","onInput"],nL={key:2,class:"thread-pending-request-select-wrap"},rL=["value","onChange"],oL={key:0,value:""},sL={key:3,class:"thread-pending-request-select-wrap"},iL=["value","onChange"],aL={key:0,value:""},lL=["value"],cL={key:4,class:"thread-pending-request-question-options"},uL=["checked","onChange"],dL={class:"thread-pending-request-checkbox-label"},fL={key:2,class:"thread-pending-request-validation-error"},pL={class:"thread-pending-request-footer"},hL={key:2,class:"thread-pending-request-user-input"},mL={class:"thread-pending-request-question-title"},gL={key:0,class:"thread-pending-request-question-text"},vL={key:1,class:"thread-pending-request-question-options"},yL={class:"thread-pending-request-select-wrap"},_L=["value","onChange"],bL=["value"],wL={key:0,class:"thread-pending-request-question-description"},SL={key:2,class:"thread-pending-request-input-wrap"},TL=["value","onInput"],EL={class:"thread-pending-request-footer"},kL={key:3,class:"thread-pending-request-actions"},IL={key:4,class:"thread-pending-request-actions"},CL=In({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean}},emits:["respondServerRequest"],setup(e,{emit:t}){const n=e,r=t,o=N("accept"),s=N(""),i=N({}),a=N({}),l=N({}),u=N("");function d(P){return P!==null&&typeof P=="object"&&!Array.isArray(P)?P:null}function f(P){return typeof P=="string"?P.trim():""}function g(P){return typeof P=="string"?P:null}function y(P){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(P)?P:JSON.stringify(P)}function k(P){const j=(Array.isArray(P.commandActions)?P.commandActions:[]).map(K=>d(K)).map(K=>f(K==null?void 0:K.command)).find(K=>K.length>0);if(j)return j.replace(/\s+/g," ").trim();if(Array.isArray(P.command)){const K=P.command.filter(ae=>typeof ae=="string").map(ae=>ae.trim()).filter(ae=>ae.length>0);if(K.length>0)return K.map(ae=>y(ae)).join(" ")}return Q(f(P.command))}function A(P){return P.method==="item/commandExecution/requestApproval"||P.method==="execCommandApproval"}function H(P){return P.method==="item/fileChange/requestApproval"||P.method==="applyPatchApproval"}function R(P){return P.method==="item/permissions/requestApproval"}function O(P){return A(P)||H(P)||R(P)}function W(P){return P.method==="mcpServer/elicitation/request"}function z(P){const $=d(P.params);return f($==null?void 0:$.reason)||f($==null?void 0:$.prompt)||f($==null?void 0:$.message)}function ce(P){return O(P)?"Awaiting approval":W(P)?"MCP server input required":P.method==="item/tool/requestUserInput"?"Awaiting response":P.method==="item/tool/call"?"Tool call waiting for response":P.method}function ne(P){const $=z(P);return $||(A(P)?"Do you want to run this command?":H(P)?"Do you want to make these changes?":R(P)?"Do you want to grant these permissions?":W(P)?"An MCP server needs your input before Codex can continue.":P.method==="item/tool/requestUserInput"?"Codex needs your answer before it can continue.":"Codex is waiting for a response before it can continue.")}function Q(P){var $e;const $=P.trim();if(!$)return"";const j=$.match(/-Command\s+(.+)$/i),K=(($e=j==null?void 0:j[1])==null?void 0:$e.trim())??$;return(K.startsWith('"')&&K.endsWith('"')?K.slice(1,-1):K).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function me(P){const $=d(P.params);if(!$)return"";if(A(P))return k($);if(H(P)){const j=f($.grantRoot)||f($.grant_root);if(j)return j.replace(/\s+/g," ").trim();const K=d($.fileChanges)??d($.changes);if(!K)return"";const ae=Object.keys(K).map($e=>$e.trim()).filter($e=>$e.length>0);return ae.length===0?"":ae.slice(0,3).join(", ")}return R(P)?Me($.permissions):W(P)?f($.serverName)||f($.url):""}function Me(P){const $=d(P);if(!$)return"";const j=[],K=d($.fileSystem),ae=d($.network),$e=Array.isArray(K==null?void 0:K.read)?K.read.filter(nt=>typeof nt=="string"):[],Ue=Array.isArray(K==null?void 0:K.write)?K.write.filter(nt=>typeof nt=="string"):[];return $e.length>0&&j.push(`Read: ${$e.join(", ")}`),Ue.length>0&&j.push(`Write: ${Ue.join(", ")}`),(ae==null?void 0:ae.enabled)===!0&&j.push("Network access"),j.join(" • ")}function xe(P){return!P||!O(P)?[]:[{id:"accept",label:"Yes"},{id:"acceptForSession",label:"Yes for Session"}]}const Oe=oe(()=>xe(n.request));ct(()=>{var P;return((P=n.request)==null?void 0:P.id)??0},()=>{var P;s.value="",i.value={},a.value={},l.value={},u.value="",o.value=((P=Oe.value[0])==null?void 0:P.id)??"accept"},{immediate:!0}),ct(Oe,P=>{var $;o.value!=="decline"&&(P.some(j=>j.id===o.value)||(o.value=(($=P[0])==null?void 0:$.id)??"accept"))},{immediate:!0});function J(P,$){return`${String(P)}:${$}`}function de(P){const $=d(P.params),j=Array.isArray($==null?void 0:$.questions)?$.questions:[],K=[];for(const ae of j){const $e=d(ae);if(!$e)continue;const Ue=f($e.id);if(!Ue)continue;const nt=Array.isArray($e.options)?$e.options.map(rt=>d(rt)).map(rt=>({label:f(rt==null?void 0:rt.label),description:f(rt==null?void 0:rt.description)})).filter(rt=>rt.label.length>0):[];K.push({id:Ue,header:f($e.header),question:f($e.question),isOther:$e.isOther===!0,options:nt})}return K}function Re(P,$,j){const K=J(P,$),ae=i.value[K];return typeof ae=="string"&&ae.length>0?ae:j}function Fe(P,$){return a.value[J(P,$)]??""}function ve(P,$,j){const K=j.target;if(!(K instanceof HTMLSelectElement))return;const ae=J(P,$);i.value={...i.value,[ae]:K.value}}function we(P,$,j){const K=j.target;if(!(K instanceof HTMLInputElement))return;const ae=J(P,$);a.value={...a.value,[ae]:K.value}}function ie(P,$,j){var ae,$e;const K=Re(P,$,((ae=j[0])==null?void 0:ae.label)||"");return(($e=j.find(Ue=>Ue.label===K))==null?void 0:$e.description)??""}function Ie(P,$){return`${String(P)}:${$}`}function De(P){var $;return f(($=d(P.params))==null?void 0:$.serverName)}function Pe(P){var j;const $=f((j=d(P.params))==null?void 0:j.url);if(!$)return"";try{const K=new URL($),ae=K.protocol.toLowerCase();return ae==="https:"||ae==="http:"?K.toString():""}catch{return""}}function Ve(P){const $=d(P.params),j=d($==null?void 0:$.requestedSchema),K=d(j==null?void 0:j.properties);if(!K)return[];const ae=new Set(Array.isArray(j==null?void 0:j.required)?j.required.filter($e=>typeof $e=="string"):[]);return Object.entries(K).map(([$e,Ue])=>ze($e,d(Ue),ae.has($e))).filter($e=>$e!==null)}function ze(P,$,j){if(!$)return null;const K=f($.title)||P,ae=f($.description),$e=f($.type);if($e==="boolean")return{key:P,label:K,description:ae,required:j,kind:"boolean",inputType:"checkbox",options:[],defaultValue:typeof $.default=="boolean"?$.default:null,hasExplicitDefault:typeof $.default=="boolean"};if($e==="number"||$e==="integer")return{key:P,label:K,description:ae,required:j,kind:"number",inputType:"number",options:[],defaultValue:typeof $.default=="number"?$.default:null,hasExplicitDefault:typeof $.default=="number"};const Ue=Ge($);if($e==="array")return{key:P,label:K,description:ae,required:j,kind:"multiEnum",inputType:"checkbox",options:Ue,defaultValue:Array.isArray($.default)?$.default.filter(rt=>typeof rt=="string"):[],hasExplicitDefault:Array.isArray($.default)};const nt=g($.default);return Ue.length>0?{key:P,label:K,description:ae,required:j,kind:"singleEnum",inputType:"select",options:Ue,defaultValue:nt,hasExplicitDefault:nt!==null}:{key:P,label:K,description:ae,required:j,kind:"string",inputType:at($),options:[],defaultValue:nt,hasExplicitDefault:nt!==null}}function Ge(P){const j=(Array.isArray(P.oneOf)?P.oneOf:Array.isArray(P.anyOf)?P.anyOf:[]).map(Ue=>d(Ue)).map(Ue=>({value:f(Ue==null?void 0:Ue.const),label:f(Ue==null?void 0:Ue.title)||f(Ue==null?void 0:Ue.const)})).filter(Ue=>Ue.value.length>0);if(j.length>0)return j;const K=d(P.items);if(K){const Ue=Ge(K);if(Ue.length>0)return Ue}const ae=Array.isArray(P.enum)?P.enum.filter(Ue=>typeof Ue=="string"):[],$e=Array.isArray(P.enumNames)?P.enumNames.filter(Ue=>typeof Ue=="string"):[];return ae.map((Ue,nt)=>({value:Ue,label:$e[nt]||Ue}))}function at(P){const $=f(P.format);return $==="email"?"email":$==="uri"?"url":$==="date"?"date":$==="date-time"?"datetime-local":"text"}function Ye(P,$){const j=l.value[Ie(P,$.key)];return j!==void 0?j:$.defaultValue}function G(P,$){const j=Ye(P,$);return Array.isArray(j)?j.filter(K=>typeof K=="string"):[]}function be(P,$,j){const K=j.target;if(!(K instanceof HTMLInputElement)&&!(K instanceof HTMLSelectElement))return;const ae=K.value,$e=($.kind==="number",ae);l.value={...l.value,[Ie(P,$.key)]:ae.length>0?$e:null},u.value=""}function fe(P,$,j){const K=j.target;if(!(K instanceof HTMLSelectElement))return;let ae=null;K.value==="true"?ae=!0:K.value==="false"&&(ae=!1),l.value={...l.value,[Ie(P,$.key)]:ae},u.value=""}function je(P,$,j,K){const ae=K.target;if(!(ae instanceof HTMLInputElement))return;const $e=new Set(G(P,$));ae.checked?$e.add(j):$e.delete(j),l.value={...l.value,[Ie(P,$.key)]:Array.from($e)},u.value=""}function Xe(P){return P===!0?"true":P===!1?"false":""}function E(P,$){const j=Ye(P,$);return $.kind==="multiEnum"?Array.isArray(j)&&j.length>0:$.kind==="boolean"?typeof j=="boolean":$.kind==="number"&&typeof j=="number"?!0:typeof j=="string"&&j.trim().length>0}function I(P){const $=Ve(P).filter(j=>j.required&&!E(P.id,j)).map(j=>j.label);return $.length===0?"":$.length===1?`Answer the required field: ${$[0]}.`:`Answer the required fields: ${$.join(", ")}.`}function q(P){const $={};for(const j of Ve(P)){const K=Ye(P.id,j);if(j.kind==="multiEnum"){const $e=Array.isArray(K)?K:[];($e.length>0||j.required)&&($[j.key]=$e);continue}if(j.kind==="boolean"){typeof K=="boolean"&&($[j.key]=K);continue}if(j.kind==="number"){const $e=typeof K=="number"?K:Number(String(K).trim());Number.isNaN($e)||($[j.key]=$e);continue}const ae=String(K??"").trim();(ae.length>0||j.required)&&($[j.key]=ae)}return $}function Z(P){o.value=P}function X(){o.value="decline"}function Y(P){const $=P.target;$ instanceof HTMLInputElement&&(s.value=$.value,o.value="decline")}function se(P,$){var j;if(R(P)){if($==="decline"||$==="cancel"){r("respondServerRequest",{id:P.id,error:{code:-32e3,message:$==="cancel"?"Cancelled from CodexUI.":"Declined from CodexUI."}});return}const K=d((j=d(P.params))==null?void 0:j.permissions)??{};r("respondServerRequest",{id:P.id,result:{permissions:K,scope:$==="acceptForSession"?"session":"turn"}});return}r("respondServerRequest",{id:P.id,result:{decision:$}})}function pe(P){const $=s.value.trim(),j=$.length>0?"decline":o.value;if(R(P)){se(P,j);return}r("respondServerRequest",{id:P.id,result:{decision:j},followUpMessageText:$||void 0})}function ue(P,$){const j=d(P.params),K={action:$};if($==="accept"&&f(j==null?void 0:j.mode)==="form"){const ae=I(P);if(ae){u.value=ae;return}K.content=q(P)}r("respondServerRequest",{id:P.id,result:K})}function ee(P){var K;const $=de(P),j={};for(const ae of $){const $e=Re(P.id,ae.id,((K=ae.options[0])==null?void 0:K.label)||""),Ue=Fe(P.id,ae.id).trim(),nt=[$e,Ue].map(rt=>rt.trim()).filter(rt=>rt.length>0);j[ae.id]={answers:nt}}r("respondServerRequest",{id:P.id,result:{answers:j}})}function Ne(P){r("respondServerRequest",{id:P.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function Se(P){r("respondServerRequest",{id:P.id,result:{success:!0,contentItems:[]}})}function _e(P){r("respondServerRequest",{id:P.id,result:{}})}function Ae(P){r("respondServerRequest",{id:P.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(P,$)=>e.request?(x(),L("section",MO,[b("article",{class:ht(["thread-pending-request-shell",{"thread-pending-request-shell--no-top-radius":e.hasQueueAbove}])},[O(e.request)?(x(),L(Je,{key:0},[b("p",PO,le(ne(e.request)),1),me(e.request)?(x(),L("p",{key:0,class:"thread-pending-request-command-line",title:me(e.request)},le(me(e.request)),9,$O)):he("",!0),b("section",NO,[b("div",OO,[(x(!0),L(Je,null,Dt(Oe.value,(j,K)=>(x(),L("button",{key:j.id,type:"button",class:ht(["thread-pending-request-option",{"is-selected":o.value===j.id}]),"aria-pressed":o.value===j.id,onClick:ae=>Z(j.id)},[b("span",DO,le(K+1)+".",1),b("span",jO,le(j.label),1)],10,LO))),128))]),b("footer",FO,[b("label",{class:ht(["thread-pending-request-inline-input",{"is-active":o.value==="decline"||s.value.length>0}])},[$[11]||($[11]=b("span",{class:"thread-pending-request-option-index"},"3.",-1)),b("input",{class:"thread-pending-request-inline-control",type:"text",value:s.value,placeholder:"No, and tell Codex what to do differently",onFocus:X,onInput:Y,onKeydown:$[0]||($[0]=en(pt(j=>pe(e.request),["prevent"]),["enter"]))},null,40,BO)],2),b("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[1]||($[1]=j=>se(e.request,"cancel"))}," Skip "),b("button",{type:"button",class:"thread-pending-request-primary",onClick:$[2]||($[2]=j=>pe(e.request))}," Send ")])])],64)):(x(),L(Je,{key:1},[b("header",UO,[b("div",qO,[b("p",HO,le(ce(e.request)),1),b("p",WO,le(ne(e.request)),1)]),(e.requestCount??0)>1?(x(),L("span",VO,le(e.requestCount??0)+" pending",1)):he("",!0)]),me(e.request)?(x(),L("div",zO,[b("code",GO,le(me(e.request)),1)])):he("",!0),e.request.method==="mcpServer/elicitation/request"?(x(),L("section",KO,[De(e.request)?(x(),L("p",YO," Server: "+le(De(e.request)),1)):he("",!0),Pe(e.request)?(x(),L("a",{key:1,class:"thread-pending-request-link",href:Pe(e.request),target:"_blank",rel:"noopener noreferrer"}," Open authorization link ",8,JO)):he("",!0),(x(!0),L(Je,null,Dt(Ve(e.request),j=>(x(),L("div",{key:`${e.request.id}:${j.key}`,class:"thread-pending-request-question"},[b("p",XO,[Bs(le(j.label),1),j.required?(x(),L("span",QO," *")):he("",!0)]),j.description?(x(),L("p",ZO,le(j.description),1)):he("",!0),j.kind==="string"||j.kind==="number"?(x(),L("label",eL,[$[12]||($[12]=b("span",{class:"thread-pending-request-select-label"},"Value",-1)),b("input",{class:"thread-pending-request-input",type:j.inputType,value:String(Ye(e.request.id,j)??""),onInput:K=>be(e.request.id,j,K)},null,40,tL)])):j.kind==="boolean"?(x(),L("label",nL,[$[15]||($[15]=b("span",{class:"thread-pending-request-select-label"},"Choice",-1)),b("select",{class:"thread-pending-request-select",value:Xe(Ye(e.request.id,j)),onChange:K=>fe(e.request.id,j,K)},[j.hasExplicitDefault?he("",!0):(x(),L("option",oL,"Select true or false")),$[13]||($[13]=b("option",{value:"true"},"True",-1)),$[14]||($[14]=b("option",{value:"false"},"False",-1))],40,rL)])):j.kind==="singleEnum"?(x(),L("label",sL,[$[16]||($[16]=b("span",{class:"thread-pending-request-select-label"},"Choice",-1)),b("select",{class:"thread-pending-request-select",value:String(Ye(e.request.id,j)??""),onChange:K=>be(e.request.id,j,K)},[j.hasExplicitDefault?he("",!0):(x(),L("option",aL,"Select an option")),(x(!0),L(Je,null,Dt(j.options,K=>(x(),L("option",{key:`${e.request.id}:${j.key}:${K.value}`,value:K.value},le(K.label),9,lL))),128))],40,iL)])):(x(),L("div",cL,[(x(!0),L(Je,null,Dt(j.options,K=>(x(),L("label",{key:`${e.request.id}:${j.key}:${K.value}`,class:"thread-pending-request-checkbox-row"},[b("input",{class:"thread-pending-request-checkbox",type:"checkbox",checked:G(e.request.id,j).includes(K.value),onChange:ae=>je(e.request.id,j,K.value,ae)},null,40,uL),b("span",dL,le(K.label),1)]))),128))]))]))),128)),u.value?(x(),L("p",fL,le(u.value),1)):he("",!0),b("footer",pL,[b("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[3]||($[3]=j=>ue(e.request,"cancel"))}," Cancel "),b("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[4]||($[4]=j=>ue(e.request,"decline"))}," Decline "),b("button",{type:"button",class:"thread-pending-request-primary",onClick:$[5]||($[5]=j=>ue(e.request,"accept"))}," Continue ")])])):e.request.method==="item/tool/requestUserInput"?(x(),L("section",hL,[(x(!0),L(Je,null,Dt(de(e.request),j=>{var K;return x(),L("div",{key:`${e.request.id}:${j.id}`,class:"thread-pending-request-question"},[b("p",mL,le(j.header||j.question),1),j.question?(x(),L("p",gL,le(j.question),1)):he("",!0),j.options.length>0?(x(),L("div",vL,[b("label",yL,[$[17]||($[17]=b("span",{class:"thread-pending-request-select-label"},"Choice",-1)),b("select",{class:"thread-pending-request-select",value:Re(e.request.id,j.id,((K=j.options[0])==null?void 0:K.label)||""),onChange:ae=>ve(e.request.id,j.id,ae)},[(x(!0),L(Je,null,Dt(j.options,ae=>(x(),L("option",{key:`${e.request.id}:${j.id}:${ae.label}`,value:ae.label},le(ae.label),9,bL))),128))],40,_L)]),ie(e.request.id,j.id,j.options)?(x(),L("p",wL,le(ie(e.request.id,j.id,j.options)),1)):he("",!0)])):he("",!0),j.isOther?(x(),L("label",SL,[$[18]||($[18]=b("span",{class:"thread-pending-request-select-label"},"Other answer",-1)),b("input",{class:"thread-pending-request-input",type:"text",value:Fe(e.request.id,j.id),placeholder:"Other answer",onInput:ae=>we(e.request.id,j.id,ae)},null,40,TL)])):he("",!0)])}),128)),b("footer",EL,[b("button",{type:"button",class:"thread-pending-request-primary",onClick:$[6]||($[6]=j=>ee(e.request))}," Send ")])])):e.request.method==="item/tool/call"?(x(),L("section",kL,[b("button",{type:"button",class:"thread-pending-request-primary",onClick:$[7]||($[7]=j=>Ne(e.request))}," Fail Tool Call "),b("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[8]||($[8]=j=>Se(e.request))}," Success (Empty) ")])):(x(),L("section",IL,[b("button",{type:"button",class:"thread-pending-request-primary",onClick:$[9]||($[9]=j=>_e(e.request))}," Return Empty Result "),b("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[10]||($[10]=j=>Ae(e.request))}," Reject Request ")]))],64))],2)])):he("",!0)}}),AL=kt(CL,[["__scopeId","data-v-a033894d"]]),xL={key:0,class:"queued-messages"},RL={class:"queued-messages-inner"},ML={class:"queued-row-text"},PL={class:"queued-row-actions"},$L=["onClick"],NL=["onClick"],OL=["onClick"],LL=In({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete"],setup(e){function t(n){var l,u,d;const r=n.text.trim();if(r)return r;const o=[],s=((l=n.imageUrls)==null?void 0:l.length)??0,i=((u=n.fileAttachments)==null?void 0:u.length)??0,a=((d=n.skills)==null?void 0:d.length)??0;return s>0&&o.push(`${s} image${s===1?"":"s"}`),i>0&&o.push(`${i} file${i===1?"":"s"}`),a>0&&o.push(`${a} skill${a===1?"":"s"}`),o.join(", ")||"(empty queued message)"}return(n,r)=>e.messages.length>0?(x(),L("div",xL,[b("div",RL,[(x(!0),L(Je,null,Dt(e.messages,o=>(x(),L("div",{key:o.id,class:"queued-row"},[r[1]||(r[1]=b("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),b("span",ML,le(t(o)),1),b("div",PL,[b("button",{class:"queued-row-edit",type:"button",title:"Edit queued message",onClick:s=>n.$emit("edit",o.id)},"Edit",8,$L),b("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>n.$emit("steer",o.id)},"Steer",8,NL),b("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>n.$emit("delete",o.id)},[...r[0]||(r[0]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,OL)])]))),128))])])):he("",!0)}}),DL=kt(LL,[["__scopeId","data-v-835c6739"]]),jL={key:0,class:"rate-limit-status","aria-live":"polite"},FL=["title"],BL={class:"rate-limit-card-header"},UL={class:"rate-limit-card-title"},qL={key:0,class:"rate-limit-card-plan"},HL={class:"rate-limit-card-metrics"},WL={key:0,class:"rate-limit-card-footer"},VL=In({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(R){var O,W;return((O=R.limitId)==null?void 0:O.trim())||((W=R.limitName)==null?void 0:W.trim())||"__default__"}function n(R){var O,W;return((O=R.limitName)==null?void 0:O.trim())||((W=R.limitId)==null?void 0:W.trim())||"Rate limits"}function r(R){const O=R.trim();return O?O.replace(/[_-]+/g," ").replace(/\b\w/g,W=>W.toUpperCase()):""}function o(R){return!R||R<=0?"Window":R%1440===0?`${R/1440}d`:R%60===0?`${R/60}h`:R<60?`${R}m`:`${Math.round(R/60*10)/10}h`}function s(R){const O=Math.max(0,Math.min(100,100-R));return`${Math.round(O)}% left`}function i(R){return`${Math.round(R)}%`}function a(R,O){return{key:O,label:`${o(R.windowDurationMins)} ${s(R.usedPercent)}`}}function l(R){const O=[];return R.primary&&O.push(a(R.primary,"primary")),R.secondary&&O.push(a(R.secondary,"secondary")),O}function u(R){if(!R)return"";const O=new Date(R*1e3),W=O.getMonth()+1,z=String(O.getDate()).padStart(2,"0"),ce=String(O.getHours()).padStart(2,"0"),ne=String(O.getMinutes()).padStart(2,"0");return`${W}.${z} ${ce}:${ne}`}function d(R){if(!(R!=null&&R.resetsAt))return"";const O=R.resetsAt*1e3-Date.now();if(O<=0)return"Resetting now";const W=Math.round(O/6e4);if(W<60)return`Resets in ${W}m`;const z=Math.round(W/60);return z<24?`Resets in ${z}h`:`Resets in ${Math.round(z/24)}d`}function f(R){return[R.primary,R.secondary].filter(O=>O!==null)}function g(R){const O=f(R);return O.length===0?null:[...O].sort((W,z)=>{const ce=W.windowDurationMins??Number.MAX_SAFE_INTEGER,ne=z.windowDurationMins??Number.MAX_SAFE_INTEGER;return ce!==ne?ce-ne:(W.resetsAt??Number.MAX_SAFE_INTEGER)-(z.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function y(R){const O=f(R);if(O.length===0)return"";const W=[...O].sort((ce,ne)=>{const Q=ce.windowDurationMins??-1,me=ne.windowDurationMins??-1;return Q!==me?me-Q:(ne.resetsAt??-1)-(ce.resetsAt??-1)})[0],z=u(W.resetsAt);return z||""}function k(R){const O=R.credits;return O?O.unlimited?"Unlimited credits":O.balance?`Credits ${O.balance}`:O.hasCredits?"Credits available":"":""}function A(R){return[d(g(R)),y(R),k(R)].filter(O=>O.length>0)}function H(R){const O=[n(R)];for(const W of l(R))O.push(W.label);for(const W of f(R))O.push(`${o(W.windowDurationMins)} used ${i(W.usedPercent)}`);for(const W of A(R))O.push(W);return O.join(`
77
- `)}return(R,O)=>e.snapshots.length>0?(x(),L("aside",jL,[(x(!0),L(Je,null,Dt(e.snapshots,W=>(x(),L("div",{key:t(W),class:"rate-limit-card",title:H(W)},[b("div",BL,[b("span",UL,le(n(W)),1),W.planType?(x(),L("span",qL,le(r(W.planType)),1)):he("",!0)]),b("div",HL,[(x(!0),L(Je,null,Dt(l(W),z=>(x(),L("span",{key:z.key,class:"rate-limit-card-metric"},le(z.label),1))),128))]),A(W).length>0?(x(),L("div",WL,le(A(W).join(" | ")),1)):he("",!0)],8,FL))),128))])):he("",!0)}}),zL=kt(VL,[["__scopeId","data-v-df88906b"]]),GL={class:"runtime-toggle",role:"radiogroup","aria-label":"Continue in"},KL=["aria-checked","onClick"],YL={class:"runtime-toggle-option-label"},JL=In({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=[{value:"local",label:"Local project",icon:Ip},{value:"worktree",label:"New worktree",icon:ec}];function o(s){n("update:modelValue",s)}return(s,i)=>(x(),L("div",GL,[(x(),L(Je,null,Dt(r,a=>b("button",{key:a.value,class:ht(["runtime-toggle-option",{"is-selected":e.modelValue===a.value}]),type:"button",role:"radio","aria-checked":e.modelValue===a.value,onClick:l=>o(a.value)},[(x(),mt(Uf(a.icon),{class:"runtime-toggle-option-icon"})),b("span",YL,le(a.label),1)],10,KL)),64))]))}}),XL=kt(JL,[["__scopeId","data-v-e8b0d0ac"]]),QL={},ZL={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function eD(e,t){return x(),L("svg",ZL,[...t[0]||(t[0]=[b("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),b("path",{d:"M9 4l0 16"},null,-1)])])}const tD=kt(QL,[["render",eD]]),nD={},rD={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function oD(e,t){return x(),L("svg",rD,[...t[0]||(t[0]=[b("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const sD=kt(nD,[["render",oD]]),iD={class:"sidebar-thread-controls"},aD=["aria-label","title"],lD=In({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(x(),L("div",iD,[b("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(x(),mt(sD,{key:0,class:"sidebar-thread-controls-icon"})):(x(),mt(tD,{key:1,class:"sidebar-thread-controls-icon"}))],8,aD),no(t.$slots,"default",{},void 0),e.showNewThreadButton?(x(),L("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[We(_c,{class:"sidebar-thread-controls-icon"})])):he("",!0)]))}}),Eg=kt(lD,[["__scopeId","data-v-46a10052"]]),cD={},uD={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function dD(e,t){return x(),L("svg",uD,[...t[0]||(t[0]=[b("circle",{cx:"11",cy:"11",r:"8"},null,-1),b("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const kg=kt(cD,[["render",dD]]),fD={},pD={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function hD(e,t){return x(),L("svg",pD,[...t[0]||(t[0]=[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),b("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const mD=kt(fD,[["render",hD]]),gD={},vD={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function yD(e,t){return x(),L("svg",vD,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const _D=kt(gD,[["render",yD]]);function Lr(e){return e.flatMap(t=>t.threads)}const hb="codex-web-local.thread-read-state.v1",mb="codex-web-local.thread-scroll-state.v1",gb="codex-web-local.thread-token-usage.v1",Sf="codex-web-local.selected-thread-id.v1",Tf="codex-web-local.selected-model-by-context.v1",vb="codex-web-local.selected-model-id.v1",yb="codex-web-local.project-order.v1",_b="codex-web-local.project-display-name.v1",Ef="codex-web-local.collaboration-mode-by-context.v1",bb="codex-web-local.collaboration-mode.v1",tl="__new-thread__",kd=220,bD=500,wD=3e3,Ig=["none","minimal","low","medium","high","xhigh"],ii="__global__",SD="gpt-5.4-mini",Or="gpt-5.2-codex";function TD(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(hb);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Cg(e){typeof window>"u"||window.localStorage.setItem(hb,JSON.stringify(e))}function kf(e){return e==="plan"?"plan":"default"}function bc(e){return typeof e=="string"?e.trim():""}function jr(){return Object.create(null)}function Id(e){const t=jr();for(const[n,r]of Object.entries(e))t[n]=r;return t}function Cd(e,t){if(!(t in e))return e;const n=jr();for(const[r,o]of Object.entries(e))r!==t&&(n[r]=o);return n}function Ag(e,t){let n=!1;const r=jr();for(const[o,s]of Object.entries(e)){if(o===tl||t.has(o)){r[o]=s;continue}n=!0}return n?r:e}function wc(e){return e.trim()||tl}function ED(){if(typeof window>"u")return jr();try{const n=window.localStorage.getItem(Tf);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return jr();const o=jr();for(const[s,i]of Object.entries(r)){if(typeof s!="string"||s.length===0)continue;const a=bc(i);a&&(o[s]=a)}return o}}catch{}const e=bc(window.localStorage.getItem(vb)),t=jr();return e&&(t[tl]=e),t}function xg(e,t){const n=wc(t),r=bc(e[n]);return r||bc(e[tl])||SD}function Ad(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Tf):window.localStorage.setItem(Tf,JSON.stringify(e)),window.localStorage.removeItem(vb)}catch{}}function kD(){if(typeof window>"u")return jr();try{const n=window.localStorage.getItem(Ef);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return jr();const o=jr();for(const[s,i]of Object.entries(r)){if(typeof s!="string"||s.length===0)continue;const a=kf(i);a==="plan"&&(o[s]=a)}return o}}catch{}const e=kf(window.localStorage.getItem(bb)),t=jr();return e==="plan"&&(t[tl]="plan"),t}function Ol(e,t){const n=wc(t);return kf(e[n])}function Rg(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Ef):window.localStorage.setItem(Ef,JSON.stringify(e)),window.localStorage.removeItem(bb)}catch{}}function va(e,t,n){return Math.min(Math.max(e,t),n)}function ID(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.scrollTop!="number"||!Number.isFinite(t.scrollTop)||typeof t.isAtBottom!="boolean")return null;const n={scrollTop:Math.max(0,t.scrollTop),isAtBottom:t.isAtBottom};return typeof t.scrollRatio=="number"&&Number.isFinite(t.scrollRatio)&&(n.scrollRatio=va(t.scrollRatio,0,1)),n}function CD(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(mb);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){if(!r)continue;const s=ID(o);s&&(n[r]=s)}return n}catch{return{}}}function Mg(e){typeof window>"u"||window.localStorage.setItem(mb,JSON.stringify(e))}function ui(e){if(typeof e=="number"&&Number.isFinite(e))return Math.max(0,Math.trunc(e));if(typeof e=="string"&&e.trim().length>0){const t=Number(e);if(Number.isFinite(t))return Math.max(0,Math.trunc(t))}return null}function Pg(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return{totalTokens:ui(t.totalTokens)??0,inputTokens:ui(t.inputTokens)??0,cachedInputTokens:ui(t.cachedInputTokens)??0,outputTokens:ui(t.outputTokens)??0,reasoningOutputTokens:ui(t.reasoningOutputTokens)??0}}function AD(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=Pg(t.total),r=Pg(t.last);if(!n||!r)return null;const o=ui(t.modelContextWindow),s=r.totalTokens,i=typeof o=="number"?Math.max(o-s,0):null,a=typeof o=="number"&&o>0?va(Math.round((i??0)/o*100),0,100):null;return{total:n,last:r,modelContextWindow:o,currentContextTokens:s,remainingContextTokens:i,remainingContextPercent:a}}function xD(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(gb);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){if(!r)continue;const s=AD(o);s&&(n[r]=s)}return n}catch{return{}}}function $g(e){typeof window>"u"||window.localStorage.setItem(gb,JSON.stringify(e))}function RD(){return typeof window>"u"?"":window.localStorage.getItem(Sf)??""}function MD(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Sf);return}window.localStorage.setItem(Sf,e)}}function PD(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(yb);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t){if(typeof r!="string"||r.length===0)continue;const o=el(r);o.length>0&&!n.includes(o)&&n.push(o)}return n}catch{return[]}}function ai(e){typeof window>"u"||window.localStorage.setItem(yb,JSON.stringify(e))}function $D(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(_b);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){const s=typeof r=="string"?el(r):"";s.length>0&&typeof o=="string"&&(n[s]=o)}return n}catch{return{}}}function xd(e){typeof window>"u"||window.localStorage.setItem(_b,JSON.stringify(e))}function Ll(e,t){const n=[];for(const r of e)n.includes(r)||n.push(r);for(const r of t)n.includes(r.projectName)||n.push(r.projectName);return Xo(e,n)?e:n}function Rd(e,t){const n=new Map(e.map(o=>[o.projectName,o])),r=t.map(o=>n.get(o)??null).filter(o=>o!==null&&o.threads.length>0);for(const o of e)t.includes(o.projectName)||r.push(o);return r}function Xo(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1)if(n[o]!==r[o])return!1;return!0}function ND(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[o]=r.splice(t,1);return r.splice(n,0,o),r}function OD(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function LD(e=[],t=[]){var n,r,o,s;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(((n=e[i])==null?void 0:n.step)!==((r=t[i])==null?void 0:r.step)||((o=e[i])==null?void 0:o.status)!==((s=t[i])==null?void 0:s.status))return!1;return!0}function DD(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&LD(e.steps,t.steps)}function Dl(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function If(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Xo(e.images,t.images)&&FD(e.fileChanges,t.fileChanges)&&e.fileChangeStatus===t.fileChangeStatus&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&OD(e.commandExecution,t.commandExecution)&&DD(e.plan,t.plan)&&e.turnId===t.turnId&&e.turnIndex===t.turnIndex}function pi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function jD(e,t,n={}){const r=new Map(e.map(d=>[d.id,d])),o=new Map(t.map(d=>[d.id,d])),s=t.map(d=>{const f=r.get(d.id);return f&&If(f,d)?f:d});if(n.preserveMissing!==!0)return pi(e,s)?e:s;const i=e.map(d=>{const f=o.get(d.id);return!f||If(d,f)?d:f}),a=new Set(e.map(d=>d.id)),l=s.filter(d=>!a.has(d.id)),u=[...i,...l];return pi(e,u)?e:u}function FD(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],o=t[n];if(r.path!==o.path||r.operation!==o.operation||r.movedToPath!==o.movedToPath||r.diff!==o.diff||r.addedLineCount!==o.addedLineCount||r.removedLineCount!==o.removedLineCount)return!1}return!0}function Cf(e){return e.replace(/\s+/gu," ").trim()}function BD(e,t){const n=new Set(t.map(s=>s.id)),r=new Set(t.filter(s=>s.role==="assistant").map(s=>Cf(s.text)).filter(s=>s.length>0));if(r.size===0)return e;const o=e.filter(s=>{if(s.messageType!=="agentMessage.live")return!0;if(n.has(s.id))return!1;const i=Cf(s.text);return i.length===0?!1:!r.has(i)});return o.length===e.length?e:o}function jl(e,t){const n=e.findIndex(s=>s.id===t.id);if(n<0)return[...e,t];const r=e[n];if(If(r,t))return e;const o=[...e];return o.splice(n,1,t),o}const wb="worked";function Go(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function UD(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=t%60,s=[];n>0&&s.push(`${n}h`),(r>0||n>0)&&s.push(`${r}m`);const i=o>0||s.length===0?o:0;return s.push(`${i}s`),s.join(" ")}function qD(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function HD(e,t){if(!e&&!t)return!0;if(!e||!t||e.label!==t.label||e.details.length!==t.details.length)return!1;for(let n=0;n<e.details.length;n+=1)if(e.details[n]!==t.details[n])return!1;return!0}function WD(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${UD(e.durationMs)}`,messageType:wb,turnId:e.turnId}}function VD(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function zD(e,t){const n=WD(t),r=e.filter(i=>i.messageType!==wb),o=VD(r);if(o<0)return[...r,n];const s=[...r];return s.splice(o,0,n),s}function _t(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function GD(e,t){if(t.size===0)return e;let n=!1;const r={};for(const[o,s]of Object.entries(e)){if(t.has(o)){n=!0;continue}r[o]=s}return n?r:e}function KD(e,t){return e.id===t.id&&e.title===t.title&&e.projectName===t.projectName&&e.cwd===t.cwd&&e.createdAtIso===t.createdAtIso&&e.updatedAtIso===t.updatedAtIso&&e.preview===t.preview&&e.unread===t.unread&&e.inProgress===t.inProgress&&e.pendingRequestState===t.pendingRequestState}function YD(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function JD(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Gt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Fl(e,t){const n=new Map(e.map(o=>[o.projectName,o])),r=t.map(o=>{const s=n.get(o.projectName),i=new Map((s==null?void 0:s.threads.map(l=>[l.id,l]))??[]),a=o.threads.map(l=>{const u=i.get(l.id);return u&&KD(u,l)?u:l});return s&&s.projectName===o.projectName&&YD(s.threads,a)?s:{projectName:o.projectName,threads:a}});return JD(e,r)?e:r}function XD(e,t,n){const r=new Set(Lr(t).map(a=>a.id)),o=Lr(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(o.length===0)return t;const s=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of o){if(s.get(a.projectName)){const u=i.findIndex(d=>d.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function Ko(e){return el(e)}function QD(e){const t=e.split(`
78
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function ZD(e){const t=e.trim()||"Untitled thread";return/^fork:\s+/iu.test(t)?t:`Fork: ${t}`}function ej(){const e=N([]),t=N([]),n=N(RD()),r=N({}),o=N({}),s=N({}),i=N({}),a=N({}),l=N({}),u=N({}),d=N({}),f=N({}),g=N({}),y=N([]),k=N([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),A=N(kD()),H=N(ED()),R=N(Ol(A.value,n.value)),O=N(xg(H.value,n.value)),W=N("medium"),z=N("standard"),ce=N(TD()),ne=N(CD()),Q=N(PD()),me=N($D()),Me=N({}),xe=N({}),Oe=N({}),J=N({}),de=N({}),Re=N({}),Fe=N({}),ve=N({}),we=N({}),ie=N({}),Ie=N({}),De=N({}),Pe=N({}),Ve=N(null),ze=N(xD()),Ge=N({}),at=N([]),Ye=N([]),G=N(!1),be=N(!1),fe=N(!1),je=N(!1),Xe=N(!1),E=N(!1),I=N(""),q=N(!1),Z=N(!1);let X=null,Y=null,se=null;const pe=new Map;let ue=null,ee=!1;const Ne=new Set;let Se=!1,_e=!1;const Ae=new Map,P=new Set,$=oe(()=>Lr(e.value)),j=oe(()=>$.value.find(c=>c.id===n.value)??null),K=oe(()=>ne.value[n.value]??null),ae=oe(()=>{const c=n.value;return c?we.value[c]===!0:!1}),$e=oe(()=>{const c=[],p=n.value;return p&&Array.isArray(De.value[p])&&c.push(...De.value[p]),Array.isArray(De.value[ii])&&c.push(...De.value[ii]),c.sort((v,S)=>v.receivedAtIso.localeCompare(S.receivedAtIso))}),Ue=oe(()=>{var F;const c=n.value;if(!c)return null;const p=u.value[c]===!0,v=p?Re.value[c]:void 0,S=p?(i.value[c]??"").trim():"",D=(((F=Fe.value[c])==null?void 0:F.message)??"").trim();return!v&&!S&&!D?null:{activityLabel:(v==null?void 0:v.label)||"Thinking",activityDetails:(v==null?void 0:v.details)??[],reasoningText:S,errorText:D}}),nt=oe(()=>Ve.value),rt=oe(()=>{const c=n.value;return c?ze.value[c]??null:null}),$t=oe(()=>{const c=n.value;if(!c)return[];const p=r.value[c]??[],v=o.value[c]??[],S=s.value[c]??[],D=a.value[c]??[],F=l.value[c]??[],U=[...p,...v,...D,...F,...S],V=de.value[c];return V?zD(U,V):U});function bt(c){return xg(H.value,c).trim()}function on(...c){const p=[...y.value];for(const v of c){const S=v.trim();S&&!p.includes(S)&&p.push(S)}Xo(y.value,p)||(y.value=p)}function tt(c){n.value!==c&&(n.value=c,MD(c),O.value=bt(c),on(O.value),R.value=Ol(A.value,c),_e=!1)}function fn(c){const p=c.trim(),v=wc(n.value);if(p){const S=Id(H.value);S[v]=p,H.value=S}else H.value=Cd(H.value,v);O.value=bt(n.value),on(O.value),Ad(H.value),mr({category:"ui.model",message:`model → ${O.value}`,level:"info"})}function Xt(c,p){const v=c.trim();if(!v)return;const S=p.trim();if(S){const D=Id(H.value);D[v]=S,H.value=D}else H.value=Cd(H.value,v);on(S),n.value===v&&(O.value=bt(n.value)),Ad(H.value)}function vr(c,p){const v=c.trim();if(!v)return;if(!p){if(!(v in ze.value))return;ze.value=_t(ze.value,v),$g(ze.value);return}const S=ze.value[v];S&&JSON.stringify(S)===JSON.stringify(p)||(ze.value={...ze.value,[v]:p},$g(ze.value))}function cr(c){const p=c==="plan"?"plan":"default",v=wc(n.value);if(!(Ol(A.value,n.value)===p&&R.value===p)){if(R.value=p,p==="plan"){const D=Id(A.value);D[v]=p,A.value=D}else A.value=Cd(A.value,v);Rg(A.value)}}function Xn(c){Ve.value=c}async function Vt(c=n.value){c.trim()?Xt(c,Or):fn(Or),on(Or)}function It(c,p){Pe.value={...Pe.value,[c]:p}}function pn(c){Pe.value[c]&&(Pe.value=_t(Pe.value,c))}async function jt(c){if(P.has(c))return;const p=Pe.value[c];if(!(!p||p.fallbackRetried)){P.add(c),It(c,{...p,fallbackRetried:!0});try{await Vt(c);try{const v=await vd(c,1);mn(c,v),qn(c),er(c,[]),Un(c),a.value[c]&&(a.value=_t(a.value,c))}catch{}Tt(c,null),I.value="",qt(c,null),wt(c,{label:"Thinking",details:yr(Or,p.effort,p.collaborationMode)}),Ct(c,!0),Oe.value[c]!==!0&&await gd(c),await yd(c,p.text,p.imageUrls,Or,p.effort||void 0,p.skills.length>0?p.skills:void 0,p.fileAttachments,p.collaborationMode),Oe.value={...Oe.value,[c]:!0},sn(),Ne.add(c),ee=!0,await nr()}catch(v){const S=v instanceof Error?v.message:"Unknown application error";Tt(c,S),I.value=S,Ct(c,!1),wt(c,null)}finally{P.delete(c)}}}function so(c){c&&!Ig.includes(c)||(W.value=c)}async function fs(c){const p=c==="fast"?"fast":"standard";if(Xe.value||z.value===p)return;const v=z.value;z.value=p,Xe.value=!0,I.value="";try{await wM(p)}catch(S){z.value=v,I.value=S instanceof Error?S.message:"Failed to update Fast mode"}finally{Xe.value=!1}}async function io(){try{const c=await kM();k.value=c,c.some(p=>p.value===R.value)||cr("default")}catch{}}function yr(c,p,v=R.value){const S=c.trim()||"default",D=p||"default",F=v==="plan"?"Plan":"Default",U=z.value==="fast"?"Fast":"Standard";return[`Mode: ${F}`,`Model: ${S}`,`Thinking: ${D}`,`Speed: ${U}`]}async function zr(){try{const[c,p]=await Promise.all([fb(),pb()]),v=bt(n.value),S=p.model.trim(),D=[...c];for(const F of[v,S])F&&!D.includes(F)&&D.push(F);y.value=D,v||(S&&D.includes(S)?fn(p.model):D.length>0?fn(D[0]):fn("")),p.reasoningEffort&&Ig.includes(p.reasoningEffort)&&(W.value=p.reasoningEffort),z.value=p.speedMode}catch{}}async function bn(){if(ue){await ue;return}ue=(async()=>{try{Ye.value=w(await dg())}catch{}finally{ue=null}})(),await ue}function sn(){if(typeof window>"u"){bn();return}se!==null&&window.clearTimeout(se),se=window.setTimeout(()=>{se=null,bn()},bD)}function Gr(c){if(!c||typeof window>"u")return;const p=pe.get(c);p!==void 0&&(window.clearTimeout(p),pe.delete(c))}function wn(c){if(!c||typeof window>"u")return;Gr(c);const p=window.setTimeout(()=>{pe.delete(c),Ne.add(c),nr()},wD);pe.set(c,p)}function Sn(c){const p=Ge.value;return Object.keys(p).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(S=>{const D=p[S.id];return D?{...S,title:D}:S})}))}function Qn(c){return c?Array.isArray(De.value[c])?De.value[c]:[]:[]}function ur(c){return c==="item/commandExecution/requestApproval"||c==="item/fileChange/requestApproval"||c==="item/permissions/requestApproval"||c==="execCommandApproval"||c==="applyPatchApproval"}function Fn(c){return c.some(p=>ur(p.method))?"approval":c.length>0?"response":null}function Ut(){const p=Sn(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(S=>{const D=u.value[S.id]===!0,F=Fn(Qn(S.id)),U=n.value===S.id,V=ce.value[S.id],te=g.value[S.id]===!0,ke=!U&&!D&&(te||V!==S.updatedAtIso);return{...S,inProgress:D,unread:ke,pendingRequestState:F}})}));e.value=Fl(e.value,p)}function _r(c,p,v){const S=new Date().toISOString(),D=Ht(p),F=el(D),U={id:c,title:QD(v),projectName:F,cwd:D,hasWorktree:D.includes("/.codex/worktrees/")||D.includes("/.git/worktrees/"),createdAtIso:S,updatedAtIso:S,preview:v,unread:!1,inProgress:!1},V=t.value.findIndex(ke=>ke.projectName===F);if(V>=0){const qe=t.value[V].threads.filter(Zt=>Zt.id!==c),lt={projectName:F,threads:[U,...qe]},vt=[...t.value];vt.splice(V,1,lt),t.value=vt}else t.value=[{projectName:F,threads:[U]},...t.value];const te=Ll(Q.value,t.value);Xo(Q.value,te)||(Q.value=te,ai(Q.value)),Ut()}function Zn(c){const p=new Set(c.map(V=>V.id)),v=Ag(H.value,p);v!==H.value&&(H.value=v,O.value=bt(n.value),on(O.value),Ad(v));const S=Ag(A.value,p);S!==A.value&&(A.value=S,R.value=Ol(S,n.value),Rg(S));const D=Gt(ce.value,p);D!==ce.value&&(ce.value=D,Cg(D));const F=Gt(ne.value,p);F!==ne.value&&(ne.value=F,Mg(F)),xe.value=Gt(xe.value,p),Me.value=Gt(Me.value,p),Oe.value=Gt(Oe.value,p),J.value=Gt(J.value,p),r.value=Gt(r.value,p),s.value=Gt(s.value,p),i.value=Gt(i.value,p),a.value=Gt(a.value,p),l.value=Gt(l.value,p),de.value=Gt(de.value,p),Re.value=Gt(Re.value,p),Fe.value=Gt(Fe.value,p),ve.value=Gt(ve.value,p),we.value=Gt(we.value,p),ie.value=Gt(ie.value,p),Ie.value=Gt(Ie.value,p),ze.value=Gt(ze.value,p),g.value=Gt(g.value,p),u.value=Gt(u.value,p);const U={};for(const[V,te]of Object.entries(De.value))(V===ii||p.has(V))&&(U[V]=te);De.value=U}function hn(c){const p=Lr(t.value).find(v=>v.id===c);p&&(ce.value={...ce.value,[c]:p.updatedAtIso},Cg(ce.value),g.value[c]&&(g.value=_t(g.value,c)),Ut())}function qt(c,p){if(!c)return;const v=de.value[c];if(p){if(qD(v,p))return;de.value={...de.value,[c]:p}}else v&&(de.value=_t(de.value,c))}function Ct(c,p){!c||u.value[c]===!0===p||(p?u.value={...u.value,[c]:!0}:(u.value=_t(u.value,c),gn(c),Tn(c)),Ut())}function Tn(c){c&&(we.value[c]&&(we.value=_t(we.value,c)),ie.value[c]&&(ie.value=_t(ie.value,c)),Ie.value[c]&&(Ie.value=_t(Ie.value,c)))}function An(c){c&&(we.value={...we.value,[c]:!0},ie.value[c]&&(ie.value=_t(ie.value,c)),Ie.value[c]&&(Ie.value=_t(Ie.value,c)))}function xn(c){c&&we.value[c]===!0&&ie.value[c]===!0&&Ie.value[c]===!0&&Tn(c)}function zt(c){const p=Object.keys(we.value);if(p.length===0)return;let v=ie.value,S=!1;for(const D of p)!c.has(D)||v[D]===!0||(v={...v,[D]:!0},S=!0);if(S){ie.value=v;for(const D of p)xn(D)}}function Bn(c,p){c&&we.value[c]===!0&&p.some(v=>v.role==="user")&&(Ie.value[c]!==!0&&(Ie.value={...Ie.value,[c]:!0}),xn(c))}function Rn(c){c&&c!==n.value&&g.value[c]!==!0&&(g.value={...g.value,[c]:!0},Ut())}function wt(c,p){if(!c)return;const v=Re.value[c];if(!p){v&&(Re.value=_t(Re.value,c));return}const S=ol(p.label)||"Thinking",D=p.details.map(V=>ol(V)).filter(V=>V.length>0&&V!==S),F=Array.from(new Set([...(v==null?void 0:v.details)??[],...D])).slice(-3),U={label:S,details:F};HD(v,U)||(Re.value={...Re.value,[c]:U})}function Tt(c,p,v={}){if(!c)return;const S=Fe.value[c],D=p?Cf(p):"";if(!D){S&&(Fe.value=_t(Fe.value,c));return}const F=v.transient===!0;(S==null?void 0:S.message)===D&&S.transient===F||(Fe.value={...Fe.value,[c]:{message:D,transient:F}})}function br(c){var p;c&&(p=Fe.value[c])!=null&&p.transient&&Tt(c,null)}function dr(){const c=Object.entries(Fe.value).filter(([,v])=>v==null?void 0:v.transient).map(([v])=>v);if(c.length===0)return;let p=Fe.value;for(const v of c)p=_t(p,v);Fe.value=p}function fr(c){const p=Lr(t.value).find(v=>v.id===c);return(p==null?void 0:p.updatedAtIso)??""}function jo(c,p){if(!c)return;const v={scrollTop:Math.max(0,p.scrollTop),isAtBottom:p.isAtBottom===!0};typeof p.scrollRatio=="number"&&Number.isFinite(p.scrollRatio)&&(v.scrollRatio=va(p.scrollRatio,0,1));const S=ne.value[c];S&&S.scrollTop===v.scrollTop&&S.isAtBottom===v.isAtBottom&&S.scrollRatio===v.scrollRatio||(ne.value={...ne.value,[c]:v},Mg(ne.value))}function mn(c,p){const v=r.value[c]??[];pi(v,p)||(r.value={...r.value,[c]:p})}function er(c,p){const v=s.value[c]??[];pi(v,p)||(s.value={...s.value,[c]:p})}function Kr(c){c&&c in s.value&&(s.value=_t(s.value,c))}function an(c,p){const v=l.value[c]??[];pi(v,p)||(l.value={...l.value,[c]:p})}function ao(c,p){const v=o.value[c]??[];pi(v,p)||(o.value={...o.value,[c]:p})}function Pr(c,p){const v=o.value[c]??[],S=jl(v,p);ao(c,S)}function Ft(c,p){const v=s.value[c]??[],S=jl(v,p);er(c,S)}function Mn(c,p){const v=l.value[c]??[],S=jl(v,p);an(c,S)}function nn(c,p){if(!c)return;const v=p.trim(),S=i.value[c]??"";if(v.length===0){if(!S)return;i.value=_t(i.value,c);return}S!==v&&(i.value={...i.value,[c]:v})}function lo(c,p){if(!c)return;const v=i.value[c]??"";nn(c,`${v}${p}`)}function Un(c){c&&c in i.value&&(i.value=_t(i.value,c))}function qn(c){c&&c in o.value&&(o.value=_t(o.value,c))}function $r(c){c&&c in l.value&&(l.value=_t(l.value,c))}function gn(c){c&&(qn(c),Un(c),wt(c,null),n.value,a.value[c]&&(a.value=_t(a.value,c)),ve.value[c]&&(ve.value=_t(ve.value,c)),pn(c))}function Nr(c){return c==="completed"?"completed":c==="inProgress"||c==="in_progress"?"inProgress":"pending"}function Hn(c){var v;const p=[];(v=c.explanation)!=null&&v.trim()&&p.push(c.explanation.trim());for(const S of c.steps){const D=S.status==="completed"?"x":S.status==="inProgress"?"~":" ";p.push(`- [${D}] ${S.step}`)}return p.join(`
79
- `).trim()}function tr(c){if(c.method!=="turn/plan/updated")return null;const p=Le(c.params),v=st(c),S=ye(p==null?void 0:p.turnId)||ye(p==null?void 0:p.turn_id),F=(Array.isArray(p==null?void 0:p.plan)?p==null?void 0:p.plan:[]).map(te=>Le(te)).map(te=>({step:ye(te==null?void 0:te.step),status:Nr(te==null?void 0:te.status)})).filter(te=>te.step.length>0);if(!v||!S)return null;const V={explanation:ye(p==null?void 0:p.explanation).trim()||void 0,steps:F,isStreaming:!0};return{threadId:v,message:{id:`${S}:plan`,role:"assistant",text:Hn(V),messageType:"plan.live",plan:V}}}function Qt(c){if(c.method!=="item/plan/delta")return null;const p=Le(c.params),v=st(c),S=ye(p==null?void 0:p.turnId)||ye(p==null?void 0:p.turn_id),D=ye(p==null?void 0:p.delta);if(!v||!S||!D)return null;const F=`${S}:plan`,U=(o.value[v]??[]).find(ke=>ke.id===F),V=`${(U==null?void 0:U.text)??""}${D}`,te=U!=null&&U.plan?{...U.plan,isStreaming:!0}:void 0;return{threadId:v,message:{id:F,role:"assistant",text:V,messageType:"plan.live",plan:te}}}function Le(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function ye(c){return typeof c=="string"?c:""}function vn(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function T(c){var p,v;return((p=c.limitId)==null?void 0:p.trim())||((v=c.limitName)==null?void 0:v.trim())||"__default__"}function M(c){const p=Le(c);if(!p)return null;const v=vn(p.windowDurationMins);return{usedPercent:va(vn(p.usedPercent)??0,0,100),windowDurationMins:v,windowMinutes:v,resetsAt:vn(p.resetsAt)}}function m(c){const p=Le(c);if(!p)return null;const v=Le(p.credits);return{limitId:ye(p.limitId)||null,limitName:ye(p.limitName)||null,primary:M(p.primary),secondary:M(p.secondary),credits:v?{hasCredits:v.hasCredits===!0,unlimited:v.unlimited===!0,balance:ye(v.balance)||null}:null,planType:ye(p.planType)||null}}function w(c){const p=Le(c);if(!p)return[];const v=[],S=new Set,D=U=>{if(!U)return;const V=T(U);S.has(V)||(S.add(V),v.push(U))};D(m(p.rateLimits));const F=Le(p.rateLimitsByLimitId);if(F)for(const U of Object.values(F))D(m(U));return v}function B(c){const p=Le(c);if(!p)return null;const v=vn(p.totalTokens??p.total_tokens),S=vn(p.inputTokens??p.input_tokens),D=vn(p.cachedInputTokens??p.cached_input_tokens),F=vn(p.outputTokens??p.output_tokens),U=vn(p.reasoningOutputTokens??p.reasoning_output_tokens);return v===null||S===null||D===null||F===null||U===null?null:{totalTokens:v,inputTokens:S,cachedInputTokens:D,outputTokens:F,reasoningOutputTokens:U}}function ge(c){const p=Le(c);if(!p)return null;const v=B(p.total),S=B(p.last);if(!v||!S)return null;const D=vn(p.modelContextWindow??p.model_context_window),F=S.totalTokens,U=typeof D=="number"?Math.max(D-F,0):null,V=typeof D=="number"&&D>0?va(Math.round((U??0)/D*100),0,100):null;return{total:v,last:S,modelContextWindow:D,currentContextTokens:F,remainingContextTokens:U,remainingContextPercent:V}}function ot(c){if(c.method!=="thread/tokenUsage/updated")return null;const p=Le(c.params),v=st(c),S=ge((p==null?void 0:p.tokenUsage)??(p==null?void 0:p.token_usage));return!v||!S?null:{threadId:v,usage:S}}function st(c){const p=Le(c.params);if(!p)return"";const v=ye(p.threadId);if(v)return v;const S=ye(p.thread_id);if(S)return S;const D=ye(p.conversationId);if(D)return D;const F=ye(p.conversation_id);if(F)return F;const U=Le(p.thread),V=ye(U==null?void 0:U.id);if(V)return V;const te=Le(p.turn),ke=ye(te==null?void 0:te.threadId);if(ke)return ke;const qe=ye(te==null?void 0:te.thread_id);return qe||""}function dt(c){if(c.method!=="turn/completed")return"";const p=Le(c.params),v=Le(p==null?void 0:p.turn);if(!v||v.status!=="failed")return"";const S=Le(v.error);return ye(S==null?void 0:S.message)}function ft(c){var S;if(c.method!=="error")return null;const p=Le(c.params),v=ye(p==null?void 0:p.message)||ye((S=Le(p==null?void 0:p.error))==null?void 0:S.message);return v?{message:v,transient:(p==null?void 0:p.willRetry)===!0}:null}function Bt(c){const p=Le(c);if(!p)return null;const v=p.id,S=ye(p.method),D=p.params;if(typeof v!="number"||!Number.isInteger(v)||!S)return null;const F=Le(D),U=Wn(S,F),V=ye(F==null?void 0:F.threadId)||ye(F==null?void 0:F.thread_id)||ye(F==null?void 0:F.conversationId)||ye(F==null?void 0:F.conversation_id)||ii,te=ye(F==null?void 0:F.turnId)||ye(F==null?void 0:F.turn_id),ke=ye(F==null?void 0:F.itemId)||ye(F==null?void 0:F.item_id)||ye(F==null?void 0:F.callId)||ye(F==null?void 0:F.call_id),qe=ye(p.receivedAtIso)||new Date().toISOString();return{id:v,method:U,threadId:V,turnId:te,itemId:ke,receivedAtIso:qe,params:D??null}}function Wn(c,p){const v=c.trim();return v&&(v==="item/commandExecution/requestApproval"||v==="execCommandApproval"||v==="exec_approval_request"||yn(p)?"item/commandExecution/requestApproval":v==="item/fileChange/requestApproval"||v==="applyPatchApproval"||v==="apply_patch_approval_request"||Ui(p)?"item/fileChange/requestApproval":v==="item/tool/requestUserInput"||v==="request_user_input"||ps(p)?"item/tool/requestUserInput":v==="mcpServer/elicitation/request"||v==="elicitation_request"||nl(p)?"mcpServer/elicitation/request":v==="item/permissions/requestApproval"||Pn(p)?"item/permissions/requestApproval":v==="item/tool/call"||v==="dynamic_tool_call_request"||co(p)?"item/tool/call":v)}function yn(c){if(!c)return!1;const p=c.command;return Array.isArray(p)&&p.some(v=>typeof v=="string"&&v.trim().length>0)||typeof p=="string"&&p.trim().length>0?!0:Array.isArray(c.commandActions)}function Ui(c){return c?typeof c.grantRoot=="string"&&c.grantRoot.trim().length>0||typeof c.grant_root=="string"&&c.grant_root.trim().length>0||Le(c.fileChanges)?!0:Le(c.changes)!==null:!1}function ps(c){return!!(c&&Array.isArray(c.questions))}function co(c){return c?typeof c.toolName=="string"||typeof c.tool_name=="string"||typeof c.name=="string"||Array.isArray(c.arguments):!1}function nl(c){if(!c)return!1;const p=ye(c.mode);return typeof c.serverName=="string"&&typeof c.threadId=="string"&&typeof c.message=="string"&&(p==="form"||p==="url")}function Pn(c){return c?typeof c.threadId=="string"&&typeof c.turnId=="string"&&typeof c.itemId=="string"&&Le(c.permissions)!==null:!1}function Fo(c){if(c.method!=="item/tool/requestUserInput")return[];const p=Le(c.params),v=Array.isArray(p==null?void 0:p.questions)?p.questions:[],S=[];for(const D of v){const F=Le(D),U=ye(F==null?void 0:F.id).trim();U&&S.push(U)}return S}function Kc(c){const p=c.threadId||ii,v=De.value[p]??[],S=v.findIndex(F=>F.id===c.id),D=[...v];S>=0?D.splice(S,1,c):D.push(c),De.value={...De.value,[p]:D.sort((F,U)=>F.receivedAtIso.localeCompare(U.receivedAtIso))},Ut()}function rl(c){const p={};for(const[v,S]of Object.entries(De.value)){const D=S.filter(F=>F.id!==c);D.length>0&&(p[v]=D)}De.value=p,Ut()}function Yc(c){const p={};for(const v of c){const S=v.threadId||ii,D=p[S]??[];D.push(v),p[S]=D}for(const v of Object.values(p))v.sort((S,D)=>S.receivedAtIso.localeCompare(D.receivedAtIso));De.value=p}function Js(c){if(c.method==="server/request"){const p=Bt(c.params);return p&&Kc(p),!0}if(c.method==="server/request/resolved"){const p=Le(c.params),v=p==null?void 0:p.id;return typeof v=="number"&&Number.isInteger(v)&&rl(v),!0}return!1}function ol(c){return c.replace(/\s+/gu," ").trim()}function qi(c){const p=st(c);if(!p)return null;if(c.method==="turn/started")return{threadId:p,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Le(c.params),S=Le(v==null?void 0:v.item),D=ye(S==null?void 0:S.type).toLowerCase();if(D==="reasoning")return{threadId:p,activity:{label:"Thinking",details:[]}};if(D==="agentmessage")return{threadId:p,activity:{label:"Writing response",details:[]}};if(D==="commandexecution"){const F=ye(S==null?void 0:S.command);return{threadId:p,activity:{label:"Running command",details:F?[F]:[]}}}if(D==="filechange"){const U=(Array.isArray(S==null?void 0:S.changes)?S.changes:[])[0],V=ye(U==null?void 0:U.path);return{threadId:p,activity:{label:"Applying changes",details:V?[V]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:p,activity:{label:"Running command",details:[]}}:c.method==="item/fileChange/outputDelta"?{threadId:p,activity:{label:"Applying changes",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:p,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:p,activity:{label:"Writing response",details:[]}}:null}function sl(c){if(c.method!=="turn/started")return null;const p=Le(c.params);if(!p)return null;const v=st(c);if(!v)return null;const S=Le(p.turn),D=ye(S==null?void 0:S.id)||ye(p.turnId)||`${v}:unknown`;if(!D)return null;const F=Go(ye(S==null?void 0:S.startedAt))??Go(ye(p.startedAt))??Go(c.atIso)??Date.now();return{threadId:v,turnId:D,startedAtMs:F}}function uo(c){if(c.method!=="turn/completed")return null;const p=Le(c.params);if(!p)return null;const v=st(c);if(!v)return null;const S=Le(p.turn),D=ye(S==null?void 0:S.id)||ye(p.turnId)||`${v}:unknown`;if(!D)return null;const F=Go(ye(S==null?void 0:S.completedAt))??Go(ye(p.completedAt))??Go(c.atIso)??Date.now(),U=Go(ye(S==null?void 0:S.startedAt))??Go(ye(p.startedAt))??void 0;return{threadId:v,turnId:D,completedAtMs:F,startedAtMs:U}}function hs(c){return`${c}:live-reasoning`}function Jc(c){const p=r.value[c]??[];let v=-1;for(const S of p)typeof S.turnIndex=="number"&&Number.isFinite(S.turnIndex)&&(v=Math.max(v,S.turnIndex));return v+1}function Hi(c,p,v){if(!c||!p||!Number.isInteger(v)||v<0)return;const S=J.value[c]??{};S[p]!==v&&(J.value={...J.value,[c]:{...S,[p]:v}})}function Xs(c,p){const v=J.value[c]??{},S=Object.entries(v),D=Object.entries(p);S.length===D.length&&S.every(([F,U])=>p[F]===U)||(J.value={...J.value,[c]:{...p}})}function Xc(c){const p=l.value[c];if(!p||p.length===0)return;const v=J.value[c]??{};let S=!1;const D=p.map(F=>{if(typeof F.turnIndex=="number"||!F.turnId)return F;const U=v[F.turnId];return typeof U!="number"?F:(S=!0,{...F,turnIndex:U})});S&&(l.value={...l.value,[c]:D})}function il(c){const p=Le(c.params);if(!p)return"";if(c.method==="item/started"){const v=Le(p.item);return!v||v.type!=="reasoning"?"":ye(v.id)}return""}function Qc(c){const p=Le(c.params);if(!p)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=ye(p.itemId),S=ye(p.delta);return!v||!S?null:{messageId:hs(v),delta:S}}return null}function Zc(c){const p=Le(c.params);if(!p)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=ye(p.itemId);return v?hs(v):""}return""}function eu(c){const p=Le(c.params);if(!p)return"";if(c.method==="item/completed"){const v=Le(p.item);return!v||v.type!=="reasoning"?"":hs(ye(v.id))}return""}function Wi(c){const p=Le(c.params);if(!p)return"";if(c.method==="item/started"){const v=Le(p.item);return!v||v.type!=="agentMessage"?"":ye(v.id)}return""}function Vi(c){const p=Le(c.params);if(!p)return null;if(c.method==="item/agentMessage/delta"){const v=ye(p.itemId),S=ye(p.delta);return!v||!S?null:{messageId:v,delta:S}}return null}function al(c){const p=Le(c.params);if(!p)return null;if(c.method==="item/completed"){const v=Le(p.item);if(!v||v.type!=="agentMessage")return null;const S=ye(v.id),D=ye(v.text);return!S||!D?null:{id:S,role:"assistant",text:D,messageType:"agentMessage.live"}}return null}function tu(c){var ke;if(c.method!=="item/started")return null;const p=Le(c.params),v=Le(p==null?void 0:p.item);if(!v||v.type!=="commandExecution")return null;const S=ye(v.id),D=ye(v.command);if(!S)return null;const F=typeof v.cwd=="string"?v.cwd:null,U=st(c),V=ye(p==null?void 0:p.turnId)||ye(p==null?void 0:p.turn_id),te=U&&V?(ke=J.value[U])==null?void 0:ke[V]:void 0;return{id:S,role:"system",text:D,messageType:"commandExecution",commandExecution:{command:D,cwd:F,status:"inProgress",aggregatedOutput:"",exitCode:null},turnId:V||void 0,turnIndex:typeof te=="number"?te:void 0}}function nu(c){if(c.method!=="item/commandExecution/outputDelta")return null;const p=Le(c.params);if(!p)return null;const v=ye(p.itemId),S=ye(p.delta);return!v||!S?null:{itemId:v,delta:S}}function ll(c){var Zt;if(c.method!=="item/completed")return null;const p=Le(c.params),v=Le(p==null?void 0:p.item);if(!v||v.type!=="commandExecution")return null;const S=ye(v.id),D=ye(v.command);if(!S)return null;const F=typeof v.cwd=="string"?v.cwd:null,U=ye(v.status),V=U==="failed"?"failed":U==="declined"?"declined":U==="interrupted"?"interrupted":"completed",te=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",ke=typeof v.exitCode=="number"?v.exitCode:null,qe=st(c),lt=ye(p==null?void 0:p.turnId)||ye(p==null?void 0:p.turn_id),vt=qe&&lt?(Zt=J.value[qe])==null?void 0:Zt[lt]:void 0;return{id:S,role:"system",text:D,messageType:"commandExecution",commandExecution:{command:D,cwd:F,status:V,aggregatedOutput:te,exitCode:ke},turnId:lt||void 0,turnIndex:typeof vt=="number"?vt:void 0}}function cl(c){var ke;if(c.method!=="item/completed")return null;const p=Le(c.params),v=Le(p==null?void 0:p.item);if(!v||v.type!=="fileChange")return null;const S=ye(v.id);if(!S)return null;const D=ye(p==null?void 0:p.threadId),F=ye(p==null?void 0:p.turnId),U=D&&F?(ke=J.value[D])==null?void 0:ke[F]:void 0,V=ib(v.changes),te=sb(v.status);return V.length===0||te!=="completed"?null:{id:S,role:"system",text:"",messageType:"fileChange",fileChangeStatus:te,fileChanges:V,turnId:F||void 0,turnIndex:typeof U=="number"?U:void 0}}function zi(c,p){const v=a.value[c]??[],S=jl(v,p);S!==v&&(a.value={...a.value,[c]:S})}function ru(c,p){const v=a.value[c];if(!v||v.length===0)return;const S=new Set(p.map(F=>F.id)),D=v.filter(F=>!S.has(F.id));D.length!==v.length&&(D.length===0?a.value=_t(a.value,c):a.value={...a.value,[c]:D})}function ou(c,p){const v=l.value[c];if(!v||v.length===0)return;const S=new Set(p.map(V=>V.id)),D=new Set(p.filter(V=>V.messageType==="fileChange"&&typeof V.turnId=="string"&&V.turnId.length>0).map(V=>V.turnId)),F=new Set(p.filter(V=>V.messageType==="fileChange"&&typeof V.turnIndex=="number").map(V=>V.turnIndex)),U=v.filter(V=>!S.has(V.id)&&!(V.turnId&&D.has(V.turnId))&&!(typeof V.turnIndex=="number"&&F.has(V.turnIndex)));U.length!==v.length&&(U.length===0?l.value=_t(l.value,c):l.value={...l.value,[c]:U})}function ul(c){if(c.method==="item/agentMessage/delta")return!0;const p=Le(c.params);if(!p)return!1;if(c.method==="item/completed"){const v=Le(p.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function Gi(c){var Ts,qo,Ji,bl,wl;if(Js(c))return;if(c.method==="account/rateLimits/updated"&&sn(),c.method==="thread/name/updated"){const Qe=Le(c.params),rr=ye(Qe==null?void 0:Qe.threadId),po=ye(Qe==null?void 0:Qe.threadName);rr&&po&&(Ge.value={...Ge.value,[rr]:po},Ut(),wd(rr,po))}if(c.method==="account/rateLimits/updated"){Xn(cb(c.params));return}const p=ot(c);if(p){vr(p.threadId,p.usage);return}const v=qi(c);v&&wt(v.threadId,v.activity);const S=st(c),D=ft(c);!D&&S&&br(S);const F=sl(c);F&&(Ae.set(F.turnId,F),Hi(F.threadId,F.turnId,Jc(F.threadId)),ve.value={...ve.value,[F.threadId]:F.turnId},qn(F.threadId),$r(F.threadId),qt(F.threadId,null),Tt(F.threadId,null),Ct(F.threadId,!0),g.value[F.threadId]&&(g.value=_t(g.value,F.threadId)));const U=uo(c),V=dt(c),te=(U==null?void 0:U.threadId)??st(c),ke=te?bt(te):"",qe=!!te&&!!V&&ke!==Or&&Dl(new Error(V));if(U){Pe.value[U.threadId];const Qe=Ae.get(U.turnId);Qe&&Ae.delete(U.turnId);const rr=vn((Ts=Le(c.params))==null?void 0:Ts.durationMs)??vn((Ji=Le((qo=Le(c.params))==null?void 0:qo.turn))==null?void 0:Ji.durationMs)??(typeof U.startedAtMs=="number"?U.completedAtMs-U.startedAtMs:null)??(Qe?U.completedAtMs-Qe.startedAtMs:null),po=typeof rr=="number"?Math.max(0,rr):0;qt(U.threadId,{turnId:U.turnId,durationMs:po}),ve.value[U.threadId]&&(ve.value=_t(ve.value,U.threadId)),Ct(U.threadId,!1),wt(U.threadId,null),Rn(U.threadId),qe||(pn(U.threadId),ys(U.threadId))}if(V){const Qe=(U==null?void 0:U.threadId)||st(c);Qe&&Tt(Qe,V),I.value=V,Qe&&qe&&jt(Qe)}else U&&Tt(U.threadId,null);if(D){const Qe=S,rr=Qe?bt(Qe):O.value.trim();Qe&&Tt(Qe,D.message,{transient:D.transient}),I.value=D.message,rr!==Or&&Dl(new Error(D.message))&&(Qe?jt(Qe):Vt())}const lt=tr(c);lt&&(Pr(lt.threadId,lt.message),wt(lt.threadId,{label:"Planning",details:((bl=lt.message.plan)==null?void 0:bl.steps.map(Qe=>Qe.step).slice(0,2))??[]}));const vt=Qt(c);if(vt&&(Pr(vt.threadId,vt.message),wt(vt.threadId,{label:"Planning",details:[]})),!S||S!==n.value)return;Wi(c);const Zt=Vi(c);if(Zt){const Qe=(s.value[S]??[]).find(po=>po.id===Zt.messageId),rr=`${(Qe==null?void 0:Qe.text)??""}${Zt.delta}`;Ft(S,{id:Zt.messageId,role:"assistant",text:rr,messageType:"agentMessage.live"})}const _s=al(c);_s&&Ft(S,_s),il(c);const bs=Qc(c);if(bs&&lo(S,bs.delta),Zc(c)){const Qe=i.value[S]??"";Qe.trim().length>0&&!Qe.endsWith(`
80
-
81
- `)&&nn(S,`${Qe}
82
-
83
- `)}eu(c);const ws=tu(c);ws&&(zi(S,ws),wt(S,{label:"Running command",details:[((wl=ws.commandExecution)==null?void 0:wl.command)??""]}));const fo=nu(c);if(fo){const Qe=(a.value[S]??[]).find(rr=>rr.id===fo.itemId);Qe!=null&&Qe.commandExecution&&zi(S,{...Qe,commandExecution:{...Qe.commandExecution,aggregatedOutput:`${Qe.commandExecution.aggregatedOutput}${fo.delta}`}})}const Ss=ll(c);Ss&&zi(S,Ss);const Uo=cl(c);if(Uo&&Mn(S,Uo),ul(c)&&(_e&&n.value&&jo(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Un(S)),c.method==="turn/completed"){_e=!1,Un(S),a.value[S]&&(a.value=_t(a.value,S));const Qe=st(c);Qe&&(Ct(Qe,!1),wt(Qe,null),Rn(Qe),qe||(pn(Qe),ys(Qe)))}}function Bo(c){if(c.method==="thread/tokenUsage/updated")return;const p=st(c);p&&Ne.add(p);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(ee=!0),!(Y!==null||typeof window>"u")&&(Y=window.setTimeout(()=>{Y=null,nr()},kd))}async function su(c){if(!Se){Se=!0;try{const p=await Ps(),v=[];for(const S of p.order){const D=Ko(S);v.includes(D)||v.push(D)}if(v.length>0){const S=Ll(v,c);Xo(Q.value,S)||(Q.value=S,ai(Q.value))}if(Object.keys(p.labels).length>0){const S={...me.value};let D=!1;for(const[F,U]of Object.entries(p.labels)){const V=Ko(F);S[V]!==U&&(S[V]=U,D=!0)}D&&(me.value=S,xd(S))}}catch{}}}async function iu(){if(!(Object.keys(Ge.value).length>0))try{const c=await UM();Object.keys(c.titles).length>0&&(Ge.value=c.titles)}catch{}}async function au(c,p,v){if(Ge.value[c])return;const S=p.trim();if(!S)return;const D=S.length>300?S.slice(0,300):S;try{const F=await WM(D,v);if(!F||Ge.value[c])return;Ge.value={...Ge.value,[c]:F},Ut(),wd(c,F)}catch{}}async function lu(c){try{const p=await Ps();if(p.order.length===0)return c;const v=new Set(p.order.map(S=>Ko(S)));return c.filter(S=>v.has(S.projectName))}catch{return c}}async function ms(){var p;Z.value||(G.value=!0);const c=performance.now();try{const[v]=await ef({name:"loadThreads",op:"ui.load.threads"},()=>Promise.all([eM(),iu()]));await su(v);const S=await lu(v),D=Ll(Q.value,S);Xo(Q.value,D)||(Q.value=D,ai(Q.value));const F=Rd(S,Q.value);zt(new Set(Lr(F).map(qe=>qe.id)));const U=XD(t.value,F,u.value);t.value=Fl(t.value,U),u.value=Gt(u.value,new Set(Lr(t.value).map(qe=>qe.id))),Ut(),Z.value=!0;const V=Lr(e.value);Zn(V),V.some(qe=>qe.id===n.value)||tt(((p=V[0])==null?void 0:p.id)??"");const ke=Math.round(performance.now()-c);mr({category:"threads",message:`loaded ${V.length} threads in ${ke}ms`,data:{projectCount:S.length},level:"info"})}finally{G.value=!1}}async function wr(c,p={}){var F;if(!c)return;const v=xe.value[c]===!0,S=p.silent!==!0&&!v;S&&(be.value=!0);const D=performance.now();try{const V=Oe.value[c]!==!0?gd(c):null,te=cg(c),[ke,qe]=await ef({name:"thread.loadMessages",op:"ui.load",attributes:{threadId:c,silent:p.silent??!1}},()=>Promise.all([V,te]));ke&&(Xt(c,ke.model),Oe.value={...Oe.value,[c]:!0});const{messages:lt,inProgress:vt,activeTurnId:Zt,turnIndexByTurnId:_s}=qe;Bn(c,lt),Xs(c,_s),Xc(c);const bs=r.value[c]??[],ei=jD(bs,lt,{preserveMissing:p.silent===!0});mn(c,ei);const ws=s.value[c]??[];if(vt){const qo=BD(ws,lt);er(c,qo)}else Kr(c);ru(c,lt),ou(c,lt),xe.value={...xe.value,[c]:!0};const fo=fr(c);fo&&(Me.value={...Me.value,[c]:fo}),Ct(c,vt),Zt?ve.value={...ve.value,[c]:Zt}:ve.value[c]&&(ve.value=_t(ve.value,c)),vt||gn(c),hn(c);const Ss=Math.round(performance.now()-D),Uo=$.value.find(qo=>qo.id===c),Ts=((F=Uo==null?void 0:Uo.cwd)==null?void 0:F.split("/").pop())??"unknown";ek("thread",{id:c,messageCount:lt.length,loadMs:Ss,projectFolder:Ts}),mr({category:"thread",message:`loaded ${lt.length} msgs in ${Ss}ms`,data:{threadId:c,projectFolder:Ts},level:"info"})}finally{S&&(be.value=!1)}}async function dl(c,p={}){c&&xe.value[c]!==!0&&await wr(c,p)}async function Ki(){var c,p;try{const v=((p=(c=j.value)==null?void 0:c.cwd)==null?void 0:p.trim())??"";at.value=await VM(v?[v]:void 0)}catch{}}async function cu(){try{Xn(await dg())}catch{}}async function uu(c={}){I.value="";const p=c.includeSelectedThreadMessages!==!1,v=c.awaitAncillaryRefreshes===!0;try{await ms();const S=Promise.allSettled([zr(),bn(),io(),Ki(),cu()]).then(()=>{});p&&await wr(n.value),v&&await S}catch(S){I.value=S instanceof Error?S.message:"Unknown application error"}}async function du(c){tt(c);try{await Promise.all([wr(c),Ki()])}catch(p){I.value=p instanceof Error?p.message:"Unknown application error"}}async function fu(c){try{await pM(c),await ms(),n.value===c&&await wr(n.value)}catch(p){I.value=p instanceof Error?p.message:"Unknown application error"}}async function fl(c,p){const v=p.trim();if(!(!c||!v))try{await hM(c,v),Ge.value={...Ge.value,[c]:v},Ut(),wd(c,v)}catch(S){I.value=S instanceof Error?S.message:"Unknown application error"}}async function pu(c){var U,V;const p=c.trim();if(!p)return"";const v=Lr(t.value).find(te=>te.id===p),S=((U=v==null?void 0:v.cwd)==null?void 0:U.trim())??"",D=((V=v==null?void 0:v.title)==null?void 0:V.trim())??"Forked chat",F=bt(p);I.value="";try{const te=await pg(p,S||void 0,F||void 0),ke=te.threadId.trim();return ke?(_r(ke,S,D),Xt(ke,te.model),Oe.value={...Oe.value,[ke]:!0},tt(ke),await ms(),await wr(ke),ke):""}catch(te){return I.value=te instanceof Error?te.message:"Unknown application error",""}}async function hu(c,p){var U;const v=c.trim();if(!v||!Number.isInteger(p)||p<0)return"";if(u.value[v]===!0)return I.value="Finish the current turn before forking from a response.","";if(xe.value[v]!==!0)try{await wr(v)}catch(V){return I.value=V instanceof Error?V.message:"Unknown application error",""}const S=r.value[v]??[];let D=-1;for(const V of S)typeof V.turnIndex=="number"&&Number.isFinite(V.turnIndex)&&(D=Math.max(D,V.turnIndex));if(D>=0&&p>D)return"";const F=Lr(t.value).find(V=>V.id===v)??null;try{I.value="";const V=await pg(v),te=V.threadId.trim();if(!te)return"";const ke=V.cwd.trim()||((U=F==null?void 0:F.cwd)==null?void 0:U.trim())||"",qe=ZD((F==null?void 0:F.title)||(F==null?void 0:F.preview)||"Untitled thread");_r(te,ke,qe),Xt(te,V.model),mn(te,V.messages),xe.value={...xe.value,[te]:!0},Oe.value={...Oe.value,[te]:!0},qn(te),er(te,[]),Un(te),a.value[te]&&(a.value=_t(a.value,te)),qt(te,null),wt(te,null),Tt(te,null),Ct(te,!1);const lt=D-p;if(lt>0){const vt=await vd(te,lt);mn(te,vt)}return await fl(te,qe),tt(te),ms().catch(()=>{}),te}catch(V){return I.value=V instanceof Error?V.message:"Unknown application error",""}}async function pl(c,p,v=[],S=[],D=[]){if(!c||!p.trim()||v.length>0||S.length>0||D.length>0)return!1;const U=(De.value[c]??[]).filter(ke=>ke.method==="item/tool/requestUserInput");if(U.length!==1)return!1;const[V]=U,te=Fo(V);return te.length!==1?!1:yl({id:V.id,result:{answers:{[te[0]]:{answers:[p.trim()]}}}})}async function hl(c,p=[],v=[],S="steer",D=[],F){if(Xe.value)return;const U=n.value,V=c.trim();if(!U||!V&&p.length===0&&D.length===0||await pl(U,V,p,v,D))return;mr({category:"ui.action",message:"send message",data:{threadId:U,hasImages:p.length>0,skillCount:v.length},level:"info"});const te=u.value[U]===!0;if(te&&S==="queue"){const ke=d.value[U]??[],qe=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,lt=[...ke],vt=typeof F=="number"?Math.max(0,Math.min(F,lt.length)):lt.length;lt.splice(vt,0,{id:qe,text:V,imageUrls:p,skills:v,fileAttachments:D,collaborationMode:R.value}),d.value={...d.value,[U]:lt};return}if(te){_e=!0,vs(U,V,p,v,D).catch(ke=>{const qe=ke instanceof Error?ke.message:"Unknown application error";Tt(U,qe),I.value=qe});return}I.value="",_e=!0,qt(U,null),wt(U,{label:"Thinking",details:yr(bt(U),W.value,R.value)}),Tt(U,null),Ct(U,!0);try{await vs(U,V,p,v,D)}catch(ke){_e=!1,Ct(U,!1),wt(U,null);const qe=ke instanceof Error?ke.message:"Unknown application error";throw Tt(U,qe),I.value=qe,ke}}async function gs(c,p,v=[],S=[],D=[]){if(Xe.value)return"";const F=c.trim(),U=p.trim(),V=O.value.trim();if(!F&&v.length===0&&D.length===0)return"";fe.value=!0,I.value="";let te="";try{try{const vt=await fg(U||void 0,V||void 0);te=vt.threadId,Xt(te,vt.model)}catch(vt){if(V&&V!==Or&&Dl(vt)){await Vt();const Zt=await fg(U||void 0,Or);te=Zt.threadId,Xt(te,Zt.model)}else throw vt}if(!te)return"";_r(te,U,F||"[Image]"),An(te),Oe.value={...Oe.value,[te]:!0},tt(te),_e=!0,qt(te,null),wt(te,{label:"Thinking",details:yr(O.value,W.value,R.value)}),Tt(te,null),Ct(te,!0);const ke=te,qe=U||null,lt=F;return vs(te,F,v,S,D).catch(vt=>{_e=!1,Ct(te,!1),wt(te,null);const Zt=vt instanceof Error?vt.message:"Unknown application error";Tt(te,Zt),I.value=Zt}).finally(()=>{fe.value=!1}),au(ke,lt,qe),te}catch(ke){_e=!1,te&&(Ct(te,!1),wt(te,null));const qe=ke instanceof Error?ke.message:"Unknown application error";throw te&&Tt(te,qe),I.value=qe,fe.value=!1,ke}}async function vs(c,p,v=[],S=[],D=[]){const F=W.value,U=R.value,V=p.trim(),te=S.map(qe=>({name:qe.name,path:qe.path})),ke=D.map(qe=>({...qe}));It(c,{text:V,imageUrls:[...v],skills:te,fileAttachments:ke,effort:F,collaborationMode:U,fallbackRetried:!1});try{if(Oe.value[c]!==!0){const vt=await gd(c);Xt(c,vt.model)}const qe=bt(c);let lt="";try{lt=await yd(c,p,v,qe||void 0,F||void 0,S.length>0?S:void 0,D,U)}catch(vt){if(qe&&qe!==Or&&Dl(vt))await Vt(c),It(c,{text:V,imageUrls:[...v],skills:te,fileAttachments:ke,effort:F,collaborationMode:U,fallbackRetried:!0}),lt=await yd(c,p,v,Or,F||void 0,S.length>0?S:void 0,D,U);else throw vt}lt&&(ve.value={...ve.value,[c]:lt}),Oe.value={...Oe.value,[c]:!0},Ne.add(c),ee=!0,await nr(),wn(c)}catch(qe){throw qe}}async function ys(c){if(f.value[c]===!0)return;const p=d.value[c];if(!p||p.length===0)return;f.value={...f.value,[c]:!0};const[v,...S]=p;d.value=S.length>0?{...d.value,[c]:S}:_t(d.value,c),fe.value=!0,I.value="",_e=!0,qt(c,null),wt(c,{label:"Thinking",details:yr(bt(c),W.value,v.collaborationMode)}),Tt(c,null),Ct(c,!0);try{cr(v.collaborationMode),await vs(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{Ct(c,!1),wt(c,null)}finally{f.value=_t(f.value,c),fe.value=!1}}async function ml(){const c=n.value;if(!c||u.value[c]!==!0||we.value[c]===!0)return;let p=ve.value[c];if(!p){const{activeTurnId:v}=await cg(c);p=v,p&&(ve.value={...ve.value,[c]:p})}if(!p)throw new Error("Could not determine active turn id for interrupt");je.value=!0,I.value="";try{await bM(c,p),Ct(c,!1),wt(c,null),Tt(c,null),ve.value[c]&&(ve.value=_t(ve.value,c)),Ne.add(c),ee=!0,await nr()}catch(v){const S=v instanceof Error?v.message:"Failed to interrupt active turn";Tt(c,S),I.value=S}finally{je.value=!1}}async function mu(c){var V,te;const p=n.value;if(!p||E.value||!c.trim())return;const v=r.value[p]??[],S=v.find(ke=>ke.turnId===c),D=typeof(S==null?void 0:S.turnIndex)=="number"?S.turnIndex:-1;if(D<0)return;const F=v.reduce((ke,qe)=>typeof qe.turnIndex=="number"&&qe.turnIndex>ke?qe.turnIndex:ke,-1);if(F<0||D>F)return;const U=F-D+1;if(!(U<1)){E.value=!0,I.value="";try{const ke=((te=(V=j.value)==null?void 0:V.cwd)==null?void 0:te.trim())??"";ke&&await mM(p,c,ke);const qe=await vd(p,U);mn(p,qe),er(p,[]),Un(p),a.value[p]&&(a.value=_t(a.value,p)),qt(p,null),wt(p,null),Tt(p,null),ee=!0,await nr()}catch(ke){I.value=ke instanceof Error?ke.message:"Failed to rollback thread"}finally{E.value=!1}}}let Qs=null;async function gu(c,p){try{const v=await Ps(),S={...v.labels};let D=!1;for(const F of v.order){if(Ko(F)!==c)continue;const U=p.trim();U.length===0?S[F]!==void 0&&(delete S[F],D=!0):S[F]!==U&&(S[F]=U,D=!0)}D&&await _d({order:v.order,labels:S,active:v.active})}catch{}}function vu(c,p){c.length===0||(me.value[c]??"")===p||(me.value={...me.value,[c]:p},xd(me.value),Qs!==null&&clearTimeout(Qs),Qs=setTimeout(()=>{Qs=null,gu(c,p)},500))}async function yu(c){var F;if(c.length===0)return;const p=Q.value.filter(U=>U!==c);if(Xo(Q.value,p)||(Q.value=p,ai(Q.value)),t.value=t.value.filter(U=>U.projectName!==c),me.value[c]!==void 0){const U={...me.value};delete U[c],me.value=U,xd(U)}Ut();const v=Lr(e.value);Zn(v),v.some(U=>U.id===n.value)||tt(((F=v[0])==null?void 0:F.id)??"");const D=new Set;try{const U=await Ps();for(const V of U.order)Ko(V)===c&&D.add(V);for(const V of U.active)Ko(V)===c&&D.add(V);for(const V of Object.keys(U.labels))Ko(V)===c&&D.add(V)}catch{}if(D.size>0)try{const U=await Ps(),V=U.order.filter(qe=>!D.has(qe)),te=U.active.filter(qe=>!D.has(qe)),ke=te.length===0&&V.length>0?[V[0]]:te;await _d({order:V,labels:GD(U.labels,D),active:ke});return}catch{}await Yi()}function _u(c,p){if(c.length===0||t.value.length===0)return;const v=t.value.map(te=>te.projectName),S=v.indexOf(c);if(S===-1)return;const D=Math.max(0,Math.min(p,v.length-1)),F=ND(v,S,D);if(F===v)return;const U=Ll(F,t.value);Q.value=U,ai(Q.value);const V=Rd(t.value,Q.value);t.value=Fl(t.value,V),Ut(),Yi()}function gl(c){const p=c.trim();if(!p)return;const v=[p,...Q.value.filter(D=>D!==p)];if(Xo(Q.value,v))return;Q.value=v,ai(Q.value);const S=Rd(t.value,Q.value);t.value=Fl(t.value,S),Ut(),Yi()}async function Yi(){var c,p;try{const v=await Ps(),S=new Map;for(const U of v.order){const V=Ko(U);S.has(V)||S.set(V,U)}for(const U of t.value){const V=((p=(c=U.threads[0])==null?void 0:c.cwd)==null?void 0:p.trim())??"";V&&S.set(U.projectName,V)}const D=[];for(const U of Q.value){const V=S.get(U);V&&!D.includes(V)&&D.push(V)}for(const U of v.order)D.includes(U)||D.push(U);const F=v.active.filter(U=>D.includes(U));F.length===0&&D.length>0&&F.push(D[0]),await _d({order:D,labels:v.labels,active:F})}catch{}}async function nr(){if(q.value){typeof window<"u"&&Y===null&&(Y=window.setTimeout(()=>{Y=null,nr()},kd));return}q.value=!0;const c=ee,p=new Set(Ne);ee=!1,Ne.clear();try{c&&await ms();const v=n.value;if(!v)return;const S=p.has(v),D=u.value[v]===!0,F=fr(v),U=Me.value[v]??"",V=F.length>0&&F!==U;(S||D||V||c)&&await wr(v,{silent:!0})}catch{}finally{q.value=!1,(ee||Ne.size>0)&&typeof window<"u"&&Y===null&&(Y=window.setTimeout(()=>{Y=null,nr()},kd))}}async function bu(){await vl(),ee=!0,n.value&&Ne.add(n.value),await nr()}function wu(){typeof window>"u"||X||(vl(),X=iM(c=>{if(c.method==="ready"){dr(),bu();return}Gi(c),Bo(c)}))}async function vl(){try{const p=(await lM()).map(v=>Bt(v)).filter(v=>v!==null);Yc(p)}catch{}}async function yl(c){try{return await aM(c.id,{result:c.result,error:c.error}),rl(c.id),!0}catch(p){return I.value=p instanceof Error?p.message:"Failed to reply to server request",!1}}function Su(){if(X&&(X(),X=null),ee=!1,Ne.clear(),Ae.clear(),Y!==null&&typeof window<"u"&&(window.clearTimeout(Y),Y=null),se!==null&&typeof window<"u"&&(window.clearTimeout(se),se=null),typeof window<"u")for(const c of pe.values())window.clearTimeout(c);pe.clear(),_e=!1,r.value={},o.value={},s.value={},i.value={},a.value={},l.value={},J.value={},Re.value={},de.value={},Fe.value={},ve.value={},we.value={},ie.value={},Ie.value={},d.value={},f.value={},Ve.value=null,ze.value={}}const _l=oe(()=>{const c=n.value;return c?d.value[c]??[]:[]});function Zs(c){const p=n.value;if(!p)return;const v=d.value[p];if(!v)return;const S=v.filter(D=>D.id!==c);d.value=S.length>0?{...d.value,[p]:S}:_t(d.value,p)}function Tu(c){const p=n.value;if(!p)return;const v=d.value[p];if(!v)return;const S=v.find(D=>D.id===c);S&&(Zs(c),cr(S.collaborationMode),hl(S.text,S.imageUrls,S.skills,"steer",S.fileAttachments))}function Eu(c){tt(c)}return{projectGroups:e,projectDisplayNameById:me,selectedThread:j,selectedThreadTokenUsage:rt,selectedThreadScrollState:K,isSelectedThreadInterruptPending:ae,selectedThreadServerRequests:$e,selectedLiveOverlay:Ue,codexQuota:nt,selectedThreadId:n,availableCollaborationModes:k,availableModelIds:y,selectedCollaborationMode:R,selectedModelId:O,selectedReasoningEffort:W,selectedSpeedMode:z,installedSkills:at,accountRateLimitSnapshots:Ye,messages:$t,isLoadingThreads:G,isLoadingMessages:be,isSendingMessage:fe,isInterruptingTurn:je,isUpdatingSpeedMode:Xe,isRollingBack:E,error:I,refreshAll:uu,refreshSkills:Ki,selectThread:du,loadMessages:wr,ensureThreadMessagesLoaded:dl,setThreadScrollState:jo,archiveThreadById:fu,renameThreadById:fl,forkThreadById:pu,forkThreadFromTurn:hu,rollbackSelectedThread:mu,sendMessageToSelectedThread:hl,sendMessageToNewThread:gs,interruptSelectedThreadTurn:ml,selectedThreadQueuedMessages:_l,removeQueuedMessage:Zs,steerQueuedMessage:Tu,setSelectedCollaborationMode:cr,setSelectedModelId:fn,setSelectedReasoningEffort:so,updateSelectedSpeedMode:fs,respondToPendingServerRequest:yl,renameProject:vu,removeProject:yu,reorderProject:_u,pinProjectToTop:gl,startPolling:wu,stopPolling:Su,primeSelectedThread:Eu}}const tj={class:"sidebar-root"},nj={class:"sidebar-scrollable"},rj=["aria-pressed"],oj={key:1,class:"sidebar-search-bar"},sj={class:"sidebar-settings-account-section"},ij={class:"sidebar-settings-account-header"},aj={class:"sidebar-settings-account-header-main"},lj=["aria-expanded","title"],cj={class:"sidebar-settings-account-collapse-icon"},uj={class:"sidebar-settings-account-count"},dj=["disabled"],fj={key:0,class:"sidebar-settings-account-error"},pj={key:1,class:"sidebar-settings-account-empty"},hj={key:2,class:"sidebar-settings-account-list"},mj=["title","onMouseenter","onMouseleave"],gj={class:"sidebar-settings-account-main"},vj={class:"sidebar-settings-account-email"},yj={class:"sidebar-settings-account-meta"},_j={class:"sidebar-settings-account-quota"},bj={class:"sidebar-settings-account-id"},wj={class:"sidebar-settings-account-actions"},Sj=["disabled","onClick"],Tj=["disabled","onClick"],Ej=["title"],kj=["title"],Ij={class:"sidebar-settings-value"},Cj=["title"],Aj={class:"sidebar-settings-value"},xj=["title"],Rj={class:"sidebar-settings-value"},Mj=["title"],Pj=["title"],$j=["title"],Nj={class:"sidebar-settings-row sidebar-settings-row--select",title:"Choose the API provider for the Codex backend"},Oj=["value","disabled"],Lj={key:0,class:"sidebar-settings-row sidebar-settings-row--input"},Dj={class:"sidebar-settings-key-group"},jj={class:"sidebar-settings-key-masked"},Fj=["disabled"],Bj=["disabled"],Uj={key:1,class:"sidebar-settings-row sidebar-settings-row--input"},qj={class:"sidebar-settings-key-group"},Hj={class:"sidebar-settings-key-group"},Wj=["disabled"],Vj=["title"],zj={class:"sidebar-settings-value"},Gj={key:2,class:"sidebar-settings-telegram-panel"},Kj={class:"sidebar-settings-field"},Yj={class:"sidebar-settings-field"},Jj={key:0,class:"sidebar-settings-telegram-error"},Xj={class:"sidebar-settings-telegram-actions"},Qj=["disabled"],Zj=["data-state","title"],eF=["data-state"],tF={class:"sidebar-settings-context-meta"},nF={class:"sidebar-settings-rate-limits"},rF={class:"sidebar-settings-build-label","aria-label":"Worktree name and version"},oF={class:"sidebar-settings-button-version"},sF={class:"content-body"},iF={key:1,class:"content-grid content-grid-home"},aF={class:"new-thread-empty"},lF=["title"],cF=["onKeydown"],uF={class:"new-thread-open-folder-current"},dF=["title"],fF=["disabled"],pF={class:"new-thread-open-folder-actions"},hF={class:"new-thread-open-folder-toggle"},mF=["aria-pressed","disabled"],gF={key:0,class:"new-thread-open-folder-create"},vF={class:"new-thread-open-folder-create-composer"},yF=["onKeydown"],_F=["disabled"],bF={key:0,class:"new-thread-open-folder-error"},wF=["onKeydown"],SF={key:1,class:"new-thread-open-folder-error-actions"},TF={class:"new-thread-open-folder-error"},EF=["disabled"],kF={key:2,class:"new-thread-open-folder-status"},IF={key:3,class:"new-thread-open-folder-status"},CF={key:4,class:"new-thread-open-folder-list"},AF=["title","disabled","onClick"],xF={class:"new-thread-open-folder-item-name"},RF=["disabled","onClick"],MF={key:1,class:"new-thread-branch-select"},PF={class:"new-thread-branch-select-help"},$F={class:"worktree-init-status-title"},NF={class:"worktree-init-status-message"},OF={key:3,class:"new-thread-trending"},LF={class:"new-thread-trending-header"},DF={key:0,class:"new-thread-trending-empty"},jF={key:1,class:"new-thread-trending-empty"},FF={key:2,class:"new-thread-trending-list"},BF=["onClick"],UF=["title"],qF={class:"new-thread-trending-tip-name-owner"},HF={class:"new-thread-trending-tip-name-repo"},WF={key:1,class:"new-thread-trending-tip-name-repo"},VF={class:"new-thread-trending-tip-meta"},zF={class:"new-thread-trending-tip-description"},GF={class:"composer-with-queue"},KF={key:2,class:"content-grid"},YF={class:"content-thread"},JF={class:"composer-with-queue"},Ng="codex-web-local.sidebar-collapsed.v1",Og="codex-web-local.accounts-section-collapsed.v1",Lg="codex-web-local.send-with-enter.v1",Dg="codex-web-local.in-progress-send-mode.v1",jg="codex-web-local.dark-mode.v1",Fg="codex-web-local.dictation-click-to-toggle.v1",Bg="codex-web-local.dictation-auto-send.v1",Ug="codex-web-local.dictation-language.v1",qg="codex-web-local.github-trending-projects.v1",Hg="codex-web-local.chat-width.v1",XF=400,QF=In({__name:"App",setup(e){const t=ju(()=>ld(()=>import("./ThreadConversation-B-Ik7tFp.js"),__vite__mapDeps([0,1]))),n=ju(()=>ld(()=>import("./ReviewPane-Blnhnm6J.js"),__vite__mapDeps([2,3]))),r=ju(()=>ld(()=>import("./SkillsHub-C93DMbLM.js"),__vite__mapDeps([4,5]))),o="a77f",s="0.1.88",i={sendWithEnter:"When enabled, press Enter to send. When disabled, use Command+Enter to send.",inProgressSendMode:"If a turn is still running, choose whether a new prompt should steer the current turn or be queued.",appearance:"Switch between system theme, light mode, and dark mode.",chatWidth:"Choose how wide the conversation column and composer can grow on desktop screens.",dictationClickToToggle:"Use click-to-start and click-to-stop dictation instead of hold-to-talk.",dictationAutoSend:"Automatically send transcribed dictation when recording stops.",githubTrendingProjects:"Show or hide GitHub trending project cards on the new thread screen.",dictationLanguage:"Choose transcription language or keep auto-detect."},a={standard:{label:"Standard",columnMax:"45rem",cardMax:"76ch"},wide:{label:"Wide",columnMax:"72rem",cardMax:"88ch"},"extra-wide":{label:"Extra wide",columnMax:"96rem",cardMax:"96ch"}},l={en:"english",zh:"chinese",de:"german",es:"spanish",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan",nl:"dutch",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi",si:"sinhala",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole",ps:"pashto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish",my:"myanmar",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese",yue:"cantonese"},{projectGroups:u,projectDisplayNameById:d,selectedThread:f,selectedThreadTokenUsage:g,selectedThreadScrollState:y,selectedThreadServerRequests:k,selectedLiveOverlay:A,codexQuota:H,selectedThreadId:R,availableCollaborationModes:O,availableModelIds:W,selectedCollaborationMode:z,selectedModelId:ce,selectedReasoningEffort:ne,selectedSpeedMode:Q,installedSkills:me,accountRateLimitSnapshots:Me,messages:xe,isLoadingThreads:Oe,isLoadingMessages:J,isSendingMessage:de,isInterruptingTurn:Re,isSelectedThreadInterruptPending:Fe,isUpdatingSpeedMode:ve,refreshAll:we,refreshSkills:ie,selectThread:Ie,ensureThreadMessagesLoaded:De,setThreadScrollState:Pe,archiveThreadById:Ve,forkThreadById:ze,renameThreadById:Ge,forkThreadFromTurn:at,sendMessageToSelectedThread:Ye,sendMessageToNewThread:G,interruptSelectedThreadTurn:be,selectedThreadQueuedMessages:fe,removeQueuedMessage:je,steerQueuedMessage:Xe,setSelectedCollaborationMode:E,setSelectedModelId:I,setSelectedReasoningEffort:q,updateSelectedSpeedMode:Z,respondToPendingServerRequest:X,renameProject:Y,removeProject:se,reorderProject:pe,pinProjectToTop:ue,startPolling:ee,stopPolling:Ne,primeSelectedThread:Se,rollbackSelectedThread:_e}=ej(),Ae=dR(),P=uR(),{isMobile:$}=bp(),j=N(null),K=N(null),ae=N(null),$e=N([]),Ue=N(!1),nt=N("trending-daily"),rt=N(null),$t=N(!1);let bt=!1;const on=N(!1),tt=N(""),fn=N("local"),Xt=N(""),vr=N([]),cr=N(!1),Xn=N({order:[],labels:{}}),Vt=N({phase:"idle",title:"",message:""}),It=N(Qb()),pn=N(""),jt=N(!1),so=N(null),fs=N(null),io=N(null),yr=N(null),zr=N(null);let bn=null;const sn=N("New Project (1)"),Gr=N(""),wn=N(!1),Sn=N(ew()),Qn=N(!1),ur=N([]),Fn=N(null),Ut=N(!1),_r=N(!1),Zn=N(null),hn=N([]),qt=N(!1),Ct=N(!1),Tn=N(""),An=N(""),xn=N(""),zt=N(""),Bn=N(Sl(Lg,!0)),Rn=N(jb()),wt=N(Db()),Tt=N(Fb()),br=N(Sl(Fg,!1)),dr=N(Sl(Bg,!0)),fr=N(Jb()),jo=oe(()=>Xb()),mn=N(Sl(qg,!1)),er=N(!1),Kr=N(!1),an=N(""),ao=N(!1),Pr=N(null),Ft=N(!1),Mn=N("codex"),nn=N(""),lo=N(""),Un=N(!1),qn=N(""),$r=N(""),gn=N(""),Nr=N(!1),Hn=N(!1),tr=N(""),Qt=N(""),Le=N(!1),ye=N(!1),vn=N(null),T=N(""),M=N(""),m=N([]),w=N(""),B=N(!1),ge=N(!1),ot=N(!1),st=N(""),dt=N({configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:""}),ft=N(null),Bt=N(!1),Wn=N(!1);let yn=null,Ui=!1,ps=0;const co=oe(()=>{const h=Ae.params.threadId;return typeof h=="string"?h:""}),nl=oe(()=>{const h=new Set;for(const _ of u.value)for(const C of _.threads)h.add(C.id);return h}),Pn=oe(()=>Ae.name==="home"),Fo=oe(()=>Ae.name==="skills"),Kc=oe(()=>{var h;return Fo.value?"Skills":Pn.value?"New thread":((h=f.value)==null?void 0:h.title)??"Choose a thread"}),rl=typeof window<"u"&&(window.location.hostname||window.location.host)||"codexui",Yc=oe(()=>{var _,C;return(((C=(_=f.value)==null?void 0:_.title)==null?void 0:C.trim())??"")||rl}),Js=oe(()=>xe.value.filter(h=>{const _=nw(h.messageType,h.role);return _==="worked"?!0:!(_==="turnActivity.live"||_==="turnError.live"||_==="agentReasoning.live")})),ol=oe(()=>A.value),qi=oe(()=>Pn.value?"__new-thread__":R.value),sl=oe(()=>{const h=k.value;return h.length>0?h[h.length-1]:null}),uo=oe(()=>{var h,_;return Pn.value?tt.value.trim():((_=(h=f.value)==null?void 0:h.cwd)==null?void 0:_.trim())??""}),hs=oe(()=>{var h;return!Pn.value&&((h=f.value)==null?void 0:h.inProgress)===!0}),Jc=oe(()=>!Pn.value&&!Fo.value&&R.value.trim().length>0),Hi=oe(()=>de.value||Re.value||hs.value||k.value.length>0);function Xs(h){return Number.isFinite(h)?new Intl.NumberFormat("en-US",{notation:h>=1e3?"compact":"standard",maximumFractionDigits:h>=1e5?0:1}).format(Math.max(0,Math.trunc(h))):"0"}function Xc(h){if(!h)return"Waiting for Codex thread/tokenUsage/updated events for this thread.";const _=[`Current context usage: ${h.currentContextTokens.toLocaleString()} tokens`,`Cumulative thread usage: ${h.total.totalTokens.toLocaleString()} tokens`];return typeof h.modelContextWindow=="number"?(_.unshift(`Model context window: ${h.modelContextWindow.toLocaleString()} tokens`),_.push(`Remaining context: ${(h.remainingContextTokens??0).toLocaleString()} tokens`)):_.push("Model context window is unavailable in the latest usage event."),_.join(`
84
- `)}const il=oe(()=>{var _;const h=(_=g.value)==null?void 0:_.remainingContextPercent;return h===null||typeof h!="number"?"pending":h<=10?"danger":h<=25?"warning":"ok"}),Qc=oe(()=>{const h=g.value;return h?typeof h.remainingContextTokens=="number"?`${Xs(h.remainingContextTokens)} left`:`${Xs(h.currentContextTokens)} used`:"Awaiting data"}),Zc=oe(()=>{const h=g.value;return h?typeof h.modelContextWindow=="number"?`${Xs(h.currentContextTokens)} used / ${Xs(h.modelContextWindow)}`:"Window size unavailable":"Updates after the next token usage event"}),eu=oe(()=>Xc(g.value)),Wi=oe(()=>{var re,Te;const h=[],_=new Set;for(const Ce of Xn.value.order){const it=Ce.trim();!it||_.has(it)||(_.add(it),h.push({value:it,label:Xn.value.labels[it]||Ms(it)}))}for(const Ce of u.value){const it=((Te=(re=Ce.threads[0])==null?void 0:re.cwd)==null?void 0:Te.trim())??"";!it||_.has(it)||(_.add(it),h.push({value:it,label:d.value[Ce.projectName]??Ce.projectName}))}const C=tt.value.trim();return C&&!_.has(C)&&h.unshift({value:C,label:Ms(C)}),h}),Vi=oe(()=>{const h=Xt.value.trim(),_=[...vr.value];return h&&!_.some(C=>C.value===h)&&_.unshift({value:h,label:h}),_}),al=oe(()=>{const h=Xt.value.trim();if(!h)return"";const _=Vi.value.find(C=>C.value===h);return(_==null?void 0:_.label)??h}),tu=oe(()=>Fn.value??"__detached_head__"),nu=oe(()=>{var re;const h=[{value:"__review__",label:Qn.value?"Review (Open)":"Review"}],_=new Set,C=((re=Fn.value)==null?void 0:re.trim())??"";C?(h.push({value:C,label:C}),_.add(C)):(h.push({value:"__detached_head__",label:"Detached HEAD"}),_.add("__detached_head__"));for(const Te of ur.value)!Te.value||_.has(Te.value)||(_.add(Te.value),h.push(Te));return h}),ll=oe(()=>T.value.trim()),cl=oe(()=>{const h=tr.value.trim();return!h||h==="."||h===".."?!1:!/[\\/]/u.test(h)}),zi=oe(()=>cl.value&&ll.value.trim().length>0&&!w.value),ru=oe(()=>Le.value?"Creating…":"Create"),ou=oe(()=>{const h=T.value.trim(),_=M.value.trim();return!!(h&&_&&h!==_)}),ul=oe(()=>{const h=[];ou.value&&h.push({key:`parent:${M.value}`,name:"..",path:M.value,kind:"parent"});for(const _ of m.value)h.push({key:`directory:${_.path}`,name:_.name,path:_.path,kind:"directory"});return h}),Gi=oe(()=>{const h=st.value.trim().toLowerCase();return h?ul.value.filter(_=>_.kind==="parent"||_.name.toLowerCase().includes(h)):ul.value}),Bo=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,su=oe(()=>[{value:"search-daily",label:"Search daily"},{value:"search-weekly",label:"Search weekly"},{value:"search-monthly",label:"Search monthly"},{value:"trending-daily",label:"Trending daily"},{value:"trending-weekly",label:"Trending weekly"},{value:"trending-monthly",label:"Trending monthly"}]),iu=oe(()=>a[Tt.value].label),au=oe(()=>{const h=a[Tt.value];return{"--chat-column-max":h.columnMax,"--chat-card-max":h.cardMax}}),lu=oe(()=>{if(!dt.value.configured)return"Not configured";const h=dt.value.active?"Online":"Configured (offline)",_=dt.value.allowAllUsers?"allow all users":`${dt.value.allowedUsers} allowed user(s)`,C=`${dt.value.mappedChats} chat(s), ${dt.value.mappedThreads} thread(s), ${_}`,re=dt.value.lastError?`, error: ${dt.value.lastError}`:"";return`${h}, ${C}${re}`});ls(()=>{document.addEventListener("pointerdown",lt),window.addEventListener("keydown",qe),document.addEventListener("visibilitychange",Zt),window.addEventListener("pageshow",_s),window.addEventListener("focus",bs),Tl(),Bo==null||Bo.addEventListener("change",Tl),rw(),Rb(),ti(),Ho(),dl(),wr(),xu(),mn.value&&Iu()}),Mc(()=>{document.removeEventListener("pointerdown",lt),window.removeEventListener("keydown",qe),document.removeEventListener("visibilitychange",Zt),window.removeEventListener("pageshow",_s),window.removeEventListener("focus",bs),Bo==null||Bo.removeEventListener("change",Tl),yn!==null&&(window.clearInterval(yn),yn=null),bn&&(clearTimeout(bn),bn=null),Ne()}),ct(pn,h=>{const _=h.trim();if(bn&&(clearTimeout(bn),bn=null),!_){zr.value=null;return}bn=setTimeout(()=>{OM(_,1e3).then(C=>{pn.value.trim()===_&&(zr.value=C.threadIds)}).catch(()=>{pn.value.trim()===_&&(zr.value=null)})},220)}),ct(hn,()=>{if(typeof window>"u")return;if(!hn.value.some(_=>_.quotaStatus==="loading")){yn!==null&&(window.clearInterval(yn),yn=null);return}yn===null&&(yn=window.setInterval(()=>{Ui||(Ui=!0,nr({silent:!0}).finally(()=>{Ui=!1}))},1500))},{deep:!0});function ms(){ie()}async function wr(){try{dt.value=await jM()}catch(h){const _=h instanceof Error?h.message:"Failed to load Telegram status";dt.value={configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:_}}}async function dl(){try{const h=await DM();qn.value=h.botToken,$r.value=h.allowedUserIds.map(_=>String(_)).join(`
85
- `),gn.value=""}catch(h){gn.value=h instanceof Error?h.message:"Failed to load Telegram configuration"}}function Ki(h){const _=h.split(/[\n,]/).map(Te=>Te.trim().replace(/^(telegram|tg):/i,"").trim()).filter(Boolean),C=_.includes("*"),re=Array.from(new Set(_.filter(Te=>/^-?\d+$/.test(Te)).map(Te=>Number.parseInt(Te,10))));return C?["*",...re]:re}async function cu(){const h=qn.value.trim(),_=Ki($r.value);if(!h){gn.value="Telegram bot token is required.";return}if(_.length===0){gn.value="At least one allowed Telegram user ID or * is required.";return}Nr.value=!0,gn.value="";try{await LM(h,_),$r.value=_.map(C=>String(C)).join(`
86
- `),await Promise.all([dl(),wr()]),window.alert("Telegram bot configured. Only allowlisted Telegram users can use the bridge.")}catch(C){gn.value=C instanceof Error?C.message:"Failed to connect Telegram bot",wr()}finally{Nr.value=!1}}function uu(){jt.value=!jt.value,jt.value?Yt(()=>{var h;return(h=so.value)==null?void 0:h.focus()}):pn.value=""}function du(){var h;pn.value="",(h=so.value)==null||h.focus()}function fu(h){h.key==="Escape"&&(jt.value=!1,pn.value="")}function fl(h){h&&(Ae.name==="thread"&&co.value===h||(P.push({name:"thread",params:{threadId:h}}),$.value&&ke(!0)))}async function pu(h){h&&(R.value!==h&&(await Ie(h),await P.push({name:"thread",params:{threadId:h}})),await Yt(),$b())}function hu(h){return h.length>8?h.slice(-8):h}function pl(h){const _=[h.planType||"unknown"];return h.authMode&&_.unshift(h.authMode),_.join(" · ")}function hl(h){if(!h)return!1;const _=h.toLowerCase();return _.includes("payment required")||/\b402\b/.test(_)}function gs(h){return h.unavailableReason==="payment_required"||hl(h.quotaError)}function vs(h){return qt.value||Ct.value||Tn.value.length>0||h.isActive&&Tn.value!==h.accountId&&Hi.value}function ys(h){return An.value===h.accountId}function ml(h){return xn.value===h.accountId||ys(h)}function mu(h){return gs(h)?"Unavailable":h.isActive?"Active":Ct.value?"Switching…":"Switch"}function Qs(h){return Tn.value===h.accountId?"Removing…":ys(h)?"Click again to remove":"Remove"}function gu(h){xn.value=h}function vu(h){xn.value===h&&(xn.value=""),Tn.value!==h&&An.value===h&&(An.value="")}function yu(h){const _=h.quotaSnapshot;if(!_)return null;const C=[_==null?void 0:_.primary,_==null?void 0:_.secondary].filter(Ce=>Ce!==null),re=C.find(Ce=>Ce.windowMinutes===10080);if(re)return re;const Te=C.filter(Ce=>typeof Ce.windowMinutes=="number"&&Ce.windowMinutes>=10080).sort((Ce,it)=>(Ce.windowMinutes??0)-(it.windowMinutes??0))[0]??null;return Te||(_.secondary??null)}function _u(h){if(typeof h!="number"||!Number.isFinite(h))return"";const _=new Date(h*1e3);return`${_.getMonth()+1}月${_.getDate()}日`}function gl(h){var Ce,it;if(gs(h))return h.quotaError||"402 Payment Required";const _=h.quotaSnapshot,C=yu(h),re=(_==null?void 0:_.primary)??(_==null?void 0:_.secondary)??null,Te=C??re;if(Te){const $n=Math.max(0,Math.min(100,100-Math.round(Te.usedPercent))),Yr=_u(Te.resetsAt);return Yr?`${$n}% weekly remaining · ${Yr}`:`${$n}% weekly remaining`}return(Ce=_==null?void 0:_.credits)!=null&&Ce.unlimited?"Unlimited credits":(it=_==null?void 0:_.credits)!=null&&it.hasCredits&&_.credits.balance?`${_.credits.balance} credits`:h.quotaStatus==="loading"?"Loading quota…":h.quotaStatus==="error"?h.quotaError||"Quota unavailable":h.quotaStatus==="ready"||h.quotaStatus==="idle"?"Quota unavailable":"Fetching account details…"}function Yi(h){return[h.email||"Account",pl(h),gs(h)?"Unavailable account":null,gl(h),`Workspace ${h.accountId}`].filter(Boolean).join(`
87
- `)}async function nr(h={}){try{const _=await cM();hn.value=_.accounts,_.accounts.some(C=>C.accountId===xn.value)||(xn.value=""),_.accounts.some(C=>C.accountId===An.value)||(An.value="")}catch(_){if(h.silent===!0)return;zt.value=_ instanceof Error?_.message:"Failed to load accounts"}}async function bu(){if(!(qt.value||Ct.value)){zt.value="",xn.value="",An.value="",qt.value=!0;try{const h=await uM();hn.value=h.accounts,Ne(),ee(),we({includeSelectedThreadMessages:!0})}catch(h){zt.value=h instanceof Error?h.message:"Failed to refresh accounts"}finally{qt.value=!1}}}async function wu(h){if(!(Ct.value||qt.value)){if(Hi.value){zt.value="Finish the current turn and pending requests before switching accounts.";return}zt.value="",xn.value="",An.value="",Ct.value=!0;try{const _=await dM(h);hn.value=hn.value.map(C=>C.accountId===h?_:{...C,isActive:!1}),Ne(),ee(),we({includeSelectedThreadMessages:!0}),nr({silent:!0})}catch(_){zt.value=_ instanceof Error?_.message:"Failed to switch account"}finally{Ct.value=!1}}}async function vl(h){if(qt.value||Ct.value||Tn.value.length>0)return;const _=hn.value.find(re=>re.accountId===h)??null;if(!_)return;if(An.value!==h){An.value=h;return}if(_.isActive&&Hi.value){zt.value="Finish the current turn and pending requests before removing the active account.";return}const C=_.isActive;zt.value="",An.value="",Tn.value=h;try{const re=await fM(h);hn.value=re.accounts,Ne(),ee(),C&&we({includeSelectedThreadMessages:!0}),nr({silent:!0})}catch(re){zt.value=re instanceof Error?re.message:"Failed to remove account"}finally{Tn.value=""}}function yl(h){Ve(h)}async function Su(h){const _=await ze(h);_&&(Pn.value?await P.replace({name:"thread",params:{threadId:_}}):await P.push({name:"thread",params:{threadId:_}}),$.value&&ke(!0))}function _l(h){const _=h.trim().replace(/\\/gu,"/");return _?_.includes("/.codex/worktrees/")||_.includes("/.git/worktrees/"):!1}function Zs(h,_=""){var Ce,it,$n;const C=u.value.find(Yr=>Yr.projectName===h);if(!C)return _.trim();const re=C.threads.find(Yr=>!_l(Yr.cwd));return(((Ce=re==null?void 0:re.cwd)==null?void 0:Ce.trim())??(($n=(it=C.threads[0])==null?void 0:it.cwd)==null?void 0:$n.trim())??"")||_.trim()}function Tu(h){var re,Te;const _=u.value.find(Ce=>Ce.projectName===h),C=Zs(h,((Te=(re=_==null?void 0:_.threads[0])==null?void 0:re.cwd)==null?void 0:Te.trim())??"");C&&(tt.value=C),$.value&&ke(!0),!Pn.value&&P.push({name:"home"})}function Eu(h){var C;let _="";for(const re of u.value){const Te=re.threads.find(Ce=>Ce.id===h);if((C=Te==null?void 0:Te.cwd)!=null&&C.trim()){_=Te.cwd.trim();break}}!_||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(_)}`,"_blank","noopener,noreferrer")}function c(){var C;const h=f.value,_=h?Zs(h.projectName,((C=h.cwd)==null?void 0:C.trim())??""):"";_&&(tt.value=_),$.value&&ke(!0),!Pn.value&&P.push({name:"home"})}function p(h){Y(h.projectName,h.displayName)}function v(h){Ge(h.threadId,h.title)}async function S(h){await se(h),await ti(),Ho()}function D(h){pe(h.projectName,h.toIndex)}function F(h){Pe(h.threadId,h.state)}function U(h){V(h)}async function V(h){var re;const _=await X(h),C=((re=h.followUpMessageText)==null?void 0:re.trim())??"";if(!(!_||!C||Pn.value))try{await Ye(C,[],[],"steer",[])}catch{}}async function te(h){const _=await at(h.threadId,h.turnIndex);_&&(await P.push({name:"thread",params:{threadId:_}}),R.value!==_&&await Ie(_),$.value&&ke(!0))}function ke(h){It.value!==h&&(It.value=h,Zb(h))}function qe(h){if(!h.defaultPrevented){if(h.key==="Escape"&&wn.value){wn.value=!1;return}!h.ctrlKey&&!h.metaKey||h.shiftKey||h.altKey||h.key.toLowerCase()==="b"&&(h.preventDefault(),ke(!It.value))}}function lt(h){var C,re;if(!wn.value)return;const _=h.target;_ instanceof Node&&((C=io.value)!=null&&C.contains(_)||(re=yr.value)!=null&&re.contains(_)||(wn.value=!1))}function vt(h){var C,re;if(!wn.value)return;const _=h.target;_ instanceof Node&&((C=io.value)!=null&&C.contains(_)||(re=yr.value)!=null&&re.contains(_)||(wn.value=!1))}function Zt(){if(!(typeof document>"u")&&$.value){if(document.visibilityState==="hidden"){ft.value=Date.now(),Bt.value=!1;return}ei()}}function _s(h){h.persisted&&ei()}function bs(){Ae.name==="home"&&(ti(),Ho()),ei()}function ei(){typeof window>"u"||typeof document>"u"||!$.value||document.visibilityState!=="visible"||Bt.value||ft.value===null||Date.now()-ft.value<XF||(Bt.value=!0,ft.value=null,ws())}async function ws(){if(!Wn.value){Wn.value=!0;try{await we({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await Mu()}finally{Wn.value=!1}}}function fo(h){const _=h.text;Ji();const C=rt.value,re=h.mode==="queue"&&C&&C.threadId===R.value?C.queueIndex:void 0;if(rt.value=null,Pn.value){ow(_,h.imageUrls,h.skills,h.fileAttachments);return}Ye(_,h.imageUrls,h.skills,h.mode,h.fileAttachments,re)}function Ss(h){const _=new Intl.NumberFormat().format(h.stars);return h.language?`${h.language} · ★ ${_}`:`★ ${_}`}function Uo(h){const C=new Set(["search-daily","search-weekly","search-monthly","trending-daily","trending-weekly","trending-monthly"]).has(h)?h:"trending-daily";nt.value!==C&&(nt.value=C)}function Ts(h){const _=j.value;_&&_.hydrateDraft({text:`Clone this GitHub project and run it: ${h.url}
88
- Then explain what this project does in very simple words a 5th grader can understand.`,imageUrls:[],fileAttachments:[],skills:[]})}function qo(h){const _=fe.value.findIndex(Ce=>Ce.id===h),C=_>=0?fe.value[_]:void 0,re=K.value;if(!C||!re||re.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;rt.value=R.value?{threadId:R.value,queueIndex:_}:null;const Te={text:C.text,imageUrls:[...C.imageUrls],fileAttachments:C.fileAttachments.map(Ce=>({...Ce})),skills:C.skills.map(Ce=>({...Ce}))};re.hydrateDraft(Te),je(h)}function Ji(){if(!$.value||Pn.value)return;const h=()=>{var _;(_=ae.value)==null||_.jumpToLatest()};h(),Yt(()=>{h(),!(typeof window>"u")&&window.requestAnimationFrame(()=>{h(),window.requestAnimationFrame(h)})})}function bl(h){tt.value=h.trim(),Qt.value=""}function wl(h){Xt.value=h.trim()}async function Qe(h){const _=h.trim();if(!_||Ae.name!=="thread"){ur.value=[],Fn.value=null;return}Ut.value=!0;try{const C=await xM(_);ur.value=C.options,Fn.value=C.currentBranch}catch{ur.value=[],Fn.value=null}finally{Ut.value=!1}}function rr(h){if(h==="__review__"){Qn.value=!Qn.value;return}if(h==="__detached_head__"||_r.value)return;const _=h.trim();if(!_||_===(Fn.value??""))return;const C=uo.value.trim();C&&(_r.value=!0,RM(C,_).then(re=>(Fn.value=re||_,Qn.value=!1,Qe(C))).catch(re=>{const Te=re instanceof Error?re.message:"Failed to switch branch";window.alert(Te)}).finally(()=>{_r.value=!1}))}async function po(){const h=await ku();if(!h)return;await Ho();const _=sn.value.trim()||"New Project (1)",C=window.prompt(`Create project in ${h}`,_);if(C===null)return;const re=C.trim();if(!re)return;const Te=Mp(Rp(h,re));if(Te)try{const Ce=await bd(Te,{createIfMissing:!0,label:""});if(!Ce)return;tt.value=Ce,ue(Ms(Ce)),await ti(),await Ho()}catch(Ce){const it=Ce instanceof Error?Ce.message:"Failed to create the project.";window.alert(it)}}async function Eb(){const h=tt.value.trim()||await ku();h&&(Hn.value=!1,ye.value=!0,st.value="",await ni(h),w.value||Yt(()=>{var _;return(_=vn.value)==null?void 0:_.focus()}))}function Xi(){ps+=1,ye.value=!1,B.value=!1,w.value="",st.value="",Qi()}async function kb(h){!h||B.value||(st.value="",await ni(h))}function Ib(){const h=T.value.trim();!ye.value||!h||ni(h)}function Cb(){const h=T.value.trim();!ye.value||!h||B.value||ni(h)}async function Cp(h=T.value){const _=h.trim();if(_){w.value="",ge.value=!0;try{const C=await bd(_,{createIfMissing:!1,label:""});if(!C){w.value="Failed to open the selected folder.";return}tt.value=C,ue(Ms(C)),await ti(),await Ho(),Xi()}catch(C){w.value=C instanceof Error?C.message:"Failed to open the selected folder."}finally{ge.value=!1}}}async function Ab(){if(Qt.value="",Hn.value){Qi();return}if(!ye.value){const h=tt.value.trim()||await ku();if(!h||(ye.value=!0,st.value="",await ni(h),w.value))return}w.value||(tr.value=sn.value,Hn.value=!0,Yt(()=>{var h;return(h=Zn.value)==null?void 0:h.focus()}))}function Qi(){Qt.value="",tr.value="",Hn.value=!1}async function Ap(){const h=tr.value.trim();if(!h)return;if(Qt.value="",w.value){Qt.value="Reload the current folder before creating a new one.";return}Le.value=!0;const _=ll.value.trim(),C=Mp(Rp(_,h));if(!C){Qt.value="Unable to determine where the new folder should be created.",Le.value=!1;return}if(!cl.value){Qt.value="Enter a single folder name.",Le.value=!1;return}try{const re=await PM(C);if(!re){Qt.value="Failed to create the folder.";return}Qt.value="",st.value="",await ni(re),Qi()}catch(re){Qt.value=re instanceof Error?re.message:"Failed to create folder."}finally{Le.value=!1}}async function xb(){var _;if(typeof window>"u")return!1;const h=((_=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:_.trim())??"";if(!h)return!1;try{const C=await bd(h,{createIfMissing:!1,label:""});if(!C)return!1;tt.value=C,ue(Ms(C)),await P.replace({name:"home"}),await ti();const re=new URL(window.location.href);return re.searchParams.delete("openProjectPath"),window.history.replaceState({},"",re.toString()),!0}catch{return!1}}async function ku(){const h=xp();if(h)return h;try{const _=await gg();if(_)return Gr.value=_,_}catch{}return""}async function Ho(){const h=xp();if(!h){sn.value="New Project (1)";return}try{const _=await $M(h);sn.value=_.name||"New Project (1)"}catch{sn.value="New Project (1)"}}function xp(){var C,re;const h=tt.value.trim();if(h)return pd(h);const _=((re=(C=Wi.value[0])==null?void 0:C.value)==null?void 0:re.trim())??"";return _?pd(_):Gr.value.trim()}async function Rb(){try{Gr.value=await gg()}catch{Gr.value=""}}async function ti(){try{const h=await Ps();Xn.value={order:[...h.order],labels:{...h.labels}}}catch{Xn.value={order:[],labels:{}}}}async function ni(h){const _=++ps;T.value=Ht(h).trim(),w.value="",B.value=!0;try{const C=await MM(h,{showHidden:ot.value});if(_!==ps)return;T.value=C.path,M.value=C.parentPath,m.value=C.entries}catch(C){if(_!==ps)return;w.value=C instanceof Error?C.message:"Failed to load local folders.",M.value=pd(T.value),m.value=[],Qi()}finally{_===ps&&(B.value=!1)}}async function Iu(){Ue.value=!0;try{$e.value=await BM(nt.value,6)}catch{$e.value=[]}finally{Ue.value=!1}}function Rp(h,_){const C=Ht(h).trim(),re=Ht(_).trim().replace(/^[\\/]+/u,"");if(!C||!re)return"";const Te=C.includes("\\")&&!C.includes("/")?"\\":"/";if(/^[a-zA-Z]:[\\/]?$/u.test(C))return`${C.slice(0,2)}${Te}${re}`;if(/^\/+$/u.test(C))return`/${re}`;const Ce=C.replace(/[\\/]+$/u,"");return Ce?`${Ce}${Te}${re}`:""}function Mp(h){const _=Ht(h).trim();if(!_)return"";const C=_.match(/^\\\\([^\\/]+)[\\/]+([^\\/]+)([\\/].*)?$/u);if(C){const[,Te,Ce,it=""]=C,$n=Cu(it.split(/[\\/]+/u));return $n.length>0?`\\\\${Te}\\${Ce}\\${$n.join("\\")}`:`\\\\${Te}\\${Ce}`}const re=_.match(/^([a-zA-Z]:)([\\/].*)?$/u);if(re){const[,Te,Ce=""]=re,it=_.includes("\\")&&!_.includes("/")?"\\":"/",$n=Cu(Ce.split(/[\\/]+/u));return $n.length>0?`${Te}${it}${$n.join(it)}`:`${Te}${it}`}if(_.startsWith("/")){const Te=Cu(_.split("/"));return Te.length>0?`/${Te.join("/")}`:"/"}return _}function Cu(h){const _=[];for(const C of h){const re=C.trim();if(!(!re||re===".")){if(re===".."){_.length>0&&_.pop();continue}_.push(re)}}return _}function Pp(h){I(h)}function $p(h){q(h)}function Np(h){Z(h)}function Mb(){be()}function Pb(h){const _=h.turnId.trim();if(_.length>0){const C=[...Js.value].reverse().find(re=>{var Te;return re.role==="user"&&(((Te=re.turnId)==null?void 0:Te.trim())??"")===_&&re.text.trim().length>0});C!=null&&C.text&&K.value&&K.value.appendTextToDraft(C.text)}_e(h.turnId)}function $b(){if(Pn.value||Fo.value||typeof document>"u"||!f.value||Js.value.length===0)return;const h=Nb(),_=Ob(),C=new Blob([h],{type:"text/markdown;charset=utf-8"}),re=URL.createObjectURL(C),Te=document.createElement("a");Te.href=re,Te.download=_,document.body.appendChild(Te),Te.click(),document.body.removeChild(Te),window.setTimeout(()=>URL.revokeObjectURL(re),0)}function Nb(){var C,re,Te;const h=[],_=((re=(C=f.value)==null?void 0:C.title)==null?void 0:re.trim())||"Untitled thread";h.push(`# ${Lb(_)}`),h.push(""),h.push(`- Exported: ${new Date().toISOString()}`),h.push(`- Thread ID: ${((Te=f.value)==null?void 0:Te.id)??""}`),h.push(""),h.push("---"),h.push("");for(const Ce of Js.value){const it=Ce.role?Ce.role.toUpperCase():"MESSAGE";h.push(`## ${it}`),h.push("");const $n=Ce.text.trim();if($n&&(h.push($n),h.push("")),Ce.commandExecution&&(h.push("```text"),h.push(`command: ${Ce.commandExecution.command}`),h.push(`status: ${Ce.commandExecution.status}`),Ce.commandExecution.cwd&&h.push(`cwd: ${Ce.commandExecution.cwd}`),Ce.commandExecution.exitCode!==null&&h.push(`exitCode: ${Ce.commandExecution.exitCode}`),h.push(Ce.commandExecution.aggregatedOutput||"(no output)"),h.push("```"),h.push("")),Ce.fileAttachments&&Ce.fileAttachments.length>0){h.push("Attachments:");for(const Yr of Ce.fileAttachments)h.push(`- ${Yr.path}`);h.push("")}if(Ce.images&&Ce.images.length>0){h.push("Images:");for(const Yr of Ce.images)h.push(`- ${Yr}`);h.push("")}}return`${h.join(`
89
- `).trimEnd()}
90
- `}function Ob(){var Te,Ce;const C=(((Ce=(Te=f.value)==null?void 0:Te.title)==null?void 0:Ce.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",re=new Date().toISOString().replace(/[:.]/g,"-");return`${C}-${re}.md`}function Lb(h){return h.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function Sl(h,_){if(typeof window>"u")return _;const C=window.localStorage.getItem(h);return C===null?_:C==="1"}function Db(){if(typeof window>"u")return"system";const h=window.localStorage.getItem(jg);return h==="light"||h==="dark"?h:"system"}function jb(){return typeof window>"u"?"steer":window.localStorage.getItem(Dg)==="queue"?"queue":"steer"}function Fb(){if(typeof window>"u")return"standard";const h=window.localStorage.getItem(Hg);return h==="standard"||h==="wide"||h==="extra-wide"?h:"standard"}function Bb(){Bn.value=!Bn.value,window.localStorage.setItem(Lg,Bn.value?"1":"0")}function Ub(){Rn.value=Rn.value==="steer"?"queue":"steer",window.localStorage.setItem(Dg,Rn.value)}function qb(){const h=["system","light","dark"],_=h.indexOf(wt.value);wt.value=h[(_+1)%h.length],window.localStorage.setItem(jg,wt.value),Tl()}function Hb(){const h=["standard","wide","extra-wide"],_=h.indexOf(Tt.value);Tt.value=h[(_+1)%h.length],window.localStorage.setItem(Hg,Tt.value)}function Wb(){br.value=!br.value,window.localStorage.setItem(Fg,br.value?"1":"0")}function Vb(){dr.value=!dr.value,window.localStorage.setItem(Bg,dr.value?"1":"0")}function zb(){mn.value=!mn.value,window.localStorage.setItem(qg,mn.value?"1":"0")}async function Gb(h){if(!Kr.value){Kr.value=!0;try{if(h==="codex"){Mn.value="codex";const _=await hg(!1);er.value=_.enabled}else if(h==="openrouter"){Mn.value="openrouter";const _=await hg(!0);er.value=_.enabled}else h==="custom"&&(Mn.value="custom");await we({includeSelectedThreadMessages:!1})}catch{}finally{Kr.value=!1}}}async function Au(){if(Ft.value)return;const h=nn.value.trim();if(h){Ft.value=!0;try{await TM(h,lo.value.trim()),er.value=!0,await we({includeSelectedThreadMessages:!1})}catch{}finally{Ft.value=!1}}}async function Op(){if(!Ft.value){Ft.value=!0;try{const h=an.value.trim();await mg(h),an.value="",await xu(),await we({includeSelectedThreadMessages:!1})}catch{}finally{Ft.value=!1}}}async function Kb(){if(!Ft.value){Ft.value=!0;try{await mg(""),an.value="",await xu(),await we({includeSelectedThreadMessages:!1})}catch{}finally{Ft.value=!1}}}async function xu(){try{const h=await SM();er.value=h.enabled,ao.value=h.customKey??!1,Pr.value=h.maskedKey??null,h.enabled?h.provider==="custom"?(Mn.value="custom",nn.value=h.customBaseUrl??""):Mn.value="openrouter":Mn.value="codex"}catch{}}function Yb(h){const C=Ru(h.trim())||"auto";fr.value=C,window.localStorage.setItem(Ug,C)}function Jb(){var C;if(typeof window>"u")return"auto";const h=((C=window.localStorage.getItem(Ug))==null?void 0:C.trim())||"auto";return Ru(h)||"auto"}function Xb(){const h=[{value:"auto",label:"Auto-detect"}],_=new Set(["auto"]);function C(Te){const Ce=l[Te]||Te;return`${Ce.charAt(0).toUpperCase()+Ce.slice(1)} (${Te})`}for(const Te of typeof navigator<"u"?navigator.languages??[]:[]){const Ce=Ru(Te);!Ce||_.has(Ce)||(_.add(Ce),h.push({value:Ce,label:`Preferred: ${C(Ce)}`}))}for(const Te of Object.keys(l))_.has(Te)||(_.add(Te),h.push({value:Te,label:C(Te)}));const re=fr.value.trim();return re&&!_.has(re)&&h.push({value:re,label:C(re)}),h}function Ru(h){const _=h.trim().toLowerCase();if(!_||_==="auto")return"";if(_ in l)return _;const C=_.split("-")[0]??_;return C in l?C:""}function Tl(){const h=document.documentElement;if(wt.value==="dark")h.classList.add("dark");else if(wt.value==="light")h.classList.remove("dark");else{const _=window.matchMedia("(prefers-color-scheme: dark)").matches;h.classList.toggle("dark",_)}}function Qb(){return typeof window>"u"?!1:window.localStorage.getItem(Ng)==="1"}function Zb(h){typeof window>"u"||window.localStorage.setItem(Ng,h?"1":"0")}function ew(){if(typeof window>"u")return!0;const h=window.localStorage.getItem(Og);return h===null?!0:h==="1"}function tw(){Sn.value=!Sn.value,!(typeof window>"u")&&window.localStorage.setItem(Og,Sn.value?"1":"0")}function nw(h,_){const C=(h??"").trim();return C.length>0?C:_.trim()||"message"}function Lp(h){E(h)}async function rw(){await P.isReady(),Ae.name==="thread"&&co.value&&Se(co.value),ee(),await we({includeSelectedThreadMessages:!0}),nr({silent:!0}),await xb(),on.value=!0,await Mu()}async function Mu(){if($t.value){bt=!0;return}$t.value=!0;try{do{if(bt=!1,Ae.name==="home"||Ae.name==="skills"){R.value!==""&&await Ie("");continue}if(Ae.name==="thread"){const h=co.value;if(!h)continue;if(!nl.value.has(h)){await P.replace({name:"home"});continue}R.value!==h?await Ie(h):De(h,{silent:!0})}}while(bt)}finally{$t.value=!1}}ct(()=>[Ae.name,co.value,Oe.value,nl.value.has(co.value),R.value],async()=>{on.value&&await Mu()}),ct(()=>R.value,async h=>{if(on.value&&!$t.value&&!(Pn.value||Fo.value)){if(!h){Ae.name!=="home"&&await P.replace({name:"home"});return}Ae.name==="thread"&&co.value===h||await P.replace({name:"thread",params:{threadId:h}})}}),ct(()=>nt.value,()=>{mn.value&&Iu()}),ct(()=>mn.value,h=>{if(!h){$e.value=[];return}Iu()}),ct(()=>[on.value,Ae.name,R.value],([h,_,C])=>{h&&_==="thread"&&C&&De(C,{silent:!0})}),ct(()=>Wi.value,h=>{if(h.length===0){tt.value="";return}h.some(C=>C.value===tt.value)||(tt.value=h[0].value),Ho()},{immediate:!0}),ct(()=>tt.value,()=>{Vt.value={phase:"idle",title:"",message:""},Ho()}),ct(()=>[fn.value,tt.value],([h,_])=>{h==="worktree"&&Dp(_)},{immediate:!0}),ct(()=>fn.value,h=>{var _;if(h==="local"){Vt.value={phase:"idle",title:"",message:""};const C=tt.value.trim();if(C&&_l(C)){const re=((_=f.value)==null?void 0:_.projectName)??Ms(C),Te=Zs(re,"");Te&&(tt.value=Te)}return}Dp(tt.value)}),ct(()=>Ae.name,h=>{h!=="home"&&(Vt.value={phase:"idle",title:"",message:""}),h!=="thread"&&(Qn.value=!1)}),ct(()=>R.value,()=>{Vt.value={phase:"idle",title:"",message:""}}),ct(()=>[Ae.name,uo.value],([h,_])=>{if(h!=="thread"){ur.value=[],Fn.value=null;return}Qe(_)},{immediate:!0}),ct(Yc,h=>{typeof document>"u"||(document.title=h)},{immediate:!0}),ct($,h=>{h&&!It.value&&ke(!0)});async function ow(h,_=[],C=[],re=[]){try{Vt.value={phase:"idle",title:"",message:""};let Te=tt.value;if(fn.value==="worktree"){Vt.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const it=await CM(tt.value,Xt.value);Te=it.cwd,tt.value=it.cwd,Vt.value={phase:"idle",title:"",message:""}}catch{Vt.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ce=await G(h,Te,_,C,re);if(!Ce)return;await P.replace({name:"thread",params:{threadId:Ce}}),Ji()}catch{}}async function Dp(h){var C;const _=h.trim();if(!_){vr.value=[],Xt.value="";return}cr.value=!0;try{const re=await AM(_);vr.value=re;const Te=Xt.value.trim();if(!(Te.length>0&&re.some(it=>it.value===Te))){const it=re.find($n=>$n.value.trim()==="main");Xt.value=(it==null?void 0:it.value)??((C=re[0])==null?void 0:C.value)??""}}catch{vr.value=[],Xt.value=""}finally{cr.value=!1}}return(h,_)=>(x(),mt(vR,{"is-sidebar-collapsed":It.value,onCloseSidebar:_[19]||(_[19]=C=>ke(!0))},{sidebar:At(()=>[b("section",tj,[b("div",nj,[It.value?he("",!0):(x(),mt(Eg,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":It.value,"show-new-thread-button":!0,onToggleSidebar:_[0]||(_[0]=C=>ke(!It.value)),onStartNewThread:c},{default:At(()=>[b("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":jt.value,"aria-label":"Search threads",title:"Search threads",onClick:uu},[We(kg,{class:"sidebar-search-toggle-icon"})],8,rj)]),_:1},8,["is-sidebar-collapsed"])),!It.value&&jt.value?(x(),L("div",oj,[We(kg,{class:"sidebar-search-bar-icon"}),Kn(b("input",{ref_key:"sidebarSearchInputRef",ref:so,"onUpdate:modelValue":_[1]||(_[1]=C=>pn.value=C),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:fu},null,544),[[ir,pn.value]]),pn.value.length>0?(x(),L("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:du},[We(_D,{class:"sidebar-search-clear-icon"})])):he("",!0)])):he("",!0),It.value?he("",!0):(x(),L("button",{key:2,class:ht(["sidebar-skills-link",{"is-active":Fo.value}]),type:"button",onClick:_[2]||(_[2]=C=>{Be(P).push({name:"skills"}),Be($)&&ke(!0)})}," Skills Hub ",2)),It.value?he("",!0):(x(),mt(D$,{key:3,groups:Be(u),"project-display-name-by-id":Be(d),"selected-thread-id":Be(R),"is-loading":Be(Oe),"search-query":pn.value,"search-matched-thread-ids":zr.value,onSelect:fl,onArchive:yl,onStartNewThread:Tu,onRenameProject:p,onBrowseThreadFiles:Eu,onRenameThread:v,onForkThread:Su,onRemoveProject:S,onReorderProject:D,onExportThread:pu},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),It.value?he("",!0):(x(),L("div",{key:0,ref_key:"settingsAreaRef",ref:fs,class:"sidebar-settings-area",onClick:vt},[We(ny,{name:"settings-panel"},{default:At(()=>[wn.value?(x(),L("div",{key:0,ref_key:"settingsPanelRef",ref:io,class:"sidebar-settings-panel",onClick:_[10]||(_[10]=pt(()=>{},["stop"]))},[b("div",sj,[b("div",ij,[b("div",aj,[b("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!Sn.value,title:Sn.value?"Expand accounts":"Collapse accounts",onClick:tw},[b("span",cj,le(Sn.value?"▸":"▾"),1)],8,lj),_[20]||(_[20]=b("span",{class:"sidebar-settings-account-title"},"Accounts",-1)),b("span",uj,le(hn.value.length),1)]),b("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:qt.value||Ct.value,onClick:bu},le(qt.value?"Reloading…":"Reload"),9,dj)]),Sn.value?he("",!0):(x(),L(Je,{key:0},[zt.value?(x(),L("p",fj,le(zt.value),1)):he("",!0),hn.value.length===0?(x(),L("p",pj," Run `codex login`, then click reload. ")):(x(),L("div",hj,[(x(!0),L(Je,null,Dt(hn.value,C=>(x(),L("article",{key:C.accountId,class:ht(["sidebar-settings-account-item",{"is-active":C.isActive,"is-unavailable":gs(C),"is-confirming-remove":ys(C),"is-remove-visible":ml(C)}]),title:Yi(C),onMouseenter:re=>gu(C.accountId),onMouseleave:re=>vu(C.accountId)},[b("div",gj,[b("p",vj,le(C.email||"Account"),1),b("p",yj,le(pl(C)),1),b("p",_j,le(gl(C)),1),b("p",bj," Workspace "+le(hu(C.accountId)),1)]),b("div",wj,[b("button",{class:"sidebar-settings-account-switch",type:"button",disabled:vs(C)||C.isActive||gs(C),onClick:re=>wu(C.accountId)},le(mu(C)),9,Sj),b("button",{class:ht(["sidebar-settings-account-remove",{"is-visible":ml(C),"is-confirming":ys(C)}]),type:"button",disabled:vs(C),onClick:re=>vl(C.accountId)},le(Qs(C)),11,Tj)])],42,mj))),128))]))],64))]),b("button",{class:"sidebar-settings-row",type:"button",title:i.sendWithEnter,onClick:Bb},[_[21]||(_[21]=b("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),b("span",{class:ht(["sidebar-settings-toggle",{"is-on":!Bn.value}])},null,2)],8,Ej),b("button",{class:"sidebar-settings-row",type:"button",title:i.inProgressSendMode,onClick:Ub},[_[22]||(_[22]=b("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),b("span",Ij,le(Rn.value==="steer"?"Steer":"Queue"),1)],8,kj),b("button",{class:"sidebar-settings-row",type:"button",title:i.appearance,onClick:qb},[_[23]||(_[23]=b("span",{class:"sidebar-settings-label"},"Appearance",-1)),b("span",Aj,le(wt.value==="system"?"System":wt.value==="dark"?"Dark":"Light"),1)],8,Cj),b("button",{class:"sidebar-settings-row",type:"button",title:i.chatWidth,onClick:Hb},[_[24]||(_[24]=b("span",{class:"sidebar-settings-label"},"Chat width",-1)),b("span",Rj,le(iu.value),1)],8,xj),b("button",{class:"sidebar-settings-row",type:"button",title:i.dictationClickToToggle,onClick:Wb},[_[25]||(_[25]=b("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),b("span",{class:ht(["sidebar-settings-toggle",{"is-on":br.value}])},null,2)],8,Mj),b("button",{class:"sidebar-settings-row",type:"button",title:i.dictationAutoSend,onClick:Vb},[_[26]||(_[26]=b("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),b("span",{class:ht(["sidebar-settings-toggle",{"is-on":dr.value}])},null,2)],8,Pj),b("button",{class:"sidebar-settings-row",type:"button",title:i.githubTrendingProjects,onClick:zb},[_[27]||(_[27]=b("span",{class:"sidebar-settings-label"},"GitHub trending projects",-1)),b("span",{class:ht(["sidebar-settings-toggle",{"is-on":mn.value}])},null,2)],8,$j),b("div",Nj,[_[29]||(_[29]=b("span",{class:"sidebar-settings-label"},"Provider",-1)),b("select",{class:"sidebar-settings-provider-select",value:Mn.value,disabled:Kr.value,onChange:_[3]||(_[3]=C=>Gb(C.target.value))},[..._[28]||(_[28]=[b("option",{value:"codex"},"Codex",-1),b("option",{value:"openrouter"},"OpenRouter",-1),b("option",{value:"custom"},"Custom endpoint",-1)])],40,Oj)]),Mn.value==="openrouter"?(x(),L("div",Lj,[_[30]||(_[30]=b("div",{class:"sidebar-settings-provider-info"},[b("span",{class:"sidebar-settings-label"},"OpenRouter API key"),b("a",{class:"sidebar-settings-provider-link",href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer"},"Get API key")],-1)),b("div",Dj,[ao.value&&!an.value?(x(),L(Je,{key:0},[b("span",jj,le(Pr.value),1),b("button",{class:"sidebar-settings-key-clear",type:"button",disabled:Ft.value,title:"Remove custom key, use community keys",onClick:Kb},"✕",8,Fj)],64)):(x(),L(Je,{key:1},[Kn(b("input",{"onUpdate:modelValue":_[4]||(_[4]=C=>an.value=C),class:"sidebar-settings-key-input",type:"password",placeholder:"sk-or-v1-... (optional, uses free keys if empty)",onKeydown:en(Op,["enter"])},null,544),[[ir,an.value]]),b("button",{class:"sidebar-settings-key-save",type:"button",disabled:Ft.value||!an.value.trim(),onClick:Op},le(Ft.value?"...":"Set"),9,Bj)],64))])])):he("",!0),Mn.value==="custom"?(x(),L("div",Uj,[_[31]||(_[31]=b("span",{class:"sidebar-settings-label"},"Custom endpoint URL",-1)),b("div",qj,[Kn(b("input",{"onUpdate:modelValue":_[5]||(_[5]=C=>nn.value=C),class:"sidebar-settings-key-input",type:"url",placeholder:"https://api.example.com/v1",onKeydown:en(Au,["enter"])},null,544),[[ir,nn.value]])]),_[32]||(_[32]=b("span",{class:"sidebar-settings-label",style:{"margin-top":"4px"}},"API key",-1)),b("div",Hj,[Kn(b("input",{"onUpdate:modelValue":_[6]||(_[6]=C=>lo.value=C),class:"sidebar-settings-key-input",type:"password",placeholder:"Bearer token (optional)",onKeydown:en(Au,["enter"])},null,544),[[ir,lo.value]]),b("button",{class:"sidebar-settings-key-save",type:"button",disabled:Ft.value||!nn.value.trim(),onClick:Au},le(Ft.value?"...":"Save"),9,Wj)])])):he("",!0),b("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:i.dictationLanguage},[_[33]||(_[33]=b("span",{class:"sidebar-settings-label"},"Dictation language",-1)),We(Ls,{class:"sidebar-settings-language-dropdown","model-value":fr.value,options:jo.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":Yb},null,8,["model-value","options"])],8,Vj),b("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:_[7]||(_[7]=C=>Un.value=!Un.value)},[_[34]||(_[34]=b("span",{class:"sidebar-settings-label"},"Telegram",-1)),b("span",zj,le(lu.value),1)]),Un.value?(x(),L("div",Gj,[b("label",Kj,[_[35]||(_[35]=b("span",{class:"sidebar-settings-field-label"},"Bot token",-1)),Kn(b("input",{"onUpdate:modelValue":_[8]||(_[8]=C=>qn.value=C),class:"sidebar-settings-input",type:"password",placeholder:"123456:ABCDEF",autocomplete:"off",spellcheck:"false"},null,512),[[ir,qn.value]])]),b("label",Yj,[_[36]||(_[36]=b("span",{class:"sidebar-settings-field-label"},"Allowed Telegram user IDs",-1)),Kn(b("textarea",{"onUpdate:modelValue":_[9]||(_[9]=C=>$r.value=C),class:"sidebar-settings-textarea",rows:"3",placeholder:`123456789
91
- 987654321`,spellcheck:"false"},null,512),[[ir,$r.value]])]),_[37]||(_[37]=b("div",{class:"sidebar-settings-field-help"}," Put one Telegram user ID per line or separate them with commas. Use `*` to allow all Telegram users. Unauthorized users will see their own ID in the rejection message so they can copy it here. ",-1)),gn.value?(x(),L("div",Jj,le(gn.value),1)):he("",!0),b("div",Xj,[b("button",{class:"sidebar-settings-telegram-save",type:"button",disabled:Nr.value,onClick:cu},le(Nr.value?"Saving…":"Save Telegram config"),9,Qj)])])):he("",!0),Jc.value?(x(),L("div",{key:3,class:"sidebar-settings-row sidebar-settings-context-row","data-state":il.value,title:eu.value},[_[38]||(_[38]=b("span",{class:"sidebar-settings-label"},"Context",-1)),b("span",{class:"sidebar-settings-context-value","data-state":il.value},[Bs(le(Qc.value)+" ",1),b("span",tF,le(Zc.value),1)],8,eF)],8,Zj)):he("",!0),b("div",nF,[We(zL,{snapshots:Be(Me)},null,8,["snapshots"])]),b("div",rF," WT "+le(Be(o))+" · v"+le(Be(s)),1)],512)):he("",!0)]),_:1}),b("button",{ref_key:"settingsButtonRef",ref:yr,class:"sidebar-settings-button",type:"button",onClick:_[11]||(_[11]=pt(C=>wn.value=!wn.value,["stop"]))},[We(mD,{class:"sidebar-settings-icon"}),_[39]||(_[39]=b("span",null,"Settings",-1)),b("span",oF,le(Be(o))+" · v"+le(Be(s)),1)],512)],512))])]),content:At(()=>[b("section",{class:"content-root",style:To(au.value)},[We(H$,{title:Kc.value},{leading:At(()=>[It.value||Be($)?(x(),mt(Eg,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":It.value,"show-new-thread-button":!0,onToggleSidebar:_[12]||(_[12]=C=>ke(!It.value)),onStartNewThread:c},null,8,["is-sidebar-collapsed"])):he("",!0)]),actions:At(()=>[Be(Ae).name==="thread"&&Be(R)?(x(),mt(Ls,{key:0,class:ht(["content-header-branch-dropdown",{"is-review-open":Qn.value}]),"model-value":tu.value,options:nu.value,disabled:Ut.value||_r.value,"enable-search":!0,"search-placeholder":"Search branches...","onUpdate:modelValue":rr},null,8,["class","model-value","options","disabled"])):he("",!0)]),_:1},8,["title"]),b("section",sF,[Fo.value?(x(),mt(Be(r),{key:0,onSkillsChanged:ms})):Pn.value?(x(),L("div",iF,[b("div",aF,[_[46]||(_[46]=b("p",{class:"new-thread-hero"},"Let's build",-1)),We(Ls,{class:"new-thread-folder-dropdown","model-value":tt.value,options:Wi.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project",disabled:!1,"onUpdate:modelValue":bl},null,8,["model-value","options"]),tt.value?(x(),L("p",{key:0,class:"new-thread-folder-selected",title:tt.value}," Selected folder: "+le(tt.value),9,lF)):he("",!0),b("div",{class:"new-thread-folder-actions"},[b("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",onClick:Eb}," Select folder "),b("button",{class:"new-thread-folder-action",type:"button",onClick:po}," Create Project ")]),(x(),mt(ua,{to:"body"},[ye.value?(x(),L("div",{key:0,class:"new-thread-open-folder-overlay",onClick:pt(Xi,["self"])},[b("div",{class:"new-thread-open-folder",role:"dialog","aria-modal":"true","aria-label":"Select folder",onKeydown:en(pt(Xi,["prevent"]),["esc"])},[b("div",{class:"new-thread-open-folder-header"},[_[40]||(_[40]=b("p",{class:"new-thread-open-folder-title"},"Select folder",-1)),b("button",{class:"new-thread-open-folder-close",type:"button",onClick:Xi}," Cancel ")]),_[42]||(_[42]=b("p",{class:"new-thread-open-folder-label"},"Current folder",-1)),b("div",uF,[b("p",{class:"new-thread-open-folder-path",title:T.value||"Unavailable"},le(T.value||"Unavailable"),9,dF),b("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",disabled:!T.value||!!w.value||B.value||ge.value,onClick:_[13]||(_[13]=C=>Cp())},le(ge.value?"Opening…":"Open"),9,fF)]),b("div",pF,[b("label",hF,[Kn(b("input",{"onUpdate:modelValue":_[14]||(_[14]=C=>ot.value=C),class:"new-thread-open-folder-toggle-input",type:"checkbox",onChange:Ib},null,544),[[AT,ot.value]]),_[41]||(_[41]=b("span",null,"Show hidden folders",-1))]),b("button",{class:ht(["new-thread-folder-action",{"new-thread-folder-action-primary":Hn.value}]),type:"button","aria-pressed":Hn.value,disabled:!T.value||B.value||ge.value||Le.value||!!w.value&&!Hn.value,onClick:Ab}," New folder ",10,mF)]),Hn.value?(x(),L("div",gF,[b("div",vF,[Kn(b("input",{ref_key:"createFolderInputRef",ref:Zn,"onUpdate:modelValue":_[15]||(_[15]=C=>tr.value=C),class:"new-thread-open-folder-create-input",type:"text",placeholder:"Folder name",onKeydown:[en(pt(Ap,["prevent"]),["enter"]),en(pt(Qi,["prevent"]),["esc"])]},null,40,yF),[[ir,tr.value]]),b("button",{class:"new-thread-folder-action new-thread-folder-action-primary new-thread-open-folder-create-submit",type:"button",disabled:!zi.value||Le.value,onClick:Ap},le(ru.value),9,_F)]),Qt.value?(x(),L("p",bF,le(Qt.value),1)):he("",!0)])):he("",!0),Kn(b("input",{ref_key:"existingFolderFilterInputRef",ref:vn,"onUpdate:modelValue":_[16]||(_[16]=C=>st.value=C),class:"new-thread-open-folder-filter",type:"text",placeholder:"Filter folders...",onKeydown:en(pt(Xi,["prevent"]),["esc"])},null,40,wF),[[ir,st.value]]),w.value?(x(),L("div",SF,[b("p",TF,le(w.value),1),b("button",{class:"new-thread-folder-action",type:"button",disabled:B.value||ge.value,onClick:Cb}," Retry ",8,EF)])):he("",!0),B.value?(x(),L("p",kF,"Loading folders…")):!w.value&&Gi.value.length===0?(x(),L("p",IF,le(st.value.trim()?"No folders match this filter.":"No subfolders found here."),1)):Gi.value.length>0?(x(),L("ul",CF,[(x(!0),L(Je,null,Dt(Gi.value,C=>(x(),L("li",{key:C.key,class:"new-thread-open-folder-item"},[b("button",{class:"new-thread-open-folder-item-main",type:"button",title:C.path,disabled:B.value||ge.value,onClick:re=>kb(C.path)},[b("span",xF,le(C.name),1)],8,AF),C.kind==="directory"?(x(),L("button",{key:0,class:"new-thread-open-folder-item-open",type:"button",disabled:B.value||ge.value,onClick:re=>Cp(C.path)}," Open ",8,RF)):he("",!0)]))),128))])):he("",!0)],40,cF)])):he("",!0)])),We(XL,{class:"new-thread-runtime-dropdown",modelValue:fn.value,"onUpdate:modelValue":_[17]||(_[17]=C=>fn.value=C)},null,8,["modelValue"]),fn.value==="worktree"?(x(),L("div",MF,[_[43]||(_[43]=b("p",{class:"new-thread-branch-select-label"},"Base branch",-1)),We(Ls,{class:"new-thread-branch-dropdown","model-value":Xt.value,options:Vi.value,placeholder:"Select branch","enable-search":!0,"search-placeholder":"Search branches...",disabled:cr.value||Vi.value.length===0,"onUpdate:modelValue":wl},null,8,["model-value","options","disabled"]),b("p",PF,le(cr.value?"Loading branches…":al.value?`New worktree branch will start from ${al.value}.`:"No Git branches found for this folder."),1)])):he("",!0),_[47]||(_[47]=b("p",{class:"new-thread-runtime-help"},[b("code",null,"Local project"),Bs(" uses the selected folder directly. "),b("code",null,"New worktree"),Bs(" creates an isolated Git worktree before the first prompt. ")],-1)),Vt.value.phase!=="idle"?(x(),L("div",{key:2,class:ht(["worktree-init-status",{"is-running":Vt.value.phase==="running","is-error":Vt.value.phase==="error"}])},[b("strong",$F,le(Vt.value.title),1),b("span",NF,le(Vt.value.message),1)],2)):he("",!0),mn.value?(x(),L("div",OF,[b("div",LF,[_[44]||(_[44]=b("p",{class:"new-thread-trending-title"},"Trending GitHub projects",-1)),We(Ls,{class:"new-thread-trending-scope-dropdown","model-value":nt.value,options:su.value,"onUpdate:modelValue":Uo},null,8,["model-value","options"])]),Ue.value?(x(),L("p",DF,"Loading trending projects...")):$e.value.length===0?(x(),L("p",jF," Trending repos are unavailable right now. ")):(x(),L("div",FF,[(x(!0),L(Je,null,Dt($e.value,C=>(x(),L("button",{key:C.id,type:"button",class:"new-thread-trending-tip",onClick:re=>Ts(C)},[b("span",{class:"new-thread-trending-tip-name",title:C.fullName},[C.owner&&C.repo?(x(),L(Je,{key:0},[b("span",qF,le(C.owner),1),_[45]||(_[45]=b("span",{class:"new-thread-trending-tip-name-slash"},"/",-1)),b("span",HF,le(C.repo),1)],64)):(x(),L("span",WF,le(C.fullName),1))],8,UF),b("span",VF,le(Ss(C)),1),b("span",zF,le(C.description||"No description available."),1)],8,BF))),128))]))])):he("",!0)]),b("div",GF,[We(Tg,{ref_key:"homeThreadComposerRef",ref:j,"active-thread-id":qi.value,cwd:uo.value,"collaboration-modes":Be(O),"selected-collaboration-mode":Be(z),models:Be(W),"selected-model":Be(ce),"selected-reasoning-effort":Be(ne),"selected-speed-mode":Be(Q),"is-updating-speed-mode":Be(ve),skills:Be(me),"thread-token-usage":Be(g),"codex-quota":Be(H),"is-turn-in-progress":!1,"is-stop-pending":!1,"is-interrupting-turn":!1,"send-with-enter":Bn.value,"in-progress-submit-mode":Rn.value,"dictation-click-to-toggle":br.value,"dictation-auto-send":dr.value,"dictation-language":fr.value,onSubmit:fo,"onUpdate:selectedCollaborationMode":Lp,"onUpdate:selectedModel":Pp,"onUpdate:selectedReasoningEffort":$p,"onUpdate:selectedSpeedMode":Np},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"])])])):(x(),L("div",KF,[Qn.value&&Be(R)&&uo.value?(x(),mt(Be(n),{key:0,"thread-id":Be(R),cwd:uo.value,"is-thread-in-progress":hs.value,onClose:_[18]||(_[18]=C=>Qn.value=!1)},null,8,["thread-id","cwd","is-thread-in-progress"])):(x(),L(Je,{key:1},[b("div",YF,[We(Be(t),{ref_key:"threadConversationRef",ref:ae,messages:Js.value,"is-loading":Be(J),"active-thread-id":qi.value,cwd:uo.value,"scroll-state":Be(y),"live-overlay":ol.value,"pending-requests":Be(k),onUpdateScrollState:F,onForkThread:te,onRollback:Pb,onRespondServerRequest:U},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests"])]),b("div",JF,[We(DL,{messages:Be(fe),onEdit:qo,onSteer:Be(Xe),onDelete:Be(je)},null,8,["messages","onSteer","onDelete"]),sl.value?(x(),mt(AL,{key:0,request:sl.value,"request-count":Be(k).length,"has-queue-above":Be(fe).length>0,onRespondServerRequest:U},null,8,["request","request-count","has-queue-above"])):(x(),mt(Tg,{key:1,ref_key:"threadComposerRef",ref:K,"active-thread-id":qi.value,cwd:uo.value,"collaboration-modes":Be(O),"selected-collaboration-mode":Be(z),models:Be(W),"selected-model":Be(ce),"selected-reasoning-effort":Be(ne),"selected-speed-mode":Be(Q),"is-updating-speed-mode":Be(ve),skills:Be(me),"thread-token-usage":Be(g),"codex-quota":Be(H),"is-turn-in-progress":hs.value,"is-stop-pending":Be(Fe),"is-interrupting-turn":Be(Re),"has-queue-above":Be(fe).length>0,"send-with-enter":Bn.value,"in-progress-submit-mode":Rn.value,"dictation-click-to-toggle":br.value,"dictation-auto-send":dr.value,"dictation-language":fr.value,"onUpdate:selectedCollaborationMode":Lp,onSubmit:fo,"onUpdate:selectedModel":Pp,"onUpdate:selectedReasoningEffort":$p,"onUpdate:selectedSpeedMode":Np,onInterrupt:Mb},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","is-turn-in-progress","is-stop-pending","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"]))])],64))]))])],4)]),_:1},8,["is-sidebar-collapsed"]))}}),ZF=kt(QF,[["__scopeId","data-v-8f736898"]]),Md={render:()=>null},Sb=cR({history:U1(),routes:[{path:"/",name:"home",component:Md},{path:"/thread/:threadId",name:"thread",component:Md},{path:"/skills",name:"skills",component:Md},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexui. npm: https://www.npmjs.com/package/@nervmor/codexui");const Tb=NT(ZF);async function e2(){{t2();return}}function t2(e){Xx({app:Tb,dsn:"https://9b1c6357d134c512f8171518ec2cb18e@o4511194738982912.ingest.us.sentry.io/4511201728200704",release:"codexui@0.1.88",environment:"production",integrations:[e1({router:Sb})],tracesSampleRate:.05,sendDefaultPii:!0,beforeSendTransaction(t){const n=t.transaction??"";return n.includes("/health")||n.includes("/favicon")||n.match(/\.(js|css|map|png|svg|ico|woff2?)$/)?null:t}})}e2();Tb.use(Sb).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed.",e)})});export{l2 as A,iM as B,Kn as C,n2 as D,o2 as E,Je as F,i2 as G,a2 as H,ec as I,r2 as J,s2 as K,Ip as L,ua as M,ZM as N,kg as O,ir as P,en as Q,ny as T,kt as _,b as a,ls as b,L as c,In as d,zs as e,he as f,Dt as g,ht as h,mt as i,At as j,Uf as k,To as l,We as m,Yt as n,x as o,Y$ as p,_D as q,N as r,pt as s,le as t,bp as u,Be as v,ct as w,Bs as x,oe as y,ld as z};
92
- //# sourceMappingURL=index-CmAz60O4.js.map