@whoz-oss/coday-client 3.10.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-BGWBjvwQ.js → chunk-1LsZyzCe.js} +1 -1
- package/browser/{chunk-BZz5YcIe.js → chunk-3cJY-y-K.js} +1 -1
- package/browser/{chunk-DyD311Os.js → chunk-538NlE7s.js} +1 -1
- package/browser/{chunk-TVb3vD1X.js → chunk-7IDkwdi0.js} +1 -1
- package/browser/{chunk-Bsfux6Ph.js → chunk-B1Tv2Ebu.js} +1 -1
- package/browser/{chunk-CaXQnKEW.js → chunk-B3QJ8PhL.js} +1 -1
- package/browser/{chunk-Cm1-CoCU.js → chunk-B5rsaW2b.js} +1 -1
- package/browser/{chunk-Bampatce.js → chunk-B8YsdH5W.js} +1 -1
- package/browser/{chunk-DqUBpSwH.js → chunk-BA23pyYd.js} +1 -1
- package/browser/{chunk-MIRdYHA6.js → chunk-BDkp40LI.js} +2 -2
- package/browser/{chunk-CC3VBVuU.js → chunk-BGILLpeT.js} +1 -1
- package/browser/{chunk-DlBSfQiR.js → chunk-BJ4jWcd_.js} +1 -1
- package/browser/{chunk-7R07nDPZ.js → chunk-BM08gUt6.js} +1 -1
- package/browser/{chunk-BrxgjRsW.js → chunk-BPt7wScV.js} +1 -1
- package/browser/{chunk-EUKNlco8.js → chunk-BTvzcZ1s.js} +1 -1
- package/browser/{chunk-BwivPJC3.js → chunk-BWbwxWKa.js} +1 -1
- package/browser/{chunk-Cdb2CX2Q.js → chunk-BkVtgsRG.js} +1 -1
- package/browser/{chunk-CjRw0M6d.js → chunk-Bpth0xKt.js} +2 -2
- package/browser/{chunk-D-WJGEwY.js → chunk-BsaBLbYE.js} +1 -1
- package/browser/{chunk-loSw75E5.js → chunk-BuSLhs6I.js} +1 -1
- package/browser/{chunk-Ba945z-E.js → chunk-C1xOKACR.js} +1 -1
- package/browser/{chunk-D7ubXpF6.js → chunk-C2OedcEU.js} +1 -1
- package/browser/{chunk-Cksl5AD8.js → chunk-C2fhkSx5.js} +1 -1
- package/browser/{chunk-BJzVFbX0.js → chunk-C2rlLV-W.js} +2 -2
- package/browser/{chunk-YSBUI5Fn.js → chunk-CE3CVQYJ.js} +1 -1
- package/browser/{chunk-C6ZQFaHV.js → chunk-CFQpQly7.js} +1 -1
- package/browser/{chunk-D5aCMhSf.js → chunk-CFU4PT4-.js} +1 -1
- package/browser/{chunk-DbP7sgsG.js → chunk-CJdqLI4x.js} +1 -1
- package/browser/{chunk-Y92IHTQj.js → chunk-CPUMKiuB.js} +1 -1
- package/browser/{chunk-5c_jmV57.js → chunk-CQXNmLda.js} +1 -1
- package/browser/{chunk-DJEez-Yg.js → chunk-CRoK_gKa.js} +1 -1
- package/browser/{chunk-Bd2CH26d.js → chunk-CUmZcEGx.js} +1 -1
- package/browser/{chunk-QtmhX0X1.js → chunk-CX02zIUT.js} +1 -1
- package/browser/{chunk-nhFfwaIm.js → chunk-CaZlpLSd.js} +1 -1
- package/browser/{chunk-CiUdI8_s.js → chunk-CbXRaZ5e.js} +1 -1
- package/browser/{chunk-CGBTxglZ.js → chunk-CeTOubPL.js} +1 -1
- package/browser/{chunk-GAwnZGMd.js → chunk-CgurnF00.js} +1 -1
- package/browser/{chunk-DxZvzVYB.js → chunk-CkfpO0Ui.js} +1 -1
- package/browser/chunk-CmUHL9Tg.js +1 -0
- package/browser/{chunk-CnlsBi4s.js → chunk-CqkMIKRg.js} +5 -5
- package/browser/{chunk-Bc0GuFnm.js → chunk-Ct1RBakr.js} +1 -1
- package/browser/{chunk-B66h5RwF.js → chunk-D73z8OGT.js} +1 -1
- package/browser/{chunk-Brb8CVHb.js → chunk-DAEEDI2g.js} +1 -1
- package/browser/{chunk-LGfFQHFU.js → chunk-DAOnyJ7c.js} +1 -1
- package/browser/{chunk-DNFP1xT9.js → chunk-DB97l2cM.js} +1 -1
- package/browser/{chunk-CfqdY4Mw.js → chunk-DDdQkLim.js} +1 -1
- package/browser/{chunk-ybjAFl7I.js → chunk-Db48BeGH.js} +1 -1
- package/browser/{chunk-Dkhotd2g.js → chunk-DbmrZGxd.js} +1 -1
- package/browser/{chunk-BJAZmQ7l.js → chunk-DfnvTJ7R.js} +1 -1
- package/browser/{chunk-BdHdehhQ.js → chunk-DhYK3aRa.js} +1 -1
- package/browser/{chunk-DR_6ChV2.js → chunk-Dk3h998A.js} +1 -1
- package/browser/{chunk-wlytGgOb.js → chunk-DkFy_8tW.js} +1 -1
- package/browser/{chunk-CIgFq37k.js → chunk-DngVvVw1.js} +1 -1
- package/browser/{chunk-DIahKei4.js → chunk-DqfT0kg4.js} +1 -1
- package/browser/{chunk-B0MWdje6.js → chunk-Dx68TWlI.js} +1 -1
- package/browser/{chunk-BJWqi_bR.js → chunk-DxhQHX1Y.js} +1 -1
- package/browser/{chunk-CWKiaMQh.js → chunk-DzZlI93U.js} +1 -1
- package/browser/{chunk-Cc8mup8X.js → chunk-IM1UfDv7.js} +1 -1
- package/browser/{chunk-8Uub9JWj.js → chunk-LlG18Htx.js} +1 -1
- package/browser/{chunk-DLGt0phX.js → chunk-O1wALPze.js} +1 -1
- package/browser/{chunk-CUISPpfB.js → chunk-TngDHyxp.js} +1 -1
- package/browser/{chunk-BIM6FY9C.js → chunk-TxtSVoMY.js} +1 -1
- package/browser/{chunk-tOt8zs3G.js → chunk-ZtJnIW3b.js} +1 -1
- package/browser/{chunk-Dvnd0JmL.js → chunk-_aUM9QLW.js} +1 -1
- package/browser/{chunk-C516j1og.js → chunk-b_e1R_FV.js} +1 -1
- package/browser/{chunk-CThSpKxi.js → chunk-zmM38Yul.js} +2 -2
- package/browser/index.html +1 -1
- package/browser/{main-SY6UM2GV.js → main-MX6O2FH4.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-DWsrvadK.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {an as ce,g,L,ci as me,ap as Vy,av as dt$1,A as Aw,v as vs,W as WC,j as fl,ai as Jg,aj as KC,k as Ag,a3 as HI,o as bg,n as eC,q as oC,X as XE,ak as Xg,a6 as $I,r as Tg,t as tC,x as iC,a5 as yl,aL as Do,aM as qn,aO as wt$1,az as Qt,aW as w,cj as Pn,ce as Sb,c8 as QT,af as Dg,ag as fT,c9 as kf,ck as Ff,ch as Mg,T as TC,C as Cg,ad as Vg,b$ as FC,y as Hg,D as Fg,I as IC,E as wC,aJ as Tr,aG as fe,cl as be,p as pe,l as le,bU as Od,b9 as T,b8 as B,be as A,b7 as u,bd as h,cm as M,d as O,ba as v,bb as m,c as b,cn as F,f,V,bc as R,co as H,cp as K,ca as _e,Y as x,Z as z,_ as Ue,am as Gm,i as Gn,e as pr,a0 as jt,a2 as Nt,a1 as Vt,b0 as Yg,ac as mC}from'./main-
|
|
1
|
+
import {an as ce,g,L,ci as me,ap as Vy,av as dt$1,A as Aw,v as vs,W as WC,j as fl,ai as Jg,aj as KC,k as Ag,a3 as HI,o as bg,n as eC,q as oC,X as XE,ak as Xg,a6 as $I,r as Tg,t as tC,x as iC,a5 as yl,aL as Do,aM as qn,aO as wt$1,az as Qt,aW as w,cj as Pn,ce as Sb,c8 as QT,af as Dg,ag as fT,c9 as kf,ck as Ff,ch as Mg,T as TC,C as Cg,ad as Vg,b$ as FC,y as Hg,D as Fg,I as IC,E as wC,aJ as Tr,aG as fe,cl as be,p as pe,l as le,bU as Od,b9 as T,b8 as B,be as A,b7 as u,bd as h,cm as M,d as O,ba as v,bb as m,c as b,cn as F,f,V,bc as R,co as H,cp as K,ca as _e,Y as x,Z as z$1,_ as Ue,am as Gm,i as Gn,e as pr,a0 as jt,a2 as Nt,a1 as Vt,b0 as Yg,ac as mC}from'./main-MX6O2FH4.js';import {s as se}from'./chunk-CFQpQly7.js';import {t as ti,Q as Qn,e as ei,Y as Ye$1,h as _n,A as At,m as mn,Z as Zn,c as cn,w as wt}from'./chunk-CJdqLI4x.js';var Xe=["determinateSpinner"];function et(c,e){if(c&1&&(kf(),vs(0,"svg",11),bg(1,"circle",12),fl()),c&2){let t=mC();Cg("viewBox",t._viewBox()),XE(),Vg("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Cg("r",t._circleRadius());}}var tt=new w("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:qe})}),qe=100,nt=10,yt=(()=>{class c{_elementRef=g(Qt);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t;}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=g(tt),n=Pn(),i=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!t&&!t._forceAnimations,this.mode=i.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&i.classList.add("mat-progress-spinner-reduced-motion"),t&&(t.color&&(this.color=this._defaultColor=t.color),t.diameter&&(this.diameter=t.diameter),t.strokeWidth&&(this.strokeWidth=t.strokeWidth));}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0));}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0;}_diameter=qe;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0;}_strokeWidth;_circleRadius(){return (this.diameter-nt)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return `0 0 ${t} ${t}`}_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(n){return new(n||c)};static \u0275cmp=Aw({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&Fg(Xe,5),n&2){let o;IC(o=wC())&&(i._determinateCircle=o.first);}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,i){n&2&&(Cg("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),FC("mat-"+i.color),Vg("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),Hg("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",QT],diameter:[2,"diameter","diameter",QT],strokeWidth:[2,"strokeWidth","strokeWidth",QT]},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(n,i){if(n&1&&(Dg(0,et,2,8,"ng-template",null,0,fT),vs(2,"div",2,1),kf(),vs(4,"svg",3),bg(5,"circle",4),fl()(),Ff(),vs(6,"div",5)(7,"div",6)(8,"div",7),Mg(9,8),fl(),vs(10,"div",9),Mg(11,8),fl(),vs(12,"div",10),Mg(13,8),fl()()()),n&2){let o=TC(1);XE(4),Cg("viewBox",i._viewBox()),XE(),Vg("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Cg("r",i._circleRadius()),XE(4),Tg("ngTemplateOutlet",o),XE(2),Tg("ngTemplateOutlet",o),XE(2),Tg("ngTemplateOutlet",o);}},dependencies:[Sb],styles:[`.mat-mdc-progress-spinner {
|
|
2
2
|
--mat-progress-spinner-animation-multiplier: 1;
|
|
3
3
|
display: block;
|
|
4
4
|
overflow: hidden;
|
|
@@ -173,10 +173,10 @@ import {an as ce,g,L,ci as me,ap as Vy,av as dt$1,A as Aw,v as vs,W as WC,j as f
|
|
|
173
173
|
transform: rotate(-265deg);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
`],encapsulation:2})}return c})();var Et=(()=>{class c{static \u0275fac=function(n){return new(n||c)};static \u0275mod=Do({type:c});static \u0275inj=qn({imports:[wt$1]})}return c})();var
|
|
176
|
+
`],encapsulation:2})}return c})();var Et=(()=>{class c{static \u0275fac=function(n){return new(n||c)};static \u0275mod=Do({type:c});static \u0275inj=qn({imports:[wt$1]})}return c})();var z=class c{destroy$=new ce;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new Tr(false);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=g(L);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(e=>e([]));return}this.voices=new Promise((e,t)=>{let n=speechSynthesis.getVoices();if(n.length)e(n);else {let i=setTimeout(()=>{t("no voices found");},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let o=speechSynthesis.getVoices();o.length&&(clearTimeout(i),e(o));});}}),console.log("[VOICE-SERVICE] Speech synthesis initialized");}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(Vy(this.destroy$)).subscribe(e=>{this.volume=e,console.log("[VOICE-SERVICE] Volume updated to:",e);}),this.preferencesService.voiceRate$.pipe(Vy(this.destroy$)).subscribe(e=>{this.rate=e,console.log("[VOICE-SERVICE] Rate updated to:",e);}),this.preferencesService.voiceLanguage$.pipe(Vy(this.destroy$)).subscribe(e=>{this.language=e,console.log("[VOICE-SERVICE] Language updated to:",e),this.updateSelectedVoiceForLanguage();}),this.preferencesService.selectedVoice$.pipe(Vy(this.destroy$)).subscribe(e=>{this.setSelectedVoice(e);}),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(e,t){return dt$1(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),false;if(!e.trim())return console.warn("[VOICE-SERVICE] No text to speak"),false;let n=this.extractPlainText(e);if(!n.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),false;this.stopSpeech();try{let i=new SpeechSynthesisUtterance(n);i.voice=this.selectedVoice,i.lang=this.selectedVoice.lang,i.volume=this.volume,i.rate=this.rate,this.currentOnEndCallback=t||null,t&&(i.onend=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t());},i.onerror=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t());}),this.currentUtterance=i,this.speakingSubject.next(!0);let o=i.onend,E=i.onerror;return i.onend=C=>{this.speakingSubject.next(!1),o&&o.call(i,C);},i.onerror=C=>{this.speakingSubject.next(!1),E&&E.call(i,C);},speechSynthesis.speak(i),console.log("[VOICE-SERVICE] Started speaking:",e.substring(0,50)+"..."),!0}catch(i){return console.error("[VOICE-SERVICE] Error speaking:",i),false}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let e=this.currentOnEndCallback;this.currentOnEndCallback=null,e();}this.speakingSubject.next(false),console.log("[VOICE-SERVICE] Speech stopped");}}ding(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.frequency.setValueAtTime(800,e.currentTime),n.gain.setValueAtTime(.1,e.currentTime),n.gain.exponentialRampToValueAtTime(.01,e.currentTime+.1),t.start(e.currentTime),t.stop(e.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played");}catch(e){console.error("[VOICE-SERVICE] Notification sound failed:",e);}}getVoicesForLanguage(){return dt$1(this,null,function*(){try{let e=this.language.slice(0,2),t=yield this.voices;if(!t||t.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let n=t.filter(i=>i.lang.toLowerCase().startsWith(e)).sort((i,o)=>i.localService&&!o.localService?-1:!i.localService&&o.localService?1:i.name.localeCompare(o.name));return console.log("[VOICE-SERVICE] Found matching voices:",n.length,"for language:",e),n.map(i=>({name:i.name,lang:i.lang,localService:i.localService,default:i.default,displayName:this.formatVoiceDisplayName(i)}))}catch(e){return console.error("[VOICE-SERVICE] Error getting voices for language:",e),[]}})}formatVoiceDisplayName(e){let t=e.localService?"\u{1F3E0}":"\u2601\uFE0F",n=e.default?" \u2B50":"";return `${t} ${e.name} (${e.lang})${n}`}setSelectedVoice(e){return dt$1(this,null,function*(){if(!e){this.selectedVoice=void 0;return}let[t,n]=e.split("|");if(!t||!n){this.selectedVoice=void 0;return}let i=(yield this.voices)?.find(o=>o.name===t&&o.lang===n);i?(this.selectedVoice=i,console.log("[VOICE-SERVICE] Selected voice:",i.name,i.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",t,n));})}updateSelectedVoiceForLanguage(){return dt$1(this,null,function*(){let e=yield this.getVoicesForLanguage();if(e.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let t=this.preferencesService.getSelectedVoice();if(t){let[i,o]=t.split("|"),E=o?.slice(0,2),C=this.language.slice(0,2);if(E===C&&e.some(q=>q.name===i&&q.lang===o)){console.log("[VOICE-SERVICE] Keeping current voice for language:",t);return}}let n=e[0];if(n){let i=`${n.name}|${n.lang}`;this.preferencesService.setSelectedVoice(i),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",n.displayName);}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let e=this.getTestText();e&&this.speak(e);},100);}getTestText(){let e=this.language.slice(0,2),t={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 t[e]||t.en}extractPlainText(e){let t=e.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 t=this.addNaturalPunctuation(t),t.replace(/\s+/g," ").trim()}addNaturalPunctuation(e){return e.replace(/\n+/g,`
|
|
177
177
|
`).split(`
|
|
178
|
-
`).map(t=>this.addPeriodIfNeeded(t.trim())).filter(t=>t.length>0).join(" ")}addPeriodIfNeeded(e){return e?/[.!?;:]$/.test(e)?e:e+".":""}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};var ot=(c,e)=>e.code,rt=(c,e)=>e.name+e.lang;function at(c,e){c&1&&(vs(0,"div",17)(1,"mat-icon",39),WC(2,"warning"),fl(),vs(3,"span",40),WC(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),fl()());}function st(c,e){if(c&1&&(vs(0,"option",25),WC(1),fl()),c&2){let t=e.$implicit;Tg("value",t.code),XE(),Yg("",t.flag," ",t.label);}}function ct(c,e){c&1&&(vs(0,"option",32),WC(1,"Loading voices..."),fl());}function lt(c,e){c&1&&(vs(0,"option",32),WC(1,"No voice available"),fl());}function dt(c,e){if(c&1&&(vs(0,"option",25),WC(1),fl()),c&2){let t=e.$implicit;Tg("value",t.name+"|"+t.lang),XE(),yl(" ",t.displayName," ");}}var Ye=class c{destroy$=new ce;selectedTheme="light";selectedThemeVariant="industry";selectedVoiceLanguage="en-US";useEnterToSend=false;printTechnicalMessages=false;showTechnicalMessages=true;showWarningMessages=true;voiceInputMode="browser";voiceAnnounceEnabled=false;voiceMode="speech";voiceReadFullText=false;voiceVolume=80;voiceRate=120;agentNotificationEnabled=false;notificationSoundEnabled=true;browserNotificationEnabled=false;browserNotificationDenied=false;missionPreviewEnabled=false;availableVoices=[];selectedVoiceId=null;loadingVoices=false;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=g(L);voiceSynthesisService=g($);themeService=g(me);ngOnInit(){let e=this.themeService.getCurrentTheme();this.selectedTheme=e.mode,this.selectedThemeVariant=e.variant,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.voiceInputMode=this.preferencesService.getVoiceInputMode(),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.missionPreviewEnabled=this.preferencesService.getMissionPreviewEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(Vy(this.destroy$)).subscribe(t=>{this.selectedTheme=t.mode,this.selectedThemeVariant=t.variant;}),this.preferencesService.voiceLanguage$.pipe(Vy(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t;}),this.preferencesService.enterToSend$.pipe(Vy(this.destroy$)).subscribe(t=>{this.useEnterToSend=t;}),this.preferencesService.printTechnicalMessages$.pipe(Vy(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t;}),this.preferencesService.hideTechnicalMessages$.pipe(Vy(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t;}),this.preferencesService.hideWarningMessages$.pipe(Vy(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t;}),this.preferencesService.voiceInputMode$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceInputMode=t;}),this.preferencesService.voiceAnnounceEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t;}),this.preferencesService.voiceMode$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceMode=t;}),this.preferencesService.voiceReadFullText$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t;}),this.preferencesService.voiceVolume$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100);}),this.preferencesService.voiceRate$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100);}),this.preferencesService.selectedVoice$.pipe(Vy(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t;}),this.preferencesService.voiceLanguage$.pipe(Vy(this.destroy$)).subscribe(()=>{this.loadAvailableVoices();}),this.preferencesService.agentNotificationEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t;}),this.preferencesService.notificationSoundEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t;}),this.preferencesService.browserNotificationEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission();}),this.preferencesService.missionPreviewEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.missionPreviewEnabled=t;});}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme({variant:this.selectedThemeVariant,mode:this.selectedTheme});}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage);}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend);}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages);}onShowTechnicalMessagesChange(){let e=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",e,")"),this.preferencesService.setHideTechnicalMessages(e);}onShowWarningMessagesChange(){let e=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",e,")"),this.preferencesService.setHideWarningMessages(e);}onVoiceInputModeChange(e){let t=e.target.value;console.log("[OPTIONS] Voice input mode changed to:",t),this.preferencesService.setVoiceInputMode(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 e=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",e),this.preferencesService.setVoiceVolume(e);}onVoiceRateChange(){let e=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",e),this.preferencesService.setVoiceRate(e);}loadAvailableVoices(){return dt$1(this,null,function*(){this.loadingVoices=true;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language");}catch(e){console.error("[OPTIONS] Error loading voices:",e),this.availableVoices=[];}finally{this.loadingVoices=false;}})}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);}onMissionPreviewEnabledChange(){console.log("[OPTIONS] Mission preview panel enabled changed to:",this.missionPreviewEnabled),this.preferencesService.setMissionPreviewEnabled(this.missionPreviewEnabled);}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission));}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Aw({type:c,selectors:[["app-options-panel"]],decls:168,vars:37,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"],[1,"option-label-with-hint"],[1,"option-hint"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-input-mode-select",1,"option-label"],["id","voice-input-mode-select",1,"option-select",3,"change","value"],["value","browser"],["value","whisper"],["value","voice-message"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(t,n){t&1&&(vs(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),WC(4,"palette"),fl(),vs(5,"span"),WC(6,"Appearance"),fl()(),vs(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),Jg("ngModelChange",function(o){return KC(n.selectedTheme,o)||(n.selectedTheme=o),o}),Ag("change",function(){return n.onThemeChange()}),fl(),HI(),bg(11,"span",7),WC(12," Light "),fl(),vs(13,"label",5)(14,"input",8),Jg("ngModelChange",function(o){return KC(n.selectedTheme,o)||(n.selectedTheme=o),o}),Ag("change",function(){return n.onThemeChange()}),fl(),HI(),bg(15,"span",7),WC(16," Dark "),fl(),vs(17,"label",5)(18,"input",9),Jg("ngModelChange",function(o){return KC(n.selectedTheme,o)||(n.selectedTheme=o),o}),Ag("change",function(){return n.onThemeChange()}),fl(),HI(),bg(19,"span",7),WC(20," System "),fl()()()(),vs(21,"div",1)(22,"div",2)(23,"mat-icon"),WC(24,"chat_bubble_outline"),fl(),vs(25,"span"),WC(26,"Messaging"),fl()(),vs(27,"div",3)(28,"span",10),WC(29,"Send message behavior:"),fl(),vs(30,"div",4)(31,"label",5)(32,"input",11),Jg("ngModelChange",function(o){return KC(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Ag("change",function(){return n.onEnterToSendChange()}),fl(),HI(),bg(33,"span",7),WC(34," Enter to send "),fl(),vs(35,"label",5)(36,"input",11),Jg("ngModelChange",function(o){return KC(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Ag("change",function(){return n.onEnterToSendChange()}),fl(),HI(),bg(37,"span",7),WC(38," Enter for new line "),fl()()(),vs(39,"div",3)(40,"div",12)(41,"span",10),WC(42,"Show technical messages"),fl(),vs(43,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),Ag("change",function(){return n.onShowTechnicalMessagesChange()}),fl(),HI(),fl()(),vs(44,"div",3)(45,"div",12)(46,"span",10),WC(47,"Show warning messages"),fl(),vs(48,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),Ag("change",function(){return n.onShowWarningMessagesChange()}),fl(),HI(),fl()(),vs(49,"div",3)(50,"div",12)(51,"span",10),WC(52,"Include technical messages in print"),fl(),vs(53,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),Ag("change",function(){return n.onPrintTechnicalMessagesChange()}),fl(),HI(),fl()()(),vs(54,"div",1)(55,"div",2)(56,"mat-icon"),WC(57,"rocket_launch"),fl(),vs(58,"span"),WC(59,"Mission Control"),fl()(),vs(60,"div",3)(61,"div",12)(62,"div",14)(63,"span",10),WC(64,"Side-by-side thread preview"),fl(),vs(65,"span",15),WC(66,"Click a mission card to open a preview panel. Recommended for large screens."),fl()(),vs(67,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.missionPreviewEnabled,o)||(n.missionPreviewEnabled=o),o}),Ag("change",function(){return n.onMissionPreviewEnabledChange()}),fl(),HI(),fl()()(),vs(68,"div",1)(69,"div",2)(70,"mat-icon"),WC(71,"notifications"),fl(),vs(72,"span"),WC(73,"Notifications"),fl()(),vs(74,"div",3)(75,"div",12)(76,"span",10),WC(77,"Notify when the agent answers or requests input"),fl(),vs(78,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),Ag("change",function(){return n.onAgentNotificationEnabledChange()}),fl(),HI(),fl()(),vs(79,"div",3)(80,"div",12)(81,"span",10),WC(82,"Notification sound"),fl(),vs(83,"mat-slide-toggle",16),Jg("ngModelChange",function(o){return KC(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),Ag("change",function(){return n.onNotificationSoundEnabledChange()}),fl(),HI(),fl()(),vs(84,"div",3)(85,"div",12)(86,"span",10),WC(87,"Browser notification"),fl(),vs(88,"mat-slide-toggle",16),Jg("ngModelChange",function(o){return KC(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),Ag("change",function(){return n.onBrowserNotificationEnabledChange()}),fl(),HI(),fl(),eC(89,at,5,0,"div",17),fl()(),vs(90,"div",1)(91,"div",2)(92,"mat-icon"),WC(93,"record_voice_over"),fl(),vs(94,"span"),WC(95,"Voice & Speech"),fl()(),vs(96,"div",3)(97,"label",18),WC(98,"Voice input method:"),fl(),vs(99,"select",19),Ag("change",function(o){return n.onVoiceInputModeChange(o)}),vs(100,"option",20),WC(101,"Browser (real-time)"),fl(),vs(102,"option",21),WC(103,"Whisper (higher accuracy)"),fl(),vs(104,"option",22),WC(105,"Voice message (send audio)"),fl()()(),vs(106,"div",3)(107,"label",23),WC(108,"Voice recognition language:"),fl(),vs(109,"select",24),Jg("ngModelChange",function(o){return KC(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),Ag("change",function(){return n.onVoiceLanguageChange()}),oC(110,st,2,3,"option",25,ot),fl(),HI(),fl(),vs(112,"div",3)(113,"span",10),WC(114,"Automatic announcement:"),fl(),vs(115,"div",4)(116,"label",5)(117,"input",26),Jg("ngModelChange",function(o){return KC(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Ag("change",function(){return n.onVoiceAnnounceEnabledChange()}),fl(),HI(),bg(118,"span",7),WC(119," Enabled "),fl(),vs(120,"label",5)(121,"input",26),Jg("ngModelChange",function(o){return KC(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Ag("change",function(){return n.onVoiceAnnounceEnabledChange()}),fl(),HI(),bg(122,"span",7),WC(123," Disabled "),fl()()(),vs(124,"div",3)(125,"span",10),WC(126,"Voice mode:"),fl(),vs(127,"div",4)(128,"label",5)(129,"input",27),Jg("ngModelChange",function(o){return KC(n.voiceMode,o)||(n.voiceMode=o),o}),Ag("change",function(){return n.onVoiceModeChange()}),fl(),HI(),bg(130,"span",7),WC(131," Voice synthesis "),fl(),vs(132,"label",5)(133,"input",28),Jg("ngModelChange",function(o){return KC(n.voiceMode,o)||(n.voiceMode=o),o}),Ag("change",function(){return n.onVoiceModeChange()}),fl(),HI(),bg(134,"span",7),WC(135," Sound notification "),fl()()(),vs(136,"div",3)(137,"span",10),WC(138,"Message reading:"),fl(),vs(139,"div",4)(140,"label",5)(141,"input",29),Jg("ngModelChange",function(o){return KC(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Ag("change",function(){return n.onVoiceReadFullTextChange()}),fl(),HI(),bg(142,"span",7),WC(143," Full message "),fl(),vs(144,"label",5)(145,"input",29),Jg("ngModelChange",function(o){return KC(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Ag("change",function(){return n.onVoiceReadFullTextChange()}),fl(),HI(),bg(146,"span",7),WC(147," First paragraphs only "),fl()()(),vs(148,"div",3)(149,"label",30),WC(150,"Selected voice:"),fl(),vs(151,"select",31),Jg("ngModelChange",function(o){return KC(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),Ag("change",function(){return n.onSelectedVoiceChange()}),eC(152,ct,2,0,"option",32),eC(153,lt,2,0,"option",32),oC(154,dt,2,2,"option",25,rt),fl(),HI(),bg(156,"div",10),vs(157,"a",33),Ag("click",function(){return n.testVoice()}),vs(158,"span",34),WC(159,"Test voice"),fl()()(),vs(160,"div",3)(161,"label",35),WC(162),fl(),vs(163,"input",36),Jg("ngModelChange",function(o){return KC(n.voiceVolume,o)||(n.voiceVolume=o),o}),Ag("input",function(){return n.onVoiceVolumeChange()}),fl(),HI(),fl(),vs(164,"div",3)(165,"label",37),WC(166),fl(),vs(167,"input",38),Jg("ngModelChange",function(o){return KC(n.voiceRate,o)||(n.voiceRate=o),o}),Ag("input",function(){return n.onVoiceRateChange()}),fl(),HI(),fl()()()),t&2&&(XE(10),Xg("ngModel",n.selectedTheme),$I(),XE(4),Xg("ngModel",n.selectedTheme),$I(),XE(4),Xg("ngModel",n.selectedTheme),$I(),XE(14),Tg("value",true),Xg("ngModel",n.useEnterToSend),$I(),XE(4),Tg("value",false),Xg("ngModel",n.useEnterToSend),$I(),XE(7),Xg("ngModel",n.showTechnicalMessages),$I(),XE(5),Xg("ngModel",n.showWarningMessages),$I(),XE(5),Xg("ngModel",n.printTechnicalMessages),$I(),XE(14),Xg("ngModel",n.missionPreviewEnabled),$I(),XE(11),Xg("ngModel",n.agentNotificationEnabled),$I(),XE(5),Xg("ngModel",n.notificationSoundEnabled),Tg("disabled",!n.agentNotificationEnabled),$I(),XE(5),Xg("ngModel",n.browserNotificationEnabled),Tg("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),$I(),XE(),tC(n.browserNotificationDenied?89:-1),XE(10),Tg("value",n.voiceInputMode),XE(10),Xg("ngModel",n.selectedVoiceLanguage),$I(),XE(),iC(n.voiceLanguageOptions),XE(7),Tg("value",true),Xg("ngModel",n.voiceAnnounceEnabled),$I(),XE(4),Tg("value",false),Xg("ngModel",n.voiceAnnounceEnabled),$I(),XE(8),Xg("ngModel",n.voiceMode),$I(),XE(4),Xg("ngModel",n.voiceMode),$I(),XE(8),Tg("value",true),Xg("ngModel",n.voiceReadFullText),$I(),XE(4),Tg("value",false),Xg("ngModel",n.voiceReadFullText),$I(),XE(6),Xg("ngModel",n.selectedVoiceId),Tg("disabled",n.loadingVoices||n.availableVoices.length===0),$I(),XE(),tC(n.loadingVoices?152:-1),XE(),tC(!n.loadingVoices&&n.availableVoices.length===0?153:-1),XE(),iC(n.availableVoices),XE(8),yl("Volume: ",n.voiceVolume,"%"),XE(),Xg("ngModel",n.voiceVolume),$I(),XE(3),yl("Speed: ",n.voiceRate,"%"),XE(),Xg("ngModel",n.voiceRate),$I());},dependencies:[ti,Qn,ei,Ye$1,_n,At,mn,Zn,cn,wt,se],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-label-with-hint[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1}.option-label-with-hint[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0}.option-label-with-hint[_ngcontent-%COMP%] .option-hint[_ngcontent-%COMP%]{font-size:.775rem;color:var(--color-text-secondary);line-height:1.4}.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}'],changeDetection:1})};function Ke(c){let e=c.args??"",t;try{let n=JSON.parse(e);t=JSON.stringify(n,null,2);}catch(n){t=e;}return `\u{1F527} ${c.name}
|
|
178
|
+
`).map(t=>this.addPeriodIfNeeded(t.trim())).filter(t=>t.length>0).join(" ")}addPeriodIfNeeded(e){return e?/[.!?;:]$/.test(e)?e:e+".":""}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};var rt=(c,e)=>e.code,at=(c,e)=>e.name+e.lang;function st(c,e){c&1&&(vs(0,"div",17)(1,"mat-icon",39),WC(2,"warning"),fl(),vs(3,"span",40),WC(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),fl()());}function ct(c,e){if(c&1&&(vs(0,"option",25),WC(1),fl()),c&2){let t=e.$implicit;Tg("value",t.code),XE(),Yg("",t.flag," ",t.label);}}function lt(c,e){c&1&&(vs(0,"option",32),WC(1,"Loading voices..."),fl());}function dt(c,e){c&1&&(vs(0,"option",32),WC(1,"No voice available"),fl());}function pt(c,e){if(c&1&&(vs(0,"option",25),WC(1),fl()),c&2){let t=e.$implicit;Tg("value",t.name+"|"+t.lang),XE(),yl(" ",t.displayName," ");}}var Ye=class c{destroy$=new ce;selectedTheme="light";selectedThemeVariant="industry";selectedVoiceLanguage="en-US";useEnterToSend=false;printTechnicalMessages=false;showTechnicalMessages=true;showWarningMessages=true;voiceInputMode="browser";voiceAnnounceEnabled=false;voiceMode="speech";voiceReadFullText=false;voiceVolume=80;voiceRate=120;agentNotificationEnabled=false;notificationSoundEnabled=true;browserNotificationEnabled=false;browserNotificationDenied=false;missionPreviewEnabled=false;availableVoices=[];selectedVoiceId=null;loadingVoices=false;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=g(L);voiceSynthesisService=g(z);themeService=g(me);ngOnInit(){let e=this.themeService.getCurrentTheme();this.selectedTheme=e.mode,this.selectedThemeVariant=e.variant,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.voiceInputMode=this.preferencesService.getVoiceInputMode(),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.missionPreviewEnabled=this.preferencesService.getMissionPreviewEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(Vy(this.destroy$)).subscribe(t=>{this.selectedTheme=t.mode,this.selectedThemeVariant=t.variant;}),this.preferencesService.voiceLanguage$.pipe(Vy(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t;}),this.preferencesService.enterToSend$.pipe(Vy(this.destroy$)).subscribe(t=>{this.useEnterToSend=t;}),this.preferencesService.printTechnicalMessages$.pipe(Vy(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t;}),this.preferencesService.hideTechnicalMessages$.pipe(Vy(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t;}),this.preferencesService.hideWarningMessages$.pipe(Vy(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t;}),this.preferencesService.voiceInputMode$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceInputMode=t;}),this.preferencesService.voiceAnnounceEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t;}),this.preferencesService.voiceMode$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceMode=t;}),this.preferencesService.voiceReadFullText$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t;}),this.preferencesService.voiceVolume$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100);}),this.preferencesService.voiceRate$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100);}),this.preferencesService.selectedVoice$.pipe(Vy(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t;}),this.preferencesService.voiceLanguage$.pipe(Vy(this.destroy$)).subscribe(()=>{this.loadAvailableVoices();}),this.preferencesService.agentNotificationEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t;}),this.preferencesService.notificationSoundEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t;}),this.preferencesService.browserNotificationEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission();}),this.preferencesService.missionPreviewEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.missionPreviewEnabled=t;});}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme({variant:this.selectedThemeVariant,mode:this.selectedTheme});}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage);}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend);}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages);}onShowTechnicalMessagesChange(){let e=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",e,")"),this.preferencesService.setHideTechnicalMessages(e);}onShowWarningMessagesChange(){let e=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",e,")"),this.preferencesService.setHideWarningMessages(e);}onVoiceInputModeChange(e){let t=e.target.value;console.log("[OPTIONS] Voice input mode changed to:",t),this.preferencesService.setVoiceInputMode(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 e=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",e),this.preferencesService.setVoiceVolume(e);}onVoiceRateChange(){let e=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",e),this.preferencesService.setVoiceRate(e);}loadAvailableVoices(){return dt$1(this,null,function*(){this.loadingVoices=true;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language");}catch(e){console.error("[OPTIONS] Error loading voices:",e),this.availableVoices=[];}finally{this.loadingVoices=false;}})}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);}onMissionPreviewEnabledChange(){console.log("[OPTIONS] Mission preview panel enabled changed to:",this.missionPreviewEnabled),this.preferencesService.setMissionPreviewEnabled(this.missionPreviewEnabled);}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission));}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Aw({type:c,selectors:[["app-options-panel"]],decls:168,vars:37,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"],[1,"option-label-with-hint"],[1,"option-hint"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-input-mode-select",1,"option-label"],["id","voice-input-mode-select",1,"option-select",3,"change","value"],["value","browser"],["value","whisper"],["value","voice-message"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(t,n){t&1&&(vs(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),WC(4,"palette"),fl(),vs(5,"span"),WC(6,"Appearance"),fl()(),vs(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),Jg("ngModelChange",function(o){return KC(n.selectedTheme,o)||(n.selectedTheme=o),o}),Ag("change",function(){return n.onThemeChange()}),fl(),HI(),bg(11,"span",7),WC(12," Light "),fl(),vs(13,"label",5)(14,"input",8),Jg("ngModelChange",function(o){return KC(n.selectedTheme,o)||(n.selectedTheme=o),o}),Ag("change",function(){return n.onThemeChange()}),fl(),HI(),bg(15,"span",7),WC(16," Dark "),fl(),vs(17,"label",5)(18,"input",9),Jg("ngModelChange",function(o){return KC(n.selectedTheme,o)||(n.selectedTheme=o),o}),Ag("change",function(){return n.onThemeChange()}),fl(),HI(),bg(19,"span",7),WC(20," System "),fl()()()(),vs(21,"div",1)(22,"div",2)(23,"mat-icon"),WC(24,"chat_bubble_outline"),fl(),vs(25,"span"),WC(26,"Messaging"),fl()(),vs(27,"div",3)(28,"span",10),WC(29,"Send message behavior:"),fl(),vs(30,"div",4)(31,"label",5)(32,"input",11),Jg("ngModelChange",function(o){return KC(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Ag("change",function(){return n.onEnterToSendChange()}),fl(),HI(),bg(33,"span",7),WC(34," Enter to send "),fl(),vs(35,"label",5)(36,"input",11),Jg("ngModelChange",function(o){return KC(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Ag("change",function(){return n.onEnterToSendChange()}),fl(),HI(),bg(37,"span",7),WC(38," Enter for new line "),fl()()(),vs(39,"div",3)(40,"div",12)(41,"span",10),WC(42,"Show technical messages"),fl(),vs(43,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),Ag("change",function(){return n.onShowTechnicalMessagesChange()}),fl(),HI(),fl()(),vs(44,"div",3)(45,"div",12)(46,"span",10),WC(47,"Show warning messages"),fl(),vs(48,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),Ag("change",function(){return n.onShowWarningMessagesChange()}),fl(),HI(),fl()(),vs(49,"div",3)(50,"div",12)(51,"span",10),WC(52,"Include technical messages in print"),fl(),vs(53,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),Ag("change",function(){return n.onPrintTechnicalMessagesChange()}),fl(),HI(),fl()()(),vs(54,"div",1)(55,"div",2)(56,"mat-icon"),WC(57,"rocket_launch"),fl(),vs(58,"span"),WC(59,"Mission Control"),fl()(),vs(60,"div",3)(61,"div",12)(62,"div",14)(63,"span",10),WC(64,"Side-by-side thread preview"),fl(),vs(65,"span",15),WC(66,"Click a mission card to open a preview panel. Recommended for large screens."),fl()(),vs(67,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.missionPreviewEnabled,o)||(n.missionPreviewEnabled=o),o}),Ag("change",function(){return n.onMissionPreviewEnabledChange()}),fl(),HI(),fl()()(),vs(68,"div",1)(69,"div",2)(70,"mat-icon"),WC(71,"notifications"),fl(),vs(72,"span"),WC(73,"Notifications"),fl()(),vs(74,"div",3)(75,"div",12)(76,"span",10),WC(77,"Notify when the agent answers or requests input"),fl(),vs(78,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return KC(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),Ag("change",function(){return n.onAgentNotificationEnabledChange()}),fl(),HI(),fl()(),vs(79,"div",3)(80,"div",12)(81,"span",10),WC(82,"Notification sound"),fl(),vs(83,"mat-slide-toggle",16),Jg("ngModelChange",function(o){return KC(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),Ag("change",function(){return n.onNotificationSoundEnabledChange()}),fl(),HI(),fl()(),vs(84,"div",3)(85,"div",12)(86,"span",10),WC(87,"Browser notification"),fl(),vs(88,"mat-slide-toggle",16),Jg("ngModelChange",function(o){return KC(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),Ag("change",function(){return n.onBrowserNotificationEnabledChange()}),fl(),HI(),fl(),eC(89,st,5,0,"div",17),fl()(),vs(90,"div",1)(91,"div",2)(92,"mat-icon"),WC(93,"record_voice_over"),fl(),vs(94,"span"),WC(95,"Voice & Speech"),fl()(),vs(96,"div",3)(97,"label",18),WC(98,"Voice input method:"),fl(),vs(99,"select",19),Ag("change",function(o){return n.onVoiceInputModeChange(o)}),vs(100,"option",20),WC(101,"Browser (real-time)"),fl(),vs(102,"option",21),WC(103,"Whisper (higher accuracy)"),fl(),vs(104,"option",22),WC(105,"Voice message (send audio)"),fl()()(),vs(106,"div",3)(107,"label",23),WC(108,"Voice recognition language:"),fl(),vs(109,"select",24),Jg("ngModelChange",function(o){return KC(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),Ag("change",function(){return n.onVoiceLanguageChange()}),oC(110,ct,2,3,"option",25,rt),fl(),HI(),fl(),vs(112,"div",3)(113,"span",10),WC(114,"Automatic announcement:"),fl(),vs(115,"div",4)(116,"label",5)(117,"input",26),Jg("ngModelChange",function(o){return KC(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Ag("change",function(){return n.onVoiceAnnounceEnabledChange()}),fl(),HI(),bg(118,"span",7),WC(119," Enabled "),fl(),vs(120,"label",5)(121,"input",26),Jg("ngModelChange",function(o){return KC(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Ag("change",function(){return n.onVoiceAnnounceEnabledChange()}),fl(),HI(),bg(122,"span",7),WC(123," Disabled "),fl()()(),vs(124,"div",3)(125,"span",10),WC(126,"Voice mode:"),fl(),vs(127,"div",4)(128,"label",5)(129,"input",27),Jg("ngModelChange",function(o){return KC(n.voiceMode,o)||(n.voiceMode=o),o}),Ag("change",function(){return n.onVoiceModeChange()}),fl(),HI(),bg(130,"span",7),WC(131," Voice synthesis "),fl(),vs(132,"label",5)(133,"input",28),Jg("ngModelChange",function(o){return KC(n.voiceMode,o)||(n.voiceMode=o),o}),Ag("change",function(){return n.onVoiceModeChange()}),fl(),HI(),bg(134,"span",7),WC(135," Sound notification "),fl()()(),vs(136,"div",3)(137,"span",10),WC(138,"Message reading:"),fl(),vs(139,"div",4)(140,"label",5)(141,"input",29),Jg("ngModelChange",function(o){return KC(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Ag("change",function(){return n.onVoiceReadFullTextChange()}),fl(),HI(),bg(142,"span",7),WC(143," Full message "),fl(),vs(144,"label",5)(145,"input",29),Jg("ngModelChange",function(o){return KC(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Ag("change",function(){return n.onVoiceReadFullTextChange()}),fl(),HI(),bg(146,"span",7),WC(147," First paragraphs only "),fl()()(),vs(148,"div",3)(149,"label",30),WC(150,"Selected voice:"),fl(),vs(151,"select",31),Jg("ngModelChange",function(o){return KC(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),Ag("change",function(){return n.onSelectedVoiceChange()}),eC(152,lt,2,0,"option",32),eC(153,dt,2,0,"option",32),oC(154,pt,2,2,"option",25,at),fl(),HI(),bg(156,"div",10),vs(157,"a",33),Ag("click",function(){return n.testVoice()}),vs(158,"span",34),WC(159,"Test voice"),fl()()(),vs(160,"div",3)(161,"label",35),WC(162),fl(),vs(163,"input",36),Jg("ngModelChange",function(o){return KC(n.voiceVolume,o)||(n.voiceVolume=o),o}),Ag("input",function(){return n.onVoiceVolumeChange()}),fl(),HI(),fl(),vs(164,"div",3)(165,"label",37),WC(166),fl(),vs(167,"input",38),Jg("ngModelChange",function(o){return KC(n.voiceRate,o)||(n.voiceRate=o),o}),Ag("input",function(){return n.onVoiceRateChange()}),fl(),HI(),fl()()()),t&2&&(XE(10),Xg("ngModel",n.selectedTheme),$I(),XE(4),Xg("ngModel",n.selectedTheme),$I(),XE(4),Xg("ngModel",n.selectedTheme),$I(),XE(14),Tg("value",true),Xg("ngModel",n.useEnterToSend),$I(),XE(4),Tg("value",false),Xg("ngModel",n.useEnterToSend),$I(),XE(7),Xg("ngModel",n.showTechnicalMessages),$I(),XE(5),Xg("ngModel",n.showWarningMessages),$I(),XE(5),Xg("ngModel",n.printTechnicalMessages),$I(),XE(14),Xg("ngModel",n.missionPreviewEnabled),$I(),XE(11),Xg("ngModel",n.agentNotificationEnabled),$I(),XE(5),Xg("ngModel",n.notificationSoundEnabled),Tg("disabled",!n.agentNotificationEnabled),$I(),XE(5),Xg("ngModel",n.browserNotificationEnabled),Tg("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),$I(),XE(),tC(n.browserNotificationDenied?89:-1),XE(10),Tg("value",n.voiceInputMode),XE(10),Xg("ngModel",n.selectedVoiceLanguage),$I(),XE(),iC(n.voiceLanguageOptions),XE(7),Tg("value",true),Xg("ngModel",n.voiceAnnounceEnabled),$I(),XE(4),Tg("value",false),Xg("ngModel",n.voiceAnnounceEnabled),$I(),XE(8),Xg("ngModel",n.voiceMode),$I(),XE(4),Xg("ngModel",n.voiceMode),$I(),XE(8),Tg("value",true),Xg("ngModel",n.voiceReadFullText),$I(),XE(4),Tg("value",false),Xg("ngModel",n.voiceReadFullText),$I(),XE(6),Xg("ngModel",n.selectedVoiceId),Tg("disabled",n.loadingVoices||n.availableVoices.length===0),$I(),XE(),tC(n.loadingVoices?152:-1),XE(),tC(!n.loadingVoices&&n.availableVoices.length===0?153:-1),XE(),iC(n.availableVoices),XE(8),yl("Volume: ",n.voiceVolume,"%"),XE(),Xg("ngModel",n.voiceVolume),$I(),XE(3),yl("Speed: ",n.voiceRate,"%"),XE(),Xg("ngModel",n.voiceRate),$I());},dependencies:[ti,Qn,ei,Ye$1,_n,At,mn,Zn,cn,wt,se],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-label-with-hint[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1}.option-label-with-hint[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0}.option-label-with-hint[_ngcontent-%COMP%] .option-hint[_ngcontent-%COMP%]{font-size:.775rem;color:var(--color-text-secondary);line-height:1.4}.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}'],changeDetection:1})};function Qe(c){let e=c.args??"",t;try{let n=JSON.parse(e);t=JSON.stringify(n,null,2);}catch(n){t=e;}return `\u{1F527} ${c.name}
|
|
179
179
|
|
|
180
|
-
${t}`}var Ge=class c{destroy$=new ce;currentProject=null;currentThread=null;messagesSubject=new Tr([]);isThinkingSubject=new Tr(false);currentChoiceSubject=new Tr(null);projectTitleSubject=new Tr("Coday");currentInviteEventSubject=new Tr(null);messageToRestoreSubject=new Tr("");threadUpdateEventSubject=new Tr(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new Tr("");subThreadEventsSubject=new ce;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(e){return this.subThreadEventBuffers.get(e)??[]}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=g(fe);messageApi=g(be);userService=g(pe);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling();}setTabTitleService(e){this.tabTitleService=e;}connectToThread(e,t){this.currentProject=e,this.currentThread=t,this.eventStream.connectToThread(e,t);}loadHistoryFromRest(e){for(let t of e){let n=le(t);n&&this.handleEvent(n);}}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking();}sendMessage(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let t=this.currentInviteEventSubject.value;if(t){this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let n=t.buildAnswer(e);this.messageApi.sendMessage(n).subscribe({error:i=>{console.error("[CODAY] Send invite answer error:",i),this.currentInviteEventSubject.next(t),this.stopThinking();}});}else this.messageApi.sendFreeMessage(e).subscribe({error:n=>{console.error("[CODAY] Send error:",n);}});}sendChoice(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive();let t=this.currentChoiceEvent.buildAnswer(e);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(t).subscribe({next:()=>{},error:n=>{console.error("[CODAY-CHOICE] Choice error:",n),this.stopThinking();}});}else console.error("[CODAY-CHOICE] No choice event available for choice:",e);}deleteMessage(e){let t=this.messagesSubject.value.find(i=>i.id===e),n=this.extractTextContentFromMessage(t);return this.messageApi.deleteMessage(e).pipe(Od(i=>{i.success&&(this.removeMessagesFromIndex(e),n.trim()&&this.messageToRestoreSubject.next(n));}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive();}initializeEventHandling(){this.eventStream.events$.pipe(Vy(this.destroy$)).subscribe({next:e=>this.handleEvent(e),error:e=>console.error("[CODAY] Event stream error:",e),complete:()=>console.log("[CODAY] Event stream completed")});}handleEvent(e){if(e.threadId&&e.threadId!==this.currentThread){let
|
|
180
|
+
${t}`}var Ge=class c{destroy$=new ce;currentProject=null;currentThread=null;messagesSubject=new Tr([]);isThinkingSubject=new Tr(false);currentChoiceSubject=new Tr(null);projectTitleSubject=new Tr("Coday");currentInviteEventSubject=new Tr(null);messageToRestoreSubject=new Tr("");threadUpdateEventSubject=new Tr(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new Tr("");subThreadEventsSubject=new ce;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(e){return this.subThreadEventBuffers.get(e)??[]}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=g(fe);messageApi=g(be);userService=g(pe);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling();}setTabTitleService(e){this.tabTitleService=e;}connectToThread(e,t){this.currentProject=e,this.currentThread=t,this.eventStream.connectToThread(e,t);}loadHistoryFromRest(e){for(let t of e){let n=le(t);n&&this.handleEvent(n,true);}}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking();}sendMessage(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let t=this.currentInviteEventSubject.value;if(t){this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.thinkingTimeout=setTimeout(()=>{this.thinkingTimeout=null,this.stopThinking(),console.warn("[CODAY] Safety timeout: no server response after 30 s, releasing thinking state");},3e4),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let n=t.buildAnswer(e);this.messageApi.sendMessage(n).subscribe({error:i=>{console.error("[CODAY] Send invite answer error:",i),this.currentInviteEventSubject.next(t),this.stopThinking();}});}else this.messageApi.sendFreeMessage(e).subscribe({error:n=>{console.error("[CODAY] Send error:",n);}});}sendChoice(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.thinkingTimeout=setTimeout(()=>{this.thinkingTimeout=null,this.stopThinking(),console.warn("[CODAY] Safety timeout: no server response after 30 s, releasing thinking state");},3e4),this.tabTitleService?.setSystemActive();let t=this.currentChoiceEvent.buildAnswer(e);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(t).subscribe({next:()=>{},error:n=>{console.error("[CODAY-CHOICE] Choice error:",n),this.stopThinking();}});}else console.error("[CODAY-CHOICE] No choice event available for choice:",e);}deleteMessage(e){let t=this.messagesSubject.value.find(i=>i.id===e),n=this.extractTextContentFromMessage(t);return this.messageApi.deleteMessage(e).pipe(Od(i=>{i.success&&(this.removeMessagesFromIndex(e),n.trim()&&this.messageToRestoreSubject.next(n));}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive();}initializeEventHandling(){this.eventStream.events$.pipe(Vy(this.destroy$)).subscribe({next:e=>this.handleEvent(e),error:e=>console.error("[CODAY] Event stream error:",e),complete:()=>console.log("[CODAY] Event stream completed")});}handleEvent(e,t=false){if(e.threadId&&e.threadId!==this.currentThread){let n=this.subThreadEventBuffers.get(e.threadId);n?n.push(e):this.subThreadEventBuffers.set(e.threadId,[e]),this.subThreadEventsSubject.next(e);return}e instanceof T?this.handleMessageEvent(e):e instanceof B?this.handleTextChunkEvent(e):e instanceof A?this.handleTextEvent(e):e instanceof u?this.handleAnswerEvent(e):e instanceof h?this.handleErrorEvent(e):e instanceof M?this.handleWarnEvent(e):e instanceof O?this.handleThinkingEvent(e):e instanceof v?this.handleToolRequestEvent(e):e instanceof m?this.handleToolResponseEvent(e):e instanceof b?this.handleChoiceEvent(e,t):e instanceof F?this.handleHeartBeatEvent(e):e instanceof f?this.handleInviteEvent(e,t):e instanceof V?this.handleThreadUpdateEvent(e):e instanceof R?this.handleDelegationEvent(e):e instanceof H||e instanceof K||console.warn("[CODAY] Unhandled event type:",e.type);}handleDelegationEvent(e){if(console.log("[CODAY] DelegationEvent received:",e.subThreadId,e.agentName),this.messagesSubject.value.findIndex(i=>i.subThreadId===e.subThreadId)===-1){let i={id:e.timestamp,role:"system",speaker:e.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:e.subThreadId,delegationAgentName:e.agentName};this.addMessage(i);}}handleThreadUpdateEvent(e){this.threadUpdateEventSubject.next(e);}handleMessageEvent(e){e.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let t={id:e.timestamp,role:e.role,speaker:e.name,content:e.content,timestamp:e.date,type:"text"};this.addMessage(t);}handleTextChunkEvent(e){this.accumulatedChunks+=e.chunk,this.streamingTextSubject.next(this.accumulatedChunks);}handleTextEvent(e){let t={id:e.timestamp,role:e.speaker?"assistant":"system",speaker:e.speaker??"System",content:[{type:"text",content:e.text}],timestamp:e.date,type:e.speaker?"text":"technical"};this.addMessage(t);}handleAnswerEvent(e){let t=this.currentInviteEventSubject.value;if(t){let i=!!e.parentKey&&e.parentKey===t.timestamp,o=!e.parentKey&&e.date>=t.date;(i||o)&&this.currentInviteEventSubject.next(null);}if(this.currentChoiceEvent){let i=!!e.parentKey&&e.parentKey===this.currentChoiceEvent.timestamp,o=!e.parentKey&&e.date>=this.currentChoiceEvent.date;(i||o)&&(this.currentChoiceEvent=null,this.currentChoiceSubject.next(null));}if(e.silent)return;let n={id:e.timestamp,role:"user",speaker:e.name??this.userService.getUsername()??"User",content:[{type:"text",content:e.answer}],timestamp:e.date,type:"text",parentKey:e.parentKey,invite:e.invite};this.addMessage(n);}handleErrorEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(e.error)}`}],timestamp:e.date,type:"error"};this.addMessage(t);}handleWarnEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(e.warning)}`}],timestamp:e.date,type:"warning"};this.addMessage(t);}handleThinkingEvent(e){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(false),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive();},O.debounce+1e3));}handleToolRequestEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp,fullContent:Qe(e)};this.addMessage(t);}handleToolResponseEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp};this.addMessage(t);}handleChoiceEvent(e,t=false){this.stopThinking();let n={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite}],timestamp:e.date,type:"text"};if(this.addMessage(n),t||this.messagesSubject.value.some(y=>y.parentKey===e.timestamp||y.role==="user"&&y.timestamp>e.date||y.role==="assistant"&&y.timestamp>e.date))return;this.currentChoiceEvent=e,this.tabTitleService?.setSystemInactive();let E=e.options.map(y=>({value:y,label:y})),C=e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite;this.currentChoiceSubject.next({options:E,label:C,allowFreeText:e.allowFreeText});}handleHeartBeatEvent(e){}handleInviteEvent(e,t=false){if(this.stopThinking(),e.invite===_e)t||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive());else {let i={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.invite}],timestamp:e.date,type:"text"};this.addMessage(i),this.messagesSubject.value.some(C=>C.parentKey===e.timestamp||C.role==="user"&&C.timestamp>e.date||C.role==="assistant"&&C.timestamp>e.date)||t||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive());}}addMessage(e){let t=this.messagesSubject.value;t.some(n=>n.id===e.id)||this.messagesSubject.next([...t,e]);}removeMessagesFromIndex(e){let t=this.messagesSubject.value,n=t.findIndex(o=>o.id===e);if(n===-1||n===0)return;let i=t.slice(0,n);this.messagesSubject.next(i),this.stopThinking();}extractTextContentFromMessage(e){return e?e.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
181
181
|
|
|
182
|
-
`):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null);}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(false),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(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};function
|
|
182
|
+
`):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null);}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(false),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(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};function gt(c,e){if(c&1&&(vs(0,"div",3),WC(1),fl()),c&2){let t=mC();XE(),yl("\u274C ",t.errorMessage);}}var Ze=class c{dialogRef=g(z$1);data=g(Ue);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName);}getDefaultTitle(e,t){return e==="user"?"User Configuration":`Project Configuration: ${t||"Unknown"}`}onSave(){this.errorMessage="";let e;try{e=JSON.parse(this.jsonContent);}catch(t){this.errorMessage=`Invalid JSON syntax: ${t instanceof Error?t.message:"Unknown error"}`;return}this.dialogRef.close(e);}onCancel(){this.dialogRef.close();}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Aw({type:c,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(t,n){t&1&&(vs(0,"div",0),WC(1),vs(2,"button",1),Ag("click",function(){return n.onCancel()}),vs(3,"mat-icon"),WC(4,"close"),fl()()(),vs(5,"mat-dialog-content")(6,"textarea",2),Jg("ngModelChange",function(o){return KC(n.jsonContent,o)||(n.jsonContent=o),o}),fl(),HI(),eC(7,gt,2,1,"div",3),fl(),vs(8,"mat-dialog-actions",4)(9,"button",5),Ag("click",function(){return n.onCancel()}),WC(10,"Cancel"),fl(),vs(11,"button",6),Ag("click",function(){return n.onSave()}),WC(12,"Save"),fl()()),t&2&&(XE(),yl(" ",n.title," "),XE(5),Xg("ngModel",n.jsonContent),$I(),XE(),tC(n.errorMessage?7:-1));},dependencies:[Gm,ti,Ye$1,Zn,cn,wt,Gn,pr,jt,Nt,Vt],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)}"],changeDetection:1})};export{Et as E,Ge as G,Qe as Q,Ye as Y,Ze as Z,yt as y,z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {A,k as kt,b as bt}from'./chunk-BJWqi_bR.js';import {S as St}from'./chunk-CjRw0M6d.js';import {E as Et,y as yt$1,G as Ge}from'./chunk-CnlsBi4s.js';import {g,G,P,U,N,p as pe$1,K as c,w as we,H as Hi,F as F$1,m as mT,b as U$1,A as Aw,h as hr,e as pr,v as vs,W as WC,j as fl,k as Ag,n as eC,q as oC,X as XE,r as Tg,t as tC,x as iC,y as Hg,C as Cg,u as ue$1,ca as _e$1,Y as x,an as ce$1,ap as Vy,l as le$1,V,o as bg,a9 as dC,aa as If,ac as mC,ab as wf,a8 as Zg,a5 as yl}from'./main-SY6UM2GV.js';import'./chunk-DxZvzVYB.js';import'./chunk-C6ZQFaHV.js';import'./chunk-Bampatce.js';import'./chunk-Bd2CH26d.js';import {y as yt,w as wt}from'./chunk-DbP7sgsG.js';var R=class n{threadState=g(U);codayService=g(Ge);threadList=F$1(this.threadState.threadList$,{initialValue:[]});selectedThread=F$1(this.threadState.selectedThread$,{initialValue:null});isThinking=F$1(this.codayService.isThinking$,{initialValue:false});inviteEvent=F$1(this.codayService.currentInviteEvent$.pipe(ue$1(t=>t?.invite===_e$1?null:t)),{initialValue:null});tasks=mT(()=>{let t=this.threadList(),e=this.selectedThread(),r=this.isThinking(),o=this.inviteEvent();return t.filter(i=>!i.parentThreadId).map(i=>{let m=!!e&&i.id===e.id;return {id:i.id,name:i.name,summary:i.summary,modifiedDate:i.modifiedDate,starring:i.starring??[],users:i.users??[],status:this.deriveStatus(i,m,r,!!o),isActive:m,worktreeProject:i.worktreeProject}}).sort((i,m)=>{let q=kt[i.status]-kt[m.status];return q!==0?q:i.modifiedDate>m.modifiedDate?-1:1})});deriveStatus(t,e,r,o){let i=Date.now()-new Date(t.modifiedDate).getTime();return t.closedByUser?"done":t.pendingInvite?"waiting-you":e?r?"in-progress":"paused":i<bt?"in-progress":"paused"}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var F=class n{projectState=g(P);threadState=g(U);destroy$=new ce$1;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(Vy(this.destroy$)).subscribe(t=>{let e=t?.name??null;e!==this.currentProject&&(this.disconnect(),e&&this.connect(e));});}connect(t,e=5e3){this.currentProject=t;let r=`/api/projects/${encodeURIComponent(t)}/event-stream`;console.log(`[PROJECT_SSE] Connecting to ${r}`),this.eventSource=new EventSource(r),this.eventSource.onmessage=o=>{try{let i=JSON.parse(o.data),m=le$1(i);if(!m)return;m instanceof V&&(console.log("[PROJECT_SSE] ThreadUpdateEvent \u2014 refreshing thread list"),this.threadState.refreshThreadList());}catch(i){console.warn("[PROJECT_SSE] Failed to parse event:",i);}},this.eventSource.onerror=()=>{this.eventSource?.readyState===EventSource.CLOSED&&(console.warn(`[PROJECT_SSE] Connection closed for ${t}, reconnecting in ${e}ms`),this.eventSource=null,setTimeout(()=>{this.currentProject===t&&this.connect(t,Math.min(e*2,6e4));},e));};}disconnect(){this.eventSource&&(this.eventSource.close(),this.eventSource=null,console.log(`[PROJECT_SSE] Disconnected from project ${this.currentProject}`)),this.currentProject=null;}ngOnDestroy(){this.disconnect(),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var ce=(n,t)=>t.key,de=(n,t)=>t.status,le=(n,t)=>t.id;function pe(n,t){n&1&&bg(0,"mat-spinner",6);}function me(n,t){n&1&&(vs(0,"mat-icon"),WC(1,"add"),fl());}function ue(n,t){if(n&1&&(vs(0,"span",16),WC(1),fl()),n&2){let e=mC().$implicit,r=mC();XE(),Zg(r.filterCounts()[e.key]);}}function ge(n,t){if(n&1){let e=dC();vs(0,"button",15),Ag("click",function(){let o=If(e).$implicit,i=mC();return wf(i.setFilter(o.key))}),vs(1,"mat-icon",10),WC(2),fl(),vs(3,"span"),WC(4),fl(),eC(5,ue,2,1,"span",16),fl();}if(n&2){let e=t.$implicit,r=mC();Hg("active",r.activeFilter()===e.key),Cg("aria-selected",r.activeFilter()===e.key),XE(2),Zg(e.icon),XE(2),Zg(e.label),XE(),tC(r.filterCounts()[e.key]>0?5:-1);}}function _e(n,t){n&1&&(vs(0,"div",12),bg(1,"mat-spinner",17),vs(2,"p"),WC(3,"Loading tasks\u2026"),fl()());}function fe(n,t){if(n&1){let e=dC();vs(0,"p"),WC(1,"No tasks yet. Start your first one!"),fl(),vs(2,"button",19),Ag("click",function(){If(e);let o=mC(2);return wf(o.createTask())}),vs(3,"mat-icon"),WC(4,"add"),fl(),WC(5," New Task "),fl();}}function he(n,t){n&1&&(vs(0,"p"),WC(1,"No tasks in this category."),fl());}function ke(n,t){if(n&1&&(vs(0,"div",13)(1,"mat-icon",18),WC(2,"rocket_launch"),fl(),eC(3,fe,6,0)(4,he,2,0,"p"),fl()),n&2){let e=mC();XE(3),tC(e.activeFilter()==="all"?3:4);}}function ve(n,t){if(n&1){let e=dC();vs(0,"app-task-card",25),Ag("stopRequested",function(o){If(e);let i=mC(3);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=mC(3);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=mC(3);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=mC(3);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=mC(3);return wf(i.onMarkActiveRequested(o))}),fl();}if(n&2){let e=t.$implicit;Tg("task",e);}}function Ce(n,t){if(n&1&&(vs(0,"section",20)(1,"h2",21)(2,"mat-icon",22),WC(3),fl(),WC(4),vs(5,"span",23),WC(6),fl()(),vs(7,"div",14),oC(8,ve,1,1,"app-task-card",24,le),fl()()),n&2){let e=t.$implicit;XE(3),Zg(e.icon),XE(),yl(" ",e.label," "),XE(2),Zg(e.tasks.length),XE(2),iC(e.tasks);}}function be(n,t){if(n&1&&oC(0,Ce,10,3,"section",20,de),n&2){let e=mC();iC(e.taskGroups());}}function ye(n,t){if(n&1){let e=dC();vs(0,"app-task-card",25),Ag("stopRequested",function(o){If(e);let i=mC(2);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=mC(2);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=mC(2);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=mC(2);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=mC(2);return wf(i.onMarkActiveRequested(o))}),fl();}if(n&2){let e=t.$implicit;Tg("task",e);}}function xe(n,t){if(n&1&&(vs(0,"div",14),oC(1,ye,1,1,"app-task-card",24,le),fl()),n&2){let e=mC();XE(),iC(e.filteredTasks());}}var Te=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],se=class n{router=g(G);projectState=g(P);threadState=g(U);threadApi=g(N);taskStatus=g(R);userService=g(pe$1);projectApi=g(c);destroyRef=g(we);_projectEventStream=g(F);filters=Te;activeFilter=Hi("all");starredOnly=Hi(false);isCreating=Hi(false);isLoadingList=F$1(this.threadState.isLoadingThreadList$,{initialValue:false});username=F$1(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=mT(()=>{let t=this.activeFilter(),e=this.username(),r=this.allTasks();return this.starredOnly()&&e&&(r=r.filter(o=>o.starring.includes(e))),t==="all"?r:r.filter(o=>o.status===t)});filterCounts=mT(()=>{let t=this.username(),e=this.allTasks();return this.starredOnly()&&t&&(e=e.filter(r=>r.starring.includes(t))),{all:e.length,"waiting-you":e.filter(r=>r.status==="waiting-you").length,"in-progress":e.filter(r=>r.status==="in-progress").length,paused:e.filter(r=>r.status==="paused").length,done:e.filter(r=>r.status==="done").length}});taskGroups=mT(()=>{let t=this.username(),e=this.allTasks();this.starredOnly()&&t&&(e=e.filter(o=>o.starring.includes(t)));let r=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt",tasks:[]},{status:"in-progress",label:"In progress",icon:"pending",tasks:[]},{status:"done",label:"Done",icon:"check_circle",tasks:[]},{status:"paused",label:"Paused",icon:"pause_circle",tasks:[]},{status:"error",label:"Error",icon:"error",tasks:[]}];for(let o of e){let i=r.find(m=>m.status===o.status);i&&i.tasks.push(o);}return r.filter(o=>o.tasks.length>0)});ngOnInit(){this.userService.fetchCurrentUser().pipe(U$1(this.destroyRef)).subscribe({error:t=>console.warn("[TASK-CONTROL] Could not fetch user:",t)});}setFilter(t){this.activeFilter.set(t);}toggleStarredFilter(){this.starredOnly.update(t=>!t);}createTask(){let t=this.projectState.getSelectedProjectId();!t||this.isCreating()||(this.isCreating.set(true),this.threadApi.createThread().pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(false),this.router.navigate(["project",t,"thread",e.thread.id]);},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(false);}}));}onStopRequested(t){this.threadApi.stopThread(t).pipe(U$1(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)});}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:e=>console.error("[TASK-CONTROL] Failed to delete thread:",e)});}onStarToggled(t){let e=this.username();if(!e)return;let r=this.allTasks().find(m=>m.id===t);if(!r)return;let o=r.starring.includes(e),i=o?this.threadApi.unstarThread(t):this.threadApi.starThread(t);this.threadState.updateStarLocal(t,!o,e),i.pipe(U$1(this.destroyRef)).subscribe({error:m=>{console.error("[TASK-CONTROL] Failed to toggle star:",m),this.threadState.refreshThreadList();}});}onMarkDoneRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadDone(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as done:",r)});}onMarkActiveRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadActive(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as active:",r)});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["app-task-control"]],decls:25,vars:6,consts:[[1,"task-control"],[1,"tc-header"],[1,"tc-title-row"],[1,"tc-title"],[1,"title-icon"],["mat-flat-button","","aria-label","Start a new task",1,"new-task-btn",3,"click","disabled"],["diameter","16"],["role","tablist","aria-label","Filter tasks",1,"tc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"tc-grid-wrapper"],[1,"tc-loading"],[1,"tc-empty"],[1,"tc-grid"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","40"],[1,"empty-icon"],["mat-flat-button","",1,"new-task-btn",3,"click"],[1,"tc-group"],[1,"tc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task"],[3,"stopRequested","deleteRequested","starToggled","markDoneRequested","markActiveRequested","task"]],template:function(e,r){e&1&&(vs(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),WC(6,"rocket_launch"),fl(),WC(7," Task Control "),fl(),vs(8,"button",5),Ag("click",function(){return r.createTask()}),eC(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),WC(11," New Task "),fl()(),vs(12,"nav",7),oC(13,ge,6,6,"button",8,ce),vs(15,"button",9),Ag("click",function(){return r.toggleStarredFilter()}),vs(16,"mat-icon",10),WC(17,"star"),fl(),vs(18,"span"),WC(19,"Starred"),fl()()()(),vs(20,"main",11),eC(21,_e,4,0,"div",12)(22,ke,5,1,"div",13)(23,be,2,0)(24,xe,3,0,"div",14),fl()()()),e&2&&(XE(8),Tg("disabled",r.isCreating()),XE(),tC(r.isCreating()?9:10),XE(4),iC(r.filters),XE(2),Hg("active",r.starredOnly()),Cg("aria-checked",r.starredOnly()),XE(6),tC(r.isLoadingList()?21:r.filteredTasks().length===0?22:r.activeFilter()==="all"?23:24));},dependencies:[A,St,yt,wt,hr,pr,Et,yt$1],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden}.task-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;padding:1.5rem;gap:1.25rem;box-sizing:border-box}.tc-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;flex-shrink:0}.tc-title-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.tc-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text)}.tc-title[_ngcontent-%COMP%] .title-icon[_ngcontent-%COMP%]{font-size:1.5rem;width:1.5rem;height:1.5rem;color:var(--color-primary)}.new-task-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;padding:0 1rem;height:36px;flex-shrink:0}.new-task-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}.new-task-btn[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block}.tc-filters[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.375rem .875rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff4d;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.tc-group[_ngcontent-%COMP%]{margin-bottom:1.5rem}.tc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.tc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.85rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.tc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem}.tc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.75rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.tc-grid-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--color-border) transparent}.tc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;padding-bottom:1rem}@media(max-width:600px){.tc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.tc-loading[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;height:100%;min-height:240px;color:var(--color-text-secondary);text-align:center}.tc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.95rem}.empty-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;opacity:.3}"]})};export{se as TaskControlComponent};
|
|
1
|
+
import {A,k as kt,b as bt}from'./chunk-DxhQHX1Y.js';import {S as St}from'./chunk-Bpth0xKt.js';import {E as Et,y as yt$1,G as Ge}from'./chunk-CqkMIKRg.js';import {g,G,P,U,N,p as pe$1,K as c,w as we,H as Hi,F as F$1,m as mT,b as U$1,A as Aw,h as hr,e as pr,v as vs,W as WC,j as fl,k as Ag,n as eC,q as oC,X as XE,r as Tg,t as tC,x as iC,y as Hg,C as Cg,u as ue$1,ca as _e$1,Y as x,an as ce$1,ap as Vy,l as le$1,V,o as bg,a9 as dC,aa as If,ac as mC,ab as wf,a8 as Zg,a5 as yl}from'./main-MX6O2FH4.js';import'./chunk-CkfpO0Ui.js';import'./chunk-CFQpQly7.js';import'./chunk-B8YsdH5W.js';import'./chunk-CUmZcEGx.js';import {y as yt,w as wt}from'./chunk-CJdqLI4x.js';var R=class n{threadState=g(U);codayService=g(Ge);threadList=F$1(this.threadState.threadList$,{initialValue:[]});selectedThread=F$1(this.threadState.selectedThread$,{initialValue:null});isThinking=F$1(this.codayService.isThinking$,{initialValue:false});inviteEvent=F$1(this.codayService.currentInviteEvent$.pipe(ue$1(t=>t?.invite===_e$1?null:t)),{initialValue:null});tasks=mT(()=>{let t=this.threadList(),e=this.selectedThread(),r=this.isThinking(),o=this.inviteEvent();return t.filter(i=>!i.parentThreadId).map(i=>{let m=!!e&&i.id===e.id;return {id:i.id,name:i.name,summary:i.summary,modifiedDate:i.modifiedDate,starring:i.starring??[],users:i.users??[],status:this.deriveStatus(i,m,r,!!o),isActive:m,worktreeProject:i.worktreeProject}}).sort((i,m)=>{let q=kt[i.status]-kt[m.status];return q!==0?q:i.modifiedDate>m.modifiedDate?-1:1})});deriveStatus(t,e,r,o){let i=Date.now()-new Date(t.modifiedDate).getTime();return t.closedByUser?"done":t.pendingInvite?"waiting-you":e?r?"in-progress":"paused":i<bt?"in-progress":"paused"}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var F=class n{projectState=g(P);threadState=g(U);destroy$=new ce$1;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(Vy(this.destroy$)).subscribe(t=>{let e=t?.name??null;e!==this.currentProject&&(this.disconnect(),e&&this.connect(e));});}connect(t,e=5e3){this.currentProject=t;let r=`/api/projects/${encodeURIComponent(t)}/event-stream`;console.log(`[PROJECT_SSE] Connecting to ${r}`),this.eventSource=new EventSource(r),this.eventSource.onmessage=o=>{try{let i=JSON.parse(o.data),m=le$1(i);if(!m)return;m instanceof V&&(console.log("[PROJECT_SSE] ThreadUpdateEvent \u2014 refreshing thread list"),this.threadState.refreshThreadList());}catch(i){console.warn("[PROJECT_SSE] Failed to parse event:",i);}},this.eventSource.onerror=()=>{this.eventSource?.readyState===EventSource.CLOSED&&(console.warn(`[PROJECT_SSE] Connection closed for ${t}, reconnecting in ${e}ms`),this.eventSource=null,setTimeout(()=>{this.currentProject===t&&this.connect(t,Math.min(e*2,6e4));},e));};}disconnect(){this.eventSource&&(this.eventSource.close(),this.eventSource=null,console.log(`[PROJECT_SSE] Disconnected from project ${this.currentProject}`)),this.currentProject=null;}ngOnDestroy(){this.disconnect(),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var ce=(n,t)=>t.key,de=(n,t)=>t.status,le=(n,t)=>t.id;function pe(n,t){n&1&&bg(0,"mat-spinner",6);}function me(n,t){n&1&&(vs(0,"mat-icon"),WC(1,"add"),fl());}function ue(n,t){if(n&1&&(vs(0,"span",16),WC(1),fl()),n&2){let e=mC().$implicit,r=mC();XE(),Zg(r.filterCounts()[e.key]);}}function ge(n,t){if(n&1){let e=dC();vs(0,"button",15),Ag("click",function(){let o=If(e).$implicit,i=mC();return wf(i.setFilter(o.key))}),vs(1,"mat-icon",10),WC(2),fl(),vs(3,"span"),WC(4),fl(),eC(5,ue,2,1,"span",16),fl();}if(n&2){let e=t.$implicit,r=mC();Hg("active",r.activeFilter()===e.key),Cg("aria-selected",r.activeFilter()===e.key),XE(2),Zg(e.icon),XE(2),Zg(e.label),XE(),tC(r.filterCounts()[e.key]>0?5:-1);}}function _e(n,t){n&1&&(vs(0,"div",12),bg(1,"mat-spinner",17),vs(2,"p"),WC(3,"Loading tasks\u2026"),fl()());}function fe(n,t){if(n&1){let e=dC();vs(0,"p"),WC(1,"No tasks yet. Start your first one!"),fl(),vs(2,"button",19),Ag("click",function(){If(e);let o=mC(2);return wf(o.createTask())}),vs(3,"mat-icon"),WC(4,"add"),fl(),WC(5," New Task "),fl();}}function he(n,t){n&1&&(vs(0,"p"),WC(1,"No tasks in this category."),fl());}function ke(n,t){if(n&1&&(vs(0,"div",13)(1,"mat-icon",18),WC(2,"rocket_launch"),fl(),eC(3,fe,6,0)(4,he,2,0,"p"),fl()),n&2){let e=mC();XE(3),tC(e.activeFilter()==="all"?3:4);}}function ve(n,t){if(n&1){let e=dC();vs(0,"app-task-card",25),Ag("stopRequested",function(o){If(e);let i=mC(3);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=mC(3);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=mC(3);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=mC(3);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=mC(3);return wf(i.onMarkActiveRequested(o))}),fl();}if(n&2){let e=t.$implicit;Tg("task",e);}}function Ce(n,t){if(n&1&&(vs(0,"section",20)(1,"h2",21)(2,"mat-icon",22),WC(3),fl(),WC(4),vs(5,"span",23),WC(6),fl()(),vs(7,"div",14),oC(8,ve,1,1,"app-task-card",24,le),fl()()),n&2){let e=t.$implicit;XE(3),Zg(e.icon),XE(),yl(" ",e.label," "),XE(2),Zg(e.tasks.length),XE(2),iC(e.tasks);}}function be(n,t){if(n&1&&oC(0,Ce,10,3,"section",20,de),n&2){let e=mC();iC(e.taskGroups());}}function ye(n,t){if(n&1){let e=dC();vs(0,"app-task-card",25),Ag("stopRequested",function(o){If(e);let i=mC(2);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=mC(2);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=mC(2);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=mC(2);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=mC(2);return wf(i.onMarkActiveRequested(o))}),fl();}if(n&2){let e=t.$implicit;Tg("task",e);}}function xe(n,t){if(n&1&&(vs(0,"div",14),oC(1,ye,1,1,"app-task-card",24,le),fl()),n&2){let e=mC();XE(),iC(e.filteredTasks());}}var Te=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],se=class n{router=g(G);projectState=g(P);threadState=g(U);threadApi=g(N);taskStatus=g(R);userService=g(pe$1);projectApi=g(c);destroyRef=g(we);_projectEventStream=g(F);filters=Te;activeFilter=Hi("all");starredOnly=Hi(false);isCreating=Hi(false);isLoadingList=F$1(this.threadState.isLoadingThreadList$,{initialValue:false});username=F$1(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=mT(()=>{let t=this.activeFilter(),e=this.username(),r=this.allTasks();return this.starredOnly()&&e&&(r=r.filter(o=>o.starring.includes(e))),t==="all"?r:r.filter(o=>o.status===t)});filterCounts=mT(()=>{let t=this.username(),e=this.allTasks();return this.starredOnly()&&t&&(e=e.filter(r=>r.starring.includes(t))),{all:e.length,"waiting-you":e.filter(r=>r.status==="waiting-you").length,"in-progress":e.filter(r=>r.status==="in-progress").length,paused:e.filter(r=>r.status==="paused").length,done:e.filter(r=>r.status==="done").length}});taskGroups=mT(()=>{let t=this.username(),e=this.allTasks();this.starredOnly()&&t&&(e=e.filter(o=>o.starring.includes(t)));let r=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt",tasks:[]},{status:"in-progress",label:"In progress",icon:"pending",tasks:[]},{status:"done",label:"Done",icon:"check_circle",tasks:[]},{status:"paused",label:"Paused",icon:"pause_circle",tasks:[]},{status:"error",label:"Error",icon:"error",tasks:[]}];for(let o of e){let i=r.find(m=>m.status===o.status);i&&i.tasks.push(o);}return r.filter(o=>o.tasks.length>0)});ngOnInit(){this.userService.fetchCurrentUser().pipe(U$1(this.destroyRef)).subscribe({error:t=>console.warn("[TASK-CONTROL] Could not fetch user:",t)});}setFilter(t){this.activeFilter.set(t);}toggleStarredFilter(){this.starredOnly.update(t=>!t);}createTask(){let t=this.projectState.getSelectedProjectId();!t||this.isCreating()||(this.isCreating.set(true),this.threadApi.createThread().pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(false),this.router.navigate(["project",t,"thread",e.thread.id]);},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(false);}}));}onStopRequested(t){this.threadApi.stopThread(t).pipe(U$1(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)});}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:e=>console.error("[TASK-CONTROL] Failed to delete thread:",e)});}onStarToggled(t){let e=this.username();if(!e)return;let r=this.allTasks().find(m=>m.id===t);if(!r)return;let o=r.starring.includes(e),i=o?this.threadApi.unstarThread(t):this.threadApi.starThread(t);this.threadState.updateStarLocal(t,!o,e),i.pipe(U$1(this.destroyRef)).subscribe({error:m=>{console.error("[TASK-CONTROL] Failed to toggle star:",m),this.threadState.refreshThreadList();}});}onMarkDoneRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadDone(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as done:",r)});}onMarkActiveRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadActive(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as active:",r)});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["app-task-control"]],decls:25,vars:6,consts:[[1,"task-control"],[1,"tc-header"],[1,"tc-title-row"],[1,"tc-title"],[1,"title-icon"],["mat-flat-button","","aria-label","Start a new task",1,"new-task-btn",3,"click","disabled"],["diameter","16"],["role","tablist","aria-label","Filter tasks",1,"tc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"tc-grid-wrapper"],[1,"tc-loading"],[1,"tc-empty"],[1,"tc-grid"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","40"],[1,"empty-icon"],["mat-flat-button","",1,"new-task-btn",3,"click"],[1,"tc-group"],[1,"tc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task"],[3,"stopRequested","deleteRequested","starToggled","markDoneRequested","markActiveRequested","task"]],template:function(e,r){e&1&&(vs(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),WC(6,"rocket_launch"),fl(),WC(7," Task Control "),fl(),vs(8,"button",5),Ag("click",function(){return r.createTask()}),eC(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),WC(11," New Task "),fl()(),vs(12,"nav",7),oC(13,ge,6,6,"button",8,ce),vs(15,"button",9),Ag("click",function(){return r.toggleStarredFilter()}),vs(16,"mat-icon",10),WC(17,"star"),fl(),vs(18,"span"),WC(19,"Starred"),fl()()()(),vs(20,"main",11),eC(21,_e,4,0,"div",12)(22,ke,5,1,"div",13)(23,be,2,0)(24,xe,3,0,"div",14),fl()()()),e&2&&(XE(8),Tg("disabled",r.isCreating()),XE(),tC(r.isCreating()?9:10),XE(4),iC(r.filters),XE(2),Hg("active",r.starredOnly()),Cg("aria-checked",r.starredOnly()),XE(6),tC(r.isLoadingList()?21:r.filteredTasks().length===0?22:r.activeFilter()==="all"?23:24));},dependencies:[A,St,yt,wt,hr,pr,Et,yt$1],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden}.task-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;padding:1.5rem;gap:1.25rem;box-sizing:border-box}.tc-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;flex-shrink:0}.tc-title-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.tc-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text)}.tc-title[_ngcontent-%COMP%] .title-icon[_ngcontent-%COMP%]{font-size:1.5rem;width:1.5rem;height:1.5rem;color:var(--color-primary)}.new-task-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;padding:0 1rem;height:36px;flex-shrink:0}.new-task-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}.new-task-btn[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block}.tc-filters[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.375rem .875rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff4d;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.tc-group[_ngcontent-%COMP%]{margin-bottom:1.5rem}.tc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.tc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.85rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.tc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem}.tc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.75rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.tc-grid-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--color-border) transparent}.tc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;padding-bottom:1rem}@media(max-width:600px){.tc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.tc-loading[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;height:100%;min-height:240px;color:var(--color-text-secondary);text-align:center}.tc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.95rem}.empty-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;opacity:.3}"]})};export{se as TaskControlComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {I}from'./chunk-
|
|
1
|
+
import {I}from'./chunk-DkFy_8tW.js';import {m}from'./chunk-BDkp40LI.js';import {g,ao as V$1,G as G$1,w as we,aJ as Tr,H as Hi,bS as ma,Q as By,a7 as ga,S as ha,u as ue,b as U$1,A as Aw,aK as Nb,v as vs,bf as aT,k as Ag,W as WC,j as fl,af as Dg,T as TC,r as Tg,bg as uT,ah as rT,n as eC,ac as mC,t as tC,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-MX6O2FH4.js';import {W as Wn}from'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import'./chunk-CJdqLI4x.js';import'./chunk-BkVtgsRG.js';var U=()=>[];function V(r,t){if(r&1){let o=dC();vs(0,"agentos-prompt-item",4),Ag("deleteRequested",function(n){If(o);let F=mC(2);return wf(F.deletePrompt(n))}),fl();}if(r&2){let o=mC().$implicit,e=mC();Tg("prompt",t)("namespaceId",e.namespaceId)("readOnly",e.isPlatformPrompt(o.id));}}function j(r,t){if(r&1&&eC(0,V,1,3,"agentos-prompt-item",3),r&2){let o,e=t.$implicit,n=mC();tC((o=n.resolvePrompt(e.id))?0:-1,o);}}var G="platform",K="namespace",A=class r{route=g(V$1);router=g(G$1);destroyRef=g(we);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Hi(true);allPrompts$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),By({platform:this.promptState.listPlatform().pipe(ga(()=>ha([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));promptItems$=this.allPrompts$.pipe(ue(({platform:t,namespace:o})=>[...t.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:G,groupLabel:"Platform (read-only)"})),...o.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:K,groupLabel:"Namespace"}))]));namespacePromptsById=new Map;platformPromptsById=new Map;constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:t,namespace:o})=>{this.platformPromptsById=new Map(t.map(e=>[e.id??"",e])),this.namespacePromptsById=new Map(o.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}deletePrompt(t){this.promptState.delete(t.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolvePrompt(t){return this.platformPromptsById.get(t)??this.namespacePromptsById.get(t)??null}isPlatformPrompt(t){return this.platformPromptsById.has(t)}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-namespace-prompts"]],decls:6,vars:7,consts:[["promptItemTpl",""],["title","Prompts","emptyMessage","No prompts defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"namespace-prompts__back",3,"click"],[3,"prompt","namespaceId","readOnly"],[3,"deleteRequested","prompt","namespaceId","readOnly"]],template:function(o,e){if(o&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return e.openCreateForm()}),vs(2,"button",2),Ag("click",function(){return e.goBack()}),WC(3,"\u2190 Namespaces"),fl()(),Dg(4,j,1,1,"ng-template",null,0,fT)),o&2){let n=TC(5);Tg("items",uT(1,4,e.promptItems$)??rT(6,U))("loading",e.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,I,Nb],styles:[".namespace-prompts__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-prompts__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{A as NamespacePromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O}from'./chunk-
|
|
1
|
+
import {O}from'./chunk-Dk3h998A.js';import {R}from'./chunk-DDdQkLim.js';import {g,G,w as we,aJ as Tr,H as Hi,bS as ma,u as ue,b as U,A as Aw,aK as Nb,v as vs,bf as aT,k as Ag,W as WC,j as fl,af as Dg,T as TC,r as Tg,bg as uT,ah as rT,n as eC,ac as mC,t as tC,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-MX6O2FH4.js';import'./chunk-BDkp40LI.js';import {W as Wn}from'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import'./chunk-CJdqLI4x.js';import'./chunk-CmUHL9Tg.js';import'./chunk-BkVtgsRG.js';var k=()=>[];function V(i,t){if(i&1){let e=dC();vs(0,"agentos-auth-setting-item",4),Ag("editRequested",function(n){If(e);let p=mC(2);return wf(p.onEdit(n))})("deleteRequested",function(n){If(e);let p=mC(2);return wf(p.onDelete(n))}),fl();}i&2&&Tg("config",t)("showBadge",false);}function F(i,t){if(i&1&&eC(0,V,1,2,"agentos-auth-setting-item",3),i&2){let e,o=t.$implicit,n=mC();tC((e=n.resolveSetting(o.id))?0:-1,e);}}var M=class i{router=g(G);destroyRef=g(we);state=g(R);refresh$=new Tr(void 0);isLoading=Hi(true);settings$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())));settingItems$=this.settings$.pipe(ue(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.authType}))));settingsById=new Map;constructor(){this.settings$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.settingsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.state.delete(t.id,"platform").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveSetting(t){return this.settingsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Aw({type:i,selectors:[["agentos-platform-auth-settings"]],decls:6,vars:7,consts:[["authSettingItemTpl",""],["title","Platform Auth Settings","emptyMessage","No platform auth settings defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-auth-settings__back",3,"click"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(e,o){if(e&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return o.openCreateForm()}),vs(2,"button",2),Ag("click",function(){return o.goBack()}),WC(3,"\u2190 Admin"),fl()(),Dg(4,F,1,1,"ng-template",null,0,fT)),e&2){let n=TC(5);Tg("items",uT(1,4,o.settingItems$)??rT(6,k))("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,O,Nb],encapsulation:2})};export{M as PlatformAuthSettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,J as dy,S as ha,bU as Od,u as ue,Y as x}from'./main-
|
|
1
|
+
import {g,J as dy,S as ha,bU as Od,u as ue,Y as x}from'./main-MX6O2FH4.js';var f=class s{http=g(dy);agentsCache=new Map;getAgents(e){let t=this.agentsCache.get(e);return t?ha(t):this.http.get(`/api/projects/${e}/agents`).pipe(Od(o=>{this.agentsCache.set(e,o);}))}getAgentsAutocomplete(e,t){return this.getAgents(e).pipe(ue(o=>{if(!t)return o;let i=t.toLowerCase(),a=r=>{let n=r.name.toLowerCase();return n.startsWith(i)?0:n.includes(i)?1:2};return o.filter(r=>{let n=r.name.toLowerCase(),h=r.description?.toLowerCase()||"";return n.includes(i)||h.includes(i)}).sort((r,n)=>a(r)-a(n))}))}clearCache(e){this.agentsCache.delete(e);}clearAllCache(){this.agentsCache.clear();}static \u0275fac=function(t){return new(t||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};export{f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {S as S$1}from'./chunk-
|
|
1
|
+
import {S as S$1}from'./chunk-DbmrZGxd.js';import {g,G,w as we,dd as $,aJ as Tr,H as Hi,bS as ma,u as ue,b as U,A as Aw,aK as Nb,v as vs,bf as aT,k as Ag,j as fl,af as Dg,T as TC,r as Tg,bg as uT,ah as rT,n as eC,ac as mC,t as tC,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-MX6O2FH4.js';import {W as Wn,S as Se}from'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import'./chunk-CJdqLI4x.js';var S=()=>[];function V(r,e){if(r&1){let t=dC();vs(0,"agentos-ai-provider-item",4),Ag("editRequested",function(i){If(t);let p=mC(2);return wf(p.onEdit(i))})("deleteRequested",function(i){If(t);let p=mC(2);return wf(p.onDelete(i))}),fl();}r&2&&Tg("config",e)("showBadge",false);}function F(r,e){if(r&1&&eC(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=mC();tC((t=i.resolveProvider(o.id))?0:-1,t);}}var E=class r{router=g(G);destroyRef=g(we);aiProviderController=g($);refresh$=new Tr(void 0);isLoading=Hi(true);providers$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))));providerItems$=this.providers$.pipe(ue(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(U(this.destroyRef)).subscribe({next:e=>{this.providersById=new Map(e.map(t=>[t.id??"",t])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:7,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return o.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return o.goBack()}),fl()(),Dg(3,F,1,1,"ng-template",null,0,fT)),t&2){let i=TC(4);Tg("items",uT(1,4,o.providerItems$)??rT(6,S))("loading",o.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,S$1,Se,Nb],styles:[".platform-ai-providers__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"]})};export{E as PlatformAiProvidersComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-CmUHL9Tg.js';import {l}from'./chunk-BDkp40LI.js';import {g,dh as D,aJ as Tr,aD as Ly,bS as ma,a7 as ga,S as ha,u as ue,cE as Rd,z as z$1,a as P,bU as Od,Y as x}from'./main-MX6O2FH4.js';var q=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],J={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},E="none",C="me",I={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},U={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function v(n){let t=I[n.authType];return t?z$1(P({},n),{authType:t}):n}function d(n){return B(n)}function O(n){return n.map(B)}function B(n){let t=n;if(typeof t.authType=="string"){let e=U[t.authType];if(e)return z$1(P({},t),{authType:e})}return n}var R=class n{controller=g(D);userState=g(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(ma(([t])=>{let e=this.loadPlatformSettings().pipe(ga(()=>ha([])));return t?Ly([e,this.loadNamespaceSettings(t).pipe(ga(()=>ha([]))),this.loadUserSettings(t).pipe(ga(()=>ha([]))),this.loadUserSettings("global").pipe(ga(()=>ha([])))]).pipe(ue(([i,s,u,p])=>({platform:i,namespace:s,userOnNs:u,userGlobal:p}))):Ly([e,this.loadNamespaceSettings("").pipe(ga(()=>ha([]))),this.loadUserSettings("global").pipe(ga(()=>ha([])))]).pipe(ue(([i,s,u])=>({platform:i,namespace:s,userOnNs:[],userGlobal:u})))}),Rd({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?E:t;return this.controller.listAuthSetting(e,C).pipe(ue(i=>O(i)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(E).pipe(ue(t=>O(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(ue(e=>O(e))):ha([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(ue(i=>d(i)))}create(t,e,i){let u=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!u)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(i===void 0||i===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!i)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let p=v(z$1(P({},t),{namespaceId:e==="namespace"||e==="userOnNs"?i??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?u:void 0}));return this.controller.createAuthSetting(p).pipe(ue(_=>d(_)),Od(()=>this.refresh()))}update(t,e,i){let s=v(z$1(P({},e),{namespaceId:i.namespaceId,userId:i.userId,authType:i.authType}));return this.controller.updateAuthSetting(t,s).pipe(ue(u=>d(u)),Od(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(Od(()=>this.refresh()))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};export{J,R,q};
|