@qaecy/cue-ui 0.0.49 → 0.0.51

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.
Files changed (106) hide show
  1. package/1138.js +1 -0
  2. package/1153.js +1 -0
  3. package/{247.js → 1247.js} +1 -1
  4. package/1338.js +1 -0
  5. package/1359.js +1 -0
  6. package/1573.js +1 -0
  7. package/1931.js +1 -0
  8. package/1985.js +1 -0
  9. package/2245.js +1 -0
  10. package/2269.js +1 -0
  11. package/2312.js +1 -0
  12. package/2399.js +1 -0
  13. package/2724.js +1 -0
  14. package/2839.js +1 -0
  15. package/29.js +1 -0
  16. package/3036.js +1 -0
  17. package/3039.js +1 -0
  18. package/{418.js → 3418.js} +1 -1
  19. package/3523.js +1 -0
  20. package/3910.js +1 -0
  21. package/4031.js +1 -0
  22. package/4283.js +1 -0
  23. package/4284.js +1 -0
  24. package/4311.js +1 -0
  25. package/4613.js +1 -0
  26. package/4687.js +1 -0
  27. package/4879.js +1 -0
  28. package/503.js +1 -0
  29. package/5041.js +1 -0
  30. package/5137.js +1 -0
  31. package/5187.js +1 -0
  32. package/5559.js +1 -0
  33. package/5740.js +1 -0
  34. package/5872.js +1 -0
  35. package/617.js +1 -0
  36. package/63.js +1 -0
  37. package/6376.js +1 -0
  38. package/6419.js +1 -0
  39. package/6423.js +1 -0
  40. package/6586.js +1 -0
  41. package/6911.js +1 -0
  42. package/7056.js +1 -0
  43. package/7247.js +1 -0
  44. package/7284.js +1 -0
  45. package/7427.js +1 -0
  46. package/7598.js +1 -0
  47. package/7719.js +1 -0
  48. package/8336.js +1 -0
  49. package/836.js +1 -1
  50. package/8560.js +1 -0
  51. package/8791.js +1 -0
  52. package/8855.js +1 -0
  53. package/8957.js +1 -0
  54. package/9004.js +1 -0
  55. package/906.js +1 -0
  56. package/928.js +1 -1
  57. package/9396.js +1 -0
  58. package/9417.js +1 -0
  59. package/9443.js +1 -0
  60. package/9495.js +1 -0
  61. package/9695.js +1 -0
  62. package/9769.js +1 -0
  63. package/README.md +135 -0
  64. package/common.js +1 -1
  65. package/index.js +1 -1
  66. package/main.js +1 -1
  67. package/package.json +1 -1
  68. package/runtime.js +1 -1
  69. package/149.js +0 -1
  70. package/153.js +0 -1
  71. package/245.js +0 -1
  72. package/269.js +0 -1
  73. package/284.js +0 -1
  74. package/311.js +0 -1
  75. package/336.js +0 -1
  76. package/36.js +0 -1
  77. package/376.js +0 -1
  78. package/393.js +0 -1
  79. package/396.js +0 -1
  80. package/399.js +0 -1
  81. package/4.js +0 -1
  82. package/41.js +0 -1
  83. package/419.js +0 -1
  84. package/423.js +0 -1
  85. package/494.js +0 -1
  86. package/523.js +0 -1
  87. package/560.js +0 -1
  88. package/586.js +0 -1
  89. package/598.js +0 -1
  90. package/613.js +0 -1
  91. package/628.js +0 -1
  92. package/7.js +0 -1
  93. package/719.js +0 -1
  94. package/724.js +0 -1
  95. package/740.js +0 -1
  96. package/773.js +0 -1
  97. package/791.js +0 -1
  98. package/799.js +0 -1
  99. package/802.js +0 -1
  100. package/839.js +0 -1
  101. package/855.js +0 -1
  102. package/872.js +0 -1
  103. package/879.js +0 -1
  104. package/903.js +0 -1
  105. package/911.js +0 -1
  106. package/931.js +0 -1
