@whoz-oss/coday-client 0.0.0-workstream-forge.45 → 0.0.0-workstream-forge.46

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 (77) hide show
  1. package/browser/{chunk-D9_OKAzm.js → chunk--1ywLX5-.js} +1 -1
  2. package/browser/{chunk-BklVYxUM.js → chunk-4uirPFLL.js} +1 -1
  3. package/browser/{chunk-ZJzMI5VP.js → chunk-7tTqxsm6.js} +1 -1
  4. package/browser/{chunk-FZmiz4Qr.js → chunk-8Uk5dORX.js} +1 -1
  5. package/browser/{chunk-CkCBl_UG.js → chunk-8mfEyMLV.js} +1 -1
  6. package/browser/{chunk-DXdSoNy4.js → chunk-B-L_IEiO.js} +1 -1
  7. package/browser/{chunk-CMXltUaw.js → chunk-B1a-YZcr.js} +1 -1
  8. package/browser/{chunk-DWwzYMmI.js → chunk-B653U1VO.js} +1 -1
  9. package/browser/{chunk-CbhL5SV0.js → chunk-BEab1dAl.js} +1 -1
  10. package/browser/{chunk-CAp_lfVu.js → chunk-BFyw66tP.js} +1 -1
  11. package/browser/{chunk-C8iOOOY_.js → chunk-BIhJ2Ry0.js} +1 -1
  12. package/browser/{chunk-QNhyHoOU.js → chunk-BKIl2dle.js} +1 -1
  13. package/browser/{chunk-CUlEJdpX.js → chunk-BRmEkJ52.js} +1 -1
  14. package/browser/{chunk-C3svnH2b.js → chunk-BTb9w0u1.js} +1 -1
  15. package/browser/{chunk-B072vQwV.js → chunk-BVJ57XNG.js} +1 -1
  16. package/browser/{chunk-C_9_JbQU.js → chunk-BWar9Wj4.js} +1 -1
  17. package/browser/{chunk-F1-hM7f7.js → chunk-BYTELqh9.js} +1 -1
  18. package/browser/{chunk-D_thO_Ag.js → chunk-B_d48Wsa.js} +1 -1
  19. package/browser/{chunk-QrsQAI6B.js → chunk-Bb-eZxWs.js} +1 -1
  20. package/browser/{chunk-B990P9Py.js → chunk-BwwJ1rnT.js} +1 -1
  21. package/browser/{chunk-COBkzJ-u.js → chunk-C30VSwOl.js} +1 -1
  22. package/browser/{chunk-CmMtmghN.js → chunk-CA-YCcDm.js} +1 -1
  23. package/browser/{chunk-BdO-nXjF.js → chunk-CAmjRPRv.js} +1 -1
  24. package/browser/{chunk-_06xvpMi.js → chunk-CDgJQeuD.js} +1 -1
  25. package/browser/{chunk-Ct_2S-sl.js → chunk-CGZIfIdd.js} +1 -1
  26. package/browser/{chunk-DQQOdU1U.js → chunk-CWtHBZBP.js} +1 -1
  27. package/browser/{chunk-DcA4SQ_F.js → chunk-CXbiMHfN.js} +1 -1
  28. package/browser/{chunk-D624sHdG.js → chunk-CYIao0Tp.js} +1 -1
  29. package/browser/{chunk-DSkXYm2v.js → chunk-CZpUD7nz.js} +1 -1
  30. package/browser/{chunk-CzaqG5Fn.js → chunk-CdZIUq0j.js} +1 -1
  31. package/browser/{chunk-BPMVQi2q.js → chunk-CgDncIUW.js} +1 -1
  32. package/browser/{chunk-C7_JV7A3.js → chunk-Cjw6T8Mk.js} +1 -1
  33. package/browser/{chunk-CXG84hn8.js → chunk-CuQi2Zrf.js} +1 -1
  34. package/browser/{chunk-CJJFWKWB.js → chunk-CypCXByJ.js} +1 -1
  35. package/browser/{chunk-BktzBCjW.js → chunk-D0JonC9u.js} +1 -1
  36. package/browser/{chunk-BYXp-98T.js → chunk-D0irPb8A.js} +1 -1
  37. package/browser/{chunk-BGUzVqK4.js → chunk-D16Dnddi.js} +5 -5
  38. package/browser/{chunk-DefJ0uW7.js → chunk-DGK_1-jv.js} +1 -1
  39. package/browser/{chunk-B8BlhnyO.js → chunk-DGo080oC.js} +1 -1
  40. package/browser/{chunk-CUzyYjnK.js → chunk-DHDE74d9.js} +1 -1
  41. package/browser/{chunk-C1UQ_4kg.js → chunk-DI_Ac3gc.js} +1 -1
  42. package/browser/{chunk-Dhf4vG-g.js → chunk-DKjAt4Zj.js} +1 -1
  43. package/browser/{chunk-CpcddH1i.js → chunk-Db8A_MqJ.js} +1 -1
  44. package/browser/{chunk-DZckwiLN.js → chunk-Dduvga3P.js} +1 -1
  45. package/browser/{chunk-D225c7Xz.js → chunk-Df1wyDfJ.js} +1 -1
  46. package/browser/{chunk-WkmNSaSs.js → chunk-DfDtwhe3.js} +1 -1
  47. package/browser/{chunk-fUMUoKB6.js → chunk-Dfkhi9f6.js} +1 -1
  48. package/browser/{chunk-CBTf-tDI.js → chunk-Dj5abQ5w.js} +1 -1
  49. package/browser/{chunk-zPzzH02F.js → chunk-DrG304z5.js} +1 -1
  50. package/browser/{chunk-CKSlMf7M.js → chunk-DsRgOrg5.js} +1 -1
  51. package/browser/{chunk-bOymKVwq.js → chunk-DvlcAPUq.js} +1 -1
  52. package/browser/{chunk-DrDv-6ZR.js → chunk-Dy2YTJY4.js} +1 -1
  53. package/browser/chunk-Dz-DdLR6.js +1 -0
  54. package/browser/{chunk-CbHR06PD.js → chunk-E-xsAdxy.js} +1 -1
  55. package/browser/{chunk-DB_diwHv.js → chunk-IBS_Sr9m.js} +1 -1
  56. package/browser/{chunk-BG1uCwUL.js → chunk-L-2ySl6x.js} +1 -1
  57. package/browser/{chunk-8_4J6QVe.js → chunk-R0zhreqt.js} +1 -1
  58. package/browser/{chunk-DFrltwI3.js → chunk-SAy5I1WQ.js} +1 -1
  59. package/browser/{chunk-BwBnWvZ9.js → chunk-SDAP6_kt.js} +1 -1
  60. package/browser/{chunk-RFA99Ed8.js → chunk-VDtmKXg2.js} +1 -1
  61. package/browser/{chunk-Df3PzhTd.js → chunk-YekhGerL.js} +1 -1
  62. package/browser/chunk-_UW4wTJo.js +1 -0
  63. package/browser/{chunk-DnkM9dIF.js → chunk-fpnlNii6.js} +1 -1
  64. package/browser/chunk-hrdbF1jX.js +1 -0
  65. package/browser/{chunk-BTCEs3J0.js → chunk-iCWmwpuo.js} +1 -1
  66. package/browser/{chunk-H98syF3F.js → chunk-lCf3g_UU.js} +1 -1
  67. package/browser/{chunk-O7U04KOq.js → chunk-lnJjugRf.js} +1 -1
  68. package/browser/{chunk-BLuuMWjm.js → chunk-pfGEXSK6.js} +1 -1
  69. package/browser/{chunk-DJLmqEKS.js → chunk-qI9tM3V_.js} +1 -1
  70. package/browser/{chunk-yVRLS86p.js → chunk-t6FIWe7S.js} +1 -1
  71. package/browser/{chunk-Dcygvta2.js → chunk-wZXIGLks.js} +1 -1
  72. package/browser/index.html +1 -1
  73. package/browser/{main-WPRRV3C7.js → main-SMDF5ZWK.js} +4 -4
  74. package/package.json +1 -1
  75. package/browser/chunk-BN0krnx_.js +0 -1
  76. package/browser/chunk-BcGPLDCP.js +0 -1
  77. package/browser/chunk-CSOsSJN-.js +0 -1
