@whoz-oss/coday-client 0.204.3 → 0.206.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-IZMOVLXM.js → chunk-243E2GWV.js} +1 -1
- package/browser/{chunk-X4OBCZKS.js → chunk-2J5DAOVJ.js} +1 -1
- package/browser/{chunk-TJUGTTPT.js → chunk-2L7CAI22.js} +1 -1
- package/browser/{chunk-T7LK5WIK.js → chunk-3IOIMTCZ.js} +1 -1
- package/browser/{chunk-IZ232KSX.js → chunk-3NE2UZIY.js} +1 -1
- package/browser/{chunk-KP7JXEQ6.js → chunk-3ODG3JTW.js} +1 -1
- package/browser/chunk-42QJEAX4.js +1 -0
- package/browser/{chunk-W2DFJLOU.js → chunk-4734TK7R.js} +1 -1
- package/browser/{chunk-TIPIHEBG.js → chunk-4F2LQOD7.js} +1 -1
- package/browser/{chunk-OCT6NWLB.js → chunk-4JBCVOGN.js} +1 -1
- package/browser/{chunk-MLSIHZ2T.js → chunk-4NGQR26Q.js} +1 -1
- package/browser/{chunk-4OZZANXO.js → chunk-53URG3R4.js} +1 -1
- package/browser/chunk-55QD2MSQ.js +1 -0
- package/browser/{chunk-T6U3WDDW.js → chunk-5EHY76TA.js} +1 -1
- package/browser/chunk-5J7BTB5J.js +5 -0
- package/browser/{chunk-2KD6MSFI.js → chunk-5VKJNF6W.js} +1 -1
- package/browser/{chunk-2XIUD7DV.js → chunk-6F2QS5ZN.js} +1 -1
- package/browser/{chunk-PN75DG7I.js → chunk-6RZUBD7A.js} +1 -1
- package/browser/chunk-6YFVWUFP.js +1 -0
- package/browser/{chunk-LN6ED2HF.js → chunk-7BGJAFEA.js} +1 -1
- package/browser/{chunk-H7A4LOFH.js → chunk-7MQRVE7E.js} +1 -1
- package/browser/{chunk-ZTCAFSDX.js → chunk-7TME2YLZ.js} +1 -1
- package/browser/{chunk-H2NKOG3U.js → chunk-7V5RIRTC.js} +1 -1
- package/browser/{chunk-ZFLT2KNY.js → chunk-A5C4DTSU.js} +1 -1
- package/browser/{chunk-AV7DTXWS.js → chunk-ATKHLJJ3.js} +1 -1
- package/browser/chunk-BD6N2UN6.js +1 -0
- package/browser/{chunk-GN7KRTUQ.js → chunk-BGEXT3EN.js} +1 -1
- package/browser/{chunk-POQ6PK6P.js → chunk-BWMTUVRQ.js} +1 -1
- package/browser/{chunk-PZWORCU2.js → chunk-CIMPBK5N.js} +1 -1
- package/browser/{chunk-TANV4K2Q.js → chunk-CRMVKTOY.js} +1 -1
- package/browser/{chunk-YQAOEJN2.js → chunk-DVSVPID7.js} +1 -1
- package/browser/{chunk-TZKO65ML.js → chunk-E3XC4CVU.js} +1 -1
- package/browser/chunk-E64XBDJ4.js +1 -0
- package/browser/{chunk-Q7GPLEGX.js → chunk-EQXGFCI5.js} +1 -1
- package/browser/{chunk-7DUVQCGC.js → chunk-ERQUBIFQ.js} +1 -1
- package/browser/{chunk-QJ3OBGZZ.js → chunk-FAM7HWYV.js} +1 -1
- package/browser/{chunk-ZH3XQHLJ.js → chunk-FEJVBWEX.js} +1 -1
- package/browser/{chunk-UFOTGZBF.js → chunk-FMAU2O5I.js} +1 -1
- package/browser/{chunk-JEGJL4TT.js → chunk-FTVXDMJT.js} +1 -1
- package/browser/chunk-G32LX34P.js +1 -0
- package/browser/{chunk-XIWUSJ3U.js → chunk-H27HCS4L.js} +1 -1
- package/browser/{chunk-EJH5VPZT.js → chunk-HE2ON544.js} +1 -1
- package/browser/chunk-HM6HNJMS.js +1 -0
- package/browser/{chunk-7UX5UET4.js → chunk-HO4VUFE6.js} +1 -1
- package/browser/{chunk-MQIE2KBB.js → chunk-HQZLHG3V.js} +1 -1
- package/browser/{chunk-RI2JQRSB.js → chunk-IRZNRZ5Q.js} +1 -1
- package/browser/chunk-JHUUVBVD.js +1 -0
- package/browser/{chunk-E5MP3JT3.js → chunk-JWURN5PB.js} +1 -1
- package/browser/{chunk-SUCGKO3W.js → chunk-K4C36S6V.js} +1 -1
- package/browser/{chunk-BM7HTRD4.js → chunk-KKZABPQU.js} +1 -1
- package/browser/{chunk-CREVHCXF.js → chunk-L3L75XR6.js} +1 -1
- package/browser/{chunk-7BYLIOKV.js → chunk-LBMJRBEQ.js} +1 -1
- package/browser/{chunk-P6D3VN2I.js → chunk-LH2YTDIO.js} +1 -1
- package/browser/{chunk-EMS3MOSZ.js → chunk-LM2BKZRF.js} +1 -1
- package/browser/{chunk-ATOA52OV.js → chunk-LRKPIL3B.js} +1 -1
- package/browser/{chunk-JLGR5C43.js → chunk-M7LNEVHA.js} +1 -1
- package/browser/{chunk-O4JNY3IM.js → chunk-ND3PB3FA.js} +1 -1
- package/browser/{chunk-FUVTYKQF.js → chunk-OBNBWBWU.js} +1 -1
- package/browser/{chunk-RBAVAHXW.js → chunk-OBV4LQBZ.js} +1 -1
- package/browser/chunk-OSVXE7XF.js +1 -0
- package/browser/{chunk-24EMVCMJ.js → chunk-P6ABEFHB.js} +1 -1
- package/browser/{chunk-4URCDOMP.js → chunk-PKBNMAQJ.js} +1 -1
- package/browser/{chunk-YTTJDHQV.js → chunk-PRFGHN7L.js} +1 -1
- package/browser/{chunk-WRTC44LF.js → chunk-QDRJZVVJ.js} +1 -1
- package/browser/{chunk-S4E4KZRV.js → chunk-RMRAPNZV.js} +1 -1
- package/browser/chunk-SCK76QV6.js +1 -0
- package/browser/chunk-SO5P7HTY.js +1 -0
- package/browser/{chunk-SR3JKZ3U.js → chunk-TG75SVZ4.js} +1 -1
- package/browser/{chunk-IWORAUIR.js → chunk-TS6GGNWA.js} +1 -1
- package/browser/{chunk-5YY3K2H4.js → chunk-TWMYRLVR.js} +1 -1
- package/browser/{chunk-5RSIAFID.js → chunk-TZMTC2HL.js} +1 -1
- package/browser/chunk-URX4BP67.js +1 -0
- package/browser/{chunk-RFEQZZ65.js → chunk-VYU454KQ.js} +1 -1
- package/browser/{chunk-J6XN2QQO.js → chunk-W6TYWCQH.js} +1 -1
- package/browser/{chunk-XG3WOI3P.js → chunk-WLSXA23B.js} +1 -1
- package/browser/{chunk-34XXAW4B.js → chunk-WN6IHVRI.js} +1 -1
- package/browser/{chunk-5ZZOXT2B.js → chunk-WQ5AIKDC.js} +1 -1
- package/browser/{chunk-QWADOF7R.js → chunk-WSIKJ6LY.js} +1 -1
- package/browser/chunk-WXOBY3EY.js +1 -0
- package/browser/{chunk-FPE2L5B6.js → chunk-XBPK63K2.js} +1 -1
- package/browser/{chunk-BWBXJSAF.js → chunk-XXFLSKH4.js} +1 -1
- package/browser/{chunk-4RQXBHNU.js → chunk-XXPGZDVF.js} +1 -1
- package/browser/chunk-YMLYNSOP.js +1 -0
- package/browser/{chunk-YJA5A4XF.js → chunk-ZAKB7MFY.js} +1 -1
- package/browser/{chunk-DIAV5ZVT.js → chunk-ZJUUFIFM.js} +1 -1
- package/browser/{chunk-ETLSYFBB.js → chunk-ZMCXRMG2.js} +1 -1
- package/browser/{chunk-6J2HD2IJ.js → chunk-ZU7FZEK3.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-JKZQAP3G.js → main-UE2RLE5B.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-34RQ5AVW.js +0 -1
- package/browser/chunk-75VP5HIT.js +0 -1
- package/browser/chunk-EU6MUKDF.js +0 -1
- package/browser/chunk-GTY23DMS.js +0 -1
- package/browser/chunk-HMFECYUP.js +0 -1
- package/browser/chunk-HNNYFORJ.js +0 -1
- package/browser/chunk-J3CZ3MOZ.js +0 -1
- package/browser/chunk-JTM5UHB2.js +0 -1
- package/browser/chunk-LT6BGRWZ.js +0 -1
- package/browser/chunk-OQBPCHYW.js +0 -1
- package/browser/chunk-PCPMONQV.js +0 -1
- package/browser/chunk-RYEX2DR7.js +0 -5
- package/browser/chunk-SK7JAK5K.js +0 -1
- package/browser/chunk-TPZGV5NA.js +0 -1
- package/browser/chunk-TUY5UD3L.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as Se,f as we,h as xe}from"./chunk-EJH5VPZT.js";import{g as Re,h as Le,j as Pe,k as Ve,l as We,m as B,n as Be}from"./chunk-GN7KRTUQ.js";import{c as Ee,d as Fe}from"./chunk-4URCDOMP.js";import{c as ve,d as be,l as Ce,r as Oe,t as V,u as W,v as Me}from"./chunk-RBAVAHXW.js";import{e as De,f as Ie,k as Ae,w as Te}from"./chunk-XG3WOI3P.js";import{A as ge,E as ye,K as ke,d as pe,r as me,t as ue,u as k,v as _e,x as fe,y as P}from"./chunk-TZKO65ML.js";import{$b as ce,A as b,B as w,Bb as ae,Db as y,Fb as f,G as z,Gb as re,Hb as T,Ib as ne,Jb as le,Ka as d,Kb as p,Lb as m,Pa as $,Pb as oe,R as x,Rb as E,S as D,Sb as se,T as _,Tb as F,Ub as R,Wa as J,Xa as Z,_ as G,aa as C,ab as ee,ca as l,ga as q,h as v,ha as H,ia as j,jb as M,ka as Q,lb as I,mb as A,mc as de,oa as O,rb as te,sb as s,t as S,ta as Y,tb as h,tc as he,ub as ie,uc as c,va as U,vc as L,y as K,ya as X}from"./chunk-RYEX2DR7.js";var Ye=["trigger"],Ue=["panel"],Xe=[[["mat-select-trigger"]],"*"],$e=["mat-select-trigger","*"];function Je(r,u){if(r&1&&(s(0,"span",4),F(1),h()),r&2){let e=f();d(),R(e.placeholder)}}function Ze(r,u){r&1&&T(0)}function et(r,u){if(r&1&&(s(0,"span",11),F(1),h()),r&2){let e=f(2);d(),R(e.triggerValue)}}function tt(r,u){if(r&1&&(s(0,"span",5),I(1,Ze,1,0)(2,et,2,1,"span",11),h()),r&2){let e=f();d(),A(e.customTrigger?1:2)}}function it(r,u){if(r&1){let e=ae();s(0,"div",12,1),y("keydown",function(i){q(e);let a=f();return H(a._handleKeydown(i))}),T(2,1),h()}if(r&2){let e=f();se(e.panelClass),E("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",(e._parentFormField==null?null:e._parentFormField.color)==="primary")("mat-accent",(e._parentFormField==null?null:e._parentFormField.color)==="accent")("mat-warn",(e._parentFormField==null?null:e._parentFormField.color)==="warn")("mat-undefined",!(e._parentFormField!=null&&e._parentFormField.color)),M("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var at=new C("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let r=l(Q);return()=>Ce(r)}}),rt=new C("MAT_SELECT_CONFIG"),nt=new C("MatSelectTrigger"),N=class{source;value;constructor(u,e){this.source=u,this.value=e}},Pt=(()=>{class r{_viewportRuler=l(ve);_changeDetectorRef=l(he);_elementRef=l(X);_dir=l(ge,{optional:!0});_idGenerator=l(ue);_renderer=l($);_parentFormField=l(we,{optional:!0});ngControl=l(Ie,{self:!0,optional:!0});_liveAnnouncer=l(me);_defaultOptions=l(rt,{optional:!0});_animationsDisabled=ke();_popoverLocation;_initialized=new v;_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,a=Ve(e,this.options,this.optionGroups),n=t._getHostElement();e===0&&a===1?i.scrollTop=0:i.scrollTop=We(n.offsetTop,n.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new N(this,e)}_scrollStrategyFactory=l(at);_panelOpen=!1;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new v;_errorStateTracker;stateChanges=new v;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Y(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(De.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=K(()=>{let e=this.options;return e?e.changes.pipe(x(e),D(()=>b(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(D(()=>this.optionSelectionChanges))});openedChange=new O;_openedStream=this.openedChange.pipe(w(e=>e),S(()=>{}));_closedStream=this.openedChange.pipe(w(e=>!e),S(()=>{}));selectionChange=new O;valueChange=new O;constructor(){let e=l(Ee),t=l(Ae,{optional:!0}),i=l(Te,{optional:!0}),a=l(new de("tabindex"),{optional:!0}),n=l(Oe,{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Fe(e,this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=a==null?0:parseInt(a)||0,this._popoverLocation=n?.usePopover===!1?null:"inline",this.id=this.id}ngOnInit(){this._selectionModel=new Be(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(_(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(_(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(x(null),_(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(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(z(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=`${this.id}-panel`;this._trackedModal&&P(this._trackedModal,"aria-owns",t),fe(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;P(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",a=>{a.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":!1}_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,a=t===13||t===32,n=this._keyManager;if(!n.isTyping()&&a&&!k(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let g=this.selected;n.onKeydown(e);let o=this.selected;o&&g!==o&&this._liveAnnouncer.announce(o.viewValue,1e4)}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,a=i===40||i===38,n=t.isTyping();if(a&&e.altKey)e.preventDefault(),this.close();else if(!n&&(i===13||i===32)&&t.activeItem&&!k(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!n&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let g=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(g?o.select():o.deselect())})}else{let g=t.activeItemIndex;t.onKeydown(e),this._multiple&&a&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==g&&t.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!k(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}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)Array.isArray(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!1;try{return(i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(a){return!1}});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,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof V?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 _e(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=b(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(_(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),b(...this.options.map(t=>t._stateChanges)).pipe(_(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=pe(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||r)};static \u0275cmp=J({type:r,selectors:[["mat-select"]],contentQueries:function(t,i,a){if(t&1&&ne(a,nt,5)(a,Pe,5)(a,Le,5),t&2){let n;p(n=m())&&(i.customTrigger=n.first),p(n=m())&&(i.options=n),p(n=m())&&(i.optionGroups=n)}},viewQuery:function(t,i){if(t&1&&le(Ye,5)(Ue,5)(W,5),t&2){let a;p(a=m())&&(i.trigger=a.first),p(a=m())&&(i.panel=a.first),p(a=m())&&(i._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&y("keydown",function(n){return i._handleKeydown(n)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(M("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()),E("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",c],disableRipple:[2,"disableRipple","disableRipple",c],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:L(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",c],placeholder:"placeholder",required:[2,"required","required",c],multiple:[2,"multiple","multiple",c],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",c],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",L],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",c]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[ce([{provide:Se,useExisting:r},{provide:Re,useExisting:r}]),U],ngContentSelectors:$e,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&&(re(Xe),s(0,"div",2,0),y("click",function(){return i.open()}),s(3,"div",3),I(4,Je,2,1,"span",4)(5,tt,3,1,"span",5),h(),s(6,"div",6)(7,"div",7),j(),s(8,"svg",8),ie(9,"path",9),h()()()(),ee(10,it,3,16,"ng-template",10),y("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(n){return i._handleOverlayKeydown(n)})),t&2){let a=oe(1);d(3),M("id",i._valueId),d(),A(i.empty?4:5),d(6),te("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||a)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayUsePopover",i._popoverLocation)}},dependencies:[V,W],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
1
|
+
import{e as Se,f as we,h as xe}from"./chunk-HE2ON544.js";import{g as Re,h as Le,j as Pe,k as Ve,l as We,m as B,n as Be}from"./chunk-BGEXT3EN.js";import{c as Ee,d as Fe}from"./chunk-PKBNMAQJ.js";import{c as ve,d as be,l as Ce,r as Oe,t as V,u as W,v as Me}from"./chunk-OBV4LQBZ.js";import{e as De,f as Ie,k as Ae,w as Te}from"./chunk-WLSXA23B.js";import{A as ge,E as ye,K as ke,d as pe,r as me,t as ue,u as k,v as _e,x as fe,y as P}from"./chunk-E3XC4CVU.js";import{A as b,B as w,Bb as ae,Db as y,Fb as f,G as z,Gb as re,Hb as T,Ib as ne,Jb as le,Ka as d,Kb as p,Lb as m,Pa as $,Pb as oe,R as x,Rb as E,S as D,Sb as se,T as _,Tb as F,Ub as R,Wa as J,Xa as Z,_ as G,aa as C,ab as ee,ac as ce,ca as l,ga as q,h as v,ha as H,ia as j,jb as M,ka as Q,lb as I,mb as A,nc as de,oa as O,rb as te,sb as s,t as S,ta as Y,tb as h,ub as ie,uc as he,va as U,vc as c,wc as L,y as K,ya as X}from"./chunk-5J7BTB5J.js";var Ye=["trigger"],Ue=["panel"],Xe=[[["mat-select-trigger"]],"*"],$e=["mat-select-trigger","*"];function Je(r,u){if(r&1&&(s(0,"span",4),F(1),h()),r&2){let e=f();d(),R(e.placeholder)}}function Ze(r,u){r&1&&T(0)}function et(r,u){if(r&1&&(s(0,"span",11),F(1),h()),r&2){let e=f(2);d(),R(e.triggerValue)}}function tt(r,u){if(r&1&&(s(0,"span",5),I(1,Ze,1,0)(2,et,2,1,"span",11),h()),r&2){let e=f();d(),A(e.customTrigger?1:2)}}function it(r,u){if(r&1){let e=ae();s(0,"div",12,1),y("keydown",function(i){q(e);let a=f();return H(a._handleKeydown(i))}),T(2,1),h()}if(r&2){let e=f();se(e.panelClass),E("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",(e._parentFormField==null?null:e._parentFormField.color)==="primary")("mat-accent",(e._parentFormField==null?null:e._parentFormField.color)==="accent")("mat-warn",(e._parentFormField==null?null:e._parentFormField.color)==="warn")("mat-undefined",!(e._parentFormField!=null&&e._parentFormField.color)),M("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var at=new C("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let r=l(Q);return()=>Ce(r)}}),rt=new C("MAT_SELECT_CONFIG"),nt=new C("MatSelectTrigger"),N=class{source;value;constructor(u,e){this.source=u,this.value=e}},Pt=(()=>{class r{_viewportRuler=l(ve);_changeDetectorRef=l(he);_elementRef=l(X);_dir=l(ge,{optional:!0});_idGenerator=l(ue);_renderer=l($);_parentFormField=l(we,{optional:!0});ngControl=l(Ie,{self:!0,optional:!0});_liveAnnouncer=l(me);_defaultOptions=l(rt,{optional:!0});_animationsDisabled=ke();_popoverLocation;_initialized=new v;_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,a=Ve(e,this.options,this.optionGroups),n=t._getHostElement();e===0&&a===1?i.scrollTop=0:i.scrollTop=We(n.offsetTop,n.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new N(this,e)}_scrollStrategyFactory=l(at);_panelOpen=!1;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new v;_errorStateTracker;stateChanges=new v;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Y(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(De.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=K(()=>{let e=this.options;return e?e.changes.pipe(x(e),D(()=>b(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(D(()=>this.optionSelectionChanges))});openedChange=new O;_openedStream=this.openedChange.pipe(w(e=>e),S(()=>{}));_closedStream=this.openedChange.pipe(w(e=>!e),S(()=>{}));selectionChange=new O;valueChange=new O;constructor(){let e=l(Ee),t=l(Ae,{optional:!0}),i=l(Te,{optional:!0}),a=l(new de("tabindex"),{optional:!0}),n=l(Oe,{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Fe(e,this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=a==null?0:parseInt(a)||0,this._popoverLocation=n?.usePopover===!1?null:"inline",this.id=this.id}ngOnInit(){this._selectionModel=new Be(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(_(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(_(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(x(null),_(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(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(z(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=`${this.id}-panel`;this._trackedModal&&P(this._trackedModal,"aria-owns",t),fe(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;P(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",a=>{a.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":!1}_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,a=t===13||t===32,n=this._keyManager;if(!n.isTyping()&&a&&!k(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let g=this.selected;n.onKeydown(e);let o=this.selected;o&&g!==o&&this._liveAnnouncer.announce(o.viewValue,1e4)}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,a=i===40||i===38,n=t.isTyping();if(a&&e.altKey)e.preventDefault(),this.close();else if(!n&&(i===13||i===32)&&t.activeItem&&!k(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!n&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let g=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(g?o.select():o.deselect())})}else{let g=t.activeItemIndex;t.onKeydown(e),this._multiple&&a&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==g&&t.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!k(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}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)Array.isArray(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!1;try{return(i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(a){return!1}});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,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof V?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 _e(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=b(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(_(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),b(...this.options.map(t=>t._stateChanges)).pipe(_(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=pe(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||r)};static \u0275cmp=J({type:r,selectors:[["mat-select"]],contentQueries:function(t,i,a){if(t&1&&ne(a,nt,5)(a,Pe,5)(a,Le,5),t&2){let n;p(n=m())&&(i.customTrigger=n.first),p(n=m())&&(i.options=n),p(n=m())&&(i.optionGroups=n)}},viewQuery:function(t,i){if(t&1&&le(Ye,5)(Ue,5)(W,5),t&2){let a;p(a=m())&&(i.trigger=a.first),p(a=m())&&(i.panel=a.first),p(a=m())&&(i._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&y("keydown",function(n){return i._handleKeydown(n)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(M("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()),E("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",c],disableRipple:[2,"disableRipple","disableRipple",c],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:L(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",c],placeholder:"placeholder",required:[2,"required","required",c],multiple:[2,"multiple","multiple",c],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",c],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",L],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",c]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[ce([{provide:Se,useExisting:r},{provide:Re,useExisting:r}]),U],ngContentSelectors:$e,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&&(re(Xe),s(0,"div",2,0),y("click",function(){return i.open()}),s(3,"div",3),I(4,Je,2,1,"span",4)(5,tt,3,1,"span",5),h(),s(6,"div",6)(7,"div",7),j(),s(8,"svg",8),ie(9,"path",9),h()()()(),ee(10,it,3,16,"ng-template",10),y("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(n){return i._handleOverlayKeydown(n)})),t&2){let a=oe(1);d(3),M("id",i._valueId),d(),A(i.empty?4:5),d(6),te("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||a)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayUsePopover",i._popoverLocation)}},dependencies:[V,W],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}return r})();var Vt=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Z({type:r});static \u0275inj=G({imports:[Me,B,ye,be,xe,B]})}return r})();export{Pt as a,Vt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
1
|
+
import{a as k}from"./chunk-L3L75XR6.js";import{c as T}from"./chunk-7MQRVE7E.js";import{o as D,t as L,u as E}from"./chunk-BGEXT3EN.js";import{a as U}from"./chunk-IRZNRZ5Q.js";import{Bb as w,Db as a,Fb as m,Ka as d,Pb as R,Tb as v,Ub as C,Wa as c,ab as I,ca as p,ga as y,ha as b,ic as M,lb as _,lc as S,ma as x,mb as g,oc as h,pc as q,rb as u,sb as s,tb as o}from"./chunk-5J7BTB5J.js";function O(i,e){if(i&1&&(s(0,"span",3),v(1),o()),i&2){let t=m();d(),C(t.subtitle)}}var f=class i{user=q.required();editRequested=h();deleteRequested=h();menuItems=[{key:"edit",label:"Edit user",icon:"edit"},{key:"delete",label:"Delete user",icon:"delete",variant:"danger"}];get displayName(){let{firstname:e,lastname:t,email:n}=this.user();return[e,t].filter(Boolean).join(" ")||n||"\u2014"}get subtitle(){return this.user().email??this.user().externalId??""}onMenuAction(e){switch(e){case"edit":this.editRequested.emit(this.user());break;case"delete":confirm(`Delete user "${this.displayName}"?`)&&this.deleteRequested.emit(this.user());break}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=c({type:i,selectors:[["agentos-user-item"]],inputs:{user:[1,"user"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem",1,"user-item"],[1,"user-item__body"],[1,"user-item__name"],[1,"user-item__subtitle"],[1,"user-item__actions"],[3,"itemSelected","items"]],template:function(t,n){t&1&&(s(0,"div",0)(1,"div",1)(2,"span",2),v(3),o(),_(4,O,2,1,"span",3),o(),s(5,"div",4)(6,"ds-kebab-menu",5),a("itemSelected",function(l){return n.onMenuAction(l)}),o()()()),t&2&&(d(3),C(n.displayName),d(),g(n.subtitle?4:-1),d(2),u("items",n.menuItems))},dependencies:[E],styles:[".user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;width:100%;padding:1rem 1.25rem;background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px;box-sizing:border-box;overflow:hidden;position:relative}.user-item__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.user-item__name[_ngcontent-%COMP%]{font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__subtitle[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0}"],changeDetection:0})};function P(i,e){if(i&1){let t=w();s(0,"agentos-user-item",4),a("editRequested",function(r){y(t);let l=m(2);return b(l.navigateToEdit(r))})("deleteRequested",function(r){y(t);let l=m(2);return b(l.deleteUser(r))}),o()}i&2&&u("user",e)}function V(i,e){if(i&1&&_(0,P,1,1,"agentos-user-item",3),i&2){let t,n=e.$implicit,r=m();g((t=r.resolveUser(n.id))?0:-1,t)}}var A=class i{router=p(T);destroyRef=p(x);userAdminState=p(k);isLoading=this.userAdminState.isLoading;userItems=S(()=>this.userAdminState.users().map(e=>({id:e.id??"",name:[e.firstname,e.lastname].filter(Boolean).join(" ")||e.email||"\u2014",description:e.email})));get usersById(){return new Map(this.userAdminState.users().map(e=>[e.id??"",e]))}ngOnInit(){this.userAdminState.loadAll().pipe(U(this.destroyRef)).subscribe()}goBack(){this.router.navigate(["/agentos"])}navigateToCreate(){this.router.navigate(["/agentos/admin/users/new"])}navigateToEdit(e){this.router.navigate(["/agentos/admin/users",e.id??"","edit"])}deleteUser(e){this.userAdminState.deleteUser(e.id??"").pipe(U(this.destroyRef)).subscribe()}resolveUser(e){return this.usersById.get(e)??null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=c({type:i,selectors:[["agentos-user-list"]],decls:4,vars:3,consts:[["userItemTpl",""],["title","Users","emptyMessage","No users found.","cardMinWidth","320px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"user"],[3,"editRequested","deleteRequested","user"]],template:function(t,n){if(t&1&&(s(0,"ds-entity-list",1),a("createRequested",function(){return n.navigateToCreate()}),s(1,"ds-icon-button",2),a("action",function(){return n.goBack()}),o()(),I(2,V,1,1,"ng-template",null,0,M)),t&2){let r=R(3);u("items",n.userItems())("showCreate",!0)("itemTemplate",r)}},dependencies:[L,f,D],encapsulation:2,changeDetection:0})};export{f as a,A as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{l as p}from"./chunk-BD6N2UN6.js";import{V as s,Z as d,a as n,ca as u,ta as a}from"./chunk-5J7BTB5J.js";var c=class o{userController=u(p);users=a([]);isLoading=a(!1);loadAll(){return this.isLoading.set(!0),this.userController.listAllUser().pipe(s({next:e=>{this.users.set(e),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)}))}createUser(e){return this.userController.createUser(e).pipe(s(()=>{this.loadAll().subscribe()}))}updateUser(e,r){let t=this.users().find(i=>i.id===e);if(!t)throw new Error(`Cannot update: user ${e} not found in state`);let U=n(n({},t),r);return this.userController.updateUser(e,U).pipe(s(i=>{this.users.update(b=>b.map(l=>l.id===i.id?i:l))}))}deleteUser(e){return this.userController.deleteUser(e).pipe(s(()=>{this.users.update(r=>r.filter(t=>t.id!==e))}))}static \u0275fac=function(r){return new(r||o)};static \u0275prov=d({token:o,factory:o.\u0275fac,providedIn:"root"})};export{c as a};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as De,e as Y,f as Ce,g as Ae,i as v,j as D,k as M,m as Te,n as Oe,o as xe,q as B,s as we,v as j}from"./chunk-
|
|
1
|
+
import{b as De,e as Y,f as Ce,g as Ae,i as v,j as D,k as M,m as Te,n as Oe,o as xe,q as B,s as we,v as j}from"./chunk-OBV4LQBZ.js";import{A as U,E as ve,K as Z,c as R,e as pe,f as q,h as fe,p as _e,q as ye,s as be,t as b,u as P}from"./chunk-E3XC4CVU.js";import{$a as f,A as te,B as _,Cb as W,G as p,Jb as he,Kb as me,Lb as ue,Ma as ne,Na as se,Pa as re,R as T,Rb as Q,Wa as E,Xa as S,Ya as y,Z as O,_ as x,_a as le,a as c,aa as u,ab as F,b as ee,ca as s,h as m,j as G,jb as L,ka as h,la as ie,oa as w,pa as ae,sb as de,ta as oe,tb as ce,uc as ge,wa as k,y as A,ya as I}from"./chunk-5J7BTB5J.js";function Be(i,o){}var g=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var K=(()=>{class i extends Ae{_elementRef=s(I);_focusTrapFactory=s(ye);_config;_interactivityChecker=s(_e);_ngZone=s(ae);_focusMonitor=s(fe);_renderer=s(re);_changeDetectorRef=s(ge);_injector=s(h);_platform=s(pe);_document=s(ie);_portalOutlet;_focusTrapped=new m;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=s(g,{optional:!0})||new g,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let t=this._ariaLabelledByQueue.indexOf(e);t>-1&&(this._ariaLabelledByQueue.splice(t,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),t}attachTemplatePortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),t}attachDomPortal=e=>{this._portalOutlet.hasAttached();let t=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),t};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,t){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let a=()=>{n(),l(),e.removeAttribute("tabindex")},n=this._renderer.listen(e,"blur",a),l=this._renderer.listen(e,"mousedown",a)})),e.focus(t)}_focusByCssSelector(e,t){let a=this._elementRef.nativeElement.querySelector(e);a&&this._forceFocus(a,t)}_trapFocus(e){this._isDestroyed||ne(()=>{let t=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||t.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,t=null;if(typeof e=="string"?t=this._document.querySelector(e):typeof e=="boolean"?t=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(t=e),this._config.restoreFocus&&t&&typeof t.focus=="function"){let a=R(),n=this._elementRef.nativeElement;(!a||a===this._document.body||a===n||n.contains(a))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,t=R();return e===t||e.contains(t)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=R()))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["cdk-dialog-container"]],viewQuery:function(t,a){if(t&1&&he(v,7),t&2){let n;me(n=ue())&&(a._portalOutlet=n.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(t,a){t&2&&L("id",a._config.id||null)("role",a._config.role)("aria-modal",a._config.ariaModal)("aria-labelledby",a._config.ariaLabel?null:a._ariaLabelledByQueue[0])("aria-label",a._config.ariaLabel)("aria-describedby",a._config.ariaDescribedBy||null)},features:[f],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,a){t&1&&F(0,Be,0,0,"ng-template",0)},dependencies:[v],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
|
|
2
2
|
`],encapsulation:2})}return i})(),C=class{overlayRef;config;componentInstance=null;componentRef=null;containerInstance;disableClose;closed=new m;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(o,e){this.overlayRef=o,this.config=e,this.disableClose=e.disableClose,this.backdropClick=o.backdropClick(),this.keydownEvents=o.keydownEvents(),this.outsidePointerEvents=o.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(t=>{t.keyCode===27&&!this.disableClose&&!P(t)&&(t.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=o.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(o,e){if(this._canClose(o)){let t=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),t.next(o),t.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(o="",e=""){return this.overlayRef.updateSize({width:o,height:e}),this}addPanelClass(o){return this.overlayRef.addPanelClass(o),this}removePanelClass(o){return this.overlayRef.removePanelClass(o),this}_canClose(o){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(o,e,this.componentInstance))}},je=new u("DialogScrollStrategy",{providedIn:"root",factory:()=>{let i=s(h);return()=>M(i)}}),Ne=new u("DialogData"),Ve=new u("DefaultDialogConfig");function ze(i){let o=oe(i),e=new w;return{valueSignal:o,get value(){return o()},change:e,ngOnDestroy(){e.complete()}}}var X=(()=>{class i{_injector=s(h);_defaultOptions=s(Ve,{optional:!0});_parentDialog=s(i,{optional:!0,skipSelf:!0});_overlayContainer=s(Oe);_idGenerator=s(b);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new m;_afterOpenedAtThisLevel=new m;_ariaHiddenElements=new Map;_scrollStrategy=s(je);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=A(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(T(void 0)));constructor(){}open(e,t){let a=this._defaultOptions||new g;t=c(c({},a),t),t.id=t.id||this._idGenerator.getId("cdk-dialog-"),t.id&&this.getDialogById(t.id);let n=this._getOverlayConfig(t),l=we(this._injector,n),r=new C(l,t),d=this._attachContainer(l,r,t);if(r.containerInstance=d,!this.openDialogs.length){let H=this._overlayContainer.getContainerElement();d._focusTrapped?d._focusTrapped.pipe(p(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(H)}):this._hideNonDialogContentFromAssistiveTechnology(H)}return this._attachDialogContent(e,r,d,t),this.openDialogs.push(r),r.closed.subscribe(()=>this._removeOpenDialog(r,!0)),this.afterOpened.next(r),r}closeAll(){$(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){$(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),$(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let t=new Te({positionStrategy:e.positionStrategy||B().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(t.backdropClass=e.backdropClass),t}_attachContainer(e,t,a){let n=a.injector||a.viewContainerRef?.injector,l=[{provide:g,useValue:a},{provide:C,useValue:t},{provide:xe,useValue:e}],r;a.container?typeof a.container=="function"?r=a.container:(r=a.container.type,l.push(...a.container.providers(a))):r=K;let d=new Y(r,a.viewContainerRef,h.create({parent:n||this._injector,providers:l}));return e.attach(d).instance}_attachDialogContent(e,t,a,n){if(e instanceof se){let l=this._createInjector(n,t,a,void 0),r={$implicit:n.data,dialogRef:t};n.templateContext&&(r=c(c({},r),typeof n.templateContext=="function"?n.templateContext():n.templateContext)),a.attachTemplatePortal(new Ce(e,null,r,l))}else{let l=this._createInjector(n,t,a,this._injector),r=a.attachComponentPortal(new Y(e,n.viewContainerRef,l));t.componentRef=r,t.componentInstance=r.instance}}_createInjector(e,t,a,n){let l=e.injector||e.viewContainerRef?.injector,r=[{provide:Ne,useValue:e.data},{provide:C,useValue:t}];return e.providers&&(typeof e.providers=="function"?r.push(...e.providers(t,e,a)):r.push(...e.providers)),e.direction&&(!l||!l.get(U,null,{optional:!0}))&&r.push({provide:U,useValue:ze(e.direction)}),h.create({parent:l||n,providers:r})}_removeOpenDialog(e,t){let a=this.openDialogs.indexOf(e);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((n,l)=>{n?l.setAttribute("aria-hidden",n):l.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),t&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let t=e.parentElement.children;for(let a=t.length-1;a>-1;a--){let n=t[a];n!==e&&n.nodeName!=="SCRIPT"&&n.nodeName!=="STYLE"&&!n.hasAttribute("aria-live")&&!n.hasAttribute("popover")&&(this._ariaHiddenElements.set(n,n.getAttribute("aria-hidden")),n.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(t){return new(t||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function $(i,o){let e=i.length;for(;e--;)o(i[e])}var Ie=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=S({type:i});static \u0275inj=x({providers:[X],imports:[j,D,be,D]})}return i})();function He(i,o){}var V=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},J="mdc-dialog--open",Ee="mdc-dialog--opening",Se="mdc-dialog--closing",Ge=150,We=75,Qe=(()=>{class i extends K{_animationStateChanged=new w;_animationsEnabled=!Z();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?Le(this._config.enterAnimationDuration)??Ge:0;_exitAnimationDuration=this._animationsEnabled?Le(this._config.exitAnimationDuration)??We:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(Fe,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Ee,J)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(J),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(J),this._animationsEnabled?(this._hostElement.style.setProperty(Fe,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Se)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(Ee,Se)}_waitForAnimationToComplete(e,t){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(t,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let t=super.attachComponentPortal(e);return t.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),t}static \u0275fac=(()=>{let e;return function(a){return(e||(e=k(i)))(a||i)}})();static \u0275cmp=E({type:i,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(t,a){t&2&&(W("id",a._config.id),L("aria-modal",a._config.ariaModal)("role",a._config.role)("aria-labelledby",a._config.ariaLabel?null:a._ariaLabelledByQueue[0])("aria-label",a._config.ariaLabel)("aria-describedby",a._config.ariaDescribedBy||null),Q("_mat-animation-noopable",!a._animationsEnabled)("mat-mdc-dialog-container-with-actions",a._actionSectionCount>0))},features:[f],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(t,a){t&1&&(de(0,"div",0)(1,"div",1),F(2,He,0,0,"ng-template",2),ce()())},dependencies:[v],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
|
|
3
3
|
`],encapsulation:2})}return i})(),Fe="--mat-dialog-transition-duration";function Le(i){return i==null?null:typeof i=="number"?i:i.endsWith("ms")?q(i.substring(0,i.length-2)):i.endsWith("s")?q(i.substring(0,i.length-1))*1e3:i==="0"?0:null}var N=(function(i){return i[i.OPEN=0]="OPEN",i[i.CLOSING=1]="CLOSING",i[i.CLOSED=2]="CLOSED",i})(N||{}),z=class{_ref;_config;_containerInstance;componentInstance;componentRef=null;disableClose;id;_afterOpened=new G(1);_beforeClosed=new G(1);_result;_closeFallbackTimeout;_state=N.OPEN;_closeInteractionType;constructor(o,e,t){this._ref=o,this._config=e,this._containerInstance=t,this.disableClose=e.disableClose,this.id=o.id,o.addPanelClass("mat-mdc-dialog-panel"),t._animationStateChanged.pipe(_(a=>a.state==="opened"),p(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(_(a=>a.state==="closed"),p(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),o.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),te(this.backdropClick(),this.keydownEvents().pipe(_(a=>a.keyCode===27&&!this.disableClose&&!P(a)))).subscribe(a=>{this.disableClose||(a.preventDefault(),qe(this,a.type==="keydown"?"keyboard":"mouse"))})}close(o){let e=this._config.closePredicate;e&&!e(o,this._config,this.componentInstance)||(this._result=o,this._containerInstance._animationStateChanged.pipe(_(t=>t.state==="closing"),p(1)).subscribe(t=>{this._beforeClosed.next(o),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.totalTime+100)}),this._state=N.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(o){let e=this._ref.config.positionStrategy;return o&&(o.left||o.right)?o.left?e.left(o.left):e.right(o.right):e.centerHorizontally(),o&&(o.top||o.bottom)?o.top?e.top(o.top):e.bottom(o.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(o="",e=""){return this._ref.updateSize(o,e),this}addPanelClass(o){return this._ref.addPanelClass(o),this}removePanelClass(o){return this._ref.removePanelClass(o),this}getState(){return this._state}_finishDialogClose(){this._state=N.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function qe(i,o,e){return i._closeInteractionType=o,i.close(e)}var Ue=new u("MatMdcDialogData"),Ye=new u("mat-mdc-dialog-default-options"),Ze=new u("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let i=s(h);return()=>M(i)}}),Re=(()=>{class i{_defaultOptions=s(Ye,{optional:!0});_scrollStrategy=s(Ze);_parentDialog=s(i,{optional:!0,skipSelf:!0});_idGenerator=s(b);_injector=s(h);_dialog=s(X);_animationsDisabled=Z();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new m;_afterOpenedAtThisLevel=new m;dialogConfigClass=V;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=A(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(T(void 0)));constructor(){this._dialogRefConstructor=z,this._dialogContainerType=Qe,this._dialogDataToken=Ue}open(e,t){let a;t=c(c({},this._defaultOptions||new V),t),t.id=t.id||this._idGenerator.getId("mat-mdc-dialog-"),t.scrollStrategy=t.scrollStrategy||this._scrollStrategy();let n=this._dialog.open(e,ee(c({},t),{positionStrategy:B(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||t.enterAnimationDuration?.toLocaleString()==="0"||t.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:t},{provide:g,useValue:t}]},templateContext:()=>({dialogRef:a}),providers:(l,r,d)=>(a=new this._dialogRefConstructor(l,t,d),a.updatePosition(t?.position),[{provide:this._dialogContainerType,useValue:d},{provide:this._dialogDataToken,useValue:r.data},{provide:this._dialogRefConstructor,useValue:a}])}));return a.componentRef=n.componentRef,a.componentInstance=n.componentInstance,this.openDialogs.push(a),this.afterOpened.next(a),a.afterClosed().subscribe(()=>{let l=this.openDialogs.indexOf(a);l>-1&&(this.openDialogs.splice(l,1),this.openDialogs.length||this._getAfterAllClosed().next())}),a}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let t=e.length;for(;t--;)e[t].close()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Pe=(()=>{class i{_dialogRef=s(z,{optional:!0});_elementRef=s(I);_dialog=s(Re);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=$e(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(t){return new(t||i)};static \u0275dir=y({type:i})}return i})(),jt=(()=>{class i extends Pe{id=s(b).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(a){return(e||(e=k(i)))(a||i)}})();static \u0275dir=y({type:i,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(t,a){t&2&&W("id",a.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[f]})}return i})(),Nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275dir=y({type:i,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[le([De])]})}return i})(),Vt=(()=>{class i extends Pe{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(a){return(e||(e=k(i)))(a||i)}})();static \u0275dir=y({type:i,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(t,a){t&2&&Q("mat-mdc-dialog-actions-align-start",a.align==="start")("mat-mdc-dialog-actions-align-center",a.align==="center")("mat-mdc-dialog-actions-align-end",a.align==="end")},inputs:{align:"align"},features:[f]})}return i})();function $e(i,o){let e=i.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?o.find(t=>t.id===e.id):null}var zt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=S({type:i});static \u0275inj=x({providers:[Re],imports:[Ie,j,D,ve]})}return i})();export{z as a,Ue as b,Ye as c,Re as d,jt as e,Nt as f,Vt as g,zt as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
1
|
+
import{a as B}from"./chunk-OBNBWBWU.js";import{a as G}from"./chunk-AIC4U2MU.js";import{a as K}from"./chunk-7TME2YLZ.js";import{a as V}from"./chunk-ZMCXRMG2.js";import"./chunk-PRFGHN7L.js";import"./chunk-JHUUVBVD.js";import"./chunk-BD6N2UN6.js";import{a as N,c as D}from"./chunk-7MQRVE7E.js";import{o as $,t as L}from"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import{a as d}from"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import{Bb as b,Db as u,Fb as s,Ic as q,Ka as h,Pb as S,S as g,Tb as x,Ub as E,Wa as I,ab as P,bc as w,ca as n,ec as O,fc as M,ga as c,ha as l,ic as T,lb as C,m as f,ma as y,mb as R,rb as v,sb as p,t as _,ta as A,tb as m}from"./chunk-5J7BTB5J.js";var z=()=>[];function W(r,e){if(r&1&&(p(0,"p",3),x(1),m()),r&2){let t=s().$implicit;h(),E(t.name)}}function U(r,e){if(r&1){let t=b();p(0,"agentos-ai-provider-item",5),u("editRequested",function(){let o=c(t),a=s(2);return l(a.onEdit(o))})("deleteRequested",function(){let o=c(t),a=s(2);return l(a.onDelete(o))})("duplicateRequested",function(){let o=c(t),a=s(2);return l(a.onDuplicate(o))}),m()}if(r&2){let t=e,i=s(2);v("config",t.config)("scope",t.scope)("readOnly",t.scope==="namespace"&&!i.isAdmin())}}function X(r,e){if(r&1&&C(0,W,2,1,"p",3)(1,U,1,3,"agentos-ai-provider-item",4),r&2){let t,i=e.$implicit,o=s();R(o.isEmptyPlaceholder(i.id)?0:(t=o.resolve(i.id))?1:-1,t)}}var k=Object.freeze({namespace:"AI Providers du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class r{route=n(N);router=n(D);destroyRef=n(y);state=n(K);namespaceRole=n(V);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=A(!1);listItems$=this.state.vm$.pipe(_(e=>this.toListItems(e)));resolved=new Map;ngOnInit(){this.route.paramMap.pipe(d(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t)}),this.route.paramMap.pipe(_(e=>e.get("namespaceId")??""),g(e=>e?this.namespaceRole.isAdminOfNamespace$(e):f(!1)),d(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(d(this.destroyRef)).subscribe(e=>{let t=new Map;e.namespace.forEach(i=>{i.id&&t.set(this.itemKey("namespace",i.id),{config:i,scope:"namespace"})}),e.userOnNs.forEach(i=>{i.id&&t.set(this.itemKey("userOnNs",i.id),{config:i,scope:"userOnNs"})}),e.userGlobal.forEach(i=>{i.id&&t.set(this.itemKey("userGlobal",i.id),{config:i,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,"ai-providers","new"],{queryParams:{scope:G(this.isAdmin())}})}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"ai-providers",t,"edit"],{queryParams:{scope:e.scope}})}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(d(this.destroyRef)).subscribe({error:i=>{console.error(`[AiProvidersAllScopes] Delete failed for ${e.scope}:${t}:`,i)}})}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}})}toListItems(e){let t=[];return 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 AI Provider",groupKey:e,groupLabel:k[e]}]:t.filter(i=>!!i.id).map(i=>({id:this.itemKey(e,i.id),name:i.name,description:i.apiType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=I({type:r,selectors:[["agentos-ai-providers-all-scopes"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","AI Providers","emptyMessage","No AI providers available.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"ai-providers-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,i){if(t&1&&(p(0,"ds-entity-list",1),O(1,"async"),u("createRequested",function(){return i.openCreateForm()}),p(2,"ds-icon-button",2),u("action",function(){return i.goBack()}),m()(),P(3,X,2,1,"ng-template",null,0,T)),t&2){let o=S(4);v("items",M(1,3,i.listItems$)??w(5,z))("showCreate",!0)("itemTemplate",o)}},dependencies:[L,B,$,q],styles:[".ai-providers-all-scopes__empty[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);padding:.5rem .25rem;margin:0;font-style:italic}"],changeDetection:0})};export{j as AiProvidersAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l,b as p,c as m}from"./chunk-
|
|
1
|
+
import{a as l,b as p,c as m}from"./chunk-4F2LQOD7.js";import{Xc as o,Za as s,ca as i}from"./chunk-5J7BTB5J.js";var d=class a{sanitizer=i(o);renderer=this.buildRenderer();transform(r){if(!r)return"";let e=p.parse(r,{renderer:this.renderer,breaks:!0,gfm:!0,async:!1}),t=m.sanitize(e,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i});return this.sanitizer.bypassSecurityTrustHtml(t)}buildRenderer(){let r=new l,e=r.link.bind(r);return r.link=t=>{let n=e(t);return this.isExternal(t.href)&&(n=n.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ').replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')),n},r}isExternal(r){if(!r||r.startsWith("/")||r.startsWith("#")||r.startsWith("?"))return!1;if(r.startsWith("//"))return!0;try{return new URL(r,window.location.href).hostname!==window.location.hostname}catch(e){return!1}}static \u0275fac=function(e){return new(e||a)};static \u0275pipe=s({name:"agentosMarkdown",type:a,pure:!0})};export{d as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as de,b as w}from"./chunk-H2NKOG3U.js";import{D as $,J as se,P as ce,R as re,S as ie,Tc as E,V as g,Z as c,a as T,b as C,ca as a,d,h as j,i as r,m as D,n as k,pa as le,t as te,u as ne}from"./chunk-RYEX2DR7.js";var N=class n{http=a(E);projectState=a(w);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let t=e?{name:e}:{};return this.http.post(this.getBaseUrl(),t)}updateThread(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:t})}updateThreadUsers(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:t})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var U=class n{selectedThreadIdSubject=new r(null);isLoadingSubject=new r(!1);isLoadingThreadListSubject=new r(!1);refreshThreadListSubject=new j;threadListSubject=new r([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=a(N);projectStateService=a(w);projectApi=a(de);projectName$=this.projectStateService.selectedProject$.pipe(te(e=>e?.name),se());constructor(){ne([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(re(void 0))]).pipe(g(([e])=>{e!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=e),e?this.hasLoadedOncePerProject.get(e)?console.log("[THREAD_STATE] Refreshing thread list for project",e,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",e,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),ie(([e])=>e?(console.log("[THREAD_STATE] Fetching threads for project:",e),this.threadApi.listThreads().pipe(te(t=>({threads:t,projectName:e})),$(t=>(console.error("[THREAD_STATE] Error loading thread list:",t),D({threads:[],projectName:e}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),D({threads:[],projectName:null}))),g(({threads:e,projectName:t})=>{console.log("[THREAD_STATE] Thread list loaded:",e.length,"threads for project",t),t&&this.hasLoadedOncePerProject.set(t,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(e)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new j;selectedThread$=ne([this.projectName$,this.selectedThreadIdSubject.pipe(se()),this.refreshSelectedThreadSubject.pipe(re(void 0))]).pipe(ie(([e,t])=>!e||!t?D(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(t).pipe(ce({bufferSize:1,refCount:!0})))),g(()=>{this.isLoadingSubject.next(!1)}));selectThread(e){this.selectedThreadIdSubject.next(e)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let e=this.selectedThreadIdSubject.value;if(!e)throw new Error("[THREAD_STATE] No thread selected");return e}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let e=this.selectedThreadIdSubject.value;if(!e){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",e),this.threadApi.stopThread(e).subscribe({next:t=>console.log("[THREAD_STATE] Stop signal sent:",t.message),error:t=>console.error("[THREAD_STATE] Error stopping thread:",t)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}updateStarLocal(e,t,s){let P=this.threadListSubject.value.map(l=>{if(l.id!==e)return l;let p=l.starring||[];return t&&!p.includes(s)?C(T({},l),{starring:[...p,s]}):!t&&p.includes(s)?C(T({},l),{starring:p.filter(I=>I!==s)}):l});this.threadListSubject.next(P)}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(e,t){return this.threadApi.updateThreadUsers(e,t).pipe(g(()=>{this.refreshThreadList()}),$(s=>(console.error("[THREAD_STATE] Error updating thread users:",s),k(()=>s))))}markDone(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark done: no project selected");return}this.projectApi.markThreadDone(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as done:",s)})}markActive(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark active: no project selected");return}this.projectApi.markThreadActive(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as active:",s)})}renameThread(e,t){let s=t.trim();return!s||s.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),k(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",e,"to:",s),this.threadApi.updateThread(e,s).pipe(g(i=>{console.log("[THREAD_STATE] Thread renamed successfully:",i),this.refreshThreadList()}),$(i=>(console.error("[THREAD_STATE] Error renaming thread:",i),k(()=>i)))))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var ue=class n{http=a(E);usernameSubject=new r(null);authEnabledSubject=new r(!1);username$=this.usernameSubject.asObservable();authEnabled$=this.authEnabledSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(g(e=>{this.usernameSubject.next(e.username),this.authEnabledSubject.next(e.authEnabled)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var L=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new r("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();voiceInputModeSubject=new r("browser");voiceInputMode$=this.voiceInputModeSubject.asObservable();enterToSendSubject=new r(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new r(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new r("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new r(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new r(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new r(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new r(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new r(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new r(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new r(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new r(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new r(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new r(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new r("light");theme$=this.themeSubject.asObservable();missionPreviewEnabledSubject=new r(!1);missionPreviewEnabled$=this.missionPreviewEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(s);let i=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(i);let P=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(P);let l=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(l);let p=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(p);let I=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(I);let _=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(_);let K=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(K);let G=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(G);let Q=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(Q);let J=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(J);let Y=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(Y);let X=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(X);let Z=this.getPreferenceSync("missionPreviewEnabled",!1)??!1;this.missionPreviewEnabledSubject.next(Z);let ee=this.getPreferenceSync("voiceInputMode","browser")??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return d(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(s);let i=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(i);let P=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(P);let l=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(l);let p=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(p);let I=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(I);let _=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(_);let K=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(K);let G=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(G);let Q=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(Q);let J=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(J);let Y=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(Y);let X=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(X);let Z=(yield this.getPreferenceAsync("missionPreviewEnabled",!1))??!1;this.missionPreviewEnabledSubject.next(Z);let ee=(yield this.getPreferenceAsync("voiceInputMode","browser"))??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}}getPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let s=yield this.electronStorage.get(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}}setPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let s=yield this.electronStorage.get(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t),e==="voiceInputMode"&&this.voiceInputModeSubject.next(t),e==="missionPreviewEnabled"&&this.missionPreviewEnabledSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setVoiceInputMode(e){console.log("[PREFERENCES] Setting voice input mode to:",e),this.setPreference("voiceInputMode",e)}getVoiceInputMode(){return this.getPreference("voiceInputMode","browser")??"browser"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}setMissionPreviewEnabled(e){this.setPreference("missionPreviewEnabled",e)}getMissionPreviewEnabled(){return this.getPreference("missionPreviewEnabled",!1)??!1}getMissionPreviewPanelWidth(){return this.getPreference("missionPreviewPanelWidth",33)??33}setMissionPreviewPanelWidth(e){this.setPreference("missionPreviewPanelWidth",e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function oe(n,e=80){if(n.length<=e)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let t=JSON.parse(n),s=JSON.stringify(t);return s.length<=e?s:s.substring(0,e)+`...(${s.length} chars)`}}catch(t){}return n.substring(0,e)+"..."}var o=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let s=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${s}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},q=class extends o{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new u({answer:e,parentKey:this.timestamp,invite:this.invite})}},F=class n extends o{static type="heartbeat";constructor(e){super(e,n.type)}},f=class n extends q{defaultValue;static type="invite";constructor(e){super(e,n.type),this.defaultValue=e.defaultValue}},He="InviteEventDefault",u=class n extends o{answer;invite;name;silent;static type="answer";constructor(e){super(e,n.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name,this.silent=e.silent}},A=class n extends o{speaker;text;static type="text";constructor(e){super(e,n.type),this.speaker=e.speaker,this.text=e.text}},B=class n extends o{chunk;static type="text_chunk";constructor(e){super(e,n.type),this.chunk=e.chunk,this.length=this.chunk.length}},M=class n extends o{warning;static type="warn";constructor(e){super(e,n.type),this.warning=e.warning}},h=class n extends o{error;static type="error";constructor(e){super(e,n.type),this.error=e.error}},b=class n extends q{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,n.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},v=class n extends o{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,n.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new m({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=oe(this.args,e);return`\u{1F527} ${this.name}(${t})`}},m=class n extends o{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,n.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),s=oe(t,e),i=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${s}${i}`}},O=class n extends o{static type="thinking";static debounce=5e3;constructor(e){super(e,n.type)}},y=class n extends o{summary;static type="summary";constructor(e){super(e,n.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${oe(this.summary,e)}`}},S=class n extends o{role;name;content;static type="message";constructor(e){super(e,n.type),this.role=e.role,this.name=e.name,this.content=e.content,this.length=this.content.map(t=>{if(t.type==="text")return t.content.length;if(t.type==="image"){let s=(t.width||0)*(t.height||0)/750;return s?s*3.5:t.content.length}return t.type==="audio"?t.transcription?.length??100:0}).reduce((t,s)=>t+s,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
1
|
+
import{a as de,b as w}from"./chunk-7V5RIRTC.js";import{D as $,J as se,P as ce,R as re,S as ie,Uc as E,V as g,Z as c,a as T,b as C,ca as a,d,h as j,i as r,m as D,n as k,pa as le,t as te,u as ne}from"./chunk-5J7BTB5J.js";var N=class n{http=a(E);projectState=a(w);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let t=e?{name:e}:{};return this.http.post(this.getBaseUrl(),t)}updateThread(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:t})}updateThreadUsers(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:t})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var U=class n{selectedThreadIdSubject=new r(null);isLoadingSubject=new r(!1);isLoadingThreadListSubject=new r(!1);refreshThreadListSubject=new j;threadListSubject=new r([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=a(N);projectStateService=a(w);projectApi=a(de);projectName$=this.projectStateService.selectedProject$.pipe(te(e=>e?.name),se());constructor(){ne([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(re(void 0))]).pipe(g(([e])=>{e!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=e),e?this.hasLoadedOncePerProject.get(e)?console.log("[THREAD_STATE] Refreshing thread list for project",e,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",e,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),ie(([e])=>e?(console.log("[THREAD_STATE] Fetching threads for project:",e),this.threadApi.listThreads().pipe(te(t=>({threads:t,projectName:e})),$(t=>(console.error("[THREAD_STATE] Error loading thread list:",t),D({threads:[],projectName:e}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),D({threads:[],projectName:null}))),g(({threads:e,projectName:t})=>{console.log("[THREAD_STATE] Thread list loaded:",e.length,"threads for project",t),t&&this.hasLoadedOncePerProject.set(t,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(e)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new j;selectedThread$=ne([this.projectName$,this.selectedThreadIdSubject.pipe(se()),this.refreshSelectedThreadSubject.pipe(re(void 0))]).pipe(ie(([e,t])=>!e||!t?D(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(t).pipe(ce({bufferSize:1,refCount:!0})))),g(()=>{this.isLoadingSubject.next(!1)}));selectThread(e){this.selectedThreadIdSubject.next(e)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let e=this.selectedThreadIdSubject.value;if(!e)throw new Error("[THREAD_STATE] No thread selected");return e}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let e=this.selectedThreadIdSubject.value;if(!e){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",e),this.threadApi.stopThread(e).subscribe({next:t=>console.log("[THREAD_STATE] Stop signal sent:",t.message),error:t=>console.error("[THREAD_STATE] Error stopping thread:",t)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}updateStarLocal(e,t,s){let P=this.threadListSubject.value.map(l=>{if(l.id!==e)return l;let p=l.starring||[];return t&&!p.includes(s)?C(T({},l),{starring:[...p,s]}):!t&&p.includes(s)?C(T({},l),{starring:p.filter(I=>I!==s)}):l});this.threadListSubject.next(P)}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(e,t){return this.threadApi.updateThreadUsers(e,t).pipe(g(()=>{this.refreshThreadList()}),$(s=>(console.error("[THREAD_STATE] Error updating thread users:",s),k(()=>s))))}markDone(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark done: no project selected");return}this.projectApi.markThreadDone(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as done:",s)})}markActive(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark active: no project selected");return}this.projectApi.markThreadActive(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as active:",s)})}renameThread(e,t){let s=t.trim();return!s||s.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),k(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",e,"to:",s),this.threadApi.updateThread(e,s).pipe(g(i=>{console.log("[THREAD_STATE] Thread renamed successfully:",i),this.refreshThreadList()}),$(i=>(console.error("[THREAD_STATE] Error renaming thread:",i),k(()=>i)))))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var ue=class n{http=a(E);usernameSubject=new r(null);authEnabledSubject=new r(!1);username$=this.usernameSubject.asObservable();authEnabled$=this.authEnabledSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(g(e=>{this.usernameSubject.next(e.username),this.authEnabledSubject.next(e.authEnabled)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var L=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new r("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();voiceInputModeSubject=new r("browser");voiceInputMode$=this.voiceInputModeSubject.asObservable();enterToSendSubject=new r(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new r(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new r("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new r(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new r(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new r(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new r(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new r(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new r(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new r(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new r(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new r(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new r(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new r("light");theme$=this.themeSubject.asObservable();missionPreviewEnabledSubject=new r(!1);missionPreviewEnabled$=this.missionPreviewEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(s);let i=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(i);let P=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(P);let l=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(l);let p=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(p);let I=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(I);let _=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(_);let K=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(K);let G=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(G);let Q=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(Q);let J=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(J);let Y=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(Y);let X=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(X);let Z=this.getPreferenceSync("missionPreviewEnabled",!1)??!1;this.missionPreviewEnabledSubject.next(Z);let ee=this.getPreferenceSync("voiceInputMode","browser")??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return d(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(s);let i=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(i);let P=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(P);let l=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(l);let p=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(p);let I=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(I);let _=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(_);let K=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(K);let G=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(G);let Q=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(Q);let J=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(J);let Y=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(Y);let X=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(X);let Z=(yield this.getPreferenceAsync("missionPreviewEnabled",!1))??!1;this.missionPreviewEnabledSubject.next(Z);let ee=(yield this.getPreferenceAsync("voiceInputMode","browser"))??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}}getPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let s=yield this.electronStorage.get(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}}setPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let s=yield this.electronStorage.get(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t),e==="voiceInputMode"&&this.voiceInputModeSubject.next(t),e==="missionPreviewEnabled"&&this.missionPreviewEnabledSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setVoiceInputMode(e){console.log("[PREFERENCES] Setting voice input mode to:",e),this.setPreference("voiceInputMode",e)}getVoiceInputMode(){return this.getPreference("voiceInputMode","browser")??"browser"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}setMissionPreviewEnabled(e){this.setPreference("missionPreviewEnabled",e)}getMissionPreviewEnabled(){return this.getPreference("missionPreviewEnabled",!1)??!1}getMissionPreviewPanelWidth(){return this.getPreference("missionPreviewPanelWidth",33)??33}setMissionPreviewPanelWidth(e){this.setPreference("missionPreviewPanelWidth",e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function oe(n,e=80){if(n.length<=e)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let t=JSON.parse(n),s=JSON.stringify(t);return s.length<=e?s:s.substring(0,e)+`...(${s.length} chars)`}}catch(t){}return n.substring(0,e)+"..."}var o=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let s=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${s}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},q=class extends o{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new u({answer:e,parentKey:this.timestamp,invite:this.invite})}},F=class n extends o{static type="heartbeat";constructor(e){super(e,n.type)}},f=class n extends q{defaultValue;static type="invite";constructor(e){super(e,n.type),this.defaultValue=e.defaultValue}},He="InviteEventDefault",u=class n extends o{answer;invite;name;silent;static type="answer";constructor(e){super(e,n.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name,this.silent=e.silent}},A=class n extends o{speaker;text;static type="text";constructor(e){super(e,n.type),this.speaker=e.speaker,this.text=e.text}},B=class n extends o{chunk;static type="text_chunk";constructor(e){super(e,n.type),this.chunk=e.chunk,this.length=this.chunk.length}},M=class n extends o{warning;static type="warn";constructor(e){super(e,n.type),this.warning=e.warning}},h=class n extends o{error;static type="error";constructor(e){super(e,n.type),this.error=e.error}},b=class n extends q{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,n.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},v=class n extends o{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,n.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new m({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=oe(this.args,e);return`\u{1F527} ${this.name}(${t})`}},m=class n extends o{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,n.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),s=oe(t,e),i=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${s}${i}`}},O=class n extends o{static type="thinking";static debounce=5e3;constructor(e){super(e,n.type)}},y=class n extends o{summary;static type="summary";constructor(e){super(e,n.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${oe(this.summary,e)}`}},S=class n extends o{role;name;content;static type="message";constructor(e){super(e,n.type),this.role=e.role,this.name=e.name,this.content=e.content,this.length=this.content.map(t=>{if(t.type==="text")return t.content.length;if(t.type==="image"){let s=(t.width||0)*(t.height||0)/750;return s?s*3.5:t.content.length}return t.type==="audio"?t.transcription?.length??100:0}).reduce((t,s)=>t+s,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
2
2
|
`)}},V=class n extends o{threadId;name;summary;users;static type="thread_update";constructor(e){super(e,n.type),this.threadId=e.threadId,this.name=e.name,this.summary=e.summary,this.users=e.users}},z=class n extends o{filename;operation;size;mimeType;static type="file";constructor(e){super(e,n.type),this.filename=e.filename,this.operation=e.operation,this.size=e.size,this.mimeType=e.mimeType}toSingleLineString(){let e=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",t=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${e} ${this.operation}: ${this.filename}${t}`}},H=class n extends o{authUrl;state;integrationName;static type="oauth_request";constructor(e){super(e,n.type),this.authUrl=e.authUrl,this.state=e.state,this.integrationName=e.integrationName}},R=class n extends o{subThreadId;agentName;static type="delegation";constructor(e){super(e,n.type),this.subThreadId=e.subThreadId,this.agentName=e.agentName}},W=class n extends o{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(e){super(e,n.type),this.code=e.code,this.state=e.state,this.integrationName=e.integrationName,this.error=e.error,this.errorDescription=e.errorDescription}},fe={[S.type]:S,[u.type]:u,[b.type]:b,[R.type]:R,[h.type]:h,[F.type]:F,[f.type]:f,[v.type]:v,[m.type]:m,[A.type]:A,[B.type]:B,[O.type]:O,[M.type]:M,[V.type]:V,[y.type]:y,[z.type]:z,[H.type]:H,[W.type]:W};function ae(n){let e=fe[n.type];return e?new e(n):void 0}var Ye=[{id:"builtin-plan",name:"plan",description:"Build a plan to complete the given task",source:"builtin",commands:[`@ We start a 3 phase process to build a comprehensive execution plan for the following task:
|
|
3
3
|
|
|
4
4
|
<task>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-7MQRVE7E.js";import{Ka as i,Tb as p,Ub as h,Wa as l,ca as s,vb as c,wb as u}from"./chunk-5J7BTB5J.js";var m="coday_oauth_callback",d=class r{route=s(g);message="Authentication in progress...";ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),a=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",o,"Opener:",!!window.opener),o){if(console.log("[OAuth Callback] OAuth error received:",o,a),!window.opener){console.warn("[OAuth Callback] No window.opener \u2014 using localStorage fallback for error"),localStorage.setItem(m,JSON.stringify({error:o,state:e,errorDescription:a})),this.message="Authentication failed. You can close this window.",setTimeout(()=>window.close(),1e3);return}try{window.opener.postMessage({error:o,state:e,errorDescription:a},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(n){console.error("[OAuth Callback] Error sending error postMessage:",n),alert("OAuth error: Failed to communicate with parent window")}return}if(!t){console.error("[OAuth Callback] Missing authorization code"),this.message="OAuth callback error: Missing authorization code.";return}if(!window.opener){console.warn("[OAuth Callback] No window.opener \u2014 using localStorage fallback"),localStorage.setItem(m,JSON.stringify({code:t,state:e})),this.message="Authentication complete. You can close this window.",setTimeout(()=>window.close(),1e3);return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(n){console.error("[OAuth Callback] Error sending postMessage:",n),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=l({type:r,selectors:[["app-oauth-callback"]],decls:2,vars:1,template:function(e,o){e&1&&(c(0,"p"),p(1),u()),e&2&&(i(),h(o.message))},encapsulation:2})};export{m as a,d as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as Re}from"./chunk-
|
|
1
|
+
import{f as Re}from"./chunk-HE2ON544.js";import{g as Te,h as Fe,i as De,j as Le,k as je,l as xe,m as R}from"./chunk-BGEXT3EN.js";import{c as ye,d as Oe,f as Se,l as Ae,m as we,p as Pe,s as Ce,v as ke}from"./chunk-OBV4LQBZ.js";import{a as Ee}from"./chunk-WLSXA23B.js";import{b as Ie}from"./chunk-7V5RIRTC.js";import{A as ve,E as be,I as Me,K as I,c as ue,d as de,e as he,l as me,n as _e,t as ge,u as g,v as fe,x as M,y as f}from"./chunk-E3XC4CVU.js";import{A as m,B as O,Cb as te,Db as ie,Fb as oe,G as L,Gb as ne,Hb as se,I as j,Ib as ae,Jb as re,Kb as u,Lb as d,Ma as U,Na as q,Pa as Y,R as x,Rb as le,S as _,Sa as G,Sb as ce,Uc as pe,V as B,Wa as z,Xa as Q,Y as V,Ya as X,Z as N,_ as $,aa as S,ac as C,bb as Z,ca as r,e as h,ea as W,g as v,h as b,jb as P,ka as A,m as y,oa as p,pa as H,t as F,uc as k,va as K,vb as J,vc as c,wb as ee,y as D,ya as w}from"./chunk-5J7BTB5J.js";var Be=class a{http=r(pe);projectState=r(Ie);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(n){return this.http.get(`${this.getBaseUrl()}/${n}`)}createScheduler(n){return this.http.post(this.getBaseUrl(),n)}listSchedulersForProject(n){return this.http.get(`/api/projects/${n}/schedulers`)}enableSchedulerForProject(n,e){return this.http.post(`/api/projects/${n}/schedulers/${e}/enable`,{})}disableSchedulerForProject(n,e){return this.http.post(`/api/projects/${n}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(n,e){return this.http.post(`/api/projects/${n}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(n,e){return this.http.delete(`/api/projects/${n}/schedulers/${e}`)}updateSchedulerForProject(n,e,t){return this.http.put(`/api/projects/${n}/schedulers/${e}`,t)}createSchedulerForProject(n,e){return this.http.post(`/api/projects/${n}/schedulers`,e)}updateScheduler(n,e){return this.http.put(`${this.getBaseUrl()}/${n}`,e)}deleteScheduler(n){return this.http.delete(`${this.getBaseUrl()}/${n}`)}enableScheduler(n){return this.http.post(`${this.getBaseUrl()}/${n}/enable`,{})}disableScheduler(n){return this.http.post(`${this.getBaseUrl()}/${n}/disable`,{})}runSchedulerNow(n){return this.http.post(`${this.getBaseUrl()}/${n}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=N({token:a,factory:a.\u0275fac,providedIn:"root"})};var qe=["panel"],Ye=["*"];function Ge(a,n){if(a&1&&(J(0,"div",1,0),se(2),ee()),a&2){let e=n.id,t=oe();ce(t._classList),le("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),te("id",t.id),P("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e))}}var E=class{source;option;constructor(n,e){this.source=n,this.option=e}},$e=new S("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1})}),It=(()=>{class a{_changeDetectorRef=r(k);_elementRef=r(w);_defaults=r($e);_animationsDisabled=I();_activeOptionChanges=h.EMPTY;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=!1;optionSelected=new p;opened=new p;closed=new p;optionActivated=new p;set classList(e){this._classList=e,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}id=r(ge).getId("mat-autocomplete-");inertGroups;constructor(){let e=r(he);this.inertGroups=e?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new fe(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe()}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(e){let t=new E(this,e);this.optionSelected.emit(t)}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return!1}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=z({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,o){if(t&1&&ae(o,Le,5)(o,Fe,5),t&2){let s;u(s=d())&&(i.options=s),u(s=d())&&(i.optionGroups=s)}},viewQuery:function(t,i){if(t&1&&re(q,7)(qe,5),t&2){let o;u(o=d())&&(i.template=o.first),u(o=d())&&(i.panel=o.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",c],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",c],requireSelection:[2,"requireSelection","requireSelection",c],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",c],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",c]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[C([{provide:Te,useExisting:a}])],ngContentSelectors:Ye,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(ne(),Z(0,Ge,3,17,"ng-template"))},styles:[`div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden,.cdk-overlay-pane:has(>.mat-mdc-autocomplete-hidden){visibility:hidden;pointer-events:none}@keyframes _mat-autocomplete-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}.mat-autocomplete-panel-animations-enabled{animation:_mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1)}mat-autocomplete{display:none}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}return a})();var ze={provide:Ee,useExisting:V(()=>Xe),multi:!0};var Qe=new S("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let a=r(A);return()=>Ae(a)}}),Xe=(()=>{class a{_environmentInjector=r(W);_element=r(w);_injector=r(A);_viewContainerRef=r(G);_zone=r(H);_changeDetectorRef=r(k);_dir=r(ve,{optional:!0});_formField=r(Re,{optional:!0,host:!0});_viewportRuler=r(ye);_scrollStrategy=r(Qe);_renderer=r(Y);_animationsDisabled=I();_defaults=r($e,{optional:!0});_overlayRef=null;_portal;_componentDestroyed=!1;_initialized=new b;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=h.EMPTY;_breakpointObserver=r(_e);_handsetLandscapeSubscription=h.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new b;_overlayPanelClass=me(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus()};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled=!1;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&f(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return m(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(O(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(O(()=>this._overlayAttached)):y()).pipe(F(e=>e instanceof De?e:null))}optionSelections=D(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(x(e),_(()=>m(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(_(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new v(e=>{let t=o=>{let s=de(o),l=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,T=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&s!==this._element.nativeElement&&!this._hasFocus()&&(!l||!l.contains(s))&&(!T||!T.contains(s))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(s)&&e.next(o)},i=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return()=>{i.forEach(o=>o())}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e))}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._element.nativeElement.disabled=e}_handleKeydown(e){let t=e,i=t.keyCode,o=g(t);if(i===27&&!o&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&i===13&&this.panelOpen&&!o)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let s=this.autocomplete._keyManager.activeItem,l=i===38||i===40;i===9||l&&!o&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):l&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(l||this.autocomplete._keyManager.activeItem!==s)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(e){let t=e.target,i=t.value;if(t.type==="number"&&(i=i==""?null:parseFloat(i)),this._previousValue!==i){if(this._previousValue=i,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(i),!i)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let o=this.autocomplete.options?.find(s=>s.selected);if(o){let s=this._getDisplayValue(o.value);i!==s&&o.deselect(!1)}}if(this._canOpen()&&this._hasFocus()){let o=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(o)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_hasFocus(){return ue()===this._element.nativeElement}_floatLabel(e=!1){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let e=new v(i=>{U(()=>{i.next()},{injector:this._environmentInjector})}),t=this.autocomplete.options?.changes.pipe(B(()=>this._positionStrategy.reapplyLastPosition()),j(0))??y();return m(e,t).pipe(_(()=>this._zone.run(()=>{let i=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),i!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),L(1)).subscribe(i=>this._setValueAndClose(i))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(e){let t=this.autocomplete;return t&&t.displayWith?t.displayWith(e):e}_assignOptionValue(e){let t=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(t??"")}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e}_setValueAndClose(e){let t=this.autocomplete,i=e?e.source:this._pendingAutoselectedOption;i?(this._clearPreviousSelectedOption(i),this._assignOptionValue(i.value),this._onChange(i.value),t._emitSelectEvent(i),this._element.nativeElement.focus()):t.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(e,t){this.autocomplete?.options?.forEach(i=>{i!==e&&i.selected&&i.deselect(t)})}_openPanelInternal(e=this._element.nativeElement.value){if(this._attachOverlay(e),this._floatLabel(),this._trackedModal){let t=this.autocomplete.id;M(this._trackedModal,"aria-owns",t)}}_attachOverlay(e){if(!this.autocomplete)return;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new Se(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=Ce(this._injector,this._getOverlayConfig()),this._overlayRef=t,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&t&&t.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Me.HandsetLandscape).subscribe(o=>{o.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),t&&!t.hasAttached()&&(t.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let i=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&i!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=e=>{(e.keyCode===27&&!g(e)||e.keyCode===38&&g(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=void 0}_getOverlayConfig(){return new we({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:this._overlayPanelClass,disableAnimations:this._animationsDisabled})}_getOverlayPosition(){let e=Pe(this._injector,this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1).withPopoverLocation("inline");return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let t=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],i=this._aboveClass,o=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}],s;this.position==="above"?s=o:this.position==="below"?s=t:s=[...t,...o],e.withPositions(s)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let t=-1;for(let i=0;i<e.options.length;i++)if(!e.options.get(i).disabled){t=i;break}e._keyManager.setActiveItem(t)}else e._keyManager.setActiveItem(-1)}_canOpen(){let e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_scrollToOption(e){let t=this.autocomplete,i=je(e,t.options,t.optionGroups);if(e===0&&i===1)t._setScrollTop(0);else if(t.panel){let o=t.options.toArray()[e];if(o){let s=o._getHostElement(),l=xe(s.offsetTop,s.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(l)}}}_trackedModal=null;_applyModalPanelOwnership(){let e=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=this.autocomplete.id;this._trackedModal&&f(this._trackedModal,"aria-owns",t),M(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(this._trackedModal){let e=this.autocomplete.id;f(this._trackedModal,"aria-owns",e),this._trackedModal=null}}static \u0275fac=function(t){return new(t||a)};static \u0275dir=X({type:a,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,i){t&1&&ie("focusin",function(){return i._handleFocus()})("blur",function(){return i._onTouched()})("input",function(s){return i._handleInput(s)})("keydown",function(s){return i._handleKeydown(s)})("click",function(){return i._handleClick()}),t&2&&P("autocomplete",i.autocompleteAttribute)("role",i.autocompleteDisabled?null:"combobox")("aria-autocomplete",i.autocompleteDisabled?null:"list")("aria-activedescendant",i.panelOpen&&i.activeOption?i.activeOption.id:null)("aria-expanded",i.autocompleteDisabled?null:i.panelOpen.toString())("aria-controls",i.autocompleteDisabled||!i.panelOpen||i.autocomplete==null?null:i.autocomplete.id)("aria-haspopup",i.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",c]},exportAs:["matAutocompleteTrigger"],features:[C([ze]),K]})}return a})(),Rt=(()=>{class a{static \u0275fac=function(t){return new(t||a)};static \u0275mod=Q({type:a});static \u0275inj=$({imports:[ke,R,Oe,R,be]})}return a})();export{It as a,Xe as b,Rt as c,Be as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as M,u as D}from"./chunk-
|
|
1
|
+
import{o as M,u as D}from"./chunk-BGEXT3EN.js";import{Bb as v,Db as g,Fb as a,Ka as r,Tb as c,Ub as b,Vb as P,Wa as y,ga as s,ha as m,jb as h,lb as p,lc as C,mb as _,oc as f,pc as u,rb as w,sb as n,ta as x,tb as i}from"./chunk-5J7BTB5J.js";function A(t,d){if(t&1&&(n(0,"span",4),c(1),i()),t&2){let e=a();h("data-variant",e.badge().variant)("aria-label",e.badge().ariaLabel),r(),P(" ",e.badge().label," ")}}function I(t,d){if(t&1&&(n(0,"span",6),c(1),i()),t&2){let e=a();r(),b(e.config().baseUrl)}}function k(t,d){if(t&1){let e=v();n(0,"span",8),c(1,"Delete?"),i(),n(2,"ds-icon-button",9),g("action",function(){s(e);let l=a();return m(l.onDeleteConfirmed())}),i(),n(3,"ds-icon-button",10),g("action",function(){s(e);let l=a();return m(l.onDeleteCancelled())}),i()}}function E(t,d){if(t&1){let e=v();n(0,"ds-kebab-menu",13),g("itemSelected",function(l){s(e);let S=a(2);return m(S.onMenuAction(l))}),i()}if(t&2){let e=a(2);w("items",e.menuItems())}}function R(t,d){if(t&1){let e=v();n(0,"ds-icon-button",11),g("action",function(){s(e);let l=a();return m(l.onDuplicate())}),i(),p(1,E,1,1,"ds-kebab-menu",12)}if(t&2){let e=a();r(),_(e.readOnly()?-1:1)}}var q=Object.freeze({namespace:{label:"NS",ariaLabel:"Configuration partag\xE9e du namespace",variant:"neutral"},userOnNs:{label:"USER \xD7 NS",ariaLabel:"Configuration utilisateur sur ce namespace",variant:"info"},userGlobal:{label:"USER GLOBAL",ariaLabel:"Configuration utilisateur globale",variant:"warning"}}),O=class t{config=u.required();scope=u.required();readOnly=u(!1);showBadge=u(!0);editRequested=f();deleteRequested=f();duplicateRequested=f();pendingDelete=x(!1);badge=C(()=>q[this.scope()]);menuItems=C(()=>[{key:"edit",label:"Edit provider",icon:"edit"},{key:"delete",label:"Delete provider",icon:"delete",variant:"danger"}]);onMenuAction(d){switch(d){case"edit":this.editRequested.emit(this.config());break;case"delete":this.pendingDelete.set(!0);break}}onDuplicate(){this.duplicateRequested.emit(this.config())}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.config())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["agentos-ai-provider-item"]],inputs:{config:[1,"config"],scope:[1,"scope"],readOnly:[1,"readOnly"],showBadge:[1,"showBadge"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested",duplicateRequested:"duplicateRequested"},decls:12,vars:5,consts:[["role","listitem",1,"ai-provider-item"],[1,"ai-provider-item__body"],[1,"ai-provider-item__heading"],[1,"ai-provider-item__name"],[1,"ai-provider-item__badge"],[1,"ai-provider-item__type"],[1,"ai-provider-item__url"],[1,"ai-provider-item__actions"],[1,"ai-provider-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","content_copy","title","Duplicate this provider",3,"action"],[3,"items"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),c(4),i(),p(5,A,2,3,"span",4),i(),n(6,"span",5),c(7),i(),p(8,I,2,1,"span",6),i(),n(9,"div",7),p(10,k,4,0)(11,R,2,1),i()()),e&2&&(r(4),b(o.config().name),r(),_(o.showBadge()?5:-1),r(2),b(o.config().apiType),r(),_(o.config().baseUrl?8:-1),r(2),_(o.pendingDelete()?10:11))},dependencies:[D,M],styles:[".ai-provider-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);transition:background .15s ease,border-color .15s ease}.ai-provider-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-primary)}.ai-provider-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-provider-item__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.ai-provider-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.ai-provider-item__badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.65rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:.1rem .4rem;border-radius:4px;line-height:1.2}.ai-provider-item__badge[data-variant=neutral][_ngcontent-%COMP%]{background:var(--color-bg-secondary);color:var(--color-text-secondary)}.ai-provider-item__badge[data-variant=info][_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-info) 15%,transparent);color:var(--color-info)}.ai-provider-item__badge[data-variant=warning][_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-warning) 15%,transparent);color:var(--color-warning)}.ai-provider-item__type[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-provider-item__url[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-provider-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-provider-item[_ngcontent-%COMP%]:hover .ai-provider-item__actions[_ngcontent-%COMP%], .ai-provider-item[_ngcontent-%COMP%]:focus-within .ai-provider-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-provider-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};export{O as a};
|