@qaecy/cue-ui 0.0.60 → 0.0.61
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/1359.js +1 -1
- package/1837.js +1 -1
- package/1842.js +1 -0
- package/2317.js +1 -1
- package/2538.js +1 -0
- package/2713.js +7 -0
- package/2775.js +1 -1
- package/2839.js +1 -1
- package/3036.js +1 -1
- package/3202.js +1 -1
- package/3418.js +1 -1
- package/3523.js +1 -1
- package/3577.js +1 -1
- package/3614.js +1 -1
- package/3654.js +1 -0
- package/3656.js +1 -1
- package/366.js +1 -0
- package/4098.js +1 -1
- package/426.js +1 -0
- package/468.js +1 -0
- package/4791.js +1 -1
- package/5649.js +1 -1
- package/5872.js +1 -1
- package/6233.js +1 -1
- package/6419.js +1 -1
- package/6947.js +1 -1
- package/7019.js +1 -0
- package/7193.js +1 -0
- package/7719.js +1 -1
- package/7727.js +1 -1
- package/8725.js +1 -0
- package/9396.js +1 -1
- package/992.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/1701.js +0 -1
- package/2530.js +0 -1
- package/329.js +0 -1
- package/3842.js +0 -1
- package/3869.js +0 -1
- package/4311.js +0 -1
- package/6040.js +0 -1
- package/7154.js +0 -1
- package/928.js +0 -1
package/7193.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[7193],{329(w,g,a){a.d(g,{CodeViewer:()=>f});var c=a(467),i=a(7705),s=a(5802),o=a(2538),_=a(5547);let f=(()=>{class p{fileURL=i.hFB.required();codeType=(0,i.hFB)("text");content=(0,s.vPA)("");onFile=(0,s.QZP)((()=>{var n=this;return(0,c.A)(function*(){const d=n.fileURL(),y=yield(yield fetch(d)).text();if("json"===n.codeType()||"jsonld"===n.codeType())try{return void n.content.set(JSON.parse(y))}catch{}n.content.set(y)})})());static \u0275fac=function(d){return new(d||p)};static \u0275cmp=_.VBU({type:p,selectors:[["cue-code-viewer"]],inputs:{fileURL:[1,"fileURL"],codeType:[1,"codeType"]},decls:1,vars:3,consts:[[2,"height","100%","width","100%","display","block",3,"type","content","readonly"]],template:function(d,l){1&d&&_.nrm(0,"cue-code-editor",0),2&d&&_.Y8G("type",l.codeType())("content",l.content())("readonly",!0)},dependencies:[o.B],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return p})()},639(w,g,a){a.d(g,{A:()=>o});const c="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",s="http://www.w3.org/2000/10/swap/",o={xsd:{decimal:`${i}decimal`,boolean:`${i}boolean`,double:`${i}double`,integer:`${i}integer`,string:`${i}string`},rdf:{type:`${c}type`,nil:`${c}nil`,first:`${c}first`,rest:`${c}rest`,langString:`${c}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${s}reify#forSome`,forAll:`${s}reify#forAll`},log:{implies:`${s}log#implies`,isImpliedBy:`${s}log#isImpliedBy`}}},6353(w,g,a){a.d(g,{Ay:()=>A,x1:()=>n});var c=a(639);const{rdf:i,xsd:s}=c.A;let o,_=0;const A={namedNode:$,blankNode:v,variable:D,literal:E,defaultGraph:function L(){return o},quad:m,triple:m,fromTerm:h,fromQuad:O};class n{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof n?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class d extends n{get termType(){return"NamedNode"}}class l extends n{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let r=t.lastIndexOf('"')+1;return r<t.length&&"@"===t[r++]?t.substr(r).toLowerCase():""}get datatype(){return new d(this.datatypeString)}get datatypeString(){const t=this.id,r=t.lastIndexOf('"')+1,u=r<t.length?t[r]:"";return"^"===u?t.substr(r+2):"@"!==u?s.string:i.langString}equals(t){return t instanceof l?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class y extends n{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class P extends n{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}o=new class j extends n{constructor(){return super(""),o||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}};class N extends n{constructor(t,r,u,S){super(""),this._subject=t,this._predicate=r,this._object=u,this._graph=S||o}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(t){return!!t&&this._subject.equals(t.subject)&&this._predicate.equals(t.predicate)&&this._object.equals(t.object)&&this._graph.equals(t.graph)}}function $(e){return new d(e)}function v(e){return new y(e||"n3-"+_++)}function E(e,t){if("string"==typeof t)return new l(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";return""===r&&("boolean"==typeof e?r=s.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?s.integer:s.double:(r=s.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),new l(""===r||r===s.string?`"${e}"`:`"${e}"^^${r}`)}function D(e){return new P(e)}function m(e,t,r,u){return new N(e,t,r,u)}function h(e){if(e instanceof n)return e;switch(e.termType){case"NamedNode":return $(e.value);case"BlankNode":return v(e.value);case"Variable":return D(e.value);case"DefaultGraph":return o;case"Literal":return E(e.value,e.language||e.datatype);case"Quad":return O(e);default:throw new Error(`Unexpected termType: ${e.termType}`)}}function O(e){if(e instanceof N)return e;if("Quad"!==e.termType)throw new Error(`Unexpected termType: ${e.termType}`);return m(h(e.subject),h(e.predicate),h(e.object),h(e.graph))}}}]);
|
package/7719.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2014,3319,5971,7719],{3319(D,f,n){n.d(f,{ButtonIcon:()=>v});var u=n(7705),i=n(29),c=n(5547);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})()},5448(D,f,n){n.d(f,{ButtonLabel:()=>p});var u=n(7705),i=n(2245),c=n(5547);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(7705),i=n(2271),c=n(5547);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})()},5971(D,f,n){n.d(f,{Button:()=>g});var u=n(9769),i=n(7705),c=n(2271),v=n(7089),p=n(2403),d=n(5547);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})()},7293(D,f,n){n.d(f,{x:()=>g});var u=n(7705),i=n(5802),c=n(2271),v=n(4613),p=n(9352),d=n(7089),s=n(5547);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,d.d,p.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(7705),i=n(5547),c=n(5802);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})()},7719(D,f,n){n.d(f,{CueDocumentCharts:()=>j});var u=n(7705),i=n(5802),c=n(2271),v=n(3615),p=n(7993),d=n(1519),s=n(9811),_=n(5381),g=n(2245),l=n(5971),M=n(9352),b=n(3319),h=n(5448),m=n(2014),E=n(7851),y=n(7293),e=n(5547);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(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 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(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,x,2,4,"div",5),e.nVh(2,L,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,_.FlexContainer,g.Typography,l.Button,h.ButtonLabel,m.ButtonPadder,b.ButtonIcon,E.k,y.x,M.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],{3319(D,f,n){n.d(f,{ButtonIcon:()=>v});var u=n(7705),i=n(29),c=n(5547);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})()},5448(D,f,n){n.d(f,{ButtonLabel:()=>p});var u=n(7705),i=n(2245),c=n(5547);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(7705),i=n(2271),c=n(5547);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})()},5971(D,f,n){n.d(f,{Button:()=>g});var u=n(9769),i=n(7705),c=n(2271),v=n(7089),p=n(2403),d=n(5547);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})()},7293(D,f,n){n.d(f,{x:()=>g});var u=n(7705),i=n(5802),c=n(2271),v=n(4613),p=n(9352),d=n(7089),s=n(5547);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,d.d,p.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(7705),i=n(5547),c=n(5802);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})()},100(D,f,n){n.d(f,{CueDocumentCharts:()=>j});var u=n(7705),i=n(5802),c=n(2271),v=n(3615),p=n(7993),d=n(1519),s=n(9811),_=n(5381),g=n(2245),l=n(5971),M=n(9352),b=n(3319),h=n(5448),m=n(2014),E=n(7851),y=n(7293),e=n(5547);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(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 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(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,x,2,4,"div",5),e.nVh(2,L,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,_.FlexContainer,g.Typography,l.Button,h.ButtonLabel,m.ButtonPadder,b.ButtonIcon,E.k,y.x,M.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],{4631(se,B,u){u.d(B,{G:()=>ue});var M=u(467),f=u(7705),y=u(2271),h=u(5802),l=u(5381),V=u(1024),j=u(9421),G=u(5794),w=u(9352),$=u(6117),U=u(8547),I=u(3319),T=u(5971),O=u(7573),X=u(9769),e=u(5547);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 S=u(2245),Z=u(5745),q=u(63),ee=u(9695),m=u(5448),x=u(2611);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,j.F,I.ButtonIcon,T.Button,m.ButtonLabel,S.Typography,Z.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,V.p,j.F,G.L,$.W,U.T,I.ButtonIcon,T.Button,K,S.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})()},7727(se,B,u){u.d(B,{CueDocumentViewer:()=>ee});var M=u(467),f=u(7705),y=u(2271),h=u(5802),l=u(5547),V=u(9769),j=u(5381),G=u(2245),w=u(4631);class ${requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var U=u(2065),I=u(5187),T=u(7293);const O=["viewerHost"];function X(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 e(m,x){1&m&&(l.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),l.EFF(2,"Loading\u2026"),l.k0s()())}function W(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 H(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 z(m,x){if(1&m&&(l.j41(0,"div",3),l.nVh(1,X,1,3,"cue-document-info",4),l.nVh(2,e,3,0,"cue-flexcontainer",5)(3,W,3,1,"cue-flexcontainer",5),l.j41(4,"div",6),l.eu8(5,null,1),l.k0s(),l.nVh(7,H,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 Y(m,x){1&m&&l.eu8(0)}function J(m,x){if(1&m&&(l.j41(0,"cue-card",2),l.DNE(1,Y,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 Q(m,x){1&m&&l.eu8(0)}function K(m,x){if(1&m&&l.DNE(0,Q,1,0,"ng-container",9),2&m){l.XpG();const a=l.sdS(1);l.Y8G("ngTemplateOutlet",a)}}const S=[".fragments",".dxf",".pdf",".png",".jpg",".jpeg",".svg",".gif",".webp",".bmp",".avif",".apng",".xlsx",".xls",".csv",".json",".jsonld",".xml",".css",".js",".html",".htm",".sh",".txt",".rst",".md"];let 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=S.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(3418),u.e(3036)]).then(u.bind(u,3036)),{DocumentViewerSettings:P}=yield u.e(3418).then(u.bind(u,3418));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,U.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(O,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,z,8,3,"ng-template",null,0,l.C5r),l.nVh(2,J,2,3,"cue-card",2)(3,K,1,1,"ng-container")),2&d&&(l.R7$(2),l.vxM("none"!==g.variant()?2:3))},dependencies:[V.MD,V.T3,j.FlexContainer,G.Typography,w.G,I.Card,T.x],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return m})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[7727],{4631(re,B,d){d.d(B,{G:()=>ue});var w=d(467),g=d(7705),y=d(2271),h=d(5802),l=d(5381),V=d(1024),j=d(9421),G=d(5794),F=d(9352),$=d(6117),O=d(8547),T=d(3319),R=d(5971),U=d(7573),X=d(9769),e=d(5547);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=g.hFB.required();highlights=(0,g.hFB)([]);allowDelete=(0,g.hFB)(!1);allowAdd=(0,g.hFB)(!1);size=(0,g.hFB)("m");highlightClick=(0,g.CGW)();deleteHighlight=(0,g.CGW)();textSelected=(0,g.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((_,oe)=>_.start-oe.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 oe=parseInt(r.getAttribute("data-segment-start"),10);let le=0;const se=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);let k=se.nextNode();for(;k&&k!==n;)le+=k.textContent?.length??0,k=se.nextNode();return oe+le+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,R.Button,T.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 S=d(2245),Z=d(5745),q=d(63),ee=d(9695),p=d(5448),x=d(2611);const a=o=>({count:o}),c=(o,C)=>t=>t.iri;function f(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 u(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 m(o,C){if(1&o&&e.nVh(0,f,3,3,"cue-typography",11)(1,u,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function M(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,m,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 E(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=g.hFB.required();availableEntityCategories=(0,g.hFB)([]);fileLocations=(0,g.hFB)([]);requestFileLocations=(0,g.hFB)(void 0);requestFilePathEntityAdd=(0,g.hFB)(void 0);confirm=(0,g.CGW)();cancel=(0,g.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,F.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,w.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,w.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,M,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,E,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,c,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,j.F,T.ButtonIcon,R.Button,p.ButtonLabel,S.Typography,Z.a,q.Select,ee.Switch,x.R,F.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 I(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 ne(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 ae(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 ie(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 P(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,ne,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,ae,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,ie,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,P,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=g.hFB.required();handlers=g.hFB.required();dataChanged=(0,g.CGW)();filePathEntityAdded=(0,g.CGW)();fileLocations=(0,g.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,g.geq)([]);contentCategories=(0,g.hFB)([]);contentCategoriesEditable=(0,g.hFB)(!1);filePathEntitiesVisible=(0,g.hFB)(!1);filePathEntitiesEditable=(0,g.hFB)(!1);menuItems=(0,g.hFB)([]);availableContentCategories=(0,g.hFB)([]);availableEntityCategories=(0,g.hFB)([]);collapsed=(0,g.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,w.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,F.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,w.A)(function*(r){console.log(r);const v={subject:t.subject(),predicate:`${U.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,I,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,V.p,j.F,G.L,$.W,O.T,T.ButtonIcon,R.Button,K,S.Typography,D,F.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})()},7727(re,B,d){d.d(B,{CueDocumentViewer:()=>ee});var w=d(467),g=d(7705),y=d(2271),h=d(5802),l=d(5547),V=d(9769),j=d(5381),G=d(2245),F=d(4631);class ${requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var O=d(2065),T=d(5187),R=d(7293);const U=["viewerHost"];function X(p,x){if(1&p&&l.nrm(0,"cue-document-info",4),2&p){const a=l.XpG(2);l.Y8G("subject",a._docSubject())("handlers",a._docInfoHandlers)("menuItems",a._menuItems())}}function e(p,x){1&p&&(l.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),l.EFF(2,"Loading\u2026"),l.k0s()())}function W(p,x){if(1&p&&(l.j41(0,"cue-flexcontainer",5)(1,"cue-typography",8),l.EFF(2),l.k0s()()),2&p){const a=l.XpG(2);l.R7$(2),l.JRh(a.errorMessage())}}function H(p,x){if(1&p&&l.nrm(0,"cue-logo-link",7),2&p){const a=l.XpG(2);l.Y8G("projectId",a.projectId())("resourceId",a._uuidOnly())}}function z(p,x){if(1&p&&(l.j41(0,"div",3),l.nVh(1,X,1,3,"cue-document-info",4),l.nVh(2,e,3,0,"cue-flexcontainer",5)(3,W,3,1,"cue-flexcontainer",5),l.j41(4,"div",6),l.eu8(5,null,1),l.k0s(),l.nVh(7,H,1,2,"cue-logo-link",7),l.k0s()),2&p){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 Y(p,x){1&p&&l.eu8(0)}function J(p,x){if(1&p&&(l.j41(0,"cue-card",2),l.DNE(1,Y,1,0,"ng-container",9),l.k0s()),2&p){const a=l.XpG(),c=l.sdS(1);l.Y8G("variant",a._cardVariant())("padded",!0),l.R7$(),l.Y8G("ngTemplateOutlet",c)}}function Q(p,x){1&p&&l.eu8(0)}function K(p,x){if(1&p&&l.DNE(0,Q,1,0,"ng-container",9),2&p){l.XpG();const a=l.sdS(1);l.Y8G("ngTemplateOutlet",a)}}const S=[".fragments",".dxf",".pdf",".png",".jpg",".jpeg",".svg",".gif",".webp",".bmp",".avif",".apng",".xlsx",".xls",".csv",".json",".jsonld",".xml",".css",".js",".html",".htm",".sh",".txt",".rst",".md"];let ee=(()=>{class p{set _viewerHostRef(a){if(this._viewerHost=a,a&&this._lastRenderArgs){const{url:c,bytes:f,suffix:s,page:u,viewerTypeOverride:m}=this._lastRenderArgs;this._renderViewer(c,f,s,u,m)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,g.hFB)(void 0);uuid=(0,g.hFB)(void 0);projectId=(0,g.hFB)(void 0);showDocumentInfo=(0,g.hFB)(!0,{transform:g.L39});showLogo=(0,g.hFB)(!1,{transform:g.L39});_uuidOnly=(0,y.EW)(()=>{const a=this.uuid();return a?a.split("?")[0].trim():void 0});extraMenuItems=(0,g.hFB)([]);portalBaseURL=(0,g.hFB)("https://cue.qaecy.com");variant=(0,g.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=[],c=this._originalUuid(),f=this._originalDocSuffix();c&&f&&a.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const s=this._alternatives();if(s.length>1){const u=this.resolvedSuffix();a.push({icon:"document",label:"Alternative representation",children:s.map(m=>({label:m.original?`Original (${m.suffix.replace(".","").toUpperCase()})`:m.suffix.replace(".","").toUpperCase(),tooltip:u===m.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(m)}))})}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(),c=this.uuid(),f=this.projectId();a&&c&&f?this._load(a,c,f):this.state.set("idle")})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._blobUrls.forEach(a=>URL.revokeObjectURL(a))}_load(a,c,f){var s=this;return(0,w.A)(function*(){if(a&&c&&f){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=f;const{uuid:u,page:m}=function Z(p){const[x,a]=p.split("?"),c=x.trim();let f=null;if(a){const u=new URLSearchParams(a).get("page");if(null!==u){const m=parseInt(u,10);!isNaN(m)&&m>0&&(f=m)}}return{uuid:c,page:f}}(c),M=a.createProjectDocuments(f),D=(yield M.fetchDocumentData([u]))[u];if(!D)throw new Error(`Document '${u}' not found in project '${f}'.`);s._docSubject.set(D.subject??""),s._originalUuid.set(u),s._originalDocSuffix.set(D.suffix);const L=yield M.fetchAlternativeRepresentations(u);s._alternatives.set([{uuid:u,suffix:D.suffix,original:!0},...L.filter(P=>P.id!==u).map(P=>({uuid:P.id,suffix:P.suffix,original:!1,remoteRelativePath:P.remoteRelativePath}))]);const{uuid:te,suffix:I,remoteRelativePath:N}=function q(p,x){const a=[p,...x];let c,f=1/0;for(const s of a){const u=S.indexOf(s.suffix);-1!==u&&u<f&&(f=u,c=s)}return c?{uuid:c.id,suffix:c.suffix,remoteRelativePath:c.remoteRelativePath}:{uuid:p.id,suffix:p.suffix}}(D,L),{blobUrl:A,bytes:ne}=N?yield s._fetchDoc(a,a.storage.getAltRepDownloadUrl(N),f):yield s._fetchDoc(a,a.storage.getDownloadUrl(f,te,I),f);s.resolvedUrl.set(A),s.resolvedSuffix.set(I);const ie=[".eml",".msg",".emlx",".mbx"].includes(D.suffix)&&".json"===I?"email":void 0;yield s._renderViewer(A,ne,I,m,ie),s.state.set("ready")}catch(u){const m=u instanceof Error?u.message:String(u);console.error("[CueDocumentViewerWC] Failed to load document:",m),s.errorMessage.set(m),s.state.set("error")}}else s.state.set("idle")})()}_fetchDoc(a,c,f){var s=this;return(0,w.A)(function*(){const u=yield a.auth.authenticatedFetch(c,{headers:{"cue-project-id":f}});if(!u.ok)throw new Error(`Failed to fetch document: ${u.status} ${u.statusText}`);const m=yield u.arrayBuffer(),M=u.headers.get("content-type")??"",E=URL.createObjectURL(new Blob([m],M?{type:M}:void 0));return s._blobUrls.add(E),{blobUrl:E,bytes:new Uint8Array(m)}})()}_renderViewer(a,c,f,s,u){var m=this;return(0,w.A)(function*(){try{const{DocumentViewer:M}=yield Promise.all([d.e(3418),d.e(3036)]).then(d.bind(d,3036)),{DocumentViewerSettings:E}=yield d.e(3418).then(d.bind(d,3418));m._viewerHost?.clear(),m.currentViewerRef?.destroy();const D=new E;if(null!==s&&(D.pdf.page=String(s)),!m._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");m._lastRenderArgs={url:a,bytes:c,suffix:f,page:s,viewerTypeOverride:u},m.currentViewerRef=m._viewerHost.createComponent(M),m.currentViewerRef.setInput("url",a),m.currentViewerRef.setInput("pdfBytes",c),m.currentViewerRef.setInput("suffix",f),m.currentViewerRef.setInput("settings",D),u&&m.currentViewerRef.setInput("viewerTypeOverride",u)}catch(M){throw new Error(`Failed to load viewer component: ${M instanceof Error?M.message:String(M)}`)}})()}_switchToAlternative(a){var c=this;return(0,w.A)(function*(){const f=c._cueSnapshot,s=c._projectIdSnapshot;if(f&&s)try{const{blobUrl:u,bytes:m}=a.remoteRelativePath?yield c._fetchDoc(f,f.storage.getAltRepDownloadUrl(a.remoteRelativePath),s):yield c._fetchDoc(f,f.storage.getDownloadUrl(s,a.uuid,a.suffix),s);c.resolvedUrl.set(u),c.resolvedSuffix.set(a.suffix),yield c._renderViewer(u,m,a.suffix,null)}catch(u){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",u)}})()}_downloadOriginal(){var a=this;return(0,w.A)(function*(){const c=a._cueSnapshot,f=a._projectIdSnapshot,s=a._originalUuid(),u=a._originalDocSuffix();if(c&&f&&s&&u)try{const m=yield c.storage.downloadBlob(f,s,u);(0,O.KE)(m,`${s}${u}`)}catch(m){console.error("[CueDocumentViewerWC] Failed to download original:",m)}})()}static \u0275fac=function(c){return new(c||p)};static \u0275cmp=l.VBU({type:p,selectors:[["cue-document-viewer-wc"]],viewQuery:function(c,f){if(1&c&&l.GBs(U,5,l.c1b),2&c){let s;l.mGM(s=l.lsd())&&(f._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(c,f){1&c&&(l.DNE(0,z,8,3,"ng-template",null,0,l.C5r),l.nVh(2,J,2,3,"cue-card",2)(3,K,1,1,"ng-container")),2&c&&(l.R7$(2),l.vxM("none"!==f.variant()?2:3))},dependencies:[V.MD,V.T3,j.FlexContainer,G.Typography,F.G,T.Card,R.x],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return p})()}}]);
|
package/8725.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[8725],{928(f,p,o){o.d(p,{CueProjectList:()=>k});var c=o(467),a=o(7705),i=o(5802),d=o(2271),g=o(2611),j=o(8017),S=o(6455),y=o(8334),m=o(2306),_=o(140),v=o(58),w=o(5187),h=o(1951),t=o(5547);function x(s,u){if(1&s){const e=t.RV6();t.j41(0,"cue-tabs",0)(1,"cue-tab",1)(2,"cue-ag-grid",2),t.bIt("selectedRows",function(r){i.eBV(e);const l=t.XpG();return i.Njj(l.onSelectedRows(r))}),t.k0s()(),t.j41(3,"cue-tab",3)(4,"cue-map",4),t.bIt("clickedFeature",function(r){i.eBV(e);const l=t.XpG();return i.Njj(l.onMapFeatureClick(r))}),t.k0s()()()}if(2&s){const e=t.XpG();t.Y8G("variant",e.variant()),t.R7$(2),t.Y8G("rowData",e.projects())("columnDefs",e.columnDefs)("rowSelection",e.rowSelection)("showPaginator",!1)("size",e.size())("overlaySettings",e.overlaySettings())("overlayActions",e.overlayActions()),t.R7$(2),t.Y8G("layers",e.mapLayers())("settings",e._mapSettings())("zoomToFit",!0)("hoverTooltipFn",e.mapHoverTooltipFn)}}function P(s,u){if(1&s){const e=t.RV6();t.j41(0,"cue-card",5)(1,"cue-ag-grid",7),t.bIt("selectedRows",function(r){i.eBV(e);const l=t.XpG(2);return i.Njj(l.onSelectedRows(r))}),t.k0s()()}if(2&s){const e=t.XpG(2);t.Y8G("variant",e._cardVariant())("padded",!1),t.R7$(),t.Y8G("rowData",e.projects())("columnDefs",e.columnDefs)("rowSelection",e.rowSelection)("showPaginator",!1)("size",e.size())}}function C(s,u){if(1&s){const e=t.RV6();t.j41(0,"cue-ag-grid",7),t.bIt("selectedRows",function(r){i.eBV(e);const l=t.XpG(2);return i.Njj(l.onSelectedRows(r))}),t.k0s()}if(2&s){const e=t.XpG(2);t.Y8G("rowData",e.projects())("columnDefs",e.columnDefs)("rowSelection",e.rowSelection)("showPaginator",!1)("size",e.size())}}function D(s,u){if(1&s&&t.nVh(0,P,2,7,"cue-card",5)(1,C,1,5,"cue-ag-grid",6),2&s){const e=t.XpG();t.vxM("none"!==e.variant()?0:1)}}let M=(()=>{class s{projects=(0,a.hFB)([]);mapSettings=(0,a.hFB)(new m.yY);variant=(0,a.hFB)("none");overlaySettings=(0,a.hFB)(new h.K);overlayActions=(0,a.hFB)([]);size=(0,a.hFB)("m");projectSelected=(0,a.CGW)();_cardVariant=(0,d.EW)(()=>this.variant());columnDefs=[{field:"name",headerName:"Project",flex:1}];rowSelection={mode:"singleRow",checkboxes:!1,enableClickSelection:!0};_mapSettings=(0,d.EW)(()=>({...this.mapSettings(),contextMenu:{showProperties:!1,showFlyTo:!1}}));mapHoverTooltipFn=e=>e.name??null;onSelectedRows(e){const n=e[0]?.id;n&&this.projectSelected.emit(n)}onMapFeatureClick(e){const n=e.feature.properties?.id;n&&this.projectSelected.emit(n)}hasLocations=(0,d.EW)(()=>this.projects().some(e=>!!e.location));mapLayers=(0,d.EW)(()=>{const e=this.projects().filter(r=>!!r.location);if(!e.length)return[];const n=new m.ux("Projects","projects");return n.collection=new _.o(e.flatMap(r=>{const l=(0,v.S)(r.location);return l?[{type:"Feature",geometry:(0,v.n)(l),properties:{name:r.name,id:r.id}}]:[]})),[n]});static \u0275fac=function(n){return new(n||s)};static \u0275cmp=t.VBU({type:s,selectors:[["cue-proj-list"]],inputs:{projects:[1,"projects"],mapSettings:[1,"mapSettings"],variant:[1,"variant"],overlaySettings:[1,"overlaySettings"],overlayActions:[1,"overlayActions"],size:[1,"size"]},outputs:{projectSelected:"projectSelected"},decls:2,vars:1,consts:[[2,"flex","1",3,"variant"],["label","List"],[3,"selectedRows","rowData","columnDefs","rowSelection","showPaginator","size","overlaySettings","overlayActions"],["label","Map"],[3,"clickedFeature","layers","settings","zoomToFit","hoverTooltipFn"],[2,"height","100%","width","100%",3,"variant","padded"],[3,"rowData","columnDefs","rowSelection","showPaginator","size"],[3,"selectedRows","rowData","columnDefs","rowSelection","showPaginator","size"]],template:function(n,r){1&n&&t.nVh(0,x,5,12,"cue-tabs",0)(1,D,2,1),2&n&&t.vxM(r.hasLocations()?0:1)},dependencies:[g.R,j.T,S.t,y.o,w.Card],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}cue-tabs[_ngcontent-%COMP%]{flex:1}cue-ag-grid[_ngcontent-%COMP%]{flex:1}cue-map[_ngcontent-%COMP%]{flex:1;min-height:300px}"],changeDetection:0})}return s})();var L=o(5381),T=o(2245),F=o(7851),b=o(7293);function R(s,u){if(1&s&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),t.EFF(2),t.k0s()()),2&s){const e=t.XpG();t.R7$(2),t.SpI(" ",e.errorMessage()," ")}}function N(s,u){1&s&&t.nrm(0,"cue-logo-link",4)}function z(s,u){if(1&s){const e=t.RV6();t.j41(0,"div",1)(1,"cue-proj-list",3),t.bIt("projectSelected",function(r){i.eBV(e);const l=t.XpG();return i.Njj(l.projectSelected.emit(r))}),t.k0s(),t.nVh(2,N,1,0,"cue-logo-link",4),t.k0s()}if(2&s){const e=t.XpG();t.Y8G("cueLogoLoader","loading"===e.state()),t.R7$(),t.Y8G("projects",e.projects())("mapSettings",e.mapSettings())("variant",e.variant())("size",e.size())("overlaySettings",e._overlaySettings)("overlayActions",e._overlayActions),t.R7$(),t.vxM(e.showLogo()?2:-1)}}let k=(()=>{class s{sdkState=(0,a.hFB)(void 0);mapboxToken=(0,a.hFB)(void 0);variant=(0,a.hFB)("none");size=(0,a.hFB)("m");showLogo=(0,a.hFB)(!1,{transform:a.L39});projectSelected=(0,a.CGW)();state=(0,i.vPA)("idle");errorMessage=(0,i.vPA)(null);_rawProjects=(0,i.vPA)([]);mapSettings=(0,d.EW)(()=>({...new m.yY,mapboxToken:this.mapboxToken()}));projects=(0,d.EW)(()=>this._rawProjects().map(e=>({id:e.id,name:e.name,location:e.location??void 0})));_overlaySettings=Object.assign(new h.K,{mode:"row"});_overlayActions=[{label:"Open in Cue portal",icon:"external-link",action:e=>{const n=e.rowData.id,r=n?`https://cue.qaecy.com/home/project?p=${encodeURIComponent(n)}`:"https://cue.qaecy.com/home/projects";window.open(r,"_blank","noopener,noreferrer")}}];_lastCue;_inputWarningTimer;constructor(){this._inputWarningTimer=setTimeout(()=>{this.sdkState()?.cue||console.warn('[cue-project-list] Required input "sdkState" is not set or missing a `cue` property. Pass a { cue: Cue } object to enable project loading.')},3e3),(0,i.QZP)(()=>{const e=this.sdkState()?.cue;e!==this._lastCue&&(this._lastCue=e,e?this._loadProjects(e.projects):(this._rawProjects.set([]),this.state.set("idle"),this.errorMessage.set(null)))})}ngOnDestroy(){clearTimeout(this._inputWarningTimer)}_loadProjects(e){var n=this;return(0,c.A)(function*(){n.state.set("loading"),n.errorMessage.set(null);try{const r=yield e.listProjects();n._rawProjects.set(r),n.state.set("ready")}catch(r){console.error("[CueProjectList] Failed to load projects:",r),n.errorMessage.set(r instanceof Error?r.message:String(r)),n.state.set("error")}})()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=t.VBU({type:s,selectors:[["cue-project-list"]],inputs:{sdkState:[1,"sdkState"],mapboxToken:[1,"mapboxToken"],variant:[1,"variant"],size:[1,"size"],showLogo:[1,"showLogo"]},outputs:{projectSelected:"projectSelected"},decls:2,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,"height","100%",3,"projectSelected","projects","mapSettings","variant","size","overlaySettings","overlayActions"],[2,"position","absolute","top","12px","right","12px","z-index","5"]],template:function(n,r){1&n&&t.nVh(0,R,3,1,"cue-flexcontainer",0)(1,z,3,8,"div",1),2&n&&t.vxM("error"===r.state()?0:1)},dependencies:[M,L.FlexContainer,T.Typography,F.k,b.x],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return s})()},362(f){f.exports=function p(o,c){if(o===c)return!0;if(o&&c&&"object"==typeof o&&"object"==typeof c){if(o.constructor!==c.constructor)return!1;var a,i,d;if(Array.isArray(o)){if((a=o.length)!=c.length)return!1;for(i=a;0!==i--;)if(!p(o[i],c[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===c.source&&o.flags===c.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===c.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===c.toString();if((a=(d=Object.keys(o)).length)!==Object.keys(c).length)return!1;for(i=a;0!==i--;)if(!Object.prototype.hasOwnProperty.call(c,d[i]))return!1;for(i=a;0!==i--;){var g=d[i];if(!p(o[g],c[g]))return!1}return!0}return o!=o&&c!=c}}}]);
|
package/9396.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[9396],{9396(U,D,s){s.d(D,{CueContextViewer:()=>A});var v=s(467),r=s(7705),c=s(5802),d=s(2271),h=s(8645),w=s(3656),p=s(2839),x=s(4631),f=s(1625),y=s(6455),C=s(8334),M=s(9352),g=s(7851),t=s(5547);function I(n,u){1&n&&(t.j41(0,"div",1),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&n&&(t.R7$(),t.JRh(t.bMT(2,1,"components.contextViewer.infoNoContext")))}function k(n,u){if(1&n){const e=t.RV6();t.j41(0,"cue-tabs",2)(1,"cue-tab",5),t.nI1(2,"transloco"),t.j41(3,"cue-doc-list",6),t.bIt("clickedDocument",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onDocumentClicked(a))})("viewMarkdown",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onDocumentViewMarkdown(a))}),t.k0s()(),t.j41(4,"cue-tab",5),t.nI1(5,"transloco"),t.j41(6,"cue-ent-list-inner",7),t.bIt("rowClicked",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onEntityRowClicked(a))})("viewMarkdown",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onEntityViewMarkdown(a))}),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("label",t.bMT(2,9,"components.contextViewer.tabDocuments")),t.R7$(2),t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant()),t.R7$(),t.Y8G("label",t.bMT(5,11,"components.contextViewer.tabEntities")),t.R7$(2),t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())}}function V(n,u){if(1&n){const e=t.RV6();t.nrm(0,"cue-document-info",8),t.j41(1,"cue-doc-list",9),t.bIt("viewMarkdown",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onDocumentViewMarkdown(a))}),t.k0s()}if(2&n){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 b(n,u){if(1&n){const e=t.RV6();t.j41(0,"cue-doc-list",6),t.bIt("clickedDocument",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onDocumentClicked(a))})("viewMarkdown",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onDocumentViewMarkdown(a))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant())}}function j(n,u){if(1&n){const e=t.RV6();t.nrm(0,"cue-entity-info",10),t.j41(1,"cue-ent-list-inner",11),t.bIt("viewMarkdown",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onEntityViewMarkdown(a))}),t.k0s()}if(2&n){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 E(n,u){if(1&n){const e=t.RV6();t.j41(0,"cue-ent-list-inner",12),t.bIt("rowClicked",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onEntityRowClicked(a))})("viewMarkdown",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.onEntityViewMarkdown(a))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())}}function R(n,u){1&n&&(t.j41(0,"div",1),t.EFF(1),t.nI1(2,"transloco"),t.k0s()),2&n&&(t.R7$(),t.JRh(t.bMT(2,1,"components.contextViewer.infoNoItems")))}let N=(()=>{class n{contextId=(0,r.hFB)(void 0);handlers=(0,r.hFB)(void 0);variant=(0,r.hFB)("none");contextDoc=(0,r.hFB)(void 0);documentData=(0,r.hFB)({});entityData=(0,r.hFB)({});itemRowClicked=(0,r.CGW)();viewMarkdown=(0,r.CGW)();loading=(0,d.EW)(()=>!!this.contextId()&&!this.contextDoc());_docItems=(0,d.EW)(()=>(this.contextDoc()?.items??[]).filter(e=>"document"===e.type));_entityItems=(0,d.EW)(()=>(this.contextDoc()?.items??[]).filter(e=>"entity"===e.type));hasDocuments=(0,d.EW)(()=>this._docItems().length>0);hasEntities=(0,d.EW)(()=>this._entityItems().length>0);hasBoth=(0,d.EW)(()=>this.hasDocuments()&&this.hasEntities());documentRefs=(0,d.EW)(()=>this._docItems().map(e=>({id:e.id,relevance:e.relevance})));entityIris=(0,d.EW)(()=>this._entityItems().map(e=>e.id));singleDocument=(0,d.EW)(()=>{if(1===this._docItems().length)return this.documentData()[this._docItems()[0].id]});isSingleDocument=(0,d.EW)(()=>this.hasDocuments()&&!this.hasEntities()&&!!this.singleDocument());singleDocumentSubject=(0,d.EW)(()=>this.singleDocument()?.subject||this.singleDocument()?.path||"");singleDocumentFileLocations=(0,d.EW)(()=>{const e=this.singleDocument();return e?[{iri:e.id,path:e.path,providerId:e.providerId}]:[]});_docInfoHandlers={};singleEntity=(0,d.EW)(()=>{if(1!==this._entityItems().length)return;const e=this._entityItems()[0].id,o=this.entityData()[e];return o?{iri:e,value:o.value,categories:o.categories}:void 0});isSingleEntity=(0,d.EW)(()=>this.hasEntities()&&!this.hasDocuments()&&!!this.singleEntity());_entityInfoHandlers={};_docHandlers=(0,d.EW)(()=>({requestData:e=>this.handlers()?.requestDocumentData?.(e),requestDownload:e=>this.handlers()?.requestDownloadDocument?.(e),requestOpen:(e,o)=>this.handlers()?.requestOpenDocument?.(e,o),requestOpenInDir:(e,o)=>this.handlers()?.requestOpenDocumentInDir?.(e,o)}));_entityHandlers=(0,d.EW)(()=>({requestData:(e,o)=>this.handlers()?.requestEntityData?.(e,o),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)})}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(o=>o.id===e)}constructor(){(0,c.QZP)(()=>{const e=this.contextId();e&&this.handlers()?.requestContext?.(e)})}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=t.VBU({type:n,selectors:[["cue-context-viewer-inner"]],inputs:{contextId:[1,"contextId"],handlers:[1,"handlers"],variant:[1,"variant"],contextDoc:[1,"contextDoc"],documentData:[1,"documentData"],entityData:[1,"entityData"]},outputs:{itemRowClicked:"itemRowClicked",viewMarkdown:"viewMarkdown"},decls:9,vars:5,consts:[[2,"position","relative","height","100%","width","100%",3,"cueLogoLoader","cueLogoLoaderMessage"],[1,"cv-status"],[2,"height","100%"],[3,"documentRefs","documentData","handlers","variant"],[2,"height","400px",3,"entities","entityData","handlers"],[3,"label"],[3,"clickedDocument","viewMarkdown","documentRefs","documentData","handlers","variant"],[2,"height","100%",3,"rowClicked","viewMarkdown","entities","entityData","handlers"],[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","viewMarkdown","entities","entityData","handlers"]],template:function(o,a){1&o&&(t.j41(0,"div",0),t.nI1(1,"transloco"),t.nVh(2,I,3,3,"div",1)(3,k,7,13,"cue-tabs",2)(4,V,2,8)(5,b,1,4,"cue-doc-list",3)(6,j,2,5)(7,E,1,3,"cue-ent-list-inner",4)(8,R,3,3,"div",1),t.k0s()),2&o&&(t.Y8G("cueLogoLoader",a.loading())("cueLogoLoaderMessage",t.bMT(1,3,"components.contextViewer.infoLoading")),t.R7$(2),t.vxM(a.contextDoc()?a.hasBoth()?3:a.isSingleDocument()?4:a.hasDocuments()?5:a.isSingleEntity()?6:a.hasEntities()?7:8:2))},dependencies:[w.g,p.u,x.G,f.U,y.t,C.o,g.k,M.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}"],changeDetection:0})}return n})();var G=s(5381),T=s(2245),B=s(7293),L=s(7727),F=s(3202);function W(n,u){if(1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",2),t.EFF(2),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.errorMessage()," ")}}function X(n,u){1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",3),t.EFF(2," No project connected. "),t.k0s()())}function Y(n,u){if(1&n){const e=t.RV6();t.nrm(0,"cue-document-viewer-wc",4),t.j41(1,"cue-context-viewer-inner",5),t.bIt("viewMarkdown",function(a){c.eBV(e);const i=t.XpG(2);return c.Njj(i.viewMarkdown.emit(a))}),t.k0s()}if(2&n){const e=t.XpG(2);t.Y8G("cue",e.cue())("projectId",e.projectId())("uuid",u)("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 $(n,u){if(1&n){const e=t.RV6();t.nrm(0,"cue-entity-viewer-wc",6),t.j41(1,"cue-context-viewer-inner",5),t.bIt("viewMarkdown",function(a){c.eBV(e);const i=t.XpG(2);return c.Njj(i.viewMarkdown.emit(a))}),t.k0s()}if(2&n){const e=t.XpG(2);t.Y8G("cue",e.cue())("projectId",e.projectId())("iri",u)("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(n,u){if(1&n&&t.nrm(0,"cue-logo-link",8),2&n){const e=t.XpG(3);t.Y8G("projectId",e.projectId())}}function P(n,u){if(1&n){const e=t.RV6();t.j41(0,"cue-context-viewer-inner",7),t.bIt("itemRowClicked",function(a){c.eBV(e);const i=t.XpG(2);return c.Njj(i.itemRowClicked.emit(a))})("viewMarkdown",function(a){c.eBV(e);const i=t.XpG(2);return c.Njj(i.viewMarkdown.emit(a))}),t.k0s(),t.nVh(1,H,1,1,"cue-logo-link",8)}if(2&n){const e=t.XpG(2);t.Y8G("contextDoc",e.contextDoc())("documentData",e.documentData())("entityData",e.entityData())("handlers",e._handlers())("variant",e.variant()),t.R7$(),t.vxM(e.showLogo()?1:-1)}}function O(n,u){if(1&n&&(t.j41(0,"div",1),t.nVh(1,Y,2,10)(2,$,2,10)(3,P,2,6),t.k0s()),2&n){let e;const o=t.XpG();t.Y8G("cueLogoLoader","loading"===o.state()),t.R7$(),t.vxM((e=o._singleDocumentUuid())?1:(e=o._singleEntityIri())?2:3,e)}}function S(n){return{id:n.id,contentIRI:n.contentIRI??n.id,path:n.path??"",suffix:n.suffix??"",size:n.size??0,tags:n.tags??[],summary:n.summary??"",categories:n.categories??[],subject:n.subject,providerId:n.providerId,relevance:0}}let A=(()=>{class n{cue=(0,r.hFB)(void 0);projectId=(0,r.hFB)(void 0);contextId=(0,r.hFB)(void 0);variant=(0,r.hFB)("none");showLogo=(0,r.hFB)(!1,{transform:r.L39});itemRowClicked=(0,r.CGW)();viewMarkdown=(0,r.CGW)();state=(0,c.vPA)("idle");errorMessage=(0,c.vPA)(null);contextDoc=(0,c.vPA)(void 0);documentData=(0,c.vPA)({});entityData=(0,c.vPA)({});_documents=(0,c.vPA)(void 0);_entities=(0,c.vPA)(void 0);_unsubDocs;_unsubEntities;_inputWarningTimer;_singleDocumentUuid=(0,d.EW)(()=>{const e=this.contextDoc()?.items??[],o=e.filter(i=>"document"===i.type),a=e.filter(i=>"entity"===i.type);return 1===o.length&&0===a.length?o[0].id:void 0});_singleEntityIri=(0,d.EW)(()=>{const e=this.contextDoc()?.items??[],o=e.filter(i=>"document"===i.type),a=e.filter(i=>"entity"===i.type);return 1===a.length&&0===o.length?a[0].id:void 0});_handlers=(0,d.EW)(()=>({requestDocumentData:e=>this._documents()?.requestDocumentData(e),requestEntityData:(e,o)=>this._entities()?.requestEntityData(e,o)}));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,c.QZP)(()=>{this._load(this.cue(),this.projectId(),this.contextId())})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._teardown()}_load(e,o,a){var i=this;return(0,v.A)(function*(){if(i._teardown(),i.contextDoc.set(void 0),i.documentData.set({}),i.entityData.set({}),e&&o&&a){i.state.set("loading"),i.errorMessage.set(null);try{const l=yield e.api.contexts.getContext(o,a);i.contextDoc.set(l);const m=new h.f$(e.api,o),_=new h.g8(e.api,o);i._documents.set(m),i._entities.set(_),i._unsubDocs=m.documentInfoMap.subscribe(()=>i._syncDocumentData(m)),i._unsubEntities=_.entityInfoMap.subscribe(()=>i._syncEntityData(_)),i.state.set("ready")}catch(l){console.error("[cue-context-viewer] Failed to load context",l),i.errorMessage.set(l instanceof Error?l.message:"Failed to load context."),i.state.set("error")}}else i.state.set("idle")})()}_syncDocumentData(e){const o=e.documentInfoMap.get(),a={};for(const[i,l]of Object.entries(o))a[i]=S(l);this.documentData.set(a)}_syncEntityData(e){const o=e.entityInfoMap.get(),a={};for(const[i,l]of Object.entries(o))a[i]={value:l.value??i,categories:l.categories??[],mentionCount:l.mentionCount};this.entityData.set(a)}_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(o){return new(o||n)};static \u0275cmp=t.VBU({type:n,selectors:[["cue-context-viewer"]],inputs:{cue:[1,"cue"],projectId:[1,"projectId"],contextId:[1,"contextId"],variant:[1,"variant"],showLogo:[1,"showLogo"]},outputs:{itemRowClicked:"itemRowClicked",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","viewMarkdown","contextDoc","documentData","entityData","handlers","variant"],[2,"position","absolute","top","12px","left","12px","z-index","5",3,"projectId"]],template:function(o,a){1&o&&t.nVh(0,W,3,1,"cue-flexcontainer",0)(1,X,3,0,"cue-flexcontainer",0)(2,O,4,2,"div",1),2&o&&t.vxM("error"===a.state()?0:"idle"===a.state()?1:2)},dependencies:[N,G.FlexContainer,T.Typography,g.k,B.x,L.CueDocumentViewer,F.CueEntityViewer],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return n})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[9396],{9396(Z,D,s){s.d(D,{CueContextViewer:()=>Q});var g=s(467),d=s(7705),a=s(5802),r=s(2271),h=s(4400),p=s(3656),w=s(2839),x=s(4631),C=s(1625),f=s(6455),y=s(8334),I=s(9352),v=s(7851),b=s(5971),M=s(5448),k=s(2014),t=s(5547);function V(c,u){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,u){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(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onDocumentClicked(i))})("selectionChanged",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onDocSelectionChanged(i))})("viewMarkdown",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onDocumentViewMarkdown(i))}),t.k0s()(),t.j41(4,"cue-tab",6),t.nI1(5,"transloco"),t.j41(6,"cue-ent-list-inner",8),t.bIt("rowClicked",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onEntityRowClicked(i))})("selectionChanged",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onEntitySelectionChanged(i))})("viewMarkdown",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onEntityViewMarkdown(i))}),t.k0s()()()}if(2&c){const e=t.XpG();t.R7$(),t.Y8G("label",t.bMT(2,12,"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,14,"components.contextViewer.tabEntities")),t.R7$(2),t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())("variant",e.variant())("selectable",e.selectable())}}function E(c,u){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(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onDocumentViewMarkdown(i))}),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,u){if(1&c){const e=t.RV6();t.j41(0,"cue-doc-list",7),t.bIt("clickedDocument",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onDocumentClicked(i))})("selectionChanged",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onDocSelectionChanged(i))})("viewMarkdown",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onDocumentViewMarkdown(i))}),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,u){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(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onEntityViewMarkdown(i))}),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,u){if(1&c){const e=t.RV6();t.j41(0,"cue-ent-list-inner",13),t.bIt("rowClicked",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onEntityRowClicked(i))})("selectionChanged",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onEntitySelectionChanged(i))})("viewMarkdown",function(i){a.eBV(e);const o=t.XpG();return a.Njj(o.onEntityViewMarkdown(i))}),t.k0s()}if(2&c){const e=t.XpG();t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())("variant",e.variant())("selectable",e.selectable())}}function T(c,u){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,u){if(1&c){const e=t.RV6();t.j41(0,"div",5)(1,"cue-button",14),t.bIt("click",function(){a.eBV(e);const i=t.XpG();return a.Njj(i.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","width","100%",3,"cueLogoLoader","cueLogoLoaderMessage"],[1,"cv-status"],[2,"height","440px"],[3,"documentRefs","documentData","handlers","variant","selectable"],[2,"height","400px",3,"entities","entityData","handlers","variant","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","variant","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","variant","selectable"],["variant","primary",3,"click","loading","disabled"]],template:function(n,i){1&n&&(t.j41(0,"div",0),t.nI1(1,"transloco"),t.nVh(2,V,3,3,"div",1)(3,j,7,16,"cue-tabs",2)(4,E,2,8)(5,N,1,5,"cue-doc-list",3)(6,R,2,5)(7,G,1,5,"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",i.loading())("cueLogoLoaderMessage",t.bMT(1,4,"components.contextViewer.infoLoading")),t.R7$(2),t.vxM(i.contextDoc()?i.hasBoth()?3:i.isSingleDocument()?4:i.hasDocuments()?5:i.isSingleEntity()?6:i.hasEntities()?7:8:2),t.R7$(7),t.vxM(i.selectable()&&i.selectedIndices().length>0?9:-1))},dependencies:[p.g,w.u,x.G,C.U,f.t,y.o,v.k,b.Button,M.ButtonLabel,k.ButtonPadder,I.Kj],styles:["[_nghost-%COMP%]{display:block;width: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(5381),F=s(2245),S=s(7293),W=s(7727),P=s(3202);function Y(c,u){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,u){1&c&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",3),t.EFF(2," No project connected. "),t.k0s()())}function $(c,u){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(i){a.eBV(e);const o=t.XpG(2);return a.Njj(o.viewMarkdown.emit(i))}),t.k0s()}if(2&c){const e=t.XpG(2);t.Y8G("cue",e.cue())("projectId",e.projectId())("uuid",u)("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,u){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(i){a.eBV(e);const o=t.XpG(2);return a.Njj(o.viewMarkdown.emit(i))}),t.k0s()}if(2&c){const e=t.XpG(2);t.Y8G("cue",e.cue())("projectId",e.projectId())("iri",u)("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,u){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,u){if(1&c){const e=t.RV6();t.j41(0,"cue-context-viewer-inner",7),t.bIt("itemRowClicked",function(i){a.eBV(e);const o=t.XpG(2);return a.Njj(o.itemRowClicked.emit(i))})("addSelection",function(i){a.eBV(e);const o=t.XpG(2);return a.Njj(o.onAddSelection(i))})("viewMarkdown",function(i){a.eBV(e);const o=t.XpG(2);return a.Njj(o.viewMarkdown.emit(i))}),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,u){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(o=>"document"===o.type),i=e.filter(o=>"entity"===o.type);return 1===n.length&&0===i.length?n[0].id:void 0});_singleEntityIri=(0,r.EW)(()=>{const e=this.contextDoc()?.items??[],n=e.filter(l=>"document"===l.type),i=e.filter(l=>"entity"===l.type);if(1!==i.length||0!==n.length)return;const o=i[0].id;return this._entities()?.entityIri(o)??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 i=n.cue(),o=n.projectId(),l=n.contextId();if(i&&o&&l&&0!==e.length){n.adding.set(!0);try{const _=yield i.api.mcp.callTool("select",{ctx:l,column:"index",value:e,space_id:o});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,i){var o=this;return(0,g.A)(function*(){if(o._teardown(),o.contextDoc.set(void 0),o.documentData.set({}),o.entityData.set({}),e&&n&&i){o.state.set("loading"),o.errorMessage.set(null);try{const l=yield e.api.contexts.getContext(n,i);o.contextDoc.set(l);const _=new h.f$(e.api,n),m=new h.g8(e.api,n);o._documents.set(_),o._entities.set(m),o._unsubDocs=_.documentInfoMap.subscribe(()=>o._syncDocumentData(_)),o._unsubEntities=m.entityInfoMap.subscribe(()=>o._syncEntityData(m)),o.state.set("ready")}catch(l){console.error("[cue-context-viewer] Failed to load context",l),o.errorMessage.set(l instanceof Error?l.message:"Failed to load context."),o.state.set("error")}}else o.state.set("idle")})()}_syncDocumentData(e){const n=e.documentInfoMap.get(),i={};for(const[o,l]of Object.entries(n))i[o]=K(l);this.documentData.set(i)}_syncEntityData(e){const n=e.entityInfoMap.get(),i={};for(const[o,l]of Object.entries(n))i[o]={value:l.value??o,categories:l.categories??[],mentionCount:l.mentionCount};this.entityData.set(i)}_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,"min-height","200px","width","100%","padding","8px"],[2,"position","relative","width","100%","min-height","200px",3,"cueLogoLoader"],[2,"color","#c44","font-size","13px"],[2,"color","#9ca3af","font-size","13px"],[2,"height","600px","display","block",3,"cue","projectId","uuid","showLogo","variant"],[2,"display","none",3,"viewMarkdown","contextDoc","documentData","entityData","handlers","variant"],[2,"height","600px","display","block",3,"cue","projectId","iri","showLogo","variant"],[2,"height","100%",3,"itemRowClicked","addSelection","viewMarkdown","contextDoc","documentData","entityData","handlers","variant","adding"],[2,"position","absolute","bottom","12px","right","12px","z-index","5",3,"projectId"]],template:function(n,i){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"===i.state()?0:"idle"===i.state()?1:2)},dependencies:[L,X.FlexContainer,F.Typography,v.k,S.x,W.CueDocumentViewer,P.CueEntityViewer],styles:["[_nghost-%COMP%]{display:block;width:100%}"],changeDetection:0})}return c})()}}]);
|
package/992.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[992],{4152(_e,K,k){k.d(K,{B:()=>H});var I=k(2065),D=k(7284),F=k.n(D);function H(N,C,b="table.csv"){const V=C.map(p=>p.label),x=N.map(p=>C.map(B=>B.formatter?B.formatter(p[B.key]):p[B.key])),U=F().unparse({fields:V,data:x});(0,I.YN)(U,b,"text/csv")}},992(_e,K,k){k.d(K,{a:()=>ct});var I=k(2271),D=k(5802);function F(e){return Array.isArray?Array.isArray(e):"[object Array]"===ue(e)}function N(e){return null==e?"":function H(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();const t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function C(e){return"string"==typeof e}function b(e){return"number"==typeof e}function x(e){return"object"==typeof e}function p(e){return null!=e}function B(e){return!e.trim().length}function ue(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Q="Invalid doc index: must be a non-negative integer within the bounds of the docs array",he=Object.prototype.hasOwnProperty;var we=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(s=>{const n=ae(s);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(s=>{s.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function ae(e){let t=null,s=null,n=null,i=1,r=null;if(C(e)||F(e))n=e,t=le(e),s=P(e);else{if(!he.call(e,"name"))throw new Error("Missing name property in key");const c=e.name;if(n=c,he.call(e,"weight")&&void 0!==e.weight&&(i=e.weight,i<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(P(c)));t=le(c),s=P(c),r=e.getFn??null}return{path:t,id:s,weight:i,src:n,getFn:r}}function le(e){return F(e)?e:e.split(".")}function P(e){return F(e)?e.join("."):e}const d=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:function be(e,t){const s=[];let n=!1;const i=(r,c,u,o)=>{if(p(r))if(c[u]){const a=r[c[u]];if(!p(a))return;if(u===c.length-1&&(C(a)||b(a)||function V(e){return!0===e||!1===e||function U(e){return x(e)&&null!==e}(e)&&"[object Boolean]"==ue(e)}(a)||"bigint"==typeof a))s.push(void 0!==o?{v:N(a),i:o}:N(a));else if(F(a)){n=!0;for(let h=0,l=a.length;h<l;h+=1)i(a[h],c,u+1,h)}else c.length&&i(a,c,u+1,o)}else s.push(void 0!==o?{v:r,i:o}:r)};return i(e,C(t)?t.split("."):t,0),n?s:s[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1});var Y=class{constructor({getFn:e=d.getFn,fieldNormWeight:t=d.fieldNormWeight}={}){this.norm=function Te(e=1,t=3){const s=new Map,n=Math.pow(10,t);return{get(i){let r=1,c=!1;for(let o=0;o<i.length;o++)32===i.charCodeAt(o)?c||(r++,c=!0):c=!1;if(s.has(r))return s.get(r);const u=Math.round(n/Math.pow(r,.5*e))/n;return s.set(r,u),u},clear(){s.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,s)=>{this._keysMap[t.id]=s})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(C(this.docs[0]))for(let s=0;s<e;s++){const n=this._createStringRecord(this.docs[s],s);n&&(this.records[t++]=n)}else for(let s=0;s<e;s++)this.records[t++]=this._createObjectRecord(this.docs[s],s);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(Q);if(C(e)){const n=this._createStringRecord(e,t);return n&&this.records.push(n),n}const s=this._createObjectRecord(e,t);return this.records.push(s),s}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(Q);for(let t=0,s=this.records.length;t<s;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,s=this.records.length;t<s;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(0===t.size)return;this.records=this.records.filter(n=>!t.has(n.i));const s=Array.from(t).sort((n,i)=>n-i);for(const n of this.records){let i=0,r=s.length;for(;i<r;){const c=i+r>>>1;s[c]<n.i?i=c+1:r=c}n.i-=i}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!p(e)||B(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const s={i:t,$:{}};for(let n=0,i=this.keys.length;n<i;n++){const r=this.keys[n],c=r.getFn?r.getFn(e):this.getFn(e,r.path);if(p(c))if(F(c)){const u=[];for(let o=0,a=c.length;o<a;o+=1){const h=c[o];if(p(h))if(C(h)){if(!B(h)){const l={v:h,i:o,n:this.norm.get(h)};u.push(l)}}else if(p(h.v)){const l=C(h.v)?h.v:N(h.v);if(!B(l)){const f={v:l,i:h.i,n:this.norm.get(l)};u.push(f)}}}s.$[n]=u}else if(C(c)&&!B(c)){const u={v:c,n:this.norm.get(c)};s.$[n]=u}}return s}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function fe(e,t,{getFn:s=d.getFn,fieldNormWeight:n=d.fieldNormWeight}={}){const i=new Y({getFn:s,fieldNormWeight:n});return i.setKeys(e.map(ae)),i.setSources(t),i.create(),i}function Oe(e,{getFn:t=d.getFn,fieldNormWeight:s=d.fieldNormWeight}={}){const{keys:n,records:i}=e,r=new Y({getFn:t,fieldNormWeight:s});return r.setKeys(n),r.setIndexRecords(i),r}function Le(e){const t={};for(let s=0,n=e.length;s<n;s+=1){const i=e.charAt(s);t[i]=(t[i]||0)|1<<n-s-1}return t}function G(e){if(e.length<=1)return e;e.sort((s,n)=>s[0]-n[0]||s[1]-n[1]);const t=[e[0]];for(let s=1,n=e.length;s<n;s+=1){const i=t[t.length-1],r=e[s];r[0]<=i[1]+1?i[1]=Math.max(i[1],r[1]):t.push(r)}return t}const de={\u0142:"l",\u0141:"L",\u0111:"d",\u0110:"D",\u00f8:"o",\u00d8:"O",\u0127:"h",\u0126:"H",\u0167:"t",\u0166:"T",\u0131:"i",\u00df:"ss"},xe=new RegExp("["+Object.keys(de).join("")+"]","g"),R="function"==typeof String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(xe,t=>de[t]):e=>e;var J=class{constructor(e,{location:t=d.location,threshold:s=d.threshold,distance:n=d.distance,includeMatches:i=d.includeMatches,findAllMatches:r=d.findAllMatches,minMatchCharLength:c=d.minMatchCharLength,isCaseSensitive:u=d.isCaseSensitive,ignoreDiacritics:o=d.ignoreDiacritics,ignoreLocation:a=d.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:n,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:o,ignoreLocation:a},e=u?e:e.toLowerCase(),e=o?R(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const h=(f,m)=>{this.chunks.push({pattern:f,alphabet:Le(f),startIndex:m})},l=this.pattern.length;if(l>32){let f=0;const m=l%32,g=l-m;for(;f<g;)h(this.pattern.substr(f,32),f),f+=32;if(m){const A=l-32;h(this.pattern.substr(A),A)}}else h(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:s,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=s?R(e):e,this.pattern===e){const g={isMatch:!0,score:0};return n&&(g.indices=[[0,e.length-1]]),g}const{location:i,distance:r,threshold:c,findAllMatches:u,minMatchCharLength:o,ignoreLocation:a}=this.options,h=[];let l=0,f=!1;this.chunks.forEach(({pattern:g,alphabet:A,startIndex:M})=>{const{isMatch:y,score:T,indices:w}=function Re(e,t,s,{location:n=d.location,distance:i=d.distance,threshold:r=d.threshold,findAllMatches:c=d.findAllMatches,minMatchCharLength:u=d.minMatchCharLength,includeMatches:o=d.includeMatches,ignoreLocation:a=d.ignoreLocation}={}){if(t.length>32)throw new Error("Pattern length exceeds max of 32.");const h=t.length,l=e.length,f=Math.max(0,Math.min(n,l));let m=r,g=f;const A=(v,E)=>{const _=v/h;if(a)return _;const L=Math.abs(f-E);return i?_+L/i:L?1:_},M=u>1||o,y=M?Array(l):[];let T;for(;(T=e.indexOf(t,g))>-1;){const v=A(0,T);if(m=Math.min(v,m),g=T+h,M){let E=0;for(;E<h;)y[T+E]=1,E+=1}}g=-1;let w=[],j=1,De=0,W=h+l;const ut=1<<h-1;for(let v=0;v<h;v+=1){let E=0,_=W;for(;E<_;)A(v,f+_)<=m?E=_:W=_,_=Math.floor((W-E)/2+E);W=_;let L=Math.max(1,f-_+1);const oe=c?l:Math.min(f+_,l)+h,O=Array(oe+2);O[oe+1]=(1<<v)-1;for(let S=oe;S>=L;S-=1){const ce=S-1;if(O[S]=(O[S+1]<<1|1)&s[e[ce]],v&&(O[S]|=(w[S+1]|w[S])<<1|1|w[S+1]),O[S]&ut&&(j=A(v,ce),j<=m)){if(m=j,g=ce,De=v,g<=f)break;L=Math.max(1,2*f-g)}}if(A(v+1,f)>m)break;w=O}if(M&&g>=0){const v=Math.min(l-1,g+h-1+De);for(let E=g;E<=v;E+=1)s[e[E]]&&(y[E]=1)}const re={isMatch:g>=0,score:Math.max(.001,j)};if(M){const v=function Ne(e=[],t=d.minMatchCharLength){const s=[];let n=-1,i=-1,r=0;for(let c=e.length;r<c;r+=1){const u=e[r];u&&-1===n?n=r:!u&&-1!==n&&(i=r-1,i-n+1>=t&&s.push([n,i]),n=-1)}return e[r-1]&&r-n>=t&&s.push([n,r-1]),s}(y,u);v.length?o&&(re.indices=v):re.isMatch=!1}return re}(e,g,A,{location:i+M,distance:r,threshold:c,findAllMatches:u,minMatchCharLength:o,includeMatches:n,ignoreLocation:a});y&&(f=!0),l+=T,y&&w&&h.push(...w)});const m={isMatch:f,score:f?l/this.chunks.length:1};return f&&n&&(m.indices=G(h)),m}};const Pe=new Set(["fuzzy","include"]);function $e(e){return e.startsWith("inverse")}const X=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const s=t===e;return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n,s=0;const i=[],r=e.length;for(;(n=t.indexOf(e,s))>-1;)s=n+r,i.push([n,s-1]);const c=!!i.length;return{isMatch:c,score:c?0:1,indices:i}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const s=t.startsWith(e);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const s=!t.startsWith(e);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const s=!t.endsWith(e);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const s=t.endsWith(e);return{isMatch:s,score:s?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const s=-1===t.indexOf(e);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const s=new J(e,{location:t.location??d.location,threshold:t.threshold??d.threshold,distance:t.distance??d.distance,includeMatches:t.includeMatches??d.includeMatches,findAllMatches:t.findAllMatches??d.findAllMatches,minMatchCharLength:t.minMatchCharLength??d.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??d.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??d.ignoreDiacritics,ignoreLocation:t.ignoreLocation??d.ignoreLocation});return{type:"fuzzy",search:n=>s.searchIn(n)}}}],ge=X.length;function me(e,t){const s=e.match(t);return s?s[1]:null}const Z=[];function q(...e){Z.push(...e)}function $(e,t){for(let s=0,n=Z.length;s<n;s+=1){const i=Z[s];if(i.condition(e,t))return new i(e,t)}return new J(e,t)}const z_AND="$and",te=e=>!(!e.$and&&!e.$or),Ae=e=>({[z_AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ce(e,t,{auto:s=!0}={}){const n=i=>{if(C(i)){const o={keyId:null,pattern:i};return s&&(o.searcher=$(i,t)),o}const r=Object.keys(i),c=(e=>!!e.$path)(i);if(!c&&r.length>1&&!te(i))return n(Ae(i));if((e=>!F(e)&&x(e)&&!te(e))(i)){const o=c?i.$path:r[0],a=c?i.$val:i[o];if(!C(a))throw new Error((e=>`Invalid value for key ${e}`)(o));const h={keyId:P(o),pattern:a};return s&&(h.searcher=$(a,t)),h}const u={children:[],operator:r[0]};return r.forEach(o=>{const a=i[o];F(a)&&a.forEach(h=>{u.children.push(n(h))})}),u};return te(e)||(e=Ae(e)),n(e)}function se(e,{ignoreFieldNorm:t=d.ignoreFieldNorm}){let s=1;return e.forEach(({key:n,norm:i,score:r})=>{const c=n?n.weight:null;s*=Math.pow(0===r&&c?Number.EPSILON:r,(c||1)*(t?1:i))}),s}var Ye=class{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const t=this.heap;for(;e>0;){const s=e-1>>1;if(t[e].score<=t[s].score)break;const n=t[e];t[e]=t[s],t[s]=n,e=s}}_sinkDown(e){const t=this.heap,s=t.length;let n=e;do{const i=2*(e=n)+1,r=2*e+2;if(i<s&&t[i].score>t[n].score&&(n=i),r<s&&t[r].score>t[n].score&&(n=r),n!==e){const c=t[e];t[e]=t[n],t[n]=c}}while(n!==e)}};const Xe=/[\p{L}\p{M}\p{N}_]+/gu,pe=new WeakSet;function ne({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:s}={}){const n=function qe(e){if("function"==typeof e){let t=!1;return s=>{const n=e(s);if(!t&&(t=!0,!Array.isArray(n)||n.some(i=>"string"!=typeof i)))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(n)?"array containing non-strings":typeof n}.`);return n}}return e instanceof RegExp?(e.global||function Ze(e){pe.has(e)||(pe.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}(e),t=>t.match(e)||[]):t=>t.match(Xe)||[]}(s);return{tokenize:i=>(e||(i=i.toLowerCase()),t&&(i=R(i)),n(i))}}function ie(e,t,s,n){const i=n.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(s,(e.docFieldCount.get(s)||0)+1);const r=new Set(i);let c=e.docTermFieldHits.get(s);c||(c=new Map,e.docTermFieldHits.set(s,c));for(const u of r)c.set(u,(c.get(u)||0)+1),e.df.set(u,(e.df.get(u)||0)+1)}function Me(e,t,s,n){const{i,v:r,$:c}=t;if(void 0===r){if(c)for(let u=0;u<s;u++){const o=c[u];if(o)if(Array.isArray(o))for(const a of o)ie(e,a.v,i,n);else ie(e,o.v,i,n)}}else ie(e,r,i,n)}function nt(e,t){const s=e.docFieldCount.get(t);if(void 0===s)return;e.fieldCount-=s,e.docFieldCount.delete(t);const n=e.docTermFieldHits.get(t);if(n){for(const[i,r]of n){const c=(e.df.get(i)||0)-r;c<=0?e.df.delete(i):e.df.set(i,c)}e.docTermFieldHits.delete(t)}}function ve(e,t){if(0===t.length)return;const s=Array.from(new Set(t)).sort((u,o)=>u-o);for(const u of s)nt(e,u);const n=u=>{let o=0,a=s.length;for(;o<a;){const h=o+a>>>1;s[h]<u?o=h+1:a=h}return u-o},i=s[0],r=new Map;for(const[u,o]of e.docFieldCount)r.set(u>i?n(u):u,o);e.docFieldCount=r;const c=new Map;for(const[u,o]of e.docTermFieldHits)c.set(u>i?n(u):u,o);e.docTermFieldHits=c}var Ee=(()=>{let e=class{constructor(t,s,n){this.options={...d,...s},this._keyStore=new we(this.options.keys),this._docs=t,this._myIndex=null,this._invertedIndex=null,this.setCollection(t,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(t){if(this._lastQuery===t)return this._lastSearcher;const s=$(t,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=t,this._lastSearcher=s,s}setCollection(t,s){if(this._docs=t,s&&!(s instanceof Y))throw new Error("Incorrect 'index' type");if(this._myIndex=s||fe(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=ne({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=function tt(e,t,s){const n={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const i of e)Me(n,i,t,s);return n}(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(t){if(!p(t))return;this._docs.push(t);const s=this._myIndex.add(t,this._docs.length-1);if(this._invertedIndex&&s){const n=ne({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});!function st(e,t,s,n){Me(e,t,s,n)}(this._invertedIndex,s,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(t=()=>!1){const s=[],n=[];for(let i=0,r=this._docs.length;i<r;i+=1)t(this._docs[i],i)&&(s.push(this._docs[i]),n.push(i));if(n.length){this._invertedIndex&&ve(this._invertedIndex,n);const i=new Set(n);this._docs=this._docs.filter((r,c)=>!i.has(c)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return s}removeAt(t){if(!Number.isInteger(t)||t<0||t>=this._docs.length)throw new Error(Q);this._invertedIndex&&ve(this._invertedIndex,[t]);const s=this._docs.splice(t,1)[0];return this._myIndex.removeAt(t),this._invalidateSearcherCache(),s}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}search(t,s){const{limit:n=-1}=s||{},{includeMatches:i,includeScore:r,shouldSort:c,sortFn:u,ignoreFieldNorm:o}=this.options;if(C(t)&&!t.trim()){let l=this._docs.map((f,m)=>({item:f,refIndex:m}));return b(n)&&n>-1&&(l=l.slice(0,n)),l}let h;if(b(n)&&n>0&&C(t)){const l=new Ye(n);C(this._docs[0])?this._searchStringList(t,{heap:l,ignoreFieldNorm:o}):this._searchObjectList(t,{heap:l,ignoreFieldNorm:o}),h=l.extractSorted(u)}else h=C(t)?C(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t),function Qe(e,{ignoreFieldNorm:t=d.ignoreFieldNorm}){e.forEach(s=>{s.score=se(s.matches,{ignoreFieldNorm:t})})}(h,{ignoreFieldNorm:o}),c&&h.sort(u),b(n)&&n>-1&&(h=h.slice(0,n));return function Je(e,t,{includeMatches:s=d.includeMatches,includeScore:n=d.includeScore}={}){return e.map(i=>{const{idx:r}=i,c={item:t[r],refIndex:r};return s&&(c.matches=function Ge(e){const t=[];return e.matches.forEach(s=>{if(!p(s.indices)||!s.indices.length)return;const n={indices:s.indices,value:s.value};s.key&&(n.key=s.key.id),s.idx>-1&&(n.refIndex=s.idx),t.push(n)}),t}(i)),n&&(c.score=i.score),c})}(h,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(t,{heap:s,ignoreFieldNorm:n}={}){const i=this._getSearcher(t),r=this.options.useTokenSearch&&"all"===this.options.tokenMatch,{records:c}=this._myIndex,u=s?null:[];return c.forEach(({v:o,i:a,n:h})=>{if(!p(o))return;const l=i.searchIn(o);if(l.isMatch){const f={score:l.score,value:o,norm:h,indices:l.indices};r&&(f.matchedMask=l.matchedMask,f.matchedTerms=l.matchedTerms,f.termCount=l.termCount);const m=[f];if(!r||this._coversAllTokens(m)){const g={item:o,idx:a,matches:m};s?(g.score=se(g.matches,{ignoreFieldNorm:n}),s.shouldInsert(g.score)&&s.insert(g)):u.push(g)}}}),u}_searchLogical(t){const s=Ce(t,this.options),n=(u,o,a)=>{if(!("children"in u)){const{keyId:m,searcher:g}=u;let A;return null===m?(A=[],this._myIndex.keys.forEach((M,y)=>{A.push(...this._findMatches({key:M,value:o[y],searcher:g}))})):A=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(o,m),searcher:g}),A&&A.length?[{idx:a,item:o,matches:A}]:[]}const{children:h,operator:l}=u,f=[];for(let m=0,g=h.length;m<g;m+=1){const M=n(h[m],o,a);if(M.length)f.push(...M);else if("$and"===l)return[]}return f},i=this._myIndex.records,r=new Map,c=[];return i.forEach(({$:u,i:o})=>{if(p(u)){const a=n(s,u,o);a.length&&(r.has(o)||(r.set(o,{idx:o,item:u,matches:[]}),c.push(r.get(o))),a.forEach(({matches:h})=>{r.get(o).matches.push(...h)}))}}),c}_searchObjectList(t,{heap:s,ignoreFieldNorm:n}={}){const i=this._getSearcher(t),r=this.options.useTokenSearch&&"all"===this.options.tokenMatch,{keys:c,records:u}=this._myIndex,o=s?null:[];return u.forEach(({$:a,i:h})=>{if(!p(a))return;const l=[];let f=!1,m=!1;if(c.forEach((g,A)=>{const M=this._findMatches({key:g,value:a[A],searcher:i});M.length?(l.push(...M),M[0].hasInverse&&(m=!0)):f=!0}),(!m||!f)&&l.length&&(!r||this._coversAllTokens(l))){const g={idx:h,item:a,matches:l};s?(g.score=se(g.matches,{ignoreFieldNorm:n}),s.shouldInsert(g.score)&&s.insert(g)):o.push(g)}}),o}_findMatches({key:t,value:s,searcher:n}){if(!p(s))return[];const i=[];if(F(s))s.forEach(({v:r,i:c,n:u})=>{if(!p(r))return;const o=n.searchIn(r);if(o.isMatch){const a={score:o.score,key:t,value:r,idx:c,norm:u,indices:o.indices,hasInverse:o.hasInverse};void 0!==o.termCount&&(a.matchedMask=o.matchedMask,a.matchedTerms=o.matchedTerms,a.termCount=o.termCount),i.push(a)}});else{const{v:r,n:c}=s,u=n.searchIn(r);if(u.isMatch){const o={score:u.score,key:t,value:r,norm:c,indices:u.indices,hasInverse:u.hasInverse};void 0!==u.termCount&&(o.matchedMask=u.matchedMask,o.matchedTerms=u.matchedTerms,o.termCount=u.termCount),i.push(o)}}return i}_coversAllTokens(t){const s=t.length?t[0].termCount:void 0;if(void 0===s)return!0;if(s<=31){let i=0;for(let r=0;r<t.length;r++)i|=t[r].matchedMask||0;return i===2**s-1}const n=new Set;for(let i=0;i<t.length;i++){const r=t[i].matchedTerms;if(r)for(const c of r)n.add(c)}return n.size===s}};return e.version="7.4.2",e.createIndex=fe,e.parseIndex=Oe,e.config=d,e.match=function(t,s,n){if(n&&n.useTokenSearch)throw new Error("Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.");return $(t,{...d,...n}).searchIn(s)},e.parseQuery=Ce,e})();q(class{constructor(e,{isCaseSensitive:t=d.isCaseSensitive,ignoreDiacritics:s=d.ignoreDiacritics,includeMatches:n=d.includeMatches,minMatchCharLength:i=d.minMatchCharLength,ignoreLocation:r=d.ignoreLocation,findAllMatches:c=d.findAllMatches,location:u=d.location,threshold:o=d.threshold,distance:a=d.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:s,includeMatches:n,minMatchCharLength:i,findAllMatches:c,ignoreLocation:r,location:u,threshold:o,distance:a},e=t?e:e.toLowerCase(),e=s?R(e):e,this.pattern=e,this.query=function Ke(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(s=>{const n=function We(e){const t=[],s=e.length;let n=0;for(;n<s;){for(;n<s&&" "===e[n];)n++;if(n>=s)break;let i=n;for(;i<s&&" "!==e[i]&&'"'!==e[i];)i++;if(i<s&&'"'===e[i]){for(i++;i<s;){if('"'===e[i]){const r=i+1;if(r>=s||" "===e[r]){i++;break}if("$"===e[r]&&(r+1>=s||" "===e[r+1])){i+=2;break}}i++}t.push(e.substring(n,i)),n=i}else{for(;i<s&&" "!==e[i];)i++;t.push(e.substring(n,i)),n=i}}return t}(s.replace(/\u0000/g,"|").trim()).filter(r=>r&&!!r.trim()),i=[];for(let r=0,c=n.length;r<c;r+=1){const u=n[r];let o=!1,a=-1;for(;!o&&++a<ge;){const h=X[a],l=me(u,h.multiRegex);l&&(i.push(h.create(l,t)),o=!0)}if(!o)for(a=-1;++a<ge;){const h=X[a],l=me(u,h.singleRegex);if(l){i.push(h.create(l,t));break}}}return i})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:n,ignoreDiacritics:i}=this.options;e=n?e:e.toLowerCase(),e=i?R(e):e;let r=0;const c=[];let u=0,o=!1;for(let a=0,h=t.length;a<h;a+=1){const l=t[a];c.length=0,r=0,o=!1;for(let f=0,m=l.length;f<m;f+=1){const g=l[f],{isMatch:A,indices:M,score:y}=g.search(e);if(!A){u=0,r=0,c.length=0,o=!1;break}r+=1,u+=y,$e(g.type)&&(o=!0),s&&(Pe.has(g.type)?c.push(...M):c.push(M))}if(r){const f={isMatch:!0,score:u/r};return o&&(f.hasInverse=!0),s&&(f.indices=G(c)),f}}return{isMatch:!1,score:1}}}),q(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=ne({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const s=this.analyzer.tokenize(e),{df:n,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const r of s){this.termSearchers.push(new J(r,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const c=n.get(r)||0,u=Math.log(1+(i-c+.5)/(c+.5));this.idfWeights.push(u)}this.combineAll="all"===t.tokenMatch,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let s=0,n=0,i=0,r=0;const c=this.combineAll&&!this.useMask?new Set:null;for(let a=0;a<this.termSearchers.length;a++){const h=this.termSearchers[a].searchIn(e),l=this.idfWeights[a];n+=l,h.isMatch&&(i++,s+=l*(1-h.score),h.indices&&t.push(...h.indices),this.combineAll&&(this.useMask?r|=1<<a:c.add(a)))}if(0===i)return{isMatch:!1,score:1};const o={isMatch:!0,score:Math.max(.001,n>0?1-s/n:0)};return this.options.includeMatches&&t.length&&(o.indices=G(t)),this.combineAll&&(this.useMask?o.matchedMask=r:o.matchedTerms=c,o.termCount=this.numTerms),o}}),Ee.use=function(...e){e.forEach(t=>q(t))};var it=Ee,ot=k(4152);let ct=(()=>{class e{filterOptions=(0,I.uu)(()=>({isCaseSensitive:!!this.filterExactMatch(),includeScore:!1,ignoreDiacritics:!1,shouldSort:!0,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:this.filterExactMatch()?0:.3,distance:100,useExtendedSearch:!1,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1,keys:this.filterKeys()}));fuse=(0,I.EW)(()=>new it(this.sorted(),this.filterOptions()));columnDefs=(0,D.vPA)([]);data=(0,D.vPA)([]);sortCol=(0,D.vPA)(void 0);sortOrder=(0,D.vPA)("ASC");filterValue=(0,D.vPA)(void 0);filterOnlyVisible=(0,D.vPA)(!0);paginatorStartIndex=(0,D.vPA)(1);paginatorEndIndex=(0,D.vPA)(5);showColumnSettings=(0,D.vPA)(!1);totalRows=(0,I.EW)(()=>this.sortedAndFiltered().length);sorted=(0,I.EW)(()=>function rt(e,t,s){if(void 0===e)return[...t];const n=e.split(",").map(r=>r.trim()),i=s.split(",").map(r=>r.trim());return[...t].sort((r,c)=>{for(let u=0;u<n.length;u++){const o=n[u],a=i[u]||i[0];if(!(o in r))continue;let h=r[o],l=c[o];if("object"==typeof h&&(h=r[o].value,l=c[o].value),null==h)return 1;if(null==l)return-1;let f=0;if(f="string"==typeof h&&"string"==typeof l?h.localeCompare(l):h>l?1:h<l?-1:0,"DESC"===a&&(f*=-1),0!==f)return f}return 0})}(this.sortCol(),this.data(),this.sortOrder()));filterCol=(0,D.vPA)(void 0);filterExactMatch=(0,D.vPA)(!1);filterKeys=(0,I.EW)(()=>{const s=this.filterCol();return void 0!==s?[s]:this.filterOnlyVisible()?this.columnDefs().map(n=>n.key):Object.keys(this.sorted()[0]||{})});sortedAndFiltered=(0,I.EW)(()=>{const s=this.filterValue()??"";return""===s?this.sorted():this.fuse().search(s).map(i=>i.item)});sortedFilteredAndPaginated=(0,I.EW)(()=>this.sortedAndFiltered().slice(this.paginatorStartIndex(),this.paginatorEndIndex()));downloadCSV(){const s=this.sortedFilteredAndPaginated(),n=this.columnDefs();(0,ot.B)(s,n)}static \u0275fac=function(n){return new(n||e)};static \u0275prov=D.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[992],{4152(_e,K,k){k.d(K,{B:()=>H});var I=k(2065),D=k(262),F=k.n(D);function H(N,C,b="table.csv"){const V=C.map(p=>p.label),x=N.map(p=>C.map(B=>B.formatter?B.formatter(p[B.key]):p[B.key])),U=F().unparse({fields:V,data:x});(0,I.YN)(U,b,"text/csv")}},992(_e,K,k){k.d(K,{a:()=>ct});var I=k(2271),D=k(5802);function F(e){return Array.isArray?Array.isArray(e):"[object Array]"===ue(e)}function N(e){return null==e?"":function H(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();const t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function C(e){return"string"==typeof e}function b(e){return"number"==typeof e}function x(e){return"object"==typeof e}function p(e){return null!=e}function B(e){return!e.trim().length}function ue(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Q="Invalid doc index: must be a non-negative integer within the bounds of the docs array",he=Object.prototype.hasOwnProperty;var we=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(s=>{const n=ae(s);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(s=>{s.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function ae(e){let t=null,s=null,n=null,i=1,r=null;if(C(e)||F(e))n=e,t=le(e),s=P(e);else{if(!he.call(e,"name"))throw new Error("Missing name property in key");const c=e.name;if(n=c,he.call(e,"weight")&&void 0!==e.weight&&(i=e.weight,i<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(P(c)));t=le(c),s=P(c),r=e.getFn??null}return{path:t,id:s,weight:i,src:n,getFn:r}}function le(e){return F(e)?e:e.split(".")}function P(e){return F(e)?e.join("."):e}const d=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:function be(e,t){const s=[];let n=!1;const i=(r,c,u,o)=>{if(p(r))if(c[u]){const a=r[c[u]];if(!p(a))return;if(u===c.length-1&&(C(a)||b(a)||function V(e){return!0===e||!1===e||function U(e){return x(e)&&null!==e}(e)&&"[object Boolean]"==ue(e)}(a)||"bigint"==typeof a))s.push(void 0!==o?{v:N(a),i:o}:N(a));else if(F(a)){n=!0;for(let h=0,l=a.length;h<l;h+=1)i(a[h],c,u+1,h)}else c.length&&i(a,c,u+1,o)}else s.push(void 0!==o?{v:r,i:o}:r)};return i(e,C(t)?t.split("."):t,0),n?s:s[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1});var Y=class{constructor({getFn:e=d.getFn,fieldNormWeight:t=d.fieldNormWeight}={}){this.norm=function Te(e=1,t=3){const s=new Map,n=Math.pow(10,t);return{get(i){let r=1,c=!1;for(let o=0;o<i.length;o++)32===i.charCodeAt(o)?c||(r++,c=!0):c=!1;if(s.has(r))return s.get(r);const u=Math.round(n/Math.pow(r,.5*e))/n;return s.set(r,u),u},clear(){s.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,s)=>{this._keysMap[t.id]=s})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(C(this.docs[0]))for(let s=0;s<e;s++){const n=this._createStringRecord(this.docs[s],s);n&&(this.records[t++]=n)}else for(let s=0;s<e;s++)this.records[t++]=this._createObjectRecord(this.docs[s],s);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(Q);if(C(e)){const n=this._createStringRecord(e,t);return n&&this.records.push(n),n}const s=this._createObjectRecord(e,t);return this.records.push(s),s}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(Q);for(let t=0,s=this.records.length;t<s;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,s=this.records.length;t<s;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(0===t.size)return;this.records=this.records.filter(n=>!t.has(n.i));const s=Array.from(t).sort((n,i)=>n-i);for(const n of this.records){let i=0,r=s.length;for(;i<r;){const c=i+r>>>1;s[c]<n.i?i=c+1:r=c}n.i-=i}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!p(e)||B(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const s={i:t,$:{}};for(let n=0,i=this.keys.length;n<i;n++){const r=this.keys[n],c=r.getFn?r.getFn(e):this.getFn(e,r.path);if(p(c))if(F(c)){const u=[];for(let o=0,a=c.length;o<a;o+=1){const h=c[o];if(p(h))if(C(h)){if(!B(h)){const l={v:h,i:o,n:this.norm.get(h)};u.push(l)}}else if(p(h.v)){const l=C(h.v)?h.v:N(h.v);if(!B(l)){const f={v:l,i:h.i,n:this.norm.get(l)};u.push(f)}}}s.$[n]=u}else if(C(c)&&!B(c)){const u={v:c,n:this.norm.get(c)};s.$[n]=u}}return s}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function fe(e,t,{getFn:s=d.getFn,fieldNormWeight:n=d.fieldNormWeight}={}){const i=new Y({getFn:s,fieldNormWeight:n});return i.setKeys(e.map(ae)),i.setSources(t),i.create(),i}function Oe(e,{getFn:t=d.getFn,fieldNormWeight:s=d.fieldNormWeight}={}){const{keys:n,records:i}=e,r=new Y({getFn:t,fieldNormWeight:s});return r.setKeys(n),r.setIndexRecords(i),r}function Le(e){const t={};for(let s=0,n=e.length;s<n;s+=1){const i=e.charAt(s);t[i]=(t[i]||0)|1<<n-s-1}return t}function G(e){if(e.length<=1)return e;e.sort((s,n)=>s[0]-n[0]||s[1]-n[1]);const t=[e[0]];for(let s=1,n=e.length;s<n;s+=1){const i=t[t.length-1],r=e[s];r[0]<=i[1]+1?i[1]=Math.max(i[1],r[1]):t.push(r)}return t}const de={\u0142:"l",\u0141:"L",\u0111:"d",\u0110:"D",\u00f8:"o",\u00d8:"O",\u0127:"h",\u0126:"H",\u0167:"t",\u0166:"T",\u0131:"i",\u00df:"ss"},xe=new RegExp("["+Object.keys(de).join("")+"]","g"),R="function"==typeof String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(xe,t=>de[t]):e=>e;var J=class{constructor(e,{location:t=d.location,threshold:s=d.threshold,distance:n=d.distance,includeMatches:i=d.includeMatches,findAllMatches:r=d.findAllMatches,minMatchCharLength:c=d.minMatchCharLength,isCaseSensitive:u=d.isCaseSensitive,ignoreDiacritics:o=d.ignoreDiacritics,ignoreLocation:a=d.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:n,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:o,ignoreLocation:a},e=u?e:e.toLowerCase(),e=o?R(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const h=(f,m)=>{this.chunks.push({pattern:f,alphabet:Le(f),startIndex:m})},l=this.pattern.length;if(l>32){let f=0;const m=l%32,g=l-m;for(;f<g;)h(this.pattern.substr(f,32),f),f+=32;if(m){const A=l-32;h(this.pattern.substr(A),A)}}else h(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:s,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=s?R(e):e,this.pattern===e){const g={isMatch:!0,score:0};return n&&(g.indices=[[0,e.length-1]]),g}const{location:i,distance:r,threshold:c,findAllMatches:u,minMatchCharLength:o,ignoreLocation:a}=this.options,h=[];let l=0,f=!1;this.chunks.forEach(({pattern:g,alphabet:A,startIndex:M})=>{const{isMatch:y,score:T,indices:w}=function Re(e,t,s,{location:n=d.location,distance:i=d.distance,threshold:r=d.threshold,findAllMatches:c=d.findAllMatches,minMatchCharLength:u=d.minMatchCharLength,includeMatches:o=d.includeMatches,ignoreLocation:a=d.ignoreLocation}={}){if(t.length>32)throw new Error("Pattern length exceeds max of 32.");const h=t.length,l=e.length,f=Math.max(0,Math.min(n,l));let m=r,g=f;const A=(v,E)=>{const _=v/h;if(a)return _;const L=Math.abs(f-E);return i?_+L/i:L?1:_},M=u>1||o,y=M?Array(l):[];let T;for(;(T=e.indexOf(t,g))>-1;){const v=A(0,T);if(m=Math.min(v,m),g=T+h,M){let E=0;for(;E<h;)y[T+E]=1,E+=1}}g=-1;let w=[],j=1,De=0,W=h+l;const ut=1<<h-1;for(let v=0;v<h;v+=1){let E=0,_=W;for(;E<_;)A(v,f+_)<=m?E=_:W=_,_=Math.floor((W-E)/2+E);W=_;let L=Math.max(1,f-_+1);const oe=c?l:Math.min(f+_,l)+h,O=Array(oe+2);O[oe+1]=(1<<v)-1;for(let S=oe;S>=L;S-=1){const ce=S-1;if(O[S]=(O[S+1]<<1|1)&s[e[ce]],v&&(O[S]|=(w[S+1]|w[S])<<1|1|w[S+1]),O[S]&ut&&(j=A(v,ce),j<=m)){if(m=j,g=ce,De=v,g<=f)break;L=Math.max(1,2*f-g)}}if(A(v+1,f)>m)break;w=O}if(M&&g>=0){const v=Math.min(l-1,g+h-1+De);for(let E=g;E<=v;E+=1)s[e[E]]&&(y[E]=1)}const re={isMatch:g>=0,score:Math.max(.001,j)};if(M){const v=function Ne(e=[],t=d.minMatchCharLength){const s=[];let n=-1,i=-1,r=0;for(let c=e.length;r<c;r+=1){const u=e[r];u&&-1===n?n=r:!u&&-1!==n&&(i=r-1,i-n+1>=t&&s.push([n,i]),n=-1)}return e[r-1]&&r-n>=t&&s.push([n,r-1]),s}(y,u);v.length?o&&(re.indices=v):re.isMatch=!1}return re}(e,g,A,{location:i+M,distance:r,threshold:c,findAllMatches:u,minMatchCharLength:o,includeMatches:n,ignoreLocation:a});y&&(f=!0),l+=T,y&&w&&h.push(...w)});const m={isMatch:f,score:f?l/this.chunks.length:1};return f&&n&&(m.indices=G(h)),m}};const Pe=new Set(["fuzzy","include"]);function $e(e){return e.startsWith("inverse")}const X=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const s=t===e;return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n,s=0;const i=[],r=e.length;for(;(n=t.indexOf(e,s))>-1;)s=n+r,i.push([n,s-1]);const c=!!i.length;return{isMatch:c,score:c?0:1,indices:i}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const s=t.startsWith(e);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const s=!t.startsWith(e);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const s=!t.endsWith(e);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const s=t.endsWith(e);return{isMatch:s,score:s?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const s=-1===t.indexOf(e);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const s=new J(e,{location:t.location??d.location,threshold:t.threshold??d.threshold,distance:t.distance??d.distance,includeMatches:t.includeMatches??d.includeMatches,findAllMatches:t.findAllMatches??d.findAllMatches,minMatchCharLength:t.minMatchCharLength??d.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??d.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??d.ignoreDiacritics,ignoreLocation:t.ignoreLocation??d.ignoreLocation});return{type:"fuzzy",search:n=>s.searchIn(n)}}}],ge=X.length;function me(e,t){const s=e.match(t);return s?s[1]:null}const Z=[];function q(...e){Z.push(...e)}function $(e,t){for(let s=0,n=Z.length;s<n;s+=1){const i=Z[s];if(i.condition(e,t))return new i(e,t)}return new J(e,t)}const z_AND="$and",te=e=>!(!e.$and&&!e.$or),Ae=e=>({[z_AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ce(e,t,{auto:s=!0}={}){const n=i=>{if(C(i)){const o={keyId:null,pattern:i};return s&&(o.searcher=$(i,t)),o}const r=Object.keys(i),c=(e=>!!e.$path)(i);if(!c&&r.length>1&&!te(i))return n(Ae(i));if((e=>!F(e)&&x(e)&&!te(e))(i)){const o=c?i.$path:r[0],a=c?i.$val:i[o];if(!C(a))throw new Error((e=>`Invalid value for key ${e}`)(o));const h={keyId:P(o),pattern:a};return s&&(h.searcher=$(a,t)),h}const u={children:[],operator:r[0]};return r.forEach(o=>{const a=i[o];F(a)&&a.forEach(h=>{u.children.push(n(h))})}),u};return te(e)||(e=Ae(e)),n(e)}function se(e,{ignoreFieldNorm:t=d.ignoreFieldNorm}){let s=1;return e.forEach(({key:n,norm:i,score:r})=>{const c=n?n.weight:null;s*=Math.pow(0===r&&c?Number.EPSILON:r,(c||1)*(t?1:i))}),s}var Ye=class{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const t=this.heap;for(;e>0;){const s=e-1>>1;if(t[e].score<=t[s].score)break;const n=t[e];t[e]=t[s],t[s]=n,e=s}}_sinkDown(e){const t=this.heap,s=t.length;let n=e;do{const i=2*(e=n)+1,r=2*e+2;if(i<s&&t[i].score>t[n].score&&(n=i),r<s&&t[r].score>t[n].score&&(n=r),n!==e){const c=t[e];t[e]=t[n],t[n]=c}}while(n!==e)}};const Xe=/[\p{L}\p{M}\p{N}_]+/gu,pe=new WeakSet;function ne({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:s}={}){const n=function qe(e){if("function"==typeof e){let t=!1;return s=>{const n=e(s);if(!t&&(t=!0,!Array.isArray(n)||n.some(i=>"string"!=typeof i)))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(n)?"array containing non-strings":typeof n}.`);return n}}return e instanceof RegExp?(e.global||function Ze(e){pe.has(e)||(pe.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}(e),t=>t.match(e)||[]):t=>t.match(Xe)||[]}(s);return{tokenize:i=>(e||(i=i.toLowerCase()),t&&(i=R(i)),n(i))}}function ie(e,t,s,n){const i=n.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(s,(e.docFieldCount.get(s)||0)+1);const r=new Set(i);let c=e.docTermFieldHits.get(s);c||(c=new Map,e.docTermFieldHits.set(s,c));for(const u of r)c.set(u,(c.get(u)||0)+1),e.df.set(u,(e.df.get(u)||0)+1)}function Me(e,t,s,n){const{i,v:r,$:c}=t;if(void 0===r){if(c)for(let u=0;u<s;u++){const o=c[u];if(o)if(Array.isArray(o))for(const a of o)ie(e,a.v,i,n);else ie(e,o.v,i,n)}}else ie(e,r,i,n)}function nt(e,t){const s=e.docFieldCount.get(t);if(void 0===s)return;e.fieldCount-=s,e.docFieldCount.delete(t);const n=e.docTermFieldHits.get(t);if(n){for(const[i,r]of n){const c=(e.df.get(i)||0)-r;c<=0?e.df.delete(i):e.df.set(i,c)}e.docTermFieldHits.delete(t)}}function ve(e,t){if(0===t.length)return;const s=Array.from(new Set(t)).sort((u,o)=>u-o);for(const u of s)nt(e,u);const n=u=>{let o=0,a=s.length;for(;o<a;){const h=o+a>>>1;s[h]<u?o=h+1:a=h}return u-o},i=s[0],r=new Map;for(const[u,o]of e.docFieldCount)r.set(u>i?n(u):u,o);e.docFieldCount=r;const c=new Map;for(const[u,o]of e.docTermFieldHits)c.set(u>i?n(u):u,o);e.docTermFieldHits=c}var Ee=(()=>{let e=class{constructor(t,s,n){this.options={...d,...s},this._keyStore=new we(this.options.keys),this._docs=t,this._myIndex=null,this._invertedIndex=null,this.setCollection(t,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(t){if(this._lastQuery===t)return this._lastSearcher;const s=$(t,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=t,this._lastSearcher=s,s}setCollection(t,s){if(this._docs=t,s&&!(s instanceof Y))throw new Error("Incorrect 'index' type");if(this._myIndex=s||fe(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=ne({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=function tt(e,t,s){const n={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const i of e)Me(n,i,t,s);return n}(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(t){if(!p(t))return;this._docs.push(t);const s=this._myIndex.add(t,this._docs.length-1);if(this._invertedIndex&&s){const n=ne({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});!function st(e,t,s,n){Me(e,t,s,n)}(this._invertedIndex,s,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(t=()=>!1){const s=[],n=[];for(let i=0,r=this._docs.length;i<r;i+=1)t(this._docs[i],i)&&(s.push(this._docs[i]),n.push(i));if(n.length){this._invertedIndex&&ve(this._invertedIndex,n);const i=new Set(n);this._docs=this._docs.filter((r,c)=>!i.has(c)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return s}removeAt(t){if(!Number.isInteger(t)||t<0||t>=this._docs.length)throw new Error(Q);this._invertedIndex&&ve(this._invertedIndex,[t]);const s=this._docs.splice(t,1)[0];return this._myIndex.removeAt(t),this._invalidateSearcherCache(),s}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}search(t,s){const{limit:n=-1}=s||{},{includeMatches:i,includeScore:r,shouldSort:c,sortFn:u,ignoreFieldNorm:o}=this.options;if(C(t)&&!t.trim()){let l=this._docs.map((f,m)=>({item:f,refIndex:m}));return b(n)&&n>-1&&(l=l.slice(0,n)),l}let h;if(b(n)&&n>0&&C(t)){const l=new Ye(n);C(this._docs[0])?this._searchStringList(t,{heap:l,ignoreFieldNorm:o}):this._searchObjectList(t,{heap:l,ignoreFieldNorm:o}),h=l.extractSorted(u)}else h=C(t)?C(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t),function Qe(e,{ignoreFieldNorm:t=d.ignoreFieldNorm}){e.forEach(s=>{s.score=se(s.matches,{ignoreFieldNorm:t})})}(h,{ignoreFieldNorm:o}),c&&h.sort(u),b(n)&&n>-1&&(h=h.slice(0,n));return function Je(e,t,{includeMatches:s=d.includeMatches,includeScore:n=d.includeScore}={}){return e.map(i=>{const{idx:r}=i,c={item:t[r],refIndex:r};return s&&(c.matches=function Ge(e){const t=[];return e.matches.forEach(s=>{if(!p(s.indices)||!s.indices.length)return;const n={indices:s.indices,value:s.value};s.key&&(n.key=s.key.id),s.idx>-1&&(n.refIndex=s.idx),t.push(n)}),t}(i)),n&&(c.score=i.score),c})}(h,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(t,{heap:s,ignoreFieldNorm:n}={}){const i=this._getSearcher(t),r=this.options.useTokenSearch&&"all"===this.options.tokenMatch,{records:c}=this._myIndex,u=s?null:[];return c.forEach(({v:o,i:a,n:h})=>{if(!p(o))return;const l=i.searchIn(o);if(l.isMatch){const f={score:l.score,value:o,norm:h,indices:l.indices};r&&(f.matchedMask=l.matchedMask,f.matchedTerms=l.matchedTerms,f.termCount=l.termCount);const m=[f];if(!r||this._coversAllTokens(m)){const g={item:o,idx:a,matches:m};s?(g.score=se(g.matches,{ignoreFieldNorm:n}),s.shouldInsert(g.score)&&s.insert(g)):u.push(g)}}}),u}_searchLogical(t){const s=Ce(t,this.options),n=(u,o,a)=>{if(!("children"in u)){const{keyId:m,searcher:g}=u;let A;return null===m?(A=[],this._myIndex.keys.forEach((M,y)=>{A.push(...this._findMatches({key:M,value:o[y],searcher:g}))})):A=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(o,m),searcher:g}),A&&A.length?[{idx:a,item:o,matches:A}]:[]}const{children:h,operator:l}=u,f=[];for(let m=0,g=h.length;m<g;m+=1){const M=n(h[m],o,a);if(M.length)f.push(...M);else if("$and"===l)return[]}return f},i=this._myIndex.records,r=new Map,c=[];return i.forEach(({$:u,i:o})=>{if(p(u)){const a=n(s,u,o);a.length&&(r.has(o)||(r.set(o,{idx:o,item:u,matches:[]}),c.push(r.get(o))),a.forEach(({matches:h})=>{r.get(o).matches.push(...h)}))}}),c}_searchObjectList(t,{heap:s,ignoreFieldNorm:n}={}){const i=this._getSearcher(t),r=this.options.useTokenSearch&&"all"===this.options.tokenMatch,{keys:c,records:u}=this._myIndex,o=s?null:[];return u.forEach(({$:a,i:h})=>{if(!p(a))return;const l=[];let f=!1,m=!1;if(c.forEach((g,A)=>{const M=this._findMatches({key:g,value:a[A],searcher:i});M.length?(l.push(...M),M[0].hasInverse&&(m=!0)):f=!0}),(!m||!f)&&l.length&&(!r||this._coversAllTokens(l))){const g={idx:h,item:a,matches:l};s?(g.score=se(g.matches,{ignoreFieldNorm:n}),s.shouldInsert(g.score)&&s.insert(g)):o.push(g)}}),o}_findMatches({key:t,value:s,searcher:n}){if(!p(s))return[];const i=[];if(F(s))s.forEach(({v:r,i:c,n:u})=>{if(!p(r))return;const o=n.searchIn(r);if(o.isMatch){const a={score:o.score,key:t,value:r,idx:c,norm:u,indices:o.indices,hasInverse:o.hasInverse};void 0!==o.termCount&&(a.matchedMask=o.matchedMask,a.matchedTerms=o.matchedTerms,a.termCount=o.termCount),i.push(a)}});else{const{v:r,n:c}=s,u=n.searchIn(r);if(u.isMatch){const o={score:u.score,key:t,value:r,norm:c,indices:u.indices,hasInverse:u.hasInverse};void 0!==u.termCount&&(o.matchedMask=u.matchedMask,o.matchedTerms=u.matchedTerms,o.termCount=u.termCount),i.push(o)}}return i}_coversAllTokens(t){const s=t.length?t[0].termCount:void 0;if(void 0===s)return!0;if(s<=31){let i=0;for(let r=0;r<t.length;r++)i|=t[r].matchedMask||0;return i===2**s-1}const n=new Set;for(let i=0;i<t.length;i++){const r=t[i].matchedTerms;if(r)for(const c of r)n.add(c)}return n.size===s}};return e.version="7.4.2",e.createIndex=fe,e.parseIndex=Oe,e.config=d,e.match=function(t,s,n){if(n&&n.useTokenSearch)throw new Error("Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.");return $(t,{...d,...n}).searchIn(s)},e.parseQuery=Ce,e})();q(class{constructor(e,{isCaseSensitive:t=d.isCaseSensitive,ignoreDiacritics:s=d.ignoreDiacritics,includeMatches:n=d.includeMatches,minMatchCharLength:i=d.minMatchCharLength,ignoreLocation:r=d.ignoreLocation,findAllMatches:c=d.findAllMatches,location:u=d.location,threshold:o=d.threshold,distance:a=d.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:s,includeMatches:n,minMatchCharLength:i,findAllMatches:c,ignoreLocation:r,location:u,threshold:o,distance:a},e=t?e:e.toLowerCase(),e=s?R(e):e,this.pattern=e,this.query=function Ke(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(s=>{const n=function We(e){const t=[],s=e.length;let n=0;for(;n<s;){for(;n<s&&" "===e[n];)n++;if(n>=s)break;let i=n;for(;i<s&&" "!==e[i]&&'"'!==e[i];)i++;if(i<s&&'"'===e[i]){for(i++;i<s;){if('"'===e[i]){const r=i+1;if(r>=s||" "===e[r]){i++;break}if("$"===e[r]&&(r+1>=s||" "===e[r+1])){i+=2;break}}i++}t.push(e.substring(n,i)),n=i}else{for(;i<s&&" "!==e[i];)i++;t.push(e.substring(n,i)),n=i}}return t}(s.replace(/\u0000/g,"|").trim()).filter(r=>r&&!!r.trim()),i=[];for(let r=0,c=n.length;r<c;r+=1){const u=n[r];let o=!1,a=-1;for(;!o&&++a<ge;){const h=X[a],l=me(u,h.multiRegex);l&&(i.push(h.create(l,t)),o=!0)}if(!o)for(a=-1;++a<ge;){const h=X[a],l=me(u,h.singleRegex);if(l){i.push(h.create(l,t));break}}}return i})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:n,ignoreDiacritics:i}=this.options;e=n?e:e.toLowerCase(),e=i?R(e):e;let r=0;const c=[];let u=0,o=!1;for(let a=0,h=t.length;a<h;a+=1){const l=t[a];c.length=0,r=0,o=!1;for(let f=0,m=l.length;f<m;f+=1){const g=l[f],{isMatch:A,indices:M,score:y}=g.search(e);if(!A){u=0,r=0,c.length=0,o=!1;break}r+=1,u+=y,$e(g.type)&&(o=!0),s&&(Pe.has(g.type)?c.push(...M):c.push(M))}if(r){const f={isMatch:!0,score:u/r};return o&&(f.hasInverse=!0),s&&(f.indices=G(c)),f}}return{isMatch:!1,score:1}}}),q(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=ne({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const s=this.analyzer.tokenize(e),{df:n,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const r of s){this.termSearchers.push(new J(r,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const c=n.get(r)||0,u=Math.log(1+(i-c+.5)/(c+.5));this.idfWeights.push(u)}this.combineAll="all"===t.tokenMatch,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let s=0,n=0,i=0,r=0;const c=this.combineAll&&!this.useMask?new Set:null;for(let a=0;a<this.termSearchers.length;a++){const h=this.termSearchers[a].searchIn(e),l=this.idfWeights[a];n+=l,h.isMatch&&(i++,s+=l*(1-h.score),h.indices&&t.push(...h.indices),this.combineAll&&(this.useMask?r|=1<<a:c.add(a)))}if(0===i)return{isMatch:!1,score:1};const o={isMatch:!0,score:Math.max(.001,n>0?1-s/n:0)};return this.options.includeMatches&&t.length&&(o.indices=G(t)),this.combineAll&&(this.useMask?o.matchedMask=r:o.matchedTerms=c,o.termCount=this.numTerms),o}}),Ee.use=function(...e){e.forEach(t=>q(t))};var it=Ee,ot=k(4152);let ct=(()=>{class e{filterOptions=(0,I.uu)(()=>({isCaseSensitive:!!this.filterExactMatch(),includeScore:!1,ignoreDiacritics:!1,shouldSort:!0,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:this.filterExactMatch()?0:.3,distance:100,useExtendedSearch:!1,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1,keys:this.filterKeys()}));fuse=(0,I.EW)(()=>new it(this.sorted(),this.filterOptions()));columnDefs=(0,D.vPA)([]);data=(0,D.vPA)([]);sortCol=(0,D.vPA)(void 0);sortOrder=(0,D.vPA)("ASC");filterValue=(0,D.vPA)(void 0);filterOnlyVisible=(0,D.vPA)(!0);paginatorStartIndex=(0,D.vPA)(1);paginatorEndIndex=(0,D.vPA)(5);showColumnSettings=(0,D.vPA)(!1);totalRows=(0,I.EW)(()=>this.sortedAndFiltered().length);sorted=(0,I.EW)(()=>function rt(e,t,s){if(void 0===e)return[...t];const n=e.split(",").map(r=>r.trim()),i=s.split(",").map(r=>r.trim());return[...t].sort((r,c)=>{for(let u=0;u<n.length;u++){const o=n[u],a=i[u]||i[0];if(!(o in r))continue;let h=r[o],l=c[o];if("object"==typeof h&&(h=r[o].value,l=c[o].value),null==h)return 1;if(null==l)return-1;let f=0;if(f="string"==typeof h&&"string"==typeof l?h.localeCompare(l):h>l?1:h<l?-1:0,"DESC"===a&&(f*=-1),0!==f)return f}return 0})}(this.sortCol(),this.data(),this.sortOrder()));filterCol=(0,D.vPA)(void 0);filterExactMatch=(0,D.vPA)(!1);filterKeys=(0,I.EW)(()=>{const s=this.filterCol();return void 0!==s?[s]:this.filterOnlyVisible()?this.columnDefs().map(n=>n.key):Object.keys(this.sorted()[0]||{})});sortedAndFiltered=(0,I.EW)(()=>{const s=this.filterValue()??"";return""===s?this.sorted():this.fuse().search(s).map(i=>i.item)});sortedFilteredAndPaginated=(0,I.EW)(()=>this.sortedAndFiltered().slice(this.paginatorStartIndex(),this.paginatorEndIndex()));downloadCSV(){const s=this.sortedFilteredAndPaginated(),n=this.columnDefs();(0,ot.B)(s,n)}static \u0275fac=function(n){return new(n||e)};static \u0275prov=D.jDH({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})()}}]);
|