@whoz-oss/coday-client 0.82.0 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{A as Sc,B as wh,C as Sh,D as We,E as dt,F as Dt,G as In,H as Rn,I as yt,J as Ct,K as zr,L as le,M as rs,N as It,O as as,P as xt,Q as xe,R as Qe,S as Mh,a as Za,b as Ja,c as rt,d as bh,e as bi,f as jr,g as Vi,h as Lt,i as es,j as Cc,k as vh,l as yh,m as Lo,n as ts,o as is,p as jo,q as Fe,r as vt,s as Ch,t as xh,u as xc,v as ns,w as zo,x as os,y as Bo,z as wc}from"./chunk-NKVTMSP6.js";import{e as kh}from"./chunk-YXDDUSGH.js";import{$ as ge,$a as eo,$b as De,A as fc,Aa as M,Ab as Pn,B as Ba,Ba as re,Bb as fe,Ca as Z,Cb as nh,D as $m,Da as Zm,Db as to,E as Fo,Ea as ye,Eb as oh,Fa as Jm,Fb as Vr,G as Mn,Ga as Ge,Gb as Ga,Ha as H,Hb as rh,I as Vt,Ia as me,Ib as fi,J as Ri,Ja as Et,Jb as ft,K as N,Ka as eh,Kb as Vo,L as qm,La as bc,Lb as On,M as ct,Ma as Fr,Mb as Lr,N as de,Na as Y,Nb as ah,O as at,Ob as Re,P as R,Pa as w,Pb as J,Q as oe,Qa as S,Qb as _i,R as ee,Ra as Jn,Rb as sh,S as Ha,Sa as th,Sb as lh,T as d,Ta as Oe,Tb as yc,Ua as Ae,Ub as ch,V as Gm,Va as x,Vb as An,W as Wa,Wa as s,Wb as Ya,X as v,Xa as c,Xb as Qa,Y as y,Ya as F,Yb as Xa,Z as on,Za as ri,Zb as dh,_ as Ua,_a as ai,_b as mh,a as q,aa as it,ab as qa,b as Ie,ba as Kn,bb as E,bc as hh,c as Vm,cb as ei,cc as ph,d as ie,da as Ym,db as _,e as Di,ea as $a,f as oi,fa as Te,fb as g,fc as Ye,g as D,ga as Le,gb as He,gc as uh,h as se,ha as nt,hb as he,hc as Ni,i as Lm,ia as K,ib as Tt,ic as Ka,j as jm,ja as Qm,jb as ne,jc as gh,k as kt,kb as W,kc as Dn,l as Ir,lb as U,lc as fh,m as zm,ma as Rr,mb as ih,mc as _h,n as Bm,nb as Nr,o as ve,ob as vc,p as nn,pa as Jt,pb as ti,qa as No,qb as Fi,r as Ro,ra as Xm,rb as A,s as Hm,sa as m,sb as rn,t as Wm,ta as En,tb as h,u as Ii,ua as gi,ub as B,v as pe,va as ot,vb as ae,w as gc,wa as Pe,wb as Tn,x as Xn,xa as Zn,xb as V,y as Um,ya as Km,yb as L,z as Mt,za as _c,zb as j}from"./chunk-3FWTNKYQ.js";var ce=(function(n){return n[n.State=0]="State",n[n.Transition=1]="Transition",n[n.Sequence=2]="Sequence",n[n.Group=3]="Group",n[n.Animate=4]="Animate",n[n.Keyframes=5]="Keyframes",n[n.Style=6]="Style",n[n.Trigger=7]="Trigger",n[n.Reference=8]="Reference",n[n.AnimateChild=9]="AnimateChild",n[n.AnimateRef=10]="AnimateRef",n[n.Query=11]="Query",n[n.Stagger=12]="Stagger",n})(ce||{}),si="*";function kc(n,t){return{type:ce.Trigger,name:n,definitions:t,options:{}}}function ss(n,t=null){return{type:ce.Animate,styles:t,timings:n}}function Eh(n,t=null){return{type:ce.Sequence,steps:n,options:t}}function Fn(n){return{type:ce.Style,styles:n,offset:null}}function ls(n,t,e=null){return{type:ce.Transition,expr:n,animation:t,options:e}}var Li=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(t=0,e=0){this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},io=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(t){this.players=t;let e=0,i=0,o=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++e==r&&this._onFinish()}),a.onDestroy(()=>{++i==r&&this._onDestroy()}),a.onStart(()=>{++o==r&&this._onStart()})}),this.totalTime=this.players.reduce((a,l)=>Math.max(a,l.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){let e=t*this.totalTime;this.players.forEach(i=>{let o=i.totalTime?Math.min(1,e/i.totalTime):1;i.setPosition(o)})}getPosition(){let t=this.players.reduce((e,i)=>e===null||i.totalTime>e.totalTime?i:e,null);return t!=null?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},Ho="!";function Th(n){return new de(3e3,!1)}function Hf(){return new de(3100,!1)}function Wf(){return new de(3101,!1)}function Uf(n){return new de(3001,!1)}function $f(n){return new de(3003,!1)}function qf(n){return new de(3004,!1)}function Oh(n,t){return new de(3005,!1)}function Ah(){return new de(3006,!1)}function Dh(){return new de(3007,!1)}function Ih(n,t){return new de(3008,!1)}function Rh(n){return new de(3002,!1)}function Fh(n,t,e,i,o){return new de(3010,!1)}function Nh(){return new de(3011,!1)}function Vh(){return new de(3012,!1)}function Lh(){return new de(3200,!1)}function jh(){return new de(3202,!1)}function zh(){return new de(3013,!1)}function Bh(n){return new de(3014,!1)}function Hh(n){return new de(3015,!1)}function Wh(n){return new de(3016,!1)}function Uh(n,t){return new de(3404,!1)}function Gf(n){return new de(3502,!1)}function $h(n){return new de(3503,!1)}function qh(){return new de(3300,!1)}function Gh(n){return new de(3504,!1)}function Yh(n){return new de(3301,!1)}function Qh(n,t){return new de(3302,!1)}function Xh(n){return new de(3303,!1)}function Kh(n,t){return new de(3400,!1)}function Zh(n){return new de(3401,!1)}function Jh(n){return new de(3402,!1)}function ep(n,t){return new de(3505,!1)}function an(n){switch(n.length){case 0:return new Li;case 1:return n[0];default:return new io(n)}}function Pc(n,t,e=new Map,i=new Map){let o=[],r=[],a=-1,l=null;if(t.forEach(p=>{let u=p.get("offset"),b=u==a,C=b&&l||new Map;p.forEach((T,P)=>{let k=P,z=T;if(P!=="offset")switch(k=n.normalizePropertyName(k,o),z){case Ho:z=e.get(P);break;case si:z=i.get(P);break;default:z=n.normalizeStyleValue(P,k,z,o);break}C.set(k,z)}),b||r.push(C),l=C,a=u}),o.length)throw Gf(o);return r}function cs(n,t,e,i){switch(t){case"start":n.onStart(()=>i(e&&Mc(e,"start",n)));break;case"done":n.onDone(()=>i(e&&Mc(e,"done",n)));break;case"destroy":n.onDestroy(()=>i(e&&Mc(e,"destroy",n)));break}}function Mc(n,t,e){let i=e.totalTime,o=!!e.disabled,r=ds(n.element,n.triggerName,n.fromState,n.toState,t||n.phaseName,i??n.totalTime,o),a=n._data;return a!=null&&(r._data=a),r}function ds(n,t,e,i,o="",r=0,a){return{element:n,triggerName:t,fromState:e,toState:i,phaseName:o,totalTime:r,disabled:!!a}}function Qt(n,t,e){let i=n.get(t);return i||n.set(t,i=e),i}function Oc(n){let t=n.indexOf(":"),e=n.substring(1,t),i=n.slice(t+1);return[e,i]}var Yf=typeof document>"u"?null:document.documentElement;function ms(n){let t=n.parentNode||n.host||null;return t===Yf?null:t}function Qf(n){return n.substring(1,6)=="ebkit"}var no=null,Ph=!1;function tp(n){no||(no=Xf()||{},Ph=no.style?"WebkitAppearance"in no.style:!1);let t=!0;return no.style&&!Qf(n)&&(t=n in no.style,!t&&Ph&&(t="Webkit"+n.charAt(0).toUpperCase()+n.slice(1)in no.style)),t}function Xf(){return typeof document<"u"?document.body:null}function Ac(n,t){for(;t;){if(t===n)return!0;t=ms(t)}return!1}function Dc(n,t,e){if(e)return Array.from(n.querySelectorAll(t));let i=n.querySelector(t);return i?[i]:[]}var Kf=1e3,Ic="{{",Zf="}}",Rc="ng-enter",hs="ng-leave",Br="ng-trigger",Hr=".ng-trigger",Fc="ng-animating",ps=".ng-animating";function ji(n){if(typeof n=="number")return n;let t=n.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:Ec(parseFloat(t[1]),t[2])}function Ec(n,t){switch(t){case"s":return n*Kf;default:return n}}function Wr(n,t,e){return n.hasOwnProperty("duration")?n:e_(n,t,e)}var Jf=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function e_(n,t,e){let i,o=0,r="";if(typeof n=="string"){let a=n.match(Jf);if(a===null)return t.push(Th(n)),{duration:0,delay:0,easing:""};i=Ec(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(o=Ec(parseFloat(l),a[4]));let p=a[5];p&&(r=p)}else i=n;if(!e){let a=!1,l=t.length;i<0&&(t.push(Hf()),a=!0),o<0&&(t.push(Wf()),a=!0),a&&t.splice(l,0,Th(n))}return{duration:i,delay:o,easing:r}}function ip(n){return n.length?n[0]instanceof Map?n:n.map(t=>new Map(Object.entries(t))):[]}function vi(n,t,e){t.forEach((i,o)=>{let r=us(o);e&&!e.has(o)&&e.set(o,n.style[r]),n.style[r]=i})}function Nn(n,t){t.forEach((e,i)=>{let o=us(i);n.style[o]=""})}function Wo(n){return Array.isArray(n)?n.length==1?n[0]:Eh(n):n}function np(n,t,e){let i=t.params||{},o=Nc(n);o.length&&o.forEach(r=>{i.hasOwnProperty(r)||e.push(Uf(r))})}var Tc=new RegExp(`${Ic}\\s*(.+?)\\s*${Zf}`,"g");function Nc(n){let t=[];if(typeof n=="string"){let e;for(;e=Tc.exec(n);)t.push(e[1]);Tc.lastIndex=0}return t}function Uo(n,t,e){let i=`${n}`,o=i.replace(Tc,(r,a)=>{let l=t[a];return l==null&&(e.push($f(a)),l=""),l.toString()});return o==i?n:o}var t_=/-+([a-z0-9])/g;function us(n){return n.replace(t_,(...t)=>t[1].toUpperCase())}function op(n,t){return n===0||t===0}function rp(n,t,e){if(e.size&&t.length){let i=t[0],o=[];if(e.forEach((r,a)=>{i.has(a)||o.push(a),i.set(a,r)}),o.length)for(let r=1;r<t.length;r++){let a=t[r];o.forEach(l=>a.set(l,gs(n,l)))}}return t}function Xt(n,t,e){switch(t.type){case ce.Trigger:return n.visitTrigger(t,e);case ce.State:return n.visitState(t,e);case ce.Transition:return n.visitTransition(t,e);case ce.Sequence:return n.visitSequence(t,e);case ce.Group:return n.visitGroup(t,e);case ce.Animate:return n.visitAnimate(t,e);case ce.Keyframes:return n.visitKeyframes(t,e);case ce.Style:return n.visitStyle(t,e);case ce.Reference:return n.visitReference(t,e);case ce.AnimateChild:return n.visitAnimateChild(t,e);case ce.AnimateRef:return n.visitAnimateRef(t,e);case ce.Query:return n.visitQuery(t,e);case ce.Stagger:return n.visitStagger(t,e);default:throw qf(t.type)}}function gs(n,t){return window.getComputedStyle(n)[t]}var Jc=(()=>{class n{validateStyleProperty(e){return tp(e)}containsElement(e,i){return Ac(e,i)}getParentElement(e){return ms(e)}query(e,i,o){return Dc(e,i,o)}computeStyle(e,i,o){return o||""}animate(e,i,o,r,a,l=[],p){return new Li(o,r)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac})}return n})(),ro=class{static NOOP=new Jc},ao=class{};var i_=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"]),ys=class extends ao{normalizePropertyName(t,e){return us(t)}normalizeStyleValue(t,e,i,o){let r="",a=i.toString().trim();if(i_.has(e)&&i!==0&&i!=="0")if(typeof i=="number")r="px";else{let l=i.match(/^[+-]?[\d\.]+([a-z]*)$/);l&&l[1].length==0&&o.push(Oh(t,i))}return a+r}};var Cs="*";function n_(n,t){let e=[];return typeof n=="string"?n.split(/\s*,\s*/).forEach(i=>o_(i,e,t)):e.push(n),e}function o_(n,t,e){if(n[0]==":"){let p=r_(n,e);if(typeof p=="function"){t.push(p);return}n=p}let i=n.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return e.push(Hh(n)),t;let o=i[1],r=i[2],a=i[3];t.push(ap(o,a));let l=o==Cs&&a==Cs;r[0]=="<"&&!l&&t.push(ap(a,o))}function r_(n,t){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,i)=>parseFloat(i)>parseFloat(e);case":decrement":return(e,i)=>parseFloat(i)<parseFloat(e);default:return t.push(Wh(n)),"* => *"}}var fs=new Set(["true","1"]),_s=new Set(["false","0"]);function ap(n,t){let e=fs.has(n)||_s.has(n),i=fs.has(t)||_s.has(t);return(o,r)=>{let a=n==Cs||n==o,l=t==Cs||t==r;return!a&&e&&typeof o=="boolean"&&(a=o?fs.has(n):_s.has(n)),!l&&i&&typeof r=="boolean"&&(l=r?fs.has(t):_s.has(t)),a&&l}}var fp=":self",a_=new RegExp(`s*${fp}s*,?`,"g");function _p(n,t,e,i){return new Hc(n).build(t,e,i)}var sp="",Hc=class{_driver;constructor(t){this._driver=t}build(t,e,i){let o=new Wc(e);return this._resetContextStyleTimingState(o),Xt(this,Wo(t),o)}_resetContextStyleTimingState(t){t.currentQuerySelector=sp,t.collectedStyles=new Map,t.collectedStyles.set(sp,new Map),t.currentTime=0}visitTrigger(t,e){let i=e.queryCount=0,o=e.depCount=0,r=[],a=[];return t.name.charAt(0)=="@"&&e.errors.push(Ah()),t.definitions.forEach(l=>{if(this._resetContextStyleTimingState(e),l.type==ce.State){let p=l,u=p.name;u.toString().split(/\s*,\s*/).forEach(b=>{p.name=b,r.push(this.visitState(p,e))}),p.name=u}else if(l.type==ce.Transition){let p=this.visitTransition(l,e);i+=p.queryCount,o+=p.depCount,a.push(p)}else e.errors.push(Dh())}),{type:ce.Trigger,name:t.name,states:r,transitions:a,queryCount:i,depCount:o,options:null}}visitState(t,e){let i=this.visitStyle(t.styles,e),o=t.options&&t.options.params||null;if(i.containsDynamicStyles){let r=new Set,a=o||{};i.styles.forEach(l=>{l instanceof Map&&l.forEach(p=>{Nc(p).forEach(u=>{a.hasOwnProperty(u)||r.add(u)})})}),r.size&&e.errors.push(Ih(t.name,[...r.values()]))}return{type:ce.State,name:t.name,style:i,options:o?{params:o}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let i=Xt(this,Wo(t.animation),e),o=n_(t.expr,e.errors);return{type:ce.Transition,matchers:o,animation:i,queryCount:e.queryCount,depCount:e.depCount,options:oo(t.options)}}visitSequence(t,e){return{type:ce.Sequence,steps:t.steps.map(i=>Xt(this,i,e)),options:oo(t.options)}}visitGroup(t,e){let i=e.currentTime,o=0,r=t.steps.map(a=>{e.currentTime=i;let l=Xt(this,a,e);return o=Math.max(o,e.currentTime),l});return e.currentTime=o,{type:ce.Group,steps:r,options:oo(t.options)}}visitAnimate(t,e){let i=d_(t.timings,e.errors);e.currentAnimateTimings=i;let o,r=t.styles?t.styles:Fn({});if(r.type==ce.Keyframes)o=this.visitKeyframes(r,e);else{let a=t.styles,l=!1;if(!a){l=!0;let u={};i.easing&&(u.easing=i.easing),a=Fn(u)}e.currentTime+=i.duration+i.delay;let p=this.visitStyle(a,e);p.isEmptyStep=l,o=p}return e.currentAnimateTimings=null,{type:ce.Animate,timings:i,style:o,options:null}}visitStyle(t,e){let i=this._makeStyleAst(t,e);return this._validateStyleAst(i,e),i}_makeStyleAst(t,e){let i=[],o=Array.isArray(t.styles)?t.styles:[t.styles];for(let l of o)typeof l=="string"?l===si?i.push(l):e.errors.push(Rh(l)):i.push(new Map(Object.entries(l)));let r=!1,a=null;return i.forEach(l=>{if(l instanceof Map&&(l.has("easing")&&(a=l.get("easing"),l.delete("easing")),!r)){for(let p of l.values())if(p.toString().indexOf(Ic)>=0){r=!0;break}}}),{type:ce.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(t,e){let i=e.currentAnimateTimings,o=e.currentTime,r=e.currentTime;i&&r>0&&(r-=i.duration+i.delay),t.styles.forEach(a=>{typeof a!="string"&&a.forEach((l,p)=>{let u=e.collectedStyles.get(e.currentQuerySelector),b=u.get(p),C=!0;b&&(r!=o&&r>=b.startTime&&o<=b.endTime&&(e.errors.push(Fh(p,b.startTime,b.endTime,r,o)),C=!1),r=b.startTime),C&&u.set(p,{startTime:r,endTime:o}),e.options&&np(l,e.options,e.errors)})})}visitKeyframes(t,e){let i={type:ce.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(Nh()),i;let o=1,r=0,a=[],l=!1,p=!1,u=0,b=t.steps.map(Be=>{let Je=this._makeStyleAst(Be,e),et=Je.offset!=null?Je.offset:c_(Je.styles),_e=0;return et!=null&&(r++,_e=Je.offset=et),p=p||_e<0||_e>1,l=l||_e<u,u=_e,a.push(_e),Je});p&&e.errors.push(Vh()),l&&e.errors.push(Lh());let C=t.steps.length,T=0;r>0&&r<C?e.errors.push(jh()):r==0&&(T=o/(C-1));let P=C-1,k=e.currentTime,z=e.currentAnimateTimings,Ce=z.duration;return b.forEach((Be,Je)=>{let et=T>0?Je==P?1:T*Je:a[Je],_e=et*Ce;e.currentTime=k+z.delay+_e,z.duration=_e,this._validateStyleAst(Be,e),Be.offset=et,i.styles.push(Be)}),i}visitReference(t,e){return{type:ce.Reference,animation:Xt(this,Wo(t.animation),e),options:oo(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:ce.AnimateChild,options:oo(t.options)}}visitAnimateRef(t,e){return{type:ce.AnimateRef,animation:this.visitReference(t.animation,e),options:oo(t.options)}}visitQuery(t,e){let i=e.currentQuerySelector,o=t.options||{};e.queryCount++,e.currentQuery=t;let[r,a]=s_(t.selector);e.currentQuerySelector=i.length?i+" "+r:r,Qt(e.collectedStyles,e.currentQuerySelector,new Map);let l=Xt(this,Wo(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=i,{type:ce.Query,selector:r,limit:o.limit||0,optional:!!o.optional,includeSelf:a,animation:l,originalSelector:t.selector,options:oo(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(zh());let i=t.timings==="full"?{duration:0,delay:0,easing:"full"}:Wr(t.timings,e.errors,!0);return{type:ce.Stagger,animation:Xt(this,Wo(t.animation),e),timings:i,options:null}}};function s_(n){let t=!!n.split(/\s*,\s*/).find(e=>e==fp);return t&&(n=n.replace(a_,"")),n=n.replace(/@\*/g,Hr).replace(/@\w+/g,e=>Hr+"-"+e.slice(1)).replace(/:animating/g,ps),[n,t]}function l_(n){return n?q({},n):null}var Wc=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(t){this.errors=t}};function c_(n){if(typeof n=="string")return null;let t=null;if(Array.isArray(n))n.forEach(e=>{if(e instanceof Map&&e.has("offset")){let i=e;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(n instanceof Map&&n.has("offset")){let e=n;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function d_(n,t){if(n.hasOwnProperty("duration"))return n;if(typeof n=="number"){let r=Wr(n,t).duration;return Vc(r,0,"")}let e=n;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=Vc(0,0,"");return r.dynamic=!0,r.strValue=e,r}let o=Wr(e,t);return Vc(o.duration,o.delay,o.easing)}function oo(n){return n?(n=q({},n),n.params&&(n.params=l_(n.params))):n={},n}function Vc(n,t,e){return{duration:n,delay:t,easing:e}}function ed(n,t,e,i,o,r,a=null,l=!1){return{type:1,element:n,keyframes:t,preStyleProps:e,postStyleProps:i,duration:o,delay:r,totalTime:o+r,easing:a,subTimeline:l}}var $r=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},m_=1,h_=":enter",p_=new RegExp(h_,"g"),u_=":leave",g_=new RegExp(u_,"g");function bp(n,t,e,i,o,r=new Map,a=new Map,l,p,u=[]){return new Uc().buildKeyframes(n,t,e,i,o,r,a,l,p,u)}var Uc=class{buildKeyframes(t,e,i,o,r,a,l,p,u,b=[]){u=u||new $r;let C=new $c(t,e,u,o,r,b,[]);C.options=p;let T=p.delay?ji(p.delay):0;C.currentTimeline.delayNextStep(T),C.currentTimeline.setStyles([a],null,C.errors,p),Xt(this,i,C);let P=C.timelines.filter(k=>k.containsAnimation());if(P.length&&l.size){let k;for(let z=P.length-1;z>=0;z--){let Ce=P[z];if(Ce.element===e){k=Ce;break}}k&&!k.allowOnlyTimelineStyles()&&k.setStyles([l],null,C.errors,p)}return P.length?P.map(k=>k.buildKeyframes()):[ed(e,[],[],[],0,T,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let i=e.subInstructions.get(e.element);if(i){let o=e.createSubContext(t.options),r=e.currentTimeline.currentTime,a=this._visitSubInstructions(i,o,o.options);r!=a&&e.transformIntoNewTimeline(a)}e.previousNode=t}visitAnimateRef(t,e){let i=e.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,i),this.visitReference(t.animation,i),e.transformIntoNewTimeline(i.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,i){for(let o of t){let r=o?.delay;if(r){let a=typeof r=="number"?r:ji(Uo(r,o?.params??{},e.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,e,i){let r=e.currentTimeline.currentTime,a=i.duration!=null?ji(i.duration):null,l=i.delay!=null?ji(i.delay):null;return a!==0&&t.forEach(p=>{let u=e.appendInstructionToTimeline(p,a,l);r=Math.max(r,u.duration+u.delay)}),r}visitReference(t,e){e.updateOptions(t.options,!0),Xt(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let i=e.subContextCount,o=e,r=t.options;if(r&&(r.params||r.delay)&&(o=e.createSubContext(r),o.transformIntoNewTimeline(),r.delay!=null)){o.previousNode.type==ce.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=xs);let a=ji(r.delay);o.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>Xt(this,a,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>i&&o.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let i=[],o=e.currentTimeline.currentTime,r=t.options&&t.options.delay?ji(t.options.delay):0;t.steps.forEach(a=>{let l=e.createSubContext(t.options);r&&l.delayNextStep(r),Xt(this,a,l),o=Math.max(o,l.currentTimeline.currentTime),i.push(l.currentTimeline)}),i.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(o),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let i=t.strValue,o=e.params?Uo(i,e.params,e.errors):i;return Wr(o,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let i=e.currentAnimateTimings=this._visitTiming(t.timings,e),o=e.currentTimeline;i.delay&&(e.incrementTime(i.delay),o.snapshotCurrentStyles());let r=t.style;r.type==ce.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(i.duration),this.visitStyle(r,e),o.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let i=e.currentTimeline,o=e.currentAnimateTimings;!o&&i.hasCurrentStyleProperties()&&i.forwardFrame();let r=o&&o.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(r):i.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let i=e.currentAnimateTimings,o=e.currentTimeline.duration,r=i.duration,l=e.createSubContext().currentTimeline;l.easing=i.easing,t.styles.forEach(p=>{let u=p.offset||0;l.forwardTime(u*r),l.setStyles(p.styles,p.easing,e.errors,e.options),l.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(l),e.transformIntoNewTimeline(o+r),e.previousNode=t}visitQuery(t,e){let i=e.currentTimeline.currentTime,o=t.options||{},r=o.delay?ji(o.delay):0;r&&(e.previousNode.type===ce.Style||i==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=xs);let a=i,l=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!o.optional,e.errors);e.currentQueryTotal=l.length;let p=null;l.forEach((u,b)=>{e.currentQueryIndex=b;let C=e.createSubContext(t.options,u);r&&C.delayNextStep(r),u===e.element&&(p=C.currentTimeline),Xt(this,t.animation,C),C.currentTimeline.applyStylesToKeyframe();let T=C.currentTimeline.currentTime;a=Math.max(a,T)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),p&&(e.currentTimeline.mergeTimelineCollectedStyles(p),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let i=e.parentContext,o=e.currentTimeline,r=t.timings,a=Math.abs(r.duration),l=a*(e.currentQueryTotal-1),p=a*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":p=l-p;break;case"full":p=i.currentStaggerTime;break}let b=e.currentTimeline;p&&b.delayNextStep(p);let C=b.currentTime;Xt(this,t.animation,e),e.previousNode=t,i.currentStaggerTime=o.currentTime-C+(o.startTime-i.currentTimeline.startTime)}},xs={},$c=class n{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=xs;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,i,o,r,a,l,p){this._driver=t,this.element=e,this.subInstructions=i,this._enterClassName=o,this._leaveClassName=r,this.errors=a,this.timelines=l,this.currentTimeline=p||new ws(this._driver,e,0),l.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let i=t,o=this.options;i.duration!=null&&(o.duration=ji(i.duration)),i.delay!=null&&(o.delay=ji(i.delay));let r=i.params;if(r){let a=o.params;a||(a=this.options.params={}),Object.keys(r).forEach(l=>{(!e||!a.hasOwnProperty(l))&&(a[l]=Uo(r[l],a,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let i=t.params={};Object.keys(e).forEach(o=>{i[o]=e[o]})}}return t}createSubContext(t=null,e,i){let o=e||this.element,r=new n(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,i||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=xs,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,i){let o={duration:e??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},r=new qc(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,o,t.stretchStartingKeyframe);return this.timelines.push(r),o}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,i,o,r,a){let l=[];if(o&&l.push(this.element),t.length>0){t=t.replace(p_,"."+this._enterClassName),t=t.replace(g_,"."+this._leaveClassName);let p=i!=1,u=this._driver.query(this.element,t,p);i!==0&&(u=i<0?u.slice(u.length+i,u.length):u.slice(0,i)),l.push(...u)}return!r&&l.length==0&&a.push(Bh(e)),l}},ws=class n{_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(t,e,i,o){this._driver=t,this.element=e,this.startTime=i,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,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(t){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new n(this._driver,t,e||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+=m_,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles.set(t,e),this._globalTimelineStyles.set(t,e),this._styleSummary.set(t,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[e,i]of this._globalTimelineStyles)this._backFill.set(e,i||si),this._currentKeyframe.set(e,si);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,i,o){e&&this._previousKeyframe.set("easing",e);let r=o&&o.params||{},a=f_(t,this._globalTimelineStyles);for(let[l,p]of a){let u=Uo(p,r,i);this._pendingStyles.set(l,u),this._localTimelineStyles.has(l)||this._backFill.set(l,this._globalTimelineStyles.get(l)??si),this._updateStyle(l,u)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((t,e)=>{this._currentKeyframe.set(e,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,t)}))}snapshotCurrentStyles(){for(let[t,e]of this._localTimelineStyles)this._pendingStyles.set(t,e),this._updateStyle(t,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((e,i)=>{let o=this._styleSummary.get(i);(!o||e.time>o.time)&&this._updateStyle(i,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,i=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((l,p)=>{let u=new Map([...this._backFill,...l]);u.forEach((b,C)=>{b===Ho?t.add(C):b===si&&e.add(C)}),i||u.set("offset",p/this.duration),o.push(u)});let r=[...t.values()],a=[...e.values()];if(i){let l=o[0],p=new Map(l);l.set("offset",0),p.set("offset",1),o=[l,p]}return ed(this.element,o,r,a,this.duration,this.startTime,this.easing,!1)}},qc=class extends ws{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,i,o,r,a,l=!1){super(t,e,a.delay),this.keyframes=i,this.preStyleProps=o,this.postStyleProps=r,this._stretchStartingKeyframe=l,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:i,easing:o}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],a=i+e,l=e/a,p=new Map(t[0]);p.set("offset",0),r.push(p);let u=new Map(t[0]);u.set("offset",lp(l)),r.push(u);let b=t.length-1;for(let C=1;C<=b;C++){let T=new Map(t[C]),P=T.get("offset"),k=e+P*i;T.set("offset",lp(k/a)),r.push(T)}i=a,e=0,o="",t=r}return ed(this.element,t,this.preStyleProps,this.postStyleProps,i,e,o,!0)}};function lp(n,t=3){let e=Math.pow(10,t-1);return Math.round(n*e)/e}function f_(n,t){let e=new Map,i;return n.forEach(o=>{if(o==="*"){i??=t.keys();for(let r of i)e.set(r,si)}else for(let[r,a]of o)e.set(r,a)}),e}function cp(n,t,e,i,o,r,a,l,p,u,b,C,T){return{type:0,element:n,triggerName:t,isRemovalTransition:o,fromState:e,fromStyles:r,toState:i,toStyles:a,timelines:l,queriedElements:p,preStyleProps:u,postStyleProps:b,totalTime:C,errors:T}}var Lc={},Ss=class{_triggerName;ast;_stateStyles;constructor(t,e,i){this._triggerName=t,this.ast=e,this._stateStyles=i}match(t,e,i,o){return __(this.ast.matchers,t,e,i,o)}buildStyles(t,e,i){let o=this._stateStyles.get("*");return t!==void 0&&(o=this._stateStyles.get(t?.toString())||o),o?o.buildStyles(e,i):new Map}build(t,e,i,o,r,a,l,p,u,b){let C=[],T=this.ast.options&&this.ast.options.params||Lc,P=l&&l.params||Lc,k=this.buildStyles(i,P,C),z=p&&p.params||Lc,Ce=this.buildStyles(o,z,C),Be=new Set,Je=new Map,et=new Map,_e=o==="void",qt={params:vp(z,T),delay:this.ast.options?.delay},_t=b?[]:bp(t,e,this.ast.animation,r,a,k,Ce,qt,u,C),tt=0;return _t.forEach(Pt=>{tt=Math.max(Pt.duration+Pt.delay,tt)}),C.length?cp(e,this._triggerName,i,o,_e,k,Ce,[],[],Je,et,tt,C):(_t.forEach(Pt=>{let Zi=Pt.element,Sn=Qt(Je,Zi,new Set);Pt.preStyleProps.forEach(ui=>Sn.add(ui));let bt=Qt(et,Zi,new Set);Pt.postStyleProps.forEach(ui=>bt.add(ui)),Zi!==e&&Be.add(Zi)}),cp(e,this._triggerName,i,o,_e,k,Ce,_t,[...Be.values()],Je,et,tt))}};function __(n,t,e,i,o){return n.some(r=>r(t,e,i,o))}function vp(n,t){let e=q({},t);return Object.entries(n).forEach(([i,o])=>{o!=null&&(e[i]=o)}),e}var Gc=class{styles;defaultParams;normalizer;constructor(t,e,i){this.styles=t,this.defaultParams=e,this.normalizer=i}buildStyles(t,e){let i=new Map,o=vp(t,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((a,l)=>{a&&(a=Uo(a,o,e));let p=this.normalizer.normalizePropertyName(l,e);a=this.normalizer.normalizeStyleValue(l,p,a,e),i.set(l,a)})}),i}};function b_(n,t,e){return new Yc(n,t,e)}var Yc=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,i){this.name=t,this.ast=e,this._normalizer=i,e.states.forEach(o=>{let r=o.options&&o.options.params||{};this.states.set(o.name,new Gc(o.style,r,i))}),dp(this.states,"true","1"),dp(this.states,"false","0"),e.transitions.forEach(o=>{this.transitionFactories.push(new Ss(t,o,this.states))}),this.fallbackTransition=v_(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,i,o){return this.transitionFactories.find(a=>a.match(t,e,i,o))||null}matchStyles(t,e,i){return this.fallbackTransition.buildStyles(t,e,i)}};function v_(n,t,e){let i=[(a,l)=>!0],o={type:ce.Sequence,steps:[],options:null},r={type:ce.Transition,animation:o,matchers:i,options:null,queryCount:0,depCount:0};return new Ss(n,r,t)}function dp(n,t,e){n.has(t)?n.has(e)||n.set(e,n.get(t)):n.has(e)&&n.set(t,n.get(e))}var y_=new $r,Qc=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,i){this.bodyNode=t,this._driver=e,this._normalizer=i}register(t,e){let i=[],o=[],r=_p(this._driver,e,i,o);if(i.length)throw $h(i);this._animations.set(t,r)}_buildPlayer(t,e,i){let o=t.element,r=Pc(this._normalizer,t.keyframes,e,i);return this._driver.animate(o,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,i={}){let o=[],r=this._animations.get(t),a,l=new Map;if(r?(a=bp(this._driver,e,r,Rc,hs,new Map,new Map,i,y_,o),a.forEach(b=>{let C=Qt(l,b.element,new Map);b.postStyleProps.forEach(T=>C.set(T,null))})):(o.push(qh()),a=[]),o.length)throw Gh(o);l.forEach((b,C)=>{b.forEach((T,P)=>{b.set(P,this._driver.computeStyle(C,P,si))})});let p=a.map(b=>{let C=l.get(b.element);return this._buildPlayer(b,new Map,C)}),u=an(p);return this._playersById.set(t,u),u.onDestroy(()=>this.destroy(t)),this.players.push(u),u}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let i=this.players.indexOf(e);i>=0&&this.players.splice(i,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw Yh(t);return e}listen(t,e,i,o){let r=ds(e,"","","");return cs(this._getPlayer(t),i,r,o),()=>{}}command(t,e,i,o){if(i=="register"){this.register(t,o[0]);return}if(i=="create"){let a=o[0]||{};this.create(t,e,a);return}let r=this._getPlayer(t);switch(i){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(t);break}}},mp="ng-animate-queued",C_=".ng-animate-queued",jc="ng-animate-disabled",x_=".ng-animate-disabled",w_="ng-star-inserted",S_=".ng-star-inserted",k_=[],yp={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},M_={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},yi="__ng_removed",qr=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let i=t&&t.hasOwnProperty("value"),o=i?t.value:t;if(this.value=T_(o),i){let r=t,{value:a}=r,l=Vm(r,["value"]);this.options=l}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let i=this.options.params;Object.keys(e).forEach(o=>{i[o]==null&&(i[o]=e[o])})}}},Ur="void",zc=new qr(Ur),Xc=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,i){this.id=t,this.hostElement=e,this._engine=i,this._hostClassName="ng-tns-"+t,li(e,this._hostClassName)}listen(t,e,i,o){if(!this._triggers.has(e))throw Qh(i,e);if(i==null||i.length==0)throw Xh(e);if(!P_(i))throw Kh(i,e);let r=Qt(this._elementListeners,t,[]),a={name:e,phase:i,callback:o};r.push(a);let l=Qt(this._engine.statesByElement,t,new Map);return l.has(e)||(li(t,Br),li(t,Br+"-"+e),l.set(e,zc)),()=>{this._engine.afterFlush(()=>{let p=r.indexOf(a);p>=0&&r.splice(p,1),this._triggers.has(e)||l.delete(e)})}}register(t,e){return this._triggers.has(t)?!1:(this._triggers.set(t,e),!0)}_getTrigger(t){let e=this._triggers.get(t);if(!e)throw Zh(t);return e}trigger(t,e,i,o=!0){let r=this._getTrigger(e),a=new Gr(this.id,e,t),l=this._engine.statesByElement.get(t);l||(li(t,Br),li(t,Br+"-"+e),this._engine.statesByElement.set(t,l=new Map));let p=l.get(e),u=new qr(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&p&&u.absorbOptions(p.options),l.set(e,u),p||(p=zc),!(u.value===Ur)&&p.value===u.value){if(!D_(p.params,u.params)){let z=[],Ce=r.matchStyles(p.value,p.params,z),Be=r.matchStyles(u.value,u.params,z);z.length?this._engine.reportError(z):this._engine.afterFlush(()=>{Nn(t,Ce),vi(t,Be)})}return}let T=Qt(this._engine.playersByElement,t,[]);T.forEach(z=>{z.namespaceId==this.id&&z.triggerName==e&&z.queued&&z.destroy()});let P=r.matchTransition(p.value,u.value,t,u.params),k=!1;if(!P){if(!o)return;P=r.fallbackTransition,k=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:P,fromState:p,toState:u,player:a,isFallbackTransition:k}),k||(li(t,mp),a.onStart(()=>{$o(t,mp)})),a.onDone(()=>{let z=this.players.indexOf(a);z>=0&&this.players.splice(z,1);let Ce=this._engine.playersByElement.get(t);if(Ce){let Be=Ce.indexOf(a);Be>=0&&Ce.splice(Be,1)}}),this.players.push(a),T.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,i)=>{this._elementListeners.set(i,e.filter(o=>o.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let i=this._engine.driver.query(t,Hr,!0);i.forEach(o=>{if(o[yi])return;let r=this._engine.fetchNamespacesByElement(o);r.size?r.forEach(a=>a.triggerLeaveAnimation(o,e,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(t,e,i,o){let r=this._engine.statesByElement.get(t),a=new Map;if(r){let l=[];if(r.forEach((p,u)=>{if(a.set(u,p.value),this._triggers.has(u)){let b=this.trigger(t,u,Ur,o);b&&l.push(b)}}),l.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,a),i&&an(l).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(e&&i){let o=new Set;e.forEach(r=>{let a=r.name;if(o.has(a))return;o.add(a);let p=this._triggers.get(a).fallbackTransition,u=i.get(a)||zc,b=new qr(Ur),C=new Gr(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:p,fromState:u,toState:b,player:C,isFallbackTransition:!0})})}}removeNode(t,e){let i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let o=!1;if(i.totalAnimations){let r=i.players.length?i.playersByQueriedElement.get(t):[];if(r&&r.length)o=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(t),o)i.markElementAsRemoved(this.id,t,!1,e);else{let r=t[yi];(!r||r===yp)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,e))}}insertNode(t,e){li(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(i=>{let o=i.player;if(o.destroyed)return;let r=i.element,a=this._elementListeners.get(r);a&&a.forEach(l=>{if(l.name==i.triggerName){let p=ds(r,i.triggerName,i.fromState.value,i.toState.value);p._data=t,cs(i.player,l.phase,p,l.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):e.push(i)}),this._queue=[],e.sort((i,o)=>{let r=i.transition.ast.depCount,a=o.transition.ast.depCount;return r==0||a==0?r-a:this._engine.driver.containsElement(i.element,o.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Kc=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=(t,e)=>{};_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}constructor(t,e,i){this.bodyNode=t,this.driver=e,this._normalizer=i}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,e){let i=new Xc(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(i,e):(this.newHostElements.set(e,i),this.collectEnterElement(e)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,e){let i=this._namespaceList,o=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,l=this.driver.getParentElement(e);for(;l;){let p=o.get(l);if(p){let u=i.indexOf(p);i.splice(u+1,0,t),a=!0;break}l=this.driver.getParentElement(l)}a||i.unshift(t)}else i.push(t);return o.set(e,t),t}register(t,e){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,e)),i}registerTrigger(t,e,i){let o=this._namespaceLookup[t];o&&o.register(e,i)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);let o=this._namespaceList.indexOf(i);o>=0&&this._namespaceList.splice(o,1),i.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,i=this.statesByElement.get(t);if(i){for(let o of i.values())if(o.namespaceId){let r=this._fetchNamespace(o.namespaceId);r&&e.add(r)}}return e}trigger(t,e,i,o){if(bs(e)){let r=this._fetchNamespace(t);if(r)return r.trigger(e,i,o),!0}return!1}insertNode(t,e,i,o){if(!bs(e))return;let r=e[yi];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let a=this.collectedLeaveElements.indexOf(e);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){let a=this._fetchNamespace(t);a&&a.insertNode(e,i)}o&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),li(t,jc)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),$o(t,jc))}removeNode(t,e,i){if(bs(e)){let o=t?this._fetchNamespace(t):null;o?o.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i);let r=this.namespacesByHostElement.get(e);r&&r.id!==t&&r.removeNode(e,i)}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,i,o,r){this.collectedLeaveElements.push(e),e[yi]={namespaceId:t,setForRemoval:o,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:r}}listen(t,e,i,o,r){return bs(e)?this._fetchNamespace(t).listen(e,i,o,r):()=>{}}_buildInstruction(t,e,i,o,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,o,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,Hr,!0);e.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,ps,!0),e.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return an(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[yi];if(e&&e.setForRemoval){if(t[yi]=yp,e.namespaceId){this.destroyInnerAnimations(t);let i=this._fetchNamespace(e.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(jc)&&this.markElementAsDisabled(t,!1),this.driver.query(t,x_,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,o)=>this._balanceNamespaceList(i,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;i<this.collectedEnterElements.length;i++){let o=this.collectedEnterElements[i];li(o,w_)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let i=[];try{e=this._flushAnimations(i,t)}finally{for(let o=0;o<i.length;o++)i[o]()}}else for(let i=0;i<this.collectedLeaveElements.length;i++){let o=this.collectedLeaveElements[i];this.processLeaveNode(o)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(i=>i()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],e.length?an(e).onDone(()=>{i.forEach(o=>o())}):i.forEach(o=>o())}}reportError(t){throw Jh(t)}_flushAnimations(t,e){let i=new $r,o=[],r=new Map,a=[],l=new Map,p=new Map,u=new Map,b=new Set;this.disabledNodes.forEach($=>{b.add($);let Q=this.driver.query($,C_,!0);for(let te=0;te<Q.length;te++)b.add(Q[te])});let C=this.bodyNode,T=Array.from(this.statesByElement.keys()),P=up(T,this.collectedEnterElements),k=new Map,z=0;P.forEach(($,Q)=>{let te=Rc+z++;k.set(Q,te),$.forEach(be=>li(be,te))});let Ce=[],Be=new Set,Je=new Set;for(let $=0;$<this.collectedLeaveElements.length;$++){let Q=this.collectedLeaveElements[$],te=Q[yi];te&&te.setForRemoval&&(Ce.push(Q),Be.add(Q),te.hasAnimation?this.driver.query(Q,S_,!0).forEach(be=>Be.add(be)):Je.add(Q))}let et=new Map,_e=up(T,Array.from(Be));_e.forEach(($,Q)=>{let te=hs+z++;et.set(Q,te),$.forEach(be=>li(be,te))}),t.push(()=>{P.forEach(($,Q)=>{let te=k.get(Q);$.forEach(be=>$o(be,te))}),_e.forEach(($,Q)=>{let te=et.get(Q);$.forEach(be=>$o(be,te))}),Ce.forEach($=>{this.processLeaveNode($)})});let qt=[],_t=[];for(let $=this._namespaceList.length-1;$>=0;$--)this._namespaceList[$].drainQueuedTransitions(e).forEach(te=>{let be=te.player,lt=te.element;if(qt.push(be),this.collectedEnterElements.length){let mt=lt[yi];if(mt&&mt.setForMove){if(mt.previousTriggersValues&&mt.previousTriggersValues.has(te.triggerName)){let Gt=mt.previousTriggersValues.get(te.triggerName),Nt=this.statesByElement.get(te.element);if(Nt&&Nt.has(te.triggerName)){let kn=Nt.get(te.triggerName);kn.value=Gt,Nt.set(te.triggerName,kn)}}be.destroy();return}}let Ee=!C||!this.driver.containsElement(C,lt),Ot=et.get(lt),Ne=k.get(lt),Ve=this._buildInstruction(te,i,Ne,Ot,Ee);if(Ve.errors&&Ve.errors.length){_t.push(Ve);return}if(Ee){be.onStart(()=>Nn(lt,Ve.fromStyles)),be.onDestroy(()=>vi(lt,Ve.toStyles)),o.push(be);return}if(te.isFallbackTransition){be.onStart(()=>Nn(lt,Ve.fromStyles)),be.onDestroy(()=>vi(lt,Ve.toStyles)),o.push(be);return}let $e=[];Ve.timelines.forEach(mt=>{mt.stretchStartingKeyframe=!0,this.disabledNodes.has(mt.element)||$e.push(mt)}),Ve.timelines=$e,i.append(lt,Ve.timelines);let Gn={instruction:Ve,player:be,element:lt};a.push(Gn),Ve.queriedElements.forEach(mt=>Qt(l,mt,[]).push(be)),Ve.preStyleProps.forEach((mt,Gt)=>{if(mt.size){let Nt=p.get(Gt);Nt||p.set(Gt,Nt=new Set),mt.forEach((kn,Eo)=>Nt.add(Eo))}}),Ve.postStyleProps.forEach((mt,Gt)=>{let Nt=u.get(Gt);Nt||u.set(Gt,Nt=new Set),mt.forEach((kn,Eo)=>Nt.add(Eo))})});if(_t.length){let $=[];_t.forEach(Q=>{$.push(ep(Q.triggerName,Q.errors))}),qt.forEach(Q=>Q.destroy()),this.reportError($)}let tt=new Map,Pt=new Map;a.forEach($=>{let Q=$.element;i.has(Q)&&(Pt.set(Q,Q),this._beforeAnimationBuild($.player.namespaceId,$.instruction,tt))}),o.forEach($=>{let Q=$.element;this._getPreviousPlayers(Q,!1,$.namespaceId,$.triggerName,null).forEach(be=>{Qt(tt,Q,[]).push(be),be.destroy()})});let Zi=Ce.filter($=>gp($,p,u)),Sn=new Map;pp(Sn,this.driver,Je,u,si).forEach($=>{gp($,p,u)&&Zi.push($)});let ui=new Map;P.forEach(($,Q)=>{pp(ui,this.driver,new Set($),p,Ho)}),Zi.forEach($=>{let Q=Sn.get($),te=ui.get($);Sn.set($,new Map([...Q?.entries()??[],...te?.entries()??[]]))});let qn=[],Mo=[],Ia={};a.forEach($=>{let{element:Q,player:te,instruction:be}=$;if(i.has(Q)){if(b.has(Q)){te.onDestroy(()=>vi(Q,be.toStyles)),te.disabled=!0,te.overrideTotalTime(be.totalTime),o.push(te);return}let lt=Ia;if(Pt.size>1){let Ot=Q,Ne=[];for(;Ot=Ot.parentNode;){let Ve=Pt.get(Ot);if(Ve){lt=Ve;break}Ne.push(Ot)}Ne.forEach(Ve=>Pt.set(Ve,lt))}let Ee=this._buildAnimation(te.namespaceId,be,tt,r,ui,Sn);if(te.setRealPlayer(Ee),lt===Ia)qn.push(te);else{let Ot=this.playersByElement.get(lt);Ot&&Ot.length&&(te.parentPlayer=an(Ot)),o.push(te)}}else Nn(Q,be.fromStyles),te.onDestroy(()=>vi(Q,be.toStyles)),Mo.push(te),b.has(Q)&&o.push(te)}),Mo.forEach($=>{let Q=r.get($.element);if(Q&&Q.length){let te=an(Q);$.setRealPlayer(te)}}),o.forEach($=>{$.parentPlayer?$.syncPlayerEvents($.parentPlayer):$.destroy()});for(let $=0;$<Ce.length;$++){let Q=Ce[$],te=Q[yi];if($o(Q,hs),te&&te.hasAnimation)continue;let be=[];if(l.size){let Ee=l.get(Q);Ee&&Ee.length&&be.push(...Ee);let Ot=this.driver.query(Q,ps,!0);for(let Ne=0;Ne<Ot.length;Ne++){let Ve=l.get(Ot[Ne]);Ve&&Ve.length&&be.push(...Ve)}}let lt=be.filter(Ee=>!Ee.destroyed);lt.length?O_(this,Q,lt):this.processLeaveNode(Q)}return Ce.length=0,qn.forEach($=>{this.players.push($),$.onDone(()=>{$.destroy();let Q=this.players.indexOf($);this.players.splice(Q,1)}),$.play()}),qn}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,i,o,r){let a=[];if(e){let l=this.playersByQueriedElement.get(t);l&&(a=l)}else{let l=this.playersByElement.get(t);if(l){let p=!r||r==Ur;l.forEach(u=>{u.queued||!p&&u.triggerName!=o||a.push(u)})}}return(i||o)&&(a=a.filter(l=>!(i&&i!=l.namespaceId||o&&o!=l.triggerName))),a}_beforeAnimationBuild(t,e,i){let o=e.triggerName,r=e.element,a=e.isRemovalTransition?void 0:t,l=e.isRemovalTransition?void 0:o;for(let p of e.timelines){let u=p.element,b=u!==r,C=Qt(i,u,[]);this._getPreviousPlayers(u,b,a,l,e.toState).forEach(P=>{let k=P.getRealPlayer();k.beforeDestroy&&k.beforeDestroy(),P.destroy(),C.push(P)})}Nn(r,e.fromStyles)}_buildAnimation(t,e,i,o,r,a){let l=e.triggerName,p=e.element,u=[],b=new Set,C=new Set,T=e.timelines.map(k=>{let z=k.element;b.add(z);let Ce=z[yi];if(Ce&&Ce.removedBeforeQueried)return new Li(k.duration,k.delay);let Be=z!==p,Je=A_((i.get(z)||k_).map(tt=>tt.getRealPlayer())).filter(tt=>{let Pt=tt;return Pt.element?Pt.element===z:!1}),et=r.get(z),_e=a.get(z),qt=Pc(this._normalizer,k.keyframes,et,_e),_t=this._buildPlayer(k,qt,Je);if(k.subTimeline&&o&&C.add(z),Be){let tt=new Gr(t,l,z);tt.setRealPlayer(_t),u.push(tt)}return _t});u.forEach(k=>{Qt(this.playersByQueriedElement,k.element,[]).push(k),k.onDone(()=>E_(this.playersByQueriedElement,k.element,k))}),b.forEach(k=>li(k,Fc));let P=an(T);return P.onDestroy(()=>{b.forEach(k=>$o(k,Fc)),vi(p,e.toStyles)}),C.forEach(k=>{Qt(o,k,[]).push(P)}),P}_buildPlayer(t,e,i){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,i):new Li(t.duration,t.delay)}},Gr=class{namespaceId;triggerName;element;_player=new Li;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,i){this.namespaceId=t,this.triggerName=e,this.element=i}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,i)=>{e.forEach(o=>cs(t,i,void 0,o))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){let e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){Qt(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}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(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){let e=this._player;e.triggerCallback&&e.triggerCallback(t)}};function E_(n,t,e){let i=n.get(t);if(i){if(i.length){let o=i.indexOf(e);i.splice(o,1)}i.length==0&&n.delete(t)}return i}function T_(n){return n??null}function bs(n){return n&&n.nodeType===1}function P_(n){return n=="start"||n=="done"}function hp(n,t){let e=n.style.display;return n.style.display=t??"none",e}function pp(n,t,e,i,o){let r=[];e.forEach(p=>r.push(hp(p)));let a=[];i.forEach((p,u)=>{let b=new Map;p.forEach(C=>{let T=t.computeStyle(u,C,o);b.set(C,T),(!T||T.length==0)&&(u[yi]=M_,a.push(u))}),n.set(u,b)});let l=0;return e.forEach(p=>hp(p,r[l++])),a}function up(n,t){let e=new Map;if(n.forEach(l=>e.set(l,[])),t.length==0)return e;let i=1,o=new Set(t),r=new Map;function a(l){if(!l)return i;let p=r.get(l);if(p)return p;let u=l.parentNode;return e.has(u)?p=u:o.has(u)?p=i:p=a(u),r.set(l,p),p}return t.forEach(l=>{let p=a(l);p!==i&&e.get(p).push(l)}),e}function li(n,t){n.classList?.add(t)}function $o(n,t){n.classList?.remove(t)}function O_(n,t,e){an(e).onDone(()=>n.processLeaveNode(t))}function A_(n){let t=[];return Cp(n,t),t}function Cp(n,t){for(let e=0;e<n.length;e++){let i=n[e];i instanceof io?Cp(i.players,t):t.push(i)}}function D_(n,t){let e=Object.keys(n),i=Object.keys(t);if(e.length!=i.length)return!1;for(let o=0;o<e.length;o++){let r=e[o];if(!t.hasOwnProperty(r)||n[r]!==t[r])return!1}return!0}function gp(n,t,e){let i=e.get(n);if(!i)return!1;let o=t.get(n);return o?i.forEach(r=>o.add(r)):t.set(n,i),e.delete(n),!0}var qo=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,i){this._driver=e,this._normalizer=i,this._transitionEngine=new Kc(t.body,e,i),this._timelineEngine=new Qc(t.body,e,i),this._transitionEngine.onRemovalComplete=(o,r)=>this.onRemovalComplete(o,r)}registerTrigger(t,e,i,o,r){let a=t+"-"+o,l=this._triggerCache[a];if(!l){let p=[],u=[],b=_p(this._driver,r,p,u);if(p.length)throw Uh(o,p);l=b_(o,b,this._normalizer),this._triggerCache[a]=l}this._transitionEngine.registerTrigger(e,o,l)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,i,o){this._transitionEngine.insertNode(t,e,i,o)}onRemove(t,e,i){this._transitionEngine.removeNode(t,e,i)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,i,o){if(i.charAt(0)=="@"){let[r,a]=Oc(i),l=o;this._timelineEngine.command(r,e,a,l)}else this._transitionEngine.trigger(t,e,i,o)}listen(t,e,i,o,r){if(i.charAt(0)=="@"){let[a,l]=Oc(i);return this._timelineEngine.listen(a,e,l,r)}return this._transitionEngine.listen(t,e,i,o,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}};function I_(n,t){let e=null,i=null;return Array.isArray(t)&&t.length?(e=Bc(t[0]),t.length>1&&(i=Bc(t[t.length-1]))):t instanceof Map&&(e=Bc(t)),e||i?new R_(n,e,i):null}var R_=(()=>{class n{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,i,o){this._element=e,this._startStyles=i,this._endStyles=o;let r=n.initialStylesByElement.get(e);r||n.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&vi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vi(this._element,this._initialStyles),this._endStyles&&(vi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(Nn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Nn(this._element,this._endStyles),this._endStyles=null),vi(this._element,this._initialStyles),this._state=3)}}return n})();function Bc(n){let t=null;return n.forEach((e,i)=>{F_(i)&&(t=t||new Map,t.set(i,e))}),t}function F_(n){return n==="display"||n==="position"}var ks=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(t,e,i,o){this.element=t,this.keyframes=e,this.options=i,this._specialStyles=o,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;let e=()=>this._onFinish();this.domPlayer.addEventListener("finish",e),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",e)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){let e=[];return t.forEach(i=>{e.push(Object.fromEntries(i))}),e}_triggerWebAnimation(t,e,i){return t.animate(this._convertKeyframesToObject(e),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,o)=>{o!=="offset"&&t.set(o,this._finished?i:gs(this.element,o))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},Ms=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return Ac(t,e)}getParentElement(t){return ms(t)}query(t,e,i){return Dc(t,e,i)}computeStyle(t,e,i){return gs(t,e)}animate(t,e,i,o,r,a=[]){let l=o==0?"both":"forwards",p={duration:i,delay:o,fill:l};r&&(p.easing=r);let u=new Map,b=a.filter(P=>P instanceof ks);op(i,o)&&b.forEach(P=>{P.currentSnapshot.forEach((k,z)=>u.set(z,k))});let C=ip(e).map(P=>new Map(P));C=rp(t,C,u);let T=I_(t,C);return new ks(t,C,p,T)}};var vs="@",xp="@.disabled",Es=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,i,o){this.namespaceId=t,this.delegate=e,this.engine=i,this._onDestroy=o}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,i,o=!0){this.delegate.insertBefore(t,e,i),this.engine.onInsert(this.namespaceId,e,t,o)}removeChild(t,e,i,o){if(o){this.delegate.removeChild(t,e,i);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,i,o){this.delegate.setAttribute(t,e,i,o)}removeAttribute(t,e,i){this.delegate.removeAttribute(t,e,i)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,i,o){this.delegate.setStyle(t,e,i,o)}removeStyle(t,e,i){this.delegate.removeStyle(t,e,i)}setProperty(t,e,i){e.charAt(0)==vs&&e==xp?this.disableAnimations(t,!!i):this.delegate.setProperty(t,e,i)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,i,o){return this.delegate.listen(t,e,i,o)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},Zc=class extends Es{factory;constructor(t,e,i,o,r){super(e,i,o,r),this.factory=t,this.namespaceId=e}setProperty(t,e,i){e.charAt(0)==vs?e.charAt(1)=="."&&e==xp?(i=i===void 0?!0:!!i,this.disableAnimations(t,i)):this.engine.process(this.namespaceId,t,e.slice(1),i):this.delegate.setProperty(t,e,i)}listen(t,e,i,o){if(e.charAt(0)==vs){let r=N_(t),a=e.slice(1),l="";return a.charAt(0)!=vs&&([a,l]=V_(a)),this.engine.listen(this.namespaceId,r,a,l,p=>{let u=p._data||-1;this.factory.scheduleListenerCallback(u,i,p)})}return this.delegate.listen(t,e,i,o)}};function N_(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}function V_(n){let t=n.indexOf("."),e=n.substring(0,t),i=n.slice(t+1);return[e,i]}var Ts=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,i){this.delegate=t,this.engine=e,this._zone=i,e.onRemovalComplete=(o,r)=>{r?.removeChild(null,o)}}createRenderer(t,e){let o=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let u=this._rendererCache,b=u.get(o);if(!b){let C=()=>u.delete(o);b=new Es("",o,this.engine,C),u.set(o,b)}return b}let r=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);let l=u=>{Array.isArray(u)?u.forEach(l):this.engine.registerTrigger(r,a,t,u.name,u)};return e.data.animation.forEach(l),new Zc(this,a,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,i){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(i));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(r=>{let[a,l]=r;a(l)}),this._animationCallbacksBuffer=[]})}),o.push([e,i])}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(t){this.engine.flush(),this.delegate.componentReplaced?.(t)}};var j_=(()=>{class n extends qo{constructor(e,i,o){super(e,i,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||n)(Ha(it),Ha(ro),Ha(ao))};static \u0275prov=R({token:n,factory:n.\u0275fac})}return n})();function z_(){return new ys}function B_(n,t,e){return new Ts(n,t,e)}var wp=[{provide:ao,useFactory:z_},{provide:qo,useClass:j_},{provide:gi,useFactory:B_,deps:[hh,qo,me]}],hk=[{provide:ro,useClass:Jc},{provide:Rr,useValue:"NoopAnimations"},...wp],H_=[{provide:ro,useFactory:()=>new Ms},{provide:Rr,useFactory:()=>"BrowserAnimations"},...wp];function Sp(){return Km("NgEagerAnimations"),[...H_]}var Yr=class{_attachedHost;attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;t!=null&&(this._attachedHost=null,t.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(t){this._attachedHost=t}},Ci=class extends Yr{component;viewContainerRef;injector;projectableNodes;constructor(t,e,i,o){super(),this.component=t,this.viewContainerRef=e,this.injector=i,this.projectableNodes=o}},sn=class extends Yr{templateRef;viewContainerRef;context;injector;constructor(t,e,i,o){super(),this.templateRef=t,this.viewContainerRef=e,this.context=i,this.injector=o}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}},td=class extends Yr{element;constructor(t){super(),this.element=t instanceof K?t.nativeElement:t}},Vn=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof Ci)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof sn)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof td)return this._attachedPortal=t,this.attachDomPortal(t)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},Ps=class extends Vn{outletElement;_appRef;_defaultInjector;constructor(t,e,i){super(),this.outletElement=t,this._appRef=e,this._defaultInjector=i}attachComponentPortal(t){let e;if(t.viewContainerRef){let i=t.injector||t.viewContainerRef.injector,o=i.get(_c,null,{optional:!0})||void 0;e=t.viewContainerRef.createComponent(t.component,{index:t.viewContainerRef.length,injector:i,ngModuleRef:o,projectableNodes:t.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let i=this._appRef,o=t.injector||this._defaultInjector||ge.NULL,r=o.get(Wa,i.injector);e=lh(t.component,{elementInjector:o,environmentInjector:r,projectableNodes:t.projectableNodes||void 0}),i.attachView(e.hostView),this.setDisposeFn(()=>{i.viewCount>0&&i.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=t,e}attachTemplatePortal(t){let e=t.viewContainerRef,i=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return i.rootNodes.forEach(o=>this.outletElement.appendChild(o)),i.detectChanges(),this.setDisposeFn(()=>{let o=e.indexOf(i);o!==-1&&e.remove(o)}),this._attachedPortal=t,i}attachDomPortal=t=>{let e=t.element;e.parentNode;let i=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(i,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(e,i)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var Ln=(()=>{class n extends Vn{_moduleRef=d(_c,{optional:!0});_document=d(it);_viewContainerRef=d(Zn);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}attached=new H;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let i=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,o=i.createComponent(e.component,{index:i.length,injector:e.injector||i.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=e,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(e){e.setAttachedHost(this);let i=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=i,this.attached.emit(i),i}attachDomPortal=e=>{let i=e.element;i.parentNode;let o=this._document.createComment("dom-portal");e.setAttachedHost(this),i.parentNode.insertBefore(o,i),this._getRootNode().appendChild(i),this._attachedPortal=e,super.setDisposeFn(()=>{o.parentNode&&o.parentNode.replaceChild(i,o)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ye]})}return n})();var ln=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({})}return n})();var W_=20,cn=(()=>{class n{_ngZone=d(me);_platform=d(rt);_renderer=d(gi).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new D;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let i=this.scrollContainers.get(e);i&&(i.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=W_){return this._platform.isBrowser?new oi(i=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let o=e>0?this._scrolled.pipe(gc(e)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):kt()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(e,i){let o=this.getAncestorScrollContainers(e);return this.scrolled(i).pipe(pe(r=>!r||o.indexOf(r)>-1))}getAncestorScrollContainers(e){let i=[];return this.scrollContainers.forEach((o,r)=>{this._scrollableContainsElement(r,e)&&i.push(r)}),i}_scrollableContainsElement(e,i){let o=jr(i),r=e.getElementRef().nativeElement;do if(o==r)return!0;while(o=o.parentElement);return!1}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),dn=(()=>{class n{elementRef=d(K);scrollDispatcher=d(cn);ngZone=d(me);dir=d(Ct,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new D;_renderer=d(ot);_cleanupScroll;_elementScrolled=new D;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){let i=this.elementRef.nativeElement,o=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=o?e.end:e.start),e.right==null&&(e.right=o?e.start:e.end),e.bottom!=null&&(e.top=i.scrollHeight-i.clientHeight-e.bottom),o&&Bo()!=zo.NORMAL?(e.left!=null&&(e.right=i.scrollWidth-i.clientWidth-e.left),Bo()==zo.INVERTED?e.left=e.right:Bo()==zo.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=i.scrollWidth-i.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let i=this.elementRef.nativeElement;os()?i.scrollTo(e):(e.top!=null&&(i.scrollTop=e.top),e.left!=null&&(i.scrollLeft=e.left))}measureScrollOffset(e){let i="left",o="right",r=this.elementRef.nativeElement;if(e=="top")return r.scrollTop;if(e=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let a=this.dir&&this.dir.value=="rtl";return e=="start"?e=a?o:i:e=="end"&&(e=a?i:o),a&&Bo()==zo.INVERTED?e==i?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:a&&Bo()==zo.NEGATED?e==i?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==i?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return n})(),U_=20,Bi=(()=>{class n{_platform=d(rt);_listeners;_viewportSize;_change=new D;_document=d(it);constructor(){let e=d(me),i=d(gi).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let o=r=>this._change.next(r);this._listeners=[i.listen("window","resize",o),i.listen("window","orientationchange",o)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:i,height:o}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+o,right:e.left+i,height:o,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,i=this._getWindow(),o=e.documentElement,r=o.getBoundingClientRect(),a=-r.top||e.body.scrollTop||i.scrollY||o.scrollTop||0,l=-r.left||e.body.scrollLeft||i.scrollX||o.scrollLeft||0;return{top:a,left:l}}change(e=U_){return e>0?this._change.pipe(gc(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var zi=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({})}return n})(),id=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[zr,zi,zr,zi]})}return n})();var kp=os();function Qo(n){return new Os(n.get(Bi),n.get(it))}var Os=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(t,e){this._viewportRuler=t,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=dt(-this._previousScrollPosition.left),t.style.top=dt(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,e=this._document.body,i=t.style,o=e.style,r=i.scrollBehavior||"",a=o.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),kp&&(i.scrollBehavior=o.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),kp&&(i.scrollBehavior=r,o.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,i=this._viewportRuler.getViewportSize();return e.scrollHeight>i.height||e.scrollWidth>i.width}};function Dp(n,t){return new As(n.get(cn),n.get(me),n.get(Bi),t)}var As=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(t,e,i,o){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=i,this._config=o}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(pe(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var Qr=class{enable(){}disable(){}attach(){}};function nd(n,t){return t.some(e=>{let i=n.bottom<e.top,o=n.top>e.bottom,r=n.right<e.left,a=n.left>e.right;return i||o||r||a})}function Mp(n,t){return t.some(e=>{let i=n.top<e.top,o=n.bottom>e.bottom,r=n.left<e.left,a=n.right>e.right;return i||o||r||a})}function Hi(n,t){return new Ds(n.get(cn),n.get(Bi),n.get(me),t)}var Ds=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(t,e,i,o){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this._config=o}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(!this._scrollSubscription){let t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:o}=this._viewportRuler.getViewportSize();nd(e,[{width:i,height:o,bottom:o,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},Ip=(()=>{class n{_injector=d(ge);constructor(){}noop=()=>new Qr;close=e=>Dp(this._injector,e);block=()=>Qo(this._injector);reposition=e=>Hi(this._injector,e);static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),mn=class{positionStrategy;scrollStrategy=new Qr;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(t){if(t){let e=Object.keys(t);for(let i of e)t[i]!==void 0&&(this[i]=t[i])}}};var Is=class{connectionPair;scrollableViewProperties;constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var Rp=(()=>{class n{_attachedOverlays=[];_document=d(it);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let i=this._attachedOverlays.indexOf(e);i>-1&&this._attachedOverlays.splice(i,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Fp=(()=>{class n extends Rp{_ngZone=d(me);_renderer=d(gi).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=e=>{let i=this._attachedOverlays;for(let o=i.length-1;o>-1;o--)if(i[o]._keydownEvents.observers.length>0){this._ngZone.run(()=>i[o]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Np=(()=>{class n extends Rp{_platform=d(rt);_ngZone=d(me);_renderer=d(gi).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let i=this._document.body,o={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(i,"pointerdown",this._pointerDownListener,o),r.listen(i,"click",this._clickListener,o),r.listen(i,"auxclick",this._clickListener,o),r.listen(i,"contextmenu",this._clickListener,o)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=Ja(e)};_clickListener=e=>{let i=Ja(e),o=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:i;this._pointerDownEventTarget=null;let r=this._attachedOverlays.slice();for(let a=r.length-1;a>-1;a--){let l=r[a];if(l._outsidePointerEvents.observers.length<1||!l.hasAttached())continue;if(Ep(l.overlayElement,i)||Ep(l.overlayElement,o))break;let p=l._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>p.next(e)):p.next(e)}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Ep(n,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,i=t;for(;i;){if(i===n)return!0;i=e&&i instanceof ShadowRoot?i.host:i.parentNode}return!1}var Vp=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(i,o){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
|
|
2
|
-
`],encapsulation:2,changeDetection:0})}return n})(),Ns=(()=>{class n{_platform=d(rt);_containerElement;_document=d(it);_styleLoader=d(Lt);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||wc()){let o=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<o.length;r++)o[r].remove()}let i=this._document.createElement("div");i.classList.add(e),wc()?i.setAttribute("platform","test"):this._platform.isBrowser||i.setAttribute("platform","server"),this._document.body.appendChild(i),this._containerElement=i}_loadStyles(){this._styleLoader.load(Vp)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),od=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,e,i,o){this._renderer=e,this._ngZone=i,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",o)}detach(){this._ngZone.runOutsideAngular(()=>{let t=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),t.style.pointerEvents="none",t.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Go=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new D;_attachments=new D;_detachments=new D;_positionStrategy;_scrollStrategy;_locationChanges=Di.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new D;_outsidePointerEvents=new D;_afterNextRenderRef;constructor(t,e,i,o,r,a,l,p,u,b=!1,C,T){this._portalOutlet=t,this._host=e,this._pane=i,this._config=o,this._ngZone=r,this._keyboardDispatcher=a,this._document=l,this._location=p,this._outsideClickDispatcher=u,this._animationsDisabled=b,this._injector=C,this._renderer=T,o.scrollStrategy&&(this._scrollStrategy=o.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=o.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Et(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,t&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=q(q({},this._config),t),this._updateElementSize()}setDirection(t){this._config=Ie(q({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=dt(this._config.width),t.height=dt(this._config.height),t.minWidth=dt(this._config.minWidth),t.minHeight=dt(this._config.minHeight),t.maxWidth=dt(this._config.maxWidth),t.maxHeight=dt(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new od(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(t))}):this._backdropRef.element.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(t,e,i){let o=Cc(e||[]).filter(r=>!!r);o.length&&(i?t.classList.add(...o):t.classList.remove(...o))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=Et(()=>{t=!0,this._detachContent()},{injector:this._injector})}catch(e){if(t)throw e;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let t=this._scrollStrategy;t?.disable(),t?.detach?.()}},Tp="cdk-overlay-connected-position-bounding-box",q_=/([A-Za-z%]+)$/;function Xr(n,t){return new Rs(t,n.get(Bi),n.get(it),n.get(rt),n.get(Ns))}var Rs=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new D;_resizeSubscription=Di.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(t,e,i,o,r){this._viewportRuler=e,this._document=i,this._platform=o,this._overlayContainer=r,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(Tp),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._originRect,e=this._overlayRect,i=this._viewportRect,o=this._containerRect,r=[],a;for(let l of this._preferredPositions){let p=this._getOriginPoint(t,o,l),u=this._getOverlayPoint(p,e,l),b=this._getOverlayFit(u,e,i,l);if(b.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(l,p);return}if(this._canFitWithFlexibleDimensions(b,u,i)){r.push({position:l,origin:p,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(p,l)});continue}(!a||a.overlayFit.visibleArea<b.visibleArea)&&(a={overlayFit:b,overlayPoint:u,originPoint:p,position:l,overlayRect:e})}if(r.length){let l=null,p=-1;for(let u of r){let b=u.boundingBoxRect.width*u.boundingBoxRect.height*(u.position.weight||1);b>p&&(p=b,l=u)}this._isPushed=!1,this._applyPosition(l.position,l.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&so(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Tp),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,e)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,t.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e,i){let o;if(i.originX=="center")o=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,l=this._isRtl()?t.left:t.right;o=i.originX=="start"?a:l}e.left<0&&(o-=e.left);let r;return i.originY=="center"?r=t.top+t.height/2:r=i.originY=="top"?t.top:t.bottom,e.top<0&&(r-=e.top),{x:o,y:r}}_getOverlayPoint(t,e,i){let o;i.overlayX=="center"?o=-e.width/2:i.overlayX==="start"?o=this._isRtl()?-e.width:0:o=this._isRtl()?0:-e.width;let r;return i.overlayY=="center"?r=-e.height/2:r=i.overlayY=="top"?0:-e.height,{x:t.x+o,y:t.y+r}}_getOverlayFit(t,e,i,o){let r=Op(e),{x:a,y:l}=t,p=this._getOffset(o,"x"),u=this._getOffset(o,"y");p&&(a+=p),u&&(l+=u);let b=0-a,C=a+r.width-i.width,T=0-l,P=l+r.height-i.height,k=this._subtractOverflows(r.width,b,C),z=this._subtractOverflows(r.height,T,P),Ce=k*z;return{visibleArea:Ce,isCompletelyWithinViewport:r.width*r.height===Ce,fitsInViewportVertically:z===r.height,fitsInViewportHorizontally:k==r.width}}_canFitWithFlexibleDimensions(t,e,i){if(this._hasFlexibleDimensions){let o=i.bottom-e.y,r=i.right-e.x,a=Pp(this._overlayRef.getConfig().minHeight),l=Pp(this._overlayRef.getConfig().minWidth),p=t.fitsInViewportVertically||a!=null&&a<=o,u=t.fitsInViewportHorizontally||l!=null&&l<=r;return p&&u}return!1}_pushOverlayOnScreen(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let o=Op(e),r=this._viewportRect,a=Math.max(t.x+o.width-r.width,0),l=Math.max(t.y+o.height-r.height,0),p=Math.max(r.top-i.top-t.y,0),u=Math.max(r.left-i.left-t.x,0),b=0,C=0;return o.width<=r.width?b=u||-a:b=t.x<this._viewportMargin?r.left-i.left-t.x:0,o.height<=r.height?C=p||-l:C=t.y<this._viewportMargin?r.top-i.top-t.y:0,this._previousPushAmount={x:b,y:C},{x:t.x+b,y:t.y+C}}_applyPosition(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._positionChanges.observers.length){let i=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!G_(this._lastScrollVisibility,i)){let o=new Is(t,i);this._positionChanges.next(o)}this._lastScrollVisibility=i}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),i,o=t.overlayY;t.overlayX==="center"?i="center":this._isRtl()?i=t.overlayX==="start"?"right":"left":i=t.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${i} ${o}`}_calculateBoundingBoxRect(t,e){let i=this._viewportRect,o=this._isRtl(),r,a,l;if(e.overlayY==="top")a=t.y,r=i.height-a+this._viewportMargin;else if(e.overlayY==="bottom")l=i.height-t.y+this._viewportMargin*2,r=i.height-l+this._viewportMargin;else{let P=Math.min(i.bottom-t.y+i.top,t.y),k=this._lastBoundingBoxSize.height;r=P*2,a=t.y-P,r>k&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-k/2)}let p=e.overlayX==="start"&&!o||e.overlayX==="end"&&o,u=e.overlayX==="end"&&!o||e.overlayX==="start"&&o,b,C,T;if(u)T=i.width-t.x+this._viewportMargin*2,b=t.x-this._viewportMargin;else if(p)C=t.x,b=i.right-t.x;else{let P=Math.min(i.right-t.x+i.left,t.x),k=this._lastBoundingBoxSize.width;b=P*2,C=t.x-P,b>k&&!this._isInitialRender&&!this._growAfterOpen&&(C=t.x-k/2)}return{top:a,left:C,bottom:l,right:T,width:b,height:r}}_setBoundingBoxStyles(t,e){let i=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));let o={};if(this._hasExactPosition())o.top=o.left="0",o.bottom=o.right=o.maxHeight=o.maxWidth="",o.width=o.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;o.height=dt(i.height),o.top=dt(i.top),o.bottom=dt(i.bottom),o.width=dt(i.width),o.left=dt(i.left),o.right=dt(i.right),e.overlayX==="center"?o.alignItems="center":o.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?o.justifyContent="center":o.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(o.maxHeight=dt(r)),a&&(o.maxWidth=dt(a))}this._lastBoundingBoxSize=i,so(this._boundingBox.style,o)}_resetBoundingBoxStyles(){so(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){so(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let i={},o=this._hasExactPosition(),r=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(o){let b=this._viewportRuler.getViewportScrollPosition();so(i,this._getExactOverlayY(e,t,b)),so(i,this._getExactOverlayX(e,t,b))}else i.position="static";let l="",p=this._getOffset(e,"x"),u=this._getOffset(e,"y");p&&(l+=`translateX(${p}px) `),u&&(l+=`translateY(${u}px)`),i.transform=l.trim(),a.maxHeight&&(o?i.maxHeight=dt(a.maxHeight):r&&(i.maxHeight="")),a.maxWidth&&(o?i.maxWidth=dt(a.maxWidth):r&&(i.maxWidth="")),so(this._pane.style,i)}_getExactOverlayY(t,e,i){let o={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;o.bottom=`${a-(r.y+this._overlayRect.height)}px`}else o.top=dt(r.y);return o}_getExactOverlayX(t,e,i){let o={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let l=this._document.documentElement.clientWidth;o.right=`${l-(r.x+this._overlayRect.width)}px`}else o.left=dt(r.x);return o}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map(o=>o.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Mp(t,i),isOriginOutsideView:nd(t,i),isOverlayClipped:Mp(e,i),isOverlayOutsideView:nd(e,i)}}_subtractOverflows(t,...e){return e.reduce((i,o)=>i-Math.max(o,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return e==="x"?t.offsetX==null?this._offsetX:t.offsetX:t.offsetY==null?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&Cc(t).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){let t=this._origin;if(t instanceof K)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}}};function so(n,t){for(let e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}function Pp(n){if(typeof n!="number"&&n!=null){let[t,e]=n.split(q_);return!e||e==="px"?parseFloat(t):null}return n||null}function Op(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}function G_(n,t){return n===t?!0:n.isOriginClipped===t.isOriginClipped&&n.isOriginOutsideView===t.isOriginOutsideView&&n.isOverlayClipped===t.isOverlayClipped&&n.isOverlayOutsideView===t.isOverlayOutsideView}var Ap="cdk-global-overlay-wrapper";function jn(n){return new Fs}var Fs=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(t){let e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(Ap),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:o,height:r,maxWidth:a,maxHeight:l}=i,p=(o==="100%"||o==="100vw")&&(!a||a==="100%"||a==="100vw"),u=(r==="100%"||r==="100vh")&&(!l||l==="100%"||l==="100vh"),b=this._xPosition,C=this._xOffset,T=this._overlayRef.getConfig().direction==="rtl",P="",k="",z="";p?z="flex-start":b==="center"?(z="center",T?k=C:P=C):T?b==="left"||b==="end"?(z="flex-end",P=C):(b==="right"||b==="start")&&(z="flex-start",k=C):b==="left"||b==="start"?(z="flex-start",P=C):(b==="right"||b==="end")&&(z="flex-end",k=C),t.position=this._cssPosition,t.marginLeft=p?"0":P,t.marginTop=u?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=p?"0":k,e.justifyContent=z,e.alignItems=u?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,i=e.style;e.classList.remove(Ap),i.justifyContent=i.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},Lp=(()=>{class n{_injector=d(ge);constructor(){}global(){return jn()}flexibleConnectedTo(e){return Xr(this._injector,e)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function pn(n,t){n.get(Lt).load(Vp);let e=n.get(Ns),i=n.get(it),o=n.get(Fe),r=n.get(Fr),a=n.get(Ct),l=i.createElement("div"),p=i.createElement("div");p.id=o.getId("cdk-overlay-"),p.classList.add("cdk-overlay-pane"),l.appendChild(p),e.getContainerElement().appendChild(l);let u=new Ps(p,r,n),b=new mn(t),C=n.get(ot,null,{optional:!0})||n.get(gi).createRenderer(null,null);return b.direction=b.direction||a.value,new Go(u,l,p,b,n.get(me),n.get(Fp),i,n.get(ch),n.get(Np),t?.disableAnimations??n.get(Rr,null,{optional:!0})==="NoopAnimations",n.get(Wa),C)}var jp=(()=>{class n{scrollStrategies=d(Ip);_positionBuilder=d(Lp);_injector=d(ge);constructor(){}create(e){return pn(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Y_=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],zp=new ee("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let n=d(ge);return()=>Hi(n)}}),Yo=(()=>{class n{elementRef=d(K);constructor(){}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return n})(),Vs=(()=>{class n{_dir=d(Ct,{optional:!0});_injector=d(ge);_overlayRef;_templatePortal;_backdropSubscription=Di.EMPTY;_attachSubscription=Di.EMPTY;_detachSubscription=Di.EMPTY;_positionSubscription=Di.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=d(zp);_disposeOnNavigation=!1;_ngZone=d(me);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(e){this._disposeOnNavigation=e}backdropClick=new H;positionChange=new H;attach=new H;detach=new H;overlayKeydown=new H;overlayOutsideClick=new H;constructor(){let e=d(En),i=d(Zn);this._templatePortal=new sn(e,i),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Y_);let e=this._overlayRef=pn(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),i.keyCode===27&&!this.disableClose&&!vt(i)&&(i.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{let o=this._getOriginElement(),r=Ja(i);(!o||o!==r&&!o.contains(r))&&this.overlayOutsideClick.next(i)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),i=new mn({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(i.width=this.width),(this.height||this.height===0)&&(i.height=this.height),(this.minWidth||this.minWidth===0)&&(i.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(e){let i=this.positions.map(o=>({originX:o.originX,originY:o.originY,overlayX:o.overlayX,overlayY:o.overlayY,offsetX:o.offsetX||this.offsetX,offsetY:o.offsetY||this.offsetY,panelClass:o.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=Xr(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Yo?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Yo?this.origin.elementRef.nativeElement:this.origin instanceof K?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(qm(()=>this.positionChange.observers.length>0)).subscribe(e=>{this._ngZone.run(()=>this.positionChange.emit(e)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",J],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",J],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",J],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",J],push:[2,"cdkConnectedOverlayPush","push",J],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",J]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[Le]})}return n})();function Q_(n){let t=d(ge);return()=>Hi(t)}var X_={provide:zp,useFactory:Q_},xi=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[jp,X_],imports:[zr,ln,id,id]})}return n})();function K_(n,t){if(n&1){let e=E();s(0,"div",1)(1,"button",2),_("click",function(){v(e);let o=g();return y(o.action())}),h(2),c()()}if(n&2){let e=g();m(2),ae(" ",e.data.action," ")}}var Z_=["label"];function J_(n,t){}var eb=Math.pow(2,31)-1,Kr=class{_overlayRef;instance;containerInstance;_afterDismissed=new D;_afterOpened=new D;_onAction=new D;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,eb))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},Bp=new ee("MatSnackBarData"),Xo=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},tb=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return n})(),ib=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return n})(),nb=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return n})(),Hp=(()=>{class n{snackBarRef=d(Kr);data=d(Bp);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(i,o){i&1&&(s(0,"div",0),h(1),c(),w(2,K_,3,1,"div",1)),i&2&&(m(),ae(" ",o.data.message,`
|
|
1
|
+
import{A as kc,B as wh,C as Sh,D as We,E as dt,F as Dt,G as In,H as Rn,I as yt,J as Ct,K as Br,L as le,M as as,N as It,O as ss,P as xt,Q as xe,R as Qe,S as Mh,a as Ja,b as es,c as rt,d as bh,e as bi,f as zr,g as Vi,h as Lt,i as ts,j as xc,k as vh,l as yh,m as Lo,n as is,o as ns,p as jo,q as Fe,r as vt,s as Ch,t as xh,u as wc,v as os,w as zo,x as rs,y as Bo,z as Sc}from"./chunk-NKVTMSP6.js";import{e as kh}from"./chunk-YXDDUSGH.js";import{$ as fe,$a as eo,$b as De,A as _c,Aa as M,Ab as Pn,B as Ha,Ba as re,Bb as pe,Ca as Z,Cb as oh,D as qm,Da as Jm,Db as to,E as Fo,Ea as ye,Eb as rh,Fa as eh,Fb as Vr,G as Mn,Ga as Ge,Gb as Ya,Ha as H,Hb as ah,I as Vt,Ia as me,Ib as fi,J as Ri,Ja as Et,Jb as ft,K as N,Ka as th,Kb as Vo,L as Gm,La as vc,Lb as On,M as ct,Ma as Fr,Mb as Lr,N as de,Na as Y,Nb as sh,O as at,Ob as Re,P as R,Pa as w,Pb as J,Q as oe,Qa as S,Qb as _i,R as ee,Ra as Jn,Rb as lh,S as Wa,Sa as ih,Sb as ch,T as d,Ta as Oe,Tb as Cc,Ua as Ae,Ub as dh,V as Ym,Va as x,Vb as An,W as Ua,Wa as s,Wb as Qa,X as v,Xa as c,Xb as Xa,Y as y,Ya as F,Yb as Ka,Z as on,Za as ri,Zb as mh,_ as $a,_a as ai,_b as jr,a as q,aa as it,ab as Ga,b as Ie,ba as Kn,bb as E,bc as hh,c as Lm,cb as ei,cc as ph,d as ie,da as Qm,db as _,e as Di,ea as qa,f as oi,fa as Te,fb as g,fc as Ye,g as D,ga as Le,gb as He,gc as uh,h as se,ha as nt,hb as he,hc as Ni,i as jm,ia as K,ib as Tt,ic as Za,j as zm,ja as Xm,jb as ne,jc as gh,k as kt,kb as W,kc as Dn,l as Ir,lb as U,lc as fh,m as Bm,ma as Rr,mb as nh,mc as _h,n as Hm,nb as Nr,o as ve,ob as yc,p as nn,pa as Jt,pb as ti,qa as No,qb as Fi,r as Ro,ra as Km,rb as A,s as Wm,sa as m,sb as rn,t as Um,ta as En,tb as h,u as Ii,ua as gi,ub as B,v as ue,va as ot,vb as ae,w as fc,wa as Pe,wb as Tn,x as Xn,xa as Zn,xb as V,y as $m,ya as Zm,yb as L,z as Mt,za as bc,zb as j}from"./chunk-3FWTNKYQ.js";var ce=(function(n){return n[n.State=0]="State",n[n.Transition=1]="Transition",n[n.Sequence=2]="Sequence",n[n.Group=3]="Group",n[n.Animate=4]="Animate",n[n.Keyframes=5]="Keyframes",n[n.Style=6]="Style",n[n.Trigger=7]="Trigger",n[n.Reference=8]="Reference",n[n.AnimateChild=9]="AnimateChild",n[n.AnimateRef=10]="AnimateRef",n[n.Query=11]="Query",n[n.Stagger=12]="Stagger",n})(ce||{}),si="*";function Mc(n,t){return{type:ce.Trigger,name:n,definitions:t,options:{}}}function ls(n,t=null){return{type:ce.Animate,styles:t,timings:n}}function Eh(n,t=null){return{type:ce.Sequence,steps:n,options:t}}function Fn(n){return{type:ce.Style,styles:n,offset:null}}function cs(n,t,e=null){return{type:ce.Transition,expr:n,animation:t,options:e}}var Li=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(t=0,e=0){this.totalTime=t+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},io=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(t){this.players=t;let e=0,i=0,o=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++e==r&&this._onFinish()}),a.onDestroy(()=>{++i==r&&this._onDestroy()}),a.onStart(()=>{++o==r&&this._onStart()})}),this.totalTime=this.players.reduce((a,l)=>Math.max(a,l.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){let e=t*this.totalTime;this.players.forEach(i=>{let o=i.totalTime?Math.min(1,e/i.totalTime):1;i.setPosition(o)})}getPosition(){let t=this.players.reduce((e,i)=>e===null||i.totalTime>e.totalTime?i:e,null);return t!=null?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){let e=t=="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},Ho="!";function Th(n){return new de(3e3,!1)}function Hf(){return new de(3100,!1)}function Wf(){return new de(3101,!1)}function Uf(n){return new de(3001,!1)}function $f(n){return new de(3003,!1)}function qf(n){return new de(3004,!1)}function Oh(n,t){return new de(3005,!1)}function Ah(){return new de(3006,!1)}function Dh(){return new de(3007,!1)}function Ih(n,t){return new de(3008,!1)}function Rh(n){return new de(3002,!1)}function Fh(n,t,e,i,o){return new de(3010,!1)}function Nh(){return new de(3011,!1)}function Vh(){return new de(3012,!1)}function Lh(){return new de(3200,!1)}function jh(){return new de(3202,!1)}function zh(){return new de(3013,!1)}function Bh(n){return new de(3014,!1)}function Hh(n){return new de(3015,!1)}function Wh(n){return new de(3016,!1)}function Uh(n,t){return new de(3404,!1)}function Gf(n){return new de(3502,!1)}function $h(n){return new de(3503,!1)}function qh(){return new de(3300,!1)}function Gh(n){return new de(3504,!1)}function Yh(n){return new de(3301,!1)}function Qh(n,t){return new de(3302,!1)}function Xh(n){return new de(3303,!1)}function Kh(n,t){return new de(3400,!1)}function Zh(n){return new de(3401,!1)}function Jh(n){return new de(3402,!1)}function ep(n,t){return new de(3505,!1)}function an(n){switch(n.length){case 0:return new Li;case 1:return n[0];default:return new io(n)}}function Oc(n,t,e=new Map,i=new Map){let o=[],r=[],a=-1,l=null;if(t.forEach(p=>{let u=p.get("offset"),b=u==a,C=b&&l||new Map;p.forEach((T,P)=>{let k=P,z=T;if(P!=="offset")switch(k=n.normalizePropertyName(k,o),z){case Ho:z=e.get(P);break;case si:z=i.get(P);break;default:z=n.normalizeStyleValue(P,k,z,o);break}C.set(k,z)}),b||r.push(C),l=C,a=u}),o.length)throw Gf(o);return r}function ds(n,t,e,i){switch(t){case"start":n.onStart(()=>i(e&&Ec(e,"start",n)));break;case"done":n.onDone(()=>i(e&&Ec(e,"done",n)));break;case"destroy":n.onDestroy(()=>i(e&&Ec(e,"destroy",n)));break}}function Ec(n,t,e){let i=e.totalTime,o=!!e.disabled,r=ms(n.element,n.triggerName,n.fromState,n.toState,t||n.phaseName,i??n.totalTime,o),a=n._data;return a!=null&&(r._data=a),r}function ms(n,t,e,i,o="",r=0,a){return{element:n,triggerName:t,fromState:e,toState:i,phaseName:o,totalTime:r,disabled:!!a}}function Qt(n,t,e){let i=n.get(t);return i||n.set(t,i=e),i}function Ac(n){let t=n.indexOf(":"),e=n.substring(1,t),i=n.slice(t+1);return[e,i]}var Yf=typeof document>"u"?null:document.documentElement;function hs(n){let t=n.parentNode||n.host||null;return t===Yf?null:t}function Qf(n){return n.substring(1,6)=="ebkit"}var no=null,Ph=!1;function tp(n){no||(no=Xf()||{},Ph=no.style?"WebkitAppearance"in no.style:!1);let t=!0;return no.style&&!Qf(n)&&(t=n in no.style,!t&&Ph&&(t="Webkit"+n.charAt(0).toUpperCase()+n.slice(1)in no.style)),t}function Xf(){return typeof document<"u"?document.body:null}function Dc(n,t){for(;t;){if(t===n)return!0;t=hs(t)}return!1}function Ic(n,t,e){if(e)return Array.from(n.querySelectorAll(t));let i=n.querySelector(t);return i?[i]:[]}var Kf=1e3,Rc="{{",Zf="}}",Fc="ng-enter",ps="ng-leave",Hr="ng-trigger",Wr=".ng-trigger",Nc="ng-animating",us=".ng-animating";function ji(n){if(typeof n=="number")return n;let t=n.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:Tc(parseFloat(t[1]),t[2])}function Tc(n,t){switch(t){case"s":return n*Kf;default:return n}}function Ur(n,t,e){return n.hasOwnProperty("duration")?n:e_(n,t,e)}var Jf=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function e_(n,t,e){let i,o=0,r="";if(typeof n=="string"){let a=n.match(Jf);if(a===null)return t.push(Th(n)),{duration:0,delay:0,easing:""};i=Tc(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(o=Tc(parseFloat(l),a[4]));let p=a[5];p&&(r=p)}else i=n;if(!e){let a=!1,l=t.length;i<0&&(t.push(Hf()),a=!0),o<0&&(t.push(Wf()),a=!0),a&&t.splice(l,0,Th(n))}return{duration:i,delay:o,easing:r}}function ip(n){return n.length?n[0]instanceof Map?n:n.map(t=>new Map(Object.entries(t))):[]}function vi(n,t,e){t.forEach((i,o)=>{let r=gs(o);e&&!e.has(o)&&e.set(o,n.style[r]),n.style[r]=i})}function Nn(n,t){t.forEach((e,i)=>{let o=gs(i);n.style[o]=""})}function Wo(n){return Array.isArray(n)?n.length==1?n[0]:Eh(n):n}function np(n,t,e){let i=t.params||{},o=Vc(n);o.length&&o.forEach(r=>{i.hasOwnProperty(r)||e.push(Uf(r))})}var Pc=new RegExp(`${Rc}\\s*(.+?)\\s*${Zf}`,"g");function Vc(n){let t=[];if(typeof n=="string"){let e;for(;e=Pc.exec(n);)t.push(e[1]);Pc.lastIndex=0}return t}function Uo(n,t,e){let i=`${n}`,o=i.replace(Pc,(r,a)=>{let l=t[a];return l==null&&(e.push($f(a)),l=""),l.toString()});return o==i?n:o}var t_=/-+([a-z0-9])/g;function gs(n){return n.replace(t_,(...t)=>t[1].toUpperCase())}function op(n,t){return n===0||t===0}function rp(n,t,e){if(e.size&&t.length){let i=t[0],o=[];if(e.forEach((r,a)=>{i.has(a)||o.push(a),i.set(a,r)}),o.length)for(let r=1;r<t.length;r++){let a=t[r];o.forEach(l=>a.set(l,fs(n,l)))}}return t}function Xt(n,t,e){switch(t.type){case ce.Trigger:return n.visitTrigger(t,e);case ce.State:return n.visitState(t,e);case ce.Transition:return n.visitTransition(t,e);case ce.Sequence:return n.visitSequence(t,e);case ce.Group:return n.visitGroup(t,e);case ce.Animate:return n.visitAnimate(t,e);case ce.Keyframes:return n.visitKeyframes(t,e);case ce.Style:return n.visitStyle(t,e);case ce.Reference:return n.visitReference(t,e);case ce.AnimateChild:return n.visitAnimateChild(t,e);case ce.AnimateRef:return n.visitAnimateRef(t,e);case ce.Query:return n.visitQuery(t,e);case ce.Stagger:return n.visitStagger(t,e);default:throw qf(t.type)}}function fs(n,t){return window.getComputedStyle(n)[t]}var ed=(()=>{class n{validateStyleProperty(e){return tp(e)}containsElement(e,i){return Dc(e,i)}getParentElement(e){return hs(e)}query(e,i,o){return Ic(e,i,o)}computeStyle(e,i,o){return o||""}animate(e,i,o,r,a,l=[],p){return new Li(o,r)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac})}return n})(),ro=class{static NOOP=new ed},ao=class{};var i_=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"]),Cs=class extends ao{normalizePropertyName(t,e){return gs(t)}normalizeStyleValue(t,e,i,o){let r="",a=i.toString().trim();if(i_.has(e)&&i!==0&&i!=="0")if(typeof i=="number")r="px";else{let l=i.match(/^[+-]?[\d\.]+([a-z]*)$/);l&&l[1].length==0&&o.push(Oh(t,i))}return a+r}};var xs="*";function n_(n,t){let e=[];return typeof n=="string"?n.split(/\s*,\s*/).forEach(i=>o_(i,e,t)):e.push(n),e}function o_(n,t,e){if(n[0]==":"){let p=r_(n,e);if(typeof p=="function"){t.push(p);return}n=p}let i=n.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return e.push(Hh(n)),t;let o=i[1],r=i[2],a=i[3];t.push(ap(o,a));let l=o==xs&&a==xs;r[0]=="<"&&!l&&t.push(ap(a,o))}function r_(n,t){switch(n){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,i)=>parseFloat(i)>parseFloat(e);case":decrement":return(e,i)=>parseFloat(i)<parseFloat(e);default:return t.push(Wh(n)),"* => *"}}var _s=new Set(["true","1"]),bs=new Set(["false","0"]);function ap(n,t){let e=_s.has(n)||bs.has(n),i=_s.has(t)||bs.has(t);return(o,r)=>{let a=n==xs||n==o,l=t==xs||t==r;return!a&&e&&typeof o=="boolean"&&(a=o?_s.has(n):bs.has(n)),!l&&i&&typeof r=="boolean"&&(l=r?_s.has(t):bs.has(t)),a&&l}}var fp=":self",a_=new RegExp(`s*${fp}s*,?`,"g");function _p(n,t,e,i){return new Wc(n).build(t,e,i)}var sp="",Wc=class{_driver;constructor(t){this._driver=t}build(t,e,i){let o=new Uc(e);return this._resetContextStyleTimingState(o),Xt(this,Wo(t),o)}_resetContextStyleTimingState(t){t.currentQuerySelector=sp,t.collectedStyles=new Map,t.collectedStyles.set(sp,new Map),t.currentTime=0}visitTrigger(t,e){let i=e.queryCount=0,o=e.depCount=0,r=[],a=[];return t.name.charAt(0)=="@"&&e.errors.push(Ah()),t.definitions.forEach(l=>{if(this._resetContextStyleTimingState(e),l.type==ce.State){let p=l,u=p.name;u.toString().split(/\s*,\s*/).forEach(b=>{p.name=b,r.push(this.visitState(p,e))}),p.name=u}else if(l.type==ce.Transition){let p=this.visitTransition(l,e);i+=p.queryCount,o+=p.depCount,a.push(p)}else e.errors.push(Dh())}),{type:ce.Trigger,name:t.name,states:r,transitions:a,queryCount:i,depCount:o,options:null}}visitState(t,e){let i=this.visitStyle(t.styles,e),o=t.options&&t.options.params||null;if(i.containsDynamicStyles){let r=new Set,a=o||{};i.styles.forEach(l=>{l instanceof Map&&l.forEach(p=>{Vc(p).forEach(u=>{a.hasOwnProperty(u)||r.add(u)})})}),r.size&&e.errors.push(Ih(t.name,[...r.values()]))}return{type:ce.State,name:t.name,style:i,options:o?{params:o}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let i=Xt(this,Wo(t.animation),e),o=n_(t.expr,e.errors);return{type:ce.Transition,matchers:o,animation:i,queryCount:e.queryCount,depCount:e.depCount,options:oo(t.options)}}visitSequence(t,e){return{type:ce.Sequence,steps:t.steps.map(i=>Xt(this,i,e)),options:oo(t.options)}}visitGroup(t,e){let i=e.currentTime,o=0,r=t.steps.map(a=>{e.currentTime=i;let l=Xt(this,a,e);return o=Math.max(o,e.currentTime),l});return e.currentTime=o,{type:ce.Group,steps:r,options:oo(t.options)}}visitAnimate(t,e){let i=d_(t.timings,e.errors);e.currentAnimateTimings=i;let o,r=t.styles?t.styles:Fn({});if(r.type==ce.Keyframes)o=this.visitKeyframes(r,e);else{let a=t.styles,l=!1;if(!a){l=!0;let u={};i.easing&&(u.easing=i.easing),a=Fn(u)}e.currentTime+=i.duration+i.delay;let p=this.visitStyle(a,e);p.isEmptyStep=l,o=p}return e.currentAnimateTimings=null,{type:ce.Animate,timings:i,style:o,options:null}}visitStyle(t,e){let i=this._makeStyleAst(t,e);return this._validateStyleAst(i,e),i}_makeStyleAst(t,e){let i=[],o=Array.isArray(t.styles)?t.styles:[t.styles];for(let l of o)typeof l=="string"?l===si?i.push(l):e.errors.push(Rh(l)):i.push(new Map(Object.entries(l)));let r=!1,a=null;return i.forEach(l=>{if(l instanceof Map&&(l.has("easing")&&(a=l.get("easing"),l.delete("easing")),!r)){for(let p of l.values())if(p.toString().indexOf(Rc)>=0){r=!0;break}}}),{type:ce.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(t,e){let i=e.currentAnimateTimings,o=e.currentTime,r=e.currentTime;i&&r>0&&(r-=i.duration+i.delay),t.styles.forEach(a=>{typeof a!="string"&&a.forEach((l,p)=>{let u=e.collectedStyles.get(e.currentQuerySelector),b=u.get(p),C=!0;b&&(r!=o&&r>=b.startTime&&o<=b.endTime&&(e.errors.push(Fh(p,b.startTime,b.endTime,r,o)),C=!1),r=b.startTime),C&&u.set(p,{startTime:r,endTime:o}),e.options&&np(l,e.options,e.errors)})})}visitKeyframes(t,e){let i={type:ce.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(Nh()),i;let o=1,r=0,a=[],l=!1,p=!1,u=0,b=t.steps.map(Be=>{let Je=this._makeStyleAst(Be,e),et=Je.offset!=null?Je.offset:c_(Je.styles),_e=0;return et!=null&&(r++,_e=Je.offset=et),p=p||_e<0||_e>1,l=l||_e<u,u=_e,a.push(_e),Je});p&&e.errors.push(Vh()),l&&e.errors.push(Lh());let C=t.steps.length,T=0;r>0&&r<C?e.errors.push(jh()):r==0&&(T=o/(C-1));let P=C-1,k=e.currentTime,z=e.currentAnimateTimings,Ce=z.duration;return b.forEach((Be,Je)=>{let et=T>0?Je==P?1:T*Je:a[Je],_e=et*Ce;e.currentTime=k+z.delay+_e,z.duration=_e,this._validateStyleAst(Be,e),Be.offset=et,i.styles.push(Be)}),i}visitReference(t,e){return{type:ce.Reference,animation:Xt(this,Wo(t.animation),e),options:oo(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:ce.AnimateChild,options:oo(t.options)}}visitAnimateRef(t,e){return{type:ce.AnimateRef,animation:this.visitReference(t.animation,e),options:oo(t.options)}}visitQuery(t,e){let i=e.currentQuerySelector,o=t.options||{};e.queryCount++,e.currentQuery=t;let[r,a]=s_(t.selector);e.currentQuerySelector=i.length?i+" "+r:r,Qt(e.collectedStyles,e.currentQuerySelector,new Map);let l=Xt(this,Wo(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=i,{type:ce.Query,selector:r,limit:o.limit||0,optional:!!o.optional,includeSelf:a,animation:l,originalSelector:t.selector,options:oo(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(zh());let i=t.timings==="full"?{duration:0,delay:0,easing:"full"}:Ur(t.timings,e.errors,!0);return{type:ce.Stagger,animation:Xt(this,Wo(t.animation),e),timings:i,options:null}}};function s_(n){let t=!!n.split(/\s*,\s*/).find(e=>e==fp);return t&&(n=n.replace(a_,"")),n=n.replace(/@\*/g,Wr).replace(/@\w+/g,e=>Wr+"-"+e.slice(1)).replace(/:animating/g,us),[n,t]}function l_(n){return n?q({},n):null}var Uc=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(t){this.errors=t}};function c_(n){if(typeof n=="string")return null;let t=null;if(Array.isArray(n))n.forEach(e=>{if(e instanceof Map&&e.has("offset")){let i=e;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(n instanceof Map&&n.has("offset")){let e=n;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function d_(n,t){if(n.hasOwnProperty("duration"))return n;if(typeof n=="number"){let r=Ur(n,t).duration;return Lc(r,0,"")}let e=n;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=Lc(0,0,"");return r.dynamic=!0,r.strValue=e,r}let o=Ur(e,t);return Lc(o.duration,o.delay,o.easing)}function oo(n){return n?(n=q({},n),n.params&&(n.params=l_(n.params))):n={},n}function Lc(n,t,e){return{duration:n,delay:t,easing:e}}function td(n,t,e,i,o,r,a=null,l=!1){return{type:1,element:n,keyframes:t,preStyleProps:e,postStyleProps:i,duration:o,delay:r,totalTime:o+r,easing:a,subTimeline:l}}var qr=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},m_=1,h_=":enter",p_=new RegExp(h_,"g"),u_=":leave",g_=new RegExp(u_,"g");function bp(n,t,e,i,o,r=new Map,a=new Map,l,p,u=[]){return new $c().buildKeyframes(n,t,e,i,o,r,a,l,p,u)}var $c=class{buildKeyframes(t,e,i,o,r,a,l,p,u,b=[]){u=u||new qr;let C=new qc(t,e,u,o,r,b,[]);C.options=p;let T=p.delay?ji(p.delay):0;C.currentTimeline.delayNextStep(T),C.currentTimeline.setStyles([a],null,C.errors,p),Xt(this,i,C);let P=C.timelines.filter(k=>k.containsAnimation());if(P.length&&l.size){let k;for(let z=P.length-1;z>=0;z--){let Ce=P[z];if(Ce.element===e){k=Ce;break}}k&&!k.allowOnlyTimelineStyles()&&k.setStyles([l],null,C.errors,p)}return P.length?P.map(k=>k.buildKeyframes()):[td(e,[],[],[],0,T,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let i=e.subInstructions.get(e.element);if(i){let o=e.createSubContext(t.options),r=e.currentTimeline.currentTime,a=this._visitSubInstructions(i,o,o.options);r!=a&&e.transformIntoNewTimeline(a)}e.previousNode=t}visitAnimateRef(t,e){let i=e.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,i),this.visitReference(t.animation,i),e.transformIntoNewTimeline(i.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,i){for(let o of t){let r=o?.delay;if(r){let a=typeof r=="number"?r:ji(Uo(r,o?.params??{},e.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,e,i){let r=e.currentTimeline.currentTime,a=i.duration!=null?ji(i.duration):null,l=i.delay!=null?ji(i.delay):null;return a!==0&&t.forEach(p=>{let u=e.appendInstructionToTimeline(p,a,l);r=Math.max(r,u.duration+u.delay)}),r}visitReference(t,e){e.updateOptions(t.options,!0),Xt(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let i=e.subContextCount,o=e,r=t.options;if(r&&(r.params||r.delay)&&(o=e.createSubContext(r),o.transformIntoNewTimeline(),r.delay!=null)){o.previousNode.type==ce.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=ws);let a=ji(r.delay);o.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>Xt(this,a,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>i&&o.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let i=[],o=e.currentTimeline.currentTime,r=t.options&&t.options.delay?ji(t.options.delay):0;t.steps.forEach(a=>{let l=e.createSubContext(t.options);r&&l.delayNextStep(r),Xt(this,a,l),o=Math.max(o,l.currentTimeline.currentTime),i.push(l.currentTimeline)}),i.forEach(a=>e.currentTimeline.mergeTimelineCollectedStyles(a)),e.transformIntoNewTimeline(o),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let i=t.strValue,o=e.params?Uo(i,e.params,e.errors):i;return Ur(o,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let i=e.currentAnimateTimings=this._visitTiming(t.timings,e),o=e.currentTimeline;i.delay&&(e.incrementTime(i.delay),o.snapshotCurrentStyles());let r=t.style;r.type==ce.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(i.duration),this.visitStyle(r,e),o.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let i=e.currentTimeline,o=e.currentAnimateTimings;!o&&i.hasCurrentStyleProperties()&&i.forwardFrame();let r=o&&o.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(r):i.setStyles(t.styles,r,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let i=e.currentAnimateTimings,o=e.currentTimeline.duration,r=i.duration,l=e.createSubContext().currentTimeline;l.easing=i.easing,t.styles.forEach(p=>{let u=p.offset||0;l.forwardTime(u*r),l.setStyles(p.styles,p.easing,e.errors,e.options),l.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(l),e.transformIntoNewTimeline(o+r),e.previousNode=t}visitQuery(t,e){let i=e.currentTimeline.currentTime,o=t.options||{},r=o.delay?ji(o.delay):0;r&&(e.previousNode.type===ce.Style||i==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=ws);let a=i,l=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!o.optional,e.errors);e.currentQueryTotal=l.length;let p=null;l.forEach((u,b)=>{e.currentQueryIndex=b;let C=e.createSubContext(t.options,u);r&&C.delayNextStep(r),u===e.element&&(p=C.currentTimeline),Xt(this,t.animation,C),C.currentTimeline.applyStylesToKeyframe();let T=C.currentTimeline.currentTime;a=Math.max(a,T)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(a),p&&(e.currentTimeline.mergeTimelineCollectedStyles(p),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let i=e.parentContext,o=e.currentTimeline,r=t.timings,a=Math.abs(r.duration),l=a*(e.currentQueryTotal-1),p=a*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":p=l-p;break;case"full":p=i.currentStaggerTime;break}let b=e.currentTimeline;p&&b.delayNextStep(p);let C=b.currentTime;Xt(this,t.animation,e),e.previousNode=t,i.currentStaggerTime=o.currentTime-C+(o.startTime-i.currentTimeline.startTime)}},ws={},qc=class n{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=ws;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,i,o,r,a,l,p){this._driver=t,this.element=e,this.subInstructions=i,this._enterClassName=o,this._leaveClassName=r,this.errors=a,this.timelines=l,this.currentTimeline=p||new Ss(this._driver,e,0),l.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let i=t,o=this.options;i.duration!=null&&(o.duration=ji(i.duration)),i.delay!=null&&(o.delay=ji(i.delay));let r=i.params;if(r){let a=o.params;a||(a=this.options.params={}),Object.keys(r).forEach(l=>{(!e||!a.hasOwnProperty(l))&&(a[l]=Uo(r[l],a,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let i=t.params={};Object.keys(e).forEach(o=>{i[o]=e[o]})}}return t}createSubContext(t=null,e,i){let o=e||this.element,r=new n(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,i||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(t),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(t){return this.previousNode=ws,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,i){let o={duration:e??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},r=new Gc(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,o,t.stretchStartingKeyframe);return this.timelines.push(r),o}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,i,o,r,a){let l=[];if(o&&l.push(this.element),t.length>0){t=t.replace(p_,"."+this._enterClassName),t=t.replace(g_,"."+this._leaveClassName);let p=i!=1,u=this._driver.query(this.element,t,p);i!==0&&(u=i<0?u.slice(u.length+i,u.length):u.slice(0,i)),l.push(...u)}return!r&&l.length==0&&a.push(Bh(e)),l}},Ss=class n{_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(t,e,i,o){this._driver=t,this.element=e,this.startTime=i,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,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(t){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new n(this._driver,t,e||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+=m_,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles.set(t,e),this._globalTimelineStyles.set(t,e),this._styleSummary.set(t,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[e,i]of this._globalTimelineStyles)this._backFill.set(e,i||si),this._currentKeyframe.set(e,si);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,i,o){e&&this._previousKeyframe.set("easing",e);let r=o&&o.params||{},a=f_(t,this._globalTimelineStyles);for(let[l,p]of a){let u=Uo(p,r,i);this._pendingStyles.set(l,u),this._localTimelineStyles.has(l)||this._backFill.set(l,this._globalTimelineStyles.get(l)??si),this._updateStyle(l,u)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((t,e)=>{this._currentKeyframe.set(e,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,t)}))}snapshotCurrentStyles(){for(let[t,e]of this._localTimelineStyles)this._pendingStyles.set(t,e),this._updateStyle(t,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((e,i)=>{let o=this._styleSummary.get(i);(!o||e.time>o.time)&&this._updateStyle(i,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,i=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((l,p)=>{let u=new Map([...this._backFill,...l]);u.forEach((b,C)=>{b===Ho?t.add(C):b===si&&e.add(C)}),i||u.set("offset",p/this.duration),o.push(u)});let r=[...t.values()],a=[...e.values()];if(i){let l=o[0],p=new Map(l);l.set("offset",0),p.set("offset",1),o=[l,p]}return td(this.element,o,r,a,this.duration,this.startTime,this.easing,!1)}},Gc=class extends Ss{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,i,o,r,a,l=!1){super(t,e,a.delay),this.keyframes=i,this.preStyleProps=o,this.postStyleProps=r,this._stretchStartingKeyframe=l,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:i,easing:o}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],a=i+e,l=e/a,p=new Map(t[0]);p.set("offset",0),r.push(p);let u=new Map(t[0]);u.set("offset",lp(l)),r.push(u);let b=t.length-1;for(let C=1;C<=b;C++){let T=new Map(t[C]),P=T.get("offset"),k=e+P*i;T.set("offset",lp(k/a)),r.push(T)}i=a,e=0,o="",t=r}return td(this.element,t,this.preStyleProps,this.postStyleProps,i,e,o,!0)}};function lp(n,t=3){let e=Math.pow(10,t-1);return Math.round(n*e)/e}function f_(n,t){let e=new Map,i;return n.forEach(o=>{if(o==="*"){i??=t.keys();for(let r of i)e.set(r,si)}else for(let[r,a]of o)e.set(r,a)}),e}function cp(n,t,e,i,o,r,a,l,p,u,b,C,T){return{type:0,element:n,triggerName:t,isRemovalTransition:o,fromState:e,fromStyles:r,toState:i,toStyles:a,timelines:l,queriedElements:p,preStyleProps:u,postStyleProps:b,totalTime:C,errors:T}}var jc={},ks=class{_triggerName;ast;_stateStyles;constructor(t,e,i){this._triggerName=t,this.ast=e,this._stateStyles=i}match(t,e,i,o){return __(this.ast.matchers,t,e,i,o)}buildStyles(t,e,i){let o=this._stateStyles.get("*");return t!==void 0&&(o=this._stateStyles.get(t?.toString())||o),o?o.buildStyles(e,i):new Map}build(t,e,i,o,r,a,l,p,u,b){let C=[],T=this.ast.options&&this.ast.options.params||jc,P=l&&l.params||jc,k=this.buildStyles(i,P,C),z=p&&p.params||jc,Ce=this.buildStyles(o,z,C),Be=new Set,Je=new Map,et=new Map,_e=o==="void",qt={params:vp(z,T),delay:this.ast.options?.delay},_t=b?[]:bp(t,e,this.ast.animation,r,a,k,Ce,qt,u,C),tt=0;return _t.forEach(Pt=>{tt=Math.max(Pt.duration+Pt.delay,tt)}),C.length?cp(e,this._triggerName,i,o,_e,k,Ce,[],[],Je,et,tt,C):(_t.forEach(Pt=>{let Zi=Pt.element,Sn=Qt(Je,Zi,new Set);Pt.preStyleProps.forEach(ui=>Sn.add(ui));let bt=Qt(et,Zi,new Set);Pt.postStyleProps.forEach(ui=>bt.add(ui)),Zi!==e&&Be.add(Zi)}),cp(e,this._triggerName,i,o,_e,k,Ce,_t,[...Be.values()],Je,et,tt))}};function __(n,t,e,i,o){return n.some(r=>r(t,e,i,o))}function vp(n,t){let e=q({},t);return Object.entries(n).forEach(([i,o])=>{o!=null&&(e[i]=o)}),e}var Yc=class{styles;defaultParams;normalizer;constructor(t,e,i){this.styles=t,this.defaultParams=e,this.normalizer=i}buildStyles(t,e){let i=new Map,o=vp(t,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((a,l)=>{a&&(a=Uo(a,o,e));let p=this.normalizer.normalizePropertyName(l,e);a=this.normalizer.normalizeStyleValue(l,p,a,e),i.set(l,a)})}),i}};function b_(n,t,e){return new Qc(n,t,e)}var Qc=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,i){this.name=t,this.ast=e,this._normalizer=i,e.states.forEach(o=>{let r=o.options&&o.options.params||{};this.states.set(o.name,new Yc(o.style,r,i))}),dp(this.states,"true","1"),dp(this.states,"false","0"),e.transitions.forEach(o=>{this.transitionFactories.push(new ks(t,o,this.states))}),this.fallbackTransition=v_(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,i,o){return this.transitionFactories.find(a=>a.match(t,e,i,o))||null}matchStyles(t,e,i){return this.fallbackTransition.buildStyles(t,e,i)}};function v_(n,t,e){let i=[(a,l)=>!0],o={type:ce.Sequence,steps:[],options:null},r={type:ce.Transition,animation:o,matchers:i,options:null,queryCount:0,depCount:0};return new ks(n,r,t)}function dp(n,t,e){n.has(t)?n.has(e)||n.set(e,n.get(t)):n.has(e)&&n.set(t,n.get(e))}var y_=new qr,Xc=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,i){this.bodyNode=t,this._driver=e,this._normalizer=i}register(t,e){let i=[],o=[],r=_p(this._driver,e,i,o);if(i.length)throw $h(i);this._animations.set(t,r)}_buildPlayer(t,e,i){let o=t.element,r=Oc(this._normalizer,t.keyframes,e,i);return this._driver.animate(o,r,t.duration,t.delay,t.easing,[],!0)}create(t,e,i={}){let o=[],r=this._animations.get(t),a,l=new Map;if(r?(a=bp(this._driver,e,r,Fc,ps,new Map,new Map,i,y_,o),a.forEach(b=>{let C=Qt(l,b.element,new Map);b.postStyleProps.forEach(T=>C.set(T,null))})):(o.push(qh()),a=[]),o.length)throw Gh(o);l.forEach((b,C)=>{b.forEach((T,P)=>{b.set(P,this._driver.computeStyle(C,P,si))})});let p=a.map(b=>{let C=l.get(b.element);return this._buildPlayer(b,new Map,C)}),u=an(p);return this._playersById.set(t,u),u.onDestroy(()=>this.destroy(t)),this.players.push(u),u}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let i=this.players.indexOf(e);i>=0&&this.players.splice(i,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw Yh(t);return e}listen(t,e,i,o){let r=ms(e,"","","");return ds(this._getPlayer(t),i,r,o),()=>{}}command(t,e,i,o){if(i=="register"){this.register(t,o[0]);return}if(i=="create"){let a=o[0]||{};this.create(t,e,a);return}let r=this._getPlayer(t);switch(i){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(t);break}}},mp="ng-animate-queued",C_=".ng-animate-queued",zc="ng-animate-disabled",x_=".ng-animate-disabled",w_="ng-star-inserted",S_=".ng-star-inserted",k_=[],yp={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},M_={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},yi="__ng_removed",Gr=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let i=t&&t.hasOwnProperty("value"),o=i?t.value:t;if(this.value=T_(o),i){let r=t,{value:a}=r,l=Lm(r,["value"]);this.options=l}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let i=this.options.params;Object.keys(e).forEach(o=>{i[o]==null&&(i[o]=e[o])})}}},$r="void",Bc=new Gr($r),Kc=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,i){this.id=t,this.hostElement=e,this._engine=i,this._hostClassName="ng-tns-"+t,li(e,this._hostClassName)}listen(t,e,i,o){if(!this._triggers.has(e))throw Qh(i,e);if(i==null||i.length==0)throw Xh(e);if(!P_(i))throw Kh(i,e);let r=Qt(this._elementListeners,t,[]),a={name:e,phase:i,callback:o};r.push(a);let l=Qt(this._engine.statesByElement,t,new Map);return l.has(e)||(li(t,Hr),li(t,Hr+"-"+e),l.set(e,Bc)),()=>{this._engine.afterFlush(()=>{let p=r.indexOf(a);p>=0&&r.splice(p,1),this._triggers.has(e)||l.delete(e)})}}register(t,e){return this._triggers.has(t)?!1:(this._triggers.set(t,e),!0)}_getTrigger(t){let e=this._triggers.get(t);if(!e)throw Zh(t);return e}trigger(t,e,i,o=!0){let r=this._getTrigger(e),a=new Yr(this.id,e,t),l=this._engine.statesByElement.get(t);l||(li(t,Hr),li(t,Hr+"-"+e),this._engine.statesByElement.set(t,l=new Map));let p=l.get(e),u=new Gr(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&p&&u.absorbOptions(p.options),l.set(e,u),p||(p=Bc),!(u.value===$r)&&p.value===u.value){if(!D_(p.params,u.params)){let z=[],Ce=r.matchStyles(p.value,p.params,z),Be=r.matchStyles(u.value,u.params,z);z.length?this._engine.reportError(z):this._engine.afterFlush(()=>{Nn(t,Ce),vi(t,Be)})}return}let T=Qt(this._engine.playersByElement,t,[]);T.forEach(z=>{z.namespaceId==this.id&&z.triggerName==e&&z.queued&&z.destroy()});let P=r.matchTransition(p.value,u.value,t,u.params),k=!1;if(!P){if(!o)return;P=r.fallbackTransition,k=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:P,fromState:p,toState:u,player:a,isFallbackTransition:k}),k||(li(t,mp),a.onStart(()=>{$o(t,mp)})),a.onDone(()=>{let z=this.players.indexOf(a);z>=0&&this.players.splice(z,1);let Ce=this._engine.playersByElement.get(t);if(Ce){let Be=Ce.indexOf(a);Be>=0&&Ce.splice(Be,1)}}),this.players.push(a),T.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,i)=>{this._elementListeners.set(i,e.filter(o=>o.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let i=this._engine.driver.query(t,Wr,!0);i.forEach(o=>{if(o[yi])return;let r=this._engine.fetchNamespacesByElement(o);r.size?r.forEach(a=>a.triggerLeaveAnimation(o,e,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(t,e,i,o){let r=this._engine.statesByElement.get(t),a=new Map;if(r){let l=[];if(r.forEach((p,u)=>{if(a.set(u,p.value),this._triggers.has(u)){let b=this.trigger(t,u,$r,o);b&&l.push(b)}}),l.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,a),i&&an(l).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(e&&i){let o=new Set;e.forEach(r=>{let a=r.name;if(o.has(a))return;o.add(a);let p=this._triggers.get(a).fallbackTransition,u=i.get(a)||Bc,b=new Gr($r),C=new Yr(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:p,fromState:u,toState:b,player:C,isFallbackTransition:!0})})}}removeNode(t,e){let i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let o=!1;if(i.totalAnimations){let r=i.players.length?i.playersByQueriedElement.get(t):[];if(r&&r.length)o=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(t),o)i.markElementAsRemoved(this.id,t,!1,e);else{let r=t[yi];(!r||r===yp)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,e))}}insertNode(t,e){li(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(i=>{let o=i.player;if(o.destroyed)return;let r=i.element,a=this._elementListeners.get(r);a&&a.forEach(l=>{if(l.name==i.triggerName){let p=ms(r,i.triggerName,i.fromState.value,i.toState.value);p._data=t,ds(i.player,l.phase,p,l.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):e.push(i)}),this._queue=[],e.sort((i,o)=>{let r=i.transition.ast.depCount,a=o.transition.ast.depCount;return r==0||a==0?r-a:this._engine.driver.containsElement(i.element,o.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Zc=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=(t,e)=>{};_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}constructor(t,e,i){this.bodyNode=t,this.driver=e,this._normalizer=i}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,e){let i=new Kc(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(i,e):(this.newHostElements.set(e,i),this.collectEnterElement(e)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,e){let i=this._namespaceList,o=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,l=this.driver.getParentElement(e);for(;l;){let p=o.get(l);if(p){let u=i.indexOf(p);i.splice(u+1,0,t),a=!0;break}l=this.driver.getParentElement(l)}a||i.unshift(t)}else i.push(t);return o.set(e,t),t}register(t,e){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,e)),i}registerTrigger(t,e,i){let o=this._namespaceLookup[t];o&&o.register(e,i)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);let o=this._namespaceList.indexOf(i);o>=0&&this._namespaceList.splice(o,1),i.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,i=this.statesByElement.get(t);if(i){for(let o of i.values())if(o.namespaceId){let r=this._fetchNamespace(o.namespaceId);r&&e.add(r)}}return e}trigger(t,e,i,o){if(vs(e)){let r=this._fetchNamespace(t);if(r)return r.trigger(e,i,o),!0}return!1}insertNode(t,e,i,o){if(!vs(e))return;let r=e[yi];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let a=this.collectedLeaveElements.indexOf(e);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){let a=this._fetchNamespace(t);a&&a.insertNode(e,i)}o&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),li(t,zc)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),$o(t,zc))}removeNode(t,e,i){if(vs(e)){let o=t?this._fetchNamespace(t):null;o?o.removeNode(e,i):this.markElementAsRemoved(t,e,!1,i);let r=this.namespacesByHostElement.get(e);r&&r.id!==t&&r.removeNode(e,i)}else this._onRemovalComplete(e,i)}markElementAsRemoved(t,e,i,o,r){this.collectedLeaveElements.push(e),e[yi]={namespaceId:t,setForRemoval:o,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:r}}listen(t,e,i,o,r){return vs(e)?this._fetchNamespace(t).listen(e,i,o,r):()=>{}}_buildInstruction(t,e,i,o,r){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,o,t.fromState.options,t.toState.options,e,r)}destroyInnerAnimations(t){let e=this.driver.query(t,Wr,!0);e.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,us,!0),e.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return an(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[yi];if(e&&e.setForRemoval){if(t[yi]=yp,e.namespaceId){this.destroyInnerAnimations(t);let i=this._fetchNamespace(e.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(zc)&&this.markElementAsDisabled(t,!1),this.driver.query(t,x_,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,o)=>this._balanceNamespaceList(i,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;i<this.collectedEnterElements.length;i++){let o=this.collectedEnterElements[i];li(o,w_)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let i=[];try{e=this._flushAnimations(i,t)}finally{for(let o=0;o<i.length;o++)i[o]()}}else for(let i=0;i<this.collectedLeaveElements.length;i++){let o=this.collectedLeaveElements[i];this.processLeaveNode(o)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(i=>i()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],e.length?an(e).onDone(()=>{i.forEach(o=>o())}):i.forEach(o=>o())}}reportError(t){throw Jh(t)}_flushAnimations(t,e){let i=new qr,o=[],r=new Map,a=[],l=new Map,p=new Map,u=new Map,b=new Set;this.disabledNodes.forEach($=>{b.add($);let Q=this.driver.query($,C_,!0);for(let te=0;te<Q.length;te++)b.add(Q[te])});let C=this.bodyNode,T=Array.from(this.statesByElement.keys()),P=up(T,this.collectedEnterElements),k=new Map,z=0;P.forEach(($,Q)=>{let te=Fc+z++;k.set(Q,te),$.forEach(be=>li(be,te))});let Ce=[],Be=new Set,Je=new Set;for(let $=0;$<this.collectedLeaveElements.length;$++){let Q=this.collectedLeaveElements[$],te=Q[yi];te&&te.setForRemoval&&(Ce.push(Q),Be.add(Q),te.hasAnimation?this.driver.query(Q,S_,!0).forEach(be=>Be.add(be)):Je.add(Q))}let et=new Map,_e=up(T,Array.from(Be));_e.forEach(($,Q)=>{let te=ps+z++;et.set(Q,te),$.forEach(be=>li(be,te))}),t.push(()=>{P.forEach(($,Q)=>{let te=k.get(Q);$.forEach(be=>$o(be,te))}),_e.forEach(($,Q)=>{let te=et.get(Q);$.forEach(be=>$o(be,te))}),Ce.forEach($=>{this.processLeaveNode($)})});let qt=[],_t=[];for(let $=this._namespaceList.length-1;$>=0;$--)this._namespaceList[$].drainQueuedTransitions(e).forEach(te=>{let be=te.player,lt=te.element;if(qt.push(be),this.collectedEnterElements.length){let mt=lt[yi];if(mt&&mt.setForMove){if(mt.previousTriggersValues&&mt.previousTriggersValues.has(te.triggerName)){let Gt=mt.previousTriggersValues.get(te.triggerName),Nt=this.statesByElement.get(te.element);if(Nt&&Nt.has(te.triggerName)){let kn=Nt.get(te.triggerName);kn.value=Gt,Nt.set(te.triggerName,kn)}}be.destroy();return}}let Ee=!C||!this.driver.containsElement(C,lt),Ot=et.get(lt),Ne=k.get(lt),Ve=this._buildInstruction(te,i,Ne,Ot,Ee);if(Ve.errors&&Ve.errors.length){_t.push(Ve);return}if(Ee){be.onStart(()=>Nn(lt,Ve.fromStyles)),be.onDestroy(()=>vi(lt,Ve.toStyles)),o.push(be);return}if(te.isFallbackTransition){be.onStart(()=>Nn(lt,Ve.fromStyles)),be.onDestroy(()=>vi(lt,Ve.toStyles)),o.push(be);return}let $e=[];Ve.timelines.forEach(mt=>{mt.stretchStartingKeyframe=!0,this.disabledNodes.has(mt.element)||$e.push(mt)}),Ve.timelines=$e,i.append(lt,Ve.timelines);let Gn={instruction:Ve,player:be,element:lt};a.push(Gn),Ve.queriedElements.forEach(mt=>Qt(l,mt,[]).push(be)),Ve.preStyleProps.forEach((mt,Gt)=>{if(mt.size){let Nt=p.get(Gt);Nt||p.set(Gt,Nt=new Set),mt.forEach((kn,Eo)=>Nt.add(Eo))}}),Ve.postStyleProps.forEach((mt,Gt)=>{let Nt=u.get(Gt);Nt||u.set(Gt,Nt=new Set),mt.forEach((kn,Eo)=>Nt.add(Eo))})});if(_t.length){let $=[];_t.forEach(Q=>{$.push(ep(Q.triggerName,Q.errors))}),qt.forEach(Q=>Q.destroy()),this.reportError($)}let tt=new Map,Pt=new Map;a.forEach($=>{let Q=$.element;i.has(Q)&&(Pt.set(Q,Q),this._beforeAnimationBuild($.player.namespaceId,$.instruction,tt))}),o.forEach($=>{let Q=$.element;this._getPreviousPlayers(Q,!1,$.namespaceId,$.triggerName,null).forEach(be=>{Qt(tt,Q,[]).push(be),be.destroy()})});let Zi=Ce.filter($=>gp($,p,u)),Sn=new Map;pp(Sn,this.driver,Je,u,si).forEach($=>{gp($,p,u)&&Zi.push($)});let ui=new Map;P.forEach(($,Q)=>{pp(ui,this.driver,new Set($),p,Ho)}),Zi.forEach($=>{let Q=Sn.get($),te=ui.get($);Sn.set($,new Map([...Q?.entries()??[],...te?.entries()??[]]))});let qn=[],Mo=[],Ra={};a.forEach($=>{let{element:Q,player:te,instruction:be}=$;if(i.has(Q)){if(b.has(Q)){te.onDestroy(()=>vi(Q,be.toStyles)),te.disabled=!0,te.overrideTotalTime(be.totalTime),o.push(te);return}let lt=Ra;if(Pt.size>1){let Ot=Q,Ne=[];for(;Ot=Ot.parentNode;){let Ve=Pt.get(Ot);if(Ve){lt=Ve;break}Ne.push(Ot)}Ne.forEach(Ve=>Pt.set(Ve,lt))}let Ee=this._buildAnimation(te.namespaceId,be,tt,r,ui,Sn);if(te.setRealPlayer(Ee),lt===Ra)qn.push(te);else{let Ot=this.playersByElement.get(lt);Ot&&Ot.length&&(te.parentPlayer=an(Ot)),o.push(te)}}else Nn(Q,be.fromStyles),te.onDestroy(()=>vi(Q,be.toStyles)),Mo.push(te),b.has(Q)&&o.push(te)}),Mo.forEach($=>{let Q=r.get($.element);if(Q&&Q.length){let te=an(Q);$.setRealPlayer(te)}}),o.forEach($=>{$.parentPlayer?$.syncPlayerEvents($.parentPlayer):$.destroy()});for(let $=0;$<Ce.length;$++){let Q=Ce[$],te=Q[yi];if($o(Q,ps),te&&te.hasAnimation)continue;let be=[];if(l.size){let Ee=l.get(Q);Ee&&Ee.length&&be.push(...Ee);let Ot=this.driver.query(Q,us,!0);for(let Ne=0;Ne<Ot.length;Ne++){let Ve=l.get(Ot[Ne]);Ve&&Ve.length&&be.push(...Ve)}}let lt=be.filter(Ee=>!Ee.destroyed);lt.length?O_(this,Q,lt):this.processLeaveNode(Q)}return Ce.length=0,qn.forEach($=>{this.players.push($),$.onDone(()=>{$.destroy();let Q=this.players.indexOf($);this.players.splice(Q,1)}),$.play()}),qn}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,i,o,r){let a=[];if(e){let l=this.playersByQueriedElement.get(t);l&&(a=l)}else{let l=this.playersByElement.get(t);if(l){let p=!r||r==$r;l.forEach(u=>{u.queued||!p&&u.triggerName!=o||a.push(u)})}}return(i||o)&&(a=a.filter(l=>!(i&&i!=l.namespaceId||o&&o!=l.triggerName))),a}_beforeAnimationBuild(t,e,i){let o=e.triggerName,r=e.element,a=e.isRemovalTransition?void 0:t,l=e.isRemovalTransition?void 0:o;for(let p of e.timelines){let u=p.element,b=u!==r,C=Qt(i,u,[]);this._getPreviousPlayers(u,b,a,l,e.toState).forEach(P=>{let k=P.getRealPlayer();k.beforeDestroy&&k.beforeDestroy(),P.destroy(),C.push(P)})}Nn(r,e.fromStyles)}_buildAnimation(t,e,i,o,r,a){let l=e.triggerName,p=e.element,u=[],b=new Set,C=new Set,T=e.timelines.map(k=>{let z=k.element;b.add(z);let Ce=z[yi];if(Ce&&Ce.removedBeforeQueried)return new Li(k.duration,k.delay);let Be=z!==p,Je=A_((i.get(z)||k_).map(tt=>tt.getRealPlayer())).filter(tt=>{let Pt=tt;return Pt.element?Pt.element===z:!1}),et=r.get(z),_e=a.get(z),qt=Oc(this._normalizer,k.keyframes,et,_e),_t=this._buildPlayer(k,qt,Je);if(k.subTimeline&&o&&C.add(z),Be){let tt=new Yr(t,l,z);tt.setRealPlayer(_t),u.push(tt)}return _t});u.forEach(k=>{Qt(this.playersByQueriedElement,k.element,[]).push(k),k.onDone(()=>E_(this.playersByQueriedElement,k.element,k))}),b.forEach(k=>li(k,Nc));let P=an(T);return P.onDestroy(()=>{b.forEach(k=>$o(k,Nc)),vi(p,e.toStyles)}),C.forEach(k=>{Qt(o,k,[]).push(P)}),P}_buildPlayer(t,e,i){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,i):new Li(t.duration,t.delay)}},Yr=class{namespaceId;triggerName;element;_player=new Li;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,i){this.namespaceId=t,this.triggerName=e,this.element=i}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,i)=>{e.forEach(o=>ds(t,i,void 0,o))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){let e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){Qt(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}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(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){let e=this._player;e.triggerCallback&&e.triggerCallback(t)}};function E_(n,t,e){let i=n.get(t);if(i){if(i.length){let o=i.indexOf(e);i.splice(o,1)}i.length==0&&n.delete(t)}return i}function T_(n){return n??null}function vs(n){return n&&n.nodeType===1}function P_(n){return n=="start"||n=="done"}function hp(n,t){let e=n.style.display;return n.style.display=t??"none",e}function pp(n,t,e,i,o){let r=[];e.forEach(p=>r.push(hp(p)));let a=[];i.forEach((p,u)=>{let b=new Map;p.forEach(C=>{let T=t.computeStyle(u,C,o);b.set(C,T),(!T||T.length==0)&&(u[yi]=M_,a.push(u))}),n.set(u,b)});let l=0;return e.forEach(p=>hp(p,r[l++])),a}function up(n,t){let e=new Map;if(n.forEach(l=>e.set(l,[])),t.length==0)return e;let i=1,o=new Set(t),r=new Map;function a(l){if(!l)return i;let p=r.get(l);if(p)return p;let u=l.parentNode;return e.has(u)?p=u:o.has(u)?p=i:p=a(u),r.set(l,p),p}return t.forEach(l=>{let p=a(l);p!==i&&e.get(p).push(l)}),e}function li(n,t){n.classList?.add(t)}function $o(n,t){n.classList?.remove(t)}function O_(n,t,e){an(e).onDone(()=>n.processLeaveNode(t))}function A_(n){let t=[];return Cp(n,t),t}function Cp(n,t){for(let e=0;e<n.length;e++){let i=n[e];i instanceof io?Cp(i.players,t):t.push(i)}}function D_(n,t){let e=Object.keys(n),i=Object.keys(t);if(e.length!=i.length)return!1;for(let o=0;o<e.length;o++){let r=e[o];if(!t.hasOwnProperty(r)||n[r]!==t[r])return!1}return!0}function gp(n,t,e){let i=e.get(n);if(!i)return!1;let o=t.get(n);return o?i.forEach(r=>o.add(r)):t.set(n,i),e.delete(n),!0}var qo=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,i){this._driver=e,this._normalizer=i,this._transitionEngine=new Zc(t.body,e,i),this._timelineEngine=new Xc(t.body,e,i),this._transitionEngine.onRemovalComplete=(o,r)=>this.onRemovalComplete(o,r)}registerTrigger(t,e,i,o,r){let a=t+"-"+o,l=this._triggerCache[a];if(!l){let p=[],u=[],b=_p(this._driver,r,p,u);if(p.length)throw Uh(o,p);l=b_(o,b,this._normalizer),this._triggerCache[a]=l}this._transitionEngine.registerTrigger(e,o,l)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,i,o){this._transitionEngine.insertNode(t,e,i,o)}onRemove(t,e,i){this._transitionEngine.removeNode(t,e,i)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,i,o){if(i.charAt(0)=="@"){let[r,a]=Ac(i),l=o;this._timelineEngine.command(r,e,a,l)}else this._transitionEngine.trigger(t,e,i,o)}listen(t,e,i,o,r){if(i.charAt(0)=="@"){let[a,l]=Ac(i);return this._timelineEngine.listen(a,e,l,r)}return this._transitionEngine.listen(t,e,i,o,r)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}};function I_(n,t){let e=null,i=null;return Array.isArray(t)&&t.length?(e=Hc(t[0]),t.length>1&&(i=Hc(t[t.length-1]))):t instanceof Map&&(e=Hc(t)),e||i?new R_(n,e,i):null}var R_=(()=>{class n{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,i,o){this._element=e,this._startStyles=i,this._endStyles=o;let r=n.initialStylesByElement.get(e);r||n.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&vi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vi(this._element,this._initialStyles),this._endStyles&&(vi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(n.initialStylesByElement.delete(this._element),this._startStyles&&(Nn(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Nn(this._element,this._endStyles),this._endStyles=null),vi(this._element,this._initialStyles),this._state=3)}}return n})();function Hc(n){let t=null;return n.forEach((e,i)=>{F_(i)&&(t=t||new Map,t.set(i,e))}),t}function F_(n){return n==="display"||n==="position"}var Ms=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(t,e,i,o){this.element=t,this.keyframes=e,this.options=i,this._specialStyles=o,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;let e=()=>this._onFinish();this.domPlayer.addEventListener("finish",e),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",e)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){let e=[];return t.forEach(i=>{e.push(Object.fromEntries(i))}),e}_triggerWebAnimation(t,e,i){return t.animate(this._convertKeyframesToObject(e),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,o)=>{o!=="offset"&&t.set(o,this._finished?i:fs(this.element,o))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(i=>i()),e.length=0}},Es=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return Dc(t,e)}getParentElement(t){return hs(t)}query(t,e,i){return Ic(t,e,i)}computeStyle(t,e,i){return fs(t,e)}animate(t,e,i,o,r,a=[]){let l=o==0?"both":"forwards",p={duration:i,delay:o,fill:l};r&&(p.easing=r);let u=new Map,b=a.filter(P=>P instanceof Ms);op(i,o)&&b.forEach(P=>{P.currentSnapshot.forEach((k,z)=>u.set(z,k))});let C=ip(e).map(P=>new Map(P));C=rp(t,C,u);let T=I_(t,C);return new Ms(t,C,p,T)}};var ys="@",xp="@.disabled",Ts=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,i,o){this.namespaceId=t,this.delegate=e,this.engine=i,this._onDestroy=o}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,i,o=!0){this.delegate.insertBefore(t,e,i),this.engine.onInsert(this.namespaceId,e,t,o)}removeChild(t,e,i,o){if(o){this.delegate.removeChild(t,e,i);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,i,o){this.delegate.setAttribute(t,e,i,o)}removeAttribute(t,e,i){this.delegate.removeAttribute(t,e,i)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,i,o){this.delegate.setStyle(t,e,i,o)}removeStyle(t,e,i){this.delegate.removeStyle(t,e,i)}setProperty(t,e,i){e.charAt(0)==ys&&e==xp?this.disableAnimations(t,!!i):this.delegate.setProperty(t,e,i)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,i,o){return this.delegate.listen(t,e,i,o)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},Jc=class extends Ts{factory;constructor(t,e,i,o,r){super(e,i,o,r),this.factory=t,this.namespaceId=e}setProperty(t,e,i){e.charAt(0)==ys?e.charAt(1)=="."&&e==xp?(i=i===void 0?!0:!!i,this.disableAnimations(t,i)):this.engine.process(this.namespaceId,t,e.slice(1),i):this.delegate.setProperty(t,e,i)}listen(t,e,i,o){if(e.charAt(0)==ys){let r=N_(t),a=e.slice(1),l="";return a.charAt(0)!=ys&&([a,l]=V_(a)),this.engine.listen(this.namespaceId,r,a,l,p=>{let u=p._data||-1;this.factory.scheduleListenerCallback(u,i,p)})}return this.delegate.listen(t,e,i,o)}};function N_(n){switch(n){case"body":return document.body;case"document":return document;case"window":return window;default:return n}}function V_(n){let t=n.indexOf("."),e=n.substring(0,t),i=n.slice(t+1);return[e,i]}var Ps=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,i){this.delegate=t,this.engine=e,this._zone=i,e.onRemovalComplete=(o,r)=>{r?.removeChild(null,o)}}createRenderer(t,e){let o=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let u=this._rendererCache,b=u.get(o);if(!b){let C=()=>u.delete(o);b=new Ts("",o,this.engine,C),u.set(o,b)}return b}let r=e.id,a=e.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);let l=u=>{Array.isArray(u)?u.forEach(l):this.engine.registerTrigger(r,a,t,u.name,u)};return e.data.animation.forEach(l),new Jc(this,a,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,i){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(i));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(r=>{let[a,l]=r;a(l)}),this._animationCallbacksBuffer=[]})}),o.push([e,i])}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(t){this.engine.flush(),this.delegate.componentReplaced?.(t)}};var j_=(()=>{class n extends qo{constructor(e,i,o){super(e,i,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||n)(Wa(it),Wa(ro),Wa(ao))};static \u0275prov=R({token:n,factory:n.\u0275fac})}return n})();function z_(){return new Cs}function B_(n,t,e){return new Ps(n,t,e)}var wp=[{provide:ao,useFactory:z_},{provide:qo,useClass:j_},{provide:gi,useFactory:B_,deps:[hh,qo,me]}],pk=[{provide:ro,useClass:ed},{provide:Rr,useValue:"NoopAnimations"},...wp],H_=[{provide:ro,useFactory:()=>new Es},{provide:Rr,useFactory:()=>"BrowserAnimations"},...wp];function Sp(){return Zm("NgEagerAnimations"),[...H_]}var Qr=class{_attachedHost;attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;t!=null&&(this._attachedHost=null,t.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(t){this._attachedHost=t}},Ci=class extends Qr{component;viewContainerRef;injector;projectableNodes;constructor(t,e,i,o){super(),this.component=t,this.viewContainerRef=e,this.injector=i,this.projectableNodes=o}},sn=class extends Qr{templateRef;viewContainerRef;context;injector;constructor(t,e,i,o){super(),this.templateRef=t,this.viewContainerRef=e,this.context=i,this.injector=o}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}},id=class extends Qr{element;constructor(t){super(),this.element=t instanceof K?t.nativeElement:t}},Vn=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof Ci)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof sn)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof id)return this._attachedPortal=t,this.attachDomPortal(t)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},Os=class extends Vn{outletElement;_appRef;_defaultInjector;constructor(t,e,i){super(),this.outletElement=t,this._appRef=e,this._defaultInjector=i}attachComponentPortal(t){let e;if(t.viewContainerRef){let i=t.injector||t.viewContainerRef.injector,o=i.get(bc,null,{optional:!0})||void 0;e=t.viewContainerRef.createComponent(t.component,{index:t.viewContainerRef.length,injector:i,ngModuleRef:o,projectableNodes:t.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{let i=this._appRef,o=t.injector||this._defaultInjector||fe.NULL,r=o.get(Ua,i.injector);e=ch(t.component,{elementInjector:o,environmentInjector:r,projectableNodes:t.projectableNodes||void 0}),i.attachView(e.hostView),this.setDisposeFn(()=>{i.viewCount>0&&i.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=t,e}attachTemplatePortal(t){let e=t.viewContainerRef,i=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return i.rootNodes.forEach(o=>this.outletElement.appendChild(o)),i.detectChanges(),this.setDisposeFn(()=>{let o=e.indexOf(i);o!==-1&&e.remove(o)}),this._attachedPortal=t,i}attachDomPortal=t=>{let e=t.element;e.parentNode;let i=this.outletElement.ownerDocument.createComment("dom-portal");e.parentNode.insertBefore(i,e),this.outletElement.appendChild(e),this._attachedPortal=t,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(e,i)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var Ln=(()=>{class n extends Vn{_moduleRef=d(bc,{optional:!0});_document=d(it);_viewContainerRef=d(Zn);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}attached=new H;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let i=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,o=i.createComponent(e.component,{index:i.length,injector:e.injector||i.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return i!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=e,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(e){e.setAttachedHost(this);let i=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=i,this.attached.emit(i),i}attachDomPortal=e=>{let i=e.element;i.parentNode;let o=this._document.createComment("dom-portal");e.setAttachedHost(this),i.parentNode.insertBefore(o,i),this._getRootNode().appendChild(i),this._attachedPortal=e,super.setDisposeFn(()=>{o.parentNode&&o.parentNode.replaceChild(i,o)})};_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[ye]})}return n})();var ln=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({})}return n})();var W_=20,cn=(()=>{class n{_ngZone=d(me);_platform=d(rt);_renderer=d(gi).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new D;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let i=this.scrollContainers.get(e);i&&(i.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=W_){return this._platform.isBrowser?new oi(i=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let o=e>0?this._scrolled.pipe(fc(e)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):kt()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(e,i){let o=this.getAncestorScrollContainers(e);return this.scrolled(i).pipe(ue(r=>!r||o.indexOf(r)>-1))}getAncestorScrollContainers(e){let i=[];return this.scrollContainers.forEach((o,r)=>{this._scrollableContainsElement(r,e)&&i.push(r)}),i}_scrollableContainsElement(e,i){let o=zr(i),r=e.getElementRef().nativeElement;do if(o==r)return!0;while(o=o.parentElement);return!1}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),dn=(()=>{class n{elementRef=d(K);scrollDispatcher=d(cn);ngZone=d(me);dir=d(Ct,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new D;_renderer=d(ot);_cleanupScroll;_elementScrolled=new D;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){let i=this.elementRef.nativeElement,o=this.dir&&this.dir.value=="rtl";e.left==null&&(e.left=o?e.end:e.start),e.right==null&&(e.right=o?e.start:e.end),e.bottom!=null&&(e.top=i.scrollHeight-i.clientHeight-e.bottom),o&&Bo()!=zo.NORMAL?(e.left!=null&&(e.right=i.scrollWidth-i.clientWidth-e.left),Bo()==zo.INVERTED?e.left=e.right:Bo()==zo.NEGATED&&(e.left=e.right?-e.right:e.right)):e.right!=null&&(e.left=i.scrollWidth-i.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){let i=this.elementRef.nativeElement;rs()?i.scrollTo(e):(e.top!=null&&(i.scrollTop=e.top),e.left!=null&&(i.scrollLeft=e.left))}measureScrollOffset(e){let i="left",o="right",r=this.elementRef.nativeElement;if(e=="top")return r.scrollTop;if(e=="bottom")return r.scrollHeight-r.clientHeight-r.scrollTop;let a=this.dir&&this.dir.value=="rtl";return e=="start"?e=a?o:i:e=="end"&&(e=a?i:o),a&&Bo()==zo.INVERTED?e==i?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:a&&Bo()==zo.NEGATED?e==i?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==i?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return n})(),U_=20,Bi=(()=>{class n{_platform=d(rt);_listeners;_viewportSize;_change=new D;_document=d(it);constructor(){let e=d(me),i=d(gi).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let o=r=>this._change.next(r);this._listeners=[i.listen("window","resize",o),i.listen("window","orientationchange",o)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:i,height:o}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+o,right:e.left+i,height:o,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,i=this._getWindow(),o=e.documentElement,r=o.getBoundingClientRect(),a=-r.top||e.body.scrollTop||i.scrollY||o.scrollTop||0,l=-r.left||e.body.scrollLeft||i.scrollX||o.scrollLeft||0;return{top:a,left:l}}change(e=U_){return e>0?this._change.pipe(fc(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var zi=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({})}return n})(),nd=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[Br,zi,Br,zi]})}return n})();var kp=rs();function Qo(n){return new As(n.get(Bi),n.get(it))}var As=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(t,e){this._viewportRuler=t,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=dt(-this._previousScrollPosition.left),t.style.top=dt(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,e=this._document.body,i=t.style,o=e.style,r=i.scrollBehavior||"",a=o.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),kp&&(i.scrollBehavior=o.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),kp&&(i.scrollBehavior=r,o.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.documentElement,i=this._viewportRuler.getViewportSize();return e.scrollHeight>i.height||e.scrollWidth>i.width}};function Dp(n,t){return new Ds(n.get(cn),n.get(me),n.get(Bi),t)}var Ds=class{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(t,e,i,o){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=i,this._config=o}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(ue(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}};var Xr=class{enable(){}disable(){}attach(){}};function od(n,t){return t.some(e=>{let i=n.bottom<e.top,o=n.top>e.bottom,r=n.right<e.left,a=n.left>e.right;return i||o||r||a})}function Mp(n,t){return t.some(e=>{let i=n.top<e.top,o=n.bottom>e.bottom,r=n.left<e.left,a=n.right>e.right;return i||o||r||a})}function Hi(n,t){return new Is(n.get(cn),n.get(Bi),n.get(me),t)}var Is=class{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(t,e,i,o){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=i,this._config=o}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(!this._scrollSubscription){let t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:o}=this._viewportRuler.getViewportSize();od(e,[{width:i,height:o,bottom:o,right:i,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},Ip=(()=>{class n{_injector=d(fe);constructor(){}noop=()=>new Xr;close=e=>Dp(this._injector,e);block=()=>Qo(this._injector);reposition=e=>Hi(this._injector,e);static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),mn=class{positionStrategy;scrollStrategy=new Xr;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(t){if(t){let e=Object.keys(t);for(let i of e)t[i]!==void 0&&(this[i]=t[i])}}};var Rs=class{connectionPair;scrollableViewProperties;constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var Rp=(()=>{class n{_attachedOverlays=[];_document=d(it);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let i=this._attachedOverlays.indexOf(e);i>-1&&this._attachedOverlays.splice(i,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Fp=(()=>{class n extends Rp{_ngZone=d(me);_renderer=d(gi).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=e=>{let i=this._attachedOverlays;for(let o=i.length-1;o>-1;o--)if(i[o]._keydownEvents.observers.length>0){this._ngZone.run(()=>i[o]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Np=(()=>{class n extends Rp{_platform=d(rt);_ngZone=d(me);_renderer=d(gi).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){let i=this._document.body,o={capture:!0},r=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[r.listen(i,"pointerdown",this._pointerDownListener,o),r.listen(i,"click",this._clickListener,o),r.listen(i,"auxclick",this._clickListener,o),r.listen(i,"contextmenu",this._clickListener,o)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=i.style.cursor,i.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=es(e)};_clickListener=e=>{let i=es(e),o=e.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:i;this._pointerDownEventTarget=null;let r=this._attachedOverlays.slice();for(let a=r.length-1;a>-1;a--){let l=r[a];if(l._outsidePointerEvents.observers.length<1||!l.hasAttached())continue;if(Ep(l.overlayElement,i)||Ep(l.overlayElement,o))break;let p=l._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>p.next(e)):p.next(e)}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Ep(n,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,i=t;for(;i;){if(i===n)return!0;i=e&&i instanceof ShadowRoot?i.host:i.parentNode}return!1}var Vp=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(i,o){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return n})(),Vs=(()=>{class n{_platform=d(rt);_containerElement;_document=d(it);_styleLoader=d(Lt);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||Sc()){let o=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r<o.length;r++)o[r].remove()}let i=this._document.createElement("div");i.classList.add(e),Sc()?i.setAttribute("platform","test"):this._platform.isBrowser||i.setAttribute("platform","server"),this._document.body.appendChild(i),this._containerElement=i}_loadStyles(){this._styleLoader.load(Vp)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),rd=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,e,i,o){this._renderer=e,this._ngZone=i,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=e.listen(this.element,"click",o)}detach(){this._ngZone.runOutsideAngular(()=>{let t=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),t.style.pointerEvents="none",t.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Go=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new D;_attachments=new D;_detachments=new D;_positionStrategy;_scrollStrategy;_locationChanges=Di.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new D;_outsidePointerEvents=new D;_afterNextRenderRef;constructor(t,e,i,o,r,a,l,p,u,b=!1,C,T){this._portalOutlet=t,this._host=e,this._pane=i,this._config=o,this._ngZone=r,this._keyboardDispatcher=a,this._document=l,this._location=p,this._outsideClickDispatcher=u,this._animationsDisabled=b,this._injector=C,this._renderer=T,o.scrollStrategy&&(this._scrollStrategy=o.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=o.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Et(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,t&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=q(q({},this._config),t),this._updateElementSize()}setDirection(t){this._config=Ie(q({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=dt(this._config.width),t.height=dt(this._config.height),t.minWidth=dt(this._config.minWidth),t.minHeight=dt(this._config.minHeight),t.maxWidth=dt(this._config.maxWidth),t.maxHeight=dt(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new rd(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(t))}):this._backdropRef.element.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(t,e,i){let o=xc(e||[]).filter(r=>!!r);o.length&&(i?t.classList.add(...o):t.classList.remove(...o))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=Et(()=>{t=!0,this._detachContent()},{injector:this._injector})}catch(e){if(t)throw e;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let t=this._scrollStrategy;t?.disable(),t?.detach?.()}},Tp="cdk-overlay-connected-position-bounding-box",q_=/([A-Za-z%]+)$/;function Kr(n,t){return new Fs(t,n.get(Bi),n.get(it),n.get(rt),n.get(Vs))}var Fs=class{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new D;_resizeSubscription=Di.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(t,e,i,o,r){this._viewportRuler=e,this._document=i,this._platform=o,this._overlayContainer=r,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(Tp),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._originRect,e=this._overlayRect,i=this._viewportRect,o=this._containerRect,r=[],a;for(let l of this._preferredPositions){let p=this._getOriginPoint(t,o,l),u=this._getOverlayPoint(p,e,l),b=this._getOverlayFit(u,e,i,l);if(b.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(l,p);return}if(this._canFitWithFlexibleDimensions(b,u,i)){r.push({position:l,origin:p,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(p,l)});continue}(!a||a.overlayFit.visibleArea<b.visibleArea)&&(a={overlayFit:b,overlayPoint:u,originPoint:p,position:l,overlayRect:e})}if(r.length){let l=null,p=-1;for(let u of r){let b=u.boundingBoxRect.width*u.boundingBoxRect.height*(u.position.weight||1);b>p&&(p=b,l=u)}this._isPushed=!1,this._applyPosition(l.position,l.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&so(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Tp),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,e)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,t.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e,i){let o;if(i.originX=="center")o=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,l=this._isRtl()?t.left:t.right;o=i.originX=="start"?a:l}e.left<0&&(o-=e.left);let r;return i.originY=="center"?r=t.top+t.height/2:r=i.originY=="top"?t.top:t.bottom,e.top<0&&(r-=e.top),{x:o,y:r}}_getOverlayPoint(t,e,i){let o;i.overlayX=="center"?o=-e.width/2:i.overlayX==="start"?o=this._isRtl()?-e.width:0:o=this._isRtl()?0:-e.width;let r;return i.overlayY=="center"?r=-e.height/2:r=i.overlayY=="top"?0:-e.height,{x:t.x+o,y:t.y+r}}_getOverlayFit(t,e,i,o){let r=Op(e),{x:a,y:l}=t,p=this._getOffset(o,"x"),u=this._getOffset(o,"y");p&&(a+=p),u&&(l+=u);let b=0-a,C=a+r.width-i.width,T=0-l,P=l+r.height-i.height,k=this._subtractOverflows(r.width,b,C),z=this._subtractOverflows(r.height,T,P),Ce=k*z;return{visibleArea:Ce,isCompletelyWithinViewport:r.width*r.height===Ce,fitsInViewportVertically:z===r.height,fitsInViewportHorizontally:k==r.width}}_canFitWithFlexibleDimensions(t,e,i){if(this._hasFlexibleDimensions){let o=i.bottom-e.y,r=i.right-e.x,a=Pp(this._overlayRef.getConfig().minHeight),l=Pp(this._overlayRef.getConfig().minWidth),p=t.fitsInViewportVertically||a!=null&&a<=o,u=t.fitsInViewportHorizontally||l!=null&&l<=r;return p&&u}return!1}_pushOverlayOnScreen(t,e,i){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let o=Op(e),r=this._viewportRect,a=Math.max(t.x+o.width-r.width,0),l=Math.max(t.y+o.height-r.height,0),p=Math.max(r.top-i.top-t.y,0),u=Math.max(r.left-i.left-t.x,0),b=0,C=0;return o.width<=r.width?b=u||-a:b=t.x<this._viewportMargin?r.left-i.left-t.x:0,o.height<=r.height?C=p||-l:C=t.y<this._viewportMargin?r.top-i.top-t.y:0,this._previousPushAmount={x:b,y:C},{x:t.x+b,y:t.y+C}}_applyPosition(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._positionChanges.observers.length){let i=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!G_(this._lastScrollVisibility,i)){let o=new Rs(t,i);this._positionChanges.next(o)}this._lastScrollVisibility=i}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),i,o=t.overlayY;t.overlayX==="center"?i="center":this._isRtl()?i=t.overlayX==="start"?"right":"left":i=t.overlayX==="start"?"left":"right";for(let r=0;r<e.length;r++)e[r].style.transformOrigin=`${i} ${o}`}_calculateBoundingBoxRect(t,e){let i=this._viewportRect,o=this._isRtl(),r,a,l;if(e.overlayY==="top")a=t.y,r=i.height-a+this._viewportMargin;else if(e.overlayY==="bottom")l=i.height-t.y+this._viewportMargin*2,r=i.height-l+this._viewportMargin;else{let P=Math.min(i.bottom-t.y+i.top,t.y),k=this._lastBoundingBoxSize.height;r=P*2,a=t.y-P,r>k&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-k/2)}let p=e.overlayX==="start"&&!o||e.overlayX==="end"&&o,u=e.overlayX==="end"&&!o||e.overlayX==="start"&&o,b,C,T;if(u)T=i.width-t.x+this._viewportMargin*2,b=t.x-this._viewportMargin;else if(p)C=t.x,b=i.right-t.x;else{let P=Math.min(i.right-t.x+i.left,t.x),k=this._lastBoundingBoxSize.width;b=P*2,C=t.x-P,b>k&&!this._isInitialRender&&!this._growAfterOpen&&(C=t.x-k/2)}return{top:a,left:C,bottom:l,right:T,width:b,height:r}}_setBoundingBoxStyles(t,e){let i=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.width,this._lastBoundingBoxSize.width));let o={};if(this._hasExactPosition())o.top=o.left="0",o.bottom=o.right=o.maxHeight=o.maxWidth="",o.width=o.height="100%";else{let r=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;o.height=dt(i.height),o.top=dt(i.top),o.bottom=dt(i.bottom),o.width=dt(i.width),o.left=dt(i.left),o.right=dt(i.right),e.overlayX==="center"?o.alignItems="center":o.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?o.justifyContent="center":o.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",r&&(o.maxHeight=dt(r)),a&&(o.maxWidth=dt(a))}this._lastBoundingBoxSize=i,so(this._boundingBox.style,o)}_resetBoundingBoxStyles(){so(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){so(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let i={},o=this._hasExactPosition(),r=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(o){let b=this._viewportRuler.getViewportScrollPosition();so(i,this._getExactOverlayY(e,t,b)),so(i,this._getExactOverlayX(e,t,b))}else i.position="static";let l="",p=this._getOffset(e,"x"),u=this._getOffset(e,"y");p&&(l+=`translateX(${p}px) `),u&&(l+=`translateY(${u}px)`),i.transform=l.trim(),a.maxHeight&&(o?i.maxHeight=dt(a.maxHeight):r&&(i.maxHeight="")),a.maxWidth&&(o?i.maxWidth=dt(a.maxWidth):r&&(i.maxWidth="")),so(this._pane.style,i)}_getExactOverlayY(t,e,i){let o={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;o.bottom=`${a-(r.y+this._overlayRect.height)}px`}else o.top=dt(r.y);return o}_getExactOverlayX(t,e,i){let o={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,i));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let l=this._document.documentElement.clientWidth;o.right=`${l-(r.x+this._overlayRect.width)}px`}else o.left=dt(r.x);return o}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),i=this._scrollables.map(o=>o.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Mp(t,i),isOriginOutsideView:od(t,i),isOverlayClipped:Mp(e,i),isOverlayOutsideView:od(e,i)}}_subtractOverflows(t,...e){return e.reduce((i,o)=>i-Math.max(o,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+t-this._viewportMargin,bottom:i.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return e==="x"?t.offsetX==null?this._offsetX:t.offsetX:t.offsetY==null?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&xc(t).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){let t=this._origin;if(t instanceof K)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,i=t.height||0;return{top:t.y,bottom:t.y+i,left:t.x,right:t.x+e,height:i,width:e}}};function so(n,t){for(let e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}function Pp(n){if(typeof n!="number"&&n!=null){let[t,e]=n.split(q_);return!e||e==="px"?parseFloat(t):null}return n||null}function Op(n){return{top:Math.floor(n.top),right:Math.floor(n.right),bottom:Math.floor(n.bottom),left:Math.floor(n.left),width:Math.floor(n.width),height:Math.floor(n.height)}}function G_(n,t){return n===t?!0:n.isOriginClipped===t.isOriginClipped&&n.isOriginOutsideView===t.isOriginOutsideView&&n.isOverlayClipped===t.isOverlayClipped&&n.isOverlayOutsideView===t.isOverlayOutsideView}var Ap="cdk-global-overlay-wrapper";function jn(n){return new Ns}var Ns=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(t){let e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(Ap),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:o,height:r,maxWidth:a,maxHeight:l}=i,p=(o==="100%"||o==="100vw")&&(!a||a==="100%"||a==="100vw"),u=(r==="100%"||r==="100vh")&&(!l||l==="100%"||l==="100vh"),b=this._xPosition,C=this._xOffset,T=this._overlayRef.getConfig().direction==="rtl",P="",k="",z="";p?z="flex-start":b==="center"?(z="center",T?k=C:P=C):T?b==="left"||b==="end"?(z="flex-end",P=C):(b==="right"||b==="start")&&(z="flex-start",k=C):b==="left"||b==="start"?(z="flex-start",P=C):(b==="right"||b==="end")&&(z="flex-end",k=C),t.position=this._cssPosition,t.marginLeft=p?"0":P,t.marginTop=u?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=p?"0":k,e.justifyContent=z,e.alignItems=u?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,i=e.style;e.classList.remove(Ap),i.justifyContent=i.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},Lp=(()=>{class n{_injector=d(fe);constructor(){}global(){return jn()}flexibleConnectedTo(e){return Kr(this._injector,e)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function pn(n,t){n.get(Lt).load(Vp);let e=n.get(Vs),i=n.get(it),o=n.get(Fe),r=n.get(Fr),a=n.get(Ct),l=i.createElement("div"),p=i.createElement("div");p.id=o.getId("cdk-overlay-"),p.classList.add("cdk-overlay-pane"),l.appendChild(p),e.getContainerElement().appendChild(l);let u=new Os(p,r,n),b=new mn(t),C=n.get(ot,null,{optional:!0})||n.get(gi).createRenderer(null,null);return b.direction=b.direction||a.value,new Go(u,l,p,b,n.get(me),n.get(Fp),i,n.get(dh),n.get(Np),t?.disableAnimations??n.get(Rr,null,{optional:!0})==="NoopAnimations",n.get(Ua),C)}var jp=(()=>{class n{scrollStrategies=d(Ip);_positionBuilder=d(Lp);_injector=d(fe);constructor(){}create(e){return pn(this._injector,e)}position(){return this._positionBuilder}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Y_=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],zp=new ee("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let n=d(fe);return()=>Hi(n)}}),Yo=(()=>{class n{elementRef=d(K);constructor(){}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return n})(),Ls=(()=>{class n{_dir=d(Ct,{optional:!0});_injector=d(fe);_overlayRef;_templatePortal;_backdropSubscription=Di.EMPTY;_attachSubscription=Di.EMPTY;_detachSubscription=Di.EMPTY;_positionSubscription=Di.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=d(zp);_disposeOnNavigation=!1;_ngZone=d(me);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(e){this._disposeOnNavigation=e}backdropClick=new H;positionChange=new H;attach=new H;detach=new H;overlayKeydown=new H;overlayOutsideClick=new H;constructor(){let e=d(En),i=d(Zn);this._templatePortal=new sn(e,i),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Y_);let e=this._overlayRef=pn(this._injector,this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(i=>{this.overlayKeydown.next(i),i.keyCode===27&&!this.disableClose&&!vt(i)&&(i.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(i=>{let o=this._getOriginElement(),r=es(i);(!o||o!==r&&!o.contains(r))&&this.overlayOutsideClick.next(i)})}_buildConfig(){let e=this._position=this.positionStrategy||this._createPositionStrategy(),i=new mn({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||this.width===0)&&(i.width=this.width),(this.height||this.height===0)&&(i.height=this.height),(this.minWidth||this.minWidth===0)&&(i.minWidth=this.minWidth),(this.minHeight||this.minHeight===0)&&(i.minHeight=this.minHeight),this.backdropClass&&(i.backdropClass=this.backdropClass),this.panelClass&&(i.panelClass=this.panelClass),i}_updatePositionStrategy(e){let i=this.positions.map(o=>({originX:o.originX,originY:o.originY,overlayX:o.overlayX,overlayY:o.overlayY,offsetX:o.offsetX||this.offsetX,offsetY:o.offsetY||this.offsetY,panelClass:o.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(i).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){let e=Kr(this._injector,this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof Yo?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof Yo?this.origin.elementRef.nativeElement:this.origin instanceof K?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(Gm(()=>this.positionChange.observers.length>0)).subscribe(e=>{this._ngZone.run(()=>this.positionChange.emit(e)),this.positionChange.observers.length===0&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",J],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",J],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",J],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",J],push:[2,"cdkConnectedOverlayPush","push",J],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",J]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[Le]})}return n})();function Q_(n){let t=d(fe);return()=>Hi(t)}var X_={provide:zp,useFactory:Q_},xi=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[jp,X_],imports:[Br,ln,nd,nd]})}return n})();function K_(n,t){if(n&1){let e=E();s(0,"div",1)(1,"button",2),_("click",function(){v(e);let o=g();return y(o.action())}),h(2),c()()}if(n&2){let e=g();m(2),ae(" ",e.data.action," ")}}var Z_=["label"];function J_(n,t){}var eb=Math.pow(2,31)-1,Zr=class{_overlayRef;instance;containerInstance;_afterDismissed=new D;_afterOpened=new D;_onAction=new D;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,eb))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},Bp=new ee("MatSnackBarData"),Xo=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},tb=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return n})(),ib=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return n})(),nb=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return n})(),Hp=(()=>{class n{snackBarRef=d(Zr);data=d(Bp);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(i,o){i&1&&(s(0,"div",0),h(1),c(),w(2,K_,3,1,"div",1)),i&2&&(m(),ae(" ",o.data.message,`
|
|
3
3
|
`),m(),S(o.hasAction?2:-1))},dependencies:[It,tb,ib,nb],styles:[`.mat-mdc-simple-snack-bar{display:flex}.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-label{max-height:50vh;overflow:auto}
|
|
4
|
-
`],encapsulation:2,changeDetection:0})}return n})(),
|
|
5
|
-
`],encapsulation:2})}return n})();function rb(){return new Xo}var ab=new ee("mat-snack-bar-default-options",{providedIn:"root",factory:rb}),
|
|
6
|
-
`],encapsulation:2})}return n})(),Jr=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new D;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(t,e){this.overlayRef=t,this.config=e,this.disableClose=e.disableClose,this.backdropClick=t.backdropClick(),this.keydownEvents=t.keydownEvents(),this.outsidePointerEvents=t.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(i=>{i.keyCode===27&&!this.disableClose&&!vt(i)&&(i.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=t.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(t,e){if(this._canClose(t)){let i=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),i.next(t),i.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(t="",e=""){return this.overlayRef.updateSize({width:t,height:e}),this}addPanelClass(t){return this.overlayRef.addPanelClass(t),this}removePanelClass(t){return this.overlayRef.removePanelClass(t),this}_canClose(t){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(t,e,this.componentInstance))}},lb=new ee("DialogScrollStrategy",{providedIn:"root",factory:()=>{let n=d(ge);return()=>Qo(n)}}),cb=new ee("DialogData"),db=new ee("DefaultDialogConfig");function mb(n){let t=Te(n),e=new H;return{valueSignal:t,get value(){return t()},change:e,ngOnDestroy(){e.complete()}}}var cd=(()=>{class n{_injector=d(ge);_defaultOptions=d(db,{optional:!0});_parentDialog=d(n,{optional:!0,skipSelf:!0});_overlayContainer=d(Ns);_idGenerator=d(Fe);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new D;_afterOpenedAtThisLevel=new D;_ariaHiddenElements=new Map;_scrollStrategy=d(lb);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=Ro(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Vt(void 0)));constructor(){}open(e,i){let o=this._defaultOptions||new zn;i=q(q({},o),i),i.id=i.id||this._idGenerator.getId("cdk-dialog-"),i.id&&this.getDialogById(i.id);let r=this._getOverlayConfig(i),a=pn(this._injector,r),l=new Jr(a,i),p=this._attachContainer(a,l,i);if(l.containerInstance=p,!this.openDialogs.length){let u=this._overlayContainer.getContainerElement();p._focusTrapped?p._focusTrapped.pipe(Mt(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(u)}):this._hideNonDialogContentFromAssistiveTechnology(u)}return this._attachDialogContent(e,l,p,i),this.openDialogs.push(l),l.closed.subscribe(()=>this._removeOpenDialog(l,!0)),this.afterOpened.next(l),l}closeAll(){sd(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){sd(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),sd(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let i=new mn({positionStrategy:e.positionStrategy||jn().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(i.backdropClass=e.backdropClass),i}_attachContainer(e,i,o){let r=o.injector||o.viewContainerRef?.injector,a=[{provide:zn,useValue:o},{provide:Jr,useValue:i},{provide:Go,useValue:e}],l;o.container?typeof o.container=="function"?l=o.container:(l=o.container.type,a.push(...o.container.providers(o))):l=ld;let p=new Ci(l,o.viewContainerRef,ge.create({parent:r||this._injector,providers:a}));return e.attach(p).instance}_attachDialogContent(e,i,o,r){if(e instanceof En){let a=this._createInjector(r,i,o,void 0),l={$implicit:r.data,dialogRef:i};r.templateContext&&(l=q(q({},l),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),o.attachTemplatePortal(new sn(e,null,l,a))}else{let a=this._createInjector(r,i,o,this._injector),l=o.attachComponentPortal(new Ci(e,r.viewContainerRef,a));i.componentRef=l,i.componentInstance=l.instance}}_createInjector(e,i,o,r){let a=e.injector||e.viewContainerRef?.injector,l=[{provide:cb,useValue:e.data},{provide:Jr,useValue:i}];return e.providers&&(typeof e.providers=="function"?l.push(...e.providers(i,e,o)):l.push(...e.providers)),e.direction&&(!a||!a.get(Ct,null,{optional:!0}))&&l.push({provide:Ct,useValue:mb(e.direction)}),ge.create({parent:a||r,providers:l})}_removeOpenDialog(e,i){let o=this.openDialogs.indexOf(e);o>-1&&(this.openDialogs.splice(o,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,a)=>{r?a.setAttribute("aria-hidden",r):a.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),i&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let i=e.parentElement.children;for(let o=i.length-1;o>-1;o--){let r=i[o];r!==e&&r.nodeName!=="SCRIPT"&&r.nodeName!=="STYLE"&&!r.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function sd(n,t){let e=n.length;for(;e--;)t(n[e])}var Wp=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[cd],imports:[xi,ln,jo,ln]})}return n})();function hb(n,t){}var ta=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},dd="mdc-dialog--open",Up="mdc-dialog--opening",$p="mdc-dialog--closing",pb=150,ub=75,Yp=(()=>{class n extends ld{_animationStateChanged=new H;_animationsEnabled=!We();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?Gp(this._config.enterAnimationDuration)??pb:0;_exitAnimationDuration=this._animationsEnabled?Gp(this._config.exitAnimationDuration)??ub:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(qp,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Up,dd)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(dd),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(dd),this._animationsEnabled?(this._hostElement.style.setProperty(qp,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add($p)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(Up,$p)}_waitForAnimationToComplete(e,i){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(i,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let i=super.attachComponentPortal(e);return i.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),i}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275cmp=M({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(i,o){i&2&&(ei("id",o._config.id),Y("aria-modal",o._config.ariaModal)("role",o._config.role)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null),A("_mat-animation-noopable",!o._animationsEnabled)("mat-mdc-dialog-container-with-actions",o._actionSectionCount>0))},features:[ye],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(i,o){i&1&&(s(0,"div",0)(1,"div",1),Ge(2,hb,0,0,"ng-template",2),c()())},dependencies:[Ln],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
|
|
7
|
-
`],encapsulation:2})}return n})(),qp="--mat-dialog-transition-duration";function Gp(n){return n==null?null:typeof n=="number"?n:n.endsWith("ms")?bi(n.substring(0,n.length-2)):n.endsWith("s")?bi(n.substring(0,n.length-1))*1e3:n==="0"?0:null}var ea=(function(n){return n[n.OPEN=0]="OPEN",n[n.CLOSING=1]="CLOSING",n[n.CLOSED=2]="CLOSED",n})(ea||{}),ii=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new D;_beforeClosed=new D;_result;_closeFallbackTimeout;_state=ea.OPEN;_closeInteractionType;constructor(t,e,i){this._ref=t,this._config=e,this._containerInstance=i,this.disableClose=e.disableClose,this.id=t.id,t.addPanelClass("mat-mdc-dialog-panel"),i._animationStateChanged.pipe(pe(o=>o.state==="opened"),Mt(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),i._animationStateChanged.pipe(pe(o=>o.state==="closed"),Mt(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Ii(this.backdropClick(),this.keydownEvents().pipe(pe(o=>o.keyCode===27&&!this.disableClose&&!vt(o)))).subscribe(o=>{this.disableClose||(o.preventDefault(),Qp(this,o.type==="keydown"?"keyboard":"mouse"))})}close(t){let e=this._config.closePredicate;e&&!e(t,this._config,this.componentInstance)||(this._result=t,this._containerInstance._animationStateChanged.pipe(pe(i=>i.state==="closing"),Mt(1)).subscribe(i=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),i.totalTime+100)}),this._state=ea.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(t){let e=this._ref.config.positionStrategy;return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(t="",e=""){return this._ref.updateSize(t,e),this}addPanelClass(t){return this._ref.addPanelClass(t),this}removePanelClass(t){return this._ref.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=ea.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function Qp(n,t,e){return n._closeInteractionType=t,n.close(e)}var Wi=new ee("MatMdcDialogData"),Ls=new ee("mat-mdc-dialog-default-options"),Xp=new ee("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let n=d(ge);return()=>Qo(n)}}),wi=(()=>{class n{_defaultOptions=d(Ls,{optional:!0});_scrollStrategy=d(Xp);_parentDialog=d(n,{optional:!0,skipSelf:!0});_idGenerator=d(Fe);_injector=d(ge);_dialog=d(cd);_animationsDisabled=We();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new D;_afterOpenedAtThisLevel=new D;dialogConfigClass=ta;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=Ro(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Vt(void 0)));constructor(){this._dialogRefConstructor=ii,this._dialogContainerType=Yp,this._dialogDataToken=Wi}open(e,i){let o;i=q(q({},this._defaultOptions||new ta),i),i.id=i.id||this._idGenerator.getId("mat-mdc-dialog-"),i.scrollStrategy=i.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(e,Ie(q({},i),{positionStrategy:jn(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||i.enterAnimationDuration?.toLocaleString()==="0"||i.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:i},{provide:zn,useValue:i}]},templateContext:()=>({dialogRef:o}),providers:(a,l,p)=>(o=new this._dialogRefConstructor(a,i,p),o.updatePosition(i?.position),[{provide:this._dialogContainerType,useValue:p},{provide:this._dialogDataToken,useValue:l.data},{provide:this._dialogRefConstructor,useValue:o}])}));return o.componentRef=r.componentRef,o.componentInstance=r.componentInstance,this.openDialogs.push(o),this.afterOpened.next(o),o.afterClosed().subscribe(()=>{let a=this.openDialogs.indexOf(o);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||this._getAfterAllClosed().next())}),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let i=e.length;for(;i--;)e[i].close()}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Kp=(()=>{class n{_dialogRef=d(ii,{optional:!0});_elementRef=d(K);_dialog=d(wi);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=gb(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n})}return n})(),un=(()=>{class n extends Kp{id=d(Fe).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(i,o){i&2&&ei("id",o.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[ye]})}return n})(),gn=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[Jm([dn])]})}return n})(),fn=(()=>{class n extends Kp{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(i,o){i&2&&A("mat-mdc-dialog-actions-align-start",o.align==="start")("mat-mdc-dialog-actions-align-center",o.align==="center")("mat-mdc-dialog-actions-align-end",o.align==="end")},inputs:{align:"align"},features:[ye]})}return n})();function gb(n,t){let e=n.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?t.find(i=>i.id===e.id):null}var lo=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[wi],imports:[Wp,xi,ln,le,le]})}return n})();var Zo=class n{baseUrl="/api/projects";http=d(Ye);listProjects(){return this.http.get(this.baseUrl)}getProject(t){return this.http.get(`${this.baseUrl}/${t}`)}getProjectConfig(t){return this.http.get(`${this.baseUrl}/${t}/config`)}updateProjectConfig(t,e){return this.http.put(`${this.baseUrl}/${t}/config`,e)}createProject(t,e){return this.http.post(this.baseUrl,{name:t,path:e})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var we=class n{selectedProjectIdSubject=new se(null);isLoadingSubject=new se(!1);refreshTriggerSubject=new se(void 0);hasInitialized=!1;isLoading$=this.isLoadingSubject.asObservable();projectApi=d(Zo);projectListCall=this.refreshTriggerSubject.pipe(Ri(()=>this.projectApi.listProjects()),Mn({bufferSize:1,refCount:!0}));projectList$=this.projectListCall.pipe(ve(t=>t.projects));forcedProject$=this.projectListCall.pipe(ve(t=>t.forcedProject));selectedProject$=nn([this.selectedProjectIdSubject,this.forcedProject$]).pipe(Ri(([t,e])=>{let i=e??t;return i?this.projectApi.getProject(i):kt(null)}),ct(t=>{t&&t.name!==this.selectedProjectIdSubject.value&&(console.log("[PROJECT-STATE] Backend returned different project name:",t.name),this.selectedProjectIdSubject.next(t.name))}),Mn({bufferSize:1,refCount:!0}));selectProject(t){console.log("[PROJECT-STATE] Explicit project selection:",t),this.forcedProject$.pipe(Mt(1)).subscribe(e=>this.selectedProjectIdSubject.next(e??t))}getSelectedProjectId(){return this.selectedProjectIdSubject.value}getSelectedProjectIdOrThrow(){let t=this.selectedProjectIdSubject.value;if(!t)throw new Error("[PROJECT_STATE] No project selected");return t}clearSelection(){console.log("[PROJECT-STATE] Clearing project selection"),this.selectedProjectIdSubject.next(null)}initializeDefaultProject(){return ie(this,null,function*(){if(this.hasInitialized){console.log("[PROJECT-STATE] Already initialized, skipping");return}this.hasInitialized=!0;let t=yield this.projectApi.listProjects().pipe(Mt(1)).toPromise();if(!t){console.log("[PROJECT-STATE] No response from project API");return}let{defaultProject:e,forcedProject:i}=t;e&&!i?(console.log("[PROJECT-STATE] Initializing with default project:",e),this.selectedProjectIdSubject.next(e)):i?(console.log("[PROJECT-STATE] Initializing with forced project:",i),this.selectedProjectIdSubject.next(i)):console.log("[PROJECT-STATE] No default project, staying on selection page")})}createProject(t,e){return this.isLoadingSubject.next(!0),this.projectApi.createProject(t,e).pipe(ct(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next()}))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function js(n){n||(n=d(Kn));let t=new oi(e=>{if(n.destroyed){e.next();return}return n.onDestroy(e.next.bind(e))});return e=>e.pipe(N(t))}function jt(n,t){let i=!t?.manualCleanup?t?.injector?.get(Kn)??d(Kn):null,o=fb(t?.equal),r;t?.requireSync?r=Te({kind:0},{equal:o}):r=Te({kind:1,value:t?.initialValue},{equal:o});let a,l=n.subscribe({next:p=>r.set({kind:1,value:p}),error:p=>{r.set({kind:2,error:p}),a?.()},complete:()=>{a?.()}});if(t?.requireSync&&r().kind===0)throw new de(601,!1);return a=i?.onDestroy(l.unsubscribe.bind(l)),ft(()=>{let p=r();switch(p.kind){case 1:return p.value;case 2:throw p.error;case 0:throw new de(601,!1)}},{equal:t?.equal})}function fb(n=Object.is){return(t,e)=>t.kind===1&&e.kind===1&&n(t.value,e.value)}function gd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var mo=gd();function ou(n){mo=n}var ra={exec:()=>null};function Se(n,t=""){let e=typeof n=="string"?n:n.source,i={replace:(o,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(zt.caret,"$1"),e=e.replace(o,a),i},getRegex:()=>new RegExp(e,t)};return i}var zt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},_b=/^(?:[ \t]*(?:\n|$))+/,bb=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,vb=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,aa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,yb=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fd=/(?:[*+-]|\d{1,9}[.)])/,ru=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,au=Se(ru).replace(/bull/g,fd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Cb=Se(ru).replace(/bull/g,fd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_d=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,xb=/^[^\n]+/,bd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,wb=Se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",bd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Sb=Se(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fd).getRegex(),Ws="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",vd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,kb=Se("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",vd).replace("tag",Ws).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),su=Se(_d).replace("hr",aa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ws).getRegex(),Mb=Se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",su).getRegex(),yd={blockquote:Mb,code:bb,def:wb,fences:vb,heading:yb,hr:aa,html:kb,lheading:au,list:Sb,newline:_b,paragraph:su,table:ra,text:xb},Zp=Se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",aa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ws).getRegex(),Eb=Ie(q({},yd),{lheading:Cb,table:Zp,paragraph:Se(_d).replace("hr",aa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Zp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ws).getRegex()}),Tb=Ie(q({},yd),{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ra,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Se(_d).replace("hr",aa).replace("heading",` *#{1,6} *[^
|
|
8
|
-
]`).replace("lheading",au).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Pb=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ob=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lu=/^( {2,}|\\)\n(?!\s*$)/,Ab=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))
|
|
4
|
+
`],encapsulation:2,changeDetection:0})}return n})(),ad="_mat-snack-bar-enter",sd="_mat-snack-bar-exit",ob=(()=>{class n extends Vn{_ngZone=d(me);_elementRef=d(K);_changeDetectorRef=d(Re);_platform=d(rt);_animationsDisabled=We();snackBarConfig=d(Xo);_document=d(it);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=d(fe);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new D;_onExit=new D;_onEnter=new D;_animationState="void";_live;_label;_role;_liveElementId=d(Fe).getId("mat-snack-bar-container-live-");constructor(){super();let e=this.snackBarConfig;e.politeness==="assertive"&&!e.announcementMessage?this._live="assertive":e.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(e){this._assertNotAttached();let i=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),i}attachTemplatePortal(e){this._assertNotAttached();let i=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),i}attachDomPortal=e=>{this._assertNotAttached();let i=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),i};onAnimationEnd(e){e===sd?this._completeExit():e===ad&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?Et(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(ad)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(ad)},200)))}exit(){return this._destroyed?kt(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?Et(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(sd)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(sd),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let e=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(a=>e.classList.add(a)):e.classList.add(i)),this._exposeToModals();let o=this._label.nativeElement,r="mdc-snackbar__label";o.classList.toggle(r,!o.querySelector(`.${r}`))}_exposeToModals(){let e=this._liveElementId,i=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let o=0;o<i.length;o++){let r=i[o],a=r.getAttribute("aria-owns");this._trackedModals.add(r),a?a.indexOf(e)===-1&&r.setAttribute("aria-owns",a+" "+e):r.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let i=e.getAttribute("aria-owns");if(i){let o=i.replace(this._liveElementId,"").trim();o.length>0?e.setAttribute("aria-owns",o):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let e=this._elementRef.nativeElement,i=e.querySelector("[aria-hidden]"),o=e.querySelector("[aria-live]");if(i&&o){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&i.contains(document.activeElement)&&(r=document.activeElement),i.removeAttribute("aria-hidden"),o.appendChild(i),r?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-snack-bar-container"]],viewQuery:function(i,o){if(i&1&&(ne(Ln,7),ne(Z_,7)),i&2){let r;W(r=U())&&(o._portalOutlet=r.first),W(r=U())&&(o._label=r.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(i,o){i&1&&_("animationend",function(a){return o.onAnimationEnd(a.animationName)})("animationcancel",function(a){return o.onAnimationEnd(a.animationName)}),i&2&&A("mat-snack-bar-container-enter",o._animationState==="visible")("mat-snack-bar-container-exit",o._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!o._animationsDisabled)},features:[ye],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(i,o){i&1&&(s(0,"div",1)(1,"div",2,0)(3,"div",3),Ge(4,J_,0,0,"ng-template",4),c(),F(5,"div"),c()()),i&2&&(m(5),Y("aria-live",o._live)("role",o._role)("id",o._liveElementId))},dependencies:[Ln],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mat-snack-bar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-snack-bar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-snack-bar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mat-snack-bar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-snack-bar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mat-snack-bar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mat-snack-bar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-button-text-state-layer-color: currentColor;--mat-button-text-ripple-color: currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
|
|
5
|
+
`],encapsulation:2})}return n})();function rb(){return new Xo}var ab=new ee("mat-snack-bar-default-options",{providedIn:"root",factory:rb}),Jr=(()=>{class n{_live=d(ns);_injector=d(fe);_breakpointObserver=d(vh);_parentSnackBar=d(n,{optional:!0,skipSelf:!0});_defaultConfig=d(ab);_animationsDisabled=We();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=Hp;snackBarContainerComponent=ob;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,i){return this._attach(e,i)}openFromTemplate(e,i){return this._attach(e,i)}open(e,i="",o){let r=q(q({},this._defaultConfig),o);return r.data={message:e,action:i},r.announcementMessage===e&&(r.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,r)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,i){let o=i&&i.viewContainerRef&&i.viewContainerRef.injector,r=fe.create({parent:o||this._injector,providers:[{provide:Xo,useValue:i}]}),a=new Ci(this.snackBarContainerComponent,i.viewContainerRef,r),l=e.attach(a);return l.instance.snackBarConfig=i,l.instance}_attach(e,i){let o=q(q(q({},new Xo),this._defaultConfig),i),r=this._createOverlay(o),a=this._attachSnackBarContainer(r,o),l=new Zr(a,r);if(e instanceof En){let p=new sn(e,null,{$implicit:o.data,snackBarRef:l});l.instance=a.attachTemplatePortal(p)}else{let p=this._createInjector(o,l),u=new Ci(e,void 0,p),b=a.attachComponentPortal(u);l.instance=b.instance}return this._breakpointObserver.observe(wh.HandsetPortrait).pipe(N(r.detachments())).subscribe(p=>{r.overlayElement.classList.toggle(this.handsetCssClass,p.matches)}),o.announcementMessage&&a._onAnnounce.subscribe(()=>{this._live.announce(o.announcementMessage,o.politeness)}),this._animateSnackBar(l,o),this._openedSnackBarRef=l,this._openedSnackBarRef}_animateSnackBar(e,i){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),i.duration&&i.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(i.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let i=new mn;i.direction=e.direction;let o=jn(this._injector),r=e.direction==="rtl",a=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!r||e.horizontalPosition==="end"&&r,l=!a&&e.horizontalPosition!=="center";return a?o.left("0"):l?o.right("0"):o.centerHorizontally(),e.verticalPosition==="top"?o.top("0"):o.bottom("0"),i.positionStrategy=o,i.disableAnimations=this._animationsDisabled,pn(this._injector,i)}_createInjector(e,i){let o=e&&e.viewContainerRef&&e.viewContainerRef.injector;return fe.create({parent:o||this._injector,providers:[{provide:Zr,useValue:i},{provide:Bp,useValue:e.data}]})}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Ko=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[Jr],imports:[xi,ln,xt,le,Hp,le]})}return n})();function sb(n,t){}var zn=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var cd=(()=>{class n extends Vn{_elementRef=d(K);_focusTrapFactory=d(is);_config;_interactivityChecker=d(Lo);_ngZone=d(me);_focusMonitor=d(Vi);_renderer=d(ot);_changeDetectorRef=d(Re);_injector=d(fe);_platform=d(rt);_document=d(it);_portalOutlet;_focusTrapped=new D;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=d(zn,{optional:!0})||new zn,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let i=this._ariaLabelledByQueue.indexOf(e);i>-1&&(this._ariaLabelledByQueue.splice(i,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let i=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),i}attachTemplatePortal(e){this._portalOutlet.hasAttached();let i=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),i}attachDomPortal=e=>{this._portalOutlet.hasAttached();let i=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),i};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,i){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let o=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",o),a=this._renderer.listen(e,"mousedown",o)})),e.focus(i)}_focusByCssSelector(e,i){let o=this._elementRef.nativeElement.querySelector(e);o&&this._forceFocus(o,i)}_trapFocus(e){this._isDestroyed||Et(()=>{let i=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||i.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,i=null;if(typeof e=="string"?i=this._document.querySelector(e):typeof e=="boolean"?i=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(i=e),this._config.restoreFocus&&i&&typeof i.focus=="function"){let o=Ja(),r=this._elementRef.nativeElement;(!o||o===this._document.body||o===r||r.contains(o))&&(this._focusMonitor?(this._focusMonitor.focusVia(i,this._closeInteractionType),this._closeInteractionType=null):i.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,i=Ja();return e===i||e.contains(i)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Ja()))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["cdk-dialog-container"]],viewQuery:function(i,o){if(i&1&&ne(Ln,7),i&2){let r;W(r=U())&&(o._portalOutlet=r.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(i,o){i&2&&Y("id",o._config.id||null)("role",o._config.role)("aria-modal",o._config.ariaModal)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null)},features:[ye],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(i,o){i&1&&Ge(0,sb,0,0,"ng-template",0)},dependencies:[Ln],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
|
|
6
|
+
`],encapsulation:2})}return n})(),ea=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new D;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(t,e){this.overlayRef=t,this.config=e,this.disableClose=e.disableClose,this.backdropClick=t.backdropClick(),this.keydownEvents=t.keydownEvents(),this.outsidePointerEvents=t.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(i=>{i.keyCode===27&&!this.disableClose&&!vt(i)&&(i.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=t.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(t,e){if(this._canClose(t)){let i=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),i.next(t),i.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(t="",e=""){return this.overlayRef.updateSize({width:t,height:e}),this}addPanelClass(t){return this.overlayRef.addPanelClass(t),this}removePanelClass(t){return this.overlayRef.removePanelClass(t),this}_canClose(t){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(t,e,this.componentInstance))}},lb=new ee("DialogScrollStrategy",{providedIn:"root",factory:()=>{let n=d(fe);return()=>Qo(n)}}),cb=new ee("DialogData"),db=new ee("DefaultDialogConfig");function mb(n){let t=Te(n),e=new H;return{valueSignal:t,get value(){return t()},change:e,ngOnDestroy(){e.complete()}}}var dd=(()=>{class n{_injector=d(fe);_defaultOptions=d(db,{optional:!0});_parentDialog=d(n,{optional:!0,skipSelf:!0});_overlayContainer=d(Vs);_idGenerator=d(Fe);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new D;_afterOpenedAtThisLevel=new D;_ariaHiddenElements=new Map;_scrollStrategy=d(lb);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=Ro(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Vt(void 0)));constructor(){}open(e,i){let o=this._defaultOptions||new zn;i=q(q({},o),i),i.id=i.id||this._idGenerator.getId("cdk-dialog-"),i.id&&this.getDialogById(i.id);let r=this._getOverlayConfig(i),a=pn(this._injector,r),l=new ea(a,i),p=this._attachContainer(a,l,i);if(l.containerInstance=p,!this.openDialogs.length){let u=this._overlayContainer.getContainerElement();p._focusTrapped?p._focusTrapped.pipe(Mt(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(u)}):this._hideNonDialogContentFromAssistiveTechnology(u)}return this._attachDialogContent(e,l,p,i),this.openDialogs.push(l),l.closed.subscribe(()=>this._removeOpenDialog(l,!0)),this.afterOpened.next(l),l}closeAll(){ld(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){ld(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),ld(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let i=new mn({positionStrategy:e.positionStrategy||jn().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(i.backdropClass=e.backdropClass),i}_attachContainer(e,i,o){let r=o.injector||o.viewContainerRef?.injector,a=[{provide:zn,useValue:o},{provide:ea,useValue:i},{provide:Go,useValue:e}],l;o.container?typeof o.container=="function"?l=o.container:(l=o.container.type,a.push(...o.container.providers(o))):l=cd;let p=new Ci(l,o.viewContainerRef,fe.create({parent:r||this._injector,providers:a}));return e.attach(p).instance}_attachDialogContent(e,i,o,r){if(e instanceof En){let a=this._createInjector(r,i,o,void 0),l={$implicit:r.data,dialogRef:i};r.templateContext&&(l=q(q({},l),typeof r.templateContext=="function"?r.templateContext():r.templateContext)),o.attachTemplatePortal(new sn(e,null,l,a))}else{let a=this._createInjector(r,i,o,this._injector),l=o.attachComponentPortal(new Ci(e,r.viewContainerRef,a));i.componentRef=l,i.componentInstance=l.instance}}_createInjector(e,i,o,r){let a=e.injector||e.viewContainerRef?.injector,l=[{provide:cb,useValue:e.data},{provide:ea,useValue:i}];return e.providers&&(typeof e.providers=="function"?l.push(...e.providers(i,e,o)):l.push(...e.providers)),e.direction&&(!a||!a.get(Ct,null,{optional:!0}))&&l.push({provide:Ct,useValue:mb(e.direction)}),fe.create({parent:a||r,providers:l})}_removeOpenDialog(e,i){let o=this.openDialogs.indexOf(e);o>-1&&(this.openDialogs.splice(o,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,a)=>{r?a.setAttribute("aria-hidden",r):a.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),i&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let i=e.parentElement.children;for(let o=i.length-1;o>-1;o--){let r=i[o];r!==e&&r.nodeName!=="SCRIPT"&&r.nodeName!=="STYLE"&&!r.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function ld(n,t){let e=n.length;for(;e--;)t(n[e])}var Wp=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[dd],imports:[xi,ln,jo,ln]})}return n})();function hb(n,t){}var ia=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},md="mdc-dialog--open",Up="mdc-dialog--opening",$p="mdc-dialog--closing",pb=150,ub=75,Yp=(()=>{class n extends cd{_animationStateChanged=new H;_animationsEnabled=!We();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?Gp(this._config.enterAnimationDuration)??pb:0;_exitAnimationDuration=this._animationsEnabled?Gp(this._config.exitAnimationDuration)??ub:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(qp,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Up,md)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(md),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(md),this._animationsEnabled?(this._hostElement.style.setProperty(qp,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add($p)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(Up,$p)}_waitForAnimationToComplete(e,i){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(i,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let i=super.attachComponentPortal(e);return i.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),i}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275cmp=M({type:n,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(i,o){i&2&&(ei("id",o._config.id),Y("aria-modal",o._config.ariaModal)("role",o._config.role)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null),A("_mat-animation-noopable",!o._animationsEnabled)("mat-mdc-dialog-container-with-actions",o._actionSectionCount>0))},features:[ye],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(i,o){i&1&&(s(0,"div",0)(1,"div",1),Ge(2,hb,0,0,"ng-template",2),c()())},dependencies:[Ln],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
|
|
7
|
+
`],encapsulation:2})}return n})(),qp="--mat-dialog-transition-duration";function Gp(n){return n==null?null:typeof n=="number"?n:n.endsWith("ms")?bi(n.substring(0,n.length-2)):n.endsWith("s")?bi(n.substring(0,n.length-1))*1e3:n==="0"?0:null}var ta=(function(n){return n[n.OPEN=0]="OPEN",n[n.CLOSING=1]="CLOSING",n[n.CLOSED=2]="CLOSED",n})(ta||{}),ii=class{_ref;_config;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new D;_beforeClosed=new D;_result;_closeFallbackTimeout;_state=ta.OPEN;_closeInteractionType;constructor(t,e,i){this._ref=t,this._config=e,this._containerInstance=i,this.disableClose=e.disableClose,this.id=t.id,t.addPanelClass("mat-mdc-dialog-panel"),i._animationStateChanged.pipe(ue(o=>o.state==="opened"),Mt(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),i._animationStateChanged.pipe(ue(o=>o.state==="closed"),Mt(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),t.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),Ii(this.backdropClick(),this.keydownEvents().pipe(ue(o=>o.keyCode===27&&!this.disableClose&&!vt(o)))).subscribe(o=>{this.disableClose||(o.preventDefault(),Qp(this,o.type==="keydown"?"keyboard":"mouse"))})}close(t){let e=this._config.closePredicate;e&&!e(t,this._config,this.componentInstance)||(this._result=t,this._containerInstance._animationStateChanged.pipe(ue(i=>i.state==="closing"),Mt(1)).subscribe(i=>{this._beforeClosed.next(t),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),i.totalTime+100)}),this._state=ta.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(t){let e=this._ref.config.positionStrategy;return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(t="",e=""){return this._ref.updateSize(t,e),this}addPanelClass(t){return this._ref.addPanelClass(t),this}removePanelClass(t){return this._ref.removePanelClass(t),this}getState(){return this._state}_finishDialogClose(){this._state=ta.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function Qp(n,t,e){return n._closeInteractionType=t,n.close(e)}var Wi=new ee("MatMdcDialogData"),js=new ee("mat-mdc-dialog-default-options"),Xp=new ee("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let n=d(fe);return()=>Qo(n)}}),wi=(()=>{class n{_defaultOptions=d(js,{optional:!0});_scrollStrategy=d(Xp);_parentDialog=d(n,{optional:!0,skipSelf:!0});_idGenerator=d(Fe);_injector=d(fe);_dialog=d(dd);_animationsDisabled=We();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new D;_afterOpenedAtThisLevel=new D;dialogConfigClass=ia;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=Ro(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Vt(void 0)));constructor(){this._dialogRefConstructor=ii,this._dialogContainerType=Yp,this._dialogDataToken=Wi}open(e,i){let o;i=q(q({},this._defaultOptions||new ia),i),i.id=i.id||this._idGenerator.getId("mat-mdc-dialog-"),i.scrollStrategy=i.scrollStrategy||this._scrollStrategy();let r=this._dialog.open(e,Ie(q({},i),{positionStrategy:jn(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||i.enterAnimationDuration?.toLocaleString()==="0"||i.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:i},{provide:zn,useValue:i}]},templateContext:()=>({dialogRef:o}),providers:(a,l,p)=>(o=new this._dialogRefConstructor(a,i,p),o.updatePosition(i?.position),[{provide:this._dialogContainerType,useValue:p},{provide:this._dialogDataToken,useValue:l.data},{provide:this._dialogRefConstructor,useValue:o}])}));return o.componentRef=r.componentRef,o.componentInstance=r.componentInstance,this.openDialogs.push(o),this.afterOpened.next(o),o.afterClosed().subscribe(()=>{let a=this.openDialogs.indexOf(o);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||this._getAfterAllClosed().next())}),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(i=>i.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let i=e.length;for(;i--;)e[i].close()}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Kp=(()=>{class n{_dialogRef=d(ii,{optional:!0});_elementRef=d(K);_dialog=d(wi);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=gb(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n})}return n})(),un=(()=>{class n extends Kp{id=d(Fe).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(i,o){i&2&&ei("id",o.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[ye]})}return n})(),gn=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[eh([dn])]})}return n})(),fn=(()=>{class n extends Kp{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(i,o){i&2&&A("mat-mdc-dialog-actions-align-start",o.align==="start")("mat-mdc-dialog-actions-align-center",o.align==="center")("mat-mdc-dialog-actions-align-end",o.align==="end")},inputs:{align:"align"},features:[ye]})}return n})();function gb(n,t){let e=n.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?t.find(i=>i.id===e.id):null}var lo=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[wi],imports:[Wp,xi,ln,le,le]})}return n})();var Zo=class n{baseUrl="/api/projects";http=d(Ye);listProjects(){return this.http.get(this.baseUrl)}getProject(t){return this.http.get(`${this.baseUrl}/${t}`)}getProjectConfig(t){return this.http.get(`${this.baseUrl}/${t}/config`)}updateProjectConfig(t,e){return this.http.put(`${this.baseUrl}/${t}/config`,e)}createProject(t,e){return this.http.post(this.baseUrl,{name:t,path:e})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var we=class n{selectedProjectIdSubject=new se(null);isLoadingSubject=new se(!1);refreshTriggerSubject=new se(void 0);hasInitialized=!1;isLoading$=this.isLoadingSubject.asObservable();projectApi=d(Zo);projectListCall=this.refreshTriggerSubject.pipe(Ri(()=>this.projectApi.listProjects()),Mn({bufferSize:1,refCount:!0}));projectList$=this.projectListCall.pipe(ve(t=>t.projects));forcedProject$=this.projectListCall.pipe(ve(t=>t.forcedProject));selectedProject$=nn([this.selectedProjectIdSubject,this.forcedProject$]).pipe(Ri(([t,e])=>{let i=e??t;return i?this.projectApi.getProject(i):kt(null)}),ct(t=>{t&&t.name!==this.selectedProjectIdSubject.value&&(console.log("[PROJECT-STATE] Backend returned different project name:",t.name),this.selectedProjectIdSubject.next(t.name))}),Mn({bufferSize:1,refCount:!0}));selectProject(t){console.log("[PROJECT-STATE] Explicit project selection:",t),this.forcedProject$.pipe(Mt(1)).subscribe(e=>this.selectedProjectIdSubject.next(e??t))}getSelectedProjectId(){return this.selectedProjectIdSubject.value}getSelectedProjectIdOrThrow(){let t=this.selectedProjectIdSubject.value;if(!t)throw new Error("[PROJECT_STATE] No project selected");return t}clearSelection(){console.log("[PROJECT-STATE] Clearing project selection"),this.selectedProjectIdSubject.next(null)}initializeDefaultProject(){return ie(this,null,function*(){if(this.hasInitialized){console.log("[PROJECT-STATE] Already initialized, skipping");return}this.hasInitialized=!0;let t=yield this.projectApi.listProjects().pipe(Mt(1)).toPromise();if(!t){console.log("[PROJECT-STATE] No response from project API");return}let{defaultProject:e,forcedProject:i}=t;e&&!i?(console.log("[PROJECT-STATE] Initializing with default project:",e),this.selectedProjectIdSubject.next(e)):i?(console.log("[PROJECT-STATE] Initializing with forced project:",i),this.selectedProjectIdSubject.next(i)):console.log("[PROJECT-STATE] No default project, staying on selection page")})}createProject(t,e){return this.isLoadingSubject.next(!0),this.projectApi.createProject(t,e).pipe(ct(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next()}))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function zs(n){n||(n=d(Kn));let t=new oi(e=>{if(n.destroyed){e.next();return}return n.onDestroy(e.next.bind(e))});return e=>e.pipe(N(t))}function jt(n,t){let i=!t?.manualCleanup?t?.injector?.get(Kn)??d(Kn):null,o=fb(t?.equal),r;t?.requireSync?r=Te({kind:0},{equal:o}):r=Te({kind:1,value:t?.initialValue},{equal:o});let a,l=n.subscribe({next:p=>r.set({kind:1,value:p}),error:p=>{r.set({kind:2,error:p}),a?.()},complete:()=>{a?.()}});if(t?.requireSync&&r().kind===0)throw new de(601,!1);return a=i?.onDestroy(l.unsubscribe.bind(l)),ft(()=>{let p=r();switch(p.kind){case 1:return p.value;case 2:throw p.error;case 0:throw new de(601,!1)}},{equal:t?.equal})}function fb(n=Object.is){return(t,e)=>t.kind===1&&e.kind===1&&n(t.value,e.value)}function fd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var mo=fd();function ou(n){mo=n}var aa={exec:()=>null};function Se(n,t=""){let e=typeof n=="string"?n:n.source,i={replace:(o,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(zt.caret,"$1"),e=e.replace(o,a),i},getRegex:()=>new RegExp(e,t)};return i}var zt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},_b=/^(?:[ \t]*(?:\n|$))+/,bb=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,vb=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,sa=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,yb=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_d=/(?:[*+-]|\d{1,9}[.)])/,ru=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,au=Se(ru).replace(/bull/g,_d).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Cb=Se(ru).replace(/bull/g,_d).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),bd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,xb=/^[^\n]+/,vd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,wb=Se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Sb=Se(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_d).getRegex(),Us="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",yd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,kb=Se("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",yd).replace("tag",Us).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),su=Se(bd).replace("hr",sa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Us).getRegex(),Mb=Se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",su).getRegex(),Cd={blockquote:Mb,code:bb,def:wb,fences:vb,heading:yb,hr:sa,html:kb,lheading:au,list:Sb,newline:_b,paragraph:su,table:aa,text:xb},Zp=Se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",sa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Us).getRegex(),Eb=Ie(q({},Cd),{lheading:Cb,table:Zp,paragraph:Se(bd).replace("hr",sa).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Zp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Us).getRegex()}),Tb=Ie(q({},Cd),{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",yd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:aa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Se(bd).replace("hr",sa).replace("heading",` *#{1,6} *[^
|
|
8
|
+
]`).replace("lheading",au).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Pb=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ob=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lu=/^( {2,}|\\)\n(?!\s*$)/,Ab=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$s=/[\p{P}\p{S}]/u,xd=/[\s\p{P}\p{S}]/u,cu=/[^\s\p{P}\p{S}]/u,Db=Se(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xd).getRegex(),du=/(?!~)[\p{P}\p{S}]/u,Ib=/(?!~)[\s\p{P}\p{S}]/u,Rb=/(?:[^\s\p{P}\p{S}]|~)/u,Fb=/\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,mu=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Nb=Se(mu,"u").replace(/punct/g,$s).getRegex(),Vb=Se(mu,"u").replace(/punct/g,du).getRegex(),hu="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Lb=Se(hu,"gu").replace(/notPunctSpace/g,cu).replace(/punctSpace/g,xd).replace(/punct/g,$s).getRegex(),jb=Se(hu,"gu").replace(/notPunctSpace/g,Rb).replace(/punctSpace/g,Ib).replace(/punct/g,du).getRegex(),zb=Se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cu).replace(/punctSpace/g,xd).replace(/punct/g,$s).getRegex(),Bb=Se(/\\(punct)/,"gu").replace(/punct/g,$s).getRegex(),Hb=Se(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Wb=Se(yd).replace("(?:-->|$)","-->").getRegex(),Ub=Se("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Wb).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Hs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,$b=Se(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Hs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pu=Se(/^!?\[(label)\]\[(ref)\]/).replace("label",Hs).replace("ref",vd).getRegex(),uu=Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",vd).getRegex(),qb=Se("reflink|nolink(?!\\()","g").replace("reflink",pu).replace("nolink",uu).getRegex(),Jp=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,wd={_backpedal:aa,anyPunctuation:Bb,autolink:Hb,blockSkip:Fb,br:lu,code:Ob,del:aa,emStrongLDelim:Nb,emStrongRDelimAst:Lb,emStrongRDelimUnd:zb,escape:Pb,link:$b,nolink:uu,punctuation:Db,reflink:pu,reflinkSearch:qb,tag:Ub,text:Ab,url:aa},Gb=Ie(q({},wd),{link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",Hs).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Hs).getRegex()}),pd=Ie(q({},wd),{emStrongRDelimAst:jb,emStrongLDelim:Vb,url:Se(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Jp).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Se(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Jp).getRegex()}),Yb=Ie(q({},pd),{br:Se(lu).replace("{2,}","*").getRegex(),text:Se(pd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Bs={normal:Cd,gfm:Eb,pedantic:Tb},na={normal:wd,gfm:pd,breaks:Yb,pedantic:Gb},Qb={"&":"&","<":"<",">":">",'"':""","'":"'"},eu=n=>Qb[n];function Ui(n,t){if(t){if(zt.escapeTest.test(n))return n.replace(zt.escapeReplace,eu)}else if(zt.escapeTestNoEncode.test(n))return n.replace(zt.escapeReplaceNoEncode,eu);return n}function tu(n){try{n=encodeURI(n).replace(zt.percentDecode,"%")}catch{return null}return n}function iu(n,t){let e=n.replace(zt.findPipe,(r,a,l)=>{let p=!1,u=a;for(;--u>=0&&l[u]==="\\";)p=!p;return p?"|":" |"}),i=e.split(zt.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(zt.slashPipe,"|");return i}function oa(n,t,e){let i=n.length;if(i===0)return"";let o=0;for(;o<i;){let r=n.charAt(i-o-1);if(r===t&&!e)o++;else if(r!==t&&e)o++;else break}return n.slice(0,i-o)}function Xb(n,t){if(n.indexOf(t[1])===-1)return-1;let e=0;for(let i=0;i<n.length;i++)if(n[i]==="\\")i++;else if(n[i]===t[0])e++;else if(n[i]===t[1]&&(e--,e<0))return i;return e>0?-2:-1}function nu(n,t,e,i,o){let r=t.href,a=t.title||null,l=n[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let p={type:n[0].charAt(0)==="!"?"image":"link",raw:e,href:r,title:a,text:l,tokens:i.inlineTokens(l)};return i.state.inLink=!1,p}function Kb(n,t,e){let i=n.match(e.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
|
|
9
9
|
`).map(r=>{let a=r.match(e.other.beginningSpace);if(a===null)return r;let[l]=a;return l.length>=o.length?r.slice(o.length):r}).join(`
|
|
10
|
-
`)}var
|
|
11
|
-
`)}}}fences(n){let t=this.rules.block.fences.exec(n);if(t){let e=t[0],i=Kb(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(n){let t=this.rules.block.heading.exec(n);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let i=
|
|
12
|
-
`)}}blockquote(n){let t=this.rules.block.blockquote.exec(n);if(t){let e=
|
|
10
|
+
`)}var Ws=class{options;rules;lexer;constructor(n){this.options=n||mo}space(n){let t=this.rules.block.newline.exec(n);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(n){let t=this.rules.block.code.exec(n);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:oa(e,`
|
|
11
|
+
`)}}}fences(n){let t=this.rules.block.fences.exec(n);if(t){let e=t[0],i=Kb(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(n){let t=this.rules.block.heading.exec(n);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let i=oa(e,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(e=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(n){let t=this.rules.block.hr.exec(n);if(t)return{type:"hr",raw:oa(t[0],`
|
|
12
|
+
`)}}blockquote(n){let t=this.rules.block.blockquote.exec(n);if(t){let e=oa(t[0],`
|
|
13
13
|
`).split(`
|
|
14
14
|
`),i="",o="",r=[];for(;e.length>0;){let a=!1,l=[],p;for(p=0;p<e.length;p++)if(this.rules.other.blockquoteStart.test(e[p]))l.push(e[p]),a=!0;else if(!a)l.push(e[p]);else break;e=e.slice(p);let u=l.join(`
|
|
15
15
|
`),b=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -29,7 +29,7 @@ ${b}`:b;let C=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
29
29
|
`+T}!P&&!T.trim()&&(P=!0),u+=_t+`
|
|
30
30
|
`,n=n.substring(_t.length+1),C=tt.slice(k)}}o.loose||(a?o.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let z=null,Ce;this.options.gfm&&(z=this.rules.other.listIsTask.exec(b),z&&(Ce=z[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:u,task:!!z,checked:Ce,loose:!1,text:b,tokens:[]}),o.raw+=u}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let p=0;p<o.items.length;p++)if(this.lexer.state.top=!1,o.items[p].tokens=this.lexer.blockTokens(o.items[p].text,[]),!o.loose){let u=o.items[p].tokens.filter(C=>C.type==="space"),b=u.length>0&&u.some(C=>this.rules.other.anyLine.test(C.raw));o.loose=b}if(o.loose)for(let p=0;p<o.items.length;p++)o.items[p].loose=!0;return o}}html(n){let t=this.rules.block.html.exec(n);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(n){let t=this.rules.block.def.exec(n);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:o}}}table(n){let t=this.rules.block.table.exec(n);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=iu(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
31
31
|
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<e.length;a++)r.header.push({text:e[a],tokens:this.lexer.inline(e[a]),header:!0,align:r.align[a]});for(let a of o)r.rows.push(iu(a,r.header.length).map((l,p)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[p]})));return r}}lheading(n){let t=this.rules.block.lheading.exec(n);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(n){let t=this.rules.block.paragraph.exec(n);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
32
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(n){let t=this.rules.block.text.exec(n);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(n){let t=this.rules.inline.escape.exec(n);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(n){let t=this.rules.inline.tag.exec(n);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(n){let t=this.rules.inline.link.exec(n);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=
|
|
32
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(n){let t=this.rules.block.text.exec(n);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(n){let t=this.rules.inline.escape.exec(n);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(n){let t=this.rules.inline.tag.exec(n);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(n){let t=this.rules.inline.link.exec(n);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=oa(e.slice(0,-1),"\\");if((e.length-r.length)%2===0)return}else{let r=Xb(t[2],"()");if(r===-2)return;if(r>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let i=t[2],o="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i=i.slice(1):i=i.slice(1,-1)),nu(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(n,t){let e;if((e=this.rules.inline.reflink.exec(n))||(e=this.rules.inline.nolink.exec(n))){let i=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[i.toLowerCase()];if(!o){let r=e[0].charAt(0);return{type:"text",raw:r,text:r}}return nu(e,o,e[0],this.lexer,this.rules)}}emStrong(n,t,e=""){let i=this.rules.inline.emStrongLDelim.exec(n);if(!(!i||i[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!e||this.rules.inline.punctuation.exec(e))){let o=[...i[0]].length-1,r,a,l=o,p=0,u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*n.length+o);(i=u.exec(t))!=null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(a=[...r].length,i[3]||i[4]){l+=a;continue}else if((i[5]||i[6])&&o%3&&!((o+a)%3)){p+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+p);let b=[...i[0]][0].length,C=n.slice(0,o+i.index+b+a);if(Math.min(o,a)%2){let P=C.slice(1,-1);return{type:"em",raw:C,text:P,tokens:this.lexer.inlineTokens(P)}}let T=C.slice(2,-2);return{type:"strong",raw:C,text:T,tokens:this.lexer.inlineTokens(T)}}}}codespan(n){let t=this.rules.inline.code.exec(n);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(e),o=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&o&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(n){let t=this.rules.inline.br.exec(n);if(t)return{type:"br",raw:t[0]}}del(n){let t=this.rules.inline.del.exec(n);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(n){let t=this.rules.inline.autolink.exec(n);if(t){let e,i;return t[2]==="@"?(e=t[1],i="mailto:"+e):(e=t[1],i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(n){let t;if(t=this.rules.inline.url.exec(n)){let e,i;if(t[2]==="@")e=t[0],i="mailto:"+e;else{let o;do o=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(o!==t[0]);e=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(n){let t=this.rules.inline.text.exec(n);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Si=class ud{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||mo,this.options.tokenizer=this.options.tokenizer||new Ws,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:zt,block:Bs.normal,inline:na.normal};this.options.pedantic?(e.block=Bs.pedantic,e.inline=na.pedantic):this.options.gfm&&(e.block=Bs.gfm,this.options.breaks?e.inline=na.breaks:e.inline=na.gfm),this.tokenizer.rules=e}static get rules(){return{block:Bs,inline:na}}static lex(t,e){return new ud(e).lex(t)}static lexInline(t,e){return new ud(e).inlineTokens(t)}lex(t){t=t.replace(zt.carriageReturn,`
|
|
33
33
|
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let i=this.inlineQueue[e];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],i=!1){for(this.options.pedantic&&(t=t.replace(zt.tabCharGlobal," ").replace(zt.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},t,e))?(t=t.substring(o.raw.length),e.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=e.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
|
|
34
34
|
`:e.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
35
35
|
`)?"":`
|
|
@@ -61,11 +61,11 @@ ${this.parser.parse(n)}</blockquote>
|
|
|
61
61
|
`}tablerow({text:n}){return`<tr>
|
|
62
62
|
${n}</tr>
|
|
63
63
|
`}tablecell(n){let t=this.parser.parseInline(n.tokens),e=n.header?"th":"td";return(n.align?`<${e} align="${n.align}">`:`<${e}>`)+t+`</${e}>
|
|
64
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${Ui(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:t,tokens:e}){let i=this.parser.parseInline(e),o=tu(n);if(o===null)return i;n=o;let r='<a href="'+n+'"';return t&&(r+=' title="'+Ui(t)+'"'),r+=">"+i+"</a>",r}image({href:n,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let o=tu(n);if(o===null)return Ui(e);n=o;let r=`<img src="${n}" alt="${e}"`;return t&&(r+=` title="${Ui(t)}"`),r+=">",r}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:Ui(n.text)}},
|
|
65
|
-
`+this.renderer.text(l);e?i+=this.renderer.paragraph({type:"paragraph",raw:p,text:p,tokens:[{type:"text",raw:p,text:p,escaped:!0}]}):i+=p;continue}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(t,e=this.renderer){let i="";for(let o=0;o<t.length;o++){let r=t[o];if(this.options.extensions?.renderers?.[r.type]){let l=this.options.extensions.renderers[r.type].call({parser:this},r);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){i+=l||"";continue}}let a=r;switch(a.type){case"escape":{i+=e.text(a);break}case"html":{i+=e.html(a);break}case"link":{i+=e.link(a);break}case"image":{i+=e.image(a);break}case"strong":{i+=e.strong(a);break}case"em":{i+=e.em(a);break}case"codespan":{i+=e.codespan(a);break}case"br":{i+=e.br(a);break}case"del":{i+=e.del(a);break}case"text":{i+=e.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},
|
|
66
|
-
Please report this to https://github.com/markedjs/marked.`,n){let i="<p>An error occurred:</p><pre>"+Ui(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},co=new Zb;function Me(n,t){return co.parse(n,t)}Me.options=Me.setOptions=function(n){return co.setOptions(n),Me.defaults=co.defaults,ou(Me.defaults),Me};Me.getDefaults=gd;Me.defaults=mo;Me.use=function(...n){return co.use(...n),Me.defaults=co.defaults,ou(Me.defaults),Me};Me.walkTokens=function(n,t){return co.walkTokens(n,t)};Me.parseInline=co.parseInline;Me.Parser=ki;Me.parser=ki.parse;Me.Renderer=Jo;Me.TextRenderer=wd;Me.Lexer=Si;Me.lexer=Si.lex;Me.Tokenizer=Hs;Me.Hooks=oa;Me.parse=Me;var cE=Me.options,dE=Me.setOptions,mE=Me.use,hE=Me.walkTokens,pE=Me.parseInline;var uE=ki.parse,gE=Si.lex;var{entries:wu,setPrototypeOf:gu,isFrozen:Jb,getPrototypeOf:ev,getOwnPropertyDescriptor:tv}=Object,{freeze:Ht,seal:ci,create:Od}=Object,{apply:Ad,construct:Dd}=typeof Reflect<"u"&&Reflect;Ht||(Ht=function(t){return t});ci||(ci=function(t){return t});Ad||(Ad=function(t,e){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];return t.apply(e,o)});Dd||(Dd=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return new t(...i)});var $s=Wt(Array.prototype.forEach),iv=Wt(Array.prototype.lastIndexOf),fu=Wt(Array.prototype.pop),sa=Wt(Array.prototype.push),nv=Wt(Array.prototype.splice),Gs=Wt(String.prototype.toLowerCase),Sd=Wt(String.prototype.toString),kd=Wt(String.prototype.match),la=Wt(String.prototype.replace),ov=Wt(String.prototype.indexOf),rv=Wt(String.prototype.trim),Mi=Wt(Object.prototype.hasOwnProperty),Bt=Wt(RegExp.prototype.test),ca=av(TypeError);function Wt(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Ad(n,t,i)}}function av(n){return function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return Dd(n,e)}}function ue(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Gs;gu&&gu(n,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=e(o);r!==o&&(Jb(t)||(t[i]=r),o=r)}n[o]=!0}return n}function sv(n){for(let t=0;t<n.length;t++)Mi(n,t)||(n[t]=null);return n}function $i(n){let t=Od(null);for(let[e,i]of wu(n))Mi(n,e)&&(Array.isArray(i)?t[e]=sv(i):i&&typeof i=="object"&&i.constructor===Object?t[e]=$i(i):t[e]=i);return t}function da(n,t){for(;n!==null;){let i=tv(n,t);if(i){if(i.get)return Wt(i.get);if(typeof i.value=="function")return Wt(i.value)}n=ev(n)}function e(){return null}return e}var _u=Ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Md=Ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ed=Ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),lv=Ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Td=Ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),cv=Ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bu=Ht(["#text"]),vu=Ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Pd=Ht(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yu=Ht(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),qs=Ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),dv=ci(/\{\{[\w\W]*|[\w\W]*\}\}/gm),mv=ci(/<%[\w\W]*|[\w\W]*%>/gm),hv=ci(/\$\{[\w\W]*/gm),pv=ci(/^data-[\-\w.\u00B7-\uFFFF]+$/),uv=ci(/^aria-[\-\w]+$/),Su=ci(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gv=ci(/^(?:\w+script|data):/i),fv=ci(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ku=ci(/^html$/i),_v=ci(/^[a-z][.\w]*(-[.\w]+)+$/i),Cu=Object.freeze({__proto__:null,ARIA_ATTR:uv,ATTR_WHITESPACE:fv,CUSTOM_ELEMENT:_v,DATA_ATTR:pv,DOCTYPE_NAME:ku,ERB_EXPR:mv,IS_ALLOWED_URI:Su,IS_SCRIPT_OR_DATA:gv,MUSTACHE_EXPR:dv,TMPLIT_EXPR:hv}),ma={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bv=function(){return typeof window>"u"?null:window},vv=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(i=e.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},xu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Mu(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bv(),t=X=>Mu(X);if(t.version="3.3.1",t.removed=[],!n||!n.document||n.document.nodeType!==ma.document||!n.Element)return t.isSupported=!1,t;let{document:e}=n,i=e,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:l,Element:p,NodeFilter:u,NamedNodeMap:b=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:C,DOMParser:T,trustedTypes:P}=n,k=p.prototype,z=da(k,"cloneNode"),Ce=da(k,"remove"),Be=da(k,"nextSibling"),Je=da(k,"childNodes"),et=da(k,"parentNode");if(typeof a=="function"){let X=e.createElement("template");X.content&&X.content.ownerDocument&&(e=X.content.ownerDocument)}let _e,qt="",{implementation:_t,createNodeIterator:tt,createDocumentFragment:Pt,getElementsByTagName:Zi}=e,{importNode:Sn}=i,bt=xu();t.isSupported=typeof wu=="function"&&typeof et=="function"&&_t&&_t.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ui,ERB_EXPR:qn,TMPLIT_EXPR:Mo,DATA_ATTR:Ia,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:Q,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:be}=Cu,{IS_ALLOWED_URI:lt}=Cu,Ee=null,Ot=ue({},[..._u,...Md,...Ed,...Td,...bu]),Ne=null,Ve=ue({},[...vu,...Pd,...yu,...qs]),$e=Object.seal(Od(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Gn=null,mt=null,Gt=Object.seal(Od(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Nt=!0,kn=!0,Eo=!1,vm=!0,To=!1,Ra=!0,Yn=!1,rc=!1,ac=!1,Po=!1,Fa=!1,Na=!1,ym=!0,Cm=!1,Rf="user-content-",sc=!0,Ar=!1,Oo={},Oi=null,lc=ue({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),xm=null,wm=ue({},["audio","video","img","source","image","track"]),cc=null,Sm=ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Va="http://www.w3.org/1998/Math/MathML",La="http://www.w3.org/2000/svg",Ji="http://www.w3.org/1999/xhtml",Ao=Ji,dc=!1,mc=null,Ff=ue({},[Va,La,Ji],Sd),ja=ue({},["mi","mo","mn","ms","mtext"]),za=ue({},["annotation-xml"]),Nf=ue({},["title","style","font","a","script"]),Dr=null,Vf=["application/xhtml+xml","text/html"],Lf="text/html",gt=null,Do=null,jf=e.createElement("form"),km=function(f){return f instanceof RegExp||f instanceof Function},hc=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Do&&Do===f)){if((!f||typeof f!="object")&&(f={}),f=$i(f),Dr=Vf.indexOf(f.PARSER_MEDIA_TYPE)===-1?Lf:f.PARSER_MEDIA_TYPE,gt=Dr==="application/xhtml+xml"?Sd:Gs,Ee=Mi(f,"ALLOWED_TAGS")?ue({},f.ALLOWED_TAGS,gt):Ot,Ne=Mi(f,"ALLOWED_ATTR")?ue({},f.ALLOWED_ATTR,gt):Ve,mc=Mi(f,"ALLOWED_NAMESPACES")?ue({},f.ALLOWED_NAMESPACES,Sd):Ff,cc=Mi(f,"ADD_URI_SAFE_ATTR")?ue($i(Sm),f.ADD_URI_SAFE_ATTR,gt):Sm,xm=Mi(f,"ADD_DATA_URI_TAGS")?ue($i(wm),f.ADD_DATA_URI_TAGS,gt):wm,Oi=Mi(f,"FORBID_CONTENTS")?ue({},f.FORBID_CONTENTS,gt):lc,Gn=Mi(f,"FORBID_TAGS")?ue({},f.FORBID_TAGS,gt):$i({}),mt=Mi(f,"FORBID_ATTR")?ue({},f.FORBID_ATTR,gt):$i({}),Oo=Mi(f,"USE_PROFILES")?f.USE_PROFILES:!1,Nt=f.ALLOW_ARIA_ATTR!==!1,kn=f.ALLOW_DATA_ATTR!==!1,Eo=f.ALLOW_UNKNOWN_PROTOCOLS||!1,vm=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,To=f.SAFE_FOR_TEMPLATES||!1,Ra=f.SAFE_FOR_XML!==!1,Yn=f.WHOLE_DOCUMENT||!1,Po=f.RETURN_DOM||!1,Fa=f.RETURN_DOM_FRAGMENT||!1,Na=f.RETURN_TRUSTED_TYPE||!1,ac=f.FORCE_BODY||!1,ym=f.SANITIZE_DOM!==!1,Cm=f.SANITIZE_NAMED_PROPS||!1,sc=f.KEEP_CONTENT!==!1,Ar=f.IN_PLACE||!1,lt=f.ALLOWED_URI_REGEXP||Su,Ao=f.NAMESPACE||Ji,ja=f.MATHML_TEXT_INTEGRATION_POINTS||ja,za=f.HTML_INTEGRATION_POINTS||za,$e=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&km(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($e.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&km(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($e.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),To&&(kn=!1),Fa&&(Po=!0),Oo&&(Ee=ue({},bu),Ne=[],Oo.html===!0&&(ue(Ee,_u),ue(Ne,vu)),Oo.svg===!0&&(ue(Ee,Md),ue(Ne,Pd),ue(Ne,qs)),Oo.svgFilters===!0&&(ue(Ee,Ed),ue(Ne,Pd),ue(Ne,qs)),Oo.mathMl===!0&&(ue(Ee,Td),ue(Ne,yu),ue(Ne,qs))),f.ADD_TAGS&&(typeof f.ADD_TAGS=="function"?Gt.tagCheck=f.ADD_TAGS:(Ee===Ot&&(Ee=$i(Ee)),ue(Ee,f.ADD_TAGS,gt))),f.ADD_ATTR&&(typeof f.ADD_ATTR=="function"?Gt.attributeCheck=f.ADD_ATTR:(Ne===Ve&&(Ne=$i(Ne)),ue(Ne,f.ADD_ATTR,gt))),f.ADD_URI_SAFE_ATTR&&ue(cc,f.ADD_URI_SAFE_ATTR,gt),f.FORBID_CONTENTS&&(Oi===lc&&(Oi=$i(Oi)),ue(Oi,f.FORBID_CONTENTS,gt)),f.ADD_FORBID_CONTENTS&&(Oi===lc&&(Oi=$i(Oi)),ue(Oi,f.ADD_FORBID_CONTENTS,gt)),sc&&(Ee["#text"]=!0),Yn&&ue(Ee,["html","head","body"]),Ee.table&&(ue(Ee,["tbody"]),delete Gn.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw ca('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ca('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_e=f.TRUSTED_TYPES_POLICY,qt=_e.createHTML("")}else _e===void 0&&(_e=vv(P,o)),_e!==null&&typeof qt=="string"&&(qt=_e.createHTML(""));Ht&&Ht(f),Do=f}},Mm=ue({},[...Md,...Ed,...lv]),Em=ue({},[...Td,...cv]),zf=function(f){let O=et(f);(!O||!O.tagName)&&(O={namespaceURI:Ao,tagName:"template"});let G=Gs(f.tagName),qe=Gs(O.tagName);return mc[f.namespaceURI]?f.namespaceURI===La?O.namespaceURI===Ji?G==="svg":O.namespaceURI===Va?G==="svg"&&(qe==="annotation-xml"||ja[qe]):!!Mm[G]:f.namespaceURI===Va?O.namespaceURI===Ji?G==="math":O.namespaceURI===La?G==="math"&&za[qe]:!!Em[G]:f.namespaceURI===Ji?O.namespaceURI===La&&!za[qe]||O.namespaceURI===Va&&!ja[qe]?!1:!Em[G]&&(Nf[G]||!Mm[G]):!!(Dr==="application/xhtml+xml"&&mc[f.namespaceURI]):!1},Ai=function(f){sa(t.removed,{element:f});try{et(f).removeChild(f)}catch{Ce(f)}},Qn=function(f,O){try{sa(t.removed,{attribute:O.getAttributeNode(f),from:O})}catch{sa(t.removed,{attribute:null,from:O})}if(O.removeAttribute(f),f==="is")if(Po||Fa)try{Ai(O)}catch{}else try{O.setAttribute(f,"")}catch{}},Tm=function(f){let O=null,G=null;if(ac)f="<remove></remove>"+f;else{let ht=kd(f,/^[\r\n\t ]+/);G=ht&&ht[0]}Dr==="application/xhtml+xml"&&Ao===Ji&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");let qe=_e?_e.createHTML(f):f;if(Ao===Ji)try{O=new T().parseFromString(qe,Dr)}catch{}if(!O||!O.documentElement){O=_t.createDocument(Ao,"template",null);try{O.documentElement.innerHTML=dc?qt:qe}catch{}}let At=O.body||O.documentElement;return f&&G&&At.insertBefore(e.createTextNode(G),At.childNodes[0]||null),Ao===Ji?Zi.call(O,Yn?"html":"body")[0]:Yn?O.documentElement:At},Pm=function(f){return tt.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},pc=function(f){return f instanceof C&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof b)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Om=function(f){return typeof l=="function"&&f instanceof l};function en(X,f,O){$s(X,G=>{G.call(t,f,O,Do)})}let Am=function(f){let O=null;if(en(bt.beforeSanitizeElements,f,null),pc(f))return Ai(f),!0;let G=gt(f.nodeName);if(en(bt.uponSanitizeElement,f,{tagName:G,allowedTags:Ee}),Ra&&f.hasChildNodes()&&!Om(f.firstElementChild)&&Bt(/<[/\w!]/g,f.innerHTML)&&Bt(/<[/\w!]/g,f.textContent)||f.nodeType===ma.progressingInstruction||Ra&&f.nodeType===ma.comment&&Bt(/<[/\w]/g,f.data))return Ai(f),!0;if(!(Gt.tagCheck instanceof Function&&Gt.tagCheck(G))&&(!Ee[G]||Gn[G])){if(!Gn[G]&&Im(G)&&($e.tagNameCheck instanceof RegExp&&Bt($e.tagNameCheck,G)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(G)))return!1;if(sc&&!Oi[G]){let qe=et(f)||f.parentNode,At=Je(f)||f.childNodes;if(At&&qe){let ht=At.length;for(let Yt=ht-1;Yt>=0;--Yt){let tn=z(At[Yt],!0);tn.__removalCount=(f.__removalCount||0)+1,qe.insertBefore(tn,Be(f))}}}return Ai(f),!0}return f instanceof p&&!zf(f)||(G==="noscript"||G==="noembed"||G==="noframes")&&Bt(/<\/no(script|embed|frames)/i,f.innerHTML)?(Ai(f),!0):(To&&f.nodeType===ma.text&&(O=f.textContent,$s([ui,qn,Mo],qe=>{O=la(O,qe," ")}),f.textContent!==O&&(sa(t.removed,{element:f.cloneNode()}),f.textContent=O)),en(bt.afterSanitizeElements,f,null),!1)},Dm=function(f,O,G){if(ym&&(O==="id"||O==="name")&&(G in e||G in jf))return!1;if(!(kn&&!mt[O]&&Bt(Ia,O))){if(!(Nt&&Bt($,O))){if(!(Gt.attributeCheck instanceof Function&&Gt.attributeCheck(O,f))){if(!Ne[O]||mt[O]){if(!(Im(f)&&($e.tagNameCheck instanceof RegExp&&Bt($e.tagNameCheck,f)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(f))&&($e.attributeNameCheck instanceof RegExp&&Bt($e.attributeNameCheck,O)||$e.attributeNameCheck instanceof Function&&$e.attributeNameCheck(O,f))||O==="is"&&$e.allowCustomizedBuiltInElements&&($e.tagNameCheck instanceof RegExp&&Bt($e.tagNameCheck,G)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(G))))return!1}else if(!cc[O]){if(!Bt(lt,la(G,te,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&f!=="script"&&ov(G,"data:")===0&&xm[f])){if(!(Eo&&!Bt(Q,la(G,te,"")))){if(G)return!1}}}}}}}return!0},Im=function(f){return f!=="annotation-xml"&&kd(f,be)},Rm=function(f){en(bt.beforeSanitizeAttributes,f,null);let{attributes:O}=f;if(!O||pc(f))return;let G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne,forceKeepAttr:void 0},qe=O.length;for(;qe--;){let At=O[qe],{name:ht,namespaceURI:Yt,value:tn}=At,Io=gt(ht),uc=tn,St=ht==="value"?uc:rv(uc);if(G.attrName=Io,G.attrValue=St,G.keepAttr=!0,G.forceKeepAttr=void 0,en(bt.uponSanitizeAttribute,f,G),St=G.attrValue,Cm&&(Io==="id"||Io==="name")&&(Qn(ht,f),St=Rf+St),Ra&&Bt(/((--!?|])>)|<\/(style|title|textarea)/i,St)){Qn(ht,f);continue}if(Io==="attributename"&&kd(St,"href")){Qn(ht,f);continue}if(G.forceKeepAttr)continue;if(!G.keepAttr){Qn(ht,f);continue}if(!vm&&Bt(/\/>/i,St)){Qn(ht,f);continue}To&&$s([ui,qn,Mo],Nm=>{St=la(St,Nm," ")});let Fm=gt(f.nodeName);if(!Dm(Fm,Io,St)){Qn(ht,f);continue}if(_e&&typeof P=="object"&&typeof P.getAttributeType=="function"&&!Yt)switch(P.getAttributeType(Fm,Io)){case"TrustedHTML":{St=_e.createHTML(St);break}case"TrustedScriptURL":{St=_e.createScriptURL(St);break}}if(St!==uc)try{Yt?f.setAttributeNS(Yt,ht,St):f.setAttribute(ht,St),pc(f)?Ai(f):fu(t.removed)}catch{Qn(ht,f)}}en(bt.afterSanitizeAttributes,f,null)},Bf=function X(f){let O=null,G=Pm(f);for(en(bt.beforeSanitizeShadowDOM,f,null);O=G.nextNode();)en(bt.uponSanitizeShadowNode,O,null),Am(O),Rm(O),O.content instanceof r&&X(O.content);en(bt.afterSanitizeShadowDOM,f,null)};return t.sanitize=function(X){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,G=null,qe=null,At=null;if(dc=!X,dc&&(X="<!-->"),typeof X!="string"&&!Om(X))if(typeof X.toString=="function"){if(X=X.toString(),typeof X!="string")throw ca("dirty is not a string, aborting")}else throw ca("toString is not a function");if(!t.isSupported)return X;if(rc||hc(f),t.removed=[],typeof X=="string"&&(Ar=!1),Ar){if(X.nodeName){let tn=gt(X.nodeName);if(!Ee[tn]||Gn[tn])throw ca("root node is forbidden and cannot be sanitized in-place")}}else if(X instanceof l)O=Tm("<!---->"),G=O.ownerDocument.importNode(X,!0),G.nodeType===ma.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?O=G:O.appendChild(G);else{if(!Po&&!To&&!Yn&&X.indexOf("<")===-1)return _e&&Na?_e.createHTML(X):X;if(O=Tm(X),!O)return Po?null:Na?qt:""}O&&ac&&Ai(O.firstChild);let ht=Pm(Ar?X:O);for(;qe=ht.nextNode();)Am(qe),Rm(qe),qe.content instanceof r&&Bf(qe.content);if(Ar)return X;if(Po){if(Fa)for(At=Pt.call(O.ownerDocument);O.firstChild;)At.appendChild(O.firstChild);else At=O;return(Ne.shadowroot||Ne.shadowrootmode)&&(At=Sn.call(i,At,!0)),At}let Yt=Yn?O.outerHTML:O.innerHTML;return Yn&&Ee["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&Bt(ku,O.ownerDocument.doctype.name)&&(Yt="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
|
|
67
|
-
`+Yt),To&&$s([ui,qn,Mo],tn=>{Yt=la(Yt,tn," ")}),_e&&Na?_e.createHTML(Yt):Yt},t.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hc(X),rc=!0},t.clearConfig=function(){Do=null,rc=!1},t.isValidAttribute=function(X,f,O){Do||hc({});let G=gt(X),qe=gt(f);return Dm(G,qe,O)},t.addHook=function(X,f){typeof f=="function"&&sa(bt[X],f)},t.removeHook=function(X,f){if(f!==void 0){let O=iv(bt[X],f);return O===-1?void 0:nv(bt[X],O,1)[0]}return fu(bt[X])},t.removeHooks=function(X){bt[X]=[]},t.removeAllHooks=function(){bt=xu()},t}var Eu=Mu();var qi=class n{renderer;constructor(){this.renderer=new Jo,this.configureRenderer()}configureRenderer(){let t=this.renderer.link.bind(this.renderer);this.renderer.link=e=>{let i=this.isExternalLink(e.href),o=t(e);if(i){o=o.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ');let r=e.title?`${e.text} - ${e.title} (opens in new tab)`:`${e.text} (opens in new tab)`;o=o.replace("<a ",`<a aria-label="${this.escapeHtml(r)}" `),o=o.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return o}}isExternalLink(t){if(!t||t.startsWith("/")||t.startsWith("#")||t.startsWith("?"))return!1;if(t.startsWith("//"))return!0;try{return new URL(t,window.location.href).hostname!==window.location.hostname}catch{return!1}}escapeHtml(t){let e={"&":"&","<":"<",">":">",'"':""","'":"'"};return t.replace(/[&<>"']/g,i=>e[i]||i)}parse(t){return ie(this,null,function*(){let e=yield Me.parse(t,{renderer:this.renderer,breaks:!0,gfm:!0});return Eu.sanitize(e,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var yv=["buttonContainer"],Cv=(n,t)=>t.value;function xv(n,t){n&1&&(s(0,"mat-icon",8),h(1,"keyboard_return"),c())}function wv(n,t){if(n&1){let e=E();s(0,"button",6),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.onOptionClick(o.value))}),s(1,"span",7),h(2),c(),w(3,xv,2,0,"mat-icon",8),c()}if(n&2){let e=t.$implicit,i=t.$index,o=g(2);A("highlighted",i===o.highlightedIndex),x("disabled",e.disabled)("id","choice-option-"+i),Y("aria-selected",i===o.highlightedIndex),m(2),B(e.label),m(),S(i===o.highlightedIndex?3:-1)}}function Sv(n,t){if(n&1&&(s(0,"div",5)(1,"mat-icon"),h(2,"search"),c(),s(3,"span"),h(4),c()()),n&2){let e=g(2);m(4),B(e.searchText)}}function kv(n,t){if(n&1){let e=E();s(0,"div",1),F(1,"div",2),to(2,"async"),s(3,"div",3,0),_("keydown",function(o){v(e);let r=g();return y(r.onKeyDown(o))}),Oe(5,wv,4,7,"button",4,Cv),c(),w(7,Sv,5,1,"div",5),c()}if(n&2){let e=g();m(),x("innerHTML",oh(2,3,e.renderedLabel$),Jt),m(2),Y("aria-activedescendant","choice-option-"+e.highlightedIndex),m(2),Ae(e.options),m(2),S(e.searchText?7:-1)}}var er=class n{options=[];set labelHtml(t){typeof t=="object"?this.renderedLabelSubject.next(t):this.renderLabelMarkdown(t)}isVisible=!1;choiceSelected=new H;buttonContainer;highlightedIndex=0;searchText="";searchTimeout;destroy$=new D;renderedLabelSubject=new se("");renderedLabel$=this.renderedLabelSubject.asObservable();sanitizer=d(Ni);markdownService=d(qi);ngOnDestroy(){this.renderedLabelSubject.complete(),this.destroy$.next(),this.destroy$.complete(),this.searchTimeout&&clearTimeout(this.searchTimeout)}ngAfterViewInit(){this.isVisible&&this.buttonContainer&&setTimeout(()=>this.focusContainer(),100)}ngOnChanges(t){t.isVisible&&(console.log("[CHOICE-SELECT] isVisible changed:",t.isVisible.previousValue,"->",t.isVisible.currentValue),t.isVisible.currentValue&&!t.isVisible.previousValue&&(console.log("[CHOICE-SELECT] Component becoming visible, setting focus..."),this.highlightedIndex=0,setTimeout(()=>this.focusContainer(),150))),t.options&&!t.options.firstChange&&(this.highlightedIndex=0)}focusContainer(){this.buttonContainer?.nativeElement&&(this.buttonContainer.nativeElement.focus(),console.log("[CHOICE-SELECT] Focus set on button container"))}onKeyDown(t){if(this.options.filter(i=>!i.disabled).length!==0)switch(t.key){case"ArrowDown":t.preventDefault(),this.moveHighlight(1);break;case"ArrowUp":t.preventDefault(),this.moveHighlight(-1);break;case"Enter":case" ":t.preventDefault(),this.selectHighlighted();break;case"Home":t.preventDefault(),this.highlightFirst();break;case"End":t.preventDefault(),this.highlightLast();break;case"Escape":t.preventDefault();break;default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&this.handleTypeAhead(t.key);break}}moveHighlight(t){let e=this.options.map((r,a)=>({opt:r,idx:a})).filter(({opt:r})=>!r.disabled).map(({idx:r})=>r);if(e.length===0)return;let o=e.findIndex(r=>r===this.highlightedIndex)+t;if(o>=0&&o<e.length){let r=e[o];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===1&&o>=e.length){let r=e[0];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===-1&&o<0){let r=e[e.length-1];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}}highlightFirst(){let t=this.options.findIndex(e=>!e.disabled);t>=0&&(this.highlightedIndex=t,this.scrollToHighlighted())}highlightLast(){let t=this.options.map((e,i)=>({opt:e,idx:i})).filter(({opt:e})=>!e.disabled).map(({idx:e})=>e);if(t.length>0){let e=t[t.length-1];e!==void 0&&(this.highlightedIndex=e,this.scrollToHighlighted())}}scrollToHighlighted(){setTimeout(()=>{let t=document.getElementById("choice-option-"+this.highlightedIndex);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})},0)}selectHighlighted(){let t=this.options[this.highlightedIndex];t&&!t.disabled&&this.onOptionClick(t.value)}handleTypeAhead(t){this.searchText+=t.toLowerCase();let e=this.options.findIndex(i=>!i.disabled&&i.label.toLowerCase().startsWith(this.searchText));e>=0&&(this.highlightedIndex=e,this.scrollToHighlighted()),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText=""},1e3)}onOptionClick(t){console.log("[CHOICE-SELECT] Choice selected:",t),this.choiceSelected.emit(t)}renderLabelMarkdown(t){return ie(this,null,function*(){if(!t){this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(""));return}try{let e=yield this.markdownService.parse(t);this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(e))}catch(e){console.error("[CHOICE-SELECT] Error parsing label markdown:",e),this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(t))}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-choice-select"]],viewQuery:function(e,i){if(e&1&&ne(yv,5),e&2){let o;W(o=U())&&(i.buttonContainer=o.first)}},inputs:{options:"options",labelHtml:"labelHtml",isVisible:"isVisible"},outputs:{choiceSelected:"choiceSelected"},features:[Le],decls:1,vars:1,consts:[["buttonContainer",""],[1,"choice-container"],[1,"choice-label",3,"innerHTML"],["role","listbox","tabindex","0",1,"choice-buttons",3,"keydown"],["type","button","role","option",1,"choice-button",3,"highlighted","disabled","id"],[1,"search-indicator"],["type","button","role","option",1,"choice-button",3,"click","disabled","id"],[1,"choice-button-label"],[1,"choice-button-icon"]],template:function(e,i){e&1&&w(0,kv,8,5,"div",1),e&2&&S(i.isVisible?0:-1)},dependencies:[Qe,xe,dh],styles:[".choice-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem}.choice-label[_ngcontent-%COMP%]{display:block;font-weight:500;color:var(--color-text);font-size:1rem;line-height:1.5}.choice-label[_ngcontent-%COMP%] p{margin:0 0 .5rem}.choice-label[_ngcontent-%COMP%] p:last-child{margin-bottom:0}.choice-label[_ngcontent-%COMP%] code{background:var(--color-code-bg);padding:.2em .4em;border-radius:4px;font-family:monospace;font-size:.9em}.choice-label[_ngcontent-%COMP%] strong{font-weight:600}.choice-buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-height:400px;overflow-y:auto;padding:.5rem;background:var(--color-background);border:2px solid var(--color-border);border-radius:12px;outline:none}.choice-buttons[_ngcontent-%COMP%]:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:var(--color-background);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.choice-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.75rem 1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;text-align:left;cursor:pointer;transition:all .2s ease}.choice-button[_ngcontent-%COMP%]:hover:not(:disabled):not(.highlighted){background:var(--color-bg-hover);border-color:var(--color-primary);transform:translate(2px)}.choice-button.highlighted[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff;border-color:var(--color-primary);box-shadow:0 2px 8px #007aff4d}.choice-button.highlighted[_ngcontent-%COMP%] .choice-button-icon[_ngcontent-%COMP%]{color:#fff}.choice-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.choice-button[_ngcontent-%COMP%]:focus{outline:none}.choice-button-label[_ngcontent-%COMP%]{flex:1;line-height:1.5}.choice-button-icon[_ngcontent-%COMP%]{flex-shrink:0;margin-left:.5rem;font-size:1.2rem;width:1.2rem;height:1.2rem}.search-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:var(--color-primary);color:#fff;border-radius:8px;font-size:.9rem;font-weight:500;animation:_ngcontent-%COMP%_fadeIn .2s ease}.search-indicator[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:#fff}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 480px){.choice-container[_ngcontent-%COMP%]{gap:.75rem}.choice-label[_ngcontent-%COMP%]{font-size:.95rem}.choice-buttons[_ngcontent-%COMP%]{max-height:300px;gap:.375rem}.choice-button[_ngcontent-%COMP%]{font-size:.95rem;padding:.625rem .875rem}}@media print{.choice-buttons[_ngcontent-%COMP%]{max-height:none;overflow:visible}.search-indicator[_ngcontent-%COMP%]{display:none!important}}"]})};var tr=class n{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(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(e,i){e&1&&(ri(0,"h1",0),h(1),ai()),e&2&&(m(),B(i.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(2.5rem,6vw,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:inline-block;min-height:1.2em}@media (max-width: 768px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(2rem,5vw,3rem)}}@media (max-width: 480px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,2rem)}}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var Nu=(()=>{class n{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||n)(Pe(ot),Pe(K))};static \u0275dir=Z({type:n})}return n})(),po=(()=>{class n extends Nu{static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,features:[ye]})}return n})(),Kt=new ee(""),Mv={provide:Kt,useExisting:at(()=>Fd),multi:!0},Fd=(()=>{class n extends po{writeValue(e){this.setProperty("checked",e)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(i,o){i&1&&_("change",function(a){return o.onChange(a.target.checked)})("blur",function(){return o.onTouched()})},standalone:!1,features:[fe([Mv]),ye]})}return n})(),Ev={provide:Kt,useExisting:at(()=>ze),multi:!0};function Tv(){let n=yc()?yc().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var Pv=new ee(""),ze=(()=>{class n extends Nu{_compositionMode;_composing=!1;constructor(e,i,o){super(e,i),this._compositionMode=o,this._compositionMode==null&&(this._compositionMode=!Tv())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||n)(Pe(ot),Pe(K),Pe(Pv,8))};static \u0275dir=Z({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,o){i&1&&_("input",function(a){return o._handleInput(a.target.value)})("blur",function(){return o.onTouched()})("compositionstart",function(){return o._compositionStart()})("compositionend",function(a){return o._compositionEnd(a.target.value)})},standalone:!1,features:[fe([Ev]),ye]})}return n})();function Nd(n){return n==null||Vd(n)===0}function Vd(n){return n==null?null:Array.isArray(n)||typeof n=="string"?n.length:n instanceof Set?n.size:null}var Ti=new ee(""),Ld=new ee(""),Ov=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,or=class{static min(t){return Vu(t)}static max(t){return Lu(t)}static required(t){return ju(t)}static requiredTrue(t){return Av(t)}static email(t){return Dv(t)}static minLength(t){return Iv(t)}static maxLength(t){return zu(t)}static pattern(t){return Rv(t)}static nullValidator(t){return Qs()}static compose(t){return qu(t)}static composeAsync(t){return Gu(t)}};function Vu(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e<n?{min:{min:n,actual:t.value}}:null}}function Lu(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e>n?{max:{max:n,actual:t.value}}:null}}function ju(n){return Nd(n.value)?{required:!0}:null}function Av(n){return n.value===!0?null:{required:!0}}function Dv(n){return Nd(n.value)||Ov.test(n.value)?null:{email:!0}}function Iv(n){return t=>{let e=t.value?.length??Vd(t.value);return e===null||e===0?null:e<n?{minlength:{requiredLength:n,actualLength:e}}:null}}function zu(n){return t=>{let e=t.value?.length??Vd(t.value);return e!==null&&e>n?{maxlength:{requiredLength:n,actualLength:e}}:null}}function Rv(n){if(!n)return Qs;let t,e;return typeof n=="string"?(e="",n.charAt(0)!=="^"&&(e+="^"),e+=n,n.charAt(n.length-1)!=="$"&&(e+="$"),t=new RegExp(e)):(e=n.toString(),t=n),i=>{if(Nd(i.value))return null;let o=i.value;return t.test(o)?null:{pattern:{requiredPattern:e,actualValue:o}}}}function Qs(n){return null}function Bu(n){return n!=null}function Hu(n){return eh(n)?jm(n):n}function Wu(n){let t={};return n.forEach(e=>{t=e!=null?q(q({},t),e):t}),Object.keys(t).length===0?null:t}function Uu(n,t){return t.map(e=>e(n))}function Fv(n){return!n.validate}function $u(n){return n.map(t=>Fv(t)?t:e=>t.validate(e))}function qu(n){if(!n)return null;let t=n.filter(Bu);return t.length==0?null:function(e){return Wu(Uu(e,t))}}function jd(n){return n!=null?qu($u(n)):null}function Gu(n){if(!n)return null;let t=n.filter(Bu);return t.length==0?null:function(e){let i=Uu(e,t).map(Hu);return Hm(i).pipe(ve(Wu))}}function zd(n){return n!=null?Gu($u(n)):null}function Tu(n,t){return n===null?[t]:Array.isArray(n)?[...n,t]:[n,t]}function Yu(n){return n._rawValidators}function Qu(n){return n._rawAsyncValidators}function Id(n){return n?Array.isArray(n)?n:[n]:[]}function Xs(n,t){return Array.isArray(n)?n.includes(t):n===t}function Pu(n,t){let e=Id(t);return Id(n).forEach(o=>{Xs(e,o)||e.push(o)}),e}function Ou(n,t){return Id(t).filter(e=>!Xs(n,e))}var Ks=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=jd(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=zd(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},ho=class extends Ks{name;get formDirective(){return null}get path(){return null}},Gi=class extends Ks{_parent=null;name=null;valueAccessor=null},Rd=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},Nv={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},hT=Ie(q({},Nv),{"[class.ng-submitted]":"isSubmitted"}),Xe=(()=>{class n extends Rd{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(Pe(Gi,2))};static \u0275dir=Z({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,o){i&2&&A("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)},standalone:!1,features:[ye]})}return n})();var ha="VALID",Ys="INVALID",ir="PENDING",pa="DISABLED",Bn=class{},Zs=class extends Bn{value;source;constructor(t,e){super(),this.value=t,this.source=e}},ga=class extends Bn{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},fa=class extends Bn{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},nr=class extends Bn{status;source;constructor(t,e){super(),this.status=t,this.source=e}},Js=class extends Bn{source;constructor(t){super(),this.source=t}},el=class extends Bn{source;constructor(t){super(),this.source=t}};function Xu(n){return(al(n)?n.validators:n)||null}function Vv(n){return Array.isArray(n)?jd(n):n||null}function Ku(n,t){return(al(t)?t.asyncValidators:n)||null}function Lv(n){return Array.isArray(n)?zd(n):n||null}function al(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function jv(n,t,e){let i=n.controls;if(!(t?Object.keys(i):i).length)throw new de(1e3,"");if(!i[e])throw new de(1001,"")}function zv(n,t,e){n._forEachChild((i,o)=>{if(e[o]===void 0)throw new de(1002,"")})}var tl=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return fi(this.statusReactive)}set status(t){fi(()=>this.statusReactive.set(t))}_status=ft(()=>this.statusReactive());statusReactive=Te(void 0);get valid(){return this.status===ha}get invalid(){return this.status===Ys}get pending(){return this.status==ir}get disabled(){return this.status===pa}get enabled(){return this.status!==pa}errors;get pristine(){return fi(this.pristineReactive)}set pristine(t){fi(()=>this.pristineReactive.set(t))}_pristine=ft(()=>this.pristineReactive());pristineReactive=Te(!0);get dirty(){return!this.pristine}get touched(){return fi(this.touchedReactive)}set touched(t){fi(()=>this.touchedReactive.set(t))}_touched=ft(()=>this.touchedReactive());touchedReactive=Te(!1);get untouched(){return!this.touched}_events=new D;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(Pu(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(Pu(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(Ou(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(Ou(t,this._rawAsyncValidators))}hasValidator(t){return Xs(this._rawValidators,t)}hasAsyncValidator(t){return Xs(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched(Ie(q({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new fa(!0,i))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=t.sourceControl??this;this._forEachChild(o=>{o.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:i})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,i),e&&t.emitEvent!==!1&&this._events.next(new fa(!1,i))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty(Ie(q({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new ga(!1,i))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=t.sourceControl??this;this._forEachChild(o=>{o.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,i),e&&t.emitEvent!==!1&&this._events.next(new ga(!0,i))}markAsPending(t={}){this.status=ir;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new nr(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending(Ie(q({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=pa,this.errors=null,this._forEachChild(o=>{o.disable(Ie(q({},t),{onlySelf:!0}))}),this._updateValue();let i=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Zs(this.value,i)),this._events.next(new nr(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Ie(q({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(o=>o(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=ha,this._forEachChild(i=>{i.enable(Ie(q({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Ie(q({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(t,e){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===ha||this.status===ir)&&this._runAsyncValidator(i,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Zs(this.value,e)),this._events.next(new nr(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(Ie(q({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?pa:ha}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=ir,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let i=Hu(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(o=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(o,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,o)=>i&&i._find(o),this)}getError(t,e){let i=e?this.get(e):this;return i&&i.errors?i.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new nr(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,i)}_initObservables(){this.valueChanges=new H,this.statusChanges=new H}_calculateStatus(){return this._allControlsDisabled()?pa:this.errors?Ys:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(ir)?ir:this._anyControlsHaveStatus(Ys)?Ys:ha}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let i=!this._anyControlsDirty(),o=this.pristine!==i;this.pristine=i,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,e),o&&this._events.next(new ga(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new fa(this.touched,e)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){al(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){let e=this._parent&&this._parent.dirty;return!t&&!!e&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=Vv(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=Lv(this._rawAsyncValidators)}},il=class extends tl{constructor(t,e,i){super(Xu(e),Ku(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,i={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,i={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){zv(this,!0,t),Object.keys(t).forEach(i=>{jv(this,!0,i),this.controls[i].setValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(i=>{let o=this.controls[i];o&&o.patchValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((i,o)=>{i.reset(t?t[o]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new el(this))}getRawValue(){return this._reduceChildren({},(t,e,i)=>(t[i]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,i)=>i._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&t(i,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&t(i))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,i,o)=>((i.enabled||this.disabled)&&(e[o]=i.value),e))}_reduceChildren(t,e){let i=t;return this._forEachChild((o,r)=>{i=e(i,o,r)}),i}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var _a=new ee("",{providedIn:"root",factory:()=>sl}),sl="always";function Bv(n,t){return[...t.path,n]}function nl(n,t,e=sl){Bd(n,t),t.valueAccessor.writeValue(n.value),(n.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(n.disabled),Wv(n,t),$v(n,t),Uv(n,t),Hv(n,t)}function Au(n,t,e=!0){let i=()=>{};t.valueAccessor&&(t.valueAccessor.registerOnChange(i),t.valueAccessor.registerOnTouched(i)),rl(n,t),n&&(t._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function ol(n,t){n.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function Hv(n,t){if(t.valueAccessor.setDisabledState){let e=i=>{t.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(e),t._registerOnDestroy(()=>{n._unregisterOnDisabledChange(e)})}}function Bd(n,t){let e=Yu(n);t.validator!==null?n.setValidators(Tu(e,t.validator)):typeof e=="function"&&n.setValidators([e]);let i=Qu(n);t.asyncValidator!==null?n.setAsyncValidators(Tu(i,t.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let o=()=>n.updateValueAndValidity();ol(t._rawValidators,o),ol(t._rawAsyncValidators,o)}function rl(n,t){let e=!1;if(n!==null){if(t.validator!==null){let o=Yu(n);if(Array.isArray(o)&&o.length>0){let r=o.filter(a=>a!==t.validator);r.length!==o.length&&(e=!0,n.setValidators(r))}}if(t.asyncValidator!==null){let o=Qu(n);if(Array.isArray(o)&&o.length>0){let r=o.filter(a=>a!==t.asyncValidator);r.length!==o.length&&(e=!0,n.setAsyncValidators(r))}}}let i=()=>{};return ol(t._rawValidators,i),ol(t._rawAsyncValidators,i),e}function Wv(n,t){t.valueAccessor.registerOnChange(e=>{n._pendingValue=e,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&Zu(n,t)})}function Uv(n,t){t.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&Zu(n,t),n.updateOn!=="submit"&&n.markAsTouched()})}function Zu(n,t){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function $v(n,t){let e=(i,o)=>{t.valueAccessor.writeValue(i),o&&t.viewToModelUpdate(i)};n.registerOnChange(e),t._registerOnDestroy(()=>{n._unregisterOnChange(e)})}function Ju(n,t){n==null,Bd(n,t)}function qv(n,t){return rl(n,t)}function Gv(n,t){if(!n.hasOwnProperty("model"))return!1;let e=n.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function Yv(n){return Object.getPrototypeOf(n.constructor)===po}function eg(n,t){n._syncPendingControls(),t.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function Qv(n,t){if(!t)return null;Array.isArray(t);let e,i,o;return t.forEach(r=>{r.constructor===ze?e=r:Yv(r)?i=r:o=r}),o||i||e||null}function Xv(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}var Kv={provide:ho,useExisting:at(()=>ba)},ua=Promise.resolve(),ba=(()=>{class n extends ho{callSetDisabledState;get submitted(){return fi(this.submittedReactive)}_submitted=ft(()=>this.submittedReactive());submittedReactive=Te(!1);_directives=new Set;form;ngSubmit=new H;options;constructor(e,i,o){super(),this.callSetDisabledState=o,this.form=new il({},jd(e),zd(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){ua.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),nl(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){ua.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){ua.then(()=>{let i=this._findContainer(e.path),o=new il({});Ju(o,e),i.registerControl(e.name,o),o.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){ua.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){ua.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),eg(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new Js(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||n)(Pe(Ti,10),Pe(Ld,10),Pe(_a,8))};static \u0275dir=Z({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,o){i&1&&_("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[fe([Kv]),ye]})}return n})();function Du(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}function Iu(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var tg=class extends tl{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,i){super(Xu(e),Ku(i,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),al(e)&&(e.nonNullable||e.initialValueIsDefault)&&(Iu(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new el(this))}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Du(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Du(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){Iu(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var Zv=n=>n instanceof tg;var Jv={provide:Gi,useExisting:at(()=>Ue)},Ru=Promise.resolve(),Ue=(()=>{class n extends Gi{_changeDetectorRef;callSetDisabledState;control=new tg;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new H;constructor(e,i,o,r,a,l){super(),this._changeDetectorRef=a,this.callSetDisabledState=l,this._parent=e,this._setValidators(i),this._setAsyncValidators(o),this.valueAccessor=Qv(this,r)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Gv(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){nl(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){Ru.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,o=i!==0&&J(i);Ru.then(()=>{o&&!this.control.disabled?this.control.disable():!o&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Bv(e,this._parent):[e]}static \u0275fac=function(i){return new(i||n)(Pe(ho,9),Pe(Ti,10),Pe(Ld,10),Pe(Kt,10),Pe(Re,8),Pe(_a,8))};static \u0275dir=Z({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[fe([Jv]),ye,Le]})}return n})();var e0={provide:Kt,useExisting:at(()=>va),multi:!0},va=(()=>{class n extends po{writeValue(e){let i=e??"";this.setProperty("value",i)}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(i,o){i&1&&_("input",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},standalone:!1,features:[fe([e0]),ye]})}return n})(),t0={provide:Kt,useExisting:at(()=>uo),multi:!0};var i0=(()=>{class n{_accessors=[];add(e,i){this._accessors.push([e,i])}remove(e){for(let i=this._accessors.length-1;i>=0;--i)if(this._accessors[i][1]===e){this._accessors.splice(i,1);return}}select(e){this._accessors.forEach(i=>{this._isSameGroup(i,e)&&i[1]!==e&&i[1].fireUncheck(e.value)})}_isSameGroup(e,i){return e[0].control?e[0]._parent===i._control._parent&&e[1].name===i.name:!1}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),uo=(()=>{class n extends po{_registry;_injector;_state;_control;_fn;setDisabledStateFired=!1;onChange=()=>{};name;formControlName;value;callSetDisabledState=d(_a,{optional:!0})??sl;constructor(e,i,o,r){super(e,i),this._registry=o,this._injector=r}ngOnInit(){this._control=this._injector.get(Gi),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this.setProperty("checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}setDisabledState(e){(this.setDisabledStateFired||e||this.callSetDisabledState==="whenDisabledForLegacyCode")&&this.setProperty("disabled",e),this.setDisabledStateFired=!0}fireUncheck(e){this.writeValue(e)}_checkName(){this.name&&this.formControlName&&(this.name,this.formControlName),!this.name&&this.formControlName&&(this.name=this.formControlName)}static \u0275fac=function(i){return new(i||n)(Pe(ot),Pe(K),Pe(i0),Pe(ge))};static \u0275dir=Z({type:n,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(i,o){i&1&&_("change",function(){return o.onChange()})("blur",function(){return o.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},standalone:!1,features:[fe([t0]),ye]})}return n})(),n0={provide:Kt,useExisting:at(()=>Hd),multi:!0},Hd=(()=>{class n extends po{writeValue(e){this.setProperty("value",parseFloat(e))}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(i,o){i&1&&_("change",function(a){return o.onChange(a.target.value)})("input",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},standalone:!1,features:[fe([n0]),ye]})}return n})();var o0={provide:ho,useExisting:at(()=>ya)},ya=(()=>{class n extends ho{callSetDisabledState;get submitted(){return fi(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=ft(()=>this._submittedReactive());_submittedReactive=Te(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new H;constructor(e,i,o){super(),this.callSetDisabledState=o,this._setValidators(e),this._setAsyncValidators(i)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(rl(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){let i=this.form.get(e.path);return nl(i,e,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),i}getControl(e){return this.form.get(e.path)}removeControl(e){Au(e.control||null,e,!1),Xv(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,i){this.form.get(e.path).setValue(i)}onSubmit(e){return this._submittedReactive.set(!0),eg(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new Js(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0,i={}){this.form.reset(e,i),this._submittedReactive.set(!1)}_updateDomValue(){this.directives.forEach(e=>{let i=e.control,o=this.form.get(e.path);i!==o&&(Au(i||null,e),Zv(o)&&(nl(o,e,this.callSetDisabledState),e.control=o))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let i=this.form.get(e.path);Ju(i,e),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){let i=this.form.get(e.path);i&&qv(i,e)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Bd(this.form,this),this._oldForm&&rl(this._oldForm,this)}static \u0275fac=function(i){return new(i||n)(Pe(Ti,10),Pe(Ld,10),Pe(_a,8))};static \u0275dir=Z({type:n,selectors:[["","formGroup",""]],hostBindings:function(i,o){i&1&&_("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[fe([o0]),ye,Le]})}return n})();var r0={provide:Kt,useExisting:at(()=>ll),multi:!0};function ig(n,t){return n==null?`${t}`:(t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function a0(n){return n.split(":")[0]}var ll=(()=>{class n extends po{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;appRefInjector=d(Fr).injector;destroyRef=d(Kn);cdr=d(Re);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,Et({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(e){this.cdr.markForCheck(),this.value=e;let i=this._getOptionId(e),o=ig(i,e);this.setProperty("value",o)}registerOnChange(e){this.onChange=i=>{this.value=this._getOptionValue(i),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),e))return i;return null}_getOptionValue(e){let i=a0(e);return this._optionMap.has(i)?this._optionMap.get(i):e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,o){i&1&&_("change",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[fe([r0]),ye]})}return n})(),cl=(()=>{class n{_element;_renderer;_select;id;constructor(e,i,o){this._element=e,this._renderer=i,this._select=o,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(ig(this.id,e)),this._select._writeValueAfterRender())}set value(e){this._setElementValue(e),this._select&&this._select._writeValueAfterRender()}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select._writeValueAfterRender())}static \u0275fac=function(i){return new(i||n)(Pe(K),Pe(ot),Pe(ll,9))};static \u0275dir=Z({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),s0={provide:Kt,useExisting:at(()=>ng),multi:!0};function Fu(n,t){return n==null?`${t}`:(typeof t=="string"&&(t=`'${t}'`),t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function l0(n){return n.split(":")[0]}var ng=(()=>{class n extends po{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;writeValue(e){this.value=e;let i;if(Array.isArray(e)){let o=e.map(r=>this._getOptionId(r));i=(r,a)=>{r._setSelected(o.indexOf(a.toString())>-1)}}else i=(o,r)=>{o._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(e){this.onChange=i=>{let o=[],r=i.selectedOptions;if(r!==void 0){let a=r;for(let l=0;l<a.length;l++){let p=a[l],u=this._getOptionValue(p.value);o.push(u)}}else{let a=i.options;for(let l=0;l<a.length;l++){let p=a[l];if(p.selected){let u=this._getOptionValue(p.value);o.push(u)}}}this.value=o,e(o)}}_registerOption(e){let i=(this._idCounter++).toString();return this._optionMap.set(i,e),i}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,e))return i;return null}_getOptionValue(e){let i=l0(e);return this._optionMap.has(i)?this._optionMap.get(i)._value:e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,o){i&1&&_("change",function(a){return o.onChange(a.target)})("blur",function(){return o.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[fe([s0]),ye]})}return n})(),dl=(()=>{class n{_element;_renderer;_select;id;_value;constructor(e,i,o){this._element=e,this._renderer=i,this._select=o,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(Fu(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(Fu(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(Pe(K),Pe(ot),Pe(ng,9))};static \u0275dir=Z({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();function c0(n){return typeof n=="number"?n:parseInt(n,10)}function og(n){return typeof n=="number"?n:parseFloat(n)}var ml=(()=>{class n{_validator=Qs;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let i=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(i),this._validator=this._enabled?this.createValidator(i):Qs,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,features:[Le]})}return n})(),d0={provide:Ti,useExisting:at(()=>Wd),multi:!0},Wd=(()=>{class n extends ml{max;inputName="max";normalizeInput=e=>og(e);createValidator=e=>Lu(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&Y("max",o._enabled?o.max:null)},inputs:{max:"max"},standalone:!1,features:[fe([d0]),ye]})}return n})(),m0={provide:Ti,useExisting:at(()=>Ca),multi:!0},Ca=(()=>{class n extends ml{min;inputName="min";normalizeInput=e=>og(e);createValidator=e=>Vu(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&Y("min",o._enabled?o.min:null)},inputs:{min:"min"},standalone:!1,features:[fe([m0]),ye]})}return n})(),h0={provide:Ti,useExisting:at(()=>go),multi:!0};var go=(()=>{class n extends ml{required;inputName="required";normalizeInput=J;createValidator=e=>ju;enabled(e){return e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(i,o){i&2&&Y("required",o._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[fe([h0]),ye]})}return n})();var p0={provide:Ti,useExisting:at(()=>Ud),multi:!0},Ud=(()=>{class n extends ml{maxlength;inputName="maxlength";normalizeInput=e=>c0(e);createValidator=e=>zu(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&Y("maxlength",o._enabled?o.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[fe([p0]),ye]})}return n})();var u0=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({})}return n})();var Ke=(()=>{class n{static withConfig(e){return{ngModule:n,providers:[{provide:_a,useValue:e.callSetDisabledState??sl}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[u0]})}return n})();var g0=["inputElement"];function f0(n,t){if(n&1&&(s(0,"span",3),h(1),c()),n&2){let e=g();m(),B(e.label)}}function _0(n,t){if(n&1&&(s(0,"small",5),h(1),c()),n&2){let e=g();m(),B(e.hint)}}var hl=class n{label="";placeholder="";hint="";isDisabled=!1;value="";autoFocus=!0;valueChange=new H;enterPressed=new H;inputElement;inputValue="";ngAfterViewInit(){this.inputValue=this.value,this.autoFocus&&setTimeout(()=>this.inputElement?.nativeElement.focus(),100)}onValueChange(t){this.valueChange.emit(t)}onEnter(){this.inputValue.trim()&&this.enterPressed.emit(this.inputValue.trim())}focus(){this.inputElement?.nativeElement.focus()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-text-input"]],viewQuery:function(e,i){if(e&1&&ne(g0,5),e&2){let o;W(o=U())&&(i.inputElement=o.first)}},inputs:{label:"label",placeholder:"placeholder",hint:"hint",isDisabled:"isDisabled",value:"value",autoFocus:"autoFocus"},outputs:{valueChange:"valueChange",enterPressed:"enterPressed"},decls:6,vars:5,consts:[["inputElement",""],[1,"text-input-container"],[1,"text-input-wrapper"],[1,"text-input-label"],["type","text",1,"text-input-field",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],[1,"text-input-hint"]],template:function(e,i){if(e&1){let o=E();s(0,"div",1)(1,"label",2),w(2,f0,2,1,"span",3),s(3,"input",4,0),j("ngModelChange",function(a){return v(o),L(i.inputValue,a)||(i.inputValue=a),y(a)}),_("ngModelChange",function(a){return v(o),y(i.onValueChange(a))})("keydown.enter",function(){return v(o),y(i.onEnter())}),c()(),w(5,_0,2,1,"small",5),c()}e&2&&(m(2),S(i.label?2:-1),m(),V("ngModel",i.inputValue),x("placeholder",i.placeholder)("disabled",i.isDisabled),m(2),S(i.hint?5:-1))},dependencies:[Ke,ze,Xe,Ue,De],styles:[".text-input-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%}.text-input-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;cursor:text}.text-input-label[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);margin:0}.text-input-field[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:1rem;color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;outline:none;transition:all .2s ease}.text-input-field[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.text-input-field[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(var(--color-primary-rgb),.1)}.text-input-field[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;background:var(--color-surface)}.text-input-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);margin:0;font-style:italic}@media (max-width: 768px){.text-input-field[_ngcontent-%COMP%]{padding:.65rem .85rem;font-size:.95rem}.text-input-label[_ngcontent-%COMP%]{font-size:.9rem}.text-input-hint[_ngcontent-%COMP%]{font-size:.8rem}}"]})};var b0=["nameInput"],v0=["pathInput"];function y0(n,t){if(n&1&&(s(0,"div",7),h(1),c()),n&2){let e=g();m(),B(e.errorMessage)}}var pl=class n{isCreating=!1;create=new H;cancelled=new H;nameInput;pathInput;projectName="";projectPath="";errorMessage="";isValid(){return this.projectName.trim()!==""&&this.projectPath.trim()!==""}onNameEnter(){this.projectName.trim()&&setTimeout(()=>this.pathInput?.focus(),50)}onCreate(){this.isValid()?(this.errorMessage="",this.create.emit({name:this.projectName.trim(),path:this.projectPath.trim()})):this.errorMessage="Both name and path are required"}onCancel(){this.cancelled.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-project-create"]],viewQuery:function(e,i){if(e&1&&(ne(b0,5),ne(v0,5)),e&2){let o;W(o=U())&&(i.nameInput=o.first),W(o=U())&&(i.pathInput=o.first)}},inputs:{isCreating:"isCreating"},outputs:{create:"create",cancelled:"cancelled"},decls:14,vars:10,consts:[["nameInput",""],["pathInput",""],[1,"project-create"],[1,"create-title"],[1,"create-form"],["label","Project Name","placeholder","my-project",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],["label","Project Path","placeholder","/path/to/project","hint","Absolute path to the project directory",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],[1,"error-message"],[1,"form-actions"],["matButton","",3,"click","disabled"],["matButton","filled",3,"click","disabled"]],template:function(e,i){if(e&1){let o=E();s(0,"div",2)(1,"h3",3),h(2,"Create New Project"),c(),s(3,"div",4)(4,"app-text-input",5,0),_("valueChange",function(a){return v(o),y(i.projectName=a)})("enterPressed",function(){return v(o),y(i.onNameEnter())}),c(),s(6,"app-text-input",6,1),_("valueChange",function(a){return v(o),y(i.projectPath=a)})("enterPressed",function(){return v(o),y(i.onCreate())}),c(),w(8,y0,2,1,"div",7),c(),s(9,"div",8)(10,"button",9),_("click",function(){return v(o),y(i.onCancel())}),h(11,"Cancel"),c(),s(12,"button",10),_("click",function(){return v(o),y(i.onCreate())}),h(13),c()()()}e&2&&(m(4),x("value",i.projectName)("isDisabled",i.isCreating)("autoFocus",!0),m(2),x("value",i.projectPath)("isDisabled",i.isCreating)("autoFocus",!1),m(2),S(i.errorMessage?8:-1),m(2),x("disabled",i.isCreating),m(2),x("disabled",!i.isValid()||i.isCreating),m(),ae(" ",i.isCreating?"Creating...":"Create Project"," "))},dependencies:[De,hl,It],styles:[".project-create[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1rem;animation:_ngcontent-%COMP%_slideIn .3s ease-out}.create-title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text);text-align:center}.create-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;background:#dc26261a;border:1px solid rgba(220,38,38,.3);border-radius:8px;color:var(--color-error);font-size:.9rem;text-align:center}.form-actions[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:flex-end;margin-top:.5rem}@keyframes _ngcontent-%COMP%_slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 768px){.project-create[_ngcontent-%COMP%]{gap:1.25rem;padding:.75rem}.create-title[_ngcontent-%COMP%]{font-size:1.3rem}.form-actions[_ngcontent-%COMP%]{flex-direction:column-reverse;gap:.75rem}}@media (max-width: 480px){.project-create[_ngcontent-%COMP%]{gap:1rem;padding:.5rem}.create-title[_ngcontent-%COMP%]{font-size:1.2rem}}"]})};function C0(n,t){if(n&1){let e=E();s(0,"app-project-create",10),_("create",function(o){v(e);let r=g();return y(r.onCreateProject(o))})("cancelled",function(){v(e);let o=g();return y(o.closeCreateForm())}),c()}if(n&2){let e=g();x("isCreating",e.isCreating)}}function x0(n,t){n&1&&(s(0,"div",6),F(1,"div",11),s(2,"p",12),h(3,"Loading projects..."),c()())}function w0(n,t){if(n&1&&(s(0,"div",7)(1,"p",13),h(2),c()()),n&2){let e=g();m(2),B(e.error)}}function S0(n,t){if(n&1){let e=E();s(0,"app-choice-select",14),_("choiceSelected",function(o){v(e);let r=g();return y(r.selectProject(o))}),c()}if(n&2){let e=g();x("options",e.projectOptions())("labelHtml","Select a project to continue")("isVisible",!0)}}function k0(n,t){if(n&1){let e=E();s(0,"div",9)(1,"p",15),h(2,"No projects available."),c(),s(3,"button",16),_("click",function(){v(e);let o=g();return y(o.openCreateForm())}),h(4,"Create your first project"),c()()}}var ul=class n{isLoading=!1;error=null;showCreateForm=!1;isCreating=!1;router=d(Dn);projectStateService=d(we);projects=jt(this.projectStateService.projectList$);forcedProject=jt(this.projectStateService.forcedProject$);projectOptions=ft(()=>{let t=this.projects();if(!t)return[];let e=t.filter(a=>!a.volatile),i=t.filter(a=>a.volatile),r=[...e,...i].map(a=>({value:a.name,label:a.volatile?`${a.name} \u{1F538}temp`:a.name}));return t.length>0&&r.push({value:"__new_project__",label:"New project..."}),r});showCreateButton=ft(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(js(),pe(t=>!!t),pe(()=>this.router.url.split("?")[0]==="/"),Mt(1)).subscribe(t=>{console.log(`\u{1F43C} navigate to ${t.name}`),this.router.navigate(["project",t.name])})}selectProject(t){if(t==="__new_project__"){this.openCreateForm();return}this.projectStateService.selectProject(t)}openCreateForm(){this.showCreateForm=!0}closeCreateForm(){this.showCreateForm=!1,this.isCreating=!1}onCreateProject(t){this.isCreating=!0,this.error=null,this.projectStateService.createProject(t.name,t.path).subscribe({next:e=>{console.log("[PROJECT-SELECTION] Project created:",e.message),this.isCreating=!1,this.closeCreateForm(),this.selectProject(t.name)},error:e=>{console.error("[PROJECT-SELECTION] Error creating project:",e),this.error=e.error?.error||"Failed to create project",this.isCreating=!1}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-project-selection"]],decls:11,vars:1,consts:[[1,"project-selection"],[1,"centered-content"],[1,"welcome-section"],[1,"choice-section"],[1,"choice-glass"],[3,"isCreating"],[1,"loading-container"],[1,"error-container"],[3,"options","labelHtml","isVisible"],[1,"no-projects-container"],[3,"create","cancelled","isCreating"],[1,"loading-spinner"],[1,"loading-text"],[1,"error-text"],[3,"choiceSelected","options","labelHtml","isVisible"],[1,"no-projects-text"],["matButton","filled","color","primary",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),F(3,"app-welcome-message"),c(),s(4,"div",3)(5,"div",4),w(6,C0,1,1,"app-project-create",5)(7,x0,4,0,"div",6)(8,w0,3,1,"div",7)(9,S0,1,3,"app-choice-select",8)(10,k0,5,0,"div",9),c()()()()),e&2&&(m(6),S(i.showCreateForm?6:i.isLoading?7:i.error?8:i.projects()&&i.projects().length>0?9:10))},dependencies:[De,er,tr,pl,It],styles:[".project-selection[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100vh;width:100%;overflow:hidden;background:var(--color-bg);padding:2rem}.centered-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3rem;width:100%;max-width:800px;animation:_ngcontent-%COMP%_fadeIn .6s ease-out}.welcome-section[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_slideUp .8s ease-out}.choice-section[_ngcontent-%COMP%]{width:100%;animation:_ngcontent-%COMP%_slideUp .8s ease-out .2s both}.choice-glass[_ngcontent-%COMP%]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;padding:1.5rem;box-shadow:0 4px 6px #0000001a;transition:all .3s ease}.choice-glass[_ngcontent-%COMP%]:hover{box-shadow:0 8px 12px #00000026}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:2rem}.loading-spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-text[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0}.error-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.error-text[_ngcontent-%COMP%]{color:var(--color-error);margin:0}.no-projects-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.no-projects-text[_ngcontent-%COMP%]{color:var(--color-text);margin:0 0 1rem;font-size:1.1rem}.no-projects-hint[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0;font-size:.9rem}.create-action[_ngcontent-%COMP%]{margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--color-border);display:flex;justify-content:center}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@keyframes _ngcontent-%COMP%_slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media (max-width: 768px){.project-selection[_ngcontent-%COMP%]{padding:1.5rem}.centered-content[_ngcontent-%COMP%]{gap:2rem}.choice-glass[_ngcontent-%COMP%]{padding:1rem}}@media (max-width: 480px){.project-selection[_ngcontent-%COMP%]{padding:1rem}.centered-content[_ngcontent-%COMP%]{gap:1.5rem}.choice-glass[_ngcontent-%COMP%]{padding:.75rem}.create-action[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem}}"]})};var st=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new se("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new se(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new se(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new se("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new se(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new se(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new se(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new se(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new se(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new se(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new se(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new se(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new se(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new se(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.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 t=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(i);let o=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(o);let r=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(r);let a=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(a);let l=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(l);let p=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(p);let u=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(u);let b=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(b);let C=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(C);let T=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(T);let P=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(P);let k=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return ie(this,null,function*(){let t=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(i);let o=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(o);let r=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(r);let a=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(a);let l=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(l);let p=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(p);let u=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(u);let b=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(b);let C=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(C);let T=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(T);let P=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(P);let k=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(t,e){return this.getPreferenceSync(t,e)}getPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY);if(!i)return e;let o=JSON.parse(i);return o[t]!==void 0?o[t]:e}catch{return e}}getPreferenceAsync(t,e){return ie(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(t,e);try{let i=yield this.electronStorage.get(this.STORAGE_KEY);if(!i)return e;let o=JSON.parse(i);return o[t]!==void 0?o[t]:e}catch{return e}})}setPreference(t,e){this.isDesktopApp?this.setPreferenceAsync(t,e):this.setPreferenceSync(t,e)}setPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY),o=i?JSON.parse(i):{};o[t]=e,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(o)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}}setPreferenceAsync(t,e){return ie(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(t,e);return}try{let i=yield this.electronStorage.get(this.STORAGE_KEY),o=i?JSON.parse(i):{};o[t]=e,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(o)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}})}updateSubject(t,e){t==="voiceLanguage"&&this.voiceLanguageSubject.next(e),t==="useEnterToSend"&&this.enterToSendSubject.next(e),t==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(e),t==="voiceMode"&&this.voiceModeSubject.next(e),t==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(e),t==="voiceVolume"&&this.voiceVolumeSubject.next(e),t==="voiceRate"&&this.voiceRateSubject.next(e),t==="selectedVoice"&&this.selectedVoiceSubject.next(e),t==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(e),t==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(e),t==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(e),t==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(e),t==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(e),t==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(e)}setVoiceLanguage(t){console.log("[PREFERENCES] Setting voice language to:",t),this.setPreference("voiceLanguage",t)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setEnterToSend(t){console.log("[PREFERENCES] Setting Enter to send to:",t),this.setPreference("useEnterToSend",t)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(t){console.log("[PREFERENCES] Setting voice announce enabled to:",t),this.setPreference("voiceAnnounceEnabled",t)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(t){console.log("[PREFERENCES] Setting voice mode to:",t),this.setPreference("voiceMode",t)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(t){console.log("[PREFERENCES] Setting voice read full text to:",t),this.setPreference("voiceReadFullText",t)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(t){let e=Math.max(0,Math.min(1,t));console.log("[PREFERENCES] Setting voice volume to:",e),this.setPreference("voiceVolume",e)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(t){let e=Math.max(.5,Math.min(2,t));console.log("[PREFERENCES] Setting voice rate to:",e),this.setPreference("voiceRate",e)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(t){console.log("[PREFERENCES] Setting selected voice to:",t),this.setPreference("selectedVoice",t)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(t){console.log("[PREFERENCES] Setting print technical messages to:",t),this.setPreference("printTechnicalMessages",t)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(t){console.log("[PREFERENCES] Setting hide technical messages to:",t),this.setPreference("hideTechnicalMessages",t)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(t){console.log("[PREFERENCES] Setting hide warning messages to:",t),this.setPreference("hideWarningMessages",t)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(t){console.log("[PREFERENCES] Setting agent notification enabled to:",t),this.setPreference("agentNotificationEnabled",t)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(t){console.log("[PREFERENCES] Setting notification sound enabled to:",t),this.setPreference("notificationSoundEnabled",t)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(t){console.log("[PREFERENCES] Setting browser notification enabled to:",t),this.setPreference("browserNotificationEnabled",t)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function $d(n,t=80){if(n.length<=t)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let e=JSON.parse(n),i=JSON.stringify(e);return i.length<=t?i:i.substring(0,t)+`...(${i.length} chars)`}}catch{}return n.substring(0,t)+"..."}var wt=class{constructor(t,e){this.type=e;if(t.timestamp)this.timestamp=t.timestamp;else{let i=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${i}`}this.parentKey=t.parentKey,this.length=0}timestamp;parentKey;static type;length},gl=class extends wt{invite;constructor(t,e){super(t,e),this.invite=t.invite}buildAnswer(t){return new ni({answer:t,parentKey:this.timestamp,invite:this.invite})}},rr=class n extends wt{static type="heartbeat";constructor(t){super(t,n.type)}},_n=class n extends gl{defaultValue;static type="invite";constructor(t){super(t,n.type),this.defaultValue=t.defaultValue}},qd="InviteEventDefault",ni=class n extends wt{answer;invite;static type="answer";constructor(t){super(t,n.type),this.answer=t.answer??"No answer",this.invite=t.invite}},fo=class n extends wt{speaker;text;static type="text";constructor(t){super(t,n.type),this.speaker=t.speaker,this.text=t.text}},ar=class n extends wt{chunk;static type="text_chunk";constructor(t){super(t,n.type),this.chunk=t.chunk,this.length=this.chunk.length}},_o=class n extends wt{warning;static type="warn";constructor(t){super(t,n.type),this.warning=t.warning}},Pi=class n extends wt{error;static type="error";constructor(t){super(t,n.type),this.error=t.error}},bn=class n extends gl{options;optionalQuestion;static type="choice";constructor(t){super(t,n.type),this.options=t.options,this.optionalQuestion=t.optionalQuestion}},vn=class n extends wt{toolRequestId;name;args;static type="tool_request";constructor(t){super(t,n.type),this.toolRequestId=t.toolRequestId??this.timestamp,this.name=t.name,this.args=t.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(t){return new Yi({output:t,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(t=50){let e=$d(this.args,t);return`\u{1F527} ${this.name}(${e})`}},Yi=class n extends wt{toolRequestId;output;static type="tool_response";constructor(t){if(super(t,n.type),this.toolRequestId=t.toolRequestId||this.timestamp||new Date().toISOString(),this.output=t.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 e=(this.output.width??0)*(this.output.height??0)/750;this.length=(e?e*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(t=50){let e=this.getTextOutput(),i=$d(e,t),o=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${i}${o}`}},Hn=class n extends wt{static type="thinking";static debounce=5e3;constructor(t){super(t,n.type)}},bo=class n extends wt{summary;static type="summary";constructor(t){super(t,n.type),this.summary=t.summary,this.length=this.summary.length}toSingleLineString(t=80){return`\u{1F4CB} Summary: ${$d(this.summary,t)}`}},yn=class n extends wt{role;name;content;static type="message";constructor(t){super(t,n.type),this.role=t.role,this.name=t.name,this.content=t.content,this.length=this.content.map(e=>{if(e.type==="text")return e.content.length;if(e.type==="image"){let i=(e.width||0)*(e.height||0)/750;return i?i*3.5:e.content.length}return 0}).reduce((e,i)=>e+i,0)}getTextContent(){return this.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
68
|
-
`)}},sr=class n extends wt{threadId;name;summary;static type="thread_update";constructor(t){super(t,n.type),this.threadId=t.threadId,this.name=t.name,this.summary=t.summary}},Wn=class n extends wt{filename;operation;size;mimeType;static type="file";constructor(t){super(t,n.type),this.filename=t.filename,this.operation=t.operation,this.size=t.size,this.mimeType=t.mimeType}toSingleLineString(){let t=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",e=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${t} ${this.operation}: ${this.filename}${e}`}},lr=class n extends wt{authUrl;state;integrationName;static type="oauth_request";constructor(t){super(t,n.type),this.authUrl=t.authUrl,this.state=t.state,this.integrationName=t.integrationName}},Qi=class n extends wt{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(t){super(t,n.type),this.code=t.code,this.state=t.state,this.integrationName=t.integrationName,this.error=t.error,this.errorDescription=t.errorDescription}},M0={[yn.type]:yn,[ni.type]:ni,[bn.type]:bn,[Pi.type]:Pi,[rr.type]:rr,[_n.type]:_n,[vn.type]:vn,[Yi.type]:Yi,[fo.type]:fo,[ar.type]:ar,[Hn.type]:Hn,[_o.type]:_o,[sr.type]:sr,[bo.type]:bo,[Wn.type]:Wn,[lr.type]:lr,[Qi.type]:Qi};function
|
|
64
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${Ui(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:t,tokens:e}){let i=this.parser.parseInline(e),o=tu(n);if(o===null)return i;n=o;let r='<a href="'+n+'"';return t&&(r+=' title="'+Ui(t)+'"'),r+=">"+i+"</a>",r}image({href:n,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let o=tu(n);if(o===null)return Ui(e);n=o;let r=`<img src="${n}" alt="${e}"`;return t&&(r+=` title="${Ui(t)}"`),r+=">",r}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:Ui(n.text)}},Sd=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},ki=class gd{options;renderer;textRenderer;constructor(t){this.options=t||mo,this.options.renderer=this.options.renderer||new Jo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Sd}static parse(t,e){return new gd(e).parse(t)}static parseInline(t,e){return new gd(e).parseInline(t)}parse(t,e=!0){let i="";for(let o=0;o<t.length;o++){let r=t[o];if(this.options.extensions?.renderers?.[r.type]){let l=r,p=this.options.extensions.renderers[l.type].call({parser:this},l);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){i+=p||"";continue}}let a=r;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let l=a,p=this.renderer.text(l);for(;o+1<t.length&&t[o+1].type==="text";)l=t[++o],p+=`
|
|
65
|
+
`+this.renderer.text(l);e?i+=this.renderer.paragraph({type:"paragraph",raw:p,text:p,tokens:[{type:"text",raw:p,text:p,escaped:!0}]}):i+=p;continue}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(t,e=this.renderer){let i="";for(let o=0;o<t.length;o++){let r=t[o];if(this.options.extensions?.renderers?.[r.type]){let l=this.options.extensions.renderers[r.type].call({parser:this},r);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){i+=l||"";continue}}let a=r;switch(a.type){case"escape":{i+=e.text(a);break}case"html":{i+=e.html(a);break}case"link":{i+=e.link(a);break}case"image":{i+=e.image(a);break}case"strong":{i+=e.strong(a);break}case"em":{i+=e.em(a);break}case"codespan":{i+=e.codespan(a);break}case"br":{i+=e.br(a);break}case"del":{i+=e.del(a);break}case"text":{i+=e.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},ra=class{options;block;constructor(n){this.options=n||mo}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Si.lex:Si.lexInline}provideParser(){return this.block?ki.parse:ki.parseInline}},Zb=class{defaults=fd();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ki;Renderer=Jo;TextRenderer=Sd;Lexer=Si;Tokenizer=Ws;Hooks=ra;constructor(...n){this.use(...n)}walkTokens(n,t){let e=[];for(let i of n)switch(e=e.concat(t.call(this,i)),i.type){case"table":{let o=i;for(let r of o.header)e=e.concat(this.walkTokens(r.tokens,t));for(let r of o.rows)for(let a of r)e=e.concat(this.walkTokens(a.tokens,t));break}case"list":{let o=i;e=e.concat(this.walkTokens(o.items,t));break}default:{let o=i;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(r=>{let a=o[r].flat(1/0);e=e.concat(this.walkTokens(a,t))}):o.tokens&&(e=e.concat(this.walkTokens(o.tokens,t)))}}return e}use(...n){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(e=>{let i=q({},e);if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let r=t.renderers[o.name];r?t.renderers[o.name]=function(...a){let l=o.renderer.apply(this,a);return l===!1&&(l=r.apply(this,a)),l}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[o.level];r?r.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),i.extensions=t),e.renderer){let o=this.defaults.renderer||new Jo(this.defaults);for(let r in e.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,l=e.renderer[a],p=o[a];o[a]=(...u)=>{let b=l.apply(o,u);return b===!1&&(b=p.apply(o,u)),b||""}}i.renderer=o}if(e.tokenizer){let o=this.defaults.tokenizer||new Ws(this.defaults);for(let r in e.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,l=e.tokenizer[a],p=o[a];o[a]=(...u)=>{let b=l.apply(o,u);return b===!1&&(b=p.apply(o,u)),b}}i.tokenizer=o}if(e.hooks){let o=this.defaults.hooks||new ra;for(let r in e.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,l=e.hooks[a],p=o[a];ra.passThroughHooks.has(r)?o[a]=u=>{if(this.defaults.async&&ra.passThroughHooksRespectAsync.has(r))return ie(this,null,function*(){let C=yield l.call(o,u);return p.call(o,C)});let b=l.call(o,u);return p.call(o,b)}:o[a]=(...u)=>{if(this.defaults.async)return ie(this,null,function*(){let C=yield l.apply(o,u);return C===!1&&(C=yield p.apply(o,u)),C});let b=l.apply(o,u);return b===!1&&(b=p.apply(o,u)),b}}i.hooks=o}if(e.walkTokens){let o=this.defaults.walkTokens,r=e.walkTokens;i.walkTokens=function(a){let l=[];return l.push(r.call(this,a)),o&&(l=l.concat(o.call(this,a))),l}}this.defaults=q(q({},this.defaults),i)}),this}setOptions(n){return this.defaults=q(q({},this.defaults),n),this}lexer(n,t){return Si.lex(n,t??this.defaults)}parser(n,t){return ki.parse(n,t??this.defaults)}parseMarkdown(n){return(t,e)=>{let i=q({},e),o=q(q({},this.defaults),i),r=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return ie(this,null,function*(){let a=o.hooks?yield o.hooks.preprocess(t):t,l=yield(o.hooks?yield o.hooks.provideLexer():n?Si.lex:Si.lexInline)(a,o),p=o.hooks?yield o.hooks.processAllTokens(l):l;o.walkTokens&&(yield Promise.all(this.walkTokens(p,o.walkTokens)));let u=yield(o.hooks?yield o.hooks.provideParser():n?ki.parse:ki.parseInline)(p,o);return o.hooks?yield o.hooks.postprocess(u):u}).catch(r);try{o.hooks&&(t=o.hooks.preprocess(t));let a=(o.hooks?o.hooks.provideLexer():n?Si.lex:Si.lexInline)(t,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let l=(o.hooks?o.hooks.provideParser():n?ki.parse:ki.parseInline)(a,o);return o.hooks&&(l=o.hooks.postprocess(l)),l}catch(a){return r(a)}}}onError(n,t){return e=>{if(e.message+=`
|
|
66
|
+
Please report this to https://github.com/markedjs/marked.`,n){let i="<p>An error occurred:</p><pre>"+Ui(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},co=new Zb;function Me(n,t){return co.parse(n,t)}Me.options=Me.setOptions=function(n){return co.setOptions(n),Me.defaults=co.defaults,ou(Me.defaults),Me};Me.getDefaults=fd;Me.defaults=mo;Me.use=function(...n){return co.use(...n),Me.defaults=co.defaults,ou(Me.defaults),Me};Me.walkTokens=function(n,t){return co.walkTokens(n,t)};Me.parseInline=co.parseInline;Me.Parser=ki;Me.parser=ki.parse;Me.Renderer=Jo;Me.TextRenderer=Sd;Me.Lexer=Si;Me.lexer=Si.lex;Me.Tokenizer=Ws;Me.Hooks=ra;Me.parse=Me;var dE=Me.options,mE=Me.setOptions,hE=Me.use,pE=Me.walkTokens,uE=Me.parseInline;var gE=ki.parse,fE=Si.lex;var{entries:wu,setPrototypeOf:gu,isFrozen:Jb,getPrototypeOf:ev,getOwnPropertyDescriptor:tv}=Object,{freeze:Ht,seal:ci,create:Ad}=Object,{apply:Dd,construct:Id}=typeof Reflect<"u"&&Reflect;Ht||(Ht=function(t){return t});ci||(ci=function(t){return t});Dd||(Dd=function(t,e){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];return t.apply(e,o)});Id||(Id=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return new t(...i)});var qs=Wt(Array.prototype.forEach),iv=Wt(Array.prototype.lastIndexOf),fu=Wt(Array.prototype.pop),la=Wt(Array.prototype.push),nv=Wt(Array.prototype.splice),Ys=Wt(String.prototype.toLowerCase),kd=Wt(String.prototype.toString),Md=Wt(String.prototype.match),ca=Wt(String.prototype.replace),ov=Wt(String.prototype.indexOf),rv=Wt(String.prototype.trim),Mi=Wt(Object.prototype.hasOwnProperty),Bt=Wt(RegExp.prototype.test),da=av(TypeError);function Wt(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Dd(n,t,i)}}function av(n){return function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return Id(n,e)}}function ge(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ys;gu&&gu(n,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=e(o);r!==o&&(Jb(t)||(t[i]=r),o=r)}n[o]=!0}return n}function sv(n){for(let t=0;t<n.length;t++)Mi(n,t)||(n[t]=null);return n}function $i(n){let t=Ad(null);for(let[e,i]of wu(n))Mi(n,e)&&(Array.isArray(i)?t[e]=sv(i):i&&typeof i=="object"&&i.constructor===Object?t[e]=$i(i):t[e]=i);return t}function ma(n,t){for(;n!==null;){let i=tv(n,t);if(i){if(i.get)return Wt(i.get);if(typeof i.value=="function")return Wt(i.value)}n=ev(n)}function e(){return null}return e}var _u=Ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ed=Ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Td=Ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),lv=Ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Pd=Ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),cv=Ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bu=Ht(["#text"]),vu=Ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Od=Ht(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yu=Ht(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Gs=Ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),dv=ci(/\{\{[\w\W]*|[\w\W]*\}\}/gm),mv=ci(/<%[\w\W]*|[\w\W]*%>/gm),hv=ci(/\$\{[\w\W]*/gm),pv=ci(/^data-[\-\w.\u00B7-\uFFFF]+$/),uv=ci(/^aria-[\-\w]+$/),Su=ci(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gv=ci(/^(?:\w+script|data):/i),fv=ci(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ku=ci(/^html$/i),_v=ci(/^[a-z][.\w]*(-[.\w]+)+$/i),Cu=Object.freeze({__proto__:null,ARIA_ATTR:uv,ATTR_WHITESPACE:fv,CUSTOM_ELEMENT:_v,DATA_ATTR:pv,DOCTYPE_NAME:ku,ERB_EXPR:mv,IS_ALLOWED_URI:Su,IS_SCRIPT_OR_DATA:gv,MUSTACHE_EXPR:dv,TMPLIT_EXPR:hv}),ha={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bv=function(){return typeof window>"u"?null:window},vv=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(i=e.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},xu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Mu(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bv(),t=X=>Mu(X);if(t.version="3.3.1",t.removed=[],!n||!n.document||n.document.nodeType!==ha.document||!n.Element)return t.isSupported=!1,t;let{document:e}=n,i=e,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:l,Element:p,NodeFilter:u,NamedNodeMap:b=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:C,DOMParser:T,trustedTypes:P}=n,k=p.prototype,z=ma(k,"cloneNode"),Ce=ma(k,"remove"),Be=ma(k,"nextSibling"),Je=ma(k,"childNodes"),et=ma(k,"parentNode");if(typeof a=="function"){let X=e.createElement("template");X.content&&X.content.ownerDocument&&(e=X.content.ownerDocument)}let _e,qt="",{implementation:_t,createNodeIterator:tt,createDocumentFragment:Pt,getElementsByTagName:Zi}=e,{importNode:Sn}=i,bt=xu();t.isSupported=typeof wu=="function"&&typeof et=="function"&&_t&&_t.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ui,ERB_EXPR:qn,TMPLIT_EXPR:Mo,DATA_ATTR:Ra,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:Q,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:be}=Cu,{IS_ALLOWED_URI:lt}=Cu,Ee=null,Ot=ge({},[..._u,...Ed,...Td,...Pd,...bu]),Ne=null,Ve=ge({},[...vu,...Od,...yu,...Gs]),$e=Object.seal(Ad(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Gn=null,mt=null,Gt=Object.seal(Ad(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Nt=!0,kn=!0,Eo=!1,ym=!0,To=!1,Fa=!0,Yn=!1,ac=!1,sc=!1,Po=!1,Na=!1,Va=!1,Cm=!0,xm=!1,Rf="user-content-",lc=!0,Ar=!1,Oo={},Oi=null,cc=ge({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),wm=null,Sm=ge({},["audio","video","img","source","image","track"]),dc=null,km=ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),La="http://www.w3.org/1998/Math/MathML",ja="http://www.w3.org/2000/svg",Ji="http://www.w3.org/1999/xhtml",Ao=Ji,mc=!1,hc=null,Ff=ge({},[La,ja,Ji],kd),za=ge({},["mi","mo","mn","ms","mtext"]),Ba=ge({},["annotation-xml"]),Nf=ge({},["title","style","font","a","script"]),Dr=null,Vf=["application/xhtml+xml","text/html"],Lf="text/html",gt=null,Do=null,jf=e.createElement("form"),Mm=function(f){return f instanceof RegExp||f instanceof Function},pc=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Do&&Do===f)){if((!f||typeof f!="object")&&(f={}),f=$i(f),Dr=Vf.indexOf(f.PARSER_MEDIA_TYPE)===-1?Lf:f.PARSER_MEDIA_TYPE,gt=Dr==="application/xhtml+xml"?kd:Ys,Ee=Mi(f,"ALLOWED_TAGS")?ge({},f.ALLOWED_TAGS,gt):Ot,Ne=Mi(f,"ALLOWED_ATTR")?ge({},f.ALLOWED_ATTR,gt):Ve,hc=Mi(f,"ALLOWED_NAMESPACES")?ge({},f.ALLOWED_NAMESPACES,kd):Ff,dc=Mi(f,"ADD_URI_SAFE_ATTR")?ge($i(km),f.ADD_URI_SAFE_ATTR,gt):km,wm=Mi(f,"ADD_DATA_URI_TAGS")?ge($i(Sm),f.ADD_DATA_URI_TAGS,gt):Sm,Oi=Mi(f,"FORBID_CONTENTS")?ge({},f.FORBID_CONTENTS,gt):cc,Gn=Mi(f,"FORBID_TAGS")?ge({},f.FORBID_TAGS,gt):$i({}),mt=Mi(f,"FORBID_ATTR")?ge({},f.FORBID_ATTR,gt):$i({}),Oo=Mi(f,"USE_PROFILES")?f.USE_PROFILES:!1,Nt=f.ALLOW_ARIA_ATTR!==!1,kn=f.ALLOW_DATA_ATTR!==!1,Eo=f.ALLOW_UNKNOWN_PROTOCOLS||!1,ym=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,To=f.SAFE_FOR_TEMPLATES||!1,Fa=f.SAFE_FOR_XML!==!1,Yn=f.WHOLE_DOCUMENT||!1,Po=f.RETURN_DOM||!1,Na=f.RETURN_DOM_FRAGMENT||!1,Va=f.RETURN_TRUSTED_TYPE||!1,sc=f.FORCE_BODY||!1,Cm=f.SANITIZE_DOM!==!1,xm=f.SANITIZE_NAMED_PROPS||!1,lc=f.KEEP_CONTENT!==!1,Ar=f.IN_PLACE||!1,lt=f.ALLOWED_URI_REGEXP||Su,Ao=f.NAMESPACE||Ji,za=f.MATHML_TEXT_INTEGRATION_POINTS||za,Ba=f.HTML_INTEGRATION_POINTS||Ba,$e=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Mm(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($e.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Mm(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($e.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),To&&(kn=!1),Na&&(Po=!0),Oo&&(Ee=ge({},bu),Ne=[],Oo.html===!0&&(ge(Ee,_u),ge(Ne,vu)),Oo.svg===!0&&(ge(Ee,Ed),ge(Ne,Od),ge(Ne,Gs)),Oo.svgFilters===!0&&(ge(Ee,Td),ge(Ne,Od),ge(Ne,Gs)),Oo.mathMl===!0&&(ge(Ee,Pd),ge(Ne,yu),ge(Ne,Gs))),f.ADD_TAGS&&(typeof f.ADD_TAGS=="function"?Gt.tagCheck=f.ADD_TAGS:(Ee===Ot&&(Ee=$i(Ee)),ge(Ee,f.ADD_TAGS,gt))),f.ADD_ATTR&&(typeof f.ADD_ATTR=="function"?Gt.attributeCheck=f.ADD_ATTR:(Ne===Ve&&(Ne=$i(Ne)),ge(Ne,f.ADD_ATTR,gt))),f.ADD_URI_SAFE_ATTR&&ge(dc,f.ADD_URI_SAFE_ATTR,gt),f.FORBID_CONTENTS&&(Oi===cc&&(Oi=$i(Oi)),ge(Oi,f.FORBID_CONTENTS,gt)),f.ADD_FORBID_CONTENTS&&(Oi===cc&&(Oi=$i(Oi)),ge(Oi,f.ADD_FORBID_CONTENTS,gt)),lc&&(Ee["#text"]=!0),Yn&&ge(Ee,["html","head","body"]),Ee.table&&(ge(Ee,["tbody"]),delete Gn.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_e=f.TRUSTED_TYPES_POLICY,qt=_e.createHTML("")}else _e===void 0&&(_e=vv(P,o)),_e!==null&&typeof qt=="string"&&(qt=_e.createHTML(""));Ht&&Ht(f),Do=f}},Em=ge({},[...Ed,...Td,...lv]),Tm=ge({},[...Pd,...cv]),zf=function(f){let O=et(f);(!O||!O.tagName)&&(O={namespaceURI:Ao,tagName:"template"});let G=Ys(f.tagName),qe=Ys(O.tagName);return hc[f.namespaceURI]?f.namespaceURI===ja?O.namespaceURI===Ji?G==="svg":O.namespaceURI===La?G==="svg"&&(qe==="annotation-xml"||za[qe]):!!Em[G]:f.namespaceURI===La?O.namespaceURI===Ji?G==="math":O.namespaceURI===ja?G==="math"&&Ba[qe]:!!Tm[G]:f.namespaceURI===Ji?O.namespaceURI===ja&&!Ba[qe]||O.namespaceURI===La&&!za[qe]?!1:!Tm[G]&&(Nf[G]||!Em[G]):!!(Dr==="application/xhtml+xml"&&hc[f.namespaceURI]):!1},Ai=function(f){la(t.removed,{element:f});try{et(f).removeChild(f)}catch{Ce(f)}},Qn=function(f,O){try{la(t.removed,{attribute:O.getAttributeNode(f),from:O})}catch{la(t.removed,{attribute:null,from:O})}if(O.removeAttribute(f),f==="is")if(Po||Na)try{Ai(O)}catch{}else try{O.setAttribute(f,"")}catch{}},Pm=function(f){let O=null,G=null;if(sc)f="<remove></remove>"+f;else{let ht=Md(f,/^[\r\n\t ]+/);G=ht&&ht[0]}Dr==="application/xhtml+xml"&&Ao===Ji&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");let qe=_e?_e.createHTML(f):f;if(Ao===Ji)try{O=new T().parseFromString(qe,Dr)}catch{}if(!O||!O.documentElement){O=_t.createDocument(Ao,"template",null);try{O.documentElement.innerHTML=mc?qt:qe}catch{}}let At=O.body||O.documentElement;return f&&G&&At.insertBefore(e.createTextNode(G),At.childNodes[0]||null),Ao===Ji?Zi.call(O,Yn?"html":"body")[0]:Yn?O.documentElement:At},Om=function(f){return tt.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},uc=function(f){return f instanceof C&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof b)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Am=function(f){return typeof l=="function"&&f instanceof l};function en(X,f,O){qs(X,G=>{G.call(t,f,O,Do)})}let Dm=function(f){let O=null;if(en(bt.beforeSanitizeElements,f,null),uc(f))return Ai(f),!0;let G=gt(f.nodeName);if(en(bt.uponSanitizeElement,f,{tagName:G,allowedTags:Ee}),Fa&&f.hasChildNodes()&&!Am(f.firstElementChild)&&Bt(/<[/\w!]/g,f.innerHTML)&&Bt(/<[/\w!]/g,f.textContent)||f.nodeType===ha.progressingInstruction||Fa&&f.nodeType===ha.comment&&Bt(/<[/\w]/g,f.data))return Ai(f),!0;if(!(Gt.tagCheck instanceof Function&&Gt.tagCheck(G))&&(!Ee[G]||Gn[G])){if(!Gn[G]&&Rm(G)&&($e.tagNameCheck instanceof RegExp&&Bt($e.tagNameCheck,G)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(G)))return!1;if(lc&&!Oi[G]){let qe=et(f)||f.parentNode,At=Je(f)||f.childNodes;if(At&&qe){let ht=At.length;for(let Yt=ht-1;Yt>=0;--Yt){let tn=z(At[Yt],!0);tn.__removalCount=(f.__removalCount||0)+1,qe.insertBefore(tn,Be(f))}}}return Ai(f),!0}return f instanceof p&&!zf(f)||(G==="noscript"||G==="noembed"||G==="noframes")&&Bt(/<\/no(script|embed|frames)/i,f.innerHTML)?(Ai(f),!0):(To&&f.nodeType===ha.text&&(O=f.textContent,qs([ui,qn,Mo],qe=>{O=ca(O,qe," ")}),f.textContent!==O&&(la(t.removed,{element:f.cloneNode()}),f.textContent=O)),en(bt.afterSanitizeElements,f,null),!1)},Im=function(f,O,G){if(Cm&&(O==="id"||O==="name")&&(G in e||G in jf))return!1;if(!(kn&&!mt[O]&&Bt(Ra,O))){if(!(Nt&&Bt($,O))){if(!(Gt.attributeCheck instanceof Function&&Gt.attributeCheck(O,f))){if(!Ne[O]||mt[O]){if(!(Rm(f)&&($e.tagNameCheck instanceof RegExp&&Bt($e.tagNameCheck,f)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(f))&&($e.attributeNameCheck instanceof RegExp&&Bt($e.attributeNameCheck,O)||$e.attributeNameCheck instanceof Function&&$e.attributeNameCheck(O,f))||O==="is"&&$e.allowCustomizedBuiltInElements&&($e.tagNameCheck instanceof RegExp&&Bt($e.tagNameCheck,G)||$e.tagNameCheck instanceof Function&&$e.tagNameCheck(G))))return!1}else if(!dc[O]){if(!Bt(lt,ca(G,te,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&f!=="script"&&ov(G,"data:")===0&&wm[f])){if(!(Eo&&!Bt(Q,ca(G,te,"")))){if(G)return!1}}}}}}}return!0},Rm=function(f){return f!=="annotation-xml"&&Md(f,be)},Fm=function(f){en(bt.beforeSanitizeAttributes,f,null);let{attributes:O}=f;if(!O||uc(f))return;let G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne,forceKeepAttr:void 0},qe=O.length;for(;qe--;){let At=O[qe],{name:ht,namespaceURI:Yt,value:tn}=At,Io=gt(ht),gc=tn,St=ht==="value"?gc:rv(gc);if(G.attrName=Io,G.attrValue=St,G.keepAttr=!0,G.forceKeepAttr=void 0,en(bt.uponSanitizeAttribute,f,G),St=G.attrValue,xm&&(Io==="id"||Io==="name")&&(Qn(ht,f),St=Rf+St),Fa&&Bt(/((--!?|])>)|<\/(style|title|textarea)/i,St)){Qn(ht,f);continue}if(Io==="attributename"&&Md(St,"href")){Qn(ht,f);continue}if(G.forceKeepAttr)continue;if(!G.keepAttr){Qn(ht,f);continue}if(!ym&&Bt(/\/>/i,St)){Qn(ht,f);continue}To&&qs([ui,qn,Mo],Vm=>{St=ca(St,Vm," ")});let Nm=gt(f.nodeName);if(!Im(Nm,Io,St)){Qn(ht,f);continue}if(_e&&typeof P=="object"&&typeof P.getAttributeType=="function"&&!Yt)switch(P.getAttributeType(Nm,Io)){case"TrustedHTML":{St=_e.createHTML(St);break}case"TrustedScriptURL":{St=_e.createScriptURL(St);break}}if(St!==gc)try{Yt?f.setAttributeNS(Yt,ht,St):f.setAttribute(ht,St),uc(f)?Ai(f):fu(t.removed)}catch{Qn(ht,f)}}en(bt.afterSanitizeAttributes,f,null)},Bf=function X(f){let O=null,G=Om(f);for(en(bt.beforeSanitizeShadowDOM,f,null);O=G.nextNode();)en(bt.uponSanitizeShadowNode,O,null),Dm(O),Fm(O),O.content instanceof r&&X(O.content);en(bt.afterSanitizeShadowDOM,f,null)};return t.sanitize=function(X){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,G=null,qe=null,At=null;if(mc=!X,mc&&(X="<!-->"),typeof X!="string"&&!Am(X))if(typeof X.toString=="function"){if(X=X.toString(),typeof X!="string")throw da("dirty is not a string, aborting")}else throw da("toString is not a function");if(!t.isSupported)return X;if(ac||pc(f),t.removed=[],typeof X=="string"&&(Ar=!1),Ar){if(X.nodeName){let tn=gt(X.nodeName);if(!Ee[tn]||Gn[tn])throw da("root node is forbidden and cannot be sanitized in-place")}}else if(X instanceof l)O=Pm("<!---->"),G=O.ownerDocument.importNode(X,!0),G.nodeType===ha.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?O=G:O.appendChild(G);else{if(!Po&&!To&&!Yn&&X.indexOf("<")===-1)return _e&&Va?_e.createHTML(X):X;if(O=Pm(X),!O)return Po?null:Va?qt:""}O&&sc&&Ai(O.firstChild);let ht=Om(Ar?X:O);for(;qe=ht.nextNode();)Dm(qe),Fm(qe),qe.content instanceof r&&Bf(qe.content);if(Ar)return X;if(Po){if(Na)for(At=Pt.call(O.ownerDocument);O.firstChild;)At.appendChild(O.firstChild);else At=O;return(Ne.shadowroot||Ne.shadowrootmode)&&(At=Sn.call(i,At,!0)),At}let Yt=Yn?O.outerHTML:O.innerHTML;return Yn&&Ee["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&Bt(ku,O.ownerDocument.doctype.name)&&(Yt="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
|
|
67
|
+
`+Yt),To&&qs([ui,qn,Mo],tn=>{Yt=ca(Yt,tn," ")}),_e&&Va?_e.createHTML(Yt):Yt},t.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pc(X),ac=!0},t.clearConfig=function(){Do=null,ac=!1},t.isValidAttribute=function(X,f,O){Do||pc({});let G=gt(X),qe=gt(f);return Im(G,qe,O)},t.addHook=function(X,f){typeof f=="function"&&la(bt[X],f)},t.removeHook=function(X,f){if(f!==void 0){let O=iv(bt[X],f);return O===-1?void 0:nv(bt[X],O,1)[0]}return fu(bt[X])},t.removeHooks=function(X){bt[X]=[]},t.removeAllHooks=function(){bt=xu()},t}var Eu=Mu();var qi=class n{renderer;constructor(){this.renderer=new Jo,this.configureRenderer()}configureRenderer(){let t=this.renderer.link.bind(this.renderer);this.renderer.link=e=>{let i=this.isExternalLink(e.href),o=t(e);if(i){o=o.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ');let r=e.title?`${e.text} - ${e.title} (opens in new tab)`:`${e.text} (opens in new tab)`;o=o.replace("<a ",`<a aria-label="${this.escapeHtml(r)}" `),o=o.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return o}}isExternalLink(t){if(!t||t.startsWith("/")||t.startsWith("#")||t.startsWith("?"))return!1;if(t.startsWith("//"))return!0;try{return new URL(t,window.location.href).hostname!==window.location.hostname}catch{return!1}}escapeHtml(t){let e={"&":"&","<":"<",">":">",'"':""","'":"'"};return t.replace(/[&<>"']/g,i=>e[i]||i)}parse(t){return ie(this,null,function*(){let e=yield Me.parse(t,{renderer:this.renderer,breaks:!0,gfm:!0});return Eu.sanitize(e,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var yv=["buttonContainer"],Cv=(n,t)=>t.value;function xv(n,t){n&1&&(s(0,"mat-icon",8),h(1,"keyboard_return"),c())}function wv(n,t){if(n&1){let e=E();s(0,"button",6),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.onOptionClick(o.value))}),s(1,"span",7),h(2),c(),w(3,xv,2,0,"mat-icon",8),c()}if(n&2){let e=t.$implicit,i=t.$index,o=g(2);A("highlighted",i===o.highlightedIndex),x("disabled",e.disabled)("id","choice-option-"+i),Y("aria-selected",i===o.highlightedIndex),m(2),B(e.label),m(),S(i===o.highlightedIndex?3:-1)}}function Sv(n,t){if(n&1&&(s(0,"div",5)(1,"mat-icon"),h(2,"search"),c(),s(3,"span"),h(4),c()()),n&2){let e=g(2);m(4),B(e.searchText)}}function kv(n,t){if(n&1){let e=E();s(0,"div",1),F(1,"div",2),to(2,"async"),s(3,"div",3,0),_("keydown",function(o){v(e);let r=g();return y(r.onKeyDown(o))}),Oe(5,wv,4,7,"button",4,Cv),c(),w(7,Sv,5,1,"div",5),c()}if(n&2){let e=g();m(),x("innerHTML",rh(2,3,e.renderedLabel$),Jt),m(2),Y("aria-activedescendant","choice-option-"+e.highlightedIndex),m(2),Ae(e.options),m(2),S(e.searchText?7:-1)}}var er=class n{options=[];set labelHtml(t){typeof t=="object"?this.renderedLabelSubject.next(t):this.renderLabelMarkdown(t)}isVisible=!1;choiceSelected=new H;buttonContainer;highlightedIndex=0;searchText="";searchTimeout;destroy$=new D;renderedLabelSubject=new se("");renderedLabel$=this.renderedLabelSubject.asObservable();sanitizer=d(Ni);markdownService=d(qi);ngOnDestroy(){this.renderedLabelSubject.complete(),this.destroy$.next(),this.destroy$.complete(),this.searchTimeout&&clearTimeout(this.searchTimeout)}ngAfterViewInit(){this.isVisible&&this.buttonContainer&&setTimeout(()=>this.focusContainer(),100)}ngOnChanges(t){t.isVisible&&(console.log("[CHOICE-SELECT] isVisible changed:",t.isVisible.previousValue,"->",t.isVisible.currentValue),t.isVisible.currentValue&&!t.isVisible.previousValue&&(console.log("[CHOICE-SELECT] Component becoming visible, setting focus..."),this.highlightedIndex=0,setTimeout(()=>this.focusContainer(),150))),t.options&&!t.options.firstChange&&(this.highlightedIndex=0)}focusContainer(){this.buttonContainer?.nativeElement&&(this.buttonContainer.nativeElement.focus(),console.log("[CHOICE-SELECT] Focus set on button container"))}onKeyDown(t){if(this.options.filter(i=>!i.disabled).length!==0)switch(t.key){case"ArrowDown":t.preventDefault(),this.moveHighlight(1);break;case"ArrowUp":t.preventDefault(),this.moveHighlight(-1);break;case"Enter":case" ":t.preventDefault(),this.selectHighlighted();break;case"Home":t.preventDefault(),this.highlightFirst();break;case"End":t.preventDefault(),this.highlightLast();break;case"Escape":t.preventDefault();break;default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&this.handleTypeAhead(t.key);break}}moveHighlight(t){let e=this.options.map((r,a)=>({opt:r,idx:a})).filter(({opt:r})=>!r.disabled).map(({idx:r})=>r);if(e.length===0)return;let o=e.findIndex(r=>r===this.highlightedIndex)+t;if(o>=0&&o<e.length){let r=e[o];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===1&&o>=e.length){let r=e[0];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}else if(t===-1&&o<0){let r=e[e.length-1];r!==void 0&&(this.highlightedIndex=r,this.scrollToHighlighted())}}highlightFirst(){let t=this.options.findIndex(e=>!e.disabled);t>=0&&(this.highlightedIndex=t,this.scrollToHighlighted())}highlightLast(){let t=this.options.map((e,i)=>({opt:e,idx:i})).filter(({opt:e})=>!e.disabled).map(({idx:e})=>e);if(t.length>0){let e=t[t.length-1];e!==void 0&&(this.highlightedIndex=e,this.scrollToHighlighted())}}scrollToHighlighted(){setTimeout(()=>{let t=document.getElementById("choice-option-"+this.highlightedIndex);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})},0)}selectHighlighted(){let t=this.options[this.highlightedIndex];t&&!t.disabled&&this.onOptionClick(t.value)}handleTypeAhead(t){this.searchText+=t.toLowerCase();let e=this.options.findIndex(i=>!i.disabled&&i.label.toLowerCase().startsWith(this.searchText));e>=0&&(this.highlightedIndex=e,this.scrollToHighlighted()),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchText=""},1e3)}onOptionClick(t){console.log("[CHOICE-SELECT] Choice selected:",t),this.choiceSelected.emit(t)}renderLabelMarkdown(t){return ie(this,null,function*(){if(!t){this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(""));return}try{let e=yield this.markdownService.parse(t);this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(e))}catch(e){console.error("[CHOICE-SELECT] Error parsing label markdown:",e),this.renderedLabelSubject.next(this.sanitizer.bypassSecurityTrustHtml(t))}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-choice-select"]],viewQuery:function(e,i){if(e&1&&ne(yv,5),e&2){let o;W(o=U())&&(i.buttonContainer=o.first)}},inputs:{options:"options",labelHtml:"labelHtml",isVisible:"isVisible"},outputs:{choiceSelected:"choiceSelected"},features:[Le],decls:1,vars:1,consts:[["buttonContainer",""],[1,"choice-container"],[1,"choice-label",3,"innerHTML"],["role","listbox","tabindex","0",1,"choice-buttons",3,"keydown"],["type","button","role","option",1,"choice-button",3,"highlighted","disabled","id"],[1,"search-indicator"],["type","button","role","option",1,"choice-button",3,"click","disabled","id"],[1,"choice-button-label"],[1,"choice-button-icon"]],template:function(e,i){e&1&&w(0,kv,8,5,"div",1),e&2&&S(i.isVisible?0:-1)},dependencies:[Qe,xe,mh],styles:[".choice-container[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem}.choice-label[_ngcontent-%COMP%]{display:block;font-weight:500;color:var(--color-text);font-size:1rem;line-height:1.5}.choice-label[_ngcontent-%COMP%] p{margin:0 0 .5rem}.choice-label[_ngcontent-%COMP%] p:last-child{margin-bottom:0}.choice-label[_ngcontent-%COMP%] code{background:var(--color-code-bg);padding:.2em .4em;border-radius:4px;font-family:monospace;font-size:.9em}.choice-label[_ngcontent-%COMP%] strong{font-weight:600}.choice-buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-height:400px;overflow-y:auto;padding:.5rem;background:var(--color-background);border:2px solid var(--color-border);border-radius:12px;outline:none}.choice-buttons[_ngcontent-%COMP%]:focus-within{border-color:var(--color-primary);box-shadow:0 0 0 3px #007aff1a}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:var(--color-background);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.choice-buttons[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.choice-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.75rem 1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-background);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;font-size:1rem;text-align:left;cursor:pointer;transition:all .2s ease}.choice-button[_ngcontent-%COMP%]:hover:not(:disabled):not(.highlighted){background:var(--color-bg-hover);border-color:var(--color-primary);transform:translate(2px)}.choice-button.highlighted[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff;border-color:var(--color-primary);box-shadow:0 2px 8px #007aff4d}.choice-button.highlighted[_ngcontent-%COMP%] .choice-button-icon[_ngcontent-%COMP%]{color:#fff}.choice-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.choice-button[_ngcontent-%COMP%]:focus{outline:none}.choice-button-label[_ngcontent-%COMP%]{flex:1;line-height:1.5}.choice-button-icon[_ngcontent-%COMP%]{flex-shrink:0;margin-left:.5rem;font-size:1.2rem;width:1.2rem;height:1.2rem}.search-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:var(--color-primary);color:#fff;border-radius:8px;font-size:.9rem;font-weight:500;animation:_ngcontent-%COMP%_fadeIn .2s ease}.search-indicator[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:#fff}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 480px){.choice-container[_ngcontent-%COMP%]{gap:.75rem}.choice-label[_ngcontent-%COMP%]{font-size:.95rem}.choice-buttons[_ngcontent-%COMP%]{max-height:300px;gap:.375rem}.choice-button[_ngcontent-%COMP%]{font-size:.95rem;padding:.625rem .875rem}}@media print{.choice-buttons[_ngcontent-%COMP%]{max-height:none;overflow:visible}.search-indicator[_ngcontent-%COMP%]{display:none!important}}"]})};var tr=class n{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(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(e,i){e&1&&(ri(0,"h1",0),h(1),ai()),e&2&&(m(),B(i.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(2.5rem,6vw,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:inline-block;min-height:1.2em}@media (max-width: 768px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(2rem,5vw,3rem)}}@media (max-width: 480px){.welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,2rem)}}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var Nu=(()=>{class n{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||n)(Pe(ot),Pe(K))};static \u0275dir=Z({type:n})}return n})(),po=(()=>{class n extends Nu{static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,features:[ye]})}return n})(),Kt=new ee(""),Mv={provide:Kt,useExisting:at(()=>Nd),multi:!0},Nd=(()=>{class n extends po{writeValue(e){this.setProperty("checked",e)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(i,o){i&1&&_("change",function(a){return o.onChange(a.target.checked)})("blur",function(){return o.onTouched()})},standalone:!1,features:[pe([Mv]),ye]})}return n})(),Ev={provide:Kt,useExisting:at(()=>ze),multi:!0};function Tv(){let n=Cc()?Cc().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var Pv=new ee(""),ze=(()=>{class n extends Nu{_compositionMode;_composing=!1;constructor(e,i,o){super(e,i),this._compositionMode=o,this._compositionMode==null&&(this._compositionMode=!Tv())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||n)(Pe(ot),Pe(K),Pe(Pv,8))};static \u0275dir=Z({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,o){i&1&&_("input",function(a){return o._handleInput(a.target.value)})("blur",function(){return o.onTouched()})("compositionstart",function(){return o._compositionStart()})("compositionend",function(a){return o._compositionEnd(a.target.value)})},standalone:!1,features:[pe([Ev]),ye]})}return n})();function Vd(n){return n==null||Ld(n)===0}function Ld(n){return n==null?null:Array.isArray(n)||typeof n=="string"?n.length:n instanceof Set?n.size:null}var Ti=new ee(""),jd=new ee(""),Ov=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,or=class{static min(t){return Vu(t)}static max(t){return Lu(t)}static required(t){return ju(t)}static requiredTrue(t){return Av(t)}static email(t){return Dv(t)}static minLength(t){return Iv(t)}static maxLength(t){return zu(t)}static pattern(t){return Rv(t)}static nullValidator(t){return Xs()}static compose(t){return qu(t)}static composeAsync(t){return Gu(t)}};function Vu(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e<n?{min:{min:n,actual:t.value}}:null}}function Lu(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e>n?{max:{max:n,actual:t.value}}:null}}function ju(n){return Vd(n.value)?{required:!0}:null}function Av(n){return n.value===!0?null:{required:!0}}function Dv(n){return Vd(n.value)||Ov.test(n.value)?null:{email:!0}}function Iv(n){return t=>{let e=t.value?.length??Ld(t.value);return e===null||e===0?null:e<n?{minlength:{requiredLength:n,actualLength:e}}:null}}function zu(n){return t=>{let e=t.value?.length??Ld(t.value);return e!==null&&e>n?{maxlength:{requiredLength:n,actualLength:e}}:null}}function Rv(n){if(!n)return Xs;let t,e;return typeof n=="string"?(e="",n.charAt(0)!=="^"&&(e+="^"),e+=n,n.charAt(n.length-1)!=="$"&&(e+="$"),t=new RegExp(e)):(e=n.toString(),t=n),i=>{if(Vd(i.value))return null;let o=i.value;return t.test(o)?null:{pattern:{requiredPattern:e,actualValue:o}}}}function Xs(n){return null}function Bu(n){return n!=null}function Hu(n){return th(n)?zm(n):n}function Wu(n){let t={};return n.forEach(e=>{t=e!=null?q(q({},t),e):t}),Object.keys(t).length===0?null:t}function Uu(n,t){return t.map(e=>e(n))}function Fv(n){return!n.validate}function $u(n){return n.map(t=>Fv(t)?t:e=>t.validate(e))}function qu(n){if(!n)return null;let t=n.filter(Bu);return t.length==0?null:function(e){return Wu(Uu(e,t))}}function zd(n){return n!=null?qu($u(n)):null}function Gu(n){if(!n)return null;let t=n.filter(Bu);return t.length==0?null:function(e){let i=Uu(e,t).map(Hu);return Wm(i).pipe(ve(Wu))}}function Bd(n){return n!=null?Gu($u(n)):null}function Tu(n,t){return n===null?[t]:Array.isArray(n)?[...n,t]:[n,t]}function Yu(n){return n._rawValidators}function Qu(n){return n._rawAsyncValidators}function Rd(n){return n?Array.isArray(n)?n:[n]:[]}function Ks(n,t){return Array.isArray(n)?n.includes(t):n===t}function Pu(n,t){let e=Rd(t);return Rd(n).forEach(o=>{Ks(e,o)||e.push(o)}),e}function Ou(n,t){return Rd(t).filter(e=>!Ks(n,e))}var Zs=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=zd(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=Bd(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},ho=class extends Zs{name;get formDirective(){return null}get path(){return null}},Gi=class extends Zs{_parent=null;name=null;valueAccessor=null},Fd=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},Nv={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},pT=Ie(q({},Nv),{"[class.ng-submitted]":"isSubmitted"}),Xe=(()=>{class n extends Fd{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(Pe(Gi,2))};static \u0275dir=Z({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,o){i&2&&A("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)},standalone:!1,features:[ye]})}return n})();var pa="VALID",Qs="INVALID",ir="PENDING",ua="DISABLED",Bn=class{},Js=class extends Bn{value;source;constructor(t,e){super(),this.value=t,this.source=e}},fa=class extends Bn{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},_a=class extends Bn{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},nr=class extends Bn{status;source;constructor(t,e){super(),this.status=t,this.source=e}},el=class extends Bn{source;constructor(t){super(),this.source=t}},tl=class extends Bn{source;constructor(t){super(),this.source=t}};function Xu(n){return(sl(n)?n.validators:n)||null}function Vv(n){return Array.isArray(n)?zd(n):n||null}function Ku(n,t){return(sl(t)?t.asyncValidators:n)||null}function Lv(n){return Array.isArray(n)?Bd(n):n||null}function sl(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function jv(n,t,e){let i=n.controls;if(!(t?Object.keys(i):i).length)throw new de(1e3,"");if(!i[e])throw new de(1001,"")}function zv(n,t,e){n._forEachChild((i,o)=>{if(e[o]===void 0)throw new de(1002,"")})}var il=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return fi(this.statusReactive)}set status(t){fi(()=>this.statusReactive.set(t))}_status=ft(()=>this.statusReactive());statusReactive=Te(void 0);get valid(){return this.status===pa}get invalid(){return this.status===Qs}get pending(){return this.status==ir}get disabled(){return this.status===ua}get enabled(){return this.status!==ua}errors;get pristine(){return fi(this.pristineReactive)}set pristine(t){fi(()=>this.pristineReactive.set(t))}_pristine=ft(()=>this.pristineReactive());pristineReactive=Te(!0);get dirty(){return!this.pristine}get touched(){return fi(this.touchedReactive)}set touched(t){fi(()=>this.touchedReactive.set(t))}_touched=ft(()=>this.touchedReactive());touchedReactive=Te(!1);get untouched(){return!this.touched}_events=new D;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(Pu(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(Pu(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(Ou(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(Ou(t,this._rawAsyncValidators))}hasValidator(t){return Ks(this._rawValidators,t)}hasAsyncValidator(t){return Ks(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched(Ie(q({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new _a(!0,i))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=t.sourceControl??this;this._forEachChild(o=>{o.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:i})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,i),e&&t.emitEvent!==!1&&this._events.next(new _a(!1,i))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty(Ie(q({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new fa(!1,i))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=t.sourceControl??this;this._forEachChild(o=>{o.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,i),e&&t.emitEvent!==!1&&this._events.next(new fa(!0,i))}markAsPending(t={}){this.status=ir;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new nr(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending(Ie(q({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=ua,this.errors=null,this._forEachChild(o=>{o.disable(Ie(q({},t),{onlySelf:!0}))}),this._updateValue();let i=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Js(this.value,i)),this._events.next(new nr(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Ie(q({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(o=>o(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=pa,this._forEachChild(i=>{i.enable(Ie(q({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Ie(q({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(t,e){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===pa||this.status===ir)&&this._runAsyncValidator(i,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Js(this.value,e)),this._events.next(new nr(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(Ie(q({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ua:pa}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=ir,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let i=Hu(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(o=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(o,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,o)=>i&&i._find(o),this)}getError(t,e){let i=e?this.get(e):this;return i&&i.errors?i.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new nr(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,i)}_initObservables(){this.valueChanges=new H,this.statusChanges=new H}_calculateStatus(){return this._allControlsDisabled()?ua:this.errors?Qs:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(ir)?ir:this._anyControlsHaveStatus(Qs)?Qs:pa}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let i=!this._anyControlsDirty(),o=this.pristine!==i;this.pristine=i,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,e),o&&this._events.next(new fa(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new _a(this.touched,e)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){sl(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){let e=this._parent&&this._parent.dirty;return!t&&!!e&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=Vv(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=Lv(this._rawAsyncValidators)}},nl=class extends il{constructor(t,e,i){super(Xu(e),Ku(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,i={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,i={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){zv(this,!0,t),Object.keys(t).forEach(i=>{jv(this,!0,i),this.controls[i].setValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(i=>{let o=this.controls[i];o&&o.patchValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((i,o)=>{i.reset(t?t[o]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new tl(this))}getRawValue(){return this._reduceChildren({},(t,e,i)=>(t[i]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,i)=>i._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&t(i,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&t(i))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,i,o)=>((i.enabled||this.disabled)&&(e[o]=i.value),e))}_reduceChildren(t,e){let i=t;return this._forEachChild((o,r)=>{i=e(i,o,r)}),i}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var ba=new ee("",{providedIn:"root",factory:()=>ll}),ll="always";function Bv(n,t){return[...t.path,n]}function ol(n,t,e=ll){Hd(n,t),t.valueAccessor.writeValue(n.value),(n.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(n.disabled),Wv(n,t),$v(n,t),Uv(n,t),Hv(n,t)}function Au(n,t,e=!0){let i=()=>{};t.valueAccessor&&(t.valueAccessor.registerOnChange(i),t.valueAccessor.registerOnTouched(i)),al(n,t),n&&(t._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function rl(n,t){n.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function Hv(n,t){if(t.valueAccessor.setDisabledState){let e=i=>{t.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(e),t._registerOnDestroy(()=>{n._unregisterOnDisabledChange(e)})}}function Hd(n,t){let e=Yu(n);t.validator!==null?n.setValidators(Tu(e,t.validator)):typeof e=="function"&&n.setValidators([e]);let i=Qu(n);t.asyncValidator!==null?n.setAsyncValidators(Tu(i,t.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let o=()=>n.updateValueAndValidity();rl(t._rawValidators,o),rl(t._rawAsyncValidators,o)}function al(n,t){let e=!1;if(n!==null){if(t.validator!==null){let o=Yu(n);if(Array.isArray(o)&&o.length>0){let r=o.filter(a=>a!==t.validator);r.length!==o.length&&(e=!0,n.setValidators(r))}}if(t.asyncValidator!==null){let o=Qu(n);if(Array.isArray(o)&&o.length>0){let r=o.filter(a=>a!==t.asyncValidator);r.length!==o.length&&(e=!0,n.setAsyncValidators(r))}}}let i=()=>{};return rl(t._rawValidators,i),rl(t._rawAsyncValidators,i),e}function Wv(n,t){t.valueAccessor.registerOnChange(e=>{n._pendingValue=e,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&Zu(n,t)})}function Uv(n,t){t.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&Zu(n,t),n.updateOn!=="submit"&&n.markAsTouched()})}function Zu(n,t){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function $v(n,t){let e=(i,o)=>{t.valueAccessor.writeValue(i),o&&t.viewToModelUpdate(i)};n.registerOnChange(e),t._registerOnDestroy(()=>{n._unregisterOnChange(e)})}function Ju(n,t){n==null,Hd(n,t)}function qv(n,t){return al(n,t)}function Gv(n,t){if(!n.hasOwnProperty("model"))return!1;let e=n.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function Yv(n){return Object.getPrototypeOf(n.constructor)===po}function eg(n,t){n._syncPendingControls(),t.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function Qv(n,t){if(!t)return null;Array.isArray(t);let e,i,o;return t.forEach(r=>{r.constructor===ze?e=r:Yv(r)?i=r:o=r}),o||i||e||null}function Xv(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}var Kv={provide:ho,useExisting:at(()=>va)},ga=Promise.resolve(),va=(()=>{class n extends ho{callSetDisabledState;get submitted(){return fi(this.submittedReactive)}_submitted=ft(()=>this.submittedReactive());submittedReactive=Te(!1);_directives=new Set;form;ngSubmit=new H;options;constructor(e,i,o){super(),this.callSetDisabledState=o,this.form=new nl({},zd(e),Bd(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){ga.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),ol(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){ga.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){ga.then(()=>{let i=this._findContainer(e.path),o=new nl({});Ju(o,e),i.registerControl(e.name,o),o.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){ga.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){ga.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),eg(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new el(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||n)(Pe(Ti,10),Pe(jd,10),Pe(ba,8))};static \u0275dir=Z({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,o){i&1&&_("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[pe([Kv]),ye]})}return n})();function Du(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}function Iu(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var tg=class extends il{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,i){super(Xu(e),Ku(i,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),sl(e)&&(e.nonNullable||e.initialValueIsDefault)&&(Iu(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new tl(this))}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Du(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Du(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){Iu(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var Zv=n=>n instanceof tg;var Jv={provide:Gi,useExisting:at(()=>Ue)},Ru=Promise.resolve(),Ue=(()=>{class n extends Gi{_changeDetectorRef;callSetDisabledState;control=new tg;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new H;constructor(e,i,o,r,a,l){super(),this._changeDetectorRef=a,this.callSetDisabledState=l,this._parent=e,this._setValidators(i),this._setAsyncValidators(o),this.valueAccessor=Qv(this,r)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Gv(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){ol(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){Ru.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,o=i!==0&&J(i);Ru.then(()=>{o&&!this.control.disabled?this.control.disable():!o&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Bv(e,this._parent):[e]}static \u0275fac=function(i){return new(i||n)(Pe(ho,9),Pe(Ti,10),Pe(jd,10),Pe(Kt,10),Pe(Re,8),Pe(ba,8))};static \u0275dir=Z({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[pe([Jv]),ye,Le]})}return n})();var e0={provide:Kt,useExisting:at(()=>ya),multi:!0},ya=(()=>{class n extends po{writeValue(e){let i=e??"";this.setProperty("value",i)}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(i,o){i&1&&_("input",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},standalone:!1,features:[pe([e0]),ye]})}return n})(),t0={provide:Kt,useExisting:at(()=>uo),multi:!0};var i0=(()=>{class n{_accessors=[];add(e,i){this._accessors.push([e,i])}remove(e){for(let i=this._accessors.length-1;i>=0;--i)if(this._accessors[i][1]===e){this._accessors.splice(i,1);return}}select(e){this._accessors.forEach(i=>{this._isSameGroup(i,e)&&i[1]!==e&&i[1].fireUncheck(e.value)})}_isSameGroup(e,i){return e[0].control?e[0]._parent===i._control._parent&&e[1].name===i.name:!1}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),uo=(()=>{class n extends po{_registry;_injector;_state;_control;_fn;setDisabledStateFired=!1;onChange=()=>{};name;formControlName;value;callSetDisabledState=d(ba,{optional:!0})??ll;constructor(e,i,o,r){super(e,i),this._registry=o,this._injector=r}ngOnInit(){this._control=this._injector.get(Gi),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this.setProperty("checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}setDisabledState(e){(this.setDisabledStateFired||e||this.callSetDisabledState==="whenDisabledForLegacyCode")&&this.setProperty("disabled",e),this.setDisabledStateFired=!0}fireUncheck(e){this.writeValue(e)}_checkName(){this.name&&this.formControlName&&(this.name,this.formControlName),!this.name&&this.formControlName&&(this.name=this.formControlName)}static \u0275fac=function(i){return new(i||n)(Pe(ot),Pe(K),Pe(i0),Pe(fe))};static \u0275dir=Z({type:n,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(i,o){i&1&&_("change",function(){return o.onChange()})("blur",function(){return o.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},standalone:!1,features:[pe([t0]),ye]})}return n})(),n0={provide:Kt,useExisting:at(()=>Wd),multi:!0},Wd=(()=>{class n extends po{writeValue(e){this.setProperty("value",parseFloat(e))}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(i,o){i&1&&_("change",function(a){return o.onChange(a.target.value)})("input",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},standalone:!1,features:[pe([n0]),ye]})}return n})();var o0={provide:ho,useExisting:at(()=>Ca)},Ca=(()=>{class n extends ho{callSetDisabledState;get submitted(){return fi(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=ft(()=>this._submittedReactive());_submittedReactive=Te(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new H;constructor(e,i,o){super(),this.callSetDisabledState=o,this._setValidators(e),this._setAsyncValidators(i)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(al(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){let i=this.form.get(e.path);return ol(i,e,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),i}getControl(e){return this.form.get(e.path)}removeControl(e){Au(e.control||null,e,!1),Xv(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,i){this.form.get(e.path).setValue(i)}onSubmit(e){return this._submittedReactive.set(!0),eg(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new el(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0,i={}){this.form.reset(e,i),this._submittedReactive.set(!1)}_updateDomValue(){this.directives.forEach(e=>{let i=e.control,o=this.form.get(e.path);i!==o&&(Au(i||null,e),Zv(o)&&(ol(o,e,this.callSetDisabledState),e.control=o))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let i=this.form.get(e.path);Ju(i,e),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){let i=this.form.get(e.path);i&&qv(i,e)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Hd(this.form,this),this._oldForm&&al(this._oldForm,this)}static \u0275fac=function(i){return new(i||n)(Pe(Ti,10),Pe(jd,10),Pe(ba,8))};static \u0275dir=Z({type:n,selectors:[["","formGroup",""]],hostBindings:function(i,o){i&1&&_("submit",function(a){return o.onSubmit(a)})("reset",function(){return o.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[pe([o0]),ye,Le]})}return n})();var r0={provide:Kt,useExisting:at(()=>cl),multi:!0};function ig(n,t){return n==null?`${t}`:(t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function a0(n){return n.split(":")[0]}var cl=(()=>{class n extends po{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;appRefInjector=d(Fr).injector;destroyRef=d(Kn);cdr=d(Re);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,Et({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(e){this.cdr.markForCheck(),this.value=e;let i=this._getOptionId(e),o=ig(i,e);this.setProperty("value",o)}registerOnChange(e){this.onChange=i=>{this.value=this._getOptionValue(i),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),e))return i;return null}_getOptionValue(e){let i=a0(e);return this._optionMap.has(i)?this._optionMap.get(i):e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,o){i&1&&_("change",function(a){return o.onChange(a.target.value)})("blur",function(){return o.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[pe([r0]),ye]})}return n})(),dl=(()=>{class n{_element;_renderer;_select;id;constructor(e,i,o){this._element=e,this._renderer=i,this._select=o,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(ig(this.id,e)),this._select._writeValueAfterRender())}set value(e){this._setElementValue(e),this._select&&this._select._writeValueAfterRender()}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select._writeValueAfterRender())}static \u0275fac=function(i){return new(i||n)(Pe(K),Pe(ot),Pe(cl,9))};static \u0275dir=Z({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),s0={provide:Kt,useExisting:at(()=>ng),multi:!0};function Fu(n,t){return n==null?`${t}`:(typeof t=="string"&&(t=`'${t}'`),t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function l0(n){return n.split(":")[0]}var ng=(()=>{class n extends po{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;writeValue(e){this.value=e;let i;if(Array.isArray(e)){let o=e.map(r=>this._getOptionId(r));i=(r,a)=>{r._setSelected(o.indexOf(a.toString())>-1)}}else i=(o,r)=>{o._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(e){this.onChange=i=>{let o=[],r=i.selectedOptions;if(r!==void 0){let a=r;for(let l=0;l<a.length;l++){let p=a[l],u=this._getOptionValue(p.value);o.push(u)}}else{let a=i.options;for(let l=0;l<a.length;l++){let p=a[l];if(p.selected){let u=this._getOptionValue(p.value);o.push(u)}}}this.value=o,e(o)}}_registerOption(e){let i=(this._idCounter++).toString();return this._optionMap.set(i,e),i}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,e))return i;return null}_getOptionValue(e){let i=l0(e);return this._optionMap.has(i)?this._optionMap.get(i)._value:e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,o){i&1&&_("change",function(a){return o.onChange(a.target)})("blur",function(){return o.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[pe([s0]),ye]})}return n})(),ml=(()=>{class n{_element;_renderer;_select;id;_value;constructor(e,i,o){this._element=e,this._renderer=i,this._select=o,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(Fu(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(Fu(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(Pe(K),Pe(ot),Pe(ng,9))};static \u0275dir=Z({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();function c0(n){return typeof n=="number"?n:parseInt(n,10)}function og(n){return typeof n=="number"?n:parseFloat(n)}var hl=(()=>{class n{_validator=Xs;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let i=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(i),this._validator=this._enabled?this.createValidator(i):Xs,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,features:[Le]})}return n})(),d0={provide:Ti,useExisting:at(()=>Ud),multi:!0},Ud=(()=>{class n extends hl{max;inputName="max";normalizeInput=e=>og(e);createValidator=e=>Lu(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&Y("max",o._enabled?o.max:null)},inputs:{max:"max"},standalone:!1,features:[pe([d0]),ye]})}return n})(),m0={provide:Ti,useExisting:at(()=>xa),multi:!0},xa=(()=>{class n extends hl{min;inputName="min";normalizeInput=e=>og(e);createValidator=e=>Vu(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&Y("min",o._enabled?o.min:null)},inputs:{min:"min"},standalone:!1,features:[pe([m0]),ye]})}return n})(),h0={provide:Ti,useExisting:at(()=>go),multi:!0};var go=(()=>{class n extends hl{required;inputName="required";normalizeInput=J;createValidator=e=>ju;enabled(e){return e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(i,o){i&2&&Y("required",o._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[pe([h0]),ye]})}return n})();var p0={provide:Ti,useExisting:at(()=>$d),multi:!0},$d=(()=>{class n extends hl{maxlength;inputName="maxlength";normalizeInput=e=>c0(e);createValidator=e=>zu(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275dir=Z({type:n,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(i,o){i&2&&Y("maxlength",o._enabled?o.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[pe([p0]),ye]})}return n})();var u0=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({})}return n})();var Ke=(()=>{class n{static withConfig(e){return{ngModule:n,providers:[{provide:ba,useValue:e.callSetDisabledState??ll}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[u0]})}return n})();var g0=["inputElement"];function f0(n,t){if(n&1&&(s(0,"span",3),h(1),c()),n&2){let e=g();m(),B(e.label)}}function _0(n,t){if(n&1&&(s(0,"small",5),h(1),c()),n&2){let e=g();m(),B(e.hint)}}var pl=class n{label="";placeholder="";hint="";isDisabled=!1;value="";autoFocus=!0;valueChange=new H;enterPressed=new H;inputElement;inputValue="";ngAfterViewInit(){this.inputValue=this.value,this.autoFocus&&setTimeout(()=>this.inputElement?.nativeElement.focus(),100)}onValueChange(t){this.valueChange.emit(t)}onEnter(){this.inputValue.trim()&&this.enterPressed.emit(this.inputValue.trim())}focus(){this.inputElement?.nativeElement.focus()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-text-input"]],viewQuery:function(e,i){if(e&1&&ne(g0,5),e&2){let o;W(o=U())&&(i.inputElement=o.first)}},inputs:{label:"label",placeholder:"placeholder",hint:"hint",isDisabled:"isDisabled",value:"value",autoFocus:"autoFocus"},outputs:{valueChange:"valueChange",enterPressed:"enterPressed"},decls:6,vars:5,consts:[["inputElement",""],[1,"text-input-container"],[1,"text-input-wrapper"],[1,"text-input-label"],["type","text",1,"text-input-field",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],[1,"text-input-hint"]],template:function(e,i){if(e&1){let o=E();s(0,"div",1)(1,"label",2),w(2,f0,2,1,"span",3),s(3,"input",4,0),j("ngModelChange",function(a){return v(o),L(i.inputValue,a)||(i.inputValue=a),y(a)}),_("ngModelChange",function(a){return v(o),y(i.onValueChange(a))})("keydown.enter",function(){return v(o),y(i.onEnter())}),c()(),w(5,_0,2,1,"small",5),c()}e&2&&(m(2),S(i.label?2:-1),m(),V("ngModel",i.inputValue),x("placeholder",i.placeholder)("disabled",i.isDisabled),m(2),S(i.hint?5:-1))},dependencies:[Ke,ze,Xe,Ue,De],styles:[".text-input-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%}.text-input-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;cursor:text}.text-input-label[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);margin:0}.text-input-field[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:1rem;color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;outline:none;transition:all .2s ease}.text-input-field[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.text-input-field[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(var(--color-primary-rgb),.1)}.text-input-field[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;background:var(--color-surface)}.text-input-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);margin:0;font-style:italic}@media (max-width: 768px){.text-input-field[_ngcontent-%COMP%]{padding:.65rem .85rem;font-size:.95rem}.text-input-label[_ngcontent-%COMP%]{font-size:.9rem}.text-input-hint[_ngcontent-%COMP%]{font-size:.8rem}}"]})};var b0=["nameInput"],v0=["pathInput"];function y0(n,t){if(n&1&&(s(0,"div",7),h(1),c()),n&2){let e=g();m(),B(e.errorMessage)}}var ul=class n{isCreating=!1;create=new H;cancelled=new H;nameInput;pathInput;projectName="";projectPath="";errorMessage="";isValid(){return this.projectName.trim()!==""&&this.projectPath.trim()!==""}onNameEnter(){this.projectName.trim()&&setTimeout(()=>this.pathInput?.focus(),50)}onCreate(){this.isValid()?(this.errorMessage="",this.create.emit({name:this.projectName.trim(),path:this.projectPath.trim()})):this.errorMessage="Both name and path are required"}onCancel(){this.cancelled.emit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-project-create"]],viewQuery:function(e,i){if(e&1&&(ne(b0,5),ne(v0,5)),e&2){let o;W(o=U())&&(i.nameInput=o.first),W(o=U())&&(i.pathInput=o.first)}},inputs:{isCreating:"isCreating"},outputs:{create:"create",cancelled:"cancelled"},decls:14,vars:10,consts:[["nameInput",""],["pathInput",""],[1,"project-create"],[1,"create-title"],[1,"create-form"],["label","Project Name","placeholder","my-project",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],["label","Project Path","placeholder","/path/to/project","hint","Absolute path to the project directory",3,"valueChange","enterPressed","value","isDisabled","autoFocus"],[1,"error-message"],[1,"form-actions"],["matButton","",3,"click","disabled"],["matButton","filled",3,"click","disabled"]],template:function(e,i){if(e&1){let o=E();s(0,"div",2)(1,"h3",3),h(2,"Create New Project"),c(),s(3,"div",4)(4,"app-text-input",5,0),_("valueChange",function(a){return v(o),y(i.projectName=a)})("enterPressed",function(){return v(o),y(i.onNameEnter())}),c(),s(6,"app-text-input",6,1),_("valueChange",function(a){return v(o),y(i.projectPath=a)})("enterPressed",function(){return v(o),y(i.onCreate())}),c(),w(8,y0,2,1,"div",7),c(),s(9,"div",8)(10,"button",9),_("click",function(){return v(o),y(i.onCancel())}),h(11,"Cancel"),c(),s(12,"button",10),_("click",function(){return v(o),y(i.onCreate())}),h(13),c()()()}e&2&&(m(4),x("value",i.projectName)("isDisabled",i.isCreating)("autoFocus",!0),m(2),x("value",i.projectPath)("isDisabled",i.isCreating)("autoFocus",!1),m(2),S(i.errorMessage?8:-1),m(2),x("disabled",i.isCreating),m(2),x("disabled",!i.isValid()||i.isCreating),m(),ae(" ",i.isCreating?"Creating...":"Create Project"," "))},dependencies:[De,pl,It],styles:[".project-create[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1rem;animation:_ngcontent-%COMP%_slideIn .3s ease-out}.create-title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text);text-align:center}.create-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;background:#dc26261a;border:1px solid rgba(220,38,38,.3);border-radius:8px;color:var(--color-error);font-size:.9rem;text-align:center}.form-actions[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:flex-end;margin-top:.5rem}@keyframes _ngcontent-%COMP%_slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 768px){.project-create[_ngcontent-%COMP%]{gap:1.25rem;padding:.75rem}.create-title[_ngcontent-%COMP%]{font-size:1.3rem}.form-actions[_ngcontent-%COMP%]{flex-direction:column-reverse;gap:.75rem}}@media (max-width: 480px){.project-create[_ngcontent-%COMP%]{gap:1rem;padding:.5rem}.create-title[_ngcontent-%COMP%]{font-size:1.2rem}}"]})};function C0(n,t){if(n&1){let e=E();s(0,"app-project-create",10),_("create",function(o){v(e);let r=g();return y(r.onCreateProject(o))})("cancelled",function(){v(e);let o=g();return y(o.closeCreateForm())}),c()}if(n&2){let e=g();x("isCreating",e.isCreating)}}function x0(n,t){n&1&&(s(0,"div",6),F(1,"div",11),s(2,"p",12),h(3,"Loading projects..."),c()())}function w0(n,t){if(n&1&&(s(0,"div",7)(1,"p",13),h(2),c()()),n&2){let e=g();m(2),B(e.error)}}function S0(n,t){if(n&1){let e=E();s(0,"app-choice-select",14),_("choiceSelected",function(o){v(e);let r=g();return y(r.selectProject(o))}),c()}if(n&2){let e=g();x("options",e.projectOptions())("labelHtml","Select a project to continue")("isVisible",!0)}}function k0(n,t){if(n&1){let e=E();s(0,"div",9)(1,"p",15),h(2,"No projects available."),c(),s(3,"button",16),_("click",function(){v(e);let o=g();return y(o.openCreateForm())}),h(4,"Create your first project"),c()()}}var gl=class n{isLoading=!1;error=null;showCreateForm=!1;isCreating=!1;router=d(Dn);projectStateService=d(we);projects=jt(this.projectStateService.projectList$);forcedProject=jt(this.projectStateService.forcedProject$);projectOptions=ft(()=>{let t=this.projects();if(!t)return[];let e=t.filter(a=>!a.volatile),i=t.filter(a=>a.volatile),r=[...e,...i].map(a=>({value:a.name,label:a.volatile?`${a.name} \u{1F538}temp`:a.name}));return t.length>0&&r.push({value:"__new_project__",label:"New project..."}),r});showCreateButton=ft(()=>!this.forcedProject());constructor(){this.projectStateService.selectedProject$.pipe(zs(),ue(t=>!!t),ue(()=>this.router.url.split("?")[0]==="/"),Mt(1)).subscribe(t=>{console.log(`\u{1F43C} navigate to ${t.name}`),this.router.navigate(["project",t.name])})}selectProject(t){if(t==="__new_project__"){this.openCreateForm();return}this.projectStateService.selectProject(t)}openCreateForm(){this.showCreateForm=!0}closeCreateForm(){this.showCreateForm=!1,this.isCreating=!1}onCreateProject(t){this.isCreating=!0,this.error=null,this.projectStateService.createProject(t.name,t.path).subscribe({next:e=>{console.log("[PROJECT-SELECTION] Project created:",e.message),this.isCreating=!1,this.closeCreateForm(),this.selectProject(t.name)},error:e=>{console.error("[PROJECT-SELECTION] Error creating project:",e),this.error=e.error?.error||"Failed to create project",this.isCreating=!1}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-project-selection"]],decls:11,vars:1,consts:[[1,"project-selection"],[1,"centered-content"],[1,"welcome-section"],[1,"choice-section"],[1,"choice-glass"],[3,"isCreating"],[1,"loading-container"],[1,"error-container"],[3,"options","labelHtml","isVisible"],[1,"no-projects-container"],[3,"create","cancelled","isCreating"],[1,"loading-spinner"],[1,"loading-text"],[1,"error-text"],[3,"choiceSelected","options","labelHtml","isVisible"],[1,"no-projects-text"],["matButton","filled","color","primary",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),F(3,"app-welcome-message"),c(),s(4,"div",3)(5,"div",4),w(6,C0,1,1,"app-project-create",5)(7,x0,4,0,"div",6)(8,w0,3,1,"div",7)(9,S0,1,3,"app-choice-select",8)(10,k0,5,0,"div",9),c()()()()),e&2&&(m(6),S(i.showCreateForm?6:i.isLoading?7:i.error?8:i.projects()&&i.projects().length>0?9:10))},dependencies:[De,er,tr,ul,It],styles:[".project-selection[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100vh;width:100%;overflow:hidden;background:var(--color-bg);padding:2rem}.centered-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3rem;width:100%;max-width:800px;animation:_ngcontent-%COMP%_fadeIn .6s ease-out}.welcome-section[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_slideUp .8s ease-out}.choice-section[_ngcontent-%COMP%]{width:100%;animation:_ngcontent-%COMP%_slideUp .8s ease-out .2s both}.choice-glass[_ngcontent-%COMP%]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;padding:1.5rem;box-shadow:0 4px 6px #0000001a;transition:all .3s ease}.choice-glass[_ngcontent-%COMP%]:hover{box-shadow:0 8px 12px #00000026}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:2rem}.loading-spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}.loading-text[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0}.error-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.error-text[_ngcontent-%COMP%]{color:var(--color-error);margin:0}.no-projects-container[_ngcontent-%COMP%]{padding:2rem;text-align:center}.no-projects-text[_ngcontent-%COMP%]{color:var(--color-text);margin:0 0 1rem;font-size:1.1rem}.no-projects-hint[_ngcontent-%COMP%]{color:var(--color-text-secondary);margin:0;font-size:.9rem}.create-action[_ngcontent-%COMP%]{margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--color-border);display:flex;justify-content:center}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0}to{opacity:1}}@keyframes _ngcontent-%COMP%_slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@media (max-width: 768px){.project-selection[_ngcontent-%COMP%]{padding:1.5rem}.centered-content[_ngcontent-%COMP%]{gap:2rem}.choice-glass[_ngcontent-%COMP%]{padding:1rem}}@media (max-width: 480px){.project-selection[_ngcontent-%COMP%]{padding:1rem}.centered-content[_ngcontent-%COMP%]{gap:1.5rem}.choice-glass[_ngcontent-%COMP%]{padding:.75rem}.create-action[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem}}"]})};var st=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new se("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();enterToSendSubject=new se(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new se(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new se("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new se(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new se(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new se(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new se(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new se(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new se(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new se(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new se(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new se(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new se(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.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 t=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(i);let o=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(o);let r=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(r);let a=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(a);let l=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(l);let p=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(p);let u=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(u);let b=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(b);let C=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(C);let T=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(T);let P=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(P);let k=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return ie(this,null,function*(){let t=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(t),console.log("[PREFERENCES] Voice language initialized to:",t);let e=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(e),console.log("[PREFERENCES] Enter to send initialized to:",e);let i=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(i);let o=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(o);let r=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(r);let a=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(a);let l=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(l);let p=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(p);let u=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(u);let b=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(b);let C=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(C);let T=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(T);let P=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(P);let k=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(k),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(t,e){return this.getPreferenceSync(t,e)}getPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY);if(!i)return e;let o=JSON.parse(i);return o[t]!==void 0?o[t]:e}catch{return e}}getPreferenceAsync(t,e){return ie(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(t,e);try{let i=yield this.electronStorage.get(this.STORAGE_KEY);if(!i)return e;let o=JSON.parse(i);return o[t]!==void 0?o[t]:e}catch{return e}})}setPreference(t,e){this.isDesktopApp?this.setPreferenceAsync(t,e):this.setPreferenceSync(t,e)}setPreferenceSync(t,e){try{let i=localStorage.getItem(this.STORAGE_KEY),o=i?JSON.parse(i):{};o[t]=e,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(o)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}}setPreferenceAsync(t,e){return ie(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(t,e);return}try{let i=yield this.electronStorage.get(this.STORAGE_KEY),o=i?JSON.parse(i):{};o[t]=e,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(o)),this.updateSubject(t,e)}catch(i){console.error("Failed to set preference:",i)}})}updateSubject(t,e){t==="voiceLanguage"&&this.voiceLanguageSubject.next(e),t==="useEnterToSend"&&this.enterToSendSubject.next(e),t==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(e),t==="voiceMode"&&this.voiceModeSubject.next(e),t==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(e),t==="voiceVolume"&&this.voiceVolumeSubject.next(e),t==="voiceRate"&&this.voiceRateSubject.next(e),t==="selectedVoice"&&this.selectedVoiceSubject.next(e),t==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(e),t==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(e),t==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(e),t==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(e),t==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(e),t==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(e)}setVoiceLanguage(t){console.log("[PREFERENCES] Setting voice language to:",t),this.setPreference("voiceLanguage",t)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setEnterToSend(t){console.log("[PREFERENCES] Setting Enter to send to:",t),this.setPreference("useEnterToSend",t)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(t){console.log("[PREFERENCES] Setting voice announce enabled to:",t),this.setPreference("voiceAnnounceEnabled",t)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(t){console.log("[PREFERENCES] Setting voice mode to:",t),this.setPreference("voiceMode",t)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(t){console.log("[PREFERENCES] Setting voice read full text to:",t),this.setPreference("voiceReadFullText",t)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(t){let e=Math.max(0,Math.min(1,t));console.log("[PREFERENCES] Setting voice volume to:",e),this.setPreference("voiceVolume",e)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(t){let e=Math.max(.5,Math.min(2,t));console.log("[PREFERENCES] Setting voice rate to:",e),this.setPreference("voiceRate",e)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(t){console.log("[PREFERENCES] Setting selected voice to:",t),this.setPreference("selectedVoice",t)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(t){console.log("[PREFERENCES] Setting print technical messages to:",t),this.setPreference("printTechnicalMessages",t)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(t){console.log("[PREFERENCES] Setting hide technical messages to:",t),this.setPreference("hideTechnicalMessages",t)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(t){console.log("[PREFERENCES] Setting hide warning messages to:",t),this.setPreference("hideWarningMessages",t)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(t){console.log("[PREFERENCES] Setting agent notification enabled to:",t),this.setPreference("agentNotificationEnabled",t)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(t){console.log("[PREFERENCES] Setting notification sound enabled to:",t),this.setPreference("notificationSoundEnabled",t)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(t){console.log("[PREFERENCES] Setting browser notification enabled to:",t),this.setPreference("browserNotificationEnabled",t)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function qd(n,t=80){if(n.length<=t)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let e=JSON.parse(n),i=JSON.stringify(e);return i.length<=t?i:i.substring(0,t)+`...(${i.length} chars)`}}catch{}return n.substring(0,t)+"..."}var wt=class{constructor(t,e){this.type=e;if(t.timestamp)this.timestamp=t.timestamp;else{let i=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${i}`}this.parentKey=t.parentKey,this.length=0}timestamp;parentKey;static type;length;get date(){let t=this.timestamp.lastIndexOf("-");if(t>0){let e=this.timestamp.substring(t+1);if(e.length===5&&/^[a-z0-9]+$/.test(e))return new Date(this.timestamp.substring(0,t))}return new Date(this.timestamp)}},fl=class extends wt{invite;constructor(t,e){super(t,e),this.invite=t.invite}buildAnswer(t){return new ni({answer:t,parentKey:this.timestamp,invite:this.invite})}},rr=class n extends wt{static type="heartbeat";constructor(t){super(t,n.type)}},_n=class n extends fl{defaultValue;static type="invite";constructor(t){super(t,n.type),this.defaultValue=t.defaultValue}},Gd="InviteEventDefault",ni=class n extends wt{answer;invite;static type="answer";constructor(t){super(t,n.type),this.answer=t.answer??"No answer",this.invite=t.invite}},fo=class n extends wt{speaker;text;static type="text";constructor(t){super(t,n.type),this.speaker=t.speaker,this.text=t.text}},ar=class n extends wt{chunk;static type="text_chunk";constructor(t){super(t,n.type),this.chunk=t.chunk,this.length=this.chunk.length}},_o=class n extends wt{warning;static type="warn";constructor(t){super(t,n.type),this.warning=t.warning}},Pi=class n extends wt{error;static type="error";constructor(t){super(t,n.type),this.error=t.error}},bn=class n extends fl{options;optionalQuestion;static type="choice";constructor(t){super(t,n.type),this.options=t.options,this.optionalQuestion=t.optionalQuestion}},vn=class n extends wt{toolRequestId;name;args;static type="tool_request";constructor(t){super(t,n.type),this.toolRequestId=t.toolRequestId??this.timestamp,this.name=t.name,this.args=t.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(t){return new Yi({output:t,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(t=50){let e=qd(this.args,t);return`\u{1F527} ${this.name}(${e})`}},Yi=class n extends wt{toolRequestId;output;static type="tool_response";constructor(t){if(super(t,n.type),this.toolRequestId=t.toolRequestId||this.timestamp||new Date().toISOString(),this.output=t.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 e=(this.output.width??0)*(this.output.height??0)/750;this.length=(e?e*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(t=50){let e=this.getTextOutput(),i=qd(e,t),o=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${i}${o}`}},Hn=class n extends wt{static type="thinking";static debounce=5e3;constructor(t){super(t,n.type)}},bo=class n extends wt{summary;static type="summary";constructor(t){super(t,n.type),this.summary=t.summary,this.length=this.summary.length}toSingleLineString(t=80){return`\u{1F4CB} Summary: ${qd(this.summary,t)}`}},yn=class n extends wt{role;name;content;static type="message";constructor(t){super(t,n.type),this.role=t.role,this.name=t.name,this.content=t.content,this.length=this.content.map(e=>{if(e.type==="text")return e.content.length;if(e.type==="image"){let i=(e.width||0)*(e.height||0)/750;return i?i*3.5:e.content.length}return 0}).reduce((e,i)=>e+i,0)}getTextContent(){return this.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
68
|
+
`)}},sr=class n extends wt{threadId;name;summary;static type="thread_update";constructor(t){super(t,n.type),this.threadId=t.threadId,this.name=t.name,this.summary=t.summary}},Wn=class n extends wt{filename;operation;size;mimeType;static type="file";constructor(t){super(t,n.type),this.filename=t.filename,this.operation=t.operation,this.size=t.size,this.mimeType=t.mimeType}toSingleLineString(){let t=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",e=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${t} ${this.operation}: ${this.filename}${e}`}},lr=class n extends wt{authUrl;state;integrationName;static type="oauth_request";constructor(t){super(t,n.type),this.authUrl=t.authUrl,this.state=t.state,this.integrationName=t.integrationName}},Qi=class n extends wt{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(t){super(t,n.type),this.code=t.code,this.state=t.state,this.integrationName=t.integrationName,this.error=t.error,this.errorDescription=t.errorDescription}},M0={[yn.type]:yn,[ni.type]:ni,[bn.type]:bn,[Pi.type]:Pi,[rr.type]:rr,[_n.type]:_n,[vn.type]:vn,[Yi.type]:Yi,[fo.type]:fo,[ar.type]:ar,[Hn.type]:Hn,[_o.type]:_o,[sr.type]:sr,[bo.type]:bo,[Wn.type]:Wn,[lr.type]:lr,[Qi.type]:Qi};function Yd(n){let t=M0[n.type];return t?new t(n):void 0}var pP=[{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:
|
|
69
69
|
|
|
70
70
|
<task>
|
|
71
71
|
{{PARAMETERS}}
|
|
@@ -333,11 +333,11 @@ Verify the memory system's overall health:
|
|
|
333
333
|
- List any remaining issues or concerns
|
|
334
334
|
- Provide recommendations for maintaining memory quality
|
|
335
335
|
|
|
336
|
-
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var kP=[yn.type,vn.type,Yi.type,bo.type,_n.type,bn.type,ni.type];var rg={CONFLUENCE:[],GIT:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},WP=Object.keys(rg).filter(n=>rg[n]?.length===0);var Xi=class n{eventSource=null;eventsSubject=new D;connectionStatusSubject=new se({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=d(me);connectToThread(t,e){console.log("[SSE] Connecting to thread event stream:",t,e),this.eventSource&&(console.log("[SSE] Closing existing EventSource"),this.eventSource.close());let i=`/api/projects/${t}/threads/${e}/event-stream`;console.log("[SSE] EventSource URL:",i),this.eventSource=new EventSource(i),this.setupEventHandlers()}setupEventHandlers(){this.eventSource&&(this.eventSource.onmessage=t=>{this.ngZone.run(()=>{console.log("[SSE] Message received:",t.data.substring(0,100)),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0);try{let e=JSON.parse(t.data),i=Gd(e);i?(console.log("[SSE] Event:",i.type),this.eventsSubject.next(i)):console.warn("[SSE] Failed to build event:",e.type)}catch(e){console.error("[SSE] Parse error:",e.message)}})},this.eventSource.onopen=()=>{this.ngZone.run(()=>{console.log("[SSE] Connection established"),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0)})},this.eventSource.onerror=t=>{this.ngZone.run(()=>{console.log("[SSE] EventSource error:",t),this.eventSource?.readyState===EventSource.CLOSED&&(console.log("[SSE] Connection closed"),this.updateConnectionStatus(!1,this.reconnectAttempts),this.reconnectAttempts<this.MAX_RECONNECT_ATTEMPTS?(console.log(`[SSE] Attempting reconnect ${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS}`),this.eventsSubject.next(new Pi({error:new Error(`Connection lost. Attempting to reconnect (${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS})...`)})),setTimeout(()=>{this.reconnectAttempts++,console.warn("[SSE] Reconnection may not work properly with thread-based connections")},this.RECONNECT_DELAY)):(console.log("[SSE] Max reconnection attempts reached"),this.eventsSubject.next(new Pi({error:new Error("Connection lost permanently. Please refresh the page.")}))))})})}disconnect(){this.eventSource&&(console.log("[SSE] Disconnecting EventSource"),this.eventSource.close(),this.eventSource=null,this.updateConnectionStatus(!1,0))}updateConnectionStatus(t,e){this.connectionStatusSubject.next({connected:t,reconnectAttempts:e,maxAttempts:this.MAX_RECONNECT_ATTEMPTS})}ngOnDestroy(){this.disconnect(),this.eventsSubject.complete(),this.connectionStatusSubject.complete()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Un=class n{http=d(Ye);projectState=d(we);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}getThread(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createThread(t){let e=t?{name:t}:{};return this.http.post(this.getBaseUrl(),e)}updateThread(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{name:e})}starThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/star`,{})}unstarThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}/star`)}deleteThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}stopThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/stop`,{})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Rt=class n{selectedThreadIdSubject=new se(null);isLoadingSubject=new se(!1);isLoadingThreadListSubject=new se(!1);refreshThreadListSubject=new D;threadListSubject=new se([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=d(Un);projectStateService=d(we);projectName$=this.projectStateService.selectedProject$.pipe(ve(t=>t?.name),Ba());constructor(){nn([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(Vt(void 0))]).pipe(ct(([t])=>{t!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=t),t?this.hasLoadedOncePerProject.get(t)?console.log("[THREAD_STATE] Refreshing thread list for project",t,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",t,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),Ri(([t])=>t?(console.log("[THREAD_STATE] Fetching threads for project:",t),this.threadApi.listThreads().pipe(ve(e=>({threads:e,projectName:t})),Xn(e=>(console.error("[THREAD_STATE] Error loading thread list:",e),kt({threads:[],projectName:t}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),kt({threads:[],projectName:null}))),ct(({threads:t,projectName:e})=>{console.log("[THREAD_STATE] Thread list loaded:",t.length,"threads for project",e),e&&this.hasLoadedOncePerProject.set(e,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(t)})).subscribe()}threadList$=this.threadListSubject.asObservable();selectedThread$=nn([this.projectName$,this.selectedThreadIdSubject.pipe(Ba())]).pipe(ct(([t,e])=>{console.log("\u{1F43C} combineLatest emitted:",{projectName:t,threadId:e})}),Ri(([t,e])=>!t||!e?(console.log("\u{1F43C} null"),kt(null)):(console.log("\u{1F43C} loading thread:",e),this.isLoadingSubject.next(!0),this.threadApi.getThread(e).pipe(ct(i=>{console.log("\u{1F43C} loaded thread:",i?.id)}),Mn({bufferSize:1,refCount:!0})))),ct(()=>{console.log("\u{1F43C} finished loading"),this.isLoadingSubject.next(!1)}));selectThread(t){this.selectedThreadIdSubject.next(t)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let t=this.selectedThreadIdSubject.value;if(!t)throw new Error("[THREAD_STATE] No thread selected");return t}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let t=this.selectedThreadIdSubject.value;if(!t){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",t),this.threadApi.stopThread(t).subscribe({next:e=>console.log("[THREAD_STATE] Stop signal sent:",e.message),error:e=>console.error("[THREAD_STATE] Error stopping thread:",e)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}renameThread(t,e){let i=e.trim();return!i||i.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),Ir(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",t,"to:",i),this.threadApi.updateThread(t,i).pipe(ct(o=>{console.log("[THREAD_STATE] Thread renamed successfully:",o),this.refreshThreadList()}),Xn(o=>(console.error("[THREAD_STATE] Error renaming thread:",o),Ir(()=>o)))))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var cr=class n{http=d(Ye);projectState=d(we);threadState=d(Rt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/messages`}getMessages(){return this.http.get(this.getBaseUrl())}sendMessage(t){return this.http.post(this.getBaseUrl(),t,{responseType:"text"})}getMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}deleteMessage(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}getFormattedMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}/formatted`,{responseType:"text"})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var mi=class n{destroy$=new D;currentProject=null;currentThread=null;messagesSubject=new se([]);isThinkingSubject=new se(!1);currentChoiceSubject=new se(null);projectTitleSubject=new se("Coday");currentInviteEventSubject=new se(null);messageToRestoreSubject=new se("");threadUpdateEventSubject=new se(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new se("");messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=d(Xi);messageApi=d(cr);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling()}setTabTitleService(t){this.tabTitleService=t}connectToThread(t,e){this.currentProject=t,this.currentThread=e,this.eventStream.connectToThread(t,e),setTimeout(()=>this.processUnansweredInvites(),500)}processUnansweredInvites(){let t=this.messagesSubject.value,e=t.filter(i=>i.type==="text"&&i.parentKey===void 0&&i.invite!==void 0).filter(i=>!t.some(o=>o.type==="text"&&o.role==="user"&&o.parentKey===i.id));e.length>0&&console.log("[CODAY] Found",e.length,"unanswered invite(s)")}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.stopThinking()}sendMessage(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentInviteEventSubject.value;if(e){let i=e.buildAnswer(t);this.currentInviteEventSubject.next(null),this.messageApi.sendMessage(i).subscribe({error:o=>{console.error("[CODAY] Send error:",o),this.stopThinking()}})}else{let i=new ni({answer:t});this.messageApi.sendMessage(i).subscribe({error:o=>{console.error("[CODAY] Send error:",o),this.stopThinking()}})}}sendChoice(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentChoiceEvent.buildAnswer(t);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(e).subscribe({next:()=>{},error:i=>{console.error("[CODAY-CHOICE] Choice error:",i),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",t)}deleteMessage(t){let e=this.messagesSubject.value.find(o=>o.id===t),i=this.extractTextContentFromMessage(e);return this.messageApi.deleteMessage(t).pipe(ct(o=>{o.success&&(this.removeMessagesFromIndex(t),i.trim()&&this.messageToRestoreSubject.next(i))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(N(this.destroy$)).subscribe({next:t=>this.handleEvent(t),error:t=>console.error("[CODAY] Event stream error:",t),complete:()=>console.log("[CODAY] Event stream completed")})}handleEvent(t){t instanceof yn?this.handleMessageEvent(t):t instanceof ar?this.handleTextChunkEvent(t):t instanceof fo?this.handleTextEvent(t):t instanceof ni?this.handleAnswerEvent(t):t instanceof Pi?this.handleErrorEvent(t):t instanceof _o?this.handleWarnEvent(t):t instanceof Hn?this.handleThinkingEvent(t):t instanceof vn?this.handleToolRequestEvent(t):t instanceof Yi?this.handleToolResponseEvent(t):t instanceof bn?this.handleChoiceEvent(t):t instanceof rr?this.handleHeartBeatEvent(t):t instanceof _n?this.handleInviteEvent(t):t instanceof sr?this.handleThreadUpdateEvent(t):t instanceof lr||t instanceof Qi||console.warn("[CODAY] Unhandled event type:",t.type)}handleThreadUpdateEvent(t){this.threadUpdateEventSubject.next(t)}handleMessageEvent(t){t.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let e={id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:new Date,type:"text"};this.addMessage(e)}handleTextChunkEvent(t){this.accumulatedChunks+=t.chunk,this.streamingTextSubject.next(this.accumulatedChunks)}handleTextEvent(t){let e={id:t.timestamp,role:t.speaker?"assistant":"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:new Date,type:t.speaker?"text":"technical"};this.addMessage(e)}handleAnswerEvent(t){let e={id:t.timestamp,role:"user",speaker:"User",content:[{type:"text",content:t.answer}],timestamp:new Date,type:"text",parentKey:t.parentKey,invite:t.invite};this.addMessage(e)}handleErrorEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(t.error)}`}],timestamp:new Date,type:"error"};this.addMessage(e)}handleWarnEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(t.warning)}`}],timestamp:new Date,type:"warning"};this.addMessage(e)}handleThinkingEvent(t){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},Hn.debounce+1e3))}handleToolRequestEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleToolResponseEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:new Date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleChoiceEvent(t){this.stopThinking(),this.currentChoiceEvent=t,this.tabTitleService?.setSystemInactive();let e=t.options.map(o=>({value:o,label:o})),i=t.optionalQuestion?`${t.optionalQuestion} ${t.invite}`:t.invite;this.currentChoiceSubject.next({options:e,label:i})}handleHeartBeatEvent(t){}handleInviteEvent(t){this.stopThinking();let e=this.messagesSubject.value,i=e[e.length-1];if(!(!(t.invite===qd)&&i&&i.role==="assistant"&&i.content.some(a=>a.type==="text"&&a.content.includes(t.invite)))&&t.invite!==qd){let a={id:t.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:t.invite}],timestamp:new Date,type:"text"};this.addMessage(a)}this.currentInviteEventSubject.next(t),this.tabTitleService?.setSystemInactive()}addMessage(t){let i=[...this.messagesSubject.value,t];this.messagesSubject.next(i)}removeMessagesFromIndex(t){let e=this.messagesSubject.value,i=e.findIndex(r=>r.id===t);if(i===-1||i===0)return;let o=e.slice(0,i);this.messagesSubject.next(o),this.stopThinking()}extractTextContentFromMessage(t){return t?t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
336
|
+
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var MP=[yn.type,vn.type,Yi.type,bo.type,_n.type,bn.type,ni.type];var rg={CONFLUENCE:[],GIT:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},UP=Object.keys(rg).filter(n=>rg[n]?.length===0);var Xi=class n{eventSource=null;eventsSubject=new D;connectionStatusSubject=new se({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=d(me);connectToThread(t,e){console.log("[SSE] Connecting to thread event stream:",t,e),this.eventSource&&(console.log("[SSE] Closing existing EventSource"),this.eventSource.close());let i=`/api/projects/${t}/threads/${e}/event-stream`;console.log("[SSE] EventSource URL:",i),this.eventSource=new EventSource(i),this.setupEventHandlers()}setupEventHandlers(){this.eventSource&&(this.eventSource.onmessage=t=>{this.ngZone.run(()=>{console.log("[SSE] Message received:",t.data.substring(0,100)),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0);try{let e=JSON.parse(t.data),i=Yd(e);i?(console.log("[SSE] Event:",i.type),this.eventsSubject.next(i)):console.warn("[SSE] Failed to build event:",e.type)}catch(e){console.error("[SSE] Parse error:",e.message)}})},this.eventSource.onopen=()=>{this.ngZone.run(()=>{console.log("[SSE] Connection established"),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0)})},this.eventSource.onerror=t=>{this.ngZone.run(()=>{console.log("[SSE] EventSource error:",t),this.eventSource?.readyState===EventSource.CLOSED&&(console.log("[SSE] Connection closed"),this.updateConnectionStatus(!1,this.reconnectAttempts),this.reconnectAttempts<this.MAX_RECONNECT_ATTEMPTS?(console.log(`[SSE] Attempting reconnect ${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS}`),this.eventsSubject.next(new Pi({error:new Error(`Connection lost. Attempting to reconnect (${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS})...`)})),setTimeout(()=>{this.reconnectAttempts++,console.warn("[SSE] Reconnection may not work properly with thread-based connections")},this.RECONNECT_DELAY)):(console.log("[SSE] Max reconnection attempts reached"),this.eventsSubject.next(new Pi({error:new Error("Connection lost permanently. Please refresh the page.")}))))})})}disconnect(){this.eventSource&&(console.log("[SSE] Disconnecting EventSource"),this.eventSource.close(),this.eventSource=null,this.updateConnectionStatus(!1,0))}updateConnectionStatus(t,e){this.connectionStatusSubject.next({connected:t,reconnectAttempts:e,maxAttempts:this.MAX_RECONNECT_ATTEMPTS})}ngOnDestroy(){this.disconnect(),this.eventsSubject.complete(),this.connectionStatusSubject.complete()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Un=class n{http=d(Ye);projectState=d(we);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}getThread(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createThread(t){let e=t?{name:t}:{};return this.http.post(this.getBaseUrl(),e)}updateThread(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{name:e})}starThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/star`,{})}unstarThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}/star`)}deleteThread(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}stopThread(t){return this.http.post(`${this.getBaseUrl()}/${t}/stop`,{})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Rt=class n{selectedThreadIdSubject=new se(null);isLoadingSubject=new se(!1);isLoadingThreadListSubject=new se(!1);refreshThreadListSubject=new D;threadListSubject=new se([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=d(Un);projectStateService=d(we);projectName$=this.projectStateService.selectedProject$.pipe(ve(t=>t?.name),Ha());constructor(){nn([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(Vt(void 0))]).pipe(ct(([t])=>{t!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=t),t?this.hasLoadedOncePerProject.get(t)?console.log("[THREAD_STATE] Refreshing thread list for project",t,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",t,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),Ri(([t])=>t?(console.log("[THREAD_STATE] Fetching threads for project:",t),this.threadApi.listThreads().pipe(ve(e=>({threads:e,projectName:t})),Xn(e=>(console.error("[THREAD_STATE] Error loading thread list:",e),kt({threads:[],projectName:t}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),kt({threads:[],projectName:null}))),ct(({threads:t,projectName:e})=>{console.log("[THREAD_STATE] Thread list loaded:",t.length,"threads for project",e),e&&this.hasLoadedOncePerProject.set(e,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(t)})).subscribe()}threadList$=this.threadListSubject.asObservable();selectedThread$=nn([this.projectName$,this.selectedThreadIdSubject.pipe(Ha())]).pipe(ct(([t,e])=>{console.log("\u{1F43C} combineLatest emitted:",{projectName:t,threadId:e})}),Ri(([t,e])=>!t||!e?(console.log("\u{1F43C} null"),kt(null)):(console.log("\u{1F43C} loading thread:",e),this.isLoadingSubject.next(!0),this.threadApi.getThread(e).pipe(ct(i=>{console.log("\u{1F43C} loaded thread:",i?.id)}),Mn({bufferSize:1,refCount:!0})))),ct(()=>{console.log("\u{1F43C} finished loading"),this.isLoadingSubject.next(!1)}));selectThread(t){this.selectedThreadIdSubject.next(t)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let t=this.selectedThreadIdSubject.value;if(!t)throw new Error("[THREAD_STATE] No thread selected");return t}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let t=this.selectedThreadIdSubject.value;if(!t){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",t),this.threadApi.stopThread(t).subscribe({next:e=>console.log("[THREAD_STATE] Stop signal sent:",e.message),error:e=>console.error("[THREAD_STATE] Error stopping thread:",e)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}renameThread(t,e){let i=e.trim();return!i||i.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),Ir(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",t,"to:",i),this.threadApi.updateThread(t,i).pipe(ct(o=>{console.log("[THREAD_STATE] Thread renamed successfully:",o),this.refreshThreadList()}),Xn(o=>(console.error("[THREAD_STATE] Error renaming thread:",o),Ir(()=>o)))))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var cr=class n{http=d(Ye);projectState=d(we);threadState=d(Rt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/messages`}getMessages(){return this.http.get(this.getBaseUrl())}sendMessage(t){return this.http.post(this.getBaseUrl(),t,{responseType:"text"})}getMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}deleteMessage(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}getFormattedMessage(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}/formatted`,{responseType:"text"})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var mi=class n{destroy$=new D;currentProject=null;currentThread=null;messagesSubject=new se([]);isThinkingSubject=new se(!1);currentChoiceSubject=new se(null);projectTitleSubject=new se("Coday");currentInviteEventSubject=new se(null);messageToRestoreSubject=new se("");threadUpdateEventSubject=new se(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new se("");messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=d(Xi);messageApi=d(cr);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling()}setTabTitleService(t){this.tabTitleService=t}connectToThread(t,e){this.currentProject=t,this.currentThread=e,this.eventStream.connectToThread(t,e),setTimeout(()=>this.processUnansweredInvites(),500)}processUnansweredInvites(){let t=this.messagesSubject.value,e=t.filter(i=>i.type==="text"&&i.parentKey===void 0&&i.invite!==void 0).filter(i=>!t.some(o=>o.type==="text"&&o.role==="user"&&o.parentKey===i.id));e.length>0&&console.log("[CODAY] Found",e.length,"unanswered invite(s)")}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.stopThinking()}sendMessage(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentInviteEventSubject.value;if(e){let i=e.buildAnswer(t);this.currentInviteEventSubject.next(null),this.messageApi.sendMessage(i).subscribe({error:o=>{console.error("[CODAY] Send error:",o),this.stopThinking()}})}else{let i=new ni({answer:t});this.messageApi.sendMessage(i).subscribe({error:o=>{console.error("[CODAY] Send error:",o),this.stopThinking()}})}}sendChoice(t){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let e=this.currentChoiceEvent.buildAnswer(t);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(e).subscribe({next:()=>{},error:i=>{console.error("[CODAY-CHOICE] Choice error:",i),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",t)}deleteMessage(t){let e=this.messagesSubject.value.find(o=>o.id===t),i=this.extractTextContentFromMessage(e);return this.messageApi.deleteMessage(t).pipe(ct(o=>{o.success&&(this.removeMessagesFromIndex(t),i.trim()&&this.messageToRestoreSubject.next(i))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(N(this.destroy$)).subscribe({next:t=>this.handleEvent(t),error:t=>console.error("[CODAY] Event stream error:",t),complete:()=>console.log("[CODAY] Event stream completed")})}handleEvent(t){t instanceof yn?this.handleMessageEvent(t):t instanceof ar?this.handleTextChunkEvent(t):t instanceof fo?this.handleTextEvent(t):t instanceof ni?this.handleAnswerEvent(t):t instanceof Pi?this.handleErrorEvent(t):t instanceof _o?this.handleWarnEvent(t):t instanceof Hn?this.handleThinkingEvent(t):t instanceof vn?this.handleToolRequestEvent(t):t instanceof Yi?this.handleToolResponseEvent(t):t instanceof bn?this.handleChoiceEvent(t):t instanceof rr?this.handleHeartBeatEvent(t):t instanceof _n?this.handleInviteEvent(t):t instanceof sr?this.handleThreadUpdateEvent(t):t instanceof lr||t instanceof Qi||console.warn("[CODAY] Unhandled event type:",t.type)}handleThreadUpdateEvent(t){this.threadUpdateEventSubject.next(t)}handleMessageEvent(t){t.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let e={id:t.timestamp,role:t.role,speaker:t.name,content:t.content,timestamp:t.date,type:"text"};this.addMessage(e)}handleTextChunkEvent(t){this.accumulatedChunks+=t.chunk,this.streamingTextSubject.next(this.accumulatedChunks)}handleTextEvent(t){let e={id:t.timestamp,role:t.speaker?"assistant":"system",speaker:t.speaker??"System",content:[{type:"text",content:t.text}],timestamp:t.date,type:t.speaker?"text":"technical"};this.addMessage(e)}handleAnswerEvent(t){let e={id:t.timestamp,role:"user",speaker:"User",content:[{type:"text",content:t.answer}],timestamp:t.date,type:"text",parentKey:t.parentKey,invite:t.invite};this.addMessage(e)}handleErrorEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(t.error)}`}],timestamp:t.date,type:"error"};this.addMessage(e)}handleWarnEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(t.warning)}`}],timestamp:t.date,type:"warning"};this.addMessage(e)}handleThinkingEvent(t){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},Hn.debounce+1e3))}handleToolRequestEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleToolResponseEvent(t){let e={id:t.timestamp,role:"system",speaker:"System",content:[{type:"text",content:t.toSingleLineString()}],timestamp:t.date,type:"technical",eventId:t.timestamp};this.addMessage(e)}handleChoiceEvent(t){this.stopThinking(),this.currentChoiceEvent=t,this.tabTitleService?.setSystemInactive();let e=t.options.map(o=>({value:o,label:o})),i=t.optionalQuestion?`${t.optionalQuestion} ${t.invite}`:t.invite;this.currentChoiceSubject.next({options:e,label:i})}handleHeartBeatEvent(t){}handleInviteEvent(t){this.stopThinking();let e=this.messagesSubject.value,i=e[e.length-1];if(!(!(t.invite===Gd)&&i&&i.role==="assistant"&&i.content.some(a=>a.type==="text"&&a.content.includes(t.invite)))&&t.invite!==Gd){let a={id:t.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:t.invite}],timestamp:t.date,type:"text"};this.addMessage(a)}this.currentInviteEventSubject.next(t),this.tabTitleService?.setSystemInactive()}addMessage(t){let i=[...this.messagesSubject.value,t];this.messagesSubject.next(i)}removeMessagesFromIndex(t){let e=this.messagesSubject.value,i=e.findIndex(r=>r.id===t);if(i===-1||i===0)return;let o=e.slice(0,i);this.messagesSubject.next(o),this.stopThinking()}extractTextContentFromMessage(t){return t?t.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
337
337
|
|
|
338
|
-
`):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null)}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(!1),this.tabTitleService&&this.tabTitleService.setSystemInactive()}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var dr=class n{http=d(Ye);agentsCache=new Map;getAgents(t){let e=this.agentsCache.get(t);return e?kt(e):this.http.get(`/api/projects/${t}/agents`).pipe(ct(i=>{this.agentsCache.set(t,i)}))}getAgentsAutocomplete(t,e){return this.getAgents(t).pipe(ve(i=>{if(!e)return i;let o=e.toLowerCase();return i.filter(r=>{let a=r.name.toLowerCase(),l=r.description?.toLowerCase()||"";return a.includes(o)||l.includes(o)})}))}clearCache(t){this.agentsCache.delete(t)}clearAllCache(){this.agentsCache.clear()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var hi=class n{http=d(Ye);projectState=d(we);promptsCache=new Map;getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let i=this.promptsCache.get(t);return i?kt(this.filterPromptsForAutocomplete(i,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(ve(o=>(this.promptsCache.set(t,o),this.filterPromptsForAutocomplete(o,e))))}filterPromptsForAutocomplete(t,e){let i=e.toLowerCase();return t.filter(r=>r.name.toLowerCase().includes(i)||r.description.toLowerCase().includes(i)).map(r=>({name:r.name,description:r.description,parameterFormat:r.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear()}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(ve(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(ve(i=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),i)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(ve(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var fl=class n{sanitizer=d(Ni);transform(t,e){if(!e||!t)return t;let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`(${i})`,"gi"),r=t.replace(o,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(e){return new(e||n)};static \u0275pipe=Zm({name:"highlight",type:n,pure:!0})};var T0=["messageInput"],P0=["fileInput"],O0=(n,t)=>t.name;function A0(n,t){n&1&&(s(0,"div",3),F(1,"span",7),h(2," Recording... Click mic to stop "),c())}function D0(n,t){if(n&1&&(s(0,"span",12),h(1),c()),n&2){let e=g().$implicit,i=g(2);m(),B(" "+(i.getParameterFormat(e)||""))}}function I0(n,t){if(n&1){let e=E();s(0,"div",9),_("click",function(){let o=v(e).$index,r=g(2);return y(r.selectAutocompleteItemByClick(o))})("keydown.enter",function(){let o=v(e).$index,r=g(2);return y(r.selectAutocompleteItemByClick(o))})("keydown.space",function(){let o=v(e).$index,r=g(2);return y(r.selectAutocompleteItemByClick(o))})("mouseenter",function(){let o=v(e).$index,r=g(2);return y(r.selectedAutocompleteIndex=o)}),s(1,"div",10),F(2,"span",11),to(3,"highlight"),w(4,D0,2,1,"span",12),c(),F(5,"div",13),to(6,"highlight"),c()}if(n&2){let e=t.$implicit,i=t.$index,o=g(2);A("selected",i===o.selectedAutocompleteIndex),Y("aria-selected",i===o.selectedAutocompleteIndex),m(2),x("innerHTML",Vr(3,6,o.autocompleteTrigger+e.name,o.getAutocompleteQuery()),Jt),m(2),S(o.hasParameterFormat(e)?4:-1),m(),x("innerHTML",Vr(6,9,e.description,o.getAutocompleteQuery()),Jt)}}function R0(n,t){if(n&1&&(s(0,"div",4),Oe(1,I0,7,12,"div",8,O0),c()),n&2){let e=g();m(),Ae(e.autocompleteItems)}}function F0(n,t){if(n&1){let e=E();s(0,"ds-icon-button",15),_("action",function(){v(e);let o=g(2);return y(o.onStopClick())}),c()}}function N0(n,t){if(n&1){let e=E();s(0,"ds-icon-button",18),_("action",function(){v(e);let o=g(3);return y(o.triggerFileUpload())}),c(),s(1,"input",19,1),_("change",function(o){v(e);let r=g(3);return y(r.onFileInputChange(o))}),c()}if(n&2){let e=g(3);x("disabled",e.isDisabled||e.isLocallyDisabled)}}function V0(n,t){if(n&1){let e=E();s(0,"ds-icon-button",16),_("action",function(){v(e);let o=g(2);return y(o.sendMessage())}),c(),w(1,N0,3,1),s(2,"ds-icon-button",17),_("action",function(){v(e);let o=g(2);return y(o.toggleRecording())}),c()}if(n&2){let e=g(2);A("hidden",e.isDisabled||!e.message.trim()||e.isLocallyDisabled)("active",!!e.message.trim()&&!e.isDisabled&&!e.isLocallyDisabled),x("title",e.getSendButtonTooltip())("disabled",e.isDisabled||!e.message.trim()||e.isLocallyDisabled),m(),S(e.showWelcome?-1:1),m(),A("recording",e.isRecording)("hidden",e.message.trim()),x("icon",e.isRecording?"fiber_manual_record":"mic")("title",e.isRecording?"Click to stop recording":"Click to start recording")}}function L0(n,t){if(n&1&&w(0,F0,1,0,"ds-icon-button",14)(1,V0,3,13),n&2){let e=g();S(e.isThinking?0:1)}}var mr=class n{static MIN_TEXTAREA_LINES=2;static MAX_TEXTAREA_LINES=15;isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;isLocallyDisabled=!1;filesPasted=new H;messageSubmitted=new H;voiceRecordingToggled=new H;heightChanged=new H;stopRequested=new H;messageInput;fileInput;message="";isRecording=!1;isFocused=!1;recognition=null;sessionHadTranscript=!1;pendingLineBreaksTimeout=null;useEnterToSend=!1;currentInvite="";subscriptions=[];thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;autocompleteVisible=!1;autocompleteTrigger=null;autocompleteItems=[];selectedAutocompleteIndex=0;preferencesService=d(st);codayService=d(mi);agentApiService=d(dr);promptApiService=d(hi);projectStateService=d(we);ngOnInit(){this.initializeVoiceInput(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.subscriptions.push(this.preferencesService.voiceLanguage$.subscribe(()=>this.updateRecognitionLanguage())),this.subscriptions.push(this.preferencesService.enterToSend$.subscribe(t=>{this.useEnterToSend=t})),this.subscribeToInviteEvents(),this.subscribeToMessageRestore()}ngAfterViewInit(){this.adjustTextareaHeight(),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),200)})}ngOnChanges(t){t.isThinking&&(t.isThinking.currentValue?this.startThinkingAnimation():(this.stopThinkingAnimation(),this.isStopping=!1,this.isLocallyDisabled=!1,t.isThinking.previousValue&&(console.log("[CHAT-TEXTAREA] Thinking ended, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})))),t.isSessionInitializing&&!t.isSessionInitializing.currentValue&&t.isSessionInitializing.previousValue&&(console.log("[CHAT-TEXTAREA] Session initialization completed, scheduling focus"),this.isLocallyDisabled=!1,requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})),t.isStarting&&!t.isStarting.currentValue&&t.isStarting.previousValue&&this.isThinking&&(this.thinkingPhraseIndex===0?(console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index 0 - restarting animation"),this.stopThinkingAnimation(),this.startThinkingAnimation()):console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index",this.thinkingPhraseIndex,"- continuing without restart"))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],this.clearPendingLineBreaks(),this.stopThinkingAnimation()}onKeyDown(t){if(this.autocompleteVisible)switch(t.key){case"ArrowDown":t.preventDefault(),this.selectedAutocompleteIndex=Math.min(this.selectedAutocompleteIndex+1,this.autocompleteItems.length-1),this.scrollSelectedItemIntoView();return;case"ArrowUp":t.preventDefault(),this.selectedAutocompleteIndex=Math.max(this.selectedAutocompleteIndex-1,0),this.scrollSelectedItemIntoView();return;case"Tab":case"Enter":if(!this.message.includes(" ")){t.preventDefault(),this.selectAutocompleteItem();return}break;case"Escape":t.preventDefault(),this.hideAutocomplete();return}t.key==="Enter"&&(this.useEnterToSend?!t.shiftKey&&!t.metaKey&&!t.ctrlKey&&(t.preventDefault(),this.sendMessage(!0)):(navigator.platform.toLowerCase().includes("mac")?t.metaKey:t.ctrlKey)&&!t.shiftKey&&(t.preventDefault(),this.sendMessage(!0)))}onInput(){this.adjustTextareaHeight(),this.checkForAutocomplete()}onPaste(t){let e=t.clipboardData?.items;if(!e)return;let i=Array.from(e).filter(r=>r.kind==="file");if(!i.length)return;t.preventDefault();let o=i.reduce((r,a)=>{let l=a.getAsFile();return l?[...r,l]:r},[]);o.length&&this.filesPasted.emit(o)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(t){let e=t.target,i=e.files;if(!i||i.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",i.length);let o=Array.from(i);this.filesPasted.emit(o),e.value=""}onDocumentClick(t){if(!this.autocompleteVisible)return;let e=t.target,i=document.querySelector(".autocomplete-popup"),o=this.messageInput?.nativeElement;i&&!i.contains(e)&&o&&!o.contains(e)&&this.hideAutocomplete()}sendMessage(t=!1){let e=this.message.trim();!this.isDisabled&&!this.isLocallyDisabled&&(t||e)&&(this.isLocallyDisabled=!0,this.messageSubmitted.emit(e),this.message="",setTimeout(()=>this.adjustTextareaHeight(),0))}onStopClick(){this.isStopping=!0,this.stopRequested.emit()}toggleRecording(){this.isRecording?this.stopRecording():this.startRecording()}initializeVoiceInput(){let t=window.SpeechRecognition??window.webkitSpeechRecognition;if(console.log("[SPEECH] speechRecognition",t),!t){console.warn("[SPEECH] Speech Recognition API not available");return}this.recognition=new t,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.lang=this.getSelectedLanguage();try{"grammars"in this.recognition&&(this.recognition.serviceURI=void 0)}catch{console.log("[SPEECH] Advanced speech recognition parameters not supported")}this.recognition.onresult=e=>{let i="";for(let o=e.resultIndex;o<e.results.length;o++){let r=e.results[o][0].transcript;e.results[o].isFinal&&(i+=r)}if(i){let o=this.improveTranscriptPunctuation(i.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(o)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onerror=e=>{console.error("[SPEECH] Speech recognition error:",e.error),console.log("[SPEECH] Error details:",{error:e.error,message:e.message,timeStamp:e.timeStamp}),this.isRecording=!1,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onstart=()=>{console.log("[SPEECH] Recognition started successfully")},this.recognition.onspeechstart=()=>{console.log("[SPEECH] Speech detected")},this.recognition.onspeechend=()=>{console.log("[SPEECH] Speech ended")}}startRecording(){return ie(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording),this.recognition.start(),console.log("[SPEECH] Started recording")}catch(t){console.error("[SPEECH] Failed to start recording:",t),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)}})}stopRecording(){if(!this.recognition||!this.isRecording){console.log("[SPEECH] stopRecording not recording");return}try{console.log("[SPEECH] stopRecording recognition stop"),this.recognition.stop(),this.schedulePendingLineBreaks()}catch(t){console.error("[SPEECH] Failed to stop recording:",t)}}getSelectedLanguage(){return this.preferencesService.getVoiceLanguage()}updateRecognitionLanguage(){if(this.recognition){let t=this.getSelectedLanguage();this.recognition.lang=t,console.log("[SPEECH] Language changed to:",t)}}improveTranscriptPunctuation(t){let e=t;return/[.!?]$/.test(e.trim())||(e=e.trim()+"."),e=e.charAt(0).toUpperCase()+e.slice(1),e=e.replace(/\s+/g," "),e=e+" ",e}appendToTextarea(t){let e=this.message;if(this.message=e?`${e}${t}`:t,this.messageInput?.nativeElement){this.messageInput.nativeElement.focus();let i=this.message.length;this.messageInput.nativeElement.setSelectionRange(i,i)}setTimeout(()=>this.adjustTextareaHeight(),0)}schedulePendingLineBreaks(){this.clearPendingLineBreaks(),this.pendingLineBreaksTimeout=window.setTimeout(()=>{this.sessionHadTranscript&&(console.log("[SPEECH] Adding line breaks after transcript session"),this.appendToTextarea(`
|
|
338
|
+
`):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null)}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(!1),this.tabTitleService&&this.tabTitleService.setSystemInactive()}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var dr=class n{http=d(Ye);agentsCache=new Map;getAgents(t){let e=this.agentsCache.get(t);return e?kt(e):this.http.get(`/api/projects/${t}/agents`).pipe(ct(i=>{this.agentsCache.set(t,i)}))}getAgentsAutocomplete(t,e){return this.getAgents(t).pipe(ve(i=>{if(!e)return i;let o=e.toLowerCase();return i.filter(r=>{let a=r.name.toLowerCase(),l=r.description?.toLowerCase()||"";return a.includes(o)||l.includes(o)})}))}clearCache(t){this.agentsCache.delete(t)}clearAllCache(){this.agentsCache.clear()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var hi=class n{http=d(Ye);projectState=d(we);promptsCache=new Map;getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let i=this.promptsCache.get(t);return i?kt(this.filterPromptsForAutocomplete(i,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(ve(o=>(this.promptsCache.set(t,o),this.filterPromptsForAutocomplete(o,e))))}filterPromptsForAutocomplete(t,e){let i=e.toLowerCase();return t.filter(r=>r.name.toLowerCase().includes(i)||r.description.toLowerCase().includes(i)).map(r=>({name:r.name,description:r.description,parameterFormat:r.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear()}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(ve(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(ve(i=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),i)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(ve(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var _l=class n{sanitizer=d(Ni);transform(t,e){if(!e||!t)return t;let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`(${i})`,"gi"),r=t.replace(o,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(e){return new(e||n)};static \u0275pipe=Jm({name:"highlight",type:n,pure:!0})};var T0=["messageInput"],P0=["fileInput"],O0=(n,t)=>t.name;function A0(n,t){n&1&&(s(0,"div",3),F(1,"span",7),h(2," Recording... Click mic to stop "),c())}function D0(n,t){if(n&1&&(s(0,"span",12),h(1),c()),n&2){let e=g().$implicit,i=g(2);m(),B(" "+(i.getParameterFormat(e)||""))}}function I0(n,t){if(n&1){let e=E();s(0,"div",9),_("click",function(){let o=v(e).$index,r=g(2);return y(r.selectAutocompleteItemByClick(o))})("keydown.enter",function(){let o=v(e).$index,r=g(2);return y(r.selectAutocompleteItemByClick(o))})("keydown.space",function(){let o=v(e).$index,r=g(2);return y(r.selectAutocompleteItemByClick(o))})("mouseenter",function(){let o=v(e).$index,r=g(2);return y(r.selectedAutocompleteIndex=o)}),s(1,"div",10),F(2,"span",11),to(3,"highlight"),w(4,D0,2,1,"span",12),c(),F(5,"div",13),to(6,"highlight"),c()}if(n&2){let e=t.$implicit,i=t.$index,o=g(2);A("selected",i===o.selectedAutocompleteIndex),Y("aria-selected",i===o.selectedAutocompleteIndex),m(2),x("innerHTML",Vr(3,6,o.autocompleteTrigger+e.name,o.getAutocompleteQuery()),Jt),m(2),S(o.hasParameterFormat(e)?4:-1),m(),x("innerHTML",Vr(6,9,e.description,o.getAutocompleteQuery()),Jt)}}function R0(n,t){if(n&1&&(s(0,"div",4),Oe(1,I0,7,12,"div",8,O0),c()),n&2){let e=g();m(),Ae(e.autocompleteItems)}}function F0(n,t){if(n&1){let e=E();s(0,"ds-icon-button",15),_("action",function(){v(e);let o=g(2);return y(o.onStopClick())}),c()}}function N0(n,t){if(n&1){let e=E();s(0,"ds-icon-button",18),_("action",function(){v(e);let o=g(3);return y(o.triggerFileUpload())}),c(),s(1,"input",19,1),_("change",function(o){v(e);let r=g(3);return y(r.onFileInputChange(o))}),c()}if(n&2){let e=g(3);x("disabled",e.isDisabled||e.isLocallyDisabled)}}function V0(n,t){if(n&1){let e=E();s(0,"ds-icon-button",16),_("action",function(){v(e);let o=g(2);return y(o.sendMessage())}),c(),w(1,N0,3,1),s(2,"ds-icon-button",17),_("action",function(){v(e);let o=g(2);return y(o.toggleRecording())}),c()}if(n&2){let e=g(2);A("hidden",e.isDisabled||!e.message.trim()||e.isLocallyDisabled)("active",!!e.message.trim()&&!e.isDisabled&&!e.isLocallyDisabled),x("title",e.getSendButtonTooltip())("disabled",e.isDisabled||!e.message.trim()||e.isLocallyDisabled),m(),S(e.showWelcome?-1:1),m(),A("recording",e.isRecording)("hidden",e.message.trim()),x("icon",e.isRecording?"fiber_manual_record":"mic")("title",e.isRecording?"Click to stop recording":"Click to start recording")}}function L0(n,t){if(n&1&&w(0,F0,1,0,"ds-icon-button",14)(1,V0,3,13),n&2){let e=g();S(e.isThinking?0:1)}}var mr=class n{static MIN_TEXTAREA_LINES=2;static MAX_TEXTAREA_LINES=15;isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;isLocallyDisabled=!1;filesPasted=new H;messageSubmitted=new H;voiceRecordingToggled=new H;heightChanged=new H;stopRequested=new H;messageInput;fileInput;message="";isRecording=!1;isFocused=!1;recognition=null;sessionHadTranscript=!1;pendingLineBreaksTimeout=null;useEnterToSend=!1;currentInvite="";subscriptions=[];thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;autocompleteVisible=!1;autocompleteTrigger=null;autocompleteItems=[];selectedAutocompleteIndex=0;preferencesService=d(st);codayService=d(mi);agentApiService=d(dr);promptApiService=d(hi);projectStateService=d(we);ngOnInit(){this.initializeVoiceInput(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.subscriptions.push(this.preferencesService.voiceLanguage$.subscribe(()=>this.updateRecognitionLanguage())),this.subscriptions.push(this.preferencesService.enterToSend$.subscribe(t=>{this.useEnterToSend=t})),this.subscribeToInviteEvents(),this.subscribeToMessageRestore()}ngAfterViewInit(){this.adjustTextareaHeight(),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),200)})}ngOnChanges(t){t.isThinking&&(t.isThinking.currentValue?this.startThinkingAnimation():(this.stopThinkingAnimation(),this.isStopping=!1,this.isLocallyDisabled=!1,t.isThinking.previousValue&&(console.log("[CHAT-TEXTAREA] Thinking ended, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})))),t.isSessionInitializing&&!t.isSessionInitializing.currentValue&&t.isSessionInitializing.previousValue&&(console.log("[CHAT-TEXTAREA] Session initialization completed, scheduling focus"),this.isLocallyDisabled=!1,requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})),t.isStarting&&!t.isStarting.currentValue&&t.isStarting.previousValue&&this.isThinking&&(this.thinkingPhraseIndex===0?(console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index 0 - restarting animation"),this.stopThinkingAnimation(),this.startThinkingAnimation()):console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index",this.thinkingPhraseIndex,"- continuing without restart"))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],this.clearPendingLineBreaks(),this.stopThinkingAnimation()}onKeyDown(t){if(this.autocompleteVisible)switch(t.key){case"ArrowDown":t.preventDefault(),this.selectedAutocompleteIndex=Math.min(this.selectedAutocompleteIndex+1,this.autocompleteItems.length-1),this.scrollSelectedItemIntoView();return;case"ArrowUp":t.preventDefault(),this.selectedAutocompleteIndex=Math.max(this.selectedAutocompleteIndex-1,0),this.scrollSelectedItemIntoView();return;case"Tab":case"Enter":if(!this.message.includes(" ")){t.preventDefault(),this.selectAutocompleteItem();return}break;case"Escape":t.preventDefault(),this.hideAutocomplete();return}t.key==="Enter"&&(this.useEnterToSend?!t.shiftKey&&!t.metaKey&&!t.ctrlKey&&(t.preventDefault(),this.sendMessage(!0)):(navigator.platform.toLowerCase().includes("mac")?t.metaKey:t.ctrlKey)&&!t.shiftKey&&(t.preventDefault(),this.sendMessage(!0)))}onInput(){this.adjustTextareaHeight(),this.checkForAutocomplete()}onPaste(t){let e=t.clipboardData?.items;if(!e)return;let i=Array.from(e).filter(r=>r.kind==="file");if(!i.length)return;t.preventDefault();let o=i.reduce((r,a)=>{let l=a.getAsFile();return l?[...r,l]:r},[]);o.length&&this.filesPasted.emit(o)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(t){let e=t.target,i=e.files;if(!i||i.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",i.length);let o=Array.from(i);this.filesPasted.emit(o),e.value=""}onDocumentClick(t){if(!this.autocompleteVisible)return;let e=t.target,i=document.querySelector(".autocomplete-popup"),o=this.messageInput?.nativeElement;i&&!i.contains(e)&&o&&!o.contains(e)&&this.hideAutocomplete()}sendMessage(t=!1){let e=this.message.trim();!this.isDisabled&&!this.isLocallyDisabled&&(t||e)&&(this.isLocallyDisabled=!0,this.messageSubmitted.emit(e),this.message="",setTimeout(()=>this.adjustTextareaHeight(),0))}onStopClick(){this.isStopping=!0,this.stopRequested.emit()}toggleRecording(){this.isRecording?this.stopRecording():this.startRecording()}initializeVoiceInput(){let t=window.SpeechRecognition??window.webkitSpeechRecognition;if(console.log("[SPEECH] speechRecognition",t),!t){console.warn("[SPEECH] Speech Recognition API not available");return}this.recognition=new t,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.lang=this.getSelectedLanguage();try{"grammars"in this.recognition&&(this.recognition.serviceURI=void 0)}catch{console.log("[SPEECH] Advanced speech recognition parameters not supported")}this.recognition.onresult=e=>{let i="";for(let o=e.resultIndex;o<e.results.length;o++){let r=e.results[o][0].transcript;e.results[o].isFinal&&(i+=r)}if(i){let o=this.improveTranscriptPunctuation(i.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(o)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onerror=e=>{console.error("[SPEECH] Speech recognition error:",e.error),console.log("[SPEECH] Error details:",{error:e.error,message:e.message,timeStamp:e.timeStamp}),this.isRecording=!1,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onstart=()=>{console.log("[SPEECH] Recognition started successfully")},this.recognition.onspeechstart=()=>{console.log("[SPEECH] Speech detected")},this.recognition.onspeechend=()=>{console.log("[SPEECH] Speech ended")}}startRecording(){return ie(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording),this.recognition.start(),console.log("[SPEECH] Started recording")}catch(t){console.error("[SPEECH] Failed to start recording:",t),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)}})}stopRecording(){if(!this.recognition||!this.isRecording){console.log("[SPEECH] stopRecording not recording");return}try{console.log("[SPEECH] stopRecording recognition stop"),this.recognition.stop(),this.schedulePendingLineBreaks()}catch(t){console.error("[SPEECH] Failed to stop recording:",t)}}getSelectedLanguage(){return this.preferencesService.getVoiceLanguage()}updateRecognitionLanguage(){if(this.recognition){let t=this.getSelectedLanguage();this.recognition.lang=t,console.log("[SPEECH] Language changed to:",t)}}improveTranscriptPunctuation(t){let e=t;return/[.!?]$/.test(e.trim())||(e=e.trim()+"."),e=e.charAt(0).toUpperCase()+e.slice(1),e=e.replace(/\s+/g," "),e=e+" ",e}appendToTextarea(t){let e=this.message;if(this.message=e?`${e}${t}`:t,this.messageInput?.nativeElement){this.messageInput.nativeElement.focus();let i=this.message.length;this.messageInput.nativeElement.setSelectionRange(i,i)}setTimeout(()=>this.adjustTextareaHeight(),0)}schedulePendingLineBreaks(){this.clearPendingLineBreaks(),this.pendingLineBreaksTimeout=window.setTimeout(()=>{this.sessionHadTranscript&&(console.log("[SPEECH] Adding line breaks after transcript session"),this.appendToTextarea(`
|
|
339
339
|
|
|
340
|
-
`),this.sessionHadTranscript=!1),this.pendingLineBreaksTimeout=null},500)}clearPendingLineBreaks(){this.pendingLineBreaksTimeout&&(clearTimeout(this.pendingLineBreaksTimeout),this.pendingLineBreaksTimeout=null)}adjustTextareaHeight(){let t=this.messageInput?.nativeElement;if(!t)return;let e=window.getComputedStyle(t),i=parseFloat(e.fontSize),o=parseFloat(e.lineHeight)||i*1.5,r=o*n.MIN_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),a=o*n.MAX_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom);t.style.height="auto";let l=t.scrollHeight;l<r?l=r:l>a&&(l=a),t.style.height=`${l}px`;let p=t.parentElement?.offsetHeight??l+32;this.heightChanged.emit(p)}getSendButtonShortcut(){return this.useEnterToSend?"Enter":navigator.platform.toLowerCase().includes("mac")?"\u2318+Enter":"Ctrl+Enter"}getSendButtonTooltip(){return this.useEnterToSend?"Send message (Enter) - Shift+Enter for new line":`Send message (${navigator.platform.toLowerCase().includes("mac")?"Cmd+Enter":"Ctrl+Enter"}) - Enter for new line`}getPlaceholder(){return this.isSessionInitializing?"Initializing session...":this.isThinking?this.isStopping?"Stopping...":this.isStarting?"Processing request...":this.currentThinkingPhrase:this.showWelcome?"How can I help you today?":"Type '@' for agents, '/' for commands, or just your message..."}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]??"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]??"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}subscribeToInviteEvents(){this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{t?this.handleInviteEvent(t.invite,t.defaultValue):this.currentInvite=""}))}handleInviteEvent(t,e){this.currentInvite=t,this.isLocallyDisabled=!1,e&&(this.message=e,setTimeout(()=>this.adjustTextareaHeight(),0)),setTimeout(()=>{this.messageInput?.nativeElement&&this.messageInput.nativeElement.focus()},50)}subscribeToMessageRestore(){this.subscriptions.push(this.codayService.messageToRestore$.subscribe(t=>{t.trim()&&(console.log("[CHAT-TEXTAREA] Restoring message content:",t.substring(0,50)+"..."),this.restoreMessageContent(t))}))}restoreMessageContent(t){this.message=t,this.messageInput?.nativeElement&&(this.messageInput.nativeElement.focus(),setTimeout(()=>{let e=this.messageInput.nativeElement,i=this.message.length;e.setSelectionRange(i,i)},0)),setTimeout(()=>this.adjustTextareaHeight(),10)}focusTextarea(){let t=this.messageInput?.nativeElement;console.log("[CHAT-TEXTAREA] focusTextarea called",{hasElement:!!t,isDisabled:this.isDisabled,isThinking:this.isThinking,elementDisabled:t?.disabled,isSessionInitializing:this.isSessionInitializing}),t&&!t.disabled?(t.focus(),console.log("[CHAT-TEXTAREA] Textarea focused successfully")):console.log("[CHAT-TEXTAREA] Focus blocked - element disabled or not available")}checkForAutocomplete(){let t=this.message;if(t.startsWith("@")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showAgentAutocomplete(e);return}if(t.startsWith("/")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showPromptAutocomplete(e);return}this.hideAutocomplete()}showAgentAutocomplete(t){this.autocompleteTrigger="@";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.agentApiService.getAgentsAutocomplete(e,t).subscribe({next:i=>{this.autocompleteItems=i,this.autocompleteVisible=i.length>0,this.selectedAutocompleteIndex=0},error:i=>{console.error("[AUTOCOMPLETE] Error loading agents:",i),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load agents"),this.hideAutocomplete()}}showPromptAutocomplete(t){this.autocompleteTrigger="/";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.promptApiService.getPromptsAutocomplete(e,t).subscribe({next:i=>{this.autocompleteItems=i,this.autocompleteVisible=i.length>0,this.selectedAutocompleteIndex=0},error:i=>{console.error("[AUTOCOMPLETE] Error loading prompts:",i),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load prompts"),this.hideAutocomplete()}}hideAutocomplete(){this.autocompleteVisible=!1,this.autocompleteItems=[],this.selectedAutocompleteIndex=0}selectAutocompleteItem(){let t=this.autocompleteItems[this.selectedAutocompleteIndex];if(!t)return;let e=null;if(this.autocompleteTrigger==="/"){let i=t,o=i.parameterFormat;if(console.log(i),o===void 0)this.message=`/${t.name}`;else if(o==="")this.message=`/${t.name} `;else{this.message=`/${t.name} ${o}`;let r=this.message.indexOf('=""');r!==-1&&(e=r+2)}}else this.message=`@${t.name} `;this.hideAutocomplete(),setTimeout(()=>{if(this.messageInput?.nativeElement)if(this.messageInput.nativeElement.focus(),e!==null)this.messageInput.nativeElement.setSelectionRange(e,e);else{let i=this.message.length;this.messageInput.nativeElement.setSelectionRange(i,i)}},0)}selectAutocompleteItemByClick(t){this.selectedAutocompleteIndex=t,this.selectAutocompleteItem()}getAutocompleteQuery(){return this.message.substring(1).split(" ")[0]??""}getParameterFormat(t){return t.parameterFormat}hasParameterFormat(t){return this.autocompleteTrigger==="/"&&t.parameterFormat!==void 0}scrollSelectedItemIntoView(){setTimeout(()=>{let t=document.querySelector(".autocomplete-popup");if(!t)return;let e=t.querySelector(".autocomplete-item.selected");e&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},0)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-chat-textarea"]],viewQuery:function(e,i){if(e&1&&(ne(T0,7),ne(P0,5)),e&2){let o;W(o=U())&&(i.messageInput=o.first),W(o=U())&&(i.fileInput=o.first)}},hostBindings:function(e,i){e&1&&_("paste",function(r){return i.onPaste(r)})("click",function(r){return i.onDocumentClick(r)},Xm)},inputs:{isDisabled:"isDisabled",showWelcome:"showWelcome",isThinking:"isThinking",isStarting:"isStarting",isSessionInitializing:"isSessionInitializing"},outputs:{filesPasted:"filesPasted",messageSubmitted:"messageSubmitted",voiceRecordingToggled:"voiceRecordingToggled",heightChanged:"heightChanged",stopRequested:"stopRequested"},features:[Le],decls:7,vars:12,consts:[["messageInput",""],["fileInput",""],[1,"chat-input-container"],[1,"recording-indicator"],[1,"autocomplete-popup"],[1,"input-row","grouped-input"],[1,"message-input",3,"ngModelChange","keydown","input","focus","blur","ngModel","placeholder","disabled"],[1,"recording-dot"],["role","option","tabindex","0",1,"autocomplete-item",3,"selected"],["role","option","tabindex","0",1,"autocomplete-item",3,"click","keydown.enter","keydown.space","mouseenter"],[1,"item-name"],[3,"innerHTML"],[1,"parameter-format"],[1,"item-description",3,"innerHTML"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn",3,"action"],["icon","send","variant","primary",1,"send-btn",3,"action","title","disabled"],["variant","default",1,"voice-btn",3,"action","icon","title"],["icon","attach_file","variant","default","title","Upload files (images or documents)",1,"upload-btn",3,"action","disabled"],["type","file","multiple","","accept","image/*,application/pdf,.pdf,.doc,.docx,.txt,.md,.json,.yaml,.yml,.csv,.xml,.html",2,"display","none",3,"change"]],template:function(e,i){if(e&1){let o=E();s(0,"div",2),w(1,A0,3,0,"div",3),w(2,R0,3,0,"div",4),s(3,"div",5)(4,"textarea",6,0),j("ngModelChange",function(a){return v(o),L(i.message,a)||(i.message=a),y(a)}),_("keydown",function(a){return v(o),y(i.onKeyDown(a))})("input",function(){return v(o),y(i.onInput())})("focus",function(){return v(o),y(i.isFocused=!0)})("blur",function(){return v(o),y(i.isFocused=!1)}),c(),w(6,L0,2,1),c()()}e&2&&(m(),S(i.isRecording?1:-1),m(),S(i.autocompleteVisible?2:-1),m(),A("focused",i.isFocused)("welcome-mode",i.showWelcome)("is-thinking",i.isThinking),m(),V("ngModel",i.message),x("placeholder",i.getPlaceholder())("disabled",i.isDisabled||i.isThinking||i.isLocallyDisabled),m(2),S(i.isSessionInitializing?-1:6))},dependencies:[Ke,ze,Xe,Ue,Mh,fl],styles:['@keyframes _ngcontent-%COMP%_gradientBorderShift{0%{background-position:0 0}50%{background-position:100% 0}to{background-position:0 0}}.chat-input-container[_ngcontent-%COMP%]{flex-shrink:0;width:100%;position:relative}.thinking-progress[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;height:3px;z-index:1}.thinking-progress[_ngcontent-%COMP%] .mdc-linear-progress__bar-inner{border-top-width:3px}.input-row.grouped-input[_ngcontent-%COMP%]{display:flex;align-items:center;background:var(--glass-bg);border-radius:16px;padding:0 .15rem 0 1.25rem;position:relative;transition:border-color .2s,box-shadow .2s,background .3s}.input-row[_ngcontent-%COMP%]{position:relative;background:var(--glass-bg, #1e1e1e)!important;background-clip:padding-box}.input-row[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-2px;border-radius:inherit;background-size:200% 100%;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1px;pointer-events:none;z-index:-1;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%]:before{inset:0;mask:none;padding:0;opacity:.15;z-index:0;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% 100%;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%] .message-input[_ngcontent-%COMP%], .input-row.is-thinking[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{position:relative;z-index:1}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking){box-shadow:0 0 0 4px #007aff1a}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking):before{background:var(--color-primary);animation:none}.message-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent!important;box-shadow:none;font-size:1rem;padding:1rem 0;color:var(--color-text);resize:none;min-height:36px;max-height:70vh;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;line-height:1.5}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.message-input[_ngcontent-%COMP%]:focus{outline:none;border:none;box-shadow:none}.message-input[_ngcontent-%COMP%]:disabled{background-color:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;opacity:.6}.message-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);transition:opacity .3s ease-in-out}.message-input[_ngcontent-%COMP%]:disabled::placeholder{animation:_ngcontent-%COMP%_thinkingPulsate 2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_thinkingPulsate{0%,to{opacity:.6}50%{opacity:1}}.voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%]{margin:0 .5rem 0 .08rem}.voice-btn.recording[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--color-error);animation:_ngcontent-%COMP%_pulse 1.5s infinite}.send-btn[_ngcontent-%COMP%]{transition:opacity .4s,margin-left .4s}.send-btn.active[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:1}.send-btn[_ngcontent-%COMP%]:not(.active) button[_ngcontent-%COMP%]{opacity:0;margin-left:calc(-.5rem - 36px)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){color:#fff;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-primary, #3b82f6) 20%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 80%,var(--color-primary, #3b82f6) 100%);background-size:300% auto;animation:sendButtonGradientShift 6s ease-in-out infinite;box-shadow:0 4px 14px #007aff30;transform:scale(1.2)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(1.3);box-shadow:0 4px 24px #007aff30}.recording-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-top:.2rem;margin-bottom:.2rem;color:var(--color-error, #ff5555);font-size:.9rem;position:absolute;top:-1.5rem}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:1}50%{opacity:.5}}.autocomplete-popup[_ngcontent-%COMP%]{position:absolute;bottom:100%;left:0;right:0;margin-bottom:.5rem;background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);border-radius:12px;box-shadow:0 8px 32px #00000026;border:1px solid var(--color-border);max-height:400px;max-width:500px;overflow-y:auto;z-index:100}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]{padding:.75rem 1rem;cursor:pointer;transition:background .2s;border-left:3px solid transparent}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]:hover, .autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{background:var(--color-bg-hover)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{border-left-color:var(--color-primary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-text);margin-bottom:.25rem;font-family:SF Mono,Monaco,Menlo,Cascadia Code,Consolas,monospace;font-size:.95rem}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1));padding:0 2px;border-radius:2px}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] .parameter-format[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-weight:400;opacity:.7}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);line-height:1.3}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1))}@media print{.thinking-progress[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%], .recording-indicator[_ngcontent-%COMP%], .autocomplete-popup[_ngcontent-%COMP%]{display:none!important}}']})};var j0=(n,t)=>t.label;function z0(n,t){if(n&1){let e=E();s(0,"button",2),_("click",function(o){let r=v(e).$implicit,a=g();return y(a.executeAction(r,o))}),s(1,"mat-icon"),h(2),c()()}if(n&2){let e=t.$implicit;Y("title",e.tooltip||e.label),m(),Y("aria-label",e.label),m(),B(e.icon)}}var _l=class n{actions=[];executeAction(t,e){e.stopPropagation(),t.action()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-message-context-menu"]],inputs:{actions:"actions"},decls:3,vars:0,consts:[[1,"context-menu-wrapper"],["mat-icon-button",""],["mat-icon-button","",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0),Oe(1,z0,3,3,"button",1,j0),c()),e&2&&(m(),Ae(i.actions))},dependencies:[De,yt,xe],styles:[".context-menu-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.context-menu-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{transform:scale(.75)}"]})};var bl=class n{snackBar=d(Zr);success(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-success"]})}error(t,e=3e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-error"]})}info(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-info"]})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var B0=n=>({"user-message-wrapper":n});function H0(n,t){if(n&1&&(s(0,"div",5)(1,"div",8),h(2),c()()),n&2){let e=g(2);m(2),ae(" ",e.message.speaker," ")}}function W0(n,t){if(n&1&&(s(0,"div",7),F(1,"app-message-context-menu",9),c()),n&2){let e=g(2);m(),x("actions",e.actions)}}function U0(n,t){if(n&1&&(w(0,H0,3,1,"div",5),F(1,"div",6),w(2,W0,2,1,"div",7)),n&2){let e=g();S(e.shouldShowSpeaker?0:-1),m(),x("innerHTML",e.renderedContent,Jt),m(),S(e.isLongMessage&&e.shouldShowActions&&e.message.role==="assistant"?2:-1)}}function $0(n,t){if(n&1&&(s(0,"a",11),h(1,"view"),c()),n&2){let e=g(2);x("href",e.eventLink,No)}}function q0(n,t){if(n&1&&(s(0,"div",2),F(1,"span",10),w(2,$0,2,1,"a",11),c()),n&2){let e=g();m(),x("innerHTML",e.renderedContent,Jt),m(),S(e.eventLink?2:-1)}}function G0(n,t){if(n&1&&(s(0,"div",3),F(1,"app-message-context-menu",9),c()),n&2){let e=g();m(),x("actions",e.actions)}}function Y0(n,t){if(n&1&&(s(0,"div",4),F(1,"app-message-context-menu",9),c()),n&2){let e=g();m(),x("actions",e.actions)}}var vl=class n{destroy$=new D;message;canDelete=!0;copyRequested=new H;deleteRequested=new H;renderedContent="";shouldHideTechnical=!1;shouldHideWarning=!1;sanitizer=d(Ni);notificationService=d(bl);preferencesService=d(st);projectState=d(we);threadState=d(Rt);markdownService=d(qi);get messageClasses(){return{[this.message.role]:!0,[this.message.type]:!0,"hidden-technical":this.shouldHideTechnical&&this.message.type==="technical","hidden-warning":this.shouldHideWarning&&this.message.type==="warning"}}ngOnInit(){return ie(this,null,function*(){yield this.renderMarkdown(),this.preferencesService.hideTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.shouldHideTechnical=t}),this.preferencesService.hideWarningMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.shouldHideWarning=t}),this.shouldHideTechnical=this.preferencesService.getHideTechnicalMessages(),this.shouldHideWarning=this.preferencesService.getHideWarningMessages()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get shouldShowSpeaker(){return this.message.role==="user"?this.message.speaker.startsWith("@"):this.message.role==="assistant"}get shouldShowActions(){return this.message.role==="user"||this.message.role==="assistant"}get isSimplified(){return this.message.role!=="user"&&this.message.role!=="assistant"}get isLongMessage(){let t=this.extractTextContent();return t.length>1e3||t.split(`
|
|
340
|
+
`),this.sessionHadTranscript=!1),this.pendingLineBreaksTimeout=null},500)}clearPendingLineBreaks(){this.pendingLineBreaksTimeout&&(clearTimeout(this.pendingLineBreaksTimeout),this.pendingLineBreaksTimeout=null)}adjustTextareaHeight(){let t=this.messageInput?.nativeElement;if(!t)return;let e=window.getComputedStyle(t),i=parseFloat(e.fontSize),o=parseFloat(e.lineHeight)||i*1.5,r=o*n.MIN_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),a=o*n.MAX_TEXTAREA_LINES+parseFloat(e.paddingTop)+parseFloat(e.paddingBottom);t.style.height="auto";let l=t.scrollHeight;l<r?l=r:l>a&&(l=a),t.style.height=`${l}px`;let p=t.parentElement?.offsetHeight??l+32;this.heightChanged.emit(p)}getSendButtonShortcut(){return this.useEnterToSend?"Enter":navigator.platform.toLowerCase().includes("mac")?"\u2318+Enter":"Ctrl+Enter"}getSendButtonTooltip(){return this.useEnterToSend?"Send message (Enter) - Shift+Enter for new line":`Send message (${navigator.platform.toLowerCase().includes("mac")?"Cmd+Enter":"Ctrl+Enter"}) - Enter for new line`}getPlaceholder(){return this.isSessionInitializing?"Initializing session...":this.isThinking?this.isStopping?"Stopping...":this.isStarting?"Processing request...":this.currentThinkingPhrase:this.showWelcome?"How can I help you today?":"Type '@' for agents, '/' for commands, or just your message..."}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]??"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]??"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}subscribeToInviteEvents(){this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{t?this.handleInviteEvent(t.invite,t.defaultValue):this.currentInvite=""}))}handleInviteEvent(t,e){this.currentInvite=t,this.isLocallyDisabled=!1,e&&(this.message=e,setTimeout(()=>this.adjustTextareaHeight(),0)),setTimeout(()=>{this.messageInput?.nativeElement&&this.messageInput.nativeElement.focus()},50)}subscribeToMessageRestore(){this.subscriptions.push(this.codayService.messageToRestore$.subscribe(t=>{t.trim()&&(console.log("[CHAT-TEXTAREA] Restoring message content:",t.substring(0,50)+"..."),this.restoreMessageContent(t))}))}restoreMessageContent(t){this.message=t,this.messageInput?.nativeElement&&(this.messageInput.nativeElement.focus(),setTimeout(()=>{let e=this.messageInput.nativeElement,i=this.message.length;e.setSelectionRange(i,i)},0)),setTimeout(()=>this.adjustTextareaHeight(),10)}focusTextarea(){let t=this.messageInput?.nativeElement;console.log("[CHAT-TEXTAREA] focusTextarea called",{hasElement:!!t,isDisabled:this.isDisabled,isThinking:this.isThinking,elementDisabled:t?.disabled,isSessionInitializing:this.isSessionInitializing}),t&&!t.disabled?(t.focus(),console.log("[CHAT-TEXTAREA] Textarea focused successfully")):console.log("[CHAT-TEXTAREA] Focus blocked - element disabled or not available")}checkForAutocomplete(){let t=this.message;if(t.startsWith("@")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showAgentAutocomplete(e);return}if(t.startsWith("/")){let e=t.substring(1);if(e.includes(" ")){this.hideAutocomplete();return}this.showPromptAutocomplete(e);return}this.hideAutocomplete()}showAgentAutocomplete(t){this.autocompleteTrigger="@";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.agentApiService.getAgentsAutocomplete(e,t).subscribe({next:i=>{this.autocompleteItems=i,this.autocompleteVisible=i.length>0,this.selectedAutocompleteIndex=0},error:i=>{console.error("[AUTOCOMPLETE] Error loading agents:",i),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load agents"),this.hideAutocomplete()}}showPromptAutocomplete(t){this.autocompleteTrigger="/";try{let e=this.projectStateService.getSelectedProjectIdOrThrow();this.promptApiService.getPromptsAutocomplete(e,t).subscribe({next:i=>{this.autocompleteItems=i,this.autocompleteVisible=i.length>0,this.selectedAutocompleteIndex=0},error:i=>{console.error("[AUTOCOMPLETE] Error loading prompts:",i),this.hideAutocomplete()}})}catch{console.warn("[AUTOCOMPLETE] No project selected, cannot load prompts"),this.hideAutocomplete()}}hideAutocomplete(){this.autocompleteVisible=!1,this.autocompleteItems=[],this.selectedAutocompleteIndex=0}selectAutocompleteItem(){let t=this.autocompleteItems[this.selectedAutocompleteIndex];if(!t)return;let e=null;if(this.autocompleteTrigger==="/"){let i=t,o=i.parameterFormat;if(console.log(i),o===void 0)this.message=`/${t.name}`;else if(o==="")this.message=`/${t.name} `;else{this.message=`/${t.name} ${o}`;let r=this.message.indexOf('=""');r!==-1&&(e=r+2)}}else this.message=`@${t.name} `;this.hideAutocomplete(),setTimeout(()=>{if(this.messageInput?.nativeElement)if(this.messageInput.nativeElement.focus(),e!==null)this.messageInput.nativeElement.setSelectionRange(e,e);else{let i=this.message.length;this.messageInput.nativeElement.setSelectionRange(i,i)}},0)}selectAutocompleteItemByClick(t){this.selectedAutocompleteIndex=t,this.selectAutocompleteItem()}getAutocompleteQuery(){return this.message.substring(1).split(" ")[0]??""}getParameterFormat(t){return t.parameterFormat}hasParameterFormat(t){return this.autocompleteTrigger==="/"&&t.parameterFormat!==void 0}scrollSelectedItemIntoView(){setTimeout(()=>{let t=document.querySelector(".autocomplete-popup");if(!t)return;let e=t.querySelector(".autocomplete-item.selected");e&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},0)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-chat-textarea"]],viewQuery:function(e,i){if(e&1&&(ne(T0,7),ne(P0,5)),e&2){let o;W(o=U())&&(i.messageInput=o.first),W(o=U())&&(i.fileInput=o.first)}},hostBindings:function(e,i){e&1&&_("paste",function(r){return i.onPaste(r)})("click",function(r){return i.onDocumentClick(r)},Km)},inputs:{isDisabled:"isDisabled",showWelcome:"showWelcome",isThinking:"isThinking",isStarting:"isStarting",isSessionInitializing:"isSessionInitializing"},outputs:{filesPasted:"filesPasted",messageSubmitted:"messageSubmitted",voiceRecordingToggled:"voiceRecordingToggled",heightChanged:"heightChanged",stopRequested:"stopRequested"},features:[Le],decls:7,vars:12,consts:[["messageInput",""],["fileInput",""],[1,"chat-input-container"],[1,"recording-indicator"],[1,"autocomplete-popup"],[1,"input-row","grouped-input"],[1,"message-input",3,"ngModelChange","keydown","input","focus","blur","ngModel","placeholder","disabled"],[1,"recording-dot"],["role","option","tabindex","0",1,"autocomplete-item",3,"selected"],["role","option","tabindex","0",1,"autocomplete-item",3,"click","keydown.enter","keydown.space","mouseenter"],[1,"item-name"],[3,"innerHTML"],[1,"parameter-format"],[1,"item-description",3,"innerHTML"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn",3,"action"],["icon","send","variant","primary",1,"send-btn",3,"action","title","disabled"],["variant","default",1,"voice-btn",3,"action","icon","title"],["icon","attach_file","variant","default","title","Upload files (images or documents)",1,"upload-btn",3,"action","disabled"],["type","file","multiple","","accept","image/*,application/pdf,.pdf,.doc,.docx,.txt,.md,.json,.yaml,.yml,.csv,.xml,.html",2,"display","none",3,"change"]],template:function(e,i){if(e&1){let o=E();s(0,"div",2),w(1,A0,3,0,"div",3),w(2,R0,3,0,"div",4),s(3,"div",5)(4,"textarea",6,0),j("ngModelChange",function(a){return v(o),L(i.message,a)||(i.message=a),y(a)}),_("keydown",function(a){return v(o),y(i.onKeyDown(a))})("input",function(){return v(o),y(i.onInput())})("focus",function(){return v(o),y(i.isFocused=!0)})("blur",function(){return v(o),y(i.isFocused=!1)}),c(),w(6,L0,2,1),c()()}e&2&&(m(),S(i.isRecording?1:-1),m(),S(i.autocompleteVisible?2:-1),m(),A("focused",i.isFocused)("welcome-mode",i.showWelcome)("is-thinking",i.isThinking),m(),V("ngModel",i.message),x("placeholder",i.getPlaceholder())("disabled",i.isDisabled||i.isThinking||i.isLocallyDisabled),m(2),S(i.isSessionInitializing?-1:6))},dependencies:[Ke,ze,Xe,Ue,Mh,_l],styles:['@keyframes _ngcontent-%COMP%_gradientBorderShift{0%{background-position:0 0}50%{background-position:100% 0}to{background-position:0 0}}.chat-input-container[_ngcontent-%COMP%]{flex-shrink:0;width:100%;position:relative}.thinking-progress[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;height:3px;z-index:1}.thinking-progress[_ngcontent-%COMP%] .mdc-linear-progress__bar-inner{border-top-width:3px}.input-row.grouped-input[_ngcontent-%COMP%]{display:flex;align-items:center;background:var(--glass-bg);border-radius:16px;padding:0 .15rem 0 1.25rem;position:relative;transition:border-color .2s,box-shadow .2s,background .3s}.input-row[_ngcontent-%COMP%]{position:relative;background:var(--glass-bg, #1e1e1e)!important;background-clip:padding-box}.input-row[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-2px;border-radius:inherit;background-size:200% 100%;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1px;pointer-events:none;z-index:-1;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%]:before{inset:0;mask:none;padding:0;opacity:.15;z-index:0;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% 100%;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%] .message-input[_ngcontent-%COMP%], .input-row.is-thinking[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{position:relative;z-index:1}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking){box-shadow:0 0 0 4px #007aff1a}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking):before{background:var(--color-primary);animation:none}.message-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent!important;box-shadow:none;font-size:1rem;padding:1rem 0;color:var(--color-text);resize:none;min-height:36px;max-height:70vh;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;line-height:1.5}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.message-input[_ngcontent-%COMP%]:focus{outline:none;border:none;box-shadow:none}.message-input[_ngcontent-%COMP%]:disabled{background-color:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;opacity:.6}.message-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);transition:opacity .3s ease-in-out}.message-input[_ngcontent-%COMP%]:disabled::placeholder{animation:_ngcontent-%COMP%_thinkingPulsate 2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_thinkingPulsate{0%,to{opacity:.6}50%{opacity:1}}.voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%]{margin:0 .5rem 0 .08rem}.voice-btn.recording[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--color-error);animation:_ngcontent-%COMP%_pulse 1.5s infinite}.send-btn[_ngcontent-%COMP%]{transition:opacity .4s,margin-left .4s}.send-btn.active[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:1}.send-btn[_ngcontent-%COMP%]:not(.active) button[_ngcontent-%COMP%]{opacity:0;margin-left:calc(-.5rem - 36px)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){color:#fff;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-primary, #3b82f6) 20%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 80%,var(--color-primary, #3b82f6) 100%);background-size:300% auto;animation:sendButtonGradientShift 6s ease-in-out infinite;box-shadow:0 4px 14px #007aff30;transform:scale(1.2)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(1.3);box-shadow:0 4px 24px #007aff30}.recording-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-top:.2rem;margin-bottom:.2rem;color:var(--color-error, #ff5555);font-size:.9rem;position:absolute;top:-1.5rem}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:1}50%{opacity:.5}}.autocomplete-popup[_ngcontent-%COMP%]{position:absolute;bottom:100%;left:0;right:0;margin-bottom:.5rem;background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);border-radius:12px;box-shadow:0 8px 32px #00000026;border:1px solid var(--color-border);max-height:400px;max-width:500px;overflow-y:auto;z-index:100}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]{padding:.75rem 1rem;cursor:pointer;transition:background .2s;border-left:3px solid transparent}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]:hover, .autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{background:var(--color-bg-hover)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{border-left-color:var(--color-primary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-text);margin-bottom:.25rem;font-family:SF Mono,Monaco,Menlo,Cascadia Code,Consolas,monospace;font-size:.95rem}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1));padding:0 2px;border-radius:2px}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] .parameter-format[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-weight:400;opacity:.7}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);line-height:1.3}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1))}@media print{.thinking-progress[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%], .recording-indicator[_ngcontent-%COMP%], .autocomplete-popup[_ngcontent-%COMP%]{display:none!important}}']})};var j0=(n,t)=>t.label;function z0(n,t){if(n&1){let e=E();s(0,"button",2),_("click",function(o){let r=v(e).$implicit,a=g();return y(a.executeAction(r,o))}),s(1,"mat-icon"),h(2),c()()}if(n&2){let e=t.$implicit;Y("title",e.tooltip||e.label),m(),Y("aria-label",e.label),m(),B(e.icon)}}var bl=class n{actions=[];executeAction(t,e){e.stopPropagation(),t.action()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-message-context-menu"]],inputs:{actions:"actions"},decls:3,vars:0,consts:[[1,"context-menu-wrapper"],["mat-icon-button",""],["mat-icon-button","",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0),Oe(1,z0,3,3,"button",1,j0),c()),e&2&&(m(),Ae(i.actions))},dependencies:[De,yt,xe],styles:[".context-menu-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.context-menu-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{transform:scale(.75)}"]})};var vl=class n{snackBar=d(Jr);success(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-success"]})}error(t,e=3e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-error"]})}info(t,e=2e3){this.snackBar.open(t,"",{duration:e,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-info"]})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var B0=n=>({"user-message-wrapper":n});function H0(n,t){if(n&1&&(s(0,"div",5)(1,"div",9),h(2),c()()),n&2){let e=g(2);m(2),ae(" ",e.message.speaker," ")}}function W0(n,t){if(n&1&&(s(0,"time",7),h(1),c()),n&2){let e=g(2);m(),B(e.formattedTimestamp)}}function U0(n,t){if(n&1&&(s(0,"div",8),F(1,"app-message-context-menu",10),c()),n&2){let e=g(2);m(),x("actions",e.actions)}}function $0(n,t){if(n&1&&(w(0,H0,3,1,"div",5),F(1,"div",6),w(2,W0,2,1,"time",7),w(3,U0,2,1,"div",8)),n&2){let e=g();S(e.shouldShowSpeaker?0:-1),m(),x("innerHTML",e.renderedContent,Jt),m(),S(e.formattedTimestamp?2:-1),m(),S(e.isLongMessage&&e.shouldShowActions&&e.message.role==="assistant"?3:-1)}}function q0(n,t){if(n&1&&(s(0,"a",12),h(1,"view"),c()),n&2){let e=g(2);x("href",e.eventLink,No)}}function G0(n,t){if(n&1&&(s(0,"div",2),F(1,"span",11),w(2,q0,2,1,"a",12),c()),n&2){let e=g();m(),x("innerHTML",e.renderedContent,Jt),m(),S(e.eventLink?2:-1)}}function Y0(n,t){if(n&1&&(s(0,"div",3),F(1,"app-message-context-menu",10),c()),n&2){let e=g();m(),x("actions",e.actions)}}function Q0(n,t){if(n&1&&(s(0,"div",4),F(1,"app-message-context-menu",10),c()),n&2){let e=g();m(),x("actions",e.actions)}}var yl=class n{destroy$=new D;message;canDelete=!0;copyRequested=new H;deleteRequested=new H;renderedContent="";shouldHideTechnical=!1;shouldHideWarning=!1;sanitizer=d(Ni);notificationService=d(vl);preferencesService=d(st);projectState=d(we);threadState=d(Rt);markdownService=d(qi);get messageClasses(){return{[this.message.role]:!0,[this.message.type]:!0,"hidden-technical":this.shouldHideTechnical&&this.message.type==="technical","hidden-warning":this.shouldHideWarning&&this.message.type==="warning"}}ngOnInit(){return ie(this,null,function*(){yield this.renderMarkdown(),this.preferencesService.hideTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.shouldHideTechnical=t}),this.preferencesService.hideWarningMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.shouldHideWarning=t}),this.shouldHideTechnical=this.preferencesService.getHideTechnicalMessages(),this.shouldHideWarning=this.preferencesService.getHideWarningMessages()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get shouldShowSpeaker(){return this.message.role==="user"?this.message.speaker.startsWith("@"):this.message.role==="assistant"}get shouldShowActions(){return this.message.role==="user"||this.message.role==="assistant"}get isSimplified(){return this.message.role!=="user"&&this.message.role!=="assistant"}datePipe=d(jr);get formattedTimestamp(){if(this.message.role!=="user"||!this.message.timestamp)return null;let t=new Date().toDateString()===this.message.timestamp.toDateString();return this.datePipe.transform(this.message.timestamp,t?"HH:mm":"dd/MM HH:mm")}get isLongMessage(){let t=this.extractTextContent();return t.length>1e3||t.split(`
|
|
341
341
|
`).length>20}get actions(){let t=[];return this.message.role==="user"&&this.canDelete&&t.push({icon:"delete",label:"Delete from here",tooltip:"Delete this message and all following messages",action:()=>this.onDelete(),destructive:!0}),t.push({icon:"content_copy",label:"Copy message",tooltip:"Copy message content to clipboard",action:()=>this.onCopy()}),t}get eventLink(){if(!this.message.eventId)return null;let t=this.projectState.getSelectedProjectId(),e=this.threadState.getSelectedThreadId();return!t||!e?null:`/api/projects/${t}/threads/${e}/messages/${encodeURIComponent(this.message.eventId)}/formatted`}renderMarkdown(){return ie(this,null,function*(){try{let t=yield this.renderRichContent(this.message.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("Error parsing rich content:",t);let e=this.extractTextContent();this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(e)}})}renderRichContent(t){return ie(this,null,function*(){let e=[];for(let i of t)if(i.type==="text"){let o=yield this.markdownService.parse(i.content);e.push(`<div class="text-part">${o}</div>`)}else if(i.type==="image"){let o=`data:${i.mimeType};base64,${i.content}`,r=i.source||"Image",a=`
|
|
342
342
|
<div class="image-content">
|
|
343
343
|
<img src="${o}"
|
|
@@ -348,9 +348,9 @@ This ensures the memory system stays efficient and valuable.`],createdBy:"system
|
|
|
348
348
|
</div>
|
|
349
349
|
`;e.push(a)}return e.join("")})}onCopy(){let t=this.extractTextContent();t.trim()&&navigator.clipboard.writeText(t).then(()=>{console.log("[CHAT-MESSAGE] Message copied to clipboard"),this.notificationService.success("Message copied to clipboard")}).catch(e=>{console.error("[CHAT-MESSAGE] Failed to copy message:",e),this.notificationService.error("Failed to copy message")}),this.copyRequested.emit(this.message)}onDelete(){console.log("[CHAT-MESSAGE] Delete requested for message:",this.message.id),this.deleteRequested.emit(this.message)}extractTextContent(){return this.message.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
350
350
|
|
|
351
|
-
`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-chat-message"]],inputs:{message:"message",canDelete:"canDelete"},outputs:{copyRequested:"copyRequested",deleteRequested:"deleteRequested"},decls:6,vars:8,consts:[[1,"message-wrapper",3,"ngClass"],[1,"message",3,"ngClass"],[1,"simple-content","markdown-content"],[1,"actions","assistant-top-actions"],[1,"actions","user-top-actions"],[1,"message-header"],[1,"content","markdown-content",3,"innerHTML"],[1,"actions","bottom-actions"],[1,"speaker"],[3,"actions"],[3,"innerHTML"],["target","_blank",1,"event-link",3,"href"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),w(2,U0,3,3),w(3,q0,3,2,"div",2),c(),w(4,G0,2,1,"div",3),w(5,Y0,2,1,"div",4),c()),e&2&&(x("ngClass",nh(6,B0,i.message.role==="user")),m(),x("ngClass",i.messageClasses),m(),S(i.isSimplified?-1:2),m(),S(i.isSimplified?3:-1),m(),S(!i.isLongMessage&&i.shouldShowActions&&i.message.role==="assistant"?4:-1),m(),S(i.shouldShowActions&&i.message.role==="user"?5:-1))},dependencies:[_l,An],styles:[".message-wrapper[_ngcontent-%COMP%]{margin:0;display:flex;align-items:flex-start;gap:.5rem}.message-wrapper.user-message-wrapper[_ngcontent-%COMP%]{margin:.75rem 0;flex-direction:row-reverse;align-items:flex-start}.message[_ngcontent-%COMP%]{position:relative}.message.user[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:var(--color-message-user);border-radius:18px 18px 6px;border:1px solid var(--glass-border);box-shadow:none;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);width:fit-content;max-width:75%;min-width:120px;word-wrap:break-word;transition:transform .2s ease,box-shadow .2s ease}.message.user[_ngcontent-%COMP%]:hover{transform:translateY(-1px);box-shadow:0 12px 40px #1f268733}.message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.message.system[_ngcontent-%COMP%], .message.technical[_ngcontent-%COMP%]{padding:.5rem .75rem;background:transparent;border:none;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;margin:0;font-family:SF Mono,Monaco,Menlo,monospace;font-size:.85rem;color:var(--color-text-secondary);max-width:none;width:auto;min-width:auto}.message.system[_ngcontent-%COMP%]:hover, .message.technical[_ngcontent-%COMP%]:hover{transform:none;box-shadow:none}.message.hidden-technical[_ngcontent-%COMP%], .message.hidden-warning[_ngcontent-%COMP%]{display:none!important}.message.error[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff3b301f;border-left:3px solid var(--color-error);color:var(--color-error)}.message.warning[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff95001f;border-left:3px solid var(--color-warning);color:var(--color-warning)}.message-header[_ngcontent-%COMP%]{margin-bottom:.5rem}.speaker[_ngcontent-%COMP%]{font-weight:600;font-size:.85rem;color:var(--color-text-secondary, #6272a4)}.content[_ngcontent-%COMP%]{line-height:1.5}.context-menu-top[_ngcontent-%COMP%]{top:.5rem;right:.5rem;z-index:10}.context-menu-bottom[_ngcontent-%COMP%]{bottom:.5rem;right:.5rem;z-index:10}.user-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.user-message-wrapper[_ngcontent-%COMP%]:hover .user-top-actions[_ngcontent-%COMP%]{opacity:1}.assistant-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.message-wrapper[_ngcontent-%COMP%]:hover .assistant-top-actions[_ngcontent-%COMP%]{opacity:1}.simple-content[_ngcontent-%COMP%]{display:flex}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]{margin-left:5px;font-size:.9em;color:var(--color-link, #3498db);text-decoration:none}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.text-part[_ngcontent-%COMP%]{margin:4px 0}.image-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;margin:1em 0}.message-image[_ngcontent-%COMP%]{display:block;max-width:100%;height:auto;margin:8px 0;border-radius:12px;cursor:pointer;box-shadow:var(--glass-shadow);transition:transform .3s ease,box-shadow .3s ease;border:1px solid var(--glass-border)}.message-image[_ngcontent-%COMP%]:hover{transform:scale(1.02) translateY(-2px);box-shadow:0 16px 48px #00000026}@media (max-width: 768px){.message-image[_ngcontent-%COMP%]{border-radius:4px;margin:6px 0}}@media (max-width: 480px){.message-image[_ngcontent-%COMP%]{margin:4px 0}}"]})};var hr=class n{unreadCountSubject=new se(0);unreadCount$=this.unreadCountSubject.asObservable();constructor(){console.log("[UNREAD] Service initialized")}addUnread(){let e=this.unreadCountSubject.value+1;this.unreadCountSubject.next(e),console.log("[UNREAD] Added unread message, total:",e)}markAllAsRead(){this.unreadCountSubject.value>0&&(this.unreadCountSubject.next(0),console.log("[UNREAD] Marked all messages as read"))}getCurrentCount(){return this.unreadCountSubject.value}reset(){this.unreadCountSubject.next(0),console.log("[UNREAD] Counter reset")}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var pr=class n{destroy$=new D;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new se(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=d(st);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech()}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(t=>t([]));return}this.voices=new Promise((t,e)=>{let i=speechSynthesis.getVoices();if(i.length)t(i);else{let o=setTimeout(()=>{e("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let r=speechSynthesis.getVoices();r.length&&(clearTimeout(o),t(r))})}}),console.log("[VOICE-SERVICE] Speech synthesis initialized")}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(N(this.destroy$)).subscribe(t=>{this.volume=t,console.log("[VOICE-SERVICE] Volume updated to:",t)}),this.preferencesService.voiceRate$.pipe(N(this.destroy$)).subscribe(t=>{this.rate=t,console.log("[VOICE-SERVICE] Rate updated to:",t)}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(t=>{this.language=t,console.log("[VOICE-SERVICE] Language updated to:",t),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(N(this.destroy$)).subscribe(t=>{this.setSelectedVoice(t)}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice())}isReady(){return"speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(t,e){return ie(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),!1;if(!t.trim())return console.warn("[VOICE-SERVICE] No text to speak"),!1;let i=this.extractPlainText(t);if(!i.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let o=new SpeechSynthesisUtterance(i);o.voice=this.selectedVoice,o.lang=this.selectedVoice.lang,o.volume=this.volume,o.rate=this.rate,this.currentOnEndCallback=e||null,e&&(o.onend=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())},o.onerror=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())}),this.currentUtterance=o,this.speakingSubject.next(!0);let r=o.onend,a=o.onerror;return o.onend=l=>{this.speakingSubject.next(!1),r&&r.call(o,l)},o.onerror=l=>{this.speakingSubject.next(!1),a&&a.call(o,l)},speechSynthesis.speak(o),console.log("[VOICE-SERVICE] Started speaking:",t.substring(0,50)+"..."),!0}catch(o){return console.error("[VOICE-SERVICE] Error speaking:",o),!1}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let t=this.currentOnEndCallback;this.currentOnEndCallback=null,t()}this.speakingSubject.next(!1),console.log("[VOICE-SERVICE] Speech stopped")}}ding(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(800,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.1),e.start(t.currentTime),e.stop(t.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played")}catch(t){console.error("[VOICE-SERVICE] Notification sound failed:",t)}}getVoicesForLanguage(){return ie(this,null,function*(){try{let t=this.language.slice(0,2),e=yield this.voices;if(!e||e.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let i=e.filter(o=>o.lang.toLowerCase().startsWith(t)).sort((o,r)=>o.localService&&!r.localService?-1:!o.localService&&r.localService?1:o.name.localeCompare(r.name));return console.log("[VOICE-SERVICE] Found matching voices:",i.length,"for language:",t),i.map(o=>({name:o.name,lang:o.lang,localService:o.localService,default:o.default,displayName:this.formatVoiceDisplayName(o)}))}catch(t){return console.error("[VOICE-SERVICE] Error getting voices for language:",t),[]}})}formatVoiceDisplayName(t){let e=t.localService?"\u{1F3E0}":"\u2601\uFE0F",i=t.default?" \u2B50":"";return`${e} ${t.name} (${t.lang})${i}`}setSelectedVoice(t){return ie(this,null,function*(){if(!t){this.selectedVoice=void 0;return}let[e,i]=t.split("|");if(!e||!i){this.selectedVoice=void 0;return}let o=(yield this.voices)?.find(r=>r.name===e&&r.lang===i);o?(this.selectedVoice=o,console.log("[VOICE-SERVICE] Selected voice:",o.name,o.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",e,i))})}updateSelectedVoiceForLanguage(){return ie(this,null,function*(){let t=yield this.getVoicesForLanguage();if(t.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let e=this.preferencesService.getSelectedVoice();if(e){let[o,r]=e.split("|"),a=r?.slice(0,2),l=this.language.slice(0,2);if(a===l&&t.some(u=>u.name===o&&u.lang===r)){console.log("[VOICE-SERVICE] Keeping current voice for language:",e);return}}let i=t[0];if(i){let o=`${i.name}|${i.lang}`;this.preferencesService.setSelectedVoice(o),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",i.displayName)}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let t=this.getTestText();t&&this.speak(t)},100)}getTestText(){let t=this.language.slice(0,2),e={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return e[t]||e.en||"Hello, this is a test."}extractPlainText(t){let e=t.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/ /g," ").replace(/&/g,"and").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"');return e=this.addNaturalPunctuation(e),e.replace(/\s+/g," ").trim()}addNaturalPunctuation(t){return t.replace(/\n+/g,`
|
|
351
|
+
`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-chat-message"]],inputs:{message:"message",canDelete:"canDelete"},outputs:{copyRequested:"copyRequested",deleteRequested:"deleteRequested"},features:[pe([jr])],decls:6,vars:8,consts:[[1,"message-wrapper",3,"ngClass"],[1,"message",3,"ngClass"],[1,"simple-content","markdown-content"],[1,"actions","assistant-top-actions"],[1,"actions","user-top-actions"],[1,"message-header"],[1,"content","markdown-content",3,"innerHTML"],[1,"message-timestamp"],[1,"actions","bottom-actions"],[1,"speaker"],[3,"actions"],[3,"innerHTML"],["target","_blank",1,"event-link",3,"href"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1),w(2,$0,4,4),w(3,G0,3,2,"div",2),c(),w(4,Y0,2,1,"div",3),w(5,Q0,2,1,"div",4),c()),e&2&&(x("ngClass",oh(6,B0,i.message.role==="user")),m(),x("ngClass",i.messageClasses),m(),S(i.isSimplified?-1:2),m(),S(i.isSimplified?3:-1),m(),S(!i.isLongMessage&&i.shouldShowActions&&i.message.role==="assistant"?4:-1),m(),S(i.shouldShowActions&&i.message.role==="user"?5:-1))},dependencies:[bl,An],styles:[".message-wrapper[_ngcontent-%COMP%]{margin:0;display:flex;align-items:flex-start;gap:.5rem}.message-wrapper.user-message-wrapper[_ngcontent-%COMP%]{margin:.75rem 0;flex-direction:row-reverse;align-items:flex-start}.message[_ngcontent-%COMP%]{position:relative}.message.user[_ngcontent-%COMP%]{padding:1rem 1.25rem .5rem;background:var(--color-message-user);border-radius:18px 18px 6px;border:1px solid var(--glass-border);box-shadow:none;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);width:fit-content;max-width:75%;min-width:120px;word-wrap:break-word;transition:transform .2s ease,box-shadow .2s ease}.message.user[_ngcontent-%COMP%] .message-timestamp[_ngcontent-%COMP%]{display:block;text-align:right;font-size:.7rem;color:var(--color-text-secondary, #6272a4);white-space:nowrap;margin-top:.4rem;opacity:.7}.message.user[_ngcontent-%COMP%]:hover{transform:translateY(-1px);box-shadow:0 12px 40px #1f268733}.message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.message.system[_ngcontent-%COMP%], .message.technical[_ngcontent-%COMP%]{padding:.5rem .75rem;background:transparent;border:none;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;margin:0;font-family:SF Mono,Monaco,Menlo,monospace;font-size:.85rem;color:var(--color-text-secondary);max-width:none;width:auto;min-width:auto}.message.system[_ngcontent-%COMP%]:hover, .message.technical[_ngcontent-%COMP%]:hover{transform:none;box-shadow:none}.message.hidden-technical[_ngcontent-%COMP%], .message.hidden-warning[_ngcontent-%COMP%]{display:none!important}.message.error[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff3b301f;border-left:3px solid var(--color-error);color:var(--color-error)}.message.warning[_ngcontent-%COMP%]{padding:1rem 1.25rem;background:#ff95001f;border-left:3px solid var(--color-warning);color:var(--color-warning)}.message-header[_ngcontent-%COMP%]{margin-bottom:.5rem}.speaker[_ngcontent-%COMP%]{font-weight:600;font-size:.85rem;color:var(--color-text-secondary, #6272a4)}.content[_ngcontent-%COMP%]{line-height:1.5}.context-menu-top[_ngcontent-%COMP%]{top:.5rem;right:.5rem;z-index:10}.context-menu-bottom[_ngcontent-%COMP%]{bottom:.5rem;right:.5rem;z-index:10}.user-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.user-message-wrapper[_ngcontent-%COMP%]:hover .user-top-actions[_ngcontent-%COMP%]{opacity:1}.assistant-top-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding-top:.5rem;opacity:0;transition:opacity .2s ease}.message-wrapper[_ngcontent-%COMP%]:hover .assistant-top-actions[_ngcontent-%COMP%]{opacity:1}.simple-content[_ngcontent-%COMP%]{display:flex}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]{margin-left:5px;font-size:.9em;color:var(--color-link, #3498db);text-decoration:none}.simple-content[_ngcontent-%COMP%] .event-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.text-part[_ngcontent-%COMP%]{margin:4px 0}.image-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;margin:1em 0}.message-image[_ngcontent-%COMP%]{display:block;max-width:100%;height:auto;margin:8px 0;border-radius:12px;cursor:pointer;box-shadow:var(--glass-shadow);transition:transform .3s ease,box-shadow .3s ease;border:1px solid var(--glass-border)}.message-image[_ngcontent-%COMP%]:hover{transform:scale(1.02) translateY(-2px);box-shadow:0 16px 48px #00000026}@media (max-width: 768px){.message-image[_ngcontent-%COMP%]{border-radius:4px;margin:6px 0}}@media (max-width: 480px){.message-image[_ngcontent-%COMP%]{margin:4px 0}}"]})};var hr=class n{unreadCountSubject=new se(0);unreadCount$=this.unreadCountSubject.asObservable();constructor(){console.log("[UNREAD] Service initialized")}addUnread(){let e=this.unreadCountSubject.value+1;this.unreadCountSubject.next(e),console.log("[UNREAD] Added unread message, total:",e)}markAllAsRead(){this.unreadCountSubject.value>0&&(this.unreadCountSubject.next(0),console.log("[UNREAD] Marked all messages as read"))}getCurrentCount(){return this.unreadCountSubject.value}reset(){this.unreadCountSubject.next(0),console.log("[UNREAD] Counter reset")}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var pr=class n{destroy$=new D;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new se(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=d(st);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech()}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(t=>t([]));return}this.voices=new Promise((t,e)=>{let i=speechSynthesis.getVoices();if(i.length)t(i);else{let o=setTimeout(()=>{e("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let r=speechSynthesis.getVoices();r.length&&(clearTimeout(o),t(r))})}}),console.log("[VOICE-SERVICE] Speech synthesis initialized")}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(N(this.destroy$)).subscribe(t=>{this.volume=t,console.log("[VOICE-SERVICE] Volume updated to:",t)}),this.preferencesService.voiceRate$.pipe(N(this.destroy$)).subscribe(t=>{this.rate=t,console.log("[VOICE-SERVICE] Rate updated to:",t)}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(t=>{this.language=t,console.log("[VOICE-SERVICE] Language updated to:",t),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(N(this.destroy$)).subscribe(t=>{this.setSelectedVoice(t)}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice())}isReady(){return"speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(t,e){return ie(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),!1;if(!t.trim())return console.warn("[VOICE-SERVICE] No text to speak"),!1;let i=this.extractPlainText(t);if(!i.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let o=new SpeechSynthesisUtterance(i);o.voice=this.selectedVoice,o.lang=this.selectedVoice.lang,o.volume=this.volume,o.rate=this.rate,this.currentOnEndCallback=e||null,e&&(o.onend=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())},o.onerror=()=>{this.currentOnEndCallback===e&&(this.currentOnEndCallback=null,e())}),this.currentUtterance=o,this.speakingSubject.next(!0);let r=o.onend,a=o.onerror;return o.onend=l=>{this.speakingSubject.next(!1),r&&r.call(o,l)},o.onerror=l=>{this.speakingSubject.next(!1),a&&a.call(o,l)},speechSynthesis.speak(o),console.log("[VOICE-SERVICE] Started speaking:",t.substring(0,50)+"..."),!0}catch(o){return console.error("[VOICE-SERVICE] Error speaking:",o),!1}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let t=this.currentOnEndCallback;this.currentOnEndCallback=null,t()}this.speakingSubject.next(!1),console.log("[VOICE-SERVICE] Speech stopped")}}ding(){try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(800,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.1),e.start(t.currentTime),e.stop(t.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played")}catch(t){console.error("[VOICE-SERVICE] Notification sound failed:",t)}}getVoicesForLanguage(){return ie(this,null,function*(){try{let t=this.language.slice(0,2),e=yield this.voices;if(!e||e.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let i=e.filter(o=>o.lang.toLowerCase().startsWith(t)).sort((o,r)=>o.localService&&!r.localService?-1:!o.localService&&r.localService?1:o.name.localeCompare(r.name));return console.log("[VOICE-SERVICE] Found matching voices:",i.length,"for language:",t),i.map(o=>({name:o.name,lang:o.lang,localService:o.localService,default:o.default,displayName:this.formatVoiceDisplayName(o)}))}catch(t){return console.error("[VOICE-SERVICE] Error getting voices for language:",t),[]}})}formatVoiceDisplayName(t){let e=t.localService?"\u{1F3E0}":"\u2601\uFE0F",i=t.default?" \u2B50":"";return`${e} ${t.name} (${t.lang})${i}`}setSelectedVoice(t){return ie(this,null,function*(){if(!t){this.selectedVoice=void 0;return}let[e,i]=t.split("|");if(!e||!i){this.selectedVoice=void 0;return}let o=(yield this.voices)?.find(r=>r.name===e&&r.lang===i);o?(this.selectedVoice=o,console.log("[VOICE-SERVICE] Selected voice:",o.name,o.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",e,i))})}updateSelectedVoiceForLanguage(){return ie(this,null,function*(){let t=yield this.getVoicesForLanguage();if(t.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let e=this.preferencesService.getSelectedVoice();if(e){let[o,r]=e.split("|"),a=r?.slice(0,2),l=this.language.slice(0,2);if(a===l&&t.some(u=>u.name===o&&u.lang===r)){console.log("[VOICE-SERVICE] Keeping current voice for language:",e);return}}let i=t[0];if(i){let o=`${i.name}|${i.lang}`;this.preferencesService.setSelectedVoice(o),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",i.displayName)}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let t=this.getTestText();t&&this.speak(t)},100)}getTestText(){let t=this.language.slice(0,2),e={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return e[t]||e.en||"Hello, this is a test."}extractPlainText(t){let e=t.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/ /g," ").replace(/&/g,"and").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"');return e=this.addNaturalPunctuation(e),e.replace(/\s+/g," ").trim()}addNaturalPunctuation(t){return t.replace(/\n+/g,`
|
|
352
352
|
`).split(`
|
|
353
|
-
`).map(e=>this.addPeriodIfNeeded(e.trim())).filter(e=>e.length>0).join(" ")}addPeriodIfNeeded(t){return t?/[.!?;:]$/.test(t)?t:t+".":""}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var
|
|
353
|
+
`).map(e=>this.addPeriodIfNeeded(e.trim())).filter(e=>e.length>0).join(" ")}addPeriodIfNeeded(t){return t?/[.!?;:]$/.test(t)?t:t+".":""}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Cl=class n{thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;ngOnInit(){this.startThinkingAnimation()}ngOnDestroy(){this.stopThinkingAnimation()}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]||"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]||"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-thinking-loader"]],decls:8,vars:1,consts:[[1,"message-wrapper"],[1,"message","assistant","thinking-message"],[1,"content"],[1,"thinking-loader"],[1,"logo-container"],["src","CODAY-Logo.png","alt","Coday Logo",1,"coday-logo"],[1,"thinking-text"]],template:function(e,i){e&1&&(ri(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),eo(5,"img",5),ai(),ri(6,"p",6),h(7),ai()()()()()),e&2&&(m(7),B(i.currentThinkingPhrase))},dependencies:[De],styles:[".message-wrapper[_ngcontent-%COMP%]{margin:0;display:flex;align-items:flex-start;gap:.5rem}.message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.message.thinking-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{line-height:1.5}.thinking-loader[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:.75rem 0}.logo-container[_ngcontent-%COMP%]{position:relative;width:32px;height:32px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.coday-logo[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain;animation:_ngcontent-%COMP%_pulse 2s ease-in-out infinite;filter:drop-shadow(0 1px 4px rgba(0,0,0,.1))}.thinking-text[_ngcontent-%COMP%]{font-size:.95rem;font-weight:400;color:var(--color-text-secondary);margin:0;animation:_ngcontent-%COMP%_fadeInOut 2s ease-in-out infinite;letter-spacing:.01em;font-style:italic}@keyframes _ngcontent-%COMP%_pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.1);opacity:.7}}@keyframes _ngcontent-%COMP%_fadeInOut{0%,to{opacity:.6}50%{opacity:1}}@media (max-width: 768px){.logo-container[_ngcontent-%COMP%]{width:28px;height:28px}.thinking-text[_ngcontent-%COMP%]{font-size:.875rem}.thinking-loader[_ngcontent-%COMP%]{gap:.75rem}}@media print{.thinking-loader[_ngcontent-%COMP%]{display:none!important}}"]})};var X0=(n,t)=>t.id;function K0(n,t){if(n&1){let e=E();s(0,"app-chat-message",4),_("copyRequested",function(o){v(e);let r=g();return y(r.onCopyMessage(o))})("deleteRequested",function(o){v(e);let r=g();return y(r.onDeleteMessage(o))}),c()}if(n&2){let e=t.$implicit,i=t.$index,o=g();x("message",e)("canDelete",o.canDeleteMessage(i))}}function Z0(n,t){if(n&1&&(s(0,"div",2),F(1,"div",5),c()),n&2){let e=g();m(),x("innerHTML",e.renderedStreamingText,Jt)}}function J0(n,t){n&1&&F(0,"app-thinking-loader")}function ey(n,t){if(n&1){let e=E();s(0,"button",6),_("click",function(){v(e);let o=g();return y(o.goToBottom())}),s(1,"mat-icon",7),h(2,"arrow_downward"),c()()}}var xl=class n{messages=[];streamingText="";isThinking=!1;copyRequested=new H;stopRequested=new H;lastMessageCount=0;destroy$=new D;renderedStreamingText="";isTracking=!0;showGoToBottom=!1;scrollContainer=null;lastScrollTop=0;NEAR_BOTTOM_THRESHOLD=100;scrollCheckTimeout;isProgrammaticScroll=!1;MESSAGE_FRESHNESS_THRESHOLD=300*1e3;elementRef=d(K);unreadService=d(hr);voiceSynthesisService=d(pr);preferencesService=d(st);codayService=d(mi);markdownService=d(qi);sanitizer=d(Ni);ngOnInit(){this.findScrollContainer(),this.setupFocusListeners()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.scrollCheckTimeout&&clearTimeout(this.scrollCheckTimeout),window.removeEventListener("focus",this.handleWindowFocus),window.removeEventListener("blur",this.handleWindowBlur)}ngOnChanges(t){t.streamingText&&(this.renderStreamingText(),this.streamingText&&this.isTracking&&setTimeout(()=>this.scrollToBottom(),0))}ngAfterViewChecked(){if(this.messages.length!==this.lastMessageCount){console.log("[CHAT-HISTORY] Message count changed:",this.lastMessageCount,"->",this.messages.length);let t=this.messages.length-this.lastMessageCount;t>0&&(this.handleNewMessages(t),this.handleVoiceAnnouncement(t)),this.lastMessageCount=this.messages.length,this.isTracking&&this.scrollToBottom()}this.scrollContainer||this.findScrollContainer()}scrollToBottom(){try{this.scrollContainer||this.findScrollContainer(),this.scrollContainer&&(this.isProgrammaticScroll=!0,setTimeout(()=>{this.scrollContainer&&this.scrollContainer.scrollTo({top:this.scrollContainer.scrollHeight,behavior:"smooth"}),setTimeout(()=>{this.isProgrammaticScroll=!1},600)},50))}catch(t){console.error("Error scrolling to bottom:",t)}}trackByMessageId(t,e){return e.id}onCopyMessage(t){let e=t.content.filter(i=>i.type==="text").map(i=>i.content).join(`
|
|
354
354
|
|
|
355
355
|
`);navigator.clipboard.writeText(e).then(()=>console.log("Message copied")).catch(i=>console.error("Failed to copy:",i)),this.copyRequested.emit(t)}onStop(){this.stopRequested.emit()}canDeleteMessage(t){return t===0?!1:!this.isThinking}onDeleteMessage(t){if(console.log("[CHAT-HISTORY] Delete requested for message:",t.id),this.messages.findIndex(o=>o.id===t.id)===0){console.warn("[CHAT-HISTORY] Cannot delete first message");return}if(this.isThinking){console.warn("[CHAT-HISTORY] Cannot delete message while agent is thinking");return}if(t.role!=="user"){console.warn("[CHAT-HISTORY] Can only delete user messages");return}confirm(`Delete this message and all following messages?
|
|
356
356
|
|
|
@@ -358,20 +358,20 @@ This action cannot be undone once you post another message.`)&&(console.log("[CH
|
|
|
358
358
|
|
|
359
359
|
`)}extractPartialText(t){return t.split(`
|
|
360
360
|
`).filter(a=>a.trim().length>0).reduce((a,l)=>{if(a.paragraphs>=3)return a;let p=l.length>80?1:0;return{paragraphs:a.paragraphs+p,text:a.text+(a.text?`
|
|
361
|
-
`:"")+l}},{paragraphs:0,text:""}).text||t}renderStreamingText(){return ie(this,null,function*(){if(!this.streamingText){this.renderedStreamingText="";return}try{let t=yield this.markdownService.parse(this.streamingText);this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CHAT-HISTORY] Error rendering streaming text markdown:",t),this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(this.streamingText)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-chat-history"]],hostBindings:function(e,i){e&1&&_("scroll",function(){return i.onScroll()})},inputs:{messages:"messages",streamingText:"streamingText",isThinking:"isThinking"},outputs:{copyRequested:"copyRequested",stopRequested:"stopRequested"},features:[Le],decls:6,vars:3,consts:[[1,"chat-history"],[3,"message","canDelete"],[1,"streaming-message","message","assistant"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn"],[3,"copyRequested","deleteRequested","message","canDelete"],[1,"content","markdown-content",3,"innerHTML"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn",3,"click"],["fontSet","material-icons-outlined"]],template:function(e,i){e&1&&(s(0,"div",0),Oe(1,X0,1,2,"app-chat-message",1,Q0),w(3,K0,2,1,"div",2),w(4,Z0,1,0,"app-thinking-loader"),w(5,J0,3,0,"button",3),c()),e&2&&(m(),Ae(i.messages),m(2),S(i.streamingText?3:-1),m(),S(i.isThinking?4:-1),m(),S(i.showGoToBottom?5:-1))},dependencies:[vl,xe,yl,as],styles:[".streaming-message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.streaming-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{color:var(--color-text);line-height:1.5}.go-to-bottom-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:120px!important;right:2rem!important;z-index:1000!important}@media (max-width: 768px){.go-to-bottom-btn[_ngcontent-%COMP%]{right:1rem!important;bottom:100px!important}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.chat-history[_ngcontent-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.go-to-bottom-btn[_ngcontent-%COMP%]{display:none!important}}"]})};var xl=class n{http=d(Ye);projectState=d(we);threadState=d(Rt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/files`}uploadFile(t){let e=this.projectState.getSelectedProjectIdOrThrow(),i=this.threadState.getSelectedThreadIdOrThrow();return new oi(o=>{let r=new FileReader;r.onload=()=>{let l=r.result.split(",")[1];this.http.post(`/api/projects/${e}/threads/${i}/upload`,{content:l,mimeType:t.type||"application/octet-stream",filename:t.name}).subscribe({next:p=>{o.next({success:p.success,filename:p.filename}),o.complete()},error:p=>o.error(p)})},r.onerror=()=>o.error(new Error("Failed to read file")),r.readAsDataURL(t)})}listFiles(){return this.http.get(this.getBaseUrl()).pipe(ve(t=>t.files))}downloadFile(t){let e=encodeURIComponent(t);return this.http.get(`${this.getBaseUrl()}/${e}`,{responseType:"blob"})}deleteFile(t){let e=encodeURIComponent(t);return this.http.delete(`${this.getBaseUrl()}/${e}`)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var ur=class n{fileApi=d(xl);eventStream=d(Xi);filesSignal=Te([]);isLoadingSignal=Te(!1);currentProjectSignal=Te(null);currentThreadSignal=Te(null);files=ft(()=>this.filesSignal());isLoading=ft(()=>this.isLoadingSignal());fileCount=ft(()=>this.filesSignal().length);constructor(){this.subscribeToFileEvents()}initializeForThread(t,e){this.currentProjectSignal.set(t),this.currentThreadSignal.set(e),this.refreshFileList()}clear(){this.filesSignal.set([]),this.currentProjectSignal.set(null),this.currentThreadSignal.set(null)}refreshFileList(){this.isLoadingSignal.set(!0),this.fileApi.listFiles().subscribe({next:t=>{let e=t.map(i=>Ie(q({},i),{lastModified:new Date(i.lastModified)})).sort((i,o)=>o.lastModified.getTime()-i.lastModified.getTime());this.filesSignal.set(e),this.isLoadingSignal.set(!1)},error:t=>{console.error("[FILE_EXCHANGE_STATE] Error loading files:",t),this.isLoadingSignal.set(!1)}})}uploadFile(t){return ie(this,null,function*(){return new Promise(e=>{this.fileApi.uploadFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Upload error:",i),e({success:!1,error:i.message||"Upload failed"})}})})})}downloadAllFiles(){let t=this.filesSignal();if(t.length===0){console.warn("[FILE_EXCHANGE_STATE] No files to download");return}t.forEach((e,i)=>{setTimeout(()=>{this.downloadFile(e.filename)},i*300)})}downloadFile(t){this.fileApi.downloadFile(t).subscribe({next:e=>{let i=window.URL.createObjectURL(e),o=document.createElement("a");o.href=i,o.download=t,o.click(),window.URL.revokeObjectURL(i)},error:e=>{console.error("[FILE_EXCHANGE_STATE] Download error:",e)}})}deleteFile(t){return ie(this,null,function*(){return new Promise(e=>{this.fileApi.deleteFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Delete error:",i),e({success:!1,error:i.message||"Delete failed"})}})})})}subscribeToFileEvents(){this.eventStream.events$.pipe(pe(t=>t instanceof Wn),js()).subscribe(t=>{this.handleFileEvent(t)})}handleFileEvent(t){let e=this.filesSignal();switch(t.operation){case"created":{let i=t.timestamp,o=t.timestamp.lastIndexOf("-");if(o>0){let a=t.timestamp.substring(o+1);a.length===5&&/^[a-z0-9]+$/.test(a)&&(i=t.timestamp.substring(0,o))}let r={filename:t.filename,size:t.size||0,lastModified:new Date(i)};this.filesSignal.set([r,...e]);break}case"updated":{let i=e.filter(p=>p.filename!==t.filename),o=e.find(p=>p.filename===t.filename),r=t.timestamp,a=t.timestamp.lastIndexOf("-");if(a>0){let p=t.timestamp.substring(a+1);p.length===5&&/^[a-z0-9]+$/.test(p)&&(r=t.timestamp.substring(0,a))}let l={filename:t.filename,size:t.size||o?.size||0,lastModified:new Date(r)};this.filesSignal.set([l,...i]);break}case"deleted":{let i=e.filter(o=>o.filename!==t.filename);this.filesSignal.set(i);break}}}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var ey=["determinateSpinner"];function ty(n,t){if(n&1&&(on(),s(0,"svg",11),F(1,"circle",12),c()),n&2){let e=g();Y("viewBox",e._viewBox()),m(),Fi("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),Y("r",e._circleRadius())}}var iy=new ee("mat-progress-spinner-default-options",{providedIn:"root",factory:ny});function ny(){return{diameter:ag}}var ag=100,oy=10,wl=(()=>{class n{_elementRef=d(K);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=d(iy),i=Sh(),o=this._elementRef.nativeElement;this._noopAnimations=i==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=o.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&i==="reduced-motion"&&o.classList.add("mat-progress-spinner-reduced-motion"),e&&(e.color&&(this.color=this._defaultColor=e.color),e.diameter&&(this.diameter=e.diameter),e.strokeWidth&&(this.strokeWidth=e.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(e){this._value=Math.max(0,Math.min(100,e||0))}_value=0;get diameter(){return this._diameter}set diameter(e){this._diameter=e||0}_diameter=ag;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0}_strokeWidth;_circleRadius(){return(this.diameter-oy)/2}_viewBox(){let e=this._circleRadius()*2+this.strokeWidth;return`0 0 ${e} ${e}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(i,o){if(i&1&&ne(ey,5),i&2){let r;W(r=U())&&(o._determinateCircle=r.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(i,o){i&2&&(Y("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",o.mode==="determinate"?o.value:null)("mode",o.mode),rn("mat-"+o.color),Fi("width",o.diameter,"px")("height",o.diameter,"px")("--mat-progress-spinner-size",o.diameter+"px")("--mat-progress-spinner-active-indicator-width",o.diameter+"px"),A("_mat-animation-noopable",o._noopAnimations)("mdc-circular-progress--indeterminate",o.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",_i],diameter:[2,"diameter","diameter",_i],strokeWidth:[2,"strokeWidth","strokeWidth",_i]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(i,o){if(i&1&&(Ge(0,ty,2,8,"ng-template",null,0,Ga),s(2,"div",2,1),on(),s(4,"svg",3),F(5,"circle",4),c()(),Ua(),s(6,"div",5)(7,"div",6)(8,"div",7),qa(9,8),c(),s(10,"div",9),qa(11,8),c(),s(12,"div",10),qa(13,8),c()()()),i&2){let r=ti(1);m(4),Y("viewBox",o._viewBox()),m(),Fi("stroke-dasharray",o._strokeCircumference(),"px")("stroke-dashoffset",o._strokeDashOffset(),"px")("stroke-width",o._circleStrokeWidth(),"%"),Y("r",o._circleRadius()),m(4),x("ngTemplateOutlet",r),m(2),x("ngTemplateOutlet",r),m(2),x("ngTemplateOutlet",r)}},dependencies:[Xa],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
|
|
362
|
-
`],encapsulation:2,changeDetection:0})}return n})();var Sl=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le]})}return n})();function ry(n,t){if(n&1&&F(0,"div",1),n&2){let e=g();x("innerHTML",e.renderedContent,Jt)}}function ay(n,t){if(n&1&&F(0,"iframe",2),n&2){let e=g();x("srcdoc",e.content,Jt)}}function sy(n,t){if(n&1&&(s(0,"pre",3),h(1),c()),n&2){let e=g();m(),B(e.content)}}var kl=class n{content="";format="text";renderedContent="";sanitizer=d(Ni);markdownService=d(qi);ngOnChanges(t){(t.content||t.format)&&this.renderContent()}renderContent(){this.format==="markdown"?this.renderMarkdown():this.format==="json"&&this.formatJson()}renderMarkdown(){return ie(this,null,function*(){try{let t=yield this.markdownService.parse(this.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CONTENT_RENDERER] Error rendering markdown:",t),this.content=this.content}})}formatJson(){try{let t=JSON.parse(this.content);this.content=JSON.stringify(t,null,2)}catch(t){console.error("[CONTENT_RENDERER] Error formatting JSON:",t)}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-content-renderer"]],inputs:{content:"content",format:"format"},features:[Le],decls:4,vars:2,consts:[[1,"content-renderer",3,"ngClass"],[1,"markdown-content",3,"innerHTML"],["sandbox","allow-same-origin",1,"html-viewer",3,"srcdoc"],[1,"code-content"]],template:function(e,i){e&1&&(s(0,"div",0),w(1,ry,1,1,"div",1)(2,ay,1,1,"iframe",2)(3,sy,2,1,"pre",3),c()),e&2&&(x("ngClass","format-"+i.format),m(),S(i.format==="markdown"?1:i.format==="html"?2:3))},dependencies:[De,An],styles:[".content-renderer[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;padding:1rem}.markdown-content[_ngcontent-%COMP%]{line-height:1.6;color:var(--color-text)}.code-content[_ngcontent-%COMP%]{font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:.9rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word;color:var(--color-text)}.format-json[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-code-text, #d63384)}.format-yaml[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%], .format-text[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-text)}.html-viewer[_ngcontent-%COMP%]{width:100%;height:100%;min-height:400px;border:1px solid var(--color-border);border-radius:8px;background:#fff}"]})};var gr=class n{http=d(Ye);MAX_FILE_SIZE=20*1024*1024;isViewable(t){return t<=this.MAX_FILE_SIZE}isFormatViewable(t){let e=t.split(".").pop()?.toLowerCase();return!(e&&["pdf","png","jpg","jpeg","gif","webp","zip","tar","gz","exe","bin","doc","docx","xls","xlsx","ppt","pptx"].includes(e))}detectFormat(t){switch(t.split(".").pop()?.toLowerCase()){case"md":return"markdown";case"json":return"json";case"yaml":case"yml":return"yaml";case"html":case"htm":return"html";default:return"text"}}loadFileContent(t,e,i){let o=`/api/projects/${t}/threads/${e}/files/${encodeURIComponent(i)}`,r=this.detectFormat(i);return this.http.get(o,{responseType:"text",observe:"response"}).pipe(ve(a=>{let l=a.body||"",p=new Blob([l]).size;return{content:l,format:r,filename:i,size:p}}),Xn(a=>(console.error("[CONTENT_VIEWER] Error loading file:",i,a),Ir(()=>new Error(`Failed to load file: ${a.message||"Unknown error"}`)))))}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function ly(n,t){if(n&1){let e=E();s(0,"button",12),_("click",function(){v(e);let o=g();return y(o.download())}),s(1,"mat-icon"),h(2,"download"),c()()}}function cy(n,t){n&1&&(s(0,"div",9),F(1,"mat-spinner",13),s(2,"p"),h(3,"Loading file content..."),c()())}function dy(n,t){if(n&1){let e=E();s(0,"div",10)(1,"mat-icon",14),h(2,"error_outline"),c(),s(3,"p",15),h(4),c(),s(5,"button",16),_("click",function(){v(e);let o=g();return y(o.download())}),s(6,"mat-icon"),h(7,"download"),c(),h(8," Download instead "),c()()}if(n&2){let e=g();m(4),B(e.error)}}function my(n,t){if(n&1&&F(0,"app-content-renderer",11),n&2){let e=g();x("content",e.fileContent.content)("format",e.fileContent.format)}}var Ml=class n{destroy$=new D;file;projectName;threadId;closeViewer=new H;contentService=d(gr);eventStream=d(Xi);fileContent=null;isLoading=!1;error="";ngOnInit(){this.loadContent(),this.subscribeToFileEvents()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadContent(){if(!this.contentService.isViewable(this.file.size)){this.error=`File too large to view (${this.contentService.formatSize(this.file.size)}). Maximum size: 20 MB.`;return}this.isLoading=!0,this.error="",this.contentService.loadFileContent(this.projectName,this.threadId,this.file.filename).subscribe({next:t=>{console.log("[CONTENT_VIEWER] Content loaded:",t.filename),this.fileContent=t,this.isLoading=!1},error:t=>{console.error("[CONTENT_VIEWER] Error loading content:",t),this.error=t.message||"Failed to load file content",this.isLoading=!1}})}onClose(){this.closeViewer.emit()}download(){let t=new Blob([this.fileContent?.content||""],{type:"text/plain"}),e=window.URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download=this.file.filename,i.click(),window.URL.revokeObjectURL(e)}formatSize(t){return this.contentService.formatSize(t)}subscribeToFileEvents(){this.eventStream.events$.pipe(pe(t=>t instanceof Wn),pe(t=>t.filename===this.file.filename),pe(t=>t.operation==="updated"),N(this.destroy$)).subscribe(t=>{console.log("[CONTENT_VIEWER] File updated event received, reloading:",t.filename),t.size&&(this.file.size=t.size),this.loadContent()})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-content-viewer"]],inputs:{file:"file",projectName:"projectName",threadId:"threadId"},outputs:{closeViewer:"closeViewer"},decls:16,vars:6,consts:[[1,"viewer-container"],[1,"viewer-header"],[1,"header-info"],[1,"filename"],[1,"file-size"],[1,"header-actions"],["mat-icon-button","","title","Download","type","button"],["mat-icon-button","","title","Close","type","button",3,"click"],[1,"viewer-content"],[1,"loading-state"],[1,"error-state"],[3,"content","format"],["mat-icon-button","","title","Download","type","button",3,"click"],["diameter","48"],[1,"error-icon"],[1,"error-message"],["mat-raised-button","","color","primary","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),h(4),c(),s(5,"span",4),h(6),c()(),s(7,"div",5),w(8,ly,3,0,"button",6),s(9,"button",7),_("click",function(){return i.onClose()}),s(10,"mat-icon"),h(11,"chevron_right"),c()()()(),s(12,"div",8),w(13,cy,4,0,"div",9),w(14,dy,9,1,"div",10),w(15,my,1,2,"app-content-renderer",11),c()()),e&2&&(m(4),B(i.file.filename),m(2),B(i.formatSize(i.file.size)),m(2),S(i.fileContent&&!i.isLoading&&!i.error?8:-1),m(5),S(i.isLoading?13:-1),m(),S(i.error?14:-1),m(),S(i.fileContent&&!i.isLoading&&!i.error?15:-1))},dependencies:[De,Qe,xe,xt,It,yt,Sl,wl,kl],styles:[".viewer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--color-bg)}.viewer-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:1rem;border-bottom:1px solid var(--color-border);background:var(--color-bg);flex-shrink:0}.header-info[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.filename[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-size[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary)}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0}.viewer-content[_ngcontent-%COMP%]{flex:1;overflow:auto;background:var(--color-bg)}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;color:var(--color-text-secondary)}.error-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;padding:2rem;text-align:center}.error-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{color:var(--color-text);margin:0;max-width:400px}"]})};var hy=Math.pow(10,8)*24*60*60*1e3,BR=-hy,El=6048e5,cg=864e5;var py=3600;var dg=py*24,HR=dg*7,uy=dg*365.2425,gy=uy/12,WR=gy*3,Yd=Symbol.for("constructDateFrom");function pt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Yd in n?n[Yd](t):n instanceof Date?new n.constructor(t):new Date(t)}function Ze(n,t){return pt(t||n,n)}function mg(n,t,e){let i=Ze(n,e?.in);return isNaN(t)?pt(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}var fy={};function $n(){return fy}function Cn(n,t){let e=$n(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,o=Ze(n,t?.in),r=o.getDay(),a=(r<i?7:0)+r-i;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function yo(n,t){return Cn(n,Ie(q({},t),{weekStartsOn:1}))}function Tl(n,t){let e=Ze(n,t?.in),i=e.getFullYear(),o=pt(e,0);o.setFullYear(i+1,0,4),o.setHours(0,0,0,0);let r=yo(o),a=pt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);let l=yo(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function Qd(n){let t=Ze(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function fr(n,...t){let e=pt.bind(null,n||t.find(i=>typeof i=="object"));return t.map(e)}function _r(n,t){let e=Ze(n,t?.in);return e.setHours(0,0,0,0),e}function Pl(n,t,e){let[i,o]=fr(e?.in,n,t),r=_r(i),a=_r(o),l=+r-Qd(r),p=+a-Qd(a);return Math.round((l-p)/cg)}function hg(n,t){let e=Tl(n,t),i=pt(t?.in||n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),yo(i)}function pg(n){return pt(n,Date.now())}function ug(n,t,e){let[i,o]=fr(e?.in,n,t);return+_r(i)==+_r(o)}function gg(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function fg(n){return!(!gg(n)&&typeof n!="number"||isNaN(+Ze(n)))}function bg(n,t,e){let[i,o]=fr(e?.in,n,t),r=_g(i,o),a=Math.abs(Pl(i,o));i.setDate(i.getDate()-r*a);let l=+(_g(i,o)===-r),p=r*(a-l);return p===0?0:p}function _g(n,t){let e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function vg(n,t){let e=Ze(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}var _y={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yg=(n,t,e)=>{let i,o=_y[n];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ol(n){return(t={})=>{let e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}var by={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},vy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cg={date:Ol({formats:by,defaultWidth:"full"}),time:Ol({formats:vy,defaultWidth:"full"}),dateTime:Ol({formats:yy,defaultWidth:"full"})};var Cy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xg=(n,t,e,i)=>Cy[n];function br(n){return(t,e)=>{let i=e?.context?String(e.context):"standalone",o;if(i==="formatting"&&n.formattingValues){let a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;o=n.formattingValues[l]||n.formattingValues[a]}else{let a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;o=n.values[l]||n.values[a]}let r=n.argumentCallback?n.argumentCallback(t):t;return o[r]}}var xy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Sy={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ky={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},My={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ey={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ty=(n,t)=>{let e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},wg={ordinalNumber:Ty,era:br({values:xy,defaultWidth:"wide"}),quarter:br({values:wy,defaultWidth:"wide",argumentCallback:n=>n-1}),month:br({values:Sy,defaultWidth:"wide"}),day:br({values:ky,defaultWidth:"wide"}),dayPeriod:br({values:My,defaultWidth:"wide",formattingValues:Ey,defaultFormattingWidth:"wide"})};function vr(n){return(t,e={})=>{let i=e.width,o=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(o);if(!r)return null;let a=r[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],p=Array.isArray(l)?Oy(l,C=>C.test(a)):Py(l,C=>C.test(a)),u;u=n.valueCallback?n.valueCallback(p):p,u=e.valueCallback?e.valueCallback(u):u;let b=t.slice(a.length);return{value:u,rest:b}}}function Py(n,t){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Oy(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Sg(n){return(t,e={})=>{let i=t.match(n.matchPattern);if(!i)return null;let o=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;let l=t.slice(o.length);return{value:a,rest:l}}}var Ay=/^(\d+)(th|st|nd|rd)?/i,Dy=/\d+/i,Iy={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ry={any:[/^b/i,/^(a|c)/i]},Fy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ny={any:[/1/i,/2/i,/3/i,/4/i]},Vy={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ly={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},jy={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},zy={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},By={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Hy={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},kg={ordinalNumber:Sg({matchPattern:Ay,parsePattern:Dy,valueCallback:n=>parseInt(n,10)}),era:vr({matchPatterns:Iy,defaultMatchWidth:"wide",parsePatterns:Ry,defaultParseWidth:"any"}),quarter:vr({matchPatterns:Fy,defaultMatchWidth:"wide",parsePatterns:Ny,defaultParseWidth:"any",valueCallback:n=>n+1}),month:vr({matchPatterns:Vy,defaultMatchWidth:"wide",parsePatterns:Ly,defaultParseWidth:"any"}),day:vr({matchPatterns:jy,defaultMatchWidth:"wide",parsePatterns:zy,defaultParseWidth:"any"}),dayPeriod:vr({matchPatterns:By,defaultMatchWidth:"any",parsePatterns:Hy,defaultParseWidth:"any"})};var Xd={code:"en-US",formatDistance:yg,formatLong:Cg,formatRelative:xg,localize:wg,match:kg,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Mg(n,t){let e=Ze(n,t?.in);return Pl(e,vg(e))+1}function Eg(n,t){let e=Ze(n,t?.in),i=+yo(e)-+hg(e);return Math.round(i/El)+1}function Al(n,t){let e=Ze(n,t?.in),i=e.getFullYear(),o=$n(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=pt(t?.in||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);let l=Cn(a,t),p=pt(t?.in||n,0);p.setFullYear(i,0,r),p.setHours(0,0,0,0);let u=Cn(p,t);return+e>=+l?i+1:+e>=+u?i:i-1}function Tg(n,t){let e=$n(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,o=Al(n,t),r=pt(t?.in||n,0);return r.setFullYear(o,0,i),r.setHours(0,0,0,0),Cn(r,t)}function Pg(n,t){let e=Ze(n,t?.in),i=+Cn(e,t)-+Tg(e,t);return Math.round(i/El)+1}function ke(n,t){let e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}var xn={y(n,t){let e=n.getFullYear(),i=e>0?e:1-e;return ke(t==="yy"?i%100:i,t.length)},M(n,t){let e=n.getMonth();return t==="M"?String(e+1):ke(e+1,2)},d(n,t){return ke(n.getDate(),t.length)},a(n,t){let e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return ke(n.getHours()%12||12,t.length)},H(n,t){return ke(n.getHours(),t.length)},m(n,t){return ke(n.getMinutes(),t.length)},s(n,t){return ke(n.getSeconds(),t.length)},S(n,t){let e=t.length,i=n.getMilliseconds(),o=Math.trunc(i*Math.pow(10,e-3));return ke(o,t.length)}};var yr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kd={G:function(n,t,e){let i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){let i=n.getFullYear(),o=i>0?i:1-i;return e.ordinalNumber(o,{unit:"year"})}return xn.y(n,t)},Y:function(n,t,e,i){let o=Al(n,i),r=o>0?o:1-o;if(t==="YY"){let a=r%100;return ke(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):ke(r,t.length)},R:function(n,t){let e=Tl(n);return ke(e,t.length)},u:function(n,t){let e=n.getFullYear();return ke(e,t.length)},Q:function(n,t,e){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ke(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ke(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){let i=n.getMonth();switch(t){case"M":case"MM":return xn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){let i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return ke(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){let o=Pg(n,i);return t==="wo"?e.ordinalNumber(o,{unit:"week"}):ke(o,t.length)},I:function(n,t,e){let i=Eg(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ke(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):xn.d(n,t)},D:function(n,t,e){let i=Mg(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ke(i,t.length)},E:function(n,t,e){let i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){let o=n.getDay(),r=(o-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return ke(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(o,{width:"short",context:"formatting"});case"eeee":default:return e.day(o,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){let o=n.getDay(),r=(o-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return ke(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(o,{width:"narrow",context:"standalone"});case"cccccc":return e.day(o,{width:"short",context:"standalone"});case"cccc":default:return e.day(o,{width:"wide",context:"standalone"})}},i:function(n,t,e){let i=n.getDay(),o=i===0?7:i;switch(t){case"i":return String(o);case"ii":return ke(o,t.length);case"io":return e.ordinalNumber(o,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){let o=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,t,e){let i=n.getHours(),o;switch(i===12?o=yr.noon:i===0?o=yr.midnight:o=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,t,e){let i=n.getHours(),o;switch(i>=17?o=yr.evening:i>=12?o=yr.afternoon:i>=4?o=yr.morning:o=yr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return xn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):xn.H(n,t)},K:function(n,t,e){let i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ke(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ke(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):xn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):xn.s(n,t)},S:function(n,t){return xn.S(n,t)},X:function(n,t,e){let i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ag(i);case"XXXX":case"XX":return Co(i);case"XXXXX":case"XXX":default:return Co(i,":")}},x:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"x":return Ag(i);case"xxxx":case"xx":return Co(i);case"xxxxx":case"xxx":default:return Co(i,":")}},O:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Og(i,":");case"OOOO":default:return"GMT"+Co(i,":")}},z:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Og(i,":");case"zzzz":default:return"GMT"+Co(i,":")}},t:function(n,t,e){let i=Math.trunc(+n/1e3);return ke(i,t.length)},T:function(n,t,e){return ke(+n,t.length)}};function Og(n,t=""){let e=n>0?"-":"+",i=Math.abs(n),o=Math.trunc(i/60),r=i%60;return r===0?e+String(o):e+String(o)+t+ke(r,2)}function Ag(n,t){return n%60===0?(n>0?"-":"+")+ke(Math.abs(n)/60,2):Co(n,t)}function Co(n,t=""){let e=n>0?"-":"+",i=Math.abs(n),o=ke(Math.trunc(i/60),2),r=ke(i%60,2);return e+o+t+r}var Dg=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ig=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Wy=(n,t)=>{let e=n.match(/(P+)(p+)?/)||[],i=e[1],o=e[2];if(!o)return Dg(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Dg(i,t)).replace("{{time}}",Ig(o,t))},Rg={p:Ig,P:Wy};var Uy=/^D+$/,$y=/^Y+$/,qy=["D","DD","YY","YYYY"];function Fg(n){return Uy.test(n)}function Ng(n){return $y.test(n)}function Vg(n,t,e){let i=Gy(n,t,e);if(console.warn(i),qy.includes(n))throw new RangeError(i)}function Gy(n,t,e){let i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Yy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xy=/^'([^]*?)'?$/,Ky=/''/g,Zy=/[a-zA-Z]/;function Zd(n,t,e){let i=$n(),o=e?.locale??i.locale??Xd,r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=Ze(n,e?.in);if(!fg(l))throw new RangeError("Invalid time value");let p=t.match(Qy).map(b=>{let C=b[0];if(C==="p"||C==="P"){let T=Rg[C];return T(b,o.formatLong)}return b}).join("").match(Yy).map(b=>{if(b==="''")return{isToken:!1,value:"'"};let C=b[0];if(C==="'")return{isToken:!1,value:Jy(b)};if(Kd[C])return{isToken:!0,value:b};if(C.match(Zy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:b}});o.localize.preprocessor&&(p=o.localize.preprocessor(l,p));let u={firstWeekContainsDate:r,weekStartsOn:a,locale:o};return p.map(b=>{if(!b.isToken)return b.value;let C=b.value;(!e?.useAdditionalWeekYearTokens&&Ng(C)||!e?.useAdditionalDayOfYearTokens&&Fg(C))&&Vg(C,t,String(n));let T=Kd[C[0]];return T(l,C,o.localize,u)}).join("")}function Jy(n){let t=n.match(Xy);return t?t[1].replace(Ky,"'"):n}function Lg(n,t,e){return mg(n,-t,e)}function jg(n,t){return ug(pt(t?.in||n,n),Lg(pg(t?.in||n),1))}function zg(n){if(!n||isNaN(n.getTime()))return"unknown";let t=new Date,e=Zd(n,"HH:mm:ss"),i=t.getTime()-n.getTime(),o=Math.floor(i/(1e3*60));if(o<1)return`just now (${e})`;if(o<60)return`${o} min ago (${e})`;let r=Math.floor(i/(1e3*60*60));if(r<24)return`${r}h ago (${e})`;if(jg(n))return`yesterday ${e}`;let a=bg(t,n);return a<7?`${a}d ago ${e}`:`${Zd(n,"dd/MM/yyyy")} ${e}`}var eC=(n,t)=>t.filename;function tC(n,t){if(n&1){let e=E();s(0,"button",11),_("click",function(){v(e);let o=g(2);return y(o.downloadAll())}),s(1,"mat-icon"),h(2,"download_for_offline"),c()()}}function iC(n,t){n&1&&(s(0,"div",10),F(1,"span",12),s(2,"span",13),h(3,"Loading files..."),c()())}function nC(n,t){n&1&&(s(0,"div",14)(1,"mat-icon",15),h(2,"folder_open"),c(),s(3,"p",16),h(4,"No files in exchange space"),c(),s(5,"p",17),h(6,"Upload files to share with the agent"),c()())}function oC(n,t){if(n&1){let e=E();s(0,"button",28),_("click",function(){v(e);let o=g().$implicit,r=g(4);return y(r.viewFile(o))}),s(1,"mat-icon"),h(2,"visibility"),c()()}}function rC(n,t){if(n&1){let e=E();s(0,"div",18)(1,"div",19)(2,"mat-icon",20),h(3),c(),s(4,"div",21)(5,"span",22),h(6),c(),s(7,"span",23),h(8),c()()(),s(9,"div",24),w(10,oC,3,0,"button",25),s(11,"button",26),_("click",function(){let o=v(e).$implicit,r=g(4);return y(r.download(o))}),s(12,"mat-icon"),h(13,"download"),c()(),s(14,"button",27),_("click",function(){let o=v(e).$implicit,r=g(4);return y(r.delete(o))}),s(15,"mat-icon"),h(16,"delete"),c()()()()}if(n&2){let e=t.$implicit,i=g(4);m(3),B(i.getFileIcon(e.filename)),m(2),x("title",e.filename),m(),B(e.filename),m(2),Tn("",i.formatSize(e.size)," \u2022 ",i.formatDate(e.lastModified)),m(2),S(i.canViewFile(e)?10:-1)}}function aC(n,t){if(n&1&&Oe(0,rC,17,6,"div",18,eC),n&2){let e=g(3);Ae(e.files())}}function sC(n,t){if(n&1&&w(0,nC,7,0,"div",14)(1,aC,2,0),n&2){let e=g(2);S(e.files().length===0?0:1)}}function lC(n,t){if(n&1){let e=E();s(0,"div",0)(1,"div",2)(2,"div",3)(3,"h3",4),h(4,"Exchange"),c(),s(5,"span",5),h(6),c()(),s(7,"div",6),w(8,tC,3,0,"button",7),s(9,"button",8),_("click",function(){v(e);let o=g();return y(o.close())}),s(10,"mat-icon"),h(11,"chevron_right"),c()()()(),s(12,"div",9),w(13,iC,4,0,"div",10)(14,sC,2,1),c()()}if(n&2){let e=g();m(6),ae("(",e.files().length,")"),m(2),S(e.files().length>0?8:-1),m(5),S(e.isLoading()?13:14)}}function cC(n,t){if(n&1){let e=E();s(0,"app-content-viewer",29),_("closeViewer",function(){v(e);let o=g();return y(o.backToList())}),c()}if(n&2){let e=g();x("file",e.currentFile)("projectName",e.projectName)("threadId",e.threadId)}}var Dl=class n{projectName;threadId;closeDrawer=new H;fileExchangeState=d(ur);contentViewerService=d(gr);files=this.fileExchangeState.files;isLoading=this.fileExchangeState.isLoading;viewerState="list";currentFile=null;close(){this.viewerState==="content"?this.backToList():this.closeDrawer.emit()}viewFile(t){this.currentFile=t,this.viewerState="content"}backToList(){this.viewerState="list",this.currentFile=null}downloadAll(){this.fileExchangeState.downloadAllFiles()}download(t){this.fileExchangeState.downloadFile(t.filename)}delete(t){return ie(this,null,function*(){if(!confirm(`Delete file "${t.filename}"?`))return;let i=yield this.fileExchangeState.deleteFile(t.filename);i.success||alert(`Failed to delete file: ${i.error}`)})}getFileIcon(t){switch(t.split(".").pop()?.toLowerCase()){case"pdf":return"picture_as_pdf";case"csv":case"xlsx":case"xls":return"table_chart";case"txt":case"md":return"description";case"jpg":case"jpeg":case"png":case"gif":case"webp":return"image";case"zip":case"tar":case"gz":return"folder_zip";default:return"insert_drive_file"}}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}formatDate(t){return zg(t)}canViewFile(t){return this.contentViewerService.isFormatViewable(t.filename)&&this.contentViewerService.isViewable(t.size)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-file-exchange-drawer"]],inputs:{projectName:"projectName",threadId:"threadId"},outputs:{closeDrawer:"closeDrawer"},decls:2,vars:2,consts:[[1,"file-drawer-container"],[3,"file","projectName","threadId"],[1,"drawer-header"],[1,"header-left"],[1,"drawer-title"],[1,"file-count"],[1,"header-actions"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[1,"file-list"],[1,"file-loading"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn",3,"click"],[1,"loading-spinner"],[1,"loading-text"],[1,"file-empty"],[1,"empty-icon"],[1,"empty-text"],[1,"empty-hint"],[1,"file-item"],[1,"file-info"],[1,"file-icon"],[1,"file-details"],[1,"file-name",3,"title"],[1,"file-meta"],[1,"file-actions"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn"],["mat-icon-button","","title","Download","type","button",1,"action-btn","download-btn",3,"click"],["mat-icon-button","","title","Delete","type","button",1,"action-btn","delete-btn",3,"click"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn",3,"click"],[3,"closeViewer","file","projectName","threadId"]],template:function(e,i){e&1&&(w(0,lC,15,3,"div",0),w(1,cC,1,3,"app-content-viewer",1)),e&2&&(S(i.viewerState==="list"?0:-1),m(),S(i.viewerState==="content"&&i.currentFile?1:-1))},dependencies:[De,Qe,xe,xt,yt,Ml],styles:[".file-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.header-left[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.5rem}.header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.file-count[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text-secondary)}.download-all-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.download-all-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}.file-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:.5rem}.file-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;gap:1rem;color:var(--color-text-secondary)}.loading-spinner[_ngcontent-%COMP%]{display:inline-block;width:32px;height:32px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.loading-text[_ngcontent-%COMP%]{font-size:.9rem}.file-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:var(--color-text-secondary)}.empty-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px;margin-bottom:1rem;opacity:.5}.empty-text[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:500}.empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;opacity:.7}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.75rem;border-radius:8px;transition:background .2s;gap:1rem}.file-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.file-item[_ngcontent-%COMP%]:hover .file-actions[_ngcontent-%COMP%]{opacity:1}.file-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex:1;min-width:0}.file-icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--color-primary);font-size:28px;width:28px;height:28px}.file-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.file-name[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-meta[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary)}.file-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0;opacity:0;transition:opacity .2s}.action-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.action-btn.view-btn[_ngcontent-%COMP%]:hover, .action-btn.download-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.action-btn.delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}@media (max-width: 768px){.file-actions[_ngcontent-%COMP%]{opacity:1}.file-item[_ngcontent-%COMP%]{padding:1rem .75rem}.drawer-header[_ngcontent-%COMP%]{padding:.75rem}}"]})};var Rl=["*"],dC=["content"],mC=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],hC=["mat-drawer","mat-drawer-content","*"];function pC(n,t){if(n&1){let e=E();s(0,"div",1),_("click",function(){v(e);let o=g();return y(o._onBackdropClicked())}),c()}if(n&2){let e=g();A("mat-drawer-shown",e._isShowingBackdrop())}}function uC(n,t){n&1&&(s(0,"mat-drawer-content"),he(1,2),c())}var gC=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],fC=["mat-sidenav","mat-sidenav-content","*"];function _C(n,t){if(n&1){let e=E();s(0,"div",1),_("click",function(){v(e);let o=g();return y(o._onBackdropClicked())}),c()}if(n&2){let e=g();A("mat-drawer-shown",e._isShowingBackdrop())}}function bC(n,t){n&1&&(s(0,"mat-sidenav-content"),he(1,2),c())}var vC=`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
|
|
363
|
-
`;var yC=new ee("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:CC}),Jd=new ee("MAT_DRAWER_CONTAINER");function CC(){return!1}var Cr=(()=>{class n extends dn{_platform=d(rt);_changeDetectorRef=d(Re);_container=d(wa);constructor(){let e=d(K),i=d(cn),o=d(me);super(e,i,o)}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}_shouldBeHidden(){if(this._platform.isBrowser)return!1;let{start:e,end:i}=this._container;return e!=null&&e.mode!=="over"&&e.opened||i!=null&&i.mode!=="over"&&i.opened}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:6,hostBindings:function(i,o){i&2&&(Fi("margin-left",o._container._contentMargins.left,"px")("margin-right",o._container._contentMargins.right,"px"),A("mat-drawer-content-hidden",o._shouldBeHidden()))},features:[fe([{provide:dn,useExisting:n}]),ye],ngContentSelectors:Rl,decls:1,vars:0,template:function(i,o){i&1&&(He(),he(0))},encapsulation:2,changeDetection:0})}return n})(),xa=(()=>{class n{_elementRef=d(K);_focusTrapFactory=d(ts);_focusMonitor=d(Vi);_platform=d(rt);_ngZone=d(me);_renderer=d(ot);_interactivityChecker=d(Lo);_doc=d(it);_container=d(Jd,{optional:!0});_focusTrap=null;_elementFocusedBeforeDrawerWasOpened=null;_eventCleanups;_isAttached;_anchor;get position(){return this._position}set position(e){e=e==="end"?"end":"start",e!==this._position&&(this._isAttached&&this._updatePositionInParent(e),this._position=e,this.onPositionChanged.emit())}_position="start";get mode(){return this._mode}set mode(e){this._mode=e,this._updateFocusTrapState(),this._modeChanged.next()}_mode="over";get disableClose(){return this._disableClose}set disableClose(e){this._disableClose=Dt(e)}_disableClose=!1;get autoFocus(){let e=this._autoFocus;return e??(this.mode==="side"?"dialog":"first-tabbable")}set autoFocus(e){(e==="true"||e==="false"||e==null)&&(e=Dt(e)),this._autoFocus=e}_autoFocus;get opened(){return this._opened()}set opened(e){this.toggle(Dt(e))}_opened=Te(!1);_openedVia;_animationStarted=new D;_animationEnd=new D;openedChange=new H(!0);_openedStream=this.openedChange.pipe(pe(e=>e),ve(()=>{}));openedStart=this._animationStarted.pipe(pe(()=>this.opened),fc(void 0));_closedStream=this.openedChange.pipe(pe(e=>!e),ve(()=>{}));closedStart=this._animationStarted.pipe(pe(()=>!this.opened),fc(void 0));_destroyed=new D;onPositionChanged=new H;_content;_modeChanged=new D;_injector=d(ge);_changeDetectorRef=d(Re);constructor(){this.openedChange.pipe(N(this._destroyed)).subscribe(e=>{e?(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement,this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{let e=this._elementRef.nativeElement;Wm(e,"keydown").pipe(pe(i=>i.keyCode===27&&!this.disableClose&&!vt(i)),N(this._destroyed)).subscribe(i=>this._ngZone.run(()=>{this.close(),i.stopPropagation(),i.preventDefault()})),this._eventCleanups=[this._renderer.listen(e,"transitionrun",this._handleTransitionEvent),this._renderer.listen(e,"transitionend",this._handleTransitionEvent),this._renderer.listen(e,"transitioncancel",this._handleTransitionEvent)]}),this._animationEnd.subscribe(()=>{this.openedChange.emit(this.opened)})}_forceFocus(e,i){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let o=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",o),a=this._renderer.listen(e,"mousedown",o)})),e.focus(i)}_focusByCssSelector(e,i){let o=this._elementRef.nativeElement.querySelector(e);o&&this._forceFocus(o,i)}_takeFocus(){if(!this._focusTrap)return;let e=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":Et(()=>{!this._focusTrap.focusInitialElement()&&typeof e.focus=="function"&&e.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus);break}}_restoreFocus(e){this.autoFocus!=="dialog"&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,e):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){let e=this._doc.activeElement;return!!e&&this._elementRef.nativeElement.contains(e)}ngAfterViewInit(){this._isAttached=!0,this._position==="end"&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngOnDestroy(){this._eventCleanups.forEach(e=>e()),this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(e){return this.toggle(!0,e)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(e=!this.opened,i){e&&i&&(this._openedVia=i);let o=this._setOpen(e,!e&&this._isFocusWithinDrawer(),this._openedVia||"program");return e||(this._openedVia=null),o}_setOpen(e,i,o){return e===this.opened?Promise.resolve(e?"open":"close"):(this._opened.set(e),this._container?._transitionsEnabled?this._setIsAnimating(!0):setTimeout(()=>{this._animationStarted.next(),this._animationEnd.next()}),this._elementRef.nativeElement.classList.toggle("mat-drawer-opened",e),!e&&i&&this._restoreFocus(o),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(r=>{this.openedChange.pipe(Mt(1)).subscribe(a=>r(a?"open":"close"))}))}_setIsAnimating(e){this._elementRef.nativeElement.classList.toggle("mat-drawer-animating",e)}_getWidth(){return this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(e){if(!this._platform.isBrowser)return;let i=this._elementRef.nativeElement,o=i.parentNode;e==="end"?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),o.insertBefore(this._anchor,i)),o.appendChild(i)):this._anchor&&this._anchor.parentNode.insertBefore(i,this._anchor)}_handleTransitionEvent=e=>{let i=this._elementRef.nativeElement;e.target===i&&this._ngZone.run(()=>{e.type==="transitionrun"?this._animationStarted.next(e):(e.type==="transitionend"&&this._setIsAnimating(!1),this._animationEnd.next(e))})};static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-drawer"]],viewQuery:function(i,o){if(i&1&&ne(dC,5),i&2){let r;W(r=U())&&(o._content=r.first)}},hostAttrs:[1,"mat-drawer"],hostVars:12,hostBindings:function(i,o){i&2&&(Y("align",null)("tabIndex",o.mode!=="side"?"-1":null),Fi("visibility",!o._container&&!o.opened?"hidden":null),A("mat-drawer-end",o.position==="end")("mat-drawer-over",o.mode==="over")("mat-drawer-push",o.mode==="push")("mat-drawer-side",o.mode==="side"))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],ngContentSelectors:Rl,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(i,o){i&1&&(He(),s(0,"div",1,0),he(2),c())},dependencies:[dn],encapsulation:2,changeDetection:0})}return n})(),wa=(()=>{class n{_dir=d(Ct,{optional:!0});_element=d(K);_ngZone=d(me);_changeDetectorRef=d(Re);_animationDisabled=We();_transitionsEnabled=!1;_allDrawers;_drawers=new Qm;_content;_userContent;get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(e){this._autosize=Dt(e)}_autosize=d(yC);get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(e){this._backdropOverride=e==null?null:Dt(e)}_backdropOverride;backdropClick=new H;_start;_end;_left;_right;_destroyed=new D;_doCheckSubject=new D;_contentMargins={left:null,right:null};_contentMarginChanges=new D;get scrollable(){return this._userContent||this._content}_injector=d(ge);constructor(){let e=d(rt),i=d(Bi);this._dir?.change.pipe(N(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),i.change().pipe(N(this._destroyed)).subscribe(()=>this.updateContentMargins()),!this._animationDisabled&&e.isBrowser&&this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._element.nativeElement.classList.add("mat-drawer-transition"),this._transitionsEnabled=!0},200)})}ngAfterContentInit(){this._allDrawers.changes.pipe(Vt(this._allDrawers),N(this._destroyed)).subscribe(e=>{this._drawers.reset(e.filter(i=>!i._container||i._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(Vt(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(e=>{this._watchDrawerToggle(e),this._watchDrawerPosition(e),this._watchDrawerMode(e)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe(Um(10),N(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(e=>e.open())}close(){this._drawers.forEach(e=>e.close())}updateContentMargins(){let e=0,i=0;if(this._left&&this._left.opened){if(this._left.mode=="side")e+=this._left._getWidth();else if(this._left.mode=="push"){let o=this._left._getWidth();e+=o,i-=o}}if(this._right&&this._right.opened){if(this._right.mode=="side")i+=this._right._getWidth();else if(this._right.mode=="push"){let o=this._right._getWidth();i+=o,e-=o}}e=e||null,i=i||null,(e!==this._contentMargins.left||i!==this._contentMargins.right)&&(this._contentMargins={left:e,right:i},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(e){e._animationStarted.pipe(N(this._drawers.changes)).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),e.mode!=="side"&&e.openedChange.pipe(N(this._drawers.changes)).subscribe(()=>this._setContainerClass(e.opened))}_watchDrawerPosition(e){e.onPositionChanged.pipe(N(this._drawers.changes)).subscribe(()=>{Et({read:()=>this._validateDrawers()},{injector:this._injector})})}_watchDrawerMode(e){e._modeChanged.pipe(N(Ii(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(e){let i=this._element.nativeElement.classList,o="mat-drawer-container-has-open";e?i.add(o):i.remove(o)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(e=>{e.position=="end"?(this._end!=null,this._end=e):(this._start!=null,this._start=e)}),this._right=this._left=null,this._dir&&this._dir.value==="rtl"?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&this._start.mode!="over"||this._isDrawerOpen(this._end)&&this._end.mode!="over"}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(e=>e&&!e.disableClose&&this._drawerHasBackdrop(e)).forEach(e=>e._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(e){return e!=null&&e.opened}_drawerHasBackdrop(e){return this._backdropOverride==null?!!e&&e.mode!=="side":this._backdropOverride}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-drawer-container"]],contentQueries:function(i,o,r){if(i&1&&(Tt(r,Cr,5),Tt(r,xa,5)),i&2){let a;W(a=U())&&(o._content=a.first),W(a=U())&&(o._allDrawers=a)}},viewQuery:function(i,o){if(i&1&&ne(Cr,5),i&2){let r;W(r=U())&&(o._userContent=r.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(i,o){i&2&&A("mat-drawer-container-explicit-backdrop",o._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],features:[fe([{provide:Jd,useExisting:n}])],ngContentSelectors:hC,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(i,o){i&1&&(He(mC),w(0,pC,1,2,"div",0),he(1),he(2,1),w(3,uC,2,0,"mat-drawer-content")),i&2&&(S(o.hasBackdrop?0:-1),m(3),S(o._content?-1:3))},dependencies:[Cr],styles:[`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
|
|
364
|
-
`],encapsulation:2,changeDetection:0})}return n})(),
|
|
365
|
-
`],encapsulation:2,changeDetection:0})}return n})(),Ug=(()=>{class n{_ngZone=d(me);_elementRef=d(K);_ariaDescriber=d(ns);_renderer=d(ot);_animationsDisabled=We();_idGenerator=d(Fe);get color(){return this._color}set color(e){this._setColor(e),this._color=e}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(e){this._updateRenderedContent(e)}_content;get description(){return this._description}set description(e){this._updateDescription(e)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=d(Lo);_document=d(it);constructor(){let e=d(Lt);e.load(xC),e.load(es)}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}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 e=this._renderer.createElement("span"),i="mat-badge-active";return e.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),e.setAttribute("aria-hidden","true"),e.classList.add(Wg),this._animationsDisabled&&e.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(e),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{e.classList.add(i)})}):e.classList.add(i),e}_updateRenderedContent(e){let i=`${e??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(e){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!e||this._isHostInteractive())&&this._removeInlineDescription(),this._description=e,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,e):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(e){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),e&&i.add(`mat-badge-${e}`)}_clearExistingBadges(){let e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Wg}`);for(let i of Array.from(e))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,o){i&2&&A("mat-badge-overlap",o.overlap)("mat-badge-above",o.isAbove())("mat-badge-below",!o.isAbove())("mat-badge-before",!o.isAfter())("mat-badge-after",o.isAfter())("mat-badge-small",o.size==="small")("mat-badge-medium",o.size==="medium")("mat-badge-large",o.size==="large")("mat-badge-hidden",o.hidden||!o.content)("mat-badge-disabled",o.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",J],disabled:[2,"matBadgeDisabled","disabled",J],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",J]}})}return n})(),$g=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[jo,le,le]})}return n})();var xr=class n{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=d(hr);project=d(we);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){nn([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([t,e])=>{this.updateTitle(t?.name??"...",e)})}updateTitle(t,e){let i;this.isSystemActive?i=`\u23F3${e>0?` (${e}) `:" "}${t}`:e>0?i=`${this.ATTENTION_EMOJI} (${e}) ${t}`:i=t,document.title=i,console.log("[TAB-TITLE] Updated to:",i)}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 t=this.project.getSelectedProjectId()??"...",e=this.unreadService.getCurrentCount();this.updateTitle(t,e)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Nl=class n{http=d(Ye);maxFileSize=5*1024*1024;supportedTypes=["image/png","image/jpeg","image/gif","image/webp"];validateFile(t){if(!this.supportedTypes.includes(t.type))throw new Error(`Unsupported file type: ${t.type}`);if(t.size>this.maxFileSize)throw new Error(`File too large: ${(t.size/1024/1024).toFixed(1)}MB exceeds 5MB limit`)}fileToBase64(t){return ie(this,null,function*(){return new Promise((e,i)=>{let o=new FileReader;o.onload=()=>{let r=o.result;if(!r){i(new Error("Failed to read file"));return}let a=r.split(",")[1];if(!a){i(new Error("Invalid file format"));return}e(a)},o.onerror=i,o.readAsDataURL(t)})})}getUploadUrl(t,e){return`/api/projects/${t}/threads/${e}/upload`}uploadImage(t,e,i){console.log("[IMAGE-UPLOAD] uploadImage - file:",t.name,t.type,t.size),console.log("[IMAGE-UPLOAD] uploadImage - project:",e,"thread:",i);try{console.log("[IMAGE-UPLOAD] Validating file..."),this.validateFile(t)}catch(o){return console.log("[IMAGE-UPLOAD] Validation failed:",o),kt({success:!1,error:o instanceof Error?o.message:"Validation failed"})}return new oi(o=>{console.log("[IMAGE-UPLOAD] Converting to base64..."),this.fileToBase64(t).then(r=>{console.log("[IMAGE-UPLOAD] Base64 length:",r.length),console.log("[IMAGE-UPLOAD] Sending upload request..."),this.http.post(this.getUploadUrl(e,i),{content:r,mimeType:t.type,filename:t.name}).pipe(ve(a=>(console.log("[IMAGE-UPLOAD] Upload success result:",a),{success:!0,processedSize:a.processedSize,dimensions:a.dimensions})),Xn(a=>{console.log("[IMAGE-UPLOAD] Upload failed:",a);let l=a.error?.error||a.message||"Upload failed";return kt({success:!1,error:l})})).subscribe({next:a=>{o.next(a),o.complete()},error:a=>o.error(a)})}).catch(r=>{console.log("[IMAGE-UPLOAD] Base64 conversion failed:",r),o.next({success:!1,error:r instanceof Error?r.message:"Failed to read file"}),o.complete()})})}hasImageFiles(t){if(console.log("[IMAGE-UPLOAD] hasImageFiles - dataTransfer:",t),!t)return console.log("[IMAGE-UPLOAD] hasImageFiles - no dataTransfer"),!1;if(console.log("[IMAGE-UPLOAD] hasImageFiles - types:",Array.from(t.types)),!Array.from(t.types).includes("Files"))return console.log("[IMAGE-UPLOAD] hasImageFiles - no Files type"),!1;let e=Array.from(t.files||[]);console.log("[IMAGE-UPLOAD] hasImageFiles - files:",e.map(o=>({name:o.name,type:o.type})));let i=e.some(o=>this.supportedTypes.includes(o.type));return console.log("[IMAGE-UPLOAD] hasImageFiles - result:",i),i}filterImageFiles(t){return Array.from(t).filter(i=>this.supportedTypes.includes(i.type))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var wr=class n{pendingFirstMessage=null;setPendingFirstMessage(t){console.log("[FIRST-MESSAGE-STATE] Storing pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=t}consumePendingFirstMessage(){let t=this.pendingFirstMessage;return t?(console.log("[FIRST-MESSAGE-STATE] Consuming pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=null):console.log("[FIRST-MESSAGE-STATE] No pending first message to consume"),t}hasPendingFirstMessage(){return this.pendingFirstMessage!==null}clear(){this.pendingFirstMessage&&(console.log("[FIRST-MESSAGE-STATE] Clearing pending first message"),this.pendingFirstMessage=null)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var SC=["inputSection"];function kC(n,t){if(n&1){let e=E();s(0,"button",18),_("click",function(){v(e);let o=g();return y(o.toggleFileDrawer())}),s(1,"mat-icon"),h(2,"folder_open"),c()()}if(n&2){let e=g();A("has-files",e.fileCount>0),x("title",Pn("Files Exchange",e.fileCount>0?" ("+e.fileCount+" file"+(e.fileCount>1?"s":"")+")":""))("matBadge",e.fileCount>0?e.fileCount:null)}}function MC(n,t){if(n&1&&(s(0,"div",5),h(1),c()),n&2){let e=g();m(),Tn(" \u26A0\uFE0F Connection lost. Reconnecting... (",e.connectionStatus.reconnectAttempts,"/",e.connectionStatus.maxAttempts,") ")}}function EC(n,t){if(n&1&&(s(0,"div",19),h(1),c()),n&2){let e=g();A("error",e.uploadStatus.isError),m(),ae(" ",e.uploadStatus.message," ")}}function TC(n,t){if(n&1){let e=E();s(0,"app-chat-textarea",20),_("messageSubmitted",function(o){v(e);let r=g();return y(r.onMessageSubmitted(o))})("voiceRecordingToggled",function(o){v(e);let r=g();return y(r.onVoiceToggled(o))})("heightChanged",function(o){v(e);let r=g();return y(r.onInputHeightChanged(o))})("stopRequested",function(){v(e);let o=g();return y(o.onStopRequested())})("filesPasted",function(o){v(e);let r=g();return y(r.onFilesPasted(o))}),c()}if(n&2){let e=g();x("isDisabled",!e.isConnected)("isSessionInitializing",!1)("showWelcome",!1)("isThinking",e.isThinking)("isStarting",!1)}}function PC(n,t){if(n&1){let e=E();s(0,"app-choice-select",21),_("choiceSelected",function(o){v(e);let r=g();return y(r.onChoiceSelected(o))}),c()}if(n&2){let e=g();x("options",e.currentChoice.options)("labelHtml",e.currentChoice.label)("isVisible",!!e.currentChoice)}}function OC(n,t){n&1&&(s(0,"div",17)(1,"div",22)(2,"div",23),h(3,"\u{1F4CE}"),c(),s(4,"div",24),h(5,"Drop files here to upload"),c(),s(6,"div",25),h(7,"Images will be added to conversation, other files to exchange space"),c()()())}var Vl=class n{projectName;threadId;destroy$=new D;inputSection;messages=[];streamingText="";isThinking=!1;currentChoice=null;connectionStatus=null;isConnected=!1;showConnectionStatus=!1;hasEverConnected=!1;inputSectionHeight=80;uploadStatus={message:"",isError:!1};isDragOver=!1;isFileDrawerOpen=!1;get fileCount(){return this.fileExchangeState.fileCount()}pendingFirstMessage=null;subscriptions=[];codayService=d(mi);preferencesService=d(st);titleService=d(xr);elementRef=d(K);threadState=d(Rt);imageUploadService=d(Nl);fileExchangeState=d(ur);firstMessageState=d(wr);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.initializeThreadConnection()}ngOnChanges(t){console.log("[THREAD] ngOnChanges called",t),t.threadId&&(console.log("[THREAD] threadId changed:",{firstChange:t.threadId.firstChange,previousValue:t.threadId.previousValue,currentValue:t.threadId.currentValue}),t.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.codayService.messages$.pipe(N(this.destroy$)).subscribe(e=>{console.log("[THREAD] Messages updated:",e.length),this.messages=e}),this.codayService.streamingText$.pipe(N(this.destroy$)).subscribe(e=>{this.streamingText=e}),this.codayService.isThinking$.pipe(N(this.destroy$)).subscribe(e=>{this.isThinking=e}),this.codayService.currentChoice$.pipe(N(this.destroy$)).subscribe(e=>{this.currentChoice=e}),this.codayService.connectionStatus$.pipe(N(this.destroy$)).subscribe(e=>{this.connectionStatus=e,this.isConnected=e.connected,e.connected&&!this.hasEverConnected&&(this.hasEverConnected=!0,this.showConnectionStatus=!0),!e.connected&&!this.hasEverConnected?setTimeout(()=>{!this.isConnected&&!this.hasEverConnected&&(this.showConnectionStatus=!0)},2e3):!e.connected&&this.hasEverConnected?this.showConnectionStatus=!0:e.connected&&(this.showConnectionStatus=!0)}),this.codayService.threadUpdateEvent$.pipe(N(this.destroy$)).subscribe(e=>{e&&(console.log("[THREAD] Thread update event received:",e),this.threadState.refreshThreadList())}),this.codayService.resetMessages(),this.codayService.setTabTitleService(this.titleService),console.log("[THREAD] Connecting to thread event stream"),this.codayService.connectToThread(this.projectName,this.threadId);let t=this.firstMessageState.consumePendingFirstMessage();t?(console.log("[THREAD] First message pending:",t.substring(0,50)+"..."),this.pendingFirstMessage=t,this.codayService.setThinkingForPendingMessage(),this.subscribeToFirstInvite()):console.log("[THREAD] No first message found in state service")}ngAfterViewChecked(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&t>0&&(this.inputSectionHeight=t)}}ngOnDestroy(){console.log("[THREAD] Destroying component"),this.destroy$.next(),this.destroy$.complete(),this.fileExchangeState.clear(),this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[THREAD] Sending message:",t),this.codayService.sendMessage(t)}onVoiceToggled(t){console.log("[VOICE] Recording:",t)}onChoiceSelected(t){console.log("[THREAD] Choice selected:",t),this.codayService.sendChoice(t)}onCopyMessage(t){console.log("[COPY] Message copied:",t.id)}onStopRequested(){this.threadState.stop()}onInputHeightChanged(t){console.log("[THREAD] Input height changed:",t),this.inputSectionHeight=t}onFilesPasted(t){console.log("[THREAD] File(s) pasted:",t.length);let e=this.imageUploadService.filterImageFiles(t),i=t.filter(o=>!o.type.startsWith("image/"));e.length&&this.uploadFilesSequentially(e,0),i.length&&this.uploadFilesToExchangeSpace(i),!e.length&&!i.length&&this.showUploadError("No supported files found")}toggleFileDrawer(){console.log("[THREAD] Toggling file drawer"),this.isFileDrawerOpen=!this.isFileDrawerOpen}closeFileDrawer(){console.log("[THREAD] Closing file drawer"),this.isFileDrawerOpen=!1}onDragEnter(t){t.preventDefault(),t.dataTransfer?.types.includes("Files")&&(console.log("[THREAD] Image files detected - showing drag overlay"),this.isDragOver=!0)}onDragOver(t){t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy")}onDragLeave(t){this.elementRef.nativeElement.contains(t.relatedTarget)||(console.log("[THREAD] Leaving component area - hiding drag overlay"),this.isDragOver=!1)}onDrop(t){t.preventDefault(),this.isDragOver=!1,console.log("[THREAD] Files dropped:",t.dataTransfer?.files?.length||0);let e=t.dataTransfer?.files;if(!e||e.length===0){console.log("[THREAD] No files in drop event");return}let i=this.imageUploadService.filterImageFiles(e),o=Array.from(e).filter(r=>!r.type.startsWith("image/"));console.log("[THREAD] Image files:",i.length,"Other files:",o.length),i.length>0&&this.uploadFilesSequentially(i,0),o.length>0&&this.uploadFilesToExchangeSpace(o),i.length===0&&o.length===0&&this.showUploadError("No supported files found")}uploadFilesSequentially(t,e){if(e>=t.length)return;let i=t[e];if(!i){console.error("[THREAD] File at index",e,"is undefined");return}console.log("[THREAD] Uploading file:",i.name),this.uploadStatus={message:`Uploading ${i.name}...`,isError:!1},this.imageUploadService.uploadImage(i,this.projectName,this.threadId).subscribe({next:o=>{o.success?(console.log("[THREAD] Upload successful:",i.name),this.uploadStatus={message:`\u2713 ${i.name} uploaded (${(o.processedSize/1024).toFixed(1)} KB)`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3),this.uploadFilesSequentially(t,e+1)):(console.error("[THREAD] Upload failed:",i.name,o.error),this.showUploadError(`Failed to upload ${i.name}: ${o.error}`))},error:o=>{console.error("[THREAD] Upload error:",i.name,o),this.showUploadError(`Failed to upload ${i.name}: ${o.message||"Unknown error"}`)}})}showUploadError(t){this.uploadStatus={message:t,isError:!0},setTimeout(()=>{this.uploadStatus={message:"",isError:!1}},5e3)}uploadFilesToExchangeSpace(t){return ie(this,null,function*(){for(let e of t){console.log("[THREAD] Uploading to exchange space:",e.name),this.uploadStatus={message:`Uploading ${e.name}...`,isError:!1};let i=yield this.fileExchangeState.uploadFile(e);if(i.success)console.log("[THREAD] Upload to exchange space successful:",e.name),this.uploadStatus={message:`\u2713 ${e.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:",e.name,i.error),this.showUploadError(`Failed to upload ${e.name}: ${i.error}`);break}}})}subscribeToFirstInvite(){console.log("[THREAD] Subscribing to wait for InviteEvent"),this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{if(t&&this.pendingFirstMessage){console.log("[THREAD] Received InviteEvent, sending pending message");let e=this.pendingFirstMessage;this.pendingFirstMessage=null,this.codayService.sendMessage(e)}}))}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?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(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-thread"]],viewQuery:function(e,i){if(e&1&&ne(SC,5),e&2){let o;W(o=U())&&(i.inputSection=o.first)}},inputs:{projectName:"projectName",threadId:"threadId"},features:[Le],decls:19,vars:13,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"],[1,"connection-status"],[1,"chat-wrapper"],[1,"chat-center"],[3,"copyRequested","stopRequested","messages","streamingText","isThinking"],[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"],["mode","side","position","end",3,"closed","opened"],[3,"closeDrawer","projectName","threadId"],[1,"drag-overlay"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"click","matBadge","title"],[1,"upload-status"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","stopRequested","filesPasted","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"choiceSelected","options","labelHtml","isVisible"],[1,"drag-overlay-content"],[1,"drag-icon"],[1,"drag-text"],[1,"drag-hint"]],template:function(e,i){if(e&1){let o=E();s(0,"div",1),_("dragenter",function(a){return v(o),y(i.onDragEnter(a))})("dragover",function(a){return v(o),y(i.onDragOver(a))})("dragleave",function(a){return v(o),y(i.onDragLeave(a))})("drop",function(a){return v(o),y(i.onDrop(a))}),s(1,"mat-drawer-container",2)(2,"mat-drawer-content")(3,"div",3),w(4,kC,3,5,"button",4),w(5,MC,2,2,"div",5),s(6,"div",6)(7,"div",7)(8,"app-chat-history",8),_("copyRequested",function(a){return v(o),y(i.onCopyMessage(a))})("stopRequested",function(){return v(o),y(i.onStopRequested())}),c(),w(9,EC,2,3,"div",9),c()(),s(10,"div",10,0)(12,"div",11)(13,"div",12),w(14,TC,1,5,"app-chat-textarea",13),w(15,PC,1,3,"app-choice-select",14),c()()()()(),s(16,"mat-drawer",15),_("closed",function(){return v(o),y(i.closeFileDrawer())}),s(17,"app-file-exchange-drawer",16),_("closeDrawer",function(){return v(o),y(i.closeFileDrawer())}),c()()(),w(18,OC,8,0,"div",17),c()}e&2&&(m(),x("hasBackdrop",!1),m(3),S(i.isFileDrawerOpen?-1:4),m(),S(i.showConnectionStatus&&i.connectionStatus&&!i.connectionStatus.connected?5:-1),m(3),x("messages",i.messages)("streamingText",i.streamingText)("isThinking",i.isThinking),m(),S(i.uploadStatus.message?9:-1),m(5),S(i.currentChoice?-1:14),m(),S(i.currentChoice?15:-1),m(),x("opened",i.isFileDrawerOpen),m(),x("projectName",i.projectName)("threadId",i.threadId),m(),S(i.isDragOver?18:-1))},dependencies:[Cl,mr,er,Dl,Fl,xa,wa,Cr,Qe,xe,xt,as,$g,Ug],styles:[".drag-drop-wrapper[_ngcontent-%COMP%]{height:100vh;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}@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:100vh;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:35vw;max-width:90vw;box-shadow:-2px 0 8px #0000001a}@media (max-width: 768px){.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw}}.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 1rem;display:flex;flex-direction:column;gap:1rem}.upload-status[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:8px;background:var(--color-primary-light);color:var(--color-text);text-align:center;font-size:.9rem;margin-top:1rem}.upload-status.error[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.input-section[_ngcontent-%COMP%]{flex-shrink:0;width:100%;padding:1rem 0;background:var(--color-background)}.input-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 1rem}.input-glass[_ngcontent-%COMP%]{position:relative;background:transparent;border-radius:12px;display:flex;flex-direction:column}.choice-overlay[_ngcontent-%COMP%]{width:100%;background:var(--color-bg-solid);border-radius:12px;padding:1.5rem;box-shadow:0 4px 12px #00000026}.drag-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;background:#000000b3;z-index:10000;display:flex;align-items:center;justify-content:center;pointer-events:none}.drag-overlay-content[_ngcontent-%COMP%]{text-align:center;color:#fff;padding:2rem;border:3px dashed white;border-radius:12px;background:#00000080}.drag-icon[_ngcontent-%COMP%]{font-size:4rem;margin-bottom:1rem}.drag-text[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:500}.drag-hint[_ngcontent-%COMP%]{font-size:.9rem;margin-top:.5rem;opacity:.8}@media (max-width: 768px){.chat-center[_ngcontent-%COMP%], .input-center[_ngcontent-%COMP%]{padding:0 .5rem}.drag-text[_ngcontent-%COMP%]{font-size:1.2rem}.drag-icon[_ngcontent-%COMP%]{font-size:3rem}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw}.file-drawer-toggle-btn[_ngcontent-%COMP%]{top:.75rem!important;right:.75rem!important}}@media print{.connection-status[_ngcontent-%COMP%], .input-section[_ngcontent-%COMP%], .drag-overlay[_ngcontent-%COMP%], .file-drawer-toggle-btn[_ngcontent-%COMP%], .file-drawer-container[_ngcontent-%COMP%]{display:none!important}.chat-wrapper[_ngcontent-%COMP%]{overflow:visible;height:auto}.thread-container[_ngcontent-%COMP%]{height:auto}}"]})};var qg=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le,le]})}return n})();var Gg=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le]})}return n})();var Ki=class n{http=d(Ye);getUserConfig(){return this.http.get("/api/config/user").pipe(ct(t=>console.log("[CONFIG-API] User config retrieved:",t)))}updateUserConfig(t){return this.http.put("/api/config/user",t).pipe(ct(e=>console.log("[CONFIG-API] User config updated:",e)))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Sr=class n{currentThemeSubject=new se("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=d(st);constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}initializeTheme(){let t=this.preferences.getPreference("theme","light")??"light";console.log("[THEME] Loaded saved theme:",t),this.applyTheme(t),setTimeout(()=>{let e=this.preferences.getPreference("theme","light")??"light";e!==t&&(console.log("[THEME] Theme updated after async load:",e),this.applyTheme(e))},100)}setTheme(t){this.preferences.setPreference("theme",t),this.applyTheme(t)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(t){if(console.log("[THEME] Applying theme:",t),this.currentThemeSubject.next(t),t==="system")if(typeof window<"u"&&window.matchMedia){let i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",i),this.setDocumentTheme(i)}else console.log("[THEME] matchMedia not available, defaulting to light theme"),this.setDocumentTheme("light");else this.setDocumentTheme(t)}setDocumentTheme(t){console.log("[THEME] Setting document theme to:",t),typeof document<"u"&&document.documentElement&&(t==="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",t=>{this.getCurrentTheme()==="system"&&this.setDocumentTheme(t.matches?"dark":"light")})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var AC=["mat-internal-form-field",""],DC=["*"],Ll=(()=>{class n{labelPosition;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(i,o){i&2&&A("mdc-form-field--align-end",o.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:AC,ngContentSelectors:DC,decls:1,vars:0,template:function(i,o){i&1&&(He(),he(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}
|
|
366
|
-
`],encapsulation:2,changeDetection:0})}return n})();var IC=["switch"],RC=["*"];function FC(n,t){n&1&&(s(0,"span",11),on(),s(1,"svg",13),F(2,"path",14),c(),s(3,"svg",15),F(4,"path",16),c()())}var NC=new ee("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),jl=class{source;checked;constructor(t,e){this.source=t,this.checked=e}},xo=(()=>{class n{_elementRef=d(K);_focusMonitor=d(Vi);_changeDetectorRef=d(Re);defaults=d(NC);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new jl(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=We();_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new H;toggleChange=new H;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){d(Lt).load(Rn);let e=d(new On("tabindex"),{optional:!0}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=d(Fe).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new jl(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(i,o){if(i&1&&ne(IC,5),i&2){let r;W(r=U())&&(o._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,o){i&2&&(ei("id",o.id),Y("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),rn(o.color?"mat-"+o.color:""),A("mat-mdc-slide-toggle-focused",o._focused)("mat-mdc-slide-toggle-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",J],color:"color",disabled:[2,"disabled","disabled",J],disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:_i(e)],checked:[2,"checked","checked",J],hideIcon:[2,"hideIcon","hideIcon",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[fe([{provide:Kt,useExisting:at(()=>n),multi:!0},{provide:Ti,useExisting:n,multi:!0}]),Le],ngContentSelectors:RC,decls:14,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mat-mdc-slide-toggle-touch-target"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,o){if(i&1){let r=E();He(),s(0,"div",1)(1,"button",2,0),_("click",function(){return v(r),y(o._handleClick())}),F(3,"div",3)(4,"span",4),s(5,"span",5)(6,"span",6)(7,"span",7),F(8,"span",8),c(),s(9,"span",9),F(10,"span",10),c(),w(11,FC,5,0,"span",11),c()()(),s(12,"label",12),_("click",function(l){return v(r),y(l.stopPropagation())}),he(13),c()()}if(i&2){let r=ti(2);x("labelPosition",o.labelPosition),m(),A("mdc-switch--selected",o.checked)("mdc-switch--unselected",!o.checked)("mdc-switch--checked",o.checked)("mdc-switch--disabled",o.disabled)("mat-mdc-slide-toggle-disabled-interactive",o.disabledInteractive),x("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("disabled",o.disabled&&!o.disabledInteractive),Y("id",o.buttonId)("name",o.name)("aria-label",o.ariaLabel)("aria-labelledby",o._getAriaLabelledBy())("aria-describedby",o.ariaDescribedby)("aria-required",o.required||null)("aria-checked",o.checked)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),m(9),x("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),m(),S(o.hideIcon?-1:11),m(),x("for",o.buttonId),Y("id",o._labelId)}},dependencies:[In,Ll],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-slide-toggle-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-slide-toggle-touch-target-size, 48px);width:100%;transform:translate(-50%, -50%);display:var(--mat-slide-toggle-touch-target-display, block)}[dir=rtl] .mat-mdc-slide-toggle-touch-target{left:auto;right:50%;transform:translate(50%, -50%)}
|
|
367
|
-
`],encapsulation:2,changeDetection:0})}return n})(),zl=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[xo,le,le]})}return n})();var VC=(n,t)=>t.code,LC=(n,t)=>t.name+t.lang;function jC(n,t){n&1&&(s(0,"div",15)(1,"mat-icon",32),h(2,"warning"),c(),s(3,"span",33),h(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),c()())}function zC(n,t){if(n&1&&(s(0,"option",18),h(1),c()),n&2){let e=t.$implicit;x("value",e.code),m(),Tn("",e.flag," ",e.label)}}function BC(n,t){n&1&&(s(0,"option",25),h(1,"Loading voices..."),c())}function HC(n,t){n&1&&(s(0,"option",25),h(1,"No voice available"),c())}function WC(n,t){if(n&1&&(s(0,"option",18),h(1),c()),n&2){let e=t.$implicit;x("value",e.name+"|"+e.lang),m(),ae(" ",e.displayName," ")}}var Sa=class n{destroy$=new D;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=d(st);voiceSynthesisService=d(pr);themeService=d(Sr);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(N(this.destroy$)).subscribe(t=>{this.selectedTheme=t}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t}),this.preferencesService.enterToSend$.pipe(N(this.destroy$)).subscribe(t=>{this.useEnterToSend=t}),this.preferencesService.printTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t}),this.preferencesService.hideTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t}),this.preferencesService.hideWarningMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t}),this.preferencesService.voiceAnnounceEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t}),this.preferencesService.voiceMode$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceMode=t}),this.preferencesService.voiceReadFullText$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t}),this.preferencesService.voiceVolume$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100)}),this.preferencesService.voiceRate$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100)}),this.preferencesService.selectedVoice$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t}),this.preferencesService.notificationSoundEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t}),this.preferencesService.browserNotificationEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,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 t=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",t,")"),this.preferencesService.setHideTechnicalMessages(t)}onShowWarningMessagesChange(){let t=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",t,")"),this.preferencesService.setHideWarningMessages(t)}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 t=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",t),this.preferencesService.setVoiceVolume(t)}onVoiceRateChange(){let t=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",t),this.preferencesService.setVoiceRate(t)}loadAvailableVoices(){return ie(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(t){console.error("[OPTIONS] Error loading voices:",t),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(e){return new(e||n)};static \u0275cmp=M({type:n,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(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),h(4,"palette"),c(),s(5,"span"),h(6,"Appearance"),c()(),s(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),j("ngModelChange",function(r){return L(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),c(),F(11,"span",7),h(12," Light "),c(),s(13,"label",5)(14,"input",8),j("ngModelChange",function(r){return L(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),c(),F(15,"span",7),h(16," Dark "),c(),s(17,"label",5)(18,"input",9),j("ngModelChange",function(r){return L(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),c(),F(19,"span",7),h(20," System "),c()()()(),s(21,"div",1)(22,"div",2)(23,"mat-icon"),h(24,"chat_bubble_outline"),c(),s(25,"span"),h(26,"Messaging"),c()(),s(27,"div",3)(28,"span",10),h(29,"Send message behavior:"),c(),s(30,"div",4)(31,"label",5)(32,"input",11),j("ngModelChange",function(r){return L(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),_("change",function(){return i.onEnterToSendChange()}),c(),F(33,"span",7),h(34," Enter to send "),c(),s(35,"label",5)(36,"input",11),j("ngModelChange",function(r){return L(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),_("change",function(){return i.onEnterToSendChange()}),c(),F(37,"span",7),h(38," Enter for new line "),c()()(),s(39,"div",3)(40,"div",12)(41,"span",10),h(42,"Show technical messages"),c(),s(43,"mat-slide-toggle",13),j("ngModelChange",function(r){return L(i.showTechnicalMessages,r)||(i.showTechnicalMessages=r),r}),_("change",function(){return i.onShowTechnicalMessagesChange()}),c()()(),s(44,"div",3)(45,"div",12)(46,"span",10),h(47,"Show warning messages"),c(),s(48,"mat-slide-toggle",13),j("ngModelChange",function(r){return L(i.showWarningMessages,r)||(i.showWarningMessages=r),r}),_("change",function(){return i.onShowWarningMessagesChange()}),c()()(),s(49,"div",3)(50,"div",12)(51,"span",10),h(52,"Include technical messages in print"),c(),s(53,"mat-slide-toggle",13),j("ngModelChange",function(r){return L(i.printTechnicalMessages,r)||(i.printTechnicalMessages=r),r}),_("change",function(){return i.onPrintTechnicalMessagesChange()}),c()()()(),s(54,"div",1)(55,"div",2)(56,"mat-icon"),h(57,"notifications"),c(),s(58,"span"),h(59,"Notifications"),c()(),s(60,"div",3)(61,"div",12)(62,"span",10),h(63,"Notify when the agent answers or requests input"),c(),s(64,"mat-slide-toggle",13),j("ngModelChange",function(r){return L(i.agentNotificationEnabled,r)||(i.agentNotificationEnabled=r),r}),_("change",function(){return i.onAgentNotificationEnabledChange()}),c()()(),s(65,"div",3)(66,"div",12)(67,"span",10),h(68,"Notification sound"),c(),s(69,"mat-slide-toggle",14),j("ngModelChange",function(r){return L(i.notificationSoundEnabled,r)||(i.notificationSoundEnabled=r),r}),_("change",function(){return i.onNotificationSoundEnabledChange()}),c()()(),s(70,"div",3)(71,"div",12)(72,"span",10),h(73,"Browser notification"),c(),s(74,"mat-slide-toggle",14),j("ngModelChange",function(r){return L(i.browserNotificationEnabled,r)||(i.browserNotificationEnabled=r),r}),_("change",function(){return i.onBrowserNotificationEnabledChange()}),c()(),w(75,jC,5,0,"div",15),c()(),s(76,"div",1)(77,"div",2)(78,"mat-icon"),h(79,"record_voice_over"),c(),s(80,"span"),h(81,"Voice & Speech"),c()(),s(82,"div",3)(83,"label",16),h(84,"Voice recognition language:"),c(),s(85,"select",17),j("ngModelChange",function(r){return L(i.selectedVoiceLanguage,r)||(i.selectedVoiceLanguage=r),r}),_("change",function(){return i.onVoiceLanguageChange()}),Oe(86,zC,2,3,"option",18,VC),c()(),s(88,"div",3)(89,"span",10),h(90,"Automatic announcement:"),c(),s(91,"div",4)(92,"label",5)(93,"input",19),j("ngModelChange",function(r){return L(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),_("change",function(){return i.onVoiceAnnounceEnabledChange()}),c(),F(94,"span",7),h(95," Enabled "),c(),s(96,"label",5)(97,"input",19),j("ngModelChange",function(r){return L(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),_("change",function(){return i.onVoiceAnnounceEnabledChange()}),c(),F(98,"span",7),h(99," Disabled "),c()()(),s(100,"div",3)(101,"span",10),h(102,"Voice mode:"),c(),s(103,"div",4)(104,"label",5)(105,"input",20),j("ngModelChange",function(r){return L(i.voiceMode,r)||(i.voiceMode=r),r}),_("change",function(){return i.onVoiceModeChange()}),c(),F(106,"span",7),h(107," Voice synthesis "),c(),s(108,"label",5)(109,"input",21),j("ngModelChange",function(r){return L(i.voiceMode,r)||(i.voiceMode=r),r}),_("change",function(){return i.onVoiceModeChange()}),c(),F(110,"span",7),h(111," Sound notification "),c()()(),s(112,"div",3)(113,"span",10),h(114,"Message reading:"),c(),s(115,"div",4)(116,"label",5)(117,"input",22),j("ngModelChange",function(r){return L(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),_("change",function(){return i.onVoiceReadFullTextChange()}),c(),F(118,"span",7),h(119," Full message "),c(),s(120,"label",5)(121,"input",22),j("ngModelChange",function(r){return L(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),_("change",function(){return i.onVoiceReadFullTextChange()}),c(),F(122,"span",7),h(123," First paragraphs only "),c()()(),s(124,"div",3)(125,"label",23),h(126,"Selected voice:"),c(),s(127,"select",24),j("ngModelChange",function(r){return L(i.selectedVoiceId,r)||(i.selectedVoiceId=r),r}),_("change",function(){return i.onSelectedVoiceChange()}),w(128,BC,2,0,"option",25),w(129,HC,2,0,"option",25),Oe(130,WC,2,2,"option",18,LC),c(),F(132,"div",10),s(133,"a",26),_("click",function(){return i.testVoice()}),s(134,"span",27),h(135,"Test voice"),c()()(),s(136,"div",3)(137,"label",28),h(138),c(),s(139,"input",29),j("ngModelChange",function(r){return L(i.voiceVolume,r)||(i.voiceVolume=r),r}),_("input",function(){return i.onVoiceVolumeChange()}),c()(),s(140,"div",3)(141,"label",30),h(142),c(),s(143,"input",31),j("ngModelChange",function(r){return L(i.voiceRate,r)||(i.voiceRate=r),r}),_("input",function(){return i.onVoiceRateChange()}),c()()()()),e&2&&(m(10),V("ngModel",i.selectedTheme),m(4),V("ngModel",i.selectedTheme),m(4),V("ngModel",i.selectedTheme),m(14),x("value",!0),V("ngModel",i.useEnterToSend),m(4),x("value",!1),V("ngModel",i.useEnterToSend),m(7),V("ngModel",i.showTechnicalMessages),m(5),V("ngModel",i.showWarningMessages),m(5),V("ngModel",i.printTechnicalMessages),m(11),V("ngModel",i.agentNotificationEnabled),m(5),V("ngModel",i.notificationSoundEnabled),x("disabled",!i.agentNotificationEnabled),m(5),V("ngModel",i.browserNotificationEnabled),x("disabled",!i.agentNotificationEnabled||i.browserNotificationDenied),m(),S(i.browserNotificationDenied?75:-1),m(10),V("ngModel",i.selectedVoiceLanguage),m(),Ae(i.voiceLanguageOptions),m(7),x("value",!0),V("ngModel",i.voiceAnnounceEnabled),m(4),x("value",!1),V("ngModel",i.voiceAnnounceEnabled),m(8),V("ngModel",i.voiceMode),m(4),V("ngModel",i.voiceMode),m(8),x("value",!0),V("ngModel",i.voiceReadFullText),m(4),x("value",!1),V("ngModel",i.voiceReadFullText),m(6),V("ngModel",i.selectedVoiceId),x("disabled",i.loadingVoices||i.availableVoices.length===0),m(),S(i.loadingVoices?128:-1),m(),S(!i.loadingVoices&&i.availableVoices.length===0?129:-1),m(),Ae(i.availableVoices),m(8),ae("Volume: ",i.voiceVolume,"%"),m(),V("ngModel",i.voiceVolume),m(3),ae("Speed: ",i.voiceRate,"%"),m(),V("ngModel",i.voiceRate))},dependencies:[Ke,cl,dl,ze,Hd,ll,uo,Xe,Ue,xe,xo],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 UC=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(i,o){},styles:[`textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}
|
|
368
|
-
`],encapsulation:2,changeDetection:0})}return n})(),$C={passive:!0},Qg=(()=>{class n{_platform=d(rt);_ngZone=d(me);_renderer=d(gi).createRenderer(null,null);_styleLoader=d(Lt);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return Lm;this._styleLoader.load(UC);let i=jr(e),o=this._monitoredElements.get(i);if(o)return o.subject;let r=new D,a="cdk-text-field-autofilled",l=u=>{u.animationName==="cdk-text-field-autofill-start"&&!i.classList.contains(a)?(i.classList.add(a),this._ngZone.run(()=>r.next({target:u.target,isAutofilled:!0}))):u.animationName==="cdk-text-field-autofill-end"&&i.classList.contains(a)&&(i.classList.remove(a),this._ngZone.run(()=>r.next({target:u.target,isAutofilled:!1})))},p=this._ngZone.runOutsideAngular(()=>(i.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(i,"animationstart",l,$C)));return this._monitoredElements.set(i,{subject:r,unlisten:p}),r}stopMonitoring(e){let i=jr(e),o=this._monitoredElements.get(i);o&&(o.unlisten(),o.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((e,i)=>this.stopMonitoring(i))}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Xg=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({})}return n})();var Kg=new ee("MAT_INPUT_VALUE_ACCESSOR");var tm=class{_box;_destroyed=new D;_resizeSubject=new D;_resizeObserver;_elementObservables=new Map;constructor(t){this._box=t,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)))}observe(t){return this._elementObservables.has(t)||this._elementObservables.set(t,new oi(e=>{let i=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(t,{box:this._box}),()=>{this._resizeObserver?.unobserve(t),i.unsubscribe(),this._elementObservables.delete(t)}}).pipe(pe(e=>e.some(i=>i.target===t)),Mn({bufferSize:1,refCount:!0}),N(this._destroyed))),this._elementObservables.get(t)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},Zg=(()=>{class n{_cleanupErrorListener;_observers=new Map;_ngZone=d(me);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,i){let o=i?.box||"content-box";return this._observers.has(o)||this._observers.set(o,new tm(o)),this._observers.get(o).observe(e)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var qC=["notch"],GC=["matFormFieldNotchedOutline",""],YC=["*"],Jg=["iconPrefixContainer"],ef=["textPrefixContainer"],tf=["iconSuffixContainer"],nf=["textSuffixContainer"],QC=["textField"],XC=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],KC=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function ZC(n,t){n&1&&F(0,"span",21)}function JC(n,t){if(n&1&&(s(0,"label",20),he(1,1),w(2,ZC,1,0,"span",21),c()),n&2){let e=g(2);x("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),Y("for",e._control.disableAutomaticLabeling?null:e._control.id),m(2),S(!e.hideRequiredMarker&&e._control.required?2:-1)}}function ex(n,t){if(n&1&&w(0,JC,3,5,"label",20),n&2){let e=g();S(e._hasFloatingLabel()?0:-1)}}function tx(n,t){n&1&&F(0,"div",7)}function ix(n,t){}function nx(n,t){if(n&1&&Ge(0,ix,0,0,"ng-template",13),n&2){g(2);let e=ti(1);x("ngTemplateOutlet",e)}}function ox(n,t){if(n&1&&(s(0,"div",9),w(1,nx,1,1,null,13),c()),n&2){let e=g();x("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),m(),S(e._forceDisplayInfixLabel()?-1:1)}}function rx(n,t){n&1&&(s(0,"div",10,2),he(2,2),c())}function ax(n,t){n&1&&(s(0,"div",11,3),he(2,3),c())}function sx(n,t){}function lx(n,t){if(n&1&&Ge(0,sx,0,0,"ng-template",13),n&2){g();let e=ti(1);x("ngTemplateOutlet",e)}}function cx(n,t){n&1&&(s(0,"div",14,4),he(2,4),c())}function dx(n,t){n&1&&(s(0,"div",15,5),he(2,5),c())}function mx(n,t){n&1&&F(0,"div",16)}function hx(n,t){n&1&&(s(0,"div",18),he(1,6),c())}function px(n,t){if(n&1&&(s(0,"mat-hint",22),h(1),c()),n&2){let e=g(2);x("id",e._hintLabelId),m(),B(e.hintLabel)}}function ux(n,t){if(n&1&&(s(0,"div",19),w(1,px,2,2,"mat-hint",22),he(2,7),F(3,"div",23),he(4,8),c()),n&2){let e=g();m(),S(e.hintLabel?1:-1)}}var Ut=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["mat-label"]]})}return n})(),gx=new ee("MatError");var wn=(()=>{class n{align="start";id=d(Fe).getId("mat-mdc-hint-");static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(i,o){i&2&&(ei("id",o.id),Y("align",null),A("mat-mdc-form-field-hint-end",o.align==="end"))},inputs:{align:"align",id:"id"}})}return n})(),df=new ee("MatPrefix"),wo=(()=>{class n{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[fe([{provide:df,useExisting:n}])]})}return n})(),fx=new ee("MatSuffix");var mf=new ee("FloatingLabelParent"),of=(()=>{class n{_elementRef=d(K);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=d(Zg);_ngZone=d(me);_parent=d(mf);_resizeSubscription=new Di;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return _x(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(i,o){i&2&&A("mdc-floating-label--float-above",o.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return n})();function _x(n){let t=n;if(t.offsetParent!==null)return t.scrollWidth;let e=t.cloneNode(!0);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let i=e.scrollWidth;return e.remove(),i}var rf="mdc-line-ripple--active",Bl="mdc-line-ripple--deactivating",af=(()=>{class n{_elementRef=d(K);_cleanupTransitionEnd;constructor(){let e=d(me),i=d(ot);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=i.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(Bl),e.add(rf)}deactivate(){this._elementRef.nativeElement.classList.add(Bl)}_handleTransitionEnd=e=>{let i=this._elementRef.nativeElement.classList,o=i.contains(Bl);e.propertyName==="opacity"&&o&&i.remove(rf,Bl)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return n})(),sf=(()=>{class n{_elementRef=d(K);_ngZone=d(me);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,i=e.querySelector(".mdc-floating-label");i?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(i.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>i.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let i=this._notch.nativeElement;!this.open||!e?i.style.width="":i.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(i,o){if(i&1&&ne(qC,5),i&2){let r;W(r=U())&&(o._notch=r.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(i,o){i&2&&A("mdc-notched-outline--notched",o.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:GC,ngContentSelectors:YC,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(i,o){i&1&&(He(),eo(0,"div",1),ri(1,"div",2,0),he(3),ai(),eo(4,"div",3))},encapsulation:2,changeDetection:0})}return n})(),ka=(()=>{class n{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n})}return n})();var Ma=new ee("MatFormField"),bx=new ee("MAT_FORM_FIELD_DEFAULT_OPTIONS"),lf="fill",vx="auto",cf="fixed",yx="translateY(-50%)",$t=(()=>{class n{_elementRef=d(K);_changeDetectorRef=d(Re);_platform=d(rt);_idGenerator=d(Fe);_ngZone=d(me);_defaults=d(bx,{optional:!0});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=Lr("iconPrefixContainer");_textPrefixContainerSignal=Lr("textPrefixContainer");_iconSuffixContainerSignal=Lr("iconSuffixContainer");_textSuffixContainerSignal=Lr("textSuffixContainer");_prefixSuffixContainers=ft(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=ah(Ut);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=Dt(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||vx}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let i=e||this._defaults?.appearance||lf;this._appearanceSignal.set(i)}_appearanceSignal=Te(lf);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||cf}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||cf}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e}_destroyed=new D;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=We();constructor(){let e=this._defaults,i=d(Ct);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),Vo(()=>this._currentDirection=i.valueSignal()),this._syncOutlineLabelOffset()}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=ft(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let i=this._control,o="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(o+e.controlType),i.controlType&&this._elementRef.nativeElement.classList.add(o+i.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=i.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=i.stateChanges.pipe(Vt([void 0,void 0]),ve(()=>[i.errorState,i.userAriaDescribedBy]),Fo(),pe(([[r,a],[l,p]])=>r!==l||a!==p)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),i.ngControl&&i.ngControl.valueChanges&&(this._valueChanges=i.ngControl.valueChanges.pipe(N(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Ii(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){this._control}_updateFocusState(){let e=this._control.focused;e&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!e&&(this._isFocused||this._isFocused===null)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",e),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",e)}_syncOutlineLabelOffset(){sh({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset())});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"})}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())})}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=ft(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let i=this._control?this._control.ngControl:null;return i&&i[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth())}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){this._hintChildren}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let r=this._hintChildren?this._hintChildren.find(l=>l.align==="start"):null,a=this._hintChildren?this._hintChildren.find(l=>l.align==="end"):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id)}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));let i=this._control.describedByIds,o;if(i){let r=this._describedByIds||e;o=e.concat(i.filter(a=>a&&!r.includes(a)))}else o=e;this._control.setDescribedByIds(o),this._describedByIds=e}}_getOutlinedLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,i=this._textPrefixContainer?.nativeElement,o=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,l=i?.getBoundingClientRect().width??0,p=o?.getBoundingClientRect().width??0,u=r?.getBoundingClientRect().width??0,b=this._currentDirection==="rtl"?"-1":"1",C=`${a+l}px`,P=`calc(${b} * (${C} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,k=`var(--mat-mdc-form-field-label-transform, ${yx} translateX(${P}))`,z=a+l+p+u;return[k,z]}_writeOutlinedLabelStyles(e){if(e!==null){let[i,o]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=i),o!==null&&this._notchedOutline?._setMaxWidth(o)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let i=e.getRootNode();return i&&i!==e}return document.documentElement.contains(e)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-form-field"]],contentQueries:function(i,o,r){if(i&1&&(ih(r,o._labelChild,Ut,5),Tt(r,ka,5),Tt(r,df,5),Tt(r,fx,5),Tt(r,gx,5),Tt(r,wn,5)),i&2){vc();let a;W(a=U())&&(o._formFieldControl=a.first),W(a=U())&&(o._prefixChildren=a),W(a=U())&&(o._suffixChildren=a),W(a=U())&&(o._errorChildren=a),W(a=U())&&(o._hintChildren=a)}},viewQuery:function(i,o){if(i&1&&(Nr(o._iconPrefixContainerSignal,Jg,5),Nr(o._textPrefixContainerSignal,ef,5),Nr(o._iconSuffixContainerSignal,tf,5),Nr(o._textSuffixContainerSignal,nf,5),ne(QC,5),ne(Jg,5),ne(ef,5),ne(tf,5),ne(nf,5),ne(of,5),ne(sf,5),ne(af,5)),i&2){vc(4);let r;W(r=U())&&(o._textField=r.first),W(r=U())&&(o._iconPrefixContainer=r.first),W(r=U())&&(o._textPrefixContainer=r.first),W(r=U())&&(o._iconSuffixContainer=r.first),W(r=U())&&(o._textSuffixContainer=r.first),W(r=U())&&(o._floatingLabel=r.first),W(r=U())&&(o._notchedOutline=r.first),W(r=U())&&(o._lineRipple=r.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(i,o){i&2&&A("mat-mdc-form-field-label-always-float",o._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",o._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",o._hasIconSuffix)("mat-form-field-invalid",o._control.errorState)("mat-form-field-disabled",o._control.disabled)("mat-form-field-autofilled",o._control.autofilled)("mat-form-field-appearance-fill",o.appearance=="fill")("mat-form-field-appearance-outline",o.appearance=="outline")("mat-form-field-hide-placeholder",o._hasFloatingLabel()&&!o._shouldLabelFloat())("mat-primary",o.color!=="accent"&&o.color!=="warn")("mat-accent",o.color==="accent")("mat-warn",o.color==="warn")("ng-untouched",o._shouldForward("untouched"))("ng-touched",o._shouldForward("touched"))("ng-pristine",o._shouldForward("pristine"))("ng-dirty",o._shouldForward("dirty"))("ng-valid",o._shouldForward("valid"))("ng-invalid",o._shouldForward("invalid"))("ng-pending",o._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[fe([{provide:Ma,useExisting:n},{provide:mf,useExisting:n}])],ngContentSelectors:KC,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],["aria-atomic","true","aria-live","polite",1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(i,o){if(i&1){let r=E();He(XC),Ge(0,ex,1,1,"ng-template",null,0,Ga),s(2,"div",6,1),_("click",function(l){return v(r),y(o._control.onContainerClick(l))}),w(4,tx,1,0,"div",7),s(5,"div",8),w(6,ox,2,2,"div",9),w(7,rx,3,0,"div",10),w(8,ax,3,0,"div",11),s(9,"div",12),w(10,lx,1,1,null,13),he(11),c(),w(12,cx,3,0,"div",14),w(13,dx,3,0,"div",15),c(),w(14,mx,1,0,"div",16),c(),s(15,"div",17),w(16,hx,2,0,"div",18)(17,ux,5,1,"div",19),c()}if(i&2){let r;m(2),A("mdc-text-field--filled",!o._hasOutline())("mdc-text-field--outlined",o._hasOutline())("mdc-text-field--no-label",!o._hasFloatingLabel())("mdc-text-field--disabled",o._control.disabled)("mdc-text-field--invalid",o._control.errorState),m(2),S(!o._hasOutline()&&!o._control.disabled?4:-1),m(2),S(o._hasOutline()?6:-1),m(),S(o._hasIconPrefix?7:-1),m(),S(o._hasTextPrefix?8:-1),m(2),S(!o._hasOutline()||o._forceDisplayInfixLabel()?10:-1),m(2),S(o._hasTextSuffix?12:-1),m(),S(o._hasIconSuffix?13:-1),m(),S(o._hasOutline()?-1:14),m(),A("mat-mdc-form-field-subscript-dynamic-size",o.subscriptSizing==="dynamic");let a=o._getSubscriptMessageType();m(),S((r=a)==="error"?16:r==="hint"?17:-1)}},dependencies:[of,sf,Xa,af,wn],styles:[`.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}
|
|
369
|
-
`],encapsulation:2,changeDetection:0})}return n})();var Hl=(()=>{class n{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var kr=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(t,e,i,o,r){this._defaultMatcher=t,this.ngControl=e,this._parentFormGroup=i,this._parentForm=o,this._stateChanges=r}updateErrorState(){let t=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,o=this.ngControl?this.ngControl.control:null,r=i?.isErrorState(o,e)??!1;r!==t&&(this.errorState=r,this._stateChanges.next())}};var ut=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le,yh,$t,le]})}return n})();var Cx=["button","checkbox","file","hidden","image","radio","range","reset","submit"],xx=new ee("MAT_INPUT_CONFIG"),pi=(()=>{class n{_elementRef=d(K);_platform=d(rt);ngControl=d(Gi,{optional:!0,self:!0});_autofillMonitor=d(Qg);_ngZone=d(me);_formField=d(Ma,{optional:!0});_renderer=d(ot);_uid=d(Fe).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=d(xx,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new D;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=Dt(e),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(e){this._id=e||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(or.required)??!1}set required(e){this._required=Dt(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&Sc().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(e){e!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(e):this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=Dt(e)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(e=>Sc().has(e));constructor(){let e=d(ba,{optional:!0}),i=d(ya,{optional:!0}),o=d(Hl),r=d(Kg,{optional:!0,self:!0}),a=this._elementRef.nativeElement,l=a.nodeName.toLowerCase();r?$a(r.value)?this._signalBasedValueAccessor=r:this._inputValueAccessor=r:this._inputValueAccessor=a,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(a,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new kr(o,this.ngControl,i,e,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect=l==="select",this._isTextarea=l==="textarea",this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=a.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&Vo(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(e){if(e!==this.focused){if(!this._isNativeSelect&&e&&this.disabled&&this.disabledInteractive){let i=this._elementRef.nativeElement;i.type==="number"?(i.type="text",i.setSelectionRange(0,0),i.type="number"):i.setSelectionRange(0,0)}this.focused=e,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){let e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){let e=this._getPlaceholder();if(e!==this._previousPlaceholder){let i=this._elementRef.nativeElement;this._previousPlaceholder=e,e?i.setAttribute("placeholder",e):i.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){Cx.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let e=this._elementRef.nativeElement,i=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&i&&i.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let i=this._elementRef.nativeElement;e.length?i.setAttribute("aria-describedby",e.join(" ")):i.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}_iOSKeyupListener=e=>{let i=e.target;!i.value&&i.selectionStart===0&&i.selectionEnd===0&&(i.setSelectionRange(1,1),i.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(i,o){i&1&&_("focus",function(){return o._focusChanged(!0)})("blur",function(){return o._focusChanged(!1)})("input",function(){return o._onInput()}),i&2&&(ei("id",o.id)("disabled",o.disabled&&!o.disabledInteractive)("required",o.required),Y("name",o.name||null)("readonly",o._getReadonlyAttribute())("aria-disabled",o.disabled&&o.disabledInteractive?"true":null)("aria-invalid",o.empty&&o.required?null:o.errorState)("aria-required",o.required)("id",o.id),A("mat-input-server",o._isServer)("mat-mdc-form-field-textarea-control",o._isInFormField&&o._isTextarea)("mat-mdc-form-field-input-control",o._isInFormField)("mat-mdc-input-disabled-interactive",o.disabledInteractive)("mdc-text-field__input",o._isInFormField)("mat-mdc-native-select-inline",o._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},exportAs:["matInput"],features:[fe([{provide:ka,useExisting:n}]),Le]})}return n})(),Zt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le,ut,ut,Xg,le]})}return n})();var wx=["tooltip"],im=20;var nm=new ee("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=d(ge);return()=>Hi(n,{scrollThrottle:im})}});function uf(n){let t=d(ge);return()=>Hi(t,{scrollThrottle:im})}var om={provide:nm,deps:[],useFactory:uf};function gf(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}var ff=new ee("mat-tooltip-default-options",{providedIn:"root",factory:gf});var hf="tooltip-panel",pf=bh({passive:!0}),Sx=8,kx=8,Mx=24,Ex=200,rm=(()=>{class n{_elementRef=d(K);_ngZone=d(me);_platform=d(rt);_ariaDescriber=d(ns);_focusMonitor=d(Vi);_dir=d(Ct);_injector=d(ge);_viewContainerRef=d(Zn);_animationsDisabled=We();_defaultOptions=d(ff,{optional:!0});_overlayRef;_tooltipInstance;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=_f;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(e){e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(e){this._positionAtOrigin=Dt(e),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(e){let i=Dt(e);this._disabled!==i&&(this._disabled=i,i?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(e){this._showDelay=bi(e)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(e){this._hideDelay=bi(e),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(e){let i=this._message;this._message=e!=null?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(i)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new D;_isDestroyed=!1;constructor(){let e=this._defaultOptions;e&&(this._showDelay=e.showDelay,this._hideDelay=e.hideDelay,e.position&&(this.position=e.position),e.positionAtOrigin&&(this.positionAtOrigin=e.positionAtOrigin),e.touchGestures&&(this.touchGestures=e.touchGestures),e.tooltipClass&&(this.tooltipClass=e.tooltipClass)),this._viewportMargin=Sx}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(N(this._destroyed)).subscribe(e=>{e?e==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){let e=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([i,o])=>{e.removeEventListener(i,o,pf)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}show(e=this.showDelay,i){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let o=this._createOverlay(i);this._detach(),this._portal=this._portal||new Ci(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=o.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(N(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(e)}hide(e=this.hideDelay){let i=this._tooltipInstance;i&&(i.isVisible()?i.hide(e):(i._cancelPendingAnimations(),this._detach()))}toggle(e){this._isTooltipVisible()?this.hide():this.show(void 0,e)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(e){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!e)&&a._origin instanceof K)return this._overlayRef;this._detach()}let i=this._injector.get(cn).getAncestorScrollContainers(this._elementRef),o=`${this._cssClassPrefix}-${hf}`,r=Xr(this._injector,this.positionAtOrigin?e||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(i);return r.positionChanges.pipe(N(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=pn(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,o]:o,scrollStrategy:this._injector.get(nm)(),disableAnimations:this._animationsDisabled}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(N(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(N(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(N(this._destroyed)).subscribe(a=>{this._isTooltipVisible()&&a.keyCode===27&&!vt(a)&&(a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(N(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(e){let i=e.getConfig().positionStrategy,o=this._getOrigin(),r=this._getOverlayPosition();i.withPositions([this._addOffset(q(q({},o.main),r.main)),this._addOffset(q(q({},o.fallback),r.fallback))])}_addOffset(e){let i=kx,o=!this._dir||this._dir.value=="ltr";return e.originY==="top"?e.offsetY=-i:e.originY==="bottom"?e.offsetY=i:e.originX==="start"?e.offsetX=o?-i:i:e.originX==="end"&&(e.offsetX=o?i:-i),e}_getOrigin(){let e=!this._dir||this._dir.value=="ltr",i=this.position,o;i=="above"||i=="below"?o={originX:"center",originY:i=="above"?"top":"bottom"}:i=="before"||i=="left"&&e||i=="right"&&!e?o={originX:"start",originY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(o={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(o.originX,o.originY);return{main:o,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let e=!this._dir||this._dir.value=="ltr",i=this.position,o;i=="above"?o={overlayX:"center",overlayY:"bottom"}:i=="below"?o={overlayX:"center",overlayY:"top"}:i=="before"||i=="left"&&e||i=="right"&&!e?o={overlayX:"end",overlayY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(o={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(o.overlayX,o.overlayY);return{main:o,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),Et(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}_invertPosition(e,i){return this.position==="above"||this.position==="below"?i==="top"?i="bottom":i==="bottom"&&(i="top"):e==="end"?e="start":e==="start"&&(e="end"),{x:e,y:i}}_updateCurrentPositionClass(e){let{overlayY:i,originX:o,originY:r}=e,a;if(i==="center"?this._dir&&this._dir.value==="rtl"?a=o==="end"?"left":"right":a=o==="start"?"left":"right":a=i==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let l=this._overlayRef;if(l){let p=`${this._cssClassPrefix}-${hf}-`;l.removePanelClass(p+this._currentPosition),l.addPanelClass(p+a)}this._currentPosition=a}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",e=>{this._setupPointerExitEventsIfNeeded();let i;e.x!==void 0&&e.y!==void 0&&(i=e),this.show(void 0,i)}]):this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",e=>{let i=e.targetTouches?.[0],o=i?{x:i.clientX,y:i.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,o)},this._defaultOptions?.touchLongPressShowDelay??r)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;let e=[];if(this._platformSupportsMouseEvents())e.push(["mouseleave",i=>{let o=i.relatedTarget;(!o||!this._overlayRef?.overlayElement.contains(o))&&this.hide()}],["wheel",i=>this._wheelListener(i)]);else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let i=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};e.push(["touchend",i],["touchcancel",i])}this._addListeners(e),this._passiveListeners.push(...e)}_addListeners(e){e.forEach(([i,o])=>{this._elementRef.nativeElement.addEventListener(i,o,pf)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(e){if(this._isTooltipVisible()){let i=this._injector.get(it).elementFromPoint(e.clientX,e.clientY),o=this._elementRef.nativeElement;i!==o&&!o.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){let e=this.touchGestures;if(e!=="off"){let i=this._elementRef.nativeElement,o=i.style;(e==="on"||i.nodeName!=="INPUT"&&i.nodeName!=="TEXTAREA")&&(o.userSelect=o.msUserSelect=o.webkitUserSelect=o.MozUserSelect="none"),(e==="on"||!i.draggable)&&(o.webkitUserDrag="none"),o.touchAction="none",o.webkitTapHighlightColor="transparent"}}_syncAriaDescription(e){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,e,"tooltip"),this._isDestroyed||Et({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(i,o){i&2&&A("mat-mdc-tooltip-disabled",o.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),_f=(()=>{class n{_changeDetectorRef=d(Re);_elementRef=d(K);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=We();_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new D;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){}show(e){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},e)}hide(e){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},e)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:e}){(!e||!this._triggerElement.contains(e))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){let e=this._elementRef.nativeElement.getBoundingClientRect();return e.height>Mx&&e.width>=Ex}_handleAnimationEnd({animationName:e}){(e===this._showAnimation||e===this._hideAnimation)&&this._finalizeAnimation(e===this._showAnimation)}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(e){e?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(e){let i=this._tooltip.nativeElement,o=this._showAnimation,r=this._hideAnimation;if(i.classList.remove(e?r:o),i.classList.add(e?o:r),this._isVisible!==e&&(this._isVisible=e,this._changeDetectorRef.markForCheck()),e&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(i);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=!0)}e&&this._onShow(),this._animationsDisabled&&(i.classList.add("_mat-animation-noopable"),this._finalizeAnimation(e))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(i,o){if(i&1&&ne(wx,7),i&2){let r;W(r=U())&&(o._tooltip=r.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(i,o){i&1&&_("mouseleave",function(a){return o._handleMouseLeave(a)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(i,o){if(i&1){let r=E();s(0,"div",1,0),_("animationend",function(l){return v(r),y(o._handleAnimationEnd(l))}),s(2,"div",2),h(3),c()()}i&2&&(A("mdc-tooltip--multiline",o._isMultiline),x("ngClass",o.tooltipClass),m(3),B(o.message))},dependencies:[An],styles:[`.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mat-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mat-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mat-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mat-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mat-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mat-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}
|
|
370
|
-
`],encapsulation:2,changeDetection:0})}return n})();var
|
|
371
|
-
|
|
372
|
-
`+(e.summary||""):e.summary||"")("matTooltipDisabled",!e.summary),m(),S(e.name?1:2)}}function Vx(n,t){if(n&1){let e=E();s(0,"button",23),_("click",function(o){v(e);let r=g().$implicit,a=g(4);return y(a.startEditingThreadName(o,r))}),s(1,"mat-icon"),h(2,"edit"),c()()}}function Lx(n,t){if(n&1){let e=E();s(0,"div",10),w(1,Ix,3,3,"div",11)(2,Nx,3,3,"a",12),s(3,"div",13),w(4,Vx,3,0,"button",14),s(5,"button",15),_("click",function(o){let r=v(e).$implicit,a=g(4);return y(a.toggleStar(o,r))}),s(6,"mat-icon"),h(7),c()(),s(8,"button",16),_("click",function(o){let r=v(e).$implicit,a=g(4);return y(a.deleteThread(o,r))}),s(9,"mat-icon"),h(10,"delete"),c()()()()}if(n&2){let e,i=t.$implicit,o=g(4);A("current",i.id===((e=o.currentThread())==null?null:e.id)),m(),S(o.editingThreadId===i.id?1:2),m(3),S(o.editingThreadId!==i.id&&i.name?4:-1),m(),A("starred",o.isStarred(i)),x("title",o.isStarred(i)?"Unstar thread":"Star thread"),m(2),B(o.isStarred(i)?"star":"star_outline")}}function jx(n,t){if(n&1&&(s(0,"div",6)(1,"div",8),h(2),c(),Oe(3,Lx,11,8,"div",9,Ox),c()),n&2){let e=t.$implicit;m(2),B(e.label),m(),Ae(e.threads)}}function zx(n,t){n&1&&(s(0,"div",7),h(1,"No existing threads"),c())}function Bx(n,t){if(n&1&&(s(0,"div",7),h(1),c()),n&2){let e=g(3);m(),ae('No threads matching "',e.searchQuery,'"')}}function Hx(n,t){if(n&1&&(Oe(0,jx,5,1,"div",6,Px),w(2,zx,2,0,"div",7)(3,Bx,2,1,"div",7)),n&2){let e,i=g(2);Ae(i.getGroupedThreads()),m(2),S(!((e=i.threads())!=null&&e.length)&&!i.searchQuery?2:i.searchQuery&&i.getGroupedThreads().length===0?3:-1)}}function Wx(n,t){if(n&1&&(s(0,"div",1),w(1,Ax,4,0,"div",3)(2,Hx,4,1),c()),n&2){let e=g();m(),S(e.isLoadingThreadList()?1:2)}}function Ux(n,t){n&1&&(s(0,"span",24),h(1,"No project selected"),c())}function $x(n,t){n&1&&(s(0,"span",24),h(1,"Loading..."),c())}function qx(n,t){if(n&1&&(s(0,"div",2),w(1,Ux,2,0,"span",24)(2,$x,2,0,"span",24),c()),n&2){let e,i=g();m(),S((e=i.currentProject())!=null&&e.name?2:1)}}var Ul=class n{projects=null;searchMode=!1;searchQuery="";searchModeChange=new H;projectStateService=d(we);threadStateService=d(Rt);threadApiService=d(Un);userService=d(Wl);router=d(Dn);currentThread=jt(this.threadStateService.selectedThread$);currentProject=jt(this.projectStateService.selectedProject$);threads=jt(this.threadStateService.threadList$);isLoadingThreadList=jt(this.threadStateService.isLoadingThreadList$);username=jt(this.userService.username$);editingThreadId=null;editingThreadName="";isRenamingThread=!1;renameErrorMessage="";ngOnInit(){this.userService.fetchCurrentUser().subscribe({error:t=>{console.error("[THREAD-SELECTOR] Failed to load current user:",t)}})}selectThread(t){this.threadStateService.selectThread(t),this.router.navigate(["project",this.currentProject()?.name,"thread",t])}getGroupedThreads(){let t=this.threads();if(!t?.length)return[];if(this.searchQuery&&this.searchQuery.trim()){let u=this.searchQuery.toLowerCase().trim();t=t.filter(b=>b.name.toLowerCase().includes(u)||b.summary&&b.summary.toLowerCase().includes(u))}if(!t.length)return[];let e=this.username();if(!e)return[];let i=t.filter(u=>u.starring&&u.starring.includes(e)),o=t.filter(u=>!u.starring||!u.starring.includes(e)),r=new Map,a=new Date;a.setHours(0,0,0,0);for(let u of o){let b=new Date(u.modifiedDate);b.setHours(0,0,0,0);let C=a.getTime()-b.getTime(),T=Math.floor(C/(1e3*60*60*24)),P;T===0?P="Today":T===1?P="Yesterday":T<7?P="This Week":T<30?P="This Month":T<90?P="Last 3 Months":P="Older",r.has(P)||r.set(P,[]),r.get(P).push(u)}let l=[];if(i.length>0){let u=[...i].sort((b,C)=>b.modifiedDate>C.modifiedDate?-1:1);l.push({label:"Starred",threads:u})}return["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(u=>r.has(u)).forEach(u=>{l.push({label:u,threads:r.get(u)})}),l}isStarred(t){let e=this.username();return!!e&&t.starring&&t.starring.includes(e)}toggleStar(t,e){t.stopPropagation();let i=this.username();if(!i)return;(e.starring&&e.starring.includes(i)?this.threadApiService.unstarThread(e.id):this.threadApiService.starThread(e.id)).subscribe({next:()=>{this.threadStateService.refreshThreadList()},error:a=>{console.error("Error toggling star:",a)}})}deleteThread(t,e){t.stopPropagation();let i=this.currentProject()?.name;!i||!confirm(`Are you sure you want to delete the thread "${e.name}"?`)||this.threadApiService.deleteThread(e.id).subscribe({next:()=>{this.currentThread()?.id===e.id&&(this.threadStateService.clearSelection(),this.router.navigate(["project",i])),this.threadStateService.refreshThreadList()},error:r=>{console.error("Error deleting thread:",r),alert("Failed to delete thread. Please try again.")}})}formatDate(t){try{let e=new Date(t),o=new Date().getTime()-e.getTime(),r=Math.floor(o/(1e3*60*60*24));return r===0?"Today":r===1?"Yesterday":r<7?`${r} days ago`:e.toLocaleDateString("en-EN",{day:"numeric",month:"short"})}catch{return"No date"}}startEditingThreadName(t,e){t.stopPropagation(),this.editingThreadId=e.id,this.editingThreadName=e.name||"",this.renameErrorMessage="",setTimeout(()=>{let i=document.querySelector(".thread-name-input");i&&(i.focus(),i.select())},0)}cancelEditingThreadName(){this.editingThreadId=null,this.editingThreadName="",this.renameErrorMessage=""}saveThreadName(t){if(t&&t.stopPropagation(),!this.editingThreadId)return;let e=this.editingThreadName.trim();if(!e){this.renameErrorMessage="Thread name cannot be empty";return}if(e.length>200){this.renameErrorMessage="Thread name is too long (max 200 characters)";return}let i=this.editingThreadId;this.isRenamingThread=!0,this.renameErrorMessage="",this.threadStateService.renameThread(i,e).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=!1},error:o=>{console.error("[THREAD-SELECTOR] Error renaming thread:",o),this.renameErrorMessage=o.message||"Failed to rename thread",this.isRenamingThread=!1}})}onEditKeydown(t){t.key==="Enter"?(t.preventDefault(),t.stopPropagation(),this.saveThreadName()):t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.cancelEditingThreadName())}onEditBlur(){setTimeout(()=>{this.editingThreadId&&!this.isRenamingThread&&this.saveThreadName()},200)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-thread-selector"]],inputs:{searchMode:"searchMode",searchQuery:"searchQuery"},outputs:{searchModeChange:"searchModeChange"},decls:3,vars:1,consts:[["tabindex","0","role","application","aria-label","Thread selector",1,"thread-selector",3,"click","keydown"],["role","menu","aria-label","Thread selection",1,"thread-list"],[1,"thread-disabled"],[1,"thread-loading"],[1,"loading-spinner"],[1,"loading-text"],[1,"thread-group"],[1,"thread-empty"],[1,"thread-group-header"],[1,"thread-item-wrapper",3,"current"],[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"],[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(e,i){if(e&1&&(s(0,"div",0),_("click",function(r){return r.stopPropagation()})("keydown",function(r){return r.stopPropagation()}),w(1,Wx,3,1,"div",1)(2,qx,3,1,"div",2),c()),e&2){let o;m(),S((o=i.currentProject())!=null&&o.name?1:2)}},dependencies:[De,Ke,ze,Xe,Ud,Ue,Qe,xe,xt,yt,Zt,ut,Sl,wl,am,rm],styles:[".thread-selector[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;min-height:0}.sidenav-thread-selector[_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%], .sidenav-thread-selector [_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%]{flex:1;min-height:0}.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}@media (max-width: 768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"]})};function Gx(n,t){if(n&1&&(s(0,"div",3),h(1),c()),n&2){let e=g();m(),ae("\u274C ",e.errorMessage)}}var Ea=class n{dialogRef=d(ii);data=d(Wi);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName)}getDefaultTitle(t,e){return t==="user"?"User Configuration":`Project Configuration: ${e||"Unknown"}`}onSave(){this.errorMessage="";let t;try{t=JSON.parse(this.jsonContent)}catch(e){this.errorMessage=`Invalid JSON syntax: ${e instanceof Error?e.message:"Unknown error"}`;return}this.dialogRef.close(t)}onCancel(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,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(e,i){e&1&&(s(0,"div",0),h(1),s(2,"button",1),_("click",function(){return i.onCancel()}),s(3,"mat-icon"),h(4,"close"),c()()(),s(5,"mat-dialog-content")(6,"textarea",2),j("ngModelChange",function(r){return L(i.jsonContent,r)||(i.jsonContent=r),r}),c(),w(7,Gx,2,1,"div",3),c(),s(8,"mat-dialog-actions",4)(9,"button",5),_("click",function(){return i.onCancel()}),h(10,"Cancel"),c(),s(11,"button",6),_("click",function(){return i.onSave()}),h(12,"Save"),c()()),e&2&&(m(),ae(" ",i.title," "),m(5),V("ngModel",i.jsonContent),m(),S(i.errorMessage?7:-1))},dependencies:[De,Ke,ze,Xe,Ue,xe,yt,It,un,gn,fn],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)}"]})};function Yx(n,t){if(n&1){let e=E();s(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),h(3),c(),s(4,"textarea",19),j("ngModelChange",function(o){let r=v(e).$index,a=g();return L(a.commands[r],o)||(a.commands[r]=o),y(o)}),c(),s(5,"mat-hint"),h(6,"Use placeholder for dynamic values"),c()(),s(7,"button",20),_("click",function(){let o=v(e).$index,r=g();return y(r.removeCommand(o))}),s(8,"mat-icon"),h(9,"delete"),c()()()}if(n&2){let e=t.$index,i=g();m(3),ae("Prompt ",e+1),m(),V("ngModel",i.commands[e]),m(3),x("disabled",i.commands.length===1)}}function Qx(n,t){if(n&1){let e=E();s(0,"div",10)(1,"h3"),h(2,"Save to"),c(),s(3,"div",21)(4,"label",22)(5,"input",23),j("ngModelChange",function(o){v(e);let r=g();return L(r.source,o)||(r.source=o),y(o)}),c(),s(6,"div",24)(7,"div",25)(8,"span",26),h(9,"\u{1F464}"),c(),s(10,"span",27),h(11,"Local"),c()(),s(12,"p",28),h(13,"Personal prompt in ~/.coday/... (not committed)"),c()()(),s(14,"label",22)(15,"input",29),j("ngModelChange",function(o){v(e);let r=g();return L(r.source,o)||(r.source=o),y(o)}),c(),s(16,"div",24)(17,"div",25)(18,"span",26),h(19,"\u{1F4E6}"),c(),s(20,"span",27),h(21,"Project"),c()(),s(22,"p",28),h(23,"Shared prompt in ./prompts/ (committable)"),c()()()(),s(24,"p",30),h(25,"Storage location is permanent and cannot be changed after creation"),c()()}if(n&2){let e=g();m(4),A("selected",e.source==="local"),m(),V("ngModel",e.source),m(9),A("selected",e.source==="project"),m(),V("ngModel",e.source)}}function Xx(n,t){if(n&1&&(s(0,"div",11)(1,"h3"),h(2,"Storage Location"),c(),s(3,"div",31)(4,"span",26),h(5),c(),s(6,"span",27),h(7),c()(),s(8,"p",30),h(9,"Cannot be changed after creation"),c()()),n&2){let e=g();m(3),A("badge-local",e.source==="local")("badge-project",e.source==="project"),m(2),B(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),m(2),B(e.source==="local"?"Local":"Project")}}function Kx(n,t){if(n&1){let e=E();s(0,"div",12)(1,"label",32)(2,"input",33),j("ngModelChange",function(o){v(e);let r=g();return L(r.webhookEnabled,o)||(r.webhookEnabled=o),y(o)}),c(),s(3,"span"),h(4,"Enable webhook"),c()(),s(5,"p",30),h(6,"Enable webhook to trigger this prompt via HTTP POST"),c()()}if(n&2){let e=g();m(2),V("ngModel",e.webhookEnabled)}}function Zx(n,t){if(n&1){let e=E();s(0,"div",13)(1,"div",34)(2,"mat-icon",35),h(3,"link"),c(),s(4,"h4"),h(5,"Webhook URL"),c()(),s(6,"div",36)(7,"p",37),h(8),c(),s(9,"button",38),_("click",function(){v(e);let o=g();return y(o.copyWebhookUrl())}),s(10,"mat-icon"),h(11,"content_copy"),c(),s(12,"span"),h(13,"Copy URL"),c()()(),s(14,"p",30),h(15,"Use this URL to trigger the prompt via HTTP POST"),c()()}if(n&2){let e=g();m(8),B(e.getWebhookUrl())}}function Jx(n,t){if(n&1&&(s(0,"div",14)(1,"mat-icon"),h(2,"error"),c(),s(3,"span"),h(4),c()()),n&2){let e=g();m(4),B(e.errorMessage)}}var Ta=class n{promptApi=d(hi);dialogRef=d(ii);configApi=d(Ki);snackBar=d(Zr);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=d(Wi);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1},error:t=>{console.error("[PROMPT_FORM] Error loading user config:",t),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(t){this.commands.length>1&&this.commands.splice(t,1)}trackByIndex(t){return t}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let t=this.getWebhookUrl();navigator.clipboard.writeText(t).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),h(1),c(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),c(),s(7,"input",3),j("ngModelChange",function(r){return L(i.name,r)||(i.name=r),r}),_("blur",function(){return i.normalizeName()}),c(),s(8,"mat-hint"),h(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),c()(),s(10,"mat-form-field",2)(11,"mat-label"),h(12,"Description"),c(),s(13,"textarea",4),j("ngModelChange",function(r){return L(i.description,r)||(i.description=r),r}),c(),s(14,"mat-hint"),h(15,"Explain the purpose of this prompt, helps for searchability"),c()(),s(16,"div",5)(17,"div",6)(18,"h3"),h(19,"Prompts"),c(),s(20,"button",7),_("click",function(){return i.addCommand()}),s(21,"mat-icon"),h(22,"add"),c()()(),s(23,"div",8),Oe(24,Yx,10,3,"div",9,Jn),c()(),w(26,Qx,26,6,"div",10),w(27,Xx,10,6,"div",11),w(28,Kx,7,1,"div",12),w(29,Zx,16,1,"div",13),w(30,Jx,5,1,"div",14),c()(),s(31,"mat-dialog-actions",15)(32,"button",16),_("click",function(){return i.cancel()}),h(33,"Cancel"),c(),s(34,"button",17),_("click",function(){return i.save()}),h(35),c()()),e&2&&(m(),B(i.isEditMode?"Edit Prompt":"Create Prompt"),m(6),V("ngModel",i.name),m(6),V("ngModel",i.description),m(11),Ae(i.commands),m(2),S(i.isEditMode?-1:26),m(),S(i.isEditMode?27:-1),m(),S(i.isAdmin?28:-1),m(),S(i.isEditMode&&i.webhookEnabled&&i.isAdmin?29:-1),m(),S(i.errorMessage?30:-1),m(2),x("disabled",i.isSaving),m(2),x("disabled",i.isSaving),m(),ae(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[De,Ke,ze,Fd,uo,Xe,go,Ue,lo,un,fn,gn,xt,It,yt,Zt,pi,$t,Ut,wn,ut,Qe,xe,Ko],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media (max-width: 768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};function ew(n,t){n&1&&(s(0,"div",12),h(1,"Loading prompts..."),c())}function tw(n,t){if(n&1&&(s(0,"div",13),h(1),c()),n&2){let e=g();m(),B(e.errorMessage)}}function iw(n,t){n&1&&(s(0,"div",14),h(1," No prompts found. Create your first prompt to get started. "),c())}function nw(n,t){n&1&&(s(0,"div",14),h(1," No prompts match your search. "),c())}function ow(n,t){if(n&1&&(s(0,"span",31),h(1),c()),n&2){let e=g().$implicit;x("title",Pn("Created by ",e.createdBy)),m(),ae(" \u{1F464} ",e.createdBy," ")}}function rw(n,t){if(n&1){let e=E();s(0,"button",32),_("click",function(){v(e);let o=g().$implicit,r=g(2);return y(r.toggleWebhook(o))}),h(1),c()}if(n&2){let e=g().$implicit;A("btn-webhook-enabled",e.webhookEnabled)("btn-webhook-disabled",!e.webhookEnabled),m(),ae(" ",e.webhookEnabled?"Disable Webhook":"Enable Webhook"," ")}}function aw(n,t){if(n&1){let e=E();s(0,"div",17)(1,"div",18)(2,"div",19)(3,"h3"),h(4),c(),s(5,"div",20)(6,"span",21),h(7),c(),Ge(8,ow,2,3,"span",22),c()(),s(9,"p",23),h(10),c(),s(11,"div",24)(12,"span",25),h(13),c(),s(14,"span",26),h(15),c()()(),s(16,"div",27)(17,"button",28),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.editPrompt(o))}),h(18,"Edit"),c(),Ge(19,rw,2,5,"button",29),s(20,"button",30),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.deletePrompt(o.id))}),h(21,"Delete"),c()()()}if(n&2){let e=t.$implicit,i=g(2);m(4),B(e.name),m(2),A("badge-local",e.source==="local")("badge-project",e.source==="project"),x("title",e.source==="local"?"Local prompt (~/.coday/)":"Project prompt (./prompts/)"),m(),ae(" ",e.source==="local"?"\u{1F464}":"\u{1F4E6}"," "),m(),x("ngIf",e.createdBy!==i.getCurrentUsername()),m(2),B(e.description),m(3),ae("ID: ",e.id),m(),A("enabled",e.webhookEnabled),m(),ae(" Webhook: ",e.webhookEnabled?"Enabled":"Disabled"," "),m(4),x("ngIf",i.isAdmin)}}function sw(n,t){if(n&1&&(s(0,"div",15),Ge(1,aw,22,14,"div",16),c()),n&2){let e=g();m(),x("ngForOf",e.filteredPrompts)}}var $l=class n{promptApi=d(hi);dialog=d(wi);configApi=d(Ki);prompts=[];filteredPrompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";isAdmin=!1;currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1,this.currentUsername=t.username??"",console.log("[PROMPT_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[PROMPT_MANAGER] Error loading user config:",t),this.isAdmin=!1}}),this.loadPrompts()}loadPrompts(){this.isLoading=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoading=!1}})}deletePrompt(t){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(t).subscribe({next:()=>{this.loadPrompts()},error:e=>{console.error("Error deleting prompt:",e);let i=e?.error?.error??e?.message??"Failed to delete prompt";alert(`Failed to delete prompt: ${i}`)}})}toggleWebhook(t){(t.webhookEnabled?this.promptApi.disableWebhook(t.id):this.promptApi.enableWebhook(t.id)).subscribe({next:()=>{this.loadPrompts()},error:i=>{console.error("Error toggling webhook:",i);let o=i?.error?.error??i?.message??"Failed to toggle webhook";alert(`Failed to toggle webhook: ${o}`)}})}createPrompt(){this.dialog.open(Ta,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}getCurrentUsername(){return this.currentUsername}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyPrompt(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.prompts.filter(i=>this.isMyPrompt(i)):[...this.prompts];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.description.toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredPrompts=e}onSearchChange(){this.applyFilter()}editPrompt(t){this.promptApi.getPrompt(t.id).subscribe({next:e=>{this.dialog.open(Ta,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(o=>{o&&this.loadPrompts()})},error:e=>{console.error("Error loading prompt details:",e);let i=e?.error?.error??e?.message??"Failed to load prompt details";alert(`Failed to load prompt details: ${i}`)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-prompt-manager"]],decls:23,vars:7,consts:[[1,"prompt-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, description, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","prompt-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"prompt-list"],["class","prompt-item",4,"ngFor","ngForOf"],[1,"prompt-item"],[1,"prompt-info"],[1,"prompt-header"],[1,"badges"],[1,"source-badge",3,"title"],["class","owner-badge",3,"title",4,"ngIf"],[1,"description"],[1,"meta"],["title","Prompt ID",1,"prompt-id"],[1,"webhook-status"],[1,"prompt-actions"],[1,"btn-primary",3,"click"],[3,"btn-webhook-enabled","btn-webhook-disabled","click",4,"ngIf"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"],[3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Prompts"),c(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),c(),s(8,"input",4),j("ngModelChange",function(r){return L(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),c(),s(9,"mat-icon",5),h(10,"search"),c()(),s(11,"mat-slide-toggle",6),j("ngModelChange",function(r){return L(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),_("change",function(){return i.applyFilter()}),h(12," Mine "),c(),s(13,"button",7),_("click",function(){return i.createPrompt()}),s(14,"mat-icon"),h(15,"add"),c(),s(16,"span"),h(17,"Create Prompt"),c()()()(),Ge(18,ew,2,0,"div",8)(19,tw,2,1,"div",9)(20,iw,2,0,"div",10)(21,nw,2,0,"div",10)(22,sw,2,1,"div",11),c()),e&2&&(m(8),V("ngModel",i.searchQuery),m(3),V("ngModel",i.showOnlyMine),m(7),x("ngIf",i.isLoading),m(),x("ngIf",i.errorMessage),m(),x("ngIf",!i.isLoading&&i.prompts.length===0),m(),x("ngIf",!i.isLoading&&i.prompts.length>0&&i.filteredPrompts.length===0),m(),x("ngIf",!i.isLoading&&i.filteredPrompts.length>0))},dependencies:[De,Ya,Qa,Ke,ze,Xe,Ue,Qe,xe,Zt,pi,$t,Ut,wo,ut,zl,xo],styles:[".prompt-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.prompt-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.prompt-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.prompt-info[_ngcontent-%COMP%]{flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem;flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400;white-space:nowrap}.prompt-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0 0 .5rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{display:flex;gap:1rem;font-size:.85rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .prompt-id[_ngcontent-%COMP%]{font-family:monospace;opacity:.7}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .webhook-status.enabled[_ngcontent-%COMP%]{color:var(--color-success);font-weight:600}.prompt-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.prompt-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var Er=class n{http=d(Ye);projectState=d(we);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createScheduler(t){return this.http.post(this.getBaseUrl(),t)}updateScheduler(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e)}deleteScheduler(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}enableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/enable`,{})}disableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/disable`,{})}runSchedulerNow(t){return this.http.post(`${this.getBaseUrl()}/${t}/run-now`,{})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var ql=(()=>{class n{_animationsDisabled=We();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(i,o){i&2&&A("mat-pseudo-checkbox-indeterminate",o.state==="indeterminate")("mat-pseudo-checkbox-checked",o.state==="checked")("mat-pseudo-checkbox-disabled",o.disabled)("mat-pseudo-checkbox-minimal",o.appearance==="minimal")("mat-pseudo-checkbox-full",o.appearance==="full")("_mat-animation-noopable",o._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(i,o){},styles:[`.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}
|
|
373
|
-
`],encapsulation:2,changeDetection:0})}return n})();var
|
|
374
|
-
`],encapsulation:2,changeDetection:0})}return n})();function bf(n,t,e){if(e.length){let i=t.toArray(),o=e.toArray(),r=0;for(let a=0;a<n+1;a++)i[a].group&&i[a].group===o[r]&&r++;return r}return 0}function vf(n,t,e,i){return n<e?n:n+t>e+i?Math.max(0,n-i+t):e}var ko=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new D;constructor(t=!1,e,i=!0,o){this._multiple=t,this._emitChanges=i,this.compareWith=o,e&&e.length&&(t?e.forEach(r=>this._markSelected(r)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){this._verifyValueAssignment(t),t.forEach(i=>this._markSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...t){this._verifyValueAssignment(t),t.forEach(i=>this._unmarkSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...t){this._verifyValueAssignment(t);let e=this.selected,i=new Set(t.map(r=>this._getConcreteValue(r)));t.forEach(r=>this._markSelected(r)),e.filter(r=>!i.has(this._getConcreteValue(r,i))).forEach(r=>this._unmarkSelected(r));let o=this._hasQueuedChanges();return this._emitChangeEvent(),o}toggle(t){return this.isSelected(t)?this.deselect(t):this.select(t)}clear(t=!0){this._unmarkAll();let e=this._hasQueuedChanges();return t&&this._emitChangeEvent(),e}isSelected(t){return this._selection.has(this._getConcreteValue(t))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){t=this._getConcreteValue(t),this.isSelected(t)||(this._multiple||this._unmarkAll(),this.isSelected(t)||this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){t=this._getConcreteValue(t),this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){t.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(t,e){if(this.compareWith){e=e??this._selection;for(let i of e)if(this.compareWith(t,i))return i;return t}else return t}};var yf=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le]})}return n})();var dm=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[rs,le,yf,So]})}return n})();var gw=["trigger"],fw=["panel"],_w=[[["mat-select-trigger"]],"*"],bw=["mat-select-trigger","*"];function vw(n,t){if(n&1&&(s(0,"span",4),h(1),c()),n&2){let e=g();m(),B(e.placeholder)}}function yw(n,t){n&1&&he(0)}function Cw(n,t){if(n&1&&(s(0,"span",11),h(1),c()),n&2){let e=g(2);m(),B(e.triggerValue)}}function xw(n,t){if(n&1&&(s(0,"span",5),w(1,yw,1,0)(2,Cw,2,1,"span",11),c()),n&2){let e=g();m(),S(e.customTrigger?1:2)}}function ww(n,t){if(n&1){let e=E();s(0,"div",12,1),_("keydown",function(o){v(e);let r=g();return y(r._handleKeydown(o))}),he(2,1),c()}if(n&2){let e=g();rn(Pn("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),A("mat-select-panel-animations-enabled",!e._animationsDisabled),x("ngClass",e.panelClass),Y("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var pm=new ee("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let n=d(ge);return()=>Hi(n)}});function Cf(n){let t=d(ge);return()=>Hi(t)}var xf=new ee("MAT_SELECT_CONFIG"),wf={provide:pm,deps:[],useFactory:Cf},Sf=new ee("MatSelectTrigger"),Ql=class{source;value;constructor(t,e){this.source=t,this.value=e}},um=(()=>{class n{_viewportRuler=d(Bi);_changeDetectorRef=d(Re);_elementRef=d(K);_dir=d(Ct,{optional:!0});_idGenerator=d(Fe);_renderer=d(ot);_parentFormField=d(Ma,{optional:!0});ngControl=d(Gi,{self:!0,optional:!0});_liveAnnouncer=d(is);_defaultOptions=d(xf,{optional:!0});_animationsDisabled=We();_initialized=new D;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let i=this.options.toArray()[e];if(i){let o=this.panel.nativeElement,r=bf(e,this.options,this.optionGroups),a=i._getHostElement();e===0&&r===1?o.scrollTop=0:o.scrollTop=vf(a.offsetTop,a.offsetHeight,o.scrollTop,o.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new Ql(this,e)}_scrollStrategyFactory=d(pm);_panelOpen=!1;_compareWith=(e,i)=>e===i;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new D;_errorStateTracker;stateChanges=new D;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Te(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(or.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=Ro(()=>{let e=this.options;return e?e.changes.pipe(Vt(e),Ri(()=>Ii(...e.map(i=>i.onSelectionChange)))):this._initialized.pipe(Ri(()=>this.optionSelectionChanges))});openedChange=new H;_openedStream=this.openedChange.pipe(pe(e=>e),ve(()=>{}));_closedStream=this.openedChange.pipe(pe(e=>!e),ve(()=>{}));selectionChange=new H;valueChange=new H;constructor(){let e=d(Hl),i=d(ba,{optional:!0}),o=d(ya,{optional:!0}),r=d(new On("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new kr(e,this.ngControl,o,i,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=r==null?0:parseInt(r)||0,this.id=this.id}ngOnInit(){this._selectionModel=new ko(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(N(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(N(this._destroy)).subscribe(e=>{e.added.forEach(i=>i.select()),e.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(Vt(null),N(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),i=this.ngControl;if(e!==this._triggerAriaLabelledBy){let o=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?o.setAttribute("aria-labelledby",e):o.removeAttribute("aria-labelledby")}i&&(this._previousControl!==i.control&&(this._previousControl!==void 0&&i.disabled!==null&&i.disabled!==this.disabled&&(this.disabled=i.disabled),this._previousControl=i.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(Mt(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let i=`${this.id}-panel`;this._trackedModal&&xc(this._trackedModal,"aria-owns",i),xh(e,"aria-owns",i),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;xc(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{i(),clearTimeout(o),this._cleanupDetach=void 0};let e=this.panel.nativeElement,i=this._renderer.listen(e,"animationend",r=>{r.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),o=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let i=e.keyCode,o=i===40||i===38||i===37||i===39,r=i===13||i===32,a=this._keyManager;if(!a.isTyping()&&r&&!vt(e)||(this.multiple||e.altKey)&&o)e.preventDefault(),this.open();else if(!this.multiple){let l=this.selected;a.onKeydown(e);let p=this.selected;p&&l!==p&&this._liveAnnouncer.announce(p.viewValue,1e4)}}_handleOpenKeydown(e){let i=this._keyManager,o=e.keyCode,r=o===40||o===38,a=i.isTyping();if(r&&e.altKey)e.preventDefault(),this.close();else if(!a&&(o===13||o===32)&&i.activeItem&&!vt(e))e.preventDefault(),i.activeItem._selectViaInteraction();else if(!a&&this._multiple&&o===65&&e.ctrlKey){e.preventDefault();let l=this.options.some(p=>!p.disabled&&!p.selected);this.options.forEach(p=>{p.disabled||(l?p.select():p.deselect())})}else{let l=i.activeItemIndex;i.onKeydown(e),this._multiple&&r&&e.shiftKey&&i.activeItem&&i.activeItemIndex!==l&&i.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!vt(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(i=>this._selectOptionByValue(i)),this._sortValues();else{let i=this._selectOptionByValue(e);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let i=this.options.find(o=>{if(this._selectionModel.isSelected(o))return!1;try{return(o.value!=null||this.canSelectNullableOptions)&&this._compareWith(o.value,e)}catch{return!1}});return i&&this._selectionModel.select(i),i}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Yo?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Ch(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=Ii(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(N(e)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Ii(...this.options.map(i=>i._stateChanges)).pipe(N(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,i){let o=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(o!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),i&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),i&&this.focus())),o!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((i,o)=>this.sortComparator?this.sortComparator(i,o,e):e.indexOf(i)-e.indexOf(o)),this.stateChanges.next()}}_propagateChanges(e){let i;this.multiple?i=this.selected.map(o=>o.value):i=this.selected?this.selected.value:e,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let i=0;i<this.options.length;i++)if(!this.options.get(i).disabled){e=i;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,i=e?e+" ":"";return this.ariaLabelledby?i+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-select"]],contentQueries:function(i,o,r){if(i&1&&(Tt(r,Sf,5),Tt(r,So,5),Tt(r,cm,5)),i&2){let a;W(a=U())&&(o.customTrigger=a.first),W(a=U())&&(o.options=a),W(a=U())&&(o.optionGroups=a)}},viewQuery:function(i,o){if(i&1&&(ne(gw,5),ne(fw,5),ne(Vs,5)),i&2){let r;W(r=U())&&(o.trigger=r.first),W(r=U())&&(o.panel=r.first),W(r=U())&&(o._overlayDir=r.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(i,o){i&1&&_("keydown",function(a){return o._handleKeydown(a)})("focus",function(){return o._onFocus()})("blur",function(){return o._onBlur()}),i&2&&(Y("id",o.id)("tabindex",o.disabled?-1:o.tabIndex)("aria-controls",o.panelOpen?o.id+"-panel":null)("aria-expanded",o.panelOpen)("aria-label",o.ariaLabel||null)("aria-required",o.required.toString())("aria-disabled",o.disabled.toString())("aria-invalid",o.errorState)("aria-activedescendant",o._getAriaActiveDescendant()),A("mat-mdc-select-disabled",o.disabled)("mat-mdc-select-invalid",o.errorState)("mat-mdc-select-required",o.required)("mat-mdc-select-empty",o.empty)("mat-mdc-select-multiple",o.multiple)("mat-select-open",o.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",J],disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:_i(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",J],placeholder:"placeholder",required:[2,"required","required",J],multiple:[2,"multiple","multiple",J],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",J],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",_i],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",J]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[fe([{provide:ka,useExisting:n},{provide:lm,useExisting:n}]),Le],ngContentSelectors:bw,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(i,o){if(i&1){let r=E();He(_w),s(0,"div",2,0),_("click",function(){return v(r),y(o.open())}),s(3,"div",3),w(4,vw,2,1,"span",4)(5,xw,3,1,"span",5),c(),s(6,"div",6)(7,"div",7),on(),s(8,"svg",8),F(9,"path",9),c()()()(),Ge(10,ww,3,10,"ng-template",10),_("detach",function(){return v(r),y(o.close())})("backdropClick",function(){return v(r),y(o.close())})("overlayKeydown",function(l){return v(r),y(o._handleOverlayKeydown(l))})}if(i&2){let r=ti(1);m(3),Y("id",o._valueId),m(),S(o.empty?4:5),m(6),x("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",o._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",o._scrollStrategy)("cdkConnectedOverlayOrigin",o._preferredOverlayOrigin||r)("cdkConnectedOverlayPositions",o._positions)("cdkConnectedOverlayWidth",o._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[Yo,Vs,An],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
375
|
-
`],encapsulation:2,changeDetection:0})}return n})();var Pa=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[wf],imports:[xi,dm,le,zi,ut,dm,le]})}return n})();var kw=["input"],Mw=["label"],Ew=["*"],Tw=new ee("mat-checkbox-default-options",{providedIn:"root",factory:Mf});function Mf(){return{color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1}}var Ft=(function(n){return n[n.Init=0]="Init",n[n.Checked=1]="Checked",n[n.Unchecked=2]="Unchecked",n[n.Indeterminate=3]="Indeterminate",n})(Ft||{}),gm=class{source;checked},kf=Mf(),fm=(()=>{class n{_elementRef=d(K);_changeDetectorRef=d(Re);_ngZone=d(me);_animationsDisabled=We();_options=d(Tw,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let i=new gm;return i.source=this,i.checked=e,i}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return`${this.id||this._uniqueId}-input`}required;labelPosition="after";name=null;change=new H;indeterminateChange=new H;value;disableRipple;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=Ft.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){d(Lt).load(Rn);let e=d(new On("tabindex"),{optional:!0});this._options=this._options||kf,this.color=this._options.color||kf.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=d(Fe).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??!1}ngOnChanges(e){e.required&&this._validatorChangeFn()}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate)}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck())}_checked=!1;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}_disabled=!1;get indeterminate(){return this._indeterminate()}set indeterminate(e){let i=e!=this._indeterminate();this._indeterminate.set(e),i&&(e?this._transitionCheckState(Ft.Indeterminate):this._transitionCheckState(this.checked?Ft.Checked:Ft.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=Te(!1);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(e){this.checked=!!e}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorChangeFn=e}_transitionCheckState(e){let i=this._currentCheckState,o=this._getAnimationTargetElement();if(!(i===e||!o)&&(this._currentAnimationClass&&o.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){o.classList.add(this._currentAnimationClass);let r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{o.classList.remove(r)},1e3)})}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked)}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(!1),this.indeterminateChange.emit(!1)}),this._checked=!this._checked,this._transitionCheckState(this._checked?Ft.Checked:Ft.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&e==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate)}_onInteractionEvent(e){e.stopPropagation()}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}_getAnimationClassForCheckStateTransition(e,i){if(this._animationsDisabled)return"";switch(e){case Ft.Init:if(i===Ft.Checked)return this._animationClasses.uncheckedToChecked;if(i==Ft.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case Ft.Unchecked:return i===Ft.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case Ft.Checked:return i===Ft.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case Ft.Indeterminate:return i===Ft.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){let i=this._inputElement;i&&(i.nativeElement.indeterminate=e)}_onInputClick(){this._handleInputClick()}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus()}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation()}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-checkbox"]],viewQuery:function(i,o){if(i&1&&(ne(kw,5),ne(Mw,5)),i&2){let r;W(r=U())&&(o._inputElement=r.first),W(r=U())&&(o._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(i,o){i&2&&(ei("id",o.id),Y("tabindex",null)("aria-label",null)("aria-labelledby",null),rn(o.color?"mat-"+o.color:"mat-accent"),A("_mat-animation-noopable",o._animationsDisabled)("mdc-checkbox--disabled",o.disabled)("mat-mdc-checkbox-disabled",o.disabled)("mat-mdc-checkbox-checked",o.checked)("mat-mdc-checkbox-disabled-interactive",o.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",J],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",J],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:_i(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",J],checked:[2,"checked","checked",J],disabled:[2,"disabled","disabled",J],indeterminate:[2,"indeterminate","indeterminate",J]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[fe([{provide:Kt,useExisting:at(()=>n),multi:!0},{provide:Ti,useExisting:n,multi:!0}]),Le],ngContentSelectors:Ew,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],[1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],[1,"mdc-checkbox__ripple"],[1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24","aria-hidden","true",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(i,o){if(i&1){let r=E();He(),s(0,"div",3),_("click",function(l){return v(r),y(o._preventBubblingFromLabel(l))}),s(1,"div",4,0)(3,"div",5),_("click",function(){return v(r),y(o._onTouchTargetClick())}),c(),s(4,"input",6,1),_("blur",function(){return v(r),y(o._onBlur())})("click",function(){return v(r),y(o._onInputClick())})("change",function(l){return v(r),y(o._onInteractionEvent(l))}),c(),F(6,"div",7),s(7,"div",8),on(),s(8,"svg",9),F(9,"path",10),c(),Ua(),F(10,"div",11),c(),F(11,"div",12),c(),s(12,"label",13,2),he(14),c()()}if(i&2){let r=ti(2);x("labelPosition",o.labelPosition),m(4),A("mdc-checkbox--selected",o.checked),x("checked",o.checked)("indeterminate",o.indeterminate)("disabled",o.disabled&&!o.disabledInteractive)("id",o.inputId)("required",o.required)("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex),Y("aria-label",o.ariaLabel||null)("aria-labelledby",o.ariaLabelledby)("aria-describedby",o.ariaDescribedby)("aria-checked",o.indeterminate?"mixed":null)("aria-controls",o.ariaControls)("aria-disabled",o.disabled&&o.disabledInteractive?!0:null)("aria-expanded",o.ariaExpanded)("aria-owns",o.ariaOwns)("name",o.name)("value",o.value),m(7),x("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),m(),x("for",o.inputId)}},dependencies:[In,Ll],styles:[`.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom;padding:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);margin:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox:hover>.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:hover>.mat-mdc-checkbox-ripple>.mat-ripple-element{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control+.mdc-checkbox__ripple{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;width:var(--mat-checkbox-state-layer-size, 40px);height:var(--mat-checkbox-state-layer-size, 40px);top:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);right:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox--disabled{cursor:default;pointer-events:none}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:rgba(0,0,0,0);pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1);-webkit-print-color-adjust:exact;color-adjust:exact;border-color:var(--mat-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));top:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2)}.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}@media(forced-colors: active){.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:checked)~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-hover-icon-color, var(--mat-sys-on-surface));background-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary))}.mdc-checkbox__native-control:focus:focus:not(:checked)~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mdc-checkbox__native-control:focus:focus:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.6, 1);color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:GrayText}}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);border-color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:GrayText}}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark{transition:opacity 180ms cubic-bezier(0, 0, 0.2, 1),transform 180ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mat-mdc-checkbox{display:inline-block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-touch-target,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__native-control,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__ripple,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-ripple::before,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__mixedmark{transition:none !important;animation:none !important}.mat-mdc-checkbox label{cursor:pointer}.mat-mdc-checkbox .mat-internal-form-field{color:var(--mat-checkbox-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-checkbox-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-checkbox-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-checkbox-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-checkbox-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-checkbox-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive{pointer-events:auto}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive input{cursor:default}.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{cursor:default;color:var(--mat-checkbox-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{color:GrayText}}.mat-mdc-checkbox label:empty{display:none}.mat-mdc-checkbox .mdc-checkbox__ripple{opacity:0}.mat-mdc-checkbox .mat-mdc-checkbox-ripple,.mdc-checkbox__ripple{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-checkbox .mat-mdc-checkbox-ripple:not(:empty),.mdc-checkbox__ripple:not(:empty){transform:translateZ(0)}.mat-mdc-checkbox-ripple .mat-ripple-element{opacity:.1}.mat-mdc-checkbox-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-checkbox-touch-target-size, 48px);width:var(--mat-checkbox-touch-target-size, 48px);transform:translate(-50%, -50%);display:var(--mat-checkbox-touch-target-display, block)}.mat-mdc-checkbox .mat-mdc-checkbox-ripple::before{border-radius:50%}.mdc-checkbox__native-control:focus~.mat-focus-indicator::before{content:""}
|
|
376
|
-
`],encapsulation:2,changeDetection:0})}return n})(),Ef=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[fm,le,le]})}return n})();var Ow=["button"],Aw=["*"];function Dw(n,t){if(n&1&&(s(0,"div",2),F(1,"mat-pseudo-checkbox",6),c()),n&2){let e=g();m(),x("disabled",e.disabled)}}var Tf=new ee("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:Iw});function Iw(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var Pf=new ee("MatButtonToggleGroup"),Rw={provide:Kt,useExisting:at(()=>_m),multi:!0},Xl=class{source;value;constructor(t,e){this.source=t,this.value=e}},_m=(()=>{class n{_changeDetector=d(Re);_dir=d(Ct,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck()}_name=d(Fe).getId("mat-button-toggle-group-");vertical;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(i=>i.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value)}valueChange=new H;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new H;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let e=d(Tf,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this.hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new ko(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex()}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_keydown(e){if(this.multiple||this.disabled||vt(e))return;let o=e.target.id,r=this._buttonToggles.toArray().findIndex(l=>l.buttonId===o),a=null;switch(e.keyCode){case 32:case 13:a=this._buttonToggles.get(r)||null;break;case 38:a=this._getNextButton(r,-1);break;case 37:a=this._getNextButton(r,this.dir==="ltr"?-1:1);break;case 40:a=this._getNextButton(r,1);break;case 39:a=this._getNextButton(r,this.dir==="ltr"?1:-1);break;default:return}a&&(e.preventDefault(),a._onButtonClick(),a.focus())}_emitChangeEvent(e){let i=new Xl(e,this.value);this._rawValue=i.value,this._controlValueAccessorChangeFn(i.value),this.change.emit(i)}_syncButtonToggle(e,i,o=!1,r=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?i?this._selectionModel.select(e):this._selectionModel.deselect(e):r=!0,r?Promise.resolve().then(()=>this._updateModelValue(e,o)):this._updateModelValue(e,o)}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(i=>e.value!=null&&i===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let i=this._buttonToggles.get(e);if(!i.disabled){i.tabIndex=0;break}}}_getNextButton(e,i){let o=this._buttonToggles;for(let r=1;r<=o.length;r++){let a=(e+i*r+o.length)%o.length,l=o.get(a);if(l&&!l.disabled)return l}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let i=this._buttonToggles.toArray();if(this.multiple&&e?(Array.isArray(e),this._clearSelection(),e.forEach(o=>this._selectValue(o,i))):(this._clearSelection(),this._selectValue(e,i)),!this.multiple&&i.every(o=>o.tabIndex===-1)){for(let o of i)if(!o.disabled){o.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,i){for(let o of i)if(o.value===e){o.checked=!0,this._selectionModel.select(o),this.multiple||(o.tabIndex=0);break}}_updateModelValue(e,i){i&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,o,r){if(i&1&&Tt(r,Kl,5),i&2){let a;W(a=U())&&(o._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(i,o){i&1&&_("keydown",function(a){return o._keydown(a)}),i&2&&(Y("role",o.multiple?"group":"radiogroup")("aria-disabled",o.disabled),A("mat-button-toggle-vertical",o.vertical)("mat-button-toggle-group-appearance-standard",o.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",J],value:"value",multiple:[2,"multiple","multiple",J],disabled:[2,"disabled","disabled",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",J],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",J]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[fe([Rw,{provide:Pf,useExisting:n}])]})}return n})(),Kl=(()=>{class n{_changeDetectorRef=d(Re);_elementRef=d(K);_focusMonitor=d(Vi);_idGenerator=d(Fe);_animationDisabled=We();_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e)}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new H;constructor(){d(Lt).load(Rn);let e=d(Pf,{optional:!0}),i=d(new On("tabindex"),{optional:!0})||"",o=d(Tf,{optional:!0});this._tabIndex=Te(parseInt(i)||0),this.buttonToggleGroup=e,this.appearance=o&&o.appearance?o.appearance:"standard",this.disabledInteractive=o?.disabledInteractive??!1}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=!0:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,!1,!1,!0)}focus(e){this._buttonElement.nativeElement.focus(e)}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?!0:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let i=this.buttonToggleGroup._buttonToggles.find(o=>o.tabIndex===0);i&&(i.tabIndex=-1),this.tabIndex=0}this.change.emit(new Xl(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-button-toggle"]],viewQuery:function(i,o){if(i&1&&ne(Ow,5),i&2){let r;W(r=U())&&(o._buttonElement=r.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(i,o){i&1&&_("focus",function(){return o.focus()}),i&2&&(Y("aria-label",null)("aria-labelledby",null)("id",o.id)("name",null),A("mat-button-toggle-standalone",!o.buttonToggleGroup)("mat-button-toggle-checked",o.checked)("mat-button-toggle-disabled",o.disabled)("mat-button-toggle-disabled-interactive",o.disabledInteractive)("mat-button-toggle-appearance-standard",o.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",J],appearance:"appearance",checked:[2,"checked","checked",J],disabled:[2,"disabled","disabled",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:Aw,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(i,o){if(i&1){let r=E();He(),s(0,"button",1,0),_("click",function(){return v(r),y(o._onButtonClick())}),w(2,Dw,2,1,"div",2),s(3,"span",3),he(4),c()(),F(5,"span",4)(6,"span",5)}if(i&2){let r=ti(1);x("id",o.buttonId)("disabled",o.disabled&&!o.disabledInteractive||null),Y("role",o.isSingleSelector()?"radio":"button")("tabindex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("aria-pressed",o.isSingleSelector()?null:o.checked)("aria-checked",o.isSingleSelector()?o.checked:null)("name",o._getButtonName())("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledby)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),m(2),S(o.buttonToggleGroup&&(!o.buttonToggleGroup.multiple&&!o.buttonToggleGroup.hideSingleSelectionIndicator||o.buttonToggleGroup.multiple&&!o.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),m(4),x("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)}},dependencies:[In,ql],styles:[`.mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);border-radius:var(--mat-button-toggle-legacy-shape);transform:translateZ(0)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-button-toggle-legacy-text-color);font-family:var(--mat-button-toggle-legacy-label-text-font);font-size:var(--mat-button-toggle-legacy-label-text-size);line-height:var(--mat-button-toggle-legacy-label-text-line-height);font-weight:var(--mat-button-toggle-legacy-label-text-weight);letter-spacing:var(--mat-button-toggle-legacy-label-text-tracking);--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-legacy-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-legacy-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-button-toggle-legacy-selected-state-text-color);background-color:var(--mat-button-toggle-legacy-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-button-toggle-legacy-disabled-state-text-color);background-color:var(--mat-button-toggle-legacy-disabled-state-background-color);--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-legacy-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-button-toggle-legacy-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-button-toggle-background-color, transparent);font-family:var(--mat-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-button-toggle-legacy-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-button-toggle-legacy-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius: var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}
|
|
377
|
-
`],encapsulation:2,changeDetection:0})}return n})(),Of=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le,rs,Kl,le]})}return n})();var Nw=(n,t)=>t.id,Vw=(n,t)=>t.value;function Lw(n,t){if(n&1&&(s(0,"mat-option",5),h(1),c()),n&2){let e=t.$implicit;x("value",e.id),m(),ae(" ",e.name," ")}}function jw(n,t){if(n&1){let e=E();s(0,"mat-checkbox",35),_("change",function(){let o=v(e).$implicit,r=g();return y(r.toggleDayOfWeek(o.value))}),h(1),c()}if(n&2){let e=t.$implicit,i=g();x("checked",i.isDaySelected(e.value)),m(),ae(" ",e.label," ")}}function zw(n,t){if(n&1){let e=E();s(0,"mat-form-field",2)(1,"mat-label"),h(2,"Number of Occurrences"),c(),s(3,"input",10),j("ngModelChange",function(o){v(e);let r=g();return L(r.endOccurrences,o)||(r.endOccurrences=o),y(o)}),c()()}if(n&2){let e=g();m(3),V("ngModel",e.endOccurrences)}}function Bw(n,t){if(n&1){let e=E();s(0,"mat-form-field",2)(1,"mat-label"),h(2,"End Date"),c(),s(3,"input",36),j("ngModelChange",function(o){v(e);let r=g();return L(r.endTimestamp,o)||(r.endTimestamp=o),y(o)}),c()()}if(n&2){let e=g();m(3),V("ngModel",e.endTimestamp)}}function Hw(n,t){if(n&1){let e=E();s(0,"div")(1,"mat-form-field",2)(2,"mat-label"),h(3,"Parameter Value"),c(),s(4,"input",37),j("ngModelChange",function(o){v(e);let r=g();return L(r.simpleParameter,o)||(r.simpleParameter=o),y(o)}),c(),s(5,"mat-hint"),h(6),c()()()}if(n&2){let e=g();m(4),V("ngModel",e.simpleParameter),m(2),ae("Simple value for ","{{PARAMETERS}}"," placeholder or appended to first command")}}function Ww(n,t){if(n&1){let e=E();s(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),h(3,"Key"),c(),s(4,"input",42),j("ngModelChange",function(o){let r=v(e).$implicit;return L(r.key,o)||(r.key=o),y(o)}),c()(),s(5,"mat-form-field",43)(6,"mat-label"),h(7,"Value"),c(),s(8,"input",44),j("ngModelChange",function(o){let r=v(e).$implicit;return L(r.value,o)||(r.value=o),y(o)}),c()(),s(9,"button",45),_("click",function(){let o=v(e).$index,r=g(3);return y(r.removeParameter(o))}),s(10,"mat-icon"),h(11,"delete"),c()()()}if(n&2){let e=t.$implicit;m(4),V("ngModel",e.key),m(4),V("ngModel",e.value)}}function Uw(n,t){if(n&1&&(s(0,"div",39),Oe(1,Ww,12,2,"div",40,Jn),c()),n&2){let e=g(2);m(),Ae(e.parameters)}}function $w(n,t){if(n&1){let e=E();s(0,"div")(1,"div",26)(2,"button",38),_("click",function(){v(e);let o=g();return y(o.addParameter())}),s(3,"mat-icon"),h(4,"add"),c()()(),w(5,Uw,3,0,"div",39),s(6,"p",19),h(7),c()()}if(n&2){let e=g();m(5),S(e.parameters.length>0?5:-1),m(2),ae("Key-value pairs for ","{{key}}"," placeholders in prompt commands")}}function qw(n,t){if(n&1&&(s(0,"div",31)(1,"mat-icon"),h(2,"error"),c(),s(3,"span"),h(4),c()()),n&2){let e=g();m(4),B(e.errorMessage)}}var Oa=class n{schedulerApi=d(Er);promptApi=d(hi);dialogRef=d(ii);availablePrompts=[];isLoadingPrompts=!1;name="";promptId="";enabled=!0;startTimestamp="";intervalValue=1;intervalUnit="h";daysOfWeek=[];endConditionType="none";endOccurrences=10;endTimestamp="";parameterMode="simple";simpleParameter="";parameters=[];isSaving=!1;errorMessage="";isEditMode=!1;schedulerId="";data=d(Wi);daysOfWeekOptions=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}];constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){if(this.loadPrompts(),this.isEditMode||(this.startTimestamp=this.formatDateForInput(new Date)),this.isEditMode&&this.data.scheduler){if(this.schedulerId=this.data.scheduler.id,this.name=this.data.scheduler.name,this.promptId=this.data.scheduler.promptId,this.enabled=this.data.scheduler.enabled,this.data.scheduler.schedule.startTimestamp){let e=new Date(this.data.scheduler.schedule.startTimestamp);this.startTimestamp=this.formatDateForInput(e)}let t=this.data.scheduler.schedule.interval.match(/^(\d+)(min|h|d|M)$/);t&&t[1]&&t[2]&&(this.intervalValue=parseInt(t[1],10),this.intervalUnit=t[2]),this.daysOfWeek=this.data.scheduler.schedule.daysOfWeek||[],this.data.scheduler.schedule.endCondition&&(this.endConditionType=this.data.scheduler.schedule.endCondition.type,this.endConditionType==="occurrences"?this.endOccurrences=this.data.scheduler.schedule.endCondition.value:this.endConditionType==="endTimestamp"&&(this.endTimestamp=this.data.scheduler.schedule.endCondition.value)),this.data.scheduler.parameters&&(typeof this.data.scheduler.parameters=="object"&&Object.keys(this.data.scheduler.parameters).length===1&&"PARAMETERS"in this.data.scheduler.parameters?(this.parameterMode="simple",this.simpleParameter=String(this.data.scheduler.parameters.PARAMETERS)):(this.parameterMode="structured",this.parameters=Object.entries(this.data.scheduler.parameters).map(([e,i])=>({key:e,value:String(i)}))))}}loadPrompts(){this.isLoadingPrompts=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.availablePrompts=t,this.isLoadingPrompts=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoadingPrompts=!1}})}toggleDayOfWeek(t){let e=this.daysOfWeek.indexOf(t);e>-1?this.daysOfWeek.splice(e,1):this.daysOfWeek.push(t),this.daysOfWeek.sort()}isDaySelected(t){return this.daysOfWeek.includes(t)}addParameter(){this.parameters.push({key:"",value:""})}removeParameter(t){this.parameters.splice(t,1)}trackByIndex(t){return t}formatDateForInput(t){let e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");return`${e}-${i}-${o}T${r}:${a}`}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!this.promptId)return this.errorMessage="Prompt is required",!1;if(this.intervalValue<1)return this.errorMessage="Interval must be at least 1",!1;switch(this.intervalUnit){case"min":if(this.intervalValue>59)return this.errorMessage="Minutes interval must be between 1 and 59 (use hours for longer)",!1;break;case"h":if(this.intervalValue>24)return this.errorMessage="Hours interval must be between 1 and 24 (use days for longer)",!1;break;case"d":if(this.intervalValue>31)return this.errorMessage="Days interval must be between 1 and 31 (use months for longer)",!1;break;case"M":if(this.intervalValue>12)return this.errorMessage="Months interval must be between 1 and 12",!1;break}return this.endConditionType==="occurrences"&&this.endOccurrences<1?(this.errorMessage="Occurrences must be at least 1",!1):this.endConditionType==="endTimestamp"&&!this.endTimestamp?(this.errorMessage="End date is required",!1):!0}buildSchedule(){let e={startTimestamp:(this.startTimestamp?new Date(this.startTimestamp):new Date).toISOString(),interval:`${this.intervalValue}${this.intervalUnit}`};return this.daysOfWeek.length>0&&(e.daysOfWeek=[...this.daysOfWeek]),this.endConditionType==="occurrences"?e.endCondition={type:"occurrences",value:this.endOccurrences}:this.endConditionType==="endTimestamp"&&(e.endCondition={type:"endTimestamp",value:this.endTimestamp}),e}buildParameters(){if(this.parameterMode==="simple")return this.simpleParameter.trim()?{PARAMETERS:this.simpleParameter.trim()}:void 0;let t=this.parameters.filter(i=>i.key.trim());if(t.length===0)return;let e={};return t.forEach(i=>{e[i.key]=i.value}),e}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildSchedule(),e=this.buildParameters();this.isSaving=!0,this.isEditMode&&this.schedulerId?this.schedulerApi.updateScheduler(this.schedulerId,{name:this.name.trim(),enabled:this.enabled,promptId:this.promptId,schedule:t,parameters:e}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update scheduler",this.isSaving=!1}}):this.schedulerApi.createScheduler({name:this.name.trim(),promptId:this.promptId,schedule:t,parameters:e,enabled:this.enabled}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create scheduler",this.isSaving=!1}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-scheduler-form"]],decls:89,vars:17,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","My Scheduler","required","",3,"ngModelChange","ngModel"],["required","",3,"ngModelChange","ngModel"],[3,"value"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel"],[1,"interval-section"],[1,"interval-fields"],["appearance","outline",1,"interval-value"],["matInput","","type","number","min","1","required","",3,"ngModelChange","ngModel"],["appearance","outline",1,"interval-unit"],["value","min"],["value","h"],["value","d"],["value","M"],[1,"days-section"],[1,"days-checkboxes"],[3,"checked"],[1,"hint"],[1,"end-condition-section"],[3,"ngModelChange","ngModel"],["value","none"],["value","occurrences"],["value","endTimestamp"],[1,"parameters-section"],[1,"section-header"],[1,"mode-toggle",3,"ngModelChange","ngModel"],["value","simple"],["value","structured"],[1,"enabled-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"change","checked"],["matInput","","type","datetime-local","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g., 1234 or staging",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add parameter",3,"click"],[1,"parameters-list"],[1,"parameter-item"],["appearance","outline",1,"param-key"],["matInput","","placeholder","parameterName",3,"ngModelChange","ngModel"],["appearance","outline",1,"param-value"],["matInput","","placeholder","value",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove parameter",1,"remove-btn",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),h(1),c(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),c(),s(7,"input",3),j("ngModelChange",function(r){return L(i.name,r)||(i.name=r),r}),c(),s(8,"mat-hint"),h(9,"A descriptive name for this scheduler"),c()(),s(10,"mat-form-field",2)(11,"mat-label"),h(12,"Prompt"),c(),s(13,"mat-select",4),j("ngModelChange",function(r){return L(i.promptId,r)||(i.promptId=r),r}),Oe(14,Lw,2,2,"mat-option",5,Nw),c(),s(16,"mat-hint"),h(17,"Select the prompt to execute"),c()(),s(18,"mat-form-field",2)(19,"mat-label"),h(20,"Start Date & Time"),c(),s(21,"input",6),j("ngModelChange",function(r){return L(i.startTimestamp,r)||(i.startTimestamp=r),r}),c(),s(22,"mat-hint"),h(23,"When to start the scheduler (leave empty for now)"),c()(),s(24,"div",7)(25,"h3"),h(26,"Schedule Interval"),c(),s(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),h(30,"Every"),c(),s(31,"input",10),j("ngModelChange",function(r){return L(i.intervalValue,r)||(i.intervalValue=r),r}),c()(),s(32,"mat-form-field",11)(33,"mat-label"),h(34,"Unit"),c(),s(35,"mat-select",4),j("ngModelChange",function(r){return L(i.intervalUnit,r)||(i.intervalUnit=r),r}),s(36,"mat-option",12),h(37,"Minutes (1-59)"),c(),s(38,"mat-option",13),h(39,"Hours (1-24)"),c(),s(40,"mat-option",14),h(41,"Days (1-31)"),c(),s(42,"mat-option",15),h(43,"Months (1-12)"),c()()()()(),s(44,"div",16)(45,"h3"),h(46,"Days of Week (Optional)"),c(),s(47,"div",17),Oe(48,jw,2,2,"mat-checkbox",18,Vw),c(),s(50,"p",19),h(51,"Leave empty to run every day"),c()(),s(52,"div",20)(53,"h3"),h(54,"End Condition (Optional)"),c(),s(55,"mat-form-field",2)(56,"mat-label"),h(57,"End Type"),c(),s(58,"mat-select",21),j("ngModelChange",function(r){return L(i.endConditionType,r)||(i.endConditionType=r),r}),s(59,"mat-option",22),h(60,"Never (run indefinitely)"),c(),s(61,"mat-option",23),h(62,"After X occurrences"),c(),s(63,"mat-option",24),h(64,"Until specific date"),c()()(),w(65,zw,4,1,"mat-form-field",2),w(66,Bw,4,1,"mat-form-field",2),c(),s(67,"div",25)(68,"div",26)(69,"h3"),h(70,"Parameters (Optional)"),c(),s(71,"mat-button-toggle-group",27),j("ngModelChange",function(r){return L(i.parameterMode,r)||(i.parameterMode=r),r}),s(72,"mat-button-toggle",28),h(73,"Simple"),c(),s(74,"mat-button-toggle",29),h(75,"Structured"),c()()(),w(76,Hw,7,2,"div"),w(77,$w,8,2,"div"),c(),s(78,"div",30)(79,"mat-checkbox",21),j("ngModelChange",function(r){return L(i.enabled,r)||(i.enabled=r),r}),h(80,"Enabled"),c(),s(81,"p",19),h(82,"Scheduler will only run if enabled"),c()(),w(83,qw,5,1,"div",31),c()(),s(84,"mat-dialog-actions",32)(85,"button",33),_("click",function(){return i.cancel()}),h(86,"Cancel"),c(),s(87,"button",34),_("click",function(){return i.save()}),h(88),c()()),e&2&&(m(),B(i.isEditMode?"Edit Scheduler":"Create Scheduler"),m(6),V("ngModel",i.name),m(6),V("ngModel",i.promptId),m(),Ae(i.availablePrompts),m(7),V("ngModel",i.startTimestamp),m(10),V("ngModel",i.intervalValue),m(4),V("ngModel",i.intervalUnit),m(13),Ae(i.daysOfWeekOptions),m(10),V("ngModel",i.endConditionType),m(7),S(i.endConditionType==="occurrences"?65:-1),m(),S(i.endConditionType==="endTimestamp"?66:-1),m(5),V("ngModel",i.parameterMode),m(5),S(i.parameterMode==="simple"?76:-1),m(),S(i.parameterMode==="structured"?77:-1),m(2),V("ngModel",i.enabled),m(4),S(i.errorMessage?83:-1),m(2),x("disabled",i.isSaving),m(2),x("disabled",i.isSaving),m(),ae(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[De,Ke,ze,va,Xe,go,Ca,Ue,lo,un,fn,gn,xt,It,yt,Zt,pi,$t,Ut,wn,ut,Qe,xe,Pa,um,So,Ef,fm,Of,_m,Kl],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:600px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.interval-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%]{display:flex;gap:1rem}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%], .interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.days-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:.5rem}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{min-width:120px}.days-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.end-condition-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] .mode-toggle[_ngcontent-%COMP%]{height:32px}.parameters-section[_ngcontent-%COMP%] .parameters-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-key[_ngcontent-%COMP%]{flex:1}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-value[_ngcontent-%COMP%]{flex:2}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.parameters-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.enabled-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.enabled-section[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem}.enabled-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};function Gw(n,t){n&1&&(s(0,"div",12),h(1,"Loading schedulers..."),c())}function Yw(n,t){if(n&1&&(s(0,"div",13),h(1),c()),n&2){let e=g();m(),B(e.errorMessage)}}function Qw(n,t){n&1&&(s(0,"div",14),h(1," No schedulers found. Create your first scheduler to automate prompt execution. "),c())}function Xw(n,t){n&1&&(s(0,"div",14),h(1," No schedulers match your search. "),c())}function Kw(n,t){if(n&1&&(s(0,"span",31),h(1),c()),n&2){let e=g().$implicit;x("title",Pn("Created by ",e.createdBy)),m(),ae(" \u{1F464} ",e.createdBy," ")}}function Zw(n,t){if(n&1&&(s(0,"div",22)(1,"span",23),h(2,"Last Run:"),c(),s(3,"span",24),h(4),to(5,"date"),c()()),n&2){let e=g().$implicit;m(4),B(Vr(5,1,e.lastRun,"short"))}}function Jw(n,t){if(n&1){let e=E();s(0,"div",17)(1,"div",18)(2,"h3"),h(3),s(4,"span",19),h(5),c(),Ge(6,Kw,2,3,"span",20),c(),s(7,"div",21)(8,"div",22)(9,"span",23),h(10,"Prompt:"),c(),s(11,"span",24),h(12),c()(),s(13,"div",22)(14,"span",23),h(15,"Schedule:"),c(),s(16,"span",24),h(17),c()(),s(18,"div",22)(19,"span",23),h(20,"Next Run:"),c(),s(21,"span",24),h(22),c()(),Ge(23,Zw,6,4,"div",25),c()(),s(24,"div",26)(25,"button",27),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.editScheduler(o))}),h(26,"Edit"),c(),s(27,"button",28),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.toggleEnabled(o))}),h(28),c(),s(29,"button",29),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.runNow(o.id))}),h(30,"Run Now"),c(),s(31,"button",30),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.deleteScheduler(o.id))}),h(32,"Delete"),c()()()}if(n&2){let e=t.$implicit,i=g(2);m(3),ae(" ",e.name," "),m(),A("enabled",e.enabled),m(),ae(" ",e.enabled?"Enabled":"Disabled"," "),m(),x("ngIf",e.createdBy!==i.getCurrentUsername()),m(6),B(i.getPromptName(e.promptId)),m(5),B(i.formatInterval(e.schedule.interval)),m(5),B(i.formatNextRun(e.nextRun)),m(),x("ngIf",e.lastRun),m(4),A("btn-enabled",e.enabled)("btn-disabled",!e.enabled),m(),ae(" ",e.enabled?"Disable":"Enable"," ")}}function eS(n,t){if(n&1&&(s(0,"div",15),Ge(1,Jw,33,14,"div",16),c()),n&2){let e=g();m(),x("ngForOf",e.filteredSchedulers)}}var Zl=class n{schedulerApi=d(Er);promptApi=d(hi);configApi=d(Ki);dialog=d(wi);schedulers=[];filteredSchedulers=[];prompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.currentUsername=t.username??"",console.log("[SCHEDULER_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[SCHEDULER_MANAGER] Error loading user config:",t)}}),this.loadPrompts(),this.loadSchedulers()}loadPrompts(){this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t},error:t=>{console.error("Error loading prompts:",t)}})}loadSchedulers(){this.isLoading=!0,this.schedulerApi.listSchedulers().subscribe({next:t=>{this.schedulers=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading schedulers:",t),this.errorMessage="Failed to load schedulers",this.isLoading=!1}})}deleteScheduler(t){confirm("Are you sure you want to delete this scheduler?")&&this.schedulerApi.deleteScheduler(t).subscribe({next:()=>{this.loadSchedulers()},error:e=>{console.error("Error deleting scheduler:",e);let i=e?.error?.error??e?.message??"Failed to delete scheduler";alert(`Failed to delete scheduler: ${i}`)}})}toggleEnabled(t){(t.enabled?this.schedulerApi.disableScheduler(t.id):this.schedulerApi.enableScheduler(t.id)).subscribe({next:()=>{this.loadSchedulers()},error:i=>{console.error("Error toggling scheduler:",i);let o=i?.error?.error??i?.message??"Failed to toggle scheduler";alert(`Failed to toggle scheduler: ${o}`)}})}runNow(t){this.schedulerApi.runSchedulerNow(t).subscribe({next:e=>{alert(`Scheduler executed successfully! Thread ID: ${e.threadId}`),this.loadSchedulers()},error:e=>{console.error("Error running scheduler:",e);let i=e?.error?.error??e?.message??"Failed to run scheduler";alert(`Failed to run scheduler: ${i}`)}})}formatNextRun(t){return t?new Date(t).toLocaleString():"Expired or completed"}getCurrentUsername(){return this.currentUsername}getPromptName(t){let e=this.prompts.find(i=>i.id===t);return e?e.name:t}formatInterval(t){let e=RegExp(/^(\d+)(min|h|d|M)$/).exec(t);if(!e)return t;let[,i,o]=e;if(!i||!o)return t;let a={min:"minute",h:"hour",d:"day",M:"month"}[o]??o;return`Every ${i} ${a}${parseInt(i,10)>1?"s":""}`}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyScheduler(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.schedulers.filter(i=>this.isMyScheduler(i)):[...this.schedulers];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.promptId.toLowerCase().includes(t)||this.getPromptName(i.promptId).toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredSchedulers=e}onSearchChange(){this.applyFilter()}createScheduler(){this.dialog.open(Oa,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadSchedulers()})}editScheduler(t){this.schedulerApi.getScheduler(t.id).subscribe({next:e=>{this.dialog.open(Oa,{width:"700px",maxHeight:"90vh",data:{mode:"edit",scheduler:e}}).afterClosed().subscribe(o=>{o&&this.loadSchedulers()})},error:e=>{console.error("Error loading scheduler details:",e);let i=e?.error?.error??e?.message??"Failed to load scheduler details";alert(`Failed to load scheduler details: ${i}`)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-scheduler-manager"]],decls:23,vars:7,consts:[[1,"scheduler-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, prompt, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","scheduler-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"scheduler-list"],["class","scheduler-item",4,"ngFor","ngForOf"],[1,"scheduler-item"],[1,"scheduler-info"],[1,"status-badge"],["class","owner-badge",3,"title",4,"ngIf"],[1,"details"],[1,"detail-row"],[1,"label"],[1,"value"],["class","detail-row",4,"ngIf"],[1,"scheduler-actions"],[1,"btn-primary",3,"click"],[3,"click"],[1,"btn-accent",3,"click"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Schedulers"),c(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),c(),s(8,"input",4),j("ngModelChange",function(r){return L(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),c(),s(9,"mat-icon",5),h(10,"search"),c()(),s(11,"mat-slide-toggle",6),j("ngModelChange",function(r){return L(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),_("change",function(){return i.applyFilter()}),h(12," Mine "),c(),s(13,"button",7),_("click",function(){return i.createScheduler()}),s(14,"mat-icon"),h(15,"add"),c(),s(16,"span"),h(17,"Create Scheduler"),c()()()(),Ge(18,Gw,2,0,"div",8)(19,Yw,2,1,"div",9)(20,Qw,2,0,"div",10)(21,Xw,2,0,"div",10)(22,eS,2,1,"div",11),c()),e&2&&(m(8),V("ngModel",i.searchQuery),m(3),V("ngModel",i.showOnlyMine),m(7),x("ngIf",i.isLoading),m(),x("ngIf",i.errorMessage),m(),x("ngIf",!i.isLoading&&i.schedulers.length===0),m(),x("ngIf",!i.isLoading&&i.schedulers.length>0&&i.filteredSchedulers.length===0),m(),x("ngIf",!i.isLoading&&i.filteredSchedulers.length>0))},dependencies:[De,Ya,Qa,Ke,ze,Xe,Ue,Qe,xe,Zt,pi,$t,Ut,wo,ut,zl,xo,mh],styles:[".scheduler-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.scheduler-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.scheduler-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.scheduler-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.scheduler-info[_ngcontent-%COMP%]{flex:1}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem;display:flex;align-items:center;gap:.5rem}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400}.scheduler-info[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%]{padding:.25rem .5rem;font-size:.75rem;border-radius:4px;background:var(--color-text-secondary);color:#fff}.scheduler-info[_ngcontent-%COMP%] .status-badge.enabled[_ngcontent-%COMP%]{background:var(--color-success)}.scheduler-info[_ngcontent-%COMP%] .details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;font-size:.9rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:600;min-width:100px;color:var(--color-text-secondary)}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{color:var(--color-text)}.scheduler-actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduler-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;white-space:nowrap}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]{background:#4caf50;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var Or=class n{http=d(Ye);projectState=d(we);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new oi(i=>{let o=new FileReader;o.onload=()=>{let r=o.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(i)},o.onerror=()=>i.error(o.error),o.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function tS(n,t){n&1&&(s(0,"p",15),h(1,"No integrations defined \u2014 agent will have access to all tools."),c())}function iS(n,t){if(n&1){let e=E();s(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),h(3,"Integration"),c(),s(4,"input",23),j("ngModelChange",function(o){let r=v(e).$implicit;return L(r.integration,o)||(r.integration=o),y(o)}),c()(),s(5,"mat-form-field",24)(6,"mat-label"),h(7,"Tools (comma-separated)"),c(),s(8,"input",25),j("ngModelChange",function(o){let r=v(e).$implicit;return L(r.tools,o)||(r.tools=o),y(o)}),c()(),s(9,"button",26),_("click",function(){let o=v(e).$index,r=g();return y(r.removeIntegrationRow(o))}),s(10,"mat-icon"),h(11,"delete"),c()()()}if(n&2){let e=t.$implicit;m(4),V("ngModel",e.integration),m(4),V("ngModel",e.tools)}}function nS(n,t){if(n&1&&(s(0,"p",30),h(1),c()),n&2){let e=g(2);m(),B(e.docUploadError)}}function oS(n,t){n&1&&(s(0,"p",15),h(1,"No mandatory documents defined."),c())}function rS(n,t){if(n&1&&F(0,"option",35),n&2){let e=t.$implicit;x("value","documents/"+e)}}function aS(n,t){if(n&1){let e=E();s(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),h(3,"Document path"),c(),s(4,"input",33),j("ngModelChange",function(o){let r=v(e).$index,a=g(2);return L(a.mandatoryDocs[r],o)||(a.mandatoryDocs[r]=o),y(o)}),c(),s(5,"datalist",34),Oe(6,rS,1,1,"option",35,th),c()(),s(8,"button",26),_("click",function(){let o=v(e).$index,r=g(2);return y(r.removeDocRow(o))}),s(9,"mat-icon"),h(10,"delete"),c()()()}if(n&2){let e=t.$index,i=g(2);m(4),V("ngModel",i.mandatoryDocs[e]),Y("list","docs-list-"+e),m(),x("id","docs-list-"+e),m(),Ae(i.availableDocuments)}}function sS(n,t){if(n&1){let e=E();s(0,"div",6)(1,"span"),h(2,"Mandatory Documents"),c(),s(3,"button",27),_("click",function(){v(e);let o=g();return y(o.addDocRow())}),s(4,"mat-icon"),h(5,"add"),c()(),s(6,"label",28)(7,"mat-icon"),h(8,"upload_file"),c(),s(9,"input",29),_("change",function(o){v(e);let r=g();return y(r.onDocFileSelected(o))}),c()()(),w(10,nS,2,1,"p",30),w(11,oS,2,0,"p",15),Oe(12,aS,11,3,"div",31,Jn)}if(n&2){let e=g();m(6),A("uploading",e.isUploadingDoc),m(3),x("disabled",e.isUploadingDoc),m(),S(e.docUploadError?10:-1),m(),S(e.mandatoryDocs.length===0?11:-1),m(),Ae(e.mandatoryDocs)}}function lS(n,t){n&1&&(s(0,"p",15),h(1,"\u{1F4A1} Documents can be added after the agent is created."),c())}function cS(n,t){if(n&1){let e=E();s(0,"div",6),h(1,"Save to"),c(),s(2,"div",36)(3,"label",37)(4,"input",38),j("ngModelChange",function(o){v(e);let r=g();return L(r.location,o)||(r.location=o),y(o)}),c(),s(5,"div",39)(6,"div",40)(7,"span",41),h(8,"\u{1F464}"),c(),s(9,"span",42),h(10,"Project config"),c()(),s(11,"p",43),h(12),c()()(),s(13,"label",37)(14,"input",44),j("ngModelChange",function(o){v(e);let r=g();return L(r.location,o)||(r.location=o),y(o)}),c(),s(15,"div",39)(16,"div",40)(17,"span",41),h(18,"\u{1F4E6}"),c(),s(19,"span",42),h(20,"Colocated"),c()(),s(21,"p",43),h(22,"Next to coday.yaml in ./agents/ (committable)"),c()()()(),s(23,"p",15),h(24,"Storage location is permanent and cannot be changed after creation."),c()}if(n&2){let e=g();m(3),A("selected",e.location==="project"),m(),V("ngModel",e.location),m(8),Tn("~/.coday/projects/","{","name","}","/agents/ (not committed)"),m(),A("selected",e.location==="colocated"),m(),V("ngModel",e.location)}}function dS(n,t){if(n&1&&(s(0,"div",17)(1,"span",6),h(2,"Storage Location"),c(),s(3,"span",45),h(4),c(),s(5,"p",15),h(6,"Cannot be changed after creation."),c()()),n&2){let e=g();m(3),A("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),m(),ae(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function mS(n,t){if(n&1&&(s(0,"div",18)(1,"mat-icon"),h(2,"error"),c(),s(3,"span"),h(4),c()()),n&2){let e=g();m(4),B(e.errorMessage)}}var Aa=class n{agentCrudApi=d(Or);agentApi=d(dr);dialogRef=d(ii);data=d(Wi);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=!1;docUploadError="";location="project";isSaving=!1;errorMessage="";isEditMode=!1;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,i])=>({integration:e,tools:i?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments()}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]})}addDocRow(){this.mandatoryDocs.push("")}removeDocRow(t){this.mandatoryDocs.splice(t,1)}onDocFileSelected(t){let e=t.target,i=e.files?.[0];i&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,i).subscribe({next:o=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(o.relativePath),this.loadAvailableDocuments(),e.value=""},error:o=>{this.isUploadingDoc=!1,this.docUploadError=o?.error?.error??o?.message??"Upload failed",e.value=""}}))}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""})}removeIntegrationRow(t){this.integrationRows.splice(t,1)}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",!1;if(!this.description.trim())return this.errorMessage="Description is required",!1;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",!1;return!0}buildDefinition(){let t=this.mandatoryDocs.map(i=>i.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(i=>i.integration.trim()).map(i=>[i.integration.trim(),i.tools.split(",").map(o=>o.trim()).filter(Boolean)])):void 0;return{name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=!0,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=!1,this.agentApi.clearAllCache(),this.dialogRef.close(!0)},error:i=>{this.isSaving=!1,this.errorMessage=i?.error?.error||i?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,i){e&1&&(s(0,"h2",0),h(1),c(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),c(),s(7,"input",3),j("ngModelChange",function(r){return L(i.name,r)||(i.name=r),r}),c(),s(8,"mat-hint"),h(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),c()(),s(10,"mat-form-field",2)(11,"mat-label"),h(12,"Description"),c(),s(13,"textarea",4),j("ngModelChange",function(r){return L(i.description,r)||(i.description=r),r}),c()(),s(14,"mat-form-field",2)(15,"mat-label"),h(16,"Instructions"),c(),s(17,"textarea",5),j("ngModelChange",function(r){return L(i.instructions,r)||(i.instructions=r),r}),c(),s(18,"mat-hint"),h(19,"System prompt / instructions sent to the AI model"),c()(),s(20,"div",6),h(21,"AI Configuration"),c(),s(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),h(25,"AI Provider"),c(),s(26,"input",9),j("ngModelChange",function(r){return L(i.aiProvider,r)||(i.aiProvider=r),r}),c()(),s(27,"mat-form-field",8)(28,"mat-label"),h(29,"Model Name"),c(),s(30,"input",10),j("ngModelChange",function(r){return L(i.modelName,r)||(i.modelName=r),r}),c()()(),s(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),h(34,"Temperature"),c(),s(35,"input",11),j("ngModelChange",function(r){return L(i.temperature,r)||(i.temperature=r),r}),c(),s(36,"mat-hint"),h(37,"Leave empty for model default"),c()(),s(38,"mat-form-field",8)(39,"mat-label"),h(40,"Max Output Tokens"),c(),s(41,"input",12),j("ngModelChange",function(r){return L(i.maxOutputTokens,r)||(i.maxOutputTokens=r),r}),c(),s(42,"mat-hint"),h(43,"Leave empty for model default"),c()()(),s(44,"mat-form-field",2)(45,"mat-label"),h(46,"OpenAI Assistant ID"),c(),s(47,"input",13),j("ngModelChange",function(r){return L(i.openaiAssistantId,r)||(i.openaiAssistantId=r),r}),c(),s(48,"mat-hint"),h(49,"If set, forces aiProvider to openai"),c()(),s(50,"div",6)(51,"span"),h(52,"Integrations"),c(),s(53,"button",14),_("click",function(){return i.addIntegrationRow()}),s(54,"mat-icon"),h(55,"add"),c()()(),w(56,tS,2,0,"p",15),Oe(57,iS,12,2,"div",16,Jn),w(59,sS,14,5)(60,lS,2,0,"p",15),w(61,cS,25,8),w(62,dS,7,5,"div",17),w(63,mS,5,1,"div",18),c()(),s(64,"mat-dialog-actions",19)(65,"button",20),_("click",function(){return i.cancel()}),h(66,"Cancel"),c(),s(67,"button",21),_("click",function(){return i.save()}),h(68),c()()),e&2&&(m(),B(i.isEditMode?"Edit Agent":"Create Agent"),m(6),V("ngModel",i.name),x("readonly",i.isEditMode),m(6),V("ngModel",i.description),m(4),V("ngModel",i.instructions),m(9),V("ngModel",i.aiProvider),m(4),V("ngModel",i.modelName),m(5),V("ngModel",i.temperature),m(6),V("ngModel",i.maxOutputTokens),m(6),V("ngModel",i.openaiAssistantId),m(9),S(i.integrationRows.length===0?56:-1),m(),Ae(i.integrationRows),m(2),S(i.isEditMode?59:60),m(2),S(i.isEditMode?-1:61),m(),S(i.isEditMode?62:-1),m(),S(i.errorMessage?63:-1),m(2),x("disabled",i.isSaving),m(2),x("disabled",i.isSaving),m(),ae(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Ke,cl,dl,ze,va,uo,Xe,go,Ca,Wd,Ue,lo,un,fn,gn,xt,It,yt,Zt,pi,$t,Ut,wn,ut,Qe,xe,Pa,Ko],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media (max-width: 768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media (max-width: 768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};var hS=(n,t)=>t.name;function pS(n,t){n&1&&(s(0,"div",7),h(1,"Loading agents..."),c())}function uS(n,t){if(n&1&&(s(0,"div",8),h(1),c()),n&2){let e=g();m(),B(e.errorMessage)}}function gS(n,t){n&1&&(s(0,"div",9),h(1,"No file-based agents found. Create your first agent to get started."),c())}function fS(n,t){n&1&&(s(0,"div",9),h(1,"No agents match your search."),c())}function _S(n,t){if(n&1){let e=E();s(0,"div",11)(1,"div",12)(2,"div",13)(3,"h3"),h(4),c(),s(5,"span",14),h(6),c()(),s(7,"p",15),h(8),c()(),s(9,"div",16)(10,"button",17),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.editAgent(o))}),h(11,"Edit"),c(),s(12,"button",18),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.deleteAgent(o))}),h(13,"Delete"),c()()()}if(n&2){let e=t.$implicit;m(4),B(e.name),m(),A("badge-project",e.source==="project")("badge-colocated",e.source==="colocated"),x("title",e.source==="project"?"Project config (~/.coday/)":"Colocated (next to coday.yaml)"),m(),ae(" ",e.source==="project"?"\u{1F464}":"\u{1F4E6}"," "),m(2),B(e.description)}}function bS(n,t){if(n&1&&(s(0,"div",10),Oe(1,_S,14,8,"div",11,hS),c()),n&2){let e=g();m(),Ae(e.filteredAgents)}}var Jl=class n{agentCrudApi=d(Or);dialog=d(wi);agents=[];filteredAgents=[];searchQuery="";isLoading=!1;errorMessage="";ngOnInit(){this.loadAgents()}loadAgents(){this.isLoading=!0,this.errorMessage="",this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading agents:",t),this.errorMessage="Failed to load agents",this.isLoading=!1}})}applyFilter(){let t=this.searchQuery.toLowerCase().trim();this.filteredAgents=t?this.agents.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):[...this.agents]}onSearchChange(){this.applyFilter()}createAgent(){this.dialog.open(Aa,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents()})}editAgent(t){this.errorMessage="",this.agentCrudApi.getAgent(t.name).subscribe({next:e=>{this.dialog.open(Aa,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(o=>{o&&this.loadAgents()})},error:e=>{console.error("Error loading agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to load agent"}})}deleteAgent(t){confirm(`Are you sure you want to delete agent "${t.name}"?`)&&(this.errorMessage="",this.agentCrudApi.deleteAgent(t.name).subscribe({next:()=>this.loadAgents(),error:e=>{console.error("Error deleting agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to delete agent"}}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-agent-manager"]],decls:21,vars:6,consts:[[1,"agent-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name or description...",3,"ngModelChange","input","ngModel"],["matPrefix",""],[1,"btn-create",3,"click"],[1,"loading"],[1,"error"],[1,"empty"],[1,"agent-list"],[1,"agent-item"],[1,"agent-info"],[1,"agent-header"],[1,"source-badge",3,"title"],[1,"description"],[1,"agent-actions"],[1,"btn-primary",3,"click"],[1,"btn-danger",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Agents"),c(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),c(),s(8,"input",4),j("ngModelChange",function(r){return L(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),c(),s(9,"mat-icon",5),h(10,"search"),c()(),s(11,"button",6),_("click",function(){return i.createAgent()}),s(12,"mat-icon"),h(13,"add"),c(),s(14,"span"),h(15,"Create Agent"),c()()()(),w(16,pS,2,0,"div",7),w(17,uS,2,1,"div",8),w(18,gS,2,0,"div",9),w(19,fS,2,0,"div",9),w(20,bS,3,0,"div",10),c()),e&2&&(m(8),V("ngModel",i.searchQuery),m(8),S(i.isLoading?16:-1),m(),S(i.errorMessage?17:-1),m(),S(!i.isLoading&&i.agents.length===0?18:-1),m(),S(!i.isLoading&&i.agents.length>0&&i.filteredAgents.length===0?19:-1),m(),S(!i.isLoading&&i.filteredAgents.length>0?20:-1))},dependencies:[Ke,ze,Xe,Ue,Qe,xe,Zt,pi,$t,Ut,wo,ut],styles:[".agent-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.agent-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.agent-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.agent-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-info[_ngcontent-%COMP%]{flex:1}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.5rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.agent-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0;color:var(--color-text-secondary)}.agent-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.agent-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var vS=["threadSearchInput"],yS=["*"];function CS(n,t){n&1&&(s(0,"a",27),F(1,"img",28),c()),n&2&&(m(),Y("src","CODAY-Logo.png",No))}function xS(n,t){if(n&1){let e=E();s(0,"button",25),_("click",function(){v(e);let o=g();return y(o.toggle())}),s(1,"mat-icon"),h(2,"menu"),c()(),s(3,"button",26),_("click",function(){v(e);let o=g();return y(o.createNewThread())}),s(4,"mat-icon",10),h(5,"play_circle"),c()(),w(6,CS,2,1,"a",27)}if(n&2){let e=g();m(3),x("disabled",!e.selectedProjectName()),m(3),S(e.isOpen?-1:6)}}function wS(n,t){if(n&1){let e=E();s(0,"div",14)(1,"mat-icon",29),h(2,"search"),c(),s(3,"input",30,0),j("ngModelChange",function(o){v(e);let r=g();return L(r.threadSearchQuery,o)||(r.threadSearchQuery=o),y(o)}),_("input",function(){v(e);let o=g();return y(o.onThreadSearchInput())}),c(),s(5,"button",31),_("click",function(){v(e);let o=g();return y(o.closeThreadSearch())}),s(6,"mat-icon"),h(7,"close"),c()()()}if(n&2){let e=g();m(3),V("ngModel",e.threadSearchQuery)}}function SS(n,t){n&1&&(s(0,"mat-icon",18),h(1,"keyboard_arrow_up"),c())}function kS(n,t){n&1&&(s(0,"mat-icon",19),h(1,"forum"),c())}function MS(n,t){if(n&1){let e=E();s(0,"button",33),_("click",function(o){v(e);let r=g(2);return y(r.toggleThreadSearch(o))}),s(1,"mat-icon"),h(2,"search"),c()()}}function ES(n,t){if(n&1){let e=E();s(0,"a",17),_("click",function(o){return v(e),g().toggleSection("threads"),y(o.preventDefault())}),w(1,SS,2,0,"mat-icon",18)(2,kS,2,0,"mat-icon",19),s(3,"span",20),h(4,"Threads"),c(),w(5,MS,3,0,"button",32),c()}if(n&2){let e=g();A("active",e.expandedSections.threads),m(),S(e.expandedSections.threads?1:2),m(4),S(e.expandedSections.threads?5:-1)}}function TS(n,t){if(n&1){let e=E();s(0,"div",16)(1,"app-thread-selector",34),_("searchModeChange",function(o){v(e);let r=g();return y(r.onThreadSearchModeChange(o))}),c()()}if(n&2){let e=g();m(),x("searchMode",e.isThreadSearchActive)("searchQuery",e.threadSearchQuery)}}function PS(n,t){n&1&&(s(0,"mat-icon",18),h(1,"keyboard_arrow_up"),c())}function OS(n,t){n&1&&(s(0,"mat-icon",19),h(1,"tune"),c())}function AS(n,t){n&1&&(s(0,"div",21)(1,"div",35),F(2,"app-options-panel",36),c()())}function DS(n,t){if(n&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g(2).openProjectConfig(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"settings_applications"),c(),s(4,"span",20),h(5,"Project Configuration"),c()()()}}function IS(n,t){n&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"settings_applications"),c(),s(4,"span",20),h(5,"Project config (No project)"),c()()())}function RS(n,t){if(n&1&&w(0,DS,6,0,"div",13)(1,IS,6,0,"div",13),n&2){let e=g();S(e.selectedProjectName()?0:1)}}function FS(n,t){if(n&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g().openAgents(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"smart_toy"),c(),s(4,"span",20),h(5,"Agents"),c()()()}}function NS(n,t){n&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"smart_toy"),c(),s(4,"span",20),h(5,"Agents (No project)"),c()()())}function VS(n,t){if(n&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g().openPrompts(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"description"),c(),s(4,"span",20),h(5,"Prompts"),c()()()}}function LS(n,t){n&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"description"),c(),s(4,"span",20),h(5,"Prompts (No project)"),c()()())}function jS(n,t){if(n&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g().openSchedulers(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"schedule"),c(),s(4,"span",20),h(5,"Schedulers"),c()()()}}function zS(n,t){n&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"schedule"),c(),s(4,"span",20),h(5,"Schedulers (No project)"),c()()())}function BS(n,t){if(n&1){let e=E();s(0,"div",24)(1,"mat-icon",38),h(2,"warning"),c(),s(3,"span",39),h(4),c(),s(5,"button",40),_("click",function(){v(e);let o=g();return y(o.configErrorMessage="")}),s(6,"mat-icon"),h(7,"close"),c()()()}if(n&2){let e=g();m(4),B(e.configErrorMessage)}}var ec=class n{destroy$=new D;isOpen=!0;isAdmin=!1;configErrorMessage="";expandedSections={threads:!0,config:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=d(wi);configApi=d(Ki);projectStateService=d(we);projectApi=d(Zo);router=d(Dn);preferences=d(st);threadStateService=d(Rt);projects=jt(this.projectStateService.projectList$);selectedProject=jt(this.projectStateService.selectedProject$);selectedProjectName=jt(this.projectStateService.selectedProject$.pipe(ve(t=>t?.name)));isProjectVolatile=jt(this.projectStateService.selectedProject$.pipe(ve(t=>t?.config?.volatile||!1)));forcedProject=jt(this.projectStateService.forcedProject$);ngOnInit(){let t=this.preferences.getPreference("sidenavOpen",!0);this.isOpen=t??!0,console.log("[SIDENAV] Loaded sidenav state from preferences:",this.isOpen),this.configApi.getUserConfig().pipe(N(this.destroy$)).subscribe({next:e=>{this.isAdmin=e.groups?.includes("CODAY_ADMIN")??!1,console.log("[SIDENAV] User admin status:",this.isAdmin)},error:e=>{console.error("[SIDENAV] Error loading user config for roles:",e),this.isAdmin=!1}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}toggle(){this.isOpen=!this.isOpen,this.saveSidenavState()}close(){this.isOpen=!1,this.saveSidenavState()}saveSidenavState(){this.preferences.setPreference("sidenavOpen",this.isOpen),console.log("[SIDENAV] Saved sidenav state:",this.isOpen)}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(N(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(Ea,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(i=>{i&&this.saveUserConfig(i)})},error:t=>{console.error("[SIDENAV] Error loading user config:",t),this.configErrorMessage=t?.error?.error||"Failed to load user configuration"}})}saveUserConfig(t){this.configApi.updateUserConfig(t).pipe(N(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] User config saved successfully")},error:e=>{console.error("[SIDENAV] Error saving user config:",e),this.configErrorMessage=e?.error?.error||"Failed to save user configuration"}})}openProjectConfig(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected"),this.configErrorMessage="No project selected. Please select a project first.";return}this.configErrorMessage="",this.projectApi.getProjectConfig(t).pipe(N(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(Ea,{data:{configType:"project",projectName:t,initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(o=>{o&&this.saveProjectConfig(t,o)})},error:e=>{console.error("[SIDENAV] Error loading project config:",e),this.configErrorMessage=e?.error?.error||"Failed to load project configuration"}})}saveProjectConfig(t,e){this.projectApi.updateProjectConfig(t,e).pipe(N(this.destroy$)).subscribe({next:i=>{console.log("[SIDENAV] Project config saved successfully")},error:i=>{console.error("[SIDENAV] Error saving project config:",i),this.configErrorMessage=i?.error?.error||"Failed to save project configuration"}})}requireProjectSelection(t){return this.selectedProjectName()?!0:(console.error(`[SIDENAV] No project selected, cannot ${t}`),this.configErrorMessage="Please select a project first",!1)}openManagerDialog(t,e){console.log(`[SIDENAV] ${e}`),this.dialog.open(t,{width:"90vw",maxWidth:"1200px",height:"90vh",maxHeight:"900px"})}openAgents(){this.requireProjectSelection("open agents")&&this.openManagerDialog(Jl,"Opening agent manager dialog")}openPrompts(){this.requireProjectSelection("open prompts")&&this.openManagerDialog($l,"Opening prompt manager dialog")}openSchedulers(){this.requireProjectSelection("open schedulers")&&this.openManagerDialog(Zl,`Opening scheduler manager dialog for project: ${this.selectedProjectName()}`)}toggleSection(t){let e=this.expandedSections[t];Object.keys(this.expandedSections).forEach(i=>{this.expandedSections[i]=!1}),this.expandedSections[t]=!e}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 t=this.selectedProjectName();if(!t){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",t])}toggleThreadSearch(t){t.stopPropagation(),this.isThreadSearchActive=!0,this.threadSearchQuery="",console.log("[SIDENAV] Thread search active:",this.isThreadSearchActive),setTimeout(()=>{this.threadSearchInput?.nativeElement.focus()},0)}closeThreadSearch(){this.isThreadSearchActive=!1,this.threadSearchQuery="",console.log("[SIDENAV] Thread search closed")}onThreadSearchInput(){console.log("[SIDENAV] Search query:",this.threadSearchQuery)}onThreadSearchModeChange(t){t||this.closeThreadSearch()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-sidenav"]],viewQuery:function(e,i){if(e&1&&ne(vS,5),e&2){let o;W(o=U())&&(i.threadSearchInput=o.first)}},ngContentSelectors:yS,decls:50,vars:35,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"],[1,"search-header"],["role","button","tabindex","0",1,"section-toggle",3,"active"],[1,"section-content","threads"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content"],["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"],["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"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"sidenav-logo-btn"],["alt","Coday",1,"logo"],[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"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"sidenav-thread-selector",3,"searchModeChange","searchMode","searchQuery"],[1,"preference-item"],[1,"inline-panel"],["role","button","tabindex","-1","aria-disabled","true",1,"section-toggle","disabled"],[1,"error-icon"],[1,"error-text"],["mat-icon-button","","aria-label","Close error message",1,"error-close",3,"click"]],template:function(e,i){e&1&&(He(),w(0,xS,7,2),s(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),_("closed",function(){return i.close()}),s(3,"div",3)(4,"button",4),_("click",function(){return i.close()}),s(5,"mat-icon"),h(6,"chevron_left"),c()(),s(7,"img",5),_("click",function(r){return i.navigateToHome(),r.stopPropagation()})("keydown.enter",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()})("keydown.space",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()}),c(),s(8,"div",6)(9,"h2",7),h(10),c()()(),s(11,"div",8)(12,"a",9),_("click",function(r){return i.createNewThread(),r.preventDefault()}),s(13,"mat-icon",10),h(14,"play_circle"),c(),s(15,"span",11),h(16,"Start a new thread"),c()()(),s(17,"div",12)(18,"div",13),w(19,wS,8,1,"div",14)(20,ES,6,4,"a",15),w(21,TS,2,2,"div",16),c(),s(22,"div",13)(23,"a",17),_("click",function(r){return i.toggleSection("config"),r.preventDefault()}),w(24,PS,2,0,"mat-icon",18)(25,OS,2,0,"mat-icon",19),s(26,"span",20),h(27,"Preferences"),c()(),w(28,AS,3,0,"div",21),c(),s(29,"div",13)(30,"a",17),_("click",function(r){return i.openUserConfig(),r.preventDefault(),r.stopPropagation()}),s(31,"mat-icon",19),h(32,"settings"),c(),s(33,"span",20),h(34,"User Configuration"),c()()(),w(35,RS,2,1),w(36,FS,6,0,"div",13)(37,NS,6,0,"div",13),w(38,VS,6,0,"div",13)(39,LS,6,0,"div",13),w(40,jS,6,0,"div",13)(41,zS,6,0,"div",13),s(42,"div",13)(43,"a",22),F(44,"img",23),s(45,"span",20),h(46,"Contribute on GitHub"),c()()()()(),s(47,"mat-sidenav-content"),he(48),c()(),w(49,BS,8,1,"div",24)),e&2&&(S(i.isOpen?-1:0),m(),x("hasBackdrop",!1),m(),x("opened",i.isOpen)("disableClose",!0),m(5),A("sidenav-logo",!0)("clickable",!i.forcedProject())("disabled",i.forcedProject()),x("title",i.forcedProject()?"Project selection disabled":"Go to project selection"),Y("src","CODAY-Logo.png",No)("role",i.forcedProject()?null:"button")("tabindex",i.forcedProject()?null:"0"),m(3),B(i.selectedProjectName()),m(7),A("has-footer",!0)("is-admin",i.isAdmin),m(),A("expanded",i.expandedSections.threads),m(),S(i.isThreadSearchActive&&i.expandedSections.threads?19:20),m(2),S(i.expandedSections.threads?21:-1),m(),A("expanded",i.expandedSections.config),m(),A("active",i.expandedSections.config),m(),S(i.expandedSections.config?24:25),m(4),S(i.expandedSections.config?28:-1),m(7),S(i.isAdmin?35:-1),m(),S(i.selectedProjectName()?36:37),m(2),S(i.selectedProjectName()?38:39),m(2),S(i.selectedProjectName()?40:41),m(4),Y("src","CODAY-Logo.png",No),m(5),S(i.configErrorMessage?49:-1))},dependencies:[Ke,ze,Xe,Ue,Fl,em,Bg,Il,Qe,xe,xt,yt,qg,Gg,Sa,Ul],styles:['[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:310px;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!important}.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{width:100%;margin:0!important}[_nghost-%COMP%] .mat-drawer-backdrop{pointer-events:auto}[_nghost-%COMP%] .mat-drawer-content{pointer-events:auto!important;background:transparent!important;overflow:visible!important}.sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;left:1rem!important;z-index:1500!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{position:fixed!important;top:4.5rem!important;left:1rem!important;z-index:1500!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-new-thread-btn[_ngcontent-%COMP%]:disabled mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)!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:310px;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border-radius:0;overflow:hidden;display:flex;flex-direction:column}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.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%]{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:0;height:100%;max-height:calc(100vh - 122px)}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.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%]{flex:1;min-height:0;overflow:hidden}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;border-bottom:none;position:relative}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]:after{content:"";position:sticky;bottom:0;left:0;right:0;height:60px;background:linear-gradient(to bottom,transparent 0%,var(--glass-bg) 100%);pointer-events:none;opacity:1;transition:opacity .3s ease;z-index:10;flex-shrink:0}.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}@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:280px}.sidenav-toggle-btn[_ngcontent-%COMP%]{left:.75rem!important;top:.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 tc=class n{destroy$=new D;isSetup=!1;codayService=d(mi);preferencesService=d(st);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(N(this.destroy$),Fo(),pe(([t,e])=>t===!0&&e===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(N(this.destroy$),Fo(),pe(([t,e])=>t===!1&&e===!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 t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(700,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.08),e.start(t.currentTime),e.stop(t.currentTime+.08);let o=t.createOscillator(),r=t.createGain();o.connect(r),r.connect(t.destination);let a=t.currentTime+.11;o.frequency.setValueAtTime(950,a),r.gain.setValueAtTime(.1,a),r.gain.exponentialRampToValueAtTime(.01,a+.09),o.start(a),o.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(t){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",t)}}handleBrowserNotificationEnabled(){return ie(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(t){console.error("[AGENT-NOTIFICATION] Error requesting permission:",t),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 t=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(()=>t.close(),4e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let t=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(()=>t.close(),5e3),t.onclick=()=>{window.focus(),t.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(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var HS=["inputSection"];function WS(n,t){if(n&1&&F(0,"app-thread",2),n&2){let e=g();x("projectName",e.projectName)("threadId",e.threadId)}}function US(n,t){if(n&1){let e=E();s(0,"div",3),F(1,"app-welcome-message"),c(),s(2,"div",4,0)(4,"div",5)(5,"div",6)(6,"app-chat-textarea",7),_("messageSubmitted",function(o){v(e);let r=g();return y(r.onMessageSubmitted(o))})("voiceRecordingToggled",function(o){v(e);let r=g();return y(r.onVoiceToggled(o))})("heightChanged",function(o){v(e);let r=g();return y(r.onInputHeightChanged(o))}),c()()()()}if(n&2){let e=g();m(6),x("isDisabled",e.isSessionInitializing)("isSessionInitializing",e.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",e.isStartingFirstMessage)}}var Da=class n{destroy$=new D;inputSection;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=d(mi);titleService=d(xr);preferencesService=d(st);route=d(Ka);router=d(Dn);threadApiService=d(Un);agentNotificationService=d(tc);firstMessageState=d(wr);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(N(this.destroy$)).subscribe(t=>{let e=t.projectName,i=t.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:e,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=e,this.threadId=i,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(t){console.log("[MAIN-APP] First message submitted from welcome view:",t),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:e=>{console.log("[MAIN-APP] Thread created:",e.thread.id),this.firstMessageState.setPendingFirstMessage(t),this.router.navigate(["project",this.projectName,"thread",e.thread.id])},error:e=>{console.error("[MAIN-APP] Failed to create thread:",e),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(e.message||"Unknown error"))}})}onVoiceToggled(t){console.log("[VOICE] Recording in welcome view:",t)}onInputHeightChanged(t){console.log("[MAIN-APP] Input height changed:",t),this.inputSectionHeight=t}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",t),this.inputSectionHeight=t)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?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(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-main"]],viewQuery:function(e,i){if(e&1&&ne(HS,5),e&2){let o;W(o=U())&&(i.inputSection=o.first)}},decls:4,vars:1,consts:[["inputSection",""],[1,"app"],[3,"projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(e,i){e&1&&(s(0,"app-sidenav")(1,"div",1),w(2,WS,1,2,"app-thread",2)(3,US,7,5),c()()),e&2&&(m(2),S(i.threadId?2:3))},dependencies:[mr,Vl,tr,ec],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center}.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 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%}@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 1rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}.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:[kc("slideIn",[ls(":enter",[Fn({transform:"translateY(100%)",opacity:0}),ss("300ms ease-out",Fn({transform:"translateY(0)",opacity:1}))]),ls(":leave",[ss("200ms ease-in",Fn({transform:"translateY(100%)",opacity:0}))])])]}})};var ic=class n{route=d(Ka);ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),i=this.route.snapshot.queryParamMap.get("error"),o=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",i,"Opener:",!!window.opener),i){if(console.log("[OAuth Callback] OAuth error received:",i,o),!window.opener){alert(`OAuth error: ${i}${o?" - "+o:""}. Please close this window.`);return}try{window.opener.postMessage({error:i,state:e,errorDescription:o},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending error postMessage:",r),alert("OAuth error: Failed to communicate with parent window")}return}if(!t||!e){console.error("[OAuth Callback] Missing code or state");return}if(!window.opener){console.error("[OAuth Callback] No window.opener - popup may have been opened incorrectly"),alert("OAuth callback error: No parent window found. Please close this window and try again.");return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending postMessage:",r),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-oauth-callback"]],decls:2,vars:0,template:function(e,i){e&1&&(ri(0,"p"),h(1,"Authentication in progress..."),ai())},encapsulation:2})};var bm=n=>ie(null,null,function*(){let t=d(we),e=n.params.projectName;return e?t.getSelectedProjectId()===e?!0:(t.selectProject(e),(yield Bm(t.selectedProject$.pipe($m(o=>o?.name===e))))?.name===e):(console.log("[PROJECT GUARD] no project id in route"),!1)});var Af=n=>ie(null,null,function*(){let t=d(Rt),e=n.params.threadId;if(!e)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",e),console.log("[THREAD GUARD] Current selected thread:",t.getSelectedThreadId()),t.getSelectedThreadId()===e)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",e),t.selectThread(e);try{let i=yield zm(nn([t.isLoading$,t.selectedThread$]).pipe(ct(([r,a])=>console.log(`\u{1F43C} [${r?"loading":"loaded"}]`,a?.id)),pe(([r,a])=>!r&&!!a),Mt(1),ve(([r,a])=>a?.id))),o=i===e;return o?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",e,"loaded:",i),o}catch(i){return console.error("[THREAD GUARD] Error loading thread:",i),!1}});var Df=[{path:"",component:ul},{path:"oauth/callback",component:ic},{path:"project/:projectName",component:Da,canActivate:[bm]},{path:"project/:projectName/thread/:threadId",component:Da,canActivate:[bm,Af]},{path:"agentos",loadChildren:()=>import("./chunk-4Q2XO4DS.js").then(n=>n.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];var nc=class n{eventStream=d(Xi);messageApi=d(cr);pendingStates=new Map;popupCheckInterval=null;constructor(){this.eventStream.events$.pipe(pe(t=>t.type==="oauth_request")).subscribe(t=>this.handleOAuthRequest(t)),window.addEventListener("message",t=>this.handlePopupMessage(t))}startPopupMonitoring(t,e){this.popupCheckInterval&&clearInterval(this.popupCheckInterval),this.popupCheckInterval=setInterval(()=>{if(t.closed&&(console.log("[OAuth Service] Popup closed by user"),clearInterval(this.popupCheckInterval),this.popupCheckInterval=null,this.pendingStates.has(e))){console.warn("[OAuth Service] OAuth cancelled - popup closed without completing authentication");let i=this.pendingStates.get(e);if(this.pendingStates.delete(e),i){let o=new Qi({state:e,integrationName:i,error:"user_cancelled",errorDescription:"User closed the popup without completing authentication"});this.messageApi.sendMessage(o).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:r=>console.error("[OAuth Service] Failed to send cancellation:",r)})}}},500)}handleOAuthRequest(t){console.log("[OAuth Service] Received OAuthRequestEvent:",t.integrationName,t.state),this.pendingStates.set(t.state,t.integrationName),console.log("[OAuth Service] Pending states:",Array.from(this.pendingStates.keys()));let e=600,i=900,o=window.screenX+(window.outerWidth-e)/2,r=window.screenY+(window.outerHeight-i)/2,a=`width=${e},height=${i},left=${o},top=${r},popup=yes,resizable=yes,scrollbars=yes`,l=window.open(t.authUrl,"oauth_popup",a);console.log("[OAuth Service] Popup opened:",!!l),l&&(l.focus(),this.startPopupMonitoring(l,t.state))}handlePopupMessage(t){if(console.log("[OAuth Service] Received postMessage:",t.origin,t.data),t.origin!==window.location.origin){console.warn("[OAuth Service] Rejected message from different origin:",t.origin);return}let{code:e,state:i,error:o,errorDescription:r}=t.data??{};if(o){console.log("[OAuth Service] OAuth error received:",o,r);let p=this.pendingStates.get(i);if(p){this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let u=new Qi({state:i,integrationName:p,error:o,errorDescription:r});this.messageApi.sendMessage(u).subscribe({next:()=>console.log("[OAuth Service] Error callback sent to backend"),error:b=>console.error("[OAuth Service] Failed to send error callback:",b)})}return}if(!e||!i){console.warn("[OAuth Service] Message missing code or state:",t.data);return}console.log("[OAuth Service] Processing callback - code:",e,"state:",i);let a=this.pendingStates.get(i);if(!a){console.warn("[OAuth Service] Unknown state received:",i,"Pending states:",Array.from(this.pendingStates.keys()));return}console.log("[OAuth Service] Found integration:",a),this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let l=new Qi({code:e,state:i,integrationName:a});console.log("[OAuth Service] Sending callback to backend..."),this.messageApi.sendMessage(l).subscribe({next:()=>console.log("[OAuth Service] Callback sent to backend successfully"),error:p=>console.error("[OAuth Service] Failed to send callback:",p)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function $S(n){return()=>n.initializeDefaultProject()}function qS(n){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var If={providers:[Ym(),rh({eventCoalescing:!0}),fh(Df),uh(),Sp(),Gm(Ko),{provide:bc,useFactory:$S,deps:[we],multi:!0},{provide:bc,useFactory:qS,deps:[nc],multi:!0},kh({basePath:"/api/agentos"}),{provide:Ls,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var oc=class n{title="client";themeService=d(Sr);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-root"]],decls:1,vars:0,template:function(e,i){e&1&&F(0,"router-outlet")},dependencies:[_h,gh],encapsulation:2})};ph(oc,If).catch(n=>console.error(n));
|
|
361
|
+
`:"")+l}},{paragraphs:0,text:""}).text||t}renderStreamingText(){return ie(this,null,function*(){if(!this.streamingText){this.renderedStreamingText="";return}try{let t=yield this.markdownService.parse(this.streamingText);this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CHAT-HISTORY] Error rendering streaming text markdown:",t),this.renderedStreamingText=this.sanitizer.bypassSecurityTrustHtml(this.streamingText)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-chat-history"]],hostBindings:function(e,i){e&1&&_("scroll",function(){return i.onScroll()})},inputs:{messages:"messages",streamingText:"streamingText",isThinking:"isThinking"},outputs:{copyRequested:"copyRequested",stopRequested:"stopRequested"},features:[Le],decls:6,vars:3,consts:[[1,"chat-history"],[3,"message","canDelete"],[1,"streaming-message","message","assistant"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn"],[3,"copyRequested","deleteRequested","message","canDelete"],[1,"content","markdown-content",3,"innerHTML"],["mat-fab","","color","primary","title","Go to bottom",1,"go-to-bottom-btn",3,"click"],["fontSet","material-icons-outlined"]],template:function(e,i){e&1&&(s(0,"div",0),Oe(1,K0,1,2,"app-chat-message",1,X0),w(3,Z0,2,1,"div",2),w(4,J0,1,0,"app-thinking-loader"),w(5,ey,3,0,"button",3),c()),e&2&&(m(),Ae(i.messages),m(2),S(i.streamingText?3:-1),m(),S(i.isThinking?4:-1),m(),S(i.showGoToBottom?5:-1))},dependencies:[yl,xe,Cl,ss],styles:[".streaming-message.assistant[_ngcontent-%COMP%]{background:transparent;border:none;box-shadow:none;border-radius:0;margin-left:0;margin-right:auto;padding:.5rem 0;width:100%;max-width:none;min-width:0}.streaming-message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{color:var(--color-text);line-height:1.5}.go-to-bottom-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:120px!important;right:2rem!important;z-index:1000!important}@media (max-width: 768px){.go-to-bottom-btn[_ngcontent-%COMP%]{right:1rem!important;bottom:100px!important}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.chat-history[_ngcontent-%COMP%]{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important;position:static!important}.go-to-bottom-btn[_ngcontent-%COMP%]{display:none!important}}"]})};var wl=class n{http=d(Ye);projectState=d(we);threadState=d(Rt);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/files`}uploadFile(t){let e=this.projectState.getSelectedProjectIdOrThrow(),i=this.threadState.getSelectedThreadIdOrThrow();return new oi(o=>{let r=new FileReader;r.onload=()=>{let l=r.result.split(",")[1];this.http.post(`/api/projects/${e}/threads/${i}/upload`,{content:l,mimeType:t.type||"application/octet-stream",filename:t.name}).subscribe({next:p=>{o.next({success:p.success,filename:p.filename}),o.complete()},error:p=>o.error(p)})},r.onerror=()=>o.error(new Error("Failed to read file")),r.readAsDataURL(t)})}listFiles(){return this.http.get(this.getBaseUrl()).pipe(ve(t=>t.files))}downloadFile(t){let e=encodeURIComponent(t);return this.http.get(`${this.getBaseUrl()}/${e}`,{responseType:"blob"})}deleteFile(t){let e=encodeURIComponent(t);return this.http.delete(`${this.getBaseUrl()}/${e}`)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var ur=class n{fileApi=d(wl);eventStream=d(Xi);filesSignal=Te([]);isLoadingSignal=Te(!1);currentProjectSignal=Te(null);currentThreadSignal=Te(null);files=ft(()=>this.filesSignal());isLoading=ft(()=>this.isLoadingSignal());fileCount=ft(()=>this.filesSignal().length);constructor(){this.subscribeToFileEvents()}initializeForThread(t,e){this.currentProjectSignal.set(t),this.currentThreadSignal.set(e),this.refreshFileList()}clear(){this.filesSignal.set([]),this.currentProjectSignal.set(null),this.currentThreadSignal.set(null)}refreshFileList(){this.isLoadingSignal.set(!0),this.fileApi.listFiles().subscribe({next:t=>{let e=t.map(i=>Ie(q({},i),{lastModified:new Date(i.lastModified)})).sort((i,o)=>o.lastModified.getTime()-i.lastModified.getTime());this.filesSignal.set(e),this.isLoadingSignal.set(!1)},error:t=>{console.error("[FILE_EXCHANGE_STATE] Error loading files:",t),this.isLoadingSignal.set(!1)}})}uploadFile(t){return ie(this,null,function*(){return new Promise(e=>{this.fileApi.uploadFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Upload error:",i),e({success:!1,error:i.message||"Upload failed"})}})})})}downloadAllFiles(){let t=this.filesSignal();if(t.length===0){console.warn("[FILE_EXCHANGE_STATE] No files to download");return}t.forEach((e,i)=>{setTimeout(()=>{this.downloadFile(e.filename)},i*300)})}downloadFile(t){this.fileApi.downloadFile(t).subscribe({next:e=>{let i=window.URL.createObjectURL(e),o=document.createElement("a");o.href=i,o.download=t,o.click(),window.URL.revokeObjectURL(i)},error:e=>{console.error("[FILE_EXCHANGE_STATE] Download error:",e)}})}deleteFile(t){return ie(this,null,function*(){return new Promise(e=>{this.fileApi.deleteFile(t).subscribe({next:()=>{this.refreshFileList(),e({success:!0})},error:i=>{console.error("[FILE_EXCHANGE_STATE] Delete error:",i),e({success:!1,error:i.message||"Delete failed"})}})})})}subscribeToFileEvents(){this.eventStream.events$.pipe(ue(t=>t instanceof Wn),zs()).subscribe(t=>{this.handleFileEvent(t)})}handleFileEvent(t){let e=this.filesSignal();switch(t.operation){case"created":{let i=t.timestamp,o=t.timestamp.lastIndexOf("-");if(o>0){let a=t.timestamp.substring(o+1);a.length===5&&/^[a-z0-9]+$/.test(a)&&(i=t.timestamp.substring(0,o))}let r={filename:t.filename,size:t.size||0,lastModified:new Date(i)};this.filesSignal.set([r,...e]);break}case"updated":{let i=e.filter(p=>p.filename!==t.filename),o=e.find(p=>p.filename===t.filename),r=t.timestamp,a=t.timestamp.lastIndexOf("-");if(a>0){let p=t.timestamp.substring(a+1);p.length===5&&/^[a-z0-9]+$/.test(p)&&(r=t.timestamp.substring(0,a))}let l={filename:t.filename,size:t.size||o?.size||0,lastModified:new Date(r)};this.filesSignal.set([l,...i]);break}case"deleted":{let i=e.filter(o=>o.filename!==t.filename);this.filesSignal.set(i);break}}}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var ty=["determinateSpinner"];function iy(n,t){if(n&1&&(on(),s(0,"svg",11),F(1,"circle",12),c()),n&2){let e=g();Y("viewBox",e._viewBox()),m(),Fi("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),Y("r",e._circleRadius())}}var ny=new ee("mat-progress-spinner-default-options",{providedIn:"root",factory:oy});function oy(){return{diameter:ag}}var ag=100,ry=10,Sl=(()=>{class n{_elementRef=d(K);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=d(ny),i=Sh(),o=this._elementRef.nativeElement;this._noopAnimations=i==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=o.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&i==="reduced-motion"&&o.classList.add("mat-progress-spinner-reduced-motion"),e&&(e.color&&(this.color=this._defaultColor=e.color),e.diameter&&(this.diameter=e.diameter),e.strokeWidth&&(this.strokeWidth=e.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(e){this._value=Math.max(0,Math.min(100,e||0))}_value=0;get diameter(){return this._diameter}set diameter(e){this._diameter=e||0}_diameter=ag;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0}_strokeWidth;_circleRadius(){return(this.diameter-ry)/2}_viewBox(){let e=this._circleRadius()*2+this.strokeWidth;return`0 0 ${e} ${e}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(i,o){if(i&1&&ne(ty,5),i&2){let r;W(r=U())&&(o._determinateCircle=r.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(i,o){i&2&&(Y("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",o.mode==="determinate"?o.value:null)("mode",o.mode),rn("mat-"+o.color),Fi("width",o.diameter,"px")("height",o.diameter,"px")("--mat-progress-spinner-size",o.diameter+"px")("--mat-progress-spinner-active-indicator-width",o.diameter+"px"),A("_mat-animation-noopable",o._noopAnimations)("mdc-circular-progress--indeterminate",o.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",_i],diameter:[2,"diameter","diameter",_i],strokeWidth:[2,"strokeWidth","strokeWidth",_i]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(i,o){if(i&1&&(Ge(0,iy,2,8,"ng-template",null,0,Ya),s(2,"div",2,1),on(),s(4,"svg",3),F(5,"circle",4),c()(),$a(),s(6,"div",5)(7,"div",6)(8,"div",7),Ga(9,8),c(),s(10,"div",9),Ga(11,8),c(),s(12,"div",10),Ga(13,8),c()()()),i&2){let r=ti(1);m(4),Y("viewBox",o._viewBox()),m(),Fi("stroke-dasharray",o._strokeCircumference(),"px")("stroke-dashoffset",o._strokeDashOffset(),"px")("stroke-width",o._circleStrokeWidth(),"%"),Y("r",o._circleRadius()),m(4),x("ngTemplateOutlet",r),m(2),x("ngTemplateOutlet",r),m(2),x("ngTemplateOutlet",r)}},dependencies:[Ka],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
|
|
362
|
+
`],encapsulation:2,changeDetection:0})}return n})();var kl=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le]})}return n})();function ay(n,t){if(n&1&&F(0,"div",1),n&2){let e=g();x("innerHTML",e.renderedContent,Jt)}}function sy(n,t){if(n&1&&F(0,"iframe",2),n&2){let e=g();x("srcdoc",e.content,Jt)}}function ly(n,t){if(n&1&&(s(0,"pre",3),h(1),c()),n&2){let e=g();m(),B(e.content)}}var Ml=class n{content="";format="text";renderedContent="";sanitizer=d(Ni);markdownService=d(qi);ngOnChanges(t){(t.content||t.format)&&this.renderContent()}renderContent(){this.format==="markdown"?this.renderMarkdown():this.format==="json"&&this.formatJson()}renderMarkdown(){return ie(this,null,function*(){try{let t=yield this.markdownService.parse(this.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}catch(t){console.error("[CONTENT_RENDERER] Error rendering markdown:",t),this.content=this.content}})}formatJson(){try{let t=JSON.parse(this.content);this.content=JSON.stringify(t,null,2)}catch(t){console.error("[CONTENT_RENDERER] Error formatting JSON:",t)}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-content-renderer"]],inputs:{content:"content",format:"format"},features:[Le],decls:4,vars:2,consts:[[1,"content-renderer",3,"ngClass"],[1,"markdown-content",3,"innerHTML"],["sandbox","allow-same-origin",1,"html-viewer",3,"srcdoc"],[1,"code-content"]],template:function(e,i){e&1&&(s(0,"div",0),w(1,ay,1,1,"div",1)(2,sy,1,1,"iframe",2)(3,ly,2,1,"pre",3),c()),e&2&&(x("ngClass","format-"+i.format),m(),S(i.format==="markdown"?1:i.format==="html"?2:3))},dependencies:[De,An],styles:[".content-renderer[_ngcontent-%COMP%]{width:100%;height:100%;overflow:auto;padding:1rem}.markdown-content[_ngcontent-%COMP%]{line-height:1.6;color:var(--color-text)}.code-content[_ngcontent-%COMP%]{font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:.9rem;line-height:1.5;margin:0;white-space:pre-wrap;word-wrap:break-word;color:var(--color-text)}.format-json[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-code-text, #d63384)}.format-yaml[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%], .format-text[_ngcontent-%COMP%] .code-content[_ngcontent-%COMP%]{color:var(--color-text)}.html-viewer[_ngcontent-%COMP%]{width:100%;height:100%;min-height:400px;border:1px solid var(--color-border);border-radius:8px;background:#fff}"]})};var gr=class n{http=d(Ye);MAX_FILE_SIZE=20*1024*1024;isViewable(t){return t<=this.MAX_FILE_SIZE}isFormatViewable(t){let e=t.split(".").pop()?.toLowerCase();return!(e&&["pdf","png","jpg","jpeg","gif","webp","zip","tar","gz","exe","bin","doc","docx","xls","xlsx","ppt","pptx"].includes(e))}detectFormat(t){switch(t.split(".").pop()?.toLowerCase()){case"md":return"markdown";case"json":return"json";case"yaml":case"yml":return"yaml";case"html":case"htm":return"html";default:return"text"}}loadFileContent(t,e,i){let o=`/api/projects/${t}/threads/${e}/files/${encodeURIComponent(i)}`,r=this.detectFormat(i);return this.http.get(o,{responseType:"text",observe:"response"}).pipe(ve(a=>{let l=a.body||"",p=new Blob([l]).size;return{content:l,format:r,filename:i,size:p}}),Xn(a=>(console.error("[CONTENT_VIEWER] Error loading file:",i,a),Ir(()=>new Error(`Failed to load file: ${a.message||"Unknown error"}`)))))}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function cy(n,t){if(n&1){let e=E();s(0,"button",12),_("click",function(){v(e);let o=g();return y(o.download())}),s(1,"mat-icon"),h(2,"download"),c()()}}function dy(n,t){n&1&&(s(0,"div",9),F(1,"mat-spinner",13),s(2,"p"),h(3,"Loading file content..."),c()())}function my(n,t){if(n&1){let e=E();s(0,"div",10)(1,"mat-icon",14),h(2,"error_outline"),c(),s(3,"p",15),h(4),c(),s(5,"button",16),_("click",function(){v(e);let o=g();return y(o.download())}),s(6,"mat-icon"),h(7,"download"),c(),h(8," Download instead "),c()()}if(n&2){let e=g();m(4),B(e.error)}}function hy(n,t){if(n&1&&F(0,"app-content-renderer",11),n&2){let e=g();x("content",e.fileContent.content)("format",e.fileContent.format)}}var El=class n{destroy$=new D;file;projectName;threadId;closeViewer=new H;contentService=d(gr);eventStream=d(Xi);fileContent=null;isLoading=!1;error="";ngOnInit(){this.loadContent(),this.subscribeToFileEvents()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadContent(){if(!this.contentService.isViewable(this.file.size)){this.error=`File too large to view (${this.contentService.formatSize(this.file.size)}). Maximum size: 20 MB.`;return}this.isLoading=!0,this.error="",this.contentService.loadFileContent(this.projectName,this.threadId,this.file.filename).subscribe({next:t=>{console.log("[CONTENT_VIEWER] Content loaded:",t.filename),this.fileContent=t,this.isLoading=!1},error:t=>{console.error("[CONTENT_VIEWER] Error loading content:",t),this.error=t.message||"Failed to load file content",this.isLoading=!1}})}onClose(){this.closeViewer.emit()}download(){let t=new Blob([this.fileContent?.content||""],{type:"text/plain"}),e=window.URL.createObjectURL(t),i=document.createElement("a");i.href=e,i.download=this.file.filename,i.click(),window.URL.revokeObjectURL(e)}formatSize(t){return this.contentService.formatSize(t)}subscribeToFileEvents(){this.eventStream.events$.pipe(ue(t=>t instanceof Wn),ue(t=>t.filename===this.file.filename),ue(t=>t.operation==="updated"),N(this.destroy$)).subscribe(t=>{console.log("[CONTENT_VIEWER] File updated event received, reloading:",t.filename),t.size&&(this.file.size=t.size),this.loadContent()})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-content-viewer"]],inputs:{file:"file",projectName:"projectName",threadId:"threadId"},outputs:{closeViewer:"closeViewer"},decls:16,vars:6,consts:[[1,"viewer-container"],[1,"viewer-header"],[1,"header-info"],[1,"filename"],[1,"file-size"],[1,"header-actions"],["mat-icon-button","","title","Download","type","button"],["mat-icon-button","","title","Close","type","button",3,"click"],[1,"viewer-content"],[1,"loading-state"],[1,"error-state"],[3,"content","format"],["mat-icon-button","","title","Download","type","button",3,"click"],["diameter","48"],[1,"error-icon"],[1,"error-message"],["mat-raised-button","","color","primary","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),h(4),c(),s(5,"span",4),h(6),c()(),s(7,"div",5),w(8,cy,3,0,"button",6),s(9,"button",7),_("click",function(){return i.onClose()}),s(10,"mat-icon"),h(11,"chevron_right"),c()()()(),s(12,"div",8),w(13,dy,4,0,"div",9),w(14,my,9,1,"div",10),w(15,hy,1,2,"app-content-renderer",11),c()()),e&2&&(m(4),B(i.file.filename),m(2),B(i.formatSize(i.file.size)),m(2),S(i.fileContent&&!i.isLoading&&!i.error?8:-1),m(5),S(i.isLoading?13:-1),m(),S(i.error?14:-1),m(),S(i.fileContent&&!i.isLoading&&!i.error?15:-1))},dependencies:[De,Qe,xe,xt,It,yt,kl,Sl,Ml],styles:[".viewer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--color-bg)}.viewer-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:1rem;border-bottom:1px solid var(--color-border);background:var(--color-bg);flex-shrink:0}.header-info[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.filename[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-size[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary)}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0}.viewer-content[_ngcontent-%COMP%]{flex:1;overflow:auto;background:var(--color-bg)}.loading-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;color:var(--color-text-secondary)}.error-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:1rem;padding:2rem;text-align:center}.error-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{color:var(--color-text);margin:0;max-width:400px}"]})};var py=Math.pow(10,8)*24*60*60*1e3,HR=-py,Tl=6048e5,cg=864e5;var uy=3600;var dg=uy*24,WR=dg*7,gy=dg*365.2425,fy=gy/12,UR=fy*3,Qd=Symbol.for("constructDateFrom");function pt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Qd in n?n[Qd](t):n instanceof Date?new n.constructor(t):new Date(t)}function Ze(n,t){return pt(t||n,n)}function mg(n,t,e){let i=Ze(n,e?.in);return isNaN(t)?pt(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}var _y={};function $n(){return _y}function Cn(n,t){let e=$n(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,o=Ze(n,t?.in),r=o.getDay(),a=(r<i?7:0)+r-i;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function yo(n,t){return Cn(n,Ie(q({},t),{weekStartsOn:1}))}function Pl(n,t){let e=Ze(n,t?.in),i=e.getFullYear(),o=pt(e,0);o.setFullYear(i+1,0,4),o.setHours(0,0,0,0);let r=yo(o),a=pt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);let l=yo(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function Xd(n){let t=Ze(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function fr(n,...t){let e=pt.bind(null,n||t.find(i=>typeof i=="object"));return t.map(e)}function _r(n,t){let e=Ze(n,t?.in);return e.setHours(0,0,0,0),e}function Ol(n,t,e){let[i,o]=fr(e?.in,n,t),r=_r(i),a=_r(o),l=+r-Xd(r),p=+a-Xd(a);return Math.round((l-p)/cg)}function hg(n,t){let e=Pl(n,t),i=pt(t?.in||n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),yo(i)}function pg(n){return pt(n,Date.now())}function ug(n,t,e){let[i,o]=fr(e?.in,n,t);return+_r(i)==+_r(o)}function gg(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function fg(n){return!(!gg(n)&&typeof n!="number"||isNaN(+Ze(n)))}function bg(n,t,e){let[i,o]=fr(e?.in,n,t),r=_g(i,o),a=Math.abs(Ol(i,o));i.setDate(i.getDate()-r*a);let l=+(_g(i,o)===-r),p=r*(a-l);return p===0?0:p}function _g(n,t){let e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function vg(n,t){let e=Ze(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}var by={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yg=(n,t,e)=>{let i,o=by[n];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Al(n){return(t={})=>{let e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}var vy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Cy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cg={date:Al({formats:vy,defaultWidth:"full"}),time:Al({formats:yy,defaultWidth:"full"}),dateTime:Al({formats:Cy,defaultWidth:"full"})};var xy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xg=(n,t,e,i)=>xy[n];function br(n){return(t,e)=>{let i=e?.context?String(e.context):"standalone",o;if(i==="formatting"&&n.formattingValues){let a=n.defaultFormattingWidth||n.defaultWidth,l=e?.width?String(e.width):a;o=n.formattingValues[l]||n.formattingValues[a]}else{let a=n.defaultWidth,l=e?.width?String(e.width):n.defaultWidth;o=n.values[l]||n.values[a]}let r=n.argumentCallback?n.argumentCallback(t):t;return o[r]}}var wy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Sy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ky={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},My={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ey={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ty={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Py=(n,t)=>{let e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},wg={ordinalNumber:Py,era:br({values:wy,defaultWidth:"wide"}),quarter:br({values:Sy,defaultWidth:"wide",argumentCallback:n=>n-1}),month:br({values:ky,defaultWidth:"wide"}),day:br({values:My,defaultWidth:"wide"}),dayPeriod:br({values:Ey,defaultWidth:"wide",formattingValues:Ty,defaultFormattingWidth:"wide"})};function vr(n){return(t,e={})=>{let i=e.width,o=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(o);if(!r)return null;let a=r[0],l=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],p=Array.isArray(l)?Ay(l,C=>C.test(a)):Oy(l,C=>C.test(a)),u;u=n.valueCallback?n.valueCallback(p):p,u=e.valueCallback?e.valueCallback(u):u;let b=t.slice(a.length);return{value:u,rest:b}}}function Oy(n,t){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Ay(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Sg(n){return(t,e={})=>{let i=t.match(n.matchPattern);if(!i)return null;let o=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;let l=t.slice(o.length);return{value:a,rest:l}}}var Dy=/^(\d+)(th|st|nd|rd)?/i,Iy=/\d+/i,Ry={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Fy={any:[/^b/i,/^(a|c)/i]},Ny={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vy={any:[/1/i,/2/i,/3/i,/4/i]},Ly={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jy={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},zy={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},By={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Hy={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Wy={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},kg={ordinalNumber:Sg({matchPattern:Dy,parsePattern:Iy,valueCallback:n=>parseInt(n,10)}),era:vr({matchPatterns:Ry,defaultMatchWidth:"wide",parsePatterns:Fy,defaultParseWidth:"any"}),quarter:vr({matchPatterns:Ny,defaultMatchWidth:"wide",parsePatterns:Vy,defaultParseWidth:"any",valueCallback:n=>n+1}),month:vr({matchPatterns:Ly,defaultMatchWidth:"wide",parsePatterns:jy,defaultParseWidth:"any"}),day:vr({matchPatterns:zy,defaultMatchWidth:"wide",parsePatterns:By,defaultParseWidth:"any"}),dayPeriod:vr({matchPatterns:Hy,defaultMatchWidth:"any",parsePatterns:Wy,defaultParseWidth:"any"})};var Kd={code:"en-US",formatDistance:yg,formatLong:Cg,formatRelative:xg,localize:wg,match:kg,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Mg(n,t){let e=Ze(n,t?.in);return Ol(e,vg(e))+1}function Eg(n,t){let e=Ze(n,t?.in),i=+yo(e)-+hg(e);return Math.round(i/Tl)+1}function Dl(n,t){let e=Ze(n,t?.in),i=e.getFullYear(),o=$n(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=pt(t?.in||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);let l=Cn(a,t),p=pt(t?.in||n,0);p.setFullYear(i,0,r),p.setHours(0,0,0,0);let u=Cn(p,t);return+e>=+l?i+1:+e>=+u?i:i-1}function Tg(n,t){let e=$n(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,o=Dl(n,t),r=pt(t?.in||n,0);return r.setFullYear(o,0,i),r.setHours(0,0,0,0),Cn(r,t)}function Pg(n,t){let e=Ze(n,t?.in),i=+Cn(e,t)-+Tg(e,t);return Math.round(i/Tl)+1}function ke(n,t){let e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}var xn={y(n,t){let e=n.getFullYear(),i=e>0?e:1-e;return ke(t==="yy"?i%100:i,t.length)},M(n,t){let e=n.getMonth();return t==="M"?String(e+1):ke(e+1,2)},d(n,t){return ke(n.getDate(),t.length)},a(n,t){let e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return ke(n.getHours()%12||12,t.length)},H(n,t){return ke(n.getHours(),t.length)},m(n,t){return ke(n.getMinutes(),t.length)},s(n,t){return ke(n.getSeconds(),t.length)},S(n,t){let e=t.length,i=n.getMilliseconds(),o=Math.trunc(i*Math.pow(10,e-3));return ke(o,t.length)}};var yr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zd={G:function(n,t,e){let i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){let i=n.getFullYear(),o=i>0?i:1-i;return e.ordinalNumber(o,{unit:"year"})}return xn.y(n,t)},Y:function(n,t,e,i){let o=Dl(n,i),r=o>0?o:1-o;if(t==="YY"){let a=r%100;return ke(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):ke(r,t.length)},R:function(n,t){let e=Pl(n);return ke(e,t.length)},u:function(n,t){let e=n.getFullYear();return ke(e,t.length)},Q:function(n,t,e){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ke(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ke(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){let i=n.getMonth();switch(t){case"M":case"MM":return xn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){let i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return ke(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){let o=Pg(n,i);return t==="wo"?e.ordinalNumber(o,{unit:"week"}):ke(o,t.length)},I:function(n,t,e){let i=Eg(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ke(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):xn.d(n,t)},D:function(n,t,e){let i=Mg(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ke(i,t.length)},E:function(n,t,e){let i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){let o=n.getDay(),r=(o-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return ke(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(o,{width:"short",context:"formatting"});case"eeee":default:return e.day(o,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){let o=n.getDay(),r=(o-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return ke(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(o,{width:"narrow",context:"standalone"});case"cccccc":return e.day(o,{width:"short",context:"standalone"});case"cccc":default:return e.day(o,{width:"wide",context:"standalone"})}},i:function(n,t,e){let i=n.getDay(),o=i===0?7:i;switch(t){case"i":return String(o);case"ii":return ke(o,t.length);case"io":return e.ordinalNumber(o,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){let o=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,t,e){let i=n.getHours(),o;switch(i===12?o=yr.noon:i===0?o=yr.midnight:o=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,t,e){let i=n.getHours(),o;switch(i>=17?o=yr.evening:i>=12?o=yr.afternoon:i>=4?o=yr.morning:o=yr.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return xn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):xn.H(n,t)},K:function(n,t,e){let i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ke(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ke(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):xn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):xn.s(n,t)},S:function(n,t){return xn.S(n,t)},X:function(n,t,e){let i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ag(i);case"XXXX":case"XX":return Co(i);case"XXXXX":case"XXX":default:return Co(i,":")}},x:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"x":return Ag(i);case"xxxx":case"xx":return Co(i);case"xxxxx":case"xxx":default:return Co(i,":")}},O:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Og(i,":");case"OOOO":default:return"GMT"+Co(i,":")}},z:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Og(i,":");case"zzzz":default:return"GMT"+Co(i,":")}},t:function(n,t,e){let i=Math.trunc(+n/1e3);return ke(i,t.length)},T:function(n,t,e){return ke(+n,t.length)}};function Og(n,t=""){let e=n>0?"-":"+",i=Math.abs(n),o=Math.trunc(i/60),r=i%60;return r===0?e+String(o):e+String(o)+t+ke(r,2)}function Ag(n,t){return n%60===0?(n>0?"-":"+")+ke(Math.abs(n)/60,2):Co(n,t)}function Co(n,t=""){let e=n>0?"-":"+",i=Math.abs(n),o=ke(Math.trunc(i/60),2),r=ke(i%60,2);return e+o+t+r}var Dg=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ig=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Uy=(n,t)=>{let e=n.match(/(P+)(p+)?/)||[],i=e[1],o=e[2];if(!o)return Dg(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Dg(i,t)).replace("{{time}}",Ig(o,t))},Rg={p:Ig,P:Uy};var $y=/^D+$/,qy=/^Y+$/,Gy=["D","DD","YY","YYYY"];function Fg(n){return $y.test(n)}function Ng(n){return qy.test(n)}function Vg(n,t,e){let i=Yy(n,t,e);if(console.warn(i),Gy.includes(n))throw new RangeError(i)}function Yy(n,t,e){let i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Qy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ky=/^'([^]*?)'?$/,Zy=/''/g,Jy=/[a-zA-Z]/;function Jd(n,t,e){let i=$n(),o=e?.locale??i.locale??Kd,r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=Ze(n,e?.in);if(!fg(l))throw new RangeError("Invalid time value");let p=t.match(Xy).map(b=>{let C=b[0];if(C==="p"||C==="P"){let T=Rg[C];return T(b,o.formatLong)}return b}).join("").match(Qy).map(b=>{if(b==="''")return{isToken:!1,value:"'"};let C=b[0];if(C==="'")return{isToken:!1,value:eC(b)};if(Zd[C])return{isToken:!0,value:b};if(C.match(Jy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:b}});o.localize.preprocessor&&(p=o.localize.preprocessor(l,p));let u={firstWeekContainsDate:r,weekStartsOn:a,locale:o};return p.map(b=>{if(!b.isToken)return b.value;let C=b.value;(!e?.useAdditionalWeekYearTokens&&Ng(C)||!e?.useAdditionalDayOfYearTokens&&Fg(C))&&Vg(C,t,String(n));let T=Zd[C[0]];return T(l,C,o.localize,u)}).join("")}function eC(n){let t=n.match(Ky);return t?t[1].replace(Zy,"'"):n}function Lg(n,t,e){return mg(n,-t,e)}function jg(n,t){return ug(pt(t?.in||n,n),Lg(pg(t?.in||n),1))}function zg(n){if(!n||isNaN(n.getTime()))return"unknown";let t=new Date,e=Jd(n,"HH:mm:ss"),i=t.getTime()-n.getTime(),o=Math.floor(i/(1e3*60));if(o<1)return`just now (${e})`;if(o<60)return`${o} min ago (${e})`;let r=Math.floor(i/(1e3*60*60));if(r<24)return`${r}h ago (${e})`;if(jg(n))return`yesterday ${e}`;let a=bg(t,n);return a<7?`${a}d ago ${e}`:`${Jd(n,"dd/MM/yyyy")} ${e}`}var tC=(n,t)=>t.filename;function iC(n,t){if(n&1){let e=E();s(0,"button",11),_("click",function(){v(e);let o=g(2);return y(o.downloadAll())}),s(1,"mat-icon"),h(2,"download_for_offline"),c()()}}function nC(n,t){n&1&&(s(0,"div",10),F(1,"span",12),s(2,"span",13),h(3,"Loading files..."),c()())}function oC(n,t){n&1&&(s(0,"div",14)(1,"mat-icon",15),h(2,"folder_open"),c(),s(3,"p",16),h(4,"No files in exchange space"),c(),s(5,"p",17),h(6,"Upload files to share with the agent"),c()())}function rC(n,t){if(n&1){let e=E();s(0,"button",28),_("click",function(){v(e);let o=g().$implicit,r=g(4);return y(r.viewFile(o))}),s(1,"mat-icon"),h(2,"visibility"),c()()}}function aC(n,t){if(n&1){let e=E();s(0,"div",18)(1,"div",19)(2,"mat-icon",20),h(3),c(),s(4,"div",21)(5,"span",22),h(6),c(),s(7,"span",23),h(8),c()()(),s(9,"div",24),w(10,rC,3,0,"button",25),s(11,"button",26),_("click",function(){let o=v(e).$implicit,r=g(4);return y(r.download(o))}),s(12,"mat-icon"),h(13,"download"),c()(),s(14,"button",27),_("click",function(){let o=v(e).$implicit,r=g(4);return y(r.delete(o))}),s(15,"mat-icon"),h(16,"delete"),c()()()()}if(n&2){let e=t.$implicit,i=g(4);m(3),B(i.getFileIcon(e.filename)),m(2),x("title",e.filename),m(),B(e.filename),m(2),Tn("",i.formatSize(e.size)," \u2022 ",i.formatDate(e.lastModified)),m(2),S(i.canViewFile(e)?10:-1)}}function sC(n,t){if(n&1&&Oe(0,aC,17,6,"div",18,tC),n&2){let e=g(3);Ae(e.files())}}function lC(n,t){if(n&1&&w(0,oC,7,0,"div",14)(1,sC,2,0),n&2){let e=g(2);S(e.files().length===0?0:1)}}function cC(n,t){if(n&1){let e=E();s(0,"div",0)(1,"div",2)(2,"div",3)(3,"h3",4),h(4,"Exchange"),c(),s(5,"span",5),h(6),c()(),s(7,"div",6),w(8,iC,3,0,"button",7),s(9,"button",8),_("click",function(){v(e);let o=g();return y(o.close())}),s(10,"mat-icon"),h(11,"chevron_right"),c()()()(),s(12,"div",9),w(13,nC,4,0,"div",10)(14,lC,2,1),c()()}if(n&2){let e=g();m(6),ae("(",e.files().length,")"),m(2),S(e.files().length>0?8:-1),m(5),S(e.isLoading()?13:14)}}function dC(n,t){if(n&1){let e=E();s(0,"app-content-viewer",29),_("closeViewer",function(){v(e);let o=g();return y(o.backToList())}),c()}if(n&2){let e=g();x("file",e.currentFile)("projectName",e.projectName)("threadId",e.threadId)}}var Il=class n{projectName;threadId;closeDrawer=new H;fileExchangeState=d(ur);contentViewerService=d(gr);files=this.fileExchangeState.files;isLoading=this.fileExchangeState.isLoading;viewerState="list";currentFile=null;close(){this.viewerState==="content"?this.backToList():this.closeDrawer.emit()}viewFile(t){this.currentFile=t,this.viewerState="content"}backToList(){this.viewerState="list",this.currentFile=null}downloadAll(){this.fileExchangeState.downloadAllFiles()}download(t){this.fileExchangeState.downloadFile(t.filename)}delete(t){return ie(this,null,function*(){if(!confirm(`Delete file "${t.filename}"?`))return;let i=yield this.fileExchangeState.deleteFile(t.filename);i.success||alert(`Failed to delete file: ${i.error}`)})}getFileIcon(t){switch(t.split(".").pop()?.toLowerCase()){case"pdf":return"picture_as_pdf";case"csv":case"xlsx":case"xls":return"table_chart";case"txt":case"md":return"description";case"jpg":case"jpeg":case"png":case"gif":case"webp":return"image";case"zip":case"tar":case"gz":return"folder_zip";default:return"insert_drive_file"}}formatSize(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}formatDate(t){return zg(t)}canViewFile(t){return this.contentViewerService.isFormatViewable(t.filename)&&this.contentViewerService.isViewable(t.size)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-file-exchange-drawer"]],inputs:{projectName:"projectName",threadId:"threadId"},outputs:{closeDrawer:"closeDrawer"},decls:2,vars:2,consts:[[1,"file-drawer-container"],[3,"file","projectName","threadId"],[1,"drawer-header"],[1,"header-left"],[1,"drawer-title"],[1,"file-count"],[1,"header-actions"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn"],["mat-icon-button","","title","Close","type","button",1,"close-btn",3,"click"],[1,"file-list"],[1,"file-loading"],["mat-icon-button","","title","Download all files","type","button",1,"download-all-btn",3,"click"],[1,"loading-spinner"],[1,"loading-text"],[1,"file-empty"],[1,"empty-icon"],[1,"empty-text"],[1,"empty-hint"],[1,"file-item"],[1,"file-info"],[1,"file-icon"],[1,"file-details"],[1,"file-name",3,"title"],[1,"file-meta"],[1,"file-actions"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn"],["mat-icon-button","","title","Download","type","button",1,"action-btn","download-btn",3,"click"],["mat-icon-button","","title","Delete","type","button",1,"action-btn","delete-btn",3,"click"],["mat-icon-button","","title","View","type","button",1,"action-btn","view-btn",3,"click"],[3,"closeViewer","file","projectName","threadId"]],template:function(e,i){e&1&&(w(0,cC,15,3,"div",0),w(1,dC,1,3,"app-content-viewer",1)),e&2&&(S(i.viewerState==="list"?0:-1),m(),S(i.viewerState==="content"&&i.currentFile?1:-1))},dependencies:[De,Qe,xe,xt,yt,El],styles:[".file-drawer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);color:var(--color-text)}.drawer-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.header-left[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.5rem}.header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.drawer-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text)}.file-count[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text-secondary)}.download-all-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.download-all-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.close-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.close-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);background:var(--color-bg-hover)}.file-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:.5rem}.file-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;gap:1rem;color:var(--color-text-secondary)}.loading-spinner[_ngcontent-%COMP%]{display:inline-block;width:32px;height:32px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.loading-text[_ngcontent-%COMP%]{font-size:.9rem}.file-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:var(--color-text-secondary)}.empty-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px;margin-bottom:1rem;opacity:.5}.empty-text[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:500}.empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;opacity:.7}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:.75rem;border-radius:8px;transition:background .2s;gap:1rem}.file-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.file-item[_ngcontent-%COMP%]:hover .file-actions[_ngcontent-%COMP%]{opacity:1}.file-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex:1;min-width:0}.file-icon[_ngcontent-%COMP%]{flex-shrink:0;color:var(--color-primary);font-size:28px;width:28px;height:28px}.file-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:0}.file-name[_ngcontent-%COMP%]{font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-meta[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary)}.file-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-shrink:0;opacity:0;transition:opacity .2s}.action-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.action-btn.view-btn[_ngcontent-%COMP%]:hover, .action-btn.download-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.action-btn.delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}@media (max-width: 768px){.file-actions[_ngcontent-%COMP%]{opacity:1}.file-item[_ngcontent-%COMP%]{padding:1rem .75rem}.drawer-header[_ngcontent-%COMP%]{padding:.75rem}}"]})};var Fl=["*"],mC=["content"],hC=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],pC=["mat-drawer","mat-drawer-content","*"];function uC(n,t){if(n&1){let e=E();s(0,"div",1),_("click",function(){v(e);let o=g();return y(o._onBackdropClicked())}),c()}if(n&2){let e=g();A("mat-drawer-shown",e._isShowingBackdrop())}}function gC(n,t){n&1&&(s(0,"mat-drawer-content"),he(1,2),c())}var fC=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],_C=["mat-sidenav","mat-sidenav-content","*"];function bC(n,t){if(n&1){let e=E();s(0,"div",1),_("click",function(){v(e);let o=g();return y(o._onBackdropClicked())}),c()}if(n&2){let e=g();A("mat-drawer-shown",e._isShowingBackdrop())}}function vC(n,t){n&1&&(s(0,"mat-sidenav-content"),he(1,2),c())}var yC=`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
|
|
363
|
+
`;var CC=new ee("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:xC}),em=new ee("MAT_DRAWER_CONTAINER");function xC(){return!1}var Cr=(()=>{class n extends dn{_platform=d(rt);_changeDetectorRef=d(Re);_container=d(Sa);constructor(){let e=d(K),i=d(cn),o=d(me);super(e,i,o)}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}_shouldBeHidden(){if(this._platform.isBrowser)return!1;let{start:e,end:i}=this._container;return e!=null&&e.mode!=="over"&&e.opened||i!=null&&i.mode!=="over"&&i.opened}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:6,hostBindings:function(i,o){i&2&&(Fi("margin-left",o._container._contentMargins.left,"px")("margin-right",o._container._contentMargins.right,"px"),A("mat-drawer-content-hidden",o._shouldBeHidden()))},features:[pe([{provide:dn,useExisting:n}]),ye],ngContentSelectors:Fl,decls:1,vars:0,template:function(i,o){i&1&&(He(),he(0))},encapsulation:2,changeDetection:0})}return n})(),wa=(()=>{class n{_elementRef=d(K);_focusTrapFactory=d(is);_focusMonitor=d(Vi);_platform=d(rt);_ngZone=d(me);_renderer=d(ot);_interactivityChecker=d(Lo);_doc=d(it);_container=d(em,{optional:!0});_focusTrap=null;_elementFocusedBeforeDrawerWasOpened=null;_eventCleanups;_isAttached;_anchor;get position(){return this._position}set position(e){e=e==="end"?"end":"start",e!==this._position&&(this._isAttached&&this._updatePositionInParent(e),this._position=e,this.onPositionChanged.emit())}_position="start";get mode(){return this._mode}set mode(e){this._mode=e,this._updateFocusTrapState(),this._modeChanged.next()}_mode="over";get disableClose(){return this._disableClose}set disableClose(e){this._disableClose=Dt(e)}_disableClose=!1;get autoFocus(){let e=this._autoFocus;return e??(this.mode==="side"?"dialog":"first-tabbable")}set autoFocus(e){(e==="true"||e==="false"||e==null)&&(e=Dt(e)),this._autoFocus=e}_autoFocus;get opened(){return this._opened()}set opened(e){this.toggle(Dt(e))}_opened=Te(!1);_openedVia;_animationStarted=new D;_animationEnd=new D;openedChange=new H(!0);_openedStream=this.openedChange.pipe(ue(e=>e),ve(()=>{}));openedStart=this._animationStarted.pipe(ue(()=>this.opened),_c(void 0));_closedStream=this.openedChange.pipe(ue(e=>!e),ve(()=>{}));closedStart=this._animationStarted.pipe(ue(()=>!this.opened),_c(void 0));_destroyed=new D;onPositionChanged=new H;_content;_modeChanged=new D;_injector=d(fe);_changeDetectorRef=d(Re);constructor(){this.openedChange.pipe(N(this._destroyed)).subscribe(e=>{e?(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement,this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{let e=this._elementRef.nativeElement;Um(e,"keydown").pipe(ue(i=>i.keyCode===27&&!this.disableClose&&!vt(i)),N(this._destroyed)).subscribe(i=>this._ngZone.run(()=>{this.close(),i.stopPropagation(),i.preventDefault()})),this._eventCleanups=[this._renderer.listen(e,"transitionrun",this._handleTransitionEvent),this._renderer.listen(e,"transitionend",this._handleTransitionEvent),this._renderer.listen(e,"transitioncancel",this._handleTransitionEvent)]}),this._animationEnd.subscribe(()=>{this.openedChange.emit(this.opened)})}_forceFocus(e,i){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let o=()=>{r(),a(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",o),a=this._renderer.listen(e,"mousedown",o)})),e.focus(i)}_focusByCssSelector(e,i){let o=this._elementRef.nativeElement.querySelector(e);o&&this._forceFocus(o,i)}_takeFocus(){if(!this._focusTrap)return;let e=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":Et(()=>{!this._focusTrap.focusInitialElement()&&typeof e.focus=="function"&&e.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus);break}}_restoreFocus(e){this.autoFocus!=="dialog"&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,e):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){let e=this._doc.activeElement;return!!e&&this._elementRef.nativeElement.contains(e)}ngAfterViewInit(){this._isAttached=!0,this._position==="end"&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngOnDestroy(){this._eventCleanups.forEach(e=>e()),this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(e){return this.toggle(!0,e)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(e=!this.opened,i){e&&i&&(this._openedVia=i);let o=this._setOpen(e,!e&&this._isFocusWithinDrawer(),this._openedVia||"program");return e||(this._openedVia=null),o}_setOpen(e,i,o){return e===this.opened?Promise.resolve(e?"open":"close"):(this._opened.set(e),this._container?._transitionsEnabled?this._setIsAnimating(!0):setTimeout(()=>{this._animationStarted.next(),this._animationEnd.next()}),this._elementRef.nativeElement.classList.toggle("mat-drawer-opened",e),!e&&i&&this._restoreFocus(o),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(r=>{this.openedChange.pipe(Mt(1)).subscribe(a=>r(a?"open":"close"))}))}_setIsAnimating(e){this._elementRef.nativeElement.classList.toggle("mat-drawer-animating",e)}_getWidth(){return this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(e){if(!this._platform.isBrowser)return;let i=this._elementRef.nativeElement,o=i.parentNode;e==="end"?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),o.insertBefore(this._anchor,i)),o.appendChild(i)):this._anchor&&this._anchor.parentNode.insertBefore(i,this._anchor)}_handleTransitionEvent=e=>{let i=this._elementRef.nativeElement;e.target===i&&this._ngZone.run(()=>{e.type==="transitionrun"?this._animationStarted.next(e):(e.type==="transitionend"&&this._setIsAnimating(!1),this._animationEnd.next(e))})};static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-drawer"]],viewQuery:function(i,o){if(i&1&&ne(mC,5),i&2){let r;W(r=U())&&(o._content=r.first)}},hostAttrs:[1,"mat-drawer"],hostVars:12,hostBindings:function(i,o){i&2&&(Y("align",null)("tabIndex",o.mode!=="side"?"-1":null),Fi("visibility",!o._container&&!o.opened?"hidden":null),A("mat-drawer-end",o.position==="end")("mat-drawer-over",o.mode==="over")("mat-drawer-push",o.mode==="push")("mat-drawer-side",o.mode==="side"))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],ngContentSelectors:Fl,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(i,o){i&1&&(He(),s(0,"div",1,0),he(2),c())},dependencies:[dn],encapsulation:2,changeDetection:0})}return n})(),Sa=(()=>{class n{_dir=d(Ct,{optional:!0});_element=d(K);_ngZone=d(me);_changeDetectorRef=d(Re);_animationDisabled=We();_transitionsEnabled=!1;_allDrawers;_drawers=new Xm;_content;_userContent;get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(e){this._autosize=Dt(e)}_autosize=d(CC);get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(e){this._backdropOverride=e==null?null:Dt(e)}_backdropOverride;backdropClick=new H;_start;_end;_left;_right;_destroyed=new D;_doCheckSubject=new D;_contentMargins={left:null,right:null};_contentMarginChanges=new D;get scrollable(){return this._userContent||this._content}_injector=d(fe);constructor(){let e=d(rt),i=d(Bi);this._dir?.change.pipe(N(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),i.change().pipe(N(this._destroyed)).subscribe(()=>this.updateContentMargins()),!this._animationDisabled&&e.isBrowser&&this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._element.nativeElement.classList.add("mat-drawer-transition"),this._transitionsEnabled=!0},200)})}ngAfterContentInit(){this._allDrawers.changes.pipe(Vt(this._allDrawers),N(this._destroyed)).subscribe(e=>{this._drawers.reset(e.filter(i=>!i._container||i._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(Vt(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(e=>{this._watchDrawerToggle(e),this._watchDrawerPosition(e),this._watchDrawerMode(e)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe($m(10),N(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(e=>e.open())}close(){this._drawers.forEach(e=>e.close())}updateContentMargins(){let e=0,i=0;if(this._left&&this._left.opened){if(this._left.mode=="side")e+=this._left._getWidth();else if(this._left.mode=="push"){let o=this._left._getWidth();e+=o,i-=o}}if(this._right&&this._right.opened){if(this._right.mode=="side")i+=this._right._getWidth();else if(this._right.mode=="push"){let o=this._right._getWidth();i+=o,e-=o}}e=e||null,i=i||null,(e!==this._contentMargins.left||i!==this._contentMargins.right)&&(this._contentMargins={left:e,right:i},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(e){e._animationStarted.pipe(N(this._drawers.changes)).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),e.mode!=="side"&&e.openedChange.pipe(N(this._drawers.changes)).subscribe(()=>this._setContainerClass(e.opened))}_watchDrawerPosition(e){e.onPositionChanged.pipe(N(this._drawers.changes)).subscribe(()=>{Et({read:()=>this._validateDrawers()},{injector:this._injector})})}_watchDrawerMode(e){e._modeChanged.pipe(N(Ii(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(e){let i=this._element.nativeElement.classList,o="mat-drawer-container-has-open";e?i.add(o):i.remove(o)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(e=>{e.position=="end"?(this._end!=null,this._end=e):(this._start!=null,this._start=e)}),this._right=this._left=null,this._dir&&this._dir.value==="rtl"?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&this._start.mode!="over"||this._isDrawerOpen(this._end)&&this._end.mode!="over"}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(e=>e&&!e.disableClose&&this._drawerHasBackdrop(e)).forEach(e=>e._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(e){return e!=null&&e.opened}_drawerHasBackdrop(e){return this._backdropOverride==null?!!e&&e.mode!=="side":this._backdropOverride}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-drawer-container"]],contentQueries:function(i,o,r){if(i&1&&(Tt(r,Cr,5),Tt(r,wa,5)),i&2){let a;W(a=U())&&(o._content=a.first),W(a=U())&&(o._allDrawers=a)}},viewQuery:function(i,o){if(i&1&&ne(Cr,5),i&2){let r;W(r=U())&&(o._userContent=r.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(i,o){i&2&&A("mat-drawer-container-explicit-backdrop",o._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],features:[pe([{provide:em,useExisting:n}])],ngContentSelectors:pC,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(i,o){i&1&&(He(hC),w(0,uC,1,2,"div",0),he(1),he(2,1),w(3,gC,2,0,"mat-drawer-content")),i&2&&(S(o.hasBackdrop?0:-1),m(3),S(o._content?-1:3))},dependencies:[Cr],styles:[`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
|
|
364
|
+
`],encapsulation:2,changeDetection:0})}return n})(),Rl=(()=>{class n extends Cr{static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275cmp=M({type:n,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],features:[pe([{provide:dn,useExisting:n}]),ye],ngContentSelectors:Fl,decls:1,vars:0,template:function(i,o){i&1&&(He(),he(0))},encapsulation:2,changeDetection:0})}return n})(),tm=(()=>{class n extends wa{get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(e){this._fixedInViewport=Dt(e)}_fixedInViewport=!1;get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(e){this._fixedTopGap=bi(e)}_fixedTopGap=0;get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(e){this._fixedBottomGap=bi(e)}_fixedBottomGap=0;static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275cmp=M({type:n,selectors:[["mat-sidenav"]],hostAttrs:[1,"mat-drawer","mat-sidenav"],hostVars:16,hostBindings:function(i,o){i&2&&(Y("tabIndex",o.mode!=="side"?"-1":null)("align",null),Fi("top",o.fixedInViewport?o.fixedTopGap:null,"px")("bottom",o.fixedInViewport?o.fixedBottomGap:null,"px"),A("mat-drawer-end",o.position==="end")("mat-drawer-over",o.mode==="over")("mat-drawer-push",o.mode==="push")("mat-drawer-side",o.mode==="side")("mat-sidenav-fixed",o.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],features:[pe([{provide:wa,useExisting:n}]),ye],ngContentSelectors:Fl,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(i,o){i&1&&(He(),s(0,"div",1,0),he(2),c())},dependencies:[dn],encapsulation:2,changeDetection:0})}return n})(),Bg=(()=>{class n extends Sa{_allDrawers=void 0;_content=void 0;static \u0275fac=(()=>{let e;return function(o){return(e||(e=nt(n)))(o||n)}})();static \u0275cmp=M({type:n,selectors:[["mat-sidenav-container"]],contentQueries:function(i,o,r){if(i&1&&(Tt(r,Rl,5),Tt(r,tm,5)),i&2){let a;W(a=U())&&(o._content=a.first),W(a=U())&&(o._allDrawers=a)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(i,o){i&2&&A("mat-drawer-container-explicit-backdrop",o._backdropOverride)},exportAs:["matSidenavContainer"],features:[pe([{provide:em,useExisting:n},{provide:Sa,useExisting:n}]),ye],ngContentSelectors:_C,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(i,o){i&1&&(He(fC),w(0,bC,1,2,"div",0),he(1),he(2,1),w(3,vC,2,0,"mat-sidenav-content")),i&2&&(S(o.hasBackdrop?0:-1),m(3),S(o._content?-1:3))},dependencies:[Rl],styles:[yC],encapsulation:2,changeDetection:0})}return n})(),Nl=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le,zi,zi,le]})}return n})();var Wg="mat-badge-content",wC=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,o){},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)}
|
|
365
|
+
`],encapsulation:2,changeDetection:0})}return n})(),Ug=(()=>{class n{_ngZone=d(me);_elementRef=d(K);_ariaDescriber=d(os);_renderer=d(ot);_animationsDisabled=We();_idGenerator=d(Fe);get color(){return this._color}set color(e){this._setColor(e),this._color=e}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(e){this._updateRenderedContent(e)}_content;get description(){return this._description}set description(e){this._updateDescription(e)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=d(Lo);_document=d(it);constructor(){let e=d(Lt);e.load(wC),e.load(ts)}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}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 e=this._renderer.createElement("span"),i="mat-badge-active";return e.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),e.setAttribute("aria-hidden","true"),e.classList.add(Wg),this._animationsDisabled&&e.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(e),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{e.classList.add(i)})}):e.classList.add(i),e}_updateRenderedContent(e){let i=`${e??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(e){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!e||this._isHostInteractive())&&this._removeInlineDescription(),this._description=e,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,e):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(e){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),e&&i.add(`mat-badge-${e}`)}_clearExistingBadges(){let e=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Wg}`);for(let i of Array.from(e))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,o){i&2&&A("mat-badge-overlap",o.overlap)("mat-badge-above",o.isAbove())("mat-badge-below",!o.isAbove())("mat-badge-before",!o.isAfter())("mat-badge-after",o.isAfter())("mat-badge-small",o.size==="small")("mat-badge-medium",o.size==="medium")("mat-badge-large",o.size==="large")("mat-badge-hidden",o.hidden||!o.content)("mat-badge-disabled",o.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",J],disabled:[2,"matBadgeDisabled","disabled",J],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",J]}})}return n})(),$g=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[jo,le,le]})}return n})();var xr=class n{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=d(hr);project=d(we);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){nn([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([t,e])=>{this.updateTitle(t?.name??"...",e)})}updateTitle(t,e){let i;this.isSystemActive?i=`\u23F3${e>0?` (${e}) `:" "}${t}`:e>0?i=`${this.ATTENTION_EMOJI} (${e}) ${t}`:i=t,document.title=i,console.log("[TAB-TITLE] Updated to:",i)}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 t=this.project.getSelectedProjectId()??"...",e=this.unreadService.getCurrentCount();this.updateTitle(t,e)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Vl=class n{http=d(Ye);maxFileSize=5*1024*1024;supportedTypes=["image/png","image/jpeg","image/gif","image/webp"];validateFile(t){if(!this.supportedTypes.includes(t.type))throw new Error(`Unsupported file type: ${t.type}`);if(t.size>this.maxFileSize)throw new Error(`File too large: ${(t.size/1024/1024).toFixed(1)}MB exceeds 5MB limit`)}fileToBase64(t){return ie(this,null,function*(){return new Promise((e,i)=>{let o=new FileReader;o.onload=()=>{let r=o.result;if(!r){i(new Error("Failed to read file"));return}let a=r.split(",")[1];if(!a){i(new Error("Invalid file format"));return}e(a)},o.onerror=i,o.readAsDataURL(t)})})}getUploadUrl(t,e){return`/api/projects/${t}/threads/${e}/upload`}uploadImage(t,e,i){console.log("[IMAGE-UPLOAD] uploadImage - file:",t.name,t.type,t.size),console.log("[IMAGE-UPLOAD] uploadImage - project:",e,"thread:",i);try{console.log("[IMAGE-UPLOAD] Validating file..."),this.validateFile(t)}catch(o){return console.log("[IMAGE-UPLOAD] Validation failed:",o),kt({success:!1,error:o instanceof Error?o.message:"Validation failed"})}return new oi(o=>{console.log("[IMAGE-UPLOAD] Converting to base64..."),this.fileToBase64(t).then(r=>{console.log("[IMAGE-UPLOAD] Base64 length:",r.length),console.log("[IMAGE-UPLOAD] Sending upload request..."),this.http.post(this.getUploadUrl(e,i),{content:r,mimeType:t.type,filename:t.name}).pipe(ve(a=>(console.log("[IMAGE-UPLOAD] Upload success result:",a),{success:!0,processedSize:a.processedSize,dimensions:a.dimensions})),Xn(a=>{console.log("[IMAGE-UPLOAD] Upload failed:",a);let l=a.error?.error||a.message||"Upload failed";return kt({success:!1,error:l})})).subscribe({next:a=>{o.next(a),o.complete()},error:a=>o.error(a)})}).catch(r=>{console.log("[IMAGE-UPLOAD] Base64 conversion failed:",r),o.next({success:!1,error:r instanceof Error?r.message:"Failed to read file"}),o.complete()})})}hasImageFiles(t){if(console.log("[IMAGE-UPLOAD] hasImageFiles - dataTransfer:",t),!t)return console.log("[IMAGE-UPLOAD] hasImageFiles - no dataTransfer"),!1;if(console.log("[IMAGE-UPLOAD] hasImageFiles - types:",Array.from(t.types)),!Array.from(t.types).includes("Files"))return console.log("[IMAGE-UPLOAD] hasImageFiles - no Files type"),!1;let e=Array.from(t.files||[]);console.log("[IMAGE-UPLOAD] hasImageFiles - files:",e.map(o=>({name:o.name,type:o.type})));let i=e.some(o=>this.supportedTypes.includes(o.type));return console.log("[IMAGE-UPLOAD] hasImageFiles - result:",i),i}filterImageFiles(t){return Array.from(t).filter(i=>this.supportedTypes.includes(i.type))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var wr=class n{pendingFirstMessage=null;setPendingFirstMessage(t){console.log("[FIRST-MESSAGE-STATE] Storing pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=t}consumePendingFirstMessage(){let t=this.pendingFirstMessage;return t?(console.log("[FIRST-MESSAGE-STATE] Consuming pending first message:",t.substring(0,50)+"..."),this.pendingFirstMessage=null):console.log("[FIRST-MESSAGE-STATE] No pending first message to consume"),t}hasPendingFirstMessage(){return this.pendingFirstMessage!==null}clear(){this.pendingFirstMessage&&(console.log("[FIRST-MESSAGE-STATE] Clearing pending first message"),this.pendingFirstMessage=null)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var kC=["inputSection"];function MC(n,t){if(n&1){let e=E();s(0,"button",18),_("click",function(){v(e);let o=g();return y(o.toggleFileDrawer())}),s(1,"mat-icon"),h(2,"folder_open"),c()()}if(n&2){let e=g();A("has-files",e.fileCount>0),x("title",Pn("Files Exchange",e.fileCount>0?" ("+e.fileCount+" file"+(e.fileCount>1?"s":"")+")":""))("matBadge",e.fileCount>0?e.fileCount:null)}}function EC(n,t){if(n&1&&(s(0,"div",5),h(1),c()),n&2){let e=g();m(),Tn(" \u26A0\uFE0F Connection lost. Reconnecting... (",e.connectionStatus.reconnectAttempts,"/",e.connectionStatus.maxAttempts,") ")}}function TC(n,t){if(n&1&&(s(0,"div",19),h(1),c()),n&2){let e=g();A("error",e.uploadStatus.isError),m(),ae(" ",e.uploadStatus.message," ")}}function PC(n,t){if(n&1){let e=E();s(0,"app-chat-textarea",20),_("messageSubmitted",function(o){v(e);let r=g();return y(r.onMessageSubmitted(o))})("voiceRecordingToggled",function(o){v(e);let r=g();return y(r.onVoiceToggled(o))})("heightChanged",function(o){v(e);let r=g();return y(r.onInputHeightChanged(o))})("stopRequested",function(){v(e);let o=g();return y(o.onStopRequested())})("filesPasted",function(o){v(e);let r=g();return y(r.onFilesPasted(o))}),c()}if(n&2){let e=g();x("isDisabled",!e.isConnected)("isSessionInitializing",!1)("showWelcome",!1)("isThinking",e.isThinking)("isStarting",!1)}}function OC(n,t){if(n&1){let e=E();s(0,"app-choice-select",21),_("choiceSelected",function(o){v(e);let r=g();return y(r.onChoiceSelected(o))}),c()}if(n&2){let e=g();x("options",e.currentChoice.options)("labelHtml",e.currentChoice.label)("isVisible",!!e.currentChoice)}}function AC(n,t){n&1&&(s(0,"div",17)(1,"div",22)(2,"div",23),h(3,"\u{1F4CE}"),c(),s(4,"div",24),h(5,"Drop files here to upload"),c(),s(6,"div",25),h(7,"Images will be added to conversation, other files to exchange space"),c()()())}var Ll=class n{projectName;threadId;destroy$=new D;inputSection;messages=[];streamingText="";isThinking=!1;currentChoice=null;connectionStatus=null;isConnected=!1;showConnectionStatus=!1;hasEverConnected=!1;inputSectionHeight=80;uploadStatus={message:"",isError:!1};isDragOver=!1;isFileDrawerOpen=!1;get fileCount(){return this.fileExchangeState.fileCount()}pendingFirstMessage=null;subscriptions=[];codayService=d(mi);preferencesService=d(st);titleService=d(xr);elementRef=d(K);threadState=d(Rt);imageUploadService=d(Vl);fileExchangeState=d(ur);firstMessageState=d(wr);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.initializeThreadConnection()}ngOnChanges(t){console.log("[THREAD] ngOnChanges called",t),t.threadId&&(console.log("[THREAD] threadId changed:",{firstChange:t.threadId.firstChange,previousValue:t.threadId.previousValue,currentValue:t.threadId.currentValue}),t.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.codayService.messages$.pipe(N(this.destroy$)).subscribe(e=>{console.log("[THREAD] Messages updated:",e.length),this.messages=e}),this.codayService.streamingText$.pipe(N(this.destroy$)).subscribe(e=>{this.streamingText=e}),this.codayService.isThinking$.pipe(N(this.destroy$)).subscribe(e=>{this.isThinking=e}),this.codayService.currentChoice$.pipe(N(this.destroy$)).subscribe(e=>{this.currentChoice=e}),this.codayService.connectionStatus$.pipe(N(this.destroy$)).subscribe(e=>{this.connectionStatus=e,this.isConnected=e.connected,e.connected&&!this.hasEverConnected&&(this.hasEverConnected=!0,this.showConnectionStatus=!0),!e.connected&&!this.hasEverConnected?setTimeout(()=>{!this.isConnected&&!this.hasEverConnected&&(this.showConnectionStatus=!0)},2e3):!e.connected&&this.hasEverConnected?this.showConnectionStatus=!0:e.connected&&(this.showConnectionStatus=!0)}),this.codayService.threadUpdateEvent$.pipe(N(this.destroy$)).subscribe(e=>{e&&(console.log("[THREAD] Thread update event received:",e),this.threadState.refreshThreadList())}),this.codayService.resetMessages(),this.codayService.setTabTitleService(this.titleService),console.log("[THREAD] Connecting to thread event stream"),this.codayService.connectToThread(this.projectName,this.threadId);let t=this.firstMessageState.consumePendingFirstMessage();t?(console.log("[THREAD] First message pending:",t.substring(0,50)+"..."),this.pendingFirstMessage=t,this.codayService.setThinkingForPendingMessage(),this.subscribeToFirstInvite()):console.log("[THREAD] No first message found in state service")}ngAfterViewChecked(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&t>0&&(this.inputSectionHeight=t)}}ngOnDestroy(){console.log("[THREAD] Destroying component"),this.destroy$.next(),this.destroy$.complete(),this.fileExchangeState.clear(),this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[],window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(t){console.log("[THREAD] Sending message:",t),this.codayService.sendMessage(t)}onVoiceToggled(t){console.log("[VOICE] Recording:",t)}onChoiceSelected(t){console.log("[THREAD] Choice selected:",t),this.codayService.sendChoice(t)}onCopyMessage(t){console.log("[COPY] Message copied:",t.id)}onStopRequested(){this.threadState.stop()}onInputHeightChanged(t){console.log("[THREAD] Input height changed:",t),this.inputSectionHeight=t}onFilesPasted(t){console.log("[THREAD] File(s) pasted:",t.length);let e=this.imageUploadService.filterImageFiles(t),i=t.filter(o=>!o.type.startsWith("image/"));e.length&&this.uploadFilesSequentially(e,0),i.length&&this.uploadFilesToExchangeSpace(i),!e.length&&!i.length&&this.showUploadError("No supported files found")}toggleFileDrawer(){console.log("[THREAD] Toggling file drawer"),this.isFileDrawerOpen=!this.isFileDrawerOpen}closeFileDrawer(){console.log("[THREAD] Closing file drawer"),this.isFileDrawerOpen=!1}onDragEnter(t){t.preventDefault(),t.dataTransfer?.types.includes("Files")&&(console.log("[THREAD] Image files detected - showing drag overlay"),this.isDragOver=!0)}onDragOver(t){t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy")}onDragLeave(t){this.elementRef.nativeElement.contains(t.relatedTarget)||(console.log("[THREAD] Leaving component area - hiding drag overlay"),this.isDragOver=!1)}onDrop(t){t.preventDefault(),this.isDragOver=!1,console.log("[THREAD] Files dropped:",t.dataTransfer?.files?.length||0);let e=t.dataTransfer?.files;if(!e||e.length===0){console.log("[THREAD] No files in drop event");return}let i=this.imageUploadService.filterImageFiles(e),o=Array.from(e).filter(r=>!r.type.startsWith("image/"));console.log("[THREAD] Image files:",i.length,"Other files:",o.length),i.length>0&&this.uploadFilesSequentially(i,0),o.length>0&&this.uploadFilesToExchangeSpace(o),i.length===0&&o.length===0&&this.showUploadError("No supported files found")}uploadFilesSequentially(t,e){if(e>=t.length)return;let i=t[e];if(!i){console.error("[THREAD] File at index",e,"is undefined");return}console.log("[THREAD] Uploading file:",i.name),this.uploadStatus={message:`Uploading ${i.name}...`,isError:!1},this.imageUploadService.uploadImage(i,this.projectName,this.threadId).subscribe({next:o=>{o.success?(console.log("[THREAD] Upload successful:",i.name),this.uploadStatus={message:`\u2713 ${i.name} uploaded (${(o.processedSize/1024).toFixed(1)} KB)`,isError:!1},setTimeout(()=>{this.uploadStatus.isError||(this.uploadStatus={message:"",isError:!1})},3e3),this.uploadFilesSequentially(t,e+1)):(console.error("[THREAD] Upload failed:",i.name,o.error),this.showUploadError(`Failed to upload ${i.name}: ${o.error}`))},error:o=>{console.error("[THREAD] Upload error:",i.name,o),this.showUploadError(`Failed to upload ${i.name}: ${o.message||"Unknown error"}`)}})}showUploadError(t){this.uploadStatus={message:t,isError:!0},setTimeout(()=>{this.uploadStatus={message:"",isError:!1}},5e3)}uploadFilesToExchangeSpace(t){return ie(this,null,function*(){for(let e of t){console.log("[THREAD] Uploading to exchange space:",e.name),this.uploadStatus={message:`Uploading ${e.name}...`,isError:!1};let i=yield this.fileExchangeState.uploadFile(e);if(i.success)console.log("[THREAD] Upload to exchange space successful:",e.name),this.uploadStatus={message:`\u2713 ${e.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:",e.name,i.error),this.showUploadError(`Failed to upload ${e.name}: ${i.error}`);break}}})}subscribeToFirstInvite(){console.log("[THREAD] Subscribing to wait for InviteEvent"),this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(t=>{if(t&&this.pendingFirstMessage){console.log("[THREAD] Received InviteEvent, sending pending message");let e=this.pendingFirstMessage;this.pendingFirstMessage=null,this.codayService.sendMessage(e)}}))}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?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(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-thread"]],viewQuery:function(e,i){if(e&1&&ne(kC,5),e&2){let o;W(o=U())&&(i.inputSection=o.first)}},inputs:{projectName:"projectName",threadId:"threadId"},features:[Le],decls:19,vars:13,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"],[1,"connection-status"],[1,"chat-wrapper"],[1,"chat-center"],[3,"copyRequested","stopRequested","messages","streamingText","isThinking"],[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"],["mode","side","position","end",3,"closed","opened"],[3,"closeDrawer","projectName","threadId"],[1,"drag-overlay"],["matFab","","type","button",1,"file-drawer-toggle-btn",3,"click","matBadge","title"],[1,"upload-status"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","stopRequested","filesPasted","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"],[1,"choice-overlay",3,"choiceSelected","options","labelHtml","isVisible"],[1,"drag-overlay-content"],[1,"drag-icon"],[1,"drag-text"],[1,"drag-hint"]],template:function(e,i){if(e&1){let o=E();s(0,"div",1),_("dragenter",function(a){return v(o),y(i.onDragEnter(a))})("dragover",function(a){return v(o),y(i.onDragOver(a))})("dragleave",function(a){return v(o),y(i.onDragLeave(a))})("drop",function(a){return v(o),y(i.onDrop(a))}),s(1,"mat-drawer-container",2)(2,"mat-drawer-content")(3,"div",3),w(4,MC,3,5,"button",4),w(5,EC,2,2,"div",5),s(6,"div",6)(7,"div",7)(8,"app-chat-history",8),_("copyRequested",function(a){return v(o),y(i.onCopyMessage(a))})("stopRequested",function(){return v(o),y(i.onStopRequested())}),c(),w(9,TC,2,3,"div",9),c()(),s(10,"div",10,0)(12,"div",11)(13,"div",12),w(14,PC,1,5,"app-chat-textarea",13),w(15,OC,1,3,"app-choice-select",14),c()()()()(),s(16,"mat-drawer",15),_("closed",function(){return v(o),y(i.closeFileDrawer())}),s(17,"app-file-exchange-drawer",16),_("closeDrawer",function(){return v(o),y(i.closeFileDrawer())}),c()()(),w(18,AC,8,0,"div",17),c()}e&2&&(m(),x("hasBackdrop",!1),m(3),S(i.isFileDrawerOpen?-1:4),m(),S(i.showConnectionStatus&&i.connectionStatus&&!i.connectionStatus.connected?5:-1),m(3),x("messages",i.messages)("streamingText",i.streamingText)("isThinking",i.isThinking),m(),S(i.uploadStatus.message?9:-1),m(5),S(i.currentChoice?-1:14),m(),S(i.currentChoice?15:-1),m(),x("opened",i.isFileDrawerOpen),m(),x("projectName",i.projectName)("threadId",i.threadId),m(),S(i.isDragOver?18:-1))},dependencies:[xl,mr,er,Il,Nl,wa,Sa,Cr,Qe,xe,xt,ss,$g,Ug],styles:[".drag-drop-wrapper[_ngcontent-%COMP%]{height:100vh;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}@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:100vh;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:35vw;max-width:90vw;box-shadow:-2px 0 8px #0000001a}@media (max-width: 768px){.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw}}.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 1rem;display:flex;flex-direction:column;gap:1rem}.upload-status[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:8px;background:var(--color-primary-light);color:var(--color-text);text-align:center;font-size:.9rem;margin-top:1rem}.upload-status.error[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.input-section[_ngcontent-%COMP%]{flex-shrink:0;width:100%;padding:1rem 0;background:var(--color-background)}.input-center[_ngcontent-%COMP%]{max-width:800px;width:100%;margin:0 auto;padding:0 1rem}.input-glass[_ngcontent-%COMP%]{position:relative;background:transparent;border-radius:12px;display:flex;flex-direction:column}.choice-overlay[_ngcontent-%COMP%]{width:100%;background:var(--color-bg-solid);border-radius:12px;padding:1.5rem;box-shadow:0 4px 12px #00000026}.drag-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;background:#000000b3;z-index:10000;display:flex;align-items:center;justify-content:center;pointer-events:none}.drag-overlay-content[_ngcontent-%COMP%]{text-align:center;color:#fff;padding:2rem;border:3px dashed white;border-radius:12px;background:#00000080}.drag-icon[_ngcontent-%COMP%]{font-size:4rem;margin-bottom:1rem}.drag-text[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:500}.drag-hint[_ngcontent-%COMP%]{font-size:.9rem;margin-top:.5rem;opacity:.8}@media (max-width: 768px){.chat-center[_ngcontent-%COMP%], .input-center[_ngcontent-%COMP%]{padding:0 .5rem}.drag-text[_ngcontent-%COMP%]{font-size:1.2rem}.drag-icon[_ngcontent-%COMP%]{font-size:3rem}.file-drawer-container[_ngcontent-%COMP%] .mat-drawer{width:100vw;max-width:100vw}.file-drawer-toggle-btn[_ngcontent-%COMP%]{top:.75rem!important;right:.75rem!important}}@media print{.connection-status[_ngcontent-%COMP%], .input-section[_ngcontent-%COMP%], .drag-overlay[_ngcontent-%COMP%], .file-drawer-toggle-btn[_ngcontent-%COMP%], .file-drawer-container[_ngcontent-%COMP%]{display:none!important}.chat-wrapper[_ngcontent-%COMP%]{overflow:visible;height:auto}.thread-container[_ngcontent-%COMP%]{height:auto}}"]})};var qg=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le,le]})}return n})();var Gg=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le]})}return n})();var Ki=class n{http=d(Ye);getUserConfig(){return this.http.get("/api/config/user").pipe(ct(t=>console.log("[CONFIG-API] User config retrieved:",t)))}updateUserConfig(t){return this.http.put("/api/config/user",t).pipe(ct(e=>console.log("[CONFIG-API] User config updated:",e)))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Sr=class n{currentThemeSubject=new se("light");currentTheme$=this.currentThemeSubject.asObservable();preferences=d(st);constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}initializeTheme(){let t=this.preferences.getPreference("theme","light")??"light";console.log("[THEME] Loaded saved theme:",t),this.applyTheme(t),setTimeout(()=>{let e=this.preferences.getPreference("theme","light")??"light";e!==t&&(console.log("[THEME] Theme updated after async load:",e),this.applyTheme(e))},100)}setTheme(t){this.preferences.setPreference("theme",t),this.applyTheme(t)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(t){if(console.log("[THEME] Applying theme:",t),this.currentThemeSubject.next(t),t==="system")if(typeof window<"u"&&window.matchMedia){let i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";console.log("[THEME] System theme resolved to:",i),this.setDocumentTheme(i)}else console.log("[THEME] matchMedia not available, defaulting to light theme"),this.setDocumentTheme("light");else this.setDocumentTheme(t)}setDocumentTheme(t){console.log("[THEME] Setting document theme to:",t),typeof document<"u"&&document.documentElement&&(t==="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",t=>{this.getCurrentTheme()==="system"&&this.setDocumentTheme(t.matches?"dark":"light")})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var DC=["mat-internal-form-field",""],IC=["*"],jl=(()=>{class n{labelPosition;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(i,o){i&2&&A("mdc-form-field--align-end",o.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:DC,ngContentSelectors:IC,decls:1,vars:0,template:function(i,o){i&1&&(He(),he(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}
|
|
366
|
+
`],encapsulation:2,changeDetection:0})}return n})();var RC=["switch"],FC=["*"];function NC(n,t){n&1&&(s(0,"span",11),on(),s(1,"svg",13),F(2,"path",14),c(),s(3,"svg",15),F(4,"path",16),c()())}var VC=new ee("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),zl=class{source;checked;constructor(t,e){this.source=t,this.checked=e}},xo=(()=>{class n{_elementRef=d(K);_focusMonitor=d(Vi);_changeDetectorRef=d(Re);defaults=d(VC);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new zl(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=We();_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new H;toggleChange=new H;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){d(Lt).load(Rn);let e=d(new On("tabindex"),{optional:!0}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=d(Fe).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new zl(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(i,o){if(i&1&&ne(RC,5),i&2){let r;W(r=U())&&(o._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,o){i&2&&(ei("id",o.id),Y("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),rn(o.color?"mat-"+o.color:""),A("mat-mdc-slide-toggle-focused",o._focused)("mat-mdc-slide-toggle-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",J],color:"color",disabled:[2,"disabled","disabled",J],disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:_i(e)],checked:[2,"checked","checked",J],hideIcon:[2,"hideIcon","hideIcon",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[pe([{provide:Kt,useExisting:at(()=>n),multi:!0},{provide:Ti,useExisting:n,multi:!0}]),Le],ngContentSelectors:FC,decls:14,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mat-mdc-slide-toggle-touch-target"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,o){if(i&1){let r=E();He(),s(0,"div",1)(1,"button",2,0),_("click",function(){return v(r),y(o._handleClick())}),F(3,"div",3)(4,"span",4),s(5,"span",5)(6,"span",6)(7,"span",7),F(8,"span",8),c(),s(9,"span",9),F(10,"span",10),c(),w(11,NC,5,0,"span",11),c()()(),s(12,"label",12),_("click",function(l){return v(r),y(l.stopPropagation())}),he(13),c()()}if(i&2){let r=ti(2);x("labelPosition",o.labelPosition),m(),A("mdc-switch--selected",o.checked)("mdc-switch--unselected",!o.checked)("mdc-switch--checked",o.checked)("mdc-switch--disabled",o.disabled)("mat-mdc-slide-toggle-disabled-interactive",o.disabledInteractive),x("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("disabled",o.disabled&&!o.disabledInteractive),Y("id",o.buttonId)("name",o.name)("aria-label",o.ariaLabel)("aria-labelledby",o._getAriaLabelledBy())("aria-describedby",o.ariaDescribedby)("aria-required",o.required||null)("aria-checked",o.checked)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),m(9),x("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),m(),S(o.hideIcon?-1:11),m(),x("for",o.buttonId),Y("id",o._labelId)}},dependencies:[In,jl],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-slide-toggle-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-slide-toggle-touch-target-size, 48px);width:100%;transform:translate(-50%, -50%);display:var(--mat-slide-toggle-touch-target-display, block)}[dir=rtl] .mat-mdc-slide-toggle-touch-target{left:auto;right:50%;transform:translate(50%, -50%)}
|
|
367
|
+
`],encapsulation:2,changeDetection:0})}return n})(),Bl=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[xo,le,le]})}return n})();var LC=(n,t)=>t.code,jC=(n,t)=>t.name+t.lang;function zC(n,t){n&1&&(s(0,"div",15)(1,"mat-icon",32),h(2,"warning"),c(),s(3,"span",33),h(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),c()())}function BC(n,t){if(n&1&&(s(0,"option",18),h(1),c()),n&2){let e=t.$implicit;x("value",e.code),m(),Tn("",e.flag," ",e.label)}}function HC(n,t){n&1&&(s(0,"option",25),h(1,"Loading voices..."),c())}function WC(n,t){n&1&&(s(0,"option",25),h(1,"No voice available"),c())}function UC(n,t){if(n&1&&(s(0,"option",18),h(1),c()),n&2){let e=t.$implicit;x("value",e.name+"|"+e.lang),m(),ae(" ",e.displayName," ")}}var ka=class n{destroy$=new D;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=d(st);voiceSynthesisService=d(pr);themeService=d(Sr);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(N(this.destroy$)).subscribe(t=>{this.selectedTheme=t}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t}),this.preferencesService.enterToSend$.pipe(N(this.destroy$)).subscribe(t=>{this.useEnterToSend=t}),this.preferencesService.printTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t}),this.preferencesService.hideTechnicalMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t}),this.preferencesService.hideWarningMessages$.pipe(N(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t}),this.preferencesService.voiceAnnounceEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t}),this.preferencesService.voiceMode$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceMode=t}),this.preferencesService.voiceReadFullText$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t}),this.preferencesService.voiceVolume$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100)}),this.preferencesService.voiceRate$.pipe(N(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100)}),this.preferencesService.selectedVoice$.pipe(N(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t}),this.preferencesService.voiceLanguage$.pipe(N(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t}),this.preferencesService.notificationSoundEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t}),this.preferencesService.browserNotificationEnabled$.pipe(N(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,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 t=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",t,")"),this.preferencesService.setHideTechnicalMessages(t)}onShowWarningMessagesChange(){let t=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",t,")"),this.preferencesService.setHideWarningMessages(t)}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 t=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",t),this.preferencesService.setVoiceVolume(t)}onVoiceRateChange(){let t=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",t),this.preferencesService.setVoiceRate(t)}loadAvailableVoices(){return ie(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(t){console.error("[OPTIONS] Error loading voices:",t),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(e){return new(e||n)};static \u0275cmp=M({type:n,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(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),h(4,"palette"),c(),s(5,"span"),h(6,"Appearance"),c()(),s(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),j("ngModelChange",function(r){return L(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),c(),F(11,"span",7),h(12," Light "),c(),s(13,"label",5)(14,"input",8),j("ngModelChange",function(r){return L(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),c(),F(15,"span",7),h(16," Dark "),c(),s(17,"label",5)(18,"input",9),j("ngModelChange",function(r){return L(i.selectedTheme,r)||(i.selectedTheme=r),r}),_("change",function(){return i.onThemeChange()}),c(),F(19,"span",7),h(20," System "),c()()()(),s(21,"div",1)(22,"div",2)(23,"mat-icon"),h(24,"chat_bubble_outline"),c(),s(25,"span"),h(26,"Messaging"),c()(),s(27,"div",3)(28,"span",10),h(29,"Send message behavior:"),c(),s(30,"div",4)(31,"label",5)(32,"input",11),j("ngModelChange",function(r){return L(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),_("change",function(){return i.onEnterToSendChange()}),c(),F(33,"span",7),h(34," Enter to send "),c(),s(35,"label",5)(36,"input",11),j("ngModelChange",function(r){return L(i.useEnterToSend,r)||(i.useEnterToSend=r),r}),_("change",function(){return i.onEnterToSendChange()}),c(),F(37,"span",7),h(38," Enter for new line "),c()()(),s(39,"div",3)(40,"div",12)(41,"span",10),h(42,"Show technical messages"),c(),s(43,"mat-slide-toggle",13),j("ngModelChange",function(r){return L(i.showTechnicalMessages,r)||(i.showTechnicalMessages=r),r}),_("change",function(){return i.onShowTechnicalMessagesChange()}),c()()(),s(44,"div",3)(45,"div",12)(46,"span",10),h(47,"Show warning messages"),c(),s(48,"mat-slide-toggle",13),j("ngModelChange",function(r){return L(i.showWarningMessages,r)||(i.showWarningMessages=r),r}),_("change",function(){return i.onShowWarningMessagesChange()}),c()()(),s(49,"div",3)(50,"div",12)(51,"span",10),h(52,"Include technical messages in print"),c(),s(53,"mat-slide-toggle",13),j("ngModelChange",function(r){return L(i.printTechnicalMessages,r)||(i.printTechnicalMessages=r),r}),_("change",function(){return i.onPrintTechnicalMessagesChange()}),c()()()(),s(54,"div",1)(55,"div",2)(56,"mat-icon"),h(57,"notifications"),c(),s(58,"span"),h(59,"Notifications"),c()(),s(60,"div",3)(61,"div",12)(62,"span",10),h(63,"Notify when the agent answers or requests input"),c(),s(64,"mat-slide-toggle",13),j("ngModelChange",function(r){return L(i.agentNotificationEnabled,r)||(i.agentNotificationEnabled=r),r}),_("change",function(){return i.onAgentNotificationEnabledChange()}),c()()(),s(65,"div",3)(66,"div",12)(67,"span",10),h(68,"Notification sound"),c(),s(69,"mat-slide-toggle",14),j("ngModelChange",function(r){return L(i.notificationSoundEnabled,r)||(i.notificationSoundEnabled=r),r}),_("change",function(){return i.onNotificationSoundEnabledChange()}),c()()(),s(70,"div",3)(71,"div",12)(72,"span",10),h(73,"Browser notification"),c(),s(74,"mat-slide-toggle",14),j("ngModelChange",function(r){return L(i.browserNotificationEnabled,r)||(i.browserNotificationEnabled=r),r}),_("change",function(){return i.onBrowserNotificationEnabledChange()}),c()(),w(75,zC,5,0,"div",15),c()(),s(76,"div",1)(77,"div",2)(78,"mat-icon"),h(79,"record_voice_over"),c(),s(80,"span"),h(81,"Voice & Speech"),c()(),s(82,"div",3)(83,"label",16),h(84,"Voice recognition language:"),c(),s(85,"select",17),j("ngModelChange",function(r){return L(i.selectedVoiceLanguage,r)||(i.selectedVoiceLanguage=r),r}),_("change",function(){return i.onVoiceLanguageChange()}),Oe(86,BC,2,3,"option",18,LC),c()(),s(88,"div",3)(89,"span",10),h(90,"Automatic announcement:"),c(),s(91,"div",4)(92,"label",5)(93,"input",19),j("ngModelChange",function(r){return L(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),_("change",function(){return i.onVoiceAnnounceEnabledChange()}),c(),F(94,"span",7),h(95," Enabled "),c(),s(96,"label",5)(97,"input",19),j("ngModelChange",function(r){return L(i.voiceAnnounceEnabled,r)||(i.voiceAnnounceEnabled=r),r}),_("change",function(){return i.onVoiceAnnounceEnabledChange()}),c(),F(98,"span",7),h(99," Disabled "),c()()(),s(100,"div",3)(101,"span",10),h(102,"Voice mode:"),c(),s(103,"div",4)(104,"label",5)(105,"input",20),j("ngModelChange",function(r){return L(i.voiceMode,r)||(i.voiceMode=r),r}),_("change",function(){return i.onVoiceModeChange()}),c(),F(106,"span",7),h(107," Voice synthesis "),c(),s(108,"label",5)(109,"input",21),j("ngModelChange",function(r){return L(i.voiceMode,r)||(i.voiceMode=r),r}),_("change",function(){return i.onVoiceModeChange()}),c(),F(110,"span",7),h(111," Sound notification "),c()()(),s(112,"div",3)(113,"span",10),h(114,"Message reading:"),c(),s(115,"div",4)(116,"label",5)(117,"input",22),j("ngModelChange",function(r){return L(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),_("change",function(){return i.onVoiceReadFullTextChange()}),c(),F(118,"span",7),h(119," Full message "),c(),s(120,"label",5)(121,"input",22),j("ngModelChange",function(r){return L(i.voiceReadFullText,r)||(i.voiceReadFullText=r),r}),_("change",function(){return i.onVoiceReadFullTextChange()}),c(),F(122,"span",7),h(123," First paragraphs only "),c()()(),s(124,"div",3)(125,"label",23),h(126,"Selected voice:"),c(),s(127,"select",24),j("ngModelChange",function(r){return L(i.selectedVoiceId,r)||(i.selectedVoiceId=r),r}),_("change",function(){return i.onSelectedVoiceChange()}),w(128,HC,2,0,"option",25),w(129,WC,2,0,"option",25),Oe(130,UC,2,2,"option",18,jC),c(),F(132,"div",10),s(133,"a",26),_("click",function(){return i.testVoice()}),s(134,"span",27),h(135,"Test voice"),c()()(),s(136,"div",3)(137,"label",28),h(138),c(),s(139,"input",29),j("ngModelChange",function(r){return L(i.voiceVolume,r)||(i.voiceVolume=r),r}),_("input",function(){return i.onVoiceVolumeChange()}),c()(),s(140,"div",3)(141,"label",30),h(142),c(),s(143,"input",31),j("ngModelChange",function(r){return L(i.voiceRate,r)||(i.voiceRate=r),r}),_("input",function(){return i.onVoiceRateChange()}),c()()()()),e&2&&(m(10),V("ngModel",i.selectedTheme),m(4),V("ngModel",i.selectedTheme),m(4),V("ngModel",i.selectedTheme),m(14),x("value",!0),V("ngModel",i.useEnterToSend),m(4),x("value",!1),V("ngModel",i.useEnterToSend),m(7),V("ngModel",i.showTechnicalMessages),m(5),V("ngModel",i.showWarningMessages),m(5),V("ngModel",i.printTechnicalMessages),m(11),V("ngModel",i.agentNotificationEnabled),m(5),V("ngModel",i.notificationSoundEnabled),x("disabled",!i.agentNotificationEnabled),m(5),V("ngModel",i.browserNotificationEnabled),x("disabled",!i.agentNotificationEnabled||i.browserNotificationDenied),m(),S(i.browserNotificationDenied?75:-1),m(10),V("ngModel",i.selectedVoiceLanguage),m(),Ae(i.voiceLanguageOptions),m(7),x("value",!0),V("ngModel",i.voiceAnnounceEnabled),m(4),x("value",!1),V("ngModel",i.voiceAnnounceEnabled),m(8),V("ngModel",i.voiceMode),m(4),V("ngModel",i.voiceMode),m(8),x("value",!0),V("ngModel",i.voiceReadFullText),m(4),x("value",!1),V("ngModel",i.voiceReadFullText),m(6),V("ngModel",i.selectedVoiceId),x("disabled",i.loadingVoices||i.availableVoices.length===0),m(),S(i.loadingVoices?128:-1),m(),S(!i.loadingVoices&&i.availableVoices.length===0?129:-1),m(),Ae(i.availableVoices),m(8),ae("Volume: ",i.voiceVolume,"%"),m(),V("ngModel",i.voiceVolume),m(3),ae("Speed: ",i.voiceRate,"%"),m(),V("ngModel",i.voiceRate))},dependencies:[Ke,dl,ml,ze,Wd,cl,uo,Xe,Ue,xe,xo],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 $C=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(i,o){},styles:[`textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}
|
|
368
|
+
`],encapsulation:2,changeDetection:0})}return n})(),qC={passive:!0},Qg=(()=>{class n{_platform=d(rt);_ngZone=d(me);_renderer=d(gi).createRenderer(null,null);_styleLoader=d(Lt);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return jm;this._styleLoader.load($C);let i=zr(e),o=this._monitoredElements.get(i);if(o)return o.subject;let r=new D,a="cdk-text-field-autofilled",l=u=>{u.animationName==="cdk-text-field-autofill-start"&&!i.classList.contains(a)?(i.classList.add(a),this._ngZone.run(()=>r.next({target:u.target,isAutofilled:!0}))):u.animationName==="cdk-text-field-autofill-end"&&i.classList.contains(a)&&(i.classList.remove(a),this._ngZone.run(()=>r.next({target:u.target,isAutofilled:!1})))},p=this._ngZone.runOutsideAngular(()=>(i.classList.add("cdk-text-field-autofill-monitored"),this._renderer.listen(i,"animationstart",l,qC)));return this._monitoredElements.set(i,{subject:r,unlisten:p}),r}stopMonitoring(e){let i=zr(e),o=this._monitoredElements.get(i);o&&(o.unlisten(),o.subject.complete(),i.classList.remove("cdk-text-field-autofill-monitored"),i.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(i))}ngOnDestroy(){this._monitoredElements.forEach((e,i)=>this.stopMonitoring(i))}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Xg=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({})}return n})();var Kg=new ee("MAT_INPUT_VALUE_ACCESSOR");var im=class{_box;_destroyed=new D;_resizeSubject=new D;_resizeObserver;_elementObservables=new Map;constructor(t){this._box=t,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)))}observe(t){return this._elementObservables.has(t)||this._elementObservables.set(t,new oi(e=>{let i=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(t,{box:this._box}),()=>{this._resizeObserver?.unobserve(t),i.unsubscribe(),this._elementObservables.delete(t)}}).pipe(ue(e=>e.some(i=>i.target===t)),Mn({bufferSize:1,refCount:!0}),N(this._destroyed))),this._elementObservables.get(t)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}},Zg=(()=>{class n{_cleanupErrorListener;_observers=new Map;_ngZone=d(me);constructor(){typeof ResizeObserver<"u"}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,i){let o=i?.box||"content-box";return this._observers.has(o)||this._observers.set(o,new im(o)),this._observers.get(o).observe(e)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var GC=["notch"],YC=["matFormFieldNotchedOutline",""],QC=["*"],Jg=["iconPrefixContainer"],ef=["textPrefixContainer"],tf=["iconSuffixContainer"],nf=["textSuffixContainer"],XC=["textField"],KC=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],ZC=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function JC(n,t){n&1&&F(0,"span",21)}function ex(n,t){if(n&1&&(s(0,"label",20),he(1,1),w(2,JC,1,0,"span",21),c()),n&2){let e=g(2);x("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),Y("for",e._control.disableAutomaticLabeling?null:e._control.id),m(2),S(!e.hideRequiredMarker&&e._control.required?2:-1)}}function tx(n,t){if(n&1&&w(0,ex,3,5,"label",20),n&2){let e=g();S(e._hasFloatingLabel()?0:-1)}}function ix(n,t){n&1&&F(0,"div",7)}function nx(n,t){}function ox(n,t){if(n&1&&Ge(0,nx,0,0,"ng-template",13),n&2){g(2);let e=ti(1);x("ngTemplateOutlet",e)}}function rx(n,t){if(n&1&&(s(0,"div",9),w(1,ox,1,1,null,13),c()),n&2){let e=g();x("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),m(),S(e._forceDisplayInfixLabel()?-1:1)}}function ax(n,t){n&1&&(s(0,"div",10,2),he(2,2),c())}function sx(n,t){n&1&&(s(0,"div",11,3),he(2,3),c())}function lx(n,t){}function cx(n,t){if(n&1&&Ge(0,lx,0,0,"ng-template",13),n&2){g();let e=ti(1);x("ngTemplateOutlet",e)}}function dx(n,t){n&1&&(s(0,"div",14,4),he(2,4),c())}function mx(n,t){n&1&&(s(0,"div",15,5),he(2,5),c())}function hx(n,t){n&1&&F(0,"div",16)}function px(n,t){n&1&&(s(0,"div",18),he(1,6),c())}function ux(n,t){if(n&1&&(s(0,"mat-hint",22),h(1),c()),n&2){let e=g(2);x("id",e._hintLabelId),m(),B(e.hintLabel)}}function gx(n,t){if(n&1&&(s(0,"div",19),w(1,ux,2,2,"mat-hint",22),he(2,7),F(3,"div",23),he(4,8),c()),n&2){let e=g();m(),S(e.hintLabel?1:-1)}}var Ut=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["mat-label"]]})}return n})(),fx=new ee("MatError");var wn=(()=>{class n{align="start";id=d(Fe).getId("mat-mdc-hint-");static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(i,o){i&2&&(ei("id",o.id),Y("align",null),A("mat-mdc-form-field-hint-end",o.align==="end"))},inputs:{align:"align",id:"id"}})}return n})(),df=new ee("MatPrefix"),wo=(()=>{class n{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[pe([{provide:df,useExisting:n}])]})}return n})(),_x=new ee("MatSuffix");var mf=new ee("FloatingLabelParent"),of=(()=>{class n{_elementRef=d(K);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=d(Zg);_ngZone=d(me);_parent=d(mf);_resizeSubscription=new Di;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return bx(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(i,o){i&2&&A("mdc-floating-label--float-above",o.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return n})();function bx(n){let t=n;if(t.offsetParent!==null)return t.scrollWidth;let e=t.cloneNode(!0);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let i=e.scrollWidth;return e.remove(),i}var rf="mdc-line-ripple--active",Hl="mdc-line-ripple--deactivating",af=(()=>{class n{_elementRef=d(K);_cleanupTransitionEnd;constructor(){let e=d(me),i=d(ot);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=i.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){let e=this._elementRef.nativeElement.classList;e.remove(Hl),e.add(rf)}deactivate(){this._elementRef.nativeElement.classList.add(Hl)}_handleTransitionEnd=e=>{let i=this._elementRef.nativeElement.classList,o=i.contains(Hl);e.propertyName==="opacity"&&o&&i.remove(rf,Hl)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return n})(),sf=(()=>{class n{_elementRef=d(K);_ngZone=d(me);open=!1;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,i=e.querySelector(".mdc-floating-label");i?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(i.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>i.style.transitionDuration="")}))):e.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){let i=this._notch.nativeElement;!this.open||!e?i.style.width="":i.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(i,o){if(i&1&&ne(GC,5),i&2){let r;W(r=U())&&(o._notch=r.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(i,o){i&2&&A("mdc-notched-outline--notched",o.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:YC,ngContentSelectors:QC,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(i,o){i&1&&(He(),eo(0,"div",1),ri(1,"div",2,0),he(3),ai(),eo(4,"div",3))},encapsulation:2,changeDetection:0})}return n})(),Ma=(()=>{class n{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n})}return n})();var Ea=new ee("MatFormField"),vx=new ee("MAT_FORM_FIELD_DEFAULT_OPTIONS"),lf="fill",yx="auto",cf="fixed",Cx="translateY(-50%)",$t=(()=>{class n{_elementRef=d(K);_changeDetectorRef=d(Re);_platform=d(rt);_idGenerator=d(Fe);_ngZone=d(me);_defaults=d(vx,{optional:!0});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=Lr("iconPrefixContainer");_textPrefixContainerSignal=Lr("textPrefixContainer");_iconSuffixContainerSignal=Lr("iconSuffixContainer");_textSuffixContainerSignal=Lr("textSuffixContainer");_prefixSuffixContainers=ft(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=sh(Ut);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=Dt(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||yx}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let i=e||this._defaults?.appearance||lf;this._appearanceSignal.set(i)}_appearanceSignal=Te(lf);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||cf}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||cf}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e}_destroyed=new D;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=We();constructor(){let e=this._defaults,i=d(Ct);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),Vo(()=>this._currentDirection=i.valueSignal()),this._syncOutlineLabelOffset()}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=ft(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){let i=this._control,o="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(o+e.controlType),i.controlType&&this._elementRef.nativeElement.classList.add(o+i.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=i.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=i.stateChanges.pipe(Vt([void 0,void 0]),ve(()=>[i.errorState,i.userAriaDescribedBy]),Fo(),ue(([[r,a],[l,p]])=>r!==l||a!==p)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),i.ngControl&&i.ngControl.valueChanges&&(this._valueChanges=i.ngControl.valueChanges.pipe(N(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Ii(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){this._control}_updateFocusState(){let e=this._control.focused;e&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!e&&(this._isFocused||this._isFocused===null)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",e),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",e)}_syncOutlineLabelOffset(){lh({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset())});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"})}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())})}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=ft(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():!1}_shouldForward(e){let i=this._control?this._control.ngControl:null;return i&&i[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth())}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){this._hintChildren}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let r=this._hintChildren?this._hintChildren.find(l=>l.align==="start"):null,a=this._hintChildren?this._hintChildren.find(l=>l.align==="end"):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id)}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));let i=this._control.describedByIds,o;if(i){let r=this._describedByIds||e;o=e.concat(i.filter(a=>a&&!r.includes(a)))}else o=e;this._control.setDescribedByIds(o),this._describedByIds=e}}_getOutlinedLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,i=this._textPrefixContainer?.nativeElement,o=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,l=i?.getBoundingClientRect().width??0,p=o?.getBoundingClientRect().width??0,u=r?.getBoundingClientRect().width??0,b=this._currentDirection==="rtl"?"-1":"1",C=`${a+l}px`,P=`calc(${b} * (${C} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,k=`var(--mat-mdc-form-field-label-transform, ${Cx} translateX(${P}))`,z=a+l+p+u;return[k,z]}_writeOutlinedLabelStyles(e){if(e!==null){let[i,o]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=i),o!==null&&this._notchedOutline?._setMaxWidth(o)}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let i=e.getRootNode();return i&&i!==e}return document.documentElement.contains(e)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-form-field"]],contentQueries:function(i,o,r){if(i&1&&(nh(r,o._labelChild,Ut,5),Tt(r,Ma,5),Tt(r,df,5),Tt(r,_x,5),Tt(r,fx,5),Tt(r,wn,5)),i&2){yc();let a;W(a=U())&&(o._formFieldControl=a.first),W(a=U())&&(o._prefixChildren=a),W(a=U())&&(o._suffixChildren=a),W(a=U())&&(o._errorChildren=a),W(a=U())&&(o._hintChildren=a)}},viewQuery:function(i,o){if(i&1&&(Nr(o._iconPrefixContainerSignal,Jg,5),Nr(o._textPrefixContainerSignal,ef,5),Nr(o._iconSuffixContainerSignal,tf,5),Nr(o._textSuffixContainerSignal,nf,5),ne(XC,5),ne(Jg,5),ne(ef,5),ne(tf,5),ne(nf,5),ne(of,5),ne(sf,5),ne(af,5)),i&2){yc(4);let r;W(r=U())&&(o._textField=r.first),W(r=U())&&(o._iconPrefixContainer=r.first),W(r=U())&&(o._textPrefixContainer=r.first),W(r=U())&&(o._iconSuffixContainer=r.first),W(r=U())&&(o._textSuffixContainer=r.first),W(r=U())&&(o._floatingLabel=r.first),W(r=U())&&(o._notchedOutline=r.first),W(r=U())&&(o._lineRipple=r.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(i,o){i&2&&A("mat-mdc-form-field-label-always-float",o._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",o._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",o._hasIconSuffix)("mat-form-field-invalid",o._control.errorState)("mat-form-field-disabled",o._control.disabled)("mat-form-field-autofilled",o._control.autofilled)("mat-form-field-appearance-fill",o.appearance=="fill")("mat-form-field-appearance-outline",o.appearance=="outline")("mat-form-field-hide-placeholder",o._hasFloatingLabel()&&!o._shouldLabelFloat())("mat-primary",o.color!=="accent"&&o.color!=="warn")("mat-accent",o.color==="accent")("mat-warn",o.color==="warn")("ng-untouched",o._shouldForward("untouched"))("ng-touched",o._shouldForward("touched"))("ng-pristine",o._shouldForward("pristine"))("ng-dirty",o._shouldForward("dirty"))("ng-valid",o._shouldForward("valid"))("ng-invalid",o._shouldForward("invalid"))("ng-pending",o._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[pe([{provide:Ea,useExisting:n},{provide:mf,useExisting:n}])],ngContentSelectors:ZC,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],["aria-atomic","true","aria-live","polite",1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(i,o){if(i&1){let r=E();He(KC),Ge(0,tx,1,1,"ng-template",null,0,Ya),s(2,"div",6,1),_("click",function(l){return v(r),y(o._control.onContainerClick(l))}),w(4,ix,1,0,"div",7),s(5,"div",8),w(6,rx,2,2,"div",9),w(7,ax,3,0,"div",10),w(8,sx,3,0,"div",11),s(9,"div",12),w(10,cx,1,1,null,13),he(11),c(),w(12,dx,3,0,"div",14),w(13,mx,3,0,"div",15),c(),w(14,hx,1,0,"div",16),c(),s(15,"div",17),w(16,px,2,0,"div",18)(17,gx,5,1,"div",19),c()}if(i&2){let r;m(2),A("mdc-text-field--filled",!o._hasOutline())("mdc-text-field--outlined",o._hasOutline())("mdc-text-field--no-label",!o._hasFloatingLabel())("mdc-text-field--disabled",o._control.disabled)("mdc-text-field--invalid",o._control.errorState),m(2),S(!o._hasOutline()&&!o._control.disabled?4:-1),m(2),S(o._hasOutline()?6:-1),m(),S(o._hasIconPrefix?7:-1),m(),S(o._hasTextPrefix?8:-1),m(2),S(!o._hasOutline()||o._forceDisplayInfixLabel()?10:-1),m(2),S(o._hasTextSuffix?12:-1),m(),S(o._hasIconSuffix?13:-1),m(),S(o._hasOutline()?-1:14),m(),A("mat-mdc-form-field-subscript-dynamic-size",o.subscriptSizing==="dynamic");let a=o._getSubscriptMessageType();m(),S((r=a)==="error"?16:r==="hint"?17:-1)}},dependencies:[of,sf,Ka,af,wn],styles:[`.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator,.mdc-text-field__input::-webkit-search-cancel-button{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-filled-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-filled-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-filled-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mat-form-field-outlined-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mat-form-field-outlined-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-outlined-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-filled-error-caret-color, var(--mat-sys-error))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mat-form-field-outlined-error-caret-color, var(--mat-sys-error))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-filled-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mat-form-field-outlined-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mat-form-field-filled-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mat-form-field-filled-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mat-form-field-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-filled-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-filled-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-filled-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-filled-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-filled-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mat-form-field-filled-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-filled-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-filled-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-filled-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mat-form-field-outlined-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mat-form-field-outlined-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mat-form-field-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mat-form-field-outlined-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mat-form-field-outlined-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mat-form-field-outlined-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mat-form-field-outlined-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-form-field-outlined-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-form-field-outlined-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-form-field-outlined-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-outline-color, var(--mat-sys-outline));border-width:var(--mat-form-field-outlined-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mat-form-field-outlined-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mat-form-field-outlined-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{max-width:min(100%,calc(100% - max(12px, var(--mat-form-field-outlined-container-shape, var(--mat-sys-corner-extra-small))) * 2))}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mat-form-field-filled-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mat-form-field-filled-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mat-form-field-filled-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mat-form-field-filled-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}
|
|
369
|
+
`],encapsulation:2,changeDetection:0})}return n})();var Wl=(()=>{class n{isErrorState(e,i){return!!(e&&e.invalid&&(e.touched||i&&i.submitted))}static \u0275fac=function(i){return new(i||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var kr=class{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(t,e,i,o,r){this._defaultMatcher=t,this.ngControl=e,this._parentFormGroup=i,this._parentForm=o,this._stateChanges=r}updateErrorState(){let t=this.errorState,e=this._parentFormGroup||this._parentForm,i=this.matcher||this._defaultMatcher,o=this.ngControl?this.ngControl.control:null,r=i?.isErrorState(o,e)??!1;r!==t&&(this.errorState=r,this._stateChanges.next())}};var ut=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le,yh,$t,le]})}return n})();var xx=["button","checkbox","file","hidden","image","radio","range","reset","submit"],wx=new ee("MAT_INPUT_CONFIG"),pi=(()=>{class n{_elementRef=d(K);_platform=d(rt);ngControl=d(Gi,{optional:!0,self:!0});_autofillMonitor=d(Qg);_ngZone=d(me);_formField=d(Ea,{optional:!0});_renderer=d(ot);_uid=d(Fe).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=d(wx,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new D;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=Dt(e),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(e){this._id=e||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(or.required)??!1}set required(e){this._required=Dt(e)}_required;get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&kc().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(e){e!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(e):this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=Dt(e)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(e=>kc().has(e));constructor(){let e=d(va,{optional:!0}),i=d(Ca,{optional:!0}),o=d(Wl),r=d(Kg,{optional:!0,self:!0}),a=this._elementRef.nativeElement,l=a.nodeName.toLowerCase();r?qa(r.value)?this._signalBasedValueAccessor=r:this._inputValueAccessor=r:this._inputValueAccessor=a,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(a,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new kr(o,this.ngControl,i,e,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect=l==="select",this._isTextarea=l==="textarea",this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=a.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&Vo(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),this.ngControl.disabled!==null&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(e){if(e!==this.focused){if(!this._isNativeSelect&&e&&this.disabled&&this.disabledInteractive){let i=this._elementRef.nativeElement;i.type==="number"?(i.type="text",i.setSelectionRange(0,0),i.type="number"):i.setSelectionRange(0,0)}this.focused=e,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){let e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){let e=this._getPlaceholder();if(e!==this._previousPlaceholder){let i=this._elementRef.nativeElement;this._previousPlaceholder=e,e?i.setAttribute("placeholder",e):i.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){xx.indexOf(this._type)>-1}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!this._isNeverEmpty()&&!this._elementRef.nativeElement.value&&!this._isBadInput()&&!this.autofilled}get shouldLabelFloat(){if(this._isNativeSelect){let e=this._elementRef.nativeElement,i=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&i&&i.label)}else return this.focused&&!this.disabled||!this.empty}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let i=this._elementRef.nativeElement;e.length?i.setAttribute("aria-describedby",e.join(" ")):i.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){let e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}_iOSKeyupListener=e=>{let i=e.target;!i.value&&i.selectionStart===0&&i.selectionEnd===0&&(i.setSelectionRange(1,1),i.setSelectionRange(0,0))};_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(i,o){i&1&&_("focus",function(){return o._focusChanged(!0)})("blur",function(){return o._focusChanged(!1)})("input",function(){return o._onInput()}),i&2&&(ei("id",o.id)("disabled",o.disabled&&!o.disabledInteractive)("required",o.required),Y("name",o.name||null)("readonly",o._getReadonlyAttribute())("aria-disabled",o.disabled&&o.disabledInteractive?"true":null)("aria-invalid",o.empty&&o.required?null:o.errorState)("aria-required",o.required)("id",o.id),A("mat-input-server",o._isServer)("mat-mdc-form-field-textarea-control",o._isInFormField&&o._isTextarea)("mat-mdc-form-field-input-control",o._isInFormField)("mat-mdc-input-disabled-interactive",o.disabledInteractive)("mdc-text-field__input",o._isInFormField)("mat-mdc-native-select-inline",o._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},exportAs:["matInput"],features:[pe([{provide:Ma,useExisting:n}]),Le]})}return n})(),Zt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le,ut,ut,Xg,le]})}return n})();var Sx=["tooltip"],nm=20;var om=new ee("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=d(fe);return()=>Hi(n,{scrollThrottle:nm})}});function uf(n){let t=d(fe);return()=>Hi(t,{scrollThrottle:nm})}var rm={provide:om,deps:[],useFactory:uf};function gf(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}var ff=new ee("mat-tooltip-default-options",{providedIn:"root",factory:gf});var hf="tooltip-panel",pf=bh({passive:!0}),kx=8,Mx=8,Ex=24,Tx=200,am=(()=>{class n{_elementRef=d(K);_ngZone=d(me);_platform=d(rt);_ariaDescriber=d(os);_focusMonitor=d(Vi);_dir=d(Ct);_injector=d(fe);_viewContainerRef=d(Zn);_animationsDisabled=We();_defaultOptions=d(ff,{optional:!0});_overlayRef;_tooltipInstance;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=_f;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(e){e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(e){this._positionAtOrigin=Dt(e),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(e){let i=Dt(e);this._disabled!==i&&(this._disabled=i,i?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(e){this._showDelay=bi(e)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(e){this._hideDelay=bi(e),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(e){let i=this._message;this._message=e!=null?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(i)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new D;_isDestroyed=!1;constructor(){let e=this._defaultOptions;e&&(this._showDelay=e.showDelay,this._hideDelay=e.hideDelay,e.position&&(this.position=e.position),e.positionAtOrigin&&(this.positionAtOrigin=e.positionAtOrigin),e.touchGestures&&(this.touchGestures=e.touchGestures),e.tooltipClass&&(this.tooltipClass=e.tooltipClass)),this._viewportMargin=kx}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(N(this._destroyed)).subscribe(e=>{e?e==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){let e=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([i,o])=>{e.removeEventListener(i,o,pf)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}show(e=this.showDelay,i){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let o=this._createOverlay(i);this._detach(),this._portal=this._portal||new Ci(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=o.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(N(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(e)}hide(e=this.hideDelay){let i=this._tooltipInstance;i&&(i.isVisible()?i.hide(e):(i._cancelPendingAnimations(),this._detach()))}toggle(e){this._isTooltipVisible()?this.hide():this.show(void 0,e)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(e){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!e)&&a._origin instanceof K)return this._overlayRef;this._detach()}let i=this._injector.get(cn).getAncestorScrollContainers(this._elementRef),o=`${this._cssClassPrefix}-${hf}`,r=Kr(this._injector,this.positionAtOrigin?e||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(i);return r.positionChanges.pipe(N(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=pn(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,o]:o,scrollStrategy:this._injector.get(om)(),disableAnimations:this._animationsDisabled}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(N(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(N(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(N(this._destroyed)).subscribe(a=>{this._isTooltipVisible()&&a.keyCode===27&&!vt(a)&&(a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(N(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(e){let i=e.getConfig().positionStrategy,o=this._getOrigin(),r=this._getOverlayPosition();i.withPositions([this._addOffset(q(q({},o.main),r.main)),this._addOffset(q(q({},o.fallback),r.fallback))])}_addOffset(e){let i=Mx,o=!this._dir||this._dir.value=="ltr";return e.originY==="top"?e.offsetY=-i:e.originY==="bottom"?e.offsetY=i:e.originX==="start"?e.offsetX=o?-i:i:e.originX==="end"&&(e.offsetX=o?i:-i),e}_getOrigin(){let e=!this._dir||this._dir.value=="ltr",i=this.position,o;i=="above"||i=="below"?o={originX:"center",originY:i=="above"?"top":"bottom"}:i=="before"||i=="left"&&e||i=="right"&&!e?o={originX:"start",originY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(o={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(o.originX,o.originY);return{main:o,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let e=!this._dir||this._dir.value=="ltr",i=this.position,o;i=="above"?o={overlayX:"center",overlayY:"bottom"}:i=="below"?o={overlayX:"center",overlayY:"top"}:i=="before"||i=="left"&&e||i=="right"&&!e?o={overlayX:"end",overlayY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(o={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(o.overlayX,o.overlayY);return{main:o,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),Et(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}_invertPosition(e,i){return this.position==="above"||this.position==="below"?i==="top"?i="bottom":i==="bottom"&&(i="top"):e==="end"?e="start":e==="start"&&(e="end"),{x:e,y:i}}_updateCurrentPositionClass(e){let{overlayY:i,originX:o,originY:r}=e,a;if(i==="center"?this._dir&&this._dir.value==="rtl"?a=o==="end"?"left":"right":a=o==="start"?"left":"right":a=i==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let l=this._overlayRef;if(l){let p=`${this._cssClassPrefix}-${hf}-`;l.removePanelClass(p+this._currentPosition),l.addPanelClass(p+a)}this._currentPosition=a}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",e=>{this._setupPointerExitEventsIfNeeded();let i;e.x!==void 0&&e.y!==void 0&&(i=e),this.show(void 0,i)}]):this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",e=>{let i=e.targetTouches?.[0],o=i?{x:i.clientX,y:i.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,o)},this._defaultOptions?.touchLongPressShowDelay??r)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;let e=[];if(this._platformSupportsMouseEvents())e.push(["mouseleave",i=>{let o=i.relatedTarget;(!o||!this._overlayRef?.overlayElement.contains(o))&&this.hide()}],["wheel",i=>this._wheelListener(i)]);else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let i=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};e.push(["touchend",i],["touchcancel",i])}this._addListeners(e),this._passiveListeners.push(...e)}_addListeners(e){e.forEach(([i,o])=>{this._elementRef.nativeElement.addEventListener(i,o,pf)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(e){if(this._isTooltipVisible()){let i=this._injector.get(it).elementFromPoint(e.clientX,e.clientY),o=this._elementRef.nativeElement;i!==o&&!o.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){let e=this.touchGestures;if(e!=="off"){let i=this._elementRef.nativeElement,o=i.style;(e==="on"||i.nodeName!=="INPUT"&&i.nodeName!=="TEXTAREA")&&(o.userSelect=o.msUserSelect=o.webkitUserSelect=o.MozUserSelect="none"),(e==="on"||!i.draggable)&&(o.webkitUserDrag="none"),o.touchAction="none",o.webkitTapHighlightColor="transparent"}}_syncAriaDescription(e){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,e,"tooltip"),this._isDestroyed||Et({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(i,o){i&2&&A("mat-mdc-tooltip-disabled",o.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),_f=(()=>{class n{_changeDetectorRef=d(Re);_elementRef=d(K);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=We();_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new D;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){}show(e){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},e)}hide(e){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},e)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:e}){(!e||!this._triggerElement.contains(e))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){let e=this._elementRef.nativeElement.getBoundingClientRect();return e.height>Ex&&e.width>=Tx}_handleAnimationEnd({animationName:e}){(e===this._showAnimation||e===this._hideAnimation)&&this._finalizeAnimation(e===this._showAnimation)}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(e){e?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(e){let i=this._tooltip.nativeElement,o=this._showAnimation,r=this._hideAnimation;if(i.classList.remove(e?r:o),i.classList.add(e?o:r),this._isVisible!==e&&(this._isVisible=e,this._changeDetectorRef.markForCheck()),e&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(i);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=!0)}e&&this._onShow(),this._animationsDisabled&&(i.classList.add("_mat-animation-noopable"),this._finalizeAnimation(e))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(i,o){if(i&1&&ne(Sx,7),i&2){let r;W(r=U())&&(o._tooltip=r.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(i,o){i&1&&_("mouseleave",function(a){return o._handleMouseLeave(a)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(i,o){if(i&1){let r=E();s(0,"div",1,0),_("animationend",function(l){return v(r),y(o._handleAnimationEnd(l))}),s(2,"div",2),h(3),c()()}i&2&&(A("mdc-tooltip--multiline",o._isMultiline),x("ngClass",o.tooltipClass),m(3),B(o.message))},dependencies:[An],styles:[`.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mat-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mat-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mat-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mat-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mat-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mat-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}
|
|
370
|
+
`],encapsulation:2,changeDetection:0})}return n})();var sm=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[rm],imports:[jo,xi,le,le,zi]})}return n})();var Ul=class n{http=d(Ye);usernameSubject=new se(null);username$=this.usernameSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(ct(t=>{this.usernameSubject.next(t.username)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ox=(n,t)=>t.label,Ax=(n,t)=>t.id;function Dx(n,t){n&1&&(s(0,"div",3),F(1,"span",4),s(2,"span",5),h(3,"Loading threads..."),c()())}function Ix(n,t){if(n&1&&(s(0,"div",18),h(1),c()),n&2){let e=g(6);m(),B(e.renameErrorMessage)}}function Rx(n,t){if(n&1){let e=E();s(0,"div",11)(1,"input",17),j("ngModelChange",function(o){v(e);let r=g(5);return L(r.editingThreadName,o)||(r.editingThreadName=o),y(o)}),_("keydown",function(o){v(e);let r=g(5);return y(r.onEditKeydown(o))})("blur",function(){v(e);let o=g(5);return y(o.onEditBlur())})("click",function(o){return v(e),y(o.stopPropagation())}),c(),w(2,Ix,2,1,"div",18),c()}if(n&2){let e=g(5);m(),V("ngModel",e.editingThreadName),x("disabled",e.isRenamingThread),m(),S(e.renameErrorMessage?2:-1)}}function Fx(n,t){if(n&1&&(s(0,"span",20),h(1),c()),n&2){let e=g(2).$implicit;m(),B(e.name)}}function Nx(n,t){n&1&&(F(0,"mat-spinner",21),s(1,"span",22),h(2,"Generating name..."),c()),n&2&&x("diameter",16)}function Vx(n,t){if(n&1){let e=E();s(0,"a",19),_("click",function(o){v(e);let r=g().$implicit;return g(4).selectThread(r.id),y(o.preventDefault())})("keydown.enter",function(o){v(e);let r=g().$implicit;return g(4).selectThread(r.id),y(o.preventDefault())})("keydown.space",function(o){v(e);let r=g().$implicit;return g(4).selectThread(r.id),y(o.preventDefault())}),w(1,Fx,2,1,"span",20)(2,Nx,3,1),c()}if(n&2){let e=g().$implicit;x("matTooltip",e.name?e.name+`
|
|
371
|
+
|
|
372
|
+
`+(e.summary||""):e.summary||"")("matTooltipDisabled",!e.summary),m(),S(e.name?1:2)}}function Lx(n,t){if(n&1){let e=E();s(0,"button",23),_("click",function(o){v(e);let r=g().$implicit,a=g(4);return y(a.startEditingThreadName(o,r))}),s(1,"mat-icon"),h(2,"edit"),c()()}}function jx(n,t){if(n&1){let e=E();s(0,"div",10),w(1,Rx,3,3,"div",11)(2,Vx,3,3,"a",12),s(3,"div",13),w(4,Lx,3,0,"button",14),s(5,"button",15),_("click",function(o){let r=v(e).$implicit,a=g(4);return y(a.toggleStar(o,r))}),s(6,"mat-icon"),h(7),c()(),s(8,"button",16),_("click",function(o){let r=v(e).$implicit,a=g(4);return y(a.deleteThread(o,r))}),s(9,"mat-icon"),h(10,"delete"),c()()()()}if(n&2){let e,i=t.$implicit,o=g(4);A("current",i.id===((e=o.currentThread())==null?null:e.id)),m(),S(o.editingThreadId===i.id?1:2),m(3),S(o.editingThreadId!==i.id&&i.name?4:-1),m(),A("starred",o.isStarred(i)),x("title",o.isStarred(i)?"Unstar thread":"Star thread"),m(2),B(o.isStarred(i)?"star":"star_outline")}}function zx(n,t){if(n&1&&(s(0,"div",6)(1,"div",8),h(2),c(),Oe(3,jx,11,8,"div",9,Ax),c()),n&2){let e=t.$implicit;m(2),B(e.label),m(),Ae(e.threads)}}function Bx(n,t){n&1&&(s(0,"div",7),h(1,"No existing threads"),c())}function Hx(n,t){if(n&1&&(s(0,"div",7),h(1),c()),n&2){let e=g(3);m(),ae('No threads matching "',e.searchQuery,'"')}}function Wx(n,t){if(n&1&&(Oe(0,zx,5,1,"div",6,Ox),w(2,Bx,2,0,"div",7)(3,Hx,2,1,"div",7)),n&2){let e,i=g(2);Ae(i.getGroupedThreads()),m(2),S(!((e=i.threads())!=null&&e.length)&&!i.searchQuery?2:i.searchQuery&&i.getGroupedThreads().length===0?3:-1)}}function Ux(n,t){if(n&1&&(s(0,"div",1),w(1,Dx,4,0,"div",3)(2,Wx,4,1),c()),n&2){let e=g();m(),S(e.isLoadingThreadList()?1:2)}}function $x(n,t){n&1&&(s(0,"span",24),h(1,"No project selected"),c())}function qx(n,t){n&1&&(s(0,"span",24),h(1,"Loading..."),c())}function Gx(n,t){if(n&1&&(s(0,"div",2),w(1,$x,2,0,"span",24)(2,qx,2,0,"span",24),c()),n&2){let e,i=g();m(),S((e=i.currentProject())!=null&&e.name?2:1)}}var $l=class n{projects=null;searchMode=!1;searchQuery="";searchModeChange=new H;projectStateService=d(we);threadStateService=d(Rt);threadApiService=d(Un);userService=d(Ul);router=d(Dn);currentThread=jt(this.threadStateService.selectedThread$);currentProject=jt(this.projectStateService.selectedProject$);threads=jt(this.threadStateService.threadList$);isLoadingThreadList=jt(this.threadStateService.isLoadingThreadList$);username=jt(this.userService.username$);editingThreadId=null;editingThreadName="";isRenamingThread=!1;renameErrorMessage="";ngOnInit(){this.userService.fetchCurrentUser().subscribe({error:t=>{console.error("[THREAD-SELECTOR] Failed to load current user:",t)}})}selectThread(t){this.threadStateService.selectThread(t),this.router.navigate(["project",this.currentProject()?.name,"thread",t])}getGroupedThreads(){let t=this.threads();if(!t?.length)return[];if(this.searchQuery&&this.searchQuery.trim()){let u=this.searchQuery.toLowerCase().trim();t=t.filter(b=>b.name.toLowerCase().includes(u)||b.summary&&b.summary.toLowerCase().includes(u))}if(!t.length)return[];let e=this.username();if(!e)return[];let i=t.filter(u=>u.starring&&u.starring.includes(e)),o=t.filter(u=>!u.starring||!u.starring.includes(e)),r=new Map,a=new Date;a.setHours(0,0,0,0);for(let u of o){let b=new Date(u.modifiedDate);b.setHours(0,0,0,0);let C=a.getTime()-b.getTime(),T=Math.floor(C/(1e3*60*60*24)),P;T===0?P="Today":T===1?P="Yesterday":T<7?P="This Week":T<30?P="This Month":T<90?P="Last 3 Months":P="Older",r.has(P)||r.set(P,[]),r.get(P).push(u)}let l=[];if(i.length>0){let u=[...i].sort((b,C)=>b.modifiedDate>C.modifiedDate?-1:1);l.push({label:"Starred",threads:u})}return["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(u=>r.has(u)).forEach(u=>{l.push({label:u,threads:r.get(u)})}),l}isStarred(t){let e=this.username();return!!e&&t.starring&&t.starring.includes(e)}toggleStar(t,e){t.stopPropagation();let i=this.username();if(!i)return;(e.starring&&e.starring.includes(i)?this.threadApiService.unstarThread(e.id):this.threadApiService.starThread(e.id)).subscribe({next:()=>{this.threadStateService.refreshThreadList()},error:a=>{console.error("Error toggling star:",a)}})}deleteThread(t,e){t.stopPropagation();let i=this.currentProject()?.name;!i||!confirm(`Are you sure you want to delete the thread "${e.name}"?`)||this.threadApiService.deleteThread(e.id).subscribe({next:()=>{this.currentThread()?.id===e.id&&(this.threadStateService.clearSelection(),this.router.navigate(["project",i])),this.threadStateService.refreshThreadList()},error:r=>{console.error("Error deleting thread:",r),alert("Failed to delete thread. Please try again.")}})}formatDate(t){try{let e=new Date(t),o=new Date().getTime()-e.getTime(),r=Math.floor(o/(1e3*60*60*24));return r===0?"Today":r===1?"Yesterday":r<7?`${r} days ago`:e.toLocaleDateString("en-EN",{day:"numeric",month:"short"})}catch{return"No date"}}startEditingThreadName(t,e){t.stopPropagation(),this.editingThreadId=e.id,this.editingThreadName=e.name||"",this.renameErrorMessage="",setTimeout(()=>{let i=document.querySelector(".thread-name-input");i&&(i.focus(),i.select())},0)}cancelEditingThreadName(){this.editingThreadId=null,this.editingThreadName="",this.renameErrorMessage=""}saveThreadName(t){if(t&&t.stopPropagation(),!this.editingThreadId)return;let e=this.editingThreadName.trim();if(!e){this.renameErrorMessage="Thread name cannot be empty";return}if(e.length>200){this.renameErrorMessage="Thread name is too long (max 200 characters)";return}let i=this.editingThreadId;this.isRenamingThread=!0,this.renameErrorMessage="",this.threadStateService.renameThread(i,e).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=!1},error:o=>{console.error("[THREAD-SELECTOR] Error renaming thread:",o),this.renameErrorMessage=o.message||"Failed to rename thread",this.isRenamingThread=!1}})}onEditKeydown(t){t.key==="Enter"?(t.preventDefault(),t.stopPropagation(),this.saveThreadName()):t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.cancelEditingThreadName())}onEditBlur(){setTimeout(()=>{this.editingThreadId&&!this.isRenamingThread&&this.saveThreadName()},200)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-thread-selector"]],inputs:{searchMode:"searchMode",searchQuery:"searchQuery"},outputs:{searchModeChange:"searchModeChange"},decls:3,vars:1,consts:[["tabindex","0","role","application","aria-label","Thread selector",1,"thread-selector",3,"click","keydown"],["role","menu","aria-label","Thread selection",1,"thread-list"],[1,"thread-disabled"],[1,"thread-loading"],[1,"loading-spinner"],[1,"loading-text"],[1,"thread-group"],[1,"thread-empty"],[1,"thread-group-header"],[1,"thread-item-wrapper",3,"current"],[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"],[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(e,i){if(e&1&&(s(0,"div",0),_("click",function(r){return r.stopPropagation()})("keydown",function(r){return r.stopPropagation()}),w(1,Ux,3,1,"div",1)(2,Gx,3,1,"div",2),c()),e&2){let o;m(),S((o=i.currentProject())!=null&&o.name?1:2)}},dependencies:[De,Ke,ze,Xe,$d,Ue,Qe,xe,xt,yt,Zt,ut,kl,Sl,sm,am],styles:[".thread-selector[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;min-height:0}.sidenav-thread-selector[_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%], .sidenav-thread-selector [_nghost-%COMP%] .thread-selector[_ngcontent-%COMP%]{flex:1;min-height:0}.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}@media (max-width: 768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"]})};function Yx(n,t){if(n&1&&(s(0,"div",3),h(1),c()),n&2){let e=g();m(),ae("\u274C ",e.errorMessage)}}var Ta=class n{dialogRef=d(ii);data=d(Wi);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName)}getDefaultTitle(t,e){return t==="user"?"User Configuration":`Project Configuration: ${e||"Unknown"}`}onSave(){this.errorMessage="";let t;try{t=JSON.parse(this.jsonContent)}catch(e){this.errorMessage=`Invalid JSON syntax: ${e instanceof Error?e.message:"Unknown error"}`;return}this.dialogRef.close(t)}onCancel(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,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(e,i){e&1&&(s(0,"div",0),h(1),s(2,"button",1),_("click",function(){return i.onCancel()}),s(3,"mat-icon"),h(4,"close"),c()()(),s(5,"mat-dialog-content")(6,"textarea",2),j("ngModelChange",function(r){return L(i.jsonContent,r)||(i.jsonContent=r),r}),c(),w(7,Yx,2,1,"div",3),c(),s(8,"mat-dialog-actions",4)(9,"button",5),_("click",function(){return i.onCancel()}),h(10,"Cancel"),c(),s(11,"button",6),_("click",function(){return i.onSave()}),h(12,"Save"),c()()),e&2&&(m(),ae(" ",i.title," "),m(5),V("ngModel",i.jsonContent),m(),S(i.errorMessage?7:-1))},dependencies:[De,Ke,ze,Xe,Ue,xe,yt,It,un,gn,fn],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)}"]})};function Qx(n,t){if(n&1){let e=E();s(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),h(3),c(),s(4,"textarea",19),j("ngModelChange",function(o){let r=v(e).$index,a=g();return L(a.commands[r],o)||(a.commands[r]=o),y(o)}),c(),s(5,"mat-hint"),h(6,"Use placeholder for dynamic values"),c()(),s(7,"button",20),_("click",function(){let o=v(e).$index,r=g();return y(r.removeCommand(o))}),s(8,"mat-icon"),h(9,"delete"),c()()()}if(n&2){let e=t.$index,i=g();m(3),ae("Prompt ",e+1),m(),V("ngModel",i.commands[e]),m(3),x("disabled",i.commands.length===1)}}function Xx(n,t){if(n&1){let e=E();s(0,"div",10)(1,"h3"),h(2,"Save to"),c(),s(3,"div",21)(4,"label",22)(5,"input",23),j("ngModelChange",function(o){v(e);let r=g();return L(r.source,o)||(r.source=o),y(o)}),c(),s(6,"div",24)(7,"div",25)(8,"span",26),h(9,"\u{1F464}"),c(),s(10,"span",27),h(11,"Local"),c()(),s(12,"p",28),h(13,"Personal prompt in ~/.coday/... (not committed)"),c()()(),s(14,"label",22)(15,"input",29),j("ngModelChange",function(o){v(e);let r=g();return L(r.source,o)||(r.source=o),y(o)}),c(),s(16,"div",24)(17,"div",25)(18,"span",26),h(19,"\u{1F4E6}"),c(),s(20,"span",27),h(21,"Project"),c()(),s(22,"p",28),h(23,"Shared prompt in ./prompts/ (committable)"),c()()()(),s(24,"p",30),h(25,"Storage location is permanent and cannot be changed after creation"),c()()}if(n&2){let e=g();m(4),A("selected",e.source==="local"),m(),V("ngModel",e.source),m(9),A("selected",e.source==="project"),m(),V("ngModel",e.source)}}function Kx(n,t){if(n&1&&(s(0,"div",11)(1,"h3"),h(2,"Storage Location"),c(),s(3,"div",31)(4,"span",26),h(5),c(),s(6,"span",27),h(7),c()(),s(8,"p",30),h(9,"Cannot be changed after creation"),c()()),n&2){let e=g();m(3),A("badge-local",e.source==="local")("badge-project",e.source==="project"),m(2),B(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),m(2),B(e.source==="local"?"Local":"Project")}}function Zx(n,t){if(n&1){let e=E();s(0,"div",12)(1,"label",32)(2,"input",33),j("ngModelChange",function(o){v(e);let r=g();return L(r.webhookEnabled,o)||(r.webhookEnabled=o),y(o)}),c(),s(3,"span"),h(4,"Enable webhook"),c()(),s(5,"p",30),h(6,"Enable webhook to trigger this prompt via HTTP POST"),c()()}if(n&2){let e=g();m(2),V("ngModel",e.webhookEnabled)}}function Jx(n,t){if(n&1){let e=E();s(0,"div",13)(1,"div",34)(2,"mat-icon",35),h(3,"link"),c(),s(4,"h4"),h(5,"Webhook URL"),c()(),s(6,"div",36)(7,"p",37),h(8),c(),s(9,"button",38),_("click",function(){v(e);let o=g();return y(o.copyWebhookUrl())}),s(10,"mat-icon"),h(11,"content_copy"),c(),s(12,"span"),h(13,"Copy URL"),c()()(),s(14,"p",30),h(15,"Use this URL to trigger the prompt via HTTP POST"),c()()}if(n&2){let e=g();m(8),B(e.getWebhookUrl())}}function ew(n,t){if(n&1&&(s(0,"div",14)(1,"mat-icon"),h(2,"error"),c(),s(3,"span"),h(4),c()()),n&2){let e=g();m(4),B(e.errorMessage)}}var Pa=class n{promptApi=d(hi);dialogRef=d(ii);configApi=d(Ki);snackBar=d(Jr);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=d(Wi);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1},error:t=>{console.error("[PROMPT_FORM] Error loading user config:",t),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(t){this.commands.length>1&&this.commands.splice(t,1)}trackByIndex(t){return t}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:t,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating prompt:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let t=this.getWebhookUrl();navigator.clipboard.writeText(t).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),h(1),c(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),c(),s(7,"input",3),j("ngModelChange",function(r){return L(i.name,r)||(i.name=r),r}),_("blur",function(){return i.normalizeName()}),c(),s(8,"mat-hint"),h(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),c()(),s(10,"mat-form-field",2)(11,"mat-label"),h(12,"Description"),c(),s(13,"textarea",4),j("ngModelChange",function(r){return L(i.description,r)||(i.description=r),r}),c(),s(14,"mat-hint"),h(15,"Explain the purpose of this prompt, helps for searchability"),c()(),s(16,"div",5)(17,"div",6)(18,"h3"),h(19,"Prompts"),c(),s(20,"button",7),_("click",function(){return i.addCommand()}),s(21,"mat-icon"),h(22,"add"),c()()(),s(23,"div",8),Oe(24,Qx,10,3,"div",9,Jn),c()(),w(26,Xx,26,6,"div",10),w(27,Kx,10,6,"div",11),w(28,Zx,7,1,"div",12),w(29,Jx,16,1,"div",13),w(30,ew,5,1,"div",14),c()(),s(31,"mat-dialog-actions",15)(32,"button",16),_("click",function(){return i.cancel()}),h(33,"Cancel"),c(),s(34,"button",17),_("click",function(){return i.save()}),h(35),c()()),e&2&&(m(),B(i.isEditMode?"Edit Prompt":"Create Prompt"),m(6),V("ngModel",i.name),m(6),V("ngModel",i.description),m(11),Ae(i.commands),m(2),S(i.isEditMode?-1:26),m(),S(i.isEditMode?27:-1),m(),S(i.isAdmin?28:-1),m(),S(i.isEditMode&&i.webhookEnabled&&i.isAdmin?29:-1),m(),S(i.errorMessage?30:-1),m(2),x("disabled",i.isSaving),m(2),x("disabled",i.isSaving),m(),ae(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[De,Ke,ze,Nd,uo,Xe,go,Ue,lo,un,fn,gn,xt,It,yt,Zt,pi,$t,Ut,wn,ut,Qe,xe,Ko],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media (max-width: 768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};function tw(n,t){n&1&&(s(0,"div",12),h(1,"Loading prompts..."),c())}function iw(n,t){if(n&1&&(s(0,"div",13),h(1),c()),n&2){let e=g();m(),B(e.errorMessage)}}function nw(n,t){n&1&&(s(0,"div",14),h(1," No prompts found. Create your first prompt to get started. "),c())}function ow(n,t){n&1&&(s(0,"div",14),h(1," No prompts match your search. "),c())}function rw(n,t){if(n&1&&(s(0,"span",31),h(1),c()),n&2){let e=g().$implicit;x("title",Pn("Created by ",e.createdBy)),m(),ae(" \u{1F464} ",e.createdBy," ")}}function aw(n,t){if(n&1){let e=E();s(0,"button",32),_("click",function(){v(e);let o=g().$implicit,r=g(2);return y(r.toggleWebhook(o))}),h(1),c()}if(n&2){let e=g().$implicit;A("btn-webhook-enabled",e.webhookEnabled)("btn-webhook-disabled",!e.webhookEnabled),m(),ae(" ",e.webhookEnabled?"Disable Webhook":"Enable Webhook"," ")}}function sw(n,t){if(n&1){let e=E();s(0,"div",17)(1,"div",18)(2,"div",19)(3,"h3"),h(4),c(),s(5,"div",20)(6,"span",21),h(7),c(),Ge(8,rw,2,3,"span",22),c()(),s(9,"p",23),h(10),c(),s(11,"div",24)(12,"span",25),h(13),c(),s(14,"span",26),h(15),c()()(),s(16,"div",27)(17,"button",28),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.editPrompt(o))}),h(18,"Edit"),c(),Ge(19,aw,2,5,"button",29),s(20,"button",30),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.deletePrompt(o.id))}),h(21,"Delete"),c()()()}if(n&2){let e=t.$implicit,i=g(2);m(4),B(e.name),m(2),A("badge-local",e.source==="local")("badge-project",e.source==="project"),x("title",e.source==="local"?"Local prompt (~/.coday/)":"Project prompt (./prompts/)"),m(),ae(" ",e.source==="local"?"\u{1F464}":"\u{1F4E6}"," "),m(),x("ngIf",e.createdBy!==i.getCurrentUsername()),m(2),B(e.description),m(3),ae("ID: ",e.id),m(),A("enabled",e.webhookEnabled),m(),ae(" Webhook: ",e.webhookEnabled?"Enabled":"Disabled"," "),m(4),x("ngIf",i.isAdmin)}}function lw(n,t){if(n&1&&(s(0,"div",15),Ge(1,sw,22,14,"div",16),c()),n&2){let e=g();m(),x("ngForOf",e.filteredPrompts)}}var ql=class n{promptApi=d(hi);dialog=d(wi);configApi=d(Ki);prompts=[];filteredPrompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";isAdmin=!1;currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.isAdmin=t.groups?.includes("CODAY_ADMIN")??!1,this.currentUsername=t.username??"",console.log("[PROMPT_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[PROMPT_MANAGER] Error loading user config:",t),this.isAdmin=!1}}),this.loadPrompts()}loadPrompts(){this.isLoading=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoading=!1}})}deletePrompt(t){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(t).subscribe({next:()=>{this.loadPrompts()},error:e=>{console.error("Error deleting prompt:",e);let i=e?.error?.error??e?.message??"Failed to delete prompt";alert(`Failed to delete prompt: ${i}`)}})}toggleWebhook(t){(t.webhookEnabled?this.promptApi.disableWebhook(t.id):this.promptApi.enableWebhook(t.id)).subscribe({next:()=>{this.loadPrompts()},error:i=>{console.error("Error toggling webhook:",i);let o=i?.error?.error??i?.message??"Failed to toggle webhook";alert(`Failed to toggle webhook: ${o}`)}})}createPrompt(){this.dialog.open(Pa,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}getCurrentUsername(){return this.currentUsername}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyPrompt(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.prompts.filter(i=>this.isMyPrompt(i)):[...this.prompts];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.description.toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredPrompts=e}onSearchChange(){this.applyFilter()}editPrompt(t){this.promptApi.getPrompt(t.id).subscribe({next:e=>{this.dialog.open(Pa,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(o=>{o&&this.loadPrompts()})},error:e=>{console.error("Error loading prompt details:",e);let i=e?.error?.error??e?.message??"Failed to load prompt details";alert(`Failed to load prompt details: ${i}`)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-prompt-manager"]],decls:23,vars:7,consts:[[1,"prompt-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, description, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","prompt-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"prompt-list"],["class","prompt-item",4,"ngFor","ngForOf"],[1,"prompt-item"],[1,"prompt-info"],[1,"prompt-header"],[1,"badges"],[1,"source-badge",3,"title"],["class","owner-badge",3,"title",4,"ngIf"],[1,"description"],[1,"meta"],["title","Prompt ID",1,"prompt-id"],[1,"webhook-status"],[1,"prompt-actions"],[1,"btn-primary",3,"click"],[3,"btn-webhook-enabled","btn-webhook-disabled","click",4,"ngIf"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"],[3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Prompts"),c(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),c(),s(8,"input",4),j("ngModelChange",function(r){return L(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),c(),s(9,"mat-icon",5),h(10,"search"),c()(),s(11,"mat-slide-toggle",6),j("ngModelChange",function(r){return L(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),_("change",function(){return i.applyFilter()}),h(12," Mine "),c(),s(13,"button",7),_("click",function(){return i.createPrompt()}),s(14,"mat-icon"),h(15,"add"),c(),s(16,"span"),h(17,"Create Prompt"),c()()()(),Ge(18,tw,2,0,"div",8)(19,iw,2,1,"div",9)(20,nw,2,0,"div",10)(21,ow,2,0,"div",10)(22,lw,2,1,"div",11),c()),e&2&&(m(8),V("ngModel",i.searchQuery),m(3),V("ngModel",i.showOnlyMine),m(7),x("ngIf",i.isLoading),m(),x("ngIf",i.errorMessage),m(),x("ngIf",!i.isLoading&&i.prompts.length===0),m(),x("ngIf",!i.isLoading&&i.prompts.length>0&&i.filteredPrompts.length===0),m(),x("ngIf",!i.isLoading&&i.filteredPrompts.length>0))},dependencies:[De,Qa,Xa,Ke,ze,Xe,Ue,Qe,xe,Zt,pi,$t,Ut,wo,ut,Bl,xo],styles:[".prompt-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.prompt-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.prompt-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.prompt-info[_ngcontent-%COMP%]{flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem;flex:1}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.prompt-info[_ngcontent-%COMP%] .prompt-header[_ngcontent-%COMP%] .badges[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400;white-space:nowrap}.prompt-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0 0 .5rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{display:flex;gap:1rem;font-size:.85rem;color:var(--color-text-secondary)}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .prompt-id[_ngcontent-%COMP%]{font-family:monospace;opacity:.7}.prompt-info[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .webhook-status.enabled[_ngcontent-%COMP%]{color:var(--color-success);font-weight:600}.prompt-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.prompt-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-webhook-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.prompt-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var Er=class n{http=d(Ye);projectState=d(we);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createScheduler(t){return this.http.post(this.getBaseUrl(),t)}updateScheduler(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e)}deleteScheduler(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}enableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/enable`,{})}disableScheduler(t){return this.http.post(`${this.getBaseUrl()}/${t}/disable`,{})}runSchedulerNow(t){return this.http.post(`${this.getBaseUrl()}/${t}/run-now`,{})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var Gl=(()=>{class n{_animationsDisabled=We();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(i,o){i&2&&A("mat-pseudo-checkbox-indeterminate",o.state==="indeterminate")("mat-pseudo-checkbox-checked",o.state==="checked")("mat-pseudo-checkbox-disabled",o.disabled)("mat-pseudo-checkbox-minimal",o.appearance==="minimal")("mat-pseudo-checkbox-full",o.appearance==="full")("_mat-animation-noopable",o._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(i,o){},styles:[`.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}
|
|
373
|
+
`],encapsulation:2,changeDetection:0})}return n})();var cw=["text"],dw=[[["mat-icon"]],"*"],mw=["mat-icon","*"];function hw(n,t){if(n&1&&F(0,"mat-pseudo-checkbox",1),n&2){let e=g();x("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function pw(n,t){if(n&1&&F(0,"mat-pseudo-checkbox",3),n&2){let e=g();x("disabled",e.disabled)}}function uw(n,t){if(n&1&&(s(0,"span",4),h(1),c()),n&2){let e=g();m(),ae("(",e.group.label,")")}}var cm=new ee("MAT_OPTION_PARENT_COMPONENT"),dm=new ee("MatOptgroup");var lm=class{source;isUserInput;constructor(t,e=!1){this.source=t,this.isUserInput=e}},So=(()=>{class n{_element=d(K);_changeDetectorRef=d(Re);_parent=d(cm,{optional:!0});group=d(dm,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=d(Fe).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=Te(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new H;_text;_stateChanges=new D;constructor(){let e=d(Lt);e.load(Rn),e.load(ts),this._signalDisableRipple=!!this._parent&&qa(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,i){let o=this._getHostElement();typeof o.focus=="function"&&o.focus(i)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!vt(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new lm(this,e))}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-option"]],viewQuery:function(i,o){if(i&1&&ne(cw,7),i&2){let r;W(r=U())&&(o._text=r.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(i,o){i&1&&_("click",function(){return o._selectViaInteraction()})("keydown",function(a){return o._handleKeydown(a)}),i&2&&(ei("id",o.id),Y("aria-selected",o.selected)("aria-disabled",o.disabled.toString()),A("mdc-list-item--selected",o.selected)("mat-mdc-option-multiple",o.multiple)("mat-mdc-option-active",o.active)("mdc-list-item--disabled",o.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",J]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:mw,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(i,o){i&1&&(He(dw),w(0,hw,1,2,"mat-pseudo-checkbox",1),he(1),s(2,"span",2,0),he(4,1),c(),w(5,pw,1,1,"mat-pseudo-checkbox",3),w(6,uw,2,1,"span",4),F(7,"div",5)),i&2&&(S(o.multiple?0:-1),m(5),S(!o.multiple&&o.selected&&!o.hideSingleSelectionIndicator?5:-1),m(),S(o.group&&o.group._inert?6:-1),m(),x("matRippleTrigger",o._getHostElement())("matRippleDisabled",o.disabled||o.disableRipple))},dependencies:[Gl,In],styles:[`.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""}
|
|
374
|
+
`],encapsulation:2,changeDetection:0})}return n})();function bf(n,t,e){if(e.length){let i=t.toArray(),o=e.toArray(),r=0;for(let a=0;a<n+1;a++)i[a].group&&i[a].group===o[r]&&r++;return r}return 0}function vf(n,t,e,i){return n<e?n:n+t>e+i?Math.max(0,n-i+t):e}var ko=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new D;constructor(t=!1,e,i=!0,o){this._multiple=t,this._emitChanges=i,this.compareWith=o,e&&e.length&&(t?e.forEach(r=>this._markSelected(r)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...t){this._verifyValueAssignment(t),t.forEach(i=>this._markSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...t){this._verifyValueAssignment(t),t.forEach(i=>this._unmarkSelected(i));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...t){this._verifyValueAssignment(t);let e=this.selected,i=new Set(t.map(r=>this._getConcreteValue(r)));t.forEach(r=>this._markSelected(r)),e.filter(r=>!i.has(this._getConcreteValue(r,i))).forEach(r=>this._unmarkSelected(r));let o=this._hasQueuedChanges();return this._emitChangeEvent(),o}toggle(t){return this.isSelected(t)?this.deselect(t):this.select(t)}clear(t=!0){this._unmarkAll();let e=this._hasQueuedChanges();return t&&this._emitChangeEvent(),e}isSelected(t){return this._selection.has(this._getConcreteValue(t))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(t){this._multiple&&this.selected&&this._selected.sort(t)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(t){t=this._getConcreteValue(t),this.isSelected(t)||(this._multiple||this._unmarkAll(),this.isSelected(t)||this._selection.add(t),this._emitChanges&&this._selectedToEmit.push(t))}_unmarkSelected(t){t=this._getConcreteValue(t),this.isSelected(t)&&(this._selection.delete(t),this._emitChanges&&this._deselectedToEmit.push(t))}_unmarkAll(){this.isEmpty()||this._selection.forEach(t=>this._unmarkSelected(t))}_verifyValueAssignment(t){t.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(t,e){if(this.compareWith){e=e??this._selection;for(let i of e)if(this.compareWith(t,i))return i;return t}else return t}};var yf=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le]})}return n})();var mm=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[as,le,yf,So]})}return n})();var fw=["trigger"],_w=["panel"],bw=[[["mat-select-trigger"]],"*"],vw=["mat-select-trigger","*"];function yw(n,t){if(n&1&&(s(0,"span",4),h(1),c()),n&2){let e=g();m(),B(e.placeholder)}}function Cw(n,t){n&1&&he(0)}function xw(n,t){if(n&1&&(s(0,"span",11),h(1),c()),n&2){let e=g(2);m(),B(e.triggerValue)}}function ww(n,t){if(n&1&&(s(0,"span",5),w(1,Cw,1,0)(2,xw,2,1,"span",11),c()),n&2){let e=g();m(),S(e.customTrigger?1:2)}}function Sw(n,t){if(n&1){let e=E();s(0,"div",12,1),_("keydown",function(o){v(e);let r=g();return y(r._handleKeydown(o))}),he(2,1),c()}if(n&2){let e=g();rn(Pn("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),A("mat-select-panel-animations-enabled",!e._animationsDisabled),x("ngClass",e.panelClass),Y("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var um=new ee("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let n=d(fe);return()=>Hi(n)}});function Cf(n){let t=d(fe);return()=>Hi(t)}var xf=new ee("MAT_SELECT_CONFIG"),wf={provide:um,deps:[],useFactory:Cf},Sf=new ee("MatSelectTrigger"),Xl=class{source;value;constructor(t,e){this.source=t,this.value=e}},gm=(()=>{class n{_viewportRuler=d(Bi);_changeDetectorRef=d(Re);_elementRef=d(K);_dir=d(Ct,{optional:!0});_idGenerator=d(Fe);_renderer=d(ot);_parentFormField=d(Ea,{optional:!0});ngControl=d(Gi,{self:!0,optional:!0});_liveAnnouncer=d(ns);_defaultOptions=d(xf,{optional:!0});_animationsDisabled=We();_initialized=new D;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let i=this.options.toArray()[e];if(i){let o=this.panel.nativeElement,r=bf(e,this.options,this.optionGroups),a=i._getHostElement();e===0&&r===1?o.scrollTop=0:o.scrollTop=vf(a.offsetTop,a.offsetHeight,o.scrollTop,o.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new Xl(this,e)}_scrollStrategyFactory=d(um);_panelOpen=!1;_compareWith=(e,i)=>e===i;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new D;_errorStateTracker;stateChanges=new D;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Te(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(or.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=Ro(()=>{let e=this.options;return e?e.changes.pipe(Vt(e),Ri(()=>Ii(...e.map(i=>i.onSelectionChange)))):this._initialized.pipe(Ri(()=>this.optionSelectionChanges))});openedChange=new H;_openedStream=this.openedChange.pipe(ue(e=>e),ve(()=>{}));_closedStream=this.openedChange.pipe(ue(e=>!e),ve(()=>{}));selectionChange=new H;valueChange=new H;constructor(){let e=d(Wl),i=d(va,{optional:!0}),o=d(Ca,{optional:!0}),r=d(new On("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new kr(e,this.ngControl,o,i,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=r==null?0:parseInt(r)||0,this.id=this.id}ngOnInit(){this._selectionModel=new ko(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(N(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(N(this._destroy)).subscribe(e=>{e.added.forEach(i=>i.select()),e.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(Vt(null),N(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),i=this.ngControl;if(e!==this._triggerAriaLabelledBy){let o=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?o.setAttribute("aria-labelledby",e):o.removeAttribute("aria-labelledby")}i&&(this._previousControl!==i.control&&(this._previousControl!==void 0&&i.disabled!==null&&i.disabled!==this.disabled&&(this.disabled=i.disabled),this._previousControl=i.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(Mt(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let i=`${this.id}-panel`;this._trackedModal&&wc(this._trackedModal,"aria-owns",i),xh(e,"aria-owns",i),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;wc(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{i(),clearTimeout(o),this._cleanupDetach=void 0};let e=this.panel.nativeElement,i=this._renderer.listen(e,"animationend",r=>{r.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),o=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let i=e.keyCode,o=i===40||i===38||i===37||i===39,r=i===13||i===32,a=this._keyManager;if(!a.isTyping()&&r&&!vt(e)||(this.multiple||e.altKey)&&o)e.preventDefault(),this.open();else if(!this.multiple){let l=this.selected;a.onKeydown(e);let p=this.selected;p&&l!==p&&this._liveAnnouncer.announce(p.viewValue,1e4)}}_handleOpenKeydown(e){let i=this._keyManager,o=e.keyCode,r=o===40||o===38,a=i.isTyping();if(r&&e.altKey)e.preventDefault(),this.close();else if(!a&&(o===13||o===32)&&i.activeItem&&!vt(e))e.preventDefault(),i.activeItem._selectViaInteraction();else if(!a&&this._multiple&&o===65&&e.ctrlKey){e.preventDefault();let l=this.options.some(p=>!p.disabled&&!p.selected);this.options.forEach(p=>{p.disabled||(l?p.select():p.deselect())})}else{let l=i.activeItemIndex;i.onKeydown(e),this._multiple&&r&&e.shiftKey&&i.activeItem&&i.activeItemIndex!==l&&i.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!vt(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(i=>this._selectOptionByValue(i)),this._sortValues();else{let i=this._selectOptionByValue(e);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let i=this.options.find(o=>{if(this._selectionModel.isSelected(o))return!1;try{return(o.value!=null||this.canSelectNullableOptions)&&this._compareWith(o.value,e)}catch{return!1}});return i&&this._selectionModel.select(i),i}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Yo?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Ch(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=Ii(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(N(e)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),Ii(...this.options.map(i=>i._stateChanges)).pipe(N(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,i){let o=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(o!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),i&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),i&&this.focus())),o!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((i,o)=>this.sortComparator?this.sortComparator(i,o,e):e.indexOf(i)-e.indexOf(o)),this.stateChanges.next()}}_propagateChanges(e){let i;this.multiple?i=this.selected.map(o=>o.value):i=this.selected?this.selected.value:e,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let i=0;i<this.options.length;i++)if(!this.options.get(i).disabled){e=i;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,i=e?e+" ":"";return this.ariaLabelledby?i+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-select"]],contentQueries:function(i,o,r){if(i&1&&(Tt(r,Sf,5),Tt(r,So,5),Tt(r,dm,5)),i&2){let a;W(a=U())&&(o.customTrigger=a.first),W(a=U())&&(o.options=a),W(a=U())&&(o.optionGroups=a)}},viewQuery:function(i,o){if(i&1&&(ne(fw,5),ne(_w,5),ne(Ls,5)),i&2){let r;W(r=U())&&(o.trigger=r.first),W(r=U())&&(o.panel=r.first),W(r=U())&&(o._overlayDir=r.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(i,o){i&1&&_("keydown",function(a){return o._handleKeydown(a)})("focus",function(){return o._onFocus()})("blur",function(){return o._onBlur()}),i&2&&(Y("id",o.id)("tabindex",o.disabled?-1:o.tabIndex)("aria-controls",o.panelOpen?o.id+"-panel":null)("aria-expanded",o.panelOpen)("aria-label",o.ariaLabel||null)("aria-required",o.required.toString())("aria-disabled",o.disabled.toString())("aria-invalid",o.errorState)("aria-activedescendant",o._getAriaActiveDescendant()),A("mat-mdc-select-disabled",o.disabled)("mat-mdc-select-invalid",o.errorState)("mat-mdc-select-required",o.required)("mat-mdc-select-empty",o.empty)("mat-mdc-select-multiple",o.multiple)("mat-select-open",o.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",J],disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:_i(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",J],placeholder:"placeholder",required:[2,"required","required",J],multiple:[2,"multiple","multiple",J],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",J],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",_i],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",J]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[pe([{provide:Ma,useExisting:n},{provide:cm,useExisting:n}]),Le],ngContentSelectors:vw,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(i,o){if(i&1){let r=E();He(bw),s(0,"div",2,0),_("click",function(){return v(r),y(o.open())}),s(3,"div",3),w(4,yw,2,1,"span",4)(5,ww,3,1,"span",5),c(),s(6,"div",6)(7,"div",7),on(),s(8,"svg",8),F(9,"path",9),c()()()(),Ge(10,Sw,3,10,"ng-template",10),_("detach",function(){return v(r),y(o.close())})("backdropClick",function(){return v(r),y(o.close())})("overlayKeydown",function(l){return v(r),y(o._handleOverlayKeydown(l))})}if(i&2){let r=ti(1);m(3),Y("id",o._valueId),m(),S(o.empty?4:5),m(6),x("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",o._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",o._scrollStrategy)("cdkConnectedOverlayOrigin",o._preferredOverlayOrigin||r)("cdkConnectedOverlayPositions",o._positions)("cdkConnectedOverlayWidth",o._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[Yo,Ls,An],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
375
|
+
`],encapsulation:2,changeDetection:0})}return n})();var Oa=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({providers:[wf],imports:[xi,mm,le,zi,ut,mm,le]})}return n})();var Mw=["input"],Ew=["label"],Tw=["*"],Pw=new ee("mat-checkbox-default-options",{providedIn:"root",factory:Mf});function Mf(){return{color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1}}var Ft=(function(n){return n[n.Init=0]="Init",n[n.Checked=1]="Checked",n[n.Unchecked=2]="Unchecked",n[n.Indeterminate=3]="Indeterminate",n})(Ft||{}),fm=class{source;checked},kf=Mf(),_m=(()=>{class n{_elementRef=d(K);_changeDetectorRef=d(Re);_ngZone=d(me);_animationsDisabled=We();_options=d(Pw,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){let i=new fm;return i.source=this,i.checked=e,i}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return`${this.id||this._uniqueId}-input`}required;labelPosition="after";name=null;change=new H;indeterminateChange=new H;value;disableRipple;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=Ft.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){d(Lt).load(Rn);let e=d(new On("tabindex"),{optional:!0});this._options=this._options||kf,this.color=this._options.color||kf.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=d(Fe).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??!1}ngOnChanges(e){e.required&&this._validatorChangeFn()}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate)}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck())}_checked=!1;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}_disabled=!1;get indeterminate(){return this._indeterminate()}set indeterminate(e){let i=e!=this._indeterminate();this._indeterminate.set(e),i&&(e?this._transitionCheckState(Ft.Indeterminate):this._transitionCheckState(this.checked?Ft.Checked:Ft.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e)}_indeterminate=Te(!1);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(e){this.checked=!!e}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorChangeFn=e}_transitionCheckState(e){let i=this._currentCheckState,o=this._getAnimationTargetElement();if(!(i===e||!o)&&(this._currentAnimationClass&&o.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(i,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){o.classList.add(this._currentAnimationClass);let r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{o.classList.remove(r)},1e3)})}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked)}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(!1),this.indeterminateChange.emit(!1)}),this._checked=!this._checked,this._transitionCheckState(this._checked?Ft.Checked:Ft.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&e==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate)}_onInteractionEvent(e){e.stopPropagation()}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}_getAnimationClassForCheckStateTransition(e,i){if(this._animationsDisabled)return"";switch(e){case Ft.Init:if(i===Ft.Checked)return this._animationClasses.uncheckedToChecked;if(i==Ft.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case Ft.Unchecked:return i===Ft.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case Ft.Checked:return i===Ft.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case Ft.Indeterminate:return i===Ft.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){let i=this._inputElement;i&&(i.nativeElement.indeterminate=e)}_onInputClick(){this._handleInputClick()}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus()}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation()}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-checkbox"]],viewQuery:function(i,o){if(i&1&&(ne(Mw,5),ne(Ew,5)),i&2){let r;W(r=U())&&(o._inputElement=r.first),W(r=U())&&(o._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(i,o){i&2&&(ei("id",o.id),Y("tabindex",null)("aria-label",null)("aria-labelledby",null),rn(o.color?"mat-"+o.color:"mat-accent"),A("_mat-animation-noopable",o._animationsDisabled)("mdc-checkbox--disabled",o.disabled)("mat-mdc-checkbox-disabled",o.disabled)("mat-mdc-checkbox-checked",o.checked)("mat-mdc-checkbox-disabled-interactive",o.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",J],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",J],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",J],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:_i(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",J],checked:[2,"checked","checked",J],disabled:[2,"disabled","disabled",J],indeterminate:[2,"indeterminate","indeterminate",J]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[pe([{provide:Kt,useExisting:at(()=>n),multi:!0},{provide:Ti,useExisting:n,multi:!0}]),Le],ngContentSelectors:Tw,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],[1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],[1,"mdc-checkbox__ripple"],[1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24","aria-hidden","true",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(i,o){if(i&1){let r=E();He(),s(0,"div",3),_("click",function(l){return v(r),y(o._preventBubblingFromLabel(l))}),s(1,"div",4,0)(3,"div",5),_("click",function(){return v(r),y(o._onTouchTargetClick())}),c(),s(4,"input",6,1),_("blur",function(){return v(r),y(o._onBlur())})("click",function(){return v(r),y(o._onInputClick())})("change",function(l){return v(r),y(o._onInteractionEvent(l))}),c(),F(6,"div",7),s(7,"div",8),on(),s(8,"svg",9),F(9,"path",10),c(),$a(),F(10,"div",11),c(),F(11,"div",12),c(),s(12,"label",13,2),he(14),c()()}if(i&2){let r=ti(2);x("labelPosition",o.labelPosition),m(4),A("mdc-checkbox--selected",o.checked),x("checked",o.checked)("indeterminate",o.indeterminate)("disabled",o.disabled&&!o.disabledInteractive)("id",o.inputId)("required",o.required)("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex),Y("aria-label",o.ariaLabel||null)("aria-labelledby",o.ariaLabelledby)("aria-describedby",o.ariaDescribedby)("aria-checked",o.indeterminate?"mixed":null)("aria-controls",o.ariaControls)("aria-disabled",o.disabled&&o.disabledInteractive?!0:null)("aria-expanded",o.ariaExpanded)("aria-owns",o.ariaOwns)("name",o.name)("value",o.value),m(7),x("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),m(),x("for",o.inputId)}},dependencies:[In,jl],styles:[`.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom;padding:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);margin:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox:hover>.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:hover>.mat-mdc-checkbox-ripple>.mat-ripple-element{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control+.mdc-checkbox__ripple{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;width:var(--mat-checkbox-state-layer-size, 40px);height:var(--mat-checkbox-state-layer-size, 40px);top:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);right:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox--disabled{cursor:default;pointer-events:none}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:rgba(0,0,0,0);pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1);-webkit-print-color-adjust:exact;color-adjust:exact;border-color:var(--mat-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));top:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2)}.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}@media(forced-colors: active){.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:checked)~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-hover-icon-color, var(--mat-sys-on-surface));background-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary))}.mdc-checkbox__native-control:focus:focus:not(:checked)~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mdc-checkbox__native-control:focus:focus:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.6, 1);color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:GrayText}}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);border-color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:GrayText}}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark{transition:opacity 180ms cubic-bezier(0, 0, 0.2, 1),transform 180ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mat-mdc-checkbox{display:inline-block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-touch-target,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__native-control,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__ripple,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-ripple::before,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__mixedmark{transition:none !important;animation:none !important}.mat-mdc-checkbox label{cursor:pointer}.mat-mdc-checkbox .mat-internal-form-field{color:var(--mat-checkbox-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-checkbox-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-checkbox-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-checkbox-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-checkbox-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-checkbox-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive{pointer-events:auto}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive input{cursor:default}.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{cursor:default;color:var(--mat-checkbox-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{color:GrayText}}.mat-mdc-checkbox label:empty{display:none}.mat-mdc-checkbox .mdc-checkbox__ripple{opacity:0}.mat-mdc-checkbox .mat-mdc-checkbox-ripple,.mdc-checkbox__ripple{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-checkbox .mat-mdc-checkbox-ripple:not(:empty),.mdc-checkbox__ripple:not(:empty){transform:translateZ(0)}.mat-mdc-checkbox-ripple .mat-ripple-element{opacity:.1}.mat-mdc-checkbox-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-checkbox-touch-target-size, 48px);width:var(--mat-checkbox-touch-target-size, 48px);transform:translate(-50%, -50%);display:var(--mat-checkbox-touch-target-display, block)}.mat-mdc-checkbox .mat-mdc-checkbox-ripple::before{border-radius:50%}.mdc-checkbox__native-control:focus~.mat-focus-indicator::before{content:""}
|
|
376
|
+
`],encapsulation:2,changeDetection:0})}return n})(),Ef=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[_m,le,le]})}return n})();var Aw=["button"],Dw=["*"];function Iw(n,t){if(n&1&&(s(0,"div",2),F(1,"mat-pseudo-checkbox",6),c()),n&2){let e=g();m(),x("disabled",e.disabled)}}var Tf=new ee("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:Rw});function Rw(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}var Pf=new ee("MatButtonToggleGroup"),Fw={provide:Kt,useExisting:at(()=>bm),multi:!0},Kl=class{source;value;constructor(t,e){this.source=t,this.value=e}},bm=(()=>{class n{_changeDetector=d(Re);_dir=d(Ct,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck()}_name=d(Fe).getId("mat-button-toggle-group-");vertical;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(i=>i.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value)}valueChange=new H;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new H;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let e=d(Tf,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this.hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new ko(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex()}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_keydown(e){if(this.multiple||this.disabled||vt(e))return;let o=e.target.id,r=this._buttonToggles.toArray().findIndex(l=>l.buttonId===o),a=null;switch(e.keyCode){case 32:case 13:a=this._buttonToggles.get(r)||null;break;case 38:a=this._getNextButton(r,-1);break;case 37:a=this._getNextButton(r,this.dir==="ltr"?-1:1);break;case 40:a=this._getNextButton(r,1);break;case 39:a=this._getNextButton(r,this.dir==="ltr"?1:-1);break;default:return}a&&(e.preventDefault(),a._onButtonClick(),a.focus())}_emitChangeEvent(e){let i=new Kl(e,this.value);this._rawValue=i.value,this._controlValueAccessorChangeFn(i.value),this.change.emit(i)}_syncButtonToggle(e,i,o=!1,r=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?i?this._selectionModel.select(e):this._selectionModel.deselect(e):r=!0,r?Promise.resolve().then(()=>this._updateModelValue(e,o)):this._updateModelValue(e,o)}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(i=>e.value!=null&&i===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let i=this._buttonToggles.get(e);if(!i.disabled){i.tabIndex=0;break}}}_getNextButton(e,i){let o=this._buttonToggles;for(let r=1;r<=o.length;r++){let a=(e+i*r+o.length)%o.length,l=o.get(a);if(l&&!l.disabled)return l}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let i=this._buttonToggles.toArray();if(this.multiple&&e?(Array.isArray(e),this._clearSelection(),e.forEach(o=>this._selectValue(o,i))):(this._clearSelection(),this._selectValue(e,i)),!this.multiple&&i.every(o=>o.tabIndex===-1)){for(let o of i)if(!o.disabled){o.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,i){for(let o of i)if(o.value===e){o.checked=!0,this._selectionModel.select(o),this.multiple||(o.tabIndex=0);break}}_updateModelValue(e,i){i&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Z({type:n,selectors:[["mat-button-toggle-group"]],contentQueries:function(i,o,r){if(i&1&&Tt(r,Zl,5),i&2){let a;W(a=U())&&(o._buttonToggles=a)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(i,o){i&1&&_("keydown",function(a){return o._keydown(a)}),i&2&&(Y("role",o.multiple?"group":"radiogroup")("aria-disabled",o.disabled),A("mat-button-toggle-vertical",o.vertical)("mat-button-toggle-group-appearance-standard",o.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",J],value:"value",multiple:[2,"multiple","multiple",J],disabled:[2,"disabled","disabled",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",J],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",J]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[pe([Fw,{provide:Pf,useExisting:n}])]})}return n})(),Zl=(()=>{class n{_changeDetectorRef=d(Re);_elementRef=d(K);_focusMonitor=d(Vi);_idGenerator=d(Fe);_animationDisabled=We();_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e)}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new H;constructor(){d(Lt).load(Rn);let e=d(Pf,{optional:!0}),i=d(new On("tabindex"),{optional:!0})||"",o=d(Tf,{optional:!0});this._tabIndex=Te(parseInt(i)||0),this.buttonToggleGroup=e,this.appearance=o&&o.appearance?o.appearance:"standard",this.disabledInteractive=o?.disabledInteractive??!1}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=!0:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,!1,!1,!0)}focus(e){this._buttonElement.nativeElement.focus(e)}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?!0:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let i=this.buttonToggleGroup._buttonToggles.find(o=>o.tabIndex===0);i&&(i.tabIndex=-1),this.tabIndex=0}this.change.emit(new Kl(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["mat-button-toggle"]],viewQuery:function(i,o){if(i&1&&ne(Aw,5),i&2){let r;W(r=U())&&(o._buttonElement=r.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(i,o){i&1&&_("focus",function(){return o.focus()}),i&2&&(Y("aria-label",null)("aria-labelledby",null)("id",o.id)("name",null),A("mat-button-toggle-standalone",!o.buttonToggleGroup)("mat-button-toggle-checked",o.checked)("mat-button-toggle-disabled",o.disabled)("mat-button-toggle-disabled-interactive",o.disabledInteractive)("mat-button-toggle-appearance-standard",o.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",J],appearance:"appearance",checked:[2,"checked","checked",J],disabled:[2,"disabled","disabled",J],disabledInteractive:[2,"disabledInteractive","disabledInteractive",J]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:Dw,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(i,o){if(i&1){let r=E();He(),s(0,"button",1,0),_("click",function(){return v(r),y(o._onButtonClick())}),w(2,Iw,2,1,"div",2),s(3,"span",3),he(4),c()(),F(5,"span",4)(6,"span",5)}if(i&2){let r=ti(1);x("id",o.buttonId)("disabled",o.disabled&&!o.disabledInteractive||null),Y("role",o.isSingleSelector()?"radio":"button")("tabindex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("aria-pressed",o.isSingleSelector()?null:o.checked)("aria-checked",o.isSingleSelector()?o.checked:null)("name",o._getButtonName())("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledby)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),m(2),S(o.buttonToggleGroup&&(!o.buttonToggleGroup.multiple&&!o.buttonToggleGroup.hideSingleSelectionIndicator||o.buttonToggleGroup.multiple&&!o.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),m(4),x("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)}},dependencies:[In,Gl],styles:[`.mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);border-radius:var(--mat-button-toggle-legacy-shape);transform:translateZ(0)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-button-toggle-legacy-text-color);font-family:var(--mat-button-toggle-legacy-label-text-font);font-size:var(--mat-button-toggle-legacy-label-text-size);line-height:var(--mat-button-toggle-legacy-label-text-line-height);font-weight:var(--mat-button-toggle-legacy-label-text-weight);letter-spacing:var(--mat-button-toggle-legacy-label-text-tracking);--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-legacy-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-legacy-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-button-toggle-legacy-selected-state-text-color);background-color:var(--mat-button-toggle-legacy-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-button-toggle-legacy-disabled-state-text-color);background-color:var(--mat-button-toggle-legacy-disabled-state-background-color);--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-legacy-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-button-toggle-legacy-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-button-toggle-background-color, transparent);font-family:var(--mat-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-button-toggle-legacy-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-button-toggle-legacy-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius: var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}
|
|
377
|
+
`],encapsulation:2,changeDetection:0})}return n})(),Of=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=re({type:n});static \u0275inj=oe({imports:[le,as,Zl,le]})}return n})();var Vw=(n,t)=>t.id,Lw=(n,t)=>t.value;function jw(n,t){if(n&1&&(s(0,"mat-option",5),h(1),c()),n&2){let e=t.$implicit;x("value",e.id),m(),ae(" ",e.name," ")}}function zw(n,t){if(n&1){let e=E();s(0,"mat-checkbox",35),_("change",function(){let o=v(e).$implicit,r=g();return y(r.toggleDayOfWeek(o.value))}),h(1),c()}if(n&2){let e=t.$implicit,i=g();x("checked",i.isDaySelected(e.value)),m(),ae(" ",e.label," ")}}function Bw(n,t){if(n&1){let e=E();s(0,"mat-form-field",2)(1,"mat-label"),h(2,"Number of Occurrences"),c(),s(3,"input",10),j("ngModelChange",function(o){v(e);let r=g();return L(r.endOccurrences,o)||(r.endOccurrences=o),y(o)}),c()()}if(n&2){let e=g();m(3),V("ngModel",e.endOccurrences)}}function Hw(n,t){if(n&1){let e=E();s(0,"mat-form-field",2)(1,"mat-label"),h(2,"End Date"),c(),s(3,"input",36),j("ngModelChange",function(o){v(e);let r=g();return L(r.endTimestamp,o)||(r.endTimestamp=o),y(o)}),c()()}if(n&2){let e=g();m(3),V("ngModel",e.endTimestamp)}}function Ww(n,t){if(n&1){let e=E();s(0,"div")(1,"mat-form-field",2)(2,"mat-label"),h(3,"Parameter Value"),c(),s(4,"input",37),j("ngModelChange",function(o){v(e);let r=g();return L(r.simpleParameter,o)||(r.simpleParameter=o),y(o)}),c(),s(5,"mat-hint"),h(6),c()()()}if(n&2){let e=g();m(4),V("ngModel",e.simpleParameter),m(2),ae("Simple value for ","{{PARAMETERS}}"," placeholder or appended to first command")}}function Uw(n,t){if(n&1){let e=E();s(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),h(3,"Key"),c(),s(4,"input",42),j("ngModelChange",function(o){let r=v(e).$implicit;return L(r.key,o)||(r.key=o),y(o)}),c()(),s(5,"mat-form-field",43)(6,"mat-label"),h(7,"Value"),c(),s(8,"input",44),j("ngModelChange",function(o){let r=v(e).$implicit;return L(r.value,o)||(r.value=o),y(o)}),c()(),s(9,"button",45),_("click",function(){let o=v(e).$index,r=g(3);return y(r.removeParameter(o))}),s(10,"mat-icon"),h(11,"delete"),c()()()}if(n&2){let e=t.$implicit;m(4),V("ngModel",e.key),m(4),V("ngModel",e.value)}}function $w(n,t){if(n&1&&(s(0,"div",39),Oe(1,Uw,12,2,"div",40,Jn),c()),n&2){let e=g(2);m(),Ae(e.parameters)}}function qw(n,t){if(n&1){let e=E();s(0,"div")(1,"div",26)(2,"button",38),_("click",function(){v(e);let o=g();return y(o.addParameter())}),s(3,"mat-icon"),h(4,"add"),c()()(),w(5,$w,3,0,"div",39),s(6,"p",19),h(7),c()()}if(n&2){let e=g();m(5),S(e.parameters.length>0?5:-1),m(2),ae("Key-value pairs for ","{{key}}"," placeholders in prompt commands")}}function Gw(n,t){if(n&1&&(s(0,"div",31)(1,"mat-icon"),h(2,"error"),c(),s(3,"span"),h(4),c()()),n&2){let e=g();m(4),B(e.errorMessage)}}var Aa=class n{schedulerApi=d(Er);promptApi=d(hi);dialogRef=d(ii);availablePrompts=[];isLoadingPrompts=!1;name="";promptId="";enabled=!0;startTimestamp="";intervalValue=1;intervalUnit="h";daysOfWeek=[];endConditionType="none";endOccurrences=10;endTimestamp="";parameterMode="simple";simpleParameter="";parameters=[];isSaving=!1;errorMessage="";isEditMode=!1;schedulerId="";data=d(Wi);daysOfWeekOptions=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}];constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){if(this.loadPrompts(),this.isEditMode||(this.startTimestamp=this.formatDateForInput(new Date)),this.isEditMode&&this.data.scheduler){if(this.schedulerId=this.data.scheduler.id,this.name=this.data.scheduler.name,this.promptId=this.data.scheduler.promptId,this.enabled=this.data.scheduler.enabled,this.data.scheduler.schedule.startTimestamp){let e=new Date(this.data.scheduler.schedule.startTimestamp);this.startTimestamp=this.formatDateForInput(e)}let t=this.data.scheduler.schedule.interval.match(/^(\d+)(min|h|d|M)$/);t&&t[1]&&t[2]&&(this.intervalValue=parseInt(t[1],10),this.intervalUnit=t[2]),this.daysOfWeek=this.data.scheduler.schedule.daysOfWeek||[],this.data.scheduler.schedule.endCondition&&(this.endConditionType=this.data.scheduler.schedule.endCondition.type,this.endConditionType==="occurrences"?this.endOccurrences=this.data.scheduler.schedule.endCondition.value:this.endConditionType==="endTimestamp"&&(this.endTimestamp=this.data.scheduler.schedule.endCondition.value)),this.data.scheduler.parameters&&(typeof this.data.scheduler.parameters=="object"&&Object.keys(this.data.scheduler.parameters).length===1&&"PARAMETERS"in this.data.scheduler.parameters?(this.parameterMode="simple",this.simpleParameter=String(this.data.scheduler.parameters.PARAMETERS)):(this.parameterMode="structured",this.parameters=Object.entries(this.data.scheduler.parameters).map(([e,i])=>({key:e,value:String(i)}))))}}loadPrompts(){this.isLoadingPrompts=!0,this.promptApi.listPrompts().subscribe({next:t=>{this.availablePrompts=t,this.isLoadingPrompts=!1},error:t=>{console.error("Error loading prompts:",t),this.errorMessage="Failed to load prompts",this.isLoadingPrompts=!1}})}toggleDayOfWeek(t){let e=this.daysOfWeek.indexOf(t);e>-1?this.daysOfWeek.splice(e,1):this.daysOfWeek.push(t),this.daysOfWeek.sort()}isDaySelected(t){return this.daysOfWeek.includes(t)}addParameter(){this.parameters.push({key:"",value:""})}removeParameter(t){this.parameters.splice(t,1)}trackByIndex(t){return t}formatDateForInput(t){let e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");return`${e}-${i}-${o}T${r}:${a}`}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!this.promptId)return this.errorMessage="Prompt is required",!1;if(this.intervalValue<1)return this.errorMessage="Interval must be at least 1",!1;switch(this.intervalUnit){case"min":if(this.intervalValue>59)return this.errorMessage="Minutes interval must be between 1 and 59 (use hours for longer)",!1;break;case"h":if(this.intervalValue>24)return this.errorMessage="Hours interval must be between 1 and 24 (use days for longer)",!1;break;case"d":if(this.intervalValue>31)return this.errorMessage="Days interval must be between 1 and 31 (use months for longer)",!1;break;case"M":if(this.intervalValue>12)return this.errorMessage="Months interval must be between 1 and 12",!1;break}return this.endConditionType==="occurrences"&&this.endOccurrences<1?(this.errorMessage="Occurrences must be at least 1",!1):this.endConditionType==="endTimestamp"&&!this.endTimestamp?(this.errorMessage="End date is required",!1):!0}buildSchedule(){let e={startTimestamp:(this.startTimestamp?new Date(this.startTimestamp):new Date).toISOString(),interval:`${this.intervalValue}${this.intervalUnit}`};return this.daysOfWeek.length>0&&(e.daysOfWeek=[...this.daysOfWeek]),this.endConditionType==="occurrences"?e.endCondition={type:"occurrences",value:this.endOccurrences}:this.endConditionType==="endTimestamp"&&(e.endCondition={type:"endTimestamp",value:this.endTimestamp}),e}buildParameters(){if(this.parameterMode==="simple")return this.simpleParameter.trim()?{PARAMETERS:this.simpleParameter.trim()}:void 0;let t=this.parameters.filter(i=>i.key.trim());if(t.length===0)return;let e={};return t.forEach(i=>{e[i.key]=i.value}),e}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildSchedule(),e=this.buildParameters();this.isSaving=!0,this.isEditMode&&this.schedulerId?this.schedulerApi.updateScheduler(this.schedulerId,{name:this.name.trim(),enabled:this.enabled,promptId:this.promptId,schedule:t,parameters:e}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error updating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to update scheduler",this.isSaving=!1}}):this.schedulerApi.createScheduler({name:this.name.trim(),promptId:this.promptId,schedule:t,parameters:e,enabled:this.enabled}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:i=>{console.error("Error creating scheduler:",i),this.errorMessage=i?.error?.error||i?.message||"Failed to create scheduler",this.isSaving=!1}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-scheduler-form"]],decls:89,vars:17,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","My Scheduler","required","",3,"ngModelChange","ngModel"],["required","",3,"ngModelChange","ngModel"],[3,"value"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel"],[1,"interval-section"],[1,"interval-fields"],["appearance","outline",1,"interval-value"],["matInput","","type","number","min","1","required","",3,"ngModelChange","ngModel"],["appearance","outline",1,"interval-unit"],["value","min"],["value","h"],["value","d"],["value","M"],[1,"days-section"],[1,"days-checkboxes"],[3,"checked"],[1,"hint"],[1,"end-condition-section"],[3,"ngModelChange","ngModel"],["value","none"],["value","occurrences"],["value","endTimestamp"],[1,"parameters-section"],[1,"section-header"],[1,"mode-toggle",3,"ngModelChange","ngModel"],["value","simple"],["value","structured"],[1,"enabled-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"change","checked"],["matInput","","type","datetime-local","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g., 1234 or staging",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add parameter",3,"click"],[1,"parameters-list"],[1,"parameter-item"],["appearance","outline",1,"param-key"],["matInput","","placeholder","parameterName",3,"ngModelChange","ngModel"],["appearance","outline",1,"param-value"],["matInput","","placeholder","value",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove parameter",1,"remove-btn",3,"click"]],template:function(e,i){e&1&&(s(0,"h2",0),h(1),c(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),c(),s(7,"input",3),j("ngModelChange",function(r){return L(i.name,r)||(i.name=r),r}),c(),s(8,"mat-hint"),h(9,"A descriptive name for this scheduler"),c()(),s(10,"mat-form-field",2)(11,"mat-label"),h(12,"Prompt"),c(),s(13,"mat-select",4),j("ngModelChange",function(r){return L(i.promptId,r)||(i.promptId=r),r}),Oe(14,jw,2,2,"mat-option",5,Vw),c(),s(16,"mat-hint"),h(17,"Select the prompt to execute"),c()(),s(18,"mat-form-field",2)(19,"mat-label"),h(20,"Start Date & Time"),c(),s(21,"input",6),j("ngModelChange",function(r){return L(i.startTimestamp,r)||(i.startTimestamp=r),r}),c(),s(22,"mat-hint"),h(23,"When to start the scheduler (leave empty for now)"),c()(),s(24,"div",7)(25,"h3"),h(26,"Schedule Interval"),c(),s(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),h(30,"Every"),c(),s(31,"input",10),j("ngModelChange",function(r){return L(i.intervalValue,r)||(i.intervalValue=r),r}),c()(),s(32,"mat-form-field",11)(33,"mat-label"),h(34,"Unit"),c(),s(35,"mat-select",4),j("ngModelChange",function(r){return L(i.intervalUnit,r)||(i.intervalUnit=r),r}),s(36,"mat-option",12),h(37,"Minutes (1-59)"),c(),s(38,"mat-option",13),h(39,"Hours (1-24)"),c(),s(40,"mat-option",14),h(41,"Days (1-31)"),c(),s(42,"mat-option",15),h(43,"Months (1-12)"),c()()()()(),s(44,"div",16)(45,"h3"),h(46,"Days of Week (Optional)"),c(),s(47,"div",17),Oe(48,zw,2,2,"mat-checkbox",18,Lw),c(),s(50,"p",19),h(51,"Leave empty to run every day"),c()(),s(52,"div",20)(53,"h3"),h(54,"End Condition (Optional)"),c(),s(55,"mat-form-field",2)(56,"mat-label"),h(57,"End Type"),c(),s(58,"mat-select",21),j("ngModelChange",function(r){return L(i.endConditionType,r)||(i.endConditionType=r),r}),s(59,"mat-option",22),h(60,"Never (run indefinitely)"),c(),s(61,"mat-option",23),h(62,"After X occurrences"),c(),s(63,"mat-option",24),h(64,"Until specific date"),c()()(),w(65,Bw,4,1,"mat-form-field",2),w(66,Hw,4,1,"mat-form-field",2),c(),s(67,"div",25)(68,"div",26)(69,"h3"),h(70,"Parameters (Optional)"),c(),s(71,"mat-button-toggle-group",27),j("ngModelChange",function(r){return L(i.parameterMode,r)||(i.parameterMode=r),r}),s(72,"mat-button-toggle",28),h(73,"Simple"),c(),s(74,"mat-button-toggle",29),h(75,"Structured"),c()()(),w(76,Ww,7,2,"div"),w(77,qw,8,2,"div"),c(),s(78,"div",30)(79,"mat-checkbox",21),j("ngModelChange",function(r){return L(i.enabled,r)||(i.enabled=r),r}),h(80,"Enabled"),c(),s(81,"p",19),h(82,"Scheduler will only run if enabled"),c()(),w(83,Gw,5,1,"div",31),c()(),s(84,"mat-dialog-actions",32)(85,"button",33),_("click",function(){return i.cancel()}),h(86,"Cancel"),c(),s(87,"button",34),_("click",function(){return i.save()}),h(88),c()()),e&2&&(m(),B(i.isEditMode?"Edit Scheduler":"Create Scheduler"),m(6),V("ngModel",i.name),m(6),V("ngModel",i.promptId),m(),Ae(i.availablePrompts),m(7),V("ngModel",i.startTimestamp),m(10),V("ngModel",i.intervalValue),m(4),V("ngModel",i.intervalUnit),m(13),Ae(i.daysOfWeekOptions),m(10),V("ngModel",i.endConditionType),m(7),S(i.endConditionType==="occurrences"?65:-1),m(),S(i.endConditionType==="endTimestamp"?66:-1),m(5),V("ngModel",i.parameterMode),m(5),S(i.parameterMode==="simple"?76:-1),m(),S(i.parameterMode==="structured"?77:-1),m(2),V("ngModel",i.enabled),m(4),S(i.errorMessage?83:-1),m(2),x("disabled",i.isSaving),m(2),x("disabled",i.isSaving),m(),ae(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[De,Ke,ze,ya,Xe,go,xa,Ue,lo,un,fn,gn,xt,It,yt,Zt,pi,$t,Ut,wn,ut,Qe,xe,Oa,gm,So,Ef,_m,Of,bm,Zl],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:600px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.interval-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%]{display:flex;gap:1rem}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%], .interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.days-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:.5rem}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{min-width:120px}.days-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.end-condition-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] .mode-toggle[_ngcontent-%COMP%]{height:32px}.parameters-section[_ngcontent-%COMP%] .parameters-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-key[_ngcontent-%COMP%]{flex:1}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-value[_ngcontent-%COMP%]{flex:2}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.parameters-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.enabled-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.enabled-section[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem}.enabled-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};function Yw(n,t){n&1&&(s(0,"div",12),h(1,"Loading schedulers..."),c())}function Qw(n,t){if(n&1&&(s(0,"div",13),h(1),c()),n&2){let e=g();m(),B(e.errorMessage)}}function Xw(n,t){n&1&&(s(0,"div",14),h(1," No schedulers found. Create your first scheduler to automate prompt execution. "),c())}function Kw(n,t){n&1&&(s(0,"div",14),h(1," No schedulers match your search. "),c())}function Zw(n,t){if(n&1&&(s(0,"span",31),h(1),c()),n&2){let e=g().$implicit;x("title",Pn("Created by ",e.createdBy)),m(),ae(" \u{1F464} ",e.createdBy," ")}}function Jw(n,t){if(n&1&&(s(0,"div",22)(1,"span",23),h(2,"Last Run:"),c(),s(3,"span",24),h(4),to(5,"date"),c()()),n&2){let e=g().$implicit;m(4),B(Vr(5,1,e.lastRun,"short"))}}function eS(n,t){if(n&1){let e=E();s(0,"div",17)(1,"div",18)(2,"h3"),h(3),s(4,"span",19),h(5),c(),Ge(6,Zw,2,3,"span",20),c(),s(7,"div",21)(8,"div",22)(9,"span",23),h(10,"Prompt:"),c(),s(11,"span",24),h(12),c()(),s(13,"div",22)(14,"span",23),h(15,"Schedule:"),c(),s(16,"span",24),h(17),c()(),s(18,"div",22)(19,"span",23),h(20,"Next Run:"),c(),s(21,"span",24),h(22),c()(),Ge(23,Jw,6,4,"div",25),c()(),s(24,"div",26)(25,"button",27),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.editScheduler(o))}),h(26,"Edit"),c(),s(27,"button",28),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.toggleEnabled(o))}),h(28),c(),s(29,"button",29),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.runNow(o.id))}),h(30,"Run Now"),c(),s(31,"button",30),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.deleteScheduler(o.id))}),h(32,"Delete"),c()()()}if(n&2){let e=t.$implicit,i=g(2);m(3),ae(" ",e.name," "),m(),A("enabled",e.enabled),m(),ae(" ",e.enabled?"Enabled":"Disabled"," "),m(),x("ngIf",e.createdBy!==i.getCurrentUsername()),m(6),B(i.getPromptName(e.promptId)),m(5),B(i.formatInterval(e.schedule.interval)),m(5),B(i.formatNextRun(e.nextRun)),m(),x("ngIf",e.lastRun),m(4),A("btn-enabled",e.enabled)("btn-disabled",!e.enabled),m(),ae(" ",e.enabled?"Disable":"Enable"," ")}}function tS(n,t){if(n&1&&(s(0,"div",15),Ge(1,eS,33,14,"div",16),c()),n&2){let e=g();m(),x("ngForOf",e.filteredSchedulers)}}var Jl=class n{schedulerApi=d(Er);promptApi=d(hi);configApi=d(Ki);dialog=d(wi);schedulers=[];filteredSchedulers=[];prompts=[];searchQuery="";showOnlyMine=!0;isLoading=!1;errorMessage="";currentUsername="";ngOnInit(){this.configApi.getUserConfig().subscribe({next:t=>{this.currentUsername=t.username??"",console.log("[SCHEDULER_MANAGER] Current username:",this.currentUsername)},error:t=>{console.error("[SCHEDULER_MANAGER] Error loading user config:",t)}}),this.loadPrompts(),this.loadSchedulers()}loadPrompts(){this.promptApi.listPrompts().subscribe({next:t=>{this.prompts=t},error:t=>{console.error("Error loading prompts:",t)}})}loadSchedulers(){this.isLoading=!0,this.schedulerApi.listSchedulers().subscribe({next:t=>{this.schedulers=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading schedulers:",t),this.errorMessage="Failed to load schedulers",this.isLoading=!1}})}deleteScheduler(t){confirm("Are you sure you want to delete this scheduler?")&&this.schedulerApi.deleteScheduler(t).subscribe({next:()=>{this.loadSchedulers()},error:e=>{console.error("Error deleting scheduler:",e);let i=e?.error?.error??e?.message??"Failed to delete scheduler";alert(`Failed to delete scheduler: ${i}`)}})}toggleEnabled(t){(t.enabled?this.schedulerApi.disableScheduler(t.id):this.schedulerApi.enableScheduler(t.id)).subscribe({next:()=>{this.loadSchedulers()},error:i=>{console.error("Error toggling scheduler:",i);let o=i?.error?.error??i?.message??"Failed to toggle scheduler";alert(`Failed to toggle scheduler: ${o}`)}})}runNow(t){this.schedulerApi.runSchedulerNow(t).subscribe({next:e=>{alert(`Scheduler executed successfully! Thread ID: ${e.threadId}`),this.loadSchedulers()},error:e=>{console.error("Error running scheduler:",e);let i=e?.error?.error??e?.message??"Failed to run scheduler";alert(`Failed to run scheduler: ${i}`)}})}formatNextRun(t){return t?new Date(t).toLocaleString():"Expired or completed"}getCurrentUsername(){return this.currentUsername}getPromptName(t){let e=this.prompts.find(i=>i.id===t);return e?e.name:t}formatInterval(t){let e=RegExp(/^(\d+)(min|h|d|M)$/).exec(t);if(!e)return t;let[,i,o]=e;if(!i||!o)return t;let a={min:"minute",h:"hour",d:"day",M:"month"}[o]??o;return`Every ${i} ${a}${parseInt(i,10)>1?"s":""}`}normalizeUsername(t){return t.replace(/[.\s]+/g,"_")}isMyScheduler(t){if(!this.currentUsername)return!1;let e=this.normalizeUsername(this.currentUsername.toLowerCase());return this.normalizeUsername(t.createdBy.toLowerCase())===e}applyFilter(){let t=this.searchQuery.toLowerCase().trim(),e=this.showOnlyMine&&this.currentUsername?this.schedulers.filter(i=>this.isMyScheduler(i)):[...this.schedulers];t&&(e=e.filter(i=>i.name.toLowerCase().includes(t)||i.promptId.toLowerCase().includes(t)||this.getPromptName(i.promptId).toLowerCase().includes(t)?!0:i.createdBy.toLowerCase().includes(t))),this.filteredSchedulers=e}onSearchChange(){this.applyFilter()}createScheduler(){this.dialog.open(Aa,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadSchedulers()})}editScheduler(t){this.schedulerApi.getScheduler(t.id).subscribe({next:e=>{this.dialog.open(Aa,{width:"700px",maxHeight:"90vh",data:{mode:"edit",scheduler:e}}).afterClosed().subscribe(o=>{o&&this.loadSchedulers()})},error:e=>{console.error("Error loading scheduler details:",e);let i=e?.error?.error??e?.message??"Failed to load scheduler details";alert(`Failed to load scheduler details: ${i}`)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-scheduler-manager"]],decls:23,vars:7,consts:[[1,"scheduler-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name, prompt, author...",3,"ngModelChange","input","ngModel"],["matPrefix",""],["color","primary",1,"mine-toggle",3,"ngModelChange","change","ngModel"],[1,"btn-create",3,"click"],["class","loading",4,"ngIf"],["class","error",4,"ngIf"],["class","empty",4,"ngIf"],["class","scheduler-list",4,"ngIf"],[1,"loading"],[1,"error"],[1,"empty"],[1,"scheduler-list"],["class","scheduler-item",4,"ngFor","ngForOf"],[1,"scheduler-item"],[1,"scheduler-info"],[1,"status-badge"],["class","owner-badge",3,"title",4,"ngIf"],[1,"details"],[1,"detail-row"],[1,"label"],[1,"value"],["class","detail-row",4,"ngIf"],[1,"scheduler-actions"],[1,"btn-primary",3,"click"],[3,"click"],[1,"btn-accent",3,"click"],[1,"btn-danger",3,"click"],[1,"owner-badge",3,"title"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Schedulers"),c(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),c(),s(8,"input",4),j("ngModelChange",function(r){return L(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),c(),s(9,"mat-icon",5),h(10,"search"),c()(),s(11,"mat-slide-toggle",6),j("ngModelChange",function(r){return L(i.showOnlyMine,r)||(i.showOnlyMine=r),r}),_("change",function(){return i.applyFilter()}),h(12," Mine "),c(),s(13,"button",7),_("click",function(){return i.createScheduler()}),s(14,"mat-icon"),h(15,"add"),c(),s(16,"span"),h(17,"Create Scheduler"),c()()()(),Ge(18,Yw,2,0,"div",8)(19,Qw,2,1,"div",9)(20,Xw,2,0,"div",10)(21,Kw,2,0,"div",10)(22,tS,2,1,"div",11),c()),e&2&&(m(8),V("ngModel",i.searchQuery),m(3),V("ngModel",i.showOnlyMine),m(7),x("ngIf",i.isLoading),m(),x("ngIf",i.errorMessage),m(),x("ngIf",!i.isLoading&&i.schedulers.length===0),m(),x("ngIf",!i.isLoading&&i.schedulers.length>0&&i.filteredSchedulers.length===0),m(),x("ngIf",!i.isLoading&&i.filteredSchedulers.length>0))},dependencies:[De,Qa,Xa,Ke,ze,Xe,Ue,Qe,xe,Zt,pi,$t,Ut,wo,ut,Bl,xo,jr],styles:[".scheduler-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .mine-toggle[_ngcontent-%COMP%]{margin-bottom:-1.25em}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.scheduler-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.scheduler-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.scheduler-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.scheduler-info[_ngcontent-%COMP%]{flex:1}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem;display:flex;align-items:center;gap:.5rem}.scheduler-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] .owner-badge[_ngcontent-%COMP%]{font-size:.75rem;padding:.25rem .5rem;background:#2196f3;color:#fff;border-radius:4px;font-weight:400}.scheduler-info[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%]{padding:.25rem .5rem;font-size:.75rem;border-radius:4px;background:var(--color-text-secondary);color:#fff}.scheduler-info[_ngcontent-%COMP%] .status-badge.enabled[_ngcontent-%COMP%]{background:var(--color-success)}.scheduler-info[_ngcontent-%COMP%] .details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;font-size:.9rem}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:600;min-width:100px;color:var(--color-text-secondary)}.scheduler-info[_ngcontent-%COMP%] .detail-row[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{color:var(--color-text)}.scheduler-actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduler-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;white-space:nowrap}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]{background:var(--color-secondary);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-secondary[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]{background:#4caf50;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-enabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]{background:#9e9e9e;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-disabled[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]{background:#ff9800;color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-accent[_ngcontent-%COMP%]:hover{opacity:.9}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.scheduler-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var Or=class n{http=d(Ye);projectState=d(we);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new oi(i=>{let o=new FileReader;o.onload=()=>{let r=o.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(i)},o.onerror=()=>i.error(o.error),o.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${t}`)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function iS(n,t){n&1&&(s(0,"p",15),h(1,"No integrations defined \u2014 agent will have access to all tools."),c())}function nS(n,t){if(n&1){let e=E();s(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),h(3,"Integration"),c(),s(4,"input",23),j("ngModelChange",function(o){let r=v(e).$implicit;return L(r.integration,o)||(r.integration=o),y(o)}),c()(),s(5,"mat-form-field",24)(6,"mat-label"),h(7,"Tools (comma-separated)"),c(),s(8,"input",25),j("ngModelChange",function(o){let r=v(e).$implicit;return L(r.tools,o)||(r.tools=o),y(o)}),c()(),s(9,"button",26),_("click",function(){let o=v(e).$index,r=g();return y(r.removeIntegrationRow(o))}),s(10,"mat-icon"),h(11,"delete"),c()()()}if(n&2){let e=t.$implicit;m(4),V("ngModel",e.integration),m(4),V("ngModel",e.tools)}}function oS(n,t){if(n&1&&(s(0,"p",30),h(1),c()),n&2){let e=g(2);m(),B(e.docUploadError)}}function rS(n,t){n&1&&(s(0,"p",15),h(1,"No mandatory documents defined."),c())}function aS(n,t){if(n&1&&F(0,"option",35),n&2){let e=t.$implicit;x("value","documents/"+e)}}function sS(n,t){if(n&1){let e=E();s(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),h(3,"Document path"),c(),s(4,"input",33),j("ngModelChange",function(o){let r=v(e).$index,a=g(2);return L(a.mandatoryDocs[r],o)||(a.mandatoryDocs[r]=o),y(o)}),c(),s(5,"datalist",34),Oe(6,aS,1,1,"option",35,ih),c()(),s(8,"button",26),_("click",function(){let o=v(e).$index,r=g(2);return y(r.removeDocRow(o))}),s(9,"mat-icon"),h(10,"delete"),c()()()}if(n&2){let e=t.$index,i=g(2);m(4),V("ngModel",i.mandatoryDocs[e]),Y("list","docs-list-"+e),m(),x("id","docs-list-"+e),m(),Ae(i.availableDocuments)}}function lS(n,t){if(n&1){let e=E();s(0,"div",6)(1,"span"),h(2,"Mandatory Documents"),c(),s(3,"button",27),_("click",function(){v(e);let o=g();return y(o.addDocRow())}),s(4,"mat-icon"),h(5,"add"),c()(),s(6,"label",28)(7,"mat-icon"),h(8,"upload_file"),c(),s(9,"input",29),_("change",function(o){v(e);let r=g();return y(r.onDocFileSelected(o))}),c()()(),w(10,oS,2,1,"p",30),w(11,rS,2,0,"p",15),Oe(12,sS,11,3,"div",31,Jn)}if(n&2){let e=g();m(6),A("uploading",e.isUploadingDoc),m(3),x("disabled",e.isUploadingDoc),m(),S(e.docUploadError?10:-1),m(),S(e.mandatoryDocs.length===0?11:-1),m(),Ae(e.mandatoryDocs)}}function cS(n,t){n&1&&(s(0,"p",15),h(1,"\u{1F4A1} Documents can be added after the agent is created."),c())}function dS(n,t){if(n&1){let e=E();s(0,"div",6),h(1,"Save to"),c(),s(2,"div",36)(3,"label",37)(4,"input",38),j("ngModelChange",function(o){v(e);let r=g();return L(r.location,o)||(r.location=o),y(o)}),c(),s(5,"div",39)(6,"div",40)(7,"span",41),h(8,"\u{1F464}"),c(),s(9,"span",42),h(10,"Project config"),c()(),s(11,"p",43),h(12),c()()(),s(13,"label",37)(14,"input",44),j("ngModelChange",function(o){v(e);let r=g();return L(r.location,o)||(r.location=o),y(o)}),c(),s(15,"div",39)(16,"div",40)(17,"span",41),h(18,"\u{1F4E6}"),c(),s(19,"span",42),h(20,"Colocated"),c()(),s(21,"p",43),h(22,"Next to coday.yaml in ./agents/ (committable)"),c()()()(),s(23,"p",15),h(24,"Storage location is permanent and cannot be changed after creation."),c()}if(n&2){let e=g();m(3),A("selected",e.location==="project"),m(),V("ngModel",e.location),m(8),Tn("~/.coday/projects/","{","name","}","/agents/ (not committed)"),m(),A("selected",e.location==="colocated"),m(),V("ngModel",e.location)}}function mS(n,t){if(n&1&&(s(0,"div",17)(1,"span",6),h(2,"Storage Location"),c(),s(3,"span",45),h(4),c(),s(5,"p",15),h(6,"Cannot be changed after creation."),c()()),n&2){let e=g();m(3),A("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),m(),ae(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function hS(n,t){if(n&1&&(s(0,"div",18)(1,"mat-icon"),h(2,"error"),c(),s(3,"span"),h(4),c()()),n&2){let e=g();m(4),B(e.errorMessage)}}var Da=class n{agentCrudApi=d(Or);agentApi=d(dr);dialogRef=d(ii);data=d(Wi);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=!1;docUploadError="";location="project";isSaving=!1;errorMessage="";isEditMode=!1;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,i])=>({integration:e,tools:i?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments()}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]})}addDocRow(){this.mandatoryDocs.push("")}removeDocRow(t){this.mandatoryDocs.splice(t,1)}onDocFileSelected(t){let e=t.target,i=e.files?.[0];i&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,i).subscribe({next:o=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(o.relativePath),this.loadAvailableDocuments(),e.value=""},error:o=>{this.isUploadingDoc=!1,this.docUploadError=o?.error?.error??o?.message??"Upload failed",e.value=""}}))}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""})}removeIntegrationRow(t){this.integrationRows.splice(t,1)}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",!1;if(!this.description.trim())return this.errorMessage="Description is required",!1;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",!1;return!0}buildDefinition(){let t=this.mandatoryDocs.map(i=>i.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(i=>i.integration.trim()).map(i=>[i.integration.trim(),i.tools.split(",").map(o=>o.trim()).filter(Boolean)])):void 0;return{name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=!0,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=!1,this.agentApi.clearAllCache(),this.dialogRef.close(!0)},error:i=>{this.isSaving=!1,this.errorMessage=i?.error?.error||i?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,i){e&1&&(s(0,"h2",0),h(1),c(),s(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),h(6,"Name"),c(),s(7,"input",3),j("ngModelChange",function(r){return L(i.name,r)||(i.name=r),r}),c(),s(8,"mat-hint"),h(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),c()(),s(10,"mat-form-field",2)(11,"mat-label"),h(12,"Description"),c(),s(13,"textarea",4),j("ngModelChange",function(r){return L(i.description,r)||(i.description=r),r}),c()(),s(14,"mat-form-field",2)(15,"mat-label"),h(16,"Instructions"),c(),s(17,"textarea",5),j("ngModelChange",function(r){return L(i.instructions,r)||(i.instructions=r),r}),c(),s(18,"mat-hint"),h(19,"System prompt / instructions sent to the AI model"),c()(),s(20,"div",6),h(21,"AI Configuration"),c(),s(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),h(25,"AI Provider"),c(),s(26,"input",9),j("ngModelChange",function(r){return L(i.aiProvider,r)||(i.aiProvider=r),r}),c()(),s(27,"mat-form-field",8)(28,"mat-label"),h(29,"Model Name"),c(),s(30,"input",10),j("ngModelChange",function(r){return L(i.modelName,r)||(i.modelName=r),r}),c()()(),s(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),h(34,"Temperature"),c(),s(35,"input",11),j("ngModelChange",function(r){return L(i.temperature,r)||(i.temperature=r),r}),c(),s(36,"mat-hint"),h(37,"Leave empty for model default"),c()(),s(38,"mat-form-field",8)(39,"mat-label"),h(40,"Max Output Tokens"),c(),s(41,"input",12),j("ngModelChange",function(r){return L(i.maxOutputTokens,r)||(i.maxOutputTokens=r),r}),c(),s(42,"mat-hint"),h(43,"Leave empty for model default"),c()()(),s(44,"mat-form-field",2)(45,"mat-label"),h(46,"OpenAI Assistant ID"),c(),s(47,"input",13),j("ngModelChange",function(r){return L(i.openaiAssistantId,r)||(i.openaiAssistantId=r),r}),c(),s(48,"mat-hint"),h(49,"If set, forces aiProvider to openai"),c()(),s(50,"div",6)(51,"span"),h(52,"Integrations"),c(),s(53,"button",14),_("click",function(){return i.addIntegrationRow()}),s(54,"mat-icon"),h(55,"add"),c()()(),w(56,iS,2,0,"p",15),Oe(57,nS,12,2,"div",16,Jn),w(59,lS,14,5)(60,cS,2,0,"p",15),w(61,dS,25,8),w(62,mS,7,5,"div",17),w(63,hS,5,1,"div",18),c()(),s(64,"mat-dialog-actions",19)(65,"button",20),_("click",function(){return i.cancel()}),h(66,"Cancel"),c(),s(67,"button",21),_("click",function(){return i.save()}),h(68),c()()),e&2&&(m(),B(i.isEditMode?"Edit Agent":"Create Agent"),m(6),V("ngModel",i.name),x("readonly",i.isEditMode),m(6),V("ngModel",i.description),m(4),V("ngModel",i.instructions),m(9),V("ngModel",i.aiProvider),m(4),V("ngModel",i.modelName),m(5),V("ngModel",i.temperature),m(6),V("ngModel",i.maxOutputTokens),m(6),V("ngModel",i.openaiAssistantId),m(9),S(i.integrationRows.length===0?56:-1),m(),Ae(i.integrationRows),m(2),S(i.isEditMode?59:60),m(2),S(i.isEditMode?-1:61),m(),S(i.isEditMode?62:-1),m(),S(i.errorMessage?63:-1),m(2),x("disabled",i.isSaving),m(2),x("disabled",i.isSaving),m(),ae(" ",i.isSaving?"Saving...":"Save"," "))},dependencies:[Ke,dl,ml,ze,ya,uo,Xe,go,xa,Ud,Ue,lo,un,fn,gn,xt,It,yt,Zt,pi,$t,Ut,wn,ut,Qe,xe,Oa,Ko],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media (max-width: 768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media (max-width: 768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media (max-width: 768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};var pS=(n,t)=>t.name;function uS(n,t){n&1&&(s(0,"div",7),h(1,"Loading agents..."),c())}function gS(n,t){if(n&1&&(s(0,"div",8),h(1),c()),n&2){let e=g();m(),B(e.errorMessage)}}function fS(n,t){n&1&&(s(0,"div",9),h(1,"No file-based agents found. Create your first agent to get started."),c())}function _S(n,t){n&1&&(s(0,"div",9),h(1,"No agents match your search."),c())}function bS(n,t){if(n&1){let e=E();s(0,"div",11)(1,"div",12)(2,"div",13)(3,"h3"),h(4),c(),s(5,"span",14),h(6),c()(),s(7,"p",15),h(8),c()(),s(9,"div",16)(10,"button",17),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.editAgent(o))}),h(11,"Edit"),c(),s(12,"button",18),_("click",function(){let o=v(e).$implicit,r=g(2);return y(r.deleteAgent(o))}),h(13,"Delete"),c()()()}if(n&2){let e=t.$implicit;m(4),B(e.name),m(),A("badge-project",e.source==="project")("badge-colocated",e.source==="colocated"),x("title",e.source==="project"?"Project config (~/.coday/)":"Colocated (next to coday.yaml)"),m(),ae(" ",e.source==="project"?"\u{1F464}":"\u{1F4E6}"," "),m(2),B(e.description)}}function vS(n,t){if(n&1&&(s(0,"div",10),Oe(1,bS,14,8,"div",11,pS),c()),n&2){let e=g();m(),Ae(e.filteredAgents)}}var ec=class n{agentCrudApi=d(Or);dialog=d(wi);agents=[];filteredAgents=[];searchQuery="";isLoading=!1;errorMessage="";ngOnInit(){this.loadAgents()}loadAgents(){this.isLoading=!0,this.errorMessage="",this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents=t,this.applyFilter(),this.isLoading=!1},error:t=>{console.error("Error loading agents:",t),this.errorMessage="Failed to load agents",this.isLoading=!1}})}applyFilter(){let t=this.searchQuery.toLowerCase().trim();this.filteredAgents=t?this.agents.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)):[...this.agents]}onSearchChange(){this.applyFilter()}createAgent(){this.dialog.open(Da,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents()})}editAgent(t){this.errorMessage="",this.agentCrudApi.getAgent(t.name).subscribe({next:e=>{this.dialog.open(Da,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(o=>{o&&this.loadAgents()})},error:e=>{console.error("Error loading agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to load agent"}})}deleteAgent(t){confirm(`Are you sure you want to delete agent "${t.name}"?`)&&(this.errorMessage="",this.agentCrudApi.deleteAgent(t.name).subscribe({next:()=>this.loadAgents(),error:e=>{console.error("Error deleting agent:",e),this.errorMessage=e?.error?.error??e?.message??"Failed to delete agent"}}))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-agent-manager"]],decls:21,vars:6,consts:[[1,"agent-manager"],[1,"header"],[1,"header-actions"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Name or description...",3,"ngModelChange","input","ngModel"],["matPrefix",""],[1,"btn-create",3,"click"],[1,"loading"],[1,"error"],[1,"empty"],[1,"agent-list"],[1,"agent-item"],[1,"agent-info"],[1,"agent-header"],[1,"source-badge",3,"title"],[1,"description"],[1,"agent-actions"],[1,"btn-primary",3,"click"],[1,"btn-danger",3,"click"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"h2"),h(3,"Agents"),c(),s(4,"div",2)(5,"mat-form-field",3)(6,"mat-label"),h(7,"Search"),c(),s(8,"input",4),j("ngModelChange",function(r){return L(i.searchQuery,r)||(i.searchQuery=r),r}),_("input",function(){return i.onSearchChange()}),c(),s(9,"mat-icon",5),h(10,"search"),c()(),s(11,"button",6),_("click",function(){return i.createAgent()}),s(12,"mat-icon"),h(13,"add"),c(),s(14,"span"),h(15,"Create Agent"),c()()()(),w(16,uS,2,0,"div",7),w(17,gS,2,1,"div",8),w(18,fS,2,0,"div",9),w(19,_S,2,0,"div",9),w(20,vS,3,0,"div",10),c()),e&2&&(m(8),V("ngModel",i.searchQuery),m(8),S(i.isLoading?16:-1),m(),S(i.errorMessage?17:-1),m(),S(!i.isLoading&&i.agents.length===0?18:-1),m(),S(!i.isLoading&&i.agents.length>0&&i.filteredAgents.length===0?19:-1),m(),S(!i.isLoading&&i.filteredAgents.length>0?20:-1))},dependencies:[Ke,ze,Xe,Ue,Qe,xe,Zt,pi,$t,Ut,wo,ut],styles:[".agent-manager[_ngcontent-%COMP%]{padding:1.5rem .5rem 1.5rem 1.5rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;padding-right:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .search-field[_ngcontent-%COMP%]{width:300px;margin-bottom:-1.25em}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border:none;border-radius:4px;background:var(--color-primary);color:#fff;cursor:pointer;font-size:1rem;font-weight:500;white-space:nowrap}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%]:hover{opacity:.9}.agent-manager[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%] .btn-create[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.loading[_ngcontent-%COMP%], .error[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{padding:1rem 1.5rem 1rem 1rem;text-align:center;color:var(--color-text-secondary)}.error[_ngcontent-%COMP%]{color:var(--color-error)}.agent-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding-right:1rem}.agent-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:1rem;border:1px solid var(--color-border);border-radius:8px;background:var(--color-surface)}.agent-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.agent-info[_ngcontent-%COMP%]{flex:1}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.5rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;font-size:1rem;cursor:help}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;border:1px solid rgba(33,150,243,.3)}.agent-info[_ngcontent-%COMP%] .agent-header[_ngcontent-%COMP%] .source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;border:1px solid rgba(76,175,80,.3)}.agent-info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{margin:0;color:var(--color-text-secondary)}.agent-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.agent-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:.5rem 1rem;border:none;border-radius:4px;cursor:pointer;font-size:.9rem}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]{background:var(--color-primary);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-primary[_ngcontent-%COMP%]:hover{opacity:.9}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]{background:var(--color-error);color:#fff}.agent-actions[_ngcontent-%COMP%] button.btn-danger[_ngcontent-%COMP%]:hover{opacity:.9}"]})};var yS=["threadSearchInput"],CS=["*"];function xS(n,t){n&1&&(s(0,"a",27),F(1,"img",28),c()),n&2&&(m(),Y("src","CODAY-Logo.png",No))}function wS(n,t){if(n&1){let e=E();s(0,"button",25),_("click",function(){v(e);let o=g();return y(o.toggle())}),s(1,"mat-icon"),h(2,"menu"),c()(),s(3,"button",26),_("click",function(){v(e);let o=g();return y(o.createNewThread())}),s(4,"mat-icon",10),h(5,"play_circle"),c()(),w(6,xS,2,1,"a",27)}if(n&2){let e=g();m(3),x("disabled",!e.selectedProjectName()),m(3),S(e.isOpen?-1:6)}}function SS(n,t){if(n&1){let e=E();s(0,"div",14)(1,"mat-icon",29),h(2,"search"),c(),s(3,"input",30,0),j("ngModelChange",function(o){v(e);let r=g();return L(r.threadSearchQuery,o)||(r.threadSearchQuery=o),y(o)}),_("input",function(){v(e);let o=g();return y(o.onThreadSearchInput())}),c(),s(5,"button",31),_("click",function(){v(e);let o=g();return y(o.closeThreadSearch())}),s(6,"mat-icon"),h(7,"close"),c()()()}if(n&2){let e=g();m(3),V("ngModel",e.threadSearchQuery)}}function kS(n,t){n&1&&(s(0,"mat-icon",18),h(1,"keyboard_arrow_up"),c())}function MS(n,t){n&1&&(s(0,"mat-icon",19),h(1,"forum"),c())}function ES(n,t){if(n&1){let e=E();s(0,"button",33),_("click",function(o){v(e);let r=g(2);return y(r.toggleThreadSearch(o))}),s(1,"mat-icon"),h(2,"search"),c()()}}function TS(n,t){if(n&1){let e=E();s(0,"a",17),_("click",function(o){return v(e),g().toggleSection("threads"),y(o.preventDefault())}),w(1,kS,2,0,"mat-icon",18)(2,MS,2,0,"mat-icon",19),s(3,"span",20),h(4,"Threads"),c(),w(5,ES,3,0,"button",32),c()}if(n&2){let e=g();A("active",e.expandedSections.threads),m(),S(e.expandedSections.threads?1:2),m(4),S(e.expandedSections.threads?5:-1)}}function PS(n,t){if(n&1){let e=E();s(0,"div",16)(1,"app-thread-selector",34),_("searchModeChange",function(o){v(e);let r=g();return y(r.onThreadSearchModeChange(o))}),c()()}if(n&2){let e=g();m(),x("searchMode",e.isThreadSearchActive)("searchQuery",e.threadSearchQuery)}}function OS(n,t){n&1&&(s(0,"mat-icon",18),h(1,"keyboard_arrow_up"),c())}function AS(n,t){n&1&&(s(0,"mat-icon",19),h(1,"tune"),c())}function DS(n,t){n&1&&(s(0,"div",21)(1,"div",35),F(2,"app-options-panel",36),c()())}function IS(n,t){if(n&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g(2).openProjectConfig(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"settings_applications"),c(),s(4,"span",20),h(5,"Project Configuration"),c()()()}}function RS(n,t){n&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"settings_applications"),c(),s(4,"span",20),h(5,"Project config (No project)"),c()()())}function FS(n,t){if(n&1&&w(0,IS,6,0,"div",13)(1,RS,6,0,"div",13),n&2){let e=g();S(e.selectedProjectName()?0:1)}}function NS(n,t){if(n&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g().openAgents(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"smart_toy"),c(),s(4,"span",20),h(5,"Agents"),c()()()}}function VS(n,t){n&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"smart_toy"),c(),s(4,"span",20),h(5,"Agents (No project)"),c()()())}function LS(n,t){if(n&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g().openPrompts(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"description"),c(),s(4,"span",20),h(5,"Prompts"),c()()()}}function jS(n,t){n&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"description"),c(),s(4,"span",20),h(5,"Prompts (No project)"),c()()())}function zS(n,t){if(n&1){let e=E();s(0,"div",13)(1,"a",17),_("click",function(o){return v(e),g().openSchedulers(),o.preventDefault(),y(o.stopPropagation())}),s(2,"mat-icon",19),h(3,"schedule"),c(),s(4,"span",20),h(5,"Schedulers"),c()()()}}function BS(n,t){n&1&&(s(0,"div",13)(1,"a",37)(2,"mat-icon",19),h(3,"schedule"),c(),s(4,"span",20),h(5,"Schedulers (No project)"),c()()())}function HS(n,t){if(n&1){let e=E();s(0,"div",24)(1,"mat-icon",38),h(2,"warning"),c(),s(3,"span",39),h(4),c(),s(5,"button",40),_("click",function(){v(e);let o=g();return y(o.configErrorMessage="")}),s(6,"mat-icon"),h(7,"close"),c()()()}if(n&2){let e=g();m(4),B(e.configErrorMessage)}}var tc=class n{destroy$=new D;isOpen=!0;isAdmin=!1;configErrorMessage="";expandedSections={threads:!0,config:!1};isThreadSearchActive=!1;threadSearchQuery="";threadSearchInput;dialog=d(wi);configApi=d(Ki);projectStateService=d(we);projectApi=d(Zo);router=d(Dn);preferences=d(st);threadStateService=d(Rt);projects=jt(this.projectStateService.projectList$);selectedProject=jt(this.projectStateService.selectedProject$);selectedProjectName=jt(this.projectStateService.selectedProject$.pipe(ve(t=>t?.name)));isProjectVolatile=jt(this.projectStateService.selectedProject$.pipe(ve(t=>t?.config?.volatile||!1)));forcedProject=jt(this.projectStateService.forcedProject$);ngOnInit(){let t=this.preferences.getPreference("sidenavOpen",!0);this.isOpen=t??!0,console.log("[SIDENAV] Loaded sidenav state from preferences:",this.isOpen),this.configApi.getUserConfig().pipe(N(this.destroy$)).subscribe({next:e=>{this.isAdmin=e.groups?.includes("CODAY_ADMIN")??!1,console.log("[SIDENAV] User admin status:",this.isAdmin)},error:e=>{console.error("[SIDENAV] Error loading user config for roles:",e),this.isAdmin=!1}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}toggle(){this.isOpen=!this.isOpen,this.saveSidenavState()}close(){this.isOpen=!1,this.saveSidenavState()}saveSidenavState(){this.preferences.setPreference("sidenavOpen",this.isOpen),console.log("[SIDENAV] Saved sidenav state:",this.isOpen)}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(N(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(Ta,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(i=>{i&&this.saveUserConfig(i)})},error:t=>{console.error("[SIDENAV] Error loading user config:",t),this.configErrorMessage=t?.error?.error||"Failed to load user configuration"}})}saveUserConfig(t){this.configApi.updateUserConfig(t).pipe(N(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] User config saved successfully")},error:e=>{console.error("[SIDENAV] Error saving user config:",e),this.configErrorMessage=e?.error?.error||"Failed to save user configuration"}})}openProjectConfig(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected"),this.configErrorMessage="No project selected. Please select a project first.";return}this.configErrorMessage="",this.projectApi.getProjectConfig(t).pipe(N(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(Ta,{data:{configType:"project",projectName:t,initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(o=>{o&&this.saveProjectConfig(t,o)})},error:e=>{console.error("[SIDENAV] Error loading project config:",e),this.configErrorMessage=e?.error?.error||"Failed to load project configuration"}})}saveProjectConfig(t,e){this.projectApi.updateProjectConfig(t,e).pipe(N(this.destroy$)).subscribe({next:i=>{console.log("[SIDENAV] Project config saved successfully")},error:i=>{console.error("[SIDENAV] Error saving project config:",i),this.configErrorMessage=i?.error?.error||"Failed to save project configuration"}})}requireProjectSelection(t){return this.selectedProjectName()?!0:(console.error(`[SIDENAV] No project selected, cannot ${t}`),this.configErrorMessage="Please select a project first",!1)}openManagerDialog(t,e){console.log(`[SIDENAV] ${e}`),this.dialog.open(t,{width:"90vw",maxWidth:"1200px",height:"90vh",maxHeight:"900px"})}openAgents(){this.requireProjectSelection("open agents")&&this.openManagerDialog(ec,"Opening agent manager dialog")}openPrompts(){this.requireProjectSelection("open prompts")&&this.openManagerDialog(ql,"Opening prompt manager dialog")}openSchedulers(){this.requireProjectSelection("open schedulers")&&this.openManagerDialog(Jl,`Opening scheduler manager dialog for project: ${this.selectedProjectName()}`)}toggleSection(t){let e=this.expandedSections[t];Object.keys(this.expandedSections).forEach(i=>{this.expandedSections[i]=!1}),this.expandedSections[t]=!e}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 t=this.selectedProjectName();if(!t){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",t])}toggleThreadSearch(t){t.stopPropagation(),this.isThreadSearchActive=!0,this.threadSearchQuery="",console.log("[SIDENAV] Thread search active:",this.isThreadSearchActive),setTimeout(()=>{this.threadSearchInput?.nativeElement.focus()},0)}closeThreadSearch(){this.isThreadSearchActive=!1,this.threadSearchQuery="",console.log("[SIDENAV] Thread search closed")}onThreadSearchInput(){console.log("[SIDENAV] Search query:",this.threadSearchQuery)}onThreadSearchModeChange(t){t||this.closeThreadSearch()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-sidenav"]],viewQuery:function(e,i){if(e&1&&ne(yS,5),e&2){let o;W(o=U())&&(i.threadSearchInput=o.first)}},ngContentSelectors:CS,decls:50,vars:35,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"],[1,"search-header"],["role","button","tabindex","0",1,"section-toggle",3,"active"],[1,"section-content","threads"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content"],["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"],["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"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"sidenav-logo-btn"],["alt","Coday",1,"logo"],[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"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"sidenav-thread-selector",3,"searchModeChange","searchMode","searchQuery"],[1,"preference-item"],[1,"inline-panel"],["role","button","tabindex","-1","aria-disabled","true",1,"section-toggle","disabled"],[1,"error-icon"],[1,"error-text"],["mat-icon-button","","aria-label","Close error message",1,"error-close",3,"click"]],template:function(e,i){e&1&&(He(),w(0,wS,7,2),s(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),_("closed",function(){return i.close()}),s(3,"div",3)(4,"button",4),_("click",function(){return i.close()}),s(5,"mat-icon"),h(6,"chevron_left"),c()(),s(7,"img",5),_("click",function(r){return i.navigateToHome(),r.stopPropagation()})("keydown.enter",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()})("keydown.space",function(r){return i.navigateToHome(),r.preventDefault(),r.stopPropagation()}),c(),s(8,"div",6)(9,"h2",7),h(10),c()()(),s(11,"div",8)(12,"a",9),_("click",function(r){return i.createNewThread(),r.preventDefault()}),s(13,"mat-icon",10),h(14,"play_circle"),c(),s(15,"span",11),h(16,"Start a new thread"),c()()(),s(17,"div",12)(18,"div",13),w(19,SS,8,1,"div",14)(20,TS,6,4,"a",15),w(21,PS,2,2,"div",16),c(),s(22,"div",13)(23,"a",17),_("click",function(r){return i.toggleSection("config"),r.preventDefault()}),w(24,OS,2,0,"mat-icon",18)(25,AS,2,0,"mat-icon",19),s(26,"span",20),h(27,"Preferences"),c()(),w(28,DS,3,0,"div",21),c(),s(29,"div",13)(30,"a",17),_("click",function(r){return i.openUserConfig(),r.preventDefault(),r.stopPropagation()}),s(31,"mat-icon",19),h(32,"settings"),c(),s(33,"span",20),h(34,"User Configuration"),c()()(),w(35,FS,2,1),w(36,NS,6,0,"div",13)(37,VS,6,0,"div",13),w(38,LS,6,0,"div",13)(39,jS,6,0,"div",13),w(40,zS,6,0,"div",13)(41,BS,6,0,"div",13),s(42,"div",13)(43,"a",22),F(44,"img",23),s(45,"span",20),h(46,"Contribute on GitHub"),c()()()()(),s(47,"mat-sidenav-content"),he(48),c()(),w(49,HS,8,1,"div",24)),e&2&&(S(i.isOpen?-1:0),m(),x("hasBackdrop",!1),m(),x("opened",i.isOpen)("disableClose",!0),m(5),A("sidenav-logo",!0)("clickable",!i.forcedProject())("disabled",i.forcedProject()),x("title",i.forcedProject()?"Project selection disabled":"Go to project selection"),Y("src","CODAY-Logo.png",No)("role",i.forcedProject()?null:"button")("tabindex",i.forcedProject()?null:"0"),m(3),B(i.selectedProjectName()),m(7),A("has-footer",!0)("is-admin",i.isAdmin),m(),A("expanded",i.expandedSections.threads),m(),S(i.isThreadSearchActive&&i.expandedSections.threads?19:20),m(2),S(i.expandedSections.threads?21:-1),m(),A("expanded",i.expandedSections.config),m(),A("active",i.expandedSections.config),m(),S(i.expandedSections.config?24:25),m(4),S(i.expandedSections.config?28:-1),m(7),S(i.isAdmin?35:-1),m(),S(i.selectedProjectName()?36:37),m(2),S(i.selectedProjectName()?38:39),m(2),S(i.selectedProjectName()?40:41),m(4),Y("src","CODAY-Logo.png",No),m(5),S(i.configErrorMessage?49:-1))},dependencies:[Ke,ze,Xe,Ue,Nl,tm,Bg,Rl,Qe,xe,xt,yt,qg,Gg,ka,$l],styles:['[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:310px;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!important}.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{width:100%;margin:0!important}[_nghost-%COMP%] .mat-drawer-backdrop{pointer-events:auto}[_nghost-%COMP%] .mat-drawer-content{pointer-events:auto!important;background:transparent!important;overflow:visible!important}.sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;top:1rem!important;left:1rem!important;z-index:1500!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{position:fixed!important;top:4.5rem!important;left:1rem!important;z-index:1500!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-new-thread-btn[_ngcontent-%COMP%]:disabled mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)!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:310px;height:100%;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border-radius:0;overflow:hidden;display:flex;flex-direction:column}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.app-sidenav[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.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%]{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding:0;height:100%;max-height:calc(100vh - 122px)}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:4px}.sidenav-sections[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text)}.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%]{flex:1;min-height:0;overflow:hidden}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overflow-x:hidden;border-bottom:none;position:relative}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]:after{content:"";position:sticky;bottom:0;left:0;right:0;height:60px;background:linear-gradient(to bottom,transparent 0%,var(--glass-bg) 100%);pointer-events:none;opacity:1;transition:opacity .3s ease;z-index:10;flex-shrink:0}.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}@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:280px}.sidenav-toggle-btn[_ngcontent-%COMP%]{left:.75rem!important;top:.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 ic=class n{destroy$=new D;isSetup=!1;codayService=d(mi);preferencesService=d(st);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(N(this.destroy$),Fo(),ue(([t,e])=>t===!0&&e===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(N(this.destroy$),Fo(),ue(([t,e])=>t===!1&&e===!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 t=new(window.AudioContext||window.webkitAudioContext),e=t.createOscillator(),i=t.createGain();e.connect(i),i.connect(t.destination),e.frequency.setValueAtTime(700,t.currentTime),i.gain.setValueAtTime(.1,t.currentTime),i.gain.exponentialRampToValueAtTime(.01,t.currentTime+.08),e.start(t.currentTime),e.stop(t.currentTime+.08);let o=t.createOscillator(),r=t.createGain();o.connect(r),r.connect(t.destination);let a=t.currentTime+.11;o.frequency.setValueAtTime(950,a),r.gain.setValueAtTime(.1,a),r.gain.exponentialRampToValueAtTime(.01,a+.09),o.start(a),o.stop(a+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(t){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",t)}}handleBrowserNotificationEnabled(){return ie(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(t){console.error("[AGENT-NOTIFICATION] Error requesting permission:",t),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 t=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(()=>t.close(),4e3),t.onclick=()=>{window.focus(),t.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let t=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(()=>t.close(),5e3),t.onclick=()=>{window.focus(),t.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(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};var WS=["inputSection"];function US(n,t){if(n&1&&F(0,"app-thread",2),n&2){let e=g();x("projectName",e.projectName)("threadId",e.threadId)}}function $S(n,t){if(n&1){let e=E();s(0,"div",3),F(1,"app-welcome-message"),c(),s(2,"div",4,0)(4,"div",5)(5,"div",6)(6,"app-chat-textarea",7),_("messageSubmitted",function(o){v(e);let r=g();return y(r.onMessageSubmitted(o))})("voiceRecordingToggled",function(o){v(e);let r=g();return y(r.onVoiceToggled(o))})("heightChanged",function(o){v(e);let r=g();return y(r.onInputHeightChanged(o))}),c()()()()}if(n&2){let e=g();m(6),x("isDisabled",e.isSessionInitializing)("isSessionInitializing",e.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",e.isStartingFirstMessage)}}var Ia=class n{destroy$=new D;inputSection;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=d(mi);titleService=d(xr);preferencesService=d(st);route=d(Za);router=d(Dn);threadApiService=d(Un);agentNotificationService=d(ic);firstMessageState=d(wr);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(N(this.destroy$)).subscribe(t=>{let e=t.projectName,i=t.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:e,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=e,this.threadId=i,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(t){console.log("[MAIN-APP] First message submitted from welcome view:",t),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:e=>{console.log("[MAIN-APP] Thread created:",e.thread.id),this.firstMessageState.setPendingFirstMessage(t),this.router.navigate(["project",this.projectName,"thread",e.thread.id])},error:e=>{console.error("[MAIN-APP] Failed to create thread:",e),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(e.message||"Unknown error"))}})}onVoiceToggled(t){console.log("[VOICE] Recording in welcome view:",t)}onInputHeightChanged(t){console.log("[MAIN-APP] Input height changed:",t),this.inputSectionHeight=t}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let t=this.inputSection.nativeElement.offsetHeight;t!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",t),this.inputSectionHeight=t)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let t=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",t),t?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(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-main"]],viewQuery:function(e,i){if(e&1&&ne(WS,5),e&2){let o;W(o=U())&&(i.inputSection=o.first)}},decls:4,vars:1,consts:[["inputSection",""],[1,"app"],[3,"projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceRecordingToggled","heightChanged","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(e,i){e&1&&(s(0,"app-sidenav")(1,"div",1),w(2,US,1,2,"app-thread",2)(3,$S,7,5),c()()),e&2&&(m(2),S(i.threadId?2:3))},dependencies:[mr,Ll,tr,tc],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center}.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 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%}@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 1rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}.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:[Mc("slideIn",[cs(":enter",[Fn({transform:"translateY(100%)",opacity:0}),ls("300ms ease-out",Fn({transform:"translateY(0)",opacity:1}))]),cs(":leave",[ls("200ms ease-in",Fn({transform:"translateY(100%)",opacity:0}))])])]}})};var nc=class n{route=d(Za);ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),i=this.route.snapshot.queryParamMap.get("error"),o=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",i,"Opener:",!!window.opener),i){if(console.log("[OAuth Callback] OAuth error received:",i,o),!window.opener){alert(`OAuth error: ${i}${o?" - "+o:""}. Please close this window.`);return}try{window.opener.postMessage({error:i,state:e,errorDescription:o},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending error postMessage:",r),alert("OAuth error: Failed to communicate with parent window")}return}if(!t||!e){console.error("[OAuth Callback] Missing code or state");return}if(!window.opener){console.error("[OAuth Callback] No window.opener - popup may have been opened incorrectly"),alert("OAuth callback error: No parent window found. Please close this window and try again.");return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(r){console.error("[OAuth Callback] Error sending postMessage:",r),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-oauth-callback"]],decls:2,vars:0,template:function(e,i){e&1&&(ri(0,"p"),h(1,"Authentication in progress..."),ai())},encapsulation:2})};var vm=n=>ie(null,null,function*(){let t=d(we),e=n.params.projectName;return e?t.getSelectedProjectId()===e?!0:(t.selectProject(e),(yield Hm(t.selectedProject$.pipe(qm(o=>o?.name===e))))?.name===e):(console.log("[PROJECT GUARD] no project id in route"),!1)});var Af=n=>ie(null,null,function*(){let t=d(Rt),e=n.params.threadId;if(!e)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",e),console.log("[THREAD GUARD] Current selected thread:",t.getSelectedThreadId()),t.getSelectedThreadId()===e)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",e),t.selectThread(e);try{let i=yield Bm(nn([t.isLoading$,t.selectedThread$]).pipe(ct(([r,a])=>console.log(`\u{1F43C} [${r?"loading":"loaded"}]`,a?.id)),ue(([r,a])=>!r&&!!a),Mt(1),ve(([r,a])=>a?.id))),o=i===e;return o?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",e,"loaded:",i),o}catch(i){return console.error("[THREAD GUARD] Error loading thread:",i),!1}});var Df=[{path:"",component:gl},{path:"oauth/callback",component:nc},{path:"project/:projectName",component:Ia,canActivate:[vm]},{path:"project/:projectName/thread/:threadId",component:Ia,canActivate:[vm,Af]},{path:"agentos",loadChildren:()=>import("./chunk-4Q2XO4DS.js").then(n=>n.AGENTOS_ROUTES)},{path:"**",redirectTo:""}];var oc=class n{eventStream=d(Xi);messageApi=d(cr);pendingStates=new Map;popupCheckInterval=null;constructor(){this.eventStream.events$.pipe(ue(t=>t.type==="oauth_request")).subscribe(t=>this.handleOAuthRequest(t)),window.addEventListener("message",t=>this.handlePopupMessage(t))}startPopupMonitoring(t,e){this.popupCheckInterval&&clearInterval(this.popupCheckInterval),this.popupCheckInterval=setInterval(()=>{if(t.closed&&(console.log("[OAuth Service] Popup closed by user"),clearInterval(this.popupCheckInterval),this.popupCheckInterval=null,this.pendingStates.has(e))){console.warn("[OAuth Service] OAuth cancelled - popup closed without completing authentication");let i=this.pendingStates.get(e);if(this.pendingStates.delete(e),i){let o=new Qi({state:e,integrationName:i,error:"user_cancelled",errorDescription:"User closed the popup without completing authentication"});this.messageApi.sendMessage(o).subscribe({next:()=>console.log("[OAuth Service] Cancellation sent to backend"),error:r=>console.error("[OAuth Service] Failed to send cancellation:",r)})}}},500)}handleOAuthRequest(t){console.log("[OAuth Service] Received OAuthRequestEvent:",t.integrationName,t.state),this.pendingStates.set(t.state,t.integrationName),console.log("[OAuth Service] Pending states:",Array.from(this.pendingStates.keys()));let e=600,i=900,o=window.screenX+(window.outerWidth-e)/2,r=window.screenY+(window.outerHeight-i)/2,a=`width=${e},height=${i},left=${o},top=${r},popup=yes,resizable=yes,scrollbars=yes`,l=window.open(t.authUrl,"oauth_popup",a);console.log("[OAuth Service] Popup opened:",!!l),l&&(l.focus(),this.startPopupMonitoring(l,t.state))}handlePopupMessage(t){if(console.log("[OAuth Service] Received postMessage:",t.origin,t.data),t.origin!==window.location.origin){console.warn("[OAuth Service] Rejected message from different origin:",t.origin);return}let{code:e,state:i,error:o,errorDescription:r}=t.data??{};if(o){console.log("[OAuth Service] OAuth error received:",o,r);let p=this.pendingStates.get(i);if(p){this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let u=new Qi({state:i,integrationName:p,error:o,errorDescription:r});this.messageApi.sendMessage(u).subscribe({next:()=>console.log("[OAuth Service] Error callback sent to backend"),error:b=>console.error("[OAuth Service] Failed to send error callback:",b)})}return}if(!e||!i){console.warn("[OAuth Service] Message missing code or state:",t.data);return}console.log("[OAuth Service] Processing callback - code:",e,"state:",i);let a=this.pendingStates.get(i);if(!a){console.warn("[OAuth Service] Unknown state received:",i,"Pending states:",Array.from(this.pendingStates.keys()));return}console.log("[OAuth Service] Found integration:",a),this.pendingStates.delete(i),this.popupCheckInterval&&(clearInterval(this.popupCheckInterval),this.popupCheckInterval=null);let l=new Qi({code:e,state:i,integrationName:a});console.log("[OAuth Service] Sending callback to backend..."),this.messageApi.sendMessage(l).subscribe({next:()=>console.log("[OAuth Service] Callback sent to backend successfully"),error:p=>console.error("[OAuth Service] Failed to send callback:",p)})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})};function qS(n){return()=>n.initializeDefaultProject()}function GS(n){return()=>{console.log("[APP_INIT] OAuthService initialized")}}var If={providers:[Qm(),ah({eventCoalescing:!0}),fh(Df),uh(),Sp(),Ym(Ko),{provide:vc,useFactory:qS,deps:[we],multi:!0},{provide:vc,useFactory:GS,deps:[oc],multi:!0},kh({basePath:"/api/agentos"}),{provide:js,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var rc=class n{title="client";themeService=d(Sr);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-root"]],decls:1,vars:0,template:function(e,i){e&1&&F(0,"router-outlet")},dependencies:[_h,gh],encapsulation:2})};ph(rc,If).catch(n=>console.error(n));
|