@qaecy/cue-ui 0.0.51 → 0.0.52
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/1520.js +1 -0
- package/2399.js +1 -1
- package/5500.js +1 -0
- package/5559.js +1 -1
- package/5649.js +1 -0
- package/5738.js +1 -0
- package/640.js +1 -0
- package/6947.js +1 -0
- package/7441.js +1 -0
- package/804.js +1 -0
- package/README.md +48 -0
- package/common.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/3910.js +0 -1
- package/4031.js +0 -1
- package/5041.js +0 -1
- package/7427.js +0 -1
- package/8791.js +0 -1
- package/906.js +0 -1
package/1520.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[1520],{5448(I,C,r){r.d(C,{L:()=>w});var _=r(7705),i=r(2245),a=r(5547);const f=["*"];let w=(()=>{class g{fontSize=(0,_.hFB)("m");italic=(0,_.hFB)(!1);noWrap=(0,_.hFB)(!0);static \u0275fac=function(p){return new(p||g)};static \u0275cmp=a.VBU({type:g,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:f,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function(p,D){1&p&&(a.NAR(),a.j41(0,"div")(1,"cue-typography",0),a.SdG(2),a.k0s()()),2&p&&(a.R7$(),a.Y8G("size",D.fontSize())("italic",D.italic())("noWrap",D.noWrap()))},dependencies:[i.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return g})()},8791(I,C,r){r.d(C,{CueDocumentList:()=>R});var _=r(467),i=r(7705),a=r(5802),f=r(2271),w=r(4879),g=r(2065),y=r(4372),M=r(5381),p=r(2245),D=r(7851),E=r(7293),o=r(5547);function P(c,O){if(1&c&&(o.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),o.EFF(2),o.k0s()()),2&c){const e=o.XpG();o.R7$(2),o.SpI(" ",e.errorMessage()," ")}}function L(c,O){if(1&c&&o.nrm(0,"cue-logo-link",4),2&c){const e=o.XpG(2);o.Y8G("projectId",e.projectId())}}function B(c,O){if(1&c){const e=o.RV6();o.j41(0,"div",1)(1,"cue-doc-list",3),o.bIt("clickedDocument",function(s){a.eBV(e);const n=o.XpG();return a.Njj(n.clickedDocument.emit(s))})("clickedDownloadDocument",function(s){a.eBV(e);const n=o.XpG();return a.Njj(n.clickedDownloadDocument.emit(s))})("clickedOpenInDir",function(s){a.eBV(e);const n=o.XpG();return a.Njj(n.clickedOpenInDir.emit(s))})("clickedOpen",function(s){a.eBV(e);const n=o.XpG();return a.Njj(n.clickedOpen.emit(s))}),o.k0s(),o.nVh(2,L,1,1,"cue-logo-link",4),o.k0s()}if(2&c){const e=o.XpG();o.Y8G("cueLogoLoader","loading"===e.state()),o.R7$(),o.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e.handlers())("availableContentCategories",e.availableContentCategories())("detailedView",e.detailedView())("simple",e.simple())("pageSize",e.pageSize())("size",e.size())("prefetchPages",e.prefetchPages())("showOpenInDocumentViewerAction",e.showOpenInDocumentViewerAction())("showOpenInFileManagerAction",e.showOpenInFileManagerAction())("customOverlayActions",e.customOverlayActions())("variant",e.variant()),o.R7$(),o.vxM(e.showLogo()?2:-1)}}function b(c){return c.split("?")[0].trim()}let R=(()=>{class c{projectId=(0,i.hFB)(void 0);uuids=(0,i.hFB)([]);suffixes=(0,i.hFB)(void 0);mimeTypes=(0,i.hFB)(void 0);contentCategories=(0,i.hFB)(void 0);sdkState=(0,i.hFB)(void 0);detailedView=(0,i.hFB)(!1,{transform:i.L39});simple=(0,i.hFB)(!1,{transform:i.L39});pageSize=(0,i.hFB)(10,{transform:i.Udg});size=(0,i.hFB)("m");prefetchPages=(0,i.hFB)(3,{transform:i.Udg});showOpenInDocumentViewerAction=(0,i.hFB)(!1,{transform:i.L39});showOpenInFileManagerAction=(0,i.hFB)(!1,{transform:i.L39});customMenuItems=(0,i.hFB)([]);showLogo=(0,i.hFB)(!1,{transform:i.L39});variant=(0,i.hFB)("none");clickedDocument=(0,i.CGW)();clickedDownloadDocument=(0,i.CGW)();clickedOpenInDir=(0,i.CGW)();clickedOpen=(0,i.CGW)();state=(0,a.vPA)("idle");errorMessage=(0,a.vPA)(null);documentData=(0,a.vPA)({});availableContentCategories=(0,a.vPA)(void 0);_filterResolvedUuids=(0,a.vPA)(void 0);documentRefs=(0,f.EW)(()=>{const e=new Set;return(void 0!==this._filterResolvedUuids()?this._filterResolvedUuids()??[]:this.uuids()??[]).map(b).filter(s=>!!s).filter(s=>!e.has(s)&&(e.add(s),!0)).map(s=>({id:s}))});customOverlayActions=(0,f.EW)(()=>{const e=this.projectId();return[...e?[{label:"Open in Cue",icon:"external-link",action:n=>{const u=n.rowData;window.open(`https://cue.qaecy.com/r/${encodeURIComponent(e)}/${encodeURIComponent(u.id)}`,"_blank","noopener,noreferrer")}}]:[],...(this.customMenuItems()||[]).map(n=>({label:n.label,icon:n.icon,action:u=>{n.action(u.rowData,u)}}))]});handlers=(0,f.EW)(()=>{var e=this;const t=this._docs();if(t)return{requestData:(s=(0,_.A)(function*(n){const u=n.map(b).filter(l=>!!l),d=u.filter(l=>!e.documentData()[l]);if(console.debug("[CueDocumentListWC] requestData",{requestedCount:u.length,missingCount:d.length,missing:d}),d.length)try{const l=t,m=e.simple()&&l.fetchDocumentDataSimple?yield l.fetchDocumentDataSimple(d):yield t.fetchDocumentData(d);console.debug("[CueDocumentListWC] fetchDocumentData resolved",{fetchedCount:Object.keys(m).length,ids:Object.keys(m)});const v={};Object.values(m).forEach(h=>{v[h.id]=function A(c){return{id:c.id,path:c.path,suffix:c.suffix,size:c.size,contentIRI:c.contentIRI,providerId:c.providerId,tags:c.tags??[],summary:c.summary??"",categories:c.categories??[],subject:c.subject,relevance:0}}(h)}),Object.keys(v).length>0&&e.documentData.update(h=>({...h,...v}))}catch(l){console.error("[CueDocumentListWC] Failed to fetch document data:",l),e.errorMessage.set(l instanceof Error?l.message:String(l)),e.state.set("error")}}),function(u){return s.apply(this,arguments)}),requestDownload:function(){var s=(0,_.A)(function*(n){const u=e._cue(),d=e.projectId();if(u&&d)try{const l=yield u.storage.getDownloadUrl(d,n.id,n.suffix,"raw"),m=yield fetch(l);if(!m.ok)throw new Error(`Download failed: ${m.status} ${m.statusText}`);const v=yield m.blob(),h=(0,y.M)(n.path)||`${n.id}${n.suffix||""}`;(0,g.KE)(v,h)}catch(l){console.error("[CueDocumentListWC] Failed to download document:",l)}});return function(u){return s.apply(this,arguments)}}(),requestOpen:(s,n)=>{console.log("[CueDocumentListWC] requestOpen",{documentUUID:s,document:n})},requestOpenInDir:(s,n)=>{console.log("[CueDocumentListWC] requestOpenInDir",{documentUUID:s,document:n})}};var s});_cue=(0,a.vPA)(void 0);_docs=(0,a.vPA)(void 0);_ownedView;_inputWarningTimer;_unsubscribeCategories;_lastSetupSignature;constructor(){this._inputWarningTimer=setTimeout(()=>{this.projectId()||console.warn('[cue-document-list] Required input "projectId" is not set. Pass the Cue project ID to load documents.'),this.sdkState()||console.warn('[cue-document-list] Required input "sdkState" is not set. Pass a { cue, view, or documents } object to enable document loading.')},3e3),(0,a.QZP)(()=>{const e=this.projectId(),t=this.sdkState(),s=t?.language??"en";if(console.debug("[CueDocumentListWC] input state changed",{projectId:e,uuids:this.uuids().length,hasSdkState:!!t,hasCue:!!t?.cue,hasView:!!t?.view,hasDocuments:!!t?.documents}),!e||!t)return this._clearRuntimeState(),void this.state.set("idle");const n={projectId:e,cue:t.cue,view:t.view,documents:t.documents,language:s,simple:this.simple()};if(this._isSameSetupSignature(n))return this.state.set("ready"),void this.errorMessage.set(null);this._setupFromSdkState(e,t),this._lastSetupSignature=n,this.state.set("ready"),this.errorMessage.set(null)}),(0,a.QZP)(()=>{const e=this.suffixes(),t=this.mimeTypes(),s=this.contentCategories(),n=this._docs();void 0!==e||void 0!==t||void 0!==s?this._fetchByFilter(e,t,s,n):this._filterResolvedUuids.set(void 0)}),(0,a.QZP)(()=>{const e=new Set(this.documentRefs().map(t=>t.id));this.documentData.update(t=>Object.fromEntries(Object.entries(t).filter(([n])=>e.has(n))))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0}_setupFromSdkState(e,t){const s=t.language??"en";if(this.documentData.set({}),this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this.availableContentCategories.set(t.availableContentCategories?t.availableContentCategories:void 0),t.documents)return t.documents.setLanguage(s),this._docs.set(t.documents),void this._cue.set(t.cue);if(t.view)return t.view.setLanguage(s),this._docs.set(t.view.documents),this._cue.set(t.cue),void(this.simple()||this._bindCategoriesFromView(t.view));if(t.cue){if(this.simple())return this._docs.set(t.cue.createProjectDocuments(e)),this._cue.set(t.cue),void this.availableContentCategories.set(void 0);const n=t.cue.createProjectView(e,{language:s});return this._ownedView=n,this._docs.set(n.documents),this._cue.set(t.cue),void this._bindCategoriesFromView(n)}this._docs.set(void 0),this._cue.set(void 0),this.errorMessage.set("sdkState must include cue, view, or documents to load data."),this.state.set("error")}_bindCategoriesFromView(e){const t=()=>{this.availableContentCategories.set(e.availableContentCategories.get())};t(),this._unsubscribeCategories=e.availableContentCategories.subscribe(t)}_clearRuntimeState(){this._cleanupOwnedView(),this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this._docs.set(void 0),this._cue.set(void 0),this.documentData.set({}),this.availableContentCategories.set(void 0),this.errorMessage.set(null),this._lastSetupSignature=void 0}_cleanupOwnedView(){this._ownedView&&(this._ownedView.destroy(),this._ownedView=void 0)}_fetchByFilter(e,t,s,n){var u=this;return(0,_.A)(function*(){if(n){u.state.set("loading");try{let d;if(void 0!==e&&e.length>0)d=yield n.documentsBySuffix(e);else if(void 0!==t&&t.length>0)d=yield n.documentsByMime(t);else{if(!(void 0!==s&&s.length>0))return u._filterResolvedUuids.set([]),void u.state.set("ready");d=yield n.documentsByContentCategory(s)}u._filterResolvedUuids.set(d.map(l=>l.uuid)),u.state.set("ready")}catch(d){console.error("[CueDocumentListWC] Failed to fetch documents by filter",d),u.errorMessage.set(d instanceof Error?d.message:"Failed to load documents."),u.state.set("error")}}else u._filterResolvedUuids.set([])})()}_isSameSetupSignature(e){const t=this._lastSetupSignature;return!!t&&t.projectId===e.projectId&&t.cue===e.cue&&t.view===e.view&&t.documents===e.documents&&t.language===e.language&&t.simple===e.simple}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=o.VBU({type:c,selectors:[["cue-document-list"]],inputs:{projectId:[1,"projectId"],uuids:[1,"uuids"],suffixes:[1,"suffixes"],mimeTypes:[1,"mimeTypes"],contentCategories:[1,"contentCategories"],sdkState:[1,"sdkState"],detailedView:[1,"detailedView"],simple:[1,"simple"],pageSize:[1,"pageSize"],size:[1,"size"],prefetchPages:[1,"prefetchPages"],showOpenInDocumentViewerAction:[1,"showOpenInDocumentViewerAction"],showOpenInFileManagerAction:[1,"showOpenInFileManagerAction"],customMenuItems:[1,"customMenuItems"],showLogo:[1,"showLogo"],variant:[1,"variant"]},outputs:{clickedDocument:"clickedDocument",clickedDownloadDocument:"clickedDownloadDocument",clickedOpenInDir:"clickedOpenInDir",clickedOpen:"clickedOpen"},decls:2,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","relative","width","100%",3,"cueLogoLoader"],[2,"color","#c44","font-size","13px"],[3,"clickedDocument","clickedDownloadDocument","clickedOpenInDir","clickedOpen","documentRefs","documentData","handlers","availableContentCategories","detailedView","simple","pageSize","size","prefetchPages","showOpenInDocumentViewerAction","showOpenInFileManagerAction","customOverlayActions","variant"],[2,"position","absolute","top","8px","left","8px","z-index","5",3,"projectId"]],template:function(t,s){1&t&&o.nVh(0,P,3,1,"cue-flexcontainer",0)(1,B,3,15,"div",1),2&t&&o.vxM("error"===s.state()?0:1)},dependencies:[w.g,M.n,p.Typography,D.k,E.x],styles:["[_nghost-%COMP%]{display:block;width:100%}"],changeDetection:0})}return c})()}}]);
|
package/2399.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2399],{4853(O,w,l){l.d(w,{H:()=>j});var _=l(7705),c=l(5802),p=l(7089),u=l(7023),e=l(5381),h=l(5971),v=l(3319),g=l(356),E=l(6279),r=l(5547);const C=()=>({position:"bottomleft"}),y=(M,I)=>I.label||M;function P(M,I){if(1&M){const b=r.RV6();r.j41(0,"cue-menu-item",4),r.bIt("click",function(){const D=c.eBV(b).$implicit;return c.Njj(D.action())}),r.EFF(1),r.k0s()}if(2&M){const b=I.$implicit;r.Y8G("selected",b.selected),r.R7$(),r.JRh(b.label)}}function R(M,I){if(1&M&&(r.j41(0,"cue-menu-wrap"),r.Z7z(1,P,2,2,"cue-menu-item",3,y),r.k0s()),2&M){const b=r.XpG();r.R7$(),r.Dyx(b.contextMenuItems())}}function V(M,I){if(1&M){const b=r.RV6();r.j41(0,"cue-button",5),r.bIt("click",function(D){const A=c.eBV(b).$implicit,k=r.XpG();return c.Njj(k.handleClick(D,A))}),r.nrm(1,"cue-button-icon",6),r.k0s()}if(2&M){const b=I.$implicit,x=r.XpG(),D=r.sdS(1);r.Y8G("cueTooltip",b.label)("variant",b.variant?b.variant:x.variant())("size",x.size())("cueContextMenu",D)("contextMenuData",r.lJ4(7,C))("cueContextEnabled",void 0!==b.contextMenuItems&&b.contextMenuItems.length>0),r.R7$(),r.Y8G("icon",b.icon)}}let j=(()=>{class M{items=_.hFB.required();noGap=(0,_.hFB)(!0);direction=(0,_.hFB)("row");size=(0,_.hFB)("xs");variant=(0,_.hFB)("tertiary");mouseEnter=(0,_.CGW)();mouseLeave=(0,_.CGW)();contextMenuItems=(0,c.vPA)([]);handleClick(b,x){b.stopPropagation(),x.contextMenuItems&&x.contextMenuItems.length>0?this.contextMenuItems.set(x.contextMenuItems):x.action&&(this.contextMenuItems.set([]),x.action())}static \u0275fac=function(x){return new(x||M)};static \u0275cmp=r.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(x,D){1&x&&(r.DNE(0,R,3,0,"ng-template",null,0,r.C5r),r.j41(2,"cue-flexcontainer",1),r.bIt("mouseenter",function(){return D.mouseEnter.emit()})("mouseleave",function(){return D.mouseLeave.emit()}),r.Z7z(3,V,2,8,"cue-button",2,y),r.k0s()),2&x&&(r.R7$(2),r.Y8G("direction",D.direction())("noGap",D.noGap()),r.R7$(),r.Dyx(D.items()))},dependencies:[e.n,h.$,p.d,v.a,u.Q,g.M,E.D],encapsulation:2,changeDetection:0})}return M})()},1024(O,w,l){l.d(w,{p:()=>p});var _=l(5547);const c=["*"];let p=(()=>{class u{static \u0275fac=function(v){return new(v||u)};static \u0275cmp=_.VBU({type:u,selectors:[["cue-key-val-list"]],ngContentSelectors:c,decls:2,vars:0,consts:[[1,"key-val-list"]],template:function(v,g){1&v&&(_.NAR(),_.rj2(0,"div",0),_.SdG(1),_.eux())},styles:[".key-val-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-grid-gap-s)}"]})}return u})()},9421(O,w,l){l.d(w,{F:()=>v});var _=l(7705),c=l(5802),p=l(2271),u=l(7335),e=l(2245),h=l(5547);let v=(()=>{class g{entityMenuDirective;size=(0,_.hFB)("m");key=_.hFB.required();val=_.geq.required();options=(0,_.hFB)([]);suffix=(0,_.hFB)("");valueChange=(0,_.CGW)();editModeEnabled=(0,c.vPA)(!1);valueChanged=(0,p.EW)(()=>this.val()!==this.newValue());newValue=(0,p.uu)(()=>this.val());labelSize=(0,p.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(r){this.editModeEnabled()&&("Escape"===r.key?(this._reset(),r.stopPropagation()):"Enter"===r.key&&this._emitChange())}saveCancelMenu=(0,p.EW)(()=>{const r=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&r.push({icon:"save",label:"Save",action:()=>this._emitChange()}),r});selectionChange(r){this.newValue.set(r?.toString()??"")}inputChange(r){this.newValue.set(r)}_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(C){return new(C||g)};static \u0275cmp=h.VBU({type:g,selectors:[["cue-key-val"]],viewQuery:function(C,y){if(1&C&&h.GBs(u.e,5),2&C){let P;h.mGM(P=h.lsd())&&(y.entityMenuDirective=P.first)}},hostBindings:function(C,y){1&C&&h.bIt("keydown",function(R){return y.onKeyPress(R)},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(C,y){1&C&&(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&C&&(h.R7$(2),h.Y8G("size",y.labelSize()),h.R7$(),h.JRh(y.key()),h.R7$(2),h.Y8G("size",y.size()),h.R7$(2),h.Lme("",y.val()," ",y.suffix()))},dependencies:[e.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 g})()},7335(O,w,l){l.d(w,{e:()=>g});var _=l(7705),c=l(5547),p=l(5802),u=l(8359),e=l(6939),h=l(2444),v=l(4853);let g=(()=>{class E{_targetEl=(0,p.WQX)(c.aKT);_overlay=(0,p.WQX)(h.hJ);_overlayRef;_isOverlayHovered=!1;_subscriptions;display=(0,_.hFB)("on-hover");menuItems=_.hFB.required();menuEnabled=(0,_.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 C=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=C;const y=window.getComputedStyle(this._targetEl.nativeElement).color;C.overlayElement.style.color=y;const P=new e.A8(v.H),R=C.attach(P);R.instance.items=this.menuItems,this._subscriptions&&this._subscriptions.unsubscribe(),this._subscriptions=new u.yU,this._subscriptions.add(R.instance.mouseEnter.subscribe(()=>{this._isOverlayHovered=!0})),this._subscriptions.add(R.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(y){return new(y||E)};static \u0275dir=c.FsC({type:E,selectors:[["","cueEntityMenu",""]],hostBindings:function(y,P){1&y&&c.bIt("mouseenter",function(){return P.onMouseEnter()})("mouseleave",function(){return P.onMouseLeave()})},inputs:{display:[1,"display"],menuItems:[1,"menuItems"],menuEnabled:[1,"menuEnabled"]}})}return E})()},2399(O,w,l){l.d(w,{CueDocumentViewer:()=>Oe});var _=l(467),c=l(7705),p=l(2271),u=l(5802),e=l(5547),h=l(9769),v=l(5381),g=l(2245),E=l(1024),r=l(9421),C=l(5794),y=l(9352),P=l(6117),R=l(8547),V=l(3319),j=l(5971),M=l(7573);const I=(o,m)=>t=>t.isHighlight;function b(o,m){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 x(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){u.eBV(t);const a=e.XpG(2).$implicit,s=e.XpG();return u.Njj(s.onDeleteHighlight(i,a.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function D(o,m){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){u.eBV(t);const i=e.XpG().$implicit,a=e.XpG();return u.Njj(a.onHighlightClick(i.highlight))}),e.nVh(1,b,2,1,"span",3),e.EFF(2),e.nVh(3,x,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 A(o,m){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 k(o,m){if(1&o&&e.nVh(0,D,4,4,"span",1)(1,A,2,2,"span"),2&o){const t=m.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let W=(()=>{class o{path=c.hFB.required();highlights=(0,c.hFB)([]);allowDelete=(0,c.hFB)(!1);allowAdd=(0,c.hFB)(!1);size=(0,c.hFB)("m");highlightClick=(0,c.CGW)();deleteHighlight=(0,c.CGW)();textSelected=(0,c.CGW)();segments=(0,p.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(f=>f.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const a=[...i].sort((f,T)=>f.start-T.start),s=[];let d=0;for(const f of a)f.start>d&&s.push({text:t.substring(d,f.start),isHighlight:!1,segmentStart:d}),s.push({text:t.substring(f.start,f.end),isHighlight:!0,highlight:f,segmentStart:f.start}),d=f.end;return d<t.length&&s.push({text:t.substring(d),isHighlight:!1,segmentStart:d}),s}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),s=t.currentTarget,d=this.getAbsoluteOffset(s,a.startContainer,a.startOffset),f=this.getAbsoluteOffset(s,a.endContainer,a.endOffset);n.removeAllRanges(),f>d&&this.textSelected.emit({path:this.path(),start:d,end:f,text:this.path().substring(d,f)})}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 T=parseInt(a.getAttribute("data-segment-start"),10);let F=0;const B=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);let L=B.nextNode();for(;L&&L!==n;)F+=L.textContent?.length??0,L=B.nextNode();return T+F+i}a=a.parentElement}const s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let d=0,f=s.nextNode();for(;f&&f!==n;)d+=f.textContent?.length??0,f=s.nextNode();return d+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(s){return i.onMouseUp(s)}),e.Z7z(1,k,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,I,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[h.MD,j.$,V.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 z=l(5745),X=l(63),H=l(9695),K=l(5448),Y=l(2611);const G=o=>({count:o}),J=(o,m)=>t=>t.iri;function Q(o,m){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 Z(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){u.eBV(t);const a=e.XpG(4);return u.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 q(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){u.eBV(t);const i=e.XpG(3);return u.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,Z,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,G,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,G,t._selectedPaths().length)))}}function ee(o,m){if(1&o&&e.nVh(0,Q,3,3,"cue-typography",11)(1,q,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function te(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){u.eBV(t);const a=e.XpG();return u.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,m){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=c.hFB.required();availableEntityCategories=(0,c.hFB)([]);fileLocations=(0,c.hFB)([]);requestFileLocations=(0,c.hFB)(void 0);requestFilePathEntityAdd=(0,c.hFB)(void 0);confirm=(0,c.CGW)();cancel=(0,c.CGW)();_selectedEntityCategory=(0,u.vPA)("");_applyToAllFiles=(0,u.vPA)(!1);_fileLocations=(0,u.vPA)(null);_fileLocationsLoading=(0,u.vPA)(!1);_matchTableExpanded=(0,u.vPA)(!1);_selectedPaths=(0,u.vPA)([]);_saving=(0,u.vPA)(!1);_saveError=(0,u.vPA)(null);_dirPrefix=(0,p.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,p.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,p.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,p.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,p.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,y.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,p.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,_.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 s=n._dirPrefix();n._selectedPaths.set(a.filter(d=>d.path.startsWith(s)))}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,_.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,a=t._fileLocations()?.find(f=>f.path===i)??t.fileLocations().find(f=>f.path===i)??{iri:"",path:i},s=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[a],d=t.requestFilePathEntityAdd();if(d){t._saving.set(!0),t._saveError.set(null);try{yield d(n,s)}catch(f){return console.error("[EntityMentionModal] Failed to save entity mention:",f),t._saveError.set(f instanceof Error?f.message:String(f)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:s})})()}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(s){return i.onEntityCategoryChange(s)}),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,J,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:[v.n,r.F,V.a,j.$,K.L,g.Typography,z.a,X.Select,H.Switch,Y.R,y.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const oe=()=>[];function ae(o,m){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 se(o,m){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 le(o,m){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,m){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,m){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,m){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){u.eBV(t);const i=e.XpG(3);return u.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,m){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){u.eBV(t);const i=e.XpG(3);return u.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,m){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){u.eBV(t);const a=e.XpG(2);return u.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,m){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 _e(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){u.eBV(t);const a=e.XpG();return u.Njj(a.onEntityMentionConfirm(i))})("cancel",function(){u.eBV(t);const i=e.XpG();return u.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=c.hFB.required();handlers=c.hFB.required();dataChanged=(0,c.CGW)();filePathEntityAdded=(0,c.CGW)();fileLocations=(0,c.hFB)([]);_fileLocationsProvider=(0,p.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,c.geq)([]);contentCategories=(0,c.hFB)([]);contentCategoriesEditable=(0,c.hFB)(!1);filePathEntitiesVisible=(0,c.hFB)(!1);filePathEntitiesEditable=(0,c.hFB)(!1);menuItems=(0,c.hFB)([]);availableContentCategories=(0,c.hFB)([]);availableEntityCategories=(0,c.hFB)([]);collapsed=(0,c.hFB)(!1);hasDocInfo=(0,p.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,u.vPA)(0);_entityCategoryModalVisible=(0,u.vPA)(!1);_pendingSelection=(0,u.vPA)(null);_requestFilePathEntityAdd=(0,p.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,_.A)(function*(a,s){const d=t._pendingSelection();d&&(yield n({paths:s,start:d.start,end:d.end,text:d.text,entityCategory:a,folderPath:d.path.substring(0,d.end)}))});return function(a,s){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,p.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,p.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,p.uu)(()=>this.contentCategories());contentCategoriesString=(0,p.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,y.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,p.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,_.A)(function*(a){console.log(a);const s={subject:t.subject(),predicate:`${M.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:a.newValue,type:"contentCategory",comment:a.comment};yield n(s),t._contentCategories.set(a.newValue),t.dataChanged.emit({contentCategories:a.newValue})}),function(s){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,se,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,le,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,ge,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,_e,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:[v.n,E.p,r.F,C.L,P.W,R.T,V.a,j.$,W,g.Typography,ie,y.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 fe{requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var pe=l(2065),ve=l(5187),ye=l(7293);const be=["viewerHost"];function Ce(o,m){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 Me(o,m){1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),e.EFF(2,"Loading\u2026"),e.k0s()())}function xe(o,m){if(1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography",8),e.EFF(2),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(2),e.JRh(t.errorMessage())}}function Ee(o,m){if(1&o&&e.nrm(0,"cue-logo-link",7),2&o){const t=e.XpG(2);e.Y8G("projectId",t.projectId())("resourceId",t._uuidOnly())}}function De(o,m){if(1&o&&(e.j41(0,"div",3),e.nVh(1,Ce,1,3,"cue-document-info",4),e.nVh(2,Me,3,0,"cue-flexcontainer",5)(3,xe,3,1,"cue-flexcontainer",5),e.j41(4,"div",6),e.eu8(5,null,1),e.k0s(),e.nVh(7,Ee,1,2,"cue-logo-link",7),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),e.R7$(5),e.vxM(t.showLogo()?7:-1)}}function Pe(o,m){1&o&&e.eu8(0)}function we(o,m){if(1&o&&(e.j41(0,"cue-card",2),e.DNE(1,Pe,1,0,"ng-container",9),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 Re(o,m){1&o&&e.eu8(0)}function Fe(o,m){if(1&o&&e.DNE(0,Re,1,0,"ng-container",9),2&o){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}const Ie=[".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"];let Oe=(()=>{class o{set _viewerHostRef(t){if(this._viewerHost=t,t&&this._lastRenderArgs){const{url:n,suffix:i,page:a,viewerTypeOverride:s}=this._lastRenderArgs;this._renderViewer(n,i,a,s)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,c.hFB)(void 0);uuid=(0,c.hFB)(void 0);projectId=(0,c.hFB)(void 0);showDocumentInfo=(0,c.hFB)(!0,{transform:c.L39});showLogo=(0,c.hFB)(!1,{transform:c.L39});_uuidOnly=(0,p.EW)(()=>{const t=this.uuid();return t?t.split("?")[0].trim():void 0});extraMenuItems=(0,c.hFB)([]);portalBaseURL=(0,c.hFB)("https://cue.qaecy.com");variant=(0,c.hFB)("none");_cardVariant=(0,p.EW)(()=>this.variant());state=(0,u.vPA)("idle");errorMessage=(0,u.vPA)(null);resolvedUrl=(0,u.vPA)(null);resolvedSuffix=(0,u.vPA)(null);_docSubject=(0,u.vPA)("");_alternatives=(0,u.vPA)([]);_originalUuid=(0,u.vPA)(null);_originalDocSuffix=(0,u.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_inputWarningTimer;_blobUrls=new Set;_docInfoHandlers=new fe;_menuItems=(0,p.EW)(()=>{const t=[],n=this._originalUuid(),i=this._originalDocSuffix();n&&i&&t.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const a=this._alternatives();if(a.length>1){const s=this.resolvedSuffix();t.push({icon:"document",label:"Alternative representation",children:a.map(d=>({label:d.original?`Original (${d.suffix.replace(".","").toUpperCase()})`:d.suffix.replace(".","").toUpperCase(),tooltip:s===d.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(d)}))})}return t.push(...this.extraMenuItems()),t});constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-document-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.uuid()||console.warn('[cue-document-viewer] Required input "uuid" is not set. Pass the document UUID to display.'),this.projectId()||console.warn('[cue-document-viewer] Required input "projectId" is not set. Pass the Cue project ID the document belongs to.')},3e3),(0,u.QZP)(()=>{const t=this.cue(),n=this.uuid(),i=this.projectId();t&&n&&i?this._load(t,n,i):this.state.set("idle")})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._blobUrls.forEach(t=>URL.revokeObjectURL(t))}_load(t,n,i){var a=this;return(0,_.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:s,page:d}=function Te(o){const[m,t]=o.split("?"),n=m.trim();let i=null;if(t){const s=new URLSearchParams(t).get("page");if(null!==s){const d=parseInt(s,10);!isNaN(d)&&d>0&&(i=d)}}return{uuid:n,page:i}}(n),f=t.createProjectDocuments(i),F=(yield f.fetchDocumentData([s]))[s];if(!F)throw new Error(`Document '${s}' not found in project '${i}'.`);a._docSubject.set(F.subject??""),a._originalUuid.set(s),a._originalDocSuffix.set(F.suffix);const B=yield f.fetchAlternativeRepresentations(s);a._alternatives.set([{uuid:s,suffix:F.suffix,original:!0},...B.filter(N=>N.id!==s).map(N=>({uuid:N.id,suffix:N.suffix,original:!1,remoteRelativePath:N.remoteRelativePath}))]);const{uuid:L,suffix:S,remoteRelativePath:U}=function Le(o,m){const t=[o,...m];let n,i=1/0;for(const a of t){const s=Ie.indexOf(a.suffix);-1!==s&&s<i&&(i=s,n=a)}return n?{uuid:n.id,suffix:n.suffix,remoteRelativePath:n.remoteRelativePath}:{uuid:o.id,suffix:o.suffix}}(F,B),$=U?yield a._toBlobUrl(t,t.storage.getAltRepDownloadUrl(U),i):yield a._toBlobUrl(t,t.storage.getDownloadUrl(i,L,S),i);a.resolvedUrl.set($),a.resolvedSuffix.set(S);const Ve=[".eml",".msg",".emlx",".mbx"].includes(F.suffix)&&".json"===S?"email":void 0;yield a._renderViewer($,S,d,Ve),a.state.set("ready")}catch(s){const d=s instanceof Error?s.message:String(s);console.error("[CueDocumentViewerWC] Failed to load document:",d),a.errorMessage.set(d),a.state.set("error")}}else a.state.set("idle")})()}_toBlobUrl(t,n,i){var a=this;return(0,_.A)(function*(){const s=yield t.auth.authenticatedFetch(n,{headers:{"cue-project-id":i}});if(!s.ok)throw new Error(`Failed to fetch document: ${s.status} ${s.statusText}`);const d=URL.createObjectURL(yield s.blob());return a._blobUrls.add(d),d})()}_renderViewer(t,n,i,a){var s=this;return(0,_.A)(function*(){try{const{DocumentViewer:d}=yield Promise.all([l.e(3418),l.e(3036)]).then(l.bind(l,3036)),{DocumentViewerSettings:f}=yield l.e(3418).then(l.bind(l,3418));s._viewerHost?.clear(),s.currentViewerRef?.destroy();const T=new f;if(null!==i&&(T.pdf.page=String(i)),!s._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");s._lastRenderArgs={url:t,suffix:n,page:i,viewerTypeOverride:a},s.currentViewerRef=s._viewerHost.createComponent(d),s.currentViewerRef.setInput("url",t),s.currentViewerRef.setInput("suffix",n),s.currentViewerRef.setInput("settings",T),a&&s.currentViewerRef.setInput("viewerTypeOverride",a)}catch(d){throw new Error(`Failed to load viewer component: ${d instanceof Error?d.message:String(d)}`)}})()}_switchToAlternative(t){var n=this;return(0,_.A)(function*(){const i=n._cueSnapshot,a=n._projectIdSnapshot;if(i&&a)try{const s=t.remoteRelativePath?yield n._toBlobUrl(i,i.storage.getAltRepDownloadUrl(t.remoteRelativePath),a):yield n._toBlobUrl(i,i.storage.getDownloadUrl(a,t.uuid,t.suffix),a);n.resolvedUrl.set(s),n.resolvedSuffix.set(t.suffix),yield n._renderViewer(s,t.suffix,null)}catch(s){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",s)}})()}_downloadOriginal(){var t=this;return(0,_.A)(function*(){const n=t._cueSnapshot,i=t._projectIdSnapshot,a=t._originalUuid(),s=t._originalDocSuffix();if(n&&i&&a&&s)try{const d=yield n.storage.downloadBlob(i,a,s);(0,pe.KE)(d,`${a}${s}`)}catch(d){console.error("[CueDocumentViewerWC] Failed to download original:",d)}})()}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"],showLogo:[1,"showLogo"],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%","position","relative"],[3,"subject","handlers","menuItems"],["direction","column","align","center","justify","center",2,"flex","1","width","100%"],[2,"flex","1","min-height","0","overflow","hidden"],[2,"position","absolute","bottom","12px","right","12px","z-index","5",3,"projectId","resourceId"],[2,"color","#c44","font-size","13px"],[4,"ngTemplateOutlet"]],template:function(n,i){1&n&&(e.DNE(0,De,8,3,"ng-template",null,0,e.C5r),e.nVh(2,we,2,3,"cue-card",2)(3,Fe,1,1,"ng-container")),2&n&&(e.R7$(2),e.vxM("none"!==i.variant()?2:3))},dependencies:[h.MD,h.T3,v.n,g.Typography,me,ve.Card,ye.x],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return o})()},2065(O,w,l){function p(h,v,g="text/plain"){return function _(h,v="data.zip"){const g=document.createElement("a"),E=URL.createObjectURL(h);g.href=E,g.download=v,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(E)}(new Blob([h],{type:g}),v)}function u(h,v){const g=document.createElement("a");g.style.display="hidden",g.setAttribute("href",window.URL.createObjectURL(h)),g.setAttribute("download",v),document.body.appendChild(g),g.click(),g.remove()}l.d(w,{KE:()=>u,YN:()=>p})}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2399],{5448(L,D,l){l.d(D,{L:()=>e});var _=l(7705),c=l(2245),g=l(5547);const d=["*"];let e=(()=>{class h{fontSize=(0,_.hFB)("m");italic=(0,_.hFB)(!1);noWrap=(0,_.hFB)(!0);static \u0275fac=function(C){return new(C||h)};static \u0275cmp=g.VBU({type:h,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:d,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function(C,r){1&C&&(g.NAR(),g.j41(0,"div")(1,"cue-typography",0),g.SdG(2),g.k0s()()),2&C&&(g.R7$(),g.Y8G("size",r.fontSize())("italic",r.italic())("noWrap",r.noWrap()))},dependencies:[c.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return h})()},4853(L,D,l){l.d(D,{H:()=>j});var _=l(7705),c=l(5802),g=l(7089),d=l(7023),e=l(5381),h=l(5971),v=l(3319),m=l(356),C=l(6279),r=l(5547);const M=()=>({position:"bottomleft"}),y=(E,I)=>I.label||E;function w(E,I){if(1&E){const b=r.RV6();r.j41(0,"cue-menu-item",4),r.bIt("click",function(){const P=c.eBV(b).$implicit;return c.Njj(P.action())}),r.EFF(1),r.k0s()}if(2&E){const b=I.$implicit;r.Y8G("selected",b.selected),r.R7$(),r.JRh(b.label)}}function R(E,I){if(1&E&&(r.j41(0,"cue-menu-wrap"),r.Z7z(1,w,2,2,"cue-menu-item",3,y),r.k0s()),2&E){const b=r.XpG();r.R7$(),r.Dyx(b.contextMenuItems())}}function V(E,I){if(1&E){const b=r.RV6();r.j41(0,"cue-button",5),r.bIt("click",function(P){const B=c.eBV(b).$implicit,k=r.XpG();return c.Njj(k.handleClick(P,B))}),r.nrm(1,"cue-button-icon",6),r.k0s()}if(2&E){const b=I.$implicit,x=r.XpG(),P=r.sdS(1);r.Y8G("cueTooltip",b.label)("variant",b.variant?b.variant:x.variant())("size",x.size())("cueContextMenu",P)("contextMenuData",r.lJ4(7,M))("cueContextEnabled",void 0!==b.contextMenuItems&&b.contextMenuItems.length>0),r.R7$(),r.Y8G("icon",b.icon)}}let j=(()=>{class E{items=_.hFB.required();noGap=(0,_.hFB)(!0);direction=(0,_.hFB)("row");size=(0,_.hFB)("xs");variant=(0,_.hFB)("tertiary");mouseEnter=(0,_.CGW)();mouseLeave=(0,_.CGW)();contextMenuItems=(0,c.vPA)([]);handleClick(b,x){b.stopPropagation(),x.contextMenuItems&&x.contextMenuItems.length>0?this.contextMenuItems.set(x.contextMenuItems):x.action&&(this.contextMenuItems.set([]),x.action())}static \u0275fac=function(x){return new(x||E)};static \u0275cmp=r.VBU({type:E,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(x,P){1&x&&(r.DNE(0,R,3,0,"ng-template",null,0,r.C5r),r.j41(2,"cue-flexcontainer",1),r.bIt("mouseenter",function(){return P.mouseEnter.emit()})("mouseleave",function(){return P.mouseLeave.emit()}),r.Z7z(3,V,2,8,"cue-button",2,y),r.k0s()),2&x&&(r.R7$(2),r.Y8G("direction",P.direction())("noGap",P.noGap()),r.R7$(),r.Dyx(P.items()))},dependencies:[e.n,h.$,g.d,v.a,d.Q,m.M,C.D],encapsulation:2,changeDetection:0})}return E})()},1024(L,D,l){l.d(D,{p:()=>g});var _=l(5547);const c=["*"];let g=(()=>{class d{static \u0275fac=function(v){return new(v||d)};static \u0275cmp=_.VBU({type:d,selectors:[["cue-key-val-list"]],ngContentSelectors:c,decls:2,vars:0,consts:[[1,"key-val-list"]],template:function(v,m){1&v&&(_.NAR(),_.rj2(0,"div",0),_.SdG(1),_.eux())},styles:[".key-val-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-grid-gap-s)}"]})}return d})()},9421(L,D,l){l.d(D,{F:()=>v});var _=l(7705),c=l(5802),g=l(2271),d=l(7335),e=l(2245),h=l(5547);let v=(()=>{class m{entityMenuDirective;size=(0,_.hFB)("m");key=_.hFB.required();val=_.geq.required();options=(0,_.hFB)([]);suffix=(0,_.hFB)("");valueChange=(0,_.CGW)();editModeEnabled=(0,c.vPA)(!1);valueChanged=(0,g.EW)(()=>this.val()!==this.newValue());newValue=(0,g.uu)(()=>this.val());labelSize=(0,g.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(r){this.editModeEnabled()&&("Escape"===r.key?(this._reset(),r.stopPropagation()):"Enter"===r.key&&this._emitChange())}saveCancelMenu=(0,g.EW)(()=>{const r=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&r.push({icon:"save",label:"Save",action:()=>this._emitChange()}),r});selectionChange(r){this.newValue.set(r?.toString()??"")}inputChange(r){this.newValue.set(r)}_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(M){return new(M||m)};static \u0275cmp=h.VBU({type:m,selectors:[["cue-key-val"]],viewQuery:function(M,y){if(1&M&&h.GBs(d.e,5),2&M){let w;h.mGM(w=h.lsd())&&(y.entityMenuDirective=w.first)}},hostBindings:function(M,y){1&M&&h.bIt("keydown",function(R){return y.onKeyPress(R)},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(M,y){1&M&&(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&M&&(h.R7$(2),h.Y8G("size",y.labelSize()),h.R7$(),h.JRh(y.key()),h.R7$(2),h.Y8G("size",y.size()),h.R7$(2),h.Lme("",y.val()," ",y.suffix()))},dependencies:[e.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 m})()},7335(L,D,l){l.d(D,{e:()=>m});var _=l(7705),c=l(5547),g=l(5802),d=l(8359),e=l(6939),h=l(2444),v=l(4853);let m=(()=>{class C{_targetEl=(0,g.WQX)(c.aKT);_overlay=(0,g.WQX)(h.hJ);_overlayRef;_isOverlayHovered=!1;_subscriptions;display=(0,_.hFB)("on-hover");menuItems=_.hFB.required();menuEnabled=(0,_.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 M=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=M;const y=window.getComputedStyle(this._targetEl.nativeElement).color;M.overlayElement.style.color=y;const w=new e.A8(v.H),R=M.attach(w);R.instance.items=this.menuItems,this._subscriptions&&this._subscriptions.unsubscribe(),this._subscriptions=new d.yU,this._subscriptions.add(R.instance.mouseEnter.subscribe(()=>{this._isOverlayHovered=!0})),this._subscriptions.add(R.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(y){return new(y||C)};static \u0275dir=c.FsC({type:C,selectors:[["","cueEntityMenu",""]],hostBindings:function(y,w){1&y&&c.bIt("mouseenter",function(){return w.onMouseEnter()})("mouseleave",function(){return w.onMouseLeave()})},inputs:{display:[1,"display"],menuItems:[1,"menuItems"],menuEnabled:[1,"menuEnabled"]}})}return C})()},2399(L,D,l){l.d(D,{CueDocumentViewer:()=>Oe});var _=l(467),c=l(7705),g=l(2271),d=l(5802),e=l(5547),h=l(9769),v=l(5381),m=l(2245),C=l(1024),r=l(9421),M=l(5794),y=l(9352),w=l(6117),R=l(8547),V=l(3319),j=l(5971),E=l(7573);const I=(o,f)=>t=>t.isHighlight;function b(o,f){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 x(o,f){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){d.eBV(t);const a=e.XpG(2).$implicit,s=e.XpG();return d.Njj(s.onDeleteHighlight(i,a.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function P(o,f){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){d.eBV(t);const i=e.XpG().$implicit,a=e.XpG();return d.Njj(a.onHighlightClick(i.highlight))}),e.nVh(1,b,2,1,"span",3),e.EFF(2),e.nVh(3,x,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 B(o,f){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 k(o,f){if(1&o&&e.nVh(0,P,4,4,"span",1)(1,B,2,2,"span"),2&o){const t=f.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let $=(()=>{class o{path=c.hFB.required();highlights=(0,c.hFB)([]);allowDelete=(0,c.hFB)(!1);allowAdd=(0,c.hFB)(!1);size=(0,c.hFB)("m");highlightClick=(0,c.CGW)();deleteHighlight=(0,c.CGW)();textSelected=(0,c.CGW)();segments=(0,g.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(p=>p.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const a=[...i].sort((p,T)=>p.start-T.start),s=[];let u=0;for(const p of a)p.start>u&&s.push({text:t.substring(u,p.start),isHighlight:!1,segmentStart:u}),s.push({text:t.substring(p.start,p.end),isHighlight:!0,highlight:p,segmentStart:p.start}),u=p.end;return u<t.length&&s.push({text:t.substring(u),isHighlight:!1,segmentStart:u}),s}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),s=t.currentTarget,u=this.getAbsoluteOffset(s,a.startContainer,a.startOffset),p=this.getAbsoluteOffset(s,a.endContainer,a.endOffset);n.removeAllRanges(),p>u&&this.textSelected.emit({path:this.path(),start:u,end:p,text:this.path().substring(u,p)})}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 T=parseInt(a.getAttribute("data-segment-start"),10);let F=0;const A=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);let O=A.nextNode();for(;O&&O!==n;)F+=O.textContent?.length??0,O=A.nextNode();return T+F+i}a=a.parentElement}const s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let u=0,p=s.nextNode();for(;p&&p!==n;)u+=p.textContent?.length??0,p=s.nextNode();return u+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(s){return i.onMouseUp(s)}),e.Z7z(1,k,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,I,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[h.MD,j.$,V.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 z=l(5745),X=l(63),H=l(9695),K=l(5448),Y=l(2611);const G=o=>({count:o}),J=(o,f)=>t=>t.iri;function Q(o,f){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 Z(o,f){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){d.eBV(t);const a=e.XpG(4);return d.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 q(o,f){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){d.eBV(t);const i=e.XpG(3);return d.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,Z,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,G,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,G,t._selectedPaths().length)))}}function ee(o,f){if(1&o&&e.nVh(0,Q,3,3,"cue-typography",11)(1,q,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function te(o,f){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){d.eBV(t);const a=e.XpG();return d.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,f){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=c.hFB.required();availableEntityCategories=(0,c.hFB)([]);fileLocations=(0,c.hFB)([]);requestFileLocations=(0,c.hFB)(void 0);requestFilePathEntityAdd=(0,c.hFB)(void 0);confirm=(0,c.CGW)();cancel=(0,c.CGW)();_selectedEntityCategory=(0,d.vPA)("");_applyToAllFiles=(0,d.vPA)(!1);_fileLocations=(0,d.vPA)(null);_fileLocationsLoading=(0,d.vPA)(!1);_matchTableExpanded=(0,d.vPA)(!1);_selectedPaths=(0,d.vPA)([]);_saving=(0,d.vPA)(!1);_saveError=(0,d.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,y.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,_.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 s=n._dirPrefix();n._selectedPaths.set(a.filter(u=>u.path.startsWith(s)))}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,_.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,a=t._fileLocations()?.find(p=>p.path===i)??t.fileLocations().find(p=>p.path===i)??{iri:"",path:i},s=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[a],u=t.requestFilePathEntityAdd();if(u){t._saving.set(!0),t._saveError.set(null);try{yield u(n,s)}catch(p){return console.error("[EntityMentionModal] Failed to save entity mention:",p),t._saveError.set(p instanceof Error?p.message:String(p)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:s})})()}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(s){return i.onEntityCategoryChange(s)}),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,J,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:[v.n,r.F,V.a,j.$,K.L,m.Typography,z.a,X.Select,H.Switch,Y.R,y.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const oe=()=>[];function ae(o,f){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 se(o,f){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 le(o,f){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,f){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,f){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,f){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){d.eBV(t);const i=e.XpG(3);return d.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,f){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){d.eBV(t);const i=e.XpG(3);return d.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,f){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){d.eBV(t);const a=e.XpG(2);return d.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,f){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 _e(o,f){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){d.eBV(t);const a=e.XpG();return d.Njj(a.onEntityMentionConfirm(i))})("cancel",function(){d.eBV(t);const i=e.XpG();return d.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=c.hFB.required();handlers=c.hFB.required();dataChanged=(0,c.CGW)();filePathEntityAdded=(0,c.CGW)();fileLocations=(0,c.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,c.geq)([]);contentCategories=(0,c.hFB)([]);contentCategoriesEditable=(0,c.hFB)(!1);filePathEntitiesVisible=(0,c.hFB)(!1);filePathEntitiesEditable=(0,c.hFB)(!1);menuItems=(0,c.hFB)([]);availableContentCategories=(0,c.hFB)([]);availableEntityCategories=(0,c.hFB)([]);collapsed=(0,c.hFB)(!1);hasDocInfo=(0,g.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,d.vPA)(0);_entityCategoryModalVisible=(0,d.vPA)(!1);_pendingSelection=(0,d.vPA)(null);_requestFilePathEntityAdd=(0,g.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,_.A)(function*(a,s){const u=t._pendingSelection();u&&(yield n({paths:s,start:u.start,end:u.end,text:u.text,entityCategory:a,folderPath:u.path.substring(0,u.end)}))});return function(a,s){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,y.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,_.A)(function*(a){console.log(a);const s={subject:t.subject(),predicate:`${E.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:a.newValue,type:"contentCategory",comment:a.comment};yield n(s),t._contentCategories.set(a.newValue),t.dataChanged.emit({contentCategories:a.newValue})}),function(s){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,se,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,le,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,ge,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,_e,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:[v.n,C.p,r.F,M.L,w.W,R.T,V.a,j.$,$,m.Typography,ie,y.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 fe{requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var pe=l(2065),ve=l(5187),ye=l(7293);const be=["viewerHost"];function Ce(o,f){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 Me(o,f){1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),e.EFF(2,"Loading\u2026"),e.k0s()())}function Ee(o,f){if(1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography",8),e.EFF(2),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(2),e.JRh(t.errorMessage())}}function xe(o,f){if(1&o&&e.nrm(0,"cue-logo-link",7),2&o){const t=e.XpG(2);e.Y8G("projectId",t.projectId())("resourceId",t._uuidOnly())}}function De(o,f){if(1&o&&(e.j41(0,"div",3),e.nVh(1,Ce,1,3,"cue-document-info",4),e.nVh(2,Me,3,0,"cue-flexcontainer",5)(3,Ee,3,1,"cue-flexcontainer",5),e.j41(4,"div",6),e.eu8(5,null,1),e.k0s(),e.nVh(7,xe,1,2,"cue-logo-link",7),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),e.R7$(5),e.vxM(t.showLogo()?7:-1)}}function Pe(o,f){1&o&&e.eu8(0)}function we(o,f){if(1&o&&(e.j41(0,"cue-card",2),e.DNE(1,Pe,1,0,"ng-container",9),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 Re(o,f){1&o&&e.eu8(0)}function Fe(o,f){if(1&o&&e.DNE(0,Re,1,0,"ng-container",9),2&o){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}const Ie=[".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"];let Oe=(()=>{class o{set _viewerHostRef(t){if(this._viewerHost=t,t&&this._lastRenderArgs){const{url:n,suffix:i,page:a,viewerTypeOverride:s}=this._lastRenderArgs;this._renderViewer(n,i,a,s)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,c.hFB)(void 0);uuid=(0,c.hFB)(void 0);projectId=(0,c.hFB)(void 0);showDocumentInfo=(0,c.hFB)(!0,{transform:c.L39});showLogo=(0,c.hFB)(!1,{transform:c.L39});_uuidOnly=(0,g.EW)(()=>{const t=this.uuid();return t?t.split("?")[0].trim():void 0});extraMenuItems=(0,c.hFB)([]);portalBaseURL=(0,c.hFB)("https://cue.qaecy.com");variant=(0,c.hFB)("none");_cardVariant=(0,g.EW)(()=>this.variant());state=(0,d.vPA)("idle");errorMessage=(0,d.vPA)(null);resolvedUrl=(0,d.vPA)(null);resolvedSuffix=(0,d.vPA)(null);_docSubject=(0,d.vPA)("");_alternatives=(0,d.vPA)([]);_originalUuid=(0,d.vPA)(null);_originalDocSuffix=(0,d.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_inputWarningTimer;_blobUrls=new Set;_docInfoHandlers=new fe;_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._alternatives();if(a.length>1){const s=this.resolvedSuffix();t.push({icon:"document",label:"Alternative representation",children:a.map(u=>({label:u.original?`Original (${u.suffix.replace(".","").toUpperCase()})`:u.suffix.replace(".","").toUpperCase(),tooltip:s===u.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(u)}))})}return t.push(...this.extraMenuItems()),t});constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-document-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.uuid()||console.warn('[cue-document-viewer] Required input "uuid" is not set. Pass the document UUID to display.'),this.projectId()||console.warn('[cue-document-viewer] Required input "projectId" is not set. Pass the Cue project ID the document belongs to.')},3e3),(0,d.QZP)(()=>{const t=this.cue(),n=this.uuid(),i=this.projectId();t&&n&&i?this._load(t,n,i):this.state.set("idle")})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._blobUrls.forEach(t=>URL.revokeObjectURL(t))}_load(t,n,i){var a=this;return(0,_.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:s,page:u}=function Te(o){const[f,t]=o.split("?"),n=f.trim();let i=null;if(t){const s=new URLSearchParams(t).get("page");if(null!==s){const u=parseInt(s,10);!isNaN(u)&&u>0&&(i=u)}}return{uuid:n,page:i}}(n),p=t.createProjectDocuments(i),F=(yield p.fetchDocumentData([s]))[s];if(!F)throw new Error(`Document '${s}' not found in project '${i}'.`);a._docSubject.set(F.subject??""),a._originalUuid.set(s),a._originalDocSuffix.set(F.suffix);const A=yield p.fetchAlternativeRepresentations(s);a._alternatives.set([{uuid:s,suffix:F.suffix,original:!0},...A.filter(S=>S.id!==s).map(S=>({uuid:S.id,suffix:S.suffix,original:!1,remoteRelativePath:S.remoteRelativePath}))]);const{uuid:O,suffix:N,remoteRelativePath:U}=function Le(o,f){const t=[o,...f];let n,i=1/0;for(const a of t){const s=Ie.indexOf(a.suffix);-1!==s&&s<i&&(i=s,n=a)}return n?{uuid:n.id,suffix:n.suffix,remoteRelativePath:n.remoteRelativePath}:{uuid:o.id,suffix:o.suffix}}(F,A),W=U?yield a._toBlobUrl(t,t.storage.getAltRepDownloadUrl(U),i):yield a._toBlobUrl(t,t.storage.getDownloadUrl(i,O,N),i);a.resolvedUrl.set(W),a.resolvedSuffix.set(N);const Ve=[".eml",".msg",".emlx",".mbx"].includes(F.suffix)&&".json"===N?"email":void 0;yield a._renderViewer(W,N,u,Ve),a.state.set("ready")}catch(s){const u=s instanceof Error?s.message:String(s);console.error("[CueDocumentViewerWC] Failed to load document:",u),a.errorMessage.set(u),a.state.set("error")}}else a.state.set("idle")})()}_toBlobUrl(t,n,i){var a=this;return(0,_.A)(function*(){const s=yield t.auth.authenticatedFetch(n,{headers:{"cue-project-id":i}});if(!s.ok)throw new Error(`Failed to fetch document: ${s.status} ${s.statusText}`);const u=URL.createObjectURL(yield s.blob());return a._blobUrls.add(u),u})()}_renderViewer(t,n,i,a){var s=this;return(0,_.A)(function*(){try{const{DocumentViewer:u}=yield Promise.all([l.e(3418),l.e(3036)]).then(l.bind(l,3036)),{DocumentViewerSettings:p}=yield l.e(3418).then(l.bind(l,3418));s._viewerHost?.clear(),s.currentViewerRef?.destroy();const T=new p;if(null!==i&&(T.pdf.page=String(i)),!s._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");s._lastRenderArgs={url:t,suffix:n,page:i,viewerTypeOverride:a},s.currentViewerRef=s._viewerHost.createComponent(u),s.currentViewerRef.setInput("url",t),s.currentViewerRef.setInput("suffix",n),s.currentViewerRef.setInput("settings",T),a&&s.currentViewerRef.setInput("viewerTypeOverride",a)}catch(u){throw new Error(`Failed to load viewer component: ${u instanceof Error?u.message:String(u)}`)}})()}_switchToAlternative(t){var n=this;return(0,_.A)(function*(){const i=n._cueSnapshot,a=n._projectIdSnapshot;if(i&&a)try{const s=t.remoteRelativePath?yield n._toBlobUrl(i,i.storage.getAltRepDownloadUrl(t.remoteRelativePath),a):yield n._toBlobUrl(i,i.storage.getDownloadUrl(a,t.uuid,t.suffix),a);n.resolvedUrl.set(s),n.resolvedSuffix.set(t.suffix),yield n._renderViewer(s,t.suffix,null)}catch(s){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",s)}})()}_downloadOriginal(){var t=this;return(0,_.A)(function*(){const n=t._cueSnapshot,i=t._projectIdSnapshot,a=t._originalUuid(),s=t._originalDocSuffix();if(n&&i&&a&&s)try{const u=yield n.storage.downloadBlob(i,a,s);(0,pe.KE)(u,`${a}${s}`)}catch(u){console.error("[CueDocumentViewerWC] Failed to download original:",u)}})()}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"],showLogo:[1,"showLogo"],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%","position","relative"],[3,"subject","handlers","menuItems"],["direction","column","align","center","justify","center",2,"flex","1","width","100%"],[2,"flex","1","min-height","0","overflow","hidden"],[2,"position","absolute","bottom","12px","right","12px","z-index","5",3,"projectId","resourceId"],[2,"color","#c44","font-size","13px"],[4,"ngTemplateOutlet"]],template:function(n,i){1&n&&(e.DNE(0,De,8,3,"ng-template",null,0,e.C5r),e.nVh(2,we,2,3,"cue-card",2)(3,Fe,1,1,"ng-container")),2&n&&(e.R7$(2),e.vxM("none"!==i.variant()?2:3))},dependencies:[h.MD,h.T3,v.n,m.Typography,me,ve.Card,ye.x],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return o})()},2065(L,D,l){function g(h,v,m="text/plain"){return function _(h,v="data.zip"){const m=document.createElement("a"),C=URL.createObjectURL(h);m.href=C,m.download=v,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(C)}(new Blob([h],{type:m}),v)}function d(h,v){const m=document.createElement("a");m.style.display="hidden",m.setAttribute("href",window.URL.createObjectURL(h)),m.setAttribute("download",v),document.body.appendChild(m),m.click(),m.remove()}l.d(D,{KE:()=>d,YN:()=>g})}}]);
|
package/5500.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[5500,9695],{9695(U,E,m){"use strict";m.d(E,{Switch:()=>x});var f=m(7705),P=m(29),d=m(5547);function n(b,C){if(1&b&&d.nrm(0,"cue-svg-icon",2),2&b){const D=d.XpG();d.Y8G("name",D.iconChecked())}}function S(b,C){if(1&b&&d.nrm(0,"cue-svg-icon",2),2&b){const D=d.XpG();d.Y8G("name",D.icon())}}let x=(()=>{class b{size=(0,f.hFB)("m");icon=(0,f.hFB)(void 0);iconChecked=(0,f.hFB)(void 0);disabled=(0,f.hFB)(!1);checked=(0,f.geq)(!1);toggleChange=(0,f.CGW)();toggle(){this.checked.set(!this.checked()),this.toggleChange.emit(this.checked())}static \u0275fac=function(M){return new(M||b)};static \u0275cmp=d.VBU({type:b,selectors:[["cue-input-switch"]],hostVars:5,hostBindings:function(M,p){2&M&&(d.BMQ("size",p.size()),d.AVh("checked",p.checked())("disabled",p.disabled()))},inputs:{size:[1,"size"],icon:[1,"icon"],iconChecked:[1,"iconChecked"],disabled:[1,"disabled"],checked:[1,"checked"]},outputs:{checked:"checkedChange",toggleChange:"toggleChange"},decls:4,vars:3,consts:[["type","checkbox",3,"click","checked","disabled"],[1,"indicator"],[3,"name"]],template:function(M,p){1&M&&(d.j41(0,"input",0),d.bIt("click",function(){return p.toggle()}),d.k0s(),d.j41(1,"div",1),d.nVh(2,n,1,1,"cue-svg-icon",2)(3,S,1,1,"cue-svg-icon",2),d.k0s()),2&M&&(d.Y8G("checked",p.checked())("disabled",p.disabled()),d.R7$(2),d.vxM(p.checked()&&p.iconChecked()?2:p.icon()?3:-1))},dependencies:[P.A],styles:["[_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-width: calc(var(--cue-input-switch-height) * 1.7);--cue-input-switch-inset: 2px;--cue-input-switch-indicator-width: calc( var(--cue-input-switch-height) - (2 * var(--cue-input-switch-inset)) );--cue-input-switch-icon-width: calc( var(--cue-input-switch-indicator-width) - (2 * var(--cue-input-switch-inset)) );display:block;flex-shrink:0;position:relative;height:var(--cue-input-switch-height);width:var(--cue-input-switch-width);border-radius:var(--cue-input-switch-height);--cue-icon-width: var(--cue-input-switch-icon-width);background:var(--cue-input-switch-background);transition:background-color .4s ease}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 12px;--cue-input-switch-inset: 1px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 14px;--cue-input-switch-inset: 1px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-inset: 2px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 22px;--cue-input-switch-inset: 3px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 28px;--cue-input-switch-inset: 3px}@container cue-container (width < 20em){[_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 10px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 12px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 18px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 20px}}.checked[_nghost-%COMP%]{background:var(--cue-input-switch-checked-background)}.disabled[_nghost-%COMP%]{background:var(--cue-input-switch-disabled-background);cursor:default}[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{pointer-events:none;position:absolute;left:var(--cue-input-switch-inset);top:var(--cue-input-switch-inset);width:var(--cue-input-switch-indicator-width);aspect-ratio:1;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:var(--cue-input-switch-indicator-background);color:var(--cue-input-switch-indicator-foreground);transition:left .4s ease,background-color .4s ease,color .4s ease}.checked[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{left:calc(var(--cue-input-switch-width) - var(--cue-input-switch-inset) - var( --cue-input-switch-indicator-width ));background:var(--cue-input-switch-checked-indicator-background);color:var(--cue-input-switch-checked-indicator-foreground)}.disabled[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{background:var(--cue-input-switch-disabled-indicator-background);color:var(--cue-input-switch-disabled-indicator-foreground)}input[_ngcontent-%COMP%]{all:unset;position:absolute;inset:0;cursor:pointer;border-radius:var(--cue-input-switch-height)}input[_ngcontent-%COMP%]:focus-visible:not(:disabled) + .indicator[_ngcontent-%COMP%]{outline:1px solid var(--cue-input-switch-focus-color);outline-offset:2px}"]})}return b})()},5745(U,E,m){"use strict";m.d(E,{a:()=>G});var f=m(7705),P=m(5802),d=m(2271),n=m(5547);const S=["dialog"],x=["*",[["","modal-footer",""]]],b=["*","[modal-footer]"];function C(g,R){if(1&g&&(n.rj2(0,"h2",7),n.EFF(1),n.eux()),2&g){const a=n.XpG(3);n.R7$(),n.JRh(a.effectiveTitle())}}function D(g,R){if(1&g&&(n.rj2(0,"p",8),n.EFF(1),n.eux()),2&g){const a=n.XpG(3);n.R7$(),n.JRh(a.subtitle())}}function M(g,R){if(1&g){const a=n.RV6();n.rj2(0,"button",10),n.VwU("click",function(){P.eBV(a);const $=n.XpG(3);return P.Njj($.onClose())}),P.qSk(),n.rj2(1,"svg",11),n.Hgh(2,"path",12),n.eux()()}}function p(g,R){if(1&g&&(n.rj2(0,"div",4)(1,"div",6),n.nVh(2,C,2,1,"h2",7),n.nVh(3,D,2,1,"p",8),n.eux(),n.nVh(4,M,3,0,"button",9),n.eux()),2&g){const a=n.XpG(2);n.R7$(2),n.vxM(a.effectiveTitle()?2:-1),n.R7$(),n.vxM(a.subtitle()?3:-1),n.R7$(),n.vxM(a.displayCloseBtn()?4:-1)}}function L(g,R){if(1&g&&(n.rj2(0,"div",3),n.VwU("click",function(O){return O.stopPropagation()}),n.nVh(1,p,5,3,"div",4),n.rj2(2,"div",5),n.SdG(3),n.eux(),n.SdG(4,1),n.eux()),2&g){const a=n.XpG();n.xc7("min-width",a.minWidth()),n.AVh("has-header",a.effectiveTitle()||a.displayCloseBtn()),n.R7$(),n.vxM(a.effectiveTitle()||a.displayCloseBtn()?1:-1)}}let G=(()=>{class g{visible=(0,f.geq)(!0);closeOnBackgroundClick=(0,f.hFB)(!0);displayCloseBtn=(0,f.hFB)(!0);label=(0,f.hFB)("");title=(0,f.hFB)("");subtitle=(0,f.hFB)("");minWidth=(0,f.hFB)();close=(0,f.CGW)();dialogRef=f.ebz.required("dialog");effectiveTitle=(0,d.EW)(()=>this.title()||this.label());constructor(){(0,P.QZP)(()=>{const a=this.dialogRef().nativeElement;this.visible()?a.open||a.showModal():a.open&&a.close()})}onBackdropClick(){this.closeOnBackgroundClick()&&this.onClose()}onClose(){this.visible.set(!1),this.close.emit()}static \u0275fac=function(O){return new(O||g)};static \u0275cmp=n.VBU({type:g,selectors:[["cue-modal"]],viewQuery:function(O,$){1&O&&n.wEZ($.dialogRef,S,5),2&O&&n.NyB()},inputs:{visible:[1,"visible"],closeOnBackgroundClick:[1,"closeOnBackgroundClick"],displayCloseBtn:[1,"displayCloseBtn"],label:[1,"label"],title:[1,"title"],subtitle:[1,"subtitle"],minWidth:[1,"minWidth"]},outputs:{visible:"visibleChange",close:"close"},ngContentSelectors:b,decls:3,vars:1,consts:[["dialog",""],[1,"modal-dialog",3,"cancel","click"],[1,"panel",3,"has-header","minWidth"],[1,"panel",3,"click"],[1,"header"],[1,"body"],[1,"header-text"],[1,"modal-title"],[1,"modal-subtitle"],["type","button","aria-label","Close",1,"close-btn"],["type","button","aria-label","Close",1,"close-btn",3,"click"],["viewBox","0 0 256 256","xmlns","http://www.w3.org/2000/svg"],["fill","currentColor","d","M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128L61.34 72.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z"]],template:function(O,$){1&O&&(n.NAR(x),n.rj2(0,"dialog",1,0),n.VwU("cancel",function(){return $.onClose()})("click",function(){return $.onBackdropClick()}),n.nVh(2,L,5,5,"div",2),n.eux()),2&O&&(n.R7$(2),n.vxM($.visible()?2:-1))},styles:[".modal-dialog[_ngcontent-%COMP%]{padding:0;border:none;background:transparent;overflow:visible;margin:auto;outline:none;max-width:min(calc(100vw - 32px),80vw)}.modal-dialog[_ngcontent-%COMP%]::backdrop{background-color:var(--cue-modal-overlay-color, rgba(14, 24, 39, .55));-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.panel[_ngcontent-%COMP%]{background:var(--cue-default);color:var(--cue-defaultContrast);border-radius:24px;border:1px solid var(--cue-border-color);box-shadow:0 12px 48px #00000047;max-height:88vh;overflow-y:auto;overflow-x:hidden;box-sizing:border-box;scrollbar-width:thin}.header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:12px;padding:26px 26px 0;margin-bottom:20px}.header-text[_ngcontent-%COMP%]{flex:1}.modal-title[_ngcontent-%COMP%]{margin:0;font-size:20px;font-weight:700;letter-spacing:-.01em;font-family:var(--cue-font-family);color:var(--cue-defaultContrast)}.modal-subtitle[_ngcontent-%COMP%]{margin:5px 0 0;font-size:13px;color:var(--cue-color-midgray);letter-spacing:.02em;line-height:1.5}.close-btn[_ngcontent-%COMP%]{flex:none;width:34px;height:34px;border-radius:50%;border:none;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--cue-color-midgray);padding:0;margin-top:-4px;transition:background .15s,color .15s}.close-btn[_ngcontent-%COMP%]:hover{background:var(--cue-main-background);color:var(--cue-main-foreground)}.close-btn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:18px;height:18px;display:block}.body[_ngcontent-%COMP%]{padding:26px}.has-header[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{padding-top:0}"]})}return g})()},7374(U){U.exports=function(){"use strict";var m=6e4,f=36e5,P="millisecond",d="second",n="minute",S="hour",x="day",b="week",C="month",D="quarter",M="year",p="date",L="Invalid Date",G=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(o){var i=["th","st","nd","rd"],t=o%100;return"["+o+(i[(t-20)%10]||i[t]||i[0])+"]"}},a=function(o,i,t){var c=String(o);return!c||c.length>=i?o:""+Array(i+1-c.length).join(t)+o},O={s:a,z:function(o){var i=-o.utcOffset(),t=Math.abs(i),c=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+a(c,2,"0")+":"+a(e,2,"0")},m:function o(i,t){if(i.date()<t.date())return-o(t,i);var c=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(c,C),r=t-e<0,s=i.clone().add(c+(r?-1:1),C);return+(-(c+(t-e)/(r?e-s:s-e))||0)},a:function(o){return o<0?Math.ceil(o)||0:Math.floor(o)},p:function(o){return{M:C,y:M,w:b,d:x,D:p,h:S,m:n,s:d,ms:P,Q:D}[o]||String(o||"").toLowerCase().replace(/s$/,"")},u:function(o){return void 0===o}},$="en",B={};B[$]=R;var I="$isDayjsObject",H=function(o){return o instanceof V||!(!o||!o[I])},j=function o(i,t,c){var e;if(!i)return $;if("string"==typeof i){var r=i.toLowerCase();B[r]&&(e=r),t&&(B[r]=t,e=r);var s=i.split("-");if(!e&&s.length>1)return o(s[0])}else{var l=i.name;B[l]=i,e=l}return!c&&e&&($=e),e||!c&&$},_=function(o,i){if(H(o))return o.clone();var t="object"==typeof i?i:{};return t.date=o,t.args=arguments,new V(t)},u=O;u.l=j,u.i=H,u.w=function(o,i){return _(o,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var V=function(){function o(t){this.$L=j(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[I]=!0}var i=o.prototype;return i.parse=function(t){this.$d=function(c){var e=c.date,r=c.utc;if(null===e)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(G);if(s){var l=s[2]-1||0,h=(s[7]||"0").substring(0,3);return r?new Date(Date.UTC(s[1],l,s[3]||1,s[4]||0,s[5]||0,s[6]||0,h)):new Date(s[1],l,s[3]||1,s[4]||0,s[5]||0,s[6]||0,h)}}return new Date(e)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==L},i.isSame=function(t,c){var e=_(t);return this.startOf(c)<=e&&e<=this.endOf(c)},i.isAfter=function(t,c){return _(t)<this.startOf(c)},i.isBefore=function(t,c){return this.endOf(c)<_(t)},i.$g=function(t,c,e){return u.u(t)?this[c]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,c){var e=this,r=!!u.u(c)||c,s=u.p(t),l=function(z,k){var T=u.w(e.$u?Date.UTC(e.$y,k,z):new Date(e.$y,k,z),e);return r?T:T.endOf(x)},h=function(z,k){return u.w(e.toDate()[z].apply(e.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(k)),e)},v=this.$W,w=this.$M,y=this.$D,Y="set"+(this.$u?"UTC":"");switch(s){case M:return r?l(1,0):l(31,11);case C:return r?l(1,w):l(0,w+1);case b:var W=this.$locale().weekStart||0,N=(v<W?v+7:v)-W;return l(r?y-N:y+(6-N),w);case x:case p:return h(Y+"Hours",0);case S:return h(Y+"Minutes",1);case n:return h(Y+"Seconds",2);case d:return h(Y+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,c){var e,r=u.p(t),s="set"+(this.$u?"UTC":""),l=(e={},e[x]=s+"Date",e[p]=s+"Date",e[C]=s+"Month",e[M]=s+"FullYear",e[S]=s+"Hours",e[n]=s+"Minutes",e[d]=s+"Seconds",e[P]=s+"Milliseconds",e)[r],h=r===x?this.$D+(c-this.$W):c;if(r===C||r===M){var v=this.clone().set(p,1);v.$d[l](h),v.init(),this.$d=v.set(p,Math.min(this.$D,v.daysInMonth())).$d}else l&&this.$d[l](h);return this.init(),this},i.set=function(t,c){return this.clone().$set(t,c)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,c){var e,r=this;t=Number(t);var s=u.p(c),l=function(w){var y=_(r);return u.w(y.date(y.date()+Math.round(w*t)),r)};if(s===C)return this.set(C,this.$M+t);if(s===M)return this.set(M,this.$y+t);if(s===x)return l(1);if(s===b)return l(7);var h=(e={},e[n]=m,e[S]=f,e[d]=1e3,e)[s]||1,v=this.$d.getTime()+t*h;return u.w(v,this)},i.subtract=function(t,c){return this.add(-1*t,c)},i.format=function(t){var c=this,e=this.$locale();if(!this.isValid())return e.invalidDate||L;var r=t||"YYYY-MM-DDTHH:mm:ssZ",s=u.z(this),l=this.$H,h=this.$m,v=this.$M,w=e.weekdays,y=e.months,W=function(k,T,F,A){return k&&(k[T]||k(c,r))||F[T].slice(0,A)},N=function(k){return u.s(l%12||12,k,"0")},z=e.meridiem||function(k,T,F){var A=k<12?"AM":"PM";return F?A.toLowerCase():A};return r.replace(g,function(k,T){return T||function(F){switch(F){case"YY":return String(c.$y).slice(-2);case"YYYY":return u.s(c.$y,4,"0");case"M":return v+1;case"MM":return u.s(v+1,2,"0");case"MMM":return W(e.monthsShort,v,y,3);case"MMMM":return W(y,v);case"D":return c.$D;case"DD":return u.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return W(e.weekdaysMin,c.$W,w,2);case"ddd":return W(e.weekdaysShort,c.$W,w,3);case"dddd":return w[c.$W];case"H":return String(l);case"HH":return u.s(l,2,"0");case"h":return N(1);case"hh":return N(2);case"a":return z(l,h,!0);case"A":return z(l,h,!1);case"m":return String(h);case"mm":return u.s(h,2,"0");case"s":return String(c.$s);case"ss":return u.s(c.$s,2,"0");case"SSS":return u.s(c.$ms,3,"0");case"Z":return s}return null}(k)||s.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,c,e){var r,s=this,l=u.p(c),h=_(t),v=(h.utcOffset()-this.utcOffset())*m,w=this-h,y=function(){return u.m(s,h)};switch(l){case M:r=y()/12;break;case C:r=y();break;case D:r=y()/3;break;case b:r=(w-v)/6048e5;break;case x:r=(w-v)/864e5;break;case S:r=w/f;break;case n:r=w/m;break;case d:r=w/1e3;break;default:r=w}return e?r:u.a(r)},i.daysInMonth=function(){return this.endOf(C).$D},i.$locale=function(){return B[this.$L]},i.locale=function(t,c){if(!t)return this.$L;var e=this.clone(),r=j(t,c,!0);return r&&(e.$L=r),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},o}(),K=V.prototype;return _.prototype=K,[["$ms",P],["$s",d],["$m",n],["$H",S],["$W",x],["$M",C],["$y",M],["$D",p]].forEach(function(o){K[o[1]]=function(i){return this.$g(i,o[0],o[1])}}),_.extend=function(o,i){return o.$i||(o(i,V,_),o.$i=!0),_},_.locale=j,_.isDayjs=H,_.unix=function(o){return _(1e3*o)},_.en=B[$],_.Ls=B,_.p={},_}()}}]);
|
package/5559.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[5559],{3319(C,M,r){r.d(M,{a:()=>f});var o=r(7705),e=r(29),a=r(5547);let f=(()=>{class m{icon=(0,o.hFB)(void 0);slot=(0,o.hFB)("before");static \u0275fac=function(l){return new(l||m)};static \u0275cmp=a.VBU({type:m,selectors:[["cue-button-icon"]],inputs:{icon:[1,"icon"],slot:[1,"slot"]},decls:1,vars:2,consts:[[3,"slot","name"]],template:function(l,_){1&l&&a.nrm(0,"cue-svg-icon",0),2&l&&a.Y8G("slot",_.slot())("name",_.icon())},dependencies:[e.A],encapsulation:2})}return m})()},5971(C,M,r){r.d(M,{$:()=>_});var o=r(9769),e=r(7705),a=r(2271),f=r(7089),m=r(2403),d=r(5547);const h=["buttonElement"],l=["*"];let _=(()=>{class g{variant=(0,e.hFB)("primary");size=(0,e.hFB)("m");tooltip=(0,e.hFB)("");disabled=(0,e.hFB)(!1);selected=(0,e.geq)(!1);toggleButton=(0,e.hFB)(!1);loading=(0,e.hFB)(!1);fitParentWidth=(0,e.hFB)(!1);noWrap=(0,e.hFB)(!0);buttonElement=e.ebz.required("buttonElement");getStyles=(0,a.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(v){v.detail>0&&this.buttonElement().nativeElement.blur(),this.toggleButton()&&(v.stopPropagation(),this.selected.set(!this.selected()))}static \u0275fac=function(p){return new(p||g)};static \u0275cmp=d.VBU({type:g,selectors:[["cue-button"]],viewQuery:function(p,c){1&p&&d.wEZ(c.buttonElement,h,5),2&p&&d.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:l,decls:3,vars:18,consts:[["buttonElement",""],["tooltipSize","small",3,"click","disabled","cueTooltip","tooltipPlacement","cuePulse"]],template:function(p,c){1&p&&(d.NAR(),d.j41(0,"button",1,0),d.bIt("click",function(u){return c.handleClick(u)}),d.SdG(2),d.k0s()),2&p&&(d.Aen(c.getStyles()),d.xc7("white-space",c.noWrap()?"nowrap":"normal")("flex-basis",c.noWrap()?null:"auto")("min-width",c.noWrap()?null:"fit-content"),d.AVh("selected",c.selected())("ghost","ghost"===c.variant())("fit-parent-width",c.fitParentWidth()),d.Y8G("disabled",c.disabled())("cueTooltip",c.tooltip())("tooltipPlacement","top")("cuePulse",c.loading()))},dependencies:[o.MD,f.d,m.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 g})()},5559(C,M,r){r.d(M,{I:()=>x});var o=r(5802),e=r(5547),a=r(7705),f=r(2271),m=r(5971),d=r(3319),h=r(7089);let l=(()=>{class u{element;enabled=(0,a.hFB)(!1,{alias:"cueAutoMultiline"});value=(0,a.hFB)("",{alias:"autoMultilineValue"});buttonOffset=(0,a.hFB)(0,{alias:"autoMultilineButtonOffset"});shouldSwitchToMultiline=(0,a.CGW)();multilinePasted=(0,a.CGW)();measureSpan;hasSwitched=!1;constructor(t){this.element=t,(0,o.QZP)(()=>{this.value();this.enabled()&&this.measureSpan&&!this.hasSwitched&&setTimeout(()=>this.checkOverflow(),0)})}ngAfterViewInit(){this.enabled()&&(this.createMeasurementSpan(),setTimeout(()=>this.checkOverflow(),0))}onPaste(t){if(!this.enabled()||this.hasSwitched)return;const n=t.clipboardData?.getData("text");if(n&&n.includes("\n")){t.preventDefault();const i=this.element.nativeElement,s=i.selectionStart||0,b=i.value,E=b.substring(0,s)+n+b.substring(i.selectionEnd||s);this.hasSwitched=!0,this.multilinePasted.emit(E)}}createMeasurementSpan(){this.measureSpan=document.createElement("span"),this.measureSpan.style.position="absolute",this.measureSpan.style.visibility="hidden",this.measureSpan.style.whiteSpace="nowrap",this.measureSpan.style.pointerEvents="none";const t=this.element.nativeElement,n=window.getComputedStyle(t);this.measureSpan.style.font=n.font,this.measureSpan.style.padding=n.padding,t.parentElement?.appendChild(this.measureSpan)}checkOverflow(){if(!this.enabled()||!this.measureSpan||this.hasSwitched)return;const t=this.element.nativeElement;this.measureSpan.textContent=this.value(),this.measureSpan.offsetWidth>t.offsetWidth-this.buttonOffset()&&(this.hasSwitched=!0,this.shouldSwitchToMultiline.emit())}ngOnDestroy(){this.measureSpan&&this.measureSpan.remove()}static \u0275fac=function(n){return new(n||u)(e.rXU(e.aKT))};static \u0275dir=e.FsC({type:u,selectors:[["","cueAutoMultiline",""]],hostBindings:function(n,i){1&n&&e.bIt("paste",function(b){return i.onPaste(b)})},inputs:{enabled:[1,"cueAutoMultiline","enabled"],value:[1,"autoMultilineValue","value"],buttonOffset:[1,"autoMultilineButtonOffset","buttonOffset"]},outputs:{shouldSwitchToMultiline:"shouldSwitchToMultiline",multilinePasted:"multilinePasted"}})}return u})(),_=(()=>{class u{element;enabled=(0,a.hFB)(!0,{alias:"cueShiftEnter"});shiftEnterPressed=(0,a.CGW)();constructor(t){this.element=t}onKeyDown(t){if(this.enabled()&&"Enter"===t.key&&t.shiftKey){t.preventDefault();const n=this.element.nativeElement,i=n.selectionStart||0,s=n.value,b=s.substring(0,i)+"\n"+s.substring(i);this.shiftEnterPressed.emit({newValue:b,cursorPosition:i+1})}}static \u0275fac=function(n){return new(n||u)(e.rXU(e.aKT))};static \u0275dir=e.FsC({type:u,selectors:[["","cueShiftEnter",""]],hostBindings:function(n,i){1&n&&e.bIt("keydown",function(b){return i.onKeyDown(b)})},inputs:{enabled:[1,"cueShiftEnter","enabled"]},outputs:{shiftEnterPressed:"shiftEnterPressed"}})}return u})();const g=["inputElement"],P=["textareaElement"];function v(u,S){if(1&u){const t=e.RV6();e.j41(0,"input",4,0),e.mxI("valueChange",function(i){o.eBV(t);const s=e.XpG();return e.DH7(s.value,i)||(s.value=i),o.Njj(i)}),e.bIt("shiftEnterPressed",function(i){o.eBV(t);const s=e.XpG();return o.Njj(s.handleShiftEnter(i))})("shouldSwitchToMultiline",function(){o.eBV(t);const i=e.XpG();return o.Njj(i.switchToMultiline())})("multilinePasted",function(i){o.eBV(t);const s=e.XpG();return o.Njj(s.handleMultilinePaste(i))})("keyup",function(i){o.eBV(t);const s=e.XpG();return o.Njj(s.update(i))})("input",function(i){o.eBV(t);const s=e.XpG();return o.Njj(s.update(i))}),e.k0s()}if(2&u){const t=e.XpG();e.R50("value",t.value),e.Y8G("placeholder",t.placeholder())("cueShiftEnter",t.responsiveMode())("cueAutoMultiline",t.responsiveMode())("autoMultilineValue",t.value())("autoMultilineButtonOffset",t.showSubmitButton()?60:0)}}function p(u,S){if(1&u){const t=e.RV6();e.j41(0,"textarea",5,1),e.mxI("valueChange",function(i){o.eBV(t);const s=e.XpG();return e.DH7(s.value,i)||(s.value=i),o.Njj(i)}),e.bIt("keyup",function(i){o.eBV(t);const s=e.XpG();return o.Njj(s.update(i))}),e.k0s(),e.j41(2,"div",6),e.bIt("mousedown",function(i){o.eBV(t);const s=e.XpG();return o.Njj(s.startDrag(i))}),e.nrm(3,"div",7),e.k0s()}if(2&u){const t=e.XpG();e.R50("value",t.value),e.Y8G("placeholder",t.placeholder())}}function c(u,S){if(1&u){const t=e.RV6();e.j41(0,"cue-button",8),e.bIt("click",function(){o.eBV(t);const i=e.XpG();return o.Njj(i.searchInProgress()?i.cancel():i.submit())}),e.nrm(1,"cue-button-icon",9),e.k0s()}if(2&u){const t=e.XpG();e.AVh("multiline-button",t.effectiveMultiLineMode()),e.Y8G("variant",t.buttonVariant())("size",t.buttonSize())("cueTooltip",t.buttonTooltip()),e.R7$(),e.Y8G("icon",t.searchInProgress()?t.cancelIcon():t.submitIcon())}}let x=(()=>{class u{renderer=(0,o.WQX)(e.sFG);placeholder=(0,a.hFB)("Search...");value=(0,a.geq)("");searchInProgress=(0,a.geq)(!1);searchFailed=(0,a.hFB)(!1);size=(0,a.hFB)("l");debounceTime=(0,a.hFB)(200);variant=(0,a.hFB)("secondary");showSubmitButton=(0,a.hFB)(!0);submitIcon=(0,a.hFB)("search");cancelIcon=(0,a.hFB)("close");buttonTooltip=(0,a.hFB)("");buttonVariant=(0,a.hFB)("accent");multiLineMode=(0,a.hFB)(!1);responsiveMode=(0,a.hFB)(!1);autoMultiLineMode=(0,o.vPA)(!1);effectiveMultiLineMode=(0,f.EW)(()=>this.multiLineMode()||this.responsiveMode()&&this.autoMultiLineMode());inputElement=(0,a.ebz)("inputElement");textareaElement=(0,a.ebz)("textareaElement");valueChange=(0,a.CGW)();valueSubmit=(0,a.CGW)();_debounceTimer;_value="";isDragging=(0,o.vPA)(!1);dragStartY=0;dragStartHeight=0;constructor(){(0,o.QZP)(()=>{this.effectiveMultiLineMode()&&this.responsiveMode()&&setTimeout(()=>{const n=this.textareaElement()?.nativeElement;if(n){n.focus();const i=n.value.length;n.setSelectionRange(i,i)}},0)}),(0,o.QZP)(()=>{this.value();const n=this.textareaElement()?.nativeElement;if(n&&this.effectiveMultiLineMode()){n.style.height="auto";const i=Math.min(n.scrollHeight,250);n.style.height=`${i}px`}})}startDrag(t){t.preventDefault();const n=this.textareaElement()?.nativeElement;if(!n)return;this.isDragging.set(!0),this.dragStartY=t.clientY;const i=window.getComputedStyle(n),s=parseFloat(i.height);this.dragStartHeight=s,n.style.height=`${s}px`;const b=this.onDragMove.bind(this),E=this.onDragEnd.bind(this);this.renderer.listen("document","mousemove",b);const B=this.renderer.listen("document","mouseup",y=>{E(y),B()})}onDragMove(t){if(!this.isDragging())return;const n=this.textareaElement()?.nativeElement;if(!n)return;const s=Math.max(64,this.dragStartHeight+(t.clientY-this.dragStartY));n.style.height=`${s}px`}onDragEnd(t){this.isDragging.set(!1)}switchToMultiline(){this.autoMultiLineMode.set(!0)}handleShiftEnter(t){this.value.set(t.newValue),this._value=t.newValue,this.autoMultiLineMode.set(!0),setTimeout(()=>{const n=this.textareaElement()?.nativeElement;n&&(n.focus(),n.setSelectionRange(t.cursorPosition,t.cursorPosition))},0)}handleMultilinePaste(t){this.value.set(t),this._value=t,this.autoMultiLineMode.set(!0),setTimeout(()=>{const n=this.textareaElement()?.nativeElement;if(n){n.focus();const i=n.value.length;n.setSelectionRange(i,i)}},0)}handleEnterKey(){this.multiLineMode()||this.responsiveMode()&&this.effectiveMultiLineMode()||this.submit()}update(t){this._value=t.target.value,this.value.set(this._value),clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this.valueChange.emit(this._value)},this.debounceTime())}submit(){this.valueSubmit.emit(this._value);const t=this.textareaElement()?.nativeElement;t&&(t.style.height="")}cancel(){this._value="",this.searchInProgress.set(!1),this.valueChange.emit(this._value)}buttonSize=(0,f.EW)(()=>"s"===this.size()?"xs":"m");hostStyles=(0,f.EW)(()=>{const n="s"===this.size()?"--height: calc(32rem / 16); --search-button-right: calc(4rem / 16); --search-input-padding-x: 1em; --search-font-size: 0.875em;":"";return`\n color: var(--cue-${this.variant()}Contrast);\n background-color: var(--cue-${this.variant()});\n ${n}\n `});static \u0275fac=function(n){return new(n||u)};static \u0275cmp=e.VBU({type:u,selectors:[["cue-search-bar"]],viewQuery:function(n,i){1&n&&e.wEZ(i.inputElement,g,5)(i.textareaElement,P,5),2&n&&e.NyB(2)},hostVars:6,hostBindings:function(n,i){1&n&&e.bIt("keydown.enter",function(){return i.handleEnterKey()},e.EBC),2&n&&(e.Aen(i.hostStyles()),e.AVh("pulsing",i.searchInProgress()&&!i.searchFailed())("failed",i.searchFailed()))},inputs:{placeholder:[1,"placeholder"],value:[1,"value"],searchInProgress:[1,"searchInProgress"],searchFailed:[1,"searchFailed"],size:[1,"size"],debounceTime:[1,"debounceTime"],variant:[1,"variant"],showSubmitButton:[1,"showSubmitButton"],submitIcon:[1,"submitIcon"],cancelIcon:[1,"cancelIcon"],buttonTooltip:[1,"buttonTooltip"],buttonVariant:[1,"buttonVariant"],multiLineMode:[1,"multiLineMode"],responsiveMode:[1,"responsiveMode"]},outputs:{value:"valueChange",searchInProgress:"searchInProgressChange",valueChange:"valueChange",valueSubmit:"valueSubmit"},decls:3,vars:2,consts:[["inputElement",""],["textareaElement",""],["type","text",1,"search-input",3,"value","placeholder","cueShiftEnter","cueAutoMultiline","autoMultilineValue","autoMultilineButtonOffset"],[1,"search-button",3,"multiline-button","variant","size","cueTooltip"],["type","text",1,"search-input",3,"valueChange","shiftEnterPressed","shouldSwitchToMultiline","multilinePasted","keyup","input","value","placeholder","cueShiftEnter","cueAutoMultiline","autoMultilineValue","autoMultilineButtonOffset"],["rows","1",1,"search-input","multiline",3,"valueChange","keyup","value","placeholder"],[1,"drag-handle",3,"mousedown"],[1,"drag-handle-icon"],[1,"search-button",3,"click","variant","size","cueTooltip"],[3,"icon"]],template:function(n,i){1&n&&(e.nVh(0,v,2,6,"input",2)(1,p,4,2),e.nVh(2,c,2,6,"cue-button",3)),2&n&&(e.vxM(i.effectiveMultiLineMode()?1:0),e.R7$(2),e.vxM(i.showSubmitButton()?2:-1))},dependencies:[m.$,d.a,h.d,l,_],styles:['[_nghost-%COMP%]{--height: 4rem ;border-radius:var(--height);font-family:var(--cue-font-family);position:relative;height:var(--height);display:flex;align-items:stretch}@container cue-container (width < 20em){[_nghost-%COMP%]{--height: 2.125rem }}[_nghost-%COMP%]:has(textarea.multiline){border-radius:1.25rem;min-height:var(--height);height:auto}.pulsing[_nghost-%COMP%]{animation:pulse-border 1.5s infinite ease-in-out}.failed[_nghost-%COMP%]{animation:_ngcontent-%COMP%_pulse-border-red 1.5s infinite ease-in-out}@keyframes _ngcontent-%COMP%_pulse-border-red{0%,to{box-shadow:0 0 #ef444466}50%{box-shadow:0 0 0 8px #ef44441a}}cue-button[_ngcontent-%COMP%]{position:absolute;right:var(--search-button-right, .625em);top:50%;transform:translateY(-50%)}cue-button.multiline-button[_ngcontent-%COMP%]{bottom:.625em;top:auto;transform:none}@container cue-container (width < 20em){cue-button[_ngcontent-%COMP%]{right:.25em}cue-button.multiline-button[_ngcontent-%COMP%]{bottom:.25em}}cue-typography[_ngcontent-%COMP%]{display:contents}cue-typography[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:1;display:flex;align-items:stretch}input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{all:unset;font:inherit;font-size:var(--search-font-size, 1em);padding:0 var(--search-input-padding-x, 2em);flex:1;min-width:0;width:100%;height:100%;background-color:transparent;color:inherit;border-radius:4rem}input[_ngcontent-%COMP%]:focus-visible, textarea[_ngcontent-%COMP%]:focus-visible{outline:1px solid currentColor;outline-offset:2px}input[_ngcontent-%COMP%]::placeholder, textarea[_ngcontent-%COMP%]::placeholder{color:currentColor;opacity:.6}input[_ngcontent-%COMP%]::-ms-input-placeholder, textarea[_ngcontent-%COMP%]::-ms-input-placeholder{color:currentColor}@container cue-container (width < 20em){input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{padding:0 1em}}textarea.multiline[_ngcontent-%COMP%]{font-size:.875em;line-height:1.5;padding:1em 4em 2em 2em;resize:none;min-height:var(--height);border-radius:1.25rem;box-sizing:border-box;overflow-y:auto;scrollbar-gutter:stable}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar{width:10px}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#ffffff1a;border-top:28px solid transparent;border-bottom:28px solid transparent;background-clip:content-box}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:#fff6;border-radius:5px;border:2px solid transparent;background-clip:content-box}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background-color:#ffffff80}@container cue-container (width < 20em){textarea.multiline[_ngcontent-%COMP%]{padding:.75em 3em 1.75em 1em}}.drag-handle[_ngcontent-%COMP%]{position:absolute;bottom:4px;left:50%;transform:translate(-50%);width:48px;height:24px;display:flex;align-items:center;justify-content:center;cursor:ns-resize;z-index:2;transition:opacity .2s ease;opacity:.6}.drag-handle[_ngcontent-%COMP%]:hover, .drag-handle[_ngcontent-%COMP%]:active{opacity:1}.drag-handle-icon[_ngcontent-%COMP%]{position:relative;width:24px;height:12px}.drag-handle-icon[_ngcontent-%COMP%]:before, .drag-handle-icon[_ngcontent-%COMP%]:after{content:"";position:absolute;width:16px;height:2px;background-color:currentColor;border-radius:1px;left:50%;transform:translate(-50%)}.drag-handle-icon[_ngcontent-%COMP%]:before{top:2px}.drag-handle-icon[_ngcontent-%COMP%]:after{bottom:2px}'],changeDetection:0})}return u})()},2403(C,M,r){r.d(M,{V:()=>f});var o=r(7705),e=r(5547),a=r(5802);let f=(()=>{class m{el=(0,a.WQX)(e.aKT);renderer=(0,a.WQX)(e.sFG);cuePulse=(0,o.hFB)(!1);cuePulseColor=(0,o.hFB)("");cuePulseMode=(0,o.hFB)("border");activeClass="";constructor(){this.ensureGlobalStyles()}onPulseChanged=(0,a.QZP)(()=>{const h=this.cuePulse(),l=this.cuePulseColor(),_=this.cuePulseMode(),g=this.el.nativeElement;if(this.activeClass&&(this.renderer.removeClass(g,this.activeClass),this.activeClass=""),this.renderer.removeStyle(g,"--cue-pulse-color"),this.renderer.removeStyle(g,"border-radius"),h){const P="text"===_?"cue-pulse-text":"cue-pulse-border";this.renderer.addClass(g,P),this.activeClass=P,l&&this.renderer.setStyle(g,"--cue-pulse-color",l),"border"===_&&setTimeout(()=>{const v=g.firstElementChild;if(v){const p=getComputedStyle(v).borderRadius;p&&"0px"!==p&&this.renderer.setStyle(g,"border-radius",p)}})}});ngOnDestroy(){const h=this.el.nativeElement;this.activeClass&&this.renderer.removeClass(h,this.activeClass),this.renderer.removeStyle(h,"border-radius")}ensureGlobalStyles(){const h="cue-pulse-global-styles";if(document.getElementById(h))return;const l=document.createElement("style");l.id=h,l.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(l)}static \u0275fac=function(l){return new(l||m)};static \u0275dir=e.FsC({type:m,selectors:[["","cuePulse",""]],inputs:{cuePulse:[1,"cuePulse"],cuePulseColor:[1,"cuePulseColor"],cuePulseMode:[1,"cuePulseMode"]}})}return m})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[5559],{5559(y,m,l){l.d(m,{I:()=>P});var o=l(5802),i=l(5547),s=l(7705),c=l(2271),g=l(5971),p=l(3319),f=l(7089);let b=(()=>{class r{element;enabled=(0,s.hFB)(!1,{alias:"cueAutoMultiline"});value=(0,s.hFB)("",{alias:"autoMultilineValue"});buttonOffset=(0,s.hFB)(0,{alias:"autoMultilineButtonOffset"});shouldSwitchToMultiline=(0,s.CGW)();multilinePasted=(0,s.CGW)();measureSpan;hasSwitched=!1;constructor(e){this.element=e,(0,o.QZP)(()=>{this.value();this.enabled()&&this.measureSpan&&!this.hasSwitched&&setTimeout(()=>this.checkOverflow(),0)})}ngAfterViewInit(){this.enabled()&&(this.createMeasurementSpan(),setTimeout(()=>this.checkOverflow(),0))}onPaste(e){if(!this.enabled()||this.hasSwitched)return;const t=e.clipboardData?.getData("text");if(t&&t.includes("\n")){e.preventDefault();const n=this.element.nativeElement,a=n.selectionStart||0,u=n.value,h=u.substring(0,a)+t+u.substring(n.selectionEnd||a);this.hasSwitched=!0,this.multilinePasted.emit(h)}}createMeasurementSpan(){this.measureSpan=document.createElement("span"),this.measureSpan.style.position="absolute",this.measureSpan.style.visibility="hidden",this.measureSpan.style.whiteSpace="nowrap",this.measureSpan.style.pointerEvents="none";const e=this.element.nativeElement,t=window.getComputedStyle(e);this.measureSpan.style.font=t.font,this.measureSpan.style.padding=t.padding,e.parentElement?.appendChild(this.measureSpan)}checkOverflow(){if(!this.enabled()||!this.measureSpan||this.hasSwitched)return;const e=this.element.nativeElement;this.measureSpan.textContent=this.value(),this.measureSpan.offsetWidth>e.offsetWidth-this.buttonOffset()&&(this.hasSwitched=!0,this.shouldSwitchToMultiline.emit())}ngOnDestroy(){this.measureSpan&&this.measureSpan.remove()}static \u0275fac=function(t){return new(t||r)(i.rXU(i.aKT))};static \u0275dir=i.FsC({type:r,selectors:[["","cueAutoMultiline",""]],hostBindings:function(t,n){1&t&&i.bIt("paste",function(u){return n.onPaste(u)})},inputs:{enabled:[1,"cueAutoMultiline","enabled"],value:[1,"autoMultilineValue","value"],buttonOffset:[1,"autoMultilineButtonOffset","buttonOffset"]},outputs:{shouldSwitchToMultiline:"shouldSwitchToMultiline",multilinePasted:"multilinePasted"}})}return r})(),v=(()=>{class r{element;enabled=(0,s.hFB)(!0,{alias:"cueShiftEnter"});shiftEnterPressed=(0,s.CGW)();constructor(e){this.element=e}onKeyDown(e){if(this.enabled()&&"Enter"===e.key&&e.shiftKey){e.preventDefault();const t=this.element.nativeElement,n=t.selectionStart||0,a=t.value,u=a.substring(0,n)+"\n"+a.substring(n);this.shiftEnterPressed.emit({newValue:u,cursorPosition:n+1})}}static \u0275fac=function(t){return new(t||r)(i.rXU(i.aKT))};static \u0275dir=i.FsC({type:r,selectors:[["","cueShiftEnter",""]],hostBindings:function(t,n){1&t&&i.bIt("keydown",function(u){return n.onKeyDown(u)})},inputs:{enabled:[1,"cueShiftEnter","enabled"]},outputs:{shiftEnterPressed:"shiftEnterPressed"}})}return r})();const M=["inputElement"],_=["textareaElement"];function S(r,d){if(1&r){const e=i.RV6();i.j41(0,"input",4,0),i.mxI("valueChange",function(n){o.eBV(e);const a=i.XpG();return i.DH7(a.value,n)||(a.value=n),o.Njj(n)}),i.bIt("shiftEnterPressed",function(n){o.eBV(e);const a=i.XpG();return o.Njj(a.handleShiftEnter(n))})("shouldSwitchToMultiline",function(){o.eBV(e);const n=i.XpG();return o.Njj(n.switchToMultiline())})("multilinePasted",function(n){o.eBV(e);const a=i.XpG();return o.Njj(a.handleMultilinePaste(n))})("keyup",function(n){o.eBV(e);const a=i.XpG();return o.Njj(a.update(n))})("input",function(n){o.eBV(e);const a=i.XpG();return o.Njj(a.update(n))}),i.k0s()}if(2&r){const e=i.XpG();i.R50("value",e.value),i.Y8G("placeholder",e.placeholder())("cueShiftEnter",e.responsiveMode())("cueAutoMultiline",e.responsiveMode())("autoMultilineValue",e.value())("autoMultilineButtonOffset",e.showSubmitButton()?60:0)}}function x(r,d){if(1&r){const e=i.RV6();i.j41(0,"textarea",5,1),i.mxI("valueChange",function(n){o.eBV(e);const a=i.XpG();return i.DH7(a.value,n)||(a.value=n),o.Njj(n)}),i.bIt("keyup",function(n){o.eBV(e);const a=i.XpG();return o.Njj(a.update(n))}),i.k0s(),i.j41(2,"div",6),i.bIt("mousedown",function(n){o.eBV(e);const a=i.XpG();return o.Njj(a.startDrag(n))}),i.nrm(3,"div",7),i.k0s()}if(2&r){const e=i.XpG();i.R50("value",e.value),i.Y8G("placeholder",e.placeholder())}}function C(r,d){if(1&r){const e=i.RV6();i.j41(0,"cue-button",8),i.bIt("click",function(){o.eBV(e);const n=i.XpG();return o.Njj(n.searchInProgress()?n.cancel():n.submit())}),i.nrm(1,"cue-button-icon",9),i.k0s()}if(2&r){const e=i.XpG();i.AVh("multiline-button",e.effectiveMultiLineMode()),i.Y8G("variant",e.buttonVariant())("size",e.buttonSize())("cueTooltip",e.buttonTooltip()),i.R7$(),i.Y8G("icon",e.searchInProgress()?e.cancelIcon():e.submitIcon())}}let P=(()=>{class r{renderer=(0,o.WQX)(i.sFG);placeholder=(0,s.hFB)("Search...");value=(0,s.geq)("");searchInProgress=(0,s.geq)(!1);searchFailed=(0,s.hFB)(!1);size=(0,s.hFB)("l");debounceTime=(0,s.hFB)(200);variant=(0,s.hFB)("secondary");showSubmitButton=(0,s.hFB)(!0);submitIcon=(0,s.hFB)("search");cancelIcon=(0,s.hFB)("close");buttonTooltip=(0,s.hFB)("");buttonVariant=(0,s.hFB)("accent");multiLineMode=(0,s.hFB)(!1);responsiveMode=(0,s.hFB)(!1);autoMultiLineMode=(0,o.vPA)(!1);effectiveMultiLineMode=(0,c.EW)(()=>this.multiLineMode()||this.responsiveMode()&&this.autoMultiLineMode());inputElement=(0,s.ebz)("inputElement");textareaElement=(0,s.ebz)("textareaElement");valueChange=(0,s.CGW)();valueSubmit=(0,s.CGW)();_debounceTimer;_value="";isDragging=(0,o.vPA)(!1);dragStartY=0;dragStartHeight=0;constructor(){(0,o.QZP)(()=>{this.effectiveMultiLineMode()&&this.responsiveMode()&&setTimeout(()=>{const t=this.textareaElement()?.nativeElement;if(t){t.focus();const n=t.value.length;t.setSelectionRange(n,n)}},0)}),(0,o.QZP)(()=>{this.value();const t=this.textareaElement()?.nativeElement;if(t&&this.effectiveMultiLineMode()){t.style.height="auto";const n=Math.min(t.scrollHeight,250);t.style.height=`${n}px`}})}startDrag(e){e.preventDefault();const t=this.textareaElement()?.nativeElement;if(!t)return;this.isDragging.set(!0),this.dragStartY=e.clientY;const n=window.getComputedStyle(t),a=parseFloat(n.height);this.dragStartHeight=a,t.style.height=`${a}px`;const u=this.onDragMove.bind(this),h=this.onDragEnd.bind(this);this.renderer.listen("document","mousemove",u);const w=this.renderer.listen("document","mouseup",B=>{h(B),w()})}onDragMove(e){if(!this.isDragging())return;const t=this.textareaElement()?.nativeElement;if(!t)return;const a=Math.max(64,this.dragStartHeight+(e.clientY-this.dragStartY));t.style.height=`${a}px`}onDragEnd(e){this.isDragging.set(!1)}switchToMultiline(){this.autoMultiLineMode.set(!0)}handleShiftEnter(e){this.value.set(e.newValue),this._value=e.newValue,this.autoMultiLineMode.set(!0),setTimeout(()=>{const t=this.textareaElement()?.nativeElement;t&&(t.focus(),t.setSelectionRange(e.cursorPosition,e.cursorPosition))},0)}handleMultilinePaste(e){this.value.set(e),this._value=e,this.autoMultiLineMode.set(!0),setTimeout(()=>{const t=this.textareaElement()?.nativeElement;if(t){t.focus();const n=t.value.length;t.setSelectionRange(n,n)}},0)}handleEnterKey(){this.multiLineMode()||this.responsiveMode()&&this.effectiveMultiLineMode()||this.submit()}update(e){this._value=e.target.value,this.value.set(this._value),clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this.valueChange.emit(this._value)},this.debounceTime())}submit(){this.valueSubmit.emit(this._value);const e=this.textareaElement()?.nativeElement;e&&(e.style.height="")}cancel(){this._value="",this.searchInProgress.set(!1),this.valueChange.emit(this._value)}buttonSize=(0,c.EW)(()=>"s"===this.size()?"xs":"m");hostStyles=(0,c.EW)(()=>{const t="s"===this.size()?"--height: calc(32rem / 16); --search-button-right: calc(4rem / 16); --search-input-padding-x: 1em; --search-font-size: 0.875em;":"";return`\n color: var(--cue-${this.variant()}Contrast);\n background-color: var(--cue-${this.variant()});\n ${t}\n `});static \u0275fac=function(t){return new(t||r)};static \u0275cmp=i.VBU({type:r,selectors:[["cue-search-bar"]],viewQuery:function(t,n){1&t&&i.wEZ(n.inputElement,M,5)(n.textareaElement,_,5),2&t&&i.NyB(2)},hostVars:6,hostBindings:function(t,n){1&t&&i.bIt("keydown.enter",function(){return n.handleEnterKey()},i.EBC),2&t&&(i.Aen(n.hostStyles()),i.AVh("pulsing",n.searchInProgress()&&!n.searchFailed())("failed",n.searchFailed()))},inputs:{placeholder:[1,"placeholder"],value:[1,"value"],searchInProgress:[1,"searchInProgress"],searchFailed:[1,"searchFailed"],size:[1,"size"],debounceTime:[1,"debounceTime"],variant:[1,"variant"],showSubmitButton:[1,"showSubmitButton"],submitIcon:[1,"submitIcon"],cancelIcon:[1,"cancelIcon"],buttonTooltip:[1,"buttonTooltip"],buttonVariant:[1,"buttonVariant"],multiLineMode:[1,"multiLineMode"],responsiveMode:[1,"responsiveMode"]},outputs:{value:"valueChange",searchInProgress:"searchInProgressChange",valueChange:"valueChange",valueSubmit:"valueSubmit"},decls:3,vars:2,consts:[["inputElement",""],["textareaElement",""],["type","text",1,"search-input",3,"value","placeholder","cueShiftEnter","cueAutoMultiline","autoMultilineValue","autoMultilineButtonOffset"],[1,"search-button",3,"multiline-button","variant","size","cueTooltip"],["type","text",1,"search-input",3,"valueChange","shiftEnterPressed","shouldSwitchToMultiline","multilinePasted","keyup","input","value","placeholder","cueShiftEnter","cueAutoMultiline","autoMultilineValue","autoMultilineButtonOffset"],["rows","1",1,"search-input","multiline",3,"valueChange","keyup","value","placeholder"],[1,"drag-handle",3,"mousedown"],[1,"drag-handle-icon"],[1,"search-button",3,"click","variant","size","cueTooltip"],[3,"icon"]],template:function(t,n){1&t&&(i.nVh(0,S,2,6,"input",2)(1,x,4,2),i.nVh(2,C,2,6,"cue-button",3)),2&t&&(i.vxM(n.effectiveMultiLineMode()?1:0),i.R7$(2),i.vxM(n.showSubmitButton()?2:-1))},dependencies:[g.$,p.a,f.d,b,v],styles:['[_nghost-%COMP%]{--height: 4rem ;border-radius:var(--height);font-family:var(--cue-font-family);position:relative;height:var(--height);display:flex;align-items:stretch}@container cue-container (width < 20em){[_nghost-%COMP%]{--height: 2.125rem }}[_nghost-%COMP%]:has(textarea.multiline){border-radius:1.25rem;min-height:var(--height);height:auto}.pulsing[_nghost-%COMP%]{animation:pulse-border 1.5s infinite ease-in-out}.failed[_nghost-%COMP%]{animation:_ngcontent-%COMP%_pulse-border-red 1.5s infinite ease-in-out}@keyframes _ngcontent-%COMP%_pulse-border-red{0%,to{box-shadow:0 0 #ef444466}50%{box-shadow:0 0 0 8px #ef44441a}}cue-button[_ngcontent-%COMP%]{position:absolute;right:var(--search-button-right, .625em);top:50%;transform:translateY(-50%)}cue-button.multiline-button[_ngcontent-%COMP%]{bottom:.625em;top:auto;transform:none}@container cue-container (width < 20em){cue-button[_ngcontent-%COMP%]{right:.25em}cue-button.multiline-button[_ngcontent-%COMP%]{bottom:.25em}}cue-typography[_ngcontent-%COMP%]{display:contents}cue-typography[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:1;display:flex;align-items:stretch}input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{all:unset;font:inherit;font-size:var(--search-font-size, 1em);padding:0 var(--search-input-padding-x, 2em);flex:1;min-width:0;width:100%;height:100%;background-color:transparent;color:inherit;border-radius:4rem}input[_ngcontent-%COMP%]:focus-visible, textarea[_ngcontent-%COMP%]:focus-visible{outline:1px solid currentColor;outline-offset:2px}input[_ngcontent-%COMP%]::placeholder, textarea[_ngcontent-%COMP%]::placeholder{color:currentColor;opacity:.6}input[_ngcontent-%COMP%]::-ms-input-placeholder, textarea[_ngcontent-%COMP%]::-ms-input-placeholder{color:currentColor}@container cue-container (width < 20em){input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{padding:0 1em}}textarea.multiline[_ngcontent-%COMP%]{font-size:.875em;line-height:1.5;padding:1em 4em 2em 2em;resize:none;min-height:var(--height);border-radius:1.25rem;box-sizing:border-box;overflow-y:auto;scrollbar-gutter:stable}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar{width:10px}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#ffffff1a;border-top:28px solid transparent;border-bottom:28px solid transparent;background-clip:content-box}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:#fff6;border-radius:5px;border:2px solid transparent;background-clip:content-box}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background-color:#ffffff80}@container cue-container (width < 20em){textarea.multiline[_ngcontent-%COMP%]{padding:.75em 3em 1.75em 1em}}.drag-handle[_ngcontent-%COMP%]{position:absolute;bottom:4px;left:50%;transform:translate(-50%);width:48px;height:24px;display:flex;align-items:center;justify-content:center;cursor:ns-resize;z-index:2;transition:opacity .2s ease;opacity:.6}.drag-handle[_ngcontent-%COMP%]:hover, .drag-handle[_ngcontent-%COMP%]:active{opacity:1}.drag-handle-icon[_ngcontent-%COMP%]{position:relative;width:24px;height:12px}.drag-handle-icon[_ngcontent-%COMP%]:before, .drag-handle-icon[_ngcontent-%COMP%]:after{content:"";position:absolute;width:16px;height:2px;background-color:currentColor;border-radius:1px;left:50%;transform:translate(-50%)}.drag-handle-icon[_ngcontent-%COMP%]:before{top:2px}.drag-handle-icon[_ngcontent-%COMP%]:after{bottom:2px}'],changeDetection:0})}return r})()}}]);
|
package/5649.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[5187,5649],{5187(D,y,t){t.d(y,{Card:()=>m});var d=t(7705),o=t(2271),f=t(5970),l=t(5547);const p=["*"];let m=(()=>{class n{style=(0,d.hFB)("");variant=(0,d.hFB)("default");shadow=(0,d.hFB)(!1);padded=(0,d.hFB)(!0);scrollable=(0,d.hFB)(!1);maxHeight=(0,d.hFB)(void 0);maxContentHeight=(0,d.hFB)(!1);isScrollable=(0,o.EW)(()=>this.scrollable()||void 0!==this.maxHeight());getClass=(0,o.EW)(()=>`variant-${this.variant()}`);getStyles=(0,o.EW)(()=>{const i="fade"===this.variant()?"neutral":this.variant(),s=[`\n color: var(--cue-${i}Contrast);\n --background-color: var(--cue-${i});\n background-color: var(--background-color);\n max-height: ${this.maxHeight()??"none"};\n position: ${this.isScrollable()?"relative":void 0};\n min-height: ${this.isScrollable()?void 0:"fit-content"};\n `];return"fade"===this.variant()&&s.push(`\n background-image: linear-gradient(to bottom,var(--cue-${i}),var(--cue-main-background));\n `),s.push(this.style()),s.join("")});innerDisplay=(0,o.EW)(()=>this.isScrollable()?"block":"contents");onResize(i){if(!this.maxContentHeight())return;const s=Array.from(i.element.children).reduce((g,M)=>M.getBoundingClientRect().height+g,0);i.element.parentElement.style.maxHeight=`calc(${s}px + var(--cue-card-padding-y) * 2 + 2px)`}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=l.VBU({type:n,selectors:[["cue-card"]],hostVars:8,hostBindings:function(s,g){2&s&&(l.Aen(g.getStyles()),l.HbH(g.getClass()),l.AVh("padded",g.padded())("shadow",g.shadow()))},inputs:{style:[1,"style"],variant:[1,"variant"],shadow:[1,"shadow"],padded:[1,"padded"],scrollable:[1,"scrollable"],maxHeight:[1,"maxHeight"],maxContentHeight:[1,"maxContentHeight"]},ngContentSelectors:p,decls:2,vars:2,consts:[["cueResized","",1,"inner",3,"resized"]],template:function(s,g){1&s&&(l.NAR(),l.j41(0,"div",0),l.bIt("resized",function(w){return g.onResize(w)}),l.SdG(1),l.k0s()),2&s&&l.xc7("display",g.innerDisplay())},dependencies:[f.C],styles:["[_nghost-%COMP%]{display:block;border-radius:var(--cue-card-border-radius);border:1px solid var(--cue-card-border-color);box-sizing:border-box;overflow:hidden;--cue-scrollbar-thumb-color: var(--cue-color-lightgray)}.padded[_nghost-%COMP%]{padding:var(--cue-card-padding-y) var(--cue-card-padding-x)}.shadow[_nghost-%COMP%]{box-shadow:var(--cue-card-box-shadow)}.variant-default[_nghost-%COMP%]{--cue-paginator-text-color: var(--cue-paginator-text-color);--cue-input-border-bottom-color: var(--cue-main-foreground);--cue-input-placeholder-color: var(--cue-color-darkmidgray);--cue-input-label-color: var(--cue-main-foreground);--cue-input-value-color: var(--cue-main-foreground);--cue-stepper-border-color: var(--cue-main-foreground);--cue-stepper-fill-color: var(--cue-main-foreground);--cue-stepper-connector-color: var(--cue-main-foreground)}body.dark .variant-default[_nghost-%COMP%]{--cue-scrollbar-thumb-color: var(--cue-color-midgray);--cue-paginator-text-color: var(--cue-color-midgray)}.variant-secondary[_nghost-%COMP%], .variant-primary[_nghost-%COMP%]{--cue-button-primary-focus-color: var(--cue-color-ultralightgray);--cue-button-primary-foreground: var(--cue-color-blue);--cue-button-primary-border-color: var(--cue-color-ultralightgray);--cue-button-primary-background: var(--cue-color-ultralightgray);--cue-button-primary-disabled-foreground: var(--cue-color-midgray);--cue-button-primary-disabled-background: var(--cue-color-lightgray);--cue-button-primary-disabled-border-color: var(--cue-color-lightgray);--cue-button-secondary-disabled-foreground: var(--cue-color-midgray);--cue-button-secondary-disabled-border-color: var(--cue-color-midgray);--cue-input-value-color: var(--cue-color-ultralightgray);--cue-input-label-color: var(--cue-color-ultralightgray);--cue-input-placeholder-color: var(--cue-color-lightgray);--cue-input-border-bottom-color: var(--cue-color-ultralightgray);--cue-input-switch-background: rgba(255, 255, 255, .25);--cue-input-switch-checked-background: var(--cue-color-green);--cue-input-switch-checked-indicator-background: var(--cue-color-darkgray);--cue-stepper-border-color: var(--cue-color-ultralightgray);--cue-stepper-fill-color: var(--cue-color-ultralightgray);--cue-stepper-connector-color: var(--cue-color-ultralightgray);--cue-table-text-color: var(--cue-color-ultralightgray);--cue-table-secondary-text-color: var(--cue-color-lightgray);--cue-table-row-border-bottom-color: rgba(255, 255, 255, .2);--cue-table-row-hover-bg: rgba(255, 255, 255, .1);--cue-chart-text-color: var(--cue-color-ultralightgray);--cue-paginator-text-color: var(--cue-color-ultralightgray)}:is(.variant-secondary[_nghost-%COMP%], .variant-primary[_nghost-%COMP%]) .ag-cell{--cue-input-value-color: var(--cue-table-text-color);--cue-input-placeholder-color: var(--cue-table-secondary-text-color)}.variant-secondary[_nghost-%COMP%]{--cue-input-switch-checked-background: var(--cue-color-blue);--cue-chart-border-background-color: var(--cue-secondary)}.variant-accent[_nghost-%COMP%]{--cue-chart-border-background-color: var(--cue-accent);--cue-chart-text-color: var(--cue-color-darkgray);--cue-chart-text-color-select: var(--cue-color-darkmidgray);--cue-input-value-color: var(--cue-color-darkgray);--cue-input-label-color: var(--cue-color-darkgray);--cue-input-placeholder-color: var(--cue-color-darkmidgray);--cue-input-border-bottom-color: var(--cue-color-darkgray);--cue-input-border-color: var(--cue-color-darkgray);--cue-stepper-border-color: var(--cue-color-darkgray);--cue-stepper-fill-color: var(--cue-color-darkgray);--cue-stepper-connector-color: var(--cue-color-darkgray);--cue-table-text-color: var(--cue-color-darkgray);--cue-table-secondary-text-color: var(--cue-color-darkmidgray);--cue-table-row-border-bottom-color: rgba(0, 0, 0, .15);--cue-table-row-hover-bg: rgba(0, 0, 0, .06)}.variant-primary[_nghost-%COMP%]{--cue-chart-border-background-color: var(--cue-primary);--cue-chart-text-color: var(--cue-color-ultralightgray);--cue-chart-text-color-select: var(--cue-color-lightgray);--cue-input-placeholder-color: rgba(255, 255, 255, .45)}[_nghost-%COMP%] > .inner[_ngcontent-%COMP%]{position:absolute;inset:var(--cue-card-padding-y) 0 0 var(--cue-card-padding-x);overflow:auto;padding-right:var(--cue-card-padding-x);padding-bottom:var(--cue-card-padding-y);scrollbar-width:thin;scrollbar-color:var(--cue-scrollbar-thumb-color) transparent}[_nghost-%COMP%] > .inner[_ngcontent-%COMP%]::-webkit-scrollbar{width:4px;height:4px}[_nghost-%COMP%] > .inner[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:var(--cue-scrollbar-thumb-color);border-radius:2px}[_nghost-%COMP%] > .inner[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}"]})}return n})()},5970(D,y,t){t.d(y,{C:()=>p});var d=t(7705),o=t(5547),f=t(5802);class l{newRect;oldRect;isFirst;element;constructor(m,n,e){this.newRect=m,this.oldRect=n,this.isFirst=null==n,this.element=e}}let p=(()=>{class v{element;zone;observer;oldRect;resized=(0,d.CGW)();windowResized=(0,d.CGW)();constructor(n,e){this.element=n,this.zone=e,this.observer=new ResizeObserver(i=>this.zone.run(()=>this.observe(i)))}ngOnInit(){this.observer.observe(this.element.nativeElement)}ngOnDestroy(){this.observer.disconnect()}onWindowResize(){this.zone.run(()=>{const n=this.getWindowRect(),e=new l(n,void 0,window.document.documentElement);this.windowResized.emit(e)})}observe(n){const e=n[0],i=new l(e.contentRect,this.oldRect,e.target);this.oldRect=e.contentRect,this.resized.emit(i)}getWindowRect(){return{x:0,y:0,width:window.innerWidth,height:window.innerHeight,top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,toJSON:()=>({})}}static \u0275fac=function(e){return new(e||v)(o.rXU(o.aKT),o.rXU(f.SKi))};static \u0275dir=o.FsC({type:v,selectors:[["","cueResized",""]],hostBindings:function(e,i){1&e&&o.bIt("resize",function(){return i.onWindowResize()},o.tSv)},outputs:{resized:"resized",windowResized:"windowResized"}})}return v})()},5649(D,y,t){t.d(y,{CueDocumentSearchBar:()=>P});var d=t(467),o=t(7705),f=t(5802),l=t(2271),p=t(7427),v=t(9352),m=t(5187),n=t(5559),e=t(5547);const i=["*"];let s=(()=>{class u{variant=(0,o.hFB)("default");static \u0275fac=function(c){return new(c||u)};static \u0275cmp=e.VBU({type:u,selectors:[["cue-search-bar-shadow"]],inputs:{variant:[1,"variant"]},ngContentSelectors:i,decls:2,vars:1,consts:[["variant","variant()",3,"shadow"]],template:function(c,r){1&c&&(e.NAR(),e.j41(0,"cue-card",0),e.SdG(1),e.k0s()),2&c&&e.Y8G("shadow",!0)},dependencies:[m.Card],styles:["[_nghost-%COMP%]{display:contents}cue-card[_ngcontent-%COMP%]{border:0;margin:calc(-1 * var(--cue-card-padding-y)) calc(-1 * var(--cue-card-padding-x))}"],changeDetection:0})}return u})();var g=t(5381),M=t(2245),w=t(9822);const S=u=>({count:u});function O(u,z){if(1&u&&(e.j41(0,"cue-typography",6),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&u){const a=e.XpG();e.R7$(),e.SpI(" ",e.i5U(2,1,"sdkWrapped.documentSearchBar.activeFilters",e.eq3(4,S,a._filters().length))," ")}}let P=(()=>{class u{projectId=o.hFB.required();sdkState=o.hFB.required();placeholder=(0,o.hFB)("");size=(0,o.hFB)("l");searchSubmit=(0,o.CGW)();_filters=(0,f.vPA)([]);_handlers=(0,l.EW)(()=>{var a=this;const c=this.sdkState(),r=this.projectId(),h=new p.NV(c.cue.api,r,c.graphType);let b=null;const R=()=>(b||(b=this._loadSchemaLabels(c,r)),b);return{requestAvailableFilters:(k=(0,d.A)(function*(C){const[_,x]=yield Promise.all([h.availableFilters(C),R()]);return a._withSchemaLabels(_,x)}),function(_){return k.apply(this,arguments)}),requestAvailableEntities:function(){var k=(0,d.A)(function*(C,_){return yield h.availableEntities(C,_)});return function(_,x){return k.apply(this,arguments)}}()};var k});onSubmit(a){this.searchSubmit.emit({query:a,filters:this._filters()})}_onFiltersChange(a){this._filters.set(a)}_loadSchemaLabels(a,c){return(0,d.A)(function*(){try{const r=new p.Ug(a.cue.api,c,a.cue.api.language,void 0,a.graphType);return yield r.ready,{content:new Map(r.availableContentCategories.get().map(h=>[h.iri,h.label])),entity:new Map(r.availableEntityCategories.get().map(h=>[h.iri,h.label]))}}catch(r){return console.error("[document-search-bar] Failed to load schema labels",r),{content:new Map,entity:new Map}}})()}_withSchemaLabels(a,c){return{mimes:a.mimes.map(r=>({iri:r.iri,label:r.label.replace(/FileContent$/,"")})),contents:a.contents.map(r=>({iri:r.iri,label:c.content.get(r.iri)??r.label})),entityCategories:a.entityCategories.map(r=>({iri:r.iri,label:c.entity.get(r.iri)??r.label}))}}static \u0275fac=function(c){return new(c||u)};static \u0275cmp=e.VBU({type:u,selectors:[["cue-document-search-bar"]],inputs:{projectId:[1,"projectId"],sdkState:[1,"sdkState"],placeholder:[1,"placeholder"],size:[1,"size"]},outputs:{searchSubmit:"searchSubmit"},decls:9,vars:7,consts:[["direction","column","gap","s","align","start"],["variant","primary",2,"width","100%"],["direction","column"],["variant","default"],[3,"valueSubmit","placeholder","responsiveMode","size"],[3,"filtersChange","handlers"],["size","xs",1,"muted"]],template:function(c,r){1&c&&(e.j41(0,"cue-flexcontainer",0)(1,"cue-card",1)(2,"cue-flexcontainer",2)(3,"cue-search-bar-shadow",3)(4,"cue-search-bar",4),e.nI1(5,"transloco"),e.bIt("valueSubmit",function(b){return r.onSubmit(b)}),e.k0s()(),e.nrm(6,"div"),e.j41(7,"cue-doc-filter",5),e.bIt("filtersChange",function(b){return r._onFiltersChange(b)}),e.k0s()()(),e.nVh(8,O,3,6,"cue-typography",6),e.k0s()),2&c&&(e.R7$(4),e.Y8G("placeholder",r.placeholder()||e.bMT(5,5,"sdkWrapped.documentSearchBar.searchPlaceholder"))("responsiveMode",!0)("size",r.size()),e.R7$(3),e.Y8G("handlers",r._handlers()),e.R7$(),e.vxM(r._filters().length>0?8:-1))},dependencies:[m.Card,n.I,s,g.n,M.Typography,w.y,v.Kj],styles:["[_nghost-%COMP%]{display:block}.muted[_ngcontent-%COMP%]{color:var(--cue-color-darkmidgray)}"],changeDetection:0})}return u})()}}]);
|
package/5738.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[5738],{3319(w,y,s){s.d(y,{a:()=>C});var b=s(7705),o=s(29),l=s(5547);let C=(()=>{class d{icon=(0,b.hFB)(void 0);slot=(0,b.hFB)("before");static \u0275fac=function(r){return new(r||d)};static \u0275cmp=l.VBU({type:d,selectors:[["cue-button-icon"]],inputs:{icon:[1,"icon"],slot:[1,"slot"]},decls:1,vars:2,consts:[[3,"slot","name"]],template:function(r,m){1&r&&l.nrm(0,"cue-svg-icon",0),2&r&&l.Y8G("slot",m.slot())("name",m.icon())},dependencies:[o.A],encapsulation:2})}return d})()},5971(w,y,s){s.d(y,{$:()=>m});var b=s(9769),o=s(7705),l=s(2271),C=s(7089),d=s(2403),c=s(5547);const a=["buttonElement"],r=["*"];let m=(()=>{class f{variant=(0,o.hFB)("primary");size=(0,o.hFB)("m");tooltip=(0,o.hFB)("");disabled=(0,o.hFB)(!1);selected=(0,o.geq)(!1);toggleButton=(0,o.hFB)(!1);loading=(0,o.hFB)(!1);fitParentWidth=(0,o.hFB)(!1);noWrap=(0,o.hFB)(!0);buttonElement=o.ebz.required("buttonElement");getStyles=(0,l.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(x){x.detail>0&&this.buttonElement().nativeElement.blur(),this.toggleButton()&&(x.stopPropagation(),this.selected.set(!this.selected()))}static \u0275fac=function(v){return new(v||f)};static \u0275cmp=c.VBU({type:f,selectors:[["cue-button"]],viewQuery:function(v,u){1&v&&c.wEZ(u.buttonElement,a,5),2&v&&c.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:r,decls:3,vars:18,consts:[["buttonElement",""],["tooltipSize","small",3,"click","disabled","cueTooltip","tooltipPlacement","cuePulse"]],template:function(v,u){1&v&&(c.NAR(),c.j41(0,"button",1,0),c.bIt("click",function(L){return u.handleClick(L)}),c.SdG(2),c.k0s()),2&v&&(c.Aen(u.getStyles()),c.xc7("white-space",u.noWrap()?"nowrap":"normal")("flex-basis",u.noWrap()?null:"auto")("min-width",u.noWrap()?null:"fit-content"),c.AVh("selected",u.selected())("ghost","ghost"===u.variant())("fit-parent-width",u.fitParentWidth()),c.Y8G("disabled",u.disabled())("cueTooltip",u.tooltip())("tooltipPlacement","top")("cuePulse",u.loading()))},dependencies:[b.MD,C.d,d.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 f})()},3910(w,y,s){s.d(y,{IDBuilder:()=>Z});var b=s(7705),o=s(5802),l=s(5332);const C=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,r=function a(t){if(!function d(t){return"string"==typeof t&&C.test(t)}(t))throw TypeError("Invalid UUID");var n,e=new Uint8Array(16);return e[0]=(n=parseInt(t.slice(0,8),16))>>>24,e[1]=n>>>16&255,e[2]=n>>>8&255,e[3]=255&n,e[4]=(n=parseInt(t.slice(9,13),16))>>>8,e[5]=255&n,e[6]=(n=parseInt(t.slice(14,18),16))>>>8,e[7]=255&n,e[8]=(n=parseInt(t.slice(19,23),16))>>>8,e[9]=255&n,e[10]=(n=parseInt(t.slice(24,36),16))/1099511627776&255,e[11]=n/4294967296&255,e[12]=n>>>24&255,e[13]=n>>>16&255,e[14]=n>>>8&255,e[15]=255&n,e};function v(t,n,e,i){switch(t){case 0:return n&e^~n&i;case 1:case 3:return n^e^i;case 2:return n&e^n&i^e&i}}function u(t,n){return t<<n|t>>>32-n}const V=function x(t,n,e){function i(h,D,g,M){var E;if("string"==typeof h&&(h=function m(t){t=unescape(encodeURIComponent(t));for(var n=[],e=0;e<t.length;++e)n.push(t.charCodeAt(e));return n}(h)),"string"==typeof D&&(D=r(D)),16!==(null===(E=D)||void 0===E?void 0:E.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var p=new Uint8Array(16+h.length);if(p.set(D),p.set(h,D.length),(p=e(p))[6]=15&p[6]|n,p[8]=63&p[8]|128,g){M=M||0;for(var _=0;_<16;++_)g[M+_]=p[_];return g}return(0,l.k)(p)}try{i.name=t}catch{}return i.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",i}("v5",80,function $(t){var n=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var i=unescape(encodeURIComponent(t));t=[];for(var h=0;h<i.length;++h)t.push(i.charCodeAt(h))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var g=Math.ceil((t.length/4+2)/16),M=new Array(g),E=0;E<g;++E){for(var p=new Uint32Array(16),_=0;_<16;++_)p[_]=t[64*E+4*_]<<24|t[64*E+4*_+1]<<16|t[64*E+4*_+2]<<8|t[64*E+4*_+3];M[E]=p}M[g-1][14]=8*(t.length-1)/Math.pow(2,32),M[g-1][14]=Math.floor(M[g-1][14]),M[g-1][15]=8*(t.length-1)&4294967295;for(var W=0;W<g;++W){for(var B=new Uint32Array(80),U=0;U<16;++U)B[U]=M[W][U];for(var O=16;O<80;++O)B[O]=u(B[O-3]^B[O-8]^B[O-14]^B[O-16],1);for(var A=e[0],T=e[1],F=e[2],N=e[3],S=e[4],R=0;R<80;++R){var k=Math.floor(R/20),J=u(A,5)+v(k,T,F,N)+S+n[k]+B[R]>>>0;S=N,N=F,F=u(T,30)>>>0,T=A,A=J}e[0]=e[0]+A>>>0,e[1]=e[1]+T>>>0,e[2]=e[2]+F>>>0,e[3]=e[3]+N>>>0,e[4]=e[4]+S>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,255&e[0],e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,255&e[1],e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,255&e[2],e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,255&e[3],e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,255&e[4]]}),K={\u00e4:"ae",a\u0308:"ae",\u00c4:"AE",\u00f6:"oe",\u00d6:"OE",\u00fc:"ue",u\u0308:"ue",\u00dc:"UE",U\u0308:"UE",\u00df:"ss",\u00e6:"ae",\u00c6:"AE",\u00f8:"oe",\u00d8:"OE",\u00e5:"aa",\u00c5:"AA",\u00e1:"a",\u00c1:"A",\u00f0:"d",\u00d0:"D",\u00e9:"e",\u00c9:"E",\u00ed:"i",\u00cd:"I",\u00f3:"o",\u00d3:"O",\u00fa:"u",\u00da:"U",\u00fd:"y",\u00dd:"Y",\u00fe:"th",\u00de:"Th"};var Y=s(5559),X=s(5381),H=s(2245),P=s(5547);let Z=(()=>{class t{size=(0,b.hFB)("l");id=(0,o.vPA)("");updateId(e){this.id.set(function z(t,n=!1){return t=function Q(t,n=!1){let e=t;for(const i in K)e=e.replace(new RegExp(i,"g"),K[i]);return n&&e!==t&&console.info(`${t} -> ${e}`),e}(t,n),V(t,"daca0510-72b5-48ba-9091-b918ca18136b")}(e))}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=P.VBU({type:t,selectors:[["cue-id-builder"]],inputs:{size:[1,"size"]},decls:4,vars:3,consts:[["direction","column","align","center"],["placeholder","Text string...",2,"width","100%","text-align","start",3,"valueChange","showSubmitButton","size"]],template:function(i,h){1&i&&(P.j41(0,"cue-flexcontainer",0)(1,"cue-search-bar",1),P.bIt("valueChange",function(g){return h.updateId(g)}),P.k0s(),P.j41(2,"cue-typography"),P.EFF(3),P.k0s()()),2&i&&(P.R7$(),P.Y8G("showSubmitButton",!1)("size",h.size()),P.R7$(2),P.JRh(h.id()))},dependencies:[Y.I,X.n,H.Typography],encapsulation:2})}return t})()},2403(w,y,s){s.d(y,{V:()=>C});var b=s(7705),o=s(5547),l=s(5802);let C=(()=>{class d{el=(0,l.WQX)(o.aKT);renderer=(0,l.WQX)(o.sFG);cuePulse=(0,b.hFB)(!1);cuePulseColor=(0,b.hFB)("");cuePulseMode=(0,b.hFB)("border");activeClass="";constructor(){this.ensureGlobalStyles()}onPulseChanged=(0,l.QZP)(()=>{const a=this.cuePulse(),r=this.cuePulseColor(),m=this.cuePulseMode(),f=this.el.nativeElement;if(this.activeClass&&(this.renderer.removeClass(f,this.activeClass),this.activeClass=""),this.renderer.removeStyle(f,"--cue-pulse-color"),this.renderer.removeStyle(f,"border-radius"),a){const I="text"===m?"cue-pulse-text":"cue-pulse-border";this.renderer.addClass(f,I),this.activeClass=I,r&&this.renderer.setStyle(f,"--cue-pulse-color",r),"border"===m&&setTimeout(()=>{const x=f.firstElementChild;if(x){const v=getComputedStyle(x).borderRadius;v&&"0px"!==v&&this.renderer.setStyle(f,"border-radius",v)}})}});ngOnDestroy(){const a=this.el.nativeElement;this.activeClass&&this.renderer.removeClass(a,this.activeClass),this.renderer.removeStyle(a,"border-radius")}ensureGlobalStyles(){const a="cue-pulse-global-styles";if(document.getElementById(a))return;const r=document.createElement("style");r.id=a,r.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(r)}static \u0275fac=function(r){return new(r||d)};static \u0275dir=o.FsC({type:d,selectors:[["","cuePulse",""]],inputs:{cuePulse:[1,"cuePulse"],cuePulseColor:[1,"cuePulseColor"],cuePulseMode:[1,"cuePulseMode"]}})}return d})()},5332(w,y,s){s.d(y,{k:()=>C});for(var o=[],l=0;l<256;++l)o.push((l+256).toString(16).slice(1));function C(a,r=0){return(o[a[r+0]]+o[a[r+1]]+o[a[r+2]]+o[a[r+3]]+"-"+o[a[r+4]]+o[a[r+5]]+"-"+o[a[r+6]]+o[a[r+7]]+"-"+o[a[r+8]]+o[a[r+9]]+"-"+o[a[r+10]]+o[a[r+11]]+o[a[r+12]]+o[a[r+13]]+o[a[r+14]]+o[a[r+15]]).toLowerCase()}}}]);
|