@qaecy/cue-ui 0.0.24 → 0.0.26

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/104.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[104],{4853(T,D,c){c.d(D,{H:()=>f});var s=c(7705),l=c(5802),d=c(7089),x=c(7023),R=c(5381),h=c(5971),r=c(3319),E=c(356),P=c(6279),u=c(5547);const v=()=>({position:"bottomleft"}),b=(M,_)=>_.label||M;function y(M,_){if(1&M){const m=u.RV6();u.j41(0,"cue-menu-item",4),u.bIt("click",function(){const z=l.eBV(m).$implicit;return l.Njj(z.action())}),u.EFF(1),u.k0s()}if(2&M){const m=_.$implicit;u.Y8G("selected",m.selected),u.R7$(),u.JRh(m.label)}}function O(M,_){if(1&M&&(u.j41(0,"cue-menu-wrap"),u.Z7z(1,y,2,2,"cue-menu-item",3,b),u.k0s()),2&M){const m=u.XpG();u.R7$(),u.Dyx(m.contextMenuItems())}}function F(M,_){if(1&M){const m=u.RV6();u.j41(0,"cue-button",5),u.bIt("click",function(z){const I=l.eBV(m).$implicit,B=u.XpG();return l.Njj(B.handleClick(z,I))}),u.nrm(1,"cue-button-icon",6),u.k0s()}if(2&M){const m=_.$implicit,e=u.XpG(),z=u.sdS(1);u.Y8G("cueTooltip",m.label)("variant",m.variant?m.variant:e.variant())("size",e.size())("cueContextMenu",z)("contextMenuData",u.lJ4(7,v))("cueContextEnabled",void 0!==m.contextMenuItems&&m.contextMenuItems.length>0),u.R7$(),u.Y8G("icon",m.icon)}}let f=(()=>{class M{items=s.hFB.required();noGap=(0,s.hFB)(!0);direction=(0,s.hFB)("row");size=(0,s.hFB)("xs");variant=(0,s.hFB)("tertiary");mouseEnter=(0,s.CGW)();mouseLeave=(0,s.CGW)();contextMenuItems=(0,l.vPA)([]);handleClick(m,e){m.stopPropagation(),e.contextMenuItems&&e.contextMenuItems.length>0?this.contextMenuItems.set(e.contextMenuItems):e.action&&(this.contextMenuItems.set([]),e.action())}static \u0275fac=function(e){return new(e||M)};static \u0275cmp=u.VBU({type:M,selectors:[["cue-entity-menu"]],inputs:{items:[1,"items"],noGap:[1,"noGap"],direction:[1,"direction"],size:[1,"size"],variant:[1,"variant"]},outputs:{mouseEnter:"mouseEnter",mouseLeave:"mouseLeave"},decls:5,vars:2,consts:[["contextMenu",""],["gap","s","justify","end",2,"width","100%",3,"mouseenter","mouseleave","direction","noGap"],["trigger","leftclick",3,"cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"selected"],[3,"click","selected"],["trigger","leftclick",3,"click","cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"icon"]],template:function(e,z){1&e&&(u.DNE(0,O,3,0,"ng-template",null,0,u.C5r),u.j41(2,"cue-flexcontainer",1),u.bIt("mouseenter",function(){return z.mouseEnter.emit()})("mouseleave",function(){return z.mouseLeave.emit()}),u.Z7z(3,F,2,8,"cue-button",2,b),u.k0s()),2&e&&(u.R7$(2),u.Y8G("direction",z.direction())("noGap",z.noGap()),u.R7$(),u.Dyx(z.items()))},dependencies:[R.n,h.$,d.d,r.a,x.Q,E.M,P.D],encapsulation:2,changeDetection:0})}return M})()},5903(T,D,c){c.d(D,{L:()=>Ae});var s=c(7705),l=c(5802),d=c(2271),x=c(4853),R=c(9495),h=c(467),r=c(9352),E=c(5745),P=c(5381),u=c(5971),v=c(2245),b=c(9421),y=c(8957),O=c(5448),F=c(2444),f=c(9417),M=c(7374),_=c.n(M),m=c(3319),e=c(5547);const z=(o,g)=>g.date;function I(o,g){if(1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o){const t=g.$implicit,i=e.XpG();e.Y8G("size",i.size()),e.R7$(),e.JRh(e.bMT(2,2,t))}}function B(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-button",13),e.bIt("click",function(){const n=l.eBV(t).$implicit,a=e.XpG();return l.Njj(a.selectDay(n))}),e.j41(1,"cue-button-label"),e.EFF(2),e.k0s()()}if(2&o){const t=g.$implicit,i=e.XpG();e.AVh("other-month",!t.isCurrentMonth)("today",t.isToday),e.Y8G("selected",t.isSelected)("size",i.size()),e.R7$(2),e.JRh(t.day)}}let W=(()=>{class o{date=s.geq.required();size=(0,s.hFB)("m");weekdays=["mon","tue","wed","thu","fri","sat","sun"].map(t=>`common.weekdaysShort.${t}`);yearOptions=Array.from({length:101},(t,i)=>(_()().year()-50+i).toString()).reverse();monthOptions=Array.from({length:12},(t,i)=>(i+1).toString());chevronSize=(0,d.EW)(()=>{const t=this.size();return"l"===t?"m":"m"===t?"s":"s"===t?"xs":"s"});monthLabels={1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"};today=(0,d.EW)(()=>_()().format("YYYY-MM-DD"));calendarDays=(0,d.EW)(()=>{const t=this.year(),i=this.month(),n=_()(this.date()),a=this.today(),p=_()(`${t}-${i}-01`),C=p.endOf("month"),w=0===p.day()?p.subtract(6,"day"):p.subtract(p.day()-1,"day"),j=0===C.day()?C:C.add(7-C.day(),"day"),V=[];let k=w;for(;k.isBefore(j)||k.isSame(j);){const $=k.format("YYYY-MM-DD");V.push({date:$,day:k.date(),isCurrentMonth:k.month()+1===i,isSelected:k.isSame(n,"day"),isToday:$===a,dayjs:k}),k=k.add(1,"day")}return V});jsDate=(0,d.EW)(()=>_()(this.date()));year=(0,d.uu)(()=>this.jsDate().year());month=(0,d.uu)(()=>this.jsDate().month()+1);day=(0,d.uu)(()=>this.jsDate().date());updateDate(){const t=_()(new Date(this.year(),this.month()-1,this.day())).format("YYYY-MM-DD");this.date.set(t)}navigateMonth(t="next"){const i=_()(this.date()),n="next"===t?i.add(1,"month"):i.subtract(1,"month");this.date.set(n.format("YYYY-MM-DD"))}navigateYear(t="next"){const i=_()(this.date()),n="next"===t?i.add(1,"year"):i.subtract(1,"year");this.date.set(n.format("YYYY-MM-DD"))}selectDay(t){this.date.set(t.date),t.isCurrentMonth||(this.year.set(t.dayjs.year()),this.month.set(t.dayjs.month()+1))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-datepicker"]],inputs:{date:[1,"date"],size:[1,"size"]},outputs:{date:"dateChange"},decls:17,vars:10,consts:[["direction","column"],["gap","m","justify","center","align","center",2,"width","100%"],["variant","ghost",3,"size"],["icon","paginator-first",3,"click"],["icon","paginator-back",3,"click"],["justify","center",2,"width","200px"],["label","Month",3,"valueChange","size","options","labelMap","value"],["label","Year",3,"valueChange","size","options","value"],["icon","paginator-next",3,"click"],["icon","paginator-last",3,"click"],[1,"calendar-grid"],[3,"size"],["variant","ghost",3,"other-month","today","selected","size"],["variant","ghost",3,"click","selected","size"]],template:function(i,n){1&i&&(e.j41(0,"cue-flexcontainer",0)(1,"cue-flexcontainer",1)(2,"cue-button",2)(3,"cue-button-icon",3),e.bIt("click",function(){return n.navigateYear("prev")}),e.k0s(),e.j41(4,"cue-button-icon",4),e.bIt("click",function(){return n.navigateMonth("prev")}),e.k0s()(),e.j41(5,"cue-flexcontainer",5)(6,"cue-select",6),e.mxI("valueChange",function(p){return e.DH7(n.month,p)||(n.month=p),p}),e.bIt("valueChange",function(){return n.updateDate()}),e.k0s(),e.j41(7,"cue-select",7),e.mxI("valueChange",function(p){return e.DH7(n.year,p)||(n.year=p),p}),e.bIt("valueChange",function(){return n.updateDate()}),e.k0s()(),e.j41(8,"cue-button",2)(9,"cue-button-icon",8),e.bIt("click",function(){return n.navigateMonth("next")}),e.k0s()(),e.j41(10,"cue-button",2)(11,"cue-button-icon",9),e.bIt("click",function(){return n.navigateYear("next")}),e.k0s()()(),e.j41(12,"div",10),e.Z7z(13,I,3,4,"cue-typography",11,e.Vm6),e.Z7z(15,B,3,7,"cue-button",12,z),e.k0s()()),2&i&&(e.R7$(2),e.Y8G("size",n.chevronSize()),e.R7$(4),e.Y8G("size",n.size())("options",n.monthOptions)("labelMap",n.monthLabels),e.R50("value",n.month),e.R7$(),e.Y8G("size",n.size())("options",n.yearOptions),e.R50("value",n.year),e.R7$(),e.Y8G("size",n.chevronSize()),e.R7$(2),e.Y8G("size",n.chevronSize()),e.R7$(3),e.Dyx(n.weekdays),e.R7$(2),e.Dyx(n.calendarDays()))},dependencies:[P.n,F.l,u.$,O.L,v.Typography,m.a,r.Kj],styles:[".calendar-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-top:12px}.other-month[_ngcontent-%COMP%]{opacity:.4}"],changeDetection:0})}return o})();var X=c(7023),K=c(5187);const U=["inputField"];function Q(o,g){1&o&&e.EFF(0," * ")}function J(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-card",8)(1,"cue-datepicker",9),e.mxI("dateChange",function(n){l.eBV(t);const a=e.XpG();return e.DH7(a.internalDateValue,n)||(a.internalDateValue=n),l.Njj(n)}),e.bIt("dateChange",function(n){l.eBV(t);const a=e.XpG();return l.Njj(a.onDateChange(n))})("click",function(n){return n.stopPropagation()}),e.k0s()()}if(2&o){const t=e.XpG();e.R7$(),e.R50("date",t.internalDateValue)}}function Z(o,g){if(1&o&&(e.j41(0,"cue-typography",7),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.JRh(t.error())}}let q=(()=>{class o{value=(0,s.geq)("");label=(0,s.hFB)("");placeholder=(0,s.hFB)("");error=(0,s.hFB)(void 0);required=(0,s.hFB)(!1);size=(0,s.hFB)("m");datePickerPositioning=(0,s.hFB)(void 0);isFocused=!1;disabled=!1;iconSize=(0,d.EW)(()=>{switch(this.size()){case"l":return"m";case"m":default:return"s";case"s":case"xs":return"xs"}});contextMenuRef=null;inputField;internalDateValue=(0,d.uu)(()=>{const t=this.value();if(t){if(_()(t,"YYYY-MM-DD",!0).isValid())return t;const i=_()(t);return i.isValid()?i.format("YYYY-MM-DD"):_()().format("YYYY-MM-DD")}return _()().format("YYYY-MM-DD")});formattedDateValue=(0,d.EW)(()=>{const t=this.value();if(t){const i=_()(t);return i.isValid()?i.format("MMM D, YYYY"):t}return""});onValueChange=(0,l.QZP)(()=>this.valueChange.emit(this.value()));valueChange=(0,s.CGW)();onChange=t=>{};onTouched=()=>{};writeValue(t){this.value.set(t||"")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}emitValue(t){const i=t.target.value;this.value.set(i),this.onChange(i)}focus(){this.isFocused=!0,this.inputField?.nativeElement&&this.inputField.nativeElement.focus()}onBlur(){this.isFocused=!1,this.onTouched()}onDateChange(t){this.value.set(t),this.onChange(t)}onDatePickerOpen(t){this.contextMenuRef=t}onDatePickerClose(){this.contextMenuRef=null}closeDatePicker(){this.contextMenuRef&&document.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-input-date"]],viewQuery:function(i,n){if(1&i&&e.GBs(U,5),2&i){let a;e.mGM(a=e.lsd())&&(n.inputField=a.first)}},inputs:{value:[1,"value"],label:[1,"label"],placeholder:[1,"placeholder"],error:[1,"error"],required:[1,"required"],size:[1,"size"],datePickerPositioning:[1,"datePickerPositioning"]},outputs:{value:"valueChange",valueChange:"valueChange"},features:[e.Jv_([{provide:f.kq,useExisting:(0,l.Rfq)(()=>o),multi:!0}])],decls:11,vars:15,consts:[["inputField",""],["datePickerTemplate",""],[1,"form-field"],["size","s",1,"label"],["type","text","readonly","","trigger","leftclick",1,"input",3,"focus","blur","contextMenuOpen","contextMenuClose","value","placeholder","disabled","cueContextMenu","positioning"],["variant","ghost","trigger","leftclick",1,"calendar-button",3,"size","cueContextMenu","positioning"],["icon","calendar"],["size","s",1,"error-text"],[1,"date-picker-overlay","clickoutside-ignore"],["size","s",1,"clickoutside-ignore",3,"dateChange","click","date"]],template:function(i,n){if(1&i&&(e.j41(0,"div",2)(1,"cue-typography",3),e.EFF(2),e.nVh(3,Q,1,0),e.k0s(),e.j41(4,"input",4,0),e.bIt("focus",function(){return n.isFocused=!0})("blur",function(){return n.onBlur()})("contextMenuOpen",function(p){return n.onDatePickerOpen(p)})("contextMenuClose",function(){return n.onDatePickerClose()}),e.k0s(),e.j41(6,"cue-button",5),e.nrm(7,"cue-button-icon",6),e.k0s(),e.DNE(8,J,2,1,"ng-template",null,1,e.C5r),e.nVh(10,Z,2,1,"cue-typography",7),e.k0s()),2&i){const a=e.sdS(9);e.HbH("size-"+n.size()),e.AVh("focused",n.isFocused||n.value()),e.R7$(2),e.SpI(" ",n.label()," "),e.R7$(),e.vxM(n.required()?3:-1),e.R7$(),e.Y8G("value",n.formattedDateValue())("placeholder",n.placeholder())("disabled",n.disabled)("cueContextMenu",a)("positioning",n.datePickerPositioning()??"bottomright"),e.R7$(2),e.Y8G("size",n.iconSize())("cueContextMenu",a)("positioning",n.datePickerPositioning()??"bottomright"),e.R7$(4),e.vxM(n.error()?10:-1)}},dependencies:[v.Typography,W,X.Q,K.Z,m.a,u.$],styles:['.form-field[_ngcontent-%COMP%]{position:relative}.input[_ngcontent-%COMP%]{color:var(--cue-input-value-color);width:100%;border:none;border-bottom:1px solid var(--cue-input-border-bottom-color);background:none;outline:none;font-family:var(--cue-font-family)}.size-xs[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-xs-padding);font-size:var(--cue-input-xs-font-size)}.size-s[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-s-padding);font-size:var(--cue-input-s-font-size)}.size-m[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-m-padding);font-size:var(--cue-input-m-font-size)}.size-l[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{padding:var(--cue-input-l-padding);font-size:var(--cue-input-l-font-size)}.input[_ngcontent-%COMP%]::placeholder{color:var(--cue-input-placeholder-color);font-family:var(--cue-font-family)}.input[_ngcontent-%COMP%]:-webkit-autofill, .input[_ngcontent-%COMP%]:-webkit-autofill:hover, .input[_ngcontent-%COMP%]:-webkit-autofill:focus{-webkit-box-shadow:0 0 0px 1000px transparent inset;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s;-webkit-text-fill-color:var(--cue-input-value-color)}.label[_ngcontent-%COMP%]{position:absolute;pointer-events:none;transition:all .2s ease}.size-xs[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-top);left:var(--cue-input-xs-label-left)}.size-s[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-top);left:var(--cue-input-s-label-left)}.size-m[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-top);left:var(--cue-input-m-label-left)}.size-l[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-top);left:var(--cue-input-l-label-left)}.form-field.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{color:var(--cue-input-value-color)}.size-xs.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-xs[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-xs[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-focused-top);font-size:var(--cue-input-xs-label-focused-font-size)}.size-s.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-s[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-s[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-focused-top);font-size:var(--cue-input-s-label-focused-font-size)}.size-m.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-m[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-m[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-focused-top);font-size:var(--cue-input-m-label-focused-font-size)}.size-l.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-l[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-l[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-focused-top);font-size:var(--cue-input-l-label-focused-font-size)}.underline[_ngcontent-%COMP%]{content:"";position:absolute;bottom:0;left:0;height:1px;width:0;background-color:var(--cue-input-border-bottom-color);transition:width .3s ease}.form-field.focused[_ngcontent-%COMP%] .underline[_ngcontent-%COMP%]{width:100%}.error-text[_ngcontent-%COMP%]{color:var(--cue-error);margin-top:4px;min-height:18px}.date-picker-overlay[_ngcontent-%COMP%]{box-shadow:0 4px 12px #00000026;min-width:320px;position:relative;z-index:10001}.date-picker-overlay[_ngcontent-%COMP%] [_ngcontent-%COMP%]:deep(cue-menu){z-index:10002!important}.date-picker-overlay[_ngcontent-%COMP%] [_ngcontent-%COMP%]:deep(.clickoutside-ignore){pointer-events:auto}.calendar-button[_ngcontent-%COMP%]{position:absolute;right:8px;top:50%;transform:translateY(-50%);z-index:10;opacity:.7;transition:opacity .2s ease}.calendar-button[_ngcontent-%COMP%]:hover{opacity:1}.input[_ngcontent-%COMP%]{padding-right:40px;box-sizing:border-box}.form-field[_ngcontent-%COMP%]{width:100%;max-width:none;box-sizing:border-box}'],changeDetection:0})}return o})();var ee=c(9695),G=c(1413),te=c(7421),ne=c(3293),S=c(7384),ie=c(3798);let oe=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(i,n){},styles:["textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}\n"],encapsulation:2,changeDetection:0})}return o})(),ae=(()=>{class o{_elementRef=(0,l.WQX)(e.aKT);_platform=(0,l.WQX)(te.O);_ngZone=(0,l.WQX)(l.SKi);_renderer=(0,l.WQX)(e.sFG);_resizeEvents=new G.B;_previousValue;_initialHeight;_destroyed=new G.B;_listenerCleanups;_minRows;_maxRows;_enabled=!0;_previousMinRows=-1;_textareaElement;get minRows(){return this._minRows}set minRows(t){this._minRows=(0,S.OE)(t),this._setMinHeight()}get maxRows(){return this._maxRows}set maxRows(t){this._maxRows=(0,S.OE)(t),this._setMaxHeight()}get enabled(){return this._enabled}set enabled(t){this._enabled!==t&&((this._enabled=t)?this.resizeToFitContent(!0):this.reset())}get placeholder(){return this._textareaElement.placeholder}set placeholder(t){this._cachedPlaceholderHeight=void 0,t?this._textareaElement.setAttribute("placeholder",t):this._textareaElement.removeAttribute("placeholder"),this._cacheTextareaPlaceholderHeight()}_cachedLineHeight;_cachedPlaceholderHeight;_document=(0,l.WQX)(l.qQL);_hasFocus=!1;_isViewInited=!1;constructor(){(0,l.WQX)(ne.l).load(oe),this._textareaElement=this._elementRef.nativeElement}_setMinHeight(){const t=this.minRows&&this._cachedLineHeight?this.minRows*this._cachedLineHeight+"px":null;t&&(this._textareaElement.style.minHeight=t)}_setMaxHeight(){const t=this.maxRows&&this._cachedLineHeight?this.maxRows*this._cachedLineHeight+"px":null;t&&(this._textareaElement.style.maxHeight=t)}ngAfterViewInit(){this._platform.isBrowser&&(this._initialHeight=this._textareaElement.style.height,this.resizeToFitContent(),this._ngZone.runOutsideAngular(()=>{this._listenerCleanups=[this._renderer.listen("window","resize",()=>this._resizeEvents.next()),this._renderer.listen(this._textareaElement,"focus",this._handleFocusEvent),this._renderer.listen(this._textareaElement,"blur",this._handleFocusEvent)],this._resizeEvents.pipe((0,ie.Z)(16)).subscribe(()=>{this._cachedLineHeight=this._cachedPlaceholderHeight=void 0,this.resizeToFitContent(!0)})}),this._isViewInited=!0,this.resizeToFitContent(!0))}ngOnDestroy(){this._listenerCleanups?.forEach(t=>t()),this._resizeEvents.complete(),this._destroyed.next(),this._destroyed.complete()}_cacheTextareaLineHeight(){if(this._cachedLineHeight)return;const t=this._textareaElement.cloneNode(!1),i=t.style;t.rows=1,i.position="absolute",i.visibility="hidden",i.border="none",i.padding="0",i.height="",i.minHeight="",i.maxHeight="",i.top=i.bottom=i.left=i.right="auto",i.overflow="hidden",this._textareaElement.parentNode.appendChild(t),this._cachedLineHeight=t.clientHeight,t.remove(),this._setMinHeight(),this._setMaxHeight()}_measureScrollHeight(){const t=this._textareaElement,i=t.style.marginBottom||"",a=this._hasFocus,p=this._platform.FIREFOX?"cdk-textarea-autosize-measuring-firefox":"cdk-textarea-autosize-measuring";a&&(t.style.marginBottom=`${t.clientHeight}px`),t.classList.add(p);const C=t.scrollHeight-4;return t.classList.remove(p),a&&(t.style.marginBottom=i),C}_cacheTextareaPlaceholderHeight(){if(!this._isViewInited||null!=this._cachedPlaceholderHeight)return;if(!this.placeholder)return void(this._cachedPlaceholderHeight=0);const t=this._textareaElement.value;this._textareaElement.value=this._textareaElement.placeholder,this._cachedPlaceholderHeight=this._measureScrollHeight(),this._textareaElement.value=t}_handleFocusEvent=t=>{this._hasFocus="focus"===t.type};ngDoCheck(){this._platform.isBrowser&&this.resizeToFitContent()}resizeToFitContent(t=!1){if(!this._enabled||(this._cacheTextareaLineHeight(),this._cacheTextareaPlaceholderHeight(),!this._cachedLineHeight))return;const i=this._elementRef.nativeElement,n=i.value;if(!t&&this._minRows===this._previousMinRows&&n===this._previousValue)return;const a=this._measureScrollHeight(),p=Math.max(a,this._cachedPlaceholderHeight||0);i.style.height=`${p}px`,this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame<"u"?requestAnimationFrame(()=>this._scrollToCaretPosition(i)):setTimeout(()=>this._scrollToCaretPosition(i))}),this._previousValue=n,this._previousMinRows=this._minRows}reset(){void 0!==this._initialHeight&&(this._textareaElement.style.height=this._initialHeight)}_noopInputHandler(){}_scrollToCaretPosition(t){const{selectionStart:i,selectionEnd:n}=t;!this._destroyed.isStopped&&this._hasFocus&&t.setSelectionRange(i,n)}static \u0275fac=function(i){return new(i||o)};static \u0275dir=e.FsC({type:o,selectors:[["textarea","cdkTextareaAutosize",""]],hostAttrs:["rows","1",1,"cdk-textarea-autosize"],hostBindings:function(i,n){1&i&&e.bIt("input",function(){return n._noopInputHandler()})},inputs:{minRows:[0,"cdkAutosizeMinRows","minRows"],maxRows:[0,"cdkAutosizeMaxRows","maxRows"],enabled:[2,"cdkTextareaAutosize","enabled",s.L39],placeholder:"placeholder"},exportAs:["cdkTextareaAutosize"]})}return o})(),le=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e.$C({type:o});static \u0275inj=l.G2t({})}return o})();var A=c(29);const se=["inputField"];function ce(o,g){1&o&&e.EFF(0," * ")}function re(o,g){if(1&o&&(e.j41(0,"span",5),e.nrm(1,"cue-svg-icon",8),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Y8G("name",t.icon())}}function ue(o,g){if(1&o&&(e.j41(0,"cue-typography",7),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.JRh(t.error())}}let de=(()=>{class o{value=(0,s.geq)("");label=(0,s.hFB)("");placeholder=(0,s.hFB)("");error=(0,s.hFB)(void 0);required=(0,s.hFB)(!1);icon=(0,s.hFB)(void 0);size=(0,s.hFB)("m");isFocused=!1;disabled=!1;inputField;valueChange=(0,s.CGW)();onChange=t=>{};onTouched=()=>{};constructor(){(0,l.QZP)(()=>{this.valueChange.emit(this.value())})}writeValue(t){this.value.set(t||"")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}emitValue(t){const i=t.target.value;this.value.set(i),this.onChange(i)}focus(){this.isFocused=!0,this.inputField?.nativeElement&&this.inputField.nativeElement.focus()}onBlur(){this.isFocused=!1,this.onTouched()}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-input-multiline"]],viewQuery:function(i,n){if(1&i&&e.GBs(se,5),2&i){let a;e.mGM(a=e.lsd())&&(n.inputField=a.first)}},inputs:{value:[1,"value"],label:[1,"label"],placeholder:[1,"placeholder"],error:[1,"error"],required:[1,"required"],icon:[1,"icon"],size:[1,"size"]},outputs:{value:"valueChange",valueChange:"valueChange"},features:[e.Jv_([{provide:f.kq,useExisting:(0,l.Rfq)(()=>o),multi:!0}])],decls:10,vars:13,consts:[["inputField",""],[1,"form-field"],["size","s",1,"label"],[1,"input-container"],["align","center","gap","s"],[2,"height","12px"],["cdkTextareaAutosize","",1,"input","textarea",2,"resize","none","overflow","hidden",3,"input","focus","blur","cdkAutosizeMinRows","cdkAutosizeMaxRows","placeholder","value","disabled"],["size","s",1,"error-text"],[3,"name"]],template:function(i,n){1&i&&(e.j41(0,"div",1)(1,"cue-typography",2),e.EFF(2),e.nVh(3,ce,1,0),e.k0s(),e.j41(4,"div",3)(5,"cue-flexcontainer",4),e.nVh(6,re,2,1,"span",5),e.j41(7,"textarea",6,0),e.bIt("input",function(p){return n.emitValue(p)})("focus",function(){return n.isFocused=!0})("blur",function(){return n.onBlur()}),e.k0s()()(),e.nVh(9,ue,2,1,"cue-typography",7),e.k0s()),2&i&&(e.HbH("size-"+n.size()),e.AVh("focused",n.isFocused||n.value()),e.R7$(2),e.SpI(" ",n.label()," "),e.R7$(),e.vxM(n.required()?3:-1),e.R7$(3),e.vxM(n.icon()?6:-1),e.R7$(),e.Y8G("cdkAutosizeMinRows",1)("cdkAutosizeMaxRows",8)("placeholder",n.placeholder())("value",n.value())("disabled",n.disabled),e.R7$(2),e.vxM(n.error()?9:-1))},dependencies:[v.Typography,P.n,A.A,le,ae],styles:[".form-field[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column}.input-container[_ngcontent-%COMP%]{position:relative;z-index:2}.input.textarea[_ngcontent-%COMP%]{width:100%;min-height:32px;border:none;border-bottom:1px solid var(--cue-input-border-bottom-color);background:none;outline:none;font-family:var(--cue-font-family);resize:none;overflow:hidden;color:var(--cue-input-value-color);position:relative;z-index:2}.size-xs[_ngcontent-%COMP%] .input.textarea[_ngcontent-%COMP%]{padding:var(--cue-input-xs-padding);font-size:var(--cue-input-xs-font-size)}.size-s[_ngcontent-%COMP%] .input.textarea[_ngcontent-%COMP%]{padding:var(--cue-input-s-padding);font-size:var(--cue-input-s-font-size)}.size-m[_ngcontent-%COMP%] .input.textarea[_ngcontent-%COMP%]{padding:var(--cue-input-m-padding);font-size:var(--cue-input-m-font-size)}.size-l[_ngcontent-%COMP%] .input.textarea[_ngcontent-%COMP%]{padding:var(--cue-input-l-padding);font-size:var(--cue-input-l-font-size)}.input.textarea[_ngcontent-%COMP%]::placeholder{color:var(--cue-input-placeholder-color);font-family:var(--cue-font-family)}.input[_ngcontent-%COMP%]:-webkit-autofill, .input[_ngcontent-%COMP%]:-webkit-autofill:hover, .input[_ngcontent-%COMP%]:-webkit-autofill:focus{-webkit-box-shadow:0 0 0px 1000px transparent inset;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s;-webkit-text-fill-color:var(--cue-input-value-color)}.label[_ngcontent-%COMP%]{position:absolute;pointer-events:none;transition:all .2s ease;z-index:1;padding:0 4px;left:0}.size-xs[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-top);left:var(--cue-input-xs-label-left)}.size-s[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-top);left:var(--cue-input-s-label-left)}.size-m[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-top);left:var(--cue-input-m-label-left)}.size-l[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-top);left:var(--cue-input-l-label-left)}.form-field.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{color:var(--cue-input-value-color)}.size-xs.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-focused-top);font-size:var(--cue-input-xs-label-focused-font-size)}.size-s.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-focused-top);font-size:var(--cue-input-s-label-focused-font-size)}.size-m.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-focused-top);font-size:var(--cue-input-m-label-focused-font-size)}.size-l.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-focused-top);font-size:var(--cue-input-l-label-focused-font-size)}.error-text[_ngcontent-%COMP%]{color:var(--cue-error);margin-top:4px;min-height:18px}.form-field[_ngcontent-%COMP%]:not(.focused) .input-container[_ngcontent-%COMP%]{margin-top:24px}.form-field.focused[_ngcontent-%COMP%] .input-container[_ngcontent-%COMP%]{margin-top:12px}"],changeDetection:0})}return o})();var N=c(6117),_e=c(356),ge=c(6279),pe=c(1359);function me(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-typography",11),e.bIt("click",function(){l.eBV(t);const n=e.XpG();return l.Njj(!n.disabled()&&n.openMenu())}),e.EFF(1),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("info",t.info()),e.R7$(),e.JRh(t.label())}}function he(o,g){if(1&o&&e.nrm(0,"cue-svg-icon",12),2&o){const t=e.XpG();e.xc7("--cue-icon-width",t.iconSize()),e.Y8G("name",g)}}function fe(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-input",13),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){l.eBV(t);const a=e.XpG();return e.DH7(a.filterValue,n)||(a.filterValue=n),l.Njj(n)}),e.k0s(),e.nrm(2,"div",14)}if(2&o){const t=e.XpG();e.R50("value",t.filterValue),e.Y8G("placeholder",e.bMT(1,2,"components.input.select.placeholderFilter"))}}function ve(o,g){1&o&&e.nrm(0,"cue-svg-icon",17),2&o&&e.Y8G("name",g)}function Me(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-menu-item",15),e.bIt("click",function(n){const a=l.eBV(t).$implicit,p=e.XpG();return l.Njj(p.handleSelect(n,a.value))})("mousedown",function(n){l.eBV(t);const a=e.XpG();return l.Njj(a.preventEventBubbling(n))}),e.j41(1,"cue-checkbox",16),e.bIt("click",function(n){const a=l.eBV(t).$implicit,p=e.XpG();return l.Njj(p.handleSelect(n,a.value))})("mousedown",function(n){l.eBV(t);const a=e.XpG();return l.Njj(a.preventEventBubbling(n))}),e.k0s(),e.nVh(2,ve,1,1,"cue-svg-icon",17),e.EFF(3),e.k0s()}if(2&o){let t;const i=g.$implicit,n=e.XpG();e.Y8G("size",n.size())("disabled",n.isFixedValue(i.value)&&n.isSelected(i.value))("selected",n.isSelected(i.value)),e.R7$(),e.Y8G("checked",n.isSelected(i.value))("disabled",n.isFixedValue(i.value)&&n.isSelected(i.value)),e.R7$(),e.vxM((t=n.icon(i.value))?2:-1,t),e.R7$(),e.SpI(" ",i.label," ")}}function be(o,g){if(1&o&&(e.j41(0,"cue-typography",10),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.JRh(t.error())}}let Ce=(()=>{class o{label=(0,s.hFB)("");info=(0,s.hFB)("");placeholder=(0,s.hFB)(void 0);menuPosition=(0,s.hFB)(void 0);options=(0,s.hFB)();labelMap=(0,s.hFB)({});iconMap=(0,s.hFB)({});value=(0,s.geq)([]);valueChange=(0,s.CGW)();fixedValues=(0,s.hFB)([]);size=(0,s.hFB)("xs");disabled=(0,s.hFB)(!1);showFilter=(0,s.hFB)(!1);underline=(0,s.hFB)(!0);error=(0,s.hFB)(void 0);maxHeight=(0,s.hFB)(void 0);optionLabels=(0,d.EW)(()=>{const t=this.labelMap();return(this.options()??[]).map(n=>t[n]?t[n]:n.toString())});_multiSelectCount=(0,d.EW)(()=>(this.value()||[]).length);_multiSelectTranslated=(0,r.Xx)("components.input.multiSelect.itemsSelected",(0,d.EW)(()=>({count:this._multiSelectCount()})));_defaultPlaceholder=(0,r.Xx)("components.input.multiSelect.placeholderSelect");_placeholder=(0,d.EW)(()=>this.placeholder()??this._defaultPlaceholder());valueLabel=(0,d.EW)(()=>{const t=this.labelMap(),i=this.value()||[];if(0===i.length)return"";if(1===i.length){const n=i[0];return t[n]?t[n]:n.toString()}return this._multiSelectTranslated()});menuIsOpen=(0,l.vPA)(void 0);filterInputEl=(0,s.ebz)(y.p);menuEl=(0,s.ebz)(N.W);filterValue=(0,l.vPA)("");optionsFiltered=(0,d.EW)(()=>this._appendFilter(this.options()??[],this.filterValue(),this.labelMap()));iconSize=(0,d.EW)(()=>`var(--cue-input-${this.size()}-font-size)`);handleSelect(t,i){const a=t.target.closest("cue-multi-select");(null!==a?.closest(".ag-filter-wrapper")||null!==a?.closest(".ag-popup")||null!==a?.closest(".ag-filter-apply-panel")||null!==a?.closest('[class*="ag-"]')||null!==document.querySelector(".ag-filter-wrapper"))&&t.stopPropagation(),t.preventDefault();const C=this.value()||[],w=C.includes(i),j=this.fixedValues().includes(i);if(w&&j)return;let V;V=w?C.filter(k=>k!==i):[...C,i],this.value.update(()=>[...V]),this.valueChange.emit(V)}preventEventBubbling(t){const n=t.target.closest("cue-multi-select");(null!==n?.closest(".ag-filter-wrapper")||null!==n?.closest(".ag-popup")||null!==n?.closest(".ag-filter-apply-panel")||null!==n?.closest('[class*="ag-"]')||null!==document.querySelector(".ag-filter-wrapper"))&&(t.stopPropagation(),t.stopImmediatePropagation())}onMenuClosed(){this.menuIsOpen.set(!1)}openMenu(){this.menuIsOpen.set(!0),this.filterValue.set("")}handleSpace(t){t.preventDefault(),this.openMenu()}isSelected(t){return(this.value()||[]).includes(t)}isFixedValue(t){return this.fixedValues().includes(t)}constructor(){(0,l.QZP)(()=>{this.showFilter()&&this.menuIsOpen()&&setTimeout(()=>this.filterInputEl()?.focus(),20)}),(0,l.QZP)(()=>{const t=this.value()||[],n=this.fixedValues().filter(a=>!t.includes(a));if(n.length>0){const a=[...t,...n];this.value.set(a)}})}icon(t){if(void 0!==t)return this.iconMap()[t]}_appendFilter(t,i,n){const a=i.toLowerCase();return(""===i?t:t.filter(C=>(n[C]?n[C].toLowerCase():C.toString().toLowerCase()).startsWith(a))).map(C=>({value:C,label:n[C]?n[C]:C.toString()}))}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-multi-select"]],viewQuery:function(i,n){1&i&&e.wEZ(n.filterInputEl,y.p,5)(n.menuEl,N.W,5),2&i&&e.NyB(2)},inputs:{label:[1,"label"],info:[1,"info"],placeholder:[1,"placeholder"],menuPosition:[1,"menuPosition"],options:[1,"options"],labelMap:[1,"labelMap"],iconMap:[1,"iconMap"],value:[1,"value"],fixedValues:[1,"fixedValues"],size:[1,"size"],disabled:[1,"disabled"],showFilter:[1,"showFilter"],underline:[1,"underline"],error:[1,"error"],maxHeight:[1,"maxHeight"]},outputs:{value:"valueChange",valueChange:"valueChange"},decls:15,vars:20,consts:[["trigger",""],[1,"form-field"],["size","s",1,"label",3,"info"],[3,"menuClosed","positioning","contextEnabled"],["trigger","","tabindex","0",1,"select-trigger",3,"click","keydown.enter","keydown.space"],["align","center","gap","s",1,"select-value"],[3,"--cue-icon-width","name"],["name","arrow-dropdown",1,"select-arrow"],["menu","",1,"menu",3,"maxHeight"],[3,"size","disabled","selected"],["size","s",1,"error-text"],["size","s",1,"label",3,"click","info"],[3,"name"],[3,"valueChange","value","placeholder"],[2,"height","6px"],[3,"click","mousedown","size","disabled","selected"],["before","",3,"click","mousedown","checked","disabled"],["before","",3,"name"]],template:function(i,n){if(1&i&&(e.j41(0,"div",1),e.nVh(1,me,2,2,"cue-typography",2),e.j41(2,"cue-menu",3),e.bIt("menuClosed",function(){return n.onMenuClosed()}),e.EFF(3,"> "),e.j41(4,"div",4,0),e.bIt("click",function(){return!n.disabled()&&n.openMenu()})("keydown.enter",function(){return!n.disabled()&&n.openMenu()})("keydown.space",function(p){return!n.disabled()&&n.handleSpace(p)}),e.j41(6,"cue-flexcontainer",5),e.nVh(7,he,1,3,"cue-svg-icon",6),e.EFF(8),e.k0s(),e.nrm(9,"cue-svg-icon",7),e.k0s(),e.j41(10,"cue-menu-wrap",8),e.nVh(11,fe,3,4),e.Z7z(12,Me,4,7,"cue-menu-item",9,e.Vm6),e.k0s()(),e.nVh(14,be,2,1,"cue-typography",10),e.k0s()),2&i){let a;e.HbH("size-"+n.size()),e.AVh("focused",n.value()&&n.value().length>0||""!==n.placeholder())("menu-open",n.menuIsOpen())("underline",n.underline())("no-label",!n.label()),e.R7$(),e.vxM(n.label()?1:-1),e.R7$(),e.Y8G("positioning",n.menuPosition())("contextEnabled",!n.disabled()),e.R7$(2),e.AVh("disabled",n.disabled()),e.R7$(3),e.vxM((a=n.icon(1===n.value().length?n.value()[0]:void 0))?7:-1,a),e.R7$(),e.SpI(" ",n.value()&&n.value().length>0?n.valueLabel():n._placeholder()," "),e.R7$(2),e.Y8G("maxHeight",n.maxHeight()),e.R7$(),e.vxM(n.showFilter()?11:-1),e.R7$(),e.Dyx(n.optionsFiltered()),e.R7$(2),e.vxM(n.error()?14:-1)}},dependencies:[N.W,_e.M,ge.D,v.Typography,y.p,pe.S,A.A,P.n,r.Kj],styles:[".form-field[_ngcontent-%COMP%]{position:relative}.select-trigger[_ngcontent-%COMP%]{color:var(--cue-input-value-color);width:100%;border:none;background:none;outline:none;font-family:var(--cue-font-family);display:flex;justify-content:space-between;align-items:center;cursor:pointer;box-sizing:border-box}.form-field.underline[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{border-bottom:1px solid var(--cue-input-border-bottom-color)}.form-field[_ngcontent-%COMP%]:not(.underline) .select-trigger[_ngcontent-%COMP%]{align-items:flex-start;padding-top:2px;padding-bottom:1px}.select-trigger.disabled[_ngcontent-%COMP%]{cursor:not-allowed;opacity:.6}.select-trigger[_ngcontent-%COMP%]:focus{outline:none}.size-xs[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding:var(--cue-input-xs-padding);font-size:var(--cue-input-xs-font-size)}.size-s[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding:var(--cue-input-s-padding);font-size:var(--cue-input-s-font-size)}.size-m[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding:var(--cue-input-m-padding);font-size:var(--cue-input-m-font-size)}.size-l[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding:var(--cue-input-l-padding);font-size:var(--cue-input-l-font-size)}.form-field.no-label.size-xs[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%], .form-field.no-label.size-s[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%], .form-field.no-label.size-m[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%], .form-field.no-label.size-l[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]{padding-top:0}.select-value[_ngcontent-%COMP%]{color:var(--cue-input-value-color);font-family:var(--cue-font-family);flex:1;text-align:left}.form-field[_ngcontent-%COMP%]:not(.focused) .select-value[_ngcontent-%COMP%]{color:var(--cue-input-placeholder-color)}.select-arrow[_ngcontent-%COMP%]{color:var(--cue-input-value-color);margin-left:8px;display:inline-block;transition:transform .2s ease}.form-field.menu-open[_ngcontent-%COMP%] .select-arrow[_ngcontent-%COMP%]{transform:rotate(180deg)}.label[_ngcontent-%COMP%]{position:absolute;pointer-events:auto;transition:all .2s ease;cursor:pointer}.size-xs[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-top);left:var(--cue-input-xs-label-left)}.size-s[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-top);left:var(--cue-input-s-label-left)}.size-m[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-top);left:var(--cue-input-m-label-left)}.size-l[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-top);left:var(--cue-input-l-label-left)}.form-field.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .form-field.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{color:var(--cue-input-value-color)}.size-xs.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-xs.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-xs[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-xs[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-xs-label-focused-top);font-size:var(--cue-input-xs-label-focused-font-size)}.size-s.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-s.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-s[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-s[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-s-label-focused-top);font-size:var(--cue-input-s-label-focused-font-size)}.size-m.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-m.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-m[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-m[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-m-label-focused-top);font-size:var(--cue-input-m-label-focused-font-size)}.size-l.focused[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-l.menu-open[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], .size-l[_ngcontent-%COMP%] .select-trigger[_ngcontent-%COMP%]:not(:placeholder-shown) + .label[_ngcontent-%COMP%], .size-l[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:valid + .label[_ngcontent-%COMP%]{top:var(--cue-input-l-label-focused-top);font-size:var(--cue-input-l-label-focused-font-size)}cue-menu[_ngcontent-%COMP%]{width:100%}.error-text[_ngcontent-%COMP%]{color:var(--cue-error);margin-top:4px;min-height:18px}"],changeDetection:0})}return o})();const ye=["*"],Y=()=>[],L=()=>({});function xe(o,g){if(1&o&&(e.j41(0,"cue-typography"),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(t.config().message)}}function Pe(o,g){if(1&o&&(e.nrm(0,"cue-key-val",4),e.nI1(1,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",e.mNQ(e.bMT(1,3,"components.modals.rdfEdit.labelExistingValue")))("val",t.existingValue())}}function Oe(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-input",15),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){l.eBV(t);const a=e.XpG(2);return e.DH7(a.newValue,n)||(a.newValue=n),l.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,4,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("error",t.valueError())}}function De(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-input",16),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){l.eBV(t);const a=e.XpG(2);return e.DH7(a.newValue,n)||(a.newValue=n),l.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,4,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("error",t.valueError())}}function Ee(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-input-date",17),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){l.eBV(t);const a=e.XpG(2);return e.DH7(a.newValue,n)||(a.newValue=n),l.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,4,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("error",t.valueError())}}function ze(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",8)(1,"cue-typography"),e.EFF(2),e.nI1(3,"transloco"),e.k0s(),e.j41(4,"cue-input-switch",18),e.bIt("checkedChange",function(n){l.eBV(t);const a=e.XpG(2);return l.Njj(a.onBooleanChange(n))}),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"components.modals.rdfEdit.labelSetNewValue")),e.R7$(2),e.Y8G("checked","true"===t.newValue())}}function ke(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-select",19),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){l.eBV(t);const a=e.XpG(2);return e.DH7(a.newValue,n)||(a.newValue=n),l.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,7,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("options",t.config().options||e.lJ4(9,Y))("labelMap",t.config().optionLabelMap||e.lJ4(10,L))("showFilter",t.optionsCount()>5)("error",t.valueError())}}function Re(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-multi-select",19),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){l.eBV(t);const a=e.XpG(2);return e.DH7(a.newValue,n)||(a.newValue=n),l.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,7,"components.modals.rdfEdit.labelNewValue"))),e.R50("value",t.newValue),e.Y8G("options",t.config().options||e.lJ4(9,Y))("labelMap",t.config().optionLabelMap||e.lJ4(10,L))("showFilter",t.optionsCount()>5)("error",t.valueError())}}function Fe(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-input-multiline",20),e.nI1(1,"transloco"),e.mxI("valueChange",function(n){l.eBV(t);const a=e.XpG(2);return e.DH7(a.comment,n)||(a.comment=n),l.Njj(n)}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("label",e.mNQ(e.bMT(1,3,"components.modals.rdfEdit.labelComment"))),e.R50("value",t.comment)}}function Ve(o,g){if(1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(t.error())}}function Te(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-modal",1),e.bIt("close",function(){l.eBV(t);const n=e.XpG();return l.Njj(n.onClose())}),e.j41(1,"cue-flexcontainer",2),e.SdG(2),e.nVh(3,xe,2,1,"cue-typography"),e.j41(4,"cue-flexcontainer",3),e.nVh(5,Pe,2,5,"cue-key-val",4),e.nVh(6,Oe,2,6,"cue-input",5),e.nVh(7,De,2,6,"cue-input",6),e.nVh(8,Ee,2,6,"cue-input-date",7),e.nVh(9,ze,5,4,"cue-flexcontainer",8),e.nVh(10,ke,2,11,"cue-select",9),e.nVh(11,Re,2,11,"cue-multi-select",9),e.k0s(),e.nVh(12,Fe,2,5,"cue-input-multiline",10),e.nVh(13,Ve,2,1,"cue-typography",11),e.j41(14,"cue-flexcontainer",12)(15,"cue-button",13),e.bIt("click",function(){l.eBV(t);const n=e.XpG();return l.Njj(n.onClose())}),e.j41(16,"cue-button-label"),e.EFF(17),e.nI1(18,"transloco"),e.k0s()(),e.j41(19,"cue-button",14),e.bIt("click",function(){l.eBV(t);const n=e.XpG();return l.Njj(n.onSave())}),e.j41(20,"cue-button-label"),e.EFF(21),e.nI1(22,"transloco"),e.k0s()()()()()}if(2&o){const t=e.XpG();e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.vxM(t.config().message?3:-1),e.R7$(2),e.vxM("boolean"!==t.config().dataType?5:-1),e.R7$(),e.vxM("string"===t.config().dataType?6:-1),e.R7$(),e.vxM("number"===t.config().dataType?7:-1),e.R7$(),e.vxM("date"===t.config().dataType?8:-1),e.R7$(),e.vxM("boolean"===t.config().dataType?9:-1),e.R7$(),e.vxM("select"===t.config().dataType?10:-1),e.R7$(),e.vxM("multiselect"===t.config().dataType?11:-1),e.R7$(),e.vxM(t.identical()?-1:12),e.R7$(),e.vxM(t.error()?13:-1),e.R7$(2),e.Y8G("disabled",t.saving()),e.R7$(2),e.JRh(e.bMT(18,17,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",t.saving()||t.identical())("loading",t.saving()),e.R7$(2),e.JRh(e.bMT(22,19,"components.modals.rdfEdit.buttonSave"))}}let we=(()=>{class o{visible=(0,s.geq)(!0);config=s.hFB.required();close=(0,s.CGW)();existingValue=(0,d.EW)(()=>{let t="";return t=Array.isArray(this.config().existingValue)?this.config().existingValue.map(n=>this._getLabel(n)).join(", "):this._getLabel(this.config().existingValue),t});newValue=(0,d.uu)(()=>this.config().existingValue);comment=(0,l.vPA)("");errorID=(0,s.geq)("");error=(0,r.Xx)(this.errorID);saving=(0,l.vPA)(!1);pristine=(0,l.vPA)(!0);identical=(0,d.EW)(()=>!this.config().hasExternalChanges&&this.newValue()===this.config().existingValue);valueErrorID=(0,d.EW)(()=>this.pristine()?"":this.identical()?"components.modals.rdfEdit.errorIdenticalValue":"");valueError=(0,r.Xx)(this.valueErrorID);optionsCount=(0,d.EW)(()=>this.config().options?.length||0);constructor(){(0,l.QZP)(()=>{this.pristine()&&this.newValue()!==this.config().existingValue&&this.pristine.set(!1)})}onSave(){var t=this;return(0,h.A)(function*(){t.saving.set(!0),t.errorID.set("");try{const i=t.config();yield i.requestSave({newValue:t.newValue(),comment:t.comment(),previousValue:i.existingValue}),t.visible.set(!1),t.close.emit(t.newValue())}catch(i){console.error("Error saving RDF edit:",i),t.errorID.set("components.modals.rdfEdit.errorSaving")}t.saving.set(!1)})()}onClose(){this.visible.set(!1),this.close.emit(null)}onBooleanChange(t){this.newValue.set(t?"true":"false")}_getLabel(t){const i=this.config().optionLabelMap;return void 0!==i&&i[t]||t}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-modal-rdf-edit"]],inputs:{visible:[1,"visible"],config:[1,"config"],errorID:[1,"errorID"]},outputs:{visible:"visibleChange",close:"close",errorID:"errorIDChange"},ngContentSelectors:ye,decls:1,vars:1,consts:[[3,"displayCloseBtn","closeOnBackgroundClick"],[3,"close","displayCloseBtn","closeOnBackgroundClick"],["direction","column","align","center"],["direction","column","gap","m"],[3,"key","val"],["type","text",3,"label","value","error"],["type","number",3,"label","value","error"],[3,"label","value","error"],["direction","row","align","center","justify","space-between","gap","l"],[3,"value","options","labelMap","label","showFilter","error"],[2,"width","100%",3,"label","value"],[2,"color","var(--cue-error)"],["direction","row","justify","center",2,"width","100%"],[3,"click","disabled"],["variant","secondary",3,"click","disabled","loading"],["type","text",3,"valueChange","label","value","error"],["type","number",3,"valueChange","label","value","error"],[3,"valueChange","label","value","error"],[3,"checkedChange","checked"],[3,"valueChange","value","options","labelMap","label","showFilter","error"],[2,"width","100%",3,"valueChange","label","value"]],template:function(i,n){1&i&&(e.NAR(),e.nVh(0,Te,23,21,"cue-modal",0)),2&i&&e.vxM(n.visible()?0:-1)},dependencies:[E.a,P.n,u.$,v.Typography,b.F,y.p,O.L,F.l,Ce,q,ee.d,de,r.Kj],styles:[".col[_ngcontent-%COMP%]{flex:1;min-width:0;height:100%}"]})}return o})();var H=c(7335);function Ie(o,g){1&o&&(e.j41(0,"span",7),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o&&(e.R7$(),e.SpI("(",e.bMT(2,1,"components.keyVal.edited"),")"))}function je(o,g){if(1&o){const t=e.RV6();e.j41(0,"span",5),e.bIt("click",function(){l.eBV(t);const n=e.XpG();return l.Njj(n.onReadClick())}),e.j41(1,"span",6),e.EFF(2),e.k0s(),e.nVh(3,Ie,3,3,"span",7),e.k0s()}if(2&o){const t=e.XpG();e.AVh("interactive",!t.editDisabled()),e.Y8G("menuItems",t.hoverMenu()),e.R7$(2),e.Lme("",t.valueFormatted()," ",t.suffix()),e.R7$(),e.vxM(t.isDirty()?3:-1)}}function Be(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-select",10),e.bIt("valueChange",function(n){l.eBV(t);const a=e.XpG(2);return l.Njj(a.selectionChange(n))}),e.k0s()}if(2&o){const t=e.XpG(2);e.Y8G("value",t.newValue())("options",t.options())}}function Ne(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-inline-input",11),e.bIt("valueChange",function(n){l.eBV(t);const a=e.XpG(2);return l.Njj(a.inputChange(n))}),e.k0s(),e.EFF(1)}if(2&o){const t=e.XpG(2);e.Y8G("value",t.valueFormatted()),e.R7$(),e.SpI(" ",t.suffix()," ")}}function Ge(o,g){if(1&o&&(e.j41(0,"cue-flexcontainer",3),e.nVh(1,Be,1,2,"cue-select",8)(2,Ne,2,2),e.nrm(3,"cue-entity-menu",9),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(void 0!==t.options()&&t.options().length?1:2),e.R7$(2),e.Y8G("items",t.saveCancelMenu())}}function Se(o,g){if(1&o){const t=e.RV6();e.j41(0,"cue-modal-rdf-edit",12),e.mxI("visibleChange",function(n){l.eBV(t);const a=e.XpG();return e.DH7(a.rdfModalVisible,n)||(a.rdfModalVisible=n),l.Njj(n)}),e.bIt("close",function(n){l.eBV(t);const a=e.XpG();return l.Njj(a.onRdfModalClose(n))}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("config",g),e.R50("visible",t.rdfModalVisible)}}let Ae=(()=>{class o{entityMenuDirective;size=(0,s.hFB)("m");key=s.hFB.required();val=s.geq.required();originalValue=(0,s.hFB)(void 0);options=(0,s.hFB)([]);suffix=(0,s.hFB)("");rdfConfig=(0,s.hFB)();editDisabled=(0,s.hFB)(!1);valueChange=(0,s.CGW)();editModeEnabled=(0,l.vPA)(!1);isDirty=(0,d.EW)(()=>{const t=this.originalValue();return void 0!==t&&this.val()!==t});valueChanged=(0,d.EW)(()=>this.val()!==this.newValue());newValue=(0,d.uu)(()=>this.val());rdfModalVisible=(0,l.vPA)(!1);valueFormatted=(0,d.EW)(()=>this._idToString(this.val()));hoverMenu=(0,d.EW)(()=>{if(this.editModeEnabled()||this.editDisabled())return[];const t=[{icon:"edit",label:"Edit",action:()=>this.onReadClick()}];return this.isDirty()&&t.push({icon:"close",label:"Revert to original",action:()=>this._revert()}),t});onReadClick(){this.editDisabled()||(this.rdfConfig()?this.rdfModalVisible.set(!0):this.editModeEnabled.set(!0),this.entityMenuDirective?.removeOverlayMenu())}labelSize=(0,d.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(t){this.editModeEnabled()&&("Escape"===t.key?(this._reset(),t.stopPropagation()):"Enter"===t.key&&this._emitChange())}saveCancelMenu=(0,d.EW)(()=>{const t=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&t.push({icon:"save",label:"Save",action:()=>this._emitChange()}),t});selectionChange(t){this.newValue.set(t?.toString()??"")}inputChange(t){this.newValue.set(t)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}_revert(){const t=this.originalValue();void 0!==t&&(this.val.set(t),this.newValue.set(t),this.valueChange.emit(t),this.entityMenuDirective?.removeOverlayMenu())}_idToString(t){const i=this.rdfConfig()?.optionLabelMap;return i?i[t]??t:t}onRdfModalClose(t){if(this.rdfModalVisible.set(!1),null===t)return;const i=Array.isArray(t)?t.join(", "):t;this.val.set(i)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-key-val-editable"]],viewQuery:function(i,n){if(1&i&&e.GBs(H.e,5),2&i){let a;e.mGM(a=e.lsd())&&(n.entityMenuDirective=a.first)}},hostBindings:function(i,n){1&i&&e.bIt("keydown",function(p){return n.onKeyPress(p)},e.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],originalValue:[1,"originalValue"],options:[1,"options"],suffix:[1,"suffix"],rdfConfig:[1,"rdfConfig"],editDisabled:[1,"editDisabled"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:9,vars:5,consts:[[1,"key-val-container"],[3,"size"],["cueEntityMenu","",1,"read-mode-container",3,"interactive","menuItems"],["direction","row","align","center"],[3,"config","visible"],["cueEntityMenu","",1,"read-mode-container",3,"click","menuItems"],[1,"value-content"],[1,"dirty-indicator"],[3,"value","options"],[3,"items"],[3,"valueChange","value","options"],[3,"valueChange","value"],[3,"visibleChange","close","config","visible"]],template:function(i,n){if(1&i&&(e.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),e.EFF(3),e.k0s()(),e.j41(4,"dd")(5,"cue-typography",1),e.nVh(6,je,4,6,"span",2)(7,Ge,4,2,"cue-flexcontainer",3),e.k0s()()(),e.nVh(8,Se,1,2,"cue-modal-rdf-edit",4)),2&i){let a;e.R7$(2),e.Y8G("size",n.labelSize()),e.R7$(),e.JRh(n.key()),e.R7$(2),e.Y8G("size",n.size()),e.R7$(),e.vxM(n.editModeEnabled()?n.rdfConfig()?-1:7:6),e.R7$(2),e.vxM((a=n.rdfConfig())?8:-1,a)}},dependencies:[v.Typography,H.e,F.l,x.H,P.n,R.I,we,r.Kj],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return o})()},1024(T,D,c){c.d(D,{p:()=>d});var s=c(5547);const l=["*"];let d=(()=>{class x{static \u0275fac=function(r){return new(r||x)};static \u0275cmp=s.VBU({type:x,selectors:[["cue-key-val-list"]],ngContentSelectors:l,decls:2,vars:0,consts:[[1,"key-val-list"]],template:function(r,E){1&r&&(s.NAR(),s.rj2(0,"div",0),s.SdG(1),s.eux())},styles:[".key-val-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-grid-gap-s)}"]})}return x})()},9421(T,D,c){c.d(D,{F:()=>r});var s=c(7705),l=c(5802),d=c(2271),x=c(7335),R=c(2245),h=c(5547);let r=(()=>{class E{entityMenuDirective;size=(0,s.hFB)("m");key=s.hFB.required();val=s.geq.required();options=(0,s.hFB)([]);suffix=(0,s.hFB)("");valueChange=(0,s.CGW)();editModeEnabled=(0,l.vPA)(!1);valueChanged=(0,d.EW)(()=>this.val()!==this.newValue());newValue=(0,d.uu)(()=>this.val());labelSize=(0,d.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(u){this.editModeEnabled()&&("Escape"===u.key?(this._reset(),u.stopPropagation()):"Enter"===u.key&&this._emitChange())}saveCancelMenu=(0,d.EW)(()=>{const u=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&u.push({icon:"save",label:"Save",action:()=>this._emitChange()}),u});selectionChange(u){this.newValue.set(u?.toString()??"")}inputChange(u){this.newValue.set(u)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}static \u0275fac=function(v){return new(v||E)};static \u0275cmp=h.VBU({type:E,selectors:[["cue-key-val"]],viewQuery:function(v,b){if(1&v&&h.GBs(x.e,5),2&v){let y;h.mGM(y=h.lsd())&&(b.entityMenuDirective=y.first)}},hostBindings:function(v,b){1&v&&h.bIt("keydown",function(O){return b.onKeyPress(O)},h.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],options:[1,"options"],suffix:[1,"suffix"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:8,vars:5,consts:[[1,"key-val-container"],[3,"size"],[1,"value-content"]],template:function(v,b){1&v&&(h.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),h.EFF(3),h.k0s()(),h.j41(4,"dd")(5,"cue-typography",1)(6,"span",2),h.EFF(7),h.k0s()()()()),2&v&&(h.R7$(2),h.Y8G("size",b.labelSize()),h.R7$(),h.JRh(b.key()),h.R7$(2),h.Y8G("size",b.size()),h.R7$(2),h.Lme("",b.val()," ",b.suffix()))},dependencies:[R.Typography],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return E})()},8547(T,D,c){c.d(D,{T:()=>F});var s=c(7705),l=c(29),d=c(6117),x=c(6279),R=c(356),h=c(5802),r=c(5547);const E=(f,M)=>M.label;function P(f,M){if(1&f&&r.nrm(0,"cue-svg-icon",3),2&f){const _=r.XpG(2).$implicit;r.Y8G("name",_.icon)}}function u(f,M){if(1&f&&r.nrm(0,"cue-menu-nested",5),2&f){const _=r.XpG(2).$implicit,m=r.XpG();r.Y8G("items",_.children)("positioning",m.positioning())}}function v(f,M){if(1&f&&(r.j41(0,"cue-menu",0)(1,"cue-menu-item",2),r.nVh(2,P,1,1,"cue-svg-icon",3),r.EFF(3),r.nrm(4,"cue-svg-icon",4),r.k0s(),r.nVh(5,u,1,2,"cue-menu-nested",5),r.k0s()),2&f){const _=r.XpG().$implicit,m=r.XpG();r.Y8G("positioning",m.positioning()),r.R7$(),r.Y8G("title",_.tooltip),r.R7$(),r.vxM(_.icon?2:-1),r.R7$(),r.SpI(" ",_.label," "),r.R7$(2),r.vxM(_.children?5:-1)}}function b(f,M){if(1&f&&r.nrm(0,"cue-svg-icon",3),2&f){const _=r.XpG(2).$implicit;r.Y8G("name",_.icon)}}function y(f,M){if(1&f){const _=r.RV6();r.j41(0,"cue-menu-item",6),r.bIt("click",function(){h.eBV(_);const e=r.XpG().$implicit;return h.Njj(null==e.action?null:e.action())}),r.nVh(1,b,1,1,"cue-svg-icon",3),r.EFF(2),r.k0s()}if(2&f){const _=r.XpG().$implicit;r.Y8G("title",_.tooltip),r.R7$(),r.vxM(_.icon?1:-1),r.R7$(),r.SpI(" ",_.label," ")}}function O(f,M){if(1&f&&r.nVh(0,v,6,5,"cue-menu",0)(1,y,3,3,"cue-menu-item",1),2&f){const _=M.$implicit;r.vxM(null!=_.children&&_.children.length?0:1)}}let F=(()=>{class f{items=s.hFB.required();positioning=(0,s.hFB)(void 0);static \u0275fac=function(m){return new(m||f)};static \u0275cmp=r.VBU({type:f,selectors:[["cue-menu-nested"]],inputs:{items:[1,"items"],positioning:[1,"positioning"]},decls:3,vars:0,consts:[["trigger","hover",3,"positioning"],[3,"title"],["trigger","",3,"title"],["before","",3,"name"],["after","","name","paginator-next"],["menu","",3,"items","positioning"],[3,"click","title"]],template:function(m,e){1&m&&(r.j41(0,"cue-menu-wrap"),r.Z7z(1,O,2,1,null,null,E),r.k0s()),2&m&&(r.R7$(),r.Dyx(e.items()))},dependencies:[f,d.W,x.D,R.M,l.A],encapsulation:2})}return f})()},7335(T,D,c){c.d(D,{e:()=>E});var s=c(7705),l=c(5802),d=c(5547),x=c(8359),R=c(6939),h=c(63),r=c(4853);let E=(()=>{class P{_targetEl=(0,l.WQX)(d.aKT);_overlay=(0,l.WQX)(h.hJ);_overlayRef;_isOverlayHovered=!1;_subscriptions;display=(0,s.hFB)("on-hover");menuItems=s.hFB.required();menuEnabled=(0,s.hFB)(!0);onMouseEnter(){if("on-hover"===this.display()){if(!this.menuItems().length)return void this.removeOverlayMenu();this.appendOverlayMenu()}}onMouseLeave(){this._checkShouldRemoveOverlay()}appendOverlayMenu(){if(!this.menuItems().length||this._overlayRef)return;const v=this._overlay.create({positionStrategy:this._overlay.position().flexibleConnectedTo(this._targetEl).withPositions([{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:2,offsetY:0}])});this._overlayRef=v;const b=window.getComputedStyle(this._targetEl.nativeElement).color;v.overlayElement.style.color=b;const y=new R.A8(r.H),O=v.attach(y);O.instance.items=this.menuItems,this._subscriptions&&this._subscriptions.unsubscribe(),this._subscriptions=new x.yU,this._subscriptions.add(O.instance.mouseEnter.subscribe(()=>{this._isOverlayHovered=!0})),this._subscriptions.add(O.instance.mouseLeave.subscribe(()=>{this._isOverlayHovered=!1,this._checkShouldRemoveOverlay()}))}removeOverlayMenu(){this._overlayRef&&(this._subscriptions&&(this._subscriptions.unsubscribe(),this._subscriptions=void 0),this._overlayRef.detach(),this._overlayRef.dispose(),this._overlayRef=void 0)}_checkShouldRemoveOverlay(){setTimeout(()=>{this._isOverlayHovered||this.removeOverlayMenu()},300)}static \u0275fac=function(b){return new(b||P)};static \u0275dir=d.FsC({type:P,selectors:[["","cueEntityMenu",""]],hostBindings:function(b,y){1&b&&d.bIt("mouseenter",function(){return y.onMouseEnter()})("mouseleave",function(){return y.onMouseLeave()})},inputs:{display:[1,"display"],menuItems:[1,"menuItems"],menuEnabled:[1,"menuEnabled"]}})}return P})()},7573(T,D,c){c.d(D,{E:()=>s});const s={qcy:"https://dev.qaecy.com/ont#","qcy-e":"https://dev.qaecy.com/enum#","qcy-f":"https://dev.qaecy.com/functions#",obc:"https://w3id.org/obc#",dicc:"https://w3id.org/digitalconstruction/0.5/Contexts#",dicv:"https://w3id.org/digitalconstruction/0.5/Variables#",dice:"https://w3id.org/digitalconstruction/0.5/Entities#",dicp:"https://w3id.org/digitalconstruction/0.5/Processes#",dica:"https://w3id.org/digitalconstruction/0.5/Agents#",dici:"https://w3id.org/digitalconstruction/0.5/Information#",dicbm:"https://w3id.org/digitalconstruction/0.5/Materials#",dicob:"https://w3id.org/digitalconstruction/0.5/Occupancy#",dicl:"https://w3id.org/digitalconstruction/0.5/Lifecycle#",dices:"https://w3id.org/digitalconstruction/0.5/Energy#",dicu:"https://w3id.org/digitalconstruction/0.5/Units#",diclvl:"https://w3id.org/digitalconstruction/0.5/Levels#",dicstg:"https://w3id.org/digitalconstruction/0.5/Stages#"}}}]);
package/112.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[112],{3112(Ve,V,h){h.d(V,{CueDocumentViewer:()=>Te});var p=h(467),d=h(7705),g=h(2271),r=h(5802),e=h(5547),x=h(9769),M=h(5381),E=h(2245),j=h(1024),P=h(9421),S=h(4177),C=h(9352),N=h(6117),k=h(8547),D=h(3319),w=h(5971),A=h(7573);const L=(o,u)=>t=>t.isHighlight;function G(o,u){if(1&o&&(e.j41(0,"span",3),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit;e.R7$(),e.JRh(t.highlight.label)}}function $(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){r.eBV(t);const a=e.XpG(2).$implicit,l=e.XpG();return r.Njj(l.onDeleteHighlight(i,a.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function B(o,u){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){r.eBV(t);const i=e.XpG().$implicit,a=e.XpG();return r.Njj(a.onHighlightClick(i.highlight))}),e.nVh(1,G,2,1,"span",3),e.EFF(2),e.nVh(3,$,2,0,"cue-button",4),e.k0s()}if(2&o){const t=e.XpG().$implicit,n=e.XpG();e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.vxM(t.highlight.label?1:-1),e.R7$(),e.SpI(" ",t.text," "),e.R7$(),e.vxM(n.allowDelete()?3:-1)}}function O(o,u){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.JRh(t.text)}}function X(o,u){if(1&o&&e.nVh(0,B,4,4,"span",1)(1,O,2,2,"span"),2&o){const t=u.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let U=(()=>{class o{path=d.hFB.required();highlights=(0,d.hFB)([]);allowDelete=(0,d.hFB)(!1);allowAdd=(0,d.hFB)(!1);size=(0,d.hFB)("m");highlightClick=(0,d.CGW)();deleteHighlight=(0,d.CGW)();textSelected=(0,d.CGW)();segments=(0,g.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(c=>c.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const a=[...i].sort((c,f)=>c.start-f.start),l=[];let s=0;for(const c of a)c.start>s&&l.push({text:t.substring(s,c.start),isHighlight:!1,segmentStart:s}),l.push({text:t.substring(c.start,c.end),isHighlight:!0,highlight:c,segmentStart:c.start}),s=c.end;return s<t.length&&l.push({text:t.substring(s),isHighlight:!1,segmentStart:s}),l}onHighlightClick(t){const n=this.path().substring(t.start,t.end);this.highlightClick.emit({path:this.path(),highlight:t,text:n})}onDeleteHighlight(t,n){t.stopPropagation(),this.deleteHighlight.emit({path:this.path(),highlight:n})}onMouseUp(t){if(!this.allowAdd())return;const n=window.getSelection();if(!n||n.isCollapsed||!n.rangeCount||!n.toString().trim())return;const a=n.getRangeAt(0),l=t.currentTarget,s=this.getAbsoluteOffset(l,a.startContainer,a.startOffset),c=this.getAbsoluteOffset(l,a.endContainer,a.endOffset);n.removeAllRanges(),c>s&&this.textSelected.emit({path:this.path(),start:s,end:c,text:this.path().substring(s,c)})}getAbsoluteOffset(t,n,i){let a=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;a&&a!==t;){if(a instanceof HTMLElement&&a.hasAttribute("data-segment-start")){const f=parseInt(a.getAttribute("data-segment-start"),10);let m=0;const v=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);let _=v.nextNode();for(;_&&_!==n;)m+=_.textContent?.length??0,_=v.nextNode();return f+m+i}a=a.parentElement}const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let s=0,c=l.nextNode();for(;c&&c!==n;)s+=c.textContent?.length??0,c=l.nextNode();return s+i}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-file-path-viewer"]],inputs:{path:[1,"path"],highlights:[1,"highlights"],allowDelete:[1,"allowDelete"],allowAdd:[1,"allowAdd"],size:[1,"size"]},outputs:{highlightClick:"highlightClick",deleteHighlight:"deleteHighlight",textSelected:"textSelected"},decls:3,vars:7,consts:[[1,"path-content",3,"mouseup"],[1,"highlight-segment"],[1,"highlight-segment",3,"click"],[1,"highlight-label"],["size","xs","aria-label","Remove highlight",1,"delete-button"],["size","xs","aria-label","Remove highlight",1,"delete-button",3,"click"],["icon","close"]],template:function(n,i){1&n&&(e.j41(0,"div",0),e.bIt("mouseup",function(l){return i.onMouseUp(l)}),e.Z7z(1,X,2,1,null,null,e.Vm6),e.k0s()),2&n&&(e.AVh("size-s","s"===i.size())("allow-add",i.allowAdd())("has-highlights",i.segments().some(e._m7(6,L,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[x.MD,w.$,D.a],styles:["[_nghost-%COMP%]{display:contents}.path-content[_ngcontent-%COMP%]{display:block;flex:1;min-width:0;word-break:break-all;text-align:start;font-family:var(--cue-font-family);font-size:var(--cue-font-m-size);line-height:var(--cue-font-m-line-height);letter-spacing:var(--cue-font-m-letter-spacing);font-weight:var(--cue-font-weight-regular)}.path-content.size-s[_ngcontent-%COMP%]{font-size:var(--cue-font-s-size);line-height:var(--cue-font-s-line-height);letter-spacing:var(--cue-font-s-letter-spacing)}.path-content.allow-add[_ngcontent-%COMP%]{cursor:text;-webkit-user-select:text;user-select:text}.path-content.has-highlights[_ngcontent-%COMP%]{padding-top:.8rem;line-height:2.3rem}.highlight-segment[_ngcontent-%COMP%]{display:inline-block;vertical-align:text-bottom;position:relative;line-height:normal;font-weight:var(--cue-font-weight-medium);cursor:pointer;padding:0 .2rem;border-radius:3px;border:1px solid currentColor;transition:all .2s ease}.highlight-segment[_ngcontent-%COMP%] .highlight-label[_ngcontent-%COMP%]{font-family:var(--cue-font-family);position:absolute;bottom:100%;left:0;font-size:.5rem;line-height:1;opacity:.7;margin-bottom:.15rem;white-space:nowrap;pointer-events:none}.highlight-segment[_ngcontent-%COMP%] .delete-button[_ngcontent-%COMP%]{position:absolute;top:-12px;right:-12px;z-index:10;opacity:0;transition:opacity .2s ease;pointer-events:none}.highlight-segment[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,currentColor 12%,transparent)}.highlight-segment[_ngcontent-%COMP%]:hover .delete-button[_ngcontent-%COMP%]{opacity:1;pointer-events:all}"],changeDetection:0})}return o})();var H=h(5745),W=h(2444),z=h(9695),Y=h(5448),J=h(6950);const F=o=>({count:o}),Q=(o,u)=>t=>t.iri;function q(o,u){1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"components.documentInfo.infoLoadingFilePaths")))}function K(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){r.eBV(t);const a=e.XpG(4);return r.Njj(a.onMatchedPathsSelectionChange(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("rowData",t._matchTableRowData())("columnDefs",t._matchTableColDefs())("rowSelection",t._matchTableRowSelection)}}function Z(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i._matchTableExpanded.set(!i._matchTableExpanded()))}),e.nrm(2,"cue-button-icon",14),e.j41(3,"cue-button-label"),e.EFF(4),e.nI1(5,"transloco"),e.k0s()(),e.nVh(6,K,1,3,"cue-ag-grid",15),e.k0s(),e.j41(7,"cue-typography",11),e.EFF(8),e.nI1(9,"transloco"),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(2),e.Y8G("icon",t._matchTableExpanded()?"arrow-up":"arrow-dropdown"),e.R7$(2),e.JRh(e.i5U(5,4,1===t._matchCount()?"components.documentInfo.filePathMatched":"components.documentInfo.filePathsMatched",e.eq3(10,F,t._matchCount()))),e.R7$(2),e.vxM(t._matchTableExpanded()?6:-1),e.R7$(2),e.JRh(e.i5U(9,7,"components.documentInfo.applyToNPaths",e.eq3(12,F,t._selectedPaths().length)))}}function ee(o,u){if(1&o&&e.nVh(0,q,3,3,"cue-typography",11)(1,Z,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function te(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){r.eBV(t);const a=e.XpG();return r.Njj(a.onApplyToAllChange(i))}),e.k0s(),e.j41(2,"cue-typography",11),e.EFF(3),e.nI1(4,"transloco"),e.k0s()(),e.nVh(5,ee,2,1)}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("checked",t._applyToAllFiles()),e.R7$(2),e.JRh(e.bMT(4,3,"components.documentInfo.applyToAllFiles")),e.R7$(2),e.vxM(t._applyToAllFiles()?5:-1)}}function ne(o,u){if(1&o&&(e.j41(0,"cue-typography",8),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Lme("",e.bMT(2,2,"components.documentInfo.errorSavingEntityMention"),": ",t._saveError())}}let ie=(()=>{class o{selection=d.hFB.required();availableEntityCategories=(0,d.hFB)([]);fileLocations=(0,d.hFB)([]);requestFileLocations=(0,d.hFB)(void 0);requestFilePathEntityAdd=(0,d.hFB)(void 0);confirm=(0,d.CGW)();cancel=(0,d.CGW)();_selectedEntityCategory=(0,r.vPA)("");_applyToAllFiles=(0,r.vPA)(!1);_fileLocations=(0,r.vPA)(null);_fileLocationsLoading=(0,r.vPA)(!1);_matchTableExpanded=(0,r.vPA)(!1);_selectedPaths=(0,r.vPA)([]);_saving=(0,r.vPA)(!1);_saveError=(0,r.vPA)(null);_dirPrefix=(0,g.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,g.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,g.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,g.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,g.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,C.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,g.EW)(()=>[{headerName:this._filePathLabel(),field:"path",flex:1,filter:!0,sortable:!0}]);onEntityCategoryChange(t){this._selectedEntityCategory.set("string"==typeof t?t:String(t??""))}onApplyToAllChange(t){var n=this;return(0,p.A)(function*(){if(n._applyToAllFiles.set(t),n._matchTableExpanded.set(!1),!t)return n._fileLocations.set(null),void n._selectedPaths.set([]);const i=n.requestFileLocations();if(i){n._fileLocationsLoading.set(!0);try{const a=yield i();n._fileLocations.set(a);const l=n._dirPrefix();n._selectedPaths.set(a.filter(s=>s.path.startsWith(l)))}finally{n._fileLocationsLoading.set(!1)}}})()}onMatchedPathsSelectionChange(t){const n=this._fileLocations()??[];this._selectedPaths.set(t.map(i=>n.find(a=>a.path===i.path)??{iri:"",path:i.path}))}onConfirm(){var t=this;return(0,p.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,a=t._fileLocations()?.find(c=>c.path===i)??t.fileLocations().find(c=>c.path===i)??{iri:"",path:i},l=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[a],s=t.requestFilePathEntityAdd();if(s){t._saving.set(!0),t._saveError.set(null);try{yield s(n,l)}catch(c){return console.error("[EntityMentionModal] Failed to save entity mention:",c),t._saveError.set(c instanceof Error?c.message:String(c)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:l})})()}onCancel(){this.cancel.emit()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-entity-mention-modal"]],inputs:{selection:[1,"selection"],availableEntityCategories:[1,"availableEntityCategories"],fileLocations:[1,"fileLocations"],requestFileLocations:[1,"requestFileLocations"],requestFilePathEntityAdd:[1,"requestFilePathEntityAdd"]},outputs:{confirm:"confirm",cancel:"cancel"},decls:18,vars:24,consts:[[3,"close","displayCloseBtn","closeOnBackgroundClick"],[1,"modal-content"],["direction","column","gap","m"],[3,"key","val"],[3,"valueChange","value","options","labelMap","label","showFilter"],["direction","row","justify","center"],[3,"click","disabled"],["variant","secondary",3,"click","disabled"],["size","s",2,"color","var(--cue-error)"],["direction","row","gap","s","align","center"],[3,"toggleChange","checked"],["size","s"],["direction","column","gap","xs"],["variant","ghost","size","xs",3,"click"],[3,"icon"],["size","s","height","220px",3,"rowData","columnDefs","rowSelection"],["size","s","height","220px",3,"selectedRows","rowData","columnDefs","rowSelection"]],template:function(n,i){1&n&&(e.j41(0,"cue-modal",0),e.bIt("close",function(){return i.onCancel()}),e.j41(1,"div",1)(2,"cue-flexcontainer",2),e.nrm(3,"cue-key-val",3),e.nI1(4,"transloco"),e.j41(5,"cue-select",4),e.nI1(6,"transloco"),e.bIt("valueChange",function(l){return i.onEntityCategoryChange(l)}),e.k0s(),e.nVh(7,te,6,5),e.j41(8,"cue-flexcontainer",5)(9,"cue-button",6),e.bIt("click",function(){return i.onCancel()}),e.j41(10,"cue-button-label"),e.EFF(11),e.nI1(12,"transloco"),e.k0s()(),e.j41(13,"cue-button",7),e.bIt("click",function(){return i.onConfirm()}),e.j41(14,"cue-button-label"),e.EFF(15),e.nI1(16,"transloco"),e.k0s()()(),e.nVh(17,ne,3,4,"cue-typography",8),e.k0s()()()),2&n&&(e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.Y8G("key",e.bMT(4,15,"components.documentInfo.labelSelectedText"))("val",i.selection().text),e.R7$(2),e.Y8G("value",i._selectedEntityCategory())("options",i.availableEntityCategories().map(e._m7(17,Q,i)))("labelMap",i._entityCategoryLabelMap())("label",e.bMT(6,18,"components.entityInfo.labelEntityCategory"))("showFilter",i.availableEntityCategories().length>5),e.R7$(2),e.vxM(i.requestFileLocations()?7:-1),e.R7$(2),e.Y8G("disabled",i._saving()),e.R7$(2),e.JRh(e.bMT(12,20,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",!i._selectedEntityCategory()||i._saving()),e.R7$(2),e.JRh(e.bMT(16,22,"components.modals.rdfEdit.buttonSave")),e.R7$(2),e.vxM(i._saveError()?17:-1))},dependencies:[M.n,P.F,D.a,w.$,Y.L,E.Typography,H.a,W.l,z.d,J.R,C.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const oe=()=>[];function ae(o,u){if(1&o&&(e.nrm(0,"cue-key-val",6),e.nI1(1,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",e.bMT(1,2,"components.contentBlocks.documentViewer.labelSubject"))("val",t.subject())}}function le(o,u){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nVh(1,ae,2,4,"cue-key-val",6),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.subject()?1:-1)}}function se(o,u){if(1&o&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-menu",7)(2,"cue-button",8,0),e.nrm(4,"cue-button-icon",9),e.k0s(),e.nrm(5,"cue-menu-nested",10),e.k0s()()),2&o){const t=e.XpG();e.R7$(5),e.Y8G("items",t.menuItems())}}function re(o,u){if(1&o&&(e.nrm(0,"cue-key-val-editable",11),e.nI1(1,"transloco"),e.nI1(2,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",1===t.contentCategories().length?e.bMT(1,4,"components.contentBlocks.documentViewer.labelContentCategory"):e.bMT(2,6,"components.contentBlocks.documentViewer.labelContentCategories"))("val",t.contentCategoriesString())("rdfConfig",t.rdfEditConfig())("editDisabled",!t.contentCategoriesEditable())}}function ce(o,u){if(1&o&&(e.j41(0,"span",15),e.EFF(1),e.k0s()),2&o){const t=e.XpG(3);e.R7$(),e.Lme("(",t.currentFilePathIndex()+1,"/",t.fileLocations().length,")")}}function de(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i.prevFilePath())}),e.nrm(1,"cue-button-icon",20),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",0===t.currentFilePathIndex())}}function ue(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i.nextFilePath())}),e.nrm(1,"cue-button-icon",21),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",t.currentFilePathIndex()===t.fileLocations().length-1)}}function he(o,u){if(1&o){const t=e.RV6();e.j41(0,"dl",12)(1,"dt",13)(2,"cue-typography",14),e.EFF(3),e.nI1(4,"transloco"),e.nVh(5,ce,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,de,2,1,"cue-button",17),e.j41(8,"cue-file-path-viewer",18),e.bIt("textSelected",function(i){r.eBV(t);const a=e.XpG(2);return r.Njj(a.onTextSelected(i))}),e.k0s(),e.nVh(9,ue,2,1,"cue-button",17),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,8,"components.contentBlocks.documentViewer.labelFilePath")," "),e.R7$(2),e.vxM(t.fileLocations().length>1?5:-1),e.R7$(2),e.vxM(t.fileLocations().length>1?7:-1),e.R7$(),e.Y8G("path",t.fileLocations()[t.currentFilePathIndex()].path)("highlights",t.filePathEntitiesVisible()?t.filePathHighlights():e.lJ4(10,oe))("allowDelete",t.filePathEntitiesEditable())("allowAdd",t.filePathEntitiesEditable()),e.R7$(),e.vxM(t.fileLocations().length>1?9:-1)}}function ge(o,u){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nrm(1,"hr"),e.nVh(2,re,3,8,"cue-key-val-editable",11),e.nVh(3,he,10,11,"dl",12),e.k0s()),2&o){const t=e.XpG();e.R7$(2),e.vxM(t.contentCategories()&&t.contentCategories().length>0?2:-1),e.R7$(),e.vxM(t.fileLocations().length>0?3:-1)}}function fe(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){r.eBV(t);const a=e.XpG();return r.Njj(a.onEntityMentionConfirm(i))})("cancel",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.onEntityMentionCancel())}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("selection",t._pendingSelection())("availableEntityCategories",t.availableEntityCategories())("fileLocations",t.fileLocations())("requestFileLocations",t._fileLocationsProvider())("requestFilePathEntityAdd",t._requestFilePathEntityAdd())}}let me=(()=>{class o{subject=d.hFB.required();handlers=d.hFB.required();dataChanged=(0,d.CGW)();filePathEntityAdded=(0,d.CGW)();fileLocations=(0,d.hFB)([]);_fileLocationsProvider=(0,g.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,d.geq)([]);contentCategories=(0,d.hFB)([]);contentCategoriesEditable=(0,d.hFB)(!1);filePathEntitiesVisible=(0,d.hFB)(!1);filePathEntitiesEditable=(0,d.hFB)(!1);menuItems=(0,d.hFB)([]);availableContentCategories=(0,d.hFB)([]);availableEntityCategories=(0,d.hFB)([]);collapsed=(0,d.hFB)(!1);hasDocInfo=(0,g.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,r.vPA)(0);_entityCategoryModalVisible=(0,r.vPA)(!1);_pendingSelection=(0,r.vPA)(null);_requestFilePathEntityAdd=(0,g.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,p.A)(function*(a,l){const s=t._pendingSelection();s&&(yield n({paths:l,start:s.start,end:s.end,text:s.text,entityCategory:a,folderPath:s.path.substring(0,s.end)}))});return function(a,l){return i.apply(this,arguments)}}()});prevFilePath(){this.currentFilePathIndex()>0&&this.currentFilePathIndex.update(t=>t-1)}nextFilePath(){this.currentFilePathIndex()<this.fileLocations().length-1&&this.currentFilePathIndex.update(t=>t+1)}filePathHighlights=(0,g.EW)(()=>this.filePathEntities().map(t=>({path:t.path,start:t.startIndex,end:t.endIndex,label:this.availableEntityCategories().find(n=>n.iri===t.entityCategory)?.label??t.entityCategory.split("/").pop()??t.entityCategory})));entityCategoryLabelMap=(0,g.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));onTextSelected(t){this._pendingSelection.set(t),this._entityCategoryModalVisible.set(!0)}onEntityMentionConfirm(t){const n=this._pendingSelection();n&&(this.filePathEntities.update(i=>[...i,...t.paths.map(a=>({path:a.path,entityCategory:t.entityCategory,startIndex:n.start,endIndex:n.end}))]),this.filePathEntityAdded.emit({paths:t.paths,start:n.start,end:n.end,text:n.text,entityCategory:t.entityCategory,folderPath:n.path.substring(0,n.end)}),this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null))}onEntityMentionCancel(){this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null)}_contentCategories=(0,g.uu)(()=>this.contentCategories());contentCategoriesString=(0,g.EW)(()=>this._contentCategories().map(t=>this._iriToString(t)).sort().join(", "));_iriToString(t){const n=this.availableContentCategories()?.find(i=>i.iri===t);return n?n.label:t}infoChangeContentCategory=(0,C.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,g.EW)(()=>{var t=this;const n=this.handlers()?.requestRDFChange;var i;if(void 0!==n)return{message:this.infoChangeContentCategory(),existingValue:this._contentCategories(),dataType:"multiselect",options:this.availableContentCategories()?.map(i=>i.iri),optionLabelMap:this.availableContentCategories()?.reduce((i,a)=>(i[a.iri]=a.label,i),{}),requestSave:(i=(0,p.A)(function*(a){console.log(a);const l={subject:t.subject(),predicate:`${A.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:a.newValue,type:"contentCategory",comment:a.comment};yield n(l),t._contentCategories.set(a.newValue),t.dataChanged.emit({contentCategories:a.newValue})}),function(l){return i.apply(this,arguments)})};console.warn("No RDF change request handler defined")});static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-info"]],inputs:{subject:[1,"subject"],handlers:[1,"handlers"],fileLocations:[1,"fileLocations"],filePathEntities:[1,"filePathEntities"],contentCategories:[1,"contentCategories"],contentCategoriesEditable:[1,"contentCategoriesEditable"],filePathEntitiesVisible:[1,"filePathEntitiesVisible"],filePathEntitiesEditable:[1,"filePathEntitiesEditable"],menuItems:[1,"menuItems"],availableContentCategories:[1,"availableContentCategories"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged",filePathEntityAdded:"filePathEntityAdded",filePathEntities:"filePathEntitiesChange"},decls:7,vars:4,consts:[["trigger",""],["direction","column",2,"min-height","50px"],["direction","row"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],[3,"selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"],["size","l",3,"key","val"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"],["size","s",3,"key","val","rdfConfig","editDisabled"],[1,"file-path-nav-container"],[1,"file-path-label"],["size","xs"],[1,"path-counter"],[1,"file-path-row"],["variant","tertiary","size","xs",3,"disabled"],["size","s",3,"textSelected","path","highlights","allowDelete","allowAdd"],["variant","tertiary","size","xs",3,"click","disabled"],["icon","paginator-back"],["icon","paginator-next"],[3,"confirm","cancel","selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"]],template:function(n,i){1&n&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2)(2,"cue-flexcontainer",3),e.nVh(3,le,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,se,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,ge,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,fe,1,5,"cue-entity-mention-modal",5)),2&n&&(e.R7$(3),e.vxM(i.fileLocations().length>0||i.subject()?3:-1),e.R7$(),e.vxM(i.menuItems().length>0?4:-1),e.R7$(),e.vxM(!i.collapsed()&&i.hasDocInfo()?5:-1),e.R7$(),e.vxM(i._entityCategoryModalVisible()&&i._pendingSelection()?6:-1))},dependencies:[M.n,j.p,P.F,S.L,N.W,k.T,D.a,w.$,U,E.Typography,ie,C.Kj],styles:[".file-path-nav-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.file-path-label[_ngcontent-%COMP%]{display:block;margin:0}.file-path-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin:0;overflow:visible;padding:1px}.file-path-row[_ngcontent-%COMP%] cue-file-path-viewer[_ngcontent-%COMP%]{flex:1;overflow:visible;min-width:0}.path-counter[_ngcontent-%COMP%]{opacity:.6}"],changeDetection:0})}return o})();class pe{requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var _e=h(2065),ve=h(5187);const be=["viewerHost"];function Ce(o,u){if(1&o&&e.nrm(0,"cue-document-info",4),2&o){const t=e.XpG(2);e.Y8G("subject",t._docSubject())("handlers",t._docInfoHandlers)("menuItems",t._menuItems())}}function ye(o,u){1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),e.EFF(2,"Loading\u2026"),e.k0s()())}function xe(o,u){if(1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography",7),e.EFF(2),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(2),e.JRh(t.errorMessage())}}function Me(o,u){if(1&o&&(e.j41(0,"div",3),e.nVh(1,Ce,1,3,"cue-document-info",4),e.nVh(2,ye,3,0,"cue-flexcontainer",5)(3,xe,3,1,"cue-flexcontainer",5),e.j41(4,"div",6),e.eu8(5,null,1),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.showDocumentInfo()&&"ready"===t.state()?1:-1),e.R7$(),e.vxM("loading"===t.state()?2:"error"===t.state()?3:-1)}}function Ee(o,u){1&o&&e.eu8(0)}function De(o,u){if(1&o&&(e.j41(0,"cue-card",2),e.DNE(1,Ee,1,0,"ng-container",8),e.k0s()),2&o){const t=e.XpG(),n=e.sdS(1);e.Y8G("variant",t._cardVariant())("padded",!0),e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function we(o,u){1&o&&e.eu8(0)}function Pe(o,u){if(1&o&&e.DNE(0,we,1,0,"ng-container",8),2&o){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}const Fe=[".fragments",".dxf",".pdf",".png",".jpg",".jpeg",".svg",".gif",".webp",".bmp",".avif",".apng",".xlsx",".xls",".csv",".json",".jsonld",".xml",".css",".js",".html",".htm",".sh",".txt",".rst",".md"];function I(o){const[u,t]=o.split("?"),n=u.trim();let i=null;if(t){const l=new URLSearchParams(t).get("page");if(null!==l){const s=parseInt(l,10);!isNaN(s)&&s>0&&(i=s)}}return{uuid:n,page:i}}let Te=(()=>{class o{set _viewerHostRef(t){if(this._viewerHost=t,t&&this._lastRenderArgs){const{url:n,suffix:i,page:a,viewerTypeOverride:l}=this._lastRenderArgs;this._renderViewer(n,i,a,l)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,d.hFB)(void 0);uuid=(0,d.hFB)(void 0);projectId=(0,d.hFB)(void 0);showDocumentInfo=(0,d.hFB)(!0);extraMenuItems=(0,d.hFB)([]);portalBaseURL=(0,d.hFB)("https://cue.qaecy.com");variant=(0,d.hFB)("none");_cardVariant=(0,g.EW)(()=>this.variant());state=(0,r.vPA)("idle");errorMessage=(0,r.vPA)(null);resolvedUrl=(0,r.vPA)(null);resolvedSuffix=(0,r.vPA)(null);_docSubject=(0,r.vPA)("");_alternatives=(0,r.vPA)([]);_originalUuid=(0,r.vPA)(null);_originalDocSuffix=(0,r.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_docInfoHandlers=new pe;_menuItems=(0,g.EW)(()=>{const t=[],n=this._originalUuid(),i=this._originalDocSuffix();n&&i&&t.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const a=this.uuid(),l=this.projectId();if(a&&l){const{uuid:c}=I(a),f=this.portalBaseURL().replace(/\/$/,"");t.push({icon:"external-link",label:"Open in Cue",action:()=>window.open(`${f}/r/${l}/${c}`,"_blank","noopener,noreferrer")})}const s=this._alternatives();if(s.length>1){const c=this.resolvedSuffix();t.push({icon:"document",label:"Alternative representation",children:s.map(f=>({label:f.original?`Original (${f.suffix.replace(".","").toUpperCase()})`:f.suffix.replace(".","").toUpperCase(),tooltip:c===f.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(f)}))})}return t.push(...this.extraMenuItems()),t});constructor(){(0,r.QZP)(()=>{const t=this.cue(),n=this.uuid(),i=this.projectId();t&&n&&i?this._load(t,n,i):this.state.set("idle")})}_load(t,n,i){var a=this;return(0,p.A)(function*(){if(t&&n&&i){a.state.set("loading"),a.resolvedUrl.set(null),a.resolvedSuffix.set(null),a.errorMessage.set(null),a._docSubject.set(""),a._originalUuid.set(null),a._originalDocSuffix.set(null),a._alternatives.set([]),a._viewerHost?.clear(),a.currentViewerRef?.destroy(),a.currentViewerRef=void 0,a._lastRenderArgs=void 0;try{a._cueSnapshot=t,a._projectIdSnapshot=i;const{uuid:l,page:s}=I(n),c=t.createProjectDocuments(i),m=(yield c.fetchDocumentData([l]))[l];if(!m)throw new Error(`Document '${l}' not found in project '${i}'.`);a._docSubject.set(m.subject??""),a._originalUuid.set(l),a._originalDocSuffix.set(m.suffix);const v=yield c.fetchAlternativeRepresentations(l);a._alternatives.set([{uuid:l,suffix:m.suffix,original:!0},...v.filter(b=>b.id!==l).map(b=>({uuid:b.id,suffix:b.suffix,original:!1,remoteRelativePath:b.remoteRelativePath}))]);const{uuid:_,suffix:y,remoteRelativePath:T}=function Ie(o,u){const t=[o,...u];let n,i=1/0;for(const a of t){const l=Fe.indexOf(a.suffix);-1!==l&&l<i&&(i=l,n=a)}return n?{uuid:n.id,suffix:n.suffix,remoteRelativePath:n.remoteRelativePath}:{uuid:o.id,suffix:o.suffix}}(m,v),R=T?yield t.storage.getAltRepDownloadUrl(T):yield t.storage.getDownloadUrl(i,_,y);a.resolvedUrl.set(R),a.resolvedSuffix.set(y);const Re=[".eml",".msg",".emlx",".mbx"].includes(m.suffix)&&".json"===y?"email":void 0;yield a._renderViewer(R,y,s,Re),a.state.set("ready")}catch(l){const s=l instanceof Error?l.message:String(l);console.error("[CueDocumentViewerWC] Failed to load document:",s),a.errorMessage.set(s),a.state.set("error")}}else a.state.set("idle")})()}_renderViewer(t,n,i,a){var l=this;return(0,p.A)(function*(){try{const{DocumentViewer:s}=yield Promise.all([h.e(418),h.e(76),h.e(741)]).then(h.bind(h,1741)),{DocumentViewerSettings:c}=yield h.e(418).then(h.bind(h,3418));l._viewerHost?.clear(),l.currentViewerRef?.destroy();const f=new c;if(null!==i&&(f.pdf.page=String(i)),!l._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");l._lastRenderArgs={url:t,suffix:n,page:i,viewerTypeOverride:a},l.currentViewerRef=l._viewerHost.createComponent(s),l.currentViewerRef.setInput("url",t),l.currentViewerRef.setInput("suffix",n),l.currentViewerRef.setInput("settings",f),a&&l.currentViewerRef.setInput("viewerTypeOverride",a)}catch(s){throw new Error(`Failed to load viewer component: ${s instanceof Error?s.message:String(s)}`)}})()}_switchToAlternative(t){var n=this;return(0,p.A)(function*(){const i=n._cueSnapshot,a=n._projectIdSnapshot;if(i&&a)try{const l=t.remoteRelativePath?yield i.storage.getAltRepDownloadUrl(t.remoteRelativePath):yield i.storage.getDownloadUrl(a,t.uuid,t.suffix);n.resolvedUrl.set(l),n.resolvedSuffix.set(t.suffix),yield n._renderViewer(l,t.suffix,null)}catch(l){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",l)}})()}_downloadOriginal(){var t=this;return(0,p.A)(function*(){const n=t._cueSnapshot,i=t._projectIdSnapshot,a=t._originalUuid(),l=t._originalDocSuffix();if(n&&i&&a&&l)try{const s=yield n.storage.getDownloadUrl(i,a,l),f=yield(yield fetch(s)).blob();(0,_e.KE)(f,`${a}${l}`)}catch(s){console.error("[CueDocumentViewerWC] Failed to download original:",s)}})()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-viewer-wc"]],viewQuery:function(n,i){if(1&n&&e.GBs(be,5,e.c1b),2&n){let a;e.mGM(a=e.lsd())&&(i._viewerHostRef=a.first)}},inputs:{cue:[1,"cue"],uuid:[1,"uuid"],projectId:[1,"projectId"],showDocumentInfo:[1,"showDocumentInfo"],extraMenuItems:[1,"extraMenuItems"],portalBaseURL:[1,"portalBaseURL"],variant:[1,"variant"]},decls:4,vars:1,consts:[["body",""],["viewerHost",""],[2,"height","100%","width","100%",3,"variant","padded"],[2,"display","flex","flex-direction","column","height","100%","width","100%"],[3,"subject","handlers","menuItems"],["direction","column","align","center","justify","center",2,"flex","1","width","100%"],[2,"flex","1","min-height","0","overflow","hidden"],[2,"color","#c44","font-size","13px"],[4,"ngTemplateOutlet"]],template:function(n,i){1&n&&(e.DNE(0,Me,7,2,"ng-template",null,0,e.C5r),e.nVh(2,De,2,3,"cue-card",2)(3,Pe,1,1,"ng-container")),2&n&&(e.R7$(2),e.vxM("none"!==i.variant()?2:3))},dependencies:[x.MD,x.T3,M.n,E.Typography,me,ve.Z],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return o})()}}]);
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[112],{3112(Ve,V,h){h.d(V,{CueDocumentViewer:()=>Te});var p=h(467),d=h(7705),g=h(2271),r=h(5802),e=h(5547),x=h(9769),M=h(5381),E=h(2245),j=h(1024),P=h(9421),S=h(5903),C=h(9352),N=h(6117),k=h(8547),D=h(3319),w=h(5971),A=h(7573);const L=(o,u)=>t=>t.isHighlight;function G(o,u){if(1&o&&(e.j41(0,"span",3),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit;e.R7$(),e.JRh(t.highlight.label)}}function $(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){r.eBV(t);const a=e.XpG(2).$implicit,l=e.XpG();return r.Njj(l.onDeleteHighlight(i,a.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function B(o,u){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){r.eBV(t);const i=e.XpG().$implicit,a=e.XpG();return r.Njj(a.onHighlightClick(i.highlight))}),e.nVh(1,G,2,1,"span",3),e.EFF(2),e.nVh(3,$,2,0,"cue-button",4),e.k0s()}if(2&o){const t=e.XpG().$implicit,n=e.XpG();e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.vxM(t.highlight.label?1:-1),e.R7$(),e.SpI(" ",t.text," "),e.R7$(),e.vxM(n.allowDelete()?3:-1)}}function O(o,u){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.JRh(t.text)}}function X(o,u){if(1&o&&e.nVh(0,B,4,4,"span",1)(1,O,2,2,"span"),2&o){const t=u.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let U=(()=>{class o{path=d.hFB.required();highlights=(0,d.hFB)([]);allowDelete=(0,d.hFB)(!1);allowAdd=(0,d.hFB)(!1);size=(0,d.hFB)("m");highlightClick=(0,d.CGW)();deleteHighlight=(0,d.CGW)();textSelected=(0,d.CGW)();segments=(0,g.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(c=>c.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const a=[...i].sort((c,f)=>c.start-f.start),l=[];let s=0;for(const c of a)c.start>s&&l.push({text:t.substring(s,c.start),isHighlight:!1,segmentStart:s}),l.push({text:t.substring(c.start,c.end),isHighlight:!0,highlight:c,segmentStart:c.start}),s=c.end;return s<t.length&&l.push({text:t.substring(s),isHighlight:!1,segmentStart:s}),l}onHighlightClick(t){const n=this.path().substring(t.start,t.end);this.highlightClick.emit({path:this.path(),highlight:t,text:n})}onDeleteHighlight(t,n){t.stopPropagation(),this.deleteHighlight.emit({path:this.path(),highlight:n})}onMouseUp(t){if(!this.allowAdd())return;const n=window.getSelection();if(!n||n.isCollapsed||!n.rangeCount||!n.toString().trim())return;const a=n.getRangeAt(0),l=t.currentTarget,s=this.getAbsoluteOffset(l,a.startContainer,a.startOffset),c=this.getAbsoluteOffset(l,a.endContainer,a.endOffset);n.removeAllRanges(),c>s&&this.textSelected.emit({path:this.path(),start:s,end:c,text:this.path().substring(s,c)})}getAbsoluteOffset(t,n,i){let a=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;a&&a!==t;){if(a instanceof HTMLElement&&a.hasAttribute("data-segment-start")){const f=parseInt(a.getAttribute("data-segment-start"),10);let m=0;const v=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);let _=v.nextNode();for(;_&&_!==n;)m+=_.textContent?.length??0,_=v.nextNode();return f+m+i}a=a.parentElement}const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let s=0,c=l.nextNode();for(;c&&c!==n;)s+=c.textContent?.length??0,c=l.nextNode();return s+i}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-file-path-viewer"]],inputs:{path:[1,"path"],highlights:[1,"highlights"],allowDelete:[1,"allowDelete"],allowAdd:[1,"allowAdd"],size:[1,"size"]},outputs:{highlightClick:"highlightClick",deleteHighlight:"deleteHighlight",textSelected:"textSelected"},decls:3,vars:7,consts:[[1,"path-content",3,"mouseup"],[1,"highlight-segment"],[1,"highlight-segment",3,"click"],[1,"highlight-label"],["size","xs","aria-label","Remove highlight",1,"delete-button"],["size","xs","aria-label","Remove highlight",1,"delete-button",3,"click"],["icon","close"]],template:function(n,i){1&n&&(e.j41(0,"div",0),e.bIt("mouseup",function(l){return i.onMouseUp(l)}),e.Z7z(1,X,2,1,null,null,e.Vm6),e.k0s()),2&n&&(e.AVh("size-s","s"===i.size())("allow-add",i.allowAdd())("has-highlights",i.segments().some(e._m7(6,L,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[x.MD,w.$,D.a],styles:["[_nghost-%COMP%]{display:contents}.path-content[_ngcontent-%COMP%]{display:block;flex:1;min-width:0;word-break:break-all;text-align:start;font-family:var(--cue-font-family);font-size:var(--cue-font-m-size);line-height:var(--cue-font-m-line-height);letter-spacing:var(--cue-font-m-letter-spacing);font-weight:var(--cue-font-weight-regular)}.path-content.size-s[_ngcontent-%COMP%]{font-size:var(--cue-font-s-size);line-height:var(--cue-font-s-line-height);letter-spacing:var(--cue-font-s-letter-spacing)}.path-content.allow-add[_ngcontent-%COMP%]{cursor:text;-webkit-user-select:text;user-select:text}.path-content.has-highlights[_ngcontent-%COMP%]{padding-top:.8rem;line-height:2.3rem}.highlight-segment[_ngcontent-%COMP%]{display:inline-block;vertical-align:text-bottom;position:relative;line-height:normal;font-weight:var(--cue-font-weight-medium);cursor:pointer;padding:0 .2rem;border-radius:3px;border:1px solid currentColor;transition:all .2s ease}.highlight-segment[_ngcontent-%COMP%] .highlight-label[_ngcontent-%COMP%]{font-family:var(--cue-font-family);position:absolute;bottom:100%;left:0;font-size:.5rem;line-height:1;opacity:.7;margin-bottom:.15rem;white-space:nowrap;pointer-events:none}.highlight-segment[_ngcontent-%COMP%] .delete-button[_ngcontent-%COMP%]{position:absolute;top:-12px;right:-12px;z-index:10;opacity:0;transition:opacity .2s ease;pointer-events:none}.highlight-segment[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,currentColor 12%,transparent)}.highlight-segment[_ngcontent-%COMP%]:hover .delete-button[_ngcontent-%COMP%]{opacity:1;pointer-events:all}"],changeDetection:0})}return o})();var H=h(5745),W=h(2444),z=h(9695),Y=h(5448),J=h(6950);const F=o=>({count:o}),Q=(o,u)=>t=>t.iri;function q(o,u){1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"components.documentInfo.infoLoadingFilePaths")))}function K(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){r.eBV(t);const a=e.XpG(4);return r.Njj(a.onMatchedPathsSelectionChange(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("rowData",t._matchTableRowData())("columnDefs",t._matchTableColDefs())("rowSelection",t._matchTableRowSelection)}}function Z(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i._matchTableExpanded.set(!i._matchTableExpanded()))}),e.nrm(2,"cue-button-icon",14),e.j41(3,"cue-button-label"),e.EFF(4),e.nI1(5,"transloco"),e.k0s()(),e.nVh(6,K,1,3,"cue-ag-grid",15),e.k0s(),e.j41(7,"cue-typography",11),e.EFF(8),e.nI1(9,"transloco"),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(2),e.Y8G("icon",t._matchTableExpanded()?"arrow-up":"arrow-dropdown"),e.R7$(2),e.JRh(e.i5U(5,4,1===t._matchCount()?"components.documentInfo.filePathMatched":"components.documentInfo.filePathsMatched",e.eq3(10,F,t._matchCount()))),e.R7$(2),e.vxM(t._matchTableExpanded()?6:-1),e.R7$(2),e.JRh(e.i5U(9,7,"components.documentInfo.applyToNPaths",e.eq3(12,F,t._selectedPaths().length)))}}function ee(o,u){if(1&o&&e.nVh(0,q,3,3,"cue-typography",11)(1,Z,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function te(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){r.eBV(t);const a=e.XpG();return r.Njj(a.onApplyToAllChange(i))}),e.k0s(),e.j41(2,"cue-typography",11),e.EFF(3),e.nI1(4,"transloco"),e.k0s()(),e.nVh(5,ee,2,1)}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("checked",t._applyToAllFiles()),e.R7$(2),e.JRh(e.bMT(4,3,"components.documentInfo.applyToAllFiles")),e.R7$(2),e.vxM(t._applyToAllFiles()?5:-1)}}function ne(o,u){if(1&o&&(e.j41(0,"cue-typography",8),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Lme("",e.bMT(2,2,"components.documentInfo.errorSavingEntityMention"),": ",t._saveError())}}let ie=(()=>{class o{selection=d.hFB.required();availableEntityCategories=(0,d.hFB)([]);fileLocations=(0,d.hFB)([]);requestFileLocations=(0,d.hFB)(void 0);requestFilePathEntityAdd=(0,d.hFB)(void 0);confirm=(0,d.CGW)();cancel=(0,d.CGW)();_selectedEntityCategory=(0,r.vPA)("");_applyToAllFiles=(0,r.vPA)(!1);_fileLocations=(0,r.vPA)(null);_fileLocationsLoading=(0,r.vPA)(!1);_matchTableExpanded=(0,r.vPA)(!1);_selectedPaths=(0,r.vPA)([]);_saving=(0,r.vPA)(!1);_saveError=(0,r.vPA)(null);_dirPrefix=(0,g.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,g.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,g.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,g.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,g.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,C.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,g.EW)(()=>[{headerName:this._filePathLabel(),field:"path",flex:1,filter:!0,sortable:!0}]);onEntityCategoryChange(t){this._selectedEntityCategory.set("string"==typeof t?t:String(t??""))}onApplyToAllChange(t){var n=this;return(0,p.A)(function*(){if(n._applyToAllFiles.set(t),n._matchTableExpanded.set(!1),!t)return n._fileLocations.set(null),void n._selectedPaths.set([]);const i=n.requestFileLocations();if(i){n._fileLocationsLoading.set(!0);try{const a=yield i();n._fileLocations.set(a);const l=n._dirPrefix();n._selectedPaths.set(a.filter(s=>s.path.startsWith(l)))}finally{n._fileLocationsLoading.set(!1)}}})()}onMatchedPathsSelectionChange(t){const n=this._fileLocations()??[];this._selectedPaths.set(t.map(i=>n.find(a=>a.path===i.path)??{iri:"",path:i.path}))}onConfirm(){var t=this;return(0,p.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,a=t._fileLocations()?.find(c=>c.path===i)??t.fileLocations().find(c=>c.path===i)??{iri:"",path:i},l=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[a],s=t.requestFilePathEntityAdd();if(s){t._saving.set(!0),t._saveError.set(null);try{yield s(n,l)}catch(c){return console.error("[EntityMentionModal] Failed to save entity mention:",c),t._saveError.set(c instanceof Error?c.message:String(c)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:l})})()}onCancel(){this.cancel.emit()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-entity-mention-modal"]],inputs:{selection:[1,"selection"],availableEntityCategories:[1,"availableEntityCategories"],fileLocations:[1,"fileLocations"],requestFileLocations:[1,"requestFileLocations"],requestFilePathEntityAdd:[1,"requestFilePathEntityAdd"]},outputs:{confirm:"confirm",cancel:"cancel"},decls:18,vars:24,consts:[[3,"close","displayCloseBtn","closeOnBackgroundClick"],[1,"modal-content"],["direction","column","gap","m"],[3,"key","val"],[3,"valueChange","value","options","labelMap","label","showFilter"],["direction","row","justify","center"],[3,"click","disabled"],["variant","secondary",3,"click","disabled"],["size","s",2,"color","var(--cue-error)"],["direction","row","gap","s","align","center"],[3,"toggleChange","checked"],["size","s"],["direction","column","gap","xs"],["variant","ghost","size","xs",3,"click"],[3,"icon"],["size","s","height","220px",3,"rowData","columnDefs","rowSelection"],["size","s","height","220px",3,"selectedRows","rowData","columnDefs","rowSelection"]],template:function(n,i){1&n&&(e.j41(0,"cue-modal",0),e.bIt("close",function(){return i.onCancel()}),e.j41(1,"div",1)(2,"cue-flexcontainer",2),e.nrm(3,"cue-key-val",3),e.nI1(4,"transloco"),e.j41(5,"cue-select",4),e.nI1(6,"transloco"),e.bIt("valueChange",function(l){return i.onEntityCategoryChange(l)}),e.k0s(),e.nVh(7,te,6,5),e.j41(8,"cue-flexcontainer",5)(9,"cue-button",6),e.bIt("click",function(){return i.onCancel()}),e.j41(10,"cue-button-label"),e.EFF(11),e.nI1(12,"transloco"),e.k0s()(),e.j41(13,"cue-button",7),e.bIt("click",function(){return i.onConfirm()}),e.j41(14,"cue-button-label"),e.EFF(15),e.nI1(16,"transloco"),e.k0s()()(),e.nVh(17,ne,3,4,"cue-typography",8),e.k0s()()()),2&n&&(e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.Y8G("key",e.bMT(4,15,"components.documentInfo.labelSelectedText"))("val",i.selection().text),e.R7$(2),e.Y8G("value",i._selectedEntityCategory())("options",i.availableEntityCategories().map(e._m7(17,Q,i)))("labelMap",i._entityCategoryLabelMap())("label",e.bMT(6,18,"components.entityInfo.labelEntityCategory"))("showFilter",i.availableEntityCategories().length>5),e.R7$(2),e.vxM(i.requestFileLocations()?7:-1),e.R7$(2),e.Y8G("disabled",i._saving()),e.R7$(2),e.JRh(e.bMT(12,20,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",!i._selectedEntityCategory()||i._saving()),e.R7$(2),e.JRh(e.bMT(16,22,"components.modals.rdfEdit.buttonSave")),e.R7$(2),e.vxM(i._saveError()?17:-1))},dependencies:[M.n,P.F,D.a,w.$,Y.L,E.Typography,H.a,W.l,z.d,J.R,C.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const oe=()=>[];function ae(o,u){if(1&o&&(e.nrm(0,"cue-key-val",6),e.nI1(1,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",e.bMT(1,2,"components.contentBlocks.documentViewer.labelSubject"))("val",t.subject())}}function le(o,u){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nVh(1,ae,2,4,"cue-key-val",6),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.subject()?1:-1)}}function se(o,u){if(1&o&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-menu",7)(2,"cue-button",8,0),e.nrm(4,"cue-button-icon",9),e.k0s(),e.nrm(5,"cue-menu-nested",10),e.k0s()()),2&o){const t=e.XpG();e.R7$(5),e.Y8G("items",t.menuItems())}}function re(o,u){if(1&o&&(e.nrm(0,"cue-key-val-editable",11),e.nI1(1,"transloco"),e.nI1(2,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",1===t.contentCategories().length?e.bMT(1,4,"components.contentBlocks.documentViewer.labelContentCategory"):e.bMT(2,6,"components.contentBlocks.documentViewer.labelContentCategories"))("val",t.contentCategoriesString())("rdfConfig",t.rdfEditConfig())("editDisabled",!t.contentCategoriesEditable())}}function ce(o,u){if(1&o&&(e.j41(0,"span",15),e.EFF(1),e.k0s()),2&o){const t=e.XpG(3);e.R7$(),e.Lme("(",t.currentFilePathIndex()+1,"/",t.fileLocations().length,")")}}function de(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i.prevFilePath())}),e.nrm(1,"cue-button-icon",20),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",0===t.currentFilePathIndex())}}function ue(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){r.eBV(t);const i=e.XpG(3);return r.Njj(i.nextFilePath())}),e.nrm(1,"cue-button-icon",21),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",t.currentFilePathIndex()===t.fileLocations().length-1)}}function he(o,u){if(1&o){const t=e.RV6();e.j41(0,"dl",12)(1,"dt",13)(2,"cue-typography",14),e.EFF(3),e.nI1(4,"transloco"),e.nVh(5,ce,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,de,2,1,"cue-button",17),e.j41(8,"cue-file-path-viewer",18),e.bIt("textSelected",function(i){r.eBV(t);const a=e.XpG(2);return r.Njj(a.onTextSelected(i))}),e.k0s(),e.nVh(9,ue,2,1,"cue-button",17),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,8,"components.contentBlocks.documentViewer.labelFilePath")," "),e.R7$(2),e.vxM(t.fileLocations().length>1?5:-1),e.R7$(2),e.vxM(t.fileLocations().length>1?7:-1),e.R7$(),e.Y8G("path",t.fileLocations()[t.currentFilePathIndex()].path)("highlights",t.filePathEntitiesVisible()?t.filePathHighlights():e.lJ4(10,oe))("allowDelete",t.filePathEntitiesEditable())("allowAdd",t.filePathEntitiesEditable()),e.R7$(),e.vxM(t.fileLocations().length>1?9:-1)}}function ge(o,u){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nrm(1,"hr"),e.nVh(2,re,3,8,"cue-key-val-editable",11),e.nVh(3,he,10,11,"dl",12),e.k0s()),2&o){const t=e.XpG();e.R7$(2),e.vxM(t.contentCategories()&&t.contentCategories().length>0?2:-1),e.R7$(),e.vxM(t.fileLocations().length>0?3:-1)}}function fe(o,u){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){r.eBV(t);const a=e.XpG();return r.Njj(a.onEntityMentionConfirm(i))})("cancel",function(){r.eBV(t);const i=e.XpG();return r.Njj(i.onEntityMentionCancel())}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("selection",t._pendingSelection())("availableEntityCategories",t.availableEntityCategories())("fileLocations",t.fileLocations())("requestFileLocations",t._fileLocationsProvider())("requestFilePathEntityAdd",t._requestFilePathEntityAdd())}}let me=(()=>{class o{subject=d.hFB.required();handlers=d.hFB.required();dataChanged=(0,d.CGW)();filePathEntityAdded=(0,d.CGW)();fileLocations=(0,d.hFB)([]);_fileLocationsProvider=(0,g.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,d.geq)([]);contentCategories=(0,d.hFB)([]);contentCategoriesEditable=(0,d.hFB)(!1);filePathEntitiesVisible=(0,d.hFB)(!1);filePathEntitiesEditable=(0,d.hFB)(!1);menuItems=(0,d.hFB)([]);availableContentCategories=(0,d.hFB)([]);availableEntityCategories=(0,d.hFB)([]);collapsed=(0,d.hFB)(!1);hasDocInfo=(0,g.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,r.vPA)(0);_entityCategoryModalVisible=(0,r.vPA)(!1);_pendingSelection=(0,r.vPA)(null);_requestFilePathEntityAdd=(0,g.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,p.A)(function*(a,l){const s=t._pendingSelection();s&&(yield n({paths:l,start:s.start,end:s.end,text:s.text,entityCategory:a,folderPath:s.path.substring(0,s.end)}))});return function(a,l){return i.apply(this,arguments)}}()});prevFilePath(){this.currentFilePathIndex()>0&&this.currentFilePathIndex.update(t=>t-1)}nextFilePath(){this.currentFilePathIndex()<this.fileLocations().length-1&&this.currentFilePathIndex.update(t=>t+1)}filePathHighlights=(0,g.EW)(()=>this.filePathEntities().map(t=>({path:t.path,start:t.startIndex,end:t.endIndex,label:this.availableEntityCategories().find(n=>n.iri===t.entityCategory)?.label??t.entityCategory.split("/").pop()??t.entityCategory})));entityCategoryLabelMap=(0,g.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));onTextSelected(t){this._pendingSelection.set(t),this._entityCategoryModalVisible.set(!0)}onEntityMentionConfirm(t){const n=this._pendingSelection();n&&(this.filePathEntities.update(i=>[...i,...t.paths.map(a=>({path:a.path,entityCategory:t.entityCategory,startIndex:n.start,endIndex:n.end}))]),this.filePathEntityAdded.emit({paths:t.paths,start:n.start,end:n.end,text:n.text,entityCategory:t.entityCategory,folderPath:n.path.substring(0,n.end)}),this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null))}onEntityMentionCancel(){this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null)}_contentCategories=(0,g.uu)(()=>this.contentCategories());contentCategoriesString=(0,g.EW)(()=>this._contentCategories().map(t=>this._iriToString(t)).sort().join(", "));_iriToString(t){const n=this.availableContentCategories()?.find(i=>i.iri===t);return n?n.label:t}infoChangeContentCategory=(0,C.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,g.EW)(()=>{var t=this;const n=this.handlers()?.requestRDFChange;var i;if(void 0!==n)return{message:this.infoChangeContentCategory(),existingValue:this._contentCategories(),dataType:"multiselect",options:this.availableContentCategories()?.map(i=>i.iri),optionLabelMap:this.availableContentCategories()?.reduce((i,a)=>(i[a.iri]=a.label,i),{}),requestSave:(i=(0,p.A)(function*(a){console.log(a);const l={subject:t.subject(),predicate:`${A.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:a.newValue,type:"contentCategory",comment:a.comment};yield n(l),t._contentCategories.set(a.newValue),t.dataChanged.emit({contentCategories:a.newValue})}),function(l){return i.apply(this,arguments)})};console.warn("No RDF change request handler defined")});static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-info"]],inputs:{subject:[1,"subject"],handlers:[1,"handlers"],fileLocations:[1,"fileLocations"],filePathEntities:[1,"filePathEntities"],contentCategories:[1,"contentCategories"],contentCategoriesEditable:[1,"contentCategoriesEditable"],filePathEntitiesVisible:[1,"filePathEntitiesVisible"],filePathEntitiesEditable:[1,"filePathEntitiesEditable"],menuItems:[1,"menuItems"],availableContentCategories:[1,"availableContentCategories"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged",filePathEntityAdded:"filePathEntityAdded",filePathEntities:"filePathEntitiesChange"},decls:7,vars:4,consts:[["trigger",""],["direction","column",2,"min-height","50px"],["direction","row"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],[3,"selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"],["size","l",3,"key","val"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"],["size","s",3,"key","val","rdfConfig","editDisabled"],[1,"file-path-nav-container"],[1,"file-path-label"],["size","xs"],[1,"path-counter"],[1,"file-path-row"],["variant","tertiary","size","xs",3,"disabled"],["size","s",3,"textSelected","path","highlights","allowDelete","allowAdd"],["variant","tertiary","size","xs",3,"click","disabled"],["icon","paginator-back"],["icon","paginator-next"],[3,"confirm","cancel","selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"]],template:function(n,i){1&n&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2)(2,"cue-flexcontainer",3),e.nVh(3,le,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,se,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,ge,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,fe,1,5,"cue-entity-mention-modal",5)),2&n&&(e.R7$(3),e.vxM(i.fileLocations().length>0||i.subject()?3:-1),e.R7$(),e.vxM(i.menuItems().length>0?4:-1),e.R7$(),e.vxM(!i.collapsed()&&i.hasDocInfo()?5:-1),e.R7$(),e.vxM(i._entityCategoryModalVisible()&&i._pendingSelection()?6:-1))},dependencies:[M.n,j.p,P.F,S.L,N.W,k.T,D.a,w.$,U,E.Typography,ie,C.Kj],styles:[".file-path-nav-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.file-path-label[_ngcontent-%COMP%]{display:block;margin:0}.file-path-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin:0;overflow:visible;padding:1px}.file-path-row[_ngcontent-%COMP%] cue-file-path-viewer[_ngcontent-%COMP%]{flex:1;overflow:visible;min-width:0}.path-counter[_ngcontent-%COMP%]{opacity:.6}"],changeDetection:0})}return o})();class pe{requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var _e=h(2065),ve=h(5187);const be=["viewerHost"];function Ce(o,u){if(1&o&&e.nrm(0,"cue-document-info",4),2&o){const t=e.XpG(2);e.Y8G("subject",t._docSubject())("handlers",t._docInfoHandlers)("menuItems",t._menuItems())}}function ye(o,u){1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),e.EFF(2,"Loading\u2026"),e.k0s()())}function xe(o,u){if(1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography",7),e.EFF(2),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(2),e.JRh(t.errorMessage())}}function Me(o,u){if(1&o&&(e.j41(0,"div",3),e.nVh(1,Ce,1,3,"cue-document-info",4),e.nVh(2,ye,3,0,"cue-flexcontainer",5)(3,xe,3,1,"cue-flexcontainer",5),e.j41(4,"div",6),e.eu8(5,null,1),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.showDocumentInfo()&&"ready"===t.state()?1:-1),e.R7$(),e.vxM("loading"===t.state()?2:"error"===t.state()?3:-1)}}function Ee(o,u){1&o&&e.eu8(0)}function De(o,u){if(1&o&&(e.j41(0,"cue-card",2),e.DNE(1,Ee,1,0,"ng-container",8),e.k0s()),2&o){const t=e.XpG(),n=e.sdS(1);e.Y8G("variant",t._cardVariant())("padded",!0),e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function we(o,u){1&o&&e.eu8(0)}function Pe(o,u){if(1&o&&e.DNE(0,we,1,0,"ng-container",8),2&o){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}const Fe=[".fragments",".dxf",".pdf",".png",".jpg",".jpeg",".svg",".gif",".webp",".bmp",".avif",".apng",".xlsx",".xls",".csv",".json",".jsonld",".xml",".css",".js",".html",".htm",".sh",".txt",".rst",".md"];function I(o){const[u,t]=o.split("?"),n=u.trim();let i=null;if(t){const l=new URLSearchParams(t).get("page");if(null!==l){const s=parseInt(l,10);!isNaN(s)&&s>0&&(i=s)}}return{uuid:n,page:i}}let Te=(()=>{class o{set _viewerHostRef(t){if(this._viewerHost=t,t&&this._lastRenderArgs){const{url:n,suffix:i,page:a,viewerTypeOverride:l}=this._lastRenderArgs;this._renderViewer(n,i,a,l)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,d.hFB)(void 0);uuid=(0,d.hFB)(void 0);projectId=(0,d.hFB)(void 0);showDocumentInfo=(0,d.hFB)(!0);extraMenuItems=(0,d.hFB)([]);portalBaseURL=(0,d.hFB)("https://cue.qaecy.com");variant=(0,d.hFB)("none");_cardVariant=(0,g.EW)(()=>this.variant());state=(0,r.vPA)("idle");errorMessage=(0,r.vPA)(null);resolvedUrl=(0,r.vPA)(null);resolvedSuffix=(0,r.vPA)(null);_docSubject=(0,r.vPA)("");_alternatives=(0,r.vPA)([]);_originalUuid=(0,r.vPA)(null);_originalDocSuffix=(0,r.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_docInfoHandlers=new pe;_menuItems=(0,g.EW)(()=>{const t=[],n=this._originalUuid(),i=this._originalDocSuffix();n&&i&&t.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const a=this.uuid(),l=this.projectId();if(a&&l){const{uuid:c}=I(a),f=this.portalBaseURL().replace(/\/$/,"");t.push({icon:"external-link",label:"Open in Cue",action:()=>window.open(`${f}/r/${l}/${c}`,"_blank","noopener,noreferrer")})}const s=this._alternatives();if(s.length>1){const c=this.resolvedSuffix();t.push({icon:"document",label:"Alternative representation",children:s.map(f=>({label:f.original?`Original (${f.suffix.replace(".","").toUpperCase()})`:f.suffix.replace(".","").toUpperCase(),tooltip:c===f.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(f)}))})}return t.push(...this.extraMenuItems()),t});constructor(){(0,r.QZP)(()=>{const t=this.cue(),n=this.uuid(),i=this.projectId();t&&n&&i?this._load(t,n,i):this.state.set("idle")})}_load(t,n,i){var a=this;return(0,p.A)(function*(){if(t&&n&&i){a.state.set("loading"),a.resolvedUrl.set(null),a.resolvedSuffix.set(null),a.errorMessage.set(null),a._docSubject.set(""),a._originalUuid.set(null),a._originalDocSuffix.set(null),a._alternatives.set([]),a._viewerHost?.clear(),a.currentViewerRef?.destroy(),a.currentViewerRef=void 0,a._lastRenderArgs=void 0;try{a._cueSnapshot=t,a._projectIdSnapshot=i;const{uuid:l,page:s}=I(n),c=t.createProjectDocuments(i),m=(yield c.fetchDocumentData([l]))[l];if(!m)throw new Error(`Document '${l}' not found in project '${i}'.`);a._docSubject.set(m.subject??""),a._originalUuid.set(l),a._originalDocSuffix.set(m.suffix);const v=yield c.fetchAlternativeRepresentations(l);a._alternatives.set([{uuid:l,suffix:m.suffix,original:!0},...v.filter(b=>b.id!==l).map(b=>({uuid:b.id,suffix:b.suffix,original:!1,remoteRelativePath:b.remoteRelativePath}))]);const{uuid:_,suffix:y,remoteRelativePath:T}=function Ie(o,u){const t=[o,...u];let n,i=1/0;for(const a of t){const l=Fe.indexOf(a.suffix);-1!==l&&l<i&&(i=l,n=a)}return n?{uuid:n.id,suffix:n.suffix,remoteRelativePath:n.remoteRelativePath}:{uuid:o.id,suffix:o.suffix}}(m,v),R=T?yield t.storage.getAltRepDownloadUrl(T):yield t.storage.getDownloadUrl(i,_,y);a.resolvedUrl.set(R),a.resolvedSuffix.set(y);const Re=[".eml",".msg",".emlx",".mbx"].includes(m.suffix)&&".json"===y?"email":void 0;yield a._renderViewer(R,y,s,Re),a.state.set("ready")}catch(l){const s=l instanceof Error?l.message:String(l);console.error("[CueDocumentViewerWC] Failed to load document:",s),a.errorMessage.set(s),a.state.set("error")}}else a.state.set("idle")})()}_renderViewer(t,n,i,a){var l=this;return(0,p.A)(function*(){try{const{DocumentViewer:s}=yield Promise.all([h.e(418),h.e(76),h.e(741)]).then(h.bind(h,1741)),{DocumentViewerSettings:c}=yield h.e(418).then(h.bind(h,3418));l._viewerHost?.clear(),l.currentViewerRef?.destroy();const f=new c;if(null!==i&&(f.pdf.page=String(i)),!l._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");l._lastRenderArgs={url:t,suffix:n,page:i,viewerTypeOverride:a},l.currentViewerRef=l._viewerHost.createComponent(s),l.currentViewerRef.setInput("url",t),l.currentViewerRef.setInput("suffix",n),l.currentViewerRef.setInput("settings",f),a&&l.currentViewerRef.setInput("viewerTypeOverride",a)}catch(s){throw new Error(`Failed to load viewer component: ${s instanceof Error?s.message:String(s)}`)}})()}_switchToAlternative(t){var n=this;return(0,p.A)(function*(){const i=n._cueSnapshot,a=n._projectIdSnapshot;if(i&&a)try{const l=t.remoteRelativePath?yield i.storage.getAltRepDownloadUrl(t.remoteRelativePath):yield i.storage.getDownloadUrl(a,t.uuid,t.suffix);n.resolvedUrl.set(l),n.resolvedSuffix.set(t.suffix),yield n._renderViewer(l,t.suffix,null)}catch(l){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",l)}})()}_downloadOriginal(){var t=this;return(0,p.A)(function*(){const n=t._cueSnapshot,i=t._projectIdSnapshot,a=t._originalUuid(),l=t._originalDocSuffix();if(n&&i&&a&&l)try{const s=yield n.storage.getDownloadUrl(i,a,l),f=yield(yield fetch(s)).blob();(0,_e.KE)(f,`${a}${l}`)}catch(s){console.error("[CueDocumentViewerWC] Failed to download original:",s)}})()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-viewer-wc"]],viewQuery:function(n,i){if(1&n&&e.GBs(be,5,e.c1b),2&n){let a;e.mGM(a=e.lsd())&&(i._viewerHostRef=a.first)}},inputs:{cue:[1,"cue"],uuid:[1,"uuid"],projectId:[1,"projectId"],showDocumentInfo:[1,"showDocumentInfo"],extraMenuItems:[1,"extraMenuItems"],portalBaseURL:[1,"portalBaseURL"],variant:[1,"variant"]},decls:4,vars:1,consts:[["body",""],["viewerHost",""],[2,"height","100%","width","100%",3,"variant","padded"],[2,"display","flex","flex-direction","column","height","100%","width","100%"],[3,"subject","handlers","menuItems"],["direction","column","align","center","justify","center",2,"flex","1","width","100%"],[2,"flex","1","min-height","0","overflow","hidden"],[2,"color","#c44","font-size","13px"],[4,"ngTemplateOutlet"]],template:function(n,i){1&n&&(e.DNE(0,Me,7,2,"ng-template",null,0,e.C5r),e.nVh(2,De,2,3,"cue-card",2)(3,Pe,1,1,"ng-container")),2&n&&(e.R7$(2),e.vxM("none"!==i.variant()?2:3))},dependencies:[x.MD,x.T3,M.n,E.Typography,me,ve.Z],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return o})()}}]);
package/149.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[149],{3319(ie,$,h){h.d($,{a:()=>V});var k=h(7705),p=h(29),b=h(5547);let V=(()=>{class P{icon=(0,k.hFB)(void 0);slot=(0,k.hFB)("before");static \u0275fac=function(A){return new(A||P)};static \u0275cmp=b.VBU({type:P,selectors:[["cue-button-icon"]],inputs:{icon:[1,"icon"],slot:[1,"slot"]},decls:1,vars:2,consts:[[3,"slot","name"]],template:function(A,U){1&A&&b.nrm(0,"cue-svg-icon",0),2&A&&b.Y8G("slot",U.slot())("name",U.icon())},dependencies:[p.A],encapsulation:2})}return P})()},5971(ie,$,h){h.d($,{$:()=>U});var k=h(9769),p=h(7705),b=h(2271),V=h(7089),P=h(2403),S=h(5547);const O=["buttonElement"],A=["*"];let U=(()=>{class m{variant=(0,p.hFB)("primary");size=(0,p.hFB)("m");tooltip=(0,p.hFB)("");disabled=(0,p.hFB)(!1);selected=(0,p.geq)(!1);toggleButton=(0,p.hFB)(!1);loading=(0,p.hFB)(!1);fitParentWidth=(0,p.hFB)(!1);noWrap=(0,p.hFB)(!0);buttonElement=p.ebz.required("buttonElement");getStyles=(0,b.EW)(()=>[`\n padding: 0 var(--cue-button-${this.size()}-padding-x);\n\n --focus-color: var(--cue-button-${this.variant()}-focus-color);\n --cue-button-border-color: var(--cue-button-${this.variant()}-border-color);\n color: var(--cue-button-${this.variant()}-foreground);\n --background-color: var(--cue-button-${this.variant()}-background);\n\n --cue-icon-width: var(--cue-button-${this.size()}-icon-width);\n --button-height: var(--cue-button-${this.size()}-height);\n --cue-button-border-radius: var(--cue-button-border-radius, 9999px);\n --button-label-padding-x: var(--cue-button-${this.size()}-label-padding-x);\n `,this.disabled()?`\n color: var(--cue-button-${this.variant()}-disabled-foreground);\n --cue-button-border-color: var(--cue-button-${this.variant()}-disabled-border-color);\n --background-color: var(--cue-button-${this.variant()}-disabled-background);\n `:""].join(""));handleClick(i){i.detail>0&&this.buttonElement().nativeElement.blur(),this.toggleButton()&&(i.stopPropagation(),this.selected.set(!this.selected()))}static \u0275fac=function(w){return new(w||m)};static \u0275cmp=S.VBU({type:m,selectors:[["cue-button"]],viewQuery:function(w,v){1&w&&S.wEZ(v.buttonElement,O,5),2&w&&S.NyB()},inputs:{variant:[1,"variant"],size:[1,"size"],tooltip:[1,"tooltip"],disabled:[1,"disabled"],selected:[1,"selected"],toggleButton:[1,"toggleButton"],loading:[1,"loading"],fitParentWidth:[1,"fitParentWidth"],noWrap:[1,"noWrap"]},outputs:{selected:"selectedChange"},ngContentSelectors:A,decls:3,vars:18,consts:[["buttonElement",""],["tooltipSize","small",3,"click","disabled","cueTooltip","tooltipPlacement","cuePulse"]],template:function(w,v){1&w&&(S.NAR(),S.j41(0,"button",1,0),S.bIt("click",function(K){return v.handleClick(K)}),S.SdG(2),S.k0s()),2&w&&(S.Aen(v.getStyles()),S.xc7("white-space",v.noWrap()?"nowrap":"normal")("flex-basis",v.noWrap()?null:"auto")("min-width",v.noWrap()?null:"fit-content"),S.AVh("selected",v.selected())("ghost","ghost"===v.variant())("fit-parent-width",v.fitParentWidth()),S.Y8G("disabled",v.disabled())("cueTooltip",v.tooltip())("tooltipPlacement","top")("cuePulse",v.loading()))},dependencies:[k.MD,V.d,P.V],styles:['[_nghost-%COMP%]:has(.fit-parent-width){display:contents}@keyframes _ngcontent-%COMP%_pulse-border{0%{box-shadow:0 0 0 0 var(--focus-color)}50%{box-shadow:0 0 0 8px transparent}to{box-shadow:0 0 0 0 transparent}}button[_ngcontent-%COMP%]{min-width:0;pulse-border-radius:var(--cue-button-border-radius);appearance:none;padding:0;font:inherit;border:var(--cue-button-border-width) var(--cue-button-border-style) var(--cue-button-border-color);display:flex;justify-content:space-between;align-items:center;gap:var(--cue-button-gap);min-height:var(--button-height);height:auto;background-color:var(--background-color);border-radius:var(--cue-button-border-radius, 9999px);margin:3px;position:relative}button[style*="white-space: normal"][_ngcontent-%COMP%]{border-radius:30px!important;padding:10px!important}button.fit-parent-width[_ngcontent-%COMP%]{width:100%;min-width:0}button[_ngcontent-%COMP%]:not(.fit-parent-width){min-width:fit-content;width:auto}button[_ngcontent-%COMP%]:focus{outline:none}button[_ngcontent-%COMP%]:hover:not(:disabled), button[_ngcontent-%COMP%]:focus-within:not(:disabled){outline:1px solid var(--focus-color);outline-offset:2px;cursor:pointer}button.selected[_ngcontent-%COMP%]{outline:1px solid currentColor!important;outline-offset:2px;margin:3px}button.ghost[_ngcontent-%COMP%]:not(.selected){border:none}']})}return m})()},2403(ie,$,h){h.d($,{V:()=>V});var k=h(7705),p=h(5802),b=h(5547);let V=(()=>{class P{el=(0,p.WQX)(b.aKT);renderer=(0,p.WQX)(b.sFG);cuePulse=(0,k.hFB)(!1);cuePulseColor=(0,k.hFB)("");cuePulseMode=(0,k.hFB)("border");activeClass="";constructor(){this.ensureGlobalStyles()}onPulseChanged=(0,p.QZP)(()=>{const O=this.cuePulse(),A=this.cuePulseColor(),U=this.cuePulseMode(),m=this.el.nativeElement;if(this.activeClass&&(this.renderer.removeClass(m,this.activeClass),this.activeClass=""),this.renderer.removeStyle(m,"--cue-pulse-color"),this.renderer.removeStyle(m,"border-radius"),O){const d="text"===U?"cue-pulse-text":"cue-pulse-border";this.renderer.addClass(m,d),this.activeClass=d,A&&this.renderer.setStyle(m,"--cue-pulse-color",A),"border"===U&&setTimeout(()=>{const i=m.firstElementChild;if(i){const w=getComputedStyle(i).borderRadius;w&&"0px"!==w&&this.renderer.setStyle(m,"border-radius",w)}})}});ngOnDestroy(){const O=this.el.nativeElement;this.activeClass&&this.renderer.removeClass(O,this.activeClass),this.renderer.removeStyle(O,"border-radius")}ensureGlobalStyles(){const O="cue-pulse-global-styles";if(document.getElementById(O))return;const A=document.createElement("style");A.id=O,A.textContent="\n @keyframes cue-pulse-border-anim {\n 0% {\n box-shadow: 0 0 0 0 var(--cue-pulse-color, currentColor);\n }\n 70% {\n box-shadow: 0 0 0 8px transparent;\n }\n 100% {\n box-shadow: 0 0 0 0 transparent;\n }\n }\n\n @keyframes cue-pulse-text-anim {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n }\n\n .cue-pulse-border {\n animation: cue-pulse-border-anim 1.5s infinite ease-in-out;\n }\n\n .cue-pulse-text {\n animation: cue-pulse-text-anim 1.5s infinite ease-in-out;\n }\n ",document.head.appendChild(A)}static \u0275fac=function(A){return new(A||P)};static \u0275dir=b.FsC({type:P,selectors:[["","cuePulse",""]],inputs:{cuePulse:[1,"cuePulse"],cuePulseColor:[1,"cuePulseColor"],cuePulseMode:[1,"cuePulseMode"]}})}return P})()},9769(ie,$,h){h.d($,{B3:()=>Ne,MD:()=>en,T3:()=>Le});var m=h(7705),d=h(5802),i=h(5547);h(2271);let Ne=(()=>{class e{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(t,n,r){this._ngEl=t,this._differs=n,this._renderer=r}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,n){const[r,s]=t.split("."),o=-1===r.indexOf("-")?void 0:i.czy.DashCase;null!=n?this._renderer.setStyle(this._ngEl.nativeElement,r,s?`${n}${s}`:n,o):this._renderer.removeStyle(this._ngEl.nativeElement,r,o)}_applyChanges(t){t.forEachRemovedItem(n=>this._setStyle(n.key,null)),t.forEachAddedItem(n=>this._setStyle(n.key,n.currentValue)),t.forEachChangedItem(n=>this._setStyle(n.key,n.currentValue))}static \u0275fac=function(n){return new(n||e)(i.rXU(i.aKT),i.rXU(m.MKu),i.rXU(i.sFG))};static \u0275dir=i.FsC({type:e,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return e})(),Le=(()=>{class e{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=(0,d.WQX)(d.zZn);constructor(t){this._viewContainerRef=t}ngOnChanges(t){if(this._shouldRecreateView(t)){const n=this._viewContainerRef;if(this._viewRef&&n.remove(n.indexOf(this._viewRef)),!this.ngTemplateOutlet)return void(this._viewRef=null);const r=this._createContextForwardProxy();this._viewRef=n.createEmbeddedView(this.ngTemplateOutlet,r,{injector:this._getInjector()})}}_getInjector(){return"outlet"===this.ngTemplateOutletInjector?this.injector:this.ngTemplateOutletInjector??void 0}_shouldRecreateView(t){return!!t.ngTemplateOutlet||!!t.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(t,n,r)=>!!this.ngTemplateOutletContext&&Reflect.set(this.ngTemplateOutletContext,n,r),get:(t,n,r)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,n,r)}})}static \u0275fac=function(n){return new(n||e)(i.rXU(i.c1b))};static \u0275dir=i.FsC({type:e,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[i.OA$]})}return e})(),en=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=i.$C({type:e});static \u0275inj=d.G2t({})}return e})()}}]);
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[149],{3319(ie,$,h){h.d($,{a:()=>V});var k=h(7705),p=h(29),b=h(5547);let V=(()=>{class P{icon=(0,k.hFB)(void 0);slot=(0,k.hFB)("before");static \u0275fac=function(A){return new(A||P)};static \u0275cmp=b.VBU({type:P,selectors:[["cue-button-icon"]],inputs:{icon:[1,"icon"],slot:[1,"slot"]},decls:1,vars:2,consts:[[3,"slot","name"]],template:function(A,U){1&A&&b.nrm(0,"cue-svg-icon",0),2&A&&b.Y8G("slot",U.slot())("name",U.icon())},dependencies:[p.A],encapsulation:2})}return P})()},5971(ie,$,h){h.d($,{$:()=>U});var k=h(9769),p=h(7705),b=h(2271),V=h(7089),P=h(2403),S=h(5547);const O=["buttonElement"],A=["*"];let U=(()=>{class _{variant=(0,p.hFB)("primary");size=(0,p.hFB)("m");tooltip=(0,p.hFB)("");disabled=(0,p.hFB)(!1);selected=(0,p.geq)(!1);toggleButton=(0,p.hFB)(!1);loading=(0,p.hFB)(!1);fitParentWidth=(0,p.hFB)(!1);noWrap=(0,p.hFB)(!0);buttonElement=p.ebz.required("buttonElement");getStyles=(0,b.EW)(()=>[`\n padding: 0 var(--cue-button-${this.size()}-padding-x);\n\n --focus-color: var(--cue-button-${this.variant()}-focus-color);\n --cue-button-border-color: var(--cue-button-${this.variant()}-border-color);\n color: var(--cue-button-${this.variant()}-foreground);\n --background-color: var(--cue-button-${this.variant()}-background);\n\n --cue-icon-width: var(--cue-button-${this.size()}-icon-width);\n --button-height: var(--cue-button-${this.size()}-height);\n --cue-button-border-radius: var(--cue-button-border-radius, 9999px);\n --button-label-padding-x: var(--cue-button-${this.size()}-label-padding-x);\n `,this.disabled()?`\n color: var(--cue-button-${this.variant()}-disabled-foreground);\n --cue-button-border-color: var(--cue-button-${this.variant()}-disabled-border-color);\n --background-color: var(--cue-button-${this.variant()}-disabled-background);\n `:""].join(""));handleClick(i){i.detail>0&&this.buttonElement().nativeElement.blur(),this.toggleButton()&&(i.stopPropagation(),this.selected.set(!this.selected()))}static \u0275fac=function(w){return new(w||_)};static \u0275cmp=S.VBU({type:_,selectors:[["cue-button"]],viewQuery:function(w,v){1&w&&S.wEZ(v.buttonElement,O,5),2&w&&S.NyB()},inputs:{variant:[1,"variant"],size:[1,"size"],tooltip:[1,"tooltip"],disabled:[1,"disabled"],selected:[1,"selected"],toggleButton:[1,"toggleButton"],loading:[1,"loading"],fitParentWidth:[1,"fitParentWidth"],noWrap:[1,"noWrap"]},outputs:{selected:"selectedChange"},ngContentSelectors:A,decls:3,vars:18,consts:[["buttonElement",""],["tooltipSize","small",3,"click","disabled","cueTooltip","tooltipPlacement","cuePulse"]],template:function(w,v){1&w&&(S.NAR(),S.j41(0,"button",1,0),S.bIt("click",function(K){return v.handleClick(K)}),S.SdG(2),S.k0s()),2&w&&(S.Aen(v.getStyles()),S.xc7("white-space",v.noWrap()?"nowrap":"normal")("flex-basis",v.noWrap()?null:"auto")("min-width",v.noWrap()?null:"fit-content"),S.AVh("selected",v.selected())("ghost","ghost"===v.variant())("fit-parent-width",v.fitParentWidth()),S.Y8G("disabled",v.disabled())("cueTooltip",v.tooltip())("tooltipPlacement","top")("cuePulse",v.loading()))},dependencies:[k.MD,V.d,P.V],styles:['[_nghost-%COMP%]:has(.fit-parent-width){display:contents}@keyframes _ngcontent-%COMP%_pulse-border{0%{box-shadow:0 0 0 0 var(--focus-color)}50%{box-shadow:0 0 0 8px transparent}to{box-shadow:0 0 0 0 transparent}}button[_ngcontent-%COMP%]{min-width:0;pulse-border-radius:var(--cue-button-border-radius);appearance:none;padding:0;font:inherit;border:var(--cue-button-border-width) var(--cue-button-border-style) var(--cue-button-border-color);display:flex;justify-content:space-between;align-items:center;gap:var(--cue-button-gap);min-height:var(--button-height);height:auto;background-color:var(--background-color);border-radius:var(--cue-button-border-radius, 9999px);margin:3px;position:relative}button[style*="white-space: normal"][_ngcontent-%COMP%]{border-radius:30px!important;padding:10px!important}button.fit-parent-width[_ngcontent-%COMP%]{width:100%;min-width:0;margin-inline:0}button[_ngcontent-%COMP%]:not(.fit-parent-width){min-width:fit-content;width:auto}button[_ngcontent-%COMP%]:focus{outline:none}button[_ngcontent-%COMP%]:hover:not(:disabled), button[_ngcontent-%COMP%]:focus-within:not(:disabled){outline:1px solid var(--focus-color);outline-offset:2px;cursor:pointer}button.selected[_ngcontent-%COMP%]{outline:1px solid currentColor!important;outline-offset:2px;margin:3px}button.ghost[_ngcontent-%COMP%]:not(.selected){border:none}']})}return _})()},2403(ie,$,h){h.d($,{V:()=>V});var k=h(7705),p=h(5802),b=h(5547);let V=(()=>{class P{el=(0,p.WQX)(b.aKT);renderer=(0,p.WQX)(b.sFG);cuePulse=(0,k.hFB)(!1);cuePulseColor=(0,k.hFB)("");cuePulseMode=(0,k.hFB)("border");activeClass="";constructor(){this.ensureGlobalStyles()}onPulseChanged=(0,p.QZP)(()=>{const O=this.cuePulse(),A=this.cuePulseColor(),U=this.cuePulseMode(),_=this.el.nativeElement;if(this.activeClass&&(this.renderer.removeClass(_,this.activeClass),this.activeClass=""),this.renderer.removeStyle(_,"--cue-pulse-color"),this.renderer.removeStyle(_,"border-radius"),O){const d="text"===U?"cue-pulse-text":"cue-pulse-border";this.renderer.addClass(_,d),this.activeClass=d,A&&this.renderer.setStyle(_,"--cue-pulse-color",A),"border"===U&&setTimeout(()=>{const i=_.firstElementChild;if(i){const w=getComputedStyle(i).borderRadius;w&&"0px"!==w&&this.renderer.setStyle(_,"border-radius",w)}})}});ngOnDestroy(){const O=this.el.nativeElement;this.activeClass&&this.renderer.removeClass(O,this.activeClass),this.renderer.removeStyle(O,"border-radius")}ensureGlobalStyles(){const O="cue-pulse-global-styles";if(document.getElementById(O))return;const A=document.createElement("style");A.id=O,A.textContent="\n @keyframes cue-pulse-border-anim {\n 0% {\n box-shadow: 0 0 0 0 var(--cue-pulse-color, currentColor);\n }\n 70% {\n box-shadow: 0 0 0 8px transparent;\n }\n 100% {\n box-shadow: 0 0 0 0 transparent;\n }\n }\n\n @keyframes cue-pulse-text-anim {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n }\n\n .cue-pulse-border {\n animation: cue-pulse-border-anim 1.5s infinite ease-in-out;\n }\n\n .cue-pulse-text {\n animation: cue-pulse-text-anim 1.5s infinite ease-in-out;\n }\n ",document.head.appendChild(A)}static \u0275fac=function(A){return new(A||P)};static \u0275dir=b.FsC({type:P,selectors:[["","cuePulse",""]],inputs:{cuePulse:[1,"cuePulse"],cuePulseColor:[1,"cuePulseColor"],cuePulseMode:[1,"cuePulseMode"]}})}return P})()},9769(ie,$,h){h.d($,{B3:()=>Ne,MD:()=>en,T3:()=>Le});var _=h(7705),d=h(5802),i=h(5547);h(2271);let Ne=(()=>{class e{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(t,n,r){this._ngEl=t,this._differs=n,this._renderer=r}set ngStyle(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())}ngDoCheck(){if(this._differ){const t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}}_setStyle(t,n){const[r,s]=t.split("."),o=-1===r.indexOf("-")?void 0:i.czy.DashCase;null!=n?this._renderer.setStyle(this._ngEl.nativeElement,r,s?`${n}${s}`:n,o):this._renderer.removeStyle(this._ngEl.nativeElement,r,o)}_applyChanges(t){t.forEachRemovedItem(n=>this._setStyle(n.key,null)),t.forEachAddedItem(n=>this._setStyle(n.key,n.currentValue)),t.forEachChangedItem(n=>this._setStyle(n.key,n.currentValue))}static \u0275fac=function(n){return new(n||e)(i.rXU(i.aKT),i.rXU(_.MKu),i.rXU(i.sFG))};static \u0275dir=i.FsC({type:e,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return e})(),Le=(()=>{class e{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=(0,d.WQX)(d.zZn);constructor(t){this._viewContainerRef=t}ngOnChanges(t){if(this._shouldRecreateView(t)){const n=this._viewContainerRef;if(this._viewRef&&n.remove(n.indexOf(this._viewRef)),!this.ngTemplateOutlet)return void(this._viewRef=null);const r=this._createContextForwardProxy();this._viewRef=n.createEmbeddedView(this.ngTemplateOutlet,r,{injector:this._getInjector()})}}_getInjector(){return"outlet"===this.ngTemplateOutletInjector?this.injector:this.ngTemplateOutletInjector??void 0}_shouldRecreateView(t){return!!t.ngTemplateOutlet||!!t.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(t,n,r)=>!!this.ngTemplateOutletContext&&Reflect.set(this.ngTemplateOutletContext,n,r),get:(t,n,r)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,n,r)}})}static \u0275fac=function(n){return new(n||e)(i.rXU(i.c1b))};static \u0275dir=i.FsC({type:e,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[i.OA$]})}return e})(),en=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=i.$C({type:e});static \u0275inj=d.G2t({})}return e})()}}]);