@@ -1,4 +1,4 @@
1
- import {c as ce,s as se,b as at$1,d as de}from'./chunk-CAp_lfVu.js';import {a as Dr,c as br,y as yr,g as gt,q as qi,F as Fn,b as $i}from'./chunk-H98syF3F.js';import {W as We,Q as Qt}from'./chunk-WkmNSaSs.js';import {aL as wo,aM as Zn,bD as ge,aO as wt,bE as vt,g,bN as F,bs as Tl,az as Xt,bt as Qn,aT as Ut,aR as Fs,c4 as On,aW as C,aS as K,an as ue,a as Gi,bQ as Gy,bR as Id,bS as va,bP as Wy,al as vt$1,ae as kt,r as re,by as um,c5 as Et,ap as wd,aA as an$1,bu as Ve,c6 as Rt,bH as Pt$1,c1 as E,e as xw,c7 as _e$1,aC as Tu,a_ as QT,c8 as KT,bA as yC,k as ws,q as Rg,J as Jw,o as pl,c9 as kf,S as Sg,af as Eg,u as CC,X as XE,T as Tg,y as eC,v as bg,b5 as nT,A as Ug,D as Pg,E as EC,I as IC,bv as Fg,bL as pe,c3 as kt$1,n as GC,ac as gC,a8 as Yg,a9 as lC,aa as If,ab as wf,bB as vC,b$ as kC}from'./main-WPRRV3C7.js';import {_,b as _e,d as an,E as En}from'./chunk-Df3PzhTd.js';var Qe=["trigger"],Ye=["panel"],Ue=[[["mat-select-trigger"]],"*"],Xe=["mat-select-trigger","*"];function Je(a,_){if(a&1&&(ws(0,"span",4),GC(1),pl()),a&2){let e=gC();XE(),Yg(e.placeholder);}}function Ze(a,_){a&1&&vC(0);}function $e(a,_){if(a&1&&(ws(0,"span",11),GC(1),pl()),a&2){let e=gC(2);XE(),Yg(e.triggerValue);}}function et(a,_){if(a&1&&(ws(0,"span",5),Jw(1,Ze,1,0)(2,$e,2,1,"span",11),pl()),a&2){let e=gC();XE(),eC(e.customTrigger?1:2);}}function tt(a,_){if(a&1){let e=lC();ws(0,"div",12,1),Rg("keydown",function(i){If(e);let n=gC();return wf(n._handleKeydown(i))}),vC(2,1),pl();}if(a&2){let e=gC();kC(e.panelClass),Ug("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",e._parentFormField?.color==="primary")("mat-accent",e._parentFormField?.color==="accent")("mat-warn",e._parentFormField?.color==="warn")("mat-undefined",!e._parentFormField?.color),Tg("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby());}}var it=new C("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let a=g(pe);return ()=>kt$1(a)}}),nt=new C("MAT_SELECT_CONFIG"),at=new C("MatSelectTrigger"),B=class{source;value;constructor(_,e){this.source=_,this.value=e;}},Lt=(()=>{class a{_viewportRuler=g(F);_changeDetectorRef=g(Tl);_elementRef=g(Xt);_dir=g(Qn,{optional:true});_idGenerator=g(Ut);_renderer=g(Fs);_parentFormField=g(se,{optional:true});ngControl=g(_,{self:true,optional:true});_liveAnnouncer=g(On);_defaultOptions=g(nt,{optional:true});_animationsDisabled=K();_popoverLocation;_initialized=new ue;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,n=br(e,this.options,this.optionGroups),r=t._getHostElement();e===0&&n===1?i.scrollTop=0:i.scrollTop=yr(r.offsetTop,r.offsetHeight,i.scrollTop,i.offsetHeight);}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0);}_getChangeEvent(e){return new B(this,e)}_scrollStrategyFactory=g(it);_panelOpen=false;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new ue;_errorStateTracker;stateChanges=new ue;disableAutomaticLabeling=true;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=false;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=false;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e);}_disableRipple=Gi(false);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??false;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next();}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(_e.required)??false}set required(e){this._required=e,this.stateChanges.next();}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e;}_multiple=false;disableOptionCentering=this._defaultOptions?.disableOptionCentering??false;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection();}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e);}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e;}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next();}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e;}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??false;optionSelectionChanges=Gy(()=>{let e=this.options;return e?e.changes.pipe(Id(e),va(()=>Wy(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(va(()=>this.optionSelectionChanges))});openedChange=new vt$1;_openedStream=this.openedChange.pipe(kt(e=>e),re(()=>{}));_closedStream=this.openedChange.pipe(kt(e=>!e),re(()=>{}));selectionChange=new vt$1;valueChange=new vt$1;constructor(){let e=g(We),t=g(an,{optional:true}),i=g(En,{optional:true}),n=g(new um("tabindex"),{optional:true}),r=g(Et,{optional:true}),d=g(at$1,{optional:true,self:true});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Qt(e,d||this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=n==null?0:parseInt(n)||0,this._popoverLocation=r?.usePopover===false?null:"inline",this.id=this.id;}ngOnInit(){this._selectionModel=new gt(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(wd(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges());});}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(wd(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect());}),this.options.changes.pipe(Id(null),wd(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection();});}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby");}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState());}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass));}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete();}toggle(){this.panelOpen?this.close():this.open();}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._panelOpen=true,this._overlayDir.positionChange.pipe(an$1(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled();}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(true)));}close(){this._panelOpen&&(this._panelOpen=false,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(false)));}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0;};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",n=>{n.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay());}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay();},200);e.classList.add("mat-select-panel-exit");}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck();}writeValue(e){this._assignValue(e);}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next();}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return "";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState();}_isRtl(){return this._dir?this._dir.value==="rtl":false}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e));}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,n=t===13||t===32,r=this._keyManager;if(!r.isTyping()&&n&&!Ve(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let d=this.selected;r.onKeydown(e);let o=this.selected;o&&d!==o&&this._liveAnnouncer.announce(o.viewValue,1e4);}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,n=i===40||i===38,r=t.isTyping();if(n&&e.altKey)e.preventDefault(),this.close();else if(!r&&(i===13||i===32)&&t.activeItem&&!Ve(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!r&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let d=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(d?o.select():o.deselect());});}else {let d=t.activeItemIndex;t.onKeydown(e),this._multiple&&n&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==d&&t.activeItem._selectViaInteraction();}}_handleOverlayKeydown(e){e.keyCode===27&&!Ve(e)&&(e.preventDefault(),this.close());}_onFocus(){this.disabled||(this._focused=true,this.stateChanges.next());}_onBlur(){this._focused=false,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next());}get empty(){return !this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next();});}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else {let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1);}this._changeDetectorRef.markForCheck();}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return false;try{return (i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(n){return false}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,true):false}_skipPredicate=e=>this.panelOpen?false:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Rt?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}_initKeyManager(){this._keyManager=new Pt$1(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close());}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction();});}_resetOptions(){let e=Wy(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(wd(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus());}),Wy(...this.options.map(t=>t._stateChanges)).pipe(wd(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next();});}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next();}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next();}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck();}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e);}else this._keyManager.setActiveItem(this._selectionModel.selected[0]);}_canOpen(){return !this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e);}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby");}onContainerClick(e){let t=E(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open());}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-select"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,at,5)(n,Fn,5)(n,$i,5),t&2){let r;EC(r=IC())&&(i.customTrigger=r.first),EC(r=IC())&&(i.options=r),EC(r=IC())&&(i.optionGroups=r);}},viewQuery:function(t,i){if(t&1&&Pg(Qe,5)(Ye,5)(_e$1,5),t&2){let n;EC(n=IC())&&(i.trigger=n.first),EC(n=IC())&&(i.panel=n.first),EC(n=IC())&&(i._overlayDir=n.first);}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&Rg("keydown",function(r){return i._handleKeydown(r)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(Tg("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),Ug("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen));},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",QT],disableRipple:[2,"disableRipple","disableRipple",QT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:KT(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT],placeholder:"placeholder",required:[2,"required","required",QT],multiple:[2,"multiple","multiple",QT],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",QT],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",KT],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",QT]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[nT([{provide:de,useExisting:a},{provide:qi,useExisting:a}]),Tu],ngContentSelectors:Xe,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(yC(Ue),ws(0,"div",2,0),Rg("click",function(){return i.open()}),ws(3,"div",3),Jw(4,Je,2,1,"span",4)(5,et,3,1,"span",5),pl(),ws(6,"div",6)(7,"div",7),kf(),ws(8,"svg",8),Sg(9,"path",9),pl()()()(),Eg(10,tt,3,16,"ng-template",10),Rg("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(r){return i._handleOverlayKeydown(r)})),t&2){let n=CC(1);XE(3),Tg("id",i._valueId),XE(),eC(i.empty?4:5),XE(6),bg("cdkConnectedOverlayDisableClose",true)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||n)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",true)("cdkConnectedOverlayUsePopover",i._popoverLocation);}},dependencies:[Rt,_e$1],styles:[`@keyframes _mat-select-enter {
1
+ import {c as ce,s as se,b as at$1,d as de}from'./chunk-BFyw66tP.js';import {a as Dr,c as br,y as yr,g as gt,q as qi,F as Fn,b as $i}from'./chunk-lCf3g_UU.js';import {W as We,Q as Qt}from'./chunk-DfDtwhe3.js';import {aL as wo,aM as Zn,bD as ge,aO as wt,bE as vt,g,bN as F,bs as Tl,az as Xt,bt as Qn,aT as Ut,aR as Fs,c4 as On,aW as C,aS as K,an as ue,a as Gi,bQ as Gy,bR as Id,bS as va,bP as Wy,al as vt$1,ae as kt,r as re,by as um,c5 as Et,ap as wd,aA as an$1,bu as Ve,c6 as Rt,bH as Pt$1,c1 as E,e as xw,c7 as _e$1,aC as Tu,a_ as QT,c8 as KT,bA as yC,k as ws,q as Rg,J as Jw,o as pl,c9 as kf,S as Sg,af as Eg,u as CC,X as XE,T as Tg,y as eC,v as bg,b5 as nT,A as Ug,D as Pg,E as EC,I as IC,bv as Fg,bL as pe,c3 as kt$1,n as GC,ac as gC,a8 as Yg,a9 as lC,aa as If,ab as wf,bB as vC,b$ as kC}from'./main-SMDF5ZWK.js';import {_,b as _e,d as an,E as En}from'./chunk-YekhGerL.js';var Qe=["trigger"],Ye=["panel"],Ue=[[["mat-select-trigger"]],"*"],Xe=["mat-select-trigger","*"];function Je(a,_){if(a&1&&(ws(0,"span",4),GC(1),pl()),a&2){let e=gC();XE(),Yg(e.placeholder);}}function Ze(a,_){a&1&&vC(0);}function $e(a,_){if(a&1&&(ws(0,"span",11),GC(1),pl()),a&2){let e=gC(2);XE(),Yg(e.triggerValue);}}function et(a,_){if(a&1&&(ws(0,"span",5),Jw(1,Ze,1,0)(2,$e,2,1,"span",11),pl()),a&2){let e=gC();XE(),eC(e.customTrigger?1:2);}}function tt(a,_){if(a&1){let e=lC();ws(0,"div",12,1),Rg("keydown",function(i){If(e);let n=gC();return wf(n._handleKeydown(i))}),vC(2,1),pl();}if(a&2){let e=gC();kC(e.panelClass),Ug("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",e._parentFormField?.color==="primary")("mat-accent",e._parentFormField?.color==="accent")("mat-warn",e._parentFormField?.color==="warn")("mat-undefined",!e._parentFormField?.color),Tg("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby());}}var it=new C("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let a=g(pe);return ()=>kt$1(a)}}),nt=new C("MAT_SELECT_CONFIG"),at=new C("MatSelectTrigger"),B=class{source;value;constructor(_,e){this.source=_,this.value=e;}},Lt=(()=>{class a{_viewportRuler=g(F);_changeDetectorRef=g(Tl);_elementRef=g(Xt);_dir=g(Qn,{optional:true});_idGenerator=g(Ut);_renderer=g(Fs);_parentFormField=g(se,{optional:true});ngControl=g(_,{self:true,optional:true});_liveAnnouncer=g(On);_defaultOptions=g(nt,{optional:true});_animationsDisabled=K();_popoverLocation;_initialized=new ue;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,n=br(e,this.options,this.optionGroups),r=t._getHostElement();e===0&&n===1?i.scrollTop=0:i.scrollTop=yr(r.offsetTop,r.offsetHeight,i.scrollTop,i.offsetHeight);}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0);}_getChangeEvent(e){return new B(this,e)}_scrollStrategyFactory=g(it);_panelOpen=false;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new ue;_errorStateTracker;stateChanges=new ue;disableAutomaticLabeling=true;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=false;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=false;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e);}_disableRipple=Gi(false);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??false;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next();}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(_e.required)??false}set required(e){this._required=e,this.stateChanges.next();}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e;}_multiple=false;disableOptionCentering=this._defaultOptions?.disableOptionCentering??false;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection();}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e);}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e;}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next();}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e;}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??false;optionSelectionChanges=Gy(()=>{let e=this.options;return e?e.changes.pipe(Id(e),va(()=>Wy(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(va(()=>this.optionSelectionChanges))});openedChange=new vt$1;_openedStream=this.openedChange.pipe(kt(e=>e),re(()=>{}));_closedStream=this.openedChange.pipe(kt(e=>!e),re(()=>{}));selectionChange=new vt$1;valueChange=new vt$1;constructor(){let e=g(We),t=g(an,{optional:true}),i=g(En,{optional:true}),n=g(new um("tabindex"),{optional:true}),r=g(Et,{optional:true}),d=g(at$1,{optional:true,self:true});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Qt(e,d||this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=n==null?0:parseInt(n)||0,this._popoverLocation=r?.usePopover===false?null:"inline",this.id=this.id;}ngOnInit(){this._selectionModel=new gt(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(wd(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges());});}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(wd(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect());}),this.options.changes.pipe(Id(null),wd(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection();});}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby");}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState());}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass));}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete();}toggle(){this.panelOpen?this.close():this.open();}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._panelOpen=true,this._overlayDir.positionChange.pipe(an$1(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled();}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(true)));}close(){this._panelOpen&&(this._panelOpen=false,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(false)));}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0;};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",n=>{n.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay());}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay();},200);e.classList.add("mat-select-panel-exit");}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck();}writeValue(e){this._assignValue(e);}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next();}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return "";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState();}_isRtl(){return this._dir?this._dir.value==="rtl":false}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e));}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,n=t===13||t===32,r=this._keyManager;if(!r.isTyping()&&n&&!Ve(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let d=this.selected;r.onKeydown(e);let o=this.selected;o&&d!==o&&this._liveAnnouncer.announce(o.viewValue,1e4);}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,n=i===40||i===38,r=t.isTyping();if(n&&e.altKey)e.preventDefault(),this.close();else if(!r&&(i===13||i===32)&&t.activeItem&&!Ve(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!r&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let d=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(d?o.select():o.deselect());});}else {let d=t.activeItemIndex;t.onKeydown(e),this._multiple&&n&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==d&&t.activeItem._selectViaInteraction();}}_handleOverlayKeydown(e){e.keyCode===27&&!Ve(e)&&(e.preventDefault(),this.close());}_onFocus(){this.disabled||(this._focused=true,this.stateChanges.next());}_onBlur(){this._focused=false,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next());}get empty(){return !this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next();});}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else {let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1);}this._changeDetectorRef.markForCheck();}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return false;try{return (i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(n){return false}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,true):false}_skipPredicate=e=>this.panelOpen?false:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Rt?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}_initKeyManager(){this._keyManager=new Pt$1(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close());}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction();});}_resetOptions(){let e=Wy(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(wd(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus());}),Wy(...this.options.map(t=>t._stateChanges)).pipe(wd(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next();});}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next();}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next();}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck();}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e);}else this._keyManager.setActiveItem(this._selectionModel.selected[0]);}_canOpen(){return !this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e);}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby");}onContainerClick(e){let t=E(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open());}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-select"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,at,5)(n,Fn,5)(n,$i,5),t&2){let r;EC(r=IC())&&(i.customTrigger=r.first),EC(r=IC())&&(i.options=r),EC(r=IC())&&(i.optionGroups=r);}},viewQuery:function(t,i){if(t&1&&Pg(Qe,5)(Ye,5)(_e$1,5),t&2){let n;EC(n=IC())&&(i.trigger=n.first),EC(n=IC())&&(i.panel=n.first),EC(n=IC())&&(i._overlayDir=n.first);}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&Rg("keydown",function(r){return i._handleKeydown(r)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(Tg("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),Ug("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen));},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",QT],disableRipple:[2,"disableRipple","disableRipple",QT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:KT(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT],placeholder:"placeholder",required:[2,"required","required",QT],multiple:[2,"multiple","multiple",QT],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",QT],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",KT],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",QT]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[nT([{provide:de,useExisting:a},{provide:qi,useExisting:a}]),Tu],ngContentSelectors:Xe,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(yC(Ue),ws(0,"div",2,0),Rg("click",function(){return i.open()}),ws(3,"div",3),Jw(4,Je,2,1,"span",4)(5,et,3,1,"span",5),pl(),ws(6,"div",6)(7,"div",7),kf(),ws(8,"svg",8),Sg(9,"path",9),pl()()()(),Eg(10,tt,3,16,"ng-template",10),Rg("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(r){return i._handleOverlayKeydown(r)})),t&2){let n=CC(1);XE(3),Tg("id",i._valueId),XE(),eC(i.empty?4:5),XE(6),bg("cdkConnectedOverlayDisableClose",true)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||n)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",true)("cdkConnectedOverlayUsePopover",i._popoverLocation);}},dependencies:[Rt,_e$1],styles:[`@keyframes _mat-select-enter {
2
2
  from {
3
3
  opacity: 0;
4
4
  transform: scaleY(0.8);
@@ -1 +1 @@
1
- import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-CzaqG5Fn.js';import {v}from'./chunk-DWwzYMmI.js';import {R}from'./chunk-DnkM9dIF.js';import {g,ao as V,G,C as Ce,a as Gi,r as re,b as U$1,bS as va,W as br,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,n as GC,X as XE,a8 as Yg,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-WPRRV3C7.js';import'./chunk-BGUzVqK4.js';import {$ as $n,S as Se}from'./chunk-H98syF3F.js';import'./chunk-WkmNSaSs.js';import'./chunk-Df3PzhTd.js';import'./chunk-BcGPLDCP.js';import'./chunk-Dcygvta2.js';var W=()=>[];function z(s,e){if(s&1&&(ws(0,"p",3),GC(1),pl()),s&2){let t=gC().$implicit;XE(),Yg(t.name);}}function U(s,e){if(s&1){let t=lC();ws(0,"agentos-auth-setting-item",5),Rg("editRequested",function(){let i=If(t),r=gC(2);return wf(r.onEdit(i))})("deleteRequested",function(){let i=If(t),r=gC(2);return wf(r.onDelete(i))})("duplicateRequested",function(){let i=If(t),r=gC(2);return wf(r.onDuplicate(i))}),pl();}if(s&2){let t=e,n=gC(2);bg("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!n.isAdmin());}}function X(s,e){if(s&1&&Jw(0,z,2,1,"p",3)(1,U,1,3,"agentos-auth-setting-item",4),s&2){let t,n=e.$implicit,i=gC();eC(i.isEmptyPlaceholder(n.id)?0:(t=i.resolve(n.id))?1:-1,t);}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"Auth Settings du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class s{route=g(V);router=g(G);destroyRef=g(Ce);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Gi(false);listItems$=this.state.vm$.pipe(re(e=>this.toListItems(e)));isLoading=Gi(true);resolved=new Map;ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(re(e=>e.get("namespaceId")??""),va(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe(e=>{this.isLoading.set(false);let t=new Map;e.platform.forEach(n=>{n.id&&t.set(this.itemKey("platform",n.id),{config:n,scope:"platform"});}),e.namespace.forEach(n=>{n.id&&t.set(this.itemKey("namespace",n.id),{config:n,scope:"namespace"});}),e.userOnNs.forEach(n=>{n.id&&t.set(this.itemKey("userOnNs",n.id),{config:n,scope:"userOnNs"});}),e.userGlobal.forEach(n=>{n.id&&t.set(this.itemKey("userGlobal",n.id),{config:n,scope:"userGlobal"});}),this.resolved=t;});}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return `${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t,"edit"],{queryParams:{scope:e.scope}});}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(U$1(this.destroyRef)).subscribe({error:n=>{console.error(`[AuthSettingsAllScopes] Delete failed for ${e.scope}:${t}:`,n);}});}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun Auth Setting",groupKey:e,groupLabel:k[e]}]:t.filter(n=>!!n.id).map(n=>({id:this.itemKey(e,n.id),name:n.name,description:n.authType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=xw({type:s,selectors:[["agentos-auth-settings-all-scopes"]],decls:5,vars:7,consts:[["authSettingItemTpl",""],["title","Auth Settings","emptyMessage","No auth settings available.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"auth-settings-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,n){if(t&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return n.goBack()}),pl()(),Eg(3,X,2,1,"ng-template",null,0,fT)),t&2){let i=CC(4);bg("items",uT(1,4,n.listItems$)??rT(6,W))("loading",n.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[$n,O,Se,xb],encapsulation:2})};export{j as AuthSettingsAllScopesComponent};
1
+ import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-CdZIUq0j.js';import {v}from'./chunk-B653U1VO.js';import {R}from'./chunk-fpnlNii6.js';import {g,ao as V,G,C as Ce,a as Gi,r as re,b as U$1,bS as va,W as br,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,n as GC,X as XE,a8 as Yg,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-SMDF5ZWK.js';import'./chunk-D16Dnddi.js';import {$ as $n,S as Se}from'./chunk-lCf3g_UU.js';import'./chunk-DfDtwhe3.js';import'./chunk-YekhGerL.js';import'./chunk-_UW4wTJo.js';import'./chunk-wZXIGLks.js';var W=()=>[];function z(s,e){if(s&1&&(ws(0,"p",3),GC(1),pl()),s&2){let t=gC().$implicit;XE(),Yg(t.name);}}function U(s,e){if(s&1){let t=lC();ws(0,"agentos-auth-setting-item",5),Rg("editRequested",function(){let i=If(t),r=gC(2);return wf(r.onEdit(i))})("deleteRequested",function(){let i=If(t),r=gC(2);return wf(r.onDelete(i))})("duplicateRequested",function(){let i=If(t),r=gC(2);return wf(r.onDuplicate(i))}),pl();}if(s&2){let t=e,n=gC(2);bg("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!n.isAdmin());}}function X(s,e){if(s&1&&Jw(0,z,2,1,"p",3)(1,U,1,3,"agentos-auth-setting-item",4),s&2){let t,n=e.$implicit,i=gC();eC(i.isEmptyPlaceholder(n.id)?0:(t=i.resolve(n.id))?1:-1,t);}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"Auth Settings du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class s{route=g(V);router=g(G);destroyRef=g(Ce);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Gi(false);listItems$=this.state.vm$.pipe(re(e=>this.toListItems(e)));isLoading=Gi(true);resolved=new Map;ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(re(e=>e.get("namespaceId")??""),va(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe(e=>{this.isLoading.set(false);let t=new Map;e.platform.forEach(n=>{n.id&&t.set(this.itemKey("platform",n.id),{config:n,scope:"platform"});}),e.namespace.forEach(n=>{n.id&&t.set(this.itemKey("namespace",n.id),{config:n,scope:"namespace"});}),e.userOnNs.forEach(n=>{n.id&&t.set(this.itemKey("userOnNs",n.id),{config:n,scope:"userOnNs"});}),e.userGlobal.forEach(n=>{n.id&&t.set(this.itemKey("userGlobal",n.id),{config:n,scope:"userGlobal"});}),this.resolved=t;});}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return `${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t,"edit"],{queryParams:{scope:e.scope}});}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(U$1(this.destroyRef)).subscribe({error:n=>{console.error(`[AuthSettingsAllScopes] Delete failed for ${e.scope}:${t}:`,n);}});}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun Auth Setting",groupKey:e,groupLabel:k[e]}]:t.filter(n=>!!n.id).map(n=>({id:this.itemKey(e,n.id),name:n.name,description:n.authType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=xw({type:s,selectors:[["agentos-auth-settings-all-scopes"]],decls:5,vars:7,consts:[["authSettingItemTpl",""],["title","Auth Settings","emptyMessage","No auth settings available.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"auth-settings-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,n){if(t&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return n.goBack()}),pl()(),Eg(3,X,2,1,"ng-template",null,0,fT)),t&2){let i=CC(4);bg("items",uT(1,4,n.listItems$)??rT(6,W))("loading",n.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[$n,O,Se,xb],encapsulation:2})};export{j as AuthSettingsAllScopesComponent};
@@ -1 +1 @@
1
- import {O}from'./chunk-CzaqG5Fn.js';import {R}from'./chunk-DnkM9dIF.js';import {g,G,C as Ce,aJ as Tr,a as Gi,bS as va,r as re,b as U,e as xw,aK as xb,k as ws,bf as aT,q as Rg,n as GC,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-WPRRV3C7.js';import'./chunk-BGUzVqK4.js';import {$ as $n}from'./chunk-H98syF3F.js';import'./chunk-WkmNSaSs.js';import'./chunk-Df3PzhTd.js';import'./chunk-BcGPLDCP.js';import'./chunk-Dcygvta2.js';var k=()=>[];function V(i,t){if(i&1){let e=lC();ws(0,"agentos-auth-setting-item",4),Rg("editRequested",function(n){If(e);let p=gC(2);return wf(p.onEdit(n))})("deleteRequested",function(n){If(e);let p=gC(2);return wf(p.onDelete(n))}),pl();}i&2&&bg("config",t)("showBadge",false);}function F(i,t){if(i&1&&Jw(0,V,1,2,"agentos-auth-setting-item",3),i&2){let e,o=t.$implicit,n=gC();eC((e=n.resolveSetting(o.id))?0:-1,e);}}var M=class i{router=g(G);destroyRef=g(Ce);state=g(R);refresh$=new Tr(void 0);isLoading=Gi(true);settings$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())));settingItems$=this.settings$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.authType}))));settingsById=new Map;constructor(){this.settings$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.settingsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.state.delete(t.id,"platform").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveSetting(t){return this.settingsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-auth-settings"]],decls:6,vars:7,consts:[["authSettingItemTpl",""],["title","Platform Auth Settings","emptyMessage","No platform auth settings defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-auth-settings__back",3,"click"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(e,o){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return o.openCreateForm()}),ws(2,"button",2),Rg("click",function(){return o.goBack()}),GC(3,"\u2190 Admin"),pl()(),Eg(4,F,1,1,"ng-template",null,0,fT)),e&2){let n=CC(5);bg("items",uT(1,4,o.settingItems$)??rT(6,k))("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[$n,O,xb],encapsulation:2})};export{M as PlatformAuthSettingsComponent};
1
+ import {O}from'./chunk-CdZIUq0j.js';import {R}from'./chunk-fpnlNii6.js';import {g,G,C as Ce,aJ as Tr,a as Gi,bS as va,r as re,b as U,e as xw,aK as xb,k as ws,bf as aT,q as Rg,n as GC,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-SMDF5ZWK.js';import'./chunk-D16Dnddi.js';import {$ as $n}from'./chunk-lCf3g_UU.js';import'./chunk-DfDtwhe3.js';import'./chunk-YekhGerL.js';import'./chunk-_UW4wTJo.js';import'./chunk-wZXIGLks.js';var k=()=>[];function V(i,t){if(i&1){let e=lC();ws(0,"agentos-auth-setting-item",4),Rg("editRequested",function(n){If(e);let p=gC(2);return wf(p.onEdit(n))})("deleteRequested",function(n){If(e);let p=gC(2);return wf(p.onDelete(n))}),pl();}i&2&&bg("config",t)("showBadge",false);}function F(i,t){if(i&1&&Jw(0,V,1,2,"agentos-auth-setting-item",3),i&2){let e,o=t.$implicit,n=gC();eC((e=n.resolveSetting(o.id))?0:-1,e);}}var M=class i{router=g(G);destroyRef=g(Ce);state=g(R);refresh$=new Tr(void 0);isLoading=Gi(true);settings$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())));settingItems$=this.settings$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.authType}))));settingsById=new Map;constructor(){this.settings$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.settingsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.state.delete(t.id,"platform").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveSetting(t){return this.settingsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-auth-settings"]],decls:6,vars:7,consts:[["authSettingItemTpl",""],["title","Platform Auth Settings","emptyMessage","No platform auth settings defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-auth-settings__back",3,"click"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(e,o){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return o.openCreateForm()}),ws(2,"button",2),Rg("click",function(){return o.goBack()}),GC(3,"\u2190 Admin"),pl()(),Eg(4,F,1,1,"ng-template",null,0,fT)),e&2){let n=CC(5);bg("items",uT(1,4,o.settingItems$)??rT(6,k))("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[$n,O,xb],encapsulation:2})};export{M as PlatformAuthSettingsComponent};
@@ -1 +1 @@
1
- import {v}from'./chunk-DWwzYMmI.js';import {R}from'./chunk-DnkM9dIF.js';import {N}from'./chunk-BYXp-98T.js';import {g,ao as V,G,C as Ce,d8 as W,F,W as br,a as Gi,m as mT,cd as Hf,b as U,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,y as eC,a9 as lC,t as rC,cH as Kw,a3 as VI,S as Sg,a4 as nC,ac as gC,v as bg,z as oC,a6 as UI,a5 as vl,aa as If,ab as wf}from'./main-WPRRV3C7.js';import'./chunk-BGUzVqK4.js';import {n as nt}from'./chunk-H98syF3F.js';import'./chunk-WkmNSaSs.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,a as wt,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-Df3PzhTd.js';import'./chunk-BcGPLDCP.js';import'./chunk-Dcygvta2.js';function le(r,t){r&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function se(r,t){if(r&1&&(ws(0,"label",10),Sg(1,"input",29),VI(),ws(2,"span"),GC(3),pl()()),r&2){let e=t.$implicit,n=gC(2);XE(),bg("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),UI(),XE(2),Yg(e.label);}}function ce(r,t){if(r&1&&(ws(0,"option",16),GC(1),pl()),r&2){let e=t.$implicit;bg("value",e.type),XE(),Yg(e.displayName);}}function me(r,t){if(r&1&&(ws(0,"option",16),GC(1),pl()),r&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function pe(r,t){if(r&1&&(ws(0,"div",11)(1,"label",30),Sg(2,"input",31),VI(),ws(3,"span",9),GC(4,"Grant automatically"),pl()(),ws(5,"p",32),GC(6),pl()()),r&2){let e=gC(2);XE(2),bg("formControl",e.autoGrantControl),UI(),XE(4),vl(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function de(r,t){if(r&1){let e=lC();ws(0,"div",24)(1,"ds-json-schema-form",33),Rg("valueChange",function(s){If(e);let m=gC(2);return wf(m.onParamsChange(s))}),pl()();}if(r&2){let e=gC(2);XE(),bg("schema",t)("value",e.initialParams());}}function ge(r,t){if(r&1){let e=lC();ws(0,"button",34),Rg("click",function(){If(e);let s=gC(2);return wf(s.exportYaml())}),GC(1),pl();}if(r&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ue(r,t){if(r&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let s=gC();return wf(s.submit())}),ws(1,"fieldset",8)(2,"legend",9),GC(3,"Scope"),pl(),rC(4,se,4,4,"label",10,Kw().trackByScope,true),pl(),ws(6,"div",11)(7,"label",12),GC(8,"Type "),ws(9,"span",13),GC(10,"*"),pl()(),ws(11,"select",14)(12,"option",15),GC(13,"Select type"),pl(),rC(14,ce,2,2,"option",16,Kw().trackByType,true),pl(),VI(),pl(),ws(16,"div",11)(17,"label",17),GC(18,"Name "),ws(19,"span",13),GC(20,"*"),pl()(),Sg(21,"input",18),VI(),pl(),ws(22,"div",11)(23,"label",19),GC(24,"Description"),pl(),Sg(25,"textarea",20),VI(),pl(),ws(26,"div",11)(27,"label",21),GC(28,"Auth Setting"),pl(),ws(29,"select",22)(30,"option",23),GC(31,"None"),pl(),rC(32,me,2,2,"option",16,nC),pl(),VI(),pl(),Jw(34,pe,7,2,"div",11),Jw(35,de,2,2,"div",24),ws(36,"div",25)(37,"button",26),GC(38),pl(),Jw(39,ge,2,2,"button",27),ws(40,"button",28),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(41,"Cancel"),pl()()();}if(r&2){let e,n=gC();bg("formGroup",n.form),XE(),bg("disabled",n.isEditMode()),XE(3),oC(n.scopeOptions),XE(7),bg("formControl",n.typeControl),UI(),XE(3),oC(n.integrationTypes()),XE(7),bg("formControl",n.nameControl),UI(),XE(4),bg("formControl",n.descriptionControl),UI(),XE(4),bg("formControl",n.authSettingNameControl),UI(),XE(),bg("ngValue",null),XE(2),oC(n.availableAuthSettings()),XE(2),eC(n.isAutoGrantable()?34:-1),XE(),eC((e=n.schema())?35:-1,e),XE(2),bg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),XE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),XE(),eC(n.isEditMode()?39:-1);}}var fe=new Set(["platform","namespace","userOnNs","userGlobal"]),T=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),re=class r{route=g(V);router=g(G);destroyRef=g(Ce);state=g(N);integrationTypeController=g(W);authSettingState=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F(this.isPlatformMode?br(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),type:new _t("",{nonNullable:true,validators:[_e.required]}),scope:new _t("namespace",{nonNullable:true}),autoGrant:new _t(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);scopeOptions=[{value:"platform",label:T.platform},{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];authSettingNameControl=new _t(null);availableAuthSettings=Gi([]);paramsValue=Gi(null);initialParams=Gi(null);integrationTypes=F(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=mT(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){Hf(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(ae=>{this.loadAuthSettingsForScope(ae);});let m=e.get("template");m&&this.hydrateFromTemplate(m);}parseScope(t){return t&&fe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[1,"integration-form__checkbox-row"],["type","checkbox",3,"formControl"],[1,"integration-form__hint"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return n.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Integrations "),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,le,2,0,"p",5)(9,ue,42,12,"form",6),pl()),e&2&&(XE(7),Yg(n.isEditMode()?"Edit integration":"New integration"),XE(),eC(n.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,wt,At,mn,Zn,Xn,Cn,En,nt],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-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-accent)}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__checkbox-row[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}.integration-form__checkbox-row[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{margin:0}.integration-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;line-height:1.4;color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};export{re as IntegrationFormComponent};
1
+ import {v}from'./chunk-B653U1VO.js';import {R}from'./chunk-fpnlNii6.js';import {N}from'./chunk-D0irPb8A.js';import {g,ao as V,G,C as Ce,d8 as W,F,W as br,a as Gi,m as mT,cd as Hf,b as U,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,y as eC,a9 as lC,t as rC,cH as Kw,a3 as VI,S as Sg,a4 as nC,ac as gC,v as bg,z as oC,a6 as UI,a5 as vl,aa as If,ab as wf}from'./main-SMDF5ZWK.js';import'./chunk-D16Dnddi.js';import {n as nt}from'./chunk-lCf3g_UU.js';import'./chunk-DfDtwhe3.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,a as wt,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-YekhGerL.js';import'./chunk-_UW4wTJo.js';import'./chunk-wZXIGLks.js';function le(r,t){r&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function se(r,t){if(r&1&&(ws(0,"label",10),Sg(1,"input",29),VI(),ws(2,"span"),GC(3),pl()()),r&2){let e=t.$implicit,n=gC(2);XE(),bg("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),UI(),XE(2),Yg(e.label);}}function ce(r,t){if(r&1&&(ws(0,"option",16),GC(1),pl()),r&2){let e=t.$implicit;bg("value",e.type),XE(),Yg(e.displayName);}}function me(r,t){if(r&1&&(ws(0,"option",16),GC(1),pl()),r&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function pe(r,t){if(r&1&&(ws(0,"div",11)(1,"label",30),Sg(2,"input",31),VI(),ws(3,"span",9),GC(4,"Grant automatically"),pl()(),ws(5,"p",32),GC(6),pl()()),r&2){let e=gC(2);XE(2),bg("formControl",e.autoGrantControl),UI(),XE(4),vl(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function de(r,t){if(r&1){let e=lC();ws(0,"div",24)(1,"ds-json-schema-form",33),Rg("valueChange",function(s){If(e);let m=gC(2);return wf(m.onParamsChange(s))}),pl()();}if(r&2){let e=gC(2);XE(),bg("schema",t)("value",e.initialParams());}}function ge(r,t){if(r&1){let e=lC();ws(0,"button",34),Rg("click",function(){If(e);let s=gC(2);return wf(s.exportYaml())}),GC(1),pl();}if(r&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ue(r,t){if(r&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let s=gC();return wf(s.submit())}),ws(1,"fieldset",8)(2,"legend",9),GC(3,"Scope"),pl(),rC(4,se,4,4,"label",10,Kw().trackByScope,true),pl(),ws(6,"div",11)(7,"label",12),GC(8,"Type "),ws(9,"span",13),GC(10,"*"),pl()(),ws(11,"select",14)(12,"option",15),GC(13,"Select type"),pl(),rC(14,ce,2,2,"option",16,Kw().trackByType,true),pl(),VI(),pl(),ws(16,"div",11)(17,"label",17),GC(18,"Name "),ws(19,"span",13),GC(20,"*"),pl()(),Sg(21,"input",18),VI(),pl(),ws(22,"div",11)(23,"label",19),GC(24,"Description"),pl(),Sg(25,"textarea",20),VI(),pl(),ws(26,"div",11)(27,"label",21),GC(28,"Auth Setting"),pl(),ws(29,"select",22)(30,"option",23),GC(31,"None"),pl(),rC(32,me,2,2,"option",16,nC),pl(),VI(),pl(),Jw(34,pe,7,2,"div",11),Jw(35,de,2,2,"div",24),ws(36,"div",25)(37,"button",26),GC(38),pl(),Jw(39,ge,2,2,"button",27),ws(40,"button",28),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(41,"Cancel"),pl()()();}if(r&2){let e,n=gC();bg("formGroup",n.form),XE(),bg("disabled",n.isEditMode()),XE(3),oC(n.scopeOptions),XE(7),bg("formControl",n.typeControl),UI(),XE(3),oC(n.integrationTypes()),XE(7),bg("formControl",n.nameControl),UI(),XE(4),bg("formControl",n.descriptionControl),UI(),XE(4),bg("formControl",n.authSettingNameControl),UI(),XE(),bg("ngValue",null),XE(2),oC(n.availableAuthSettings()),XE(2),eC(n.isAutoGrantable()?34:-1),XE(),eC((e=n.schema())?35:-1,e),XE(2),bg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),XE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),XE(),eC(n.isEditMode()?39:-1);}}var fe=new Set(["platform","namespace","userOnNs","userGlobal"]),T=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),re=class r{route=g(V);router=g(G);destroyRef=g(Ce);state=g(N);integrationTypeController=g(W);authSettingState=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F(this.isPlatformMode?br(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),type:new _t("",{nonNullable:true,validators:[_e.required]}),scope:new _t("namespace",{nonNullable:true}),autoGrant:new _t(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);scopeOptions=[{value:"platform",label:T.platform},{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];authSettingNameControl=new _t(null);availableAuthSettings=Gi([]);paramsValue=Gi(null);initialParams=Gi(null);integrationTypes=F(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=mT(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){Hf(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(ae=>{this.loadAuthSettingsForScope(ae);});let m=e.get("template");m&&this.hydrateFromTemplate(m);}parseScope(t){return t&&fe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=xw({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[1,"integration-form__checkbox-row"],["type","checkbox",3,"formControl"],[1,"integration-form__hint"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return n.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Integrations "),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,le,2,0,"p",5)(9,ue,42,12,"form",6),pl()),e&2&&(XE(7),Yg(n.isEditMode()?"Edit integration":"New integration"),XE(),eC(n.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,wt,At,mn,Zn,Xn,Cn,En,nt],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-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-accent)}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__checkbox-row[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}.integration-form__checkbox-row[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{margin:0}.integration-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;line-height:1.4;color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};export{re as IntegrationFormComponent};
@@ -1,4 +1,4 @@
1
- import {Z as Ze,Y as Ye$1,E as Et$1,y as yt$2}from'./chunk-QNhyHoOU.js';import {an as ue,al as vt,g,O as Ot$1,F,r as re,a as Gi,m as mT,R as Re,P,K as c,G,L,U,ap as wd,e as xw,h as hr,j as Gn,bA as yC,J as Jw,k as ws,q as Rg,n as GC,o as pl,bB as vC,S as Sg,y as eC,X as XE,A as Ug,v as bg,T as Tg,bk as yh,a8 as Yg,D as Pg,E as EC,I as IC,aL as wo,aM as Zn$1,aO as wt$1,cb as ZB,N,p as pe,C as Ce,cd as Hf,x,w,b as U$1,ce as _b,Q as By,t as rC,z as oC,aw as hl,bo as tC,ax as gl,b6 as _g,c0 as xg,ad as Hg,a9 as lC,aa as If,ac as gC,ab as wf,ai as tm,aj as KC,a3 as VI,ak as em,a6 as UI,af as Eg,ag as fT,a5 as vl,aG as fe,ae as kt$1,cf as _,Y as x$1,u as CC,cg as iT,ch as Ng,b4 as oT}from'./main-WPRRV3C7.js';import {W}from'./chunk-BdO-nXjF.js';import {T as Tn$1,c as ce}from'./chunk-CAp_lfVu.js';import {u as ui,a as me,f as fi,Y as Yt$1,H as He,V as Ve,n as ne}from'./chunk-WkmNSaSs.js';import {t as ti,Y as Ye,Z as Zn,c as cn$1,y as yt$1,w as wt,X as Xt$1}from'./chunk-Df3PzhTd.js';var bt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=wo({type:n});static \u0275inj=Zn$1({imports:[wt$1]})}return n})();var Tt=(n,t)=>({subThreads:n,depth:t}),Ot=n=>({subThreads:n,depth:1}),xt=(n,t)=>t.id,kt=(n,t)=>t.label;function Et(n,t){if(n&1){let e=lC();ws(0,"mat-icon",10),Rg("click",function(o){If(e);let s=gC().$implicit,f=gC(3);return wf(f.toggleSubThreads(o,s.id))}),GC(1),pl();}if(n&2){let e=gC().$implicit,i=gC(3);XE(),Yg(i.isParentExpanded(e.id)?"expand_more":"chevron_right");}}function Dt(n,t){n&1&&Ng(0);}function Nt(n,t){if(n&1&&Eg(0,Dt,1,0,"ng-container",11),n&2){let e=gC().$implicit,i=gC().depth;gC();let o=CC(1);bg("ngTemplateOutlet",o)("ngTemplateOutletContext",iT(2,Tt,e.subThreads,i+1));}}function jt(n,t){if(n&1){let e=lC();ws(0,"div",5)(1,"a",6),Rg("click",function(o){let s=If(e).$implicit;return gC(3).selectThread(s.id),wf(o.preventDefault())})("keydown.enter",function(o){let s=If(e).$implicit;return gC(3).selectThread(s.id),wf(o.preventDefault())})("keydown.space",function(o){let s=If(e).$implicit;return gC(3).selectThread(s.id),wf(o.preventDefault())}),Jw(2,Et,2,1,"mat-icon",7),ws(3,"span",8),GC(4),pl(),ws(5,"span",9),GC(6),pl()()(),Jw(7,Nt,1,5,"ng-container");}if(n&2){let e=t.$implicit,i=gC().depth,o=gC(2);Hg("--sub-depth",i),Ug("current",e.id===o.currentThread()?.id),XE(2),eC(e.subThreads?.length?2:-1),XE(2),Yg(e.delegatedAgentName||"Agent"),XE(2),Yg(e.delegatedTask||e.name),XE(),eC(o.isParentExpanded(e.id)&&e.subThreads?.length?7:-1);}}function Vt(n,t){if(n&1&&rC(0,jt,8,8,null,null,xt),n&2){let e=t.subThreads;oC(e);}}function Ft(n,t){n&1&&(ws(0,"div",4),Sg(1,"span",12),ws(2,"span",13),GC(3,"Loading threads..."),pl()());}function It(n,t){if(n&1&&(ws(0,"div",27),GC(1),pl()),n&2){let e=gC(6);XE(),Yg(e.renameErrorMessage);}}function zt(n,t){if(n&1){let e=lC();ws(0,"div",18)(1,"input",26),tm("ngModelChange",function(o){If(e);let s=gC(5);return KC(s.editingThreadName,o)||(s.editingThreadName=o),wf(o)}),Rg("keydown",function(o){If(e);let s=gC(5);return wf(s.onEditKeydown(o))})("blur",function(){If(e);let o=gC(5);return wf(o.onEditBlur())})("click",function(o){return o.stopPropagation()}),pl(),VI(),Jw(2,It,2,1,"div",27),pl();}if(n&2){let e=gC(5);XE(),em("ngModel",e.editingThreadName),bg("disabled",e.isRenamingThread),UI(),XE(),eC(e.renameErrorMessage?2:-1);}}function At(n,t){if(n&1){let e=lC();ws(0,"mat-icon",10),Rg("click",function(o){If(e);let s=gC(2).$implicit,f=gC(4);return wf(f.toggleSubThreads(o,s.id))}),GC(1),pl();}if(n&2){let e=gC(2).$implicit,i=gC(4);XE(),Yg(i.isParentExpanded(e.id)?"expand_more":"chevron_right");}}function Lt(n,t){if(n&1&&(ws(0,"span",29),GC(1),pl()),n&2){let e=gC(2).$implicit;XE(),Yg(e.name);}}function Rt(n,t){n&1&&(Sg(0,"mat-spinner",31),ws(1,"span",32),GC(2,"Generating name..."),pl()),n&2&&bg("diameter",16);}function $t(n,t){n&1&&(ws(0,"mat-icon",30),GC(1,"group"),pl());}function Bt(n,t){if(n&1){let e=lC();ws(0,"a",28),Rg("click",function(o){If(e);let s=gC().$implicit;return gC(4).selectThread(s.id),wf(o.preventDefault())})("keydown.enter",function(o){If(e);let s=gC().$implicit;return gC(4).selectThread(s.id),wf(o.preventDefault())})("keydown.space",function(o){If(e);let s=gC().$implicit;return gC(4).selectThread(s.id),wf(o.preventDefault())}),Jw(1,At,2,1,"mat-icon",7),Jw(2,Lt,2,1,"span",29)(3,Rt,3,1),Jw(4,$t,2,0,"mat-icon",30),pl();}if(n&2){let e=gC().$implicit,i=gC(4);bg("matTooltip",e.name?e.name+`
1
+ import {Z as Ze,Y as Ye$1,E as Et$1,y as yt$2}from'./chunk-BKIl2dle.js';import {an as ue,al as vt,g,O as Ot$1,F,r as re,a as Gi,m as mT,R as Re,P,K as c,G,L,U,ap as wd,e as xw,h as hr,j as Gn,bA as yC,J as Jw,k as ws,q as Rg,n as GC,o as pl,bB as vC,S as Sg,y as eC,X as XE,A as Ug,v as bg,T as Tg,bk as yh,a8 as Yg,D as Pg,E as EC,I as IC,aL as wo,aM as Zn$1,aO as wt$1,cb as ZB,N,p as pe,C as Ce,cd as Hf,x,w,b as U$1,ce as _b,Q as By,t as rC,z as oC,aw as hl,bo as tC,ax as gl,b6 as _g,c0 as xg,ad as Hg,a9 as lC,aa as If,ac as gC,ab as wf,ai as tm,aj as KC,a3 as VI,ak as em,a6 as UI,af as Eg,ag as fT,a5 as vl,aG as fe,ae as kt$1,cf as _,Y as x$1,u as CC,cg as iT,ch as Ng,b4 as oT}from'./main-SMDF5ZWK.js';import {W}from'./chunk-CAmjRPRv.js';import {T as Tn$1,c as ce}from'./chunk-BFyw66tP.js';import {u as ui,a as me,f as fi,Y as Yt$1,H as He,V as Ve,n as ne}from'./chunk-DfDtwhe3.js';import {t as ti,Y as Ye,Z as Zn,c as cn$1,y as yt$1,w as wt,X as Xt$1}from'./chunk-YekhGerL.js';var bt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=wo({type:n});static \u0275inj=Zn$1({imports:[wt$1]})}return n})();var Tt=(n,t)=>({subThreads:n,depth:t}),Ot=n=>({subThreads:n,depth:1}),xt=(n,t)=>t.id,kt=(n,t)=>t.label;function Et(n,t){if(n&1){let e=lC();ws(0,"mat-icon",10),Rg("click",function(o){If(e);let s=gC().$implicit,f=gC(3);return wf(f.toggleSubThreads(o,s.id))}),GC(1),pl();}if(n&2){let e=gC().$implicit,i=gC(3);XE(),Yg(i.isParentExpanded(e.id)?"expand_more":"chevron_right");}}function Dt(n,t){n&1&&Ng(0);}function Nt(n,t){if(n&1&&Eg(0,Dt,1,0,"ng-container",11),n&2){let e=gC().$implicit,i=gC().depth;gC();let o=CC(1);bg("ngTemplateOutlet",o)("ngTemplateOutletContext",iT(2,Tt,e.subThreads,i+1));}}function jt(n,t){if(n&1){let e=lC();ws(0,"div",5)(1,"a",6),Rg("click",function(o){let s=If(e).$implicit;return gC(3).selectThread(s.id),wf(o.preventDefault())})("keydown.enter",function(o){let s=If(e).$implicit;return gC(3).selectThread(s.id),wf(o.preventDefault())})("keydown.space",function(o){let s=If(e).$implicit;return gC(3).selectThread(s.id),wf(o.preventDefault())}),Jw(2,Et,2,1,"mat-icon",7),ws(3,"span",8),GC(4),pl(),ws(5,"span",9),GC(6),pl()()(),Jw(7,Nt,1,5,"ng-container");}if(n&2){let e=t.$implicit,i=gC().depth,o=gC(2);Hg("--sub-depth",i),Ug("current",e.id===o.currentThread()?.id),XE(2),eC(e.subThreads?.length?2:-1),XE(2),Yg(e.delegatedAgentName||"Agent"),XE(2),Yg(e.delegatedTask||e.name),XE(),eC(o.isParentExpanded(e.id)&&e.subThreads?.length?7:-1);}}function Vt(n,t){if(n&1&&rC(0,jt,8,8,null,null,xt),n&2){let e=t.subThreads;oC(e);}}function Ft(n,t){n&1&&(ws(0,"div",4),Sg(1,"span",12),ws(2,"span",13),GC(3,"Loading threads..."),pl()());}function It(n,t){if(n&1&&(ws(0,"div",27),GC(1),pl()),n&2){let e=gC(6);XE(),Yg(e.renameErrorMessage);}}function zt(n,t){if(n&1){let e=lC();ws(0,"div",18)(1,"input",26),tm("ngModelChange",function(o){If(e);let s=gC(5);return KC(s.editingThreadName,o)||(s.editingThreadName=o),wf(o)}),Rg("keydown",function(o){If(e);let s=gC(5);return wf(s.onEditKeydown(o))})("blur",function(){If(e);let o=gC(5);return wf(o.onEditBlur())})("click",function(o){return o.stopPropagation()}),pl(),VI(),Jw(2,It,2,1,"div",27),pl();}if(n&2){let e=gC(5);XE(),em("ngModel",e.editingThreadName),bg("disabled",e.isRenamingThread),UI(),XE(),eC(e.renameErrorMessage?2:-1);}}function At(n,t){if(n&1){let e=lC();ws(0,"mat-icon",10),Rg("click",function(o){If(e);let s=gC(2).$implicit,f=gC(4);return wf(f.toggleSubThreads(o,s.id))}),GC(1),pl();}if(n&2){let e=gC(2).$implicit,i=gC(4);XE(),Yg(i.isParentExpanded(e.id)?"expand_more":"chevron_right");}}function Lt(n,t){if(n&1&&(ws(0,"span",29),GC(1),pl()),n&2){let e=gC(2).$implicit;XE(),Yg(e.name);}}function Rt(n,t){n&1&&(Sg(0,"mat-spinner",31),ws(1,"span",32),GC(2,"Generating name..."),pl()),n&2&&bg("diameter",16);}function $t(n,t){n&1&&(ws(0,"mat-icon",30),GC(1,"group"),pl());}function Bt(n,t){if(n&1){let e=lC();ws(0,"a",28),Rg("click",function(o){If(e);let s=gC().$implicit;return gC(4).selectThread(s.id),wf(o.preventDefault())})("keydown.enter",function(o){If(e);let s=gC().$implicit;return gC(4).selectThread(s.id),wf(o.preventDefault())})("keydown.space",function(o){If(e);let s=gC().$implicit;return gC(4).selectThread(s.id),wf(o.preventDefault())}),Jw(1,At,2,1,"mat-icon",7),Jw(2,Lt,2,1,"span",29)(3,Rt,3,1),Jw(4,$t,2,0,"mat-icon",30),pl();}if(n&2){let e=gC().$implicit,i=gC(4);bg("matTooltip",e.name?e.name+`
2
2
 
3
3
  `+(e.summary||""):e.summary||"")("matTooltipDisabled",!e.summary),XE(),eC(e.subThreads?.length?1:-1),XE(),eC(e.name?2:3),XE(2),eC(i.isSharedThread(e)?4:-1);}}function Ut(n,t){if(n&1){let e=lC();ws(0,"button",33),Rg("click",function(o){If(e);let s=gC().$implicit,f=gC(4);return wf(f.startEditingThreadName(o,s))}),ws(1,"mat-icon"),GC(2,"edit"),pl()();}}function Xt(n,t){if(n&1){let e=lC();ws(0,"button",34),Rg("click",function(o){If(e);let s=gC().$implicit,f=gC(4);return wf(f.markActive(o,s))}),ws(1,"mat-icon"),GC(2,"replay"),pl()();}}function Qt(n,t){if(n&1){let e=lC();ws(0,"button",35),Rg("click",function(o){If(e);let s=gC().$implicit,f=gC(4);return wf(f.markDone(o,s))}),ws(1,"mat-icon"),GC(2,"check_circle_outline"),pl()();}}function Gt(n,t){n&1&&Ng(0);}function Ht(n,t){if(n&1&&Eg(0,Gt,1,0,"ng-container",11),n&2){let e=gC().$implicit;gC(3);let i=CC(1);bg("ngTemplateOutlet",i)("ngTemplateOutletContext",oT(2,Ot,e.subThreads));}}function qt(n,t){if(n&1){let e=lC();ws(0,"div",17),Jw(1,zt,3,3,"div",18)(2,Bt,5,5,"a",19),ws(3,"div",20),Jw(4,Ut,3,0,"button",21),Jw(5,Xt,3,0,"button",22)(6,Qt,3,0,"button",23),ws(7,"button",24),Rg("click",function(o){let s=If(e).$implicit,f=gC(4);return wf(f.toggleStar(o,s))}),ws(8,"mat-icon"),GC(9),pl()(),ws(10,"button",25),Rg("click",function(o){let s=If(e).$implicit,f=gC(4);return wf(f.deleteThread(o,s))}),ws(11,"mat-icon"),GC(12,"delete"),pl()()()(),Jw(13,Ht,1,4,"ng-container");}if(n&2){let e=t.$implicit,i=gC(4);Ug("current",e.id===i.currentThread()?.id),XE(),eC(i.editingThreadId===e.id?1:2),XE(3),eC(i.editingThreadId!==e.id&&e.name?4:-1),XE(),eC(e.closedByUser?5:6),XE(2),Ug("starred",i.isStarred(e)),bg("title",i.isStarred(e)?"Unstar thread":"Star thread"),XE(2),Yg(i.isStarred(e)?"star":"star_outline"),XE(4),eC(i.isParentExpanded(e.id)&&e.subThreads?.length?13:-1);}}function Wt(n,t){if(n&1&&(ws(0,"div",14)(1,"div",16),GC(2),pl(),rC(3,qt,14,10,null,null,xt),pl()),n&2){let e=t.$implicit;XE(2),Yg(e.label),XE(),oC(e.threads);}}function Jt(n,t){n&1&&(ws(0,"div",15),GC(1,"No existing threads"),pl());}function Yt(n,t){if(n&1&&(ws(0,"div",15),GC(1),pl()),n&2){let e=gC(3);XE(),vl('No threads matching "',e.searchQuery(),'"');}}function Zt(n,t){if(n&1&&(rC(0,Wt,5,1,"div",14,kt),Jw(2,Jt,2,0,"div",15)(3,Yt,2,1,"div",15)),n&2){let e=gC(2);oC(e.getGroupedThreads()),XE(2),eC(!e.threads()?.length&&!e.searchQuery()?2:e.searchQuery()&&e.getGroupedThreads().length===0?3:-1);}}function Kt(n,t){if(n&1&&(Eg(0,Vt,2,0,"ng-template",null,0,fT),ws(2,"div",3),Jw(3,Ft,4,0,"div",4)(4,Zt,4,1),pl()),n&2){let e=gC();XE(3),eC(e.isLoadingThreadList()?3:4);}}function en(n,t){n&1&&(ws(0,"span",36),GC(1,"No project selected"),pl());}function tn(n,t){n&1&&(ws(0,"span",36),GC(1,"Loading..."),pl());}function nn(n,t){if(n&1&&(ws(0,"div",2),Jw(1,en,2,0,"span",36)(2,tn,2,0,"span",36),pl()),n&2){let e=gC();XE(),eC(e.currentProject()?.name?2:1);}}var we=class n{projects=null;searchMode=false;searchQuery=ZB("");searchModeChange=new vt;threadSelected=new vt;projectStateService=g(P);threadStateService=g(U);threadApiService=g(N);userService=g(pe);router=g(G);destroyRef=g(Ce);currentThread=F(this.threadStateService.selectedThread$);currentProject=F(this.projectStateService.selectedProject$);threads=F(this.threadStateService.threadList$);isLoadingThreadList=F(this.threadStateService.isLoadingThreadList$);username=F(this.userService.username$);isTouchDevice="ontouchstart"in window||navigator.maxTouchPoints>0;editingThreadId=null;editingThreadName="";isRenamingThread=false;renameErrorMessage="";expandedParents=new Set;constructor(){Hf(()=>{let t=this.currentThread()?.id,e=this.threads();if(!t||!e?.length)return;let i=new Map;for(let s of e)s.parentThreadId&&i.set(s.id,s.parentThreadId);let o=t;for(;o;){let s=i.get(o);s&&this.expandedParents.add(s),o=s;}});}ngOnInit(){this.userService.fetchCurrentUser().subscribe({error:t=>{console.error("[THREAD-SELECTOR] Failed to load current user:",t);}});}selectThread(t){this.threadStateService.selectThread(t),this.threadSelected.emit(),this.router.navigate(["project",this.currentProject()?.name,"thread",t]);}getGroupedThreads(){let t=this.threads();if(!t?.length)return [];let e=new Set(t.map(h=>h.id)),i=t.filter(h=>!h.parentThreadId),o=t.filter(h=>!!h.parentThreadId),s=o.filter(h=>!e.has(h.parentThreadId)),f=o.filter(h=>e.has(h.parentThreadId)),A=new Map;for(let h of f){let O=h.parentThreadId;A.has(O)||A.set(O,[]),A.get(O).push(h);}let J=h=>(A.get(h)||[]).sort((j,I)=>j.modifiedDate>I.modifiedDate?-1:1).map(j=>x(w({},j),{subThreads:J(j.id)})),L=[...i,...s];if(this.searchQuery()&&this.searchQuery().trim()){let h=this.searchQuery().toLowerCase().trim();L=L.filter(O=>O.name.toLowerCase().includes(h)||O.summary&&O.summary.toLowerCase().includes(h));}if(!L.length)return [];let R=this.username();if(!R)return [];let Ie=L.map(h=>x(w({},h),{subThreads:J(h.id)})),ze=Ie.filter(h=>h.starring&&h.starring.includes(R)),Mt=Ie.filter(h=>!h.starring||!h.starring.includes(R)),Y=new Map,Ae=new Date;Ae.setHours(0,0,0,0);for(let h of Mt){let O=new Date(h.modifiedDate);O.setHours(0,0,0,0);let j=Ae.getTime()-O.getTime(),I=Math.floor(j/(1e3*60*60*24)),D;I===0?D="Today":I===1?D="Yesterday":I<7?D="This Week":I<30?D="This Month":I<90?D="Last 3 Months":D="Older",Y.has(D)||Y.set(D,[]),Y.get(D).push(h);}let Ee=[];if(ze.length>0){let h=[...ze].sort((O,j)=>O.modifiedDate>j.modifiedDate?-1:1);Ee.push({label:"Starred",threads:h});}return ["Today","Yesterday","This Week","This Month","Last 3 Months","Older"].filter(h=>Y.has(h)).forEach(h=>{Ee.push({label:h,threads:Y.get(h)});}),Ee}isParentExpanded(t){return this.expandedParents.has(t)}toggleSubThreads(t,e){t.stopPropagation(),this.expandedParents.has(e)?this.expandedParents.delete(e):this.expandedParents.add(e);}isSubThread(t){return !!t.parentThreadId}isSharedThread(t){return t.users&&t.users.length>1}isStarred(t){let e=this.username();return !!e&&t.starring&&t.starring.includes(e)}toggleStar(t,e){t.stopPropagation();let i=this.username();if(!i)return;let o=e.starring&&e.starring.includes(i),s=o?this.threadApiService.unstarThread(e.id):this.threadApiService.starThread(e.id);this.threadStateService.updateStarLocal(e.id,!o,i),s.pipe(U$1(this.destroyRef)).subscribe({next:()=>{},error:f=>{console.error("Error toggling star:",f),this.threadStateService.refreshThreadList();}});}markDone(t,e){t.stopPropagation(),this.threadStateService.markDone(e.id);}markActive(t,e){t.stopPropagation(),this.threadStateService.markActive(e.id);}deleteThread(t,e){t.stopPropagation();let i=this.currentProject()?.name;!i||!confirm(`Are you sure you want to delete the thread "${e.name}"?`)||this.threadApiService.deleteThread(e.id).subscribe({next:()=>{this.currentThread()?.id===e.id&&(this.threadStateService.clearSelection(),this.router.navigate(["project",i])),this.threadStateService.refreshThreadList();},error:s=>{console.error("Error deleting thread:",s),alert("Failed to delete thread. Please try again.");}});}formatDate(t){try{let e=new Date(t),o=new Date().getTime()-e.getTime(),s=Math.floor(o/(1e3*60*60*24));return s===0?"Today":s===1?"Yesterday":s<7?`${s} days ago`:e.toLocaleDateString("en-EN",{day:"numeric",month:"short"})}catch(e){return "No date"}}startEditingThreadName(t,e){t.stopPropagation(),this.editingThreadId=e.id,this.editingThreadName=e.name||"",this.renameErrorMessage="",setTimeout(()=>{let i=document.querySelector(".thread-name-input");i&&(i.focus(),i.select());},0);}cancelEditingThreadName(){this.editingThreadId=null,this.editingThreadName="",this.renameErrorMessage="";}saveThreadName(t){if(t&&t.stopPropagation(),!this.editingThreadId)return;let e=this.editingThreadName.trim();if(!e){this.renameErrorMessage="Thread name cannot be empty";return}if(e.length>200){this.renameErrorMessage="Thread name is too long (max 200 characters)";return}let i=this.editingThreadId;this.isRenamingThread=true,this.renameErrorMessage="",this.threadStateService.renameThread(i,e).subscribe({next:()=>{console.log("[THREAD-SELECTOR] Thread renamed successfully"),this.cancelEditingThreadName(),this.isRenamingThread=false;},error:o=>{console.error("[THREAD-SELECTOR] Error renaming thread:",o),this.renameErrorMessage=o.message||"Failed to rename thread",this.isRenamingThread=false;}});}onEditKeydown(t){t.key==="Enter"?(t.preventDefault(),t.stopPropagation(),this.saveThreadName()):t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),this.cancelEditingThreadName());}onEditBlur(){setTimeout(()=>{this.editingThreadId&&!this.isRenamingThread&&this.saveThreadName();},200);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["app-thread-selector"]],inputs:{searchMode:"searchMode",searchQuery:[1,"searchQuery"]},outputs:{searchModeChange:"searchModeChange",threadSelected:"threadSelected"},decls:3,vars:1,consts:[["subThreadTemplate",""],["tabindex","0","role","application","aria-label","Thread selector",1,"thread-selector",3,"click","keydown"],[1,"thread-disabled"],["role","menu","aria-label","Thread selection",1,"thread-list"],[1,"thread-loading"],[1,"thread-item-wrapper","sub-thread"],["role","menuitem","tabindex","0",1,"thread-item","sub-thread-item",3,"click","keydown.enter","keydown.space"],[1,"sub-thread-toggle"],[1,"sub-thread-agent"],[1,"sub-thread-task"],[1,"sub-thread-toggle",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"loading-spinner"],[1,"loading-text"],[1,"thread-group"],[1,"thread-empty"],[1,"thread-group-header"],[1,"thread-item-wrapper"],[1,"thread-name-edit-wrapper"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"matTooltip","matTooltipDisabled"],[1,"action-buttons"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button"],["mat-icon-button","","title","Mark as active","type","button",1,"action-button","mark-active-button"],["mat-icon-button","","title","Mark as done","type","button",1,"action-button","mark-done-button"],["mat-icon-button","","type","button",1,"action-button","star-button",3,"click","title"],["mat-icon-button","","title","Delete thread","type","button",1,"action-button","delete-button",3,"click"],["type","text","maxlength","200",1,"thread-name-input",3,"ngModelChange","keydown","blur","click","ngModel","disabled"],[1,"rename-error"],["matTooltipShowDelay","1000","role","menuitem","tabindex","0",1,"thread-item",3,"click","keydown.enter","keydown.space","matTooltip","matTooltipDisabled"],[1,"thread-name"],["matTooltip","Shared thread",1,"shared-indicator"],[1,"thread-name-spinner",3,"diameter"],[1,"thread-name","thread-name-generating"],["mat-icon-button","","title","Rename thread","type","button",1,"action-button","edit-button",3,"click"],["mat-icon-button","","title","Mark as active","type","button",1,"action-button","mark-active-button",3,"click"],["mat-icon-button","","title","Mark as done","type","button",1,"action-button","mark-done-button",3,"click"],[1,"disabled-text"]],template:function(e,i){e&1&&(ws(0,"div",1),Rg("click",function(s){return s.stopPropagation()})("keydown",function(s){return s.stopPropagation()}),Jw(1,Kt,5,1)(2,nn,3,1,"div",2),pl()),e&2&&(XE(),eC(i.currentProject()?.name?1:2));},dependencies:[_b,ti,Ye,Zn,Xt$1,cn$1,yt$1,wt,hr,Gn,Tn$1,ce,Et$1,yt$2,Ve,ne],styles:[".thread-selector[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1;min-height:0;overflow-x:hidden;overflow-y:auto}.thread-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:0;max-height:none;overflow:visible}.thread-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-bottom:.5rem}.thread-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.thread-group-header[_ngcontent-%COMP%]{padding:.5rem 1rem .25rem;font-size:.75rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.5px;position:sticky;top:0;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);z-index:1}.thread-item-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;position:relative;width:100%;border-radius:0;min-width:0;gap:.25rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%]{display:flex}.thread-item-wrapper.current[_ngcontent-%COMP%]{background:var(--color-primary-light)}.thread-item-wrapper.current[_ngcontent-%COMP%] .thread-item[_ngcontent-%COMP%]{color:var(--color-primary-text);font-weight:600}.thread-item[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1;min-width:0;padding:.75rem 1rem;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);text-align:left;justify-content:flex-start}.thread-item.new-thread-item[_ngcontent-%COMP%]{margin-bottom:.25rem}.thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.action-buttons[_ngcontent-%COMP%]{display:none;align-items:center;gap:.25rem;flex-shrink:0;margin-right:.5rem}.thread-item-wrapper[_ngcontent-%COMP%]:hover .action-buttons[_ngcontent-%COMP%], .thread-item-wrapper.current[_ngcontent-%COMP%] .action-buttons[_ngcontent-%COMP%]{display:flex}.action-button[_ngcontent-%COMP%]{flex-shrink:0;border-radius:4px!important;width:28px!important;height:28px!important;padding:0!important}.action-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple{border-radius:4px!important}.action-button[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)!important}.action-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.action-button.edit-button[_ngcontent-%COMP%]:hover{background-color:var(--color-primary-hover)!important}.action-button.edit-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.action-button.star-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:color .2s ease}.action-button.star-button.starred[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.star-button[_ngcontent-%COMP%]:not(.starred):hover mat-icon[_ngcontent-%COMP%]{color:#fbbf24}.action-button.delete-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:#ef4444}.action-button.mark-done-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:#22c55e}.action-button.mark-active-button[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.875rem;font-weight:400;padding:0 1rem;min-width:0}.thread-link[_ngcontent-%COMP%]:hover:not(.new-thread-link){color:var(--color-primary-hover, var(--color-primary));text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:3px}.thread-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.thread-link.new-thread-link[_ngcontent-%COMP%]{margin-bottom:.5rem;font-weight:600;font-size:.95rem}.thread-link.new-thread-link[_ngcontent-%COMP%] .thread-name[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.thread-link.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0 center}50%{background-position:100% center}to{background-position:0 center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.thread-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}.thread-name.thread-name-generating[_ngcontent-%COMP%]{color:var(--color-text-muted);font-style:italic}.thread-name-edit-wrapper[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:0 .5rem}.thread-name-input[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-bg-secondary);color:var(--color-text-primary);font-size:.9rem;font-family:inherit}.thread-name-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 2px #3b82f61a}.thread-name-input[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.rename-error[_ngcontent-%COMP%]{color:var(--color-error);font-size:.75rem;margin-top:.25rem;padding-left:.5rem}.thread-name-spinner[_ngcontent-%COMP%]{flex-shrink:0;margin-right:.5rem}.thread-name-spinner[_ngcontent-%COMP%] .mat-mdc-progress-spinner circle{stroke:var(--color-primary)!important}.current-indicator[_ngcontent-%COMP%]{color:var(--color-success);font-weight:700;flex-shrink:0;font-size:1rem}.thread-separator[_ngcontent-%COMP%]{height:1px;background:var(--color-border);margin:.25rem 0}.thread-empty[_ngcontent-%COMP%]{padding:1.5rem 1rem;text-align:center;color:var(--color-text-muted);font-size:.8rem;font-style:italic}.thread-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1rem;gap:.75rem}.thread-loading[_ngcontent-%COMP%] .loading-spinner[_ngcontent-%COMP%]{width:24px;height:24px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}.thread-loading[_ngcontent-%COMP%] .loading-text[_ngcontent-%COMP%]{color:var(--color-text-muted);font-size:.8rem}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.thread-disabled[_ngcontent-%COMP%]{padding:1.5rem 1rem}.thread-disabled[_ngcontent-%COMP%] .disabled-text[_ngcontent-%COMP%]{display:block;color:var(--color-text-muted);font-size:.85rem;font-style:italic;text-align:center}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%]{padding-left:calc(.2rem + var(--sub-depth, 1) * 1.5rem);border-left:2px solid var(--color-primary, #3b82f6);margin-left:.75rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]{padding:.35rem .5rem .35rem 0;gap:.2rem;font-size:.8rem;color:var(--color-text-secondary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-item[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-agent[_ngcontent-%COMP%]{font-weight:600;color:var(--color-primary);white-space:nowrap;flex-shrink:0;font-size:.8rem}.thread-item-wrapper.sub-thread[_ngcontent-%COMP%] .sub-thread-task[_ngcontent-%COMP%]{color:var(--color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.75rem}.sub-thread-toggle[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex-shrink:0;cursor:pointer;color:var(--color-text-secondary);margin-right:.25rem}.sub-thread-toggle[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.shared-indicator[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;color:var(--color-text-secondary);flex-shrink:0;margin-left:.25rem}@media(max-width:768px){.thread-item[_ngcontent-%COMP%]{padding:.6rem .8rem}.thread-name[_ngcontent-%COMP%]{font-size:.8rem}}"],changeDetection:1})};var on=["logsContent"],rn=(n,t)=>t.name;function an(n,t){if(n&1){let e=lC();ws(0,"button",12),Rg("click",function(){If(e);let o=gC().$implicit,s=gC();return wf(s.start(o.name))}),ws(1,"mat-icon"),GC(2,"play_arrow"),pl()();}if(n&2){let e=gC().$implicit;bg("disabled",e.isLoading);}}function sn(n,t){if(n&1){let e=lC();ws(0,"button",13),Rg("click",function(){If(e);let o=gC().$implicit,s=gC();return wf(s.stop(o.name))}),ws(1,"mat-icon"),GC(2,"stop"),pl()();}if(n&2){let e=gC().$implicit;bg("disabled",e.isLoading);}}function cn(n,t){if(n&1&&(ws(0,"a",8)(1,"mat-icon",14),GC(2,"open_in_new"),pl()()),n&2){let e=gC().$implicit;bg("href",e.url,yh)("title",e.url);}}function ln(n,t){if(n&1&&(ws(0,"div",15),GC(1),pl()),n&2){let e=gC(),i=e.$implicit,o=e.$index;Hg("order",o*2),XE(),Yg(i.errorMessage);}}function dn(n,t){if(n&1){let e=lC();ws(0,"button",21),Rg("click",function(){If(e);let o=gC(3);return wf(o.onManualRefresh())}),ws(1,"mat-icon"),GC(2,"refresh"),pl()();}}function mn(n,t){if(n&1&&(ws(0,"div",16)(1,"div",17)(2,"span",18),GC(3),pl(),Jw(4,dn,3,0,"button",19),pl(),ws(5,"pre",20,0),GC(7),pl()()),n&2){let e=gC(),i=e.$implicit,o=e.$index,s=gC();Hg("order",o*2+1),XE(3),vl("",i.name," logs"),XE(),eC(i.status==="running"?4:-1),XE(3),Yg(s.logs()||"(empty)");}}function pn(n,t){if(n&1){let e=lC();ws(0,"div",2)(1,"span",3),GC(2),pl(),ws(3,"div",4),Jw(4,an,3,1,"button",5)(5,sn,3,1,"button",6),ws(6,"span",7),GC(7),pl(),Jw(8,cn,3,2,"a",8),ws(9,"button",9),Rg("click",function(){let o=If(e).$implicit,s=gC();return wf(s.toggleLogs(o.name))}),ws(10,"mat-icon"),GC(11),pl()()()(),Jw(12,ln,2,3,"div",10),Jw(13,mn,8,5,"div",11);}if(n&2){let e=t.$implicit,i=t.$index,o=gC();Hg("order",i*2),XE(2),Yg(e.name),XE(2),eC(e.status==="stopped"?4:5),XE(2),Ug("running",e.status==="running"),XE(),vl(" ",e.status==="running"?"Running":"Stopped"," "),XE(),eC(e.url?8:-1),XE(),bg("title",o.logsOpenFor()===e.name?"Hide logs":"Show logs"),XE(2),Yg(o.logsOpenFor()===e.name?"expand_less":"terminal"),XE(),eC(e.errorMessage?12:-1),XE(),eC(o.logsOpenFor()===e.name?13:-1);}}var Te=class n{destroyRef=g(Ce);projectApi=g(c);projectName=ZB.required();entryStates=Gi([]);hasPreview=mT(()=>this.entryStates().length>0);logsOpenFor=Gi(null);logs=Gi("");logsContent;logsPollTimer=null;logsTimeoutTimer=null;static LOGS_POLL_MS=5e3;static LOGS_TIMEOUT_MS=1200*1e3;constructor(){Hf(()=>{let t=this.projectName();t&&this.onProjectChanged(t);},{}),Hf(()=>{console.log("entry states",this.entryStates());});}ngOnDestroy(){this.stopLogPolling();}onProjectChanged(t){this.stopLogPolling(),this.entryStates.set([]),this.logsOpenFor.set(null),this.logs.set(""),this.projectApi.getPreviewEntries(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let i=e.entries;if(i.length===0)return;let o=i.map(f=>({name:f.name,command:f.command,url:f.url,status:"stopped",isLoading:false,errorMessage:""}));this.entryStates.set(o);let s=i.map(f=>this.projectApi.getPreviewStatus(t,f.name));By(s).pipe(U$1(this.destroyRef)).subscribe({next:f=>{this.entryStates.update(A=>A.map((J,L)=>{let R=f[L];return R?x(w({},J),{status:R.status}):J}));},error:()=>{}});},error:()=>{}});}start(t){this.updateEntry(t,{isLoading:true,errorMessage:""}),this.projectApi.startPreview(this.projectName(),t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.updateEntry(t,{status:e.status,isLoading:false});},error:e=>{this.updateEntry(t,{errorMessage:e?.error?.error??"Failed to start preview",isLoading:false});}});}stop(t){this.updateEntry(t,{isLoading:true,errorMessage:""}),this.projectApi.stopPreview(this.projectName(),t).pipe(U$1(this.destroyRef)).subscribe({next:()=>{this.updateEntry(t,{status:"stopped",isLoading:false}),this.logsOpenFor()===t&&this.stopLogPolling();},error:e=>{this.updateEntry(t,{errorMessage:e?.error?.error??"Failed to stop preview",isLoading:false});}});}toggleLogs(t){this.logsOpenFor()===t?(this.logsOpenFor.set(null),this.logs.set(""),this.stopLogPolling()):(this.logsOpenFor.set(t),this.refreshLogs(),this.startLogPolling());}onManualRefresh(){this.refreshLogs(),this.logsPollTimer&&this.resetLogsTimeout();}refreshLogs(){let t=this.logsOpenFor();t&&this.projectApi.getPreviewLogs(this.projectName(),t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.logs.set(e.logs),this.scrollLogsToBottom();},error:()=>this.logs.set("(failed to load logs)")});}updateEntry(t,e){this.entryStates.update(i=>i.map(o=>o.name===t?w(w({},o),e):o));}startLogPolling(){this.stopLogPolling(),this.logsPollTimer=setInterval(()=>{this.logsOpenFor()?this.refreshLogs():this.stopLogPolling();},n.LOGS_POLL_MS),this.resetLogsTimeout();}stopLogPolling(){this.logsPollTimer&&(clearInterval(this.logsPollTimer),this.logsPollTimer=null),this.logsTimeoutTimer&&(clearTimeout(this.logsTimeoutTimer),this.logsTimeoutTimer=null);}resetLogsTimeout(){this.logsTimeoutTimer&&clearTimeout(this.logsTimeoutTimer),this.logsTimeoutTimer=setTimeout(()=>{this.stopLogPolling();},n.LOGS_TIMEOUT_MS);}scrollLogsToBottom(){setTimeout(()=>{let t=this.logsContent?.nativeElement;t&&(t.scrollTop=t.scrollHeight);});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["app-preview-panel"]],viewQuery:function(e,i){if(e&1&&Pg(on,5),e&2){let o;EC(o=IC())&&(i.logsContent=o.first);}},inputs:{projectName:[1,"projectName"]},decls:3,vars:0,consts:[["logsContent",""],[1,"preview-panel"],[1,"entry-row"],[1,"entry-name"],[1,"entry-actions"],["mat-icon-button","","title","Start","type","button",1,"entry-btn","start",3,"disabled"],["mat-icon-button","","title","Stop","type","button",1,"entry-btn","stop",3,"disabled"],[1,"status-pill"],["target","_blank","rel","noopener noreferrer",1,"preview-url",3,"href","title"],["mat-icon-button","","type","button",1,"entry-btn","logs",3,"click","title"],[1,"preview-error",3,"order"],[1,"logs-container",3,"order"],["mat-icon-button","","title","Start","type","button",1,"entry-btn","start",3,"click","disabled"],["mat-icon-button","","title","Stop","type","button",1,"entry-btn","stop",3,"click","disabled"],[1,"link-icon"],[1,"preview-error"],[1,"logs-container"],[1,"logs-header"],[1,"logs-title"],["mat-icon-button","","title","Refresh logs","type","button",1,"entry-btn"],[1,"logs-content"],["mat-icon-button","","title","Refresh logs","type","button",1,"entry-btn",3,"click"]],template:function(e,i){e&1&&(ws(0,"div",1),rC(1,pn,14,12,null,null,rn),pl()),e&2&&(XE(),oC(i.entryStates()));},dependencies:[hr,Gn,yt$1,wt],styles:["[_nghost-%COMP%]{display:block}.preview-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:.25rem 0}.entry-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;padding:.125rem .5rem;min-height:36px}.entry-name[_ngcontent-%COMP%]{font-size:.82rem;font-weight:500;color:var(--on-surface, #e0e0e0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;min-width:0}.entry-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0}.entry-btn[_ngcontent-%COMP%]{width:28px!important;height:28px!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center;flex-shrink:0}.entry-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px}.entry-btn.start[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.entry-btn.stop[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#e53935}.entry-btn.logs[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px;color:var(--color-text-secondary)}.entry-btn[disabled][_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.status-pill[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:1px 6px;border-radius:12px;font-size:.68rem;font-weight:600;letter-spacing:.02em;flex-shrink:0;min-width:52px;text-align:center;background:var(--color-bg-hover);color:var(--color-text-secondary);border:1px solid var(--color-border)}.status-pill.running[_ngcontent-%COMP%]{background:#22c55e26;color:#16a34a;border-color:#22c55e66}.preview-url[_ngcontent-%COMP%]{display:inline-flex;align-items:center;text-decoration:none;color:var(--color-primary);flex-shrink:0}.preview-url[_ngcontent-%COMP%]:hover{text-decoration:underline}.preview-url[_ngcontent-%COMP%] .link-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}.preview-error[_ngcontent-%COMP%]{font-size:.75rem;color:#c00;padding:0 .75rem}.logs-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:.125rem .5rem .25rem;background:var(--color-bg-hover);border-radius:8px;overflow:hidden;border:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%]{display:flex;align-items:center;padding:.25rem .75rem;border-bottom:1px solid var(--color-border)}.logs-header[_ngcontent-%COMP%] .logs-title[_ngcontent-%COMP%]{flex:1;font-size:.72rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.logs-content[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;font-family:Courier New,Courier,monospace;font-size:.72rem;line-height:1.5;color:var(--color-text);white-space:pre-wrap;word-break:break-all;max-height:200px;overflow-y:auto}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.logs-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-text-secondary);border-radius:3px}"],changeDetection:1})};var Oe=class n{eventStream=g(fe);threadState=g(U);ratio=Gi(0);inputTokens=Gi(0);contextWindow=Gi(0);price=Gi(0);iterations=Gi(0);cacheReadTokens=Gi(0);visible=Gi(false);level=mT(()=>{let t=this.ratio();return t<.6?"ok":t<.85?"warning":"danger"});constructor(){this.eventStream.events$.pipe(kt$1(t=>t instanceof _),kt$1(t=>!t.threadId||t.threadId===this.threadState.getSelectedThreadId())).subscribe(t=>{this.inputTokens.set(t.inputTokens),this.contextWindow.set(t.contextWindow),this.price.set(t.price),this.iterations.set(t.iterations),this.cacheReadTokens.set(t.cacheReadTokens),this.ratio.set(t.contextWindow>0?t.inputTokens/t.contextWindow:0),this.visible.set(true);}),this.eventStream.connectionStatus$.pipe(kt$1(t=>!t.connected)).subscribe(()=>{this.visible.set(false),this.ratio.set(0),this.inputTokens.set(0),this.contextWindow.set(0),this.price.set(0),this.iterations.set(0),this.cacheReadTokens.set(0);});}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x$1({token:n,factory:n.\u0275fac,providedIn:"root"})};function gn(n,t){if(n&1&&_g(0,"div",12),n&2){let e=t.$implicit,i=t.$index,o=gC();Hg("--delay",e.delay+"s")("--left",e.left+"%")("--dur",e.dur+"s")("--size",e.size+"px")("--rise",e.rise+"px"),Ug("invisible",i>=o.aboveBubbleCount());}}function _n(n,t){if(n&1&&_g(0,"div",13),n&2){let e=t.$implicit;Hg("--delay",e.delay+"s")("--size",e.size+"px")("--left",e.left+"%")("--dur",e.dur+"s")("--top",e.top+"px");}}function un(n,t){if(n&1&&_g(0,"div",14),n&2){let e=t.$implicit,i=t.$index,o=gC();Hg("--delay",e.delay+"s")("--left",e.left+"%")("--dur",e.dur+"s")("--size",e.size+"px"),Ug("invisible",i>=o.insideBubbleCount());}}var yt=30,Pt=27,hn=40;function T(n,t,e,i=0){return i+(n*137+t*31)%e}var ke=class n{gaugeState=g(Oe);sidenavOpen=ZB(false);aboveBubbles=Array.from({length:yt},(t,e)=>({delay:T(e,1,30)/10,left:T(e,2,82,5),dur:2.5+T(e,3,20)/10,size:1.5+T(e,4,40)/10,rise:150+T(e,5,150)}));insideBubbles=Array.from({length:Pt},(t,e)=>({delay:T(e,6,20)/10,left:T(e,7,80,5),dur:1.2+T(e,8,15)/10,size:2+T(e,9,35)/10}));foamBubbles=Array.from({length:hn},(t,e)=>({delay:T(e,10,25)/10,left:T(e,11,85,3),dur:1.5+T(e,12,10)/10,size:(3+T(e,13,80)/10)*.75,top:T(e,14,4)+8}));displayRatio=mT(()=>Math.min(100,this.gaugeState.ratio()*100));liquidColor=mT(()=>{let t=this.gaugeState.ratio();return t<=.5?`rgb(${Math.round(t*2*255)}, 255, 0)`:`rgb(255, ${Math.round((1-(t-.5)*2)*255)}, 0)`});aboveBubbleCount=mT(()=>Math.round(this.gaugeState.ratio()*yt));insideBubbleCount=mT(()=>{let t=this.gaugeState.ratio();return t<.5?0:t<.65?5:t<.8?13:t<.9?20:Pt});foamActive=mT(()=>this.gaugeState.ratio()>=.5);overflowing=mT(()=>this.gaugeState.ratio()>=.9);tooltipText=mT(()=>{let t=Math.round(this.gaugeState.ratio()*100),e=this.gaugeState.price().toFixed(4);return [`${this.gaugeState.inputTokens().toLocaleString()} / ${this.gaugeState.contextWindow().toLocaleString()} tokens (${t}%)`,`Cost: $${e}`,`Iterations: ${this.gaugeState.iterations()}`,`Cache read: ${this.gaugeState.cacheReadTokens().toLocaleString()}`].join(`
4
4
  `)});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["app-context-gauge"]],inputs:{sidenavOpen:[1,"sidenavOpen"]},decls:15,vars:11,consts:[[1,"tube-host",3,"title"],[1,"tube"],[1,"bubbles-above"],[1,"bubble-color",3,"invisible","--delay","--left","--dur","--size","--rise"],[1,"foam"],[1,"foam-bubble",3,"--delay","--size","--left","--dur","--top"],[1,"body"],[1,"shine"],[1,"liquid"],[1,"percentage"],[1,"bubbles-inside"],[1,"bubble-dark",3,"invisible","--delay","--left","--dur","--size"],[1,"bubble-color"],[1,"foam-bubble"],[1,"bubble-dark"]],template:function(e,i){e&1&&(hl(0,"div",0)(1,"div",1)(2,"div",2),rC(3,gn,1,12,"div",3,tC),gl(),hl(5,"div",4),rC(6,_n,1,10,"div",5,tC),gl(),hl(8,"div",6),_g(9,"div",7),hl(10,"div",8)(11,"div",9)(12,"div",10),rC(13,un,1,10,"div",11,tC),gl()()()()()()),e&2&&(Ug("hidden",i.sidenavOpen()),xg("title",i.tooltipText()),XE(),Hg("--tube-color",i.liquidColor()),XE(2),oC(i.aboveBubbles),XE(2),Hg("bottom",i.displayRatio()+"%"),Ug("active",i.foamActive()),XE(),oC(i.foamBubbles),XE(5),Hg("height",i.displayRatio(),"%"),XE(2),oC(i.insideBubbles));},styles:['[_nghost-%COMP%]{position:fixed;left:calc(1rem + 10px);z-index:1500;display:block;top:calc(3.5rem + 80px);--gauge-glass: #dddddd}[data-theme$=dark][_nghost-%COMP%], [data-theme$=dark] [_nghost-%COMP%]{--gauge-glass: #333333}.tube-host[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;align-items:center}.tube-host.hidden[_ngcontent-%COMP%]{visibility:hidden}.tube[_ngcontent-%COMP%]{position:relative;height:100px;width:24px;border:none;border-radius:0 0 50rem 50rem;background-color:var(--gauge-glass, #333333);cursor:default;overflow:visible}.tube[_ngcontent-%COMP%]:after{content:"";position:absolute;left:-3px;top:0;width:calc(100% + 6px);height:4px;border-radius:50rem;background:var(--gauge-glass, #333333)}.body[_ngcontent-%COMP%]{position:absolute;border-radius:inherit;height:100%;width:100%;bottom:0;overflow:hidden;z-index:5}.shine[_ngcontent-%COMP%]{position:absolute;left:20%;top:0;width:10%;height:100%;z-index:90;opacity:.2;pointer-events:none}.shine[_ngcontent-%COMP%]:before, .shine[_ngcontent-%COMP%]:after{content:"";position:absolute;background-color:#fff;border-radius:50rem;top:10%;height:40%;width:100%}.shine[_ngcontent-%COMP%]:after{height:15%;top:60%}@keyframes _ngcontent-%COMP%_liquid-spin{0%{transform:translate(-50%) rotate(0)}to{transform:translate(-50%) rotate(360deg)}}.liquid[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;bottom:0}.percentage[_ngcontent-%COMP%]{position:absolute;height:0%;width:100%;bottom:0;left:0;z-index:80;transition:height .9s cubic-bezier(.4,0,.2,1);overflow:visible}.percentage[_ngcontent-%COMP%]:before, .percentage[_ngcontent-%COMP%]:after{position:absolute;content:"";width:100px;height:100px;border-radius:40px;animation:_ngcontent-%COMP%_liquid-spin 4s infinite linear;transform:translate(-50%);left:50%;top:0;background:var(--tube-color, #34c759);transition:background .5s ease}.percentage[_ngcontent-%COMP%]:after{opacity:.4;animation-direction:reverse;border-radius:30px}@keyframes _ngcontent-%COMP%_bubble-rise-inside{0%{bottom:2%;opacity:0;transform:scale(.5)}15%{opacity:.7}85%{opacity:.4}to{bottom:96%;opacity:0;transform:scale(1.1)}}.bubbles-inside[_ngcontent-%COMP%]{position:absolute;left:0;bottom:0;width:100%;height:100%;z-index:10;pointer-events:none}.bubbles-inside[_ngcontent-%COMP%] .bubble-dark[_ngcontent-%COMP%]{position:absolute;border-radius:50%;background:var(--color-bg, rgba(20, 20, 20, .55));width:var(--size, 3px);height:var(--size, 3px);opacity:0;bottom:2%;left:var(--left, 30%);animation:_ngcontent-%COMP%_bubble-rise-inside var(--dur, 1.5s) infinite ease-in;animation-delay:var(--delay, 0s)}.bubbles-inside[_ngcontent-%COMP%] .bubble-dark.invisible[_ngcontent-%COMP%]{animation:none;opacity:0}@keyframes _ngcontent-%COMP%_bubble-rise-above{0%{bottom:0;opacity:0;transform:scale(.4)}10%{opacity:.9}70%{opacity:.8}90%{opacity:.3}to{bottom:var(--rise, 80px);opacity:0;transform:scale(1.2)}}.bubbles-above[_ngcontent-%COMP%]{position:absolute;left:0;bottom:0;width:100%;height:100%;z-index:20;pointer-events:none;overflow:visible}.bubbles-above[_ngcontent-%COMP%] .bubble-color[_ngcontent-%COMP%]{position:absolute;border-radius:50%;background:var(--tube-color, #34c759);opacity:0;bottom:0;left:var(--left, 30%);width:var(--size, 3px);height:var(--size, 3px);animation:_ngcontent-%COMP%_bubble-rise-above var(--dur, 1.5s) infinite ease-in;animation-delay:var(--delay, 0s)}.bubbles-above[_ngcontent-%COMP%] .bubble-color.invisible[_ngcontent-%COMP%]{animation:none;opacity:0}.foam[_ngcontent-%COMP%]{position:absolute;bottom:0;left:-1px;width:100%;height:14px;z-index:100;pointer-events:none;overflow:visible;transition:bottom .9s cubic-bezier(.4,0,.2,1)}.foam[_ngcontent-%COMP%] .foam-bubble[_ngcontent-%COMP%]{position:absolute;top:var(--top, 0px);left:var(--left, 50%);width:var(--size, 4px);height:var(--size, 4px);border-radius:50%;background:#fff0;animation:none}.foam.active[_ngcontent-%COMP%] .foam-bubble[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_foam-pulse var(--dur, 1.5s) ease-in-out infinite;animation-delay:var(--delay, 0s)}@keyframes _ngcontent-%COMP%_foam-pulse{0%{background:#fff0;transform:scale(.5)}30%{background:#ffffff73;transform:scale(1)}60%{background:#ffffff40;transform:scale(1.1)}to{background:#fff0;transform:scale(.6)}}@media(max-width:768px){[_nghost-%COMP%]{top:calc(3.25rem + 80px);left:calc(.75rem + 10px)}.tube[_ngcontent-%COMP%]{height:75px;width:20px}}']})};var fn=["threadSearchInput"],bn=["*"];function vn(n,t){if(n&1){let e=lC();ws(0,"button",28),Rg("click",function(){If(e);let o=gC();return wf(o.toggle())}),ws(1,"mat-icon"),GC(2,"menu"),pl()(),ws(3,"button",29),Rg("click",function(){If(e);let o=gC();return wf(o.createNewThread())}),ws(4,"mat-icon",10),GC(5,"play_circle"),pl()();}if(n&2){let e=gC();XE(3),bg("disabled",!e.selectedProjectName());}}function Cn(n,t){if(n&1){let e=lC();ws(0,"div",12)(1,"a",30),Rg("click",function(o){return If(e),gC().openMissionControl(),wf(o.preventDefault())}),ws(2,"mat-icon"),GC(3,"rocket_launch"),pl(),ws(4,"span",31),GC(5,"Task Control"),pl()()();}}function xn(n,t){if(n&1){let e=lC();ws(0,"div",15)(1,"mat-icon",32),GC(2,"search"),pl(),ws(3,"input",33,0),tm("ngModelChange",function(o){If(e);let s=gC();return KC(s.threadSearchQuery,o)||(s.threadSearchQuery=o),wf(o)}),Rg("input",function(){If(e);let o=gC();return wf(o.onThreadSearchInput())}),pl(),VI(),ws(5,"button",34),Rg("click",function(){If(e);let o=gC();return wf(o.closeThreadSearch())}),ws(6,"mat-icon"),GC(7,"close"),pl()()();}if(n&2){let e=gC();XE(3),em("ngModel",e.threadSearchQuery),UI();}}function yn(n,t){if(n&1){let e=lC();ws(0,"div",16)(1,"mat-icon",23),GC(2,"forum"),pl(),ws(3,"span",24),GC(4,"Threads"),pl(),ws(5,"button",35),Rg("click",function(o){If(e);let s=gC();return wf(s.toggleThreadSearch(o))}),ws(6,"mat-icon"),GC(7,"search"),pl()()();}}function Pn(n,t){n&1&&(ws(0,"mat-icon",22),GC(1,"keyboard_arrow_up"),pl());}function Sn(n,t){n&1&&(ws(0,"mat-icon",23),GC(1,"hub"),pl());}function Mn(n,t){n&1&&(ws(0,"mat-icon",22),GC(1,"keyboard_arrow_up"),pl());}function wn(n,t){n&1&&(ws(0,"mat-icon",23),GC(1,"tune"),pl());}function Tn(n,t){n&1&&(ws(0,"div",37)(1,"div",41),Sg(2,"app-options-panel",42),pl()());}function On(n,t){if(n&1){let e=lC();ws(0,"div",36)(1,"a",21),Rg("click",function(o){return If(e),gC(3).openProjectConfig(),o.preventDefault(),wf(o.stopPropagation())}),ws(2,"mat-icon",23),GC(3,"settings_applications"),pl(),ws(4,"span",24),GC(5,"Project Configuration"),pl()()();}}function kn(n,t){n&1&&(ws(0,"div",36)(1,"a",43)(2,"mat-icon",23),GC(3,"settings_applications"),pl(),ws(4,"span",24),GC(5,"Project config (No project)"),pl()()());}function En(n,t){if(n&1&&Jw(0,On,6,0,"div",36)(1,kn,6,0,"div",36),n&2){let e=gC(2);eC(e.selectedProjectName()?0:1);}}function Dn(n,t){if(n&1){let e=lC();ws(0,"div",36)(1,"a",21),Rg("click",function(o){return If(e),gC(2).openAgents(),o.preventDefault(),wf(o.stopPropagation())}),ws(2,"mat-icon",23),GC(3,"smart_toy"),pl(),ws(4,"span",24),GC(5,"Agents"),pl()()();}}function Nn(n,t){n&1&&(ws(0,"div",36)(1,"a",43)(2,"mat-icon",23),GC(3,"smart_toy"),pl(),ws(4,"span",24),GC(5,"Agents (No project)"),pl()()());}function jn(n,t){if(n&1){let e=lC();ws(0,"div",36)(1,"a",21),Rg("click",function(o){return If(e),gC(2).openPrompts(),o.preventDefault(),wf(o.stopPropagation())}),ws(2,"mat-icon",23),GC(3,"description"),pl(),ws(4,"span",24),GC(5,"Prompts"),pl()()();}}function Vn(n,t){n&1&&(ws(0,"div",36)(1,"a",43)(2,"mat-icon",23),GC(3,"description"),pl(),ws(4,"span",24),GC(5,"Prompts (No project)"),pl()()());}function Fn(n,t){if(n&1){let e=lC();ws(0,"div",36)(1,"a",21),Rg("click",function(o){return If(e),gC(2).openSchedulers(),o.preventDefault(),wf(o.stopPropagation())}),ws(2,"mat-icon",23),GC(3,"schedule"),pl(),ws(4,"span",24),GC(5,"Schedulers"),pl()()();}}function In(n,t){n&1&&(ws(0,"div",36)(1,"a",43)(2,"mat-icon",23),GC(3,"schedule"),pl(),ws(4,"span",24),GC(5,"Schedulers (No project)"),pl()()());}function zn(n,t){n&1&&(ws(0,"mat-icon",22),GC(1,"keyboard_arrow_up"),pl());}function An(n,t){n&1&&(ws(0,"mat-icon",23),GC(1,"rocket_launch"),pl());}function Ln(n,t){if(n&1&&(ws(0,"div",37),Sg(1,"app-preview-panel",44),pl()),n&2){let e=gC(3);XE(),bg("projectName",e.selectedProjectName());}}function Rn(n,t){if(n&1){let e=lC();ws(0,"div",36)(1,"a",21),Rg("click",function(o){return If(e),gC(2).toggleSection("preview"),o.preventDefault(),wf(o.stopPropagation())}),Jw(2,zn,2,0,"mat-icon",22)(3,An,2,0,"mat-icon",23),ws(4,"span",24),GC(5,"Preview Server"),pl()(),Jw(6,Ln,2,1,"div",37),pl();}if(n&2){let e=gC(2);Ug("expanded",e.expandedSections.preview),XE(),Ug("active",e.expandedSections.preview),XE(),eC(e.expandedSections.preview?2:3),XE(4),eC(e.expandedSections.preview?6:-1);}}function $n(n,t){if(n&1){let e=lC();ws(0,"div",25)(1,"div",36)(2,"a",21),Rg("click",function(o){return If(e),gC().toggleSection("config"),wf(o.preventDefault())}),Jw(3,Mn,2,0,"mat-icon",22)(4,wn,2,0,"mat-icon",23),ws(5,"span",24),GC(6,"Preferences"),pl()(),Jw(7,Tn,3,0,"div",37),pl(),ws(8,"div",36)(9,"a",21),Rg("click",function(o){return If(e),gC().openTokenUsage(),o.preventDefault(),wf(o.stopPropagation())}),ws(10,"mat-icon",23),GC(11,"data_usage"),pl(),ws(12,"span",24),GC(13,"Token Usage"),pl()()(),ws(14,"div",36)(15,"a",21),Rg("click",function(o){return If(e),gC().openUserConfig(),o.preventDefault(),wf(o.stopPropagation())}),ws(16,"mat-icon",23),GC(17,"manage_accounts"),pl(),ws(18,"span",24),GC(19,"User Configuration"),pl()()(),Jw(20,En,2,1),Jw(21,Dn,6,0,"div",36)(22,Nn,6,0,"div",36),Jw(23,jn,6,0,"div",36)(24,Vn,6,0,"div",36),Jw(25,Fn,6,0,"div",36)(26,In,6,0,"div",36),Jw(27,Rn,7,6,"div",38),ws(28,"div",36)(29,"a",39),Sg(30,"img",40),ws(31,"span",24),GC(32,"Contribute on GitHub"),pl()()()();}if(n&2){let e=gC();XE(),Ug("expanded",e.expandedSections.config),XE(),Ug("active",e.expandedSections.config),XE(),eC(e.expandedSections.config?3:4),XE(4),eC(e.expandedSections.config?7:-1),XE(13),eC(e.isAdmin?20:-1),XE(),eC(e.selectedProjectName()?21:22),XE(2),eC(e.selectedProjectName()?23:24),XE(2),eC(e.selectedProjectName()?25:26),XE(2),eC(e.hasPreviewConfig()?27:-1),XE(3),Tg("src","CODAY-Logo.png",yh);}}function Bn(n,t){if(n&1){let e=lC();ws(0,"div",27)(1,"mat-icon",45),GC(2,"warning"),pl(),ws(3,"span",46),GC(4),pl(),ws(5,"button",47),Rg("click",function(){If(e);let o=gC();return wf(o.configErrorMessage="")}),ws(6,"mat-icon"),GC(7,"close"),pl()()();}if(n&2){let e=gC();XE(4),Yg(e.configErrorMessage);}}var St=class n{destroy$=new ue;sidenavStateChange=new vt;drawerOpen=false;breakpointObserver=g(Ot$1);isDesktop=F(this.breakpointObserver.observe("(min-width: 1400px)").pipe(re(t=>t.matches)),{initialValue:false});userOpenPreference=Gi(true);isOpen=mT(()=>this.userOpenPreference());isAdmin=false;configErrorMessage="";expandedSections={config:false,preview:false,settings:false};isThreadSearchActive=false;threadSearchQuery="";threadSearchInput;dialog=g(Re);configApi=g(W);projectStateService=g(P);projectApi=g(c);router=g(G);preferences=g(L);threadStateService=g(U);projects=F(this.projectStateService.projectList$);selectedProject=F(this.projectStateService.selectedProject$);selectedProjectName=F(this.projectStateService.selectedProject$.pipe(re(t=>t?.name)));isProjectVolatile=F(this.projectStateService.selectedProject$.pipe(re(t=>t?.config?.volatile||false)));forcedProject=F(this.projectStateService.forcedProject$);hasPreviewConfig=F(this.projectStateService.selectedProject$.pipe(re(t=>{let e=t?.config?.preview;return Array.isArray(e)&&!!e.length})),{initialValue:false});ngOnInit(){let t=window.innerWidth>=1024,e=this.preferences.getPreference("sidenavOpen",t);this.userOpenPreference.set(e??t),this.configApi.getUserConfig().pipe(wd(this.destroy$)).subscribe({next:i=>{this.isAdmin=i.groups?.includes("CODAY_ADMIN")??false,console.log("[SIDENAV] User admin status:",this.isAdmin);},error:i=>{console.error("[SIDENAV] Error loading user config for roles:",i),this.isAdmin=false;}});}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}toggle(){let t=!this.userOpenPreference();this.userOpenPreference.set(t),this.saveSidenavState(t),this.sidenavStateChange.emit(t);}close(){this.userOpenPreference()&&(this.userOpenPreference.set(false),this.saveSidenavState(false),this.sidenavStateChange.emit(false));}saveSidenavState(t){this.preferences.setPreference("sidenavOpen",t);}openTokenUsage(){this.configErrorMessage="",this.router.navigate(["/token-usage"]);}openUserConfig(){console.log("[SIDENAV] openUserConfig called"),this.configErrorMessage="",this.configApi.getUserConfig().pipe(wd(this.destroy$)).subscribe({next:t=>{console.log("[SIDENAV] User config loaded, opening dialog"),this.dialog.open(Ze,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(i=>{i&&this.saveUserConfig(i);});},error:t=>{console.error("[SIDENAV] Error loading user config:",t),this.configErrorMessage=t?.error?.error||"Failed to load user configuration";}});}saveUserConfig(t){this.configApi.updateUserConfig(t).pipe(wd(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] User config saved successfully");},error:e=>{console.error("[SIDENAV] Error saving user config:",e),this.configErrorMessage=e?.error?.error||"Failed to save user configuration";}});}openProjectConfig(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected"),this.configErrorMessage="No project selected. Please select a project first.";return}this.configErrorMessage="",this.projectApi.getProjectConfig(t).pipe(wd(this.destroy$)).subscribe({next:e=>{console.log("[SIDENAV] Project config loaded, opening dialog"),this.dialog.open(Ze,{data:{configType:"project",projectName:t,initialContent:JSON.stringify(e,null,2)}}).afterClosed().subscribe(o=>{o&&this.saveProjectConfig(t,o);});},error:e=>{console.error("[SIDENAV] Error loading project config:",e),this.configErrorMessage=e?.error?.error||"Failed to load project configuration";}});}saveProjectConfig(t,e){this.projectApi.updateProjectConfig(t,e).pipe(wd(this.destroy$)).subscribe({next:i=>{console.log("[SIDENAV] Project config saved successfully");},error:i=>{console.error("[SIDENAV] Error saving project config:",i),this.configErrorMessage=i?.error?.error||"Failed to save project configuration";}});}requireProjectSelection(t){return this.selectedProjectName()?true:(console.error(`[SIDENAV] No project selected, cannot ${t}`),this.configErrorMessage="Please select a project first",false)}openAgents(){if(!this.requireProjectSelection("open agents"))return;let t=this.selectedProjectName();this.router.navigate(["project",t,"agents"]);}openPrompts(){if(!this.requireProjectSelection("open prompts"))return;let t=this.selectedProjectName();this.router.navigate(["project",t,"prompts"]);}openSchedulers(){if(!this.requireProjectSelection("open schedulers"))return;let t=this.selectedProjectName();this.router.navigate(["project",t,"schedulers"]);}toggleSection(t){let e=this.expandedSections[t];t==="settings"?this.expandedSections[t]=!e:(["config","preview"].forEach(o=>{this.expandedSections[o]=false;}),this.expandedSections[t]=!e);}navigateToHome(){console.log("[SIDENAV] Navigating to home (project selection)"),this.projectStateService.clearSelection(),this.router.navigate(["/"]);}openMissionControl(){let t=this.selectedProjectName();t&&(this.router.navigate(["project",t,"tasks"]),this.close());}createNewThread(){let t=this.selectedProjectName();if(!t){console.error("[SIDENAV] No project selected, cannot create new thread"),this.configErrorMessage="Please select a project first";return}console.log("[SIDENAV] Navigating to welcome view for new thread"),this.threadStateService.clearSelection(),this.router.navigate(["project",t]);}onThreadSelectedOnMobile(){this.isDesktop()||this.close();}toggleThreadSearch(t){t.stopPropagation(),this.isThreadSearchActive=true,this.threadSearchQuery="",setTimeout(()=>{this.threadSearchInput?.nativeElement.focus();},0);}closeThreadSearch(){this.isThreadSearchActive=false,this.threadSearchQuery="";}onThreadSearchInput(){}onThreadSearchModeChange(t){t||this.closeThreadSearch();}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["app-sidenav"]],viewQuery:function(e,i){if(e&1&&Pg(fn,5),e&2){let o;EC(o=IC())&&(i.threadSearchInput=o.first);}},inputs:{drawerOpen:"drawerOpen"},outputs:{sidenavStateChange:"sidenavStateChange"},ngContentSelectors:bn,decls:36,vars:24,consts:[["threadSearchInput",""],[1,"sidenav-container",3,"hasBackdrop"],["mode","push","position","start",1,"app-sidenav",3,"closed","opened","disableClose"],[1,"sidenav-header"],["mat-icon-button","","title","Close menu",3,"click"],["alt","coday","title","Go to project selection","role","button","tabindex","0",1,"sidenav-logo","clickable",3,"click","keydown.enter","keydown.space"],[1,"header-title-section"],[1,"sidenav-title"],[1,"new-thread-section"],["role","button","tabindex","0",1,"new-thread-link",3,"click"],["fontSet","material-icons-outlined"],[1,"new-thread-text"],[1,"mission-control-section"],[1,"sidenav-sections"],[1,"section-container","expanded"],[1,"search-header"],[1,"section-toggle","active","threads-header"],[1,"section-content","threads"],[1,"sidenav-thread-selector",3,"searchModeChange","threadSelected","searchMode","searchQuery"],[1,"sidenav-nav"],[1,"section-container","settings-group"],["role","button","tabindex","0",1,"section-toggle",3,"click"],[1,"arrow-icon","expanded"],[1,"section-icon"],[1,"section-label"],[1,"section-content","settings-content"],[3,"sidenavOpen"],["role","alert",1,"error-notification"],["mat-icon-button","","title","Menu","type","button",1,"sidenav-toggle-btn",3,"click"],["mat-icon-button","","title","Start a new thread","type","button",1,"sidenav-new-thread-btn",3,"click","disabled"],["role","button","tabindex","0",1,"mission-control-link",3,"click"],[1,"mission-control-text"],[1,"search-icon"],["type","text","placeholder","Search threads...",1,"search-input",3,"ngModelChange","input","ngModel"],["mat-icon-button","","title","Close search","type","button",1,"close-search-btn",3,"click"],["mat-icon-button","","title","Search threads","type","button",1,"search-button",3,"click"],[1,"section-container"],[1,"section-content"],[1,"section-container",3,"expanded"],["href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer","title","Contribute on GitHub",1,"section-toggle","contribute-btn"],["alt","Coday",1,"contribute-logo"],[1,"preference-item"],[1,"inline-panel"],["role","button","tabindex","-1","aria-disabled","true",1,"section-toggle","disabled"],[3,"projectName"],[1,"error-icon"],[1,"error-text"],["mat-icon-button","","aria-label","Close error message",1,"error-close",3,"click"]],template:function(e,i){e&1&&(yC(),Jw(0,vn,6,1),ws(1,"mat-sidenav-container",1)(2,"mat-sidenav",2),Rg("closed",function(){return i.close()}),ws(3,"div",3)(4,"button",4),Rg("click",function(){return i.close()}),ws(5,"mat-icon"),GC(6,"chevron_left"),pl()(),ws(7,"img",5),Rg("click",function(s){return i.navigateToHome(),s.stopPropagation()})("keydown.enter",function(s){return i.navigateToHome(),s.preventDefault(),s.stopPropagation()})("keydown.space",function(s){return i.navigateToHome(),s.preventDefault(),s.stopPropagation()}),pl(),ws(8,"div",6)(9,"h2",7),GC(10),pl()()(),ws(11,"div",8)(12,"a",9),Rg("click",function(s){return i.createNewThread(),s.preventDefault()}),ws(13,"mat-icon",10),GC(14,"play_circle"),pl(),ws(15,"span",11),GC(16,"Start a new thread"),pl()()(),Jw(17,Cn,6,0,"div",12),ws(18,"div",13)(19,"div",14),Jw(20,xn,8,1,"div",15)(21,yn,8,0,"div",16),ws(22,"div",17)(23,"app-thread-selector",18),Rg("searchModeChange",function(s){return i.onThreadSearchModeChange(s)})("threadSelected",function(){return i.onThreadSelectedOnMobile()}),pl()()()(),ws(24,"div",19)(25,"div",20)(26,"a",21),Rg("click",function(s){return i.toggleSection("settings"),s.preventDefault()}),Jw(27,Pn,2,0,"mat-icon",22)(28,Sn,2,0,"mat-icon",23),ws(29,"span",24),GC(30,"Control Center"),pl()(),Jw(31,$n,33,12,"div",25),pl()()(),ws(32,"mat-sidenav-content"),vC(33),pl()(),Sg(34,"app-context-gauge",26),Jw(35,Bn,8,1,"div",27)),e&2&&(eC(!i.isOpen()&&!i.drawerOpen?0:-1),XE(),Ug("sidenav-open",i.isOpen()),bg("hasBackdrop",false),XE(),bg("opened",i.isOpen())("disableClose",true),XE(5),Tg("src","CODAY-Logo.png",yh),XE(3),Yg(i.selectedProjectName()),XE(7),eC(i.selectedProjectName()?17:-1),XE(3),eC(i.isThreadSearchActive?20:21),XE(3),bg("searchMode",i.isThreadSearchActive)("searchQuery",i.threadSearchQuery),XE(),Ug("is-admin",i.isAdmin),XE(),Ug("expanded",i.expandedSections.settings),XE(),Ug("active",i.expandedSections.settings),XE(),eC(i.expandedSections.settings?27:28),XE(4),eC(i.expandedSections.settings?31:-1),XE(),Ug("sidenav-closed-offset",!i.isOpen()),XE(2),bg("sidenavOpen",i.isOpen()),XE(),eC(i.configErrorMessage?35:-1));},dependencies:[ti,Ye,Zn,cn$1,ui,me,fi,Yt$1,yt$1,wt,hr,Gn,He,bt,Ye$1,we,Te,ke],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.sidenav-container[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;height:100dvh;z-index:1400;transition:width;display:flex}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]{position:relative!important;transition:width;width:25%;min-width:320px;height:100dvh!important;flex-shrink:0}.sidenav-container[_ngcontent-%COMP%] mat-sidenav[_ngcontent-%COMP%]:not(.mat-drawer-opened){width:0!important;min-width:0;overflow:hidden!important;visibility:hidden!important}.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{width:100%;margin:0!important}@media(min-width:1024px){.sidenav-container[_ngcontent-%COMP%] mat-sidenav-content[_ngcontent-%COMP%]{min-width:0}}[_nghost-%COMP%] .mat-drawer-backdrop{pointer-events:auto}[_nghost-%COMP%] .mat-drawer-content{pointer-events:auto!important;background:transparent!important;overflow:visible!important}[_nghost-%COMP%] .mat-drawer-inner-container{overflow:hidden!important;height:100dvh!important;display:flex!important;flex-direction:column!important}.sidenav-new-thread-btn[_ngcontent-%COMP%], .sidenav-toggle-btn[_ngcontent-%COMP%]{position:fixed!important;z-index:1500!important;width:40px!important;height:40px!important;border-radius:50%!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;border:1px solid var(--glass-border)!important;box-shadow:var(--glass-shadow)!important}.sidenav-toggle-btn[_ngcontent-%COMP%]{top:1rem!important;left:1rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{top:calc(1.5rem + 40px)!important;left:1rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]:disabled{opacity:.5!important}.sidenav-logo-btn[_ngcontent-%COMP%]{position:fixed!important;bottom:1rem!important;left:1rem!important;z-index:1500!important;width:56px!important;height:56px!important;border-radius:50%!important;border:1px solid var(--glass-border)!important;padding:4px!important;background:var(--glass-bg)!important;backdrop-filter:var(--glass-backdrop-blur)!important;-webkit-backdrop-filter:var(--glass-backdrop-blur)!important;box-shadow:var(--glass-shadow)!important;transition:all .3s cubic-bezier(.4,0,.2,1)!important;cursor:pointer!important;pointer-events:auto!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;text-decoration:none!important}.sidenav-logo-btn[_ngcontent-%COMP%]:hover{transform:scale(1.08) translateY(-2px)!important;box-shadow:0 16px 48px #0003!important;border-color:var(--color-primary)!important}.sidenav-logo-btn[_ngcontent-%COMP%]:active{transform:scale(.96)!important}.sidenav-logo-btn[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:2px}.app-sidenav[_ngcontent-%COMP%]{width:480px;height:100dvh!important;min-height:0!important;position:relative;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);overflow:hidden!important;display:flex;flex-direction:column}.sidenav-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:1.5rem 1rem .5rem;flex-shrink:0}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:4px;flex-shrink:0;transition:all .2s ease}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]{cursor:pointer}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:hover{transform:scale(1.1);filter:drop-shadow(0 4px 12px rgba(0,0,0,.15))}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:active{transform:scale(.95)}.sidenav-header[_ngcontent-%COMP%] .sidenav-logo.clickable[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;min-width:0}.sidenav-header[_ngcontent-%COMP%] .header-title-section[_ngcontent-%COMP%] .sidenav-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mission-control-section[_ngcontent-%COMP%]{padding:.25rem 1rem .5rem;flex-shrink:0}.mission-control-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;font-size:.875rem;font-weight:500;color:var(--color-text-secondary);padding:0}.mission-control-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-text-secondary);transition:color .2s ease}.mission-control-link[_ngcontent-%COMP%]:hover{color:var(--color-primary);transform:translate(3px)}.mission-control-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.mission-control-link[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px;border-radius:4px}.new-thread-section[_ngcontent-%COMP%]{padding:1rem 1rem .5rem;flex-shrink:0}.new-thread-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:transparent;border:none;text-decoration:none;cursor:pointer;transition:all .2s ease;gap:.5rem;font-size:.95rem;font-weight:600;padding:0}.new-thread-link[_ngcontent-%COMP%] .new-thread-text[_ngcontent-%COMP%]{background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-primary);animation:_ngcontent-%COMP%_iconPulse 3s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:hover{transform:translate(4px)}.new-thread-link[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_iconPulse 1.5s ease-in-out infinite}.new-thread-link[_ngcontent-%COMP%]:focus{transform:scale(1.1)}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}@keyframes _ngcontent-%COMP%_iconPulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.05)}}.sidenav-sections[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:100px;overflow:hidden}.sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container.expanded[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%], .sidenav-sections[_ngcontent-%COMP%] > .section-container[_ngcontent-%COMP%] > .section-content.threads[_ngcontent-%COMP%] > app-thread-selector[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;flex:1!important;min-height:0!important;overflow:hidden!important}.sidenav-nav[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column;overflow:hidden;max-height:70%;border-top:1px solid var(--color-border)}.sidenav-nav[_ngcontent-%COMP%] > .settings-group[_ngcontent-%COMP%] > .section-toggle.active[_ngcontent-%COMP%]{border-top:none}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-toggle[_ngcontent-%COMP%]{flex-shrink:0}.sidenav-nav[_ngcontent-%COMP%] .settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%]{padding:0;border-bottom:1px solid var(--color-border);overflow:visible}.settings-group[_ngcontent-%COMP%] > .section-content.settings-content[_ngcontent-%COMP%] .section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{max-height:40vh;overflow-y:auto;overflow-x:hidden}.contribute-btn[_ngcontent-%COMP%] .contribute-logo[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:2px;flex-shrink:0}.section-container[_ngcontent-%COMP%]{flex-shrink:0;display:flex;flex-direction:column}.section-container.expanded[_ngcontent-%COMP%] .section-content[_ngcontent-%COMP%]{border-bottom:none}.section-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;width:100%;padding:.5rem 1rem;height:50px;text-decoration:none;cursor:pointer;transition:all .2s ease;background:transparent;border:none;border-radius:0;color:var(--color-text);flex-shrink:0}.section-toggle.active[_ngcontent-%COMP%]{border-top:1px solid var(--color-border)}.section-toggle.disabled[_ngcontent-%COMP%]{opacity:.5;cursor:not-allowed;pointer-events:none}.section-toggle[_ngcontent-%COMP%] .arrow-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);transition:transform .2s ease;flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .section-label[_ngcontent-%COMP%]{flex:1;font-size:.9rem;color:var(--color-text);text-align:left}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0}.section-toggle[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-toggle[_ngcontent-%COMP%]:hover:not(.disabled){background:var(--color-bg-hover)}.section-toggle[_ngcontent-%COMP%]:active:not(.disabled){transform:scale(.98)}.section-toggle[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary);outline-offset:-2px}.search-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;height:50px;background:var(--color-bg-hover);border-top:1px solid var(--color-border);transition:all .2s ease}.search-header[_ngcontent-%COMP%] .search-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:var(--color-text-secondary);flex-shrink:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent;color:var(--color-text);font-size:.9rem;padding:0;min-width:0}.search-header[_ngcontent-%COMP%] .search-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-muted)}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%]{flex-shrink:0}.search-header[_ngcontent-%COMP%] .close-search-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.section-content[_ngcontent-%COMP%]{padding:.5rem 0 0;animation:_ngcontent-%COMP%_slideDown .2s ease;border-bottom:1px solid var(--color-border);display:flex;flex-direction:column}.section-content.threads[_ngcontent-%COMP%]{padding:0;border-bottom:none;flex:1!important;min-height:0!important;overflow:hidden!important}.section-content.threads[_ngcontent-%COMP%] app-thread-selector[_ngcontent-%COMP%]{flex:1!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}@keyframes _ngcontent-%COMP%_slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.preference-item[_ngcontent-%COMP%]{padding-bottom:1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border)}.preference-item[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem;padding:0 1rem}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.preference-item[_ngcontent-%COMP%] .preference-header[_ngcontent-%COMP%] .item-text[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.preference-item[_ngcontent-%COMP%] .preference-content[_ngcontent-%COMP%]{padding:0 1rem}.error-notification[_ngcontent-%COMP%]{position:fixed;top:5rem;left:50%;transform:translate(-50%);z-index:2000;display:flex;align-items:center;gap:.75rem;background:#ff3b3026;backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid rgba(255,59,48,.3);border-radius:16px;padding:1rem 1.5rem;box-shadow:var(--glass-shadow);animation:_ngcontent-%COMP%_errorSlideDown .3s cubic-bezier(.4,0,.2,1)}.error-notification[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{font-size:1.2rem;flex-shrink:0;color:#c00}.error-notification[_ngcontent-%COMP%] .error-text[_ngcontent-%COMP%]{flex:1;color:#c00;font-size:.9rem;font-weight:500}@keyframes _ngcontent-%COMP%_errorSlideDown{0%{opacity:0;transform:translate(-50%,-10px)}to{opacity:1;transform:translate(-50%)}}@media(max-width:480px){.app-sidenav[_ngcontent-%COMP%]{width:320px}.sidenav-toggle-btn[_ngcontent-%COMP%]{top:.75rem!important;left:.75rem!important}.sidenav-new-thread-btn[_ngcontent-%COMP%]{top:calc(1.25rem + 40px)!important;left:.75rem!important}.error-notification[_ngcontent-%COMP%]{left:1rem;right:1rem;transform:none;max-width:calc(100vw - 2rem)}}body.dark[_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .app-sidenav[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .app-sidenav[_ngcontent-%COMP%]{background:#242830f2;border-right-color:#b4c8ff17}body.dark[_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], body.dark [_nghost-%COMP%] .sidenav-header[_ngcontent-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .sidenav-header[_ngcontent-%COMP%]{background:#242830b3}"],changeDetection:1})};