@whoz-oss/coday-client 0.128.0 → 0.129.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/browser/{chunk-D6WU5O4X.js → chunk-2TT2VS4Q.js} +1 -1
  2. package/browser/{chunk-GVX63TKQ.js → chunk-2YPR6RKN.js} +1 -1
  3. package/browser/{chunk-6LO3ANKL.js → chunk-3CAK3MY2.js} +1 -1
  4. package/browser/{chunk-ZAM3WGZM.js → chunk-3DDLKUVJ.js} +1 -1
  5. package/browser/{chunk-7XSGZTN3.js → chunk-4AYGP75X.js} +1 -1
  6. package/browser/chunk-4KNZ7PUG.js +1 -0
  7. package/browser/{chunk-KYPWHL43.js → chunk-4XDVIAH5.js} +1 -1
  8. package/browser/{chunk-HSNVFCBN.js → chunk-6DNANWSF.js} +1 -1
  9. package/browser/{chunk-AK6F2DC7.js → chunk-6JH2UGTU.js} +1 -1
  10. package/browser/chunk-6MVTL5VJ.js +1 -0
  11. package/browser/chunk-7GBHCDC2.js +1 -0
  12. package/browser/{chunk-7CFO7WWZ.js → chunk-AHABNNMX.js} +1 -1
  13. package/browser/{chunk-Z26H5ES2.js → chunk-AKD5MBRD.js} +1 -1
  14. package/browser/chunk-B6DPIDKI.js +1 -0
  15. package/browser/{chunk-EPA5P2I6.js → chunk-BEKG4CZE.js} +1 -1
  16. package/browser/{chunk-3TO5PQRD.js → chunk-BYSD3PVJ.js} +1 -1
  17. package/browser/{chunk-LLDKKRUC.js → chunk-BZJFZW26.js} +1 -1
  18. package/browser/{chunk-ADWJAQMQ.js → chunk-CL3F6CYH.js} +1 -1
  19. package/browser/{chunk-WNNKQ2DH.js → chunk-CND4W2V5.js} +1 -1
  20. package/browser/chunk-CX2W2KP4.js +1 -0
  21. package/browser/{chunk-DVO44NIX.js → chunk-CXN4NTRD.js} +1 -1
  22. package/browser/chunk-DIZZ6MCJ.js +1 -0
  23. package/browser/{chunk-XJUBZLY2.js → chunk-DLU3TQID.js} +1 -1
  24. package/browser/{chunk-7T6Q4MDL.js → chunk-DPFJ6LFY.js} +1 -1
  25. package/browser/{chunk-MWWLTJ77.js → chunk-FAAHG43E.js} +1 -1
  26. package/browser/{chunk-KTPX26DH.js → chunk-FDCPX2YT.js} +1 -1
  27. package/browser/{chunk-YCJZTFYJ.js → chunk-FJR6WCPX.js} +1 -1
  28. package/browser/{chunk-VNCIHM33.js → chunk-FQSDA7SM.js} +1 -1
  29. package/browser/{chunk-IFXDK4GQ.js → chunk-FTMDL4HX.js} +1 -1
  30. package/browser/{chunk-XIQ3L6H6.js → chunk-G4QDBE4F.js} +1 -1
  31. package/browser/chunk-GYZJRAEL.js +1 -0
  32. package/browser/chunk-HCMK67ST.js +1 -0
  33. package/browser/chunk-HUWAPEGQ.js +1 -0
  34. package/browser/{chunk-DRBOHCTP.js → chunk-HY7OYHZF.js} +1 -1
  35. package/browser/{chunk-RQLQ22PM.js → chunk-HYNHL5RY.js} +1 -1
  36. package/browser/{chunk-3U3QVZEU.js → chunk-I75FDNMK.js} +1 -1
  37. package/browser/{chunk-TSDYLM5L.js → chunk-J6NHAJP2.js} +1 -1
  38. package/browser/{chunk-GEUVTKHG.js → chunk-KNY6WJUH.js} +1 -1
  39. package/browser/{chunk-AJOXSD6I.js → chunk-LCBWJP6Z.js} +1 -1
  40. package/browser/{chunk-QWMDAFBN.js → chunk-LTFITYTW.js} +1 -1
  41. package/browser/{chunk-7A54VTP2.js → chunk-MLNEYB77.js} +1 -1
  42. package/browser/{chunk-VGRGY2U3.js → chunk-MO6H3TK3.js} +1 -1
  43. package/browser/{chunk-EU3J4G2Y.js → chunk-NEINI73V.js} +1 -1
  44. package/browser/{chunk-UORJVNGU.js → chunk-NLRFBAA2.js} +1 -1
  45. package/browser/chunk-NV3MNDVJ.js +1 -0
  46. package/browser/{chunk-NZDKKDRG.js → chunk-OBMXZUQM.js} +1 -1
  47. package/browser/{chunk-IJ2YZMNS.js → chunk-OHLGZXEO.js} +1 -1
  48. package/browser/chunk-OMENROC2.js +1 -0
  49. package/browser/{chunk-QSQYSFNQ.js → chunk-OSX2KHVN.js} +1 -1
  50. package/browser/{chunk-I5OT3IGD.js → chunk-Q74LPU7S.js} +1 -1
  51. package/browser/{chunk-YXFL2FTT.js → chunk-QDQW667Q.js} +1 -1
  52. package/browser/{chunk-WPC6XC7P.js → chunk-QFSZDRP2.js} +1 -1
  53. package/browser/chunk-R2OQMKB5.js +1 -0
  54. package/browser/{chunk-DE5MXWYR.js → chunk-R3DKNIV5.js} +1 -1
  55. package/browser/chunk-R5RVDZLX.js +1 -0
  56. package/browser/{chunk-JWEUUCFC.js → chunk-RAJZGLER.js} +1 -1
  57. package/browser/{chunk-3JGMGRXW.js → chunk-RNXBUYHW.js} +2 -2
  58. package/browser/{chunk-B2QA6UZX.js → chunk-SDLTQWY6.js} +1 -1
  59. package/browser/{chunk-FFMGEAGW.js → chunk-SHWW6WRB.js} +1 -1
  60. package/browser/{chunk-WQUBEVZN.js → chunk-SI36SMXC.js} +1 -1
  61. package/browser/{chunk-AQ3SEH2N.js → chunk-SKVQOMLG.js} +1 -1
  62. package/browser/{chunk-NAQEVUOV.js → chunk-SQWEKOLS.js} +1 -1
  63. package/browser/{chunk-SDNXWYG5.js → chunk-T2JHUF63.js} +1 -1
  64. package/browser/chunk-T2LG7TT2.js +1 -0
  65. package/browser/{chunk-U4662WTU.js → chunk-TY4VCUP2.js} +1 -1
  66. package/browser/{chunk-IXD43YQI.js → chunk-UQNMPA5Y.js} +1 -1
  67. package/browser/chunk-WBRWLEC2.js +1 -0
  68. package/browser/{chunk-MVATXMLV.js → chunk-WC5DQJKZ.js} +1 -1
  69. package/browser/{chunk-IZFHJAEI.js → chunk-YBAY4MP6.js} +1 -1
  70. package/browser/{chunk-RHFQ7GO2.js → chunk-ZQJGEWGV.js} +1 -1
  71. package/browser/index.html +1 -1
  72. package/browser/{main-YSLZYJ4P.js → main-XJQHXNY2.js} +1 -1
  73. package/package.json +1 -1
  74. package/browser/chunk-3D3KN52V.js +0 -1
  75. package/browser/chunk-3YSNMKXU.js +0 -1
  76. package/browser/chunk-5B6P72NR.js +0 -1
  77. package/browser/chunk-B2FFL2F7.js +0 -1
  78. package/browser/chunk-FPNKDL3E.js +0 -1
  79. package/browser/chunk-GAZJZBKP.js +0 -1
  80. package/browser/chunk-GG2XORTA.js +0 -1
  81. package/browser/chunk-H6Q42HHV.js +0 -1
  82. package/browser/chunk-I5EEQETN.js +0 -1
  83. package/browser/chunk-O3U2KGCT.js +0 -1
  84. package/browser/chunk-ONXSTLRN.js +0 -1
  85. package/browser/chunk-QU37OGFO.js +0 -1
  86. package/browser/chunk-QXZ6AR76.js +0 -1
