@qaecy/cue-ui 0.0.66 → 0.0.68
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/1153.js +1 -1
- package/1231.js +1 -0
- package/1320.js +1 -0
- package/179.js +1 -0
- package/1837.js +1 -1
- package/198.js +1 -0
- package/2130.js +1 -1
- package/2317.js +1 -1
- package/2559.js +1 -1
- package/2775.js +1 -1
- package/29.js +1 -1
- package/3.js +1 -0
- package/3036.js +1 -1
- package/3202.js +1 -1
- package/3213.js +1 -1
- package/3614.js +1 -1
- package/3630.js +1 -0
- package/3632.js +7 -0
- package/3786.js +1 -1
- package/4098.js +1 -1
- package/4415.js +1 -1
- package/4660.js +1 -0
- package/469.js +1 -0
- package/5649.js +1 -1
- package/6233.js +1 -1
- package/6423.js +1 -1
- package/6439.js +1 -1
- package/6442.js +1 -0
- package/650.js +1 -1
- package/675.js +1 -0
- package/6751.js +1 -1
- package/6947.js +1 -1
- package/7003.js +1 -0
- package/7108.js +1 -0
- package/7154.js +1 -1
- package/7573.js +1 -0
- package/7719.js +1 -1
- package/7727.js +1 -1
- package/8629.js +1 -0
- package/8647.js +1 -0
- package/9231.js +1 -0
- package/9396.js +1 -1
- package/README.md +20 -0
- package/common.js +1 -1
- package/ifclite-pointcloud-decode.js +1 -0
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +3 -1
- package/pdf.worker.min.mjs +21 -0
- package/runtime.js +1 -1
- package/styles.css +1 -1
- package/wasm/ifc-lite_bg.wasm +0 -0
- package/1778.js +0 -1
- package/487.js +0 -1
- package/6780.js +0 -7
- package/7598.js +0 -1
- package/9707.js +0 -1
package/7719.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2014,3319,5971,7719],{13319(D,f,n){n.d(f,{ButtonIcon:()=>v});var u=n(17705),i=n(20029),c=n(35547);let v=(()=>{class p{icon=(0,u.hFB)(void 0);slot=(0,u.hFB)("before");static \u0275fac=function(_){return new(_||p)};static \u0275cmp=c.VBU({type:p,selectors:[["cue-button-icon"]],inputs:{icon:[1,"icon"],slot:[1,"slot"]},decls:1,vars:2,consts:[[3,"slot","name"]],template:function(_,g){1&_&&c.nrm(0,"cue-svg-icon",0),2&_&&c.Y8G("slot",g.slot())("name",g.icon())},dependencies:[i.A],encapsulation:2})}return p})()},75448(D,f,n){n.d(f,{ButtonLabel:()=>p});var u=n(17705),i=n(42245),c=n(35547);const v=["*"];let p=(()=>{class d{fontSize=(0,u.hFB)("m");italic=(0,u.hFB)(!1);noWrap=(0,u.hFB)(!0);static \u0275fac=function(g){return new(g||d)};static \u0275cmp=c.VBU({type:d,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:v,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function(g,l){1&g&&(c.NAR(),c.j41(0,"div")(1,"cue-typography",0),c.SdG(2),c.k0s()()),2&g&&(c.R7$(),c.Y8G("size",l.fontSize())("italic",l.italic())("noWrap",l.noWrap()))},dependencies:[i.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return d})()},2014(D,f,n){n.d(f,{ButtonPadder:()=>p});var u=n(17705),i=n(32271),c=n(35547);const v=["*"];let p=(()=>{class d{justify=(0,u.hFB)("start");size=(0,u.hFB)("l");widthStyle=(0,i.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(g){return new(g||d)};static \u0275cmp=c.VBU({type:d,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:v,decls:2,vars:4,template:function(g,l){1&g&&(c.NAR(),c.rj2(0,"div"),c.SdG(1),c.eux()),2&g&&c.xc7("justify-content",l.justify())("min-width",l.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return d})()},85971(D,f,n){n.d(f,{Button:()=>g});var u=n(49769),i=n(17705),c=n(32271),v=n(77089),p=n(2403),d=n(35547);const s=["buttonElement"],_=["*"];let g=(()=>{class l{variant=(0,i.hFB)("primary");size=(0,i.hFB)("m");tooltip=(0,i.hFB)("");disabled=(0,i.hFB)(!1);selected=(0,i.geq)(!1);toggleButton=(0,i.hFB)(!1);loading=(0,i.hFB)(!1);fitParentWidth=(0,i.hFB)(!1);noWrap=(0,i.hFB)(!0);buttonElement=i.ebz.required("buttonElement");getStyles=(0,c.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(b){b.detail>0&&this.buttonElement().nativeElement.blur(),this.toggleButton()&&(b.stopPropagation(),this.selected.set(!this.selected()))}static \u0275fac=function(h){return new(h||l)};static \u0275cmp=d.VBU({type:l,selectors:[["cue-button"]],viewQuery:function(h,m){1&h&&d.wEZ(m.buttonElement,s,5),2&h&&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:_,decls:3,vars:18,consts:[["buttonElement",""],["tooltipSize","small",3,"click","disabled","cueTooltip","tooltipPlacement","cuePulse"]],template:function(h,m){1&h&&(d.NAR(),d.j41(0,"button",1,0),d.bIt("click",function(y){return m.handleClick(y)}),d.SdG(2),d.k0s()),2&h&&(d.Aen(m.getStyles()),d.xc7("white-space",m.noWrap()?"nowrap":"normal")("flex-basis",m.noWrap()?null:"auto")("min-width",m.noWrap()?null:"fit-content"),d.AVh("selected",m.selected())("ghost","ghost"===m.variant())("fit-parent-width",m.fitParentWidth()),d.Y8G("disabled",m.disabled())("cueTooltip",m.tooltip())("tooltipPlacement","top")("cuePulse",m.loading()))},dependencies:[u.MD,v.d,p.V],styles:['[_nghost-%COMP%]:has(.fit-parent-width){display:contents}@keyframes _ngcontent-%COMP%_pulse-border{0%{box-shadow:0 0 0 0 var(--focus-color)}50%{box-shadow:0 0 0 8px transparent}to{box-shadow:0 0 0 0 transparent}}button[_ngcontent-%COMP%]{min-width:0;pulse-border-radius:var(--cue-button-border-radius);appearance:none;padding:0;font:inherit;border:var(--cue-button-border-width) var(--cue-button-border-style) var(--cue-button-border-color);display:flex;justify-content:space-between;align-items:center;gap:var(--cue-button-gap);min-height:var(--button-height);height:auto;background-color:var(--background-color);border-radius:var(--cue-button-border-radius, 9999px);margin:3px;position:relative}button[style*="white-space: normal"][_ngcontent-%COMP%]{border-radius:30px!important;padding:10px!important}button.fit-parent-width[_ngcontent-%COMP%]{width:100%;min-width:0;margin-inline:0}button[_ngcontent-%COMP%]:not(.fit-parent-width){min-width:fit-content;width:auto}button[_ngcontent-%COMP%]:focus{outline:none}button[_ngcontent-%COMP%]:hover:not(:disabled), button[_ngcontent-%COMP%]:focus-within:not(:disabled){outline:1px solid var(--focus-color);outline-offset:2px;cursor:pointer}button.selected[_ngcontent-%COMP%]{outline:1px solid currentColor!important;outline-offset:2px;margin:3px}button.ghost[_ngcontent-%COMP%]:not(.selected){border:none}']})}return l})()},57293(D,f,n){n.d(f,{x:()=>g});var u=n(17705),i=n(85802),c=n(32271),v=n(44613),p=n(77089),d=n(59352),s=n(35547);function _(l,M){1&l&&s.nrm(0,"cue-logo",4)}let g=(()=>{class l{projectId=(0,u.hFB)(void 0);resourceId=(0,u.hFB)(void 0);_active=(0,i.vPA)(!0);onHover(){this._active.set(!1),requestAnimationFrame(()=>this._active.set(!0))}_title=(0,c.EW)(()=>this.projectId()&&this.resourceId()?"components.logoLink.showResourceInCue":this.projectId()?"components.logoLink.openProjectInCue":"components.logoLink.openCuePortal");_href=(0,c.EW)(()=>{const b=this.projectId(),h=this.resourceId();return b&&h?`https://cue.qaecy.com/r/${encodeURIComponent(b)}/${encodeURIComponent(h)}`:b?`https://cue.qaecy.com/home/projects?p=${encodeURIComponent(b)}`:"https://cue.qaecy.com/home/projects"});static \u0275fac=function(h){return new(h||l)};static \u0275cmp=s.VBU({type:l,selectors:[["cue-logo-link"]],inputs:{projectId:[1,"projectId"],resourceId:[1,"resourceId"]},decls:6,vars:5,consts:[["target","_blank","rel","noopener noreferrer",1,"link",3,"mouseenter","href"],[1,"logo-stack",3,"cueTooltip"],["size","xs",1,"logo-bg"],[1,"logo-fg"],["size","xs"]],template:function(h,m){1&h&&(s.j41(0,"a",0),s.bIt("mouseenter",function(){return m.onHover()}),s.j41(1,"div",1),s.nI1(2,"transloco"),s.nrm(3,"cue-logo",2),s.j41(4,"div",3),s.nVh(5,_,1,0,"cue-logo",4),s.k0s()()()),2&h&&(s.Y8G("href",m._href(),s.B4B),s.R7$(),s.Y8G("cueTooltip",s.bMT(2,3,m._title())),s.R7$(4),s.vxM(m._active()?5:-1))},dependencies:[v.Logo,p.d,d.Kj],styles:["[_nghost-%COMP%]{display:inline-block;line-height:0}.link[_ngcontent-%COMP%]{display:block;text-decoration:none;cursor:pointer}.logo-stack[_ngcontent-%COMP%]{position:relative;display:inline-block;line-height:0}.logo-bg[_ngcontent-%COMP%]{display:block;opacity:.3;transition:opacity .2s ease}.link[_ngcontent-%COMP%]:hover .logo-bg[_ngcontent-%COMP%]{opacity:.15}.logo-fg[_ngcontent-%COMP%]{position:absolute;inset:0;opacity:0;transition:opacity .15s ease}.link[_ngcontent-%COMP%]:hover .logo-fg[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})}return l})()},2403(D,f,n){n.d(f,{V:()=>v});var u=n(17705),i=n(35547),c=n(85802);let v=(()=>{class p{el=(0,c.WQX)(i.aKT);renderer=(0,c.WQX)(i.sFG);cuePulse=(0,u.hFB)(!1);cuePulseColor=(0,u.hFB)("");cuePulseMode=(0,u.hFB)("border");activeClass="";constructor(){this.ensureGlobalStyles()}onPulseChanged=(0,c.QZP)(()=>{const s=this.cuePulse(),_=this.cuePulseColor(),g=this.cuePulseMode(),l=this.el.nativeElement;if(this.activeClass&&(this.renderer.removeClass(l,this.activeClass),this.activeClass=""),this.renderer.removeStyle(l,"--cue-pulse-color"),this.renderer.removeStyle(l,"border-radius"),s){const M="text"===g?"cue-pulse-text":"cue-pulse-border";this.renderer.addClass(l,M),this.activeClass=M,_&&this.renderer.setStyle(l,"--cue-pulse-color",_),"border"===g&&setTimeout(()=>{const b=l.firstElementChild;if(b){const h=getComputedStyle(b).borderRadius;h&&"0px"!==h&&this.renderer.setStyle(l,"border-radius",h)}})}});ngOnDestroy(){const s=this.el.nativeElement;this.activeClass&&this.renderer.removeClass(s,this.activeClass),this.renderer.removeStyle(s,"border-radius")}ensureGlobalStyles(){const s="cue-pulse-global-styles";if(document.getElementById(s))return;const _=document.createElement("style");_.id=s,_.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(_)}static \u0275fac=function(_){return new(_||p)};static \u0275dir=i.FsC({type:p,selectors:[["","cuePulse",""]],inputs:{cuePulse:[1,"cuePulse"],cuePulseColor:[1,"cuePulseColor"],cuePulseMode:[1,"cuePulseMode"]}})}return p})()},67719(D,f,n){n.d(f,{CueDocumentCharts:()=>j});var u=n(17705),i=n(85802),c=n(32271),v=n(23615),p=n(7993),d=n(61519),s=n(99811),_=n(13319),g=n(75448),l=n(2014),M=n(85971),b=n(35381),h=n(42245),m=n(97851),E=n(59352),y=n(57293),e=n(35547);const B=r=>({suffix:r}),O=r=>({type:r});function I(r,C){if(1&r&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-typography",3),e.EFF(2),e.k0s()()),2&r){const t=e.XpG();e.R7$(2),e.SpI(" ",t.errorMessage()," ")}}function L(r,C){if(1&r){const t=e.RV6();e.j41(0,"div",7)(1,"cue-block-documents-by-suffix",8),e.bIt("navigated",function(a){i.eBV(t);const P=e.XpG(2);return i.Njj(P.handleNavigated(a,"suffix"))}),e.k0s()()}if(2&r){const t=e.XpG(2);e.xc7("height",t.chartHeight(),"px"),e.R7$(),e.Y8G("data",C)("config",t.blockConfig())}}function x(r,C){if(1&r){const t=e.RV6();e.j41(0,"div",7)(1,"cue-block-documents-by-content-category",8),e.bIt("navigated",function(a){i.eBV(t);const P=e.XpG(2);return i.Njj(P.handleNavigated(a,"content-category"))}),e.k0s()()}if(2&r){const t=e.XpG(2);e.xc7("height",t.chartHeight(),"px"),e.R7$(),e.Y8G("data",C)("config",t.blockConfig())}}function W(r,C){if(1&r&&(e.EFF(0),e.nI1(1,"transloco")),2&r){const t=e.XpG(3);e.SpI(" ",e.i5U(1,1,"components.documentCharts.listDocumentsBySuffix",e.eq3(4,B,t._activeSelection().label))," ")}}function T(r,C){if(1&r&&(e.EFF(0),e.nI1(1,"transloco")),2&r){const t=e.XpG(3);e.SpI(" ",e.i5U(1,1,"components.documentCharts.listDocumentsByType",e.eq3(4,O,t._activeSelection().label))," ")}}function w(r,C){if(1&r){const t=e.RV6();e.j41(0,"cue-flexcontainer",6)(1,"cue-button",9),e.bIt("click",function(){i.eBV(t);const a=e.XpG(2);return i.Njj(a.onShowListButtonClick())}),e.nrm(2,"cue-button-padder")(3,"cue-button-icon",10),e.j41(4,"cue-button-label"),e.nVh(5,W,2,6)(6,T,2,6),e.k0s(),e.nrm(7,"cue-button-padder"),e.k0s()()}if(2&r){const t=e.XpG(2);e.R7$(5),e.vxM("suffix"===t._activeSelection().filterBy&&t._activeSelection().label.startsWith(".")?5:6)}}function R(r,C){if(1&r&&(e.j41(0,"cue-flexcontainer",4),e.nVh(1,L,2,4,"div",5),e.nVh(2,x,2,4,"div",5),e.k0s(),e.nVh(3,w,8,1,"cue-flexcontainer",6)),2&r){let t,o;const a=e.XpG();e.Y8G("direction",a.stackCharts()?"column":"row"),e.R7$(),e.vxM((t="content-category"!==a.mode()&&a.bySuffix())?1:-1,t),e.R7$(),e.vxM((o="suffix"!==a.mode()&&a.byContentCategory())?2:-1,o),e.R7$(),e.vxM(a.showDocumentListButton()&&a._activeSelection()?3:-1)}}function S(r,C){if(1&r&&e.nrm(0,"cue-logo-link",2),2&r){const t=e.XpG();e.Y8G("projectId",t.projectId())}}let j=(()=>{class r{_blockCtx=(0,i.WQX)(s.z);projectId=(0,u.hFB)(void 0);sdkState=(0,u.hFB)(void 0);mode=(0,u.hFB)("both");stackCharts=(0,u.hFB)(!1);chartHeight=(0,u.hFB)(400);selected=(0,u.CGW)();selectionCleared=(0,u.CGW)();showDocumentListButton=(0,u.hFB)(!1,{transform:u.L39});showLogo=(0,u.hFB)(!1,{transform:u.L39});showInDocumentList=(0,u.CGW)();state=(0,i.vPA)("idle");errorMessage=(0,i.vPA)(null);_activeSelection=(0,i.vPA)(null);_rawData=(0,i.vPA)(void 0);bySuffix=(0,c.EW)(()=>{const t=this._rawData();if(t?.documentsBySuffix&&0!==Object.keys(t.documentsBySuffix).length)return{documents:t.documentsBySuffix}});byContentCategory=(0,c.EW)(()=>{const t=this._rawData();if(t?.documentsByContentCategory&&0!==Object.keys(t.documentsByContentCategory).length)return{documents:t.documentsByContentCategory}});blockConfig=(0,c.EW)(()=>({projectId:this.projectId()??"",portalBaseURL:"",resourceBaseURL:"",graphIsSaturated:!1,privileges:new d.c,handlers:new d.$}));_ownedView;_unsubscribeCategories;_unsubscribeDocumentsData;_lastSetupSignature;constructor(){(0,i.QZP)(()=>{const t=this.projectId(),o=this.sdkState();if(!o)return this._clearRuntimeState(),void this.state.set("idle");const a={projectId:t,cue:o.cue,view:o.view,documents:o.documents,language:o.language,mode:this.mode()};this._isSameSetupSignature(a)||(this._setupFromSdkState(t,o),this._lastSetupSignature=a)})}ngOnDestroy(){this._cleanupSubscriptions(),this._cleanupOwnedView()}handleNavigated(t,o){if(!t)return this._activeSelection.set(null),void this.selectionCleared.emit({chart:o});const a={filterBy:"suffix"===t.filterBy?"suffix":"content-category",values:t.values.filter(P=>"__grouped_small__"!==P),label:t.label};this._activeSelection.set(a),this.selected.emit(a)}onShowListButtonClick(){const t=this._activeSelection();t&&this.showInDocumentList.emit(t)}_setupFromSdkState(t,o){if(this._cleanupSubscriptions(),this._cleanupOwnedView(),this._rawData.set(void 0),o.availableContentCategories&&this._blockCtx.availableContentCategories.set(o.availableContentCategories),o.documents)return o.documents.setLanguage(o.language??"en"),void this._bindDocumentsData(o.documents);if(o.view)return o.view.setLanguage(o.language??"en"),this._bindDocumentsData(o.view.documents),void(o.availableContentCategories||this._bindCategoriesFromView(o.view));if(o.cue&&t){const a=o.cue.createProjectView(t,{language:o.language??"en"});return this._ownedView=a,this._bindDocumentsData(a.documents),void("suffix"!==this.mode()&&!o.availableContentCategories&&this._bindCategoriesFromView(a))}this.errorMessage.set("sdkState must include cue, view, or documents to load data."),this.state.set("error")}_bindDocumentsData(t){this.state.set("loading");const o=()=>{const a=t.projectDocumentsData.get();a&&Object.keys(a.documentsBySuffix).length>0&&(0,c.O8)(()=>{this._rawData.set(a),this.state.set("ready")})};o(),this._unsubscribeDocumentsData=t.projectDocumentsData.subscribe(()=>o())}_bindCategoriesFromView(t){const o=()=>{this._blockCtx.availableContentCategories.set(t.availableContentCategories.get())};o(),this._unsubscribeCategories=t.availableContentCategories.subscribe(o)}_clearRuntimeState(){this._cleanupSubscriptions(),this._cleanupOwnedView(),this._rawData.set(void 0),this._blockCtx.availableContentCategories.set(void 0),this.errorMessage.set(null),this._lastSetupSignature=void 0}_cleanupSubscriptions(){this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this._unsubscribeDocumentsData?.(),this._unsubscribeDocumentsData=void 0}_cleanupOwnedView(){this._ownedView&&(this._ownedView.destroy(),this._ownedView=void 0)}_isSameSetupSignature(t){const o=this._lastSetupSignature;return!!o&&o.projectId===t.projectId&&o.cue===t.cue&&o.view===t.view&&o.documents===t.documents&&o.language===t.language&&o.mode===t.mode}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=e.VBU({type:r,selectors:[["cue-document-charts"]],inputs:{projectId:[1,"projectId"],sdkState:[1,"sdkState"],mode:[1,"mode"],stackCharts:[1,"stackCharts"],chartHeight:[1,"chartHeight"],showDocumentListButton:[1,"showDocumentListButton"],showLogo:[1,"showLogo"]},outputs:{selected:"selected",selectionCleared:"selectionCleared",showInDocumentList:"showInDocumentList"},features:[e.Jv_([s.z])],decls:4,vars:5,consts:[[3,"cueLogoLoader"],["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","absolute","bottom","8px","right","8px","z-index","5",3,"projectId"],[2,"color","#c44","font-size","13px"],["align","stretch",2,"width","100%",3,"direction"],[1,"chart-wrapper",3,"height"],["justify","center"],[1,"chart-wrapper"],[3,"navigated","data","config"],["size","s","variant","secondary",3,"click"],["icon","filter"]],template:function(o,a){1&o&&(e.j41(0,"div",0),e.nVh(1,I,3,1,"cue-flexcontainer",1)(2,R,4,4),e.nVh(3,S,1,1,"cue-logo-link",2),e.k0s()),2&o&&(e.xc7("min-height",a.chartHeight(),"px"),e.Y8G("cueLogoLoader","loading"===a.state()),e.R7$(),e.vxM("error"===a.state()?1:"ready"===a.state()?2:-1),e.R7$(2),e.vxM(a.showLogo()?3:-1))},dependencies:[v.Y,p.o,b.FlexContainer,h.Typography,M.Button,g.ButtonLabel,l.ButtonPadder,_.ButtonIcon,m.k,y.x,E.Kj],styles:["[_nghost-%COMP%]{display:block;width:100%}.chart-wrapper[_ngcontent-%COMP%]{flex:1;min-width:0;position:relative}cue-block-documents-by-suffix[_ngcontent-%COMP%], cue-block-documents-by-content-category[_ngcontent-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return r})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2014,3319,5971,7719],{13319(D,f,n){n.d(f,{ButtonIcon:()=>v});var u=n(17705),i=n(20029),c=n(35547);let v=(()=>{class p{icon=(0,u.hFB)(void 0);slot=(0,u.hFB)("before");static \u0275fac=function(_){return new(_||p)};static \u0275cmp=c.VBU({type:p,selectors:[["cue-button-icon"]],inputs:{icon:[1,"icon"],slot:[1,"slot"]},decls:1,vars:2,consts:[[3,"slot","name"]],template:function(_,g){1&_&&c.nrm(0,"cue-svg-icon",0),2&_&&c.Y8G("slot",g.slot())("name",g.icon())},dependencies:[i.A],encapsulation:2})}return p})()},75448(D,f,n){n.d(f,{ButtonLabel:()=>p});var u=n(17705),i=n(42245),c=n(35547);const v=["*"];let p=(()=>{class d{fontSize=(0,u.hFB)("m");italic=(0,u.hFB)(!1);noWrap=(0,u.hFB)(!0);static \u0275fac=function(g){return new(g||d)};static \u0275cmp=c.VBU({type:d,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:v,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function(g,l){1&g&&(c.NAR(),c.j41(0,"div")(1,"cue-typography",0),c.SdG(2),c.k0s()()),2&g&&(c.R7$(),c.Y8G("size",l.fontSize())("italic",l.italic())("noWrap",l.noWrap()))},dependencies:[i.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return d})()},2014(D,f,n){n.d(f,{ButtonPadder:()=>p});var u=n(17705),i=n(32271),c=n(35547);const v=["*"];let p=(()=>{class d{justify=(0,u.hFB)("start");size=(0,u.hFB)("l");widthStyle=(0,i.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(g){return new(g||d)};static \u0275cmp=c.VBU({type:d,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:v,decls:2,vars:4,template:function(g,l){1&g&&(c.NAR(),c.rj2(0,"div"),c.SdG(1),c.eux()),2&g&&c.xc7("justify-content",l.justify())("min-width",l.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return d})()},85971(D,f,n){n.d(f,{Button:()=>g});var u=n(49769),i=n(17705),c=n(32271),v=n(77089),p=n(2403),d=n(35547);const a=["buttonElement"],_=["*"];let g=(()=>{class l{variant=(0,i.hFB)("primary");size=(0,i.hFB)("m");tooltip=(0,i.hFB)("");disabled=(0,i.hFB)(!1);selected=(0,i.geq)(!1);toggleButton=(0,i.hFB)(!1);loading=(0,i.hFB)(!1);fitParentWidth=(0,i.hFB)(!1);noWrap=(0,i.hFB)(!0);buttonElement=i.ebz.required("buttonElement");getStyles=(0,c.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(b){b.detail>0&&this.buttonElement().nativeElement.blur(),this.toggleButton()&&(b.stopPropagation(),this.selected.set(!this.selected()))}static \u0275fac=function(h){return new(h||l)};static \u0275cmp=d.VBU({type:l,selectors:[["cue-button"]],viewQuery:function(h,m){1&h&&d.wEZ(m.buttonElement,a,5),2&h&&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:_,decls:3,vars:18,consts:[["buttonElement",""],["tooltipSize","small",3,"click","disabled","cueTooltip","tooltipPlacement","cuePulse"]],template:function(h,m){1&h&&(d.NAR(),d.j41(0,"button",1,0),d.bIt("click",function(y){return m.handleClick(y)}),d.SdG(2),d.k0s()),2&h&&(d.Aen(m.getStyles()),d.xc7("white-space",m.noWrap()?"nowrap":"normal")("flex-basis",m.noWrap()?null:"auto")("min-width",m.noWrap()?null:"fit-content"),d.AVh("selected",m.selected())("ghost","ghost"===m.variant())("fit-parent-width",m.fitParentWidth()),d.Y8G("disabled",m.disabled())("cueTooltip",m.tooltip())("tooltipPlacement","top")("cuePulse",m.loading()))},dependencies:[u.MD,v.d,p.V],styles:['[_nghost-%COMP%]:has(.fit-parent-width){display:contents}@keyframes _ngcontent-%COMP%_pulse-border{0%{box-shadow:0 0 0 0 var(--focus-color)}50%{box-shadow:0 0 0 8px transparent}to{box-shadow:0 0 0 0 transparent}}button[_ngcontent-%COMP%]{min-width:0;pulse-border-radius:var(--cue-button-border-radius);appearance:none;padding:0;font:inherit;border:var(--cue-button-border-width) var(--cue-button-border-style) var(--cue-button-border-color);display:flex;justify-content:space-between;align-items:center;gap:var(--cue-button-gap);min-height:var(--button-height);height:auto;background-color:var(--background-color);border-radius:var(--cue-button-border-radius, 9999px);margin:3px;position:relative}button[style*="white-space: normal"][_ngcontent-%COMP%]{border-radius:30px!important;padding:10px!important}button.fit-parent-width[_ngcontent-%COMP%]{width:100%;min-width:0;margin-inline:0}button[_ngcontent-%COMP%]:not(.fit-parent-width){min-width:fit-content;width:auto}button[_ngcontent-%COMP%]:focus{outline:none}button[_ngcontent-%COMP%]:hover:not(:disabled), button[_ngcontent-%COMP%]:focus-within:not(:disabled){outline:1px solid var(--focus-color);outline-offset:2px;cursor:pointer}button.selected[_ngcontent-%COMP%]{outline:1px solid currentColor!important;outline-offset:2px;margin:3px}button.ghost[_ngcontent-%COMP%]:not(.selected){border:none}']})}return l})()},57293(D,f,n){n.d(f,{x:()=>g});var u=n(17705),i=n(85802),c=n(32271),v=n(44613),p=n(77089),d=n(59352),a=n(35547);function _(l,M){1&l&&a.nrm(0,"cue-logo",4)}let g=(()=>{class l{projectId=(0,u.hFB)(void 0);resourceId=(0,u.hFB)(void 0);_active=(0,i.vPA)(!0);onHover(){this._active.set(!1),requestAnimationFrame(()=>this._active.set(!0))}_title=(0,c.EW)(()=>this.projectId()&&this.resourceId()?"components.logoLink.showResourceInCue":this.projectId()?"components.logoLink.openProjectInCue":"components.logoLink.openCuePortal");_href=(0,c.EW)(()=>{const b=this.projectId(),h=this.resourceId();return b&&h?`https://cue.qaecy.com/r/${encodeURIComponent(b)}/${encodeURIComponent(h)}`:b?`https://cue.qaecy.com/home/projects?p=${encodeURIComponent(b)}`:"https://cue.qaecy.com/home/projects"});static \u0275fac=function(h){return new(h||l)};static \u0275cmp=a.VBU({type:l,selectors:[["cue-logo-link"]],inputs:{projectId:[1,"projectId"],resourceId:[1,"resourceId"]},decls:6,vars:5,consts:[["target","_blank","rel","noopener noreferrer",1,"link",3,"mouseenter","href"],[1,"logo-stack",3,"cueTooltip"],["size","xs",1,"logo-bg"],[1,"logo-fg"],["size","xs"]],template:function(h,m){1&h&&(a.j41(0,"a",0),a.bIt("mouseenter",function(){return m.onHover()}),a.j41(1,"div",1),a.nI1(2,"transloco"),a.nrm(3,"cue-logo",2),a.j41(4,"div",3),a.nVh(5,_,1,0,"cue-logo",4),a.k0s()()()),2&h&&(a.Y8G("href",m._href(),a.B4B),a.R7$(),a.Y8G("cueTooltip",a.bMT(2,3,m._title())),a.R7$(4),a.vxM(m._active()?5:-1))},dependencies:[v.Logo,p.d,d.Kj],styles:["[_nghost-%COMP%]{display:inline-block;line-height:0}.link[_ngcontent-%COMP%]{display:block;text-decoration:none;cursor:pointer}.logo-stack[_ngcontent-%COMP%]{position:relative;display:inline-block;line-height:0}.logo-bg[_ngcontent-%COMP%]{display:block;opacity:.3;transition:opacity .2s ease}.link[_ngcontent-%COMP%]:hover .logo-bg[_ngcontent-%COMP%]{opacity:.15}.logo-fg[_ngcontent-%COMP%]{position:absolute;inset:0;opacity:0;transition:opacity .15s ease}.link[_ngcontent-%COMP%]:hover .logo-fg[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})}return l})()},2403(D,f,n){n.d(f,{V:()=>v});var u=n(17705),i=n(35547),c=n(85802);let v=(()=>{class p{el=(0,c.WQX)(i.aKT);renderer=(0,c.WQX)(i.sFG);cuePulse=(0,u.hFB)(!1);cuePulseColor=(0,u.hFB)("");cuePulseMode=(0,u.hFB)("border");activeClass="";constructor(){this.ensureGlobalStyles()}onPulseChanged=(0,c.QZP)(()=>{const a=this.cuePulse(),_=this.cuePulseColor(),g=this.cuePulseMode(),l=this.el.nativeElement;if(this.activeClass&&(this.renderer.removeClass(l,this.activeClass),this.activeClass=""),this.renderer.removeStyle(l,"--cue-pulse-color"),this.renderer.removeStyle(l,"border-radius"),a){const M="text"===g?"cue-pulse-text":"cue-pulse-border";this.renderer.addClass(l,M),this.activeClass=M,_&&this.renderer.setStyle(l,"--cue-pulse-color",_),"border"===g&&setTimeout(()=>{const b=l.firstElementChild;if(b){const h=getComputedStyle(b).borderRadius;h&&"0px"!==h&&this.renderer.setStyle(l,"border-radius",h)}})}});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 _=document.createElement("style");_.id=a,_.textContent="\n @keyframes cue-pulse-border-anim {\n 0% {\n box-shadow: 0 0 0 0 var(--cue-pulse-color, currentColor);\n }\n 70% {\n box-shadow: 0 0 0 8px transparent;\n }\n 100% {\n box-shadow: 0 0 0 0 transparent;\n }\n }\n\n @keyframes cue-pulse-text-anim {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.4;\n }\n }\n\n .cue-pulse-border {\n animation: cue-pulse-border-anim 1.5s infinite ease-in-out;\n }\n\n .cue-pulse-text {\n animation: cue-pulse-text-anim 1.5s infinite ease-in-out;\n }\n ",document.head.appendChild(_)}static \u0275fac=function(_){return new(_||p)};static \u0275dir=i.FsC({type:p,selectors:[["","cuePulse",""]],inputs:{cuePulse:[1,"cuePulse"],cuePulseColor:[1,"cuePulseColor"],cuePulseMode:[1,"cuePulseMode"]}})}return p})()},67719(D,f,n){n.d(f,{CueDocumentCharts:()=>j});var u=n(17705),i=n(85802),c=n(32271),v=n(23615),p=n(7993),d=n(61519),a=n(99811),_=n(13319),g=n(75448),l=n(2014),M=n(85971),b=n(35381),h=n(42245),m=n(97851),E=n(59352),y=n(57293),e=n(35547);const B=r=>({suffix:r}),O=r=>({type:r});function I(r,C){if(1&r&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-typography",3),e.EFF(2),e.k0s()()),2&r){const t=e.XpG();e.R7$(2),e.SpI(" ",t.errorMessage()," ")}}function x(r,C){if(1&r){const t=e.RV6();e.j41(0,"div",7)(1,"cue-block-documents-by-suffix",8),e.bIt("navigated",function(s){i.eBV(t);const P=e.XpG(2);return i.Njj(P.handleNavigated(s,"suffix"))}),e.k0s()()}if(2&r){const t=e.XpG(2);e.xc7("height",t.chartHeight(),"px")("--cue-pie-chart-height",t.chartHeight()+"px"),e.R7$(),e.Y8G("data",C)("config",t.blockConfig())}}function L(r,C){if(1&r){const t=e.RV6();e.j41(0,"div",7)(1,"cue-block-documents-by-content-category",8),e.bIt("navigated",function(s){i.eBV(t);const P=e.XpG(2);return i.Njj(P.handleNavigated(s,"content-category"))}),e.k0s()()}if(2&r){const t=e.XpG(2);e.xc7("height",t.chartHeight(),"px")("--cue-pie-chart-height",t.chartHeight()+"px"),e.R7$(),e.Y8G("data",C)("config",t.blockConfig())}}function W(r,C){if(1&r&&(e.EFF(0),e.nI1(1,"transloco")),2&r){const t=e.XpG(3);e.SpI(" ",e.i5U(1,1,"components.documentCharts.listDocumentsBySuffix",e.eq3(4,B,t._activeSelection().label))," ")}}function T(r,C){if(1&r&&(e.EFF(0),e.nI1(1,"transloco")),2&r){const t=e.XpG(3);e.SpI(" ",e.i5U(1,1,"components.documentCharts.listDocumentsByType",e.eq3(4,O,t._activeSelection().label))," ")}}function w(r,C){if(1&r){const t=e.RV6();e.j41(0,"cue-flexcontainer",6)(1,"cue-button",9),e.bIt("click",function(){i.eBV(t);const s=e.XpG(2);return i.Njj(s.onShowListButtonClick())}),e.nrm(2,"cue-button-padder")(3,"cue-button-icon",10),e.j41(4,"cue-button-label"),e.nVh(5,W,2,6)(6,T,2,6),e.k0s(),e.nrm(7,"cue-button-padder"),e.k0s()()}if(2&r){const t=e.XpG(2);e.R7$(5),e.vxM("suffix"===t._activeSelection().filterBy&&t._activeSelection().label.startsWith(".")?5:6)}}function R(r,C){if(1&r&&(e.j41(0,"cue-flexcontainer",4),e.nVh(1,x,2,6,"div",5),e.nVh(2,L,2,6,"div",5),e.k0s(),e.nVh(3,w,8,1,"cue-flexcontainer",6)),2&r){let t,o;const s=e.XpG();e.Y8G("direction",s.stackCharts()?"column":"row"),e.R7$(),e.vxM((t="content-category"!==s.mode()&&s.bySuffix())?1:-1,t),e.R7$(),e.vxM((o="suffix"!==s.mode()&&s.byContentCategory())?2:-1,o),e.R7$(),e.vxM(s.showDocumentListButton()&&s._activeSelection()?3:-1)}}function S(r,C){if(1&r&&e.nrm(0,"cue-logo-link",2),2&r){const t=e.XpG();e.Y8G("projectId",t.projectId())}}let j=(()=>{class r{_blockCtx=(0,i.WQX)(a.z);projectId=(0,u.hFB)(void 0);sdkState=(0,u.hFB)(void 0);mode=(0,u.hFB)("both");stackCharts=(0,u.hFB)(!1);chartHeight=(0,u.hFB)(400);selected=(0,u.CGW)();selectionCleared=(0,u.CGW)();showDocumentListButton=(0,u.hFB)(!1,{transform:u.L39});showLogo=(0,u.hFB)(!1,{transform:u.L39});showInDocumentList=(0,u.CGW)();state=(0,i.vPA)("idle");errorMessage=(0,i.vPA)(null);_activeSelection=(0,i.vPA)(null);_rawData=(0,i.vPA)(void 0);bySuffix=(0,c.EW)(()=>{const t=this._rawData();if(t?.documentsBySuffix&&0!==Object.keys(t.documentsBySuffix).length)return{documents:t.documentsBySuffix}});byContentCategory=(0,c.EW)(()=>{const t=this._rawData();if(t?.documentsByContentCategory&&0!==Object.keys(t.documentsByContentCategory).length)return{documents:t.documentsByContentCategory}});blockConfig=(0,c.EW)(()=>({projectId:this.projectId()??"",portalBaseURL:"",resourceBaseURL:"",graphIsSaturated:!1,privileges:new d.c,handlers:new d.$}));_ownedView;_unsubscribeCategories;_unsubscribeDocumentsData;_lastSetupSignature;constructor(){(0,i.QZP)(()=>{const t=this.projectId(),o=this.sdkState();if(!o)return this._clearRuntimeState(),void this.state.set("idle");const s={projectId:t,cue:o.cue,view:o.view,documents:o.documents,language:o.language,mode:this.mode()};this._isSameSetupSignature(s)||(this._setupFromSdkState(t,o),this._lastSetupSignature=s)})}ngOnDestroy(){this._cleanupSubscriptions(),this._cleanupOwnedView()}handleNavigated(t,o){if(!t)return this._activeSelection.set(null),void this.selectionCleared.emit({chart:o});const s={filterBy:"suffix"===t.filterBy?"suffix":"content-category",values:t.values.filter(P=>"__grouped_small__"!==P),label:t.label};this._activeSelection.set(s),this.selected.emit(s)}onShowListButtonClick(){const t=this._activeSelection();t&&this.showInDocumentList.emit(t)}_setupFromSdkState(t,o){if(this._cleanupSubscriptions(),this._cleanupOwnedView(),this._rawData.set(void 0),o.availableContentCategories&&this._blockCtx.availableContentCategories.set(o.availableContentCategories),o.documents)return o.documents.setLanguage(o.language??"en"),void this._bindDocumentsData(o.documents);if(o.view)return o.view.setLanguage(o.language??"en"),this._bindDocumentsData(o.view.documents),void(o.availableContentCategories||this._bindCategoriesFromView(o.view));if(o.cue&&t){const s=o.cue.createProjectView(t,{language:o.language??"en"});return this._ownedView=s,this._bindDocumentsData(s.documents),void("suffix"!==this.mode()&&!o.availableContentCategories&&this._bindCategoriesFromView(s))}this.errorMessage.set("sdkState must include cue, view, or documents to load data."),this.state.set("error")}_bindDocumentsData(t){this.state.set("loading");const o=()=>{const s=t.projectDocumentsData.get();s&&Object.keys(s.documentsBySuffix).length>0&&(0,c.O8)(()=>{this._rawData.set(s),this.state.set("ready")})};o(),this._unsubscribeDocumentsData=t.projectDocumentsData.subscribe(()=>o())}_bindCategoriesFromView(t){const o=()=>{this._blockCtx.availableContentCategories.set(t.availableContentCategories.get())};o(),this._unsubscribeCategories=t.availableContentCategories.subscribe(o)}_clearRuntimeState(){this._cleanupSubscriptions(),this._cleanupOwnedView(),this._rawData.set(void 0),this._blockCtx.availableContentCategories.set(void 0),this.errorMessage.set(null),this._lastSetupSignature=void 0}_cleanupSubscriptions(){this._unsubscribeCategories?.(),this._unsubscribeCategories=void 0,this._unsubscribeDocumentsData?.(),this._unsubscribeDocumentsData=void 0}_cleanupOwnedView(){this._ownedView&&(this._ownedView.destroy(),this._ownedView=void 0)}_isSameSetupSignature(t){const o=this._lastSetupSignature;return!!o&&o.projectId===t.projectId&&o.cue===t.cue&&o.view===t.view&&o.documents===t.documents&&o.language===t.language&&o.mode===t.mode}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=e.VBU({type:r,selectors:[["cue-document-charts"]],inputs:{projectId:[1,"projectId"],sdkState:[1,"sdkState"],mode:[1,"mode"],stackCharts:[1,"stackCharts"],chartHeight:[1,"chartHeight"],showDocumentListButton:[1,"showDocumentListButton"],showLogo:[1,"showLogo"]},outputs:{selected:"selected",selectionCleared:"selectionCleared",showInDocumentList:"showInDocumentList"},features:[e.Jv_([a.z])],decls:4,vars:5,consts:[[3,"cueLogoLoader"],["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","absolute","bottom","8px","right","8px","z-index","5",3,"projectId"],[2,"color","#c44","font-size","13px"],["align","stretch",2,"width","100%",3,"direction"],[1,"chart-wrapper",3,"height","--cue-pie-chart-height"],["justify","center"],[1,"chart-wrapper"],[3,"navigated","data","config"],["size","s","variant","secondary",3,"click"],["icon","filter"]],template:function(o,s){1&o&&(e.j41(0,"div",0),e.nVh(1,I,3,1,"cue-flexcontainer",1)(2,R,4,4),e.nVh(3,S,1,1,"cue-logo-link",2),e.k0s()),2&o&&(e.xc7("min-height",s.chartHeight(),"px"),e.Y8G("cueLogoLoader","loading"===s.state()),e.R7$(),e.vxM("error"===s.state()?1:"ready"===s.state()?2:-1),e.R7$(2),e.vxM(s.showLogo()?3:-1))},dependencies:[v.Y,p.o,b.FlexContainer,h.Typography,M.Button,g.ButtonLabel,l.ButtonPadder,_.ButtonIcon,m.k,y.x,E.Kj],styles:["[_nghost-%COMP%]{display:block;width:100%}.chart-wrapper[_ngcontent-%COMP%]{flex:1;min-width:0;position:relative}cue-block-documents-by-suffix[_ngcontent-%COMP%], cue-block-documents-by-content-category[_ngcontent-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return r})()}}]);
|
package/7727.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[7727],{74631(se,B,u){u.d(B,{G:()=>ue});var M=u(10467),f=u(17705),y=u(32271),h=u(85802),l=u(35381),V=u(86117),G=u(8547),I=u(13319),T=u(85971),j=u(42245),$=u(31024),S=u(89421),U=u(55794),w=u(59352),O=u(77573),X=u(49769),e=u(35547);const W=(o,C)=>t=>t.isHighlight;function H(o,C){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 z(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){h.eBV(t);const r=e.XpG(2).$implicit,v=e.XpG();return h.Njj(v.onDeleteHighlight(i,r.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function Y(o,C){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){h.eBV(t);const i=e.XpG().$implicit,r=e.XpG();return h.Njj(r.onHighlightClick(i.highlight))}),e.nVh(1,H,2,1,"span",3),e.EFF(2),e.nVh(3,z,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 J(o,C){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 Q(o,C){if(1&o&&e.nVh(0,Y,4,4,"span",1)(1,J,2,2,"span"),2&o){const t=C.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let K=(()=>{class o{path=f.hFB.required();highlights=(0,f.hFB)([]);allowDelete=(0,f.hFB)(!1);allowAdd=(0,f.hFB)(!1);size=(0,f.hFB)("m");highlightClick=(0,f.CGW)();deleteHighlight=(0,f.CGW)();textSelected=(0,f.CGW)();segments=(0,y.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(_=>_.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const r=[...i].sort((_,ie)=>_.start-ie.start),v=[];let b=0;for(const _ of r)_.start>b&&v.push({text:t.substring(b,_.start),isHighlight:!1,segmentStart:b}),v.push({text:t.substring(_.start,_.end),isHighlight:!0,highlight:_,segmentStart:_.start}),b=_.end;return b<t.length&&v.push({text:t.substring(b),isHighlight:!1,segmentStart:b}),v}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 r=n.getRangeAt(0),v=t.currentTarget,b=this.getAbsoluteOffset(v,r.startContainer,r.startOffset),_=this.getAbsoluteOffset(v,r.endContainer,r.endOffset);n.removeAllRanges(),_>b&&this.textSelected.emit({path:this.path(),start:b,end:_,text:this.path().substring(b,_)})}getAbsoluteOffset(t,n,i){let r=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;r&&r!==t;){if(r instanceof HTMLElement&&r.hasAttribute("data-segment-start")){const ie=parseInt(r.getAttribute("data-segment-start"),10);let ae=0;const le=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);let k=le.nextNode();for(;k&&k!==n;)ae+=k.textContent?.length??0,k=le.nextNode();return ie+ae+i}r=r.parentElement}const v=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let b=0,_=v.nextNode();for(;_&&_!==n;)b+=_.textContent?.length??0,_=v.nextNode();return b+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(v){return i.onMouseUp(v)}),e.Z7z(1,Q,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,W,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[X.MD,T.Button,I.ButtonIcon],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=u(75448),q=u(70063),ee=u(59695),m=u(55745),x=u(19682);const a=o=>({count:o}),d=(o,C)=>t=>t.iri;function g(o,C){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 s(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){h.eBV(t);const r=e.XpG(4);return h.Njj(r.onMatchedPathsSelectionChange(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("rowData",t._matchTableRowData())("columnDefs",t._matchTableColDefs())("rowSelection",t._matchTableRowSelection)}}function c(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){h.eBV(t);const i=e.XpG(3);return h.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,s,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,a,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,a,t._selectedPaths().length)))}}function p(o,C){if(1&o&&e.nVh(0,g,3,3,"cue-typography",11)(1,c,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function P(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){h.eBV(t);const r=e.XpG();return h.Njj(r.onApplyToAllChange(i))}),e.k0s(),e.j41(2,"cue-typography",11),e.EFF(3),e.nI1(4,"transloco"),e.k0s()(),e.nVh(5,p,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 R(o,C){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 D=(()=>{class o{selection=f.hFB.required();availableEntityCategories=(0,f.hFB)([]);fileLocations=(0,f.hFB)([]);requestFileLocations=(0,f.hFB)(void 0);requestFilePathEntityAdd=(0,f.hFB)(void 0);confirm=(0,f.CGW)();cancel=(0,f.CGW)();_selectedEntityCategory=(0,h.vPA)("");_applyToAllFiles=(0,h.vPA)(!1);_fileLocations=(0,h.vPA)(null);_fileLocationsLoading=(0,h.vPA)(!1);_matchTableExpanded=(0,h.vPA)(!1);_selectedPaths=(0,h.vPA)([]);_saving=(0,h.vPA)(!1);_saveError=(0,h.vPA)(null);_dirPrefix=(0,y.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,y.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,y.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,y.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,y.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,w.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,y.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,M.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 r=yield i();n._fileLocations.set(r);const v=n._dirPrefix();n._selectedPaths.set(r.filter(b=>b.path.startsWith(v)))}finally{n._fileLocationsLoading.set(!1)}}})()}onMatchedPathsSelectionChange(t){const n=this._fileLocations()??[];this._selectedPaths.set(t.map(i=>n.find(r=>r.path===i.path)??{iri:"",path:i.path}))}onConfirm(){var t=this;return(0,M.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,r=t._fileLocations()?.find(_=>_.path===i)??t.fileLocations().find(_=>_.path===i)??{iri:"",path:i},v=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[r],b=t.requestFilePathEntityAdd();if(b){t._saving.set(!0),t._saveError.set(null);try{yield b(n,v)}catch(_){return console.error("[EntityMentionModal] Failed to save entity mention:",_),t._saveError.set(_ instanceof Error?_.message:String(_)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:v})})()}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(v){return i.onEntityCategoryChange(v)}),e.k0s(),e.nVh(7,P,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,R,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,d,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:[l.FlexContainer,S.F,I.ButtonIcon,T.Button,Z.ButtonLabel,j.Typography,m.a,q.Select,ee.Switch,x.R,w.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const L=()=>[];function te(o,C){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 F(o,C){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nVh(1,te,2,4,"cue-key-val",6),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.subject()?1:-1)}}function N(o,C){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 A(o,C){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 oe(o,C){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 ne(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){h.eBV(t);const i=e.XpG(3);return h.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 E(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){h.eBV(t);const i=e.XpG(3);return h.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 re(o,C){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,oe,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,ne,2,1,"cue-button",17),e.j41(8,"cue-file-path-viewer",18),e.bIt("textSelected",function(i){h.eBV(t);const r=e.XpG(2);return h.Njj(r.onTextSelected(i))}),e.k0s(),e.nVh(9,E,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,L))("allowDelete",t.filePathEntitiesEditable())("allowAdd",t.filePathEntitiesEditable()),e.R7$(),e.vxM(t.fileLocations().length>1?9:-1)}}function ce(o,C){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nrm(1,"hr"),e.nVh(2,A,3,8,"cue-key-val-editable",11),e.nVh(3,re,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 de(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){h.eBV(t);const r=e.XpG();return h.Njj(r.onEntityMentionConfirm(i))})("cancel",function(){h.eBV(t);const i=e.XpG();return h.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 ue=(()=>{class o{subject=f.hFB.required();handlers=f.hFB.required();dataChanged=(0,f.CGW)();filePathEntityAdded=(0,f.CGW)();fileLocations=(0,f.hFB)([]);_fileLocationsProvider=(0,y.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,f.geq)([]);contentCategories=(0,f.hFB)([]);contentCategoriesEditable=(0,f.hFB)(!1);filePathEntitiesVisible=(0,f.hFB)(!1);filePathEntitiesEditable=(0,f.hFB)(!1);menuItems=(0,f.hFB)([]);availableContentCategories=(0,f.hFB)([]);availableEntityCategories=(0,f.hFB)([]);collapsed=(0,f.hFB)(!1);hasDocInfo=(0,y.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,h.vPA)(0);_entityCategoryModalVisible=(0,h.vPA)(!1);_pendingSelection=(0,h.vPA)(null);_requestFilePathEntityAdd=(0,y.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,M.A)(function*(r,v){const b=t._pendingSelection();b&&(yield n({paths:v,start:b.start,end:b.end,text:b.text,entityCategory:r,folderPath:b.path.substring(0,b.end)}))});return function(r,v){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,y.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,y.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(r=>({path:r.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,y.uu)(()=>this.contentCategories());contentCategoriesString=(0,y.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,w.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,y.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,r)=>(i[r.iri]=r.label,i),{}),requestSave:(i=(0,M.A)(function*(r){console.log(r);const v={subject:t.subject(),predicate:`${O.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:r.newValue,type:"contentCategory",comment:r.comment};yield n(v),t._contentCategories.set(r.newValue),t.dataChanged.emit({contentCategories:r.newValue})}),function(v){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,F,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,N,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,ce,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,de,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:[l.FlexContainer,$.p,S.F,U.L,V.W,G.T,I.ButtonIcon,T.Button,K,j.Typography,D,w.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})()},77727(se,B,u){u.d(B,{CueDocumentViewer:()=>ee});var M=u(10467),f=u(17705),y=u(32271),h=u(85802),l=u(35547),V=u(49769),G=u(35381),I=u(42245),T=u(65187),j=u(74631);class ${requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var S=u(2065),U=u(57293);const w=["viewerHost"];function O(m,x){if(1&m&&l.nrm(0,"cue-document-info",4),2&m){const a=l.XpG(2);l.Y8G("subject",a._docSubject())("handlers",a._docInfoHandlers)("menuItems",a._menuItems())}}function X(m,x){1&m&&(l.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),l.EFF(2,"Loading\u2026"),l.k0s()())}function e(m,x){if(1&m&&(l.j41(0,"cue-flexcontainer",5)(1,"cue-typography",8),l.EFF(2),l.k0s()()),2&m){const a=l.XpG(2);l.R7$(2),l.JRh(a.errorMessage())}}function W(m,x){if(1&m&&l.nrm(0,"cue-logo-link",7),2&m){const a=l.XpG(2);l.Y8G("projectId",a.projectId())("resourceId",a._uuidOnly())}}function H(m,x){if(1&m&&(l.j41(0,"div",3),l.nVh(1,O,1,3,"cue-document-info",4),l.nVh(2,X,3,0,"cue-flexcontainer",5)(3,e,3,1,"cue-flexcontainer",5),l.j41(4,"div",6),l.eu8(5,null,1),l.k0s(),l.nVh(7,W,1,2,"cue-logo-link",7),l.k0s()),2&m){const a=l.XpG();l.R7$(),l.vxM(a.showDocumentInfo()&&"ready"===a.state()?1:-1),l.R7$(),l.vxM("loading"===a.state()?2:"error"===a.state()?3:-1),l.R7$(5),l.vxM(a.showLogo()?7:-1)}}function z(m,x){1&m&&l.eu8(0)}function Y(m,x){if(1&m&&(l.j41(0,"cue-card",2),l.DNE(1,z,1,0,"ng-container",9),l.k0s()),2&m){const a=l.XpG(),d=l.sdS(1);l.Y8G("variant",a._cardVariant())("padded",!0),l.R7$(),l.Y8G("ngTemplateOutlet",d)}}function J(m,x){1&m&&l.eu8(0)}function Q(m,x){if(1&m&&l.DNE(0,J,1,0,"ng-container",9),2&m){l.XpG();const a=l.sdS(1);l.Y8G("ngTemplateOutlet",a)}}const K=[".ifc",".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 ee=(()=>{class m{set _viewerHostRef(a){if(this._viewerHost=a,a&&this._lastRenderArgs){const{url:d,suffix:g,page:s,viewerTypeOverride:c}=this._lastRenderArgs;this._renderViewer(d,g,s,c)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,f.hFB)(void 0);uuid=(0,f.hFB)(void 0);projectId=(0,f.hFB)(void 0);showDocumentInfo=(0,f.hFB)(!0,{transform:f.L39});showLogo=(0,f.hFB)(!1,{transform:f.L39});_uuidOnly=(0,y.EW)(()=>{const a=this.uuid();return a?a.split("?")[0].trim():void 0});extraMenuItems=(0,f.hFB)([]);portalBaseURL=(0,f.hFB)("https://cue.qaecy.com");variant=(0,f.hFB)("none");_cardVariant=(0,y.EW)(()=>this.variant());state=(0,h.vPA)("idle");errorMessage=(0,h.vPA)(null);resolvedUrl=(0,h.vPA)(null);resolvedSuffix=(0,h.vPA)(null);_docSubject=(0,h.vPA)("");_alternatives=(0,h.vPA)([]);_originalUuid=(0,h.vPA)(null);_originalDocSuffix=(0,h.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_inputWarningTimer;_blobUrls=new Set;_docInfoHandlers=new $;_menuItems=(0,y.EW)(()=>{const a=[],d=this._originalUuid(),g=this._originalDocSuffix();d&&g&&a.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const s=this._alternatives();if(s.length>1){const c=this.resolvedSuffix();a.push({icon:"document",label:"Alternative representation",children:s.map(p=>({label:p.original?`Original (${p.suffix.replace(".","").toUpperCase()})`:p.suffix.replace(".","").toUpperCase(),tooltip:c===p.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(p)}))})}return a.push(...this.extraMenuItems()),a});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,h.QZP)(()=>{const a=this.cue(),d=this.uuid(),g=this.projectId();a&&d&&g?this._load(a,d,g):this.state.set("idle")})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._blobUrls.forEach(a=>URL.revokeObjectURL(a))}_load(a,d,g){var s=this;return(0,M.A)(function*(){if(a&&d&&g){s.state.set("loading"),s.resolvedUrl.set(null),s.resolvedSuffix.set(null),s.errorMessage.set(null),s._docSubject.set(""),s._originalUuid.set(null),s._originalDocSuffix.set(null),s._alternatives.set([]),s._viewerHost?.clear(),s.currentViewerRef?.destroy(),s.currentViewerRef=void 0,s._lastRenderArgs=void 0;try{s._cueSnapshot=a,s._projectIdSnapshot=g;const{uuid:c,page:p}=function Z(m){const[x,a]=m.split("?"),d=x.trim();let g=null;if(a){const c=new URLSearchParams(a).get("page");if(null!==c){const p=parseInt(c,10);!isNaN(p)&&p>0&&(g=p)}}return{uuid:d,page:g}}(d),P=a.createProjectDocuments(g),D=(yield P.fetchDocumentData([c]))[c];if(!D)throw new Error(`Document '${c}' not found in project '${g}'.`);s._docSubject.set(D.subject??""),s._originalUuid.set(c),s._originalDocSuffix.set(D.suffix);const L=yield P.fetchAlternativeRepresentations(c);s._alternatives.set([{uuid:c,suffix:D.suffix,original:!0},...L.filter(E=>E.id!==c).map(E=>({uuid:E.id,suffix:E.suffix,original:!1,remoteRelativePath:E.remoteRelativePath}))]);const{uuid:te,suffix:F,remoteRelativePath:N}=function q(m,x){const a=[m,...x];let d,g=1/0;for(const s of a){const c=K.indexOf(s.suffix);-1!==c&&c<g&&(g=c,d=s)}return d?{uuid:d.id,suffix:d.suffix,remoteRelativePath:d.remoteRelativePath}:{uuid:m.id,suffix:m.suffix}}(D,L),A=N?yield s._toBlobUrl(a,a.storage.getAltRepDownloadUrl(N),g):yield s._toBlobUrl(a,a.storage.getDownloadUrl(g,te,F),g);s.resolvedUrl.set(A),s.resolvedSuffix.set(F);const ne=[".eml",".msg",".emlx",".mbx"].includes(D.suffix)&&".json"===F?"email":void 0;yield s._renderViewer(A,F,p,ne),s.state.set("ready")}catch(c){const p=c instanceof Error?c.message:String(c);console.error("[CueDocumentViewerWC] Failed to load document:",p),s.errorMessage.set(p),s.state.set("error")}}else s.state.set("idle")})()}_toBlobUrl(a,d,g){var s=this;return(0,M.A)(function*(){const c=yield a.auth.authenticatedFetch(d,{headers:{"cue-project-id":g}});if(!c.ok)throw new Error(`Failed to fetch document: ${c.status} ${c.statusText}`);const p=URL.createObjectURL(yield c.blob());return s._blobUrls.add(p),p})()}_renderViewer(a,d,g,s){var c=this;return(0,M.A)(function*(){try{const{DocumentViewer:p}=yield Promise.all([u.e(2076),u.e(3036)]).then(u.bind(u,43036)),{DocumentViewerSettings:P}=yield u.e(2076).then(u.bind(u,43418));c._viewerHost?.clear(),c.currentViewerRef?.destroy();const R=new P;if(null!==g&&(R.pdf.page=String(g)),!c._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");c._lastRenderArgs={url:a,suffix:d,page:g,viewerTypeOverride:s},c.currentViewerRef=c._viewerHost.createComponent(p),c.currentViewerRef.setInput("url",a),c.currentViewerRef.setInput("suffix",d),c.currentViewerRef.setInput("settings",R),s&&c.currentViewerRef.setInput("viewerTypeOverride",s)}catch(p){throw new Error(`Failed to load viewer component: ${p instanceof Error?p.message:String(p)}`)}})()}_switchToAlternative(a){var d=this;return(0,M.A)(function*(){const g=d._cueSnapshot,s=d._projectIdSnapshot;if(g&&s)try{const c=a.remoteRelativePath?yield d._toBlobUrl(g,g.storage.getAltRepDownloadUrl(a.remoteRelativePath),s):yield d._toBlobUrl(g,g.storage.getDownloadUrl(s,a.uuid,a.suffix),s);d.resolvedUrl.set(c),d.resolvedSuffix.set(a.suffix),yield d._renderViewer(c,a.suffix,null)}catch(c){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",c)}})()}_downloadOriginal(){var a=this;return(0,M.A)(function*(){const d=a._cueSnapshot,g=a._projectIdSnapshot,s=a._originalUuid(),c=a._originalDocSuffix();if(d&&g&&s&&c)try{const p=yield d.storage.downloadBlob(g,s,c);(0,S.KE)(p,`${s}${c}`)}catch(p){console.error("[CueDocumentViewerWC] Failed to download original:",p)}})()}static \u0275fac=function(d){return new(d||m)};static \u0275cmp=l.VBU({type:m,selectors:[["cue-document-viewer-wc"]],viewQuery:function(d,g){if(1&d&&l.GBs(w,5,l.c1b),2&d){let s;l.mGM(s=l.lsd())&&(g._viewerHostRef=s.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(d,g){1&d&&(l.DNE(0,H,8,3,"ng-template",null,0,l.C5r),l.nVh(2,Y,2,3,"cue-card",2)(3,Q,1,1,"ng-container")),2&d&&(l.R7$(2),l.vxM("none"!==g.variant()?2:3))},dependencies:[V.MD,V.T3,G.FlexContainer,I.Typography,j.G,T.Card,U.x],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return m})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[7727],{74631(se,B,u){u.d(B,{G:()=>ue});var M=u(10467),f=u(17705),y=u(32271),h=u(85802),l=u(35381),V=u(86117),G=u(8547),I=u(13319),T=u(85971),j=u(42245),$=u(31024),S=u(89421),U=u(55794),w=u(59352),O=u(77573),X=u(49769),e=u(35547);const W=(o,C)=>t=>t.isHighlight;function H(o,C){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 z(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){h.eBV(t);const r=e.XpG(2).$implicit,v=e.XpG();return h.Njj(v.onDeleteHighlight(i,r.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function Y(o,C){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){h.eBV(t);const i=e.XpG().$implicit,r=e.XpG();return h.Njj(r.onHighlightClick(i.highlight))}),e.nVh(1,H,2,1,"span",3),e.EFF(2),e.nVh(3,z,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 J(o,C){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 Q(o,C){if(1&o&&e.nVh(0,Y,4,4,"span",1)(1,J,2,2,"span"),2&o){const t=C.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let K=(()=>{class o{path=f.hFB.required();highlights=(0,f.hFB)([]);allowDelete=(0,f.hFB)(!1);allowAdd=(0,f.hFB)(!1);size=(0,f.hFB)("m");highlightClick=(0,f.CGW)();deleteHighlight=(0,f.CGW)();textSelected=(0,f.CGW)();segments=(0,y.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(_=>_.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const r=[...i].sort((_,ie)=>_.start-ie.start),v=[];let b=0;for(const _ of r)_.start>b&&v.push({text:t.substring(b,_.start),isHighlight:!1,segmentStart:b}),v.push({text:t.substring(_.start,_.end),isHighlight:!0,highlight:_,segmentStart:_.start}),b=_.end;return b<t.length&&v.push({text:t.substring(b),isHighlight:!1,segmentStart:b}),v}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 r=n.getRangeAt(0),v=t.currentTarget,b=this.getAbsoluteOffset(v,r.startContainer,r.startOffset),_=this.getAbsoluteOffset(v,r.endContainer,r.endOffset);n.removeAllRanges(),_>b&&this.textSelected.emit({path:this.path(),start:b,end:_,text:this.path().substring(b,_)})}getAbsoluteOffset(t,n,i){let r=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;r&&r!==t;){if(r instanceof HTMLElement&&r.hasAttribute("data-segment-start")){const ie=parseInt(r.getAttribute("data-segment-start"),10);let ae=0;const le=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);let k=le.nextNode();for(;k&&k!==n;)ae+=k.textContent?.length??0,k=le.nextNode();return ie+ae+i}r=r.parentElement}const v=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let b=0,_=v.nextNode();for(;_&&_!==n;)b+=_.textContent?.length??0,_=v.nextNode();return b+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(v){return i.onMouseUp(v)}),e.Z7z(1,Q,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,W,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[X.MD,T.Button,I.ButtonIcon],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=u(75448),q=u(70063),ee=u(59695),m=u(21331),x=u(19682);const a=o=>({count:o}),d=(o,C)=>t=>t.iri;function g(o,C){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 s(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){h.eBV(t);const r=e.XpG(4);return h.Njj(r.onMatchedPathsSelectionChange(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("rowData",t._matchTableRowData())("columnDefs",t._matchTableColDefs())("rowSelection",t._matchTableRowSelection)}}function c(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){h.eBV(t);const i=e.XpG(3);return h.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,s,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,a,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,a,t._selectedPaths().length)))}}function p(o,C){if(1&o&&e.nVh(0,g,3,3,"cue-typography",11)(1,c,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function P(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){h.eBV(t);const r=e.XpG();return h.Njj(r.onApplyToAllChange(i))}),e.k0s(),e.j41(2,"cue-typography",11),e.EFF(3),e.nI1(4,"transloco"),e.k0s()(),e.nVh(5,p,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 R(o,C){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 D=(()=>{class o{selection=f.hFB.required();availableEntityCategories=(0,f.hFB)([]);fileLocations=(0,f.hFB)([]);requestFileLocations=(0,f.hFB)(void 0);requestFilePathEntityAdd=(0,f.hFB)(void 0);confirm=(0,f.CGW)();cancel=(0,f.CGW)();_selectedEntityCategory=(0,h.vPA)("");_applyToAllFiles=(0,h.vPA)(!1);_fileLocations=(0,h.vPA)(null);_fileLocationsLoading=(0,h.vPA)(!1);_matchTableExpanded=(0,h.vPA)(!1);_selectedPaths=(0,h.vPA)([]);_saving=(0,h.vPA)(!1);_saveError=(0,h.vPA)(null);_dirPrefix=(0,y.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,y.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,y.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,y.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,y.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,w.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,y.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,M.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 r=yield i();n._fileLocations.set(r);const v=n._dirPrefix();n._selectedPaths.set(r.filter(b=>b.path.startsWith(v)))}finally{n._fileLocationsLoading.set(!1)}}})()}onMatchedPathsSelectionChange(t){const n=this._fileLocations()??[];this._selectedPaths.set(t.map(i=>n.find(r=>r.path===i.path)??{iri:"",path:i.path}))}onConfirm(){var t=this;return(0,M.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,r=t._fileLocations()?.find(_=>_.path===i)??t.fileLocations().find(_=>_.path===i)??{iri:"",path:i},v=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[r],b=t.requestFilePathEntityAdd();if(b){t._saving.set(!0),t._saveError.set(null);try{yield b(n,v)}catch(_){return console.error("[EntityMentionModal] Failed to save entity mention:",_),t._saveError.set(_ instanceof Error?_.message:String(_)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:v})})()}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(v){return i.onEntityCategoryChange(v)}),e.k0s(),e.nVh(7,P,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,R,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,d,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:[l.FlexContainer,S.F,I.ButtonIcon,T.Button,Z.ButtonLabel,j.Typography,m.a,q.Select,ee.Switch,x.R,w.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const L=()=>[];function te(o,C){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 F(o,C){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nVh(1,te,2,4,"cue-key-val",6),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.subject()?1:-1)}}function N(o,C){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 A(o,C){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 oe(o,C){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 ne(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){h.eBV(t);const i=e.XpG(3);return h.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 E(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){h.eBV(t);const i=e.XpG(3);return h.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 re(o,C){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,oe,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,ne,2,1,"cue-button",17),e.j41(8,"cue-file-path-viewer",18),e.bIt("textSelected",function(i){h.eBV(t);const r=e.XpG(2);return h.Njj(r.onTextSelected(i))}),e.k0s(),e.nVh(9,E,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,L))("allowDelete",t.filePathEntitiesEditable())("allowAdd",t.filePathEntitiesEditable()),e.R7$(),e.vxM(t.fileLocations().length>1?9:-1)}}function ce(o,C){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nrm(1,"hr"),e.nVh(2,A,3,8,"cue-key-val-editable",11),e.nVh(3,re,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 de(o,C){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){h.eBV(t);const r=e.XpG();return h.Njj(r.onEntityMentionConfirm(i))})("cancel",function(){h.eBV(t);const i=e.XpG();return h.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 ue=(()=>{class o{subject=f.hFB.required();handlers=f.hFB.required();dataChanged=(0,f.CGW)();filePathEntityAdded=(0,f.CGW)();fileLocations=(0,f.hFB)([]);_fileLocationsProvider=(0,y.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,f.geq)([]);contentCategories=(0,f.hFB)([]);contentCategoriesEditable=(0,f.hFB)(!1);filePathEntitiesVisible=(0,f.hFB)(!1);filePathEntitiesEditable=(0,f.hFB)(!1);menuItems=(0,f.hFB)([]);availableContentCategories=(0,f.hFB)([]);availableEntityCategories=(0,f.hFB)([]);collapsed=(0,f.hFB)(!1);hasDocInfo=(0,y.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,h.vPA)(0);_entityCategoryModalVisible=(0,h.vPA)(!1);_pendingSelection=(0,h.vPA)(null);_requestFilePathEntityAdd=(0,y.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,M.A)(function*(r,v){const b=t._pendingSelection();b&&(yield n({paths:v,start:b.start,end:b.end,text:b.text,entityCategory:r,folderPath:b.path.substring(0,b.end)}))});return function(r,v){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,y.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,y.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(r=>({path:r.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,y.uu)(()=>this.contentCategories());contentCategoriesString=(0,y.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,w.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,y.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,r)=>(i[r.iri]=r.label,i),{}),requestSave:(i=(0,M.A)(function*(r){console.log(r);const v={subject:t.subject(),predicate:`${O.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:r.newValue,type:"contentCategory",comment:r.comment};yield n(v),t._contentCategories.set(r.newValue),t.dataChanged.emit({contentCategories:r.newValue})}),function(v){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,F,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,N,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,ce,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,de,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:[l.FlexContainer,$.p,S.F,U.L,V.W,G.T,I.ButtonIcon,T.Button,K,j.Typography,D,w.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})()},77727(se,B,u){u.d(B,{CueDocumentViewer:()=>ee});var M=u(10467),f=u(17705),y=u(32271),h=u(85802),l=u(35547),V=u(49769),G=u(35381),I=u(42245),T=u(65187),j=u(74631);class ${requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var S=u(2065),U=u(57293);const w=["viewerHost"];function O(m,x){if(1&m&&l.nrm(0,"cue-document-info",4),2&m){const a=l.XpG(2);l.Y8G("subject",a._docSubject())("handlers",a._docInfoHandlers)("menuItems",a._menuItems())}}function X(m,x){1&m&&(l.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),l.EFF(2,"Loading\u2026"),l.k0s()())}function e(m,x){if(1&m&&(l.j41(0,"cue-flexcontainer",5)(1,"cue-typography",8),l.EFF(2),l.k0s()()),2&m){const a=l.XpG(2);l.R7$(2),l.JRh(a.errorMessage())}}function W(m,x){if(1&m&&l.nrm(0,"cue-logo-link",7),2&m){const a=l.XpG(2);l.Y8G("projectId",a.projectId())("resourceId",a._uuidOnly())}}function H(m,x){if(1&m&&(l.j41(0,"div",3),l.nVh(1,O,1,3,"cue-document-info",4),l.nVh(2,X,3,0,"cue-flexcontainer",5)(3,e,3,1,"cue-flexcontainer",5),l.j41(4,"div",6),l.eu8(5,null,1),l.k0s(),l.nVh(7,W,1,2,"cue-logo-link",7),l.k0s()),2&m){const a=l.XpG();l.R7$(),l.vxM(a.showDocumentInfo()&&"ready"===a.state()?1:-1),l.R7$(),l.vxM("loading"===a.state()?2:"error"===a.state()?3:-1),l.R7$(5),l.vxM(a.showLogo()?7:-1)}}function z(m,x){1&m&&l.eu8(0)}function Y(m,x){if(1&m&&(l.j41(0,"cue-card",2),l.DNE(1,z,1,0,"ng-container",9),l.k0s()),2&m){const a=l.XpG(),d=l.sdS(1);l.Y8G("variant",a._cardVariant())("padded",!0),l.R7$(),l.Y8G("ngTemplateOutlet",d)}}function J(m,x){1&m&&l.eu8(0)}function Q(m,x){if(1&m&&l.DNE(0,J,1,0,"ng-container",9),2&m){l.XpG();const a=l.sdS(1);l.Y8G("ngTemplateOutlet",a)}}const K=[".ifc",".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 ee=(()=>{class m{set _viewerHostRef(a){if(this._viewerHost=a,a&&this._lastRenderArgs){const{url:d,suffix:g,page:s,viewerTypeOverride:c}=this._lastRenderArgs;this._renderViewer(d,g,s,c)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,f.hFB)(void 0);uuid=(0,f.hFB)(void 0);projectId=(0,f.hFB)(void 0);showDocumentInfo=(0,f.hFB)(!0,{transform:f.L39});showLogo=(0,f.hFB)(!1,{transform:f.L39});_uuidOnly=(0,y.EW)(()=>{const a=this.uuid();return a?a.split("?")[0].trim():void 0});extraMenuItems=(0,f.hFB)([]);portalBaseURL=(0,f.hFB)("https://cue.qaecy.com");variant=(0,f.hFB)("none");_cardVariant=(0,y.EW)(()=>this.variant());state=(0,h.vPA)("idle");errorMessage=(0,h.vPA)(null);resolvedUrl=(0,h.vPA)(null);resolvedSuffix=(0,h.vPA)(null);_docSubject=(0,h.vPA)("");_alternatives=(0,h.vPA)([]);_originalUuid=(0,h.vPA)(null);_originalDocSuffix=(0,h.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_inputWarningTimer;_blobUrls=new Set;_docInfoHandlers=new $;_menuItems=(0,y.EW)(()=>{const a=[],d=this._originalUuid(),g=this._originalDocSuffix();d&&g&&a.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const s=this._alternatives();if(s.length>1){const c=this.resolvedSuffix();a.push({icon:"document",label:"Alternative representation",children:s.map(p=>({label:p.original?`Original (${p.suffix.replace(".","").toUpperCase()})`:p.suffix.replace(".","").toUpperCase(),tooltip:c===p.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(p)}))})}return a.push(...this.extraMenuItems()),a});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,h.QZP)(()=>{const a=this.cue(),d=this.uuid(),g=this.projectId();a&&d&&g?this._load(a,d,g):this.state.set("idle")})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._blobUrls.forEach(a=>URL.revokeObjectURL(a))}_load(a,d,g){var s=this;return(0,M.A)(function*(){if(a&&d&&g){s.state.set("loading"),s.resolvedUrl.set(null),s.resolvedSuffix.set(null),s.errorMessage.set(null),s._docSubject.set(""),s._originalUuid.set(null),s._originalDocSuffix.set(null),s._alternatives.set([]),s._viewerHost?.clear(),s.currentViewerRef?.destroy(),s.currentViewerRef=void 0,s._lastRenderArgs=void 0;try{s._cueSnapshot=a,s._projectIdSnapshot=g;const{uuid:c,page:p}=function Z(m){const[x,a]=m.split("?"),d=x.trim();let g=null;if(a){const c=new URLSearchParams(a).get("page");if(null!==c){const p=parseInt(c,10);!isNaN(p)&&p>0&&(g=p)}}return{uuid:d,page:g}}(d),P=a.createProjectDocuments(g),D=(yield P.fetchDocumentData([c]))[c];if(!D)throw new Error(`Document '${c}' not found in project '${g}'.`);s._docSubject.set(D.subject??""),s._originalUuid.set(c),s._originalDocSuffix.set(D.suffix);const L=yield P.fetchAlternativeRepresentations(c);s._alternatives.set([{uuid:c,suffix:D.suffix,original:!0},...L.filter(E=>E.id!==c).map(E=>({uuid:E.id,suffix:E.suffix,original:!1,remoteRelativePath:E.remoteRelativePath}))]);const{uuid:te,suffix:F,remoteRelativePath:N}=function q(m,x){const a=[m,...x];let d,g=1/0;for(const s of a){const c=K.indexOf(s.suffix);-1!==c&&c<g&&(g=c,d=s)}return d?{uuid:d.id,suffix:d.suffix,remoteRelativePath:d.remoteRelativePath}:{uuid:m.id,suffix:m.suffix}}(D,L),A=N?yield s._toBlobUrl(a,a.storage.getAltRepDownloadUrl(N),g):yield s._toBlobUrl(a,a.storage.getDownloadUrl(g,te,F),g);s.resolvedUrl.set(A),s.resolvedSuffix.set(F);const ne=[".eml",".msg",".emlx",".mbx"].includes(D.suffix)&&".json"===F?"email":void 0;yield s._renderViewer(A,F,p,ne),s.state.set("ready")}catch(c){const p=c instanceof Error?c.message:String(c);console.error("[CueDocumentViewerWC] Failed to load document:",p),s.errorMessage.set(p),s.state.set("error")}}else s.state.set("idle")})()}_toBlobUrl(a,d,g){var s=this;return(0,M.A)(function*(){const c=yield a.auth.authenticatedFetch(d,{headers:{"cue-project-id":g}});if(!c.ok)throw new Error(`Failed to fetch document: ${c.status} ${c.statusText}`);const p=URL.createObjectURL(yield c.blob());return s._blobUrls.add(p),p})()}_renderViewer(a,d,g,s){var c=this;return(0,M.A)(function*(){try{const{DocumentViewer:p}=yield Promise.all([u.e(2076),u.e(3036)]).then(u.bind(u,43036)),{DocumentViewerSettings:P}=yield u.e(2076).then(u.bind(u,43418));c._viewerHost?.clear(),c.currentViewerRef?.destroy();const R=new P;if(null!==g&&(R.pdf.page=String(g)),!c._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");c._lastRenderArgs={url:a,suffix:d,page:g,viewerTypeOverride:s},c.currentViewerRef=c._viewerHost.createComponent(p),c.currentViewerRef.setInput("url",a),c.currentViewerRef.setInput("suffix",d),c.currentViewerRef.setInput("settings",R),s&&c.currentViewerRef.setInput("viewerTypeOverride",s)}catch(p){throw new Error(`Failed to load viewer component: ${p instanceof Error?p.message:String(p)}`)}})()}_switchToAlternative(a){var d=this;return(0,M.A)(function*(){const g=d._cueSnapshot,s=d._projectIdSnapshot;if(g&&s)try{const c=a.remoteRelativePath?yield d._toBlobUrl(g,g.storage.getAltRepDownloadUrl(a.remoteRelativePath),s):yield d._toBlobUrl(g,g.storage.getDownloadUrl(s,a.uuid,a.suffix),s);d.resolvedUrl.set(c),d.resolvedSuffix.set(a.suffix),yield d._renderViewer(c,a.suffix,null)}catch(c){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",c)}})()}_downloadOriginal(){var a=this;return(0,M.A)(function*(){const d=a._cueSnapshot,g=a._projectIdSnapshot,s=a._originalUuid(),c=a._originalDocSuffix();if(d&&g&&s&&c)try{const p=yield d.storage.downloadBlob(g,s,c);(0,S.KE)(p,`${s}${c}`)}catch(p){console.error("[CueDocumentViewerWC] Failed to download original:",p)}})()}static \u0275fac=function(d){return new(d||m)};static \u0275cmp=l.VBU({type:m,selectors:[["cue-document-viewer-wc"]],viewQuery:function(d,g){if(1&d&&l.GBs(w,5,l.c1b),2&d){let s;l.mGM(s=l.lsd())&&(g._viewerHostRef=s.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(d,g){1&d&&(l.DNE(0,H,8,3,"ng-template",null,0,l.C5r),l.nVh(2,Y,2,3,"cue-card",2)(3,Q,1,1,"ng-container")),2&d&&(l.R7$(2),l.vxM("none"!==g.variant()?2:3))},dependencies:[V.MD,V.T3,G.FlexContainer,I.Typography,j.G,T.Card,U.x],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return m})()}}]);
|
package/8629.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[8629,9695],{59695(k,m,n){n.d(m,{Switch:()=>h});var o=n(17705),s=n(20029),c=n(35547);function e(d,f){if(1&d&&c.nrm(0,"cue-svg-icon",2),2&d){const l=c.XpG();c.Y8G("name",l.iconChecked())}}function v(d,f){if(1&d&&c.nrm(0,"cue-svg-icon",2),2&d){const l=c.XpG();c.Y8G("name",l.icon())}}let h=(()=>{class d{id=(0,o.hFB)("");size=(0,o.hFB)("m");icon=(0,o.hFB)(void 0);iconChecked=(0,o.hFB)(void 0);disabled=(0,o.hFB)(!1);checked=(0,o.geq)(!1);toggleChange=(0,o.CGW)();toggle(){this.checked.set(!this.checked()),this.toggleChange.emit(this.checked())}static \u0275fac=function(g){return new(g||d)};static \u0275cmp=c.VBU({type:d,selectors:[["cue-input-switch"]],hostVars:5,hostBindings:function(g,r){2&g&&(c.BMQ("size",r.size()),c.AVh("checked",r.checked())("disabled",r.disabled()))},inputs:{id:[1,"id"],size:[1,"size"],icon:[1,"icon"],iconChecked:[1,"iconChecked"],disabled:[1,"disabled"],checked:[1,"checked"]},outputs:{checked:"checkedChange",toggleChange:"toggleChange"},decls:4,vars:4,consts:[["type","checkbox",3,"click","checked","disabled"],[1,"indicator"],[3,"name"]],template:function(g,r){1&g&&(c.j41(0,"input",0),c.bIt("click",function(){return r.toggle()}),c.k0s(),c.j41(1,"div",1),c.nVh(2,e,1,1,"cue-svg-icon",2)(3,v,1,1,"cue-svg-icon",2),c.k0s()),2&g&&(c.Y8G("checked",r.checked())("disabled",r.disabled()),c.BMQ("id",r.id()||null),c.R7$(2),c.vxM(r.checked()&&r.iconChecked()?2:r.icon()?3:-1))},dependencies:[s.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 d})()},21331(k,m,n){n.d(m,{a:()=>X});var o=n(85802),s=n(17705),c=n(32271),e=n(35547),v=n(21413),h=n(84572),d=n(28793),f=n(24226),l=n(96697),g=n(5964),w=n(70152),O=n(96354),_=n(99172),P=n(56977),T=n(27421),B=n(67523);const D=new Set;let C,z=(()=>{class i{_platform=(0,o.WQX)(T.O);_nonce=(0,o.WQX)(e.BIS,{optional:!0});_matchMedia;constructor(){this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):R}matchMedia(t){return(this._platform.WEBKIT||this._platform.BLINK)&&function W(i,u){if(!D.has(i))try{C||(C=document.createElement("style"),u&&C.setAttribute("nonce",u),C.setAttribute("type","text/css"),document.head.appendChild(C)),C.sheet&&(C.sheet.insertRule(`@media ${i} {body{ }}`,0),D.add(i))}catch(t){console.error(t)}}(t,this._nonce),this._matchMedia(t)}static \u0275fac=function(a){return new(a||i)};static \u0275prov=o.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function R(i){return{matches:"all"===i||""===i,media:i,addListener:()=>{},removeListener:()=>{}}}let F=(()=>{class i{_mediaMatcher=(0,o.WQX)(z);_zone=(0,o.WQX)(o.SKi);_queries=new Map;_destroySubject=new v.B;constructor(){}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(t){return E((0,B.F)(t)).some(p=>this._registerQuery(p).mql.matches)}observe(t){const p=E((0,B.F)(t)).map(M=>this._registerQuery(M).observable);let b=(0,h.z)(p);return b=(0,d.x)(b.pipe((0,l.s)(1)),b.pipe(function r(i){return(0,g.p)((u,t)=>i<=t)}(1),(0,w.B)(0))),b.pipe((0,O.T)(M=>{const x={matches:!1,breakpoints:{}};return M.forEach(({matches:y,query:K})=>{x.matches=x.matches||y,x.breakpoints[K]=y}),x}))}_registerQuery(t){if(this._queries.has(t))return this._queries.get(t);const a=this._mediaMatcher.matchMedia(t),b={observable:new f.c(M=>{const x=y=>this._zone.run(()=>M.next(y));return a.addListener(x),()=>{a.removeListener(x)}}).pipe((0,_.Z)(a),(0,O.T)(({matches:M})=>({query:t,matches:M})),(0,P.Q)(this._destroySubject)),mql:a};return this._queries.set(t,b),b}static \u0275fac=function(a){return new(a||i)};static \u0275prov=o.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function E(i){return i.map(u=>u.split(",")).reduce((u,t)=>u.concat(t)).map(u=>u.trim())}var N=n(89079);let j=(()=>{class i{_breakpointObserver=(0,o.WQX)(F);mobileBreakpointQuery=this._breakpointObserver.observe(["(max-width: 800px)"]);isMatchingMobileBreakpoint=(0,N.ot)(this.mobileBreakpointQuery,{initialValue:{matches:!1,breakpoints:{}}});isMobile=(0,c.EW)(()=>this.isMatchingMobileBreakpoint()?.matches??!1);static \u0275fac=function(a){return new(a||i)};static \u0275prov=o.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();const S=["dialog"],L=["*",[["","modal-footer",""]]],Q=["*","[modal-footer]"];function V(i,u){if(1&i&&(e.rj2(0,"h2",7),e.EFF(1),e.eux()),2&i){const t=e.XpG(3);e.R7$(),e.JRh(t.effectiveTitle())}}function A(i,u){if(1&i&&(e.rj2(0,"p",8),e.EFF(1),e.eux()),2&i){const t=e.XpG(3);e.R7$(),e.JRh(t.subtitle())}}function I(i,u){if(1&i){const t=e.RV6();e.rj2(0,"button",10),e.VwU("click",function(){o.eBV(t);const p=e.XpG(3);return o.Njj(p.onClose())}),o.qSk(),e.rj2(1,"svg",11),e.Hgh(2,"path",12),e.eux()()}}function U(i,u){if(1&i&&(e.rj2(0,"div",4)(1,"div",6),e.nVh(2,V,2,1,"h2",7),e.nVh(3,A,2,1,"p",8),e.eux(),e.nVh(4,I,3,0,"button",9),e.eux()),2&i){const t=e.XpG(2);e.R7$(2),e.vxM(t.effectiveTitle()?2:-1),e.R7$(),e.vxM(t.subtitle()?3:-1),e.R7$(),e.vxM(t.displayCloseBtn()?4:-1)}}function G(i,u){if(1&i&&(e.rj2(0,"div",3),e.VwU("click",function(a){return a.stopPropagation()}),e.nVh(1,U,5,3,"div",4),e.rj2(2,"div",5),e.SdG(3),e.eux(),e.SdG(4,1),e.eux()),2&i){const t=e.XpG();e.xc7("min-width",t.client.isMobile()?null:t.minWidth()),e.AVh("has-header",t.effectiveTitle()||t.displayCloseBtn())("fullscreen","fullscreen"===t.size()),e.R7$(),e.vxM(t.effectiveTitle()||t.displayCloseBtn()?1:-1),e.R7$(),e.AVh("fullscreen","fullscreen"===t.size())}}let X=(()=>{class i{client=(0,o.WQX)(j);visible=(0,s.geq)(!0);closeOnBackgroundClick=(0,s.hFB)(!0);closable=(0,s.hFB)(!0);displayCloseBtn=(0,s.hFB)(!0);label=(0,s.hFB)("");title=(0,s.hFB)("");subtitle=(0,s.hFB)("");minWidth=(0,s.hFB)();size=(0,s.hFB)("default");close=(0,s.CGW)();dialogRef=s.ebz.required("dialog");effectiveTitle=(0,c.EW)(()=>this.title()||this.label());constructor(){(0,o.QZP)(()=>{const t=this.dialogRef().nativeElement;this.visible()?t.open||t.showModal():t.open&&t.close()})}onBackdropClick(){this.closeOnBackgroundClick()&&this.closable()&&this.onClose()}onCancel(t){t.preventDefault(),this.closable()&&this.onClose()}onClose(){this.visible.set(!1),this.close.emit()}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.VBU({type:i,selectors:[["cue-modal"]],viewQuery:function(a,p){1&a&&e.wEZ(p.dialogRef,S,5),2&a&&e.NyB()},inputs:{visible:[1,"visible"],closeOnBackgroundClick:[1,"closeOnBackgroundClick"],closable:[1,"closable"],displayCloseBtn:[1,"displayCloseBtn"],label:[1,"label"],title:[1,"title"],subtitle:[1,"subtitle"],minWidth:[1,"minWidth"],size:[1,"size"]},outputs:{visible:"visibleChange",close:"close"},ngContentSelectors:Q,decls:3,vars:3,consts:[["dialog",""],[1,"modal-dialog",3,"cancel","click"],[1,"panel",3,"has-header","fullscreen","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(a,p){1&a&&(e.NAR(L),e.rj2(0,"dialog",1,0),e.VwU("cancel",function(M){return p.onCancel(M)})("click",function(){return p.onBackdropClick()}),e.nVh(2,G,5,9,"div",2),e.eux()),2&a&&(e.AVh("fullscreen","fullscreen"===p.size()),e.R7$(2),e.vxM(p.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}.modal-dialog.fullscreen[_ngcontent-%COMP%]{max-width:100vw}.panel.fullscreen[_ngcontent-%COMP%]{width:100vw;height:100vh;max-width:100vw;max-height:100vh;border-radius:0;display:flex;flex-direction:column}.body.fullscreen[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column}@media(max-width:800px){.modal-dialog[_ngcontent-%COMP%]:not(.fullscreen){width:calc(100vw - 16px);max-width:calc(100vw - 16px)}.panel[_ngcontent-%COMP%]:not(.fullscreen){width:100%;max-height:92dvh;border-radius:20px}.header[_ngcontent-%COMP%]{padding:20px 18px 0;margin-bottom:16px}.body[_ngcontent-%COMP%]{padding:18px}}"]})}return i})()},28793(k,m,n){n.d(m,{x:()=>v});var o=n(26365),c=n(9326),e=n(86648);function v(...h){return function s(){return(0,o.U)(1)}()((0,e.H)(h,(0,c.lI)(h)))}},70152(k,m,n){n.d(m,{B:()=>e});var o=n(43236),s=n(39974),c=n(54360);function e(v,h=o.E){return(0,s.N)((d,f)=>{let l=null,g=null,r=null;const w=()=>{if(l){l.unsubscribe(),l=null;const _=g;g=null,f.next(_)}};function O(){const _=r+v,P=h.now();if(P<_)return l=this.schedule(void 0,_-P),void f.add(l);w()}d.subscribe((0,c._)(f,_=>{g=_,r=h.now(),l||(l=h.schedule(O,v),f.add(l))},()=>{w(),f.complete()},void 0,()=>{g=l=null}))})}},99172(k,m,n){n.d(m,{Z:()=>e});var o=n(28793),s=n(9326),c=n(39974);function e(...v){const h=(0,s.lI)(v);return(0,c.N)((d,f)=>{(h?(0,o.x)(v,d,h):(0,o.x)(v,d)).subscribe(f)})}}}]);
|
package/8647.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[8647],{68647(T,z,c){c.r(z),c.d(z,{LazStreamingSource:()=>C,probeLazPerfWasmLoad:()=>U,setLazPerfLoaderForTesting:()=>B});var h=c(10467),p=c(80070),b=c(14582);function y(){return w.apply(this,arguments)}function w(){return w=(0,h.A)(function*(){const i=yield function O(){return _.apply(this,arguments)}(),r=yield Promise.resolve().then(function(){var s=new Error("Cannot find module 'laz-perf'");throw s.code="MODULE_NOT_FOUND",s}),e=r.default,o=[r.createLazPerf,"object"==typeof e&&null!==e?e.createLazPerf:void 0,e,r].find(n=>"function"==typeof n);if(!o){const n=Object.keys(r).join(", ");throw new Error(`laz-perf: could not find createLazPerf factory (saw keys: ${n||"<empty>"})`)}return o({wasmBinary:i})}),w.apply(this,arguments)}function _(){return(_=(0,h.A)(function*(){let i;try{i=(yield Promise.resolve().then(function(){var n=new Error("Cannot find module 'laz-perf/lib/web/laz-perf.wasm?url'");throw n.code="MODULE_NOT_FOUND",n})).default}catch(t){throw new Error(`laz-perf: could not resolve wasm asset URL (${t instanceof Error?t.message:String(t)}). Ensure the bundler treats \`laz-perf/lib/web/laz-perf.wasm?url\` as a static asset.`)}const r=yield fetch(i);if(!r.ok)throw new Error(`laz-perf: wasm fetch failed (${r.status} ${r.statusText}) for ${i}`);const e=yield r.arrayBuffer();return new Uint8Array(e)})).apply(this,arguments)}let P=(0,b.T)(y);function U(){return g.apply(this,arguments)}function g(){return(g=(0,h.A)(function*(){try{return{ok:!0,hasLASZip:"function"==typeof(yield y()).LASZip}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}})).apply(this,arguments)}function B(i){return P=(0,b.T)(i),()=>{P=(0,b.T)(y)}}class C{blob;downsample;label;mod=null;laszip=null;header=null;fileBytes=null;filePtr=0;pointPtr=0;pointBuffer=null;cursor=0;rgbScale=1;originOffset;constructor(r,e={}){this.blob=r,this.downsample=e.downsample??{stride:1},this.label=e.label,this.originOffset=e.originOffset}open(r){var e=this;return(0,h.A)(function*(){if(e.header)return e.toInfo(e.header);m(r);let t,s,o=0,n=0;try{const l=yield e.blob.arrayBuffer();m(r);const a=new Uint8Array(l),f=(0,p.jb)(a);t=yield P(),m(r),o=t._malloc(a.byteLength),t.HEAPU8.set(a,o),s=new t.LASZip,s.open(o,a.byteLength);const u=s.getPointLength();n=t._malloc(u);const d=new Uint8Array(u);let E=1;if(f.hasRgb){const A=Math.min(4096,f.pointCount),S=new Uint8Array(A*u);for(let L=0;L<A;L++)s.getPoint(n),S.set(t.HEAPU8.subarray(n,n+u),L*u);const M=(0,p.V_)(S,f);E=M>0&&M<=255?257:1,s.delete(),s=new t.LASZip,s.open(o,a.byteLength)}return e.fileBytes=a,e.mod=t,e.filePtr=o,e.laszip=s,e.pointPtr=n,e.pointBuffer=d,e.rgbScale=E,e.header=f,e.cursor=0,e.toInfo(f)}catch(l){try{s?.delete()}catch{}if(t&&n)try{t._free(n)}catch{}if(t&&o)try{t._free(o)}catch{}throw l}})()}next(r,e){var t=this;return(0,h.A)(function*(){if(m(e),!Number.isFinite(r)||r<=0)throw new Error(`LazStreamingSource: maxPoints must be > 0 (got ${r})`);if(!(t.header&&t.mod&&t.laszip&&t.pointBuffer))throw new Error("LazStreamingSource: open() must be awaited before next()");const o=Math.max(1,0|t.downsample.stride);if(t.cursor>=t.header.pointCount)return null;const n=t.pointBuffer.byteLength,l=Math.min(1===o?r:r*o,t.header.pointCount-t.cursor),a=1===o?l:Math.ceil(l/o),f=new Uint8Array(a*n);let u=0;for(let d=0;d<l;d++)t.laszip.getPoint(t.pointPtr),(1===o||d%o===0)&&(f.set(t.mod.HEAPU8.subarray(t.pointPtr,t.pointPtr+n),u*n),u++);return t.cursor+=l,(0,p.wu)(f,t.header,a,n,t.rgbScale,t.originOffset)})()}close(){try{this.laszip?.delete()}catch{}if(this.mod&&this.pointPtr)try{this.mod._free(this.pointPtr)}catch{}if(this.mod&&this.filePtr)try{this.mod._free(this.filePtr)}catch{}this.laszip=null,this.mod=null,this.header=null,this.fileBytes=null,this.pointBuffer=null,this.filePtr=0,this.pointPtr=0,this.cursor=0}toInfo(r){const e=Math.max(1,0|this.downsample.stride);return{totalPointCount:1===e?r.pointCount:Math.ceil(r.pointCount/e),bbox:(0,p.iX)(r.bbox,this.originOffset),hasColor:r.hasRgb,hasClassification:!0,hasIntensity:!0,label:this.label}}}function m(i){if(i?.aborted)throw new DOMException("Aborted","AbortError")}}}]);
|
package/9231.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[9231],{75448(B,_,m){"use strict";m.d(_,{ButtonLabel:()=>S});var b=m(17705),C=m(42245),$=m(35547);const D=["*"];let S=(()=>{class d{fontSize=(0,b.hFB)("m");italic=(0,b.hFB)(!1);noWrap=(0,b.hFB)(!0);static \u0275fac=function(w){return new(w||d)};static \u0275cmp=$.VBU({type:d,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(w,y){1&w&&($.NAR(),$.j41(0,"div")(1,"cue-typography",0),$.SdG(2),$.k0s()()),2&w&&($.R7$(),$.Y8G("size",y.fontSize())("italic",y.italic())("noWrap",y.noWrap()))},dependencies:[C.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return d})()},2065(B,_,m){"use strict";function $(d,g,a="text/plain"){return function b(d,g="data.zip"){const a=document.createElement("a"),w=URL.createObjectURL(d);a.href=w,a.download=g,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(w)}(new Blob([d],{type:a}),g)}function D(d,g){const a=document.createElement("a");a.style.display="hidden",a.setAttribute("href",window.URL.createObjectURL(d)),a.setAttribute("download",g),document.body.appendChild(a),a.click(),a.remove()}m.d(_,{KE:()=>D,YN:()=>$})},77573(B,_,m){"use strict";m.d(_,{E:()=>b});const b={qcy:"https://dev.qaecy.com/ont#","qcy-e":"https://dev.qaecy.com/enum#","qcy-f":"https://dev.qaecy.com/functions#",obc:"https://w3id.org/obc#",dicc:"https://w3id.org/digitalconstruction/0.5/Contexts#",dicv:"https://w3id.org/digitalconstruction/0.5/Variables#",dice:"https://w3id.org/digitalconstruction/0.5/Entities#",dicp:"https://w3id.org/digitalconstruction/0.5/Processes#",dica:"https://w3id.org/digitalconstruction/0.5/Agents#",dici:"https://w3id.org/digitalconstruction/0.5/Information#",dicbm:"https://w3id.org/digitalconstruction/0.5/Materials#",dicob:"https://w3id.org/digitalconstruction/0.5/Occupancy#",dicl:"https://w3id.org/digitalconstruction/0.5/Lifecycle#",dices:"https://w3id.org/digitalconstruction/0.5/Energy#",dicu:"https://w3id.org/digitalconstruction/0.5/Units#",diclvl:"https://w3id.org/digitalconstruction/0.5/Levels#",dicstg:"https://w3id.org/digitalconstruction/0.5/Stages#"}},67374(B){B.exports=function(){"use strict";var m=6e4,b=36e5,C="millisecond",$="second",D="minute",S="hour",d="day",g="week",a="month",w="quarter",y="year",A="date",I="Invalid Date",F=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,J=/\[([^\]]+)]|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,q={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(i){var n=["th","st","nd","rd"],t=i%100;return"["+i+(n[(t-20)%10]||n[t]||n[0])+"]"}},z=function(i,n,t){var r=String(i);return!r||r.length>=n?i:""+Array(n+1-r.length).join(t)+i},V={s:z,z:function(i){var n=-i.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+z(r,2,"0")+":"+z(e,2,"0")},m:function i(n,t){if(n.date()<t.date())return-i(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,a),s=t-e<0,o=n.clone().add(r+(s?-1:1),a);return+(-(r+(t-e)/(s?e-o:o-e))||0)},a:function(i){return i<0?Math.ceil(i)||0:Math.floor(i)},p:function(i){return{M:a,y,w:g,d,D:A,h:S,m:D,s:$,ms:C,Q:w}[i]||String(i||"").toLowerCase().replace(/s$/,"")},u:function(i){return void 0===i}},U="en",L={};L[U]=q;var N="$isDayjsObject",x=function(i){return i instanceof H||!(!i||!i[N])},j=function i(n,t,r){var e;if(!n)return U;if("string"==typeof n){var s=n.toLowerCase();L[s]&&(e=s),t&&(L[s]=t,e=s);var o=n.split("-");if(!e&&o.length>1)return i(o[0])}else{var u=n.name;L[u]=n,e=u}return!r&&e&&(U=e),e||!r&&U},h=function(i,n){if(x(i))return i.clone();var t="object"==typeof n?n:{};return t.date=i,t.args=arguments,new H(t)},c=V;c.l=j,c.i=x,c.w=function(i,n){return h(i,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var H=function(){function i(t){this.$L=j(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[N]=!0}var n=i.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,s=r.utc;if(null===e)return new Date(NaN);if(c.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var o=e.match(F);if(o){var u=o[2]-1||0,l=(o[7]||"0").substring(0,3);return s?new Date(Date.UTC(o[1],u,o[3]||1,o[4]||0,o[5]||0,o[6]||0,l)):new Date(o[1],u,o[3]||1,o[4]||0,o[5]||0,o[6]||0,l)}}return new Date(e)}(t),this.init()},n.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()},n.$utils=function(){return c},n.isValid=function(){return this.$d.toString()!==I},n.isSame=function(t,r){var e=h(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return h(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<h(t)},n.$g=function(t,r,e){return c.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,s=!!c.u(r)||r,o=c.p(t),u=function(Y,v){var O=c.w(e.$u?Date.UTC(e.$y,v,Y):new Date(e.$y,v,Y),e);return s?O:O.endOf(d)},l=function(Y,v){return c.w(e.toDate()[Y].apply(e.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(v)),e)},f=this.$W,p=this.$M,M=this.$D,W="set"+(this.$u?"UTC":"");switch(o){case y:return s?u(1,0):u(31,11);case a:return s?u(1,p):u(0,p+1);case g:var k=this.$locale().weekStart||0,E=(f<k?f+7:f)-k;return u(s?M-E:M+(6-E),p);case d:case A:return l(W+"Hours",0);case S:return l(W+"Minutes",1);case D:return l(W+"Seconds",2);case $:return l(W+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,s=c.p(t),o="set"+(this.$u?"UTC":""),u=(e={},e[d]=o+"Date",e[A]=o+"Date",e[a]=o+"Month",e[y]=o+"FullYear",e[S]=o+"Hours",e[D]=o+"Minutes",e[$]=o+"Seconds",e[C]=o+"Milliseconds",e)[s],l=s===d?this.$D+(r-this.$W):r;if(s===a||s===y){var f=this.clone().set(A,1);f.$d[u](l),f.init(),this.$d=f.set(A,Math.min(this.$D,f.daysInMonth())).$d}else u&&this.$d[u](l);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[c.p(t)]()},n.add=function(t,r){var e,s=this;t=Number(t);var o=c.p(r),u=function(p){var M=h(s);return c.w(M.date(M.date()+Math.round(p*t)),s)};if(o===a)return this.set(a,this.$M+t);if(o===y)return this.set(y,this.$y+t);if(o===d)return u(1);if(o===g)return u(7);var l=(e={},e[D]=m,e[S]=b,e[$]=1e3,e)[o]||1,f=this.$d.getTime()+t*l;return c.w(f,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||I;var s=t||"YYYY-MM-DDTHH:mm:ssZ",o=c.z(this),u=this.$H,l=this.$m,f=this.$M,p=e.weekdays,M=e.months,k=function(v,O,T,R){return v&&(v[O]||v(r,s))||T[O].slice(0,R)},E=function(v){return c.s(u%12||12,v,"0")},Y=e.meridiem||function(v,O,T){var R=v<12?"AM":"PM";return T?R.toLowerCase():R};return s.replace(J,function(v,O){return O||function(T){switch(T){case"YY":return String(r.$y).slice(-2);case"YYYY":return c.s(r.$y,4,"0");case"M":return f+1;case"MM":return c.s(f+1,2,"0");case"MMM":return k(e.monthsShort,f,M,3);case"MMMM":return k(M,f);case"D":return r.$D;case"DD":return c.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return k(e.weekdaysMin,r.$W,p,2);case"ddd":return k(e.weekdaysShort,r.$W,p,3);case"dddd":return p[r.$W];case"H":return String(u);case"HH":return c.s(u,2,"0");case"h":return E(1);case"hh":return E(2);case"a":return Y(u,l,!0);case"A":return Y(u,l,!1);case"m":return String(l);case"mm":return c.s(l,2,"0");case"s":return String(r.$s);case"ss":return c.s(r.$s,2,"0");case"SSS":return c.s(r.$ms,3,"0");case"Z":return o}return null}(v)||o.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var s,o=this,u=c.p(r),l=h(t),f=(l.utcOffset()-this.utcOffset())*m,p=this-l,M=function(){return c.m(o,l)};switch(u){case y:s=M()/12;break;case a:s=M();break;case w:s=M()/3;break;case g:s=(p-f)/6048e5;break;case d:s=(p-f)/864e5;break;case S:s=p/b;break;case D:s=p/m;break;case $:s=p/1e3;break;default:s=p}return e?s:c.a(s)},n.daysInMonth=function(){return this.endOf(a).$D},n.$locale=function(){return L[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),s=j(t,r,!0);return s&&(e.$L=s),e},n.clone=function(){return c.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},i}(),P=H.prototype;return h.prototype=P,[["$ms",C],["$s",$],["$m",D],["$H",S],["$W",d],["$M",a],["$y",y],["$D",A]].forEach(function(i){P[i[1]]=function(n){return this.$g(n,i[0],i[1])}}),h.extend=function(i,n){return i.$i||(i(n,H,h),i.$i=!0),h},h.locale=j,h.isDayjs=x,h.unix=function(i){return h(1e3*i)},h.en=L[U],h.Ls=L,h.p={},h}()}}]);
|
package/9396.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[9396],{19396(Z,D,s){s.d(D,{CueContextViewer:()=>Q});var g=s(10467),d=s(17705),a=s(85802),r=s(32271),h=s(17579),p=s(73656),w=s(32839),x=s(74631),C=s(91625),f=s(16455),y=s(68334),v=s(97851),I=s(85971),M=s(75448),b=s(2014),k=s(59352),t=s(35547);function V(c,l){1&c&&(t.j41(0,"div",1),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&c&&(t.R7$(),t.JRh(t.bMT(2,1,"components.contextViewer.infoNoContext")))}function j(c,l){if(1&c){const e=t.RV6();t.j41(0,"cue-tabs",2)(1,"cue-tab",6),t.nI1(2,"transloco"),t.j41(3,"cue-doc-list",7),t.bIt("clickedDocument",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentClicked(o))})("selectionChanged",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocSelectionChanged(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentViewMarkdown(o))}),t.k0s()(),t.j41(4,"cue-tab",6),t.nI1(5,"transloco"),t.j41(6,"cue-ent-list-inner",8),t.bIt("rowClicked",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityRowClicked(o))})("selectionChanged",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntitySelectionChanged(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityViewMarkdown(o))}),t.k0s()()()}if(2&c){const e=t.XpG();t.R7$(),t.Y8G("label",t.bMT(2,11,"components.contextViewer.tabDocuments")),t.R7$(2),t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant())("selectable",e.selectable()),t.R7$(),t.Y8G("label",t.bMT(5,13,"components.contextViewer.tabEntities")),t.R7$(2),t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())("selectable",e.selectable())}}function E(c,l){if(1&c){const e=t.RV6();t.nrm(0,"cue-document-info",9),t.j41(1,"cue-doc-list",10),t.bIt("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentViewMarkdown(o))}),t.k0s()}if(2&c){const e=t.XpG();t.Y8G("subject",e.singleDocumentSubject())("handlers",e._docInfoHandlers)("contentCategories",e.singleDocument().categories)("fileLocations",e.singleDocumentFileLocations()),t.R7$(),t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant())}}function N(c,l){if(1&c){const e=t.RV6();t.j41(0,"cue-doc-list",7),t.bIt("clickedDocument",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentClicked(o))})("selectionChanged",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocSelectionChanged(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentViewMarkdown(o))}),t.k0s()}if(2&c){const e=t.XpG();t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant())("selectable",e.selectable())}}function R(c,l){if(1&c){const e=t.RV6();t.nrm(0,"cue-entity-info",11),t.j41(1,"cue-ent-list-inner",12),t.bIt("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityViewMarkdown(o))}),t.k0s()}if(2&c){const e=t.XpG();t.Y8G("entity",e.singleEntity())("handlers",e._entityInfoHandlers),t.R7$(),t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())}}function G(c,l){if(1&c){const e=t.RV6();t.j41(0,"cue-ent-list-inner",13),t.bIt("rowClicked",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityRowClicked(o))})("selectionChanged",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntitySelectionChanged(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityViewMarkdown(o))}),t.k0s()}if(2&c){const e=t.XpG();t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())("selectable",e.selectable())}}function T(c,l){1&c&&(t.j41(0,"div",1),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&c&&(t.R7$(),t.JRh(t.bMT(2,1,"components.contextViewer.infoNoItems")))}function B(c,l){if(1&c){const e=t.RV6();t.j41(0,"div",5)(1,"cue-button",14),t.bIt("click",function(){a.eBV(e);const o=t.XpG();return a.Njj(o.onAddSelectionClicked())}),t.nrm(2,"cue-button-padder"),t.j41(3,"cue-button-label"),t.EFF(4),t.nI1(5,"transloco"),t.k0s(),t.nrm(6,"cue-button-padder"),t.k0s()()}if(2&c){const e=t.XpG();t.R7$(),t.Y8G("loading",e.adding())("disabled",e.adding()),t.R7$(3),t.Lme(" ",t.bMT(5,4,"components.contextViewer.buttonAddSelection")," (",e.selectedIndices().length,") ")}}let L=(()=>{class c{contextId=(0,d.hFB)(void 0);handlers=(0,d.hFB)(void 0);variant=(0,d.hFB)("none");contextDoc=(0,d.hFB)(void 0);documentData=(0,d.hFB)({});entityData=(0,d.hFB)({});selectable=(0,d.hFB)(!0);adding=(0,d.hFB)(!1);itemRowClicked=(0,d.CGW)();viewMarkdown=(0,d.CGW)();addSelection=(0,d.CGW)();loading=(0,r.EW)(()=>!!this.contextId()&&!this.contextDoc());_docItems=(0,r.EW)(()=>(this.contextDoc()?.items??[]).filter(e=>"document"===e.type));_entityItems=(0,r.EW)(()=>(this.contextDoc()?.items??[]).filter(e=>"entity"===e.type));hasDocuments=(0,r.EW)(()=>this._docItems().length>0);hasEntities=(0,r.EW)(()=>this._entityItems().length>0);hasBoth=(0,r.EW)(()=>this.hasDocuments()&&this.hasEntities());documentRefs=(0,r.EW)(()=>this._docItems().map(e=>({id:e.id,relevance:e.relevance})));entityIris=(0,r.EW)(()=>this._entityItems().map(e=>e.id));singleDocument=(0,r.EW)(()=>{if(1===this._docItems().length)return this.documentData()[this._docItems()[0].id]});isSingleDocument=(0,r.EW)(()=>this.hasDocuments()&&!this.hasEntities()&&!!this.singleDocument());singleDocumentSubject=(0,r.EW)(()=>this.singleDocument()?.subject||this.singleDocument()?.path||"");singleDocumentFileLocations=(0,r.EW)(()=>{const e=this.singleDocument();return e?[{iri:e.id,path:e.path,providerId:e.providerId}]:[]});_docInfoHandlers={};singleEntity=(0,r.EW)(()=>{if(1!==this._entityItems().length)return;const e=this._entityItems()[0].id,n=this.entityData()[e];return n?{iri:e,value:n.value,categories:n.categories}:void 0});isSingleEntity=(0,r.EW)(()=>this.hasEntities()&&!this.hasDocuments()&&!!this.singleEntity());_entityInfoHandlers={};_docHandlers=(0,r.EW)(()=>({requestData:e=>this.handlers()?.requestDocumentData?.(e),requestDownload:e=>this.handlers()?.requestDownloadDocument?.(e),requestOpen:(e,n)=>this.handlers()?.requestOpenDocument?.(e,n),requestOpenInDir:(e,n)=>this.handlers()?.requestOpenDocumentInDir?.(e,n)}));_entityHandlers=(0,r.EW)(()=>({requestData:(e,n)=>this.handlers()?.requestEntityData?.(e,n),requestOpen:e=>this.handlers()?.requestOpenEntity?.(e)}));onEntityRowClicked({row:e}){this.itemRowClicked.emit({type:"entity",row:e,index:this._originalIndex(e.entity)})}onDocumentClicked(e){this.itemRowClicked.emit({type:"document",row:e,index:this._originalIndex(e.id)})}_selectedDocIndices=(0,a.vPA)([]);_selectedEntityIndices=(0,a.vPA)([]);selectedIndices=(0,r.EW)(()=>Array.from(new Set([...this._selectedDocIndices(),...this._selectedEntityIndices()])).sort((e,n)=>e-n));onDocSelectionChanged(e){this._selectedDocIndices.set(e.map(n=>this._originalIndex(n.id)).filter(n=>n>=0))}onEntitySelectionChanged(e){this._selectedEntityIndices.set(e.map(n=>this._originalIndex(n.entity)).filter(n=>n>=0))}onAddSelectionClicked(){const e=this.selectedIndices();e.length>0&&this.addSelection.emit(e)}onDocumentViewMarkdown(e){this.viewMarkdown.emit({type:"document",markdown:e})}onEntityViewMarkdown(e){this.viewMarkdown.emit({type:"entity",markdown:e})}_originalIndex(e){return(this.contextDoc()?.items??[]).findIndex(n=>n.id===e)}constructor(){let e;(0,a.QZP)(()=>{const n=this.contextId();n&&this.handlers()?.requestContext?.(n)}),(0,a.QZP)(()=>{const n=this.contextDoc()?.id;n!==e&&(e=n,this._selectedDocIndices.set([]),this._selectedEntityIndices.set([]))})}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=t.VBU({type:c,selectors:[["cue-context-viewer-inner"]],inputs:{contextId:[1,"contextId"],handlers:[1,"handlers"],variant:[1,"variant"],contextDoc:[1,"contextDoc"],documentData:[1,"documentData"],entityData:[1,"entityData"],selectable:[1,"selectable"],adding:[1,"adding"]},outputs:{itemRowClicked:"itemRowClicked",viewMarkdown:"viewMarkdown",addSelection:"addSelection"},decls:10,vars:6,consts:[[2,"position","relative","height","100%","width","100%",3,"cueLogoLoader","cueLogoLoaderMessage"],[1,"cv-status"],[2,"height","100%"],[3,"documentRefs","documentData","handlers","variant","selectable"],[2,"height","400px",3,"entities","entityData","handlers","selectable"],[1,"cv-add-selection"],[3,"label"],[3,"clickedDocument","selectionChanged","viewMarkdown","documentRefs","documentData","handlers","variant","selectable"],[2,"height","100%",3,"rowClicked","selectionChanged","viewMarkdown","entities","entityData","handlers","selectable"],[3,"subject","handlers","contentCategories","fileLocations"],[2,"display","none",3,"viewMarkdown","documentRefs","documentData","handlers","variant"],[3,"entity","handlers"],[2,"display","none",3,"viewMarkdown","entities","entityData","handlers"],[2,"height","400px",3,"rowClicked","selectionChanged","viewMarkdown","entities","entityData","handlers","selectable"],["variant","primary",3,"click","loading","disabled"]],template:function(n,o){1&n&&(t.j41(0,"div",0),t.nI1(1,"transloco"),t.nVh(2,V,3,3,"div",1)(3,j,7,15,"cue-tabs",2)(4,E,2,8)(5,N,1,5,"cue-doc-list",3)(6,R,2,5)(7,G,1,4,"cue-ent-list-inner",4)(8,T,3,3,"div",1),t.nVh(9,B,7,6,"div",5),t.k0s()),2&n&&(t.Y8G("cueLogoLoader",o.loading())("cueLogoLoaderMessage",t.bMT(1,4,"components.contextViewer.infoLoading")),t.R7$(2),t.vxM(o.contextDoc()?o.hasBoth()?3:o.isSingleDocument()?4:o.hasDocuments()?5:o.isSingleEntity()?6:o.hasEntities()?7:8:2),t.R7$(7),t.vxM(o.selectable()&&o.selectedIndices().length>0?9:-1))},dependencies:[p.g,w.u,x.G,C.U,f.t,y.o,v.k,I.Button,M.ButtonLabel,b.ButtonPadder,k.Kj],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.cv-status[_ngcontent-%COMP%]{padding:16px;color:var(--cue-color-midgray, #888);font-size:13px}.cv-add-selection[_ngcontent-%COMP%]{position:fixed;right:24px;bottom:24px;z-index:20}"],changeDetection:0})}return c})();var X=s(35381),F=s(42245),S=s(57293),W=s(77727),P=s(13202);function Y(c,l){if(1&c&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),t.EFF(2),t.k0s()()),2&c){const e=t.XpG();t.R7$(2),t.SpI(" ",e.errorMessage()," ")}}function A(c,l){1&c&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",3),t.EFF(2," No project connected. "),t.k0s()())}function $(c,l){if(1&c){const e=t.RV6();t.nrm(0,"cue-document-viewer-wc",4),t.j41(1,"cue-context-viewer-inner",5),t.bIt("viewMarkdown",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.viewMarkdown.emit(o))}),t.k0s()}if(2&c){const e=t.XpG(2);t.Y8G("cue",e.cue())("projectId",e.projectId())("uuid",l)("showLogo",e.showLogo())("variant",e.variant()),t.R7$(),t.Y8G("contextDoc",e.contextDoc())("documentData",e.documentData())("entityData",e.entityData())("handlers",e._handlers())("variant",e.variant())}}function H(c,l){if(1&c){const e=t.RV6();t.nrm(0,"cue-entity-viewer-wc",6),t.j41(1,"cue-context-viewer-inner",5),t.bIt("viewMarkdown",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.viewMarkdown.emit(o))}),t.k0s()}if(2&c){const e=t.XpG(2);t.Y8G("cue",e.cue())("projectId",e.projectId())("iri",l)("showLogo",e.showLogo())("variant",e.variant()),t.R7$(),t.Y8G("contextDoc",e.contextDoc())("documentData",e.documentData())("entityData",e.entityData())("handlers",e._handlers())("variant",e.variant())}}function O(c,l){if(1&c&&t.nrm(0,"cue-logo-link",8),2&c){const e=t.XpG(3);t.Y8G("projectId",e.projectId())}}function z(c,l){if(1&c){const e=t.RV6();t.j41(0,"cue-context-viewer-inner",7),t.bIt("itemRowClicked",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.itemRowClicked.emit(o))})("addSelection",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.onAddSelection(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.viewMarkdown.emit(o))}),t.k0s(),t.nVh(1,O,1,1,"cue-logo-link",8)}if(2&c){const e=t.XpG(2);t.Y8G("contextDoc",e.contextDoc())("documentData",e.documentData())("entityData",e.entityData())("handlers",e._handlers())("variant",e.variant())("adding",e.adding()),t.R7$(),t.vxM(e.showLogo()?1:-1)}}function U(c,l){if(1&c&&(t.j41(0,"div",1),t.nVh(1,$,2,10)(2,H,2,10)(3,z,2,7),t.k0s()),2&c){let e;const n=t.XpG();t.Y8G("cueLogoLoader","loading"===n.state()),t.R7$(),t.vxM((e=n._singleDocumentUuid())?1:(e=n._singleEntityIri())?2:3,e)}}function K(c){return{id:c.id,contentIRI:c.contentIRI??c.id,path:c.path??"",suffix:c.suffix??"",size:c.size??0,tags:c.tags??[],summary:c.summary??"",categories:c.categories??[],subject:c.subject,providerId:c.providerId,relevance:0}}let Q=(()=>{class c{cue=(0,d.hFB)(void 0);projectId=(0,d.hFB)(void 0);contextId=(0,d.hFB)(void 0);variant=(0,d.hFB)("none");showLogo=(0,d.hFB)(!1,{transform:d.L39});itemRowClicked=(0,d.CGW)();selectionResult=(0,d.CGW)();viewMarkdown=(0,d.CGW)();adding=(0,a.vPA)(!1);state=(0,a.vPA)("idle");errorMessage=(0,a.vPA)(null);contextDoc=(0,a.vPA)(void 0);documentData=(0,a.vPA)({});entityData=(0,a.vPA)({});_documents=(0,a.vPA)(void 0);_entities=(0,a.vPA)(void 0);_unsubDocs;_unsubEntities;_inputWarningTimer;_singleDocumentUuid=(0,r.EW)(()=>{const e=this.contextDoc()?.items??[],n=e.filter(i=>"document"===i.type),o=e.filter(i=>"entity"===i.type);return 1===n.length&&0===o.length?n[0].id:void 0});_singleEntityIri=(0,r.EW)(()=>{const e=this.contextDoc()?.items??[],n=e.filter(i=>"document"===i.type),o=e.filter(i=>"entity"===i.type);return 1===o.length&&0===n.length?o[0].id:void 0});_handlers=(0,r.EW)(()=>({requestDocumentData:e=>this._documents()?.requestDocumentData(e),requestEntityData:(e,n)=>this._entities()?.requestEntityData(e,n)}));onAddSelection(e){var n=this;return(0,g.A)(function*(){const o=n.cue(),i=n.projectId(),u=n.contextId();if(o&&i&&u&&0!==e.length){n.adding.set(!0);try{const _=yield o.api.mcp.callTool("select",{ctx:u,column:"index",value:e,space_id:i});n.selectionResult.emit(_)}catch(_){console.error('[cue-context-viewer] "select" MCP call failed',_)}finally{n.adding.set(!1)}}})()}constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-context-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.projectId()||console.warn('[cue-context-viewer] Required input "projectId" is not set.'),this.contextId()||console.warn('[cue-context-viewer] Required input "contextId" is not set.')},3e3),(0,a.QZP)(()=>{this._load(this.cue(),this.projectId(),this.contextId())})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._teardown()}_load(e,n,o){var i=this;return(0,g.A)(function*(){if(i._teardown(),i.contextDoc.set(void 0),i.documentData.set({}),i.entityData.set({}),e&&n&&o){i.state.set("loading"),i.errorMessage.set(null);try{const u=yield e.api.contexts.getContext(n,o);i.contextDoc.set(u);const _=new h.f$(e.api,n),m=new h.g8(e.api,n);i._documents.set(_),i._entities.set(m),i._unsubDocs=_.documentInfoMap.subscribe(()=>i._syncDocumentData(_)),i._unsubEntities=m.entityInfoMap.subscribe(()=>i._syncEntityData(m)),i.state.set("ready")}catch(u){console.error("[cue-context-viewer] Failed to load context",u),i.errorMessage.set(u instanceof Error?u.message:"Failed to load context."),i.state.set("error")}}else i.state.set("idle")})()}_syncDocumentData(e){const n=e.documentInfoMap.get(),o={};for(const[i,u]of Object.entries(n))o[i]=K(u);this.documentData.set(o)}_syncEntityData(e){const n=e.entityInfoMap.get(),o={};for(const[i,u]of Object.entries(n))o[i]={value:u.value??i,categories:u.categories??[],mentionCount:u.mentionCount};this.entityData.set(o)}_teardown(){this._unsubDocs?.(),this._unsubEntities?.(),this._unsubDocs=void 0,this._unsubEntities=void 0,this._documents.set(void 0),this._entities.set(void 0)}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=t.VBU({type:c,selectors:[["cue-context-viewer"]],inputs:{cue:[1,"cue"],projectId:[1,"projectId"],contextId:[1,"contextId"],variant:[1,"variant"],showLogo:[1,"showLogo"]},outputs:{itemRowClicked:"itemRowClicked",selectionResult:"selectionResult",viewMarkdown:"viewMarkdown"},decls:3,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","relative","height","100%","width","100%",3,"cueLogoLoader"],[2,"color","#c44","font-size","13px"],[2,"color","#9ca3af","font-size","13px"],[2,"height","100%","display","block",3,"cue","projectId","uuid","showLogo","variant"],[2,"display","none",3,"viewMarkdown","contextDoc","documentData","entityData","handlers","variant"],[2,"height","100%","display","block",3,"cue","projectId","iri","showLogo","variant"],[2,"height","100%",3,"itemRowClicked","addSelection","viewMarkdown","contextDoc","documentData","entityData","handlers","variant","adding"],[2,"position","absolute","top","12px","left","12px","z-index","5",3,"projectId"]],template:function(n,o){1&n&&t.nVh(0,Y,3,1,"cue-flexcontainer",0)(1,A,3,0,"cue-flexcontainer",0)(2,U,4,2,"div",1),2&n&&t.vxM("error"===o.state()?0:"idle"===o.state()?1:2)},dependencies:[L,X.FlexContainer,F.Typography,v.k,S.x,W.CueDocumentViewer,P.CueEntityViewer],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return c})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[9396],{19396(Z,D,s){s.d(D,{CueContextViewer:()=>Q});var g=s(10467),d=s(17705),a=s(85802),r=s(32271),h=s(42996),p=s(73656),w=s(32839),x=s(74631),C=s(91625),f=s(16455),y=s(68334),v=s(97851),I=s(85971),M=s(75448),b=s(2014),k=s(59352),t=s(35547);function V(c,l){1&c&&(t.j41(0,"div",1),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&c&&(t.R7$(),t.JRh(t.bMT(2,1,"components.contextViewer.infoNoContext")))}function j(c,l){if(1&c){const e=t.RV6();t.j41(0,"cue-tabs",2)(1,"cue-tab",6),t.nI1(2,"transloco"),t.j41(3,"cue-doc-list",7),t.bIt("clickedDocument",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentClicked(o))})("selectionChanged",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocSelectionChanged(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentViewMarkdown(o))}),t.k0s()(),t.j41(4,"cue-tab",6),t.nI1(5,"transloco"),t.j41(6,"cue-ent-list-inner",8),t.bIt("rowClicked",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityRowClicked(o))})("selectionChanged",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntitySelectionChanged(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityViewMarkdown(o))}),t.k0s()()()}if(2&c){const e=t.XpG();t.R7$(),t.Y8G("label",t.bMT(2,11,"components.contextViewer.tabDocuments")),t.R7$(2),t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant())("selectable",e.selectable()),t.R7$(),t.Y8G("label",t.bMT(5,13,"components.contextViewer.tabEntities")),t.R7$(2),t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())("selectable",e.selectable())}}function E(c,l){if(1&c){const e=t.RV6();t.nrm(0,"cue-document-info",9),t.j41(1,"cue-doc-list",10),t.bIt("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentViewMarkdown(o))}),t.k0s()}if(2&c){const e=t.XpG();t.Y8G("subject",e.singleDocumentSubject())("handlers",e._docInfoHandlers)("contentCategories",e.singleDocument().categories)("fileLocations",e.singleDocumentFileLocations()),t.R7$(),t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant())}}function N(c,l){if(1&c){const e=t.RV6();t.j41(0,"cue-doc-list",7),t.bIt("clickedDocument",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentClicked(o))})("selectionChanged",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocSelectionChanged(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onDocumentViewMarkdown(o))}),t.k0s()}if(2&c){const e=t.XpG();t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant())("selectable",e.selectable())}}function R(c,l){if(1&c){const e=t.RV6();t.nrm(0,"cue-entity-info",11),t.j41(1,"cue-ent-list-inner",12),t.bIt("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityViewMarkdown(o))}),t.k0s()}if(2&c){const e=t.XpG();t.Y8G("entity",e.singleEntity())("handlers",e._entityInfoHandlers),t.R7$(),t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())}}function G(c,l){if(1&c){const e=t.RV6();t.j41(0,"cue-ent-list-inner",13),t.bIt("rowClicked",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityRowClicked(o))})("selectionChanged",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntitySelectionChanged(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG();return a.Njj(i.onEntityViewMarkdown(o))}),t.k0s()}if(2&c){const e=t.XpG();t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())("selectable",e.selectable())}}function T(c,l){1&c&&(t.j41(0,"div",1),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&c&&(t.R7$(),t.JRh(t.bMT(2,1,"components.contextViewer.infoNoItems")))}function B(c,l){if(1&c){const e=t.RV6();t.j41(0,"div",5)(1,"cue-button",14),t.bIt("click",function(){a.eBV(e);const o=t.XpG();return a.Njj(o.onAddSelectionClicked())}),t.nrm(2,"cue-button-padder"),t.j41(3,"cue-button-label"),t.EFF(4),t.nI1(5,"transloco"),t.k0s(),t.nrm(6,"cue-button-padder"),t.k0s()()}if(2&c){const e=t.XpG();t.R7$(),t.Y8G("loading",e.adding())("disabled",e.adding()),t.R7$(3),t.Lme(" ",t.bMT(5,4,"components.contextViewer.buttonAddSelection")," (",e.selectedIndices().length,") ")}}let L=(()=>{class c{contextId=(0,d.hFB)(void 0);handlers=(0,d.hFB)(void 0);variant=(0,d.hFB)("none");contextDoc=(0,d.hFB)(void 0);documentData=(0,d.hFB)({});entityData=(0,d.hFB)({});selectable=(0,d.hFB)(!0);adding=(0,d.hFB)(!1);itemRowClicked=(0,d.CGW)();viewMarkdown=(0,d.CGW)();addSelection=(0,d.CGW)();loading=(0,r.EW)(()=>!!this.contextId()&&!this.contextDoc());_docItems=(0,r.EW)(()=>(this.contextDoc()?.items??[]).filter(e=>"document"===e.type));_entityItems=(0,r.EW)(()=>(this.contextDoc()?.items??[]).filter(e=>"entity"===e.type));hasDocuments=(0,r.EW)(()=>this._docItems().length>0);hasEntities=(0,r.EW)(()=>this._entityItems().length>0);hasBoth=(0,r.EW)(()=>this.hasDocuments()&&this.hasEntities());documentRefs=(0,r.EW)(()=>this._docItems().map(e=>({id:e.id,relevance:e.relevance})));entityIris=(0,r.EW)(()=>this._entityItems().map(e=>e.id));singleDocument=(0,r.EW)(()=>{if(1===this._docItems().length)return this.documentData()[this._docItems()[0].id]});isSingleDocument=(0,r.EW)(()=>this.hasDocuments()&&!this.hasEntities()&&!!this.singleDocument());singleDocumentSubject=(0,r.EW)(()=>this.singleDocument()?.subject||this.singleDocument()?.path||"");singleDocumentFileLocations=(0,r.EW)(()=>{const e=this.singleDocument();return e?[{iri:e.id,path:e.path,providerId:e.providerId}]:[]});_docInfoHandlers={};singleEntity=(0,r.EW)(()=>{if(1!==this._entityItems().length)return;const e=this._entityItems()[0].id,n=this.entityData()[e];return n?{iri:e,value:n.value,categories:n.categories}:void 0});isSingleEntity=(0,r.EW)(()=>this.hasEntities()&&!this.hasDocuments()&&!!this.singleEntity());_entityInfoHandlers={};_docHandlers=(0,r.EW)(()=>({requestData:e=>this.handlers()?.requestDocumentData?.(e),requestDownload:e=>this.handlers()?.requestDownloadDocument?.(e),requestOpen:(e,n)=>this.handlers()?.requestOpenDocument?.(e,n),requestOpenInDir:(e,n)=>this.handlers()?.requestOpenDocumentInDir?.(e,n)}));_entityHandlers=(0,r.EW)(()=>({requestData:(e,n)=>this.handlers()?.requestEntityData?.(e,n),requestOpen:e=>this.handlers()?.requestOpenEntity?.(e)}));onEntityRowClicked({row:e}){this.itemRowClicked.emit({type:"entity",row:e,index:this._originalIndex(e.entity)})}onDocumentClicked(e){this.itemRowClicked.emit({type:"document",row:e,index:this._originalIndex(e.id)})}_selectedDocIndices=(0,a.vPA)([]);_selectedEntityIndices=(0,a.vPA)([]);selectedIndices=(0,r.EW)(()=>Array.from(new Set([...this._selectedDocIndices(),...this._selectedEntityIndices()])).sort((e,n)=>e-n));onDocSelectionChanged(e){this._selectedDocIndices.set(e.map(n=>this._originalIndex(n.id)).filter(n=>n>=0))}onEntitySelectionChanged(e){this._selectedEntityIndices.set(e.map(n=>this._originalIndex(n.entity)).filter(n=>n>=0))}onAddSelectionClicked(){const e=this.selectedIndices();e.length>0&&this.addSelection.emit(e)}onDocumentViewMarkdown(e){this.viewMarkdown.emit({type:"document",markdown:e})}onEntityViewMarkdown(e){this.viewMarkdown.emit({type:"entity",markdown:e})}_originalIndex(e){return(this.contextDoc()?.items??[]).findIndex(n=>n.id===e)}constructor(){let e;(0,a.QZP)(()=>{const n=this.contextId();n&&this.handlers()?.requestContext?.(n)}),(0,a.QZP)(()=>{const n=this.contextDoc()?.id;n!==e&&(e=n,this._selectedDocIndices.set([]),this._selectedEntityIndices.set([]))})}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=t.VBU({type:c,selectors:[["cue-context-viewer-inner"]],inputs:{contextId:[1,"contextId"],handlers:[1,"handlers"],variant:[1,"variant"],contextDoc:[1,"contextDoc"],documentData:[1,"documentData"],entityData:[1,"entityData"],selectable:[1,"selectable"],adding:[1,"adding"]},outputs:{itemRowClicked:"itemRowClicked",viewMarkdown:"viewMarkdown",addSelection:"addSelection"},decls:10,vars:6,consts:[[2,"position","relative","height","100%","width","100%",3,"cueLogoLoader","cueLogoLoaderMessage"],[1,"cv-status"],[2,"height","100%"],[3,"documentRefs","documentData","handlers","variant","selectable"],[2,"height","400px",3,"entities","entityData","handlers","selectable"],[1,"cv-add-selection"],[3,"label"],[3,"clickedDocument","selectionChanged","viewMarkdown","documentRefs","documentData","handlers","variant","selectable"],[2,"height","100%",3,"rowClicked","selectionChanged","viewMarkdown","entities","entityData","handlers","selectable"],[3,"subject","handlers","contentCategories","fileLocations"],[2,"display","none",3,"viewMarkdown","documentRefs","documentData","handlers","variant"],[3,"entity","handlers"],[2,"display","none",3,"viewMarkdown","entities","entityData","handlers"],[2,"height","400px",3,"rowClicked","selectionChanged","viewMarkdown","entities","entityData","handlers","selectable"],["variant","primary",3,"click","loading","disabled"]],template:function(n,o){1&n&&(t.j41(0,"div",0),t.nI1(1,"transloco"),t.nVh(2,V,3,3,"div",1)(3,j,7,15,"cue-tabs",2)(4,E,2,8)(5,N,1,5,"cue-doc-list",3)(6,R,2,5)(7,G,1,4,"cue-ent-list-inner",4)(8,T,3,3,"div",1),t.nVh(9,B,7,6,"div",5),t.k0s()),2&n&&(t.Y8G("cueLogoLoader",o.loading())("cueLogoLoaderMessage",t.bMT(1,4,"components.contextViewer.infoLoading")),t.R7$(2),t.vxM(o.contextDoc()?o.hasBoth()?3:o.isSingleDocument()?4:o.hasDocuments()?5:o.isSingleEntity()?6:o.hasEntities()?7:8:2),t.R7$(7),t.vxM(o.selectable()&&o.selectedIndices().length>0?9:-1))},dependencies:[p.g,w.u,x.G,C.U,f.t,y.o,v.k,I.Button,M.ButtonLabel,b.ButtonPadder,k.Kj],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.cv-status[_ngcontent-%COMP%]{padding:16px;color:var(--cue-color-midgray, #888);font-size:13px}.cv-add-selection[_ngcontent-%COMP%]{position:fixed;right:24px;bottom:24px;z-index:20}"],changeDetection:0})}return c})();var X=s(35381),F=s(42245),S=s(57293),W=s(77727),P=s(13202);function Y(c,l){if(1&c&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),t.EFF(2),t.k0s()()),2&c){const e=t.XpG();t.R7$(2),t.SpI(" ",e.errorMessage()," ")}}function A(c,l){1&c&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",3),t.EFF(2," No project connected. "),t.k0s()())}function $(c,l){if(1&c){const e=t.RV6();t.nrm(0,"cue-document-viewer-wc",4),t.j41(1,"cue-context-viewer-inner",5),t.bIt("viewMarkdown",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.viewMarkdown.emit(o))}),t.k0s()}if(2&c){const e=t.XpG(2);t.Y8G("cue",e.cue())("projectId",e.projectId())("uuid",l)("showLogo",e.showLogo())("variant",e.variant()),t.R7$(),t.Y8G("contextDoc",e.contextDoc())("documentData",e.documentData())("entityData",e.entityData())("handlers",e._handlers())("variant",e.variant())}}function H(c,l){if(1&c){const e=t.RV6();t.nrm(0,"cue-entity-viewer-wc",6),t.j41(1,"cue-context-viewer-inner",5),t.bIt("viewMarkdown",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.viewMarkdown.emit(o))}),t.k0s()}if(2&c){const e=t.XpG(2);t.Y8G("cue",e.cue())("projectId",e.projectId())("iri",l)("showLogo",e.showLogo())("variant",e.variant()),t.R7$(),t.Y8G("contextDoc",e.contextDoc())("documentData",e.documentData())("entityData",e.entityData())("handlers",e._handlers())("variant",e.variant())}}function O(c,l){if(1&c&&t.nrm(0,"cue-logo-link",8),2&c){const e=t.XpG(3);t.Y8G("projectId",e.projectId())}}function z(c,l){if(1&c){const e=t.RV6();t.j41(0,"cue-context-viewer-inner",7),t.bIt("itemRowClicked",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.itemRowClicked.emit(o))})("addSelection",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.onAddSelection(o))})("viewMarkdown",function(o){a.eBV(e);const i=t.XpG(2);return a.Njj(i.viewMarkdown.emit(o))}),t.k0s(),t.nVh(1,O,1,1,"cue-logo-link",8)}if(2&c){const e=t.XpG(2);t.Y8G("contextDoc",e.contextDoc())("documentData",e.documentData())("entityData",e.entityData())("handlers",e._handlers())("variant",e.variant())("adding",e.adding()),t.R7$(),t.vxM(e.showLogo()?1:-1)}}function U(c,l){if(1&c&&(t.j41(0,"div",1),t.nVh(1,$,2,10)(2,H,2,10)(3,z,2,7),t.k0s()),2&c){let e;const n=t.XpG();t.Y8G("cueLogoLoader","loading"===n.state()),t.R7$(),t.vxM((e=n._singleDocumentUuid())?1:(e=n._singleEntityIri())?2:3,e)}}function K(c){return{id:c.id,contentIRI:c.contentIRI??c.id,path:c.path??"",suffix:c.suffix??"",size:c.size??0,tags:c.tags??[],summary:c.summary??"",categories:c.categories??[],subject:c.subject,providerId:c.providerId,relevance:0}}let Q=(()=>{class c{cue=(0,d.hFB)(void 0);projectId=(0,d.hFB)(void 0);contextId=(0,d.hFB)(void 0);variant=(0,d.hFB)("none");showLogo=(0,d.hFB)(!1,{transform:d.L39});itemRowClicked=(0,d.CGW)();selectionResult=(0,d.CGW)();viewMarkdown=(0,d.CGW)();adding=(0,a.vPA)(!1);state=(0,a.vPA)("idle");errorMessage=(0,a.vPA)(null);contextDoc=(0,a.vPA)(void 0);documentData=(0,a.vPA)({});entityData=(0,a.vPA)({});_documents=(0,a.vPA)(void 0);_entities=(0,a.vPA)(void 0);_unsubDocs;_unsubEntities;_inputWarningTimer;_singleDocumentUuid=(0,r.EW)(()=>{const e=this.contextDoc()?.items??[],n=e.filter(i=>"document"===i.type),o=e.filter(i=>"entity"===i.type);return 1===n.length&&0===o.length?n[0].id:void 0});_singleEntityIri=(0,r.EW)(()=>{const e=this.contextDoc()?.items??[],n=e.filter(i=>"document"===i.type),o=e.filter(i=>"entity"===i.type);return 1===o.length&&0===n.length?o[0].id:void 0});_handlers=(0,r.EW)(()=>({requestDocumentData:e=>this._documents()?.requestDocumentData(e),requestEntityData:(e,n)=>this._entities()?.requestEntityData(e,n)}));onAddSelection(e){var n=this;return(0,g.A)(function*(){const o=n.cue(),i=n.projectId(),u=n.contextId();if(o&&i&&u&&0!==e.length){n.adding.set(!0);try{const _=yield o.api.mcp.callTool("select",{ctx:u,column:"index",value:e,space_id:i});n.selectionResult.emit(_)}catch(_){console.error('[cue-context-viewer] "select" MCP call failed',_)}finally{n.adding.set(!1)}}})()}constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-context-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.projectId()||console.warn('[cue-context-viewer] Required input "projectId" is not set.'),this.contextId()||console.warn('[cue-context-viewer] Required input "contextId" is not set.')},3e3),(0,a.QZP)(()=>{this._load(this.cue(),this.projectId(),this.contextId())})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._teardown()}_load(e,n,o){var i=this;return(0,g.A)(function*(){if(i._teardown(),i.contextDoc.set(void 0),i.documentData.set({}),i.entityData.set({}),e&&n&&o){i.state.set("loading"),i.errorMessage.set(null);try{const u=yield e.api.contexts.getContext(n,o);i.contextDoc.set(u);const _=new h.f$(e.api,n),m=new h.g8(e.api,n);i._documents.set(_),i._entities.set(m),i._unsubDocs=_.documentInfoMap.subscribe(()=>i._syncDocumentData(_)),i._unsubEntities=m.entityInfoMap.subscribe(()=>i._syncEntityData(m)),i.state.set("ready")}catch(u){console.error("[cue-context-viewer] Failed to load context",u),i.errorMessage.set(u instanceof Error?u.message:"Failed to load context."),i.state.set("error")}}else i.state.set("idle")})()}_syncDocumentData(e){const n=e.documentInfoMap.get(),o={};for(const[i,u]of Object.entries(n))o[i]=K(u);this.documentData.set(o)}_syncEntityData(e){const n=e.entityInfoMap.get(),o={};for(const[i,u]of Object.entries(n))o[i]={value:u.value??i,categories:u.categories??[],mentionCount:u.mentionCount};this.entityData.set(o)}_teardown(){this._unsubDocs?.(),this._unsubEntities?.(),this._unsubDocs=void 0,this._unsubEntities=void 0,this._documents.set(void 0),this._entities.set(void 0)}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=t.VBU({type:c,selectors:[["cue-context-viewer"]],inputs:{cue:[1,"cue"],projectId:[1,"projectId"],contextId:[1,"contextId"],variant:[1,"variant"],showLogo:[1,"showLogo"]},outputs:{itemRowClicked:"itemRowClicked",selectionResult:"selectionResult",viewMarkdown:"viewMarkdown"},decls:3,vars:1,consts:[["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"position","relative","height","100%","width","100%",3,"cueLogoLoader"],[2,"color","#c44","font-size","13px"],[2,"color","#9ca3af","font-size","13px"],[2,"height","100%","display","block",3,"cue","projectId","uuid","showLogo","variant"],[2,"display","none",3,"viewMarkdown","contextDoc","documentData","entityData","handlers","variant"],[2,"height","100%","display","block",3,"cue","projectId","iri","showLogo","variant"],[2,"height","100%",3,"itemRowClicked","addSelection","viewMarkdown","contextDoc","documentData","entityData","handlers","variant","adding"],[2,"position","absolute","top","12px","left","12px","z-index","5",3,"projectId"]],template:function(n,o){1&n&&t.nVh(0,Y,3,1,"cue-flexcontainer",0)(1,A,3,0,"cue-flexcontainer",0)(2,U,4,2,"div",1),2&n&&t.vxM("error"===o.state()?0:"idle"===o.state()?1:2)},dependencies:[L,X.FlexContainer,F.Typography,v.k,S.x,W.CueDocumentViewer,P.CueEntityViewer],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return c})()}}]);
|
package/README.md
CHANGED
|
@@ -109,6 +109,26 @@ import '@qaecy/cue-ui';
|
|
|
109
109
|
import '@qaecy/cue-ui/styles';
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
> **With a bundler (Vite, esbuild, …)** — prefer serving the package as static files over
|
|
113
|
+
> importing it. The loader fetches its ~110 lazy chunks, the IFC wasm and the PDF worker
|
|
114
|
+
> relative to wherever `index.js` is hosted, and re-bundling it breaks that. Copy
|
|
115
|
+
> `node_modules/@qaecy/cue-ui/` to e.g. `/cue-ui/` in your build output and add
|
|
116
|
+
> `<script type="module" src="/cue-ui/index.js"></script>`. This also removes the jsDelivr
|
|
117
|
+
> dependency, which matters under a strict CSP or on-prem.
|
|
118
|
+
|
|
119
|
+
### Loader behaviour
|
|
120
|
+
|
|
121
|
+
- **Lazy boot.** Angular starts only when the first cue-ui tag is requested (`data-components`)
|
|
122
|
+
or appears in the DOM, so loading the script up front costs one request.
|
|
123
|
+
- **Dynamic tags.** Tags added to `document` later — including by a host that renders
|
|
124
|
+
everything from JS — are registered automatically. `data-components` is only needed to
|
|
125
|
+
preload chunks. Tags created inside another element's shadow root are not seen.
|
|
126
|
+
- **Language** follows `<html lang>` (`en`, `da`, `de`, `fr`, `it`; `de-CH` → `de`; anything
|
|
127
|
+
else → `en`), and changes to the attribute switch the language live.
|
|
128
|
+
- **Static assets.** `wasm/ifc-lite_bg.wasm` (IFC geometry) and `pdf.worker.min.mjs` ship
|
|
129
|
+
with the package and are resolved next to `index.js`. Set `window.pdfWorkerSrc` before
|
|
130
|
+
loading the script to use a different PDF worker.
|
|
131
|
+
|
|
112
132
|
---
|
|
113
133
|
|
|
114
134
|
## `<cue-logo>`
|