1import{a as ie,b as Ze}from"./chunk-WVGPV5DE.js";import{b as ui}from"./chunk-UZ3ALPIR.js";import{a as we,b as xi,c as Mi,d as ke,e as Fi}from"./chunk-F4S6YZLK.js";import{a as Si,b as wi,c as ki,d as Ai}from"./chunk-VHCSP5YS.js";import{a as We}from"./chunk-2RI2AWAT.js";import{a as fi}from"./chunk-TNCRHRKD.js";import{a as Di}from"./chunk-72UEF3G2.js";import{a as Ye,b as vi,d as bi}from"./chunk-77JINHLV.js";import{a as si}from"./chunk-YE26XUZE.js";import{a as Pi,b as Ei,c as Ii,d as De,e as Ri,f as Vi}from"./chunk-XY63EEUF.js";import{p as ci,r as hi,s as Ci}from"./chunk-NQXIRLBD.js";import{a as ni}from"./chunk-2VD7UGO7.js";import{b as _i,c as yi}from"./chunk-G2WCWVJH.js";import{b as li,c as mi,d as pi,g as di}from"./chunk-N7APNT3K.js";import{a as Se}from"./chunk-I6NC4JTQ.js";import{c as gi}from"./chunk-B5Q3SFNL.js";import{a as Ni,b as Ti}from"./chunk-DG5C5ETO.js";import{a as Zt}from"./chunk-BTHSCOLW.js";import{W as ze,X as ti,Y as ii,Z as je,_ as ye,a as Re,b as Ve,c as Ae,d as Xt,e as Oe,f as Ge,g as qe,h as Le,k as ge,l as _e}from"./chunk-JG2FXJFB.js";import{E as Ce,F as Qe,G as He,e as Be,o as Jt}from"./chunk-ZQOKDUDZ.js";import{I as E,Ua as fe,gb as Yt}from"./chunk-LSBXKOIM.js";import{a as ri,b as ai,c as $e,d as ve}from"./chunk-3AZP5W52.js";import{f as ei,j as W,k as J}from"./chunk-AG7CNCK4.js";import{a as oi,c as ee,d as te}from"./chunk-4XE67YXS.js";import{b as X,d as Ue,f as $}from"./chunk-HOFLFO46.js";import{H as he,u as Kt}from"./chunk-76NNUBWD.js";import{A as jt,E as $t,G as V,H as A,a as Ut,c as K,e as ue,h as b,i as x,j as Fe,m as j,p as Bt,s as Qt,v as Ht,w as M,x as F,z as zt}from"./chunk-2NYU7F75.js";import{Q as Wt}from"./chunk-LBKJROAR.js";import{$ as St,Aa as Dt,Ab as r,Ac as D,Bc as N,Ca as S,Cc as It,Ed as qt,Gc as I,Ha as y,Ia as v,Kb as ne,L as Ft,Ld as de,Mb as Tt,Mc as d,Md as Lt,Oc as m,Pa as ae,Pc as ce,Qb as h,Qc as oe,Rc as Ie,Sb as Pt,Sc as T,Ta as Nt,Tb as Ee,Tc as C,Uc as g,Wb as Et,Wc as le,Xa as Pe,Xc as me,Zc as gt,_a as U,_c as _,bd as p,cd as Z,d as xt,dd as L,ed as Rt,hd as Vt,ic as f,id as At,j as Mt,jd as Ot,mc as w,nd as pe,oc as k,pc as se,qc as Me,ra as wt,rc as B,sc as Q,tc as l,ub as Ct,uc as a,ud as H,vc as s,wa as kt,wc as P,wd as z,zd as Gt}from"./chunk-P2QKVCYW.js";import{a as q,b as Y}from"./chunk-W7GRJBO5.js";var Bi=["dateInput"];function Qi(o,t){if(o&1){let e=I();D(0,1),a(1,"spai-date-field",2,0),d("dateChange",function(n){y(e);let c=m();return v(c.dateChangeHandler(n))}),s(),N()}if(o&2){let e=m();l("formGroup",e.metricForm),r(),_("is-gpt",e.metric.source===e.metricSource.GPT),l("id",e.id)("name",e.name)("formControlName",e.metric==null?null:e.metric.shortName),f("data-testid","metric-date-"+(e.metric==null?null:e.metric.shortName))}}var Ke=class o{constructor(){this.metricSource=E}focus(){this.dateField.representDateInput.nativeElement?.focus()}dateChangeHandler(){if(this.dateField._displayValue===""){this.metricForm.get(this.metric.shortName).setValue(null);return}this.metricForm.get(this.metric.shortName).setValue(this.dateField._displayValue||null)}defaultClick(){this.metricForm.get(this.metric.shortName).setValue(new Date(this.metric.defaultValue)),this.metricForm.get(this.metric.shortName).isSetDefaultClick=!0}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-date"]],viewQuery:function(e,i){if(e&1&&T(ze,5)(Bi,5),e&2){let n;C(n=g())&&(i.dateField=n.first),C(n=g())&&(i.dateInput=n.first)}}
1,inputs:{metric:"metric",metricForm:"metricForm",id:"id",name:"name",hideDefault:"hideDefault"},standalone:!1,decls:1,vars:1,consts:[["dateInput",""],[3,"formGroup"],[3,"dateChange","id","name","formControlName"]],template:function(e,i){e&1&&w(0,Qi,3,7,"ng-container",1),e&2&&k(i.metricForm?0:-1)},dependencies:[b,x,F,M,ze],styles:["[_nghost-%COMP%] .input-group[_ngcontent-%COMP%] input.date-input[_ngcontent-%COMP%]:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating){border-top-right-radius:0!important;border-bottom-right-radius:0!important;text-align:end}[_nghost-%COMP%] .spai-form-control{--spai-input-padding-x: .5rem;--spai-input-padding-y: calc(.25rem - 1px) ;text-align:right}"]})}};var zi=["input"];function ji(o,t){if(o&1&&(a(0,"option",5),p(1),s()),o&2){let e=t.$implicit;l("value",e.value),r(),L(" ",e.option," ")}}var Xe=class o{constructor(){this.options=[{option:"Day",value:"Day"},{option:"Month",value:"Month"},{option:"Year",value:"Year"},{option:"Hours",value:"Hours"},{option:"Minutes",value:"Minutes"}];this.metricSource=E}focus(){this.input.nativeElement.focus()}forceSetDefault(){this.metricForm.get(this.metric.shortName)?.setValue(this.metric.defaultValue)}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-duration"]],viewQuery:function(e,i){if(e&1&&T(zi,5),e&2){let n;C(n=g())&&(i.input=n.first)}},inputs:{hideDefault:"hideDefault"},standalone:!1,decls:7,vars:8,consts:[["input",""],[3,"formGroup"],[1,"input-group"],["spaiInput","","container","body",1,"form-control-sm","mb-0",3,"id","name","formControlName"],[1,"form-select","form-select-sm"],[3,"value"]],template:function(e,i){e&1&&(D(0,1),a(1,"div",2),P(2,"input",3,0),a(4,"select",4),B(5,ji,2,2,"option",5,Me),s()(),N()),e&2&&(l("formGroup",i.metricForm),r(2),_("is-gpt",i.metric.source===i.metricSource.GPT),l("id",i.id)("name",i.name)("formControlName",i.metric.shortName),f("data-testid","metric-input-"+i.metric.shortName),r(2),f("data-testid","metric-unit-select-"+i.metric.shortName),r(),Q(i.options))},dependencies:[zt,jt,K,b,x,F,M,We],styles:["[_nghost-%COMP%]{position:relative}input[_ngcontent-%COMP%]{border-top-right-radius:0;border-bottom-right-radius:0}spai-input-container[_ngcontent-%COMP%]{width:90px}"]})}};var $i=["input"];function Wi(o,t){if(o&1){let e=I();D(0,1),a(1,"spai-input-container",2)(2,"input",3,0),d("blur",function(){y(e);let n=m();return v(n.onBlur())}),s()(),N()}if(o&2){let e=m();l("formGroup",e.metricForm),r(2),_("is-gpt",e.metric.source===e.metricSource.GPT)("text-start",e.textLeft)("text-end",!e.textLeft),l("id","spai-question-"+e.id)("name",e.name)("spaiType",e.spaiType)("placeholder",e.placeholder)("formControlName",e.metric.shortName)}}var Je=class o{constructor(t){this.eRef=t;this.placeholder="";this.metricSource=E;this._destroyed=new Mt}focus(){this.input.nativeElement.focus()}ngOnChanges(){this.metric&&(this.spaiType=this._getSpaiType()),this.metric?.defaultValue&&(this.placeholder=String(this.metric.defaultValue))}ngOnInit(){this.metric&&(this.spaiType=this._getSpaiType()),this.metric?.defaultValue&&(this.placeholder=String(this.metric.defaultValue))}onBlur(){setTimeout(()=>{this.metricForm.get(this.metric.shortName).setValue(this.metricForm.controls[this.metric.shortName].value)})}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_getSpaiType(){let t=this.metric?.type?.toLowerCase();return t==="currency"?"currency":t==="percentage"?"percentage":"decimal"}static{this.\u0275fac=function(e){return new(e||o)(ne(U))}}static{this.\u0275cmp=h({type:o,selectors:[["spai-numeric"]],viewQuery:function(e,i){if(e&1&&T($i,5),e&2){let n;C(n=g())&&(i.input=n.first)}}
1,inputs:{metric:"metric",metricForm:"metricForm",id:"id",name:"name",hideDefault:"hideDefault",textLeft:"textLeft"},standalone:!1,features:[Pe],decls:1,vars:1,consts:[["input",""],[3,"formGroup"],[1,"spai-metric-field"],["spaiInput","","spaiNumberFormat2","","maxlength","18","min","0","autocomplete","off",1,"form-control-sm",3,"blur","id","name","spaiType","placeholder","formControlName"]],template:function(e,i){e&1&&w(0,Wi,4,12,"ng-container",1),e&2&&k(i.metricForm?0:-1)},dependencies:[K,b,x,$t,F,M,We,fi,hi],styles:[".spai-metric-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border-radius:var(--spai-border-radius)!important}"]})}};var Yi=["sliderRef"],et=class o{focus(){this.sliderRef?.focus()}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-range"]],viewQuery:function(e,i){if(e&1&&T(Yi,5),e&2){let n;C(n=g())&&(i.sliderRef=n.first)}},inputs:{hideDefault:"hideDefault"},standalone:!1,decls:4,vars:9,consts:[["sliderRef",""],[1,"spai-question-container",3,"formGroup"],[1,"spai-range-control-wrapper"],[3,"formControlName","tickInterval","id","name","step","min","max"]],template:function(e,i){e&1&&(a(0,"div",1)(1,"div",2),P(2,"spai-slider",3,0),s()()),e&2&&(l("formGroup",i.metricForm),r(2),l("formControlName",i.metric.shortName)("tickInterval",1)("id",i.id)("name",i.name)("step",1)("min",0)("max",5),f("data-testid","metric-slider-"+i.metric.shortName))},dependencies:[b,x,F,M,ci],styles:["[_nghost-%COMP%]{display:block;padding-right:19px}[_nghost-%COMP%] .mat-slider .mat-slider-horizontal .mat-slider-wrapper{height:2px;top:16px;left:8px;right:8px}spai-slider[_ngcontent-%COMP%]{display:block;width:100%}"]})}};var Ki=["textArea"];function Xi(o,t){if(o&1){let e=I();D(0,1),a(1,"mat-form-field",2)(2,"textarea",3,0),d("input",function(){y(e);let n=m();return v(n.ngModelChange())}),s()(),N()}if(o&2){let e=m();l("formGroup",e.metricForm),r(2),_("is-gpt",e.metric.source===e.metricSource.GPT),l("formControlName",e.metric.shortName)("id",e.id)("name",e.name)("placeholder",e.placeholder),f("data-testid","metric-input-"+e.metric.shortName)}}var tt=class o{constructor(){this.currentLength=0;this.placeholder="";this.metricSource=E}ngAfterViewInit(){Promise.resolve().then(()=>{this.metric?.size&&this.handleLength(),this.metric?.defaultValue&&(this.placeholder=String(this.metric.defaultValue))})}ngModelChange(){this.metric?.size&&this.textArea&&this.handleLength()}focus(){this.textArea.nativeElement.focus()}handleLength(){this.currentLength=this.textArea?.nativeElement?.value.length,this.currentLength>this.metric?.size&&(this.textArea.nativeElement.value=this.textArea.nativeElement.value.slice(0,this.metric.size),this.currentLength=this.textArea.nativeElement.value.length)}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-text"]],viewQuery:function(e,i){if(e&1&&T(Ki,5),e&2){let n;C(n=g())&&(i.textArea=n.first)}},inputs:{hideDefault:"hideDefault"},decls:1,vars:1,consts:[["textArea",""],[3,"formGroup"],["appearance","outline",1,"spai-mat-form-field"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","10",3,"input","formControlName","id","name","placeholder"]],template:function(e,i){e&1&&w(0,Xi,4,8,"ng-container",1),e&2&&k(i.metricForm?0:-1)},dependencies:[V,K,b,x,A,F,M,ai,ri,J,W,ve,$e],styles:["[_nghost-%COMP%]{position:relative;display:inline-block;width:100%}.editor-container[_ngcontent-%COMP%]{position:relative}.editor-container[_ngcontent-%COMP%] .counter[_ngcontent-%COMP%]{position:absolute;right:5px;bottom:-16px;--spai-body-font-size: 9px;font-size:var(--spai-body-font-size)}textarea.spai-form-control[_ngcontent-%COMP%]{max-height:212px;overflow-y:auto;box-sizing:content-box;resize:vertical}.spai-mat-form-field[_ngcontent-%COMP%]{resize:vertical}.spai-mat-form-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{font-size:14px}"]})}};var Ji=[[["spaiLabel"]],[["spai-radio"]]],en=["spaiLabel","spai-radio"],tn={provide:Ut,useExisting:kt(()=>re),multi:!0},nn=new Dt("RadioContainerComponent"),on=0,re=class o{constructor(){this._controlValueAccessorChangeFn=()=>Se;this.onTouched=()=>Se;this.change=new ae;this.metricSource=E;this._selected=null;this._disabled=!1;this._required=!1;this._value=null;this._name=`spai-radio-group-${on++}`}get selected(){return this._selected}set selected(t){this._selected=t,this.value=t?t.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(t){this._disabled=t}get required(){return this._required}set required(t){this._required=he(t)}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}get name(){return this._name}set name(t){this._name=t,this._updateRadioButtonNames()}_updateSelectedRadioFromValue(){let t=this._selected!==null&&this._selected.value===this._value;
1this.radios&&!t&&(this._selected=null,this.radios.forEach(e=>{e.checked=this.value===e.value,e.checked&&(this._selected=e)}))}_emitChangeEvent(){this.change.emit(q(q({},this._selected),this._value))}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}writeValue(t){this.value=t}registerOnChange(t){this._controlValueAccessorChangeFn=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}_updateRadioButtonNames(){this.radios&&this.radios.forEach(t=>{t.name=this.name})}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-radio-container"]],contentQueries:function(e,i,n){if(e&1&&Ie(n,be,5),e&2){let c;C(c=g())&&(i.radios=c)}},hostAttrs:["role","radiogroup"],inputs:{selected:"selected",disabled:"disabled",required:"required",value:"value",name:"name",metric:"metric"},outputs:{change:"change"},standalone:!1,features:[pe([tn,{provide:nn,useExisting:o,multi:!0}])],ngContentSelectors:en,decls:3,vars:2,consts:[[1,"spai-control-container"]],template:function(e,i){e&1&&(ce(Ji),oe(0),a(1,"div",0),oe(2,1),s()),e&2&&(r(),_("border-success",i.metric.source===i.metricSource.GPT))},encapsulation:2})}};var rn=["radioInput"],an=["*"],sn=0,be=class o{constructor(t,e){this.radioGroup=t;this._radioDispatcher=e;this._uniqueId=`spai-radio-${++sn}`;this.id=this._uniqueId;this.change=new ae;this._checked=!1;this._value=null;this._removeUniqueSelectionListener=Se;this._removeUniqueSelectionListener=e.listen((i,n)=>{i!==this.id&&n===this.name&&(this.checked=!1)})}get disabled(){return this._disabled||this.radioGroup!==null&&this.radioGroup.disabled}set disabled(t){this._setDisabled(he(t))}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(t){this._required=he(t)}get checked(){return this._checked}set checked(t){let e=he(t);this._checked!==e&&(this._checked=e,e&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!e&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),e&&this._radioDispatcher.notify(this.id,this.name))}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this.radioGroup!==null&&(this.checked||(this.checked=this.radioGroup.value===t),this.checked&&(this.radioGroup.selected=this)))}writeValue(t){this.value=t}focus(){this.inputRef?.nativeElement?.focus()}registerOnTouched(t){this.onTouchedCallback=t}registerOnChange(t){this.onChangeCallback=t}setDisabledState(t){this.disabled=t}ngOnInit(){this.radioGroup&&(this.name=this.radioGroup.name)}ngOnDestroy(){this._removeUniqueSelectionListener()}_onInputInteraction(t){if(t.stopPropagation(),!this.checked&&!this.disabled){let e=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),e&&this.radioGroup._emitChangeEvent())}}_setDisabled(t){this._disabled!==t&&(this._disabled=t)}_emitChangeEvent(){this.change.emit(new vt(this,this._value))}static{this.\u0275fac=function(e){return new(e||o)(ne(re),ne(Jt))}}static{this.\u0275cmp=h({type:o,selectors:[["spai-radio"]],viewQuery:function(e,i){if(e&1&&T(rn,5),e&2){let n;C(n=g())&&(i.inputRef=n.first)}},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],id:"id",name:"name",disabled:"disabled",required:"required",checked:"checked",value:"value"},outputs:{change:"change"},standalone:!1,ngContentSelectors:an,decls:5,vars:10,consts:[["radioInput",""],[1,"form-check","form-check-inline"],["type","radio",1,"form-check-input",3,"change","checked","disabled","required"],[1,"form-check-label"]],template:function(e,i){e&1&&(ce(),a(0,"div",1)(1,"input",2,0),d("change",function(c){return i._onInputInteraction(c)}),s(),a(3,"label",3),oe(4),s()()),e&2&&(r(),l("checked",i.checked)("disabled",i.disabled)("required",i.required),f("value",i.value)("name",i.name)("id",i.id)("aria-label",i.ariaLabel)("aria-labelledby",i.ariaLabelledby)("aria-describedby",i.ariaDescribedby),r(2),f("for",i.id))},styles:["[_nghost-%COMP%]:not(:last-child) .form-check-inline[_ngcontent-%COMP%]{margin-right:1rem}[_nghost-%COMP%] .form-check[_ngcontent-%COMP%]{padding-left:1.75em}.form-check-inline[_ngcontent-%COMP%]{margin-right:0}.form-check-input[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .5rem #5c6bc04d}.form-check-input[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem;margin-top:1px;margin-right:8px}"]})}},vt=class{constructor(t,e){this.source=t;this.value=e}};var ln=["checkBoxRef"],mn=["radioRef"],it=class o{constructor(){this.radio=!0}onChanges(t){this.metricForm.get(this.metric.shortName).setValue(t._value)}focus(){this.checkBoxRef?.focus(),this.radioRef?.radios?.first.inputRef?.nativeElement?.focus()}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-yes-no"]],viewQuery:function(e,i){if(e&1&&T(ln,5)(mn,5),e&2){let n;C(n=g())&&(i.checkBoxRef=n.first),C(n=g())&&(i.radioRef=n.first)}},hostAttrs:[1,"spai-yes-no"],inputs:{id:"id",name:"name",metric:"metric",metricF
1orm:"metricForm",radio:"radio"},decls:9,vars:8,consts:[["radioRef",""],["spaiRadio",""],[3,"formGroup"],[1,"spai-yes-no-control-wrapper"],[1,"spai-metric-field",3,"change","formControlName","metric"],["cdkFocusInitial","",3,"click","value"],[3,"click","value"]],template:function(e,i){e&1&&(D(0,2),a(1,"div",3)(2,"spai-radio-container",4,0),d("change",function(c){return i.onChanges(c)}),a(4,"spai-radio",5,1),d("click",function(c){return c.stopPropagation()}),p(6," Yes "),s(),a(7,"spai-radio",6),d("click",function(c){return c.stopPropagation()}),p(8," No "),s()()(),N()),e&2&&(l("formGroup",i.metricForm),r(2),l("formControlName",i.metric.shortName)("metric",i.metric),f("data-testid","metric-radio-group-"+i.metric.shortName),r(2),l("value",1),f("data-testid","metric-yes-"+i.metric.shortName),r(3),l("value",0),f("data-testid","metric-no-"+i.metric.shortName))},dependencies:[si,be,re,V,b,x,A,F,M],styles:["[_nghost-%COMP%]{display:block;min-width:120px;margin-left:12px}.spai-yes-no-control-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}"]})}};var nt=class o{transform(t,...e){return!t||typeof t!="string"?"":e[0].data.values.find(n=>n.key===t).name}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275pipe=Ee({name:"enumChipsList",type:o,pure:!0})}};var ot=class o{transform(t,e){let i=e.data?.values;return i?.length>0&&i?.some(n=>n.key===t)?i.find(n=>n.key===t).matches?.length:!1}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275pipe=Ee({name:"isValueFromGpt",type:o,pure:!0})}};var Gi=["chipGrid"];function pn(o,t){o&1&&(a(0,"mat-icon",11),p(1,"cancel"),s())}function dn(o,t){if(o&1){let e=I();a(0,"mat-chip-row",9),H(1,"isValueFromGpt"),H(2,"enumChipsList"),d("removed",function(){let n=y(e).$implicit,c=m(3);return v(c.onToppingRemoved(n))}),a(3,"span",10),p(4),H(5,"enumChipsList"),s(),w(6,pn,2,0,"mat-icon",11),s()}if(o&2){let e=t.$implicit,i=m(3);_("background-success",z(1,9,e,i.metric))("spai-deleted-enum-option",i.isDeleted(e)),l("removable",i.displayCloseButton)("title",z(2,12,e,i.metric)),f("data-testid","metric-chip-"+i.metric.shortName+"-"+e),r(4),L(" ",z(5,15,e,i.metric)," "),r(2),k(i.displayCloseButton?6:-1)}}function un(o,t){if(o&1&&(a(0,"mat-chip-set",6,0),B(2,dn,7,18,"mat-chip-row",8,Me),s()),o&2){let e=m(2);r(2),Q(e.metricForm.controls[e.metric.shortName].value)}}function fn(o,t){if(o&1){let e=I();a(0,"div",7)(1,"span",12),H(2,"isValueFromGpt"),p(3),H(4,"enumChipsList"),s(),a(5,"button",13),d("click",function(n){y(e);let c=m(2);return v(c.clearValue(n))}),a(6,"mat-icon",14),p(7,"clear"),s()()()}if(o&2){let e=m(2);r(),_("highlighted-answer",z(2,4,e.metricForm.controls[e.metric.shortName].value,e.metric)),r(2),L(" ",z(4,7,e.metricForm.controls[e.metric.shortName].value,e.metric)),r(2),f("data-testid","metric-clear-"+e.metric.shortName)}}function hn(o,t){if(o&1&&(a(0,"mat-option",15,1)(2,"span",16),H(3,"isValueFromGpt"),p(4),s()()),o&2){let e=m().$implicit,i=m(2);l("value",e.key)("title",e.name),f("data-testid","metric-option-"+i.metric.shortName+"-"+e.key),r(2),_("highlighted-answer",z(3,6,e.key,i.metric)),r(2),L(" ",e.name," ")}}function Cn(o,t){if(o&1&&w(0,hn,5,9,"mat-option",15),o&2){let e=t.$implicit;k(e.deleted?-1:0)}}function gn(o,t){if(o&1){let e=I();D(0,2),a(1,"mat-form-field",3)(2,"mat-select",4),d("openedChange",function(n){y(e);let c=m();return v(c.openedChangeHandler(n))}),a(3,"mat-select-trigger",5),w(4,un,4,0,"mat-chip-set",6)(5,fn,8,10,"div",7),s(),B(6,Cn,1,1,null,null,Me),s()(),N()}if(o&2){let e=m();l("formGroup",e.metricForm),r(),_("multiple-values",e.isChipOverflowing()),r(),l("formControlName",e.metric.shortName)("multiple",e.isMultiple)("placeholder",e.placeholder),f("data-testid","metric-select-"+e.metric.shortName),r(2),k(e.isMultiple?4:5),r(2),Q(e.enumValues)}}var rt=class o{constructor(){this.biggerSize=new ae;this.chipGridRef=de("chipGrid");this.settingService=S(Yt);this.metricFormatter=S(ie);this.placeholder="";this.displayCloseButton=!0;this.metricSource=E;this._panelOpen=!1;this.isChipOverflowing=qt(()=>{let t=!1;if(this.chipGridRef()?.nativeElement){let e=this.chipGridRef()?.nativeElement.offsetHeight,i=this.chipGridRef()?.nativeElement?.firstChild;if(i){let n=i?.firstChild?.offsetHeight;t=e>n*2}}return t});this.focusMonitor=S(Kt);this.elementRef=S(U);this.subscription=new xt;this.displayCloseButton=this.settingService.settings.multiSelectX}focus(){this.select?.focus()}set metric(t){this._metric=t,this._panelOpen||this._syncEnumValues(),this.placeholder=this.isMultiple?"":this.metricFormatter.formatValue(t,"defaultValue")}get metric(){return this._metric}openedChangeHandler(t){this._panelOpen=t,t?Promise.resolve().then(()=>this._setExternalUpdatesGuard(!0)):(this._syncEnumValues(),Promise.resolve().then(()=>this._setExternalUpdatesGuard(!1)))}_syncEnumValues(){this.enumValues=this._metric.data.values?.map(t=>t)}_setExternalUpdatesGuard(t){let e=this.metricForm;t?e.focusField?.(this.metric.shortName):e.blurField?.(this.metric.shortName)}get isMultiple(){return this.metric.type==="multiselect".toUpperCase()}isDeleted(t){return this.enumValues.find(e=>e.key===t)?.deleted}get checkChipOverflow(){let t=!1;if(this.chipGrid?.nativeElement){let e=this.chipGrid.nativeElement.offsetHeight,i=this.chipGrid.nativeElement?.firstChild;if(i){let n=i?.firstChild?.offsetHeight;t=e>n*2}}return t}ngAfterViewInit(){this.subscription.add(this.focusMonitor.monitor(this.elementRef.nativeElement,!0).subscribe(t=>{t==="keyboard"&&this.select?.open()}))}ngOnDestroy(){this.focusMonitor.stopMonitoring(this.elementRef.nativeElement),this.subscription.unsubscribe()}onToppingRemoved(t){let i=[...this.metricForm.get(this.metric.shortName).value];this.enumValues=this.enumValues.map(n=>Y(q({},n),{source:n.key===t&&n.source===this.metricSource.GPT?this.metricSource.User:n.source})),this._metric.data={values:this.enumValues},this._removeFirst(i,t),this.metricForm.get(this.metric.shortName).setValue(i)}clearValue(t){t.stopPropagation(),this.metricForm.get(this.metric.shortName).setValue("")}defaultClick(){this.metricForm.get(this.metric.shortName).setValue(this.metric.defaultValue),this.metricForm.get(this.metric.shortName).isSetDefaultClick=!0}_removeFirst(t,e){let i=t.indexOf(e);i!==-1&&t.splice(i,1)}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-enum-activity-metric"]],viewQuery:function(e,i){if(e&1&&(le(i.chipGridRef,Gi,5),T(Ce,5)(W,5)(Gi,5,U)),e&2){me();let n;C(n=g())&&(i.select=n.first),C(n=g())&&(i.formField=n.first),C(n=g())&&(i.chipGrid=n.first)}},hostAttrs:[1,"spai-enum-activity-metric"],inputs:{metric:"metric",metricF
1orm:"metricForm",id:"id",name:"name"},outputs:{biggerSize:"biggerSize"},decls:1,vars:1,consts:[["chipGrid",""],["optionElement",""],[3,"formGroup"],["appearance","outline","subscriptSizing","dynamic",1,"spai-mat-form-field","w-100"],["hideSingleSelectionIndicator","","panelWidth","null","panelClass","spai-mat-panel",3,"openedChange","formControlName","multiple","placeholder"],[1,"single-trigger"],["aria-label","Selected enums values"],[1,"spai-enum-trigger"],["color","primary",1,"spai-enum-chip",3,"removable","background-success","spai-deleted-enum-option","title"],["color","primary",1,"spai-enum-chip",3,"removed","removable","title"],[1,"spai-enum-label","text-truncate"],["matChipRemove",""],[1,"spai-enum-selected-value","small-font-size"],["matIconButton","","type","button","aria-label","Clear",1,"spai-close-button",3,"click"],[1,"clear-select-button"],[1,"spai-enum-options",3,"value","title"],[1,"text-truncate","small-font-size"]],template:function(e,i){e&1&&w(0,gn,8,8,"ng-container",2),e&2&&k(i.metricForm&&(i.metric!=null&&i.metric.shortName)?0:-1)},dependencies:[J,W,te,ee,He,Ce,Qe,Be,di,li,mi,pi,V,b,x,A,F,M,Zt,$,X,nt,ot],styles:["[_nghost-%COMP%]{position:relative;width:100%}[_nghost-%COMP%] .text-truncate[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:calc(100% - 18px);line-height:1}[_nghost-%COMP%] .clear-select-button[_ngcontent-%COMP%]{vertical-align:middle;position:relative;color:#999}[_nghost-%COMP%] .spai-enum-trigger[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .spai-enum-trigger[_ngcontent-%COMP%] .spai-enum-selected-value[_ngcontent-%COMP%]{display:flex;width:calc(100% - 24px);text-overflow:ellipsis;overflow:hidden}.spai-enum-activity-metric[_nghost-%COMP%] mat-select[_ngcontent-%COMP%]{transform:translateY(.1rem)}.spai-close-button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}.spai-close-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:auto;height:auto;font-size:16px}"]})}};var _n=["checkBoxRef"],st=class o{constructor(){this.metricSource=E}focus(){this.checkBoxRef?.focus()}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-checkbox"]],viewQuery:function(e,i){if(e&1&&T(_n,5),e&2){let n;C(n=g())&&(i.checkBoxRef=n.first)}},decls:4,vars:5,consts:[["checkBoxRef",""],[3,"formGroup"],[1,"wrapper","d-flex","align-items-center","justify-content-end"],["cdkFocusInitial","",1,"spai-mat-checkbox","spai-mat-checkbox--circle",3,"formControlName"]],template:function(e,i){e&1&&(D(0,1),a(1,"div",2),P(2,"mat-checkbox",3,0),s(),N()),e&2&&(l("formGroup",i.metricForm),r(2),_("background-success",i.metric.source===i.metricSource.GPT),l("formControlName",i.metric.shortName),f("data-testid","metric-checkbox-"+i.metric.shortName))},dependencies:[_e,ge,V,b,x,A,F,M],styles:[".wrapper[_ngcontent-%COMP%]{min-width:175px}.justify-content-end[_ngcontent-%COMP%]{justify-content:end!important}"]})}};var yn=["per"];function vn(o,t){if(o&1&&(D(0,1),P(1,"spai-percentage-input",2,0),N()),o&2){let e=m();l("formGroup",e.metricForm),r(),_("is-gpt",e.metric.source===e.metricSource.GPT),l("formControlName",e.metric.shortName),f("data-testid","metric-input-"+e.metric.shortName)}}var ct=class o{constructor(){this._metricFormatter=S(ie);this.metricSource=E}ngAfterViewInit(){this.metric.defaultValue&&(this.per.elementRef.nativeElement.placeholder=this._metricFormatter.formatValue(this.metric,"defaultValue"))}focus(){this.per.elementRef.nativeElement?.focus()}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-percentage-metric-field"]],viewQuery:function(e,i){if(e&1&&T(yn,5),e&2){let n;C(n=g())&&(i.per=n.first)}},inputs:{metricForm:"metricForm",metric:"metric"},decls:1,vars:1,consts:[["per",""],[3,"formGroup"],[1,"spai-text-end",3,"formControlName"]],template:function(e,i){e&1&&w(0,vn,3,5,"ng-container",1),e&2&&k(i.metricForm?0:-1)},dependencies:[ye,ii,V,b,x,A,F,M],encapsulation:2})}};var bn=["metricFormContainer"];function xn(o,t){if(o&1&&(D(0,1),P(1,"spai-currency-field",2,0),N()),o&2){let e=m();
1l("formGroup",e.metricForm),r(),_("is-gpt",e.metric.source===e.metricSource.GPT),l("currencyCode",e.currencyCode)("formControlName",e.metric.shortName),f("data-testid","metric-input-"+e.metric.shortName)}}var lt=class o{constructor(){this._metricFormatter=S(ie);this.metricSource=E}set metric(t){this._metric=t,this.currencyCode=Ci(this._metric?.data)?this._metric?.data:"USD"}get metric(){return this._metric}ngAfterViewInit(){(this.metric.defaultValue||this.metric.defaultValue===0)&&(this.metricFormElement.nativeElement.firstChild.placeholder=this._metricFormatter.formatValue(this.metric,"defaultValue"))}focus(){this.metricFormElement.nativeElement.firstChild?.focus()}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-currency-metric-field"]],viewQuery:function(e,i){if(e&1&&T(bn,5,U),e&2){let n;C(n=g())&&(i.metricFormElement=n.first)}},inputs:{metricForm:"metricForm",metric:"metric"},decls:1,vars:1,consts:[["metricFormContainer",""],[3,"formGroup"],[1,"spai-text-end",3,"currencyCode","formControlName"]],template:function(e,i){e&1&&w(0,xn,3,6,"ng-container",1),e&2&&k(i.metricForm?0:-1)},dependencies:[ye,ti,V,b,x,A,F,M],styles:["[_nghost-%COMP%]{width:100%}"]})}};var Mn=["metricFormContainer"];function Fn(o,t){if(o&1&&(D(0,1),P(1,"spai-decimal-field",2,0),N()),o&2){let e=m();l("formGroup",e.metricForm),r(),_("is-gpt",e.metric.source===e.metricSource.GPT),l("formControlName",e.metric.shortName),f("data-testid","metric-input-"+e.metric.shortName)}}var mt=class o{constructor(){this._metricFormatter=S(ie);this.metricSource=E}ngAfterViewInit(){(this.metric.defaultValue||this.metric.defaultValue===0)&&(this.metricFormElement.nativeElement.firstChild.placeholder=this._metricFormatter.formatValue(this.metric,"defaultValue"))}focus(){this.metricFormElement?.nativeElement?.firstChild?.focus()}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-decimal-metric-field"]],viewQuery:function(e,i){if(e&1&&T(je,7)(Mn,5,U),e&2){let n;C(n=g())&&(i.input=n.first),C(n=g())&&(i.metricFormElement=n.first)}},inputs:{metricForm:"metricForm",metric:"metric"},decls:1,vars:1,consts:[["metricFormContainer",""],[3,"formGroup"],[1,"spai-text-end",3,"formControlName"]],template:function(e,i){e&1&&w(0,Fn,3,5,"ng-container",1),e&2&&k(i.metricForm?0:-1)},dependencies:[ye,je,V,b,x,A,F,M],encapsulation:2})}};function Sn(o,t){if(o&1&&(a(0,"span",3),p(1),s()),o&2){let e=m(2);r(),Rt("",e.currentLength," / ",e.characterLimit)}}function wn(o,t){if(o&1){let e=I();D(0,0),a(1,"div",1)(2,"quill-editor",2),d("onEditorCreated",function(n){y(e);let c=m();return v(c.createQuill(n))})("onContentChanged",function(n){y(e);let c=m();return v(c.textChanged(n))})("onSelectionChanged",function(n){y(e);let c=m();return v(c.hideShowToolbar(n))}),s(),w(3,Sn,2,2,"span",3),s(),N()}if(o&2){let e=m();l("formGroup",e.metricForm),r(2),_("is-gpt",e.metric.source===e.metricSource.GPT),l("id",e.id)("placeholder",e.placeholder)("formControlName",e.metric.shortName)("modules",e.modules)("formats",e.quillFormats)("format","html"),f("data-testid","metric-editor-"+e.metric.shortName),r(),k(e.hasCharacterCount?3:-1)}}gi.register({"formats/align":_i,"formats/font":yi});var pt=class o{constructor(){this.currentLength=0;this.richTextHeight=100;this.placeholder=" ";this.modules={toolbar:[["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}]],clipboard:{matchVisual:!1,matchers:[]}};this.quillFormats=["header","list","blockquote","indent","direction","code","code-block","bold","italic","underline","strike","link","image","align","indent"];this.metricSource=E}get characterLimit(){return vi(this.metric)}get hasCharacterCount(){return this.characterLimit>0}createQuill(t){this.quill=t;let e=this.quill.theme.modules.toolbar.container,i=this.quill.theme.modules.input?.quill.container;kn(e)&&(e.style.display="none"),i&&this.setQuillContainerStyles(!1,i),this.setCount(),this.metric.defaultValue&&(this.placeholder=this.removeHtmlTags(String(this.metric.defaultValue)))}textChanged(t){this.setCount(),this.hasCharacterCount&&t.editor.getLength()>this.characterLimit&&t.editor.deleteText(this.characterLimit,t.editor.getLength())}focus(){this.quill.focus()}hideShowToolbar(t){t.oldRange==null&&this.handleToolBar(t,!0),t.range==null&&this.handleToolBar(t,!1)}setCount(){let t=this.quill.getText();this.hasCharacterCount&&t.length>this.characterLimit&&this.quill.deleteText(this.characterLimit,t.length),this.currentLength=this.quill.getText().trim().length}handleToolBar(t,e){let i=t.editor.theme.modules.toolbar.container,n=t.editor.theme.modules.input?.quill.container;"style"in i&&(i.style.display=e?"block":"none",this.setQuillContainerStyles(e,n))}setQuillContainerStyles(t,e){t?(e.style.borderTop="none",e.style.borderTopLeftRadius="0",e.
1style.borderTopRightRadius="0"):(e.style.border="1.11px solid",e.style.borderRadius="4px")}removeHtmlTags(t){return t.replace(/<[^>]*>?/gm,"")}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-rich-text"]],inputs:{hideDefault:"hideDefault"},standalone:!1,decls:1,vars:1,consts:[[3,"formGroup"],[1,"editor-container"],[1,"spai-quill-editor",3,"onEditorCreated","onContentChanged","onSelectionChanged","id","placeholder","formControlName","modules","formats","format"],[1,"counter"]],template:function(e,i){e&1&&w(0,wn,4,11,"ng-container",0),e&2&&k(i.metricForm?0:-1)},dependencies:[b,x,F,M,bi],styles:["[_nghost-%COMP%]{position:relative;display:inline-block;width:100%}[_nghost-%COMP%] .spai-quill-editor{--mat-form-field-outlined-input-text-color: #ffffff}[_nghost-%COMP%] .spai-quill-editor .ql-editor{padding-left:.75rem}[_nghost-%COMP%] .spai-quill-editor .ql-editor *:first-child, [_nghost-%COMP%] .spai-quill-editor .ql-editor:before{line-height:26px}[_nghost-%COMP%] .spai-quill-editor .ql-toolbar.ql-snow{width:100%;flex-wrap:wrap;display:flex}[_nghost-%COMP%] .spai-quill-editor .ql-toolbar.ql-snow svg{position:static}[_nghost-%COMP%] .spai-quill-editor .ql-toolbar{display:none}.editor-container[_ngcontent-%COMP%]{position:relative}.editor-container[_ngcontent-%COMP%] .counter[_ngcontent-%COMP%]{position:absolute;right:5px;bottom:-9px;--spai-body-font-size: 9px;font-size:var(--spai-body-font-size)}"]})}};function kn(o){return!!o&&typeof o=="object"&&"style"in o}var Ne=class o{constructor(){this.formGroup=new Fe({firstName:new j(""),lastName:new j("",ue.required),email:new j(null,[ue.email])});this.contact=null;this._contactService=S(fe);this._date=S(Ve);this._dialogRef=S(Re);this.dealId=this._date.dealId,this.contact=this._date.contact,this.contact&&this.formGroup.patchValue({firstName:this.contact.firstName||null,lastName:this.contact.lastName||"",email:this.contact.email||null})}saveContactClickHandler(){this.formGroup.invalid||(this.contact?this._contactService.updateDealContact(this.dealId,Y(q({},this.formGroup.value),{id:this.contact.id})).subscribe(()=>{this._dialogRef.close()}):this._contactService.createDealContact(this.dealId,this.formGroup.value).subscribe(t=>{this._dialogRef.close(t)}))}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-contact-form"]],decls:21,vars:1,consts:[["mat-dialog-title",""],[3,"formGroup"],["for",""],["subscriptSizing","fixed",1,"spai-mat-form-field"],["type","text","matInput","","formControlName","firstName","data-testid","contact-form-first-name-input"],["type","text","matInput","","formControlName","lastName","data-testid","contact-form-last-name-input"],["type","email","matInput","","formControlName","email","data-testid","contact-form-email-input"],["align","end"],["type","button","mat-dialog-close","","matButton","outlined","data-testid","contact-form-close-button"],["type","button","matButton","filled","data-testid","contact-form-save-button",3,"click"]],template:function(e,i){e&1&&(a(0,"h2",0),p(1,"Contact"),s(),a(2,"mat-dialog-content")(3,"form",1)(4,"label",2),p(5,"First Name"),s(),a(6,"mat-form-field",3),P(7,"input",4),s(),a(8,"label",2),p(9,"Last Name"),s(),a(10,"mat-form-field",3),P(11,"input",5),s(),a(12,"label",2),p(13,"Email"),s(),a(14,"mat-form-field",3),P(15,"input",6),s()()(),a(16,"mat-dialog-actions",7)(17,"button",8),p(18,"Close"),s(),a(19,"button",9),d("click",function(){return i.saveContactClickHandler()}),p(20,"Save"),s()()),e&2&&(r(3),l("formGroup",i.formGroup))},dependencies:[J,W,ve,$e,V,Bt,K,b,x,A,F,M,Le,Xt,Oe,qe,Ge,$,Ue],encapsulation:2})}};function Nn(o,t){o&1&&(a(0,"div",2),P(1,"mat-spinner"),s())}function Tn(o,t){if(o&1){let e=I();a(0,"li")(1,"mat-checkbox",12)(2,"span",13)(3,"span",14),p(4),s(),a(5,"span",15),p(6),s()()(),a(7,"button",16),d("click",function(){let n=y(e).$implicit,c=m(2);return v(c.editClickHandler(n))}),a(8,"mat-icon"),p(9,"edit"),s()()()}if(o&2){let e=t.$implicit;r(),f("data-testid","contact-dialog-contact-checkbox-"+e.id),r(2),l("title",e.firstName),r(),Z(e.firstName),r(),l("title",e.lastName),r(),Z(e.lastName),r(),f("data-testid","contact-dialog-edit-button-"+e.id)}}function Pn(o,t){if(o&1){let e=I();a(0,"li")(1,"mat-checkbox",17)(2,"span",13)(3,"span",14),p(4),s(),a(5,"span",15),p(6),s()()(),a(7,"button",16),d("click",function(){let n=y(e).$implicit,c=m(2);return v(c.editClickHandler(n))}),a(8,"mat-icon"),p(9,"edit"),s()()()}if(o&2){let e=t.$implicit,i=t.$index;r(),l("formControlName",i)("value",e.id),f("data-testid","contact-dialog-contact-checkbox-"+e.id),r(2),l("title",e.firstName),r(),Z(e.firstName),r(),l("title",e.lastName),r(),Z(e.lastName),r(),f("data-testid","contact-dialog-edit-button-"+e.id)}}function En(o,t){if(o&1&&(a(0,"ul",3),B(1,Tn,10,6,"li",null,se),D(3,10)(4,11),B(5,Pn,10,8,"li",null,se),N()(),s()),o&2){let e=m();r(),Q(e.checkedContacts),r(2),l("formGroup",e.contactsForm),r(2),Q(e.uncheckedContacts)}}var dt=class o{constructor(){this._contactService=S(fe);this._dialogRef=S(Re);this.loading=!1;this.processingNewContact=!1;this.checkedContacts=[];this.uncheckedContacts=[];this.newContactForm=new Fe({firstName:new j(null),lastName:new j("",[ue.required]),email:new j(null,[ue.email])});this.contactsForm=new Fe({contacts:new Qt([])});this.showNewContactForm=!1;this.data=S(Ve);this._matDialog=S(Ae);this.dealId=this.data.dealId,this.metric=this.data.metric}get contactsArray(){return this.contactsForm.get("contacts")}
1ngOnInit(){this.getPotentialContacts()}getPotentialContacts(){try{this.loading=!0,this._contactService.getContactsByDeal(this.dealId).pipe(St(900)).subscribe(t=>{let e=new Set(this.metric.data.values.map(c=>String(c.key))),[i,n]=[t.filter(c=>e.has(String(c.id))),t.filter(c=>!e.has(String(c.id)))];this.checkedContacts=i,this.uncheckedContacts=n,this.uncheckedContacts.forEach(()=>{this.contactsArray.push(new j(!1))}),this.loading=!1})}catch(t){this.checkedContacts=[],this.uncheckedContacts=[],console.error(t),this.loading=!1}}addNewContactClickHandler(){this._matDialog.open(Ne,{width:"500px",data:{dealId:this.dealId,metric:this.metric}}).afterClosed().subscribe(t=>{t&&(this.contactsArray.push(new j(!0)),this.uncheckedContacts.push(t))})}createNewContactClickHandler(){if(this.newContactForm.invalid)return;let t=this.newContactForm.value;this.processingNewContact=!0,this.showNewContactForm=!0,this._contactService.createDealContact(this.dealId,t).subscribe({next:()=>{this.getPotentialContacts(),this.showNewContactForm=!1,this.processingNewContact=!1,this.newContactForm.reset()},error:e=>{this.processingNewContact=!1,typeof e.error=="string"&&this.newContactForm.setErrors({server:e.error})}})}submitSelectedContacts(){let t=this.contactsArray.controls.map((u,ht)=>u.value?this.uncheckedContacts[ht].id:null).filter(u=>u!==null),e=t.map(u=>this._contactService.addContactToMetric(u,this.dealId,this.metric.score,this.metric.detail)),i=this.uncheckedContacts.filter(u=>t.includes(u.id)).map(u=>({key:u.id,value:0,name:`${u.firstName} ${u.lastName}`,avatarLetter:`${u.firstName[0]}${u.lastName[0]}`})),n=this.checkedContacts.map(u=>({key:u.id,value:0,name:`${u.firstName} ${u.lastName}`,avatarLetter:`${u.firstName[0]}${u.lastName[0]}`})),c=()=>this._dialogRef.close({added:i,updated:n});e.length?Ft(e).subscribe(()=>c()):c()}saveClickHandler(){this.submitSelectedContacts()}closeClickHandler(){let t=this.checkedContacts.map(e=>({key:e.id,value:0,name:`${e.firstName} ${e.lastName}`,avatarLetter:`${e.firstName[0]}${e.lastName[0]}`}));this._dialogRef.close({added:[],updated:t})}editClickHandler(t){this._matDialog.open(Ne,{width:"500px",data:{dealId:this.dealId,metric:this.metric,contact:t}}).afterClosed().subscribe(()=>{this.getPotentialContacts()})}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-add-contact-dialog"]],decls:17,vars:1,consts:[["mat-dialog-title",""],[1,"mb-3"],[1,"spiner-container"],[1,"spai-contact-list"],[1,"d-flex"],["matButton","filled","type","button","data-testid","contact-dialog-new-button",3,"click"],["align","end"],[1,"spai-button-block"],["type","button","matButton","outlined","data-testid","contact-dialog-close-button",3,"click"],["type","button","matButton","filled","data-testid","contact-dialog-save-button",3,"click"],[3,"formGroup"],["formArrayName","contacts"],["disabled","","checked","",1,"spai-contact-checkbox"],[1,"spai-contact-name"],[1,"spai-contact-first-name",3,"title"],[1,"spai-contact-last-name",3,"title"],["type","button","matIconButton","",1,"spai-edit-contact-button",3,"click"],[1,"spai-contact-checkbox",3,"formControlName","value"]],template:function(e,i){e&1&&(a(0,"h2",0),p(1,"Add new contacts to the activity"),s(),a(2,"mat-dialog-content")(3,"section",1)(4,"legend"),p(5,"Existing contacts in your drop down list"),s(),w(6,Nn,2,0,"div",2)(7,En,7,1,"ul",3),s(),a(8,"div",4)(9,"button",5),d("click",function(){return i.addNewContactClickHandler()}),p(10,"+ New Contact"),s()()(),a(11,"mat-dialog-actions",6)(12,"div",7)(13,"button",8),d("click",function(){return i.closeClickHandler()}),p(14,"Close"),s(),a(15,"button",9),d("click",function(){return i.saveClickHandler()}),p(16,"Save"),s()()()),e&2&&(r(6),k(i.loading?6:7))},dependencies:[Le,Oe,qe,Ge,Di,Ti,Ni,_e,ge,J,ve,$,Ue,X,te,ee,V,b,x,A,F,M,Ht],styles:[".spai-contact-list[_ngcontent-%COMP%]{padding:0;margin-bottom:0}.spai-contact-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{list-style:none;display:flex;align-items:center;gap:6px;min-width:0}.spai-contact-checkbox[_ngcontent-%COMP%]{flex:1;min-width:0}
1.spai-contact-name[_ngcontent-%COMP%]{display:inline-flex;gap:4px;max-width:260px;min-width:0;vertical-align:bottom}.spai-contact-first-name[_ngcontent-%COMP%], .spai-contact-last-name[_ngcontent-%COMP%]{display:inline-block;max-width:128px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}legend[_ngcontent-%COMP%]{font-weight:700}.spiner-container[_ngcontent-%COMP%]{min-height:60px}.spai-edit-contact-button[_ngcontent-%COMP%]{font-size:14px;display:inline-flex;align-items:center;justify-content:center;position:relative;top:2px}.spai-edit-contact-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}"]})}};var Te=class{constructor(t,e,i,n,c,u){typeof t=="string"?(this.name=t,this.key=e,this.source=i,this.value=n,this.matches=u||[]):(this.name=t.name,this.key=t.key,this.source=t.source,this.value=t.value,this.matches=t.matches||[]),this.matches.length&&(this.matchesAdapted={metric:{matches:this.matches}}),this.avatarLetter=this._getInitialsAvatar(this.name),this.avatarBackground=this.matches.length?"#0acf97":"#77778c"}_getInitialsAvatar(t){return t.split(" ").filter(Boolean).slice(0,2).map(i=>i[0]).join("")}};function In(o,t){if(o&1){let e=I();a(0,"button",14),d("click",function(){y(e);let n=m();return v(n.clearSelection())}),a(1,"mat-icon"),p(2,"close"),s()()}}function Rn(o,t){if(o&1){let e=I();a(0,"li",21)(1,"mat-checkbox",22),d("change",function(n){let c=y(e).$implicit,u=m().$implicit,ht=m();return v(ht.attributeChangeHandler(n,+u.key,c.key))}),Ot("checkedChange",function(n){let c=y(e).$implicit;return At(c.selected,n)||(c.selected=n),v(n)}),p(2),s()()}if(o&2){let e=t.$implicit;_("gpt-source",e.source==="GPT"),r(),Vt("checked",e.selected),l("value",e.key),r(),L("",e.name," ")}}function Vn(o,t){if(o&1){let e=I();a(0,"mat-option",15),d("click",function(n){return y(e),n.stopPropagation(),v(n.preventDefault())}),a(1,"mat-expansion-panel",16),d("click",function(n){return n.stopPropagation()})("afterExpand",function(){let n=y(e).$implicit,c=m();return v(c.toggleContact(+n.key))}),a(2,"mat-expansion-panel-header")(3,"mat-panel-title")(4,"mat-radio-button",17),d("click",function(n){return n.stopPropagation()})("change",function(n){y(e);let c=m();return v(c.selectNewContactHandler(n))}),s(),a(5,"div",18),p(6),s(),p(7),s()(),a(8,"ul",19),d("click",function(n){return n.stopPropagation()}),B(9,Rn,3,5,"li",20,se),s()()()}if(o&2){let e=t.$implicit;l("value",+e.key),r(),l("id",+e.key),r(3),l("value",+e.key),r(),gt("background",e==null?null:e.avatarBackground),r(),L(" ",e==null?null:e.avatarLetter," "),r(),L(" ",e.name," "),r(2),Q(e.attributes)}}var An="70%",On="835px",Gn="956px",ut=class o{constructor(){this.accordion=de(ke);this.expansionPanel=Lt(we);this.name="";this.selectedValue=null;this.options=[];this.contactAttributes={};this._pendingContactIds=new Set;this._pendingSelectionValue=null;this._hasPendingSelection=!1;this._contactService=S(fe);this._matDialog=S(Ae)}focus(){throw new Error("Method not implemented.")}ngAfterViewInit(){this.options=this.metric.data.values.map(t=>new Te(t)),this.selectedValue=this.options.find(t=>Number(t.key)===Number(this.metric.value))}clearSelection(){this.metricForm?.get(this.metric?.shortName)?.setValue(null),this.selectedValue=null}openedChangeHandler(t){t?Promise.resolve().then(()=>{this._setExternalUpdatesGuard(!0),this.expansionPanel().forEach(e=>{if(e._elementRef.nativeElement.id===this.selectedValue?.key){e.open();return}})}):(this._flushPendingAttributes(),this._flushPendingSelection(),Promise.resolve().then(()=>this._setExternalUpdatesGuard(!1)))}_setExternalUpdatesGuard(t){let e=this.metricForm;t?e.focusField?.(this.metric.shortName):e.blurField?.(this.metric.shortName)}_flushPendingSelection(){this._hasPendingSelection&&(this.metricForm.controls[this.metric.shortName].setValue(this._pendingSelectionValue),this._hasPendingSelection=!1,this._pendingSelectionValue=null)}toggleContact(t){if(this._pendingContactIds.has(t))return;let e=this.options.find(i=>+i.key===t);this._contactService.getAttributes(t,this.dealId,this.metric.detail).pipe(wt(i=>{e.attributes=[...i.data.values.map(n=>Y(q({},n),{selected:i.value?.includes(n.key)}
1))]})).subscribe()}attributeChangeHandler(t,e,i){let n=this.options.find(u=>+u.key===e),c=n.attributes.findIndex(u=>u.key===i);n.attributes[c].selected=t.checked,this.options=[...this.options],this._pendingContactIds.add(e)}_flushPendingAttributes(){this._pendingContactIds.forEach(t=>{let e=this.options.find(n=>+n.key===t);if(!e)return;let i=e.attributes.filter(n=>n.selected).map(n=>n.key);this._contactService.assignAttributeToContact(t,this.dealId,this.metric.detail,i).subscribe()}),this._pendingContactIds.clear()}addContactClickHandler(){this._matDialog.open(dt,{minHeight:An,minWidth:On,maxWidth:Gn,data:{dealId:this.dealId,metric:this.metric}}).afterClosed().subscribe(t=>{if(t){let e=Array.isArray(t)?t:t.added??[],i=Array.isArray(t)?[]:t.updated??[];if(i.length){let n=new Map(i.map(c=>[String(c.key),c]));this.options=this.options.map(c=>{let u=n.get(String(c.key));return u?Y(q({},c),{name:u.name,avatarLetter:u.avatarLetter}):c})}if(e.length){let n=new Set(this.options.map(u=>String(u.key))),c=e.filter(u=>!n.has(String(u.key))).map(u=>new Te(u));this.options=[...this.options,...c],Promise.resolve().then(()=>{this.expansionPanel().forEach(u=>{u._elementRef.nativeElement.id===e[0].key&&u.open()})})}}})}selectNewContactHandler(t){this._pendingSelectionValue=t.value,this._hasPendingSelection=!0,this.selectedValue=this.options.find(e=>Number(e.key)===Number(t.value))}selectionChangeHandler(t){this._pendingSelectionValue=t.value,this._hasPendingSelection=!0,this.selectedValue=this.options.find(e=>Number(e.key)===Number(t.value))}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-contact-select"]],viewQuery:function(e,i){e&1&&le(i.accordion,ke,5)(i.expansionPanel,we,5),e&2&&me(2)},features:[pe([Ei,Pi])],decls:19,vars:8,consts:[[3,"formGroup"],["appearance","outline","subscriptSizing","dynamic",1,"spai-mat-form-field","w-100"],["matSuffix","",1,"spai-metric-selector-suffix"],["matIconButton","","type","button","title","Clear selection",1,"spai-mat-suffix-button"],["hideSingleSelectionIndicator","","panelClass","spai-mat-panel",3,"selectionChange","openedChange","formControlName"],[1,"spai-contact-select-trigger"],[1,"spai-contact-select-trigger__avatar"],[1,"spai-contact-select-trigger__name"],["aria-label","Select an contact",3,"value"],[1,"example-headers-align",3,"click"],[1,"spai-contact-option",3,"value"],[1,"spai-contact-option","spai-contact-option--add",3,"click"],[1,"spai-contact-action",3,"click"],["type","button",1,"spai-button",3,"click"],["matIconButton","","type","button","title","Clear selection",1,"spai-mat-suffix-button",3,"click"],[1,"spai-contact-option",3,"click","value"],["togglePosition","before",1,"spai-contact-mat-expansion-panel",3,"click","afterExpand","id"],[3,"click","change","value"],[1,"spai-contact-select-trigger__avatar","margin-2"],[1,"spai-attributes-list",3,"click"],[1,"spai-attribute-item",3,"gpt-source"],[1,"spai-attribute-item"],[3,"change","checkedChange","checked","value"]],template:function(e,i){e&1&&(D(0,0),a(1,"mat-form-field",1)(2,"div",2),w(3,In,3,0,"button",3),s(),a(4,"mat-select",4),d("selectionChange",function(c){return i.selectionChangeHandler(c)})("openedChange",function(c){return i.openedChangeHandler(c)}),a(5,"mat-select-trigger")(6,"div",5)(7,"div",6),p(8),s(),a(9,"div",7),p(10),s()()(),a(11,"mat-radio-group",8)(12,"mat-accordion",9),d("click",function(c){return c.stopPropagation()}),B(13,Vn,11,7,"mat-option",10,se),s()(),a(15,"mat-option",11),d("click",function(c){return c.stopPropagation(),c.preventDefault()}),a(16,"div",12),d("click",function(c){return c.stopPropagation()}),a(17,"button",13),d("click",function(){return i.addContactClickHandler()}),p(18,"Add contact"),s()()()()(),N()),e&2&&(l("formGroup",i.metricForm),r(3),k(i.selectedValue?3:-1),r(),l("formControlName",i.metric.shortName),r(3),gt("background",i.selectedValue==null?null:i.selectedValue.avatarBackground),r(),L(" ",i.selectedValue==null?null:i.selectedValue.avatarLetter," "),r(2),L(" ",i.selectedValue==null?null:i.selectedValue.name," "),r(),l("value",+(i.selectedValue==null?null:i.selectedValue.key)),r(2),Q(i.options))},dependencies:[He,W,ei,Ce,Qe,Be,Fi,ke,we,xi,Mi,_e,ge,ki,Si,wi,V,b,x,A,F,M,$,X,te,ee],styles:["[_nghost-%COMP%]{display:block;width:100%}.margin-2[_ngcontent-%COMP%]{margin-right:8px}.spai-contact-select-trigger[_ngcontent-%COMP%]{display:flex;align-items:center;width:calc(100% - 24px);cursor:pointer;gap:.5rem}
1.spai-contact-select-trigger__avatar[_ngcontent-%COMP%]{font-size:12px;background-color:red;flex-shrink:0;border-radius:50%;padding:4px;width:24px;height:24px;display:flex;justify-content:center;align-items:center}.spai-contact-select-trigger__name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.spai-contact-mat-expansion-panel[_ngcontent-%COMP%]{border-radius:0;margin-bottom:0}.spai-contact-mat-expansion-panel[_ngcontent-%COMP%] mat-expansion-panel-header[_ngcontent-%COMP%]{height:48px;background-color:transparent}.spai-contact-option[_ngcontent-%COMP%]{padding-left:0;padding-right:0;border-radius:0;--mat-expansion-container-shape: 0;--mat-option-focus-state-layer-color: var(--spai-card-bg)}.spai-attributes-list[_ngcontent-%COMP%]{padding-left:24px}.spai-attribute-item[_ngcontent-%COMP%]{list-style:none}.spai-ai-answers-trigger-wrapper[_ngcontent-%COMP%]{width:36px}.spai-contact-action[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:.5rem 1rem;position:sticky;margin-bottom:-5px;border-top:1px solid var(--spai-border-color);background-color:var(--spai-card-bg);bottom:-8px}.spai-contact-option--add[_ngcontent-%COMP%]{position:sticky;bottom:-9px}.spai-mat-suffix-button[_ngcontent-%COMP%]{position:absolute;right:16px;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center}.spai-mat-suffix-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:auto;height:auto;font-size:16px}.gpt-source[_ngcontent-%COMP%]{--mat-checkbox-label-text-color: var(--spai-success)}"]})}};var Li={numeric:Je,enum:ui,enumActivities:rt,yesNo:it,checkbox:st,range:et,duration:Xe,text:tt,richText:pt,date:Ke,percentage:ct,currency:lt,decimal:mt,contact:ut},xe=class o{constructor(t){this.container=t}ngOnChanges(t){t.metric&&this.componentRef?.instance&&("enumValues"in this.componentRef.instance?this.componentRef.instance.metric=Y(q({},this.metric),{data:{values:this.componentRef.instance.enumValues}}):this.componentRef.instance.metric=this.metric)}ngOnInit(){let t=this.getType();this.isActivity&&t==="enum"?this.componentRef=this.container.createComponent(Li.enumActivities):this.componentRef=this.container.createComponent(Li[t]),this.componentRef.instance.id=this.id,this.componentRef.instance.name=this.name,this.componentRef.instance.metric=this.metric,this.componentRef.instance.metricForm=this.group,this.componentRef.instance.hideDefault=this.hideDefault,this.componentRef.instance.textLeft=this.textLeft,this.componentRef.instance.dealId=this.dealId}getType(){switch(this.metric?.type?.toLowerCase()){case"currency":return"currency";case"percentage":return"percentage";case"range":return"range";case"yes/no":case"yes_no":return this.metric.data==="Check"?"checkbox":"yesNo";case"duration":return"duration";case"text":return Ye(this.metric)?"richText":"text";case"enum_contact":return"contact";case"date":return"date";case"multiselect":case"enum":return"enum";default:return"decimal"}}focus(){this.componentRef.instance?.focus()}static{this.\u0275fac=function(e){return new(e||o)(ne(Tt))}}static{this.\u0275dir=Pt({type:o,selectors:[["","spaiMetricFieldBuilder",""]],inputs:{metric:"metric",group:"group",id:"id",name:"name",hideDefault:"hideDefault",textLeft:"textLeft",isActivity:"isActivity",dealId:"dealId"},standalone:!1,features:[Pe]})}};var ft=class o{focus(){this.field.focus()}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-metric-field"]],viewQuery:function(e,i){if(e&1&&T(xe,5),e&2){let n;C(n=g())&&(i.field=n.first)}},hostVars:3,hostBindings:function(e,i){e&1&&d("focus",function(){return i.focus()}),e&2&&f("id","spai-metric-field-"+i.id)("data-testid","metric-field-"+(i.metric==null?null:i.metric.shortName))("tabindex",0)}
1,inputs:{id:"id",name:"name",metric:"metric",metricForm:"metricForm",textLeft:"textLeft",hideDefault:"hideDefault",isActivity:"isActivity",dealId:"dealId"},standalone:!1,decls:2,vars:8,consts:[["field",""],["spaiMetricFieldBuilder","",3,"id","name","metric","group","hideDefault","textLeft","isActivity","dealId"]],template:function(e,i){e&1&&It(0,1,0),e&2&&l("id",i.id)("name",i.name)("metric",i.metric)("group",i.metricForm)("hideDefault",i.hideDefault)("textLeft",i.textLeft)("isActivity",i.isActivity)("dealId",i.dealId)},dependencies:[xe],styles:["[_nghost-%COMP%]{display:flex;justify-content:end;width:100%}"]})}};var Ln=[[["spai-metric-field"]]],Un=["spai-metric-field"];function Bn(o,t){if(o&1&&P(0,"div",4),o&2){let e=m(2);l("innerHTML",e.sanitizedMetric,Ct)}}function Qn(o,t){if(o&1&&(a(0,"div",5),p(1),H(2,"metricFormat"),s()),o&2){let e=m(2);r(),Z(z(2,1,e.metricField==null?null:e.metricField.metric,"defaultValue"))}}function Hn(o,t){if(o&1&&w(0,Bn,1,1,"div",4)(1,Qn,3,4,"div",5),o&2){let e=m();k(e.isRichText?0:1)}}function zn(o,t){if(o&1&&P(0,"div",4),o&2){let e=m(2);l("innerHTML",e.sanitizedMetric,Ct)}}function jn(o,t){if(o&1&&(a(0,"div",5),p(1),H(2,"metricFormat"),s()),o&2){let e=m(2);r(),Z(z(2,1,e.metricField==null?null:e.metricField.metric,"defaultValue"))}}function $n(o,t){if(o&1){let e=I();a(0,"spai-signpost",6)(1,"button",7,1),d("click",function(){y(e);let n=m();return v(n.pressEnterHandler())})("focus",function(){y(e);let n=m();return v(n.focusIconHandler())})("blur",function(){y(e);let n=m();return v(n.blurIconHandler())})("keydown.enter",function(){y(e);let n=m();return v(n.pressEnterHandler())})("click",function(){y(e);let n=m();return v(n.pressEnterHandler())}),P(3,"mat-icon",8),s(),a(4,"spai-signpost-content")(5,"spai-signpost-content-header")(6,"div",9),p(7,"Default Value"),s()(),a(8,"div",10),w(9,zn,1,1,"div",4)(10,jn,3,4,"div",5),s()()()}if(o&2){let e=m();_("spai-default-info--position-absolute",e.displayPositionAbsolute),r(9),k(e.isRichText?9:10)}}var Wn=["yes/no","yes_no"],Yn=`<svg xmlns="http://www.w3.org/2000/svg" fill="#5C6BC0" height="24" width="24" viewBox="0 -960 960 960" > 2 <path 3 d="m480-320 160-160-160-160-56 56 64 64H320v80h168l-64 64 56 56Zm0 240q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z" /> 4</svg> 5`,Ui=class o{constructor(){this.spaiSignpostTrigger=de(De);this._isRangeOrYesNo=!1;this.isSmallMetric=Nt(!1);this.metricFormat=S(Ze);this.elementRef=S(U);let t=S(oi),e=S(Wt);t.addSvgIconLiteral("default-value",e.bypassSecurityTrustHtml(Yn))}get isRichText(){return Ye(this.metricField?.metric)}get sanitizedMetric(){let t=this.metricFormat.transform(this.metricField.metric,"defaultValue");return ni(t)}ngAfterContentInit(){this.spaiType=this._getSpaiType(),(this.spaiType==="currency"||this.spaiType==="percentage"||this.spaiType==="number"||this.spaiType==="integer"||this.spaiType==="date"||this.spaiType==="yes_no")&&this.isSmallMetric.set(!0),this.displayDefaultIcon=!!(this.metricField?.metric?.defaultValue||this.metricField?.metric?.defaultValue===0),this._isRangeOrYesNo=this.metricField?.metric?.type?.toLowerCase()==="range"||this.metricField?.metric?.type?.toLowerCase()==="yes_no",this.displayPositionAbsolute=!Wn.includes(this.metricField?.metric?.type.toLowerCase())||this.elementRef.nativeElement?.offsetWidth>133}focusIconHandler(){this.spaiSignpostTrigger().signpostTriggerHoverHandler()}blurIconHandler(){this.spaiSignpostTrigger().closePopover()}pressEnterHandler(){this.setDefault(),this.spaiSignpostTrigger().closePopover()}setDefault(){this.metricField.metricForm.get(this.metricField.metric.shortName).setValue(this.metricField.metric.defaultValue),this.metricField.metricForm.get(this.metricField.metric.shortName).isSetDefaultClick=!0}_getSpaiType(){let t=this.metricField.metric?.type?.toLowerCase();return t==="currency"?"currency":t==="percentage"?"percentage":t}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275cmp=h({type:o,selectors:[["spai-default-wrapper"]],contentQueries:function(e,i,n){if(e&1&&Ie(n,ft,5),e&2){let c;C(c=g())&&(i.metricField=c.first)}},viewQuery:function(e,i){e&1&&le(i.spaiSignpostTrigger,De,5),e&2&&me()},hostAttrs:[1,"spai-metric-field__default-wrapper"],hostVars:2,hostBindings:function(e,i){e&2&&_("spai-metric-field__default-wrapper--small",i.isSmallMetric())},features:[pe([Ze])],ngContentSelectors:Un,decls:5,vars:6,consts:[["defaultContent",""],["spaiSignpostTrigger",""],[1,"spai-default-wrapper-inner"],[1,"default","spai-default-info",3,"spai-default-info--position-absolute"],[3,"innerHTML"],[1,"text-center"],[1,"default","spai-default-info"],["data-testid","set-default-metric-value","spaiSignpostTrigger","","triggerType","hover","type","button","mat-icon-button","",1,"spai-default-info--button",3,"click","focus","blur","keydown.enter"],["svgIcon","default-value"],[1,"spai-ai-popover-header"],[1,"spai-default-value-content"]],template:function(e,i){e&1&&(ce(Ln),a(0,"div",2),Et(1,Hn,2,1,"ng-template",null,0,Gt),w(3,$n,11,3,"spai-signpost",3),oe(4),s()),e&2&&(_("rich-text",i.isRichText)("spai-default-wrapper-inner--range",i._isRangeOrYesNo),f("data-testid","metric-wrapper-"+(i.metricField==null||i.metricField.metric==null?null:i.metricField.metric.shortName)),r(3),k(i.displayDefaultIcon?3:-1))},dependencies:[$,X,te,ee,Ii,Vi,Ri,De,Ai,Ze],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] mat-slider{width:100%;min-width:169px}[_nghost-%COMP%] .mat-slider-horizontal .mat-slider-wrapper{left
5:2px;right:2px}[_nghost-%COMP%] spai-slider{width:100%}.spai-metric-field__default-wrapper--small[_nghost-%COMP%]{width:auto!important}.spai-default-info.spai-default-info--position-absolute[_ngcontent-%COMP%]{left:0;transform:translate(-50%,-50%)}.spai-default-info[_ngcontent-%COMP%]:focus{box-shadow:#5c6bc040 0 0 0 .25rem;border-radius:50%}.spai-default-wrapper-inner[_ngcontent-%COMP%]{display:flex;position:relative;gap:.7rem}.spai-default-wrapper-inner--range[_ngcontent-%COMP%]{justify-content:end}.spai-default-wrapper-inner.rich-text[_ngcontent-%COMP%] .spai-default-info.spai-default-info--position-absolute[_ngcontent-%COMP%]{top:6px;transform:translate(-50%)}.spai-default-info--button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}.spai-default-info--button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{display:inline-flex}spai-signpost-content[_ngcontent-%COMP%]{padding:0}.spai-default-value-content[_ngcontent-%COMP%]{padding:12px}"]})}};export{st as a,tt as b,re as c,be as d,it as e,rt as f,ct as g,lt as h,mt as i,ft as j,Ui as k};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.