package/36.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[36],{2014(V,M,n){n.d(M,{z:()=>R});var f=n(7705),e=n(2271),a=n(5547);const t=["*"];let R=(()=>{class u{justify=(0,f.hFB)("start");size=(0,f.hFB)("l");widthStyle=(0,e.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(g){return new(g||u)};static \u0275cmp=a.VBU({type:u,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:t,decls:2,vars:4,template:function(g,T){1&g&&(a.NAR(),a.rj2(0,"div"),a.SdG(1),a.eux()),2&g&&a.xc7("justify-content",T.justify())("min-width",T.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return u})()},3036(V,M,n){n.r(M),n.d(M,{DocumentViewer:()=>G});var f=n(467),e=n(9769),a=n(5802),t=n(7705),R=n(2271),u=n(5547),h=n(3418),c=n(6114);const g={bim:()=>Promise.all([n.e(598),n.e(76),n.e(419)]).then(n.bind(n,6419)).then(r=>r.BIMFragmentsViewer),cad:()=>Promise.all([n.e(598),n.e(560),n.e(76),n.e(931)]).then(n.bind(n,1051)).then(r=>r.DXFViewer),image:()=>n.e(560).then(n.bind(n,8560)).then(r=>r.ImageViewer),markdown:()=>Promise.all([n.e(222),n.e(586)]).then(n.bind(n,6586)).then(r=>r.MarkdownViewer),pdf:()=>Promise.all([n.e(560),n.e(311)]).then(n.bind(n,4311)).then(r=>r.PDFViewer),text:()=>n.e(523).then(n.bind(n,3523)).then(r=>r.TextViewer),spreadsheet:()=>Promise.all([n.e(903),n.e(336)]).then(n.bind(n,8336)).then(r=>r.Spreadsheet),code:()=>Promise.all([n.e(284),n.e(836),n.e(329)]).then(n.bind(n,329)).then(r=>r.CodeViewer),email:()=>n.e(740).then(n.bind(n,5740)).then(r=>r.EmailViewer)},T=new Map([[c.N.DXF,"cad"],[c.N.FRAG,"bim"],[c.N.PDF,"pdf"],[c.N.PNG,"image"],[c.N.JPG,"image"],[c.N.JPEG,"image"],[c.N.SVG,"image"],[c.N.GIF,"image"],[c.N.WEBP,"image"],[c.N.BMP,"image"],[c.N.AVIF,"image"],[c.N.APNG,"image"],[c.N.CSV,"spreadsheet"],[c.N.XLSX,"spreadsheet"],[c.N.XLS,"spreadsheet"],[c.N.JSON,"code"],[c.N.JSONLD,"code"],[c.N.XML,"code"],[c.N.CSS,"code"],[c.N.JS,"code"],[c.N.HTML,"code"],[c.N.HTM,"code"],[c.N.SH,"code"],[c.N.TXT,"text"],[c.N.RST,"text"],[c.N.MD,"markdown"]]);var A=n(8807),E=n(2065);const C=["*"];let H=(()=>{class r{width=(0,t.hFB)("auto");height=(0,t.hFB)("auto");style=(0,t.hFB)("");getStyles=(0,R.EW)(()=>this.style());static \u0275fac=function(o){return new(o||r)};static \u0275cmp=u.VBU({type:r,selectors:[["cue-container"]],hostVars:6,hostBindings:function(o,d){2&o&&(u.Aen(d.getStyles()),u.xc7("max-width",d.width())("max-height",d.height()))},inputs:{width:[1,"width"],height:[1,"height"],style:[1,"style"]},ngContentSelectors:C,decls:1,vars:0,template:function(o,d){1&o&&(u.NAR(),u.SdG(0))},styles:["[_nghost-%COMP%]{display:flex;align-items:stretch;container-name:cue-container;container-type:inline-size}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{flex:1;max-width:100%}"]})}return r})();var w=n(2245),X=n(5381),J=n(5971),U=n(3319),O=n(5448),y=n(2014),W=n(7851),v=n(3191);let P=(()=>{class r{searchService=(0,a.WQX)(v.g);entityBeingPlaced=(0,a.vPA)(void 0);confirmedPlacement=(0,a.vPA)(void 0);rdfBaseURL=(0,a.vPA)("");contentUUID=(0,a.vPA)("");activePdfDoc=(0,a.vPA)(null);currentPage=(0,a.vPA)(1);requestedPage=(0,a.vPA)(null);navigateToPage(p){this.currentPage.set(p),this.requestedPage.set(p)}entityTextSearchResults=(0,a.vPA)([]);entityTextSearchResultsOnCurrentPage=(0,R.EW)(()=>this.entityTextSearchResults().filter(p=>p.page===this.currentPage()));currentPlacementBbox=(0,a.vPA)(null);categoryPreviewBoxes=(0,a.vPA)([]);_lastMatchIndex=(0,a.vPA)(null);matchCycleDisplay=(0,R.EW)(()=>{const p=this._lastMatchIndex(),o=this.entityTextSearchResultsOnCurrentPage().length;return null===p||0===o?"":`${p+1}/${o}`});cycleTextMatch(){const p=this.entityTextSearchResultsOnCurrentPage();if(!p.length)return;const o=this._lastMatchIndex(),d=null===o?0:(o+1)%p.length;this._lastMatchIndex.set(d);const s=p[d].xywhStr.replace("percent:",""),[I,D,i,m]=s.split(",").map(Number),j=Math.max(0,I-.5),b=Math.max(0,D-.5),x=Math.min(100-j,i+1),N=Math.min(100-b,m+1);this.currentPlacementBbox.set({xywhStr:`percent:${j.toFixed(2)},${b.toFixed(2)},${x.toFixed(2)},${N.toFixed(2)}`,color:"rgba(255, 160, 0, 0.9)",allowRemove:!1})}setManualBbox(p){this._lastMatchIndex.set(null),this.currentPlacementBbox.set({...p,allowRemove:!1})}clearPlacement(){this.currentPlacementBbox.set(null),this._lastMatchIndex.set(null)}constructor(){(0,a.QZP)(()=>{const p=this.entityBeingPlaced(),o=this.activePdfDoc();p?.value&&o?this.searchService.searchAll(o,p.value).then(d=>{this.entityTextSearchResults.set(d)}):this.entityTextSearchResults.set([])}),(0,a.QZP)(()=>{this.currentPage(),this._lastMatchIndex.set(null),this.currentPlacementBbox.set(null)}),(0,a.QZP)(()=>{const p=this.entityBeingPlaced();this._lastMatchIndex.set(null),void 0===p&&this.currentPlacementBbox.set(null)})}static \u0275fac=function(o){return new(o||r)};static \u0275prov=a.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var S=n(9352);const B=["viewerTarget"];function L(r,$){if(1&r){const p=u.RV6();u.j41(0,"cue-flexcontainer",2)(1,"cue-typography"),u.EFF(2),u.nI1(3,"transloco"),u.k0s(),u.j41(4,"cue-button",3),u.bIt("click",function(){a.eBV(p);const d=u.XpG();return a.Njj(d.downloadFile())}),u.j41(5,"cue-button-padder"),u.nrm(6,"cue-button-icon",4),u.k0s(),u.j41(7,"cue-button-label"),u.EFF(8),u.nI1(9,"transloco"),u.k0s()()()}2&r&&(u.R7$(2),u.JRh(u.bMT(3,2,"components.documentViewer.infoNoViewer")),u.R7$(6),u.JRh(u.bMT(9,4,"common.buttons.download")))}let G=(()=>{class r{_eps=(0,a.WQX)(P);_destroyed=!1;url=t.hFB.required();suffix=(0,t.hFB)();settings=(0,t.hFB)(new h.DocumentViewerSettings);viewerTypeOverride=(0,t.hFB)(void 0);interactions=(0,t.CGW)();viewerType=(0,R.EW)(()=>{const p=this.viewerTypeOverride();if(p)return p;const o=this.url(),d=void 0!==this.suffix()?this.suffix()?.trim():`.${o.split(".").pop()?.trim()}`,s=d?T.get(d):void 0;return console.log("[DocumentViewer] viewerType resolved",{url:o?.substring(0,80),suffix:d,viewerType:s}),void 0!==d?s:void 0});currentComponent=(0,a.vPA)(null);noViewer=(0,R.EW)(()=>null===this.currentComponent());isLoading=(0,a.vPA)(!1);viewerTarget;currentRef;_interactionsState=(0,a.vPA)(new h.DocumentViewerInteractions);constructor(){(0,a.QZP)(()=>{const p=this.viewerType(),o=this.url();console.log("[DocumentViewer] url/viewerType effect \u2014",{viewerType:p,url:o?.substring(0,80),destroyed:this._destroyed}),p?("pdf"!==p&&this._eps.activePdfDoc.set(null),this.isLoading.set(!0),this.loadViewerComponent(p,o,this.settings())):(this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0,console.info("No viewer available for this file type"),this.currentComponent.set(null),this.isLoading.set(!1),this._eps.activePdfDoc.set(null))}),(0,a.QZP)(()=>{this.interactions.emit(this._interactionsState())}),(0,a.QZP)(()=>{const p=this.settings().pdf,o=this.currentRef;o&&o.setInput("settings",p)})}ngOnDestroy(){this._destroyed=!0,this.viewerTarget.clear(),this.currentRef?.destroy(),this.currentRef=void 0}loadViewerComponent(p,o,d){var s=this;return(0,f.A)(function*(){console.log("[DocumentViewer] loadViewerComponent",{viewerType:p,url:o?.substring(0,100)});try{const I=g[p],D=yield I();if(s._destroyed)return;if(s.currentComponent.set(D),s.isLoading.set(!1),s.viewerTarget.clear(),s.currentRef?.destroy(),s.currentRef=s.viewerTarget.createComponent(D),"pdf"===p)s.currentRef.setInput("src",o),void 0!==d?.pdf&&s.currentRef.setInput("settings",d.pdf),s.currentRef.instance.pdfLoaded&&s.currentRef.instance.pdfLoaded.subscribe(i=>{s._eps.currentPage.set(1),s._eps.activePdfDoc.set(i)}),s.currentRef.instance.settingsChange&&s.currentRef.instance.settingsChange.subscribe(i=>{const m=parseInt(i?.page,10);!isNaN(m)&&m>0&&s._eps.currentPage.set(m)}),s.currentRef.instance.artefactDrawn&&s.currentRef.instance.artefactDrawn.subscribe(i=>{"xywh"===i.type&&s._eps.setManualBbox(i.def)}),s.currentRef.instance.artefactEdited&&s.currentRef.instance.artefactEdited.subscribe(i=>{"bbox"===i.type&&s._eps.setManualBbox(i.after)});else if("bim"===p){const i=new A.di("model","Model",o);i.visible=!0,s.currentRef.setInput("data",{models:[i]}),void 0!==d?.bim&&s.currentRef.setInput("settings",d.bim),s.currentRef.instance.selectedElements&&s.currentRef.instance.selectedElements.subscribe(m=>{s._interactionsState.update(l=>(l.bim.selectedElements=m,Object.assign({},l)))}),s.currentRef.instance.clickedElement&&s.currentRef.instance.clickedElement.subscribe(m=>{s._interactionsState.update(l=>(l.bim.clickedElement=m,Object.assign({},l)))})}else if("cad"===p)s.currentRef.setInput("fileURL",o),void 0!==d?.cad&&s.currentRef.setInput("settings",d.cad);else if("image"===p)s.currentRef.setInput("src",o);else if("markdown"===p)s.currentRef.setInput("fileURL",o);else if("text"===p)s.currentRef.setInput("fileURL",o);else if("spreadsheet"===p){const i=s.suffix()?.split(".").pop()||o.split(".").pop()||"csv";s.currentRef.setInput("data",{url:o,format:i})}else if("code"===p){const l={".json":"json",".jsonld":"jsonld",".xml":"xml",".html":"xml",".htm":"xml",".css":"text",".js":"text",".sh":"text"}[s.suffix()??`.${o.split(".").pop()??""}`]??"text";s.currentRef.setInput("fileURL",o),s.currentRef.setInput("codeType",l)}else"email"===p&&s.currentRef.setInput("fileURL",o)}catch(I){console.error("Failed to load viewer component:",I),s.currentComponent.set(null)}})()}downloadFile(){var p=this;return(0,f.A)(function*(){const d=yield(yield fetch(p.url())).blob();(0,E.KE)(d,`document${p.suffix()??""}`)})()}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=u.VBU({type:r,selectors:[["cue-doc-viewer"]],viewQuery:function(o,d){if(1&o&&u.GBs(B,7,u.c1b),2&o){let s;u.mGM(s=u.lsd())&&(d.viewerTarget=s.first)}},inputs:{url:[1,"url"],suffix:[1,"suffix"],settings:[1,"settings"],viewerTypeOverride:[1,"viewerTypeOverride"]},outputs:{interactions:"interactions"},decls:4,vars:2,consts:[["viewerTarget",""],[2,"height","100%","width","100%",3,"cueLogoLoader"],["direction","column","align","center","justify","center",2,"height","100%","width","100%"],[3,"click"],["icon","download"]],template:function(o,d){1&o&&(u.j41(0,"cue-container",1),u.eu8(1,null,0),u.nVh(3,L,10,6,"cue-flexcontainer",2),u.k0s()),2&o&&(u.Y8G("cueLogoLoader",d.isLoading()),u.R7$(3),u.vxM(!d.isLoading()&&d.noViewer()?3:-1))},dependencies:[e.MD,H,w.Typography,X.n,J.$,U.a,O.L,y.z,W.k,S.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return r})()},3191(V,M,n){n.d(M,{g:()=>a});var f=n(467),e=n(5802);let a=(()=>{class t{searchPage(u,h,c){return(0,f.A)(function*(){if(!c||!c.trim())return[];const g=c.toLowerCase(),T=yield u.getPage(h),A=T.getViewport({scale:1}),C=(yield T.getTextContent()).items,H=[];let w="";const X=[],J=[];for(let y=0;y<C.length;y++){const v=C[y].str??"";for(let P=0;P<v.length;P++)w+=v[P],X.push(y),J.push(P)}const U=w.toLowerCase();let O=0;for(;O<U.length;){const y=U.indexOf(g,O);if(-1===y)break;const W=y+g.length-1;O=y+1;const v=new Set;for(let D=y;D<=W;D++)v.add(X[D]);let P=1/0,S=1/0,B=-1/0,L=-1/0;for(const D of v){const i=C[D],[m,l,j,b,x,N]=i.transform,K=i.width??0,z=i.height??Math.abs(m||b||12),Z=Math.sqrt(m*m+l*l)||1,Q=m/Z,Y=l/Z,k=j/Z,q=b/Z,fe=[[x,N],[x+Q*K,N+Y*K],[x+Q*K+k*z,N+Y*K+q*z],[x+k*z,N+q*z]];for(const[ne,pe]of fe){const[F,_]=A.convertToViewportPoint(ne,pe);P=Math.min(P,F),S=Math.min(S,_),B=Math.max(B,F),L=Math.max(L,_)}}const G=A.width,r=A.height,$=.005*G,p=.005*r,d=(S-p)/r*100,s=(B-P+2*$)/G*100,I=(L-S+2*p)/r*100;s>0&&I>0&&H.push({page:h,xywhStr:`percent:${((P-$)/G*100).toFixed(2)},${d.toFixed(2)},${s.toFixed(2)},${I.toFixed(2)}`})}return H})()}searchAll(u,h){var c=this;return(0,f.A)(function*(){if(!h||!h.trim())return[];const g=u.numPages,T=[];for(let A=1;A<=g;A++){const E=yield c.searchPage(u,A,h);T.push(...E)}return T})()}static \u0275fac=function(h){return new(h||t)};static \u0275prov=e.jDH({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})()},6114(V,M,n){n.d(M,{N:()=>e,V:()=>a});var f=n(4820),e=function(t){return t.AAC=".aac",t.ABW=".abw",t.ARC=".arc",t.AVIF=".avif",t.AVI=".avi",t.APNG=".apng",t.BAK=".bak",t.BIN=".bin",t.BMC=".bmc",t.BMP=".bmp",t.BZ=".bz",t.BZ2=".bz2",t.C3D=".c3d",t.CPG=".cpg",t.CSS=".css",t.CSV=".csv",t.DAT=".dat",t.DOC=".doc",t.DOCX=".docx",t.E57=".e57",t.EPUB=".epub",t.EXE=".exe",t.FFS=".ffs",t.FME=".fme",t.FMW=".fmw",t.FRAG=".fragments",t.GH=".gh",t.GZ=".gz",t.GIF=".gif",t.HTML=".html",t.HTM=".htm",t.ICO=".ico",t.ICS=".ics",t.JAR=".jar",t.JPG=".jpg",t.JPEG=".jpeg",t.JSON=".json",t.JSONLD=".jsonld",t.JS=".js",t.MOV=".mov",t.MP3=".mp3",t.MP4=".mp4",t.MPEG=".mpeg",t.MSI=".msi",t.MTL=".mtl",t.ODP=".odp",t.ODS=".ods",t.ODT=".odt",t.OGA=".oga",t.OGG=".ogg",t.OGV=".ogv",t.OGX=".ogx",t.OTF=".otf",t.PNG=".png",t.PDF=".pdf",t.PHP=".php",t.PKG=".pkg",t.PPT=".ppt",t.PPTX=".pptx",t.PS=".ps",t.RAR=".rar",t.RCP=".rcp",t.RTF=".rtf",t.SH=".sh",t.SLK=".slk",t.SVG=".svg",t.TAR=".tar",t.TIFF=".tiff",t.TIF=".tif",t.TTF=".ttf",t.TXT=".txt",t.VGL=".vgl",t.VWX=".vwx",t.WAV=".wav",t.WEBM=".webm",t.WEBP=".webp",t.WMV=".wmv",t.WOFF=".woff",t.WOFF2=".woff2",t.XLS=".xls",t.XLSX=".xlsx",t.XHTML=".xhtml",t.XML=".xml",t.XYZ=".xyz",t.ZIP=".zip",t.SEVEN_Z=".7z",t.DBF=".dbf",t.EML=".eml",t.EMLX=".emlx",t.MBX=".mbx",t.MD=".md",t.MSG=".msg",t.RST=".rst",t.HEIC=".heic",t.MPP=".mpp",t.TSV=".tsv",t.B3DM=".b3dm",t.I3DM=".i3dm",t.PNTS=".pnts",t.CMPT=".cmpt",t.GLTF=".gltf",t.GLB=".glb",t.IFC=".ifc",t.IFCZIP=".ifczip",t.IFXML=".ifcxml",t.THREEDM=".3dm",t.THREEDS=".3ds",t.GHP=".ghp",t.RVT=".rvt",t.RFA=".rfa",t.RFT=".rft",t.RTE=".rte",t.PLA=".pla",t.PLN=".pln",t.GSM=".gsm",t.SMC=".smc",t.BCF=".bcf",t.DWG=".dwg",t.DWL=".dwl",t.DXF=".dxf",t.DGN=".dgn",t.NWD=".nwd",t.OBJ=".obj",t.C4D=".c4d",t.TEKLASTRUCTURES=".teklastructures",t.PTS=".pts",t.LAS=".las",t.LAZ=".laz",t.USDZ=".usdz",t.USDA=".usda",t.USDC=".usdc",t.USD=".usd",t.PSD=".psd",t.PSP=".psp",t.AI=".ai",t.SBN=".sbn",t.SBX=".sbx",t.SHX=".shx",t.SKP=".skp",t.STL=".stl",t.FBX=".fbx",t.KML=".kml",t.SHP=".shp",t}(e||{});const a={[e.AAC]:{type:f.p.AUDIO,open:!0,suffix:".aac"},[e.ABW]:{type:f.p.TEXT,open:!0,suffix:".abw"},[e.ARC]:{type:f.p.ARCHIVE,open:!1,suffix:".arc"},[e.AVIF]:{type:f.p.IMAGE,open:!0,suffix:".avif"},[e.AVI]:{type:f.p.VIDEO,open:!0,suffix:".avi"},[e.APNG]:{type:f.p.IMAGE,open:!0,suffix:".apng"},[e.BAK]:{type:f.p.BACKUP,open:!1,suffix:".bak"},[e.BIN]:{type:f.p.BINARY,open:!1,suffix:".bin"},[e.BMC]:{type:f.p.BIM,open:!1,suffix:".bmc"},[e.BMP]:{type:f.p.IMAGE,open:!0,suffix:".bmp"},[e.BZ]:{type:f.p.ARCHIVE,open:!0,suffix:".bz"},[e.BZ2]:{type:f.p.ARCHIVE,open:!0,suffix:".bz2"},[e.C3D]:{type:f.p.THREE_D,open:!0,suffix:".c3d"},[e.CPG]:{type:f.p.GEOSPATIAL,open:!0,suffix:".cpg"},[e.CSS]:{type:f.p.MARKUP,open:!0,suffix:".css"},[e.CSV]:{type:f.p.DATA,open:!0,suffix:".csv"},[e.DAT]:{type:f.p.DATA,open:!1,suffix:".dat"},[e.DBF]:{type:f.p.DATA,open:!0,suffix:".dbf"},[e.DOC]:{type:f.p.TEXT,open:!1,suffix:".doc"},[e.DOCX]:{type:f.p.TEXT,open:!0,suffix:".docx"},[e.E57]:{type:f.p.THREE_D,open:!0,suffix:".e57"},[e.EPUB]:{type:f.p.TEXT,open:!0,suffix:".epub"},[e.EXE]:{type:f.p.INSTALLER,open:!1,suffix:".exe"},[e.FFS]:{type:f.p.AUTOMATION,open:!1,suffix:".ffs"},[e.FME]:{type:f.p.AUTOMATION,open:!1,suffix:".fme"},[e.FMW]:{type:f.p.AUTOMATION,open:!1,suffix:".fmw"},[e.FRAG]:{type:f.p.BIM,open:!0,suffix:".fragments"},[e.GH]:{type:f.p.THREE_D,open:!1,suffix:".gh"},[e.GZ]:{type:f.p.ARCHIVE,open:!0,suffix:".gz"},[e.GIF]:{type:f.p.IMAGE,open:!0,suffix:".gif"},[e.HTML]:{type:f.p.MARKUP,open:!0,suffix:".html"},[e.HTM]:{type:f.p.MARKUP,open:!0,suffix:".htm"},[e.ICO]:{type:f.p.IMAGE,open:!1,suffix:".ico"},[e.ICS]:{type:f.p.DATA,open:!0,suffix:".ics"},[e.JAR]:{type:f.p.ARCHIVE,open:!0,suffix:".jar"},[e.JPG]:{type:f.p.IMAGE,open:!0,suffix:".jpg"},[e.JPEG]:{type:f.p.IMAGE,open:!0,suffix:".jpeg"},[e.JSON]:{type:f.p.DATA,open:!0,suffix:".json"},[e.JSONLD]:{type:f.p.DATA,open:!0,suffix:".jsonld"},[e.JS]:{type:f.p.SCRIPT,open:!0,suffix:".js"},[e.MSI]:{type:f.p.INSTALLER,open:!1,suffix:".msi"},[e.MOV]:{type:f.p.VIDEO,open:!0,suffix:".mov"},[e.MP3]:{type:f.p.AUDIO,open:!0,suffix:".mp3"},[e.MP4]:{type:f.p.VIDEO,open:!0,suffix:".mp4"},[e.MPEG]:{type:f.p.VIDEO,open:!0,suffix:".mpeg"},[e.MTL]:{type:f.p.THREE_D,open:!0,suffix:".mtl"},[e.ODP]:{type:f.p.PRESENTATION,open:!0,suffix:".odp"},[e.ODS]:{type:f.p.SPREADSHEET,open:!0,suffix:".ods"},[e.ODT]:{type:f.p.TEXT,open:!0,suffix:".odt"},[e.OGA]:{type:f.p.AUDIO,open:!0,suffix:".oga"},[e.OGG]:{type:f.p.AUDIO,open:!0,suffix:".ogg"},[e.OGV]:{type:f.p.VIDEO,open:!0,suffix:".ogv"},[e.OGX]:{type:f.p.VIDEO,open:!0,suffix:".ogx"},[e.OTF]:{type:f.p.FONT,open:!0,suffix:".otf"},[e.PNG]:{type:f.p.IMAGE,open:!0,suffix:".png"},[e.PDF]:{type:f.p.TEXT,open:!0,suffix:".pdf"},[e.PHP]:{type:f.p.SCRIPT,open:!0,suffix:".php"},[e.PKG]:{type:f.p.INSTALLER,open:!1,suffix:".pkg"},[e.PPT]:{type:f.p.PRESENTATION,open:!1,suffix:".ppt"},[e.PPTX]:{type:f.p.PRESENTATION,open:!0,suffix:".pptx"},[e.PS]:{type:f.p.IMAGE,open:!1,suffix:".ps"},[e.RAR]:{type:f.p.ARCHIVE,open:!1,suffix:".rar"},[e.RCP]:{type:f.p.THREE_D,open:!1,suffix:".rcp"},[e.RTF]:{type:f.p.TEXT,open:!0,suffix:".rtf"},[e.SBN]:{type:f.p.GEOSPATIAL,open:!1,suffix:".sbn"},[e.SBX]:{type:f.p.GEOSPATIAL,open:!1,suffix:".sbx"},[e.SHX]:{type:f.p.GEOSPATIAL,open:!0,suffix:".shx"},[e.SH]:{type:f.p.SCRIPT,open:!0,suffix:".sh"},[e.SLK]:{type:f.p.DATA,open:!0,suffix:".slk"},[e.SVG]:{type:f.p.IMAGE,open:!0,suffix:".svg"},[e.TAR]:{type:f.p.ARCHIVE,open:!0,suffix:".tar"},[e.TIFF]:{type:f.p.IMAGE,open:!0,suffix:".tiff"},[e.TIF]:{type:f.p.IMAGE,open:!0,suffix:".tif"},[e.TTF]:{type:f.p.FONT,open:!0,suffix:".ttf"},[e.TXT]:{type:f.p.TEXT,open:!0,suffix:".txt"},[e.VGL]:{type:f.p.THREE_D,open:!1,suffix:".vgl"},[e.VWX]:{type:f.p.CAD,open:!1,suffix:".vwx"},[e.WAV]:{type:f.p.AUDIO,open:!0,suffix:".wav"},[e.WEBM]:{type:f.p.VIDEO,open:!0,suffix:".webm"},[e.WEBP]:{type:f.p.IMAGE,open:!0,suffix:".webp"},[e.WMV]:{type:f.p.VIDEO,open:!0,suffix:".wmv"},[e.WOFF]:{type:f.p.FONT,open:!0,suffix:".woff"},[e.WOFF2]:{type:f.p.FONT,open:!0,suffix:".woff2"},[e.XLS]:{type:f.p.SPREADSHEET,open:!1,suffix:".xls"},[e.XLSX]:{type:f.p.SPREADSHEET,open:!0,suffix:".xlsx"},[e.XHTML]:{type:f.p.MARKUP,open:!0,suffix:".xhtml"},[e.XML]:{type:f.p.DATA,open:!0,suffix:".xml"},[e.XYZ]:{type:f.p.THREE_D,open:!0,suffix:".xyz"},[e.ZIP]:{type:f.p.ARCHIVE,open:!0,suffix:".zip"},[e.SEVEN_Z]:{type:f.p.ARCHIVE,open:!0,suffix:".7z"},[e.EML]:{type:f.p.EMAIL,open:!0,suffix:".eml"},[e.EMLX]:{type:f.p.EMAIL,open:!0,suffix:".emlx"},[e.MBX]:{type:f.p.EMAIL,open:!0,suffix:".mbx"},[e.MD]:{type:f.p.TEXT,open:!0,suffix:".md"},[e.MSG]:{type:f.p.EMAIL,open:!1,suffix:".msg"},[e.RST]:{type:f.p.TEXT,open:!0,suffix:".rst"},[e.HEIC]:{type:f.p.IMAGE,open:!1,suffix:".heic"},[e.MPP]:{type:f.p.PLANNING,open:!1,suffix:".mpp"},[e.TSV]:{type:f.p.DATA,open:!0,suffix:".tsv"},[e.B3DM]:{type:f.p.THREE_D,open:!0,suffix:".b3dm"},[e.I3DM]:{type:f.p.THREE_D,open:!0,suffix:".i3dm"},[e.PNTS]:{type:f.p.THREE_D,open:!1,suffix:".pnts"},[e.CMPT]:{type:f.p.THREE_D,open:!1,suffix:".cmpt"},[e.GLTF]:{type:f.p.THREE_D,open:!0,suffix:".gltf"},[e.GLB]:{type:f.p.THREE_D,open:!0,suffix:".glb"},[e.IFC]:{type:f.p.BIM,open:!0,suffix:".ifc"},[e.IFCZIP]:{type:f.p.BIM,open:!0,suffix:".ifczip"},[e.IFXML]:{type:f.p.BIM,open:!0,suffix:".ifcxml"},[e.THREEDM]:{type:f.p.CAD,open:!1,suffix:".3dm"},[e.THREEDS]:{type:f.p.THREE_D,open:!1,suffix:".3ds"},[e.GHP]:{type:f.p.CAD,open:!1,suffix:".ghp"},[e.RVT]:{type:f.p.BIM,open:!1,suffix:".rvt"},[e.RFA]:{type:f.p.BIM,open:!1,suffix:".rfa"},[e.RFT]:{type:f.p.BIM,open:!1,suffix:".rft"},[e.RTE]:{type:f.p.BIM,open:!1,suffix:".rte"},[e.PLA]:{type:f.p.BIM,open:!1,suffix:".pla"},[e.PLN]:{type:f.p.BIM,open:!1,suffix:".pln"},[e.GSM]:{type:f.p.BIM,open:!1,suffix:".gsm"},[e.SMC]:{type:f.p.BIM,open:!1,suffix:".smc"},[e.STL]:{type:f.p.THREE_D,open:!0,suffix:".stl"},[e.BCF]:{type:f.p.BIM,open:!0,suffix:".bcf"},[e.DWG]:{type:f.p.CAD,open:!1,suffix:".dwg"},[e.DWL]:{type:f.p.CAD,open:!1,suffix:".dwl"},[e.DXF]:{type:f.p.CAD,open:!0,suffix:".dxf"},[e.DGN]:{type:f.p.CAD,open:!1,suffix:".dgn"},[e.NWD]:{type:f.p.BIM,open:!1,suffix:".nwd"},[e.OBJ]:{type:f.p.THREE_D,open:!0,suffix:".obj"},[e.C4D]:{type:f.p.THREE_D,open:!1,suffix:".c4d"},[e.TEKLASTRUCTURES]:{type:f.p.BIM,open:!1,suffix:".teklastructures"},[e.PTS]:{type:f.p.THREE_D,open:!1,suffix:".pts"},[e.LAS]:{type:f.p.THREE_D,open:!0,suffix:".las"},[e.LAZ]:{type:f.p.THREE_D,open:!0,suffix:".laz"},[e.USDZ]:{type:f.p.THREE_D,open:!0,suffix:".usdz"},[e.USDA]:{type:f.p.THREE_D,open:!0,suffix:".usda"},[e.USDC]:{type:f.p.THREE_D,open:!0,suffix:".usdc"},[e.USD]:{type:f.p.THREE_D,open:!0,suffix:".usd"},[e.PSD]:{type:f.p.IMAGE,open:!1,suffix:".psd"},[e.PSP]:{type:f.p.IMAGE,open:!1,suffix:".psp"},[e.AI]:{type:f.p.IMAGE,open:!1,suffix:".ai"},[e.SKP]:{type:f.p.THREE_D,open:!1,suffix:".skp"},[e.FBX]:{type:f.p.THREE_D,open:!0,suffix:".fbx"},[e.KML]:{type:f.p.GEOSPATIAL,open:!0,suffix:".kml"},[e.SHP]:{type:f.p.GEOSPATIAL,open:!0,suffix:".shp"}}},4820(V,M,n){n.d(M,{p:()=>f});var f=function(e){return e.AUTOMATION="automation",e.ARCHIVE="archive",e.AUDIO="audio",e.BACKUP="backup",e.BINARY="binary",e.BIM="bim",e.CAD="cad",e.DATA="data",e.EMAIL="email",e.FONT="font",e.GEOSPATIAL="geospatial",e.IMAGE="image",e.INSTALLER="installer",e.MARKUP="markup",e.MULTIMEDIA="multimedia",e.PLANNING="planning",e.PRESENTATION="presentation",e.SCRIPT="script",e.SPREADSHEET="spreadsheet",e.TEXT="text",e.THREE_D="3d",e.UNKNOWN="unknown",e.VIDEO="video",e}(f||{})}}]);
package/376.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[376],{6376(k,g,b){function d(s,e){let t=function m(s,e){let r=0;return s.color?r=s.color:e.tables&&e.tables.layer&&e.tables.layer.layers[s.layer]&&(r=e.tables.layer.layers[s.layer].color),(null==r||16777215===r)&&(r=0),r}(s,e).toString(16);for(;t.length<6;)t="0"+t;return"#"+t}function A(s){if(s=function T(s){let e=s.replace(/\\P/g,"\n");return e=e.replace(/\\X/g,"\n"),e}(s),!s.includes(";"))return{text:w(s)};let e=s;const r={};["f","A","Q","H","W","T"].forEach(i=>{r[i]=function $(s,e,r){const t=new RegExp(`(?<=${e})(.*?)(?=${r})`,"s"),i=s.match(t);return i?i[1].trim():void 0}(s,`\\\\${i}`,";"),void 0!==r[i]&&(e=e.replace(`\\${i}${r[i]};`,""))});const t=s.lastIndexOf(";");return s=w(s.substring(t+1)),e=e.replace(s,""),{text:s,formatting:r}}function w(s){return(s=(s=(s=(s=s.replace(/\\{/g,"\0LBRACE")).replace(/\\}/g,"\0RBRACE")).replace(/[{}]/g,"")).replace(/__LBRACE__/g,"{")).replace(/__RBRACE__/g,"}")}b.r(g),b.d(g,{DrawEntitySVG:()=>x});const f="http://www.w3.org/2000/svg";class x{_svg;_currentGroup;entityMap=new Map;_idCounter=0;constructor(){this._svg=document.createElementNS(f,"svg"),this._svg.setAttribute("xmlns",f)}fromEntity(e,r,t=!0){t||this._resetSVG(),Array.isArray(e)?e.forEach(i=>this.fromEntity(i,r,!0)):"ARC"===e.type?this._drawArc(e,r):"CIRCLE"===e.type?this._drawCircle(e,r):"INSERT"===e.type?this._drawBlock(e,r):"LINE"===e.type?this._drawLine(e,r):"LWPOLYLINE"===e.type||"POLYLINE"===e.type?this._drawPath(e,r):"POINT"===e.type?this._drawPoint(e,r):"SPLINE"===e.type?this._drawSpline(e,r):"SOLID"===e.type?this._drawSolid(e,r):"ELLIPSE"===e.type?this._drawEllipse(e,r):"TEXT"===e.type?this._drawText(e,r):"MTEXT"===e.type?this._drawMtext(e,r):"DIMENSION"===e.type&&!(7&e.dimensionType)&&this._drawDimension(e,r)}asString(){return this._svg.outerHTML}asElement(){return this._svg}_resetSVG(){this._svg=document.createElementNS(f,"svg"),this._svg.setAttribute("xmlns",f),this.entityMap.clear(),this._idCounter=0}_drawBlock(e,r){const t=r.blocks[e.name];if(!t||!t.entities)return;const i=this._appendElementOfType("g",e);this._currentGroup=i;const n=this._buildGroupTransformation(e);""!==n&&i.setAttribute("transform",n),t.entities.forEach(o=>{this.fromEntity(o,r)}),this._currentGroup=void 0}_drawLine(e,r){const t=this._appendElementOfType("line",e);t.setAttribute("x1",e.vertices[0].x.toString()),t.setAttribute("y1",e.vertices[0].y.toString()),t.setAttribute("x2",e.vertices[1].x.toString()),t.setAttribute("y2",e.vertices[1].y.toString()),this._setStrokeFill(e,r,t)}_drawPath(e,r){const t=e.vertices.some(c=>void 0!==c.bulge&&Math.abs(c.bulge)>1e-4);if(2===e.vertices.length&&!t)return this._drawLine(e,r);const i=this._appendElementOfType("path",e);let n=!0===e.shape||!0===e.closed,o=e.vertices;if(!n&&o.length>3){const c=o[0],a=o[o.length-1];Math.abs(c.x-a.x)<.001&&Math.abs(c.y-a.y)<.001&&(n=!0,o=o.slice(0,-1))}const u=this._verticeArrayToPath(o,n,e.extrusion);i.setAttribute("d",u),this._setStrokeFill(e,r,i)}_drawArc(e,r){const t=this._appendElementOfType("path",e),i=this._arcPath(e.center,e.radius,e.startAngle,e.endAngle,e.extrusion);t.setAttribute("d",i),this._setStrokeFill(e,r,t)}_drawCircle(e,r){const t=this._appendElementOfType("circle",e);t.setAttribute("cx",e.center.x.toString()),t.setAttribute("cy",e.center.y.toString()),t.setAttribute("r",e.radius.toString()),this._setStrokeFill(e,r,t)}_drawText(e,r){const t=this._appendElementOfType("text",e);t.setAttribute("x",e.startPoint.x.toString()),t.setAttribute("y",e.startPoint.y.toString());const i=A(e.text);t.innerHTML=i.text,this._setTextAppearance(e,r,t)}_drawPoint(e,r){const t=this._appendElementOfType("circle",e);t.setAttribute("cx",e.position.x.toString()),t.setAttribute("cy",e.position.y.toString()),t.setAttribute("r","0.0001"),t.setAttribute("stroke",d(e,r)),t.setAttribute("fill","none"),t.setAttribute("vector-effect","non-scaling-stroke"),t.setAttribute("stroke-width","2"),t.classList.add("dxf-path")}_drawDimension(e,r){const t=r.blocks[e.block];if(!t||!t.entities)return;const i=this._appendElementOfType("g",e);this._currentGroup=i,t.entities.forEach(n=>{this.fromEntity(n,r)}),this._currentGroup=void 0}_drawEllipse(e,r){}_drawSpline(e,r){}_drawSolid(e,r){}_drawMtext(e,r){const t=this._appendElementOfType("text",e);t.setAttribute("x",e.position.x.toString()),t.setAttribute("y",e.position.y.toString());const i=A(e.text);t.innerHTML=i.text,this._setMTextAppearance(e,r,t)}_setStrokeFill(e,r,t){t.setAttribute("stroke",d(e,r)),t.setAttribute("fill","none"),t.setAttribute("stroke-width",((void 0!==e.lineweight&&e.lineweight>0?e.lineweight:25)/1e5).toString()),t.setAttribute("vector-effect","non-scaling-stroke"),t.classList.add("dxf-path")}_setTextAppearance(e,r,t){t.setAttribute("fill",d(e,r)),t.setAttribute("font-size",(e.textHeight/1e3).toString()),e.rotation&&t.setAttribute("transform",`rotate(${e.rotation})`)}_setMTextAppearance(e,r,t){t.setAttribute("fill",d(e,r)),t.setAttribute("font-size",(e.height/1e3).toString()),e.rotation&&t.setAttribute("transform",`rotate(${e.rotation})`)}_buildGroupTransformation(e){let r="";return void 0!==e.position&&(r+=` translate(${e.position.x} ${e.position.y})`),void 0!==e.xScale&&void 0!==e.yScale&&(r+=` scale(${e.xScale} ${e.yScale})`),void 0!==e.rotation&&(r+=` rotate(${e.rotation})`),r.trim()}_appendElementOfType(e,r){const t=document.createElementNS(f,e);if(r){const i="dxf-entity-"+this._idCounter++;t.setAttribute("data-dxf-id",i),this.entityMap.set(i,r)}return void 0!==this._currentGroup?this._currentGroup.appendChild(t):this._svg.appendChild(t),t}_arcPath(e,r,t,i,n){const o=e.x+r*Math.cos(t),u=e.y+r*Math.sin(t),c=e.x+r*Math.cos(i),a=e.y+r*Math.sin(i),h=n&&n.z<0;let l=i-t;for(;l<0;)l+=2*Math.PI;for(;l>2*Math.PI;)l-=2*Math.PI;return l<1e-4?`M ${o} ${u}`:`M ${o} ${u} A ${r} ${r} 0 ${l>Math.PI?1:0} ${h?0:1} ${c} ${a}`}_verticeArrayToPath(e,r=!1,t){let i="";const n=r?e.length:e.length-1;for(let o=0;o<n;o++){const{x:u,y:c,bulge:a}=e[o],{x:h,y:l}=e[(o+1)%e.length];if(void 0!==a&&Math.abs(a)>1e-4){const _=Math.sqrt((u-h)**2+(c-l)**2),p=Math.abs(a),S=_/2*(1+p*p)/(2*p),E=t&&t.z<0;0===o&&(i+=`M ${u} ${c} `),i+=`A ${S} ${S} 0 ${p>1?1:0} ${a>0?E?0:1:E?1:0} ${h} ${l} `}else 0===o&&(i+=`M ${u} ${c} `),i+=`L ${h} ${l} `}return r&&(i+=" Z"),i.trim()}}}}]);
package/393.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[393],{3393(G,D,p){p.d(D,{IDBuilder:()=>re});var s=p(5802),d=p(5332);const x=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,c=function V(i){if(!function _(i){return"string"==typeof i&&x.test(i)}(i))throw TypeError("Invalid UUID");var r,e=new Uint8Array(16);return e[0]=(r=parseInt(i.slice(0,8),16))>>>24,e[1]=r>>>16&255,e[2]=r>>>8&255,e[3]=255&r,e[4]=(r=parseInt(i.slice(9,13),16))>>>8,e[5]=255&r,e[6]=(r=parseInt(i.slice(14,18),16))>>>8,e[7]=255&r,e[8]=(r=parseInt(i.slice(19,23),16))>>>8,e[9]=255&r,e[10]=(r=parseInt(i.slice(24,36),16))/1099511627776&255,e[11]=r/4294967296&255,e[12]=r>>>24&255,e[13]=r>>>16&255,e[14]=r>>>8&255,e[15]=255&r,e};function j(i,r,e,t){switch(i){case 0:return r&e^~r&t;case 1:case 3:return r^e^t;case 2:return r&e^r&t^e&t}}function T(i,r){return i<<r|i>>>32-r}const X=function H(i,r,e){function t(n,o,u,g){var m;if("string"==typeof n&&(n=function h(i){i=unescape(encodeURIComponent(i));for(var r=[],e=0;e<i.length;++e)r.push(i.charCodeAt(e));return r}(n)),"string"==typeof o&&(o=c(o)),16!==(null===(m=o)||void 0===m?void 0:m.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var f=new Uint8Array(16+n.length);if(f.set(o),f.set(n,o.length),(f=e(f))[6]=15&f[6]|r,f[8]=63&f[8]|128,u){g=g||0;for(var v=0;v<16;++v)u[g+v]=f[v];return u}return(0,d.k)(f)}try{t.name=i}catch{}return t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t}("v5",80,function z(i){var r=[1518500249,1859775393,2400959708,3395469782],e=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof i){var t=unescape(encodeURIComponent(i));i=[];for(var n=0;n<t.length;++n)i.push(t.charCodeAt(n))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);for(var u=Math.ceil((i.length/4+2)/16),g=new Array(u),m=0;m<u;++m){for(var f=new Uint32Array(16),v=0;v<16;++v)f[v]=i[64*m+4*v]<<24|i[64*m+4*v+1]<<16|i[64*m+4*v+2]<<8|i[64*m+4*v+3];g[m]=f}g[u-1][14]=8*(i.length-1)/Math.pow(2,32),g[u-1][14]=Math.floor(g[u-1][14]),g[u-1][15]=8*(i.length-1)&4294967295;for(var I=0;I<u;++I){for(var b=new Uint32Array(80),C=0;C<16;++C)b[C]=g[I][C];for(var M=16;M<80;++M)b[M]=T(b[M-3]^b[M-8]^b[M-14]^b[M-16],1);for(var w=e[0],y=e[1],E=e[2],P=e[3],N=e[4],B=0;B<80;++B){var U=Math.floor(B/20),se=T(w,5)+j(U,y,E,P)+N+r[U]+b[B]>>>0;N=P,P=E,E=T(y,30)>>>0,y=w,w=se}e[0]=e[0]+w>>>0,e[1]=e[1]+y>>>0,e[2]=e[2]+E>>>0,e[3]=e[3]+P>>>0,e[4]=e[4]+N>>>0}return[e[0]>>24&255,e[0]>>16&255,e[0]>>8&255,255&e[0],e[1]>>24&255,e[1]>>16&255,e[1]>>8&255,255&e[1],e[2]>>24&255,e[2]>>16&255,e[2]>>8&255,255&e[2],e[3]>>24&255,e[3]>>16&255,e[3]>>8&255,255&e[3],e[4]>>24&255,e[4]>>16&255,e[4]>>8&255,255&e[4]]}),F={\u00e4:"ae",a\u0308:"ae",\u00c4:"AE",\u00f6:"oe",\u00d6:"OE",\u00fc:"ue",u\u0308:"ue",\u00dc:"UE",U\u0308:"UE",\u00df:"ss",\u00e6:"ae",\u00c6:"AE",\u00f8:"oe",\u00d8:"OE",\u00e5:"aa",\u00c5:"AA",\u00e1:"a",\u00c1:"A",\u00f0:"d",\u00d0:"D",\u00e9:"e",\u00c9:"E",\u00ed:"i",\u00cd:"I",\u00f3:"o",\u00d3:"O",\u00fa:"u",\u00da:"U",\u00fd:"y",\u00dd:"Y",\u00fe:"th",\u00de:"Th"};var a=p(5547),l=p(7705),O=p(2271),$=p(5971),W=p(3319),K=p(7089);let Q=(()=>{class i{element;enabled=(0,l.hFB)(!1,{alias:"cueAutoMultiline"});value=(0,l.hFB)("",{alias:"autoMultilineValue"});buttonOffset=(0,l.hFB)(0,{alias:"autoMultilineButtonOffset"});shouldSwitchToMultiline=(0,l.CGW)();multilinePasted=(0,l.CGW)();measureSpan;hasSwitched=!1;constructor(e){this.element=e,(0,s.QZP)(()=>{this.value();this.enabled()&&this.measureSpan&&!this.hasSwitched&&setTimeout(()=>this.checkOverflow(),0)})}ngAfterViewInit(){this.enabled()&&(this.createMeasurementSpan(),setTimeout(()=>this.checkOverflow(),0))}onPaste(e){if(!this.enabled()||this.hasSwitched)return;const t=e.clipboardData?.getData("text");if(t&&t.includes("\n")){e.preventDefault();const n=this.element.nativeElement,o=n.selectionStart||0,u=n.value,g=u.substring(0,o)+t+u.substring(n.selectionEnd||o);this.hasSwitched=!0,this.multilinePasted.emit(g)}}createMeasurementSpan(){this.measureSpan=document.createElement("span"),this.measureSpan.style.position="absolute",this.measureSpan.style.visibility="hidden",this.measureSpan.style.whiteSpace="nowrap",this.measureSpan.style.pointerEvents="none";const e=this.element.nativeElement,t=window.getComputedStyle(e);this.measureSpan.style.font=t.font,this.measureSpan.style.padding=t.padding,e.parentElement?.appendChild(this.measureSpan)}checkOverflow(){if(!this.enabled()||!this.measureSpan||this.hasSwitched)return;const e=this.element.nativeElement;this.measureSpan.textContent=this.value(),this.measureSpan.offsetWidth>e.offsetWidth-this.buttonOffset()&&(this.hasSwitched=!0,this.shouldSwitchToMultiline.emit())}ngOnDestroy(){this.measureSpan&&this.measureSpan.remove()}static \u0275fac=function(t){return new(t||i)(a.rXU(a.aKT))};static \u0275dir=a.FsC({type:i,selectors:[["","cueAutoMultiline",""]],hostBindings:function(t,n){1&t&&a.bIt("paste",function(u){return n.onPaste(u)})},inputs:{enabled:[1,"cueAutoMultiline","enabled"],value:[1,"autoMultilineValue","value"],buttonOffset:[1,"autoMultilineButtonOffset","buttonOffset"]},outputs:{shouldSwitchToMultiline:"shouldSwitchToMultiline",multilinePasted:"multilinePasted"}})}return i})(),Z=(()=>{class i{element;enabled=(0,l.hFB)(!0,{alias:"cueShiftEnter"});shiftEnterPressed=(0,l.CGW)();constructor(e){this.element=e}onKeyDown(e){if(this.enabled()&&"Enter"===e.key&&e.shiftKey){e.preventDefault();const t=this.element.nativeElement,n=t.selectionStart||0,o=t.value,u=o.substring(0,n)+"\n"+o.substring(n);this.shiftEnterPressed.emit({newValue:u,cursorPosition:n+1})}}static \u0275fac=function(t){return new(t||i)(a.rXU(a.aKT))};static \u0275dir=a.FsC({type:i,selectors:[["","cueShiftEnter",""]],hostBindings:function(t,n){1&t&&a.bIt("keydown",function(u){return n.onKeyDown(u)})},inputs:{enabled:[1,"cueShiftEnter","enabled"]},outputs:{shiftEnterPressed:"shiftEnterPressed"}})}return i})();const J=["inputElement"],q=["textareaElement"];function ee(i,r){if(1&i){const e=a.RV6();a.j41(0,"input",4,0),a.mxI("valueChange",function(n){s.eBV(e);const o=a.XpG();return a.DH7(o.value,n)||(o.value=n),s.Njj(n)}),a.bIt("shiftEnterPressed",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.handleShiftEnter(n))})("shouldSwitchToMultiline",function(){s.eBV(e);const n=a.XpG();return s.Njj(n.switchToMultiline())})("multilinePasted",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.handleMultilinePaste(n))})("keyup",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.update(n))})("input",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.update(n))}),a.k0s()}if(2&i){const e=a.XpG();a.R50("value",e.value),a.Y8G("placeholder",e.placeholder())("cueShiftEnter",e.responsiveMode())("cueAutoMultiline",e.responsiveMode())("autoMultilineValue",e.value())("autoMultilineButtonOffset",e.showSubmitButton()?60:0)}}function te(i,r){if(1&i){const e=a.RV6();a.j41(0,"textarea",5,1),a.mxI("valueChange",function(n){s.eBV(e);const o=a.XpG();return a.DH7(o.value,n)||(o.value=n),s.Njj(n)}),a.bIt("keyup",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.update(n))}),a.k0s(),a.j41(2,"div",6),a.bIt("mousedown",function(n){s.eBV(e);const o=a.XpG();return s.Njj(o.startDrag(n))}),a.nrm(3,"div",7),a.k0s()}if(2&i){const e=a.XpG();a.R50("value",e.value),a.Y8G("placeholder",e.placeholder())}}function ne(i,r){if(1&i){const e=a.RV6();a.j41(0,"cue-button",8),a.bIt("click",function(){s.eBV(e);const n=a.XpG();return s.Njj(n.searchInProgress()?n.cancel():n.submit())}),a.nrm(1,"cue-button-icon",9),a.k0s()}if(2&i){const e=a.XpG();a.AVh("multiline-button",e.effectiveMultiLineMode()),a.Y8G("variant",e.buttonVariant())("size",e.buttonSize())("cueTooltip",e.buttonTooltip()),a.R7$(),a.Y8G("icon",e.searchInProgress()?e.cancelIcon():e.submitIcon())}}let ie=(()=>{class i{renderer=(0,s.WQX)(a.sFG);placeholder=(0,l.hFB)("Search...");value=(0,l.geq)("");searchInProgress=(0,l.geq)(!1);searchFailed=(0,l.hFB)(!1);size=(0,l.hFB)("l");debounceTime=(0,l.hFB)(200);variant=(0,l.hFB)("secondary");showSubmitButton=(0,l.hFB)(!0);submitIcon=(0,l.hFB)("search");cancelIcon=(0,l.hFB)("close");buttonTooltip=(0,l.hFB)("");buttonVariant=(0,l.hFB)("accent");multiLineMode=(0,l.hFB)(!1);responsiveMode=(0,l.hFB)(!1);autoMultiLineMode=(0,s.vPA)(!1);effectiveMultiLineMode=(0,O.EW)(()=>this.multiLineMode()||this.responsiveMode()&&this.autoMultiLineMode());inputElement=(0,l.ebz)("inputElement");textareaElement=(0,l.ebz)("textareaElement");valueChange=(0,l.CGW)();valueSubmit=(0,l.CGW)();_debounceTimer;_value="";isDragging=(0,s.vPA)(!1);dragStartY=0;dragStartHeight=0;constructor(){(0,s.QZP)(()=>{this.effectiveMultiLineMode()&&this.responsiveMode()&&setTimeout(()=>{const t=this.textareaElement()?.nativeElement;if(t){t.focus();const n=t.value.length;t.setSelectionRange(n,n)}},0)}),(0,s.QZP)(()=>{this.value();const t=this.textareaElement()?.nativeElement;if(t&&this.effectiveMultiLineMode()){t.style.height="auto";const n=Math.min(t.scrollHeight,250);t.style.height=`${n}px`}})}startDrag(e){e.preventDefault();const t=this.textareaElement()?.nativeElement;if(!t)return;this.isDragging.set(!0),this.dragStartY=e.clientY;const n=window.getComputedStyle(t),o=parseFloat(n.height);this.dragStartHeight=o,t.style.height=`${o}px`;const u=this.onDragMove.bind(this),g=this.onDragEnd.bind(this);this.renderer.listen("document","mousemove",u);const m=this.renderer.listen("document","mouseup",f=>{g(f),m()})}onDragMove(e){if(!this.isDragging())return;const t=this.textareaElement()?.nativeElement;if(!t)return;const o=Math.max(64,this.dragStartHeight+(e.clientY-this.dragStartY));t.style.height=`${o}px`}onDragEnd(e){this.isDragging.set(!1)}switchToMultiline(){this.autoMultiLineMode.set(!0)}handleShiftEnter(e){this.value.set(e.newValue),this._value=e.newValue,this.autoMultiLineMode.set(!0),setTimeout(()=>{const t=this.textareaElement()?.nativeElement;t&&(t.focus(),t.setSelectionRange(e.cursorPosition,e.cursorPosition))},0)}handleMultilinePaste(e){this.value.set(e),this._value=e,this.autoMultiLineMode.set(!0),setTimeout(()=>{const t=this.textareaElement()?.nativeElement;if(t){t.focus();const n=t.value.length;t.setSelectionRange(n,n)}},0)}handleEnterKey(){this.multiLineMode()||this.responsiveMode()&&this.effectiveMultiLineMode()||this.submit()}update(e){this._value=e.target.value,this.value.set(this._value),clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this.valueChange.emit(this._value)},this.debounceTime())}submit(){this.valueSubmit.emit(this._value);const e=this.textareaElement()?.nativeElement;e&&(e.style.height="")}cancel(){this._value="",this.searchInProgress.set(!1),this.valueChange.emit(this._value)}buttonSize=(0,O.EW)(()=>"s"===this.size()?"xs":"m");hostStyles=(0,O.EW)(()=>{const t="s"===this.size()?"--height: calc(32rem / 16); --search-button-right: calc(4rem / 16); --search-input-padding-x: 1em; --search-font-size: 0.875em;":"";return`\n color: var(--cue-${this.variant()}Contrast);\n background-color: var(--cue-${this.variant()});\n ${t}\n `});static \u0275fac=function(t){return new(t||i)};static \u0275cmp=a.VBU({type:i,selectors:[["cue-search-bar"]],viewQuery:function(t,n){1&t&&a.wEZ(n.inputElement,J,5)(n.textareaElement,q,5),2&t&&a.NyB(2)},hostVars:6,hostBindings:function(t,n){1&t&&a.bIt("keydown.enter",function(){return n.handleEnterKey()},a.EBC),2&t&&(a.Aen(n.hostStyles()),a.AVh("pulsing",n.searchInProgress()&&!n.searchFailed())("failed",n.searchFailed()))},inputs:{placeholder:[1,"placeholder"],value:[1,"value"],searchInProgress:[1,"searchInProgress"],searchFailed:[1,"searchFailed"],size:[1,"size"],debounceTime:[1,"debounceTime"],variant:[1,"variant"],showSubmitButton:[1,"showSubmitButton"],submitIcon:[1,"submitIcon"],cancelIcon:[1,"cancelIcon"],buttonTooltip:[1,"buttonTooltip"],buttonVariant:[1,"buttonVariant"],multiLineMode:[1,"multiLineMode"],responsiveMode:[1,"responsiveMode"]},outputs:{value:"valueChange",searchInProgress:"searchInProgressChange",valueChange:"valueChange",valueSubmit:"valueSubmit"},decls:3,vars:2,consts:[["inputElement",""],["textareaElement",""],["type","text",1,"search-input",3,"value","placeholder","cueShiftEnter","cueAutoMultiline","autoMultilineValue","autoMultilineButtonOffset"],[1,"search-button",3,"multiline-button","variant","size","cueTooltip"],["type","text",1,"search-input",3,"valueChange","shiftEnterPressed","shouldSwitchToMultiline","multilinePasted","keyup","input","value","placeholder","cueShiftEnter","cueAutoMultiline","autoMultilineValue","autoMultilineButtonOffset"],["rows","1",1,"search-input","multiline",3,"valueChange","keyup","value","placeholder"],[1,"drag-handle",3,"mousedown"],[1,"drag-handle-icon"],[1,"search-button",3,"click","variant","size","cueTooltip"],[3,"icon"]],template:function(t,n){1&t&&(a.nVh(0,ee,2,6,"input",2)(1,te,4,2),a.nVh(2,ne,2,6,"cue-button",3)),2&t&&(a.vxM(n.effectiveMultiLineMode()?1:0),a.R7$(2),a.vxM(n.showSubmitButton()?2:-1))},dependencies:[$.$,W.a,K.d,Q,Z],styles:['[_nghost-%COMP%]{--height: 4rem ;border-radius:var(--height);font-family:var(--cue-font-family);position:relative;height:var(--height);display:flex;align-items:stretch}@container cue-container (width < 20em){[_nghost-%COMP%]{--height: 2.125rem }}[_nghost-%COMP%]:has(textarea.multiline){border-radius:1.25rem;min-height:var(--height);height:auto}.pulsing[_nghost-%COMP%]{animation:pulse-border 1.5s infinite ease-in-out}.failed[_nghost-%COMP%]{animation:_ngcontent-%COMP%_pulse-border-red 1.5s infinite ease-in-out}@keyframes _ngcontent-%COMP%_pulse-border-red{0%,to{box-shadow:0 0 #ef444466}50%{box-shadow:0 0 0 8px #ef44441a}}cue-button[_ngcontent-%COMP%]{position:absolute;right:var(--search-button-right, .625em);top:50%;transform:translateY(-50%)}cue-button.multiline-button[_ngcontent-%COMP%]{bottom:.625em;top:auto;transform:none}@container cue-container (width < 20em){cue-button[_ngcontent-%COMP%]{right:.25em}cue-button.multiline-button[_ngcontent-%COMP%]{bottom:.25em}}cue-typography[_ngcontent-%COMP%]{display:contents}cue-typography[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex:1;display:flex;align-items:stretch}input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{all:unset;font:inherit;font-size:var(--search-font-size, 1em);padding:0 var(--search-input-padding-x, 2em);flex:1;min-width:0;width:100%;height:100%;background-color:transparent;color:inherit;border-radius:4rem}input[_ngcontent-%COMP%]:focus-visible, textarea[_ngcontent-%COMP%]:focus-visible{outline:1px solid currentColor;outline-offset:2px}input[_ngcontent-%COMP%]::placeholder, textarea[_ngcontent-%COMP%]::placeholder{color:currentColor;opacity:.6}input[_ngcontent-%COMP%]::-ms-input-placeholder, textarea[_ngcontent-%COMP%]::-ms-input-placeholder{color:currentColor}@container cue-container (width < 20em){input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{padding:0 1em}}textarea.multiline[_ngcontent-%COMP%]{font-size:.875em;line-height:1.5;padding:1em 4em 2em 2em;resize:none;min-height:var(--height);border-radius:1.25rem;box-sizing:border-box;overflow-y:auto;scrollbar-gutter:stable}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar{width:10px}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#ffffff1a;border-top:28px solid transparent;border-bottom:28px solid transparent;background-clip:content-box}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:#fff6;border-radius:5px;border:2px solid transparent;background-clip:content-box}textarea.multiline[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background-color:#ffffff80}@container cue-container (width < 20em){textarea.multiline[_ngcontent-%COMP%]{padding:.75em 3em 1.75em 1em}}.drag-handle[_ngcontent-%COMP%]{position:absolute;bottom:4px;left:50%;transform:translate(-50%);width:48px;height:24px;display:flex;align-items:center;justify-content:center;cursor:ns-resize;z-index:2;transition:opacity .2s ease;opacity:.6}.drag-handle[_ngcontent-%COMP%]:hover, .drag-handle[_ngcontent-%COMP%]:active{opacity:1}.drag-handle-icon[_ngcontent-%COMP%]{position:relative;width:24px;height:12px}.drag-handle-icon[_ngcontent-%COMP%]:before, .drag-handle-icon[_ngcontent-%COMP%]:after{content:"";position:absolute;width:16px;height:2px;background-color:currentColor;border-radius:1px;left:50%;transform:translate(-50%)}.drag-handle-icon[_ngcontent-%COMP%]:before{top:2px}.drag-handle-icon[_ngcontent-%COMP%]:after{bottom:2px}'],changeDetection:0})}return i})();var ae=p(5381),oe=p(2245);let re=(()=>{class i{id=(0,s.vPA)("");updateId(e){this.id.set(function A(i,r=!1){return i=function Y(i,r=!1){let e=i;for(const t in F)e=e.replace(new RegExp(t,"g"),F[t]);return r&&e!==i&&console.info(`${i} -> ${e}`),e}(i,r),X(i,"daca0510-72b5-48ba-9091-b918ca18136b")}(e))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=a.VBU({type:i,selectors:[["cue-id-builder"]],decls:4,vars:2,consts:[["direction","column","align","center"],["placeholder","Text string...",2,"width","100%","text-align","start",3,"valueChange","showSubmitButton"]],template:function(t,n){1&t&&(a.j41(0,"cue-flexcontainer",0)(1,"cue-search-bar",1),a.bIt("valueChange",function(u){return n.updateId(u)}),a.k0s(),a.j41(2,"cue-typography"),a.EFF(3),a.k0s()()),2&t&&(a.R7$(),a.Y8G("showSubmitButton",!1),a.R7$(2),a.JRh(n.id()))},dependencies:[ie,ae.n,oe.Typography],encapsulation:2})}return i})()},5332(G,D,p){p.d(D,{k:()=>_});for(var d=[],x=0;x<256;++x)d.push((x+256).toString(16).slice(1));function _(c,h=0){return(d[c[h+0]]+d[c[h+1]]+d[c[h+2]]+d[c[h+3]]+"-"+d[c[h+4]]+d[c[h+5]]+"-"+d[c[h+6]]+d[c[h+7]]+"-"+d[c[h+8]]+d[c[h+9]]+"-"+d[c[h+10]]+d[c[h+11]]+d[c[h+12]]+d[c[h+13]]+d[c[h+14]]+d[c[h+15]]).toLowerCase()}}}]);
package/396.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[396],{9396(P,D,s){s.d(D,{CueContextViewer:()=>W});var v=s(467),d=s(7705),c=s(5802),r=s(2271),g=s(494),p=s(4879),x=s(2839),f=s(6455),y=s(8334),t=s(5547);function _(n,l){1&n&&(t.j41(0,"div",0),t.EFF(1,"Loading context\u2026"),t.k0s())}function C(n,l){1&n&&(t.j41(0,"div",0),t.EFF(1,"No context loaded."),t.k0s())}function I(n,l){if(1&n){const e=t.RV6();t.j41(0,"cue-tabs",1)(1,"cue-tab",4),t.nrm(2,"cue-doc-list",2),t.k0s(),t.j41(3,"cue-tab",5)(4,"cue-ent-list-inner",6),t.bIt("rowClicked",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.entityRowClicked.emit(a))}),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(2),t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant()),t.R7$(2),t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())}}function w(n,l){if(1&n&&t.nrm(0,"cue-doc-list",2),2&n){const e=t.XpG();t.Y8G("documentRefs",e.documentRefs())("documentData",e.documentData())("handlers",e._docHandlers())("variant",e.variant())}}function b(n,l){if(1&n){const e=t.RV6();t.j41(0,"cue-ent-list-inner",7),t.bIt("rowClicked",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.entityRowClicked.emit(a))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("entities",e.entityIris())("entityData",e.entityData())("handlers",e._entityHandlers())}}function M(n,l){1&n&&(t.j41(0,"div",0),t.EFF(1,"No items in this context."),t.k0s())}let N=(()=>{class n{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)({});entityRowClicked=(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));_docHandlers=(0,r.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,r.EW)(()=>({requestData:(e,o)=>this.handlers()?.requestEntityData?.(e,o),requestOpen:e=>this.handlers()?.requestOpenEntity?.(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:{entityRowClicked:"entityRowClicked"},decls:6,vars:1,consts:[[1,"cv-status"],[2,"height","100%"],[3,"documentRefs","documentData","handlers","variant"],[2,"height","400px",3,"entities","entityData","handlers"],["label","Documents"],["label","Entities"],[2,"height","100%",3,"rowClicked","entities","entityData","handlers"],[2,"height","400px",3,"rowClicked","entities","entityData","handlers"]],template:function(o,a){1&o&&t.nVh(0,_,2,0,"div",0)(1,C,2,0,"div",0)(2,I,5,7,"cue-tabs",1)(3,w,1,4,"cue-doc-list",2)(4,b,1,3,"cue-ent-list-inner",3)(5,M,2,0,"div",0),2&o&&t.vxM(a.loading()?0:a.contextDoc()?a.hasBoth()?2:a.hasDocuments()?3:a.hasEntities()?4:5:1)},dependencies:[p.g,x.u,f.t,y.o],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 E=s(5381),R=s(2245),k=s(7851),V=s(7293);function j(n,l){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 F(n,l){1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"cue-typography",3),t.EFF(2," No project connected. "),t.k0s()())}function T(n,l){if(1&n&&t.nrm(0,"cue-logo-link",5),2&n){const e=t.XpG(2);t.Y8G("projectId",e.projectId())}}function B(n,l){if(1&n){const e=t.RV6();t.j41(0,"div",1)(1,"cue-context-viewer-inner",4),t.bIt("entityRowClicked",function(a){c.eBV(e);const i=t.XpG();return c.Njj(i.entityRowClicked.emit(a))}),t.k0s(),t.nVh(2,T,1,1,"cue-logo-link",5),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("cueLogoLoader","loading"===e.state()),t.R7$(),t.Y8G("contextDoc",e.contextDoc())("documentData",e.documentData())("entityData",e.entityData())("handlers",e._handlers())("variant",e.variant()),t.R7$(),t.vxM(e.showLogo()?2:-1)}}function G(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 W=(()=>{class n{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});entityRowClicked=(0,d.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;_handlers=(0,r.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 u=yield e.api.contexts.getContext(o,a);i.contextDoc.set(u);const h=new g.f$(e.api,o),m=new g.g8(e.api,o);i._documents.set(h),i._entities.set(m),i._unsubDocs=h.documentInfoMap.subscribe(()=>i._syncDocumentData(h)),i._unsubEntities=m.entityInfoMap.subscribe(()=>i._syncEntityData(m)),i.state.set("ready")}catch(u){console.error("[cue-context-viewer] Failed to load context",u),i.errorMessage.set(u instanceof Error?u.message:"Failed to load context."),i.state.set("error")}}else i.state.set("idle")})()}_syncDocumentData(e){const o=e.documentInfoMap.get(),a={};for(const[i,u]of Object.entries(o))a[i]=G(u);this.documentData.set(a)}_syncEntityData(e){const o=e.entityInfoMap.get(),a={};for(const[i,u]of Object.entries(o))a[i]={value:u.value??i,categories:u.categories??[],mentionCount:u.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:{entityRowClicked:"entityRowClicked"},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%",3,"entityRowClicked","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,j,3,1,"cue-flexcontainer",0)(1,F,3,0,"cue-flexcontainer",0)(2,B,3,7,"div",1),2&o&&t.vxM("error"===a.state()?0:"idle"===a.state()?1:2)},dependencies:[N,E.n,R.Typography,k.k,V.x],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}"],changeDetection:0})}return n})()}}]);
package/399.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[399],{4853(O,w,l){l.d(w,{H:()=>j});var _=l(7705),c=l(5802),p=l(7089),d=l(7023),e=l(5381),h=l(5971),v=l(3319),g=l(356),E=l(6279),r=l(5547);const C=()=>({position:"bottomleft"}),y=(M,I)=>I.label||M;function P(M,I){if(1&M){const b=r.RV6();r.j41(0,"cue-menu-item",4),r.bIt("click",function(){const D=c.eBV(b).$implicit;return c.Njj(D.action())}),r.EFF(1),r.k0s()}if(2&M){const b=I.$implicit;r.Y8G("selected",b.selected),r.R7$(),r.JRh(b.label)}}function R(M,I){if(1&M&&(r.j41(0,"cue-menu-wrap"),r.Z7z(1,P,2,2,"cue-menu-item",3,y),r.k0s()),2&M){const b=r.XpG();r.R7$(),r.Dyx(b.contextMenuItems())}}function V(M,I){if(1&M){const b=r.RV6();r.j41(0,"cue-button",5),r.bIt("click",function(D){const A=c.eBV(b).$implicit,k=r.XpG();return c.Njj(k.handleClick(D,A))}),r.nrm(1,"cue-button-icon",6),r.k0s()}if(2&M){const b=I.$implicit,x=r.XpG(),D=r.sdS(1);r.Y8G("cueTooltip",b.label)("variant",b.variant?b.variant:x.variant())("size",x.size())("cueContextMenu",D)("contextMenuData",r.lJ4(7,C))("cueContextEnabled",void 0!==b.contextMenuItems&&b.contextMenuItems.length>0),r.R7$(),r.Y8G("icon",b.icon)}}let j=(()=>{class M{items=_.hFB.required();noGap=(0,_.hFB)(!0);direction=(0,_.hFB)("row");size=(0,_.hFB)("xs");variant=(0,_.hFB)("tertiary");mouseEnter=(0,_.CGW)();mouseLeave=(0,_.CGW)();contextMenuItems=(0,c.vPA)([]);handleClick(b,x){b.stopPropagation(),x.contextMenuItems&&x.contextMenuItems.length>0?this.contextMenuItems.set(x.contextMenuItems):x.action&&(this.contextMenuItems.set([]),x.action())}static \u0275fac=function(x){return new(x||M)};static \u0275cmp=r.VBU({type:M,selectors:[["cue-entity-menu"]],inputs:{items:[1,"items"],noGap:[1,"noGap"],direction:[1,"direction"],size:[1,"size"],variant:[1,"variant"]},outputs:{mouseEnter:"mouseEnter",mouseLeave:"mouseLeave"},decls:5,vars:2,consts:[["contextMenu",""],["gap","s","justify","end",2,"width","100%",3,"mouseenter","mouseleave","direction","noGap"],["trigger","leftclick",3,"cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"selected"],[3,"click","selected"],["trigger","leftclick",3,"click","cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"icon"]],template:function(x,D){1&x&&(r.DNE(0,R,3,0,"ng-template",null,0,r.C5r),r.j41(2,"cue-flexcontainer",1),r.bIt("mouseenter",function(){return D.mouseEnter.emit()})("mouseleave",function(){return D.mouseLeave.emit()}),r.Z7z(3,V,2,8,"cue-button",2,y),r.k0s()),2&x&&(r.R7$(2),r.Y8G("direction",D.direction())("noGap",D.noGap()),r.R7$(),r.Dyx(D.items()))},dependencies:[e.n,h.$,p.d,v.a,d.Q,g.M,E.D],encapsulation:2,changeDetection:0})}return M})()},1024(O,w,l){l.d(w,{p:()=>p});var _=l(5547);const c=["*"];let p=(()=>{class d{static \u0275fac=function(v){return new(v||d)};static \u0275cmp=_.VBU({type:d,selectors:[["cue-key-val-list"]],ngContentSelectors:c,decls:2,vars:0,consts:[[1,"key-val-list"]],template:function(v,g){1&v&&(_.NAR(),_.rj2(0,"div",0),_.SdG(1),_.eux())},styles:[".key-val-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-grid-gap-s)}"]})}return d})()},9421(O,w,l){l.d(w,{F:()=>v});var _=l(7705),c=l(5802),p=l(2271),d=l(7335),e=l(2245),h=l(5547);let v=(()=>{class g{entityMenuDirective;size=(0,_.hFB)("m");key=_.hFB.required();val=_.geq.required();options=(0,_.hFB)([]);suffix=(0,_.hFB)("");valueChange=(0,_.CGW)();editModeEnabled=(0,c.vPA)(!1);valueChanged=(0,p.EW)(()=>this.val()!==this.newValue());newValue=(0,p.uu)(()=>this.val());labelSize=(0,p.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(r){this.editModeEnabled()&&("Escape"===r.key?(this._reset(),r.stopPropagation()):"Enter"===r.key&&this._emitChange())}saveCancelMenu=(0,p.EW)(()=>{const r=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&r.push({icon:"save",label:"Save",action:()=>this._emitChange()}),r});selectionChange(r){this.newValue.set(r?.toString()??"")}inputChange(r){this.newValue.set(r)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}static \u0275fac=function(C){return new(C||g)};static \u0275cmp=h.VBU({type:g,selectors:[["cue-key-val"]],viewQuery:function(C,y){if(1&C&&h.GBs(d.e,5),2&C){let P;h.mGM(P=h.lsd())&&(y.entityMenuDirective=P.first)}},hostBindings:function(C,y){1&C&&h.bIt("keydown",function(R){return y.onKeyPress(R)},h.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],options:[1,"options"],suffix:[1,"suffix"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:8,vars:5,consts:[[1,"key-val-container"],[3,"size"],[1,"value-content"]],template:function(C,y){1&C&&(h.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),h.EFF(3),h.k0s()(),h.j41(4,"dd")(5,"cue-typography",1)(6,"span",2),h.EFF(7),h.k0s()()()()),2&C&&(h.R7$(2),h.Y8G("size",y.labelSize()),h.R7$(),h.JRh(y.key()),h.R7$(2),h.Y8G("size",y.size()),h.R7$(2),h.Lme("",y.val()," ",y.suffix()))},dependencies:[e.Typography],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return g})()},7335(O,w,l){l.d(w,{e:()=>g});var _=l(7705),c=l(5547),p=l(5802),d=l(8359),e=l(6939),h=l(63),v=l(4853);let g=(()=>{class E{_targetEl=(0,p.WQX)(c.aKT);_overlay=(0,p.WQX)(h.hJ);_overlayRef;_isOverlayHovered=!1;_subscriptions;display=(0,_.hFB)("on-hover");menuItems=_.hFB.required();menuEnabled=(0,_.hFB)(!0);onMouseEnter(){if("on-hover"===this.display()){if(!this.menuItems().length)return void this.removeOverlayMenu();this.appendOverlayMenu()}}onMouseLeave(){this._checkShouldRemoveOverlay()}appendOverlayMenu(){if(!this.menuItems().length||this._overlayRef)return;const C=this._overlay.create({positionStrategy:this._overlay.position().flexibleConnectedTo(this._targetEl).withPositions([{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:2,offsetY:0}])});this._overlayRef=C;const y=window.getComputedStyle(this._targetEl.nativeElement).color;C.overlayElement.style.color=y;const P=new e.A8(v.H),R=C.attach(P);R.instance.items=this.menuItems,this._subscriptions&&this._subscriptions.unsubscribe(),this._subscriptions=new d.yU,this._subscriptions.add(R.instance.mouseEnter.subscribe(()=>{this._isOverlayHovered=!0})),this._subscriptions.add(R.instance.mouseLeave.subscribe(()=>{this._isOverlayHovered=!1,this._checkShouldRemoveOverlay()}))}removeOverlayMenu(){this._overlayRef&&(this._subscriptions&&(this._subscriptions.unsubscribe(),this._subscriptions=void 0),this._overlayRef.detach(),this._overlayRef.dispose(),this._overlayRef=void 0)}_checkShouldRemoveOverlay(){setTimeout(()=>{this._isOverlayHovered||this.removeOverlayMenu()},300)}static \u0275fac=function(y){return new(y||E)};static \u0275dir=c.FsC({type:E,selectors:[["","cueEntityMenu",""]],hostBindings:function(y,P){1&y&&c.bIt("mouseenter",function(){return P.onMouseEnter()})("mouseleave",function(){return P.onMouseLeave()})},inputs:{display:[1,"display"],menuItems:[1,"menuItems"],menuEnabled:[1,"menuEnabled"]}})}return E})()},2399(O,w,l){l.d(w,{CueDocumentViewer:()=>Oe});var _=l(467),c=l(7705),p=l(2271),d=l(5802),e=l(5547),h=l(9769),v=l(5381),g=l(2245),E=l(1024),r=l(9421),C=l(5903),y=l(9352),P=l(6117),R=l(8547),V=l(3319),j=l(5971),M=l(7573);const I=(o,m)=>t=>t.isHighlight;function b(o,m){if(1&o&&(e.j41(0,"span",3),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).$implicit;e.R7$(),e.JRh(t.highlight.label)}}function x(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-button",5),e.bIt("click",function(i){d.eBV(t);const a=e.XpG(2).$implicit,s=e.XpG();return d.Njj(s.onDeleteHighlight(i,a.highlight))}),e.nrm(1,"cue-button-icon",6),e.k0s()}}function D(o,m){if(1&o){const t=e.RV6();e.j41(0,"span",2),e.bIt("click",function(){d.eBV(t);const i=e.XpG().$implicit,a=e.XpG();return d.Njj(a.onHighlightClick(i.highlight))}),e.nVh(1,b,2,1,"span",3),e.EFF(2),e.nVh(3,x,2,0,"cue-button",4),e.k0s()}if(2&o){const t=e.XpG().$implicit,n=e.XpG();e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.vxM(t.highlight.label?1:-1),e.R7$(),e.SpI(" ",t.text," "),e.R7$(),e.vxM(n.allowDelete()?3:-1)}}function A(o,m){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.BMQ("data-segment-start",t.segmentStart),e.R7$(),e.JRh(t.text)}}function k(o,m){if(1&o&&e.nVh(0,D,4,4,"span",1)(1,A,2,2,"span"),2&o){const t=m.$implicit;e.vxM(t.isHighlight&&t.highlight?0:1)}}let W=(()=>{class o{path=c.hFB.required();highlights=(0,c.hFB)([]);allowDelete=(0,c.hFB)(!1);allowAdd=(0,c.hFB)(!1);size=(0,c.hFB)("m");highlightClick=(0,c.CGW)();deleteHighlight=(0,c.CGW)();textSelected=(0,c.CGW)();segments=(0,p.EW)(()=>this.parseSegments(this.path(),this.highlights()));parseSegments(t,n){const i=n.filter(f=>f.path===t);if(0===i.length)return[{text:t,isHighlight:!1,segmentStart:0}];const a=[...i].sort((f,T)=>f.start-T.start),s=[];let u=0;for(const f of a)f.start>u&&s.push({text:t.substring(u,f.start),isHighlight:!1,segmentStart:u}),s.push({text:t.substring(f.start,f.end),isHighlight:!0,highlight:f,segmentStart:f.start}),u=f.end;return u<t.length&&s.push({text:t.substring(u),isHighlight:!1,segmentStart:u}),s}onHighlightClick(t){const n=this.path().substring(t.start,t.end);this.highlightClick.emit({path:this.path(),highlight:t,text:n})}onDeleteHighlight(t,n){t.stopPropagation(),this.deleteHighlight.emit({path:this.path(),highlight:n})}onMouseUp(t){if(!this.allowAdd())return;const n=window.getSelection();if(!n||n.isCollapsed||!n.rangeCount||!n.toString().trim())return;const a=n.getRangeAt(0),s=t.currentTarget,u=this.getAbsoluteOffset(s,a.startContainer,a.startOffset),f=this.getAbsoluteOffset(s,a.endContainer,a.endOffset);n.removeAllRanges(),f>u&&this.textSelected.emit({path:this.path(),start:u,end:f,text:this.path().substring(u,f)})}getAbsoluteOffset(t,n,i){let a=n.nodeType===Node.TEXT_NODE?n.parentElement:n;for(;a&&a!==t;){if(a instanceof HTMLElement&&a.hasAttribute("data-segment-start")){const T=parseInt(a.getAttribute("data-segment-start"),10);let F=0;const B=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);let L=B.nextNode();for(;L&&L!==n;)F+=L.textContent?.length??0,L=B.nextNode();return T+F+i}a=a.parentElement}const s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let u=0,f=s.nextNode();for(;f&&f!==n;)u+=f.textContent?.length??0,f=s.nextNode();return u+i}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-file-path-viewer"]],inputs:{path:[1,"path"],highlights:[1,"highlights"],allowDelete:[1,"allowDelete"],allowAdd:[1,"allowAdd"],size:[1,"size"]},outputs:{highlightClick:"highlightClick",deleteHighlight:"deleteHighlight",textSelected:"textSelected"},decls:3,vars:7,consts:[[1,"path-content",3,"mouseup"],[1,"highlight-segment"],[1,"highlight-segment",3,"click"],[1,"highlight-label"],["size","xs","aria-label","Remove highlight",1,"delete-button"],["size","xs","aria-label","Remove highlight",1,"delete-button",3,"click"],["icon","close"]],template:function(n,i){1&n&&(e.j41(0,"div",0),e.bIt("mouseup",function(s){return i.onMouseUp(s)}),e.Z7z(1,k,2,1,null,null,e.Vm6),e.k0s()),2&n&&(e.AVh("size-s","s"===i.size())("allow-add",i.allowAdd())("has-highlights",i.segments().some(e._m7(6,I,i))),e.R7$(),e.Dyx(i.segments()))},dependencies:[h.MD,j.$,V.a],styles:["[_nghost-%COMP%]{display:contents}.path-content[_ngcontent-%COMP%]{display:block;flex:1;min-width:0;word-break:break-all;text-align:start;font-family:var(--cue-font-family);font-size:var(--cue-font-m-size);line-height:var(--cue-font-m-line-height);letter-spacing:var(--cue-font-m-letter-spacing);font-weight:var(--cue-font-weight-regular)}.path-content.size-s[_ngcontent-%COMP%]{font-size:var(--cue-font-s-size);line-height:var(--cue-font-s-line-height);letter-spacing:var(--cue-font-s-letter-spacing)}.path-content.allow-add[_ngcontent-%COMP%]{cursor:text;-webkit-user-select:text;user-select:text}.path-content.has-highlights[_ngcontent-%COMP%]{padding-top:.8rem;line-height:2.3rem}.highlight-segment[_ngcontent-%COMP%]{display:inline-block;vertical-align:text-bottom;position:relative;line-height:normal;font-weight:var(--cue-font-weight-medium);cursor:pointer;padding:0 .2rem;border-radius:3px;border:1px solid currentColor;transition:all .2s ease}.highlight-segment[_ngcontent-%COMP%] .highlight-label[_ngcontent-%COMP%]{font-family:var(--cue-font-family);position:absolute;bottom:100%;left:0;font-size:.5rem;line-height:1;opacity:.7;margin-bottom:.15rem;white-space:nowrap;pointer-events:none}.highlight-segment[_ngcontent-%COMP%] .delete-button[_ngcontent-%COMP%]{position:absolute;top:-12px;right:-12px;z-index:10;opacity:0;transition:opacity .2s ease;pointer-events:none}.highlight-segment[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,currentColor 12%,transparent)}.highlight-segment[_ngcontent-%COMP%]:hover .delete-button[_ngcontent-%COMP%]{opacity:1;pointer-events:all}"],changeDetection:0})}return o})();var z=l(5745),X=l(2444),H=l(9695),K=l(5448),Y=l(2611);const G=o=>({count:o}),J=(o,m)=>t=>t.iri;function Q(o,m){1&o&&(e.j41(0,"cue-typography",11),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o&&(e.R7$(),e.JRh(e.bMT(2,1,"components.documentInfo.infoLoadingFilePaths")))}function Z(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-ag-grid",16),e.bIt("selectedRows",function(i){d.eBV(t);const a=e.XpG(4);return d.Njj(a.onMatchedPathsSelectionChange(i))}),e.k0s()}if(2&o){const t=e.XpG(4);e.Y8G("rowData",t._matchTableRowData())("columnDefs",t._matchTableColDefs())("rowSelection",t._matchTableRowSelection)}}function q(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",12)(1,"cue-button",13),e.bIt("click",function(){d.eBV(t);const i=e.XpG(3);return d.Njj(i._matchTableExpanded.set(!i._matchTableExpanded()))}),e.nrm(2,"cue-button-icon",14),e.j41(3,"cue-button-label"),e.EFF(4),e.nI1(5,"transloco"),e.k0s()(),e.nVh(6,Z,1,3,"cue-ag-grid",15),e.k0s(),e.j41(7,"cue-typography",11),e.EFF(8),e.nI1(9,"transloco"),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(2),e.Y8G("icon",t._matchTableExpanded()?"arrow-up":"arrow-dropdown"),e.R7$(2),e.JRh(e.i5U(5,4,1===t._matchCount()?"components.documentInfo.filePathMatched":"components.documentInfo.filePathsMatched",e.eq3(10,G,t._matchCount()))),e.R7$(2),e.vxM(t._matchTableExpanded()?6:-1),e.R7$(2),e.JRh(e.i5U(9,7,"components.documentInfo.applyToNPaths",e.eq3(12,G,t._selectedPaths().length)))}}function ee(o,m){if(1&o&&e.nVh(0,Q,3,3,"cue-typography",11)(1,q,10,14),2&o){const t=e.XpG(2);e.vxM(t._fileLocationsLoading()?0:null!==t._fileLocations()?1:-1)}}function te(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-flexcontainer",9)(1,"cue-input-switch",10),e.bIt("toggleChange",function(i){d.eBV(t);const a=e.XpG();return d.Njj(a.onApplyToAllChange(i))}),e.k0s(),e.j41(2,"cue-typography",11),e.EFF(3),e.nI1(4,"transloco"),e.k0s()(),e.nVh(5,ee,2,1)}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("checked",t._applyToAllFiles()),e.R7$(2),e.JRh(e.bMT(4,3,"components.documentInfo.applyToAllFiles")),e.R7$(2),e.vxM(t._applyToAllFiles()?5:-1)}}function ne(o,m){if(1&o&&(e.j41(0,"cue-typography",8),e.EFF(1),e.nI1(2,"transloco"),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Lme("",e.bMT(2,2,"components.documentInfo.errorSavingEntityMention"),": ",t._saveError())}}let ie=(()=>{class o{selection=c.hFB.required();availableEntityCategories=(0,c.hFB)([]);fileLocations=(0,c.hFB)([]);requestFileLocations=(0,c.hFB)(void 0);requestFilePathEntityAdd=(0,c.hFB)(void 0);confirm=(0,c.CGW)();cancel=(0,c.CGW)();_selectedEntityCategory=(0,d.vPA)("");_applyToAllFiles=(0,d.vPA)(!1);_fileLocations=(0,d.vPA)(null);_fileLocationsLoading=(0,d.vPA)(!1);_matchTableExpanded=(0,d.vPA)(!1);_selectedPaths=(0,d.vPA)([]);_saving=(0,d.vPA)(!1);_saveError=(0,d.vPA)(null);_dirPrefix=(0,p.EW)(()=>{const t=this.selection();return t.path.substring(0,t.end)});_matchedLocations=(0,p.EW)(()=>{const t=this._fileLocations();if(!t)return[];const n=this._dirPrefix();return t.filter(i=>i.path.startsWith(n))});_matchCount=(0,p.EW)(()=>this._matchedLocations().length);_matchTableRowData=(0,p.EW)(()=>this._matchedLocations().map(t=>({iri:t.iri,path:t.path,providerId:t.providerId})));_entityCategoryLabelMap=(0,p.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));_matchTableRowSelection={mode:"multiRow",selectAll:"filtered"};_filePathLabel=(0,y.Xx)("components.contentBlocks.documentViewer.labelFilePath");_matchTableColDefs=(0,p.EW)(()=>[{headerName:this._filePathLabel(),field:"path",flex:1,filter:!0,sortable:!0}]);onEntityCategoryChange(t){this._selectedEntityCategory.set("string"==typeof t?t:String(t??""))}onApplyToAllChange(t){var n=this;return(0,_.A)(function*(){if(n._applyToAllFiles.set(t),n._matchTableExpanded.set(!1),!t)return n._fileLocations.set(null),void n._selectedPaths.set([]);const i=n.requestFileLocations();if(i){n._fileLocationsLoading.set(!0);try{const a=yield i();n._fileLocations.set(a);const s=n._dirPrefix();n._selectedPaths.set(a.filter(u=>u.path.startsWith(s)))}finally{n._fileLocationsLoading.set(!1)}}})()}onMatchedPathsSelectionChange(t){const n=this._fileLocations()??[];this._selectedPaths.set(t.map(i=>n.find(a=>a.path===i.path)??{iri:"",path:i.path}))}onConfirm(){var t=this;return(0,_.A)(function*(){const n=t._selectedEntityCategory();if(!n)return;const i=t.selection().path,a=t._fileLocations()?.find(f=>f.path===i)??t.fileLocations().find(f=>f.path===i)??{iri:"",path:i},s=t._applyToAllFiles()&&t._selectedPaths().length>0?t._selectedPaths():[a],u=t.requestFilePathEntityAdd();if(u){t._saving.set(!0),t._saveError.set(null);try{yield u(n,s)}catch(f){return console.error("[EntityMentionModal] Failed to save entity mention:",f),t._saveError.set(f instanceof Error?f.message:String(f)),void t._saving.set(!1)}t._saving.set(!1)}t.confirm.emit({entityCategory:n,paths:s})})()}onCancel(){this.cancel.emit()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-entity-mention-modal"]],inputs:{selection:[1,"selection"],availableEntityCategories:[1,"availableEntityCategories"],fileLocations:[1,"fileLocations"],requestFileLocations:[1,"requestFileLocations"],requestFilePathEntityAdd:[1,"requestFilePathEntityAdd"]},outputs:{confirm:"confirm",cancel:"cancel"},decls:18,vars:24,consts:[[3,"close","displayCloseBtn","closeOnBackgroundClick"],[1,"modal-content"],["direction","column","gap","m"],[3,"key","val"],[3,"valueChange","value","options","labelMap","label","showFilter"],["direction","row","justify","center"],[3,"click","disabled"],["variant","secondary",3,"click","disabled"],["size","s",2,"color","var(--cue-error)"],["direction","row","gap","s","align","center"],[3,"toggleChange","checked"],["size","s"],["direction","column","gap","xs"],["variant","ghost","size","xs",3,"click"],[3,"icon"],["size","s","height","220px",3,"rowData","columnDefs","rowSelection"],["size","s","height","220px",3,"selectedRows","rowData","columnDefs","rowSelection"]],template:function(n,i){1&n&&(e.j41(0,"cue-modal",0),e.bIt("close",function(){return i.onCancel()}),e.j41(1,"div",1)(2,"cue-flexcontainer",2),e.nrm(3,"cue-key-val",3),e.nI1(4,"transloco"),e.j41(5,"cue-select",4),e.nI1(6,"transloco"),e.bIt("valueChange",function(s){return i.onEntityCategoryChange(s)}),e.k0s(),e.nVh(7,te,6,5),e.j41(8,"cue-flexcontainer",5)(9,"cue-button",6),e.bIt("click",function(){return i.onCancel()}),e.j41(10,"cue-button-label"),e.EFF(11),e.nI1(12,"transloco"),e.k0s()(),e.j41(13,"cue-button",7),e.bIt("click",function(){return i.onConfirm()}),e.j41(14,"cue-button-label"),e.EFF(15),e.nI1(16,"transloco"),e.k0s()()(),e.nVh(17,ne,3,4,"cue-typography",8),e.k0s()()()),2&n&&(e.Y8G("displayCloseBtn",!1)("closeOnBackgroundClick",!1),e.R7$(3),e.Y8G("key",e.bMT(4,15,"components.documentInfo.labelSelectedText"))("val",i.selection().text),e.R7$(2),e.Y8G("value",i._selectedEntityCategory())("options",i.availableEntityCategories().map(e._m7(17,J,i)))("labelMap",i._entityCategoryLabelMap())("label",e.bMT(6,18,"components.entityInfo.labelEntityCategory"))("showFilter",i.availableEntityCategories().length>5),e.R7$(2),e.vxM(i.requestFileLocations()?7:-1),e.R7$(2),e.Y8G("disabled",i._saving()),e.R7$(2),e.JRh(e.bMT(12,20,"components.modals.rdfEdit.buttonCancel")),e.R7$(2),e.Y8G("disabled",!i._selectedEntityCategory()||i._saving()),e.R7$(2),e.JRh(e.bMT(16,22,"components.modals.rdfEdit.buttonSave")),e.R7$(2),e.vxM(i._saveError()?17:-1))},dependencies:[v.n,r.F,V.a,j.$,K.L,g.Typography,z.a,X.l,H.d,Y.R,y.Kj],styles:[".modal-content[_ngcontent-%COMP%]{width:640px;max-width:calc(100vw - 32px)}"],changeDetection:0})}return o})();const oe=()=>[];function ae(o,m){if(1&o&&(e.nrm(0,"cue-key-val",6),e.nI1(1,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",e.bMT(1,2,"components.contentBlocks.documentViewer.labelSubject"))("val",t.subject())}}function se(o,m){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nVh(1,ae,2,4,"cue-key-val",6),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.subject()?1:-1)}}function le(o,m){if(1&o&&(e.j41(0,"cue-flexcontainer",4)(1,"cue-menu",7)(2,"cue-button",8,0),e.nrm(4,"cue-button-icon",9),e.k0s(),e.nrm(5,"cue-menu-nested",10),e.k0s()()),2&o){const t=e.XpG();e.R7$(5),e.Y8G("items",t.menuItems())}}function re(o,m){if(1&o&&(e.nrm(0,"cue-key-val-editable",11),e.nI1(1,"transloco"),e.nI1(2,"transloco")),2&o){const t=e.XpG(2);e.Y8G("key",1===t.contentCategories().length?e.bMT(1,4,"components.contentBlocks.documentViewer.labelContentCategory"):e.bMT(2,6,"components.contentBlocks.documentViewer.labelContentCategories"))("val",t.contentCategoriesString())("rdfConfig",t.rdfEditConfig())("editDisabled",!t.contentCategoriesEditable())}}function ce(o,m){if(1&o&&(e.j41(0,"span",15),e.EFF(1),e.k0s()),2&o){const t=e.XpG(3);e.R7$(),e.Lme("(",t.currentFilePathIndex()+1,"/",t.fileLocations().length,")")}}function de(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){d.eBV(t);const i=e.XpG(3);return d.Njj(i.prevFilePath())}),e.nrm(1,"cue-button-icon",20),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",0===t.currentFilePathIndex())}}function ue(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-button",19),e.bIt("click",function(){d.eBV(t);const i=e.XpG(3);return d.Njj(i.nextFilePath())}),e.nrm(1,"cue-button-icon",21),e.k0s()}if(2&o){const t=e.XpG(3);e.Y8G("disabled",t.currentFilePathIndex()===t.fileLocations().length-1)}}function he(o,m){if(1&o){const t=e.RV6();e.j41(0,"dl",12)(1,"dt",13)(2,"cue-typography",14),e.EFF(3),e.nI1(4,"transloco"),e.nVh(5,ce,2,2,"span",15),e.k0s()(),e.j41(6,"dd",16),e.nVh(7,de,2,1,"cue-button",17),e.j41(8,"cue-file-path-viewer",18),e.bIt("textSelected",function(i){d.eBV(t);const a=e.XpG(2);return d.Njj(a.onTextSelected(i))}),e.k0s(),e.nVh(9,ue,2,1,"cue-button",17),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.SpI(" ",e.bMT(4,8,"components.contentBlocks.documentViewer.labelFilePath")," "),e.R7$(2),e.vxM(t.fileLocations().length>1?5:-1),e.R7$(2),e.vxM(t.fileLocations().length>1?7:-1),e.R7$(),e.Y8G("path",t.fileLocations()[t.currentFilePathIndex()].path)("highlights",t.filePathEntitiesVisible()?t.filePathHighlights():e.lJ4(10,oe))("allowDelete",t.filePathEntitiesEditable())("allowAdd",t.filePathEntitiesEditable()),e.R7$(),e.vxM(t.fileLocations().length>1?9:-1)}}function ge(o,m){if(1&o&&(e.j41(0,"cue-key-val-list"),e.nrm(1,"hr"),e.nVh(2,re,3,8,"cue-key-val-editable",11),e.nVh(3,he,10,11,"dl",12),e.k0s()),2&o){const t=e.XpG();e.R7$(2),e.vxM(t.contentCategories()&&t.contentCategories().length>0?2:-1),e.R7$(),e.vxM(t.fileLocations().length>0?3:-1)}}function _e(o,m){if(1&o){const t=e.RV6();e.j41(0,"cue-entity-mention-modal",22),e.bIt("confirm",function(i){d.eBV(t);const a=e.XpG();return d.Njj(a.onEntityMentionConfirm(i))})("cancel",function(){d.eBV(t);const i=e.XpG();return d.Njj(i.onEntityMentionCancel())}),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("selection",t._pendingSelection())("availableEntityCategories",t.availableEntityCategories())("fileLocations",t.fileLocations())("requestFileLocations",t._fileLocationsProvider())("requestFilePathEntityAdd",t._requestFilePathEntityAdd())}}let me=(()=>{class o{subject=c.hFB.required();handlers=c.hFB.required();dataChanged=(0,c.CGW)();filePathEntityAdded=(0,c.CGW)();fileLocations=(0,c.hFB)([]);_fileLocationsProvider=(0,p.EW)(()=>{const t=this.handlers().requestFileLocations;if(t)return t;const n=this.fileLocations();return n.length?()=>Promise.resolve(n):void 0});filePathEntities=(0,c.geq)([]);contentCategories=(0,c.hFB)([]);contentCategoriesEditable=(0,c.hFB)(!1);filePathEntitiesVisible=(0,c.hFB)(!1);filePathEntitiesEditable=(0,c.hFB)(!1);menuItems=(0,c.hFB)([]);availableContentCategories=(0,c.hFB)([]);availableEntityCategories=(0,c.hFB)([]);collapsed=(0,c.hFB)(!1);hasDocInfo=(0,p.EW)(()=>{const t=""!==this.subject(),n=this.fileLocations().length>0;return t||n});currentFilePathIndex=(0,d.vPA)(0);_entityCategoryModalVisible=(0,d.vPA)(!1);_pendingSelection=(0,d.vPA)(null);_requestFilePathEntityAdd=(0,p.EW)(()=>{var t=this;const n=this.handlers().requestFilePathEntityAdd;if(n)return function(){var i=(0,_.A)(function*(a,s){const u=t._pendingSelection();u&&(yield n({paths:s,start:u.start,end:u.end,text:u.text,entityCategory:a,folderPath:u.path.substring(0,u.end)}))});return function(a,s){return i.apply(this,arguments)}}()});prevFilePath(){this.currentFilePathIndex()>0&&this.currentFilePathIndex.update(t=>t-1)}nextFilePath(){this.currentFilePathIndex()<this.fileLocations().length-1&&this.currentFilePathIndex.update(t=>t+1)}filePathHighlights=(0,p.EW)(()=>this.filePathEntities().map(t=>({path:t.path,start:t.startIndex,end:t.endIndex,label:this.availableEntityCategories().find(n=>n.iri===t.entityCategory)?.label??t.entityCategory.split("/").pop()??t.entityCategory})));entityCategoryLabelMap=(0,p.EW)(()=>this.availableEntityCategories().reduce((t,n)=>(t[n.iri]=n.label,t),{}));onTextSelected(t){this._pendingSelection.set(t),this._entityCategoryModalVisible.set(!0)}onEntityMentionConfirm(t){const n=this._pendingSelection();n&&(this.filePathEntities.update(i=>[...i,...t.paths.map(a=>({path:a.path,entityCategory:t.entityCategory,startIndex:n.start,endIndex:n.end}))]),this.filePathEntityAdded.emit({paths:t.paths,start:n.start,end:n.end,text:n.text,entityCategory:t.entityCategory,folderPath:n.path.substring(0,n.end)}),this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null))}onEntityMentionCancel(){this._entityCategoryModalVisible.set(!1),this._pendingSelection.set(null)}_contentCategories=(0,p.uu)(()=>this.contentCategories());contentCategoriesString=(0,p.EW)(()=>this._contentCategories().map(t=>this._iriToString(t)).sort().join(", "));_iriToString(t){const n=this.availableContentCategories()?.find(i=>i.iri===t);return n?n.label:t}infoChangeContentCategory=(0,y.Xx)("components.documentInfo.infoChangeContentCategory");rdfEditConfig=(0,p.EW)(()=>{var t=this;const n=this.handlers()?.requestRDFChange;var i;if(void 0!==n)return{message:this.infoChangeContentCategory(),existingValue:this._contentCategories(),dataType:"multiselect",options:this.availableContentCategories()?.map(i=>i.iri),optionLabelMap:this.availableContentCategories()?.reduce((i,a)=>(i[a.iri]=a.label,i),{}),requestSave:(i=(0,_.A)(function*(a){console.log(a);const s={subject:t.subject(),predicate:`${M.E.qcy}contentCategory`,objects:t._contentCategories(),newObjects:a.newValue,type:"contentCategory",comment:a.comment};yield n(s),t._contentCategories.set(a.newValue),t.dataChanged.emit({contentCategories:a.newValue})}),function(s){return i.apply(this,arguments)})};console.warn("No RDF change request handler defined")});static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-info"]],inputs:{subject:[1,"subject"],handlers:[1,"handlers"],fileLocations:[1,"fileLocations"],filePathEntities:[1,"filePathEntities"],contentCategories:[1,"contentCategories"],contentCategoriesEditable:[1,"contentCategoriesEditable"],filePathEntitiesVisible:[1,"filePathEntitiesVisible"],filePathEntitiesEditable:[1,"filePathEntitiesEditable"],menuItems:[1,"menuItems"],availableContentCategories:[1,"availableContentCategories"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged",filePathEntityAdded:"filePathEntityAdded",filePathEntities:"filePathEntitiesChange"},decls:7,vars:4,consts:[["trigger",""],["direction","column",2,"min-height","50px"],["direction","row"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],[3,"selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"],["size","l",3,"key","val"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"],["size","s",3,"key","val","rdfConfig","editDisabled"],[1,"file-path-nav-container"],[1,"file-path-label"],["size","xs"],[1,"path-counter"],[1,"file-path-row"],["variant","tertiary","size","xs",3,"disabled"],["size","s",3,"textSelected","path","highlights","allowDelete","allowAdd"],["variant","tertiary","size","xs",3,"click","disabled"],["icon","paginator-back"],["icon","paginator-next"],[3,"confirm","cancel","selection","availableEntityCategories","fileLocations","requestFileLocations","requestFilePathEntityAdd"]],template:function(n,i){1&n&&(e.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2)(2,"cue-flexcontainer",3),e.nVh(3,se,2,1,"cue-key-val-list"),e.k0s(),e.nVh(4,le,6,1,"cue-flexcontainer",4),e.k0s(),e.nVh(5,ge,4,2,"cue-key-val-list"),e.k0s(),e.nVh(6,_e,1,5,"cue-entity-mention-modal",5)),2&n&&(e.R7$(3),e.vxM(i.fileLocations().length>0||i.subject()?3:-1),e.R7$(),e.vxM(i.menuItems().length>0?4:-1),e.R7$(),e.vxM(!i.collapsed()&&i.hasDocInfo()?5:-1),e.R7$(),e.vxM(i._entityCategoryModalVisible()&&i._pendingSelection()?6:-1))},dependencies:[v.n,E.p,r.F,C.L,P.W,R.T,V.a,j.$,W,g.Typography,ie,y.Kj],styles:[".file-path-nav-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.file-path-label[_ngcontent-%COMP%]{display:block;margin:0}.file-path-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin:0;overflow:visible;padding:1px}.file-path-row[_ngcontent-%COMP%] cue-file-path-viewer[_ngcontent-%COMP%]{flex:1;overflow:visible;min-width:0}.path-counter[_ngcontent-%COMP%]{opacity:.6}"],changeDetection:0})}return o})();class fe{requestRDFChange;requestFileLocations;requestFilePathEntityAdd}var pe=l(2065),ve=l(5187),ye=l(7293);const be=["viewerHost"];function Ce(o,m){if(1&o&&e.nrm(0,"cue-document-info",4),2&o){const t=e.XpG(2);e.Y8G("subject",t._docSubject())("handlers",t._docInfoHandlers)("menuItems",t._menuItems())}}function Me(o,m){1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography"),e.EFF(2,"Loading\u2026"),e.k0s()())}function xe(o,m){if(1&o&&(e.j41(0,"cue-flexcontainer",5)(1,"cue-typography",8),e.EFF(2),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(2),e.JRh(t.errorMessage())}}function Ee(o,m){if(1&o&&e.nrm(0,"cue-logo-link",7),2&o){const t=e.XpG(2);e.Y8G("projectId",t.projectId())("resourceId",t._uuidOnly())}}function De(o,m){if(1&o&&(e.j41(0,"div",3),e.nVh(1,Ce,1,3,"cue-document-info",4),e.nVh(2,Me,3,0,"cue-flexcontainer",5)(3,xe,3,1,"cue-flexcontainer",5),e.j41(4,"div",6),e.eu8(5,null,1),e.k0s(),e.nVh(7,Ee,1,2,"cue-logo-link",7),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.vxM(t.showDocumentInfo()&&"ready"===t.state()?1:-1),e.R7$(),e.vxM("loading"===t.state()?2:"error"===t.state()?3:-1),e.R7$(5),e.vxM(t.showLogo()?7:-1)}}function Pe(o,m){1&o&&e.eu8(0)}function we(o,m){if(1&o&&(e.j41(0,"cue-card",2),e.DNE(1,Pe,1,0,"ng-container",9),e.k0s()),2&o){const t=e.XpG(),n=e.sdS(1);e.Y8G("variant",t._cardVariant())("padded",!0),e.R7$(),e.Y8G("ngTemplateOutlet",n)}}function Re(o,m){1&o&&e.eu8(0)}function Fe(o,m){if(1&o&&e.DNE(0,Re,1,0,"ng-container",9),2&o){e.XpG();const t=e.sdS(1);e.Y8G("ngTemplateOutlet",t)}}const Ie=[".fragments",".dxf",".pdf",".png",".jpg",".jpeg",".svg",".gif",".webp",".bmp",".avif",".apng",".xlsx",".xls",".csv",".json",".jsonld",".xml",".css",".js",".html",".htm",".sh",".txt",".rst",".md"];let Oe=(()=>{class o{set _viewerHostRef(t){if(this._viewerHost=t,t&&this._lastRenderArgs){const{url:n,suffix:i,page:a,viewerTypeOverride:s}=this._lastRenderArgs;this._renderViewer(n,i,a,s)}}_viewerHost;_lastRenderArgs;currentViewerRef;cue=(0,c.hFB)(void 0);uuid=(0,c.hFB)(void 0);projectId=(0,c.hFB)(void 0);showDocumentInfo=(0,c.hFB)(!0,{transform:c.L39});showLogo=(0,c.hFB)(!1,{transform:c.L39});_uuidOnly=(0,p.EW)(()=>{const t=this.uuid();return t?t.split("?")[0].trim():void 0});extraMenuItems=(0,c.hFB)([]);portalBaseURL=(0,c.hFB)("https://cue.qaecy.com");variant=(0,c.hFB)("none");_cardVariant=(0,p.EW)(()=>this.variant());state=(0,d.vPA)("idle");errorMessage=(0,d.vPA)(null);resolvedUrl=(0,d.vPA)(null);resolvedSuffix=(0,d.vPA)(null);_docSubject=(0,d.vPA)("");_alternatives=(0,d.vPA)([]);_originalUuid=(0,d.vPA)(null);_originalDocSuffix=(0,d.vPA)(null);_cueSnapshot=null;_projectIdSnapshot=null;_inputWarningTimer;_blobUrls=new Set;_docInfoHandlers=new fe;_menuItems=(0,p.EW)(()=>{const t=[],n=this._originalUuid(),i=this._originalDocSuffix();n&&i&&t.push({icon:"download",label:"Download file",action:()=>this._downloadOriginal()});const a=this._alternatives();if(a.length>1){const s=this.resolvedSuffix();t.push({icon:"document",label:"Alternative representation",children:a.map(u=>({label:u.original?`Original (${u.suffix.replace(".","").toUpperCase()})`:u.suffix.replace(".","").toUpperCase(),tooltip:s===u.suffix?"Currently shown":void 0,action:()=>this._switchToAlternative(u)}))})}return t.push(...this.extraMenuItems()),t});constructor(){this._inputWarningTimer=setTimeout(()=>{this.cue()||console.warn('[cue-document-viewer] Required input "cue" is not set. Pass an authenticated Cue SDK instance.'),this.uuid()||console.warn('[cue-document-viewer] Required input "uuid" is not set. Pass the document UUID to display.'),this.projectId()||console.warn('[cue-document-viewer] Required input "projectId" is not set. Pass the Cue project ID the document belongs to.')},3e3),(0,d.QZP)(()=>{const t=this.cue(),n=this.uuid(),i=this.projectId();t&&n&&i?this._load(t,n,i):this.state.set("idle")})}ngOnDestroy(){clearTimeout(this._inputWarningTimer),this._blobUrls.forEach(t=>URL.revokeObjectURL(t))}_load(t,n,i){var a=this;return(0,_.A)(function*(){if(t&&n&&i){a.state.set("loading"),a.resolvedUrl.set(null),a.resolvedSuffix.set(null),a.errorMessage.set(null),a._docSubject.set(""),a._originalUuid.set(null),a._originalDocSuffix.set(null),a._alternatives.set([]),a._viewerHost?.clear(),a.currentViewerRef?.destroy(),a.currentViewerRef=void 0,a._lastRenderArgs=void 0;try{a._cueSnapshot=t,a._projectIdSnapshot=i;const{uuid:s,page:u}=function Te(o){const[m,t]=o.split("?"),n=m.trim();let i=null;if(t){const s=new URLSearchParams(t).get("page");if(null!==s){const u=parseInt(s,10);!isNaN(u)&&u>0&&(i=u)}}return{uuid:n,page:i}}(n),f=t.createProjectDocuments(i),F=(yield f.fetchDocumentData([s]))[s];if(!F)throw new Error(`Document '${s}' not found in project '${i}'.`);a._docSubject.set(F.subject??""),a._originalUuid.set(s),a._originalDocSuffix.set(F.suffix);const B=yield f.fetchAlternativeRepresentations(s);a._alternatives.set([{uuid:s,suffix:F.suffix,original:!0},...B.filter(N=>N.id!==s).map(N=>({uuid:N.id,suffix:N.suffix,original:!1,remoteRelativePath:N.remoteRelativePath}))]);const{uuid:L,suffix:S,remoteRelativePath:U}=function Le(o,m){const t=[o,...m];let n,i=1/0;for(const a of t){const s=Ie.indexOf(a.suffix);-1!==s&&s<i&&(i=s,n=a)}return n?{uuid:n.id,suffix:n.suffix,remoteRelativePath:n.remoteRelativePath}:{uuid:o.id,suffix:o.suffix}}(F,B),$=U?yield a._toBlobUrl(t,t.storage.getAltRepDownloadUrl(U)):yield a._toBlobUrl(t,t.storage.getDownloadUrl(i,L,S));a.resolvedUrl.set($),a.resolvedSuffix.set(S);const Ve=[".eml",".msg",".emlx",".mbx"].includes(F.suffix)&&".json"===S?"email":void 0;yield a._renderViewer($,S,u,Ve),a.state.set("ready")}catch(s){const u=s instanceof Error?s.message:String(s);console.error("[CueDocumentViewerWC] Failed to load document:",u),a.errorMessage.set(u),a.state.set("error")}}else a.state.set("idle")})()}_toBlobUrl(t,n){var i=this;return(0,_.A)(function*(){const a=yield t.auth.authenticatedFetch(n);if(!a.ok)throw new Error(`Failed to fetch document: ${a.status} ${a.statusText}`);const s=URL.createObjectURL(yield a.blob());return i._blobUrls.add(s),s})()}_renderViewer(t,n,i,a){var s=this;return(0,_.A)(function*(){try{const{DocumentViewer:u}=yield Promise.all([l.e(418),l.e(36)]).then(l.bind(l,3036)),{DocumentViewerSettings:f}=yield l.e(418).then(l.bind(l,3418));s._viewerHost?.clear(),s.currentViewerRef?.destroy();const T=new f;if(null!==i&&(T.pdf.page=String(i)),!s._viewerHost)throw new Error("viewerHost is not yet available \u2014 view has not been initialized.");s._lastRenderArgs={url:t,suffix:n,page:i,viewerTypeOverride:a},s.currentViewerRef=s._viewerHost.createComponent(u),s.currentViewerRef.setInput("url",t),s.currentViewerRef.setInput("suffix",n),s.currentViewerRef.setInput("settings",T),a&&s.currentViewerRef.setInput("viewerTypeOverride",a)}catch(u){throw new Error(`Failed to load viewer component: ${u instanceof Error?u.message:String(u)}`)}})()}_switchToAlternative(t){var n=this;return(0,_.A)(function*(){const i=n._cueSnapshot,a=n._projectIdSnapshot;if(i&&a)try{const s=t.remoteRelativePath?yield n._toBlobUrl(i,i.storage.getAltRepDownloadUrl(t.remoteRelativePath)):yield n._toBlobUrl(i,i.storage.getDownloadUrl(a,t.uuid,t.suffix));n.resolvedUrl.set(s),n.resolvedSuffix.set(t.suffix),yield n._renderViewer(s,t.suffix,null)}catch(s){console.error("[CueDocumentViewerWC] Failed to switch to alternative:",s)}})()}_downloadOriginal(){var t=this;return(0,_.A)(function*(){const n=t._cueSnapshot,i=t._projectIdSnapshot,a=t._originalUuid(),s=t._originalDocSuffix();if(n&&i&&a&&s)try{const u=yield n.storage.downloadBlob(i,a,s);(0,pe.KE)(u,`${a}${s}`)}catch(u){console.error("[CueDocumentViewerWC] Failed to download original:",u)}})()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=e.VBU({type:o,selectors:[["cue-document-viewer-wc"]],viewQuery:function(n,i){if(1&n&&e.GBs(be,5,e.c1b),2&n){let a;e.mGM(a=e.lsd())&&(i._viewerHostRef=a.first)}},inputs:{cue:[1,"cue"],uuid:[1,"uuid"],projectId:[1,"projectId"],showDocumentInfo:[1,"showDocumentInfo"],showLogo:[1,"showLogo"],extraMenuItems:[1,"extraMenuItems"],portalBaseURL:[1,"portalBaseURL"],variant:[1,"variant"]},decls:4,vars:1,consts:[["body",""],["viewerHost",""],[2,"height","100%","width","100%",3,"variant","padded"],[2,"display","flex","flex-direction","column","height","100%","width","100%","position","relative"],[3,"subject","handlers","menuItems"],["direction","column","align","center","justify","center",2,"flex","1","width","100%"],[2,"flex","1","min-height","0","overflow","hidden"],[2,"position","absolute","bottom","12px","right","12px","z-index","5",3,"projectId","resourceId"],[2,"color","#c44","font-size","13px"],[4,"ngTemplateOutlet"]],template:function(n,i){1&n&&(e.DNE(0,De,8,3,"ng-template",null,0,e.C5r),e.nVh(2,we,2,3,"cue-card",2)(3,Fe,1,1,"ng-container")),2&n&&(e.R7$(2),e.vxM("none"!==i.variant()?2:3))},dependencies:[h.MD,h.T3,v.n,g.Typography,me,ve.Z,ye.x],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return o})()},2065(O,w,l){function p(h,v,g="text/plain"){return function _(h,v="data.zip"){const g=document.createElement("a"),E=URL.createObjectURL(h);g.href=E,g.download=v,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(E)}(new Blob([h],{type:g}),v)}function d(h,v){const g=document.createElement("a");g.style.display="hidden",g.setAttribute("href",window.URL.createObjectURL(h)),g.setAttribute("download",v),document.body.appendChild(g),g.click(),g.remove()}l.d(w,{KE:()=>d,YN:()=>p})}}]);