@whoz-oss/coday-client 0.121.0 → 0.121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdpartylicenses.txt +26 -26
- package/browser/chunk-2DE3OXG3.js +1 -0
- package/browser/chunk-3TOJSAQM.js +1 -0
- package/browser/chunk-4FGPNBI3.js +1 -0
- package/browser/chunk-4LFZBXC3.js +1 -0
- package/browser/chunk-4OMSGXSL.js +1 -0
- package/browser/chunk-5CTKRMM2.js +2 -0
- package/browser/{chunk-HNL4PUVG.js → chunk-5UOZGBZ2.js} +1 -1
- package/browser/chunk-7RF7FEOC.js +1 -0
- package/browser/chunk-DJBCK5D7.js +5 -0
- package/browser/chunk-ELXKRVE4.js +1 -0
- package/browser/chunk-FCCT54AP.js +1 -0
- package/browser/chunk-FPUSD6J7.js +1 -0
- package/browser/chunk-G5XS2TEE.js +1 -0
- package/browser/chunk-GT5UFSUE.js +2 -0
- package/browser/chunk-JPWWZVYZ.js +1 -0
- package/browser/chunk-JW6LSUP2.js +1 -0
- package/browser/chunk-KYPMYRHP.js +1 -0
- package/browser/chunk-LVEC3TBP.js +1 -0
- package/browser/chunk-MJEQQZDO.js +1 -0
- package/browser/{chunk-UAD6TAO5.js → chunk-NO2ODJHX.js} +1 -1
- package/browser/chunk-OK747ZMT.js +1 -0
- package/browser/chunk-OMLFSDJ5.js +1 -0
- package/browser/chunk-P5TSPSCB.js +1 -0
- package/browser/{chunk-S2O6N5YR.js → chunk-PKKHLHXJ.js} +1 -1
- package/browser/chunk-PWN5O4WY.js +1 -0
- package/browser/chunk-R35XCYRZ.js +1 -0
- package/browser/chunk-R5SZYFB2.js +1 -0
- package/browser/chunk-S5LR3GBS.js +2 -0
- package/browser/chunk-TE3JOGRA.js +2 -0
- package/browser/chunk-UGVRFJHC.js +1 -0
- package/browser/chunk-UMDZZGIC.js +1 -0
- package/browser/chunk-UXXLDXN3.js +1 -0
- package/browser/chunk-VNGIXNER.js +1 -0
- package/browser/chunk-VUV5JL5J.js +1 -0
- package/browser/chunk-W4VYO3E2.js +1 -0
- package/browser/chunk-WQDJM4TR.js +1 -0
- package/browser/chunk-XPK5V34V.js +1 -0
- package/browser/{chunk-4VDSG7R6.js → chunk-YDXVLOQW.js} +1 -1
- package/browser/chunk-Z7DC3UIO.js +1 -0
- package/browser/index.html +1 -1
- package/browser/{main-HXX7E37B.js → main-4CSREW6D.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-3YDRI4TY.js +0 -1
- package/browser/chunk-665PXQXJ.js +0 -1
- package/browser/chunk-6WTX5KC7.js +0 -1
- package/browser/chunk-72FRBMD4.js +0 -1
- package/browser/chunk-75YBV3AO.js +0 -1
- package/browser/chunk-7AQBJ5TI.js +0 -1
- package/browser/chunk-7CLTLEML.js +0 -1
- package/browser/chunk-7TOE3DRW.js +0 -2
- package/browser/chunk-A4ZJFWAK.js +0 -1
- package/browser/chunk-BIJXZ7JD.js +0 -1
- package/browser/chunk-CNPJ5XEL.js +0 -1
- package/browser/chunk-EAUVSQPC.js +0 -1
- package/browser/chunk-GLWBXLFL.js +0 -1
- package/browser/chunk-J3WTEANY.js +0 -1
- package/browser/chunk-JB7MERI6.js +0 -1
- package/browser/chunk-JBCOCIPY.js +0 -1
- package/browser/chunk-JDOIYNG7.js +0 -1
- package/browser/chunk-LXI5747H.js +0 -1
- package/browser/chunk-OVZ5YI5D.js +0 -1
- package/browser/chunk-PKJOCTNH.js +0 -2
- package/browser/chunk-QCHIMPFZ.js +0 -1
- package/browser/chunk-QMHQ4NWQ.js +0 -2
- package/browser/chunk-QU3UZZE4.js +0 -5
- package/browser/chunk-RNFBUSBO.js +0 -1
- package/browser/chunk-RQLPS2YR.js +0 -1
- package/browser/chunk-S43E5ZUR.js +0 -2
- package/browser/chunk-SQBLNCXA.js +0 -1
- package/browser/chunk-TA4AM2F6.js +0 -1
- package/browser/chunk-U3HXU6IS.js +0 -1
- package/browser/chunk-VIG2DS4B.js +0 -1
- package/browser/chunk-VLQP3XTM.js +0 -1
- package/browser/chunk-VOAECLLH.js +0 -1
- package/browser/chunk-WCNGR6NT.js +0 -1
- package/browser/chunk-YZAA7VTK.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as sc,b as lc}from"./chunk-S43E5ZUR.js";import{a as dc,b as pc,c as mc}from"./chunk-PKJOCTNH.js";import{a as cc}from"./chunk-BIJXZ7JD.js";import{a as Hl,b as Ul}from"./chunk-HNL4PUVG.js";import{a as Hr,b as Ur,c as Wl,d as Wr,e as qr,f as ql,g as Gr}from"./chunk-UAD6TAO5.js";import{I as nc,J as Qr,K as ic,R as rc,T as oc,U as ac,f as $l,g as li,h as Bl,i as Aa,u as Yl,w as tc}from"./chunk-4VDSG7R6.js";import{F as Vl,G as $r,I as Dn,L as ze,M as zl,N as $t,P as si,Q as Br,R as Ge,S as se,T as ke,e as Vr,f as Oa,h as Ol,i as Al,j as Il,m as Dl,o as zr,p as Rl,r as Nl,s as Fl,t as Ll,y as jl}from"./chunk-S2O6N5YR.js";import{a as Yr,b as ye}from"./chunk-75YBV3AO.js";import{B as ec,C as lt,c as _t,g as at,m as st,p as Ql,q as Kl,v as Xl,w as Jl,x as Zl}from"./chunk-U3HXU6IS.js";import{k as Gl}from"./chunk-VOAECLLH.js";import{a as ot,b as Ie}from"./chunk-SQBLNCXA.js";import{$ as Ca,$a as F,A as fa,Ab as Ne,B as _a,Bb as oi,Cb as te,D as ll,Db as ne,E as ba,Ea as I,Eb as ie,Fa as wt,Fb as vl,G as cl,Ga as _l,Gb as fn,Ha as bl,Hb as Or,I as ni,Ib as Ar,J as va,Ja as Ui,Jb as yl,K as D,Ka as un,Kb as Wi,Lb as Cl,M as gt,Mb as ka,N as re,Oa as wa,Ob as ai,P as H,Q as xt,Qa as Me,Qb as Tt,R as Bi,S as Mr,Sa as C,T as f,Ta as S,Tb as Ir,V as dl,Wa as we,Wb as Sl,X as x,Xa as Te,Xb as Dr,Y as w,Ya as T,Yb as Rr,Z as ya,Za as l,Zb as Nr,_ as pl,_a as c,a as G,aa as ii,ab as hn,b as he,ba as ri,bb as gn,c as il,ca as Z,cb as Ta,cc as Fr,d as B,da as Lt,dc as Lr,ec as xl,f as Er,fa as ml,fb as An,fc as Pa,g as J,ga as qe,gb as O,h as W,ha as Hi,hc as it,ia as jt,ib as v,ja as kr,jc as wl,ka as ft,kb as h,kc as Tl,l as kn,la as ul,lb as rn,m as ei,mb as ht,n as ga,nb as Ea,o as rl,oa as Sa,ob as Be,oc as rt,p as Ae,pb as ge,pc as El,q as Pn,qb as fe,qc as Vt,ra as ut,rc as jr,sa as On,sc as Ml,t as ol,ta as hl,tc as zt,u as al,ua as p,ub as In,uc as kl,v as ve,va as gl,vb as Ke,vc as Pl,wa as xa,wb as Y,x as mn,xb as Ma,y as sl,ya as fl,yb as u,z as ti,za as Pr,zb as L}from"./chunk-QU3UZZE4.js";var q=(function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i})(q||{}),bt="*";function Ia(i,e){return{type:q.Trigger,name:i,definitions:e,options:{}}}function Kr(i,e=null){return{type:q.Animate,styles:e,timings:i}}function uc(i,e=null){return{type:q.Sequence,steps:i,options:e}}function _n(i){return{type:q.Style,styles:i,offset:null}}function Xr(i,e,t=null){return{type:q.Transition,expr:i,animation:e,options:t}}var Bt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(e=0,t=0){this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},Rn=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(e){this.players=e;let t=0,n=0,r=0,o=this.players.length;o==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++t==o&&this._onFinish()}),a.onDestroy(()=>{++n==o&&this._onDestroy()}),a.onStart(()=>{++r==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,s)=>Math.max(a,s.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let t=e*this.totalTime;this.players.forEach(n=>{let r=n.totalTime?Math.min(1,t/n.totalTime):1;n.setPosition(r)})}getPosition(){let e=this.players.reduce((t,n)=>t===null||n.totalTime>t.totalTime?n:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},ci="!";function hc(i){return new re(3e3,!1)}function zp(){return new re(3100,!1)}function $p(){return new re(3101,!1)}function Bp(i){return new re(3001,!1)}function Hp(i){return new re(3003,!1)}function Up(i){return new re(3004,!1)}function fc(i,e){return new re(3005,!1)}function _c(){return new re(3006,!1)}function bc(){return new re(3007,!1)}function vc(i,e){return new re(3008,!1)}function yc(i){return new re(3002,!1)}function Cc(i,e,t,n,r){return new re(3010,!1)}function Sc(){return new re(3011,!1)}function xc(){return new re(3012,!1)}function wc(){return new re(3200,!1)}function Tc(){return new re(3202,!1)}function Ec(){return new re(3013,!1)}function Mc(i){return new re(3014,!1)}function kc(i){return new re(3015,!1)}function Pc(i){return new re(3016,!1)}function Oc(i,e){return new re(3404,!1)}function Wp(i){return new re(3502,!1)}function Ac(i){return new re(3503,!1)}function Ic(){return new re(3300,!1)}function Dc(i){return new re(3504,!1)}function Rc(i){return new re(3301,!1)}function Nc(i,e){return new re(3302,!1)}function Fc(i){return new re(3303,!1)}function Lc(i,e){return new re(3400,!1)}function jc(i){return new re(3401,!1)}function Vc(i){return new re(3402,!1)}function zc(i,e){return new re(3505,!1)}function on(i){switch(i.length){case 0:return new Bt;case 1:return i[0];default:return new Rn(i)}}function Fa(i,e,t=new Map,n=new Map){let r=[],o=[],a=-1,s=null;if(e.forEach(d=>{let m=d.get("offset"),_=m==a,b=_&&s||new Map;d.forEach((y,k)=>{let E=k,P=y;if(k!=="offset")switch(E=i.normalizePropertyName(E,r),P){case ci:P=t.get(k);break;case bt:P=n.get(k);break;default:P=i.normalizeStyleValue(k,E,P,r);break}b.set(E,P)}),_||o.push(b),s=b,a=m}),r.length)throw Wp(r);return o}function Jr(i,e,t,n){switch(e){case"start":i.onStart(()=>n(t&&Da(t,"start",i)));break;case"done":i.onDone(()=>n(t&&Da(t,"done",i)));break;case"destroy":i.onDestroy(()=>n(t&&Da(t,"destroy",i)));break}}function Da(i,e,t){let n=t.totalTime,r=!!t.disabled,o=Zr(i.element,i.triggerName,i.fromState,i.toState,e||i.phaseName,n??i.totalTime,r),a=i._data;return a!=null&&(o._data=a),o}function Zr(i,e,t,n,r="",o=0,a){return{element:i,triggerName:e,fromState:t,toState:n,phaseName:r,totalTime:o,disabled:!!a}}function ct(i,e,t){let n=i.get(e);return n||i.set(e,n=t),n}function La(i){let e=i.indexOf(":"),t=i.substring(1,e),n=i.slice(e+1);return[t,n]}var qp=typeof document>"u"?null:document.documentElement;function eo(i){let e=i.parentNode||i.host||null;return e===qp?null:e}function Gp(i){return i.substring(1,6)=="ebkit"}var Nn=null,gc=!1;function $c(i){Nn||(Nn=Yp()||{},gc=Nn.style?"WebkitAppearance"in Nn.style:!1);let e=!0;return Nn.style&&!Gp(i)&&(e=i in Nn.style,!e&&gc&&(e="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in Nn.style)),e}function Yp(){return typeof document<"u"?document.body:null}function ja(i,e){for(;e;){if(e===i)return!0;e=eo(e)}return!1}function Va(i,e,t){if(t)return Array.from(i.querySelectorAll(e));let n=i.querySelector(e);return n?[n]:[]}var Qp=1e3,za="{{",Kp="}}",$a="ng-enter",to="ng-leave",qi="ng-trigger",Gi=".ng-trigger",Ba="ng-animating",no=".ng-animating";function Ht(i){if(typeof i=="number")return i;let e=i.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Ra(parseFloat(e[1]),e[2])}function Ra(i,e){return e==="s"?i*Qp:i}function Yi(i,e,t){return i.hasOwnProperty("duration")?i:Jp(i,e,t)}var Xp=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Jp(i,e,t){let n,r=0,o="";if(typeof i=="string"){let a=i.match(Xp);if(a===null)return e.push(hc(i)),{duration:0,delay:0,easing:""};n=Ra(parseFloat(a[1]),a[2]);let s=a[3];s!=null&&(r=Ra(parseFloat(s),a[4]));let d=a[5];d&&(o=d)}else n=i;if(!t){let a=!1,s=e.length;n<0&&(e.push(zp()),a=!0),r<0&&(e.push($p()),a=!0),a&&e.splice(s,0,hc(i))}return{duration:n,delay:r,easing:o}}function Bc(i){return i.length?i[0]instanceof Map?i:i.map(e=>new Map(Object.entries(e))):[]}function Et(i,e,t){e.forEach((n,r)=>{let o=io(r);t&&!t.has(r)&&t.set(r,i.style[o]),i.style[o]=n})}function bn(i,e){e.forEach((t,n)=>{let r=io(n);i.style[r]=""})}function di(i){return Array.isArray(i)?i.length==1?i[0]:uc(i):i}function Hc(i,e,t){let n=e.params||{},r=Ha(i);r.length&&r.forEach(o=>{n.hasOwnProperty(o)||t.push(Bp(o))})}var Na=new RegExp(`${za}\\s*(.+?)\\s*${Kp}`,"g");function Ha(i){let e=[];if(typeof i=="string"){let t;for(;t=Na.exec(i);)e.push(t[1]);Na.lastIndex=0}return e}function pi(i,e,t){let n=`${i}`,r=n.replace(Na,(o,a)=>{let s=e[a];return s==null&&(t.push(Hp(a)),s=""),s.toString()});return r==n?i:r}var Zp=/-+([a-z0-9])/g;function io(i){return i.replace(Zp,(...e)=>e[1].toUpperCase())}function Uc(i,e){return i===0||e===0}function Wc(i,e,t){if(t.size&&e.length){let n=e[0],r=[];if(t.forEach((o,a)=>{n.has(a)||r.push(a),n.set(a,o)}),r.length)for(let o=1;o<e.length;o++){let a=e[o];r.forEach(s=>a.set(s,ro(i,s)))}}return e}function dt(i,e,t){switch(e.type){case q.Trigger:return i.visitTrigger(e,t);case q.State:return i.visitState(e,t);case q.Transition:return i.visitTransition(e,t);case q.Sequence:return i.visitSequence(e,t);case q.Group:return i.visitGroup(e,t);case q.Animate:return i.visitAnimate(e,t);case q.Keyframes:return i.visitKeyframes(e,t);case q.Style:return i.visitStyle(e,t);case q.Reference:return i.visitReference(e,t);case q.AnimateChild:return i.visitAnimateChild(e,t);case q.AnimateRef:return i.visitAnimateRef(e,t);case q.Query:return i.visitQuery(e,t);case q.Stagger:return i.visitStagger(e,t);default:throw Up(e.type)}}function ro(i,e){return window.getComputedStyle(i)[e]}var as=(()=>{class i{validateStyleProperty(t){return $c(t)}containsElement(t,n){return ja(t,n)}getParentElement(t){return eo(t)}query(t,n,r){return Va(t,n,r)}computeStyle(t,n,r){return r||""}animate(t,n,r,o,a,s=[],d){return new Bt(r,o)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=H({token:i,factory:i.\u0275fac})}return i})(),Ln=class{static NOOP=new as},jn=class{};var em=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),co=class extends jn{normalizePropertyName(e,t){return io(e)}normalizeStyleValue(e,t,n,r){let o="",a=n.toString().trim();if(em.has(t)&&n!==0&&n!=="0")if(typeof n=="number")o="px";else{let s=n.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&s[1].length==0&&r.push(fc(e,n))}return a+o}};var po="*";function tm(i,e){let t=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(n=>nm(n,t,e)):t.push(i),t}function nm(i,e,t){if(i[0]==":"){let d=im(i,t);if(typeof d=="function"){e.push(d);return}i=d}let n=i.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return t.push(kc(i)),e;let r=n[1],o=n[2],a=n[3];e.push(qc(r,a));let s=r==po&&a==po;o[0]=="<"&&!s&&e.push(qc(a,r))}function im(i,e){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,n)=>parseFloat(n)>parseFloat(t);case":decrement":return(t,n)=>parseFloat(n)<parseFloat(t);default:return e.push(Pc(i)),"* => *"}}var oo=new Set(["true","1"]),ao=new Set(["false","0"]);function qc(i,e){let t=oo.has(i)||ao.has(i),n=oo.has(e)||ao.has(e);return(r,o)=>{let a=i==po||i==r,s=e==po||e==o;return!a&&t&&typeof r=="boolean"&&(a=r?oo.has(i):ao.has(i)),!s&&n&&typeof o=="boolean"&&(s=o?oo.has(e):ao.has(e)),a&&s}}var nd=":self",rm=new RegExp(`s*${nd}s*,?`,"g");function id(i,e,t,n){return new Qa(i).build(e,t,n)}var Gc="",Qa=class{_driver;constructor(e){this._driver=e}build(e,t,n){let r=new Ka(t);return this._resetContextStyleTimingState(r),dt(this,di(e),r)}_resetContextStyleTimingState(e){e.currentQuerySelector=Gc,e.collectedStyles=new Map,e.collectedStyles.set(Gc,new Map),e.currentTime=0}visitTrigger(e,t){let n=t.queryCount=0,r=t.depCount=0,o=[],a=[];return e.name.charAt(0)=="@"&&t.errors.push(_c()),e.definitions.forEach(s=>{if(this._resetContextStyleTimingState(t),s.type==q.State){let d=s,m=d.name;m.toString().split(/\s*,\s*/).forEach(_=>{d.name=_,o.push(this.visitState(d,t))}),d.name=m}else if(s.type==q.Transition){let d=this.visitTransition(s,t);n+=d.queryCount,r+=d.depCount,a.push(d)}else t.errors.push(bc())}),{type:q.Trigger,name:e.name,states:o,transitions:a,queryCount:n,depCount:r,options:null}}visitState(e,t){let n=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(n.containsDynamicStyles){let o=new Set,a=r||{};n.styles.forEach(s=>{s instanceof Map&&s.forEach(d=>{Ha(d).forEach(m=>{a.hasOwnProperty(m)||o.add(m)})})}),o.size&&t.errors.push(vc(e.name,[...o.values()]))}return{type:q.State,name:e.name,style:n,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let n=dt(this,di(e.animation),t),r=tm(e.expr,t.errors);return{type:q.Transition,matchers:r,animation:n,queryCount:t.queryCount,depCount:t.depCount,options:Fn(e.options)}}visitSequence(e,t){return{type:q.Sequence,steps:e.steps.map(n=>dt(this,n,t)),options:Fn(e.options)}}visitGroup(e,t){let n=t.currentTime,r=0,o=e.steps.map(a=>{t.currentTime=n;let s=dt(this,a,t);return r=Math.max(r,t.currentTime),s});return t.currentTime=r,{type:q.Group,steps:o,options:Fn(e.options)}}visitAnimate(e,t){let n=lm(e.timings,t.errors);t.currentAnimateTimings=n;let r,o=e.styles?e.styles:_n({});if(o.type==q.Keyframes)r=this.visitKeyframes(o,t);else{let a=e.styles,s=!1;if(!a){s=!0;let m={};n.easing&&(m.easing=n.easing),a=_n(m)}t.currentTime+=n.duration+n.delay;let d=this.visitStyle(a,t);d.isEmptyStep=s,r=d}return t.currentAnimateTimings=null,{type:q.Animate,timings:n,style:r,options:null}}visitStyle(e,t){let n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,t){let n=[],r=Array.isArray(e.styles)?e.styles:[e.styles];for(let s of r)typeof s=="string"?s===bt?n.push(s):t.errors.push(yc(s)):n.push(new Map(Object.entries(s)));let o=!1,a=null;return n.forEach(s=>{if(s instanceof Map&&(s.has("easing")&&(a=s.get("easing"),s.delete("easing")),!o)){for(let d of s.values())if(d.toString().indexOf(za)>=0){o=!0;break}}}),{type:q.Style,styles:n,easing:a,offset:e.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(e,t){let n=t.currentAnimateTimings,r=t.currentTime,o=t.currentTime;n&&o>0&&(o-=n.duration+n.delay),e.styles.forEach(a=>{typeof a!="string"&&a.forEach((s,d)=>{let m=t.collectedStyles.get(t.currentQuerySelector),_=m.get(d),b=!0;_&&(o!=r&&o>=_.startTime&&r<=_.endTime&&(t.errors.push(Cc(d,_.startTime,_.endTime,o,r)),b=!1),o=_.startTime),b&&m.set(d,{startTime:o,endTime:r}),t.options&&Hc(s,t.options,t.errors)})})}visitKeyframes(e,t){let n={type:q.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(Sc()),n;let r=1,o=0,a=[],s=!1,d=!1,m=0,_=e.steps.map(pe=>{let N=this._makeStyleAst(pe,t),X=N.offset!=null?N.offset:sm(N.styles),U=0;return X!=null&&(o++,U=N.offset=X),d=d||U<0||U>1,s=s||U<m,m=U,a.push(U),N});d&&t.errors.push(xc()),s&&t.errors.push(wc());let b=e.steps.length,y=0;o>0&&o<b?t.errors.push(Tc()):o==0&&(y=r/(b-1));let k=b-1,E=t.currentTime,P=t.currentAnimateTimings,K=P.duration;return _.forEach((pe,N)=>{let X=y>0?N==k?1:y*N:a[N],U=X*K;t.currentTime=E+P.delay+U,P.duration=U,this._validateStyleAst(pe,t),pe.offset=X,n.styles.push(pe)}),n}visitReference(e,t){return{type:q.Reference,animation:dt(this,di(e.animation),t),options:Fn(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:q.AnimateChild,options:Fn(e.options)}}visitAnimateRef(e,t){return{type:q.AnimateRef,animation:this.visitReference(e.animation,t),options:Fn(e.options)}}visitQuery(e,t){let n=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;let[o,a]=om(e.selector);t.currentQuerySelector=n.length?n+" "+o:o,ct(t.collectedStyles,t.currentQuerySelector,new Map);let s=dt(this,di(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:q.Query,selector:o,limit:r.limit||0,optional:!!r.optional,includeSelf:a,animation:s,originalSelector:e.selector,options:Fn(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(Ec());let n=e.timings==="full"?{duration:0,delay:0,easing:"full"}:Yi(e.timings,t.errors,!0);return{type:q.Stagger,animation:dt(this,di(e.animation),t),timings:n,options:null}}};function om(i){let e=!!i.split(/\s*,\s*/).find(t=>t==nd);return e&&(i=i.replace(rm,"")),i=i.replace(/@\*/g,Gi).replace(/@\w+/g,t=>Gi+"-"+t.slice(1)).replace(/:animating/g,no),[i,e]}function am(i){return i?G({},i):null}var Ka=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function sm(i){if(typeof i=="string")return null;let e=null;if(Array.isArray(i))i.forEach(t=>{if(t instanceof Map&&t.has("offset")){let n=t;e=parseFloat(n.get("offset")),n.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let t=i;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function lm(i,e){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let o=Yi(i,e).duration;return Ua(o,0,"")}let t=i;if(t.split(/\s+/).some(o=>o.charAt(0)=="{"&&o.charAt(1)=="{")){let o=Ua(0,0,"");return o.dynamic=!0,o.strValue=t,o}let r=Yi(t,e);return Ua(r.duration,r.delay,r.easing)}function Fn(i){return i?(i=G({},i),i.params&&(i.params=am(i.params))):i={},i}function Ua(i,e,t){return{duration:i,delay:e,easing:t}}function ss(i,e,t,n,r,o,a=null,s=!1){return{type:1,element:i,keyframes:e,preStyleProps:t,postStyleProps:n,duration:r,delay:o,totalTime:r+o,easing:a,subTimeline:s}}var Ki=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},cm=1,dm=":enter",pm=new RegExp(dm,"g"),mm=":leave",um=new RegExp(mm,"g");function rd(i,e,t,n,r,o=new Map,a=new Map,s,d,m=[]){return new Xa().buildKeyframes(i,e,t,n,r,o,a,s,d,m)}var Xa=class{buildKeyframes(e,t,n,r,o,a,s,d,m,_=[]){m=m||new Ki;let b=new Ja(e,t,m,r,o,_,[]);b.options=d;let y=d.delay?Ht(d.delay):0;b.currentTimeline.delayNextStep(y),b.currentTimeline.setStyles([a],null,b.errors,d),dt(this,n,b);let k=b.timelines.filter(E=>E.containsAnimation());if(k.length&&s.size){let E;for(let P=k.length-1;P>=0;P--){let K=k[P];if(K.element===t){E=K;break}}E&&!E.allowOnlyTimelineStyles()&&E.setStyles([s],null,b.errors,d)}return k.length?k.map(E=>E.buildKeyframes()):[ss(t,[],[],[],0,y,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let n=t.subInstructions.get(t.element);if(n){let r=t.createSubContext(e.options),o=t.currentTimeline.currentTime,a=this._visitSubInstructions(n,r,r.options);o!=a&&t.transformIntoNewTimeline(a)}t.previousNode=e}visitAnimateRef(e,t){let n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,n),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,n){for(let r of e){let o=r?.delay;if(o){let a=typeof o=="number"?o:Ht(pi(o,r?.params??{},t.errors));n.delayNextStep(a)}}}_visitSubInstructions(e,t,n){let o=t.currentTimeline.currentTime,a=n.duration!=null?Ht(n.duration):null,s=n.delay!=null?Ht(n.delay):null;return a!==0&&e.forEach(d=>{let m=t.appendInstructionToTimeline(d,a,s);o=Math.max(o,m.duration+m.delay)}),o}visitReference(e,t){t.updateOptions(e.options,!0),dt(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let n=t.subContextCount,r=t,o=e.options;if(o&&(o.params||o.delay)&&(r=t.createSubContext(o),r.transformIntoNewTimeline(),o.delay!=null)){r.previousNode.type==q.Style&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=mo);let a=Ht(o.delay);r.delayNextStep(a)}e.steps.length&&(e.steps.forEach(a=>dt(this,a,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>n&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let n=[],r=t.currentTimeline.currentTime,o=e.options&&e.options.delay?Ht(e.options.delay):0;e.steps.forEach(a=>{let s=t.createSubContext(e.options);o&&s.delayNextStep(o),dt(this,a,s),r=Math.max(r,s.currentTimeline.currentTime),n.push(s.currentTimeline)}),n.forEach(a=>t.currentTimeline.mergeTimelineCollectedStyles(a)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let n=e.strValue,r=t.params?pi(n,t.params,t.errors):n;return Yi(r,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let n=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),r.snapshotCurrentStyles());let o=e.style;o.type==q.Keyframes?this.visitKeyframes(o,t):(t.incrementTime(n.duration),this.visitStyle(o,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let n=t.currentTimeline,r=t.currentAnimateTimings;!r&&n.hasCurrentStyleProperties()&&n.forwardFrame();let o=r&&r.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(o):n.setStyles(e.styles,o,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let n=t.currentAnimateTimings,r=t.currentTimeline.duration,o=n.duration,s=t.createSubContext().currentTimeline;s.easing=n.easing,e.styles.forEach(d=>{let m=d.offset||0;s.forwardTime(m*o),s.setStyles(d.styles,d.easing,t.errors,t.options),s.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(s),t.transformIntoNewTimeline(r+o),t.previousNode=e}visitQuery(e,t){let n=t.currentTimeline.currentTime,r=e.options||{},o=r.delay?Ht(r.delay):0;o&&(t.previousNode.type===q.Style||n==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=mo);let a=n,s=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=s.length;let d=null;s.forEach((m,_)=>{t.currentQueryIndex=_;let b=t.createSubContext(e.options,m);o&&b.delayNextStep(o),m===t.element&&(d=b.currentTimeline),dt(this,e.animation,b),b.currentTimeline.applyStylesToKeyframe();let y=b.currentTimeline.currentTime;a=Math.max(a,y)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(a),d&&(t.currentTimeline.mergeTimelineCollectedStyles(d),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let n=t.parentContext,r=t.currentTimeline,o=e.timings,a=Math.abs(o.duration),s=a*(t.currentQueryTotal-1),d=a*t.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":d=s-d;break;case"full":d=n.currentStaggerTime;break}let _=t.currentTimeline;d&&_.delayNextStep(d);let b=_.currentTime;dt(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=r.currentTime-b+(r.startTime-n.currentTimeline.startTime)}},mo={},Ja=class i{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=mo;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,n,r,o,a,s,d){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=o,this.errors=a,this.timelines=s,this.currentTimeline=d||new uo(this._driver,t,0),s.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let n=e,r=this.options;n.duration!=null&&(r.duration=Ht(n.duration)),n.delay!=null&&(r.delay=Ht(n.delay));let o=n.params;if(o){let a=r.params;a||(a=this.options.params={}),Object.keys(o).forEach(s=>{(!t||!a.hasOwnProperty(s))&&(a[s]=pi(o[s],a,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let n=e.params={};Object.keys(t).forEach(r=>{n[r]=t[r]})}}return e}createSubContext(e=null,t,n){let r=t||this.element,o=new i(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,n||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(e),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(e){return this.previousNode=mo,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){let r={duration:t??e.duration,delay:this.currentTimeline.currentTime+(n??0)+e.delay,easing:""},o=new Za(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(o),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,n,r,o,a){let s=[];if(r&&s.push(this.element),e.length>0){e=e.replace(pm,"."+this._enterClassName),e=e.replace(um,"."+this._leaveClassName);let d=n!=1,m=this._driver.query(this.element,e,d);n!==0&&(m=n<0?m.slice(m.length+n,m.length):m.slice(0,n)),s.push(...m)}return!o&&s.length==0&&a.push(Mc(t)),s}},uo=class i{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,n,r){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=r,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new i(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=cm,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,n]of this._globalTimelineStyles)this._backFill.set(t,n||bt),this._currentKeyframe.set(t,bt);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,n,r){t&&this._previousKeyframe.set("easing",t);let o=r&&r.params||{},a=hm(e,this._globalTimelineStyles);for(let[s,d]of a){let m=pi(d,o,n);this._pendingStyles.set(s,m),this._localTimelineStyles.has(s)||this._backFill.set(s,this._globalTimelineStyles.get(s)??bt),this._updateStyle(s,m)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,n)=>{let r=this._styleSummary.get(n);(!r||t.time>r.time)&&this._updateStyle(n,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,n=this._keyframes.size===1&&this.duration===0,r=[];this._keyframes.forEach((s,d)=>{let m=new Map([...this._backFill,...s]);m.forEach((_,b)=>{_===ci?e.add(b):_===bt&&t.add(b)}),n||m.set("offset",d/this.duration),r.push(m)});let o=[...e.values()],a=[...t.values()];if(n){let s=r[0],d=new Map(s);s.set("offset",0),d.set("offset",1),r=[s,d]}return ss(this.element,r,o,a,this.duration,this.startTime,this.easing,!1)}},Za=class extends uo{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,n,r,o,a,s=!1){super(e,t,a.delay),this.keyframes=n,this.preStyleProps=r,this.postStyleProps=o,this._stretchStartingKeyframe=s,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:n,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){let o=[],a=n+t,s=t/a,d=new Map(e[0]);d.set("offset",0),o.push(d);let m=new Map(e[0]);m.set("offset",Yc(s)),o.push(m);let _=e.length-1;for(let b=1;b<=_;b++){let y=new Map(e[b]),k=y.get("offset"),E=t+k*n;y.set("offset",Yc(E/a)),o.push(y)}n=a,t=0,r="",e=o}return ss(this.element,e,this.preStyleProps,this.postStyleProps,n,t,r,!0)}};function Yc(i,e=3){let t=Math.pow(10,e-1);return Math.round(i*t)/t}function hm(i,e){let t=new Map,n;return i.forEach(r=>{if(r==="*"){n??=e.keys();for(let o of n)t.set(o,bt)}else for(let[o,a]of r)t.set(o,a)}),t}function Qc(i,e,t,n,r,o,a,s,d,m,_,b,y){return{type:0,element:i,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:o,toState:n,toStyles:a,timelines:s,queriedElements:d,preStyleProps:m,postStyleProps:_,totalTime:b,errors:y}}var Wa={},ho=class{_triggerName;ast;_stateStyles;constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,r){return gm(this.ast.matchers,e,t,n,r)}buildStyles(e,t,n){let r=this._stateStyles.get("*");return e!==void 0&&(r=this._stateStyles.get(e?.toString())||r),r?r.buildStyles(t,n):new Map}build(e,t,n,r,o,a,s,d,m,_){let b=[],y=this.ast.options&&this.ast.options.params||Wa,k=s&&s.params||Wa,E=this.buildStyles(n,k,b),P=d&&d.params||Wa,K=this.buildStyles(r,P,b),pe=new Set,N=new Map,X=new Map,U=r==="void",Ee={params:od(P,y),delay:this.ast.options?.delay},de=_?[]:rd(e,t,this.ast.animation,o,a,E,K,Ee,m,b),xe=0;return de.forEach(He=>{xe=Math.max(He.duration+He.delay,xe)}),b.length?Qc(t,this._triggerName,n,r,U,E,K,[],[],N,X,xe,b):(de.forEach(He=>{let Zt=He.element,dn=ct(N,Zt,new Set);He.preStyleProps.forEach(St=>dn.add(St));let Ve=ct(X,Zt,new Set);He.postStyleProps.forEach(St=>Ve.add(St)),Zt!==t&&pe.add(Zt)}),Qc(t,this._triggerName,n,r,U,E,K,de,[...pe.values()],N,X,xe))}};function gm(i,e,t,n,r){return i.some(o=>o(e,t,n,r))}function od(i,e){let t=G({},e);return Object.entries(i).forEach(([n,r])=>{r!=null&&(t[n]=r)}),t}var es=class{styles;defaultParams;normalizer;constructor(e,t,n){this.styles=e,this.defaultParams=t,this.normalizer=n}buildStyles(e,t){let n=new Map,r=od(e,this.defaultParams);return this.styles.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,s)=>{a&&(a=pi(a,r,t));let d=this.normalizer.normalizePropertyName(s,t);a=this.normalizer.normalizeStyleValue(s,d,a,t),n.set(s,a)})}),n}};function fm(i,e,t){return new ts(i,e,t)}var ts=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,n){this.name=e,this.ast=t,this._normalizer=n,t.states.forEach(r=>{let o=r.options&&r.options.params||{};this.states.set(r.name,new es(r.style,o,n))}),Kc(this.states,"true","1"),Kc(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new ho(e,r,this.states))}),this.fallbackTransition=_m(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,r){return this.transitionFactories.find(a=>a.match(e,t,n,r))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}};function _m(i,e,t){let n=[(a,s)=>!0],r={type:q.Sequence,steps:[],options:null},o={type:q.Transition,animation:r,matchers:n,options:null,queryCount:0,depCount:0};return new ho(i,o,e)}function Kc(i,e,t){i.has(e)?i.has(t)||i.set(t,i.get(e)):i.has(t)&&i.set(e,i.get(t))}var bm=new Ki,ns=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n}register(e,t){let n=[],r=[],o=id(this._driver,t,n,r);if(n.length)throw Ac(n);this._animations.set(e,o)}_buildPlayer(e,t,n){let r=e.element,o=Fa(this._normalizer,e.keyframes,t,n);return this._driver.animate(r,o,e.duration,e.delay,e.easing,[],!0)}create(e,t,n={}){let r=[],o=this._animations.get(e),a,s=new Map;if(o?(a=rd(this._driver,t,o,$a,to,new Map,new Map,n,bm,r),a.forEach(_=>{let b=ct(s,_.element,new Map);_.postStyleProps.forEach(y=>b.set(y,null))})):(r.push(Ic()),a=[]),r.length)throw Dc(r);s.forEach((_,b)=>{_.forEach((y,k)=>{_.set(k,this._driver.computeStyle(b,k,bt))})});let d=a.map(_=>{let b=s.get(_.element);return this._buildPlayer(_,new Map,b)}),m=on(d);return this._playersById.set(e,m),m.onDestroy(()=>this.destroy(e)),this.players.push(m),m}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Rc(e);return t}listen(e,t,n,r){let o=Zr(t,"","","");return Jr(this._getPlayer(e),n,o,r),()=>{}}command(e,t,n,r){if(n=="register"){this.register(e,r[0]);return}if(n=="create"){let a=r[0]||{};this.create(e,t,a);return}let o=this._getPlayer(e);switch(n){case"play":o.play();break;case"pause":o.pause();break;case"reset":o.reset();break;case"restart":o.restart();break;case"finish":o.finish();break;case"init":o.init();break;case"setPosition":o.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e);break}}},Xc="ng-animate-queued",vm=".ng-animate-queued",qa="ng-animate-disabled",ym=".ng-animate-disabled",Cm="ng-star-inserted",Sm=".ng-star-inserted",xm=[],ad={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},wm={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Mt="__ng_removed",Xi=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let n=e&&e.hasOwnProperty("value"),r=n?e.value:e;if(this.value=Em(r),n){let o=e,{value:a}=o,s=il(o,["value"]);this.options=s}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let n=this.options.params;Object.keys(t).forEach(r=>{n[r]==null&&(n[r]=t[r])})}}},Qi="void",Ga=new Xi(Qi),is=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this._hostClassName="ng-tns-"+e,vt(t,this._hostClassName)}listen(e,t,n,r){if(!this._triggers.has(t))throw Nc(n,t);if(n==null||n.length==0)throw Fc(t);if(!Mm(n))throw Lc(n,t);let o=ct(this._elementListeners,e,[]),a={name:t,phase:n,callback:r};o.push(a);let s=ct(this._engine.statesByElement,e,new Map);return s.has(t)||(vt(e,qi),vt(e,qi+"-"+t),s.set(t,Ga)),()=>{this._engine.afterFlush(()=>{let d=o.indexOf(a);d>=0&&o.splice(d,1),this._triggers.has(t)||s.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw jc(e);return t}trigger(e,t,n,r=!0){let o=this._getTrigger(t),a=new Ji(this.id,t,e),s=this._engine.statesByElement.get(e);s||(vt(e,qi),vt(e,qi+"-"+t),this._engine.statesByElement.set(e,s=new Map));let d=s.get(t),m=new Xi(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&d&&m.absorbOptions(d.options),s.set(t,m),d||(d=Ga),!(m.value===Qi)&&d.value===m.value){if(!Om(d.params,m.params)){let P=[],K=o.matchStyles(d.value,d.params,P),pe=o.matchStyles(m.value,m.params,P);P.length?this._engine.reportError(P):this._engine.afterFlush(()=>{bn(e,K),Et(e,pe)})}return}let y=ct(this._engine.playersByElement,e,[]);y.forEach(P=>{P.namespaceId==this.id&&P.triggerName==t&&P.queued&&P.destroy()});let k=o.matchTransition(d.value,m.value,e,m.params),E=!1;if(!k){if(!r)return;k=o.fallbackTransition,E=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:k,fromState:d,toState:m,player:a,isFallbackTransition:E}),E||(vt(e,Xc),a.onStart(()=>{mi(e,Xc)})),a.onDone(()=>{let P=this.players.indexOf(a);P>=0&&this.players.splice(P,1);let K=this._engine.playersByElement.get(e);if(K){let pe=K.indexOf(a);pe>=0&&K.splice(pe,1)}}),this.players.push(a),y.push(a),a}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,n)=>{this._elementListeners.set(n,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(n=>n.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let n=this._engine.driver.query(e,Gi,!0);n.forEach(r=>{if(r[Mt])return;let o=this._engine.fetchNamespacesByElement(r);o.size?o.forEach(a=>a.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,n,r){let o=this._engine.statesByElement.get(e),a=new Map;if(o){let s=[];if(o.forEach((d,m)=>{if(a.set(m,d.value),this._triggers.has(m)){let _=this.trigger(e,m,Qi,r);_&&s.push(_)}}),s.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,a),n&&on(s).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),n=this._engine.statesByElement.get(e);if(t&&n){let r=new Set;t.forEach(o=>{let a=o.name;if(r.has(a))return;r.add(a);let d=this._triggers.get(a).fallbackTransition,m=n.get(a)||Ga,_=new Xi(Qi),b=new Ji(this.id,a,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:a,transition:d,fromState:m,toState:_,player:b,isFallbackTransition:!0})})}}removeNode(e,t){let n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(n.totalAnimations){let o=n.players.length?n.playersByQueriedElement.get(e):[];if(o&&o.length)r=!0;else{let a=e;for(;a=a.parentNode;)if(n.statesByElement.get(a)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)n.markElementAsRemoved(this.id,e,!1,t);else{let o=e[Mt];(!o||o===ad)&&(n.afterFlush(()=>this.clearElementCache(e)),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){vt(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(n=>{let r=n.player;if(r.destroyed)return;let o=n.element,a=this._elementListeners.get(o);a&&a.forEach(s=>{if(s.name==n.triggerName){let d=Zr(o,n.triggerName,n.fromState.value,n.toState.value);d._data=e,Jr(n.player,s.phase,d,s.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(n)}),this._queue=[],t.sort((n,r)=>{let o=n.transition.ast.depCount,a=r.transition.ast.depCount;return o==0||a==0?o-a:this._engine.driver.containsElement(n.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},rs=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(n=>{n.queued&&e.push(n)})}),e}createNamespace(e,t){let n=new is(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){let n=this._namespaceList,r=this.namespacesByHostElement;if(n.length-1>=0){let a=!1,s=this.driver.getParentElement(t);for(;s;){let d=r.get(s);if(d){let m=n.indexOf(d);n.splice(m+1,0,e),a=!0;break}s=this.driver.getParentElement(s)}a||n.unshift(e)}else n.push(e);return r.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let r=this._namespaceLookup[e];r&&r.register(t,n)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(e);this.namespacesByHostElement.delete(n.hostElement);let r=this._namespaceList.indexOf(n);r>=0&&this._namespaceList.splice(r,1),n.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,n=this.statesByElement.get(e);if(n){for(let r of n.values())if(r.namespaceId){let o=this._fetchNamespace(r.namespaceId);o&&t.add(o)}}return t}trigger(e,t,n,r){if(so(t)){let o=this._fetchNamespace(e);if(o)return o.trigger(t,n,r),!0}return!1}insertNode(e,t,n,r){if(!so(t))return;let o=t[Mt];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;let a=this.collectedLeaveElements.indexOf(t);a>=0&&this.collectedLeaveElements.splice(a,1)}if(e){let a=this._fetchNamespace(e);a&&a.insertNode(t,n)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),vt(e,qa)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),mi(e,qa))}removeNode(e,t,n){if(so(t)){let r=e?this._fetchNamespace(e):null;r?r.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n);let o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,n)}else this._onRemovalComplete(t,n)}markElementAsRemoved(e,t,n,r,o){this.collectedLeaveElements.push(t),t[Mt]={namespaceId:e,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:o}}listen(e,t,n,r,o){return so(t)?this._fetchNamespace(e).listen(t,n,r,o):()=>{}}_buildInstruction(e,t,n,r,o){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,r,e.fromState.options,e.toState.options,t,o)}destroyInnerAnimations(e){let t=this.driver.query(e,Gi,!0);t.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,no,!0),t.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return on(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[Mt];if(t&&t.setForRemoval){if(e[Mt]=ad,t.namespaceId){this.destroyInnerAnimations(e);let n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(qa)&&this.markElementAsDisabled(e,!1),this.driver.query(e,ym,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,r)=>this._balanceNamespaceList(n,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;n<this.collectedEnterElements.length;n++){let r=this.collectedEnterElements[n];vt(r,Cm)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let n=[];try{t=this._flushAnimations(n,e)}finally{for(let r=0;r<n.length;r++)n[r]()}}else for(let n=0;n<this.collectedLeaveElements.length;n++){let r=this.collectedLeaveElements[n];this.processLeaveNode(r)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(n=>n()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],t.length?on(t).onDone(()=>{n.forEach(r=>r())}):n.forEach(r=>r())}}reportError(e){throw Vc(e)}_flushAnimations(e,t){let n=new Ki,r=[],o=new Map,a=[],s=new Map,d=new Map,m=new Map,_=new Set;this.disabledNodes.forEach(A=>{_.add(A);let j=this.driver.query(A,vm,!0);for(let $=0;$<j.length;$++)_.add(j[$])});let b=this.bodyNode,y=Array.from(this.statesByElement.keys()),k=ed(y,this.collectedEnterElements),E=new Map,P=0;k.forEach((A,j)=>{let $=$a+P++;E.set(j,$),A.forEach(ee=>vt(ee,$))});let K=[],pe=new Set,N=new Set;for(let A=0;A<this.collectedLeaveElements.length;A++){let j=this.collectedLeaveElements[A],$=j[Mt];$&&$.setForRemoval&&(K.push(j),pe.add(j),$.hasAnimation?this.driver.query(j,Sm,!0).forEach(ee=>pe.add(ee)):N.add(j))}let X=new Map,U=ed(y,Array.from(pe));U.forEach((A,j)=>{let $=to+P++;X.set(j,$),A.forEach(ee=>vt(ee,$))}),e.push(()=>{k.forEach((A,j)=>{let $=E.get(j);A.forEach(ee=>mi(ee,$))}),U.forEach((A,j)=>{let $=X.get(j);A.forEach(ee=>mi(ee,$))}),K.forEach(A=>{this.processLeaveNode(A)})});let Ee=[],de=[];for(let A=this._namespaceList.length-1;A>=0;A--)this._namespaceList[A].drainQueuedTransitions(t).forEach($=>{let ee=$.player,Oe=$.element;if(Ee.push(ee),this.collectedEnterElements.length){let De=Oe[Mt];if(De&&De.setForMove){if(De.previousTriggersValues&&De.previousTriggersValues.has($.triggerName)){let tt=De.previousTriggersValues.get($.triggerName),Qe=this.statesByElement.get($.element);if(Qe&&Qe.has($.triggerName)){let pn=Qe.get($.triggerName);pn.value=tt,Qe.set($.triggerName,pn)}}ee.destroy();return}}let ce=!b||!this.driver.containsElement(b,Oe),Ue=X.get(Oe),me=E.get(Oe),ue=this._buildInstruction($,n,me,Ue,ce);if(ue.errors&&ue.errors.length){de.push(ue);return}if(ce){ee.onStart(()=>bn(Oe,ue.fromStyles)),ee.onDestroy(()=>Et(Oe,ue.toStyles)),r.push(ee);return}if($.isFallbackTransition){ee.onStart(()=>bn(Oe,ue.fromStyles)),ee.onDestroy(()=>Et(Oe,ue.toStyles)),r.push(ee);return}let _e=[];ue.timelines.forEach(De=>{De.stretchStartingKeyframe=!0,this.disabledNodes.has(De.element)||_e.push(De)}),ue.timelines=_e,n.append(Oe,ue.timelines);let Tn={instruction:ue,player:ee,element:Oe};a.push(Tn),ue.queriedElements.forEach(De=>ct(s,De,[]).push(ee)),ue.preStyleProps.forEach((De,tt)=>{if(De.size){let Qe=d.get(tt);Qe||d.set(tt,Qe=new Set),De.forEach((pn,Gn)=>Qe.add(Gn))}}),ue.postStyleProps.forEach((De,tt)=>{let Qe=m.get(tt);Qe||m.set(tt,Qe=new Set),De.forEach((pn,Gn)=>Qe.add(Gn))})});if(de.length){let A=[];de.forEach(j=>{A.push(zc(j.triggerName,j.errors))}),Ee.forEach(j=>j.destroy()),this.reportError(A)}let xe=new Map,He=new Map;a.forEach(A=>{let j=A.element;n.has(j)&&(He.set(j,j),this._beforeAnimationBuild(A.player.namespaceId,A.instruction,xe))}),r.forEach(A=>{let j=A.element;this._getPreviousPlayers(j,!1,A.namespaceId,A.triggerName,null).forEach(ee=>{ct(xe,j,[]).push(ee),ee.destroy()})});let Zt=K.filter(A=>td(A,d,m)),dn=new Map;Zc(dn,this.driver,N,m,bt).forEach(A=>{td(A,d,m)&&Zt.push(A)});let St=new Map;k.forEach((A,j)=>{Zc(St,this.driver,new Set(A),d,ci)}),Zt.forEach(A=>{let j=dn.get(A),$=St.get(A);dn.set(A,new Map([...j?.entries()??[],...$?.entries()??[]]))});let wn=[],qn=[],br={};a.forEach(A=>{let{element:j,player:$,instruction:ee}=A;if(n.has(j)){if(_.has(j)){$.onDestroy(()=>Et(j,ee.toStyles)),$.disabled=!0,$.overrideTotalTime(ee.totalTime),r.push($);return}let Oe=br;if(He.size>1){let Ue=j,me=[];for(;Ue=Ue.parentNode;){let ue=He.get(Ue);if(ue){Oe=ue;break}me.push(Ue)}me.forEach(ue=>He.set(ue,Oe))}let ce=this._buildAnimation($.namespaceId,ee,xe,o,St,dn);if($.setRealPlayer(ce),Oe===br)wn.push($);else{let Ue=this.playersByElement.get(Oe);Ue&&Ue.length&&($.parentPlayer=on(Ue)),r.push($)}}else bn(j,ee.fromStyles),$.onDestroy(()=>Et(j,ee.toStyles)),qn.push($),_.has(j)&&r.push($)}),qn.forEach(A=>{let j=o.get(A.element);if(j&&j.length){let $=on(j);A.setRealPlayer($)}}),r.forEach(A=>{A.parentPlayer?A.syncPlayerEvents(A.parentPlayer):A.destroy()});for(let A=0;A<K.length;A++){let j=K[A],$=j[Mt];if(mi(j,to),$&&$.hasAnimation)continue;let ee=[];if(s.size){let ce=s.get(j);ce&&ce.length&&ee.push(...ce);let Ue=this.driver.query(j,no,!0);for(let me=0;me<Ue.length;me++){let ue=s.get(Ue[me]);ue&&ue.length&&ee.push(...ue)}}let Oe=ee.filter(ce=>!ce.destroyed);Oe.length?km(this,j,Oe):this.processLeaveNode(j)}return K.length=0,wn.forEach(A=>{this.players.push(A),A.onDone(()=>{A.destroy();let j=this.players.indexOf(A);this.players.splice(j,1)}),A.play()}),wn}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,r,o){let a=[];if(t){let s=this.playersByQueriedElement.get(e);s&&(a=s)}else{let s=this.playersByElement.get(e);if(s){let d=!o||o==Qi;s.forEach(m=>{m.queued||!d&&m.triggerName!=r||a.push(m)})}}return(n||r)&&(a=a.filter(s=>!(n&&n!=s.namespaceId||r&&r!=s.triggerName))),a}_beforeAnimationBuild(e,t,n){let r=t.triggerName,o=t.element,a=t.isRemovalTransition?void 0:e,s=t.isRemovalTransition?void 0:r;for(let d of t.timelines){let m=d.element,_=m!==o,b=ct(n,m,[]);this._getPreviousPlayers(m,_,a,s,t.toState).forEach(k=>{let E=k.getRealPlayer();E.beforeDestroy&&E.beforeDestroy(),k.destroy(),b.push(k)})}bn(o,t.fromStyles)}_buildAnimation(e,t,n,r,o,a){let s=t.triggerName,d=t.element,m=[],_=new Set,b=new Set,y=t.timelines.map(E=>{let P=E.element;_.add(P);let K=P[Mt];if(K&&K.removedBeforeQueried)return new Bt(E.duration,E.delay);let pe=P!==d,N=Pm((n.get(P)||xm).map(xe=>xe.getRealPlayer())).filter(xe=>{let He=xe;return He.element?He.element===P:!1}),X=o.get(P),U=a.get(P),Ee=Fa(this._normalizer,E.keyframes,X,U),de=this._buildPlayer(E,Ee,N);if(E.subTimeline&&r&&b.add(P),pe){let xe=new Ji(e,s,P);xe.setRealPlayer(de),m.push(xe)}return de});m.forEach(E=>{ct(this.playersByQueriedElement,E.element,[]).push(E),E.onDone(()=>Tm(this.playersByQueriedElement,E.element,E))}),_.forEach(E=>vt(E,Ba));let k=on(y);return k.onDestroy(()=>{_.forEach(E=>mi(E,Ba)),Et(d,t.toStyles)}),b.forEach(E=>{ct(r,E,[]).push(k)}),k}_buildPlayer(e,t,n){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new Bt(e.duration,e.delay)}},Ji=class{namespaceId;triggerName;element;_player=new Bt;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,n)=>{t.forEach(r=>Jr(e,n,void 0,r))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){ct(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function Tm(i,e,t){let n=i.get(e);if(n){if(n.length){let r=n.indexOf(t);n.splice(r,1)}n.length==0&&i.delete(e)}return n}function Em(i){return i??null}function so(i){return i&&i.nodeType===1}function Mm(i){return i=="start"||i=="done"}function Jc(i,e){let t=i.style.display;return i.style.display=e??"none",t}function Zc(i,e,t,n,r){let o=[];t.forEach(d=>o.push(Jc(d)));let a=[];n.forEach((d,m)=>{let _=new Map;d.forEach(b=>{let y=e.computeStyle(m,b,r);_.set(b,y),(!y||y.length==0)&&(m[Mt]=wm,a.push(m))}),i.set(m,_)});let s=0;return t.forEach(d=>Jc(d,o[s++])),a}function ed(i,e){let t=new Map;if(i.forEach(s=>t.set(s,[])),e.length==0)return t;let n=1,r=new Set(e),o=new Map;function a(s){if(!s)return n;let d=o.get(s);if(d)return d;let m=s.parentNode;return t.has(m)?d=m:r.has(m)?d=n:d=a(m),o.set(s,d),d}return e.forEach(s=>{let d=a(s);d!==n&&t.get(d).push(s)}),t}function vt(i,e){i.classList?.add(e)}function mi(i,e){i.classList?.remove(e)}function km(i,e,t){on(t).onDone(()=>i.processLeaveNode(e))}function Pm(i){let e=[];return sd(i,e),e}function sd(i,e){for(let t=0;t<i.length;t++){let n=i[t];n instanceof Rn?sd(n.players,e):e.push(n)}}function Om(i,e){let t=Object.keys(i),n=Object.keys(e);if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let o=t[r];if(!e.hasOwnProperty(o)||i[o]!==e[o])return!1}return!0}function td(i,e,t){let n=t.get(i);if(!n)return!1;let r=e.get(i);return r?n.forEach(o=>r.add(o)):e.set(i,n),t.delete(i),!0}var ui=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,n){this._driver=t,this._normalizer=n,this._transitionEngine=new rs(e.body,t,n),this._timelineEngine=new ns(e.body,t,n),this._transitionEngine.onRemovalComplete=(r,o)=>this.onRemovalComplete(r,o)}registerTrigger(e,t,n,r,o){let a=e+"-"+r,s=this._triggerCache[a];if(!s){let d=[],m=[],_=id(this._driver,o,d,m);if(d.length)throw Oc(r,d);s=fm(r,_,this._normalizer),this._triggerCache[a]=s}this._transitionEngine.registerTrigger(t,r,s)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,n,r){this._transitionEngine.insertNode(e,t,n,r)}onRemove(e,t,n){this._transitionEngine.removeNode(e,t,n)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,n,r){if(n.charAt(0)=="@"){let[o,a]=La(n),s=r;this._timelineEngine.command(o,t,a,s)}else this._transitionEngine.trigger(e,t,n,r)}listen(e,t,n,r,o){if(n.charAt(0)=="@"){let[a,s]=La(n);return this._timelineEngine.listen(a,t,s,o)}return this._transitionEngine.listen(e,t,n,r,o)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function Am(i,e){let t=null,n=null;return Array.isArray(e)&&e.length?(t=Ya(e[0]),e.length>1&&(n=Ya(e[e.length-1]))):e instanceof Map&&(t=Ya(e)),t||n?new Im(i,t,n):null}var Im=(()=>{class i{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,n,r){this._element=t,this._startStyles=n,this._endStyles=r;let o=i.initialStylesByElement.get(t);o||i.initialStylesByElement.set(t,o=new Map),this._initialStyles=o}start(){this._state<1&&(this._startStyles&&Et(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Et(this._element,this._initialStyles),this._endStyles&&(Et(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(i.initialStylesByElement.delete(this._element),this._startStyles&&(bn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(bn(this._element,this._endStyles),this._endStyles=null),Et(this._element,this._initialStyles),this._state=3)}}return i})();function Ya(i){let e=null;return i.forEach((t,n)=>{Dm(n)&&(e=e||new Map,e.set(n,t))}),e}function Dm(i){return i==="display"||i==="position"}var go=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,n,r){this.element=e,this.keyframes=t,this.options=n,this._specialStyles=r,this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let e=this.keyframes,t=this._triggerWebAnimation(this.element,e,this.options);if(!t)return this._onFinish(),null;this.domPlayer=t,this._finalKeyframe=e.length?e[e.length-1]:new Map;let n=()=>this._onFinish();return t.addEventListener("finish",n),this.onDestroy(()=>{t.removeEventListener("finish",n)}),t}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(n=>{t.push(Object.fromEntries(n))}),t}_triggerWebAnimation(e,t,n){let r=this._convertKeyframesToObject(t);try{return e.animate(r,n)}catch(o){return null}}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){let e=this._buildPlayer();e&&(this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),e.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=e*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((n,r)=>{r!=="offset"&&e.set(r,this._finished?n:ro(this.element,r))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},fo=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return ja(e,t)}getParentElement(e){return eo(e)}query(e,t,n){return Va(e,t,n)}computeStyle(e,t,n){return ro(e,t)}animate(e,t,n,r,o,a=[]){let s=r==0?"both":"forwards",d={duration:n,delay:r,fill:s};o&&(d.easing=o);let m=new Map,_=a.filter(k=>k instanceof go);Uc(n,r)&&_.forEach(k=>{k.currentSnapshot.forEach((E,P)=>m.set(P,E))});let b=Bc(t).map(k=>new Map(k));b=Wc(e,b,m);let y=Am(e,b);return new go(e,b,d,y)}};var lo="@",ld="@.disabled",_o=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,n,r){this.namespaceId=e,this.delegate=t,this.engine=n,this._onDestroy=r}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,n,r=!0){this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,n,r){if(r){this.delegate.removeChild(e,t,n,r);return}this.parentNode(t)&&this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,n,r){this.delegate.setAttribute(e,t,n,r)}removeAttribute(e,t,n){this.delegate.removeAttribute(e,t,n)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,n,r){this.delegate.setStyle(e,t,n,r)}removeStyle(e,t,n){this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){t.charAt(0)==lo&&t==ld?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,n,r){return this.delegate.listen(e,t,n,r)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},os=class extends _o{factory;constructor(e,t,n,r,o){super(t,n,r,o),this.factory=e,this.namespaceId=t}setProperty(e,t,n){t.charAt(0)==lo?t.charAt(1)=="."&&t==ld?(n=n===void 0?!0:!!n,this.disableAnimations(e,n)):this.engine.process(this.namespaceId,e,t.slice(1),n):this.delegate.setProperty(e,t,n)}listen(e,t,n,r){if(t.charAt(0)==lo){let o=Rm(e),a=t.slice(1),s="";return a.charAt(0)!=lo&&([a,s]=Nm(a)),this.engine.listen(this.namespaceId,o,a,s,d=>{let m=d._data||-1;this.factory.scheduleListenerCallback(m,n,d)})}return this.delegate.listen(e,t,n,r)}};function Rm(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function Nm(i){let e=i.indexOf("."),t=i.substring(0,e),n=i.slice(e+1);return[t,n]}var bo=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,n){this.delegate=e,this.engine=t,this._zone=n,t.onRemovalComplete=(r,o)=>{o?.removeChild(null,r)}}createRenderer(e,t){let r=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let m=this._rendererCache,_=m.get(r);if(!_){let b=()=>m.delete(r);_=new _o("",r,this.engine,b),m.set(r,_)}return _}let o=t.id,a=t.id+"-"+this._currentId;this._currentId++,this.engine.register(a,e);let s=m=>{Array.isArray(m)?m.forEach(s):this.engine.registerTrigger(o,a,e,m.name,m)};return t.data.animation.forEach(s),new os(this,a,r,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,n){if(e>=0&&e<this._microtaskId){this._zone.run(()=>t(n));return}let r=this._animationCallbacksBuffer;r.length==0&&queueMicrotask(()=>{this._zone.run(()=>{r.forEach(o=>{let[a,s]=o;a(s)}),this._animationCallbacksBuffer=[]})}),r.push([t,n])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(e){this.engine.flush(),this.delegate.componentReplaced?.(e)}};var Lm=(()=>{class i extends ui{constructor(t,n,r){super(t,n,r)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||i)(Mr(ii),Mr(Ln),Mr(jn))};static \u0275prov=H({token:i,factory:i.\u0275fac})}return i})();function jm(){return new co}function Vm(){return new bo(f(wl),f(ui),f(Lt))}var cd=[{provide:jn,useFactory:jm},{provide:ui,useClass:Lm},{provide:fl,useFactory:Vm}],h_=[{provide:Ln,useClass:as},{provide:Sa,useValue:"NoopAnimations"},...cd],zm=[{provide:Ln,useFactory:()=>new fo},{provide:Sa,useFactory:()=>"BrowserAnimations"},...cd];function dd(){return gl("NgEagerAnimations"),[...zm]}function $m(i,e){if(i&1){let t=O();l(0,"mat-checkbox",6),ie("ngModelChange",function(r){x(t);let o=h();return ne(o.checkboxChecked,r)||(o.checkboxChecked=r),w(r)}),u(1),c()}if(i&2){let t=h();te("ngModel",t.checkboxChecked),p(),L(t.data.checkboxLabel)}}var vo=class i{dialogRef=f(Hr);data=f(Ur);checkboxChecked=!1;cancel(){this.dialogRef.close({confirmed:!1})}confirm(){this.dialogRef.close({confirmed:!0,checkboxChecked:this.checkboxChecked})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-confirm-dialog"]],decls:10,vars:6,consts:[["mat-dialog-title",""],[1,"confirm-dialog__message"],[1,"confirm-dialog__checkbox",3,"ngModel"],["align","end"],["mat-button","",3,"click"],["mat-flat-button","",3,"click","color"],[1,"confirm-dialog__checkbox",3,"ngModelChange","ngModel"]],template:function(t,n){t&1&&(l(0,"h2",0),u(1),c(),l(2,"p",1),u(3),c(),C(4,$m,2,2,"mat-checkbox",2),l(5,"mat-dialog-actions",3)(6,"button",4),v("click",function(){return n.cancel()}),u(7),c(),l(8,"button",5),v("click",function(){return n.confirm()}),u(9),c()()),t&2&&(p(),L(n.data.title),p(2),L(n.data.message),p(),S(n.data.checkboxLabel?4:-1),p(3),L(n.data.cancelLabel??"Cancel"),p(),T("color",n.data.isDestructive?"warn":"primary"),p(),Ne(" ",n.data.confirmLabel??"Confirm"," "))},dependencies:[qr,Gr,Ge,si,lc,sc,lt,at,st],styles:[".confirm-dialog__message[_ngcontent-%COMP%]{margin:0 24px 8px;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;line-height:1.5}.confirm-dialog__checkbox[_ngcontent-%COMP%]{display:block;margin:0 24px 8px;font-size:.875rem}"]})};var gi=class i{snackBar=f(Hl);success(e,t=2e3){this.snackBar.open(e,"",{duration:t,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-success"]})}error(e,t=3e3){this.snackBar.open(e,"",{duration:t,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-error"]})}info(e,t=2e3){this.snackBar.open(e,"",{duration:t,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-info"]})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Bm=()=>[];function Hm(i,e){if(i&1){let t=O();l(0,"div",3)(1,"ds-entity-card",4),v("selected",function(r){x(t);let o=h();return w(o.onItemSelected(r))}),c(),l(2,"button",5),v("click",function(r){let o=x(t).$implicit,a=h();return r.stopPropagation(),w(a.onDeleteRequested(o.id))}),l(3,"mat-icon"),u(4,"close"),c()()()}if(i&2){let t=e.$implicit;p(),T("id",t.id)("name",t.name)("description",t.description)("badges",t.badges??Or(4,Bm))}}var Zi="__",yo=class i{router=f(zt);projectStateService=f(ye);dialog=f(Wr);destroyRef=f(ri);notification=f(gi);projects=Ie(this.projectStateService.projectList$);forcedProject=Ie(this.projectStateService.forcedProject$,{initialValue:null});projectItems=Tt(()=>{let e=this.projects();if(!e)return[];let t=e.filter(y=>!y.name.includes(Zi)),n=e.filter(y=>y.name.includes(Zi)),r=new Set(t.map(y=>y.name)),o=y=>y.split(Zi)[0]??null,a=new Set(n.map(y=>o(y.name)).filter(y=>y!==null&&r.has(y))),s=[],d=[...a].sort((y,k)=>y.localeCompare(k));for(let y of d){let k=t.find(P=>P.name===y);s.push(he(G({},this.toEntityListItem(k)),{groupKey:y,groupLabel:y}));let E=n.filter(P=>o(P.name)===y).sort((P,K)=>P.name.localeCompare(K.name));for(let P of E){let K=P.name.slice(y.length+Zi.length);s.push(he(G({},this.toEntityListItem(P)),{name:K,description:P.name,groupKey:y,groupLabel:y}))}}let m=[...t].filter(y=>!a.has(y.name)&&!y.volatile).sort((y,k)=>y.name.localeCompare(k.name));for(let y of m)s.push(he(G({},this.toEntityListItem(y)),{groupKey:"__standalone__",groupLabel:"Projects"}));let _=[...t].filter(y=>!a.has(y.name)&&y.volatile).sort((y,k)=>y.name.localeCompare(k.name));for(let y of _)s.push(he(G({},this.toEntityListItem(y)),{groupKey:"__volatile__",groupLabel:"Temporary"}));let b=n.filter(y=>{let k=o(y.name);return k!==null&&!r.has(k)}).sort((y,k)=>y.name.localeCompare(k.name));for(let y of b)s.push(he(G({},this.toEntityListItem(y)),{groupKey:"__orphaned__",groupLabel:"Orphaned worktrees"}));return s});showCreateButton=Tt(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(ot(),ve(e=>!!e),ve(()=>this.router.url.split("?")[0]==="/"),ti(1)).subscribe(e=>{this.router.navigate(["project",e.name])})}onItemSelected(e){this.projectStateService.selectProject(e),this.router.navigate(["project",e])}onCreateRequested(){this.router.navigate(["project","new"])}onDeleteRequested(e){let t=e.includes(Zi);this.dialog.open(vo,{width:"400px",panelClass:"confirm-dialog-panel",data:G({title:"Delete project",message:`This will remove the project "${e}" from Coday and archive its configuration. The project source code on disk is not affected.`,confirmLabel:"Delete",cancelLabel:"Cancel",isDestructive:!0},t?{checkboxLabel:"Also remove git worktree from disk"}:{})}).afterClosed().pipe(ve(r=>r?.confirmed===!0),ot(this.destroyRef)).subscribe(r=>{this.notification.info("Deleting project\u2026"),this.projectStateService.deleteProject(e,r.checkboxChecked).pipe(ot(this.destroyRef)).subscribe({next:()=>{this.notification.success(`Project "${e}" deleted`),this.router.url.includes(`/project/${encodeURIComponent(e)}`)&&this.router.navigate(["/"])},error:o=>{console.error("[PROJECT-LIST] Failed to delete project:",o),this.notification.error(o?.error?.error??"Failed to delete project")}})})}toEntityListItem(e){return{id:e.name,name:e.name,badges:e.volatile?[{label:"temp",variant:"warning"}]:[]}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-project-selection"]],decls:4,vars:4,consts:[["projectCard",""],["title","Projects","contentMaxWidth","1400px","searchPlaceholder","Filter projects\u2026","emptyMessage","No projects found.",3,"itemSelected","createRequested","items","itemTemplate","showCreate","autoFocusSearch"],["toolbar-start","","src","CODAY-Logo.png","alt","Coday",1,"project-list__logo"],[1,"project-card-wrapper"],[3,"selected","id","name","description","badges"],["mat-icon-button","","title","Delete project",1,"project-card-wrapper__delete",3,"click"]],template:function(t,n){if(t&1&&(l(0,"ds-entity-list",1),v("itemSelected",function(o){return n.onItemSelected(o)})("createRequested",function(){return n.onCreateRequested()}),F(1,"img",2),c(),un(2,Hm,5,5,"ng-template",null,0,ai)),t&2){let r=In(3);T("items",n.projectItems())("itemTemplate",r)("showCreate",n.showCreateButton())("autoFocusSearch",!0)}},dependencies:[ac,ic,ke,se,ze],styles:[".project-list__logo[_ngcontent-%COMP%]{height:28px;width:auto}.project-card-wrapper[_ngcontent-%COMP%]{position:relative}.project-card-wrapper__delete[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;width:28px;height:28px;line-height:28px;padding:0;opacity:0;transition:opacity .15s ease;color:var(--color-text-secondary, #6e6e73)}.project-card-wrapper__delete[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.project-card-wrapper__delete[_ngcontent-%COMP%]:hover{color:var(--color-error, #ff3b30)}.project-card-wrapper[_ngcontent-%COMP%]:hover .project-card-wrapper__delete[_ngcontent-%COMP%]{opacity:1}"]})};var Pe=class i{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new W("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new W(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new W(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new W("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new W(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new W(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new W(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new W(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new W(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new W(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new W(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new W(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new W(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new W(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new W("light");theme$=this.themeSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let n=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(n);let r=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(r);let o=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(o);let a=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(a);let s=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(s);let d=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(d);let m=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(m);let _=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(_);let b=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(b);let y=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(y);let k=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(k);let E=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(E);let P=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(P),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return B(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let n=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(n);let r=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(r);let o=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(o);let a=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(a);let s=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(s);let d=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(d);let m=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(m);let _=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(_);let b=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(b);let y=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(y);let k=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(k);let E=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(E);let P=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(P),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let n=localStorage.getItem(this.STORAGE_KEY);if(!n)return t;let r=JSON.parse(n);return r[e]!==void 0?r[e]:t}catch(n){return t}}getPreferenceAsync(e,t){return B(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let n=yield this.electronStorage.get(this.STORAGE_KEY);if(!n)return t;let r=JSON.parse(n);return r[e]!==void 0?r[e]:t}catch(n){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let n=localStorage.getItem(this.STORAGE_KEY),r=n?JSON.parse(n):{};r[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(r)),this.updateSubject(e,t)}catch(n){console.error("Failed to set preference:",n)}}setPreferenceAsync(e,t){return B(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let n=yield this.electronStorage.get(this.STORAGE_KEY),r=n?JSON.parse(n):{};r[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(r)),this.updateSubject(e,t)}catch(n){console.error("Failed to set preference:",n)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};function ls(i,e=80){if(i.length<=e)return i;try{if(i.trim().startsWith("{")||i.trim().startsWith("[")){let t=JSON.parse(i),n=JSON.stringify(t);return n.length<=e?n:n.substring(0,e)+`...(${n.length} chars)`}}catch(t){}return i.substring(0,e)+"..."}var je=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let n=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${n}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},Co=class extends je{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new pt({answer:e,parentKey:this.timestamp,invite:this.invite})}},fi=class i extends je{static type="heartbeat";constructor(e){super(e,i.type)}},an=class i extends Co{defaultValue;static type="invite";constructor(e){super(e,i.type),this.defaultValue=e.defaultValue}},cs="InviteEventDefault",pt=class i extends je{answer;invite;name;static type="answer";constructor(e){super(e,i.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name}},Wt=class i extends je{speaker;text;static type="text";constructor(e){super(e,i.type),this.speaker=e.speaker,this.text=e.text}},vn=class i extends je{chunk;static type="text_chunk";constructor(e){super(e,i.type),this.chunk=e.chunk,this.length=this.chunk.length}},zn=class i extends je{warning;static type="warn";constructor(e){super(e,i.type),this.warning=e.warning}},kt=class i extends je{error;static type="error";constructor(e){super(e,i.type),this.error=e.error}},sn=class i extends Co{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,i.type),this.options=e.options,this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},Pt=class i extends je{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,i.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new yt({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=ls(this.args,e);return`\u{1F527} ${this.name}(${t})`}},yt=class i extends je{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,i.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),n=ls(t,e),r=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${n}${r}`}},yn=class i extends je{static type="thinking";static debounce=5e3;constructor(e){super(e,i.type)}},$n=class i extends je{summary;static type="summary";constructor(e){super(e,i.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${ls(this.summary,e)}`}},Ot=class i extends je{role;name;content;static type="message";constructor(e){super(e,i.type),this.role=e.role,this.name=e.name,this.content=e.content,this.length=this.content.map(t=>{if(t.type==="text")return t.content.length;if(t.type==="image"){let n=(t.width||0)*(t.height||0)/750;return n?n*3.5:t.content.length}return 0}).reduce((t,n)=>t+n,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
1
|
+
import{a as sc,b as lc}from"./chunk-S5LR3GBS.js";import{a as dc,b as pc,c as mc}from"./chunk-5CTKRMM2.js";import{a as cc}from"./chunk-FCCT54AP.js";import{a as Hl,b as Ul}from"./chunk-5UOZGBZ2.js";import{a as Hr,b as Ur,c as Wl,d as Wr,e as qr,f as ql,g as Gr}from"./chunk-NO2ODJHX.js";import{I as nc,J as Qr,K as ic,R as rc,T as oc,U as ac,f as $l,g as li,h as Bl,i as Aa,u as Yl,w as tc}from"./chunk-YDXVLOQW.js";import{a as Yr,b as ye}from"./chunk-3TOJSAQM.js";import{F as Vl,G as $r,I as Dn,L as ze,M as zl,N as $t,P as si,Q as Br,R as Ge,S as se,T as ke,e as Vr,f as Oa,h as Ol,i as Al,j as Il,m as Dl,o as zr,p as Rl,r as Nl,s as Fl,t as Ll,y as jl}from"./chunk-PKKHLHXJ.js";import{B as ec,C as lt,c as _t,g as at,m as st,p as Ql,q as Kl,v as Xl,w as Jl,x as Zl}from"./chunk-2DE3OXG3.js";import{k as Gl}from"./chunk-KYPMYRHP.js";import{a as ot,b as Ie}from"./chunk-VNGIXNER.js";import{a as jr,b as Ml,c as zt,d as kl,e as Pl}from"./chunk-PWN5O4WY.js";import{$ as Mr,$b as yl,A as ve,Aa as Sa,Ab as v,Ac as Fr,Bc as Lr,C as mn,Cb as h,Cc as xl,Db as rn,Dc as Pa,E as sl,Ea as ut,Eb as ht,F as ti,Fa as On,Fb as Ea,Fc as it,G as fa,Ga as hl,Gb as Be,H as _a,Ha as p,Hb as ge,Ia as gl,Ib as fe,Ic as wl,J as ll,Ja as xa,Jc as Tl,L as ba,La as fl,Ma as Pr,Mb as In,N as cl,Nb as Ke,Nc as rt,Ob as Y,Oc as El,P as ni,Pb as Ma,Q as va,Qb as u,Qc as Vt,R as D,Rb as L,Sb as Ne,T as gt,Ta as I,Tb as oi,U as re,Ua as wt,Ub as te,Va as _l,Vb as ne,Wa as bl,Wb as ie,X as H,Xb as vl,Y as xt,Ya as Ui,Yb as fn,Za as un,Zb as Or,_ as Bi,_b as Ar,a as G,aa as f,ac as Wi,b as he,bc as Cl,c as il,ca as dl,cb as wa,cc as ka,d as B,ec as ai,fa as x,g as Er,ga as w,gb as Me,h as J,ha as ya,hc as Tt,i as W,ia as pl,ib as C,ja as Ca,jb as S,ka as ii,kc as Ir,la as ri,m as kn,mb as we,n as ei,na as Z,nb as Te,nc as Sl,oa as Lt,ob as T,oc as Dr,pb as l,pc as Rr,q as ga,qb as c,qc as Nr,r as rl,ra as ml,rb as F,s as Ae,sa as qe,sb as hn,t as Pn,ta as Hi,tb as gn,ua as jt,ub as Ta,va as kr,wa as ft,xa as ul,xb as An,y as ol,yb as O,z as al}from"./chunk-DJBCK5D7.js";var q=(function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i})(q||{}),bt="*";function Ia(i,e){return{type:q.Trigger,name:i,definitions:e,options:{}}}function Kr(i,e=null){return{type:q.Animate,styles:e,timings:i}}function uc(i,e=null){return{type:q.Sequence,steps:i,options:e}}function _n(i){return{type:q.Style,styles:i,offset:null}}function Xr(i,e,t=null){return{type:q.Transition,expr:i,animation:e,options:t}}var Bt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(e=0,t=0){this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},Rn=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(e){this.players=e;let t=0,n=0,r=0,o=this.players.length;o==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++t==o&&this._onFinish()}),a.onDestroy(()=>{++n==o&&this._onDestroy()}),a.onStart(()=>{++r==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,s)=>Math.max(a,s.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let t=e*this.totalTime;this.players.forEach(n=>{let r=n.totalTime?Math.min(1,t/n.totalTime):1;n.setPosition(r)})}getPosition(){let e=this.players.reduce((t,n)=>t===null||n.totalTime>t.totalTime?n:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},ci="!";function hc(i){return new re(3e3,!1)}function zp(){return new re(3100,!1)}function $p(){return new re(3101,!1)}function Bp(i){return new re(3001,!1)}function Hp(i){return new re(3003,!1)}function Up(i){return new re(3004,!1)}function fc(i,e){return new re(3005,!1)}function _c(){return new re(3006,!1)}function bc(){return new re(3007,!1)}function vc(i,e){return new re(3008,!1)}function yc(i){return new re(3002,!1)}function Cc(i,e,t,n,r){return new re(3010,!1)}function Sc(){return new re(3011,!1)}function xc(){return new re(3012,!1)}function wc(){return new re(3200,!1)}function Tc(){return new re(3202,!1)}function Ec(){return new re(3013,!1)}function Mc(i){return new re(3014,!1)}function kc(i){return new re(3015,!1)}function Pc(i){return new re(3016,!1)}function Oc(i,e){return new re(3404,!1)}function Wp(i){return new re(3502,!1)}function Ac(i){return new re(3503,!1)}function Ic(){return new re(3300,!1)}function Dc(i){return new re(3504,!1)}function Rc(i){return new re(3301,!1)}function Nc(i,e){return new re(3302,!1)}function Fc(i){return new re(3303,!1)}function Lc(i,e){return new re(3400,!1)}function jc(i){return new re(3401,!1)}function Vc(i){return new re(3402,!1)}function zc(i,e){return new re(3505,!1)}function on(i){switch(i.length){case 0:return new Bt;case 1:return i[0];default:return new Rn(i)}}function Fa(i,e,t=new Map,n=new Map){let r=[],o=[],a=-1,s=null;if(e.forEach(d=>{let m=d.get("offset"),_=m==a,b=_&&s||new Map;d.forEach((y,k)=>{let E=k,P=y;if(k!=="offset")switch(E=i.normalizePropertyName(E,r),P){case ci:P=t.get(k);break;case bt:P=n.get(k);break;default:P=i.normalizeStyleValue(k,E,P,r);break}b.set(E,P)}),_||o.push(b),s=b,a=m}),r.length)throw Wp(r);return o}function Jr(i,e,t,n){switch(e){case"start":i.onStart(()=>n(t&&Da(t,"start",i)));break;case"done":i.onDone(()=>n(t&&Da(t,"done",i)));break;case"destroy":i.onDestroy(()=>n(t&&Da(t,"destroy",i)));break}}function Da(i,e,t){let n=t.totalTime,r=!!t.disabled,o=Zr(i.element,i.triggerName,i.fromState,i.toState,e||i.phaseName,n??i.totalTime,r),a=i._data;return a!=null&&(o._data=a),o}function Zr(i,e,t,n,r="",o=0,a){return{element:i,triggerName:e,fromState:t,toState:n,phaseName:r,totalTime:o,disabled:!!a}}function ct(i,e,t){let n=i.get(e);return n||i.set(e,n=t),n}function La(i){let e=i.indexOf(":"),t=i.substring(1,e),n=i.slice(e+1);return[t,n]}var qp=typeof document>"u"?null:document.documentElement;function eo(i){let e=i.parentNode||i.host||null;return e===qp?null:e}function Gp(i){return i.substring(1,6)=="ebkit"}var Nn=null,gc=!1;function $c(i){Nn||(Nn=Yp()||{},gc=Nn.style?"WebkitAppearance"in Nn.style:!1);let e=!0;return Nn.style&&!Gp(i)&&(e=i in Nn.style,!e&&gc&&(e="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in Nn.style)),e}function Yp(){return typeof document<"u"?document.body:null}function ja(i,e){for(;e;){if(e===i)return!0;e=eo(e)}return!1}function Va(i,e,t){if(t)return Array.from(i.querySelectorAll(e));let n=i.querySelector(e);return n?[n]:[]}var Qp=1e3,za="{{",Kp="}}",$a="ng-enter",to="ng-leave",qi="ng-trigger",Gi=".ng-trigger",Ba="ng-animating",no=".ng-animating";function Ht(i){if(typeof i=="number")return i;let e=i.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Ra(parseFloat(e[1]),e[2])}function Ra(i,e){return e==="s"?i*Qp:i}function Yi(i,e,t){return i.hasOwnProperty("duration")?i:Jp(i,e,t)}var Xp=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Jp(i,e,t){let n,r=0,o="";if(typeof i=="string"){let a=i.match(Xp);if(a===null)return e.push(hc(i)),{duration:0,delay:0,easing:""};n=Ra(parseFloat(a[1]),a[2]);let s=a[3];s!=null&&(r=Ra(parseFloat(s),a[4]));let d=a[5];d&&(o=d)}else n=i;if(!t){let a=!1,s=e.length;n<0&&(e.push(zp()),a=!0),r<0&&(e.push($p()),a=!0),a&&e.splice(s,0,hc(i))}return{duration:n,delay:r,easing:o}}function Bc(i){return i.length?i[0]instanceof Map?i:i.map(e=>new Map(Object.entries(e))):[]}function Et(i,e,t){e.forEach((n,r)=>{let o=io(r);t&&!t.has(r)&&t.set(r,i.style[o]),i.style[o]=n})}function bn(i,e){e.forEach((t,n)=>{let r=io(n);i.style[r]=""})}function di(i){return Array.isArray(i)?i.length==1?i[0]:uc(i):i}function Hc(i,e,t){let n=e.params||{},r=Ha(i);r.length&&r.forEach(o=>{n.hasOwnProperty(o)||t.push(Bp(o))})}var Na=new RegExp(`${za}\\s*(.+?)\\s*${Kp}`,"g");function Ha(i){let e=[];if(typeof i=="string"){let t;for(;t=Na.exec(i);)e.push(t[1]);Na.lastIndex=0}return e}function pi(i,e,t){let n=`${i}`,r=n.replace(Na,(o,a)=>{let s=e[a];return s==null&&(t.push(Hp(a)),s=""),s.toString()});return r==n?i:r}var Zp=/-+([a-z0-9])/g;function io(i){return i.replace(Zp,(...e)=>e[1].toUpperCase())}function Uc(i,e){return i===0||e===0}function Wc(i,e,t){if(t.size&&e.length){let n=e[0],r=[];if(t.forEach((o,a)=>{n.has(a)||r.push(a),n.set(a,o)}),r.length)for(let o=1;o<e.length;o++){let a=e[o];r.forEach(s=>a.set(s,ro(i,s)))}}return e}function dt(i,e,t){switch(e.type){case q.Trigger:return i.visitTrigger(e,t);case q.State:return i.visitState(e,t);case q.Transition:return i.visitTransition(e,t);case q.Sequence:return i.visitSequence(e,t);case q.Group:return i.visitGroup(e,t);case q.Animate:return i.visitAnimate(e,t);case q.Keyframes:return i.visitKeyframes(e,t);case q.Style:return i.visitStyle(e,t);case q.Reference:return i.visitReference(e,t);case q.AnimateChild:return i.visitAnimateChild(e,t);case q.AnimateRef:return i.visitAnimateRef(e,t);case q.Query:return i.visitQuery(e,t);case q.Stagger:return i.visitStagger(e,t);default:throw Up(e.type)}}function ro(i,e){return window.getComputedStyle(i)[e]}var as=(()=>{class i{validateStyleProperty(t){return $c(t)}containsElement(t,n){return ja(t,n)}getParentElement(t){return eo(t)}query(t,n,r){return Va(t,n,r)}computeStyle(t,n,r){return r||""}animate(t,n,r,o,a,s=[],d){return new Bt(r,o)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=H({token:i,factory:i.\u0275fac})}return i})(),Ln=class{static NOOP=new as},jn=class{};var em=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),co=class extends jn{normalizePropertyName(e,t){return io(e)}normalizeStyleValue(e,t,n,r){let o="",a=n.toString().trim();if(em.has(t)&&n!==0&&n!=="0")if(typeof n=="number")o="px";else{let s=n.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&s[1].length==0&&r.push(fc(e,n))}return a+o}};var po="*";function tm(i,e){let t=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(n=>nm(n,t,e)):t.push(i),t}function nm(i,e,t){if(i[0]==":"){let d=im(i,t);if(typeof d=="function"){e.push(d);return}i=d}let n=i.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return t.push(kc(i)),e;let r=n[1],o=n[2],a=n[3];e.push(qc(r,a));let s=r==po&&a==po;o[0]=="<"&&!s&&e.push(qc(a,r))}function im(i,e){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,n)=>parseFloat(n)>parseFloat(t);case":decrement":return(t,n)=>parseFloat(n)<parseFloat(t);default:return e.push(Pc(i)),"* => *"}}var oo=new Set(["true","1"]),ao=new Set(["false","0"]);function qc(i,e){let t=oo.has(i)||ao.has(i),n=oo.has(e)||ao.has(e);return(r,o)=>{let a=i==po||i==r,s=e==po||e==o;return!a&&t&&typeof r=="boolean"&&(a=r?oo.has(i):ao.has(i)),!s&&n&&typeof o=="boolean"&&(s=o?oo.has(e):ao.has(e)),a&&s}}var nd=":self",rm=new RegExp(`s*${nd}s*,?`,"g");function id(i,e,t,n){return new Qa(i).build(e,t,n)}var Gc="",Qa=class{_driver;constructor(e){this._driver=e}build(e,t,n){let r=new Ka(t);return this._resetContextStyleTimingState(r),dt(this,di(e),r)}_resetContextStyleTimingState(e){e.currentQuerySelector=Gc,e.collectedStyles=new Map,e.collectedStyles.set(Gc,new Map),e.currentTime=0}visitTrigger(e,t){let n=t.queryCount=0,r=t.depCount=0,o=[],a=[];return e.name.charAt(0)=="@"&&t.errors.push(_c()),e.definitions.forEach(s=>{if(this._resetContextStyleTimingState(t),s.type==q.State){let d=s,m=d.name;m.toString().split(/\s*,\s*/).forEach(_=>{d.name=_,o.push(this.visitState(d,t))}),d.name=m}else if(s.type==q.Transition){let d=this.visitTransition(s,t);n+=d.queryCount,r+=d.depCount,a.push(d)}else t.errors.push(bc())}),{type:q.Trigger,name:e.name,states:o,transitions:a,queryCount:n,depCount:r,options:null}}visitState(e,t){let n=this.visitStyle(e.styles,t),r=e.options&&e.options.params||null;if(n.containsDynamicStyles){let o=new Set,a=r||{};n.styles.forEach(s=>{s instanceof Map&&s.forEach(d=>{Ha(d).forEach(m=>{a.hasOwnProperty(m)||o.add(m)})})}),o.size&&t.errors.push(vc(e.name,[...o.values()]))}return{type:q.State,name:e.name,style:n,options:r?{params:r}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let n=dt(this,di(e.animation),t),r=tm(e.expr,t.errors);return{type:q.Transition,matchers:r,animation:n,queryCount:t.queryCount,depCount:t.depCount,options:Fn(e.options)}}visitSequence(e,t){return{type:q.Sequence,steps:e.steps.map(n=>dt(this,n,t)),options:Fn(e.options)}}visitGroup(e,t){let n=t.currentTime,r=0,o=e.steps.map(a=>{t.currentTime=n;let s=dt(this,a,t);return r=Math.max(r,t.currentTime),s});return t.currentTime=r,{type:q.Group,steps:o,options:Fn(e.options)}}visitAnimate(e,t){let n=lm(e.timings,t.errors);t.currentAnimateTimings=n;let r,o=e.styles?e.styles:_n({});if(o.type==q.Keyframes)r=this.visitKeyframes(o,t);else{let a=e.styles,s=!1;if(!a){s=!0;let m={};n.easing&&(m.easing=n.easing),a=_n(m)}t.currentTime+=n.duration+n.delay;let d=this.visitStyle(a,t);d.isEmptyStep=s,r=d}return t.currentAnimateTimings=null,{type:q.Animate,timings:n,style:r,options:null}}visitStyle(e,t){let n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,t){let n=[],r=Array.isArray(e.styles)?e.styles:[e.styles];for(let s of r)typeof s=="string"?s===bt?n.push(s):t.errors.push(yc(s)):n.push(new Map(Object.entries(s)));let o=!1,a=null;return n.forEach(s=>{if(s instanceof Map&&(s.has("easing")&&(a=s.get("easing"),s.delete("easing")),!o)){for(let d of s.values())if(d.toString().indexOf(za)>=0){o=!0;break}}}),{type:q.Style,styles:n,easing:a,offset:e.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(e,t){let n=t.currentAnimateTimings,r=t.currentTime,o=t.currentTime;n&&o>0&&(o-=n.duration+n.delay),e.styles.forEach(a=>{typeof a!="string"&&a.forEach((s,d)=>{let m=t.collectedStyles.get(t.currentQuerySelector),_=m.get(d),b=!0;_&&(o!=r&&o>=_.startTime&&r<=_.endTime&&(t.errors.push(Cc(d,_.startTime,_.endTime,o,r)),b=!1),o=_.startTime),b&&m.set(d,{startTime:o,endTime:r}),t.options&&Hc(s,t.options,t.errors)})})}visitKeyframes(e,t){let n={type:q.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(Sc()),n;let r=1,o=0,a=[],s=!1,d=!1,m=0,_=e.steps.map(pe=>{let N=this._makeStyleAst(pe,t),X=N.offset!=null?N.offset:sm(N.styles),U=0;return X!=null&&(o++,U=N.offset=X),d=d||U<0||U>1,s=s||U<m,m=U,a.push(U),N});d&&t.errors.push(xc()),s&&t.errors.push(wc());let b=e.steps.length,y=0;o>0&&o<b?t.errors.push(Tc()):o==0&&(y=r/(b-1));let k=b-1,E=t.currentTime,P=t.currentAnimateTimings,K=P.duration;return _.forEach((pe,N)=>{let X=y>0?N==k?1:y*N:a[N],U=X*K;t.currentTime=E+P.delay+U,P.duration=U,this._validateStyleAst(pe,t),pe.offset=X,n.styles.push(pe)}),n}visitReference(e,t){return{type:q.Reference,animation:dt(this,di(e.animation),t),options:Fn(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:q.AnimateChild,options:Fn(e.options)}}visitAnimateRef(e,t){return{type:q.AnimateRef,animation:this.visitReference(e.animation,t),options:Fn(e.options)}}visitQuery(e,t){let n=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;let[o,a]=om(e.selector);t.currentQuerySelector=n.length?n+" "+o:o,ct(t.collectedStyles,t.currentQuerySelector,new Map);let s=dt(this,di(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:q.Query,selector:o,limit:r.limit||0,optional:!!r.optional,includeSelf:a,animation:s,originalSelector:e.selector,options:Fn(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(Ec());let n=e.timings==="full"?{duration:0,delay:0,easing:"full"}:Yi(e.timings,t.errors,!0);return{type:q.Stagger,animation:dt(this,di(e.animation),t),timings:n,options:null}}};function om(i){let e=!!i.split(/\s*,\s*/).find(t=>t==nd);return e&&(i=i.replace(rm,"")),i=i.replace(/@\*/g,Gi).replace(/@\w+/g,t=>Gi+"-"+t.slice(1)).replace(/:animating/g,no),[i,e]}function am(i){return i?G({},i):null}var Ka=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function sm(i){if(typeof i=="string")return null;let e=null;if(Array.isArray(i))i.forEach(t=>{if(t instanceof Map&&t.has("offset")){let n=t;e=parseFloat(n.get("offset")),n.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let t=i;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function lm(i,e){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let o=Yi(i,e).duration;return Ua(o,0,"")}let t=i;if(t.split(/\s+/).some(o=>o.charAt(0)=="{"&&o.charAt(1)=="{")){let o=Ua(0,0,"");return o.dynamic=!0,o.strValue=t,o}let r=Yi(t,e);return Ua(r.duration,r.delay,r.easing)}function Fn(i){return i?(i=G({},i),i.params&&(i.params=am(i.params))):i={},i}function Ua(i,e,t){return{duration:i,delay:e,easing:t}}function ss(i,e,t,n,r,o,a=null,s=!1){return{type:1,element:i,keyframes:e,preStyleProps:t,postStyleProps:n,duration:r,delay:o,totalTime:r+o,easing:a,subTimeline:s}}var Ki=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},cm=1,dm=":enter",pm=new RegExp(dm,"g"),mm=":leave",um=new RegExp(mm,"g");function rd(i,e,t,n,r,o=new Map,a=new Map,s,d,m=[]){return new Xa().buildKeyframes(i,e,t,n,r,o,a,s,d,m)}var Xa=class{buildKeyframes(e,t,n,r,o,a,s,d,m,_=[]){m=m||new Ki;let b=new Ja(e,t,m,r,o,_,[]);b.options=d;let y=d.delay?Ht(d.delay):0;b.currentTimeline.delayNextStep(y),b.currentTimeline.setStyles([a],null,b.errors,d),dt(this,n,b);let k=b.timelines.filter(E=>E.containsAnimation());if(k.length&&s.size){let E;for(let P=k.length-1;P>=0;P--){let K=k[P];if(K.element===t){E=K;break}}E&&!E.allowOnlyTimelineStyles()&&E.setStyles([s],null,b.errors,d)}return k.length?k.map(E=>E.buildKeyframes()):[ss(t,[],[],[],0,y,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let n=t.subInstructions.get(t.element);if(n){let r=t.createSubContext(e.options),o=t.currentTimeline.currentTime,a=this._visitSubInstructions(n,r,r.options);o!=a&&t.transformIntoNewTimeline(a)}t.previousNode=e}visitAnimateRef(e,t){let n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,n),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,n){for(let r of e){let o=r?.delay;if(o){let a=typeof o=="number"?o:Ht(pi(o,r?.params??{},t.errors));n.delayNextStep(a)}}}_visitSubInstructions(e,t,n){let o=t.currentTimeline.currentTime,a=n.duration!=null?Ht(n.duration):null,s=n.delay!=null?Ht(n.delay):null;return a!==0&&e.forEach(d=>{let m=t.appendInstructionToTimeline(d,a,s);o=Math.max(o,m.duration+m.delay)}),o}visitReference(e,t){t.updateOptions(e.options,!0),dt(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let n=t.subContextCount,r=t,o=e.options;if(o&&(o.params||o.delay)&&(r=t.createSubContext(o),r.transformIntoNewTimeline(),o.delay!=null)){r.previousNode.type==q.Style&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=mo);let a=Ht(o.delay);r.delayNextStep(a)}e.steps.length&&(e.steps.forEach(a=>dt(this,a,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>n&&r.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let n=[],r=t.currentTimeline.currentTime,o=e.options&&e.options.delay?Ht(e.options.delay):0;e.steps.forEach(a=>{let s=t.createSubContext(e.options);o&&s.delayNextStep(o),dt(this,a,s),r=Math.max(r,s.currentTimeline.currentTime),n.push(s.currentTimeline)}),n.forEach(a=>t.currentTimeline.mergeTimelineCollectedStyles(a)),t.transformIntoNewTimeline(r),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let n=e.strValue,r=t.params?pi(n,t.params,t.errors):n;return Yi(r,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let n=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),r.snapshotCurrentStyles());let o=e.style;o.type==q.Keyframes?this.visitKeyframes(o,t):(t.incrementTime(n.duration),this.visitStyle(o,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let n=t.currentTimeline,r=t.currentAnimateTimings;!r&&n.hasCurrentStyleProperties()&&n.forwardFrame();let o=r&&r.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(o):n.setStyles(e.styles,o,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let n=t.currentAnimateTimings,r=t.currentTimeline.duration,o=n.duration,s=t.createSubContext().currentTimeline;s.easing=n.easing,e.styles.forEach(d=>{let m=d.offset||0;s.forwardTime(m*o),s.setStyles(d.styles,d.easing,t.errors,t.options),s.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(s),t.transformIntoNewTimeline(r+o),t.previousNode=e}visitQuery(e,t){let n=t.currentTimeline.currentTime,r=e.options||{},o=r.delay?Ht(r.delay):0;o&&(t.previousNode.type===q.Style||n==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=mo);let a=n,s=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!r.optional,t.errors);t.currentQueryTotal=s.length;let d=null;s.forEach((m,_)=>{t.currentQueryIndex=_;let b=t.createSubContext(e.options,m);o&&b.delayNextStep(o),m===t.element&&(d=b.currentTimeline),dt(this,e.animation,b),b.currentTimeline.applyStylesToKeyframe();let y=b.currentTimeline.currentTime;a=Math.max(a,y)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(a),d&&(t.currentTimeline.mergeTimelineCollectedStyles(d),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let n=t.parentContext,r=t.currentTimeline,o=e.timings,a=Math.abs(o.duration),s=a*(t.currentQueryTotal-1),d=a*t.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":d=s-d;break;case"full":d=n.currentStaggerTime;break}let _=t.currentTimeline;d&&_.delayNextStep(d);let b=_.currentTime;dt(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=r.currentTime-b+(r.startTime-n.currentTimeline.startTime)}},mo={},Ja=class i{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=mo;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,n,r,o,a,s,d){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=o,this.errors=a,this.timelines=s,this.currentTimeline=d||new uo(this._driver,t,0),s.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let n=e,r=this.options;n.duration!=null&&(r.duration=Ht(n.duration)),n.delay!=null&&(r.delay=Ht(n.delay));let o=n.params;if(o){let a=r.params;a||(a=this.options.params={}),Object.keys(o).forEach(s=>{(!t||!a.hasOwnProperty(s))&&(a[s]=pi(o[s],a,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let n=e.params={};Object.keys(t).forEach(r=>{n[r]=t[r]})}}return e}createSubContext(e=null,t,n){let r=t||this.element,o=new i(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,n||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(e),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(e){return this.previousNode=mo,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){let r={duration:t??e.duration,delay:this.currentTimeline.currentTime+(n??0)+e.delay,easing:""},o=new Za(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(o),r}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,n,r,o,a){let s=[];if(r&&s.push(this.element),e.length>0){e=e.replace(pm,"."+this._enterClassName),e=e.replace(um,"."+this._leaveClassName);let d=n!=1,m=this._driver.query(this.element,e,d);n!==0&&(m=n<0?m.slice(m.length+n,m.length):m.slice(0,n)),s.push(...m)}return!o&&s.length==0&&a.push(Mc(t)),s}},uo=class i{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,n,r){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=r,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new i(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=cm,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,n]of this._globalTimelineStyles)this._backFill.set(t,n||bt),this._currentKeyframe.set(t,bt);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,n,r){t&&this._previousKeyframe.set("easing",t);let o=r&&r.params||{},a=hm(e,this._globalTimelineStyles);for(let[s,d]of a){let m=pi(d,o,n);this._pendingStyles.set(s,m),this._localTimelineStyles.has(s)||this._backFill.set(s,this._globalTimelineStyles.get(s)??bt),this._updateStyle(s,m)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,n)=>{let r=this._styleSummary.get(n);(!r||t.time>r.time)&&this._updateStyle(n,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,n=this._keyframes.size===1&&this.duration===0,r=[];this._keyframes.forEach((s,d)=>{let m=new Map([...this._backFill,...s]);m.forEach((_,b)=>{_===ci?e.add(b):_===bt&&t.add(b)}),n||m.set("offset",d/this.duration),r.push(m)});let o=[...e.values()],a=[...t.values()];if(n){let s=r[0],d=new Map(s);s.set("offset",0),d.set("offset",1),r=[s,d]}return ss(this.element,r,o,a,this.duration,this.startTime,this.easing,!1)}},Za=class extends uo{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,n,r,o,a,s=!1){super(e,t,a.delay),this.keyframes=n,this.preStyleProps=r,this.postStyleProps=o,this._stretchStartingKeyframe=s,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:n,easing:r}=this.timings;if(this._stretchStartingKeyframe&&t){let o=[],a=n+t,s=t/a,d=new Map(e[0]);d.set("offset",0),o.push(d);let m=new Map(e[0]);m.set("offset",Yc(s)),o.push(m);let _=e.length-1;for(let b=1;b<=_;b++){let y=new Map(e[b]),k=y.get("offset"),E=t+k*n;y.set("offset",Yc(E/a)),o.push(y)}n=a,t=0,r="",e=o}return ss(this.element,e,this.preStyleProps,this.postStyleProps,n,t,r,!0)}};function Yc(i,e=3){let t=Math.pow(10,e-1);return Math.round(i*t)/t}function hm(i,e){let t=new Map,n;return i.forEach(r=>{if(r==="*"){n??=e.keys();for(let o of n)t.set(o,bt)}else for(let[o,a]of r)t.set(o,a)}),t}function Qc(i,e,t,n,r,o,a,s,d,m,_,b,y){return{type:0,element:i,triggerName:e,isRemovalTransition:r,fromState:t,fromStyles:o,toState:n,toStyles:a,timelines:s,queriedElements:d,preStyleProps:m,postStyleProps:_,totalTime:b,errors:y}}var Wa={},ho=class{_triggerName;ast;_stateStyles;constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,r){return gm(this.ast.matchers,e,t,n,r)}buildStyles(e,t,n){let r=this._stateStyles.get("*");return e!==void 0&&(r=this._stateStyles.get(e?.toString())||r),r?r.buildStyles(t,n):new Map}build(e,t,n,r,o,a,s,d,m,_){let b=[],y=this.ast.options&&this.ast.options.params||Wa,k=s&&s.params||Wa,E=this.buildStyles(n,k,b),P=d&&d.params||Wa,K=this.buildStyles(r,P,b),pe=new Set,N=new Map,X=new Map,U=r==="void",Ee={params:od(P,y),delay:this.ast.options?.delay},de=_?[]:rd(e,t,this.ast.animation,o,a,E,K,Ee,m,b),xe=0;return de.forEach(He=>{xe=Math.max(He.duration+He.delay,xe)}),b.length?Qc(t,this._triggerName,n,r,U,E,K,[],[],N,X,xe,b):(de.forEach(He=>{let Zt=He.element,dn=ct(N,Zt,new Set);He.preStyleProps.forEach(St=>dn.add(St));let Ve=ct(X,Zt,new Set);He.postStyleProps.forEach(St=>Ve.add(St)),Zt!==t&&pe.add(Zt)}),Qc(t,this._triggerName,n,r,U,E,K,de,[...pe.values()],N,X,xe))}};function gm(i,e,t,n,r){return i.some(o=>o(e,t,n,r))}function od(i,e){let t=G({},e);return Object.entries(i).forEach(([n,r])=>{r!=null&&(t[n]=r)}),t}var es=class{styles;defaultParams;normalizer;constructor(e,t,n){this.styles=e,this.defaultParams=t,this.normalizer=n}buildStyles(e,t){let n=new Map,r=od(e,this.defaultParams);return this.styles.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,s)=>{a&&(a=pi(a,r,t));let d=this.normalizer.normalizePropertyName(s,t);a=this.normalizer.normalizeStyleValue(s,d,a,t),n.set(s,a)})}),n}};function fm(i,e,t){return new ts(i,e,t)}var ts=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,n){this.name=e,this.ast=t,this._normalizer=n,t.states.forEach(r=>{let o=r.options&&r.options.params||{};this.states.set(r.name,new es(r.style,o,n))}),Kc(this.states,"true","1"),Kc(this.states,"false","0"),t.transitions.forEach(r=>{this.transitionFactories.push(new ho(e,r,this.states))}),this.fallbackTransition=_m(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,r){return this.transitionFactories.find(a=>a.match(e,t,n,r))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}};function _m(i,e,t){let n=[(a,s)=>!0],r={type:q.Sequence,steps:[],options:null},o={type:q.Transition,animation:r,matchers:n,options:null,queryCount:0,depCount:0};return new ho(i,o,e)}function Kc(i,e,t){i.has(e)?i.has(t)||i.set(t,i.get(e)):i.has(t)&&i.set(e,i.get(t))}var bm=new Ki,ns=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n}register(e,t){let n=[],r=[],o=id(this._driver,t,n,r);if(n.length)throw Ac(n);this._animations.set(e,o)}_buildPlayer(e,t,n){let r=e.element,o=Fa(this._normalizer,e.keyframes,t,n);return this._driver.animate(r,o,e.duration,e.delay,e.easing,[],!0)}create(e,t,n={}){let r=[],o=this._animations.get(e),a,s=new Map;if(o?(a=rd(this._driver,t,o,$a,to,new Map,new Map,n,bm,r),a.forEach(_=>{let b=ct(s,_.element,new Map);_.postStyleProps.forEach(y=>b.set(y,null))})):(r.push(Ic()),a=[]),r.length)throw Dc(r);s.forEach((_,b)=>{_.forEach((y,k)=>{_.set(k,this._driver.computeStyle(b,k,bt))})});let d=a.map(_=>{let b=s.get(_.element);return this._buildPlayer(_,new Map,b)}),m=on(d);return this._playersById.set(e,m),m.onDestroy(()=>this.destroy(e)),this.players.push(m),m}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Rc(e);return t}listen(e,t,n,r){let o=Zr(t,"","","");return Jr(this._getPlayer(e),n,o,r),()=>{}}command(e,t,n,r){if(n=="register"){this.register(e,r[0]);return}if(n=="create"){let a=r[0]||{};this.create(e,t,a);return}let o=this._getPlayer(e);switch(n){case"play":o.play();break;case"pause":o.pause();break;case"reset":o.reset();break;case"restart":o.restart();break;case"finish":o.finish();break;case"init":o.init();break;case"setPosition":o.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e);break}}},Xc="ng-animate-queued",vm=".ng-animate-queued",qa="ng-animate-disabled",ym=".ng-animate-disabled",Cm="ng-star-inserted",Sm=".ng-star-inserted",xm=[],ad={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},wm={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Mt="__ng_removed",Xi=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let n=e&&e.hasOwnProperty("value"),r=n?e.value:e;if(this.value=Em(r),n){let o=e,{value:a}=o,s=il(o,["value"]);this.options=s}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let n=this.options.params;Object.keys(t).forEach(r=>{n[r]==null&&(n[r]=t[r])})}}},Qi="void",Ga=new Xi(Qi),is=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this._hostClassName="ng-tns-"+e,vt(t,this._hostClassName)}listen(e,t,n,r){if(!this._triggers.has(t))throw Nc(n,t);if(n==null||n.length==0)throw Fc(t);if(!Mm(n))throw Lc(n,t);let o=ct(this._elementListeners,e,[]),a={name:t,phase:n,callback:r};o.push(a);let s=ct(this._engine.statesByElement,e,new Map);return s.has(t)||(vt(e,qi),vt(e,qi+"-"+t),s.set(t,Ga)),()=>{this._engine.afterFlush(()=>{let d=o.indexOf(a);d>=0&&o.splice(d,1),this._triggers.has(t)||s.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw jc(e);return t}trigger(e,t,n,r=!0){let o=this._getTrigger(t),a=new Ji(this.id,t,e),s=this._engine.statesByElement.get(e);s||(vt(e,qi),vt(e,qi+"-"+t),this._engine.statesByElement.set(e,s=new Map));let d=s.get(t),m=new Xi(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&d&&m.absorbOptions(d.options),s.set(t,m),d||(d=Ga),!(m.value===Qi)&&d.value===m.value){if(!Om(d.params,m.params)){let P=[],K=o.matchStyles(d.value,d.params,P),pe=o.matchStyles(m.value,m.params,P);P.length?this._engine.reportError(P):this._engine.afterFlush(()=>{bn(e,K),Et(e,pe)})}return}let y=ct(this._engine.playersByElement,e,[]);y.forEach(P=>{P.namespaceId==this.id&&P.triggerName==t&&P.queued&&P.destroy()});let k=o.matchTransition(d.value,m.value,e,m.params),E=!1;if(!k){if(!r)return;k=o.fallbackTransition,E=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:k,fromState:d,toState:m,player:a,isFallbackTransition:E}),E||(vt(e,Xc),a.onStart(()=>{mi(e,Xc)})),a.onDone(()=>{let P=this.players.indexOf(a);P>=0&&this.players.splice(P,1);let K=this._engine.playersByElement.get(e);if(K){let pe=K.indexOf(a);pe>=0&&K.splice(pe,1)}}),this.players.push(a),y.push(a),a}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,n)=>{this._elementListeners.set(n,t.filter(r=>r.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(n=>n.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let n=this._engine.driver.query(e,Gi,!0);n.forEach(r=>{if(r[Mt])return;let o=this._engine.fetchNamespacesByElement(r);o.size?o.forEach(a=>a.triggerLeaveAnimation(r,t,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(e,t,n,r){let o=this._engine.statesByElement.get(e),a=new Map;if(o){let s=[];if(o.forEach((d,m)=>{if(a.set(m,d.value),this._triggers.has(m)){let _=this.trigger(e,m,Qi,r);_&&s.push(_)}}),s.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,a),n&&on(s).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),n=this._engine.statesByElement.get(e);if(t&&n){let r=new Set;t.forEach(o=>{let a=o.name;if(r.has(a))return;r.add(a);let d=this._triggers.get(a).fallbackTransition,m=n.get(a)||Ga,_=new Xi(Qi),b=new Ji(this.id,a,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:a,transition:d,fromState:m,toState:_,player:b,isFallbackTransition:!0})})}}removeNode(e,t){let n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let r=!1;if(n.totalAnimations){let o=n.players.length?n.playersByQueriedElement.get(e):[];if(o&&o.length)r=!0;else{let a=e;for(;a=a.parentNode;)if(n.statesByElement.get(a)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(e),r)n.markElementAsRemoved(this.id,e,!1,t);else{let o=e[Mt];(!o||o===ad)&&(n.afterFlush(()=>this.clearElementCache(e)),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){vt(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(n=>{let r=n.player;if(r.destroyed)return;let o=n.element,a=this._elementListeners.get(o);a&&a.forEach(s=>{if(s.name==n.triggerName){let d=Zr(o,n.triggerName,n.fromState.value,n.toState.value);d._data=e,Jr(n.player,s.phase,d,s.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):t.push(n)}),this._queue=[],t.sort((n,r)=>{let o=n.transition.ast.depCount,a=r.transition.ast.depCount;return o==0||a==0?o-a:this._engine.driver.containsElement(n.element,r.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},rs=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(n=>{n.queued&&e.push(n)})}),e}createNamespace(e,t){let n=new is(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){let n=this._namespaceList,r=this.namespacesByHostElement;if(n.length-1>=0){let a=!1,s=this.driver.getParentElement(t);for(;s;){let d=r.get(s);if(d){let m=n.indexOf(d);n.splice(m+1,0,e),a=!0;break}s=this.driver.getParentElement(s)}a||n.unshift(e)}else n.push(e);return r.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let r=this._namespaceLookup[e];r&&r.register(t,n)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(e);this.namespacesByHostElement.delete(n.hostElement);let r=this._namespaceList.indexOf(n);r>=0&&this._namespaceList.splice(r,1),n.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,n=this.statesByElement.get(e);if(n){for(let r of n.values())if(r.namespaceId){let o=this._fetchNamespace(r.namespaceId);o&&t.add(o)}}return t}trigger(e,t,n,r){if(so(t)){let o=this._fetchNamespace(e);if(o)return o.trigger(t,n,r),!0}return!1}insertNode(e,t,n,r){if(!so(t))return;let o=t[Mt];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;let a=this.collectedLeaveElements.indexOf(t);a>=0&&this.collectedLeaveElements.splice(a,1)}if(e){let a=this._fetchNamespace(e);a&&a.insertNode(t,n)}r&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),vt(e,qa)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),mi(e,qa))}removeNode(e,t,n){if(so(t)){let r=e?this._fetchNamespace(e):null;r?r.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n);let o=this.namespacesByHostElement.get(t);o&&o.id!==e&&o.removeNode(t,n)}else this._onRemovalComplete(t,n)}markElementAsRemoved(e,t,n,r,o){this.collectedLeaveElements.push(t),t[Mt]={namespaceId:e,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:o}}listen(e,t,n,r,o){return so(t)?this._fetchNamespace(e).listen(t,n,r,o):()=>{}}_buildInstruction(e,t,n,r,o){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,r,e.fromState.options,e.toState.options,t,o)}destroyInnerAnimations(e){let t=this.driver.query(e,Gi,!0);t.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,no,!0),t.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return on(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[Mt];if(t&&t.setForRemoval){if(e[Mt]=ad,t.namespaceId){this.destroyInnerAnimations(e);let n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(qa)&&this.markElementAsDisabled(e,!1),this.driver.query(e,ym,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,r)=>this._balanceNamespaceList(n,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;n<this.collectedEnterElements.length;n++){let r=this.collectedEnterElements[n];vt(r,Cm)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let n=[];try{t=this._flushAnimations(n,e)}finally{for(let r=0;r<n.length;r++)n[r]()}}else for(let n=0;n<this.collectedLeaveElements.length;n++){let r=this.collectedLeaveElements[n];this.processLeaveNode(r)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(n=>n()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],t.length?on(t).onDone(()=>{n.forEach(r=>r())}):n.forEach(r=>r())}}reportError(e){throw Vc(e)}_flushAnimations(e,t){let n=new Ki,r=[],o=new Map,a=[],s=new Map,d=new Map,m=new Map,_=new Set;this.disabledNodes.forEach(A=>{_.add(A);let j=this.driver.query(A,vm,!0);for(let $=0;$<j.length;$++)_.add(j[$])});let b=this.bodyNode,y=Array.from(this.statesByElement.keys()),k=ed(y,this.collectedEnterElements),E=new Map,P=0;k.forEach((A,j)=>{let $=$a+P++;E.set(j,$),A.forEach(ee=>vt(ee,$))});let K=[],pe=new Set,N=new Set;for(let A=0;A<this.collectedLeaveElements.length;A++){let j=this.collectedLeaveElements[A],$=j[Mt];$&&$.setForRemoval&&(K.push(j),pe.add(j),$.hasAnimation?this.driver.query(j,Sm,!0).forEach(ee=>pe.add(ee)):N.add(j))}let X=new Map,U=ed(y,Array.from(pe));U.forEach((A,j)=>{let $=to+P++;X.set(j,$),A.forEach(ee=>vt(ee,$))}),e.push(()=>{k.forEach((A,j)=>{let $=E.get(j);A.forEach(ee=>mi(ee,$))}),U.forEach((A,j)=>{let $=X.get(j);A.forEach(ee=>mi(ee,$))}),K.forEach(A=>{this.processLeaveNode(A)})});let Ee=[],de=[];for(let A=this._namespaceList.length-1;A>=0;A--)this._namespaceList[A].drainQueuedTransitions(t).forEach($=>{let ee=$.player,Oe=$.element;if(Ee.push(ee),this.collectedEnterElements.length){let De=Oe[Mt];if(De&&De.setForMove){if(De.previousTriggersValues&&De.previousTriggersValues.has($.triggerName)){let tt=De.previousTriggersValues.get($.triggerName),Qe=this.statesByElement.get($.element);if(Qe&&Qe.has($.triggerName)){let pn=Qe.get($.triggerName);pn.value=tt,Qe.set($.triggerName,pn)}}ee.destroy();return}}let ce=!b||!this.driver.containsElement(b,Oe),Ue=X.get(Oe),me=E.get(Oe),ue=this._buildInstruction($,n,me,Ue,ce);if(ue.errors&&ue.errors.length){de.push(ue);return}if(ce){ee.onStart(()=>bn(Oe,ue.fromStyles)),ee.onDestroy(()=>Et(Oe,ue.toStyles)),r.push(ee);return}if($.isFallbackTransition){ee.onStart(()=>bn(Oe,ue.fromStyles)),ee.onDestroy(()=>Et(Oe,ue.toStyles)),r.push(ee);return}let _e=[];ue.timelines.forEach(De=>{De.stretchStartingKeyframe=!0,this.disabledNodes.has(De.element)||_e.push(De)}),ue.timelines=_e,n.append(Oe,ue.timelines);let Tn={instruction:ue,player:ee,element:Oe};a.push(Tn),ue.queriedElements.forEach(De=>ct(s,De,[]).push(ee)),ue.preStyleProps.forEach((De,tt)=>{if(De.size){let Qe=d.get(tt);Qe||d.set(tt,Qe=new Set),De.forEach((pn,Gn)=>Qe.add(Gn))}}),ue.postStyleProps.forEach((De,tt)=>{let Qe=m.get(tt);Qe||m.set(tt,Qe=new Set),De.forEach((pn,Gn)=>Qe.add(Gn))})});if(de.length){let A=[];de.forEach(j=>{A.push(zc(j.triggerName,j.errors))}),Ee.forEach(j=>j.destroy()),this.reportError(A)}let xe=new Map,He=new Map;a.forEach(A=>{let j=A.element;n.has(j)&&(He.set(j,j),this._beforeAnimationBuild(A.player.namespaceId,A.instruction,xe))}),r.forEach(A=>{let j=A.element;this._getPreviousPlayers(j,!1,A.namespaceId,A.triggerName,null).forEach(ee=>{ct(xe,j,[]).push(ee),ee.destroy()})});let Zt=K.filter(A=>td(A,d,m)),dn=new Map;Zc(dn,this.driver,N,m,bt).forEach(A=>{td(A,d,m)&&Zt.push(A)});let St=new Map;k.forEach((A,j)=>{Zc(St,this.driver,new Set(A),d,ci)}),Zt.forEach(A=>{let j=dn.get(A),$=St.get(A);dn.set(A,new Map([...j?.entries()??[],...$?.entries()??[]]))});let wn=[],qn=[],br={};a.forEach(A=>{let{element:j,player:$,instruction:ee}=A;if(n.has(j)){if(_.has(j)){$.onDestroy(()=>Et(j,ee.toStyles)),$.disabled=!0,$.overrideTotalTime(ee.totalTime),r.push($);return}let Oe=br;if(He.size>1){let Ue=j,me=[];for(;Ue=Ue.parentNode;){let ue=He.get(Ue);if(ue){Oe=ue;break}me.push(Ue)}me.forEach(ue=>He.set(ue,Oe))}let ce=this._buildAnimation($.namespaceId,ee,xe,o,St,dn);if($.setRealPlayer(ce),Oe===br)wn.push($);else{let Ue=this.playersByElement.get(Oe);Ue&&Ue.length&&($.parentPlayer=on(Ue)),r.push($)}}else bn(j,ee.fromStyles),$.onDestroy(()=>Et(j,ee.toStyles)),qn.push($),_.has(j)&&r.push($)}),qn.forEach(A=>{let j=o.get(A.element);if(j&&j.length){let $=on(j);A.setRealPlayer($)}}),r.forEach(A=>{A.parentPlayer?A.syncPlayerEvents(A.parentPlayer):A.destroy()});for(let A=0;A<K.length;A++){let j=K[A],$=j[Mt];if(mi(j,to),$&&$.hasAnimation)continue;let ee=[];if(s.size){let ce=s.get(j);ce&&ce.length&&ee.push(...ce);let Ue=this.driver.query(j,no,!0);for(let me=0;me<Ue.length;me++){let ue=s.get(Ue[me]);ue&&ue.length&&ee.push(...ue)}}let Oe=ee.filter(ce=>!ce.destroyed);Oe.length?km(this,j,Oe):this.processLeaveNode(j)}return K.length=0,wn.forEach(A=>{this.players.push(A),A.onDone(()=>{A.destroy();let j=this.players.indexOf(A);this.players.splice(j,1)}),A.play()}),wn}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,r,o){let a=[];if(t){let s=this.playersByQueriedElement.get(e);s&&(a=s)}else{let s=this.playersByElement.get(e);if(s){let d=!o||o==Qi;s.forEach(m=>{m.queued||!d&&m.triggerName!=r||a.push(m)})}}return(n||r)&&(a=a.filter(s=>!(n&&n!=s.namespaceId||r&&r!=s.triggerName))),a}_beforeAnimationBuild(e,t,n){let r=t.triggerName,o=t.element,a=t.isRemovalTransition?void 0:e,s=t.isRemovalTransition?void 0:r;for(let d of t.timelines){let m=d.element,_=m!==o,b=ct(n,m,[]);this._getPreviousPlayers(m,_,a,s,t.toState).forEach(k=>{let E=k.getRealPlayer();E.beforeDestroy&&E.beforeDestroy(),k.destroy(),b.push(k)})}bn(o,t.fromStyles)}_buildAnimation(e,t,n,r,o,a){let s=t.triggerName,d=t.element,m=[],_=new Set,b=new Set,y=t.timelines.map(E=>{let P=E.element;_.add(P);let K=P[Mt];if(K&&K.removedBeforeQueried)return new Bt(E.duration,E.delay);let pe=P!==d,N=Pm((n.get(P)||xm).map(xe=>xe.getRealPlayer())).filter(xe=>{let He=xe;return He.element?He.element===P:!1}),X=o.get(P),U=a.get(P),Ee=Fa(this._normalizer,E.keyframes,X,U),de=this._buildPlayer(E,Ee,N);if(E.subTimeline&&r&&b.add(P),pe){let xe=new Ji(e,s,P);xe.setRealPlayer(de),m.push(xe)}return de});m.forEach(E=>{ct(this.playersByQueriedElement,E.element,[]).push(E),E.onDone(()=>Tm(this.playersByQueriedElement,E.element,E))}),_.forEach(E=>vt(E,Ba));let k=on(y);return k.onDestroy(()=>{_.forEach(E=>mi(E,Ba)),Et(d,t.toStyles)}),b.forEach(E=>{ct(r,E,[]).push(k)}),k}_buildPlayer(e,t,n){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new Bt(e.duration,e.delay)}},Ji=class{namespaceId;triggerName;element;_player=new Bt;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,n)=>{t.forEach(r=>Jr(e,n,void 0,r))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){ct(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function Tm(i,e,t){let n=i.get(e);if(n){if(n.length){let r=n.indexOf(t);n.splice(r,1)}n.length==0&&i.delete(e)}return n}function Em(i){return i??null}function so(i){return i&&i.nodeType===1}function Mm(i){return i=="start"||i=="done"}function Jc(i,e){let t=i.style.display;return i.style.display=e??"none",t}function Zc(i,e,t,n,r){let o=[];t.forEach(d=>o.push(Jc(d)));let a=[];n.forEach((d,m)=>{let _=new Map;d.forEach(b=>{let y=e.computeStyle(m,b,r);_.set(b,y),(!y||y.length==0)&&(m[Mt]=wm,a.push(m))}),i.set(m,_)});let s=0;return t.forEach(d=>Jc(d,o[s++])),a}function ed(i,e){let t=new Map;if(i.forEach(s=>t.set(s,[])),e.length==0)return t;let n=1,r=new Set(e),o=new Map;function a(s){if(!s)return n;let d=o.get(s);if(d)return d;let m=s.parentNode;return t.has(m)?d=m:r.has(m)?d=n:d=a(m),o.set(s,d),d}return e.forEach(s=>{let d=a(s);d!==n&&t.get(d).push(s)}),t}function vt(i,e){i.classList?.add(e)}function mi(i,e){i.classList?.remove(e)}function km(i,e,t){on(t).onDone(()=>i.processLeaveNode(e))}function Pm(i){let e=[];return sd(i,e),e}function sd(i,e){for(let t=0;t<i.length;t++){let n=i[t];n instanceof Rn?sd(n.players,e):e.push(n)}}function Om(i,e){let t=Object.keys(i),n=Object.keys(e);if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let o=t[r];if(!e.hasOwnProperty(o)||i[o]!==e[o])return!1}return!0}function td(i,e,t){let n=t.get(i);if(!n)return!1;let r=e.get(i);return r?n.forEach(o=>r.add(o)):e.set(i,n),t.delete(i),!0}var ui=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,n){this._driver=t,this._normalizer=n,this._transitionEngine=new rs(e.body,t,n),this._timelineEngine=new ns(e.body,t,n),this._transitionEngine.onRemovalComplete=(r,o)=>this.onRemovalComplete(r,o)}registerTrigger(e,t,n,r,o){let a=e+"-"+r,s=this._triggerCache[a];if(!s){let d=[],m=[],_=id(this._driver,o,d,m);if(d.length)throw Oc(r,d);s=fm(r,_,this._normalizer),this._triggerCache[a]=s}this._transitionEngine.registerTrigger(t,r,s)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,n,r){this._transitionEngine.insertNode(e,t,n,r)}onRemove(e,t,n){this._transitionEngine.removeNode(e,t,n)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,n,r){if(n.charAt(0)=="@"){let[o,a]=La(n),s=r;this._timelineEngine.command(o,t,a,s)}else this._transitionEngine.trigger(e,t,n,r)}listen(e,t,n,r,o){if(n.charAt(0)=="@"){let[a,s]=La(n);return this._timelineEngine.listen(a,t,s,o)}return this._transitionEngine.listen(e,t,n,r,o)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function Am(i,e){let t=null,n=null;return Array.isArray(e)&&e.length?(t=Ya(e[0]),e.length>1&&(n=Ya(e[e.length-1]))):e instanceof Map&&(t=Ya(e)),t||n?new Im(i,t,n):null}var Im=(()=>{class i{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,n,r){this._element=t,this._startStyles=n,this._endStyles=r;let o=i.initialStylesByElement.get(t);o||i.initialStylesByElement.set(t,o=new Map),this._initialStyles=o}start(){this._state<1&&(this._startStyles&&Et(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Et(this._element,this._initialStyles),this._endStyles&&(Et(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(i.initialStylesByElement.delete(this._element),this._startStyles&&(bn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(bn(this._element,this._endStyles),this._endStyles=null),Et(this._element,this._initialStyles),this._state=3)}}return i})();function Ya(i){let e=null;return i.forEach((t,n)=>{Dm(n)&&(e=e||new Map,e.set(n,t))}),e}function Dm(i){return i==="display"||i==="position"}var go=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,n,r){this.element=e,this.keyframes=t,this.options=n,this._specialStyles=r,this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let e=this.keyframes,t=this._triggerWebAnimation(this.element,e,this.options);if(!t)return this._onFinish(),null;this.domPlayer=t,this._finalKeyframe=e.length?e[e.length-1]:new Map;let n=()=>this._onFinish();return t.addEventListener("finish",n),this.onDestroy(()=>{t.removeEventListener("finish",n)}),t}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(n=>{t.push(Object.fromEntries(n))}),t}_triggerWebAnimation(e,t,n){let r=this._convertKeyframesToObject(t);try{return e.animate(r,n)}catch(o){return null}}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){let e=this._buildPlayer();e&&(this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),e.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=e*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((n,r)=>{r!=="offset"&&e.set(r,this._finished?n:ro(this.element,r))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},fo=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return ja(e,t)}getParentElement(e){return eo(e)}query(e,t,n){return Va(e,t,n)}computeStyle(e,t,n){return ro(e,t)}animate(e,t,n,r,o,a=[]){let s=r==0?"both":"forwards",d={duration:n,delay:r,fill:s};o&&(d.easing=o);let m=new Map,_=a.filter(k=>k instanceof go);Uc(n,r)&&_.forEach(k=>{k.currentSnapshot.forEach((E,P)=>m.set(P,E))});let b=Bc(t).map(k=>new Map(k));b=Wc(e,b,m);let y=Am(e,b);return new go(e,b,d,y)}};var lo="@",ld="@.disabled",_o=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,n,r){this.namespaceId=e,this.delegate=t,this.engine=n,this._onDestroy=r}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,n,r=!0){this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,r)}removeChild(e,t,n,r){if(r){this.delegate.removeChild(e,t,n,r);return}this.parentNode(t)&&this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,n,r){this.delegate.setAttribute(e,t,n,r)}removeAttribute(e,t,n){this.delegate.removeAttribute(e,t,n)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,n,r){this.delegate.setStyle(e,t,n,r)}removeStyle(e,t,n){this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){t.charAt(0)==lo&&t==ld?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,n,r){return this.delegate.listen(e,t,n,r)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},os=class extends _o{factory;constructor(e,t,n,r,o){super(t,n,r,o),this.factory=e,this.namespaceId=t}setProperty(e,t,n){t.charAt(0)==lo?t.charAt(1)=="."&&t==ld?(n=n===void 0?!0:!!n,this.disableAnimations(e,n)):this.engine.process(this.namespaceId,e,t.slice(1),n):this.delegate.setProperty(e,t,n)}listen(e,t,n,r){if(t.charAt(0)==lo){let o=Rm(e),a=t.slice(1),s="";return a.charAt(0)!=lo&&([a,s]=Nm(a)),this.engine.listen(this.namespaceId,o,a,s,d=>{let m=d._data||-1;this.factory.scheduleListenerCallback(m,n,d)})}return this.delegate.listen(e,t,n,r)}};function Rm(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function Nm(i){let e=i.indexOf("."),t=i.substring(0,e),n=i.slice(e+1);return[t,n]}var bo=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,n){this.delegate=e,this.engine=t,this._zone=n,t.onRemovalComplete=(r,o)=>{o?.removeChild(null,r)}}createRenderer(e,t){let r=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let m=this._rendererCache,_=m.get(r);if(!_){let b=()=>m.delete(r);_=new _o("",r,this.engine,b),m.set(r,_)}return _}let o=t.id,a=t.id+"-"+this._currentId;this._currentId++,this.engine.register(a,e);let s=m=>{Array.isArray(m)?m.forEach(s):this.engine.registerTrigger(o,a,e,m.name,m)};return t.data.animation.forEach(s),new os(this,a,r,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,n){if(e>=0&&e<this._microtaskId){this._zone.run(()=>t(n));return}let r=this._animationCallbacksBuffer;r.length==0&&queueMicrotask(()=>{this._zone.run(()=>{r.forEach(o=>{let[a,s]=o;a(s)}),this._animationCallbacksBuffer=[]})}),r.push([t,n])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(e){this.engine.flush(),this.delegate.componentReplaced?.(e)}};var Lm=(()=>{class i extends ui{constructor(t,n,r){super(t,n,r)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||i)(Mr(ii),Mr(Ln),Mr(jn))};static \u0275prov=H({token:i,factory:i.\u0275fac})}return i})();function jm(){return new co}function Vm(){return new bo(f(wl),f(ui),f(Lt))}var cd=[{provide:jn,useFactory:jm},{provide:ui,useClass:Lm},{provide:fl,useFactory:Vm}],h_=[{provide:Ln,useClass:as},{provide:Sa,useValue:"NoopAnimations"},...cd],zm=[{provide:Ln,useFactory:()=>new fo},{provide:Sa,useFactory:()=>"BrowserAnimations"},...cd];function dd(){return gl("NgEagerAnimations"),[...zm]}function $m(i,e){if(i&1){let t=O();l(0,"mat-checkbox",6),ie("ngModelChange",function(r){x(t);let o=h();return ne(o.checkboxChecked,r)||(o.checkboxChecked=r),w(r)}),u(1),c()}if(i&2){let t=h();te("ngModel",t.checkboxChecked),p(),L(t.data.checkboxLabel)}}var vo=class i{dialogRef=f(Hr);data=f(Ur);checkboxChecked=!1;cancel(){this.dialogRef.close({confirmed:!1})}confirm(){this.dialogRef.close({confirmed:!0,checkboxChecked:this.checkboxChecked})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-confirm-dialog"]],decls:10,vars:6,consts:[["mat-dialog-title",""],[1,"confirm-dialog__message"],[1,"confirm-dialog__checkbox",3,"ngModel"],["align","end"],["mat-button","",3,"click"],["mat-flat-button","",3,"click","color"],[1,"confirm-dialog__checkbox",3,"ngModelChange","ngModel"]],template:function(t,n){t&1&&(l(0,"h2",0),u(1),c(),l(2,"p",1),u(3),c(),C(4,$m,2,2,"mat-checkbox",2),l(5,"mat-dialog-actions",3)(6,"button",4),v("click",function(){return n.cancel()}),u(7),c(),l(8,"button",5),v("click",function(){return n.confirm()}),u(9),c()()),t&2&&(p(),L(n.data.title),p(2),L(n.data.message),p(),S(n.data.checkboxLabel?4:-1),p(3),L(n.data.cancelLabel??"Cancel"),p(),T("color",n.data.isDestructive?"warn":"primary"),p(),Ne(" ",n.data.confirmLabel??"Confirm"," "))},dependencies:[qr,Gr,Ge,si,lc,sc,lt,at,st],styles:[".confirm-dialog__message[_ngcontent-%COMP%]{margin:0 24px 8px;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;line-height:1.5}.confirm-dialog__checkbox[_ngcontent-%COMP%]{display:block;margin:0 24px 8px;font-size:.875rem}"]})};var gi=class i{snackBar=f(Hl);success(e,t=2e3){this.snackBar.open(e,"",{duration:t,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-success"]})}error(e,t=3e3){this.snackBar.open(e,"",{duration:t,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-error"]})}info(e,t=2e3){this.snackBar.open(e,"",{duration:t,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-info"]})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Bm=()=>[];function Hm(i,e){if(i&1){let t=O();l(0,"div",3)(1,"ds-entity-card",4),v("selected",function(r){x(t);let o=h();return w(o.onItemSelected(r))}),c(),l(2,"button",5),v("click",function(r){let o=x(t).$implicit,a=h();return r.stopPropagation(),w(a.onDeleteRequested(o.id))}),l(3,"mat-icon"),u(4,"close"),c()()()}if(i&2){let t=e.$implicit;p(),T("id",t.id)("name",t.name)("description",t.description)("badges",t.badges??Or(4,Bm))}}var Zi="__",yo=class i{router=f(zt);projectStateService=f(ye);dialog=f(Wr);destroyRef=f(ri);notification=f(gi);projects=Ie(this.projectStateService.projectList$);forcedProject=Ie(this.projectStateService.forcedProject$,{initialValue:null});projectItems=Tt(()=>{let e=this.projects();if(!e)return[];let t=e.filter(y=>!y.name.includes(Zi)),n=e.filter(y=>y.name.includes(Zi)),r=new Set(t.map(y=>y.name)),o=y=>y.split(Zi)[0]??null,a=new Set(n.map(y=>o(y.name)).filter(y=>y!==null&&r.has(y))),s=[],d=[...a].sort((y,k)=>y.localeCompare(k));for(let y of d){let k=t.find(P=>P.name===y);s.push(he(G({},this.toEntityListItem(k)),{groupKey:y,groupLabel:y}));let E=n.filter(P=>o(P.name)===y).sort((P,K)=>P.name.localeCompare(K.name));for(let P of E){let K=P.name.slice(y.length+Zi.length);s.push(he(G({},this.toEntityListItem(P)),{name:K,description:P.name,groupKey:y,groupLabel:y}))}}let m=[...t].filter(y=>!a.has(y.name)&&!y.volatile).sort((y,k)=>y.name.localeCompare(k.name));for(let y of m)s.push(he(G({},this.toEntityListItem(y)),{groupKey:"__standalone__",groupLabel:"Projects"}));let _=[...t].filter(y=>!a.has(y.name)&&y.volatile).sort((y,k)=>y.name.localeCompare(k.name));for(let y of _)s.push(he(G({},this.toEntityListItem(y)),{groupKey:"__volatile__",groupLabel:"Temporary"}));let b=n.filter(y=>{let k=o(y.name);return k!==null&&!r.has(k)}).sort((y,k)=>y.name.localeCompare(k.name));for(let y of b)s.push(he(G({},this.toEntityListItem(y)),{groupKey:"__orphaned__",groupLabel:"Orphaned worktrees"}));return s});showCreateButton=Tt(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(ot(),ve(e=>!!e),ve(()=>this.router.url.split("?")[0]==="/"),ti(1)).subscribe(e=>{this.router.navigate(["project",e.name])})}onItemSelected(e){this.projectStateService.selectProject(e),this.router.navigate(["project",e])}onCreateRequested(){this.router.navigate(["project","new"])}onDeleteRequested(e){let t=e.includes(Zi);this.dialog.open(vo,{width:"400px",panelClass:"confirm-dialog-panel",data:G({title:"Delete project",message:`This will remove the project "${e}" from Coday and archive its configuration. The project source code on disk is not affected.`,confirmLabel:"Delete",cancelLabel:"Cancel",isDestructive:!0},t?{checkboxLabel:"Also remove git worktree from disk"}:{})}).afterClosed().pipe(ve(r=>r?.confirmed===!0),ot(this.destroyRef)).subscribe(r=>{this.notification.info("Deleting project\u2026"),this.projectStateService.deleteProject(e,r.checkboxChecked).pipe(ot(this.destroyRef)).subscribe({next:()=>{this.notification.success(`Project "${e}" deleted`),this.router.url.includes(`/project/${encodeURIComponent(e)}`)&&this.router.navigate(["/"])},error:o=>{console.error("[PROJECT-LIST] Failed to delete project:",o),this.notification.error(o?.error?.error??"Failed to delete project")}})})}toEntityListItem(e){return{id:e.name,name:e.name,badges:e.volatile?[{label:"temp",variant:"warning"}]:[]}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-project-selection"]],decls:4,vars:4,consts:[["projectCard",""],["title","Projects","contentMaxWidth","1400px","searchPlaceholder","Filter projects\u2026","emptyMessage","No projects found.",3,"itemSelected","createRequested","items","itemTemplate","showCreate","autoFocusSearch"],["toolbar-start","","src","CODAY-Logo.png","alt","Coday",1,"project-list__logo"],[1,"project-card-wrapper"],[3,"selected","id","name","description","badges"],["mat-icon-button","","title","Delete project",1,"project-card-wrapper__delete",3,"click"]],template:function(t,n){if(t&1&&(l(0,"ds-entity-list",1),v("itemSelected",function(o){return n.onItemSelected(o)})("createRequested",function(){return n.onCreateRequested()}),F(1,"img",2),c(),un(2,Hm,5,5,"ng-template",null,0,ai)),t&2){let r=In(3);T("items",n.projectItems())("itemTemplate",r)("showCreate",n.showCreateButton())("autoFocusSearch",!0)}},dependencies:[ac,ic,ke,se,ze],styles:[".project-list__logo[_ngcontent-%COMP%]{height:28px;width:auto}.project-card-wrapper[_ngcontent-%COMP%]{position:relative}.project-card-wrapper__delete[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;width:28px;height:28px;line-height:28px;padding:0;opacity:0;transition:opacity .15s ease;color:var(--color-text-secondary, #6e6e73)}.project-card-wrapper__delete[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.project-card-wrapper__delete[_ngcontent-%COMP%]:hover{color:var(--color-error, #ff3b30)}.project-card-wrapper[_ngcontent-%COMP%]:hover .project-card-wrapper__delete[_ngcontent-%COMP%]{opacity:1}"]})};var Pe=class i{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new W("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new W(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new W(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new W("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new W(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new W(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new W(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new W(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new W(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new W(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new W(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new W(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new W(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new W(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new W("light");theme$=this.themeSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let n=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(n);let r=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(r);let o=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(o);let a=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(a);let s=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(s);let d=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(d);let m=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(m);let _=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(_);let b=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(b);let y=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(y);let k=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(k);let E=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(E);let P=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(P),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return B(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let n=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(n);let r=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(r);let o=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(o);let a=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(a);let s=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(s);let d=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(d);let m=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(m);let _=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(_);let b=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(b);let y=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(y);let k=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(k);let E=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(E);let P=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(P),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let n=localStorage.getItem(this.STORAGE_KEY);if(!n)return t;let r=JSON.parse(n);return r[e]!==void 0?r[e]:t}catch(n){return t}}getPreferenceAsync(e,t){return B(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let n=yield this.electronStorage.get(this.STORAGE_KEY);if(!n)return t;let r=JSON.parse(n);return r[e]!==void 0?r[e]:t}catch(n){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let n=localStorage.getItem(this.STORAGE_KEY),r=n?JSON.parse(n):{};r[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(r)),this.updateSubject(e,t)}catch(n){console.error("Failed to set preference:",n)}}setPreferenceAsync(e,t){return B(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let n=yield this.electronStorage.get(this.STORAGE_KEY),r=n?JSON.parse(n):{};r[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(r)),this.updateSubject(e,t)}catch(n){console.error("Failed to set preference:",n)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};function ls(i,e=80){if(i.length<=e)return i;try{if(i.trim().startsWith("{")||i.trim().startsWith("[")){let t=JSON.parse(i),n=JSON.stringify(t);return n.length<=e?n:n.substring(0,e)+`...(${n.length} chars)`}}catch(t){}return i.substring(0,e)+"..."}var je=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let n=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${n}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},Co=class extends je{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new pt({answer:e,parentKey:this.timestamp,invite:this.invite})}},fi=class i extends je{static type="heartbeat";constructor(e){super(e,i.type)}},an=class i extends Co{defaultValue;static type="invite";constructor(e){super(e,i.type),this.defaultValue=e.defaultValue}},cs="InviteEventDefault",pt=class i extends je{answer;invite;name;static type="answer";constructor(e){super(e,i.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name}},Wt=class i extends je{speaker;text;static type="text";constructor(e){super(e,i.type),this.speaker=e.speaker,this.text=e.text}},vn=class i extends je{chunk;static type="text_chunk";constructor(e){super(e,i.type),this.chunk=e.chunk,this.length=this.chunk.length}},zn=class i extends je{warning;static type="warn";constructor(e){super(e,i.type),this.warning=e.warning}},kt=class i extends je{error;static type="error";constructor(e){super(e,i.type),this.error=e.error}},sn=class i extends Co{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,i.type),this.options=e.options,this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},Pt=class i extends je{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,i.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new yt({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=ls(this.args,e);return`\u{1F527} ${this.name}(${t})`}},yt=class i extends je{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,i.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),n=ls(t,e),r=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${n}${r}`}},yn=class i extends je{static type="thinking";static debounce=5e3;constructor(e){super(e,i.type)}},$n=class i extends je{summary;static type="summary";constructor(e){super(e,i.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${ls(this.summary,e)}`}},Ot=class i extends je{role;name;content;static type="message";constructor(e){super(e,i.type),this.role=e.role,this.name=e.name,this.content=e.content,this.length=this.content.map(t=>{if(t.type==="text")return t.content.length;if(t.type==="image"){let n=(t.width||0)*(t.height||0)/750;return n?n*3.5:t.content.length}return 0}).reduce((t,n)=>t+n,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
2
2
|
`)}},_i=class i extends je{threadId;name;summary;users;static type="thread_update";constructor(e){super(e,i.type),this.threadId=e.threadId,this.name=e.name,this.summary=e.summary,this.users=e.users}},Cn=class i extends je{filename;operation;size;mimeType;static type="file";constructor(e){super(e,i.type),this.filename=e.filename,this.operation=e.operation,this.size=e.size,this.mimeType=e.mimeType}toSingleLineString(){let e=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",t=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${e} ${this.operation}: ${this.filename}${t}`}},bi=class i extends je{authUrl;state;integrationName;static type="oauth_request";constructor(e){super(e,i.type),this.authUrl=e.authUrl,this.state=e.state,this.integrationName=e.integrationName}},qt=class i extends je{subThreadId;agentName;static type="delegation";constructor(e){super(e,i.type),this.subThreadId=e.subThreadId,this.agentName=e.agentName}},At=class i extends je{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(e){super(e,i.type),this.code=e.code,this.state=e.state,this.integrationName=e.integrationName,this.error=e.error,this.errorDescription=e.errorDescription}},Um={[Ot.type]:Ot,[pt.type]:pt,[sn.type]:sn,[qt.type]:qt,[kt.type]:kt,[fi.type]:fi,[an.type]:an,[Pt.type]:Pt,[yt.type]:yt,[Wt.type]:Wt,[vn.type]:vn,[yn.type]:yn,[zn.type]:zn,[_i.type]:_i,[$n.type]:$n,[Cn.type]:Cn,[bi.type]:bi,[At.type]:At};function er(i){let e=Um[i.type];return e?new e(i):void 0}var db=[{id:"builtin-plan",name:"plan",description:"Build a plan to complete the given task",source:"builtin",commands:[`@ We start a 3 phase process to build a comprehensive execution plan for the following task:
|
|
3
3
|
|
|
4
4
|
<task>
|
|
@@ -358,4 +358,4 @@ This action cannot be undone once you post another message.`)&&(console.log("[CH
|
|
|
358
358
|
`],encapsulation:2,changeDetection:0})}return i})(),Qo=(()=>{class i extends Ni{static \u0275fac=(()=>{let t;return function(r){return(t||(t=kr(i)))(r||i)}})();static \u0275cmp=I({type:i,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],features:[fn([{provide:li,useExisting:i}]),Ui],ngContentSelectors:Ko,decls:1,vars:0,template:function(n,r){n&1&&(rn(),ht(0))},encapsulation:2,changeDetection:0})}return i})(),js=(()=>{class i extends mr{get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(t){this._fixedInViewport=Dn(t)}_fixedInViewport=!1;get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(t){this._fixedTopGap=Oa(t)}_fixedTopGap=0;get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(t){this._fixedBottomGap=Oa(t)}_fixedBottomGap=0;static \u0275fac=(()=>{let t;return function(r){return(t||(t=kr(i)))(r||i)}})();static \u0275cmp=I({type:i,selectors:[["mat-sidenav"]],hostAttrs:[1,"mat-drawer","mat-sidenav"],hostVars:16,hostBindings:function(n,r){n&2&&(Me("tabIndex",r.mode!=="side"?"-1":null)("align",null),Ke("top",r.fixedInViewport?r.fixedTopGap:null,"px")("bottom",r.fixedInViewport?r.fixedBottomGap:null,"px"),Y("mat-drawer-end",r.position==="end")("mat-drawer-over",r.mode==="over")("mat-drawer-push",r.mode==="push")("mat-drawer-side",r.mode==="side")("mat-sidenav-fixed",r.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],features:[fn([{provide:mr,useExisting:i}]),Ui],ngContentSelectors:Ko,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(n,r){n&1&&(rn(),l(0,"div",1,0),ht(2),c())},dependencies:[li],encapsulation:2,changeDetection:0})}return i})(),Cp=(()=>{class i extends ur{_allDrawers=void 0;_content=void 0;static \u0275fac=(()=>{let t;return function(r){return(t||(t=kr(i)))(r||i)}})();static \u0275cmp=I({type:i,selectors:[["mat-sidenav-container"]],contentQueries:function(n,r,o){if(n&1&&Ea(o,Qo,5)(o,js,5),n&2){let a;ge(a=fe())&&(r._content=a.first),ge(a=fe())&&(r._allDrawers=a)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(n,r){n&2&&Y("mat-drawer-container-explicit-backdrop",r._backdropOverride)},exportAs:["matSidenavContainer"],features:[fn([{provide:Ls,useExisting:i},{provide:ur,useExisting:i}]),Ui],ngContentSelectors:cf,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(n,r){n&1&&(rn(lf),C(0,df,1,2,"div",0),ht(1),ht(2,1),C(3,pf,2,0,"mat-sidenav-content")),n&2&&(S(r.hasBackdrop?0:-1),p(3),S(r._content?-1:3))},dependencies:[Qo],styles:[mf],encapsulation:2,changeDetection:0})}return i})(),Xo=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=wt({type:i});static \u0275inj=xt({imports:[Aa,$t,Aa]})}return i})();var xp="mat-badge-content",hf=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=I({type:i,selectors:[["ng-component"]],decls:0,vars:0,template:function(n,r){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
|
|
359
359
|
`],encapsulation:2,changeDetection:0})}return i})(),wp=(()=>{class i{_ngZone=f(Lt);_elementRef=f(ft);_ariaDescriber=f(jl);_renderer=f(Pr);_animationsDisabled=$r();_idGenerator=f(Fl);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled=!1;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden=!1;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=f(zr);_document=f(ii);constructor(){let t=f(Al);t.load(hf),t.load(Il)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngAfterViewInit(){}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),n="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(xp),this._animationsDisabled&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(n)})}):t.classList.add(n),t}_updateRenderedContent(t){let n=`${t??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),t&&n.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${xp}`);for(let n of Array.from(t))n!==this._badgeElement&&n.remove()}static \u0275fac=function(n){return new(n||i)};static \u0275dir=_l({type:i,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,r){n&2&&Y("mat-badge-overlap",r.overlap)("mat-badge-above",r.isAbove())("mat-badge-below",!r.isAbove())("mat-badge-before",!r.isAfter())("mat-badge-after",r.isAfter())("mat-badge-small",r.size==="small")("mat-badge-medium",r.size==="medium")("mat-badge-large",r.size==="large")("mat-badge-hidden",r.hidden||!r.content)("mat-badge-disabled",r.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",Rr],disabled:[2,"matBadgeDisabled","disabled",Rr],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",Rr]}})}return i})(),Tp=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=wt({type:i});static \u0275inj=xt({imports:[Nl,$t]})}return i})();var Fi=class i{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=f(Ti);project=f(ye);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){Pn([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([e,t])=>{this.updateTitle(e?.name??"...",t)})}updateTitle(e,t){let n;this.isSystemActive?n=`\u23F3${t>0?` (${t}) `:" "}${e}`:t>0?n=`${this.ATTENTION_EMOJI} (${t}) ${e}`:n=e,document.title=n,console.log("[TAB-TITLE] Updated to:",n)}setSystemActive(){console.log("[TAB-TITLE] System active - showing hourglass"),this.isSystemActive=!0,this.systemActiveTimer&&clearTimeout(this.systemActiveTimer),this.systemActiveTimer=setTimeout(()=>{console.log("[TAB-TITLE] System active timeout - hiding hourglass"),this.isSystemActive=!1,this.forceUpdateTitle()},this.SYSTEM_ACTIVE_TIMEOUT),this.forceUpdateTitle()}setSystemInactive(){console.log("[TAB-TITLE] System inactive - hiding hourglass"),this.isSystemActive=!1,this.systemActiveTimer&&(clearTimeout(this.systemActiveTimer),this.systemActiveTimer=null),this.forceUpdateTitle()}forceUpdateTitle(){let e=this.project.getSelectedProjectId()??"...",t=this.unreadService.getCurrentCount();this.updateTitle(e,t)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Jo=class i{http=f(rt);maxFileSize=5*1024*1024;supportedTypes=["image/png","image/jpeg","image/gif","image/webp"];validateFile(e){if(!this.supportedTypes.includes(e.type))throw new Error(`Unsupported file type: ${e.type}`);if(e.size>this.maxFileSize)throw new Error(`File too large: ${(e.size/1024/1024).toFixed(1)}MB exceeds 5MB limit`)}fileToBase64(e){return B(this,null,function*(){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let o=r.result;if(!o){n(new Error("Failed to read file"));return}let a=o.split(",")[1];if(!a){n(new Error("Invalid file format"));return}t(a)},r.onerror=n,r.readAsDataURL(e)})})}getUploadUrl(e,t){return`/api/projects/${e}/threads/${t}/upload`}uploadImage(e,t,n){console.log("[IMAGE-UPLOAD] uploadImage - file:",e.name,e.type,e.size),console.log("[IMAGE-UPLOAD] uploadImage - project:",t,"thread:",n);try{console.log("[IMAGE-UPLOAD] Validating file..."),this.validateFile(e)}catch(r){return console.log("[IMAGE-UPLOAD] Validation failed:",r),kn({success:!1,error:r instanceof Error?r.message:"Validation failed"})}return new Er(r=>{console.log("[IMAGE-UPLOAD] Converting to base64..."),this.fileToBase64(e).then(o=>{console.log("[IMAGE-UPLOAD] Base64 length:",o.length),console.log("[IMAGE-UPLOAD] Sending upload request..."),this.http.post(this.getUploadUrl(t,n),{content:o,mimeType:e.type,filename:e.name}).pipe(Ae(a=>(console.log("[IMAGE-UPLOAD] Upload success result:",a),{success:!0,processedSize:a.processedSize,dimensions:a.dimensions})),mn(a=>{console.log("[IMAGE-UPLOAD] Upload failed:",a);let s=a.error?.error||a.message||"Upload failed";return kn({success:!1,error:s})})).subscribe({next:a=>{r.next(a),r.complete()},error:a=>r.error(a)})}).catch(o=>{console.log("[IMAGE-UPLOAD] Base64 conversion failed:",o),r.next({success:!1,error:o instanceof Error?o.message:"Failed to read file"}),r.complete()})})}hasImageFiles(e){if(console.log("[IMAGE-UPLOAD] hasImageFiles - dataTransfer:",e),!e)return console.log("[IMAGE-UPLOAD] hasImageFiles - no dataTransfer"),!1;if(console.log("[IMAGE-UPLOAD] hasImageFiles - types:",Array.from(e.types)),!Array.from(e.types).includes("Files"))return console.log("[IMAGE-UPLOAD] hasImageFiles - no Files type"),!1;let t=Array.from(e.files||[]);console.log("[IMAGE-UPLOAD] hasImageFiles - files:",t.map(r=>({name:r.name,type:r.type})));let n=t.some(r=>this.supportedTypes.includes(r.type));return console.log("[IMAGE-UPLOAD] hasImageFiles - result:",n),n}filterImageFiles(e){return Array.from(e).filter(n=>this.supportedTypes.includes(n.type))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var Li=class i{pendingFirstMessage=null;setPendingFirstMessage(e){console.log("[FIRST-MESSAGE-STATE] Storing pending first message:",e.substring(0,50)+"..."),this.pendingFirstMessage=e}consumePendingFirstMessage(){let e=this.pendingFirstMessage;return e?(console.log("[FIRST-MESSAGE-STATE] Consuming pending first message:",e.substring(0,50)+"..."),this.pendingFirstMessage=null):console.log("[FIRST-MESSAGE-STATE] No pending first message to consume"),e}hasPendingFirstMessage(){return this.pendingFirstMessage!==null}clear(){this.pendingFirstMessage&&(console.log("[FIRST-MESSAGE-STATE] Clearing pending first message"),this.pendingFirstMessage=null)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var ff=["inputSection"],_f=()=>[];function bf(i,e){if(i&1){let t=O();l(0,"button",20),v("click",function(){x(t);let r=h();return w(r.toggleFileDrawer())}),l(1,"mat-icon"),u(2,"folder_open"),c()()}if(i&2){let t=h();Y("has-files",t.fileCount>0),T("title",vl("Files Exchange",t.fileCount>0?" ("+t.fileCount+" file"+(t.fileCount>1?"s":"")+")":""))("matBadge",t.fileCount>0?t.fileCount:null)}}function vf(i,e){if(i&1){let t=O();l(0,"button",21),v("click",function(){x(t);let r=h();return w(r.toggleSharePanel())}),l(1,"mat-icon"),u(2,"group"),c()()}if(i&2){let t=h();Y("has-shared-users",((t.threadDetails==null||t.threadDetails.users==null?null:t.threadDetails.users.length)??0)>1)}}function yf(i,e){if(i&1&&(l(0,"div",6),u(1),c()),i&2){let t=h();p(),oi(" \u26A0\uFE0F Connection lost. Reconnecting... (",t.connectionStatus.reconnectAttempts,"/",t.connectionStatus.maxAttempts,") ")}}function Cf(i,e){if(i&1&&(l(0,"div",22),u(1),c()),i&2){let t=h();Y("error",t.uploadStatus.isError),p(),Ne(" ",t.uploadStatus.message," ")}}function Sf(i,e){if(i&1){let t=O();l(0,"app-chat-textarea",23),v("messageSubmitted",function(r){x(t);let o=h();return w(o.onMessageSubmitted(r))})("voiceRecordingToggled",function(r){x(t);let o=h();return w(o.onVoiceToggled(r))})("heightChanged",function(r){x(t);let o=h();return w(o.onInputHeightChanged(r))})("stopRequested",function(){x(t);let r=h();return w(r.onStopRequested())})("filesPasted",function(r){x(t);let o=h();return w(o.onFilesPasted(r))}),c()}if(i&2){let t=h();T("isDisabled",!t.isConnected)("isSessionInitializing",!1)("showWelcome",!1)("isThinking",t.isThinking)("isStarting",!1)}}function xf(i,e){if(i&1){let t=O();l(0,"app-choice-select",24),v("choiceSelected",function(r){x(t);let o=h();return w(o.onChoiceSelected(r))}),c()}if(i&2){let t=h();T("options",t.currentChoice.options)("labelHtml",t.currentChoice.label)("isVisible",!!t.currentChoice)("allowFreeText",t.currentChoice.allowFreeText)}}function wf(i,e){i&1&&F(0,"app-oauth-request-panel")}function Tf(i,e){if(i&1){let t=O();l(0,"app-file-exchange-drawer",25),v("closeDrawer",function(){x(t);let r=h();return w(r.closeDrawer())}),c()}if(i&2){let t=h();T("projectName",t.projectName)("threadId",t.threadId)}}function Ef(i,e){if(i&1){let t=O();l(0,"app-thread-share",26),v("userAdded",function(r){x(t);let o=h();return w(o.onUserAdded(r))})("userRemoved",function(r){x(t);let o=h();return w(o.onUserRemoved(r))})("closed",function(){x(t);let r=h();return w(r.closeDrawer())}),c()}if(i&2){let t=h();T("threadId",t.threadId)("users",t.threadDetails.users||Or(3,_f))("currentUsername",t.currentUsername)}}function Mf(i,e){i&1&&(l(0,"div",19)(1,"div",27)(2,"div",28),u(3,"\u{1F4CE}"),c(),l(4,"div",29),u(5,"Drop files here to upload"),c(),l(6,"div",30),u(7,"Images will be added to conversation, other files to exchange space"),c()()())}var Zo=class i{projectName;threadId;chatFocused=new Z;drawerStateChange=new Z;destroy$=new J;connectionDestroy$=new J;inputSection;messages=[];streamingText="";isThinking=!1;currentChoice=null;connectionStatus=null;isConnected=!1;showConnectionStatus=!1;hasEverConnected=!1;inputSectionHeight=80;uploadStatus={message:"",isError:!1};isDragOver=!1;drawerMode="none";get isDrawerOpen(){return this.drawerMode!=="none"}threadDetails=null;threadShareRef;get fileCount(){return this.fileExchangeState.fileCount()}currentUsername="";authEnabled=!1;pendingFirstMessage=null;subscriptions=[];codayService=f(mt);oauthService=f(Sn);pendingOAuthRequest=Ie(this.oauthService.pendingRequest$,{initialValue:null});preferencesService=f(Pe);titleService=f(Fi);elementRef=f(ft);threadState=f(Ye);userService=f(Qt);router=f(zt);imageUploadService=f(Jo);fileExchangeState=f(ki);firstMessageState=f(Li);ngOnInit(){if(console.log("[THREAD] Initializing with project:",this.projectName,"thread:",this.threadId),!this.projectName||!this.threadId){console.error("[THREAD] Missing required inputs: projectName or threadId");return}this.setupPrintHandlers(),this.userService.authEnabled$.pipe(D(this.destroy$)).subscribe(e=>{this.authEnabled=e}),this.userService.username$.pipe(D(this.destroy$)).subscribe(e=>{this.currentUsername=e??"",this.messages.length>0&&(this.messages=[...this.messages])}),this.initializeThreadConnection()}ngOnChanges(e){console.log("[THREAD] ngOnChanges called",e),e.threadId&&(console.log("[THREAD] threadId changed:",{firstChange:e.threadId.firstChange,previousValue:e.threadId.previousValue,currentValue:e.threadId.currentValue}),e.threadId.firstChange||(console.log("[THREAD] Reconnecting to new thread"),this.initializeThreadConnection()))}initializeThreadConnection(){console.log("[THREAD] Initializing connection for thread:",this.threadId),this.fileExchangeState.initializeForThread(this.projectName,this.threadId),this.connectionDestroy$.next(),this.codayService.messages$.pipe(D(this.connectionDestroy$)).subscribe(t=>{console.log("[THREAD] Messages updated:",t.length),this.messages=t}),this.codayService.streamingText$.pipe(D(this.connectionDestroy$)).subscribe(t=>{this.streamingText=t}),this.codayService.isThinking$.pipe(D(this.connectionDestroy$)).subscribe(t=>{this.isThinking=t}),this.codayService.currentChoice$.pipe(D(this.connectionDestroy$)).subscribe(t=>{this.currentChoice=t}),this.codayService.connectionStatus$.pipe(D(this.connectionDestroy$)).subscribe(t=>{this.connectionStatus=t,this.isConnected=t.connected,t.connected&&!this.hasEverConnected&&(this.hasEverConnected=!0,this.showConnectionStatus=!0),!t.connected&&!this.hasEverConnected?setTimeout(()=>{!this.isConnected&&!this.hasEverConnected&&(this.showConnectionStatus=!0)},2e3):!t.connected&&this.hasEverConnected?this.showConnectionStatus=!0:t.connected&&(this.showConnectionStatus=!0)}),this.codayService.threadUpdateEvent$.pipe(D(this.connectionDestroy$)).subscribe(t=>{t&&(console.log("[THREAD] Thread update event received:",t),this.threadState.refreshThreadList())}),this.threadState.selectedThread$.pipe(D(this.connectionDestroy$)).subscribe(t=>{this.threadDetails=t}),this.codayService.resetMessages(),this.codayService.setTabTitleService(this.titleService),console.log("[THREAD] Connecting to thread event stream"),this.codayService.connectToThread(this.projectName,this.threadId);let e=this.firstMessageState.consumePendingFirstMessage();e?(console.log("[THREAD] First message pending:",e.substring(0,50)+"..."),this.pendingFirstMessage=e,this.codayService.setThinkingForPendingMessage(),this.subscribeToFirstInvite()):console.log("[THREAD] No first message found in state service")}ngAfterViewChecked(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&e>0&&(this.inputSectionHeight=e)}}ngOnDestroy(){console.log("[THREAD] Destroying component"),this.connectionDestroy$.next(),this.connectionDestroy$.complete(),this.destroy$.next(),this.destroy$.complete(),this.fileExchangeState.clear(),this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions=[],window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(e){console.log("[THREAD] Sending message:",e),this.codayService.sendMessage(e)}onVoiceToggled(e){console.log("[VOICE] Recording:",e)}onChoiceSelected(e){console.log("[THREAD] Choice selected:",e),this.codayService.sendChoice(e)}onCopyMessage(e){console.log("[COPY] Message copied:",e.id)}onStopRequested(){this.threadState.stop()}onInputHeightChanged(e){console.log("[THREAD] Input height changed:",e),this.inputSectionHeight=e}onFilesPasted(e){console.log("[THREAD] File(s) pasted:",e.length);let t=this.imageUploadService.filterImageFiles(e),n=e.filter(r=>!r.type.startsWith("image/"));t.length&&this.uploadFilesSequentially(t,0),n.length&&this.uploadFilesToExchangeSpace(n),!t.length&&!n.length&&this.showUploadError("No supported files found")}emitDrawerState(){this.drawerStateChange.emit(this.isDrawerOpen)}toggleFileDrawer(){this.drawerMode=this.drawerMode==="files"?"none":"files",this.emitDrawerState()}toggleSharePanel(){this.drawerMode=this.drawerMode==="share"?"none":"share",this.emitDrawerState()}closeDrawer(){this.drawerMode="none",this.emitDrawerState()}onUserAdded(e){if(console.log("[THREAD] Adding user to thread:",e),!this.threadDetails)return;let t=this.threadDetails.users||[];if(t.some(r=>r.userId===e)){this.threadShareRef?.setError("User already has access to this thread");return}this.threadShareRef?.setAdding(!0);let n=[...t,{userId:e}];this.threadState.updateThreadUsers(this.threadId,n).pipe(D(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User added successfully"),this.threadShareRef?.setAdding(!1),this.threadState.refreshSelectedThread()},error:r=>{console.error("[THREAD] Error adding user:",r),this.threadShareRef?.setError(r?.error?.error||"Failed to add user")}})}onUserRemoved(e){if(console.log("[THREAD] Removing user from thread:",e),!this.threadDetails)return;let t=e===this.currentUsername,n=(this.threadDetails.users||[]).filter(r=>r.userId!==e);this.threadState.updateThreadUsers(this.threadId,n).pipe(D(this.destroy$)).subscribe({next:()=>{console.log("[THREAD] User removed successfully"),t?(this.threadState.clearSelection(),this.threadState.refreshThreadList(),this.router.navigate(["project",this.projectName])):this.threadState.refreshSelectedThread()},error:r=>{console.error("[THREAD] Error removing user:",r)}})}onDragEnter(e){e.preventDefault(),e.dataTransfer?.types.includes("Files")&&(console.log("[THREAD] Image files detected - showing drag overlay"),this.isDragOver=!0)}onDragOver(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")}onDragLeave(e){this.elementRef.nativeElement.contains(e.relatedTarget)||(console.log("[THREAD] Leaving component area - hiding drag overlay"),this.isDragOver=!1)}onDrop(e){e.preventDefault(),this.isDragOver=!1,console.log("[THREAD] Files dropped:",e.dataTransfer?.files?.length||0);let t=e.dataTransfer?.files;if(!t||t.length===0){console.log("[THREAD] No files in drop event");return}let n=this.imageUploadService.filterImageFiles(t),r=Array.from(t).filter(o=>!o.type.startsWith("image/"));console.log("[THREAD] Image files:",n.length,"Other files:",r.length),n.length>0&&this.uploadFilesSequentially(n,0),r.length>0&&this.uploadFilesToExchangeSpace(r),n.length===0&&r.length===0&&this.showUploadError("No supported files found")}uploadFilesSequentially(e,t){if(t>=e.length)return;let n=e[t];if(!n){console.error("[THREAD] File at index",t,"is undefined");return}console.log("[THREAD] Uploading file:",n.name),this.uploadStatus={message:`Uploading ${n.name}...`,isError:!1},this.imageUploadService.uploadImage(n,this.projectName,this.threadId).subscribe({next:r=>{r.success?(console.log("[THREAD] Upload successful:",n.name),this.uploadStatus={message:`\u2713 ${n.name} uploaded (${(r.processedSize/1024).toFixed(1)} KB)`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3),this.uploadFilesSequentially(e,t+1)):(console.error("[THREAD] Upload failed:",n.name,r.error),this.showUploadError(`Failed to upload ${n.name}: ${r.error}`))},error:r=>{console.error("[THREAD] Upload error:",n.name,r),this.showUploadError(`Failed to upload ${n.name}: ${r.message||"Unknown error"}`)}})}showUploadError(e){this.uploadStatus={message:e,isError:!0},setTimeout(()=>{this.uploadStatus={message:"",isError:!1}},5e3)}uploadFilesToExchangeSpace(e){return B(this,null,function*(){for(let t of e){console.log("[THREAD] Uploading to exchange space:",t.name),this.uploadStatus={message:`Uploading ${t.name}...`,isError:!1};let n=yield this.fileExchangeState.uploadFile(t);if(n.success)console.log("[THREAD] Upload to exchange space successful:",t.name),this.uploadStatus={message:`\u2713 ${t.name} uploaded to exchange space`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3);else{console.error("[THREAD] Upload to exchange space failed:",t.name,n.error),this.showUploadError(`Failed to upload ${t.name}: ${n.error}`);break}}})}subscribeToFirstInvite(){console.log("[THREAD] Subscribing to wait for InviteEvent"),this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(e=>{if(e&&this.pendingFirstMessage){console.log("[THREAD] Received InviteEvent, sending pending message");let t=this.pendingFirstMessage;this.pendingFirstMessage=null,this.codayService.sendMessage(t)}}))}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-thread"]],viewQuery:function(t,n){if(t&1&&Be(ff,5)(pr,5),t&2){let r;ge(r=fe())&&(n.inputSection=r.first),ge(r=fe())&&(n.threadShareRef=r.first)}},inputs:{projectName:"projectName",threadId:"threadId"},outputs:{chatFocused:"chatFocused",drawerStateChange:"drawerStateChange"},features:[jt],decls:22,vars:16,consts:[["inputSection",""],[1,"drag-drop-wrapper",3,"dragenter","dragover","dragleave","drop"],[1,"file-drawer-container",3,"hasBackdrop"],[1,"thread-container"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"has-files","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"has-shared-users"],[1,"connection-status"],[1,"chat-wrapper",3,"mousedown","touchstart"],[1,"chat-center"],[3,"copyRequested","stopRequested","messages","streamingText","isThinking","currentUsername"],[1,"upload-status",3,"error"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"options","labelHtml","isVisible","allowFreeText"],["mode","side","position","end",3,"closed","opened"],[3,"projectName","threadId"],[3,"threadId","users","currentUsername"],[1,"drag-overlay"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"click","matBadge","title"],["matFab","","title","Share thread","type","button",1,"share-toggle-btn",3,"click"],[1,"upload-status"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","stopRequested","filesPasted","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"choiceSelected","options","labelHtml","isVisible","allowFreeText"],[3,"closeDrawer","projectName","threadId"],[3,"userAdded","userRemoved","closed","threadId","users","currentUsername"],[1,"drag-overlay-content"],[1,"drag-icon"],[1,"drag-text"],[1,"drag-hint"]],template:function(t,n){t&1&&(l(0,"div",1),v("dragenter",function(o){return n.onDragEnter(o)})("dragover",function(o){return n.onDragOver(o)})("dragleave",function(o){return n.onDragLeave(o)})("drop",function(o){return n.onDrop(o)}),l(1,"mat-drawer-container",2)(2,"mat-drawer-content")(3,"div",3),C(4,bf,3,5,"button",4),C(5,vf,3,2,"button",5),C(6,yf,2,2,"div",6),l(7,"div",7),v("mousedown",function(){return n.chatFocused.emit()})("touchstart",function(){return n.chatFocused.emit()}),l(8,"div",8)(9,"app-chat-history",9),v("copyRequested",function(o){return n.onCopyMessage(o)})("stopRequested",function(){return n.onStopRequested()}),c(),C(10,Cf,2,3,"div",10),c()(),l(11,"div",11,0)(13,"div",12)(14,"div",13),C(15,Sf,1,5,"app-chat-textarea",14),C(16,xf,1,4,"app-choice-select",15),C(17,wf,1,0,"app-oauth-request-panel"),c()()()()(),l(18,"mat-drawer",16),v("closed",function(){return n.closeDrawer()}),C(19,Tf,1,2,"app-file-exchange-drawer",17),C(20,Ef,1,4,"app-thread-share",18),c()(),C(21,Mf,8,0,"div",19),c()),t&2&&(p(),T("hasBackdrop",!1),p(3),S(n.drawerMode!=="files"?4:-1),p(),S(n.authEnabled&&n.drawerMode!=="share"?5:-1),p(),S(n.showConnectionStatus&&n.connectionStatus&&!n.connectionStatus.connected?6:-1),p(3),T("messages",n.messages)("streamingText",n.streamingText)("isThinking",n.isThinking)("currentUsername",n.currentUsername),p(),S(n.uploadStatus.message?10:-1),p(5),S(!n.currentChoice&&!n.pendingOAuthRequest()?15:-1),p(),S(n.currentChoice?16:-1),p(),S(n.pendingOAuthRequest()?17:-1),p(),T("opened",n.isDrawerOpen),p(),S(n.drawerMode==="files"?19:-1),p(),S(n.drawerMode==="share"&&n.threadDetails?20:-1),p(),S(n.isDragOver?21:-1))},dependencies:[Ro,yi,No,Lo,qo,pr,Xo,mr,ur,Ni,ke,se,Ge,Br,Tp,wp],styles:[".drag-drop-wrapper[_ngcontent-%COMP%]{height:100vh;height:100dvh;width:100%;position:relative}.thread-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%;position:relative;background:transparent}.file-drawer-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;right:1rem!important;z-index:100!important}.file-drawer-toggle-btn.has-files[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_pulse-subtle 3s infinite}@media(max-width:768px){.file-drawer-toggle-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;top:.75rem!important;right:.75rem!important}.file-drawer-toggle-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}}.share-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:5rem!important;right:1rem!important;z-index:100!important}.share-toggle-btn.has-shared-users[_ngcontent-%COMP%]{color:var(--color-primary)!important}@media(max-width:768px){.share-toggle-btn[_ngcontent-%COMP%]{width:40px!important;height:40px!important;top:calc(1.25rem + 40px)!important;right:.75rem!important}.share-toggle-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}}@keyframes _ngcontent-%COMP%_pulse-subtle{0%,to{box-shadow:0 2px 8px #00000026}50%{box-shadow:0 4px 16px rgba(var(--color-primary-rgb, 25, 118, 210),.3)}}.file-drawer-container[_ngcontent-%COMP%]{height:100dvh;width:100%;background:var(--color-bg)}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-content{display:flex;flex-direction:column;height:100%;overflow:hidden;background:transparent}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:35%;min-width:280px;max-width:480px;box-shadow:-2px 0 8px #0000001a}@media(max-width:768px){.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100%;max-width:100%;padding-bottom:env(safe-area-inset-bottom,0px)}}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer-backdrop{display:none}.connection-status[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;z-index:1000;background:var(--color-warning);color:var(--color-text);padding:.5rem 1rem;text-align:center;font-size:.9rem;box-shadow:0 2px 4px #0000001a}.chat-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;width:100%;padding:1rem 0}.chat-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 2rem;display:flex;flex-direction:column;gap:1rem}@media(max-width:768px){.chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-section[_ngcontent-%COMP%]{width:100%;padding:1rem 0;padding-bottom:calc(1rem + env(safe-area-inset-bottom,0px));background:transparent;position:relative}.input-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 2rem}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.choice-overlay[_ngcontent-%COMP%]{display:block;width:100%}.upload-status[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:8px;background:var(--color-success-light);color:var(--color-text);font-size:.9rem;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:var(--color-error-light)}@media print{.file-drawer-toggle-btn[_ngcontent-%COMP%], .share-toggle-btn[_ngcontent-%COMP%], .connection-status[_ngcontent-%COMP%]{display:none}.thread-container[_ngcontent-%COMP%]{background:#fff}.input-section[_ngcontent-%COMP%]{display:none}}"]})};var ea=class i{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation()}ngOnDestroy(){this.stopWelcomeRotation()}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex]},3e3)}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(t,n){t&1&&(hn(0,"h1",0),u(1),gn()),t&2&&(p(),L(n.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var Ep=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=wt({type:i});static \u0275inj=xt({imports:[$t]})}return i})();var Mp=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=wt({type:i});static \u0275inj=xt({imports:[$t]})}return i})();var ji=class i{currentThemeSubject=new W("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=f(Pe);subscription=null;constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}ngOnDestroy(){this.subscription?.unsubscribe()}initializeTheme(){this.subscription=this.preferences.theme$.subscribe(e=>{console.log("[THEME] Theme preference changed to:",e),this.applyTheme(e)})}setTheme(e){this.preferences.setPreference("theme",e),this.applyTheme(e)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(e){if(console.log("[THEME] Applying theme:",e),this.currentThemeSubject.next(e),e==="system")if(typeof window<"u"&&window.matchMedia){let n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",n),this.setDocumentTheme(n)}else console.log("[THEME] matchMedia not available, defaulting to light theme"),this.setDocumentTheme("light");else this.setDocumentTheme(e)}setDocumentTheme(e){console.log("[THEME] Setting document theme to:",e),typeof document<"u"&&document.documentElement&&(e==="dark"?document.documentElement.setAttribute("data-theme","dark"):document.documentElement.removeAttribute("data-theme"))}setupSystemThemeListener(){typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{this.getCurrentTheme()==="system"&&this.setDocumentTheme(e.matches?"dark":"light")})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var kf=(i,e)=>e.code,Pf=(i,e)=>e.name+e.lang;function Of(i,e){i&1&&(l(0,"div",15)(1,"mat-icon",32),u(2,"warning"),c(),l(3,"span",33),u(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),c()())}function Af(i,e){if(i&1&&(l(0,"option",18),u(1),c()),i&2){let t=e.$implicit;T("value",t.code),p(),oi("",t.flag," ",t.label)}}function If(i,e){i&1&&(l(0,"option",25),u(1,"Loading voices..."),c())}function Df(i,e){i&1&&(l(0,"option",25),u(1,"No voice available"),c())}function Rf(i,e){if(i&1&&(l(0,"option",18),u(1),c()),i&2){let t=e.$implicit;T("value",t.name+"|"+t.lang),p(),Ne(" ",t.displayName," ")}}var hr=class i{destroy$=new J;selectedTheme="light";selectedVoiceLanguage="en-US";useEnterToSend=!1;printTechnicalMessages=!1;showTechnicalMessages=!0;showWarningMessages=!0;voiceAnnounceEnabled=!1;voiceMode="speech";voiceReadFullText=!1;voiceVolume=80;voiceRate=120;agentNotificationEnabled=!1;notificationSoundEnabled=!0;browserNotificationEnabled=!1;browserNotificationDenied=!1;availableVoices=[];selectedVoiceId=null;loadingVoices=!1;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=f(Pe);voiceSynthesisService=f(Ei);themeService=f(ji);ngOnInit(){this.selectedTheme=this.themeService.getCurrentTheme(),this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(D(this.destroy$)).subscribe(e=>{this.selectedTheme=e}),this.preferencesService.voiceLanguage$.pipe(D(this.destroy$)).subscribe(e=>{this.selectedVoiceLanguage=e}),this.preferencesService.enterToSend$.pipe(D(this.destroy$)).subscribe(e=>{this.useEnterToSend=e}),this.preferencesService.printTechnicalMessages$.pipe(D(this.destroy$)).subscribe(e=>{this.printTechnicalMessages=e}),this.preferencesService.hideTechnicalMessages$.pipe(D(this.destroy$)).subscribe(e=>{this.showTechnicalMessages=!e}),this.preferencesService.hideWarningMessages$.pipe(D(this.destroy$)).subscribe(e=>{this.showWarningMessages=!e}),this.preferencesService.voiceAnnounceEnabled$.pipe(D(this.destroy$)).subscribe(e=>{this.voiceAnnounceEnabled=e}),this.preferencesService.voiceMode$.pipe(D(this.destroy$)).subscribe(e=>{this.voiceMode=e}),this.preferencesService.voiceReadFullText$.pipe(D(this.destroy$)).subscribe(e=>{this.voiceReadFullText=e}),this.preferencesService.voiceVolume$.pipe(D(this.destroy$)).subscribe(e=>{this.voiceVolume=Math.round(e*100)}),this.preferencesService.voiceRate$.pipe(D(this.destroy$)).subscribe(e=>{this.voiceRate=Math.round(e*100)}),this.preferencesService.selectedVoice$.pipe(D(this.destroy$)).subscribe(e=>{this.selectedVoiceId=e}),this.preferencesService.voiceLanguage$.pipe(D(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(D(this.destroy$)).subscribe(e=>{this.agentNotificationEnabled=e}),this.preferencesService.notificationSoundEnabled$.pipe(D(this.destroy$)).subscribe(e=>{this.notificationSoundEnabled=e}),this.preferencesService.browserNotificationEnabled$.pipe(D(this.destroy$)).subscribe(e=>{this.browserNotificationEnabled=e,this.checkNotificationPermission()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme(this.selectedTheme)}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage)}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend)}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages)}onShowTechnicalMessagesChange(){let e=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",e,")"),this.preferencesService.setHideTechnicalMessages(e)}onShowWarningMessagesChange(){let e=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",e,")"),this.preferencesService.setHideWarningMessages(e)}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled)}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode)}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText)}onVoiceVolumeChange(){let e=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",e),this.preferencesService.setVoiceVolume(e)}onVoiceRateChange(){let e=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",e),this.preferencesService.setVoiceRate(e)}loadAvailableVoices(){return B(this,null,function*(){this.loadingVoices=!0;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language")}catch(e){console.error("[OPTIONS] Error loading voices:",e),this.availableVoices=[]}finally{this.loadingVoices=!1}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId)}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice()}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled)}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled)}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled)}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-options-panel"]],decls:144,vars:35,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(t,n){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),u(4,"palette"),c(),l(5,"span"),u(6,"Appearance"),c()(),l(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),ie("ngModelChange",function(o){return ne(n.selectedTheme,o)||(n.selectedTheme=o),o}),v("change",function(){return n.onThemeChange()}),c(),F(11,"span",7),u(12," Light "),c(),l(13,"label",5)(14,"input",8),ie("ngModelChange",function(o){return ne(n.selectedTheme,o)||(n.selectedTheme=o),o}),v("change",function(){return n.onThemeChange()}),c(),F(15,"span",7),u(16," Dark "),c(),l(17,"label",5)(18,"input",9),ie("ngModelChange",function(o){return ne(n.selectedTheme,o)||(n.selectedTheme=o),o}),v("change",function(){return n.onThemeChange()}),c(),F(19,"span",7),u(20," System "),c()()()(),l(21,"div",1)(22,"div",2)(23,"mat-icon"),u(24,"chat_bubble_outline"),c(),l(25,"span"),u(26,"Messaging"),c()(),l(27,"div",3)(28,"span",10),u(29,"Send message behavior:"),c(),l(30,"div",4)(31,"label",5)(32,"input",11),ie("ngModelChange",function(o){return ne(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),v("change",function(){return n.onEnterToSendChange()}),c(),F(33,"span",7),u(34," Enter to send "),c(),l(35,"label",5)(36,"input",11),ie("ngModelChange",function(o){return ne(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),v("change",function(){return n.onEnterToSendChange()}),c(),F(37,"span",7),u(38," Enter for new line "),c()()(),l(39,"div",3)(40,"div",12)(41,"span",10),u(42,"Show technical messages"),c(),l(43,"mat-slide-toggle",13),ie("ngModelChange",function(o){return ne(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),v("change",function(){return n.onShowTechnicalMessagesChange()}),c()()(),l(44,"div",3)(45,"div",12)(46,"span",10),u(47,"Show warning messages"),c(),l(48,"mat-slide-toggle",13),ie("ngModelChange",function(o){return ne(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),v("change",function(){return n.onShowWarningMessagesChange()}),c()()(),l(49,"div",3)(50,"div",12)(51,"span",10),u(52,"Include technical messages in print"),c(),l(53,"mat-slide-toggle",13),ie("ngModelChange",function(o){return ne(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),v("change",function(){return n.onPrintTechnicalMessagesChange()}),c()()()(),l(54,"div",1)(55,"div",2)(56,"mat-icon"),u(57,"notifications"),c(),l(58,"span"),u(59,"Notifications"),c()(),l(60,"div",3)(61,"div",12)(62,"span",10),u(63,"Notify when the agent answers or requests input"),c(),l(64,"mat-slide-toggle",13),ie("ngModelChange",function(o){return ne(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),v("change",function(){return n.onAgentNotificationEnabledChange()}),c()()(),l(65,"div",3)(66,"div",12)(67,"span",10),u(68,"Notification sound"),c(),l(69,"mat-slide-toggle",14),ie("ngModelChange",function(o){return ne(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),v("change",function(){return n.onNotificationSoundEnabledChange()}),c()()(),l(70,"div",3)(71,"div",12)(72,"span",10),u(73,"Browser notification"),c(),l(74,"mat-slide-toggle",14),ie("ngModelChange",function(o){return ne(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),v("change",function(){return n.onBrowserNotificationEnabledChange()}),c()(),C(75,Of,5,0,"div",15),c()(),l(76,"div",1)(77,"div",2)(78,"mat-icon"),u(79,"record_voice_over"),c(),l(80,"span"),u(81,"Voice & Speech"),c()(),l(82,"div",3)(83,"label",16),u(84,"Voice recognition language:"),c(),l(85,"select",17),ie("ngModelChange",function(o){return ne(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),v("change",function(){return n.onVoiceLanguageChange()}),we(86,Af,2,3,"option",18,kf),c()(),l(88,"div",3)(89,"span",10),u(90,"Automatic announcement:"),c(),l(91,"div",4)(92,"label",5)(93,"input",19),ie("ngModelChange",function(o){return ne(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),v("change",function(){return n.onVoiceAnnounceEnabledChange()}),c(),F(94,"span",7),u(95," Enabled "),c(),l(96,"label",5)(97,"input",19),ie("ngModelChange",function(o){return ne(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),v("change",function(){return n.onVoiceAnnounceEnabledChange()}),c(),F(98,"span",7),u(99," Disabled "),c()()(),l(100,"div",3)(101,"span",10),u(102,"Voice mode:"),c(),l(103,"div",4)(104,"label",5)(105,"input",20),ie("ngModelChange",function(o){return ne(n.voiceMode,o)||(n.voiceMode=o),o}),v("change",function(){return n.onVoiceModeChange()}),c(),F(106,"span",7),u(107," Voice synthesis "),c(),l(108,"label",5)(109,"input",21),ie("ngModelChange",function(o){return ne(n.voiceMode,o)||(n.voiceMode=o),o}),v("change",function(){return n.onVoiceModeChange()}),c(),F(110,"span",7),u(111," Sound notification "),c()()(),l(112,"div",3)(113,"span",10),u(114,"Message reading:"),c(),l(115,"div",4)(116,"label",5)(117,"input",22),ie("ngModelChange",function(o){return ne(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),v("change",function(){return n.onVoiceReadFullTextChange()}),c(),F(118,"span",7),u(119," Full message "),c(),l(120,"label",5)(121,"input",22),ie("ngModelChange",function(o){return ne(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),v("change",function(){return n.onVoiceReadFullTextChange()}),c(),F(122,"span",7),u(123," First paragraphs only "),c()()(),l(124,"div",3)(125,"label",23),u(126,"Selected voice:"),c(),l(127,"select",24),ie("ngModelChange",function(o){return ne(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),v("change",function(){return n.onSelectedVoiceChange()}),C(128,If,2,0,"option",25),C(129,Df,2,0,"option",25),we(130,Rf,2,2,"option",18,Pf),c(),F(132,"div",10),l(133,"a",26),v("click",function(){return n.testVoice()}),l(134,"span",27),u(135,"Test voice"),c()()(),l(136,"div",3)(137,"label",28),u(138),c(),l(139,"input",29),ie("ngModelChange",function(o){return ne(n.voiceVolume,o)||(n.voiceVolume=o),o}),v("input",function(){return n.onVoiceVolumeChange()}),c()(),l(140,"div",3)(141,"label",30),u(142),c(),l(143,"input",31),ie("ngModelChange",function(o){return ne(n.voiceRate,o)||(n.voiceRate=o),o}),v("input",function(){return n.onVoiceRateChange()}),c()()()()),t&2&&(p(10),te("ngModel",n.selectedTheme),p(4),te("ngModel",n.selectedTheme),p(4),te("ngModel",n.selectedTheme),p(14),T("value",!0),te("ngModel",n.useEnterToSend),p(4),T("value",!1),te("ngModel",n.useEnterToSend),p(7),te("ngModel",n.showTechnicalMessages),p(5),te("ngModel",n.showWarningMessages),p(5),te("ngModel",n.printTechnicalMessages),p(11),te("ngModel",n.agentNotificationEnabled),p(5),te("ngModel",n.notificationSoundEnabled),T("disabled",!n.agentNotificationEnabled),p(5),te("ngModel",n.browserNotificationEnabled),T("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),p(),S(n.browserNotificationDenied?75:-1),p(10),te("ngModel",n.selectedVoiceLanguage),p(),Te(n.voiceLanguageOptions),p(7),T("value",!0),te("ngModel",n.voiceAnnounceEnabled),p(4),T("value",!1),te("ngModel",n.voiceAnnounceEnabled),p(8),te("ngModel",n.voiceMode),p(4),te("ngModel",n.voiceMode),p(8),T("value",!0),te("ngModel",n.voiceReadFullText),p(4),T("value",!1),te("ngModel",n.voiceReadFullText),p(6),te("ngModel",n.selectedVoiceId),T("disabled",n.loadingVoices||n.availableVoices.length===0),p(),S(n.loadingVoices?128:-1),p(),S(!n.loadingVoices&&n.availableVoices.length===0?129:-1),p(),Te(n.availableVoices),p(8),Ne("Volume: ",n.voiceVolume,"%"),p(),te("ngModel",n.voiceVolume),p(3),Ne("Speed: ",n.voiceRate,"%"),p(),te("ngModel",n.voiceRate))},dependencies:[lt,Jl,Zl,_t,Kl,Xl,Ql,at,st,se,mc],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}']})};var Nf=(i,e)=>({subThreads:i,depth:e}),Ff=i=>({subThreads:i,depth:1}),kp=(i,e)=>e.id,Lf=(i,e)=>e.label;function jf(i,e){if(i&1){let t=O();l(0,"mat-icon",10),v("click",function(r){x(t);let o=h().$implicit,a=h(3);return w(a.toggleSubThreads(r,o.id))}),u(1),c()}if(i&2){let t=h().$implicit,n=h(3);p(),L(n.isParentExpanded(t.id)?"expand_more":"chevron_right")}}function Vf(i,e){i&1&&An(0)}function zf(i,e){if(i&1&&un(0,Vf,1,0,"ng-container",11),i&2){let t=h().$implicit,n=h().depth;h();let r=In(1);T("ngTemplateOutlet",r)("ngTemplateOutletContext",yl(2,Nf,t.subThreads,n+1))}}function $f(i,e){if(i&1){let t=O();l(0,"div",5)(1,"a",6),v("click",function(r){let o=x(t).$implicit;return h(3).selectThread(o.id),w(r.preventDefault())})("keydown.enter",function(r){let o=x(t).$implicit;return h(3).selectThread(o.id),w(r.preventDefault())})("keydown.space",function(r){let o=x(t).$implicit;return h(3).selectThread(o.id),w(r.preventDefault())}),C(2,jf,2,1,"mat-icon",7),l(3,"span",8),u(4),c(),l(5,"span",9),u(6),c()()(),C(7,zf,1,5,"ng-container")}if(i&2){let t,n=e.$implicit,r=h().depth,o=h(2);Ke("--sub-depth",r),Y("current",n.id===((t=o.currentThread())==null?null:t.id)),p(2),S(n.subThreads!=null&&n.subThreads.length?2:-1),p(2),L(n.delegatedAgentName||"Agent"),p(2),L(n.delegatedTask||n.name),p(),S(o.isParentExpanded(n.id)&&(n.subThreads!=null&&n.subThreads.length)?7:-1)}}function Bf(i,e){if(i&1&&we(0,$f,8,8,null,null,kp),i&2){let t=e.subThreads;Te(t)}}function Hf(i,e){i&1&&(l(0,"div",4),F(1,"span",12),l(2,"span",13),u(3,"Loading threads..."),c()())}function Uf(i,e){if(i&1&&(l(0,"div",25),u(1),c()),i&2){let t=h(6);p(),L(t.renameErrorMessage)}}function Wf(i,e){if(i&1){let t=O();l(0,"div",18)(1,"input",24),ie("ngModelChange",function(r){x(t);let o=h(5);return ne(o.editingThreadName,r)||(o.editingThreadName=r),w(r)}),v("keydown",function(r){x(t);let o=h(5);return w(o.onEditKeydown(r))})("blur",function(){x(t);let r=h(5);return w(r.onEditBlur())})("click",function(r){return r.stopPropagation()}),c(),C(2,Uf,2,1,"div",25),c()}if(i&2){let t=h(5);p(),te("ngModel",t.editingThreadName),T("disabled",t.isRenamingThread),p(),S(t.renameErrorMessage?2:-1)}}function qf(i,e){if(i&1){let t=O();l(0,"mat-icon",10),v("click",function(r){x(t);let o=h(2).$implicit,a=h(4);return w(a.toggleSubThreads(r,o.id))}),u(1),c()}if(i&2){let t=h(2).$implicit,n=h(4);p(),L(n.isParentExpanded(t.id)?"expand_more":"chevron_right")}}function Gf(i,e){if(i&1&&(l(0,"span",27),u(1),c()),i&2){let t=h(2).$implicit;p(),L(t.name)}}function Yf(i,e){i&1&&(F(0,"mat-spinner",29),l(1,"span",30),u(2,"Generating name..."),c()),i&2&&T("diameter",16)}function Qf(i,e){i&1&&(l(0,"mat-icon",28),u(1,"group"),c())}function Kf(i,e){if(i&1){let t=O();l(0,"a",26),v("click",function(r){x(t);let o=h().$implicit;return h(4).selectThread(o.id),w(r.preventDefault())})("keydown.enter",function(r){x(t);let o=h().$implicit;return h(4).selectThread(o.id),w(r.preventDefault())})("keydown.space",function(r){x(t);let o=h().$implicit;return h(4).selectThread(o.id),w(r.preventDefault())}),C(1,qf,2,1,"mat-icon",7),C(2,Gf,2,1,"span",27)(3,Yf,3,1),C(4,Qf,2,0,"mat-icon",28),c()}if(i&2){let t=h().$implicit,n=h(4);T("matTooltip",t.name?t.name+`
|
|
360
360
|
|
|
361
|
-
`+(t.summary||""):t.summary||"")("matTooltipDisabled",!t.summary),p(),S(t.subThreads!=null&&t.subThreads.length?1:-1),p(),S(t.name?2:3),p(2),S(n.isSharedThread(t)?4:-1)}}function Xf(i,e){if(i&1){let t=O();l(0,"button",31),v("click",function(r){x(t);let o=h().$implicit,a=h(4);return w(a.startEditingThreadName(r,o))}),l(1,"mat-icon"),u(2,"edit"),c()()}}function Jf(i,e){i&1&&An(0)}function Zf(i,e){if(i&1&&un(0,Jf,1,0,"ng-container",11),i&2){let t=h().$implicit;h(3);let n=In(1);T("ngTemplateOutlet",n)("ngTemplateOutletContext",Ar(2,Ff,t.subThreads))}}function e0(i,e){if(i&1){let t=O();l(0,"div",17),C(1,Wf,3,3,"div",18)(2,Kf,5,5,"a",19),l(3,"div",20),C(4,Xf,3,0,"button",21),l(5,"button",22),v("click",function(r){let o=x(t).$implicit,a=h(4);return w(a.toggleStar(r,o))}),l(6,"mat-icon"),u(7),c()(),l(8,"button",23),v("click",function(r){let o=x(t).$implicit,a=h(4);return w(a.deleteThread(r,o))}),l(9,"mat-icon"),u(10,"delete"),c()()()(),C(11,Zf,1,4,"ng-container")}if(i&2){let t,n=e.$implicit,r=h(4);Y("current",n.id===((t=r.currentThread())==null?null:t.id)),p(),S(r.editingThreadId===n.id?1:2),p(3),S(r.editingThreadId!==n.id&&n.name?4:-1),p(),Y("starred",r.isStarred(n)),T("title",r.isStarred(n)?"Unstar thread":"Star thread"),p(2),L(r.isStarred(n)?"star":"star_outline"),p(4),S(r.isParentExpanded(n.id)&&(n.subThreads!=null&&n.subThreads.length)?11:-1)}}function t0(i,e){if(i&1&&(l(0,"div",14)(1,"div",16),u(2),c(),we(3,e0,12,9,null,null,kp),c()),i&2){let t=e.$implicit;p(2),L(t.label),p(),Te(t.threads)}}function n0(i,e){i&1&&(l(0,"div",15),u(1,"No existing threads"),c())}function i0(i,e){if(i&1&&(l(0,"div",15),u(1),c()),i&2){let t=h(3);p(),Ne('No threads matching "',t.searchQuery(),'"')}}function r0(i,e){if(i&1&&(we(0,t0,5,1,"div",14,Lf),C(2,n0,2,0,"div",15)(3,i0,2,1,"div",15)),i&2){let t,n=h(2);Te(n.getGroupedThreads()),p(2),S(!((t=n.threads())!=null&&t.length)&&!n.searchQuery()?2:n.searchQuery()&&n.getGroupedThreads().length===0?3:-1)}}function o0(i,e){if(i&1&&(un(0,Bf,2,0,"ng-template",null,0,ai),l(2,"div",3),C(3,Hf,4,0,"div",4)(4,r0,4,1),c()),i&2){let t=h();p(3),S(t.isLoadingThreadList()?3:4)}}function a0(i,e){i&1&&(l(0,"span",32),u(1,"No project selected"),c())}function s0(i,e){i&1&&(l(0,"span",32),u(1,"Loading..."),c())}function l0(i,e){if(i&1&&(l(0,"div",2),C(1,a0,2,0,"span",32)(2,s0,2,0,"span",32),c()),i&2){let t,n=h();p(),S((t=n.currentProject())!=null&&t.name?2:1)}}var ta=class i{projects=null;searchMode=!1;searchQuery=Ir("");searchModeChange=new Z;threadSelected=new Z;projectStateService=f(ye);threadStateService=f(Ye);threadApiService=f(Yt);userService=f(Qt);router=f(zt);destroyRef=f(ri);currentThread=Ie(this.threadStateService.selectedThread$);currentProject=Ie(this.projectStateService.selectedProject$);threads=Ie(this.threadStateService.threadList$);isLoadingThreadList=Ie(this.threadStateService.isLoadingThreadList$);username=Ie(this.userService.username$);isTouchDevice="ontouchstart"in window||navigator.maxTouchPoints>0;editingThreadId=null;editingThreadName="";isRenamingThread=!1;renameErrorMessage="";expandedParents=new Set;constructor(){Hi(()=>{let e=this.currentThread()?.id,t=this.threads();if(!e||!t?.length)return;let n=new Map;for(let o of t)o.parentThreadId&&n.set(o.id,o.parentThreadId);let r=e;for(;r;){let o=n.get(r);o&&this.expandedParents.add(o),r=o}})}ngOnInit(){this.userService.fetchCurrentUser().subscribe({error:e=>{console.error("[THREAD-SELECTOR] Failed to load current user:",e)}})}selectThread(e){this.threadStateService.selectThread(e),this.threadSelected.emit(),this.router.navigate(["project",this.currentProject()?.name,"thread",e])}getGroupedThreads(){let e=this.threads();if(!e?.length)return[];let t=new Set(e.map(N=>N.id)),n=e.filter(N=>!N.parentThreadId),r=e.filter(N=>!!N.parentThreadId),o=r.filter(N=>!t.has(N.parentThreadId)),a=r.filter(N=>t.has(N.parentThreadId)),s=new Map;for(let N of a){let X=N.parentThreadId;s.has(X)||s.set(X,[]),s.get(X).push(N)}let d=N=>(s.get(N)||[]).sort((U,Ee)=>U.modifiedDate>Ee.modifiedDate?-1:1).map(U=>he(G({},U),{subThreads:d(U.id)})),m=[...n,...o];if(this.searchQuery()&&this.searchQuery().trim()){let N=this.searchQuery().toLowerCase().trim();m=m.filter(X=>X.name.toLowerCase().includes(N)||X.summary&&X.summary.toLowerCase().includes(N))}if(!m.length)return[];let _=this.username();if(!_)return[];let b=m.map(N=>he(G({},N),{subThreads:d(N.id)})),y=b.filter(N=>N.starring&&N.starring.includes(_)),k=b.filter(N=>!N.starring||!N.starring.includes(_)),E=new Map,P=new Date;P.setHours(0,0,0,0);for(let N of k){let X=new Date(N.modifiedDate);X.setHours(0,0,0,0);let U=P.getTime()-X.getTime(),Ee=Math.floor(U/(1e3*60*60*24)),de;Ee===0?de="Today":Ee===1?de="Yesterday":Ee<7?de="This Week":Ee<30?de="This Month":Ee<90?de="Last 3 Months":de="Older",E.has(de)||E.set(de,[]),E.get(de).push(N)}let K=[];if(y.length>0){let N=[...y].sort((X,U)=>X.modifiedDate>U.modifiedDate?-1:1);K.push({label:"Starred",threads:N})}return["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(N=>E.has(N)).forEach(N=>{K.push({label:N,threads:E.get(N)})}),K}isParentExpanded(e){return this.expandedParents.has(e)}toggleSubThreads(e,t){e.stopPropagation(),this.expandedParents.has(t)?this.expandedParents.delete(t):this.expandedParents.add(t)}isSubThread(e){return!!e.parentThreadId}isSharedThread(e){return e.users&&e.users.length>1}isStarred(e){let t=this.username();return!!t&&e.starring&&e.starring.includes(t)}toggleStar(e,t){e.stopPropagation();let n=this.username();if(!n)return;let r=t.starring&&t.starring.includes(n),o=r?this.threadApiService.unstarThread(t.id):this.threadApiService.starThread(t.id);this.threadStateService.updateStarLocal(t.id,!r,n),o.pipe(ot(this.destroyRef)).subscribe({next:()=>{},error:a=>{console.error("Error toggling star:",a),this.threadStateService.refreshThreadList()}})}deleteThread(e,t){e.stopPropagation();let n=this.currentProject()?.name;!n||!confirm(`Are you sure you want to delete the thread "${t.name}"?`)||this.threadApiService.deleteThread(t.id).subscribe({next:()=>{this.currentThread()?.id===t.id&&(this.threadStateService.clearSelection(),this.router.navigate(["project",n])),this.threadStateService.refreshThreadList()},error:o=>{console.error("Error deleting thread:",o),alert("Failed to delete thread. Please try again.")}})}formatDate(e){try{let t=new Date(e),r=new Date().getTime()-t.getTime(),o=Math.floor(r/(1e3*60*60*24));return o===0?"Today":o===1?"Yesterday":o<7?`${o} days ago`:t.toLocaleDateString("en-EN",{day:"numeric",month:"short"})}catch(t){return"No date"}}startEditingThreadName(e,t){e.stopPropagation(),this.editingThreadId=t.id,this.editingThreadName=t.name||"",this.renameErrorMessage="",setTimeout(()=>{let n=document.querySelector(".thread-name-input");n&&(n.focus(),n.select())},0)}cancelEditingThreadName(){this.editingThreadId=null,this.editingThreadName="",this.renameErrorMessage=""}saveThreadName(e){if(e&&e.stopPropagation(),!this.editingThreadId)return;let t=this.editingThreadName.trim();if(!t){this.renameErrorMessage="Thread name cannot be empty";return}if(t.length>200){this.renameErrorMessage="Thread name is too long (max 200 characters)";return}let n=this.editingThreadId;this.isRenamingThread=!0,this.renameErrorMessage="",this.threadStateService.renameThread(n,t).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=!1},error:r=>{console.error("[THREAD-SELECTOR] Error renaming thread:",r),this.renameErrorMessage=r.message||"Failed to rename thread",this.isRenamingThread=!1}})}onEditKeydown(e){e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.saveThreadName()):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this.cancelEditingThreadName())}onEditBlur(){setTimeout(()=>{this.editingThreadId&&!this.isRenamingThread&&this.saveThreadName()},200)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-thread-selector"]],inputs:{searchMode:"searchMode",searchQuery:[1,"searchQuery"]},outputs:{searchModeChange:"searchModeChange",threadSelected:"threadSelected"},decls:3,vars:1,consts:[["subThreadTemplate",""],["tabindex","0","role","application","aria-label","Thread selector",1,"thread-selector",3,"click","keydown"],[1,"thread-disabled"],["role","menu","aria-label","Thread selection",1,"thread-list"],[1,"thread-loading"],[1,"thread-item-wrapper","sub-thread"],["role","menuitem","tabindex","0",1,"thread-item","sub-thread-item",3,"click","keydown.enter","keydown.space"],[1,"sub-thread-toggle"],[1,"sub-thread-agent"],[1,"sub-thread-task"],[1,"sub-thread-toggle",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"loading-spinner"],[1,"loading-text"],[1,"thread-group"],[1,"thread-empty"],[1,"thread-group-header"],[1,"thread-item-wrapper"],[1,"thread-name-edit-wrapper"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"matTooltip","matTooltipDisabled"],[1,"action-buttons"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button"],["mat-icon-button","","type","button",1,"action-button","star-button",3,"click","title"],["mat-icon-button","","title","Delete thread","type","button",1,"action-button","delete-button",3,"click"],["type","text","maxlength","200",1,"thread-name-input",3,"ngModelChange","keydown","blur","click","ngModel","disabled"],[1,"rename-error"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"click","keydown.enter","keydown.space","matTooltip","matTooltipDisabled"],[1,"thread-name"],["matTooltip","Shared thread",1,"shared-indicator"],[1,"thread-name-spinner",3,"diameter"],[1,"thread-name","thread-name-generating"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button",3,"click"],[1,"disabled-text"]],template:function(t,n){if(t&1&&(l(0,"div",1),v("click",function(o){return o.stopPropagation()})("keydown",function(o){return o.stopPropagation()}),C(1,o0,5,1)(2,l0,3,1,"div",2),c()),t&2){let r;p(),S((r=n.currentProject())!=null&&r.name?1:2)}},dependencies:[Lr,lt,_t,at,ec,st,ke,se,Ge,ze,oc,rc,wi,xi,Qr,nc],styles:[".thread-selector[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1;min-height:0;overflow-x:hidden;overflow-y:auto}.thread-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:0;max-height:none;overflow:visible}.thread-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-bottom:.5rem}.thread-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.thread-group-header[_ngcontent-%COMP%]{padding:.5rem 1rem .25rem;font-size:.75rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.5px;position:sticky;top:0;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);z-index:1}.thread-item-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;position:relative;width:100%;border-radius:0;min-width:0;gap:.25rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%]{display:flex}.thread-item-wrapper.current[_ngcontent-%COMP%]{background:var(--color-primary-light)}.thread-item-wrapper.current[_ngcontent-%COMP%] .thread-item[_ngcontent-%COMP%]{color:var(--color-primary-text);font-weight:600}.thread-item[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1;min-width:0;padding:.75rem 1rem;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);text-align:left;justify-content:flex-start}.thread-item.new-thread-item[_ngcontent-%COMP%]{margin-bottom:.25rem}.thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.action-buttons[_ngcontent-%COMP%]{display:none;align-items:center;gap:.25rem;flex-shrink:0;margin-right:.5rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%], .thread-item-wrapper.current[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%]{display:flex}.action-button[_ngcontent-%COMP%]{flex-shrink:0;border-radius:4px!important;width:28px!important;height:28px!important;padding:0!important}.action-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple{border-radius:4px!important}.action-button[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)!important}.action-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%]:hover{background-color:var(--color-primary-hover)!important}.action-button.edit-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.action-button.star-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:color .2s ease}.action-button.star-button.starred[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.star-button[_ngcontent-%COMP%]:not(.starred):hover mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.delete-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:#ef4444}.thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.875rem;font-weight:400;padding:0 1rem;min-width:0}.thread-link[_ngcontent-%COMP%]:hover:not(.new-thread-link){color:var(--color-primary-hover, var(--color-primary));text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}.thread-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.thread-link.new-thread-link[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:600;font-size:.95rem}.thread-link.new-thread-link[_ngcontent-%COMP%] .thread-name[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0 center}50%{background-position:100% center}to{background-position:0 center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.thread-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}.thread-name.thread-name-generating[_ngcontent-%COMP%]{color:var(--color-text-muted);font-style:italic}.thread-name-edit-wrapper[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:0 .5rem}.thread-name-input[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-bg-secondary);color:var(--color-text-primary);font-size:.9rem;font-family:inherit}.thread-name-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 2px #3b82f61a}.thread-name-input[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.rename-error[_ngcontent-%COMP%]{color:var(--color-error);font-size:.75rem;margin-top:.25rem;padding-left:.5rem}.thread-name-spinner[_ngcontent-%COMP%]{flex-shrink:0;margin-right:.5rem}.thread-name-spinner[_ngcontent-%COMP%] .mat-mdc-progress-spinner circle{stroke:var(--color-primary)!important}.current-indicator[_ngcontent-%COMP%]{color:var(--color-success);font-weight:700;flex-shrink:0;font-size:1rem}.thread-separator[_ngcontent-%COMP%]{height:1px;background:var(--color-border);margin:.25rem 0}.thread-empty[_ngcontent-%COMP%]{padding:1.5rem 1rem;text-align:center;color:var(--color-text-muted);font-size:.8rem;font-style:italic}.thread-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1rem;gap:.75rem}.thread-loading[_ngcontent-%COMP%] .loading-spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}.thread-loading[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{color:var(--color-text-muted);font-size:.8rem}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.thread-disabled[_ngcontent-%COMP%]{padding:1.5rem 1rem}.thread-disabled[_ngcontent-%COMP%] .disabled-text[_ngcontent-%COMP%]{display:block;color:var(--color-text-muted);font-size:.85rem;font-style:italic;text-align:center}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%]{padding-left:calc(.2rem + var(--sub-depth, 1) * 1.5rem);border-left:2px solid var(--color-primary, #3b82f6);margin-left:.75rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]{padding:.35rem .5rem .35rem 0;gap:.2rem;font-size:.8rem;color:var(--color-text-secondary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-agent[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary);white-space:nowrap;flex-shrink:0;font-size:.8rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-task[_ngcontent-%COMP%]{color:var(--color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.75rem}.sub-thread-toggle[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex-shrink:0;cursor:pointer;color:var(--color-text-secondary);margin-right:.25rem}.sub-thread-toggle[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.shared-indicator[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--color-text-secondary);flex-shrink:0;margin-left:.25rem}@media(max-width:768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"]})};var c0=["logsContent"],d0=(i,e)=>e.name;function p0(i,e){if(i&1){let t=O();l(0,"button",12),v("click",function(){x(t);let r=h().$implicit,o=h();return w(o.start(r.name))}),l(1,"mat-icon"),u(2,"play_arrow"),c()()}if(i&2){let t=h().$implicit;T("disabled",t.isLoading)}}function m0(i,e){if(i&1){let t=O();l(0,"button",13),v("click",function(){x(t);let r=h().$implicit,o=h();return w(o.stop(r.name))}),l(1,"mat-icon"),u(2,"stop"),c()()}if(i&2){let t=h().$implicit;T("disabled",t.isLoading)}}function u0(i,e){if(i&1&&(l(0,"a",8)(1,"mat-icon",14),u(2,"open_in_new"),c()()),i&2){let t=h().$implicit;T("href",t.url,On)("title",t.url)}}function h0(i,e){if(i&1&&(l(0,"div",15),u(1),c()),i&2){let t=h(),n=t.$implicit,r=t.$index;Ke("order",r*2),p(),L(n.errorMessage)}}function g0(i,e){if(i&1){let t=O();l(0,"button",21),v("click",function(){x(t);let r=h(3);return w(r.onManualRefresh())}),l(1,"mat-icon"),u(2,"refresh"),c()()}}function f0(i,e){if(i&1&&(l(0,"div",16)(1,"div",17)(2,"span",18),u(3),c(),C(4,g0,3,0,"button",19),c(),l(5,"pre",20,0),u(7),c()()),i&2){let t=h(),n=t.$implicit,r=t.$index,o=h();Ke("order",r*2+1),p(3),Ne("",n.name," logs"),p(),S(n.status==="running"?4:-1),p(3),L(o.logs()||"(empty)")}}function _0(i,e){if(i&1){let t=O();l(0,"div",2)(1,"span",3),u(2),c(),l(3,"div",4),C(4,p0,3,1,"button",5)(5,m0,3,1,"button",6),l(6,"span",7),u(7),c(),C(8,u0,3,2,"a",8),l(9,"button",9),v("click",function(){let r=x(t).$implicit,o=h();return w(o.toggleLogs(r.name))}),l(10,"mat-icon"),u(11),c()()()(),C(12,h0,2,3,"div",10),C(13,f0,8,5,"div",11)}if(i&2){let t=e.$implicit,n=e.$index,r=h();Ke("order",n*2),p(2),L(t.name),p(2),S(t.status==="stopped"?4:5),p(2),Y("running",t.status==="running"),p(),Ne(" ",t.status==="running"?"Running":"Stopped"," "),p(),S(t.url?8:-1),p(),T("title",r.logsOpenFor()===t.name?"Hide logs":"Show logs"),p(2),L(r.logsOpenFor()===t.name?"expand_less":"terminal"),p(),S(t.errorMessage?12:-1),p(),S(r.logsOpenFor()===t.name?13:-1)}}var na=class i{destroyRef=f(ri);projectApi=f(Yr);projectName=Ir.required();entryStates=qe([]);hasPreview=Tt(()=>this.entryStates().length>0);logsOpenFor=qe(null);logs=qe("");logsContent;logsPollTimer=null;logsTimeoutTimer=null;static LOGS_POLL_MS=5e3;static LOGS_TIMEOUT_MS=1200*1e3;constructor(){Hi(()=>{let e=this.projectName();e&&this.onProjectChanged(e)},{allowSignalWrites:!0}),Hi(()=>{console.log("entry states",this.entryStates())})}ngOnDestroy(){this.stopLogPolling()}onProjectChanged(e){this.stopLogPolling(),this.entryStates.set([]),this.logsOpenFor.set(null),this.logs.set(""),this.projectApi.getPreviewEntries(e).pipe(ot(this.destroyRef)).subscribe({next:t=>{let n=t.entries;if(n.length===0)return;let r=n.map(a=>({name:a.name,command:a.command,url:a.url,status:"stopped",isLoading:!1,errorMessage:""}));this.entryStates.set(r);let o=n.map(a=>this.projectApi.getPreviewStatus(e,a.name));ol(o).pipe(ot(this.destroyRef)).subscribe({next:a=>{this.entryStates.update(s=>s.map((d,m)=>{let _=a[m];return _?he(G({},d),{status:_.status}):d}))},error:()=>{}})},error:()=>{}})}start(e){this.updateEntry(e,{isLoading:!0,errorMessage:""}),this.projectApi.startPreview(this.projectName(),e).pipe(ot(this.destroyRef)).subscribe({next:t=>{this.updateEntry(e,{status:t.status,isLoading:!1})},error:t=>{this.updateEntry(e,{errorMessage:t?.error?.error??"Failed to start preview",isLoading:!1})}})}stop(e){this.updateEntry(e,{isLoading:!0,errorMessage:""}),this.projectApi.stopPreview(this.projectName(),e).pipe(ot(this.destroyRef)).subscribe({next:()=>{this.updateEntry(e,{status:"stopped",isLoading:!1}),this.logsOpenFor()===e&&this.stopLogPolling()},error:t=>{this.updateEntry(e,{errorMessage:t?.error?.error??"Failed to stop preview",isLoading:!1})}})}toggleLogs(e){this.logsOpenFor()===e?(this.logsOpenFor.set(null),this.logs.set(""),this.stopLogPolling()):(this.logsOpenFor.set(e),this.refreshLogs(),this.startLogPolling())}onManualRefresh(){this.refreshLogs(),this.logsPollTimer&&this.resetLogsTimeout()}refreshLogs(){let e=this.logsOpenFor();e&&this.projectApi.getPreviewLogs(this.projectName(),e).pipe(ot(this.destroyRef)).subscribe({next:t=>{this.logs.set(t.logs),this.scrollLogsToBottom()},error:()=>this.logs.set("(failed to load logs)")})}updateEntry(e,t){this.entryStates.update(n=>n.map(r=>r.name===e?G(G({},r),t):r))}startLogPolling(){this.stopLogPolling(),this.logsPollTimer=setInterval(()=>{this.logsOpenFor()?this.refreshLogs():this.stopLogPolling()},i.LOGS_POLL_MS),this.resetLogsTimeout()}stopLogPolling(){this.logsPollTimer&&(clearInterval(this.logsPollTimer),this.logsPollTimer=null),this.logsTimeoutTimer&&(clearTimeout(this.logsTimeoutTimer),this.logsTimeoutTimer=null)}resetLogsTimeout(){this.logsTimeoutTimer&&clearTimeout(this.logsTimeoutTimer),this.logsTimeoutTimer=setTimeout(()=>{this.stopLogPolling()},i.LOGS_TIMEOUT_MS)}scrollLogsToBottom(){setTimeout(()=>{let e=this.logsContent?.nativeElement;e&&(e.scrollTop=e.scrollHeight)})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-preview-panel"]],viewQuery:function(t,n){if(t&1&&Be(c0,5),t&2){let r;ge(r=fe())&&(n.logsContent=r.first)}},inputs:{projectName:[1,"projectName"]},decls:3,vars:0,consts:[["logsContent",""],[1,"preview-panel"],[1,"entry-row"],[1,"entry-name"],[1,"entry-actions"],["mat-icon-button","","title","Start","type","button",1,"entry-btn","start",3,"disabled"],["mat-icon-button","","title","Stop","type","button",1,"entry-btn","stop",3,"disabled"],[1,"status-pill"],["target","_blank","rel","noopener noreferrer",1,"preview-url",3,"href","title"],["mat-icon-button","","type","button",1,"entry-btn","logs",3,"click","title"],[1,"preview-error",3,"order"],[1,"logs-container",3,"order"],["mat-icon-button","","title","Start","type","button",1,"entry-btn","start",3,"click","disabled"],["mat-icon-button","","title","Stop","type","button",1,"entry-btn","stop",3,"click","disabled"],[1,"link-icon"],[1,"preview-error"],[1,"logs-container"],[1,"logs-header"],[1,"logs-title"],["mat-icon-button","","title","Refresh logs","type","button",1,"entry-btn"],[1,"logs-content"],["mat-icon-button","","title","Refresh logs","type","button",1,"entry-btn",3,"click"]],template:function(t,n){t&1&&(l(0,"div",1),we(1,_0,14,12,null,null,d0),c()),t&2&&(p(),Te(n.entryStates()))},dependencies:[Ge,ze,ke,se],styles:["[_nghost-%COMP%]{display:block}.preview-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:.25rem 0}.entry-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;padding:.125rem .5rem;min-height:36px}.entry-name[_ngcontent-%COMP%]{font-size:.82rem;font-weight:500;color:var(--on-surface, #e0e0e0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;min-width:0}.entry-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0}.entry-btn[_ngcontent-%COMP%]{width:28px!important;height:28px!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center;flex-shrink:0}.entry-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px}.entry-btn.start[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.entry-btn.stop[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#e53935}.entry-btn.logs[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px;color:var(--color-text-secondary)}.entry-btn[disabled][_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.status-pill[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:1px 6px;border-radius:12px;font-size:.68rem;font-weight:600;letter-spacing:.02em;flex-shrink:0;min-width:52px;text-align:center;background:var(--color-bg-hover);color:var(--color-text-secondary);border:1px solid var(--color-border)}.status-pill.running[_ngcontent-%COMP%]{background:#22c55e26;color:#16a34a;border-color:#22c55e66}.preview-url[_ngcontent-%COMP%]{display:inline-flex;align-items:center;text-decoration:none;color:var(--color-primary);flex-shrink:0}.preview-url[_ngcontent-%COMP%]:hover{text-decoration:underline}.preview-url[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}.preview-error[_ngcontent-%COMP%]{font-size:.75rem;color:#c00;padding:0 .75rem}.logs-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:.125rem .5rem .25rem;background:var(--color-bg-hover);border-radius:8px;overflow:hidden;border:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.25rem .75rem;border-bottom:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%] .logs-title[_ngcontent-%COMP%]{flex:1;font-size:.72rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.logs-content[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;font-family:Courier New,Courier,monospace;font-size:.72rem;line-height:1.5;color:var(--color-text);white-space:pre-wrap;word-break:break-all;max-height:200px;overflow-y:auto}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:3px}"]})};function b0(i,e){if(i&1&&(l(0,"div",3),u(1),c()),i&2){let t=h();p(),Ne("\u274C ",t.errorMessage)}}var gr=class i{dialogRef=f(Hr);data=f(Ur);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName)}getDefaultTitle(e,t){return e==="user"?"User Configuration":`Project Configuration: ${t||"Unknown"}`}onSave(){this.errorMessage="";let e;try{e=JSON.parse(this.jsonContent)}catch(t){this.errorMessage=`Invalid JSON syntax: ${t instanceof Error?t.message:"Unknown error"}`;return}this.dialogRef.close(e)}onCancel(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(t,n){t&1&&(l(0,"div",0),u(1),l(2,"button",1),v("click",function(){return n.onCancel()}),l(3,"mat-icon"),u(4,"close"),c()()(),l(5,"mat-dialog-content")(6,"textarea",2),ie("ngModelChange",function(o){return ne(n.jsonContent,o)||(n.jsonContent=o),o}),c(),C(7,b0,2,1,"div",3),c(),l(8,"mat-dialog-actions",4)(9,"button",5),v("click",function(){return n.onCancel()}),u(10,"Cancel"),c(),l(11,"button",6),v("click",function(){return n.onSave()}),u(12,"Save"),c()()),t&2&&(p(),Ne(" ",n.title," "),p(5),te("ngModel",n.jsonContent),p(),S(n.errorMessage?7:-1))},dependencies:[it,lt,_t,at,st,se,ze,si,qr,ql,Gr],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{margin-left:auto}mat-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;min-height:400px}.json-textarea[_ngcontent-%COMP%]{flex:1;min-height:300px;max-height:80vh;padding:1rem;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.875rem;line-height:1.5;background:var(--color-code-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:4px;resize:vertical;outline:none;transition:border-color .2s}.json-textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.json-textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.6}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:4px;font-size:.875rem;line-height:1.4;background:#dc26261a;color:#dc2626;border:1px solid rgba(220,38,38,.3)}"]})};var v0=["threadSearchInput"],y0=["*"];function C0(i,e){if(i&1){let t=O();l(0,"button",26),v("click",function(){x(t);let r=h();return w(r.toggle())}),l(1,"mat-icon"),u(2,"menu"),c()(),l(3,"button",27),v("click",function(){x(t);let r=h();return w(r.createNewThread())}),l(4,"mat-icon",10),u(5,"play_circle"),c()()}if(i&2){let t=h();p(3),T("disabled",!t.selectedProjectName())}}function S0(i,e){if(i&1){let t=O();l(0,"div",14)(1,"mat-icon",28),u(2,"search"),c(),l(3,"input",29,0),ie("ngModelChange",function(r){x(t);let o=h();return ne(o.threadSearchQuery,r)||(o.threadSearchQuery=r),w(r)}),v("input",function(){x(t);let r=h();return w(r.onThreadSearchInput())}),c(),l(5,"button",30),v("click",function(){x(t);let r=h();return w(r.closeThreadSearch())}),l(6,"mat-icon"),u(7,"close"),c()()()}if(i&2){let t=h();p(3),te("ngModel",t.threadSearchQuery)}}function x0(i,e){if(i&1){let t=O();l(0,"div",15)(1,"mat-icon",22),u(2,"forum"),c(),l(3,"span",23),u(4,"Threads"),c(),l(5,"button",31),v("click",function(r){x(t);let o=h();return w(o.toggleThreadSearch(r))}),l(6,"mat-icon"),u(7,"search"),c()()()}}function w0(i,e){i&1&&(l(0,"mat-icon",21),u(1,"keyboard_arrow_up"),c())}function T0(i,e){i&1&&(l(0,"mat-icon",22),u(1,"hub"),c())}function E0(i,e){i&1&&(l(0,"mat-icon",21),u(1,"keyboard_arrow_up"),c())}function M0(i,e){i&1&&(l(0,"mat-icon",22),u(1,"tune"),c())}function k0(i,e){i&1&&(l(0,"div",33)(1,"div",37),F(2,"app-options-panel",38),c()())}function P0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(3).openProjectConfig(),r.preventDefault(),w(r.stopPropagation())}),l(2,"mat-icon",22),u(3,"settings_applications"),c(),l(4,"span",23),u(5,"Project Configuration"),c()()()}}function O0(i,e){i&1&&(l(0,"div",32)(1,"a",39)(2,"mat-icon",22),u(3,"settings_applications"),c(),l(4,"span",23),u(5,"Project config (No project)"),c()()())}function A0(i,e){if(i&1&&C(0,P0,6,0,"div",32)(1,O0,6,0,"div",32),i&2){let t=h(2);S(t.selectedProjectName()?0:1)}}function I0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(2).openAgents(),r.preventDefault(),w(r.stopPropagation())}),l(2,"mat-icon",22),u(3,"smart_toy"),c(),l(4,"span",23),u(5,"Agents"),c()()()}}function D0(i,e){i&1&&(l(0,"div",32)(1,"a",39)(2,"mat-icon",22),u(3,"smart_toy"),c(),l(4,"span",23),u(5,"Agents (No project)"),c()()())}function R0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(2).openPrompts(),r.preventDefault(),w(r.stopPropagation())}),l(2,"mat-icon",22),u(3,"description"),c(),l(4,"span",23),u(5,"Prompts"),c()()()}}function N0(i,e){i&1&&(l(0,"div",32)(1,"a",39)(2,"mat-icon",22),u(3,"description"),c(),l(4,"span",23),u(5,"Prompts (No project)"),c()()())}function F0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(2).openSchedulers(),r.preventDefault(),w(r.stopPropagation())}),l(2,"mat-icon",22),u(3,"schedule"),c(),l(4,"span",23),u(5,"Schedulers"),c()()()}}function L0(i,e){i&1&&(l(0,"div",32)(1,"a",39)(2,"mat-icon",22),u(3,"schedule"),c(),l(4,"span",23),u(5,"Schedulers (No project)"),c()()())}function j0(i,e){i&1&&(l(0,"mat-icon",21),u(1,"keyboard_arrow_up"),c())}function V0(i,e){i&1&&(l(0,"mat-icon",22),u(1,"rocket_launch"),c())}function z0(i,e){if(i&1&&(l(0,"div",33),F(1,"app-preview-panel",40),c()),i&2){let t=h(3);p(),T("projectName",t.selectedProjectName())}}function $0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(2).toggleSection("preview"),r.preventDefault(),w(r.stopPropagation())}),C(2,j0,2,0,"mat-icon",21)(3,V0,2,0,"mat-icon",22),l(4,"span",23),u(5,"Preview Server"),c()(),C(6,z0,2,1,"div",33),c()}if(i&2){let t=h(2);Y("expanded",t.expandedSections.preview),p(),Y("active",t.expandedSections.preview),p(),S(t.expandedSections.preview?2:3),p(4),S(t.expandedSections.preview?6:-1)}}function B0(i,e){if(i&1){let t=O();l(0,"div",24)(1,"div",32)(2,"a",20),v("click",function(r){return x(t),h().toggleSection("config"),w(r.preventDefault())}),C(3,E0,2,0,"mat-icon",21)(4,M0,2,0,"mat-icon",22),l(5,"span",23),u(6,"Preferences"),c()(),C(7,k0,3,0,"div",33),c(),l(8,"div",32)(9,"a",20),v("click",function(r){return x(t),h().openTokenUsage(),r.preventDefault(),w(r.stopPropagation())}),l(10,"mat-icon",22),u(11,"data_usage"),c(),l(12,"span",23),u(13,"Token Usage"),c()()(),l(14,"div",32)(15,"a",20),v("click",function(r){return x(t),h().openUserConfig(),r.preventDefault(),w(r.stopPropagation())}),l(16,"mat-icon",22),u(17,"manage_accounts"),c(),l(18,"span",23),u(19,"User Configuration"),c()()(),C(20,A0,2,1),C(21,I0,6,0,"div",32)(22,D0,6,0,"div",32),C(23,R0,6,0,"div",32)(24,N0,6,0,"div",32),C(25,F0,6,0,"div",32)(26,L0,6,0,"div",32),C(27,$0,7,6,"div",34),l(28,"div",32)(29,"a",35),F(30,"img",36),l(31,"span",23),u(32,"Contribute on GitHub"),c()()()()}if(i&2){let t=h();p(),Y("expanded",t.expandedSections.config),p(),Y("active",t.expandedSections.config),p(),S(t.expandedSections.config?3:4),p(4),S(t.expandedSections.config?7:-1),p(13),S(t.isAdmin?20:-1),p(),S(t.selectedProjectName()?21:22),p(2),S(t.selectedProjectName()?23:24),p(2),S(t.selectedProjectName()?25:26),p(2),S(t.hasPreviewConfig()?27:-1),p(3),Me("src","CODAY-Logo.png",On)}}function H0(i,e){if(i&1){let t=O();l(0,"div",25)(1,"mat-icon",41),u(2,"warning"),c(),l(3,"span",42),u(4),c(),l(5,"button",43),v("click",function(){x(t);let r=h();return w(r.configErrorMessage="")}),l(6,"mat-icon"),u(7,"close"),c()()()}if(i&2){let t=h();p(4),L(t.configErrorMessage)}}var fr=class i{destroy$=new J;sidenavStateChange=new Z;drawerOpen=!1;breakpointObserver=f(Dl);isDesktop=Ie(this.breakpointObserver.observe("(min-width: 1400px)").pipe(Ae(e=>e.matches)),{initialValue:!1});userOpenPreference=qe(!0);isOpen=Tt(()=>this.userOpenPreference());isAdmin=!1;configErrorMessage="";expandedSections={config:!1,preview:!1,settings:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=f(Wr);configApi=f(pc);projectStateService=f(ye);projectApi=f(Yr);router=f(zt);preferences=f(Pe);threadStateService=f(Ye);projects=Ie(this.projectStateService.projectList$);selectedProject=Ie(this.projectStateService.selectedProject$);selectedProjectName=Ie(this.projectStateService.selectedProject$.pipe(Ae(e=>e?.name)));isProjectVolatile=Ie(this.projectStateService.selectedProject$.pipe(Ae(e=>e?.config?.volatile||!1)));forcedProject=Ie(this.projectStateService.forcedProject$);hasPreviewConfig=Ie(this.projectStateService.selectedProject$.pipe(Ae(e=>{let t=e?.config?.preview;return Array.isArray(t)&&!!t.length})),{initialValue:!1});ngOnInit(){let e=window.innerWidth>=1024,t=this.preferences.getPreference("sidenavOpen",e);this.userOpenPreference.set(t??e),this.configApi.getUserConfig().pipe(D(this.destroy$)).subscribe({next:n=>{this.isAdmin=n.groups?.includes("CODAY_ADMIN")??!1,console.log("[SIDENAV] User admin status:",this.isAdmin)},error:n=>{console.error("[SIDENAV] Error loading user config for roles:",n),this.isAdmin=!1}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}toggle(){let e=!this.userOpenPreference();this.userOpenPreference.set(e),this.saveSidenavState(e),this.sidenavStateChange.emit(e)}close(){this.userOpenPreference()&&(this.userOpenPreference.set(!1),this.saveSidenavState(!1),this.sidenavStateChange.emit(!1))}saveSidenavState(e){this.preferences.setPreference("sidenavOpen",e)}openTokenUsage(){this.configErrorMessage="",this.router.navigate(["/token-usage"]),this.close()}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(D(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(gr,{data:{configType:"user",initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(n=>{n&&this.saveUserConfig(n)})},error:e=>{console.error("[SIDENAV] Error loading user config:",e),this.configErrorMessage=e?.error?.error||"Failed to load user configuration"}})}saveUserConfig(e){this.configApi.updateUserConfig(e).pipe(D(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config saved successfully")},error:t=>{console.error("[SIDENAV] Error saving user config:",t),this.configErrorMessage=t?.error?.error||"Failed to save user configuration"}})}openProjectConfig(){let e=this.selectedProjectName();if(!e){console.error("[SIDENAV] No project selected"),this.configErrorMessage="No project selected. Please select a project first.";return}this.configErrorMessage="",this.projectApi.getProjectConfig(e).pipe(D(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(gr,{data:{configType:"project",projectName:e,initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(r=>{r&&this.saveProjectConfig(e,r)})},error:t=>{console.error("[SIDENAV] Error loading project config:",t),this.configErrorMessage=t?.error?.error||"Failed to load project configuration"}})}saveProjectConfig(e,t){this.projectApi.updateProjectConfig(e,t).pipe(D(this.destroy$)).subscribe({next:n=>{console.log("[SIDENAV] Project config saved successfully")},error:n=>{console.error("[SIDENAV] Error saving project config:",n),this.configErrorMessage=n?.error?.error||"Failed to save project configuration"}})}requireProjectSelection(e){return this.selectedProjectName()?!0:(console.error(`[SIDENAV] No project selected, cannot ${e}`),this.configErrorMessage="Please select a project first",!1)}openAgents(){if(!this.requireProjectSelection("open agents"))return;let e=this.selectedProjectName();this.router.navigate(["project",e,"agents"]),this.close()}openPrompts(){if(!this.requireProjectSelection("open prompts"))return;let e=this.selectedProjectName();this.router.navigate(["project",e,"prompts"]),this.close()}openSchedulers(){if(!this.requireProjectSelection("open schedulers"))return;let e=this.selectedProjectName();this.router.navigate(["project",e,"schedulers"]),this.close()}toggleSection(e){let t=this.expandedSections[e];e==="settings"?this.expandedSections[e]=!t:(["config","preview"].forEach(r=>{this.expandedSections[r]=!1}),this.expandedSections[e]=!t)}navigateToHome(){if(this.forcedProject()){console.log("[SIDENAV] Cannot navigate to home - forced project active");return}console.log("[SIDENAV] Navigating to home (project selection)"),this.projectStateService.clearSelection(),this.router.navigate(["/"])}createNewThread(){let e=this.selectedProjectName();if(!e){console.error("[SIDENAV] No project selected, cannot create new thread"),this.configErrorMessage="Please select a project first";return}console.log("[SIDENAV] Navigating to welcome view for new thread"),this.threadStateService.clearSelection(),this.router.navigate(["project",e])}onThreadSelectedOnMobile(){this.isDesktop()||this.close()}toggleThreadSearch(e){e.stopPropagation(),this.isThreadSearchActive=!0,this.threadSearchQuery="",setTimeout(()=>{this.threadSearchInput?.nativeElement.focus()},0)}closeThreadSearch(){this.isThreadSearchActive=!1,this.threadSearchQuery=""}onThreadSearchInput(){}onThreadSearchModeChange(e){e||this.closeThreadSearch()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-sidenav"]],viewQuery:function(t,n){if(t&1&&Be(v0,5),t&2){let r;ge(r=fe())&&(n.threadSearchInput=r.first)}},inputs:{drawerOpen:"drawerOpen"},outputs:{sidenavStateChange:"sidenavStateChange"},ngContentSelectors:y0,decls:34,vars:31,consts:[["threadSearchInput",""],[1,"sidenav-container",3,"hasBackdrop"],["mode","push","position","start",1,"app-sidenav",3,"closed","opened","disableClose"],[1,"sidenav-header"],["mat-icon-button","","title","Close menu",3,"click"],["alt","coday",3,"click","keydown.enter","keydown.space","title"],[1,"header-title-section"],[1,"sidenav-title"],[1,"new-thread-section"],["role","button","tabindex","0",1,"new-thread-link",3,"click"],["fontSet","material-icons-outlined"],[1,"new-thread-text"],[1,"sidenav-sections"],[1,"section-container","expanded"],[1,"search-header"],[1,"section-toggle","active","threads-header"],[1,"section-content","threads"],[1,"sidenav-thread-selector",3,"searchModeChange","threadSelected","searchMode","searchQuery"],[1,"sidenav-nav"],[1,"section-container","settings-group"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content","settings-content"],["role","alert",1,"error-notification"],["mat-icon-button","","title","Menu","type","button",1,"sidenav-toggle-btn",3,"click"],["mat-icon-button","","title","Start a new thread","type","button",1,"sidenav-new-thread-btn",3,"click","disabled"],[1,"search-icon"],["type","text","placeholder","Search threads...",1,"search-input",3,"ngModelChange","input","ngModel"],["mat-icon-button","","title","Close search","type","button",1,"close-search-btn",3,"click"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"section-container"],[1,"section-content"],[1,"section-container",3,"expanded"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"section-toggle","contribute-btn"],["alt","Coday",1,"contribute-logo"],[1,"preference-item"],[1,"inline-panel"],["role","button","tabindex","-1","aria-disabled","true",1,"section-toggle","disabled"],[3,"projectName"],[1,"error-icon"],[1,"error-text"],["mat-icon-button","","aria-label","Close error message",1,"error-close",3,"click"]],template:function(t,n){t&1&&(rn(),C(0,C0,6,1),l(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),v("closed",function(){return n.close()}),l(3,"div",3)(4,"button",4),v("click",function(){return n.close()}),l(5,"mat-icon"),u(6,"chevron_left"),c()(),l(7,"img",5),v("click",function(o){return n.navigateToHome(),o.stopPropagation()})("keydown.enter",function(o){return n.navigateToHome(),o.preventDefault(),o.stopPropagation()})("keydown.space",function(o){return n.navigateToHome(),o.preventDefault(),o.stopPropagation()}),c(),l(8,"div",6)(9,"h2",7),u(10),c()()(),l(11,"div",8)(12,"a",9),v("click",function(o){return n.createNewThread(),o.preventDefault()}),l(13,"mat-icon",10),u(14,"play_circle"),c(),l(15,"span",11),u(16,"Start a new thread"),c()()(),l(17,"div",12)(18,"div",13),C(19,S0,8,1,"div",14)(20,x0,8,0,"div",15),l(21,"div",16)(22,"app-thread-selector",17),v("searchModeChange",function(o){return n.onThreadSearchModeChange(o)})("threadSelected",function(){return n.onThreadSelectedOnMobile()}),c()()()(),l(23,"div",18)(24,"div",19)(25,"a",20),v("click",function(o){return n.toggleSection("settings"),o.preventDefault()}),C(26,w0,2,0,"mat-icon",21)(27,T0,2,0,"mat-icon",22),l(28,"span",23),u(29,"Control Center"),c()(),C(30,B0,33,12,"div",24),c()()(),l(31,"mat-sidenav-content"),ht(32),c()(),C(33,H0,8,1,"div",25)),t&2&&(S(!n.isOpen()&&!n.drawerOpen?0:-1),p(),Y("sidenav-open",n.isOpen()),T("hasBackdrop",!1),p(),T("opened",n.isOpen())("disableClose",!0),p(5),Y("sidenav-logo",!0)("clickable",!n.forcedProject())("disabled",n.forcedProject()),T("title",n.forcedProject()?"Project selection disabled":"Go to project selection"),Me("src","CODAY-Logo.png",On)("role",n.forcedProject()?null:"button")("tabindex",n.forcedProject()?null:"0"),p(3),L(n.selectedProjectName()),p(9),S(n.isThreadSearchActive?19:20),p(3),T("searchMode",n.isThreadSearchActive)("searchQuery",n.threadSearchQuery),p(),Y("is-admin",n.isAdmin),p(),Y("expanded",n.expandedSections.settings),p(),Y("active",n.expandedSections.settings),p(),S(n.expandedSections.settings?26:27),p(4),S(n.expandedSections.settings?30:-1),p(),Y("sidenav-closed-offset",!n.isOpen()),p(2),S(n.configErrorMessage?33:-1))},dependencies:[lt,_t,at,st,Xo,js,Cp,Qo,ke,se,Ge,ze,Ep,Mp,hr,ta,na],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;height:100dvh;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:25%;min-width:320px;height:100dvh!important;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!important;min-width:0;overflow:hidden!important;visibility:hidden!important}.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{width:100%;margin:0!important}@media(min-width:1024px){.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{min-width:0}}[_nghost-%COMP%] .mat-drawer-backdrop{pointer-events:auto}[_nghost-%COMP%] .mat-drawer-content{pointer-events:auto!important;background:transparent!important;overflow:visible!important}[_nghost-%COMP%] .mat-drawer-inner-container{overflow:hidden!important;height:100dvh!important;display:flex!important;flex-direction:column!important}.sidenav-new-thread-btn[_ngcontent-%COMP%], .sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;z-index:1500!important;width:40px!important;height:40px!important;border-radius:50%!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;border:1px solid var(--glass-border)!important;box-shadow:var(--glass-shadow)!important}.sidenav-toggle-btn[_ngcontent-%COMP%]{top:1rem!important;left:1rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{top:calc(1.5rem + 40px)!important;left:1rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled{opacity:.5!important}.sidenav-logo-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:1rem!important;left:1rem!important;z-index:1500!important;width:56px!important;height:56px!important;border-radius:50%!important;border:1px solid var(--glass-border)!important;padding:4px!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;box-shadow:var(--glass-shadow)!important;transition:all .3s cubic-bezier(.4,0,.2,1)!important;cursor:pointer!important;pointer-events:auto!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;text-decoration:none!important}.sidenav-logo-btn[_ngcontent-%COMP%]:hover{transform:scale(1.08) translateY(-2px)!important;box-shadow:0 16px 48px #0003!important;border-color:var(--color-primary)!important}.sidenav-logo-btn[_ngcontent-%COMP%]:active{transform:scale(.96)!important}.sidenav-logo-btn[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:2px}.app-sidenav[_ngcontent-%COMP%]{width:480px;height:100dvh!important;min-height:0!important;position:relative;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border-radius:0;overflow:hidden;overflow-x:hidden!important;display:flex;flex-direction:column}.sidenav-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1.5rem 1rem .5rem;flex-shrink:0}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:4px;flex-shrink:0;transition:all .2s ease}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]{cursor:pointer}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:hover{transform:scale(1.1);filter:drop-shadow(0 4px 12px rgba(0,0,0,.15))}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:active{transform:scale(.95)}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;min-width:0}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%] .sidenav-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.loading-section[_ngcontent-%COMP%]{padding:2rem 1rem;display:flex;align-items:center;justify-content:center}.loading-content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem;align-items:center}.loading-content[_ngcontent-%COMP%] mat-progress-bar[_ngcontent-%COMP%]{width:100%;height:4px;border-radius:2px}.loading-content[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary);text-align:center}.new-thread-section[_ngcontent-%COMP%]{padding:1rem 1rem .5rem;flex-shrink:0}.new-thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.95rem;font-weight:600;padding:0}.new-thread-link[_ngcontent-%COMP%] .new-thread-text[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:focus{transform:scale(1.1)}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.sidenav-sections[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:100px;overflow:hidden}.sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container.expanded[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%] > app-thread-selector[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;flex:1!important;min-height:0!important;overflow:hidden!important}.sidenav-nav[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column;overflow:hidden;max-height:70%;border-top:1px solid var(--color-border)}.sidenav-nav[_ngcontent-%COMP%] > .settings-group[_ngcontent-%COMP%] > .section-toggle.active[_ngcontent-%COMP%]{border-top:none}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-toggle[_ngcontent-%COMP%]{flex-shrink:0}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{padding:0;border-bottom:1px solid var(--color-border);overflow:visible}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%] .section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{max-height:40vh;overflow-y:auto;overflow-x:hidden}.contribute-btn[_ngcontent-%COMP%] .contribute-logo[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:2px;flex-shrink:0}.section-container[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%]{display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{border-bottom:none}.section-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;width:100%;padding:.5rem 1rem;height:50px;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);flex-shrink:0}.section-toggle.active[_ngcontent-%COMP%]{border-top:1px solid var(--color-border)}.section-toggle.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.section-toggle[_ngcontent-%COMP%] .arrow-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);transition:transform .2s ease;transform:rotate(0);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-label[_ngcontent-%COMP%]{flex:1;font-size:.9rem;color:var(--color-text);text-align:left}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-toggle[_ngcontent-%COMP%]:hover:not(.disabled){background:var(--color-bg-hover)}.section-toggle[_ngcontent-%COMP%]:active:not(.disabled){transform:scale(.98)}.section-toggle[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.search-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;height:50px;background:var(--color-bg-hover);border-top:1px solid var(--color-border);transition:all .2s ease}.search-header[_ngcontent-%COMP%] .search-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent;color:var(--color-text);font-size:.9rem;padding:0;min-width:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-muted)}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%]{flex-shrink:0}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-content[_ngcontent-%COMP%]{padding:.5rem 0 0;animation:_ngcontent-%COMP%_slideDown .2s ease;border-bottom:1px solid var(--color-border);display:flex;flex-direction:column}.section-content.threads[_ngcontent-%COMP%]{padding:0;border-bottom:none;flex:1!important;min-height:0!important;overflow:hidden!important}.section-content.threads[_ngcontent-%COMP%] app-thread-selector[_ngcontent-%COMP%]{flex:1!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}@keyframes _ngcontent-%COMP%_slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.config-links[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:.5rem 1rem;margin-bottom:1rem}.sidenav-item[_ngcontent-%COMP%]{width:100%}.sidenav-item[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary)}.sidenav-item[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{flex:1;font-size:.9rem}.sidenav-item[_ngcontent-%COMP%] .disabled-hint[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary);font-style:italic}.sidenav-link.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;color:var(--color-text-secondary)}.sidenav-link.disabled[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.sidenav-link[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%], .sidenav-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-primary)}.sidenav-link[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem}.preference-item[_ngcontent-%COMP%]{padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.preference-item[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem;padding:0 1rem}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.preference-item[_ngcontent-%COMP%] .preference-content[_ngcontent-%COMP%]{padding:0 1rem}.error-notification[_ngcontent-%COMP%]{position:fixed;top:5rem;left:50%;transform:translate(-50%);z-index:2000;display:flex;align-items:center;gap:.75rem;background:#ff3b3026;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid rgba(255,59,48,.3);border-radius:16px;padding:1rem 1.5rem;box-shadow:var(--glass-shadow);animation:_ngcontent-%COMP%_errorSlideDown .3s cubic-bezier(.4,0,.2,1)}.error-notification[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{font-size:1.2rem;flex-shrink:0;color:#c00}.error-notification[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%]{flex:1;color:#c00;font-size:.9rem;font-weight:500}@keyframes _ngcontent-%COMP%_errorSlideDown{0%{opacity:0;transform:translate(-50%,-10px)}to{opacity:1;transform:translate(-50%)}}@media(max-width:480px){.app-sidenav[_ngcontent-%COMP%]{width:320px}.sidenav-toggle-btn[_ngcontent-%COMP%]{top:.75rem!important;left:.75rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{top:calc(1.25rem + 40px)!important;left:.75rem!important}.error-notification[_ngcontent-%COMP%]{left:1rem;right:1rem;transform:none;max-width:calc(100vw - 2rem)}}body.dark[_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .app-sidenav[_ngcontent-%COMP%]{background:#242830f2;border-right-color:#b4c8ff17}body.dark[_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .sidenav-header[_ngcontent-%COMP%]{background:#242830b3}"]})};var ia=class i{destroy$=new J;isSetup=!1;codayService=f(mt);preferencesService=f(Pe);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(D(this.destroy$),ba(),ve(([e,t])=>e===!0&&t===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(D(this.destroy$),ba(),ve(([e,t])=>e===!1&&t===!0)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled()}),this.isSetup=!0}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification())}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),n.gain.setValueAtTime(.1,e.currentTime),n.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let r=e.createOscillator(),o=e.createGain();r.connect(o),o.connect(e.destination);let a=e.currentTime+.11;r.frequency.setValueAtTime(950,a),o.gain.setValueAtTime(.1,a),o.gain.exponentialRampToValueAtTime(.01,a+.09),r.start(a),r.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e)}}handleBrowserNotificationEnabled(){return B(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1))}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(!1)}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification")}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:!1});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:!1});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close()},console.log("[AGENT-NOTIFICATION] Task complete notification sent")}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var U0=["inputSection"];function W0(i,e){if(i&1){let t=O();l(0,"app-thread",4),v("chatFocused",function(){x(t);let r=h();return w(r.onChatFocusedOnMobile())})("drawerStateChange",function(r){x(t);let o=h();return w(o.onDrawerStateChange(r))}),c()}if(i&2){let t=h();T("projectName",t.projectName)("threadId",t.threadId)}}function q0(i,e){if(i&1){let t=O();l(0,"div",5),F(1,"app-welcome-message"),c(),l(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),v("messageSubmitted",function(r){x(t);let o=h();return w(o.onMessageSubmitted(r))})("voiceRecordingToggled",function(r){x(t);let o=h();return w(o.onVoiceToggled(r))})("heightChanged",function(r){x(t);let o=h();return w(o.onInputHeightChanged(r))})("textareaFocused",function(){x(t);let r=h();return w(r.onChatFocusedOnMobile())}),c()()()()}if(i&2){let t=h();p(6),T("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",t.isStartingFirstMessage)}}var _r=class i{destroy$=new J;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=f(mt);titleService=f(Fi);preferencesService=f(Pe);route=f(jr);router=f(zt);threadApiService=f(Yt);agentNotificationService=f(ia);firstMessageState=f(Li);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(D(this.destroy$)).subscribe(e=>{let t=e.projectName,n=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:n,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=n,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView())})}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService)}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id])},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(t.message||"Unknown error"))}})}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e)}isDrawerOpen=!1;onDrawerStateChange(e){this.isDrawerOpen=e}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close()}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-main"]],viewQuery:function(t,n){if(t&1&&Be(U0,5)(fr,5),t&2){let r;ge(r=fe())&&(n.inputSection=r.first),ge(r=fe())&&(n.sidenav=r.first)}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,n){t&1&&(l(0,"app-sidenav",1)(1,"div",2),v("mousedown",function(){return n.onChatFocusedOnMobile()})("touchstart",function(){return n.onChatFocusedOnMobile()}),C(2,W0,1,2,"app-thread",3)(3,q0,7,5),c()()),t&2&&(T("drawerOpen",n.isDrawerOpen),p(2),S(n.threadId?2:3))},dependencies:[yi,Zo,ea,fr],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[Ia("slideIn",[Xr(":enter",[_n({transform:"translateY(100%)",opacity:0}),Kr("300ms ease-out",_n({transform:"translateY(0)",opacity:1}))]),Xr(":leave",[Kr("200ms ease-in",_n({transform:"translateY(100%)",opacity:0}))])])]}})};var Vi=i=>B(null,null,function*(){let e=f(ye),t=i.params.projectName;return t?e.getSelectedProjectId()===t?!0:(e.selectProject(t),(yield rl(e.selectedProject$.pipe(ll(r=>r?.name===t))))?.name===t):(console.log("[PROJECT GUARD] no project id in route"),!1)});var Pp=i=>B(null,null,function*(){let e=f(Ye),t=f(Qt),n=i.params.threadId;if(!t.getUsername())try{yield ga(t.fetchCurrentUser())}catch(r){console.error("[THREAD GUARD] Failed to load current user:",r)}if(!n)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",n),console.log("[THREAD GUARD] Current selected thread:",e.getSelectedThreadId()),e.getSelectedThreadId()===n)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",n),e.selectThread(n);try{let r=yield ga(Pn([e.isLoading$,e.selectedThread$]).pipe(gt(([a,s])=>console.log(`\u{1F43C} [${a?"loading":"loaded"}]`,s?.id)),ve(([a,s])=>!a&&!!s),ti(1),Ae(([a,s])=>s?.id))),o=r===n;return o?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",n,"loaded:",r),o}catch(r){return console.error("[THREAD GUARD] Error loading thread:",r),!1}});var Op=[{path:"",component:yo},{path:"oauth/callback",component:Fo},{path:"project/new",loadComponent:()=>import("./chunk-7AQBJ5TI.js").then(i=>i.ProjectNewComponent)},{path:"project/:projectName",component:_r,canActivate:[Vi]},{path:"project/:projectName/prompts",loadComponent:()=>import("./chunk-CNPJ5XEL.js").then(i=>i.PromptListComponent),canActivate:[Vi]},{path:"project/:projectName/schedulers",loadComponent:()=>import("./chunk-QMHQ4NWQ.js").then(i=>i.SchedulerListComponent),canActivate:[Vi]},{path:"project/:projectName/agents",loadComponent:()=>import("./chunk-JDOIYNG7.js").then(i=>i.AgentListComponent),canActivate:[Vi]},{path:"project/:projectName/thread/:threadId",component:_r,canActivate:[Vi,Pp]},{path:"token-usage",loadComponent:()=>import("./chunk-665PXQXJ.js").then(i=>i.TokenUsageComponent)},{path:"agentos",loadChildren:()=>import("./chunk-A4ZJFWAK.js").then(i=>i.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];function G0(i){return()=>i.initializeDefaultProject()}function Y0(i){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var Ap={providers:[ml(),Sl({eventCoalescing:!0}),kl(Op),El(),dd(),dl(Ul),{provide:wa,useFactory:G0,deps:[ye],multi:!0},{provide:wa,useFactory:Y0,deps:[Sn],multi:!0},Gl({basePath:"/api/agentos"}),{provide:Wl,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var ra=class i{title="client";themeService=f(ji);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&F(0,"router-outlet")},dependencies:[Pl,Ml],encapsulation:2})};Tl(ra,Ap).catch(i=>console.error(i));
|
|
361
|
+
`+(t.summary||""):t.summary||"")("matTooltipDisabled",!t.summary),p(),S(t.subThreads!=null&&t.subThreads.length?1:-1),p(),S(t.name?2:3),p(2),S(n.isSharedThread(t)?4:-1)}}function Xf(i,e){if(i&1){let t=O();l(0,"button",31),v("click",function(r){x(t);let o=h().$implicit,a=h(4);return w(a.startEditingThreadName(r,o))}),l(1,"mat-icon"),u(2,"edit"),c()()}}function Jf(i,e){i&1&&An(0)}function Zf(i,e){if(i&1&&un(0,Jf,1,0,"ng-container",11),i&2){let t=h().$implicit;h(3);let n=In(1);T("ngTemplateOutlet",n)("ngTemplateOutletContext",Ar(2,Ff,t.subThreads))}}function e0(i,e){if(i&1){let t=O();l(0,"div",17),C(1,Wf,3,3,"div",18)(2,Kf,5,5,"a",19),l(3,"div",20),C(4,Xf,3,0,"button",21),l(5,"button",22),v("click",function(r){let o=x(t).$implicit,a=h(4);return w(a.toggleStar(r,o))}),l(6,"mat-icon"),u(7),c()(),l(8,"button",23),v("click",function(r){let o=x(t).$implicit,a=h(4);return w(a.deleteThread(r,o))}),l(9,"mat-icon"),u(10,"delete"),c()()()(),C(11,Zf,1,4,"ng-container")}if(i&2){let t,n=e.$implicit,r=h(4);Y("current",n.id===((t=r.currentThread())==null?null:t.id)),p(),S(r.editingThreadId===n.id?1:2),p(3),S(r.editingThreadId!==n.id&&n.name?4:-1),p(),Y("starred",r.isStarred(n)),T("title",r.isStarred(n)?"Unstar thread":"Star thread"),p(2),L(r.isStarred(n)?"star":"star_outline"),p(4),S(r.isParentExpanded(n.id)&&(n.subThreads!=null&&n.subThreads.length)?11:-1)}}function t0(i,e){if(i&1&&(l(0,"div",14)(1,"div",16),u(2),c(),we(3,e0,12,9,null,null,kp),c()),i&2){let t=e.$implicit;p(2),L(t.label),p(),Te(t.threads)}}function n0(i,e){i&1&&(l(0,"div",15),u(1,"No existing threads"),c())}function i0(i,e){if(i&1&&(l(0,"div",15),u(1),c()),i&2){let t=h(3);p(),Ne('No threads matching "',t.searchQuery(),'"')}}function r0(i,e){if(i&1&&(we(0,t0,5,1,"div",14,Lf),C(2,n0,2,0,"div",15)(3,i0,2,1,"div",15)),i&2){let t,n=h(2);Te(n.getGroupedThreads()),p(2),S(!((t=n.threads())!=null&&t.length)&&!n.searchQuery()?2:n.searchQuery()&&n.getGroupedThreads().length===0?3:-1)}}function o0(i,e){if(i&1&&(un(0,Bf,2,0,"ng-template",null,0,ai),l(2,"div",3),C(3,Hf,4,0,"div",4)(4,r0,4,1),c()),i&2){let t=h();p(3),S(t.isLoadingThreadList()?3:4)}}function a0(i,e){i&1&&(l(0,"span",32),u(1,"No project selected"),c())}function s0(i,e){i&1&&(l(0,"span",32),u(1,"Loading..."),c())}function l0(i,e){if(i&1&&(l(0,"div",2),C(1,a0,2,0,"span",32)(2,s0,2,0,"span",32),c()),i&2){let t,n=h();p(),S((t=n.currentProject())!=null&&t.name?2:1)}}var ta=class i{projects=null;searchMode=!1;searchQuery=Ir("");searchModeChange=new Z;threadSelected=new Z;projectStateService=f(ye);threadStateService=f(Ye);threadApiService=f(Yt);userService=f(Qt);router=f(zt);destroyRef=f(ri);currentThread=Ie(this.threadStateService.selectedThread$);currentProject=Ie(this.projectStateService.selectedProject$);threads=Ie(this.threadStateService.threadList$);isLoadingThreadList=Ie(this.threadStateService.isLoadingThreadList$);username=Ie(this.userService.username$);isTouchDevice="ontouchstart"in window||navigator.maxTouchPoints>0;editingThreadId=null;editingThreadName="";isRenamingThread=!1;renameErrorMessage="";expandedParents=new Set;constructor(){Hi(()=>{let e=this.currentThread()?.id,t=this.threads();if(!e||!t?.length)return;let n=new Map;for(let o of t)o.parentThreadId&&n.set(o.id,o.parentThreadId);let r=e;for(;r;){let o=n.get(r);o&&this.expandedParents.add(o),r=o}})}ngOnInit(){this.userService.fetchCurrentUser().subscribe({error:e=>{console.error("[THREAD-SELECTOR] Failed to load current user:",e)}})}selectThread(e){this.threadStateService.selectThread(e),this.threadSelected.emit(),this.router.navigate(["project",this.currentProject()?.name,"thread",e])}getGroupedThreads(){let e=this.threads();if(!e?.length)return[];let t=new Set(e.map(N=>N.id)),n=e.filter(N=>!N.parentThreadId),r=e.filter(N=>!!N.parentThreadId),o=r.filter(N=>!t.has(N.parentThreadId)),a=r.filter(N=>t.has(N.parentThreadId)),s=new Map;for(let N of a){let X=N.parentThreadId;s.has(X)||s.set(X,[]),s.get(X).push(N)}let d=N=>(s.get(N)||[]).sort((U,Ee)=>U.modifiedDate>Ee.modifiedDate?-1:1).map(U=>he(G({},U),{subThreads:d(U.id)})),m=[...n,...o];if(this.searchQuery()&&this.searchQuery().trim()){let N=this.searchQuery().toLowerCase().trim();m=m.filter(X=>X.name.toLowerCase().includes(N)||X.summary&&X.summary.toLowerCase().includes(N))}if(!m.length)return[];let _=this.username();if(!_)return[];let b=m.map(N=>he(G({},N),{subThreads:d(N.id)})),y=b.filter(N=>N.starring&&N.starring.includes(_)),k=b.filter(N=>!N.starring||!N.starring.includes(_)),E=new Map,P=new Date;P.setHours(0,0,0,0);for(let N of k){let X=new Date(N.modifiedDate);X.setHours(0,0,0,0);let U=P.getTime()-X.getTime(),Ee=Math.floor(U/(1e3*60*60*24)),de;Ee===0?de="Today":Ee===1?de="Yesterday":Ee<7?de="This Week":Ee<30?de="This Month":Ee<90?de="Last 3 Months":de="Older",E.has(de)||E.set(de,[]),E.get(de).push(N)}let K=[];if(y.length>0){let N=[...y].sort((X,U)=>X.modifiedDate>U.modifiedDate?-1:1);K.push({label:"Starred",threads:N})}return["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(N=>E.has(N)).forEach(N=>{K.push({label:N,threads:E.get(N)})}),K}isParentExpanded(e){return this.expandedParents.has(e)}toggleSubThreads(e,t){e.stopPropagation(),this.expandedParents.has(t)?this.expandedParents.delete(t):this.expandedParents.add(t)}isSubThread(e){return!!e.parentThreadId}isSharedThread(e){return e.users&&e.users.length>1}isStarred(e){let t=this.username();return!!t&&e.starring&&e.starring.includes(t)}toggleStar(e,t){e.stopPropagation();let n=this.username();if(!n)return;let r=t.starring&&t.starring.includes(n),o=r?this.threadApiService.unstarThread(t.id):this.threadApiService.starThread(t.id);this.threadStateService.updateStarLocal(t.id,!r,n),o.pipe(ot(this.destroyRef)).subscribe({next:()=>{},error:a=>{console.error("Error toggling star:",a),this.threadStateService.refreshThreadList()}})}deleteThread(e,t){e.stopPropagation();let n=this.currentProject()?.name;!n||!confirm(`Are you sure you want to delete the thread "${t.name}"?`)||this.threadApiService.deleteThread(t.id).subscribe({next:()=>{this.currentThread()?.id===t.id&&(this.threadStateService.clearSelection(),this.router.navigate(["project",n])),this.threadStateService.refreshThreadList()},error:o=>{console.error("Error deleting thread:",o),alert("Failed to delete thread. Please try again.")}})}formatDate(e){try{let t=new Date(e),r=new Date().getTime()-t.getTime(),o=Math.floor(r/(1e3*60*60*24));return o===0?"Today":o===1?"Yesterday":o<7?`${o} days ago`:t.toLocaleDateString("en-EN",{day:"numeric",month:"short"})}catch(t){return"No date"}}startEditingThreadName(e,t){e.stopPropagation(),this.editingThreadId=t.id,this.editingThreadName=t.name||"",this.renameErrorMessage="",setTimeout(()=>{let n=document.querySelector(".thread-name-input");n&&(n.focus(),n.select())},0)}cancelEditingThreadName(){this.editingThreadId=null,this.editingThreadName="",this.renameErrorMessage=""}saveThreadName(e){if(e&&e.stopPropagation(),!this.editingThreadId)return;let t=this.editingThreadName.trim();if(!t){this.renameErrorMessage="Thread name cannot be empty";return}if(t.length>200){this.renameErrorMessage="Thread name is too long (max 200 characters)";return}let n=this.editingThreadId;this.isRenamingThread=!0,this.renameErrorMessage="",this.threadStateService.renameThread(n,t).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=!1},error:r=>{console.error("[THREAD-SELECTOR] Error renaming thread:",r),this.renameErrorMessage=r.message||"Failed to rename thread",this.isRenamingThread=!1}})}onEditKeydown(e){e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.saveThreadName()):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this.cancelEditingThreadName())}onEditBlur(){setTimeout(()=>{this.editingThreadId&&!this.isRenamingThread&&this.saveThreadName()},200)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-thread-selector"]],inputs:{searchMode:"searchMode",searchQuery:[1,"searchQuery"]},outputs:{searchModeChange:"searchModeChange",threadSelected:"threadSelected"},decls:3,vars:1,consts:[["subThreadTemplate",""],["tabindex","0","role","application","aria-label","Thread selector",1,"thread-selector",3,"click","keydown"],[1,"thread-disabled"],["role","menu","aria-label","Thread selection",1,"thread-list"],[1,"thread-loading"],[1,"thread-item-wrapper","sub-thread"],["role","menuitem","tabindex","0",1,"thread-item","sub-thread-item",3,"click","keydown.enter","keydown.space"],[1,"sub-thread-toggle"],[1,"sub-thread-agent"],[1,"sub-thread-task"],[1,"sub-thread-toggle",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"loading-spinner"],[1,"loading-text"],[1,"thread-group"],[1,"thread-empty"],[1,"thread-group-header"],[1,"thread-item-wrapper"],[1,"thread-name-edit-wrapper"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"matTooltip","matTooltipDisabled"],[1,"action-buttons"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button"],["mat-icon-button","","type","button",1,"action-button","star-button",3,"click","title"],["mat-icon-button","","title","Delete thread","type","button",1,"action-button","delete-button",3,"click"],["type","text","maxlength","200",1,"thread-name-input",3,"ngModelChange","keydown","blur","click","ngModel","disabled"],[1,"rename-error"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"click","keydown.enter","keydown.space","matTooltip","matTooltipDisabled"],[1,"thread-name"],["matTooltip","Shared thread",1,"shared-indicator"],[1,"thread-name-spinner",3,"diameter"],[1,"thread-name","thread-name-generating"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button",3,"click"],[1,"disabled-text"]],template:function(t,n){if(t&1&&(l(0,"div",1),v("click",function(o){return o.stopPropagation()})("keydown",function(o){return o.stopPropagation()}),C(1,o0,5,1)(2,l0,3,1,"div",2),c()),t&2){let r;p(),S((r=n.currentProject())!=null&&r.name?1:2)}},dependencies:[Lr,lt,_t,at,ec,st,ke,se,Ge,ze,oc,rc,wi,xi,Qr,nc],styles:[".thread-selector[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1;min-height:0;overflow-x:hidden;overflow-y:auto}.thread-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:0;max-height:none;overflow:visible}.thread-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-bottom:.5rem}.thread-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.thread-group-header[_ngcontent-%COMP%]{padding:.5rem 1rem .25rem;font-size:.75rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.5px;position:sticky;top:0;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);z-index:1}.thread-item-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;position:relative;width:100%;border-radius:0;min-width:0;gap:.25rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%]{display:flex}.thread-item-wrapper.current[_ngcontent-%COMP%]{background:var(--color-primary-light)}.thread-item-wrapper.current[_ngcontent-%COMP%] .thread-item[_ngcontent-%COMP%]{color:var(--color-primary-text);font-weight:600}.thread-item[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1;min-width:0;padding:.75rem 1rem;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);text-align:left;justify-content:flex-start}.thread-item.new-thread-item[_ngcontent-%COMP%]{margin-bottom:.25rem}.thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.action-buttons[_ngcontent-%COMP%]{display:none;align-items:center;gap:.25rem;flex-shrink:0;margin-right:.5rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%], .thread-item-wrapper.current[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%]{display:flex}.action-button[_ngcontent-%COMP%]{flex-shrink:0;border-radius:4px!important;width:28px!important;height:28px!important;padding:0!important}.action-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple{border-radius:4px!important}.action-button[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)!important}.action-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%]:hover{background-color:var(--color-primary-hover)!important}.action-button.edit-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.action-button.star-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:color .2s ease}.action-button.star-button.starred[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.star-button[_ngcontent-%COMP%]:not(.starred):hover mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.delete-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:#ef4444}.thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.875rem;font-weight:400;padding:0 1rem;min-width:0}.thread-link[_ngcontent-%COMP%]:hover:not(.new-thread-link){color:var(--color-primary-hover, var(--color-primary));text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}.thread-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.thread-link.new-thread-link[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:600;font-size:.95rem}.thread-link.new-thread-link[_ngcontent-%COMP%] .thread-name[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0 center}50%{background-position:100% center}to{background-position:0 center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.thread-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}.thread-name.thread-name-generating[_ngcontent-%COMP%]{color:var(--color-text-muted);font-style:italic}.thread-name-edit-wrapper[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:0 .5rem}.thread-name-input[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-bg-secondary);color:var(--color-text-primary);font-size:.9rem;font-family:inherit}.thread-name-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 2px #3b82f61a}.thread-name-input[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.rename-error[_ngcontent-%COMP%]{color:var(--color-error);font-size:.75rem;margin-top:.25rem;padding-left:.5rem}.thread-name-spinner[_ngcontent-%COMP%]{flex-shrink:0;margin-right:.5rem}.thread-name-spinner[_ngcontent-%COMP%] .mat-mdc-progress-spinner circle{stroke:var(--color-primary)!important}.current-indicator[_ngcontent-%COMP%]{color:var(--color-success);font-weight:700;flex-shrink:0;font-size:1rem}.thread-separator[_ngcontent-%COMP%]{height:1px;background:var(--color-border);margin:.25rem 0}.thread-empty[_ngcontent-%COMP%]{padding:1.5rem 1rem;text-align:center;color:var(--color-text-muted);font-size:.8rem;font-style:italic}.thread-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1rem;gap:.75rem}.thread-loading[_ngcontent-%COMP%] .loading-spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}.thread-loading[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{color:var(--color-text-muted);font-size:.8rem}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.thread-disabled[_ngcontent-%COMP%]{padding:1.5rem 1rem}.thread-disabled[_ngcontent-%COMP%] .disabled-text[_ngcontent-%COMP%]{display:block;color:var(--color-text-muted);font-size:.85rem;font-style:italic;text-align:center}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%]{padding-left:calc(.2rem + var(--sub-depth, 1) * 1.5rem);border-left:2px solid var(--color-primary, #3b82f6);margin-left:.75rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]{padding:.35rem .5rem .35rem 0;gap:.2rem;font-size:.8rem;color:var(--color-text-secondary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-agent[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary);white-space:nowrap;flex-shrink:0;font-size:.8rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-task[_ngcontent-%COMP%]{color:var(--color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.75rem}.sub-thread-toggle[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex-shrink:0;cursor:pointer;color:var(--color-text-secondary);margin-right:.25rem}.sub-thread-toggle[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.shared-indicator[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--color-text-secondary);flex-shrink:0;margin-left:.25rem}@media(max-width:768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"]})};var c0=["logsContent"],d0=(i,e)=>e.name;function p0(i,e){if(i&1){let t=O();l(0,"button",12),v("click",function(){x(t);let r=h().$implicit,o=h();return w(o.start(r.name))}),l(1,"mat-icon"),u(2,"play_arrow"),c()()}if(i&2){let t=h().$implicit;T("disabled",t.isLoading)}}function m0(i,e){if(i&1){let t=O();l(0,"button",13),v("click",function(){x(t);let r=h().$implicit,o=h();return w(o.stop(r.name))}),l(1,"mat-icon"),u(2,"stop"),c()()}if(i&2){let t=h().$implicit;T("disabled",t.isLoading)}}function u0(i,e){if(i&1&&(l(0,"a",8)(1,"mat-icon",14),u(2,"open_in_new"),c()()),i&2){let t=h().$implicit;T("href",t.url,On)("title",t.url)}}function h0(i,e){if(i&1&&(l(0,"div",15),u(1),c()),i&2){let t=h(),n=t.$implicit,r=t.$index;Ke("order",r*2),p(),L(n.errorMessage)}}function g0(i,e){if(i&1){let t=O();l(0,"button",21),v("click",function(){x(t);let r=h(3);return w(r.onManualRefresh())}),l(1,"mat-icon"),u(2,"refresh"),c()()}}function f0(i,e){if(i&1&&(l(0,"div",16)(1,"div",17)(2,"span",18),u(3),c(),C(4,g0,3,0,"button",19),c(),l(5,"pre",20,0),u(7),c()()),i&2){let t=h(),n=t.$implicit,r=t.$index,o=h();Ke("order",r*2+1),p(3),Ne("",n.name," logs"),p(),S(n.status==="running"?4:-1),p(3),L(o.logs()||"(empty)")}}function _0(i,e){if(i&1){let t=O();l(0,"div",2)(1,"span",3),u(2),c(),l(3,"div",4),C(4,p0,3,1,"button",5)(5,m0,3,1,"button",6),l(6,"span",7),u(7),c(),C(8,u0,3,2,"a",8),l(9,"button",9),v("click",function(){let r=x(t).$implicit,o=h();return w(o.toggleLogs(r.name))}),l(10,"mat-icon"),u(11),c()()()(),C(12,h0,2,3,"div",10),C(13,f0,8,5,"div",11)}if(i&2){let t=e.$implicit,n=e.$index,r=h();Ke("order",n*2),p(2),L(t.name),p(2),S(t.status==="stopped"?4:5),p(2),Y("running",t.status==="running"),p(),Ne(" ",t.status==="running"?"Running":"Stopped"," "),p(),S(t.url?8:-1),p(),T("title",r.logsOpenFor()===t.name?"Hide logs":"Show logs"),p(2),L(r.logsOpenFor()===t.name?"expand_less":"terminal"),p(),S(t.errorMessage?12:-1),p(),S(r.logsOpenFor()===t.name?13:-1)}}var na=class i{destroyRef=f(ri);projectApi=f(Yr);projectName=Ir.required();entryStates=qe([]);hasPreview=Tt(()=>this.entryStates().length>0);logsOpenFor=qe(null);logs=qe("");logsContent;logsPollTimer=null;logsTimeoutTimer=null;static LOGS_POLL_MS=5e3;static LOGS_TIMEOUT_MS=1200*1e3;constructor(){Hi(()=>{let e=this.projectName();e&&this.onProjectChanged(e)},{allowSignalWrites:!0}),Hi(()=>{console.log("entry states",this.entryStates())})}ngOnDestroy(){this.stopLogPolling()}onProjectChanged(e){this.stopLogPolling(),this.entryStates.set([]),this.logsOpenFor.set(null),this.logs.set(""),this.projectApi.getPreviewEntries(e).pipe(ot(this.destroyRef)).subscribe({next:t=>{let n=t.entries;if(n.length===0)return;let r=n.map(a=>({name:a.name,command:a.command,url:a.url,status:"stopped",isLoading:!1,errorMessage:""}));this.entryStates.set(r);let o=n.map(a=>this.projectApi.getPreviewStatus(e,a.name));ol(o).pipe(ot(this.destroyRef)).subscribe({next:a=>{this.entryStates.update(s=>s.map((d,m)=>{let _=a[m];return _?he(G({},d),{status:_.status}):d}))},error:()=>{}})},error:()=>{}})}start(e){this.updateEntry(e,{isLoading:!0,errorMessage:""}),this.projectApi.startPreview(this.projectName(),e).pipe(ot(this.destroyRef)).subscribe({next:t=>{this.updateEntry(e,{status:t.status,isLoading:!1})},error:t=>{this.updateEntry(e,{errorMessage:t?.error?.error??"Failed to start preview",isLoading:!1})}})}stop(e){this.updateEntry(e,{isLoading:!0,errorMessage:""}),this.projectApi.stopPreview(this.projectName(),e).pipe(ot(this.destroyRef)).subscribe({next:()=>{this.updateEntry(e,{status:"stopped",isLoading:!1}),this.logsOpenFor()===e&&this.stopLogPolling()},error:t=>{this.updateEntry(e,{errorMessage:t?.error?.error??"Failed to stop preview",isLoading:!1})}})}toggleLogs(e){this.logsOpenFor()===e?(this.logsOpenFor.set(null),this.logs.set(""),this.stopLogPolling()):(this.logsOpenFor.set(e),this.refreshLogs(),this.startLogPolling())}onManualRefresh(){this.refreshLogs(),this.logsPollTimer&&this.resetLogsTimeout()}refreshLogs(){let e=this.logsOpenFor();e&&this.projectApi.getPreviewLogs(this.projectName(),e).pipe(ot(this.destroyRef)).subscribe({next:t=>{this.logs.set(t.logs),this.scrollLogsToBottom()},error:()=>this.logs.set("(failed to load logs)")})}updateEntry(e,t){this.entryStates.update(n=>n.map(r=>r.name===e?G(G({},r),t):r))}startLogPolling(){this.stopLogPolling(),this.logsPollTimer=setInterval(()=>{this.logsOpenFor()?this.refreshLogs():this.stopLogPolling()},i.LOGS_POLL_MS),this.resetLogsTimeout()}stopLogPolling(){this.logsPollTimer&&(clearInterval(this.logsPollTimer),this.logsPollTimer=null),this.logsTimeoutTimer&&(clearTimeout(this.logsTimeoutTimer),this.logsTimeoutTimer=null)}resetLogsTimeout(){this.logsTimeoutTimer&&clearTimeout(this.logsTimeoutTimer),this.logsTimeoutTimer=setTimeout(()=>{this.stopLogPolling()},i.LOGS_TIMEOUT_MS)}scrollLogsToBottom(){setTimeout(()=>{let e=this.logsContent?.nativeElement;e&&(e.scrollTop=e.scrollHeight)})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-preview-panel"]],viewQuery:function(t,n){if(t&1&&Be(c0,5),t&2){let r;ge(r=fe())&&(n.logsContent=r.first)}},inputs:{projectName:[1,"projectName"]},decls:3,vars:0,consts:[["logsContent",""],[1,"preview-panel"],[1,"entry-row"],[1,"entry-name"],[1,"entry-actions"],["mat-icon-button","","title","Start","type","button",1,"entry-btn","start",3,"disabled"],["mat-icon-button","","title","Stop","type","button",1,"entry-btn","stop",3,"disabled"],[1,"status-pill"],["target","_blank","rel","noopener noreferrer",1,"preview-url",3,"href","title"],["mat-icon-button","","type","button",1,"entry-btn","logs",3,"click","title"],[1,"preview-error",3,"order"],[1,"logs-container",3,"order"],["mat-icon-button","","title","Start","type","button",1,"entry-btn","start",3,"click","disabled"],["mat-icon-button","","title","Stop","type","button",1,"entry-btn","stop",3,"click","disabled"],[1,"link-icon"],[1,"preview-error"],[1,"logs-container"],[1,"logs-header"],[1,"logs-title"],["mat-icon-button","","title","Refresh logs","type","button",1,"entry-btn"],[1,"logs-content"],["mat-icon-button","","title","Refresh logs","type","button",1,"entry-btn",3,"click"]],template:function(t,n){t&1&&(l(0,"div",1),we(1,_0,14,12,null,null,d0),c()),t&2&&(p(),Te(n.entryStates()))},dependencies:[Ge,ze,ke,se],styles:["[_nghost-%COMP%]{display:block}.preview-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:.25rem 0}.entry-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;padding:.125rem .5rem;min-height:36px}.entry-name[_ngcontent-%COMP%]{font-size:.82rem;font-weight:500;color:var(--on-surface, #e0e0e0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;min-width:0}.entry-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0}.entry-btn[_ngcontent-%COMP%]{width:28px!important;height:28px!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center;flex-shrink:0}.entry-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px}.entry-btn.start[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.entry-btn.stop[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#e53935}.entry-btn.logs[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px;color:var(--color-text-secondary)}.entry-btn[disabled][_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.status-pill[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:1px 6px;border-radius:12px;font-size:.68rem;font-weight:600;letter-spacing:.02em;flex-shrink:0;min-width:52px;text-align:center;background:var(--color-bg-hover);color:var(--color-text-secondary);border:1px solid var(--color-border)}.status-pill.running[_ngcontent-%COMP%]{background:#22c55e26;color:#16a34a;border-color:#22c55e66}.preview-url[_ngcontent-%COMP%]{display:inline-flex;align-items:center;text-decoration:none;color:var(--color-primary);flex-shrink:0}.preview-url[_ngcontent-%COMP%]:hover{text-decoration:underline}.preview-url[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}.preview-error[_ngcontent-%COMP%]{font-size:.75rem;color:#c00;padding:0 .75rem}.logs-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:.125rem .5rem .25rem;background:var(--color-bg-hover);border-radius:8px;overflow:hidden;border:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.25rem .75rem;border-bottom:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%] .logs-title[_ngcontent-%COMP%]{flex:1;font-size:.72rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.logs-content[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;font-family:Courier New,Courier,monospace;font-size:.72rem;line-height:1.5;color:var(--color-text);white-space:pre-wrap;word-break:break-all;max-height:200px;overflow-y:auto}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:3px}"]})};function b0(i,e){if(i&1&&(l(0,"div",3),u(1),c()),i&2){let t=h();p(),Ne("\u274C ",t.errorMessage)}}var gr=class i{dialogRef=f(Hr);data=f(Ur);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName)}getDefaultTitle(e,t){return e==="user"?"User Configuration":`Project Configuration: ${t||"Unknown"}`}onSave(){this.errorMessage="";let e;try{e=JSON.parse(this.jsonContent)}catch(t){this.errorMessage=`Invalid JSON syntax: ${t instanceof Error?t.message:"Unknown error"}`;return}this.dialogRef.close(e)}onCancel(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(t,n){t&1&&(l(0,"div",0),u(1),l(2,"button",1),v("click",function(){return n.onCancel()}),l(3,"mat-icon"),u(4,"close"),c()()(),l(5,"mat-dialog-content")(6,"textarea",2),ie("ngModelChange",function(o){return ne(n.jsonContent,o)||(n.jsonContent=o),o}),c(),C(7,b0,2,1,"div",3),c(),l(8,"mat-dialog-actions",4)(9,"button",5),v("click",function(){return n.onCancel()}),u(10,"Cancel"),c(),l(11,"button",6),v("click",function(){return n.onSave()}),u(12,"Save"),c()()),t&2&&(p(),Ne(" ",n.title," "),p(5),te("ngModel",n.jsonContent),p(),S(n.errorMessage?7:-1))},dependencies:[it,lt,_t,at,st,se,ze,si,qr,ql,Gr],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{margin-left:auto}mat-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;min-height:400px}.json-textarea[_ngcontent-%COMP%]{flex:1;min-height:300px;max-height:80vh;padding:1rem;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.875rem;line-height:1.5;background:var(--color-code-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:4px;resize:vertical;outline:none;transition:border-color .2s}.json-textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.json-textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.6}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:4px;font-size:.875rem;line-height:1.4;background:#dc26261a;color:#dc2626;border:1px solid rgba(220,38,38,.3)}"]})};var v0=["threadSearchInput"],y0=["*"];function C0(i,e){if(i&1){let t=O();l(0,"button",26),v("click",function(){x(t);let r=h();return w(r.toggle())}),l(1,"mat-icon"),u(2,"menu"),c()(),l(3,"button",27),v("click",function(){x(t);let r=h();return w(r.createNewThread())}),l(4,"mat-icon",10),u(5,"play_circle"),c()()}if(i&2){let t=h();p(3),T("disabled",!t.selectedProjectName())}}function S0(i,e){if(i&1){let t=O();l(0,"div",14)(1,"mat-icon",28),u(2,"search"),c(),l(3,"input",29,0),ie("ngModelChange",function(r){x(t);let o=h();return ne(o.threadSearchQuery,r)||(o.threadSearchQuery=r),w(r)}),v("input",function(){x(t);let r=h();return w(r.onThreadSearchInput())}),c(),l(5,"button",30),v("click",function(){x(t);let r=h();return w(r.closeThreadSearch())}),l(6,"mat-icon"),u(7,"close"),c()()()}if(i&2){let t=h();p(3),te("ngModel",t.threadSearchQuery)}}function x0(i,e){if(i&1){let t=O();l(0,"div",15)(1,"mat-icon",22),u(2,"forum"),c(),l(3,"span",23),u(4,"Threads"),c(),l(5,"button",31),v("click",function(r){x(t);let o=h();return w(o.toggleThreadSearch(r))}),l(6,"mat-icon"),u(7,"search"),c()()()}}function w0(i,e){i&1&&(l(0,"mat-icon",21),u(1,"keyboard_arrow_up"),c())}function T0(i,e){i&1&&(l(0,"mat-icon",22),u(1,"hub"),c())}function E0(i,e){i&1&&(l(0,"mat-icon",21),u(1,"keyboard_arrow_up"),c())}function M0(i,e){i&1&&(l(0,"mat-icon",22),u(1,"tune"),c())}function k0(i,e){i&1&&(l(0,"div",33)(1,"div",37),F(2,"app-options-panel",38),c()())}function P0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(3).openProjectConfig(),r.preventDefault(),w(r.stopPropagation())}),l(2,"mat-icon",22),u(3,"settings_applications"),c(),l(4,"span",23),u(5,"Project Configuration"),c()()()}}function O0(i,e){i&1&&(l(0,"div",32)(1,"a",39)(2,"mat-icon",22),u(3,"settings_applications"),c(),l(4,"span",23),u(5,"Project config (No project)"),c()()())}function A0(i,e){if(i&1&&C(0,P0,6,0,"div",32)(1,O0,6,0,"div",32),i&2){let t=h(2);S(t.selectedProjectName()?0:1)}}function I0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(2).openAgents(),r.preventDefault(),w(r.stopPropagation())}),l(2,"mat-icon",22),u(3,"smart_toy"),c(),l(4,"span",23),u(5,"Agents"),c()()()}}function D0(i,e){i&1&&(l(0,"div",32)(1,"a",39)(2,"mat-icon",22),u(3,"smart_toy"),c(),l(4,"span",23),u(5,"Agents (No project)"),c()()())}function R0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(2).openPrompts(),r.preventDefault(),w(r.stopPropagation())}),l(2,"mat-icon",22),u(3,"description"),c(),l(4,"span",23),u(5,"Prompts"),c()()()}}function N0(i,e){i&1&&(l(0,"div",32)(1,"a",39)(2,"mat-icon",22),u(3,"description"),c(),l(4,"span",23),u(5,"Prompts (No project)"),c()()())}function F0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(2).openSchedulers(),r.preventDefault(),w(r.stopPropagation())}),l(2,"mat-icon",22),u(3,"schedule"),c(),l(4,"span",23),u(5,"Schedulers"),c()()()}}function L0(i,e){i&1&&(l(0,"div",32)(1,"a",39)(2,"mat-icon",22),u(3,"schedule"),c(),l(4,"span",23),u(5,"Schedulers (No project)"),c()()())}function j0(i,e){i&1&&(l(0,"mat-icon",21),u(1,"keyboard_arrow_up"),c())}function V0(i,e){i&1&&(l(0,"mat-icon",22),u(1,"rocket_launch"),c())}function z0(i,e){if(i&1&&(l(0,"div",33),F(1,"app-preview-panel",40),c()),i&2){let t=h(3);p(),T("projectName",t.selectedProjectName())}}function $0(i,e){if(i&1){let t=O();l(0,"div",32)(1,"a",20),v("click",function(r){return x(t),h(2).toggleSection("preview"),r.preventDefault(),w(r.stopPropagation())}),C(2,j0,2,0,"mat-icon",21)(3,V0,2,0,"mat-icon",22),l(4,"span",23),u(5,"Preview Server"),c()(),C(6,z0,2,1,"div",33),c()}if(i&2){let t=h(2);Y("expanded",t.expandedSections.preview),p(),Y("active",t.expandedSections.preview),p(),S(t.expandedSections.preview?2:3),p(4),S(t.expandedSections.preview?6:-1)}}function B0(i,e){if(i&1){let t=O();l(0,"div",24)(1,"div",32)(2,"a",20),v("click",function(r){return x(t),h().toggleSection("config"),w(r.preventDefault())}),C(3,E0,2,0,"mat-icon",21)(4,M0,2,0,"mat-icon",22),l(5,"span",23),u(6,"Preferences"),c()(),C(7,k0,3,0,"div",33),c(),l(8,"div",32)(9,"a",20),v("click",function(r){return x(t),h().openTokenUsage(),r.preventDefault(),w(r.stopPropagation())}),l(10,"mat-icon",22),u(11,"data_usage"),c(),l(12,"span",23),u(13,"Token Usage"),c()()(),l(14,"div",32)(15,"a",20),v("click",function(r){return x(t),h().openUserConfig(),r.preventDefault(),w(r.stopPropagation())}),l(16,"mat-icon",22),u(17,"manage_accounts"),c(),l(18,"span",23),u(19,"User Configuration"),c()()(),C(20,A0,2,1),C(21,I0,6,0,"div",32)(22,D0,6,0,"div",32),C(23,R0,6,0,"div",32)(24,N0,6,0,"div",32),C(25,F0,6,0,"div",32)(26,L0,6,0,"div",32),C(27,$0,7,6,"div",34),l(28,"div",32)(29,"a",35),F(30,"img",36),l(31,"span",23),u(32,"Contribute on GitHub"),c()()()()}if(i&2){let t=h();p(),Y("expanded",t.expandedSections.config),p(),Y("active",t.expandedSections.config),p(),S(t.expandedSections.config?3:4),p(4),S(t.expandedSections.config?7:-1),p(13),S(t.isAdmin?20:-1),p(),S(t.selectedProjectName()?21:22),p(2),S(t.selectedProjectName()?23:24),p(2),S(t.selectedProjectName()?25:26),p(2),S(t.hasPreviewConfig()?27:-1),p(3),Me("src","CODAY-Logo.png",On)}}function H0(i,e){if(i&1){let t=O();l(0,"div",25)(1,"mat-icon",41),u(2,"warning"),c(),l(3,"span",42),u(4),c(),l(5,"button",43),v("click",function(){x(t);let r=h();return w(r.configErrorMessage="")}),l(6,"mat-icon"),u(7,"close"),c()()()}if(i&2){let t=h();p(4),L(t.configErrorMessage)}}var fr=class i{destroy$=new J;sidenavStateChange=new Z;drawerOpen=!1;breakpointObserver=f(Dl);isDesktop=Ie(this.breakpointObserver.observe("(min-width: 1400px)").pipe(Ae(e=>e.matches)),{initialValue:!1});userOpenPreference=qe(!0);isOpen=Tt(()=>this.userOpenPreference());isAdmin=!1;configErrorMessage="";expandedSections={config:!1,preview:!1,settings:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=f(Wr);configApi=f(pc);projectStateService=f(ye);projectApi=f(Yr);router=f(zt);preferences=f(Pe);threadStateService=f(Ye);projects=Ie(this.projectStateService.projectList$);selectedProject=Ie(this.projectStateService.selectedProject$);selectedProjectName=Ie(this.projectStateService.selectedProject$.pipe(Ae(e=>e?.name)));isProjectVolatile=Ie(this.projectStateService.selectedProject$.pipe(Ae(e=>e?.config?.volatile||!1)));forcedProject=Ie(this.projectStateService.forcedProject$);hasPreviewConfig=Ie(this.projectStateService.selectedProject$.pipe(Ae(e=>{let t=e?.config?.preview;return Array.isArray(t)&&!!t.length})),{initialValue:!1});ngOnInit(){let e=window.innerWidth>=1024,t=this.preferences.getPreference("sidenavOpen",e);this.userOpenPreference.set(t??e),this.configApi.getUserConfig().pipe(D(this.destroy$)).subscribe({next:n=>{this.isAdmin=n.groups?.includes("CODAY_ADMIN")??!1,console.log("[SIDENAV] User admin status:",this.isAdmin)},error:n=>{console.error("[SIDENAV] Error loading user config for roles:",n),this.isAdmin=!1}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}toggle(){let e=!this.userOpenPreference();this.userOpenPreference.set(e),this.saveSidenavState(e),this.sidenavStateChange.emit(e)}close(){this.userOpenPreference()&&(this.userOpenPreference.set(!1),this.saveSidenavState(!1),this.sidenavStateChange.emit(!1))}saveSidenavState(e){this.preferences.setPreference("sidenavOpen",e)}openTokenUsage(){this.configErrorMessage="",this.router.navigate(["/token-usage"])}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(D(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(gr,{data:{configType:"user",initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(n=>{n&&this.saveUserConfig(n)})},error:e=>{console.error("[SIDENAV] Error loading user config:",e),this.configErrorMessage=e?.error?.error||"Failed to load user configuration"}})}saveUserConfig(e){this.configApi.updateUserConfig(e).pipe(D(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config saved successfully")},error:t=>{console.error("[SIDENAV] Error saving user config:",t),this.configErrorMessage=t?.error?.error||"Failed to save user configuration"}})}openProjectConfig(){let e=this.selectedProjectName();if(!e){console.error("[SIDENAV] No project selected"),this.configErrorMessage="No project selected. Please select a project first.";return}this.configErrorMessage="",this.projectApi.getProjectConfig(e).pipe(D(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(gr,{data:{configType:"project",projectName:e,initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(r=>{r&&this.saveProjectConfig(e,r)})},error:t=>{console.error("[SIDENAV] Error loading project config:",t),this.configErrorMessage=t?.error?.error||"Failed to load project configuration"}})}saveProjectConfig(e,t){this.projectApi.updateProjectConfig(e,t).pipe(D(this.destroy$)).subscribe({next:n=>{console.log("[SIDENAV] Project config saved successfully")},error:n=>{console.error("[SIDENAV] Error saving project config:",n),this.configErrorMessage=n?.error?.error||"Failed to save project configuration"}})}requireProjectSelection(e){return this.selectedProjectName()?!0:(console.error(`[SIDENAV] No project selected, cannot ${e}`),this.configErrorMessage="Please select a project first",!1)}openAgents(){if(!this.requireProjectSelection("open agents"))return;let e=this.selectedProjectName();this.router.navigate(["project",e,"agents"])}openPrompts(){if(!this.requireProjectSelection("open prompts"))return;let e=this.selectedProjectName();this.router.navigate(["project",e,"prompts"])}openSchedulers(){if(!this.requireProjectSelection("open schedulers"))return;let e=this.selectedProjectName();this.router.navigate(["project",e,"schedulers"])}toggleSection(e){let t=this.expandedSections[e];e==="settings"?this.expandedSections[e]=!t:(["config","preview"].forEach(r=>{this.expandedSections[r]=!1}),this.expandedSections[e]=!t)}navigateToHome(){if(this.forcedProject()){console.log("[SIDENAV] Cannot navigate to home - forced project active");return}console.log("[SIDENAV] Navigating to home (project selection)"),this.projectStateService.clearSelection(),this.router.navigate(["/"])}createNewThread(){let e=this.selectedProjectName();if(!e){console.error("[SIDENAV] No project selected, cannot create new thread"),this.configErrorMessage="Please select a project first";return}console.log("[SIDENAV] Navigating to welcome view for new thread"),this.threadStateService.clearSelection(),this.router.navigate(["project",e])}onThreadSelectedOnMobile(){this.isDesktop()||this.close()}toggleThreadSearch(e){e.stopPropagation(),this.isThreadSearchActive=!0,this.threadSearchQuery="",setTimeout(()=>{this.threadSearchInput?.nativeElement.focus()},0)}closeThreadSearch(){this.isThreadSearchActive=!1,this.threadSearchQuery=""}onThreadSearchInput(){}onThreadSearchModeChange(e){e||this.closeThreadSearch()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-sidenav"]],viewQuery:function(t,n){if(t&1&&Be(v0,5),t&2){let r;ge(r=fe())&&(n.threadSearchInput=r.first)}},inputs:{drawerOpen:"drawerOpen"},outputs:{sidenavStateChange:"sidenavStateChange"},ngContentSelectors:y0,decls:34,vars:31,consts:[["threadSearchInput",""],[1,"sidenav-container",3,"hasBackdrop"],["mode","push","position","start",1,"app-sidenav",3,"closed","opened","disableClose"],[1,"sidenav-header"],["mat-icon-button","","title","Close menu",3,"click"],["alt","coday",3,"click","keydown.enter","keydown.space","title"],[1,"header-title-section"],[1,"sidenav-title"],[1,"new-thread-section"],["role","button","tabindex","0",1,"new-thread-link",3,"click"],["fontSet","material-icons-outlined"],[1,"new-thread-text"],[1,"sidenav-sections"],[1,"section-container","expanded"],[1,"search-header"],[1,"section-toggle","active","threads-header"],[1,"section-content","threads"],[1,"sidenav-thread-selector",3,"searchModeChange","threadSelected","searchMode","searchQuery"],[1,"sidenav-nav"],[1,"section-container","settings-group"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content","settings-content"],["role","alert",1,"error-notification"],["mat-icon-button","","title","Menu","type","button",1,"sidenav-toggle-btn",3,"click"],["mat-icon-button","","title","Start a new thread","type","button",1,"sidenav-new-thread-btn",3,"click","disabled"],[1,"search-icon"],["type","text","placeholder","Search threads...",1,"search-input",3,"ngModelChange","input","ngModel"],["mat-icon-button","","title","Close search","type","button",1,"close-search-btn",3,"click"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"section-container"],[1,"section-content"],[1,"section-container",3,"expanded"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"section-toggle","contribute-btn"],["alt","Coday",1,"contribute-logo"],[1,"preference-item"],[1,"inline-panel"],["role","button","tabindex","-1","aria-disabled","true",1,"section-toggle","disabled"],[3,"projectName"],[1,"error-icon"],[1,"error-text"],["mat-icon-button","","aria-label","Close error message",1,"error-close",3,"click"]],template:function(t,n){t&1&&(rn(),C(0,C0,6,1),l(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),v("closed",function(){return n.close()}),l(3,"div",3)(4,"button",4),v("click",function(){return n.close()}),l(5,"mat-icon"),u(6,"chevron_left"),c()(),l(7,"img",5),v("click",function(o){return n.navigateToHome(),o.stopPropagation()})("keydown.enter",function(o){return n.navigateToHome(),o.preventDefault(),o.stopPropagation()})("keydown.space",function(o){return n.navigateToHome(),o.preventDefault(),o.stopPropagation()}),c(),l(8,"div",6)(9,"h2",7),u(10),c()()(),l(11,"div",8)(12,"a",9),v("click",function(o){return n.createNewThread(),o.preventDefault()}),l(13,"mat-icon",10),u(14,"play_circle"),c(),l(15,"span",11),u(16,"Start a new thread"),c()()(),l(17,"div",12)(18,"div",13),C(19,S0,8,1,"div",14)(20,x0,8,0,"div",15),l(21,"div",16)(22,"app-thread-selector",17),v("searchModeChange",function(o){return n.onThreadSearchModeChange(o)})("threadSelected",function(){return n.onThreadSelectedOnMobile()}),c()()()(),l(23,"div",18)(24,"div",19)(25,"a",20),v("click",function(o){return n.toggleSection("settings"),o.preventDefault()}),C(26,w0,2,0,"mat-icon",21)(27,T0,2,0,"mat-icon",22),l(28,"span",23),u(29,"Control Center"),c()(),C(30,B0,33,12,"div",24),c()()(),l(31,"mat-sidenav-content"),ht(32),c()(),C(33,H0,8,1,"div",25)),t&2&&(S(!n.isOpen()&&!n.drawerOpen?0:-1),p(),Y("sidenav-open",n.isOpen()),T("hasBackdrop",!1),p(),T("opened",n.isOpen())("disableClose",!0),p(5),Y("sidenav-logo",!0)("clickable",!n.forcedProject())("disabled",n.forcedProject()),T("title",n.forcedProject()?"Project selection disabled":"Go to project selection"),Me("src","CODAY-Logo.png",On)("role",n.forcedProject()?null:"button")("tabindex",n.forcedProject()?null:"0"),p(3),L(n.selectedProjectName()),p(9),S(n.isThreadSearchActive?19:20),p(3),T("searchMode",n.isThreadSearchActive)("searchQuery",n.threadSearchQuery),p(),Y("is-admin",n.isAdmin),p(),Y("expanded",n.expandedSections.settings),p(),Y("active",n.expandedSections.settings),p(),S(n.expandedSections.settings?26:27),p(4),S(n.expandedSections.settings?30:-1),p(),Y("sidenav-closed-offset",!n.isOpen()),p(2),S(n.configErrorMessage?33:-1))},dependencies:[lt,_t,at,st,Xo,js,Cp,Qo,ke,se,Ge,ze,Ep,Mp,hr,ta,na],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;height:100dvh;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:25%;min-width:320px;height:100dvh!important;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!important;min-width:0;overflow:hidden!important;visibility:hidden!important}.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{width:100%;margin:0!important}@media(min-width:1024px){.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{min-width:0}}[_nghost-%COMP%] .mat-drawer-backdrop{pointer-events:auto}[_nghost-%COMP%] .mat-drawer-content{pointer-events:auto!important;background:transparent!important;overflow:visible!important}[_nghost-%COMP%] .mat-drawer-inner-container{overflow:hidden!important;height:100dvh!important;display:flex!important;flex-direction:column!important}.sidenav-new-thread-btn[_ngcontent-%COMP%], .sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;z-index:1500!important;width:40px!important;height:40px!important;border-radius:50%!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;border:1px solid var(--glass-border)!important;box-shadow:var(--glass-shadow)!important}.sidenav-toggle-btn[_ngcontent-%COMP%]{top:1rem!important;left:1rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{top:calc(1.5rem + 40px)!important;left:1rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled{opacity:.5!important}.sidenav-logo-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:1rem!important;left:1rem!important;z-index:1500!important;width:56px!important;height:56px!important;border-radius:50%!important;border:1px solid var(--glass-border)!important;padding:4px!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;box-shadow:var(--glass-shadow)!important;transition:all .3s cubic-bezier(.4,0,.2,1)!important;cursor:pointer!important;pointer-events:auto!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;text-decoration:none!important}.sidenav-logo-btn[_ngcontent-%COMP%]:hover{transform:scale(1.08) translateY(-2px)!important;box-shadow:0 16px 48px #0003!important;border-color:var(--color-primary)!important}.sidenav-logo-btn[_ngcontent-%COMP%]:active{transform:scale(.96)!important}.sidenav-logo-btn[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:2px}.app-sidenav[_ngcontent-%COMP%]{width:480px;height:100dvh!important;min-height:0!important;position:relative;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border-radius:0;overflow:hidden;overflow-x:hidden!important;display:flex;flex-direction:column}.sidenav-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1.5rem 1rem .5rem;flex-shrink:0}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:4px;flex-shrink:0;transition:all .2s ease}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]{cursor:pointer}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:hover{transform:scale(1.1);filter:drop-shadow(0 4px 12px rgba(0,0,0,.15))}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:active{transform:scale(.95)}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;min-width:0}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%] .sidenav-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.loading-section[_ngcontent-%COMP%]{padding:2rem 1rem;display:flex;align-items:center;justify-content:center}.loading-content[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem;align-items:center}.loading-content[_ngcontent-%COMP%] mat-progress-bar[_ngcontent-%COMP%]{width:100%;height:4px;border-radius:2px}.loading-content[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary);text-align:center}.new-thread-section[_ngcontent-%COMP%]{padding:1rem 1rem .5rem;flex-shrink:0}.new-thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.95rem;font-weight:600;padding:0}.new-thread-link[_ngcontent-%COMP%] .new-thread-text[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:focus{transform:scale(1.1)}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.sidenav-sections[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:100px;overflow:hidden}.sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container.expanded[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%] > app-thread-selector[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;flex:1!important;min-height:0!important;overflow:hidden!important}.sidenav-nav[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column;overflow:hidden;max-height:70%;border-top:1px solid var(--color-border)}.sidenav-nav[_ngcontent-%COMP%] > .settings-group[_ngcontent-%COMP%] > .section-toggle.active[_ngcontent-%COMP%]{border-top:none}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-toggle[_ngcontent-%COMP%]{flex-shrink:0}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{padding:0;border-bottom:1px solid var(--color-border);overflow:visible}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%] .section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{max-height:40vh;overflow-y:auto;overflow-x:hidden}.contribute-btn[_ngcontent-%COMP%] .contribute-logo[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:2px;flex-shrink:0}.section-container[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%]{display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{border-bottom:none}.section-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;width:100%;padding:.5rem 1rem;height:50px;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);flex-shrink:0}.section-toggle.active[_ngcontent-%COMP%]{border-top:1px solid var(--color-border)}.section-toggle.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.section-toggle[_ngcontent-%COMP%] .arrow-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);transition:transform .2s ease;transform:rotate(0);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-label[_ngcontent-%COMP%]{flex:1;font-size:.9rem;color:var(--color-text);text-align:left}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-toggle[_ngcontent-%COMP%]:hover:not(.disabled){background:var(--color-bg-hover)}.section-toggle[_ngcontent-%COMP%]:active:not(.disabled){transform:scale(.98)}.section-toggle[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.search-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;height:50px;background:var(--color-bg-hover);border-top:1px solid var(--color-border);transition:all .2s ease}.search-header[_ngcontent-%COMP%] .search-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent;color:var(--color-text);font-size:.9rem;padding:0;min-width:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-muted)}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%]{flex-shrink:0}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-content[_ngcontent-%COMP%]{padding:.5rem 0 0;animation:_ngcontent-%COMP%_slideDown .2s ease;border-bottom:1px solid var(--color-border);display:flex;flex-direction:column}.section-content.threads[_ngcontent-%COMP%]{padding:0;border-bottom:none;flex:1!important;min-height:0!important;overflow:hidden!important}.section-content.threads[_ngcontent-%COMP%] app-thread-selector[_ngcontent-%COMP%]{flex:1!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}@keyframes _ngcontent-%COMP%_slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.config-links[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:.5rem 1rem;margin-bottom:1rem}.sidenav-item[_ngcontent-%COMP%]{width:100%}.sidenav-item[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary)}.sidenav-item[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{flex:1;font-size:.9rem}.sidenav-item[_ngcontent-%COMP%] .disabled-hint[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary);font-style:italic}.sidenav-link.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;color:var(--color-text-secondary)}.sidenav-link.disabled[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.sidenav-link[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%], .sidenav-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-primary)}.sidenav-link[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem}.preference-item[_ngcontent-%COMP%]{padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.preference-item[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem;padding:0 1rem}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.preference-item[_ngcontent-%COMP%] .preference-content[_ngcontent-%COMP%]{padding:0 1rem}.error-notification[_ngcontent-%COMP%]{position:fixed;top:5rem;left:50%;transform:translate(-50%);z-index:2000;display:flex;align-items:center;gap:.75rem;background:#ff3b3026;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid rgba(255,59,48,.3);border-radius:16px;padding:1rem 1.5rem;box-shadow:var(--glass-shadow);animation:_ngcontent-%COMP%_errorSlideDown .3s cubic-bezier(.4,0,.2,1)}.error-notification[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{font-size:1.2rem;flex-shrink:0;color:#c00}.error-notification[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%]{flex:1;color:#c00;font-size:.9rem;font-weight:500}@keyframes _ngcontent-%COMP%_errorSlideDown{0%{opacity:0;transform:translate(-50%,-10px)}to{opacity:1;transform:translate(-50%)}}@media(max-width:480px){.app-sidenav[_ngcontent-%COMP%]{width:320px}.sidenav-toggle-btn[_ngcontent-%COMP%]{top:.75rem!important;left:.75rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{top:calc(1.25rem + 40px)!important;left:.75rem!important}.error-notification[_ngcontent-%COMP%]{left:1rem;right:1rem;transform:none;max-width:calc(100vw - 2rem)}}body.dark[_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .app-sidenav[_ngcontent-%COMP%]{background:#242830f2;border-right-color:#b4c8ff17}body.dark[_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .sidenav-header[_ngcontent-%COMP%]{background:#242830b3}"]})};var ia=class i{destroy$=new J;isSetup=!1;codayService=f(mt);preferencesService=f(Pe);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(D(this.destroy$),ba(),ve(([e,t])=>e===!0&&t===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(D(this.destroy$),ba(),ve(([e,t])=>e===!1&&t===!0)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled()}),this.isSetup=!0}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification())}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),n.gain.setValueAtTime(.1,e.currentTime),n.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let r=e.createOscillator(),o=e.createGain();r.connect(o),o.connect(e.destination);let a=e.currentTime+.11;r.frequency.setValueAtTime(950,a),o.gain.setValueAtTime(.1,a),o.gain.exponentialRampToValueAtTime(.01,a+.09),r.start(a),r.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e)}}handleBrowserNotificationEnabled(){return B(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1))}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(!1)}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification")}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:!1});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:!1});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close()},console.log("[AGENT-NOTIFICATION] Task complete notification sent")}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=H({token:i,factory:i.\u0275fac,providedIn:"root"})};var U0=["inputSection"];function W0(i,e){if(i&1){let t=O();l(0,"app-thread",4),v("chatFocused",function(){x(t);let r=h();return w(r.onChatFocusedOnMobile())})("drawerStateChange",function(r){x(t);let o=h();return w(o.onDrawerStateChange(r))}),c()}if(i&2){let t=h();T("projectName",t.projectName)("threadId",t.threadId)}}function q0(i,e){if(i&1){let t=O();l(0,"div",5),F(1,"app-welcome-message"),c(),l(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),v("messageSubmitted",function(r){x(t);let o=h();return w(o.onMessageSubmitted(r))})("voiceRecordingToggled",function(r){x(t);let o=h();return w(o.onVoiceToggled(r))})("heightChanged",function(r){x(t);let o=h();return w(o.onInputHeightChanged(r))})("textareaFocused",function(){x(t);let r=h();return w(r.onChatFocusedOnMobile())}),c()()()()}if(i&2){let t=h();p(6),T("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",t.isStartingFirstMessage)}}var _r=class i{destroy$=new J;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=f(mt);titleService=f(Fi);preferencesService=f(Pe);route=f(jr);router=f(zt);threadApiService=f(Yt);agentNotificationService=f(ia);firstMessageState=f(Li);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(D(this.destroy$)).subscribe(e=>{let t=e.projectName,n=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:n,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=n,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView())})}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService)}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id])},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(t.message||"Unknown error"))}})}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e)}isDrawerOpen=!1;onDrawerStateChange(e){this.isDrawerOpen=e}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close()}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-main"]],viewQuery:function(t,n){if(t&1&&Be(U0,5)(fr,5),t&2){let r;ge(r=fe())&&(n.inputSection=r.first),ge(r=fe())&&(n.sidenav=r.first)}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,n){t&1&&(l(0,"app-sidenav",1)(1,"div",2),v("mousedown",function(){return n.onChatFocusedOnMobile()})("touchstart",function(){return n.onChatFocusedOnMobile()}),C(2,W0,1,2,"app-thread",3)(3,q0,7,5),c()()),t&2&&(T("drawerOpen",n.isDrawerOpen),p(2),S(n.threadId?2:3))},dependencies:[yi,Zo,ea,fr],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[Ia("slideIn",[Xr(":enter",[_n({transform:"translateY(100%)",opacity:0}),Kr("300ms ease-out",_n({transform:"translateY(0)",opacity:1}))]),Xr(":leave",[Kr("200ms ease-in",_n({transform:"translateY(100%)",opacity:0}))])])]}})};var Vi=i=>B(null,null,function*(){let e=f(ye),t=i.params.projectName;return t?e.getSelectedProjectId()===t?!0:(e.selectProject(t),(yield rl(e.selectedProject$.pipe(ll(r=>r?.name===t))))?.name===t):(console.log("[PROJECT GUARD] no project id in route"),!1)});var Pp=i=>B(null,null,function*(){let e=f(Ye),t=f(Qt),n=i.params.threadId;if(!t.getUsername())try{yield ga(t.fetchCurrentUser())}catch(r){console.error("[THREAD GUARD] Failed to load current user:",r)}if(!n)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",n),console.log("[THREAD GUARD] Current selected thread:",e.getSelectedThreadId()),e.getSelectedThreadId()===n)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",n),e.selectThread(n);try{let r=yield ga(Pn([e.isLoading$,e.selectedThread$]).pipe(gt(([a,s])=>console.log(`\u{1F43C} [${a?"loading":"loaded"}]`,s?.id)),ve(([a,s])=>!a&&!!s),ti(1),Ae(([a,s])=>s?.id))),o=r===n;return o?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",n,"loaded:",r),o}catch(r){return console.error("[THREAD GUARD] Error loading thread:",r),!1}});var Op=[{path:"",component:yo},{path:"oauth/callback",component:Fo},{path:"project/new",loadComponent:()=>import("./chunk-4LFZBXC3.js").then(i=>i.ProjectNewComponent)},{path:"project/:projectName",component:_r,canActivate:[Vi]},{path:"project/:projectName/prompts",loadComponent:()=>import("./chunk-4OMSGXSL.js").then(i=>i.PromptListComponent),canActivate:[Vi]},{path:"project/:projectName/schedulers",loadComponent:()=>import("./chunk-GT5UFSUE.js").then(i=>i.SchedulerListComponent),canActivate:[Vi]},{path:"project/:projectName/agents",loadComponent:()=>import("./chunk-LVEC3TBP.js").then(i=>i.AgentListComponent),canActivate:[Vi]},{path:"project/:projectName/thread/:threadId",component:_r,canActivate:[Vi,Pp]},{path:"token-usage",loadComponent:()=>import("./chunk-JPWWZVYZ.js").then(i=>i.TokenUsageComponent)},{path:"agentos",loadChildren:()=>import("./chunk-WQDJM4TR.js").then(i=>i.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];function G0(i){return()=>i.initializeDefaultProject()}function Y0(i){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var Ap={providers:[ml(),Sl({eventCoalescing:!0}),kl(Op),El(),dd(),dl(Ul),{provide:wa,useFactory:G0,deps:[ye],multi:!0},{provide:wa,useFactory:Y0,deps:[Sn],multi:!0},Gl({basePath:"/api/agentos"}),{provide:Wl,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var ra=class i{title="client";themeService=f(ji);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&F(0,"router-outlet")},dependencies:[Pl,Ml],encapsulation:2})};Tl(ra,Ap).catch(i=>console.error(i));
|