omni-cortex 1.17.3__py3-none-any.whl → 1.17.4__py3-none-any.whl
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.
- omni_cortex/_bundled/dashboard/backend/main.py +2 -2
- omni_cortex/_bundled/dashboard/backend/test_database.py +301 -0
- omni_cortex/_bundled/dashboard/backend/tmpclaude-2dfa-cwd +1 -0
- omni_cortex/_bundled/dashboard/backend/tmpclaude-c460-cwd +1 -0
- omni_cortex/_bundled/dashboard/frontend/dist/assets/index-CQlQK3nE.js +551 -0
- omni_cortex/_bundled/dashboard/frontend/dist/assets/index-CmUNNfe4.css +1 -0
- omni_cortex/_bundled/dashboard/frontend/dist/index.html +14 -0
- omni_cortex/_bundled/hooks/user_prompt.py +113 -2
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/main.py +2 -2
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/hooks/user_prompt.py +113 -2
- {omni_cortex-1.17.3.dist-info → omni_cortex-1.17.4.dist-info}/METADATA +6 -1
- omni_cortex-1.17.4.dist-info/RECORD +53 -0
- omni_cortex/__init__.py +0 -3
- omni_cortex/categorization/__init__.py +0 -9
- omni_cortex/categorization/auto_tags.py +0 -166
- omni_cortex/categorization/auto_type.py +0 -165
- omni_cortex/config.py +0 -141
- omni_cortex/dashboard.py +0 -238
- omni_cortex/database/__init__.py +0 -24
- omni_cortex/database/connection.py +0 -137
- omni_cortex/database/migrations.py +0 -210
- omni_cortex/database/schema.py +0 -212
- omni_cortex/database/sync.py +0 -421
- omni_cortex/decay/__init__.py +0 -7
- omni_cortex/decay/importance.py +0 -147
- omni_cortex/embeddings/__init__.py +0 -35
- omni_cortex/embeddings/local.py +0 -442
- omni_cortex/models/__init__.py +0 -20
- omni_cortex/models/activity.py +0 -265
- omni_cortex/models/agent.py +0 -144
- omni_cortex/models/memory.py +0 -395
- omni_cortex/models/relationship.py +0 -206
- omni_cortex/models/session.py +0 -290
- omni_cortex/resources/__init__.py +0 -1
- omni_cortex/search/__init__.py +0 -22
- omni_cortex/search/hybrid.py +0 -197
- omni_cortex/search/keyword.py +0 -204
- omni_cortex/search/ranking.py +0 -127
- omni_cortex/search/semantic.py +0 -232
- omni_cortex/server.py +0 -360
- omni_cortex/setup.py +0 -284
- omni_cortex/tools/__init__.py +0 -13
- omni_cortex/tools/activities.py +0 -453
- omni_cortex/tools/memories.py +0 -536
- omni_cortex/tools/sessions.py +0 -311
- omni_cortex/tools/utilities.py +0 -477
- omni_cortex/utils/__init__.py +0 -13
- omni_cortex/utils/formatting.py +0 -282
- omni_cortex/utils/ids.py +0 -72
- omni_cortex/utils/timestamps.py +0 -129
- omni_cortex/utils/truncation.py +0 -111
- omni_cortex-1.17.3.dist-info/RECORD +0 -86
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/.env.example +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/backfill_summaries.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/chat_service.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/database.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/image_service.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/logging_config.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/models.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/project_config.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/project_scanner.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/prompt_security.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/pyproject.toml +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/security.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/uv.lock +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/dashboard/backend/websocket_manager.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/hooks/post_tool_use.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/hooks/pre_tool_use.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/hooks/session_utils.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/hooks/stop.py +0 -0
- {omni_cortex-1.17.3.data → omni_cortex-1.17.4.data}/data/share/omni-cortex/hooks/subagent_stop.py +0 -0
- {omni_cortex-1.17.3.dist-info → omni_cortex-1.17.4.dist-info}/WHEEL +0 -0
- {omni_cortex-1.17.3.dist-info → omni_cortex-1.17.4.dist-info}/entry_points.txt +0 -0
- {omni_cortex-1.17.3.dist-info → omni_cortex-1.17.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
var bb=Object.defineProperty;var xb=(t,e,n)=>e in t?bb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var he=(t,e,n)=>xb(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/**
|
|
2
|
+
* @vue/shared v3.5.26
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/function Nu(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const nt={},Ir=[],Fn=()=>{},p0=()=>!1,hl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Fu=t=>t.startsWith("onUpdate:"),St=Object.assign,ju=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},vb=Object.prototype.hasOwnProperty,Xe=(t,e)=>vb.call(t,e),Ae=Array.isArray,Lr=t=>ko(t)==="[object Map]",ii=t=>ko(t)==="[object Set]",rf=t=>ko(t)==="[object Date]",De=t=>typeof t=="function",ft=t=>typeof t=="string",Un=t=>typeof t=="symbol",tt=t=>t!==null&&typeof t=="object",m0=t=>(tt(t)||De(t))&&De(t.then)&&De(t.catch),y0=Object.prototype.toString,ko=t=>y0.call(t),_b=t=>ko(t).slice(8,-1),b0=t=>ko(t)==="[object Object]",gl=t=>ft(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Fi=Nu(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),pl=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},kb=/-\w/g,pn=pl(t=>t.replace(kb,e=>e.slice(1).toUpperCase())),wb=/\B([A-Z])/g,Vs=pl(t=>t.replace(wb,"-$1").toLowerCase()),ml=pl(t=>t.charAt(0).toUpperCase()+t.slice(1)),Jl=pl(t=>t?`on${ml(t)}`:""),Ns=(t,e)=>!Object.is(t,e),ba=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},x0=(t,e,n,s=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:n})},yl=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Sb=t=>{const e=ft(t)?Number(t):NaN;return isNaN(e)?t:e};let of;const bl=()=>of||(of=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function wt(t){if(Ae(t)){const e={};for(let n=0;n<t.length;n++){const s=t[n],r=ft(s)?Mb(s):wt(s);if(r)for(const i in r)e[i]=r[i]}return e}else if(ft(t)||tt(t))return t}const $b=/;(?![^(]*\))/g,Cb=/:([^]+)/,Tb=/\/\*[^]*?\*\//g;function Mb(t){const e={};return t.replace(Tb,"").split($b).forEach(n=>{if(n){const s=n.split(Cb);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function re(t){let e="";if(ft(t))e=t;else if(Ae(t))for(let n=0;n<t.length;n++){const s=re(t[n]);s&&(e+=s+" ")}else if(tt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const Ab="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Eb=Nu(Ab);function v0(t){return!!t||t===""}function Pb(t,e){if(t.length!==e.length)return!1;let n=!0;for(let s=0;n&&s<t.length;s++)n=pr(t[s],e[s]);return n}function pr(t,e){if(t===e)return!0;let n=rf(t),s=rf(e);if(n||s)return n&&s?t.getTime()===e.getTime():!1;if(n=Un(t),s=Un(e),n||s)return t===e;if(n=Ae(t),s=Ae(e),n||s)return n&&s?Pb(t,e):!1;if(n=tt(t),s=tt(e),n||s){if(!n||!s)return!1;const r=Object.keys(t).length,i=Object.keys(e).length;if(r!==i)return!1;for(const o in t){const a=t.hasOwnProperty(o),l=e.hasOwnProperty(o);if(a&&!l||!a&&l||!pr(t[o],e[o]))return!1}}return String(t)===String(e)}function zu(t,e){return t.findIndex(n=>pr(n,e))}const _0=t=>!!(t&&t.__v_isRef===!0),A=t=>ft(t)?t:t==null?"":Ae(t)||tt(t)&&(t.toString===y0||!De(t.toString))?_0(t)?A(t.value):JSON.stringify(t,k0,2):String(t),k0=(t,e)=>_0(e)?k0(t,e.value):Lr(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[s,r],i)=>(n[Zl(s,i)+" =>"]=r,n),{})}:ii(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Zl(n))}:Un(e)?Zl(e):tt(e)&&!Ae(e)&&!b0(e)?String(e):e,Zl=(t,e="")=>{var n;return Un(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/**
|
|
6
|
+
* @vue/reactivity v3.5.26
|
|
7
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
+
* @license MIT
|
|
9
|
+
**/let Mt;class w0{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Mt,!e&&Mt&&(this.index=(Mt.scopes||(Mt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=Mt;try{return Mt=this,e()}finally{Mt=n}}}on(){++this._on===1&&(this.prevScope=Mt,Mt=this)}off(){this._on>0&&--this._on===0&&(Mt=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function S0(t){return new w0(t)}function $0(){return Mt}function Rb(t,e=!1){Mt&&Mt.cleanups.push(t)}let st;const Ql=new WeakSet;class C0{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Mt&&Mt.active&&Mt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ql.has(this)&&(Ql.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||M0(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,af(this),A0(this);const e=st,n=wn;st=this,wn=!0;try{return this.fn()}finally{E0(this),st=e,wn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Uu(e);this.deps=this.depsTail=void 0,af(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ql.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Hc(this)&&this.run()}get dirty(){return Hc(this)}}let T0=0,ji,zi;function M0(t,e=!1){if(t.flags|=8,e){t.next=zi,zi=t;return}t.next=ji,ji=t}function Bu(){T0++}function Hu(){if(--T0>0)return;if(zi){let e=zi;for(zi=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;ji;){let e=ji;for(ji=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=n}}if(t)throw t}function A0(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function E0(t){let e,n=t.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Uu(s),Db(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}t.deps=e,t.depsTail=n}function Hc(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(P0(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function P0(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===eo)||(t.globalVersion=eo,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Hc(t))))return;t.flags|=2;const e=t.dep,n=st,s=wn;st=t,wn=!0;try{A0(t);const r=t.fn(t._value);(e.version===0||Ns(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{st=n,wn=s,E0(t),t.flags&=-3}}function Uu(t,e=!1){const{dep:n,prevSub:s,nextSub:r}=t;if(s&&(s.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=s,t.nextSub=void 0),n.subs===t&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Uu(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function Db(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let wn=!0;const R0=[];function gs(){R0.push(wn),wn=!1}function ps(){const t=R0.pop();wn=t===void 0?!0:t}function af(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=st;st=void 0;try{e()}finally{st=n}}}let eo=0;class Ob{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Vu{constructor(e){this.computed=e,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(e){if(!st||!wn||st===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==st)n=this.activeLink=new Ob(st,this),st.deps?(n.prevDep=st.depsTail,st.depsTail.nextDep=n,st.depsTail=n):st.deps=st.depsTail=n,D0(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=st.depsTail,n.nextDep=void 0,st.depsTail.nextDep=n,st.depsTail=n,st.deps===n&&(st.deps=s)}return n}trigger(e){this.version++,eo++,this.notify(e)}notify(e){Bu();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Hu()}}}function D0(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)D0(s)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Na=new WeakMap,lr=Symbol(""),Uc=Symbol(""),to=Symbol("");function At(t,e,n){if(wn&&st){let s=Na.get(t);s||Na.set(t,s=new Map);let r=s.get(n);r||(s.set(n,r=new Vu),r.map=s,r.key=n),r.track()}}function is(t,e,n,s,r,i){const o=Na.get(t);if(!o){eo++;return}const a=l=>{l&&l.trigger()};if(Bu(),e==="clear")o.forEach(a);else{const l=Ae(t),c=l&&gl(n);if(l&&n==="length"){const u=Number(s);o.forEach((d,h)=>{(h==="length"||h===to||!Un(h)&&h>=u)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(to)),e){case"add":l?c&&a(o.get("length")):(a(o.get(lr)),Lr(t)&&a(o.get(Uc)));break;case"delete":l||(a(o.get(lr)),Lr(t)&&a(o.get(Uc)));break;case"set":Lr(t)&&a(o.get(lr));break}}Hu()}function Ib(t,e){const n=Na.get(t);return n&&n.get(e)}function Ar(t){const e=Ue(t);return e===t?e:(At(e,"iterate",to),ln(t)?e:e.map(Sn))}function xl(t){return At(t=Ue(t),"iterate",to),t}function Cs(t,e){return ms(t)?fs(t)?Kr(Sn(e)):Kr(e):Sn(e)}const Lb={__proto__:null,[Symbol.iterator](){return ec(this,Symbol.iterator,t=>Cs(this,t))},concat(...t){return Ar(this).concat(...t.map(e=>Ae(e)?Ar(e):e))},entries(){return ec(this,"entries",t=>(t[1]=Cs(this,t[1]),t))},every(t,e){return Gn(this,"every",t,e,void 0,arguments)},filter(t,e){return Gn(this,"filter",t,e,n=>n.map(s=>Cs(this,s)),arguments)},find(t,e){return Gn(this,"find",t,e,n=>Cs(this,n),arguments)},findIndex(t,e){return Gn(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Gn(this,"findLast",t,e,n=>Cs(this,n),arguments)},findLastIndex(t,e){return Gn(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Gn(this,"forEach",t,e,void 0,arguments)},includes(...t){return tc(this,"includes",t)},indexOf(...t){return tc(this,"indexOf",t)},join(t){return Ar(this).join(t)},lastIndexOf(...t){return tc(this,"lastIndexOf",t)},map(t,e){return Gn(this,"map",t,e,void 0,arguments)},pop(){return di(this,"pop")},push(...t){return di(this,"push",t)},reduce(t,...e){return lf(this,"reduce",t,e)},reduceRight(t,...e){return lf(this,"reduceRight",t,e)},shift(){return di(this,"shift")},some(t,e){return Gn(this,"some",t,e,void 0,arguments)},splice(...t){return di(this,"splice",t)},toReversed(){return Ar(this).toReversed()},toSorted(t){return Ar(this).toSorted(t)},toSpliced(...t){return Ar(this).toSpliced(...t)},unshift(...t){return di(this,"unshift",t)},values(){return ec(this,"values",t=>Cs(this,t))}};function ec(t,e,n){const s=xl(t),r=s[e]();return s!==t&&!ln(t)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const Nb=Array.prototype;function Gn(t,e,n,s,r,i){const o=xl(t),a=o!==t&&!ln(t),l=o[e];if(l!==Nb[e]){const d=l.apply(t,i);return a?Sn(d):d}let c=n;o!==t&&(a?c=function(d,h){return n.call(this,Cs(t,d),h,t)}:n.length>2&&(c=function(d,h){return n.call(this,d,h,t)}));const u=l.call(o,c,s);return a&&r?r(u):u}function lf(t,e,n,s){const r=xl(t);let i=n;return r!==t&&(ln(t)?n.length>3&&(i=function(o,a,l){return n.call(this,o,a,l,t)}):i=function(o,a,l){return n.call(this,o,Cs(t,a),l,t)}),r[e](i,...s)}function tc(t,e,n){const s=Ue(t);At(s,"iterate",to);const r=s[e](...n);return(r===-1||r===!1)&&oi(n[0])?(n[0]=Ue(n[0]),s[e](...n)):r}function di(t,e,n=[]){gs(),Bu();const s=Ue(t)[e].apply(t,n);return Hu(),ps(),s}const Fb=Nu("__proto__,__v_isRef,__isVue"),O0=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Un));function jb(t){Un(t)||(t=String(t));const e=Ue(this);return At(e,"has",t),e.hasOwnProperty(t)}class I0{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,s){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?Yb:j0:i?F0:N0).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=Ae(e);if(!r){let l;if(o&&(l=Lb[n]))return l;if(n==="hasOwnProperty")return jb}const a=Reflect.get(e,n,ht(e)?e:s);if((Un(n)?O0.has(n):Fb(n))||(r||At(e,"get",n),i))return a;if(ht(a)){const l=o&&gl(n)?a:a.value;return r&&tt(l)?Wc(l):l}return tt(a)?r?Wc(a):vl(a):a}}class L0 extends I0{constructor(e=!1){super(!1,e)}set(e,n,s,r){let i=e[n];const o=Ae(e)&&gl(n);if(!this._isShallow){const c=ms(i);if(!ln(s)&&!ms(s)&&(i=Ue(i),s=Ue(s)),!o&&ht(i)&&!ht(s))return c||(i.value=s),!0}const a=o?Number(n)<e.length:Xe(e,n),l=Reflect.set(e,n,s,ht(e)?e:r);return e===Ue(r)&&(a?Ns(s,i)&&is(e,"set",n,s):is(e,"add",n,s)),l}deleteProperty(e,n){const s=Xe(e,n);e[n];const r=Reflect.deleteProperty(e,n);return r&&s&&is(e,"delete",n,void 0),r}has(e,n){const s=Reflect.has(e,n);return(!Un(n)||!O0.has(n))&&At(e,"has",n),s}ownKeys(e){return At(e,"iterate",Ae(e)?"length":lr),Reflect.ownKeys(e)}}class zb extends I0{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const Bb=new L0,Hb=new zb,Ub=new L0(!0);const Vc=t=>t,zo=t=>Reflect.getPrototypeOf(t);function Vb(t,e,n){return function(...s){const r=this.__v_raw,i=Ue(r),o=Lr(i),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=r[t](...s),u=n?Vc:e?Kr:Sn;return!e&&At(i,"iterate",l?Uc:lr),{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}},[Symbol.iterator](){return this}}}}function Bo(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function Wb(t,e){const n={get(r){const i=this.__v_raw,o=Ue(i),a=Ue(r);t||(Ns(r,a)&&At(o,"get",r),At(o,"get",a));const{has:l}=zo(o),c=e?Vc:t?Kr:Sn;if(l.call(o,r))return c(i.get(r));if(l.call(o,a))return c(i.get(a));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!t&&At(Ue(r),"iterate",lr),r.size},has(r){const i=this.__v_raw,o=Ue(i),a=Ue(r);return t||(Ns(r,a)&&At(o,"has",r),At(o,"has",a)),r===a?i.has(r):i.has(r)||i.has(a)},forEach(r,i){const o=this,a=o.__v_raw,l=Ue(a),c=e?Vc:t?Kr:Sn;return!t&&At(l,"iterate",lr),a.forEach((u,d)=>r.call(i,c(u),c(d),o))}};return St(n,t?{add:Bo("add"),set:Bo("set"),delete:Bo("delete"),clear:Bo("clear")}:{add(r){!e&&!ln(r)&&!ms(r)&&(r=Ue(r));const i=Ue(this);return zo(i).has.call(i,r)||(i.add(r),is(i,"add",r,r)),this},set(r,i){!e&&!ln(i)&&!ms(i)&&(i=Ue(i));const o=Ue(this),{has:a,get:l}=zo(o);let c=a.call(o,r);c||(r=Ue(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,i),c?Ns(i,u)&&is(o,"set",r,i):is(o,"add",r,i),this},delete(r){const i=Ue(this),{has:o,get:a}=zo(i);let l=o.call(i,r);l||(r=Ue(r),l=o.call(i,r)),a&&a.call(i,r);const c=i.delete(r);return l&&is(i,"delete",r,void 0),c},clear(){const r=Ue(this),i=r.size!==0,o=r.clear();return i&&is(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Vb(r,t,e)}),n}function Wu(t,e){const n=Wb(t,e);return(s,r,i)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?s:Reflect.get(Xe(n,r)&&r in s?n:s,r,i)}const qb={get:Wu(!1,!1)},Kb={get:Wu(!1,!0)},Gb={get:Wu(!0,!1)};const N0=new WeakMap,F0=new WeakMap,j0=new WeakMap,Yb=new WeakMap;function Xb(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Jb(t){return t.__v_skip||!Object.isExtensible(t)?0:Xb(_b(t))}function vl(t){return ms(t)?t:qu(t,!1,Bb,qb,N0)}function Zb(t){return qu(t,!1,Ub,Kb,F0)}function Wc(t){return qu(t,!0,Hb,Gb,j0)}function qu(t,e,n,s,r){if(!tt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=Jb(t);if(i===0)return t;const o=r.get(t);if(o)return o;const a=new Proxy(t,i===2?s:n);return r.set(t,a),a}function fs(t){return ms(t)?fs(t.__v_raw):!!(t&&t.__v_isReactive)}function ms(t){return!!(t&&t.__v_isReadonly)}function ln(t){return!!(t&&t.__v_isShallow)}function oi(t){return t?!!t.__v_raw:!1}function Ue(t){const e=t&&t.__v_raw;return e?Ue(e):t}function Ku(t){return!Xe(t,"__v_skip")&&Object.isExtensible(t)&&x0(t,"__v_skip",!0),t}const Sn=t=>tt(t)?vl(t):t,Kr=t=>tt(t)?Wc(t):t;function ht(t){return t?t.__v_isRef===!0:!1}function I(t){return B0(t,!1)}function z0(t){return B0(t,!0)}function B0(t,e){return ht(t)?t:new Qb(t,e)}class Qb{constructor(e,n){this.dep=new Vu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Ue(e),this._value=n?e:Sn(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,s=this.__v_isShallow||ln(e)||ms(e);e=s?e:Ue(e),Ns(e,n)&&(this._rawValue=e,this._value=s?e:Sn(e),this.dep.trigger())}}function $(t){return ht(t)?t.value:t}const ex={get:(t,e,n)=>e==="__v_raw"?t:$(Reflect.get(t,e,n)),set:(t,e,n,s)=>{const r=t[e];return ht(r)&&!ht(n)?(r.value=n,!0):Reflect.set(t,e,n,s)}};function H0(t){return fs(t)?t:new Proxy(t,ex)}function tx(t){const e=Ae(t)?new Array(t.length):{};for(const n in t)e[n]=sx(t,n);return e}class nx{constructor(e,n,s){this._object=e,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=Ue(e);let r=!0,i=e;if(!Ae(e)||!gl(String(n)))do r=!oi(i)||ln(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=$(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&ht(this._raw[this._key])){const n=this._object[this._key];if(ht(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return Ib(this._raw,this._key)}}function sx(t,e,n){return new nx(t,e,n)}class rx{constructor(e,n,s){this.fn=e,this.setter=n,this._value=void 0,this.dep=new Vu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=eo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&st!==this)return M0(this,!0),!0}get value(){const e=this.dep.track();return P0(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ix(t,e,n=!1){let s,r;return De(t)?s=t:(s=t.get,r=t.set),new rx(s,r,n)}const Ho={},Fa=new WeakMap;let tr;function ox(t,e=!1,n=tr){if(n){let s=Fa.get(n);s||Fa.set(n,s=[]),s.push(t)}}function ax(t,e,n=nt){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:a,call:l}=n,c=v=>r?v:ln(v)||r===!1||r===0?os(v,1):os(v);let u,d,h,g,p=!1,m=!1;if(ht(t)?(d=()=>t.value,p=ln(t)):fs(t)?(d=()=>c(t),p=!0):Ae(t)?(m=!0,p=t.some(v=>fs(v)||ln(v)),d=()=>t.map(v=>{if(ht(v))return v.value;if(fs(v))return c(v);if(De(v))return l?l(v,2):v()})):De(t)?e?d=l?()=>l(t,2):t:d=()=>{if(h){gs();try{h()}finally{ps()}}const v=tr;tr=u;try{return l?l(t,3,[g]):t(g)}finally{tr=v}}:d=Fn,e&&r){const v=d,_=r===!0?1/0:r;d=()=>os(v(),_)}const y=$0(),x=()=>{u.stop(),y&&y.active&&ju(y.effects,u)};if(i&&e){const v=e;e=(..._)=>{v(..._),x()}}let S=m?new Array(t.length).fill(Ho):Ho;const T=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(e){const _=u.run();if(r||p||(m?_.some((P,L)=>Ns(P,S[L])):Ns(_,S))){h&&h();const P=tr;tr=u;try{const L=[_,S===Ho?void 0:m&&S[0]===Ho?[]:S,g];S=_,l?l(e,3,L):e(...L)}finally{tr=P}}}else u.run()};return a&&a(T),u=new C0(d),u.scheduler=o?()=>o(T,!1):T,g=v=>ox(v,!1,u),h=u.onStop=()=>{const v=Fa.get(u);if(v){if(l)l(v,4);else for(const _ of v)_();Fa.delete(u)}},e?s?T(!0):S=u.run():o?o(T.bind(null,!0),!0):u.run(),x.pause=u.pause.bind(u),x.resume=u.resume.bind(u),x.stop=x,x}function os(t,e=1/0,n){if(e<=0||!tt(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,ht(t))os(t.value,e,n);else if(Ae(t))for(let s=0;s<t.length;s++)os(t[s],e,n);else if(ii(t)||Lr(t))t.forEach(s=>{os(s,e,n)});else if(b0(t)){for(const s in t)os(t[s],e,n);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&os(t[s],e,n)}return t}/**
|
|
10
|
+
* @vue/runtime-core v3.5.26
|
|
11
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
+
* @license MIT
|
|
13
|
+
**/function wo(t,e,n,s){try{return s?t(...s):t()}catch(r){_l(r,e,n)}}function $n(t,e,n,s){if(De(t)){const r=wo(t,e,n,s);return r&&m0(r)&&r.catch(i=>{_l(i,e,n)}),r}if(Ae(t)){const r=[];for(let i=0;i<t.length;i++)r.push($n(t[i],e,n,s));return r}}function _l(t,e,n,s=!0){const r=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||nt;if(e){let a=e.parent;const l=e.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](t,l,c)===!1)return}a=a.parent}if(i){gs(),wo(i,null,10,[t,l,c]),ps();return}}lx(t,n,r,s,o)}function lx(t,e,n,s=!0,r=!1){if(r)throw t;console.error(t)}const jt=[];let On=-1;const Nr=[];let Ts=null,Or=0;const U0=Promise.resolve();let ja=null;function jn(t){const e=ja||U0;return t?e.then(this?t.bind(this):t):e}function cx(t){let e=On+1,n=jt.length;for(;e<n;){const s=e+n>>>1,r=jt[s],i=no(r);i<t||i===t&&r.flags&2?e=s+1:n=s}return e}function Gu(t){if(!(t.flags&1)){const e=no(t),n=jt[jt.length-1];!n||!(t.flags&2)&&e>=no(n)?jt.push(t):jt.splice(cx(e),0,t),t.flags|=1,V0()}}function V0(){ja||(ja=U0.then(q0))}function ux(t){Ae(t)?Nr.push(...t):Ts&&t.id===-1?Ts.splice(Or+1,0,t):t.flags&1||(Nr.push(t),t.flags|=1),V0()}function cf(t,e,n=On+1){for(;n<jt.length;n++){const s=jt[n];if(s&&s.flags&2){if(t&&s.id!==t.uid)continue;jt.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function W0(t){if(Nr.length){const e=[...new Set(Nr)].sort((n,s)=>no(n)-no(s));if(Nr.length=0,Ts){Ts.push(...e);return}for(Ts=e,Or=0;Or<Ts.length;Or++){const n=Ts[Or];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ts=null,Or=0}}const no=t=>t.id==null?t.flags&2?-1:1/0:t.id;function q0(t){try{for(On=0;On<jt.length;On++){const e=jt[On];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),wo(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;On<jt.length;On++){const e=jt[On];e&&(e.flags&=-2)}On=-1,jt.length=0,W0(),ja=null,(jt.length||Nr.length)&&q0()}}let on=null,K0=null;function za(t){const e=on;return on=t,K0=t&&t.type.__scopeId||null,e}function js(t,e=on,n){if(!e||t._n)return t;const s=(...r)=>{s._d&&Ua(-1);const i=za(e);let o;try{o=t(...r)}finally{za(i),s._d&&Ua(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Ee(t,e){if(on===null)return t;const n=Cl(on),s=t.dirs||(t.dirs=[]);for(let r=0;r<e.length;r++){let[i,o,a,l=nt]=e[r];i&&(De(i)&&(i={mounted:i,updated:i}),i.deep&&os(o),s.push({dir:i,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return t}function Gs(t,e,n,s){const r=t.dirs,i=e&&e.dirs;for(let o=0;o<r.length;o++){const a=r[o];i&&(a.oldValue=i[o].value);let l=a.dir[s];l&&(gs(),$n(l,n,8,[t.el,a,t,e]),ps())}}function dx(t,e){if(Et){let n=Et.provides;const s=Et.parent&&Et.parent.provides;s===n&&(n=Et.provides=Object.create(s)),n[t]=e}}function Bi(t,e,n=!1){const s=Qu();if(s||cr){let r=cr?cr._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return n&&De(e)?e.call(s&&s.proxy):e}}function fx(){return!!(Qu()||cr)}const hx=Symbol.for("v-scx"),gx=()=>Bi(hx);function Be(t,e,n){return G0(t,e,n)}function G0(t,e,n=nt){const{immediate:s,deep:r,flush:i,once:o}=n,a=St({},n),l=e&&s||!e&&i!=="post";let c;if(io){if(i==="sync"){const g=gx();c=g.__watcherHandles||(g.__watcherHandles=[])}else if(!l){const g=()=>{};return g.stop=Fn,g.resume=Fn,g.pause=Fn,g}}const u=Et;a.call=(g,p,m)=>$n(g,u,p,m);let d=!1;i==="post"?a.scheduler=g=>{Ft(g,u&&u.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(g,p)=>{p?g():Gu(g)}),a.augmentJob=g=>{e&&(g.flags|=4),d&&(g.flags|=2,u&&(g.id=u.uid,g.i=u))};const h=ax(t,e,a);return io&&(c?c.push(h):l&&h()),h}function px(t,e,n){const s=this.proxy,r=ft(t)?t.includes(".")?Y0(s,t):()=>s[t]:t.bind(s,s);let i;De(e)?i=e:(i=e.handler,n=e);const o=So(this),a=G0(r,i.bind(s),n);return o(),a}function Y0(t,e){const n=e.split(".");return()=>{let s=t;for(let r=0;r<n.length&&s;r++)s=s[n[r]];return s}}const X0=Symbol("_vte"),J0=t=>t.__isTeleport,Hi=t=>t&&(t.disabled||t.disabled===""),uf=t=>t&&(t.defer||t.defer===""),df=t=>typeof SVGElement<"u"&&t instanceof SVGElement,ff=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,qc=(t,e)=>{const n=t&&t.to;return ft(n)?e?e(n):null:n},Z0={name:"Teleport",__isTeleport:!0,process(t,e,n,s,r,i,o,a,l,c){const{mc:u,pc:d,pbc:h,o:{insert:g,querySelector:p,createText:m,createComment:y}}=c,x=Hi(e.props);let{shapeFlag:S,children:T,dynamicChildren:v}=e;if(t==null){const _=e.el=m(""),P=e.anchor=m("");g(_,n,s),g(P,n,s);const L=(w,M)=>{S&16&&u(T,w,M,r,i,o,a,l)},C=()=>{const w=e.target=qc(e.props,p),M=Q0(w,e,m,g);w&&(o!=="svg"&&df(w)?o="svg":o!=="mathml"&&ff(w)&&(o="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(w),x||(L(w,M),xa(e,!1)))};x&&(L(n,P),xa(e,!0)),uf(e.props)?(e.el.__isMounted=!1,Ft(()=>{C(),delete e.el.__isMounted},i)):C()}else{if(uf(e.props)&&t.el.__isMounted===!1){Ft(()=>{Z0.process(t,e,n,s,r,i,o,a,l,c)},i);return}e.el=t.el,e.targetStart=t.targetStart;const _=e.anchor=t.anchor,P=e.target=t.target,L=e.targetAnchor=t.targetAnchor,C=Hi(t.props),w=C?n:P,M=C?_:L;if(o==="svg"||df(P)?o="svg":(o==="mathml"||ff(P))&&(o="mathml"),v?(h(t.dynamicChildren,v,w,r,i,o,a),Ju(t,e,!0)):l||d(t,e,w,M,r,i,o,a,!1),x)C?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Uo(e,n,_,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const E=e.target=qc(e.props,p);E&&Uo(e,E,null,c,0)}else C&&Uo(e,P,L,c,1);xa(e,x)}},remove(t,e,n,{um:s,o:{remove:r}},i){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:h}=t;if(d&&(r(c),r(u)),i&&r(l),o&16){const g=i||!Hi(h);for(let p=0;p<a.length;p++){const m=a[p];s(m,e,n,g,!!m.dynamicChildren)}}},move:Uo,hydrate:mx};function Uo(t,e,n,{o:{insert:s},m:r},i=2){i===0&&s(t.targetAnchor,e,n);const{el:o,anchor:a,shapeFlag:l,children:c,props:u}=t,d=i===2;if(d&&s(o,e,n),(!d||Hi(u))&&l&16)for(let h=0;h<c.length;h++)r(c[h],e,n,2);d&&s(a,e,n)}function mx(t,e,n,s,r,i,{o:{nextSibling:o,parentNode:a,querySelector:l,insert:c,createText:u}},d){function h(m,y,x,S){y.anchor=d(o(m),y,a(m),n,s,r,i),y.targetStart=x,y.targetAnchor=S}const g=e.target=qc(e.props,l),p=Hi(e.props);if(g){const m=g._lpa||g.firstChild;if(e.shapeFlag&16)if(p)h(t,e,m,m&&o(m));else{e.anchor=o(t);let y=m;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")e.targetStart=y;else if(y.data==="teleport anchor"){e.targetAnchor=y,g._lpa=e.targetAnchor&&o(e.targetAnchor);break}}y=o(y)}e.targetAnchor||Q0(g,e,u,c),d(m&&o(m),e,g,n,s,r,i)}xa(e,p)}else p&&e.shapeFlag&16&&h(t,e,t,o(t));return e.anchor&&o(e.anchor)}const Gr=Z0;function xa(t,e){const n=t.ctx;if(n&&n.ut){let s,r;for(e?(s=t.el,r=t.anchor):(s=t.targetStart,r=t.targetAnchor);s&&s!==r;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Q0(t,e,n,s){const r=e.targetStart=n(""),i=e.targetAnchor=n("");return r[X0]=i,t&&(s(r,t),s(i,t)),i}const ss=Symbol("_leaveCb"),Vo=Symbol("_enterCb");function yx(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ge(()=>{t.isMounted=!0}),ap(()=>{t.isUnmounting=!0}),t}const dn=[Function,Array],ep={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:dn,onEnter:dn,onAfterEnter:dn,onEnterCancelled:dn,onBeforeLeave:dn,onLeave:dn,onAfterLeave:dn,onLeaveCancelled:dn,onBeforeAppear:dn,onAppear:dn,onAfterAppear:dn,onAppearCancelled:dn},tp=t=>{const e=t.subTree;return e.component?tp(e.component):e},bx={name:"BaseTransition",props:ep,setup(t,{slots:e}){const n=Qu(),s=yx();return()=>{const r=e.default&&rp(e.default(),!0);if(!r||!r.length)return;const i=np(r),o=Ue(t),{mode:a}=o;if(s.isLeaving)return nc(i);const l=hf(i);if(!l)return nc(i);let c=Kc(l,o,s,n,d=>c=d);l.type!==zt&&so(l,c);let u=n.subTree&&hf(n.subTree);if(u&&u.type!==zt&&!rr(u,l)&&tp(n).type!==zt){let d=Kc(u,o,s,n);if(so(u,d),a==="out-in"&&l.type!==zt)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},nc(i);a==="in-out"&&l.type!==zt?d.delayLeave=(h,g,p)=>{const m=sp(s,u);m[String(u.key)]=u,h[ss]=()=>{g(),h[ss]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function np(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==zt){e=n;break}}return e}const xx=bx;function sp(t,e){const{leavingVNodes:n}=t;let s=n.get(e.type);return s||(s=Object.create(null),n.set(e.type,s)),s}function Kc(t,e,n,s,r){const{appear:i,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:h,onLeave:g,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:y,onAppear:x,onAfterAppear:S,onAppearCancelled:T}=e,v=String(t.key),_=sp(n,t),P=(w,M)=>{w&&$n(w,s,9,M)},L=(w,M)=>{const E=M[1];P(w,M),Ae(w)?w.every(z=>z.length<=1)&&E():w.length<=1&&E()},C={mode:o,persisted:a,beforeEnter(w){let M=l;if(!n.isMounted)if(i)M=y||l;else return;w[ss]&&w[ss](!0);const E=_[v];E&&rr(t,E)&&E.el[ss]&&E.el[ss](),P(M,[w])},enter(w){let M=c,E=u,z=d;if(!n.isMounted)if(i)M=x||c,E=S||u,z=T||d;else return;let V=!1;const R=w[Vo]=j=>{V||(V=!0,j?P(z,[w]):P(E,[w]),C.delayedLeave&&C.delayedLeave(),w[Vo]=void 0)};M?L(M,[w,R]):R()},leave(w,M){const E=String(t.key);if(w[Vo]&&w[Vo](!0),n.isUnmounting)return M();P(h,[w]);let z=!1;const V=w[ss]=R=>{z||(z=!0,M(),R?P(m,[w]):P(p,[w]),w[ss]=void 0,_[E]===t&&delete _[E])};_[E]=t,g?L(g,[w,V]):V()},clone(w){const M=Kc(w,e,n,s,r);return r&&r(M),M}};return C}function nc(t){if(kl(t))return t=zs(t),t.children=null,t}function hf(t){if(!kl(t))return J0(t.type)&&t.children?np(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&De(n.default))return n.default()}}function so(t,e){t.shapeFlag&6&&t.component?(t.transition=e,so(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function rp(t,e=!1,n){let s=[],r=0;for(let i=0;i<t.length;i++){let o=t[i];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:i);o.type===ae?(o.patchFlag&128&&r++,s=s.concat(rp(o.children,e,a))):(e||o.type!==zt)&&s.push(a!=null?zs(o,{key:a}):o)}if(r>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Oe(t,e){return De(t)?St({name:t.name},e,{setup:t}):t}function ip(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}const Ba=new WeakMap;function Ui(t,e,n,s,r=!1){if(Ae(t)){t.forEach((p,m)=>Ui(p,e&&(Ae(e)?e[m]:e),n,s,r));return}if(Vi(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ui(t,e,n,s.component.subTree);return}const i=s.shapeFlag&4?Cl(s.component):s.el,o=r?null:i,{i:a,r:l}=t,c=e&&e.r,u=a.refs===nt?a.refs={}:a.refs,d=a.setupState,h=Ue(d),g=d===nt?p0:p=>Xe(h,p);if(c!=null&&c!==l){if(gf(e),ft(c))u[c]=null,g(c)&&(d[c]=null);else if(ht(c)){c.value=null;const p=e;p.k&&(u[p.k]=null)}}if(De(l))wo(l,a,12,[o,u]);else{const p=ft(l),m=ht(l);if(p||m){const y=()=>{if(t.f){const x=p?g(l)?d[l]:u[l]:l.value;if(r)Ae(x)&&ju(x,i);else if(Ae(x))x.includes(i)||x.push(i);else if(p)u[l]=[i],g(l)&&(d[l]=u[l]);else{const S=[i];l.value=S,t.k&&(u[t.k]=S)}}else p?(u[l]=o,g(l)&&(d[l]=o)):m&&(l.value=o,t.k&&(u[t.k]=o))};if(o){const x=()=>{y(),Ba.delete(t)};x.id=-1,Ba.set(t,x),Ft(x,n)}else gf(t),y()}}}function gf(t){const e=Ba.get(t);e&&(e.flags|=8,Ba.delete(t))}bl().requestIdleCallback;bl().cancelIdleCallback;const Vi=t=>!!t.type.__asyncLoader,kl=t=>t.type.__isKeepAlive;function vx(t,e){op(t,"a",e)}function _x(t,e){op(t,"da",e)}function op(t,e,n=Et){const s=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(wl(e,s,n),n){let r=n.parent;for(;r&&r.parent;)kl(r.parent.vnode)&&kx(s,e,n,r),r=r.parent}}function kx(t,e,n,s){const r=wl(e,t,s,!0);tn(()=>{ju(s[e],r)},n)}function wl(t,e,n=Et,s=!1){if(n){const r=n[t]||(n[t]=[]),i=e.__weh||(e.__weh=(...o)=>{gs();const a=So(n),l=$n(e,n,t,o);return a(),ps(),l});return s?r.unshift(i):r.push(i),i}}const bs=t=>(e,n=Et)=>{(!io||t==="sp")&&wl(t,(...s)=>e(...s),n)},wx=bs("bm"),Ge=bs("m"),Sx=bs("bu"),$x=bs("u"),ap=bs("bum"),tn=bs("um"),Cx=bs("sp"),Tx=bs("rtg"),Mx=bs("rtc");function Ax(t,e=Et){wl("ec",t,e)}const lp="components";function Ex(t,e){return up(lp,t,!0,e)||t}const cp=Symbol.for("v-ndc");function Vn(t){return ft(t)?up(lp,t,!1)||t:t||cp}function up(t,e,n=!0,s=!1){const r=on||Et;if(r){const i=r.type;{const a=gv(i,!1);if(a&&(a===e||a===pn(e)||a===ml(pn(e))))return i}const o=pf(r[t]||i[t],e)||pf(r.appContext[t],e);return!o&&s?i:o}}function pf(t,e){return t&&(t[e]||t[pn(e)]||t[ml(pn(e))])}function ve(t,e,n,s){let r;const i=n,o=Ae(t);if(o||ft(t)){const a=o&&fs(t);let l=!1,c=!1;a&&(l=!ln(t),c=ms(t),t=xl(t)),r=new Array(t.length);for(let u=0,d=t.length;u<d;u++)r[u]=e(l?c?Kr(Sn(t[u])):Sn(t[u]):t[u],u,void 0,i)}else if(typeof t=="number"){r=new Array(t);for(let a=0;a<t;a++)r[a]=e(a+1,a,void 0,i)}else if(tt(t))if(t[Symbol.iterator])r=Array.from(t,(a,l)=>e(a,l,void 0,i));else{const a=Object.keys(t);r=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const u=a[l];r[l]=e(t[u],u,l,i)}}else r=[];return r}const Gc=t=>t?Mp(t)?Cl(t):Gc(t.parent):null,Wi=St(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Gc(t.parent),$root:t=>Gc(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>fp(t),$forceUpdate:t=>t.f||(t.f=()=>{Gu(t.update)}),$nextTick:t=>t.n||(t.n=jn.bind(t.proxy)),$watch:t=>px.bind(t)}),sc=(t,e)=>t!==nt&&!t.__isScriptSetup&&Xe(t,e),Px={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:a,appContext:l}=t;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return s[e];case 2:return r[e];case 4:return n[e];case 3:return i[e]}else{if(sc(s,e))return o[e]=1,s[e];if(r!==nt&&Xe(r,e))return o[e]=2,r[e];if(Xe(i,e))return o[e]=3,i[e];if(n!==nt&&Xe(n,e))return o[e]=4,n[e];Yc&&(o[e]=0)}}const c=Wi[e];let u,d;if(c)return e==="$attrs"&&At(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==nt&&Xe(n,e))return o[e]=4,n[e];if(d=l.config.globalProperties,Xe(d,e))return d[e]},set({_:t},e,n){const{data:s,setupState:r,ctx:i}=t;return sc(r,e)?(r[e]=n,!0):s!==nt&&Xe(s,e)?(s[e]=n,!0):Xe(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(i[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:s,appContext:r,props:i,type:o}},a){let l;return!!(n[a]||t!==nt&&a[0]!=="$"&&Xe(t,a)||sc(e,a)||Xe(i,a)||Xe(s,a)||Xe(Wi,a)||Xe(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Xe(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function mf(t){return Ae(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let Yc=!0;function Rx(t){const e=fp(t),n=t.proxy,s=t.ctx;Yc=!1,e.beforeCreate&&yf(e.beforeCreate,t,"bc");const{data:r,computed:i,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:g,updated:p,activated:m,deactivated:y,beforeDestroy:x,beforeUnmount:S,destroyed:T,unmounted:v,render:_,renderTracked:P,renderTriggered:L,errorCaptured:C,serverPrefetch:w,expose:M,inheritAttrs:E,components:z,directives:V,filters:R}=e;if(c&&Dx(c,s,null),o)for(const q in o){const J=o[q];De(J)&&(s[q]=J.bind(n))}if(r){const q=r.call(n,n);tt(q)&&(t.data=vl(q))}if(Yc=!0,i)for(const q in i){const J=i[q],ge=De(J)?J.bind(n,n):De(J.get)?J.get.bind(n,n):Fn,ke=!De(J)&&De(J.set)?J.set.bind(n):Fn,ye=le({get:ge,set:ke});Object.defineProperty(s,q,{enumerable:!0,configurable:!0,get:()=>ye.value,set:ie=>ye.value=ie})}if(a)for(const q in a)dp(a[q],s,n,q);if(l){const q=De(l)?l.call(n):l;Reflect.ownKeys(q).forEach(J=>{dx(J,q[J])})}u&&yf(u,t,"c");function B(q,J){Ae(J)?J.forEach(ge=>q(ge.bind(n))):J&&q(J.bind(n))}if(B(wx,d),B(Ge,h),B(Sx,g),B($x,p),B(vx,m),B(_x,y),B(Ax,C),B(Mx,P),B(Tx,L),B(ap,S),B(tn,v),B(Cx,w),Ae(M))if(M.length){const q=t.exposed||(t.exposed={});M.forEach(J=>{Object.defineProperty(q,J,{get:()=>n[J],set:ge=>n[J]=ge,enumerable:!0})})}else t.exposed||(t.exposed={});_&&t.render===Fn&&(t.render=_),E!=null&&(t.inheritAttrs=E),z&&(t.components=z),V&&(t.directives=V),w&&ip(t)}function Dx(t,e,n=Fn){Ae(t)&&(t=Xc(t));for(const s in t){const r=t[s];let i;tt(r)?"default"in r?i=Bi(r.from||s,r.default,!0):i=Bi(r.from||s):i=Bi(r),ht(i)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):e[s]=i}}function yf(t,e,n){$n(Ae(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,n)}function dp(t,e,n,s){let r=s.includes(".")?Y0(n,s):()=>n[s];if(ft(t)){const i=e[t];De(i)&&Be(r,i)}else if(De(t))Be(r,t.bind(n));else if(tt(t))if(Ae(t))t.forEach(i=>dp(i,e,n,s));else{const i=De(t.handler)?t.handler.bind(n):e[t.handler];De(i)&&Be(r,i,t)}}function fp(t){const e=t.type,{mixins:n,extends:s}=e,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=t.appContext,a=i.get(e);let l;return a?l=a:!r.length&&!n&&!s?l=e:(l={},r.length&&r.forEach(c=>Ha(l,c,o,!0)),Ha(l,e,o)),tt(e)&&i.set(e,l),l}function Ha(t,e,n,s=!1){const{mixins:r,extends:i}=e;i&&Ha(t,i,n,!0),r&&r.forEach(o=>Ha(t,o,n,!0));for(const o in e)if(!(s&&o==="expose")){const a=Ox[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const Ox={data:bf,props:xf,emits:xf,methods:Ai,computed:Ai,beforeCreate:Nt,created:Nt,beforeMount:Nt,mounted:Nt,beforeUpdate:Nt,updated:Nt,beforeDestroy:Nt,beforeUnmount:Nt,destroyed:Nt,unmounted:Nt,activated:Nt,deactivated:Nt,errorCaptured:Nt,serverPrefetch:Nt,components:Ai,directives:Ai,watch:Lx,provide:bf,inject:Ix};function bf(t,e){return e?t?function(){return St(De(t)?t.call(this,this):t,De(e)?e.call(this,this):e)}:e:t}function Ix(t,e){return Ai(Xc(t),Xc(e))}function Xc(t){if(Ae(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Nt(t,e){return t?[...new Set([].concat(t,e))]:e}function Ai(t,e){return t?St(Object.create(null),t,e):e}function xf(t,e){return t?Ae(t)&&Ae(e)?[...new Set([...t,...e])]:St(Object.create(null),mf(t),mf(e??{})):e}function Lx(t,e){if(!t)return e;if(!e)return t;const n=St(Object.create(null),t);for(const s in e)n[s]=Nt(t[s],e[s]);return n}function hp(){return{app:null,config:{isNativeTag:p0,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 Nx=0;function Fx(t,e){return function(s,r=null){De(s)||(s=St({},s)),r!=null&&!tt(r)&&(r=null);const i=hp(),o=new WeakSet,a=[];let l=!1;const c=i.app={_uid:Nx++,_component:s,_props:r,_container:null,_context:i,_instance:null,version:Ep,get config(){return i.config},set config(u){},use(u,...d){return o.has(u)||(u&&De(u.install)?(o.add(u),u.install(c,...d)):De(u)&&(o.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,h){if(!l){const g=c._ceVNode||O(s,r);return g.appContext=i,h===!0?h="svg":h===!1&&(h=void 0),t(g,u,h),l=!0,c._container=u,u.__vue_app__=c,Cl(g.component)}},onUnmount(u){a.push(u)},unmount(){l&&($n(a,c._instance,16),t(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=cr;cr=c;try{return u()}finally{cr=d}}};return c}}let cr=null;const jx=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${pn(e)}Modifiers`]||t[`${Vs(e)}Modifiers`];function zx(t,e,...n){if(t.isUnmounted)return;const s=t.vnode.props||nt;let r=n;const i=e.startsWith("update:"),o=i&&jx(s,e.slice(7));o&&(o.trim&&(r=n.map(u=>ft(u)?u.trim():u)),o.number&&(r=n.map(yl)));let a,l=s[a=Jl(e)]||s[a=Jl(pn(e))];!l&&i&&(l=s[a=Jl(Vs(e))]),l&&$n(l,t,6,r);const c=s[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,$n(c,t,6,r)}}const Bx=new WeakMap;function gp(t,e,n=!1){const s=n?Bx:e.emitsCache,r=s.get(t);if(r!==void 0)return r;const i=t.emits;let o={},a=!1;if(!De(t)){const l=c=>{const u=gp(c,e,!0);u&&(a=!0,St(o,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!i&&!a?(tt(t)&&s.set(t,null),null):(Ae(i)?i.forEach(l=>o[l]=null):St(o,i),tt(t)&&s.set(t,o),o)}function Sl(t,e){return!t||!hl(e)?!1:(e=e.slice(2).replace(/Once$/,""),Xe(t,e[0].toLowerCase()+e.slice(1))||Xe(t,Vs(e))||Xe(t,e))}function vf(t){const{type:e,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:h,setupState:g,ctx:p,inheritAttrs:m}=t,y=za(t);let x,S;try{if(n.shapeFlag&4){const v=r||s,_=v;x=Ln(c.call(_,v,u,d,g,h,p)),S=a}else{const v=e;x=Ln(v.length>1?v(d,{attrs:a,slots:o,emit:l}):v(d,null)),S=e.props?a:Hx(a)}}catch(v){qi.length=0,_l(v,t,1),x=O(zt)}let T=x;if(S&&m!==!1){const v=Object.keys(S),{shapeFlag:_}=T;v.length&&_&7&&(i&&v.some(Fu)&&(S=Ux(S,i)),T=zs(T,S,!1,!0))}return n.dirs&&(T=zs(T,null,!1,!0),T.dirs=T.dirs?T.dirs.concat(n.dirs):n.dirs),n.transition&&so(T,n.transition),x=T,za(y),x}const Hx=t=>{let e;for(const n in t)(n==="class"||n==="style"||hl(n))&&((e||(e={}))[n]=t[n]);return e},Ux=(t,e)=>{const n={};for(const s in t)(!Fu(s)||!(s.slice(9)in e))&&(n[s]=t[s]);return n};function Vx(t,e,n){const{props:s,children:r,component:i}=t,{props:o,children:a,patchFlag:l}=e,c=i.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return s?_f(s,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const h=u[d];if(o[h]!==s[h]&&!Sl(c,h))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:s===o?!1:s?o?_f(s,o,c):!0:!!o;return!1}function _f(t,e,n){const s=Object.keys(e);if(s.length!==Object.keys(t).length)return!0;for(let r=0;r<s.length;r++){const i=s[r];if(e[i]!==t[i]&&!Sl(n,i))return!0}return!1}function Wx({vnode:t,parent:e},n){for(;e;){const s=e.subTree;if(s.suspense&&s.suspense.activeBranch===t&&(s.el=t.el),s===t)(t=e.vnode).el=n,e=e.parent;else break}}const pp={},mp=()=>Object.create(pp),yp=t=>Object.getPrototypeOf(t)===pp;function qx(t,e,n,s=!1){const r={},i=mp();t.propsDefaults=Object.create(null),bp(t,e,r,i);for(const o in t.propsOptions[0])o in r||(r[o]=void 0);n?t.props=s?r:Zb(r):t.type.props?t.props=r:t.props=i,t.attrs=i}function Kx(t,e,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=t,a=Ue(r),[l]=t.propsOptions;let c=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d<u.length;d++){let h=u[d];if(Sl(t.emitsOptions,h))continue;const g=e[h];if(l)if(Xe(i,h))g!==i[h]&&(i[h]=g,c=!0);else{const p=pn(h);r[p]=Jc(l,a,p,g,t,!1)}else g!==i[h]&&(i[h]=g,c=!0)}}}else{bp(t,e,r,i)&&(c=!0);let u;for(const d in a)(!e||!Xe(e,d)&&((u=Vs(d))===d||!Xe(e,u)))&&(l?n&&(n[d]!==void 0||n[u]!==void 0)&&(r[d]=Jc(l,a,d,void 0,t,!0)):delete r[d]);if(i!==a)for(const d in i)(!e||!Xe(e,d))&&(delete i[d],c=!0)}c&&is(t.attrs,"set","")}function bp(t,e,n,s){const[r,i]=t.propsOptions;let o=!1,a;if(e)for(let l in e){if(Fi(l))continue;const c=e[l];let u;r&&Xe(r,u=pn(l))?!i||!i.includes(u)?n[u]=c:(a||(a={}))[u]=c:Sl(t.emitsOptions,l)||(!(l in s)||c!==s[l])&&(s[l]=c,o=!0)}if(i){const l=Ue(n),c=a||nt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Jc(r,l,d,c[d],t,!Xe(c,d))}}return o}function Jc(t,e,n,s,r,i){const o=t[n];if(o!=null){const a=Xe(o,"default");if(a&&s===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&De(l)){const{propsDefaults:c}=r;if(n in c)s=c[n];else{const u=So(r);s=c[n]=l.call(null,e),u()}}else s=l;r.ce&&r.ce._setProp(n,s)}o[0]&&(i&&!a?s=!1:o[1]&&(s===""||s===Vs(n))&&(s=!0))}return s}const Gx=new WeakMap;function xp(t,e,n=!1){const s=n?Gx:e.propsCache,r=s.get(t);if(r)return r;const i=t.props,o={},a=[];let l=!1;if(!De(t)){const u=d=>{l=!0;const[h,g]=xp(d,e,!0);St(o,h),g&&a.push(...g)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!i&&!l)return tt(t)&&s.set(t,Ir),Ir;if(Ae(i))for(let u=0;u<i.length;u++){const d=pn(i[u]);kf(d)&&(o[d]=nt)}else if(i)for(const u in i){const d=pn(u);if(kf(d)){const h=i[u],g=o[d]=Ae(h)||De(h)?{type:h}:St({},h),p=g.type;let m=!1,y=!0;if(Ae(p))for(let x=0;x<p.length;++x){const S=p[x],T=De(S)&&S.name;if(T==="Boolean"){m=!0;break}else T==="String"&&(y=!1)}else m=De(p)&&p.name==="Boolean";g[0]=m,g[1]=y,(m||Xe(g,"default"))&&a.push(d)}}const c=[o,a];return tt(t)&&s.set(t,c),c}function kf(t){return t[0]!=="$"&&!Fi(t)}const Yu=t=>t==="_"||t==="_ctx"||t==="$stable",Xu=t=>Ae(t)?t.map(Ln):[Ln(t)],Yx=(t,e,n)=>{if(e._n)return e;const s=js((...r)=>Xu(e(...r)),n);return s._c=!1,s},vp=(t,e,n)=>{const s=t._ctx;for(const r in t){if(Yu(r))continue;const i=t[r];if(De(i))e[r]=Yx(r,i,s);else if(i!=null){const o=Xu(i);e[r]=()=>o}}},_p=(t,e)=>{const n=Xu(e);t.slots.default=()=>n},kp=(t,e,n)=>{for(const s in e)(n||!Yu(s))&&(t[s]=e[s])},Xx=(t,e,n)=>{const s=t.slots=mp();if(t.vnode.shapeFlag&32){const r=e._;r?(kp(s,e,n),n&&x0(s,"_",r,!0)):vp(e,s)}else e&&_p(t,e)},Jx=(t,e,n)=>{const{vnode:s,slots:r}=t;let i=!0,o=nt;if(s.shapeFlag&32){const a=e._;a?n&&a===1?i=!1:kp(r,e,n):(i=!e.$stable,vp(e,r)),o=e}else e&&(_p(t,e),o={default:1});if(i)for(const a in r)!Yu(a)&&o[a]==null&&delete r[a]},Ft=nv;function Zx(t){return Qx(t)}function Qx(t,e){const n=bl();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:g=Fn,insertStaticContent:p}=t,m=(D,F,G,ee=null,Z=null,Q=null,de=void 0,fe=null,ce=!!F.dynamicChildren)=>{if(D===F)return;D&&!rr(D,F)&&(ee=it(D),ie(D,Z,Q,!0),D=null),F.patchFlag===-2&&(ce=!1,F.dynamicChildren=null);const{type:se,ref:Ce,shapeFlag:be}=F;switch(se){case $l:y(D,F,G,ee);break;case zt:x(D,F,G,ee);break;case va:D==null&&S(F,G,ee,de);break;case ae:z(D,F,G,ee,Z,Q,de,fe,ce);break;default:be&1?_(D,F,G,ee,Z,Q,de,fe,ce):be&6?V(D,F,G,ee,Z,Q,de,fe,ce):(be&64||be&128)&&se.process(D,F,G,ee,Z,Q,de,fe,ce,It)}Ce!=null&&Z?Ui(Ce,D&&D.ref,Q,F||D,!F):Ce==null&&D&&D.ref!=null&&Ui(D.ref,null,Q,D,!0)},y=(D,F,G,ee)=>{if(D==null)s(F.el=a(F.children),G,ee);else{const Z=F.el=D.el;F.children!==D.children&&c(Z,F.children)}},x=(D,F,G,ee)=>{D==null?s(F.el=l(F.children||""),G,ee):F.el=D.el},S=(D,F,G,ee)=>{[D.el,D.anchor]=p(D.children,F,G,ee,D.el,D.anchor)},T=({el:D,anchor:F},G,ee)=>{let Z;for(;D&&D!==F;)Z=h(D),s(D,G,ee),D=Z;s(F,G,ee)},v=({el:D,anchor:F})=>{let G;for(;D&&D!==F;)G=h(D),r(D),D=G;r(F)},_=(D,F,G,ee,Z,Q,de,fe,ce)=>{if(F.type==="svg"?de="svg":F.type==="math"&&(de="mathml"),D==null)P(F,G,ee,Z,Q,de,fe,ce);else{const se=D.el&&D.el._isVueCE?D.el:null;try{se&&se._beginPatch(),w(D,F,Z,Q,de,fe,ce)}finally{se&&se._endPatch()}}},P=(D,F,G,ee,Z,Q,de,fe)=>{let ce,se;const{props:Ce,shapeFlag:be,transition:we,dirs:Te}=D;if(ce=D.el=o(D.type,Q,Ce&&Ce.is,Ce),be&8?u(ce,D.children):be&16&&C(D.children,ce,null,ee,Z,rc(D,Q),de,fe),Te&&Gs(D,null,ee,"created"),L(ce,D,D.scopeId,de,ee),Ce){for(const Le in Ce)Le!=="value"&&!Fi(Le)&&i(ce,Le,null,Ce[Le],Q,ee);"value"in Ce&&i(ce,"value",null,Ce.value,Q),(se=Ce.onVnodeBeforeMount)&&An(se,ee,D)}Te&&Gs(D,null,ee,"beforeMount");const Re=ev(Z,we);Re&&we.beforeEnter(ce),s(ce,F,G),((se=Ce&&Ce.onVnodeMounted)||Re||Te)&&Ft(()=>{se&&An(se,ee,D),Re&&we.enter(ce),Te&&Gs(D,null,ee,"mounted")},Z)},L=(D,F,G,ee,Z)=>{if(G&&g(D,G),ee)for(let Q=0;Q<ee.length;Q++)g(D,ee[Q]);if(Z){let Q=Z.subTree;if(F===Q||$p(Q.type)&&(Q.ssContent===F||Q.ssFallback===F)){const de=Z.vnode;L(D,de,de.scopeId,de.slotScopeIds,Z.parent)}}},C=(D,F,G,ee,Z,Q,de,fe,ce=0)=>{for(let se=ce;se<D.length;se++){const Ce=D[se]=fe?Ms(D[se]):Ln(D[se]);m(null,Ce,F,G,ee,Z,Q,de,fe)}},w=(D,F,G,ee,Z,Q,de)=>{const fe=F.el=D.el;let{patchFlag:ce,dynamicChildren:se,dirs:Ce}=F;ce|=D.patchFlag&16;const be=D.props||nt,we=F.props||nt;let Te;if(G&&Ys(G,!1),(Te=we.onVnodeBeforeUpdate)&&An(Te,G,F,D),Ce&&Gs(F,D,G,"beforeUpdate"),G&&Ys(G,!0),(be.innerHTML&&we.innerHTML==null||be.textContent&&we.textContent==null)&&u(fe,""),se?M(D.dynamicChildren,se,fe,G,ee,rc(F,Z),Q):de||J(D,F,fe,null,G,ee,rc(F,Z),Q,!1),ce>0){if(ce&16)E(fe,be,we,G,Z);else if(ce&2&&be.class!==we.class&&i(fe,"class",null,we.class,Z),ce&4&&i(fe,"style",be.style,we.style,Z),ce&8){const Re=F.dynamicProps;for(let Le=0;Le<Re.length;Le++){const je=Re[Le],ne=be[je],xe=we[je];(xe!==ne||je==="value")&&i(fe,je,ne,xe,Z,G)}}ce&1&&D.children!==F.children&&u(fe,F.children)}else!de&&se==null&&E(fe,be,we,G,Z);((Te=we.onVnodeUpdated)||Ce)&&Ft(()=>{Te&&An(Te,G,F,D),Ce&&Gs(F,D,G,"updated")},ee)},M=(D,F,G,ee,Z,Q,de)=>{for(let fe=0;fe<F.length;fe++){const ce=D[fe],se=F[fe],Ce=ce.el&&(ce.type===ae||!rr(ce,se)||ce.shapeFlag&198)?d(ce.el):G;m(ce,se,Ce,null,ee,Z,Q,de,!0)}},E=(D,F,G,ee,Z)=>{if(F!==G){if(F!==nt)for(const Q in F)!Fi(Q)&&!(Q in G)&&i(D,Q,F[Q],null,Z,ee);for(const Q in G){if(Fi(Q))continue;const de=G[Q],fe=F[Q];de!==fe&&Q!=="value"&&i(D,Q,fe,de,Z,ee)}"value"in G&&i(D,"value",F.value,G.value,Z)}},z=(D,F,G,ee,Z,Q,de,fe,ce)=>{const se=F.el=D?D.el:a(""),Ce=F.anchor=D?D.anchor:a("");let{patchFlag:be,dynamicChildren:we,slotScopeIds:Te}=F;Te&&(fe=fe?fe.concat(Te):Te),D==null?(s(se,G,ee),s(Ce,G,ee),C(F.children||[],G,Ce,Z,Q,de,fe,ce)):be>0&&be&64&&we&&D.dynamicChildren&&D.dynamicChildren.length===we.length?(M(D.dynamicChildren,we,G,Z,Q,de,fe),(F.key!=null||Z&&F===Z.subTree)&&Ju(D,F,!0)):J(D,F,G,Ce,Z,Q,de,fe,ce)},V=(D,F,G,ee,Z,Q,de,fe,ce)=>{F.slotScopeIds=fe,D==null?F.shapeFlag&512?Z.ctx.activate(F,G,ee,de,ce):R(F,G,ee,Z,Q,de,ce):j(D,F,ce)},R=(D,F,G,ee,Z,Q,de)=>{const fe=D.component=cv(D,ee,Z);if(kl(D)&&(fe.ctx.renderer=It),uv(fe,!1,de),fe.asyncDep){if(Z&&Z.registerDep(fe,B,de),!D.el){const ce=fe.subTree=O(zt);x(null,ce,F,G),D.placeholder=ce.el}}else B(fe,D,F,G,Z,Q,de)},j=(D,F,G)=>{const ee=F.component=D.component;if(Vx(D,F,G))if(ee.asyncDep&&!ee.asyncResolved){q(ee,F,G);return}else ee.next=F,ee.update();else F.el=D.el,ee.vnode=F},B=(D,F,G,ee,Z,Q,de)=>{const fe=()=>{if(D.isMounted){let{next:be,bu:we,u:Te,parent:Re,vnode:Le}=D;{const ot=wp(D);if(ot){be&&(be.el=Le.el,q(D,be,de)),ot.asyncDep.then(()=>{D.isUnmounted||fe()});return}}let je=be,ne;Ys(D,!1),be?(be.el=Le.el,q(D,be,de)):be=Le,we&&ba(we),(ne=be.props&&be.props.onVnodeBeforeUpdate)&&An(ne,Re,be,Le),Ys(D,!0);const xe=vf(D),Ne=D.subTree;D.subTree=xe,m(Ne,xe,d(Ne.el),it(Ne),D,Z,Q),be.el=xe.el,je===null&&Wx(D,xe.el),Te&&Ft(Te,Z),(ne=be.props&&be.props.onVnodeUpdated)&&Ft(()=>An(ne,Re,be,Le),Z)}else{let be;const{el:we,props:Te}=F,{bm:Re,m:Le,parent:je,root:ne,type:xe}=D,Ne=Vi(F);Ys(D,!1),Re&&ba(Re),!Ne&&(be=Te&&Te.onVnodeBeforeMount)&&An(be,je,F),Ys(D,!0);{ne.ce&&ne.ce._def.shadowRoot!==!1&&ne.ce._injectChildStyle(xe);const ot=D.subTree=vf(D);m(null,ot,G,ee,D,Z,Q),F.el=ot.el}if(Le&&Ft(Le,Z),!Ne&&(be=Te&&Te.onVnodeMounted)){const ot=F;Ft(()=>An(be,je,ot),Z)}(F.shapeFlag&256||je&&Vi(je.vnode)&&je.vnode.shapeFlag&256)&&D.a&&Ft(D.a,Z),D.isMounted=!0,F=G=ee=null}};D.scope.on();const ce=D.effect=new C0(fe);D.scope.off();const se=D.update=ce.run.bind(ce),Ce=D.job=ce.runIfDirty.bind(ce);Ce.i=D,Ce.id=D.uid,ce.scheduler=()=>Gu(Ce),Ys(D,!0),se()},q=(D,F,G)=>{F.component=D;const ee=D.vnode.props;D.vnode=F,D.next=null,Kx(D,F.props,ee,G),Jx(D,F.children,G),gs(),cf(D),ps()},J=(D,F,G,ee,Z,Q,de,fe,ce=!1)=>{const se=D&&D.children,Ce=D?D.shapeFlag:0,be=F.children,{patchFlag:we,shapeFlag:Te}=F;if(we>0){if(we&128){ke(se,be,G,ee,Z,Q,de,fe,ce);return}else if(we&256){ge(se,be,G,ee,Z,Q,de,fe,ce);return}}Te&8?(Ce&16&&$e(se,Z,Q),be!==se&&u(G,be)):Ce&16?Te&16?ke(se,be,G,ee,Z,Q,de,fe,ce):$e(se,Z,Q,!0):(Ce&8&&u(G,""),Te&16&&C(be,G,ee,Z,Q,de,fe,ce))},ge=(D,F,G,ee,Z,Q,de,fe,ce)=>{D=D||Ir,F=F||Ir;const se=D.length,Ce=F.length,be=Math.min(se,Ce);let we;for(we=0;we<be;we++){const Te=F[we]=ce?Ms(F[we]):Ln(F[we]);m(D[we],Te,G,null,Z,Q,de,fe,ce)}se>Ce?$e(D,Z,Q,!0,!1,be):C(F,G,ee,Z,Q,de,fe,ce,be)},ke=(D,F,G,ee,Z,Q,de,fe,ce)=>{let se=0;const Ce=F.length;let be=D.length-1,we=Ce-1;for(;se<=be&&se<=we;){const Te=D[se],Re=F[se]=ce?Ms(F[se]):Ln(F[se]);if(rr(Te,Re))m(Te,Re,G,null,Z,Q,de,fe,ce);else break;se++}for(;se<=be&&se<=we;){const Te=D[be],Re=F[we]=ce?Ms(F[we]):Ln(F[we]);if(rr(Te,Re))m(Te,Re,G,null,Z,Q,de,fe,ce);else break;be--,we--}if(se>be){if(se<=we){const Te=we+1,Re=Te<Ce?F[Te].el:ee;for(;se<=we;)m(null,F[se]=ce?Ms(F[se]):Ln(F[se]),G,Re,Z,Q,de,fe,ce),se++}}else if(se>we)for(;se<=be;)ie(D[se],Z,Q,!0),se++;else{const Te=se,Re=se,Le=new Map;for(se=Re;se<=we;se++){const Ye=F[se]=ce?Ms(F[se]):Ln(F[se]);Ye.key!=null&&Le.set(Ye.key,se)}let je,ne=0;const xe=we-Re+1;let Ne=!1,ot=0;const kt=new Array(xe);for(se=0;se<xe;se++)kt[se]=0;for(se=Te;se<=be;se++){const Ye=D[se];if(ne>=xe){ie(Ye,Z,Q,!0);continue}let xt;if(Ye.key!=null)xt=Le.get(Ye.key);else for(je=Re;je<=we;je++)if(kt[je-Re]===0&&rr(Ye,F[je])){xt=je;break}xt===void 0?ie(Ye,Z,Q,!0):(kt[xt-Re]=se+1,xt>=ot?ot=xt:Ne=!0,m(Ye,F[xt],G,null,Z,Q,de,fe,ce),ne++)}const ut=Ne?tv(kt):Ir;for(je=ut.length-1,se=xe-1;se>=0;se--){const Ye=Re+se,xt=F[Ye],vs=F[Ye+1],_s=Ye+1<Ce?vs.el||Sp(vs):ee;kt[se]===0?m(null,xt,G,_s,Z,Q,de,fe,ce):Ne&&(je<0||se!==ut[je]?ye(xt,G,_s,2):je--)}}},ye=(D,F,G,ee,Z=null)=>{const{el:Q,type:de,transition:fe,children:ce,shapeFlag:se}=D;if(se&6){ye(D.component.subTree,F,G,ee);return}if(se&128){D.suspense.move(F,G,ee);return}if(se&64){de.move(D,F,G,It);return}if(de===ae){s(Q,F,G);for(let be=0;be<ce.length;be++)ye(ce[be],F,G,ee);s(D.anchor,F,G);return}if(de===va){T(D,F,G);return}if(ee!==2&&se&1&&fe)if(ee===0)fe.beforeEnter(Q),s(Q,F,G),Ft(()=>fe.enter(Q),Z);else{const{leave:be,delayLeave:we,afterLeave:Te}=fe,Re=()=>{D.ctx.isUnmounted?r(Q):s(Q,F,G)},Le=()=>{Q._isLeaving&&Q[ss](!0),be(Q,()=>{Re(),Te&&Te()})};we?we(Q,Re,Le):Le()}else s(Q,F,G)},ie=(D,F,G,ee=!1,Z=!1)=>{const{type:Q,props:de,ref:fe,children:ce,dynamicChildren:se,shapeFlag:Ce,patchFlag:be,dirs:we,cacheIndex:Te}=D;if(be===-2&&(Z=!1),fe!=null&&(gs(),Ui(fe,null,G,D,!0),ps()),Te!=null&&(F.renderCache[Te]=void 0),Ce&256){F.ctx.deactivate(D);return}const Re=Ce&1&&we,Le=!Vi(D);let je;if(Le&&(je=de&&de.onVnodeBeforeUnmount)&&An(je,F,D),Ce&6)_e(D.component,G,ee);else{if(Ce&128){D.suspense.unmount(G,ee);return}Re&&Gs(D,null,F,"beforeUnmount"),Ce&64?D.type.remove(D,F,G,It,ee):se&&!se.hasOnce&&(Q!==ae||be>0&&be&64)?$e(se,F,G,!1,!0):(Q===ae&&be&384||!Z&&Ce&16)&&$e(ce,F,G),ee&&K(D)}(Le&&(je=de&&de.onVnodeUnmounted)||Re)&&Ft(()=>{je&&An(je,F,D),Re&&Gs(D,null,F,"unmounted")},G)},K=D=>{const{type:F,el:G,anchor:ee,transition:Z}=D;if(F===ae){te(G,ee);return}if(F===va){v(D);return}const Q=()=>{r(G),Z&&!Z.persisted&&Z.afterLeave&&Z.afterLeave()};if(D.shapeFlag&1&&Z&&!Z.persisted){const{leave:de,delayLeave:fe}=Z,ce=()=>de(G,Q);fe?fe(D.el,Q,ce):ce()}else Q()},te=(D,F)=>{let G;for(;D!==F;)G=h(D),r(D),D=G;r(F)},_e=(D,F,G)=>{const{bum:ee,scope:Z,job:Q,subTree:de,um:fe,m:ce,a:se}=D;wf(ce),wf(se),ee&&ba(ee),Z.stop(),Q&&(Q.flags|=8,ie(de,D,F,G)),fe&&Ft(fe,F),Ft(()=>{D.isUnmounted=!0},F)},$e=(D,F,G,ee=!1,Z=!1,Q=0)=>{for(let de=Q;de<D.length;de++)ie(D[de],F,G,ee,Z)},it=D=>{if(D.shapeFlag&6)return it(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const F=h(D.anchor||D.el),G=F&&F[X0];return G?h(G):F};let lt=!1;const nn=(D,F,G)=>{let ee;D==null?F._vnode&&(ie(F._vnode,null,null,!0),ee=F._vnode.component):m(F._vnode||null,D,F,null,null,null,G),F._vnode=D,lt||(lt=!0,cf(ee),W0(),lt=!1)},It={p:m,um:ie,m:ye,r:K,mt:R,mc:C,pc:J,pbc:M,n:it,o:t};return{render:nn,hydrate:void 0,createApp:Fx(nn)}}function rc({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Ys({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function ev(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Ju(t,e,n=!1){const s=t.children,r=e.children;if(Ae(s)&&Ae(r))for(let i=0;i<s.length;i++){const o=s[i];let a=r[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=r[i]=Ms(r[i]),a.el=o.el),!n&&a.patchFlag!==-2&&Ju(o,a)),a.type===$l&&(a.patchFlag!==-1?a.el=o.el:a.__elIndex=i+(t.type===ae?1:0)),a.type===zt&&!a.el&&(a.el=o.el)}}function tv(t){const e=t.slice(),n=[0];let s,r,i,o,a;const l=t.length;for(s=0;s<l;s++){const c=t[s];if(c!==0){if(r=n[n.length-1],t[r]<c){e[s]=r,n.push(s);continue}for(i=0,o=n.length-1;i<o;)a=i+o>>1,t[n[a]]<c?i=a+1:o=a;c<t[n[i]]&&(i>0&&(e[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=e[o];return n}function wp(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:wp(e)}function wf(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function Sp(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?Sp(e.subTree):null}const $p=t=>t.__isSuspense;function nv(t,e){e&&e.pendingBranch?Ae(t)?e.effects.push(...t):e.effects.push(t):ux(t)}const ae=Symbol.for("v-fgt"),$l=Symbol.for("v-txt"),zt=Symbol.for("v-cmt"),va=Symbol.for("v-stc"),qi=[];let an=null;function b(t=!1){qi.push(an=t?null:[])}function sv(){qi.pop(),an=qi[qi.length-1]||null}let ro=1;function Ua(t,e=!1){ro+=t,t<0&&an&&e&&(an.hasOnce=!0)}function Cp(t){return t.dynamicChildren=ro>0?an||Ir:null,sv(),ro>0&&an&&an.push(t),t}function k(t,e,n,s,r,i){return Cp(f(t,e,n,s,r,i,!0))}function pe(t,e,n,s,r){return Cp(O(t,e,n,s,r,!0))}function Va(t){return t?t.__v_isVNode===!0:!1}function rr(t,e){return t.type===e.type&&t.key===e.key}const Tp=({key:t})=>t??null,_a=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?ft(t)||ht(t)||De(t)?{i:on,r:t,k:e,f:!!n}:t:null);function f(t,e=null,n=null,s=0,r=null,i=t===ae?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Tp(e),ref:e&&_a(e),scopeId:K0,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:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:on};return a?(Zu(l,n),i&128&&t.normalize(l)):n&&(l.shapeFlag|=ft(n)?8:16),ro>0&&!o&&an&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&an.push(l),l}const O=rv;function rv(t,e=null,n=null,s=0,r=null,i=!1){if((!t||t===cp)&&(t=zt),Va(t)){const a=zs(t,e,!0);return n&&Zu(a,n),ro>0&&!i&&an&&(a.shapeFlag&6?an[an.indexOf(t)]=a:an.push(a)),a.patchFlag=-2,a}if(pv(t)&&(t=t.__vccOpts),e){e=iv(e);let{class:a,style:l}=e;a&&!ft(a)&&(e.class=re(a)),tt(l)&&(oi(l)&&!Ae(l)&&(l=St({},l)),e.style=wt(l))}const o=ft(t)?1:$p(t)?128:J0(t)?64:tt(t)?4:De(t)?2:0;return f(t,e,n,s,r,o,i,!0)}function iv(t){return t?oi(t)||yp(t)?St({},t):t:null}function zs(t,e,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:a,transition:l}=t,c=e?ov(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&Tp(c),ref:e&&e.ref?n&&i?Ae(i)?i.concat(_a(e)):[i,_a(e)]:_a(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ae?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&zs(t.ssContent),ssFallback:t.ssFallback&&zs(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&s&&so(u,l.clone(u)),u}function oe(t=" ",e=0){return O($l,null,t,e)}function Bs(t,e){const n=O(va,null,t);return n.staticCount=e,n}function H(t="",e=!1){return e?(b(),pe(zt,null,t)):O(zt,null,t)}function Ln(t){return t==null||typeof t=="boolean"?O(zt):Ae(t)?O(ae,null,t.slice()):Va(t)?Ms(t):O($l,null,String(t))}function Ms(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:zs(t)}function Zu(t,e){let n=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(Ae(e))n=16;else if(typeof e=="object")if(s&65){const r=e.default;r&&(r._c&&(r._d=!1),Zu(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!yp(e)?e._ctx=on:r===3&&on&&(on.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else De(e)?(e={default:e,_ctx:on},n=32):(e=String(e),s&64?(n=16,e=[oe(e)]):n=8);t.children=e,t.shapeFlag|=n}function ov(...t){const e={};for(let n=0;n<t.length;n++){const s=t[n];for(const r in s)if(r==="class")e.class!==s.class&&(e.class=re([e.class,s.class]));else if(r==="style")e.style=wt([e.style,s.style]);else if(hl(r)){const i=e[r],o=s[r];o&&i!==o&&!(Ae(i)&&i.includes(o))&&(e[r]=i?[].concat(i,o):o)}else r!==""&&(e[r]=s[r])}return e}function An(t,e,n,s=null){$n(t,e,7,[n,s])}const av=hp();let lv=0;function cv(t,e,n){const s=t.type,r=(e?e.appContext:t.appContext)||av,i={uid:lv++,vnode:t,type:s,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new w0(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:xp(s,r),emitsOptions:gp(s,r),emit:null,emitted:null,propsDefaults:nt,inheritAttrs:s.inheritAttrs,ctx:nt,data:nt,props:nt,attrs:nt,slots:nt,refs:nt,setupState:nt,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 i.ctx={_:i},i.root=e?e.root:i,i.emit=zx.bind(null,i),t.ce&&t.ce(i),i}let Et=null;const Qu=()=>Et||on;let Wa,Zc;{const t=bl(),e=(n,s)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};Wa=e("__VUE_INSTANCE_SETTERS__",n=>Et=n),Zc=e("__VUE_SSR_SETTERS__",n=>io=n)}const So=t=>{const e=Et;return Wa(t),t.scope.on(),()=>{t.scope.off(),Wa(e)}},Sf=()=>{Et&&Et.scope.off(),Wa(null)};function Mp(t){return t.vnode.shapeFlag&4}let io=!1;function uv(t,e=!1,n=!1){e&&Zc(e);const{props:s,children:r}=t.vnode,i=Mp(t);qx(t,s,i,e),Xx(t,r,n||e);const o=i?dv(t,e):void 0;return e&&Zc(!1),o}function dv(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Px);const{setup:s}=n;if(s){gs();const r=t.setupContext=s.length>1?hv(t):null,i=So(t),o=wo(s,t,0,[t.props,r]),a=m0(o);if(ps(),i(),(a||t.sp)&&!Vi(t)&&ip(t),a){if(o.then(Sf,Sf),e)return o.then(l=>{$f(t,l)}).catch(l=>{_l(l,t,0)});t.asyncDep=o}else $f(t,o)}else Ap(t)}function $f(t,e,n){De(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:tt(e)&&(t.setupState=H0(e)),Ap(t)}function Ap(t,e,n){const s=t.type;t.render||(t.render=s.render||Fn);{const r=So(t);gs();try{Rx(t)}finally{ps(),r()}}}const fv={get(t,e){return At(t,"get",""),t[e]}};function hv(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,fv),slots:t.slots,emit:t.emit,expose:e}}function Cl(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(H0(Ku(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Wi)return Wi[n](t)},has(e,n){return n in e||n in Wi}})):t.proxy}function gv(t,e=!0){return De(t)?t.displayName||t.name:t.name||e&&t.__name}function pv(t){return De(t)&&"__vccOpts"in t}const le=(t,e)=>ix(t,e,io);function Yr(t,e,n){try{Ua(-1);const s=arguments.length;return s===2?tt(e)&&!Ae(e)?Va(e)?O(t,null,[e]):O(t,e):O(t,null,e):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Va(n)&&(n=[n]),O(t,e,n))}finally{Ua(1)}}const Ep="3.5.26";/**
|
|
14
|
+
* @vue/runtime-dom v3.5.26
|
|
15
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
+
* @license MIT
|
|
17
|
+
**/let Qc;const Cf=typeof window<"u"&&window.trustedTypes;if(Cf)try{Qc=Cf.createPolicy("vue",{createHTML:t=>t})}catch{}const Pp=Qc?t=>Qc.createHTML(t):t=>t,mv="http://www.w3.org/2000/svg",yv="http://www.w3.org/1998/Math/MathML",ts=typeof document<"u"?document:null,Tf=ts&&ts.createElement("template"),bv={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,s)=>{const r=e==="svg"?ts.createElementNS(mv,t):e==="mathml"?ts.createElementNS(yv,t):n?ts.createElement(t,{is:n}):ts.createElement(t);return t==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:t=>ts.createTextNode(t),createComment:t=>ts.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ts.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,s,r,i){const o=n?n.previousSibling:e.lastChild;if(r&&(r===i||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{Tf.innerHTML=Pp(s==="svg"?`<svg>${t}</svg>`:s==="mathml"?`<math>${t}</math>`:t);const a=Tf.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},ks="transition",fi="animation",oo=Symbol("_vtc"),Rp={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},xv=St({},ep,Rp),vv=t=>(t.displayName="Transition",t.props=xv,t),mr=vv((t,{slots:e})=>Yr(xx,_v(t),e)),Xs=(t,e=[])=>{Ae(t)?t.forEach(n=>n(...e)):t&&t(...e)},Mf=t=>t?Ae(t)?t.some(e=>e.length>1):t.length>1:!1;function _v(t){const e={};for(const z in t)z in Rp||(e[z]=t[z]);if(t.css===!1)return e;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:g=`${n}-leave-to`}=t,p=kv(r),m=p&&p[0],y=p&&p[1],{onBeforeEnter:x,onEnter:S,onEnterCancelled:T,onLeave:v,onLeaveCancelled:_,onBeforeAppear:P=x,onAppear:L=S,onAppearCancelled:C=T}=e,w=(z,V,R,j)=>{z._enterCancelled=j,Js(z,V?u:a),Js(z,V?c:o),R&&R()},M=(z,V)=>{z._isLeaving=!1,Js(z,d),Js(z,g),Js(z,h),V&&V()},E=z=>(V,R)=>{const j=z?L:S,B=()=>w(V,z,R);Xs(j,[V,B]),Af(()=>{Js(V,z?l:i),Yn(V,z?u:a),Mf(j)||Ef(V,s,m,B)})};return St(e,{onBeforeEnter(z){Xs(x,[z]),Yn(z,i),Yn(z,o)},onBeforeAppear(z){Xs(P,[z]),Yn(z,l),Yn(z,c)},onEnter:E(!1),onAppear:E(!0),onLeave(z,V){z._isLeaving=!0;const R=()=>M(z,V);Yn(z,d),z._enterCancelled?(Yn(z,h),Df(z)):(Df(z),Yn(z,h)),Af(()=>{z._isLeaving&&(Js(z,d),Yn(z,g),Mf(v)||Ef(z,s,y,R))}),Xs(v,[z,R])},onEnterCancelled(z){w(z,!1,void 0,!0),Xs(T,[z])},onAppearCancelled(z){w(z,!0,void 0,!0),Xs(C,[z])},onLeaveCancelled(z){M(z),Xs(_,[z])}})}function kv(t){if(t==null)return null;if(tt(t))return[ic(t.enter),ic(t.leave)];{const e=ic(t);return[e,e]}}function ic(t){return Sb(t)}function Yn(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[oo]||(t[oo]=new Set)).add(e)}function Js(t,e){e.split(/\s+/).forEach(s=>s&&t.classList.remove(s));const n=t[oo];n&&(n.delete(e),n.size||(t[oo]=void 0))}function Af(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let wv=0;function Ef(t,e,n,s){const r=t._endId=++wv,i=()=>{r===t._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:l}=Sv(t,e);if(!o)return s();const c=o+"end";let u=0;const d=()=>{t.removeEventListener(c,h),i()},h=g=>{g.target===t&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),t.addEventListener(c,h)}function Sv(t,e){const n=window.getComputedStyle(t),s=p=>(n[p]||"").split(", "),r=s(`${ks}Delay`),i=s(`${ks}Duration`),o=Pf(r,i),a=s(`${fi}Delay`),l=s(`${fi}Duration`),c=Pf(a,l);let u=null,d=0,h=0;e===ks?o>0&&(u=ks,d=o,h=i.length):e===fi?c>0&&(u=fi,d=c,h=l.length):(d=Math.max(o,c),u=d>0?o>c?ks:fi:null,h=u?u===ks?i.length:l.length:0);const g=u===ks&&/\b(?:transform|all)(?:,|$)/.test(s(`${ks}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:g}}function Pf(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,s)=>Rf(n)+Rf(t[s])))}function Rf(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Df(t){return(t?t.ownerDocument:document).body.offsetHeight}function $v(t,e,n){const s=t[oo];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const qa=Symbol("_vod"),Dp=Symbol("_vsh"),Cv={name:"show",beforeMount(t,{value:e},{transition:n}){t[qa]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):hi(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:s}){!e!=!n&&(s?e?(s.beforeEnter(t),hi(t,!0),s.enter(t)):s.leave(t,()=>{hi(t,!1)}):hi(t,e))},beforeUnmount(t,{value:e}){hi(t,e)}};function hi(t,e){t.style.display=e?t[qa]:"none",t[Dp]=!e}const Tv=Symbol(""),Mv=/(?:^|;)\s*display\s*:/;function Av(t,e,n){const s=t.style,r=ft(n);let i=!1;if(n&&!r){if(e)if(ft(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&ka(s,a,"")}else for(const o in e)n[o]==null&&ka(s,o,"");for(const o in n)o==="display"&&(i=!0),ka(s,o,n[o])}else if(r){if(e!==n){const o=s[Tv];o&&(n+=";"+o),s.cssText=n,i=Mv.test(n)}}else e&&t.removeAttribute("style");qa in t&&(t[qa]=i?s.display:"",t[Dp]&&(s.display="none"))}const Of=/\s*!important$/;function ka(t,e,n){if(Ae(n))n.forEach(s=>ka(t,e,s));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const s=Ev(t,e);Of.test(n)?t.setProperty(Vs(s),n.replace(Of,""),"important"):t[s]=n}}const If=["Webkit","Moz","ms"],oc={};function Ev(t,e){const n=oc[e];if(n)return n;let s=pn(e);if(s!=="filter"&&s in t)return oc[e]=s;s=ml(s);for(let r=0;r<If.length;r++){const i=If[r]+s;if(i in t)return oc[e]=i}return e}const Lf="http://www.w3.org/1999/xlink";function Nf(t,e,n,s,r,i=Eb(e)){s&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Lf,e.slice(6,e.length)):t.setAttributeNS(Lf,e,n):n==null||i&&!v0(n)?t.removeAttribute(e):t.setAttribute(e,i?"":Un(n)?String(n):n)}function Ff(t,e,n,s,r){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?Pp(n):n);return}const i=t.tagName;if(e==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?t.getAttribute("value")||"":t.value,l=n==null?t.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in t))&&(t.value=l),n==null&&t.removeAttribute(e),t._value=n;return}let o=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=v0(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{t[e]=n}catch{}o&&t.removeAttribute(r||e)}function as(t,e,n,s){t.addEventListener(e,n,s)}function Pv(t,e,n,s){t.removeEventListener(e,n,s)}const jf=Symbol("_vei");function Rv(t,e,n,s,r=null){const i=t[jf]||(t[jf]={}),o=i[e];if(s&&o)o.value=s;else{const[a,l]=Dv(e);if(s){const c=i[e]=Lv(s,r);as(t,a,c,l)}else o&&(Pv(t,a,o,l),i[e]=void 0)}}const zf=/(?:Once|Passive|Capture)$/;function Dv(t){let e;if(zf.test(t)){e={};let s;for(;s=t.match(zf);)t=t.slice(0,t.length-s[0].length),e[s[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Vs(t.slice(2)),e]}let ac=0;const Ov=Promise.resolve(),Iv=()=>ac||(Ov.then(()=>ac=0),ac=Date.now());function Lv(t,e){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;$n(Nv(s,n.value),e,5,[s])};return n.value=t,n.attached=Iv(),n}function Nv(t,e){if(Ae(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(s=>r=>!r._stopped&&s&&s(r))}else return e}const Bf=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Fv=(t,e,n,s,r,i)=>{const o=r==="svg";e==="class"?$v(t,s,o):e==="style"?Av(t,n,s):hl(e)?Fu(e)||Rv(t,e,n,s,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):jv(t,e,s,o))?(Ff(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Nf(t,e,s,o,i,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!ft(s))?Ff(t,pn(e),s,i,e):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),Nf(t,e,s,o))};function jv(t,e,n,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&Bf(e)&&De(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Bf(e)&&ft(n)?!1:e in t}const Hs=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Ae(e)?n=>ba(e,n):e};function zv(t){t.target.composing=!0}function Hf(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const gn=Symbol("_assign");function Uf(t,e,n){return e&&(t=t.trim()),n&&(t=yl(t)),t}const rt={created(t,{modifiers:{lazy:e,trim:n,number:s}},r){t[gn]=Hs(r);const i=s||r.props&&r.props.type==="number";as(t,e?"change":"input",o=>{o.target.composing||t[gn](Uf(t.value,n,i))}),(n||i)&&as(t,"change",()=>{t.value=Uf(t.value,n,i)}),e||(as(t,"compositionstart",zv),as(t,"compositionend",Hf),as(t,"change",Hf))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(t[gn]=Hs(o),t.composing)return;const a=(i||t.type==="number")&&!/^0\d/.test(t.value)?yl(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(s&&e===n||r&&t.value.trim()===l)||(t.value=l))}},yr={deep:!0,created(t,e,n){t[gn]=Hs(n),as(t,"change",()=>{const s=t._modelValue,r=Xr(t),i=t.checked,o=t[gn];if(Ae(s)){const a=zu(s,r),l=a!==-1;if(i&&!l)o(s.concat(r));else if(!i&&l){const c=[...s];c.splice(a,1),o(c)}}else if(ii(s)){const a=new Set(s);i?a.add(r):a.delete(r),o(a)}else o(Op(t,i))})},mounted:Vf,beforeUpdate(t,e,n){t[gn]=Hs(n),Vf(t,e,n)}};function Vf(t,{value:e,oldValue:n},s){t._modelValue=e;let r;if(Ae(e))r=zu(e,s.props.value)>-1;else if(ii(e))r=e.has(s.props.value);else{if(e===n)return;r=pr(e,Op(t,!0))}t.checked!==r&&(t.checked=r)}const Bv={created(t,{value:e},n){t.checked=pr(e,n.props.value),t[gn]=Hs(n),as(t,"change",()=>{t[gn](Xr(t))})},beforeUpdate(t,{value:e,oldValue:n},s){t[gn]=Hs(s),e!==n&&(t.checked=pr(e,s.props.value))}},cn={deep:!0,created(t,{value:e,modifiers:{number:n}},s){const r=ii(e);as(t,"change",()=>{const i=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?yl(Xr(o)):Xr(o));t[gn](t.multiple?r?new Set(i):i:i[0]),t._assigning=!0,jn(()=>{t._assigning=!1})}),t[gn]=Hs(s)},mounted(t,{value:e}){Wf(t,e)},beforeUpdate(t,e,n){t[gn]=Hs(n)},updated(t,{value:e}){t._assigning||Wf(t,e)}};function Wf(t,e){const n=t.multiple,s=Ae(e);if(!(n&&!s&&!ii(e))){for(let r=0,i=t.options.length;r<i;r++){const o=t.options[r],a=Xr(o);if(n)if(s){const l=typeof a;l==="string"||l==="number"?o.selected=e.some(c=>String(c)===String(a)):o.selected=zu(e,a)>-1}else o.selected=e.has(a);else if(pr(Xr(o),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Xr(t){return"_value"in t?t._value:t.value}function Op(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const Hv=["ctrl","shift","alt","meta"],Uv={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Hv.some(n=>t[`${n}Key`]&&!e.includes(n))},pt=(t,e)=>{const n=t._withMods||(t._withMods={}),s=e.join(".");return n[s]||(n[s]=(r,...i)=>{for(let o=0;o<e.length;o++){const a=Uv[e[o]];if(a&&a(r,e))return}return t(r,...i)})},Vv={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Fr=(t,e)=>{const n=t._withKeys||(t._withKeys={}),s=e.join(".");return n[s]||(n[s]=r=>{if(!("key"in r))return;const i=Vs(r.key);if(e.some(o=>o===i||Vv[o]===i))return t(r)})},Wv=St({patchProp:Fv},bv);let qf;function qv(){return qf||(qf=Zx(Wv))}const Kv=(...t)=>{const e=qv().createApp(...t),{mount:n}=e;return e.mount=s=>{const r=Yv(s);if(!r)return;const i=e._component;!De(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,Gv(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e};function Gv(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Yv(t){return ft(t)?document.querySelector(t):t}/*!
|
|
18
|
+
* pinia v2.3.1
|
|
19
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
20
|
+
* @license MIT
|
|
21
|
+
*/let Ip;const Tl=t=>Ip=t,Lp=Symbol();function eu(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Ki;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Ki||(Ki={}));function Xv(){const t=S0(!0),e=t.run(()=>I({}));let n=[],s=[];const r=Ku({install(i){Tl(r),r._a=i,i.provide(Lp,r),i.config.globalProperties.$pinia=r,s.forEach(o=>n.push(o)),s=[]},use(i){return this._a?n.push(i):s.push(i),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return r}const Np=()=>{};function Kf(t,e,n,s=Np){t.push(e);const r=()=>{const i=t.indexOf(e);i>-1&&(t.splice(i,1),s())};return!n&&$0()&&Rb(r),r}function Er(t,...e){t.slice().forEach(n=>{n(...e)})}const Jv=t=>t(),Gf=Symbol(),lc=Symbol();function tu(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,s)=>t.set(s,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const s=e[n],r=t[n];eu(r)&&eu(s)&&t.hasOwnProperty(n)&&!ht(s)&&!fs(s)?t[n]=tu(r,s):t[n]=s}return t}const Zv=Symbol();function Qv(t){return!eu(t)||!t.hasOwnProperty(Zv)}const{assign:$s}=Object;function e1(t){return!!(ht(t)&&t.effect)}function t1(t,e,n,s){const{state:r,actions:i,getters:o}=e,a=n.state.value[t];let l;function c(){a||(n.state.value[t]=r?r():{});const u=tx(n.state.value[t]);return $s(u,i,Object.keys(o||{}).reduce((d,h)=>(d[h]=Ku(le(()=>{Tl(n);const g=n._s.get(t);return o[h].call(g,g)})),d),{}))}return l=Fp(t,c,e,n,s,!0),l}function Fp(t,e,n={},s,r,i){let o;const a=$s({actions:{}},n),l={deep:!0};let c,u,d=[],h=[],g;const p=s.state.value[t];!i&&!p&&(s.state.value[t]={}),I({});let m;function y(C){let w;c=u=!1,typeof C=="function"?(C(s.state.value[t]),w={type:Ki.patchFunction,storeId:t,events:g}):(tu(s.state.value[t],C),w={type:Ki.patchObject,payload:C,storeId:t,events:g});const M=m=Symbol();jn().then(()=>{m===M&&(c=!0)}),u=!0,Er(d,w,s.state.value[t])}const x=i?function(){const{state:w}=n,M=w?w():{};this.$patch(E=>{$s(E,M)})}:Np;function S(){o.stop(),d=[],h=[],s._s.delete(t)}const T=(C,w="")=>{if(Gf in C)return C[lc]=w,C;const M=function(){Tl(s);const E=Array.from(arguments),z=[],V=[];function R(q){z.push(q)}function j(q){V.push(q)}Er(h,{args:E,name:M[lc],store:_,after:R,onError:j});let B;try{B=C.apply(this&&this.$id===t?this:_,E)}catch(q){throw Er(V,q),q}return B instanceof Promise?B.then(q=>(Er(z,q),q)).catch(q=>(Er(V,q),Promise.reject(q))):(Er(z,B),B)};return M[Gf]=!0,M[lc]=w,M},v={_p:s,$id:t,$onAction:Kf.bind(null,h),$patch:y,$reset:x,$subscribe(C,w={}){const M=Kf(d,C,w.detached,()=>E()),E=o.run(()=>Be(()=>s.state.value[t],z=>{(w.flush==="sync"?u:c)&&C({storeId:t,type:Ki.direct,events:g},z)},$s({},l,w)));return M},$dispose:S},_=vl(v);s._s.set(t,_);const L=(s._a&&s._a.runWithContext||Jv)(()=>s._e.run(()=>(o=S0()).run(()=>e({action:T}))));for(const C in L){const w=L[C];if(ht(w)&&!e1(w)||fs(w))i||(p&&Qv(w)&&(ht(w)?w.value=p[C]:tu(w,p[C])),s.state.value[t][C]=w);else if(typeof w=="function"){const M=T(w,C);L[C]=M,a.actions[C]=w}}return $s(_,L),$s(Ue(_),L),Object.defineProperty(_,"$state",{get:()=>s.state.value[t],set:C=>{y(w=>{$s(w,C)})}}),s._p.forEach(C=>{$s(_,o.run(()=>C({store:_,app:s._a,pinia:s,options:a})))}),p&&i&&n.hydrate&&n.hydrate(_.$state,p),c=!0,u=!0,_}/*! #__NO_SIDE_EFFECTS__ */function jp(t,e,n){let s,r;const i=typeof e=="function";typeof t=="string"?(s=t,r=i?n:e):(r=t,s=t.id);function o(a,l){const c=fx();return a=a||(c?Bi(Lp,null):null),a&&Tl(a),a=Ip,a._s.has(s)||(i?Fp(s,e,r,a):t1(s,r,a)),a._s.get(s)}return o.$id=s,o}function zp(t,e){return function(){return t.apply(e,arguments)}}const{toString:n1}=Object.prototype,{getPrototypeOf:ed}=Object,{iterator:Ml,toStringTag:Bp}=Symbol,Al=(t=>e=>{const n=n1.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Cn=t=>(t=t.toLowerCase(),e=>Al(e)===t),El=t=>e=>typeof e===t,{isArray:ai}=Array,Jr=El("undefined");function $o(t){return t!==null&&!Jr(t)&&t.constructor!==null&&!Jr(t.constructor)&&Jt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Hp=Cn("ArrayBuffer");function s1(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Hp(t.buffer),e}const r1=El("string"),Jt=El("function"),Up=El("number"),Co=t=>t!==null&&typeof t=="object",i1=t=>t===!0||t===!1,wa=t=>{if(Al(t)!=="object")return!1;const e=ed(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Bp in t)&&!(Ml in t)},o1=t=>{if(!Co(t)||$o(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},a1=Cn("Date"),l1=Cn("File"),c1=Cn("Blob"),u1=Cn("FileList"),d1=t=>Co(t)&&Jt(t.pipe),f1=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Jt(t.append)&&((e=Al(t))==="formdata"||e==="object"&&Jt(t.toString)&&t.toString()==="[object FormData]"))},h1=Cn("URLSearchParams"),[g1,p1,m1,y1]=["ReadableStream","Request","Response","Headers"].map(Cn),b1=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function To(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,r;if(typeof t!="object"&&(t=[t]),ai(t))for(s=0,r=t.length;s<r;s++)e.call(null,t[s],s,t);else{if($o(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(s=0;s<o;s++)a=i[s],e.call(null,t[a],a,t)}}function Vp(t,e){if($o(t))return null;e=e.toLowerCase();const n=Object.keys(t);let s=n.length,r;for(;s-- >0;)if(r=n[s],e===r.toLowerCase())return r;return null}const ir=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wp=t=>!Jr(t)&&t!==ir;function nu(){const{caseless:t,skipUndefined:e}=Wp(this)&&this||{},n={},s=(r,i)=>{const o=t&&Vp(n,i)||i;wa(n[o])&&wa(r)?n[o]=nu(n[o],r):wa(r)?n[o]=nu({},r):ai(r)?n[o]=r.slice():(!e||!Jr(r))&&(n[o]=r)};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&To(arguments[r],s);return n}const x1=(t,e,n,{allOwnKeys:s}={})=>(To(e,(r,i)=>{n&&Jt(r)?t[i]=zp(r,n):t[i]=r},{allOwnKeys:s}),t),v1=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),_1=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},k1=(t,e,n,s)=>{let r,i,o;const a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)o=r[i],(!s||s(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&ed(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},w1=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},S1=t=>{if(!t)return null;if(ai(t))return t;let e=t.length;if(!Up(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},$1=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ed(Uint8Array)),C1=(t,e)=>{const s=(t&&t[Ml]).call(t);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(t,i[0],i[1])}},T1=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},M1=Cn("HTMLFormElement"),A1=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),Yf=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),E1=Cn("RegExp"),qp=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};To(n,(r,i)=>{let o;(o=e(r,i,t))!==!1&&(s[i]=o||r)}),Object.defineProperties(t,s)},P1=t=>{qp(t,(e,n)=>{if(Jt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(Jt(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},R1=(t,e)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return ai(t)?s(t):s(String(t).split(e)),n},D1=()=>{},O1=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function I1(t){return!!(t&&Jt(t.append)&&t[Bp]==="FormData"&&t[Ml])}const L1=t=>{const e=new Array(10),n=(s,r)=>{if(Co(s)){if(e.indexOf(s)>=0)return;if($o(s))return s;if(!("toJSON"in s)){e[r]=s;const i=ai(s)?[]:{};return To(s,(o,a)=>{const l=n(o,r+1);!Jr(l)&&(i[a]=l)}),e[r]=void 0,i}}return s};return n(t,0)},N1=Cn("AsyncFunction"),F1=t=>t&&(Co(t)||Jt(t))&&Jt(t.then)&&Jt(t.catch),Kp=((t,e)=>t?setImmediate:e?((n,s)=>(ir.addEventListener("message",({source:r,data:i})=>{r===ir&&i===n&&s.length&&s.shift()()},!1),r=>{s.push(r),ir.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Jt(ir.postMessage)),j1=typeof queueMicrotask<"u"?queueMicrotask.bind(ir):typeof process<"u"&&process.nextTick||Kp,z1=t=>t!=null&&Jt(t[Ml]),W={isArray:ai,isArrayBuffer:Hp,isBuffer:$o,isFormData:f1,isArrayBufferView:s1,isString:r1,isNumber:Up,isBoolean:i1,isObject:Co,isPlainObject:wa,isEmptyObject:o1,isReadableStream:g1,isRequest:p1,isResponse:m1,isHeaders:y1,isUndefined:Jr,isDate:a1,isFile:l1,isBlob:c1,isRegExp:E1,isFunction:Jt,isStream:d1,isURLSearchParams:h1,isTypedArray:$1,isFileList:u1,forEach:To,merge:nu,extend:x1,trim:b1,stripBOM:v1,inherits:_1,toFlatObject:k1,kindOf:Al,kindOfTest:Cn,endsWith:w1,toArray:S1,forEachEntry:C1,matchAll:T1,isHTMLForm:M1,hasOwnProperty:Yf,hasOwnProp:Yf,reduceDescriptors:qp,freezeMethods:P1,toObjectSet:R1,toCamelCase:A1,noop:D1,toFiniteNumber:O1,findKey:Vp,global:ir,isContextDefined:Wp,isSpecCompliantForm:I1,toJSONObject:L1,isAsyncFn:N1,isThenable:F1,setImmediate:Kp,asap:j1,isIterable:z1};function Ie(t,e,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}W.inherits(Ie,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:W.toJSONObject(this.config),code:this.code,status:this.status}}});const Gp=Ie.prototype,Yp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Yp[t]={value:t}});Object.defineProperties(Ie,Yp);Object.defineProperty(Gp,"isAxiosError",{value:!0});Ie.from=(t,e,n,s,r,i)=>{const o=Object.create(Gp);W.toFlatObject(t,o,function(u){return u!==Error.prototype},c=>c!=="isAxiosError");const a=t&&t.message?t.message:"Error",l=e==null&&t?t.code:e;return Ie.call(o,a,l,n,s,r),t&&o.cause==null&&Object.defineProperty(o,"cause",{value:t,configurable:!0}),o.name=t&&t.name||"Error",i&&Object.assign(o,i),o};const B1=null;function su(t){return W.isPlainObject(t)||W.isArray(t)}function Xp(t){return W.endsWith(t,"[]")?t.slice(0,-2):t}function Xf(t,e,n){return t?t.concat(e).map(function(r,i){return r=Xp(r),!n&&i?"["+r+"]":r}).join(n?".":""):e}function H1(t){return W.isArray(t)&&!t.some(su)}const U1=W.toFlatObject(W,{},null,function(e){return/^is[A-Z]/.test(e)});function Pl(t,e,n){if(!W.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=W.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!W.isUndefined(y[m])});const s=n.metaTokens,r=n.visitor||u,i=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&W.isSpecCompliantForm(e);if(!W.isFunction(r))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(W.isDate(p))return p.toISOString();if(W.isBoolean(p))return p.toString();if(!l&&W.isBlob(p))throw new Ie("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(p)||W.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let x=p;if(p&&!y&&typeof p=="object"){if(W.endsWith(m,"{}"))m=s?m:m.slice(0,-2),p=JSON.stringify(p);else if(W.isArray(p)&&H1(p)||(W.isFileList(p)||W.endsWith(m,"[]"))&&(x=W.toArray(p)))return m=Xp(m),x.forEach(function(T,v){!(W.isUndefined(T)||T===null)&&e.append(o===!0?Xf([m],v,i):o===null?m:m+"[]",c(T))}),!1}return su(p)?!0:(e.append(Xf(y,m,i),c(p)),!1)}const d=[],h=Object.assign(U1,{defaultVisitor:u,convertValue:c,isVisitable:su});function g(p,m){if(!W.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),W.forEach(p,function(x,S){(!(W.isUndefined(x)||x===null)&&r.call(e,x,W.isString(S)?S.trim():S,m,h))===!0&&g(x,m?m.concat(S):[S])}),d.pop()}}if(!W.isObject(t))throw new TypeError("data must be an object");return g(t),e}function Jf(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function td(t,e){this._pairs=[],t&&Pl(t,this,e)}const Jp=td.prototype;Jp.append=function(e,n){this._pairs.push([e,n])};Jp.toString=function(e){const n=e?function(s){return e.call(this,s,Jf)}:Jf;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function V1(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Zp(t,e,n){if(!e)return t;const s=n&&n.encode||V1;W.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let i;if(r?i=r(e,n):i=W.isURLSearchParams(e)?e.toString():new td(e,n).toString(s),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Zf{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){W.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Qp={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},W1=typeof URLSearchParams<"u"?URLSearchParams:td,q1=typeof FormData<"u"?FormData:null,K1=typeof Blob<"u"?Blob:null,G1={isBrowser:!0,classes:{URLSearchParams:W1,FormData:q1,Blob:K1},protocols:["http","https","file","blob","url","data"]},nd=typeof window<"u"&&typeof document<"u",ru=typeof navigator=="object"&&navigator||void 0,Y1=nd&&(!ru||["ReactNative","NativeScript","NS"].indexOf(ru.product)<0),X1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",J1=nd&&window.location.href||"http://localhost",Z1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nd,hasStandardBrowserEnv:Y1,hasStandardBrowserWebWorkerEnv:X1,navigator:ru,origin:J1},Symbol.toStringTag,{value:"Module"})),Pt={...Z1,...G1};function Q1(t,e){return Pl(t,new Pt.classes.URLSearchParams,{visitor:function(n,s,r,i){return Pt.isNode&&W.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function e_(t){return W.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function t_(t){const e={},n=Object.keys(t);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],e[i]=t[i];return e}function em(t){function e(n,s,r,i){let o=n[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=i>=n.length;return o=!o&&W.isArray(r)?r.length:o,l?(W.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!W.isObject(r[o]))&&(r[o]=[]),e(n,s,r[o],i)&&W.isArray(r[o])&&(r[o]=t_(r[o])),!a)}if(W.isFormData(t)&&W.isFunction(t.entries)){const n={};return W.forEachEntry(t,(s,r)=>{e(e_(s),r,n,0)}),n}return null}function n_(t,e,n){if(W.isString(t))try{return(e||JSON.parse)(t),W.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const Mo={transitional:Qp,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=W.isObject(e);if(i&&W.isHTMLForm(e)&&(e=new FormData(e)),W.isFormData(e))return r?JSON.stringify(em(e)):e;if(W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e)||W.isReadableStream(e))return e;if(W.isArrayBufferView(e))return e.buffer;if(W.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Q1(e,this.formSerializer).toString();if((a=W.isFileList(e))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Pl(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),n_(e)):e}],transformResponse:[function(e){const n=this.transitional||Mo.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(W.isResponse(e)||W.isReadableStream(e))return e;if(e&&W.isString(e)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?Ie.from(a,Ie.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pt.classes.FormData,Blob:Pt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};W.forEach(["delete","get","head","post","put","patch"],t=>{Mo.headers[t]={}});const s_=W.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),r_=t=>{const e={};let n,s,r;return t&&t.split(`
|
|
22
|
+
`).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!n||e[n]&&s_[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},Qf=Symbol("internals");function gi(t){return t&&String(t).trim().toLowerCase()}function Sa(t){return t===!1||t==null?t:W.isArray(t)?t.map(Sa):String(t)}function i_(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const o_=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function cc(t,e,n,s,r){if(W.isFunction(s))return s.call(this,e,n);if(r&&(e=n),!!W.isString(e)){if(W.isString(s))return e.indexOf(s)!==-1;if(W.isRegExp(s))return s.test(e)}}function a_(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function l_(t,e){const n=W.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(r,i,o){return this[s].call(this,e,r,i,o)},configurable:!0})})}let Zt=class{constructor(e){e&&this.set(e)}set(e,n,s){const r=this;function i(a,l,c){const u=gi(l);if(!u)throw new Error("header name must be a non-empty string");const d=W.findKey(r,u);(!d||r[d]===void 0||c===!0||c===void 0&&r[d]!==!1)&&(r[d||l]=Sa(a))}const o=(a,l)=>W.forEach(a,(c,u)=>i(c,u,l));if(W.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(W.isString(e)&&(e=e.trim())&&!o_(e))o(r_(e),n);else if(W.isObject(e)&&W.isIterable(e)){let a={},l,c;for(const u of e){if(!W.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?W.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}o(a,n)}else e!=null&&i(n,e,s);return this}get(e,n){if(e=gi(e),e){const s=W.findKey(this,e);if(s){const r=this[s];if(!n)return r;if(n===!0)return i_(r);if(W.isFunction(n))return n.call(this,r,s);if(W.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=gi(e),e){const s=W.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||cc(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let r=!1;function i(o){if(o=gi(o),o){const a=W.findKey(s,o);a&&(!n||cc(s,s[a],a,n))&&(delete s[a],r=!0)}}return W.isArray(e)?e.forEach(i):i(e),r}clear(e){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const i=n[s];(!e||cc(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const n=this,s={};return W.forEach(this,(r,i)=>{const o=W.findKey(s,i);if(o){n[o]=Sa(r),delete n[i];return}const a=e?a_(i):String(i).trim();a!==i&&delete n[i],n[a]=Sa(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return W.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=e&&W.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
23
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[Qf]=this[Qf]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=gi(o);s[a]||(l_(r,o),s[a]=!0)}return W.isArray(e)?e.forEach(i):i(e),this}};Zt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);W.reduceDescriptors(Zt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}});W.freezeMethods(Zt);function uc(t,e){const n=this||Mo,s=e||n,r=Zt.from(s.headers);let i=s.data;return W.forEach(t,function(a){i=a.call(n,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function tm(t){return!!(t&&t.__CANCEL__)}function li(t,e,n){Ie.call(this,t??"canceled",Ie.ERR_CANCELED,e,n),this.name="CanceledError"}W.inherits(li,Ie,{__CANCEL__:!0});function nm(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new Ie("Request failed with status code "+n.status,[Ie.ERR_BAD_REQUEST,Ie.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function c_(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function u_(t,e){t=t||10;const n=new Array(t),s=new Array(t);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=s[i];o||(o=c),n[r]=l,s[r]=c;let d=i,h=0;for(;d!==r;)h+=n[d++],d=d%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),c-o<e)return;const g=u&&c-u;return g?Math.round(h*1e3/g):void 0}}function d_(t,e){let n=0,s=1e3/e,r,i;const o=(c,u=Date.now())=>{n=u,r=null,i&&(clearTimeout(i),i=null),t(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=s?o(c,u):(r=c,i||(i=setTimeout(()=>{i=null,o(r)},s-d)))},()=>r&&o(r)]}const Ka=(t,e,n=3)=>{let s=0;const r=u_(50,250);return d_(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,l=o-s,c=r(l),u=o<=a;s=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(d)},n)},eh=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},th=t=>(...e)=>W.asap(()=>t(...e)),f_=Pt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Pt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Pt.origin),Pt.navigator&&/(msie|trident)/i.test(Pt.navigator.userAgent)):()=>!0,h_=Pt.hasStandardBrowserEnv?{write(t,e,n,s,r,i,o){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];W.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),W.isString(s)&&a.push(`path=${s}`),W.isString(r)&&a.push(`domain=${r}`),i===!0&&a.push("secure"),W.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function g_(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function p_(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function sm(t,e,n){let s=!g_(e);return t&&(s||n==!1)?p_(t,e):e}const nh=t=>t instanceof Zt?{...t}:t;function br(t,e){e=e||{};const n={};function s(c,u,d,h){return W.isPlainObject(c)&&W.isPlainObject(u)?W.merge.call({caseless:h},c,u):W.isPlainObject(u)?W.merge({},u):W.isArray(u)?u.slice():u}function r(c,u,d,h){if(W.isUndefined(u)){if(!W.isUndefined(c))return s(void 0,c,d,h)}else return s(c,u,d,h)}function i(c,u){if(!W.isUndefined(u))return s(void 0,u)}function o(c,u){if(W.isUndefined(u)){if(!W.isUndefined(c))return s(void 0,c)}else return s(void 0,u)}function a(c,u,d){if(d in e)return s(c,u);if(d in t)return s(void 0,c)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,d)=>r(nh(c),nh(u),d,!0)};return W.forEach(Object.keys({...t,...e}),function(u){const d=l[u]||r,h=d(t[u],e[u],u);W.isUndefined(h)&&d!==a||(n[u]=h)}),n}const rm=t=>{const e=br({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=e;if(e.headers=o=Zt.from(o),e.url=Zp(sm(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),W.isFormData(n)){if(Pt.hasStandardBrowserEnv||Pt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(W.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&o.set(u,d)})}}if(Pt.hasStandardBrowserEnv&&(s&&W.isFunction(s)&&(s=s(e)),s||s!==!1&&f_(e.url))){const l=r&&i&&h_.read(i);l&&o.set(r,l)}return e},m_=typeof XMLHttpRequest<"u",y_=m_&&function(t){return new Promise(function(n,s){const r=rm(t);let i=r.data;const o=Zt.from(r.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=r,u,d,h,g,p;function m(){g&&g(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function x(){if(!y)return;const T=Zt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:T,config:t,request:y};nm(function(L){n(L),m()},function(L){s(L),m()},_),y=null}"onloadend"in y?y.onloadend=x:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(x)},y.onabort=function(){y&&(s(new Ie("Request aborted",Ie.ECONNABORTED,t,y)),y=null)},y.onerror=function(v){const _=v&&v.message?v.message:"Network Error",P=new Ie(_,Ie.ERR_NETWORK,t,y);P.event=v||null,s(P),y=null},y.ontimeout=function(){let v=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const _=r.transitional||Qp;r.timeoutErrorMessage&&(v=r.timeoutErrorMessage),s(new Ie(v,_.clarifyTimeoutError?Ie.ETIMEDOUT:Ie.ECONNABORTED,t,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&W.forEach(o.toJSON(),function(v,_){y.setRequestHeader(_,v)}),W.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),c&&([h,p]=Ka(c,!0),y.addEventListener("progress",h)),l&&y.upload&&([d,g]=Ka(l),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",g)),(r.cancelToken||r.signal)&&(u=T=>{y&&(s(!T||T.type?new li(null,t,y):T),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const S=c_(r.url);if(S&&Pt.protocols.indexOf(S)===-1){s(new Ie("Unsupported protocol "+S+":",Ie.ERR_BAD_REQUEST,t));return}y.send(i||null)})},b_=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,r;const i=function(c){if(!r){r=!0,a();const u=c instanceof Error?c:this.reason;s.abort(u instanceof Ie?u:new li(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,i(new Ie(`timeout ${e} of ms exceeded`,Ie.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),t=null)};t.forEach(c=>c.addEventListener("abort",i));const{signal:l}=s;return l.unsubscribe=()=>W.asap(a),l}},x_=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,r;for(;s<n;)r=s+e,yield t.slice(s,r),s=r},v_=async function*(t,e){for await(const n of __(t))yield*x_(n,e)},__=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},sh=(t,e,n,s)=>{const r=v_(t,e);let i=0,o,a=l=>{o||(o=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await r.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=i+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},rh=64*1024,{isFunction:Wo}=W,k_=(({Request:t,Response:e})=>({Request:t,Response:e}))(W.global),{ReadableStream:ih,TextEncoder:oh}=W.global,ah=(t,...e)=>{try{return!!t(...e)}catch{return!1}},w_=t=>{t=W.merge.call({skipUndefined:!0},k_,t);const{fetch:e,Request:n,Response:s}=t,r=e?Wo(e):typeof fetch=="function",i=Wo(n),o=Wo(s);if(!r)return!1;const a=r&&Wo(ih),l=r&&(typeof oh=="function"?(p=>m=>p.encode(m))(new oh):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=i&&a&&ah(()=>{let p=!1;const m=new n(Pt.origin,{body:new ih,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!m}),u=o&&a&&ah(()=>W.isReadableStream(new s("").body)),d={stream:u&&(p=>p.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(m,y)=>{let x=m&&m[p];if(x)return x.call(m);throw new Ie(`Response type '${p}' is not supported`,Ie.ERR_NOT_SUPPORT,y)})});const h=async p=>{if(p==null)return 0;if(W.isBlob(p))return p.size;if(W.isSpecCompliantForm(p))return(await new n(Pt.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(W.isArrayBufferView(p)||W.isArrayBuffer(p))return p.byteLength;if(W.isURLSearchParams(p)&&(p=p+""),W.isString(p))return(await l(p)).byteLength},g=async(p,m)=>{const y=W.toFiniteNumber(p.getContentLength());return y??h(m)};return async p=>{let{url:m,method:y,data:x,signal:S,cancelToken:T,timeout:v,onDownloadProgress:_,onUploadProgress:P,responseType:L,headers:C,withCredentials:w="same-origin",fetchOptions:M}=rm(p),E=e||fetch;L=L?(L+"").toLowerCase():"text";let z=b_([S,T&&T.toAbortSignal()],v),V=null;const R=z&&z.unsubscribe&&(()=>{z.unsubscribe()});let j;try{if(P&&c&&y!=="get"&&y!=="head"&&(j=await g(C,x))!==0){let ye=new n(m,{method:"POST",body:x,duplex:"half"}),ie;if(W.isFormData(x)&&(ie=ye.headers.get("content-type"))&&C.setContentType(ie),ye.body){const[K,te]=eh(j,Ka(th(P)));x=sh(ye.body,rh,K,te)}}W.isString(w)||(w=w?"include":"omit");const B=i&&"credentials"in n.prototype,q={...M,signal:z,method:y.toUpperCase(),headers:C.normalize().toJSON(),body:x,duplex:"half",credentials:B?w:void 0};V=i&&new n(m,q);let J=await(i?E(V,M):E(m,q));const ge=u&&(L==="stream"||L==="response");if(u&&(_||ge&&R)){const ye={};["status","statusText","headers"].forEach(_e=>{ye[_e]=J[_e]});const ie=W.toFiniteNumber(J.headers.get("content-length")),[K,te]=_&&eh(ie,Ka(th(_),!0))||[];J=new s(sh(J.body,rh,K,()=>{te&&te(),R&&R()}),ye)}L=L||"text";let ke=await d[W.findKey(d,L)||"text"](J,p);return!ge&&R&&R(),await new Promise((ye,ie)=>{nm(ye,ie,{data:ke,headers:Zt.from(J.headers),status:J.status,statusText:J.statusText,config:p,request:V})})}catch(B){throw R&&R(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new Ie("Network Error",Ie.ERR_NETWORK,p,V),{cause:B.cause||B}):Ie.from(B,B&&B.code,p,V)}}},S_=new Map,im=t=>{let e=t&&t.env||{};const{fetch:n,Request:s,Response:r}=e,i=[s,r,n];let o=i.length,a=o,l,c,u=S_;for(;a--;)l=i[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:w_(e)),u=c;return c};im();const sd={http:B1,xhr:y_,fetch:{get:im}};W.forEach(sd,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const lh=t=>`- ${t}`,$_=t=>W.isFunction(t)||t===null||t===!1;function C_(t,e){t=W.isArray(t)?t:[t];const{length:n}=t;let s,r;const i={};for(let o=0;o<n;o++){s=t[o];let a;if(r=s,!$_(s)&&(r=sd[(a=String(s)).toLowerCase()],r===void 0))throw new Ie(`Unknown adapter '${a}'`);if(r&&(W.isFunction(r)||(r=r.get(e))))break;i[a||"#"+o]=r}if(!r){const o=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since :
|
|
24
|
+
`+o.map(lh).join(`
|
|
25
|
+
`):" "+lh(o[0]):"as no adapter specified";throw new Ie("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r}const om={getAdapter:C_,adapters:sd};function dc(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new li(null,t)}function ch(t){return dc(t),t.headers=Zt.from(t.headers),t.data=uc.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),om.getAdapter(t.adapter||Mo.adapter,t)(t).then(function(s){return dc(t),s.data=uc.call(t,t.transformResponse,s),s.headers=Zt.from(s.headers),s},function(s){return tm(s)||(dc(t),s&&s.response&&(s.response.data=uc.call(t,t.transformResponse,s.response),s.response.headers=Zt.from(s.response.headers))),Promise.reject(s)})}const am="1.13.2",Rl={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Rl[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const uh={};Rl.transitional=function(e,n,s){function r(i,o){return"[Axios v"+am+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(e===!1)throw new Ie(r(o," has been removed"+(n?" in "+n:"")),Ie.ERR_DEPRECATED);return n&&!uh[o]&&(uh[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,o,a):!0}};Rl.spelling=function(e){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function T_(t,e,n){if(typeof t!="object")throw new Ie("options must be an object",Ie.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let r=s.length;for(;r-- >0;){const i=s[r],o=e[i];if(o){const a=t[i],l=a===void 0||o(a,i,t);if(l!==!0)throw new Ie("option "+i+" must be "+l,Ie.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ie("Unknown option "+i,Ie.ERR_BAD_OPTION)}}const $a={assertOptions:T_,validators:Rl},En=$a.validators;let ur=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Zf,response:new Zf}}async request(e,n){try{return await this._request(e,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
26
|
+
`+i):s.stack=i}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=br(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&$a.assertOptions(s,{silentJSONParsing:En.transitional(En.boolean),forcedJSONParsing:En.transitional(En.boolean),clarifyTimeoutError:En.transitional(En.boolean)},!1),r!=null&&(W.isFunction(r)?n.paramsSerializer={serialize:r}:$a.assertOptions(r,{encode:En.function,serialize:En.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),$a.assertOptions(n,{baseUrl:En.spelling("baseURL"),withXsrfToken:En.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&W.merge(i.common,i[n.method]);i&&W.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Zt.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[ch.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let g=n;for(;d<h;){const p=a[d++],m=a[d++];try{g=p(g)}catch(y){m.call(this,y);break}}try{u=ch.call(this,g)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=br(this.defaults,e);const n=sm(e.baseURL,e.url,e.allowAbsoluteUrls);return Zp(n,e.params,e.paramsSerializer)}};W.forEach(["delete","get","head","options"],function(e){ur.prototype[e]=function(n,s){return this.request(br(s||{},{method:e,url:n,data:(s||{}).data}))}});W.forEach(["post","put","patch"],function(e){function n(s){return function(i,o,a){return this.request(br(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}ur.prototype[e]=n(),ur.prototype[e+"Form"]=n(!0)});let M_=class lm{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},e(function(i,o,a){s.reason||(s.reason=new li(i,o,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new lm(function(r){e=r}),cancel:e}}};function A_(t){return function(n){return t.apply(null,n)}}function E_(t){return W.isObject(t)&&t.isAxiosError===!0}const iu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(iu).forEach(([t,e])=>{iu[e]=t});function cm(t){const e=new ur(t),n=zp(ur.prototype.request,e);return W.extend(n,ur.prototype,e,{allOwnKeys:!0}),W.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return cm(br(t,r))},n}const gt=cm(Mo);gt.Axios=ur;gt.CanceledError=li;gt.CancelToken=M_;gt.isCancel=tm;gt.VERSION=am;gt.toFormData=Pl;gt.AxiosError=Ie;gt.Cancel=gt.CanceledError;gt.all=function(e){return Promise.all(e)};gt.spread=A_;gt.isAxiosError=E_;gt.mergeConfig=br;gt.AxiosHeaders=Zt;gt.formToJSON=t=>em(W.isHTMLForm(t)?new FormData(t):t);gt.getAdapter=om.getAdapter;gt.HttpStatusCode=iu;gt.default=gt;const{Axios:bB,AxiosError:xB,CanceledError:vB,isCancel:_B,CancelToken:kB,VERSION:wB,all:SB,Cancel:$B,isAxiosError:CB,spread:TB,toFormData:MB,AxiosHeaders:AB,HttpStatusCode:EB,formToJSON:PB,getAdapter:RB,mergeConfig:DB}=gt,Pe=gt.create({baseURL:"/api",timeout:1e4});async function P_(){return(await Pe.get("/projects")).data}function Ao(t){return{...t,memory_type:t.memory_type||t.type||"other"}}async function R_(t,e={},n=50,s=0){var o;const r=new URLSearchParams({project:t,limit:n.toString(),offset:s.toString()});return e.memory_type&&r.set("type",e.memory_type),e.status&&r.set("status",e.status),(o=e.tags)!=null&&o.length&&r.set("tags",e.tags.join(",")),e.search&&r.set("search",e.search),e.min_importance!==null&&e.min_importance!==void 0&&r.set("min_importance",e.min_importance.toString()),e.max_importance!==null&&e.max_importance!==void 0&&r.set("max_importance",e.max_importance.toString()),e.sort_by&&r.set("sort_by",e.sort_by),e.sort_order&&r.set("sort_order",e.sort_order),(await Pe.get(`/memories?${r}`)).data.map(Ao)}async function D_(t){return(await Pe.get(`/memories/stats/summary?project=${encodeURIComponent(t)}`)).data}async function O_(t,e,n){const s=await Pe.put(`/memories/${e}?project=${encodeURIComponent(t)}`,n);return Ao(s.data)}async function I_(t,e){return(await Pe.delete(`/memories/${e}?project=${encodeURIComponent(t)}`)).data}async function L_(t,e){const n=await Pe.post(`/memories?project=${encodeURIComponent(t)}`,e);return Ao(n.data)}async function N_(t,e,n,s=100,r=0){const i=new URLSearchParams({project:t,limit:s.toString(),offset:r.toString()});return(await Pe.get(`/activities?${i}`)).data}async function F_(t,e=24,n=!0,s=!0){const r=new URLSearchParams({project:t,hours:e.toString(),include_memories:n.toString(),include_activities:s.toString()});return(await Pe.get(`/timeline?${r}`)).data}async function j_(t){return(await Pe.get(`/tags?project=${encodeURIComponent(t)}`)).data}async function um(t){return(await Pe.get("/chat/status")).data}let jr=null;function ou(){jr&&(jr.abort(),jr=null)}async function z_(t,e,n=10){ou(),jr=new AbortController;try{return(await Pe.post(`/chat?project=${encodeURIComponent(t)}`,{question:e,max_memories:n},{timeout:12e4,signal:jr.signal})).data}catch(s){if(gt.isCancel(s))throw new Error("Request cancelled");if(s instanceof Error){if(s.message.includes("timeout"))throw new Error("The AI is taking too long to respond. Please try a simpler question or try again later.");if(s.message.includes("Network Error"))throw new Error("Network error. Please check your connection and try again.")}throw s}finally{jr=null}}function B_(t,e,n,s,r,i,o=!1){const a=`/api/chat/stream?project=${encodeURIComponent(t)}&question=${encodeURIComponent(e)}&use_style=${o}`,l=new EventSource(a);return l.onmessage=c=>{try{const u=JSON.parse(c.data);switch(u.type){case"sources":s(u.data);break;case"chunk":n(u.data);break;case"done":l.close(),r();break;case"error":l.close(),i(new Error(u.data||"Stream error"));break}}catch(u){console.error("Failed to parse SSE event:",u)}},l.onerror=()=>{l.close(),i(new Error("Stream connection failed"))},()=>l.close()}async function H_(t,e){return(await Pe.post(`/chat/save?project=${encodeURIComponent(t)}`,e,{timeout:6e4})).data}async function U_(t,e){return(await Pe.post(`/compose-response?project=${encodeURIComponent(t)}`,e,{timeout:6e4})).data}async function V_(t,e=90){return(await Pe.get(`/stats/activity-heatmap?project=${encodeURIComponent(t)}&days=${e}`)).data}async function W_(t,e=10){return(await Pe.get(`/stats/tool-usage?project=${encodeURIComponent(t)}&limit=${e}`)).data}async function q_(t,e=30){return(await Pe.get(`/stats/memory-growth?project=${encodeURIComponent(t)}&days=${e}`)).data}async function K_(t,e,n=30){let s=`/stats/command-usage?project=${encodeURIComponent(t)}&days=${n}`;return e&&(s+=`&scope=${e}`),(await Pe.get(s)).data}async function G_(t,e,n=30){let s=`/stats/skill-usage?project=${encodeURIComponent(t)}&days=${n}`;return e&&(s+=`&scope=${e}`),(await Pe.get(s)).data}async function Y_(t,e=30){return(await Pe.get(`/stats/mcp-usage?project=${encodeURIComponent(t)}&days=${e}`)).data}async function X_(t,e){return(await Pe.get(`/activities/${e}?project=${encodeURIComponent(t)}`)).data}async function J_(t,e=5){return(await Pe.get(`/sessions/recent?project=${encodeURIComponent(t)}&limit=${e}`)).data}async function Z_(t,e=30,n=50){return(await Pe.get(`/memories/needs-review?project=${encodeURIComponent(t)}&days_threshold=${e}&limit=${n}`)).data.map(Ao)}async function Q_(t,e,n){return(await Pe.post(`/memories/bulk-update-status?project=${encodeURIComponent(t)}&status=${n}`,e)).data}async function ek(t,e,n=2){let s=`/relationships/graph?project=${encodeURIComponent(t)}&depth=${n}`;return e&&(s+=`¢er_id=${encodeURIComponent(e)}`),(await Pe.get(s)).data}async function tk(){return(await Pe.get("/projects/config")).data}async function nk(t,e){await Pe.post("/projects/register",{path:t,display_name:e})}async function sk(t){await Pe.delete("/projects/register",{params:{path:t}})}async function rk(t){return(await Pe.post("/projects/favorite",null,{params:{path:t}})).data.is_favorite}async function ik(t){await Pe.post("/projects/scan-directories",null,{params:{directory:t}})}async function ok(t){await Pe.delete("/projects/scan-directories",{params:{directory:t}})}async function ak(){return(await Pe.post("/projects/refresh")).data.count}async function dm(){return(await Pe.get("/image/status")).data}async function lk(){return(await Pe.get("/image/presets")).data}async function ck(t,e){return(await Pe.post(`/image/generate-batch?project=${encodeURIComponent(t)}`,e,{timeout:18e4})).data}async function uk(t){return(await Pe.post("/image/refine",t,{timeout:18e4})).data}async function dk(t){await Pe.post("/image/clear-conversation")}async function fk(t,e={},n=50,s=0){return(await Pe.post("/aggregate/memories",{projects:t,filters:{...e,limit:n,offset:s}})).data.map(i=>({...Ao(i),source_project:i.source_project,source_project_name:i.source_project_name}))}async function hk(t){return(await Pe.post("/aggregate/stats",{projects:t})).data}async function gk(t){return(await Pe.post("/aggregate/tags",{projects:t})).data}async function pk(t,e={},n=50,s=0){const r=new URLSearchParams({project:t,limit:n.toString(),offset:s.toString()});return e.tone&&r.set("tone",e.tone),e.search&&r.set("search",e.search),e.min_word_count!==void 0&&r.set("min_word_count",e.min_word_count.toString()),e.max_word_count!==void 0&&r.set("max_word_count",e.max_word_count.toString()),e.since&&r.set("since",e.since),e.until&&r.set("until",e.until),(await Pe.get(`/user-messages?${r}`)).data}async function mk(t,e){return(await Pe.delete(`/user-messages/${e}?project=${encodeURIComponent(t)}`)).data}async function yk(t){return(await Pe.get(`/style/profile?project=${encodeURIComponent(t)}`)).data}async function bk(t,e=3){return(await Pe.get(`/style/samples?project=${encodeURIComponent(t)}&samples_per_tone=${e}`)).data}async function fm(t,e,n=!1,s=50){const r=new URLSearchParams({project:t,limit:s.toString()});return e&&e!=="all"&&r.set("type",e),n&&r.set("active_only","true"),(await Pe.get(`/agents?${r}`)).data}async function dh(t,e){return(await Pe.get(`/agents/${encodeURIComponent(e)}/stats?project=${encodeURIComponent(t)}`)).data}async function xk(t,e=20){return(await Pe.get(`/adw/list?project=${encodeURIComponent(t)}&limit=${e}`)).data}async function vk(t,e){return(await Pe.get(`/adw/${encodeURIComponent(e)}?project=${encodeURIComponent(t)}`)).data}const We=jp("dashboard",()=>{const t=I([]),e=I([]),n=le(()=>e.value[0]||null),s=I([]),r=I(null),i=I(null),o=I([]),a=I([]),l=I([]),c=I(null),u=I({memory_type:null,status:null,tags:[],search:"",min_importance:null,max_importance:null,sort_by:"last_accessed",sort_order:"desc"}),d=I(!1),h=I(null),g=I(!1),p=I(null),m=I(0),y=I(50),x=I(!0),S=le(()=>{var ne;return((ne=n.value)==null?void 0:ne.db_path)??""}),T=le(()=>e.value.map(ne=>ne.db_path)),v=le(()=>e.value.length>1),_=le(()=>e.value.some(ne=>ne.is_global)),P=le(()=>e.value.some(ne=>!ne.is_global)),L=le(()=>_.value&&P.value),C=le(()=>L.value?e.value.filter(ne=>!ne.is_global).reduce((ne,xe)=>ne+xe.memory_count,0):0);async function w(){d.value=!0,h.value=null;try{t.value=await P_(),await M(),!n.value&&t.value.length>0&&await E(t.value[0])}catch(ne){h.value=ne instanceof Error?ne.message:"Failed to load projects",console.error("Failed to load projects:",ne)}finally{d.value=!1}}async function M(){try{c.value=await tk()}catch(ne){console.error("Failed to load project config:",ne)}}async function E(ne){e.value=[ne],s.value=[],r.value=null,m.value=0,x.value=!0,await q()}function z(ne){e.value.findIndex(Ne=>Ne.db_path===ne.db_path)>=0?e.value=e.value.filter(Ne=>Ne.db_path!==ne.db_path):e.value=[...e.value,ne],q()}function V(){e.value=[...t.value],q()}function R(){e.value=[],s.value=[],i.value=null,l.value=[]}function j(){const ne=t.value.find(xe=>xe.is_global);ne&&(e.value=[ne],q())}function B(){e.value=e.value.filter(ne=>!ne.is_global),q()}async function q(){if(e.value.length===0){s.value=[],i.value=null,l.value=[];return}m.value=0,x.value=!0,await Promise.all([K(),te(),_e()])}async function J(ne=!1){if(S.value){ne&&(m.value=0,x.value=!0),d.value=!0,h.value=null;try{const xe=await R_(S.value,u.value,y.value,m.value*y.value);ne?s.value=xe:s.value=[...s.value,...xe],x.value=xe.length===y.value,p.value=Date.now()}catch(xe){h.value=xe instanceof Error?xe.message:"Failed to load memories",console.error("Failed to load memories:",xe)}finally{d.value=!1}}}async function ge(){await Promise.all([J(!0),ye(),ie()])}async function ke(){!x.value||d.value||(m.value++,await J(!1))}async function ye(){if(S.value)try{i.value=await D_(S.value)}catch(ne){console.error("Failed to load stats:",ne)}}async function ie(){if(S.value)try{l.value=await j_(S.value)}catch(ne){console.error("Failed to load tags:",ne)}}async function K(ne=!0){if(T.value.length!==0){ne&&(m.value=0,x.value=!0),d.value=!0,h.value=null;try{const xe=await fk(T.value,u.value,y.value,m.value*y.value);ne?s.value=xe:s.value=[...s.value,...xe],x.value=xe.length===y.value,p.value=Date.now()}catch(xe){h.value=xe instanceof Error?xe.message:"Failed to load memories",console.error("Failed to load aggregate memories:",xe)}finally{d.value=!1}}}async function te(){if(T.value.length!==0)try{i.value=await hk(T.value)}catch(ne){console.error("Failed to load aggregate stats:",ne)}}async function _e(){if(T.value.length!==0)try{l.value=await gk(T.value)}catch(ne){console.error("Failed to load aggregate tags:",ne)}}async function $e(){if(S.value)try{o.value=await N_(S.value)}catch(ne){console.error("Failed to load activities:",ne)}}async function it(ne=24){if(S.value)try{a.value=await F_(S.value,ne)}catch(xe){console.error("Failed to load timeline:",xe)}}async function lt(ne){r.value=ne}function nn(){r.value=null}function It(ne){u.value={...u.value,...ne},J(!0)}function qs(){u.value={memory_type:null,status:null,tags:[],search:"",min_importance:null,max_importance:null,sort_by:"last_accessed",sort_order:"desc"},J(!0)}async function D(ne){if(!S.value||!ne.trim()){It({search:""});return}It({search:ne})}async function F(ne){if(!S.value)return null;try{const xe=await L_(S.value,ne);return ce(xe),await ie(),xe}catch(xe){return h.value=xe instanceof Error?xe.message:"Failed to create memory",console.error("Failed to create memory:",xe),null}}async function G(ne,xe){if(!S.value)return null;try{const Ne=await O_(S.value,ne,xe);return se(Ne),Ne}catch(Ne){return h.value=Ne instanceof Error?Ne.message:"Failed to update memory",console.error("Failed to update memory:",Ne),null}}async function ee(ne){if(!S.value)return!1;try{return await I_(S.value,ne),Ce(ne),!0}catch(xe){return h.value=xe instanceof Error?xe.message:"Failed to delete memory",console.error("Failed to delete memory:",xe),!1}}const Z=I([]),Q=I([]),de=I(new Set),fe=I(0);function ce(ne){s.value=[ne,...s.value],i.value&&(i.value={...i.value,total_count:i.value.total_count+1}),p.value=Date.now()}function se(ne){var Ne;const xe=s.value.findIndex(ot=>ot.id===ne.id);if(xe!==-1){const ot=[...s.value];ot[xe]=ne,s.value=ot}((Ne=r.value)==null?void 0:Ne.id)===ne.id&&(r.value=ne),p.value=Date.now()}function Ce(ne){var xe;s.value=s.value.filter(Ne=>Ne.id!==ne),((xe=r.value)==null?void 0:xe.id)===ne&&(r.value=null),i.value&&(i.value={...i.value,total_count:i.value.total_count-1}),p.value=Date.now()}function be(){J(!0),ye(),ie(),p.value=Date.now()}function we(ne){var kt;if(!S.value||!ne.project.includes(((kt=n.value)==null?void 0:kt.name)||"")){const ut=S.value.replace(/\\/g,"/").toLowerCase(),Ye=ne.project.replace(/\\/g,"/").toLowerCase();if(!Ye.includes(ut)&&!ut.includes(Ye))return}const xe=ne.activity;if(Z.value.some(ut=>ut.id===xe.id))return;Z.value=[xe,...Z.value].slice(0,100),o.value.some(ut=>ut.id===xe.id)||(o.value=[xe,...o.value].slice(0,200)),de.value=new Set([...de.value,xe.id]),setTimeout(()=>{de.value=new Set([...de.value].filter(ut=>ut!==xe.id))},3e3),fe.value=Date.now(),p.value=Date.now()}function Te(ne){const xe=S.value.replace(/\\/g,"/").toLowerCase(),Ne=ne.project.replace(/\\/g,"/").toLowerCase();if(!Ne.includes(xe)&&!xe.includes(Ne))return;const ot=ne.session,kt=Q.value.findIndex(ut=>ut.id===ot.id);if(kt!==-1){const ut=[...Q.value];ut[kt]=ot,Q.value=ut}else Q.value=[ot,...Q.value].slice(0,10);p.value=Date.now()}function Re(ne){const xe=S.value.replace(/\\/g,"/").toLowerCase(),Ne=ne.project.replace(/\\/g,"/").toLowerCase();!Ne.includes(xe)&&!xe.includes(Ne)||(ne.stats&&(i.value=ne.stats),p.value=Date.now())}function Le(ne){g.value=ne}function je(ne){return de.value.has(ne)}return{projects:t,selectedProjects:e,currentProject:n,projectConfig:c,memories:s,selectedMemory:r,stats:i,activities:o,timeline:a,tags:l,filters:u,isLoading:d,error:h,isConnected:g,lastUpdated:p,hasMore:x,recentActivities:Z,recentSessions:Q,newActivityIds:de,lastActivityTimestamp:fe,currentDbPath:S,selectedDbPaths:T,isMultiProject:v,hasGlobalSelected:_,hasNonGlobalSelected:P,showDuplicationWarning:L,estimatedOverlapCount:C,loadProjects:w,loadProjectConfig:M,switchProject:E,toggleProjectSelection:z,selectAllProjects:V,clearProjectSelection:R,selectGlobalOnly:j,selectProjectsOnly:B,loadAggregateData:q,loadMemories:J,loadMore:ke,refresh:ge,loadStats:ye,loadTags:ie,loadAggregateMemories:K,loadAggregateStats:te,loadAggregateTags:_e,loadActivities:$e,loadTimeline:it,selectMemory:lt,clearSelection:nn,applyFilters:It,resetFilters:qs,search:D,createMemory:F,updateMemory:G,deleteMemoryById:ee,handleMemoryCreated:ce,handleMemoryUpdated:se,handleMemoryDeleted:Ce,handleDatabaseChanged:be,setConnected:Le,handleActivityLogged:we,handleSessionUpdated:Te,handleStatsUpdated:Re,isNewActivity:je}}),fc=[{id:"welcome",target:".app-header",title:"Welcome to Omni-Cortex Dashboard!",description:"Your AI memory management system. Let's take a quick tour of the main features.",position:"bottom"},{id:"project-switcher",target:".project-switcher",title:"Project Switcher",description:"Switch between different projects to view their memories. Each project has its own memory database.",position:"bottom"},{id:"search",target:".search-input",title:"Search Memories",description:"Search through your memories using keywords. Press / to focus, Enter to search, Esc to clear.",position:"bottom"},{id:"live-status",target:".live-status",title:"Live Status",description:"Shows real-time connection status and when data was last updated. Updates automatically every second.",position:"left"},{id:"tabs",target:".tab-navigation",title:"Dashboard Tabs",description:"Navigate between Memories, Activity timeline, Statistics, Review panel, Relationship Graph, and AI Chat.",position:"bottom"},{id:"memory-browser",target:".memory-browser",title:"Memory Browser",description:"Browse, filter, and manage your memories. Click any memory to view details. Use j/k keys to navigate.",position:"right"},{id:"keyboard-shortcuts",target:".help-button",title:"Need Help?",description:"Click here anytime to see keyboard shortcuts, replay this tour, or get help. Press ? for quick access.",position:"left"}],rd=jp("onboarding",()=>{const t=I(localStorage.getItem("onboarding_completed")==="true"),e=I(!1),n=I(0),s=le(()=>e.value?fc[n.value]:null),r=le(()=>fc.length),i=le(()=>(n.value+1)/r.value*100);function o(){e.value=!0,n.value=0}function a(){n.value<fc.length-1?n.value++:u()}function l(){n.value>0&&n.value--}function c(){u()}function u(){e.value=!1,t.value=!0,localStorage.setItem("onboarding_completed","true")}function d(){localStorage.removeItem("onboarding_completed"),t.value=!1}return{hasCompletedOnboarding:t,isOnboarding:e,currentStep:s,currentStepIndex:n,totalSteps:r,progress:i,startOnboarding:o,nextStep:a,previousStep:l,skipOnboarding:c,completeOnboarding:u,resetOnboarding:d}}),qo=!1,As={log:(...t)=>qo,warn:(...t)=>qo,error:(...t)=>console.error(...t),debug:(...t)=>qo,info:(...t)=>qo};function _k(){const t=We(),e=I(null),n=I(0),s=5,r=3e3;let i=null,o=null;function a(){var p;if(((p=e.value)==null?void 0:p.readyState)===WebSocket.OPEN)return;const g=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;e.value=new WebSocket(g),e.value.onopen=()=>{t.setConnected(!0),n.value=0,o=setInterval(()=>{var m;((m=e.value)==null?void 0:m.readyState)===WebSocket.OPEN&&e.value.send("ping")},3e4)},e.value.onmessage=m=>{try{const y=JSON.parse(m.data);l(y)}catch(y){As.error("[WS] Failed to parse message:",y)}},e.value.onclose=()=>{t.setConnected(!1),d(),c()},e.value.onerror=m=>{As.error("[WS] Error:",m)}}function l(h){switch(As.log("[WS] Event:",h.event_type,h.data),h.event_type){case"connected":As.log("[WS] Connection confirmed, client ID:",h.data.client_id);break;case"pong":break;case"memory_created":t.handleMemoryCreated(h.data);break;case"memory_updated":t.handleMemoryUpdated(h.data);break;case"memory_deleted":t.handleMemoryDeleted(h.data.id);break;case"database_changed":t.handleDatabaseChanged();break;case"activity_logged":t.handleActivityLogged(h.data);break;case"session_updated":t.handleSessionUpdated(h.data);break;case"stats_updated":t.handleStatsUpdated(h.data);break;default:As.log("[WS] Unknown event type:",h.event_type)}}function c(){n.value>=s||(n.value++,As.log(`[WS] Reconnecting (attempt ${n.value}/${s})...`),i=setTimeout(()=>{a()},r))}function u(){d(),e.value&&(e.value.close(),e.value=null),t.setConnected(!1)}function d(){o&&(clearInterval(o),o=null),i&&(clearTimeout(i),i=null)}return tn(()=>{u()}),{connect:a,disconnect:u,isConnected:t.isConnected}}function kk(){const t=We();function e(r){if(r.ctrlKey&&r.shiftKey&&r.key==="N"){r.preventDefault(),window.dispatchEvent(new CustomEvent("show-quick-capture"));return}const i=r.target;if(!(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)){switch(r.key){case"/":r.preventDefault();const o=document.querySelector('input[placeholder*="Search"]');o&&o.focus();break;case"Escape":t.selectedMemory?t.clearSelection():t.resetFilters();break;case"j":r.preventDefault(),n(1);break;case"k":r.preventDefault(),n(-1);break;case"Enter":t.selectedMemory===null&&t.memories.length>0&&t.selectMemory(t.memories[0]);break;case"r":!r.ctrlKey&&!r.metaKey&&(r.preventDefault(),t.refresh());break;case"?":r.preventDefault(),s();break}if(r.key>="1"&&r.key<="9"&&!r.ctrlKey&&!r.metaKey){const o=parseInt(r.key)-1,a=["decision","solution","insight","error","context","preference","todo","reference","workflow"];o<a.length&&(r.preventDefault(),t.filters.memory_type===a[o]?t.applyFilters({memory_type:null}):t.applyFilters({memory_type:a[o]}))}}}function n(r){if(t.memories.length===0)return;let o=(t.selectedMemory?t.memories.findIndex(a=>a.id===t.selectedMemory.id):-1)+r;o<0&&(o=0),o>=t.memories.length&&(o=t.memories.length-1),t.selectMemory(t.memories[o]),setTimeout(()=>{const a=document.querySelector('[class*="border-blue-500"]');a&&a.scrollIntoView({behavior:"smooth",block:"nearest"})},50)}function s(){window.dispatchEvent(new CustomEvent("show-help"))}return Ge(()=>{document.addEventListener("keydown",e)}),tn(()=>{document.removeEventListener("keydown",e)}),{showHelp:s}}const ws=I("system"),Ko=I(!1);function wk(){const t="omni-cortex-theme";function e(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function n(){ws.value==="system"?Ko.value=e():Ko.value=ws.value==="dark",Ko.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}function s(o){ws.value=o,localStorage.setItem(t,o),n()}function r(){ws.value==="light"?s("dark"):ws.value==="dark"?s("system"):s("light")}function i(){const o=localStorage.getItem(t);o&&["light","dark","system"].includes(o)&&(ws.value=o),n(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{ws.value==="system"&&n()})}return Ge(()=>{i()}),{theme:ws,isDark:Ko,setTheme:s,toggleTheme:r,initTheme:i}}function Sk(t,e=1e3){const n=I(0);let s=null;function r(u){return u<5e3?"Just now":u<6e4?`${Math.floor(u/1e3)}s ago`:u<36e5?`${Math.floor(u/6e4)}m ago`:u<864e5?`${Math.floor(u/36e5)}h ago`:new Date(Date.now()-u).toLocaleString()}const i=le(()=>t()?r(n.value):"");function o(){const u=t();u&&(n.value=Date.now()-u)}function a(){s&&clearInterval(s),o(),s=setInterval(o,e)}function l(){s&&(clearInterval(s),s=null)}function c(){document.hidden?l():a()}return Ge(()=>{a(),document.addEventListener("visibilitychange",c)}),tn(()=>{l(),document.removeEventListener("visibilitychange",c)}),Be(t,u=>{u&&(n.value=Date.now()-u)}),{elapsed:n,formattedElapsed:i}}/**
|
|
27
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/var Go={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
32
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const $k=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),me=(t,e)=>({size:n,strokeWidth:s=2,absoluteStrokeWidth:r,color:i,class:o,...a},{attrs:l,slots:c})=>Yr("svg",{...Go,width:n||Go.width,height:n||Go.height,stroke:i||Go.stroke,"stroke-width":r?Number(s)*24/Number(n):s,...l,class:["lucide",`lucide-${$k(t)}`],...a},[...e.map(u=>Yr(...u)),...c.default?[c.default()]:[]]);/**
|
|
37
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const au=me("ActivityIcon",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
|
|
42
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Ca=me("AlertCircleIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
47
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const lu=me("AlertTriangleIcon",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
52
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const hm=me("ArchiveIcon",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
57
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const Ck=me("AtSignIcon",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/**
|
|
62
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const gm=me("BarChart3Icon",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
67
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const Tk=me("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
|
|
72
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const hc=me("BotIcon",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
77
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const zr=me("CheckCircleIcon",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
82
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const fh=me("CheckSquareIcon",[["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}],["path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11",key:"1jnkn4"}]]);/**
|
|
87
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const Yt=me("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
92
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const Nn=me("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
97
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const Mk=me("ChevronLeftIcon",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
102
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const id=me("ChevronRightIcon",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
107
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const Ps=me("ChevronUpIcon",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
112
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const Ak=me("ClipboardIcon",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
|
|
117
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const ao=me("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
122
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const ls=me("CopyIcon",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
127
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const Zr=me("DatabaseIcon",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
132
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const xr=me("DownloadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
137
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const Ek=me("EraserIcon",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
|
|
142
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const pm=me("ExternalLinkIcon",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/**
|
|
147
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const mm=me("EyeIcon",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
152
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const Pk=me("FileCheckIcon",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);/**
|
|
157
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const od=me("FileJsonIcon",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/**
|
|
162
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const ci=me("FileTextIcon",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
|
|
167
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const ad=me("FilterIcon",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
172
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const Rk=me("FlameIcon",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
|
|
177
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const ym=me("FolderOpenIcon",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
182
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const Dk=me("FolderPlusIcon",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
187
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const Ok=me("FolderSearchIcon",[["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.5-1.5",key:"3sg1j"}]]);/**
|
|
192
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const bm=me("FolderIcon",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
197
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const cu=me("GitBranchIcon",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
202
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const Dl=me("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
207
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const Ol=me("HelpCircleIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
212
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const Ik=me("HistoryIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
|
217
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const Ga=me("ImageIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
222
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const Lk=me("InfoIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
227
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const Nk=me("KeyIcon",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
|
|
232
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const xm=me("KeyboardIcon",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",ry:"2",key:"15u882"}],["path",{d:"M6 8h.001",key:"1ej0i3"}],["path",{d:"M10 8h.001",key:"1x2st2"}],["path",{d:"M14 8h.001",key:"1vkmyp"}],["path",{d:"M18 8h.001",key:"kfsenl"}],["path",{d:"M8 12h.001",key:"1sjpby"}],["path",{d:"M12 12h.001",key:"al75ts"}],["path",{d:"M16 12h.001",key:"931bgk"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
|
|
237
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const vm=me("LayersIcon",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
242
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const zn=me("Loader2Icon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
247
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const Fk=me("MailIcon",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
252
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const jk=me("Maximize2Icon",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
257
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const _m=me("MessageCircleIcon",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
262
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const hs=me("MessageSquareIcon",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
267
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const zk=me("MonitorIcon",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
272
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const Bk=me("MoonIcon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
277
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const Ya=me("PencilIcon",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
282
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const km=me("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
287
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the ISC license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/const wm=me("RadioIcon",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
292
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the ISC license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const en=me("RefreshCwIcon",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
297
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const Hk=me("RotateCcwIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
302
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the ISC license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/const Uk=me("SaveIcon",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
|
|
307
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the ISC license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/const lo=me("SearchIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
312
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the ISC license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/const Vk=me("SendIcon",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
317
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
318
|
+
*
|
|
319
|
+
* This source code is licensed under the ISC license.
|
|
320
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
+
*/const Sm=me("ServerIcon",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
322
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the ISC license.
|
|
325
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/const ld=me("SettingsIcon",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
327
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
328
|
+
*
|
|
329
|
+
* This source code is licensed under the ISC license.
|
|
330
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
+
*/const Wk=me("SlidersHorizontalIcon",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
332
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
333
|
+
*
|
|
334
|
+
* This source code is licensed under the ISC license.
|
|
335
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
+
*/const Eo=me("SparklesIcon",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
337
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
338
|
+
*
|
|
339
|
+
* This source code is licensed under the ISC license.
|
|
340
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
+
*/const hh=me("SquareIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
342
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
343
|
+
*
|
|
344
|
+
* This source code is licensed under the ISC license.
|
|
345
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
+
*/const qk=me("StarOffIcon",[["path",{d:"M8.34 8.34 2 9.27l5 4.87L5.82 21 12 17.77 18.18 21l-.59-3.43",key:"16m0ql"}],["path",{d:"M18.42 12.76 22 9.27l-6.91-1L12 2l-1.44 2.91",key:"1vt8nq"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
|
|
347
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the ISC license.
|
|
350
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
+
*/const uu=me("StarIcon",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
|
|
352
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the ISC license.
|
|
355
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
+
*/const Kk=me("SunIcon",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
357
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
358
|
+
*
|
|
359
|
+
* This source code is licensed under the ISC license.
|
|
360
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
+
*/const Gk=me("TableIcon",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
|
|
362
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
363
|
+
*
|
|
364
|
+
* This source code is licensed under the ISC license.
|
|
365
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
+
*/const Yk=me("TagIcon",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]);/**
|
|
367
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the ISC license.
|
|
370
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/const $m=me("TerminalIcon",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
372
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
373
|
+
*
|
|
374
|
+
* This source code is licensed under the ISC license.
|
|
375
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
+
*/const Gi=me("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
377
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
378
|
+
*
|
|
379
|
+
* This source code is licensed under the ISC license.
|
|
380
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
+
*/const Cm=me("TrendingUpIcon",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
382
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
383
|
+
*
|
|
384
|
+
* This source code is licensed under the ISC license.
|
|
385
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
+
*/const du=me("UserIcon",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
387
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
388
|
+
*
|
|
389
|
+
* This source code is licensed under the ISC license.
|
|
390
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
+
*/const Xk=me("UsersIcon",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
392
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
393
|
+
*
|
|
394
|
+
* This source code is licensed under the ISC license.
|
|
395
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
+
*/const fu=me("Wand2Icon",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72Z",key:"1bcowg"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
397
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
398
|
+
*
|
|
399
|
+
* This source code is licensed under the ISC license.
|
|
400
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
+
*/const Jk=me("WifiOffIcon",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 4.17-2.65",key:"11utq1"}],["path",{d:"M10.66 5c4.01-.36 8.14.9 11.34 3.76",key:"hxefdu"}],["path",{d:"M16.85 11.25a10 10 0 0 1 2.22 1.68",key:"q734kn"}],["path",{d:"M5 13a10 10 0 0 1 5.24-2.76",key:"piq4yl"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
|
|
402
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
403
|
+
*
|
|
404
|
+
* This source code is licensed under the ISC license.
|
|
405
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
+
*/const Zk=me("WifiIcon",[["path",{d:"M5 13a10 10 0 0 1 14 0",key:"6v8j51"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
|
|
407
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
408
|
+
*
|
|
409
|
+
* This source code is licensed under the ISC license.
|
|
410
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
+
*/const Tm=me("WrenchIcon",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
412
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
413
|
+
*
|
|
414
|
+
* This source code is licensed under the ISC license.
|
|
415
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
+
*/const Qk=me("XCircleIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
417
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
418
|
+
*
|
|
419
|
+
* This source code is licensed under the ISC license.
|
|
420
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
+
*/const Qt=me("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
422
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
423
|
+
*
|
|
424
|
+
* This source code is licensed under the ISC license.
|
|
425
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
+
*/const Il=me("ZapIcon",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);/**
|
|
427
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
428
|
+
*
|
|
429
|
+
* This source code is licensed under the ISC license.
|
|
430
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
+
*/const Mm=me("ZoomInIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
|
|
432
|
+
* @license lucide-vue-next v0.300.0 - ISC
|
|
433
|
+
*
|
|
434
|
+
* This source code is licensed under the ISC license.
|
|
435
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
+
*/const ew=me("ZoomOutIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),tw={class:"multi-project-selector absolute top-full left-0 mt-2 w-80 bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 max-h-96 overflow-hidden flex flex-col animate-fade-in z-50"},nw={class:"flex items-center justify-between px-3 py-2 border-b border-gray-200 dark:border-gray-700 flex-shrink-0"},sw={class:"flex gap-2"},rw={class:"overflow-y-auto flex-1"},iw={key:0,class:"px-3 py-4 text-center text-gray-500"},ow=["checked","onChange"],aw={class:"flex-shrink-0 mt-0.5"},lw={class:"flex-1 min-w-0 relative"},cw={class:"font-medium truncate pr-4"},uw={class:"text-xs text-gray-500 dark:text-gray-400 truncate"},dw={key:0,class:"px-3 py-2 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 text-sm font-medium border-t border-blue-100 dark:border-blue-800 flex-shrink-0"},fw=Oe({__name:"MultiProjectSelector",emits:["close","openManagement"],setup(t,{emit:e}){const n=e,s=We(),r=le(()=>s.selectedProjects.length);function i(u){return s.selectedProjects.some(d=>d.db_path===u.db_path)}function o(u){s.toggleProjectSelection(u)}function a(){s.selectAllProjects()}function l(){s.clearProjectSelection()}function c(u){const d=u.target;!d.closest(".multi-project-selector")&&!d.closest(".project-switcher")&&n("close")}return Ge(()=>{document.addEventListener("click",c,!0)}),tn(()=>{document.removeEventListener("click",c,!0)}),(u,d)=>(b(),k("div",tw,[f("div",nw,[d[2]||(d[2]=f("span",{class:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase"}," Projects ",-1)),f("div",sw,[f("button",{onClick:pt(a,["stop"]),class:"text-xs text-blue-500 hover:text-blue-700 dark:hover:text-blue-400 px-2 py-1 rounded hover:bg-blue-50 dark:hover:bg-blue-900/30"}," Select All "),f("button",{onClick:pt(l,["stop"]),class:"text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700"}," Clear "),f("button",{onClick:d[0]||(d[0]=pt(h=>n("openManagement"),["stop"])),class:"text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 flex items-center gap-1 px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-700"},[O($(ld),{class:"w-3 h-3"}),d[1]||(d[1]=oe(" Manage ",-1))])])]),f("div",rw,[$(s).projects.length===0?(b(),k("div",iw," No projects found ")):H("",!0),(b(!0),k(ae,null,ve($(s).projects,h=>(b(),k("label",{key:h.db_path,class:re(["flex items-start gap-3 px-3 py-2 cursor-pointer transition-colors hover:bg-gray-50 dark:hover:bg-gray-700/50",i(h)?"bg-blue-50 dark:bg-blue-900/20":""])},[f("input",{type:"checkbox",checked:i(h),onChange:g=>o(h),class:"mt-1 w-4 h-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 focus:ring-2"},null,40,ow),f("div",aw,[h.is_global?(b(),pe($(Dl),{key:0,class:"w-5 h-5 text-purple-500"})):(b(),pe($(bm),{key:1,class:"w-5 h-5 text-gray-400"}))]),f("div",lw,[h.is_favorite?(b(),pe($(uu),{key:0,class:"w-3 h-3 text-yellow-500 fill-yellow-500 absolute -top-1 right-0"})):H("",!0),f("div",cw,A(h.display_name||h.name),1),f("div",uw,A(h.memory_count)+" memories ",1)])],2))),128))]),r.value>0?(b(),k("div",dw,A(r.value)+" project"+A(r.value>1?"s":"")+" selected ",1)):H("",!0)]))}}),Po=(t,e)=>{const n=t.__vccOpts||t;for(const[s,r]of e)n[s]=r;return n},hw=Po(fw,[["__scopeId","data-v-0ef8d9a3"]]),gw={class:"bg-white dark:bg-gray-800 rounded-xl shadow-xl max-w-md w-full mx-4 overflow-hidden"},pw={class:"px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},mw={class:"text-lg font-semibold flex items-center gap-2"},yw={class:"p-6 space-y-6"},bw={class:"space-y-2"},xw=["value"],vw={class:"flex-1"},_w={class:"font-medium"},kw={class:"text-xs text-gray-500 dark:text-gray-400"},ww={key:0,class:"w-5 h-5 bg-blue-500 rounded-full flex items-center justify-center"},Sw={class:"flex items-center gap-3 cursor-pointer"},$w=["disabled"],Cw={key:0,class:"mt-1 text-xs text-gray-500"},Tw={class:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4"},Mw={class:"text-sm text-gray-600 dark:text-gray-400"},Aw={class:"font-medium text-gray-900 dark:text-gray-100"},Ew={class:"mt-1"},Pw={class:"font-medium text-gray-900 dark:text-gray-100"},Rw={class:"px-6 py-4 bg-gray-50 dark:bg-gray-700/30 border-t border-gray-200 dark:border-gray-700 flex justify-end gap-3"},Dw=["disabled"],Ow=Oe({__name:"ExportPanel",emits:["close"],setup(t,{emit:e}){const n=e,s=We(),r=I("json"),i=I(!0),o=I(!1),a=I(!1),l=[{value:"json",label:"JSON",icon:od,description:"Full data with relationships, importable"},{value:"markdown",label:"Markdown",icon:ci,description:"Human-readable documentation"},{value:"csv",label:"CSV",icon:Gk,description:"Spreadsheet compatible"}],c=le(()=>s.currentProject?`/api/export?${new URLSearchParams({project:s.currentProject.db_path,format:r.value,include_relationships:i.value.toString()})}`:"");async function u(){if(s.currentProject){o.value=!0;try{const d=document.createElement("a");d.href=c.value,d.download=`memories_export.${r.value}`,document.body.appendChild(d),d.click(),document.body.removeChild(d),a.value=!0,setTimeout(()=>{a.value=!1},3e3)}catch(d){console.error("Export failed:",d)}finally{o.value=!1}}}return(d,h)=>{var g,p;return b(),k("div",{class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:h[4]||(h[4]=pt(m=>n("close"),["self"]))},[f("div",gw,[f("div",pw,[f("h2",mw,[O($(xr),{class:"w-5 h-5 text-blue-500"}),h[5]||(h[5]=oe(" Export Memories ",-1))]),f("button",{onClick:h[0]||(h[0]=m=>n("close")),class:"p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors"},[O($(Qt),{class:"w-5 h-5"})])]),f("div",yw,[f("div",null,[h[6]||(h[6]=f("label",{class:"block text-sm font-medium mb-3"},"Export Format",-1)),f("div",bw,[(b(),k(ae,null,ve(l,m=>f("label",{key:m.value,class:re(["flex items-center gap-3 p-3 rounded-lg border-2 cursor-pointer transition-colors",r.value===m.value?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"])},[Ee(f("input",{type:"radio",value:m.value,"onUpdate:modelValue":h[1]||(h[1]=y=>r.value=y),class:"sr-only"},null,8,xw),[[Bv,r.value]]),(b(),pe(Vn(m.icon),{class:re(["w-5 h-5",r.value===m.value?"text-blue-500":"text-gray-400"])},null,8,["class"])),f("div",vw,[f("div",_w,A(m.label),1),f("div",kw,A(m.description),1)]),r.value===m.value?(b(),k("div",ww,[O($(Yt),{class:"w-3 h-3 text-white"})])):H("",!0)],2)),64))])]),f("div",null,[f("label",Sw,[Ee(f("input",{type:"checkbox","onUpdate:modelValue":h[2]||(h[2]=m=>i.value=m),disabled:r.value==="csv",class:"w-4 h-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"},null,8,$w),[[yr,i.value]]),f("span",{class:re(r.value==="csv"?"text-gray-400":"")}," Include memory relationships ",2)]),r.value==="csv"?(b(),k("p",Cw," CSV format doesn't support relationships ")):H("",!0)]),f("div",Tw,[f("div",Mw,[f("p",null,[h[7]||(h[7]=oe("Exporting from: ",-1)),f("span",Aw,A((g=$(s).currentProject)==null?void 0:g.name),1)]),f("p",Ew,[h[8]||(h[8]=oe("Total memories: ",-1)),f("span",Pw,A(((p=$(s).stats)==null?void 0:p.total_count)??0),1)])])])]),f("div",Rw,[f("button",{onClick:h[3]||(h[3]=m=>n("close")),class:"px-4 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors"}," Cancel "),f("button",{onClick:u,disabled:o.value||!$(s).currentProject,class:re(["px-4 py-2 rounded-lg font-medium flex items-center gap-2 transition-colors",a.value?"bg-green-600 text-white":"bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-50 disabled:cursor-not-allowed"])},[a.value?(b(),pe($(Yt),{key:0,class:"w-4 h-4"})):(b(),pe($(xr),{key:1,class:re(["w-4 h-4",o.value&&"animate-bounce"])},null,8,["class"])),oe(" "+A(a.value?"Downloaded!":o.value?"Exporting...":"Export"),1)],10,Dw)])])])}}}),Iw={class:"relative bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-2xl max-h-[80vh] overflow-hidden animate-fade-in"},Lw={class:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700"},Nw={class:"text-xl font-bold text-gray-900 dark:text-white flex items-center gap-2"},Fw={class:"flex border-b border-gray-200 dark:border-gray-700"},jw=["onClick"],zw={class:"p-6 overflow-y-auto max-h-[50vh]"},Bw={key:0,class:"space-y-6"},Hw={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-3"},Uw={class:"space-y-2"},Vw={class:"text-gray-700 dark:text-gray-300"},Ww={class:"px-2 py-1 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 text-sm font-mono rounded"},qw={key:1,class:"space-y-4"},Kw={class:"p-2 bg-blue-100 dark:bg-blue-900/50 rounded-lg"},Gw={class:"font-semibold text-gray-900 dark:text-white"},Yw={class:"text-sm text-gray-600 dark:text-gray-300 mt-1"},Xw={key:2,class:"space-y-6"},Jw={class:"flex items-center gap-4"},Zw={class:"w-16 h-16 bg-gradient-to-br from-purple-500 to-blue-600 rounded-2xl flex items-center justify-center"},Qw=Oe({__name:"HelpModal",emits:["close"],setup(t,{emit:e}){const n=e,s=rd(),r=I("shortcuts"),i=[{id:"shortcuts",label:"Shortcuts",icon:xm},{id:"features",label:"Features",icon:Eo},{id:"about",label:"About",icon:Lk}],o=[{group:"Navigation",items:[{key:"/",description:"Focus search bar"},{key:"Esc",description:"Clear selection / filters"},{key:"j / k",description:"Navigate down / up through memories"},{key:"Enter",description:"Select first memory"},{key:"?",description:"Open this help dialog"}]},{group:"Actions",items:[{key:"Ctrl+Shift+N",description:"Quick capture new memory"},{key:"r",description:"Refresh data"}]},{group:"Quick Filters",items:[{key:"1-9",description:"Filter by memory type (decision, solution, etc.)"}]}],a=[{icon:Zr,title:"Memory Browser",description:"Browse, search, and filter your AI memories with powerful search and filtering."},{icon:au,title:"Activity Timeline",description:"View a chronological timeline of all activities and tool usage."},{icon:gm,title:"Statistics",description:"Visualize activity heatmaps, tool usage charts, and memory growth trends."},{icon:Pk,title:"Freshness Review",description:"Review and update outdated memories to keep your knowledge fresh."},{icon:cu,title:"Relationship Graph",description:"Explore visual connections between related memories using D3.js."},{icon:hs,title:"Ask AI",description:"Chat with AI about your memories using natural language queries."}];function l(){n("close"),s.resetOnboarding(),s.startOnboarding()}function c(d){d.target===d.currentTarget&&n("close")}function u(d){d.key==="Escape"&&n("close")}return(d,h)=>(b(),pe(Gr,{to:"body"},[f("div",{class:"fixed inset-0 z-50 flex items-center justify-center",onClick:c,onKeydown:u},[h[6]||(h[6]=f("div",{class:"absolute inset-0 bg-black/50 transition-opacity"},null,-1)),f("div",Iw,[f("div",Lw,[f("h2",Nw,[O($(Ol),{class:"w-6 h-6 text-blue-500"}),h[1]||(h[1]=oe(" Help & Shortcuts ",-1))]),f("button",{onClick:h[0]||(h[0]=g=>n("close")),class:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Close (Esc)"},[O($(Qt),{class:"w-5 h-5"})])]),f("div",Fw,[(b(),k(ae,null,ve(i,g=>f("button",{key:g.id,onClick:p=>r.value=g.id,class:re(["flex items-center gap-2 px-6 py-3 font-medium transition-colors",r.value===g.id?"text-blue-600 dark:text-blue-400 border-b-2 border-blue-600 dark:border-blue-400":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200"])},[(b(),pe(Vn(g.icon),{class:"w-4 h-4"})),oe(" "+A(g.label),1)],10,jw)),64))]),f("div",zw,[r.value==="shortcuts"?(b(),k("div",Bw,[(b(),k(ae,null,ve(o,g=>f("div",{key:g.group},[f("h3",Hw,A(g.group),1),f("div",Uw,[(b(!0),k(ae,null,ve(g.items,p=>(b(),k("div",{key:p.key,class:"flex items-center justify-between py-2 px-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg"},[f("span",Vw,A(p.description),1),f("kbd",Ww,A(p.key),1)]))),128))])])),64))])):r.value==="features"?(b(),k("div",qw,[(b(),k(ae,null,ve(a,g=>f("div",{key:g.title,class:"flex items-start gap-4 p-4 bg-gray-50 dark:bg-gray-700/50 rounded-xl"},[f("div",Kw,[(b(),pe(Vn(g.icon),{class:"w-5 h-5 text-blue-600 dark:text-blue-400"}))]),f("div",null,[f("h4",Gw,A(g.title),1),f("p",Yw,A(g.description),1)])])),64)),f("button",{onClick:l,class:"w-full py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium flex items-center justify-center gap-2 mt-6"},[O($(en),{class:"w-4 h-4"}),h[2]||(h[2]=oe(" Take the Tour Again ",-1))])])):r.value==="about"?(b(),k("div",Xw,[f("div",Jw,[f("div",Zw,[O($(Zr),{class:"w-8 h-8 text-white"})]),h[3]||(h[3]=f("div",null,[f("h3",{class:"text-xl font-bold text-gray-900 dark:text-white"},"Omni-Cortex Dashboard"),f("p",{class:"text-gray-500 dark:text-gray-400"},"Version 1.0")],-1))]),h[4]||(h[4]=f("p",{class:"text-gray-600 dark:text-gray-300 leading-relaxed"}," Omni-Cortex is an AI memory management system that helps Claude Code and other AI assistants remember context, decisions, and solutions across sessions. This dashboard provides a visual interface to browse, search, and manage your AI memories. ",-1)),h[5]||(h[5]=f("div",{class:"space-y-3"},[f("h4",{class:"font-semibold text-gray-900 dark:text-white"},"Resources"),f("div",{class:"space-y-2"},[f("a",{href:"https://github.com/Anthropic/omni-cortex",target:"_blank",rel:"noopener noreferrer",class:"flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:underline"}," GitHub Repository "),f("a",{href:"https://pypi.org/project/omni-cortex/",target:"_blank",rel:"noopener noreferrer",class:"flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:underline"}," PyPI Package ")])],-1))])):H("",!0)])])],32)]))}}),e2=Po(Qw,[["__scopeId","data-v-bde621e2"]]),t2={class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},n2={class:"bg-white dark:bg-gray-800 rounded-xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col"},s2={class:"flex items-center justify-between p-4 border-b dark:border-gray-700"},r2={class:"flex border-b dark:border-gray-700"},i2=["onClick"],o2={class:"flex-1 overflow-y-auto p-4"},a2={key:0,class:"mb-6"},l2={class:"space-y-2"},c2={class:"flex-1 min-w-0"},u2={class:"font-medium truncate"},d2={class:"text-xs text-gray-500 dark:text-gray-400 truncate"},f2=["onClick"],h2={class:"space-y-2"},g2={class:"flex-1 min-w-0"},p2={class:"font-medium truncate"},m2={key:0,class:"text-xs text-blue-500 ml-2"},y2={key:1,class:"text-xs text-purple-500 ml-2"},b2={class:"text-xs text-gray-500 dark:text-gray-400 truncate"},x2=["onClick"],v2=["onClick"],_2={class:"flex gap-2 mb-4"},k2=["disabled"],w2={class:"space-y-2"},S2={class:"flex-1 truncate"},$2=["onClick"],C2={key:0,class:"text-center text-gray-500 py-4"},T2={class:"space-y-4"},M2={key:0,class:"text-red-500 text-sm"},A2=["disabled"],E2={key:0,class:"mt-6"},P2={class:"space-y-2"},R2={class:"flex-1 min-w-0"},D2={class:"font-medium truncate"},O2={class:"text-xs text-gray-500 dark:text-gray-400 truncate"},I2=["onClick"],L2={class:"flex justify-between items-center p-4 border-t dark:border-gray-700"},N2=["disabled"],F2=Oe({__name:"ProjectManagementModal",emits:["close"],setup(t,{emit:e}){const n=e,s=We(),r=I("projects"),i=I(""),o=I(""),a=I(!1),l=I(""),c=I(""),u=I(!1),d=I(!1),h=le(()=>s.projects.filter(v=>v.is_registered)),g=le(()=>s.projects.filter(v=>v.is_favorite));async function p(){if(i.value.trim()){a.value=!0,l.value="";try{await nk(i.value.trim(),o.value.trim()||void 0),await s.loadProjects(),i.value="",o.value="",r.value="projects"}catch{l.value="Failed to add project. Check path has .omni-cortex/cortex.db"}finally{a.value=!1}}}async function m(v){try{await sk(v),await s.loadProjects()}catch(_){console.error("Failed to remove project:",_)}}async function y(v){try{await rk(v.path),await s.loadProjects()}catch(_){console.error("Failed to toggle favorite:",_)}}async function x(){if(c.value.trim()){u.value=!0;try{await ik(c.value.trim()),await s.loadProjectConfig(),await s.loadProjects(),c.value=""}catch(v){console.error("Failed to add directory:",v)}finally{u.value=!1}}}async function S(v){try{await ok(v),await s.loadProjectConfig(),await s.loadProjects()}catch(_){console.error("Failed to remove directory:",_)}}async function T(){d.value=!0;try{await ak(),await s.loadProjects()}finally{d.value=!1}}return(v,_)=>{var P,L,C;return b(),k("div",t2,[f("div",n2,[f("div",s2,[_[5]||(_[5]=f("h2",{class:"text-lg font-semibold"},"Project Management",-1)),f("button",{onClick:_[0]||(_[0]=w=>n("close")),class:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg"},[O($(Qt),{class:"w-5 h-5"})])]),f("div",r2,[(b(),k(ae,null,ve(["projects","directories","add"],w=>f("button",{key:w,onClick:M=>r.value=w,class:re(["px-4 py-3 font-medium capitalize",r.value===w?"border-b-2 border-blue-500 text-blue-600 dark:text-blue-400":"text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"])},A(w==="add"?"Add Project":w),11,i2)),64))]),f("div",o2,[r.value==="projects"?(b(),k(ae,{key:0},[g.value.length?(b(),k("div",a2,[_[6]||(_[6]=f("h3",{class:"text-sm font-semibold text-gray-500 dark:text-gray-400 mb-2"},"Favorites",-1)),f("div",l2,[(b(!0),k(ae,null,ve(g.value,w=>(b(),k("div",{key:w.path,class:"flex items-center gap-3 p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-lg"},[O($(uu),{class:"w-5 h-5 text-yellow-500 fill-yellow-500 flex-shrink-0"}),f("div",c2,[f("div",u2,A(w.display_name||w.name),1),f("div",d2,A(w.path),1)]),f("button",{onClick:M=>y(w),class:"p-2 hover:bg-yellow-100 dark:hover:bg-yellow-900/40 rounded"},[O($(qk),{class:"w-4 h-4 text-yellow-600"})],8,f2)]))),128))])])):H("",!0),_[7]||(_[7]=f("h3",{class:"text-sm font-semibold text-gray-500 dark:text-gray-400 mb-2"},"All Projects",-1)),f("div",h2,[(b(!0),k(ae,null,ve($(s).projects,w=>(b(),k("div",{key:w.path,class:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg"},[f("div",g2,[f("div",p2,[oe(A(w.display_name||w.name)+" ",1),w.is_registered?(b(),k("span",m2,"(registered)")):H("",!0),w.is_global?(b(),k("span",y2,"(global)")):H("",!0)]),f("div",b2,A(w.path),1)]),f("button",{onClick:M=>y(w),class:"p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded"},[O($(uu),{class:re(["w-4 h-4",w.is_favorite?"text-yellow-500 fill-yellow-500":"text-gray-400"])},null,8,["class"])],8,x2),w.is_registered?(b(),k("button",{key:0,onClick:M=>m(w.path),class:"p-2 hover:bg-red-100 dark:hover:bg-red-900/30 rounded text-red-500"},[O($(Gi),{class:"w-4 h-4"})],8,v2)):H("",!0)]))),128))])],64)):r.value==="directories"?(b(),k(ae,{key:1},[_[8]||(_[8]=f("p",{class:"text-sm text-gray-500 dark:text-gray-400 mb-4"}," These directories are automatically scanned for OmniCortex projects. ",-1)),f("div",_2,[Ee(f("input",{"onUpdate:modelValue":_[1]||(_[1]=w=>c.value=w),placeholder:"Enter directory path (e.g., ~/my-projects)",class:"flex-1 px-3 py-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[rt,c.value]]),f("button",{onClick:x,disabled:u.value||!c.value.trim(),class:"px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:opacity-50"}," Add ",8,k2)]),f("div",w2,[(b(!0),k(ae,null,ve((P=$(s).projectConfig)==null?void 0:P.scan_directories,w=>(b(),k("div",{key:w,class:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg"},[O($(Ok),{class:"w-5 h-5 text-gray-400 flex-shrink-0"}),f("span",S2,A(w),1),f("button",{onClick:M=>S(w),class:"p-2 hover:bg-red-100 dark:hover:bg-red-900/30 rounded text-red-500"},[O($(Gi),{class:"w-4 h-4"})],8,$2)]))),128)),(C=(L=$(s).projectConfig)==null?void 0:L.scan_directories)!=null&&C.length?H("",!0):(b(),k("div",C2," No scan directories configured "))])],64)):r.value==="add"?(b(),k(ae,{key:2},[_[13]||(_[13]=f("p",{class:"text-sm text-gray-500 dark:text-gray-400 mb-4"},[oe(" Add a project from any location. The path must contain a "),f("code",{class:"bg-gray-200 dark:bg-gray-700 px-1 rounded"},".omni-cortex/cortex.db"),oe(" file. ")],-1)),f("div",T2,[f("div",null,[_[9]||(_[9]=f("label",{class:"block text-sm font-medium mb-1"},"Project Path *",-1)),Ee(f("input",{"onUpdate:modelValue":_[2]||(_[2]=w=>i.value=w),placeholder:"C:/Users/Me/custom-project",class:"w-full px-3 py-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[rt,i.value]])]),f("div",null,[_[10]||(_[10]=f("label",{class:"block text-sm font-medium mb-1"},"Display Name (optional)",-1)),Ee(f("input",{"onUpdate:modelValue":_[3]||(_[3]=w=>o.value=w),placeholder:"My Custom Project",class:"w-full px-3 py-2 border rounded-lg dark:bg-gray-700 dark:border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[rt,o.value]])]),l.value?(b(),k("div",M2,A(l.value),1)):H("",!0),f("button",{onClick:p,disabled:a.value||!i.value.trim(),class:"w-full px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:opacity-50 flex items-center justify-center gap-2"},[O($(Dk),{class:"w-5 h-5"}),_[11]||(_[11]=oe(" Add Project ",-1))],8,A2)]),h.value.length?(b(),k("div",E2,[_[12]||(_[12]=f("h3",{class:"text-sm font-semibold text-gray-500 dark:text-gray-400 mb-2"},"Registered Projects",-1)),f("div",P2,[(b(!0),k(ae,null,ve(h.value,w=>(b(),k("div",{key:w.path,class:"flex items-center gap-3 p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg"},[f("div",R2,[f("div",D2,A(w.display_name||w.name),1),f("div",O2,A(w.path),1)]),f("button",{onClick:M=>m(w.path),class:"p-2 hover:bg-red-100 dark:hover:bg-red-900/30 rounded text-red-500"},[O($(Gi),{class:"w-4 h-4"})],8,I2)]))),128))])])):H("",!0)],64)):H("",!0)]),f("div",L2,[f("button",{onClick:T,disabled:d.value,class:"flex items-center gap-2 text-sm text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50"},[O($(en),{class:re(["w-4 h-4",d.value&&"animate-spin"])},null,8,["class"]),_[14]||(_[14]=oe(" Refresh All ",-1))],8,N2),f("button",{onClick:_[4]||(_[4]=w=>n("close")),class:"px-4 py-2 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600"}," Done ")])])])}}}),j2={class:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-hidden flex flex-col"},z2={class:"px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},B2={class:"flex items-center gap-2"},H2={class:"flex-1 overflow-y-auto p-6 space-y-6"},U2={class:"text-sm font-semibold text-gray-700 dark:text-gray-200 mb-3 flex items-center gap-2"},V2={class:"space-y-3"},W2={class:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-700/50"},q2={class:"flex items-center gap-3"},K2={key:0,class:"text-sm text-gray-400"},G2={key:1,class:"flex items-center gap-1 text-green-600 dark:text-green-400"},Y2={key:2,class:"flex items-center gap-1 text-amber-600 dark:text-amber-400"},X2={class:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-700/50"},J2={class:"flex items-center gap-3"},Z2={key:0,class:"text-sm text-gray-400"},Q2={key:1,class:"flex items-center gap-1 text-green-600 dark:text-green-400"},eS={key:2,class:"flex items-center gap-1 text-amber-600 dark:text-amber-400"},tS={key:0},nS={class:"space-y-4"},sS={class:"p-4 rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700/30"},rS={class:"flex items-start gap-3"},iS={class:"flex-1"},oS={href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",class:"inline-flex items-center gap-1 text-sm text-blue-600 dark:text-blue-400 hover:underline"},aS={class:"p-4 rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700/30"},lS={class:"flex items-start gap-3"},cS={class:"flex-1"},uS={class:"flex items-center gap-2"},dS={class:"p-4 rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700/30"},fS={class:"flex items-start gap-3"},hS={class:"flex-1"},gS={class:"space-y-2"},pS={class:"flex items-center gap-2"},mS={class:"flex items-center gap-2"},yS={class:"flex items-center gap-2"},bS={key:1},xS={class:"p-4 rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800"},vS={class:"flex items-center gap-3"},_S={class:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 flex justify-between items-center"},kS=["disabled"],wS='$env:GEMINI_API_KEY="your-api-key-here"',SS='export GEMINI_API_KEY="your-api-key-here"',$S=Oe({__name:"SettingsModal",emits:["close"],setup(t,{emit:e}){const n=e,s=We(),r=I(null),i=I(null),o=I(!0),a=I(null);Ge(async()=>{await l()});async function l(){o.value=!0;try{const[u,d]=await Promise.all([dm(),s.currentDbPath?um(s.currentDbPath):Promise.resolve({available:!1,message:"No project selected"})]);r.value=u,i.value=d}catch(u){console.error("Failed to check status:",u)}finally{o.value=!1}}async function c(u,d){try{await navigator.clipboard.writeText(u),a.value=d,setTimeout(()=>{a.value=null},2e3)}catch(h){console.error("Failed to copy:",h)}}return(u,d)=>{var h,g,p,m,y,x;return b(),k("div",{class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:d[6]||(d[6]=pt(S=>n("close"),["self"]))},[f("div",j2,[f("div",z2,[f("div",B2,[O($(ld),{class:"w-5 h-5 text-gray-500 dark:text-gray-400"}),d[7]||(d[7]=f("h2",{class:"text-lg font-semibold text-gray-800 dark:text-gray-100"},"Settings",-1))]),f("button",{onClick:d[0]||(d[0]=S=>n("close")),class:"p-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors"},[O($(Qt),{class:"w-5 h-5 text-gray-500 dark:text-gray-400"})])]),f("div",H2,[f("section",null,[f("h3",U2,[O($(Nk),{class:"w-4 h-4"}),d[8]||(d[8]=oe(" API Status ",-1))]),f("div",V2,[f("div",W2,[f("div",q2,[O($(_m),{class:"w-5 h-5 text-blue-500"}),d[9]||(d[9]=f("div",null,[f("p",{class:"text-sm font-medium text-gray-800 dark:text-gray-100"},"Ask AI (Chat)"),f("p",{class:"text-xs text-gray-500 dark:text-gray-400"},"Gemini API for chat")],-1))]),o.value?(b(),k("div",K2,"Checking...")):(h=i.value)!=null&&h.available?(b(),k("div",G2,[O($(zr),{class:"w-4 h-4"}),d[10]||(d[10]=f("span",{class:"text-sm font-medium"},"Connected",-1))])):(b(),k("div",Y2,[O($(lu),{class:"w-4 h-4"}),d[11]||(d[11]=f("span",{class:"text-sm font-medium"},"Not configured",-1))]))]),f("div",X2,[f("div",J2,[O($(Ga),{class:"w-5 h-5 text-purple-500"}),d[12]||(d[12]=f("div",null,[f("p",{class:"text-sm font-medium text-gray-800 dark:text-gray-100"},"Image Generation"),f("p",{class:"text-xs text-gray-500 dark:text-gray-400"},"Nano Banana Pro (Gemini)")],-1))]),o.value?(b(),k("div",Z2,"Checking...")):(g=r.value)!=null&&g.available?(b(),k("div",Q2,[O($(zr),{class:"w-4 h-4"}),d[13]||(d[13]=f("span",{class:"text-sm font-medium"},"Ready",-1))])):(b(),k("div",eS,[O($(lu),{class:"w-4 h-4"}),d[14]||(d[14]=f("span",{class:"text-sm font-medium"},"Not configured",-1))]))])])]),!((p=r.value)!=null&&p.available)||!((m=i.value)!=null&&m.available)?(b(),k("section",tS,[d[33]||(d[33]=f("h3",{class:"text-sm font-semibold text-gray-700 dark:text-gray-200 mb-3"}," Setup Instructions ",-1)),f("div",nS,[f("div",sS,[f("div",rS,[d[18]||(d[18]=f("div",{class:"flex-shrink-0 w-6 h-6 rounded-full bg-blue-100 dark:bg-blue-900/50 text-blue-600 dark:text-blue-400 flex items-center justify-center text-sm font-semibold"},"1",-1)),f("div",iS,[d[16]||(d[16]=f("h4",{class:"text-sm font-medium text-gray-800 dark:text-gray-100 mb-1"},"Get a Gemini API Key",-1)),d[17]||(d[17]=f("p",{class:"text-sm text-gray-600 dark:text-gray-300 mb-2"}," Create a free API key from Google AI Studio. ",-1)),f("a",oS,[d[15]||(d[15]=oe(" Open Google AI Studio ",-1)),O($(pm),{class:"w-3 h-3"})])])])]),f("div",aS,[f("div",lS,[d[22]||(d[22]=f("div",{class:"flex-shrink-0 w-6 h-6 rounded-full bg-blue-100 dark:bg-blue-900/50 text-blue-600 dark:text-blue-400 flex items-center justify-center text-sm font-semibold"},"2",-1)),f("div",cS,[d[20]||(d[20]=f("h4",{class:"text-sm font-medium text-gray-800 dark:text-gray-100 mb-1"},"Install the google-genai Package",-1)),d[21]||(d[21]=f("p",{class:"text-sm text-gray-600 dark:text-gray-300 mb-2"}," Run this command in your terminal: ",-1)),f("div",uS,[d[19]||(d[19]=f("code",{class:"flex-1 px-3 py-2 bg-gray-900 dark:bg-gray-950 text-green-400 rounded text-sm font-mono"}," pip install google-genai ",-1)),f("button",{onClick:d[1]||(d[1]=S=>c("pip install google-genai","pip")),class:"p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded transition-colors",title:"Copy command"},[a.value==="pip"?(b(),pe($(Yt),{key:0,class:"w-4 h-4 text-green-500"})):(b(),pe($(ls),{key:1,class:"w-4 h-4 text-gray-400"}))])])])])]),f("div",dS,[f("div",fS,[d[31]||(d[31]=f("div",{class:"flex-shrink-0 w-6 h-6 rounded-full bg-blue-100 dark:bg-blue-900/50 text-blue-600 dark:text-blue-400 flex items-center justify-center text-sm font-semibold"},"3",-1)),f("div",hS,[d[29]||(d[29]=f("h4",{class:"text-sm font-medium text-gray-800 dark:text-gray-100 mb-1"},"Set the Environment Variable",-1)),d[30]||(d[30]=f("p",{class:"text-sm text-gray-600 dark:text-gray-300 mb-2"}," Add the GEMINI_API_KEY to your environment or .env file: ",-1)),f("div",gS,[f("div",null,[d[24]||(d[24]=f("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-1"},"Windows (PowerShell):",-1)),f("div",pS,[d[23]||(d[23]=f("code",{class:"flex-1 px-3 py-2 bg-gray-900 dark:bg-gray-950 text-green-400 rounded text-sm font-mono overflow-x-auto"},' $env:GEMINI_API_KEY="your-api-key-here" ',-1)),f("button",{onClick:d[2]||(d[2]=S=>c(wS,"ps")),class:"p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded transition-colors",title:"Copy command"},[a.value==="ps"?(b(),pe($(Yt),{key:0,class:"w-4 h-4 text-green-500"})):(b(),pe($(ls),{key:1,class:"w-4 h-4 text-gray-400"}))])])]),f("div",null,[d[26]||(d[26]=f("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-1"},"macOS/Linux:",-1)),f("div",mS,[d[25]||(d[25]=f("code",{class:"flex-1 px-3 py-2 bg-gray-900 dark:bg-gray-950 text-green-400 rounded text-sm font-mono overflow-x-auto"},' export GEMINI_API_KEY="your-api-key-here" ',-1)),f("button",{onClick:d[3]||(d[3]=S=>c(SS,"unix")),class:"p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded transition-colors",title:"Copy command"},[a.value==="unix"?(b(),pe($(Yt),{key:0,class:"w-4 h-4 text-green-500"})):(b(),pe($(ls),{key:1,class:"w-4 h-4 text-gray-400"}))])])]),f("div",null,[d[28]||(d[28]=f("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-1"},".env file (recommended):",-1)),f("div",yS,[d[27]||(d[27]=f("code",{class:"flex-1 px-3 py-2 bg-gray-900 dark:bg-gray-950 text-green-400 rounded text-sm font-mono overflow-x-auto"}," GEMINI_API_KEY=your-api-key-here ",-1)),f("button",{onClick:d[4]||(d[4]=S=>c("GEMINI_API_KEY=your-api-key-here","env")),class:"p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded transition-colors",title:"Copy command"},[a.value==="env"?(b(),pe($(Yt),{key:0,class:"w-4 h-4 text-green-500"})):(b(),pe($(ls),{key:1,class:"w-4 h-4 text-gray-400"}))])])])])])])]),d[32]||(d[32]=Bs('<div class="p-4 rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700/30"><div class="flex items-start gap-3"><div class="flex-shrink-0 w-6 h-6 rounded-full bg-blue-100 dark:bg-blue-900/50 text-blue-600 dark:text-blue-400 flex items-center justify-center text-sm font-semibold">4</div><div class="flex-1"><h4 class="text-sm font-medium text-gray-800 dark:text-gray-100 mb-1">Restart the Dashboard</h4><p class="text-sm text-gray-600 dark:text-gray-300"> After setting the environment variable, restart the Omni-Cortex dashboard server for changes to take effect. </p></div></div></div>',1))])])):H("",!0),(y=r.value)!=null&&y.available&&((x=i.value)!=null&&x.available)?(b(),k("section",bS,[f("div",xS,[f("div",vS,[O($(zr),{class:"w-5 h-5 text-green-600 dark:text-green-400"}),d[34]||(d[34]=f("div",null,[f("p",{class:"text-sm font-medium text-green-800 dark:text-green-200"},"All AI features are configured!"),f("p",{class:"text-sm text-green-600 dark:text-green-300 mt-0.5"}," Both Chat and Image Generation are ready to use. ")],-1))])])])):H("",!0)]),f("div",_S,[f("button",{onClick:l,disabled:o.value,class:"px-4 py-2 text-sm font-medium text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-50"}," Refresh Status ",8,kS),f("button",{onClick:d[5]||(d[5]=S=>n("close")),class:"px-4 py-2 text-sm font-medium bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"}," Done ")])])])}}}),CS={class:"app-header bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 sticky top-0 z-50"},TS={class:"container mx-auto px-4 py-3"},MS={class:"flex items-center justify-between gap-4"},AS={class:"flex items-center gap-3"},ES={class:"w-8 h-8 bg-gradient-to-br from-purple-500 to-blue-600 rounded-lg flex items-center justify-center"},PS={class:"project-switcher relative"},RS={class:"font-medium truncate max-w-[200px]"},DS={class:"text-sm text-gray-500 dark:text-gray-400"},OS={class:"flex-1 max-w-xl"},IS={class:"relative"},LS={class:"flex items-center gap-2"},NS=["title"],FS=["title"],jS={key:0,class:"relative flex h-2 w-2 mr-1"},zS={key:3,class:"text-xs opacity-75"},BS=Oe({__name:"AppHeader",emits:["toggle-filters"],setup(t,{emit:e}){const n=e,s=We(),{theme:r,toggleTheme:i}=wk(),o=I(""),a=I(!1),l=I(!1),c=I(!1),u=I(!1),d=I(!1),{formattedElapsed:h}=Sk(()=>s.lastUpdated),g=le(()=>{var v;return((v=s.stats)==null?void 0:v.total_count)??0}),p=le(()=>r.value==="light"?Kk:r.value==="dark"?Bk:zk),m=le(()=>r.value==="light"?"Light":r.value==="dark"?"Dark":"System");function y(){s.search(o.value)}function x(v){v.key==="Escape"&&(o.value="",s.search(""))}function S(){a.value=!1,u.value=!0}function T(){c.value=!0}return Ge(()=>{window.addEventListener("show-help",T)}),tn(()=>{window.removeEventListener("show-help",T)}),(v,_)=>{var P;return b(),k("header",CS,[f("div",TS,[f("div",MS,[f("div",AS,[f("div",ES,[O($(Zr),{class:"w-5 h-5 text-white"})]),_[12]||(_[12]=f("h1",{class:"text-xl font-bold"},"Omni-Cortex",-1))]),f("div",PS,[f("button",{onClick:_[0]||(_[0]=L=>a.value=!a.value),class:re(["flex items-center gap-2 px-4 py-2 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",$(s).isMultiProject?"bg-gradient-to-r from-blue-100 to-purple-100 dark:from-blue-900/30 dark:to-purple-900/30":"bg-gray-100 dark:bg-gray-700"])},[$(s).isMultiProject?(b(),pe($(vm),{key:0,class:"w-5 h-5 text-blue-600 dark:text-blue-400"})):H("",!0),f("span",RS,A($(s).isMultiProject?`${$(s).selectedProjects.length} Projects`:((P=$(s).currentProject)==null?void 0:P.name)??"Select Project"),1),f("span",DS," ("+A(g.value)+" memories) ",1)],2),a.value?(b(),pe(hw,{key:0,onClose:_[1]||(_[1]=L=>a.value=!1),onOpenManagement:S})):H("",!0)]),f("div",OS,[f("div",IS,[O($(lo),{class:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),Ee(f("input",{"onUpdate:modelValue":_[2]||(_[2]=L=>o.value=L),onKeyup:Fr(y,["enter"]),onKeydown:x,type:"text",placeholder:"Search memories... (Enter to search, Esc to clear)",class:"search-input w-full pl-10 pr-4 py-2 bg-gray-100 dark:bg-gray-700 rounded-lg border-none focus:ring-2 focus:ring-blue-500 outline-none transition-all"},null,544),[[rt,o.value]])])]),f("div",LS,[f("button",{onClick:_[3]||(_[3]=L=>l.value=!0),class:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Export memories"},[O($(xr),{class:"w-5 h-5"})]),f("button",{onClick:_[4]||(_[4]=L=>n("toggle-filters")),class:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Toggle Filters"},[O($(ad),{class:"w-5 h-5"})]),f("button",{onClick:_[5]||(_[5]=L=>d.value=!0),class:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Settings & API Keys"},[O($(ld),{class:"w-5 h-5"})]),f("button",{onClick:_[6]||(_[6]=(...L)=>$(i)&&$(i)(...L)),class:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors flex items-center gap-1",title:`Theme: ${m.value} (click to toggle)`},[(b(),pe(Vn(p.value),{class:"w-5 h-5"}))],8,NS),f("button",{onClick:_[7]||(_[7]=L=>c.value=!0),class:"help-button p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Help & Shortcuts (?)"},[O($(Ol),{class:"w-5 h-5"})]),f("div",{class:re(["live-status",["flex items-center gap-1 px-2 py-1 rounded-full text-sm",$(s).isConnected?"bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-300":"bg-red-100 dark:bg-red-900 text-red-700 dark:text-red-300"]]),title:$(h)?`Last updated: ${$(h)}`:""},[$(s).isConnected?(b(),k("span",jS,[..._[13]||(_[13]=[f("span",{class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"},null,-1),f("span",{class:"relative inline-flex rounded-full h-2 w-2 bg-green-500"},null,-1)])])):H("",!0),$(s).isConnected?(b(),pe($(Zk),{key:1,class:"w-4 h-4"})):(b(),pe($(Jk),{key:2,class:"w-4 h-4"})),f("span",null,A($(s).isConnected?"Live":"Offline"),1),$(h)&&$(s).isConnected?(b(),k("span",zS," · "+A($(h)),1)):H("",!0)],10,FS)])])]),l.value?(b(),pe(Ow,{key:0,onClose:_[8]||(_[8]=L=>l.value=!1)})):H("",!0),c.value?(b(),pe(e2,{key:1,onClose:_[9]||(_[9]=L=>c.value=!1)})):H("",!0),u.value?(b(),pe(F2,{key:2,onClose:_[10]||(_[10]=L=>u.value=!1)})):H("",!0),d.value?(b(),pe($S,{key:3,onClose:_[11]||(_[11]=L=>d.value=!1)})):H("",!0)])}}}),cd=["decision","solution","insight","error","context","preference","todo","reference","workflow","api","other"],Am=["fresh","needs_review","outdated","archived"],Ll={decision:"bg-type-decision",solution:"bg-type-solution",insight:"bg-type-insight",error:"bg-type-error",context:"bg-type-context",preference:"bg-type-preference",todo:"bg-type-todo",reference:"bg-type-reference",workflow:"bg-type-workflow",api:"bg-type-api",other:"bg-type-other"},HS={decision:"border-l-type-decision",solution:"border-l-type-solution",insight:"border-l-type-insight",error:"border-l-type-error",context:"border-l-type-context",preference:"border-l-type-preference",todo:"border-l-type-todo",reference:"border-l-type-reference",workflow:"border-l-type-workflow",api:"border-l-type-api",other:"border-l-type-other"},US={professional:"bg-blue-500",casual:"bg-green-500",technical:"bg-purple-500",creative:"bg-pink-500",formal:"bg-slate-500",friendly:"bg-amber-500",urgent:"bg-red-500",neutral:"bg-gray-500"},VS={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4"},WS={class:"flex items-center justify-between mb-4"},qS={class:"mb-4"},KS={key:0,class:"space-y-1"},GS=["onClick"],YS={class:"capitalize"},XS={class:"mb-4"},JS={key:0,class:"space-y-1"},ZS=["onClick"],QS={class:"mb-4"},e5={key:0,class:"flex flex-wrap gap-1 max-h-40 overflow-y-auto"},t5=["onClick"],n5={class:"mb-4"},s5={key:0,class:"space-y-2"},r5={class:"flex items-center gap-2"},i5={class:"text-xs w-8"},o5={class:"flex items-center gap-2"},a5={class:"text-xs w-8"},l5={class:"flex gap-2 mt-2"},c5=Oe({__name:"FilterPanel",setup(t){const e=We(),n=I(!0),s=I(!0),r=I(!0),i=I(!1),o=le({get:()=>e.filters.memory_type,set:g=>e.applyFilters({memory_type:g})}),a=le({get:()=>e.filters.status,set:g=>e.applyFilters({status:g})}),l=le({get:()=>e.filters.tags,set:g=>e.applyFilters({tags:g})}),c=le({get:()=>e.filters.min_importance??0,set:g=>e.applyFilters({min_importance:g||null})}),u=le({get:()=>e.filters.max_importance??100,set:g=>e.applyFilters({max_importance:g===100?null:g})});function d(g){const p=[...l.value],m=p.indexOf(g);m===-1?p.push(g):p.splice(m,1),l.value=p}function h(g){return Ll[g]||"bg-gray-500"}return(g,p)=>(b(),k("div",VS,[f("div",WS,[p[14]||(p[14]=f("h2",{class:"font-semibold"},"Filters",-1)),f("button",{onClick:p[0]||(p[0]=(...m)=>$(e).resetFilters&&$(e).resetFilters(...m)),class:"text-sm text-blue-600 hover:text-blue-700 flex items-center gap-1"},[O($(Hk),{class:"w-4 h-4"}),p[13]||(p[13]=oe(" Reset ",-1))])]),f("div",qS,[f("button",{onClick:p[1]||(p[1]=m=>n.value=!n.value),class:"flex items-center justify-between w-full text-sm font-medium mb-2"},[p[15]||(p[15]=f("span",null,"Memory Type",-1)),n.value?(b(),pe($(Ps),{key:1,class:"w-4 h-4"})):(b(),pe($(Nn),{key:0,class:"w-4 h-4"}))]),n.value?(b(),k("div",KS,[f("button",{onClick:p[2]||(p[2]=m=>o.value=null),class:re(["w-full px-2 py-1 rounded text-sm text-left transition-colors",o.value===null?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300":"hover:bg-gray-100 dark:hover:bg-gray-700"])}," All Types ",2),(b(!0),k(ae,null,ve($(cd),m=>(b(),k("button",{key:m,onClick:y=>o.value=m,class:re(["w-full px-2 py-1 rounded text-sm text-left transition-colors flex items-center gap-2",o.value===m?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300":"hover:bg-gray-100 dark:hover:bg-gray-700"])},[f("span",{class:re(["w-2 h-2 rounded-full",h(m)])},null,2),f("span",YS,A(m),1)],10,GS))),128))])):H("",!0)]),f("div",XS,[f("button",{onClick:p[3]||(p[3]=m=>s.value=!s.value),class:"flex items-center justify-between w-full text-sm font-medium mb-2"},[p[16]||(p[16]=f("span",null,"Status",-1)),s.value?(b(),pe($(Ps),{key:1,class:"w-4 h-4"})):(b(),pe($(Nn),{key:0,class:"w-4 h-4"}))]),s.value?(b(),k("div",JS,[f("button",{onClick:p[4]||(p[4]=m=>a.value=null),class:re(["w-full px-2 py-1 rounded text-sm text-left transition-colors",a.value===null?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300":"hover:bg-gray-100 dark:hover:bg-gray-700"])}," All Statuses ",2),(b(!0),k(ae,null,ve($(Am),m=>(b(),k("button",{key:m,onClick:y=>a.value=m,class:re(["w-full px-2 py-1 rounded text-sm text-left transition-colors capitalize",a.value===m?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300":"hover:bg-gray-100 dark:hover:bg-gray-700"])},A(m.replace("_"," ")),11,ZS))),128))])):H("",!0)]),f("div",QS,[f("button",{onClick:p[5]||(p[5]=m=>r.value=!r.value),class:"flex items-center justify-between w-full text-sm font-medium mb-2"},[p[17]||(p[17]=f("span",null,"Tags",-1)),r.value?(b(),pe($(Ps),{key:1,class:"w-4 h-4"})):(b(),pe($(Nn),{key:0,class:"w-4 h-4"}))]),r.value?(b(),k("div",e5,[(b(!0),k(ae,null,ve($(e).tags.slice(0,20),m=>(b(),k("button",{key:m.name,onClick:y=>d(m.name),class:re(["px-2 py-0.5 rounded-full text-xs transition-colors",l.value.includes(m.name)?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600"])},A(m.name)+" ("+A(m.count)+") ",11,t5))),128))])):H("",!0)]),f("div",n5,[f("button",{onClick:p[6]||(p[6]=m=>i.value=!i.value),class:"flex items-center justify-between w-full text-sm font-medium mb-2"},[p[18]||(p[18]=f("span",null,"Importance",-1)),i.value?(b(),pe($(Ps),{key:1,class:"w-4 h-4"})):(b(),pe($(Nn),{key:0,class:"w-4 h-4"}))]),i.value?(b(),k("div",s5,[f("div",r5,[p[19]||(p[19]=f("span",{class:"text-xs w-8"},"Min:",-1)),Ee(f("input",{"onUpdate:modelValue":p[7]||(p[7]=m=>c.value=m),type:"range",min:"0",max:"100",class:"flex-1"},null,512),[[rt,c.value,void 0,{number:!0}]]),f("span",i5,A(c.value),1)]),f("div",o5,[p[20]||(p[20]=f("span",{class:"text-xs w-8"},"Max:",-1)),Ee(f("input",{"onUpdate:modelValue":p[8]||(p[8]=m=>u.value=m),type:"range",min:"0",max:"100",class:"flex-1"},null,512),[[rt,u.value,void 0,{number:!0}]]),f("span",a5,A(u.value),1)])])):H("",!0)]),f("div",null,[p[22]||(p[22]=f("div",{class:"text-sm font-medium mb-2"},"Sort By",-1)),Ee(f("select",{"onUpdate:modelValue":p[9]||(p[9]=m=>$(e).filters.sort_by=m),onChange:p[10]||(p[10]=m=>$(e).applyFilters({sort_by:$(e).filters.sort_by})),class:"w-full px-2 py-1.5 bg-gray-100 dark:bg-gray-700 rounded border-none text-sm"},[...p[21]||(p[21]=[f("option",{value:"last_accessed"},"Last Accessed",-1),f("option",{value:"created_at"},"Created",-1),f("option",{value:"importance_score"},"Importance",-1),f("option",{value:"access_count"},"Access Count",-1)])],544),[[cn,$(e).filters.sort_by]]),f("div",l5,[f("button",{onClick:p[11]||(p[11]=m=>$(e).applyFilters({sort_order:"desc"})),class:re(["flex-1 px-2 py-1 rounded text-sm transition-colors",$(e).filters.sort_order==="desc"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700"])}," Desc ",2),f("button",{onClick:p[12]||(p[12]=m=>$(e).applyFilters({sort_order:"asc"})),class:re(["flex-1 px-2 py-1 rounded text-sm transition-colors",$(e).filters.sort_order==="asc"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700"])}," Asc ",2)])])]))}});function gc(t,e){if(!e||!t)return gh(t);const n=gh(t),s=u5(e),r=new RegExp(`(${s})`,"gi");return n.replace(r,'<mark class="bg-yellow-200 dark:bg-yellow-700 px-0.5 rounded">$1</mark>')}function gh(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function u5(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d5(t,e,n=200){if(!t)return"";if(e){const s=t.toLowerCase(),r=e.toLowerCase(),i=s.indexOf(r);if(i!==-1){const o=Math.max(0,i-Math.floor(n/3)),a=Math.min(t.length,o+n);let l=t.substring(o,a);return o>0&&(l="..."+l),a<t.length&&(l=l+"..."),gc(l,e)}}return t.length<=n?gc(t,e):gc(t.substring(0,n)+"...",e)}const f5={class:"flex items-start justify-between gap-2 mb-2"},h5={class:"flex items-center gap-2"},g5={class:"flex items-center gap-1"},p5={class:"w-16 h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},m5={class:"text-xs text-gray-500"},y5=["innerHTML"],b5={key:0,class:"flex flex-wrap gap-1 mb-3"},x5={key:0,class:"px-2 py-0.5 text-xs text-gray-500"},v5={class:"flex items-center gap-4 text-xs text-gray-500 dark:text-gray-400"},_5={class:"flex items-center gap-1"},k5={class:"flex items-center gap-1"},w5=Oe({__name:"MemoryCard",props:{memory:{},selected:{type:Boolean},searchTerm:{}},setup(t){const e=t,n=le(()=>Ll[e.memory.memory_type]||"bg-gray-500"),s=le(()=>HS[e.memory.memory_type]||"border-l-gray-500"),r=le(()=>d5(e.memory.content,e.searchTerm||"",200));function i(o){if(!o)return"Never";const a=new Date(o),c=new Date().getTime()-a.getTime(),u=Math.floor(c/6e4),d=Math.floor(u/60),h=Math.floor(d/24);return u<1?"Just now":u<60?`${u}m ago`:d<24?`${d}h ago`:h<7?`${h}d ago`:a.toLocaleDateString()}return(o,a)=>(b(),k("div",{class:re(["p-4 rounded-lg cursor-pointer transition-all hover:shadow-md border-l-4",s.value,t.selected?"border-r border-t border-b border-r-blue-500 border-t-blue-500 border-b-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-r border-t border-b border-r-gray-200 border-t-gray-200 border-b-gray-200 dark:border-r-gray-700 dark:border-t-gray-700 dark:border-b-gray-700 bg-white dark:bg-gray-800 hover:border-r-gray-300 hover:border-t-gray-300 hover:border-b-gray-300 dark:hover:border-r-gray-600 dark:hover:border-t-gray-600 dark:hover:border-b-gray-600"])},[f("div",f5,[f("div",h5,[f("span",{class:re(["px-2 py-0.5 rounded-full text-xs font-medium text-white",n.value])},A(t.memory.memory_type),3),t.memory.status!=="fresh"?(b(),k("span",{key:0,class:re(["px-2 py-0.5 rounded-full text-xs",t.memory.status==="needs_review"&&"bg-yellow-100 text-yellow-700",t.memory.status==="outdated"&&"bg-red-100 text-red-700",t.memory.status==="archived"&&"bg-gray-100 text-gray-600"])},A(t.memory.status.replace("_"," ")),3)):H("",!0)]),f("div",g5,[f("div",p5,[f("div",{class:re(["h-full rounded-full",n.value]),style:wt({width:`${t.memory.importance_score}%`})},null,6)]),f("span",m5,A(t.memory.importance_score),1)])]),f("p",{class:"text-sm text-gray-700 dark:text-gray-300 mb-3 whitespace-pre-wrap break-words",innerHTML:r.value},null,8,y5),t.memory.tags.length>0?(b(),k("div",b5,[(b(!0),k(ae,null,ve(t.memory.tags.slice(0,5),l=>(b(),k("span",{key:l,class:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-full text-xs text-gray-600 dark:text-gray-400"},A(l),1))),128)),t.memory.tags.length>5?(b(),k("span",x5," +"+A(t.memory.tags.length-5)+" more ",1)):H("",!0)])):H("",!0),f("div",v5,[f("span",_5,[O($(ao),{class:"w-3 h-3"}),oe(" "+A(i(t.memory.last_accessed)),1)]),f("span",k5,[O($(mm),{class:"w-3 h-3"}),oe(" "+A(t.memory.access_count)+" views ",1)])])],2))}}),S5={key:0,class:"bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-700 rounded-lg p-4 mb-4"},$5={class:"flex items-start gap-3"},C5={class:"flex-1 min-w-0"},T5={class:"text-sm text-amber-700 dark:text-amber-300 mt-1"},M5={class:"flex gap-2 mt-3"},A5=Oe({__name:"DuplicationWarningBanner",setup(t){const e=We(),n=I(!1);function s(){n.value=!0}function r(){e.selectGlobalOnly(),n.value=!1}function i(){e.selectProjectsOnly(),n.value=!1}return Be(()=>e.showDuplicationWarning,(o,a)=>{o&&!a&&(n.value=!1)}),(o,a)=>(b(),pe(mr,{"enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-150 ease-in","enter-from-class":"opacity-0 -translate-y-2","leave-to-class":"opacity-0 -translate-y-2"},{default:js(()=>[$(e).showDuplicationWarning&&!n.value?(b(),k("div",S5,[f("div",$5,[O($(lu),{class:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5"}),f("div",C5,[a[2]||(a[2]=f("h4",{class:"font-medium text-amber-800 dark:text-amber-200"}," Duplicate Counting Detected ",-1)),f("p",T5," Global Index contains memories from all projects. Selecting both causes ~"+A($(e).estimatedOverlapCount)+" memories to be counted twice. ",1),f("div",M5,[f("button",{onClick:r,class:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md bg-amber-200 dark:bg-amber-800 text-amber-800 dark:text-amber-200 hover:bg-amber-300 dark:hover:bg-amber-700 transition-colors"},[O($(Dl),{class:"w-4 h-4"}),a[0]||(a[0]=oe(" View Global Only ",-1))]),f("button",{onClick:i,class:"flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md bg-amber-200 dark:bg-amber-800 text-amber-800 dark:text-amber-200 hover:bg-amber-300 dark:hover:bg-amber-700 transition-colors"},[O($(bm),{class:"w-4 h-4"}),a[1]||(a[1]=oe(" View Projects Only ",-1))])])]),f("button",{onClick:s,class:"flex-shrink-0 p-1 rounded-md text-amber-600 dark:text-amber-400 hover:bg-amber-200 dark:hover:bg-amber-800 transition-colors",title:"Dismiss"},[O($(Qt),{class:"w-4 h-4"})])])])):H("",!0)]),_:1}))}}),E5={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700"},P5={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},R5={class:"text-sm text-gray-500 dark:text-gray-400 ml-2"},D5={class:"px-4 pt-4"},O5={key:0,class:"flex items-center justify-center py-12"},I5={key:1,class:"text-center py-12"},L5={key:2,class:"flex items-center justify-center py-4"},N5={key:3,class:"text-center py-4 text-sm text-gray-500"},F5=Oe({__name:"MemoryBrowser",setup(t){const e=We(),n=I(null);function s(){if(!n.value)return;const{scrollTop:r,scrollHeight:i,clientHeight:o}=n.value;r+o>=i-200&&!e.isLoading&&e.hasMore&&e.loadMore()}return(r,i)=>(b(),k("div",E5,[f("div",P5,[f("div",null,[i[0]||(i[0]=f("span",{class:"font-semibold"},"Memories",-1)),f("span",R5," ("+A($(e).memories.length)+A($(e).hasMore?"+":"")+" loaded) ",1)])]),f("div",D5,[O(A5)]),f("div",{ref_key:"listRef",ref:n,onScroll:s,class:"overflow-y-auto max-h-[calc(100vh-280px)] p-4 space-y-3"},[$(e).isLoading&&$(e).memories.length===0?(b(),k("div",O5,[O($(zn),{class:"w-8 h-8 animate-spin text-blue-600"}),i[1]||(i[1]=f("span",{class:"ml-2 text-gray-500"},"Loading memories...",-1))])):!$(e).isLoading&&$(e).memories.length===0?(b(),k("div",I5,[...i[2]||(i[2]=[f("div",{class:"text-gray-400 text-lg mb-2"},"No memories found",-1),f("p",{class:"text-gray-500 text-sm"},"Try adjusting your filters or search query",-1)])])):H("",!0),(b(!0),k(ae,null,ve($(e).memories,o=>{var a;return b(),pe(w5,{key:o.id,memory:o,selected:((a=$(e).selectedMemory)==null?void 0:a.id)===o.id,"search-term":$(e).filters.search,onClick:l=>$(e).selectMemory(o)},null,8,["memory","selected","search-term","onClick"])}),128)),$(e).isLoading&&$(e).memories.length>0?(b(),k("div",L5,[O($(zn),{class:"w-5 h-5 animate-spin text-blue-600"}),i[3]||(i[3]=f("span",{class:"ml-2 text-sm text-gray-500"},"Loading more...",-1))])):H("",!0),!$(e).hasMore&&$(e).memories.length>0?(b(),k("div",N5," End of list ")):H("",!0)],544)]))}});function j5(t,e="memories.json"){const n=JSON.stringify(t,null,2);Em(n,e,"application/json")}function z5(t,e="memories.md"){const n=["# Omni-Cortex Memories Export","",`Exported: ${new Date().toISOString()}`,`Total: ${t.length} memories`,"","---",""];for(const s of t)n.push(`## ${s.memory_type.toUpperCase()} - ${s.id}`),n.push(""),n.push(`**Status:** ${s.status}`),n.push(`**Importance:** ${s.importance_score}`),n.push(`**Created:** ${new Date(s.created_at).toLocaleString()}`),s.tags.length>0&&n.push(`**Tags:** ${s.tags.join(", ")}`),n.push(""),n.push("### Content"),n.push(""),n.push(s.content),n.push(""),s.context&&(n.push("### Context"),n.push(""),n.push(s.context),n.push("")),n.push("---"),n.push("");Em(n.join(`
|
|
437
|
+
`),e,"text/markdown")}function B5(t){const e=[`# ${t.memory_type.toUpperCase()}`,"",`**ID:** ${t.id}`,`**Status:** ${t.status}`,`**Importance:** ${t.importance_score}`,`**Created:** ${new Date(t.created_at).toLocaleString()}`,`**Last Accessed:** ${t.last_accessed?new Date(t.last_accessed).toLocaleString():"Never"}`,`**Access Count:** ${t.access_count}`];return t.tags.length>0&&e.push(`**Tags:** ${t.tags.join(", ")}`),e.push(""),e.push("## Content"),e.push(""),e.push(t.content),t.context&&(e.push(""),e.push("## Context"),e.push(""),e.push(t.context)),e.join(`
|
|
438
|
+
`)}function Em(t,e,n){const s=new Blob([t],{type:n}),r=URL.createObjectURL(s),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}async function ph(t){try{return await navigator.clipboard.writeText(t),!0}catch(e){return console.error("Failed to copy to clipboard:",e),!1}}const H5={key:0,class:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-hidden flex flex-col"},U5={class:"px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},V5=["disabled"],W5={class:"flex-1 overflow-y-auto p-6 space-y-4"},q5={class:"grid grid-cols-2 gap-4"},K5=["value"],G5=["value"],Y5={class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},X5={key:0,class:"flex flex-wrap gap-1 mt-2"},J5={class:"px-6 py-4 border-t border-gray-200 dark:border-gray-700 flex items-center justify-end gap-3"},Z5=["disabled"],Q5=["disabled"],e4=Oe({__name:"MemoryEditModal",props:{memory:{},isOpen:{type:Boolean}},emits:["close","save"],setup(t,{emit:e}){const n=t,s=e,r=I(!1),i=I(""),o=I(""),a=I(""),l=I(""),c=I(50),u=I("");Be(()=>n.memory,m=>{m&&(i.value=m.content,o.value=m.context||"",a.value=m.memory_type,l.value=m.status,c.value=m.importance_score,u.value=m.tags.join(", "))},{immediate:!0}),Be(()=>n.isOpen,m=>{m&&n.memory&&(i.value=n.memory.content,o.value=n.memory.context||"",a.value=n.memory.memory_type,l.value=n.memory.status,c.value=n.memory.importance_score,u.value=n.memory.tags.join(", "))});const d=le(()=>u.value.trim()?u.value.split(",").map(m=>m.trim()).filter(m=>m.length>0):[]),h=le(()=>n.memory?i.value!==n.memory.content||o.value!==(n.memory.context||"")||a.value!==n.memory.memory_type||l.value!==n.memory.status||c.value!==n.memory.importance_score||JSON.stringify(d.value)!==JSON.stringify(n.memory.tags):!1);async function g(){if(!h.value||r.value)return;r.value=!0;const m={};i.value!==n.memory.content&&(m.content=i.value),o.value!==(n.memory.context||"")&&(m.context=o.value||void 0),a.value!==n.memory.memory_type&&(m.type=a.value),l.value!==n.memory.status&&(m.status=l.value),c.value!==n.memory.importance_score&&(m.importance_score=c.value),JSON.stringify(d.value)!==JSON.stringify(n.memory.tags)&&(m.tags=d.value),s("save",m),r.value=!1}function p(){r.value||s("close")}return(m,y)=>(b(),pe(Gr,{to:"body"},[O(mr,{"enter-active-class":"transition-opacity duration-200","leave-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:js(()=>[t.isOpen?(b(),k("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50",onClick:pt(p,["self"])},[O(mr,{"enter-active-class":"transition-all duration-200","leave-active-class":"transition-all duration-200","enter-from-class":"opacity-0 scale-95","leave-to-class":"opacity-0 scale-95"},{default:js(()=>[t.isOpen?(b(),k("div",H5,[f("div",U5,[y[6]||(y[6]=f("h2",{class:"text-lg font-semibold"},"Edit Memory",-1)),f("button",{onClick:p,disabled:r.value,class:"p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors disabled:opacity-50"},[O($(Qt),{class:"w-5 h-5"})],8,V5)]),f("div",W5,[f("div",null,[y[7]||(y[7]=f("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"}," Content ",-1)),Ee(f("textarea",{"onUpdate:modelValue":y[0]||(y[0]=x=>i.value=x),rows:"6",class:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Memory content..."},null,512),[[rt,i.value]])]),f("div",null,[y[8]||(y[8]=f("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"}," Context (optional) ",-1)),Ee(f("textarea",{"onUpdate:modelValue":y[1]||(y[1]=x=>o.value=x),rows:"3",class:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Additional context..."},null,512),[[rt,o.value]])]),f("div",q5,[f("div",null,[y[9]||(y[9]=f("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"}," Type ",-1)),Ee(f("select",{"onUpdate:modelValue":y[2]||(y[2]=x=>a.value=x),class:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent"},[(b(!0),k(ae,null,ve($(cd),x=>(b(),k("option",{key:x,value:x},A(x),9,K5))),128))],512),[[cn,a.value]])]),f("div",null,[y[10]||(y[10]=f("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"}," Status ",-1)),Ee(f("select",{"onUpdate:modelValue":y[3]||(y[3]=x=>l.value=x),class:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent"},[(b(!0),k(ae,null,ve($(Am),x=>(b(),k("option",{key:x,value:x},A(x.replace("_"," ")),9,G5))),128))],512),[[cn,l.value]])])]),f("div",null,[f("label",Y5," Importance: "+A(c.value),1),Ee(f("input",{"onUpdate:modelValue":y[4]||(y[4]=x=>c.value=x),type:"range",min:"1",max:"100",class:"w-full accent-blue-600"},null,512),[[rt,c.value,void 0,{number:!0}]]),y[11]||(y[11]=f("div",{class:"flex justify-between text-xs text-gray-500 mt-1"},[f("span",null,"Low (1)"),f("span",null,"High (100)")],-1))]),f("div",null,[y[12]||(y[12]=f("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"}," Tags (comma-separated) ",-1)),Ee(f("input",{"onUpdate:modelValue":y[5]||(y[5]=x=>u.value=x),type:"text",class:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"tag1, tag2, tag3"},null,512),[[rt,u.value]]),d.value.length>0?(b(),k("div",X5,[(b(!0),k(ae,null,ve(d.value,x=>(b(),k("span",{key:x,class:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded-full text-xs"},A(x),1))),128))])):H("",!0)])]),f("div",J5,[f("button",{onClick:p,disabled:r.value,class:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-50"}," Cancel ",8,Z5),f("button",{onClick:g,disabled:!h.value||r.value,class:"flex items-center gap-2 px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},[r.value?(b(),pe($(zn),{key:0,class:"w-4 h-4 animate-spin"})):(b(),pe($(Uk),{key:1,class:"w-4 h-4"})),oe(" "+A(r.value?"Saving...":"Save Changes"),1)],8,Q5)])])):H("",!0)]),_:1})])):H("",!0)]),_:1})]))}}),t4={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 h-[calc(100vh-280px)] flex flex-col"},n4={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between flex-shrink-0"},s4={class:"flex items-center gap-2"},r4={class:"flex items-center gap-2"},i4={key:1,class:"flex items-center gap-1"},o4=["disabled"],a4={key:1},l4=["disabled"],c4={class:"flex-1 overflow-y-auto p-4"},u4={class:"mb-4"},d4={class:"flex items-center justify-between mb-2"},f4={class:"flex items-center gap-2"},h4={class:"memory-content bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-sm"},g4={key:0,class:"mb-4"},p4={class:"bg-gray-50 dark:bg-gray-900 rounded-lg p-4 text-sm text-gray-600 dark:text-gray-400"},m4={key:1,class:"mb-4"},y4={class:"flex flex-wrap gap-2"},b4={class:"grid grid-cols-2 gap-4 text-sm"},x4={class:"flex items-center gap-2"},v4={class:"w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},_4={class:"font-medium"},k4={class:"font-medium"},w4={class:"font-medium"},S4={class:"font-medium"},$4={class:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700"},C4={class:"flex flex-wrap gap-2"},T4={class:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700"},M4={class:"text-xs text-gray-500 dark:text-gray-400"},A4={class:"font-mono"},E4=Oe({__name:"MemoryDetail",props:{memory:{}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,r=We(),i=I(!1),o=I(!1),a=I(!1),l=I(!1),c=I(!1),u=le(()=>Ll[n.memory.memory_type]||"bg-gray-500");function d(v){return v?new Date(v).toLocaleString():"Never"}async function h(){await ph(n.memory.content)&&(l.value=!0,setTimeout(()=>{l.value=!1},2e3))}async function g(){const v=B5(n.memory);await ph(v)&&(c.value=!0,setTimeout(()=>{c.value=!1},2e3))}function p(){j5([n.memory],`memory-${n.memory.id}.json`)}function m(){z5([n.memory],`memory-${n.memory.id}.md`)}function y(){i.value=!0}async function x(v){await r.updateMemory(n.memory.id,v)&&(i.value=!1)}async function S(){if(!a.value){a.value=!0;return}o.value=!0;const v=await r.deleteMemoryById(n.memory.id);o.value=!1,v&&s("close"),a.value=!1}function T(){a.value=!1}return(v,_)=>(b(),k(ae,null,[f("div",t4,[f("div",n4,[f("div",s4,[f("span",{class:re(["px-2 py-0.5 rounded-full text-xs font-medium text-white",u.value])},A(t.memory.memory_type),3),f("span",{class:re(["px-2 py-0.5 rounded-full text-xs capitalize",t.memory.status==="fresh"&&"bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300",t.memory.status==="needs_review"&&"bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-300",t.memory.status==="outdated"&&"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300",t.memory.status==="archived"&&"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400"])},A(t.memory.status.replace("_"," ")),3)]),f("div",r4,[f("button",{onClick:y,class:"p-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors text-blue-600 dark:text-blue-400",title:"Edit memory"},[O($(Ya),{class:"w-4 h-4"})]),a.value?(b(),k("div",i4,[f("button",{onClick:S,disabled:o.value,class:"px-2 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-700 transition-colors disabled:opacity-50"},[o.value?(b(),pe($(zn),{key:0,class:"w-3 h-3 animate-spin"})):(b(),k("span",a4,"Confirm"))],8,o4),f("button",{onClick:T,disabled:o.value,class:"px-2 py-1 text-xs bg-gray-200 dark:bg-gray-700 rounded hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors disabled:opacity-50"}," Cancel ",8,l4)])):(b(),k("button",{key:0,onClick:S,class:"p-1.5 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors text-red-600 dark:text-red-400",title:"Delete memory"},[O($(Gi),{class:"w-4 h-4"})])),f("button",{onClick:_[0]||(_[0]=P=>s("close")),class:"p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded transition-colors"},[O($(Qt),{class:"w-5 h-5"})])])]),f("div",c4,[f("div",u4,[f("div",d4,[_[2]||(_[2]=f("h3",{class:"text-sm font-semibold text-gray-500 dark:text-gray-400 uppercase"},"Content",-1)),f("div",f4,[f("button",{onClick:h,class:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 dark:text-blue-400",title:"Copy content"},[l.value?(b(),pe($(Yt),{key:0,class:"w-4 h-4"})):(b(),pe($(ls),{key:1,class:"w-4 h-4"})),oe(" "+A(l.value?"Copied!":"Copy"),1)])])]),f("div",h4,A(t.memory.content),1)]),t.memory.context?(b(),k("div",g4,[_[3]||(_[3]=f("h3",{class:"text-sm font-semibold text-gray-500 dark:text-gray-400 uppercase mb-2"},"Context",-1)),f("div",p4,A(t.memory.context),1)])):H("",!0),t.memory.tags.length>0?(b(),k("div",m4,[_[4]||(_[4]=f("h3",{class:"text-sm font-semibold text-gray-500 dark:text-gray-400 uppercase mb-2"},"Tags",-1)),f("div",y4,[(b(!0),k(ae,null,ve(t.memory.tags,P=>(b(),k("span",{key:P,class:"px-3 py-1 bg-gray-100 dark:bg-gray-700 rounded-full text-sm"},A(P),1))),128))])])):H("",!0),f("div",b4,[f("div",null,[_[5]||(_[5]=f("div",{class:"text-gray-500 dark:text-gray-400 mb-1"},"Importance",-1)),f("div",x4,[f("div",v4,[f("div",{class:re(["h-full rounded-full",u.value]),style:wt({width:`${t.memory.importance_score}%`})},null,6)]),f("span",_4,A(t.memory.importance_score),1)])]),f("div",null,[_[6]||(_[6]=f("div",{class:"text-gray-500 dark:text-gray-400 mb-1"},"Access Count",-1)),f("div",k4,A(t.memory.access_count)+" views",1)]),f("div",null,[_[7]||(_[7]=f("div",{class:"text-gray-500 dark:text-gray-400 mb-1"},"Created",-1)),f("div",w4,A(d(t.memory.created_at)),1)]),f("div",null,[_[8]||(_[8]=f("div",{class:"text-gray-500 dark:text-gray-400 mb-1"},"Last Accessed",-1)),f("div",S4,A(d(t.memory.last_accessed)),1)])]),f("div",$4,[_[11]||(_[11]=f("h3",{class:"text-sm font-semibold text-gray-500 dark:text-gray-400 uppercase mb-2"},"Export",-1)),f("div",C4,[f("button",{onClick:g,class:"flex items-center gap-1 px-3 py-1.5 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg text-sm transition-colors",title:"Copy as Markdown"},[c.value?(b(),pe($(Yt),{key:0,class:"w-4 h-4 text-green-600"})):(b(),pe($(ci),{key:1,class:"w-4 h-4"})),oe(" "+A(c.value?"Copied!":"Copy MD"),1)]),f("button",{onClick:p,class:"flex items-center gap-1 px-3 py-1.5 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg text-sm transition-colors",title:"Download as JSON"},[O($(od),{class:"w-4 h-4"}),_[9]||(_[9]=oe(" JSON ",-1))]),f("button",{onClick:m,class:"flex items-center gap-1 px-3 py-1.5 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg text-sm transition-colors",title:"Download as Markdown"},[O($(xr),{class:"w-4 h-4"}),_[10]||(_[10]=oe(" Markdown ",-1))])])]),f("div",T4,[f("div",M4,[_[12]||(_[12]=oe(" ID: ",-1)),f("span",A4,A(t.memory.id),1)])])])]),O(e4,{memory:t.memory,"is-open":i.value,onClose:_[1]||(_[1]=P=>i.value=!1),onSave:x},null,8,["memory","is-open"])],64))}}),P4={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},R4={class:"text-lg font-semibold mb-4 flex items-center gap-2"},D4={key:0,class:"flex items-center justify-center h-24"},O4={key:1,class:"text-red-500 text-sm"},I4={key:2,class:"overflow-x-auto"},L4={class:"flex gap-1"},N4=["title"],F4={class:"mt-4 text-sm text-gray-600 dark:text-gray-400"},j4=Oe({__name:"ActivityHeatmap",setup(t){const e=We(),n=I([]),s=I(!1),r=I(null),i=le(()=>{const u=new Date,d=[],h=new Map(n.value.map(p=>[p.date,p.count]));let g=[];for(let p=90;p>=0;p--){const m=new Date(u);m.setDate(m.getDate()-p);const y=m.toISOString().split("T")[0],x=m.getDay();g.push({date:y,count:h.get(y)||0,dayOfWeek:x}),(x===6||p===0)&&(d.push(g),g=[])}return d}),o=le(()=>Math.max(...n.value.map(u=>u.count),1));function a(u){if(u===0)return"bg-gray-100 dark:bg-gray-700";const d=u/o.value;return d<=.25?"bg-green-200 dark:bg-green-900":d<=.5?"bg-green-400 dark:bg-green-700":d<=.75?"bg-green-500 dark:bg-green-500":"bg-green-600 dark:bg-green-400"}function l(u){return new Date(u).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}async function c(){if(e.currentProject){s.value=!0,r.value=null;try{n.value=await V_(e.currentProject.db_path,90)}catch(u){r.value="Failed to load activity data",console.error(u)}finally{s.value=!1}}}return Ge(c),Be(()=>e.currentProject,c),(u,d)=>(b(),k("div",P4,[f("h2",R4,[O($(Rk),{class:"w-5 h-5 text-orange-500"}),d[0]||(d[0]=oe(" Activity Heatmap ",-1))]),s.value?(b(),k("div",D4,[...d[1]||(d[1]=[f("div",{class:"animate-pulse text-gray-500"},"Loading...",-1)])])):r.value?(b(),k("div",O4,A(r.value),1)):(b(),k("div",I4,[d[2]||(d[2]=Bs('<div class="flex items-start gap-1 mb-1"><div class="w-8 flex-shrink-0"></div><div class="text-xs text-gray-400 h-3">S</div><div class="text-xs text-gray-400 h-3">M</div><div class="text-xs text-gray-400 h-3">T</div><div class="text-xs text-gray-400 h-3">W</div><div class="text-xs text-gray-400 h-3">T</div><div class="text-xs text-gray-400 h-3">F</div><div class="text-xs text-gray-400 h-3">S</div></div>',1)),f("div",L4,[(b(!0),k(ae,null,ve(i.value,(h,g)=>(b(),k("div",{key:g,class:"flex flex-col gap-1"},[(b(!0),k(ae,null,ve(h,p=>(b(),k("div",{key:p.date,class:re(["w-3 h-3 rounded-sm cursor-pointer transition-colors",a(p.count)]),title:`${l(p.date)}: ${p.count} activities`},null,10,N4))),128))]))),128))]),d[3]||(d[3]=Bs('<div class="flex items-center gap-2 mt-4 text-xs text-gray-500"><span>Less</span><div class="w-3 h-3 rounded-sm bg-gray-100 dark:bg-gray-700"></div><div class="w-3 h-3 rounded-sm bg-green-200 dark:bg-green-900"></div><div class="w-3 h-3 rounded-sm bg-green-400 dark:bg-green-700"></div><div class="w-3 h-3 rounded-sm bg-green-500 dark:bg-green-500"></div><div class="w-3 h-3 rounded-sm bg-green-600 dark:bg-green-400"></div><span>More</span></div>',1)),f("div",F4,A(n.value.reduce((h,g)=>h+g.count,0))+" activities in the last 90 days ",1)]))]))}});/*!
|
|
439
|
+
* @kurkle/color v0.3.4
|
|
440
|
+
* https://github.com/kurkle/color#readme
|
|
441
|
+
* (c) 2024 Jukka Kurkela
|
|
442
|
+
* Released under the MIT License
|
|
443
|
+
*/function Ro(t){return t+.5|0}const Rs=(t,e,n)=>Math.max(Math.min(t,n),e);function Ei(t){return Rs(Ro(t*2.55),0,255)}function Fs(t){return Rs(Ro(t*255),0,255)}function rs(t){return Rs(Ro(t/2.55)/100,0,1)}function mh(t){return Rs(Ro(t*100),0,100)}const fn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},hu=[..."0123456789ABCDEF"],z4=t=>hu[t&15],B4=t=>hu[(t&240)>>4]+hu[t&15],Yo=t=>(t&240)>>4===(t&15),H4=t=>Yo(t.r)&&Yo(t.g)&&Yo(t.b)&&Yo(t.a);function U4(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&fn[t[1]]*17,g:255&fn[t[2]]*17,b:255&fn[t[3]]*17,a:e===5?fn[t[4]]*17:255}:(e===7||e===9)&&(n={r:fn[t[1]]<<4|fn[t[2]],g:fn[t[3]]<<4|fn[t[4]],b:fn[t[5]]<<4|fn[t[6]],a:e===9?fn[t[7]]<<4|fn[t[8]]:255})),n}const V4=(t,e)=>t<255?e(t):"";function W4(t){var e=H4(t)?z4:B4;return t?"#"+e(t.r)+e(t.g)+e(t.b)+V4(t.a,e):void 0}const q4=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Pm(t,e,n){const s=e*Math.min(n,1-n),r=(i,o=(i+t/30)%12)=>n-s*Math.max(Math.min(o-3,9-o,1),-1);return[r(0),r(8),r(4)]}function K4(t,e,n){const s=(r,i=(r+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return[s(5),s(3),s(1)]}function G4(t,e,n){const s=Pm(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)s[r]*=1-e-n,s[r]+=e;return s}function Y4(t,e,n,s,r){return t===r?(e-n)/s+(e<n?6:0):e===r?(n-t)/s+2:(t-e)/s+4}function ud(t){const n=t.r/255,s=t.g/255,r=t.b/255,i=Math.max(n,s,r),o=Math.min(n,s,r),a=(i+o)/2;let l,c,u;return i!==o&&(u=i-o,c=a>.5?u/(2-i-o):u/(i+o),l=Y4(n,s,r,u,i),l=l*60+.5),[l|0,c||0,a]}function dd(t,e,n,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,s)).map(Fs)}function fd(t,e,n){return dd(Pm,t,e,n)}function X4(t,e,n){return dd(G4,t,e,n)}function J4(t,e,n){return dd(K4,t,e,n)}function Rm(t){return(t%360+360)%360}function Z4(t){const e=q4.exec(t);let n=255,s;if(!e)return;e[5]!==s&&(n=e[6]?Ei(+e[5]):Fs(+e[5]));const r=Rm(+e[2]),i=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?s=X4(r,i,o):e[1]==="hsv"?s=J4(r,i,o):s=fd(r,i,o),{r:s[0],g:s[1],b:s[2],a:n}}function Q4(t,e){var n=ud(t);n[0]=Rm(n[0]+e),n=fd(n),t.r=n[0],t.g=n[1],t.b=n[2]}function e$(t){if(!t)return;const e=ud(t),n=e[0],s=mh(e[1]),r=mh(e[2]);return t.a<255?`hsla(${n}, ${s}%, ${r}%, ${rs(t.a)})`:`hsl(${n}, ${s}%, ${r}%)`}const yh={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},bh={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function t$(){const t={},e=Object.keys(bh),n=Object.keys(yh);let s,r,i,o,a;for(s=0;s<e.length;s++){for(o=a=e[s],r=0;r<n.length;r++)i=n[r],a=a.replace(i,yh[i]);i=parseInt(bh[o],16),t[a]=[i>>16&255,i>>8&255,i&255]}return t}let Xo;function n$(t){Xo||(Xo=t$(),Xo.transparent=[0,0,0,0]);const e=Xo[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const s$=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function r$(t){const e=s$.exec(t);let n=255,s,r,i;if(e){if(e[7]!==s){const o=+e[7];n=e[8]?Ei(o):Rs(o*255,0,255)}return s=+e[1],r=+e[3],i=+e[5],s=255&(e[2]?Ei(s):Rs(s,0,255)),r=255&(e[4]?Ei(r):Rs(r,0,255)),i=255&(e[6]?Ei(i):Rs(i,0,255)),{r:s,g:r,b:i,a:n}}}function i$(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${rs(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const pc=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Pr=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function o$(t,e,n){const s=Pr(rs(t.r)),r=Pr(rs(t.g)),i=Pr(rs(t.b));return{r:Fs(pc(s+n*(Pr(rs(e.r))-s))),g:Fs(pc(r+n*(Pr(rs(e.g))-r))),b:Fs(pc(i+n*(Pr(rs(e.b))-i))),a:t.a+n*(e.a-t.a)}}function Jo(t,e,n){if(t){let s=ud(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*n,e===0?360:1)),s=fd(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function Dm(t,e){return t&&Object.assign(e||{},t)}function xh(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Fs(t[3]))):(e=Dm(t,{r:0,g:0,b:0,a:1}),e.a=Fs(e.a)),e}function a$(t){return t.charAt(0)==="r"?r$(t):Z4(t)}let Om=class gu{constructor(e){if(e instanceof gu)return e;const n=typeof e;let s;n==="object"?s=xh(e):n==="string"&&(s=U4(e)||n$(e)||a$(e)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var e=Dm(this._rgb);return e&&(e.a=rs(e.a)),e}set rgb(e){this._rgb=xh(e)}rgbString(){return this._valid?i$(this._rgb):void 0}hexString(){return this._valid?W4(this._rgb):void 0}hslString(){return this._valid?e$(this._rgb):void 0}mix(e,n){if(e){const s=this.rgb,r=e.rgb;let i;const o=n===i?.5:n,a=2*o-1,l=s.a-r.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,s.r=255&c*s.r+i*r.r+.5,s.g=255&c*s.g+i*r.g+.5,s.b=255&c*s.b+i*r.b+.5,s.a=o*s.a+(1-o)*r.a,this.rgb=s}return this}interpolate(e,n){return e&&(this._rgb=o$(this._rgb,e._rgb,n)),this}clone(){return new gu(this.rgb)}alpha(e){return this._rgb.a=Fs(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=Ro(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Jo(this._rgb,2,e),this}darken(e){return Jo(this._rgb,2,-e),this}saturate(e){return Jo(this._rgb,1,e),this}desaturate(e){return Jo(this._rgb,1,-e),this}rotate(e){return Q4(this._rgb,e),this}};/*!
|
|
444
|
+
* Chart.js v4.5.1
|
|
445
|
+
* https://www.chartjs.org
|
|
446
|
+
* (c) 2025 Chart.js Contributors
|
|
447
|
+
* Released under the MIT License
|
|
448
|
+
*/function Xn(){}const l$=(()=>{let t=0;return()=>t++})();function Je(t){return t==null}function bt(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Ve(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Ot(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Pn(t,e){return Ot(t)?t:e}function Fe(t,e){return typeof t>"u"?e:t}const c$=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,Im=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function at(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Qe(t,e,n,s){let r,i,o;if(bt(t))for(i=t.length,r=0;r<i;r++)e.call(n,t[r],r);else if(Ve(t))for(o=Object.keys(t),i=o.length,r=0;r<i;r++)e.call(n,t[o[r]],o[r])}function Xa(t,e){let n,s,r,i;if(!t||!e||t.length!==e.length)return!1;for(n=0,s=t.length;n<s;++n)if(r=t[n],i=e[n],r.datasetIndex!==i.datasetIndex||r.index!==i.index)return!1;return!0}function Ja(t){if(bt(t))return t.map(Ja);if(Ve(t)){const e=Object.create(null),n=Object.keys(t),s=n.length;let r=0;for(;r<s;++r)e[n[r]]=Ja(t[n[r]]);return e}return t}function Lm(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function u$(t,e,n,s){if(!Lm(t))return;const r=e[t],i=n[t];Ve(r)&&Ve(i)?co(r,i,s):e[t]=Ja(i)}function co(t,e,n){const s=bt(e)?e:[e],r=s.length;if(!Ve(t))return t;n=n||{};const i=n.merger||u$;let o;for(let a=0;a<r;++a){if(o=s[a],!Ve(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)i(l[c],t,o,n)}return t}function Yi(t,e){return co(t,e,{merger:d$})}function d$(t,e,n){if(!Lm(t))return;const s=e[t],r=n[t];Ve(s)&&Ve(r)?Yi(s,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ja(r))}const vh={"":t=>t,x:t=>t.x,y:t=>t.y};function f$(t){const e=t.split("."),n=[];let s="";for(const r of e)s+=r,s.endsWith("\\")?s=s.slice(0,-1)+".":(n.push(s),s="");return n}function h$(t){const e=f$(t);return n=>{for(const s of e){if(s==="")break;n=n&&n[s]}return n}}function vr(t,e){return(vh[e]||(vh[e]=h$(e)))(t)}function hd(t){return t.charAt(0).toUpperCase()+t.slice(1)}const uo=t=>typeof t<"u",Us=t=>typeof t=="function",_h=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function g$(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const et=Math.PI,dt=2*et,p$=dt+et,Za=Number.POSITIVE_INFINITY,m$=et/180,_t=et/2,Zs=et/4,kh=et*2/3,Nm=Math.log10,Bn=Math.sign;function Xi(t,e,n){return Math.abs(t-e)<n}function wh(t){const e=Math.round(t);t=Xi(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Nm(t))),s=t/n;return(s<=1?1:s<=2?2:s<=5?5:10)*n}function y$(t){const e=[],n=Math.sqrt(t);let s;for(s=1;s<n;s++)t%s===0&&(e.push(s),e.push(t/s));return n===(n|0)&&e.push(n),e.sort((r,i)=>r-i).pop(),e}function b$(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function fo(t){return!b$(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function x$(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function v$(t,e,n){let s,r,i;for(s=0,r=t.length;s<r;s++)i=t[s][n],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))}function cs(t){return t*(et/180)}function _$(t){return t*(180/et)}function Sh(t){if(!Ot(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Fm(t,e){const n=e.x-t.x,s=e.y-t.y,r=Math.sqrt(n*n+s*s);let i=Math.atan2(s,n);return i<-.5*et&&(i+=dt),{angle:i,distance:r}}function pu(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function k$(t,e){return(t-e+p$)%dt-et}function rn(t){return(t%dt+dt)%dt}function ho(t,e,n,s){const r=rn(t),i=rn(e),o=rn(n),a=rn(i-r),l=rn(o-r),c=rn(r-i),u=rn(r-o);return r===i||r===o||s&&i===o||a>l&&c<u}function Rt(t,e,n){return Math.max(e,Math.min(n,t))}function w$(t){return Rt(t,-32768,32767)}function us(t,e,n,s=1e-6){return t>=Math.min(e,n)-s&&t<=Math.max(e,n)+s}function gd(t,e,n){n=n||(o=>t[o]<e);let s=t.length-1,r=0,i;for(;s-r>1;)i=r+s>>1,n(i)?r=i:s=i;return{lo:r,hi:s}}const or=(t,e,n,s)=>gd(t,n,s?r=>{const i=t[r][e];return i<n||i===n&&t[r+1][e]===n}:r=>t[r][e]<n),S$=(t,e,n)=>gd(t,n,s=>t[s][e]>=n);function $$(t,e,n){let s=0,r=t.length;for(;s<r&&t[s]<e;)s++;for(;r>s&&t[r-1]>n;)r--;return s>0||r<t.length?t.slice(s,r):t}const jm=["push","pop","shift","splice","unshift"];function C$(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),jm.forEach(n=>{const s="_onData"+hd(n),r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...i){const o=r.apply(this,i);return t._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...i)}),o}})})}function $h(t,e){const n=t._chartjs;if(!n)return;const s=n.listeners,r=s.indexOf(e);r!==-1&&s.splice(r,1),!(s.length>0)&&(jm.forEach(i=>{delete t[i]}),delete t._chartjs)}function zm(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Bm=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function Hm(t,e){let n=[],s=!1;return function(...r){n=r,s||(s=!0,Bm.call(window,()=>{s=!1,t.apply(e,n)}))}}function T$(t,e){let n;return function(...s){return e?(clearTimeout(n),n=setTimeout(t,e,s)):t.apply(this,s),e}}const pd=t=>t==="start"?"left":t==="end"?"right":"center",Tt=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,M$=(t,e,n,s)=>t===(s?"left":"right")?n:t==="center"?(e+n)/2:e;function A$(t,e,n){const s=e.length;let r=0,i=s;if(t._sorted){const{iScale:o,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=o.axis,{min:d,max:h,minDefined:g,maxDefined:p}=o.getUserBounds();if(g){if(r=Math.min(or(l,u,d).lo,n?s:or(e,u,o.getPixelForValue(d)).lo),c){const m=l.slice(0,r+1).reverse().findIndex(y=>!Je(y[a.axis]));r-=Math.max(0,m)}r=Rt(r,0,s-1)}if(p){let m=Math.max(or(l,o.axis,h,!0).hi+1,n?0:or(e,u,o.getPixelForValue(h),!0).hi+1);if(c){const y=l.slice(m-1).findIndex(x=>!Je(x[a.axis]));m+=Math.max(0,y)}i=Rt(m,r,s)-r}else i=s-r}return{start:r,count:i}}function E$(t){const{xScale:e,yScale:n,_scaleRanges:s}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!s)return t._scaleRanges=r,!0;const i=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==n.min||s.ymax!==n.max;return Object.assign(s,r),i}const Zo=t=>t===0||t===1,Ch=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*dt/n)),Th=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*dt/n)+1,Ji={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*_t)+1,easeOutSine:t=>Math.sin(t*_t),easeInOutSine:t=>-.5*(Math.cos(et*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Zo(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Zo(t)?t:Ch(t,.075,.3),easeOutElastic:t=>Zo(t)?t:Th(t,.075,.3),easeInOutElastic(t){return Zo(t)?t:t<.5?.5*Ch(t*2,.1125,.45):.5+.5*Th(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Ji.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Ji.easeInBounce(t*2)*.5:Ji.easeOutBounce(t*2-1)*.5+.5};function md(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Mh(t){return md(t)?t:new Om(t)}function mc(t){return md(t)?t:new Om(t).saturate(.5).darken(.1).hexString()}const P$=["x","y","borderWidth","radius","tension"],R$=["color","borderColor","backgroundColor"];function D$(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:R$},numbers:{type:"number",properties:P$}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function O$(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ah=new Map;function I$(t,e){e=e||{};const n=t+JSON.stringify(e);let s=Ah.get(n);return s||(s=new Intl.NumberFormat(t,e),Ah.set(n,s)),s}function yd(t,e,n){return I$(e,n).format(t)}const L$={values(t){return bt(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const s=this.chart.options.locale;let r,i=t;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(r="scientific"),i=N$(t,n)}const o=Nm(Math.abs(i)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),yd(t,s,l)}};function N$(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Um={formatters:L$};function F$(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Um.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const _r=Object.create(null),mu=Object.create(null);function Zi(t,e){if(!e)return t;const n=e.split(".");for(let s=0,r=n.length;s<r;++s){const i=n[s];t=t[i]||(t[i]=Object.create(null))}return t}function yc(t,e,n){return typeof e=="string"?co(Zi(t,e),n):co(Zi(t,""),e)}class j${constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,r)=>mc(r.backgroundColor),this.hoverBorderColor=(s,r)=>mc(r.borderColor),this.hoverColor=(s,r)=>mc(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return yc(this,e,n)}get(e){return Zi(this,e)}describe(e,n){return yc(mu,e,n)}override(e,n){return yc(_r,e,n)}route(e,n,s,r){const i=Zi(this,e),o=Zi(this,s),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[r];return Ve(l)?Object.assign({},c,l):Fe(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var mt=new j$({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[D$,O$,F$]);function z$(t){return!t||Je(t.size)||Je(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Eh(t,e,n,s,r){let i=e[r];return i||(i=e[r]=t.measureText(r).width,n.push(r)),i>s&&(s=i),s}function Qs(t,e,n){const s=t.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((e-r)*s)/s+r}function Ph(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function yu(t,e,n,s){Vm(t,e,n,s,null)}function Vm(t,e,n,s,r){let i,o,a,l,c,u,d,h;const g=e.pointStyle,p=e.rotation,m=e.radius;let y=(p||0)*m$;if(g&&typeof g=="object"&&(i=g.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){t.save(),t.translate(n,s),t.rotate(y),t.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),t.restore();return}if(!(isNaN(m)||m<=0)){switch(t.beginPath(),g){default:r?t.ellipse(n,s,r/2,m,0,0,dt):t.arc(n,s,m,0,dt),t.closePath();break;case"triangle":u=r?r/2:m,t.moveTo(n+Math.sin(y)*u,s-Math.cos(y)*m),y+=kh,t.lineTo(n+Math.sin(y)*u,s-Math.cos(y)*m),y+=kh,t.lineTo(n+Math.sin(y)*u,s-Math.cos(y)*m),t.closePath();break;case"rectRounded":c=m*.516,l=m-c,o=Math.cos(y+Zs)*l,d=Math.cos(y+Zs)*(r?r/2-c:l),a=Math.sin(y+Zs)*l,h=Math.sin(y+Zs)*(r?r/2-c:l),t.arc(n-d,s-a,c,y-et,y-_t),t.arc(n+h,s-o,c,y-_t,y),t.arc(n+d,s+a,c,y,y+_t),t.arc(n-h,s+o,c,y+_t,y+et),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,u=r?r/2:l,t.rect(n-u,s-l,2*u,2*l);break}y+=Zs;case"rectRot":d=Math.cos(y)*(r?r/2:m),o=Math.cos(y)*m,a=Math.sin(y)*m,h=Math.sin(y)*(r?r/2:m),t.moveTo(n-d,s-a),t.lineTo(n+h,s-o),t.lineTo(n+d,s+a),t.lineTo(n-h,s+o),t.closePath();break;case"crossRot":y+=Zs;case"cross":d=Math.cos(y)*(r?r/2:m),o=Math.cos(y)*m,a=Math.sin(y)*m,h=Math.sin(y)*(r?r/2:m),t.moveTo(n-d,s-a),t.lineTo(n+d,s+a),t.moveTo(n+h,s-o),t.lineTo(n-h,s+o);break;case"star":d=Math.cos(y)*(r?r/2:m),o=Math.cos(y)*m,a=Math.sin(y)*m,h=Math.sin(y)*(r?r/2:m),t.moveTo(n-d,s-a),t.lineTo(n+d,s+a),t.moveTo(n+h,s-o),t.lineTo(n-h,s+o),y+=Zs,d=Math.cos(y)*(r?r/2:m),o=Math.cos(y)*m,a=Math.sin(y)*m,h=Math.sin(y)*(r?r/2:m),t.moveTo(n-d,s-a),t.lineTo(n+d,s+a),t.moveTo(n+h,s-o),t.lineTo(n-h,s+o);break;case"line":o=r?r/2:Math.cos(y)*m,a=Math.sin(y)*m,t.moveTo(n-o,s-a),t.lineTo(n+o,s+a);break;case"dash":t.moveTo(n,s),t.lineTo(n+Math.cos(y)*(r?r/2:m),s+Math.sin(y)*m);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function go(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Nl(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Fl(t){t.restore()}function B$(t,e,n,s,r){if(!e)return t.lineTo(n.x,n.y);if(r==="middle"){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else r==="after"!=!!s?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function H$(t,e,n,s){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?n.cp2x:n.cp1x,s?n.cp2y:n.cp1y,n.x,n.y)}function U$(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Je(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function V$(t,e,n,s,r){if(r.strikethrough||r.underline){const i=t.measureText(s),o=e-i.actualBoundingBoxLeft,a=e+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,u),t.lineTo(a,u),t.stroke()}}function W$(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function po(t,e,n,s,r,i={}){const o=bt(e)?e:[e],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(t.save(),t.font=r.string,U$(t,i),l=0;l<o.length;++l)c=o[l],i.backdrop&&W$(t,i.backdrop),a&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),Je(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(c,n,s,i.maxWidth)),t.fillText(c,n,s,i.maxWidth),V$(t,n,s,c,i),s+=Number(r.lineHeight);t.restore()}function Qa(t,e){const{x:n,y:s,w:r,h:i,radius:o}=e;t.arc(n+o.topLeft,s+o.topLeft,o.topLeft,1.5*et,et,!0),t.lineTo(n,s+i-o.bottomLeft),t.arc(n+o.bottomLeft,s+i-o.bottomLeft,o.bottomLeft,et,_t,!0),t.lineTo(n+r-o.bottomRight,s+i),t.arc(n+r-o.bottomRight,s+i-o.bottomRight,o.bottomRight,_t,0,!0),t.lineTo(n+r,s+o.topRight),t.arc(n+r-o.topRight,s+o.topRight,o.topRight,0,-_t,!0),t.lineTo(n+o.topLeft,s)}const q$=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,K$=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function G$(t,e){const n=(""+t).match(q$);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const Y$=t=>+t||0;function bd(t,e){const n={},s=Ve(e),r=s?Object.keys(e):e,i=Ve(t)?s?o=>Fe(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of r)n[o]=Y$(i(o));return n}function Wm(t){return bd(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Br(t){return bd(t,["topLeft","topRight","bottomLeft","bottomRight"])}function mn(t){const e=Wm(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Dt(t,e){t=t||{},e=e||mt.font;let n=Fe(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let s=Fe(t.style,e.style);s&&!(""+s).match(K$)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const r={family:Fe(t.family,e.family),lineHeight:G$(Fe(t.lineHeight,e.lineHeight),n),size:n,style:s,weight:Fe(t.weight,e.weight),string:""};return r.string=z$(r),r}function Qo(t,e,n,s){let r,i,o;for(r=0,i=t.length;r<i;++r)if(o=t[r],o!==void 0&&o!==void 0)return o}function X$(t,e,n){const{min:s,max:r}=t,i=Im(e,(r-s)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(s,-Math.abs(i)),max:o(r,i)}}function Sr(t,e){return Object.assign(Object.create(t),e)}function xd(t,e=[""],n,s,r=()=>t[0]){const i=n||t;typeof s>"u"&&(s=Ym("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:r,override:a=>xd([a,...t],e,i,s)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return Km(a,l,()=>rC(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return Dh(a).includes(l)},ownKeys(a){return Dh(a)},set(a,l,c){const u=a._storage||(a._storage=r());return a[l]=u[l]=c,delete a._keys,!0}})}function Qr(t,e,n,s){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:qm(t,s),setContext:i=>Qr(t,i,n,s),override:i=>Qr(t.override(i),e,n,s)};return new Proxy(r,{deleteProperty(i,o){return delete i[o],delete t[o],!0},get(i,o,a){return Km(i,o,()=>Z$(i,o,a))},getOwnPropertyDescriptor(i,o){return i._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(i,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(i,o,a){return t[o]=a,delete i[o],!0}})}function qm(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:s=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:s,isScriptable:Us(n)?n:()=>n,isIndexable:Us(s)?s:()=>s}}const J$=(t,e)=>t?t+hd(e):e,vd=(t,e)=>Ve(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Km(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const s=n();return t[e]=s,s}function Z$(t,e,n){const{_proxy:s,_context:r,_subProxy:i,_descriptors:o}=t;let a=s[e];return Us(a)&&o.isScriptable(e)&&(a=Q$(e,a,t,n)),bt(a)&&a.length&&(a=eC(e,a,t,o.isIndexable)),vd(e,a)&&(a=Qr(a,r,i&&i[e],o)),a}function Q$(t,e,n,s){const{_proxy:r,_context:i,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(i,o||s);return a.delete(t),vd(t,l)&&(l=_d(r._scopes,r,t,l)),l}function eC(t,e,n,s){const{_proxy:r,_context:i,_subProxy:o,_descriptors:a}=n;if(typeof i.index<"u"&&s(t))return e[i.index%e.length];if(Ve(e[0])){const l=e,c=r._scopes.filter(u=>u!==l);e=[];for(const u of l){const d=_d(c,r,t,u);e.push(Qr(d,i,o&&o[t],a))}}return e}function Gm(t,e,n){return Us(t)?t(e,n):t}const tC=(t,e)=>t===!0?e:typeof t=="string"?vr(e,t):void 0;function nC(t,e,n,s,r){for(const i of e){const o=tC(n,i);if(o){t.add(o);const a=Gm(o._fallback,n,r);if(typeof a<"u"&&a!==n&&a!==s)return a}else if(o===!1&&typeof s<"u"&&n!==s)return null}return!1}function _d(t,e,n,s){const r=e._rootScopes,i=Gm(e._fallback,n,s),o=[...t,...r],a=new Set;a.add(s);let l=Rh(a,o,n,i||n,s);return l===null||typeof i<"u"&&i!==n&&(l=Rh(a,o,i,l,s),l===null)?!1:xd(Array.from(a),[""],r,i,()=>sC(e,n,s))}function Rh(t,e,n,s,r){for(;n;)n=nC(t,e,n,s,r);return n}function sC(t,e,n){const s=t._getTarget();e in s||(s[e]={});const r=s[e];return bt(r)&&Ve(n)?n:r||{}}function rC(t,e,n,s){let r;for(const i of e)if(r=Ym(J$(i,t),n),typeof r<"u")return vd(t,r)?_d(n,s,t,r):r}function Ym(t,e){for(const n of e){if(!n)continue;const s=n[t];if(typeof s<"u")return s}}function Dh(t){let e=t._keys;return e||(e=t._keys=iC(t._scopes)),e}function iC(t){const e=new Set;for(const n of t)for(const s of Object.keys(n).filter(r=>!r.startsWith("_")))e.add(s);return Array.from(e)}const oC=Number.EPSILON||1e-14,ei=(t,e)=>e<t.length&&!t[e].skip&&t[e],Xm=t=>t==="x"?"y":"x";function aC(t,e,n,s){const r=t.skip?e:t,i=e,o=n.skip?e:n,a=pu(i,r),l=pu(o,i);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=s*c,h=s*u;return{previous:{x:i.x-d*(o.x-r.x),y:i.y-d*(o.y-r.y)},next:{x:i.x+h*(o.x-r.x),y:i.y+h*(o.y-r.y)}}}function lC(t,e,n){const s=t.length;let r,i,o,a,l,c=ei(t,0);for(let u=0;u<s-1;++u)if(l=c,c=ei(t,u+1),!(!l||!c)){if(Xi(e[u],0,oC)){n[u]=n[u+1]=0;continue}r=n[u]/e[u],i=n[u+1]/e[u],a=Math.pow(r,2)+Math.pow(i,2),!(a<=9)&&(o=3/Math.sqrt(a),n[u]=r*o*e[u],n[u+1]=i*o*e[u])}}function cC(t,e,n="x"){const s=Xm(n),r=t.length;let i,o,a,l=ei(t,0);for(let c=0;c<r;++c){if(o=a,a=l,l=ei(t,c+1),!a)continue;const u=a[n],d=a[s];o&&(i=(u-o[n])/3,a[`cp1${n}`]=u-i,a[`cp1${s}`]=d-i*e[c]),l&&(i=(l[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${s}`]=d+i*e[c])}}function uC(t,e="x"){const n=Xm(e),s=t.length,r=Array(s).fill(0),i=Array(s);let o,a,l,c=ei(t,0);for(o=0;o<s;++o)if(a=l,l=c,c=ei(t,o+1),!!l){if(c){const u=c[e]-l[e];r[o]=u!==0?(c[n]-l[n])/u:0}i[o]=a?c?Bn(r[o-1])!==Bn(r[o])?0:(r[o-1]+r[o])/2:r[o-1]:r[o]}lC(t,r,i),cC(t,i,e)}function ea(t,e,n){return Math.max(Math.min(t,n),e)}function dC(t,e){let n,s,r,i,o,a=go(t[0],e);for(n=0,s=t.length;n<s;++n)o=i,i=a,a=n<s-1&&go(t[n+1],e),i&&(r=t[n],o&&(r.cp1x=ea(r.cp1x,e.left,e.right),r.cp1y=ea(r.cp1y,e.top,e.bottom)),a&&(r.cp2x=ea(r.cp2x,e.left,e.right),r.cp2y=ea(r.cp2y,e.top,e.bottom)))}function fC(t,e,n,s,r){let i,o,a,l;if(e.spanGaps&&(t=t.filter(c=>!c.skip)),e.cubicInterpolationMode==="monotone")uC(t,r);else{let c=s?t[t.length-1]:t[0];for(i=0,o=t.length;i<o;++i)a=t[i],l=aC(c,a,t[Math.min(i+1,o-(s?0:1))%o],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}e.capBezierPoints&&dC(t,n)}function kd(){return typeof window<"u"&&typeof document<"u"}function wd(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function el(t,e,n){let s;return typeof t=="string"?(s=parseInt(t,10),t.indexOf("%")!==-1&&(s=s/100*e.parentNode[n])):s=t,s}const jl=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function hC(t,e){return jl(t).getPropertyValue(e)}const gC=["top","right","bottom","left"];function dr(t,e,n){const s={};n=n?"-"+n:"";for(let r=0;r<4;r++){const i=gC[r];s[i]=parseFloat(t[e+"-"+i+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const pC=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function mC(t,e){const n=t.touches,s=n&&n.length?n[0]:t,{offsetX:r,offsetY:i}=s;let o=!1,a,l;if(pC(r,i,t.target))a=r,l=i;else{const c=e.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function nr(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:s}=e,r=jl(n),i=r.boxSizing==="border-box",o=dr(r,"padding"),a=dr(r,"border","width"),{x:l,y:c,box:u}=mC(t,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:g,height:p}=e;return i&&(g-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/g*n.width/s),y:Math.round((c-h)/p*n.height/s)}}function yC(t,e,n){let s,r;if(e===void 0||n===void 0){const i=t&&wd(t);if(!i)e=t.clientWidth,n=t.clientHeight;else{const o=i.getBoundingClientRect(),a=jl(i),l=dr(a,"border","width"),c=dr(a,"padding");e=o.width-c.width-l.width,n=o.height-c.height-l.height,s=el(a.maxWidth,i,"clientWidth"),r=el(a.maxHeight,i,"clientHeight")}}return{width:e,height:n,maxWidth:s||Za,maxHeight:r||Za}}const Ds=t=>Math.round(t*10)/10;function bC(t,e,n,s){const r=jl(t),i=dr(r,"margin"),o=el(r.maxWidth,t,"clientWidth")||Za,a=el(r.maxHeight,t,"clientHeight")||Za,l=yC(t,e,n);let{width:c,height:u}=l;if(r.boxSizing==="content-box"){const h=dr(r,"border","width"),g=dr(r,"padding");c-=g.width+h.width,u-=g.height+h.height}return c=Math.max(0,c-i.width),u=Math.max(0,s?c/s:u-i.height),c=Ds(Math.min(c,o,l.maxWidth)),u=Ds(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Ds(c/2)),(e!==void 0||n!==void 0)&&s&&l.height&&u>l.height&&(u=l.height,c=Ds(Math.floor(u*s))),{width:c,height:u}}function Oh(t,e,n){const s=e||1,r=Ds(t.height*s),i=Ds(t.width*s);t.height=Ds(t.height),t.width=Ds(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==s||o.height!==r||o.width!==i?(t.currentDevicePixelRatio=s,o.height=r,o.width=i,t.ctx.setTransform(s,0,0,s,0,0),!0):!1}const xC=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};kd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Ih(t,e){const n=hC(t,e),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function sr(t,e,n,s){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function vC(t,e,n,s){return{x:t.x+n*(e.x-t.x),y:s==="middle"?n<.5?t.y:e.y:s==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function _C(t,e,n,s){const r={x:t.cp2x,y:t.cp2y},i={x:e.cp1x,y:e.cp1y},o=sr(t,r,n),a=sr(r,i,n),l=sr(i,e,n),c=sr(o,a,n),u=sr(a,l,n);return sr(c,u,n)}const kC=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,s){return n-s},leftForLtr(n,s){return n-s}}},wC=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Hr(t,e,n){return t?kC(e,n):wC()}function Jm(t,e){let n,s;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,s=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Zm(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Qm(t){return t==="angle"?{between:ho,compare:k$,normalize:rn}:{between:us,compare:(e,n)=>e-n,normalize:e=>e}}function Lh({start:t,end:e,count:n,loop:s,style:r}){return{start:t%n,end:e%n,loop:s&&(e-t+1)%n===0,style:r}}function SC(t,e,n){const{property:s,start:r,end:i}=n,{between:o,normalize:a}=Qm(s),l=e.length;let{start:c,end:u,loop:d}=t,h,g;if(d){for(c+=l,u+=l,h=0,g=l;h<g&&o(a(e[c%l][s]),r,i);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:t.style}}function ey(t,e,n){if(!n)return[t];const{property:s,start:r,end:i}=n,o=e.length,{compare:a,between:l,normalize:c}=Qm(s),{start:u,end:d,loop:h,style:g}=SC(t,e,n),p=[];let m=!1,y=null,x,S,T;const v=()=>l(r,T,x)&&a(r,T)!==0,_=()=>a(i,x)===0||l(i,T,x),P=()=>m||v(),L=()=>!m||_();for(let C=u,w=u;C<=d;++C)S=e[C%o],!S.skip&&(x=c(S[s]),x!==T&&(m=l(x,r,i),y===null&&P()&&(y=a(x,r)===0?C:w),y!==null&&L()&&(p.push(Lh({start:y,end:C,loop:h,count:o,style:g})),y=null),w=C,T=x));return y!==null&&p.push(Lh({start:y,end:d,loop:h,count:o,style:g})),p}function ty(t,e){const n=[],s=t.segments;for(let r=0;r<s.length;r++){const i=ey(s[r],t.points,e);i.length&&n.push(...i)}return n}function $C(t,e,n,s){let r=0,i=e-1;if(n&&!s)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(i+=r);i>r&&t[i%e].skip;)i--;return i%=e,{start:r,end:i}}function CC(t,e,n,s){const r=t.length,i=[];let o=e,a=t[e],l;for(l=e+1;l<=n;++l){const c=t[l%r];c.skip||c.stop?a.skip||(s=!1,i.push({start:e%r,end:(l-1)%r,loop:s}),e=o=c.stop?l:null):(o=l,a.skip&&(e=l)),a=c}return o!==null&&i.push({start:e%r,end:o%r,loop:s}),i}function TC(t,e){const n=t.points,s=t.options.spanGaps,r=n.length;if(!r)return[];const i=!!t._loop,{start:o,end:a}=$C(n,r,i,s);if(s===!0)return Nh(t,[{start:o,end:a,loop:i}],n,e);const l=a<o?a+r:a,c=!!t._fullLoop&&o===0&&a===r-1;return Nh(t,CC(n,o,l,c),n,e)}function Nh(t,e,n,s){return!s||!s.setContext||!n?e:MC(t,e,n,s)}function MC(t,e,n,s){const r=t._chart.getContext(),i=Fh(t.options),{_datasetIndex:o,options:{spanGaps:a}}=t,l=n.length,c=[];let u=i,d=e[0].start,h=d;function g(p,m,y,x){const S=a?-1:1;if(p!==m){for(p+=l;n[p%l].skip;)p-=S;for(;n[m%l].skip;)m+=S;p%l!==m%l&&(c.push({start:p%l,end:m%l,loop:y,style:x}),u=x,d=m%l)}}for(const p of e){d=a?d:p.start;let m=n[d%l],y;for(h=d+1;h<=p.end;h++){const x=n[h%l];y=Fh(s.setContext(Sr(r,{type:"segment",p0:m,p1:x,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),AC(y,u)&&g(d,h-1,p.loop,u),m=x,u=y}d<h-1&&g(d,h-1,p.loop,u)}return c}function Fh(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function AC(t,e){if(!e)return!1;const n=[],s=function(r,i){return md(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(t,s)!==JSON.stringify(e,s)}function ta(t,e,n){return t.options.clip?t[n]:e[n]}function EC(t,e){const{xScale:n,yScale:s}=t;return n&&s?{left:ta(n,e,"left"),right:ta(n,e,"right"),top:ta(s,e,"top"),bottom:ta(s,e,"bottom")}:e}function ny(t,e){const n=e._clip;if(n.disabled)return!1;const s=EC(e,t.chartArea);return{left:n.left===!1?0:s.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:s.right+(n.right===!0?0:n.right),top:n.top===!1?0:s.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:s.bottom+(n.bottom===!0?0:n.bottom)}}/*!
|
|
449
|
+
* Chart.js v4.5.1
|
|
450
|
+
* https://www.chartjs.org
|
|
451
|
+
* (c) 2025 Chart.js Contributors
|
|
452
|
+
* Released under the MIT License
|
|
453
|
+
*/class PC{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,s,r){const i=n.listeners[r],o=n.duration;i.forEach(a=>a({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(s-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Bm.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((s,r)=>{if(!s.running||!s.items.length)return;const i=s.items;let o=i.length-1,a=!1,l;for(;o>=0;--o)l=i[o],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(e),a=!0):(i[o]=i[i.length-1],i.pop());a&&(r.draw(),this._notify(r,s,e,"progress")),i.length||(s.running=!1,this._notify(r,s,e,"complete"),s.initial=!1),n+=i.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let s=n.get(e);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,s)),s}listen(e,n,s){this._getAnims(e).listeners[n].push(s)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((s,r)=>Math.max(s,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const s=n.items;let r=s.length-1;for(;r>=0;--r)s[r].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Zn=new PC;const jh="transparent",RC={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const s=Mh(t||jh),r=s.valid&&Mh(e||jh);return r&&r.valid?r.mix(s,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class DC{constructor(e,n,s,r){const i=n[s];r=Qo([e.to,r,i,e.from]);const o=Qo([e.from,i,r]);this._active=!0,this._fn=e.fn||RC[e.type||typeof o],this._easing=Ji[e.easing]||Ji.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=s,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(e,n,s){if(this._active){this._notify(!1);const r=this._target[this._prop],i=s-this._start,o=this._duration-i;this._start=s,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=Qo([e.to,n,r,e.from]),this._from=Qo([e.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,s=this._duration,r=this._prop,i=this._from,o=this._loop,a=this._to;let l;if(this._active=i!==a&&(o||n<s),!this._active){this._target[r]=a,this._notify(!0);return}if(n<0){this._target[r]=i;return}l=n/s%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(i,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,s)=>{e.push({res:n,rej:s})})}_notify(e){const n=e?"res":"rej",s=this._promises||[];for(let r=0;r<s.length;r++)s[r][n]()}}class sy{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!Ve(e))return;const n=Object.keys(mt.animation),s=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const i=e[r];if(!Ve(i))return;const o={};for(const a of n)o[a]=i[a];(bt(i.properties)&&i.properties||[r]).forEach(a=>{(a===r||!s.has(a))&&s.set(a,o)})})}_animateOptions(e,n){const s=n.options,r=IC(e,s);if(!r)return[];const i=this._createAnimations(r,s);return s.$shared&&OC(e.options.$animations,s).then(()=>{e.options=s},()=>{}),i}_createAnimations(e,n){const s=this._properties,r=[],i=e.$animations||(e.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){r.push(...this._animateOptions(e,n));continue}const u=n[c];let d=i[c];const h=s.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){e[c]=u;continue}i[c]=d=new DC(h,e,c,u),r.push(d)}return r}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const s=this._createAnimations(e,n);if(s.length)return Zn.add(this._chart,s),!0}}function OC(t,e){const n=[],s=Object.keys(e);for(let r=0;r<s.length;r++){const i=t[s[r]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function IC(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function zh(t,e){const n=t&&t.options||{},s=n.reverse,r=n.min===void 0?e:0,i=n.max===void 0?e:0;return{start:s?i:r,end:s?r:i}}function LC(t,e,n){if(n===!1)return!1;const s=zh(t,n),r=zh(e,n);return{top:r.end,right:s.end,bottom:r.start,left:s.start}}function NC(t){let e,n,s,r;return Ve(t)?(e=t.top,n=t.right,s=t.bottom,r=t.left):e=n=s=r=t,{top:e,right:n,bottom:s,left:r,disabled:t===!1}}function ry(t,e){const n=[],s=t._getSortedDatasetMetas(e);let r,i;for(r=0,i=s.length;r<i;++r)n.push(s[r].index);return n}function Bh(t,e,n,s={}){const r=t.keys,i=s.mode==="single";let o,a,l,c;if(e===null)return;let u=!1;for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===n){if(u=!0,s.all)continue;break}c=t.values[l],Ot(c)&&(i||e===0||Bn(e)===Bn(c))&&(e+=c)}return!u&&!s.all?0:e}function FC(t,e){const{iScale:n,vScale:s}=e,r=n.axis==="x"?"x":"y",i=s.axis==="x"?"x":"y",o=Object.keys(t),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[r]:u,[i]:t[u]};return a}function bc(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function jC(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function zC(t){const{min:e,max:n,minDefined:s,maxDefined:r}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function BC(t,e,n){const s=t[e]||(t[e]={});return s[n]||(s[n]={})}function Hh(t,e,n,s){for(const r of e.getMatchingVisibleMetas(s).reverse()){const i=t[r.index];if(n&&i>0||!n&&i<0)return r.index}return null}function Uh(t,e){const{chart:n,_cachedMeta:s}=t,r=n._stacks||(n._stacks={}),{iScale:i,vScale:o,index:a}=s,l=i.axis,c=o.axis,u=jC(i,o,s),d=e.length;let h;for(let g=0;g<d;++g){const p=e[g],{[l]:m,[c]:y}=p,x=p._stacks||(p._stacks={});h=x[c]=BC(r,u,m),h[a]=y,h._top=Hh(h,o,!0,s.type),h._bottom=Hh(h,o,!1,s.type);const S=h._visualValues||(h._visualValues={});S[a]=y}}function xc(t,e){const n=t.scales;return Object.keys(n).filter(s=>n[s].axis===e).shift()}function HC(t,e){return Sr(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function UC(t,e,n){return Sr(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function pi(t,e){const n=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const r of e){const i=r._stacks;if(!i||i[s]===void 0||i[s][n]===void 0)return;delete i[s][n],i[s]._visualValues!==void 0&&i[s]._visualValues[n]!==void 0&&delete i[s]._visualValues[n]}}}const vc=t=>t==="reset"||t==="none",Vh=(t,e)=>e?t:Object.assign({},t),VC=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:ry(n,!0),values:null};class fr{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=bc(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&pi(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,s=this.getDataset(),r=(d,h,g,p)=>d==="x"?h:d==="r"?p:g,i=n.xAxisID=Fe(s.xAxisID,xc(e,"x")),o=n.yAxisID=Fe(s.yAxisID,xc(e,"y")),a=n.rAxisID=Fe(s.rAxisID,xc(e,"r")),l=n.indexAxis,c=n.iAxisID=r(l,i,o,a),u=n.vAxisID=r(l,o,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&$h(this._data,this),e._stacked&&pi(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),s=this._data;if(Ve(n)){const r=this._cachedMeta;this._data=FC(n,r)}else if(s!==n){if(s){$h(s,this);const r=this._cachedMeta;pi(r),r._parsed=[]}n&&Object.isExtensible(n)&&C$(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,s=this.getDataset();let r=!1;this._dataCheck();const i=n._stacked;n._stacked=bc(n.vScale,n),n.stack!==s.stack&&(r=!0,pi(n),n.stack=s.stack),this._resyncElements(e),(r||i!==n._stacked)&&(Uh(this,n._parsed),n._stacked=bc(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),s=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:s,_data:r}=this,{iScale:i,_stacked:o}=s,a=i.axis;let l=e===0&&n===r.length?!0:s._sorted,c=e>0&&s._parsed[e-1],u,d,h;if(this._parsing===!1)s._parsed=r,s._sorted=!0,h=r;else{bt(r[e])?h=this.parseArrayData(s,r,e,n):Ve(r[e])?h=this.parseObjectData(s,r,e,n):h=this.parsePrimitiveData(s,r,e,n);const g=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)s._parsed[u+e]=d=h[u],l&&(g()&&(l=!1),c=d);s._sorted=l}o&&Uh(this,h)}parsePrimitiveData(e,n,s,r){const{iScale:i,vScale:o}=e,a=i.axis,l=o.axis,c=i.getLabels(),u=i===o,d=new Array(r);let h,g,p;for(h=0,g=r;h<g;++h)p=h+s,d[h]={[a]:u||i.parse(c[p],p),[l]:o.parse(n[p],p)};return d}parseArrayData(e,n,s,r){const{xScale:i,yScale:o}=e,a=new Array(r);let l,c,u,d;for(l=0,c=r;l<c;++l)u=l+s,d=n[u],a[l]={x:i.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(e,n,s,r){const{xScale:i,yScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(r);let u,d,h,g;for(u=0,d=r;u<d;++u)h=u+s,g=n[h],c[u]={x:i.parse(vr(g,a),h),y:o.parse(vr(g,l),h)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,s){const r=this.chart,i=this._cachedMeta,o=n[e.axis],a={keys:ry(r,!0),values:n._stacks[e.axis]._visualValues};return Bh(a,o,i.index,{mode:s})}updateRangeFromParsed(e,n,s,r){const i=s[n.axis];let o=i===null?NaN:i;const a=r&&s._stacks[n.axis];r&&a&&(r.values=a,o=Bh(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,n){const s=this._cachedMeta,r=s._parsed,i=s._sorted&&e===s.iScale,o=r.length,a=this._getOtherScale(e),l=VC(n,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=zC(a);let h,g;function p(){g=r[h];const m=g[a.axis];return!Ot(g[e.axis])||u>m||d<m}for(h=0;h<o&&!(!p()&&(this.updateRangeFromParsed(c,e,g,l),i));++h);if(i){for(h=o-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,e,g,l);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,s=[];let r,i,o;for(r=0,i=n.length;r<i;++r)o=n[r][e.axis],Ot(o)&&s.push(o);return s}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,s=n.iScale,r=n.vScale,i=this.getParsed(e);return{label:s?""+s.getLabelForValue(i[s.axis]):"",value:r?""+r.getLabelForValue(i[r.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=NC(Fe(this.options.clip,LC(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,s=this._cachedMeta,r=s.data||[],i=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||r.length-a,c=this.options.drawActiveElementsOnTop;let u;for(s.dataset&&s.dataset.draw(e,i,a,l),u=a;u<a+l;++u){const d=r[u];d.hidden||(d.active&&c?o.push(d):d.draw(e,i))}for(u=0;u<o.length;++u)o[u].draw(e,i)}getStyle(e,n){const s=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(e||0,s)}getContext(e,n,s){const r=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];i=o.$context||(o.$context=UC(this.getContext(),e,o)),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=HC(this.chart.getContext(),this.index)),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=s,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",s){const r=n==="active",i=this._cachedDataOpts,o=e+"-"+n,a=i[o],l=this.enableOptionSharing&&uo(s);if(a)return Vh(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,e),d=r?[`${e}Hover`,"hover",e,""]:[e,""],h=c.getOptionScopes(this.getDataset(),u),g=Object.keys(mt.elements[e]),p=()=>this.getContext(s,r,n),m=c.resolveNamedOptions(h,g,p,d);return m.$shared&&(m.$shared=l,i[o]=Object.freeze(Vh(m,l))),m}_resolveAnimations(e,n,s){const r=this.chart,i=this._cachedDataOpts,o=`animation-${n}`,a=i[o];if(a)return a;let l;if(r.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(e,s,n))}const c=new sy(r,l&&l.animations);return l&&l._cacheable&&(i[o]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||vc(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const s=this.resolveDataElementOptions(e,n),r=this._sharedOptions,i=this.getSharedOptions(s),o=this.includeOptions(n,i)||i!==r;return this.updateSharedOptions(i,n,s),{sharedOptions:i,includeOptions:o}}updateElement(e,n,s,r){vc(r)?Object.assign(e,s):this._resolveAnimations(n,r).update(e,s)}updateSharedOptions(e,n,s){e&&!vc(n)&&this._resolveAnimations(void 0,n).update(e,s)}_setStyle(e,n,s,r){e.active=r;const i=this.getStyle(n,r);this._resolveAnimations(n,s,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,n,s){this._setStyle(e,s,"active",!1)}setHoverStyle(e,n,s){this._setStyle(e,s,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const r=s.length,i=n.length,o=Math.min(i,r);o&&this.parse(0,o),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,n,s=!0){const r=this._cachedMeta,i=r.data,o=e+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(i),a=e;a<o;++a)i[a]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(e,n),s&&this.updateElements(i,e,n,"reset")}updateElements(e,n,s,r){}_removeElements(e,n){const s=this._cachedMeta;if(this._parsing){const r=s._parsed.splice(e,n);s._stacked&&pi(s,r)}s.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,s,r]=e;this[n](s,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const s=arguments.length-2;s&&this._sync(["_insertElements",e,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}he(fr,"defaults",{}),he(fr,"datasetElementType",null),he(fr,"dataElementType",null);function WC(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let s=[];for(let r=0,i=n.length;r<i;r++)s=s.concat(n[r].controller.getAllParsedValues(t));t._cache.$bar=zm(s.sort((r,i)=>r-i))}return t._cache.$bar}function qC(t){const e=t.iScale,n=WC(e,t.type);let s=e._length,r,i,o,a;const l=()=>{o===32767||o===-32768||(uo(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(r=0,i=n.length;r<i;++r)o=e.getPixelForValue(n[r]),l();for(a=void 0,r=0,i=e.ticks.length;r<i;++r)o=e.getPixelForTick(r),l();return s}function KC(t,e,n,s){const r=n.barThickness;let i,o;return Je(r)?(i=e.min*n.categoryPercentage,o=n.barPercentage):(i=r*s,o=1),{chunk:i/s,ratio:o,start:e.pixels[t]-i/2}}function GC(t,e,n,s){const r=e.pixels,i=r[t];let o=t>0?r[t-1]:null,a=t<r.length-1?r[t+1]:null;const l=n.categoryPercentage;o===null&&(o=i-(a===null?e.end-e.start:a-i)),a===null&&(a=i+i-o);const c=i-(i-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/s,ratio:n.barPercentage,start:c}}function YC(t,e,n,s){const r=n.parse(t[0],s),i=n.parse(t[1],s),o=Math.min(r,i),a=Math.max(r,i);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:i,min:o,max:a}}function iy(t,e,n,s){return bt(t)?YC(t,e,n,s):e[n.axis]=n.parse(t,s),e}function Wh(t,e,n,s){const r=t.iScale,i=t.vScale,o=r.getLabels(),a=r===i,l=[];let c,u,d,h;for(c=n,u=n+s;c<u;++c)h=e[c],d={},d[r.axis]=a||r.parse(o[c],c),l.push(iy(h,d,i,c));return l}function _c(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function XC(t,e,n){return t!==0?Bn(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function JC(t){let e,n,s,r,i;return t.horizontal?(e=t.base>t.x,n="left",s="right"):(e=t.base<t.y,n="bottom",s="top"),e?(r="end",i="start"):(r="start",i="end"),{start:n,end:s,reverse:e,top:r,bottom:i}}function ZC(t,e,n,s){let r=e.borderSkipped;const i={};if(!r){t.borderSkipped=i;return}if(r===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=JC(t);r==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===s?r=c:(n._bottom||0)===s?r=u:(i[qh(u,o,a,l)]=!0,r=c)),i[qh(r,o,a,l)]=!0,t.borderSkipped=i}function qh(t,e,n,s){return s?(t=QC(t,e,n),t=Kh(t,n,e)):t=Kh(t,e,n),t}function QC(t,e,n){return t===e?n:t===n?e:t}function Kh(t,e,n){return t==="start"?e:t==="end"?n:t}function e3(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Ta extends fr{parsePrimitiveData(e,n,s,r){return Wh(e,n,s,r)}parseArrayData(e,n,s,r){return Wh(e,n,s,r)}parseObjectData(e,n,s,r){const{iScale:i,vScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let h,g,p,m;for(h=s,g=s+r;h<g;++h)m=n[h],p={},p[i.axis]=i.parse(vr(m,c),h),d.push(iy(vr(m,u),p,o,h));return d}updateRangeFromParsed(e,n,s,r){super.updateRangeFromParsed(e,n,s,r);const i=s._custom;i&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:s,vScale:r}=n,i=this.getParsed(e),o=i._custom,a=_c(o)?"["+o.start+", "+o.end+"]":""+r.getLabelForValue(i[r.axis]);return{label:""+s.getLabelForValue(i[s.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,s,r){const i=r==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,r);for(let g=n;g<n+s;g++){const p=this.getParsed(g),m=i||Je(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),y=this._calculateBarIndexPixels(g,u),x=(p._stacks||{})[a.axis],S={horizontal:c,base:m.base,enableBorderRadius:!x||_c(p._custom)||o===x._top||o===x._bottom,x:c?m.head:y.center,y:c?y.center:m.head,height:c?y.size:Math.abs(m.size),width:c?Math.abs(m.size):y.size};h&&(S.options=d||this.resolveDataElementOptions(g,e[g].active?"active":r));const T=S.options||e[g].options;ZC(S,T,x,o),e3(S,T,u.ratio),this.updateElement(e[g],g,S,r)}}_getStacks(e,n){const{iScale:s}=this._cachedMeta,r=s.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),i=s.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[s.axis],c=u=>{const d=u._parsed.find(g=>g[s.axis]===l),h=d&&d[u.vScale.axis];if(Je(h)||isNaN(h))return!0};for(const u of r)if(!(n!==void 0&&c(u))&&((i===!1||o.indexOf(u.stack)===-1||i===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(s=>e[s].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const s of this.chart.data.datasets)e[Fe(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,s){const r=this._getStacks(e,s),i=n!==void 0?r.indexOf(n):-1;return i===-1?r.length-1:i}_getRuler(){const e=this.options,n=this._cachedMeta,s=n.iScale,r=[];let i,o;for(i=0,o=n.data.length;i<o;++i)r.push(s.getPixelForValue(this.getParsed(i)[s.axis],i));const a=e.barThickness;return{min:a||qC(n),pixels:r,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:s,index:r},options:{base:i,minBarLength:o}}=this,a=i||0,l=this.getParsed(e),c=l._custom,u=_c(c);let d=l[n.axis],h=0,g=s?this.applyStack(n,l,s):d,p,m;g!==d&&(h=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Bn(d)!==Bn(c.barEnd)&&(h=0),h+=d);const y=!Je(i)&&!u?i:h;let x=n.getPixelForValue(y);if(this.chart.getDataVisibility(e)?p=n.getPixelForValue(h+g):p=x,m=p-x,Math.abs(m)<o){m=XC(m,n,a)*o,d===a&&(x-=m/2);const S=n.getPixelForDecimal(0),T=n.getPixelForDecimal(1),v=Math.min(S,T),_=Math.max(S,T);x=Math.max(Math.min(x,_),v),p=x+m,s&&!u&&(l._stacks[n.axis]._visualValues[r]=n.getValueForPixel(p)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const S=Bn(m)*n.getLineWidthForValue(a)/2;x+=S,m-=S}return{size:m,base:x,head:p,center:p+m/2}}_calculateBarIndexPixels(e,n){const s=n.scale,r=this.options,i=r.skipNull,o=Fe(r.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const u=i?this._getStackCount(e):n.stackCount,d=r.barThickness==="flex"?GC(e,n,r,u*c):KC(e,n,r,u*c),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(Fe(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+g;a=d.start+d.chunk*p+d.chunk/2,l=Math.min(o,d.chunk*d.ratio)}else a=s.getPixelForValue(this.getParsed(e)[s.axis],e),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const e=this._cachedMeta,n=e.vScale,s=e.data,r=s.length;let i=0;for(;i<r;++i)this.getParsed(i)[n.axis]!==null&&!s[i].hidden&&s[i].draw(this._ctx)}}he(Ta,"id","bar"),he(Ta,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),he(Ta,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function t3(t,e,n){let s=1,r=1,i=0,o=0;if(e<dt){const a=t,l=a+e,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),h=Math.sin(l),g=(T,v,_)=>ho(T,a,l,!0)?1:Math.max(v,v*n,_,_*n),p=(T,v,_)=>ho(T,a,l,!0)?-1:Math.min(v,v*n,_,_*n),m=g(0,c,d),y=g(_t,u,h),x=p(et,c,d),S=p(et+_t,u,h);s=(m-x)/2,r=(y-S)/2,i=-(m+x)/2,o=-(y+S)/2}return{ratioX:s,ratioY:r,offsetX:i,offsetY:o}}class Pi extends fr{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const s=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=s;else{let i=l=>+s[l];if(Ve(s[e])){const{key:l="value"}=this._parsing;i=c=>+vr(s[c],l)}let o,a;for(o=e,a=e+n;o<a;++o)r._parsed[o]=i(o)}}_getRotation(){return cs(this.options.rotation-90)}_getCircumference(){return cs(this.options.circumference)}_getRotationExtents(){let e=dt,n=-dt;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const r=this.chart.getDatasetMeta(s).controller,i=r._getRotation(),o=r._getCircumference();e=Math.min(e,i),n=Math.max(n,i+o)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:s}=n,r=this._cachedMeta,i=r.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(s.width,s.height)-o)/2,0),l=Math.min(c$(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:g,offsetX:p,offsetY:m}=t3(d,u,l),y=(s.width-o)/h,x=(s.height-o)/g,S=Math.max(Math.min(y,x)/2,0),T=Im(this.options.radius,S),v=Math.max(T*l,0),_=(T-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*T,this.offsetY=m*T,r.total=this.calculateTotal(),this.outerRadius=T-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(i,0,i.length,e)}_circumference(e,n){const s=this.options,r=this._cachedMeta,i=this._getCircumference();return n&&s.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/dt)}updateElements(e,n,s,r){const i=r==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,h=i&&c.animateScale,g=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,r);let x=this._getRotation(),S;for(S=0;S<n;++S)x+=this._circumference(S,i);for(S=n;S<n+s;++S){const T=this._circumference(S,i),v=e[S],_={x:u+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+T,circumference:T,outerRadius:p,innerRadius:g};y&&(_.options=m||this.resolveDataElementOptions(S,v.active?"active":r)),x+=T,this.updateElement(v,S,_,r)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let s=0,r;for(r=0;r<n.length;r++){const i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(s+=Math.abs(i))}return s}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?dt*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,s=this.chart,r=s.data.labels||[],i=yd(n._parsed[e],s.options.locale);return{label:r[e]||"",value:i}}getMaxBorderWidth(e){let n=0;const s=this.chart;let r,i,o,a,l;if(!e){for(r=0,i=s.data.datasets.length;r<i;++r)if(s.isDatasetVisible(r)){o=s.getDatasetMeta(r),e=o.data,a=o.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)l=a.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let s=0,r=e.length;s<r;++s){const i=this.resolveDataElementOptions(s);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let s=0;s<e;++s)this.chart.isDatasetVisible(s)&&(n+=this._getRingWeight(s));return n}_getRingWeight(e){return Math.max(Fe(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}he(Pi,"id","doughnut"),he(Pi,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),he(Pi,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),he(Pi,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data,{labels:{pointStyle:s,textAlign:r,color:i,useBorderRadius:o,borderRadius:a}}=e.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const d=e.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:r,pointStyle:s,borderRadius:o&&(a||d.borderRadius),index:c}}):[]}},onClick(e,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update()}}}});class Ma extends fr{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:s,data:r=[],_dataset:i}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=A$(n,r,o);this._drawStart=a,this._drawCount=l,E$(n)&&(a=0,l=r.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!i._decimated,s.points=r;const c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!o,options:c},e),this.updateElements(r,a,l,e)}updateElements(e,n,s,r){const i=r==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,r),h=o.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,y=fo(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||i||r==="none",S=n+s,T=e.length;let v=n>0&&this.getParsed(n-1);for(let _=0;_<T;++_){const P=e[_],L=x?P:{};if(_<n||_>=S){L.skip=!0;continue}const C=this.getParsed(_),w=Je(C[g]),M=L[h]=o.getPixelForValue(C[h],_),E=L[g]=i||w?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,C,l):C[g],_);L.skip=isNaN(M)||isNaN(E)||w,L.stop=_>0&&Math.abs(C[h]-v[h])>y,m&&(L.parsed=C,L.raw=c.data[_]),d&&(L.options=u||this.resolveDataElementOptions(_,P.active?"active":r)),x||this.updateElement(P,_,L,r),v=C}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,s=n.options&&n.options.borderWidth||0,r=e.data||[];if(!r.length)return s;const i=r[0].size(this.resolveDataElementOptions(0)),o=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(s,i,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}he(Ma,"id","line"),he(Ma,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),he(Ma,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function er(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Sd{constructor(e){he(this,"options");this.options=e||{}}static override(e){Object.assign(Sd.prototype,e)}init(){}formats(){return er()}parse(){return er()}format(){return er()}add(){return er()}diff(){return er()}startOf(){return er()}endOf(){return er()}}var n3={_date:Sd};function s3(t,e,n,s){const{controller:r,data:i,_sorted:o}=t,a=r._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&o&&i.length){const c=a._reversePixels?S$:or;if(s){if(r._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(e);if(d){const h=c(i,e,n-d),g=c(i,e,n+d);return{lo:h.lo,hi:g.hi}}}}else{const u=c(i,e,n);if(l){const{vScale:d}=r._cachedMeta,{_parsed:h}=t,g=h.slice(0,u.lo+1).reverse().findIndex(m=>!Je(m[d.axis]));u.lo-=Math.max(0,g);const p=h.slice(u.hi).findIndex(m=>!Je(m[d.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:i.length-1}}function zl(t,e,n,s,r){const i=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=i.length;a<l;++a){const{index:c,data:u}=i[a],{lo:d,hi:h}=s3(i[a],e,o,r);for(let g=d;g<=h;++g){const p=u[g];p.skip||s(p,c,g)}}}function r3(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(s,r){const i=e?Math.abs(s.x-r.x):0,o=n?Math.abs(s.y-r.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}function kc(t,e,n,s,r){const i=[];return!r&&!t.isPointInArea(e)||zl(t,n,e,function(a,l,c){!r&&!go(a,t.chartArea,0)||a.inRange(e.x,e.y,s)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function i3(t,e,n,s){let r=[];function i(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],s),{angle:d}=Fm(o,{x:e.x,y:e.y});ho(d,c,u)&&r.push({element:o,datasetIndex:a,index:l})}return zl(t,n,e,i),r}function o3(t,e,n,s,r,i){let o=[];const a=r3(n);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const g=u.inRange(e.x,e.y,r);if(s&&!g)return;const p=u.getCenterPoint(r);if(!(!!i||t.isPointInArea(p))&&!g)return;const y=a(e,p);y<l?(o=[{element:u,datasetIndex:d,index:h}],l=y):y===l&&o.push({element:u,datasetIndex:d,index:h})}return zl(t,n,e,c),o}function wc(t,e,n,s,r,i){return!i&&!t.isPointInArea(e)?[]:n==="r"&&!s?i3(t,e,n,r):o3(t,e,n,s,r,i)}function Gh(t,e,n,s,r){const i=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return zl(t,n,e,(l,c,u)=>{l[o]&&l[o](e[n],r)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,r))}),s&&!a?[]:i}var a3={modes:{index(t,e,n,s){const r=nr(e,t),i=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?kc(t,r,i,s,o):wc(t,r,i,!1,s,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(t,e,n,s){const r=nr(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?kc(t,r,i,s,o):wc(t,r,i,!1,s,o);if(a.length>0){const l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(t,e,n,s){const r=nr(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;return kc(t,r,i,s,o)},nearest(t,e,n,s){const r=nr(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;return wc(t,r,i,n.intersect,s,o)},x(t,e,n,s){const r=nr(e,t);return Gh(t,r,"x",n.intersect,s)},y(t,e,n,s){const r=nr(e,t);return Gh(t,r,"y",n.intersect,s)}}};const oy=["left","top","right","bottom"];function mi(t,e){return t.filter(n=>n.pos===e)}function Yh(t,e){return t.filter(n=>oy.indexOf(n.pos)===-1&&n.box.axis===e)}function yi(t,e){return t.sort((n,s)=>{const r=e?s:n,i=e?n:s;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function l3(t){const e=[];let n,s,r,i,o,a;for(n=0,s=(t||[]).length;n<s;++n)r=t[n],{position:i,options:{stack:o,stackWeight:a=1}}=r,e.push({index:n,box:r,pos:i,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&i+o,stackWeight:a});return e}function c3(t){const e={};for(const n of t){const{stack:s,pos:r,stackWeight:i}=n;if(!s||!oy.includes(r))continue;const o=e[s]||(e[s]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return e}function u3(t,e){const n=c3(t),{vBoxMaxWidth:s,hBoxMaxHeight:r}=e;let i,o,a;for(i=0,o=t.length;i<o;++i){a=t[i];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*s:l&&e.availableWidth,a.height=r):(a.width=s,a.height=u?u*r:l&&e.availableHeight)}return n}function d3(t){const e=l3(t),n=yi(e.filter(c=>c.box.fullSize),!0),s=yi(mi(e,"left"),!0),r=yi(mi(e,"right")),i=yi(mi(e,"top"),!0),o=yi(mi(e,"bottom")),a=Yh(e,"x"),l=Yh(e,"y");return{fullSize:n,leftAndTop:s.concat(i),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:mi(e,"chartArea"),vertical:s.concat(r).concat(l),horizontal:i.concat(o).concat(a)}}function Xh(t,e,n,s){return Math.max(t[n],e[n])+Math.max(t[s],e[s])}function ay(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function f3(t,e,n,s){const{pos:r,box:i}=n,o=t.maxPadding;if(!Ve(r)){n.size&&(t[r]-=n.size);const d=s[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,t[r]+=n.size}i.getPadding&&ay(o,i.getPadding());const a=Math.max(0,e.outerWidth-Xh(o,t,"left","right")),l=Math.max(0,e.outerHeight-Xh(o,t,"top","bottom")),c=a!==t.w,u=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function h3(t){const e=t.maxPadding;function n(s){const r=Math.max(e[s]-t[s],0);return t[s]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function g3(t,e){const n=e.maxPadding;function s(r){const i={left:0,top:0,right:0,bottom:0};return r.forEach(o=>{i[o]=Math.max(e[o],n[o])}),i}return s(t?["left","right"]:["top","bottom"])}function Ri(t,e,n,s){const r=[];let i,o,a,l,c,u;for(i=0,o=t.length,c=0;i<o;++i){a=t[i],l=a.box,l.update(a.width||e.w,a.height||e.h,g3(a.horizontal,e));const{same:d,other:h}=f3(e,n,a,s);c|=d&&r.length,u=u||h,l.fullSize||r.push(a)}return c&&Ri(r,e,n,s)||u}function na(t,e,n,s,r){t.top=n,t.left=e,t.right=e+s,t.bottom=n+r,t.width=s,t.height=r}function Jh(t,e,n,s){const r=n.padding;let{x:i,y:o}=e;for(const a of t){const l=a.box,c=s[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=e.w*u,h=c.size||l.height;uo(c.start)&&(o=c.start),l.fullSize?na(l,r.left,o,n.outerWidth-r.right-r.left,h):na(l,e.left+c.placed,o,d,h),c.start=o,c.placed+=d,o=l.bottom}else{const d=e.h*u,h=c.size||l.width;uo(c.start)&&(i=c.start),l.fullSize?na(l,i,r.top,h,n.outerHeight-r.bottom-r.top):na(l,i,e.top+c.placed,h,d),c.start=i,c.placed+=d,i=l.right}}e.x=i,e.y=o}var hn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,s){if(!t)return;const r=mn(t.options.layout.padding),i=Math.max(e-r.width,0),o=Math.max(n-r.height,0),a=d3(t.boxes),l=a.vertical,c=a.horizontal;Qe(t.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},r);ay(h,mn(s));const g=Object.assign({maxPadding:h,w:i,h:o,x:r.left,y:r.top},r),p=u3(l.concat(c),d);Ri(a.fullSize,g,d,p),Ri(l,g,d,p),Ri(c,g,d,p)&&Ri(l,g,d,p),h3(g),Jh(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,Jh(a.rightAndBottom,g,d,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Qe(a.chartArea,m=>{const y=m.box;Object.assign(y,t.chartArea),y.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class ly{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,s){}removeEventListener(e,n,s){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,s,r){return n=Math.max(0,n||e.width),s=s||e.height,{width:n,height:Math.max(0,r?Math.floor(n/r):s)}}isAttached(e){return!0}updateConfig(e){}}class p3 extends ly{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Aa="$chartjs",m3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zh=t=>t===null||t==="";function y3(t,e){const n=t.style,s=t.getAttribute("height"),r=t.getAttribute("width");if(t[Aa]={initial:{height:s,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Zh(r)){const i=Ih(t,"width");i!==void 0&&(t.width=i)}if(Zh(s))if(t.style.height==="")t.height=t.width/(e||2);else{const i=Ih(t,"height");i!==void 0&&(t.height=i)}return t}const cy=xC?{passive:!0}:!1;function b3(t,e,n){t&&t.addEventListener(e,n,cy)}function x3(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,cy)}function v3(t,e){const n=m3[t.type]||t.type,{x:s,y:r}=nr(t,e);return{type:n,chart:e,native:t,x:s!==void 0?s:null,y:r!==void 0?r:null}}function tl(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function _3(t,e,n){const s=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||tl(a.addedNodes,s),o=o&&!tl(a.removedNodes,s);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function k3(t,e,n){const s=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||tl(a.removedNodes,s),o=o&&!tl(a.addedNodes,s);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const mo=new Map;let Qh=0;function uy(){const t=window.devicePixelRatio;t!==Qh&&(Qh=t,mo.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function w3(t,e){mo.size||window.addEventListener("resize",uy),mo.set(t,e)}function S3(t){mo.delete(t),mo.size||window.removeEventListener("resize",uy)}function $3(t,e,n){const s=t.canvas,r=s&&wd(s);if(!r)return;const i=Hm((a,l)=>{const c=r.clientWidth;n(a,l),c<r.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return o.observe(r),w3(t,i),o}function Sc(t,e,n){n&&n.disconnect(),e==="resize"&&S3(t)}function C3(t,e,n){const s=t.canvas,r=Hm(i=>{t.ctx!==null&&n(v3(i,t))},t);return b3(s,e,r),r}class T3 extends ly{acquireContext(e,n){const s=e&&e.getContext&&e.getContext("2d");return s&&s.canvas===e?(y3(e,n),s):null}releaseContext(e){const n=e.canvas;if(!n[Aa])return!1;const s=n[Aa].initial;["height","width"].forEach(i=>{const o=s[i];Je(o)?n.removeAttribute(i):n.setAttribute(i,o)});const r=s.style||{};return Object.keys(r).forEach(i=>{n.style[i]=r[i]}),n.width=n.width,delete n[Aa],!0}addEventListener(e,n,s){this.removeEventListener(e,n);const r=e.$proxies||(e.$proxies={}),o={attach:_3,detach:k3,resize:$3}[n]||C3;r[n]=o(e,n,s)}removeEventListener(e,n){const s=e.$proxies||(e.$proxies={}),r=s[n];if(!r)return;({attach:Sc,detach:Sc,resize:Sc}[n]||x3)(e,n,r),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,s,r){return bC(e,n,s,r)}isAttached(e){const n=e&&wd(e);return!!(n&&n.isConnected)}}function M3(t){return!kd()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?p3:T3}var ma;let xs=(ma=class{constructor(){he(this,"x");he(this,"y");he(this,"active",!1);he(this,"options");he(this,"$animations")}tooltipPosition(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}hasValue(){return fo(this.x)&&fo(this.y)}getProps(e,n){const s=this.$animations;if(!n||!s)return this;const r={};return e.forEach(i=>{r[i]=s[i]&&s[i].active()?s[i]._to:this[i]}),r}},he(ma,"defaults",{}),he(ma,"defaultRoutes"),ma);function A3(t,e){const n=t.options.ticks,s=E3(t),r=Math.min(n.maxTicksLimit||s,s),i=n.major.enabled?R3(e):[],o=i.length,a=i[0],l=i[o-1],c=[];if(o>r)return D3(e,c,i,o/r),c;const u=P3(i,e,r);if(o>0){let d,h;const g=o>1?Math.round((l-a)/(o-1)):null;for(sa(e,c,u,Je(g)?0:a-g,a),d=0,h=o-1;d<h;d++)sa(e,c,u,i[d],i[d+1]);return sa(e,c,u,l,Je(g)?e.length:l+g),c}return sa(e,c,u),c}function E3(t){const e=t.options.offset,n=t._tickSize(),s=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(s,r))}function P3(t,e,n){const s=O3(t),r=e.length/n;if(!s)return Math.max(r,1);const i=y$(s);for(let o=0,a=i.length-1;o<a;o++){const l=i[o];if(l>r)return l}return Math.max(r,1)}function R3(t){const e=[];let n,s;for(n=0,s=t.length;n<s;n++)t[n].major&&e.push(n);return e}function D3(t,e,n,s){let r=0,i=n[0],o;for(s=Math.ceil(s),o=0;o<t.length;o++)o===i&&(e.push(t[o]),r++,i=n[r*s])}function sa(t,e,n,s,r){const i=Fe(s,0),o=Math.min(Fe(r,t.length),t.length);let a=0,l,c,u;for(n=Math.ceil(n),r&&(l=r-s,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<o;c++)c===u&&(e.push(t[c]),a++,u=Math.round(i+a*n))}function O3(t){const e=t.length;let n,s;if(e<2)return!1;for(s=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==s)return!1;return s}const I3=t=>t==="left"?"right":t==="right"?"left":t,eg=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,tg=(t,e)=>Math.min(e||t,t);function ng(t,e){const n=[],s=t.length/e,r=t.length;let i=0;for(;i<r;i+=s)n.push(t[Math.floor(i)]);return n}function L3(t,e,n){const s=t.ticks.length,r=Math.min(e,s-1),i=t._startPixel,o=t._endPixel,a=1e-6;let l=t.getPixelForTick(r),c;if(!(n&&(s===1?c=Math.max(l-i,o-l):e===0?c=(t.getPixelForTick(1)-l)/2:c=(l-t.getPixelForTick(r-1))/2,l+=r<e?c:-c,l<i-a||l>o+a)))return l}function N3(t,e){Qe(t,n=>{const s=n.gc,r=s.length/2;let i;if(r>e){for(i=0;i<r;++i)delete n.data[s[i]];s.splice(0,r)}})}function bi(t){return t.drawTicks?t.tickLength:0}function sg(t,e){if(!t.display)return 0;const n=Dt(t.font,e),s=mn(t.padding);return(bt(t.text)?t.text.length:1)*n.lineHeight+s.height}function F3(t,e){return Sr(t,{scale:e,type:"scale"})}function j3(t,e,n){return Sr(t,{tick:n,index:e,type:"tick"})}function z3(t,e,n){let s=pd(t);return(n&&e!=="right"||!n&&e==="right")&&(s=I3(s)),s}function B3(t,e,n,s){const{top:r,left:i,bottom:o,right:a,chart:l}=t,{chartArea:c,scales:u}=l;let d=0,h,g,p;const m=o-r,y=a-i;if(t.isHorizontal()){if(g=Tt(s,i,a),Ve(n)){const x=Object.keys(n)[0],S=n[x];p=u[x].getPixelForValue(S)+m-e}else n==="center"?p=(c.bottom+c.top)/2+m-e:p=eg(t,n,e);h=a-i}else{if(Ve(n)){const x=Object.keys(n)[0],S=n[x];g=u[x].getPixelForValue(S)-y+e}else n==="center"?g=(c.left+c.right)/2-y+e:g=eg(t,n,e);p=Tt(s,o,r),d=n==="left"?-_t:_t}return{titleX:g,titleY:p,maxWidth:h,rotation:d}}class ui extends xs{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:s,_suggestedMax:r}=this;return e=Pn(e,Number.POSITIVE_INFINITY),n=Pn(n,Number.NEGATIVE_INFINITY),s=Pn(s,Number.POSITIVE_INFINITY),r=Pn(r,Number.NEGATIVE_INFINITY),{min:Pn(e,s),max:Pn(n,r),minDefined:Ot(e),maxDefined:Ot(n)}}getMinMax(e){let{min:n,max:s,minDefined:r,maxDefined:i}=this.getUserBounds(),o;if(r&&i)return{min:n,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,e),r||(n=Math.min(n,o.min)),i||(s=Math.max(s,o.max));return n=i&&n>s?s:n,s=r&&n>s?n:s,{min:Pn(n,Pn(s,n)),max:Pn(s,Pn(n,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){at(this.options.beforeUpdate,[this])}update(e,n,s){const{beginAtZero:r,grace:i,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=X$(this,i,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?ng(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=A3(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,s;this.isHorizontal()?(n=this.left,s=this.right):(n=this.top,s=this.bottom,e=!e),this._startPixel=n,this._endPixel=s,this._reversePixels=e,this._length=s-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){at(this.options.afterUpdate,[this])}beforeSetDimensions(){at(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){at(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),at(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){at(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let s,r,i;for(s=0,r=e.length;s<r;s++)i=e[s],i.label=at(n.callback,[i.value,s,e],this)}afterTickToLabelConversion(){at(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){at(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,s=tg(this.ticks.length,e.ticks.maxTicksLimit),r=n.minRotation||0,i=n.maxRotation;let o=r,a,l,c;if(!this._isVisible()||!n.display||r>=i||s<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,g=Rt(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/s:g/(s-1),d+6>a&&(a=g/(s-(e.offset?.5:1)),l=this.maxHeight-bi(e.grid)-n.padding-sg(e.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=_$(Math.min(Math.asin(Rt((u.highest.height+6)/a,-1,1)),Math.asin(Rt(l/c,-1,1))-Math.asin(Rt(h/c,-1,1)))),o=Math.max(r,Math.min(i,o))),this.labelRotation=o}afterCalculateLabelRotation(){at(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){at(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:s,title:r,grid:i}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=sg(r,n.options.font);if(a?(e.width=this.maxWidth,e.height=bi(i)+l):(e.height=this.maxHeight,e.width=bi(i)+l),s.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=s.padding*2,p=cs(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(a){const x=s.mirror?0:y*d.width+m*h.height;e.height=Math.min(this.maxHeight,e.height+x+g)}else{const x=s.mirror?0:m*d.width+y*h.height;e.width=Math.min(this.maxWidth,e.width+x+g)}this._calculatePadding(c,u,y,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,s,r){const{ticks:{align:i,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,g=0;l?c?(h=r*e.width,g=s*n.height):(h=s*e.height,g=r*n.width):i==="start"?g=n.width:i==="end"?h=e.width:i!=="inner"&&(h=e.width/2,g=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=e.height/2;i==="start"?(u=0,d=e.height):i==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){at(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,s;for(n=0,s=e.length;n<s;n++)Je(e[n].label)&&(e.splice(n,1),s--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let s=this.ticks;n<s.length&&(s=ng(s,n)),this._labelSizes=e=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,s){const{ctx:r,_longestTextCache:i}=this,o=[],a=[],l=Math.floor(n/tg(n,s));let c=0,u=0,d,h,g,p,m,y,x,S,T,v,_;for(d=0;d<n;d+=l){if(p=e[d].label,m=this._resolveTickFontOptions(d),r.font=y=m.string,x=i[y]=i[y]||{data:{},gc:[]},S=m.lineHeight,T=v=0,!Je(p)&&!bt(p))T=Eh(r,x.data,x.gc,T,p),v=S;else if(bt(p))for(h=0,g=p.length;h<g;++h)_=p[h],!Je(_)&&!bt(_)&&(T=Eh(r,x.data,x.gc,T,_),v+=S);o.push(T),a.push(v),c=Math.max(T,c),u=Math.max(v,u)}N3(i,n);const P=o.indexOf(c),L=a.indexOf(u),C=w=>({width:o[w]||0,height:a[w]||0});return{first:C(0),last:C(n-1),widest:C(P),highest:C(L),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return w$(this._alignToPixels?Qs(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const s=n[e];return s.$context||(s.$context=j3(this.getContext(),e,s))}return this.$context||(this.$context=F3(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=cs(this.labelRotation),s=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),i=this._getLabelSizes(),o=e.autoSkipPadding||0,a=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return this.isHorizontal()?l*s>a*r?a/s:l/r:l*r<a*s?l/s:a/r}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,s=this.chart,r=this.options,{grid:i,position:o,border:a}=r,l=i.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=bi(i),g=[],p=a.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,x=function(B){return Qs(s,B,m)};let S,T,v,_,P,L,C,w,M,E,z,V;if(o==="top")S=x(this.bottom),L=this.bottom-h,w=S-y,E=x(e.top)+y,V=e.bottom;else if(o==="bottom")S=x(this.top),E=e.top,V=x(e.bottom)-y,L=S+y,w=this.top+h;else if(o==="left")S=x(this.right),P=this.right-h,C=S-y,M=x(e.left)+y,z=e.right;else if(o==="right")S=x(this.left),M=e.left,z=x(e.right)-y,P=S+y,C=this.left+h;else if(n==="x"){if(o==="center")S=x((e.top+e.bottom)/2+.5);else if(Ve(o)){const B=Object.keys(o)[0],q=o[B];S=x(this.chart.scales[B].getPixelForValue(q))}E=e.top,V=e.bottom,L=S+y,w=L+h}else if(n==="y"){if(o==="center")S=x((e.left+e.right)/2);else if(Ve(o)){const B=Object.keys(o)[0],q=o[B];S=x(this.chart.scales[B].getPixelForValue(q))}P=S-y,C=P-h,M=e.left,z=e.right}const R=Fe(r.ticks.maxTicksLimit,d),j=Math.max(1,Math.ceil(d/R));for(T=0;T<d;T+=j){const B=this.getContext(T),q=i.setContext(B),J=a.setContext(B),ge=q.lineWidth,ke=q.color,ye=J.dash||[],ie=J.dashOffset,K=q.tickWidth,te=q.tickColor,_e=q.tickBorderDash||[],$e=q.tickBorderDashOffset;v=L3(this,T,l),v!==void 0&&(_=Qs(s,v,ge),c?P=C=M=z=_:L=w=E=V=_,g.push({tx1:P,ty1:L,tx2:C,ty2:w,x1:M,y1:E,x2:z,y2:V,width:ge,color:ke,borderDash:ye,borderDashOffset:ie,tickWidth:K,tickColor:te,tickBorderDash:_e,tickBorderDashOffset:$e}))}return this._ticksLength=d,this._borderValue=S,g}_computeLabelItems(e){const n=this.axis,s=this.options,{position:r,ticks:i}=s,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,h=bi(s.grid),g=h+u,p=d?-u:g,m=-cs(this.labelRotation),y=[];let x,S,T,v,_,P,L,C,w,M,E,z,V="middle";if(r==="top")P=this.bottom-p,L=this._getXAxisLabelAlignment();else if(r==="bottom")P=this.top+p,L=this._getXAxisLabelAlignment();else if(r==="left"){const j=this._getYAxisLabelAlignment(h);L=j.textAlign,_=j.x}else if(r==="right"){const j=this._getYAxisLabelAlignment(h);L=j.textAlign,_=j.x}else if(n==="x"){if(r==="center")P=(e.top+e.bottom)/2+g;else if(Ve(r)){const j=Object.keys(r)[0],B=r[j];P=this.chart.scales[j].getPixelForValue(B)+g}L=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")_=(e.left+e.right)/2-g;else if(Ve(r)){const j=Object.keys(r)[0],B=r[j];_=this.chart.scales[j].getPixelForValue(B)}L=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?V="top":l==="end"&&(V="bottom"));const R=this._getLabelSizes();for(x=0,S=a.length;x<S;++x){T=a[x],v=T.label;const j=i.setContext(this.getContext(x));C=this.getPixelForTick(x)+i.labelOffset,w=this._resolveTickFontOptions(x),M=w.lineHeight,E=bt(v)?v.length:1;const B=E/2,q=j.color,J=j.textStrokeColor,ge=j.textStrokeWidth;let ke=L;o?(_=C,L==="inner"&&(x===S-1?ke=this.options.reverse?"left":"right":x===0?ke=this.options.reverse?"right":"left":ke="center"),r==="top"?c==="near"||m!==0?z=-E*M+M/2:c==="center"?z=-R.highest.height/2-B*M+M:z=-R.highest.height+M/2:c==="near"||m!==0?z=M/2:c==="center"?z=R.highest.height/2-B*M:z=R.highest.height-E*M,d&&(z*=-1),m!==0&&!j.showLabelBackdrop&&(_+=M/2*Math.sin(m))):(P=C,z=(1-E)*M/2);let ye;if(j.showLabelBackdrop){const ie=mn(j.backdropPadding),K=R.heights[x],te=R.widths[x];let _e=z-ie.top,$e=0-ie.left;switch(V){case"middle":_e-=K/2;break;case"bottom":_e-=K;break}switch(L){case"center":$e-=te/2;break;case"right":$e-=te;break;case"inner":x===S-1?$e-=te:x>0&&($e-=te/2);break}ye={left:$e,top:_e,width:te+ie.width,height:K+ie.height,color:j.backdropColor}}y.push({label:v,font:w,textOffset:z,options:{rotation:m,color:q,strokeColor:J,strokeWidth:ge,textAlign:ke,textBaseline:V,translation:[_,P],backdrop:ye}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-cs(this.labelRotation))return e==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:s,mirror:r,padding:i}}=this.options,o=this._getLabelSizes(),a=e+i,l=o.widest.width;let c,u;return n==="left"?r?(u=this.right+i,s==="near"?c="left":s==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,s==="near"?c="right":s==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?r?(u=this.left+i,s==="near"?c="right":s==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,s==="near"?c="left":s==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:s,top:r,width:i,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(s,r,i,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(i=>i.value===e);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){const n=this.options.grid,s=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,o;const a=(l,c,u)=>{!u.width||!u.color||(s.save(),s.lineWidth=u.width,s.strokeStyle=u.color,s.setLineDash(u.borderDash||[]),s.lineDashOffset=u.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(n.display)for(i=0,o=r.length;i<o;++i){const l=r[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:s,grid:r}}=this,i=s.setContext(this.getContext()),o=s.display?i.width:0;if(!o)return;const a=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=Qs(e,this.left,o)-o/2,u=Qs(e,this.right,a)+a/2,d=h=l):(d=Qs(e,this.top,o)-o/2,h=Qs(e,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const s=this.ctx,r=this._computeLabelArea();r&&Nl(s,r);const i=this.getLabelItems(e);for(const o of i){const a=o.options,l=o.font,c=o.label,u=o.textOffset;po(s,c,0,u,l,a)}r&&Fl(s)}drawTitle(){const{ctx:e,options:{position:n,title:s,reverse:r}}=this;if(!s.display)return;const i=Dt(s.font),o=mn(s.padding),a=s.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Ve(n)?(l+=o.bottom,bt(s.text)&&(l+=i.lineHeight*(s.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=B3(this,l,n,a);po(e,s.text,0,0,i,{color:s.color,maxWidth:d,rotation:h,textAlign:z3(a,n,r),textBaseline:"middle",translation:[c,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,s=Fe(e.grid&&e.grid.z,-1),r=Fe(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==ui.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:s,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",r=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];a[s]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return Dt(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ra{constructor(e,n,s){this.type=e,this.scope=n,this.override=s,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let s;V3(n)&&(s=this.register(n));const r=this.items,i=e.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in r||(r[i]=e,H3(e,o,s),this.override&&mt.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const n=this.items,s=e.id,r=this.scope;s in n&&delete n[s],r&&s in mt[r]&&(delete mt[r][s],this.override&&delete _r[s])}}function H3(t,e,n){const s=co(Object.create(null),[n?mt.get(n):{},mt.get(e),t.defaults]);mt.set(e,s),t.defaultRoutes&&U3(e,t.defaultRoutes),t.descriptors&&mt.describe(e,t.descriptors)}function U3(t,e){Object.keys(e).forEach(n=>{const s=n.split("."),r=s.pop(),i=[t].concat(s).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");mt.route(i,r,l,a)})}function V3(t){return"id"in t&&"defaults"in t}class W3{constructor(){this.controllers=new ra(fr,"datasets",!0),this.elements=new ra(xs,"elements"),this.plugins=new ra(Object,"plugins"),this.scales=new ra(ui,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,s){[...n].forEach(r=>{const i=s||this._getRegistryForType(r);s||i.isForType(r)||i===this.plugins&&r.id?this._exec(e,i,r):Qe(r,o=>{const a=s||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,s){const r=hd(e);at(s["before"+r],[],s),n[e](s),at(s["after"+r],[],s)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const s=this._typedRegistries[n];if(s.isForType(e))return s}return this.plugins}_get(e,n,s){const r=n.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+s+".");return r}}var In=new W3;class q3{constructor(){this._init=void 0}notify(e,n,s,r){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const i=r?this._descriptors(e).filter(r):this._descriptors(e),o=this._notify(i,e,n,s);return n==="afterDestroy"&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),o}_notify(e,n,s,r){r=r||{};for(const i of e){const o=i.plugin,a=o[s],l=[n,r,i.options];if(at(a,l,o)===!1&&r.cancelable)return!1}return!0}invalidate(){Je(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const s=e&&e.config,r=Fe(s.options&&s.options.plugins,{}),i=K3(s);return r===!1&&!n?[]:Y3(e,i,r,n)}_notifyStateChanges(e){const n=this._oldCache||[],s=this._cache,r=(i,o)=>i.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(r(n,s),e,"stop"),this._notify(r(s,n),e,"start")}}function K3(t){const e={},n=[],s=Object.keys(In.plugins.items);for(let i=0;i<s.length;i++)n.push(In.getPlugin(s[i]));const r=t.plugins||[];for(let i=0;i<r.length;i++){const o=r[i];n.indexOf(o)===-1&&(n.push(o),e[o.id]=!0)}return{plugins:n,localIds:e}}function G3(t,e){return!e&&t===!1?null:t===!0?{}:t}function Y3(t,{plugins:e,localIds:n},s,r){const i=[],o=t.getContext();for(const a of e){const l=a.id,c=G3(s[l],r);c!==null&&i.push({plugin:a,options:X3(t.config,{plugin:a,local:n[l]},c,o)})}return i}function X3(t,{plugin:e,local:n},s,r){const i=t.pluginScopeKeys(e),o=t.getOptionScopes(s,i);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function bu(t,e){const n=mt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function J3(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function Z3(t,e){return t===e?"_index_":"_value_"}function rg(t){if(t==="x"||t==="y"||t==="r")return t}function Q3(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function xu(t,...e){if(rg(t))return t;for(const n of e){const s=n.axis||Q3(n.position)||t.length>1&&rg(t[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function ig(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function eT(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(s=>s.xAxisID===t||s.yAxisID===t);if(n.length)return ig(t,"x",n[0])||ig(t,"y",n[0])}return{}}function tT(t,e){const n=_r[t.type]||{scales:{}},s=e.scales||{},r=bu(t.type,e),i=Object.create(null);return Object.keys(s).forEach(o=>{const a=s[o];if(!Ve(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=xu(o,a,eT(o,t),mt.scales[a.type]),c=Z3(l,r),u=n.scales||{};i[o]=Yi(Object.create(null),[{axis:l},a,u[l],u[c]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||bu(a,e),u=(_r[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=J3(d,l),g=o[h+"AxisID"]||h;i[g]=i[g]||Object.create(null),Yi(i[g],[{axis:h},s[g],u[d]])})}),Object.keys(i).forEach(o=>{const a=i[o];Yi(a,[mt.scales[a.type],mt.scale])}),i}function dy(t){const e=t.options||(t.options={});e.plugins=Fe(e.plugins,{}),e.scales=tT(t,e)}function fy(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function nT(t){return t=t||{},t.data=fy(t.data),dy(t),t}const og=new Map,hy=new Set;function ia(t,e){let n=og.get(t);return n||(n=e(),og.set(t,n),hy.add(n)),n}const xi=(t,e,n)=>{const s=vr(e,n);s!==void 0&&t.add(s)};class sT{constructor(e){this._config=nT(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=fy(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),dy(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ia(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return ia(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return ia(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,s=this.type;return ia(`${s}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const s=this._scopeCache;let r=s.get(e);return(!r||n)&&(r=new Map,s.set(e,r)),r}getOptionScopes(e,n,s){const{options:r,type:i}=this,o=this._cachedScopes(e,s),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{e&&(l.add(e),u.forEach(d=>xi(l,e,d))),u.forEach(d=>xi(l,r,d)),u.forEach(d=>xi(l,_r[i]||{},d)),u.forEach(d=>xi(l,mt,d)),u.forEach(d=>xi(l,mu,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),hy.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,_r[n]||{},mt.datasets[n]||{},{type:n},mt,mu]}resolveNamedOptions(e,n,s,r=[""]){const i={$shared:!0},{resolver:o,subPrefixes:a}=ag(this._resolverCache,e,r);let l=o;if(iT(o,n)){i.$shared=!1,s=Us(s)?s():s;const c=this.createResolver(e,s,a);l=Qr(o,s,c)}for(const c of n)i[c]=l[c];return i}createResolver(e,n,s=[""],r){const{resolver:i}=ag(this._resolverCache,e,s);return Ve(n)?Qr(i,n,void 0,r):i}}function ag(t,e,n){let s=t.get(e);s||(s=new Map,t.set(e,s));const r=n.join();let i=s.get(r);return i||(i={resolver:xd(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},s.set(r,i)),i}const rT=t=>Ve(t)&&Object.getOwnPropertyNames(t).some(e=>Us(t[e]));function iT(t,e){const{isScriptable:n,isIndexable:s}=qm(t);for(const r of e){const i=n(r),o=s(r),a=(o||i)&&t[r];if(i&&(Us(a)||rT(a))||o&&bt(a))return!0}return!1}var oT="4.5.1";const aT=["top","bottom","left","right","chartArea"];function lg(t,e){return t==="top"||t==="bottom"||aT.indexOf(t)===-1&&e==="x"}function cg(t,e){return function(n,s){return n[t]===s[t]?n[e]-s[e]:n[t]-s[t]}}function ug(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),at(n&&n.onComplete,[t],e)}function lT(t){const e=t.chart,n=e.options.animation;at(n&&n.onProgress,[t],e)}function gy(t){return kd()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Ea={},dg=t=>{const e=gy(t);return Object.values(Ea).filter(n=>n.canvas===e).pop()};function cT(t,e,n){const s=Object.keys(t);for(const r of s){const i=+r;if(i>=e){const o=t[r];delete t[r],(n>0||i>e)&&(t[i+n]=o)}}}function uT(t,e,n,s){return!n||t.type==="mouseout"?null:s?e:t}var Ss;let Ws=(Ss=class{static register(...e){In.add(...e),fg()}static unregister(...e){In.remove(...e),fg()}constructor(e,n){const s=this.config=new sT(n),r=gy(e),i=dg(r);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||M3(r)),this.platform.updateConfig(s);const a=this.platform.acquireContext(r,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=l$(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new q3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=T$(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Ea[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Zn.listen(this,"complete",ug),Zn.listen(this,"progress",lT),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:s,height:r,_aspectRatio:i}=this;return Je(e)?n&&i?i:r?s/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return In}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Oh(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ph(this.canvas,this.ctx),this}stop(){return Zn.stop(this),this}resize(e,n){Zn.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const s=this.options,r=this.canvas,i=s.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,e,n,i),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Oh(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),at(s.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qe(n,(s,r)=>{s.id=r})}buildOrUpdateScales(){const e=this.options,n=e.scales,s=this.scales,r=Object.keys(s).reduce((o,a)=>(o[a]=!1,o),{});let i=[];n&&(i=i.concat(Object.keys(n).map(o=>{const a=n[o],l=xu(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Qe(i,o=>{const a=o.options,l=a.id,c=xu(l,a),u=Fe(a.type,o.dtype);(a.position===void 0||lg(a.position,c)!==lg(o.dposition))&&(a.position=o.dposition),r[l]=!0;let d=null;if(l in s&&s[l].type===u)d=s[l];else{const h=In.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,e)}),Qe(r,(o,a)=>{o||delete s[a]}),Qe(s,o=>{hn.configure(this,o,o.options),hn.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,s=e.length;if(e.sort((r,i)=>r.index-i.index),s>n){for(let r=n;r<s;++r)this._destroyDatasetMeta(r);e.splice(n,s-n)}this._sortedMetasets=e.slice(0).sort(cg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((s,r)=>{n.filter(i=>i===s._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let s,r;for(this._removeUnreferencedMetasets(),s=0,r=n.length;s<r;s++){const i=n[s];let o=this.getDatasetMeta(s);const a=i.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(s),o=this.getDatasetMeta(s)),o.type=a,o.indexAxis=i.indexAxis||bu(a,this.options),o.order=i.order||0,o.index=s,o.label=""+i.label,o.visible=this.isDatasetVisible(s),o.controller)o.controller.updateIndex(s),o.controller.linkScales();else{const l=In.getController(a),{datasetElementType:c,dataElementType:u}=mt.datasets[a];Object.assign(l,{dataElementType:In.getElement(u),datasetElementType:c&&In.getElement(c)}),o.controller=new l(this,s),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){Qe(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!r&&i.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=s.layout.autoPadding?o:0,this._updateLayout(o),r||Qe(i,c=>{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(cg("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qe(this.scales,e=>{hn.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(e.events);(!_h(n,s)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:s,start:r,count:i}of n){const o=s==="_removeElements"?-i:i;cT(e,r,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,s=i=>new Set(e.filter(o=>o[0]===i).map((o,a)=>a+","+o.splice(1).join(","))),r=s(0);for(let i=1;i<n;i++)if(!_h(r,s(i)))return;return Array.from(r).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;hn.update(this,this.width,this.height,e);const n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],Qe(this.boxes,r=>{s&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,i)=>{r._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,s=this.data.datasets.length;n<s;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,s=this.data.datasets.length;n<s;++n)this._updateDataset(n,Us(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const s=this.getDatasetMeta(e),r={meta:s,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(s.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Zn.has(this)?this.attached&&!Zn.running(this)&&Zn.start(this):(this.draw(),ug({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:s,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,s=[];let r,i;for(r=0,i=n.length;r<i;++r){const o=n[r];(!e||o.visible)&&s.push(o)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,s={meta:e,index:e.index,cancelable:!0},r=ny(this,e);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Nl(n,r),e.controller.draw(),r&&Fl(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(e){return go(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,s,r){const i=a3.modes[n];return typeof i=="function"?i(this,e,s,r):[]}getDatasetMeta(e){const n=this.data.datasets[e],s=this._metasets;let r=s.filter(i=>i&&i._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},s.push(r)),r}getContext(){return this.$context||(this.$context=Sr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const s=this.getDatasetMeta(e);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden}setDatasetVisibility(e,n){const s=this.getDatasetMeta(e);s.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,s){const r=s?"show":"hide",i=this.getDatasetMeta(e),o=i.controller._resolveAnimations(void 0,r);uo(n)?(i.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(e,s),o.update(i,{visible:s}),this.update(a=>a.datasetIndex===e?r:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Zn.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Ph(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ea[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,s=(i,o)=>{n.addEventListener(this,i,o),e[i]=o},r=(i,o,a)=>{i.offsetX=o,i.offsetY=a,this._eventHandler(i)};Qe(this.options.events,i=>s(i,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,s=(l,c)=>{n.addEventListener(this,l,c),e[l]=c},r=(l,c)=>{e[l]&&(n.removeEventListener(this,l,c),delete e[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{r("attach",a),this.attached=!0,this.resize(),s("resize",i),s("detach",o)};o=()=>{this.attached=!1,r("resize",i),this._stop(),this._resize(0,0),s("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Qe(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Qe(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,s){const r=s?"set":"remove";let i,o,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+r+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){o=e[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[r+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],s=e.map(({datasetIndex:i,index:o})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[o],index:o}});!Xa(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n))}notifyPlugins(e,n,s){return this._plugins.notify(this,e,n,s)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,s){const r=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=i(n,e),a=s?e:i(e,n);o.length&&this.updateHoverStyle(o,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(e,n){const s={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},r=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",s,r)===!1)return;const i=this._handleEvent(e,n,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,r),(i||s.changed)&&this.render(),this}_handleEvent(e,n,s){const{_active:r=[],options:i}=this,o=n,a=this._getActiveElements(e,r,s,o),l=g$(e),c=uT(e,this._lastEvent,s,l);s&&(this._lastEvent=null,at(i.onHover,[e,a,this],this),l&&at(i.onClick,[e,a,this],this));const u=!Xa(a,r);return(u||n)&&(this._active=a,this._updateHoverStyles(a,r,n)),this._lastEvent=c,u}_getActiveElements(e,n,s,r){if(e.type==="mouseout")return[];if(!s)return n;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}},he(Ss,"defaults",mt),he(Ss,"instances",Ea),he(Ss,"overrides",_r),he(Ss,"registry",In),he(Ss,"version",oT),he(Ss,"getChart",dg),Ss);function fg(){return Qe(Ws.instances,t=>t._plugins.invalidate())}function dT(t,e,n){const{startAngle:s,x:r,y:i,outerRadius:o,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/o,rn(s-n));if(t.beginPath(),t.arc(r,i,o-c/2,s+d/2,n-d/2),a>0){const h=Math.min(c/a,rn(s-n));t.arc(r,i,a+c/2,n-h/2,s+h/2,!0)}else{const h=Math.min(c/2,o*rn(s-n));if(u==="round")t.arc(r,i,h,n-et/2,s+et/2,!0);else if(u==="bevel"){const g=2*h*h,p=-g*Math.cos(n+et/2)+r,m=-g*Math.sin(n+et/2)+i,y=g*Math.cos(s+et/2)+r,x=g*Math.sin(s+et/2)+i;t.lineTo(p,m),t.lineTo(y,x)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function fT(t,e,n){const{startAngle:s,pixelMargin:r,x:i,y:o,outerRadius:a,innerRadius:l}=e;let c=r/a;t.beginPath(),t.arc(i,o,a,s-c,n+c),l>r?(c=r/l,t.arc(i,o,l,n+c,s-c,!0)):t.arc(i,o,r,n+_t,s-_t),t.closePath(),t.clip()}function hT(t){return bd(t,["outerStart","outerEnd","innerStart","innerEnd"])}function gT(t,e,n,s){const r=hT(t.options.borderRadius),i=(n-e)/2,o=Math.min(i,s*e/2),a=l=>{const c=(n-Math.min(i,l))*s/2;return Rt(l,0,Math.min(i,c))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:Rt(r.innerStart,0,o),innerEnd:Rt(r.innerEnd,0,o)}}function Rr(t,e,n,s){return{x:n+t*Math.cos(e),y:s+t*Math.sin(e)}}function nl(t,e,n,s,r,i){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=e,d=Math.max(e.outerRadius+s+n-c,0),h=u>0?u+s+n+c:0;let g=0;const p=r-l;if(s){const j=u>0?u-s:0,B=d>0?d-s:0,q=(j+B)/2,J=q!==0?p*q/(q+s):p;g=(p-J)/2}const m=Math.max(.001,p*d-n/et)/d,y=(p-m)/2,x=l+y+g,S=r-y-g,{outerStart:T,outerEnd:v,innerStart:_,innerEnd:P}=gT(e,h,d,S-x),L=d-T,C=d-v,w=x+T/L,M=S-v/C,E=h+_,z=h+P,V=x+_/E,R=S-P/z;if(t.beginPath(),i){const j=(w+M)/2;if(t.arc(o,a,d,w,j),t.arc(o,a,d,j,M),v>0){const ge=Rr(C,M,o,a);t.arc(ge.x,ge.y,v,M,S+_t)}const B=Rr(z,S,o,a);if(t.lineTo(B.x,B.y),P>0){const ge=Rr(z,R,o,a);t.arc(ge.x,ge.y,P,S+_t,R+Math.PI)}const q=(S-P/h+(x+_/h))/2;if(t.arc(o,a,h,S-P/h,q,!0),t.arc(o,a,h,q,x+_/h,!0),_>0){const ge=Rr(E,V,o,a);t.arc(ge.x,ge.y,_,V+Math.PI,x-_t)}const J=Rr(L,x,o,a);if(t.lineTo(J.x,J.y),T>0){const ge=Rr(L,w,o,a);t.arc(ge.x,ge.y,T,x-_t,w)}}else{t.moveTo(o,a);const j=Math.cos(w)*d+o,B=Math.sin(w)*d+a;t.lineTo(j,B);const q=Math.cos(M)*d+o,J=Math.sin(M)*d+a;t.lineTo(q,J)}t.closePath()}function pT(t,e,n,s,r){const{fullCircles:i,startAngle:o,circumference:a}=e;let l=e.endAngle;if(i){nl(t,e,n,s,l,r);for(let c=0;c<i;++c)t.fill();isNaN(a)||(l=o+(a%dt||dt))}return nl(t,e,n,s,l,r),t.fill(),l}function mT(t,e,n,s,r){const{fullCircles:i,startAngle:o,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h,borderRadius:g}=l,p=l.borderAlign==="inner";if(!c)return;t.setLineDash(d||[]),t.lineDashOffset=h,p?(t.lineWidth=c*2,t.lineJoin=u||"round"):(t.lineWidth=c,t.lineJoin=u||"bevel");let m=e.endAngle;if(i){nl(t,e,n,s,m,r);for(let y=0;y<i;++y)t.stroke();isNaN(a)||(m=o+(a%dt||dt))}p&&fT(t,e,m),l.selfJoin&&m-o>=et&&g===0&&u!=="miter"&&dT(t,e,m),i||(nl(t,e,n,s,m,r),t.stroke())}class Di extends xs{constructor(n){super();he(this,"circumference");he(this,"endAngle");he(this,"fullCircles");he(this,"innerRadius");he(this,"outerRadius");he(this,"pixelMargin");he(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,s,r){const i=this.getProps(["x","y"],r),{angle:o,distance:a}=Fm(i,{x:n,y:s}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),g=(this.options.spacing+this.options.borderWidth)/2,p=Fe(h,c-l),m=ho(o,l,c)&&l!==c,y=p>=dt||m,x=us(a,u+g,d+g);return y&&x}getCenterPoint(n){const{x:s,y:r,startAngle:i,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(i+o)/2,h=(a+l+u+c)/2;return{x:s+Math.cos(d)*h,y:r+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:s,circumference:r}=this,i=(s.offset||0)/4,o=(s.spacing||0)/2,a=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=r>dt?Math.floor(r/dt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(et,r||0)),u=i*c;n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,pT(n,this,u,o,a),mT(n,this,u,o,a),n.restore()}}he(Di,"id","arc"),he(Di,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),he(Di,"defaultRoutes",{backgroundColor:"backgroundColor"}),he(Di,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function py(t,e,n=e){t.lineCap=Fe(n.borderCapStyle,e.borderCapStyle),t.setLineDash(Fe(n.borderDash,e.borderDash)),t.lineDashOffset=Fe(n.borderDashOffset,e.borderDashOffset),t.lineJoin=Fe(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Fe(n.borderWidth,e.borderWidth),t.strokeStyle=Fe(n.borderColor,e.borderColor)}function yT(t,e,n){t.lineTo(n.x,n.y)}function bT(t){return t.stepped?B$:t.tension||t.cubicInterpolationMode==="monotone"?H$:yT}function my(t,e,n={}){const s=t.length,{start:r=0,end:i=s-1}=n,{start:o,end:a}=e,l=Math.max(r,o),c=Math.min(i,a),u=r<o&&i<o||r>a&&i>a;return{count:s,start:l,loop:e.loop,ilen:c<l&&!u?s+c-l:c-l}}function xT(t,e,n,s){const{points:r,options:i}=e,{count:o,start:a,loop:l,ilen:c}=my(r,n,s),u=bT(i);let{move:d=!0,reverse:h}=s||{},g,p,m;for(g=0;g<=c;++g)p=r[(a+(h?c-g:g))%o],!p.skip&&(d?(t.moveTo(p.x,p.y),d=!1):u(t,m,p,h,i.stepped),m=p);return l&&(p=r[(a+(h?c:0))%o],u(t,m,p,h,i.stepped)),!!l}function vT(t,e,n,s){const r=e.points,{count:i,start:o,ilen:a}=my(r,n,s),{move:l=!0,reverse:c}=s||{};let u=0,d=0,h,g,p,m,y,x;const S=v=>(o+(c?a-v:v))%i,T=()=>{m!==y&&(t.lineTo(u,y),t.lineTo(u,m),t.lineTo(u,x))};for(l&&(g=r[S(0)],t.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=r[S(h)],g.skip)continue;const v=g.x,_=g.y,P=v|0;P===p?(_<m?m=_:_>y&&(y=_),u=(d*u+v)/++d):(T(),t.lineTo(v,_),p=P,d=0,m=y=_),x=_}T()}function vu(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?vT:xT}function _T(t){return t.stepped?vC:t.tension||t.cubicInterpolationMode==="monotone"?_C:sr}function kT(t,e,n,s){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,s)&&r.closePath()),py(t,e.options),t.stroke(r)}function wT(t,e,n,s){const{segments:r,options:i}=e,o=vu(e);for(const a of r)py(t,i,a.style),t.beginPath(),o(t,e,a,{start:n,end:n+s-1})&&t.closePath(),t.stroke()}const ST=typeof Path2D=="function";function $T(t,e,n,s){ST&&!e.options.segment?kT(t,e,n,s):wT(t,e,n,s)}class Os extends xs{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,n){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const r=s.spanGaps?this._loop:this._fullLoop;fC(this._points,s,e,r,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=TC(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,s=e.length;return s&&n[e[s-1].end]}interpolate(e,n){const s=this.options,r=e[n],i=this.points,o=ty(this,{property:n,start:r,end:r});if(!o.length)return;const a=[],l=_T(s);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:h}=o[c],g=i[d],p=i[h];if(g===p){a.push(g);continue}const m=Math.abs((r-g[n])/(p[n]-g[n])),y=l(g,p,m,s.stepped);y[n]=e[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(e,n,s){return vu(this)(e,this,n,s)}path(e,n,s){const r=this.segments,i=vu(this);let o=this._loop;n=n||0,s=s||this.points.length-n;for(const a of r)o&=i(e,this,a,{start:n,end:n+s-1});return!!o}draw(e,n,s,r){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(e.save(),$T(e,this,s,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}he(Os,"id","line"),he(Os,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),he(Os,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),he(Os,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function hg(t,e,n,s){const r=t.options,{[n]:i}=t.getProps([n],s);return Math.abs(e-i)<r.radius+r.hitRadius}class Pa extends xs{constructor(n){super();he(this,"parsed");he(this,"skip");he(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,s,r){const i=this.options,{x:o,y:a}=this.getProps(["x","y"],r);return Math.pow(n-o,2)+Math.pow(s-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,s){return hg(this,n,"x",s)}inYRange(n,s){return hg(this,n,"y",s)}getCenterPoint(n){const{x:s,y:r}=this.getProps(["x","y"],n);return{x:s,y:r}}size(n){n=n||this.options||{};let s=n.radius||0;s=Math.max(s,s&&n.hoverRadius||0);const r=s&&n.borderWidth||0;return(s+r)*2}draw(n,s){const r=this.options;this.skip||r.radius<.1||!go(this,s,this.size(r)/2)||(n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.fillStyle=r.backgroundColor,yu(n,r,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}he(Pa,"id","point"),he(Pa,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),he(Pa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function yy(t,e){const{x:n,y:s,base:r,width:i,height:o}=t.getProps(["x","y","base","width","height"],e);let a,l,c,u,d;return t.horizontal?(d=o/2,a=Math.min(n,r),l=Math.max(n,r),c=s-d,u=s+d):(d=i/2,a=n-d,l=n+d,c=Math.min(s,r),u=Math.max(s,r)),{left:a,top:c,right:l,bottom:u}}function Is(t,e,n,s){return t?0:Rt(e,n,s)}function CT(t,e,n){const s=t.options.borderWidth,r=t.borderSkipped,i=Wm(s);return{t:Is(r.top,i.top,0,n),r:Is(r.right,i.right,0,e),b:Is(r.bottom,i.bottom,0,n),l:Is(r.left,i.left,0,e)}}function TT(t,e,n){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,i=Br(r),o=Math.min(e,n),a=t.borderSkipped,l=s||Ve(r);return{topLeft:Is(!l||a.top||a.left,i.topLeft,0,o),topRight:Is(!l||a.top||a.right,i.topRight,0,o),bottomLeft:Is(!l||a.bottom||a.left,i.bottomLeft,0,o),bottomRight:Is(!l||a.bottom||a.right,i.bottomRight,0,o)}}function MT(t){const e=yy(t),n=e.right-e.left,s=e.bottom-e.top,r=CT(t,n/2,s/2),i=TT(t,n/2,s/2);return{outer:{x:e.left,y:e.top,w:n,h:s,radius:i},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:s-r.t-r.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,i.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(r.b,r.r))}}}}function $c(t,e,n,s){const r=e===null,i=n===null,a=t&&!(r&&i)&&yy(t,s);return a&&(r||us(e,a.left,a.right))&&(i||us(n,a.top,a.bottom))}function AT(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function ET(t,e){t.rect(e.x,e.y,e.w,e.h)}function Cc(t,e,n={}){const s=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,i=(t.x+t.w!==n.x+n.w?e:0)-s,o=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+s,y:t.y+r,w:t.w+i,h:t.h+o,radius:t.radius}}class Ur extends xs{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:s,backgroundColor:r}}=this,{inner:i,outer:o}=MT(this),a=AT(o.radius)?Qa:ET;e.save(),(o.w!==i.w||o.h!==i.h)&&(e.beginPath(),a(e,Cc(o,n,i)),e.clip(),a(e,Cc(i,-n,o)),e.fillStyle=s,e.fill("evenodd")),e.beginPath(),a(e,Cc(i,n)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,n,s){return $c(this,e,n,s)}inXRange(e,n){return $c(this,e,null,n)}inYRange(e,n){return $c(this,null,e,n)}getCenterPoint(e){const{x:n,y:s,base:r,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(n+r)/2:n,y:i?s:(s+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}he(Ur,"id","bar"),he(Ur,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),he(Ur,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function PT(t,e,n){const s=t.segments,r=t.points,i=e.points,o=[];for(const a of s){let{start:l,end:c}=a;c=Bl(l,c,r);const u=_u(n,r[l],r[c],a.loop);if(!e.segments){o.push({source:a,target:u,start:r[l],end:r[c]});continue}const d=ty(e,u);for(const h of d){const g=_u(n,i[h.start],i[h.end],h.loop),p=ey(a,r,g);for(const m of p)o.push({source:m,target:h,start:{[n]:gg(u,g,"start",Math.max)},end:{[n]:gg(u,g,"end",Math.min)}})}}return o}function _u(t,e,n,s){if(s)return;let r=e[t],i=n[t];return t==="angle"&&(r=rn(r),i=rn(i)),{property:t,start:r,end:i}}function RT(t,e){const{x:n=null,y:s=null}=t||{},r=e.points,i=[];return e.segments.forEach(({start:o,end:a})=>{a=Bl(o,a,r);const l=r[o],c=r[a];s!==null?(i.push({x:l.x,y:s}),i.push({x:c.x,y:s})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:c.y}))}),i}function Bl(t,e,n){for(;e>t;e--){const s=n[e];if(!isNaN(s.x)&&!isNaN(s.y))break}return e}function gg(t,e,n,s){return t&&e?s(t[n],e[n]):t?t[n]:e?e[n]:0}function by(t,e){let n=[],s=!1;return bt(t)?(s=!0,n=t):n=RT(t,e),n.length?new Os({points:n,options:{tension:0},_loop:s,_fullLoop:s}):null}function pg(t){return t&&t.fill!==!1}function DT(t,e,n){let r=t[e].fill;const i=[e];let o;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!Ot(r))return r;if(o=t[r],!o)return!1;if(o.visible)return r;i.push(r),r=o.fill}return!1}function OT(t,e,n){const s=FT(t);if(Ve(s))return isNaN(s.value)?!1:s;let r=parseFloat(s);return Ot(r)&&Math.floor(r)===r?IT(s[0],e,r,n):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function IT(t,e,n,s){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=s?!1:n}function LT(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:Ve(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function NT(t,e,n){let s;return t==="start"?s=n:t==="end"?s=e.options.reverse?e.min:e.max:Ve(t)?s=t.value:s=e.getBaseValue(),s}function FT(t){const e=t.options,n=e.fill;let s=Fe(n&&n.target,n);return s===void 0&&(s=!!e.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function jT(t){const{scale:e,index:n,line:s}=t,r=[],i=s.segments,o=s.points,a=zT(e,n);a.push(by({x:null,y:e.bottom},s));for(let l=0;l<i.length;l++){const c=i[l];for(let u=c.start;u<=c.end;u++)BT(r,o[u],a)}return new Os({points:r,options:{}})}function zT(t,e){const n=[],s=t.getMatchingVisibleMetas("line");for(let r=0;r<s.length;r++){const i=s[r];if(i.index===e)break;i.hidden||n.unshift(i.dataset)}return n}function BT(t,e,n){const s=[];for(let r=0;r<n.length;r++){const i=n[r],{first:o,last:a,point:l}=HT(i,e,"x");if(!(!l||o&&a)){if(o)s.unshift(l);else if(t.push(l),!a)break}}t.push(...s)}function HT(t,e,n){const s=t.interpolate(e,n);if(!s)return{};const r=s[n],i=t.segments,o=t.points;let a=!1,l=!1;for(let c=0;c<i.length;c++){const u=i[c],d=o[u.start][n],h=o[u.end][n];if(us(r,d,h)){a=r===d,l=r===h;break}}return{first:a,last:l,point:s}}class xy{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,s){const{x:r,y:i,radius:o}=this;return n=n||{start:0,end:dt},e.arc(r,i,o,n.end,n.start,!0),!s.bounds}interpolate(e){const{x:n,y:s,radius:r}=this,i=e.angle;return{x:n+Math.cos(i)*r,y:s+Math.sin(i)*r,angle:i}}}function UT(t){const{chart:e,fill:n,line:s}=t;if(Ot(n))return VT(e,n);if(n==="stack")return jT(t);if(n==="shape")return!0;const r=WT(t);return r instanceof xy?r:by(r,s)}function VT(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function WT(t){return(t.scale||{}).getPointPositionForValue?KT(t):qT(t)}function qT(t){const{scale:e={},fill:n}=t,s=LT(n,e);if(Ot(s)){const r=e.isHorizontal();return{x:r?s:null,y:r?null:s}}return null}function KT(t){const{scale:e,fill:n}=t,s=e.options,r=e.getLabels().length,i=s.reverse?e.max:e.min,o=NT(n,e,i),a=[];if(s.grid.circular){const l=e.getPointPositionForValue(0,i);return new xy({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(o)})}for(let l=0;l<r;++l)a.push(e.getPointPositionForValue(l,o));return a}function Tc(t,e,n){const s=UT(e),{chart:r,index:i,line:o,scale:a,axis:l}=e,c=o.options,u=c.fill,d=c.backgroundColor,{above:h=d,below:g=d}=u||{},p=r.getDatasetMeta(i),m=ny(r,p);s&&o.points.length&&(Nl(t,n),GT(t,{line:o,target:s,above:h,below:g,area:n,scale:a,axis:l,clip:m}),Fl(t))}function GT(t,e){const{line:n,target:s,above:r,below:i,area:o,scale:a,clip:l}=e,c=n._loop?"angle":e.axis;t.save();let u=i;i!==r&&(c==="x"?(mg(t,s,o.top),Mc(t,{line:n,target:s,color:r,scale:a,property:c,clip:l}),t.restore(),t.save(),mg(t,s,o.bottom)):c==="y"&&(yg(t,s,o.left),Mc(t,{line:n,target:s,color:i,scale:a,property:c,clip:l}),t.restore(),t.save(),yg(t,s,o.right),u=r)),Mc(t,{line:n,target:s,color:u,scale:a,property:c,clip:l}),t.restore()}function mg(t,e,n){const{segments:s,points:r}=e;let i=!0,o=!1;t.beginPath();for(const a of s){const{start:l,end:c}=a,u=r[l],d=r[Bl(l,c,r)];i?(t.moveTo(u.x,u.y),i=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(d.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function yg(t,e,n){const{segments:s,points:r}=e;let i=!0,o=!1;t.beginPath();for(const a of s){const{start:l,end:c}=a,u=r[l],d=r[Bl(l,c,r)];i?(t.moveTo(u.x,u.y),i=!1):(t.lineTo(n,u.y),t.lineTo(u.x,u.y)),o=!!e.pathSegment(t,a,{move:o}),o?t.closePath():t.lineTo(n,d.y)}t.lineTo(n,e.first().y),t.closePath(),t.clip()}function Mc(t,e){const{line:n,target:s,property:r,color:i,scale:o,clip:a}=e,l=PT(n,s,r);for(const{source:c,target:u,start:d,end:h}of l){const{style:{backgroundColor:g=i}={}}=c,p=s!==!0;t.save(),t.fillStyle=g,YT(t,o,a,p&&_u(r,d,h)),t.beginPath();const m=!!n.pathSegment(t,c);let y;if(p){m?t.closePath():bg(t,s,h,r);const x=!!s.pathSegment(t,u,{move:m,reverse:!0});y=m&&x,y||bg(t,s,d,r)}t.closePath(),t.fill(y?"evenodd":"nonzero"),t.restore()}}function YT(t,e,n,s){const r=e.chart.chartArea,{property:i,start:o,end:a}=s||{};if(i==="x"||i==="y"){let l,c,u,d;i==="x"?(l=o,c=r.top,u=a,d=r.bottom):(l=r.left,c=o,u=r.right,d=a),t.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),d=Math.min(d,n.bottom)),t.rect(l,c,u-l,d-c),t.clip()}}function bg(t,e,n,s){const r=e.interpolate(n,s);r&&t.lineTo(r.x,r.y)}var XT={id:"filler",afterDatasetsUpdate(t,e,n){const s=(t.data.datasets||[]).length,r=[];let i,o,a,l;for(o=0;o<s;++o)i=t.getDatasetMeta(o),a=i.dataset,l=null,a&&a.options&&a instanceof Os&&(l={visible:t.isDatasetVisible(o),index:o,fill:OT(a,o,s),chart:t,axis:i.controller.options.indexAxis,scale:i.vScale,line:a}),i.$filler=l,r.push(l);for(o=0;o<s;++o)l=r[o],!(!l||l.fill===!1)&&(l.fill=DT(r,o,n.propagate))},beforeDraw(t,e,n){const s=n.drawTime==="beforeDraw",r=t.getSortedVisibleDatasetMetas(),i=t.chartArea;for(let o=r.length-1;o>=0;--o){const a=r[o].$filler;a&&(a.line.updateControlPoints(i,a.axis),s&&a.fill&&Tc(t.ctx,a,i))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const s=t.getSortedVisibleDatasetMetas();for(let r=s.length-1;r>=0;--r){const i=s[r].$filler;pg(i)&&Tc(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,n){const s=e.meta.$filler;!pg(s)||n.drawTime!=="beforeDatasetDraw"||Tc(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const xg=(t,e)=>{let{boxHeight:n=e,boxWidth:s=e}=t;return t.usePointStyle&&(n=Math.min(n,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:n,itemHeight:Math.max(e,n)}},JT=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class vg extends xs{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,s){this.maxWidth=e,this.maxHeight=n,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=at(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(s=>e.filter(s,this.chart.data))),e.sort&&(n=n.sort((s,r)=>e.sort(s,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const s=e.labels,r=Dt(s.font),i=r.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=xg(s,i);let c,u;n.font=r.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,i,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,s,r){const{ctx:i,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=r+a;let d=e;i.textAlign="left",i.textBaseline="middle";let h=-1,g=-u;return this.legendItems.forEach((p,m)=>{const y=s+n/2+i.measureText(p.text).width;(m===0||c[c.length-1]+y+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,g+=u,h++),l[m]={left:0,top:g,row:h,width:y,height:r},c[c.length-1]+=y+a}),d}_fitCols(e,n,s,r){const{ctx:i,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-e;let d=a,h=0,g=0,p=0,m=0;return this.legendItems.forEach((y,x)=>{const{itemWidth:S,itemHeight:T}=ZT(s,n,i,y,r);x>0&&g+T+2*a>u&&(d+=h+a,c.push({width:h,height:g}),p+=h+a,m++,h=g=0),l[x]={left:p,top:g,col:m,width:S,height:T},h=Math.max(h,S),g+=T+a}),d+=h,c.push({width:h,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:s,labels:{padding:r},rtl:i}}=this,o=Hr(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=Tt(s,this.left+r,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Tt(s,this.left+r,this.right-this.lineWidths[a])),c.top+=this.top+e+r,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+r}else{let a=0,l=Tt(s,this.top+e+r,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Tt(s,this.top+e+r,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+r,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Nl(e,this),this._draw(),Fl(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:s,ctx:r}=this,{align:i,labels:o}=e,a=mt.color,l=Hr(e.rtl,this.left,this.width),c=Dt(o.font),{padding:u}=o,d=c.size,h=d/2;let g;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=xg(o,d),x=function(P,L,C){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();const w=Fe(C.lineWidth,1);if(r.fillStyle=Fe(C.fillStyle,a),r.lineCap=Fe(C.lineCap,"butt"),r.lineDashOffset=Fe(C.lineDashOffset,0),r.lineJoin=Fe(C.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=Fe(C.strokeStyle,a),r.setLineDash(Fe(C.lineDash,[])),o.usePointStyle){const M={radius:m*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:w},E=l.xPlus(P,p/2),z=L+h;Vm(r,M,E,z,o.pointStyleWidth&&p)}else{const M=L+Math.max((d-m)/2,0),E=l.leftForLtr(P,p),z=Br(C.borderRadius);r.beginPath(),Object.values(z).some(V=>V!==0)?Qa(r,{x:E,y:M,w:p,h:m,radius:z}):r.rect(E,M,p,m),r.fill(),w!==0&&r.stroke()}r.restore()},S=function(P,L,C){po(r,C.text,P,L+y/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},T=this.isHorizontal(),v=this._computeTitleHeight();T?g={x:Tt(i,this.left+u,this.right-s[0]),y:this.top+u+v,line:0}:g={x:this.left+u,y:Tt(i,this.top+v+u,this.bottom-n[0].height),line:0},Jm(this.ctx,e.textDirection);const _=y+u;this.legendItems.forEach((P,L)=>{r.strokeStyle=P.fontColor,r.fillStyle=P.fontColor;const C=r.measureText(P.text).width,w=l.textAlign(P.textAlign||(P.textAlign=o.textAlign)),M=p+h+C;let E=g.x,z=g.y;l.setWidth(this.width),T?L>0&&E+M+u>this.right&&(z=g.y+=_,g.line++,E=g.x=Tt(i,this.left+u,this.right-s[g.line])):L>0&&z+_>this.bottom&&(E=g.x=E+n[g.line].width+u,g.line++,z=g.y=Tt(i,this.top+v+u,this.bottom-n[g.line].height));const V=l.x(E);if(x(V,z,P),E=M$(w,E+p+h,T?E+M:this.right,e.rtl),S(l.x(E),z,P),T)g.x+=M+u;else if(typeof P.text!="string"){const R=c.lineHeight;g.y+=vy(P,R)+u}else g.y+=_}),Zm(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,s=Dt(n.font),r=mn(n.padding);if(!n.display)return;const i=Hr(e.rtl,this.left,this.width),o=this.ctx,a=n.position,l=s.size/2,c=r.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Tt(e.align,d,this.right-h);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=c+Tt(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const g=Tt(a,d,d+h);o.textAlign=i.textAlign(pd(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=s.string,po(o,n.text,g,u,s)}_computeTitleHeight(){const e=this.options.title,n=Dt(e.font),s=mn(e.padding);return e.display?n.lineHeight+s.height:0}_getLegendItemAt(e,n){let s,r,i;if(us(e,this.left,this.right)&&us(n,this.top,this.bottom)){for(i=this.legendHitBoxes,s=0;s<i.length;++s)if(r=i[s],us(e,r.left,r.left+r.width)&&us(n,r.top,r.top+r.height))return this.legendItems[s]}return null}handleEvent(e){const n=this.options;if(!tM(e.type,n))return;const s=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const r=this._hoveredItem,i=JT(r,s);r&&!i&&at(n.onLeave,[e,r,this],this),this._hoveredItem=s,s&&!i&&at(n.onHover,[e,s,this],this)}else s&&at(n.onClick,[e,s,this],this)}}function ZT(t,e,n,s,r){const i=QT(s,t,e,n),o=eM(r,s,e.lineHeight);return{itemWidth:i,itemHeight:o}}function QT(t,e,n,s){let r=t.text;return r&&typeof r!="string"&&(r=r.reduce((i,o)=>i.length>o.length?i:o)),e+n.size/2+s.measureText(r).width}function eM(t,e,n){let s=t;return typeof e.text!="string"&&(s=vy(e,n)),s}function vy(t,e){const n=t.text?t.text.length:0;return e*n}function tM(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Do={id:"legend",_element:vg,start(t,e,n){const s=t.legend=new vg({ctx:t.ctx,options:n,chart:t});hn.configure(t,s,n),hn.addBox(t,s)},stop(t){hn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const s=t.legend;hn.configure(t,s,n),s.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const s=e.datasetIndex,r=n.chart;r.isDatasetVisible(s)?(r.hide(s),e.hidden=!0):(r.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:s,textAlign:r,color:i,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=mn(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:r||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class _y extends xs{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const r=bt(s.text)?s.text.length:1;this._padding=mn(s.padding);const i=r*Dt(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:s,bottom:r,right:i,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Tt(a,s,i),d=n+e,c=i-s):(o.position==="left"?(u=s+e,d=Tt(a,r,n),l=et*-.5):(u=i-e,d=Tt(a,n,r),l=et*.5),c=r-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const s=Dt(n.font),i=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);po(e,n.text,0,0,s,{color:n.color,maxWidth:l,rotation:c,textAlign:pd(n.align),textBaseline:"middle",translation:[o,a]})}}function nM(t,e){const n=new _y({ctx:t.ctx,options:e,chart:t});hn.configure(t,n,e),hn.addBox(t,n),t.titleBlock=n}var Oo={id:"title",_element:_y,start(t,e,n){nM(t,n)},stop(t){const e=t.titleBlock;hn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const s=t.titleBlock;hn.configure(t,s,n),s.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Oi={average(t){if(!t.length)return!1;let e,n,s=new Set,r=0,i=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),r+=l.y,++i}}return i===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:r/i}},nearest(t,e){if(!t.length)return!1;let n=e.x,s=e.y,r=Number.POSITIVE_INFINITY,i,o,a;for(i=0,o=t.length;i<o;++i){const l=t[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=pu(e,c);u<r&&(r=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,s=l.y}return{x:n,y:s}}};function Rn(t,e){return e&&(bt(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Qn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
454
|
+
`)>-1?t.split(`
|
|
455
|
+
`):t}function sM(t,e){const{element:n,datasetIndex:s,index:r}=e,i=t.getDatasetMeta(s).controller,{label:o,value:a}=i.getLabelAndValue(r);return{chart:t,label:o,parsed:i.getParsed(r),raw:t.data.datasets[s].data[r],formattedValue:a,dataset:i.getDataset(),dataIndex:r,datasetIndex:s,element:n}}function _g(t,e){const n=t.chart.ctx,{body:s,footer:r,title:i}=t,{boxWidth:o,boxHeight:a}=e,l=Dt(e.bodyFont),c=Dt(e.titleFont),u=Dt(e.footerFont),d=i.length,h=r.length,g=s.length,p=mn(e.padding);let m=p.height,y=0,x=s.reduce((v,_)=>v+_.before.length+_.lines.length+_.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x){const v=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=g*v+(x-g)*l.lineHeight+(x-1)*e.bodySpacing}h&&(m+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let S=0;const T=function(v){y=Math.max(y,n.measureText(v).width+S)};return n.save(),n.font=c.string,Qe(t.title,T),n.font=l.string,Qe(t.beforeBody.concat(t.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,Qe(s,v=>{Qe(v.before,T),Qe(v.lines,T),Qe(v.after,T)}),S=0,n.font=u.string,Qe(t.footer,T),n.restore(),y+=p.width,{width:y,height:m}}function rM(t,e){const{y:n,height:s}=e;return n<s/2?"top":n>t.height-s/2?"bottom":"center"}function iM(t,e,n,s){const{x:r,width:i}=s,o=n.caretSize+n.caretPadding;if(t==="left"&&r+i+o>e.width||t==="right"&&r-i-o<0)return!0}function oM(t,e,n,s){const{x:r,width:i}=n,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return s==="center"?c=r<=(a+l)/2?"left":"right":r<=i/2?c="left":r>=o-i/2&&(c="right"),iM(c,t,e,n)&&(c="center"),c}function kg(t,e,n){const s=n.yAlign||e.yAlign||rM(t,n);return{xAlign:n.xAlign||e.xAlign||oM(t,e,n,s),yAlign:s}}function aM(t,e){let{x:n,width:s}=t;return e==="right"?n-=s:e==="center"&&(n-=s/2),n}function lM(t,e,n){let{y:s,height:r}=t;return e==="top"?s+=n:e==="bottom"?s-=r+n:s-=r/2,s}function wg(t,e,n,s){const{caretSize:r,caretPadding:i,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,c=r+i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=Br(o);let p=aM(e,a);const m=lM(e,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+r:a==="right"&&(p+=Math.max(d,g)+r),{x:Rt(p,0,s.width-e.width),y:Rt(m,0,s.height-e.height)}}function oa(t,e,n){const s=mn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-s.right:t.x+s.left}function Sg(t){return Rn([],Qn(t))}function cM(t,e,n){return Sr(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function $g(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const ky={beforeTitle:Xn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,s=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return n[e.dataIndex]}return""},afterTitle:Xn,beforeBody:Xn,beforeLabel:Xn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Je(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Xn,afterBody:Xn,beforeFooter:Xn,footer:Xn,afterFooter:Xn};function Kt(t,e,n,s){const r=t[e].call(n,s);return typeof r>"u"?ky[e].call(n,s):r}class ku extends xs{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,s=this.options.setContext(this.getContext()),r=s.enabled&&n.options.animation&&s.animations,i=new sy(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=cM(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:s}=n,r=Kt(s,"beforeTitle",this,e),i=Kt(s,"title",this,e),o=Kt(s,"afterTitle",this,e);let a=[];return a=Rn(a,Qn(r)),a=Rn(a,Qn(i)),a=Rn(a,Qn(o)),a}getBeforeBody(e,n){return Sg(Kt(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:s}=n,r=[];return Qe(e,i=>{const o={before:[],lines:[],after:[]},a=$g(s,i);Rn(o.before,Qn(Kt(a,"beforeLabel",this,i))),Rn(o.lines,Kt(a,"label",this,i)),Rn(o.after,Qn(Kt(a,"afterLabel",this,i))),r.push(o)}),r}getAfterBody(e,n){return Sg(Kt(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:s}=n,r=Kt(s,"beforeFooter",this,e),i=Kt(s,"footer",this,e),o=Kt(s,"afterFooter",this,e);let a=[];return a=Rn(a,Qn(r)),a=Rn(a,Qn(i)),a=Rn(a,Qn(o)),a}_createItems(e){const n=this._active,s=this.chart.data,r=[],i=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(sM(this.chart,n[l]));return e.filter&&(a=a.filter((u,d,h)=>e.filter(u,d,h,s))),e.itemSort&&(a=a.sort((u,d)=>e.itemSort(u,d,s))),Qe(a,u=>{const d=$g(e.callbacks,u);r.push(Kt(d,"labelColor",this,u)),i.push(Kt(d,"labelPointStyle",this,u)),o.push(Kt(d,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const s=this.options.setContext(this.getContext()),r=this._active;let i,o=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{const a=Oi[s.position].call(this,r,this._eventPosition);o=this._createItems(s),this.title=this.getTitle(o,s),this.beforeBody=this.getBeforeBody(o,s),this.body=this.getBody(o,s),this.afterBody=this.getAfterBody(o,s),this.footer=this.getFooter(o,s);const l=this._size=_g(this,s),c=Object.assign({},a,l),u=kg(this.chart,s,c),d=wg(s,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,s,r){const i=this.getCaretPosition(e,s,r);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,s){const{xAlign:r,yAlign:i}=this,{caretSize:o,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Br(a),{x:h,y:g}=e,{width:p,height:m}=n;let y,x,S,T,v,_;return i==="center"?(v=g+m/2,r==="left"?(y=h,x=y-o,T=v+o,_=v-o):(y=h+p,x=y+o,T=v-o,_=v+o),S=y):(r==="left"?x=h+Math.max(l,u)+o:r==="right"?x=h+p-Math.max(c,d)-o:x=this.caretX,i==="top"?(T=g,v=T-o,y=x-o,S=x+o):(T=g+m,v=T+o,y=x+o,S=x-o),_=T),{x1:y,x2:x,x3:S,y1:T,y2:v,y3:_}}drawTitle(e,n,s){const r=this.title,i=r.length;let o,a,l;if(i){const c=Hr(s.rtl,this.x,this.width);for(e.x=oa(this,s.titleAlign,s),n.textAlign=c.textAlign(s.titleAlign),n.textBaseline="middle",o=Dt(s.titleFont),a=s.titleSpacing,n.fillStyle=s.titleColor,n.font=o.string,l=0;l<i;++l)n.fillText(r[l],c.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,l+1===i&&(e.y+=s.titleMarginBottom-a)}}_drawColorBox(e,n,s,r,i){const o=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=i,u=Dt(i.bodyFont),d=oa(this,"left",i),h=r.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=n.y+g;if(i.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=r.leftForLtr(h,c)+c/2,x=p+l/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,yu(e,m,y,x),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,yu(e,m,y,x)}else{e.lineWidth=Ve(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const m=r.leftForLtr(h,c),y=r.leftForLtr(r.xPlus(h,1),c-2),x=Br(o.borderRadius);Object.values(x).some(S=>S!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Qa(e,{x:m,y:p,w:c,h:l,radius:x}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Qa(e,{x:y,y:p+1,w:c-2,h:l-2,radius:x}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(m,p,c,l),e.strokeRect(m,p,c,l),e.fillStyle=o.backgroundColor,e.fillRect(y,p+1,c-2,l-2))}e.fillStyle=this.labelTextColors[s]}drawBody(e,n,s){const{body:r}=this,{bodySpacing:i,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=s,d=Dt(s.bodyFont);let h=d.lineHeight,g=0;const p=Hr(s.rtl,this.x,this.width),m=function(C){n.fillText(C,p.x(e.x+g),e.y+h/2),e.y+=h+i},y=p.textAlign(o);let x,S,T,v,_,P,L;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,e.x=oa(this,y,s),n.fillStyle=s.bodyColor,Qe(this.beforeBody,m),g=a&&y!=="right"?o==="center"?c/2+u:c+2+u:0,v=0,P=r.length;v<P;++v){for(x=r[v],S=this.labelTextColors[v],n.fillStyle=S,Qe(x.before,m),T=x.lines,a&&T.length&&(this._drawColorBox(n,e,v,p,s),h=Math.max(d.lineHeight,l)),_=0,L=T.length;_<L;++_)m(T[_]),h=d.lineHeight;Qe(x.after,m)}g=0,h=d.lineHeight,Qe(this.afterBody,m),e.y-=i}drawFooter(e,n,s){const r=this.footer,i=r.length;let o,a;if(i){const l=Hr(s.rtl,this.x,this.width);for(e.x=oa(this,s.footerAlign,s),e.y+=s.footerMarginTop,n.textAlign=l.textAlign(s.footerAlign),n.textBaseline="middle",o=Dt(s.footerFont),n.fillStyle=s.footerColor,n.font=o.string,a=0;a<i;++a)n.fillText(r[a],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+s.footerSpacing}}drawBackground(e,n,s,r){const{xAlign:i,yAlign:o}=this,{x:a,y:l}=e,{width:c,height:u}=s,{topLeft:d,topRight:h,bottomLeft:g,bottomRight:p}=Br(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(e,n,s,r),n.lineTo(a+c-h,l),n.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&i==="right"&&this.drawCaret(e,n,s,r),n.lineTo(a+c,l+u-p),n.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(e,n,s,r),n.lineTo(a+g,l+u),n.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&i==="left"&&this.drawCaret(e,n,s,r),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,s=this.$animations,r=s&&s.x,i=s&&s.y;if(r||i){const o=Oi[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=_g(this,e),l=Object.assign({},o,this._size),c=kg(n,e,l),u=wg(e,l,c,n);(r._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},i={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const o=mn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=s,this.drawBackground(i,e,r,n),Jm(e,n.textDirection),i.y+=o.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),Zm(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const s=this._active,r=e.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),i=!Xa(s,r),o=this._positionChanged(r,n);(i||o)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,i=this._active||[],o=this._getActiveElements(e,i,n,s),a=this._positionChanged(o,e),l=n||!Xa(o,i)||a;return l&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,s,r){const i=this.options;if(e.type==="mouseout")return[];if(!r)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,i.mode,i,s);return i.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:s,caretY:r,options:i}=this,o=Oi[i.position].call(this,e,n);return o!==!1&&(s!==o.x||r!==o.y)}}he(ku,"positioners",Oi);var Io={id:"tooltip",_element:ku,positioners:Oi,afterInit(t,e,n){n&&(t.tooltip=new ku({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ky},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const uM=(t,e,n,s)=>(typeof e=="string"?(n=t.push(e)-1,s.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function dM(t,e,n,s){const r=t.indexOf(e);if(r===-1)return uM(t,e,n,s);const i=t.lastIndexOf(e);return r!==i?n:r}const fM=(t,e)=>t===null?null:Rt(Math.round(t),0,e);function Cg(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class ti extends ui{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const s=this.getLabels();for(const{index:r,label:i}of n)s[r]===i&&s.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Je(e))return null;const s=this.getLabels();return n=isFinite(n)&&s[n]===e?n:dM(s,e,Fe(n,e),this._addedLabels),fM(n,s.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(s=0),n||(r=this.getLabels().length-1)),this.min=s,this.max=r}buildTicks(){const e=this.min,n=this.max,s=this.options.offset,r=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let o=e;o<=n;o++)r.push({value:o});return r}getLabelForValue(e){return Cg.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}he(ti,"id","category"),he(ti,"defaults",{ticks:{callback:Cg}});function hM(t,e){const n=[],{bounds:r,step:i,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=t,g=i||1,p=u-1,{min:m,max:y}=e,x=!Je(o),S=!Je(a),T=!Je(c),v=(y-m)/(d+1);let _=wh((y-m)/p/g)*g,P,L,C,w;if(_<1e-14&&!x&&!S)return[{value:m},{value:y}];w=Math.ceil(y/_)-Math.floor(m/_),w>p&&(_=wh(w*_/p/g)*g),Je(l)||(P=Math.pow(10,l),_=Math.ceil(_*P)/P),r==="ticks"?(L=Math.floor(m/_)*_,C=Math.ceil(y/_)*_):(L=m,C=y),x&&S&&i&&x$((a-o)/i,_/1e3)?(w=Math.round(Math.min((a-o)/_,u)),_=(a-o)/w,L=o,C=a):T?(L=x?o:L,C=S?a:C,w=c-1,_=(C-L)/w):(w=(C-L)/_,Xi(w,Math.round(w),_/1e3)?w=Math.round(w):w=Math.ceil(w));const M=Math.max(Sh(_),Sh(L));P=Math.pow(10,Je(l)?M:l),L=Math.round(L*P)/P,C=Math.round(C*P)/P;let E=0;for(x&&(h&&L!==o?(n.push({value:o}),L<o&&E++,Xi(Math.round((L+E*_)*P)/P,o,Tg(o,v,t))&&E++):L<o&&E++);E<w;++E){const z=Math.round((L+E*_)*P)/P;if(S&&z>a)break;n.push({value:z})}return S&&h&&C!==a?n.length&&Xi(n[n.length-1].value,a,Tg(a,v,t))?n[n.length-1].value=a:n.push({value:a}):(!S||C===a)&&n.push({value:C}),n}function Tg(t,e,{horizontal:n,minRotation:s}){const r=cs(s),i=(n?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/i,o)}class gM extends ui{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Je(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:s}=this.getUserBounds();let{min:r,max:i}=this;const o=l=>r=n?r:l,a=l=>i=s?i:l;if(e){const l=Bn(r),c=Bn(i);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(r===i){let l=i===0?1:Math.abs(i*.05);a(i+l),e||o(r-l)}this.min=r,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:s}=e,r;return s?(r=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let s=this.getTickLimit();s=Math.max(2,s);const r={maxTicks:s,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,o=hM(r,i);return e.bounds==="ticks"&&v$(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,s=this.max;if(super.configure(),this.options.offset&&e.length){const r=(s-n)/Math.max(e.length-1,1)/2;n-=r,s+=r}this._startValue=n,this._endValue=s,this._valueRange=s-n}getLabelForValue(e){return yd(e,this.chart.options.locale,this.options.ticks.format)}}class ni extends gM{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Ot(e)?e:0,this.max=Ot(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,s=cs(this.options.ticks.minRotation),r=(e?Math.sin(s):Math.cos(s))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}he(ni,"id","linear"),he(ni,"defaults",{ticks:{callback:Um.formatters.numeric}});const Hl={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Gt=Object.keys(Hl);function Mg(t,e){return t-e}function Ag(t,e){if(Je(e))return null;const n=t._adapter,{parser:s,round:r,isoWeekday:i}=t._parseOpts;let o=e;return typeof s=="function"&&(o=s(o)),Ot(o)||(o=typeof s=="string"?n.parse(o,s):n.parse(o)),o===null?null:(r&&(o=r==="week"&&(fo(i)||i===!0)?n.startOf(o,"isoWeek",i):n.startOf(o,r)),+o)}function Eg(t,e,n,s){const r=Gt.length;for(let i=Gt.indexOf(t);i<r-1;++i){const o=Hl[Gt[i]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(a*o.size))<=s)return Gt[i]}return Gt[r-1]}function pM(t,e,n,s,r){for(let i=Gt.length-1;i>=Gt.indexOf(n);i--){const o=Gt[i];if(Hl[o].common&&t._adapter.diff(r,s,o)>=e-1)return o}return Gt[n?Gt.indexOf(n):0]}function mM(t){for(let e=Gt.indexOf(t)+1,n=Gt.length;e<n;++e)if(Hl[Gt[e]].common)return Gt[e]}function Pg(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:s,hi:r}=gd(n,e),i=n[s]>=e?n[s]:n[r];t[i]=!0}}function yM(t,e,n,s){const r=t._adapter,i=+r.startOf(e[0].value,s),o=e[e.length-1].value;let a,l;for(a=i;a<=o;a=+r.add(a,1,s))l=n[a],l>=0&&(e[l].major=!0);return e}function Rg(t,e,n){const s=[],r={},i=e.length;let o,a;for(o=0;o<i;++o)a=e[o],r[a]=o,s.push({value:a,major:!1});return i===0||!n?s:yM(t,s,r,n)}class sl extends ui{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const s=e.time||(e.time={}),r=this._adapter=new n3._date(e.adapters.date);r.init(n),Yi(s.displayFormats,r.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Ag(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,s=e.time.unit||"day";let{min:r,max:i,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(r=Math.min(r,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=Ot(r)&&!isNaN(r)?r:+n.startOf(Date.now(),s),i=Ot(i)&&!isNaN(i)?i:+n.endOf(Date.now(),s)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],s=e[e.length-1]),{min:n,max:s}}buildTicks(){const e=this.options,n=e.time,s=e.ticks,r=s.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const i=this.min,o=this.max,a=$$(r,i,o);return this._unit=n.unit||(s.autoSkip?Eg(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):pM(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:mM(this._unit),this.initOffsets(r),e.reverse&&a.reverse(),Rg(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,s=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?n=1-r:n=(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?s=i:s=(i-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Rt(n,0,o),s=Rt(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const e=this._adapter,n=this.min,s=this.max,r=this.options,i=r.time,o=i.unit||Eg(i.minUnit,n,s,this._getLabelCapacity(n)),a=Fe(r.ticks.stepSize,1),l=o==="week"?i.isoWeekday:!1,c=fo(l)||l===!0,u={};let d=n,h,g;if(c&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,c?"day":o),e.diff(s,n,o)>1e5*a)throw new Error(n+" and "+s+" are too far apart with stepSize of "+a+" "+o);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h<s;h=+e.add(h,a,o),g++)Pg(u,h,p);return(h===s||r.bounds==="ticks"||g===1)&&Pg(u,h,p),Object.keys(u).sort(Mg).map(m=>+m)}getLabelForValue(e){const n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(e,s.tooltipFormat):n.format(e,s.displayFormats.datetime)}format(e,n){const r=this.options.time.displayFormats,i=this._unit,o=n||r[i];return this._adapter.format(e,o)}_tickFormatFunction(e,n,s,r){const i=this.options,o=i.ticks.callback;if(o)return at(o,[e,n,s],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=s[n],g=c&&d&&h&&h.major;return this._adapter.format(e,r||(g?d:u))}generateTickLabels(e){let n,s,r;for(n=0,s=e.length;n<s;++n)r=e[n],r.label=this._tickFormatFunction(r.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,s=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+s)*n.factor)}getValueForPixel(e){const n=this._offsets,s=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+s*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,s=this.ctx.measureText(e).width,r=cs(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(r),o=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:s*i+a*o,h:s*o+a*i}}_getLabelCapacity(e){const n=this.options.time,s=n.displayFormats,r=s[n.unit]||s.millisecond,i=this._tickFormatFunction(e,0,Rg(this,[e],this._majorUnit),r),o=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,s;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,s=r.length;n<s;++n)e=e.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,s;if(e.length)return e;const r=this.getLabels();for(n=0,s=r.length;n<s;++n)e.push(Ag(this,r[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return zm(e.sort(Mg))}}he(sl,"id","time"),he(sl,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function aa(t,e,n){let s=0,r=t.length-1,i,o,a,l;n?(e>=t[s].pos&&e<=t[r].pos&&({lo:s,hi:r}=or(t,"pos",e)),{pos:i,time:a}=t[s],{pos:o,time:l}=t[r]):(e>=t[s].time&&e<=t[r].time&&({lo:s,hi:r}=or(t,"time",e)),{time:i,pos:a}=t[s],{time:o,pos:l}=t[r]);const c=o-i;return c?a+(l-a)*(e-i)/c:a}class Dg extends sl{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=aa(n,this.min),this._tableRange=aa(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:s}=this,r=[],i=[];let o,a,l,c,u;for(o=0,a=e.length;o<a;++o)c=e[o],c>=n&&c<=s&&r.push(c);if(r.length<2)return[{time:n,pos:0},{time:s,pos:1}];for(o=0,a=r.length;o<a;++o)u=r[o+1],l=r[o-1],c=r[o],Math.round((u+l)/2)!==c&&i.push({time:c,pos:o/(a-1)});return i}_generate(){const e=this.min,n=this.max;let s=super.getDataTimestamps();return(!s.includes(e)||!s.length)&&s.splice(0,0,e),(!s.includes(n)||s.length===1)&&s.push(n),s.sort((r,i)=>r-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),s=this.getLabelTimestamps();return n.length&&s.length?e=this.normalize(n.concat(s)):e=n.length?n:s,e=this._cache.all=e,e}getDecimalForValue(e){return(aa(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,s=this.getDecimalForPixel(e)/n.factor-n.end;return aa(this._table,s*this._tableRange+this._minPos,!0)}}he(Dg,"id","timeseries"),he(Dg,"defaults",sl.defaults);const wy={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},bM={ariaLabel:{type:String},ariaDescribedby:{type:String}},xM={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...wy,...bM},vM=Ep[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function Dr(t){return oi(t)?Ue(t):t}function _M(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return oi(e)?new Proxy(t,{}):t}function kM(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function Sy(t,e){t.labels=e}function $y(t,e,n){const s=[];t.datasets=e.map(r=>{const i=t.datasets.find(o=>o[n]===r[n]);return!i||!r.data||s.includes(i)?{...r}:(s.push(i),Object.assign(i,r),i)})}function wM(t,e){const n={labels:[],datasets:[]};return Sy(n,t.labels),$y(n,t.datasets,e),n}const SM=Oe({props:xM,setup(t,e){let{expose:n,slots:s}=e;const r=I(null),i=z0(null);n({chart:i});const o=()=>{if(!r.value)return;const{type:c,data:u,options:d,plugins:h,datasetIdKey:g}=t,p=wM(u,g),m=_M(p,u);i.value=new Ws(r.value,{type:c,data:m,options:{...d},plugins:h})},a=()=>{const c=Ue(i.value);c&&(t.destroyDelay>0?setTimeout(()=>{c.destroy(),i.value=null},t.destroyDelay):(c.destroy(),i.value=null))},l=c=>{c.update(t.updateMode)};return Ge(o),tn(a),Be([()=>t.options,()=>t.data],(c,u)=>{let[d,h]=c,[g,p]=u;const m=Ue(i.value);if(!m)return;let y=!1;if(d){const x=Dr(d),S=Dr(g);x&&x!==S&&(kM(m,x),y=!0)}if(h){const x=Dr(h.labels),S=Dr(p.labels),T=Dr(h.datasets),v=Dr(p.datasets);x!==S&&(Sy(m.config.data,x),y=!0),T&&T!==v&&($y(m.config.data,T,t.datasetIdKey),y=!0)}y&&jn(()=>{l(m)})},{deep:!0}),()=>Yr("canvas",{role:"img","aria-label":t.ariaLabel,"aria-describedby":t.ariaDescribedby,ref:r},[Yr("p",{},[s.default?s.default():""])])}});function $d(t,e){return Ws.register(e),Oe({props:wy,setup(n,s){let{expose:r}=s;const i=z0(null),o=a=>{i.value=a==null?void 0:a.chart};return r({chart:i}),()=>Yr(SM,vM({ref:o},{type:t,...n}))}})}const Cd=$d("bar",Ta),$M=$d("doughnut",Pi),CM=$d("line",Ma),TM={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},MM={class:"text-lg font-semibold mb-4 flex items-center gap-2"},AM={key:0,class:"flex items-center justify-center h-48"},EM={key:1,class:"text-red-500 text-sm"},PM={key:2,class:"text-gray-500 text-center py-8"},RM={key:3,class:"h-64"},DM={key:4,class:"mt-4 grid grid-cols-2 gap-2 text-sm"},OM={class:"truncate"},IM=Oe({__name:"ToolUsageChart",setup(t){Ws.register(ti,ni,Ur,Oo,Io,Do);const e=We(),n=I([]),s=I(!1),r=I(null),i=le(()=>({labels:n.value.map(l=>l.tool_name),datasets:[{label:"Usage Count",data:n.value.map(l=>l.count),backgroundColor:"rgba(59, 130, 246, 0.7)",borderColor:"rgba(59, 130, 246, 1)",borderWidth:1,borderRadius:4}]})),o=le(()=>({indexAxis:"y",responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{afterLabel:l=>{const c=n.value[l.dataIndex];return`Success rate: ${Math.round(c.success_rate*100)}%`}}}},scales:{x:{beginAtZero:!0,grid:{display:!1},ticks:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"}},y:{grid:{display:!1},ticks:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"}}}}));async function a(){if(e.currentProject){s.value=!0,r.value=null;try{n.value=await W_(e.currentProject.db_path,10)}catch(l){r.value="Failed to load tool usage data",console.error(l)}finally{s.value=!1}}}return Ge(a),Be(()=>e.currentProject,a),(l,c)=>(b(),k("div",TM,[f("h2",MM,[O($(Tm),{class:"w-5 h-5 text-blue-500"}),c[0]||(c[0]=oe(" Tool Usage ",-1))]),s.value?(b(),k("div",AM,[...c[1]||(c[1]=[f("div",{class:"animate-pulse text-gray-500"},"Loading...",-1)])])):r.value?(b(),k("div",EM,A(r.value),1)):n.value.length===0?(b(),k("div",PM," No tool usage data available ")):(b(),k("div",RM,[O($(Cd),{data:i.value,options:o.value},null,8,["data","options"])])),n.value.length>0?(b(),k("div",DM,[(b(!0),k(ae,null,ve(n.value.slice(0,4),u=>(b(),k("div",{key:u.tool_name,class:"flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded"},[f("span",OM,A(u.tool_name),1),f("span",{class:re(["px-2 py-0.5 rounded text-xs font-medium",u.success_rate>=.95?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":u.success_rate>=.8?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"])},A(Math.round(u.success_rate*100))+"% ",3)]))),128))])):H("",!0)]))}}),LM={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},NM={class:"text-lg font-semibold mb-4 flex items-center gap-2"},FM={key:0,class:"flex items-center justify-center h-48"},jM={key:1,class:"text-red-500 text-sm"},zM={key:2,class:"text-gray-500 text-center py-8"},BM={class:"grid grid-cols-2 gap-4 mb-4"},HM={class:"bg-purple-50 dark:bg-purple-900/20 rounded-lg p-3 text-center"},UM={class:"text-2xl font-bold text-purple-600 dark:text-purple-400"},VM={class:"bg-green-50 dark:bg-green-900/20 rounded-lg p-3 text-center"},WM={class:"text-2xl font-bold text-green-600 dark:text-green-400"},qM={class:"h-56"},KM=Oe({__name:"MemoryGrowthChart",setup(t){Ws.register(ti,ni,Pa,Os,Oo,Io,Do,XT);const e=We(),n=I([]),s=I(!1),r=I(null),i=le(()=>({labels:n.value.map(u=>new Date(u.date).toLocaleDateString("en-US",{month:"short",day:"numeric"})),datasets:[{label:"Cumulative Memories",data:n.value.map(u=>u.cumulative),borderColor:"rgba(139, 92, 246, 1)",backgroundColor:"rgba(139, 92, 246, 0.2)",fill:!0,tension:.4,pointRadius:2,pointHoverRadius:5},{label:"Daily New",data:n.value.map(u=>u.count),borderColor:"rgba(34, 197, 94, 1)",backgroundColor:"rgba(34, 197, 94, 0.5)",fill:!1,tension:.4,pointRadius:3,pointHoverRadius:6,yAxisID:"y1"}]})),o=le(()=>({responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"top",labels:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280",usePointStyle:!0,pointStyle:"circle"}},tooltip:{backgroundColor:document.documentElement.classList.contains("dark")?"#374151":"#ffffff",titleColor:document.documentElement.classList.contains("dark")?"#f3f4f6":"#1f2937",bodyColor:document.documentElement.classList.contains("dark")?"#d1d5db":"#4b5563",borderColor:document.documentElement.classList.contains("dark")?"#4b5563":"#e5e7eb",borderWidth:1}},scales:{x:{grid:{display:!1},ticks:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280",maxRotation:45,minRotation:45}},y:{type:"linear",display:!0,position:"left",title:{display:!0,text:"Cumulative",color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"},grid:{color:document.documentElement.classList.contains("dark")?"#374151":"#e5e7eb"},ticks:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"}},y1:{type:"linear",display:!0,position:"right",title:{display:!0,text:"Daily",color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"},grid:{drawOnChartArea:!1},ticks:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"}}}})),a=le(()=>n.value.reduce((u,d)=>u+d.count,0)),l=le(()=>n.value.length>0?n.value[n.value.length-1].cumulative:0);async function c(){if(e.currentProject){s.value=!0,r.value=null;try{n.value=await q_(e.currentProject.db_path,30)}catch(u){r.value="Failed to load memory growth data",console.error(u)}finally{s.value=!1}}}return Ge(c),Be(()=>e.currentProject,c),(u,d)=>(b(),k("div",LM,[f("h2",NM,[O($(Cm),{class:"w-5 h-5 text-purple-500"}),d[0]||(d[0]=oe(" Memory Growth ",-1))]),s.value?(b(),k("div",FM,[...d[1]||(d[1]=[f("div",{class:"animate-pulse text-gray-500"},"Loading...",-1)])])):r.value?(b(),k("div",jM,A(r.value),1)):n.value.length===0?(b(),k("div",zM," No memory growth data available ")):(b(),k(ae,{key:3},[f("div",BM,[f("div",HM,[f("div",UM,A(l.value),1),d[2]||(d[2]=f("div",{class:"text-xs text-purple-600/70 dark:text-purple-400/70"},"Total Memories",-1))]),f("div",VM,[f("div",WM,"+"+A(a.value),1),d[3]||(d[3]=f("div",{class:"text-xs text-green-600/70 dark:text-green-400/70"},"Last 30 Days",-1))])]),f("div",qM,[O($(CM),{data:i.value,options:o.value},null,8,["data","options"])])],64))]))}}),GM={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},YM={class:"flex items-center justify-between mb-4"},XM={class:"text-lg font-semibold flex items-center gap-2"},JM={class:"flex items-center gap-1 bg-gray-100 dark:bg-gray-700 rounded-lg p-1"},ZM={key:0,class:"flex items-center justify-center h-48"},QM={key:1,class:"text-red-500 text-sm"},eA={key:2,class:"text-gray-500 text-center py-8"},tA={key:3,class:"h-64"},nA={key:4,class:"mt-4 flex items-center gap-4 text-sm text-gray-600 dark:text-gray-400"},sA={key:5,class:"mt-4 grid grid-cols-2 gap-2 text-sm"},rA={class:"truncate font-mono"},iA=Oe({__name:"CommandUsageChart",setup(t){Ws.register(ti,ni,Ur,Oo,Io,Do);const e=We(),n=I([]),s=I(!1),r=I(null),i=I("all"),o=le(()=>({labels:n.value.map(c=>`/${c.command_name}`),datasets:[{label:"Usage Count",data:n.value.map(c=>c.count),backgroundColor:n.value.map(c=>c.command_scope==="universal"?"rgba(168, 85, 247, 0.7)":c.command_scope==="project"?"rgba(34, 197, 94, 0.7)":"rgba(156, 163, 175, 0.7)"),borderColor:n.value.map(c=>c.command_scope==="universal"?"rgba(168, 85, 247, 1)":c.command_scope==="project"?"rgba(34, 197, 94, 1)":"rgba(156, 163, 175, 1)"),borderWidth:1,borderRadius:4}]})),a=le(()=>({indexAxis:"y",responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{afterLabel:c=>{const u=n.value[c.dataIndex];return[`Success rate: ${Math.round(u.success_rate*100)}%`,`Scope: ${u.command_scope}`,u.avg_duration_ms?`Avg duration: ${u.avg_duration_ms}ms`:""].filter(Boolean)}}}},scales:{x:{beginAtZero:!0,grid:{display:!1},ticks:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"}},y:{grid:{display:!1},ticks:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"}}}}));async function l(){if(e.currentProject){s.value=!0,r.value=null;try{const c=i.value==="all"?void 0:i.value;n.value=await K_(e.currentProject.db_path,c,30)}catch(c){r.value="Failed to load command usage data",console.error(c)}finally{s.value=!1}}}return Ge(l),Be(()=>e.currentProject,l),Be(i,l),(c,u)=>(b(),k("div",GM,[f("div",YM,[f("h2",XM,[O($($m),{class:"w-5 h-5 text-purple-500"}),u[3]||(u[3]=oe(" Slash Command Usage ",-1))]),f("div",JM,[f("button",{onClick:u[0]||(u[0]=d=>i.value="all"),class:re(["px-3 py-1 rounded text-sm transition-colors",i.value==="all"?"bg-white dark:bg-gray-600 shadow":"hover:bg-gray-200 dark:hover:bg-gray-600"])}," All ",2),f("button",{onClick:u[1]||(u[1]=d=>i.value="universal"),class:re(["px-3 py-1 rounded text-sm transition-colors flex items-center gap-1",i.value==="universal"?"bg-white dark:bg-gray-600 shadow":"hover:bg-gray-200 dark:hover:bg-gray-600"])},[O($(Dl),{class:"w-3 h-3"}),u[4]||(u[4]=oe(" Universal ",-1))],2),f("button",{onClick:u[2]||(u[2]=d=>i.value="project"),class:re(["px-3 py-1 rounded text-sm transition-colors flex items-center gap-1",i.value==="project"?"bg-white dark:bg-gray-600 shadow":"hover:bg-gray-200 dark:hover:bg-gray-600"])},[O($(ym),{class:"w-3 h-3"}),u[5]||(u[5]=oe(" Project ",-1))],2)])]),s.value?(b(),k("div",ZM,[...u[6]||(u[6]=[f("div",{class:"animate-pulse text-gray-500"},"Loading...",-1)])])):r.value?(b(),k("div",QM,A(r.value),1)):n.value.length===0?(b(),k("div",eA," No command usage data available ")):(b(),k("div",tA,[O($(Cd),{data:o.value,options:a.value},null,8,["data","options"])])),n.value.length>0?(b(),k("div",nA,[...u[7]||(u[7]=[Bs('<div class="flex items-center gap-1"><span class="w-3 h-3 rounded bg-purple-500"></span> Universal </div><div class="flex items-center gap-1"><span class="w-3 h-3 rounded bg-green-500"></span> Project </div><div class="flex items-center gap-1"><span class="w-3 h-3 rounded bg-gray-400"></span> Unknown </div>',3)])])):H("",!0),n.value.length>0?(b(),k("div",sA,[(b(!0),k(ae,null,ve(n.value.slice(0,4),d=>(b(),k("div",{key:d.command_name,class:"flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded"},[f("span",rA,"/"+A(d.command_name),1),f("span",{class:re(["px-2 py-0.5 rounded text-xs font-medium",d.success_rate>=.95?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":d.success_rate>=.8?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"])},A(Math.round(d.success_rate*100))+"% ",3)]))),128))])):H("",!0)]))}}),oA={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},aA={class:"flex items-center justify-between mb-4"},lA={class:"text-lg font-semibold flex items-center gap-2"},cA={class:"flex items-center gap-1 bg-gray-100 dark:bg-gray-700 rounded-lg p-1"},uA={key:0,class:"flex items-center justify-center h-48"},dA={key:1,class:"text-red-500 text-sm"},fA={key:2,class:"text-gray-500 text-center py-8"},hA={key:3,class:"h-64"},gA={key:4,class:"mt-4 flex items-center gap-4 text-sm text-gray-600 dark:text-gray-400"},pA={key:5,class:"mt-4 grid grid-cols-2 gap-2 text-sm"},mA={class:"truncate"},yA=Oe({__name:"SkillUsageChart",setup(t){Ws.register(ti,ni,Ur,Oo,Io,Do);const e=We(),n=I([]),s=I(!1),r=I(null),i=I("all"),o=le(()=>({labels:n.value.map(c=>c.skill_name),datasets:[{label:"Usage Count",data:n.value.map(c=>c.count),backgroundColor:n.value.map(c=>c.skill_scope==="universal"?"rgba(236, 72, 153, 0.7)":c.skill_scope==="project"?"rgba(14, 165, 233, 0.7)":"rgba(156, 163, 175, 0.7)"),borderColor:n.value.map(c=>c.skill_scope==="universal"?"rgba(236, 72, 153, 1)":c.skill_scope==="project"?"rgba(14, 165, 233, 1)":"rgba(156, 163, 175, 1)"),borderWidth:1,borderRadius:4}]})),a=le(()=>({indexAxis:"y",responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{afterLabel:c=>{const u=n.value[c.dataIndex];return[`Success rate: ${Math.round(u.success_rate*100)}%`,`Scope: ${u.skill_scope}`,u.avg_duration_ms?`Avg duration: ${u.avg_duration_ms}ms`:""].filter(Boolean)}}}},scales:{x:{beginAtZero:!0,grid:{display:!1},ticks:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"}},y:{grid:{display:!1},ticks:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280"}}}}));async function l(){if(e.currentProject){s.value=!0,r.value=null;try{const c=i.value==="all"?void 0:i.value;n.value=await G_(e.currentProject.db_path,c,30)}catch(c){r.value="Failed to load skill usage data",console.error(c)}finally{s.value=!1}}}return Ge(l),Be(()=>e.currentProject,l),Be(i,l),(c,u)=>(b(),k("div",oA,[f("div",aA,[f("h2",lA,[O($(Eo),{class:"w-5 h-5 text-pink-500"}),u[3]||(u[3]=oe(" Skill Usage ",-1))]),f("div",cA,[f("button",{onClick:u[0]||(u[0]=d=>i.value="all"),class:re(["px-3 py-1 rounded text-sm transition-colors",i.value==="all"?"bg-white dark:bg-gray-600 shadow":"hover:bg-gray-200 dark:hover:bg-gray-600"])}," All ",2),f("button",{onClick:u[1]||(u[1]=d=>i.value="universal"),class:re(["px-3 py-1 rounded text-sm transition-colors flex items-center gap-1",i.value==="universal"?"bg-white dark:bg-gray-600 shadow":"hover:bg-gray-200 dark:hover:bg-gray-600"])},[O($(Dl),{class:"w-3 h-3"}),u[4]||(u[4]=oe(" Universal ",-1))],2),f("button",{onClick:u[2]||(u[2]=d=>i.value="project"),class:re(["px-3 py-1 rounded text-sm transition-colors flex items-center gap-1",i.value==="project"?"bg-white dark:bg-gray-600 shadow":"hover:bg-gray-200 dark:hover:bg-gray-600"])},[O($(ym),{class:"w-3 h-3"}),u[5]||(u[5]=oe(" Project ",-1))],2)])]),s.value?(b(),k("div",uA,[...u[6]||(u[6]=[f("div",{class:"animate-pulse text-gray-500"},"Loading...",-1)])])):r.value?(b(),k("div",dA,A(r.value),1)):n.value.length===0?(b(),k("div",fA," No skill usage data available ")):(b(),k("div",hA,[O($(Cd),{data:o.value,options:a.value},null,8,["data","options"])])),n.value.length>0?(b(),k("div",gA,[...u[7]||(u[7]=[Bs('<div class="flex items-center gap-1"><span class="w-3 h-3 rounded bg-pink-500"></span> Universal </div><div class="flex items-center gap-1"><span class="w-3 h-3 rounded bg-sky-500"></span> Project </div><div class="flex items-center gap-1"><span class="w-3 h-3 rounded bg-gray-400"></span> Unknown </div>',3)])])):H("",!0),n.value.length>0?(b(),k("div",pA,[(b(!0),k(ae,null,ve(n.value.slice(0,4),d=>(b(),k("div",{key:d.skill_name,class:"flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded"},[f("span",mA,A(d.skill_name),1),f("span",{class:re(["px-2 py-0.5 rounded text-xs font-medium",d.success_rate>=.95?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":d.success_rate>=.8?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"])},A(Math.round(d.success_rate*100))+"% ",3)]))),128))])):H("",!0)]))}}),bA={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},xA={class:"text-lg font-semibold mb-4 flex items-center gap-2"},vA={key:0,class:"flex items-center justify-center h-48"},_A={key:1,class:"text-red-500 text-sm"},kA={key:2,class:"text-gray-500 text-center py-8"},wA={class:"grid grid-cols-3 gap-4 mb-4"},SA={class:"bg-gray-50 dark:bg-gray-700 rounded-lg p-3 text-center"},$A={class:"text-2xl font-bold text-blue-600 dark:text-blue-400"},CA={class:"bg-gray-50 dark:bg-gray-700 rounded-lg p-3 text-center"},TA={class:"text-2xl font-bold text-green-600 dark:text-green-400"},MA={class:"bg-gray-50 dark:bg-gray-700 rounded-lg p-3 text-center"},AA={class:"text-2xl font-bold text-purple-600 dark:text-purple-400"},EA={class:"h-48"},PA={class:"mt-4 space-y-2"},RA={class:"flex items-center gap-2"},DA={class:"font-medium truncate"},OA={class:"flex items-center gap-3 text-gray-500 dark:text-gray-400"},IA={class:"text-xs"},LA=Oe({__name:"MCPUsageChart",setup(t){Ws.register(Di,Oo,Io,Do);const e=We(),n=I([]),s=I(!1),r=I(null),i=["rgba(59, 130, 246, 0.8)","rgba(16, 185, 129, 0.8)","rgba(245, 158, 11, 0.8)","rgba(239, 68, 68, 0.8)","rgba(139, 92, 246, 0.8)","rgba(236, 72, 153, 0.8)","rgba(20, 184, 166, 0.8)","rgba(251, 146, 60, 0.8)"],o=le(()=>({labels:n.value.map(d=>d.mcp_server),datasets:[{data:n.value.map(d=>d.total_calls),backgroundColor:n.value.map((d,h)=>i[h%i.length]),borderColor:n.value.map((d,h)=>i[h%i.length].replace("0.8","1")),borderWidth:2}]})),a=le(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"right",labels:{color:document.documentElement.classList.contains("dark")?"#9ca3af":"#6b7280",padding:10,usePointStyle:!0}},tooltip:{callbacks:{afterLabel:d=>{const h=n.value[d.dataIndex];return[`Tools: ${h.tool_count}`,`Success rate: ${Math.round(h.success_rate*100)}%`]}}}}})),l=le(()=>n.value.reduce((d,h)=>d+h.total_calls,0)),c=le(()=>n.value.reduce((d,h)=>d+h.tool_count,0));async function u(){if(e.currentProject){s.value=!0,r.value=null;try{n.value=await Y_(e.currentProject.db_path,30)}catch(d){r.value="Failed to load MCP usage data",console.error(d)}finally{s.value=!1}}}return Ge(u),Be(()=>e.currentProject,u),(d,h)=>(b(),k("div",bA,[f("h2",xA,[O($(Sm),{class:"w-5 h-5 text-blue-500"}),h[0]||(h[0]=oe(" MCP Server Usage ",-1))]),s.value?(b(),k("div",vA,[...h[1]||(h[1]=[f("div",{class:"animate-pulse text-gray-500"},"Loading...",-1)])])):r.value?(b(),k("div",_A,A(r.value),1)):n.value.length===0?(b(),k("div",kA," No MCP usage data available ")):(b(),k(ae,{key:3},[f("div",wA,[f("div",SA,[f("div",$A,A(n.value.length),1),h[2]||(h[2]=f("div",{class:"text-xs text-gray-500 dark:text-gray-400"},"Servers",-1))]),f("div",CA,[f("div",TA,A(c.value),1),h[3]||(h[3]=f("div",{class:"text-xs text-gray-500 dark:text-gray-400"},"Tools",-1))]),f("div",MA,[f("div",AA,A(l.value.toLocaleString()),1),h[4]||(h[4]=f("div",{class:"text-xs text-gray-500 dark:text-gray-400"},"Total Calls",-1))])]),f("div",EA,[O($($M),{data:o.value,options:a.value},null,8,["data","options"])]),f("div",PA,[(b(!0),k(ae,null,ve(n.value.slice(0,5),(g,p)=>(b(),k("div",{key:g.mcp_server,class:"flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded text-sm"},[f("div",RA,[f("span",{class:"w-3 h-3 rounded-full",style:wt({backgroundColor:i[p%i.length]})},null,4),f("span",DA,A(g.mcp_server),1)]),f("div",OA,[f("span",IA,A(g.tool_count)+" tools",1),f("span",null,A(g.total_calls)+" calls",1),f("span",{class:re(["px-2 py-0.5 rounded text-xs font-medium",g.success_rate>=.95?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":g.success_rate>=.8?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"])},A(Math.round(g.success_rate*100))+"% ",3)])]))),128))])],64))]))}}),NA={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},FA={key:0,class:"lg:col-span-3 bg-gradient-to-r from-blue-50 to-purple-50 dark:from-blue-900/30 dark:to-purple-900/30 rounded-lg p-4 border border-blue-200 dark:border-blue-800"},jA={class:"flex items-center gap-2 mb-2"},zA={class:"font-semibold text-blue-900 dark:text-blue-100"},BA={class:"flex flex-wrap gap-2"},HA={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},UA={class:"text-lg font-semibold mb-4 flex items-center gap-2"},VA={class:"space-y-4"},WA={class:"flex items-center justify-between"},qA={class:"text-2xl font-bold"},KA={class:"flex items-center justify-between"},GA={class:"text-2xl font-bold"},YA={class:"flex items-center justify-between"},XA={class:"text-2xl font-bold"},JA={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},ZA={class:"text-lg font-semibold mb-4 flex items-center gap-2"},QA={class:"space-y-3"},eE={class:"w-20 text-sm capitalize truncate"},tE={class:"flex-1 h-4 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},nE={class:"w-12 text-right text-sm text-gray-600 dark:text-gray-400"},sE={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},rE={class:"text-lg font-semibold mb-4 flex items-center gap-2"},iE={class:"space-y-3"},oE={class:"w-28 text-sm capitalize truncate"},aE={class:"flex-1 h-4 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},lE={class:"w-12 text-right text-sm text-gray-600 dark:text-gray-400"},cE={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6 md:col-span-2 lg:col-span-3"},uE={class:"text-lg font-semibold mb-4 flex items-center gap-2"},dE={class:"flex flex-wrap gap-2"},fE=["onClick"],hE={class:"ml-1 text-gray-500 dark:text-gray-400"},gE=Oe({__name:"StatsPanel",setup(t){const e=We(),n=le(()=>{if(!e.stats)return[];const o=e.stats.total_count||1;return Object.entries(e.stats.by_type).map(([a,l])=>({type:a,count:l,percentage:Math.round(l/o*100),color:Ll[a]||"bg-gray-500"})).sort((a,l)=>l.count-a.count)}),s=le(()=>{if(!e.stats)return[];const o=e.stats.total_count||1;return Object.entries(e.stats.by_status).map(([a,l])=>({status:a,count:l,percentage:Math.round(l/o*100)})).sort((a,l)=>l.count-a.count)}),r=le(()=>e.tags.slice(0,15));function i(o){switch(o){case"fresh":return"bg-green-500";case"needs_review":return"bg-yellow-500";case"outdated":return"bg-red-500";case"archived":return"bg-gray-500";default:return"bg-gray-500"}}return(o,a)=>{var l,c,u;return b(),k("div",NA,[$(e).isMultiProject?(b(),k("div",FA,[f("div",jA,[O($(vm),{class:"w-5 h-5 text-blue-600 dark:text-blue-400"}),f("span",zA," Viewing "+A($(e).selectedProjects.length)+" Projects (Combined) ",1)]),f("div",BA,[(b(!0),k(ae,null,ve($(e).selectedProjects,d=>(b(),k("span",{key:d.db_path,class:"px-3 py-1 bg-white dark:bg-gray-800 rounded-full text-sm font-medium text-gray-700 dark:text-gray-300 shadow-sm"},A(d.display_name||d.name),1))),128))])])):H("",!0),f("div",HA,[f("h2",UA,[O($(Zr),{class:"w-5 h-5 text-blue-500"}),a[0]||(a[0]=oe(" Overview ",-1))]),f("div",VA,[f("div",WA,[a[1]||(a[1]=f("span",{class:"text-gray-600 dark:text-gray-400"},"Total Memories",-1)),f("span",qA,A(((l=$(e).stats)==null?void 0:l.total_count)??0),1)]),f("div",KA,[a[2]||(a[2]=f("span",{class:"text-gray-600 dark:text-gray-400"},"Avg. Importance",-1)),f("span",GA,A(((c=$(e).stats)==null?void 0:c.avg_importance)??0),1)]),f("div",YA,[a[3]||(a[3]=f("span",{class:"text-gray-600 dark:text-gray-400"},"Total Views",-1)),f("span",XA,A(((u=$(e).stats)==null?void 0:u.total_access_count)??0),1)])])]),f("div",JA,[f("h2",ZA,[O($(Cm),{class:"w-5 h-5 text-purple-500"}),a[4]||(a[4]=oe(" By Type ",-1))]),f("div",QA,[(b(!0),k(ae,null,ve(n.value,d=>(b(),k("div",{key:d.type,class:"flex items-center gap-3"},[f("div",eE,A(d.type),1),f("div",tE,[f("div",{class:re(["h-full rounded-full",d.color]),style:wt({width:`${d.percentage}%`})},null,6)]),f("div",nE,A(d.count),1)]))),128))])]),f("div",sE,[f("h2",rE,[O($(mm),{class:"w-5 h-5 text-green-500"}),a[5]||(a[5]=oe(" By Status ",-1))]),f("div",iE,[(b(!0),k(ae,null,ve(s.value,d=>(b(),k("div",{key:d.status,class:"flex items-center gap-3"},[f("div",oE,A(d.status.replace("_"," ")),1),f("div",aE,[f("div",{class:re(["h-full rounded-full",i(d.status)]),style:wt({width:`${d.percentage}%`})},null,6)]),f("div",lE,A(d.count),1)]))),128))])]),f("div",cE,[f("h2",uE,[O($(Yk),{class:"w-5 h-5 text-orange-500"}),a[6]||(a[6]=oe(" Top Tags ",-1))]),f("div",dE,[(b(!0),k(ae,null,ve(r.value,d=>(b(),k("span",{key:d.name,class:"px-3 py-1.5 bg-gray-100 dark:bg-gray-700 rounded-full text-sm hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors cursor-pointer",onClick:h=>$(e).applyFilters({tags:[d.name]})},[oe(A(d.name)+" ",1),f("span",hE,"("+A(d.count)+")",1)],8,fE))),128))])]),O(j4,{class:"lg:col-span-3"}),O(IM),O(KM,{class:"md:col-span-2"}),O(iA),O(yA),O(LA)])}}}),pE={key:0,class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Vr=Oe({__name:"LiveElapsedTime",props:{timestamp:{},compact:{type:Boolean},showIcon:{type:Boolean}},setup(t){const e=t,n=I(0);let s=null;function r(u){if(u<5e3)return"Just now";if(u<6e4)return`${Math.floor(u/1e3)}s ago`;if(u<36e5){const h=Math.floor(u/6e4),g=Math.floor(u%6e4/1e3);return e.compact?`${h}m ago`:`${h}m ${g}s ago`}if(u<864e5){const h=Math.floor(u/36e5),g=Math.floor(u%36e5/6e4);return e.compact?`${h}h ago`:`${h}h ${g}m ago`}return`${Math.floor(u/864e5)}d ago`}const i=le(()=>r(n.value));function o(){const u=new Date(e.timestamp).getTime();isNaN(u)||(n.value=Date.now()-u)}function a(){s&&clearInterval(s),o(),s=setInterval(o,1e3)}function l(){s&&(clearInterval(s),s=null)}function c(){document.hidden?l():a()}return Ge(()=>{a(),document.addEventListener("visibilitychange",c)}),tn(()=>{l(),document.removeEventListener("visibilitychange",c)}),Be(()=>e.timestamp,()=>{o()}),(u,d)=>(b(),k("span",{class:re(["inline-flex items-center gap-1 font-mono tabular-nums",t.compact?"text-xs":"text-sm","text-gray-500 dark:text-gray-400"])},[t.showIcon?(b(),k("svg",pE,[...d[0]||(d[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])):H("",!0),oe(" "+A(i.value),1)],2))}}),mE={class:"space-y-6"},yE={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4"},bE={class:"flex items-center justify-between gap-4 flex-wrap"},xE={class:"flex items-center gap-4"},vE=["value"],_E=["value"],kE={class:"flex items-center gap-2 px-3 py-1.5 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded-lg"},wE={class:"flex items-center gap-6 mt-4 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm"},SE={class:"ml-1 font-medium"},$E={class:"ml-1 font-medium text-green-600"},CE={class:"ml-1 font-medium text-red-600"},TE={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700"},ME={key:0,class:"p-8 text-center"},AE={key:1,class:"p-8 text-center"},EE={key:2,class:"divide-y divide-gray-200 dark:divide-gray-700"},PE={class:"flex items-center gap-2 mb-4"},RE={class:"text-sm font-medium text-gray-500 dark:text-gray-400 px-2"},DE={class:"space-y-3"},OE=["onClick"],IE={class:"mt-0.5 text-gray-400"},LE={class:"flex-1 min-w-0"},NE={class:"flex items-center gap-2 flex-wrap"},FE={class:"font-medium"},jE={class:"text-xs px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-700"},zE={key:0,class:"text-xs px-2 py-0.5 rounded-full bg-purple-100 dark:bg-purple-900 text-purple-700 dark:text-purple-300 flex items-center gap-1"},BE={key:1,class:"text-xs px-2 py-0.5 rounded-full bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300 flex items-center gap-1"},HE={key:2,class:"text-xs px-2 py-0.5 rounded-full bg-red-100 dark:bg-red-900 text-red-700 dark:text-red-300"},UE={class:"text-sm text-gray-600 dark:text-gray-400 mt-1 truncate"},VE={key:0,class:"text-sm text-red-600 dark:text-red-400 mt-1 truncate"},WE={key:1,class:"text-sm text-gray-500 dark:text-gray-400 mt-1 truncate font-mono"},qE={class:"text-right text-sm flex-shrink-0"},KE={key:0,class:"text-gray-400 dark:text-gray-500 mt-1"},GE={key:0,class:"px-3 pb-3 border-t border-gray-100 dark:border-gray-700 mt-2 pt-3"},YE={key:0,class:"text-center py-4 text-gray-500"},XE={class:"mb-4"},JE={class:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800"},ZE={class:"text-sm text-gray-700 dark:text-gray-300"},QE={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},e6={class:"flex items-center justify-between mb-2"},t6=["onClick"],n6={class:"text-xs bg-gray-100 dark:bg-gray-900 p-3 rounded overflow-auto max-h-64 font-mono"},s6={class:"flex items-center justify-between mb-2"},r6=["onClick"],i6={class:"text-xs bg-gray-100 dark:bg-gray-900 p-3 rounded overflow-auto max-h-64 font-mono"},o6={class:"mt-3 flex flex-wrap gap-2 text-xs"},a6={key:0,class:"px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded"},l6={class:"px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded font-mono"},c6=Oe({__name:"ActivityTimeline",setup(t){const e=We(),n=I(!1),s=I(null),r=I(null),i=I(""),o=le(()=>e.activities),a=I(new Set),l=I(new Set),c=I(new Map),u=I(null),d=["pre_tool_use","post_tool_use","decision","observation"],h=le(()=>{const C=new Set;return o.value.forEach(w=>{w.tool_name&&C.add(w.tool_name)}),Array.from(C).sort()}),g=le(()=>o.value.filter(C=>{var w,M,E;if(s.value&&C.event_type!==s.value||r.value&&C.tool_name!==r.value)return!1;if(i.value){const z=i.value.toLowerCase(),V=(w=C.command_name)==null?void 0:w.toLowerCase().includes(z),R=(M=C.skill_name)==null?void 0:M.toLowerCase().includes(z),j=(E=C.tool_name)==null?void 0:E.toLowerCase().includes(z);if(!V&&!R&&!j)return!1}return!0})),p=le(()=>{const C=new Map;return g.value.forEach(w=>{const E=new Date(w.timestamp).toLocaleDateString();C.has(E)||C.set(E,[]),C.get(E).push(w)}),C});async function m(){if(e.currentDbPath){n.value=!0;try{await e.loadActivities()}catch(C){console.error("Failed to load activities:",C)}finally{n.value=!1}}}function y(C){return C?C<1e3?`${C}ms`:`${(C/1e3).toFixed(1)}s`:"-"}function x(C){if(C.summary)return C.summary;const w=C.tool_name||"unknown";let M={};if(C.tool_input)try{M=JSON.parse(C.tool_input)}catch{}if(w==="Read")return`Read file: ${(M.file_path||C.file_path||"file").split(/[/\\]/).pop()||"file"}`;if(w==="Write")return`Write file: ${(M.file_path||C.file_path||"file").split(/[/\\]/).pop()||"file"}`;if(w==="Edit")return`Edit file: ${(M.file_path||C.file_path||"file").split(/[/\\]/).pop()||"file"}`;if(w==="Bash"){const E=(M.command||"").slice(0,40);return E?`Run: ${E}...`:"Run command"}if(w==="Grep"){const E=(M.pattern||"").slice(0,25);return E?`Search: ${E}`:"Search codebase"}if(w==="Glob"){const E=(M.pattern||"").slice(0,25);return E?`Find files: ${E}`:"Find files"}if(w==="Skill")return`Run skill: /${M.skill||"unknown"}`;if(w==="Task")return`Spawn agent: ${(M.description||"task").slice(0,30)}`;if(w==="WebSearch"){const E=(M.query||"").slice(0,25);return E?`Web search: ${E}`:"Web search"}if(w==="WebFetch"){const E=(M.url||"").slice(0,35);return E?`Fetch: ${E}`:"Fetch URL"}if(w==="TodoWrite"){const E=M.todos;return`Update todos: ${Array.isArray(E)?E.length:0} items`}if(w==="AskUserQuestion"){const E=M.questions;return`Ask user: ${Array.isArray(E)?E.length:1} question(s)`}if(w.startsWith("mcp__")){const E=w.split("__"),z=E[1]||"unknown",V=E[2]||w;return`MCP: ${z}/${V}`}if(w.includes("remember")||w.includes("cortex_remember")){const E=M.params,z=(E==null?void 0:E.content)||"";return z?`Store: ${z.slice(0,25)}...`:"Store memory"}if(w.includes("recall")||w.includes("cortex_recall")){const E=M.params,z=(E==null?void 0:E.query)||"";return z?`Recall: ${z.slice(0,25)}`:"Recall memories"}return w==="NotebookEdit"?`Edit notebook: ${(M.notebook_path||"").split(/[/\\]/).pop()||"notebook"}`:`${C.event_type.replace("_"," ")}: ${w}`}function S(C,w){if(w!=null&&w.summary_detail)return w.summary_detail;const M=C.tool_name||"unknown";let E={};const z=(w==null?void 0:w.tool_input_full)||C.tool_input;if(z)try{E=JSON.parse(z)}catch{}const V=C.success?"":"[FAILED] ";if(M==="Read"){const R=E.file_path||C.file_path||"unknown file";return`${V}Reading contents of file: ${R}`}if(M==="Write"){const R=E.file_path||C.file_path||"unknown file";return`${V}Writing or creating file at path: ${R}`}if(M==="Edit"){const R=E.file_path||C.file_path||"unknown file";return`${V}Editing file by replacing text content in: ${R}`}if(M==="Bash"){const R=E.command||"unknown command";return`${V}Executing bash command: ${R.slice(0,100)}`}if(M==="Grep"){const R=E.pattern||"",j=E.path||"codebase";return`${V}Searching for pattern "${R}" in ${j}`}if(M==="Glob"){const R=E.pattern||"";return`${V}Finding files matching glob pattern: ${R}`}if(M==="Skill"){const R=E.skill||"unknown",j=E.args||"";return`${V}Executing slash command /${R}${j?` with args: ${j}`:""}`}if(M==="Task"){const R=E.description||"task",j=E.prompt||R;return`${V}Launching sub-agent for: ${j.slice(0,80)}`}if(M==="WebSearch"){const R=E.query||"";return`${V}Searching the web for information about: ${R}`}if(M==="WebFetch"){const R=E.url||"";return`${V}Fetching and processing content from URL: ${R}`}if(M==="TodoWrite"){const R=E.todos,j=Array.isArray(R)?R.length:0;return`${V}Managing task list with ${j} todo items`}if(M==="AskUserQuestion"){const R=E.questions,j=Array.isArray(R)?R.length:1;return`${V}Prompting user for input with ${j} question(s)`}if(M.startsWith("mcp__")){const R=M.split("__"),j=R[1]||"unknown",B=R[2]||M;return`${V}Calling ${B} tool from MCP server ${j}`}if(M.includes("remember")||M.includes("cortex_remember")){const R=E.params,j=(R==null?void 0:R.content)||"";return`${V}Saving to memory system: ${j.slice(0,80)}`}if(M.includes("recall")||M.includes("cortex_recall")){const R=E.params,j=(R==null?void 0:R.query)||"";return`${V}Searching memories for: ${j}`}if(M==="NotebookEdit"){const R=E.notebook_path||"";return`${V}Editing Jupyter notebook: ${R}`}return`${V}Activity type ${C.event_type} with tool ${M}`}function T(C){switch(C){case"pre_tool_use":return Tm;case"post_tool_use":return zr;case"decision":return Zr;case"observation":return ci;default:return ao}}function v(C,w){if(!w)return"text-red-500";switch(C){case"pre_tool_use":return"text-blue-500";case"post_tool_use":return"text-green-500";case"decision":return"text-purple-500";case"observation":return"text-amber-500";default:return"text-gray-500"}}async function _(C){if(a.value.has(C))a.value.delete(C),a.value=new Set(a.value);else if(a.value.add(C),a.value=new Set(a.value),!c.value.has(C)&&e.currentDbPath){l.value.add(C),l.value=new Set(l.value);try{const w=await X_(e.currentDbPath,C);c.value.set(C,w),c.value=new Map(c.value)}catch(w){console.error("Failed to load activity details:",w)}finally{l.value.delete(C),l.value=new Set(l.value)}}}function P(C){if(!C)return"null";try{const w=JSON.parse(C);return JSON.stringify(w,null,2)}catch{return C}}async function L(C,w){try{await navigator.clipboard.writeText(C),u.value=w,setTimeout(()=>{u.value=null},2e3)}catch(M){console.error("Failed to copy:",M)}}return Ge(()=>{m()}),Be(()=>e.currentDbPath,()=>{m()}),(C,w)=>{const M=Ex("RefreshCw");return b(),k("div",mE,[f("div",yE,[f("div",bE,[f("div",xE,[f("div",null,[w[4]||(w[4]=f("label",{class:"text-sm text-gray-500 dark:text-gray-400 block mb-1"},"Event Type",-1)),Ee(f("select",{"onUpdate:modelValue":w[0]||(w[0]=E=>s.value=E),class:"px-3 py-1.5 bg-gray-100 dark:bg-gray-700 rounded-lg border-none text-sm"},[w[3]||(w[3]=f("option",{value:null},"All Events",-1)),(b(),k(ae,null,ve(d,E=>f("option",{key:E,value:E},A(E.replace("_"," ")),9,vE)),64))],512),[[cn,s.value]])]),f("div",null,[w[6]||(w[6]=f("label",{class:"text-sm text-gray-500 dark:text-gray-400 block mb-1"},"Tool",-1)),Ee(f("select",{"onUpdate:modelValue":w[1]||(w[1]=E=>r.value=E),class:"px-3 py-1.5 bg-gray-100 dark:bg-gray-700 rounded-lg border-none text-sm"},[w[5]||(w[5]=f("option",{value:null},"All Tools",-1)),(b(!0),k(ae,null,ve(h.value,E=>(b(),k("option",{key:E,value:E},A(E),9,_E))),128))],512),[[cn,r.value]])]),f("div",null,[w[7]||(w[7]=f("label",{class:"text-sm text-gray-500 dark:text-gray-400 block mb-1"},"Command/Skill",-1)),Ee(f("input",{"onUpdate:modelValue":w[2]||(w[2]=E=>i.value=E),type:"text",placeholder:"Filter by command...",class:"px-3 py-1.5 bg-gray-100 dark:bg-gray-700 rounded-lg border-none text-sm w-40"},null,512),[[rt,i.value]])])]),f("div",kE,[O($(wm),{class:"w-4 h-4 animate-pulse"}),w[8]||(w[8]=f("span",{class:"text-sm font-medium"},"Live",-1))])]),f("div",wE,[f("div",null,[w[9]||(w[9]=f("span",{class:"text-gray-500 dark:text-gray-400"},"Total:",-1)),f("span",SE,A(g.value.length),1)]),f("div",null,[w[10]||(w[10]=f("span",{class:"text-gray-500 dark:text-gray-400"},"Success:",-1)),f("span",$E,A(g.value.filter(E=>E.success).length),1)]),f("div",null,[w[11]||(w[11]=f("span",{class:"text-gray-500 dark:text-gray-400"},"Failed:",-1)),f("span",CE,A(g.value.filter(E=>!E.success).length),1)])])]),f("div",TE,[n.value?(b(),k("div",ME,[O(M,{class:"w-8 h-8 animate-spin mx-auto text-blue-600"}),w[12]||(w[12]=f("p",{class:"mt-2 text-gray-500"},"Loading activities...",-1))])):g.value.length===0?(b(),k("div",AE,[O($(ao),{class:"w-12 h-12 mx-auto text-gray-400"}),w[13]||(w[13]=f("p",{class:"mt-2 text-gray-500"},"No activities found",-1))])):(b(),k("div",EE,[(b(!0),k(ae,null,ve(p.value,([E,z])=>(b(),k("div",{key:E,class:"p-4"},[f("div",PE,[w[14]||(w[14]=f("div",{class:"h-px flex-1 bg-gray-200 dark:bg-gray-700"},null,-1)),f("span",RE,A(E),1),w[15]||(w[15]=f("div",{class:"h-px flex-1 bg-gray-200 dark:bg-gray-700"},null,-1))]),f("div",DE,[(b(!0),k(ae,null,ve(z,V=>{var R,j,B,q;return b(),k("div",{key:V.id,class:re(["rounded-lg border border-transparent hover:border-gray-200 dark:hover:border-gray-600 transition-all",$(e).isNewActivity(V.id)&&"activity-highlight"])},[f("div",{class:"flex items-start gap-3 p-3 cursor-pointer",onClick:J=>_(V.id)},[f("div",IE,[a.value.has(V.id)?(b(),pe($(Nn),{key:0,class:"w-4 h-4"})):(b(),pe($(id),{key:1,class:"w-4 h-4"}))]),f("div",{class:re(["mt-0.5",v(V.event_type,V.success)])},[(b(),pe(Vn(T(V.event_type)),{class:"w-5 h-5"}))],2),f("div",LE,[f("div",NE,[f("span",FE,A(V.tool_name||"Unknown"),1),f("span",jE,A(V.event_type.replace("_"," ")),1),V.mcp_server?(b(),k("span",zE,[O($(Sm),{class:"w-3 h-3"}),oe(" "+A(V.mcp_server),1)])):H("",!0),V.skill_name||V.command_name?(b(),k("span",BE,[O($($m),{class:"w-3 h-3"}),oe(" "+A(V.skill_name||V.command_name),1)])):H("",!0),V.success?H("",!0):(b(),k("span",HE," Failed "))]),f("p",UE,A(x(V)),1),V.error_message?(b(),k("p",VE,A(V.error_message),1)):H("",!0),V.file_path&&!V.summary?(b(),k("p",WE,A(V.file_path),1)):H("",!0)]),f("div",qE,[O(Vr,{timestamp:V.timestamp,compact:"","show-icon":""},null,8,["timestamp"]),V.duration_ms?(b(),k("div",KE,A(y(V.duration_ms)),1)):H("",!0)])],8,OE),a.value.has(V.id)?(b(),k("div",GE,[l.value.has(V.id)?(b(),k("div",YE,[O(M,{class:"w-5 h-5 animate-spin mx-auto"}),w[16]||(w[16]=f("span",{class:"text-sm"},"Loading details...",-1))])):c.value.has(V.id)?(b(),k(ae,{key:1},[f("div",XE,[f("div",JE,[f("p",ZE,A(S(V,c.value.get(V.id))),1)])]),f("div",QE,[f("div",null,[f("div",e6,[w[17]||(w[17]=f("h4",{class:"font-medium text-sm"},"Input",-1)),f("button",{onClick:pt(J=>{var ge;return L(((ge=c.value.get(V.id))==null?void 0:ge.tool_input_full)||"",V.id+"-input")},["stop"]),class:"p-1 hover:bg-gray-200 dark:hover:bg-gray-600 rounded",title:"Copy to clipboard"},[u.value===V.id+"-input"?(b(),pe($(Yt),{key:0,class:"w-4 h-4 text-green-500"})):(b(),pe($(ls),{key:1,class:"w-4 h-4 text-gray-500"}))],8,t6)]),f("pre",n6,A(P(((R=c.value.get(V.id))==null?void 0:R.tool_input_full)||null)),1)]),f("div",null,[f("div",s6,[w[18]||(w[18]=f("h4",{class:"font-medium text-sm"},"Output",-1)),f("button",{onClick:pt(J=>{var ge;return L(((ge=c.value.get(V.id))==null?void 0:ge.tool_output_full)||"",V.id+"-output")},["stop"]),class:"p-1 hover:bg-gray-200 dark:hover:bg-gray-600 rounded",title:"Copy to clipboard"},[u.value===V.id+"-output"?(b(),pe($(Yt),{key:0,class:"w-4 h-4 text-green-500"})):(b(),pe($(ls),{key:1,class:"w-4 h-4 text-gray-500"}))],8,r6)]),f("pre",i6,A(P(((j=c.value.get(V.id))==null?void 0:j.tool_output_full)||null)),1)])]),f("div",o6,[(B=c.value.get(V.id))!=null&&B.command_scope?(b(),k("span",a6," Scope: "+A((q=c.value.get(V.id))==null?void 0:q.command_scope),1)):H("",!0),f("span",l6," ID: "+A(V.id),1)])],64)):H("",!0)])):H("",!0)],2)}),128))])]))),128))]))])])}}}),u6=Po(c6,[["__scopeId","data-v-37c8fe0d"]]),d6={class:"h-full flex"},f6={key:0,class:"w-72 border-r border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 flex flex-col overflow-hidden"},h6={class:"p-3 border-b border-gray-200 dark:border-gray-700"},g6={class:"flex items-center justify-between mb-2"},p6={class:"flex gap-2 mb-2"},m6={class:"relative"},y6={class:"flex-1 overflow-y-auto p-2 space-y-1"},b6=["onClick"],x6={class:"flex items-start gap-2"},v6={class:"flex-1 min-w-0"},_6={class:"text-xs text-gray-600 dark:text-gray-300 mt-1 line-clamp-2"},k6={class:"p-2 border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"},w6={class:"text-xs text-gray-500 dark:text-gray-400"},S6={class:"flex-1 flex flex-col overflow-hidden"},$6={class:"p-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"},C6={class:"flex items-center justify-between mb-4"},T6={class:"flex items-center gap-2"},M6={class:"flex items-center gap-2"},A6={key:0,class:"p-3 bg-amber-50 dark:bg-amber-900/30 border border-amber-200 dark:border-amber-700 rounded-lg"},E6={class:"flex items-start gap-2"},P6={class:"text-sm text-amber-800 dark:text-amber-200 font-medium"},R6={key:1,class:"mb-4"},D6={class:"flex gap-2"},O6=["onClick"],I6={class:"flex items-center justify-between mb-2"},L6={class:"text-sm font-medium text-gray-700 dark:text-gray-200"},N6={class:"mb-2"},F6=["onUpdate:modelValue","onChange"],j6=["value"],z6={class:"mb-2"},B6=["onUpdate:modelValue"],H6={class:"flex gap-2"},U6={class:"flex-1"},V6=["onUpdate:modelValue"],W6=["value"],q6={class:"flex-1"},K6=["onUpdate:modelValue"],G6=["value"],Y6={key:3,class:"mt-4 flex items-center gap-2"},X6={key:4,class:"mt-4"},J6=["disabled"],Z6={key:0,class:"p-4 bg-red-50 dark:bg-red-900/30 border-b border-red-200 dark:border-red-800"},Q6={class:"flex-1 overflow-y-auto p-4 bg-gray-50 dark:bg-gray-900"},eP={key:0},tP={class:"flex items-center justify-between mb-4"},nP={class:"font-medium text-gray-800 dark:text-gray-100"},sP={key:0,class:"relative group"},rP=["src","alt","onClick"],iP={class:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2"},oP=["onClick"],aP=["onClick"],lP=["onClick"],cP={key:1,class:"p-4 flex items-center gap-2 text-red-600 dark:text-red-400"},uP={class:"text-sm"},dP={key:2,class:"p-2 border-t border-gray-100 dark:border-gray-700 text-xs text-gray-600 dark:text-gray-400"},fP={key:1,class:"h-full flex items-center justify-center"},hP={class:"text-center text-gray-500 dark:text-gray-400"},gP={class:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-2xl w-full mx-4 overflow-hidden"},pP={class:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700"},mP={class:"p-4"},yP=["src"],bP={class:"flex justify-end gap-2 p-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800"},xP=["disabled"],vP=["src"],_P={class:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2"},kP=Oe({__name:"ImageGenerationPanel",props:{chatMessages:{}},setup(t){const e=We(),n=I(!1),s=I(""),r=I([]),i=I([]),o=I(""),a=I(!0),l=I(1),c=I([v()]),u=I(!1),d=t,h=I(!1),g=I([]),p=I([]),m=I(null),y=I(""),x=I(!1),S=I(null),T=le(()=>{if(!o.value.trim())return e.memories.slice(0,50);const ie=o.value.toLowerCase();return e.memories.filter(K=>K.content.toLowerCase().includes(ie)||K.memory_type.toLowerCase().includes(ie)||K.tags.some(te=>te.toLowerCase().includes(ie))).slice(0,50)});function v(ie="custom"){return{preset:ie,custom_prompt:"",aspect_ratio:{infographic:"9:16",key_insights:"1:1",tips_tricks:"4:5",quote_card:"1:1",workflow:"16:9",comparison:"16:9",summary_card:"4:3",custom:"16:9"}[ie],image_size:"2K"}}Be(l,ie=>{for(;c.value.length<ie;)c.value.push(v());for(;c.value.length>ie;)c.value.pop()});function _(ie,K){const te=r.value.find(_e=>_e.value===K);te&&(c.value[ie].aspect_ratio=te.default_aspect)}function P(ie){const K=i.value.indexOf(ie);K>=0?i.value.splice(K,1):i.value.push(ie)}function L(){i.value=T.value.map(ie=>ie.id)}function C(){i.value=[]}function w(ie){return i.value.includes(ie)}async function M(){if(!e.currentDbPath||c.value.length===0)return;if(!(i.value.length>0||c.value.some(K=>K.custom_prompt.trim()))){p.value=["Please select memories or enter a prompt"];return}h.value=!0,p.value=[],g.value=[];try{const K=await ck(e.currentDbPath,{images:c.value,memory_ids:i.value,chat_messages:d.chatMessages||[],use_search_grounding:u.value});g.value=K.images,p.value=K.errors}catch(K){p.value=[K instanceof Error?K.message:"Failed to generate images"]}finally{h.value=!1}}async function E(){var ie;if(!(!((ie=m.value)!=null&&ie.image_id)||!y.value.trim())){x.value=!0;try{const K=await uk({image_id:m.value.image_id,refinement_prompt:y.value}),te=g.value.findIndex(_e=>{var $e;return _e.image_id===(($e=m.value)==null?void 0:$e.image_id)});te>=0&&K.success?(g.value[te]=K,j()):K.success||(p.value=[K.error||"Failed to refine image"],j())}catch(K){console.error("Refine failed:",K),p.value=[K instanceof Error?K.message:"Failed to refine image"],j()}finally{x.value=!1}}}function z(ie,K="png"){if(!ie.image_data)return;const te=document.createElement("a");te.href=`data:image/${K};base64,${ie.image_data}`,te.download=`omni-cortex-${ie.image_id||Date.now()}.${K}`,te.click()}async function V(){for(const ie of g.value)ie.success&&ie.image_data&&(z(ie),await new Promise(K=>setTimeout(K,500)))}function R(ie){m.value=ie,y.value=""}function j(){m.value=null,y.value=""}function B(ie){S.value=ie}function q(){S.value=null}async function J(){await dk(),g.value=[],p.value=[],c.value=[v()],l.value=1}const ge={decision:"bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200",solution:"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200",error:"bg-red-100 text-red-800 dark:bg-red-900/50 dark:text-red-200",fact:"bg-blue-100 text-blue-800 dark:bg-blue-900/50 dark:text-blue-200",preference:"bg-purple-100 text-purple-800 dark:bg-purple-900/50 dark:text-purple-200",progress:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/50 dark:text-cyan-200",conversation:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900/50 dark:text-indigo-200",troubleshooting:"bg-orange-100 text-orange-800 dark:bg-orange-900/50 dark:text-orange-200",other:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200"},ke=["1:1","16:9","9:16","4:3","3:4","4:5","5:4","2:3","3:2","21:9"],ye=["1K","2K","4K"];return Ge(async()=>{try{const ie=await dm();if(n.value=ie.available,s.value=ie.message,ie.available){const K=await lk();r.value=K.presets}}catch{s.value="Failed to check image generation status"}}),(ie,K)=>(b(),k("div",d6,[a.value?(b(),k("div",f6,[f("div",h6,[f("div",g6,[K[7]||(K[7]=f("h3",{class:"font-medium text-sm text-gray-700 dark:text-gray-200"},"Memory Context",-1)),f("button",{onClick:K[0]||(K[0]=te=>a.value=!1),class:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded text-gray-500 dark:text-gray-400",title:"Hide panel"},[O($(Nn),{class:"w-4 h-4"})])]),f("div",p6,[f("button",{onClick:L,class:"flex-1 text-xs px-2 py-1 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded hover:bg-blue-100 dark:hover:bg-blue-900/50"},[O($(fh),{class:"w-3 h-3 inline mr-1"}),K[8]||(K[8]=oe(" All ",-1))]),f("button",{onClick:C,class:"flex-1 text-xs px-2 py-1 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-600"},[O($(hh),{class:"w-3 h-3 inline mr-1"}),K[9]||(K[9]=oe(" None ",-1))])]),f("div",m6,[O($(lo),{class:"absolute left-2 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500"}),Ee(f("input",{"onUpdate:modelValue":K[1]||(K[1]=te=>o.value=te),type:"text",placeholder:"Search memories...",class:"w-full pl-8 pr-2 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100"},null,512),[[rt,o.value]])])]),f("div",y6,[(b(!0),k(ae,null,ve(T.value,te=>(b(),k("div",{key:te.id,onClick:_e=>P(te.id),class:re(["p-2 rounded cursor-pointer transition-colors",w(te.id)?"bg-blue-100 dark:bg-blue-900/40 border border-blue-300 dark:border-blue-700":"bg-white dark:bg-gray-700 border border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600"])},[f("div",x6,[(b(),pe(Vn(w(te.id)?$(fh):$(hh)),{class:re(["w-4 h-4 mt-0.5 flex-shrink-0",w(te.id)?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"])},null,8,["class"])),f("div",v6,[f("span",{class:re(["text-xs px-1.5 py-0.5 rounded",ge[te.memory_type]||ge.other])},A(te.memory_type),3),f("p",_6,A(te.content.substring(0,100))+A(te.content.length>100?"...":""),1)])])],10,b6))),128))]),f("div",k6,[f("span",w6,A(i.value.length)+" selected ",1)])])):H("",!0),f("div",S6,[f("div",$6,[f("div",C6,[f("div",T6,[a.value?H("",!0):(b(),k("button",{key:0,onClick:K[2]||(K[2]=te=>a.value=!0),class:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded text-gray-500 dark:text-gray-400",title:"Show memory panel"},[O($(Ps),{class:"w-4 h-4"})])),O($(Ga),{class:"w-5 h-5 text-purple-600 dark:text-purple-400"}),K[10]||(K[10]=f("h2",{class:"font-semibold text-gray-800 dark:text-gray-100"},"Image Generation",-1)),f("span",{class:re(["text-xs px-2 py-0.5 rounded-full",n.value?"bg-green-100 dark:bg-green-900/50 text-green-700 dark:text-green-300":"bg-red-100 dark:bg-red-900/50 text-red-700 dark:text-red-300"])},A(n.value?"Ready":"Unavailable"),3)]),f("div",M6,[f("button",{onClick:J,class:"flex items-center gap-1 px-3 py-1.5 text-sm text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"},[O($(en),{class:"w-4 h-4"}),K[11]||(K[11]=oe(" New Session ",-1))])])]),n.value?H("",!0):(b(),k("div",A6,[f("div",E6,[O($(Ca),{class:"w-5 h-5 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5"}),f("div",null,[f("p",P6,A(s.value),1),K[12]||(K[12]=f("p",{class:"text-xs text-amber-600 dark:text-amber-300 mt-1"}," Set GEMINI_API_KEY environment variable and install google-genai package. ",-1))])])])),n.value?(b(),k("div",R6,[K[13]||(K[13]=f("label",{class:"text-sm font-medium text-gray-700 dark:text-gray-200 mb-2 block"},"Number of Images",-1)),f("div",D6,[(b(),k(ae,null,ve([1,2,4],te=>f("button",{key:te,onClick:_e=>l.value=te,class:re(["px-4 py-2 rounded-lg text-sm font-medium transition-colors",l.value===te?"bg-purple-600 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"])},A(te),11,O6)),64))])])):H("",!0),n.value?(b(),k("div",{key:2,class:re(["grid gap-4",l.value===1?"":(l.value===2,"grid-cols-2")])},[(b(!0),k(ae,null,ve(c.value,(te,_e)=>(b(),k("div",{key:_e,class:"p-3 border border-gray-200 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700"},[f("div",I6,[f("span",L6,"Image "+A(_e+1),1)]),f("div",N6,[K[14]||(K[14]=f("label",{class:"text-xs text-gray-500 dark:text-gray-400 block mb-1"},"Preset",-1)),Ee(f("select",{"onUpdate:modelValue":$e=>te.preset=$e,onChange:$e=>_(_e,te.preset),class:"w-full px-2 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"},[(b(!0),k(ae,null,ve(r.value,$e=>(b(),k("option",{key:$e.value,value:$e.value},A($e.label),9,j6))),128))],40,F6),[[cn,te.preset]])]),f("div",z6,[K[15]||(K[15]=f("label",{class:"text-xs text-gray-500 dark:text-gray-400 block mb-1"},"Custom Prompt",-1)),Ee(f("textarea",{"onUpdate:modelValue":$e=>te.custom_prompt=$e,placeholder:"Describe what you want...",rows:"2",class:"w-full px-2 py-1.5 text-sm border border-gray-200 dark:border-gray-600 rounded resize-none bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"},null,8,B6),[[rt,te.custom_prompt]])]),f("div",H6,[f("div",U6,[K[16]||(K[16]=f("label",{class:"text-xs text-gray-500 dark:text-gray-400 block mb-1"},"Aspect",-1)),Ee(f("select",{"onUpdate:modelValue":$e=>te.aspect_ratio=$e,class:"w-full px-2 py-1 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"},[(b(),k(ae,null,ve(ke,$e=>f("option",{key:$e,value:$e},A($e),9,W6)),64))],8,V6),[[cn,te.aspect_ratio]])]),f("div",q6,[K[17]||(K[17]=f("label",{class:"text-xs text-gray-500 dark:text-gray-400 block mb-1"},"Size",-1)),Ee(f("select",{"onUpdate:modelValue":$e=>te.image_size=$e,class:"w-full px-2 py-1 text-xs border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"},[(b(),k(ae,null,ve(ye,$e=>f("option",{key:$e,value:$e},A($e),9,G6)),64))],8,K6),[[cn,te.image_size]])])])]))),128))],2)):H("",!0),n.value?(b(),k("div",Y6,[Ee(f("input",{type:"checkbox",id:"searchGrounding","onUpdate:modelValue":K[3]||(K[3]=te=>u.value=te),class:"rounded border-gray-300 dark:border-gray-600 text-purple-600 focus:ring-purple-500"},null,512),[[yr,u.value]]),K[18]||(K[18]=f("label",{for:"searchGrounding",class:"text-sm text-gray-600 dark:text-gray-300"}," Use Google Search grounding (for current events, real-time data) ",-1))])):H("",!0),n.value?(b(),k("div",X6,[f("button",{onClick:M,disabled:h.value||!$(e).currentDbPath,class:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:bg-gray-300 dark:disabled:bg-gray-600 disabled:cursor-not-allowed transition-colors"},[h.value?(b(),pe($(zn),{key:0,class:"w-5 h-5 animate-spin"})):(b(),pe($(Eo),{key:1,class:"w-5 h-5"})),oe(" "+A(h.value?"Generating...":"Generate Images"),1)],8,J6)])):H("",!0)]),p.value.length>0?(b(),k("div",Z6,[(b(!0),k(ae,null,ve(p.value,(te,_e)=>(b(),k("div",{key:_e,class:"flex items-center gap-2 text-sm text-red-700 dark:text-red-300"},[O($(Ca),{class:"w-4 h-4"}),oe(" "+A(te),1)]))),128))])):H("",!0),f("div",Q6,[g.value.length>0?(b(),k("div",eP,[f("div",tP,[f("h3",nP,"Generated Images ("+A(g.value.length)+")",1),g.value.filter(te=>te.success).length>1?(b(),k("button",{key:0,onClick:V,class:"flex items-center gap-1 px-3 py-1.5 text-sm text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"},[O($(hm),{class:"w-4 h-4"}),K[19]||(K[19]=oe(" Download All ",-1))])):H("",!0)]),f("div",{class:re(["grid gap-4",g.value.length===1?"grid-cols-1":(g.value.length===2,"grid-cols-2")])},[(b(!0),k(ae,null,ve(g.value,te=>(b(),k("div",{key:te.image_id||te.index,class:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden bg-white dark:bg-gray-800"},[te.success&&te.image_data?(b(),k("div",sP,[f("img",{src:`data:image/png;base64,${te.image_data}`,alt:`Generated image ${te.index+1}`,class:"w-full h-auto cursor-pointer",onClick:_e=>B(te)},null,8,rP),f("div",iP,[f("button",{onClick:pt(_e=>B(te),["stop"]),class:"p-2 bg-white rounded-full hover:bg-gray-100",title:"Zoom"},[O($(Mm),{class:"w-5 h-5 text-gray-700"})],8,oP),f("button",{onClick:pt(_e=>R(te),["stop"]),class:"p-2 bg-white rounded-full hover:bg-gray-100",title:"Edit"},[O($(Ya),{class:"w-5 h-5 text-gray-700"})],8,aP),f("button",{onClick:pt(_e=>z(te),["stop"]),class:"p-2 bg-white rounded-full hover:bg-gray-100",title:"Download"},[O($(xr),{class:"w-5 h-5 text-gray-700"})],8,lP)])])):(b(),k("div",cP,[O($(Ca),{class:"w-5 h-5"}),f("span",uP,A(te.error||"Failed to generate"),1)])),te.text_response?(b(),k("div",dP,A(te.text_response),1)):H("",!0)]))),128))],2)])):(b(),k("div",fP,[f("div",hP,[O($(Ga),{class:"w-12 h-12 mx-auto mb-3 text-gray-300 dark:text-gray-600"}),K[20]||(K[20]=f("p",{class:"text-sm"},"No images generated yet",-1)),K[21]||(K[21]=f("p",{class:"text-xs mt-1"},"Select memories and configure your prompts above",-1))])]))])]),(b(),pe(Gr,{to:"body"},[m.value?(b(),k("div",{key:0,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:pt(j,["self"])},[f("div",gP,[f("div",pP,[K[22]||(K[22]=f("h3",{class:"font-medium text-gray-800 dark:text-gray-100"},"Refine Image",-1)),f("button",{onClick:j,class:"p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded text-gray-500 dark:text-gray-400"},[O($(Qt),{class:"w-5 h-5"})])]),f("div",mP,[m.value.image_data?(b(),k("img",{key:0,src:`data:image/png;base64,${m.value.image_data}`,alt:"Image to edit",class:"w-full max-h-64 object-contain rounded-lg mb-4"},null,8,yP)):H("",!0),K[23]||(K[23]=f("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2"}," Refinement Prompt ",-1)),Ee(f("textarea",{"onUpdate:modelValue":K[4]||(K[4]=te=>y.value=te),placeholder:"Describe changes you want (e.g., 'Make the title larger', 'Change colors to blue theme')",rows:"3",class:"w-full px-3 py-2 border border-gray-200 dark:border-gray-600 rounded-lg resize-none bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100"},null,512),[[rt,y.value]])]),f("div",bP,[f("button",{onClick:j,class:"px-4 py-2 text-sm text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"}," Cancel "),f("button",{onClick:E,disabled:x.value||!y.value.trim(),class:"flex items-center gap-2 px-4 py-2 text-sm bg-purple-600 text-white rounded hover:bg-purple-700 disabled:bg-gray-300 dark:disabled:bg-gray-600"},[x.value?(b(),pe($(zn),{key:0,class:"w-4 h-4 animate-spin"})):H("",!0),K[24]||(K[24]=oe(" Apply Edit ",-1))],8,xP)])])])):H("",!0)])),(b(),pe(Gr,{to:"body"},[S.value?(b(),k("div",{key:0,class:"fixed inset-0 bg-black/90 flex items-center justify-center z-50",onClick:pt(q,["self"])},[f("button",{onClick:q,class:"absolute top-4 right-4 p-2 bg-white/20 rounded-full hover:bg-white/30"},[O($(Qt),{class:"w-6 h-6 text-white"})]),S.value.image_data?(b(),k("img",{key:0,src:`data:image/png;base64,${S.value.image_data}`,alt:"Zoomed image",class:"max-w-[90vw] max-h-[90vh] object-contain"},null,8,vP)):H("",!0),f("div",_P,[f("button",{onClick:K[5]||(K[5]=te=>R(S.value)),class:"flex items-center gap-2 px-4 py-2 bg-white rounded-lg hover:bg-gray-100"},[O($(Ya),{class:"w-4 h-4"}),K[25]||(K[25]=oe(" Edit ",-1))]),f("button",{onClick:K[6]||(K[6]=te=>z(S.value)),class:"flex items-center gap-2 px-4 py-2 bg-white rounded-lg hover:bg-gray-100"},[O($(xr),{class:"w-4 h-4"}),K[26]||(K[26]=oe(" Download ",-1))])])])):H("",!0)]))]))}}),wP={class:"flex flex-col h-full"},SP={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700"},$P={class:"text-lg font-semibold flex items-center gap-2"},CP={class:"flex-1 overflow-auto p-4"},TP={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},MP={class:"space-y-4"},AP={class:"flex flex-wrap gap-2"},EP=["onClick"],PP={class:"grid grid-cols-2 gap-2"},RP=["onClick"],DP={class:"font-medium text-sm"},OP={class:"text-xs text-gray-500 mt-0.5"},IP={class:"flex items-center gap-4 flex-wrap"},LP={class:"flex items-center gap-2 cursor-pointer"},NP={class:"flex items-center gap-2 cursor-pointer"},FP={class:"flex gap-2"},jP=["disabled"],zP={key:0,class:"p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg text-sm text-red-700 dark:text-red-300"},BP={class:"space-y-4"},HP={class:"flex items-center justify-between mb-2"},UP={class:"text-sm font-medium flex items-center gap-2"},VP={class:"text-sm text-indigo-600 dark:text-indigo-400 font-medium"},WP={key:0,class:"mb-4"},qP={class:"block text-sm font-medium mb-2 flex items-center gap-2"},KP={class:"p-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg text-sm"},GP={class:"flex items-center justify-between mb-2"},YP={class:"flex items-center gap-2"},XP={key:0,class:"mt-8"},JP={class:"text-sm font-medium flex items-center gap-2 mb-3"},ZP={class:"space-y-2"},QP=["onClick"],eR={class:"text-sm font-medium truncate"},tR={class:"text-xs text-gray-500 mt-1"},nR=Oe({__name:"ResponseComposer",setup(t){const e=We(),n=I(""),s=I("general"),r=I(null),i=I(50),o=I(!0),a=I(""),l=I(!1),c=I(""),u=I(""),d=I(!1),h=I([]),g=I(!1),p=I(""),m=[{value:"skool_post",label:"Skool Post",icon:Xk},{value:"dm",label:"Direct Message",icon:hs},{value:"email",label:"Email",icon:Fk},{value:"comment",label:"Comment Thread",icon:Ck},{value:"general",label:"General",icon:ci}],y=[{value:"answer",label:"Answer Question",desc:"Direct answer with explanation"},{value:"guide",label:"Provide Guidance",desc:"Step-by-step recommendations"},{value:"redirect",label:"Redirect to Resource",desc:"Point to helpful resource"},{value:"acknowledge",label:"Acknowledge & Follow-up",desc:"Validate and ask more"}],x=le(()=>i.value<25?"Very Casual":i.value<50?"Casual":i.value<75?"Professional":"Very Professional");async function S(){if(!(!n.value.trim()||!e.currentDbPath)){d.value=!0,p.value="";try{const L=await U_(e.currentDbPath,{incoming_message:n.value,context_type:s.value,template:r.value||void 0,tone_level:i.value,include_memories:o.value,custom_instructions:a.value||void 0,include_explanation:l.value});c.value=L.response,u.value=L.explanation||"",h.value.unshift(L),h.value.length>10&&(h.value=h.value.slice(0,10))}catch(L){console.error("Failed to generate response:",L),p.value=L instanceof Error?L.message:"Failed to generate response"}finally{d.value=!1}}}async function T(){await navigator.clipboard.writeText(c.value),g.value=!0,setTimeout(()=>g.value=!1,2e3)}function v(){S()}function _(L){c.value=L.response,n.value=L.incoming_message,s.value=L.context_type,i.value=L.tone_level,L.template_used&&(r.value=L.template_used),a.value=L.custom_instructions||"",u.value=L.explanation||""}function P(){n.value="",a.value="",s.value="general",r.value=null,i.value=50,o.value=!0,l.value=!1,c.value="",u.value="",p.value=""}return(L,C)=>(b(),k("div",wP,[f("div",SP,[f("h2",$P,[O($(fu),{class:"w-5 h-5 text-indigo-500"}),C[6]||(C[6]=oe(" Response Composer ",-1))]),C[7]||(C[7]=f("p",{class:"text-sm text-gray-500 mt-1"}," Paste a message and generate a response in your voice ",-1))]),f("div",CP,[f("div",TP,[f("div",MP,[f("div",null,[C[8]||(C[8]=f("label",{class:"block text-sm font-medium mb-2"},"Message Source",-1)),f("div",AP,[(b(),k(ae,null,ve(m,w=>f("button",{key:w.value,onClick:M=>s.value=w.value,class:re(["flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",s.value===w.value?"bg-indigo-100 dark:bg-indigo-900/30 text-indigo-700 dark:text-indigo-300 ring-2 ring-indigo-500":"bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600"])},[(b(),pe(Vn(w.icon),{class:"w-4 h-4"})),oe(" "+A(w.label),1)],10,EP)),64))])]),f("div",null,[C[9]||(C[9]=f("label",{class:"block text-sm font-medium mb-2"},"Incoming Message",-1)),Ee(f("textarea",{"onUpdate:modelValue":C[0]||(C[0]=w=>n.value=w),placeholder:"Paste the message you want to respond to...",rows:"8",class:"w-full p-3 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 resize-none focus:ring-2 focus:ring-indigo-500"},null,512),[[rt,n.value]])]),f("div",null,[C[10]||(C[10]=f("label",{class:"block text-sm font-medium mb-2"}," Your Instructions (Optional) ",-1)),Ee(f("textarea",{"onUpdate:modelValue":C[1]||(C[1]=w=>a.value=w),placeholder:"Add specific requirements, questions to ask, or things to include in the response...",rows:"3",class:"w-full p-3 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 resize-none focus:ring-2 focus:ring-indigo-500"},null,512),[[rt,a.value]]),C[11]||(C[11]=f("p",{class:"text-xs text-gray-500 mt-1"},' E.g., "Ask them about their timeline" or "Include a resource link" ',-1))]),f("div",null,[C[12]||(C[12]=f("label",{class:"block text-sm font-medium mb-2"},"Response Template (Optional)",-1)),f("div",PP,[(b(),k(ae,null,ve(y,w=>f("button",{key:w.value,onClick:M=>r.value=r.value===w.value?null:w.value,class:re(["p-3 rounded-lg text-left transition-colors",r.value===w.value?"bg-indigo-100 dark:bg-indigo-900/30 ring-2 ring-indigo-500":"bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700"])},[f("div",DP,A(w.label),1),f("div",OP,A(w.desc),1)],10,RP)),64))])]),f("div",IP,[f("label",LP,[Ee(f("input",{type:"checkbox","onUpdate:modelValue":C[2]||(C[2]=w=>o.value=w),class:"rounded"},null,512),[[yr,o.value]]),C[13]||(C[13]=f("span",{class:"text-sm"},"Include knowledge from memories",-1))]),f("label",NP,[Ee(f("input",{type:"checkbox","onUpdate:modelValue":C[3]||(C[3]=w=>l.value=w),class:"rounded"},null,512),[[yr,l.value]]),C[14]||(C[14]=f("span",{class:"text-sm"},"Explain message to me first",-1))])]),f("div",FP,[f("button",{onClick:S,disabled:!n.value.trim()||d.value,class:"flex-1 py-3 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 font-medium"},[d.value?(b(),pe($(en),{key:1,class:"w-5 h-5 animate-spin"})):(b(),pe($(Eo),{key:0,class:"w-5 h-5"})),oe(" "+A(d.value?"Generating...":"Generate Response"),1)],8,jP),f("button",{onClick:P,class:"px-4 py-3 text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg flex items-center gap-2 transition-colors",title:"Clear all fields"},[O($(Ek),{class:"w-4 h-4"}),C[15]||(C[15]=f("span",{class:"text-sm font-medium"},"Clear",-1))])]),p.value?(b(),k("div",zP,A(p.value),1)):H("",!0)]),f("div",BP,[f("div",null,[f("div",HP,[f("label",UP,[O($(Wk),{class:"w-4 h-4"}),C[16]||(C[16]=oe(" Tone Adjustment ",-1))]),f("span",VP,A(x.value),1)]),Ee(f("input",{type:"range","onUpdate:modelValue":C[4]||(C[4]=w=>i.value=w),min:"0",max:"100",class:"w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer accent-indigo-600"},null,512),[[rt,i.value,void 0,{number:!0}]]),C[17]||(C[17]=f("div",{class:"flex justify-between text-xs text-gray-400 mt-1"},[f("span",null,"Casual"),f("span",null,"Professional")],-1))]),u.value?(b(),k("div",WP,[f("label",qP,[O($(Ol),{class:"w-4 h-4 text-blue-500"}),C[18]||(C[18]=oe(" What This Message Means ",-1))]),f("div",KP,A(u.value),1)])):H("",!0),f("div",null,[f("div",GP,[C[19]||(C[19]=f("label",{class:"text-sm font-medium"},"Generated Response",-1)),f("div",YP,[c.value?(b(),k("button",{key:0,onClick:v,class:"p-1.5 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500",title:"Regenerate"},[O($(en),{class:"w-4 h-4"})])):H("",!0),c.value?(b(),k("button",{key:1,onClick:T,class:"flex items-center gap-1 px-3 py-1.5 bg-green-600 text-white rounded-lg hover:bg-green-700 text-sm"},[g.value?(b(),pe($(Yt),{key:0,class:"w-4 h-4"})):(b(),pe($(ls),{key:1,class:"w-4 h-4"})),oe(" "+A(g.value?"Copied!":"Copy"),1)])):H("",!0)])]),Ee(f("textarea",{"onUpdate:modelValue":C[5]||(C[5]=w=>c.value=w),placeholder:"Your response will appear here...",rows:"12",class:"w-full p-3 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 resize-none focus:ring-2 focus:ring-indigo-500"},null,512),[[rt,c.value]])])])]),h.value.length>0?(b(),k("div",XP,[f("h3",JP,[O($(Ik),{class:"w-4 h-4"}),C[20]||(C[20]=oe(" Recent Responses ",-1))]),f("div",ZP,[(b(!0),k(ae,null,ve(h.value.slice(0,5),w=>(b(),k("button",{key:w.id,onClick:M=>_(w),class:"w-full p-3 bg-gray-50 dark:bg-gray-800 rounded-lg text-left hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors"},[f("div",eR,A(w.incoming_message.slice(0,60))+"...",1),f("div",tR,A(w.context_type)+" | "+A(w.template_used||"No template"),1)],8,QP))),128))])])):H("",!0)])]))}});function Td(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $r=Td();function Cy(t){$r=t}var Qi={exec:()=>null};function Ke(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(Ht.caret,"$1"),n=n.replace(r,o),s},getRegex:()=>new RegExp(n,e)};return s}var sR=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Ht={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},rR=/^(?:[ \t]*(?:\n|$))+/,iR=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,oR=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Lo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,aR=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Md=/(?:[*+-]|\d{1,9}[.)])/,Ty=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,My=Ke(Ty).replace(/bull/g,Md).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),lR=Ke(Ty).replace(/bull/g,Md).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ad=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,cR=/^[^\n]+/,Ed=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,uR=Ke(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ed).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dR=Ke(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Md).getRegex(),Ul="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Pd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fR=Ke("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Pd).replace("tag",Ul).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ay=Ke(Ad).replace("hr",Lo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ul).getRegex(),hR=Ke(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ay).getRegex(),Rd={blockquote:hR,code:iR,def:uR,fences:oR,heading:aR,hr:Lo,html:fR,lheading:My,list:dR,newline:rR,paragraph:Ay,table:Qi,text:cR},Og=Ke("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Lo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ul).getRegex(),gR={...Rd,lheading:lR,table:Og,paragraph:Ke(Ad).replace("hr",Lo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Og).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ul).getRegex()},pR={...Rd,html:Ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Pd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Qi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ke(Ad).replace("hr",Lo).replace("heading",` *#{1,6} *[^
|
|
456
|
+
]`).replace("lheading",My).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},mR=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yR=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ey=/^( {2,}|\\)\n(?!\s*$)/,bR=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Vl=/[\p{P}\p{S}]/u,Dd=/[\s\p{P}\p{S}]/u,Py=/[^\s\p{P}\p{S}]/u,xR=Ke(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Dd).getRegex(),Ry=/(?!~)[\p{P}\p{S}]/u,vR=/(?!~)[\s\p{P}\p{S}]/u,_R=/(?:[^\s\p{P}\p{S}]|~)/u,kR=Ke(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",sR?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Dy=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,wR=Ke(Dy,"u").replace(/punct/g,Vl).getRegex(),SR=Ke(Dy,"u").replace(/punct/g,Ry).getRegex(),Oy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$R=Ke(Oy,"gu").replace(/notPunctSpace/g,Py).replace(/punctSpace/g,Dd).replace(/punct/g,Vl).getRegex(),CR=Ke(Oy,"gu").replace(/notPunctSpace/g,_R).replace(/punctSpace/g,vR).replace(/punct/g,Ry).getRegex(),TR=Ke("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Py).replace(/punctSpace/g,Dd).replace(/punct/g,Vl).getRegex(),MR=Ke(/\\(punct)/,"gu").replace(/punct/g,Vl).getRegex(),AR=Ke(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ER=Ke(Pd).replace("(?:-->|$)","-->").getRegex(),PR=Ke("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ER).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),rl=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,RR=Ke(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",rl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Iy=Ke(/^!?\[(label)\]\[(ref)\]/).replace("label",rl).replace("ref",Ed).getRegex(),Ly=Ke(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ed).getRegex(),DR=Ke("reflink|nolink(?!\\()","g").replace("reflink",Iy).replace("nolink",Ly).getRegex(),Ig=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Od={_backpedal:Qi,anyPunctuation:MR,autolink:AR,blockSkip:kR,br:Ey,code:yR,del:Qi,emStrongLDelim:wR,emStrongRDelimAst:$R,emStrongRDelimUnd:TR,escape:mR,link:RR,nolink:Ly,punctuation:xR,reflink:Iy,reflinkSearch:DR,tag:PR,text:bR,url:Qi},OR={...Od,link:Ke(/^!?\[(label)\]\((.*?)\)/).replace("label",rl).getRegex(),reflink:Ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",rl).getRegex()},wu={...Od,emStrongRDelimAst:CR,emStrongLDelim:SR,url:Ke(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ig).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ke(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ig).getRegex()},IR={...wu,br:Ke(Ey).replace("{2,}","*").getRegex(),text:Ke(wu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},la={normal:Rd,gfm:gR,pedantic:pR},vi={normal:Od,gfm:wu,breaks:IR,pedantic:OR},LR={"&":"&","<":"<",">":">",'"':""","'":"'"},Lg=t=>LR[t];function es(t,e){if(e){if(Ht.escapeTest.test(t))return t.replace(Ht.escapeReplace,Lg)}else if(Ht.escapeTestNoEncode.test(t))return t.replace(Ht.escapeReplaceNoEncode,Lg);return t}function Ng(t){try{t=encodeURI(t).replace(Ht.percentDecode,"%")}catch{return null}return t}function Fg(t,e){var i;let n=t.replace(Ht.findPipe,(o,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),s=n.split(Ht.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(Ht.slashPipe,"|");return s}function _i(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function NR(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function jg(t,e,n,s,r){let i=e.href,o=e.title||null,a=t[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}function FR(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
457
|
+
`).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(`
|
|
458
|
+
`)}var il=class{constructor(e){he(this,"options");he(this,"rules");he(this,"lexer");this.options=e||$r}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let s=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?s:_i(s,`
|
|
459
|
+
`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let s=n[0],r=FR(s,n[3]||"",this.rules);return{type:"code",raw:s,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:r}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let s=n[2].trim();if(this.rules.other.endingHash.test(s)){let r=_i(s,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(s=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:_i(n[0],`
|
|
460
|
+
`)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let s=_i(n[0],`
|
|
461
|
+
`).split(`
|
|
462
|
+
`),r="",i="",o=[];for(;s.length>0;){let a=!1,l=[],c;for(c=0;c<s.length;c++)if(this.rules.other.blockquoteStart.test(s[c]))l.push(s[c]),a=!0;else if(!a)l.push(s[c]);else break;s=s.slice(c);let u=l.join(`
|
|
463
|
+
`),d=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
464
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
465
|
+
${u}`:u,i=i?`${i}
|
|
466
|
+
${d}`:d;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,o,!0),this.lexer.state.top=h,s.length===0)break;let g=o.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){let p=g,m=p.raw+`
|
|
467
|
+
`+s.join(`
|
|
468
|
+
`),y=this.blockquote(m);o[o.length-1]=y,r=r.substring(0,r.length-p.raw.length)+y.raw,i=i.substring(0,i.length-p.text.length)+y.text;break}else if((g==null?void 0:g.type)==="list"){let p=g,m=p.raw+`
|
|
469
|
+
`+s.join(`
|
|
470
|
+
`),y=this.list(m);o[o.length-1]=y,r=r.substring(0,r.length-g.raw.length)+y.raw,i=i.substring(0,i.length-p.raw.length)+y.raw,s=m.substring(o.at(-1).raw.length).split(`
|
|
471
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(e){var s,r;let n=this.rules.block.list.exec(e);if(n){let i=n[1].trim(),o=i.length>1,a={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;e;){let d=!1,h="",g="";if(!(n=l.exec(e))||this.rules.block.hr.test(e))break;h=n[0],e=e.substring(h.length);let p=n[2].split(`
|
|
472
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,S=>" ".repeat(3*S.length)),m=e.split(`
|
|
473
|
+
`,1)[0],y=!p.trim(),x=0;if(this.options.pedantic?(x=2,g=p.trimStart()):y?x=n[1].length+1:(x=n[2].search(this.rules.other.nonSpaceChar),x=x>4?1:x,g=p.slice(x),x+=n[1].length),y&&this.rules.other.blankLine.test(m)&&(h+=m+`
|
|
474
|
+
`,e=e.substring(m.length+1),d=!0),!d){let S=this.rules.other.nextBulletRegex(x),T=this.rules.other.hrRegex(x),v=this.rules.other.fencesBeginRegex(x),_=this.rules.other.headingBeginRegex(x),P=this.rules.other.htmlBeginRegex(x);for(;e;){let L=e.split(`
|
|
475
|
+
`,1)[0],C;if(m=L,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),C=m):C=m.replace(this.rules.other.tabCharGlobal," "),v.test(m)||_.test(m)||P.test(m)||S.test(m)||T.test(m))break;if(C.search(this.rules.other.nonSpaceChar)>=x||!m.trim())g+=`
|
|
476
|
+
`+C.slice(x);else{if(y||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(p)||_.test(p)||T.test(p))break;g+=`
|
|
477
|
+
`+m}!y&&!m.trim()&&(y=!0),h+=L+`
|
|
478
|
+
`,e=e.substring(L.length+1),p=C.slice(x)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(c=!0)),a.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),a.raw+=h}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((s=d.tokens[0])==null?void 0:s.type)==="text"||((r=d.tokens[0])==null?void 0:r.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let g={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=g.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=g.raw+d.tokens[0].raw,d.tokens[0].text=g.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(g)):d.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):d.tokens.unshift(g)}}if(!a.loose){let h=d.tokens.filter(p=>p.type==="space"),g=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));a.loose=g}}if(a.loose)for(let d of a.items){d.loose=!0;for(let h of d.tokens)h.type==="text"&&(h.type="paragraph")}return a}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let s=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:s,raw:n[0],href:r,title:i}}}table(e){var a;let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let s=Fg(n[1]),r=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=n[3])!=null&&a.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
479
|
+
`):[],o={type:"table",raw:n[0],header:[],align:[],rows:[]};if(s.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<s.length;l++)o.header.push({text:s[l],tokens:this.lexer.inline(s[l]),header:!0,align:o.align[l]});for(let l of i)o.rows.push(Fg(l,o.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[u]})));return o}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let s=n[1].charAt(n[1].length-1)===`
|
|
480
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let s=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=_i(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=NR(n[2],"()");if(o===-2)return;if(o>-1){let a=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let r=n[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=n[3]?n[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),jg(n,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=n[r.toLowerCase()];if(!i){let o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return jg(s,i,s[0],this.lexer,this.rules)}}emStrong(e,n,s=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!s||this.rules.inline.punctuation.exec(s))){let i=[...r[0]].length-1,o,a,l=i,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,n=n.slice(-1*e.length+i);(r=u.exec(n))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(a=[...o].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let d=[...r[0]][0].length,h=e.slice(0,i+r.index+d+a);if(Math.min(i,a)%2){let p=h.slice(1,-1);return{type:"em",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}let g=h.slice(2,-2);return{type:"strong",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let s=n[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(s),i=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&i&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:n[0],text:s}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let s,r;return n[2]==="@"?(s=n[1],r="mailto:"+s):(s=n[1],r=s),{type:"link",raw:n[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let n;if(n=this.rules.inline.url.exec(e)){let r,i;if(n[2]==="@")r=n[0],i="mailto:"+r;else{let o;do o=n[0],n[0]=((s=this.rules.inline._backpedal.exec(n[0]))==null?void 0:s[0])??"";while(o!==n[0]);r=n[0],n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let s=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:s}}}},xn=class Su{constructor(e){he(this,"tokens");he(this,"options");he(this,"state");he(this,"inlineQueue");he(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$r,this.options.tokenizer=this.options.tokenizer||new il,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Ht,block:la.normal,inline:vi.normal};this.options.pedantic?(n.block=la.pedantic,n.inline=vi.pedantic):this.options.gfm&&(n.block=la.gfm,this.options.breaks?n.inline=vi.breaks:n.inline=vi.gfm),this.tokenizer.rules=n}static get rules(){return{block:la,inline:vi}}static lex(e,n){return new Su(n).lex(e)}static lexInline(e,n){return new Su(n).inlineTokens(e)}lex(e){e=e.replace(Ht.carriageReturn,`
|
|
481
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){var r,i,o;for(this.options.pedantic&&(e=e.replace(Ht.tabCharGlobal," ").replace(Ht.spaceLine,""));e;){let a;if((i=(r=this.options.extensions)==null?void 0:r.block)!=null&&i.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let c=n.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
|
|
482
|
+
`:n.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
483
|
+
`)?"":`
|
|
484
|
+
`)+a.raw,c.text+=`
|
|
485
|
+
`+a.text,this.inlineQueue.at(-1).src=c.text):n.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
486
|
+
`)?"":`
|
|
487
|
+
`)+a.raw,c.text+=`
|
|
488
|
+
`+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},n.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if((o=this.options.extensions)!=null&&o.startBlock){let c=1/0,u=e.slice(1),d;this.options.extensions.startBlock.forEach(h=>{d=h.call({lexer:this},u),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){let c=n.at(-1);s&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(`
|
|
489
|
+
`)?"":`
|
|
490
|
+
`)+a.raw,c.text+=`
|
|
491
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a),s=l.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
492
|
+
`)?"":`
|
|
493
|
+
`)+a.raw,c.text+=`
|
|
494
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var l,c,u,d,h;let s=e,r=null;if(this.tokens.links){let g=Object.keys(this.tokens.links);if(g.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)g.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=r[2]?r[2].length:0,s=s.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=((c=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:c.call({lexer:this},s))??s;let o=!1,a="";for(;e;){o||(a=""),o=!1;let g;if((d=(u=this.options.extensions)==null?void 0:u.inline)!=null&&d.some(m=>(g=m.call({lexer:this},e,n))?(e=e.substring(g.raw.length),n.push(g),!0):!1))continue;if(g=this.tokenizer.escape(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.tag(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.link(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(g.raw.length);let m=n.at(-1);g.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=g.raw,m.text+=g.text):n.push(g);continue}if(g=this.tokenizer.emStrong(e,s,a)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.codespan(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.br(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.del(e)){e=e.substring(g.raw.length),n.push(g);continue}if(g=this.tokenizer.autolink(e)){e=e.substring(g.raw.length),n.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(e))){e=e.substring(g.raw.length),n.push(g);continue}let p=e;if((h=this.options.extensions)!=null&&h.startInline){let m=1/0,y=e.slice(1),x;this.options.extensions.startInline.forEach(S=>{x=S.call({lexer:this},y),typeof x=="number"&&x>=0&&(m=Math.min(m,x))}),m<1/0&&m>=0&&(p=e.substring(0,m+1))}if(g=this.tokenizer.inlineText(p)){e=e.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(a=g.raw.slice(-1)),o=!0;let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=g.raw,m.text+=g.text):n.push(g);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},ol=class{constructor(t){he(this,"options");he(this,"parser");this.options=t||$r}space(t){return""}code({text:t,lang:e,escaped:n}){var i;let s=(i=(e||"").match(Ht.notSpaceStart))==null?void 0:i[0],r=t.replace(Ht.endingNewline,"")+`
|
|
495
|
+
`;return s?'<pre><code class="language-'+es(s)+'">'+(n?r:es(r,!0))+`</code></pre>
|
|
496
|
+
`:"<pre><code>"+(n?r:es(r,!0))+`</code></pre>
|
|
497
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
498
|
+
${this.parser.parse(t)}</blockquote>
|
|
499
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
500
|
+
`}hr(t){return`<hr>
|
|
501
|
+
`}list(t){let e=t.ordered,n=t.start,s="";for(let o=0;o<t.items.length;o++){let a=t.items[o];s+=this.listitem(a)}let r=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+r+i+`>
|
|
502
|
+
`+s+"</"+r+`>
|
|
503
|
+
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
504
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
505
|
+
`}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let s="";for(let r=0;r<t.rows.length;r++){let i=t.rows[r];n="";for(let o=0;o<i.length;o++)n+=this.tablecell(i[o]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
506
|
+
<thead>
|
|
507
|
+
`+e+`</thead>
|
|
508
|
+
`+s+`</table>
|
|
509
|
+
`}tablerow({text:t}){return`<tr>
|
|
510
|
+
${t}</tr>
|
|
511
|
+
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
512
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${es(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let s=this.parser.parseInline(n),r=Ng(t);if(r===null)return s;t=r;let i='<a href="'+t+'"';return e&&(i+=' title="'+es(e)+'"'),i+=">"+s+"</a>",i}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=Ng(t);if(r===null)return es(n);t=r;let i=`<img src="${t}" alt="${n}"`;return e&&(i+=` title="${es(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:es(t.text)}},Id=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},vn=class $u{constructor(e){he(this,"options");he(this,"renderer");he(this,"textRenderer");this.options=e||$r,this.options.renderer=this.options.renderer||new ol,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Id}static parse(e,n){return new $u(n).parse(e)}static parseInline(e,n){return new $u(n).parseInline(e)}parse(e){var s,r;let n="";for(let i=0;i<e.length;i++){let o=e[i];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[o.type]){let l=o,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=c||"";continue}}let a=o;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,n=this.renderer){var r,i;let s="";for(let o=0;o<e.length;o++){let a=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=c||"";continue}}let l=a;switch(l.type){case"escape":{s+=n.text(l);break}case"html":{s+=n.html(l);break}case"link":{s+=n.link(l);break}case"image":{s+=n.image(l);break}case"checkbox":{s+=n.checkbox(l);break}case"strong":{s+=n.strong(l);break}case"em":{s+=n.em(l);break}case"codespan":{s+=n.codespan(l);break}case"br":{s+=n.br(l);break}case"del":{s+=n.del(l);break}case"text":{s+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},ya,Ii=(ya=class{constructor(t){he(this,"options");he(this,"block");this.options=t||$r}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?xn.lex:xn.lexInline}provideParser(){return this.block?vn.parse:vn.parseInline}},he(ya,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),he(ya,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ya),jR=class{constructor(...t){he(this,"defaults",Td());he(this,"options",this.setOptions);he(this,"parse",this.parseMarkdown(!0));he(this,"parseInline",this.parseMarkdown(!1));he(this,"Parser",vn);he(this,"Renderer",ol);he(this,"TextRenderer",Id);he(this,"Lexer",xn);he(this,"Tokenizer",il);he(this,"Hooks",Ii);this.use(...t)}walkTokens(t,e){var s,r;let n=[];for(let i of t)switch(n=n.concat(e.call(this,i)),i.type){case"table":{let o=i;for(let a of o.header)n=n.concat(this.walkTokens(a.tokens,e));for(let a of o.rows)for(let l of a)n=n.concat(this.walkTokens(l.tokens,e));break}case"list":{let o=i;n=n.concat(this.walkTokens(o.items,e));break}default:{let o=i;(r=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&r[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let l=o[a].flat(1/0);n=n.concat(this.walkTokens(l,e))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),n.renderer){let r=this.defaults.renderer||new ol(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=n.renderer[o],l=r[o];r[o]=(...c)=>{let u=a.apply(r,c);return u===!1&&(u=l.apply(r,c)),u||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new il(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=n.tokenizer[o],l=r[o];r[o]=(...c)=>{let u=a.apply(r,c);return u===!1&&(u=l.apply(r,c)),u}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Ii;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=n.hooks[o],l=r[o];Ii.passThroughHooks.has(i)?r[o]=c=>{if(this.defaults.async&&Ii.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await a.call(r,c);return l.call(r,d)})();let u=a.call(r,c);return l.call(r,u)}:r[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(r,c);return d===!1&&(d=await l.apply(r,c)),d})();let u=a.apply(r,c);return u===!1&&(u=l.apply(r,c)),u}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return xn.lex(t,e??this.defaults)}parser(t,e){return vn.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer():t?xn.lex:xn.lexInline)(o,r),l=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser():t?vn.parse:vn.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer():t?xn.lex:xn.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let a=(r.hooks?r.hooks.provideParser():t?vn.parse:vn.parseInline)(o,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(t,e){return n=>{if(n.message+=`
|
|
513
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+es(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},kr=new jR;function Ze(t,e){return kr.parse(t,e)}Ze.options=Ze.setOptions=function(t){return kr.setOptions(t),Ze.defaults=kr.defaults,Cy(Ze.defaults),Ze};Ze.getDefaults=Td;Ze.defaults=$r;Ze.use=function(...t){return kr.use(...t),Ze.defaults=kr.defaults,Cy(Ze.defaults),Ze};Ze.walkTokens=function(t,e){return kr.walkTokens(t,e)};Ze.parseInline=kr.parseInline;Ze.Parser=vn;Ze.parser=vn.parse;Ze.Renderer=ol;Ze.TextRenderer=Id;Ze.Lexer=xn;Ze.lexer=xn.lex;Ze.Tokenizer=il;Ze.Hooks=Ii;Ze.parse=Ze;Ze.options;Ze.setOptions;Ze.use;Ze.walkTokens;Ze.parseInline;vn.parse;xn.lex;const zR={class:"flex items-center gap-2 mb-2"},BR={class:"text-xs text-gray-500 dark:text-gray-400 font-mono"},HR={class:"text-sm text-gray-700 dark:text-gray-300 line-clamp-4"},UR={key:0,class:"mt-2 flex flex-wrap gap-1"},VR={key:0,class:"text-xs px-1.5 py-0.5 text-gray-500 dark:text-gray-400"},WR=Oe({__name:"SourceTooltip",props:{source:{},position:{}},setup(t){const e={decision:"bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200",solution:"bg-emerald-100 text-emerald-800 dark:bg-emerald-900 dark:text-emerald-200",error:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",fact:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",preference:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",progress:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-200",conversation:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200",troubleshooting:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",other:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200"};function n(s){return e[s]||e.other}return(s,r)=>{var i;return b(),k("div",{class:"fixed z-50 w-80 p-3 bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-600 pointer-events-none",style:wt({top:t.position.y+"px",left:t.position.x+"px"})},[f("div",zR,[f("span",{class:re([n(t.source.type),"px-2 py-0.5 text-xs rounded font-medium"])},A(t.source.type),3),f("span",BR,A(t.source.id.slice(0,16))+"... ",1)]),f("p",HR,A(t.source.content_preview),1),(i=t.source.tags)!=null&&i.length?(b(),k("div",UR,[(b(!0),k(ae,null,ve(t.source.tags.slice(0,5),o=>(b(),k("span",{key:o,class:"text-xs px-1.5 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded"},A(o),1))),128)),t.source.tags.length>5?(b(),k("span",VR," +"+A(t.source.tags.length-5)+" more ",1)):H("",!0)])):H("",!0)],4)}}}),qR=Po(WR,[["__scopeId","data-v-226e6fe9"]]);/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Ny,setPrototypeOf:zg,isFrozen:KR,getPrototypeOf:GR,getOwnPropertyDescriptor:YR}=Object;let{freeze:Ut,seal:yn,create:Cu}=Object,{apply:Tu,construct:Mu}=typeof Reflect<"u"&&Reflect;Ut||(Ut=function(e){return e});yn||(yn=function(e){return e});Tu||(Tu=function(e,n){for(var s=arguments.length,r=new Array(s>2?s-2:0),i=2;i<s;i++)r[i-2]=arguments[i];return e.apply(n,r)});Mu||(Mu=function(e){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return new e(...s)});const ca=Vt(Array.prototype.forEach),XR=Vt(Array.prototype.lastIndexOf),Bg=Vt(Array.prototype.pop),ki=Vt(Array.prototype.push),JR=Vt(Array.prototype.splice),Ra=Vt(String.prototype.toLowerCase),Ac=Vt(String.prototype.toString),Ec=Vt(String.prototype.match),wi=Vt(String.prototype.replace),ZR=Vt(String.prototype.indexOf),QR=Vt(String.prototype.trim),bn=Vt(Object.prototype.hasOwnProperty),Lt=Vt(RegExp.prototype.test),Si=eD(TypeError);function Vt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return Tu(t,e,s)}}function eD(t){return function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return Mu(t,n)}}function He(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ra;zg&&zg(t,null);let s=e.length;for(;s--;){let r=e[s];if(typeof r=="string"){const i=n(r);i!==r&&(KR(e)||(e[s]=i),r=i)}t[r]=!0}return t}function tD(t){for(let e=0;e<t.length;e++)bn(t,e)||(t[e]=null);return t}function Dn(t){const e=Cu(null);for(const[n,s]of Ny(t))bn(t,n)&&(Array.isArray(s)?e[n]=tD(s):s&&typeof s=="object"&&s.constructor===Object?e[n]=Dn(s):e[n]=s);return e}function $i(t,e){for(;t!==null;){const s=YR(t,e);if(s){if(s.get)return Vt(s.get);if(typeof s.value=="function")return Vt(s.value)}t=GR(t)}function n(){return null}return n}const Hg=Ut(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pc=Ut(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Rc=Ut(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),nD=Ut(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Dc=Ut(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),sD=Ut(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ug=Ut(["#text"]),Vg=Ut(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Oc=Ut(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wg=Ut(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ua=Ut(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rD=yn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),iD=yn(/<%[\w\W]*|[\w\W]*%>/gm),oD=yn(/\$\{[\w\W]*/gm),aD=yn(/^data-[\-\w.\u00B7-\uFFFF]+$/),lD=yn(/^aria-[\-\w]+$/),Fy=yn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cD=yn(/^(?:\w+script|data):/i),uD=yn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jy=yn(/^html$/i),dD=yn(/^[a-z][.\w]*(-[.\w]+)+$/i);var qg=Object.freeze({__proto__:null,ARIA_ATTR:lD,ATTR_WHITESPACE:uD,CUSTOM_ELEMENT:dD,DATA_ATTR:aD,DOCTYPE_NAME:jy,ERB_EXPR:iD,IS_ALLOWED_URI:Fy,IS_SCRIPT_OR_DATA:cD,MUSTACHE_EXPR:rD,TMPLIT_EXPR:oD});const Ci={element:1,text:3,progressingInstruction:7,comment:8,document:9},fD=function(){return typeof window>"u"?null:window},hD=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(s=n.getAttribute(r));const i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Kg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function zy(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fD();const e=Me=>zy(Me);if(e.version="3.3.1",e.removed=[],!t||!t.document||t.document.nodeType!==Ci.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const s=n,r=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:g}=t,p=l.prototype,m=$i(p,"cloneNode"),y=$i(p,"remove"),x=$i(p,"nextSibling"),S=$i(p,"childNodes"),T=$i(p,"parentNode");if(typeof o=="function"){const Me=n.createElement("template");Me.content&&Me.content.ownerDocument&&(n=Me.content.ownerDocument)}let v,_="";const{implementation:P,createNodeIterator:L,createDocumentFragment:C,getElementsByTagName:w}=n,{importNode:M}=s;let E=Kg();e.isSupported=typeof Ny=="function"&&typeof T=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:V,TMPLIT_EXPR:R,DATA_ATTR:j,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:J,CUSTOM_ELEMENT:ge}=qg;let{IS_ALLOWED_URI:ke}=qg,ye=null;const ie=He({},[...Hg,...Pc,...Rc,...Dc,...Ug]);let K=null;const te=He({},[...Vg,...Oc,...Wg,...ua]);let _e=Object.seal(Cu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$e=null,it=null;const lt=Object.seal(Cu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,It=!0,qs=!1,D=!0,F=!1,G=!0,ee=!1,Z=!1,Q=!1,de=!1,fe=!1,ce=!1,se=!0,Ce=!1;const be="user-content-";let we=!0,Te=!1,Re={},Le=null;const je=He({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ne=null;const xe=He({},["audio","video","img","source","image","track"]);let Ne=null;const ot=He({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kt="http://www.w3.org/1998/Math/MathML",ut="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml";let xt=Ye,vs=!1,_s=null;const X=He({},[kt,ut,Ye],Ac);let U=He({},["mi","mo","mn","ms","mtext"]),Y=He({},["annotation-xml"]);const qe=He({},["title","style","font","a","script"]);let ze=null;const sn=["application/xhtml+xml","text/html"],Cr="text/html";let vt=null,Tr=null;const pb=n.createElement("form"),qd=function(N){return N instanceof RegExp||N instanceof Function},Gl=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Tr&&Tr===N)){if((!N||typeof N!="object")&&(N={}),N=Dn(N),ze=sn.indexOf(N.PARSER_MEDIA_TYPE)===-1?Cr:N.PARSER_MEDIA_TYPE,vt=ze==="application/xhtml+xml"?Ac:Ra,ye=bn(N,"ALLOWED_TAGS")?He({},N.ALLOWED_TAGS,vt):ie,K=bn(N,"ALLOWED_ATTR")?He({},N.ALLOWED_ATTR,vt):te,_s=bn(N,"ALLOWED_NAMESPACES")?He({},N.ALLOWED_NAMESPACES,Ac):X,Ne=bn(N,"ADD_URI_SAFE_ATTR")?He(Dn(ot),N.ADD_URI_SAFE_ATTR,vt):ot,ne=bn(N,"ADD_DATA_URI_TAGS")?He(Dn(xe),N.ADD_DATA_URI_TAGS,vt):xe,Le=bn(N,"FORBID_CONTENTS")?He({},N.FORBID_CONTENTS,vt):je,$e=bn(N,"FORBID_TAGS")?He({},N.FORBID_TAGS,vt):Dn({}),it=bn(N,"FORBID_ATTR")?He({},N.FORBID_ATTR,vt):Dn({}),Re=bn(N,"USE_PROFILES")?N.USE_PROFILES:!1,nn=N.ALLOW_ARIA_ATTR!==!1,It=N.ALLOW_DATA_ATTR!==!1,qs=N.ALLOW_UNKNOWN_PROTOCOLS||!1,D=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,F=N.SAFE_FOR_TEMPLATES||!1,G=N.SAFE_FOR_XML!==!1,ee=N.WHOLE_DOCUMENT||!1,de=N.RETURN_DOM||!1,fe=N.RETURN_DOM_FRAGMENT||!1,ce=N.RETURN_TRUSTED_TYPE||!1,Q=N.FORCE_BODY||!1,se=N.SANITIZE_DOM!==!1,Ce=N.SANITIZE_NAMED_PROPS||!1,we=N.KEEP_CONTENT!==!1,Te=N.IN_PLACE||!1,ke=N.ALLOWED_URI_REGEXP||Fy,xt=N.NAMESPACE||Ye,U=N.MATHML_TEXT_INTEGRATION_POINTS||U,Y=N.HTML_INTEGRATION_POINTS||Y,_e=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&qd(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(_e.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&qd(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(_e.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(_e.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),F&&(It=!1),fe&&(de=!0),Re&&(ye=He({},Ug),K=[],Re.html===!0&&(He(ye,Hg),He(K,Vg)),Re.svg===!0&&(He(ye,Pc),He(K,Oc),He(K,ua)),Re.svgFilters===!0&&(He(ye,Rc),He(K,Oc),He(K,ua)),Re.mathMl===!0&&(He(ye,Dc),He(K,Wg),He(K,ua))),N.ADD_TAGS&&(typeof N.ADD_TAGS=="function"?lt.tagCheck=N.ADD_TAGS:(ye===ie&&(ye=Dn(ye)),He(ye,N.ADD_TAGS,vt))),N.ADD_ATTR&&(typeof N.ADD_ATTR=="function"?lt.attributeCheck=N.ADD_ATTR:(K===te&&(K=Dn(K)),He(K,N.ADD_ATTR,vt))),N.ADD_URI_SAFE_ATTR&&He(Ne,N.ADD_URI_SAFE_ATTR,vt),N.FORBID_CONTENTS&&(Le===je&&(Le=Dn(Le)),He(Le,N.FORBID_CONTENTS,vt)),N.ADD_FORBID_CONTENTS&&(Le===je&&(Le=Dn(Le)),He(Le,N.ADD_FORBID_CONTENTS,vt)),we&&(ye["#text"]=!0),ee&&He(ye,["html","head","body"]),ye.table&&(He(ye,["tbody"]),delete $e.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Si('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Si('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=N.TRUSTED_TYPES_POLICY,_=v.createHTML("")}else v===void 0&&(v=hD(g,r)),v!==null&&typeof _=="string"&&(_=v.createHTML(""));Ut&&Ut(N),Tr=N}},Kd=He({},[...Pc,...Rc,...nD]),Gd=He({},[...Dc,...sD]),mb=function(N){let ue=T(N);(!ue||!ue.tagName)&&(ue={namespaceURI:xt,tagName:"template"});const Se=Ra(N.tagName),ct=Ra(ue.tagName);return _s[N.namespaceURI]?N.namespaceURI===ut?ue.namespaceURI===Ye?Se==="svg":ue.namespaceURI===kt?Se==="svg"&&(ct==="annotation-xml"||U[ct]):!!Kd[Se]:N.namespaceURI===kt?ue.namespaceURI===Ye?Se==="math":ue.namespaceURI===ut?Se==="math"&&Y[ct]:!!Gd[Se]:N.namespaceURI===Ye?ue.namespaceURI===ut&&!Y[ct]||ue.namespaceURI===kt&&!U[ct]?!1:!Gd[Se]&&(qe[Se]||!Kd[Se]):!!(ze==="application/xhtml+xml"&&_s[N.namespaceURI]):!1},Mn=function(N){ki(e.removed,{element:N});try{T(N).removeChild(N)}catch{y(N)}},Ks=function(N,ue){try{ki(e.removed,{attribute:ue.getAttributeNode(N),from:ue})}catch{ki(e.removed,{attribute:null,from:ue})}if(ue.removeAttribute(N),N==="is")if(de||fe)try{Mn(ue)}catch{}else try{ue.setAttribute(N,"")}catch{}},Yd=function(N){let ue=null,Se=null;if(Q)N="<remove></remove>"+N;else{const yt=Ec(N,/^[\r\n\t ]+/);Se=yt&&yt[0]}ze==="application/xhtml+xml"&&xt===Ye&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const ct=v?v.createHTML(N):N;if(xt===Ye)try{ue=new h().parseFromString(ct,ze)}catch{}if(!ue||!ue.documentElement){ue=P.createDocument(xt,"template",null);try{ue.documentElement.innerHTML=vs?_:ct}catch{}}const Ct=ue.body||ue.documentElement;return N&&Se&&Ct.insertBefore(n.createTextNode(Se),Ct.childNodes[0]||null),xt===Ye?w.call(ue,ee?"html":"body")[0]:ee?ue.documentElement:Ct},Xd=function(N){return L.call(N.ownerDocument||N,N,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Yl=function(N){return N instanceof d&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof u)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},Jd=function(N){return typeof a=="function"&&N instanceof a};function qn(Me,N,ue){ca(Me,Se=>{Se.call(e,N,ue,Tr)})}const Zd=function(N){let ue=null;if(qn(E.beforeSanitizeElements,N,null),Yl(N))return Mn(N),!0;const Se=vt(N.nodeName);if(qn(E.uponSanitizeElement,N,{tagName:Se,allowedTags:ye}),G&&N.hasChildNodes()&&!Jd(N.firstElementChild)&&Lt(/<[/\w!]/g,N.innerHTML)&&Lt(/<[/\w!]/g,N.textContent)||N.nodeType===Ci.progressingInstruction||G&&N.nodeType===Ci.comment&&Lt(/<[/\w]/g,N.data))return Mn(N),!0;if(!(lt.tagCheck instanceof Function&<.tagCheck(Se))&&(!ye[Se]||$e[Se])){if(!$e[Se]&&ef(Se)&&(_e.tagNameCheck instanceof RegExp&&Lt(_e.tagNameCheck,Se)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(Se)))return!1;if(we&&!Le[Se]){const ct=T(N)||N.parentNode,Ct=S(N)||N.childNodes;if(Ct&&ct){const yt=Ct.length;for(let qt=yt-1;qt>=0;--qt){const Kn=m(Ct[qt],!0);Kn.__removalCount=(N.__removalCount||0)+1,ct.insertBefore(Kn,x(N))}}}return Mn(N),!0}return N instanceof l&&!mb(N)||(Se==="noscript"||Se==="noembed"||Se==="noframes")&&Lt(/<\/no(script|embed|frames)/i,N.innerHTML)?(Mn(N),!0):(F&&N.nodeType===Ci.text&&(ue=N.textContent,ca([z,V,R],ct=>{ue=wi(ue,ct," ")}),N.textContent!==ue&&(ki(e.removed,{element:N.cloneNode()}),N.textContent=ue)),qn(E.afterSanitizeElements,N,null),!1)},Qd=function(N,ue,Se){if(se&&(ue==="id"||ue==="name")&&(Se in n||Se in pb))return!1;if(!(It&&!it[ue]&&Lt(j,ue))){if(!(nn&&Lt(B,ue))){if(!(lt.attributeCheck instanceof Function&<.attributeCheck(ue,N))){if(!K[ue]||it[ue]){if(!(ef(N)&&(_e.tagNameCheck instanceof RegExp&&Lt(_e.tagNameCheck,N)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(N))&&(_e.attributeNameCheck instanceof RegExp&&Lt(_e.attributeNameCheck,ue)||_e.attributeNameCheck instanceof Function&&_e.attributeNameCheck(ue,N))||ue==="is"&&_e.allowCustomizedBuiltInElements&&(_e.tagNameCheck instanceof RegExp&&Lt(_e.tagNameCheck,Se)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(Se))))return!1}else if(!Ne[ue]){if(!Lt(ke,wi(Se,J,""))){if(!((ue==="src"||ue==="xlink:href"||ue==="href")&&N!=="script"&&ZR(Se,"data:")===0&&ne[N])){if(!(qs&&!Lt(q,wi(Se,J,"")))){if(Se)return!1}}}}}}}return!0},ef=function(N){return N!=="annotation-xml"&&Ec(N,ge)},tf=function(N){qn(E.beforeSanitizeAttributes,N,null);const{attributes:ue}=N;if(!ue||Yl(N))return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K,forceKeepAttr:void 0};let ct=ue.length;for(;ct--;){const Ct=ue[ct],{name:yt,namespaceURI:qt,value:Kn}=Ct,Mr=vt(yt),Xl=Kn;let $t=yt==="value"?Xl:QR(Xl);if(Se.attrName=Mr,Se.attrValue=$t,Se.keepAttr=!0,Se.forceKeepAttr=void 0,qn(E.uponSanitizeAttribute,N,Se),$t=Se.attrValue,Ce&&(Mr==="id"||Mr==="name")&&(Ks(yt,N),$t=be+$t),G&&Lt(/((--!?|])>)|<\/(style|title|textarea)/i,$t)){Ks(yt,N);continue}if(Mr==="attributename"&&Ec($t,"href")){Ks(yt,N);continue}if(Se.forceKeepAttr)continue;if(!Se.keepAttr){Ks(yt,N);continue}if(!D&&Lt(/\/>/i,$t)){Ks(yt,N);continue}F&&ca([z,V,R],sf=>{$t=wi($t,sf," ")});const nf=vt(N.nodeName);if(!Qd(nf,Mr,$t)){Ks(yt,N);continue}if(v&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!qt)switch(g.getAttributeType(nf,Mr)){case"TrustedHTML":{$t=v.createHTML($t);break}case"TrustedScriptURL":{$t=v.createScriptURL($t);break}}if($t!==Xl)try{qt?N.setAttributeNS(qt,yt,$t):N.setAttribute(yt,$t),Yl(N)?Mn(N):Bg(e.removed)}catch{Ks(yt,N)}}qn(E.afterSanitizeAttributes,N,null)},yb=function Me(N){let ue=null;const Se=Xd(N);for(qn(E.beforeSanitizeShadowDOM,N,null);ue=Se.nextNode();)qn(E.uponSanitizeShadowNode,ue,null),Zd(ue),tf(ue),ue.content instanceof i&&Me(ue.content);qn(E.afterSanitizeShadowDOM,N,null)};return e.sanitize=function(Me){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ue=null,Se=null,ct=null,Ct=null;if(vs=!Me,vs&&(Me="<!-->"),typeof Me!="string"&&!Jd(Me))if(typeof Me.toString=="function"){if(Me=Me.toString(),typeof Me!="string")throw Si("dirty is not a string, aborting")}else throw Si("toString is not a function");if(!e.isSupported)return Me;if(Z||Gl(N),e.removed=[],typeof Me=="string"&&(Te=!1),Te){if(Me.nodeName){const Kn=vt(Me.nodeName);if(!ye[Kn]||$e[Kn])throw Si("root node is forbidden and cannot be sanitized in-place")}}else if(Me instanceof a)ue=Yd("<!---->"),Se=ue.ownerDocument.importNode(Me,!0),Se.nodeType===Ci.element&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?ue=Se:ue.appendChild(Se);else{if(!de&&!F&&!ee&&Me.indexOf("<")===-1)return v&&ce?v.createHTML(Me):Me;if(ue=Yd(Me),!ue)return de?null:ce?_:""}ue&&Q&&Mn(ue.firstChild);const yt=Xd(Te?Me:ue);for(;ct=yt.nextNode();)Zd(ct),tf(ct),ct.content instanceof i&&yb(ct.content);if(Te)return Me;if(de){if(fe)for(Ct=C.call(ue.ownerDocument);ue.firstChild;)Ct.appendChild(ue.firstChild);else Ct=ue;return(K.shadowroot||K.shadowrootmode)&&(Ct=M.call(s,Ct,!0)),Ct}let qt=ee?ue.outerHTML:ue.innerHTML;return ee&&ye["!doctype"]&&ue.ownerDocument&&ue.ownerDocument.doctype&&ue.ownerDocument.doctype.name&&Lt(jy,ue.ownerDocument.doctype.name)&&(qt="<!DOCTYPE "+ue.ownerDocument.doctype.name+`>
|
|
514
|
+
`+qt),F&&ca([z,V,R],Kn=>{qt=wi(qt,Kn," ")}),v&&ce?v.createHTML(qt):qt},e.setConfig=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gl(Me),Z=!0},e.clearConfig=function(){Tr=null,Z=!1},e.isValidAttribute=function(Me,N,ue){Tr||Gl({});const Se=vt(Me),ct=vt(N);return Qd(Se,ct,ue)},e.addHook=function(Me,N){typeof N=="function"&&ki(E[Me],N)},e.removeHook=function(Me,N){if(N!==void 0){const ue=XR(E[Me],N);return ue===-1?void 0:JR(E[Me],ue,1)[0]}return Bg(E[Me])},e.removeHooks=function(Me){E[Me]=[]},e.removeAllHooks=function(){E=Kg()},e}var gD=zy();function pD(t){return gD.sanitize(t,{ALLOWED_TAGS:["p","br","strong","em","u","s","code","pre","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","a","img","table","thead","tbody","tr","th","td","span","div","mark"],ALLOWED_ATTR:["href","src","alt","title","class","target","rel","data-memory-index"],ALLOW_DATA_ATTR:!1,ADD_ATTR:["target"]})}function mD(t){return pD(t)}const yD={class:"flex flex-col h-full bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700"},bD={class:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},xD={class:"flex items-center gap-3"},vD={class:"flex rounded-lg bg-gray-100 dark:bg-gray-700 p-0.5"},_D={class:"font-semibold"},kD={class:"flex items-center gap-2"},wD={key:1,class:"relative"},SD={key:0,class:"absolute right-0 mt-1 w-48 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 z-50"},$D={key:0,class:"px-4 py-2 border-b border-gray-200 dark:border-gray-700 flex items-center gap-2 bg-gray-50 dark:bg-gray-900"},CD={key:0,class:"text-xs text-gray-500"},TD={key:0,class:"flex-1 flex items-center justify-center p-6"},MD={class:"text-center"},AD={class:"text-gray-500 dark:text-gray-400 text-sm mb-4"},ED={key:0,class:"h-full flex items-center justify-center"},PD={class:"text-center text-gray-500 dark:text-gray-400 max-w-md"},RD={class:"flex flex-wrap justify-center gap-2"},DD=["onClick"],OD=["id"],ID={key:0,class:"flex-shrink-0 w-8 h-8 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center"},LD={class:"max-w-[80%] flex flex-col"},ND={key:0,class:"space-y-2"},FD=["onUpdate:modelValue","onKeydown"],jD={class:"flex gap-2 justify-end"},zD=["onClick"],BD=["onClick"],HD=["innerHTML"],UD={key:1},VD=["onClick","innerHTML"],WD={key:0,class:"flex items-center gap-1 mt-2"},qD={key:2,class:"mt-3 pt-3 border-t border-gray-200 dark:border-gray-600"},KD=["onClick"],GD={class:"mt-2 space-y-1"},YD=["onClick","onMouseenter"],XD=["title"],JD={class:"flex-1 text-gray-600 dark:text-gray-300 truncate"},ZD=["onClick","title"],QD=["onClick"],eO={key:1,class:"flex flex-wrap gap-2 mt-2"},tO={key:1,class:"flex-shrink-0 w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center"},nO={key:1,class:"flex gap-3"},sO={class:"w-8 h-8 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center"},rO={class:"bg-gray-100 dark:bg-gray-700 rounded-lg p-3 flex items-center gap-3"},iO={class:"text-sm"},oO={class:"text-gray-400 dark:text-gray-500 ml-1"},aO={class:"p-4 border-t border-gray-200 dark:border-gray-700"},lO={class:"flex items-center justify-between px-2 py-2 mb-2 border-b border-gray-100 dark:border-gray-600"},cO={class:"flex items-center gap-4"},uO={class:"flex items-center gap-2 cursor-pointer"},dO={class:"text-sm font-medium flex items-center gap-1.5 text-gray-700 dark:text-gray-300"},fO={key:0,class:"text-xs px-2 py-1 bg-indigo-100 dark:bg-indigo-900/30 text-indigo-700 dark:text-indigo-300 rounded-full flex items-center gap-1"},hO={key:1,class:"text-xs text-gray-500 flex items-center gap-1"},gO={class:"flex items-center gap-2"},pO={key:0,class:"flex justify-end mb-2"},mO=["disabled"],yO={class:"flex gap-2"},bO={class:"flex-1 relative"},xO=["disabled"],vO=["disabled"],_O={key:1,class:"flex justify-center mt-2"},kO={class:"bg-white dark:bg-gray-800 rounded-lg p-6 max-w-md w-full mx-4 shadow-xl"},Ic=4e3,wO=Oe({__name:"ChatPanel",emits:["navigate-to-memory"],setup(t,{emit:e}){Ze.setOptions({breaks:!0,gfm:!0});const n=We(),s=I([]),r=I(""),i=I(!1),o=I(!1),a=I(!1),l=I(""),c=I(null),u=I(null),d=I(0);let h=null,g=null;const p=I(null),m=I({x:0,y:0});let y=null;const x=I(!1),S=I(!1),T=I(null),v=I(!1),_=I(!1),P=I(""),L=I([]),C=I(0),w=I(!1),M=I("chat"),E=I(!1),z=I(null),V=I(!1),R={decision:"bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200",solution:"bg-emerald-100 text-emerald-800 dark:bg-emerald-900 dark:text-emerald-200",error:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",fact:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",preference:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",progress:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-200",conversation:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200",troubleshooting:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",other:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200"},j=["What decisions have I made about authentication?","Summarize my recent solutions","What errors have I encountered with Vue?","Show me patterns I use frequently","What are my coding preferences?"],B=le(()=>r.value.length);Ge(async()=>{await ke(),document.addEventListener("keydown",$e)}),tn(()=>{J(),ou(),g&&g(),document.removeEventListener("keydown",$e)}),Be(()=>n.currentDbPath,()=>{S.value=!1,T.value=null}),Be(E,async X=>{if(X&&!z.value&&n.currentDbPath){V.value=!0;try{z.value=await yk(n.currentDbPath)}catch(U){console.error("Failed to load style profile:",U),E.value=!1}finally{V.value=!1}}});function q(){d.value=0,h=setInterval(()=>{d.value++},1e3)}function J(){h&&(clearInterval(h),h=null),d.value=0}function ge(){ou(),g&&(g(),g=null),J(),i.value=!1,o.value=!1;const X=s.value[s.value.length-1];if(X!=null&&X.isStreaming)X.isStreaming=!1,X.content+=`
|
|
515
|
+
|
|
516
|
+
*[Cancelled]*`;else{const U={id:`msg_${Date.now()}_cancelled`,role:"assistant",content:"Request cancelled.",timestamp:new Date,error:!1};s.value.push(U)}te()}async function ke(){if(n.currentDbPath)try{const X=await um(n.currentDbPath);a.value=X.available,l.value=X.message}catch{a.value=!1,l.value="Failed to check chat status"}}async function ye(){if(!r.value.trim()||i.value||!n.currentDbPath)return;const X=r.value.trim();r.value="",S.value=!1,T.value=null;const U={id:`msg_${Date.now()}_user`,role:"user",content:X,timestamp:new Date};s.value.push(U),te(),await ie(X)}async function ie(X){i.value=!0,o.value=!0,q();const U={id:`msg_${Date.now()}_assistant`,role:"assistant",content:"",timestamp:new Date,isStreaming:!0,sourcesExpanded:!1};s.value.push(U);try{g=B_(n.currentDbPath,X,Y=>{U.content+=Y,te()},Y=>{U.sources=Y},()=>{U.isStreaming=!1,o.value=!1,i.value=!1,J(),g=null},Y=>{U.content=Y.message,U.error=!0,U.isStreaming=!1,o.value=!1,i.value=!1,J(),g=null},E.value)}catch{await K(X,U)}}async function K(X,U){try{const Y=await z_(n.currentDbPath,X);U.content=Y.answer,U.sources=Y.sources,U.error=!!Y.error,U.isStreaming=!1}catch(Y){if(Y instanceof Error&&Y.message==="Request cancelled")return;U.content=Y instanceof Error?Y.message:"Failed to get response",U.error=!0,U.isStreaming=!1}finally{J(),i.value=!1,o.value=!1,te()}}function te(){jn(()=>{c.value&&(c.value.scrollTop=c.value.scrollHeight)})}function _e(X){X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),ye())}function $e(X){if(X.key==="Escape"){if(w.value){w.value=!1;return}if(_.value){_.value=!1,P.value="";return}if(i.value||o.value){ge();return}}if((X.ctrlKey||X.metaKey)&&X.key==="/"){X.preventDefault(),w.value=!w.value;return}if((X.ctrlKey||X.metaKey)&&X.key==="f"&&s.value.length>0){X.preventDefault(),_.value=!0,jn(()=>{const U=document.getElementById("chat-search-input");U==null||U.focus()});return}if(X.key==="ArrowUp"&&u.value){const U=u.value;if(U.value===""&&U.selectionStart===0){const Y=ee();Y>=0&&(X.preventDefault(),D(s.value[Y]))}}}function it(X,U){let Y=X.replace(/\[\[Memory (\d+)\]\]/g,(ze,sn)=>{const Cr=parseInt(sn)-1;return U&&U[Cr]?`<a href="#" class="memory-ref text-blue-600 dark:text-blue-400 hover:underline font-medium" data-memory-index="${Cr}">[Memory ${sn}]</a>`:ze});const qe=Ze.parse(Y);return mD(qe)}function lt(X,U){const Y=X.target;if(Y.classList.contains("memory-ref")){X.preventDefault();const qe=parseInt(Y.dataset.memoryIndex||"0");U&&U[qe]&&Z(U[qe])}}function nn(X){X.sourcesExpanded=!X.sourcesExpanded}async function It(X){try{await navigator.clipboard.writeText(X.content),X.copiedRecently=!0,setTimeout(()=>{X.copiedRecently=!1},2e3)}catch(U){As.error("Failed to copy:",U)}}async function qs(X){const U=s.value[X];!U||U.role!=="user"||(s.value=s.value.slice(0,X+1),S.value=!1,T.value=null,await ie(U.content))}function D(X){X.isEditing=!0,X.editContent=X.content}function F(X){X.isEditing=!1,X.editContent=void 0}async function G(X,U){var Y;(Y=X.editContent)!=null&&Y.trim()&&(X.content=X.editContent.trim(),X.isEditing=!1,X.editContent=void 0,s.value=s.value.slice(0,U+1),S.value=!1,T.value=null,await ie(X.content))}function ee(){for(let X=s.value.length-1;X>=0;X--)if(s.value[X].role==="user")return X;return-1}async function Z(X){let U=n.memories.find(Y=>Y.id===X.id);U?n.selectMemory(U):(n.filters.search=X.id,await n.loadMemories(),U=n.memories.find(Y=>Y.id===X.id),U&&n.selectMemory(U)),_s("navigate-to-memory",X.id)}function Q(X,U){y&&clearTimeout(y),y=setTimeout(()=>{const Y=X.target.getBoundingClientRect();m.value={x:Math.min(Y.left,window.innerWidth-340),y:Y.bottom+8},p.value=U},200)}function de(){y&&clearTimeout(y),p.value=null}function fe(X){return R[X]||R.other}async function ce(){if(!(x.value||s.value.length<2)){x.value=!0;try{const X=s.value.filter(Y=>Y.sources).flatMap(Y=>Y.sources.map(qe=>qe.id)),U=await H_(n.currentDbPath,{messages:s.value.map(Y=>({role:Y.role,content:Y.content,timestamp:Y.timestamp.toISOString()})),referenced_memory_ids:[...new Set(X)]});S.value=!0,T.value=U.memory_id}catch(X){As.error("Failed to save conversation:",X)}finally{x.value=!1}}}function se(){var U,Y;let X=`# Chat Conversation
|
|
517
|
+
`;X+=`**Project:** ${((U=n.currentProject)==null?void 0:U.name)||"Unknown"}
|
|
518
|
+
`,X+=`**Date:** ${new Date().toLocaleDateString()}
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
`;for(const qe of s.value){const ze=qe.role==="user"?"**You**":"**Assistant**",sn=xt(qe.timestamp);X+=`### ${ze} (${sn})
|
|
523
|
+
|
|
524
|
+
${qe.content}
|
|
525
|
+
|
|
526
|
+
`,(Y=qe.sources)!=null&&Y.length&&(X+=`**Sources:** ${qe.sources.map(Cr=>Cr.id.slice(0,8)).join(", ")}
|
|
527
|
+
|
|
528
|
+
`),X+=`---
|
|
529
|
+
|
|
530
|
+
`}return X}function Ce(){return JSON.stringify({project:n.currentDbPath,exportedAt:new Date().toISOString(),messages:s.value.map(X=>({role:X.role,content:X.content,timestamp:X.timestamp.toISOString(),sources:X.sources}))},null,2)}function be(){const X=se();Te(X,`chat_${Date.now()}.md`,"text/markdown"),v.value=!1}function we(){const X=Ce();Te(X,`chat_${Date.now()}.json`,"application/json"),v.value=!1}function Te(X,U,Y){const qe=new Blob([X],{type:Y}),ze=URL.createObjectURL(qe),sn=document.createElement("a");sn.href=ze,sn.download=U,sn.click(),URL.revokeObjectURL(ze)}async function Re(){const X=s.value.map(U=>`${U.role==="user"?"You":"Assistant"}: ${U.content}`).join(`
|
|
531
|
+
|
|
532
|
+
`);await navigator.clipboard.writeText(X),v.value=!1}function Le(){if(!P.value){L.value=[];return}const X=P.value.toLowerCase();L.value=s.value.map((U,Y)=>U.content.toLowerCase().includes(X)?Y:-1).filter(U=>U!==-1),C.value=0,L.value.length>0&&je(L.value[0])}function je(X){const U=document.getElementById(`message-${X}`);U==null||U.scrollIntoView({behavior:"smooth",block:"center"})}function ne(){L.value.length!==0&&(C.value=(C.value+1)%L.value.length,je(L.value[C.value]))}function xe(){L.value.length!==0&&(C.value=(C.value-1+L.value.length)%L.value.length,je(L.value[C.value]))}function Ne(X){if(!P.value)return X;const U=P.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Y=new RegExp(`(${U})`,"gi");return X.replace(Y,'<mark class="bg-yellow-200 dark:bg-yellow-700">$1</mark>')}function ot(X){return L.value.includes(X)}function kt(X){r.value=X,ye()}function ut(X){switch(X){case"write-like-me":r.value="Write the following in my communication style: ",E.value=!0,jn(()=>{var Y,qe;(Y=u.value)==null||Y.focus();const U=r.value.length;(qe=u.value)==null||qe.setSelectionRange(U,U)});break;case"analyze-style":r.value="Analyze my communication style based on my message history and provide insights.",E.value=!0;break}}function Ye(X){r.value=X,ye()}function xt(X){return X.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function vs(X){const Y=new Date().getTime()-X.getTime(),qe=Math.floor(Y/6e4);if(qe<1)return"just now";if(qe<60)return`${qe}m ago`;const ze=Math.floor(qe/60);return ze<24?`${ze}h ago`:X.toLocaleDateString()}const _s=e;return(X,U)=>(b(),k("div",yD,[f("div",bD,[f("div",xD,[f("div",vD,[f("button",{onClick:U[0]||(U[0]=Y=>M.value="chat"),class:re(["flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",M.value==="chat"?"bg-white dark:bg-gray-600 text-blue-600 dark:text-blue-400 shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"])},[O($(_m),{class:"w-4 h-4"}),U[18]||(U[18]=oe(" Chat ",-1))],2),f("button",{onClick:U[1]||(U[1]=Y=>M.value="compose"),class:re(["flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",M.value==="compose"?"bg-white dark:bg-gray-600 text-indigo-600 dark:text-indigo-400 shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"])},[O($(fu),{class:"w-4 h-4"}),U[19]||(U[19]=oe(" Compose ",-1))],2),f("button",{onClick:U[2]||(U[2]=Y=>M.value="image"),class:re(["flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",M.value==="image"?"bg-white dark:bg-gray-600 text-purple-600 dark:text-purple-400 shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"])},[O($(Ga),{class:"w-4 h-4"}),U[20]||(U[20]=oe(" Generate ",-1))],2)]),f("span",_D,A(M.value==="chat"?"Ask About Memories":M.value==="compose"?"Response Composer":"Image Generation"),1)]),f("div",kD,[s.value.length>0?(b(),k("button",{key:0,onClick:U[3]||(U[3]=Y=>_.value=!_.value),class:"p-2 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition-colors",title:"Search (Ctrl+F)"},[O($(lo),{class:"w-4 h-4"})])):H("",!0),s.value.length>0?(b(),k("div",wD,[f("button",{onClick:U[4]||(U[4]=Y=>v.value=!v.value),class:"p-2 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition-colors",title:"Export conversation"},[O($(xr),{class:"w-4 h-4"})]),v.value?(b(),k("div",SD,[f("button",{onClick:be,class:"w-full px-4 py-2 text-left text-sm hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center gap-2"},[O($(ci),{class:"w-4 h-4"}),U[21]||(U[21]=oe(" Export as Markdown ",-1))]),f("button",{onClick:we,class:"w-full px-4 py-2 text-left text-sm hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center gap-2"},[O($(od),{class:"w-4 h-4"}),U[22]||(U[22]=oe(" Export as JSON ",-1))]),f("button",{onClick:Re,class:"w-full px-4 py-2 text-left text-sm hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center gap-2"},[O($(Ak),{class:"w-4 h-4"}),U[23]||(U[23]=oe(" Copy to Clipboard ",-1))])])):H("",!0)])):H("",!0),f("button",{onClick:U[5]||(U[5]=Y=>w.value=!0),class:"p-2 rounded hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition-colors",title:"Keyboard shortcuts (Ctrl+/)"},[O($(xm),{class:"w-4 h-4"})])])]),_.value?(b(),k("div",$D,[O($(lo),{class:"w-4 h-4 text-gray-400"}),Ee(f("input",{id:"chat-search-input","onUpdate:modelValue":U[6]||(U[6]=Y=>P.value=Y),onInput:Le,onKeydown:[Fr(ne,["enter"]),U[7]||(U[7]=Fr(Y=>_.value=!1,["escape"]))],placeholder:"Search in conversation...",class:"flex-1 bg-transparent border-none outline-none text-sm"},null,544),[[rt,P.value]]),L.value.length>0?(b(),k("span",CD,A(C.value+1)+" / "+A(L.value.length),1)):H("",!0),f("button",{onClick:xe,class:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded"},[O($(Ps),{class:"w-4 h-4"})]),f("button",{onClick:ne,class:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded"},[O($(Nn),{class:"w-4 h-4"})]),f("button",{onClick:U[8]||(U[8]=Y=>{_.value=!1,P.value=""}),class:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded"},[O($(Qt),{class:"w-4 h-4"})])])):H("",!0),M.value==="compose"?(b(),pe(nR,{key:1})):M.value==="image"?(b(),pe(kP,{key:2,"chat-messages":s.value.map(Y=>({role:Y.role,content:Y.content}))},null,8,["chat-messages"])):(b(),k(ae,{key:3},[a.value?(b(),k(ae,{key:1},[f("div",{ref_key:"messagesContainer",ref:c,class:re(["flex-1 overflow-y-auto p-4 space-y-4",E.value&&z.value?"bg-gradient-to-b from-indigo-50/30 to-transparent dark:from-indigo-900/10":""])},[s.value.length===0?(b(),k("div",ED,[f("div",PD,[O($(hc),{class:"w-12 h-12 mx-auto mb-3 text-gray-400"}),U[26]||(U[26]=f("p",{class:"text-lg font-medium mb-3"},"Ask anything about your memories",-1)),U[27]||(U[27]=f("p",{class:"text-sm mb-4"},"Try asking:",-1)),f("div",RD,[(b(),k(ae,null,ve(j,Y=>f("button",{key:Y,onClick:qe=>kt(Y),class:"px-3 py-1.5 text-sm bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-full hover:bg-blue-100 dark:hover:bg-blue-900/50 transition-colors text-left"},A(Y),9,DD)),64))])])])):H("",!0),(b(!0),k(ae,null,ve(s.value,(Y,qe)=>(b(),k("div",{id:`message-${qe}`,key:Y.id,class:re(["flex gap-3 group",Y.role==="user"?"justify-end":"justify-start",ot(qe)?"bg-yellow-50 dark:bg-yellow-900/20 -mx-2 px-2 py-1 rounded":""])},[Y.role==="assistant"?(b(),k("div",ID,[O($(hc),{class:"w-5 h-5 text-blue-600 dark:text-blue-400"})])):H("",!0),f("div",LD,[f("span",{class:re(["text-xs text-gray-400 mb-1",Y.role==="user"?"text-right":"text-left"])},A(vs(Y.timestamp)),3),f("div",{class:re(["rounded-lg p-3",Y.role==="user"?"bg-blue-600 text-white":Y.error?"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-300 border border-red-200 dark:border-red-800":"bg-gray-100 dark:bg-gray-700"])},[Y.role==="user"?(b(),k(ae,{key:0},[Y.isEditing?(b(),k("div",ND,[Ee(f("textarea",{"onUpdate:modelValue":ze=>Y.editContent=ze,class:"w-full p-2 text-sm text-gray-900 bg-white border border-gray-300 rounded resize-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",rows:"3",onKeydown:Fr(pt(ze=>G(Y,qe),["ctrl"]),["enter"])},null,40,FD),[[rt,Y.editContent]]),f("div",jD,[f("button",{onClick:ze=>F(Y),class:"px-2 py-1 text-xs bg-gray-200 text-gray-700 rounded hover:bg-gray-300 transition-colors"}," Cancel ",8,zD),f("button",{onClick:ze=>G(Y,qe),class:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 transition-colors"}," Send ",8,BD)])])):(b(),k("p",{key:1,class:"text-sm whitespace-pre-wrap",innerHTML:P.value?Ne(Y.content):Y.content},null,8,HD))],64)):(b(),k("div",UD,[f("div",{class:"prose prose-sm dark:prose-invert max-w-none prose-p:my-1 prose-ul:my-1 prose-ol:my-1 prose-li:my-0.5 prose-headings:my-2",onClick:ze=>lt(ze,Y.sources),innerHTML:P.value?Ne(it(Y.content,Y.sources)):it(Y.content,Y.sources)},null,8,VD),Y.isStreaming?(b(),k("div",WD,[...U[28]||(U[28]=[f("span",{class:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{"animation-delay":"0ms"}},null,-1),f("span",{class:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{"animation-delay":"150ms"}},null,-1),f("span",{class:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{"animation-delay":"300ms"}},null,-1)])])):H("",!0)])),Y.sources&&Y.sources.length>0?(b(),k("div",qD,[f("button",{onClick:ze=>nn(Y),class:"flex items-center gap-1 text-xs font-medium text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 transition-colors"},[Y.sourcesExpanded?(b(),pe($(Nn),{key:1,class:"w-4 h-4"})):(b(),pe($(id),{key:0,class:"w-4 h-4"})),oe(" Sources ("+A(Y.sources.length)+") ",1)],8,KD),Ee(f("div",GD,[(b(!0),k(ae,null,ve(Y.sources,ze=>(b(),k("button",{key:ze.id,onClick:sn=>Z(ze),onMouseenter:sn=>Q(sn,ze),onMouseleave:de,class:"flex items-start gap-2 w-full text-left p-2 rounded bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors text-sm"},[ze.project_name?(b(),k("span",{key:0,class:"px-1.5 py-0.5 bg-purple-100 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300 rounded text-xs font-medium flex-shrink-0",title:ze.project_path},A(ze.project_name),9,XD)):H("",!0),f("span",{class:re([fe(ze.type),"px-1.5 py-0.5 rounded text-xs font-medium flex-shrink-0"])},A(ze.type),3),f("span",JD,A(ze.content_preview),1),O($(pm),{class:"w-3 h-3 text-gray-400 flex-shrink-0 mt-0.5"})],40,YD))),128))],512),[[Cv,Y.sourcesExpanded]])])):H("",!0)],2),!Y.isEditing&&!i.value&&!Y.isStreaming?(b(),k("div",{key:0,class:re(["flex gap-1 mt-1 opacity-0 group-hover:opacity-100 transition-opacity",Y.role==="user"?"justify-end":"justify-start"])},[Y.role==="assistant"&&!Y.error?(b(),k("button",{key:0,onClick:ze=>It(Y),class:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition-colors",title:Y.copiedRecently?"Copied!":"Copy"},[Y.copiedRecently?(b(),pe($(Yt),{key:0,class:"w-3.5 h-3.5 text-green-500"})):(b(),pe($(ls),{key:1,class:"w-3.5 h-3.5"}))],8,ZD)):H("",!0),Y.role==="assistant"&&qe===s.value.length-1&&ee()>=0?(b(),k("button",{key:1,onClick:U[9]||(U[9]=ze=>qs(ee())),class:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition-colors",title:"Regenerate response"},[O($(en),{class:"w-3.5 h-3.5"})])):H("",!0),Y.role==="user"?(b(),k("button",{key:2,onClick:ze=>D(Y),class:"p-1 rounded hover:bg-blue-500 text-blue-200 hover:text-white transition-colors",title:"Edit message"},[O($(Ya),{class:"w-3.5 h-3.5"})],8,QD)):H("",!0)],2)):H("",!0),Y.role==="assistant"&&qe===s.value.length-1&&!Y.error&&!i.value&&!Y.isStreaming?(b(),k("div",eO,[f("button",{onClick:U[10]||(U[10]=ze=>Ye("Can you explain more?")),class:"text-xs px-2 py-1 bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors"}," Explain more "),f("button",{onClick:U[11]||(U[11]=ze=>Ye("Can you summarize this?")),class:"text-xs px-2 py-1 bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors"}," Summarize "),f("button",{onClick:U[12]||(U[12]=ze=>Ye("Try a different approach")),class:"text-xs px-2 py-1 bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors"}," Different approach ")])):H("",!0)]),Y.role==="user"?(b(),k("div",tO,[O($(du),{class:"w-5 h-5 text-white"})])):H("",!0)],10,OD))),128)),i.value&&!o.value?(b(),k("div",nO,[f("div",sO,[O($(hc),{class:"w-5 h-5 text-blue-600 dark:text-blue-400"})]),f("div",rO,[O($(zn),{class:"w-5 h-5 animate-spin text-blue-500"}),f("div",iO,[U[29]||(U[29]=f("span",{class:"text-gray-600 dark:text-gray-300"},"Thinking",-1)),f("span",oO,"("+A(d.value)+"s)",1)]),f("button",{onClick:ge,class:"ml-2 p-1 rounded-full hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-500 hover:text-red-500 transition-colors",title:"Cancel request"},[O($(Qt),{class:"w-4 h-4"})])])])):H("",!0)],2),f("div",aO,[f("div",lO,[f("div",cO,[f("label",uO,[Ee(f("input",{type:"checkbox","onUpdate:modelValue":U[13]||(U[13]=Y=>E.value=Y),class:"w-4 h-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"},null,512),[[yr,E.value]]),f("span",dO,[O($(du),{class:"w-4 h-4"}),U[30]||(U[30]=oe(" Write in My Style ",-1))])]),E.value&&z.value?(b(),k("span",fO,[O($(Eo),{class:"w-3 h-3"}),oe(" Style: "+A(Object.keys(z.value.tone_distribution||{})[0]||"Active"),1)])):H("",!0),V.value?(b(),k("span",hO,[O($(zn),{class:"w-3 h-3 animate-spin"}),U[31]||(U[31]=oe(" Loading style... ",-1))])):H("",!0)]),f("div",gO,[f("button",{onClick:U[14]||(U[14]=Y=>ut("write-like-me")),class:"text-xs px-3 py-1.5 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg flex items-center gap-1.5 transition-colors text-gray-700 dark:text-gray-300",title:"Generate content in your style"},[O($(fu),{class:"w-3 h-3"}),U[32]||(U[32]=oe(" Draft in my voice ",-1))])])]),s.value.length>1?(b(),k("div",pO,[f("button",{onClick:ce,class:re(["flex items-center gap-1 px-3 py-1.5 text-sm rounded transition-colors",S.value?"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300":"bg-green-600 text-white hover:bg-green-700"]),disabled:x.value},[x.value?(b(),pe($(zn),{key:0,class:"w-4 h-4 animate-spin"})):S.value?(b(),pe($(Yt),{key:1,class:"w-4 h-4"})):(b(),pe($(Tk),{key:2,class:"w-4 h-4"})),oe(" "+A(S.value?"Saved":x.value?"Saving...":"Save Chat"),1)],10,mO)])):H("",!0),f("div",yO,[f("div",bO,[Ee(f("textarea",{ref_key:"inputRef",ref:u,"onUpdate:modelValue":U[15]||(U[15]=Y=>r.value=Y),onKeydown:_e,disabled:i.value,placeholder:"Ask about your memories...",class:"w-full px-3 py-2 pr-16 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-sm resize-none focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50",rows:"2",maxlength:Ic},null,40,xO),[[rt,r.value]]),f("span",{class:re(["absolute bottom-2 right-2 text-xs",B.value>Ic*.9?"text-amber-500":"text-gray-400"])},A(B.value)+" / "+A(Ic),3)]),f("button",{onClick:ye,disabled:!r.value.trim()||i.value,class:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors self-end"},[O($(Vk),{class:"w-5 h-5"})],8,vO)]),o.value?(b(),k("div",_O,[f("button",{onClick:ge,class:"flex items-center gap-1 px-3 py-1.5 text-sm bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300 rounded hover:bg-red-200 dark:hover:bg-red-900/50 transition-colors"},[O($(Qt),{class:"w-4 h-4"}),U[33]||(U[33]=oe(" Stop Generating ",-1))])])):H("",!0)])],64)):(b(),k("div",TD,[f("div",MD,[O($(Ca),{class:"w-12 h-12 mx-auto text-amber-500 mb-3"}),U[24]||(U[24]=f("h3",{class:"text-lg font-medium mb-2"},"Chat Not Available",-1)),f("p",AD,A(l.value),1),U[25]||(U[25]=f("div",{class:"bg-gray-100 dark:bg-gray-700 rounded-lg p-3 text-left text-sm font-mono"},[f("p",{class:"text-gray-600 dark:text-gray-300"},"Set environment variable:"),f("p",{class:"text-blue-600 dark:text-blue-400 mt-1"},"GEMINI_API_KEY=your_api_key")],-1))])]))],64)),p.value?(b(),pe(qR,{key:4,source:p.value,position:m.value},null,8,["source","position"])):H("",!0),w.value?(b(),k("div",{key:5,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:U[17]||(U[17]=pt(Y=>w.value=!1,["self"]))},[f("div",kO,[U[34]||(U[34]=Bs('<h3 class="text-lg font-semibold mb-4" data-v-43ff76fd>Keyboard Shortcuts</h3><div class="space-y-2 text-sm" data-v-43ff76fd><div class="flex justify-between py-1" data-v-43ff76fd><span data-v-43ff76fd>Send message</span><kbd class="px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded text-xs font-mono" data-v-43ff76fd>Enter</kbd></div><div class="flex justify-between py-1" data-v-43ff76fd><span data-v-43ff76fd>New line</span><kbd class="px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded text-xs font-mono" data-v-43ff76fd>Shift + Enter</kbd></div><div class="flex justify-between py-1" data-v-43ff76fd><span data-v-43ff76fd>Cancel request</span><kbd class="px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded text-xs font-mono" data-v-43ff76fd>Escape</kbd></div><div class="flex justify-between py-1" data-v-43ff76fd><span data-v-43ff76fd>Edit last message</span><kbd class="px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded text-xs font-mono" data-v-43ff76fd>↑ (empty input)</kbd></div><div class="flex justify-between py-1" data-v-43ff76fd><span data-v-43ff76fd>Submit edit</span><kbd class="px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded text-xs font-mono" data-v-43ff76fd>Ctrl + Enter</kbd></div><div class="flex justify-between py-1" data-v-43ff76fd><span data-v-43ff76fd>Search in chat</span><kbd class="px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded text-xs font-mono" data-v-43ff76fd>Ctrl + F</kbd></div><div class="flex justify-between py-1" data-v-43ff76fd><span data-v-43ff76fd>This help</span><kbd class="px-2 py-0.5 bg-gray-100 dark:bg-gray-700 rounded text-xs font-mono" data-v-43ff76fd>Ctrl + /</kbd></div></div>',2)),f("button",{onClick:U[16]||(U[16]=Y=>w.value=!1),class:"mt-4 w-full py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors"}," Close ")])])):H("",!0)]))}}),SO=Po(wO,[["__scopeId","data-v-43ff76fd"]]),$O={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700"},CO={class:"flex items-center gap-2"},TO={class:"flex items-center gap-1 px-2 py-0.5 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded-full text-xs"},MO={key:0,class:"px-4 pb-4"},AO={key:1,class:"px-4 pb-4 text-red-500 text-sm"},EO={key:2,class:"px-4 pb-4 text-gray-500 text-sm"},PO={key:0,class:"px-4 pb-4 border-b border-gray-100 dark:border-gray-700"},RO={class:"flex items-center gap-4 text-sm"},DO={key:0,class:"flex items-center gap-1.5 text-gray-600 dark:text-gray-400"},OO={class:"flex items-center gap-1.5 text-gray-600 dark:text-gray-400"},IO={key:0,class:"mt-2 text-sm text-gray-700 dark:text-gray-300"},LO={key:1,class:"px-4 pb-4 border-b border-gray-100 dark:border-gray-700"},NO={class:"flex items-center gap-4 text-sm"},FO={class:"flex items-center gap-1.5 text-gray-600 dark:text-gray-400"},jO={class:"flex items-center gap-1.5 text-gray-600 dark:text-gray-400"},zO={key:0,class:"px-2 py-0.5 bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400 rounded-full text-xs"},BO={key:0,class:"mt-2 text-sm text-gray-700 dark:text-gray-300 line-clamp-2"},HO={key:2,class:"divide-y divide-gray-100 dark:divide-gray-700"},UO={class:"flex items-center justify-between text-sm"},VO={class:"flex items-center gap-3"},WO={class:"text-gray-500 dark:text-gray-500"},qO={class:"flex items-center gap-1 text-gray-500"},KO={key:0,class:"px-1.5 py-0.5 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded text-xs"},GO={key:0,class:"mt-1 text-sm text-gray-700 dark:text-gray-300 line-clamp-1"},YO=Oe({__name:"SessionContextViewer",setup(t){const e=We(),n=I([]),s=I(!1),r=I(null),i=I(!1),o=le(()=>e.recentSessions.length>0?e.recentSessions:n.value),a=le(()=>o.value[0]||null),l=le(()=>e.activities.length),c=le(()=>e.activities.length>0?e.activities[0].timestamp:null),u=le(()=>{const g=new Map;return e.activities.slice(0,50).forEach(m=>{if(m.tool_name){const y=m.tool_name.startsWith("mcp__")&&m.tool_name.split("__")[1]||m.tool_name;g.set(y,(g.get(y)||0)+1)}}),[...g.entries()].sort((m,y)=>y[1]-m[1]).slice(0,3).map(([m])=>m).join(", ")});function d(g,p){if(!p)return"Ongoing";const m=new Date(g),x=new Date(p).getTime()-m.getTime(),S=Math.floor(x/6e4),T=Math.floor(S/60),v=S%60;return T>0?`${T}h ${v}m`:`${v}m`}async function h(){if(e.currentProject){s.value=!0,r.value=null;try{n.value=await J_(e.currentProject.db_path,5)}catch(g){r.value="Failed to load sessions",console.error(g)}finally{s.value=!1}}}return Ge(h),Be(()=>e.currentProject,h),Be(()=>e.lastActivityTimestamp,()=>{h()}),(g,p)=>(b(),k("div",$O,[f("div",{class:"p-4 flex items-center justify-between cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors rounded-t-lg",onClick:p[0]||(p[0]=m=>i.value=!i.value)},[f("div",CO,[O($(ao),{class:"w-5 h-5 text-blue-500"}),p[2]||(p[2]=f("h2",{class:"font-semibold"},"Session Context",-1)),f("div",TO,[O($(wm),{class:"w-3 h-3 animate-pulse"}),p[1]||(p[1]=f("span",null,"Live",-1))])]),(b(),pe(Vn(i.value?$(Ps):$(Nn)),{class:"w-5 h-5 text-gray-400"}))]),s.value?(b(),k("div",MO,[...p[3]||(p[3]=[f("div",{class:"animate-pulse text-gray-500 text-sm"},"Loading sessions...",-1)])])):r.value?(b(),k("div",AO,A(r.value),1)):a.value?(b(),k(ae,{key:3},[l.value>0?(b(),k("div",PO,[f("div",RO,[c.value?(b(),k("div",DO,[O(Vr,{timestamp:c.value,"show-icon":""},null,8,["timestamp"])])):H("",!0),f("div",OO,[O($(Il),{class:"w-4 h-4 text-amber-500"}),f("span",null,A(l.value)+" activities loaded",1)]),p[4]||(p[4]=f("span",{class:"px-2 py-0.5 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded-full text-xs animate-pulse"}," Active ",-1))]),u.value?(b(),k("p",IO," Recent tools: "+A(u.value),1)):H("",!0)])):H("",!0),a.value?(b(),k("div",LO,[p[5]||(p[5]=f("div",{class:"text-xs text-gray-400 dark:text-gray-500 mb-2"},"Last recorded session:",-1)),f("div",NO,[f("div",FO,[O(Vr,{timestamp:a.value.started_at,"show-icon":""},null,8,["timestamp"])]),f("div",jO,[O($(au),{class:"w-4 h-4"}),f("span",null,A(a.value.activity_count)+" activities",1)]),a.value.ended_at?H("",!0):(b(),k("span",zO," Not ended "))]),a.value.summary?(b(),k("p",BO,A(a.value.summary),1)):H("",!0)])):H("",!0),i.value?(b(),k("div",HO,[(b(!0),k(ae,null,ve(o.value.slice(1),m=>(b(),k("div",{key:m.id,class:"p-4 hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors"},[f("div",UO,[O(Vr,{timestamp:m.started_at,compact:""},null,8,["timestamp"]),f("div",VO,[f("span",WO,A(d(m.started_at,m.ended_at)),1),f("span",qO,[O($(au),{class:"w-3.5 h-3.5"}),oe(" "+A(m.activity_count),1)]),m.ended_at?H("",!0):(b(),k("span",KO," Active "))])]),m.summary?(b(),k("p",GO,A(m.summary),1)):H("",!0)]))),128))])):H("",!0)],64)):(b(),k("div",EO," No session data available "))]))}}),XO={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700"},JO={class:"p-4 border-b border-gray-200 dark:border-gray-700"},ZO={class:"flex items-center justify-between mb-4"},QO={class:"text-lg font-semibold flex items-center gap-2"},e8=["disabled"],t8={class:"mb-4"},n8={class:"flex items-center justify-between text-sm mb-1"},s8={class:"font-medium"},r8={class:"h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},i8={class:"text-xs text-gray-500 mt-1"},o8={class:"flex items-center gap-2"},a8={key:0,class:"px-4 py-3 bg-gray-50 dark:bg-gray-700/50 border-b border-gray-200 dark:border-gray-700 flex items-center gap-4"},l8={class:"flex items-center gap-2 cursor-pointer"},c8=["checked","indeterminate"],u8={class:"text-sm text-gray-600 dark:text-gray-400"},d8={key:0,class:"flex items-center gap-2 ml-auto"},f8=["disabled"],h8=["disabled"],g8=["disabled"],p8={key:1,class:"p-8 text-center"},m8={key:2,class:"p-8 text-center text-red-500"},y8={key:3,class:"p-8 text-center text-gray-500"},b8={key:4,class:"divide-y divide-gray-100 dark:divide-gray-700 max-h-96 overflow-y-auto"},x8=["onClick"],v8={class:"flex items-start gap-3"},_8=["checked","onChange"],k8={class:"flex-1 min-w-0"},w8={class:"text-sm text-gray-900 dark:text-gray-100 line-clamp-2"},S8={class:"mt-1 flex items-center gap-3 text-xs text-gray-500"},$8={class:"flex items-center gap-1"},C8={key:0,class:"text-amber-600 dark:text-amber-400"},T8=Oe({__name:"FreshnessReviewPanel",setup(t){const e=We(),n=I([]),s=I(new Set),r=I(!1),i=I(!1),o=I(null),a=I(30),l=le(()=>n.value.length>0&&s.value.size===n.value.length),c=le(()=>s.value.size>0&&s.value.size<n.value.length),u=le(()=>s.value.size),d=le(()=>{if(!e.stats)return{reviewed:0,total:0,percentage:0};const x=e.stats.total_count,S=e.stats.by_status.needs_review||0,T=e.stats.by_status.outdated||0,v=x-S-T;return{reviewed:v,total:x,percentage:x>0?Math.round(v/x*100):100}});function h(){l.value?s.value.clear():s.value=new Set(n.value.map(x=>x.id))}function g(x){s.value.has(x)?s.value.delete(x):s.value.add(x),s.value=new Set(s.value)}function p(x){if(!x)return"Never accessed";const S=new Date(x),v=new Date().getTime()-S.getTime(),_=Math.floor(v/864e5);return _<1?"Today":_===1?"Yesterday":_<7?`${_} days ago`:_<30?`${Math.floor(_/7)} weeks ago`:_<365?`${Math.floor(_/30)} months ago`:`${Math.floor(_/365)} years ago`}async function m(){if(e.currentProject){r.value=!0,o.value=null,s.value.clear();try{n.value=await Z_(e.currentProject.db_path,a.value,50)}catch(x){o.value="Failed to load memories",console.error(x)}finally{r.value=!1}}}async function y(x){if(!(!e.currentProject||s.value.size===0)){i.value=!0,o.value=null;try{await Q_(e.currentProject.db_path,Array.from(s.value),x),n.value=n.value.filter(S=>!s.value.has(S.id)),s.value.clear(),e.loadStats()}catch(S){o.value="Failed to update memories",console.error(S)}finally{i.value=!1}}}return Ge(m),Be(()=>e.currentProject,m),Be(a,m),(x,S)=>(b(),k("div",XO,[f("div",JO,[f("div",ZO,[f("h2",QO,[O($(en),{class:"w-5 h-5 text-amber-500"}),S[5]||(S[5]=oe(" Freshness Review ",-1))]),f("button",{onClick:m,disabled:r.value,class:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:"Refresh"},[O($(en),{class:re(["w-4 h-4",r.value&&"animate-spin"])},null,8,["class"])],8,e8)]),f("div",t8,[f("div",n8,[S[6]||(S[6]=f("span",{class:"text-gray-600 dark:text-gray-400"},"Review Progress",-1)),f("span",s8,A(d.value.percentage)+"%",1)]),f("div",r8,[f("div",{class:"h-full bg-green-500 transition-all duration-500",style:wt({width:`${d.value.percentage}%`})},null,4)]),f("div",i8,A(d.value.reviewed)+" of "+A(d.value.total)+" memories reviewed ",1)]),f("div",o8,[O($(ad),{class:"w-4 h-4 text-gray-400"}),S[8]||(S[8]=f("span",{class:"text-sm text-gray-600 dark:text-gray-400"},"Show memories not accessed in",-1)),Ee(f("select",{"onUpdate:modelValue":S[0]||(S[0]=T=>a.value=T),class:"px-2 py-1 bg-gray-100 dark:bg-gray-700 rounded text-sm border-none focus:ring-2 focus:ring-blue-500"},[...S[7]||(S[7]=[f("option",{value:7},"7 days",-1),f("option",{value:14},"14 days",-1),f("option",{value:30},"30 days",-1),f("option",{value:60},"60 days",-1),f("option",{value:90},"90 days",-1)])],512),[[cn,a.value]])])]),n.value.length>0?(b(),k("div",a8,[f("label",l8,[f("input",{type:"checkbox",checked:l.value,indeterminate:c.value,onChange:h,class:"w-4 h-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"},null,40,c8),f("span",u8,A(u.value)+" selected ",1)]),u.value>0?(b(),k("div",d8,[f("button",{onClick:S[1]||(S[1]=T=>y("fresh")),disabled:i.value,class:"flex items-center gap-1.5 px-3 py-1.5 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50"},[O($(zr),{class:"w-4 h-4"}),S[9]||(S[9]=oe(" Mark Fresh ",-1))],8,f8),f("button",{onClick:S[2]||(S[2]=T=>y("outdated")),disabled:i.value,class:"flex items-center gap-1.5 px-3 py-1.5 bg-amber-600 hover:bg-amber-700 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50"},[O($(Qk),{class:"w-4 h-4"}),S[10]||(S[10]=oe(" Mark Outdated ",-1))],8,h8),f("button",{onClick:S[3]||(S[3]=T=>y("archived")),disabled:i.value,class:"flex items-center gap-1.5 px-3 py-1.5 bg-gray-600 hover:bg-gray-700 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50"},[O($(hm),{class:"w-4 h-4"}),S[11]||(S[11]=oe(" Archive ",-1))],8,g8)])):H("",!0)])):H("",!0),r.value?(b(),k("div",p8,[...S[12]||(S[12]=[f("div",{class:"animate-pulse text-gray-500"},"Loading memories...",-1)])])):o.value?(b(),k("div",m8,A(o.value),1)):n.value.length===0?(b(),k("div",y8,[O($(zr),{class:"w-12 h-12 mx-auto mb-2 text-green-500"}),S[13]||(S[13]=f("p",{class:"font-medium"},"All caught up!",-1)),S[14]||(S[14]=f("p",{class:"text-sm"},"No memories need review within the selected timeframe.",-1))])):(b(),k("div",b8,[(b(!0),k(ae,null,ve(n.value,T=>(b(),k("div",{key:T.id,class:"p-4 hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors cursor-pointer",onClick:v=>g(T.id)},[f("div",v8,[f("input",{type:"checkbox",checked:s.value.has(T.id),onClick:S[4]||(S[4]=pt(()=>{},["stop"])),onChange:v=>g(T.id),class:"mt-1 w-4 h-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"},null,40,_8),f("div",k8,[f("p",w8,A(T.content),1),f("div",S8,[f("span",{class:re(["px-2 py-0.5 rounded-full capitalize",T.memory_type==="decision"?"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400":T.memory_type==="solution"?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400":T.memory_type==="error"?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400":"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-400"])},A(T.memory_type),3),f("span",$8,[O($(ao),{class:"w-3 h-3"}),oe(" "+A(p(T.last_accessed)),1)]),T.importance_score?(b(),k("span",C8," Importance: "+A(T.importance_score),1)):H("",!0)])])])],8,x8))),128))]))]))}});var M8={value:()=>{}};function No(){for(var t=0,e=arguments.length,n={},s;t<e;++t){if(!(s=arguments[t]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Da(n)}function Da(t){this._=t}function A8(t,e){return t.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Da.prototype=No.prototype={constructor:Da,on:function(t,e){var n=this._,s=A8(t+"",n),r,i=-1,o=s.length;if(arguments.length<2){for(;++i<o;)if((r=(t=s[i]).type)&&(r=E8(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<o;)if(r=(t=s[i]).type)n[r]=Gg(n[r],t.name,e);else if(e==null)for(r in n)n[r]=Gg(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Da(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],s=0,r=i.length;s<r;++s)i[s].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],r=0,i=s.length;r<i;++r)s[r].value.apply(e,n)}};function E8(t,e){for(var n=0,s=t.length,r;n<s;++n)if((r=t[n]).name===e)return r.value}function Gg(t,e,n){for(var s=0,r=t.length;s<r;++s)if(t[s].name===e){t[s]=M8,t=t.slice(0,s).concat(t.slice(s+1));break}return n!=null&&t.push({name:e,value:n}),t}var Au="http://www.w3.org/1999/xhtml";const Yg={svg:"http://www.w3.org/2000/svg",xhtml:Au,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wl(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Yg.hasOwnProperty(e)?{space:Yg[e],local:t}:t}function P8(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Au&&e.documentElement.namespaceURI===Au?e.createElement(t):e.createElementNS(n,t)}}function R8(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function By(t){var e=Wl(t);return(e.local?R8:P8)(e)}function D8(){}function Ld(t){return t==null?D8:function(){return this.querySelector(t)}}function O8(t){typeof t!="function"&&(t=Ld(t));for(var e=this._groups,n=e.length,s=new Array(n),r=0;r<n;++r)for(var i=e[r],o=i.length,a=s[r]=new Array(o),l,c,u=0;u<o;++u)(l=i[u])&&(c=t.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new un(s,this._parents)}function I8(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function L8(){return[]}function Hy(t){return t==null?L8:function(){return this.querySelectorAll(t)}}function N8(t){return function(){return I8(t.apply(this,arguments))}}function F8(t){typeof t=="function"?t=N8(t):t=Hy(t);for(var e=this._groups,n=e.length,s=[],r=[],i=0;i<n;++i)for(var o=e[i],a=o.length,l,c=0;c<a;++c)(l=o[c])&&(s.push(t.call(l,l.__data__,c,o)),r.push(l));return new un(s,r)}function Uy(t){return function(){return this.matches(t)}}function Vy(t){return function(e){return e.matches(t)}}var j8=Array.prototype.find;function z8(t){return function(){return j8.call(this.children,t)}}function B8(){return this.firstElementChild}function H8(t){return this.select(t==null?B8:z8(typeof t=="function"?t:Vy(t)))}var U8=Array.prototype.filter;function V8(){return Array.from(this.children)}function W8(t){return function(){return U8.call(this.children,t)}}function q8(t){return this.selectAll(t==null?V8:W8(typeof t=="function"?t:Vy(t)))}function K8(t){typeof t!="function"&&(t=Uy(t));for(var e=this._groups,n=e.length,s=new Array(n),r=0;r<n;++r)for(var i=e[r],o=i.length,a=s[r]=[],l,c=0;c<o;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&a.push(l);return new un(s,this._parents)}function Wy(t){return new Array(t.length)}function G8(){return new un(this._enter||this._groups.map(Wy),this._parents)}function al(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}al.prototype={constructor:al,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Y8(t){return function(){return t}}function X8(t,e,n,s,r,i){for(var o=0,a,l=e.length,c=i.length;o<c;++o)(a=e[o])?(a.__data__=i[o],s[o]=a):n[o]=new al(t,i[o]);for(;o<l;++o)(a=e[o])&&(r[o]=a)}function J8(t,e,n,s,r,i,o){var a,l,c=new Map,u=e.length,d=i.length,h=new Array(u),g;for(a=0;a<u;++a)(l=e[a])&&(h[a]=g=o.call(l,l.__data__,a,e)+"",c.has(g)?r[a]=l:c.set(g,l));for(a=0;a<d;++a)g=o.call(t,i[a],a,i)+"",(l=c.get(g))?(s[a]=l,l.__data__=i[a],c.delete(g)):n[a]=new al(t,i[a]);for(a=0;a<u;++a)(l=e[a])&&c.get(h[a])===l&&(r[a]=l)}function Z8(t){return t.__data__}function Q8(t,e){if(!arguments.length)return Array.from(this,Z8);var n=e?J8:X8,s=this._parents,r=this._groups;typeof t!="function"&&(t=Y8(t));for(var i=r.length,o=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=s[c],d=r[c],h=d.length,g=eI(t.call(u,u&&u.__data__,c,s)),p=g.length,m=a[c]=new Array(p),y=o[c]=new Array(p),x=l[c]=new Array(h);n(u,d,m,y,x,g,e);for(var S=0,T=0,v,_;S<p;++S)if(v=m[S]){for(S>=T&&(T=S+1);!(_=y[T])&&++T<p;);v._next=_||null}}return o=new un(o,s),o._enter=a,o._exit=l,o}function eI(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function tI(){return new un(this._exit||this._groups.map(Wy),this._parents)}function nI(t,e,n){var s=this.enter(),r=this,i=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function sI(t){for(var e=t.selection?t.selection():t,n=this._groups,s=e._groups,r=n.length,i=s.length,o=Math.min(r,i),a=new Array(r),l=0;l<o;++l)for(var c=n[l],u=s[l],d=c.length,h=a[l]=new Array(d),g,p=0;p<d;++p)(g=c[p]||u[p])&&(h[p]=g);for(;l<r;++l)a[l]=n[l];return new un(a,this._parents)}function rI(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var s=t[e],r=s.length-1,i=s[r],o;--r>=0;)(o=s[r])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function iI(t){t||(t=oI);function e(d,h){return d&&h?t(d.__data__,h.__data__):!d-!h}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var o=n[i],a=o.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=o[u])&&(l[u]=c);l.sort(e)}return new un(r,this._parents).order()}function oI(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function aI(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function lI(){return Array.from(this)}function cI(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var s=t[e],r=0,i=s.length;r<i;++r){var o=s[r];if(o)return o}return null}function uI(){let t=0;for(const e of this)++t;return t}function dI(){return!this.node()}function fI(t){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var r=e[n],i=0,o=r.length,a;i<o;++i)(a=r[i])&&t.call(a,a.__data__,i,r);return this}function hI(t){return function(){this.removeAttribute(t)}}function gI(t){return function(){this.removeAttributeNS(t.space,t.local)}}function pI(t,e){return function(){this.setAttribute(t,e)}}function mI(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function yI(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function bI(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function xI(t,e){var n=Wl(t);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((e==null?n.local?gI:hI:typeof e=="function"?n.local?bI:yI:n.local?mI:pI)(n,e))}function qy(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function vI(t){return function(){this.style.removeProperty(t)}}function _I(t,e,n){return function(){this.style.setProperty(t,e,n)}}function kI(t,e,n){return function(){var s=e.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,n)}}function wI(t,e,n){return arguments.length>1?this.each((e==null?vI:typeof e=="function"?kI:_I)(t,e,n??"")):si(this.node(),t)}function si(t,e){return t.style.getPropertyValue(e)||qy(t).getComputedStyle(t,null).getPropertyValue(e)}function SI(t){return function(){delete this[t]}}function $I(t,e){return function(){this[t]=e}}function CI(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function TI(t,e){return arguments.length>1?this.each((e==null?SI:typeof e=="function"?CI:$I)(t,e)):this.node()[t]}function Ky(t){return t.trim().split(/^|\s+/)}function Nd(t){return t.classList||new Gy(t)}function Gy(t){this._node=t,this._names=Ky(t.getAttribute("class")||"")}Gy.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Yy(t,e){for(var n=Nd(t),s=-1,r=e.length;++s<r;)n.add(e[s])}function Xy(t,e){for(var n=Nd(t),s=-1,r=e.length;++s<r;)n.remove(e[s])}function MI(t){return function(){Yy(this,t)}}function AI(t){return function(){Xy(this,t)}}function EI(t,e){return function(){(e.apply(this,arguments)?Yy:Xy)(this,t)}}function PI(t,e){var n=Ky(t+"");if(arguments.length<2){for(var s=Nd(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?EI:e?MI:AI)(n,e))}function RI(){this.textContent=""}function DI(t){return function(){this.textContent=t}}function OI(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function II(t){return arguments.length?this.each(t==null?RI:(typeof t=="function"?OI:DI)(t)):this.node().textContent}function LI(){this.innerHTML=""}function NI(t){return function(){this.innerHTML=t}}function FI(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function jI(t){return arguments.length?this.each(t==null?LI:(typeof t=="function"?FI:NI)(t)):this.node().innerHTML}function zI(){this.nextSibling&&this.parentNode.appendChild(this)}function BI(){return this.each(zI)}function HI(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UI(){return this.each(HI)}function VI(t){var e=typeof t=="function"?t:By(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function WI(){return null}function qI(t,e){var n=typeof t=="function"?t:By(t),s=e==null?WI:typeof e=="function"?e:Ld(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function KI(){var t=this.parentNode;t&&t.removeChild(this)}function GI(){return this.each(KI)}function YI(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function XI(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function JI(t){return this.select(t?XI:YI)}function ZI(t){return arguments.length?this.property("__data__",t):this.node().__data__}function QI(t){return function(e){t.call(this,e,this.__data__)}}function e7(t){return t.trim().split(/^|\s+/).map(function(e){var n="",s=e.indexOf(".");return s>=0&&(n=e.slice(s+1),e=e.slice(0,s)),{type:e,name:n}})}function t7(t){return function(){var e=this.__on;if(e){for(var n=0,s=-1,r=e.length,i;n<r;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++s]=i;++s?e.length=s:delete this.__on}}}function n7(t,e,n){return function(){var s=this.__on,r,i=QI(e);if(s){for(var o=0,a=s.length;o<a;++o)if((r=s[o]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=e;return}}this.addEventListener(t.type,i,n),r={type:t.type,name:t.name,value:e,listener:i,options:n},s?s.push(r):this.__on=[r]}}function s7(t,e,n){var s=e7(t+""),r,i=s.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((o=s[r]).type===u.type&&o.name===u.name)return u.value}return}for(a=e?n7:t7,r=0;r<i;++r)this.each(a(s[r],e,n));return this}function Jy(t,e,n){var s=qy(t),r=s.CustomEvent;typeof r=="function"?r=new r(e,n):(r=s.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function r7(t,e){return function(){return Jy(this,t,e)}}function i7(t,e){return function(){return Jy(this,t,e.apply(this,arguments))}}function o7(t,e){return this.each((typeof e=="function"?i7:r7)(t,e))}function*a7(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var s=t[e],r=0,i=s.length,o;r<i;++r)(o=s[r])&&(yield o)}var Zy=[null];function un(t,e){this._groups=t,this._parents=e}function Fo(){return new un([[document.documentElement]],Zy)}function l7(){return this}un.prototype=Fo.prototype={constructor:un,select:O8,selectAll:F8,selectChild:H8,selectChildren:q8,filter:K8,data:Q8,enter:G8,exit:tI,join:nI,merge:sI,selection:l7,order:rI,sort:iI,call:aI,nodes:lI,node:cI,size:uI,empty:dI,each:fI,attr:xI,style:wI,property:TI,classed:PI,text:II,html:jI,raise:BI,lower:UI,append:VI,insert:qI,remove:GI,clone:JI,datum:ZI,on:s7,dispatch:o7,[Symbol.iterator]:a7};function _n(t){return typeof t=="string"?new un([[document.querySelector(t)]],[document.documentElement]):new un([[t]],Zy)}function c7(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ns(t,e){if(t=c7(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(e.getScreenCTM().inverse()),[s.x,s.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const u7={passive:!1},yo={capture:!0,passive:!1};function Lc(t){t.stopImmediatePropagation()}function Wr(t){t.preventDefault(),t.stopImmediatePropagation()}function Qy(t){var e=t.document.documentElement,n=_n(t).on("dragstart.drag",Wr,yo);"onselectstart"in e?n.on("selectstart.drag",Wr,yo):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function eb(t,e){var n=t.document.documentElement,s=_n(t).on("dragstart.drag",null);e&&(s.on("click.drag",Wr,yo),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const da=t=>()=>t;function Eu(t,{sourceEvent:e,subject:n,target:s,identifier:r,active:i,x:o,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Eu.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function d7(t){return!t.ctrlKey&&!t.button}function f7(){return this.parentNode}function h7(t,e){return e??{x:t.x,y:t.y}}function g7(){return navigator.maxTouchPoints||"ontouchstart"in this}function p7(){var t=d7,e=f7,n=h7,s=g7,r={},i=No("start","drag","end"),o=0,a,l,c,u,d=0;function h(v){v.on("mousedown.drag",g).filter(s).on("touchstart.drag",y).on("touchmove.drag",x,u7).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(v,_){if(!(u||!t.call(this,v,_))){var P=T(this,e.call(this,v,_),v,_,"mouse");P&&(_n(v.view).on("mousemove.drag",p,yo).on("mouseup.drag",m,yo),Qy(v.view),Lc(v),c=!1,a=v.clientX,l=v.clientY,P("start",v))}}function p(v){if(Wr(v),!c){var _=v.clientX-a,P=v.clientY-l;c=_*_+P*P>d}r.mouse("drag",v)}function m(v){_n(v.view).on("mousemove.drag mouseup.drag",null),eb(v.view,c),Wr(v),r.mouse("end",v)}function y(v,_){if(t.call(this,v,_)){var P=v.changedTouches,L=e.call(this,v,_),C=P.length,w,M;for(w=0;w<C;++w)(M=T(this,L,v,_,P[w].identifier,P[w]))&&(Lc(v),M("start",v,P[w]))}}function x(v){var _=v.changedTouches,P=_.length,L,C;for(L=0;L<P;++L)(C=r[_[L].identifier])&&(Wr(v),C("drag",v,_[L]))}function S(v){var _=v.changedTouches,P=_.length,L,C;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),L=0;L<P;++L)(C=r[_[L].identifier])&&(Lc(v),C("end",v,_[L]))}function T(v,_,P,L,C,w){var M=i.copy(),E=ns(w||P,_),z,V,R;if((R=n.call(v,new Eu("beforestart",{sourceEvent:P,target:h,identifier:C,active:o,x:E[0],y:E[1],dx:0,dy:0,dispatch:M}),L))!=null)return z=R.x-E[0]||0,V=R.y-E[1]||0,function j(B,q,J){var ge=E,ke;switch(B){case"start":r[C]=j,ke=o++;break;case"end":delete r[C],--o;case"drag":E=ns(J||q,_),ke=o;break}M.call(B,v,new Eu(B,{sourceEvent:q,subject:R,target:h,identifier:C,active:ke,x:E[0]+z,y:E[1]+V,dx:E[0]-ge[0],dy:E[1]-ge[1],dispatch:M}),L)}}return h.filter=function(v){return arguments.length?(t=typeof v=="function"?v:da(!!v),h):t},h.container=function(v){return arguments.length?(e=typeof v=="function"?v:da(v),h):e},h.subject=function(v){return arguments.length?(n=typeof v=="function"?v:da(v),h):n},h.touchable=function(v){return arguments.length?(s=typeof v=="function"?v:da(!!v),h):s},h.on=function(){var v=i.on.apply(i,arguments);return v===i?h:v},h.clickDistance=function(v){return arguments.length?(d=(v=+v)*v,h):Math.sqrt(d)},h}function Fd(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function tb(t,e){var n=Object.create(t.prototype);for(var s in e)n[s]=e[s];return n}function jo(){}var bo=.7,ll=1/bo,qr="\\s*([+-]?\\d+)\\s*",xo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",m7=/^#([0-9a-f]{3,8})$/,y7=new RegExp(`^rgb\\(${qr},${qr},${qr}\\)$`),b7=new RegExp(`^rgb\\(${Hn},${Hn},${Hn}\\)$`),x7=new RegExp(`^rgba\\(${qr},${qr},${qr},${xo}\\)$`),v7=new RegExp(`^rgba\\(${Hn},${Hn},${Hn},${xo}\\)$`),_7=new RegExp(`^hsl\\(${xo},${Hn},${Hn}\\)$`),k7=new RegExp(`^hsla\\(${xo},${Hn},${Hn},${xo}\\)$`),Xg={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Fd(jo,vo,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Jg,formatHex:Jg,formatHex8:w7,formatHsl:S7,formatRgb:Zg,toString:Zg});function Jg(){return this.rgb().formatHex()}function w7(){return this.rgb().formatHex8()}function S7(){return nb(this).formatHsl()}function Zg(){return this.rgb().formatRgb()}function vo(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=m7.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Qg(e):n===3?new Xt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?fa(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?fa(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=y7.exec(t))?new Xt(e[1],e[2],e[3],1):(e=b7.exec(t))?new Xt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=x7.exec(t))?fa(e[1],e[2],e[3],e[4]):(e=v7.exec(t))?fa(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=_7.exec(t))?n0(e[1],e[2]/100,e[3]/100,1):(e=k7.exec(t))?n0(e[1],e[2]/100,e[3]/100,e[4]):Xg.hasOwnProperty(t)?Qg(Xg[t]):t==="transparent"?new Xt(NaN,NaN,NaN,0):null}function Qg(t){return new Xt(t>>16&255,t>>8&255,t&255,1)}function fa(t,e,n,s){return s<=0&&(t=e=n=NaN),new Xt(t,e,n,s)}function $7(t){return t instanceof jo||(t=vo(t)),t?(t=t.rgb(),new Xt(t.r,t.g,t.b,t.opacity)):new Xt}function Pu(t,e,n,s){return arguments.length===1?$7(t):new Xt(t,e,n,s??1)}function Xt(t,e,n,s){this.r=+t,this.g=+e,this.b=+n,this.opacity=+s}Fd(Xt,Pu,tb(jo,{brighter(t){return t=t==null?ll:Math.pow(ll,t),new Xt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?bo:Math.pow(bo,t),new Xt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Xt(hr(this.r),hr(this.g),hr(this.b),cl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:e0,formatHex:e0,formatHex8:C7,formatRgb:t0,toString:t0}));function e0(){return`#${ar(this.r)}${ar(this.g)}${ar(this.b)}`}function C7(){return`#${ar(this.r)}${ar(this.g)}${ar(this.b)}${ar((isNaN(this.opacity)?1:this.opacity)*255)}`}function t0(){const t=cl(this.opacity);return`${t===1?"rgb(":"rgba("}${hr(this.r)}, ${hr(this.g)}, ${hr(this.b)}${t===1?")":`, ${t})`}`}function cl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function hr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ar(t){return t=hr(t),(t<16?"0":"")+t.toString(16)}function n0(t,e,n,s){return s<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new kn(t,e,n,s)}function nb(t){if(t instanceof kn)return new kn(t.h,t.s,t.l,t.opacity);if(t instanceof jo||(t=vo(t)),!t)return new kn;if(t instanceof kn)return t;t=t.rgb();var e=t.r/255,n=t.g/255,s=t.b/255,r=Math.min(e,n,s),i=Math.max(e,n,s),o=NaN,a=i-r,l=(i+r)/2;return a?(e===i?o=(n-s)/a+(n<s)*6:n===i?o=(s-e)/a+2:o=(e-n)/a+4,a/=l<.5?i+r:2-i-r,o*=60):a=l>0&&l<1?0:o,new kn(o,a,l,t.opacity)}function T7(t,e,n,s){return arguments.length===1?nb(t):new kn(t,e,n,s??1)}function kn(t,e,n,s){this.h=+t,this.s=+e,this.l=+n,this.opacity=+s}Fd(kn,T7,tb(jo,{brighter(t){return t=t==null?ll:Math.pow(ll,t),new kn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?bo:Math.pow(bo,t),new kn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*e,r=2*n-s;return new Xt(Nc(t>=240?t-240:t+120,r,s),Nc(t,r,s),Nc(t<120?t+240:t-120,r,s),this.opacity)},clamp(){return new kn(s0(this.h),ha(this.s),ha(this.l),cl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=cl(this.opacity);return`${t===1?"hsl(":"hsla("}${s0(this.h)}, ${ha(this.s)*100}%, ${ha(this.l)*100}%${t===1?")":`, ${t})`}`}}));function s0(t){return t=(t||0)%360,t<0?t+360:t}function ha(t){return Math.max(0,Math.min(1,t||0))}function Nc(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const sb=t=>()=>t;function M7(t,e){return function(n){return t+n*e}}function A7(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(s){return Math.pow(t+s*e,n)}}function E7(t){return(t=+t)==1?rb:function(e,n){return n-e?A7(e,n,t):sb(isNaN(e)?n:e)}}function rb(t,e){var n=e-t;return n?M7(t,n):sb(isNaN(t)?e:t)}const r0=function t(e){var n=E7(e);function s(r,i){var o=n((r=Pu(r)).r,(i=Pu(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=rb(r.opacity,i.opacity);return function(u){return r.r=o(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return s.gamma=t,s}(1);function Es(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Ru=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fc=new RegExp(Ru.source,"g");function P7(t){return function(){return t}}function R7(t){return function(e){return t(e)+""}}function D7(t,e){var n=Ru.lastIndex=Fc.lastIndex=0,s,r,i,o=-1,a=[],l=[];for(t=t+"",e=e+"";(s=Ru.exec(t))&&(r=Fc.exec(e));)(i=r.index)>n&&(i=e.slice(n,i),a[o]?a[o]+=i:a[++o]=i),(s=s[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:Es(s,r)})),n=Fc.lastIndex;return n<e.length&&(i=e.slice(n),a[o]?a[o]+=i:a[++o]=i),a.length<2?l[0]?R7(l[0].x):P7(e):(e=l.length,function(c){for(var u=0,d;u<e;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}var i0=180/Math.PI,Du={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ib(t,e,n,s,r,i){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*s)&&(n-=t*l,s-=e*l),(a=Math.sqrt(n*n+s*s))&&(n/=a,s/=a,l/=a),t*s<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:r,translateY:i,rotate:Math.atan2(e,t)*i0,skewX:Math.atan(l)*i0,scaleX:o,scaleY:a}}var ga;function O7(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Du:ib(e.a,e.b,e.c,e.d,e.e,e.f)}function I7(t){return t==null||(ga||(ga=document.createElementNS("http://www.w3.org/2000/svg","g")),ga.setAttribute("transform",t),!(t=ga.transform.baseVal.consolidate()))?Du:(t=t.matrix,ib(t.a,t.b,t.c,t.d,t.e,t.f))}function ob(t,e,n,s){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,h,g,p){if(c!==d||u!==h){var m=g.push("translate(",null,e,null,n);p.push({i:m-4,x:Es(c,d)},{i:m-2,x:Es(u,h)})}else(d||h)&&g.push("translate("+d+e+h+n)}function o(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(r(d)+"rotate(",null,s)-2,x:Es(c,u)})):u&&d.push(r(d)+"rotate("+u+s)}function a(c,u,d,h){c!==u?h.push({i:d.push(r(d)+"skewX(",null,s)-2,x:Es(c,u)}):u&&d.push(r(d)+"skewX("+u+s)}function l(c,u,d,h,g,p){if(c!==d||u!==h){var m=g.push(r(g)+"scale(",null,",",null,")");p.push({i:m-4,x:Es(c,d)},{i:m-2,x:Es(u,h)})}else(d!==1||h!==1)&&g.push(r(g)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=t(c),u=t(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,h),o(c.rotate,u.rotate,d,h),a(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(g){for(var p=-1,m=h.length,y;++p<m;)d[(y=h[p]).i]=y.x(g);return d.join("")}}}var L7=ob(O7,"px, ","px)","deg)"),N7=ob(I7,", ",")",")"),F7=1e-12;function o0(t){return((t=Math.exp(t))+1/t)/2}function j7(t){return((t=Math.exp(t))-1/t)/2}function z7(t){return((t=Math.exp(2*t))-1)/(t+1)}const B7=function t(e,n,s){function r(i,o){var a=i[0],l=i[1],c=i[2],u=o[0],d=o[1],h=o[2],g=u-a,p=d-l,m=g*g+p*p,y,x;if(m<F7)x=Math.log(h/c)/e,y=function(L){return[a+L*g,l+L*p,c*Math.exp(e*L*x)]};else{var S=Math.sqrt(m),T=(h*h-c*c+s*m)/(2*c*n*S),v=(h*h-c*c-s*m)/(2*h*n*S),_=Math.log(Math.sqrt(T*T+1)-T),P=Math.log(Math.sqrt(v*v+1)-v);x=(P-_)/e,y=function(L){var C=L*x,w=o0(_),M=c/(n*S)*(w*z7(e*C+_)-j7(_));return[a+M*g,l+M*p,c*w/o0(e*C+_)]}}return y.duration=x*1e3*e/Math.SQRT2,y}return r.rho=function(i){var o=Math.max(.001,+i),a=o*o,l=a*a;return t(o,a,l)},r}(Math.SQRT2,2,4);var ri=0,Li=0,Ti=0,ab=1e3,ul,Ni,dl=0,wr=0,ql=0,_o=typeof performance=="object"&&performance.now?performance:Date,lb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function jd(){return wr||(lb(H7),wr=_o.now()+ql)}function H7(){wr=0}function fl(){this._call=this._time=this._next=null}fl.prototype=zd.prototype={constructor:fl,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?jd():+n)+(e==null?0:+e),!this._next&&Ni!==this&&(Ni?Ni._next=this:ul=this,Ni=this),this._call=t,this._time=n,Ou()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ou())}};function zd(t,e,n){var s=new fl;return s.restart(t,e,n),s}function U7(){jd(),++ri;for(var t=ul,e;t;)(e=wr-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ri}function a0(){wr=(dl=_o.now())+ql,ri=Li=0;try{U7()}finally{ri=0,W7(),wr=0}}function V7(){var t=_o.now(),e=t-dl;e>ab&&(ql-=e,dl=t)}function W7(){for(var t,e=ul,n,s=1/0;e;)e._call?(s>e._time&&(s=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ul=n);Ni=t,Ou(s)}function Ou(t){if(!ri){Li&&(Li=clearTimeout(Li));var e=t-wr;e>24?(t<1/0&&(Li=setTimeout(a0,t-_o.now()-ql)),Ti&&(Ti=clearInterval(Ti))):(Ti||(dl=_o.now(),Ti=setInterval(V7,ab)),ri=1,lb(a0))}}function l0(t,e,n){var s=new fl;return e=e==null?0:+e,s.restart(r=>{s.stop(),t(r+e)},e,n),s}var q7=No("start","end","cancel","interrupt"),K7=[],cb=0,c0=1,Iu=2,Oa=3,u0=4,Lu=5,Ia=6;function Kl(t,e,n,s,r,i){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;G7(t,n,{name:e,index:s,group:r,on:q7,tween:K7,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:cb})}function Bd(t,e){var n=Tn(t,e);if(n.state>cb)throw new Error("too late; already scheduled");return n}function Wn(t,e){var n=Tn(t,e);if(n.state>Oa)throw new Error("too late; already running");return n}function Tn(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function G7(t,e,n){var s=t.__transition,r;s[e]=n,n.timer=zd(i,0,n.time);function i(c){n.state=c0,n.timer.restart(o,n.delay,n.time),n.delay<=c&&o(c-n.delay)}function o(c){var u,d,h,g;if(n.state!==c0)return l();for(u in s)if(g=s[u],g.name===n.name){if(g.state===Oa)return l0(o);g.state===u0?(g.state=Ia,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete s[u]):+u<e&&(g.state=Ia,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete s[u])}if(l0(function(){n.state===Oa&&(n.state=u0,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Iu,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Iu){for(n.state=Oa,r=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(g=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++d]=g);r.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Lu,1),d=-1,h=r.length;++d<h;)r[d].call(t,u);n.state===Lu&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=Ia,n.timer.stop(),delete s[e];for(var c in s)return;delete t.__transition}}function La(t,e){var n=t.__transition,s,r,i=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((s=n[o]).name!==e){i=!1;continue}r=s.state>Iu&&s.state<Lu,s.state=Ia,s.timer.stop(),s.on.call(r?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete n[o]}i&&delete t.__transition}}function Y7(t){return this.each(function(){La(this,t)})}function X7(t,e){var n,s;return function(){var r=Wn(this,t),i=r.tween;if(i!==n){s=n=i;for(var o=0,a=s.length;o<a;++o)if(s[o].name===e){s=s.slice(),s.splice(o,1);break}}r.tween=s}}function J7(t,e,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=Wn(this,t),o=i.tween;if(o!==s){r=(s=o).slice();for(var a={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function Z7(t,e){var n=this._id;if(t+="",arguments.length<2){for(var s=Tn(this.node(),n).tween,r=0,i=s.length,o;r<i;++r)if((o=s[r]).name===t)return o.value;return null}return this.each((e==null?X7:J7)(n,t,e))}function Hd(t,e,n){var s=t._id;return t.each(function(){var r=Wn(this,s);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return Tn(r,s).value[e]}}function ub(t,e){var n;return(typeof e=="number"?Es:e instanceof vo?r0:(n=vo(e))?(e=n,r0):D7)(t,e)}function Q7(t){return function(){this.removeAttribute(t)}}function eL(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tL(t,e,n){var s,r=n+"",i;return function(){var o=this.getAttribute(t);return o===r?null:o===s?i:i=e(s=o,n)}}function nL(t,e,n){var s,r=n+"",i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===r?null:o===s?i:i=e(s=o,n)}}function sL(t,e,n){var s,r,i;return function(){var o,a=n(this),l;return a==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=a+"",o===l?null:o===s&&l===r?i:(r=l,i=e(s=o,a)))}}function rL(t,e,n){var s,r,i;return function(){var o,a=n(this),l;return a==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=a+"",o===l?null:o===s&&l===r?i:(r=l,i=e(s=o,a)))}}function iL(t,e){var n=Wl(t),s=n==="transform"?N7:ub;return this.attrTween(t,typeof e=="function"?(n.local?rL:sL)(n,s,Hd(this,"attr."+t,e)):e==null?(n.local?eL:Q7)(n):(n.local?nL:tL)(n,s,e))}function oL(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function aL(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function lL(t,e){var n,s;function r(){var i=e.apply(this,arguments);return i!==s&&(n=(s=i)&&aL(t,i)),n}return r._value=e,r}function cL(t,e){var n,s;function r(){var i=e.apply(this,arguments);return i!==s&&(n=(s=i)&&oL(t,i)),n}return r._value=e,r}function uL(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var s=Wl(t);return this.tween(n,(s.local?lL:cL)(s,e))}function dL(t,e){return function(){Bd(this,t).delay=+e.apply(this,arguments)}}function fL(t,e){return e=+e,function(){Bd(this,t).delay=e}}function hL(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?dL:fL)(e,t)):Tn(this.node(),e).delay}function gL(t,e){return function(){Wn(this,t).duration=+e.apply(this,arguments)}}function pL(t,e){return e=+e,function(){Wn(this,t).duration=e}}function mL(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?gL:pL)(e,t)):Tn(this.node(),e).duration}function yL(t,e){if(typeof e!="function")throw new Error;return function(){Wn(this,t).ease=e}}function bL(t){var e=this._id;return arguments.length?this.each(yL(e,t)):Tn(this.node(),e).ease}function xL(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Wn(this,t).ease=n}}function vL(t){if(typeof t!="function")throw new Error;return this.each(xL(this._id,t))}function _L(t){typeof t!="function"&&(t=Uy(t));for(var e=this._groups,n=e.length,s=new Array(n),r=0;r<n;++r)for(var i=e[r],o=i.length,a=s[r]=[],l,c=0;c<o;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&a.push(l);return new ys(s,this._parents,this._name,this._id)}function kL(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,s=e.length,r=n.length,i=Math.min(s,r),o=new Array(s),a=0;a<i;++a)for(var l=e[a],c=n[a],u=l.length,d=o[a]=new Array(u),h,g=0;g<u;++g)(h=l[g]||c[g])&&(d[g]=h);for(;a<s;++a)o[a]=e[a];return new ys(o,this._parents,this._name,this._id)}function wL(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function SL(t,e,n){var s,r,i=wL(e)?Bd:Wn;return function(){var o=i(this,t),a=o.on;a!==s&&(r=(s=a).copy()).on(e,n),o.on=r}}function $L(t,e){var n=this._id;return arguments.length<2?Tn(this.node(),n).on.on(t):this.each(SL(n,t,e))}function CL(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function TL(){return this.on("end.remove",CL(this._id))}function ML(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ld(t));for(var s=this._groups,r=s.length,i=new Array(r),o=0;o<r;++o)for(var a=s[o],l=a.length,c=i[o]=new Array(l),u,d,h=0;h<l;++h)(u=a[h])&&(d=t.call(u,u.__data__,h,a))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,Kl(c[h],e,n,h,c,Tn(u,n)));return new ys(i,this._parents,e,n)}function AL(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Hy(t));for(var s=this._groups,r=s.length,i=[],o=[],a=0;a<r;++a)for(var l=s[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=t.call(u,u.__data__,d,l),g,p=Tn(u,n),m=0,y=h.length;m<y;++m)(g=h[m])&&Kl(g,e,n,m,h,p);i.push(h),o.push(u)}return new ys(i,o,e,n)}var EL=Fo.prototype.constructor;function PL(){return new EL(this._groups,this._parents)}function RL(t,e){var n,s,r;return function(){var i=si(this,t),o=(this.style.removeProperty(t),si(this,t));return i===o?null:i===n&&o===s?r:r=e(n=i,s=o)}}function db(t){return function(){this.style.removeProperty(t)}}function DL(t,e,n){var s,r=n+"",i;return function(){var o=si(this,t);return o===r?null:o===s?i:i=e(s=o,n)}}function OL(t,e,n){var s,r,i;return function(){var o=si(this,t),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(t),si(this,t))),o===l?null:o===s&&l===r?i:(r=l,i=e(s=o,a))}}function IL(t,e){var n,s,r,i="style."+e,o="end."+i,a;return function(){var l=Wn(this,t),c=l.on,u=l.value[i]==null?a||(a=db(e)):void 0;(c!==n||r!==u)&&(s=(n=c).copy()).on(o,r=u),l.on=s}}function LL(t,e,n){var s=(t+="")=="transform"?L7:ub;return e==null?this.styleTween(t,RL(t,s)).on("end.style."+t,db(t)):typeof e=="function"?this.styleTween(t,OL(t,s,Hd(this,"style."+t,e))).each(IL(this._id,t)):this.styleTween(t,DL(t,s,e),n).on("end.style."+t,null)}function NL(t,e,n){return function(s){this.style.setProperty(t,e.call(this,s),n)}}function FL(t,e,n){var s,r;function i(){var o=e.apply(this,arguments);return o!==r&&(s=(r=o)&&NL(t,o,n)),s}return i._value=e,i}function jL(t,e,n){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(e==null)return this.tween(s,null);if(typeof e!="function")throw new Error;return this.tween(s,FL(t,e,n??""))}function zL(t){return function(){this.textContent=t}}function BL(t){return function(){var e=t(this);this.textContent=e??""}}function HL(t){return this.tween("text",typeof t=="function"?BL(Hd(this,"text",t)):zL(t==null?"":t+""))}function UL(t){return function(e){this.textContent=t.call(this,e)}}function VL(t){var e,n;function s(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&UL(r)),e}return s._value=t,s}function WL(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,VL(t))}function qL(){for(var t=this._name,e=this._id,n=fb(),s=this._groups,r=s.length,i=0;i<r;++i)for(var o=s[i],a=o.length,l,c=0;c<a;++c)if(l=o[c]){var u=Tn(l,e);Kl(l,t,n,c,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ys(s,this._parents,t,n)}function KL(){var t,e,n=this,s=n._id,r=n.size();return new Promise(function(i,o){var a={value:o},l={value:function(){--r===0&&i()}};n.each(function(){var c=Wn(this,s),u=c.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),c.on=e}),r===0&&i()})}var GL=0;function ys(t,e,n,s){this._groups=t,this._parents=e,this._name=n,this._id=s}function fb(){return++GL}var Jn=Fo.prototype;ys.prototype={constructor:ys,select:ML,selectAll:AL,selectChild:Jn.selectChild,selectChildren:Jn.selectChildren,filter:_L,merge:kL,selection:PL,transition:qL,call:Jn.call,nodes:Jn.nodes,node:Jn.node,size:Jn.size,empty:Jn.empty,each:Jn.each,on:$L,attr:iL,attrTween:uL,style:LL,styleTween:jL,text:HL,textTween:WL,remove:TL,tween:Z7,delay:hL,duration:mL,ease:bL,easeVarying:vL,end:KL,[Symbol.iterator]:Jn[Symbol.iterator]};function YL(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var XL={time:null,delay:0,duration:250,ease:YL};function JL(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function ZL(t){var e,n;t instanceof ys?(e=t._id,t=t._name):(e=fb(),(n=XL).time=jd(),t=t==null?null:t+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var o=s[i],a=o.length,l,c=0;c<a;++c)(l=o[c])&&Kl(l,t,e,c,o,n||JL(l,e));return new ys(s,this._parents,t,e)}Fo.prototype.interrupt=Y7;Fo.prototype.transition=ZL;function QL(t,e){var n,s=1;t==null&&(t=0),e==null&&(e=0);function r(){var i,o=n.length,a,l=0,c=0;for(i=0;i<o;++i)a=n[i],l+=a.x,c+=a.y;for(l=(l/o-t)*s,c=(c/o-e)*s,i=0;i<o;++i)a=n[i],a.x-=l,a.y-=c}return r.initialize=function(i){n=i},r.x=function(i){return arguments.length?(t=+i,r):t},r.y=function(i){return arguments.length?(e=+i,r):e},r.strength=function(i){return arguments.length?(s=+i,r):s},r}function e9(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return hb(this.cover(e,n),e,n,t)}function hb(t,e,n,s){if(isNaN(e)||isNaN(n))return t;var r,i=t._root,o={data:s},a=t._x0,l=t._y0,c=t._x1,u=t._y1,d,h,g,p,m,y,x,S;if(!i)return t._root=o,t;for(;i.length;)if((m=e>=(d=(a+c)/2))?a=d:c=d,(y=n>=(h=(l+u)/2))?l=h:u=h,r=i,!(i=i[x=y<<1|m]))return r[x]=o,t;if(g=+t._x.call(null,i.data),p=+t._y.call(null,i.data),e===g&&n===p)return o.next=i,r?r[x]=o:t._root=o,t;do r=r?r[x]=new Array(4):t._root=new Array(4),(m=e>=(d=(a+c)/2))?a=d:c=d,(y=n>=(h=(l+u)/2))?l=h:u=h;while((x=y<<1|m)===(S=(p>=h)<<1|g>=d));return r[S]=i,r[x]=o,t}function t9(t){var e,n,s=t.length,r,i,o=new Array(s),a=new Array(s),l=1/0,c=1/0,u=-1/0,d=-1/0;for(n=0;n<s;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(o[n]=r,a[n]=i,r<l&&(l=r),r>u&&(u=r),i<c&&(c=i),i>d&&(d=i));if(l>u||c>d)return this;for(this.cover(l,c).cover(u,d),n=0;n<s;++n)hb(this,o[n],a[n],t[n]);return this}function n9(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,s=this._y0,r=this._x1,i=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,i=(s=Math.floor(e))+1;else{for(var o=r-n||1,a=this._root,l,c;n>t||t>=r||s>e||e>=i;)switch(c=(e<s)<<1|t<n,l=new Array(4),l[c]=a,a=l,o*=2,c){case 0:r=n+o,i=s+o;break;case 1:n=r-o,i=s+o;break;case 2:r=n+o,s=i-o;break;case 3:n=r-o,s=i-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=s,this._x1=r,this._y1=i,this}function s9(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function r9(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Bt(t,e,n,s,r){this.node=t,this.x0=e,this.y0=n,this.x1=s,this.y1=r}function i9(t,e,n){var s,r=this._x0,i=this._y0,o,a,l,c,u=this._x1,d=this._y1,h=[],g=this._root,p,m;for(g&&h.push(new Bt(g,r,i,u,d)),n==null?n=1/0:(r=t-n,i=e-n,u=t+n,d=e+n,n*=n);p=h.pop();)if(!(!(g=p.node)||(o=p.x0)>u||(a=p.y0)>d||(l=p.x1)<r||(c=p.y1)<i))if(g.length){var y=(o+l)/2,x=(a+c)/2;h.push(new Bt(g[3],y,x,l,c),new Bt(g[2],o,x,y,c),new Bt(g[1],y,a,l,x),new Bt(g[0],o,a,y,x)),(m=(e>=x)<<1|t>=y)&&(p=h[h.length-1],h[h.length-1]=h[h.length-1-m],h[h.length-1-m]=p)}else{var S=t-+this._x.call(null,g.data),T=e-+this._y.call(null,g.data),v=S*S+T*T;if(v<n){var _=Math.sqrt(n=v);r=t-_,i=e-_,u=t+_,d=e+_,s=g.data}}return s}function o9(t){if(isNaN(u=+this._x.call(null,t))||isNaN(d=+this._y.call(null,t)))return this;var e,n=this._root,s,r,i,o=this._x0,a=this._y0,l=this._x1,c=this._y1,u,d,h,g,p,m,y,x;if(!n)return this;if(n.length)for(;;){if((p=u>=(h=(o+l)/2))?o=h:l=h,(m=d>=(g=(a+c)/2))?a=g:c=g,e=n,!(n=n[y=m<<1|p]))return this;if(!n.length)break;(e[y+1&3]||e[y+2&3]||e[y+3&3])&&(s=e,x=y)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(i=n.next)&&delete n.next,r?(i?r.next=i:delete r.next,this):e?(i?e[y]=i:delete e[y],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(s?s[x]=n:this._root=n),this):(this._root=i,this)}function a9(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function l9(){return this._root}function c9(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function u9(t){var e=[],n,s=this._root,r,i,o,a,l;for(s&&e.push(new Bt(s,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(s=n.node,i=n.x0,o=n.y0,a=n.x1,l=n.y1)&&s.length){var c=(i+a)/2,u=(o+l)/2;(r=s[3])&&e.push(new Bt(r,c,u,a,l)),(r=s[2])&&e.push(new Bt(r,i,u,c,l)),(r=s[1])&&e.push(new Bt(r,c,o,a,u)),(r=s[0])&&e.push(new Bt(r,i,o,c,u))}return this}function d9(t){var e=[],n=[],s;for(this._root&&e.push(new Bt(this._root,this._x0,this._y0,this._x1,this._y1));s=e.pop();){var r=s.node;if(r.length){var i,o=s.x0,a=s.y0,l=s.x1,c=s.y1,u=(o+l)/2,d=(a+c)/2;(i=r[0])&&e.push(new Bt(i,o,a,u,d)),(i=r[1])&&e.push(new Bt(i,u,a,l,d)),(i=r[2])&&e.push(new Bt(i,o,d,u,c)),(i=r[3])&&e.push(new Bt(i,u,d,l,c))}n.push(s)}for(;s=n.pop();)t(s.node,s.x0,s.y0,s.x1,s.y1);return this}function f9(t){return t[0]}function h9(t){return arguments.length?(this._x=t,this):this._x}function g9(t){return t[1]}function p9(t){return arguments.length?(this._y=t,this):this._y}function Ud(t,e,n){var s=new Vd(e??f9,n??g9,NaN,NaN,NaN,NaN);return t==null?s:s.addAll(t)}function Vd(t,e,n,s,r,i){this._x=t,this._y=e,this._x0=n,this._y0=s,this._x1=r,this._y1=i,this._root=void 0}function d0(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Wt=Ud.prototype=Vd.prototype;Wt.copy=function(){var t=new Vd(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,s;if(!e)return t;if(!e.length)return t._root=d0(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var r=0;r<4;++r)(s=e.source[r])&&(s.length?n.push({source:s,target:e.target[r]=new Array(4)}):e.target[r]=d0(s));return t};Wt.add=e9;Wt.addAll=t9;Wt.cover=n9;Wt.data=s9;Wt.extent=r9;Wt.find=i9;Wt.remove=o9;Wt.removeAll=a9;Wt.root=l9;Wt.size=c9;Wt.visit=u9;Wt.visitAfter=d9;Wt.x=h9;Wt.y=p9;function gr(t){return function(){return t}}function Ls(t){return(t()-.5)*1e-6}function m9(t){return t.x+t.vx}function y9(t){return t.y+t.vy}function b9(t){var e,n,s,r=1,i=1;typeof t!="function"&&(t=gr(t==null?1:+t));function o(){for(var c,u=e.length,d,h,g,p,m,y,x=0;x<i;++x)for(d=Ud(e,m9,y9).visitAfter(a),c=0;c<u;++c)h=e[c],m=n[h.index],y=m*m,g=h.x+h.vx,p=h.y+h.vy,d.visit(S);function S(T,v,_,P,L){var C=T.data,w=T.r,M=m+w;if(C){if(C.index>h.index){var E=g-C.x-C.vx,z=p-C.y-C.vy,V=E*E+z*z;V<M*M&&(E===0&&(E=Ls(s),V+=E*E),z===0&&(z=Ls(s),V+=z*z),V=(M-(V=Math.sqrt(V)))/V*r,h.vx+=(E*=V)*(M=(w*=w)/(y+w)),h.vy+=(z*=V)*M,C.vx-=E*(M=1-M),C.vy-=z*M)}return}return v>g+M||P<g-M||_>p+M||L<p-M}}function a(c){if(c.data)return c.r=n[c.data.index];for(var u=c.r=0;u<4;++u)c[u]&&c[u].r>c.r&&(c.r=c[u].r)}function l(){if(e){var c,u=e.length,d;for(n=new Array(u),c=0;c<u;++c)d=e[c],n[d.index]=+t(d,c,e)}}return o.initialize=function(c,u){e=c,s=u,l()},o.iterations=function(c){return arguments.length?(i=+c,o):i},o.strength=function(c){return arguments.length?(r=+c,o):r},o.radius=function(c){return arguments.length?(t=typeof c=="function"?c:gr(+c),l(),o):t},o}function x9(t){return t.index}function f0(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function v9(t){var e=x9,n=d,s,r=gr(30),i,o,a,l,c,u=1;t==null&&(t=[]);function d(y){return 1/Math.min(a[y.source.index],a[y.target.index])}function h(y){for(var x=0,S=t.length;x<u;++x)for(var T=0,v,_,P,L,C,w,M;T<S;++T)v=t[T],_=v.source,P=v.target,L=P.x+P.vx-_.x-_.vx||Ls(c),C=P.y+P.vy-_.y-_.vy||Ls(c),w=Math.sqrt(L*L+C*C),w=(w-i[T])/w*y*s[T],L*=w,C*=w,P.vx-=L*(M=l[T]),P.vy-=C*M,_.vx+=L*(M=1-M),_.vy+=C*M}function g(){if(o){var y,x=o.length,S=t.length,T=new Map(o.map((_,P)=>[e(_,P,o),_])),v;for(y=0,a=new Array(x);y<S;++y)v=t[y],v.index=y,typeof v.source!="object"&&(v.source=f0(T,v.source)),typeof v.target!="object"&&(v.target=f0(T,v.target)),a[v.source.index]=(a[v.source.index]||0)+1,a[v.target.index]=(a[v.target.index]||0)+1;for(y=0,l=new Array(S);y<S;++y)v=t[y],l[y]=a[v.source.index]/(a[v.source.index]+a[v.target.index]);s=new Array(S),p(),i=new Array(S),m()}}function p(){if(o)for(var y=0,x=t.length;y<x;++y)s[y]=+n(t[y],y,t)}function m(){if(o)for(var y=0,x=t.length;y<x;++y)i[y]=+r(t[y],y,t)}return h.initialize=function(y,x){o=y,c=x,g()},h.links=function(y){return arguments.length?(t=y,g(),h):t},h.id=function(y){return arguments.length?(e=y,h):e},h.iterations=function(y){return arguments.length?(u=+y,h):u},h.strength=function(y){return arguments.length?(n=typeof y=="function"?y:gr(+y),p(),h):n},h.distance=function(y){return arguments.length?(r=typeof y=="function"?y:gr(+y),m(),h):r},h}const _9=1664525,k9=1013904223,h0=4294967296;function w9(){let t=1;return()=>(t=(_9*t+k9)%h0)/h0}function S9(t){return t.x}function $9(t){return t.y}var C9=10,T9=Math.PI*(3-Math.sqrt(5));function M9(t){var e,n=1,s=.001,r=1-Math.pow(s,1/300),i=0,o=.6,a=new Map,l=zd(d),c=No("tick","end"),u=w9();t==null&&(t=[]);function d(){h(),c.call("tick",e),n<s&&(l.stop(),c.call("end",e))}function h(m){var y,x=t.length,S;m===void 0&&(m=1);for(var T=0;T<m;++T)for(n+=(i-n)*r,a.forEach(function(v){v(n)}),y=0;y<x;++y)S=t[y],S.fx==null?S.x+=S.vx*=o:(S.x=S.fx,S.vx=0),S.fy==null?S.y+=S.vy*=o:(S.y=S.fy,S.vy=0);return e}function g(){for(var m=0,y=t.length,x;m<y;++m){if(x=t[m],x.index=m,x.fx!=null&&(x.x=x.fx),x.fy!=null&&(x.y=x.fy),isNaN(x.x)||isNaN(x.y)){var S=C9*Math.sqrt(.5+m),T=m*T9;x.x=S*Math.cos(T),x.y=S*Math.sin(T)}(isNaN(x.vx)||isNaN(x.vy))&&(x.vx=x.vy=0)}}function p(m){return m.initialize&&m.initialize(t,u),m}return g(),e={tick:h,restart:function(){return l.restart(d),e},stop:function(){return l.stop(),e},nodes:function(m){return arguments.length?(t=m,g(),a.forEach(p),e):t},alpha:function(m){return arguments.length?(n=+m,e):n},alphaMin:function(m){return arguments.length?(s=+m,e):s},alphaDecay:function(m){return arguments.length?(r=+m,e):+r},alphaTarget:function(m){return arguments.length?(i=+m,e):i},velocityDecay:function(m){return arguments.length?(o=1-m,e):1-o},randomSource:function(m){return arguments.length?(u=m,a.forEach(p),e):u},force:function(m,y){return arguments.length>1?(y==null?a.delete(m):a.set(m,p(y)),e):a.get(m)},find:function(m,y,x){var S=0,T=t.length,v,_,P,L,C;for(x==null?x=1/0:x*=x,S=0;S<T;++S)L=t[S],v=m-L.x,_=y-L.y,P=v*v+_*_,P<x&&(C=L,x=P);return C},on:function(m,y){return arguments.length>1?(c.on(m,y),e):c.on(m)}}}function A9(){var t,e,n,s,r=gr(-30),i,o=1,a=1/0,l=.81;function c(g){var p,m=t.length,y=Ud(t,S9,$9).visitAfter(d);for(s=g,p=0;p<m;++p)e=t[p],y.visit(h)}function u(){if(t){var g,p=t.length,m;for(i=new Array(p),g=0;g<p;++g)m=t[g],i[m.index]=+r(m,g,t)}}function d(g){var p=0,m,y,x=0,S,T,v;if(g.length){for(S=T=v=0;v<4;++v)(m=g[v])&&(y=Math.abs(m.value))&&(p+=m.value,x+=y,S+=y*m.x,T+=y*m.y);g.x=S/x,g.y=T/x}else{m=g,m.x=m.data.x,m.y=m.data.y;do p+=i[m.data.index];while(m=m.next)}g.value=p}function h(g,p,m,y){if(!g.value)return!0;var x=g.x-e.x,S=g.y-e.y,T=y-p,v=x*x+S*S;if(T*T/l<v)return v<a&&(x===0&&(x=Ls(n),v+=x*x),S===0&&(S=Ls(n),v+=S*S),v<o&&(v=Math.sqrt(o*v)),e.vx+=x*g.value*s/v,e.vy+=S*g.value*s/v),!0;if(g.length||v>=a)return;(g.data!==e||g.next)&&(x===0&&(x=Ls(n),v+=x*x),S===0&&(S=Ls(n),v+=S*S),v<o&&(v=Math.sqrt(o*v)));do g.data!==e&&(T=i[g.data.index]*s/v,e.vx+=x*T,e.vy+=S*T);while(g=g.next)}return c.initialize=function(g,p){t=g,n=p,u()},c.strength=function(g){return arguments.length?(r=typeof g=="function"?g:gr(+g),u(),c):r},c.distanceMin=function(g){return arguments.length?(o=g*g,c):Math.sqrt(o)},c.distanceMax=function(g){return arguments.length?(a=g*g,c):Math.sqrt(a)},c.theta=function(g){return arguments.length?(l=g*g,c):Math.sqrt(l)},c}const pa=t=>()=>t;function E9(t,{sourceEvent:e,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function ds(t,e,n){this.k=t,this.x=e,this.y=n}ds.prototype={constructor:ds,scale:function(t){return t===1?this:new ds(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ds(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Wd=new ds(1,0,0);ds.prototype;function jc(t){t.stopImmediatePropagation()}function Mi(t){t.preventDefault(),t.stopImmediatePropagation()}function P9(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function R9(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function g0(){return this.__zoom||Wd}function D9(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function O9(){return navigator.maxTouchPoints||"ontouchstart"in this}function I9(t,e,n){var s=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function L9(){var t=P9,e=R9,n=I9,s=D9,r=O9,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=B7,c=No("start","zoom","end"),u,d,h,g=500,p=150,m=0,y=10;function x(R){R.property("__zoom",g0).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",w).on("dblclick.zoom",M).filter(r).on("touchstart.zoom",E).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(R,j,B,q){var J=R.selection?R.selection():R;J.property("__zoom",g0),R!==J?_(R,j,B,q):J.interrupt().each(function(){P(this,arguments).event(q).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},x.scaleBy=function(R,j,B,q){x.scaleTo(R,function(){var J=this.__zoom.k,ge=typeof j=="function"?j.apply(this,arguments):j;return J*ge},B,q)},x.scaleTo=function(R,j,B,q){x.transform(R,function(){var J=e.apply(this,arguments),ge=this.__zoom,ke=B==null?v(J):typeof B=="function"?B.apply(this,arguments):B,ye=ge.invert(ke),ie=typeof j=="function"?j.apply(this,arguments):j;return n(T(S(ge,ie),ke,ye),J,o)},B,q)},x.translateBy=function(R,j,B,q){x.transform(R,function(){return n(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof B=="function"?B.apply(this,arguments):B),e.apply(this,arguments),o)},null,q)},x.translateTo=function(R,j,B,q,J){x.transform(R,function(){var ge=e.apply(this,arguments),ke=this.__zoom,ye=q==null?v(ge):typeof q=="function"?q.apply(this,arguments):q;return n(Wd.translate(ye[0],ye[1]).scale(ke.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof B=="function"?-B.apply(this,arguments):-B),ge,o)},q,J)};function S(R,j){return j=Math.max(i[0],Math.min(i[1],j)),j===R.k?R:new ds(j,R.x,R.y)}function T(R,j,B){var q=j[0]-B[0]*R.k,J=j[1]-B[1]*R.k;return q===R.x&&J===R.y?R:new ds(R.k,q,J)}function v(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function _(R,j,B,q){R.on("start.zoom",function(){P(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(q).end()}).tween("zoom",function(){var J=this,ge=arguments,ke=P(J,ge).event(q),ye=e.apply(J,ge),ie=B==null?v(ye):typeof B=="function"?B.apply(J,ge):B,K=Math.max(ye[1][0]-ye[0][0],ye[1][1]-ye[0][1]),te=J.__zoom,_e=typeof j=="function"?j.apply(J,ge):j,$e=l(te.invert(ie).concat(K/te.k),_e.invert(ie).concat(K/_e.k));return function(it){if(it===1)it=_e;else{var lt=$e(it),nn=K/lt[2];it=new ds(nn,ie[0]-lt[0]*nn,ie[1]-lt[1]*nn)}ke.zoom(null,it)}})}function P(R,j,B){return!B&&R.__zooming||new L(R,j)}function L(R,j){this.that=R,this.args=j,this.active=0,this.sourceEvent=null,this.extent=e.apply(R,j),this.taps=0}L.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,j){return this.mouse&&R!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var j=_n(this.that).datum();c.call(R,this.that,new E9(R,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:c}),j)}};function C(R,...j){if(!t.apply(this,arguments))return;var B=P(this,j).event(R),q=this.__zoom,J=Math.max(i[0],Math.min(i[1],q.k*Math.pow(2,s.apply(this,arguments)))),ge=ns(R);if(B.wheel)(B.mouse[0][0]!==ge[0]||B.mouse[0][1]!==ge[1])&&(B.mouse[1]=q.invert(B.mouse[0]=ge)),clearTimeout(B.wheel);else{if(q.k===J)return;B.mouse=[ge,q.invert(ge)],La(this),B.start()}Mi(R),B.wheel=setTimeout(ke,p),B.zoom("mouse",n(T(S(q,J),B.mouse[0],B.mouse[1]),B.extent,o));function ke(){B.wheel=null,B.end()}}function w(R,...j){if(h||!t.apply(this,arguments))return;var B=R.currentTarget,q=P(this,j,!0).event(R),J=_n(R.view).on("mousemove.zoom",ie,!0).on("mouseup.zoom",K,!0),ge=ns(R,B),ke=R.clientX,ye=R.clientY;Qy(R.view),jc(R),q.mouse=[ge,this.__zoom.invert(ge)],La(this),q.start();function ie(te){if(Mi(te),!q.moved){var _e=te.clientX-ke,$e=te.clientY-ye;q.moved=_e*_e+$e*$e>m}q.event(te).zoom("mouse",n(T(q.that.__zoom,q.mouse[0]=ns(te,B),q.mouse[1]),q.extent,o))}function K(te){J.on("mousemove.zoom mouseup.zoom",null),eb(te.view,q.moved),Mi(te),q.event(te).end()}}function M(R,...j){if(t.apply(this,arguments)){var B=this.__zoom,q=ns(R.changedTouches?R.changedTouches[0]:R,this),J=B.invert(q),ge=B.k*(R.shiftKey?.5:2),ke=n(T(S(B,ge),q,J),e.apply(this,j),o);Mi(R),a>0?_n(this).transition().duration(a).call(_,ke,q,R):_n(this).call(x.transform,ke,q,R)}}function E(R,...j){if(t.apply(this,arguments)){var B=R.touches,q=B.length,J=P(this,j,R.changedTouches.length===q).event(R),ge,ke,ye,ie;for(jc(R),ke=0;ke<q;++ke)ye=B[ke],ie=ns(ye,this),ie=[ie,this.__zoom.invert(ie),ye.identifier],J.touch0?!J.touch1&&J.touch0[2]!==ie[2]&&(J.touch1=ie,J.taps=0):(J.touch0=ie,ge=!0,J.taps=1+!!u);u&&(u=clearTimeout(u)),ge&&(J.taps<2&&(d=ie[0],u=setTimeout(function(){u=null},g)),La(this),J.start())}}function z(R,...j){if(this.__zooming){var B=P(this,j).event(R),q=R.changedTouches,J=q.length,ge,ke,ye,ie;for(Mi(R),ge=0;ge<J;++ge)ke=q[ge],ye=ns(ke,this),B.touch0&&B.touch0[2]===ke.identifier?B.touch0[0]=ye:B.touch1&&B.touch1[2]===ke.identifier&&(B.touch1[0]=ye);if(ke=B.that.__zoom,B.touch1){var K=B.touch0[0],te=B.touch0[1],_e=B.touch1[0],$e=B.touch1[1],it=(it=_e[0]-K[0])*it+(it=_e[1]-K[1])*it,lt=(lt=$e[0]-te[0])*lt+(lt=$e[1]-te[1])*lt;ke=S(ke,Math.sqrt(it/lt)),ye=[(K[0]+_e[0])/2,(K[1]+_e[1])/2],ie=[(te[0]+$e[0])/2,(te[1]+$e[1])/2]}else if(B.touch0)ye=B.touch0[0],ie=B.touch0[1];else return;B.zoom("touch",n(T(ke,ye,ie),B.extent,o))}}function V(R,...j){if(this.__zooming){var B=P(this,j).event(R),q=R.changedTouches,J=q.length,ge,ke;for(jc(R),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),ge=0;ge<J;++ge)ke=q[ge],B.touch0&&B.touch0[2]===ke.identifier?delete B.touch0:B.touch1&&B.touch1[2]===ke.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(ke=ns(ke,this),Math.hypot(d[0]-ke[0],d[1]-ke[1])<y)){var ye=_n(this).on("dblclick.zoom");ye&&ye.apply(this,arguments)}}}return x.wheelDelta=function(R){return arguments.length?(s=typeof R=="function"?R:pa(+R),x):s},x.filter=function(R){return arguments.length?(t=typeof R=="function"?R:pa(!!R),x):t},x.touchable=function(R){return arguments.length?(r=typeof R=="function"?R:pa(!!R),x):r},x.extent=function(R){return arguments.length?(e=typeof R=="function"?R:pa([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),x):e},x.scaleExtent=function(R){return arguments.length?(i[0]=+R[0],i[1]=+R[1],x):[i[0],i[1]]},x.translateExtent=function(R){return arguments.length?(o[0][0]=+R[0][0],o[1][0]=+R[1][0],o[0][1]=+R[0][1],o[1][1]=+R[1][1],x):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},x.constrain=function(R){return arguments.length?(n=R,x):n},x.duration=function(R){return arguments.length?(a=+R,x):a},x.interpolate=function(R){return arguments.length?(l=R,x):l},x.on=function(){var R=c.on.apply(c,arguments);return R===c?x:R},x.clickDistance=function(R){return arguments.length?(m=(R=+R)*R,x):Math.sqrt(m)},x.tapDistance=function(R){return arguments.length?(y=+R,x):y},x}const N9={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700"},F9={class:"p-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},j9={class:"text-lg font-semibold flex items-center gap-2"},z9={class:"flex items-center gap-2"},B9={class:"text-sm text-gray-500"},H9=["disabled"],U9={class:"px-4 py-2 border-b border-gray-200 dark:border-gray-700 flex flex-wrap gap-4 text-xs"},V9={key:0,class:"absolute inset-0 flex items-center justify-center bg-gray-50/50 dark:bg-gray-800/50"},W9={key:1,class:"absolute inset-0 flex items-center justify-center"},q9={class:"text-red-500"},K9={key:2,class:"absolute inset-0 flex flex-col items-center justify-center text-gray-500"},G9={key:0,class:"p-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-700/50"},Y9={class:"flex items-start gap-3"},X9={class:"text-sm text-gray-700 dark:text-gray-300 flex-1"},J9=Oe({__name:"RelationshipGraph",setup(t){const e=We(),n=I(null),s=I(null),r=I(!1),i=I(null),o=I([]),a=I([]),l=I(null),c=I(1);let u=null,d=null,h=null;const g={decision:"#3b82f6",solution:"#22c55e",insight:"#8b5cf6",error:"#ef4444",context:"#06b6d4",preference:"#f97316",todo:"#eab308",reference:"#64748b",workflow:"#ec4899",api:"#14b8a6",other:"#9ca3af"};function p(M){switch(M){case"related_to":return{stroke:"#6b7280",dasharray:"none"};case"supersedes":return{stroke:"#f59e0b",dasharray:"8,4"};case"derived_from":return{stroke:"#8b5cf6",dasharray:"4,4"};case"contradicts":return{stroke:"#ef4444",dasharray:"2,2"};default:return{stroke:"#6b7280",dasharray:"none"}}}async function m(M){if(e.currentProject){r.value=!0,i.value=null;try{const E=await ek(e.currentProject.db_path,M,2);if(E.nodes.length===0){o.value=[],a.value=[];return}o.value=E.nodes.map(z=>({...z})),a.value=E.edges.map(z=>({source:z.source,target:z.target,type:z.type,strength:z.strength})),y()}catch(E){i.value="Failed to load relationship data",console.error(E)}finally{r.value=!1}}}function y(){if(!s.value||!n.value||(_n(s.value).selectAll("*").remove(),o.value.length===0))return;const M=n.value.clientWidth,E=500;d=_n(s.value).attr("width",M).attr("height",E).attr("viewBox",[0,0,M,E]),h=L9().scaleExtent([.2,4]).on("zoom",j=>{z.attr("transform",j.transform),c.value=j.transform.k}),d.call(h);const z=d.append("g");d.append("defs").selectAll("marker").data(["related_to","supersedes","derived_from","contradicts"]).join("marker").attr("id",j=>`arrow-${j}`).attr("viewBox","0 -5 10 10").attr("refX",25).attr("refY",0).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5").attr("fill",j=>p(j).stroke),u=M9(o.value).force("link",v9(a.value).id(j=>j.id).distance(100).strength(j=>j.strength*.5)).force("charge",A9().strength(-300)).force("center",QL(M/2,E/2)).force("collision",b9().radius(30));const V=z.append("g").attr("class","links").selectAll("line").data(a.value).join("line").attr("stroke",j=>p(j.type).stroke).attr("stroke-width",j=>Math.max(1,j.strength*3)).attr("stroke-dasharray",j=>p(j.type).dasharray).attr("marker-end",j=>`url(#arrow-${j.type})`),R=z.append("g").attr("class","nodes").selectAll("g").data(o.value).join("g").attr("cursor","pointer").call(p7().on("start",x).on("drag",S).on("end",T)).on("click",(j,B)=>v(B)).on("dblclick",(j,B)=>_(B));R.append("circle").attr("r",15).attr("fill",j=>g[j.type]||g.other).attr("stroke","#fff").attr("stroke-width",2),R.append("text").attr("dy",30).attr("text-anchor","middle").attr("fill",document.documentElement.classList.contains("dark")?"#d1d5db":"#374151").attr("font-size","10px").text(j=>j.content.substring(0,20)+(j.content.length>20?"...":"")),R.append("title").text(j=>`${j.type}: ${j.content}`),u.on("tick",()=>{V.attr("x1",j=>j.source.x).attr("y1",j=>j.source.y).attr("x2",j=>j.target.x).attr("y2",j=>j.target.y),R.attr("transform",j=>`translate(${j.x},${j.y})`)})}function x(M){M.active||u==null||u.alphaTarget(.3).restart(),M.subject.fx=M.subject.x,M.subject.fy=M.subject.y}function S(M){M.subject.fx=M.x,M.subject.fy=M.y}function T(M){M.active||u==null||u.alphaTarget(0),M.subject.fx=null,M.subject.fy=null}function v(M){l.value=M;const E=e.memories.find(z=>z.id===M.id);E&&e.selectMemory(E)}function _(M){m(M.id)}function P(){d&&h&&d.transition().duration(300).call(h.scaleBy,1.3)}function L(){d&&h&&d.transition().duration(300).call(h.scaleBy,.7)}function C(){if(d&&h&&n.value){const M=n.value.clientWidth,E=500;d.transition().duration(300).call(h.transform,Wd.translate(M/2,E/2).scale(1).translate(-M/2,-E/2))}}function w(){m()}return Ge(()=>{m(),window.addEventListener("resize",y)}),tn(()=>{u==null||u.stop(),window.removeEventListener("resize",y)}),Be(()=>e.currentProject,()=>m()),(M,E)=>(b(),k("div",N9,[f("div",F9,[f("h2",j9,[O($(cu),{class:"w-5 h-5 text-purple-500"}),E[0]||(E[0]=oe(" Memory Relationships ",-1))]),f("div",z9,[f("button",{onClick:L,class:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:"Zoom Out"},[O($(ew),{class:"w-4 h-4"})]),f("span",B9,A(Math.round(c.value*100))+"%",1),f("button",{onClick:P,class:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:"Zoom In"},[O($(Mm),{class:"w-4 h-4"})]),f("button",{onClick:C,class:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:"Reset View"},[O($(jk),{class:"w-4 h-4"})]),f("button",{onClick:w,disabled:r.value,class:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:"Refresh"},[O($(en),{class:re(["w-4 h-4",r.value&&"animate-spin"])},null,8,["class"])],8,H9)])]),f("div",U9,[E[1]||(E[1]=f("span",{class:"text-gray-500"},"Nodes:",-1)),(b(),k(ae,null,ve(g,(z,V)=>f("span",{key:V,class:"flex items-center gap-1"},[f("span",{class:"w-3 h-3 rounded-full",style:wt({backgroundColor:z})},null,4),oe(" "+A(V),1)])),64))]),E[6]||(E[6]=Bs('<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700 flex flex-wrap gap-4 text-xs"><span class="text-gray-500">Edges:</span><span class="flex items-center gap-1"><span class="w-6 border-t-2 border-gray-500"></span> related_to </span><span class="flex items-center gap-1"><span class="w-6 border-t-2 border-amber-500 border-dashed"></span> supersedes </span><span class="flex items-center gap-1"><span class="w-6 border-t-2 border-purple-500 border-dotted"></span> derived_from </span><span class="flex items-center gap-1"><span class="w-6 border-t-2 border-red-500" style="border-style:dotted;"></span> contradicts </span></div>',1)),f("div",{ref_key:"containerRef",ref:n,class:"relative min-h-[500px]"},[r.value?(b(),k("div",V9,[...E[2]||(E[2]=[f("div",{class:"animate-pulse text-gray-500"},"Loading graph...",-1)])])):i.value?(b(),k("div",W9,[f("div",q9,A(i.value),1)])):o.value.length===0?(b(),k("div",K9,[O($(cu),{class:"w-12 h-12 mb-2 opacity-50"}),E[3]||(E[3]=f("p",{class:"font-medium"},"No Relationships Found",-1)),E[4]||(E[4]=f("p",{class:"text-sm"},"Link memories using the cortex_link_memories tool to see connections here.",-1))])):H("",!0),(b(),k("svg",{ref_key:"svgRef",ref:s,class:"w-full"},null,512))],512),l.value?(b(),k("div",G9,[f("div",Y9,[f("span",{class:"px-2 py-1 rounded text-xs font-medium capitalize",style:wt({backgroundColor:g[l.value.type]+"20",color:g[l.value.type]})},A(l.value.type),5),f("p",X9,A(l.value.content),1)]),E[5]||(E[5]=f("p",{class:"mt-2 text-xs text-gray-500"}," Double-click a node to recenter the graph on that memory. ",-1))])):H("",!0)]))}}),Z9={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},Q9={class:"flex items-center justify-between mb-4"},eN={class:"text-lg font-semibold flex items-center gap-2"},tN=["disabled"],nN={key:0,class:"text-red-500 text-sm mb-4 p-2 bg-red-50 dark:bg-red-900/20 rounded"},sN={key:1,class:"animate-pulse space-y-4"},rN={key:2,class:"space-y-6"},iN={class:"grid grid-cols-2 gap-4"},oN={class:"p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg"},aN={class:"flex items-center gap-2 text-gray-600 dark:text-gray-400 text-sm mb-1"},lN={class:"text-2xl font-bold"},cN={class:"p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg"},uN={class:"flex items-center gap-2 text-gray-600 dark:text-gray-400 text-sm mb-1"},dN={class:"text-2xl font-bold"},fN={class:"p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg"},hN={class:"flex items-center gap-2 text-gray-600 dark:text-gray-400 text-sm mb-1"},gN={class:"flex items-center gap-2"},pN={class:"text-lg font-semibold capitalize"},mN={class:"p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg"},yN={class:"flex items-center gap-2 text-gray-600 dark:text-gray-400 text-sm mb-1"},bN={class:"text-2xl font-bold"},xN={key:0},vN={class:"h-6 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden flex"},_N=["title"],kN={class:"flex flex-wrap gap-3 mt-3"},wN={class:"text-gray-600 dark:text-gray-400"},SN={class:"text-gray-500 dark:text-gray-500"},$N={key:1,class:"text-center py-4 text-gray-500 dark:text-gray-400"},CN={key:2},TN={class:"flex flex-wrap gap-2"},MN={key:3,class:"text-center py-8 text-gray-500 dark:text-gray-400"},AN=Oe({__name:"StyleProfileCard",setup(t){const e=We(),n=I(!1),s=I(null),r=I(null),i={direct:{bg:"bg-blue-500",text:"text-blue-500",label:"Direct"},polite:{bg:"bg-green-500",text:"text-green-500",label:"Polite"},inquisitive:{bg:"bg-purple-500",text:"text-purple-500",label:"Inquisitive"},technical:{bg:"bg-orange-500",text:"text-orange-500",label:"Technical"},casual:{bg:"bg-pink-500",text:"text-pink-500",label:"Casual"},urgent:{bg:"bg-red-500",text:"text-red-500",label:"Urgent"}},o=le(()=>{var h;if(!((h=r.value)!=null&&h.toneDistribution))return[];const d=Object.values(r.value.toneDistribution).reduce((g,p)=>g+p,0)||1;return Object.entries(r.value.toneDistribution).map(([g,p])=>({tone:g,count:p,percentage:Math.round(p/d*100),color:i[g]||{bg:"bg-gray-500",text:"text-gray-500",label:g}})).sort((g,p)=>p.count-g.count)}),a=le(()=>{var d;return(d=r.value)!=null&&d.primaryTone?i[r.value.primaryTone]||{bg:"bg-gray-500",text:"text-gray-500",label:r.value.primaryTone}:i.direct});async function l(){if(e.currentProject){n.value=!0,s.value=null;try{const d=e.currentProject.db_path,h=await fetch(`/api/style/profile?project=${encodeURIComponent(d)}`);if(!h.ok){await c();return}const g=await h.json();r.value=g}catch{await c()}finally{n.value=!1}}}async function c(){if(!e.currentProject){r.value=u();return}try{const d=e.currentProject.db_path;if(!(await fetch(`/api/activities?project=${encodeURIComponent(d)}&limit=500`)).ok){r.value=u();return}r.value=u()}catch{r.value=u()}}function u(){return{totalMessages:0,avgWordCount:0,primaryTone:"direct",questionPercentage:0,toneDistribution:{},styleMarkers:["No data available yet"]}}return Be(()=>e.currentProject,()=>{l()},{immediate:!0}),Ge(()=>{l()}),(d,h)=>(b(),k("div",Z9,[f("div",Q9,[f("h2",eN,[O($(hs),{class:"w-5 h-5 text-indigo-500"}),h[0]||(h[0]=oe(" Style Profile ",-1))]),f("button",{onClick:l,disabled:n.value,class:"p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50",title:"Refresh style data"},[O($(en),{class:re(["w-4 h-4 text-gray-500",{"animate-spin":n.value}])},null,8,["class"])],8,tN)]),s.value?(b(),k("div",nN,A(s.value),1)):H("",!0),n.value&&!r.value?(b(),k("div",sN,[...h[1]||(h[1]=[Bs('<div class="grid grid-cols-2 gap-4"><div class="h-16 bg-gray-200 dark:bg-gray-700 rounded"></div><div class="h-16 bg-gray-200 dark:bg-gray-700 rounded"></div><div class="h-16 bg-gray-200 dark:bg-gray-700 rounded"></div><div class="h-16 bg-gray-200 dark:bg-gray-700 rounded"></div></div>',1)])])):r.value?(b(),k("div",rN,[f("div",iN,[f("div",oN,[f("div",aN,[O($(hs),{class:"w-4 h-4"}),h[2]||(h[2]=oe(" Total Messages ",-1))]),f("div",lN,A(r.value.totalMessages.toLocaleString()),1)]),f("div",cN,[f("div",uN,[O($(gm),{class:"w-4 h-4"}),h[3]||(h[3]=oe(" Avg Words ",-1))]),f("div",dN,A(r.value.avgWordCount.toFixed(1)),1)]),f("div",fN,[f("div",hN,[O($(Il),{class:"w-4 h-4"}),h[4]||(h[4]=oe(" Primary Tone ",-1))]),f("div",gN,[f("span",{class:re(["w-3 h-3 rounded-full",a.value.bg])},null,2),f("span",pN,A(a.value.label),1)])]),f("div",mN,[f("div",yN,[O($(Ol),{class:"w-4 h-4"}),h[5]||(h[5]=oe(" Questions ",-1))]),f("div",bN,A(r.value.questionPercentage.toFixed(0))+"% ",1)])]),o.value.length>0?(b(),k("div",xN,[h[6]||(h[6]=f("h3",{class:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"}," Tone Distribution ",-1)),f("div",vN,[(b(!0),k(ae,null,ve(o.value,g=>(b(),k("div",{key:g.tone,class:re(["h-full transition-all",g.color.bg]),style:wt({width:`${g.percentage}%`}),title:`${g.color.label}: ${g.percentage}%`},null,14,_N))),128))]),f("div",kN,[(b(!0),k(ae,null,ve(o.value,g=>(b(),k("div",{key:g.tone,class:"flex items-center gap-1.5 text-sm"},[f("span",{class:re(["w-3 h-3 rounded-full",g.color.bg])},null,2),f("span",wN,A(g.color.label),1),f("span",SN," ("+A(g.percentage)+"%) ",1)]))),128))])])):(b(),k("div",$N,[...h[7]||(h[7]=[f("p",{class:"text-sm"},"No tone data available yet",-1),f("p",{class:"text-xs mt-1"},"Start a conversation to begin tracking your communication style",-1)])])),r.value.styleMarkers.length>0?(b(),k("div",CN,[h[8]||(h[8]=f("h3",{class:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"}," Key Style Markers ",-1)),f("div",TN,[(b(!0),k(ae,null,ve(r.value.styleMarkers,(g,p)=>(b(),k("span",{key:p,class:"px-3 py-1 bg-indigo-100 dark:bg-indigo-900/30 text-indigo-700 dark:text-indigo-300 rounded-full text-sm"},A(g),1))),128))])])):H("",!0)])):(b(),k("div",MN,[O($(hs),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),h[9]||(h[9]=f("p",null,"Select a project to view style profile",-1))]))]))}}),EN={class:"bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700"},PN={class:"p-4 border-b border-gray-200 dark:border-gray-700"},RN={class:"flex items-center justify-between mb-3"},DN={class:"flex items-center gap-3"},ON={class:"text-sm text-gray-500"},IN=["disabled"],LN={class:"flex gap-3"},NN={class:"flex-1 relative"},FN={key:0,class:"mt-3 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg"},jN={class:"flex flex-wrap gap-2"},zN=["onClick"],BN={class:"overflow-x-auto"},HN={class:"w-full"},UN={class:"divide-y divide-gray-200 dark:divide-gray-700"},VN=["onClick"],WN={class:"px-4 py-3 text-sm text-gray-500 whitespace-nowrap"},qN={class:"px-4 py-3"},KN={class:"flex items-center gap-2"},GN={class:"text-sm"},YN={class:"px-4 py-3 text-center text-sm"},XN={class:"px-4 py-3 text-center text-sm text-gray-500"},JN={class:"px-4 py-3"},ZN={key:1,class:"text-gray-400 text-xs"},QN={class:"px-4 py-3 text-center"},eF=["onClick"],tF={key:0},nF={colspan:"6",class:"px-4 py-4 bg-gray-50 dark:bg-gray-700/30"},sF={class:"text-sm whitespace-pre-wrap font-mono bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-600"},rF={class:"mt-2 text-xs text-gray-500 flex gap-4"},iF={key:0},oF={colspan:"6",class:"px-4 py-8 text-center"},aF={key:1},lF={key:0,class:"p-4 border-t border-gray-200 dark:border-gray-700 flex items-center justify-between"},cF={class:"text-sm text-gray-500"},uF={class:"flex gap-2"},dF=["disabled"],fF=["disabled"],zc=20,hF=Oe({__name:"MessageHistoryTable",setup(t){const e=We(),n=I([]),s=I(0),r=I(!1),i=I(!1),o=I(1),a=I(null),l=I(""),c=I(null),u=I(!1),d=le(()=>e.currentProject);async function h(){var v;if((v=d.value)!=null&&v.db_path){i.value=!0;try{const _=await pk(d.value.db_path,{search:l.value||void 0,tone:c.value||void 0},zc,(o.value-1)*zc);n.value=_.messages,s.value=_.total_count,r.value=_.has_more}catch(_){console.error("Failed to load messages:",_),n.value=[],s.value=0,r.value=!1}finally{i.value=!1}}}async function g(v){var _;if((_=d.value)!=null&&_.db_path&&confirm("Delete this message?"))try{await mk(d.value.db_path,v),await h()}catch(P){console.error("Failed to delete message:",P)}}function p(v){a.value=a.value===v?null:v}function m(v,_=80){return v.length<=_?v:v.slice(0,_)+"..."}const y=le(()=>Math.ceil(s.value/zc));function x(){o.value>1&&o.value--}function S(){o.value<y.value&&o.value++}function T(v){return v&&US[v]||"bg-gray-200 dark:bg-gray-600"}return Be([o,l,c],()=>{h()}),Be(d,()=>{o.value=1,h()}),Ge(()=>{h()}),(v,_)=>(b(),k("div",EN,[f("div",PN,[f("div",RN,[_[2]||(_[2]=f("h3",{class:"text-lg font-semibold"},"Message History",-1)),f("div",DN,[f("span",ON,A(s.value)+" messages",1),f("button",{onClick:h,disabled:i.value,class:"p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50",title:"Refresh messages"},[O($(en),{class:re(["w-4 h-4 text-gray-500",{"animate-spin":i.value}])},null,8,["class"])],8,IN)])]),f("div",LN,[f("div",NN,[O($(lo),{class:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),Ee(f("input",{"onUpdate:modelValue":_[0]||(_[0]=P=>l.value=P),type:"text",placeholder:"Search messages...",class:"w-full pl-10 pr-4 py-2 bg-gray-100 dark:bg-gray-700 rounded-lg border-0 focus:ring-2 focus:ring-indigo-500"},null,512),[[rt,l.value]])]),f("button",{onClick:_[1]||(_[1]=P=>u.value=!u.value),class:re(["px-3 py-2 rounded-lg flex items-center gap-2 transition-colors",u.value?"bg-indigo-100 dark:bg-indigo-900/30 text-indigo-600":"bg-gray-100 dark:bg-gray-700"])},[O($(ad),{class:"w-4 h-4"}),_[3]||(_[3]=oe(" Filters ",-1))],2)]),u.value?(b(),k("div",FN,[f("div",jN,[(b(),k(ae,null,ve(["professional","casual","technical","creative","formal","friendly","urgent","neutral"],P=>f("button",{key:P,onClick:L=>c.value=c.value===P?null:P,class:re(["px-3 py-1 rounded-full text-sm capitalize transition-colors",c.value===P?"bg-indigo-500 text-white":"bg-gray-200 dark:bg-gray-600 hover:bg-gray-300 dark:hover:bg-gray-500"])},A(P),11,zN)),64))])])):H("",!0)]),f("div",BN,[f("table",HN,[_[5]||(_[5]=f("thead",{class:"bg-gray-50 dark:bg-gray-700/50 text-sm"},[f("tr",null,[f("th",{class:"px-4 py-3 text-left font-medium"},"Time"),f("th",{class:"px-4 py-3 text-left font-medium"},"Message"),f("th",{class:"px-4 py-3 text-center font-medium"},"Words"),f("th",{class:"px-4 py-3 text-center font-medium"},"Chars"),f("th",{class:"px-4 py-3 text-left font-medium"},"Tone"),f("th",{class:"px-4 py-3 text-center font-medium"},"Actions")])],-1)),f("tbody",UN,[(b(!0),k(ae,null,ve(n.value,P=>(b(),k(ae,{key:P.id},[f("tr",{class:"hover:bg-gray-50 dark:hover:bg-gray-700/30 cursor-pointer",onClick:L=>p(P.id)},[f("td",WN,[O(Vr,{timestamp:P.created_at},null,8,["timestamp"])]),f("td",qN,[f("div",KN,[(b(),pe(Vn(a.value===P.id?$(Ps):$(Nn)),{class:"w-4 h-4 text-gray-400 flex-shrink-0"})),f("span",GN,A(m(P.content)),1)])]),f("td",YN,A(P.word_count),1),f("td",XN,A(P.char_count),1),f("td",JN,[P.tone?(b(),k("span",{key:0,class:re(["px-2 py-0.5 rounded-full text-xs capitalize text-white",T(P.tone)])},A(P.tone),3)):(b(),k("span",ZN,"-"))]),f("td",QN,[f("button",{onClick:pt(L=>g(P.id),["stop"]),class:"p-1.5 text-gray-400 hover:text-red-500 rounded transition-colors",title:"Delete message"},[O($(Gi),{class:"w-4 h-4"})],8,eF)])],8,VN),a.value===P.id?(b(),k("tr",tF,[f("td",nF,[f("div",sF,A(P.content),1),f("div",rF,[f("span",null,"Session: "+A(P.session_id||"N/A"),1)])])])):H("",!0)],64))),128)),i.value&&n.value.length===0?(b(),k("tr",iF,[f("td",oF,[O($(en),{class:"w-6 h-6 animate-spin mx-auto text-gray-400"})])])):H("",!0),!i.value&&n.value.length===0?(b(),k("tr",aF,[..._[4]||(_[4]=[f("td",{colspan:"6",class:"px-4 py-8 text-center text-gray-500"}," No messages found ",-1)])])):H("",!0)])])]),y.value>1?(b(),k("div",lF,[f("span",cF," Page "+A(o.value)+" of "+A(y.value),1),f("div",uF,[f("button",{onClick:x,disabled:o.value===1,class:"px-3 py-1 bg-gray-200 dark:bg-gray-700 rounded hover:bg-gray-300 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed"}," Previous ",8,dF),f("button",{onClick:S,disabled:o.value===y.value,class:"px-3 py-1 bg-gray-200 dark:bg-gray-700 rounded hover:bg-gray-300 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed"}," Next ",8,fF)])])):H("",!0)]))}}),gF={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-6"},pF={class:"flex items-center justify-between mb-4"},mF=["disabled"],yF={key:0,class:"text-red-500 text-sm mb-4 p-2 bg-red-50 dark:bg-red-900/20 rounded"},bF={key:1,class:"animate-pulse"},xF={class:"grid md:grid-cols-2 lg:grid-cols-4 gap-4"},vF={key:2,class:"grid md:grid-cols-2 lg:grid-cols-4 gap-6"},_F={class:"flex items-center gap-2 pb-2 border-b border-gray-200 dark:border-gray-700"},kF={class:"font-medium text-sm"},wF={class:"text-xs text-gray-500 dark:text-gray-400"},SF={class:"text-gray-700 dark:text-gray-300 italic"},$F={key:0,class:"p-4 text-center text-gray-400 dark:text-gray-500 text-sm border border-dashed border-gray-300 dark:border-gray-600 rounded-lg"},CF={key:3,class:"text-center py-8 text-gray-500 dark:text-gray-400"},TF=Oe({__name:"StyleSamplesPanel",setup(t){const e=We(),n=I(null),s=I(!1),r=I(null),i=le(()=>e.currentProject),o=[{key:"professional",icon:ci,label:"Professional",description:"Formal, structured messages",color:"blue"},{key:"casual",icon:hs,label:"Casual",description:"Relaxed, conversational tone",color:"green"},{key:"technical",icon:Il,label:"Technical",description:"Code-focused, precise language",color:"purple"},{key:"creative",icon:hs,label:"Creative",description:"Expressive, unique phrasing",color:"pink"}],a={blue:{border:"border-l-blue-500",bg:"bg-blue-50 dark:bg-blue-900/20",icon:"text-blue-500"},green:{border:"border-l-green-500",bg:"bg-green-50 dark:bg-green-900/20",icon:"text-green-500"},purple:{border:"border-l-purple-500",bg:"bg-purple-50 dark:bg-purple-900/20",icon:"text-purple-500"},pink:{border:"border-l-pink-500",bg:"bg-pink-50 dark:bg-pink-900/20",icon:"text-pink-500"}};async function l(){var u;if((u=i.value)!=null&&u.db_path){s.value=!0,r.value=null;try{n.value=await bk(i.value.db_path,3)}catch(d){console.error("Failed to fetch style samples:",d),r.value="Failed to load sample messages",n.value={professional:[],casual:[],technical:[],creative:[]}}finally{s.value=!1}}}function c(u,d=200){return u.length<=d?u:u.slice(0,d)+"..."}return Be(i,()=>{l()},{immediate:!0}),Ge(()=>{i.value&&l()}),(u,d)=>(b(),k("div",gF,[f("div",pF,[d[0]||(d[0]=f("div",null,[f("h2",{class:"text-lg font-semibold"},"Sample Messages"),f("p",{class:"text-sm text-gray-500 dark:text-gray-400 mt-1"}," Representative examples of how you communicate ")],-1)),f("button",{onClick:l,disabled:s.value,class:"p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50",title:"Refresh samples"},[O($(en),{class:re(["w-4 h-4 text-gray-500",{"animate-spin":s.value}])},null,8,["class"])],8,mF)]),r.value?(b(),k("div",yF,A(r.value),1)):H("",!0),s.value&&!n.value?(b(),k("div",bF,[f("div",xF,[(b(),k(ae,null,ve(4,h=>f("div",{key:h,class:"space-y-3"},[...d[1]||(d[1]=[f("div",{class:"h-6 bg-gray-200 dark:bg-gray-700 rounded w-24"},null,-1),f("div",{class:"h-20 bg-gray-200 dark:bg-gray-700 rounded"},null,-1),f("div",{class:"h-20 bg-gray-200 dark:bg-gray-700 rounded"},null,-1)])])),64))])])):n.value?(b(),k("div",vF,[(b(),k(ae,null,ve(o,h=>f("div",{key:h.key,class:"space-y-3"},[f("div",_F,[(b(),pe(Vn(h.icon),{class:re(["w-5 h-5",a[h.color].icon])},null,8,["class"])),f("div",null,[f("h3",kF,A(h.label),1),f("p",wF,A(h.description),1)])]),(b(!0),k(ae,null,ve(n.value[h.key],(g,p)=>(b(),k("div",{key:p,class:re(["p-3 rounded-lg border-l-2 text-sm",a[h.color].border,a[h.color].bg])},[f("p",SF,' "'+A(c(g))+'" ',1)],2))),128)),!n.value[h.key]||n.value[h.key].length===0?(b(),k("div",$F," No "+A(h.label.toLowerCase())+" samples yet ",1)):H("",!0)])),64))])):(b(),k("div",CF,[O($(hs),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),d[2]||(d[2]=f("p",null,"Select a project to view sample messages",-1))]))]))}}),MF={class:"space-y-6"},AF={class:"flex items-center justify-between"},EF={class:"flex items-center gap-3"},PF={class:"p-2 bg-indigo-100 dark:bg-indigo-900/30 rounded-lg"},RF=["disabled"],DF={key:0,class:"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300 p-4 rounded-lg"},OF={key:1,class:"text-center py-16 bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700"},IF=Oe({__name:"StyleTab",setup(t){const e=We(),n=I(!1),s=I(null),r=le(()=>e.currentProject),i=le(()=>!!r.value);async function o(){n.value=!0,s.value=null;try{await new Promise(a=>setTimeout(a,100))}catch(a){console.error("Failed to refresh style data:",a),s.value="Failed to refresh data"}finally{n.value=!1}}return Be(r,()=>{s.value=null}),Ge(()=>{}),(a,l)=>(b(),k("div",MF,[f("div",AF,[f("div",EF,[f("div",PF,[O($(du),{class:"w-6 h-6 text-indigo-600 dark:text-indigo-400"})]),l[0]||(l[0]=f("div",null,[f("h1",{class:"text-xl font-semibold"},"Communication Style"),f("p",{class:"text-sm text-gray-500 dark:text-gray-400"}," Analyze your messaging patterns and tone ")],-1))]),i.value?(b(),k("button",{key:0,onClick:o,disabled:n.value,class:"flex items-center gap-2 px-4 py-2 bg-gray-200 dark:bg-gray-700 rounded-lg hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors disabled:opacity-50"},[O($(en),{class:re(["w-4 h-4",{"animate-spin":n.value}])},null,8,["class"]),l[1]||(l[1]=oe(" Refresh All ",-1))],8,RF)):H("",!0)]),s.value?(b(),k("div",DF,A(s.value),1)):H("",!0),i.value?(b(),k(ae,{key:2},[O(AN),O(hF),O(TF)],64)):(b(),k("div",OF,[O($(hs),{class:"w-16 h-16 mx-auto mb-4 text-gray-300 dark:text-gray-600"}),l[2]||(l[2]=f("h2",{class:"text-xl font-medium text-gray-600 dark:text-gray-400 mb-2"}," No Project Selected ",-1)),l[3]||(l[3]=f("p",{class:"text-gray-500 dark:text-gray-500 max-w-md mx-auto"}," Select a project from the header to view your communication style analysis. Your messaging patterns will be tracked as you interact with Claude Code. ",-1))]))]))}}),LF={class:"space-y-2"},NF={class:"w-16 text-sm font-mono text-gray-700 dark:text-gray-300 truncate"},FF={class:"flex-1 h-4 bg-gray-200 dark:bg-gray-700 rounded overflow-hidden"},jF={class:"w-32 text-xs text-gray-500 dark:text-gray-400 text-right"},zF={class:"w-20 text-xs text-gray-400 dark:text-gray-500 text-right"},BF={key:0,class:"text-sm text-gray-500 dark:text-gray-400 italic"},HF=Oe({__name:"AgentToolBreakdown",props:{breakdown:{}},setup(t){const e=t,n=le(()=>[...e.breakdown].sort((a,l)=>l.count-a.count).slice(0,8)),s=le(()=>e.breakdown.reduce((a,l)=>a+l.count,0));function r(a){return s.value===0?0:a/s.value*100}function i(a){return{Read:"bg-blue-500",Write:"bg-green-500",Edit:"bg-yellow-500",Grep:"bg-purple-500",Glob:"bg-pink-500",Bash:"bg-orange-500",Task:"bg-indigo-500"}[a]||"bg-gray-500"}function o(a){return a<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`}return(a,l)=>(b(),k("div",LF,[(b(!0),k(ae,null,ve(n.value,c=>(b(),k("div",{key:c.tool_name,class:"flex items-center gap-2"},[f("div",NF,A(c.tool_name),1),f("div",FF,[f("div",{class:re(["h-full rounded transition-all duration-300",i(c.tool_name)]),style:wt({width:`${r(c.count)}%`})},null,6)]),f("div",jF,A(c.count)+" ("+A(r(c.count).toFixed(0))+"%) ",1),f("div",zF,A(o(c.avg_duration_ms)),1)]))),128)),t.breakdown.length===0?(b(),k("div",BF," No tool usage data ")):H("",!0)]))}}),UF={class:"space-y-4"},VF={class:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm"},WF={class:"font-mono text-gray-900 dark:text-white"},qF={class:"text-gray-900 dark:text-white"},KF={key:0,class:"text-gray-500"},GF={key:0,class:"text-gray-500 dark:text-gray-400"},YF={key:1,class:"font-mono text-blue-600 dark:text-blue-400"},XF={class:"text-gray-900 dark:text-white"},JF={class:"text-gray-900 dark:text-white font-semibold"},ZF={key:0},QF={class:"flex items-center justify-between mb-2"},ej={class:"text-sm font-semibold text-gray-700 dark:text-gray-300"},tj={class:"space-y-1"},nj=["title"],sj={key:0,class:"text-sm text-gray-500 dark:text-gray-400 italic"},rj={key:1,class:"text-sm text-gray-500 dark:text-gray-400 italic"},ij=Oe({__name:"AgentExpandedView",props:{stats:{},loading:{type:Boolean}},setup(t){const e=t,n=I(!1),s=le(()=>n.value?e.stats.files_touched:e.stats.files_touched.slice(0,3));function r(a){return new Date(a).toLocaleString()}function i(a){const l=a.replace(/\\/g,"/").split("/");return l.length<=2?a:".../"+l.slice(-2).join("/")}function o(){n.value=!n.value}return(a,l)=>(b(),k("div",UF,[f("div",null,[l[4]||(l[4]=f("h4",{class:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2"}," Agent Details ",-1)),f("dl",VF,[l[0]||(l[0]=f("dt",{class:"text-gray-500 dark:text-gray-400"},"ID:",-1)),f("dd",WF,A(t.stats.agent.id),1),l[1]||(l[1]=f("dt",{class:"text-gray-500 dark:text-gray-400"},"Type:",-1)),f("dd",qF,[oe(A(t.stats.agent.type)+" ",1),t.stats.agent.type==="subagent"?(b(),k("span",KF," (spawned by Task) ")):H("",!0)]),t.stats.parent_agent_id?(b(),k("dt",GF,"Parent:")):H("",!0),t.stats.parent_agent_id?(b(),k("dd",YF,A(t.stats.parent_agent_id),1)):H("",!0),l[2]||(l[2]=f("dt",{class:"text-gray-500 dark:text-gray-400"},"First seen:",-1)),f("dd",XF,A(r(t.stats.agent.first_seen)),1),l[3]||(l[3]=f("dt",{class:"text-gray-500 dark:text-gray-400"},"Total calls:",-1)),f("dd",JF,A(t.stats.agent.total_activities.toLocaleString()),1)])]),f("div",null,[l[5]||(l[5]=f("h4",{class:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2"}," Tool Usage Breakdown ",-1)),O(HF,{breakdown:t.stats.tool_breakdown},null,8,["breakdown"])]),t.stats.files_touched.length>0?(b(),k("div",ZF,[f("div",QF,[f("h4",ej," Files Touched ("+A(t.stats.files_touched.length)+") ",1),t.stats.files_touched.length>3?(b(),k("button",{key:0,onClick:o,class:"text-xs text-blue-600 dark:text-blue-400 hover:underline"},A(n.value?"Show Less":"View All"),1)):H("",!0)]),f("ul",tj,[(b(!0),k(ae,null,ve(s.value,c=>(b(),k("li",{key:c,class:"text-sm font-mono text-gray-600 dark:text-gray-400 truncate",title:c}," • "+A(i(c)),9,nj))),128)),!n.value&&t.stats.files_touched.length>3?(b(),k("li",sj," + "+A(t.stats.files_touched.length-3)+" more... ",1)):H("",!0)])])):(b(),k("div",rj," No files touched (or file tracking not available) "))]))}}),oj={key:0,class:"absolute top-3 right-3"},aj={key:1,class:"absolute top-3 right-3"},lj={class:"font-mono font-semibold text-gray-900 dark:text-white pr-6 truncate"},cj={class:"mt-2 flex items-center gap-2"},uj={key:0,class:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"},dj={class:"mt-3 space-y-2"},fj={class:"text-sm text-gray-600 dark:text-gray-300"},hj={class:"font-semibold"},gj={class:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2"},pj={class:"text-xs text-gray-500 dark:text-gray-400"},mj={key:0},yj={key:1},bj={key:0,class:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700 overflow-hidden"},xj={key:1,class:"flex justify-center py-4"},vj=Oe({__name:"AgentPulseCard",props:{agent:{},maxActivities:{},adwPhase:{}},setup(t){const e=t,n=We(),s=I(!1),r=I(!1),i=I(null),o=le(()=>e.agent.is_active),a=le(()=>e.maxActivities===0?0:Math.min(100,e.agent.total_activities/e.maxActivities*100)),l=le(()=>{switch(e.agent.type){case"main":return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case"subagent":return"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200";case"tool":return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200"}});function c(d){return d>=1e3?`${(d/1e3).toFixed(1)}k`:d.toString()}async function u(){var d;if(s.value=!s.value,s.value&&!i.value){r.value=!0;try{const h=(d=n.currentProject)==null?void 0:d.path;h&&(i.value=await dh(h,e.agent.id))}catch(h){console.error("Failed to fetch agent stats:",h)}finally{r.value=!1}}}return Be(()=>e.agent.last_seen,()=>{var d;if(s.value){const h=(d=n.currentProject)==null?void 0:d.path;h&&dh(h,e.agent.id).then(g=>i.value=g).catch(()=>{})}}),(d,h)=>(b(),k("div",{class:re(["relative rounded-lg border p-4 transition-all duration-200",[o.value?"border-green-500 bg-green-50 dark:bg-green-900/20":"border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",s.value?"col-span-2 row-span-2":""]])},[o.value?(b(),k("div",oj,[...h[0]||(h[0]=[f("span",{class:"relative flex h-3 w-3"},[f("span",{class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),f("span",{class:"relative inline-flex rounded-full h-3 w-3 bg-green-500"})],-1)])])):(b(),k("div",aj,[...h[1]||(h[1]=[f("span",{class:"inline-flex rounded-full h-3 w-3 bg-gray-300 dark:bg-gray-600"},null,-1)])])),f("h3",lj,A(t.agent.id),1),f("div",cj,[f("span",{class:re(["inline-flex items-center px-2 py-0.5 rounded text-xs font-medium",l.value])},A(t.agent.type),3),t.adwPhase?(b(),k("span",uj,A(t.adwPhase.toUpperCase()),1)):H("",!0)]),f("div",dj,[f("div",fj,[f("span",hj,A(c(t.agent.total_activities)),1),h[2]||(h[2]=oe(" calls ",-1))]),f("div",gj,[f("div",{class:re(["h-2 rounded-full transition-all duration-500",o.value?"bg-green-500":"bg-blue-500"]),style:wt({width:`${a.value}%`})},null,6)]),f("div",pj,[h[3]||(h[3]=oe(" Last: ",-1)),O(Vr,{timestamp:t.agent.last_seen},null,8,["timestamp"])])]),f("button",{onClick:u,class:"mt-3 w-full flex items-center justify-center gap-1 text-sm text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300"},[s.value?(b(),k("span",mj,"▲ Collapse")):(b(),k("span",yj,"▼ Expand"))]),O(mr,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-96","leave-from-class":"opacity-100 max-h-96","leave-to-class":"opacity-0 max-h-0"},{default:js(()=>[s.value?(b(),k("div",bj,[i.value?(b(),pe(ij,{key:0,stats:i.value,loading:r.value},null,8,["stats","loading"])):r.value?(b(),k("div",xj,[...h[4]||(h[4]=[f("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500"},null,-1)])])):H("",!0)])):H("",!0)]),_:1})],2))}}),_j={class:"flex items-center justify-between mb-4"},kj={class:"text-lg font-semibold text-gray-900 dark:text-white"},wj={class:"flex items-center gap-2"},Sj={class:"flex items-center gap-1 text-sm text-gray-600 dark:text-gray-400"},$j=["disabled"],Cj={key:0,class:"flex justify-center py-8"},Tj={key:1,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"},Mj={key:2,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Aj=Oe({__name:"AgentPulseGrid",props:{adwState:{}},setup(t,{expose:e}){const n=t,s=We(),r=I([]),i=I(!1),o=I("all"),a=I(!1),l=le(()=>r.value.filter(h=>!(o.value!=="all"&&h.type!==o.value||a.value&&!h.is_active))),c=le(()=>Math.max(...r.value.map(h=>h.total_activities),1));function u(h){if(n.adwState){for(const g of n.adwState.phases)if(g.agent_ids.includes(h))return g.name}}async function d(){i.value=!0;try{const h=s.currentDbPath;if(h){const g=await fm(h,o.value!=="all"?o.value:void 0,a.value);r.value=(g==null?void 0:g.agents)??[]}}catch(h){console.error("Failed to fetch agents:",h),r.value=[]}finally{i.value=!1}}return Be([o,a],()=>d()),Ge(()=>d()),e({refresh:d}),(h,g)=>(b(),k("div",null,[f("div",_j,[f("h3",kj," Agents ("+A(r.value.length)+") ",1),f("div",wj,[Ee(f("select",{"onUpdate:modelValue":g[0]||(g[0]=p=>o.value=p),class:"text-sm border rounded px-2 py-1 dark:bg-gray-700 dark:border-gray-600 dark:text-white"},[...g[2]||(g[2]=[f("option",{value:"all"},"All Types",-1),f("option",{value:"main"},"Main",-1),f("option",{value:"subagent"},"Subagent",-1),f("option",{value:"tool"},"Tool",-1)])],512),[[cn,o.value]]),f("label",Sj,[Ee(f("input",{type:"checkbox","onUpdate:modelValue":g[1]||(g[1]=p=>a.value=p),class:"rounded"},null,512),[[yr,a.value]]),g[3]||(g[3]=oe(" Active only ",-1))]),f("button",{onClick:d,disabled:i.value,class:"p-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"},[(b(),k("svg",{class:re(["w-5 h-5",{"animate-spin":i.value}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...g[4]||(g[4]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2))],8,$j)])]),i.value&&r.value.length===0?(b(),k("div",Cj,[...g[5]||(g[5]=[f("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500"},null,-1)])])):(b(),k("div",Tj,[(b(!0),k(ae,null,ve(l.value,p=>(b(),pe(vj,{key:p.id,agent:p,"max-activities":c.value,"adw-phase":u(p.id)},null,8,["agent","max-activities","adw-phase"]))),128))])),!i.value&&l.value.length===0?(b(),k("div",Mj," No agents found matching filters ")):H("",!0)]))}}),Ej={class:"border rounded-lg overflow-hidden dark:border-gray-700"},Pj={class:"grid grid-cols-4 bg-gray-100 dark:bg-gray-800"},Rj={class:"grid grid-cols-4"},Dj={class:"flex items-center gap-2 mb-2"},Oj={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Ij={class:"space-y-2"},Lj=["title"],Nj={class:"font-mono text-gray-700 dark:text-gray-300 truncate"},Fj={key:0,class:"text-xs text-gray-400 dark:text-gray-500 italic"},jj={class:"grid grid-cols-4 bg-gray-50 dark:bg-gray-800/50 border-t dark:border-gray-700"},zj={class:"text-xs text-gray-500 dark:text-gray-400"},Bj=Oe({__name:"PhaseSwimlane",props:{adwState:{}},setup(t){const e=t,n=le(()=>e.adwState.phases);function s(c){switch(c.status){case"completed":return"text-green-700 dark:text-green-400";case"running":return"text-blue-700 dark:text-blue-400";case"failed":return"text-red-700 dark:text-red-400";default:return"text-gray-500 dark:text-gray-400"}}function r(c){switch(c.status){case"completed":return"bg-green-50 dark:bg-green-900/10";case"running":return"bg-blue-50 dark:bg-blue-900/10";case"failed":return"bg-red-50 dark:bg-red-900/10";default:return"bg-white dark:bg-gray-900"}}function i(c){switch(c){case"completed":return"✓";case"running":return"●";case"failed":return"✗";case"skipped":return"○";default:return"○"}}function o(c){switch(c){case"completed":return"text-green-600 dark:text-green-400";case"running":return"text-blue-600 dark:text-blue-400 animate-pulse";case"failed":return"text-red-600 dark:text-red-400";default:return"text-gray-400 dark:text-gray-500"}}function a(c){const u=Math.floor(c/60),d=Math.floor(c%60);return`${u}:${d.toString().padStart(2,"0")}`}function l(c){return c.call_count??0}return(c,u)=>(b(),k("div",Ej,[f("div",Pj,[(b(!0),k(ae,null,ve(n.value,d=>(b(),k("div",{key:d.name,class:"px-4 py-2 text-center border-r last:border-r-0 dark:border-gray-700"},[f("span",{class:re(["font-semibold text-sm uppercase",s(d)])},A(d.name),3)]))),128))]),f("div",Rj,[(b(!0),k(ae,null,ve(n.value,d=>(b(),k("div",{key:d.name,class:re(["px-3 py-3 border-r last:border-r-0 dark:border-gray-700 min-h-[120px]",r(d)])},[f("div",Dj,[f("span",{class:re(o(d.status))},A(i(d.status)),3),d.duration_seconds?(b(),k("span",Oj,A(a(d.duration_seconds)),1)):H("",!0)]),f("div",Ij,[(b(!0),k(ae,null,ve(d.agent_ids,h=>(b(),k("div",{key:h,class:"flex items-center gap-2 text-sm",title:`ADW phase agent: ${h}`},[u[0]||(u[0]=f("span",{class:"w-2 h-2 rounded-full bg-gray-400"},null,-1)),f("span",Nj,A(h),1)],8,Lj))),128)),d.agent_ids.length===0&&d.status==="pending"?(b(),k("div",Fj," Pending ")):H("",!0)])],2))),128))]),f("div",jj,[(b(!0),k(ae,null,ve(n.value,d=>(b(),k("div",{key:d.name,class:"px-3 py-2 text-center border-r last:border-r-0 dark:border-gray-700"},[f("span",zj," ["+A(l(d))+" calls] ",1)]))),128))])]))}}),Hj={class:"border rounded-lg dark:border-gray-700"},Uj={class:"px-4 py-3 bg-gray-50 dark:bg-gray-800 border-b dark:border-gray-700"},Vj={class:"flex flex-wrap items-center justify-between gap-2"},Wj={class:"flex items-center gap-2"},qj=["value"],Kj=["disabled"],Gj={class:"max-h-80 overflow-y-auto"},Yj={class:"w-full text-sm"},Xj={class:"px-3 py-2 text-gray-500 dark:text-gray-400 whitespace-nowrap w-20"},Jj={class:"px-3 py-2 w-24"},Zj=["onClick"],Qj={class:"px-3 py-2 w-20"},ez={class:"px-3 py-2 text-gray-700 dark:text-gray-300 truncate max-w-xs"},tz={class:"px-3 py-2 text-right whitespace-nowrap w-20"},nz={key:0,class:"text-red-600 dark:text-red-400"},sz={key:1,class:"text-green-600 dark:text-green-400"},rz={key:2,class:"text-blue-600 dark:text-blue-400 animate-pulse"},iz={key:0,class:"px-4 py-8 text-center text-gray-500 dark:text-gray-400"},oz={key:0,class:"px-4 py-2 border-t dark:border-gray-700 text-center"},az=["disabled"],Bc=50,lz=Oe({__name:"AgentActivityStream",props:{agents:{},initialAgentId:{}},setup(t,{expose:e}){const n=t,s=We(),r=I([]),i=I(!1),o=I(n.initialAgentId||""),a=I(""),l=I(0),c=I(!0),u=le(()=>{let S=r.value;if(o.value&&(S=S.filter(T=>T.agent_id===o.value)),a.value){const T=a.value.toLowerCase();S=S.filter(v=>{var _,P;return v.tool_name.toLowerCase().includes(T)||((_=v.tool_input)==null?void 0:_.toLowerCase().includes(T))||((P=v.agent_id)==null?void 0:P.toLowerCase().includes(T))})}return S});function d(S){return new Date(S).toLocaleTimeString("en-US",{hour12:!1})}function h(S){return{Read:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",Write:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",Edit:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",Grep:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",Bash:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",Task:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"}[S]||"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200"}function g(S){var T;try{const v=JSON.parse(S.tool_input||"{}");return v.file_path?v.file_path.split(/[/\\]/).pop():v.pattern?v.pattern:v.command?v.command.slice(0,50):v.prompt?v.prompt.slice(0,50):JSON.stringify(v).slice(0,50)}catch{return((T=S.tool_input)==null?void 0:T.slice(0,50))||""}}async function p(S=!1){if(s.currentDbPath){i.value=!0;try{const T=new URLSearchParams({project:s.currentDbPath,limit:Bc.toString(),offset:l.value.toString()}),P=(await(await fetch(`/api/activities?${T}`)).json()).activities??[];S?r.value=[...r.value,...P]:r.value=P,c.value=P.length===Bc}catch(T){console.error("Failed to fetch activities:",T),S||(r.value=[])}finally{i.value=!1}}}function m(){l.value=0,p(!1)}function y(){l.value+=Bc,p(!0)}function x(S){o.value=S}return Be(()=>n.initialAgentId,S=>{S&&(o.value=S)}),Ge(()=>p()),e({refresh:m,setAgent:S=>o.value=S}),(S,T)=>(b(),k("div",Hj,[f("div",Uj,[f("div",Vj,[T[4]||(T[4]=f("h4",{class:"font-semibold text-gray-900 dark:text-white"}," Activity Stream ",-1)),f("div",Wj,[Ee(f("select",{"onUpdate:modelValue":T[0]||(T[0]=v=>o.value=v),class:"text-sm border rounded px-2 py-1 dark:bg-gray-700 dark:border-gray-600 dark:text-white"},[T[2]||(T[2]=f("option",{value:""},"All Agents",-1)),(b(!0),k(ae,null,ve(t.agents,v=>(b(),k("option",{key:v.id,value:v.id},A(v.id),9,qj))),128))],512),[[cn,o.value]]),Ee(f("input",{"onUpdate:modelValue":T[1]||(T[1]=v=>a.value=v),type:"text",placeholder:"Search...",class:"text-sm border rounded px-2 py-1 w-40 dark:bg-gray-700 dark:border-gray-600 dark:text-white"},null,512),[[rt,a.value]]),f("button",{onClick:m,disabled:i.value,class:"p-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"},[(b(),k("svg",{class:re(["w-4 h-4",{"animate-spin":i.value}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...T[3]||(T[3]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2))],8,Kj)])])]),f("div",Gj,[f("table",Yj,[f("tbody",null,[(b(!0),k(ae,null,ve(u.value,v=>(b(),k("tr",{key:v.id,class:"border-b dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800/50"},[f("td",Xj,A(d(v.timestamp)),1),f("td",Jj,[f("button",{onClick:_=>x(v.agent_id||""),class:"font-mono text-blue-600 dark:text-blue-400 hover:underline truncate max-w-[80px] block"},A(v.agent_id||"main"),9,Zj)]),f("td",Qj,[f("span",{class:re(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",h(v.tool_name)])},A(v.tool_name),3)]),f("td",ez,A(g(v)),1),f("td",tz,[v.success===!1?(b(),k("span",nz," ✗ Error ")):v.duration_ms?(b(),k("span",sz," ✓ "+A(v.duration_ms)+"ms ",1)):(b(),k("span",rz," ● running "))])]))),128))])]),u.value.length===0?(b(),k("div",iz," No activities found ")):H("",!0)]),c.value?(b(),k("div",oz,[f("button",{onClick:y,disabled:i.value,class:"text-sm text-blue-600 dark:text-blue-400 hover:underline"}," Load More... ",8,az)])):H("",!0)]))}}),cz={class:"space-y-6"},uz={class:"flex flex-wrap items-center justify-between gap-4"},dz={class:"flex items-center gap-4"},fz={key:0,class:"flex items-center gap-1"},hz={class:"flex items-center gap-3"},gz=["value"],pz=["disabled"],mz={key:1,class:"text-center py-6 text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800/50 rounded-lg"},yz=Oe({__name:"AgentTab",setup(t){const e=We(),n=I([]),s=I([]),r=I(null),i=I(""),o=I(!1),a=I(null),l=I(null);let c=null;const u=le(()=>n.value.some(v=>v.is_active));function d(v){const P=new Date(v.created_at).toLocaleDateString();return`${v.adw_id.slice(4,20)} (${P}) - ${v.status}`}async function h(){if(e.currentDbPath)try{const v=await xk(e.currentDbPath,20);s.value=v.adw_runs;const _=s.value.find(P=>P.status==="running");_&&!i.value&&(i.value=_.adw_id)}catch(v){console.error("Failed to load ADW list:",v)}}async function g(){if(!i.value||!e.currentDbPath){r.value=null;return}try{r.value=await vk(e.currentDbPath,i.value)}catch(v){console.error("Failed to load ADW state:",v),r.value=null}}async function p(){if(e.currentDbPath)try{const v=await fm(e.currentDbPath);n.value=v.agents}catch(v){console.error("Failed to load agents:",v)}}async function m(){var v,_;o.value=!0,await Promise.all([p(),h(),g()]),(v=a.value)==null||v.refresh(),(_=l.value)==null||_.refresh(),o.value=!1}function y(){if(!e.currentDbPath){alert("No project selected");return}const _=`${e.currentDbPath.replace(/[/\\]\.cortex[/\\]cortex\.db$/,"")}/agents`;navigator.clipboard.writeText(_).then(()=>{alert(`Agents folder path copied to clipboard:
|
|
533
|
+
|
|
534
|
+
${_}`)}).catch(()=>{alert(`Agents folder path:
|
|
535
|
+
|
|
536
|
+
${_}`)})}function x(){const v=S(),_=new Blob([v],{type:"text/markdown"}),P=URL.createObjectURL(_),L=document.createElement("a");L.href=P,L.download=`agent-timeline-${new Date().toISOString().slice(0,10)}.md`,L.click(),URL.revokeObjectURL(P)}function S(){let v=`# Agent Timeline
|
|
537
|
+
|
|
538
|
+
Generated: ${new Date().toISOString()}
|
|
539
|
+
|
|
540
|
+
`;if(r.value){v+=`## ADW: ${r.value.adw_id}
|
|
541
|
+
`,v+=`Status: ${r.value.status}
|
|
542
|
+
`,v+=`Current Phase: ${r.value.current_phase}
|
|
543
|
+
|
|
544
|
+
`,v+=`### Phases
|
|
545
|
+
|
|
546
|
+
`;for(const _ of r.value.phases)v+=`- **${_.name.toUpperCase()}**: ${_.status}`,_.agent_ids.length&&(v+=` (Agents: ${_.agent_ids.join(", ")})`),v+=`
|
|
547
|
+
`}v+=`
|
|
548
|
+
## Agents (${n.value.length})
|
|
549
|
+
|
|
550
|
+
`;for(const _ of n.value)v+=`- **${_.id}** (${_.type}): ${_.total_activities} calls
|
|
551
|
+
`;return v}function T(){const _=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;c=new WebSocket(_),c.onmessage=P=>{var C;const L=JSON.parse(P.data);L.type==="activity"&&L.agent_id&&(p(),(C=l.value)==null||C.refresh())},c.onclose=()=>{setTimeout(T,3e3)}}return Be(i,()=>g()),Be(()=>e.currentProject,()=>{i.value="",r.value=null,m()}),Ge(async()=>{await m(),T()}),tn(()=>{c==null||c.close()}),(v,_)=>(b(),k("div",cz,[f("div",uz,[f("div",dz,[_[2]||(_[2]=f("h2",{class:"text-xl font-bold text-gray-900 dark:text-white"}," ADW Agents ",-1)),u.value?(b(),k("div",fz,[..._[1]||(_[1]=[f("span",{class:"relative flex h-2 w-2"},[f("span",{class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),f("span",{class:"relative inline-flex rounded-full h-2 w-2 bg-green-500"})],-1),f("span",{class:"text-sm text-green-600 dark:text-green-400"},"Live",-1)])])):H("",!0)]),f("div",hz,[Ee(f("select",{"onUpdate:modelValue":_[0]||(_[0]=P=>i.value=P),class:"border rounded px-3 py-1.5 dark:bg-gray-700 dark:border-gray-600 dark:text-white"},[_[3]||(_[3]=f("option",{value:""},"No ADW Selected",-1)),(b(!0),k(ae,null,ve(s.value,P=>(b(),k("option",{key:P.adw_id,value:P.adw_id},A(d(P)),9,gz))),128))],512),[[cn,i.value]]),f("div",{class:"flex items-center gap-1"},[f("button",{onClick:y,class:"px-3 py-1.5 text-sm border rounded hover:bg-gray-50 dark:border-gray-600 dark:hover:bg-gray-700",title:"Open agents/ folder"}," 📁 Folder "),f("button",{onClick:x,class:"px-3 py-1.5 text-sm border rounded hover:bg-gray-50 dark:border-gray-600 dark:hover:bg-gray-700",title:"Export timeline"}," 📊 Export ")]),f("button",{onClick:m,disabled:o.value,class:"p-2 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"},[(b(),k("svg",{class:re(["w-5 h-5",{"animate-spin":o.value}]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[..._[4]||(_[4]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2))],8,pz)])]),O(Aj,{ref_key:"pulseGridRef",ref:a,"adw-state":r.value},null,8,["adw-state"]),r.value?(b(),pe(Bj,{key:0,"adw-state":r.value},null,8,["adw-state"])):(b(),k("div",mz,[..._[5]||(_[5]=[f("p",null,"No ADW selected. Select an ADW above to see phase swimlanes.",-1),f("p",{class:"text-sm mt-1"},"Agent pulse cards still show all session activity.",-1)])])),O(lz,{ref_key:"activityStreamRef",ref:l,agents:n.value},null,8,["agents"])]))}}),bz={key:0,class:"fixed inset-0 z-[100]"},xz={class:"flex items-start justify-between mb-3"},vz={class:"text-lg font-bold text-gray-900 dark:text-white"},_z={class:"text-gray-600 dark:text-gray-300 mb-5 leading-relaxed"},kz={class:"flex items-center gap-3 mb-4"},wz={class:"flex-1 h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden"},Sz={class:"text-sm text-gray-500 dark:text-gray-400 font-medium whitespace-nowrap"},$z={class:"flex items-center justify-between"},Cz={key:1,class:"flex-1"},Tz={class:"flex items-center gap-2"},Mz=Oe({__name:"OnboardingOverlay",setup(t){const e=rd(),n=I(null),s=le(()=>{if(!n.value)return{};const l=8;return{top:`${n.value.top-l}px`,left:`${n.value.left-l}px`,width:`${n.value.width+l*2}px`,height:`${n.value.height+l*2}px`}}),r=le(()=>{if(!n.value||!e.currentStep)return{};const l=n.value,c=380,u=200,d=16,h=e.currentStep.position;let g=0,p=0;switch(h){case"bottom":g=l.bottom+d,p=l.left+l.width/2-c/2;break;case"top":g=l.top-u-d,p=l.left+l.width/2-c/2;break;case"left":g=l.top+l.height/2-u/2,p=l.left-c-d;break;case"right":g=l.top+l.height/2-u/2,p=l.right+d;break}const m=window.innerWidth,y=window.innerHeight;return p<16&&(p=16),p+c>m-16&&(p=m-c-16),g<16&&(g=16),g+u>y-16&&(g=y-u-16),{top:`${g}px`,left:`${p}px`,width:`${c}px`}});function i(){if(!e.currentStep){n.value=null;return}const l=document.querySelector(e.currentStep.target);l?(n.value=l.getBoundingClientRect(),l.scrollIntoView({behavior:"smooth",block:"center"})):(console.warn(`Onboarding: Element not found for selector "${e.currentStep.target}"`),n.value=null)}Be(()=>e.currentStepIndex,async()=>{await jn(),i()},{immediate:!0});function o(){i()}function a(l){l.key==="Escape"?e.skipOnboarding():l.key==="ArrowRight"||l.key==="Enter"?e.nextStep():l.key==="ArrowLeft"&&e.previousStep()}return Ge(()=>{window.addEventListener("resize",o),window.addEventListener("keydown",a),i()}),tn(()=>{window.removeEventListener("resize",o),window.removeEventListener("keydown",a)}),(l,c)=>(b(),pe(Gr,{to:"body"},[$(e).isOnboarding?(b(),k("div",bz,[c[5]||(c[5]=f("div",{class:"absolute inset-0 bg-black/70 transition-opacity duration-300"},null,-1)),n.value?(b(),k("div",{key:0,class:"absolute bg-white/10 ring-4 ring-blue-500 rounded-lg transition-all duration-300 pointer-events-none",style:wt(s.value)},null,4)):H("",!0),$(e).currentStep?(b(),k("div",{key:1,class:"absolute bg-white dark:bg-gray-800 rounded-xl shadow-2xl p-6 transition-all duration-300",style:wt(r.value)},[f("div",xz,[f("h3",vz,A($(e).currentStep.title),1),f("button",{onClick:c[0]||(c[0]=(...u)=>$(e).skipOnboarding&&$(e).skipOnboarding(...u)),class:"p-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Skip tour (Esc)"},[O($(Qt),{class:"w-4 h-4 text-gray-500"})])]),f("p",_z,A($(e).currentStep.description),1),f("div",kz,[f("div",wz,[f("div",{class:"h-full bg-blue-500 transition-all duration-300",style:wt({width:`${$(e).progress}%`})},null,4)]),f("span",Sz,A($(e).currentStepIndex+1)+" / "+A($(e).totalSteps),1)]),f("div",$z,[$(e).currentStepIndex>0?(b(),k("button",{key:0,onClick:c[1]||(c[1]=(...u)=>$(e).previousStep&&$(e).previousStep(...u)),class:"flex items-center gap-1 px-3 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 transition-colors"},[O($(Mk),{class:"w-4 h-4"}),c[4]||(c[4]=oe(" Back ",-1))])):(b(),k("div",Cz)),f("div",Tz,[f("button",{onClick:c[2]||(c[2]=(...u)=>$(e).skipOnboarding&&$(e).skipOnboarding(...u)),class:"px-4 py-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 transition-colors"}," Skip "),f("button",{onClick:c[3]||(c[3]=(...u)=>$(e).nextStep&&$(e).nextStep(...u)),class:"flex items-center gap-1 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium"},[oe(A($(e).currentStepIndex===$(e).totalSteps-1?"Finish":"Next")+" ",1),$(e).currentStepIndex<$(e).totalSteps-1?(b(),pe($(id),{key:0,class:"w-4 h-4"})):H("",!0)])])])],4)):H("",!0)])):H("",!0)]))}}),Az={key:0,class:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-lg w-full max-h-[90vh] overflow-hidden flex flex-col"},Ez={class:"px-5 py-3 border-b border-gray-200 dark:border-gray-700 bg-gradient-to-r from-blue-600 to-purple-600"},Pz={class:"flex items-center justify-between"},Rz={class:"flex items-center gap-2 text-white"},Dz=["disabled"],Oz={class:"flex items-center gap-1.5 mt-1.5 text-white/80 text-xs"},Iz={class:"font-medium text-white"},Lz={key:0,class:"text-yellow-200"},Nz={class:"flex-1 overflow-y-auto p-5 space-y-4"},Fz=["onKeydown"],jz={class:"grid grid-cols-2 gap-4"},zz=["value"],Bz={class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},Hz={class:"relative"},Uz={key:0,class:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg"},Vz=["onMousedown"],Wz={key:1,class:"flex flex-wrap gap-1 mt-2"},qz={class:"px-5 py-3 border-t border-gray-200 dark:border-gray-700 flex items-center justify-between"},Kz={class:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400"},Gz={class:"flex items-center gap-2"},Yz=["disabled"],Xz=Oe({__name:"QuickCaptureModal",props:{isOpen:{type:Boolean}},emits:["close","success"],setup(t,{emit:e}){const n=t,s=e,r=We(),i=I(""),o=I("decision"),a=I(""),l=I(50),c=I(!1),u=I(!1),d=I(null),h=le(()=>a.value.trim()?a.value.split(",").map(C=>C.trim().toLowerCase()).filter(C=>C.length>0):[]),g=le(()=>{var C,w;return((C=r.currentProject)==null?void 0:C.name)||((w=r.currentProject)==null?void 0:w.display_name)||"No project selected"}),p=le(()=>!!r.currentProject),m=le(()=>i.value.trim().length>0&&!u.value&&p.value),y=le(()=>{var w;const C=((w=a.value.split(",").pop())==null?void 0:w.trim().toLowerCase())||"";return!C||C.length<1?[]:r.tags.filter(M=>M.name.toLowerCase().startsWith(C)).filter(M=>!h.value.includes(M.name.toLowerCase())).slice(0,5).map(M=>M.name)}),x=I(!1);function S(){i.value="",o.value="decision",a.value="",l.value=50}Be(()=>n.isOpen,async C=>{var w;C&&(await jn(),(w=d.value)==null||w.focus())});async function T(){var C;if(m.value){u.value=!0;try{const w=await r.createMemory({content:i.value.trim(),memory_type:o.value,importance_score:l.value,tags:h.value});w&&(s("success",{id:w.id,content:w.content}),c.value?(S(),await jn(),(C=d.value)==null||C.focus()):(S(),s("close")))}finally{u.value=!1}}}function v(C){const w=a.value.split(",");w.pop(),w.push(C),a.value=w.join(", ")+", ",x.value=!1}function _(){setTimeout(()=>{x.value=!1},200)}function P(){u.value||(S(),s("close"))}function L(C){C.key==="Escape"?P():(C.ctrlKey||C.metaKey)&&C.key==="Enter"&&T()}return Ge(()=>{document.addEventListener("keydown",L)}),tn(()=>{document.removeEventListener("keydown",L)}),(C,w)=>(b(),pe(Gr,{to:"body"},[O(mr,{"enter-active-class":"transition-opacity duration-200","leave-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","leave-to-class":"opacity-0"},{default:js(()=>[t.isOpen?(b(),k("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50",onClick:pt(P,["self"])},[O(mr,{"enter-active-class":"transition-all duration-200","leave-active-class":"transition-all duration-200","enter-from-class":"opacity-0 scale-95","leave-to-class":"opacity-0 scale-95"},{default:js(()=>[t.isOpen?(b(),k("div",Az,[f("div",Ez,[f("div",Pz,[f("div",Rz,[O($(Il),{class:"w-5 h-5"}),w[6]||(w[6]=f("h2",{class:"text-lg font-semibold"},"Quick Capture",-1))]),f("button",{onClick:P,disabled:u.value,class:"p-1 hover:bg-white/20 rounded transition-colors text-white disabled:opacity-50"},[O($(Qt),{class:"w-5 h-5"})],8,Dz)]),f("div",Oz,[O($(Zr),{class:"w-3 h-3"}),w[7]||(w[7]=f("span",null,"Saving to:",-1)),f("span",Iz,A(g.value),1),p.value?H("",!0):(b(),k("span",Lz,"(select a project first)"))])]),f("div",Nz,[f("div",null,[w[8]||(w[8]=f("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"}," What do you want to remember? ",-1)),Ee(f("textarea",{ref_key:"contentTextarea",ref:d,"onUpdate:modelValue":w[0]||(w[0]=M=>i.value=M),rows:"4",class:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Enter your memory content...",onKeydown:[Fr(pt(T,["ctrl"]),["enter"]),Fr(pt(T,["meta"]),["enter"])]},null,40,Fz),[[rt,i.value]])]),f("div",jz,[f("div",null,[w[9]||(w[9]=f("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"}," Type ",-1)),Ee(f("select",{"onUpdate:modelValue":w[1]||(w[1]=M=>o.value=M),class:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent"},[(b(!0),k(ae,null,ve($(cd),M=>(b(),k("option",{key:M,value:M},A(M.charAt(0).toUpperCase()+M.slice(1)),9,zz))),128))],512),[[cn,o.value]])]),f("div",null,[f("label",Bz," Importance: "+A(l.value),1),Ee(f("input",{"onUpdate:modelValue":w[2]||(w[2]=M=>l.value=M),type:"range",min:"1",max:"100",class:"w-full accent-blue-600 mt-2"},null,512),[[rt,l.value,void 0,{number:!0}]])])]),f("div",Hz,[w[10]||(w[10]=f("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"}," Tags (comma-separated) ",-1)),Ee(f("input",{"onUpdate:modelValue":w[3]||(w[3]=M=>a.value=M),type:"text",class:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"tag1, tag2, tag3",onFocus:w[4]||(w[4]=M=>x.value=!0),onBlur:_},null,544),[[rt,a.value]]),x.value&&y.value.length>0?(b(),k("div",Uz,[(b(!0),k(ae,null,ve(y.value,M=>(b(),k("button",{key:M,onMousedown:pt(E=>v(M),["prevent"]),class:"w-full px-3 py-2 text-left text-sm hover:bg-gray-100 dark:hover:bg-gray-700 first:rounded-t-lg last:rounded-b-lg"},A(M),41,Vz))),128))])):H("",!0),h.value.length>0?(b(),k("div",Wz,[(b(!0),k(ae,null,ve(h.value,M=>(b(),k("span",{key:M,class:"px-2 py-0.5 bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full text-xs"},A(M),1))),128))])):H("",!0)])]),f("div",qz,[f("label",Kz,[Ee(f("input",{"onUpdate:modelValue":w[5]||(w[5]=M=>c.value=M),type:"checkbox",class:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"},null,512),[[yr,c.value]]),w[11]||(w[11]=oe(" Keep open after save ",-1))]),f("div",Gz,[w[12]||(w[12]=f("span",{class:"text-xs text-gray-400"},"Ctrl+Enter to save",-1)),f("button",{onClick:T,disabled:!m.value,class:"flex items-center gap-2 px-4 py-2 text-sm text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},[u.value?(b(),pe($(zn),{key:0,class:"w-4 h-4 animate-spin"})):(b(),pe($(km),{key:1,class:"w-4 h-4"})),oe(" "+A(u.value?"Saving...":"Create Memory"),1)],8,Yz)])])])):H("",!0)]),_:1})])):H("",!0)]),_:1})]))}}),Jz={class:"min-h-screen bg-gray-50 dark:bg-gray-900 text-gray-900 dark:text-gray-100"},Zz={class:"container mx-auto px-4 py-6"},Qz={key:0,class:"mb-6"},eB={class:"tab-navigation flex gap-2 mb-6"},tB={key:1,class:"flex gap-6"},nB={key:0,class:"w-64 flex-shrink-0 animate-fade-in"},sB={class:"memory-browser flex-1 min-w-0"},rB={key:1,class:"w-96 flex-shrink-0 animate-fade-in"},iB={key:2},oB={key:3},aB={key:4,class:"max-w-6xl mx-auto"},lB={key:5,class:"max-w-4xl mx-auto"},cB={key:6},uB={key:7,class:"max-w-6xl mx-auto h-[calc(100vh-200px)]"},dB={key:8},fB={key:0,class:"fixed bottom-24 right-6 bg-green-600 text-white px-4 py-3 rounded-lg shadow-lg z-50 flex items-center gap-2"},hB=Oe({__name:"App",setup(t){const e=We(),n=rd(),{connect:s}=_k();kk();const r=I(!0),i=I("memories"),o=I(!1),a=I({show:!1,message:""});Ge(async()=>{await e.loadProjects(),s(),n.hasCompletedOnboarding||setTimeout(()=>{n.startOnboarding()},500),window.addEventListener("show-quick-capture",()=>{o.value=!0})});function l(){r.value=!r.value}function c(h){i.value="memories"}function u(h,g=3e3){a.value={show:!0,message:h},setTimeout(()=>{a.value.show=!1},g)}function d(h){const g=h.content.slice(0,30)+(h.content.length>30?"...":"");u(`Memory created: "${g}"`)}return(h,g)=>(b(),k("div",Jz,[O(BS,{onToggleFilters:l}),f("main",Zz,[$(e).currentProject?(b(),k("div",Qz,[O(YO)])):H("",!0),f("div",eB,[f("button",{onClick:g[0]||(g[0]=p=>i.value="memories"),class:re(["px-4 py-2 rounded-lg font-medium transition-colors",i.value==="memories"?"bg-blue-600 text-white":"bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600"])}," Memories ",2),f("button",{onClick:g[1]||(g[1]=p=>i.value="activity"),class:re(["px-4 py-2 rounded-lg font-medium transition-colors",i.value==="activity"?"bg-blue-600 text-white":"bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600"])}," Activity ",2),f("button",{onClick:g[2]||(g[2]=p=>i.value="stats"),class:re(["px-4 py-2 rounded-lg font-medium transition-colors",i.value==="stats"?"bg-blue-600 text-white":"bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600"])}," Statistics ",2),f("button",{onClick:g[3]||(g[3]=p=>i.value="style"),class:re(["px-4 py-2 rounded-lg font-medium transition-colors",i.value==="style"?"bg-indigo-600 text-white":"bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600"])}," Style ",2),f("button",{onClick:g[4]||(g[4]=p=>i.value="review"),class:re(["px-4 py-2 rounded-lg font-medium transition-colors",i.value==="review"?"bg-amber-600 text-white":"bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600"])}," Review ",2),f("button",{onClick:g[5]||(g[5]=p=>i.value="graph"),class:re(["px-4 py-2 rounded-lg font-medium transition-colors",i.value==="graph"?"bg-purple-600 text-white":"bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600"])}," Graph ",2),f("button",{onClick:g[6]||(g[6]=p=>i.value="chat"),class:re(["px-4 py-2 rounded-lg font-medium transition-colors",i.value==="chat"?"bg-blue-600 text-white":"bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600"])}," Ask AI ",2),f("button",{onClick:g[7]||(g[7]=p=>i.value="agents"),class:re(["px-4 py-2 rounded-lg font-medium transition-colors",i.value==="agents"?"bg-cyan-600 text-white":"bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600"])}," Agents ",2)]),i.value==="memories"?(b(),k("div",tB,[r.value?(b(),k("aside",nB,[O(c5)])):H("",!0),f("div",sB,[O(F5)]),$(e).selectedMemory?(b(),k("aside",rB,[O(E4,{memory:$(e).selectedMemory,onClose:$(e).clearSelection},null,8,["memory","onClose"])])):H("",!0)])):i.value==="activity"?(b(),k("div",iB,[O(u6)])):i.value==="stats"?(b(),k("div",oB,[O(gE)])):i.value==="style"?(b(),k("div",aB,[O(IF)])):i.value==="review"?(b(),k("div",lB,[O(T8)])):i.value==="graph"?(b(),k("div",cB,[O(J9)])):i.value==="chat"?(b(),k("div",uB,[O(SO,{onNavigateToMemory:c})])):i.value==="agents"?(b(),k("div",dB,[O(yz)])):H("",!0)]),O(Mz),f("button",{onClick:g[8]||(g[8]=p=>o.value=!0),class:"fixed bottom-6 right-6 w-14 h-14 bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white rounded-full shadow-lg hover:shadow-xl transition-all duration-200 flex items-center justify-center z-40 group",title:"Quick Capture (Ctrl+Shift+N)"},[O($(km),{class:"w-6 h-6 group-hover:rotate-90 transition-transform duration-200"})]),O(Xz,{"is-open":o.value,onClose:g[9]||(g[9]=p=>o.value=!1),onSuccess:d},null,8,["is-open"]),O(mr,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-y-2","leave-to-class":"opacity-0 translate-y-2"},{default:js(()=>[a.value.show?(b(),k("div",fB,[O($(Yt),{class:"w-5 h-5"}),f("span",null,A(a.value.message),1)])):H("",!0)]),_:1})]))}}),gb=Kv(hB),gB=Xv();gb.use(gB);gb.mount("#app");
|