codexui-android 0.1.72 → 0.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/assets/ReviewPane-C5squOEL.js +2 -0
- package/dist/assets/ReviewPane-C5squOEL.js.map +1 -0
- package/dist/assets/{SkillsHub-BkLIHbuN.js → SkillsHub-Crvp1wow.js} +2 -1
- package/dist/assets/SkillsHub-Crvp1wow.js.map +1 -0
- package/dist/assets/ThreadConversation-BsN7bN3q.css +1 -0
- package/dist/assets/ThreadConversation-qnvp4E2o.js +40 -0
- package/dist/assets/ThreadConversation-qnvp4E2o.js.map +1 -0
- package/dist/assets/common-BeuopZEI.js +1 -0
- package/dist/assets/common-BeuopZEI.js.map +1 -0
- package/dist/assets/index-C4y0SuPN.js +559 -0
- package/dist/assets/index-C4y0SuPN.js.map +1 -0
- package/dist/assets/index-CsHtQi-g.css +1 -0
- package/dist/assets/index.esm-BilMXo9u.js +1 -0
- package/dist/assets/index.esm-BilMXo9u.js.map +1 -0
- package/dist/assets/index.esm-DtVW_dfU.js +1 -0
- package/dist/assets/index.esm-DtVW_dfU.js.map +1 -0
- package/dist/assets/index.esm-mbv_PYjX.js +1 -0
- package/dist/assets/index.esm-mbv_PYjX.js.map +1 -0
- package/dist/index.html +2 -2
- package/dist-cli/chunk-NWKUDLO2.js +111 -0
- package/dist-cli/chunk-NWKUDLO2.js.map +1 -0
- package/dist-cli/index.js +2170 -868
- package/dist-cli/index.js.map +1 -1
- package/dist-cli/instrument.js +8 -0
- package/dist-cli/instrument.js.map +1 -0
- package/package.json +9 -4
- package/dist/assets/ReviewPane-jxaR-1Q1.js +0 -1
- package/dist/assets/ThreadConversation-1LJi-Pk9.js +0 -36
- package/dist/assets/ThreadConversation-Ct-Pc8bX.css +0 -1
- package/dist/assets/index-1Zt4k_jO.css +0 -1
- package/dist/assets/index-Tdn545FN.js +0 -62
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreadConversation-qnvp4E2o.js","assets/ThreadConversation-BsN7bN3q.css","assets/ReviewPane-C5squOEL.js","assets/ReviewPane-CyugWwTM.css","assets/SkillsHub-Crvp1wow.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 Xf(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ot={},wi=[],_o=()=>{},Iv=()=>!1,Bc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Uc=e=>e.startsWith("onUpdate:"),yn=Object.assign,Qf=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Qw=Object.prototype.hasOwnProperty,Rt=(e,t)=>Qw.call(e,t),Xe=Array.isArray,Si=e=>Wa(e)==="[object Map]",Ui=e=>Wa(e)==="[object Set]",sh=e=>Wa(e)==="[object Date]",rt=e=>typeof e=="function",Zt=e=>typeof e=="string",Qr=e=>typeof e=="symbol",Mt=e=>e!==null&&typeof e=="object",Av=e=>(Mt(e)||rt(e))&&rt(e.then)&&rt(e.catch),Rv=Object.prototype.toString,Wa=e=>Rv.call(e),Zw=e=>Wa(e).slice(8,-1),Mv=e=>Wa(e)==="[object Object]",Zf=e=>Zt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ga=Xf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Hc=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},e0=/-\w/g,er=Hc(e=>e.replace(e0,t=>t.slice(1).toUpperCase())),t0=/\B([A-Z])/g,gs=Hc(e=>e.replace(t0,"-$1").toLowerCase()),qc=Hc(e=>e.charAt(0).toUpperCase()+e.slice(1)),Gu=Hc(e=>e?`on${qc(e)}`:""),go=(e,t)=>!Object.is(e,t),Xl=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Pv=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Wc=e=>{const t=parseFloat(e);return isNaN(t)?e:t},n0=e=>{const t=Zt(e)?Number(e):NaN;return isNaN(t)?e:t};let ih;const Vc=()=>ih||(ih=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Po(e){if(Xe(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=Zt(r)?i0(r):Po(r);if(o)for(const s in o)t[s]=o[s]}return t}else if(Zt(e)||Mt(e))return e}const r0=/;(?![^(]*\))/g,o0=/:([^]+)/,s0=/\/\*[^]*?\*\//g;function i0(e){const t={};return e.replace(s0,"").split(r0).forEach(n=>{if(n){const r=n.split(o0);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ht(e){let t="";if(Zt(e))t=e;else if(Xe(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 a0="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",l0=Xf(a0);function $v(e){return!!e||e===""}function c0(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Hi(e[r],t[r]);return n}function Hi(e,t){if(e===t)return!0;let n=sh(e),r=sh(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Qr(e),r=Qr(t),n||r)return e===t;if(n=Xe(e),r=Xe(t),n||r)return n&&r?c0(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||!Hi(e[i],t[i]))return!1}}return String(e)===String(t)}function ep(e,t){return e.findIndex(n=>Hi(n,t))}const Nv=e=>!!(e&&e.__v_isRef===!0),we=e=>Zt(e)?e:e==null?"":Xe(e)||Mt(e)&&(e.toString===Rv||!rt(e.toString))?Nv(e)?we(e.value):JSON.stringify(e,Lv,2):String(e),Lv=(e,t)=>Nv(t)?Lv(e,t.value):Si(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],s)=>(n[Ku(r,s)+" =>"]=o,n),{})}:Ui(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Ku(n))}:Qr(t)?Ku(t):Mt(t)&&!Xe(t)&&!Mv(t)?String(t):t,Ku=(e,t="")=>{var n;return Qr(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 cr;class u0{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=cr,!t&&cr&&(this.index=(cr.scopes||(cr.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=cr;try{return cr=this,t()}finally{cr=n}}}on(){++this._on===1&&(this.prevScope=cr,cr=this)}off(){this._on>0&&--this._on===0&&(cr=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 d0(){return cr}let Ht;const Yu=new WeakSet;class Dv{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,cr&&cr.active&&cr.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Yu.has(this)&&(Yu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Fv(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ah(this),jv(this);const t=Ht,n=Jr;Ht=this,Jr=!0;try{return this.fn()}finally{Bv(this),Ht=t,Jr=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)rp(t);this.deps=this.depsTail=void 0,ah(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Yu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Xd(this)&&this.run()}get dirty(){return Xd(this)}}let Ov=0,va,_a;function Fv(e,t=!1){if(e.flags|=8,t){e.next=_a,_a=e;return}e.next=va,va=e}function tp(){Ov++}function np(){if(--Ov>0)return;if(_a){let t=_a;for(_a=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;va;){let t=va;for(va=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 jv(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Bv(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),rp(r),f0(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Xd(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Uv(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Uv(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ca)||(e.globalVersion=Ca,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Xd(e))))return;e.flags|=2;const t=e.dep,n=Ht,r=Jr;Ht=e,Jr=!0;try{jv(e);const o=e.fn(e._value);(t.version===0||go(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Ht=n,Jr=r,Bv(e),e.flags&=-3}}function rp(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)rp(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function f0(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Jr=!0;const Hv=[];function Oo(){Hv.push(Jr),Jr=!1}function Fo(){const e=Hv.pop();Jr=e===void 0?!0:e}function ah(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Ht;Ht=void 0;try{t()}finally{Ht=n}}}let Ca=0;class p0{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 op{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(!Ht||!Jr||Ht===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Ht)n=this.activeLink=new p0(Ht,this),Ht.deps?(n.prevDep=Ht.depsTail,Ht.depsTail.nextDep=n,Ht.depsTail=n):Ht.deps=Ht.depsTail=n,qv(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=Ht.depsTail,n.nextDep=void 0,Ht.depsTail.nextDep=n,Ht.depsTail=n,Ht.deps===n&&(Ht.deps=r)}return n}trigger(t){this.version++,Ca++,this.notify(t)}notify(t){tp();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{np()}}}function qv(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)qv(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Qd=new WeakMap,qs=Symbol(""),Zd=Symbol(""),xa=Symbol("");function Fn(e,t,n){if(Jr&&Ht){let r=Qd.get(e);r||Qd.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new op),o.map=r,o.key=n),o.track()}}function Ro(e,t,n,r,o,s){const i=Qd.get(e);if(!i){Ca++;return}const a=l=>{l&&l.trigger()};if(tp(),t==="clear")i.forEach(a);else{const l=Xe(e),c=l&&Zf(n);if(l&&n==="length"){const u=Number(r);i.forEach((d,h)=>{(h==="length"||h===xa||!Qr(h)&&h>=u)&&a(d)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),c&&a(i.get(xa)),t){case"add":l?c&&a(i.get("length")):(a(i.get(qs)),Si(e)&&a(i.get(Zd)));break;case"delete":l||(a(i.get(qs)),Si(e)&&a(i.get(Zd)));break;case"set":Si(e)&&a(i.get(qs));break}}np()}function li(e){const t=kt(e);return t===e?t:(Fn(t,"iterate",xa),Rr(e)?t:t.map(Zr))}function zc(e){return Fn(e=kt(e),"iterate",xa),e}function ho(e,t){return jo(e)?Ii(Ws(e)?Zr(t):t):Zr(t)}const h0={__proto__:null,[Symbol.iterator](){return Ju(this,Symbol.iterator,e=>ho(this,e))},concat(...e){return li(this).concat(...e.map(t=>Xe(t)?li(t):t))},entries(){return Ju(this,"entries",e=>(e[1]=ho(this,e[1]),e))},every(e,t){return To(this,"every",e,t,void 0,arguments)},filter(e,t){return To(this,"filter",e,t,n=>n.map(r=>ho(this,r)),arguments)},find(e,t){return To(this,"find",e,t,n=>ho(this,n),arguments)},findIndex(e,t){return To(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return To(this,"findLast",e,t,n=>ho(this,n),arguments)},findLastIndex(e,t){return To(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return To(this,"forEach",e,t,void 0,arguments)},includes(...e){return Xu(this,"includes",e)},indexOf(...e){return Xu(this,"indexOf",e)},join(e){return li(this).join(e)},lastIndexOf(...e){return Xu(this,"lastIndexOf",e)},map(e,t){return To(this,"map",e,t,void 0,arguments)},pop(){return aa(this,"pop")},push(...e){return aa(this,"push",e)},reduce(e,...t){return lh(this,"reduce",e,t)},reduceRight(e,...t){return lh(this,"reduceRight",e,t)},shift(){return aa(this,"shift")},some(e,t){return To(this,"some",e,t,void 0,arguments)},splice(...e){return aa(this,"splice",e)},toReversed(){return li(this).toReversed()},toSorted(e){return li(this).toSorted(e)},toSpliced(...e){return li(this).toSpliced(...e)},unshift(...e){return aa(this,"unshift",e)},values(){return Ju(this,"values",e=>ho(this,e))}};function Ju(e,t,n){const r=zc(e),o=r[t]();return r!==e&&!Rr(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const m0=Array.prototype;function To(e,t,n,r,o,s){const i=zc(e),a=i!==e&&!Rr(e),l=i[t];if(l!==m0[t]){const d=l.apply(e,s);return a?Zr(d):d}let c=n;i!==e&&(a?c=function(d,h){return n.call(this,ho(e,d),h,e)}:n.length>2&&(c=function(d,h){return n.call(this,d,h,e)}));const u=l.call(i,c,r);return a&&o?o(u):u}function lh(e,t,n,r){const o=zc(e),s=o!==e&&!Rr(e);let i=n,a=!1;o!==e&&(s?(a=r.length===0,i=function(c,u,d){return a&&(a=!1,c=ho(e,c)),n.call(this,c,ho(e,u),d,e)}):n.length>3&&(i=function(c,u,d){return n.call(this,c,u,d,e)}));const l=o[t](i,...r);return a?ho(e,l):l}function Xu(e,t,n){const r=kt(e);Fn(r,"iterate",xa);const o=r[t](...n);return(o===-1||o===!1)&&ap(n[0])?(n[0]=kt(n[0]),r[t](...n)):o}function aa(e,t,n=[]){Oo(),tp();const r=kt(e)[t].apply(e,n);return np(),Fo(),r}const g0=Xf("__proto__,__v_isRef,__isVue"),Wv=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Qr));function v0(e){Qr(e)||(e=String(e));const t=kt(this);return Fn(t,"has",e),t.hasOwnProperty(e)}class Vv{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?x0:Yv:s?Kv:Gv).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Xe(t);if(!o){let l;if(i&&(l=h0[n]))return l;if(n==="hasOwnProperty")return v0}const a=Reflect.get(t,n,Hn(t)?t:r);if((Qr(n)?Wv.has(n):g0(n))||(o||Fn(t,"get",n),s))return a;if(Hn(a)){const l=i&&Zf(n)?a:a.value;return o&&Mt(l)?tf(l):l}return Mt(a)?o?tf(a):Gc(a):a}}class zv extends Vv{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];const i=Xe(t)&&Zf(n);if(!this._isShallow){const c=jo(s);if(!Rr(r)&&!jo(r)&&(s=kt(s),r=kt(r)),!i&&Hn(s)&&!Hn(r))return c||(s.value=r),!0}const a=i?Number(n)<t.length:Rt(t,n),l=Reflect.set(t,n,r,Hn(t)?t:o);return t===kt(o)&&(a?go(r,s)&&Ro(t,"set",n,r):Ro(t,"add",n,r)),l}deleteProperty(t,n){const r=Rt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&Ro(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return(!Qr(n)||!Wv.has(n))&&Fn(t,"has",n),r}ownKeys(t){return Fn(t,"iterate",Xe(t)?"length":qs),Reflect.ownKeys(t)}}class _0 extends Vv{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const y0=new zv,b0=new _0,w0=new zv(!0);const ef=e=>e,Pl=e=>Reflect.getPrototypeOf(e);function S0(e,t,n){return function(...r){const o=this.__v_raw,s=kt(o),i=Si(s),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,c=o[e](...r),u=n?ef:t?Ii:Zr;return!t&&Fn(s,"iterate",l?Zd:qs),yn(Object.create(c),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:a?[u(d[0]),u(d[1])]:u(d),done:h}}})}}function $l(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function T0(e,t){const n={get(o){const s=this.__v_raw,i=kt(s),a=kt(o);e||(go(o,a)&&Fn(i,"get",o),Fn(i,"get",a));const{has:l}=Pl(i),c=t?ef:e?Ii:Zr;if(l.call(i,o))return c(s.get(o));if(l.call(i,a))return c(s.get(a));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!e&&Fn(kt(o),"iterate",qs),o.size},has(o){const s=this.__v_raw,i=kt(s),a=kt(o);return e||(go(o,a)&&Fn(i,"has",o),Fn(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=kt(a),c=t?ef:e?Ii:Zr;return!e&&Fn(l,"iterate",qs),a.forEach((u,d)=>o.call(s,c(u),c(d),i))}};return yn(n,e?{add:$l("add"),set:$l("set"),delete:$l("delete"),clear:$l("clear")}:{add(o){const s=kt(this),i=Pl(s),a=kt(o),l=!t&&!Rr(o)&&!jo(o)?a:o;return i.has.call(s,l)||go(o,l)&&i.has.call(s,o)||go(a,l)&&i.has.call(s,a)||(s.add(l),Ro(s,"add",l,l)),this},set(o,s){!t&&!Rr(s)&&!jo(s)&&(s=kt(s));const i=kt(this),{has:a,get:l}=Pl(i);let c=a.call(i,o);c||(o=kt(o),c=a.call(i,o));const u=l.call(i,o);return i.set(o,s),c?go(s,u)&&Ro(i,"set",o,s):Ro(i,"add",o,s),this},delete(o){const s=kt(this),{has:i,get:a}=Pl(s);let l=i.call(s,o);l||(o=kt(o),l=i.call(s,o)),a&&a.call(s,o);const c=s.delete(o);return l&&Ro(s,"delete",o,void 0),c},clear(){const o=kt(this),s=o.size!==0,i=o.clear();return s&&Ro(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=S0(o,e,t)}),n}function sp(e,t){const n=T0(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 E0={get:sp(!1,!1)},k0={get:sp(!1,!0)},C0={get:sp(!0,!1)};const Gv=new WeakMap,Kv=new WeakMap,Yv=new WeakMap,x0=new WeakMap;function I0(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function A0(e){return e.__v_skip||!Object.isExtensible(e)?0:I0(Zw(e))}function Gc(e){return jo(e)?e:ip(e,!1,y0,E0,Gv)}function Jv(e){return ip(e,!1,w0,k0,Kv)}function tf(e){return ip(e,!0,b0,C0,Yv)}function ip(e,t,n,r,o){if(!Mt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=A0(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 Ws(e){return jo(e)?Ws(e.__v_raw):!!(e&&e.__v_isReactive)}function jo(e){return!!(e&&e.__v_isReadonly)}function Rr(e){return!!(e&&e.__v_isShallow)}function ap(e){return e?!!e.__v_raw:!1}function kt(e){const t=e&&e.__v_raw;return t?kt(t):e}function R0(e){return!Rt(e,"__v_skip")&&Object.isExtensible(e)&&Pv(e,"__v_skip",!0),e}const Zr=e=>Mt(e)?Gc(e):e,Ii=e=>Mt(e)?tf(e):e;function Hn(e){return e?e.__v_isRef===!0:!1}function j(e){return Xv(e,!1)}function M0(e){return Xv(e,!0)}function Xv(e,t){return Hn(e)?e:new P0(e,t)}class P0{constructor(t,n){this.dep=new op,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:kt(t),this._value=n?t:Zr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Rr(t)||jo(t);t=r?t:kt(t),go(t,n)&&(this._rawValue=t,this._value=r?t:Zr(t),this.dep.trigger())}}function qe(e){return Hn(e)?e.value:e}const $0={get:(e,t,n)=>t==="__v_raw"?e:qe(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Hn(o)&&!Hn(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Qv(e){return Ws(e)?e:new Proxy(e,$0)}class N0{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new op(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ca-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Ht!==this)return Fv(this,!0),!0}get value(){const t=this.dep.track();return Uv(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function L0(e,t,n=!1){let r,o;return rt(e)?r=e:(r=e.get,o=e.set),new N0(r,o,n)}const Nl={},_c=new WeakMap;let Ns;function D0(e,t=!1,n=Ns){if(n){let r=_c.get(n);r||_c.set(n,r=[]),r.push(e)}}function O0(e,t,n=Ot){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:a,call:l}=n,c=z=>o?z:Rr(z)||o===!1||o===0?Mo(z,1):Mo(z);let u,d,h,g,w=!1,E=!1;if(Hn(e)?(d=()=>e.value,w=Rr(e)):Ws(e)?(d=()=>c(e),w=!0):Xe(e)?(E=!0,w=e.some(z=>Ws(z)||Rr(z)),d=()=>e.map(z=>{if(Hn(z))return z.value;if(Ws(z))return c(z);if(rt(z))return l?l(z,2):z()})):rt(e)?t?d=l?()=>l(e,2):e:d=()=>{if(h){Oo();try{h()}finally{Fo()}}const z=Ns;Ns=u;try{return l?l(e,3,[g]):e(g)}finally{Ns=z}}:d=_o,t&&o){const z=d,ce=o===!0?1/0:o;d=()=>Mo(z(),ce)}const D=d0(),C=()=>{u.stop(),D&&D.active&&Qf(D.effects,u)};if(s&&t){const z=t;t=(...ce)=>{z(...ce),C()}}let I=E?new Array(e.length).fill(Nl):Nl;const V=z=>{if(!(!(u.flags&1)||!u.dirty&&!z))if(t){const ce=u.run();if(o||w||(E?ce.some((re,Z)=>go(re,I[Z])):go(ce,I))){h&&h();const re=Ns;Ns=u;try{const Z=[ce,I===Nl?void 0:E&&I[0]===Nl?[]:I,g];I=ce,l?l(t,3,Z):t(...Z)}finally{Ns=re}}}else u.run()};return a&&a(V),u=new Dv(d),u.scheduler=i?()=>i(V,!1):V,g=z=>D0(z,!1,u),h=u.onStop=()=>{const z=_c.get(u);if(z){if(l)l(z,4);else for(const ce of z)ce();_c.delete(u)}},t?r?V(!0):I=u.run():i?i(V.bind(null,!0),!0):u.run(),C.pause=u.pause.bind(u),C.resume=u.resume.bind(u),C.stop=C,C}function Mo(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--,Hn(e))Mo(e.value,t,n);else if(Xe(e))for(let r=0;r<e.length;r++)Mo(e[r],t,n);else if(Ui(e)||Si(e))e.forEach(r=>{Mo(r,t,n)});else if(Mv(e)){for(const r in e)Mo(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Mo(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 Va(e,t,n,r){try{return r?e(...r):e()}catch(o){za(o,t,n)}}function eo(e,t,n,r){if(rt(e)){const o=Va(e,t,n,r);return o&&Av(o)&&o.catch(s=>{za(s,t,n)}),o}if(Xe(e)){const o=[];for(let s=0;s<e.length;s++)o.push(eo(e[s],t,n,r));return o}}function za(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,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,l,c)===!1)return}a=a.parent}if(s){Oo(),Va(s,null,10,[e,l,c]),Fo();return}}F0(e,n,o,r,i)}function F0(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}const Zn=[];let uo=-1;const Ti=[];let ns=null,hi=0;const Zv=Promise.resolve();let yc=null;function tn(e){const t=yc||Zv;return e?t.then(this?e.bind(this):e):t}function j0(e){let t=uo+1,n=Zn.length;for(;t<n;){const r=t+n>>>1,o=Zn[r],s=Ia(o);s<e||s===e&&o.flags&2?t=r+1:n=r}return t}function lp(e){if(!(e.flags&1)){const t=Ia(e),n=Zn[Zn.length-1];!n||!(e.flags&2)&&t>=Ia(n)?Zn.push(e):Zn.splice(j0(t),0,e),e.flags|=1,e_()}}function e_(){yc||(yc=Zv.then(n_))}function B0(e){Xe(e)?Ti.push(...e):ns&&e.id===-1?ns.splice(hi+1,0,e):e.flags&1||(Ti.push(e),e.flags|=1),e_()}function ch(e,t,n=uo+1){for(;n<Zn.length;n++){const r=Zn[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Zn.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function t_(e){if(Ti.length){const t=[...new Set(Ti)].sort((n,r)=>Ia(n)-Ia(r));if(Ti.length=0,ns){ns.push(...t);return}for(ns=t,hi=0;hi<ns.length;hi++){const n=ns[hi];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}ns=null,hi=0}}const Ia=e=>e.id==null?e.flags&2?-1:1/0:e.id;function n_(e){try{for(uo=0;uo<Zn.length;uo++){const t=Zn[uo];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Va(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;uo<Zn.length;uo++){const t=Zn[uo];t&&(t.flags&=-2)}uo=-1,Zn.length=0,t_(),yc=null,(Zn.length||Ti.length)&&n_()}}let Mn=null,r_=null;function bc(e){const t=Mn;return Mn=e,r_=e&&e.type.__scopeId||null,t}function It(e,t=Mn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&Tc(-1);const s=bc(t);let i;try{i=e(...o)}finally{bc(s),r._d&&Tc(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Kr(e,t){if(Mn===null)return e;const n=Qc(Mn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,i,a,l=Ot]=t[o];s&&(rt(s)&&(s={mounted:s,updated:s}),s.deep&&Mo(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Is(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&&(Oo(),eo(l,n,8,[e.el,a,e,t]),Fo())}}function Ql(e,t){if(Rn){let n=Rn.provides;const r=Rn.parent&&Rn.parent.provides;r===n&&(n=Rn.provides=Object.create(r)),n[e]=t}}function Xr(e,t,n=!1){const r=mp();if(r||ki){let o=ki?ki._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&&rt(t)?t.call(r&&r.proxy):t}}const U0=Symbol.for("v-scx"),H0=()=>Xr(U0);function ct(e,t,n){return o_(e,t,n)}function o_(e,t,n=Ot){const{immediate:r,deep:o,flush:s,once:i}=n,a=yn({},n),l=t&&r||!t&&s!=="post";let c;if(Ai){if(s==="sync"){const g=H0();c=g.__watcherHandles||(g.__watcherHandles=[])}else if(!l){const g=()=>{};return g.stop=_o,g.resume=_o,g.pause=_o,g}}const u=Rn;a.call=(g,w,E)=>eo(g,u,w,E);let d=!1;s==="post"?a.scheduler=g=>{Xn(g,u&&u.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(g,w)=>{w?g():lp(g)}),a.augmentJob=g=>{t&&(g.flags|=4),d&&(g.flags|=2,u&&(g.id=u.uid,g.i=u))};const h=O0(e,t,a);return Ai&&(c?c.push(h):l&&h()),h}function q0(e,t,n){const r=this.proxy,o=Zt(e)?e.includes(".")?s_(r,e):()=>r[e]:e.bind(r,r);let s;rt(t)?s=t:(s=t.handler,n=t);const i=Ka(this),a=o_(o,s.bind(r),n);return i(),a}function s_(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 As=new WeakMap,i_=Symbol("_vte"),a_=e=>e.__isTeleport,Ds=e=>e&&(e.disabled||e.disabled===""),W0=e=>e&&(e.defer||e.defer===""),uh=e=>typeof SVGElement<"u"&&e instanceof SVGElement,dh=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,nf=(e,t)=>{const n=e&&e.to;return Zt(n)?t?t(n):null:n},V0={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,i,a,l,c){const{mc:u,pc:d,pbc:h,o:{insert:g,querySelector:w,createText:E,createComment:D}}=c,C=Ds(t.props);let{dynamicChildren:I}=t;const V=(re,Z,de)=>{re.shapeFlag&16&&u(re.children,Z,de,o,s,i,a,l)},z=(re=t)=>{const Z=Ds(re.props),de=re.target=nf(re.props,w),_e=rf(de,re,E,g);de&&(i!=="svg"&&uh(de)?i="svg":i!=="mathml"&&dh(de)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(de),Z||(V(re,de,_e),pa(re,!1)))},ce=re=>{const Z=()=>{As.get(re)===Z&&(As.delete(re),Ds(re.props)&&(V(re,n,re.anchor),pa(re,!0)),z(re))};As.set(re,Z),Xn(Z,s)};if(e==null){const re=t.el=E(""),Z=t.anchor=E("");if(g(re,n,r),g(Z,n,r),W0(t.props)||s&&s.pendingBranch){ce(t);return}C&&(V(t,n,Z),pa(t,!0)),z()}else{t.el=e.el;const re=t.anchor=e.anchor,Z=As.get(e);if(Z){Z.flags|=8,As.delete(e),ce(t);return}t.targetStart=e.targetStart;const de=t.target=e.target,_e=t.targetAnchor=e.targetAnchor,Te=Ds(e.props),fe=Te?n:de,H=Te?re:_e;if(i==="svg"||uh(de)?i="svg":(i==="mathml"||dh(de))&&(i="mathml"),I?(h(e.dynamicChildren,I,fe,o,s,i,a),pp(e,t,!0)):l||d(e,t,fe,H,o,s,i,a,!1),C)Te?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ll(t,n,re,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ee=t.target=nf(t.props,w);ee&&Ll(t,ee,null,c,0)}else Te&&Ll(t,de,_e,c,1);pa(t,C)}},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:h}=e;let g=s||!Ds(h);const w=As.get(e);if(w&&(w.flags|=8,As.delete(e),g=!1),d&&(o(c),o(u)),s&&o(l),i&16)for(let E=0;E<a.length;E++){const D=a[E];r(D,t,n,g,!!D.dynamicChildren)}},move:Ll,hydrate:z0};function Ll(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:c,props:u}=e,d=s===2;if(d&&r(i,t,n),(!d||Ds(u))&&l&16)for(let h=0;h<c.length;h++)o(c[h],t,n,2);d&&r(a,t,n)}function z0(e,t,n,r,o,s,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:c,createText:u}},d){function h(D,C){let I=C;for(;I;){if(I&&I.nodeType===8){if(I.data==="teleport start anchor")t.targetStart=I;else if(I.data==="teleport anchor"){t.targetAnchor=I,D._lpa=t.targetAnchor&&i(t.targetAnchor);break}}I=i(I)}}function g(D,C){C.anchor=d(i(D),C,a(D),n,r,o,s)}const w=t.target=nf(t.props,l),E=Ds(t.props);if(w){const D=w._lpa||w.firstChild;t.shapeFlag&16&&(E?(g(e,t),h(w,D),t.targetAnchor||rf(w,t,u,c,a(e)===w?e:null)):(t.anchor=i(e),h(w,D),t.targetAnchor||rf(w,t,u,c),d(D&&i(D),t,w,n,r,o,s))),pa(t,E)}else E&&t.shapeFlag&16&&(g(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Zl=V0;function pa(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 rf(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[i_]=i,e&&(r(s,e,o),r(i,e,o)),i}const po=Symbol("_leaveCb"),la=Symbol("_enterCb");function G0(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return vs(()=>{e.isMounted=!0}),Xs(()=>{e.isUnmounting=!0}),e}const xr=[Function,Array],l_={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:xr,onEnter:xr,onAfterEnter:xr,onEnterCancelled:xr,onBeforeLeave:xr,onLeave:xr,onAfterLeave:xr,onLeaveCancelled:xr,onBeforeAppear:xr,onAppear:xr,onAfterAppear:xr,onAppearCancelled:xr},c_=e=>{const t=e.subTree;return t.component?c_(t.component):t},K0={name:"BaseTransition",props:l_,setup(e,{slots:t}){const n=mp(),r=G0();return()=>{const o=t.default&&f_(t.default(),!0);if(!o||!o.length)return;const s=u_(o),i=kt(e),{mode:a}=i;if(r.isLeaving)return Qu(s);const l=fh(s);if(!l)return Qu(s);let c=of(l,i,r,n,d=>c=d);l.type!==Bn&&Aa(l,c);let u=n.subTree&&fh(n.subTree);if(u&&u.type!==Bn&&!Os(u,l)&&c_(n).type!==Bn){let d=of(u,i,r,n);if(Aa(u,d),a==="out-in"&&l.type!==Bn)return r.isLeaving=!0,d.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Qu(s);a==="in-out"&&l.type!==Bn?d.delayLeave=(h,g,w)=>{const E=d_(r,u);E[String(u.key)]=u,h[po]=()=>{g(),h[po]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{w(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return s}}};function u_(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Bn){t=n;break}}return t}const Y0=K0;function d_(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 of(e,t,n,r,o){const{appear:s,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:g,onAfterLeave:w,onLeaveCancelled:E,onBeforeAppear:D,onAppear:C,onAfterAppear:I,onAppearCancelled:V}=t,z=String(e.key),ce=d_(n,e),re=(_e,Te)=>{_e&&eo(_e,r,9,Te)},Z=(_e,Te)=>{const fe=Te[1];re(_e,Te),Xe(_e)?_e.every(H=>H.length<=1)&&fe():_e.length<=1&&fe()},de={mode:i,persisted:a,beforeEnter(_e){let Te=l;if(!n.isMounted)if(s)Te=D||l;else return;_e[po]&&_e[po](!0);const fe=ce[z];fe&&Os(e,fe)&&fe.el[po]&&fe.el[po](),re(Te,[_e])},enter(_e){if(ce[z]===e)return;let Te=c,fe=u,H=d;if(!n.isMounted)if(s)Te=C||c,fe=I||u,H=V||d;else return;let ee=!1;_e[la]=Ne=>{ee||(ee=!0,Ne?re(H,[_e]):re(fe,[_e]),de.delayedLeave&&de.delayedLeave(),_e[la]=void 0)};const Se=_e[la].bind(null,!1);Te?Z(Te,[_e,Se]):Se()},leave(_e,Te){const fe=String(e.key);if(_e[la]&&_e[la](!0),n.isUnmounting)return Te();re(h,[_e]);let H=!1;_e[po]=Se=>{H||(H=!0,Te(),Se?re(E,[_e]):re(w,[_e]),_e[po]=void 0,ce[fe]===e&&delete ce[fe])};const ee=_e[po].bind(null,!1);ce[fe]=e,g?Z(g,[_e,ee]):ee()},clone(_e){const Te=of(_e,t,n,r,o);return o&&o(Te),Te}};return de}function Qu(e){if(Ga(e))return e=fs(e),e.children=null,e}function fh(e){if(!Ga(e))return a_(e.type)&&e.children?u_(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&&rt(n.default))return n.default()}}function Aa(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Aa(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 f_(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===et?(i.patchFlag&128&&o++,r=r.concat(f_(i.children,t,a))):(t||i.type!==Bn)&&r.push(a!=null?fs(i,{key:a}):i)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Pn(e,t){return rt(e)?yn({name:e.name},t,{setup:e}):e}function cp(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ph(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const wc=new WeakMap;function ya(e,t,n,r,o=!1){if(Xe(e)){e.forEach((E,D)=>ya(E,t&&(Xe(t)?t[D]:t),n,r,o));return}if(Ei(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ya(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Qc(r.component):r.el,i=o?null:s,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Ot?a.refs={}:a.refs,d=a.setupState,h=kt(d),g=d===Ot?Iv:E=>ph(u,E)?!1:Rt(h,E),w=(E,D)=>!(D&&ph(u,D));if(c!=null&&c!==l){if(hh(t),Zt(c))u[c]=null,g(c)&&(d[c]=null);else if(Hn(c)){const E=t;w(c,E.k)&&(c.value=null),E.k&&(u[E.k]=null)}}if(rt(l))Va(l,a,12,[i,u]);else{const E=Zt(l),D=Hn(l);if(E||D){const C=()=>{if(e.f){const I=E?g(l)?d[l]:u[l]:w()||!e.k?l.value:u[e.k];if(o)Xe(I)&&Qf(I,s);else if(Xe(I))I.includes(s)||I.push(s);else if(E)u[l]=[s],g(l)&&(d[l]=u[l]);else{const V=[s];w(l,e.k)&&(l.value=V),e.k&&(u[e.k]=V)}}else E?(u[l]=i,g(l)&&(d[l]=i)):D&&(w(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const I=()=>{C(),wc.delete(e)};I.id=-1,wc.set(e,I),Xn(I,n)}else hh(e),C()}}}function hh(e){const t=wc.get(e);t&&(t.flags|=8,wc.delete(e))}const mh=e=>e.nodeType===8;Vc().requestIdleCallback;Vc().cancelIdleCallback;function J0(e,t){if(mh(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(mh(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Ei=e=>!!e.type.__asyncLoader;function Zu(e){rt(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 c=null,u,d=0;const h=()=>(d++,c=null,g()),g=()=>{let w;return c||(w=c=t().catch(E=>{if(E=E instanceof Error?E:new Error(String(E)),l)return new Promise((D,C)=>{l(E,()=>D(h()),()=>C(E),d+1)});throw E}).then(E=>w!==c&&c?c:(E&&(E.__esModule||E[Symbol.toStringTag]==="Module")&&(E=E.default),u=E,E)))};return Pn({name:"AsyncComponentWrapper",__asyncLoader:g,__asyncHydrate(w,E,D){let C=!1;(E.bu||(E.bu=[])).push(()=>C=!0);const I=()=>{C||D()},V=s?()=>{const z=s(I,ce=>J0(w,ce));z&&(E.bum||(E.bum=[])).push(z)}:I;u?V():g().then(()=>!E.isUnmounted&&V())},get __asyncResolved(){return u},setup(){const w=Rn;if(cp(w),u)return()=>Dl(u,w);const E=V=>{c=null,za(V,w,13,!r)};if(a&&w.suspense||Ai)return g().then(V=>()=>Dl(V,w)).catch(V=>(E(V),()=>r?Ge(r,{error:V}):null));const D=j(!1),C=j(),I=j(!!o);return o&&setTimeout(()=>{I.value=!1},o),i!=null&&setTimeout(()=>{if(!D.value&&!C.value){const V=new Error(`Async component timed out after ${i}ms.`);E(V),C.value=V}},i),g().then(()=>{D.value=!0,w.parent&&Ga(w.parent.vnode)&&w.parent.update()}).catch(V=>{E(V),C.value=V}),()=>{if(D.value&&u)return Dl(u,w);if(C.value&&r)return Ge(r,{error:C.value});if(n&&!I.value)return Dl(n,w)}}})}function Dl(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=Ge(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const Ga=e=>e.type.__isKeepAlive;function X0(e,t){p_(e,"a",t)}function Q0(e,t){p_(e,"da",t)}function p_(e,t,n=Rn){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Kc(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Ga(o.parent.vnode)&&Z0(r,t,n,o),o=o.parent}}function Z0(e,t,n,r){const o=Kc(t,e,r,!0);Yc(()=>{Qf(r[t],o)},n)}function Kc(e,t,n=Rn,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{Oo();const a=Ka(n),l=eo(t,n,e,i);return a(),Fo(),l});return r?o.unshift(s):o.push(s),s}}const zo=e=>(t,n=Rn)=>{(!Ai||e==="sp")&&Kc(e,(...r)=>t(...r),n)},eS=zo("bm"),vs=zo("m"),tS=zo("bu"),nS=zo("u"),Xs=zo("bum"),Yc=zo("um"),rS=zo("sp"),oS=zo("rtg"),sS=zo("rtc");function iS(e,t=Rn){Kc("ec",e,t)}const aS="components",h_=Symbol.for("v-ndc");function up(e){return Zt(e)?lS(aS,e,!1)||e:e||h_}function lS(e,t,n=!0,r=!1){const o=Mn||Rn;if(o){const s=o.type;{const a=zS(s,!1);if(a&&(a===t||a===er(t)||a===qc(er(t))))return s}const i=gh(o[e]||s[e],t)||gh(o.appContext[e],t);return!i&&r?s:i}}function gh(e,t){return e&&(e[t]||e[er(t)]||e[qc(er(t))])}function Wt(e,t,n,r){let o;const s=n,i=Xe(e);if(i||Zt(e)){const a=i&&Ws(e);let l=!1,c=!1;a&&(l=!Rr(e),c=jo(e),e=zc(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(l?c?Ii(Zr(e[u])):Zr(e[u]):e[u],u,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,c=a.length;l<c;l++){const u=a[l];o[l]=t(e[u],u,l,s)}}else o=[];return o}function vo(e,t,n={},r,o){if(Mn.ce||Mn.parent&&Ei(Mn.parent)&&Mn.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),A(),bt(et,null,[Ge("slot",n,r)],c?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),A();const i=s&&m_(s(n)),a=n.key||i&&i.key,l=bt(et,{key:(a&&!Qr(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function m_(e){return e.some(t=>Ma(t)?!(t.type===Bn||t.type===et&&!m_(t.children)):!0)?e:null}const sf=e=>e?L_(e)?Qc(e):sf(e.parent):null,ba=yn(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=>sf(e.parent),$root:e=>sf(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>v_(e),$forceUpdate:e=>e.f||(e.f=()=>{lp(e.update)}),$nextTick:e=>e.n||(e.n=tn.bind(e.proxy)),$watch:e=>q0.bind(e)}),ed=(e,t)=>e!==Ot&&!e.__isScriptSetup&&Rt(e,t),cS={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 h=i[t];if(h!==void 0)switch(h){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(ed(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];af&&(i[t]=0)}}const c=ba[t];let u,d;if(c)return t==="$attrs"&&Fn(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==Ot&&Rt(n,t))return i[t]=4,n[t];if(d=l.config.globalProperties,Rt(d,t))return d[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:s}=e;return ed(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)||ed(t,a)||Rt(s,a)||Rt(r,a)||Rt(ba,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 uS(){return dS().slots}function dS(e){const t=mp();return t.setupContext||(t.setupContext=O_(t))}function vh(e){return Xe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let af=!0;function fS(e){const t=v_(e),n=e.proxy,r=e.ctx;af=!1,t.beforeCreate&&_h(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:i,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:g,updated:w,activated:E,deactivated:D,beforeDestroy:C,beforeUnmount:I,destroyed:V,unmounted:z,render:ce,renderTracked:re,renderTriggered:Z,errorCaptured:de,serverPrefetch:_e,expose:Te,inheritAttrs:fe,components:H,directives:ee,filters:Se}=t;if(c&&pS(c,r,null),i)for(const Re in i){const ue=i[Re];rt(ue)&&(r[Re]=ue.bind(n))}if(o){const Re=o.call(n,n);Mt(Re)&&(e.data=Gc(Re))}if(af=!0,s)for(const Re in s){const ue=s[Re],Me=rt(ue)?ue.bind(n,n):rt(ue.get)?ue.get.bind(n,n):_o,Pe=!rt(ue)&&rt(ue.set)?ue.set.bind(n):_o,ke=le({get:Me,set:Pe});Object.defineProperty(r,Re,{enumerable:!0,configurable:!0,get:()=>ke.value,set:We=>ke.value=We})}if(a)for(const Re in a)g_(a[Re],r,n,Re);if(l){const Re=rt(l)?l.call(n):l;Reflect.ownKeys(Re).forEach(ue=>{Ql(ue,Re[ue])})}u&&_h(u,e,"c");function ye(Re,ue){Xe(ue)?ue.forEach(Me=>Re(Me.bind(n))):ue&&Re(ue.bind(n))}if(ye(eS,d),ye(vs,h),ye(tS,g),ye(nS,w),ye(X0,E),ye(Q0,D),ye(iS,de),ye(sS,re),ye(oS,Z),ye(Xs,I),ye(Yc,z),ye(rS,_e),Xe(Te))if(Te.length){const Re=e.exposed||(e.exposed={});Te.forEach(ue=>{Object.defineProperty(Re,ue,{get:()=>n[ue],set:Me=>n[ue]=Me,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===_o&&(e.render=ce),fe!=null&&(e.inheritAttrs=fe),H&&(e.components=H),ee&&(e.directives=ee),_e&&cp(e)}function pS(e,t,n=_o){Xe(e)&&(e=lf(e));for(const r in e){const o=e[r];let s;Mt(o)?"default"in o?s=Xr(o.from||r,o.default,!0):s=Xr(o.from||r):s=Xr(o),Hn(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:i=>s.value=i}):t[r]=s}}function _h(e,t,n){eo(Xe(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function g_(e,t,n,r){let o=r.includes(".")?s_(n,r):()=>n[r];if(Zt(e)){const s=t[e];rt(s)&&ct(o,s)}else if(rt(e))ct(o,e.bind(n));else if(Mt(e))if(Xe(e))e.forEach(s=>g_(s,t,n,r));else{const s=rt(e.handler)?e.handler.bind(n):t[e.handler];rt(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(c=>Sc(l,c,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=hS[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const hS={data:yh,props:bh,emits:bh,methods:ha,computed:ha,beforeCreate:Jn,created:Jn,beforeMount:Jn,mounted:Jn,beforeUpdate:Jn,updated:Jn,beforeDestroy:Jn,beforeUnmount:Jn,destroyed:Jn,unmounted:Jn,activated:Jn,deactivated:Jn,errorCaptured:Jn,serverPrefetch:Jn,components:ha,directives:ha,watch:gS,provide:yh,inject:mS};function yh(e,t){return t?e?function(){return yn(rt(e)?e.call(this,this):e,rt(t)?t.call(this,this):t)}:t:e}function mS(e,t){return ha(lf(e),lf(t))}function lf(e){if(Xe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Jn(e,t){return e?[...new Set([].concat(e,t))]:t}function ha(e,t){return e?yn(Object.create(null),e,t):t}function bh(e,t){return e?Xe(e)&&Xe(t)?[...new Set([...e,...t])]:yn(Object.create(null),vh(e),vh(t??{})):t}function gS(e,t){if(!e)return t;if(!t)return e;const n=yn(Object.create(null),e);for(const r in t)n[r]=Jn(e[r],t[r]);return n}function __(){return{app:null,config:{isNativeTag:Iv,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 vS=0;function _S(e,t){return function(r,o=null){rt(r)||(r=yn({},r)),o!=null&&!Mt(o)&&(o=null);const s=__(),i=new WeakSet,a=[];let l=!1;const c=s.app={_uid:vS++,_component:r,_props:o,_container:null,_context:s,_instance:null,version:KS,get config(){return s.config},set config(u){},use(u,...d){return i.has(u)||(u&&rt(u.install)?(i.add(u),u.install(c,...d)):rt(u)&&(i.add(u),u(c,...d))),c},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),c},component(u,d){return d?(s.components[u]=d,c):s.components[u]},directive(u,d){return d?(s.directives[u]=d,c):s.directives[u]},mount(u,d,h){if(!l){const g=c._ceVNode||Ge(r,o);return g.appContext=s,h===!0?h="svg":h===!1&&(h=void 0),e(g,u,h),l=!0,c._container=u,u.__vue_app__=c,Qc(g.component)}},onUnmount(u){a.push(u)},unmount(){l&&(eo(a,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return s.provides[u]=d,c},runWithContext(u){const d=ki;ki=c;try{return u()}finally{ki=d}}};return c}}let ki=null;const yS=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${er(t)}Modifiers`]||e[`${gs(t)}Modifiers`];function bS(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Ot;let o=n;const s=t.startsWith("update:"),i=s&&yS(r,t.slice(7));i&&(i.trim&&(o=n.map(u=>Zt(u)?u.trim():u)),i.number&&(o=n.map(Wc)));let a,l=r[a=Gu(t)]||r[a=Gu(er(t))];!l&&s&&(l=r[a=Gu(gs(t))]),l&&eo(l,e,6,o);const c=r[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,eo(c,e,6,o)}}const wS=new WeakMap;function y_(e,t,n=!1){const r=n?wS:t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let i={},a=!1;if(!rt(e)){const l=c=>{const u=y_(c,t,!0);u&&(a=!0,yn(i,u))};!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):(Xe(s)?s.forEach(l=>i[l]=null):yn(i,s),Mt(e)&&r.set(e,i),i)}function Jc(e,t){return!e||!Bc(t)?!1:(t=t.slice(2).replace(/Once$/,""),Rt(e,t[0].toLowerCase()+t.slice(1))||Rt(e,gs(t))||Rt(e,t))}function wh(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:l,render:c,renderCache:u,props:d,data:h,setupState:g,ctx:w,inheritAttrs:E}=e,D=bc(e);let C,I;try{if(n.shapeFlag&4){const z=o||r,ce=z;C=mo(c.call(ce,z,u,d,g,h,w)),I=a}else{const z=t;C=mo(z.length>1?z(d,{attrs:a,slots:i,emit:l}):z(d,null)),I=t.props?a:SS(a)}}catch(z){wa.length=0,za(z,e,1),C=Ge(Bn)}let V=C;if(I&&E!==!1){const z=Object.keys(I),{shapeFlag:ce}=V;z.length&&ce&7&&(s&&z.some(Uc)&&(I=TS(I,s)),V=fs(V,I,!1,!0))}return n.dirs&&(V=fs(V,null,!1,!0),V.dirs=V.dirs?V.dirs.concat(n.dirs):n.dirs),n.transition&&Aa(V,n.transition),C=V,bc(D),C}const SS=e=>{let t;for(const n in e)(n==="class"||n==="style"||Bc(n))&&((t||(t={}))[n]=e[n]);return t},TS=(e,t)=>{const n={};for(const r in e)(!Uc(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function ES(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:a,patchFlag:l}=t,c=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Sh(r,i,c):!!i;if(l&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(b_(i,r,h)&&!Jc(c,h))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Sh(r,i,c):!0:!!i;return!1}function Sh(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(b_(t,e,s)&&!Jc(n,s))return!0}return!1}function b_(e,t,n){const r=e[n],o=t[n];return n==="style"&&Mt(r)&&Mt(o)?!Hi(r,o):r!==o}function kS({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 w_={},S_=()=>Object.create(w_),T_=e=>Object.getPrototypeOf(e)===w_;function CS(e,t,n,r=!1){const o={},s=S_();e.propsDefaults=Object.create(null),E_(e,t,o,s);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=r?o:Jv(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function xS(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:i}}=e,a=kt(o),[l]=e.propsOptions;let c=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(Jc(e.emitsOptions,h))continue;const g=t[h];if(l)if(Rt(s,h))g!==s[h]&&(s[h]=g,c=!0);else{const w=er(h);o[w]=cf(l,a,w,g,e,!1)}else g!==s[h]&&(s[h]=g,c=!0)}}}else{E_(e,t,o,s)&&(c=!0);let u;for(const d in a)(!t||!Rt(t,d)&&((u=gs(d))===d||!Rt(t,u)))&&(l?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=cf(l,a,d,void 0,e,!0)):delete o[d]);if(s!==a)for(const d in s)(!t||!Rt(t,d))&&(delete s[d],c=!0)}c&&Ro(e.attrs,"set","")}function E_(e,t,n,r){const[o,s]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(ga(l))continue;const c=t[l];let u;o&&Rt(o,u=er(l))?!s||!s.includes(u)?n[u]=c:(a||(a={}))[u]=c:Jc(e.emitsOptions,l)||(!(l in r)||c!==r[l])&&(r[l]=c,i=!0)}if(s){const l=kt(n),c=a||Ot;for(let u=0;u<s.length;u++){const d=s[u];n[d]=cf(o,l,d,c[d],e,!Rt(c,d))}}return i}function cf(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&&rt(l)){const{propsDefaults:c}=o;if(n in c)r=c[n];else{const u=Ka(o);r=c[n]=l.call(null,t),u()}}else r=l;o.ce&&o.ce._setProp(n,r)}i[0]&&(s&&!a?r=!1:i[1]&&(r===""||r===gs(n))&&(r=!0))}return r}const IS=new WeakMap;function k_(e,t,n=!1){const r=n?IS:t.propsCache,o=r.get(e);if(o)return o;const s=e.props,i={},a=[];let l=!1;if(!rt(e)){const u=d=>{l=!0;const[h,g]=k_(d,t,!0);yn(i,h),g&&a.push(...g)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!s&&!l)return Mt(e)&&r.set(e,wi),wi;if(Xe(s))for(let u=0;u<s.length;u++){const d=er(s[u]);Th(d)&&(i[d]=Ot)}else if(s)for(const u in s){const d=er(u);if(Th(d)){const h=s[u],g=i[d]=Xe(h)||rt(h)?{type:h}:yn({},h),w=g.type;let E=!1,D=!0;if(Xe(w))for(let C=0;C<w.length;++C){const I=w[C],V=rt(I)&&I.name;if(V==="Boolean"){E=!0;break}else V==="String"&&(D=!1)}else E=rt(w)&&w.name==="Boolean";g[0]=E,g[1]=D,(E||Rt(g,"default"))&&a.push(d)}}const c=[i,a];return Mt(e)&&r.set(e,c),c}function Th(e){return e[0]!=="$"&&!ga(e)}const dp=e=>e==="_"||e==="_ctx"||e==="$stable",fp=e=>Xe(e)?e.map(mo):[mo(e)],AS=(e,t,n)=>{if(t._n)return t;const r=It((...o)=>fp(t(...o)),n);return r._c=!1,r},C_=(e,t,n)=>{const r=e._ctx;for(const o in e){if(dp(o))continue;const s=e[o];if(rt(s))t[o]=AS(o,s,r);else if(s!=null){const i=fp(s);t[o]=()=>i}}},x_=(e,t)=>{const n=fp(t);e.slots.default=()=>n},I_=(e,t,n)=>{for(const r in t)(n||!dp(r))&&(e[r]=t[r])},RS=(e,t,n)=>{const r=e.slots=S_();if(e.vnode.shapeFlag&32){const o=t._;o?(I_(r,t,n),n&&Pv(r,"_",o,!0)):C_(t,r)}else t&&x_(e,t)},MS=(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:I_(o,t,n):(s=!t.$stable,C_(t,o)),i=t}else t&&(x_(e,t),i={default:1});if(s)for(const a in o)!dp(a)&&i[a]==null&&delete o[a]},Xn=DS;function PS(e){return $S(e)}function $S(e,t){const n=Vc();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:i,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:g=_o,insertStaticContent:w}=e,E=(k,x,q,G=null,Y=null,te=null,oe=void 0,ie=null,pe=!!x.dynamicChildren)=>{if(k===x)return;k&&!Os(k,x)&&(G=Q(k),We(k,Y,te,!0),k=null),x.patchFlag===-2&&(pe=!1,x.dynamicChildren=null);const{type:se,ref:Ue,shapeFlag:$e}=x;switch(se){case Xc:D(k,x,q,G);break;case Bn:C(k,x,q,G);break;case nd:k==null&&I(x,q,G,oe);break;case et:H(k,x,q,G,Y,te,oe,ie,pe);break;default:$e&1?ce(k,x,q,G,Y,te,oe,ie,pe):$e&6?ee(k,x,q,G,Y,te,oe,ie,pe):($e&64||$e&128)&&se.process(k,x,q,G,Y,te,oe,ie,pe,ge)}Ue!=null&&Y?ya(Ue,k&&k.ref,te,x||k,!x):Ue==null&&k&&k.ref!=null&&ya(k.ref,null,te,k,!0)},D=(k,x,q,G)=>{if(k==null)r(x.el=a(x.children),q,G);else{const Y=x.el=k.el;x.children!==k.children&&c(Y,x.children)}},C=(k,x,q,G)=>{k==null?r(x.el=l(x.children||""),q,G):x.el=k.el},I=(k,x,q,G)=>{[k.el,k.anchor]=w(k.children,x,q,G,k.el,k.anchor)},V=({el:k,anchor:x},q,G)=>{let Y;for(;k&&k!==x;)Y=h(k),r(k,q,G),k=Y;r(x,q,G)},z=({el:k,anchor:x})=>{let q;for(;k&&k!==x;)q=h(k),o(k),k=q;o(x)},ce=(k,x,q,G,Y,te,oe,ie,pe)=>{if(x.type==="svg"?oe="svg":x.type==="math"&&(oe="mathml"),k==null)re(x,q,G,Y,te,oe,ie,pe);else{const se=k.el&&k.el._isVueCE?k.el:null;try{se&&se._beginPatch(),_e(k,x,Y,te,oe,ie,pe)}finally{se&&se._endPatch()}}},re=(k,x,q,G,Y,te,oe,ie)=>{let pe,se;const{props:Ue,shapeFlag:$e,transition:Ee,dirs:De}=k;if(pe=k.el=i(k.type,te,Ue&&Ue.is,Ue),$e&8?u(pe,k.children):$e&16&&de(k.children,pe,null,G,Y,td(k,te),oe,ie),De&&Is(k,null,G,"created"),Z(pe,k,k.scopeId,oe,G),Ue){for(const N in Ue)N!=="value"&&!ga(N)&&s(pe,N,null,Ue[N],te,G);"value"in Ue&&s(pe,"value",null,Ue.value,te),(se=Ue.onVnodeBeforeMount)&&co(se,G,k)}De&&Is(k,null,G,"beforeMount");const M=NS(Y,Ee);M&&Ee.beforeEnter(pe),r(pe,x,q),((se=Ue&&Ue.onVnodeMounted)||M||De)&&Xn(()=>{try{se&&co(se,G,k),M&&Ee.enter(pe),De&&Is(k,null,G,"mounted")}finally{}},Y)},Z=(k,x,q,G,Y)=>{if(q&&g(k,q),G)for(let te=0;te<G.length;te++)g(k,G[te]);if(Y){let te=Y.subTree;if(x===te||M_(te.type)&&(te.ssContent===x||te.ssFallback===x)){const oe=Y.vnode;Z(k,oe,oe.scopeId,oe.slotScopeIds,Y.parent)}}},de=(k,x,q,G,Y,te,oe,ie,pe=0)=>{for(let se=pe;se<k.length;se++){const Ue=k[se]=ie?Ao(k[se]):mo(k[se]);E(null,Ue,x,q,G,Y,te,oe,ie)}},_e=(k,x,q,G,Y,te,oe)=>{const ie=x.el=k.el;let{patchFlag:pe,dynamicChildren:se,dirs:Ue}=x;pe|=k.patchFlag&16;const $e=k.props||Ot,Ee=x.props||Ot;let De;if(q&&Rs(q,!1),(De=Ee.onVnodeBeforeUpdate)&&co(De,q,x,k),Ue&&Is(x,k,q,"beforeUpdate"),q&&Rs(q,!0),($e.innerHTML&&Ee.innerHTML==null||$e.textContent&&Ee.textContent==null)&&u(ie,""),se?Te(k.dynamicChildren,se,ie,q,G,td(x,Y),te):oe||ue(k,x,ie,null,q,G,td(x,Y),te,!1),pe>0){if(pe&16)fe(ie,$e,Ee,q,Y);else if(pe&2&&$e.class!==Ee.class&&s(ie,"class",null,Ee.class,Y),pe&4&&s(ie,"style",$e.style,Ee.style,Y),pe&8){const M=x.dynamicProps;for(let N=0;N<M.length;N++){const F=M[N],ne=$e[F],he=Ee[F];(he!==ne||F==="value")&&s(ie,F,ne,he,Y,q)}}pe&1&&k.children!==x.children&&u(ie,x.children)}else!oe&&se==null&&fe(ie,$e,Ee,q,Y);((De=Ee.onVnodeUpdated)||Ue)&&Xn(()=>{De&&co(De,q,x,k),Ue&&Is(x,k,q,"updated")},G)},Te=(k,x,q,G,Y,te,oe)=>{for(let ie=0;ie<x.length;ie++){const pe=k[ie],se=x[ie],Ue=pe.el&&(pe.type===et||!Os(pe,se)||pe.shapeFlag&198)?d(pe.el):q;E(pe,se,Ue,null,G,Y,te,oe,!0)}},fe=(k,x,q,G,Y)=>{if(x!==q){if(x!==Ot)for(const te in x)!ga(te)&&!(te in q)&&s(k,te,x[te],null,Y,G);for(const te in q){if(ga(te))continue;const oe=q[te],ie=x[te];oe!==ie&&te!=="value"&&s(k,te,ie,oe,Y,G)}"value"in q&&s(k,"value",x.value,q.value,Y)}},H=(k,x,q,G,Y,te,oe,ie,pe)=>{const se=x.el=k?k.el:a(""),Ue=x.anchor=k?k.anchor:a("");let{patchFlag:$e,dynamicChildren:Ee,slotScopeIds:De}=x;De&&(ie=ie?ie.concat(De):De),k==null?(r(se,q,G),r(Ue,q,G),de(x.children||[],q,Ue,Y,te,oe,ie,pe)):$e>0&&$e&64&&Ee&&k.dynamicChildren&&k.dynamicChildren.length===Ee.length?(Te(k.dynamicChildren,Ee,q,Y,te,oe,ie),(x.key!=null||Y&&x===Y.subTree)&&pp(k,x,!0)):ue(k,x,q,Ue,Y,te,oe,ie,pe)},ee=(k,x,q,G,Y,te,oe,ie,pe)=>{x.slotScopeIds=ie,k==null?x.shapeFlag&512?Y.ctx.activate(x,q,G,oe,pe):Se(x,q,G,Y,te,oe,pe):Ne(k,x,pe)},Se=(k,x,q,G,Y,te,oe)=>{const ie=k.component=HS(k,G,Y);if(Ga(k)&&(ie.ctx.renderer=ge),qS(ie,!1,oe),ie.asyncDep){if(Y&&Y.registerDep(ie,ye,oe),!k.el){const pe=ie.subTree=Ge(Bn);C(null,pe,x,q),k.placeholder=pe.el}}else ye(ie,k,x,q,Y,te,oe)},Ne=(k,x,q)=>{const G=x.component=k.component;if(ES(k,x,q))if(G.asyncDep&&!G.asyncResolved){Re(G,x,q);return}else G.next=x,G.update();else x.el=k.el,G.vnode=x},ye=(k,x,q,G,Y,te,oe)=>{const ie=()=>{if(k.isMounted){let{next:$e,bu:Ee,u:De,parent:M,vnode:N}=k;{const Oe=A_(k);if(Oe){$e&&($e.el=N.el,Re(k,$e,oe)),Oe.asyncDep.then(()=>{Xn(()=>{k.isUnmounted||se()},Y)});return}}let F=$e,ne;Rs(k,!1),$e?($e.el=N.el,Re(k,$e,oe)):$e=N,Ee&&Xl(Ee),(ne=$e.props&&$e.props.onVnodeBeforeUpdate)&&co(ne,M,$e,N),Rs(k,!0);const he=wh(k),je=k.subTree;k.subTree=he,E(je,he,d(je.el),Q(je),k,Y,te),$e.el=he.el,F===null&&kS(k,he.el),De&&Xn(De,Y),(ne=$e.props&&$e.props.onVnodeUpdated)&&Xn(()=>co(ne,M,$e,N),Y)}else{let $e;const{el:Ee,props:De}=x,{bm:M,m:N,parent:F,root:ne,type:he}=k,je=Ei(x);Rs(k,!1),M&&Xl(M),!je&&($e=De&&De.onVnodeBeforeMount)&&co($e,F,x),Rs(k,!0);{ne.ce&&ne.ce._hasShadowRoot()&&ne.ce._injectChildStyle(he,k.parent?k.parent.type:void 0);const Oe=k.subTree=wh(k);E(null,Oe,q,G,k,Y,te),x.el=Oe.el}if(N&&Xn(N,Y),!je&&($e=De&&De.onVnodeMounted)){const Oe=x;Xn(()=>co($e,F,Oe),Y)}(x.shapeFlag&256||F&&Ei(F.vnode)&&F.vnode.shapeFlag&256)&&k.a&&Xn(k.a,Y),k.isMounted=!0,x=q=G=null}};k.scope.on();const pe=k.effect=new Dv(ie);k.scope.off();const se=k.update=pe.run.bind(pe),Ue=k.job=pe.runIfDirty.bind(pe);Ue.i=k,Ue.id=k.uid,pe.scheduler=()=>lp(Ue),Rs(k,!0),se()},Re=(k,x,q)=>{x.component=k;const G=k.vnode.props;k.vnode=x,k.next=null,xS(k,x.props,G,q),MS(k,x.children,q),Oo(),ch(k),Fo()},ue=(k,x,q,G,Y,te,oe,ie,pe=!1)=>{const se=k&&k.children,Ue=k?k.shapeFlag:0,$e=x.children,{patchFlag:Ee,shapeFlag:De}=x;if(Ee>0){if(Ee&128){Pe(se,$e,q,G,Y,te,oe,ie,pe);return}else if(Ee&256){Me(se,$e,q,G,Y,te,oe,ie,pe);return}}De&8?(Ue&16&&Ke(se,Y,te),$e!==se&&u(q,$e)):Ue&16?De&16?Pe(se,$e,q,G,Y,te,oe,ie,pe):Ke(se,Y,te,!0):(Ue&8&&u(q,""),De&16&&de($e,q,G,Y,te,oe,ie,pe))},Me=(k,x,q,G,Y,te,oe,ie,pe)=>{k=k||wi,x=x||wi;const se=k.length,Ue=x.length,$e=Math.min(se,Ue);let Ee;for(Ee=0;Ee<$e;Ee++){const De=x[Ee]=pe?Ao(x[Ee]):mo(x[Ee]);E(k[Ee],De,q,null,Y,te,oe,ie,pe)}se>Ue?Ke(k,Y,te,!0,!1,$e):de(x,q,G,Y,te,oe,ie,pe,$e)},Pe=(k,x,q,G,Y,te,oe,ie,pe)=>{let se=0;const Ue=x.length;let $e=k.length-1,Ee=Ue-1;for(;se<=$e&&se<=Ee;){const De=k[se],M=x[se]=pe?Ao(x[se]):mo(x[se]);if(Os(De,M))E(De,M,q,null,Y,te,oe,ie,pe);else break;se++}for(;se<=$e&&se<=Ee;){const De=k[$e],M=x[Ee]=pe?Ao(x[Ee]):mo(x[Ee]);if(Os(De,M))E(De,M,q,null,Y,te,oe,ie,pe);else break;$e--,Ee--}if(se>$e){if(se<=Ee){const De=Ee+1,M=De<Ue?x[De].el:G;for(;se<=Ee;)E(null,x[se]=pe?Ao(x[se]):mo(x[se]),q,M,Y,te,oe,ie,pe),se++}}else if(se>Ee)for(;se<=$e;)We(k[se],Y,te,!0),se++;else{const De=se,M=se,N=new Map;for(se=M;se<=Ee;se++){const Tt=x[se]=pe?Ao(x[se]):mo(x[se]);Tt.key!=null&&N.set(Tt.key,se)}let F,ne=0;const he=Ee-M+1;let je=!1,Oe=0;const ot=new Array(he);for(se=0;se<he;se++)ot[se]=0;for(se=De;se<=$e;se++){const Tt=k[se];if(ne>=he){We(Tt,Y,te,!0);continue}let Pt;if(Tt.key!=null)Pt=N.get(Tt.key);else for(F=M;F<=Ee;F++)if(ot[F-M]===0&&Os(Tt,x[F])){Pt=F;break}Pt===void 0?We(Tt,Y,te,!0):(ot[Pt-M]=se+1,Pt>=Oe?Oe=Pt:je=!0,E(Tt,x[Pt],q,null,Y,te,oe,ie,pe),ne++)}const tt=je?LS(ot):wi;for(F=tt.length-1,se=he-1;se>=0;se--){const Tt=M+se,Pt=x[Tt],ut=x[Tt+1],rn=Tt+1<Ue?ut.el||R_(ut):G;ot[se]===0?E(null,Pt,q,rn,Y,te,oe,ie,pe):je&&(F<0||se!==tt[F]?ke(Pt,q,rn,2):F--)}}},ke=(k,x,q,G,Y=null)=>{const{el:te,type:oe,transition:ie,children:pe,shapeFlag:se}=k;if(se&6){ke(k.component.subTree,x,q,G);return}if(se&128){k.suspense.move(x,q,G);return}if(se&64){oe.move(k,x,q,ge);return}if(oe===et){r(te,x,q);for(let $e=0;$e<pe.length;$e++)ke(pe[$e],x,q,G);r(k.anchor,x,q);return}if(oe===nd){V(k,x,q);return}if(G!==2&&se&1&&ie)if(G===0)ie.beforeEnter(te),r(te,x,q),Xn(()=>ie.enter(te),Y);else{const{leave:$e,delayLeave:Ee,afterLeave:De}=ie,M=()=>{k.ctx.isUnmounted?o(te):r(te,x,q)},N=()=>{te._isLeaving&&te[po](!0),$e(te,()=>{M(),De&&De()})};Ee?Ee(te,M,N):N()}else r(te,x,q)},We=(k,x,q,G=!1,Y=!1)=>{const{type:te,props:oe,ref:ie,children:pe,dynamicChildren:se,shapeFlag:Ue,patchFlag:$e,dirs:Ee,cacheIndex:De,memo:M}=k;if($e===-2&&(Y=!1),ie!=null&&(Oo(),ya(ie,null,q,k,!0),Fo()),De!=null&&(x.renderCache[De]=void 0),Ue&256){x.ctx.deactivate(k);return}const N=Ue&1&&Ee,F=!Ei(k);let ne;if(F&&(ne=oe&&oe.onVnodeBeforeUnmount)&&co(ne,x,k),Ue&6)st(k.component,q,G);else{if(Ue&128){k.suspense.unmount(q,G);return}N&&Is(k,null,x,"beforeUnmount"),Ue&64?k.type.remove(k,x,q,ge,G):se&&!se.hasOnce&&(te!==et||$e>0&&$e&64)?Ke(se,x,q,!1,!0):(te===et&&$e&384||!Y&&Ue&16)&&Ke(pe,x,q),G&&Ye(k)}const he=M!=null&&De==null;(F&&(ne=oe&&oe.onVnodeUnmounted)||N||he)&&Xn(()=>{ne&&co(ne,x,k),N&&Is(k,null,x,"unmounted"),he&&(k.el=null)},q)},Ye=k=>{const{type:x,el:q,anchor:G,transition:Y}=k;if(x===et){Je(q,G);return}if(x===nd){z(k);return}const te=()=>{o(q),Y&&!Y.persisted&&Y.afterLeave&&Y.afterLeave()};if(k.shapeFlag&1&&Y&&!Y.persisted){const{leave:oe,delayLeave:ie}=Y,pe=()=>oe(q,te);ie?ie(k.el,te,pe):pe()}else te()},Je=(k,x)=>{let q;for(;k!==x;)q=h(k),o(k),k=q;o(x)},st=(k,x,q)=>{const{bum:G,scope:Y,job:te,subTree:oe,um:ie,m:pe,a:se}=k;Eh(pe),Eh(se),G&&Xl(G),Y.stop(),te&&(te.flags|=8,We(oe,k,x,q)),ie&&Xn(ie,x),Xn(()=>{k.isUnmounted=!0},x)},Ke=(k,x,q,G=!1,Y=!1,te=0)=>{for(let oe=te;oe<k.length;oe++)We(k[oe],x,q,G,Y)},Q=k=>{if(k.shapeFlag&6)return Q(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const x=h(k.anchor||k.el),q=x&&x[i_];return q?h(q):x};let me=!1;const be=(k,x,q)=>{let G;k==null?x._vnode&&(We(x._vnode,null,null,!0),G=x._vnode.component):E(x._vnode||null,k,x,null,null,null,q),x._vnode=k,me||(me=!0,ch(G),t_(),me=!1)},ge={p:E,um:We,m:ke,r:Ye,mt:Se,mc:de,pc:ue,pbc:Te,n:Q,o:e};return{render:be,hydrate:void 0,createApp:_S(be)}}function td({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 Rs({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function NS(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function pp(e,t,n=!1){const r=e.children,o=t.children;if(Xe(r)&&Xe(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]=Ao(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&pp(i,a)),a.type===Xc&&(a.patchFlag===-1&&(a=o[s]=Ao(a)),a.el=i.el),a.type===Bn&&!a.el&&(a.el=i.el)}}function LS(e){const t=e.slice(),n=[0];let r,o,s,i,a;const l=e.length;for(r=0;r<l;r++){const c=e[r];if(c!==0){if(o=n[n.length-1],e[o]<c){t[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)a=s+i>>1,e[n[a]]<c?s=a+1:i=a;c<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 A_(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:A_(t)}function Eh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function R_(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?R_(t.subTree):null}const M_=e=>e.__isSuspense;function DS(e,t){t&&t.pendingBranch?Xe(e)?t.effects.push(...e):t.effects.push(e):B0(e)}const et=Symbol.for("v-fgt"),Xc=Symbol.for("v-txt"),Bn=Symbol.for("v-cmt"),nd=Symbol.for("v-stc"),wa=[];let vr=null;function A(e=!1){wa.push(vr=e?null:[])}function OS(){wa.pop(),vr=wa[wa.length-1]||null}let Ra=1;function Tc(e,t=!1){Ra+=e,e<0&&vr&&t&&(vr.hasOnce=!0)}function P_(e){return e.dynamicChildren=Ra>0?vr||wi:null,OS(),Ra>0&&vr&&vr.push(e),e}function O(e,t,n,r,o,s){return P_(_(e,t,n,r,o,s,!0))}function bt(e,t,n,r,o){return P_(Ge(e,t,n,r,o,!0))}function Ma(e){return e?e.__v_isVNode===!0:!1}function Os(e,t){return e.type===t.type&&e.key===t.key}const $_=({key:e})=>e??null,ec=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Zt(e)||Hn(e)||rt(e)?{i:Mn,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,r=0,o=null,s=e===et?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&$_(t),ref:t&&ec(t),scopeId:r_,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:Mn};return a?(hp(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=Zt(n)?8:16),Ra>0&&!i&&vr&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&vr.push(l),l}const Ge=FS;function FS(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===h_)&&(e=Bn),Ma(e)){const a=fs(e,t,!0);return n&&hp(a,n),Ra>0&&!s&&vr&&(a.shapeFlag&6?vr[vr.indexOf(e)]=a:vr.push(a)),a.patchFlag=-2,a}if(GS(e)&&(e=e.__vccOpts),t){t=jS(t);let{class:a,style:l}=t;a&&!Zt(a)&&(t.class=ht(a)),Mt(l)&&(ap(l)&&!Xe(l)&&(l=yn({},l)),t.style=Po(l))}const i=Zt(e)?1:M_(e)?128:a_(e)?64:Mt(e)?4:rt(e)?2:0;return _(e,t,n,r,o,i,s,!0)}function jS(e){return e?ap(e)||T_(e)?yn({},e):e:null}function fs(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:l}=e,c=t?N_(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&$_(c),ref:t&&t.ref?n&&s?Xe(s)?s.concat(ec(t)):[s,ec(t)]:ec(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!==et?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&&fs(e.ssContent),ssFallback:e.ssFallback&&fs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Aa(u,l.clone(u)),u}function Vs(e=" ",t=0){return Ge(Xc,null,e,t)}function Ce(e="",t=!1){return t?(A(),bt(Bn,null,e)):Ge(Bn,null,e)}function mo(e){return e==null||typeof e=="boolean"?Ge(Bn):Xe(e)?Ge(et,null,e.slice()):Ma(e)?Ao(e):Ge(Xc,null,String(e))}function Ao(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:fs(e)}function hp(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Xe(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),hp(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!T_(t)?t._ctx=Mn:o===3&&Mn&&(Mn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else rt(t)?(t={default:t,_ctx:Mn},n=32):(t=String(t),r&64?(n=16,t=[Vs(t)]):n=8);e.children=t,e.shapeFlag|=n}function N_(...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=Po([t.style,r.style]);else if(Bc(o)){const s=t[o],i=r[o];i&&s!==i&&!(Xe(s)&&s.includes(i))?t[o]=s?[].concat(s,i):i:i==null&&s==null&&!Uc(o)&&(t[o]=i)}else o!==""&&(t[o]=r[o])}return t}function co(e,t,n,r=null){eo(e,t,7,[n,r])}const BS=__();let US=0;function HS(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||BS,s={uid:US++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new u0(!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:k_(r,o),emitsOptions:y_(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=bS.bind(null,s),e.ce&&e.ce(s),s}let Rn=null;const mp=()=>Rn||Mn;let Ec,uf;{const e=Vc(),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)}};Ec=t("__VUE_INSTANCE_SETTERS__",n=>Rn=n),uf=t("__VUE_SSR_SETTERS__",n=>Ai=n)}const Ka=e=>{const t=Rn;return Ec(e),e.scope.on(),()=>{e.scope.off(),Ec(t)}},kh=()=>{Rn&&Rn.scope.off(),Ec(null)};function L_(e){return e.vnode.shapeFlag&4}let Ai=!1;function qS(e,t=!1,n=!1){t&&uf(t);const{props:r,children:o}=e.vnode,s=L_(e);CS(e,r,s,t),RS(e,o,n||t);const i=s?WS(e,t):void 0;return t&&uf(!1),i}function WS(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,cS);const{setup:r}=n;if(r){Oo();const o=e.setupContext=r.length>1?O_(e):null,s=Ka(e),i=Va(r,e,0,[e.props,o]),a=Av(i);if(Fo(),s(),(a||e.sp)&&!Ei(e)&&cp(e),a){if(i.then(kh,kh),t)return i.then(l=>{Ch(e,l)}).catch(l=>{za(l,e,0)});e.asyncDep=i}else Ch(e,i)}else D_(e)}function Ch(e,t,n){rt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Mt(t)&&(e.setupState=Qv(t)),D_(e)}function D_(e,t,n){const r=e.type;e.render||(e.render=r.render||_o);{const o=Ka(e);Oo();try{fS(e)}finally{Fo(),o()}}}const VS={get(e,t){return Fn(e,"get",""),e[t]}};function O_(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,VS),slots:e.slots,emit:e.emit,expose:t}}function Qc(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Qv(R0(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ba)return ba[n](e)},has(t,n){return n in t||n in ba}})):e.proxy}function zS(e,t=!0){return rt(e)?e.displayName||e.name:e.name||t&&e.__name}function GS(e){return rt(e)&&"__vccOpts"in e}const le=(e,t)=>L0(e,t,Ai);function gp(e,t,n){try{Tc(-1);const r=arguments.length;return r===2?Mt(t)&&!Xe(t)?Ma(t)?Ge(e,null,[t]):Ge(e,t):Ge(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ma(n)&&(n=[n]),Ge(e,t,n))}finally{Tc(1)}}const KS="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 df;const xh=typeof window<"u"&&window.trustedTypes;if(xh)try{df=xh.createPolicy("vue",{createHTML:e=>e})}catch{}const F_=df?e=>df.createHTML(e):e=>e,YS="http://www.w3.org/2000/svg",JS="http://www.w3.org/1998/Math/MathML",xo=typeof document<"u"?document:null,Ih=xo&&xo.createElement("template"),XS={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"?xo.createElementNS(YS,e):t==="mathml"?xo.createElementNS(JS,e):n?xo.createElement(e,{is:n}):xo.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>xo.createTextNode(e),createComment:e=>xo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>xo.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{Ih.innerHTML=F_(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Ih.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]}},Xo="transition",ca="animation",Pa=Symbol("_vtc"),j_={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},QS=yn({},l_,j_),ZS=e=>(e.displayName="Transition",e.props=QS,e),B_=ZS((e,{slots:t})=>gp(Y0,eT(e),t)),Ms=(e,t=[])=>{Xe(e)?e.forEach(n=>n(...t)):e&&e(...t)},Ah=e=>e?Xe(e)?e.some(t=>t.length>1):e.length>1:!1;function eT(e){const t={};for(const H in e)H in j_||(t[H]=e[H]);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:c=i,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:g=`${n}-leave-to`}=e,w=tT(o),E=w&&w[0],D=w&&w[1],{onBeforeEnter:C,onEnter:I,onEnterCancelled:V,onLeave:z,onLeaveCancelled:ce,onBeforeAppear:re=C,onAppear:Z=I,onAppearCancelled:de=V}=t,_e=(H,ee,Se,Ne)=>{H._enterCancelled=Ne,Ps(H,ee?u:a),Ps(H,ee?c:i),Se&&Se()},Te=(H,ee)=>{H._isLeaving=!1,Ps(H,d),Ps(H,g),Ps(H,h),ee&&ee()},fe=H=>(ee,Se)=>{const Ne=H?Z:I,ye=()=>_e(ee,H,Se);Ms(Ne,[ee,ye]),Rh(()=>{Ps(ee,H?l:s),Eo(ee,H?u:a),Ah(Ne)||Mh(ee,r,E,ye)})};return yn(t,{onBeforeEnter(H){Ms(C,[H]),Eo(H,s),Eo(H,i)},onBeforeAppear(H){Ms(re,[H]),Eo(H,l),Eo(H,c)},onEnter:fe(!1),onAppear:fe(!0),onLeave(H,ee){H._isLeaving=!0;const Se=()=>Te(H,ee);Eo(H,d),H._enterCancelled?(Eo(H,h),Nh(H)):(Nh(H),Eo(H,h)),Rh(()=>{H._isLeaving&&(Ps(H,d),Eo(H,g),Ah(z)||Mh(H,r,D,Se))}),Ms(z,[H,Se])},onEnterCancelled(H){_e(H,!1,void 0,!0),Ms(V,[H])},onAppearCancelled(H){_e(H,!0,void 0,!0),Ms(de,[H])},onLeaveCancelled(H){Te(H),Ms(ce,[H])}})}function tT(e){if(e==null)return null;if(Mt(e))return[rd(e.enter),rd(e.leave)];{const t=rd(e);return[t,t]}}function rd(e){return n0(e)}function Eo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Pa]||(e[Pa]=new Set)).add(t)}function Ps(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Pa];n&&(n.delete(t),n.size||(e[Pa]=void 0))}function Rh(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let nT=0;function Mh(e,t,n,r){const o=e._endId=++nT,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:a,propCount:l}=rT(e,t);if(!i)return r();const c=i+"end";let u=0;const d=()=>{e.removeEventListener(c,h),s()},h=g=>{g.target===e&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),e.addEventListener(c,h)}function rT(e,t){const n=window.getComputedStyle(e),r=w=>(n[w]||"").split(", "),o=r(`${Xo}Delay`),s=r(`${Xo}Duration`),i=Ph(o,s),a=r(`${ca}Delay`),l=r(`${ca}Duration`),c=Ph(a,l);let u=null,d=0,h=0;t===Xo?i>0&&(u=Xo,d=i,h=s.length):t===ca?c>0&&(u=ca,d=c,h=l.length):(d=Math.max(i,c),u=d>0?i>c?Xo:ca:null,h=u?u===Xo?s.length:l.length:0);const g=u===Xo&&/\b(?:transform|all)(?:,|$)/.test(r(`${Xo}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:g}}function Ph(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>$h(n)+$h(e[r])))}function $h(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Nh(e){return(e?e.ownerDocument:document).body.offsetHeight}function oT(e,t,n){const r=e[Pa];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Lh=Symbol("_vod"),sT=Symbol("_vsh"),iT=Symbol(""),aT=/(?:^|;)\s*display\s*:/;function lT(e,t,n){const r=e.style,o=Zt(n);let s=!1;if(n&&!o){if(t)if(Zt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&tc(r,a,"")}else for(const i in t)n[i]==null&&tc(r,i,"");for(const i in n)i==="display"&&(s=!0),tc(r,i,n[i])}else if(o){if(t!==n){const i=r[iT];i&&(n+=";"+i),r.cssText=n,s=aT.test(n)}}else t&&e.removeAttribute("style");Lh in e&&(e[Lh]=s?r.display:"",e[sT]&&(r.display="none"))}const Dh=/\s*!important$/;function tc(e,t,n){if(Xe(n))n.forEach(r=>tc(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=cT(e,t);Dh.test(n)?e.setProperty(gs(r),n.replace(Dh,""),"important"):e[r]=n}}const Oh=["Webkit","Moz","ms"],od={};function cT(e,t){const n=od[t];if(n)return n;let r=er(t);if(r!=="filter"&&r in e)return od[t]=r;r=qc(r);for(let o=0;o<Oh.length;o++){const s=Oh[o]+r;if(s in e)return od[t]=s}return t}const Fh="http://www.w3.org/1999/xlink";function jh(e,t,n,r,o,s=l0(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Fh,t.slice(6,t.length)):e.setAttributeNS(Fh,t,n):n==null||s&&!$v(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Qr(n)?String(n):n)}function Bh(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?F_(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=$v(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 is(e,t,n,r){e.addEventListener(t,n,r)}function uT(e,t,n,r){e.removeEventListener(t,n,r)}const Uh=Symbol("_vei");function dT(e,t,n,r,o=null){const s=e[Uh]||(e[Uh]={}),i=s[t];if(r&&i)i.value=r;else{const[a,l]=fT(t);if(r){const c=s[t]=mT(r,o);is(e,a,c,l)}else i&&(uT(e,a,i,l),s[t]=void 0)}}const Hh=/(?:Once|Passive|Capture)$/;function fT(e){let t;if(Hh.test(e)){t={};let r;for(;r=e.match(Hh);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):gs(e.slice(2)),t]}let sd=0;const pT=Promise.resolve(),hT=()=>sd||(pT.then(()=>sd=0),sd=Date.now());function mT(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;eo(gT(r,n.value),t,5,[r])};return n.value=e,n.attached=hT(),n}function gT(e,t){if(Xe(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 qh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,vT=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?oT(e,r,i):t==="style"?lT(e,n,r):Bc(t)?Uc(t)||dT(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):_T(e,t,r,i))?(Bh(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&jh(e,t,r,i,s,t!=="value")):e._isVueCE&&(yT(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Zt(r)))?Bh(e,er(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),jh(e,t,r,i))};function _T(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&qh(t)&&rt(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 qh(t)&&Zt(n)?!1:t in e}function yT(e,t){const n=e._def.props;if(!n)return!1;const r=er(t);return Array.isArray(n)?n.some(o=>er(o)===r):Object.keys(n).some(o=>er(o)===r)}const Ri=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Xe(t)?n=>Xl(t,n):t};function bT(e){e.target.composing=!0}function Wh(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const $o=Symbol("_assign");function Vh(e,t,n){return t&&(e=e.trim()),n&&(e=Wc(e)),e}const yo={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[$o]=Ri(o);const s=r||o.props&&o.props.type==="number";is(e,t?"change":"input",i=>{i.target.composing||e[$o](Vh(e.value,n,s))}),(n||s)&&is(e,"change",()=>{e.value=Vh(e.value,n,s)}),t||(is(e,"compositionstart",bT),is(e,"compositionend",Wh),is(e,"change",Wh))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(e[$o]=Ri(i),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?Wc(e.value):e.value,l=t??"";if(a===l)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===l)||(e.value=l)}},wT={deep:!0,created(e,t,n){e[$o]=Ri(n),is(e,"change",()=>{const r=e._modelValue,o=$a(e),s=e.checked,i=e[$o];if(Xe(r)){const a=ep(r,o),l=a!==-1;if(s&&!l)i(r.concat(o));else if(!s&&l){const c=[...r];c.splice(a,1),i(c)}}else if(Ui(r)){const a=new Set(r);s?a.add(o):a.delete(o),i(a)}else i(U_(e,s))})},mounted:zh,beforeUpdate(e,t,n){e[$o]=Ri(n),zh(e,t,n)}};function zh(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(Xe(t))o=ep(t,r.props.value)>-1;else if(Ui(t))o=t.has(r.props.value);else{if(t===n)return;o=Hi(t,U_(e,!0))}e.checked!==o&&(e.checked=o)}const H3={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=Ui(t);is(e,"change",()=>{const s=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?Wc($a(i)):$a(i));e[$o](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,tn(()=>{e._assigning=!1})}),e[$o]=Ri(r)},mounted(e,{value:t}){Gh(e,t)},beforeUpdate(e,t,n){e[$o]=Ri(n)},updated(e,{value:t}){e._assigning||Gh(e,t)}};function Gh(e,t){const n=e.multiple,r=Xe(t);if(!(n&&!r&&!Ui(t))){for(let o=0,s=e.options.length;o<s;o++){const i=e.options[o],a=$a(i);if(n)if(r){const l=typeof a;l==="string"||l==="number"?i.selected=t.some(c=>String(c)===String(a)):i.selected=ep(t,a)>-1}else i.selected=t.has(a);else if(Hi($a(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function $a(e){return"_value"in e?e._value:e.value}function U_(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const ST=["ctrl","shift","alt","meta"],TT={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)=>ST.some(n=>e[`${n}Key`]&&!t.includes(n))},wt=(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=TT[t[i]];if(a&&a(o,t))return}return e(o,...s)}))},ET={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},xn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(o=>{if(!("key"in o))return;const s=gs(o.key);if(t.some(i=>i===s||ET[i]===s))return e(o)}))},kT=yn({patchProp:vT},XS);let Kh;function CT(){return Kh||(Kh=PS(kT))}const xT=((...e)=>{const t=CT().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=AT(r);if(!o)return;const s=t._component;!rt(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,IT(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function IT(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function AT(e){return Zt(e)?document.querySelector(e):e}const Ve=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,gt=globalThis,zs="10.48.0";function Qs(){return Zc(gt),gt}function Zc(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||zs,t[zs]=t[zs]||{}}function qi(e,t,n=gt){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[zs]=r[zs]||{};return o[e]||(o[e]=t())}const RT=["debug","info","warn","error","log","assert","trace"],MT="Sentry Logger ",kc={};function Go(e){if(!("console"in gt))return e();const t=gt.console,n={},r=Object.keys(kc);r.forEach(o=>{const s=kc[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function PT(){_p().enabled=!0}function $T(){_p().enabled=!1}function H_(){return _p().enabled}function NT(...e){vp("log",...e)}function LT(...e){vp("warn",...e)}function DT(...e){vp("error",...e)}function vp(e,...t){Ve&&H_()&&Go(()=>{gt.console[e](`${MT}[${e}]:`,...t)})}function _p(){return Ve?qi("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Ie={enable:PT,disable:$T,isEnabled:H_,log:NT,warn:LT,error:DT},q_=50,Js="?",Yh=/\(error: (.*)\)/,Jh=/captureMessage|captureException/;function W_(...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 c=Yh.test(l)?l.replace(Yh,"$1"):l;if(!c.includes("Error: ")){for(const u of t){const d=u(c);if(d){s.push(d);break}}if(s.length>=q_+o)break}}return FT(s.slice(o))}}function OT(e){return Array.isArray(e)?W_(...e):e}function FT(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Ol(t).function||"")&&t.pop(),t.reverse(),Jh.test(Ol(t).function||"")&&(t.pop(),Jh.test(Ol(t).function||"")&&t.pop()),t.slice(0,q_).map(n=>({...n,filename:n.filename||Ol(t).filename,function:n.function||Js}))}function Ol(e){return e[e.length-1]||{}}const id="<anonymous>";function Bo(e){try{return!e||typeof e!="function"?id:e.name||id}catch{return id}}function Xh(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 V_(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const nc={},Qh={};function _s(e,t){nc[e]=nc[e]||[],nc[e].push(t)}function ys(e,t){if(!Qh[e]){Qh[e]=!0;try{t()}catch(n){Ve&&Ie.error(`Error while instrumenting ${e}`,n)}}}function Mr(e,t){const n=e&&nc[e];if(n)for(const r of n)try{r(t)}catch(o){Ve&&Ie.error(`Error while triggering instrumentation handler.
|
|
20
|
+
Type: ${e}
|
|
21
|
+
Name: ${Bo(r)}
|
|
22
|
+
Error:`,o)}}let ad=null;function z_(e){const t="error";_s(t,e),ys(t,jT)}function jT(){ad=gt.onerror,gt.onerror=function(e,t,n,r,o){return Mr("error",{column:r,error:o,line:n,msg:e,url:t}),ad?ad.apply(this,arguments):!1},gt.onerror.__SENTRY_INSTRUMENTED__=!0}let ld=null;function G_(e){const t="unhandledrejection";_s(t,e),ys(t,BT)}function BT(){ld=gt.onunhandledrejection,gt.onunhandledrejection=function(e){return Mr("unhandledrejection",e),ld?ld.apply(this,arguments):!0},gt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const K_=Object.prototype.toString;function eu(e){switch(K_.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Uo(e,Error)}}function Wi(e,t){return K_.call(e)===`[object ${t}]`}function Y_(e){return Wi(e,"ErrorEvent")}function Zh(e){return Wi(e,"DOMError")}function UT(e){return Wi(e,"DOMException")}function No(e){return Wi(e,"String")}function yp(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Mi(e){return e===null||yp(e)||typeof e!="object"&&typeof e!="function"}function Na(e){return Wi(e,"Object")}function tu(e){return typeof Event<"u"&&Uo(e,Event)}function HT(e){return typeof Element<"u"&&Uo(e,Element)}function qT(e){return Wi(e,"RegExp")}function Vi(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function WT(e){return Na(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Uo(e,t){try{return e instanceof t}catch{return!1}}function J_(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function bp(e){return typeof Request<"u"&&Uo(e,Request)}const wp=gt,VT=80;function Lr(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 c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||VT;for(;n&&s++<r&&(c=zT(n,u),!(c==="html"||s>1&&i+o.length*l+c.length>=d));)o.push(c),i+=c.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(wp.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&&No(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 zi(){try{return wp.document.location.href}catch{return""}}function X_(e){if(!wp.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 _r(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const o=n(r);typeof o=="function"&&Q_(o,r);try{e[t]=o}catch{Ve&&Ie.log(`Failed to replace method "${t}" in object`,e)}}function ur(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Ve&&Ie.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Q_(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,ur(e,"__sentry_original__",t)}catch{}}function Sp(e){return e.__sentry_original__}function Z_(e){if(eu(e))return{message:e.message,name:e.name,stack:e.stack,...tm(e)};if(tu(e)){const t={type:e.type,target:em(e.target),currentTarget:em(e.currentTarget),...tm(e)};return typeof CustomEvent<"u"&&Uo(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function em(e){try{return HT(e)?Lr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function tm(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function GT(e){const t=Object.keys(Z_(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let ci;function Ya(e){if(ci!==void 0)return ci?ci(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=gt;return t in n&&typeof n[t]=="function"?(ci=n[t],ci(e)):(ci=null,e())}function ls(){return Ya(()=>Math.random())}function Ja(){return Ya(()=>Date.now())}function ff(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function nm(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const o=e[r];try{J_(o)?n.push(V_(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function rc(e,t,n=!1){return No(e)?qT(t)?t.test(e):No(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function cs(e,t=[],n=!1){return t.some(r=>rc(e,r,n))}function KT(){const e=gt;return e.crypto||e.msCrypto}let cd;function YT(){return ls()*16}function Pr(e=KT()){try{if(e!=null&&e.randomUUID)return Ya(()=>e.randomUUID()).replace(/-/g,"")}catch{}return cd||(cd="10000000100040008000"+1e11),cd.replace(/[018]/g,t=>(t^(YT()&15)>>t/4).toString(16))}function ey(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Fs(e){const{message:t,event_id:n}=e;if(t)return t;const r=ey(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function pf(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 Pi(e,t){const n=ey(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 rm(e){if(JT(e))return!0;try{ur(e,"__sentry_captured__",!0)}catch{}return!1}function JT(e){try{return e.__sentry_captured__}catch{}}const ty=1e3;function Zs(){return Ja()/ty}function XT(){const{performance:e}=gt;if(!(e!=null&&e.now)||!e.timeOrigin)return Zs;const t=e.timeOrigin;return()=>(t+Ya(()=>e.now()))/ty}let om;function cn(){return(om??(om=XT()))()}let ud=null;function QT(){var i;const{performance:e}=gt;if(!(e!=null&&e.now))return;const t=3e5,n=Ya(()=>e.now()),r=Ja(),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 Dr(){return ud===null&&(ud=QT()),ud}function ZT(e){const t=cn(),n={sid:Pr(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>tE(n)};return e&&$i(n,e),n}function $i(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||cn(),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:Pr()),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 eE(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),$i(e,n)}function tE(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 Xa(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]=Xa(r[o],t[o],n-1));return r}function Ho(){return Pr()}function Lo(){return Pr().substring(16)}const hf="_sentrySpan";function Ni(e,t){t?ur(e,hf,t):delete e[hf]}function Cc(e){return e[hf]}const nE=100;class bo{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:Ho(),sampleRand:ls()}}clone(){const t=new bo;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,Ni(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&&$i(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 bo?n.getScopeData():Na(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:l,level:c,fingerprint:u=[],propagationContext:d,conversationId:h}=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),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),h&&(this._conversationId=h),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,Ni(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ho(),sampleRand:ls()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var s;const r=typeof n=="number"?n:nE;if(r<=0)return this;const o={timestamp:Zs(),...t,message:t.message?ff(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=Xa(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)||Pr();if(!this._client)return Ve&&Ie.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)||Pr();if(!this._client)return Ve&&Ie.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)||Pr();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Ve&&Ie.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 rE(){return qi("defaultCurrentScope",()=>new bo)}function oE(){return qi("defaultIsolationScope",()=>new bo)}const sm=e=>e instanceof Promise&&!e[ny],ny=Symbol("chained PromiseLike"),ry=(e,t,n)=>{const r=e.then(o=>(t(o),o),o=>{throw n(o),o});return sm(r)&&sm(e)?r:sE(e,r)},sE=(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,{[ny]:!0}),t};class iE{constructor(t,n){let r;t?r=t:r=new bo;let o;n?o=n:o=new bo,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 Vi(r)?ry(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 Li(){const e=Qs(),t=Zc(e);return t.stack=t.stack||new iE(rE(),oE())}function aE(e){return Li().withScope(e)}function lE(e,t){const n=Li();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function im(e){return Li().withScope(()=>e(Li().getIsolationScope()))}function cE(){return{withIsolationScope:im,withScope:aE,withSetScope:lE,withSetIsolationScope:(e,t)=>im(t),getCurrentScope:()=>Li().getScope(),getIsolationScope:()=>Li().getIsolationScope()}}function Gi(e){const t=Zc(e);return t.acs?t.acs:cE()}function Ct(){const e=Qs();return Gi(e).getCurrentScope()}function Or(){const e=Qs();return Gi(e).getIsolationScope()}function oy(){return qi("globalScope",()=>new bo)}function nu(...e){const t=Qs(),n=Gi(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function vt(){return Ct().getClient()}function uE(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||Lo()};return r&&(s.parent_span_id=r),s}const Ar="sentry.source",Tp="sentry.sample_rate",sy="sentry.previous_trace_sample_rate",qo="sentry.op",nn="sentry.origin",La="sentry.idle_span_finish_reason",Qa="sentry.measurement_unit",Za="sentry.measurement_value",am="sentry.custom_span_name",Ep="sentry.profile_id",Ki="sentry.exclusive_time",dE="sentry.link.type",fE="gen_ai.conversation.id",iy=0,ru=1,vn=2;function pE(e){if(e<400&&e>=100)return{code:ru};if(e>=400&&e<500)switch(e){case 401:return{code:vn,message:"unauthenticated"};case 403:return{code:vn,message:"permission_denied"};case 404:return{code:vn,message:"not_found"};case 409:return{code:vn,message:"already_exists"};case 413:return{code:vn,message:"failed_precondition"};case 429:return{code:vn,message:"resource_exhausted"};case 499:return{code:vn,message:"cancelled"};default:return{code:vn,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:vn,message:"unimplemented"};case 503:return{code:vn,message:"unavailable"};case 504:return{code:vn,message:"deadline_exceeded"};default:return{code:vn,message:"internal_error"}}return{code:vn,message:"internal_error"}}function ay(e,t){e.setAttribute("http.response.status_code",t);const n=pE(t);n.message!=="unknown_error"&&e.setStatus(n)}const ly="_sentryScope",cy="_sentryIsolationScope";function hE(e){try{const t=gt.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function mE(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function gE(e,t,n){e&&(ur(e,cy,hE(n)),ur(e,ly,t))}function xc(e){const t=e;return{scope:t[ly],isolationScope:mE(t[cy])}}const Ic="sentry-",vE=8192;function uy(e){const t=yE(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(Ic)){const i=o.slice(Ic.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function _E(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${Ic}${r}`]=o),n),{});return bE(t)}function yE(e){if(!(!e||!No(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=lm(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):lm(e)}function lm(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 bE(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>vE?(Ve&&Ie.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}const wE=/^o(\d+)\./,SE=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function TE(e){return e==="http"||e==="https"}function Yi(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 EE(e){const t=SE.exec(e);if(!t){Go(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",i="",a=""]=t.slice(1);let l="",c=a;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const d=c.match(/^\d+/);d&&(c=d[0])}return dy({host:s,pass:o,path:l,projectId:c,port:i,protocol:n,publicKey:r})}function dy(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function kE(e){if(!Ve)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(Ie.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?TE(r)?t&&isNaN(parseInt(t,10))?(Ie.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Ie.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Ie.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function CE(e){const t=e.match(wE);return t==null?void 0:t[1]}function xE(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=CE(n)),r}function IE(e){const t=typeof e=="string"?EE(e):dy(e);if(!(!t||!kE(t)))return t}function Da(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 fy=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function AE(e){if(!e)return;const t=e.match(fy);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 RE(e,t){const n=AE(e),r=uy(t);if(!(n!=null&&n.traceId))return{traceId:Ho(),sampleRand:ls()};const o=ME(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 py(e=Ho(),t=Lo(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function hy(e=Ho(),t=Lo(),n){return`00-${e}-${t}-${n?"01":"00"}`}function ME(e,t){const n=Da(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=Da(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?ls()*r:r+ls()*(1-r):ls()}const my=0,ou=1;let cm=!1;function PE(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 $E(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:St(e).parent_span_id,s=xc(e).scope,i=r?(s==null?void 0:s.getPropagationContext().propagationSpanId)||Lo():t;return{parent_span_id:o,span_id:i,trace_id:n}}function NE(e){const{traceId:t,spanId:n}=e.spanContext(),r=bs(e);return py(t,n,r)}function LE(e){const{traceId:t,spanId:n}=e.spanContext(),r=bs(e);return hy(t,n,r)}function gy(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===ou,attributes:s,...o}))}function DE(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===ou,attributes:o}))}function Gs(e){return typeof e=="number"?um(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?um(e.getTime()):cn()}function um(e){return e>9999999999?e/1e3:e}function St(e){if(jE(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(FE(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:OE(e),start_timestamp:Gs(o),timestamp:Gs(i)||void 0,status:vy(a),op:r[qo],origin:r[nn],links:gy(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function OE(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(t=e.parentSpanContext)==null?void 0:t.spanId:void 0}function FE(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function jE(e){return typeof e.getSpanJSON=="function"}function bs(e){const{traceFlags:t}=e.spanContext();return t===ou}function vy(e){if(!(!e||e.code===iy))return e.code===ru?"ok":e.message||"internal_error"}function BE(e){return!e||e.code===ru||e.code===iy||e.message==="cancelled"?"ok":"error"}const Ks="_sentryChildSpans",mf="_sentryRootSpan";function _y(e,t){const n=e[mf]||e;ur(t,mf,n),e[Ks]?e[Ks].add(t):ur(e,Ks,new Set([t]))}function UE(e,t){e[Ks]&&e[Ks].delete(t)}function oc(e){const t=new Set;function n(r){if(!t.has(r)&&bs(r)){t.add(r);const o=r[Ks]?Array.from(r[Ks]):[];for(const s of o)n(s)}}return n(e),Array.from(t)}const Un=HE;function HE(e){return e[mf]||e}function dr(){const e=Qs(),t=Gi(e);return t.getActiveSpan?t.getActiveSpan():Cc(Ct())}function gf(){cm||(Go(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),cm=!0)}let dm=!1;function qE(){if(dm)return;function e(){const t=dr(),n=t&&Un(t);if(n){const r="internal_error";Ve&&Ie.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:vn,message:r})}}e.tag="sentry_tracingErrorCallback",dm=!0,z_(e),G_(e)}function $r(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=vt())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function fm(e){Ie.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Oa(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(VE(n)){if(rc(e.description,n))return Ve&&fm(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?rc(e.description,n.name):!0,o=n.op?e.op&&rc(e.op,n.op):!0;if(r&&o)return Ve&&fm(e),!0}return!1}function WE(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 VE(e){return typeof e=="string"||e instanceof RegExp}const kp="production",yy="_frozenDsc";function sc(e,t){ur(e,yy,t)}function by(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||kp,release:n.release,public_key:r,trace_id:e,org_id:xE(t)};return t.emit("createDsc",o),o}function wy(e,t){const n=t.getPropagationContext();return n.dsc||by(n.traceId,e)}function ps(e){var w;const t=vt();if(!t)return{};const n=Un(e),r=St(n),o=r.data,s=n.spanContext().traceState,i=(s==null?void 0:s.get("sentry.sample_rate"))??o[Tp]??o[sy];function a(E){return(typeof i=="number"||typeof i=="string")&&(E.sample_rate=`${i}`),E}const l=n[yy];if(l)return a(l);const c=s==null?void 0:s.get("sentry.dsc"),u=c&&uy(c);if(u)return a(u);const d=by(e.spanContext().traceId,t),h=o[Ar]??o["sentry.span.source"],g=r.description;return h!=="url"&&g&&(d.transaction=g),$r()&&(d.sampled=String(bs(n)),d.sample_rand=(s==null?void 0:s.get("sentry.sample_rand"))??((w=xc(n).scope)==null?void 0:w.getPropagationContext().sampleRand.toString())),a(d),t.emit("createDsc",d,n),d}class Nr{constructor(t={}){this._traceId=t.traceId||Ho(),this._spanId=t.spanId||Lo(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:my}}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 Sy(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function Io(e,t=100,n=1/0){try{return vf("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ty(e,t=3,n=100*1024){const r=Io(e,t);return YE(r)>n?Ty(e,t-1,n):r}function vf(e,t,n=1/0,r=1/0,o=JE()){const[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=zE(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 c=t;if(c&&typeof c.toJSON=="function")try{const g=c.toJSON();return vf("",g,l-1,r,o)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const h=Z_(t);for(const g in h){if(!Object.prototype.hasOwnProperty.call(h,g))continue;if(d>=r){u[g]="[MaxProperties ~]";break}const w=h[g];u[g]=vf(g,w,l-1,r,o),d++}return i(t),u}function zE(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(J_(t))return V_(t);if(WT(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Bo(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=GE(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function GE(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function KE(e){return~-encodeURI(e).split(/%..|./).length}function YE(e){return KE(JSON.stringify(e))}function JE(){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 ei(e,t=[]){return[e,t]}function XE(e,t){const[n,r]=e;return[n,[...r,t]]}function _f(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 QE(e,t){return _f(e,(n,r)=>t.includes(r))}function yf(e){const t=Zc(gt);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function ZE(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[yf(r),s]:r.push(typeof s=="string"?yf(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(Io(a))}o(l)}}return typeof r=="string"?r:e1(r)}function e1(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 t1(e){return[{type:"span"},e]}function n1(e){const t=typeof e.data=="string"?yf(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Ey={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 r1(e){return e in Ey}function pm(e){return r1(e)?Ey[e]:e}function ky(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function o1(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:Yi(r)},...o&&{trace:o}}}function s1(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 i1(e,t,n,r){const o=ky(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Yi(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ei(s,[i])}function a1(e,t,n,r){const o=ky(n),s=e.type&&e.type!=="replay_event"?e.type:"event";s1(e,n==null?void 0:n.sdk);const i=o1(e,o,r,t);return delete e.sdkProcessingMetadata,ei(i,[[{type:s},e]])}function l1(e,t){function n(g){return!!g.trace_id&&!!g.public_key}const r=ps(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:Yi(o)}},{beforeSendSpan:a,ignoreSpans:l}=(t==null?void 0:t.getOptions())||{},c=l!=null&&l.length?e.filter(g=>!Oa(St(g),l)):e,u=e.length-c.length;u&&(t==null||t.recordDroppedEvent("before_send","span",u));const d=a?g=>{const w=St(g),E=Sy(a)?w:a(w);return E||(gf(),w)}:St,h=[];for(const g of c){const w=d(g);w&&h.push(t1(w))}return ei(i,h)}function c1(e){if(!Ve)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=St(e),{spanId:o}=e.spanContext(),s=bs(e),i=Un(e),a=i===e,l=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,c=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&c.push(`parent ID: ${r}`),!a){const{op:u,description:d}=St(i);c.push(`root ID: ${i.spanContext().spanId}`),u&&c.push(`root op: ${u}`),d&&c.push(`root description: ${d}`)}Ie.log(`${l}
|
|
25
|
+
${c.join(`
|
|
26
|
+
`)}`)}function u1(e){if(!Ve)return;const{description:t="< unknown name >",op:n="< unknown op >"}=St(e),{spanId:r}=e.spanContext(),s=Un(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;Ie.log(i)}function d1(e,t,n,r=dr()){const o=r&&Un(r);o&&(Ve&&Ie.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[Za]:t,[Qa]:n}))}function hm(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},o=r[Qa],s=r[Za];typeof o=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:o})}),t}function el(e){return e.getOptions().traceLifecycle==="stream"}const mm=1e3;class su{constructor(t={}){this._traceId=t.traceId||Ho(),this._spanId=t.spanId||Lo(),this._startTime=t.startTimestamp||cn(),this._links=t.links,this._attributes={},this.setAttributes({[nn]:"manual",[qo]: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?ou:my}}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=Gs(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Ar,"custom"),this}end(t){this._endTime||(this._endTime=Gs(t),u1(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[qo],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:vy(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[nn],profile_id:this._attributes[Ep],exclusive_time:this._attributes[Ki],measurements:hm(this._events),is_segment:this._isStandaloneSpan&&Un(this)===this||void 0,segment_id:this._isStandaloneSpan?Un(this).spanContext().spanId:void 0,links:gy(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===Un(this),status:BE(this._status),attributes:this._attributes,links:DE(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){Ve&&Ie.log("[Tracing] Adding an event to span:",t);const o=gm(n)?n:r||cn(),s=gm(n)?{}:n||{},i={name:t,time:Gs(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=vt();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Un(this)))return;if(this._isStandaloneSpan){this._sampled?p1(l1([this],t)):(Ve&&Ie.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&el(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(xc(this).scope||Ct()).captureEvent(r)}_convertSpanToTransaction(){var u;if(!vm(St(this)))return;this._name||(Ve&&Ie.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=xc(this),r=(u=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:u.normalizedRequest;if(this._sampled!==!0)return;const s=oc(this).filter(d=>d!==this&&!f1(d)).map(d=>St(d)).filter(vm),i=this._attributes[Ar];delete this._attributes[am],s.forEach(d=>{delete d.data[am]});const a={contexts:{trace:PE(this)},spans:s.length>mm?s.sort((d,h)=>d.start_timestamp-h.start_timestamp).slice(0,mm):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ps(this)},request:r,...i&&{transaction_info:{source:i}}},l=hm(this._events);return l&&Object.keys(l).length&&(Ve&&Ie.log("[Measurements] Adding measurements to transaction event",JSON.stringify(l,void 0,2)),a.measurements=l),a}}function gm(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function vm(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function f1(e){return e instanceof su&&e.isStandaloneSpan()}function p1(e){const t=vt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function h1(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(s){throw t(s),n(),s}return m1(o,t,n,r)}function m1(e,t,n,r){return Vi(e)?ry(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function g1(e,t,n){if(!$r(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=Da(o);if(s===void 0)return Ve&&Ie.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 Ve&&Ie.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||Ve&&Ie.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}const v1="__SENTRY_SUPPRESS_TRACING__";function bf(e,t){const n=xp();if(n.startSpan)return n.startSpan(e,t);const r=xy(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i==null?void 0:i.clone();return nu(a,()=>y1(s)(()=>{const c=Ct(),u=Iy(c,s),h=e.onlyIfParent&&!u?new Nr:Cy({parentSpan:u,spanArguments:r,forceTransaction:o,scope:c});return(!w1(h)||!u)&&Ni(c,h),h1(()=>t(h),()=>{const{status:g}=St(h);h.isRecording()&&(!g||g==="ok")&&h.setStatus({code:vn,message:"internal_error"})},()=>{h.end()})}))}function hs(e){const t=xp();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=xy(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?i=>nu(e.scope,i):o!==void 0?i=>Cp(o,i):i=>i())(()=>{const i=Ct(),a=Iy(i,o);return e.onlyIfParent&&!a?new Nr:Cy({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}function Cp(e,t){const n=xp();return n.withActiveSpan?n.withActiveSpan(e,t):nu(r=>(Ni(r,e||void 0),t(r)))}function Cy({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!$r()){const a=new Nr;if(n||!e){const l={sampled:"false",sample_rate:"0",transaction:t.name,...ps(a)};sc(a,l)}return a}const o=vt();if(b1(o,t))return Ip(r)||o==null||o.recordDroppedEvent("ignored","span"),new Nr({dropReason:"ignored",traceId:(e==null?void 0:e.spanContext().traceId)??r.getPropagationContext().traceId});const s=Or();let i;if(e&&!n)i=_1(e,r,t),_y(e,i);else if(e){const a=ps(e),{traceId:l,spanId:c}=e.spanContext(),u=bs(e);i=_m({traceId:l,parentSpanId:c,...t},r,u),sc(i,a)}else{const{traceId:a,dsc:l,parentSpanId:c,sampled:u}={...s.getPropagationContext(),...r.getPropagationContext()};i=_m({traceId:a,parentSpanId:c,...t},r,u),l&&sc(i,l)}return c1(i),gE(i,r,s),i}function xy(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=Gs(e.startTime),delete r.startTime,r}return n}function xp(){const e=Qs();return Gi(e)}function _m(e,t,n){var E;const r=vt(),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,c=t.getPropagationContext(),u=Ip(t),[d,h,g]=u?[!1]:g1(o,{name:s,parentSampled:a,attributes:l,parentSampleRate:Da((E=c.dsc)==null?void 0:E.sample_rate)},c.sampleRand),w=new su({...e,attributes:{[Ar]:"custom",[Tp]:h!==void 0&&g?h:void 0,...l},sampled:d});return!d&&r&&!u&&(Ve&&Ie.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",el(r)?"span":"transaction")),r&&r.emit("spanStart",w),w}function _1(e,t,n){const{spanId:r,traceId:o}=e.spanContext(),s=Ip(t),i=s?!1:bs(e),a=i?new su({...n,parentSpanId:r,traceId:o,sampled:i}):new Nr({traceId:o});_y(e,a);const l=vt();return l&&(el(l)&&a instanceof Nr&&(e instanceof Nr&&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 Iy(e,t){if(t)return t;if(t===null)return;const n=Cc(e);if(!n)return;const r=vt();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Un(n):n}function y1(e){return e!==void 0?t=>Cp(e,t):t=>t()}function b1(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!el(e)||!(n!=null&&n.length)?!1:Oa({description:t.name||"",op:((r=t.attributes)==null?void 0:r[qo])||t.op},n)}function w1(e){return e instanceof Nr&&e.dropReason==="ignored"}function Ip(e){return e.getScopeData().sdkProcessingMetadata[v1]===!0}const ic={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},S1="heartbeatFailed",T1="idleTimeout",E1="finalTimeout",k1="externalFinish";function Ay(e,t={}){const n=new Map;let r=!1,o,s=k1,i=!t.disableAutoFinish;const a=[],{idleTimeout:l=ic.idleTimeout,finalTimeout:c=ic.finalTimeout,childSpanTimeout:u=ic.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:h=!0}=t,g=vt();if(!g||!$r()){const Z=new Nr,de={sample_rate:"0",sampled:"false",...ps(Z)};return sc(Z,de),Z}const w=Ct(),E=dr(),D=C1(e);D.end=new Proxy(D.end,{apply(Z,de,_e){if(d&&d(D),de instanceof Nr)return;const[Te,...fe]=_e,H=Te||cn(),ee=Gs(H),Se=oc(D).filter(Pe=>Pe!==D),Ne=St(D);if(!Se.length||!h)return re(ee),Reflect.apply(Z,de,[ee,...fe]);const ye=g.getOptions().ignoreSpans,Re=Se==null?void 0:Se.reduce((Pe,ke)=>{const We=St(ke);return!We.timestamp||ye&&Oa(We,ye)?Pe:Pe?Math.max(Pe,We.timestamp):We.timestamp},void 0),ue=Ne.start_timestamp,Me=Math.min(ue?ue+c/1e3:1/0,Math.max(ue||-1/0,Math.min(ee,Re||1/0)));return re(Me),Reflect.apply(Z,de,[Me,...fe])}});function C(){o&&(clearTimeout(o),o=void 0)}function I(Z){C(),o=setTimeout(()=>{!r&&n.size===0&&i&&(s=T1,D.end(Z))},l)}function V(Z){o=setTimeout(()=>{!r&&i&&(s=S1,D.end(Z))},u)}function z(Z){C(),n.set(Z,!0);const de=cn();V(de+u/1e3)}function ce(Z){if(n.has(Z)&&n.delete(Z),n.size===0){const de=cn();I(de+l/1e3)}}function re(Z){r=!0,n.clear(),a.forEach(Se=>Se()),Ni(w,E);const de=St(D),{start_timestamp:_e}=de;if(!_e)return;de.data[La]||D.setAttribute(La,s);const fe=de.status;(!fe||fe==="unknown")&&D.setStatus({code:ru}),Ie.log(`[Tracing] Idle span "${de.op}" finished`);const H=oc(D).filter(Se=>Se!==D);let ee=0;H.forEach(Se=>{Se.isRecording()&&(Se.setStatus({code:vn,message:"cancelled"}),Se.end(Z),Ve&&Ie.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Se,void 0,2)));const Ne=St(Se),{timestamp:ye=0,start_timestamp:Re=0}=Ne,ue=Re<=Z,Me=(c+l)/1e3,Pe=ye-Re<=Me;if(Ve){const ke=JSON.stringify(Se,void 0,2);ue?Pe||Ie.log("[Tracing] Discarding span since it finished after idle span final timeout",ke):Ie.log("[Tracing] Discarding span since it happened after idle span was finished",ke)}(!Pe||!ue)&&(UE(D,Se),ee++)}),ee>0&&D.setAttribute("sentry.idle_span_discarded_spans",ee)}return a.push(g.on("spanStart",Z=>{if(r||Z===D||St(Z).timestamp||Z instanceof su&&Z.isStandaloneSpan())return;oc(D).includes(Z)&&z(Z.spanContext().spanId)})),a.push(g.on("spanEnd",Z=>{r||ce(Z.spanContext().spanId)})),a.push(g.on("idleSpanEnableAutoFinish",Z=>{Z===D&&(i=!0,I(),n.size&&V())})),t.disableAutoFinish||I(),setTimeout(()=>{r||(D.setStatus({code:vn,message:"deadline_exceeded"}),s=E1,D.end())},c),D}function C1(e){const t=hs(e);return Ni(Ct(),t),Ve&&Ie.log("[Tracing] Started span is an idle span"),t}function x1(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;I1(e,t),r&&M1(e,r),P1(e,n),A1(e,o),R1(e,s)}function ym(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:h,propagationContext:g,transactionName:w,span:E}=t;ua(e,"extra",n),ua(e,"tags",r),ua(e,"attributes",o),ua(e,"user",s),ua(e,"contexts",i),e.sdkProcessingMetadata=Xa(e.sdkProcessingMetadata,l,2),a&&(e.level=a),w&&(e.transactionName=w),E&&(e.span=E),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext={...e.propagationContext,...g}}function ua(e,t,n){e[t]=Xa(e[t],n,1)}function Ry(e,t){const n=oy().getScopeData();return e&&ym(n,e.getScopeData()),t&&ym(n,t.getScopeData()),n}function I1(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 A1(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function R1(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function M1(e,t){e.contexts={trace:$E(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ps(t),...e.sdkProcessingMetadata};const n=Un(t),r=St(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function P1(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 dd=0,bm=1,wm=2;function tl(e){return new Fa(t=>{t(e)})}function Ap(e){return new Fa((t,n)=>{n(e)})}class Fa{constructor(t){this._state=dd,this._handlers=[],this._runExecutor(t)}then(t,n){return new Fa((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 Fa((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===dd)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===bm&&n[1](this._value),this._state===wm&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,i)=>{if(this._state===dd){if(Vi(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(bm,s)},o=s=>{n(wm,s)};try{t(r,o)}catch(s){o(s)}}}function $1(e,t,n,r=0){try{const o=wf(t,n,e,r);return Vi(o)?o:tl(o)}catch(o){return Ap(o)}}function wf(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return Ve&&s===null&&Ie.log(`Event processor "${o.id||"?"}" dropped event`),Vi(s)?s.then(i=>wf(i,t,n,r+1)):wf(s,t,n,r+1)}let ko,Sm,Tm,Qo;function N1(e){const t=gt._sentryDebugIds,n=gt._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Qo&&r.length===Sm&&o.length===Tm)return Qo;Sm=r.length,Tm=o.length,Qo={},ko||(ko={});const s=(i,a)=>{for(const l of i){const c=a[l],u=ko==null?void 0:ko[l];if(u&&Qo&&c)Qo[u[0]]=c,ko&&(ko[l]=[u[0],c]);else if(c){const d=e(l);for(let h=d.length-1;h>=0;h--){const g=d[h],w=g==null?void 0:g.filename;if(w&&Qo&&ko){Qo[w]=c,ko[l]=[w,c];break}}}}};return t&&s(r,t),n&&s(o,n),Qo}function L1(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||Pr(),timestamp:t.timestamp||Zs()},c=n.integrations||e.integrations.map(C=>C.name);D1(l,e),j1(l,c),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&O1(l,e.stackParser);const u=U1(r,n.captureContext);n.mechanism&&Pi(l,n.mechanism);const d=o?o.getEventProcessors():[],h=Ry(s,u),g=[...n.attachments||[],...h.attachments];g.length&&(n.attachments=g),x1(l,h);const w=[...d,...h.eventProcessors];return(n.data&&n.data.__sentry__===!0?tl(l):$1(w,l,n)).then(C=>(C&&F1(C),typeof i=="number"&&i>0?B1(C,i,a):C))}function D1(e,t){var a,l;const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||kp,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const i=e.request;i!=null&&i.url&&s&&(i.url=ff(i.url,s)),s&&((l=(a=e.exception)==null?void 0:a.values)==null||l.forEach(c=>{c.value&&(c.value=ff(c.value,s))}))}function O1(e,t){var r,o;const n=N1(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 F1(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 j1(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function B1(e,t,n){var o,s;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Io(i.data,t,n)}}))},...e.user&&{user:Io(e.user,t,n)},...e.contexts&&{contexts:Io(e.contexts,t,n)},...e.extra&&{extra:Io(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=Io(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>({...i,...i.data&&{data:Io(i.data,t,n)}}))),(s=e.contexts)!=null&&s.flags&&r.contexts&&(r.contexts.flags=Io(e.contexts.flags,3,n)),r}function U1(e,t){if(!t)return e;const n=e?e.clone():new bo;return n.update(t),n}function H1(e){if(e)return q1(e)?{captureContext:e}:V1(e)?{captureContext:e}:e}function q1(e){return e instanceof bo||typeof e=="function"}const W1=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function V1(e){return Object.keys(e).some(t=>W1.includes(t))}function Rp(e,t){return Ct().captureException(e,H1(t))}function My(e,t){return Ct().captureEvent(e,t)}function z1(e,t){Or().setContext(e,t)}function G1(e,t){Or().setTag(e,t)}function K1(){const e=vt();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function Em(e){const t=Or(),{user:n}=Ry(t,Ct()),{userAgent:r}=gt.navigator||{},o=ZT({user:n,...r&&{userAgent:r},...e}),s=t.getSession();return(s==null?void 0:s.status)==="ok"&&$i(s,{status:"exited"}),Py(),t.setSession(o),o}function Py(){const e=Or(),n=Ct().getSession()||e.getSession();n&&eE(n),$y(),e.setSession()}function $y(){const e=Or(),t=vt(),n=e.getSession();n&&t&&t.captureSession(n)}function fd(e=!1){if(e){Py();return}$y()}const Y1="7";function J1(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function X1(e){return`${J1(e)}${e.projectId}/envelope/`}function Q1(e,t){const n={sentry_version:Y1};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Z1(e,t,n){return t||`${X1(e)}?${Q1(e,n)}`}const km=[];function ek(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 tk(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 ek(r)}function nk(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Ny(e,r,n)}),n}function Cm(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function Ny(e,t,n){if(n[t.name]){Ve&&Ie.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!km.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),km.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)}Ve&&Ie.log(`Integration installed: ${t.name}`)}function xm(e){const t=vt();if(!t){Ve&&Ie.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function rk(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function ok(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=Yi(r)),ei(o,[rk(e)])}function Sf(e,t){const n=t??sk(e)??[];if(n.length===0)return;const r=e.getOptions(),o=ok(n,r._metadata,r.tunnel,e.getDsn());Ly().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function sk(e){return Ly().get(e)}function Ly(){return qi("clientToLogBufferMap",()=>new WeakMap)}function ik(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function ak(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=Yi(r)),ei(o,[ik(e)])}function Dy(e,t){const n=t??lk(e)??[];if(n.length===0)return;const r=e.getOptions(),o=ak(n,r._metadata,r.tunnel,e.getDsn());Oy().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function lk(e){return Oy().get(e)}function Oy(){return qi("clientToMetricBufferMap",()=>new WeakMap)}function Fy(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const Mp=Symbol.for("SentryBufferFullError");function Pp(e=100){const t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return Ap(Mp);const a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return tl(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;const l=[a,new Promise(c=>Fy(setTimeout(()=>c(!1),i)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:s}}const ck=60*1e3;function uk(e,t=Ja()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?ck:r-t}function dk(e,t){return e[t]||e.all||0}function fk(e,t,n=Ja()){return dk(e,t)>n}function pk(e,{statusCode:t,headers:n},r=Ja()){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,c,,,u]=a.split(":",5),d=parseInt(l,10),h=(isNaN(d)?60:d)*1e3;if(!c)o.all=r+h;else for(const g of c.split(";"))g==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(o[g]=r+h):o[g]=r+h}else i?o.all=r+uk(i,r):t===429&&(o.all=r+60*1e3);return o}const jy=64;function hk(e,t,n=Pp(e.bufferSize||jy)){let r={};const o=i=>n.drain(i);function s(i){const a=[];if(_f(i,(d,h)=>{const g=pm(h);fk(r,g)?e.recordDroppedEvent("ratelimit_backoff",g):a.push(d)}),a.length===0)return Promise.resolve({});const l=ei(i[0],a),c=d=>{if(QE(l,["client_report"])){Ve&&Ie.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}_f(l,(h,g)=>{e.recordDroppedEvent(d,pm(g))})},u=()=>t({body:ZE(l)}).then(d=>d.statusCode===413?(Ve&&Ie.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),d):(Ve&&d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&Ie.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=pk(r,d),d),d=>{throw c("network_error"),Ve&&Ie.error("Encountered error running transport request:",d),d});return n.add(u).then(d=>d,d=>{if(d===Mp)return Ve&&Ie.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw d})}return{send:s,flush:o}}function mk(e,t,n){const r=[{type:"client_report"},{timestamp:Zs(),discarded_events:e}];return ei(t?{dsn:t}:{},[r])}function By(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 gk(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[Ep],exclusive_time:i==null?void 0:i[Ki],measurements:e.measurements,is_segment:!0}}function vk(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&&{[Ep]:e.profile_id},...e.exclusive_time&&{[Ki]: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",Uy=Symbol.for("SentryInternalError"),Hy=Symbol.for("SentryDoNotSendEventError"),_k=5e3;function ac(e){return{message:e,[Uy]:!0}}function pd(e){return{message:e,[Hy]:!0}}function Rm(e){return!!e&&typeof e=="object"&&Uy in e}function Mm(e){return!!e&&typeof e=="object"&&Hy in e}function Pm(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=Fy(setTimeout(()=>{o(e)},_k)))}),e.on("flush",()=>{o(e)})}class yk{constructor(t){var r,o,s;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Pp(((r=t.transportOptions)==null?void 0:r.bufferSize)??jy),t.dsn?this._dsn=IE(t.dsn):Ve&&Ie.warn("No DSN provided, client will not send events."),this._dsn){const i=Z1(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&&Pm(this,"afterCaptureLog","flushLogs",Tk,Sf),(this._options.enableMetrics??((s=this._options._experiments)==null?void 0:s.enableMetrics)??!0)&&Pm(this,"afterCaptureMetric","flushMetrics",Sk,Dy)}captureException(t,n,r){const o=Pr();if(rm(t))return Ve&&Ie.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:Pr(),...r},i=yp(t)?t:String(t),a=Mi(t),l=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>l.then(c=>this._captureEvent(c,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=Pr();if(n!=null&&n.originalException&&rm(n.originalException))return Ve&&Ie.log(Im),o;const s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,l=i.capturedSpanIsolationScope,c=$m(t.type);return this._process(()=>this._captureEvent(t,s,a||r,l),c),s.event_id}captureSession(t){this.sendSession(t),$i(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){Sf(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),Ny(this,t,this._integrations),n||Cm(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=a1(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=XE(r,n1(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:r=kp}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){Ve&&Ie.warn(Am);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){Ve&&Ie.warn(Am);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=i1(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}`;Ve&&Ie.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 Ve&&Ie.error("Error while sending envelope:",n),{}}return Ve&&Ie.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=nk(this,t),Cm(this,t)}_updateSessionFromEvent(t,n){var l,c;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 u of s)if(((c=u.mechanism)==null?void 0:c.handled)===!1){r=!0;break}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&($i(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),L1(s,t,n,r,this,o).then(a=>{var c;if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...(c=a.contexts)==null?void 0:c.trace,...uE(r)},...a.contexts};const l=wy(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=Ct(),o=Or()){return Ve&&Tf(t)&&Ie.log(`Captured error event \`${By(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{Ve&&(Mm(s)?Ie.log(s.message):Rm(s)?Ie.warn(s.message):Ie.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:i}=s,a=qy(t),l=Tf(t),u=`before send for type \`${t.type||"error"}\``,d=typeof i>"u"?void 0:Da(i);if(l&&typeof d=="number"&&ls()>d)return this.recordDroppedEvent("sample_rate","error"),Ap(pd(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const h=$m(t.type);return this._prepareEvent(t,n,r,o).then(g=>{var D;if(g===null)throw this.recordDroppedEvent("event_processor",h),pd("An event processor returned `null`, will not send event.");if(((D=n.data)==null?void 0:D.__sentry__)===!0)return g;const E=wk(this,s,g,n);return bk(E,u)}).then(g=>{var D;if(g===null){if(this.recordDroppedEvent("before_send",h),a){const I=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",I)}throw pd(`${u} returned \`null\`, will not send event.`)}const w=r.getSession()||o.getSession();if(l&&w&&this._updateSessionFromEvent(w,g),a){const C=((D=g.sdkProcessingMetadata)==null?void 0:D.spanCountBeforeProcessing)||0,I=g.spans?g.spans.length:0,V=C-I;V>0&&this.recordDroppedEvent("before_send","span",V)}const E=g.transaction_info;if(a&&E&&g.transaction!==t.transaction){const C="custom";g.transaction_info={...E,source:C}}return this.sendEvent(g,n),g}).then(null,g=>{throw Mm(g)||Rm(g)?g:(this.captureException(g,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:g}),ac(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
27
|
+
Reason: ${g}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Mp&&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(){Ve&&Ie.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Ve&&Ie.log("No outcomes to send");return}if(!this._dsn){Ve&&Ie.log("No dsn provided, will not send outcomes");return}Ve&&Ie.log("Sending outcomes:",t);const n=mk(t,this._options.tunnel&&Yi(this._dsn));this.sendEnvelope(n)}}function $m(e){return e==="replay_event"?"replay":e||"error"}function bk(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Vi(e))return e.then(r=>{if(!Na(r)&&r!==null)throw ac(n);return r},r=>{throw ac(`${t} rejected with ${r}`)});if(!Na(e)&&e!==null)throw ac(n);return e}function wk(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!Sy(t.beforeSendSpan)&&t.beforeSendSpan;let l=n;if(Tf(l)&&o)return o(l,r);if(qy(l)){if(a||i){const c=gk(l);if(i!=null&&i.length&&Oa(c,i))return null;if(a){const u=a(c);u?l=Xa(n,vk(u)):gf()}if(l.spans){const u=[],d=l.spans;for(const g of d){if(i!=null&&i.length&&Oa(g,i)){WE(d,g);continue}if(a){const w=a(g);w?u.push(w):(gf(),u.push(g))}else u.push(g)}const h=l.spans.length-u.length;h&&e.recordDroppedEvent("before_send","span",h),l.spans=u}}if(s){if(l.spans){const c=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return s(l,r)}}return l}function Tf(e){return e.type===void 0}function qy(e){return e.type==="transaction"}function Sk(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Wy(e.attributes)}function Tk(e){let t=0;return e.message&&(t+=e.message.length*2),t+Wy(e.attributes)}function Wy(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Nm(n[0]):Mi(n)?t+=Nm(n):t+=100}),t}function Nm(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Ek(e){return eu(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Lm(e){return Ek(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function kk(e,t){t.debug===!0&&(Ve?Ie.enable():Go(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Ct().update(t.initialScope);const r=new e(t);return Ck(r),r.init(),r}function Ck(e){Ct().setClient(e)}const xk="thismessage:/";function Vy(e){return"isRelative"in e}function zy(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?xk: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 Ik(e){if(Vy(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 Ys(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 Ak(e){return e.split(/[?#]/,1)[0]}function us(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 Rk(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 Gy(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:zs})),o.version=zs)}function Ky(e={}){const t=e.client||vt();if(!K1()||!t)return{};const n=Qs(),r=Gi(n);if(r.getTraceData)return r.getTraceData(e);const o=e.scope||Ct(),s=e.span||dr(),i=s?NE(s):Mk(o),a=s?ps(s):wy(t,o),l=_E(a);if(!fy.test(i))return Ie.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const u={"sentry-trace":i,baggage:l};return e.propagateTraceparent&&(u.traceparent=s?LE(s):Pk(o)),u}function Mk(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return py(t,r,n)}function Pk(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return hy(t,r,n)}const $k=100;function yr(e,t){const n=vt(),r=Or();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=$k}=n.getOptions();if(s<=0)return;const a={timestamp:Zs(),...e},l=o?Go(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,s))}let Dm;const Nk="FunctionToString",Om=new WeakMap,Lk=(()=>({name:Nk,setupOnce(){Dm=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Sp(this),n=Om.has(vt())&&t!==void 0?t:this;return Dm.apply(n,e)}}catch{}},setup(e){Om.set(e,!0)}})),Dk=Lk,Ok=[/^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$/],Fk="EventFilters",jk=(e={})=>{let t;return{name:Fk,setup(n){const r=n.getOptions();t=Fm(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=Fm(e,s)}return Uk(n,t)?null:n}}},Bk=((e={})=>({...jk(e),name:"InboundFilters"}));function Fm(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Ok],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Uk(e,t){if(e.type){if(e.type==="transaction"&&qk(e,t.ignoreTransactions))return Ve&&Ie.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
28
|
+
Event: ${Fs(e)}`),!0}else{if(Hk(e,t.ignoreErrors))return Ve&&Ie.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
29
|
+
Event: ${Fs(e)}`),!0;if(Gk(e))return Ve&&Ie.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
30
|
+
Event: ${Fs(e)}`),!0;if(Wk(e,t.denyUrls))return Ve&&Ie.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
31
|
+
Event: ${Fs(e)}.
|
|
32
|
+
Url: ${Ac(e)}`),!0;if(!Vk(e,t.allowUrls))return Ve&&Ie.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
33
|
+
Event: ${Fs(e)}.
|
|
34
|
+
Url: ${Ac(e)}`),!0}return!1}function Hk(e,t){return t!=null&&t.length?By(e).some(n=>cs(n,t)):!1}function qk(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?cs(n,t):!1}function Wk(e,t){if(!(t!=null&&t.length))return!1;const n=Ac(e);return n?cs(n,t):!1}function Vk(e,t){if(!(t!=null&&t.length))return!0;const n=Ac(e);return n?cs(n,t):!0}function zk(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 Ac(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?zk(o):null}catch{return Ve&&Ie.error(`Cannot extract url for event ${Fs(e)}`),null}}function Gk(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 Kk(e,t,n,r,o,s){var a;if(!((a=o.exception)!=null&&a.values)||!s||!Uo(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=Ef(e,t,r,s.originalException,n,o.exception.values,i,0))}function Ef(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let l=[...s];if(Uo(r[o],Error)){jm(i,a,r);const c=e(t,r[o]),u=l.length;Bm(c,o,u,a),l=Ef(e,t,n,r[o],o,[c,...l],c,u)}return Yy(r)&&r.errors.forEach((c,u)=>{if(Uo(c,Error)){jm(i,a,r);const d=e(t,c),h=l.length;Bm(d,`errors[${u}]`,h,a),l=Ef(e,t,n,c,o,[d,...l],d,h)}}),l}function Yy(e){return Array.isArray(e.errors)}function jm(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Yy(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Bm(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Yk(e){const t="console";_s(t,e),ys(t,Jk)}function Jk(){"console"in gt&&RT.forEach(function(e){e in gt.console&&_r(gt.console,e,function(t){return kc[e]=t,function(...n){Mr("console",{args:n,level:e});const o=kc[e];o==null||o.apply(gt.console,n)}})})}function Xk(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Qk="Dedupe",Zk=(()=>{let e;return{name:Qk,processEvent(t){if(t.type)return t;try{if(tC(t,e))return Ve&&Ie.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),eC=Zk;function tC(e,t){return t?!!(nC(e,t)||rC(e,t)):!1}function nC(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Xy(e,t)||!Jy(e,t))}function rC(e,t){const n=Um(t),r=Um(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Xy(e,t)||!Jy(e,t))}function Jy(e,t){let n=Xh(e),r=Xh(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 Xy(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 Um(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const oC="ConversationId",sC=(()=>({name:oC,setup(e){e.on("spanStart",t=>{const n=Ct().getScopeData(),r=Or().getScopeData(),o=n.conversationId||r.conversationId;o&&t.setAttribute(fE,o)})}})),iC=sC;function aC(e,t,n,r,o){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,a=$r()&&t(i);if(e.endTimestamp){const g=e.fetchData.__span;if(!g)return;const w=r[g];w&&(a&&(uC(w,e),lC(w,e,o)),delete r[g]);return}const{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},u=!!dr(),d=a&&u?hs(fC(i,s,l)):new Nr;if(e.fetchData.__span=d.spanContext().spanId,r[d.spanContext().spanId]=d,n(e.fetchData.url)){const g=e.args[0],w={...e.args[1]||{}},E=cC(g,w,$r()&&u?d:void 0,c);E&&(e.args[1]=w,w.headers=E)}const h=vt();if(h){const g={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};h.emit("beforeOutgoingRequestSpan",d,g)}return d}function lC(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 cC(e,t,n,r){const o=Ky({span:n,propagateTraceparent:r}),s=o["sentry-trace"],i=o.baggage,a=o.traceparent;if(!s)return;const l=t.headers||(bp(e)?e.headers:void 0);if(l)if(dC(l)){const c=new Headers(l);if(c.get("sentry-trace")||c.set("sentry-trace",s),r&&a&&!c.get("traceparent")&&c.set("traceparent",a),i){const u=c.get("baggage");u?Fl(u)||c.set("baggage",`${u},${i}`):c.set("baggage",i)}return c}else if(Array.isArray(l)){const c=[...l];l.find(d=>d[0]==="sentry-trace")||c.push(["sentry-trace",s]),r&&a&&!l.find(d=>d[0]==="traceparent")&&c.push(["traceparent",a]);const u=l.find(d=>d[0]==="baggage"&&Fl(d[1]));return i&&!u&&c.push(["baggage",i]),c}else{const c="sentry-trace"in l?l["sentry-trace"]:void 0,u="traceparent"in l?l.traceparent:void 0,d="baggage"in l?l.baggage:void 0,h=d?Array.isArray(d)?[...d]:[d]:[],g=d&&(Array.isArray(d)?d.find(E=>Fl(E)):Fl(d));i&&!g&&h.push(i);const w={...l,"sentry-trace":c??s,baggage:h.length>0?h.join(","):void 0};return r&&a&&!u&&(w.traceparent=a),w}else return{...o}}function uC(e,t){var n,r;if(t.response){ay(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:vn,message:"internal_error"});e.end()}function Fl(e){return e.split(",").some(t=>t.trim().startsWith(Ic))}function dC(e){return typeof Headers<"u"&&Uo(e,Headers)}function fC(e,t,n){if(e.startsWith("data:")){const s=us(e);return{name:`${t} ${s}`,attributes:Hm(e,void 0,t,n)}}const r=zy(e),o=r?Ik(r):e;return{name:`${t} ${o}`,attributes:Hm(e,r,t,n)}}function Hm(e,t,n,r){const o={url:us(e),type:"fetch","http.method":n,[nn]:r,[qo]:"http.client"};return t&&(Vy(t)||(o["http.url"]=us(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function pC(e,t={},n=Ct()){const{message:r,name:o,email:s,url:i,source:a,associatedEventId:l,tags:c}=e,u={contexts:{feedback:{contact_email:s,name:o,message:r,url:i,source:a,associated_event_id:l}},type:"feedback",level:"info",tags:c},d=(n==null?void 0:n.getClient())||vt();return d&&d.emit("beforeSendFeedback",u,t),n.captureEvent(u,t)}function Qy(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const ja=gt;function hC(){return"history"in ja&&!!ja.history}function mC(){if(!("fetch"in ja))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function kf(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function gC(){var n;if(typeof EdgeRuntime=="string")return!0;if(!mC())return!1;if(kf(ja.fetch))return!0;let e=!1;const t=ja.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=kf(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){Ve&&Ie.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function Zy(e,t){const n="fetch";_s(n,e),ys(n,()=>eb(void 0,t))}function vC(e){const t="fetch-body-resolved";_s(t,e),ys(t,()=>eb(yC))}function eb(e,t=!1){t&&!gC()||_r(gt,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:i}=bC(r),a={args:r,fetchData:{method:s,url:i},startTimestamp:cn()*1e3,virtualError:o,headers:wC(r)};return e||Mr("fetch",{...a}),n.apply(gt,r).then(async l=>(e?e(l):Mr("fetch",{...a,endTimestamp:cn()*1e3,response:l}),l),l=>{Mr("fetch",{...a,endTimestamp:cn()*1e3,error:l}),eu(l)&&l.stack===void 0&&(l.stack=o.stack,ur(l,"framesToPop",1));const c=vt(),u=(c==null?void 0:c.getOptions().enhanceFetchErrorMessages)??"always";if(u!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{const g=new URL(a.fetchData.url).host;u==="always"?l.message=`${l.message} (${g})`:ur(l,"__sentry_fetch_url_host__",g)}catch{}throw l})}})}async function _C(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 yC(e){let t;try{t=e.clone()}catch{return}_C(t,()=>{Mr("fetch-body-resolved",{endTimestamp:cn()*1e3,response:e})})}function lc(e,t){return!!e&&typeof e=="object"&&!!e[t]}function qm(e){return typeof e=="string"?e:e?lc(e,"url")?e.url:e.toString?e.toString():"":""}function bC(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:qm(n),method:lc(r,"method")?String(r.method).toUpperCase():bp(n)&&lc(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:qm(t),method:lc(t,"method")?String(t.method).toUpperCase():"GET"}}function wC(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(bp(t))return new Headers(t.headers)}catch{}}function SC(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function TC(){return"npm"}function EC(){return!SC()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function tb(){return typeof window<"u"&&(!EC()||kC())}function kC(){const e=gt.process;return(e==null?void 0:e.type)==="renderer"}const Gr=gt,Ft=Gr.document,ma=Gr.navigator,nb="Report a Bug",CC="Cancel",xC="Send Bug Report",IC="Confirm",AC="Report a Bug",RC="your.email@example.org",MC="Email",PC="What's the bug? What did you expect?",$C="Description",NC="Your Name",LC="Name",DC="Thank you for your report!",OC="(required)",FC="Add a screenshot",jC="Remove screenshot",BC="Highlight",UC="Hide",HC="Remove",qC="widget",WC="api",VC=5e3,zC=(e,t={includeReplay:!0})=>{if(!e.message)throw new Error("Unable to submit feedback with empty message");const n=vt();if(!n)throw new Error("No client setup, cannot send feedback.");e.tags&&Object.keys(e.tags).length&&Ct().setTags(e.tags);const r=pC({source:WC,url:zi(),...e},t);return new Promise((o,s)=>{const i=setTimeout(()=>s("Unable to determine if Feedback was correctly sent."),3e4),a=n.on("afterSendEvent",(l,c)=>{if(l.event_id===r)return clearTimeout(i),a(),c!=null&&c.statusCode&&c.statusCode>=200&&c.statusCode<300?o(r):(c==null?void 0:c.statusCode)===403?s("Unable to send feedback. This could be because this domain is not in your list of allowed domains."):s("Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.")})})},cc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function GC(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ma.userAgent)||/Macintosh/i.test(ma.userAgent)&&ma.maxTouchPoints&&ma.maxTouchPoints>1||!isSecureContext)}function jl(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{var n,r;(n=t.onFormOpen)==null||n.call(t),(r=e.onFormOpen)==null||r.call(e)},onFormClose:()=>{var n,r;(n=t.onFormClose)==null||n.call(t),(r=e.onFormClose)==null||r.call(e)},onSubmitSuccess:(n,r)=>{var o,s;(o=t.onSubmitSuccess)==null||o.call(t,n,r),(s=e.onSubmitSuccess)==null||s.call(e,n,r)},onSubmitError:n=>{var r,o;(r=t.onSubmitError)==null||r.call(t,n),(o=e.onSubmitError)==null||o.call(e,n)},onFormSubmitted:()=>{var n,r;(n=t.onFormSubmitted)==null||n.call(t),(r=e.onFormSubmitted)==null||r.call(e)},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function KC(e){const t=Ft.createElement("style");return t.textContent=`
|
|
35
|
+
.widget__actor {
|
|
36
|
+
position: fixed;
|
|
37
|
+
z-index: var(--z-index);
|
|
38
|
+
margin: var(--page-margin);
|
|
39
|
+
inset: var(--actor-inset);
|
|
40
|
+
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 8px;
|
|
44
|
+
padding: 16px;
|
|
45
|
+
|
|
46
|
+
font-family: inherit;
|
|
47
|
+
font-size: var(--font-size);
|
|
48
|
+
font-weight: 600;
|
|
49
|
+
line-height: 1.14em;
|
|
50
|
+
text-decoration: none;
|
|
51
|
+
|
|
52
|
+
background: var(--actor-background, var(--background));
|
|
53
|
+
border-radius: var(--actor-border-radius, 1.7em/50%);
|
|
54
|
+
border: var(--actor-border, var(--border));
|
|
55
|
+
box-shadow: var(--actor-box-shadow, var(--box-shadow));
|
|
56
|
+
color: var(--actor-color, var(--foreground));
|
|
57
|
+
fill: var(--actor-color, var(--foreground));
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
opacity: 1;
|
|
60
|
+
transition: transform 0.2s ease-in-out;
|
|
61
|
+
transform: translate(0, 0) scale(1);
|
|
62
|
+
}
|
|
63
|
+
.widget__actor[aria-hidden="true"] {
|
|
64
|
+
opacity: 0;
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
visibility: hidden;
|
|
67
|
+
transform: translate(0, 16px) scale(0.98);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.widget__actor:hover {
|
|
71
|
+
background: var(--actor-hover-background, var(--background));
|
|
72
|
+
filter: var(--interactive-filter);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.widget__actor svg {
|
|
76
|
+
width: 1.14em;
|
|
77
|
+
height: 1.14em;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@media (max-width: 600px) {
|
|
81
|
+
.widget__actor span {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`,e&&t.setAttribute("nonce",e),t}function gr(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}const ui=20,YC="http://www.w3.org/2000/svg";function JC(){const e=a=>Gr.document.createElementNS(YC,a),t=gr(e("svg"),{width:`${ui}`,height:`${ui}`,viewBox:`0 0 ${ui} ${ui}`,fill:"var(--actor-color, var(--foreground))"}),n=gr(e("g"),{clipPath:"url(#clip0_57_80)"}),r=gr(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);const o=e("defs"),s=gr(e("clipPath"),{id:"clip0_57_80"}),i=gr(e("rect"),{width:`${ui}`,height:`${ui}`,fill:"white"});return s.appendChild(i),o.appendChild(s),t.appendChild(o).appendChild(s).appendChild(i),t}function XC({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const o=Ft.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=t||e||nb,o.appendChild(JC()),e){const i=Ft.createElement("span");i.appendChild(Ft.createTextNode(e)),o.appendChild(i)}const s=KC(r);return{el:o,appendToDom(){n.appendChild(s),n.appendChild(o)},removeFromDom(){o.remove(),s.remove()},show(){o.ariaHidden="false"},hide(){o.ariaHidden="true"}}}const rb="rgba(88, 74, 192, 1)",QC={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:rb,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},Wm={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:rb,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function Vm(e){return`
|
|
86
|
+
--foreground: ${e.foreground};
|
|
87
|
+
--background: ${e.background};
|
|
88
|
+
--accent-foreground: ${e.accentForeground};
|
|
89
|
+
--accent-background: ${e.accentBackground};
|
|
90
|
+
--success-color: ${e.successColor};
|
|
91
|
+
--error-color: ${e.errorColor};
|
|
92
|
+
--border: ${e.border};
|
|
93
|
+
--box-shadow: ${e.boxShadow};
|
|
94
|
+
--outline: ${e.outline};
|
|
95
|
+
--interactive-filter: ${e.interactiveFilter};
|
|
96
|
+
`}function zm({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const o=Ft.createElement("style");return o.textContent=`
|
|
97
|
+
:host {
|
|
98
|
+
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
|
|
99
|
+
--font-size: 14px;
|
|
100
|
+
--z-index: 100000;
|
|
101
|
+
|
|
102
|
+
--page-margin: 16px;
|
|
103
|
+
--inset: auto 0 0 auto;
|
|
104
|
+
--actor-inset: var(--inset);
|
|
105
|
+
|
|
106
|
+
font-family: var(--font-family);
|
|
107
|
+
font-size: var(--font-size);
|
|
108
|
+
|
|
109
|
+
${e!=="system"?`color-scheme: only ${e};`:""}
|
|
110
|
+
|
|
111
|
+
${Vm(e==="dark"?{...Wm,...t}:{...QC,...n})}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
${e==="system"?`
|
|
115
|
+
@media (prefers-color-scheme: dark) {
|
|
116
|
+
:host {
|
|
117
|
+
color-scheme: only dark;
|
|
118
|
+
|
|
119
|
+
${Vm({...Wm,...t})}
|
|
120
|
+
}
|
|
121
|
+
}`:""}
|
|
122
|
+
`,r&&o.setAttribute("nonce",r),o}const ZC=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>(({id:o="sentry-feedback",autoInject:s=!0,showBranding:i=!0,isEmailRequired:a=!1,isNameRequired:l=!1,showEmail:c=!0,showName:u=!0,enableScreenshot:d=!0,useSentryUser:h={email:"email",name:"username"},tags:g,styleNonce:w,scriptNonce:E,colorScheme:D="system",themeLight:C={},themeDark:I={},addScreenshotButtonLabel:V=FC,cancelButtonLabel:z=CC,confirmButtonLabel:ce=IC,emailLabel:re=MC,emailPlaceholder:Z=RC,formTitle:de=AC,isRequiredLabel:_e=OC,messageLabel:Te=$C,messagePlaceholder:fe=PC,nameLabel:H=LC,namePlaceholder:ee=NC,removeScreenshotButtonLabel:Se=jC,submitButtonLabel:Ne=xC,successMessageText:ye=DC,triggerLabel:Re=nb,triggerAriaLabel:ue="",highlightToolText:Me=BC,hideToolText:Pe=UC,removeHighlightText:ke=HC,onFormOpen:We,onFormClose:Ye,onSubmitSuccess:Je,onSubmitError:st,onFormSubmitted:Ke}={})=>{const Q={id:o,autoInject:s,showBranding:i,isEmailRequired:a,isNameRequired:l,showEmail:c,showName:u,enableScreenshot:d,useSentryUser:h,tags:g,styleNonce:w,scriptNonce:E,colorScheme:D,themeDark:I,themeLight:C,triggerLabel:Re,triggerAriaLabel:ue,cancelButtonLabel:z,submitButtonLabel:Ne,confirmButtonLabel:ce,formTitle:de,emailLabel:re,emailPlaceholder:Z,messageLabel:Te,messagePlaceholder:fe,nameLabel:H,namePlaceholder:ee,successMessageText:ye,isRequiredLabel:_e,addScreenshotButtonLabel:V,removeScreenshotButtonLabel:Se,highlightToolText:Me,hideToolText:Pe,removeHighlightText:ke,onFormClose:Ye,onFormOpen:We,onSubmitError:st,onSubmitSuccess:Je,onFormSubmitted:Ke};let me=null,be=null,ge=[];const Qe=G=>{if(!me){const Y=Ft.createElement("div");Y.id=String(G.id),Ft.body.appendChild(Y),me=Y.attachShadow({mode:"open"}),be=zm(G),me.appendChild(be)}return me},k=async G=>{const Y=G.enableScreenshot&&GC();let te,oe;try{te=(t?t():await e("feedbackModalIntegration",E))(),xm(te)}catch{throw cc&&Ie.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{const pe=Y?n?n():await e("feedbackScreenshotIntegration",E):void 0;pe&&(oe=pe(),xm(oe))}catch{cc&&Ie.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const ie=te.createDialog({options:{...G,onFormClose:()=>{var pe;ie==null||ie.close(),(pe=G.onFormClose)==null||pe.call(G)},onFormSubmitted:()=>{var pe;ie==null||ie.close(),(pe=G.onFormSubmitted)==null||pe.call(G)}},screenshotIntegration:oe,sendFeedback:zC,shadow:Qe(G)});return ie},x=(G,Y={})=>{const te=jl(Q,Y),oe=typeof G=="string"?Ft.querySelector(G):typeof G.addEventListener=="function"?G:null;if(!oe)throw cc&&Ie.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let ie=null;const pe=async()=>{ie||(ie=await k({...te,onFormSubmitted:()=>{var Ue;ie==null||ie.removeFromDom(),(Ue=te.onFormSubmitted)==null||Ue.call(te)}})),ie.appendToDom(),ie.open()};oe.addEventListener("click",pe);const se=()=>{ge=ge.filter(Ue=>Ue!==se),ie==null||ie.removeFromDom(),ie=null,oe.removeEventListener("click",pe)};return ge.push(se),se},q=(G={})=>{const Y=jl(Q,G),te=Qe(Y),oe=XC({triggerLabel:Y.triggerLabel,triggerAriaLabel:Y.triggerAriaLabel,shadow:te,styleNonce:w});return x(oe.el,{...Y,onFormOpen(){oe.hide()},onFormClose(){oe.show()},onFormSubmitted(){oe.show()}}),oe};return{name:"Feedback",setupOnce(){!tb()||!Q.autoInject||(Ft.readyState==="loading"?Ft.addEventListener("DOMContentLoaded",()=>q().appendToDom()):q().appendToDom())},attachTo:x,createWidget(G={}){const Y=q(jl(Q,G));return Y.appendToDom(),Y},async createForm(G={}){return k(jl(Q,G))},setTheme(G){if(Q.colorScheme=G,me){const Y=zm(Q);be?me.replaceChild(Y,be):me.prepend(Y),be=Y}},remove(){var G;me&&((G=me.parentElement)==null||G.remove(),me=null,be=null),ge.forEach(Y=>Y()),ge=[]}}});var iu,Bt,ob,js,Gm,sb,Cf,Ba={},$p=[],ex=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Np=Array.isArray;function as(e,t){for(var n in t)e[n]=t[n];return e}function ib(e){var t=e.parentNode;t&&t.removeChild(e)}function at(e,t,n){var r,o,s,i={};for(s in t)s=="key"?r=t[s]:s=="ref"?o=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?iu.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)i[s]===void 0&&(i[s]=e.defaultProps[s]);return uc(e,i,r,o,null)}function uc(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++ob,__i:-1,__u:0};return o==null&&Bt.vnode!=null&&Bt.vnode(s),s}function nl(e){return e.children}function dc(e,t){this.props=e,this.context=t}function Di(e,t){if(t==null)return e.__?Di(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Di(e):null}function tx(e,t,n){var r,o=e.__v,s=o.__e,i=e.__P;if(i)return(r=as({},o)).__v=o.__v+1,Bt.vnode&&Bt.vnode(r),Lp(i,r,o,e.__n,i.ownerSVGElement!==void 0,32&o.__u?[s]:null,t,s??Di(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=s&&ab(r),r}function ab(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return ab(e)}}function Km(e){(!e.__d&&(e.__d=!0)&&js.push(e)&&!Rc.__r++||Gm!==Bt.debounceRendering)&&((Gm=Bt.debounceRendering)||sb)(Rc)}function Rc(){var e,t,n,r=[],o=[];for(js.sort(Cf);e=js.shift();)e.__d&&(n=js.length,t=tx(e,r,o)||t,n===0||js.length>n?(xf(r,t,o),o.length=r.length=0,t=void 0,js.sort(Cf)):t&&Bt.__c&&Bt.__c(t,$p));t&&xf(r,t,o),Rc.__r=0}function lb(e,t,n,r,o,s,i,a,l,c,u){var d,h,g,w,E,D=r&&r.__k||$p,C=t.length;for(n.__d=l,nx(n,t,D),l=n.__d,d=0;d<C;d++)(g=n.__k[d])!=null&&typeof g!="boolean"&&typeof g!="function"&&(h=g.__i===-1?Ba:D[g.__i]||Ba,g.__i=d,Lp(e,g,h,o,s,i,a,l,c,u),w=g.__e,g.ref&&h.ref!=g.ref&&(h.ref&&Dp(h.ref,null,g),u.push(g.ref,g.__c||w,g)),E==null&&w!=null&&(E=w),65536&g.__u||h.__k===g.__k?l=cb(g,l,e):typeof g.type=="function"&&g.__d!==void 0?l=g.__d:w&&(l=w.nextSibling),g.__d=void 0,g.__u&=-196609);n.__d=l,n.__e=E}function nx(e,t,n){var r,o,s,i,a,l=t.length,c=n.length,u=c,d=0;for(e.__k=[],r=0;r<l;r++)(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?uc(null,o,null,null,o):Np(o)?uc(nl,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?uc(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,a=rx(o,n,i=r+d,u),o.__i=a,s=null,a!==-1&&(u--,(s=n[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&d--,typeof o.type!="function"&&(o.__u|=65536)):a!==i&&(a===i+1?d++:a>i?u>l-i?d+=a-i:d--:d=a<i&&a==i-1?a-i:0,a!==r+d&&(o.__u|=65536))):(s=n[r])&&s.key==null&&s.__e&&(s.__e==e.__d&&(e.__d=Di(s)),If(s,s,!1),n[r]=null,u--);if(u)for(r=0;r<c;r++)(s=n[r])!=null&&(131072&s.__u)==0&&(s.__e==e.__d&&(e.__d=Di(s)),If(s,s))}function cb(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=cb(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function rx(e,t,n,r){var o=e.key,s=e.type,i=n-1,a=n+1,l=t[n];if(l===null||l&&o==l.key&&s===l.type)return n;if(r>(l!=null&&(131072&l.__u)==0?1:0))for(;i>=0||a<t.length;){if(i>=0){if((l=t[i])&&(131072&l.__u)==0&&o==l.key&&s===l.type)return i;i--}if(a<t.length){if((l=t[a])&&(131072&l.__u)==0&&o==l.key&&s===l.type)return a;a++}}return-1}function Ym(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||ex.test(t)?n:n+"px"}function Bl(e,t,n,r,o){var s;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ym(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ym(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")s=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,s?Xm:Jm,s)):e.removeEventListener(t,s?Xm:Jm,s);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Jm(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Bt.event?Bt.event(e):e)}}function Xm(e){if(this.l)return this.l[e.type+!0](Bt.event?Bt.event(e):e)}function Lp(e,t,n,r,o,s,i,a,l,c){var u,d,h,g,w,E,D,C,I,V,z,ce,re,Z,de,_e=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),s=[a=t.__e=n.__e]),(u=Bt.__b)&&u(t);e:if(typeof _e=="function")try{if(C=t.props,I=(u=_e.contextType)&&r[u.__c],V=u?I?I.props.value:u.__:r,n.__c?D=(d=t.__c=n.__c).__=d.__E:("prototype"in _e&&_e.prototype.render?t.__c=d=new _e(C,V):(t.__c=d=new dc(C,V),d.constructor=_e,d.render=sx),I&&I.sub(d),d.props=C,d.state||(d.state={}),d.context=V,d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),d.__s==null&&(d.__s=d.state),_e.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=as({},d.__s)),as(d.__s,_e.getDerivedStateFromProps(C,d.__s))),g=d.props,w=d.state,d.__v=t,h)_e.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(_e.getDerivedStateFromProps==null&&C!==g&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(C,V),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(C,d.__s,V)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=C,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(Te){Te&&(Te.__=t)}),z=0;z<d._sb.length;z++)d.__h.push(d._sb[z]);d._sb=[],d.__h.length&&i.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(C,d.__s,V),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(g,w,E)})}if(d.context=V,d.props=C,d.__P=e,d.__e=!1,ce=Bt.__r,re=0,"prototype"in _e&&_e.prototype.render){for(d.state=d.__s,d.__d=!1,ce&&ce(t),u=d.render(d.props,d.state,d.context),Z=0;Z<d._sb.length;Z++)d.__h.push(d._sb[Z]);d._sb=[]}else do d.__d=!1,ce&&ce(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++re<25);d.state=d.__s,d.getChildContext!=null&&(r=as(as({},r),d.getChildContext())),h||d.getSnapshotBeforeUpdate==null||(E=d.getSnapshotBeforeUpdate(g,w)),lb(e,Np(de=u!=null&&u.type===nl&&u.key==null?u.props.children:u)?de:[de],t,n,r,o,s,i,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&i.push(d),D&&(d.__E=d.__=null)}catch(Te){t.__v=null,l||s!=null?(t.__e=a,t.__u|=l?160:32,s[s.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Bt.__e(Te,t,n)}else s==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ox(n.__e,t,n,r,o,s,i,l,c);(u=Bt.diffed)&&u(t)}function xf(e,t,n){for(var r=0;r<n.length;r++)Dp(n[r],n[++r],n[++r]);Bt.__c&&Bt.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){Bt.__e(s,o.__v)}})}function ox(e,t,n,r,o,s,i,a,l){var c,u,d,h,g,w,E,D=n.props,C=t.props,I=t.type;if(I==="svg"&&(o=!0),s!=null){for(c=0;c<s.length;c++)if((g=s[c])&&"setAttribute"in g==!!I&&(I?g.localName===I:g.nodeType===3)){e=g,s[c]=null;break}}if(e==null){if(I===null)return document.createTextNode(C);e=o?document.createElementNS("http://www.w3.org/2000/svg",I):document.createElement(I,C.is&&C),s=null,a=!1}if(I===null)D===C||a&&e.data===C||(e.data=C);else{if(s=s&&iu.call(e.childNodes),D=n.props||Ba,!a&&s!=null)for(D={},c=0;c<e.attributes.length;c++)D[(g=e.attributes[c]).name]=g.value;for(c in D)g=D[c],c=="children"||(c=="dangerouslySetInnerHTML"?d=g:c==="key"||c in C||Bl(e,c,null,g,o));for(c in C)g=C[c],c=="children"?h=g:c=="dangerouslySetInnerHTML"?u=g:c=="value"?w=g:c=="checked"?E=g:c==="key"||a&&typeof g!="function"||D[c]===g||Bl(e,c,g,D[c],o);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),lb(e,Np(h)?h:[h],t,n,r,o&&I!=="foreignObject",s,i,s?s[0]:n.__k&&Di(n,0),a,l),s!=null)for(c=s.length;c--;)s[c]!=null&&ib(s[c]);a||(c="value",w!==void 0&&(w!==e[c]||I==="progress"&&!w||I==="option"&&w!==D[c])&&Bl(e,c,w,D[c],!1),c="checked",E!==void 0&&E!==e[c]&&Bl(e,c,E,D[c],!1))}return e}function Dp(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){Bt.__e(r,n)}}function If(e,t,n){var r,o;if(Bt.unmount&&Bt.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Dp(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){Bt.__e(s,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&If(r[o],t,n||typeof e.type!="function");n||e.__e==null||ib(e.__e),e.__=e.__e=e.__d=void 0}function sx(e,t,n){return this.constructor(e,n)}function ix(e,t,n){var r,o,s,i;Bt.__&&Bt.__(e,t),o=(r=!1)?null:t.__k,s=[],i=[],Lp(t,e=t.__k=at(nl,null,[e]),o||Ba,Ba,t.ownerSVGElement!==void 0,o?null:t.firstChild?iu.call(t.childNodes):null,s,o?o.__e:t.firstChild,r,i),e.__d=void 0,xf(s,e,i)}iu=$p.slice,Bt={__e:function(e,t,n,r){for(var o,s,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(a){e=a}throw e}},ob=0,dc.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=as({},this.state),typeof e=="function"&&(e=e(as({},n),this.props)),e&&as(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Km(this))},dc.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Km(this))},dc.prototype.render=nl,js=[],sb=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cf=function(e,t){return e.__v.__b-t.__v.__b},Rc.__r=0;var Wo,jt,hd,Qm,Oi=0,ub=[],fc=[],Qt=Bt,Zm=Qt.__b,eg=Qt.__r,tg=Qt.diffed,ng=Qt.__c,rg=Qt.unmount,og=Qt.__;function ti(e,t){Qt.__h&&Qt.__h(jt,e,Oi||t),Oi=0;var n=jt.__H||(jt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:fc}),n.__[e]}function Us(e){return Oi=1,db(pb,e)}function db(e,t,n){var r=ti(Wo++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):pb(void 0,t),function(a){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,a);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=jt,!jt.u)){var o=function(a,l,c){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(h){return!!h.__c});if(u.every(function(h){return!h.__N}))return!s||s.call(this,a,l,c);var d=!1;return u.forEach(function(h){if(h.__N){var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(d=!0)}}),!(!d&&r.__c.props===a)&&(!s||s.call(this,a,l,c))};jt.u=!0;var s=jt.shouldComponentUpdate,i=jt.componentWillUpdate;jt.componentWillUpdate=function(a,l,c){if(this.__e){var u=s;s=void 0,o(a,l,c),s=u}i&&i.call(this,a,l,c)},jt.shouldComponentUpdate=o}return r.__N||r.__}function ax(e,t){var n=ti(Wo++,3);!Qt.__s&&Op(n.__H,t)&&(n.__=e,n.i=t,jt.__H.__h.push(n))}function fb(e,t){var n=ti(Wo++,4);!Qt.__s&&Op(n.__H,t)&&(n.__=e,n.i=t,jt.__h.push(n))}function lx(e){return Oi=5,rl(function(){return{current:e}},[])}function cx(e,t,n){Oi=6,fb(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function rl(e,t){var n=ti(Wo++,7);return Op(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Ci(e,t){return Oi=8,rl(function(){return e},t)}function ux(e){var t=jt.context[e.__c],n=ti(Wo++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(jt)),t.props.value):e.__}function dx(e,t){Qt.useDebugValue&&Qt.useDebugValue(t?t(e):e)}function fx(e){var t=ti(Wo++,10),n=Us();return t.__=e,jt.componentDidCatch||(jt.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function px(){var e=ti(Wo++,11);if(!e.__){for(var t=jt.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function hx(){for(var e;e=ub.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(pc),e.__H.__h.forEach(Af),e.__H.__h=[]}catch(t){e.__H.__h=[],Qt.__e(t,e.__v)}}Qt.__b=function(e){jt=null,Zm&&Zm(e)},Qt.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),og&&og(e,t)},Qt.__r=function(e){eg&&eg(e),Wo=0;var t=(jt=e.__c).__H;t&&(hd===jt?(t.__h=[],jt.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=fc,n.__N=n.i=void 0})):(t.__h.forEach(pc),t.__h.forEach(Af),t.__h=[],Wo=0)),hd=jt},Qt.diffed=function(e){tg&&tg(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ub.push(t)!==1&&Qm===Qt.requestAnimationFrame||((Qm=Qt.requestAnimationFrame)||mx)(hx)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==fc&&(n.__=n.__V),n.i=void 0,n.__V=fc})),hd=jt=null},Qt.__c=function(e,t){t.some(function(n){try{n.__h.forEach(pc),n.__h=n.__h.filter(function(r){return!r.__||Af(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Qt.__e(r,n.__v)}}),ng&&ng(e,t)},Qt.unmount=function(e){rg&&rg(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{pc(r)}catch(o){t=o}}),n.__H=void 0,t&&Qt.__e(t,n.__v))};var sg=typeof requestAnimationFrame=="function";function mx(e){var t,n=function(){clearTimeout(r),sg&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);sg&&(t=requestAnimationFrame(n))}function pc(e){var t=jt,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),jt=t}function Af(e){var t=jt;e.__c=e.__(),jt=t}function Op(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function pb(e,t){return typeof t=="function"?t(e):t}const gx=Object.defineProperty({__proto__:null,useCallback:Ci,useContext:ux,useDebugValue:dx,useEffect:ax,useErrorBoundary:fx,useId:px,useImperativeHandle:cx,useLayoutEffect:fb,useMemo:rl,useReducer:db,useRef:lx,useState:Us},Symbol.toStringTag,{value:"Module"}),vx="http://www.w3.org/2000/svg";function _x(){const e=r=>Ft.createElementNS(vx,r),t=gr(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=gr(e("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return t.appendChild(n),t}function yx({options:e}){const t=rl(()=>({__html:_x().outerHTML}),[]);return at("h2",{class:"dialog__header"},at("span",{class:"dialog__title"},e.formTitle),e.showBranding?at("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function bx(e,t){const n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}function md(e,t){const n=e.get(t);return typeof n=="string"?n.trim():""}function wx({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:s,onSubmitError:i,showEmail:a,showName:l,screenshotInput:c}){const{tags:u,addScreenshotButtonLabel:d,removeScreenshotButtonLabel:h,cancelButtonLabel:g,emailLabel:w,emailPlaceholder:E,isEmailRequired:D,isNameRequired:C,messageLabel:I,messagePlaceholder:V,nameLabel:z,namePlaceholder:ce,submitButtonLabel:re,isRequiredLabel:Z}=e,[de,_e]=Us(!1),[Te,fe]=Us(null),[H,ee]=Us(!1),Se=c==null?void 0:c.input,[Ne,ye]=Us(null),Re=Ci(Pe=>{ye(Pe),ee(!1)},[]),ue=Ci(Pe=>{const ke=bx(Pe,{emailLabel:w,isEmailRequired:D,isNameRequired:C,messageLabel:I,nameLabel:z});return ke.length>0?fe(`Please enter in the following required fields: ${ke.join(", ")}`):fe(null),ke.length===0},[w,D,C,I,z]),Me=Ci(async Pe=>{_e(!0);try{if(Pe.preventDefault(),!(Pe.target instanceof HTMLFormElement))return;const ke=new FormData(Pe.target),We=await(c&&H?c.value():void 0),Ye={name:md(ke,"name"),email:md(ke,"email"),message:md(ke,"message"),attachments:We?[We]:void 0};if(!ue(Ye))return;try{const Je=await o({name:Ye.name,email:Ye.email,message:Ye.message,source:qC,tags:u},{attachments:Ye.attachments});s(Ye,Je)}catch(Je){cc&&Ie.error(Je),fe(Je),i(Je)}}finally{_e(!1)}},[c&&H,s,i]);return at("form",{class:"form",onSubmit:Me},Se&&H?at(Se,{onError:Re}):null,at("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:de},at("div",{class:"form__top"},Te?at("div",{class:"form__error-container"},Te):null,l?at("label",{for:"name",class:"form__label"},at(gd,{label:z,isRequiredLabel:Z,isRequired:C}),at("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:ce,required:C,type:"text"})):at("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?at("label",{for:"email",class:"form__label"},at(gd,{label:w,isRequiredLabel:Z,isRequired:D}),at("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:E,required:D,type:"email"})):at("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),at("label",{for:"message",class:"form__label"},at(gd,{label:I,isRequiredLabel:Z,isRequired:!0}),at("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:V,required:!0,rows:5})),Se?at("label",{for:"screenshot",class:"form__label"},at("button",{class:"btn btn--default",disabled:de,type:"button",onClick:()=>{ye(null),ee(Pe=>!Pe)}},H?h:d),Ne?at("div",{class:"form__error-container"},Ne.message):null):null),at("div",{class:"btn-group"},at("button",{class:"btn btn--primary",disabled:de,type:"submit"},re),at("button",{class:"btn btn--default",disabled:de,type:"button",onClick:r},g))))}function gd({label:e,isRequired:t,isRequiredLabel:n}){return at("span",{class:"form__label__text"},e,t&&at("span",{class:"form__label__text--required"},n))}const Ul=16,ig=17,Sx="http://www.w3.org/2000/svg";function Tx(){const e=l=>Gr.document.createElementNS(Sx,l),t=gr(e("svg"),{width:`${Ul}`,height:`${ig}`,viewBox:`0 0 ${Ul} ${ig}`,fill:"inherit"}),n=gr(e("g"),{clipPath:"url(#clip0_57_156)"}),r=gr(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),o=gr(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(o,r);const s=e("defs"),i=gr(e("clipPath"),{id:"clip0_57_156"}),a=gr(e("rect"),{width:`${Ul}`,height:`${Ul}`,fill:"white",transform:"translate(0 0.5)"});return i.appendChild(a),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(a),t}function Ex({open:e,onFormSubmitted:t,...n}){const r=n.options,o=rl(()=>({__html:Tx().outerHTML}),[]),[s,i]=Us(null),a=Ci(()=>{s&&(clearTimeout(s),i(null)),t()},[s]),l=Ci((c,u)=>{n.onSubmitSuccess(c,u),i(setTimeout(()=>{t(),i(null)},VC))},[t]);return at(nl,null,s?at("div",{class:"success__position",onClick:a},at("div",{class:"success__content"},r.successMessageText,at("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):at("dialog",{class:"dialog",onClick:r.onFormClose,open:e},at("div",{class:"dialog__position"},at("div",{class:"dialog__content",onClick:c=>{c.stopPropagation()}},at(yx,{options:r}),at(wx,{...n,onSubmitSuccess:l})))))}const kx=`
|
|
123
|
+
.dialog {
|
|
124
|
+
position: fixed;
|
|
125
|
+
z-index: var(--z-index);
|
|
126
|
+
margin: 0;
|
|
127
|
+
inset: 0;
|
|
128
|
+
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
justify-content: center;
|
|
132
|
+
padding: 0;
|
|
133
|
+
height: 100vh;
|
|
134
|
+
width: 100vw;
|
|
135
|
+
|
|
136
|
+
color: var(--dialog-color, var(--foreground));
|
|
137
|
+
fill: var(--dialog-color, var(--foreground));
|
|
138
|
+
line-height: 1.75em;
|
|
139
|
+
|
|
140
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
141
|
+
border: none;
|
|
142
|
+
inset: 0;
|
|
143
|
+
opacity: 1;
|
|
144
|
+
transition: opacity 0.2s ease-in-out;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.dialog__position {
|
|
148
|
+
position: fixed;
|
|
149
|
+
z-index: var(--z-index);
|
|
150
|
+
inset: var(--dialog-inset);
|
|
151
|
+
padding: var(--page-margin);
|
|
152
|
+
display: flex;
|
|
153
|
+
max-height: calc(100vh - (2 * var(--page-margin)));
|
|
154
|
+
}
|
|
155
|
+
@media (max-width: 600px) {
|
|
156
|
+
.dialog__position {
|
|
157
|
+
inset: var(--page-margin);
|
|
158
|
+
padding: 0;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.dialog__position:has(.editor) {
|
|
163
|
+
inset: var(--page-margin);
|
|
164
|
+
padding: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.dialog:not([open]) {
|
|
168
|
+
opacity: 0;
|
|
169
|
+
pointer-events: none;
|
|
170
|
+
visibility: hidden;
|
|
171
|
+
}
|
|
172
|
+
.dialog:not([open]) .dialog__content {
|
|
173
|
+
transform: translate(0, -16px) scale(0.98);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.dialog__content {
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
gap: 16px;
|
|
180
|
+
padding: var(--dialog-padding, 24px);
|
|
181
|
+
max-width: 100%;
|
|
182
|
+
width: 100%;
|
|
183
|
+
max-height: 100%;
|
|
184
|
+
overflow: auto;
|
|
185
|
+
|
|
186
|
+
background: var(--dialog-background, var(--background));
|
|
187
|
+
border-radius: var(--dialog-border-radius, 20px);
|
|
188
|
+
border: var(--dialog-border, var(--border));
|
|
189
|
+
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
|
|
190
|
+
transform: translate(0, 0) scale(1);
|
|
191
|
+
transition: transform 0.2s ease-in-out;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
`,Cx=`
|
|
195
|
+
.dialog__header {
|
|
196
|
+
display: flex;
|
|
197
|
+
gap: 4px;
|
|
198
|
+
justify-content: space-between;
|
|
199
|
+
font-weight: var(--dialog-header-weight, 600);
|
|
200
|
+
margin: 0;
|
|
201
|
+
}
|
|
202
|
+
.dialog__title {
|
|
203
|
+
align-self: center;
|
|
204
|
+
width: var(--form-width, 272px);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@media (max-width: 600px) {
|
|
208
|
+
.dialog__title {
|
|
209
|
+
width: auto;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.dialog__position:has(.editor) .dialog__title {
|
|
214
|
+
width: auto;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
.brand-link {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
}
|
|
221
|
+
.brand-link:focus-visible {
|
|
222
|
+
outline: var(--outline);
|
|
223
|
+
}
|
|
224
|
+
`,xx=`
|
|
225
|
+
.form {
|
|
226
|
+
display: flex;
|
|
227
|
+
overflow: auto;
|
|
228
|
+
flex-direction: row;
|
|
229
|
+
gap: 16px;
|
|
230
|
+
flex: 1 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.form fieldset {
|
|
234
|
+
border: none;
|
|
235
|
+
margin: 0;
|
|
236
|
+
padding: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.form__right {
|
|
240
|
+
flex: 0 0 auto;
|
|
241
|
+
display: flex;
|
|
242
|
+
overflow: auto;
|
|
243
|
+
flex-direction: column;
|
|
244
|
+
justify-content: space-between;
|
|
245
|
+
gap: 20px;
|
|
246
|
+
width: var(--form-width, 100%);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.dialog__position:has(.editor) .form__right {
|
|
250
|
+
width: var(--form-width, 272px);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.form__top {
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-direction: column;
|
|
256
|
+
gap: 8px;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.form__error-container {
|
|
260
|
+
color: var(--error-color);
|
|
261
|
+
fill: var(--error-color);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.form__label {
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-direction: column;
|
|
267
|
+
gap: 4px;
|
|
268
|
+
margin: 0px;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.form__label__text {
|
|
272
|
+
display: flex;
|
|
273
|
+
gap: 4px;
|
|
274
|
+
align-items: center;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.form__label__text--required {
|
|
278
|
+
font-size: 0.85em;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.form__input {
|
|
282
|
+
font-family: inherit;
|
|
283
|
+
line-height: inherit;
|
|
284
|
+
background: transparent;
|
|
285
|
+
box-sizing: border-box;
|
|
286
|
+
border: var(--input-border, var(--border));
|
|
287
|
+
border-radius: var(--input-border-radius, 6px);
|
|
288
|
+
color: var(--input-color, inherit);
|
|
289
|
+
fill: var(--input-color, inherit);
|
|
290
|
+
font-size: var(--input-font-size, inherit);
|
|
291
|
+
font-weight: var(--input-font-weight, 500);
|
|
292
|
+
padding: 6px 12px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.form__input::placeholder {
|
|
296
|
+
opacity: 0.65;
|
|
297
|
+
color: var(--input-placeholder-color, inherit);
|
|
298
|
+
filter: var(--interactive-filter);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.form__input:focus-visible {
|
|
302
|
+
outline: var(--input-focus-outline, var(--outline));
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.form__input--textarea {
|
|
306
|
+
font-family: inherit;
|
|
307
|
+
resize: vertical;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.error {
|
|
311
|
+
color: var(--error-color);
|
|
312
|
+
fill: var(--error-color);
|
|
313
|
+
}
|
|
314
|
+
`,Ix=`
|
|
315
|
+
.btn-group {
|
|
316
|
+
display: grid;
|
|
317
|
+
gap: 8px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.btn {
|
|
321
|
+
line-height: inherit;
|
|
322
|
+
border: var(--button-border, var(--border));
|
|
323
|
+
border-radius: var(--button-border-radius, 6px);
|
|
324
|
+
cursor: pointer;
|
|
325
|
+
font-family: inherit;
|
|
326
|
+
font-size: var(--button-font-size, inherit);
|
|
327
|
+
font-weight: var(--button-font-weight, 600);
|
|
328
|
+
padding: var(--button-padding, 6px 16px);
|
|
329
|
+
}
|
|
330
|
+
.btn[disabled] {
|
|
331
|
+
opacity: 0.6;
|
|
332
|
+
pointer-events: none;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.btn--primary {
|
|
336
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
337
|
+
fill: var(--button-primary-color, var(--accent-foreground));
|
|
338
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
339
|
+
border: var(--button-primary-border, var(--border));
|
|
340
|
+
border-radius: var(--button-primary-border-radius, 6px);
|
|
341
|
+
font-weight: var(--button-primary-font-weight, 500);
|
|
342
|
+
}
|
|
343
|
+
.btn--primary:hover {
|
|
344
|
+
color: var(--button-primary-hover-color, var(--accent-foreground));
|
|
345
|
+
fill: var(--button-primary-hover-color, var(--accent-foreground));
|
|
346
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
347
|
+
filter: var(--interactive-filter);
|
|
348
|
+
}
|
|
349
|
+
.btn--primary:focus-visible {
|
|
350
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
351
|
+
filter: var(--interactive-filter);
|
|
352
|
+
outline: var(--button-primary-focus-outline, var(--outline));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.btn--default {
|
|
356
|
+
color: var(--button-color, var(--foreground));
|
|
357
|
+
fill: var(--button-color, var(--foreground));
|
|
358
|
+
background: var(--button-background, var(--background));
|
|
359
|
+
border: var(--button-border, var(--border));
|
|
360
|
+
border-radius: var(--button-border-radius, 6px);
|
|
361
|
+
font-weight: var(--button-font-weight, 500);
|
|
362
|
+
}
|
|
363
|
+
.btn--default:hover {
|
|
364
|
+
color: var(--button-color, var(--foreground));
|
|
365
|
+
fill: var(--button-color, var(--foreground));
|
|
366
|
+
background: var(--button-hover-background, var(--background));
|
|
367
|
+
filter: var(--interactive-filter);
|
|
368
|
+
}
|
|
369
|
+
.btn--default:focus-visible {
|
|
370
|
+
background: var(--button-hover-background, var(--background));
|
|
371
|
+
filter: var(--interactive-filter);
|
|
372
|
+
outline: var(--button-focus-outline, var(--outline));
|
|
373
|
+
}
|
|
374
|
+
`,Ax=`
|
|
375
|
+
.success__position {
|
|
376
|
+
position: fixed;
|
|
377
|
+
inset: var(--dialog-inset);
|
|
378
|
+
padding: var(--page-margin);
|
|
379
|
+
z-index: var(--z-index);
|
|
380
|
+
}
|
|
381
|
+
.success__content {
|
|
382
|
+
background: var(--success-background, var(--background));
|
|
383
|
+
border: var(--success-border, var(--border));
|
|
384
|
+
border-radius: var(--success-border-radius, 1.7em/50%);
|
|
385
|
+
box-shadow: var(--success-box-shadow, var(--box-shadow));
|
|
386
|
+
font-weight: var(--success-font-weight, 600);
|
|
387
|
+
color: var(--success-color);
|
|
388
|
+
fill: var(--success-color);
|
|
389
|
+
padding: 12px 24px;
|
|
390
|
+
line-height: 1.75em;
|
|
391
|
+
|
|
392
|
+
display: grid;
|
|
393
|
+
align-items: center;
|
|
394
|
+
grid-auto-flow: column;
|
|
395
|
+
gap: 6px;
|
|
396
|
+
cursor: default;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.success__icon {
|
|
400
|
+
display: flex;
|
|
401
|
+
}
|
|
402
|
+
`;function Rx(e){const t=Ft.createElement("style");return t.textContent=`
|
|
403
|
+
:host {
|
|
404
|
+
--dialog-inset: var(--inset);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
${kx}
|
|
408
|
+
${Cx}
|
|
409
|
+
${xx}
|
|
410
|
+
${Ix}
|
|
411
|
+
${Ax}
|
|
412
|
+
`,e&&t.setAttribute("nonce",e),t}function Mx(){const e=Ct().getUser(),t=Or().getUser(),n=oy().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}const Px=(()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const o=r,s=e.useSentryUser,i=Mx(),a=Ft.createElement("div"),l=Rx(e.styleNonce);let c="";const u={get el(){return a},appendToDom(){!o.contains(l)&&!o.contains(a)&&(o.appendChild(l),o.appendChild(a))},removeFromDom(){a.remove(),l.remove(),Ft.body.style.overflow=c},open(){var g,w;h(!0),(g=e.onFormOpen)==null||g.call(e),(w=vt())==null||w.emit("openFeedbackWidget"),c=Ft.body.style.overflow,Ft.body.style.overflow="hidden"},close(){h(!1),Ft.body.style.overflow=c}},d=t==null?void 0:t.createInput({h:at,hooks:gx,dialog:u,options:e}),h=g=>{ix(at(Ex,{options:e,screenshotInput:d,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(s&&(i==null?void 0:i[s.name])||""),defaultEmail:String(s&&(i==null?void 0:i[s.email])||""),onFormClose:()=>{var w;h(!1),(w=e.onFormClose)==null||w.call(e)},onSubmit:n,onSubmitSuccess:(w,E)=>{var D;h(!1),(D=e.onSubmitSuccess)==null||D.call(e,w,E)},onSubmitError:w=>{var E;(E=e.onSubmitError)==null||E.call(e,w)},onFormSubmitted:()=>{var w;(w=e.onFormSubmitted)==null||w.call(e)},open:g}),a)};return u}}));function $x({h:e}){return function(){return e("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},e("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),e("path",{strokeWidth:"1.5",d:"M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z"}),e("path",{strokeWidth:"1.5",d:"M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z"}),e("path",{strokeWidth:"1.5",d:"M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z"}))}}function Nx(e){const t=Ft.createElement("style"),n="#1A141F",r="#302735";return t.textContent=`
|
|
413
|
+
.editor {
|
|
414
|
+
display: flex;
|
|
415
|
+
flex-grow: 1;
|
|
416
|
+
flex-direction: column;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.editor__image-container {
|
|
420
|
+
justify-items: center;
|
|
421
|
+
padding: 15px;
|
|
422
|
+
position: relative;
|
|
423
|
+
height: 100%;
|
|
424
|
+
border-radius: var(--menu-border-radius, 6px);
|
|
425
|
+
|
|
426
|
+
background-color: ${n};
|
|
427
|
+
background-image: repeating-linear-gradient(
|
|
428
|
+
-145deg,
|
|
429
|
+
transparent,
|
|
430
|
+
transparent 8px,
|
|
431
|
+
${n} 8px,
|
|
432
|
+
${n} 11px
|
|
433
|
+
),
|
|
434
|
+
repeating-linear-gradient(
|
|
435
|
+
-45deg,
|
|
436
|
+
transparent,
|
|
437
|
+
transparent 15px,
|
|
438
|
+
${r} 15px,
|
|
439
|
+
${r} 16px
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.editor__canvas-container {
|
|
444
|
+
width: 100%;
|
|
445
|
+
height: 100%;
|
|
446
|
+
position: relative;
|
|
447
|
+
display: flex;
|
|
448
|
+
align-items: center;
|
|
449
|
+
justify-content: center;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.editor__canvas-container > * {
|
|
453
|
+
object-fit: contain;
|
|
454
|
+
position: absolute;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.editor__tool-container {
|
|
458
|
+
padding-top: 8px;
|
|
459
|
+
display: flex;
|
|
460
|
+
justify-content: center;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.editor__tool-bar {
|
|
464
|
+
display: flex;
|
|
465
|
+
gap: 8px;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.editor__tool {
|
|
469
|
+
display: flex;
|
|
470
|
+
padding: 8px 12px;
|
|
471
|
+
justify-content: center;
|
|
472
|
+
align-items: center;
|
|
473
|
+
border: var(--button-border, var(--border));
|
|
474
|
+
border-radius: var(--button-border-radius, 6px);
|
|
475
|
+
background: var(--button-background, var(--background));
|
|
476
|
+
color: var(--button-color, var(--foreground));
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.editor__tool--active {
|
|
480
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
481
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.editor__rect {
|
|
485
|
+
position: absolute;
|
|
486
|
+
z-index: 2;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.editor__rect button {
|
|
490
|
+
opacity: 0;
|
|
491
|
+
position: absolute;
|
|
492
|
+
top: -12px;
|
|
493
|
+
right: -12px;
|
|
494
|
+
cursor: pointer;
|
|
495
|
+
padding: 0;
|
|
496
|
+
z-index: 3;
|
|
497
|
+
border: none;
|
|
498
|
+
background: none;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.editor__rect:hover button {
|
|
502
|
+
opacity: 1;
|
|
503
|
+
}
|
|
504
|
+
`,e&&t.setAttribute("nonce",e),t}function Lx({h:e}){return function({action:n,setAction:r,options:o}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},o.highlightToolText),e("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},o.hideToolText)))}}function Dx({hooks:e}){function t(){const[n,r]=e.useState(Gr.devicePixelRatio??1);return e.useEffect(()=>{const o=()=>{r(Gr.devicePixelRatio)},s=matchMedia(`(resolution: ${Gr.devicePixelRatio}dppx)`);return s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:s,onError:i}){const a=t();e.useEffect(()=>{(async()=>{r();const c=await ma.mediaDevices.getDisplayMedia({video:{width:Gr.innerWidth*a,height:Gr.innerHeight*a},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),u=Ft.createElement("video");await new Promise((d,h)=>{u.srcObject=c,u.onloadedmetadata=()=>{o(u,a),c.getTracks().forEach(g=>g.stop()),d()},u.play().catch(h)}),s()})().catch(i)},[])}}function Ox(e,t,n){switch(e.type){case"highlight":{t.shadowColor="rgba(0, 0, 0, 0.7)",t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break}case"hide":t.fillStyle="rgb(0, 0, 0)",t.fillRect(e.x,e.y,e.w,e.h);break}}function rs(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function vd(e,t){rs(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function _d(e,t,n){rs(e,{alpha:!0},(r,o)=>{n.length&&(o.fillStyle="rgba(0, 0, 0, 0.25)",o.fillRect(0,0,r.width,r.height)),n.forEach(s=>{Ox(s,o,t)})})}function Fx({h:e,hooks:t,outputBuffer:n,dialog:r,options:o}){const s=Dx({hooks:t}),i=Lx({h:e}),a=$x({h:e}),l={__html:Nx(o.styleNonce).innerText},c=r.el.style,u=({screenshot:d})=>{const[h,g]=t.useState("highlight"),[w,E]=t.useState([]),D=t.useRef(null),C=t.useRef(null),I=t.useRef(null),V=t.useRef(null),[z,ce]=t.useState(1),re=t.useMemo(()=>{const H=Ft.getElementById(o.id);if(!H)return"white";const ee=getComputedStyle(H);return ee.getPropertyValue("--button-primary-background")||ee.getPropertyValue("--accent-background")},[o.id]);t.useLayoutEffect(()=>{const H=()=>{const ee=D.current;ee&&(rs(d.canvas,{alpha:!1},Se=>{const Ne=Math.min(ee.clientWidth/Se.width,ee.clientHeight/Se.height);ce(Ne)}),(ee.clientHeight===0||ee.clientWidth===0)&&setTimeout(H,0))};return H(),Gr.addEventListener("resize",H),()=>{Gr.removeEventListener("resize",H)}},[d]);const Z=t.useCallback((H,ee)=>{rs(H,{alpha:!0},(Se,Ne)=>{Ne.scale(ee,ee),Se.width=d.canvas.width,Se.height=d.canvas.height})},[d]);t.useEffect(()=>{Z(C.current,d.dpi),vd(C.current,d.canvas)},[d]),t.useEffect(()=>{Z(I.current,d.dpi),rs(I.current,{alpha:!0},(H,ee)=>{ee.clearRect(0,0,H.width,H.height)}),_d(I.current,re,w)},[w,re]),t.useEffect(()=>{Z(n,d.dpi),vd(n,d.canvas),rs(Ft.createElement("canvas"),{alpha:!0},(H,ee)=>{ee.scale(d.dpi,d.dpi),H.width=d.canvas.width,H.height=d.canvas.height,_d(H,re,w),vd(n,H)})},[w,d,re]);const de=H=>{if(!h||!V.current)return;const ee=V.current.getBoundingClientRect(),Se={type:h,x:H.offsetX/z,y:H.offsetY/z},Ne=(ue,Me)=>{const Pe=(Me.clientX-ee.x)/z,ke=(Me.clientY-ee.y)/z;return{type:ue.type,x:Math.min(ue.x,Pe),y:Math.min(ue.y,ke),w:Math.abs(Pe-ue.x),h:Math.abs(ke-ue.y)}},ye=ue=>{rs(I.current,{alpha:!0},(Me,Pe)=>{Pe.clearRect(0,0,Me.width,Me.height)}),_d(I.current,re,[...w,Ne(Se,ue)])},Re=ue=>{const Me=Ne(Se,ue);Me.w*z>=1&&Me.h*z>=1&&E(Pe=>[...Pe,Me]),Ft.removeEventListener("mousemove",ye),Ft.removeEventListener("mouseup",Re)};Ft.addEventListener("mousemove",ye),Ft.addEventListener("mouseup",Re)},_e=t.useCallback(H=>ee=>{ee.preventDefault(),ee.stopPropagation(),E(Se=>{const Ne=[...Se];return Ne.splice(H,1),Ne})},[]),Te={width:`${d.canvas.width*z}px`,height:`${d.canvas.height*z}px`},fe=H=>{H.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:o.styleNonce,dangerouslySetInnerHTML:l}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:D},e("canvas",{ref:C,id:"background",style:Te}),e("canvas",{ref:I,id:"foreground",style:Te}),e("div",{ref:V,onMouseDown:de,style:Te},w.map((H,ee)=>e("div",{key:ee,class:"editor__rect",style:{top:`${H.y*z}px`,left:`${H.x*z}px`,width:`${H.w*z}px`,height:`${H.h*z}px`}},e("button",{"aria-label":o.removeHighlightText,onClick:_e(ee),onMouseDown:fe,onMouseUp:fe,type:"button"},e(a,null))))))),e(i,{options:o,action:h,setAction:g}))};return function({onError:h}){const[g,w]=t.useState();return s({onBeforeScreenshot:t.useCallback(()=>{c.display="none"},[]),onScreenshot:t.useCallback((E,D)=>{rs(Ft.createElement("canvas"),{alpha:!1},(C,I)=>{I.scale(D,D),C.width=E.videoWidth,C.height=E.videoHeight,I.drawImage(E,0,0,C.width,C.height),w({canvas:C,dpi:D})}),n.width=E.videoWidth,n.height=E.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{c.display="block"},[]),onError:t.useCallback(E=>{c.display="block",h(E)},[])}),g?e(u,{screenshot:g}):e("div",null)}}const jx=(()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const o=Ft.createElement("canvas");return{input:Fx({h:e,hooks:t,outputBuffer:o,dialog:n,options:r}),value:async()=>{const s=await new Promise(i=>{o.toBlob(i,"image/png")});if(s)return{data:new Uint8Array(await s.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}})),dt=gt;let Rf=0;function hb(){return Rf>0}function Bx(){Rf++,setTimeout(()=>{Rf--})}function Fi(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(Sp(e))return e}catch{return e}const r=function(...o){try{const s=o.map(i=>Fi(i,t));return e.apply(this,s)}catch(s){throw Bx(),nu(i=>{i.addEventProcessor(a=>(t.mechanism&&(pf(a,void 0),Pi(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),Rp(s)}),s}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}Q_(r,e),ur(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Fp(){const e=zi(),{referrer:t}=dt.document||{},{userAgent:n}=dt.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}const Ux=ZC({getModalIntegration:()=>Px,getScreenshotIntegration:()=>jx});function jp(e,t){const n=Bp(e,t),r={type:zx(t),value:Gx(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Hx(e,t,n,r){const o=vt(),s=o==null?void 0:o.getOptions().normalizeDepth,i=Qx(t),a={__serialized__:Ty(t,s)};if(i)return{exception:{values:[jp(e,i)]},extra:a};const l={exception:{values:[{type:tu(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Jx(t,{isUnhandledRejection:r})}]},extra:a};if(n){const c=Bp(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function yd(e,t){return{exception:{values:[jp(e,t)]}}}function Bp(e,t){const n=t.stacktrace||t.stack||"",r=Wx(t),o=Vx(t);try{return e(n,r,o)}catch{}return[]}const qx=/Minified React error #\d+;/i;function Wx(e){return e&&qx.test(e.message)?1:0}function Vx(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function mb(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function zx(e){const t=e==null?void 0:e.name;return!t&&mb(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function Gx(e){const t=e==null?void 0:e.message;return mb(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Lm(t.error):Lm(e):"No error message"}function Kx(e,t,n,r){const o=(n==null?void 0:n.syntheticException)||void 0,s=Up(e,t,o,r);return Pi(s),s.level="error",n!=null&&n.event_id&&(s.event_id=n.event_id),tl(s)}function Yx(e,t,n="info",r,o){const s=(r==null?void 0:r.syntheticException)||void 0,i=Mf(e,t,s,o);return i.level=n,r!=null&&r.event_id&&(i.event_id=r.event_id),tl(i)}function Up(e,t,n,r,o){let s;if(Y_(t)&&t.error)return yd(e,t.error);if(Zh(t)||UT(t)){const i=t;if("stack"in t)s=yd(e,t);else{const a=i.name||(Zh(i)?"DOMError":"DOMException"),l=i.message?`${a}: ${i.message}`:a;s=Mf(e,l,n,r),pf(s,l)}return"code"in i&&(s.tags={...s.tags,"DOMException.code":`${i.code}`}),s}return eu(t)?yd(e,t):Na(t)||tu(t)?(s=Hx(e,t,n,o),Pi(s,{synthetic:!0}),s):(s=Mf(e,t,n,r),pf(s,`${t}`),Pi(s,{synthetic:!0}),s)}function Mf(e,t,n,r){const o={};if(r&&n){const s=Bp(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),Pi(o,{synthetic:!0})}if(yp(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 Jx(e,{isUnhandledRejection:t}){const n=GT(e),r=t?"promise rejection":"exception";return Y_(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:tu(e)?`Event \`${Xx(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Xx(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Qx(e){return Object.values(e).find(t=>t instanceof Error)}class Zx extends yk{constructor(t){var u;const n=eI(t),r=dt.SENTRY_SDK_SOURCE||TC();Gy(n,"browser",["browser"],r),(u=n._metadata)!=null&&u.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,c=l??(a==null?void 0:a.enableMetrics)??!0;dt.document&&(s||i||c)&&dt.document.addEventListener("visibilitychange",()=>{dt.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),i&&Sf(this),c&&Dy(this))}),o&&this.on("beforeSendSession",Rk)}eventFromException(t,n){return Kx(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Yx(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 eI(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=dt.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const ol=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,nt=gt,tI=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",sl=(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=tI(t.value,n),e(t)))}},il=(e=!0)=>{var n,r;const t=(r=(n=nt.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},Ji=()=>{const e=il();return(e==null?void 0:e.activationStart)??0};function ds(e,t,n){nt.document&&nt.addEventListener(e,t,n)}function Mc(e,t,n){nt.document&&nt.removeEventListener(e,t,n)}let xi=-1;const gb=new Set,nI=()=>{var e,t;return((e=nt.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=nt.document)!=null&&t.prerendering)?0:1/0},hc=e=>{if(rI(e)&&xi>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of gb)t();isFinite(xi)||(xi=e.type==="visibilitychange"?e.timeStamp:0,Mc("prerenderingchange",hc,!0))}},al=()=>{var e;if(nt.document&&xi<0){const t=Ji();xi=(nt.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??nI(),ds("visibilitychange",hc,!0),ds("pagehide",hc,!0),ds("prerenderingchange",hc,!0)}return{get firstHiddenTime(){return xi},onHidden(t){gb.add(t)}}};function rI(e){var t;return e.type==="pagehide"||((t=nt.document)==null?void 0:t.visibilityState)==="hidden"}const oI=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,ll=(e,t=-1)=>{var s,i;const n=il();let r="navigate";return n&&((s=nt.document)!=null&&s.prerendering||Ji()>0?r="prerender":(i=nt.document)!=null&&i.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:oI(),navigationType:r}},bd=new WeakMap;function Hp(e,t){try{return bd.get(e)||bd.set(e,new t),bd.get(e)}catch{return new t}}class Pc{constructor(){Pc.prototype.__init.call(this),Pc.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 Xi=(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{}},qp=e=>{let t=!1;return()=>{t||(e(),t=!0)}},au=e=>{var t;(t=nt.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},sI=[1800,3e3],iI=(e,t={})=>{au(()=>{const n=al(),r=ll("FCP");let o;const i=Xi("paint",a=>{for(const l of a)l.name==="first-contentful-paint"&&(i.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Ji(),0),r.entries.push(l),o(!0)))});i&&(o=sl(e,r,sI,t.reportAllChanges))})},aI=[.1,.25],lI=(e,t={})=>{iI(qp(()=>{var l;const n=ll("CLS",0);let r;const o=al(),s=Hp(t,Pc),i=c=>{for(const u of c)s._processEntry(u);s._sessionValue>n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},a=Xi("layout-shift",i);a&&(r=sl(e,n,aI,t.reportAllChanges),o.onHidden(()=>{i(a.takeRecords()),r(!0)}),(l=nt==null?void 0:nt.setTimeout)==null||l.call(nt,r))}))};let vb=0,wd=1/0,Hl=0;const cI=e=>{e.forEach(t=>{t.interactionId&&(wd=Math.min(wd,t.interactionId),Hl=Math.max(Hl,t.interactionId),vb=Hl?(Hl-wd)/7+1:0)})};let Pf;const _b=()=>Pf?vb:performance.interactionCount||0,uI=()=>{"interactionCount"in performance||Pf||(Pf=Xi("event",cI,{type:"event",buffered:!0,durationThreshold:0}))},Sd=10;let yb=0;const dI=()=>_b()-yb;class $c{constructor(){$c.prototype.__init.call(this),$c.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){yb=_b(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(dI()/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<Sd||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>Sd){const i=this._longestInteractionList.splice(Sd);for(const a of i)this._longestInteractionMap.delete(a.id)}(s=this._onAfterProcessingINPCandidate)==null||s.call(this,r)}}}const bb=e=>{var n;const t=nt.requestIdleCallback||nt.setTimeout;((n=nt.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=qp(e),ds("visibilitychange",e,{once:!0,capture:!0}),ds("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Mc("visibilitychange",e,{capture:!0}),Mc("pagehide",e,{capture:!0})}))},fI=[200,500],pI=40,hI=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=al();au(()=>{uI();const r=ll("INP");let o;const s=Hp(t,$c),i=l=>{bb(()=>{for(const u of l)s._processEntry(u);const c=s._estimateP98LongestInteraction();c&&c._latency!==r.value&&(r.value=c._latency,r.entries=c.entries,o())})},a=Xi("event",i,{durationThreshold:t.durationThreshold??pI});o=sl(e,r,fI,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),o(!0)}))})};class mI{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const gI=[2500,4e3],vI=(e,t={})=>{au(()=>{const n=al(),r=ll("LCP");let o;const s=Hp(t,mI),i=l=>{t.reportAllChanges||(l=l.slice(-1));for(const c of l)s._processEntry(c),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-Ji(),0),r.entries=[c],o())},a=Xi("largest-contentful-paint",i);if(a){o=sl(e,r,gI,t.reportAllChanges);const l=qp(()=>{i(a.takeRecords()),a.disconnect(),o(!0)}),c=u=>{u.isTrusted&&(bb(l),Mc(u.type,c,{capture:!0}))};for(const u of["keydown","click","visibilitychange"])ds(u,c,{capture:!0})}})},_I=[800,1800],$f=e=>{var t,n;(t=nt.document)!=null&&t.prerendering?au(()=>$f(e)):((n=nt.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>$f(e),!0):setTimeout(e)},yI=(e,t={})=>{const n=ll("TTFB"),r=sl(e,n,_I,t.reportAllChanges);$f(()=>{const o=il();o&&(n.value=Math.max(o.responseStart-Ji(),0),n.entries=[o],r(!0))})},Sa={},Nc={};let wb,Sb,Tb,Eb;function kb(e,t=!1){return lu("cls",e,SI,wb,t)}function Cb(e,t=!1){return lu("lcp",e,TI,Sb,t)}function bI(e){return lu("ttfb",e,EI,Tb)}function wI(e){return lu("inp",e,kI,Eb)}function Ua(e,t){return xb(e,t),Nc[e]||(CI(e),Nc[e]=!0),Ib(e,t)}function cl(e,t){const n=Sa[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(o){ol&&Ie.error(`Error while triggering instrumentation handler.
|
|
505
|
+
Type: ${e}
|
|
506
|
+
Name: ${Bo(r)}
|
|
507
|
+
Error:`,o)}}function SI(){return lI(e=>{cl("cls",{metric:e}),wb=e},{reportAllChanges:!0})}function TI(){return vI(e=>{cl("lcp",{metric:e}),Sb=e},{reportAllChanges:!0})}function EI(){return yI(e=>{cl("ttfb",{metric:e}),Tb=e})}function kI(){return hI(e=>{cl("inp",{metric:e}),Eb=e})}function lu(e,t,n,r,o=!1){xb(e,t);let s;return Nc[e]||(s=n(),Nc[e]=!0),r&&t({metric:r}),Ib(e,t,o?s:void 0)}function CI(e){const t={};e==="event"&&(t.durationThreshold=0),Xi(e,n=>{cl(e,{entries:n})},t)}function xb(e,t){Sa[e]=Sa[e]||[],Sa[e].push(t)}function Ib(e,t,n){return()=>{n&&n();const r=Sa[e];if(!r)return;const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function xI(e){return"duration"in e}const II=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=nt.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};ds("visibilitychange",t,{capture:!0,once:!0}),ds("pagehide",t,{capture:!0,once:!0})};function Td(e){return typeof e=="number"&&isFinite(e)}function ms(e,t,n,{...r}){const o=St(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Cp(e,()=>{const s=hs({startTime:t,...r});return s&&s.end(n),s})}function Wp(e){var D;const t=vt();if(!t)return;const{name:n,transaction:r,attributes:o,startTime:s}=e,{release:i,environment:a,sendDefaultPii:l}=t.getOptions(),c=t.getIntegrationByName("Replay"),u=c==null?void 0:c.getReplayId(),d=Ct(),h=d.getUser(),g=h!==void 0?h.email||h.id||h.ip_address:void 0;let w;try{w=d.getScopeData().contexts.profile.profile_id}catch{}const E={release:i,environment:a,user:g||void 0,profile_id:w||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":(D=nt.navigator)==null?void 0:D.userAgent,"client.address":l?"{{auto}}":void 0,...o};return hs({name:n,attributes:E,startTime:s,experimental:{standalone:!0}})}function cu(){return nt.addEventListener&&nt.performance}function _n(e){return e/1e3}function AI(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 Ab(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Rb(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n),r=!0}II(()=>{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 RI(e){let t=0,n;if(!Ab("layout-shift"))return;const r=kb(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);Rb(e,(o,s)=>{MI(t,n,s,o),r()})}function MI(e,t,n,r){var c;ol&&Ie.log(`Sending CLS span (${e})`);const o=t?_n((Dr()||0)+t.startTime):cn(),s=Ct().getScopeData().transactionName,i=t?Lr((c=t.sources[0])==null?void 0:c.node):"Layout shift",a={[nn]:"auto.http.browser.cls",[qo]:"ui.webvital.cls",[Ki]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((u,d)=>{a[`cls.source.${d+1}`]=Lr(u.node)});const l=Wp({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("cls",{[Qa]:"",[Za]:e}),l.end(o))}function PI(e){let t=0,n;if(!Ab("largest-contentful-paint"))return;const r=Cb(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);Rb(e,(o,s)=>{$I(t,n,s,o),r()})}function $I(e,t,n,r){ol&&Ie.log(`Sending LCP span (${e})`);const o=_n((Dr()||0)+((t==null?void 0:t.startTime)||0)),s=Ct().getScopeData().transactionName,i=t?Lr(t.element):"Largest contentful paint",a={[nn]:"auto.http.browser.lcp",[qo]:"ui.webvital.lcp",[Ki]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Lr(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=Wp({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[Qa]:"millisecond",[Za]:e}),l.end(o))}function Ir(e){return e&&((Dr()||performance.timeOrigin)+e)/1e3}function Mb(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:o}=AI(e.nextHopProtocol);t["network.protocol.version"]=o,t["network.protocol.name"]=r}return Dr()||(n=cu())!=null&&n.timeOrigin?NI({...t,"http.request.redirect_start":Ir(e.redirectStart),"http.request.redirect_end":Ir(e.redirectEnd),"http.request.worker_start":Ir(e.workerStart),"http.request.fetch_start":Ir(e.fetchStart),"http.request.domain_lookup_start":Ir(e.domainLookupStart),"http.request.domain_lookup_end":Ir(e.domainLookupEnd),"http.request.connect_start":Ir(e.connectStart),"http.request.secure_connection_start":Ir(e.secureConnectionStart),"http.request.connection_end":Ir(e.connectEnd),"http.request.request_start":Ir(e.requestStart),"http.request.response_start":Ir(e.responseStart),"http.request.response_end":Ir(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function NI(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const LI=2147483647;let ag=0,zr={},lr,_i;function DI({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=cu();if(r&&Dr()){r.mark&&nt.performance.mark("sentry-tracing-init");const o=t?PI(n):UI(),s=HI(),i=e?RI(n):BI();return()=>{o==null||o(),s(),i==null||i()}}return()=>{}}function OI(){Ua("longtask",({entries:e})=>{const t=dr();if(!t)return;const{op:n,start_timestamp:r}=St(t);for(const o of e){const s=_n(Dr()+o.startTime),i=_n(o.duration);n==="navigation"&&r&&s<r||ms(t,s,s+i,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[nn]:"auto.ui.browser.metrics"}})}})}function FI(){new PerformanceObserver(t=>{const n=dr();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const o=_n(Dr()+r.startTime),{start_timestamp:s,op:i}=St(n);if(i==="navigation"&&s&&o<s)continue;const a=_n(r.duration),l={[nn]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:u,invokerType:d,sourceURL:h,sourceFunctionName:g,sourceCharPosition:w}=c;l["browser.script.invoker"]=u,l["browser.script.invoker_type"]=d,h&&(l["code.filepath"]=h),g&&(l["code.function"]=g),w!==-1&&(l["browser.script.source_char_position"]=w),ms(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function jI(){Ua("event",({entries:e})=>{const t=dr();if(t){for(const n of e)if(n.name==="click"){const r=_n(Dr()+n.startTime),o=_n(n.duration),s={name:Lr(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[nn]:"auto.ui.browser.metrics"}},i=X_(n.target);i&&(s.attributes["ui.component_name"]=i),ms(t,r,r+o,s)}}})}function BI(){return kb(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(zr.cls={value:e.value,unit:""},_i=t)},!0)}function UI(){return Cb(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(zr.lcp={value:e.value,unit:"millisecond"},lr=t)},!0)}function HI(){return bI(({metric:e})=>{e.entries[e.entries.length-1]&&(zr.ttfb={value:e.value,unit:"millisecond"})})}function qI(e,t){const n=cu(),r=Dr();if(!(n!=null&&n.getEntries)||!r)return;const o=_n(r),s=n.getEntries(),{op:i,start_timestamp:a}=St(e);s.slice(ag).forEach(l=>{const c=_n(l.startTime),u=_n(Math.max(0,l.duration));if(!(i==="navigation"&&a&&o+c<a))switch(l.entryType){case"navigation":{GI(e,l,o);break}case"mark":case"paint":case"measure":{VI(e,l,c,u,o,t.ignorePerformanceApiSpans);const d=al(),h=l.startTime<d.firstHiddenTime;l.name==="first-paint"&&h&&(zr.fp={value:l.startTime,unit:"millisecond"}),l.name==="first-contentful-paint"&&h&&(zr.fcp={value:l.startTime,unit:"millisecond"});break}case"resource":{JI(e,l,l.name,c,u,o,t.ignoreResourceSpans);break}}}),ag=Math.max(s.length-1,0),XI(e),i==="pageload"&&(eA(zr),t.recordClsOnPageloadSpan||delete zr.cls,t.recordLcpOnPageloadSpan||delete zr.lcp,Object.entries(zr).forEach(([l,c])=>{d1(l,c.value,c.unit)}),e.setAttribute("performance.timeOrigin",o),e.setAttribute("performance.activationStart",Ji()),QI(e,t)),lr=void 0,_i=void 0,zr={}}function WI(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function VI(e,t,n,r,o,s){if(WI(t)||["mark","measure"].includes(t.entryType)&&cs(t.name,s))return;const i=il(!1),a=_n(i?i.requestStart:0),l=o+Math.max(n,a),c=o+n,u=c+r,d={[nn]:"auto.resource.browser.metrics"};l!==c&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=l),zI(d,t),l<=u&&ms(e,l,u,{name:t.name,op:t.entryType,attributes:d})}function zI(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,o]of Object.entries(n))if(o&&Mi(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(Mi(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function GI(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{ql(e,t,r,n)}),ql(e,t,"secureConnection",n,"TLS/SSL"),ql(e,t,"fetch",n,"cache"),ql(e,t,"domainLookup",n,"DNS"),YI(e,t,n)}function ql(e,t,n,r,o=n){const s=KI(n),i=t[s],a=t[`${n}Start`];!a||!i||ms(e,r+_n(a),r+_n(i),{op:`browser.${o}`,name:t.name,attributes:{[nn]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function KI(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function YI(e,t,n){const r=n+_n(t.requestStart),o=n+_n(t.responseEnd),s=n+_n(t.responseStart);t.responseEnd&&(ms(e,r,o,{op:"browser.request",name:t.name,attributes:{[nn]:"auto.ui.browser.metrics"}}),ms(e,s,o,{op:"browser.response",name:t.name,attributes:{[nn]:"auto.ui.browser.metrics"}}))}function JI(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={[nn]:"auto.resource.browser.metrics"},c=Ys(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(nt.location.origin),ZI(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 u={...l,...Mb(t)},d=s+r,h=d+o;ms(e,d,h,{name:n.replace(nt.location.origin,""),op:a,attributes:u})}function XI(e){const t=nt.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Td(n.rtt)&&(zr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Td(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Td(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function QI(e,t){lr&&t.recordLcpOnPageloadSpan&&(lr.element&&e.setAttribute("lcp.element",Lr(lr.element)),lr.id&&e.setAttribute("lcp.id",lr.id),lr.url&&e.setAttribute("lcp.url",lr.url.trim().slice(0,200)),lr.loadTime!=null&&e.setAttribute("lcp.loadTime",lr.loadTime),lr.renderTime!=null&&e.setAttribute("lcp.renderTime",lr.renderTime),e.setAttribute("lcp.size",lr.size)),_i!=null&&_i.sources&&t.recordClsOnPageloadSpan&&_i.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Lr(n.node)))}function ZI(e,t,n){n.forEach(([r,o])=>{const s=e[r];s!=null&&(typeof s=="number"&&s<LI||typeof s=="string")&&(t[o]=s)})}function eA(e){const t=il(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const tA=1e3;let lg,Nf,Lf;function nA(e){_s("dom",e),ys("dom",rA)}function rA(){if(!nt.document)return;const e=Mr.bind(null,"dom"),t=cg(e,!0);nt.document.addEventListener("click",t,!1),nt.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var s,i;const o=(s=nt[n])==null?void 0:s.prototype;(i=o==null?void 0:o.hasOwnProperty)!=null&&i.call(o,"addEventListener")&&(_r(o,"addEventListener",function(a){return function(l,c,u){if(l==="click"||l=="keypress")try{const d=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},h=d[l]=d[l]||{refCount:0};if(!h.handler){const g=cg(e);h.handler=g,a.call(this,l,g,u)}h.refCount++}catch{}return a.call(this,l,c,u)}}),_r(o,"removeEventListener",function(a){return function(l,c,u){if(l==="click"||l=="keypress")try{const d=this.__sentry_instrumentation_handlers__||{},h=d[l];h&&(h.refCount--,h.refCount<=0&&(a.call(this,l,h.handler,u),h.handler=void 0,delete d[l]),Object.keys(d).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,c,u)}}))})}function oA(e){if(e.type!==Nf)return!1;try{if(!e.target||e.target._sentryId!==Lf)return!1}catch{}return!0}function sA(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function cg(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=iA(n);if(sA(n.type,r))return;ur(n,"_sentryCaptured",!0),r&&!r._sentryId&&ur(r,"_sentryId",Pr());const o=n.type==="keypress"?"input":n.type;oA(n)||(e({event:n,name:o,global:t}),Nf=n.type,Lf=r?r._sentryId:void 0),clearTimeout(lg),lg=nt.setTimeout(()=>{Lf=void 0,Nf=void 0},tA)}}function iA(e){try{return e.target}catch{return null}}let Wl;function Vp(e){const t="history";_s(t,e),ys(t,aA)}function aA(){if(nt.addEventListener("popstate",()=>{const t=nt.location.href,n=Wl;if(Wl=t,n===t)return;Mr("history",{from:n,to:t})}),!hC())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=Wl,s=lA(String(r));if(Wl=s,o===s)return t.apply(this,n);Mr("history",{from:o,to:s})}return t.apply(this,n)}}_r(nt.history,"pushState",e),_r(nt.history,"replaceState",e)}function lA(e){try{return new URL(e,nt.location.origin).toString()}catch{return e}}const mc={};function cA(e){const t=mc[e];if(t)return t;let n=nt[e];if(kf(n))return mc[e]=n.bind(nt);const r=nt.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){ol&&Ie.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(mc[e]=n.bind(nt))}function uA(e){mc[e]=void 0}const yi="__sentry_xhr_v3__";function Pb(e){_s("xhr",e),ys("xhr",dA)}function dA(){if(!nt.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=cn()*1e3,i=No(r[0])?r[0].toUpperCase():void 0,a=fA(r[1]);if(!i||!a)return t.apply(n,r);n[yi]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const c=n[yi];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const u={endTimestamp:cn()*1e3,startTimestamp:s,xhr:n,virtualError:o};Mr("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,d){return l(),c.apply(u,d)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,d){const[h,g]=d,w=u[yi];return w&&No(h)&&No(g)&&(w.request_headers[h.toLowerCase()]=g),c.apply(u,d)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[yi];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:cn()*1e3,xhr:n};return Mr("xhr",s),t.apply(n,r)}})}function fA(e){if(No(e))return e;try{return e.toString()}catch{}}function pA(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return ol&&Ie.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
508
|
+
`).reduce((n,r)=>{const[o,s]=r.split(": ");return s&&(n[o.toLowerCase()]=s),n},{}):{}}const Ed=[],gc=new Map,di=new Map,hA=60;function mA(){if(cu()&&Dr()){const t=gA();return()=>{t()}}return()=>{}}const Df={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 gA(){return wI(vA)}const vA=({metric:e})=>{if(e.value==null)return;const t=_n(e.value);if(t>hA)return;const n=e.entries.find(w=>w.duration===e.value&&Df[w.name]);if(!n)return;const{interactionId:r}=n,o=Df[n.name],s=_n(Dr()+n.startTime),i=dr(),a=i?Un(i):void 0,l=r!=null?gc.get(r):void 0,c=(l==null?void 0:l.span)||a,u=c?St(c).description:Ct().getScopeData().transactionName,d=(l==null?void 0:l.elementName)||Lr(n.target),h={[nn]:"auto.http.browser.inp",[qo]:`ui.interaction.${o}`,[Ki]:n.duration},g=Wp({name:d,transaction:u,attributes:h,startTime:s});g&&(g.addEvent("inp",{[Qa]:"millisecond",[Za]:e.value}),g.end(s+t))};function _A(){const e=Object.keys(Df);tb()&&e.forEach(o=>{nt.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const s=o.target;if(!s)return;const i=Lr(s),a=Math.round(o.timeStamp);if(di.set(a,i),di.size>50){const l=di.keys().next().value;l!==void 0&&di.delete(l)}}function n(o){const s=Math.round(o.startTime);let i=di.get(s);if(!i)for(let a=-5;a<=5;a++){const l=di.get(s+a);if(l){i=l;break}}return i||"<unknown>"}const r=({entries:o})=>{const s=dr(),i=s&&Un(s);o.forEach(a=>{if(!xI(a))return;const l=a.interactionId;if(l==null||gc.has(l))return;const c=a.target?Lr(a.target):n(a);if(Ed.length>10){const u=Ed.shift();gc.delete(u)}Ed.push(l),gc.set(l,{span:i,elementName:c})})};Ua("event",r),Ua("first-input",r)}const yA=40;function bA(e,t=cA("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 uA("fetch"),l}finally{n-=i,r--}}return hk(e,o,Pp(e.bufferSize||yA))}const br=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,wA=30,SA=50;function Of(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?Js:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const TA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,EA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,kA=/\((\S*)(?::(\d+))(?::(\d+))\)/,CA=/at (.+?) ?\(data:(.+?),/,xA=e=>{var o;const t=e.match(CA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=TA.exec(e);if(n){const[,s,i,a]=n;return Of(s,Js,+i,+a)}const r=EA.exec(e);if(r){if(((o=r[2])==null?void 0:o.indexOf("eval"))===0){const l=kA.exec(r[2]);l&&(r[2]=l[1],r[3]=l[2],r[4]=l[3])}const[i,a]=$b(r[1]||Js,r[2]);return Of(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},IA=[wA,xA],AA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,RA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,MA=e=>{const t=AA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=RA.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]||Js;return[o,r]=$b(o,r),Of(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},PA=[SA,MA],$A=[IA,PA],NA=W_(...$A),$b=(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]:Js,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Vl=1024,LA="Breadcrumbs",DA=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:LA,setup(n){t.console&&Yk(BA(n)),t.dom&&nA(jA(n,t.dom)),t.xhr&&Pb(UA(n)),t.fetch&&Zy(HA(n)),t.history&&Vp(qA(n)),t.sentry&&n.on("beforeSendEvent",FA(n))}}}),OA=DA;function FA(e){return function(n){vt()===e&&yr({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Fs(n)},{event:n})}}function jA(e,t){return function(r){if(vt()!==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>Vl&&(br&&Ie.warn(`\`dom.maxStringLength\` cannot exceed ${Vl}, but a value of ${a} was configured. Sentry will use ${Vl} instead.`),a=Vl),typeof i=="string"&&(i=[i]);try{const c=r.event,u=WA(c)?c.target:c;o=Lr(u,{keyAttrs:i,maxStringLength:a}),s=X_(u)}catch{o="<unknown>"}if(o.length===0)return;const l={category:`ui.${r.name}`,message:o};s&&(l.data={"ui.component_name":s}),yr(l,{event:r.event,name:r.name,global:r.global})}}function BA(e){return function(n){if(vt()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Xk(n.level),message:nm(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${nm(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;yr(r,{input:n.args,level:n.level})}}function UA(e){return function(n){if(vt()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[yi];if(!r||!o||!s)return;const{method:i,url:a,status_code:l,body:c}=s,u={method:i,url:a,status_code:l},d={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},h={category:"xhr",data:u,type:"http",level:Qy(l)};e.emit("beforeOutgoingRequestBreadcrumb",h,d),yr(h,d)}}function HA(e){return function(n){if(vt()!==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),yr(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:Qy(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),yr(l,a)}}}function qA(e){return function(n){if(vt()!==e)return;let r=n.from,o=n.to;const s=Ys(dt.location.href);let i=r?Ys(r):void 0;const a=Ys(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),yr({category:"navigation",data:{from:r,to:o}})}}function WA(e){return!!e&&!!e.target}const VA="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(","),zA="BrowserApiErrors",GA=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:zA,setupOnce(){t.setTimeout&&_r(dt,"setTimeout",ug),t.setInterval&&_r(dt,"setInterval",ug),t.requestAnimationFrame&&_r(dt,"requestAnimationFrame",YA),t.XMLHttpRequest&&"XMLHttpRequest"in dt&&_r(XMLHttpRequest.prototype,"send",JA);const n=t.eventTarget;n&&(Array.isArray(n)?n:VA).forEach(o=>XA(o,t))}}}),KA=GA;function ug(e){return function(...t){const n=t[0];return t[0]=Fi(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Bo(e)}`}}),e.apply(this,t)}}function YA(e){return function(t){return e.apply(this,[Fi(t,{mechanism:{data:{handler:Bo(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function JA(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&_r(n,o,function(s){const i={mechanism:{data:{handler:Bo(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=Sp(s);return a&&(i.mechanism.data.handler=Bo(a)),Fi(s,i)})}),e.apply(this,t)}}function XA(e,t){var o,s;const r=(o=dt[e])==null?void 0:o.prototype;(s=r==null?void 0:r.hasOwnProperty)!=null&&s.call(r,"addEventListener")&&(_r(r,"addEventListener",function(i){return function(a,l,c){try{QA(l)&&(l.handleEvent=Fi(l.handleEvent,{mechanism:{data:{handler:Bo(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&ZA(this,a,l),i.apply(this,[a,Fi(l,{mechanism:{data:{handler:Bo(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),c])}}),_r(r,"removeEventListener",function(i){return function(a,l,c){try{const u=l.__sentry_wrapped__;u&&i.call(this,a,u,c)}catch{}return i.call(this,a,l,c)}}))}function QA(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 eR=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof dt.document>"u"){br&&Ie.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Em({ignoreDuration:!0}),fd();const n=Or();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))&&(fd(),r=s)}),t==="route"&&Vp(({from:o,to:s})=>{o!==s&&(Em({ignoreDuration:!0}),fd())})}}},tR="CultureContext",nR=(()=>({name:tR,preprocessEvent(e){var n;const t=oR();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})}})),rR=nR;function oR(){try{const e=dt.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const sR="GlobalHandlers",iR=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:sR,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(lR(n),dg("onerror")),t.onunhandledrejection&&(cR(n),dg("onunhandledrejection"))}}}),aR=iR;function lR(e){z_(t=>{const{stackParser:n,attachStacktrace:r}=Nb();if(vt()!==e||hb())return;const{msg:o,url:s,line:i,column:a,error:l}=t,c=fR(Up(n,l||o,void 0,r,!1),s,i,a);c.level="error",My(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function cR(e){G_(t=>{const{stackParser:n,attachStacktrace:r}=Nb();if(vt()!==e||hb())return;const o=uR(t),s=Mi(o)?dR(o):Up(n,o,void 0,r,!0);s.level="error",My(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function uR(e){if(Mi(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 dR(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function fR(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:pR(t)??zi(),function:Js,in_app:!0}),e}function dg(e){br&&Ie.log(`Global Handler attached: ${e}`)}function Nb(){const e=vt();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function pR(e){if(!(!No(e)||e.length===0))return e.startsWith("data:")?`<${us(e,!1)}>`:e}const hR=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!dt.navigator&&!dt.location&&!dt.document)return;const t=Fp(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),mR="cause",gR=5,vR="LinkedErrors",_R=((e={})=>{const t=e.limit||gR,n=e.key||mR;return{name:vR,preprocessEvent(r,o,s){const i=s.getOptions();Kk(jp,i.stackParser,n,t,r,o)}}}),yR=_R;function bR(){return wR()?(br&&Go(()=>{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 wR(){var o;if(typeof dt.window>"u")return!1;const e=dt;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=zi();return!(dt===dt.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function Lb(e){return[Bk(),Dk(),iC(),KA(),OA(),aR(),yR(),eC(),hR(),rR(),eR()]}function SR(e={}){const t=!e.skipBrowserExtensionCheck&&bR();let n=e.defaultIntegrations==null?Lb():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:OT(e.stackParser||NA),integrations:tk({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||bA};return kk(Zx,r)}function TR(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Db(e){try{return new URL(e,dt.location.origin).href}catch{return}}function ER(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Ob(e){try{return new Headers(e)}catch{return}}const fg=new WeakMap,kd=new Map,Fb={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function kR(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:o,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:l,onRequestSpanEnd:c}={...Fb,...t},u=typeof s=="function"?s:w=>!0,d=w=>xR(w,a),h={},g=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(w=>(w.type==="transaction"&&w.spans&&w.spans.forEach(E=>{if(E.op==="http.client"){const D=kd.get(E.span_id);D&&(E.timestamp=D/1e3,kd.delete(E.span_id))}}),w)),o&&vC(w=>{if(w.response){const E=fg.get(w.response);E&&w.endTimestamp&&kd.set(E,w.endTimestamp)}}),Zy(w=>{const E=aC(w,u,d,h,{propagateTraceparent:g,onRequestSpanEnd:c});if(w.response&&w.fetchData.__span&&fg.set(w.response,w.fetchData.__span),E){const D=Db(w.fetchData.url),C=D?Ys(D).host:void 0;E.setAttributes({"http.url":D?us(D):void 0,"server.address":C}),i&&pg(E,e),l==null||l(E,{headers:w.headers})}})),r&&Pb(w=>{var D;const E=IR(w,u,d,h,g,c);E&&(i&&pg(E,e),l==null||l(E,{headers:Ob((D=w.xhr.__sentry_xhr_v3__)==null?void 0:D.request_headers)}))})}const CR=300;function pg(e,t){const{url:n}=St(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(el(t)){const s=e.end.bind(e);e.end=i=>{const a=i??cn();let l=!1;const c=()=>{l||(l=!0,setTimeout(o),s(a),clearTimeout(u))};r=c;const u=setTimeout(c,CR)}}const o=Ua("resource",({entries:s})=>{s.forEach(i=>{ER(i)&&i.name.endsWith(n)&&(e.setAttributes(Mb(i)),r())})})}function xR(e,t){const n=zi();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?cs(r.toString(),t)||s&&cs(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?cs(e,t):r}}function IR(e,t,n,r,o,s){const i=e.xhr,a=i==null?void 0:i[yi];if(!i||i.__sentry_own_request__||!a)return;const{url:l,method:c}=a,u=$r()&&t(l);if(e.endTimestamp){const C=i.__sentry_xhr_span_id__;if(!C)return;const I=r[C];I&&(u&&a.status_code!==void 0&&(ay(I,a.status_code),I.end(),s==null||s(I,{headers:Ob(pA(i)),error:e.error})),delete r[C]);return}const d=Db(l),h=Ys(d||l),g=us(Ak(l)),w=!!dr(),E=u&&w?hs({name:`${c} ${g}`,attributes:{url:us(l),type:"xhr","http.method":c,"http.url":d?us(d):void 0,"server.address":h==null?void 0:h.host,[nn]:"auto.http.browser",[qo]:"http.client",...(h==null?void 0:h.search)&&{"http.query":h==null?void 0:h.search},...(h==null?void 0:h.hash)&&{"http.fragment":h==null?void 0:h.hash}}}):new Nr;i.__sentry_xhr_span_id__=E.spanContext().spanId,r[i.__sentry_xhr_span_id__]=E,n(l)&&AR(i,$r()&&w?E:void 0,o);const D=vt();return D&&D.emit("beforeOutgoingRequestSpan",E,e),E}function AR(e,t,n){const{"sentry-trace":r,baggage:o,traceparent:s}=Ky({span:t,propagateTraceparent:n});r&&RR(e,r,o,s)}function RR(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||!TR(i))&&e.setRequestHeader("baggage",n)}}catch{}}function MR(){dt.document?dt.document.addEventListener("visibilitychange",()=>{const e=dr();if(!e)return;const t=Un(e);if(dt.document.hidden&&t){const n="cancelled",{op:r,status:o}=St(t);br&&Ie.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:vn,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):br&&Ie.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const PR=3600,jb="sentry_previous_trace",$R="sentry.previous_trace";function NR(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let o=r?OR():void 0;e.on("spanStart",i=>{if(Un(i)!==i)return;const a=Ct().getPropagationContext();o=LR(o,i,a),r&&DR(o)});let s=!0;n&&e.on("beforeSampling",i=>{if(!o)return;const a=Ct(),l=a.getPropagationContext();if(s&&l.parentSpanId){s=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(Ff(o.spanContext))},sampleRand:o.sampleRand}),i.parentSampled=Ff(o.spanContext),i.parentSampleRate=o.sampleRate,i.spanAttributes={...i.spanAttributes,[sy]:o.sampleRate}})}function LR(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[Tp])}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<=PR&&(br&&Ie.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[dE]:"previous_trace"}}),t.setAttribute($R,`${i.traceId}-${i.spanId}-${Ff(i)?1:0}`)),s)}function DR(e){try{dt.sessionStorage.setItem(jb,JSON.stringify(e))}catch(t){br&&Ie.warn("Could not store previous trace in sessionStorage",t)}}function OR(){var e;try{const t=(e=dt.sessionStorage)==null?void 0:e.getItem(jb);return JSON.parse(t)}catch{return}}function Ff(e){return e.traceFlags===1}const FR="BrowserTracing",jR=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function BR(){const e=dt.navigator;return e!=null&&e.userAgent?jR.test(e.userAgent):!1}const UR={...ic,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Fb},hg=((e={})=>{"enableElementTiming"in e&&Go(()=>{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=dt.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:i,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:u,finalTimeout:d,childSpanTimeout:h,markBackgroundSpan:g,traceFetch:w,traceXHR:E,trackFetchStreamPerformance:D,shouldCreateSpanForRequest:C,enableHTTPTimings:I,ignoreResourceSpans:V,ignorePerformanceApiSpans:z,instrumentPageLoad:ce,instrumentNavigation:re,detectRedirects:Z,linkPreviousTrace:de,consistentTraceSampling:_e,enableReportPageLoaded:Te,onRequestSpanStart:fe,onRequestSpanEnd:H}={...UR,...e},ee=BR();let Se,Ne,ye;function Re(ue,Me,Pe=!0){const ke=Me.op==="pageload",We=Me.name,Ye=c?c(Me):Me,Je=Ye.attributes||{};if(We!==Ye.name&&(Je[Ar]="custom",Ye.attributes=Je),!Pe){const Q=Zs();hs({...Ye,startTime:Q}).end(Q);return}t.name=Ye.name,t.source=Je[Ar];const st=Ay(Ye,{idleTimeout:u,finalTimeout:d,childSpanTimeout:h,disableAutoFinish:ke,beforeSpanEnd:Q=>{Se==null||Se(),qI(Q,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!l,ignoreResourceSpans:V,ignorePerformanceApiSpans:z}),vg(ue,void 0);const me=Ct(),be=me.getPropagationContext();me.setPropagationContext({...be,traceId:st.spanContext().traceId,sampled:bs(st),dsc:ps(Q)}),ke&&(ye=void 0)},trimIdleSpanEndTimestamp:!Te});ke&&Te&&(ye=st),vg(ue,st);function Ke(){n&&["interactive","complete"].includes(n.readyState)&&ue.emit("idleSpanEnableAutoFinish",st)}ke&&!Te&&n&&(n.addEventListener("readystatechange",()=>{Ke()}),Ke())}return{name:FR,setup(ue){var Pe;if(ee){br&&Ie.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(qE(),Se=DI({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:l||!1,client:ue}),r&&mA(),s&>.PerformanceObserver&&((Pe=PerformanceObserver.supportedEntryTypes)!=null&&Pe.includes("long-animation-frame"))?FI():o&&OI(),i&&jI(),Z&&n){const ke=()=>{Ne=cn()};addEventListener("click",ke,{capture:!0}),addEventListener("keydown",ke,{capture:!0,passive:!0})}function Me(){const ke=Ha(ue);ke&&!St(ke).timestamp&&(br&&Ie.log(`[Tracing] Finishing current active span with op: ${St(ke).op}`),ke.setAttribute(La,"cancelled"),ke.end())}ue.on("startNavigationSpan",(ke,We)=>{if(vt()!==ue)return;if(We!=null&&We.isRedirect){br&&Ie.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),Re(ue,{op:"navigation.redirect",...ke},!1);return}Ne=void 0,Me(),Or().setPropagationContext({traceId:Ho(),sampleRand:Math.random(),propagationSpanId:$r()?void 0:Lo()});const Ye=Ct();Ye.setPropagationContext({traceId:Ho(),sampleRand:Math.random(),propagationSpanId:$r()?void 0:Lo()}),Ye.setSDKProcessingMetadata({normalizedRequest:void 0}),Re(ue,{op:"navigation",...ke,parentSpan:null,forceTransaction:!0})}),ue.on("startPageLoadSpan",(ke,We={})=>{if(vt()!==ue)return;Me();const Ye=We.sentryTrace||mg("sentry-trace")||gg("sentry-trace"),Je=We.baggage||mg("baggage")||gg("baggage"),st=RE(Ye,Je),Ke=Ct();Ke.setPropagationContext(st),$r()||(Ke.getPropagationContext().propagationSpanId=Lo()),Ke.setSDKProcessingMetadata({normalizedRequest:Fp()}),Re(ue,{op:"pageload",...ke})}),ue.on("endPageloadSpan",()=>{Te&&ye&&(ye.setAttribute(La,"reportPageLoaded"),ye.end())})},afterAllSetup(ue){if(ee)return;let Me=zi();if(de!=="off"&&NR(ue,{linkPreviousTrace:de,consistentTraceSampling:_e}),dt.location){if(ce){const Pe=Dr();HR(ue,{name:dt.location.pathname,startTime:Pe?Pe/1e3:void 0,attributes:{[Ar]:"url",[nn]:"auto.pageload.browser"}})}re&&Vp(({to:Pe,from:ke})=>{if(ke===void 0&&(Me==null?void 0:Me.indexOf(Pe))!==-1){Me=void 0;return}Me=void 0;const We=zy(Pe),Ye=Ha(ue),Je=Ye&&Z&&WR(Ye,Ne);Bb(ue,{name:(We==null?void 0:We.pathname)||dt.location.pathname,attributes:{[Ar]:"url",[nn]:"auto.navigation.browser"}},{url:Pe,isRedirect:Je})})}g&&MR(),i&&qR(ue,u,d,h,t),r&&_A(),kR(ue,{traceFetch:w,traceXHR:E,trackFetchStreamPerformance:D,tracePropagationTargets:ue.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:C,enableHTTPTimings:I,onRequestSpanStart:fe,onRequestSpanEnd:H})}}});function HR(e,t,n){e.emit("startPageLoadSpan",t,n),Ct().setTransactionName(t.name);const r=Ha(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function Bb(e,t,n){const{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});const s=Ct();return s.setTransactionName(t.name),r&&!o&&s.setSDKProcessingMetadata({normalizedRequest:{...Fp(),url:r}}),Ha(e)}function mg(e){const t=dt.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function gg(e){var r,o,s;const t=(o=(r=dt.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 qR(e,t,n,r,o){const s=dt.document;let i;const a=()=>{const l="ui.action.click",c=Ha(e);if(c){const u=St(c).op;if(["navigation","pageload"].includes(u)){br&&Ie.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(La,"interactionInterrupted"),i.end(),i=void 0),!o.name){br&&Ie.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}i=Ay({name:o.name,op:l,attributes:{[Ar]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",a,{capture:!0})}const Ub="_sentry_idleSpan";function Ha(e){return e[Ub]}function vg(e,t){ur(e,Ub,t)}const _g=1.5;function WR(e,t){const n=St(e),r=Zs(),o=n.start_timestamp;return!(r-o>_g||t&&r-t<=_g)}const Hb=["activate","mount"],qb=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,VR=/(?:^|[-_])(\w)/g,zR=e=>e.replace(VR,t=>t.toUpperCase()).replace(/[-_]/g,""),GR="<Root>",Cd="<Anonymous>",KR=(e,t)=>e.repeat(t),Ta=(e,t)=>{if(!e)return Cd;if(e.$root===e)return GR;if(!e.$options)return Cd;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?`<${zR(r)}>`:Cd)+(o&&t!==!1?` at ${o}`:"")},YR=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`
|
|
509
|
+
|
|
510
|
+
found in
|
|
511
|
+
|
|
512
|
+
${t.map((o,s)=>`${(s===0?"---> ":KR(" ",5+s*2))+(Array.isArray(o)?`${Ta(o[0])}... (${o[1]} recursive calls)`:Ta(o))}`).join(`
|
|
513
|
+
`)}`}return`
|
|
514
|
+
|
|
515
|
+
(found in ${Ta(e)})`},JR=(e,t)=>{const{errorHandler:n}=e.config;e.config.errorHandler=(r,o,s)=>{var c;const i=Ta(o,!1),a=o?YR(o):"",l={componentName:i,lifecycleHook:s,trace:a};if((t==null?void 0:t.attachProps)!==!1&&o&&((c=o.$options)!=null&&c.propsData?l.propsData=o.$options.propsData:o.$props&&(l.propsData=o.$props)),setTimeout(()=>{Rp(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}},yg="ui.vue",XR={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function xd(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 QR(e,t){function n(o){return o.replace(/^<([^\s]*)>(?: at [^\s]*)?$/,"$1")}return e.some(o=>n(t)===n(o))}const ZR=(e={})=>{const t=(e.hooks||[]).concat(Hb).filter((o,s,i)=>i.indexOf(o)===s),n={},r=e.timeout||2e3;for(const o of t){const s=XR[o];if(!s){qb&&Ie.warn(`Unknown hook: ${o}`);continue}for(const i of s)n[i]=function(){var h;const a=this.$root===this;a&&(this.$_sentryRootComponentSpan=this.$_sentryRootComponentSpan||hs({name:"Application Render",op:`${yg}.render`,attributes:{[nn]:"auto.ui.vue"},onlyIfParent:!0}),xd(this,cn(),r));const l=Ta(this,!1);if(!(a||(Array.isArray(e.trackComponents)?QR(e.trackComponents,l):e.trackComponents))){xd(this,cn(),r);return}this.$_sentryComponentSpans=this.$_sentryComponentSpans||{};const u=i===s[0],d=((h=this.$root)==null?void 0:h.$_sentryRootComponentSpan)||dr();if(u){if(d){const g=this.$_sentryComponentSpans[o];g&&g.end(),this.$_sentryComponentSpans[o]=hs({name:`Vue ${l}`,op:`${yg}.${o}`,attributes:{[nn]:"auto.ui.vue"},onlyIfParent:!0})}}else{const g=this.$_sentryComponentSpans[o];if(!g)return;g.end(),xd(this,cn(),r)}}}return n},eM=gt,tM={Vue:eM.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:Hb,timeout:2e3,trackComponents:!1}},nM="Vue",rM=(e={})=>({name:nM,setup(t){const n={...tM,...t.getOptions(),...e};if(!n.Vue&&!n.app){Go(()=>{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=>bg(o,n)):n.Vue&&bg(n.Vue,n)}}),bg=(e,t)=>{var n;qb&&((n=e._instance)==null?void 0:n.isMounted)===!0&&Go(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),t.attachErrorHandler&&JR(e,t),$r(t)&&e.mixin(ZR(t.tracingOptions))};function oM(e={}){const t={defaultIntegrations:[...Lb(),rM()],...e};return Gy(t,"vue"),SR(t)}function sM(e,t,n){let r=!1;const o="mode"in e;e.onError(s=>Rp(s,{mechanism:{handled:!1}})),e.beforeEach((s,i,...a)=>{const l=r?void 0:iM(),c={};for(const h of Object.keys(s.params))c[`url.path.parameter.${h}`]=s.params[h],c[`params.${h}`]=s.params[h];for(const h of Object.keys(s.query)){const g=s.query[h];g&&(c[`query.${h}`]=g)}let u=s.path,d="url";if(s.name&&t.routeLabel!=="path")u=s.name.toString(),d="custom";else if(s.matched.length>0){const h=s.matched.length-1;u=s.matched[h].path,d="route"}if(Ct().setTransactionName(u),t.instrumentPageLoad&&l&&(St(l).data[Ar]!=="custom"&&(l.updateName(u),l.setAttribute(Ar,d)),l.setAttributes({...c,[nn]:"auto.pageload.vue"}),r=!0),t.instrumentNavigation&&!l&&n({name:u,op:"navigation",attributes:{...c,[nn]:"auto.navigation.vue",[Ar]:d}}),o){const h=a[0];typeof h=="function"&&h()}})}function iM(){const e=dr(),t=e&&Un(e);return t&&St(t).op==="pageload"?t:void 0}function aM(e={}){if(!e.router)return hg(e);const t=hg({...e,instrumentNavigation:!1}),{router:n,instrumentNavigation:r=!0,instrumentPageLoad:o=!0,routeLabel:s="name"}=e;return{...t,afterAllSetup(i){t.afterAllSetup(i),sM(n,{routeLabel:s,instrumentNavigation:r,instrumentPageLoad:o},l=>{Bb(i,l)})}}}const lM="modulepreload",cM=function(e){return"/"+e},wg={},Id=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};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(c=>{if(c=cM(c),c in wg)return;wg[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":lM,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((g,w)=>{h.addEventListener("load",g),h.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${c}`)))})}))}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)})};/*!
|
|
516
|
+
* vue-router v4.6.4
|
|
517
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
518
|
+
* @license MIT
|
|
519
|
+
*/const mi=typeof document<"u";function Wb(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function uM(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Wb(e.default)}const At=Object.assign;function Ad(e,t){const n={};for(const r in t){const o=t[r];n[r]=to(o)?o.map(e):e(o)}return n}const Ea=()=>{},to=Array.isArray;function Sg(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Vb=/#/g,dM=/&/g,fM=/\//g,pM=/=/g,hM=/\?/g,zb=/\+/g,mM=/%5B/g,gM=/%5D/g,Gb=/%5E/g,vM=/%60/g,Kb=/%7B/g,_M=/%7C/g,Yb=/%7D/g,yM=/%20/g;function zp(e){return e==null?"":encodeURI(""+e).replace(_M,"|").replace(mM,"[").replace(gM,"]")}function bM(e){return zp(e).replace(Kb,"{").replace(Yb,"}").replace(Gb,"^")}function jf(e){return zp(e).replace(zb,"%2B").replace(yM,"+").replace(Vb,"%23").replace(dM,"%26").replace(vM,"`").replace(Kb,"{").replace(Yb,"}").replace(Gb,"^")}function wM(e){return jf(e).replace(pM,"%3D")}function SM(e){return zp(e).replace(Vb,"%23").replace(hM,"%3F")}function TM(e){return SM(e).replace(fM,"%2F")}function qa(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const EM=/\/$/,kM=e=>e.replace(EM,"");function Rd(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=AM(r??t,n),{fullPath:r+s+i,path:r,query:o,hash:qa(i)}}function CM(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Tg(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function xM(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&ji(t.matched[r],n.matched[o])&&Jb(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ji(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Jb(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!IM(e[n],t[n]))return!1;return!0}function IM(e,t){return to(e)?Eg(e,t):to(t)?Eg(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Eg(e,t){return to(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function AM(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 Bf=(function(e){return e.pop="pop",e.push="push",e})({}),Md=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function RM(e){if(!e)if(mi){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),kM(e)}const MM=/^[^#]+#/;function PM(e,t){return e.replace(MM,"#")+t}function $M(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 uu=()=>({left:window.scrollX,top:window.scrollY});function NM(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=$M(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 kg(e,t){return(history.state?history.state.position-t:-1)+e}const Uf=new Map;function LM(e,t){Uf.set(e,t)}function DM(e){const t=Uf.get(e);return Uf.delete(e),t}function OM(e){return typeof e=="string"||e&&typeof e=="object"}function Xb(e){return typeof e=="string"||typeof e=="symbol"}let en=(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 Qb=Symbol("");en.MATCHER_NOT_FOUND+"",en.NAVIGATION_GUARD_REDIRECT+"",en.NAVIGATION_ABORTED+"",en.NAVIGATION_CANCELLED+"",en.NAVIGATION_DUPLICATED+"";function Bi(e,t){return At(new Error,{type:e,[Qb]:!0},t)}function Co(e,t){return e instanceof Error&&Qb in e&&(t==null||!!(e.type&t))}const FM=["params","query","hash"];function jM(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of FM)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function BM(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(zb," "),s=o.indexOf("="),i=qa(s<0?o:o.slice(0,s)),a=s<0?null:qa(o.slice(s+1));if(i in t){let l=t[i];to(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Cg(e){let t="";for(let n in e){const r=e[n];if(n=wM(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(to(r)?r.map(o=>o&&jf(o)):[r&&jf(r)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function UM(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=to(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const HM=Symbol(""),xg=Symbol(""),du=Symbol(""),Gp=Symbol(""),Hf=Symbol("");function da(){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 os(e,t,n,r,o,s=i=>i()){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(Bi(en.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?l(h):OM(h)?l(Bi(en.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(i&&r.enterCallbacks[o]===i&&typeof h=="function"&&i.push(h),a())},u=s(()=>e.call(r&&r.instances[o],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(h=>l(h))})}function Pd(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(Wb(l)){const c=(l.__vccOpts||l)[t];c&&s.push(os(c,n,r,i,a,o))}else{let c=l();s.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const d=uM(u)?u.default:u;i.mods[a]=u,i.components[a]=d;const h=(d.__vccOpts||d)[t];return h&&os(h,n,r,i,a,o)()}))}}return s}function qM(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(c=>ji(c,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(c=>ji(c,l))||o.push(l))}return[n,r,o]}/*!
|
|
520
|
+
* vue-router v4.6.4
|
|
521
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
522
|
+
* @license MIT
|
|
523
|
+
*/let WM=()=>location.protocol+"//"+location.host;function Zb(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),Tg(a,"")}return Tg(n,e)+r+o}function VM(e,t,n,r){let o=[],s=[],i=null;const a=({state:h})=>{const g=Zb(e,location),w=n.value,E=t.value;let D=0;if(h){if(n.value=g,t.value=h,i&&i===w){i=null;return}D=E?h.position-E.position:0}else r(g);o.forEach(C=>{C(n.value,w,{delta:D,type:Bf.pop,direction:D?D>0?Md.forward:Md.back:Md.unknown})})};function l(){i=n.value}function c(h){o.push(h);const g=()=>{const w=o.indexOf(h);w>-1&&o.splice(w,1)};return s.push(g),g}function u(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(At({},h.state,{scroll:uu()}),"")}}function d(){for(const h of s)h();s=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:c,destroy:d}}function Ig(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?uu():null}}function zM(e){const{history:t,location:n}=window,r={value:Zb(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,c,u){const d=e.indexOf("#"),h=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+l:WM()+e+l;try{t[u?"replaceState":"pushState"](c,"",h),o.value=c}catch(g){console.error(g),n[u?"replace":"assign"](h)}}function i(l,c){s(l,At({},t.state,Ig(o.value.back,l,o.value.forward,!0),c,{position:o.value.position}),!0),r.value=l}function a(l,c){const u=At({},o.value,t.state,{forward:l,scroll:uu()});s(u.current,u,!0),s(l,At({},Ig(r.value,l,null),{position:u.position+1},c),!1),r.value=l}return{location:r,state:o,push:a,replace:i}}function GM(e){e=RM(e);const t=zM(e),n=VM(e,t.state,t.location,t.replace);function r(s,i=!0){i||n.pauseListeners(),history.go(s)}const o=At({location:"",base:e,go:r,createHref:PM.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 KM(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),GM(e)}let Hs=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var gn=(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})(gn||{});const YM={type:Hs.Static,value:""},JM=/[a-zA-Z0-9_]/;function XM(e){if(!e)return[[]];if(e==="/")return[[YM]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(g){throw new Error(`ERR (${n})/"${c}": ${g}`)}let n=gn.Static,r=n;const o=[];let s;function i(){s&&o.push(s),s=[]}let a=0,l,c="",u="";function d(){c&&(n===gn.Static?s.push({type:Hs.Static,value:c}):n===gn.Param||n===gn.ParamRegExp||n===gn.ParamRegExpEnd?(s.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.push({type:Hs.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),c="")}function h(){c+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==gn.ParamRegExp){r=n,n=gn.EscapeNext;continue}switch(n){case gn.Static:l==="/"?(c&&d(),i()):l===":"?(d(),n=gn.Param):h();break;case gn.EscapeNext:h(),n=r;break;case gn.Param:l==="("?n=gn.ParamRegExp:JM.test(l)?h():(d(),n=gn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case gn.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=gn.ParamRegExpEnd:u+=l;break;case gn.ParamRegExpEnd:d(),n=gn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===gn.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),d(),i(),o}const Ag="[^/]+?",QM={sensitive:!1,strict:!1,start:!0,end:!0};var Qn=(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})(Qn||{});const ZM=/[.+*?^${}()[\]/\\]/g;function eP(e,t){const n=At({},QM,t),r=[];let o=n.start?"^":"";const s=[];for(const c of e){const u=c.length?[]:[Qn.Root];n.strict&&!c.length&&(o+="/");for(let d=0;d<c.length;d++){const h=c[d];let g=Qn.Segment+(n.sensitive?Qn.BonusCaseSensitive:0);if(h.type===Hs.Static)d||(o+="/"),o+=h.value.replace(ZM,"\\$&"),g+=Qn.Static;else if(h.type===Hs.Param){const{value:w,repeatable:E,optional:D,regexp:C}=h;s.push({name:w,repeatable:E,optional:D});const I=C||Ag;if(I!==Ag){g+=Qn.BonusCustomRegExp;try{`${I}`}catch(z){throw new Error(`Invalid custom RegExp for param "${w}" (${I}): `+z.message)}}let V=E?`((?:${I})(?:/(?:${I}))*)`:`(${I})`;d||(V=D&&c.length<2?`(?:/${V})`:"/"+V),D&&(V+="?"),o+=V,g+=Qn.Dynamic,D&&(g+=Qn.BonusOptional),E&&(g+=Qn.BonusRepeatable),I===".*"&&(g+=Qn.BonusWildcard)}u.push(g)}r.push(u)}if(n.strict&&n.end){const c=r.length-1;r[c][r[c].length-1]+=Qn.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function a(c){const u=c.match(i),d={};if(!u)return null;for(let h=1;h<u.length;h++){const g=u[h]||"",w=s[h-1];d[w.name]=g&&w.repeatable?g.split("/"):g}return d}function l(c){let u="",d=!1;for(const h of e){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const g of h)if(g.type===Hs.Static)u+=g.value;else if(g.type===Hs.Param){const{value:w,repeatable:E,optional:D}=g,C=w in c?c[w]:"";if(to(C)&&!E)throw new Error(`Provided param "${w}" is an array but it is not repeatable (* or + modifiers)`);const I=to(C)?C.join("/"):C;if(!I)if(D)h.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${w}"`);u+=I}}return u||"/"}return{re:i,score:r,keys:s,parse:a,stringify:l}}function tP(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]===Qn.Static+Qn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Qn.Static+Qn.Segment?1:-1:0}function ew(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const s=tP(r[n],o[n]);if(s)return s;n++}if(Math.abs(o.length-r.length)===1){if(Rg(r))return 1;if(Rg(o))return-1}return o.length-r.length}function Rg(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const nP={strict:!1,end:!0,sensitive:!1};function rP(e,t,n){const r=eP(XM(e.path),n),o=At(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function oP(e,t){const n=[],r=new Map;t=Sg(nP,t);function o(d){return r.get(d)}function s(d,h,g){const w=!g,E=Pg(d);E.aliasOf=g&&g.record;const D=Sg(t,d),C=[E];if("alias"in d){const z=typeof d.alias=="string"?[d.alias]:d.alias;for(const ce of z)C.push(Pg(At({},E,{components:g?g.record.components:E.components,path:ce,aliasOf:g?g.record:E})))}let I,V;for(const z of C){const{path:ce}=z;if(h&&ce[0]!=="/"){const re=h.record.path,Z=re[re.length-1]==="/"?"":"/";z.path=h.record.path+(ce&&Z+ce)}if(I=rP(z,h,D),g?g.alias.push(I):(V=V||I,V!==I&&V.alias.push(I),w&&d.name&&!$g(I)&&i(d.name)),tw(I)&&l(I),E.children){const re=E.children;for(let Z=0;Z<re.length;Z++)s(re[Z],I,g&&g.children[Z])}g=g||I}return V?()=>{i(V)}:Ea}function i(d){if(Xb(d)){const h=r.get(d);h&&(r.delete(d),n.splice(n.indexOf(h),1),h.children.forEach(i),h.alias.forEach(i))}else{const h=n.indexOf(d);h>-1&&(n.splice(h,1),d.record.name&&r.delete(d.record.name),d.children.forEach(i),d.alias.forEach(i))}}function a(){return n}function l(d){const h=aP(d,n);n.splice(h,0,d),d.record.name&&!$g(d)&&r.set(d.record.name,d)}function c(d,h){let g,w={},E,D;if("name"in d&&d.name){if(g=r.get(d.name),!g)throw Bi(en.MATCHER_NOT_FOUND,{location:d});D=g.record.name,w=At(Mg(h.params,g.keys.filter(V=>!V.optional).concat(g.parent?g.parent.keys.filter(V=>V.optional):[]).map(V=>V.name)),d.params&&Mg(d.params,g.keys.map(V=>V.name))),E=g.stringify(w)}else if(d.path!=null)E=d.path,g=n.find(V=>V.re.test(E)),g&&(w=g.parse(E),D=g.record.name);else{if(g=h.name?r.get(h.name):n.find(V=>V.re.test(h.path)),!g)throw Bi(en.MATCHER_NOT_FOUND,{location:d,currentLocation:h});D=g.record.name,w=At({},h.params,d.params),E=g.stringify(w)}const C=[];let I=g;for(;I;)C.unshift(I.record),I=I.parent;return{name:D,path:E,params:w,matched:C,meta:iP(C)}}e.forEach(d=>s(d));function u(){n.length=0,r.clear()}return{addRoute:s,resolve:c,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:o}}function Mg(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Pg(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:sP(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 sP(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 $g(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function iP(e){return e.reduce((t,n)=>At(t,n.meta),{})}function aP(e,t){let n=0,r=t.length;for(;n!==r;){const s=n+r>>1;ew(e,t[s])<0?r=s:n=s+1}const o=lP(e);return o&&(r=t.lastIndexOf(o,r-1)),r}function lP(e){let t=e;for(;t=t.parent;)if(tw(t)&&ew(e,t)===0)return t}function tw({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ng(e){const t=Xr(du),n=Xr(Gp),r=le(()=>{const l=qe(e.to);return t.resolve(l)}),o=le(()=>{const{matched:l}=r.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const h=d.findIndex(ji.bind(null,u));if(h>-1)return h;const g=Lg(l[c-2]);return c>1&&Lg(u)===g&&d[d.length-1].path!==g?d.findIndex(ji.bind(null,l[c-2])):h}),s=le(()=>o.value>-1&&pP(n.params,r.value.params)),i=le(()=>o.value>-1&&o.value===n.matched.length-1&&Jb(n.params,r.value.params));function a(l={}){if(fP(l)){const c=t[qe(e.replace)?"replace":"push"](qe(e.to)).catch(Ea);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:r,href:le(()=>r.value.href),isActive:s,isExactActive:i,navigate:a}}function cP(e){return e.length===1?e[0]:e}const uP=Pn({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:Ng,setup(e,{slots:t}){const n=Gc(Ng(e)),{options:r}=Xr(du),o=le(()=>({[Dg(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Dg(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=t.default&&cP(t.default(n));return e.custom?s:gp("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),dP=uP;function fP(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 pP(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(!to(o)||o.length!==r.length||r.some((s,i)=>s.valueOf()!==o[i].valueOf()))return!1}return!0}function Lg(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Dg=(e,t,n)=>e??t??n,hP=Pn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Xr(Hf),o=le(()=>e.route||r.value),s=Xr(xg,0),i=le(()=>{let c=qe(s);const{matched:u}=o.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=le(()=>o.value.matched[i.value]);Ql(xg,le(()=>i.value+1)),Ql(HM,a),Ql(Hf,o);const l=j();return ct(()=>[l.value,a.value,e.name],([c,u,d],[h,g,w])=>{u&&(u.instances[d]=c,g&&g!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=g.leaveGuards),u.updateGuards.size||(u.updateGuards=g.updateGuards))),c&&u&&(!g||!ji(u,g)||!h)&&(u.enterCallbacks[d]||[]).forEach(E=>E(c))},{flush:"post"}),()=>{const c=o.value,u=e.name,d=a.value,h=d&&d.components[u];if(!h)return Og(n.default,{Component:h,route:c});const g=d.props[u],w=g?g===!0?c.params:typeof g=="function"?g(c):g:null,D=gp(h,At({},w,t,{onVnodeUnmounted:C=>{C.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return Og(n.default,{Component:D,route:c})||D}}});function Og(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const mP=hP;function gP(e){const t=oP(e.routes,e),n=e.parseQuery||BM,r=e.stringifyQuery||Cg,o=e.history,s=da(),i=da(),a=da(),l=M0(Zo);let c=Zo;mi&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Ad.bind(null,Q=>""+Q),d=Ad.bind(null,TM),h=Ad.bind(null,qa);function g(Q,me){let be,ge;return Xb(Q)?(be=t.getRecordMatcher(Q),ge=me):ge=Q,t.addRoute(ge,be)}function w(Q){const me=t.getRecordMatcher(Q);me&&t.removeRoute(me)}function E(){return t.getRoutes().map(Q=>Q.record)}function D(Q){return!!t.getRecordMatcher(Q)}function C(Q,me){if(me=At({},me||l.value),typeof Q=="string"){const q=Rd(n,Q,me.path),G=t.resolve({path:q.path},me),Y=o.createHref(q.fullPath);return At(q,G,{params:h(G.params),hash:qa(q.hash),redirectedFrom:void 0,href:Y})}let be;if(Q.path!=null)be=At({},Q,{path:Rd(n,Q.path,me.path).path});else{const q=At({},Q.params);for(const G in q)q[G]==null&&delete q[G];be=At({},Q,{params:d(q)}),me.params=d(me.params)}const ge=t.resolve(be,me),Qe=Q.hash||"";ge.params=u(h(ge.params));const k=CM(r,At({},Q,{hash:bM(Qe),path:ge.path})),x=o.createHref(k);return At({fullPath:k,hash:Qe,query:r===Cg?UM(Q.query):Q.query||{}},ge,{redirectedFrom:void 0,href:x})}function I(Q){return typeof Q=="string"?Rd(n,Q,l.value.path):At({},Q)}function V(Q,me){if(c!==Q)return Bi(en.NAVIGATION_CANCELLED,{from:me,to:Q})}function z(Q){return Z(Q)}function ce(Q){return z(At(I(Q),{replace:!0}))}function re(Q,me){const be=Q.matched[Q.matched.length-1];if(be&&be.redirect){const{redirect:ge}=be;let Qe=typeof ge=="function"?ge(Q,me):ge;return typeof Qe=="string"&&(Qe=Qe.includes("?")||Qe.includes("#")?Qe=I(Qe):{path:Qe},Qe.params={}),At({query:Q.query,hash:Q.hash,params:Qe.path!=null?{}:Q.params},Qe)}}function Z(Q,me){const be=c=C(Q),ge=l.value,Qe=Q.state,k=Q.force,x=Q.replace===!0,q=re(be,ge);if(q)return Z(At(I(q),{state:typeof q=="object"?At({},Qe,q.state):Qe,force:k,replace:x}),me||be);const G=be;G.redirectedFrom=me;let Y;return!k&&xM(r,ge,be)&&(Y=Bi(en.NAVIGATION_DUPLICATED,{to:G,from:ge}),ke(ge,ge,!0,!1)),(Y?Promise.resolve(Y):Te(G,ge)).catch(te=>Co(te)?Co(te,en.NAVIGATION_GUARD_REDIRECT)?te:Pe(te):ue(te,G,ge)).then(te=>{if(te){if(Co(te,en.NAVIGATION_GUARD_REDIRECT))return Z(At({replace:x},I(te.to),{state:typeof te.to=="object"?At({},Qe,te.to.state):Qe,force:k}),me||G)}else te=H(G,ge,!0,x,Qe);return fe(G,ge,te),te})}function de(Q,me){const be=V(Q,me);return be?Promise.reject(be):Promise.resolve()}function _e(Q){const me=Je.values().next().value;return me&&typeof me.runWithContext=="function"?me.runWithContext(Q):Q()}function Te(Q,me){let be;const[ge,Qe,k]=qM(Q,me);be=Pd(ge.reverse(),"beforeRouteLeave",Q,me);for(const q of ge)q.leaveGuards.forEach(G=>{be.push(os(G,Q,me))});const x=de.bind(null,Q,me);return be.push(x),Ke(be).then(()=>{be=[];for(const q of s.list())be.push(os(q,Q,me));return be.push(x),Ke(be)}).then(()=>{be=Pd(Qe,"beforeRouteUpdate",Q,me);for(const q of Qe)q.updateGuards.forEach(G=>{be.push(os(G,Q,me))});return be.push(x),Ke(be)}).then(()=>{be=[];for(const q of k)if(q.beforeEnter)if(to(q.beforeEnter))for(const G of q.beforeEnter)be.push(os(G,Q,me));else be.push(os(q.beforeEnter,Q,me));return be.push(x),Ke(be)}).then(()=>(Q.matched.forEach(q=>q.enterCallbacks={}),be=Pd(k,"beforeRouteEnter",Q,me,_e),be.push(x),Ke(be))).then(()=>{be=[];for(const q of i.list())be.push(os(q,Q,me));return be.push(x),Ke(be)}).catch(q=>Co(q,en.NAVIGATION_CANCELLED)?q:Promise.reject(q))}function fe(Q,me,be){a.list().forEach(ge=>_e(()=>ge(Q,me,be)))}function H(Q,me,be,ge,Qe){const k=V(Q,me);if(k)return k;const x=me===Zo,q=mi?history.state:{};be&&(ge||x?o.replace(Q.fullPath,At({scroll:x&&q&&q.scroll},Qe)):o.push(Q.fullPath,Qe)),l.value=Q,ke(Q,me,be,x),Pe()}let ee;function Se(){ee||(ee=o.listen((Q,me,be)=>{if(!st.listening)return;const ge=C(Q),Qe=re(ge,st.currentRoute.value);if(Qe){Z(At(Qe,{replace:!0,force:!0}),ge).catch(Ea);return}c=ge;const k=l.value;mi&&LM(kg(k.fullPath,be.delta),uu()),Te(ge,k).catch(x=>Co(x,en.NAVIGATION_ABORTED|en.NAVIGATION_CANCELLED)?x:Co(x,en.NAVIGATION_GUARD_REDIRECT)?(Z(At(I(x.to),{force:!0}),ge).then(q=>{Co(q,en.NAVIGATION_ABORTED|en.NAVIGATION_DUPLICATED)&&!be.delta&&be.type===Bf.pop&&o.go(-1,!1)}).catch(Ea),Promise.reject()):(be.delta&&o.go(-be.delta,!1),ue(x,ge,k))).then(x=>{x=x||H(ge,k,!1),x&&(be.delta&&!Co(x,en.NAVIGATION_CANCELLED)?o.go(-be.delta,!1):be.type===Bf.pop&&Co(x,en.NAVIGATION_ABORTED|en.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),fe(ge,k,x)}).catch(Ea)}))}let Ne=da(),ye=da(),Re;function ue(Q,me,be){Pe(Q);const ge=ye.list();return ge.length?ge.forEach(Qe=>Qe(Q,me,be)):console.error(Q),Promise.reject(Q)}function Me(){return Re&&l.value!==Zo?Promise.resolve():new Promise((Q,me)=>{Ne.add([Q,me])})}function Pe(Q){return Re||(Re=!Q,Se(),Ne.list().forEach(([me,be])=>Q?be(Q):me()),Ne.reset()),Q}function ke(Q,me,be,ge){const{scrollBehavior:Qe}=e;if(!mi||!Qe)return Promise.resolve();const k=!be&&DM(kg(Q.fullPath,0))||(ge||!be)&&history.state&&history.state.scroll||null;return tn().then(()=>Qe(Q,me,k)).then(x=>x&&NM(x)).catch(x=>ue(x,Q,me))}const We=Q=>o.go(Q);let Ye;const Je=new Set,st={currentRoute:l,listening:!0,addRoute:g,removeRoute:w,clearRoutes:t.clearRoutes,hasRoute:D,getRoutes:E,resolve:C,options:e,push:z,replace:ce,go:We,back:()=>We(-1),forward:()=>We(1),beforeEach:s.add,beforeResolve:i.add,afterEach:a.add,onError:ye.add,isReady:Me,install(Q){Q.component("RouterLink",dP),Q.component("RouterView",mP),Q.config.globalProperties.$router=st,Object.defineProperty(Q.config.globalProperties,"$route",{enumerable:!0,get:()=>qe(l)}),mi&&!Ye&&l.value===Zo&&(Ye=!0,z(o.location).catch(ge=>{}));const me={};for(const ge in Zo)Object.defineProperty(me,ge,{get:()=>l.value[ge],enumerable:!0});Q.provide(du,st),Q.provide(Gp,Jv(me)),Q.provide(Hf,l);const be=Q.unmount;Je.add(Q),Q.unmount=function(){Je.delete(Q),Je.size<1&&(c=Zo,ee&&ee(),ee=null,l.value=Zo,Ye=!1,Re=!1),be()}}};function Ke(Q){return Q.reduce((me,be)=>me.then(()=>_e(be)),Promise.resolve())}return st}function vP(){return Xr(du)}function _P(e){return Xr(Gp)}const Fg=768;function Kp(){const e=j(typeof window<"u"?window.innerWidth<Fg:!1);let t=null;function n(r){e.value=r.matches}return vs(()=>{t=window.matchMedia(`(max-width: ${Fg-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Yc(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const yP={key:0,class:"desktop-sidebar"},bP={class:"desktop-main"},jg="codex-web-local.sidebar-width.v1",wP=260,SP=620,Bg=320,TP=Pn({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Kp();function r(c){return Math.min(SP,Math.max(wP,c))}function o(){if(typeof window>"u")return Bg;const c=window.localStorage.getItem(jg),u=Number(c);return Number.isFinite(u)?r(u):Bg}const s=j(o()),i=le(()=>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(c){typeof window>"u"||window.localStorage.setItem(jg,String(c))}function l(c){c.preventDefault();const u=c.clientX,d=s.value,h=w=>{const E=w.clientX-u;s.value=r(d+E)},g=()=>{a(s.value),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",g)};window.addEventListener("mousemove",h),window.addEventListener("mouseup",g)}return(c,u)=>(A(),O("div",{class:ht(["desktop-layout",{"is-mobile":qe(n)}]),style:Po(i.value)},[qe(n)?(A(),bt(Zl,{key:0,to:"body"},[Ge(B_,{name:"drawer"},{default:It(()=>[e.isSidebarCollapsed?Ce("",!0):(A(),O("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=d=>c.$emit("close-sidebar"))},[_("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=wt(()=>{},["stop"]))},[vo(c.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):Ce("",!0),qe(n)?Ce("",!0):(A(),O(et,{key:1},[e.isSidebarCollapsed?Ce("",!0):(A(),O("aside",yP,[vo(c.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?Ce("",!0):(A(),O("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),_("section",bP,[vo(c.$slots,"content",{},void 0)])],6))}}),xt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},EP=xt(TP,[["__scopeId","data-v-4c6dbcd7"]]);function Ug(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Do extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Yp(e,t){const n=Ug(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const o=Ug(r);return o&&typeof o.message=="string"&&o.message.length>0?o.message:t}function Vo(e,t,n){return e instanceof Do?e:e instanceof Error?new Do(e.message||t,{code:"unknown_error",method:n}):new Do(t,{code:"unknown_error",method:n})}function nw(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function kP(e,t){const n={method:e,params:t??null};return bf({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 Do(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 Do(Yp(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 Do(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return s.result})}function CP(e){const t=nw(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 Hg(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function xP(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=(u,d)=>{if(n||r!==null)return;const h=Math.min(1e3*2**d,1e4);r=window.setTimeout(()=>{r=null,!n&&u()},h)},a=u=>{const d=CP(u);d&&e(d)},l=(u=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const d=new EventSource("/codex-api/events");let h=!1;d.onmessage=g=>{try{a(JSON.parse(g.data))}catch{}},d.addEventListener("ready",g=>{try{const w=g.data?JSON.parse(g.data):{ok:!0};Hg(e,w)}catch{Hg(e)}}),d.onerror=()=>{n||h||d.readyState===EventSource.CLOSED&&(h=!0,d.close(),i(()=>l(u+1),u))},t=()=>{h=!0,d.close()}},c=(u=0)=>{if(typeof WebSocket>"u"||n){l();return}t==null||t();const d=window.location.protocol==="https:"?"wss:":"ws:",h=new WebSocket(`${d}//${window.location.host}/codex-api/ws`);let g=!1,w=!1,E=window.setTimeout(()=>{g||n||w||(w=!0,h.close(),l())},2500);h.onopen=()=>{g=!0,s(),E!==null&&(window.clearTimeout(E),E=null),yr({category:"ws",message:"WebSocket connected",level:"info"})},h.onmessage=D=>{try{a(JSON.parse(String(D.data)))}catch{}},h.onerror=()=>{},h.onclose=()=>{if(E!==null&&(window.clearTimeout(E),E=null),!(n||w)){if(o++,yr({category:"ws",message:`WebSocket closed (attempt ${u})`,data:{totalReconnects:o},level:"warning"}),G1("ws_reconnects",o),!g){l();return}i(()=>c(u+1),u)}},t=()=>{w=!0,E!==null&&(window.clearTimeout(E),E=null),h.close()}};return typeof WebSocket<"u"?c():l(),()=>{n=!0,s(),t==null||t()}}async function IP(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 Do(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 Do(Yp(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function AP(){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 Do(Yp(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=nw(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function RP(e){const t=e.trim();return t?t.startsWith("\\\\?\\UNC\\")?`\\\\${t.slice(8)}`:t.startsWith("\\\\?\\")?t.slice(4):t:""}function ln(e){return RP(e)}function MP(e){return/^[a-z]:[\\/]/iu.test(e)||e.startsWith("\\\\")}function PP(e){const t=ln(e).replace(/[\\/]+/gu,"/");return MP(t)?t.toLowerCase():t}function gi(e){const t=ln(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<0?t:t.slice(n+1)}function $d(e){const t=ln(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?"":t.slice(0,n)}function ul(e){return gi(e)||ln(e)||"unknown-project"}function qg(e){return new Date(e*1e3).toISOString()}function $P(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const NP=/^##\s+(.+?):\s+(.+?)\s*$/,LP=/^#\s*files mentioned by the user\s*:?\s*$/i;function DP(e){var o,s;const t=e.split(`
|
|
524
|
+
`).findIndex(i=>LP.test(i.trim()));if(t<0)return[];const n=e.split(`
|
|
525
|
+
`).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(NP);if(!l)break;const c=(o=l[1])==null?void 0:o.trim(),u=(s=l[2])==null?void 0:s.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");c&&u&&r.push({label:c,path:u})}return r}function OP(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 FP(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!=="text"&&l.type!=="image"&&o.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:$P(l),isUnhandled:!0});const s=n.join(`
|
|
526
|
+
`),i=DP(s);return{text:OP(s),images:r,fileAttachments:i,rawBlocks:o}}function jP(e){var s;const t=e.replace(/\r\n/g,`
|
|
527
|
+
`).trim();if(!t)return null;const n=t.split(`
|
|
528
|
+
`),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 c=(l[1]??" ").toLowerCase(),u=(s=l[2])==null?void 0:s.trim();if(!u)continue;let d="pending";c==="x"&&(d="completed"),(c==="~"||c===">"||c==="-")&&(d="inProgress"),r.push({step:u,status:d});continue}o.push(a)}return r.length===0?null:{explanation:o.join(`
|
|
529
|
+
`).trim()||void 0,steps:r}}function Wg(e){if(!e)return 0;const t=e.replace(/\r\n/g,`
|
|
530
|
+
`),n=t.endsWith(`
|
|
531
|
+
`)?t.slice(0,-1):t;return n?n.split(`
|
|
532
|
+
`).length:0}function BP(e){let t=0,n=0;for(const r of e.replace(/\r\n/g,`
|
|
533
|
+
`).split(`
|
|
534
|
+
`))if(r&&!(r.startsWith("+++")||r.startsWith("---")||r.startsWith("@@"))){if(r.startsWith("+")){t+=1;continue}r.startsWith("-")&&(n+=1)}return{addedLineCount:t,removedLineCount:n}}function rw(e){return e==="failed"||e==="declined"||e==="completed"?e:"inProgress"}function ow(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 c=l==="update"&&typeof(a==null?void 0:a.move_path)=="string"?a.move_path:null,u=l==="update"?BP(i):l==="add"?{addedLineCount:Wg(i),removedLineCount:0}:{addedLineCount:0,removedLineCount:Wg(i)};n.push({path:s,operation:l,movedToPath:c,diff:i,...u})}return n}function UP(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=FP(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:jP(t)??void 0}]}if(e.type==="commandExecution"){const t=e,n=HP(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=ow(e.changes),n=rw(e.status);return t.length===0||n!=="completed"?[]:[{id:e.id,role:"system",text:"",messageType:"fileChange",fileChangeStatus:n,fileChanges:t}]}return[]}function HP(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function qP(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 WP(e){const t=qP(e);return t.length>0?t:"Untitled thread"}function Jp(e){return(e==null?void 0:e.status)==="inProgress"}function VP(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 Jp(r)}function zP(e){const t=e,n=ln(typeof t.cwd=="string"?t.cwd:e.cwd),r=PP(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:WP(e),projectName:ul(n),cwd:n,hasWorktree:o,createdAtIso:qg(e.createdAt),updatedAtIso:qg(e.updatedAt),preview:e.preview,unread:!1,inProgress:VP(e)}}function GP(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 KP(e){const t=e.data.map(zP);return GP(t)}function fu(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 UP(a))n.push({...l,turnId:s,turnIndex:r})}return n}function YP(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Jp(t.at(-1))}function sw(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(Jp(r)&&typeof r.id=="string"&&r.id.trim().length>0)return r.id.trim()}return""}const JP=5e3;function Nd(e){return e&&e.length>0?e:null}function Ld(e){return e&&e.length>0?e:null}const Vg=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function zg(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 In(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function mt(e){return typeof e=="string"&&e.length>0?e:null}function jn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Lc(e){return typeof e=="boolean"?e:null}function XP(e){return e==="payment_required"?e:null}function QP(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("payment required")||/\b402\b/.test(t)}function Gg(e){const t=In(e);if(!t)return null;const n=jn(t.usedPercent??t.used_percent);if(n===null)return null;const r=jn(t.windowDurationMins??t.window_minutes);return{usedPercent:n,windowDurationMins:r,windowMinutes:r,resetsAt:jn(t.resetsAt??t.resets_at)}}function ZP(e){const t=In(e);if(!t)return null;const n=Lc(t.hasCredits??t.has_credits),r=Lc(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:mt(t.balance)}}function qf(e){const t=In(e);if(!t)return null;const n=Gg(t.primary),r=Gg(t.secondary),o=ZP(t.credits);return!n&&!r&&!o?null:{limitId:mt(t.limitId??t.limit_id),limitName:mt(t.limitName??t.limit_name),primary:n,secondary:r,credits:o,planType:mt(t.planType??t.plan_type)}}function iw(e,t=null){const n=In(e);if(!n)return null;const r=mt(n.accountId),o=mt(n.quotaStatus),s=o==="loading"||o==="ready"||o==="error"?o:"idle";return r?{accountId:r,authMode:mt(n.authMode),email:mt(n.email),planType:mt(n.planType),lastRefreshedAtIso:mt(n.lastRefreshedAtIso)??"",lastActivatedAtIso:mt(n.lastActivatedAtIso),quotaSnapshot:qf(n.quotaSnapshot),quotaUpdatedAtIso:mt(n.quotaUpdatedAtIso),quotaStatus:s,quotaError:mt(n.quotaError),unavailableReason:XP(n.unavailableReason)??(QP(mt(n.quotaError))?"payment_required":null),isActive:Lc(n.isActive)??r===t}:null}function aw(e){const t=In(e);if(!t)return null;const n=In(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=qf(n==null?void 0:n.codex);return r||qf(t.rateLimits??t.rate_limits)}async function dn(e,t){try{return await kP(e,t)}catch(n){throw Vo(n,`RPC ${e} failed`,e)}}function lw(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 e$(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function t$(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}async function n$(){const e=await dn("thread/list",{archived:!1,limit:100,sortKey:"updated_at",modelProviders:[]});return KP(e)}async function r$(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 o$(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:fu(n),inProgress:e.isInProgress,activeTurnId:sw(n),turnIndexByTurnId:lw(n)}}async function s$(e){const t=await r$(e);if(t&&!t.liveStateError){const o=o$(t);if(o&&o.messages.length>0)return o}const n=await dn("thread/read",{threadId:e,includeTurns:!0});return{messages:fu(n),inProgress:YP(n),activeTurnId:sw(n),turnIndexByTurnId:lw(n)}}async function i$(){try{return await n$()}catch(e){throw Vo(e,"Failed to load thread groups","thread/list")}}async function Kg(e){try{return await s$(e)}catch(t){throw Vo(t,`Failed to load thread ${e}`,"thread/read")}}function a$(e){const t=In(e);if(!t)return null;const n=mt(t.key),r=typeof t.text=="string"?t.text:"",o=mt(t.kind);return!n||!o||o!=="meta"&&o!=="hunk"&&o!=="add"&&o!=="remove"&&o!=="context"?null:{key:n,kind:o,text:r,oldLine:jn(t.oldLine),newLine:jn(t.newLine)}}function l$(e){const t=In(e);if(!t)return null;const n=mt(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:jn(t.addedLineCount)??0,removedLineCount:jn(t.removedLineCount)??0,oldStart:jn(t.oldStart),oldLineCount:jn(t.oldLineCount)??0,newStart:jn(t.newStart),newLineCount:jn(t.newLineCount)??0,lines:Array.isArray(t.lines)?t.lines.map(s=>a$(s)).filter(s=>s!==null):[]}:null}function c$(e){const t=In(e);if(!t)return null;const n=mt(t.id),r=mt(t.path),o=mt(t.absolutePath),s=mt(t.operation);return!n||!r||!o||!s||s!=="add"&&s!=="delete"&&s!=="update"&&s!=="rename"?null:{id:n,path:r,absolutePath:o,previousPath:mt(t.previousPath),previousAbsolutePath:mt(t.previousAbsolutePath),operation:s,addedLineCount:jn(t.addedLineCount)??0,removedLineCount:jn(t.removedLineCount)??0,diff:typeof t.diff=="string"?t.diff:"",hunks:Array.isArray(t.hunks)?t.hunks.map(i=>l$(i)).filter(i=>i!==null):[]}}function cw(e){const t=In(e),n=In(t==null?void 0:t.data),r=In(n==null?void 0:n.summary),o=mt(n==null?void 0:n.scope)==="baseBranch"?"baseBranch":"workspace",s=mt(n==null?void 0:n.workspaceView)==="staged"?"staged":"unstaged";return{cwd:mt(n==null?void 0:n.cwd)??"",gitRoot:mt(n==null?void 0:n.gitRoot),isGitRepo:Lc(n==null?void 0:n.isGitRepo)??!1,scope:o,workspaceView:s,baseBranch:mt(n==null?void 0:n.baseBranch),baseBranchOptions:Array.isArray(n==null?void 0:n.baseBranchOptions)?n.baseBranchOptions.map(i=>mt(i)).filter(i=>typeof i=="string"&&i.length>0):[],headBranch:mt(n==null?void 0:n.headBranch),mergeBaseSha:mt(n==null?void 0:n.mergeBaseSha),generatedAtIso:mt(n==null?void 0:n.generatedAtIso)??"",summary:{fileCount:jn(r==null?void 0:r.fileCount)??0,addedLineCount:jn(r==null?void 0:r.addedLineCount)??0,removedLineCount:jn(r==null?void 0:r.removedLineCount)??0},files:Array.isArray(n==null?void 0:n.files)?n.files.map(i=>c$(i)).filter(i=>i!==null):[]}}function u$(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 d$(e){var i;const t=e.replace(/\r\n/g,`
|
|
535
|
+
`).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 c=0;for(const u of l){const d=((i=u[1])==null?void 0:i.trim())??"",h=u$(u[2]??""),g=(u[0]??"").trim(),w=(u[3]??"").split(`
|
|
536
|
+
`).map(E=>E.replace(/^ /u,"")).join(`
|
|
537
|
+
`).trim();s.push({id:`finding:${c}`,title:d||`Finding ${c+1}`,body:w,path:h.absolutePath?h.absolutePath.split("/").filter(Boolean).slice(-1)[0]??h.absolutePath:null,absolutePath:h.absolutePath,startLine:h.startLine,endLine:h.endLine,rawText:g}),c+=1}}return{reviewText:t,summary:r,findings:s}}function Yg(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 q3(e){const t=await dn("thread/read",{threadId:e,includeTurns:!0}),n=Yg(t,"exitedReviewMode");return{enteredReviewLabel:Yg(t,"enteredReviewMode"),result:n?d$(n):null}}function f$(e){return xP(e)}async function p$(e,t){await IP({id:e,...t})}async function h$(){return AP()}async function Jg(){try{const e=await dn("account/rateLimits/read");return aw(e)}catch(e){throw Vo(e,"Failed to load account rate limits","account/rateLimits/read")}}function Xp(e){const t=In(e),n=mt(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:mt(t==null?void 0:t.importedAccountId)??void 0,accounts:r.map(o=>iw(o,n)).filter(o=>o!==null)}}async function m$(){const e=await fetch("/codex-api/accounts"),t=await e.json();if(!e.ok)throw new Error(tr(t,"Failed to load accounts"));const n=In(t);return Xp(n==null?void 0:n.data)}async function g$(){const e=await fetch("/codex-api/accounts/refresh",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(tr(t,"Failed to refresh accounts"));const n=In(t);return Xp(n==null?void 0:n.data)}async function v$(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(tr(n,"Failed to switch account"));const r=In(n),o=In(r==null?void 0:r.data),s=iw(o==null?void 0:o.account,mt(o==null?void 0:o.activeAccountId));if(!s)throw new Error("Failed to switch account");return s}async function _$(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(tr(n,"Failed to remove account"));const r=In(n);return Xp(r==null?void 0:r.data)}async function Dd(e){const t=await dn("thread/resume",{threadId:e});return{model:Dc(t)}}async function y$(e){await dn("thread/archive",{threadId:e})}async function b$(e,t){await dn("thread/name/set",{threadId:e,name:t})}async function Od(e,t){const n=await dn("thread/rollback",{threadId:e,numTurns:t});return fu(n)}async function w$(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 S$(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 Dc(e){if(!e||typeof e!="object")return"";const t=e.model;return typeof t=="string"?t.trim():""}async function Xg(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 dn("thread/start",n),o=Wf(r);if(!o)throw new Error("thread/start did not return a thread id");return{threadId:o,model:Dc(r)}}catch(n){throw Vo(n,"Failed to start a new thread","thread/start")}}async function Qg(e,t,n){if(arguments.length<=1)try{const r=await dn("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:S$(r),model:Dc(r),messages:fu(r)}}catch(r){throw Vo(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 dn("thread/fork",o),i=Wf(s);if(!i)throw new Error("thread/fork did not return a thread id");return{threadId:i,model:Dc(s)}}catch(r){throw Vo(r,`Failed to fork thread ${e}`,"thread/fork")}}function T$(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
538
|
+
`;for(const r of t)n+=`
|
|
539
|
+
## ${r.label}: ${r.path}
|
|
540
|
+
`;return`${n}
|
|
541
|
+
## My request for Codex:
|
|
542
|
+
|
|
543
|
+
${e}
|
|
544
|
+
`}async function E$(e,t,n){var l;const r=(t==null?void 0:t.trim())??"";if(r)return{model:r,reasoningEffort:e==="plan"?Nd(n):Ld(n)};let o=null;try{o=await dw()}catch{o=null}const s=(o==null?void 0:o.model.trim())??"";if(s)return{model:s,reasoningEffort:e==="plan"?Nd(n??(o==null?void 0:o.reasoningEffort)):Ld(n??(o==null?void 0:o.reasoningEffort))};let i=[];try{i=await uw()}catch{i=[]}const a=((l=i.find(c=>c.trim().length>0))==null?void 0:l.trim())??"";if(a)return{model:a,reasoningEffort:e==="plan"?Nd(n??(o==null?void 0:o.reasoningEffort)):Ld(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 Fd(e,t,n=[],r,o,s,i=[],a){var l;try{const c=(r==null?void 0:r.trim())??"",d=[{type:"text",text:T$(t,i)}];for(const E of n){const D=E.trim();D&&d.push({type:"image",url:D,image_url:D})}if(s)for(const E of s)d.push({type:"skill",name:E.name,path:E.path});const h=i.map(E=>({label:E.label,path:E.path,fsPath:E.fsPath})),g={threadId:e,input:d};if(h.length>0&&(g.attachments=h),c&&(g.model=c),typeof o=="string"&&o.length>0&&(g.effort=o),a){const E=await E$(a,c,o);g.collaborationMode={mode:a,settings:{model:E.model,reasoning_effort:E.reasoningEffort,developer_instructions:null}}}const w=await dn("turn/start",g);return typeof((l=w==null?void 0:w.turn)==null?void 0:l.id)=="string"?w.turn.id.trim():""}catch(c){throw Vo(c,`Failed to start turn for thread ${e}`,"turn/start")}}async function k$(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 dn("turn/interrupt",{threadId:n,turnId:r})}catch(o){throw Vo(o,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function C$(e){const t=e==="fast"?"fast":"standard";await dn("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 uw(){const e=await dn("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(JP)});let r=null;try{r=await n.json()}catch{r=null}if(n.ok&&Array.isArray(r==null?void 0:r.data))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 dw(){const e=await dn("config/read",{}),t=e.config.model??"",n=e$(e.config.model_reasoning_effort),r=t$(e.config.service_tier);return{model:t,reasoningEffort:n,speedMode:r}}function x$(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function I$(){try{const e=await dn("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:x$(r.name||o)||(o==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of Vg)t.has(r.value)||n.push(r);return n.sort((r,o)=>r.value===o.value?0:r.value==="default"?-1:1)}}catch{}return Vg}function A$(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"?ln(s):"";a.length>0&&typeof i=="string"&&(o[a]=i)}return{order:n(t.order).map(s=>ln(s)),labels:o,active:n(t.active).map(s=>ln(s))}}async function Ls(){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 A$(n.data)}async function R$(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:ln(o.data.cwd),gitRoot:ln(o.data.gitRoot)}}async function M$(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 c=l,u=typeof c.value=="string"?c.value.trim():"",d=typeof c.label=="string"?c.label.trim():"";!u||a.has(u)||(a.add(u),i.push({value:u,label:d||u}))}return i}async function P$(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:[],c=[],u=new Set;for(const d of l){if(!d||typeof d!="object"||Array.isArray(d))continue;const h=d,g=typeof h.value=="string"?h.value.trim():"",w=typeof h.label=="string"?h.label.trim():"";!g||u.has(g)||(u.add(g),c.push({value:g,label:w||g}))}return a&&!u.has(a)&&c.unshift({value:a,label:a}),{currentBranch:a,options:c}}async function $$(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 W3(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(tr(i,"Failed to load review snapshot"));return cw(i)}async function V3(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(tr(n,"Failed to apply review action"));return cw(n)}async function z3(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(tr(n,"Failed to initialize Git"))}async function G3(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 dn("review/start",{threadId:e,target:o,delivery:"inline"})}async function Zg(){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 N$(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 fw(r);if(!r.ok){const l=tr(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"?ln(i.path):"",parentPath:typeof i.parentPath=="string"?ln(i.parentPath):"",entries:a.flatMap(l=>{if(!l||typeof l!="object"||Array.isArray(l))return[];const c=l,u=typeof c.name=="string"?c.name.trim():"",d=typeof c.path=="string"?ln(c.path):"";return u&&d?[{name:u,path:d}]:[]})}}async function fw(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 jd(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 ev(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=tr(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"?ln(s.path):""}async function L$(e){const t=await fetch("/codex-api/local-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),n=await fw(t);if(!t.ok){const s=tr(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"?ln(o.path):""}async function D$(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=tr(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"?ln(s.path):""}}async function O$(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 c=tr(s,"Failed to search files");throw new Error(c)}const i=s&&typeof s=="object"&&!Array.isArray(s)?s:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const c of a){if(!c||typeof c!="object"||Array.isArray(c))continue;const d=c.path,h=typeof d=="string"?d.trim():"";h&&l.push({path:h})}return l}async function F$(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 j$(e){const t=await fetch("/codex-api/telegram/configure-bot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:e})}),n=await t.json();if(!t.ok){const r=tr(n,"Failed to connect Telegram bot");throw new Error(r)}}async function B$(){const e=await fetch("/codex-api/telegram/status"),t=await e.json();if(!e.ok){const o=tr(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,lastError:typeof r.lastError=="string"?r.lastError:""}}function U$(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 H$(e,t=6){const n=Math.min(10,Math.max(1,Math.floor(t)));if(e.startsWith("search-")){const u=new Date;e==="search-daily"?u.setUTCDate(u.getUTCDate()-1):e==="search-weekly"?u.setUTCDate(u.getUTCDate()-7):u.setUTCDate(u.getUTCDate()-30);const d=new URLSearchParams({q:`created:>=${U$(u)}`,sort:"stars",order:"desc",per_page:String(n)}),h=await fetch(`https://api.github.com/search/repositories?${d.toString()}`,{headers:{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}});if(!h.ok)throw new Error(`Failed to fetch GitHub search projects (${h.status})`);const g=await h.json(),w=g&&typeof g=="object"&&!Array.isArray(g)?g:{},E=Array.isArray(w.items)?w.items:[],D=[];for(const C of E){if(!C||typeof C!="object"||Array.isArray(C))continue;const I=C,V=typeof I.id=="number"?I.id:0,z=typeof I.full_name=="string"?I.full_name.trim():"",ce=typeof I.html_url=="string"?I.html_url.trim():"";if(!V||!z||!ce)continue;const[re="",Z=""]=z.split("/",2);D.push({id:V,fullName:z,owner:re,repo:Z,url:ce,description:zg(z,typeof I.description=="string"?I.description:""),language:typeof I.language=="string"?I.language.trim():"",stars:typeof I.stargazers_count=="number"?I.stargazers_count:0})}return D}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 u=tr(i,"Failed to fetch GitHub trending projects");throw new Error(u)}const a=i&&typeof i=="object"&&!Array.isArray(i)?i:{},l=Array.isArray(a.data)?a.data:[],c=[];for(const u of l){if(!u||typeof u!="object"||Array.isArray(u))continue;const d=u,h=typeof d.id=="number"?d.id:0,g=typeof d.fullName=="string"?d.fullName.trim():"",w=typeof d.url=="string"?d.url.trim():"";if(!h||!g||!w)continue;const[E="",D=""]=g.split("/",2);c.push({id:h,fullName:g,owner:E,repo:D,url:w,description:zg(g,typeof d.description=="string"?d.description:""),language:typeof d.language=="string"?d.language.trim():"",stars:typeof d.stars=="number"?d.stars:0})}return c}function tr(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 q$(){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 Bd(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 W$(){try{const e=await fetch("/codex-api/thread-pins");return e.ok?(await e.json()).data??{threadIds:[]}:{threadIds:[]}}catch{return{threadIds:[]}}}async function V$(e){try{await fetch("/codex-api/thread-pins",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadIds:e})})}catch{}}async function z$(e,t){var n;try{return((n=(await dn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function G$(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await dn("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 K$=6e4;async function Ud(e){const t=new AbortController,n=setTimeout(()=>t.abort(),K$);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 Y$={},J$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function X$(e,t){return A(),O("svg",J$,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const Qp=xt(Y$,[["render",X$]]),Q$={},Z$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function e2(e,t){return A(),O("svg",Z$,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const t2=xt(Q$,[["render",e2]]),n2={},r2={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function o2(e,t){return A(),O("svg",r2,[...t[0]||(t[0]=[_("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 fa=xt(n2,[["render",o2]]),s2={},i2={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function a2(e,t){return A(),O("svg",i2,[...t[0]||(t[0]=[_("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 Oc=xt(s2,[["render",a2]]),l2={},c2={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function u2(e,t){return A(),O("svg",c2,[...t[0]||(t[0]=[_("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 Zp=xt(l2,[["render",u2]]),d2={},f2={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function p2(e,t){return A(),O("svg",f2,[...t[0]||(t[0]=[_("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 h2=xt(d2,[["render",p2]]),m2={},g2={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function v2(e,t){return A(),O("svg",g2,[...t[0]||(t[0]=[_("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 vc=xt(m2,[["render",v2]]),_2={},y2={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function b2(e,t){return A(),O("svg",y2,[...t[0]||(t[0]=[_("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 Hd=xt(_2,[["render",b2]]),w2={key:0,class:"sidebar-menu-row-left"},S2={class:"sidebar-menu-row-main"},T2={key:1,class:"sidebar-menu-row-right"},E2={key:0,class:"sidebar-menu-row-right-default"},k2={key:1,class:"sidebar-menu-row-right-hover"},C2=Pn({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=uS(),r=le(()=>!!n.left),o=le(()=>!!n.right),s=le(()=>!!n["right-hover"]),i=le(()=>o.value||s.value);return(a,l)=>(A(),bt(up(t.as),N_({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:It(()=>[r.value?(A(),O("span",w2,[vo(a.$slots,"left",{},void 0,!0)])):Ce("",!0),_("span",S2,[vo(a.$slots,"default",{},void 0,!0)]),i.value?(A(),O("span",T2,[o.value?(A(),O("span",E2,[vo(a.$slots,"right",{},void 0,!0)])):Ce("",!0),s.value?(A(),O("span",k2,[vo(a.$slots,"right-hover",{},void 0,!0)])):Ce("",!0)])):Ce("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),$s=xt(C2,[["__scopeId","data-v-36239f39"]]),x2={class:"thread-tree-root"},I2={key:0,class:"pinned-section"},A2={class:"thread-list"},R2=["data-menu-open"],M2={class:"thread-left-stack"},P2=["data-state"],$2=["onClick"],N2=["onClick"],L2={class:"thread-row-title-wrap"},D2={class:"thread-row-title-line"},O2={class:"thread-row-title"},F2=["data-state"],j2={class:"thread-row-time"},B2=["onClick"],U2=["aria-expanded"],H2=["data-active"],q2={key:0},W2=["data-active"],V2={key:0},z2={key:1,class:"thread-tree-no-results"},G2={key:2,class:"thread-tree-loading"},K2={key:3,class:"thread-list thread-list-global"},Y2=["data-menu-open"],J2={class:"thread-left-stack"},X2=["data-state"],Q2=["onClick"],Z2=["onClick"],eN={class:"thread-row-title-wrap"},tN={class:"thread-row-title-line"},nN={class:"thread-row-title"},rN=["data-state"],oN={class:"thread-row-time"},sN=["onClick"],iN=["data-project-name","data-expanded","data-dragging"],aN={class:"project-icon-stack"},lN={class:"project-icon-folder"},cN={class:"project-icon-chevron"},uN=["data-dragging-handle","onMousedown"],dN={class:"project-title"},fN={class:"project-hover-controls"},pN=["onClick"],hN=["data-open-direction"],mN=["onClick"],gN=["onClick"],vN=["onInput"],_N=["aria-label","title","onClick"],yN={key:0,class:"thread-list"},bN=["data-menu-open"],wN={class:"thread-left-stack"},SN=["data-state"],TN=["onClick"],EN=["onClick"],kN={class:"thread-row-title-wrap"},CN={class:"thread-row-title-line"},xN={class:"thread-row-title"},IN=["data-state"],AN={class:"thread-row-time"},RN=["onClick"],MN=["onClick"],PN=["data-open-direction"],$N={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},NN=["onKeydown"],LN={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},DN={class:"rename-thread-subtitle"},ON=4,tv=6,nv="codex-web-local.thread-view-mode.v1",rv="codex-web-local.collapsed-projects.v1",FN=Pn({__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=j({}),s=j({});let i=!1;const a=j([]),l=j(""),c=j(""),u=j({}),d=j({}),h=j({}),g=j("actions"),w=j(""),E=j(!1),D=j(""),C=j(""),I=j(null),V=j(!1),z=j(""),ce=j(""),re=j(null),Z=j(null),de=j(null);let _e=null,Te=null;const fe=j(""),H=j({}),ee=new Map,Se=new Map,Ne=new Map,ye=new WeakMap,Re=j(null),ue=j(null),Me=j(!1),Pe=j(Ye()),ke=typeof window<"u"?new ResizeObserver(T=>{for(const R of T){const L=R.target,K=ye.get(L);K&&rr(K,L)}}):null;function We(){if(typeof window>"u")return{};try{const T=window.localStorage.getItem(rv);if(!T)return{};const R=JSON.parse(T);return!R||typeof R!="object"||Array.isArray(R)?{}:R}catch{return{}}}function Ye(){return typeof window>"u"?"project":window.localStorage.getItem(nv)==="chronological"?"chronological":"project"}s.value=We(),ct(s,T=>{typeof window>"u"||window.localStorage.setItem(rv,JSON.stringify(T))},{deep:!0}),ct(Pe,T=>{typeof window>"u"||window.localStorage.setItem(nv,T)});const Je=le(()=>n.searchQuery.trim().toLowerCase()),st=le(()=>Je.value.length>0),Ke=le(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null),Q=le(()=>new Set(a.value));function me(T){if(!st.value)return!0;if(Ke.value)return Ke.value.has(T.id);const R=Je.value;return T.title.toLowerCase().includes(R)||T.preview.toLowerCase().includes(R)}const be=le(()=>st.value?n.groups.map(T=>({...T,threads:T.threads.filter(me)})).filter(T=>T.threads.length>0):n.groups),ge=le(()=>Pe.value==="chronological"),Qe=le(()=>{const T=be.value,R=[];for(const L of T)for(const K of L.threads)Q.value.has(K.id)||R.push(K);return R.sort((L,K)=>{const S=new Date(L.updatedAtIso||L.createdAtIso).getTime();return new Date(K.updatedAtIso||K.createdAtIso).getTime()-S})}),k=le(()=>{const T=new Map;for(const R of n.groups)for(const L of R.threads)T.set(L.id,L);return T});ct(a,T=>{i&&V$(T)}),ct(k,T=>{const R=a.value.filter(L=>T.has(L));R.length!==a.value.length&&(a.value=R)}),vs(async()=>{const{threadIds:T}=await W$(),R=Array.isArray(T)?T.filter(L=>typeof L=="string").map(L=>L.trim()).filter((L,K,S)=>L.length>0&&S.indexOf(L)===K):[];R.length>0&&(a.value=R),i=!0});const x=le(()=>{const T=new Map;for(const R of n.groups)for(const L of R.threads)T.set(L.id,R.projectName);return T}),q=le(()=>{const T=new Map;for(const R of n.groups){const L=R.threads.filter(K=>!Q.value.has(K.id));T.set(R.projectName,L)}return T}),G=le(()=>{const T=new Map;for(const R of n.groups)for(const L of R.threads){const K=new Date(L.updatedAtIso||L.createdAtIso).getTime();T.set(L.id,K)}return T}),Y=le(()=>{const T=c.value;return T?k.value.get(T)??null:null}),te=le(()=>a.value.map(T=>k.value.get(T)??null).filter(T=>T!==null).filter(me)),oe=le(()=>{const T=de.value;if(!T||T.dropTargetIndexFull===null||n.groups.length===0)return null;const R=Math.max(0,Math.min(T.dropTargetIndexFull,n.groups.length)),L=R>T.fromIndex?R-1:R,K=Math.max(0,Math.min(L,n.groups.length-1));return K===T.fromIndex?null:K}),ie=le(()=>{const R=(st.value?be.value:n.groups).map(X=>X.projectName),L=de.value,K=oe.value;if(!L||K===null)return R;const S=[...R],[P]=S.splice(L.fromIndex,1);return P?(S.splice(K,0,P),S):R}),pe=le(()=>{const T={};let R=0;for(const L of ie.value)T[L]=R,R+=Ut(L);return T}),se=le(()=>{let T=0;for(const R of ie.value)T+=Ut(R);return{height:`${Math.max(0,T)}px`}});function Ue(T){if(Number.isNaN(T))return"n/a";const R=Math.abs(Date.now()-T);if(R<6e4)return"now";const L=Math.floor(R/6e4);if(L<60)return`${L}m`;const K=Math.floor(L/60);return K<24?`${K}h`:`${Math.floor(K/24)}d`}function $e(T){const R=G.value.get(T.id);return Ue(typeof R=="number"?R:new Date(T.updatedAtIso||T.createdAtIso).getTime())}function Ee(T){return Q.value.has(T)}function De(T){if(Ee(T)){a.value=a.value.filter(R=>R!==T);return}a.value=[T,...a.value]}function M(T){r("select",T)}function N(T){r("export-thread",T),tt()}function F(T){r("fork-thread",T),tt()}function ne(T){return`start new thread ${zt(T)}`}function he(T){r("start-new-thread",T)}function je(T){r("browse-thread-files",T),tt()}function Oe(T,R){if(c.value===T){if(R){const L=R.relatedTarget,K=ue.value;if(L instanceof Node&&K&&K.contains(L))return}tt()}}function ot(T){return c.value===T}function tt(){c.value="",h.value={}}function Tt(T){if(c.value===T){tt();return}Gt(),Me.value=!1,c.value=T,tn(()=>{fn(T)})}function Pt(T,R){T.preventDefault(),c.value=R}function ut(T,R){D.value=T,C.value=R,E.value=!0,tt(),tn(()=>{var L,K;(L=I.value)==null||L.focus(),(K=I.value)==null||K.select()})}function rn(){E.value=!1,D.value="",C.value=""}function bn(){const T=D.value,R=C.value.trim();!T||!R||(r("rename-thread",{threadId:T,title:R}),rn())}function fr(T,R){z.value=T,ce.value=R,V.value=!0,tt()}function nr(){V.value=!1,z.value="",ce.value=""}function wr(){const T=z.value;T&&(a.value=a.value.filter(R=>R!==T),r("archive",T),nr())}function zt(T){return n.projectDisplayNameById[T]??T}function on(T){return l.value===T}function Gt(){l.value="",g.value="actions",w.value=""}function Sr(){const T=!Me.value;T&&(Gt(),tt()),Me.value=T}function Kt(T){Pe.value=T,Me.value=!1}function no(T){if(l.value===T){Gt();return}tt(),Me.value=!1,l.value=T,g.value="actions",w.value=zt(T),tn(()=>{ft(T)})}function qn(T){tt(),l.value=T,g.value="rename",w.value=zt(T),tn(()=>{ft(T)})}function Tr(T){r("rename-project",{projectName:T,displayName:w.value})}function Fr(T){r("remove-project",T),Gt()}function wo(T,R){if(!T.altKey||T.key!=="ArrowUp"&&T.key!=="ArrowDown")return;const L=n.groups.findIndex(P=>P.projectName===R);if(L<0)return;const K=T.key==="ArrowUp"?-1:1,S=Math.max(0,Math.min(L+K,n.groups.length-1));S!==L&&(T.preventDefault(),r("reorder-project",{projectName:R,toIndex:S}))}function Wn(T){return o.value[T]===!0}function sn(T){return s.value[T]===!0}function jr(T){o.value={...o.value,[T]:!Wn(T)}}function $n(T){if(fe.value===T){fe.value="";return}s.value={...s.value,[T]:!sn(T)}}function Ut(T){const R=H.value[T]??0,L=de.value,S=((L==null?void 0:L.projectName)===T?L.groupHeight:null)??R,P=sn(T)?0:tv;return Math.max(0,S+P)}function pr(T,R){const L=R instanceof HTMLElement?R:R&&"$el"in R&&R.$el instanceof HTMLElement?R.$el:null;if(L){Se.set(T,L);return}Se.delete(T)}function Br(T,R){const L=R instanceof HTMLElement?R:R&&"$el"in R&&R.$el instanceof HTMLElement?R.$el:null;if(L){Ne.set(T,L);return}Ne.delete(T)}function wn(T){let R=T.parentElement;for(;R;){const L=window.getComputedStyle(R),K=L.overflowY||L.overflow;if(K==="auto"||K==="scroll"||K==="hidden"||K==="clip")return R.getBoundingClientRect();R=R.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Yt(T,R){const L=T.getBoundingClientRect(),K=wn(T),S=6,P=K.bottom-L.bottom,X=L.top-K.top;return P>=R+S?"down":X>P?"up":"down"}function $t(T,R){const L=Ne.get(T);if(!L)return"down";const K=Yt(L,R);return d.value={...d.value,[T]:K},K}function Sn(T){return d.value[T]??"down"}function ft(T){const R=Se.get(T);R&&(u.value={...u.value,[T]:Yt(R,112)})}function _t(T,R,L){return Math.min(Math.max(T,R),L)}function fn(T){const R=Ne.get(T);if(!R)return;const L=ue.value,K=L==null?void 0:L.getBoundingClientRect(),S=(K==null?void 0:K.height)||(L==null?void 0:L.offsetHeight)||112,P=(K==null?void 0:K.width)||(L==null?void 0:L.offsetWidth)||160,X=$t(T,S),Ae=R.getBoundingClientRect(),it=8,qt=4,Xt=Math.max(it,window.innerWidth-P-it),Nt=_t(Ae.right-P,it,Xt),Cn=_t(X==="up"?Ae.top-S-qt:Ae.bottom+qt,it,Math.max(it,window.innerHeight-S-it));h.value={left:`${Math.round(Nt)}px`,top:`${Math.round(Cn)}px`}}function Vn(){const T=c.value;T&&fn(T)}function hr(){window.addEventListener("resize",Vn),document.addEventListener("scroll",Vn,!0)}function zn(){window.removeEventListener("resize",Vn),document.removeEventListener("scroll",Vn,!0)}function Nn(T){const R=l.value;if(!R)return!1;const L=Se.get(R);if(!L)return!1;if((typeof T.composedPath=="function"?T.composedPath():[]).includes(L))return!0;const S=T.target;return S instanceof Node?L.contains(S):!1}function pn(T){const R=c.value;if(!R)return!1;const L=Ne.get(R);if(!L)return!1;const K=typeof T.composedPath=="function"?T.composedPath():[];if(K.includes(L))return!0;const S=ue.value;if(S&&K.includes(S))return!0;const P=T.target;return P instanceof Node?!!(L.contains(P)||S&&S.contains(P)):!1}function Gn(T){if(Me.value){const R=Re.value,L=typeof T.composedPath=="function"?T.composedPath():[];!!R&&(L.includes(R)||T.target instanceof Node&&R.contains(T.target))||(Me.value=!1)}l.value&&(Nn(T)||Gt(),c.value&&(pn(T)||tt()))}function mr(T){l.value&&!Nn(T)&&Gt(),c.value&&!pn(T)&&tt()}function Ur(){Me.value&&(Me.value=!1),l.value&&Gt(),c.value&&tt()}function Kn(){window.addEventListener("pointerdown",Gn,{capture:!0}),window.addEventListener("focusin",mr,{capture:!0}),window.addEventListener("blur",Ur)}function An(){window.removeEventListener("pointerdown",Gn,{capture:!0}),window.removeEventListener("focusin",mr,{capture:!0}),window.removeEventListener("blur",Ur)}function rr(T,R){const L=R.getBoundingClientRect().height;if(!Number.isFinite(L)||L<=0)return;const K=H.value[T];K!==void 0&&Math.abs(K-L)<.5||(H.value={...H.value,[T]:L})}function Tn(T,R){const L=ee.get(T);L&&L!==R&&ke&&ke.unobserve(L);const K=R instanceof HTMLElement?R:R&&"$el"in R&&R.$el instanceof HTMLElement?R.$el:null;if(K){ee.set(T,K),ye.set(K,T),rr(T,K),ke==null||ke.observe(K);return}L&&(ke==null||ke.unobserve(L)),ee.delete(T)}function En(T,R){if(T.button!==0||Z.value||de.value)return;const L=n.groups.findIndex(X=>X.projectName===R),K=ee.get(R);if(L<0||!K)return;const S=K.getBoundingClientRect(),P=sn(R)?0:tv;Z.value={projectName:R,fromIndex:L,startClientX:T.clientX,startClientY:T.clientY,pointerOffsetY:T.clientY-S.top,groupLeft:S.left,groupWidth:S.width,groupHeight:S.height,groupOuterHeight:S.height+P},T.preventDefault(),Ln()}function Ln(){window.addEventListener("mousemove",Er),window.addEventListener("mouseup",ro),window.addEventListener("keydown",Lt)}function kn(){window.removeEventListener("mousemove",Er),window.removeEventListener("mouseup",ro),window.removeEventListener("keydown",Lt)}function Er(T){_e={clientX:T.clientX,clientY:T.clientY},Yn()}function ro(T){He({clientX:T.clientX,clientY:T.clientY});const R=de.value;if(R&&oe.value!==null){const L=n.groups.findIndex(K=>K.projectName===R.projectName);if(L>=0){const K=oe.value;K!==L&&r("reorder-project",{projectName:R.projectName,toIndex:K})}}un()}function Lt(T){T.key==="Escape"&&(!Z.value&&!de.value||(T.preventDefault(),un()))}function un(){Te!==null&&(window.cancelAnimationFrame(Te),Te=null),_e=null,Z.value=null,de.value=null,fe.value="",kn()}function Yn(){Te===null&&(Te=window.requestAnimationFrame(()=>{if(Te=null,!_e)return;const T=_e;_e=null,He(T)}))}function He(T){const R=Z.value;if(!de.value&&R){const L=T.clientX-R.startClientX,K=T.clientY-R.startClientY;if(Math.hypot(L,K)<ON)return;Gt(),fe.value=R.projectName,de.value={projectName:R.projectName,fromIndex:R.fromIndex,pointerOffsetY:R.pointerOffsetY,groupLeft:R.groupLeft,groupWidth:R.groupWidth,groupHeight:R.groupHeight,groupOuterHeight:R.groupOuterHeight,ghostTop:T.clientY-R.pointerOffsetY,dropTargetIndexFull:null}}de.value&&xe(T)}function xe(T){const R=de.value;if(!R)return;if(R.ghostTop=T.clientY-R.pointerOffsetY,!Et(T)){R.dropTargetIndexFull=null;return}const L=T.clientY,K=re.value;if(!K){R.dropTargetIndexFull=null;return}const S=K.getBoundingClientRect(),P=new Map(n.groups.map((qt,Xt)=>[qt.projectName,Xt])),X=n.groups.map(qt=>qt.projectName).filter(qt=>qt!==R.projectName);let Ae=0,it=n.groups.length;for(const qt of X){const Xt=P.get(qt);if(Xt===void 0)continue;const Nt=Ut(qt),Cn=S.top+Ae+Nt/2;if(L<Cn){it=Xt;break}Ae+=Nt}R.dropTargetIndexFull=it}function Et(T){const R=re.value;if(!R)return!1;const L=R.getBoundingClientRect(),K=T.clientX>=L.left&&T.clientX<=L.right,S=T.clientY>=L.top-32&&T.clientY<=L.bottom+32;return K&&S}function Hr(T){var R;return((R=de.value)==null?void 0:R.projectName)===T}function qr(T){const R=de.value,L=pe.value[T]??0,K=c.value?x.value.get(c.value)??"":"",S=l.value===T||K===T;return!R||R.projectName!==T?{position:"absolute",top:"0",left:"0",right:"0",zIndex:S?"40":"1",transform:`translate3d(0, ${L}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${R.groupLeft}px`,width:`${R.groupWidth}px`,height:`${R.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${R.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function or(T){return q.value.get(T.projectName)??[]}function sr(T){if(st.value)return or(T);if(sn(T.projectName))return[];const R=or(T);return Wn(T.projectName)?R:R.slice(0,10)}function oo(T){return st.value?!1:!sn(T.projectName)&&or(T).length>10}function kr(T){return or(T).length>0}function Dn(T){return!!T.pendingRequestState||T.inProgress||T.unread}function Vt(T){return T.pendingRequestState==="approval"?"Awaiting approval":"Awaiting response"}function Jt(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 S,P;const R=((S=de.value)==null?void 0:S.projectName)??((P=Z.value)==null?void 0:P.projectName)??"";R&&!n.groups.some(X=>X.projectName===R)&&un();const L=new Set(T),K=Object.fromEntries(Object.entries(H.value).filter(([X])=>L.has(X)));Object.keys(K).length!==Object.keys(H.value).length&&(H.value=K)});const Cr=le(()=>Me.value||l.value!==""||c.value!=="");return ct(Cr,T=>{if(T){Kn();return}An()}),ct(c,T=>{if(!T){zn();return}hr(),tn(()=>{fn(T)})}),Xs(()=>{for(const T of ee.values())ke==null||ke.unobserve(T);ee.clear(),Se.clear(),zn(),An(),un()}),(T,R)=>(A(),O("section",x2,[te.value.length>0?(A(),O("section",I2,[_("ul",A2,[(A(!0),O(et,null,Wt(te.value,L=>(A(),O("li",{key:L.id,class:"thread-row-item","data-menu-open":ot(L.id)?"true":"false"},[Ge($s,{class:"thread-row","data-active":L.id===e.selectedThreadId,"data-pinned":Ee(L.id),"data-menu-open":ot(L.id)?"true":"false","force-right-hover":ot(L.id),onMouseleave:K=>Oe(L.id,K),onContextmenu:K=>Pt(K,L.id)},{left:It(()=>[_("span",M2,[Dn(L)?(A(),O("span",{key:0,class:"thread-status-indicator","data-state":Jt(L)},null,8,P2)):Ce("",!0),_("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:K=>De(L.id)},[Ge(Hd,{class:"thread-icon"})],8,$2)])]),right:It(()=>[_("span",j2,we($e(L)),1)]),"right-hover":It(()=>[_("div",{ref_for:!0,ref:K=>Br(L.id,K),class:"thread-menu-wrap"},[_("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:wt(K=>Tt(L.id),["stop"])},[Ge(fa,{class:"thread-icon"})],8,B2)],512)]),default:It(()=>[_("button",{class:"thread-main-button",type:"button",onClick:K=>M(L.id)},[_("span",L2,[_("span",D2,[_("span",O2,we(L.title),1),L.hasWorktree?(A(),bt(vc,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):Ce("",!0),L.pendingRequestState?(A(),O("span",{key:1,class:"thread-row-request-chip","data-state":L.pendingRequestState},we(Vt(L)),9,F2)):Ce("",!0)])])],8,N2)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,R2))),128))])])):Ce("",!0),Ge($s,{as:"header",class:"thread-tree-header-row"},{right:It(()=>[_("div",{ref_key:"organizeMenuWrapRef",ref:Re,class:"organize-menu-wrap"},[_("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Me.value,"aria-label":"Organize threads",title:"Organize threads",onClick:Sr},[Ge(fa,{class:"thread-icon"})],8,U2),Me.value?(A(),O("div",{key:0,class:"organize-menu-panel",onClick:R[2]||(R[2]=wt(()=>{},["stop"]))},[R[14]||(R[14]=_("p",{class:"organize-menu-title"},"Organize",-1)),_("button",{class:"organize-menu-item","data-active":Pe.value==="project",type:"button",onClick:R[0]||(R[0]=L=>Kt("project"))},[R[12]||(R[12]=_("span",null,"By project",-1)),Pe.value==="project"?(A(),O("span",q2,"✓")):Ce("",!0)],8,H2),_("button",{class:"organize-menu-item","data-active":Pe.value==="chronological",type:"button",onClick:R[1]||(R[1]=L=>Kt("chronological"))},[R[13]||(R[13]=_("span",null,"Chronological list",-1)),Pe.value==="chronological"?(A(),O("span",V2,"✓")):Ce("",!0)],8,W2)])):Ce("",!0)],512)]),default:It(()=>[R[15]||(R[15]=_("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),st.value&&be.value.length===0?(A(),O("p",z2,"No matching threads")):e.isLoading&&e.groups.length===0?(A(),O("p",G2,"Loading threads...")):ge.value?(A(),O("ul",K2,[(A(!0),O(et,null,Wt(Qe.value,L=>(A(),O("li",{key:L.id,class:"thread-row-item","data-menu-open":ot(L.id)?"true":"false"},[Ge($s,{class:"thread-row","data-active":L.id===e.selectedThreadId,"data-pinned":Ee(L.id),"data-menu-open":ot(L.id)?"true":"false","force-right-hover":ot(L.id),onMouseleave:K=>Oe(L.id,K),onContextmenu:K=>Pt(K,L.id)},{left:It(()=>[_("span",J2,[Dn(L)?(A(),O("span",{key:0,class:"thread-status-indicator","data-state":Jt(L)},null,8,X2)):Ce("",!0),_("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:K=>De(L.id)},[Ge(Hd,{class:"thread-icon"})],8,Q2)])]),right:It(()=>[_("span",oN,we($e(L)),1)]),"right-hover":It(()=>[_("div",{ref_for:!0,ref:K=>Br(L.id,K),class:"thread-menu-wrap"},[_("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:wt(K=>Tt(L.id),["stop"])},[Ge(fa,{class:"thread-icon"})],8,sN)],512)]),default:It(()=>[_("button",{class:"thread-main-button",type:"button",onClick:K=>M(L.id)},[_("span",eN,[_("span",tN,[_("span",nN,we(L.title),1),L.hasWorktree?(A(),bt(vc,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):Ce("",!0),L.pendingRequestState?(A(),O("span",{key:1,class:"thread-row-request-chip","data-state":L.pendingRequestState},we(Vt(L)),9,rN)):Ce("",!0)])])],8,Z2)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,Y2))),128))])):(A(),O("div",{key:4,ref_key:"groupsContainerRef",ref:re,class:"thread-tree-groups",style:Po(se.value)},[(A(!0),O(et,null,Wt(be.value,L=>(A(),O("article",{key:L.projectName,ref_for:!0,ref:K=>Tn(L.projectName,K),class:"project-group","data-project-name":L.projectName,"data-expanded":!sn(L.projectName),"data-dragging":Hr(L.projectName),style:Po(qr(L.projectName))},[Ge($s,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:K=>$n(L.projectName),onKeydown:[K=>wo(K,L.projectName),xn(wt(K=>$n(L.projectName),["prevent"]),["enter"]),xn(wt(K=>$n(L.projectName),["prevent"]),["space"])]},{left:It(()=>[_("span",aN,[_("span",lN,[sn(L.projectName)?(A(),bt(Zp,{key:0,class:"thread-icon"})):(A(),bt(h2,{key:1,class:"thread-icon"}))]),_("span",cN,[sn(L.projectName)?(A(),bt(t2,{key:0,class:"thread-icon"})):(A(),bt(Qp,{key:1,class:"thread-icon"}))])])]),right:It(()=>[_("div",fN,[_("div",{ref_for:!0,ref:K=>pr(L.projectName,K),class:"project-menu-wrap"},[_("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:wt(K=>no(L.projectName),["stop"])},[Ge(fa,{class:"thread-icon"})],8,pN),on(L.projectName)?(A(),O("div",{key:0,class:"project-menu-panel","data-open-direction":u.value[L.projectName]??"down",onClick:R[4]||(R[4]=wt(()=>{},["stop"]))},[g.value==="actions"?(A(),O(et,{key:0},[_("button",{class:"project-menu-item",type:"button",onClick:K=>qn(L.projectName)}," Edit name ",8,mN),_("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:K=>Fr(L.projectName)}," Remove ",8,gN)],64)):(A(),O(et,{key:1},[R[16]||(R[16]=_("label",{class:"project-menu-label"},"Project name",-1)),Kr(_("input",{"onUpdate:modelValue":R[3]||(R[3]=K=>w.value=K),class:"project-menu-input",type:"text",onInput:K=>Tr(L.projectName)},null,40,vN),[[yo,w.value]])],64))],8,hN)):Ce("",!0)],512),_("button",{class:"thread-start-button",type:"button","aria-label":ne(L.projectName),title:ne(L.projectName),onClick:wt(K=>he(L.projectName),["stop"])},[Ge(Oc,{class:"thread-icon"})],8,_N)])]),default:It(()=>[_("span",{class:"project-main-button","data-dragging-handle":Hr(L.projectName),onMousedown:wt(K=>En(K,L.projectName),["left"])},[_("span",dN,we(zt(L.projectName)),1)],40,uN)]),_:2},1032,["onClick","onKeydown"]),kr(L)?(A(),O("ul",yN,[(A(!0),O(et,null,Wt(sr(L),K=>(A(),O("li",{key:K.id,class:"thread-row-item","data-menu-open":ot(K.id)?"true":"false"},[Ge($s,{class:"thread-row","data-active":K.id===e.selectedThreadId,"data-pinned":Ee(K.id),"data-menu-open":ot(K.id)?"true":"false","force-right-hover":ot(K.id),onMouseleave:S=>Oe(K.id,S),onContextmenu:S=>Pt(S,K.id)},{left:It(()=>[_("span",wN,[Dn(K)?(A(),O("span",{key:0,class:"thread-status-indicator","data-state":Jt(K)},null,8,SN)):Ce("",!0),_("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:S=>De(K.id)},[Ge(Hd,{class:"thread-icon"})],8,TN)])]),right:It(()=>[_("span",AN,we($e(K)),1)]),"right-hover":It(()=>[_("div",{ref_for:!0,ref:S=>Br(K.id,S),class:"thread-menu-wrap"},[_("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:wt(S=>Tt(K.id),["stop"])},[Ge(fa,{class:"thread-icon"})],8,RN)],512)]),default:It(()=>[_("button",{class:"thread-main-button",type:"button",onClick:S=>M(K.id)},[_("span",kN,[_("span",CN,[_("span",xN,we(K.title),1),K.hasWorktree?(A(),bt(vc,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):Ce("",!0),K.pendingRequestState?(A(),O("span",{key:1,class:"thread-row-request-chip","data-state":K.pendingRequestState},we(Vt(K)),9,IN)):Ce("",!0)])])],8,EN)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,bN))),128))])):(A(),bt($s,{key:1,as:"p",class:"project-empty-row"},{left:It(()=>[...R[17]||(R[17]=[_("span",{class:"project-empty-spacer"},null,-1)])]),default:It(()=>[R[18]||(R[18]=_("span",{class:"project-empty"},"No threads",-1))]),_:1})),oo(L)?(A(),bt($s,{key:2,class:"thread-show-more-row"},{left:It(()=>[...R[19]||(R[19]=[_("span",{class:"thread-show-more-spacer"},null,-1)])]),default:It(()=>[_("button",{class:"thread-show-more-button",type:"button",onClick:K=>jr(L.projectName)},we(Wn(L.projectName)?"Show less":"Show more"),9,MN)]),_:2},1024)):Ce("",!0)],12,iN))),128))],4)),(A(),bt(Zl,{to:"body"},[Y.value?(A(),O("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:ue,class:"thread-menu-panel thread-menu-panel-fixed",style:Po(h.value),"data-open-direction":Sn(Y.value.id),onClick:R[10]||(R[10]=wt(()=>{},["stop"]))},[_("button",{class:"thread-menu-item",type:"button",onClick:R[5]||(R[5]=L=>je(Y.value.id))}," Browse files "),_("button",{class:"thread-menu-item",type:"button",onClick:R[6]||(R[6]=L=>N(Y.value.id))}," Export chat "),_("button",{class:"thread-menu-item",type:"button",onClick:R[7]||(R[7]=L=>F(Y.value.id))}," Create chat fork "),_("button",{class:"thread-menu-item",type:"button",onClick:R[8]||(R[8]=L=>ut(Y.value.id,Y.value.title))}," Rename thread "),_("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:R[9]||(R[9]=L=>fr(Y.value.id,Y.value.title))}," Delete thread ")],12,PN)):Ce("",!0)])),(A(),bt(Zl,{to:"body"},[E.value?(A(),O("div",{key:0,class:"rename-thread-overlay",onClick:wt(rn,["self"])},[_("div",$N,[R[20]||(R[20]=_("h3",{class:"rename-thread-title"},"Rename thread",-1)),R[21]||(R[21]=_("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Kr(_("input",{ref_key:"renameThreadInputRef",ref:I,"onUpdate:modelValue":R[11]||(R[11]=L=>C.value=L),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[xn(wt(bn,["prevent"]),["enter"]),xn(wt(rn,["prevent"]),["esc"])]},null,40,NN),[[yo,C.value]]),_("div",{class:"rename-thread-actions"},[_("button",{class:"rename-thread-button",type:"button",onClick:rn},"Cancel"),_("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:bn},"Save")])])])):Ce("",!0)])),(A(),bt(Zl,{to:"body"},[V.value?(A(),O("div",{key:0,class:"rename-thread-overlay",onClick:wt(nr,["self"])},[_("div",LN,[R[22]||(R[22]=_("h3",{class:"rename-thread-title"},"Delete thread?",-1)),_("p",DN,' This will archive the thread "'+we(ce.value)+'". You can find it later in archived threads. ',1),_("div",{class:"rename-thread-actions"},[_("button",{class:"rename-thread-button",type:"button",onClick:nr},"Cancel"),_("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:wr},"Delete")])])])):Ce("",!0)]))]))}}),jN=xt(FN,[["__scopeId","data-v-5a4523d9"]]),BN={class:"content-header"},UN={class:"content-leading"},HN={class:"content-title"},qN={class:"content-actions"},WN=Pn({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(A(),O("header",BN,[_("div",UN,[vo(t.$slots,"leading",{},void 0)]),_("h1",HN,we(e.title),1),_("div",qN,[vo(t.$slots,"actions",{},void 0)])]))}}),VN=xt(WN,[["__scopeId","data-v-66ee223c"]]),ov=.0025,qd=3,sv=2,zN=256;function GN(e){var fe;const t=j("idle"),n=j(typeof navigator<"u"&&!!((fe=navigator.mediaDevices)!=null&&fe.getUserMedia)),r=j(0),o=j(null);let s=null,i=null,a=[],l=null,c=null,u=null,d=null,h=[],g=!1,w=!1,E=null;function D(){E&&(E.abort(),E=null),t.value==="transcribing"&&(t.value="idle")}function C(){const H=o.value;if(!H||typeof window>"u")return;const ee=H.getContext("2d");if(!ee)return;const Se=Math.max(1,Math.floor(H.clientWidth)),Ne=Math.max(1,Math.floor(H.clientHeight||36)),ye=window.devicePixelRatio||1,Re=Math.max(1,Math.floor(Se*ye)),ue=Math.max(1,Math.floor(Ne*ye));(H.width!==Re||H.height!==ue)&&(H.width=Re,H.height=ue),ee.setTransform(ye,0,0,ye,0,0),ee.clearRect(0,0,Se,Ne);const Me=Math.max(12,Math.floor(Se/(qd+sv))),Pe=h.slice(-Me),ke=Math.max(0,Me-Pe.length),We=Ne/2,Ye=getComputedStyle(H).color||"#000000";for(let Je=0;Je<Me;Je+=1){const st=Pe[Je-ke]??0,Q=Math.max(.08,Math.min(1,st*18))*We,me=Je*(qd+sv);ee.globalAlpha=st<=ov?.35:1,ee.fillStyle=Ye,ee.fillRect(me,We-Q,qd,Q*2)}ee.globalAlpha=1}function I(){h=[],r.value=0,C()}function V(){u&&(u.disconnect(),u.onaudioprocess=null,u=null),c&&(c.disconnect(),c=null),l&&(l.close(),l=null),d=null}function z(H){if(typeof window>"u")return;const ee=window.webkitAudioContext,Se=window.AudioContext??ee;Se&&(V(),I(),l=new Se,c=l.createMediaStreamSource(H),u=l.createScriptProcessor(2048,1,1),d=performance.now(),u.onaudioprocess=Ne=>{const ye=Ne.inputBuffer.getChannelData(0);let Re=0;for(let ue=0;ue<ye.length;ue+=1){const Me=Math.abs(ye[ue]??0);Re+=Me<ov?0:Me}h.push(Re/ye.length),h.length>zN&&h.shift(),d!==null&&(r.value=Math.max(0,performance.now()-d)),C()},c.connect(u),u.connect(l.destination),C())}async function ce(){var H;if(t.value==="transcribing"&&D(),!(t.value!=="idle"||!n.value||g)){g=!0,w=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],s=new MediaRecorder(i),s.ondataavailable=ee=>{ee.data.size>0&&a.push(ee.data)},s.onstop=()=>{var Ne;const ee=a,Se=(s==null?void 0:s.mimeType)||((Ne=ee[0])==null?void 0:Ne.type)||"audio/webm";_e(),de(ee,Se)},z(i),s.start(250),t.value="recording",w&&re()}catch(ee){_e(),t.value="idle",(H=e.onError)==null||H.call(e,ee)}finally{g=!1}}}function re(){if(g&&t.value==="idle"){w=!0;return}if(!(t.value!=="recording"||!s)&&s.state!=="inactive"){t.value="transcribing";try{s.requestData()}catch{}s.stop()}}function Z(){w=!1,D(),_e(),t.value="idle"}async function de(H,ee){var ye,Re,ue,Me,Pe;if(H.length===0){(ye=e.onEmpty)==null||ye.call(e),t.value="idle";return}const Se=new Blob(H,{type:ee});t.value="transcribing";let Ne=null;try{const ke=ee.split(/[/;]/)[1]??"webm",We=new FormData;We.append("file",Se,`codex.${ke}`);const Ye=((Re=e.getLanguage)==null?void 0:Re.call(e).trim())??"";Ye&&Ye.toLowerCase()!=="auto"&&We.append("language",Ye),Ne=new AbortController,E=Ne;const Je=await fetch("/codex-api/transcribe",{method:"POST",body:We,signal:Ne.signal}),st=await Je.text();let Ke=null;try{Ke=st.trim()?JSON.parse(st):null}catch{Ke=null}if(!Je.ok){const me=(ue=Ke==null?void 0:Ke.error)==null?void 0:ue.trim(),be=st.trim();throw new Error(me||be||`Transcription failed: ${Je.status}`)}const Q=((Ke==null?void 0:Ke.text)??"").trim();Q.length>0?e.onTranscript(Q):(Me=e.onEmpty)==null||Me.call(e)}catch(ke){if(ke instanceof DOMException&&ke.name==="AbortError")return;(Pe=e.onError)==null||Pe.call(e,ke)}finally{Ne&&E===Ne&&(E=null),t.value==="transcribing"&&(t.value="idle")}}function _e(){V(),I(),s&&(s.ondataavailable=null,s.onstop=null,s=null),i&&(i.getTracks().forEach(H=>H.stop()),i=null),a=[]}Xs(()=>{Z()});function Te(){if(t.value==="recording"){re();return}(t.value==="idle"||t.value==="transcribing")&&ce()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:o,startRecording:ce,stopRecording:re,toggleRecording:Te,cancel:Z}}const KN={},YN={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function JN(e,t){return A(),O("svg",YN,[...t[0]||(t[0]=[_("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 XN=xt(KN,[["render",JN]]),QN={},ZN={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function eL(e,t){return A(),O("svg",ZN,[...t[0]||(t[0]=[_("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 tL=xt(QN,[["render",eL]]),nL={},rL={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function oL(e,t){return A(),O("svg",rL,[...t[0]||(t[0]=[_("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 sL=xt(nL,[["render",oL]]),iL={},aL={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function lL(e,t){return A(),O("svg",aL,[...t[0]||(t[0]=[_("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),_("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 iv=xt(iL,[["render",lL]]),cL=["disabled"],uL={class:"composer-dropdown-value"},dL={class:"composer-dropdown-menu"},fL={key:0,class:"composer-dropdown-search-wrap"},pL=["placeholder","onKeydown"],hL={class:"composer-dropdown-options",role:"listbox"},mL=["onClick"],gL={key:0,class:"composer-dropdown-empty"},vL={key:1,class:"composer-dropdown-add-wrap"},_L=["placeholder","onKeydown"],yL=Pn({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},addActionMode:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add","add-action"],setup(e,{emit:t}){const n=e,r=t,o=j(null),s=j(null),i=j(null),a=j(!1),l=j(""),c=j(!1),u=j(""),d=le(()=>{var H;const fe=n.options.find(ee=>ee.value===n.modelValue);return fe?fe.label:((H=n.placeholder)==null?void 0:H.trim())||""}),h=le(()=>n.openDirection??"down"),g=le(()=>n.enableSearch===!0),w=le(()=>n.showAddAction===!0),E=le(()=>{var fe;return((fe=n.searchPlaceholder)==null?void 0:fe.trim())||"Quick search projects"}),D=le(()=>{var fe;return((fe=n.addActionLabel)==null?void 0:fe.trim())||"Add new project"}),C=le(()=>n.addActionMode??"inline"),I=le(()=>{var fe;return((fe=n.addPlaceholder)==null?void 0:fe.trim())||"Project name or absolute path"}),V=le(()=>{const fe=l.value.trim().toLowerCase();return fe?n.options.filter(H=>H.label.toLowerCase().includes(fe)||H.value.toLowerCase().includes(fe)):n.options});function z(){n.disabled||(a.value=!a.value)}function ce(fe){r("update:modelValue",fe),a.value=!1,l.value=""}function re(){var fe;if(C.value==="event"){r("add-action"),a.value=!1,l.value="";return}c.value=!0,u.value=((fe=n.defaultAddValue)==null?void 0:fe.trim())||"",tn(()=>{var H;return(H=i.value)==null?void 0:H.focus()})}function Z(){if(l.value.length>0){l.value="";return}a.value=!1}function de(){const fe=u.value.trim();fe&&(r("add",fe),c.value=!1,u.value="",a.value=!1,l.value="")}function _e(){c.value=!1,u.value="",a.value=!1,l.value=""}function Te(fe){if(!a.value)return;const H=o.value;if(!H)return;const ee=fe.target;ee instanceof Node&&(H.contains(ee)||(a.value=!1,l.value="",c.value=!1,u.value=""))}return ct(a,fe=>{if(!fe){c.value=!1,u.value="";return}g.value&&tn(()=>{var H;return(H=s.value)==null?void 0:H.focus()})}),vs(()=>{window.addEventListener("pointerdown",Te)}),Xs(()=>{window.removeEventListener("pointerdown",Te)}),(fe,H)=>(A(),O("div",{ref_key:"rootRef",ref:o,class:"composer-dropdown"},[_("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:z},[e.selectedPrefixIcon?(A(),bt(up(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):Ce("",!0),_("span",uL,we(d.value),1),Ge(Qp,{class:"composer-dropdown-chevron"})],8,cL),a.value?(A(),O("div",{key:0,class:ht(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":h.value==="up","composer-dropdown-menu-wrap-down":h.value==="down"}])},[_("div",dL,[g.value?(A(),O("div",fL,[Kr(_("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":H[0]||(H[0]=ee=>l.value=ee),class:"composer-dropdown-search-input",type:"text",placeholder:E.value,onKeydown:xn(wt(Z,["prevent"]),["esc"])},null,40,pL),[[yo,l.value]])])):Ce("",!0),_("ul",hL,[(A(!0),O(et,null,Wt(V.value,ee=>(A(),O("li",{key:ee.value},[_("button",{class:ht(["composer-dropdown-option",{"is-selected":ee.value===e.modelValue}]),type:"button",onClick:Se=>ce(ee.value)},we(ee.label),11,mL)]))),128)),V.value.length===0?(A(),O("li",gL," No matching projects ")):Ce("",!0)]),w.value?(A(),O("div",vL,[c.value?(A(),O(et,{key:0},[Kr(_("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":H[1]||(H[1]=ee=>u.value=ee),class:"composer-dropdown-add-input",type:"text",placeholder:I.value,onKeydown:[xn(wt(de,["prevent"]),["enter"]),xn(wt(_e,["prevent"]),["esc"])]},null,40,_L),[[yo,u.value]]),_("div",{class:"composer-dropdown-add-actions"},[_("button",{type:"button",class:"composer-dropdown-add-btn",onClick:de},"Open"),_("button",{type:"button",class:"composer-dropdown-add-btn",onClick:_e},"Cancel")])],64)):(A(),O("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:re},we(D.value),1))])):Ce("",!0)])],2)):Ce("",!0)],512))}}),Bs=xt(yL,[["__scopeId","data-v-ab273eac"]]),bL=["disabled"],wL={class:"search-dropdown-value"},SL={class:"search-dropdown-search-wrap"},TL=["placeholder","onKeydown"],EL={key:0,class:"search-dropdown-list",role:"listbox"},kL=["onClick","onPointerenter"],CL={class:"search-dropdown-option-check"},xL={class:"search-dropdown-option-label"},IL={key:0,class:"search-dropdown-option-desc"},AL={key:1,class:"search-dropdown-empty"},RL=Pn({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,o=j(null),s=j(null),i=j(null),a=j(!1),l=j(""),c=j(0),u=le(()=>n.openDirection??"down"),d=le(()=>new Set(n.selectedValues)),h=le(()=>{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`}),g=le(()=>{const z=l.value.toLowerCase().trim();return z?n.options.filter(ce=>{var re;return ce.label.toLowerCase().includes(z)||(((re=ce.description)==null?void 0:re.toLowerCase().includes(z))??!1)}):n.options});function w(){const z=s.value,ce=o.value;if(!z||!ce||window.innerWidth>=640)return;const re=ce.getBoundingClientRect();u.value==="up"?(z.style.setProperty("bottom",`${window.innerHeight-re.top+8}px`,"important"),z.style.setProperty("top","auto","important")):(z.style.setProperty("top",`${re.bottom+8}px`,"important"),z.style.setProperty("bottom","auto","important"))}function E(){n.disabled||(a.value=!a.value,a.value&&(l.value="",c.value=0,tn(()=>{var z;tn(()=>{w()}),(z=i.value)==null||z.focus()})))}function D(z){r("toggle",z.value,!d.value.has(z.value)),a.value=!1}function C(z){g.value.length!==0&&(c.value=(c.value+z+g.value.length)%g.value.length)}function I(){const z=g.value[c.value];z&&D(z)}function V(z){if(!a.value)return;const ce=o.value;if(!ce)return;const re=z.target;re instanceof Node&&(ce.contains(re)||(a.value=!1))}return ct(l,()=>{c.value=0}),vs(()=>window.addEventListener("pointerdown",V)),Xs(()=>window.removeEventListener("pointerdown",V)),(z,ce)=>(A(),O("div",{ref_key:"rootRef",ref:o,class:"search-dropdown"},[_("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:E},[_("span",wL,we(h.value),1),Ge(Qp,{class:"search-dropdown-chevron"})],8,bL),a.value?(A(),O("div",{key:0,ref_key:"menuRef",ref:s,class:ht(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[_("div",SL,[Kr(_("input",{ref_key:"searchRef",ref:i,"onUpdate:modelValue":ce[0]||(ce[0]=re=>l.value=re),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[ce[1]||(ce[1]=xn(wt(re=>a.value=!1,["prevent"]),["escape"])),xn(wt(I,["prevent"]),["enter"]),ce[2]||(ce[2]=xn(wt(re=>C(1),["prevent"]),["arrow-down"])),ce[3]||(ce[3]=xn(wt(re=>C(-1),["prevent"]),["arrow-up"]))]},null,40,TL),[[yo,l.value]])]),g.value.length>0?(A(),O("ul",EL,[(A(!0),O(et,null,Wt(g.value,(re,Z)=>(A(),O("li",{key:re.value},[_("button",{class:ht(["search-dropdown-option",{"is-selected":d.value.has(re.value),"is-highlighted":Z===c.value}]),type:"button",onClick:de=>D(re),onPointerenter:de=>c.value=Z},[_("span",CL,we(d.value.has(re.value)?"✓":""),1),_("span",xL,we(re.label),1),re.description?(A(),O("span",IL,we(re.description),1)):Ce("",!0)],42,kL)]))),128))])):(A(),O("div",AL,"No results"))],2)):Ce("",!0)],512))}}),ML=xt(RL,[["__scopeId","data-v-3147b20f"]]),PL={class:"skill-picker-header"},$L=["onKeydown"],NL={key:0,class:"skill-picker-list",role:"listbox"},LL=["onClick","onPointerenter"],DL={class:"skill-picker-name"},OL={key:0,class:"skill-picker-desc"},FL={key:1,class:"skill-picker-empty"},jL=Pn({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,o=j(null),s=j(null),i=j(""),a=j(0),l=le(()=>{const h=i.value.toLowerCase().trim();return h?n.skills.filter(g=>g.name.toLowerCase().includes(h)||g.description.toLowerCase().includes(h)):n.skills}),c=le(()=>{const h={};return n.anchorBottom!=null&&(h.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(h.left=`${n.anchorLeft}px`),h});function u(h){l.value.length!==0&&(a.value=(a.value+h+l.value.length)%l.value.length)}function d(){const h=l.value[a.value];h&&r("select",h)}return ct(()=>n.visible,h=>{h&&(i.value="",a.value=0,tn(()=>{var g;return(g=s.value)==null?void 0:g.focus()}))}),ct(i,()=>{a.value=0}),(h,g)=>e.visible?(A(),O("div",{key:0,ref_key:"rootRef",ref:o,class:"skill-picker",style:Po(c.value)},[_("div",PL,[Kr(_("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":g[0]||(g[0]=w=>i.value=w),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[g[1]||(g[1]=xn(wt(w=>h.$emit("close"),["prevent"]),["escape"])),xn(wt(d,["prevent"]),["enter"]),g[2]||(g[2]=xn(wt(w=>u(1),["prevent"]),["arrow-down"])),g[3]||(g[3]=xn(wt(w=>u(-1),["prevent"]),["arrow-up"]))]},null,40,$L),[[yo,i.value]])]),l.value.length>0?(A(),O("ul",NL,[(A(!0),O(et,null,Wt(l.value,(w,E)=>(A(),O("li",{key:w.path},[_("button",{class:ht(["skill-picker-item",{"is-highlighted":E===a.value}]),type:"button",onClick:D=>h.$emit("select",w),onPointerenter:D=>a.value=E},[_("span",DL,we(w.name),1),w.description?(A(),O("span",OL,we(w.description),1)):Ce("",!0)],42,LL)]))),128))])):(A(),O("div",FL,"No skills found"))],4)):Ce("",!0)}}),BL=xt(jL,[["__scopeId","data-v-ff3fb7dc"]]),UL={key:0,class:"thread-composer-dictation-error"},HL={key:0,class:"thread-composer-attachments"},qL=["src","alt"],WL=["aria-label","disabled","onClick"],VL={key:1,class:"thread-composer-folder-chips"},zL=["title"],GL={class:"thread-composer-folder-chip-meta"},KL=["aria-label","disabled","onClick"],YL={key:2,class:"thread-composer-file-chips"},JL=["title"],XL=["aria-label","disabled","onClick"],QL={key:3,class:"thread-composer-skill-chips"},ZL={class:"thread-composer-skill-chip-name"},eD=["aria-label","onClick"],tD={key:0,class:"thread-composer-drop-overlay","aria-hidden":"true"},nD={key:1,class:"thread-composer-file-mentions"},rD=["onMousedown"],oD={key:1,class:"thread-composer-file-mention-icon-markdown"},sD={class:"thread-composer-file-mention-text"},iD={class:"thread-composer-file-mention-name"},aD={key:0,class:"thread-composer-file-mention-dir"},lD={key:1,class:"thread-composer-file-mention-empty"},cD=["placeholder","disabled"],uD=["disabled"],dD={key:0,class:"thread-composer-attach-menu"},fD=["disabled"],pD=["disabled"],hD=["disabled"],mD={class:"thread-composer-attach-mode"},gD={class:"thread-composer-attach-mode-buttons"},vD=["disabled"],_D=["disabled"],yD=["aria-checked","aria-label","disabled"],bD={class:"thread-composer-attach-setting-copy"},wD={class:"thread-composer-attach-setting-description"},SD=["aria-checked","aria-label","disabled"],TD={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},ED={key:1,class:"thread-composer-dictation-timer"},kD=["aria-label","title","disabled"],CD=["disabled"],xD=["aria-label","title","disabled"],ID=["disabled"],AD=["disabled"],RD=["disabled"],MD=2e3,PD="codex-web-local.thread-draft.v1.",$D=Pn({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},collaborationModes:{},selectedCollaborationMode:{},models:{},selectedModel:{},selectedReasoningEffort:{},selectedSpeedMode:{},skills:{},threadTokenUsage:{},codexQuota:{},isTurnInProgress:{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=j(""),i=j([]),a=j([]),l=j([]),c=j([]),u=j(""),d=j(0),h=j(null),g=j(!1),{state:w,isSupported:E,recordingDurationMs:D,waveformCanvasRef:C,startRecording:I,stopRecording:V,toggleRecording:z,cancel:ce}=GN({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:S=>{if(s.value=s.value?`${s.value}
|
|
545
|
+
${S}`:S,u.value="",r.dictationAutoSend!==!1){const P=r.isTurnInProgress?Ee.value:"steer";je(P);return}tn(()=>{var P;return(P=Te.value)==null?void 0:P.focus()})},onEmpty:()=>{u.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:S=>{if(S instanceof DOMException&&S.name==="NotAllowedError"){u.value="Microphone access was denied.";return}u.value=S instanceof Error?S.message:"Dictation failed."}}),re=j(null),Z=j(null),de=j(null),_e=j(null),Te=j(null),{isMobile:fe}=Kp(),H=j(!1),ee=j(!1),Se=j(null),Ne=j(""),ye=j([]),Re=j(!1),ue=j(0),Me=j(0);let Pe=0,ke=null,We=!1,Ye=0,Je=0;const st=typeof navigator<"u"&&/Android/i.test(navigator.userAgent);let Ke="";const Q=[{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 me(S){return S.trim().replace(/^gpt/i,"GPT")}const be=le(()=>r.models.map(S=>({value:S,label:me(S)}))),ge=le(()=>r.selectedCollaborationMode==="plan"),Qe=le(()=>r.selectedCollaborationMode==="plan"&&r.selectedModel.trim().length===0),k=le(()=>r.skills??[]),x=le(()=>a.value.map(S=>S.path)),q=le(()=>(r.skills??[]).map(S=>({value:S.path,label:S.name,description:S.description}))),G=le(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId||Qe.value||d.value>0?!1:s.value.trim().length>0||i.value.length>0||l.value.length>0),Y=le(()=>s.value.trim().length>0||i.value.length>0||a.value.length>0||l.value.length>0||c.value.length>0),te=le(()=>{const S=new Set;for(const P of c.value)for(const X of P.filePaths)S.add(X);return l.value.filter(P=>!S.has(P.fsPath))}),oe=le(()=>r.disabled||!r.activeThreadId),ie=le(()=>r.selectedModel.trim()==="gpt-5.4"),pe=le(()=>r.selectedSpeedMode==="fast"&&ie.value),se=le(()=>oe.value||r.isUpdatingSpeedMode===!0),Ue=le(()=>r.isUpdatingSpeedMode?"Saving speed setting...":r.selectedSpeedMode==="fast"?"About 1.5x faster, with credits used at 2x":"Default speed with normal credit usage"),$e=le(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),Ee=j($e.value),De=le(()=>w.value==="recording"),M=le(()=>w.value==="recording"?"Stop dictation":r.dictationClickToToggle?"Click to dictate":"Hold to dictate"),N=le(()=>w.value==="idle"?u.value.trim():""),F=le(()=>{const S=Math.max(0,Math.floor(D.value/1e3)),P=Math.floor(S/60),X=S%60;return`${P}:${String(X).padStart(2,"0")}`}),ne=le(()=>r.activeThreadId?Qe.value?"Loading models for plan mode...":"Type a message... (@ for files, / for skills)":"Select a thread to send a message"),he=le(()=>s.value.trim().length>0||i.value.length>0||l.value.length>0);function je(S="steer"){var X;const P=s.value.trim();if(G.value){if(o("submit",{text:P,imageUrls:i.value.map(Ae=>Ae.url),fileAttachments:[...l.value],skills:a.value.map(Ae=>({name:Ae.name,path:Ae.path})),mode:S}),rn(r.activeThreadId),tt(),c.value=[],H.value=!1,ee.value=!1,Et(),st||fe.value){(X=Te.value)==null||X.blur();return}tn(()=>{var Ae;return(Ae=Te.value)==null?void 0:Ae.focus()})}}function Oe(S){Ee.value=S}function ot(S){Me.value+=1,s.value=S.text,i.value=S.imageUrls.map((P,X)=>({id:`queued-${Date.now()}-${X}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${X+1}`,url:P})),a.value=S.skills.map(P=>(r.skills??[]).find(X=>X.path===P.path)??{name:P.name,description:"",path:P.path}),l.value=S.fileAttachments.map(P=>({...P})),c.value=[],u.value="",h.value=null,d.value=0,H.value=!1,ee.value=!1,Et(),Je+=1}function tt(){ot({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Tt(S){return`${PD}${S}`}function Pt(S){if(typeof window>"u")return null;const P=S.trim();if(!P)return null;try{const X=window.localStorage.getItem(Tt(P));if(!X)return null;const Ae=JSON.parse(X);return typeof Ae=="string"?{text:Ae,imageUrls:[],fileAttachments:[],skills:[]}:{text:typeof Ae.text=="string"?Ae.text:"",imageUrls:Array.isArray(Ae.imageUrls)?Ae.imageUrls.filter(it=>typeof it=="string"):[],fileAttachments:Array.isArray(Ae.fileAttachments)?Ae.fileAttachments.filter(it=>!!it&&typeof it.label=="string"&&typeof it.path=="string"&&typeof it.fsPath=="string"):[],skills:Array.isArray(Ae.skills)?Ae.skills.filter(it=>!!it&&typeof it.name=="string"&&typeof it.path=="string"):[]}}catch{return null}}function ut(S,P){if(typeof window>"u")return;const X=S.trim();if(X)try{if(P.text.trim().length>0||P.imageUrls.length>0||P.fileAttachments.length>0||P.skills.length>0){window.localStorage.setItem(Tt(X),JSON.stringify(P));return}window.localStorage.removeItem(Tt(X))}catch{}}function rn(S){ut(S,{text:"",imageUrls:[],fileAttachments:[],skills:[]})}function bn(){return{text:s.value,imageUrls:i.value.map(S=>S.url),fileAttachments:l.value.map(S=>({...S})),skills:a.value.map(S=>({name:S.name,path:S.path}))}}function fr(){o("interrupt")}function nr(S){o("update:selected-model",S)}function wr(){o("update:selected-collaboration-mode",ge.value?"default":"plan")}function zt(S){o("update:selected-reasoning-effort",S)}function on(){se.value||o("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function Gt(){r.dictationClickToToggle&&(u.value&&(u.value=""),z())}function Sr(S){if(r.dictationClickToToggle||(S.preventDefault(),We))return;We=!0;const P=S.currentTarget;if(P)try{P.setPointerCapture(S.pointerId)}catch{}u.value&&(u.value=""),window.addEventListener("pointerup",Kt),window.addEventListener("pointercancel",Kt),window.addEventListener("blur",Kt),I()}function Kt(){r.dictationClickToToggle||We&&(We=!1,window.removeEventListener("pointerup",Kt),window.removeEventListener("pointercancel",Kt),window.removeEventListener("blur",Kt),V())}function no(){oe.value||(H.value=!H.value)}function qn(){var S;(S=Z.value)==null||S.click()}function Tr(){var S;(S=de.value)==null||S.click()}function Fr(){var S;(S=_e.value)==null||S.click()}function wo(S){i.value=i.value.filter(P=>P.id!==S)}function Wn(S){a.value=a.value.filter(P=>P.path!==S)}function sn(S){l.value=l.value.filter(P=>P.fsPath!==S)}function jr(S){const P=c.value.find(Ae=>Ae.id===S);if(!P)return;const X=new Set(P.filePaths);l.value=l.value.filter(Ae=>!X.has(Ae.fsPath)),c.value=c.value.filter(Ae=>Ae.id!==S)}function $n(S){return S.total<=0?0:Math.round(S.processed/S.total*100)}function Ut(S,P){const X=S.replace(/\\/g,"/");if(l.value.some(qt=>qt.fsPath===X))return;const Ae=X.split("/").filter(Boolean),it=(P==null?void 0:P.trim())||Ae[Ae.length-1]||X;l.value=[...l.value,{label:it,path:X,fsPath:X}]}function pr(S){return S.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(S.name)}function Br(S){return S?Array.from(S):[]}function wn(S){return S!==Je?!1:(d.value+=1,!0)}function Yt(S){S===Je&&(d.value=Math.max(0,d.value-1))}function $t(S){if(S<=0)return;const P=h.value,X=P?P.succeeded+P.failed:0;if(!P||X>=P.total){h.value={total:S,succeeded:0,failed:0};return}h.value={...P,total:P.total+S}}function Sn(S){const P=h.value;P&&(h.value={...P,succeeded:P.succeeded+(S==="success"?1:0),failed:P.failed+(S==="failure"?1:0)})}function ft(){return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function _t(S){const P=new Date,X=[P.getFullYear(),String(P.getMonth()+1).padStart(2,"0"),String(P.getDate()).padStart(2,"0"),String(P.getHours()).padStart(2,"0"),String(P.getMinutes()).padStart(2,"0"),String(P.getSeconds()).padStart(2,"0")].join("-"),Ae=S.type.startsWith("image/")&&S.type.slice(6).replace(/[^a-z0-9]+/gi,"")||"png";return`pasted-image-${X}.${Ae}`}function fn(){const S=new Date;return`pasted-text-${[S.getFullYear(),String(S.getMonth()+1).padStart(2,"0"),String(S.getDate()).padStart(2,"0"),String(S.getHours()).padStart(2,"0"),String(S.getMinutes()).padStart(2,"0"),String(S.getSeconds()).padStart(2,"0")].join("-")}.txt`}function Vn(S){return S.name.trim()?S:new File([S],_t(S),{type:S.type||"image/png",lastModified:Date.now()})}function hr(S){return new Promise((P,X)=>{const Ae=new FileReader;Ae.onload=()=>{if(typeof Ae.result=="string"){P(Ae.result);return}X(new Error("Image read returned an unsupported result"))},Ae.onerror=()=>{X(Ae.error??new Error("Image read failed"))},Ae.readAsDataURL(S)})}async function zn(S,P){if(wn(P))try{const X=Vn(S),Ae=await hr(X);if(P!==Je)return;i.value=[...i.value,{id:ft(),name:X.name,url:Ae}],Sn("success")}catch{P===Je&&Sn("failure")}finally{Yt(P)}}async function Nn(S,P){if(wn(P))try{const X=await Ud(S);if(P!==Je)return;if(!X){Sn("failure");return}Ut(X),Sn("success")}catch{P===Je&&Sn("failure")}finally{Yt(P)}}function pn(S){const P=Br(S);if(P.length===0)return;$t(P.length),H.value=!1,ee.value=!1,Et();const X=Je;for(const Ae of P)pr(Ae)?zn(Ae,X):Nn(Ae,X)}function Gn(){Ye=0,g.value=!1}function mr(S){if(!S||S.length===0)return;const P=Me.value;for(const X of Array.from(S))if(pr(X)){const Ae=new FileReader;Ae.onload=()=>{P===Me.value&&typeof Ae.result=="string"&&i.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:X.name,url:Ae.result})},Ae.readAsDataURL(X)}else Ud(X).then(Ae=>{P===Me.value&&Ae&&Ut(Ae)}).catch(()=>{})}function Ur(S){return S?Array.from(S.types??[]).includes("Files"):!1}async function Kn(S){if(!S||S.length===0)return;const P=Me.value,X=Array.from(S),it=(X[0].webkitRelativePath||X[0].name).split("/").filter(Boolean)[0]||"Folder",qt=`${Date.now()}-${Math.random().toString(36).slice(2)}`;c.value=[...c.value,{id:qt,name:it,total:X.length,processed:0,filePaths:[],isUploading:!0}];const Xt=Nt=>{P===Me.value&&(c.value=c.value.map(Cn=>Cn.id===qt?Nt(Cn):Cn))};for(const Nt of X)try{const Cn=await Ud(Nt);if(P!==Me.value)return;if(Cn){const so=Nt.webkitRelativePath||Nt.name;Ut(Cn,so),Xt(ws=>({...ws,processed:ws.processed+1,filePaths:[...ws.filePaths,Cn]}));continue}Xt(so=>({...so,processed:so.processed+1}))}catch{Xt(Cn=>({...Cn,processed:Cn.processed+1}))}Xt(Nt=>({...Nt,isUploading:!1}))}function An(S){S&&(S.value="")}function rr(S){const P=S.target;mr((P==null?void 0:P.files)??null),An(P),H.value=!1}function Tn(S){const P=S.target;mr((P==null?void 0:P.files)??null),An(P),H.value=!1}function En(S){const P=S.target;Kn((P==null?void 0:P.files)??null),An(P),H.value=!1}function Ln(S){oe.value||!Ur(S.dataTransfer)||(S.preventDefault(),Ye+=1,g.value=!0)}function kn(S){oe.value||!Ur(S.dataTransfer)||(S.preventDefault(),S.dataTransfer&&(S.dataTransfer.dropEffect="copy"),g.value=!0)}function Er(S){g.value&&(S.preventDefault(),Ye=Math.max(0,Ye-1),Ye===0&&Gn())}function ro(S){var P;oe.value||!Ur(S.dataTransfer)||(S.preventDefault(),Gn(),pn(((P=S.dataTransfer)==null?void 0:P.files)??null))}function Lt(){!g.value&&Ye===0||Gn()}function un(S){var qt,Xt;if(oe.value)return;const P=((qt=S.clipboardData)==null?void 0:qt.getData("text/plain"))??"";if(P.length>=MD){S.preventDefault();const Nt=new File([P],fn(),{type:"text/plain",lastModified:Date.now()});pn([Nt]);return}const X=Array.from(((Xt=S.clipboardData)==null?void 0:Xt.items)??[]);if(X.length===0)return;const Ae=P.length>0,it=X.filter(Nt=>Nt.kind==="file"&&Nt.type.startsWith("image/")).map(Nt=>Nt.getAsFile()).filter(Nt=>Nt instanceof File);it.length!==0&&(Ae||S.preventDefault(),pn(it))}function Yn(){u.value&&(u.value="");const P=s.value.startsWith("/");P!==ee.value&&(ee.value=P),Hr()}function He(S){if(Re.value){if(S.key==="Escape"){S.preventDefault(),Et();return}if(S.key==="ArrowDown"){S.preventDefault(),ye.value.length>0&&(ue.value=(ue.value+1)%ye.value.length);return}if(S.key==="ArrowUp"){if(S.preventDefault(),ye.value.length>0){const X=ye.value.length;ue.value=(ue.value+X-1)%X}return}if(S.key==="Enter"||S.key==="Tab"){S.preventDefault();const X=ye.value[ue.value];X?or(X):Et();return}}if(r.sendWithEnter!==!1?S.key==="Enter"&&!S.shiftKey:S.key==="Enter"&&(S.metaKey||S.ctrlKey)){S.preventDefault(),je(r.isTurnInProgress?Ee.value:"steer");return}if(ee.value){if(S.key==="Escape"){S.preventDefault(),xe();return}if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault();return}}}function xe(){var S;ee.value=!1,(S=Te.value)==null||S.focus()}function Et(){Re.value=!1,Se.value=null,Ne.value="",ye.value=[],ue.value=0}function Hr(){const S=Te.value;if(!S){Et();return}const P=S.selectionStart??s.value.length,Ae=s.value.slice(0,P).match(/(^|\s)(@[^\s@]*)$/);if(!Ae){Et();return}const it=Ae[2]??"",qt=it.length,Xt=P-qt;Se.value=Xt,Ne.value=it.slice(1),Re.value=!0,qr()}async function qr(){if(!Re.value)return;const S=(r.cwd??"").trim();if(!S){ye.value=[];return}ke&&clearTimeout(ke);const P=++Pe;ke=setTimeout(async()=>{try{const X=await O$(S,Ne.value,20);if(!Re.value||P!==Pe)return;ye.value=X,ue.value=0}catch{if(!Re.value||P!==Pe)return;ye.value=[]}},120)}function or(S){const P=Te.value,X=Se.value;if(X!==null&&P){const Ae=P.selectionStart??s.value.length;s.value=`${s.value.slice(0,X)}${s.value.slice(Ae)}`.trimEnd()}Ut(S.path),Et(),tn(()=>P==null?void 0:P.focus())}function sr(S){ce(),ot(S),tn(()=>{var P;return(P=Te.value)==null?void 0:P.focus()})}function oo(S){const P=S.trim();P&&(ce(),s.value.trim().length>0?s.value=`${s.value.trimEnd()}
|
|
546
|
+
${P}`:s.value=P,tn(()=>{var X;return(X=Te.value)==null?void 0:X.focus()}))}function kr(S){const P=S.lastIndexOf("/");return P<0?S:S.slice(P+1)}function Dn(S){const P=S.lastIndexOf("/");return P<=0?"":S.slice(0,P)}function Vt(S){const P=kr(S),X=P.lastIndexOf(".");return X<=0?"":P.slice(X+1).toLowerCase()}function Jt(S){const P=Vt(S);return P==="ts"?"TS":P==="tsx"?"TSX":P==="js"?"JS":P==="jsx"?"JSX":P==="json"?"{}":""}function Cr(S){const P=Vt(S);return P.startsWith("ts")?"ts":P.startsWith("js")?"js":P==="json"?"json":"default"}function T(S){const P=Vt(S);return P==="md"||P==="mdx"}function R(S){var P;a.value.some(X=>X.path===S.path)||(a.value=[...a.value,S]),s.value=s.value.startsWith("/")?"":s.value,ee.value=!1,(P=Te.value)==null||P.focus()}function L(S,P){if(P){const X=(r.skills??[]).find(Ae=>Ae.path===S);X&&!a.value.some(Ae=>Ae.path===S)&&(a.value=[...a.value,X])}else a.value=a.value.filter(X=>X.path!==S)}function K(S){if(!H.value)return;const P=re.value;if(!P)return;const X=S.target;!X||P.contains(X)||(H.value=!1)}return vs(()=>{document.addEventListener("click",K),window.addEventListener("drop",Lt),window.addEventListener("dragend",Lt),window.addEventListener("blur",Lt)}),t({hydrateDraft:sr,appendTextToDraft:oo,hasUnsavedDraft:()=>Y.value}),Xs(()=>{document.removeEventListener("click",K),window.removeEventListener("drop",Lt),window.removeEventListener("dragend",Lt),window.removeEventListener("blur",Lt),window.removeEventListener("pointerup",Kt),window.removeEventListener("pointercancel",Kt),window.removeEventListener("blur",Kt),ke&&clearTimeout(ke)}),ct(()=>r.activeThreadId,S=>{ce(),Ke&&ut(Ke,bn()),tt();const P=Pt(S);P&&(ot(P),Yn()),Ke=S.trim()},{immediate:!0}),ct([s,i,l,a],()=>{Ke&&ut(Ke,bn())},{deep:!0}),ct(()=>r.cwd,()=>{Re.value&&qr()}),ct($e,S=>{Ee.value=S}),(S,P)=>(A(),O("form",{class:"thread-composer",onSubmit:P[4]||(P[4]=wt(X=>je(e.isTurnInProgress?Ee.value:"steer"),["prevent"]))},[N.value?(A(),O("p",UL,we(N.value),1)):Ce("",!0),_("div",{class:ht(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove,"thread-composer-shell--drag-active":g.value}])},[i.value.length>0?(A(),O("div",HL,[(A(!0),O(et,null,Wt(i.value,X=>(A(),O("div",{key:X.id,class:"thread-composer-attachment"},[_("img",{class:"thread-composer-attachment-image",src:X.url,alt:X.name||"Selected image"},null,8,qL),_("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${X.name||"image"}`,disabled:oe.value,onClick:Ae=>wo(X.id)}," x ",8,WL)]))),128))])):Ce("",!0),c.value.length>0?(A(),O("div",VL,[(A(!0),O(et,null,Wt(c.value,X=>(A(),O("span",{key:X.id,class:"thread-composer-folder-chip"},[Ge(Zp,{class:"thread-composer-folder-chip-icon"}),_("span",{class:"thread-composer-folder-chip-name",title:X.name},we(X.name),9,zL),_("span",GL,[X.isUploading?(A(),O(et,{key:0},[Vs(we($n(X))+"% uploading ("+we(X.processed)+"/"+we(X.total)+") ",1)],64)):(A(),O(et,{key:1},[Vs(we(X.filePaths.length)+" file"+we(X.filePaths.length===1?"":"s"),1)],64))]),_("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${X.name}`,disabled:oe.value,onClick:Ae=>jr(X.id)},"×",8,KL)]))),128))])):Ce("",!0),te.value.length>0?(A(),O("div",YL,[(A(!0),O(et,null,Wt(te.value,X=>(A(),O("span",{key:X.fsPath,class:"thread-composer-file-chip"},[Ge(Oc,{class:"thread-composer-file-chip-icon"}),_("span",{class:"thread-composer-file-chip-name",title:X.fsPath},we(X.label),9,JL),_("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${X.label}`,disabled:oe.value,onClick:Ae=>sn(X.fsPath)},"×",8,XL)]))),128))])):Ce("",!0),a.value.length>0?(A(),O("div",QL,[(A(!0),O(et,null,Wt(a.value,X=>(A(),O("span",{key:X.path,class:"thread-composer-skill-chip"},[_("span",ZL,we(X.name),1),_("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${X.name}`,onClick:Ae=>Wn(X.path)},"×",8,eD)]))),128))])):Ce("",!0),_("div",{class:ht(["thread-composer-input-wrap",{"thread-composer-input-wrap--drag-active":g.value}]),onDragenter:Ln,onDragover:kn,onDragleave:Er,onDrop:ro},[g.value?(A(),O("div",tD,[...P[5]||(P[5]=[_("span",{class:"thread-composer-drop-overlay-copy"},"Drop images or files",-1)])])):Ce("",!0),Re.value?(A(),O("div",nD,[ye.value.length>0?(A(!0),O(et,{key:0},Wt(ye.value,(X,Ae)=>(A(),O("button",{key:X.path,class:ht(["thread-composer-file-mention-row",{"is-active":Ae===ue.value}]),type:"button",onMousedown:wt(it=>or(X),["prevent"])},[Jt(X.path)?(A(),O("span",{key:0,class:ht(["thread-composer-file-mention-icon-badge",`is-${Cr(X.path)}`])},we(Jt(X.path)),3)):T(X.path)?(A(),O("span",oD,"↓")):(A(),bt(Oc,{key:2,class:"thread-composer-file-mention-icon-file"})),_("span",sD,[_("span",iD,we(kr(X.path)),1),Dn(X.path)?(A(),O("span",aD,we(Dn(X.path)),1)):Ce("",!0)])],42,rD))),128)):(A(),O("div",lD,"No matching files"))])):Ce("",!0),Kr(_("textarea",{ref_key:"inputRef",ref:Te,"onUpdate:modelValue":P[0]||(P[0]=X=>s.value=X),class:"thread-composer-input",placeholder:ne.value,disabled:oe.value,onInput:Yn,onKeydown:He,onPaste:un},null,40,cD),[[yo,s.value]]),Ge(BL,{skills:k.value,visible:ee.value,"anchor-bottom":44,"anchor-left":0,onSelect:R,onClose:xe},null,8,["skills","visible"])],34),_("div",{class:ht(["thread-composer-controls",{"thread-composer-controls--recording":De.value}])},[_("div",{ref_key:"attachMenuRootRef",ref:re,class:"thread-composer-attach"},[_("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:oe.value,onClick:no}," + ",8,uD),H.value?(A(),O("div",dD,[_("button",{class:"thread-composer-attach-item",type:"button",disabled:oe.value,onClick:qn}," Add photos & files ",8,fD),_("button",{class:"thread-composer-attach-item",type:"button",disabled:oe.value,onClick:Fr}," Add folder ",8,pD),_("button",{class:"thread-composer-attach-item",type:"button",disabled:oe.value,onClick:Tr}," Take photo ",8,hD),P[9]||(P[9]=_("div",{class:"thread-composer-attach-separator"},null,-1)),_("div",mD,[P[6]||(P[6]=_("span",{class:"thread-composer-attach-mode-label"},"In-progress send",-1)),_("div",gD,[_("button",{class:ht(["thread-composer-attach-mode-button",{"is-active":Ee.value==="steer"}]),type:"button",disabled:oe.value,onClick:P[1]||(P[1]=X=>Oe("steer"))}," Steer ",10,vD),_("button",{class:ht(["thread-composer-attach-mode-button",{"is-active":Ee.value==="queue"}]),type:"button",disabled:oe.value,onClick:P[2]||(P[2]=X=>Oe("queue"))}," Queue ",10,_D)])]),P[10]||(P[10]=_("div",{class:"thread-composer-attach-separator"},null,-1)),ie.value?(A(),O("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:se.value,onClick:on},[_("span",bD,[P[7]||(P[7]=_("span",{class:"thread-composer-attach-setting-label"},"Fast mode",-1)),_("span",wD,we(Ue.value),1)]),_("span",{class:ht(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":se.value}])},null,2)],8,yD)):Ce("",!0),_("button",{class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":ge.value,"aria-label":ge.value?"Disable plan mode":"Enable plan mode",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onClick:wr},[P[8]||(P[8]=_("span",{class:"thread-composer-attach-setting-copy"},[_("span",{class:"thread-composer-attach-setting-label"},"Plan mode"),_("span",{class:"thread-composer-attach-setting-description"},"Agent proposes a plan before acting")],-1)),_("span",{class:ht(["thread-composer-attach-switch",{"is-on":ge.value}])},null,2)],8,SD)])):Ce("",!0)],512),De.value?Ce("",!0):(A(),O(et,{key:0},[Ge(Bs,{class:"thread-composer-control","model-value":e.selectedModel,options:be.value,"selected-prefix-icon":pe.value?tL:null,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":nr},null,8,["model-value","options","selected-prefix-icon","disabled"]),Ge(ML,{class:"thread-composer-control",options:q.value,"selected-values":x.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:L},null,8,["options","selected-values","disabled"]),Ge(Bs,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Q,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":zt},null,8,["model-value","disabled"])],64)),_("div",{class:ht(["thread-composer-actions",{"thread-composer-actions--recording":De.value}])},[qe(w)==="recording"?(A(),O("div",TD,[_("canvas",{ref_key:"dictationWaveformCanvasRef",ref:C,class:"thread-composer-dictation-waveform"},null,512)])):Ce("",!0),qe(w)==="recording"?(A(),O("span",ED,we(F.value),1)):Ce("",!0),qe(E)?(A(),O("button",{key:2,class:ht(["thread-composer-mic",{"thread-composer-mic--active":qe(w)==="recording"}]),type:"button","aria-label":M.value,title:M.value,disabled:oe.value,onClick:Gt,onPointerdown:Sr,onPointerup:Kt,onPointercancel:Kt},[qe(w)==="recording"?(A(),bt(iv,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(A(),bt(sL,{key:1,class:"thread-composer-mic-icon"}))],42,kD)):Ce("",!0),e.isTurnInProgress&&!he.value?(A(),O("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:fr},[Ge(iv,{class:"thread-composer-stop-icon"})],8,CD)):(A(),O("button",{key:4,class:ht(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Ee.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Ee.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${Ee.value}`:"Send",disabled:!G.value,onClick:P[3]||(P[3]=X=>je(e.isTurnInProgress?Ee.value:"steer"))},[Ge(XN,{class:"thread-composer-submit-icon"})],10,xD))],2)],2)],2),_("input",{ref_key:"photoLibraryInputRef",ref:Z,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:oe.value,onChange:rr},null,40,ID),_("input",{ref_key:"cameraCaptureInputRef",ref:de,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:oe.value,onChange:Tn},null,40,AD),_("input",{ref_key:"folderPickerInputRef",ref:_e,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:oe.value,onChange:En},null,40,RD)],32))}}),av=xt($D,[["__scopeId","data-v-25d88825"]]),ND={key:0,class:"thread-pending-request"},LD={class:"thread-pending-request-title"},DD=["title"],OD={class:"thread-pending-request-approval"},FD={class:"thread-pending-request-options",role:"radiogroup","aria-label":"Approval choices"},jD=["aria-pressed","onClick"],BD={class:"thread-pending-request-option-index"},UD={class:"thread-pending-request-option-label"},HD={class:"thread-pending-request-footer thread-pending-request-footer--approval"},qD=["value"],WD={class:"thread-pending-request-header"},VD={class:"thread-pending-request-heading"},zD={class:"thread-pending-request-eyebrow"},GD={class:"thread-pending-request-title"},KD={key:0,class:"thread-pending-request-counter"},YD={key:0,class:"thread-pending-request-preview"},JD={class:"thread-pending-request-preview-code"},XD={key:1,class:"thread-pending-request-user-input"},QD={key:0,class:"thread-pending-request-question-description"},ZD=["href"],eO={class:"thread-pending-request-question-title"},tO={key:0},nO={key:0,class:"thread-pending-request-question-text"},rO={key:1,class:"thread-pending-request-input-wrap"},oO=["type","value","onInput"],sO={key:2,class:"thread-pending-request-select-wrap"},iO=["value","onChange"],aO={key:0,value:""},lO={key:3,class:"thread-pending-request-select-wrap"},cO=["value","onChange"],uO={key:0,value:""},dO=["value"],fO={key:4,class:"thread-pending-request-question-options"},pO=["checked","onChange"],hO={class:"thread-pending-request-checkbox-label"},mO={key:2,class:"thread-pending-request-validation-error"},gO={class:"thread-pending-request-footer"},vO={key:2,class:"thread-pending-request-user-input"},_O={class:"thread-pending-request-question-title"},yO={key:0,class:"thread-pending-request-question-text"},bO={key:1,class:"thread-pending-request-question-options"},wO={class:"thread-pending-request-select-wrap"},SO=["value","onChange"],TO=["value"],EO={key:0,class:"thread-pending-request-question-description"},kO={key:2,class:"thread-pending-request-input-wrap"},CO=["value","onInput"],xO={class:"thread-pending-request-footer"},IO={key:3,class:"thread-pending-request-actions"},AO={key:4,class:"thread-pending-request-actions"},RO=Pn({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean}},emits:["respondServerRequest"],setup(e,{emit:t}){const n=e,r=t,o=j("accept"),s=j(""),i=j({}),a=j({}),l=j({}),c=j("");function u(M){return M!==null&&typeof M=="object"&&!Array.isArray(M)?M:null}function d(M){return typeof M=="string"?M.trim():""}function h(M){return typeof M=="string"?M:null}function g(M){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(M)?M:JSON.stringify(M)}function w(M){const F=(Array.isArray(M.commandActions)?M.commandActions:[]).map(ne=>u(ne)).map(ne=>d(ne==null?void 0:ne.command)).find(ne=>ne.length>0);if(F)return F.replace(/\s+/g," ").trim();if(Array.isArray(M.command)){const ne=M.command.filter(he=>typeof he=="string").map(he=>he.trim()).filter(he=>he.length>0);if(ne.length>0)return ne.map(he=>g(he)).join(" ")}return Z(d(M.command))}function E(M){return M.method==="item/commandExecution/requestApproval"||M.method==="execCommandApproval"}function D(M){return M.method==="item/fileChange/requestApproval"||M.method==="applyPatchApproval"}function C(M){return M.method==="item/permissions/requestApproval"}function I(M){return E(M)||D(M)||C(M)}function V(M){return M.method==="mcpServer/elicitation/request"}function z(M){const N=u(M.params);return d(N==null?void 0:N.reason)||d(N==null?void 0:N.prompt)||d(N==null?void 0:N.message)}function ce(M){return I(M)?"Awaiting approval":V(M)?"MCP server input required":M.method==="item/tool/requestUserInput"?"Awaiting response":M.method==="item/tool/call"?"Tool call waiting for response":M.method}function re(M){const N=z(M);return N||(E(M)?"Do you want to run this command?":D(M)?"Do you want to make these changes?":C(M)?"Do you want to grant these permissions?":V(M)?"An MCP server needs your input before Codex can continue.":M.method==="item/tool/requestUserInput"?"Codex needs your answer before it can continue.":"Codex is waiting for a response before it can continue.")}function Z(M){var je;const N=M.trim();if(!N)return"";const F=N.match(/-Command\s+(.+)$/i),ne=((je=F==null?void 0:F[1])==null?void 0:je.trim())??N;return(ne.startsWith('"')&&ne.endsWith('"')?ne.slice(1,-1):ne).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function de(M){const N=u(M.params);if(!N)return"";if(E(M))return w(N);if(D(M)){const F=d(N.grantRoot)||d(N.grant_root);if(F)return F.replace(/\s+/g," ").trim();const ne=u(N.fileChanges)??u(N.changes);if(!ne)return"";const he=Object.keys(ne).map(je=>je.trim()).filter(je=>je.length>0);return he.length===0?"":he.slice(0,3).join(", ")}return C(M)?_e(N.permissions):V(M)?d(N.serverName)||d(N.url):""}function _e(M){const N=u(M);if(!N)return"";const F=[],ne=u(N.fileSystem),he=u(N.network),je=Array.isArray(ne==null?void 0:ne.read)?ne.read.filter(ot=>typeof ot=="string"):[],Oe=Array.isArray(ne==null?void 0:ne.write)?ne.write.filter(ot=>typeof ot=="string"):[];return je.length>0&&F.push(`Read: ${je.join(", ")}`),Oe.length>0&&F.push(`Write: ${Oe.join(", ")}`),(he==null?void 0:he.enabled)===!0&&F.push("Network access"),F.join(" • ")}function Te(M){return!M||!I(M)?[]:[{id:"accept",label:"Yes"},{id:"acceptForSession",label:"Yes for Session"}]}const fe=le(()=>Te(n.request));ct(()=>{var M;return((M=n.request)==null?void 0:M.id)??0},()=>{var M;s.value="",i.value={},a.value={},l.value={},c.value="",o.value=((M=fe.value[0])==null?void 0:M.id)??"accept"},{immediate:!0}),ct(fe,M=>{var N;o.value!=="decline"&&(M.some(F=>F.id===o.value)||(o.value=((N=M[0])==null?void 0:N.id)??"accept"))},{immediate:!0});function H(M,N){return`${String(M)}:${N}`}function ee(M){const N=u(M.params),F=Array.isArray(N==null?void 0:N.questions)?N.questions:[],ne=[];for(const he of F){const je=u(he);if(!je)continue;const Oe=d(je.id);if(!Oe)continue;const ot=Array.isArray(je.options)?je.options.map(tt=>u(tt)).map(tt=>({label:d(tt==null?void 0:tt.label),description:d(tt==null?void 0:tt.description)})).filter(tt=>tt.label.length>0):[];ne.push({id:Oe,header:d(je.header),question:d(je.question),isOther:je.isOther===!0,options:ot})}return ne}function Se(M,N,F){const ne=H(M,N),he=i.value[ne];return typeof he=="string"&&he.length>0?he:F}function Ne(M,N){return a.value[H(M,N)]??""}function ye(M,N,F){const ne=F.target;if(!(ne instanceof HTMLSelectElement))return;const he=H(M,N);i.value={...i.value,[he]:ne.value}}function Re(M,N,F){const ne=F.target;if(!(ne instanceof HTMLInputElement))return;const he=H(M,N);a.value={...a.value,[he]:ne.value}}function ue(M,N,F){var he,je;const ne=Se(M,N,((he=F[0])==null?void 0:he.label)||"");return((je=F.find(Oe=>Oe.label===ne))==null?void 0:je.description)??""}function Me(M,N){return`${String(M)}:${N}`}function Pe(M){var N;return d((N=u(M.params))==null?void 0:N.serverName)}function ke(M){var F;const N=d((F=u(M.params))==null?void 0:F.url);if(!N)return"";try{const ne=new URL(N),he=ne.protocol.toLowerCase();return he==="https:"||he==="http:"?ne.toString():""}catch{return""}}function We(M){const N=u(M.params),F=u(N==null?void 0:N.requestedSchema),ne=u(F==null?void 0:F.properties);if(!ne)return[];const he=new Set(Array.isArray(F==null?void 0:F.required)?F.required.filter(je=>typeof je=="string"):[]);return Object.entries(ne).map(([je,Oe])=>Ye(je,u(Oe),he.has(je))).filter(je=>je!==null)}function Ye(M,N,F){if(!N)return null;const ne=d(N.title)||M,he=d(N.description),je=d(N.type);if(je==="boolean")return{key:M,label:ne,description:he,required:F,kind:"boolean",inputType:"checkbox",options:[],defaultValue:typeof N.default=="boolean"?N.default:null,hasExplicitDefault:typeof N.default=="boolean"};if(je==="number"||je==="integer")return{key:M,label:ne,description:he,required:F,kind:"number",inputType:"number",options:[],defaultValue:typeof N.default=="number"?N.default:null,hasExplicitDefault:typeof N.default=="number"};const Oe=Je(N);if(je==="array")return{key:M,label:ne,description:he,required:F,kind:"multiEnum",inputType:"checkbox",options:Oe,defaultValue:Array.isArray(N.default)?N.default.filter(tt=>typeof tt=="string"):[],hasExplicitDefault:Array.isArray(N.default)};const ot=h(N.default);return Oe.length>0?{key:M,label:ne,description:he,required:F,kind:"singleEnum",inputType:"select",options:Oe,defaultValue:ot,hasExplicitDefault:ot!==null}:{key:M,label:ne,description:he,required:F,kind:"string",inputType:st(N),options:[],defaultValue:ot,hasExplicitDefault:ot!==null}}function Je(M){const F=(Array.isArray(M.oneOf)?M.oneOf:Array.isArray(M.anyOf)?M.anyOf:[]).map(Oe=>u(Oe)).map(Oe=>({value:d(Oe==null?void 0:Oe.const),label:d(Oe==null?void 0:Oe.title)||d(Oe==null?void 0:Oe.const)})).filter(Oe=>Oe.value.length>0);if(F.length>0)return F;const ne=u(M.items);if(ne){const Oe=Je(ne);if(Oe.length>0)return Oe}const he=Array.isArray(M.enum)?M.enum.filter(Oe=>typeof Oe=="string"):[],je=Array.isArray(M.enumNames)?M.enumNames.filter(Oe=>typeof Oe=="string"):[];return he.map((Oe,ot)=>({value:Oe,label:je[ot]||Oe}))}function st(M){const N=d(M.format);return N==="email"?"email":N==="uri"?"url":N==="date"?"date":N==="date-time"?"datetime-local":"text"}function Ke(M,N){const F=l.value[Me(M,N.key)];return F!==void 0?F:N.defaultValue}function Q(M,N){const F=Ke(M,N);return Array.isArray(F)?F.filter(ne=>typeof ne=="string"):[]}function me(M,N,F){const ne=F.target;if(!(ne instanceof HTMLInputElement)&&!(ne instanceof HTMLSelectElement))return;const he=ne.value,je=(N.kind==="number",he);l.value={...l.value,[Me(M,N.key)]:he.length>0?je:null},c.value=""}function be(M,N,F){const ne=F.target;if(!(ne instanceof HTMLSelectElement))return;let he=null;ne.value==="true"?he=!0:ne.value==="false"&&(he=!1),l.value={...l.value,[Me(M,N.key)]:he},c.value=""}function ge(M,N,F,ne){const he=ne.target;if(!(he instanceof HTMLInputElement))return;const je=new Set(Q(M,N));he.checked?je.add(F):je.delete(F),l.value={...l.value,[Me(M,N.key)]:Array.from(je)},c.value=""}function Qe(M){return M===!0?"true":M===!1?"false":""}function k(M,N){const F=Ke(M,N);return N.kind==="multiEnum"?Array.isArray(F)&&F.length>0:N.kind==="boolean"?typeof F=="boolean":N.kind==="number"&&typeof F=="number"?!0:typeof F=="string"&&F.trim().length>0}function x(M){const N=We(M).filter(F=>F.required&&!k(M.id,F)).map(F=>F.label);return N.length===0?"":N.length===1?`Answer the required field: ${N[0]}.`:`Answer the required fields: ${N.join(", ")}.`}function q(M){const N={};for(const F of We(M)){const ne=Ke(M.id,F);if(F.kind==="multiEnum"){const je=Array.isArray(ne)?ne:[];(je.length>0||F.required)&&(N[F.key]=je);continue}if(F.kind==="boolean"){typeof ne=="boolean"&&(N[F.key]=ne);continue}if(F.kind==="number"){const je=typeof ne=="number"?ne:Number(String(ne).trim());Number.isNaN(je)||(N[F.key]=je);continue}const he=String(ne??"").trim();(he.length>0||F.required)&&(N[F.key]=he)}return N}function G(M){o.value=M}function Y(){o.value="decline"}function te(M){const N=M.target;N instanceof HTMLInputElement&&(s.value=N.value,o.value="decline")}function oe(M,N){var F;if(C(M)){if(N==="decline"||N==="cancel"){r("respondServerRequest",{id:M.id,error:{code:-32e3,message:N==="cancel"?"Cancelled from CodexUI.":"Declined from CodexUI."}});return}const ne=u((F=u(M.params))==null?void 0:F.permissions)??{};r("respondServerRequest",{id:M.id,result:{permissions:ne,scope:N==="acceptForSession"?"session":"turn"}});return}r("respondServerRequest",{id:M.id,result:{decision:N}})}function ie(M){const N=s.value.trim(),F=N.length>0?"decline":o.value;if(C(M)){oe(M,F);return}r("respondServerRequest",{id:M.id,result:{decision:F},followUpMessageText:N||void 0})}function pe(M,N){const F=u(M.params),ne={action:N};if(N==="accept"&&d(F==null?void 0:F.mode)==="form"){const he=x(M);if(he){c.value=he;return}ne.content=q(M)}r("respondServerRequest",{id:M.id,result:ne})}function se(M){var ne;const N=ee(M),F={};for(const he of N){const je=Se(M.id,he.id,((ne=he.options[0])==null?void 0:ne.label)||""),Oe=Ne(M.id,he.id).trim(),ot=[je,Oe].map(tt=>tt.trim()).filter(tt=>tt.length>0);F[he.id]={answers:ot}}r("respondServerRequest",{id:M.id,result:{answers:F}})}function Ue(M){r("respondServerRequest",{id:M.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function $e(M){r("respondServerRequest",{id:M.id,result:{success:!0,contentItems:[]}})}function Ee(M){r("respondServerRequest",{id:M.id,result:{}})}function De(M){r("respondServerRequest",{id:M.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(M,N)=>e.request?(A(),O("section",ND,[_("article",{class:ht(["thread-pending-request-shell",{"thread-pending-request-shell--no-top-radius":e.hasQueueAbove}])},[I(e.request)?(A(),O(et,{key:0},[_("p",LD,we(re(e.request)),1),de(e.request)?(A(),O("p",{key:0,class:"thread-pending-request-command-line",title:de(e.request)},we(de(e.request)),9,DD)):Ce("",!0),_("section",OD,[_("div",FD,[(A(!0),O(et,null,Wt(fe.value,(F,ne)=>(A(),O("button",{key:F.id,type:"button",class:ht(["thread-pending-request-option",{"is-selected":o.value===F.id}]),"aria-pressed":o.value===F.id,onClick:he=>G(F.id)},[_("span",BD,we(ne+1)+".",1),_("span",UD,we(F.label),1)],10,jD))),128))]),_("footer",HD,[_("label",{class:ht(["thread-pending-request-inline-input",{"is-active":o.value==="decline"||s.value.length>0}])},[N[11]||(N[11]=_("span",{class:"thread-pending-request-option-index"},"3.",-1)),_("input",{class:"thread-pending-request-inline-control",type:"text",value:s.value,placeholder:"No, and tell Codex what to do differently",onFocus:Y,onInput:te,onKeydown:N[0]||(N[0]=xn(wt(F=>ie(e.request),["prevent"]),["enter"]))},null,40,qD)],2),_("button",{type:"button",class:"thread-pending-request-secondary",onClick:N[1]||(N[1]=F=>oe(e.request,"cancel"))}," Skip "),_("button",{type:"button",class:"thread-pending-request-primary",onClick:N[2]||(N[2]=F=>ie(e.request))}," Send ")])])],64)):(A(),O(et,{key:1},[_("header",WD,[_("div",VD,[_("p",zD,we(ce(e.request)),1),_("p",GD,we(re(e.request)),1)]),(e.requestCount??0)>1?(A(),O("span",KD,we(e.requestCount??0)+" pending",1)):Ce("",!0)]),de(e.request)?(A(),O("div",YD,[_("code",JD,we(de(e.request)),1)])):Ce("",!0),e.request.method==="mcpServer/elicitation/request"?(A(),O("section",XD,[Pe(e.request)?(A(),O("p",QD," Server: "+we(Pe(e.request)),1)):Ce("",!0),ke(e.request)?(A(),O("a",{key:1,class:"thread-pending-request-link",href:ke(e.request),target:"_blank",rel:"noopener noreferrer"}," Open authorization link ",8,ZD)):Ce("",!0),(A(!0),O(et,null,Wt(We(e.request),F=>(A(),O("div",{key:`${e.request.id}:${F.key}`,class:"thread-pending-request-question"},[_("p",eO,[Vs(we(F.label),1),F.required?(A(),O("span",tO," *")):Ce("",!0)]),F.description?(A(),O("p",nO,we(F.description),1)):Ce("",!0),F.kind==="string"||F.kind==="number"?(A(),O("label",rO,[N[12]||(N[12]=_("span",{class:"thread-pending-request-select-label"},"Value",-1)),_("input",{class:"thread-pending-request-input",type:F.inputType,value:String(Ke(e.request.id,F)??""),onInput:ne=>me(e.request.id,F,ne)},null,40,oO)])):F.kind==="boolean"?(A(),O("label",sO,[N[15]||(N[15]=_("span",{class:"thread-pending-request-select-label"},"Choice",-1)),_("select",{class:"thread-pending-request-select",value:Qe(Ke(e.request.id,F)),onChange:ne=>be(e.request.id,F,ne)},[F.hasExplicitDefault?Ce("",!0):(A(),O("option",aO,"Select true or false")),N[13]||(N[13]=_("option",{value:"true"},"True",-1)),N[14]||(N[14]=_("option",{value:"false"},"False",-1))],40,iO)])):F.kind==="singleEnum"?(A(),O("label",lO,[N[16]||(N[16]=_("span",{class:"thread-pending-request-select-label"},"Choice",-1)),_("select",{class:"thread-pending-request-select",value:String(Ke(e.request.id,F)??""),onChange:ne=>me(e.request.id,F,ne)},[F.hasExplicitDefault?Ce("",!0):(A(),O("option",uO,"Select an option")),(A(!0),O(et,null,Wt(F.options,ne=>(A(),O("option",{key:`${e.request.id}:${F.key}:${ne.value}`,value:ne.value},we(ne.label),9,dO))),128))],40,cO)])):(A(),O("div",fO,[(A(!0),O(et,null,Wt(F.options,ne=>(A(),O("label",{key:`${e.request.id}:${F.key}:${ne.value}`,class:"thread-pending-request-checkbox-row"},[_("input",{class:"thread-pending-request-checkbox",type:"checkbox",checked:Q(e.request.id,F).includes(ne.value),onChange:he=>ge(e.request.id,F,ne.value,he)},null,40,pO),_("span",hO,we(ne.label),1)]))),128))]))]))),128)),c.value?(A(),O("p",mO,we(c.value),1)):Ce("",!0),_("footer",gO,[_("button",{type:"button",class:"thread-pending-request-secondary",onClick:N[3]||(N[3]=F=>pe(e.request,"cancel"))}," Cancel "),_("button",{type:"button",class:"thread-pending-request-secondary",onClick:N[4]||(N[4]=F=>pe(e.request,"decline"))}," Decline "),_("button",{type:"button",class:"thread-pending-request-primary",onClick:N[5]||(N[5]=F=>pe(e.request,"accept"))}," Continue ")])])):e.request.method==="item/tool/requestUserInput"?(A(),O("section",vO,[(A(!0),O(et,null,Wt(ee(e.request),F=>{var ne;return A(),O("div",{key:`${e.request.id}:${F.id}`,class:"thread-pending-request-question"},[_("p",_O,we(F.header||F.question),1),F.question?(A(),O("p",yO,we(F.question),1)):Ce("",!0),F.options.length>0?(A(),O("div",bO,[_("label",wO,[N[17]||(N[17]=_("span",{class:"thread-pending-request-select-label"},"Choice",-1)),_("select",{class:"thread-pending-request-select",value:Se(e.request.id,F.id,((ne=F.options[0])==null?void 0:ne.label)||""),onChange:he=>ye(e.request.id,F.id,he)},[(A(!0),O(et,null,Wt(F.options,he=>(A(),O("option",{key:`${e.request.id}:${F.id}:${he.label}`,value:he.label},we(he.label),9,TO))),128))],40,SO)]),ue(e.request.id,F.id,F.options)?(A(),O("p",EO,we(ue(e.request.id,F.id,F.options)),1)):Ce("",!0)])):Ce("",!0),F.isOther?(A(),O("label",kO,[N[18]||(N[18]=_("span",{class:"thread-pending-request-select-label"},"Other answer",-1)),_("input",{class:"thread-pending-request-input",type:"text",value:Ne(e.request.id,F.id),placeholder:"Other answer",onInput:he=>Re(e.request.id,F.id,he)},null,40,CO)])):Ce("",!0)])}),128)),_("footer",xO,[_("button",{type:"button",class:"thread-pending-request-primary",onClick:N[6]||(N[6]=F=>se(e.request))}," Send ")])])):e.request.method==="item/tool/call"?(A(),O("section",IO,[_("button",{type:"button",class:"thread-pending-request-primary",onClick:N[7]||(N[7]=F=>Ue(e.request))}," Fail Tool Call "),_("button",{type:"button",class:"thread-pending-request-secondary",onClick:N[8]||(N[8]=F=>$e(e.request))}," Success (Empty) ")])):(A(),O("section",AO,[_("button",{type:"button",class:"thread-pending-request-primary",onClick:N[9]||(N[9]=F=>Ee(e.request))}," Return Empty Result "),_("button",{type:"button",class:"thread-pending-request-secondary",onClick:N[10]||(N[10]=F=>De(e.request))}," Reject Request ")]))],64))],2)])):Ce("",!0)}}),MO=xt(RO,[["__scopeId","data-v-a033894d"]]),PO={key:0,class:"queued-messages"},$O={class:"queued-messages-inner"},NO={class:"queued-row-text"},LO={class:"queued-row-actions"},DO=["onClick"],OO=["onClick"],FO=["onClick"],jO=Pn({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete"],setup(e){function t(n){var l,c,u;const r=n.text.trim();if(r)return r;const o=[],s=((l=n.imageUrls)==null?void 0:l.length)??0,i=((c=n.fileAttachments)==null?void 0:c.length)??0,a=((u=n.skills)==null?void 0:u.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?(A(),O("div",PO,[_("div",$O,[(A(!0),O(et,null,Wt(e.messages,o=>(A(),O("div",{key:o.id,class:"queued-row"},[r[1]||(r[1]=_("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[_("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)),_("span",NO,we(t(o)),1),_("div",LO,[_("button",{class:"queued-row-edit",type:"button",title:"Edit queued message",onClick:s=>n.$emit("edit",o.id)},"Edit",8,DO),_("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>n.$emit("steer",o.id)},"Steer",8,OO),_("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]=[_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[_("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,FO)])]))),128))])])):Ce("",!0)}}),BO=xt(jO,[["__scopeId","data-v-835c6739"]]),UO={key:0,class:"rate-limit-status","aria-live":"polite"},HO=["title"],qO={class:"rate-limit-card-header"},WO={class:"rate-limit-card-title"},VO={key:0,class:"rate-limit-card-plan"},zO={class:"rate-limit-card-metrics"},GO={key:0,class:"rate-limit-card-footer"},KO=Pn({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(C){var I,V;return((I=C.limitId)==null?void 0:I.trim())||((V=C.limitName)==null?void 0:V.trim())||"__default__"}function n(C){var I,V;return((I=C.limitName)==null?void 0:I.trim())||((V=C.limitId)==null?void 0:V.trim())||"Rate limits"}function r(C){const I=C.trim();return I?I.replace(/[_-]+/g," ").replace(/\b\w/g,V=>V.toUpperCase()):""}function o(C){return!C||C<=0?"Window":C%1440===0?`${C/1440}d`:C%60===0?`${C/60}h`:C<60?`${C}m`:`${Math.round(C/60*10)/10}h`}function s(C){const I=Math.max(0,Math.min(100,100-C));return`${Math.round(I)}% left`}function i(C){return`${Math.round(C)}%`}function a(C,I){return{key:I,label:`${o(C.windowDurationMins)} ${s(C.usedPercent)}`}}function l(C){const I=[];return C.primary&&I.push(a(C.primary,"primary")),C.secondary&&I.push(a(C.secondary,"secondary")),I}function c(C){if(!C)return"";const I=new Date(C*1e3),V=I.getMonth()+1,z=String(I.getDate()).padStart(2,"0"),ce=String(I.getHours()).padStart(2,"0"),re=String(I.getMinutes()).padStart(2,"0");return`${V}.${z} ${ce}:${re}`}function u(C){if(!(C!=null&&C.resetsAt))return"";const I=C.resetsAt*1e3-Date.now();if(I<=0)return"Resetting now";const V=Math.round(I/6e4);if(V<60)return`Resets in ${V}m`;const z=Math.round(V/60);return z<24?`Resets in ${z}h`:`Resets in ${Math.round(z/24)}d`}function d(C){return[C.primary,C.secondary].filter(I=>I!==null)}function h(C){const I=d(C);return I.length===0?null:[...I].sort((V,z)=>{const ce=V.windowDurationMins??Number.MAX_SAFE_INTEGER,re=z.windowDurationMins??Number.MAX_SAFE_INTEGER;return ce!==re?ce-re:(V.resetsAt??Number.MAX_SAFE_INTEGER)-(z.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function g(C){const I=d(C);if(I.length===0)return"";const V=[...I].sort((ce,re)=>{const Z=ce.windowDurationMins??-1,de=re.windowDurationMins??-1;return Z!==de?de-Z:(re.resetsAt??-1)-(ce.resetsAt??-1)})[0],z=c(V.resetsAt);return z||""}function w(C){const I=C.credits;return I?I.unlimited?"Unlimited credits":I.balance?`Credits ${I.balance}`:I.hasCredits?"Credits available":"":""}function E(C){return[u(h(C)),g(C),w(C)].filter(I=>I.length>0)}function D(C){const I=[n(C)];for(const V of l(C))I.push(V.label);for(const V of d(C))I.push(`${o(V.windowDurationMins)} used ${i(V.usedPercent)}`);for(const V of E(C))I.push(V);return I.join(`
|
|
547
|
+
`)}return(C,I)=>e.snapshots.length>0?(A(),O("aside",UO,[(A(!0),O(et,null,Wt(e.snapshots,V=>(A(),O("div",{key:t(V),class:"rate-limit-card",title:D(V)},[_("div",qO,[_("span",WO,we(n(V)),1),V.planType?(A(),O("span",VO,we(r(V.planType)),1)):Ce("",!0)]),_("div",zO,[(A(!0),O(et,null,Wt(l(V),z=>(A(),O("span",{key:z.key,class:"rate-limit-card-metric"},we(z.label),1))),128))]),E(V).length>0?(A(),O("div",GO,we(E(V).join(" | ")),1)):Ce("",!0)],8,HO))),128))])):Ce("",!0)}}),YO=xt(KO,[["__scopeId","data-v-df88906b"]]),JO={class:"runtime-toggle",role:"radiogroup","aria-label":"Continue in"},XO=["aria-checked","onClick"],QO={class:"runtime-toggle-option-label"},ZO=Pn({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=[{value:"local",label:"Local project",icon:Zp},{value:"worktree",label:"New worktree",icon:vc}];function o(s){n("update:modelValue",s)}return(s,i)=>(A(),O("div",JO,[(A(),O(et,null,Wt(r,a=>_("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)},[(A(),bt(up(a.icon),{class:"runtime-toggle-option-icon"})),_("span",QO,we(a.label),1)],10,XO)),64))]))}}),eF=xt(ZO,[["__scopeId","data-v-e8b0d0ac"]]),tF={},nF={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 rF(e,t){return A(),O("svg",nF,[...t[0]||(t[0]=[_("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),_("path",{d:"M9 4l0 16"},null,-1)])])}const oF=xt(tF,[["render",rF]]),sF={},iF={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function aF(e,t){return A(),O("svg",iF,[...t[0]||(t[0]=[_("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 lF=xt(sF,[["render",aF]]),cF={class:"sidebar-thread-controls"},uF=["aria-label","title"],dF=Pn({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(A(),O("div",cF,[_("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?(A(),bt(lF,{key:0,class:"sidebar-thread-controls-icon"})):(A(),bt(oF,{key:1,class:"sidebar-thread-controls-icon"}))],8,uF),vo(t.$slots,"default",{},void 0),e.showNewThreadButton?(A(),O("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"))},[Ge(Oc,{class:"sidebar-thread-controls-icon"})])):Ce("",!0)]))}}),lv=xt(dF,[["__scopeId","data-v-46a10052"]]),fF={},pF={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function hF(e,t){return A(),O("svg",pF,[...t[0]||(t[0]=[_("circle",{cx:"11",cy:"11",r:"8"},null,-1),_("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const cv=xt(fF,[["render",hF]]),mF={},gF={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function vF(e,t){return A(),O("svg",gF,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("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"}),_("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const _F=xt(mF,[["render",vF]]),yF={},bF={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wF(e,t){return A(),O("svg",bF,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const SF=xt(yF,[["render",wF]]);function fo(e){return e.flatMap(t=>t.threads)}const pw="codex-web-local.thread-read-state.v1",hw="codex-web-local.thread-scroll-state.v1",mw="codex-web-local.thread-token-usage.v1",Vf="codex-web-local.selected-thread-id.v1",zf="codex-web-local.selected-model-by-context.v1",gw="codex-web-local.selected-model-id.v1",vw="codex-web-local.project-order.v1",_w="codex-web-local.project-display-name.v1",Gf="codex-web-local.collaboration-mode-by-context.v1",yw="codex-web-local.collaboration-mode.v1",dl="__new-thread__",Wd=220,TF=500,EF=3e3,uv=["none","minimal","low","medium","high","xhigh"],fi="__global__",Vr="gpt-5.2-codex";function kF(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(pw);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function dv(e){typeof window>"u"||window.localStorage.setItem(pw,JSON.stringify(e))}function Kf(e){return e==="plan"?"plan":"default"}function Fc(e){return typeof e=="string"?e.trim():""}function Yr(){return Object.create(null)}function Vd(e){const t=Yr();for(const[n,r]of Object.entries(e))t[n]=r;return t}function zd(e,t){if(!(t in e))return e;const n=Yr();for(const[r,o]of Object.entries(e))r!==t&&(n[r]=o);return n}function fv(e,t){let n=!1;const r=Yr();for(const[o,s]of Object.entries(e)){if(o===dl||t.has(o)){r[o]=s;continue}n=!0}return n?r:e}function jc(e){return e.trim()||dl}function CF(){if(typeof window>"u")return Yr();try{const n=window.localStorage.getItem(zf);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return Yr();const o=Yr();for(const[s,i]of Object.entries(r)){if(typeof s!="string"||s.length===0)continue;const a=Fc(i);a&&(o[s]=a)}return o}}catch{}const e=Fc(window.localStorage.getItem(gw)),t=Yr();return e&&(t[dl]=e),t}function pv(e,t){const n=jc(t),r=Fc(e[n]);return r||Fc(e[dl])}function Gd(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(zf):window.localStorage.setItem(zf,JSON.stringify(e)),window.localStorage.removeItem(gw)}catch{}}function xF(){if(typeof window>"u")return Yr();try{const n=window.localStorage.getItem(Gf);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return Yr();const o=Yr();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(yw)),t=Yr();return e==="plan"&&(t[dl]="plan"),t}function zl(e,t){const n=jc(t);return Kf(e[n])}function hv(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Gf):window.localStorage.setItem(Gf,JSON.stringify(e)),window.localStorage.removeItem(yw)}catch{}}function ka(e,t,n){return Math.min(Math.max(e,t),n)}function IF(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=ka(t.scrollRatio,0,1)),n}function AF(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(hw);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=IF(o);s&&(n[r]=s)}return n}catch{return{}}}function mv(e){typeof window>"u"||window.localStorage.setItem(hw,JSON.stringify(e))}function vi(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 gv(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return{totalTokens:vi(t.totalTokens)??0,inputTokens:vi(t.inputTokens)??0,cachedInputTokens:vi(t.cachedInputTokens)??0,outputTokens:vi(t.outputTokens)??0,reasoningOutputTokens:vi(t.reasoningOutputTokens)??0}}function RF(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=gv(t.total),r=gv(t.last);if(!n||!r)return null;const o=vi(t.modelContextWindow),s=r.totalTokens,i=typeof o=="number"?Math.max(o-s,0):null,a=typeof o=="number"&&o>0?ka(Math.round((i??0)/o*100),0,100):null;return{total:n,last:r,modelContextWindow:o,currentContextTokens:s,remainingContextTokens:i,remainingContextPercent:a}}function MF(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(mw);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=RF(o);s&&(n[r]=s)}return n}catch{return{}}}function vv(e){typeof window>"u"||window.localStorage.setItem(mw,JSON.stringify(e))}function PF(){return typeof window>"u"?"":window.localStorage.getItem(Vf)??""}function $F(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Vf);return}window.localStorage.setItem(Vf,e)}}function NF(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(vw);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=ul(r);o.length>0&&!n.includes(o)&&n.push(o)}return n}catch{return[]}}function pi(e){typeof window>"u"||window.localStorage.setItem(vw,JSON.stringify(e))}function LF(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(_w);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"?ul(r):"";s.length>0&&typeof o=="string"&&(n[s]=o)}return n}catch{return{}}}function Kd(e){typeof window>"u"||window.localStorage.setItem(_w,JSON.stringify(e))}function Gl(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 ss(e,n)?e:n}function Yd(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 ss(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 DF(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 OF(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function FF(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 jF(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&FF(e.steps,t.steps)}function Kl(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 Yf(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&ss(e.images,t.images)&&UF(e.fileChanges,t.fileChanges)&&e.fileChangeStatus===t.fileChangeStatus&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&OF(e.commandExecution,t.commandExecution)&&jF(e.plan,t.plan)&&e.turnId===t.turnId&&e.turnIndex===t.turnIndex}function bi(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 BF(e,t,n={}){const r=new Map(e.map(u=>[u.id,u])),o=new Map(t.map(u=>[u.id,u])),s=t.map(u=>{const d=r.get(u.id);return d&&Yf(d,u)?d:u});if(n.preserveMissing!==!0)return bi(e,s)?e:s;const i=e.map(u=>{const d=o.get(u.id);return!d||Yf(u,d)?u:d}),a=new Set(e.map(u=>u.id)),l=s.filter(u=>!a.has(u.id)),c=[...i,...l];return bi(e,c)?e:c}function UF(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 Jf(e){return e.replace(/\s+/gu," ").trim()}function HF(e,t){const n=new Set(t.filter(o=>o.role==="assistant").map(o=>Jf(o.text)).filter(o=>o.length>0));if(n.size===0)return e;const r=e.filter(o=>{if(o.messageType!=="agentMessage.live")return!0;const s=Jf(o.text);return s.length===0?!1:!n.has(s)});return r.length===e.length?e:r}function Yl(e,t){const n=e.findIndex(s=>s.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Yf(r,t))return e;const o=[...e];return o.splice(n,1,t),o}const bw="worked";function es(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function qF(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 WF(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function VF(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 zF(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${qF(e.durationMs)}`,messageType:bw,turnId:e.turnId}}function GF(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function KF(e,t){const n=zF(t),r=e.filter(i=>i.messageType!==bw),o=GF(r);if(o<0)return[...r,n];const s=[...r];return s.splice(o,0,n),s}function Dt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function YF(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 JF(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 XF(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 QF(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 mn(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Jl(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 c=i.get(l.id);return c&&JF(c,l)?c:l});return s&&s.projectName===o.projectName&&XF(s.threads,a)?s:{projectName:o.projectName,threads:a}});return QF(e,r)?e:r}function ZF(e,t,n){const r=new Set(fo(t).map(a=>a.id)),o=fo(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 c=i.findIndex(u=>u.projectName===a.projectName);c>=0&&(i[c]={projectName:i[c].projectName,threads:[a,...i[c].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function ts(e){return ul(e)}function e4(e){const t=e.split(`
|
|
548
|
+
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function t4(e){const t=e.trim()||"Untitled thread";return/^fork:\s+/iu.test(t)?t:`Fork: ${t}`}function n4(){const e=j([]),t=j([]),n=j(PF()),r=j({}),o=j({}),s=j({}),i=j({}),a=j({}),l=j({}),c=j({}),u=j({}),d=j({}),h=j({}),g=j([]),w=j([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),E=j(xF()),D=j(CF()),C=j(zl(E.value,n.value)),I=j(pv(D.value,n.value)),V=j("medium"),z=j("standard"),ce=j(kF()),re=j(AF()),Z=j(NF()),de=j(LF()),_e=j({}),Te=j({}),fe=j({}),H=j({}),ee=j({}),Se=j({}),Ne=j({}),ye=j({}),Re=j({}),ue=j({}),Me=j(null),Pe=j(MF()),ke=j({}),We=j([]),Ye=j([]),Je=j(!1),st=j(!1),Ke=j(!1),Q=j(!1),me=j(!1),be=j(!1),ge=j(""),Qe=j(!1),k=j(!1);let x=null,q=null,G=null;const Y=new Map;let te=null,oe=!1;const ie=new Set;let pe=!1,se=!1;const Ue=new Map,$e=new Set,Ee=le(()=>fo(e.value)),De=le(()=>Ee.value.find(f=>f.id===n.value)??null),M=le(()=>re.value[n.value]??null),N=le(()=>{const f=[],p=n.value;return p&&Array.isArray(Re.value[p])&&f.push(...Re.value[p]),Array.isArray(Re.value[fi])&&f.push(...Re.value[fi]),f.sort((v,b)=>v.receivedAtIso.localeCompare(b.receivedAtIso))}),F=le(()=>{var B;const f=n.value;if(!f)return null;const p=Se.value[f],v=(i.value[f]??"").trim(),b=(((B=Ne.value[f])==null?void 0:B.message)??"").trim();return!p&&!v&&!b?null:{activityLabel:(p==null?void 0:p.label)||"Thinking",activityDetails:(p==null?void 0:p.details)??[],reasoningText:v,errorText:b}}),ne=le(()=>Me.value),he=le(()=>{const f=n.value;return f?Pe.value[f]??null:null}),je=le(()=>{const f=n.value;if(!f)return[];const p=r.value[f]??[],v=o.value[f]??[],b=s.value[f]??[],B=a.value[f]??[],U=l.value[f]??[],W=[...p,...v,...B,...U,...b],J=ee.value[f];return J?KF(W,J):W});function Oe(f){return pv(D.value,f).trim()}function ot(...f){const p=[...g.value];for(const v of f){const b=v.trim();b&&!p.includes(b)&&p.push(b)}ss(g.value,p)||(g.value=p)}function tt(f){n.value!==f&&(n.value=f,$F(f),I.value=Oe(f),ot(I.value),C.value=zl(E.value,f),se=!1)}function Tt(f){const p=f.trim(),v=jc(n.value);if(p){const b=Vd(D.value);b[v]=p,D.value=b}else D.value=zd(D.value,v);I.value=Oe(n.value),ot(I.value),Gd(D.value),yr({category:"ui.model",message:`model → ${I.value}`,level:"info"})}function Pt(f,p){const v=f.trim();if(!v)return;const b=p.trim();if(b){const B=Vd(D.value);B[v]=b,D.value=B}else D.value=zd(D.value,v);ot(b),n.value===v&&(I.value=Oe(n.value)),Gd(D.value)}function ut(f,p){const v=f.trim();if(!v)return;if(!p){if(!(v in Pe.value))return;Pe.value=Dt(Pe.value,v),vv(Pe.value);return}const b=Pe.value[v];b&&JSON.stringify(b)===JSON.stringify(p)||(Pe.value={...Pe.value,[v]:p},vv(Pe.value))}function rn(f){const p=f==="plan"?"plan":"default",v=jc(n.value);if(!(zl(E.value,n.value)===p&&C.value===p)){if(C.value=p,p==="plan"){const B=Vd(E.value);B[v]=p,E.value=B}else E.value=zd(E.value,v);hv(E.value)}}function bn(f){Me.value=f}async function fr(f=n.value){f.trim()?Pt(f,Vr):Tt(Vr),ot(Vr)}function nr(f,p){ue.value={...ue.value,[f]:p}}function wr(f){ue.value[f]&&(ue.value=Dt(ue.value,f))}async function zt(f){if($e.has(f))return;const p=ue.value[f];if(!(!p||p.fallbackRetried)){$e.add(f),nr(f,{...p,fallbackRetried:!0});try{await fr(f);try{const v=await Od(f,1);Nn(f,v),Ln(f),pn(f,[]),En(f),a.value[f]&&(a.value=Dt(a.value,f))}catch{}_t(f,null),ge.value="",Yt(f,null),ft(f,{label:"Thinking",details:Kt(Vr,p.effort,p.collaborationMode)}),$t(f,!0),fe.value[f]!==!0&&await Dd(f),await Fd(f,p.text,p.imageUrls,Vr,p.effort||void 0,p.skills.length>0?p.skills:void 0,p.fileAttachments,p.collaborationMode),fe.value={...fe.value,[f]:!0},Tr(),ie.add(f),oe=!0,await Wr()}catch(v){const b=v instanceof Error?v.message:"Unknown application error";_t(f,b),ge.value=b,$t(f,!1),ft(f,null)}finally{$e.delete(f)}}}function on(f){f&&!uv.includes(f)||(V.value=f)}async function Gt(f){const p=f==="fast"?"fast":"standard";if(me.value||z.value===p)return;const v=z.value;z.value=p,me.value=!0,ge.value="";try{await C$(p)}catch(b){z.value=v,ge.value=b instanceof Error?b.message:"Failed to update Fast mode"}finally{me.value=!1}}async function Sr(){try{const f=await I$();w.value=f,f.some(p=>p.value===C.value)||rn("default")}catch{}}function Kt(f,p,v=C.value){const b=f.trim()||"default",B=p||"default",U=v==="plan"?"Plan":"Default",W=z.value==="fast"?"Fast":"Standard";return[`Mode: ${U}`,`Model: ${b}`,`Thinking: ${B}`,`Speed: ${W}`]}async function no(){try{const[f,p]=await Promise.all([uw(),dw()]),v=Oe(n.value),b=p.model.trim(),B=[...f];for(const U of[v,b])U&&!B.includes(U)&&B.push(U);g.value=B,v||(b&&B.includes(b)?Tt(p.model):B.length>0?Tt(B[0]):Tt("")),p.reasoningEffort&&uv.includes(p.reasoningEffort)&&(V.value=p.reasoningEffort),z.value=p.speedMode}catch{}}async function qn(){if(te){await te;return}te=(async()=>{try{Ye.value=sr(await Jg())}catch{}finally{te=null}})(),await te}function Tr(){if(typeof window>"u"){qn();return}G!==null&&window.clearTimeout(G),G=window.setTimeout(()=>{G=null,qn()},TF)}function Fr(f){if(!f||typeof window>"u")return;const p=Y.get(f);p!==void 0&&(window.clearTimeout(p),Y.delete(f))}function wo(f){if(!f||typeof window>"u")return;Fr(f);const p=window.setTimeout(()=>{Y.delete(f),ie.add(f),Wr()},EF);Y.set(f,p)}function Wn(f){const p=ke.value;return Object.keys(p).length===0?f:f.map(v=>({projectName:v.projectName,threads:v.threads.map(b=>{const B=p[b.id];return B?{...b,title:B}:b})}))}function sn(f){return f?Array.isArray(Re.value[f])?Re.value[f]:[]:[]}function jr(f){return f==="item/commandExecution/requestApproval"||f==="item/fileChange/requestApproval"||f==="item/permissions/requestApproval"||f==="execCommandApproval"||f==="applyPatchApproval"}function $n(f){return f.some(p=>jr(p.method))?"approval":f.length>0?"response":null}function Ut(){const p=Wn(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(b=>{const B=c.value[b.id]===!0,U=$n(sn(b.id)),W=n.value===b.id,J=ce.value[b.id],ae=h.value[b.id]===!0,Be=!W&&!B&&(ae||J!==b.updatedAtIso);return{...b,inProgress:B,unread:Be,pendingRequestState:U}})}));e.value=Jl(e.value,p)}function pr(f,p,v){const b=new Date().toISOString(),B=ln(p),U=ul(B),W={id:f,title:e4(v),projectName:U,cwd:B,hasWorktree:B.includes("/.codex/worktrees/")||B.includes("/.git/worktrees/"),createdAtIso:b,updatedAtIso:b,preview:v,unread:!1,inProgress:!1},J=t.value.findIndex(Be=>Be.projectName===U);if(J>=0){const ze=t.value[J].threads.filter(an=>an.id!==f),pt={projectName:U,threads:[W,...ze]},yt=[...t.value];yt.splice(J,1,pt),t.value=yt}else t.value=[{projectName:U,threads:[W]},...t.value];const ae=Gl(Z.value,t.value);ss(Z.value,ae)||(Z.value=ae,pi(Z.value)),Ut()}function Br(f){const p=new Set(f.map(J=>J.id)),v=fv(D.value,p);v!==D.value&&(D.value=v,I.value=Oe(n.value),ot(I.value),Gd(v));const b=fv(E.value,p);b!==E.value&&(E.value=b,C.value=zl(b,n.value),hv(b));const B=mn(ce.value,p);B!==ce.value&&(ce.value=B,dv(B));const U=mn(re.value,p);U!==re.value&&(re.value=U,mv(U)),Te.value=mn(Te.value,p),_e.value=mn(_e.value,p),fe.value=mn(fe.value,p),H.value=mn(H.value,p),r.value=mn(r.value,p),s.value=mn(s.value,p),i.value=mn(i.value,p),a.value=mn(a.value,p),l.value=mn(l.value,p),ee.value=mn(ee.value,p),Se.value=mn(Se.value,p),Ne.value=mn(Ne.value,p),ye.value=mn(ye.value,p),Pe.value=mn(Pe.value,p),h.value=mn(h.value,p),c.value=mn(c.value,p);const W={};for(const[J,ae]of Object.entries(Re.value))(J===fi||p.has(J))&&(W[J]=ae);Re.value=W}function wn(f){const p=fo(t.value).find(v=>v.id===f);p&&(ce.value={...ce.value,[f]:p.updatedAtIso},dv(ce.value),h.value[f]&&(h.value=Dt(h.value,f)),Ut())}function Yt(f,p){if(!f)return;const v=ee.value[f];if(p){if(WF(v,p))return;ee.value={...ee.value,[f]:p}}else v&&(ee.value=Dt(ee.value,f))}function $t(f,p){!f||c.value[f]===!0===p||(p?c.value={...c.value,[f]:!0}:c.value=Dt(c.value,f),Ut())}function Sn(f){f&&f!==n.value&&h.value[f]!==!0&&(h.value={...h.value,[f]:!0},Ut())}function ft(f,p){if(!f)return;const v=Se.value[f];if(!p){v&&(Se.value=Dt(Se.value,f));return}const b=so(p.label)||"Thinking",B=p.details.map(J=>so(J)).filter(J=>J.length>0&&J!==b),U=Array.from(new Set([...(v==null?void 0:v.details)??[],...B])).slice(-3),W={label:b,details:U};VF(v,W)||(Se.value={...Se.value,[f]:W})}function _t(f,p,v={}){if(!f)return;const b=Ne.value[f],B=p?Jf(p):"";if(!B){b&&(Ne.value=Dt(Ne.value,f));return}const U=v.transient===!0;(b==null?void 0:b.message)===B&&b.transient===U||(Ne.value={...Ne.value,[f]:{message:B,transient:U}})}function fn(f){var p;f&&(p=Ne.value[f])!=null&&p.transient&&_t(f,null)}function Vn(){const f=Object.entries(Ne.value).filter(([,v])=>v==null?void 0:v.transient).map(([v])=>v);if(f.length===0)return;let p=Ne.value;for(const v of f)p=Dt(p,v);Ne.value=p}function hr(f){const p=fo(t.value).find(v=>v.id===f);return(p==null?void 0:p.updatedAtIso)??""}function zn(f,p){if(!f)return;const v={scrollTop:Math.max(0,p.scrollTop),isAtBottom:p.isAtBottom===!0};typeof p.scrollRatio=="number"&&Number.isFinite(p.scrollRatio)&&(v.scrollRatio=ka(p.scrollRatio,0,1));const b=re.value[f];b&&b.scrollTop===v.scrollTop&&b.isAtBottom===v.isAtBottom&&b.scrollRatio===v.scrollRatio||(re.value={...re.value,[f]:v},mv(re.value))}function Nn(f,p){const v=r.value[f]??[];bi(v,p)||(r.value={...r.value,[f]:p})}function pn(f,p){const v=s.value[f]??[];bi(v,p)||(s.value={...s.value,[f]:p})}function Gn(f,p){const v=l.value[f]??[];bi(v,p)||(l.value={...l.value,[f]:p})}function mr(f,p){const v=o.value[f]??[];bi(v,p)||(o.value={...o.value,[f]:p})}function Ur(f,p){const v=o.value[f]??[],b=Yl(v,p);mr(f,b)}function Kn(f,p){const v=s.value[f]??[],b=Yl(v,p);pn(f,b)}function An(f,p){const v=l.value[f]??[],b=Yl(v,p);Gn(f,b)}function rr(f,p){if(!f)return;const v=p.trim(),b=i.value[f]??"";if(v.length===0){if(!b)return;i.value=Dt(i.value,f);return}b!==v&&(i.value={...i.value,[f]:v})}function Tn(f,p){if(!f)return;const v=i.value[f]??"";rr(f,`${v}${p}`)}function En(f){f&&f in i.value&&(i.value=Dt(i.value,f))}function Ln(f){f&&f in o.value&&(o.value=Dt(o.value,f))}function kn(f){f&&f in l.value&&(l.value=Dt(l.value,f))}function Er(f){f&&(Ln(f),En(f),ft(f,null),a.value[f]&&(a.value=Dt(a.value,f)),ye.value[f]&&(ye.value=Dt(ye.value,f)),wr(f))}function ro(f){return f==="completed"?"completed":f==="inProgress"||f==="in_progress"?"inProgress":"pending"}function Lt(f){var v;const p=[];(v=f.explanation)!=null&&v.trim()&&p.push(f.explanation.trim());for(const b of f.steps){const B=b.status==="completed"?"x":b.status==="inProgress"?"~":" ";p.push(`- [${B}] ${b.step}`)}return p.join(`
|
|
549
|
+
`).trim()}function un(f){if(f.method!=="turn/plan/updated")return null;const p=He(f.params),v=Vt(f),b=xe(p==null?void 0:p.turnId)||xe(p==null?void 0:p.turn_id),U=(Array.isArray(p==null?void 0:p.plan)?p==null?void 0:p.plan:[]).map(ae=>He(ae)).map(ae=>({step:xe(ae==null?void 0:ae.step),status:ro(ae==null?void 0:ae.status)})).filter(ae=>ae.step.length>0);if(!v||!b)return null;const J={explanation:xe(p==null?void 0:p.explanation).trim()||void 0,steps:U,isStreaming:!0};return{threadId:v,message:{id:`${b}:plan`,role:"assistant",text:Lt(J),messageType:"plan.live",plan:J}}}function Yn(f){if(f.method!=="item/plan/delta")return null;const p=He(f.params),v=Vt(f),b=xe(p==null?void 0:p.turnId)||xe(p==null?void 0:p.turn_id),B=xe(p==null?void 0:p.delta);if(!v||!b||!B)return null;const U=`${b}:plan`,W=(o.value[v]??[]).find(Be=>Be.id===U),J=`${(W==null?void 0:W.text)??""}${B}`,ae=W!=null&&W.plan?{...W.plan,isStreaming:!0}:void 0;return{threadId:v,message:{id:U,role:"assistant",text:J,messageType:"plan.live",plan:ae}}}function He(f){return f!==null&&typeof f=="object"&&!Array.isArray(f)?f:null}function xe(f){return typeof f=="string"?f:""}function Et(f){return typeof f=="number"&&Number.isFinite(f)?f:null}function Hr(f){var p,v;return((p=f.limitId)==null?void 0:p.trim())||((v=f.limitName)==null?void 0:v.trim())||"__default__"}function qr(f){const p=He(f);if(!p)return null;const v=Et(p.windowDurationMins);return{usedPercent:ka(Et(p.usedPercent)??0,0,100),windowDurationMins:v,windowMinutes:v,resetsAt:Et(p.resetsAt)}}function or(f){const p=He(f);if(!p)return null;const v=He(p.credits);return{limitId:xe(p.limitId)||null,limitName:xe(p.limitName)||null,primary:qr(p.primary),secondary:qr(p.secondary),credits:v?{hasCredits:v.hasCredits===!0,unlimited:v.unlimited===!0,balance:xe(v.balance)||null}:null,planType:xe(p.planType)||null}}function sr(f){const p=He(f);if(!p)return[];const v=[],b=new Set,B=W=>{if(!W)return;const J=Hr(W);b.has(J)||(b.add(J),v.push(W))};B(or(p.rateLimits));const U=He(p.rateLimitsByLimitId);if(U)for(const W of Object.values(U))B(or(W));return v}function oo(f){const p=He(f);if(!p)return null;const v=Et(p.totalTokens??p.total_tokens),b=Et(p.inputTokens??p.input_tokens),B=Et(p.cachedInputTokens??p.cached_input_tokens),U=Et(p.outputTokens??p.output_tokens),W=Et(p.reasoningOutputTokens??p.reasoning_output_tokens);return v===null||b===null||B===null||U===null||W===null?null:{totalTokens:v,inputTokens:b,cachedInputTokens:B,outputTokens:U,reasoningOutputTokens:W}}function kr(f){const p=He(f);if(!p)return null;const v=oo(p.total),b=oo(p.last);if(!v||!b)return null;const B=Et(p.modelContextWindow??p.model_context_window),U=b.totalTokens,W=typeof B=="number"?Math.max(B-U,0):null,J=typeof B=="number"&&B>0?ka(Math.round((W??0)/B*100),0,100):null;return{total:v,last:b,modelContextWindow:B,currentContextTokens:U,remainingContextTokens:W,remainingContextPercent:J}}function Dn(f){if(f.method!=="thread/tokenUsage/updated")return null;const p=He(f.params),v=Vt(f),b=kr((p==null?void 0:p.tokenUsage)??(p==null?void 0:p.token_usage));return!v||!b?null:{threadId:v,usage:b}}function Vt(f){const p=He(f.params);if(!p)return"";const v=xe(p.threadId);if(v)return v;const b=xe(p.thread_id);if(b)return b;const B=xe(p.conversationId);if(B)return B;const U=xe(p.conversation_id);if(U)return U;const W=He(p.thread),J=xe(W==null?void 0:W.id);if(J)return J;const ae=He(p.turn),Be=xe(ae==null?void 0:ae.threadId);if(Be)return Be;const ze=xe(ae==null?void 0:ae.thread_id);return ze||""}function Jt(f){if(f.method!=="turn/completed")return"";const p=He(f.params),v=He(p==null?void 0:p.turn);if(!v||v.status!=="failed")return"";const b=He(v.error);return xe(b==null?void 0:b.message)}function Cr(f){var b;if(f.method!=="error")return null;const p=He(f.params),v=xe(p==null?void 0:p.message)||xe((b=He(p==null?void 0:p.error))==null?void 0:b.message);return v?{message:v,transient:(p==null?void 0:p.willRetry)===!0}:null}function T(f){const p=He(f);if(!p)return null;const v=p.id,b=xe(p.method),B=p.params;if(typeof v!="number"||!Number.isInteger(v)||!b)return null;const U=He(B),W=R(b,U),J=xe(U==null?void 0:U.threadId)||xe(U==null?void 0:U.thread_id)||xe(U==null?void 0:U.conversationId)||xe(U==null?void 0:U.conversation_id)||fi,ae=xe(U==null?void 0:U.turnId)||xe(U==null?void 0:U.turn_id),Be=xe(U==null?void 0:U.itemId)||xe(U==null?void 0:U.item_id)||xe(U==null?void 0:U.callId)||xe(U==null?void 0:U.call_id),ze=xe(p.receivedAtIso)||new Date().toISOString();return{id:v,method:W,threadId:J,turnId:ae,itemId:Be,receivedAtIso:ze,params:B??null}}function R(f,p){const v=f.trim();return v&&(v==="item/commandExecution/requestApproval"||v==="execCommandApproval"||v==="exec_approval_request"||L(p)?"item/commandExecution/requestApproval":v==="item/fileChange/requestApproval"||v==="applyPatchApproval"||v==="apply_patch_approval_request"||K(p)?"item/fileChange/requestApproval":v==="item/tool/requestUserInput"||v==="request_user_input"||S(p)?"item/tool/requestUserInput":v==="mcpServer/elicitation/request"||v==="elicitation_request"||X(p)?"mcpServer/elicitation/request":v==="item/permissions/requestApproval"||Ae(p)?"item/permissions/requestApproval":v==="item/tool/call"||v==="dynamic_tool_call_request"||P(p)?"item/tool/call":v)}function L(f){if(!f)return!1;const p=f.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(f.commandActions)}function K(f){return f?typeof f.grantRoot=="string"&&f.grantRoot.trim().length>0||typeof f.grant_root=="string"&&f.grant_root.trim().length>0||He(f.fileChanges)?!0:He(f.changes)!==null:!1}function S(f){return!!(f&&Array.isArray(f.questions))}function P(f){return f?typeof f.toolName=="string"||typeof f.tool_name=="string"||typeof f.name=="string"||Array.isArray(f.arguments):!1}function X(f){if(!f)return!1;const p=xe(f.mode);return typeof f.serverName=="string"&&typeof f.threadId=="string"&&typeof f.message=="string"&&(p==="form"||p==="url")}function Ae(f){return f?typeof f.threadId=="string"&&typeof f.turnId=="string"&&typeof f.itemId=="string"&&He(f.permissions)!==null:!1}function it(f){if(f.method!=="item/tool/requestUserInput")return[];const p=He(f.params),v=Array.isArray(p==null?void 0:p.questions)?p.questions:[],b=[];for(const B of v){const U=He(B),W=xe(U==null?void 0:U.id).trim();W&&b.push(W)}return b}function qt(f){const p=f.threadId||fi,v=Re.value[p]??[],b=v.findIndex(U=>U.id===f.id),B=[...v];b>=0?B.splice(b,1,f):B.push(f),Re.value={...Re.value,[p]:B.sort((U,W)=>U.receivedAtIso.localeCompare(W.receivedAtIso))},Ut()}function Xt(f){const p={};for(const[v,b]of Object.entries(Re.value)){const B=b.filter(U=>U.id!==f);B.length>0&&(p[v]=B)}Re.value=p,Ut()}function Nt(f){const p={};for(const v of f){const b=v.threadId||fi,B=p[b]??[];B.push(v),p[b]=B}for(const v of Object.values(p))v.sort((b,B)=>b.receivedAtIso.localeCompare(B.receivedAtIso));Re.value=p}function Cn(f){if(f.method==="server/request"){const p=T(f.params);return p&&qt(p),!0}if(f.method==="server/request/resolved"){const p=He(f.params),v=p==null?void 0:p.id;return typeof v=="number"&&Number.isInteger(v)&&Xt(v),!0}return!1}function so(f){return f.replace(/\s+/gu," ").trim()}function ws(f){const p=Vt(f);if(!p)return null;if(f.method==="turn/started")return{threadId:p,activity:{label:"Thinking",details:[]}};if(f.method==="item/started"){const v=He(f.params),b=He(v==null?void 0:v.item),B=xe(b==null?void 0:b.type).toLowerCase();if(B==="reasoning")return{threadId:p,activity:{label:"Thinking",details:[]}};if(B==="agentmessage")return{threadId:p,activity:{label:"Writing response",details:[]}};if(B==="commandexecution"){const U=xe(b==null?void 0:b.command);return{threadId:p,activity:{label:"Running command",details:U?[U]:[]}}}if(B==="filechange"){const W=(Array.isArray(b==null?void 0:b.changes)?b.changes:[])[0],J=xe(W==null?void 0:W.path);return{threadId:p,activity:{label:"Applying changes",details:J?[J]:[]}}}}return f.method==="item/commandExecution/outputDelta"?{threadId:p,activity:{label:"Running command",details:[]}}:f.method==="item/fileChange/outputDelta"?{threadId:p,activity:{label:"Applying changes",details:[]}}:f.method==="item/reasoning/summaryTextDelta"||f.method==="item/reasoning/summaryPartAdded"?{threadId:p,activity:{label:"Thinking",details:[]}}:f.method==="item/agentMessage/delta"?{threadId:p,activity:{label:"Writing response",details:[]}}:null}function pu(f){if(f.method!=="turn/started")return null;const p=He(f.params);if(!p)return null;const v=Vt(f);if(!v)return null;const b=He(p.turn),B=xe(b==null?void 0:b.id)||xe(p.turnId)||`${v}:unknown`;if(!B)return null;const U=es(xe(b==null?void 0:b.startedAt))??es(xe(p.startedAt))??es(f.atIso)??Date.now();return{threadId:v,turnId:B,startedAtMs:U}}function hu(f){if(f.method!=="turn/completed")return null;const p=He(f.params);if(!p)return null;const v=Vt(f);if(!v)return null;const b=He(p.turn),B=xe(b==null?void 0:b.id)||xe(p.turnId)||`${v}:unknown`;if(!B)return null;const U=es(xe(b==null?void 0:b.completedAt))??es(xe(p.completedAt))??es(f.atIso)??Date.now(),W=es(xe(b==null?void 0:b.startedAt))??es(xe(p.startedAt))??void 0;return{threadId:v,turnId:B,completedAtMs:U,startedAtMs:W}}function Ss(f){return`${f}:live-reasoning`}function Qi(f){const p=r.value[f]??[];let v=-1;for(const b of p)typeof b.turnIndex=="number"&&Number.isFinite(b.turnIndex)&&(v=Math.max(v,b.turnIndex));return v+1}function fl(f,p,v){if(!f||!p||!Number.isInteger(v)||v<0)return;const b=H.value[f]??{};b[p]!==v&&(H.value={...H.value,[f]:{...b,[p]:v}})}function mu(f,p){const v=H.value[f]??{},b=Object.entries(v),B=Object.entries(p);b.length===B.length&&b.every(([U,W])=>p[U]===W)||(H.value={...H.value,[f]:{...p}})}function gu(f){const p=l.value[f];if(!p||p.length===0)return;const v=H.value[f]??{};let b=!1;const B=p.map(U=>{if(typeof U.turnIndex=="number"||!U.turnId)return U;const W=v[U.turnId];return typeof W!="number"?U:(b=!0,{...U,turnIndex:W})});b&&(l.value={...l.value,[f]:B})}function pl(f){const p=He(f.params);if(!p)return"";if(f.method==="item/started"){const v=He(p.item);return!v||v.type!=="reasoning"?"":xe(v.id)}return""}function hl(f){const p=He(f.params);if(!p)return null;if(f.method==="item/reasoning/summaryTextDelta"){const v=xe(p.itemId),b=xe(p.delta);return!v||!b?null:{messageId:Ss(v),delta:b}}return null}function vu(f){const p=He(f.params);if(!p)return"";if(f.method==="item/reasoning/summaryPartAdded"){const v=xe(p.itemId);return v?Ss(v):""}return""}function _u(f){const p=He(f.params);if(!p)return"";if(f.method==="item/completed"){const v=He(p.item);return!v||v.type!=="reasoning"?"":Ss(xe(v.id))}return""}function yu(f){const p=He(f.params);if(!p)return"";if(f.method==="item/started"){const v=He(p.item);return!v||v.type!=="agentMessage"?"":xe(v.id)}return""}function ml(f){const p=He(f.params);if(!p)return null;if(f.method==="item/agentMessage/delta"){const v=xe(p.itemId),b=xe(p.delta);return!v||!b?null:{messageId:v,delta:b}}return null}function Zi(f){const p=He(f.params);if(!p)return null;if(f.method==="item/completed"){const v=He(p.item);if(!v||v.type!=="agentMessage")return null;const b=xe(v.id),B=xe(v.text);return!b||!B?null:{id:b,role:"assistant",text:B,messageType:"agentMessage.live"}}return null}function Ko(f){var Be;if(f.method!=="item/started")return null;const p=He(f.params),v=He(p==null?void 0:p.item);if(!v||v.type!=="commandExecution")return null;const b=xe(v.id),B=xe(v.command);if(!b)return null;const U=typeof v.cwd=="string"?v.cwd:null,W=Vt(f),J=xe(p==null?void 0:p.turnId)||xe(p==null?void 0:p.turn_id),ae=W&&J?(Be=H.value[W])==null?void 0:Be[J]:void 0;return{id:b,role:"system",text:B,messageType:"commandExecution",commandExecution:{command:B,cwd:U,status:"inProgress",aggregatedOutput:"",exitCode:null},turnId:J||void 0,turnIndex:typeof ae=="number"?ae:void 0}}function bu(f){if(f.method!=="item/commandExecution/outputDelta")return null;const p=He(f.params);if(!p)return null;const v=xe(p.itemId),b=xe(p.delta);return!v||!b?null:{itemId:v,delta:b}}function wu(f){var an;if(f.method!=="item/completed")return null;const p=He(f.params),v=He(p==null?void 0:p.item);if(!v||v.type!=="commandExecution")return null;const b=xe(v.id),B=xe(v.command);if(!b)return null;const U=typeof v.cwd=="string"?v.cwd:null,W=xe(v.status),J=W==="failed"?"failed":W==="declined"?"declined":W==="interrupted"?"interrupted":"completed",ae=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",Be=typeof v.exitCode=="number"?v.exitCode:null,ze=Vt(f),pt=xe(p==null?void 0:p.turnId)||xe(p==null?void 0:p.turn_id),yt=ze&&pt?(an=H.value[ze])==null?void 0:an[pt]:void 0;return{id:b,role:"system",text:B,messageType:"commandExecution",commandExecution:{command:B,cwd:U,status:J,aggregatedOutput:ae,exitCode:Be},turnId:pt||void 0,turnIndex:typeof yt=="number"?yt:void 0}}function Su(f){var Be;if(f.method!=="item/completed")return null;const p=He(f.params),v=He(p==null?void 0:p.item);if(!v||v.type!=="fileChange")return null;const b=xe(v.id);if(!b)return null;const B=xe(p==null?void 0:p.threadId),U=xe(p==null?void 0:p.turnId),W=B&&U?(Be=H.value[B])==null?void 0:Be[U]:void 0,J=ow(v.changes),ae=rw(v.status);return J.length===0||ae!=="completed"?null:{id:b,role:"system",text:"",messageType:"fileChange",fileChangeStatus:ae,fileChanges:J,turnId:U||void 0,turnIndex:typeof W=="number"?W:void 0}}function ea(f,p){const v=a.value[f]??[],b=Yl(v,p);b!==v&&(a.value={...a.value,[f]:b})}function Tu(f,p){const v=a.value[f];if(!v||v.length===0)return;const b=new Set(p.map(U=>U.id)),B=v.filter(U=>!b.has(U.id));B.length!==v.length&&(B.length===0?a.value=Dt(a.value,f):a.value={...a.value,[f]:B})}function ta(f,p){const v=l.value[f];if(!v||v.length===0)return;const b=new Set(p.map(J=>J.id)),B=new Set(p.filter(J=>J.messageType==="fileChange"&&typeof J.turnId=="string"&&J.turnId.length>0).map(J=>J.turnId)),U=new Set(p.filter(J=>J.messageType==="fileChange"&&typeof J.turnIndex=="number").map(J=>J.turnIndex)),W=v.filter(J=>!b.has(J.id)&&!(J.turnId&&B.has(J.turnId))&&!(typeof J.turnIndex=="number"&&U.has(J.turnIndex)));W.length!==v.length&&(W.length===0?l.value=Dt(l.value,f):l.value={...l.value,[f]:W})}function Eu(f){if(f.method==="item/agentMessage/delta")return!0;const p=He(f.params);if(!p)return!1;if(f.method==="item/completed"){const v=He(p.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function ku(f){var So,xs,io,sa,Al;if(Cn(f))return;if(f.method==="account/rateLimits/updated"&&Tr(),f.method==="thread/name/updated"){const Ze=He(f.params),hn=xe(Ze==null?void 0:Ze.threadId),ao=xe(Ze==null?void 0:Ze.threadName);hn&&ao&&(ke.value={...ke.value,[hn]:ao},Ut(),Bd(hn,ao))}if(f.method==="account/rateLimits/updated"){bn(aw(f.params));return}const p=Dn(f);if(p){ut(p.threadId,p.usage);return}const v=ws(f);v&&ft(v.threadId,v.activity);const b=Vt(f),B=Cr(f);!B&&b&&fn(b);const U=pu(f);U&&(Ue.set(U.turnId,U),fl(U.threadId,U.turnId,Qi(U.threadId)),ye.value={...ye.value,[U.threadId]:U.turnId},Ln(U.threadId),kn(U.threadId),Yt(U.threadId,null),_t(U.threadId,null),$t(U.threadId,!0),h.value[U.threadId]&&(h.value=Dt(h.value,U.threadId)));const W=hu(f),J=Jt(f),ae=(W==null?void 0:W.threadId)??Vt(f),Be=ae?Oe(ae):"",ze=!!ae&&!!J&&Be!==Vr&&Kl(new Error(J));if(W){ue.value[W.threadId];const Ze=Ue.get(W.turnId);Ze&&Ue.delete(W.turnId);const hn=Et((So=He(f.params))==null?void 0:So.durationMs)??Et((io=He((xs=He(f.params))==null?void 0:xs.turn))==null?void 0:io.durationMs)??(typeof W.startedAtMs=="number"?W.completedAtMs-W.startedAtMs:null)??(Ze?W.completedAtMs-Ze.startedAtMs:null),ao=typeof hn=="number"?Math.max(0,hn):0;Yt(W.threadId,{turnId:W.turnId,durationMs:ao}),ye.value[W.threadId]&&(ye.value=Dt(ye.value,W.threadId)),$t(W.threadId,!1),ft(W.threadId,null),Sn(W.threadId),ze||(wr(W.threadId),Sl(W.threadId))}if(J){const Ze=(W==null?void 0:W.threadId)||Vt(f);Ze&&_t(Ze,J),ge.value=J,Ze&&ze&&zt(Ze)}else W&&_t(W.threadId,null);if(B){const Ze=b,hn=Ze?Oe(Ze):I.value.trim();Ze&&_t(Ze,B.message,{transient:B.transient}),ge.value=B.message,hn!==Vr&&Kl(new Error(B.message))&&(Ze?zt(Ze):fr())}const pt=un(f);pt&&(Ur(pt.threadId,pt.message),ft(pt.threadId,{label:"Planning",details:((sa=pt.message.plan)==null?void 0:sa.steps.map(Ze=>Ze.step).slice(0,2))??[]}));const yt=Yn(f);if(yt&&(Ur(yt.threadId,yt.message),ft(yt.threadId,{label:"Planning",details:[]})),!b||b!==n.value)return;yu(f);const an=ml(f);if(an){const Ze=(s.value[b]??[]).find(ao=>ao.id===an.messageId),hn=`${(Ze==null?void 0:Ze.text)??""}${an.delta}`;Kn(b,{id:an.messageId,role:"assistant",text:hn,messageType:"agentMessage.live"})}const si=Zi(f);si&&Kn(b,si),pl(f);const ii=hl(f);if(ii&&Tn(b,ii.delta),vu(f)){const Ze=i.value[b]??"";Ze.trim().length>0&&!Ze.endsWith(`
|
|
550
|
+
|
|
551
|
+
`)&&rr(b,`${Ze}
|
|
552
|
+
|
|
553
|
+
`)}_u(f);const Jo=Ko(f);Jo&&(ea(b,Jo),ft(b,{label:"Running command",details:[((Al=Jo.commandExecution)==null?void 0:Al.command)??""]}));const Es=bu(f);if(Es){const Ze=(a.value[b]??[]).find(hn=>hn.id===Es.itemId);Ze!=null&&Ze.commandExecution&&ea(b,{...Ze,commandExecution:{...Ze.commandExecution,aggregatedOutput:`${Ze.commandExecution.aggregatedOutput}${Es.delta}`}})}const ks=wu(f);ks&&ea(b,ks);const Cs=Su(f);if(Cs&&An(b,Cs),Eu(f)&&(se&&n.value&&zn(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),En(b)),f.method==="turn/completed"){se=!1,En(b),a.value[b]&&(a.value=Dt(a.value,b));const Ze=Vt(f);Ze&&($t(Ze,!1),ft(Ze,null),Sn(Ze),ze||(wr(Ze),Sl(Ze)))}}function Cu(f){if(f.method==="thread/tokenUsage/updated")return;const p=Vt(f);p&&ie.add(p);const v=f.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(oe=!0),!(q!==null||typeof window>"u")&&(q=window.setTimeout(()=>{q=null,Wr()},Wd))}async function xu(f){if(!pe){pe=!0;try{const p=await Ls(),v=[];for(const b of p.order){const B=ts(b);v.includes(B)||v.push(B)}if(v.length>0){const b=Gl(v,f);ss(Z.value,b)||(Z.value=b,pi(Z.value))}if(Object.keys(p.labels).length>0){const b={...de.value};let B=!1;for(const[U,W]of Object.entries(p.labels)){const J=ts(U);b[J]!==W&&(b[J]=W,B=!0)}B&&(de.value=b,Kd(b))}}catch{}}}async function Iu(){if(!(Object.keys(ke.value).length>0))try{const f=await q$();Object.keys(f.titles).length>0&&(ke.value=f.titles)}catch{}}async function Au(f,p,v){if(ke.value[f])return;const b=p.trim();if(!b)return;const B=b.length>300?b.slice(0,300):b;try{const U=await z$(B,v);if(!U||ke.value[f])return;ke.value={...ke.value,[f]:U},Ut(),Bd(f,U)}catch{}}async function gl(f){try{const p=await Ls();if(p.order.length===0)return f;const v=new Set(p.order.map(b=>ts(b)));return f.filter(b=>v.has(b.projectName))}catch{return f}}async function Ts(){var p;k.value||(Je.value=!0);const f=performance.now();try{const[v]=await bf({name:"loadThreads",op:"ui.load.threads"},()=>Promise.all([i$(),Iu()]));await xu(v);const b=await gl(v),B=Gl(Z.value,b);ss(Z.value,B)||(Z.value=B,pi(Z.value));const U=Yd(b,Z.value),W=ZF(t.value,U,c.value);t.value=Jl(t.value,W),c.value=mn(c.value,new Set(fo(t.value).map(ze=>ze.id))),Ut(),k.value=!0;const J=fo(e.value);Br(J),J.some(ze=>ze.id===n.value)||tt(((p=J[0])==null?void 0:p.id)??"");const Be=Math.round(performance.now()-f);yr({category:"threads",message:`loaded ${J.length} threads in ${Be}ms`,data:{projectCount:b.length},level:"info"})}finally{Je.value=!1}}async function ir(f,p={}){var U;if(!f)return;const v=Te.value[f]===!0,b=p.silent!==!0&&!v;b&&(st.value=!0);const B=performance.now();try{const J=fe.value[f]!==!0?Dd(f):null,ae=Kg(f),[Be,ze]=await bf({name:"thread.loadMessages",op:"ui.load",attributes:{threadId:f,silent:p.silent??!1}},()=>Promise.all([J,ae]));Be&&(Pt(f,Be.model),fe.value={...fe.value,[f]:!0});const{messages:pt,inProgress:yt,activeTurnId:an,turnIndexByTurnId:si}=ze;mu(f,si),gu(f);const ii=r.value[f]??[],Il=BF(ii,pt,{preserveMissing:p.silent===!0});Nn(f,Il);const Jo=s.value[f]??[],Es=HF(Jo,pt);pn(f,Es),Tu(f,pt),ta(f,pt),Te.value={...Te.value,[f]:!0};const ks=hr(f);ks&&(_e.value={..._e.value,[f]:ks}),$t(f,yt),an?ye.value={...ye.value,[f]:an}:ye.value[f]&&(ye.value=Dt(ye.value,f)),yt||Er(f),wn(f);const Cs=Math.round(performance.now()-B),So=Ee.value.find(io=>io.id===f),xs=((U=So==null?void 0:So.cwd)==null?void 0:U.split("/").pop())??"unknown";z1("thread",{id:f,messageCount:pt.length,loadMs:Cs,projectFolder:xs}),yr({category:"thread",message:`loaded ${pt.length} msgs in ${Cs}ms`,data:{threadId:f,projectFolder:xs},level:"info"})}finally{b&&(st.value=!1)}}async function vl(f,p={}){f&&Te.value[f]!==!0&&await ir(f,p)}async function Yo(){var f,p;try{const v=((p=(f=De.value)==null?void 0:f.cwd)==null?void 0:p.trim())??"";We.value=await G$(v?[v]:void 0)}catch{}}async function _l(){try{bn(await Jg())}catch{}}async function Ru(f={}){ge.value="";const p=f.includeSelectedThreadMessages!==!1,v=f.awaitAncillaryRefreshes===!0;try{await Ts();const b=Promise.allSettled([no(),qn(),Sr(),Yo(),_l()]).then(()=>{});p&&await ir(n.value),v&&await b}catch(b){ge.value=b instanceof Error?b.message:"Unknown application error"}}async function Mu(f){tt(f);try{await Promise.all([ir(f),Yo()])}catch(p){ge.value=p instanceof Error?p.message:"Unknown application error"}}async function Pu(f){try{await y$(f),await Ts(),n.value===f&&await ir(n.value)}catch(p){ge.value=p instanceof Error?p.message:"Unknown application error"}}async function yl(f,p){const v=p.trim();if(!(!f||!v))try{await b$(f,v),ke.value={...ke.value,[f]:v},Ut(),Bd(f,v)}catch(b){ge.value=b instanceof Error?b.message:"Unknown application error"}}async function $u(f){var W,J;const p=f.trim();if(!p)return"";const v=fo(t.value).find(ae=>ae.id===p),b=((W=v==null?void 0:v.cwd)==null?void 0:W.trim())??"",B=((J=v==null?void 0:v.title)==null?void 0:J.trim())??"Forked chat",U=Oe(p);ge.value="";try{const ae=await Qg(p,b||void 0,U||void 0),Be=ae.threadId.trim();return Be?(pr(Be,b,B),Pt(Be,ae.model),fe.value={...fe.value,[Be]:!0},tt(Be),await Ts(),await ir(Be),Be):""}catch(ae){return ge.value=ae instanceof Error?ae.message:"Unknown application error",""}}async function Nu(f,p){var W;const v=f.trim();if(!v||!Number.isInteger(p)||p<0)return"";if(c.value[v]===!0)return ge.value="Finish the current turn before forking from a response.","";if(Te.value[v]!==!0)try{await ir(v)}catch(J){return ge.value=J instanceof Error?J.message:"Unknown application error",""}const b=r.value[v]??[];let B=-1;for(const J of b)typeof J.turnIndex=="number"&&Number.isFinite(J.turnIndex)&&(B=Math.max(B,J.turnIndex));if(B>=0&&p>B)return"";const U=fo(t.value).find(J=>J.id===v)??null;try{ge.value="";const J=await Qg(v),ae=J.threadId.trim();if(!ae)return"";const Be=J.cwd.trim()||((W=U==null?void 0:U.cwd)==null?void 0:W.trim())||"",ze=t4((U==null?void 0:U.title)||(U==null?void 0:U.preview)||"Untitled thread");pr(ae,Be,ze),Pt(ae,J.model),Nn(ae,J.messages),Te.value={...Te.value,[ae]:!0},fe.value={...fe.value,[ae]:!0},Ln(ae),pn(ae,[]),En(ae),a.value[ae]&&(a.value=Dt(a.value,ae)),Yt(ae,null),ft(ae,null),_t(ae,null),$t(ae,!1);const pt=B-p;if(pt>0){const yt=await Od(ae,pt);Nn(ae,yt)}return await yl(ae,ze),tt(ae),Ts().catch(()=>{}),ae}catch(J){return ge.value=J instanceof Error?J.message:"Unknown application error",""}}async function bl(f,p,v=[],b=[],B=[]){if(!f||!p.trim()||v.length>0||b.length>0||B.length>0)return!1;const W=(Re.value[f]??[]).filter(Be=>Be.method==="item/tool/requestUserInput");if(W.length!==1)return!1;const[J]=W,ae=it(J);return ae.length!==1?!1:oa({id:J.id,result:{answers:{[ae[0]]:{answers:[p.trim()]}}}})}async function wl(f,p=[],v=[],b="steer",B=[],U){if(me.value)return;const W=n.value,J=f.trim();if(!W||!J&&p.length===0&&B.length===0||await bl(W,J,p,v,B))return;yr({category:"ui.action",message:"send message",data:{threadId:W,hasImages:p.length>0,skillCount:v.length},level:"info"});const ae=c.value[W]===!0;if(ae&&b==="queue"){const Be=u.value[W]??[],ze=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,pt=[...Be],yt=typeof U=="number"?Math.max(0,Math.min(U,pt.length)):pt.length;pt.splice(yt,0,{id:ze,text:J,imageUrls:p,skills:v,fileAttachments:B,collaborationMode:C.value}),u.value={...u.value,[W]:pt};return}if(ae){se=!0,ri(W,J,p,v,B).catch(Be=>{const ze=Be instanceof Error?Be.message:"Unknown application error";_t(W,ze),ge.value=ze});return}ge.value="",se=!0,Yt(W,null),ft(W,{label:"Thinking",details:Kt(Oe(W),V.value,C.value)}),_t(W,null),$t(W,!0);try{await ri(W,J,p,v,B)}catch(Be){se=!1,$t(W,!1),ft(W,null);const ze=Be instanceof Error?Be.message:"Unknown application error";throw _t(W,ze),ge.value=ze,Be}}async function ni(f,p,v=[],b=[],B=[]){if(me.value)return"";const U=f.trim(),W=p.trim(),J=I.value.trim();if(!U&&v.length===0&&B.length===0)return"";Ke.value=!0,ge.value="";let ae="";try{try{const yt=await Xg(W||void 0,J||void 0);ae=yt.threadId,Pt(ae,yt.model)}catch(yt){if(J&&J!==Vr&&Kl(yt)){await fr();const an=await Xg(W||void 0,Vr);ae=an.threadId,Pt(ae,an.model)}else throw yt}if(!ae)return"";pr(ae,W,U||"[Image]"),fe.value={...fe.value,[ae]:!0},tt(ae),se=!0,Yt(ae,null),ft(ae,{label:"Thinking",details:Kt(I.value,V.value,C.value)}),_t(ae,null),$t(ae,!0);const Be=ae,ze=W||null,pt=U;return ri(ae,U,v,b,B).catch(yt=>{se=!1,$t(ae,!1),ft(ae,null);const an=yt instanceof Error?yt.message:"Unknown application error";_t(ae,an),ge.value=an}).finally(()=>{Ke.value=!1}),Au(Be,pt,ze),ae}catch(Be){se=!1,ae&&($t(ae,!1),ft(ae,null));const ze=Be instanceof Error?Be.message:"Unknown application error";throw ae&&_t(ae,ze),ge.value=ze,Ke.value=!1,Be}}async function ri(f,p,v=[],b=[],B=[]){const U=V.value,W=C.value,J=p.trim(),ae=b.map(ze=>({name:ze.name,path:ze.path})),Be=B.map(ze=>({...ze}));nr(f,{text:J,imageUrls:[...v],skills:ae,fileAttachments:Be,effort:U,collaborationMode:W,fallbackRetried:!1});try{if(fe.value[f]!==!0){const yt=await Dd(f);Pt(f,yt.model)}const ze=Oe(f);let pt="";try{pt=await Fd(f,p,v,ze||void 0,U||void 0,b.length>0?b:void 0,B,W)}catch(yt){if(ze&&ze!==Vr&&Kl(yt))await fr(f),nr(f,{text:J,imageUrls:[...v],skills:ae,fileAttachments:Be,effort:U,collaborationMode:W,fallbackRetried:!0}),pt=await Fd(f,p,v,Vr,U||void 0,b.length>0?b:void 0,B,W);else throw yt}pt&&(ye.value={...ye.value,[f]:pt}),fe.value={...fe.value,[f]:!0},ie.add(f),oe=!0,await Wr(),wo(f)}catch(ze){throw ze}}async function Sl(f){if(d.value[f]===!0)return;const p=u.value[f];if(!p||p.length===0)return;d.value={...d.value,[f]:!0};const[v,...b]=p;u.value=b.length>0?{...u.value,[f]:b}:Dt(u.value,f),Ke.value=!0,ge.value="",se=!0,Yt(f,null),ft(f,{label:"Thinking",details:Kt(Oe(f),V.value,v.collaborationMode)}),_t(f,null),$t(f,!0);try{rn(v.collaborationMode),await ri(f,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{$t(f,!1),ft(f,null)}finally{d.value=Dt(d.value,f),Ke.value=!1}}async function Lu(){const f=n.value;if(!f||c.value[f]!==!0)return;let p=ye.value[f];if(!p){const{activeTurnId:v}=await Kg(f);p=v,p&&(ye.value={...ye.value,[f]:p})}if(!p)throw new Error("Could not determine active turn id for interrupt");Q.value=!0,ge.value="";try{await k$(f,p),$t(f,!1),ft(f,null),_t(f,null),ye.value[f]&&(ye.value=Dt(ye.value,f)),ie.add(f),oe=!0,await Wr()}catch(v){const b=v instanceof Error?v.message:"Failed to interrupt active turn";_t(f,b),ge.value=b}finally{Q.value=!1}}async function Du(f){var J,ae;const p=n.value;if(!p||be.value||!f.trim())return;const v=r.value[p]??[],b=v.find(Be=>Be.turnId===f),B=typeof(b==null?void 0:b.turnIndex)=="number"?b.turnIndex:-1;if(B<0)return;const U=v.reduce((Be,ze)=>typeof ze.turnIndex=="number"&&ze.turnIndex>Be?ze.turnIndex:Be,-1);if(U<0||B>U)return;const W=U-B+1;if(!(W<1)){be.value=!0,ge.value="";try{const Be=((ae=(J=De.value)==null?void 0:J.cwd)==null?void 0:ae.trim())??"";Be&&await w$(p,f,Be);const ze=await Od(p,W);Nn(p,ze),pn(p,[]),En(p),a.value[p]&&(a.value=Dt(a.value,p)),Yt(p,null),ft(p,null),_t(p,null),oe=!0,await Wr()}catch(Be){ge.value=Be instanceof Error?Be.message:"Failed to rollback thread"}finally{be.value=!1}}}let oi=null;async function Tl(f,p){try{const v=await Ls(),b={...v.labels};let B=!1;for(const U of v.order){if(ts(U)!==f)continue;const W=p.trim();W.length===0?b[U]!==void 0&&(delete b[U],B=!0):b[U]!==W&&(b[U]=W,B=!0)}B&&await jd({order:v.order,labels:b,active:v.active})}catch{}}function na(f,p){f.length===0||(de.value[f]??"")===p||(de.value={...de.value,[f]:p},Kd(de.value),oi!==null&&clearTimeout(oi),oi=setTimeout(()=>{oi=null,Tl(f,p)},500))}async function Ou(f){var U;if(f.length===0)return;const p=Z.value.filter(W=>W!==f);if(ss(Z.value,p)||(Z.value=p,pi(Z.value)),t.value=t.value.filter(W=>W.projectName!==f),de.value[f]!==void 0){const W={...de.value};delete W[f],de.value=W,Kd(W)}Ut();const v=fo(e.value);Br(v),v.some(W=>W.id===n.value)||tt(((U=v[0])==null?void 0:U.id)??"");const B=new Set;try{const W=await Ls();for(const J of W.order)ts(J)===f&&B.add(J);for(const J of W.active)ts(J)===f&&B.add(J);for(const J of Object.keys(W.labels))ts(J)===f&&B.add(J)}catch{}if(B.size>0)try{const W=await Ls(),J=W.order.filter(ze=>!B.has(ze)),ae=W.active.filter(ze=>!B.has(ze)),Be=ae.length===0&&J.length>0?[J[0]]:ae;await jd({order:J,labels:YF(W.labels,B),active:Be});return}catch{}await ra()}function Fu(f,p){if(f.length===0||t.value.length===0)return;const v=t.value.map(ae=>ae.projectName),b=v.indexOf(f);if(b===-1)return;const B=Math.max(0,Math.min(p,v.length-1)),U=DF(v,b,B);if(U===v)return;const W=Gl(U,t.value);Z.value=W,pi(Z.value);const J=Yd(t.value,Z.value);t.value=Jl(t.value,J),Ut(),ra()}function El(f){const p=f.trim();if(!p)return;const v=[p,...Z.value.filter(B=>B!==p)];if(ss(Z.value,v))return;Z.value=v,pi(Z.value);const b=Yd(t.value,Z.value);t.value=Jl(t.value,b),Ut(),ra()}async function ra(){var f,p;try{const v=await Ls(),b=new Map;for(const W of v.order){const J=ts(W);b.has(J)||b.set(J,W)}for(const W of t.value){const J=((p=(f=W.threads[0])==null?void 0:f.cwd)==null?void 0:p.trim())??"";J&&b.set(W.projectName,J)}const B=[];for(const W of Z.value){const J=b.get(W);J&&!B.includes(J)&&B.push(J)}for(const W of v.order)B.includes(W)||B.push(W);const U=v.active.filter(W=>B.includes(W));U.length===0&&B.length>0&&U.push(B[0]),await jd({order:B,labels:v.labels,active:U})}catch{}}async function Wr(){if(Qe.value){typeof window<"u"&&q===null&&(q=window.setTimeout(()=>{q=null,Wr()},Wd));return}Qe.value=!0;const f=oe,p=new Set(ie);oe=!1,ie.clear();try{f&&await Ts();const v=n.value;if(!v)return;const b=p.has(v),B=c.value[v]===!0,U=hr(v),W=_e.value[v]??"",J=U.length>0&&U!==W;(b||B||J||f)&&await ir(v,{silent:!0})}catch{}finally{Qe.value=!1,(oe||ie.size>0)&&typeof window<"u"&&q===null&&(q=window.setTimeout(()=>{q=null,Wr()},Wd))}}async function ju(){await kl(),oe=!0,n.value&&ie.add(n.value),await Wr()}function Bu(){typeof window>"u"||x||(kl(),x=f$(f=>{if(f.method==="ready"){Vn(),ju();return}ku(f),Cu(f)}))}async function kl(){try{const p=(await h$()).map(v=>T(v)).filter(v=>v!==null);Nt(p)}catch{}}async function oa(f){try{return await p$(f.id,{result:f.result,error:f.error}),Xt(f.id),!0}catch(p){return ge.value=p instanceof Error?p.message:"Failed to reply to server request",!1}}function Uu(){if(x&&(x(),x=null),oe=!1,ie.clear(),Ue.clear(),q!==null&&typeof window<"u"&&(window.clearTimeout(q),q=null),G!==null&&typeof window<"u"&&(window.clearTimeout(G),G=null),typeof window<"u")for(const f of Y.values())window.clearTimeout(f);Y.clear(),se=!1,r.value={},o.value={},s.value={},i.value={},a.value={},l.value={},H.value={},Se.value={},ee.value={},Ne.value={},ye.value={},u.value={},d.value={},Me.value=null,Pe.value={}}const Hu=le(()=>{const f=n.value;return f?u.value[f]??[]:[]});function ar(f){const p=n.value;if(!p)return;const v=u.value[p];if(!v)return;const b=v.filter(B=>B.id!==f);u.value=b.length>0?{...u.value,[p]:b}:Dt(u.value,p)}function Cl(f){const p=n.value;if(!p)return;const v=u.value[p];if(!v)return;const b=v.find(B=>B.id===f);b&&(ar(f),rn(b.collaborationMode),wl(b.text,b.imageUrls,b.skills,"steer",b.fileAttachments))}function xl(f){tt(f)}return{projectGroups:e,projectDisplayNameById:de,selectedThread:De,selectedThreadTokenUsage:he,selectedThreadScrollState:M,selectedThreadServerRequests:N,selectedLiveOverlay:F,codexQuota:ne,selectedThreadId:n,availableCollaborationModes:w,availableModelIds:g,selectedCollaborationMode:C,selectedModelId:I,selectedReasoningEffort:V,selectedSpeedMode:z,installedSkills:We,accountRateLimitSnapshots:Ye,messages:je,isLoadingThreads:Je,isLoadingMessages:st,isSendingMessage:Ke,isInterruptingTurn:Q,isUpdatingSpeedMode:me,isRollingBack:be,error:ge,refreshAll:Ru,refreshSkills:Yo,selectThread:Mu,loadMessages:ir,ensureThreadMessagesLoaded:vl,setThreadScrollState:zn,archiveThreadById:Pu,renameThreadById:yl,forkThreadById:$u,forkThreadFromTurn:Nu,rollbackSelectedThread:Du,sendMessageToSelectedThread:wl,sendMessageToNewThread:ni,interruptSelectedThreadTurn:Lu,selectedThreadQueuedMessages:Hu,removeQueuedMessage:ar,steerQueuedMessage:Cl,setSelectedCollaborationMode:rn,setSelectedModelId:Tt,setSelectedReasoningEffort:on,updateSelectedSpeedMode:Gt,respondToPendingServerRequest:oa,renameProject:na,removeProject:Ou,reorderProject:Fu,pinProjectToTop:El,startPolling:Bu,stopPolling:Uu,primeSelectedThread:xl}}const r4={class:"sidebar-root"},o4={class:"sidebar-scrollable"},s4=["aria-pressed"],i4={key:1,class:"sidebar-search-bar"},a4={key:0,class:"sidebar-settings-area"},l4={key:0,class:"sidebar-settings-panel"},c4={class:"sidebar-settings-account-section"},u4={class:"sidebar-settings-account-header"},d4={class:"sidebar-settings-account-header-main"},f4=["aria-expanded","title"],p4={class:"sidebar-settings-account-collapse-icon"},h4={class:"sidebar-settings-account-count"},m4=["disabled"],g4={key:0,class:"sidebar-settings-account-error"},v4={key:1,class:"sidebar-settings-account-empty"},_4={key:2,class:"sidebar-settings-account-list"},y4=["title","onMouseenter","onMouseleave"],b4={class:"sidebar-settings-account-main"},w4={class:"sidebar-settings-account-email"},S4={class:"sidebar-settings-account-meta"},T4={class:"sidebar-settings-account-quota"},E4={class:"sidebar-settings-account-id"},k4={class:"sidebar-settings-account-actions"},C4=["disabled","onClick"],x4=["disabled","onClick"],I4=["title"],A4=["title"],R4={class:"sidebar-settings-value"},M4=["title"],P4={class:"sidebar-settings-value"},$4=["title"],N4={class:"sidebar-settings-value"},L4=["title"],D4=["title"],O4=["title"],F4=["title"],j4={class:"sidebar-settings-value"},B4=["data-state","title"],U4=["data-state"],H4={class:"sidebar-settings-context-meta"},q4={class:"sidebar-settings-rate-limits"},W4={class:"sidebar-settings-build-label","aria-label":"Worktree name and version"},V4={class:"sidebar-settings-button-version"},z4={class:"content-body"},G4={key:1,class:"content-grid content-grid-home"},K4={class:"new-thread-empty"},Y4=["title"],J4={key:1,class:"new-thread-open-folder"},X4={class:"new-thread-open-folder-current"},Q4=["title"],Z4=["disabled"],e3={class:"new-thread-open-folder-actions"},t3={class:"new-thread-open-folder-toggle"},n3=["aria-pressed","disabled"],r3={key:0,class:"new-thread-open-folder-create"},o3={class:"new-thread-open-folder-create-composer"},s3=["onKeydown"],i3=["disabled"],a3={key:0,class:"new-thread-open-folder-error"},l3={key:1,class:"new-thread-open-folder-error-actions"},c3={class:"new-thread-open-folder-error"},u3=["disabled"],d3={key:2,class:"new-thread-open-folder-status"},f3={key:3,class:"new-thread-open-folder-status"},p3={key:4,class:"new-thread-open-folder-list"},h3=["title","disabled","onClick"],m3={class:"new-thread-open-folder-item-name"},g3=["disabled","onClick"],v3={key:2,class:"new-thread-branch-select"},_3={class:"new-thread-branch-select-help"},y3={class:"worktree-init-status-title"},b3={class:"worktree-init-status-message"},w3={key:4,class:"new-thread-trending"},S3={class:"new-thread-trending-header"},T3={key:0,class:"new-thread-trending-empty"},E3={key:1,class:"new-thread-trending-empty"},k3={key:2,class:"new-thread-trending-list"},C3=["onClick"],x3=["title"],I3={class:"new-thread-trending-tip-name-owner"},A3={class:"new-thread-trending-tip-name-repo"},R3={key:1,class:"new-thread-trending-tip-name-repo"},M3={class:"new-thread-trending-tip-meta"},P3={class:"new-thread-trending-tip-description"},$3={class:"composer-with-queue"},N3={key:2,class:"content-grid"},L3={class:"content-thread"},D3={class:"composer-with-queue"},_v="codex-web-local.sidebar-collapsed.v1",yv="codex-web-local.accounts-section-collapsed.v1",bv="codex-web-local.send-with-enter.v1",wv="codex-web-local.in-progress-send-mode.v1",Sv="codex-web-local.dark-mode.v1",Tv="codex-web-local.dictation-click-to-toggle.v1",Ev="codex-web-local.dictation-auto-send.v1",kv="codex-web-local.dictation-language.v1",Cv="codex-web-local.github-trending-projects.v1",xv="codex-web-local.chat-width.v1",O3=400,F3=Pn({__name:"App",setup(e){const t=Zu(()=>Id(()=>import("./ThreadConversation-qnvp4E2o.js"),__vite__mapDeps([0,1]))),n=Zu(()=>Id(()=>import("./ReviewPane-C5squOEL.js"),__vite__mapDeps([2,3]))),r=Zu(()=>Id(()=>import("./SkillsHub-Crvp1wow.js"),__vite__mapDeps([4,5]))),o="a77f",s="0.1.80",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:c,projectDisplayNameById:u,selectedThread:d,selectedThreadTokenUsage:h,selectedThreadScrollState:g,selectedThreadServerRequests:w,selectedLiveOverlay:E,codexQuota:D,selectedThreadId:C,availableCollaborationModes:I,availableModelIds:V,selectedCollaborationMode:z,selectedModelId:ce,selectedReasoningEffort:re,selectedSpeedMode:Z,installedSkills:de,accountRateLimitSnapshots:_e,messages:Te,isLoadingThreads:fe,isLoadingMessages:H,isSendingMessage:ee,isInterruptingTurn:Se,isUpdatingSpeedMode:Ne,refreshAll:ye,refreshSkills:Re,selectThread:ue,ensureThreadMessagesLoaded:Me,setThreadScrollState:Pe,archiveThreadById:ke,forkThreadById:We,renameThreadById:Ye,forkThreadFromTurn:Je,sendMessageToSelectedThread:st,sendMessageToNewThread:Ke,interruptSelectedThreadTurn:Q,selectedThreadQueuedMessages:me,removeQueuedMessage:be,steerQueuedMessage:ge,setSelectedCollaborationMode:Qe,setSelectedModelId:k,setSelectedReasoningEffort:x,updateSelectedSpeedMode:q,respondToPendingServerRequest:G,renameProject:Y,removeProject:te,reorderProject:oe,pinProjectToTop:ie,startPolling:pe,stopPolling:se,primeSelectedThread:Ue,rollbackSelectedThread:$e}=n4(),Ee=_P(),De=vP(),{isMobile:M}=Kp(),N=j(null),F=j(null),ne=j(null),he=j([]),je=j(!1),Oe=j("trending-daily"),ot=j(null),tt=j(!1);let Tt=!1;const Pt=j(!1),ut=j(""),rn=j("local"),bn=j(""),fr=j([]),nr=j(!1),wr=j({order:[],labels:{}}),zt=j({phase:"idle",title:"",message:""}),on=j(Vw()),Gt=j(""),Sr=j(!1),Kt=j(null),no=j(null);let qn=null;const Tr=j("New Project (1)"),Fr=j(""),wo=j(!1),Wn=j(Gw()),sn=j(!1),jr=j([]),$n=j(null),Ut=j(!1),pr=j(!1),Br=j(null),wn=j([]),Yt=j(!1),$t=j(!1),Sn=j(""),ft=j(""),_t=j(""),fn=j(""),Vn=j(Rl(bv,!0)),hr=j($w()),zn=j(Pw()),Nn=j(Nw()),pn=j(Rl(Tv,!1)),Gn=j(Rl(Ev,!0)),mr=j(qw()),Ur=le(()=>Ww()),Kn=j(Rl(Cv,!1)),An=j(!1),rr=j(""),Tn=j(""),En=j(!1),Ln=j(!1),kn=j(""),Er=j(""),ro=j([]),Lt=j(""),un=j(!1),Yn=j(!1),He=j(!1),xe=j(""),Et=j({configured:!1,active:!1,mappedChats:0,mappedThreads:0,lastError:""}),Hr=j(null),qr=j(!1),or=j(!1);let sr=null,oo=!1,kr=0;const Dn=le(()=>{const m=Ee.params.threadId;return typeof m=="string"?m:""}),Vt=le(()=>{const m=new Set;for(const y of c.value)for(const $ of y.threads)m.add($.id);return m}),Jt=le(()=>Ee.name==="home"),Cr=le(()=>Ee.name==="skills"),T=le(()=>{var m;return Cr.value?"Skills":Jt.value?"New thread":((m=d.value)==null?void 0:m.title)??"Choose a thread"}),R=typeof window<"u"&&(window.location.hostname||window.location.host)||"codexui",L=le(()=>{var y,$;return((($=(y=d.value)==null?void 0:y.title)==null?void 0:$.trim())??"")||R}),K=le(()=>Te.value.filter(m=>{const y=Yw(m.messageType,m.role);return y==="worked"?!0:!(y==="turnActivity.live"||y==="turnError.live"||y==="agentReasoning.live")})),S=le(()=>E.value),P=le(()=>Jt.value?"__new-thread__":C.value),X=le(()=>{const m=w.value;return m.length>0?m[m.length-1]:null}),Ae=le(()=>{var m,y;return Jt.value?ut.value.trim():((y=(m=d.value)==null?void 0:m.cwd)==null?void 0:y.trim())??""}),it=le(()=>{var m;return!Jt.value&&((m=d.value)==null?void 0:m.inProgress)===!0}),qt=le(()=>!Jt.value&&!Cr.value&&C.value.trim().length>0),Xt=le(()=>ee.value||Se.value||it.value||w.value.length>0);function Nt(m){return Number.isFinite(m)?new Intl.NumberFormat("en-US",{notation:m>=1e3?"compact":"standard",maximumFractionDigits:m>=1e5?0:1}).format(Math.max(0,Math.trunc(m))):"0"}function Cn(m){if(!m)return"Waiting for Codex thread/tokenUsage/updated events for this thread.";const y=[`Current context usage: ${m.currentContextTokens.toLocaleString()} tokens`,`Cumulative thread usage: ${m.total.totalTokens.toLocaleString()} tokens`];return typeof m.modelContextWindow=="number"?(y.unshift(`Model context window: ${m.modelContextWindow.toLocaleString()} tokens`),y.push(`Remaining context: ${(m.remainingContextTokens??0).toLocaleString()} tokens`)):y.push("Model context window is unavailable in the latest usage event."),y.join(`
|
|
554
|
+
`)}const so=le(()=>{var y;const m=(y=h.value)==null?void 0:y.remainingContextPercent;return m===null||typeof m!="number"?"pending":m<=10?"danger":m<=25?"warning":"ok"}),ws=le(()=>{const m=h.value;return m?typeof m.remainingContextTokens=="number"?`${Nt(m.remainingContextTokens)} left`:`${Nt(m.currentContextTokens)} used`:"Awaiting data"}),pu=le(()=>{const m=h.value;return m?typeof m.modelContextWindow=="number"?`${Nt(m.currentContextTokens)} used / ${Nt(m.modelContextWindow)}`:"Window size unavailable":"Updates after the next token usage event"}),hu=le(()=>Cn(h.value)),Ss=le(()=>{var ve,Le;const m=[],y=new Set;for(const Fe of wr.value.order){const lt=Fe.trim();!lt||y.has(lt)||(y.add(lt),m.push({value:lt,label:wr.value.labels[lt]||gi(lt)}))}for(const Fe of c.value){const lt=((Le=(ve=Fe.threads[0])==null?void 0:ve.cwd)==null?void 0:Le.trim())??"";!lt||y.has(lt)||(y.add(lt),m.push({value:lt,label:u.value[Fe.projectName]??Fe.projectName}))}const $=ut.value.trim();return $&&!y.has($)&&m.unshift({value:$,label:gi($)}),m}),Qi=le(()=>{const m=bn.value.trim(),y=[...fr.value];return m&&!y.some($=>$.value===m)&&y.unshift({value:m,label:m}),y}),fl=le(()=>{const m=bn.value.trim();if(!m)return"";const y=Qi.value.find($=>$.value===m);return(y==null?void 0:y.label)??m}),mu=le(()=>$n.value??"__detached_head__"),gu=le(()=>{var ve;const m=[{value:"__review__",label:sn.value?"Review (Open)":"Review"}],y=new Set,$=((ve=$n.value)==null?void 0:ve.trim())??"";$?(m.push({value:$,label:$}),y.add($)):(m.push({value:"__detached_head__",label:"Detached HEAD"}),y.add("__detached_head__"));for(const Le of jr.value)!Le.value||y.has(Le.value)||(y.add(Le.value),m.push(Le));return m}),pl=le(()=>kn.value.trim()),hl=le(()=>{const m=rr.value.trim();return!m||m==="."||m===".."?!1:!/[\\/]/u.test(m)}),vu=le(()=>hl.value&&pl.value.trim().length>0&&!Lt.value),_u=le(()=>En.value?"Creating…":"Create"),yu=le(()=>{const m=kn.value.trim(),y=Er.value.trim();return!!(m&&y&&m!==y)}),ml=le(()=>{const m=[];yu.value&&m.push({key:`parent:${Er.value}`,name:"..",path:Er.value,kind:"parent"});for(const y of ro.value)m.push({key:`directory:${y.path}`,name:y.name,path:y.path,kind:"directory"});return m}),Zi=le(()=>{const m=xe.value.trim().toLowerCase();return m?ml.value.filter(y=>y.kind==="parent"||y.name.toLowerCase().includes(m)):ml.value}),Ko=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,bu=le(()=>[{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"}]),wu=le(()=>a[Nn.value].label),Su=le(()=>{const m=a[Nn.value];return{"--chat-column-max":m.columnMax,"--chat-card-max":m.cardMax}}),ea=le(()=>{if(!Et.value.configured)return"Not configured";const m=Et.value.active?"Online":"Configured (offline)",y=`${Et.value.mappedChats} chat(s), ${Et.value.mappedThreads} thread(s)`,$=Et.value.lastError?`, error: ${Et.value.lastError}`:"";return`${m}, ${y}${$}`});vs(()=>{window.addEventListener("keydown",Cl),document.addEventListener("visibilitychange",xl),window.addEventListener("pageshow",f),window.addEventListener("focus",p),Ml(),Ko==null||Ko.addEventListener("change",Ml),Jw(),Tw(),ia(),hn(),ta(),Kn.value&&qu()}),Yc(()=>{window.removeEventListener("keydown",Cl),document.removeEventListener("visibilitychange",xl),window.removeEventListener("pageshow",f),window.removeEventListener("focus",p),Ko==null||Ko.removeEventListener("change",Ml),sr!==null&&(window.clearInterval(sr),sr=null),qn&&(clearTimeout(qn),qn=null),se()}),ct(Gt,m=>{const y=m.trim();if(qn&&(clearTimeout(qn),qn=null),!y){no.value=null;return}qn=setTimeout(()=>{F$(y,1e3).then($=>{Gt.value.trim()===y&&(no.value=$.threadIds)}).catch(()=>{Gt.value.trim()===y&&(no.value=null)})},220)}),ct(wn,()=>{if(typeof window>"u")return;if(!wn.value.some(y=>y.quotaStatus==="loading")){sr!==null&&(window.clearInterval(sr),sr=null);return}sr===null&&(sr=window.setInterval(()=>{oo||(oo=!0,ni({silent:!0}).finally(()=>{oo=!1}))},1500))},{deep:!0});function Tu(){Re()}async function ta(){try{Et.value=await B$()}catch(m){const y=m instanceof Error?m.message:"Failed to load Telegram status";Et.value={configured:!1,active:!1,mappedChats:0,mappedThreads:0,lastError:y}}}function Eu(){Sr.value=!Sr.value,Sr.value?tn(()=>{var m;return(m=Kt.value)==null?void 0:m.focus()}):Gt.value=""}function ku(){var m;Gt.value="",(m=Kt.value)==null||m.focus()}function Cu(m){m.key==="Escape"&&(Sr.value=!1,Gt.value="")}function xu(m){m&&(Ee.name==="thread"&&Dn.value===m||(De.push({name:"thread",params:{threadId:m}}),M.value&&ar(!0)))}async function Iu(m){m&&(C.value!==m&&(await ue(m),await De.push({name:"thread",params:{threadId:m}})),await tn(),Iw())}function Au(m){return m.length>8?m.slice(-8):m}function gl(m){const y=[m.planType||"unknown"];return m.authMode&&y.unshift(m.authMode),y.join(" · ")}function Ts(m){if(!m)return!1;const y=m.toLowerCase();return y.includes("payment required")||/\b402\b/.test(y)}function ir(m){return m.unavailableReason==="payment_required"||Ts(m.quotaError)}function vl(m){return Yt.value||$t.value||Sn.value.length>0||m.isActive&&Sn.value!==m.accountId&&Xt.value}function Yo(m){return ft.value===m.accountId}function _l(m){return _t.value===m.accountId||Yo(m)}function Ru(m){return ir(m)?"Unavailable":m.isActive?"Active":$t.value?"Switching…":"Switch"}function Mu(m){return Sn.value===m.accountId?"Removing…":Yo(m)?"Click again to remove":"Remove"}function Pu(m){_t.value=m}function yl(m){_t.value===m&&(_t.value=""),Sn.value!==m&&ft.value===m&&(ft.value="")}function $u(m){const y=m.quotaSnapshot;if(!y)return null;const $=[y==null?void 0:y.primary,y==null?void 0:y.secondary].filter(Fe=>Fe!==null),ve=$.find(Fe=>Fe.windowMinutes===10080);if(ve)return ve;const Le=$.filter(Fe=>typeof Fe.windowMinutes=="number"&&Fe.windowMinutes>=10080).sort((Fe,lt)=>(Fe.windowMinutes??0)-(lt.windowMinutes??0))[0]??null;return Le||(y.secondary??null)}function Nu(m){if(typeof m!="number"||!Number.isFinite(m))return"";const y=new Date(m*1e3);return`${y.getMonth()+1}月${y.getDate()}日`}function bl(m){var Fe,lt;if(ir(m))return m.quotaError||"402 Payment Required";const y=m.quotaSnapshot,$=$u(m),ve=(y==null?void 0:y.primary)??(y==null?void 0:y.secondary)??null,Le=$??ve;if(Le){const On=Math.max(0,Math.min(100,100-Math.round(Le.usedPercent))),lo=Nu(Le.resetsAt);return lo?`${On}% weekly remaining · ${lo}`:`${On}% weekly remaining`}return(Fe=y==null?void 0:y.credits)!=null&&Fe.unlimited?"Unlimited credits":(lt=y==null?void 0:y.credits)!=null&<.hasCredits&&y.credits.balance?`${y.credits.balance} credits`:m.quotaStatus==="loading"?"Loading quota…":m.quotaStatus==="error"?m.quotaError||"Quota unavailable":m.quotaStatus==="ready"||m.quotaStatus==="idle"?"Quota unavailable":"Fetching account details…"}function wl(m){return[m.email||"Account",gl(m),ir(m)?"Unavailable account":null,bl(m),`Workspace ${m.accountId}`].filter(Boolean).join(`
|
|
555
|
+
`)}async function ni(m={}){try{const y=await m$();wn.value=y.accounts,y.accounts.some($=>$.accountId===_t.value)||(_t.value=""),y.accounts.some($=>$.accountId===ft.value)||(ft.value="")}catch(y){if(m.silent===!0)return;fn.value=y instanceof Error?y.message:"Failed to load accounts"}}async function ri(){if(!(Yt.value||$t.value)){fn.value="",_t.value="",ft.value="",Yt.value=!0;try{const m=await g$();wn.value=m.accounts,se(),pe(),ye({includeSelectedThreadMessages:!0})}catch(m){fn.value=m instanceof Error?m.message:"Failed to refresh accounts"}finally{Yt.value=!1}}}async function Sl(m){if(!($t.value||Yt.value)){if(Xt.value){fn.value="Finish the current turn and pending requests before switching accounts.";return}fn.value="",_t.value="",ft.value="",$t.value=!0;try{const y=await v$(m);wn.value=wn.value.map($=>$.accountId===m?y:{...$,isActive:!1}),se(),pe(),ye({includeSelectedThreadMessages:!0}),ni({silent:!0})}catch(y){fn.value=y instanceof Error?y.message:"Failed to switch account"}finally{$t.value=!1}}}async function Lu(m){if(Yt.value||$t.value||Sn.value.length>0)return;const y=wn.value.find(ve=>ve.accountId===m)??null;if(!y)return;if(ft.value!==m){ft.value=m;return}if(y.isActive&&Xt.value){fn.value="Finish the current turn and pending requests before removing the active account.";return}const $=y.isActive;fn.value="",ft.value="",Sn.value=m;try{const ve=await _$(m);wn.value=ve.accounts,se(),pe(),$&&ye({includeSelectedThreadMessages:!0}),ni({silent:!0})}catch(ve){fn.value=ve instanceof Error?ve.message:"Failed to remove account"}finally{Sn.value=""}}function Du(m){ke(m)}async function oi(m){const y=await We(m);y&&(Jt.value?await De.replace({name:"thread",params:{threadId:y}}):await De.push({name:"thread",params:{threadId:y}}),M.value&&ar(!0))}function Tl(m){const y=m.trim().replace(/\\/gu,"/");return y?y.includes("/.codex/worktrees/")||y.includes("/.git/worktrees/"):!1}function na(m,y=""){var Fe,lt,On;const $=c.value.find(lo=>lo.projectName===m);if(!$)return y.trim();const ve=$.threads.find(lo=>!Tl(lo.cwd));return(((Fe=ve==null?void 0:ve.cwd)==null?void 0:Fe.trim())??((On=(lt=$.threads[0])==null?void 0:lt.cwd)==null?void 0:On.trim())??"")||y.trim()}function Ou(m){var ve,Le;const y=c.value.find(Fe=>Fe.projectName===m),$=na(m,((Le=(ve=y==null?void 0:y.threads[0])==null?void 0:ve.cwd)==null?void 0:Le.trim())??"");$&&(ut.value=$),M.value&&ar(!0),!Jt.value&&De.push({name:"home"})}function Fu(m){var $;let y="";for(const ve of c.value){const Le=ve.threads.find(Fe=>Fe.id===m);if(($=Le==null?void 0:Le.cwd)!=null&&$.trim()){y=Le.cwd.trim();break}}!y||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(y)}`,"_blank","noopener,noreferrer")}function El(){var $;const m=d.value,y=m?na(m.projectName,(($=m.cwd)==null?void 0:$.trim())??""):"";y&&(ut.value=y),M.value&&ar(!0),!Jt.value&&De.push({name:"home"})}function ra(m){Y(m.projectName,m.displayName)}function Wr(m){Ye(m.threadId,m.title)}async function ju(m){await te(m),await ia(),hn()}function Bu(m){oe(m.projectName,m.toIndex)}function kl(m){Pe(m.threadId,m.state)}function oa(m){Uu(m)}async function Uu(m){var ve;const y=await G(m),$=((ve=m.followUpMessageText)==null?void 0:ve.trim())??"";if(!(!y||!$||Jt.value))try{await st($,[],[],"steer",[])}catch{}}async function Hu(m){const y=await Je(m.threadId,m.turnIndex);y&&(await De.push({name:"thread",params:{threadId:y}}),C.value!==y&&await ue(y),M.value&&ar(!0))}function ar(m){on.value!==m&&(on.value=m,zw(m))}function Cl(m){m.defaultPrevented||!m.ctrlKey&&!m.metaKey||m.shiftKey||m.altKey||m.key.toLowerCase()==="b"&&(m.preventDefault(),ar(!on.value))}function xl(){if(!(typeof document>"u")&&M.value){if(document.visibilityState==="hidden"){Hr.value=Date.now(),qr.value=!1;return}v()}}function f(m){m.persisted&&v()}function p(){Ee.name==="home"&&(ia(),hn()),v()}function v(){typeof window>"u"||typeof document>"u"||!M.value||document.visibilityState!=="visible"||qr.value||Hr.value===null||Date.now()-Hr.value<O3||(qr.value=!0,Hr.value=null,b())}async function b(){if(!or.value){or.value=!0;try{await ye({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await zu()}finally{or.value=!1}}}function B(m){const y=m.text;ze();const $=ot.value,ve=m.mode==="queue"&&$&&$.threadId===C.value?$.queueIndex:void 0;if(ot.value=null,Jt.value){Xw(y,m.imageUrls,m.skills,m.fileAttachments);return}st(y,m.imageUrls,m.skills,m.mode,m.fileAttachments,ve)}function U(m){const y=new Intl.NumberFormat().format(m.stars);return m.language?`${m.language} · ★ ${y}`:`★ ${y}`}function W(m){const $=new Set(["search-daily","search-weekly","search-monthly","trending-daily","trending-weekly","trending-monthly"]).has(m)?m:"trending-daily";Oe.value!==$&&(Oe.value=$)}function J(){if(typeof window>"u")return;const m=window.prompt("Telegram bot token");!m||!m.trim()||j$(m.trim()).then(()=>{window.alert("Telegram bot configured. Open the bot DM and send /start."),ta()}).catch(y=>{const $=y instanceof Error?y.message:"Failed to connect Telegram bot";window.alert($),ta()})}function ae(m){const y=N.value;y&&y.hydrateDraft({text:`Clone this GitHub project and run it: ${m.url}
|
|
556
|
+
Then explain what this project does in very simple words a 5th grader can understand.`,imageUrls:[],fileAttachments:[],skills:[]})}function Be(m){const y=me.value.findIndex(Fe=>Fe.id===m),$=y>=0?me.value[y]:void 0,ve=F.value;if(!$||!ve||ve.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;ot.value=C.value?{threadId:C.value,queueIndex:y}:null;const Le={text:$.text,imageUrls:[...$.imageUrls],fileAttachments:$.fileAttachments.map(Fe=>({...Fe})),skills:$.skills.map(Fe=>({...Fe}))};ve.hydrateDraft(Le),be(m)}function ze(){if(!M.value||Jt.value)return;const m=()=>{var y;(y=ne.value)==null||y.jumpToLatest()};m(),tn(()=>{m(),!(typeof window>"u")&&window.requestAnimationFrame(()=>{m(),window.requestAnimationFrame(m)})})}function pt(m){ut.value=m.trim(),Tn.value=""}function yt(m){bn.value=m.trim()}async function an(m){const y=m.trim();if(!y||Ee.name!=="thread"){jr.value=[],$n.value=null;return}Ut.value=!0;try{const $=await P$(y);jr.value=$.options,$n.value=$.currentBranch}catch{jr.value=[],$n.value=null}finally{Ut.value=!1}}function si(m){if(m==="__review__"){sn.value=!sn.value;return}if(m==="__detached_head__"||pr.value)return;const y=m.trim();if(!y||y===($n.value??""))return;const $=Ae.value.trim();$&&(pr.value=!0,$$($,y).then(ve=>($n.value=ve||y,sn.value=!1,an($))).catch(ve=>{const Le=ve instanceof Error?ve.message:"Failed to switch branch";window.alert(Le)}).finally(()=>{pr.value=!1}))}async function ii(){const y=await Ze()||Fr.value.trim()||"/",$=new URLSearchParams,ve=Tr.value.trim();ve&&$.set("newProjectName",ve);const Le=$.toString();window.location.assign(`/codex-local-browse${encodeURI(y)}${Le?`?${Le}`:""}`)}async function Il(){const m=ut.value.trim()||await Ze();m&&(An.value=!1,Ln.value=!0,xe.value="",await ai(m))}function Jo(){kr+=1,Ln.value=!1,un.value=!1,Lt.value="",xe.value="",io()}async function Es(m){!m||un.value||(xe.value="",await ai(m))}function ks(){const m=kn.value.trim();!Ln.value||!m||ai(m)}function Cs(){const m=kn.value.trim();!Ln.value||!m||un.value||ai(m)}async function So(m=kn.value){const y=m.trim();if(y){Lt.value="",Yn.value=!0;try{const $=await ev(y,{createIfMissing:!1,label:""});if(!$){Lt.value="Failed to open the selected folder.";return}ut.value=$,ie(gi($)),await ia(),await hn(),Jo()}catch($){Lt.value=$ instanceof Error?$.message:"Failed to open the selected folder."}finally{Yn.value=!1}}}async function xs(){if(Tn.value="",An.value){io();return}if(!Ln.value){const m=ut.value.trim()||await Ze();if(!m||(Ln.value=!0,xe.value="",await ai(m),Lt.value))return}Lt.value||(rr.value=Tr.value,An.value=!0,tn(()=>{var m;return(m=Br.value)==null?void 0:m.focus()}))}function io(){Tn.value="",rr.value="",An.value=!1}async function sa(){const m=rr.value.trim();if(!m)return;if(Tn.value="",Lt.value){Tn.value="Reload the current folder before creating a new one.";return}En.value=!0;const y=pl.value.trim(),$=kw(Ew(y,m));if(!$){Tn.value="Unable to determine where the new folder should be created.",En.value=!1;return}if(!hl.value){Tn.value="Enter a single folder name.",En.value=!1;return}try{const ve=await L$($);if(!ve){Tn.value="Failed to create the folder.";return}Tn.value="",xe.value="",await ai(ve),io()}catch(ve){Tn.value=ve instanceof Error?ve.message:"Failed to create folder."}finally{En.value=!1}}async function Al(){var y;if(typeof window>"u")return!1;const m=((y=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:y.trim())??"";if(!m)return!1;try{const $=await ev(m,{createIfMissing:!1,label:""});if(!$)return!1;ut.value=$,ie(gi($)),await De.replace({name:"home"}),await ia();const ve=new URL(window.location.href);return ve.searchParams.delete("openProjectPath"),window.history.replaceState({},"",ve.toString()),!0}catch{return!1}}async function Ze(){const m=ao();if(m)return m;try{const y=await Zg();if(y)return Fr.value=y,y}catch{}return""}async function hn(){const m=ao();if(!m){Tr.value="New Project (1)";return}try{const y=await D$(m);Tr.value=y.name||"New Project (1)"}catch{Tr.value="New Project (1)"}}function ao(){var $,ve;const m=ut.value.trim();if(m)return $d(m);const y=((ve=($=Ss.value[0])==null?void 0:$.value)==null?void 0:ve.trim())??"";return y?$d(y):Fr.value.trim()}async function Tw(){try{Fr.value=await Zg()}catch{Fr.value=""}}async function ia(){try{const m=await Ls();wr.value={order:[...m.order],labels:{...m.labels}}}catch{wr.value={order:[],labels:{}}}}async function ai(m){const y=++kr;kn.value=ln(m).trim(),Lt.value="",un.value=!0;try{const $=await N$(m,{showHidden:He.value});if(y!==kr)return;kn.value=$.path,Er.value=$.parentPath,ro.value=$.entries}catch($){if(y!==kr)return;Lt.value=$ instanceof Error?$.message:"Failed to load local folders.",Er.value=$d(kn.value),ro.value=[],io()}finally{y===kr&&(un.value=!1)}}async function qu(){je.value=!0;try{he.value=await H$(Oe.value,6)}catch{he.value=[]}finally{je.value=!1}}function Ew(m,y){const $=ln(m).trim(),ve=ln(y).trim().replace(/^[\\/]+/u,"");if(!$||!ve)return"";const Le=$.includes("\\")&&!$.includes("/")?"\\":"/";if(/^[a-zA-Z]:[\\/]?$/u.test($))return`${$.slice(0,2)}${Le}${ve}`;if(/^\/+$/u.test($))return`/${ve}`;const Fe=$.replace(/[\\/]+$/u,"");return Fe?`${Fe}${Le}${ve}`:""}function kw(m){const y=ln(m).trim();if(!y)return"";const $=y.match(/^\\\\([^\\/]+)[\\/]+([^\\/]+)([\\/].*)?$/u);if($){const[,Le,Fe,lt=""]=$,On=Wu(lt.split(/[\\/]+/u));return On.length>0?`\\\\${Le}\\${Fe}\\${On.join("\\")}`:`\\\\${Le}\\${Fe}`}const ve=y.match(/^([a-zA-Z]:)([\\/].*)?$/u);if(ve){const[,Le,Fe=""]=ve,lt=y.includes("\\")&&!y.includes("/")?"\\":"/",On=Wu(Fe.split(/[\\/]+/u));return On.length>0?`${Le}${lt}${On.join(lt)}`:`${Le}${lt}`}if(y.startsWith("/")){const Le=Wu(y.split("/"));return Le.length>0?`/${Le.join("/")}`:"/"}return y}function Wu(m){const y=[];for(const $ of m){const ve=$.trim();if(!(!ve||ve===".")){if(ve===".."){y.length>0&&y.pop();continue}y.push(ve)}}return y}function eh(m){k(m)}function th(m){x(m)}function nh(m){q(m)}function Cw(){Q()}function xw(m){const y=m.turnId.trim();if(y.length>0){const $=[...K.value].reverse().find(ve=>{var Le;return ve.role==="user"&&(((Le=ve.turnId)==null?void 0:Le.trim())??"")===y&&ve.text.trim().length>0});$!=null&&$.text&&F.value&&F.value.appendTextToDraft($.text)}$e(m.turnId)}function Iw(){if(Jt.value||Cr.value||typeof document>"u"||!d.value||K.value.length===0)return;const m=Aw(),y=Rw(),$=new Blob([m],{type:"text/markdown;charset=utf-8"}),ve=URL.createObjectURL($),Le=document.createElement("a");Le.href=ve,Le.download=y,document.body.appendChild(Le),Le.click(),document.body.removeChild(Le),window.setTimeout(()=>URL.revokeObjectURL(ve),0)}function Aw(){var $,ve,Le;const m=[],y=((ve=($=d.value)==null?void 0:$.title)==null?void 0:ve.trim())||"Untitled thread";m.push(`# ${Mw(y)}`),m.push(""),m.push(`- Exported: ${new Date().toISOString()}`),m.push(`- Thread ID: ${((Le=d.value)==null?void 0:Le.id)??""}`),m.push(""),m.push("---"),m.push("");for(const Fe of K.value){const lt=Fe.role?Fe.role.toUpperCase():"MESSAGE";m.push(`## ${lt}`),m.push("");const On=Fe.text.trim();if(On&&(m.push(On),m.push("")),Fe.commandExecution&&(m.push("```text"),m.push(`command: ${Fe.commandExecution.command}`),m.push(`status: ${Fe.commandExecution.status}`),Fe.commandExecution.cwd&&m.push(`cwd: ${Fe.commandExecution.cwd}`),Fe.commandExecution.exitCode!==null&&m.push(`exitCode: ${Fe.commandExecution.exitCode}`),m.push(Fe.commandExecution.aggregatedOutput||"(no output)"),m.push("```"),m.push("")),Fe.fileAttachments&&Fe.fileAttachments.length>0){m.push("Attachments:");for(const lo of Fe.fileAttachments)m.push(`- ${lo.path}`);m.push("")}if(Fe.images&&Fe.images.length>0){m.push("Images:");for(const lo of Fe.images)m.push(`- ${lo}`);m.push("")}}return`${m.join(`
|
|
557
|
+
`).trimEnd()}
|
|
558
|
+
`}function Rw(){var Le,Fe;const $=(((Fe=(Le=d.value)==null?void 0:Le.title)==null?void 0:Fe.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",ve=new Date().toISOString().replace(/[:.]/g,"-");return`${$}-${ve}.md`}function Mw(m){return m.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function Rl(m,y){if(typeof window>"u")return y;const $=window.localStorage.getItem(m);return $===null?y:$==="1"}function Pw(){if(typeof window>"u")return"system";const m=window.localStorage.getItem(Sv);return m==="light"||m==="dark"?m:"system"}function $w(){return typeof window>"u"?"steer":window.localStorage.getItem(wv)==="queue"?"queue":"steer"}function Nw(){if(typeof window>"u")return"standard";const m=window.localStorage.getItem(xv);return m==="standard"||m==="wide"||m==="extra-wide"?m:"standard"}function Lw(){Vn.value=!Vn.value,window.localStorage.setItem(bv,Vn.value?"1":"0")}function Dw(){hr.value=hr.value==="steer"?"queue":"steer",window.localStorage.setItem(wv,hr.value)}function Ow(){const m=["system","light","dark"],y=m.indexOf(zn.value);zn.value=m[(y+1)%m.length],window.localStorage.setItem(Sv,zn.value),Ml()}function Fw(){const m=["standard","wide","extra-wide"],y=m.indexOf(Nn.value);Nn.value=m[(y+1)%m.length],window.localStorage.setItem(xv,Nn.value)}function jw(){pn.value=!pn.value,window.localStorage.setItem(Tv,pn.value?"1":"0")}function Bw(){Gn.value=!Gn.value,window.localStorage.setItem(Ev,Gn.value?"1":"0")}function Uw(){Kn.value=!Kn.value,window.localStorage.setItem(Cv,Kn.value?"1":"0")}function Hw(m){const $=Vu(m.trim())||"auto";mr.value=$,window.localStorage.setItem(kv,$)}function qw(){var $;if(typeof window>"u")return"auto";const m=(($=window.localStorage.getItem(kv))==null?void 0:$.trim())||"auto";return Vu(m)||"auto"}function Ww(){const m=[{value:"auto",label:"Auto-detect"}],y=new Set(["auto"]);function $(Le){const Fe=l[Le]||Le;return`${Fe.charAt(0).toUpperCase()+Fe.slice(1)} (${Le})`}for(const Le of typeof navigator<"u"?navigator.languages??[]:[]){const Fe=Vu(Le);!Fe||y.has(Fe)||(y.add(Fe),m.push({value:Fe,label:`Preferred: ${$(Fe)}`}))}for(const Le of Object.keys(l))y.has(Le)||(y.add(Le),m.push({value:Le,label:$(Le)}));const ve=mr.value.trim();return ve&&!y.has(ve)&&m.push({value:ve,label:$(ve)}),m}function Vu(m){const y=m.trim().toLowerCase();if(!y||y==="auto")return"";if(y in l)return y;const $=y.split("-")[0]??y;return $ in l?$:""}function Ml(){const m=document.documentElement;if(zn.value==="dark")m.classList.add("dark");else if(zn.value==="light")m.classList.remove("dark");else{const y=window.matchMedia("(prefers-color-scheme: dark)").matches;m.classList.toggle("dark",y)}}function Vw(){return typeof window>"u"?!1:window.localStorage.getItem(_v)==="1"}function zw(m){typeof window>"u"||window.localStorage.setItem(_v,m?"1":"0")}function Gw(){if(typeof window>"u")return!0;const m=window.localStorage.getItem(yv);return m===null?!0:m==="1"}function Kw(){Wn.value=!Wn.value,!(typeof window>"u")&&window.localStorage.setItem(yv,Wn.value?"1":"0")}function Yw(m,y){const $=(m??"").trim();return $.length>0?$:y.trim()||"message"}function rh(m){Qe(m)}async function Jw(){await De.isReady(),Ee.name==="thread"&&Dn.value&&Ue(Dn.value),pe(),await ye({includeSelectedThreadMessages:!0}),ni({silent:!0}),await Al(),Pt.value=!0,await zu()}async function zu(){if(tt.value){Tt=!0;return}tt.value=!0;try{do{if(Tt=!1,Ee.name==="home"||Ee.name==="skills"){C.value!==""&&await ue("");continue}if(Ee.name==="thread"){const m=Dn.value;if(!m)continue;if(!Vt.value.has(m)){await De.replace({name:"home"});continue}C.value!==m?await ue(m):Me(m,{silent:!0})}}while(Tt)}finally{tt.value=!1}}ct(()=>[Ee.name,Dn.value,fe.value,Vt.value.has(Dn.value),C.value],async()=>{Pt.value&&await zu()}),ct(()=>C.value,async m=>{if(Pt.value&&!tt.value&&!(Jt.value||Cr.value)){if(!m){Ee.name!=="home"&&await De.replace({name:"home"});return}Ee.name==="thread"&&Dn.value===m||await De.replace({name:"thread",params:{threadId:m}})}}),ct(()=>Oe.value,()=>{Kn.value&&qu()}),ct(()=>Kn.value,m=>{if(!m){he.value=[];return}qu()}),ct(()=>[Pt.value,Ee.name,C.value],([m,y,$])=>{m&&y==="thread"&&$&&Me($,{silent:!0})}),ct(()=>Ss.value,m=>{if(m.length===0){ut.value="";return}m.some($=>$.value===ut.value)||(ut.value=m[0].value),hn()},{immediate:!0}),ct(()=>ut.value,()=>{zt.value={phase:"idle",title:"",message:""},hn()}),ct(()=>[rn.value,ut.value],([m,y])=>{m==="worktree"&&oh(y)},{immediate:!0}),ct(()=>rn.value,m=>{var y;if(m==="local"){zt.value={phase:"idle",title:"",message:""};const $=ut.value.trim();if($&&Tl($)){const ve=((y=d.value)==null?void 0:y.projectName)??gi($),Le=na(ve,"");Le&&(ut.value=Le)}return}oh(ut.value)}),ct(()=>Ee.name,m=>{m!=="home"&&(zt.value={phase:"idle",title:"",message:""}),m!=="thread"&&(sn.value=!1)}),ct(()=>C.value,()=>{zt.value={phase:"idle",title:"",message:""}}),ct(()=>[Ee.name,Ae.value],([m,y])=>{if(m!=="thread"){jr.value=[],$n.value=null;return}an(y)},{immediate:!0}),ct(L,m=>{typeof document>"u"||(document.title=m)},{immediate:!0}),ct(M,m=>{m&&!on.value&&ar(!0)});async function Xw(m,y=[],$=[],ve=[]){try{zt.value={phase:"idle",title:"",message:""};let Le=ut.value;if(rn.value==="worktree"){zt.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const lt=await R$(ut.value,bn.value);Le=lt.cwd,ut.value=lt.cwd,zt.value={phase:"idle",title:"",message:""}}catch{zt.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Fe=await Ke(m,Le,y,$,ve);if(!Fe)return;await De.replace({name:"thread",params:{threadId:Fe}}),ze()}catch{}}async function oh(m){var $;const y=m.trim();if(!y){fr.value=[],bn.value="";return}nr.value=!0;try{const ve=await M$(y);fr.value=ve;const Le=bn.value.trim();if(!(Le.length>0&&ve.some(lt=>lt.value===Le))){const lt=ve.find(On=>On.value.trim()==="main");bn.value=(lt==null?void 0:lt.value)??(($=ve[0])==null?void 0:$.value)??""}}catch{fr.value=[],bn.value=""}finally{nr.value=!1}}return(m,y)=>(A(),bt(EP,{"is-sidebar-collapsed":on.value,onCloseSidebar:y[11]||(y[11]=$=>ar(!0))},{sidebar:It(()=>[_("section",r4,[_("div",o4,[on.value?Ce("",!0):(A(),bt(lv,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":on.value,"show-new-thread-button":!0,onToggleSidebar:y[0]||(y[0]=$=>ar(!on.value)),onStartNewThread:El},{default:It(()=>[_("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":Sr.value,"aria-label":"Search threads",title:"Search threads",onClick:Eu},[Ge(cv,{class:"sidebar-search-toggle-icon"})],8,s4)]),_:1},8,["is-sidebar-collapsed"])),!on.value&&Sr.value?(A(),O("div",i4,[Ge(cv,{class:"sidebar-search-bar-icon"}),Kr(_("input",{ref_key:"sidebarSearchInputRef",ref:Kt,"onUpdate:modelValue":y[1]||(y[1]=$=>Gt.value=$),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Cu},null,544),[[yo,Gt.value]]),Gt.value.length>0?(A(),O("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:ku},[Ge(SF,{class:"sidebar-search-clear-icon"})])):Ce("",!0)])):Ce("",!0),on.value?Ce("",!0):(A(),O("button",{key:2,class:ht(["sidebar-skills-link",{"is-active":Cr.value}]),type:"button",onClick:y[2]||(y[2]=$=>{qe(De).push({name:"skills"}),qe(M)&&ar(!0)})}," Skills Hub ",2)),on.value?Ce("",!0):(A(),bt(jN,{key:3,groups:qe(c),"project-display-name-by-id":qe(u),"selected-thread-id":qe(C),"is-loading":qe(fe),"search-query":Gt.value,"search-matched-thread-ids":no.value,onSelect:xu,onArchive:Du,onStartNewThread:Ou,onRenameProject:ra,onBrowseThreadFiles:Fu,onRenameThread:Wr,onForkThread:oi,onRemoveProject:ju,onReorderProject:Bu,onExportThread:Iu},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),on.value?Ce("",!0):(A(),O("div",a4,[Ge(B_,{name:"settings-panel"},{default:It(()=>[wo.value?(A(),O("div",l4,[_("div",c4,[_("div",u4,[_("div",d4,[_("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!Wn.value,title:Wn.value?"Expand accounts":"Collapse accounts",onClick:Kw},[_("span",p4,we(Wn.value?"▸":"▾"),1)],8,f4),y[12]||(y[12]=_("span",{class:"sidebar-settings-account-title"},"Accounts",-1)),_("span",h4,we(wn.value.length),1)]),_("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:Yt.value||$t.value,onClick:ri},we(Yt.value?"Reloading…":"Reload"),9,m4)]),Wn.value?Ce("",!0):(A(),O(et,{key:0},[fn.value?(A(),O("p",g4,we(fn.value),1)):Ce("",!0),wn.value.length===0?(A(),O("p",v4," Run `codex login`, then click reload. ")):(A(),O("div",_4,[(A(!0),O(et,null,Wt(wn.value,$=>(A(),O("article",{key:$.accountId,class:ht(["sidebar-settings-account-item",{"is-active":$.isActive,"is-unavailable":ir($),"is-confirming-remove":Yo($),"is-remove-visible":_l($)}]),title:wl($),onMouseenter:ve=>Pu($.accountId),onMouseleave:ve=>yl($.accountId)},[_("div",b4,[_("p",w4,we($.email||"Account"),1),_("p",S4,we(gl($)),1),_("p",T4,we(bl($)),1),_("p",E4," Workspace "+we(Au($.accountId)),1)]),_("div",k4,[_("button",{class:"sidebar-settings-account-switch",type:"button",disabled:vl($)||$.isActive||ir($),onClick:ve=>Sl($.accountId)},we(Ru($)),9,C4),_("button",{class:ht(["sidebar-settings-account-remove",{"is-visible":_l($),"is-confirming":Yo($)}]),type:"button",disabled:vl($),onClick:ve=>Lu($.accountId)},we(Mu($)),11,x4)])],42,y4))),128))]))],64))]),_("button",{class:"sidebar-settings-row",type:"button",title:i.sendWithEnter,onClick:Lw},[y[13]||(y[13]=_("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),_("span",{class:ht(["sidebar-settings-toggle",{"is-on":!Vn.value}])},null,2)],8,I4),_("button",{class:"sidebar-settings-row",type:"button",title:i.inProgressSendMode,onClick:Dw},[y[14]||(y[14]=_("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),_("span",R4,we(hr.value==="steer"?"Steer":"Queue"),1)],8,A4),_("button",{class:"sidebar-settings-row",type:"button",title:i.appearance,onClick:Ow},[y[15]||(y[15]=_("span",{class:"sidebar-settings-label"},"Appearance",-1)),_("span",P4,we(zn.value==="system"?"System":zn.value==="dark"?"Dark":"Light"),1)],8,M4),_("button",{class:"sidebar-settings-row",type:"button",title:i.chatWidth,onClick:Fw},[y[16]||(y[16]=_("span",{class:"sidebar-settings-label"},"Chat width",-1)),_("span",N4,we(wu.value),1)],8,$4),_("button",{class:"sidebar-settings-row",type:"button",title:i.dictationClickToToggle,onClick:jw},[y[17]||(y[17]=_("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),_("span",{class:ht(["sidebar-settings-toggle",{"is-on":pn.value}])},null,2)],8,L4),_("button",{class:"sidebar-settings-row",type:"button",title:i.dictationAutoSend,onClick:Bw},[y[18]||(y[18]=_("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),_("span",{class:ht(["sidebar-settings-toggle",{"is-on":Gn.value}])},null,2)],8,D4),_("button",{class:"sidebar-settings-row",type:"button",title:i.githubTrendingProjects,onClick:Uw},[y[19]||(y[19]=_("span",{class:"sidebar-settings-label"},"GitHub trending projects",-1)),_("span",{class:ht(["sidebar-settings-toggle",{"is-on":Kn.value}])},null,2)],8,O4),_("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:i.dictationLanguage},[y[20]||(y[20]=_("span",{class:"sidebar-settings-label"},"Dictation language",-1)),Ge(Bs,{class:"sidebar-settings-language-dropdown","model-value":mr.value,options:Ur.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":Hw},null,8,["model-value","options"])],8,F4),_("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:J},[y[21]||(y[21]=_("span",{class:"sidebar-settings-label"},"Telegram",-1)),_("span",j4,we(ea.value),1)]),qt.value?(A(),O("div",{key:0,class:"sidebar-settings-row sidebar-settings-context-row","data-state":so.value,title:hu.value},[y[22]||(y[22]=_("span",{class:"sidebar-settings-label"},"Context",-1)),_("span",{class:"sidebar-settings-context-value","data-state":so.value},[Vs(we(ws.value)+" ",1),_("span",H4,we(pu.value),1)],8,U4)],8,B4)):Ce("",!0),_("div",q4,[Ge(YO,{snapshots:qe(_e)},null,8,["snapshots"])]),_("div",W4," WT "+we(qe(o))+" · v"+we(qe(s)),1)])):Ce("",!0)]),_:1}),_("button",{class:"sidebar-settings-button",type:"button",onClick:y[3]||(y[3]=$=>wo.value=!wo.value)},[Ge(_F,{class:"sidebar-settings-icon"}),y[23]||(y[23]=_("span",null,"Settings",-1)),_("span",V4,we(qe(o))+" · v"+we(qe(s)),1)])]))])]),content:It(()=>[_("section",{class:"content-root",style:Po(Su.value)},[Ge(VN,{title:T.value},{leading:It(()=>[on.value||qe(M)?(A(),bt(lv,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":on.value,"show-new-thread-button":!0,onToggleSidebar:y[4]||(y[4]=$=>ar(!on.value)),onStartNewThread:El},null,8,["is-sidebar-collapsed"])):Ce("",!0)]),actions:It(()=>[qe(Ee).name==="thread"&&qe(C)?(A(),bt(Bs,{key:0,class:ht(["content-header-branch-dropdown",{"is-review-open":sn.value}]),"model-value":mu.value,options:gu.value,disabled:Ut.value||pr.value,"enable-search":!0,"search-placeholder":"Search branches...","onUpdate:modelValue":si},null,8,["class","model-value","options","disabled"])):Ce("",!0)]),_:1},8,["title"]),_("section",z4,[Cr.value?(A(),bt(qe(r),{key:0,onSkillsChanged:Tu})):Jt.value?(A(),O("div",G4,[_("div",K4,[y[30]||(y[30]=_("p",{class:"new-thread-hero"},"Let's build",-1)),Ge(Bs,{class:"new-thread-folder-dropdown","model-value":ut.value,options:Ss.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-mode":"event","add-action-label":"+ Add new project",disabled:!1,"onUpdate:modelValue":pt,onAddAction:ii},null,8,["model-value","options"]),ut.value?(A(),O("p",{key:0,class:"new-thread-folder-selected",title:ut.value}," Selected folder: "+we(ut.value),9,Y4)):Ce("",!0),_("div",{class:"new-thread-folder-actions"},[_("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",onClick:Il}," Select folder ")]),Ln.value?(A(),O("div",J4,[_("div",{class:"new-thread-open-folder-header"},[y[24]||(y[24]=_("p",{class:"new-thread-open-folder-title"},"Select folder",-1)),_("button",{class:"new-thread-open-folder-close",type:"button",onClick:Jo}," Cancel ")]),y[26]||(y[26]=_("p",{class:"new-thread-open-folder-label"},"Current folder",-1)),_("div",X4,[_("p",{class:"new-thread-open-folder-path",title:kn.value||"Unavailable"},we(kn.value||"Unavailable"),9,Q4),_("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",disabled:!kn.value||!!Lt.value||un.value||Yn.value,onClick:y[5]||(y[5]=$=>So())},we(Yn.value?"Opening…":"Open"),9,Z4)]),_("div",e3,[_("label",t3,[Kr(_("input",{"onUpdate:modelValue":y[6]||(y[6]=$=>He.value=$),class:"new-thread-open-folder-toggle-input",type:"checkbox",onChange:ks},null,544),[[wT,He.value]]),y[25]||(y[25]=_("span",null,"Show hidden folders",-1))]),_("button",{class:ht(["new-thread-folder-action",{"new-thread-folder-action-primary":An.value}]),type:"button","aria-pressed":An.value,disabled:!kn.value||un.value||Yn.value||En.value||!!Lt.value&&!An.value,onClick:xs}," New folder ",10,n3)]),An.value?(A(),O("div",r3,[_("div",o3,[Kr(_("input",{ref_key:"createFolderInputRef",ref:Br,"onUpdate:modelValue":y[7]||(y[7]=$=>rr.value=$),class:"new-thread-open-folder-create-input",type:"text",placeholder:"Folder name",onKeydown:[xn(wt(sa,["prevent"]),["enter"]),xn(wt(io,["prevent"]),["esc"])]},null,40,s3),[[yo,rr.value]]),_("button",{class:"new-thread-folder-action new-thread-folder-action-primary new-thread-open-folder-create-submit",type:"button",disabled:!vu.value||En.value,onClick:sa},we(_u.value),9,i3)]),Tn.value?(A(),O("p",a3,we(Tn.value),1)):Ce("",!0)])):Ce("",!0),Kr(_("input",{"onUpdate:modelValue":y[8]||(y[8]=$=>xe.value=$),class:"new-thread-open-folder-filter",type:"text",placeholder:"Filter folders..."},null,512),[[yo,xe.value]]),Lt.value?(A(),O("div",l3,[_("p",c3,we(Lt.value),1),_("button",{class:"new-thread-folder-action",type:"button",disabled:un.value||Yn.value,onClick:Cs}," Retry ",8,u3)])):Ce("",!0),un.value?(A(),O("p",d3,"Loading folders…")):!Lt.value&&Zi.value.length===0?(A(),O("p",f3,we(xe.value.trim()?"No folders match this filter.":"No subfolders found here."),1)):Zi.value.length>0?(A(),O("ul",p3,[(A(!0),O(et,null,Wt(Zi.value,$=>(A(),O("li",{key:$.key,class:"new-thread-open-folder-item"},[_("button",{class:"new-thread-open-folder-item-main",type:"button",title:$.path,disabled:un.value||Yn.value,onClick:ve=>Es($.path)},[_("span",m3,we($.name),1)],8,h3),$.kind==="directory"?(A(),O("button",{key:0,class:"new-thread-open-folder-item-open",type:"button",disabled:un.value||Yn.value,onClick:ve=>So($.path)}," Open ",8,g3)):Ce("",!0)]))),128))])):Ce("",!0)])):Ce("",!0),Ge(eF,{class:"new-thread-runtime-dropdown",modelValue:rn.value,"onUpdate:modelValue":y[9]||(y[9]=$=>rn.value=$)},null,8,["modelValue"]),rn.value==="worktree"?(A(),O("div",v3,[y[27]||(y[27]=_("p",{class:"new-thread-branch-select-label"},"Base branch",-1)),Ge(Bs,{class:"new-thread-branch-dropdown","model-value":bn.value,options:Qi.value,placeholder:"Select branch","enable-search":!0,"search-placeholder":"Search branches...",disabled:nr.value||Qi.value.length===0,"onUpdate:modelValue":yt},null,8,["model-value","options","disabled"]),_("p",_3,we(nr.value?"Loading branches…":fl.value?`New worktree branch will start from ${fl.value}.`:"No Git branches found for this folder."),1)])):Ce("",!0),y[31]||(y[31]=_("p",{class:"new-thread-runtime-help"},[_("code",null,"Local project"),Vs(" uses the selected folder directly. "),_("code",null,"New worktree"),Vs(" creates an isolated Git worktree before the first prompt. ")],-1)),zt.value.phase!=="idle"?(A(),O("div",{key:3,class:ht(["worktree-init-status",{"is-running":zt.value.phase==="running","is-error":zt.value.phase==="error"}])},[_("strong",y3,we(zt.value.title),1),_("span",b3,we(zt.value.message),1)],2)):Ce("",!0),Kn.value?(A(),O("div",w3,[_("div",S3,[y[28]||(y[28]=_("p",{class:"new-thread-trending-title"},"Trending GitHub projects",-1)),Ge(Bs,{class:"new-thread-trending-scope-dropdown","model-value":Oe.value,options:bu.value,"onUpdate:modelValue":W},null,8,["model-value","options"])]),je.value?(A(),O("p",T3,"Loading trending projects...")):he.value.length===0?(A(),O("p",E3," Trending repos are unavailable right now. ")):(A(),O("div",k3,[(A(!0),O(et,null,Wt(he.value,$=>(A(),O("button",{key:$.id,type:"button",class:"new-thread-trending-tip",onClick:ve=>ae($)},[_("span",{class:"new-thread-trending-tip-name",title:$.fullName},[$.owner&&$.repo?(A(),O(et,{key:0},[_("span",I3,we($.owner),1),y[29]||(y[29]=_("span",{class:"new-thread-trending-tip-name-slash"},"/",-1)),_("span",A3,we($.repo),1)],64)):(A(),O("span",R3,we($.fullName),1))],8,x3),_("span",M3,we(U($)),1),_("span",P3,we($.description||"No description available."),1)],8,C3))),128))]))])):Ce("",!0)]),_("div",$3,[Ge(av,{ref_key:"homeThreadComposerRef",ref:N,"active-thread-id":P.value,cwd:Ae.value,"collaboration-modes":qe(I),"selected-collaboration-mode":qe(z),models:qe(V),"selected-model":qe(ce),"selected-reasoning-effort":qe(re),"selected-speed-mode":qe(Z),"is-updating-speed-mode":qe(Ne),skills:qe(de),"thread-token-usage":qe(h),"codex-quota":qe(D),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Vn.value,"in-progress-submit-mode":hr.value,"dictation-click-to-toggle":pn.value,"dictation-auto-send":Gn.value,"dictation-language":mr.value,onSubmit:B,"onUpdate:selectedCollaborationMode":rh,"onUpdate:selectedModel":eh,"onUpdate:selectedReasoningEffort":th,"onUpdate:selectedSpeedMode":nh},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"])])])):(A(),O("div",N3,[sn.value&&qe(C)&&Ae.value?(A(),bt(qe(n),{key:0,"thread-id":qe(C),cwd:Ae.value,"is-thread-in-progress":it.value,onClose:y[10]||(y[10]=$=>sn.value=!1)},null,8,["thread-id","cwd","is-thread-in-progress"])):(A(),O(et,{key:1},[_("div",L3,[Ge(qe(t),{ref_key:"threadConversationRef",ref:ne,messages:K.value,"is-loading":qe(H),"active-thread-id":P.value,cwd:Ae.value,"scroll-state":qe(g),"live-overlay":S.value,"pending-requests":qe(w),onUpdateScrollState:kl,onForkThread:Hu,onRollback:xw,onRespondServerRequest:oa},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests"])]),_("div",D3,[Ge(BO,{messages:qe(me),onEdit:Be,onSteer:qe(ge),onDelete:qe(be)},null,8,["messages","onSteer","onDelete"]),X.value?(A(),bt(MO,{key:0,request:X.value,"request-count":qe(w).length,"has-queue-above":qe(me).length>0,onRespondServerRequest:oa},null,8,["request","request-count","has-queue-above"])):(A(),bt(av,{key:1,ref_key:"threadComposerRef",ref:F,"active-thread-id":P.value,cwd:Ae.value,"collaboration-modes":qe(I),"selected-collaboration-mode":qe(z),models:qe(V),"selected-model":qe(ce),"selected-reasoning-effort":qe(re),"selected-speed-mode":qe(Z),"is-updating-speed-mode":qe(Ne),skills:qe(de),"thread-token-usage":qe(h),"codex-quota":qe(D),"is-turn-in-progress":it.value,"is-interrupting-turn":qe(Se),"has-queue-above":qe(me).length>0,"send-with-enter":Vn.value,"in-progress-submit-mode":hr.value,"dictation-click-to-toggle":pn.value,"dictation-auto-send":Gn.value,"dictation-language":mr.value,"onUpdate:selectedCollaborationMode":rh,onSubmit:B,"onUpdate:selectedModel":eh,"onUpdate:selectedReasoningEffort":th,"onUpdate:selectedSpeedMode":nh,onInterrupt:Cw},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-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"]))}}),j3=xt(F3,[["__scopeId","data-v-82e52728"]]),Jd={render:()=>null},ww=gP({history:KM(),routes:[{path:"/",name:"home",component:Jd},{path:"/thread/:threadId",name:"thread",component:Jd},{path:"/skills",name:"skills",component:Jd},{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 Sw=xT(j3);async function B3(){{U3();return}}function U3(e){oM({app:Sw,dsn:"https://9b1c6357d134c512f8171518ec2cb18e@o4511194738982912.ingest.us.sentry.io/4511201728200704",release:"codexui@0.1.80",environment:"production",integrations:[aM({router:ww}),Ux({autoInject:!0,colorScheme:"dark",triggerLabel:"Report Issue",submitButtonLabel:"Send",formTitle:"Report an Issue",messagePlaceholder:"Describe what happened or what you expected…",successMessageText:"Thanks! Your feedback was sent.",showBranding:!1})],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}})}B3();Sw.use(ww).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed.",e)})});export{f$ as A,Kr as B,H3 as C,W3 as D,z3 as E,et as F,G3 as G,q3 as H,vc as I,V3 as J,Zp as K,Zl as L,t2 as M,cv as N,yo as O,xn as P,B_ as T,xt as _,_ as a,vs as b,O as c,Pn as d,Xs as e,Ce as f,Wt as g,ht as h,bt as i,It as j,up as k,Po as l,Ge as m,tn as n,A as o,XN as p,SF as q,j as r,wt as s,we as t,Kp as u,qe as v,ct as w,Vs as x,le as y,Id as z};
|
|
559
|
+
//# sourceMappingURL=index-C4y0SuPN.js.map
|