@@ -1,4 +1,4 @@
1
- import{$a as V,Aa as ot,B as ae,Ba as de,Ca as me,Da as le,F as tt,Fa as ue,G as oe,Gb as W,Hb as T,J as ne,Kc as _e,Ma as be,Oa as nt,Pa as pe,Q as et,R as ie,Rb as O,Sb as he,T as at,Uc as ye,V as re,Wa as y,Xa as I,Ya as k,Z as c,_ as E,a as u,aa as m,ca as r,db as It,e as Qt,ea as se,g as Xt,h as _,i as qt,ib as fe,jb as wt,ka as A,la as h,m as Jt,oa as xt,pa as b,t as H,ta as K,tc as N,u as te,ua as ce,uc as ve,vb as At,wb as Tt,wc as ge,x as ee,xb as C,ya as D,za as Et}from"./chunk-3JGMGRXW.js";function G(e){return e.buttons===0||e.detail===0}function Z(e){let o=e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0];return!!o&&o.identifier===-1&&(o.radiusX==null||o.radiusX===1)&&(o.radiusY==null||o.radiusY===1)}var Mt;function xe(){if(Mt==null){let e=typeof document<"u"?document.head:null;Mt=!!(e&&(e.createShadowRoot||e.attachShadow))}return Mt}function Dt(e){if(xe()){let o=e.getRootNode?e.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&o instanceof ShadowRoot)return o}return null}function sa(){let e=typeof document<"u"&&document?document.activeElement:null;for(;e&&e.shadowRoot;){let o=e.shadowRoot.activeElement;if(o===e)break;e=o}return e}function x(e){return e.composedPath?e.composedPath()[0]:e.target}var kt;try{kt=typeof Intl<"u"&&Intl.v8BreakIterator}catch(e){kt=!1}var p=(()=>{class e{_platformId=r(de);isBrowser=this._platformId?_e(this._platformId):typeof document=="object"&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||kt)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var $;function Ee(){if($==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>$=!0}))}finally{$=$||!1}return $}function B(e){return Ee()?e:!!e.capture}function ca(e,o=0){return Ie(e)?Number(e):arguments.length===2?o:0}function Ie(e){return!isNaN(parseFloat(e))&&!isNaN(Number(e))}function R(e){return e instanceof D?e.nativeElement:e}var we=new m("cdk-input-modality-detector-options"),Ae={ignoreKeys:[18,17,224,91,16]},Te=650,Ct={passive:!0,capture:!0},Me=(()=>{class e{_platform=r(p);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new qt(null);_options;_lastTouchMs=0;_onKeydown=t=>{this._options?.ignoreKeys?.some(a=>a===t.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=x(t))};_onMousedown=t=>{Date.now()-this._lastTouchMs<Te||(this._modality.next(G(t)?"keyboard":"mouse"),this._mostRecentTarget=x(t))};_onTouchstart=t=>{if(Z(t)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=x(t)};constructor(){let t=r(b),a=r(h),n=r(we,{optional:!0});if(this._options=u(u({},Ae),n),this.modalityDetected=this._modality.pipe(et(1)),this.modalityChanged=this.modalityDetected.pipe(ne()),this._platform.isBrowser){let i=r(nt).createRenderer(null,null);this._listenerCleanups=t.runOutsideAngular(()=>[i.listen(a,"keydown",this._onKeydown,Ct),i.listen(a,"mousedown",this._onMousedown,Ct),i.listen(a,"touchstart",this._onTouchstart,Ct)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(t=>t())}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Y=(function(e){return e[e.IMMEDIATE=0]="IMMEDIATE",e[e.EVENTUAL=1]="EVENTUAL",e})(Y||{}),De=new m("cdk-focus-monitor-default-options"),it=B({passive:!0,capture:!0}),Ot=(()=>{class e{_ngZone=r(b);_platform=r(p);_inputModalityDetector=r(Me);_origin=null;_lastFocusOrigin=null;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=r(h);_stopInputModalityDetector=new _;constructor(){let t=r(De,{optional:!0});this._detectionMode=t?.detectionMode||Y.IMMEDIATE}_rootNodeFocusAndBlurListener=t=>{let a=x(t);for(let n=a;n;n=n.parentElement)t.type==="focus"?this._onFocus(t,n):this._onBlur(t,n)};monitor(t,a=!1){let n=R(t);if(!this._platform.isBrowser||n.nodeType!==1)return Jt();let i=Dt(n)||this._document,s=this._elementInfo.get(n);if(s)return a&&(s.checkChildren=!0),s.subject;let d={checkChildren:a,subject:new _,rootNode:i};return this._elementInfo.set(n,d),this._registerGlobalListeners(d),d.subject}stopMonitoring(t){let a=R(t),n=this._elementInfo.get(a);n&&(n.subject.complete(),this._setClasses(a),this._elementInfo.delete(a),this._removeGlobalListeners(n))}focusVia(t,a,n){let i=R(t),s=this._document.activeElement;i===s?this._getClosestElementsInfo(i).forEach(([d,g])=>this._originChanged(d,a,g)):(this._setOrigin(a),typeof i.focus=="function"&&i.focus(n))}ngOnDestroy(){this._elementInfo.forEach((t,a)=>this.stopMonitoring(a))}_getWindow(){return this._document.defaultView||window}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:t&&this._isLastInteractionFromInputLabel(t)?"mouse":"program"}_shouldBeAttributedToTouch(t){return this._detectionMode===Y.EVENTUAL||!!t?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(t,a){t.classList.toggle("cdk-focused",!!a),t.classList.toggle("cdk-touch-focused",a==="touch"),t.classList.toggle("cdk-keyboard-focused",a==="keyboard"),t.classList.toggle("cdk-mouse-focused",a==="mouse"),t.classList.toggle("cdk-program-focused",a==="program")}_setOrigin(t,a=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=t,this._originFromTouchInteraction=t==="touch"&&a,this._detectionMode===Y.IMMEDIATE){clearTimeout(this._originTimeoutId);let n=this._originFromTouchInteraction?Te:1;this._originTimeoutId=setTimeout(()=>this._origin=null,n)}})}_onFocus(t,a){let n=this._elementInfo.get(a),i=x(t);!n||!n.checkChildren&&a!==i||this._originChanged(a,this._getFocusOrigin(i),n)}_onBlur(t,a){let n=this._elementInfo.get(a);!n||n.checkChildren&&t.relatedTarget instanceof Node&&a.contains(t.relatedTarget)||(this._setClasses(a),this._emitOrigin(n,null))}_emitOrigin(t,a){t.subject.observers.length&&this._ngZone.run(()=>t.subject.next(a))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;let a=t.rootNode,n=this._rootNodeFocusListenerCount.get(a)||0;n||this._ngZone.runOutsideAngular(()=>{a.addEventListener("focus",this._rootNodeFocusAndBlurListener,it),a.addEventListener("blur",this._rootNodeFocusAndBlurListener,it)}),this._rootNodeFocusListenerCount.set(a,n+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(at(this._stopInputModalityDetector)).subscribe(i=>{this._setOrigin(i,!0)}))}_removeGlobalListeners(t){let a=t.rootNode;if(this._rootNodeFocusListenerCount.has(a)){let n=this._rootNodeFocusListenerCount.get(a);n>1?this._rootNodeFocusListenerCount.set(a,n-1):(a.removeEventListener("focus",this._rootNodeFocusAndBlurListener,it),a.removeEventListener("blur",this._rootNodeFocusAndBlurListener,it),this._rootNodeFocusListenerCount.delete(a))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,a,n){this._setClasses(t,a),this._emitOrigin(n,a),this._lastFocusOrigin=a}_getClosestElementsInfo(t){let a=[];return this._elementInfo.forEach((n,i)=>{(i===t||n.checkChildren&&i.contains(t))&&a.push([i,n])}),a}_isLastInteractionFromInputLabel(t){let{_mostRecentTarget:a,mostRecentModality:n}=this._inputModalityDetector;if(n!=="mouse"||!a||a===t||t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"||t.disabled)return!1;let i=t.labels;if(i){for(let s=0;s<i.length;s++)if(i[s].contains(a))return!0}return!1}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var rt=new WeakMap,M=(()=>{class e{_appRef;_injector=r(A);_environmentInjector=r(se);load(t){let a=this._appRef=this._appRef||this._injector.get(fe),n=rt.get(a);n||(n={loaders:new Set,refs:[]},rt.set(a,n),a.onDestroy(()=>{rt.get(a)?.refs.forEach(i=>i.destroy()),rt.delete(a)})),n.loaders.has(t)||(n.loaders.add(t),n.refs.push(ge(t,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var ct=(()=>{class e{static \u0275fac=function(a){return new(a||e)};static \u0275cmp=y({type:e,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(a,n){},styles:[`.cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}
1
+ import{$a as V,Aa as ot,B as ae,Ba as de,Ca as me,Da as le,F as tt,Fa as ue,G as oe,Gb as W,Hb as T,J as ne,Kc as _e,Ma as be,Oa as nt,Pa as pe,Q as et,R as ie,Rb as O,Sb as he,T as at,Uc as ye,V as re,Wa as y,Xa as I,Ya as k,Z as c,_ as E,a as u,aa as m,ca as r,db as It,e as Qt,ea as se,g as Xt,h as _,i as qt,ib as fe,jb as wt,ka as A,la as h,m as Jt,oa as xt,pa as b,t as H,ta as K,tc as N,u as te,ua as ce,uc as ve,vb as At,wb as Tt,wc as ge,x as ee,xb as C,ya as D,za as Et}from"./chunk-RNXBUYHW.js";function G(e){return e.buttons===0||e.detail===0}function Z(e){let o=e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0];return!!o&&o.identifier===-1&&(o.radiusX==null||o.radiusX===1)&&(o.radiusY==null||o.radiusY===1)}var Mt;function xe(){if(Mt==null){let e=typeof document<"u"?document.head:null;Mt=!!(e&&(e.createShadowRoot||e.attachShadow))}return Mt}function Dt(e){if(xe()){let o=e.getRootNode?e.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&o instanceof ShadowRoot)return o}return null}function sa(){let e=typeof document<"u"&&document?document.activeElement:null;for(;e&&e.shadowRoot;){let o=e.shadowRoot.activeElement;if(o===e)break;e=o}return e}function x(e){return e.composedPath?e.composedPath()[0]:e.target}var kt;try{kt=typeof Intl<"u"&&Intl.v8BreakIterator}catch(e){kt=!1}var p=(()=>{class e{_platformId=r(de);isBrowser=this._platformId?_e(this._platformId):typeof document=="object"&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||kt)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var $;function Ee(){if($==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>$=!0}))}finally{$=$||!1}return $}function B(e){return Ee()?e:!!e.capture}function ca(e,o=0){return Ie(e)?Number(e):arguments.length===2?o:0}function Ie(e){return!isNaN(parseFloat(e))&&!isNaN(Number(e))}function R(e){return e instanceof D?e.nativeElement:e}var we=new m("cdk-input-modality-detector-options"),Ae={ignoreKeys:[18,17,224,91,16]},Te=650,Ct={passive:!0,capture:!0},Me=(()=>{class e{_platform=r(p);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new qt(null);_options;_lastTouchMs=0;_onKeydown=t=>{this._options?.ignoreKeys?.some(a=>a===t.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=x(t))};_onMousedown=t=>{Date.now()-this._lastTouchMs<Te||(this._modality.next(G(t)?"keyboard":"mouse"),this._mostRecentTarget=x(t))};_onTouchstart=t=>{if(Z(t)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=x(t)};constructor(){let t=r(b),a=r(h),n=r(we,{optional:!0});if(this._options=u(u({},Ae),n),this.modalityDetected=this._modality.pipe(et(1)),this.modalityChanged=this.modalityDetected.pipe(ne()),this._platform.isBrowser){let i=r(nt).createRenderer(null,null);this._listenerCleanups=t.runOutsideAngular(()=>[i.listen(a,"keydown",this._onKeydown,Ct),i.listen(a,"mousedown",this._onMousedown,Ct),i.listen(a,"touchstart",this._onTouchstart,Ct)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(t=>t())}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Y=(function(e){return e[e.IMMEDIATE=0]="IMMEDIATE",e[e.EVENTUAL=1]="EVENTUAL",e})(Y||{}),De=new m("cdk-focus-monitor-default-options"),it=B({passive:!0,capture:!0}),Ot=(()=>{class e{_ngZone=r(b);_platform=r(p);_inputModalityDetector=r(Me);_origin=null;_lastFocusOrigin=null;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=r(h);_stopInputModalityDetector=new _;constructor(){let t=r(De,{optional:!0});this._detectionMode=t?.detectionMode||Y.IMMEDIATE}_rootNodeFocusAndBlurListener=t=>{let a=x(t);for(let n=a;n;n=n.parentElement)t.type==="focus"?this._onFocus(t,n):this._onBlur(t,n)};monitor(t,a=!1){let n=R(t);if(!this._platform.isBrowser||n.nodeType!==1)return Jt();let i=Dt(n)||this._document,s=this._elementInfo.get(n);if(s)return a&&(s.checkChildren=!0),s.subject;let d={checkChildren:a,subject:new _,rootNode:i};return this._elementInfo.set(n,d),this._registerGlobalListeners(d),d.subject}stopMonitoring(t){let a=R(t),n=this._elementInfo.get(a);n&&(n.subject.complete(),this._setClasses(a),this._elementInfo.delete(a),this._removeGlobalListeners(n))}focusVia(t,a,n){let i=R(t),s=this._document.activeElement;i===s?this._getClosestElementsInfo(i).forEach(([d,g])=>this._originChanged(d,a,g)):(this._setOrigin(a),typeof i.focus=="function"&&i.focus(n))}ngOnDestroy(){this._elementInfo.forEach((t,a)=>this.stopMonitoring(a))}_getWindow(){return this._document.defaultView||window}_getFocusOrigin(t){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(t)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:t&&this._isLastInteractionFromInputLabel(t)?"mouse":"program"}_shouldBeAttributedToTouch(t){return this._detectionMode===Y.EVENTUAL||!!t?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(t,a){t.classList.toggle("cdk-focused",!!a),t.classList.toggle("cdk-touch-focused",a==="touch"),t.classList.toggle("cdk-keyboard-focused",a==="keyboard"),t.classList.toggle("cdk-mouse-focused",a==="mouse"),t.classList.toggle("cdk-program-focused",a==="program")}_setOrigin(t,a=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=t,this._originFromTouchInteraction=t==="touch"&&a,this._detectionMode===Y.IMMEDIATE){clearTimeout(this._originTimeoutId);let n=this._originFromTouchInteraction?Te:1;this._originTimeoutId=setTimeout(()=>this._origin=null,n)}})}_onFocus(t,a){let n=this._elementInfo.get(a),i=x(t);!n||!n.checkChildren&&a!==i||this._originChanged(a,this._getFocusOrigin(i),n)}_onBlur(t,a){let n=this._elementInfo.get(a);!n||n.checkChildren&&t.relatedTarget instanceof Node&&a.contains(t.relatedTarget)||(this._setClasses(a),this._emitOrigin(n,null))}_emitOrigin(t,a){t.subject.observers.length&&this._ngZone.run(()=>t.subject.next(a))}_registerGlobalListeners(t){if(!this._platform.isBrowser)return;let a=t.rootNode,n=this._rootNodeFocusListenerCount.get(a)||0;n||this._ngZone.runOutsideAngular(()=>{a.addEventListener("focus",this._rootNodeFocusAndBlurListener,it),a.addEventListener("blur",this._rootNodeFocusAndBlurListener,it)}),this._rootNodeFocusListenerCount.set(a,n+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(at(this._stopInputModalityDetector)).subscribe(i=>{this._setOrigin(i,!0)}))}_removeGlobalListeners(t){let a=t.rootNode;if(this._rootNodeFocusListenerCount.has(a)){let n=this._rootNodeFocusListenerCount.get(a);n>1?this._rootNodeFocusListenerCount.set(a,n-1):(a.removeEventListener("focus",this._rootNodeFocusAndBlurListener,it),a.removeEventListener("blur",this._rootNodeFocusAndBlurListener,it),this._rootNodeFocusListenerCount.delete(a))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(t,a,n){this._setClasses(t,a),this._emitOrigin(n,a),this._lastFocusOrigin=a}_getClosestElementsInfo(t){let a=[];return this._elementInfo.forEach((n,i)=>{(i===t||n.checkChildren&&i.contains(t))&&a.push([i,n])}),a}_isLastInteractionFromInputLabel(t){let{_mostRecentTarget:a,mostRecentModality:n}=this._inputModalityDetector;if(n!=="mouse"||!a||a===t||t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"||t.disabled)return!1;let i=t.labels;if(i){for(let s=0;s<i.length;s++)if(i[s].contains(a))return!0}return!1}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var rt=new WeakMap,M=(()=>{class e{_appRef;_injector=r(A);_environmentInjector=r(se);load(t){let a=this._appRef=this._appRef||this._injector.get(fe),n=rt.get(a);n||(n={loaders:new Set,refs:[]},rt.set(a,n),a.onDestroy(()=>{rt.get(a)?.refs.forEach(i=>i.destroy()),rt.delete(a)})),n.loaders.has(t)||(n.loaders.add(t),n.refs.push(ge(t,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var ct=(()=>{class e{static \u0275fac=function(a){return new(a||e)};static \u0275cmp=y({type:e,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(a,n){},styles:[`.cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}
2
2
  `],encapsulation:2,changeDetection:0})}return e})(),st;function da(){if(st===void 0&&(st=null,typeof window<"u")){let e=window;e.trustedTypes!==void 0&&(st=e.trustedTypes.createPolicy("angular#components",{createHTML:o=>o}))}return st}function ma(e){return da()?.createHTML(e)||e}function ke(e,o,t){let a=t.sanitize(ue.HTML,o);e.innerHTML=ma(a||"")}function dt(e){return Array.isArray(e)?e:[e]}var Ce=new Set,S,mt=(()=>{class e{_platform=r(p);_nonce=r(le,{optional:!0});_matchMedia;constructor(){this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):ua}matchMedia(t){return(this._platform.WEBKIT||this._platform.BLINK)&&la(t,this._nonce),this._matchMedia(t)}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function la(e,o){if(!Ce.has(e))try{S||(S=document.createElement("style"),o&&S.setAttribute("nonce",o),S.setAttribute("type","text/css"),document.head.appendChild(S)),S.sheet&&(S.sheet.insertRule(`@media ${e} {body{ }}`,0),Ce.add(e))}catch(t){console.error(t)}}function ua(e){return{matches:e==="all"||e==="",media:e,addListener:()=>{},removeListener:()=>{}}}var Nt=(()=>{class e{_mediaMatcher=r(mt);_zone=r(b);_queries=new Map;_destroySubject=new _;constructor(){}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return Oe(dt(t)).some(n=>this._registerQuery(n).mql.matches)}observe(t){let n=Oe(dt(t)).map(s=>this._registerQuery(s).observable),i=te(n);return i=ee(i.pipe(oe(1)),i.pipe(et(1),tt(0))),i.pipe(H(s=>{let d={matches:!1,breakpoints:{}};return s.forEach(({matches:g,query:w})=>{d.matches=d.matches||g,d.breakpoints[w]=g}),d}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);let a=this._mediaMatcher.matchMedia(t),i={observable:new Xt(s=>{let d=g=>this._zone.run(()=>s.next(g));return a.addListener(d),()=>{a.removeListener(d)}}).pipe(ie(a),H(({matches:s})=>({query:t,matches:s})),at(this._destroySubject)),mql:a};return this._queries.set(t,i),i}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Oe(e){return e.map(o=>o.split(",")).reduce((o,t)=>o.concat(t)).map(o=>o.trim())}var ba=(()=>{class e{create(t){return typeof MutationObserver>"u"?null:new MutationObserver(t)}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var Ne=(()=>{class e{static \u0275fac=function(a){return new(a||e)};static \u0275mod=I({type:e});static \u0275inj=E({providers:[ba]})}return e})();var Se=(()=>{class e{_platform=r(p);constructor(){}isDisabled(t){return t.hasAttribute("disabled")}isVisible(t){return fa(t)&&getComputedStyle(t).visibility==="visible"}isTabbable(t){if(!this._platform.isBrowser)return!1;let a=pa(Ia(t));if(a&&(Re(a)===-1||!this.isVisible(a)))return!1;let n=t.nodeName.toLowerCase(),i=Re(t);return t.hasAttribute("contenteditable")?i!==-1:n==="iframe"||n==="object"||this._platform.WEBKIT&&this._platform.IOS&&!xa(t)?!1:n==="audio"?t.hasAttribute("controls")?i!==-1:!1:n==="video"?i===-1?!1:i!==null?!0:this._platform.FIREFOX||t.hasAttribute("controls"):t.tabIndex>=0}isFocusable(t,a){return Ea(t)&&!this.isDisabled(t)&&(a?.ignoreVisibility||this.isVisible(t))}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function pa(e){try{return e.frameElement}catch(o){return null}}function fa(e){return!!(e.offsetWidth||e.offsetHeight||typeof e.getClientRects=="function"&&e.getClientRects().length)}function ha(e){let o=e.nodeName.toLowerCase();return o==="input"||o==="select"||o==="button"||o==="textarea"}function va(e){return _a(e)&&e.type=="hidden"}function ga(e){return ya(e)&&e.hasAttribute("href")}function _a(e){return e.nodeName.toLowerCase()=="input"}function ya(e){return e.nodeName.toLowerCase()=="a"}function Pe(e){if(!e.hasAttribute("tabindex")||e.tabIndex===void 0)return!1;let o=e.getAttribute("tabindex");return!!(o&&!isNaN(parseInt(o,10)))}function Re(e){if(!Pe(e))return null;let o=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(o)?-1:o}function xa(e){let o=e.nodeName.toLowerCase(),t=o==="input"&&e.type;return t==="text"||t==="password"||o==="select"||o==="textarea"}function Ea(e){return va(e)?!1:ha(e)||ga(e)||e.hasAttribute("contenteditable")||Pe(e)}function Ia(e){return e.ownerDocument&&e.ownerDocument.defaultView||window}var lt=class{_element;_checker;_ngZone;_document;_injector;_startAnchor=null;_endAnchor=null;_hasAttached=!1;startAnchorListener=()=>this.focusLastTabbableElement();endAnchorListener=()=>this.focusFirstTabbableElement();get enabled(){return this._enabled}set enabled(o){this._enabled=o,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(o,this._startAnchor),this._toggleAnchorTabIndex(o,this._endAnchor))}_enabled=!0;constructor(o,t,a,n,i=!1,s){this._element=o,this._checker=t,this._ngZone=a,this._document=n,this._injector=s,i||this.attachAnchors()}destroy(){let o=this._startAnchor,t=this._endAnchor;o&&(o.removeEventListener("focus",this.startAnchorListener),o.remove()),t&&(t.removeEventListener("focus",this.endAnchorListener),t.remove()),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return this._hasAttached?!0:(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(o){return new Promise(t=>{this._executeOnStable(()=>t(this.focusInitialElement(o)))})}focusFirstTabbableElementWhenReady(o){return new Promise(t=>{this._executeOnStable(()=>t(this.focusFirstTabbableElement(o)))})}focusLastTabbableElementWhenReady(o){return new Promise(t=>{this._executeOnStable(()=>t(this.focusLastTabbableElement(o)))})}_getRegionBoundary(o){let t=this._element.querySelectorAll(`[cdk-focus-region-${o}], [cdkFocusRegion${o}], [cdk-focus-${o}]`);return o=="start"?t.length?t[0]:this._getFirstTabbableElement(this._element):t.length?t[t.length-1]:this._getLastTabbableElement(this._element)}focusInitialElement(o){let t=this._element.querySelector("[cdk-focus-initial], [cdkFocusInitial]");if(t){if(!this._checker.isFocusable(t)){let a=this._getFirstTabbableElement(t);return a?.focus(o),!!a}return t.focus(o),!0}return this.focusFirstTabbableElement(o)}focusFirstTabbableElement(o){let t=this._getRegionBoundary("start");return t&&t.focus(o),!!t}focusLastTabbableElement(o){let t=this._getRegionBoundary("end");return t&&t.focus(o),!!t}hasAttached(){return this._hasAttached}_getFirstTabbableElement(o){if(this._checker.isFocusable(o)&&this._checker.isTabbable(o))return o;let t=o.children;for(let a=0;a<t.length;a++){let n=t[a].nodeType===this._document.ELEMENT_NODE?this._getFirstTabbableElement(t[a]):null;if(n)return n}return null}_getLastTabbableElement(o){if(this._checker.isFocusable(o)&&this._checker.isTabbable(o))return o;let t=o.children;for(let a=t.length-1;a>=0;a--){let n=t[a].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(t[a]):null;if(n)return n}return null}_createAnchor(){let o=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,o),o.classList.add("cdk-visually-hidden"),o.classList.add("cdk-focus-trap-anchor"),o.setAttribute("aria-hidden","true"),o}_toggleAnchorTabIndex(o,t){o?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex")}toggleAnchors(o){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(o,this._startAnchor),this._toggleAnchorTabIndex(o,this._endAnchor))}_executeOnStable(o){this._injector?be(o,{injector:this._injector}):setTimeout(o)}},wa=(()=>{class e{_checker=r(Se);_ngZone=r(b);_document=r(h);_injector=r(A);constructor(){r(M).load(ct)}create(t,a=!1){return new lt(t,this._checker,this._ngZone,this._document,a,this._injector)}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var Be=new m("liveAnnouncerElement",{providedIn:"root",factory:()=>null}),je=new m("LIVE_ANNOUNCER_DEFAULT_OPTIONS"),Aa=0,Ta=(()=>{class e{_ngZone=r(b);_defaultOptions=r(je,{optional:!0});_liveElement;_document=r(h);_sanitizer=r(ye);_previousTimeout;_currentPromise;_currentResolve;constructor(){let t=r(Be,{optional:!0});this._liveElement=t||this._createLiveElement()}announce(t,...a){let n=this._defaultOptions,i,s;return a.length===1&&typeof a[0]=="number"?s=a[0]:[i,s]=a,this.clear(),clearTimeout(this._previousTimeout),i||(i=n&&n.politeness?n.politeness:"polite"),s==null&&n&&(s=n.duration),this._liveElement.setAttribute("aria-live",i),this._liveElement.id&&this._exposeAnnouncerToModals(this._liveElement.id),this._ngZone.runOutsideAngular(()=>(this._currentPromise||(this._currentPromise=new Promise(d=>this._currentResolve=d)),clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{!t||typeof t=="string"?this._liveElement.textContent=t:ke(this._liveElement,t,this._sanitizer),typeof s=="number"&&(this._previousTimeout=setTimeout(()=>this.clear(),s)),this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0},100),this._currentPromise))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement?.remove(),this._liveElement=null,this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0}_createLiveElement(){let t="cdk-live-announcer-element",a=this._document.getElementsByClassName(t),n=this._document.createElement("div");for(let i=0;i<a.length;i++)a[i].remove();return n.classList.add(t),n.classList.add("cdk-visually-hidden"),n.setAttribute("aria-atomic","true"),n.setAttribute("aria-live","polite"),n.id=`cdk-live-announcer-${Aa++}`,this._document.body.appendChild(n),n}_exposeAnnouncerToModals(t){let a=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<a.length;n++){let i=a[n],s=i.getAttribute("aria-owns");s?s.indexOf(t)===-1&&i.setAttribute("aria-owns",s+" "+t):i.setAttribute("aria-owns",t)}}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var F=(function(e){return e[e.NONE=0]="NONE",e[e.BLACK_ON_WHITE=1]="BLACK_ON_WHITE",e[e.WHITE_ON_BLACK=2]="WHITE_ON_BLACK",e})(F||{}),Fe="cdk-high-contrast-black-on-white",Le="cdk-high-contrast-white-on-black",Rt="cdk-high-contrast-active",Ue=(()=>{class e{_platform=r(p);_hasCheckedHighContrastMode=!1;_document=r(h);_breakpointSubscription;constructor(){this._breakpointSubscription=r(Nt).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return F.NONE;let t=this._document.createElement("div");t.style.backgroundColor="rgb(1,2,3)",t.style.position="absolute",this._document.body.appendChild(t);let a=this._document.defaultView||window,n=a&&a.getComputedStyle?a.getComputedStyle(t):null,i=(n&&n.backgroundColor||"").replace(/ /g,"");switch(t.remove(),i){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return F.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return F.BLACK_ON_WHITE}return F.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){let t=this._document.body.classList;t.remove(Rt,Fe,Le),this._hasCheckedHighContrastMode=!0;let a=this.getHighContrastMode();a===F.BLACK_ON_WHITE?t.add(Rt,Fe):a===F.WHITE_ON_BLACK&&t.add(Rt,Le)}}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Ma=(()=>{class e{constructor(){r(Ue)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(a){return new(a||e)};static \u0275mod=I({type:e});static \u0275inj=E({imports:[Ne]})}return e})();var Ft={},Lt=class e{_appId=r(ot);static _infix=`a${Math.floor(Math.random()*1e5).toString()}`;getId(o,t=!1){return this._appId!=="ng"&&(o+=this._appId),Ft.hasOwnProperty(o)||(Ft[o]=0),`${o}${t?e._infix+"-":""}${Ft[o]++}`}static \u0275fac=function(t){return new(t||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})};var Da=200,ut=class{_letterKeyStream=new _;_items=[];_selectedItemIndex=-1;_pressedLetters=[];_skipPredicateFn;_selectedItem=new _;selectedItem=this._selectedItem;constructor(o,t){let a=typeof t?.debounceInterval=="number"?t.debounceInterval:Da;t?.skipPredicate&&(this._skipPredicateFn=t.skipPredicate),this.setItems(o),this._setupKeyHandler(a)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(o){this._selectedItemIndex=o}setItems(o){this._items=o}handleKey(o){let t=o.keyCode;o.key&&o.key.length===1?this._letterKeyStream.next(o.key.toLocaleUpperCase()):(t>=65&&t<=90||t>=48&&t<=57)&&this._letterKeyStream.next(String.fromCharCode(t))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(o){this._letterKeyStream.pipe(re(t=>this._pressedLetters.push(t)),tt(o),ae(()=>this._pressedLetters.length>0),H(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(t=>{for(let a=1;a<this._items.length+1;a++){let n=(this._selectedItemIndex+a)%this._items.length,i=this._items[n];if(!this._skipPredicateFn?.(i)&&i.getLabel?.().toLocaleUpperCase().trim().indexOf(t)===0){this._selectedItem.next(i);break}}this._pressedLetters=[]})}};function ze(e,...o){return o.length?o.some(t=>e[t]):e.altKey||e.shiftKey||e.ctrlKey||e.metaKey}var j=class{_items;_activeItemIndex=K(-1);_activeItem=K(null);_wrap=!1;_typeaheadSubscription=Qt.EMPTY;_itemChangesSubscription;_vertical=!0;_horizontal=null;_allowedModifierKeys=[];_homeAndEnd=!1;_pageUpAndDown={enabled:!1,delta:10};_effectRef;_typeahead;_skipPredicateFn=o=>o.disabled;constructor(o,t){this._items=o,o instanceof Et?this._itemChangesSubscription=o.changes.subscribe(a=>this._itemsChanged(a.toArray())):It(o)&&(this._effectRef=ce(()=>this._itemsChanged(o()),{injector:t}))}tabOut=new _;change=new _;skipPredicate(o){return this._skipPredicateFn=o,this}withWrap(o=!0){return this._wrap=o,this}withVerticalOrientation(o=!0){return this._vertical=o,this}withHorizontalOrientation(o){return this._horizontal=o,this}withAllowedModifierKeys(o){return this._allowedModifierKeys=o,this}withTypeAhead(o=200){this._typeaheadSubscription.unsubscribe();let t=this._getItemsArray();return this._typeahead=new ut(t,{debounceInterval:typeof o=="number"?o:void 0,skipPredicate:a=>this._skipPredicateFn(a)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(a=>{this.setActiveItem(a)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(o=!0){return this._homeAndEnd=o,this}withPageUpDown(o=!0,t=10){return this._pageUpAndDown={enabled:o,delta:t},this}setActiveItem(o){let t=this._activeItem();this.updateActiveItem(o),this._activeItem()!==t&&this.change.next(this._activeItemIndex())}onKeydown(o){let t=o.keyCode,n=["altKey","ctrlKey","metaKey","shiftKey"].every(i=>!o[i]||this._allowedModifierKeys.indexOf(i)>-1);switch(t){case 9:this.tabOut.next();return;case 40:if(this._vertical&&n){this.setNextItemActive();break}else return;case 38:if(this._vertical&&n){this.setPreviousItemActive();break}else return;case 39:if(this._horizontal&&n){this._horizontal==="rtl"?this.setPreviousItemActive():this.setNextItemActive();break}else return;case 37:if(this._horizontal&&n){this._horizontal==="rtl"?this.setNextItemActive():this.setPreviousItemActive();break}else return;case 36:if(this._homeAndEnd&&n){this.setFirstItemActive();break}else return;case 35:if(this._homeAndEnd&&n){this.setLastItemActive();break}else return;case 33:if(this._pageUpAndDown.enabled&&n){let i=this._activeItemIndex()-this._pageUpAndDown.delta;this._setActiveItemByIndex(i>0?i:0,1);break}else return;case 34:if(this._pageUpAndDown.enabled&&n){let i=this._activeItemIndex()+this._pageUpAndDown.delta,s=this._getItemsArray().length;this._setActiveItemByIndex(i<s?i:s-1,-1);break}else return;default:(n||ze(o,"shiftKey"))&&this._typeahead?.handleKey(o);return}this._typeahead?.reset(),o.preventDefault()}get activeItemIndex(){return this._activeItemIndex()}get activeItem(){return this._activeItem()}isTyping(){return!!this._typeahead&&this._typeahead.isTyping()}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._getItemsArray().length-1,-1)}setNextItemActive(){this._activeItemIndex()<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex()<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(o){let t=this._getItemsArray(),a=typeof o=="number"?o:t.indexOf(o),n=t[a];this._activeItem.set(n??null),this._activeItemIndex.set(a),this._typeahead?.setCurrentSelectedItemIndex(a)}destroy(){this._typeaheadSubscription.unsubscribe(),this._itemChangesSubscription?.unsubscribe(),this._effectRef?.destroy(),this._typeahead?.destroy(),this.tabOut.complete(),this.change.complete()}_setActiveItemByDelta(o){this._wrap?this._setActiveInWrapMode(o):this._setActiveInDefaultMode(o)}_setActiveInWrapMode(o){let t=this._getItemsArray();for(let a=1;a<=t.length;a++){let n=(this._activeItemIndex()+o*a+t.length)%t.length,i=t[n];if(!this._skipPredicateFn(i)){this.setActiveItem(n);return}}}_setActiveInDefaultMode(o){this._setActiveItemByIndex(this._activeItemIndex()+o,o)}_setActiveItemByIndex(o,t){let a=this._getItemsArray();if(a[o]){for(;this._skipPredicateFn(a[o]);)if(o+=t,!a[o])return;this.setActiveItem(o)}}_getItemsArray(){return It(this._items)?this._items():this._items instanceof Et?this._items.toArray():this._items}_itemsChanged(o){this._typeahead?.setItems(o);let t=this._activeItem();if(t){let a=o.indexOf(t);a>-1&&a!==this._activeItemIndex()&&(this._activeItemIndex.set(a),this._typeahead?.setCurrentSelectedItemIndex(a))}}};var St=class extends j{setActiveItem(o){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(o),this.activeItem&&this.activeItem.setActiveStyles()}};var Pt=class extends j{_origin="program";setFocusOrigin(o){return this._origin=o,this}setActiveItem(o){super.setActiveItem(o),this.activeItem&&this.activeItem.focus(this._origin)}};var Ke=" ";function ka(e,o,t){let a=pt(e,o);t=t.trim(),!a.some(n=>n.trim()===t)&&(a.push(t),e.setAttribute(o,a.join(Ke)))}function Ca(e,o,t){let a=pt(e,o);t=t.trim();let n=a.filter(i=>i!==t);n.length?e.setAttribute(o,n.join(Ke)):e.removeAttribute(o)}function pt(e,o){return e.getAttribute(o)?.match(/\S+/g)??[]}var Ve="cdk-describedby-message",bt="cdk-describedby-host",jt=0,zn=(()=>{class e{_platform=r(p);_document=r(h);_messageRegistry=new Map;_messagesContainer=null;_id=`${jt++}`;constructor(){r(M).load(ct),this._id=r(ot)+"-"+jt++}describe(t,a,n){if(!this._canBeDescribed(t,a))return;let i=Bt(a,n);typeof a!="string"?(He(a,this._id),this._messageRegistry.set(i,{messageElement:a,referenceCount:0})):this._messageRegistry.has(i)||this._createMessageElement(a,n),this._isElementDescribedByMessage(t,i)||this._addMessageReference(t,i)}removeDescription(t,a,n){if(!a||!this._isElementNode(t))return;let i=Bt(a,n);if(this._isElementDescribedByMessage(t,i)&&this._removeMessageReference(t,i),typeof a=="string"){let s=this._messageRegistry.get(i);s&&s.referenceCount===0&&this._deleteMessageElement(i)}this._messagesContainer?.childNodes.length===0&&(this._messagesContainer.remove(),this._messagesContainer=null)}ngOnDestroy(){let t=this._document.querySelectorAll(`[${bt}="${this._id}"]`);for(let a=0;a<t.length;a++)this._removeCdkDescribedByReferenceIds(t[a]),t[a].removeAttribute(bt);this._messagesContainer?.remove(),this._messagesContainer=null,this._messageRegistry.clear()}_createMessageElement(t,a){let n=this._document.createElement("div");He(n,this._id),n.textContent=t,a&&n.setAttribute("role",a),this._createMessagesContainer(),this._messagesContainer.appendChild(n),this._messageRegistry.set(Bt(t,a),{messageElement:n,referenceCount:0})}_deleteMessageElement(t){this._messageRegistry.get(t)?.messageElement?.remove(),this._messageRegistry.delete(t)}_createMessagesContainer(){if(this._messagesContainer)return;let t="cdk-describedby-message-container",a=this._document.querySelectorAll(`.${t}[platform="server"]`);for(let i=0;i<a.length;i++)a[i].remove();let n=this._document.createElement("div");n.style.visibility="hidden",n.classList.add(t),n.classList.add("cdk-visually-hidden"),this._platform.isBrowser||n.setAttribute("platform","server"),this._document.body.appendChild(n),this._messagesContainer=n}_removeCdkDescribedByReferenceIds(t){let a=pt(t,"aria-describedby").filter(n=>n.indexOf(Ve)!=0);t.setAttribute("aria-describedby",a.join(" "))}_addMessageReference(t,a){let n=this._messageRegistry.get(a);ka(t,"aria-describedby",n.messageElement.id),t.setAttribute(bt,this._id),n.referenceCount++}_removeMessageReference(t,a){let n=this._messageRegistry.get(a);n.referenceCount--,Ca(t,"aria-describedby",n.messageElement.id),t.removeAttribute(bt)}_isElementDescribedByMessage(t,a){let n=pt(t,"aria-describedby"),i=this._messageRegistry.get(a),s=i&&i.messageElement.id;return!!s&&n.indexOf(s)!=-1}_canBeDescribed(t,a){if(!this._isElementNode(t))return!1;if(a&&typeof a=="object")return!0;let n=a==null?"":`${a}`.trim(),i=t.getAttribute("aria-label");return n?!i||i.trim()!==n:!1}_isElementNode(t){return t.nodeType===this._document.ELEMENT_NODE}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Bt(e,o){return typeof e=="string"?`${o||""}/${e}`:e}function He(e,o){e.id||(e.id=`${Ve}-${o}-${jt++}`)}var Q=(function(e){return e[e.NORMAL=0]="NORMAL",e[e.NEGATED=1]="NEGATED",e[e.INVERTED=2]="INVERTED",e})(Q||{}),ft,P;function Yn(){if(P==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return P=!1,P;if(document.documentElement?.style&&"scrollBehavior"in document.documentElement.style)P=!0;else{let e=Element.prototype.scrollTo;e?P=!/\{\s*\[native code\]\s*\}/.test(e.toString()):P=!1}}return P}function Qn(){if(typeof document!="object"||!document)return Q.NORMAL;if(ft==null){let e=document.createElement("div"),o=e.style;e.dir="rtl",o.width="1px",o.overflow="auto",o.visibility="hidden",o.pointerEvents="none",o.position="absolute";let t=document.createElement("div"),a=t.style;a.width="2px",a.height="1px",e.appendChild(t),document.body.appendChild(e),ft=Q.NORMAL,e.scrollLeft===0&&(e.scrollLeft=1,ft=e.scrollLeft===0?Q.NEGATED:Q.INVERTED),e.remove()}return ft}function qn(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}var U,We=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function ti(){if(U)return U;if(typeof document!="object"||!document)return U=new Set(We),U;let e=document.createElement("input");return U=new Set(We.filter(o=>(e.setAttribute("type",o),e.type===o))),U}var ii={XSmall:"(max-width: 599.98px)",Small:"(min-width: 600px) and (max-width: 959.98px)",Medium:"(min-width: 960px) and (max-width: 1279.98px)",Large:"(min-width: 1280px) and (max-width: 1919.98px)",XLarge:"(min-width: 1920px)",Handset:"(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)",Tablet:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait), (min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",Web:"(min-width: 840px) and (orientation: portrait), (min-width: 1280px) and (orientation: landscape)",HandsetPortrait:"(max-width: 599.98px) and (orientation: portrait)",TabletPortrait:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait)",WebPortrait:"(min-width: 840px) and (orientation: portrait)",HandsetLandscape:"(max-width: 959.98px) and (orientation: landscape)",TabletLandscape:"(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",WebLandscape:"(min-width: 1280px) and (orientation: landscape)"};var Oa=new m("MATERIAL_ANIMATIONS"),Ge=null;function Na(){return r(Oa,{optional:!0})?.animationsDisabled||r(me,{optional:!0})==="NoopAnimations"?"di-disabled":(Ge??=r(mt).matchMedia("(prefers-reduced-motion)").matches,Ge?"reduced-motion":"enabled")}function z(){return Na()!=="enabled"}function li(e){return e==null?"":typeof e=="string"?e:`${e}px`}function bi(e){return e!=null&&`${e}`!="false"}var v=(function(e){return e[e.FADING_IN=0]="FADING_IN",e[e.VISIBLE=1]="VISIBLE",e[e.FADING_OUT=2]="FADING_OUT",e[e.HIDDEN=3]="HIDDEN",e})(v||{}),Ut=class{_renderer;element;config;_animationForciblyDisabledThroughCss;state=v.HIDDEN;constructor(o,t,a,n=!1){this._renderer=o,this.element=t,this.config=a,this._animationForciblyDisabledThroughCss=n}fadeOut(){this._renderer.fadeOutRipple(this)}},Ze=B({passive:!0,capture:!0}),zt=class{_events=new Map;addHandler(o,t,a,n){let i=this._events.get(t);if(i){let s=i.get(a);s?s.add(n):i.set(a,new Set([n]))}else this._events.set(t,new Map([[a,new Set([n])]])),o.runOutsideAngular(()=>{document.addEventListener(t,this._delegateEventHandler,Ze)})}removeHandler(o,t,a){let n=this._events.get(o);if(!n)return;let i=n.get(t);i&&(i.delete(a),i.size===0&&n.delete(t),n.size===0&&(this._events.delete(o),document.removeEventListener(o,this._delegateEventHandler,Ze)))}_delegateEventHandler=o=>{let t=x(o);t&&this._events.get(o.type)?.forEach((a,n)=>{(n===t||n.contains(t))&&a.forEach(i=>i.handleEvent(o))})}},X={enterDuration:225,exitDuration:150},Ra=800,$e=B({passive:!0,capture:!0}),Ye=["mousedown","touchstart"],Qe=["mouseup","mouseleave","touchend","touchcancel"],Fa=(()=>{class e{static \u0275fac=function(a){return new(a||e)};static \u0275cmp=y({type:e,selectors:[["ng-component"]],hostAttrs:["mat-ripple-style-loader",""],decls:0,vars:0,template:function(a,n){},styles:[`.mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none}
3
3
  `],encapsulation:2,changeDetection:0})}return e})(),q=class e{_target;_ngZone;_platform;_containerElement;_triggerElement=null;_isPointerDown=!1;_activeRipples=new Map;_mostRecentTransientRipple=null;_lastTouchStartEvent;_pointerUpEventsRegistered=!1;_containerRect=null;static _eventManager=new zt;constructor(o,t,a,n,i){this._target=o,this._ngZone=t,this._platform=n,n.isBrowser&&(this._containerElement=R(a)),i&&i.get(M).load(Fa)}fadeInRipple(o,t,a={}){let n=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),i=u(u({},X),a.animation);a.centered&&(o=n.left+n.width/2,t=n.top+n.height/2);let s=a.radius||La(o,t,n),d=o-n.left,g=t-n.top,w=i.enterDuration,f=document.createElement("div");f.classList.add("mat-ripple-element"),f.style.left=`${d-s}px`,f.style.top=`${g-s}px`,f.style.height=`${s*2}px`,f.style.width=`${s*2}px`,a.color!=null&&(f.style.backgroundColor=a.color),f.style.transitionDuration=`${w}ms`,this._containerElement.appendChild(f);let Gt=window.getComputedStyle(f),ra=Gt.transitionProperty,Zt=Gt.transitionDuration,_t=ra==="none"||Zt==="0s"||Zt==="0s, 0s"||n.width===0&&n.height===0,L=new Ut(this,f,a,_t);f.style.transform="scale3d(1, 1, 1)",L.state=v.FADING_IN,a.persistent||(this._mostRecentTransientRipple=L);let J=null;return!_t&&(w||i.exitDuration)&&this._ngZone.runOutsideAngular(()=>{let $t=()=>{J&&(J.fallbackTimer=null),clearTimeout(Yt),this._finishRippleTransition(L)},yt=()=>this._destroyRipple(L),Yt=setTimeout(yt,w+100);f.addEventListener("transitionend",$t),f.addEventListener("transitioncancel",yt),J={onTransitionEnd:$t,onTransitionCancel:yt,fallbackTimer:Yt}}),this._activeRipples.set(L,J),(_t||!w)&&this._finishRippleTransition(L),L}fadeOutRipple(o){if(o.state===v.FADING_OUT||o.state===v.HIDDEN)return;let t=o.element,a=u(u({},X),o.config.animation);t.style.transitionDuration=`${a.exitDuration}ms`,t.style.opacity="0",o.state=v.FADING_OUT,(o._animationForciblyDisabledThroughCss||!a.exitDuration)&&this._finishRippleTransition(o)}fadeOutAll(){this._getActiveRipples().forEach(o=>o.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(o=>{o.config.persistent||o.fadeOut()})}setupTriggerEvents(o){let t=R(o);!this._platform.isBrowser||!t||t===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=t,Ye.forEach(a=>{e._eventManager.addHandler(this._ngZone,a,t,this)}))}handleEvent(o){o.type==="mousedown"?this._onMousedown(o):o.type==="touchstart"?this._onTouchStart(o):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{Qe.forEach(t=>{this._triggerElement.addEventListener(t,this,$e)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(o){o.state===v.FADING_IN?this._startFadeOutTransition(o):o.state===v.FADING_OUT&&this._destroyRipple(o)}_startFadeOutTransition(o){let t=o===this._mostRecentTransientRipple,{persistent:a}=o.config;o.state=v.VISIBLE,!a&&(!t||!this._isPointerDown)&&o.fadeOut()}_destroyRipple(o){let t=this._activeRipples.get(o)??null;this._activeRipples.delete(o),this._activeRipples.size||(this._containerRect=null),o===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),o.state=v.HIDDEN,t!==null&&(o.element.removeEventListener("transitionend",t.onTransitionEnd),o.element.removeEventListener("transitioncancel",t.onTransitionCancel),t.fallbackTimer!==null&&clearTimeout(t.fallbackTimer)),o.element.remove()}_onMousedown(o){let t=G(o),a=this._lastTouchStartEvent&&Date.now()<this._lastTouchStartEvent+Ra;!this._target.rippleDisabled&&!t&&!a&&(this._isPointerDown=!0,this.fadeInRipple(o.clientX,o.clientY,this._target.rippleConfig))}_onTouchStart(o){if(!this._target.rippleDisabled&&!Z(o)){this._lastTouchStartEvent=Date.now(),this._isPointerDown=!0;let t=o.changedTouches;if(t)for(let a=0;a<t.length;a++)this.fadeInRipple(t[a].clientX,t[a].clientY,this._target.rippleConfig)}}_onPointerUp(){this._isPointerDown&&(this._isPointerDown=!1,this._getActiveRipples().forEach(o=>{let t=o.state===v.VISIBLE||o.config.terminateOnPointerUp&&o.state===v.FADING_IN;!o.config.persistent&&t&&o.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){let o=this._triggerElement;o&&(Ye.forEach(t=>e._eventManager.removeHandler(t,o,this)),this._pointerUpEventsRegistered&&(Qe.forEach(t=>o.removeEventListener(t,this,$e)),this._pointerUpEventsRegistered=!1))}};function La(e,o,t){let a=Math.max(Math.abs(e-t.left),Math.abs(e-t.right)),n=Math.max(Math.abs(o-t.top),Math.abs(o-t.bottom));return Math.sqrt(a*a+n*n)}var Ht=new m("mat-ripple-global-options"),Di=(()=>{class e{_elementRef=r(D);_animationsDisabled=z();color;unbounded=!1;centered=!1;radius=0;animation;get disabled(){return this._disabled}set disabled(t){t&&this.fadeOutAllNonPersistent(),this._disabled=t,this._setupTriggerEventsIfEnabled()}_disabled=!1;get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(t){this._trigger=t,this._setupTriggerEventsIfEnabled()}_trigger;_rippleRenderer;_globalOptions;_isInitialized=!1;constructor(){let t=r(b),a=r(p),n=r(Ht,{optional:!0}),i=r(A);this._globalOptions=n||{},this._rippleRenderer=new q(this,t,this._elementRef,a,i)}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:u(u(u({},this._globalOptions.animation),this._animationsDisabled?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(t,a=0,n){return typeof t=="number"?this._rippleRenderer.fadeInRipple(t,a,u(u({},this.rippleConfig),n)):this._rippleRenderer.fadeInRipple(0,0,u(u({},this.rippleConfig),t))}static \u0275fac=function(a){return new(a||e)};static \u0275dir=k({type:e,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(a,n){a&2&&O("mat-ripple-unbounded",n.unbounded)},inputs:{color:[0,"matRippleColor","color"],unbounded:[0,"matRippleUnbounded","unbounded"],centered:[0,"matRippleCentered","centered"],radius:[0,"matRippleRadius","radius"],animation:[0,"matRippleAnimation","animation"],disabled:[0,"matRippleDisabled","disabled"],trigger:[0,"matRippleTrigger","trigger"]},exportAs:["matRipple"]})}return e})();var Sa={capture:!0},Pa=["focus","mousedown","mouseenter","touchstart"],Kt="mat-ripple-loader-uninitialized",Vt="mat-ripple-loader-class-name",Xe="mat-ripple-loader-centered",ht="mat-ripple-loader-disabled",qe=(()=>{class e{_document=r(h);_animationsDisabled=z();_globalRippleOptions=r(Ht,{optional:!0});_platform=r(p);_ngZone=r(b);_injector=r(A);_eventCleanups;_hosts=new Map;constructor(){let t=r(nt).createRenderer(null,null);this._eventCleanups=this._ngZone.runOutsideAngular(()=>Pa.map(a=>t.listen(this._document,a,this._onInteraction,Sa)))}ngOnDestroy(){let t=this._hosts.keys();for(let a of t)this.destroyRipple(a);this._eventCleanups.forEach(a=>a())}configureRipple(t,a){t.setAttribute(Kt,this._globalRippleOptions?.namespace??""),(a.className||!t.hasAttribute(Vt))&&t.setAttribute(Vt,a.className||""),a.centered&&t.setAttribute(Xe,""),a.disabled&&t.setAttribute(ht,"")}setDisabled(t,a){let n=this._hosts.get(t);n?(n.target.rippleDisabled=a,!a&&!n.hasSetUpEvents&&(n.hasSetUpEvents=!0,n.renderer.setupTriggerEvents(t))):a?t.setAttribute(ht,""):t.removeAttribute(ht)}_onInteraction=t=>{let a=x(t);if(a instanceof HTMLElement){let n=a.closest(`[${Kt}="${this._globalRippleOptions?.namespace??""}"]`);n&&this._createRipple(n)}};_createRipple(t){if(!this._document||this._hosts.has(t))return;t.querySelector(".mat-ripple")?.remove();let a=this._document.createElement("span");a.classList.add("mat-ripple",t.getAttribute(Vt)),t.append(a);let n=this._globalRippleOptions,i=this._animationsDisabled?0:n?.animation?.enterDuration??X.enterDuration,s=this._animationsDisabled?0:n?.animation?.exitDuration??X.exitDuration,d={rippleDisabled:this._animationsDisabled||n?.disabled||t.hasAttribute(ht),rippleConfig:{centered:t.hasAttribute(Xe),terminateOnPointerUp:n?.terminateOnPointerUp,animation:{enterDuration:i,exitDuration:s}}},g=new q(d,this._ngZone,a,this._platform,this._injector),w=!d.rippleDisabled;w&&g.setupTriggerEvents(t),this._hosts.set(t,{target:d,renderer:g,hasSetUpEvents:w}),t.removeAttribute(Kt)}destroyRipple(t){let a=this._hosts.get(t);a&&(a.renderer._removeTriggerEvents(),this._hosts.delete(t))}static \u0275fac=function(a){return new(a||e)};static \u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var Je=(()=>{class e{static \u0275fac=function(a){return new(a||e)};static \u0275cmp=y({type:e,selectors:[["structural-styles"]],decls:0,vars:0,template:function(a,n){},styles:[`.mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus-visible::before{content:""}@media(forced-colors: active){html{--mat-focus-indicator-display: block}}
4
4
  `],encapsulation:2,changeDetection:0})}return e})();var Ba=["mat-icon-button",""],ja=["*"],Ua=new m("MAT_BUTTON_CONFIG");function ta(e){return e==null?void 0:ve(e)}var vt=(()=>{class e{_elementRef=r(D);_ngZone=r(b);_animationsDisabled=z();_config=r(Ua,{optional:!0});_focusMonitor=r(Ot);_cleanupClick;_renderer=r(pe);_rippleLoader=r(qe);_isAnchor;_isFab=!1;color;get disableRipple(){return this._disableRipple}set disableRipple(t){this._disableRipple=t,this._updateRippleDisabled()}_disableRipple=!1;get disabled(){return this._disabled}set disabled(t){this._disabled=t,this._updateRippleDisabled()}_disabled=!1;ariaDisabled;disabledInteractive;tabIndex;set _tabindex(t){this.tabIndex=t}constructor(){r(M).load(Je);let t=this._elementRef.nativeElement;this._isAnchor=t.tagName==="A",this.disabledInteractive=this._config?.disabledInteractive??!1,this.color=this._config?.color??null,this._rippleLoader?.configureRipple(t,{className:"mat-mdc-button-ripple"})}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0),this._isAnchor&&this._setupAsAnchor()}ngOnDestroy(){this._cleanupClick?.(),this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement)}focus(t="program",a){t?this._focusMonitor.focusVia(this._elementRef.nativeElement,t,a):this._elementRef.nativeElement.focus(a)}_getAriaDisabled(){return this.ariaDisabled!=null?this.ariaDisabled:this._isAnchor?this.disabled||null:this.disabled&&this.disabledInteractive?!0:null}_getDisabledAttribute(){return this.disabledInteractive||!this.disabled?null:!0}_updateRippleDisabled(){this._rippleLoader?.setDisabled(this._elementRef.nativeElement,this.disableRipple||this.disabled)}_getTabIndex(){return this._isAnchor?this.disabled&&!this.disabledInteractive?-1:this.tabIndex:this.tabIndex}_setupAsAnchor(){this._cleanupClick=this._ngZone.runOutsideAngular(()=>this._renderer.listen(this._elementRef.nativeElement,"click",t=>{this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}))}static \u0275fac=function(a){return new(a||e)};static \u0275dir=k({type:e,hostAttrs:[1,"mat-mdc-button-base"],hostVars:13,hostBindings:function(a,n){a&2&&(wt("disabled",n._getDisabledAttribute())("aria-disabled",n._getAriaDisabled())("tabindex",n._getTabIndex()),he(n.color?"mat-"+n.color:""),O("mat-mdc-button-disabled",n.disabled)("mat-mdc-button-disabled-interactive",n.disabledInteractive)("mat-unthemed",!n.color)("_mat-animation-noopable",n._animationsDisabled))},inputs:{color:"color",disableRipple:[2,"disableRipple","disableRipple",N],disabled:[2,"disabled","disabled",N],ariaDisabled:[2,"aria-disabled","ariaDisabled",N],disabledInteractive:[2,"disabledInteractive","disabledInteractive",N],tabIndex:[2,"tabIndex","tabIndex",ta],_tabindex:[2,"tabindex","_tabindex",ta]}})}return e})(),za=(()=>{class e extends vt{constructor(){super(),this._rippleLoader.configureRipple(this._elementRef.nativeElement,{centered:!0})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=y({type:e,selectors:[["button","mat-icon-button",""],["a","mat-icon-button",""],["button","matIconButton",""],["a","matIconButton",""]],hostAttrs:[1,"mdc-icon-button","mat-mdc-icon-button"],exportAs:["matButton","matAnchor"],features:[V],attrs:Ba,ngContentSelectors:ja,decls:4,vars:0,consts:[[1,"mat-mdc-button-persistent-ripple","mdc-icon-button__ripple"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(a,n){a&1&&(W(),C(0,"span",0),T(1),C(2,"span",1)(3,"span",2))},styles:[`.mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%));flex-shrink:0;text-align:center;width:var(--mat-icon-button-state-layer-size, 40px);height:var(--mat-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mat-icon-button-state-layer-size, 40px) - var(--mat-icon-button-icon-size, 24px)) / 2);font-size:var(--mat-icon-button-icon-size, 24px);color:var(--mat-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-icon-button:focus-visible>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-icon-button-touch-target-size, 48px);display:var(--mat-icon-button-touch-target-display, block);left:50%;width:var(--mat-icon-button-touch-target-size, 48px);transform:translate(-50%, -50%)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mat-icon-button-icon-size, 24px);height:var(--mat-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:var(--mat-icon-button-container-shape, var(--mat-sys-corner-full, 50%))}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}
@@ -1 +1 @@
1
- import{a as re,b as ne,c as V}from"./chunk-IJ2YZMNS.js";import{a as ie,b as oe}from"./chunk-SDNXWYG5.js";import{a as C}from"./chunk-GVX63TKQ.js";import{a as Q,b as X}from"./chunk-WQUBEVZN.js";import{a as G,b as B,e as Z,p as ee,u as te}from"./chunk-YCJZTFYJ.js";import{d as K}from"./chunk-QWMDAFBN.js";import"./chunk-7T6Q4MDL.js";import"./chunk-ZAM3WGZM.js";import"./chunk-AK6F2DC7.js";import{a as _,b as f}from"./chunk-AJOXSD6I.js";import"./chunk-DRBOHCTP.js";import"./chunk-IXD43YQI.js";import{a as H,b as W}from"./chunk-WPC6XC7P.js";import"./chunk-XJUBZLY2.js";import{a as Y,b as M}from"./chunk-XIQ3L6H6.js";import{Q as U,S as J}from"./chunk-B2QA6UZX.js";import{Bb as S,Db as h,Fb as l,Ka as p,Rb as j,T as L,Tb as c,Ub as k,Vb as z,Wa as N,Z as w,ca as d,ga as u,h as A,ha as g,jb as E,kc as v,lb as b,ma as $,mb as y,pb as x,qb as T,rb as P,sb as a,t as I,ta as O,tb as s,ub as D}from"./chunk-3JGMGRXW.js";var R=class n{threadState=d(C);codayService=d(ie);threadList=f(this.threadState.threadList$,{initialValue:[]});selectedThread=f(this.threadState.selectedThread$,{initialValue:null});isThinking=f(this.codayService.isThinking$,{initialValue:!1});inviteEvent=f(this.codayService.currentInviteEvent$.pipe(I(t=>t?.invite===Z?null:t)),{initialValue:null});tasks=v(()=>{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=V[i.status]-V[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<ne?"in-progress":"paused"}static \u0275fac=function(e){return new(e||n)};static \u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"})};var F=class n{projectState=d(M);threadState=d(C);destroy$=new A;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(L(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=te(i);if(!m)return;m instanceof ee&&(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=w({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&&D(0,"mat-spinner",6)}function me(n,t){n&1&&(a(0,"mat-icon"),c(1,"add"),s())}function ue(n,t){if(n&1&&(a(0,"span",16),c(1),s()),n&2){let e=l().$implicit,r=l();p(),k(r.filterCounts()[e.key])}}function ge(n,t){if(n&1){let e=S();a(0,"button",15),h("click",function(){let o=u(e).$implicit,i=l();return g(i.setFilter(o.key))}),a(1,"mat-icon",10),c(2),s(),a(3,"span"),c(4),s(),b(5,ue,2,1,"span",16),s()}if(n&2){let e=t.$implicit,r=l();j("active",r.activeFilter()===e.key),E("aria-selected",r.activeFilter()===e.key),p(2),k(e.icon),p(2),k(e.label),p(),y(r.filterCounts()[e.key]>0?5:-1)}}function _e(n,t){n&1&&(a(0,"div",12),D(1,"mat-spinner",17),a(2,"p"),c(3,"Loading tasks\u2026"),s()())}function fe(n,t){if(n&1){let e=S();a(0,"p"),c(1,"No tasks yet. Start your first one!"),s(),a(2,"button",19),h("click",function(){u(e);let o=l(2);return g(o.createTask())}),a(3,"mat-icon"),c(4,"add"),s(),c(5," New Task "),s()}}function he(n,t){n&1&&(a(0,"p"),c(1,"No tasks in this category."),s())}function ke(n,t){if(n&1&&(a(0,"div",13)(1,"mat-icon",18),c(2,"rocket_launch"),s(),b(3,fe,6,0)(4,he,2,0,"p"),s()),n&2){let e=l();p(3),y(e.activeFilter()==="all"?3:4)}}function ve(n,t){if(n&1){let e=S();a(0,"app-task-card",25),h("stopRequested",function(o){u(e);let i=l(3);return g(i.onStopRequested(o))})("deleteRequested",function(o){u(e);let i=l(3);return g(i.onDeleteRequested(o))})("starToggled",function(o){u(e);let i=l(3);return g(i.onStarToggled(o))})("markDoneRequested",function(o){u(e);let i=l(3);return g(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){u(e);let i=l(3);return g(i.onMarkActiveRequested(o))}),s()}if(n&2){let e=t.$implicit;P("task",e)}}function Ce(n,t){if(n&1&&(a(0,"section",20)(1,"h2",21)(2,"mat-icon",22),c(3),s(),c(4),a(5,"span",23),c(6),s()(),a(7,"div",14),x(8,ve,1,1,"app-task-card",24,le),s()()),n&2){let e=t.$implicit;p(3),k(e.icon),p(),z(" ",e.label," "),p(2),k(e.tasks.length),p(2),T(e.tasks)}}function be(n,t){if(n&1&&x(0,Ce,10,3,"section",20,de),n&2){let e=l();T(e.taskGroups())}}function ye(n,t){if(n&1){let e=S();a(0,"app-task-card",25),h("stopRequested",function(o){u(e);let i=l(2);return g(i.onStopRequested(o))})("deleteRequested",function(o){u(e);let i=l(2);return g(i.onDeleteRequested(o))})("starToggled",function(o){u(e);let i=l(2);return g(i.onStarToggled(o))})("markDoneRequested",function(o){u(e);let i=l(2);return g(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){u(e);let i=l(2);return g(i.onMarkActiveRequested(o))}),s()}if(n&2){let e=t.$implicit;P("task",e)}}function xe(n,t){if(n&1&&(a(0,"div",14),x(1,ye,1,1,"app-task-card",24,le),s()),n&2){let e=l();p(),T(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=d(K);projectState=d(M);threadState=d(C);threadApi=d(G);taskStatus=d(R);userService=d(B);projectApi=d(Y);destroyRef=d($);_projectEventStream=d(F);filters=Te;activeFilter=O("all");starredOnly=O(!1);isCreating=O(!1);isLoadingList=f(this.threadState.isLoadingThreadList$,{initialValue:!1});username=f(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=v(()=>{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=v(()=>{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=v(()=>{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(_(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(!0),this.threadApi.createThread().pipe(_(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(!1),this.router.navigate(["project",t,"thread",e.thread.id])},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(!1)}}))}onStopRequested(t){this.threadApi.stopThread(t).pipe(_(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)})}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(_(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(_(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(_(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(_(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=N({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&&(a(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),c(6,"rocket_launch"),s(),c(7," Task Control "),s(),a(8,"button",5),h("click",function(){return r.createTask()}),b(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),c(11," New Task "),s()(),a(12,"nav",7),x(13,ge,6,6,"button",8,ce),a(15,"button",9),h("click",function(){return r.toggleStarredFilter()}),a(16,"mat-icon",10),c(17,"star"),s(),a(18,"span"),c(19,"Starred"),s()()()(),a(20,"main",11),b(21,_e,4,0,"div",12)(22,ke,5,1,"div",13)(23,be,2,0)(24,xe,3,0,"div",14),s()()()),e&2&&(p(8),P("disabled",r.isCreating()),p(),y(r.isCreating()?9:10),p(4),T(r.filters),p(2),j("active",r.starredOnly()),E("aria-checked",r.starredOnly()),p(6),y(r.isLoadingList()?21:r.filteredTasks().length===0?22:r.activeFilter()==="all"?23:24))},dependencies:[re,oe,W,H,J,U,X,Q],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}"],changeDetection:0})};export{se as TaskControlComponent};
1
+ import{a as re,b as ne,c as V}from"./chunk-OHLGZXEO.js";import{a as ie,b as oe}from"./chunk-T2JHUF63.js";import{a as C}from"./chunk-2YPR6RKN.js";import{a as Q,b as X}from"./chunk-SI36SMXC.js";import{a as G,b as B,e as Z,p as ee,u as te}from"./chunk-FJR6WCPX.js";import{d as K}from"./chunk-LTFITYTW.js";import"./chunk-DPFJ6LFY.js";import"./chunk-3DDLKUVJ.js";import"./chunk-6JH2UGTU.js";import{a as _,b as f}from"./chunk-LCBWJP6Z.js";import"./chunk-HY7OYHZF.js";import"./chunk-UQNMPA5Y.js";import{a as H,b as W}from"./chunk-QFSZDRP2.js";import"./chunk-DLU3TQID.js";import{a as Y,b as M}from"./chunk-G4QDBE4F.js";import{Q as U,S as J}from"./chunk-SDLTQWY6.js";import{Bb as S,Db as h,Fb as l,Ka as p,Rb as j,T as L,Tb as c,Ub as k,Vb as z,Wa as N,Z as w,ca as d,ga as u,h as A,ha as g,jb as E,kc as v,lb as b,ma as $,mb as y,pb as x,qb as T,rb as P,sb as a,t as I,ta as O,tb as s,ub as D}from"./chunk-RNXBUYHW.js";var R=class n{threadState=d(C);codayService=d(ie);threadList=f(this.threadState.threadList$,{initialValue:[]});selectedThread=f(this.threadState.selectedThread$,{initialValue:null});isThinking=f(this.codayService.isThinking$,{initialValue:!1});inviteEvent=f(this.codayService.currentInviteEvent$.pipe(I(t=>t?.invite===Z?null:t)),{initialValue:null});tasks=v(()=>{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=V[i.status]-V[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<ne?"in-progress":"paused"}static \u0275fac=function(e){return new(e||n)};static \u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"})};var F=class n{projectState=d(M);threadState=d(C);destroy$=new A;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(L(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=te(i);if(!m)return;m instanceof ee&&(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=w({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&&D(0,"mat-spinner",6)}function me(n,t){n&1&&(a(0,"mat-icon"),c(1,"add"),s())}function ue(n,t){if(n&1&&(a(0,"span",16),c(1),s()),n&2){let e=l().$implicit,r=l();p(),k(r.filterCounts()[e.key])}}function ge(n,t){if(n&1){let e=S();a(0,"button",15),h("click",function(){let o=u(e).$implicit,i=l();return g(i.setFilter(o.key))}),a(1,"mat-icon",10),c(2),s(),a(3,"span"),c(4),s(),b(5,ue,2,1,"span",16),s()}if(n&2){let e=t.$implicit,r=l();j("active",r.activeFilter()===e.key),E("aria-selected",r.activeFilter()===e.key),p(2),k(e.icon),p(2),k(e.label),p(),y(r.filterCounts()[e.key]>0?5:-1)}}function _e(n,t){n&1&&(a(0,"div",12),D(1,"mat-spinner",17),a(2,"p"),c(3,"Loading tasks\u2026"),s()())}function fe(n,t){if(n&1){let e=S();a(0,"p"),c(1,"No tasks yet. Start your first one!"),s(),a(2,"button",19),h("click",function(){u(e);let o=l(2);return g(o.createTask())}),a(3,"mat-icon"),c(4,"add"),s(),c(5," New Task "),s()}}function he(n,t){n&1&&(a(0,"p"),c(1,"No tasks in this category."),s())}function ke(n,t){if(n&1&&(a(0,"div",13)(1,"mat-icon",18),c(2,"rocket_launch"),s(),b(3,fe,6,0)(4,he,2,0,"p"),s()),n&2){let e=l();p(3),y(e.activeFilter()==="all"?3:4)}}function ve(n,t){if(n&1){let e=S();a(0,"app-task-card",25),h("stopRequested",function(o){u(e);let i=l(3);return g(i.onStopRequested(o))})("deleteRequested",function(o){u(e);let i=l(3);return g(i.onDeleteRequested(o))})("starToggled",function(o){u(e);let i=l(3);return g(i.onStarToggled(o))})("markDoneRequested",function(o){u(e);let i=l(3);return g(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){u(e);let i=l(3);return g(i.onMarkActiveRequested(o))}),s()}if(n&2){let e=t.$implicit;P("task",e)}}function Ce(n,t){if(n&1&&(a(0,"section",20)(1,"h2",21)(2,"mat-icon",22),c(3),s(),c(4),a(5,"span",23),c(6),s()(),a(7,"div",14),x(8,ve,1,1,"app-task-card",24,le),s()()),n&2){let e=t.$implicit;p(3),k(e.icon),p(),z(" ",e.label," "),p(2),k(e.tasks.length),p(2),T(e.tasks)}}function be(n,t){if(n&1&&x(0,Ce,10,3,"section",20,de),n&2){let e=l();T(e.taskGroups())}}function ye(n,t){if(n&1){let e=S();a(0,"app-task-card",25),h("stopRequested",function(o){u(e);let i=l(2);return g(i.onStopRequested(o))})("deleteRequested",function(o){u(e);let i=l(2);return g(i.onDeleteRequested(o))})("starToggled",function(o){u(e);let i=l(2);return g(i.onStarToggled(o))})("markDoneRequested",function(o){u(e);let i=l(2);return g(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){u(e);let i=l(2);return g(i.onMarkActiveRequested(o))}),s()}if(n&2){let e=t.$implicit;P("task",e)}}function xe(n,t){if(n&1&&(a(0,"div",14),x(1,ye,1,1,"app-task-card",24,le),s()),n&2){let e=l();p(),T(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=d(K);projectState=d(M);threadState=d(C);threadApi=d(G);taskStatus=d(R);userService=d(B);projectApi=d(Y);destroyRef=d($);_projectEventStream=d(F);filters=Te;activeFilter=O("all");starredOnly=O(!1);isCreating=O(!1);isLoadingList=f(this.threadState.isLoadingThreadList$,{initialValue:!1});username=f(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=v(()=>{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=v(()=>{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=v(()=>{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(_(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(!0),this.threadApi.createThread().pipe(_(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(!1),this.router.navigate(["project",t,"thread",e.thread.id])},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(!1)}}))}onStopRequested(t){this.threadApi.stopThread(t).pipe(_(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)})}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(_(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(_(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(_(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(_(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=N({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&&(a(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),c(6,"rocket_launch"),s(),c(7," Task Control "),s(),a(8,"button",5),h("click",function(){return r.createTask()}),b(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),c(11," New Task "),s()(),a(12,"nav",7),x(13,ge,6,6,"button",8,ce),a(15,"button",9),h("click",function(){return r.toggleStarredFilter()}),a(16,"mat-icon",10),c(17,"star"),s(),a(18,"span"),c(19,"Starred"),s()()()(),a(20,"main",11),b(21,_e,4,0,"div",12)(22,ke,5,1,"div",13)(23,be,2,0)(24,xe,3,0,"div",14),s()()()),e&2&&(p(8),P("disabled",r.isCreating()),p(),y(r.isCreating()?9:10),p(4),T(r.filters),p(2),j("active",r.starredOnly()),E("aria-checked",r.starredOnly()),p(6),y(r.isLoadingList()?21:r.filteredTasks().length===0?22:r.activeFilter()==="all"?23:24))},dependencies:[re,oe,W,H,J,U,X,Q],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}"],changeDetection:0})};export{se as TaskControlComponent};
@@ -1,4 +1,4 @@
1
- import{v as D,w as ye}from"./chunk-YCJZTFYJ.js";import{a as Me}from"./chunk-7T6Q4MDL.js";import{a as de,b as pe,e as ge,f as me,g as he}from"./chunk-DRBOHCTP.js";import{a as R}from"./chunk-WPC6XC7P.js";import{C as B,c as L,g as A,m as F,p as _e,q as ve,v as be,w as Ce,x as Se}from"./chunk-XJUBZLY2.js";import{E as W,H,J as le,O as ue,Q as fe}from"./chunk-B2QA6UZX.js";import{Ab as V,Db as d,Fb as x,Fc as se,Jb as ee,Jc as ce,Ka as l,Kb as te,Lb as ne,Pb as ie,Qb as k,Rb as I,Sb as oe,T as h,Tb as s,Vb as S,Wa as v,Wb as re,Xa as T,Xb as p,Yb as g,Z as K,Zb as m,_ as P,aa as Q,ab as X,ca as _,d as C,h as O,hc as ae,i as q,ia as $,ja as Y,jb as b,lb as y,mb as M,pb as U,qb as J,rb as u,sb as a,tb as r,ub as f,uc as N,ya as Z}from"./chunk-3JGMGRXW.js";var Pe=["determinateSpinner"];function Te(c,t){if(c&1&&($(),a(0,"svg",11),f(1,"circle",12),r()),c&2){let o=x();b("viewBox",o._viewBox()),l(),k("stroke-dasharray",o._strokeCircumference(),"px")("stroke-dashoffset",o._strokeCircumference()/2,"px")("stroke-width",o._circleStrokeWidth(),"%"),b("r",o._circleRadius())}}var Ve=new Q("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:Ee})}),Ee=100,xe=10,Ze=(()=>{class c{_elementRef=_(Z);_noopAnimations;get color(){return this._color||this._defaultColor}set color(o){this._color=o}_color;_defaultColor="primary";_determinateCircle;constructor(){let o=_(Ve),e=le(),n=this._elementRef.nativeElement;this._noopAnimations=e==="di-disabled"&&!!o&&!o._forceAnimations,this.mode=n.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&e==="reduced-motion"&&n.classList.add("mat-progress-spinner-reduced-motion"),o&&(o.color&&(this.color=this._defaultColor=o.color),o.diameter&&(this.diameter=o.diameter),o.strokeWidth&&(this.strokeWidth=o.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(o){this._value=Math.max(0,Math.min(100,o||0))}_value=0;get diameter(){return this._diameter}set diameter(o){this._diameter=o||0}_diameter=Ee;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(o){this._strokeWidth=o||0}_strokeWidth;_circleRadius(){return(this.diameter-xe)/2}_viewBox(){let o=this._circleRadius()*2+this.strokeWidth;return`0 0 ${o} ${o}`}_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(e){return new(e||c)};static \u0275cmp=v({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(e,n){if(e&1&&ee(Pe,5),e&2){let i;te(i=ne())&&(n._determinateCircle=i.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(e,n){e&2&&(b("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",n.mode==="determinate"?n.value:null)("mode",n.mode),oe("mat-"+n.color),k("width",n.diameter,"px")("height",n.diameter,"px")("--mat-progress-spinner-size",n.diameter+"px")("--mat-progress-spinner-active-indicator-width",n.diameter+"px"),I("_mat-animation-noopable",n._noopAnimations)("mdc-circular-progress--indeterminate",n.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",N],diameter:[2,"diameter","diameter",N],strokeWidth:[2,"strokeWidth","strokeWidth",N]},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(e,n){if(e&1&&(X(0,Te,2,8,"ng-template",null,0,ae),a(2,"div",2,1),$(),a(4,"svg",3),f(5,"circle",4),r()(),Y(),a(6,"div",5)(7,"div",6)(8,"div",7),V(9,8),r(),a(10,"div",9),V(11,8),r(),a(12,"div",10),V(13,8),r()()()),e&2){let i=ie(1);l(4),b("viewBox",n._viewBox()),l(),k("stroke-dasharray",n._strokeCircumference(),"px")("stroke-dashoffset",n._strokeDashOffset(),"px")("stroke-width",n._circleStrokeWidth(),"%"),b("r",n._circleRadius()),l(4),u("ngTemplateOutlet",i),l(2),u("ngTemplateOutlet",i),l(2),u("ngTemplateOutlet",i)}},dependencies:[se],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
1
+ import{v as D,w as ye}from"./chunk-FJR6WCPX.js";import{a as Me}from"./chunk-DPFJ6LFY.js";import{a as de,b as pe,e as ge,f as me,g as he}from"./chunk-HY7OYHZF.js";import{a as R}from"./chunk-QFSZDRP2.js";import{C as B,c as L,g as A,m as F,p as _e,q as ve,v as be,w as Ce,x as Se}from"./chunk-DLU3TQID.js";import{E as W,H,J as le,O as ue,Q as fe}from"./chunk-SDLTQWY6.js";import{Ab as V,Db as d,Fb as x,Fc as se,Jb as ee,Jc as ce,Ka as l,Kb as te,Lb as ne,Pb as ie,Qb as k,Rb as I,Sb as oe,T as h,Tb as s,Vb as S,Wa as v,Wb as re,Xa as T,Xb as p,Yb as g,Z as K,Zb as m,_ as P,aa as Q,ab as X,ca as _,d as C,h as O,hc as ae,i as q,ia as $,ja as Y,jb as b,lb as y,mb as M,pb as U,qb as J,rb as u,sb as a,tb as r,ub as f,uc as N,ya as Z}from"./chunk-RNXBUYHW.js";var Pe=["determinateSpinner"];function Te(c,t){if(c&1&&($(),a(0,"svg",11),f(1,"circle",12),r()),c&2){let o=x();b("viewBox",o._viewBox()),l(),k("stroke-dasharray",o._strokeCircumference(),"px")("stroke-dashoffset",o._strokeCircumference()/2,"px")("stroke-width",o._circleStrokeWidth(),"%"),b("r",o._circleRadius())}}var Ve=new Q("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:Ee})}),Ee=100,xe=10,Ze=(()=>{class c{_elementRef=_(Z);_noopAnimations;get color(){return this._color||this._defaultColor}set color(o){this._color=o}_color;_defaultColor="primary";_determinateCircle;constructor(){let o=_(Ve),e=le(),n=this._elementRef.nativeElement;this._noopAnimations=e==="di-disabled"&&!!o&&!o._forceAnimations,this.mode=n.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&e==="reduced-motion"&&n.classList.add("mat-progress-spinner-reduced-motion"),o&&(o.color&&(this.color=this._defaultColor=o.color),o.diameter&&(this.diameter=o.diameter),o.strokeWidth&&(this.strokeWidth=o.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(o){this._value=Math.max(0,Math.min(100,o||0))}_value=0;get diameter(){return this._diameter}set diameter(o){this._diameter=o||0}_diameter=Ee;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(o){this._strokeWidth=o||0}_strokeWidth;_circleRadius(){return(this.diameter-xe)/2}_viewBox(){let o=this._circleRadius()*2+this.strokeWidth;return`0 0 ${o} ${o}`}_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(e){return new(e||c)};static \u0275cmp=v({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(e,n){if(e&1&&ee(Pe,5),e&2){let i;te(i=ne())&&(n._determinateCircle=i.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(e,n){e&2&&(b("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",n.mode==="determinate"?n.value:null)("mode",n.mode),oe("mat-"+n.color),k("width",n.diameter,"px")("height",n.diameter,"px")("--mat-progress-spinner-size",n.diameter+"px")("--mat-progress-spinner-active-indicator-width",n.diameter+"px"),I("_mat-animation-noopable",n._noopAnimations)("mdc-circular-progress--indeterminate",n.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",N],diameter:[2,"diameter","diameter",N],strokeWidth:[2,"strokeWidth","strokeWidth",N]},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(e,n){if(e&1&&(X(0,Te,2,8,"ng-template",null,0,ae),a(2,"div",2,1),$(),a(4,"svg",3),f(5,"circle",4),r()(),Y(),a(6,"div",5)(7,"div",6)(8,"div",7),V(9,8),r(),a(10,"div",9),V(11,8),r(),a(12,"div",10),V(13,8),r()()()),e&2){let i=ie(1);l(4),b("viewBox",n._viewBox()),l(),k("stroke-dasharray",n._strokeCircumference(),"px")("stroke-dashoffset",n._strokeDashOffset(),"px")("stroke-width",n._circleStrokeWidth(),"%"),b("r",n._circleRadius()),l(4),u("ngTemplateOutlet",i),l(2),u("ngTemplateOutlet",i),l(2),u("ngTemplateOutlet",i)}},dependencies:[se],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
2
2
  `],encapsulation:2,changeDetection:0})}return c})();var Xe=(()=>{class c{static \u0275fac=function(e){return new(e||c)};static \u0275mod=T({type:c});static \u0275inj=P({imports:[W]})}return c})();var it=(()=>{class c{get vertical(){return this._vertical}set vertical(o){this._vertical=H(o)}_vertical=!1;get inset(){return this._inset}set inset(o){this._inset=H(o)}_inset=!1;static \u0275fac=function(e){return new(e||c)};static \u0275cmp=v({type:c,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(e,n){e&2&&(b("aria-orientation",n.vertical?"vertical":"horizontal"),I("mat-divider-vertical",n.vertical)("mat-divider-horizontal",!n.vertical)("mat-divider-inset",n.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(e,n){},styles:[`.mat-divider{display:block;margin:0;border-top-style:solid;border-top-color:var(--mat-divider-color, var(--mat-sys-outline-variant));border-top-width:var(--mat-divider-width, 1px)}.mat-divider.mat-divider-vertical{border-top:0;border-right-style:solid;border-right-color:var(--mat-divider-color, var(--mat-sys-outline-variant));border-right-width:var(--mat-divider-width, 1px)}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}
3
3
  `],encapsulation:2,changeDetection:0})}return c})(),ot=(()=>{class c{static \u0275fac=function(e){return new(e||c)};static \u0275mod=T({type:c});static \u0275inj=P({imports:[W]})}return c})();var z=class c{destroy$=new O;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new q(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=_(D);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech()}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(t=>t([]));return}this.voices=new Promise((t,o)=>{let e=speechSynthesis.getVoices();if(e.length)t(e);else{let n=setTimeout(()=>{o("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let i=speechSynthesis.getVoices();i.length&&(clearTimeout(n),t(i))})}}),console.log("[VOICE-SERVICE] Speech synthesis initialized")}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(h(this.destroy$)).subscribe(t=>{this.volume=t,console.log("[VOICE-SERVICE] Volume updated to:",t)}),this.preferencesService.voiceRate$.pipe(h(this.destroy$)).subscribe(t=>{this.rate=t,console.log("[VOICE-SERVICE] Rate updated to:",t)}),this.preferencesService.voiceLanguage$.pipe(h(this.destroy$)).subscribe(t=>{this.language=t,console.log("[VOICE-SERVICE] Language updated to:",t),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(h(this.destroy$)).subscribe(t=>{this.setSelectedVoice(t)}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice())}isReady(){return"speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(t,o){return C(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),!1;if(!t.trim())return console.warn("[VOICE-SERVICE] No text to speak"),!1;let e=this.extractPlainText(t);if(!e.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let n=new SpeechSynthesisUtterance(e);n.voice=this.selectedVoice,n.lang=this.selectedVoice.lang,n.volume=this.volume,n.rate=this.rate,this.currentOnEndCallback=o||null,o&&(n.onend=()=>{this.currentOnEndCallback===o&&(this.currentOnEndCallback=null,o())},n.onerror=()=>{this.currentOnEndCallback===o&&(this.currentOnEndCallback=null,o())}),this.currentUtterance=n,this.speakingSubject.next(!0);let i=n.onend,w=n.onerror;return n.onend=E=>{this.speakingSubject.next(!1),i&&i.call(n,E)},n.onerror=E=>{this.speakingSubject.next(!1),w&&w.call(n,E)},speechSynthesis.speak(n),console.log("[VOICE-SERVICE] Started speaking:",t.substring(0,50)+"..."),!0}catch(n){return console.error("[VOICE-SERVICE] Error speaking:",n),!1}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let t=this.currentOnEndCallback;this.currentOnEndCallback=null,t()}this.speakingSubject.next(!1),console.log("[VOICE-SERVICE] Speech stopped")}}ding(){try{let t=new(window.AudioContext||window.webkitAudioContext),o=t.createOscillator(),e=t.createGain();o.connect(e),e.connect(t.destination),o.frequency.setValueAtTime(800,t.currentTime),e.gain.setValueAtTime(.1,t.currentTime),e.gain.exponentialRampToValueAtTime(.01,t.currentTime+.1),o.start(t.currentTime),o.stop(t.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played")}catch(t){console.error("[VOICE-SERVICE] Notification sound failed:",t)}}getVoicesForLanguage(){return C(this,null,function*(){try{let t=this.language.slice(0,2),o=yield this.voices;if(!o||o.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let e=o.filter(n=>n.lang.toLowerCase().startsWith(t)).sort((n,i)=>n.localService&&!i.localService?-1:!n.localService&&i.localService?1:n.name.localeCompare(i.name));return console.log("[VOICE-SERVICE] Found matching voices:",e.length,"for language:",t),e.map(n=>({name:n.name,lang:n.lang,localService:n.localService,default:n.default,displayName:this.formatVoiceDisplayName(n)}))}catch(t){return console.error("[VOICE-SERVICE] Error getting voices for language:",t),[]}})}formatVoiceDisplayName(t){let o=t.localService?"\u{1F3E0}":"\u2601\uFE0F",e=t.default?" \u2B50":"";return`${o} ${t.name} (${t.lang})${e}`}setSelectedVoice(t){return C(this,null,function*(){if(!t){this.selectedVoice=void 0;return}let[o,e]=t.split("|");if(!o||!e){this.selectedVoice=void 0;return}let n=(yield this.voices)?.find(i=>i.name===o&&i.lang===e);n?(this.selectedVoice=n,console.log("[VOICE-SERVICE] Selected voice:",n.name,n.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",o,e))})}updateSelectedVoiceForLanguage(){return C(this,null,function*(){let t=yield this.getVoicesForLanguage();if(t.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let o=this.preferencesService.getSelectedVoice();if(o){let[n,i]=o.split("|"),w=i?.slice(0,2),E=this.language.slice(0,2);if(w===E&&t.some(G=>G.name===n&&G.lang===i)){console.log("[VOICE-SERVICE] Keeping current voice for language:",o);return}}let e=t[0];if(e){let n=`${e.name}|${e.lang}`;this.preferencesService.setSelectedVoice(n),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",e.displayName)}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let t=this.getTestText();t&&this.speak(t)},100)}getTestText(){let t=this.language.slice(0,2),o={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 o[t]||o.en||"Hello, this is a test."}extractPlainText(t){let o=t.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/&nbsp;/g," ").replace(/&amp;/g,"and").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');return o=this.addNaturalPunctuation(o),o.replace(/\s+/g," ").trim()}addNaturalPunctuation(t){return t.replace(/\n+/g,`
4
4
  `).split(`
@@ -1 +1 @@
1
- import{b as l}from"./chunk-XIQ3L6H6.js";import{Rc as m,Z as c,ca as a,m as n,t as s}from"./chunk-3JGMGRXW.js";var d=class i{http=a(m);projectState=a(l);promptsCache=new Map;getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let r=this.promptsCache.get(t);return r?n(this.filterPromptsForAutocomplete(r,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(s(p=>(this.promptsCache.set(t,p),this.filterPromptsForAutocomplete(p,e))))}filterPromptsForAutocomplete(t,e){let r=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)).map(o=>({name:o.name,description:o.description,parameterFormat:o.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear()}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(s(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(s(r=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),r)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(s(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})};export{d as a};
1
+ import{b as l}from"./chunk-G4QDBE4F.js";import{Rc as m,Z as c,ca as a,m as n,t as s}from"./chunk-RNXBUYHW.js";var d=class i{http=a(m);projectState=a(l);promptsCache=new Map;getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let r=this.promptsCache.get(t);return r?n(this.filterPromptsForAutocomplete(r,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(s(p=>(this.promptsCache.set(t,p),this.filterPromptsForAutocomplete(p,e))))}filterPromptsForAutocomplete(t,e){let r=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)).map(o=>({name:o.name,description:o.description,parameterFormat:o.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear()}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(s(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(s(r=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),r)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(s(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})};export{d as a};
@@ -1 +1 @@
1
- import{g as D}from"./chunk-GAZJZBKP.js";import{b as E,d as w}from"./chunk-QWMDAFBN.js";import{a as v}from"./chunk-AJOXSD6I.js";import{D as G,c as F,e as C,g as V,h as I,i as z,l as _,n as L,s as R,u as B}from"./chunk-XJUBZLY2.js";import{Bb as S,Db as u,Fb as g,Ka as a,Tb as o,Ub as k,Vb as O,Wa as N,a as p,b as x,ca as c,ga as b,ha as h,lb as M,ma as y,mb as P,rb as m,sb as n,ta as d,tb as t,ub as f}from"./chunk-3JGMGRXW.js";function A(i,r){i&1&&(n(0,"p",5),o(1,"Loading\u2026"),t())}function $(i,r){if(i&1){let e=S();n(0,"form",7),u("ngSubmit",function(){b(e);let l=g();return h(l.submit())}),n(1,"div",8)(2,"label",9),o(3,"Name "),n(4,"span",10),o(5,"*"),t()(),f(6,"input",11),t(),n(7,"div",8)(8,"label",12),o(9,"Description"),t(),f(10,"input",13),t(),n(11,"div",8)(12,"label",14),o(13,"Config path"),t(),f(14,"input",15),t(),n(15,"div",16)(16,"button",17),o(17),t(),n(18,"button",18),u("click",function(){b(e);let l=g();return h(l.cancel())}),o(19,"Cancel"),t()()()}if(i&2){let e=g();m("formGroup",e.form),a(6),m("formControl",e.nameControl),a(4),m("formControl",e.descriptionControl),a(4),m("formControl",e.configPathControl),a(2),m("disabled",e.nameControl.invalid||e.isSubmitting()),a(),O(" ",e.isEditMode()?"Save changes":"Create"," ")}}var T=class i{route=c(E);router=c(w);namespaceController=c(D);destroyRef=c(y);form=new z({name:new _("",{nonNullable:!0,validators:[C.required,C.minLength(1)]}),description:new _("",{nonNullable:!0}),configPath:new _("",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);existingNamespace=null;ngOnInit(){let r=this.route.snapshot.paramMap.get("namespaceId");r&&(this.isEditMode.set(!0),this.loadNamespace(r))}loadNamespace(r){this.isLoading.set(!0),this.namespaceController.getByIdNamespace(r).pipe(v(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.nameControl.invalid||this.isSubmitting())return;this.isSubmitting.set(!0),(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",x(p({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0})):this.namespaceController.createNamespace(p(p({name:this.nameControl.value.trim()},this.descriptionControl.value.trim()?{description:this.descriptionControl.value.trim()}:{}),this.configPathControl.value.trim()?{configPath:this.configPathControl.value.trim()}:{}))).pipe(v(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos/namespaces"])}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=N({type:i,selectors:[["agentos-namespace-form"]],decls:10,vars:2,consts:[[1,"namespace-form"],[1,"namespace-form__header"],["type","button","title","Back to namespaces",1,"namespace-form__back",3,"click"],[1,"namespace-form__back-icon"],[1,"namespace-form__title"],[1,"namespace-form__loading"],[1,"namespace-form__form",3,"formGroup"],[1,"namespace-form__form",3,"ngSubmit","formGroup"],[1,"namespace-form__field"],["for","ns-name",1,"namespace-form__label"],["aria-hidden","true"],["id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-description",1,"namespace-form__label"],["id","ns-description","type","text","placeholder","Optional description","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-config-path",1,"namespace-form__label"],["id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",1,"namespace-form__input",3,"formControl"],[1,"namespace-form__actions"],["type","submit",1,"namespace-form__btn","namespace-form__btn--primary",3,"disabled"],["type","button",1,"namespace-form__btn",3,"click"]],template:function(e,s){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),u("click",function(){return s.cancel()}),n(3,"span",3),o(4,"\u2190"),t(),o(5," Namespaces "),t(),n(6,"h1",4),o(7),t()(),M(8,A,2,0,"p",5)(9,$,20,6,"form",6),t()),e&2&&(a(7),k(s.isEditMode()?"Edit namespace":"New namespace"),a(),P(s.isLoading()?8:9))},dependencies:[G,L,F,V,I,R,B],styles:[".namespace-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.namespace-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.namespace-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.namespace-form__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.namespace-form__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.namespace-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.namespace-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.namespace-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.namespace-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{T as NamespaceFormComponent};
1
+ import{h as D}from"./chunk-R5RVDZLX.js";import{b as E,d as w}from"./chunk-LTFITYTW.js";import{a as v}from"./chunk-LCBWJP6Z.js";import{D as G,c as F,e as C,g as V,h as I,i as z,l as _,n as L,s as R,u as B}from"./chunk-DLU3TQID.js";import{Bb as S,Db as u,Fb as g,Ka as a,Tb as o,Ub as k,Vb as O,Wa as N,a as p,b as x,ca as c,ga as b,ha as h,lb as M,ma as y,mb as P,rb as m,sb as n,ta as d,tb as t,ub as f}from"./chunk-RNXBUYHW.js";function A(i,r){i&1&&(n(0,"p",5),o(1,"Loading\u2026"),t())}function $(i,r){if(i&1){let e=S();n(0,"form",7),u("ngSubmit",function(){b(e);let l=g();return h(l.submit())}),n(1,"div",8)(2,"label",9),o(3,"Name "),n(4,"span",10),o(5,"*"),t()(),f(6,"input",11),t(),n(7,"div",8)(8,"label",12),o(9,"Description"),t(),f(10,"input",13),t(),n(11,"div",8)(12,"label",14),o(13,"Config path"),t(),f(14,"input",15),t(),n(15,"div",16)(16,"button",17),o(17),t(),n(18,"button",18),u("click",function(){b(e);let l=g();return h(l.cancel())}),o(19,"Cancel"),t()()()}if(i&2){let e=g();m("formGroup",e.form),a(6),m("formControl",e.nameControl),a(4),m("formControl",e.descriptionControl),a(4),m("formControl",e.configPathControl),a(2),m("disabled",e.nameControl.invalid||e.isSubmitting()),a(),O(" ",e.isEditMode()?"Save changes":"Create"," ")}}var T=class i{route=c(E);router=c(w);namespaceController=c(D);destroyRef=c(y);form=new z({name:new _("",{nonNullable:!0,validators:[C.required,C.minLength(1)]}),description:new _("",{nonNullable:!0}),configPath:new _("",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);existingNamespace=null;ngOnInit(){let r=this.route.snapshot.paramMap.get("namespaceId");r&&(this.isEditMode.set(!0),this.loadNamespace(r))}loadNamespace(r){this.isLoading.set(!0),this.namespaceController.getByIdNamespace(r).pipe(v(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.nameControl.invalid||this.isSubmitting())return;this.isSubmitting.set(!0),(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",x(p({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0})):this.namespaceController.createNamespace(p(p({name:this.nameControl.value.trim()},this.descriptionControl.value.trim()?{description:this.descriptionControl.value.trim()}:{}),this.configPathControl.value.trim()?{configPath:this.configPathControl.value.trim()}:{}))).pipe(v(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos/namespaces"])}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=N({type:i,selectors:[["agentos-namespace-form"]],decls:10,vars:2,consts:[[1,"namespace-form"],[1,"namespace-form__header"],["type","button","title","Back to namespaces",1,"namespace-form__back",3,"click"],[1,"namespace-form__back-icon"],[1,"namespace-form__title"],[1,"namespace-form__loading"],[1,"namespace-form__form",3,"formGroup"],[1,"namespace-form__form",3,"ngSubmit","formGroup"],[1,"namespace-form__field"],["for","ns-name",1,"namespace-form__label"],["aria-hidden","true"],["id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-description",1,"namespace-form__label"],["id","ns-description","type","text","placeholder","Optional description","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-config-path",1,"namespace-form__label"],["id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",1,"namespace-form__input",3,"formControl"],[1,"namespace-form__actions"],["type","submit",1,"namespace-form__btn","namespace-form__btn--primary",3,"disabled"],["type","button",1,"namespace-form__btn",3,"click"]],template:function(e,s){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),u("click",function(){return s.cancel()}),n(3,"span",3),o(4,"\u2190"),t(),o(5," Namespaces "),t(),n(6,"h1",4),o(7),t()(),M(8,A,2,0,"p",5)(9,$,20,6,"form",6),t()),e&2&&(a(7),k(s.isEditMode()?"Edit namespace":"New namespace"),a(),P(s.isLoading()?8:9))},dependencies:[G,L,F,V,I,R,B],styles:[".namespace-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.namespace-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.namespace-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.namespace-form__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.namespace-form__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.namespace-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.namespace-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.namespace-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.namespace-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{T as NamespaceFormComponent};
@@ -1,4 +1,4 @@
1
- import{a as ue,b as Tt,c as Pt}from"./chunk-GVX63TKQ.js";import{a as Ge,b as We,d as Je,f as we,g as Oe}from"./chunk-WQUBEVZN.js";import{a as He,b as _e,c as tt,d as nt,e as it,f as rt,g as ot,h as at,i as st,j as ct,k as lt,l as dt,m as mt,n as Me,o as pt,p as gt,r as ut,s as _t,t as ht,u as ft,v as vt}from"./chunk-YCJZTFYJ.js";import{d as me}from"./chunk-QWMDAFBN.js";import{c as bt}from"./chunk-7T6Q4MDL.js";import{d as Ct,e as xt,f as yt,g as St}from"./chunk-ZAM3WGZM.js";import{a as Ye,b as qe,j as Ke,n as et}from"./chunk-AK6F2DC7.js";import{a as k,b as S}from"./chunk-AJOXSD6I.js";import{d as Xe}from"./chunk-DRBOHCTP.js";import{a as U,b as Q}from"./chunk-WPC6XC7P.js";import{B as Ze,C as be,c as he,g as fe,m as ve}from"./chunk-XJUBZLY2.js";import{a as pe,b as ge}from"./chunk-XIQ3L6H6.js";import{E as Qe,O as $,S as B,n as Ue}from"./chunk-B2QA6UZX.js";import{Ab as Te,Bb as v,Db as _,Fb as c,Fc as Be,Gb as Fe,Ha as K,Hb as Le,Jb as ie,Ka as d,Kb as re,Lb as oe,Pb as Pe,Qb as V,Rb as x,T as O,Tb as l,Ub as y,V as De,Vb as Z,Wa as I,Xa as Ae,Xb as ae,Yb as se,Z as Ve,Zb as ce,_ as Ne,a as j,ab as te,b as Y,bc as Re,ca as b,cc as ze,ga as m,h as q,ha as p,hc as $e,i as M,jb as ne,kc as le,lb as g,ma as ee,mb as u,oa as W,oc as de,pb as R,qb as z,rb as C,sb as o,t as G,ta as L,tb as s,ua as J,ub as D,z as Ie}from"./chunk-3JGMGRXW.js";var Mt=class i{destroy$=new q;currentProject=null;currentThread=null;messagesSubject=new M([]);isThinkingSubject=new M(!1);currentChoiceSubject=new M(null);projectTitleSubject=new M("Coday");currentInviteEventSubject=new M(null);messageToRestoreSubject=new M("");threadUpdateEventSubject=new M(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new M("");subThreadEventsSubject=new q;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=b(Tt);messageApi=b(Pt);userService=b(_e);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=ft(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(!0),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let n=t.buildAnswer(e);this.messageApi.sendMessage(n).subscribe({error:r=>{console.error("[CODAY] Send invite answer error:",r),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(!0),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(r=>r.id===e),n=this.extractTextContentFromMessage(t);return this.messageApi.deleteMessage(e).pipe(De(r=>{r.success&&(this.removeMessagesFromIndex(e),n.trim()&&this.messageToRestoreSubject.next(n))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(O(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 t=this.subThreadEventBuffers.get(e.threadId);t?t.push(e):this.subThreadEventBuffers.set(e.threadId,[e]),this.subThreadEventsSubject.next(e);return}e instanceof pt?this.handleMessageEvent(e):e instanceof at?this.handleTextChunkEvent(e):e instanceof ot?this.handleTextEvent(e):e instanceof rt?this.handleAnswerEvent(e):e instanceof ct?this.handleErrorEvent(e):e instanceof st?this.handleWarnEvent(e):e instanceof Me?this.handleThinkingEvent(e):e instanceof dt?this.handleToolRequestEvent(e):e instanceof mt?this.handleToolResponseEvent(e):e instanceof lt?this.handleChoiceEvent(e):e instanceof tt?this.handleHeartBeatEvent(e):e instanceof nt?this.handleInviteEvent(e):e instanceof gt?this.handleThreadUpdateEvent(e):e instanceof _t?this.handleDelegationEvent(e):e instanceof ut||e instanceof ht||console.warn("[CODAY] Unhandled event type:",e.type)}handleDelegationEvent(e){if(console.log("[CODAY] DelegationEvent received:",e.subThreadId,e.agentName),this.messagesSubject.value.findIndex(r=>r.subThreadId===e.subThreadId)===-1){let r={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(r)}}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 r=!!e.parentKey&&e.parentKey===t.timestamp,a=!e.parentKey&&e.date>=t.date;(r||a)&&this.currentInviteEventSubject.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(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},Me.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};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){this.stopThinking(),this.currentChoiceEvent=e,this.tabTitleService?.setSystemInactive();let t=e.options.map(r=>({value:r,label:r})),n=e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite;this.currentChoiceSubject.next({options:t,label:n,allowFreeText:e.allowFreeText})}handleHeartBeatEvent(e){}handleInviteEvent(e){if(this.stopThinking(),e.invite===it)this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive();else{let n={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.invite}],timestamp:e.date,type:"text"};this.addMessage(n),this.messagesSubject.value.some(h=>h.parentKey===e.timestamp||h.role==="user"&&h.timestamp>e.date||h.role==="assistant"&&h.timestamp>e.date)||(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(a=>a.id===e);if(n===-1||n===0)return;let r=t.slice(0,n);this.messagesSubject.next(r),this.stopThinking()}extractTextContentFromMessage(e){return e?e.content.filter(t=>t.type==="text").map(t=>t.content).join(`
1
+ import{a as ue,b as Tt,c as Pt}from"./chunk-2YPR6RKN.js";import{a as Ge,b as We,d as Je,f as we,g as Oe}from"./chunk-SI36SMXC.js";import{a as He,b as _e,c as tt,d as nt,e as it,f as rt,g as ot,h as at,i as st,j as ct,k as lt,l as dt,m as mt,n as Me,o as pt,p as gt,r as ut,s as _t,t as ht,u as ft,v as vt}from"./chunk-FJR6WCPX.js";import{d as me}from"./chunk-LTFITYTW.js";import{c as bt}from"./chunk-DPFJ6LFY.js";import{d as Ct,e as xt,f as yt,g as St}from"./chunk-3DDLKUVJ.js";import{a as Ye,b as qe,j as Ke,n as et}from"./chunk-6JH2UGTU.js";import{a as k,b as S}from"./chunk-LCBWJP6Z.js";import{d as Xe}from"./chunk-HY7OYHZF.js";import{a as U,b as Q}from"./chunk-QFSZDRP2.js";import{B as Ze,C as be,c as he,g as fe,m as ve}from"./chunk-DLU3TQID.js";import{a as pe,b as ge}from"./chunk-G4QDBE4F.js";import{E as Qe,O as $,S as B,n as Ue}from"./chunk-SDLTQWY6.js";import{Ab as Te,Bb as v,Db as _,Fb as c,Fc as Be,Gb as Fe,Ha as K,Hb as Le,Jb as ie,Ka as d,Kb as re,Lb as oe,Pb as Pe,Qb as V,Rb as x,T as O,Tb as l,Ub as y,V as De,Vb as Z,Wa as I,Xa as Ae,Xb as ae,Yb as se,Z as Ve,Zb as ce,_ as Ne,a as j,ab as te,b as Y,bc as Re,ca as b,cc as ze,ga as m,h as q,ha as p,hc as $e,i as M,jb as ne,kc as le,lb as g,ma as ee,mb as u,oa as W,oc as de,pb as R,qb as z,rb as C,sb as o,t as G,ta as L,tb as s,ua as J,ub as D,z as Ie}from"./chunk-RNXBUYHW.js";var Mt=class i{destroy$=new q;currentProject=null;currentThread=null;messagesSubject=new M([]);isThinkingSubject=new M(!1);currentChoiceSubject=new M(null);projectTitleSubject=new M("Coday");currentInviteEventSubject=new M(null);messageToRestoreSubject=new M("");threadUpdateEventSubject=new M(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new M("");subThreadEventsSubject=new q;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=b(Tt);messageApi=b(Pt);userService=b(_e);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=ft(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(!0),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let n=t.buildAnswer(e);this.messageApi.sendMessage(n).subscribe({error:r=>{console.error("[CODAY] Send invite answer error:",r),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(!0),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(r=>r.id===e),n=this.extractTextContentFromMessage(t);return this.messageApi.deleteMessage(e).pipe(De(r=>{r.success&&(this.removeMessagesFromIndex(e),n.trim()&&this.messageToRestoreSubject.next(n))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(O(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 t=this.subThreadEventBuffers.get(e.threadId);t?t.push(e):this.subThreadEventBuffers.set(e.threadId,[e]),this.subThreadEventsSubject.next(e);return}e instanceof pt?this.handleMessageEvent(e):e instanceof at?this.handleTextChunkEvent(e):e instanceof ot?this.handleTextEvent(e):e instanceof rt?this.handleAnswerEvent(e):e instanceof ct?this.handleErrorEvent(e):e instanceof st?this.handleWarnEvent(e):e instanceof Me?this.handleThinkingEvent(e):e instanceof dt?this.handleToolRequestEvent(e):e instanceof mt?this.handleToolResponseEvent(e):e instanceof lt?this.handleChoiceEvent(e):e instanceof tt?this.handleHeartBeatEvent(e):e instanceof nt?this.handleInviteEvent(e):e instanceof gt?this.handleThreadUpdateEvent(e):e instanceof _t?this.handleDelegationEvent(e):e instanceof ut||e instanceof ht||console.warn("[CODAY] Unhandled event type:",e.type)}handleDelegationEvent(e){if(console.log("[CODAY] DelegationEvent received:",e.subThreadId,e.agentName),this.messagesSubject.value.findIndex(r=>r.subThreadId===e.subThreadId)===-1){let r={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(r)}}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 r=!!e.parentKey&&e.parentKey===t.timestamp,a=!e.parentKey&&e.date>=t.date;(r||a)&&this.currentInviteEventSubject.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(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},Me.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};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){this.stopThinking(),this.currentChoiceEvent=e,this.tabTitleService?.setSystemInactive();let t=e.options.map(r=>({value:r,label:r})),n=e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite;this.currentChoiceSubject.next({options:t,label:n,allowFreeText:e.allowFreeText})}handleHeartBeatEvent(e){}handleInviteEvent(e){if(this.stopThinking(),e.invite===it)this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive();else{let n={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.invite}],timestamp:e.date,type:"text"};this.addMessage(n),this.messagesSubject.value.some(h=>h.parentKey===e.timestamp||h.role==="user"&&h.timestamp>e.date||h.role==="assistant"&&h.timestamp>e.date)||(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(a=>a.id===e);if(n===-1||n===0)return;let r=t.slice(0,n);this.messagesSubject.next(r),this.stopThinking()}extractTextContentFromMessage(e){return e?e.content.filter(t=>t.type==="text").map(t=>t.content).join(`
2
2
 
3
3
  `):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null)}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(!1),this.tabTitleService&&this.tabTitleService.setSystemInactive()}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})};var wt=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=Ae({type:i});static \u0275inj=Ne({imports:[Qe]})}return i})();var Nt=(i,e)=>({subThreads:i,depth:e}),At=i=>({subThreads:i,depth:1}),jt=(i,e)=>e.id,Ft=(i,e)=>e.label;function Lt(i,e){if(i&1){let t=v();o(0,"mat-icon",10),_("click",function(r){m(t);let a=c().$implicit,h=c(3);return p(h.toggleSubThreads(r,a.id))}),l(1),s()}if(i&2){let t=c().$implicit,n=c(3);d(),y(n.isParentExpanded(t.id)?"expand_more":"chevron_right")}}function Rt(i,e){i&1&&Te(0)}function zt(i,e){if(i&1&&te(0,Rt,1,0,"ng-container",11),i&2){let t=c().$implicit,n=c().depth;c();let r=Pe(1);C("ngTemplateOutlet",r)("ngTemplateOutletContext",ze(2,Nt,t.subThreads,n+1))}}function $t(i,e){if(i&1){let t=v();o(0,"div",5)(1,"a",6),_("click",function(r){let a=m(t).$implicit;return c(3).selectThread(a.id),p(r.preventDefault())})("keydown.enter",function(r){let a=m(t).$implicit;return c(3).selectThread(a.id),p(r.preventDefault())})("keydown.space",function(r){let a=m(t).$implicit;return c(3).selectThread(a.id),p(r.preventDefault())}),g(2,Lt,2,1,"mat-icon",7),o(3,"span",8),l(4),s(),o(5,"span",9),l(6),s()()(),g(7,zt,1,5,"ng-container")}if(i&2){let t,n=e.$implicit,r=c().depth,a=c(2);V("--sub-depth",r),x("current",n.id===((t=a.currentThread())==null?null:t.id)),d(2),u(n.subThreads!=null&&n.subThreads.length?2:-1),d(2),y(n.delegatedAgentName||"Agent"),d(2),y(n.delegatedTask||n.name),d(),u(a.isParentExpanded(n.id)&&(n.subThreads!=null&&n.subThreads.length)?7:-1)}}function Bt(i,e){if(i&1&&R(0,$t,8,8,null,null,jt),i&2){let t=e.subThreads;z(t)}}function Ut(i,e){i&1&&(o(0,"div",4),D(1,"span",12),o(2,"span",13),l(3,"Loading threads..."),s()())}function Qt(i,e){if(i&1&&(o(0,"div",27),l(1),s()),i&2){let t=c(6);d(),y(t.renameErrorMessage)}}function Xt(i,e){if(i&1){let t=v();o(0,"div",18)(1,"input",26),ce("ngModelChange",function(r){m(t);let a=c(5);return se(a.editingThreadName,r)||(a.editingThreadName=r),p(r)}),_("keydown",function(r){m(t);let a=c(5);return p(a.onEditKeydown(r))})("blur",function(){m(t);let r=c(5);return p(r.onEditBlur())})("click",function(r){return r.stopPropagation()}),s(),g(2,Qt,2,1,"div",27),s()}if(i&2){let t=c(5);d(),ae("ngModel",t.editingThreadName),C("disabled",t.isRenamingThread),d(),u(t.renameErrorMessage?2:-1)}}function Ht(i,e){if(i&1){let t=v();o(0,"mat-icon",10),_("click",function(r){m(t);let a=c(2).$implicit,h=c(4);return p(h.toggleSubThreads(r,a.id))}),l(1),s()}if(i&2){let t=c(2).$implicit,n=c(4);d(),y(n.isParentExpanded(t.id)?"expand_more":"chevron_right")}}function Yt(i,e){if(i&1&&(o(0,"span",29),l(1),s()),i&2){let t=c(2).$implicit;d(),y(t.name)}}function qt(i,e){i&1&&(D(0,"mat-spinner",31),o(1,"span",32),l(2,"Generating name..."),s()),i&2&&C("diameter",16)}function Gt(i,e){i&1&&(o(0,"mat-icon",30),l(1,"group"),s())}function Wt(i,e){if(i&1){let t=v();o(0,"a",28),_("click",function(r){m(t);let a=c().$implicit;return c(4).selectThread(a.id),p(r.preventDefault())})("keydown.enter",function(r){m(t);let a=c().$implicit;return c(4).selectThread(a.id),p(r.preventDefault())})("keydown.space",function(r){m(t);let a=c().$implicit;return c(4).selectThread(a.id),p(r.preventDefault())}),g(1,Ht,2,1,"mat-icon",7),g(2,Yt,2,1,"span",29)(3,qt,3,1),g(4,Gt,2,0,"mat-icon",30),s()}if(i&2){let t=c().$implicit,n=c(4);C("matTooltip",t.name?t.name+`
4
4
 
@@ -0,0 +1 @@
1
+ import{h as A}from"./chunk-R5RVDZLX.js";import{d as V}from"./chunk-LTFITYTW.js";import{g as D,h as O}from"./chunk-MLNEYB77.js";import{a as N}from"./chunk-LCBWJP6Z.js";import{Bb as I,Db as l,Fb as o,Gc as E,Ka as _,Pb as k,S as w,Tb as b,Ub as h,Wa as f,ab as M,ac as T,ca as g,dc as P,ec as L,ga as r,ha as m,hc as S,i as R,lb as C,ma as q,mb as v,oa as c,rb as u,sb as p,t as x,tb as d}from"./chunk-RNXBUYHW.js";function K(s,e){if(s&1&&(p(0,"span",3),b(1),d()),s&2){let t=o();_(),h(t.namespace.description)}}var y=class s{namespace;selected=new c;editRequested=new c;integrationsRequested=new c;aiProvidersRequested=new c;aiModelsRequested=new c;agentConfigsRequested=new c;deleteRequested=new c;menuItems=[{key:"edit",label:"Edit namespace",icon:"edit"},{key:"integrations",label:"Manage integrations",icon:"settings"},{key:"ai-providers",label:"AI Providers",icon:"smart_toy"},{key:"ai-models",label:"AI models",icon:"model_training"},{key:"agent-configs",label:"Agent Configs",icon:"support_agent"},{key:"delete",label:"Delete namespace",icon:"delete",variant:"danger"}];onSelect(){this.selected.emit(this.namespace)}onMenuAction(e){switch(e){case"edit":this.editRequested.emit(this.namespace);break;case"integrations":this.integrationsRequested.emit(this.namespace);break;case"ai-providers":this.aiProvidersRequested.emit(this.namespace);break;case"ai-models":this.aiModelsRequested.emit(this.namespace);break;case"agent-configs":this.agentConfigsRequested.emit(this.namespace);break;case"delete":confirm(`Delete namespace "${this.namespace.name}"?`)&&this.deleteRequested.emit(this.namespace);break}}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-item"]],inputs:{namespace:"namespace"},outputs:{selected:"selected",editRequested:"editRequested",integrationsRequested:"integrationsRequested",aiProvidersRequested:"aiProvidersRequested",aiModelsRequested:"aiModelsRequested",agentConfigsRequested:"agentConfigsRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem",1,"namespace-item"],["type","button",1,"namespace-item__body",3,"click"],[1,"namespace-item__name"],[1,"namespace-item__desc"],[1,"namespace-item__actions"],[3,"itemSelected","items"]],template:function(t,a){t&1&&(p(0,"div",0)(1,"button",1),l("click",function(){return a.onSelect()}),p(2,"span",2),b(3),d(),C(4,K,2,1,"span",3),d(),p(5,"div",4)(6,"ds-kebab-menu",5),l("itemSelected",function(i){return a.onMenuAction(i)}),d()()()),t&2&&(_(3),h(a.namespace.name),_(),v(a.namespace.description?4:-1),_(2),u("items",a.menuItems))},dependencies:[O],styles:[".namespace-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.875rem 1.25rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.namespace-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.namespace-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;background:none;border:none;padding:0;cursor:pointer;text-align:left;min-width:0}.namespace-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__desc[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.namespace-item[_ngcontent-%COMP%]:hover .namespace-item__actions[_ngcontent-%COMP%], .namespace-item[_ngcontent-%COMP%]:focus-within .namespace-item__actions[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})};var j=()=>[];function z(s,e){if(s&1){let t=I();p(0,"agentos-namespace-item",3),l("selected",function(n){r(t);let i=o(2);return m(i.navigateToCases(n.id??""))})("editRequested",function(n){r(t);let i=o(2);return m(i.navigateToEdit(n))})("deleteRequested",function(n){r(t);let i=o(2);return m(i.deleteNamespace(n))})("integrationsRequested",function(n){r(t);let i=o(2);return m(i.openIntegrations(n))})("aiProvidersRequested",function(n){r(t);let i=o(2);return m(i.openAiProviders(n))})("aiModelsRequested",function(n){r(t);let i=o(2);return m(i.openAiModels(n))})("agentConfigsRequested",function(n){r(t);let i=o(2);return m(i.openAgentConfigs(n))}),d()}s&2&&u("namespace",e)}function U(s,e){if(s&1&&C(0,z,1,1,"agentos-namespace-item",2),s&2){let t,a=e.$implicit,n=o();v((t=n.resolveNamespace(a.id))?0:-1,t)}}var $=class s{router=g(V);namespaceController=g(A);destroyRef=g(q);refresh$=new R(void 0);namespaces$=this.refresh$.pipe(w(()=>this.namespaceController.listAllNamespace()));namespaceItems$=this.namespaces$.pipe(x(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.description}))));namespacesById=new Map;constructor(){this.namespaces$.pipe(N(this.destroyRef)).subscribe(e=>{this.namespacesById=new Map(e.map(t=>[t.id??"",t]))})}navigateToCases(e){this.router.navigate(["/agentos",e,"cases"])}navigateToCreate(){this.router.navigate(["/agentos/namespaces/new"])}navigateToEdit(e){this.router.navigate(["/agentos/namespaces",e.id??"","edit"])}openIntegrations(e){this.router.navigate(["/agentos",e.id,"integrations"])}openAiProviders(e){this.router.navigate(["/agentos",e.id,"ai-providers"])}openAiModels(e){this.router.navigate(["/agentos",e.id,"ai-models"])}openAgentConfigs(e){this.router.navigate(["/agentos",e.id,"agent-configs"])}deleteNamespace(e){this.namespaceController.deleteNamespace(e.id??"").pipe(N(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveNamespace(e){return this.namespacesById.get(e)??null}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-list"]],decls:4,vars:6,consts:[["namespaceItemTpl",""],["title","Namespaces","emptyMessage","No namespaces yet. Create one to get started.","cardMinWidth","400px",3,"itemSelected","createRequested","items","showCreate","itemTemplate"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","integrationsRequested","aiProvidersRequested","aiModelsRequested","agentConfigsRequested","namespace"]],template:function(t,a){if(t&1&&(p(0,"ds-entity-list",1),P(1,"async"),l("itemSelected",function(i){return a.navigateToCases(i)})("createRequested",function(){return a.navigateToCreate()}),d(),M(2,U,1,1,"ng-template",null,0,S)),t&2){let n=k(3);u("items",L(1,3,a.namespaceItems$)??T(5,j))("showCreate",!0)("itemTemplate",n)}},dependencies:[y,D,E],encapsulation:2})};export{y as a,$ as b};
@@ -1 +1 @@
1
- import{c as F,j as D}from"./chunk-GAZJZBKP.js";import{b as T,d as N}from"./chunk-QWMDAFBN.js";import{a as y}from"./chunk-AJOXSD6I.js";import{D as q,c as V,e as _,g as U,h as L,i as z,l as d,n as B,s as K,u as R,v as G,w as $,x as j}from"./chunk-XJUBZLY2.js";import{Bb as I,Db as v,Fb as u,Ka as n,Tb as i,Ub as C,Vb as w,Wa as M,a as h,b as x,ca as m,ga as g,ha as b,lb as O,ma as P,mb as S,ob as A,pb as k,qb as E,rb as l,sb as t,ta as f,tb as r,ub as s}from"./chunk-3JGMGRXW.js";function J(a,o){a&1&&(t(0,"p",5),i(1,"Loading\u2026"),r())}function Q(a,o){if(a&1&&(t(0,"option",12),i(1),r()),a&2){let e=o.$implicit;l("value",e),n(),C(e)}}function W(a,o){if(a&1){let e=I();t(0,"form",7),v("ngSubmit",function(){g(e);let c=u();return b(c.submit())}),t(1,"div",8)(2,"label",9),i(3,"API type "),t(4,"span",10),i(5,"*"),r()(),t(6,"select",11),k(7,Q,2,2,"option",12,A),r()(),t(9,"div",8)(10,"label",13),i(11,"Name "),t(12,"span",10),i(13,"*"),r()(),s(14,"input",14),r(),t(15,"div",8)(16,"label",15),i(17,"Description"),r(),s(18,"input",16),r(),t(19,"div",8)(20,"label",17),i(21,"Base URL"),r(),s(22,"input",18),r(),t(23,"div",8)(24,"label",19),i(25,"API key"),r(),s(26,"input",20),r(),t(27,"div",21)(28,"button",22),i(29),r(),t(30,"button",23),v("click",function(){g(e);let c=u();return b(c.cancel())}),i(31,"Cancel"),r()()()}if(a&2){let e=u();l("formGroup",e.form),n(6),l("formControl",e.apiTypeControl),n(),E(e.apiTypeOptions),n(7),l("formControl",e.nameControl),n(4),l("formControl",e.descriptionControl),n(4),l("formControl",e.baseUrlControl),n(4),l("formControl",e.apiKeyControl),n(2),l("disabled",e.form.invalid||e.isSubmitting()),n(),w(" ",e.isEditMode()?"Save changes":"Create"," ")}}var H=class a{route=m(T);router=m(N);destroyRef=m(P);aiProviderController=m(F);namespaceId=this.route.snapshot.params.namespaceId;apiTypeOptions=Object.values(D);form=new z({name:new d("",{nonNullable:!0,validators:[_.required,_.minLength(1)]}),description:new d(null),apiType:new d("OpenAI",{nonNullable:!0,validators:[_.required]}),baseUrl:new d("",{nonNullable:!0}),apiKey:new d("",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}isEditMode=f(!1);isSubmitting=f(!1);isLoading=f(!1);existingConfig=null;ngOnInit(){let o=this.route.snapshot.paramMap.get("aiProviderId");o&&(this.isEditMode.set(!0),this.loadConfig(o))}loadConfig(o){this.isLoading.set(!0),this.aiProviderController.getByIdAiProvider(o).pipe(y(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(e.apiKey??""),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let o=x(h({},this.existingConfig??{}),{namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,apiType:this.apiTypeControl.value,baseUrl:this.baseUrlControl.value.trim()||void 0,apiKey:this.apiKeyControl.value.trim()||void 0});(this.isEditMode()?this.aiProviderController.updateAiProvider(this.existingConfig.id??"",o):this.aiProviderController.createAiProvider(o)).pipe(y(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers"])}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["agentos-ai-provider-form"]],decls:10,vars:2,consts:[[1,"ai-provider-form"],[1,"ai-provider-form__header"],["type","button","title","Back to AI providers",1,"ai-provider-form__back",3,"click"],[1,"ai-provider-form__back-icon"],[1,"ai-provider-form__title"],[1,"ai-provider-form__loading"],[1,"ai-provider-form__form",3,"formGroup"],[1,"ai-provider-form__form",3,"ngSubmit","formGroup"],[1,"ai-provider-form__field"],["for","llm-api-type",1,"ai-provider-form__label"],["aria-hidden","true"],["id","llm-api-type",1,"ai-provider-form__select",3,"formControl"],[3,"value"],["for","llm-name",1,"ai-provider-form__label"],["id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-description",1,"ai-provider-form__label"],["id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-base-url",1,"ai-provider-form__label"],["id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-api-key",1,"ai-provider-form__label"],["id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",1,"ai-provider-form__input","ai-provider-form__input--secret",3,"formControl"],[1,"ai-provider-form__actions"],["type","submit",1,"ai-provider-form__btn","ai-provider-form__btn--primary",3,"disabled"],["type","button",1,"ai-provider-form__btn",3,"click"]],template:function(e,p){e&1&&(t(0,"div",0)(1,"header",1)(2,"button",2),v("click",function(){return p.cancel()}),t(3,"span",3),i(4,"\u2190"),r(),i(5," AI Providers "),r(),t(6,"h1",4),i(7),r()(),O(8,J,2,0,"p",5)(9,W,32,8,"form",6),r()),e&2&&(n(7),C(p.isEditMode()?"Edit AI provider":"New AI provider"),n(),S(p.isLoading()?8:9))},dependencies:[q,B,$,j,V,G,U,L,K,R],styles:[".ai-provider-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-provider-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.ai-provider-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-provider-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.ai-provider-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.ai-provider-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-provider-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-provider-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.ai-provider-form__input[_ngcontent-%COMP%], .ai-provider-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-provider-form__input[_ngcontent-%COMP%]:focus, .ai-provider-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.ai-provider-form__input[_ngcontent-%COMP%]::placeholder, .ai-provider-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.ai-provider-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.ai-provider-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-provider-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-provider-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.ai-provider-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-provider-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.ai-provider-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{H as AiProviderFormComponent};
1
+ import{d as F,k as D}from"./chunk-R5RVDZLX.js";import{b as T,d as N}from"./chunk-LTFITYTW.js";import{a as y}from"./chunk-LCBWJP6Z.js";import{D as q,c as V,e as _,g as U,h as L,i as z,l as d,n as B,s as K,u as R,v as G,w as $,x as j}from"./chunk-DLU3TQID.js";import{Bb as I,Db as v,Fb as u,Ka as n,Tb as i,Ub as C,Vb as w,Wa as M,a as h,b as x,ca as m,ga as g,ha as b,lb as O,ma as P,mb as S,ob as A,pb as k,qb as E,rb as l,sb as t,ta as f,tb as r,ub as s}from"./chunk-RNXBUYHW.js";function J(a,o){a&1&&(t(0,"p",5),i(1,"Loading\u2026"),r())}function Q(a,o){if(a&1&&(t(0,"option",12),i(1),r()),a&2){let e=o.$implicit;l("value",e),n(),C(e)}}function W(a,o){if(a&1){let e=I();t(0,"form",7),v("ngSubmit",function(){g(e);let c=u();return b(c.submit())}),t(1,"div",8)(2,"label",9),i(3,"API type "),t(4,"span",10),i(5,"*"),r()(),t(6,"select",11),k(7,Q,2,2,"option",12,A),r()(),t(9,"div",8)(10,"label",13),i(11,"Name "),t(12,"span",10),i(13,"*"),r()(),s(14,"input",14),r(),t(15,"div",8)(16,"label",15),i(17,"Description"),r(),s(18,"input",16),r(),t(19,"div",8)(20,"label",17),i(21,"Base URL"),r(),s(22,"input",18),r(),t(23,"div",8)(24,"label",19),i(25,"API key"),r(),s(26,"input",20),r(),t(27,"div",21)(28,"button",22),i(29),r(),t(30,"button",23),v("click",function(){g(e);let c=u();return b(c.cancel())}),i(31,"Cancel"),r()()()}if(a&2){let e=u();l("formGroup",e.form),n(6),l("formControl",e.apiTypeControl),n(),E(e.apiTypeOptions),n(7),l("formControl",e.nameControl),n(4),l("formControl",e.descriptionControl),n(4),l("formControl",e.baseUrlControl),n(4),l("formControl",e.apiKeyControl),n(2),l("disabled",e.form.invalid||e.isSubmitting()),n(),w(" ",e.isEditMode()?"Save changes":"Create"," ")}}var H=class a{route=m(T);router=m(N);destroyRef=m(P);aiProviderController=m(F);namespaceId=this.route.snapshot.params.namespaceId;apiTypeOptions=Object.values(D);form=new z({name:new d("",{nonNullable:!0,validators:[_.required,_.minLength(1)]}),description:new d(null),apiType:new d("OpenAI",{nonNullable:!0,validators:[_.required]}),baseUrl:new d("",{nonNullable:!0}),apiKey:new d("",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}isEditMode=f(!1);isSubmitting=f(!1);isLoading=f(!1);existingConfig=null;ngOnInit(){let o=this.route.snapshot.paramMap.get("aiProviderId");o&&(this.isEditMode.set(!0),this.loadConfig(o))}loadConfig(o){this.isLoading.set(!0),this.aiProviderController.getByIdAiProvider(o).pipe(y(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(e.apiKey??""),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let o=x(h({},this.existingConfig??{}),{namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,apiType:this.apiTypeControl.value,baseUrl:this.baseUrlControl.value.trim()||void 0,apiKey:this.apiKeyControl.value.trim()||void 0});(this.isEditMode()?this.aiProviderController.updateAiProvider(this.existingConfig.id??"",o):this.aiProviderController.createAiProvider(o)).pipe(y(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers"])}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["agentos-ai-provider-form"]],decls:10,vars:2,consts:[[1,"ai-provider-form"],[1,"ai-provider-form__header"],["type","button","title","Back to AI providers",1,"ai-provider-form__back",3,"click"],[1,"ai-provider-form__back-icon"],[1,"ai-provider-form__title"],[1,"ai-provider-form__loading"],[1,"ai-provider-form__form",3,"formGroup"],[1,"ai-provider-form__form",3,"ngSubmit","formGroup"],[1,"ai-provider-form__field"],["for","llm-api-type",1,"ai-provider-form__label"],["aria-hidden","true"],["id","llm-api-type",1,"ai-provider-form__select",3,"formControl"],[3,"value"],["for","llm-name",1,"ai-provider-form__label"],["id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-description",1,"ai-provider-form__label"],["id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-base-url",1,"ai-provider-form__label"],["id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-api-key",1,"ai-provider-form__label"],["id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",1,"ai-provider-form__input","ai-provider-form__input--secret",3,"formControl"],[1,"ai-provider-form__actions"],["type","submit",1,"ai-provider-form__btn","ai-provider-form__btn--primary",3,"disabled"],["type","button",1,"ai-provider-form__btn",3,"click"]],template:function(e,p){e&1&&(t(0,"div",0)(1,"header",1)(2,"button",2),v("click",function(){return p.cancel()}),t(3,"span",3),i(4,"\u2190"),r(),i(5," AI Providers "),r(),t(6,"h1",4),i(7),r()(),O(8,J,2,0,"p",5)(9,W,32,8,"form",6),r()),e&2&&(n(7),C(p.isEditMode()?"Edit AI provider":"New AI provider"),n(),S(p.isLoading()?8:9))},dependencies:[q,B,$,j,V,G,U,L,K,R],styles:[".ai-provider-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-provider-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.ai-provider-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-provider-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.ai-provider-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.ai-provider-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-provider-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-provider-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.ai-provider-form__input[_ngcontent-%COMP%], .ai-provider-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-provider-form__input[_ngcontent-%COMP%]:focus, .ai-provider-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.ai-provider-form__input[_ngcontent-%COMP%]::placeholder, .ai-provider-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.ai-provider-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.ai-provider-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-provider-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-provider-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.ai-provider-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-provider-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.ai-provider-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{H as AiProviderFormComponent};