@qaecy/cue-ui 0.0.40 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/799.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[613,799],{7293(f,_,s){s.d(_,{x:()=>v});var c=s(7705),r=s(5802),o=s(2271),m=s(4613),p=s(9352),a=s(5547);function g(e,i){1&e&&a.nrm(0,"cue-logo",4)}let v=(()=>{class e{projectId=(0,c.hFB)(void 0);resourceId=(0,c.hFB)(void 0);_active=(0,r.vPA)(!0);onHover(){this._active.set(!1),requestAnimationFrame(()=>this._active.set(!0))}_title=(0,o.EW)(()=>this.projectId()&&this.resourceId()?"components.logoLink.showResourceInCue":this.projectId()?"components.logoLink.openProjectInCue":"components.logoLink.openCuePortal");_href=(0,o.EW)(()=>{const t=this.projectId(),n=this.resourceId();return t&&n?`https://cue.qaecy.com/r/${encodeURIComponent(t)}/${encodeURIComponent(n)}`:t?`https://cue.qaecy.com/home/projects?p=${encodeURIComponent(t)}`:"https://cue.qaecy.com/home/projects"});static \u0275fac=function(n){return new(n||e)};static \u0275cmp=a.VBU({type:e,selectors:[["cue-logo-link"]],inputs:{projectId:[1,"projectId"],resourceId:[1,"resourceId"]},decls:6,vars:5,consts:[["target","_blank","rel","noopener noreferrer",1,"link",3,"mouseenter","href","title"],[1,"logo-stack"],["size","xs",1,"logo-bg"],[1,"logo-fg"],["size","xs"]],template:function(n,l){1&n&&(a.j41(0,"a",0),a.nI1(1,"transloco"),a.bIt("mouseenter",function(){return l.onHover()}),a.j41(2,"div",1),a.nrm(3,"cue-logo",2),a.j41(4,"div",3),a.nVh(5,g,1,0,"cue-logo",4),a.k0s()()()),2&n&&(a.Y8G("href",l._href(),a.B4B)("title",a.bMT(1,3,l._title())),a.R7$(5),a.vxM(l._active()?5:-1))},dependencies:[m.Logo,p.Kj],styles:["[_nghost-%COMP%]{display:inline-block;line-height:0}.link[_ngcontent-%COMP%]{display:block;text-decoration:none;cursor:pointer}.logo-stack[_ngcontent-%COMP%]{position:relative;display:inline-block;line-height:0}.logo-bg[_ngcontent-%COMP%]{display:block;opacity:.3;transition:opacity .2s ease}.link[_ngcontent-%COMP%]:hover .logo-bg[_ngcontent-%COMP%]{opacity:.15}.logo-fg[_ngcontent-%COMP%]{position:absolute;inset:0;opacity:0;transition:opacity .15s ease}.link[_ngcontent-%COMP%]:hover .logo-fg[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})}return e})()},4613(f,_,s){s.d(_,{Logo:()=>a});var c=s(7705),r=s(5802),o=s(5547),m=s(2271),p=s(6170);let a=(()=>{class g{size=(0,c.hFB)("m");sizeMap={xs:"40px",s:"80px",m:"160px",l:"222px"};active=(0,c.hFB)(!0,{transform:c.L39});continuous=(0,c.hFB)(!1,{transform:c.L39});mode=(0,c.hFB)("default");isDarkMode=(0,c.geq)(!1);handleDarkModeChange(e){this.isDarkMode.set(e),-1===this.raf&&this.animate()}colorA=(0,m.EW)(()=>this.isDarkMode()?[221,246,18]:[18,28,43]);colorB=[0,202,204];paths=[];raf=-1;appearTime=0;disappearTime=0;tip=0;toe=0;mix=[0,0,0];norm=0;animate=e=>{if(void 0!==e){const i=5e-4*(e-this.appearTime);"glow"===this.mode()?this.tip=i%1:(this.tip=Math.min(1,i),this.active()||(this.toe=Math.min(1,6e-4*(e-this.disappearTime))))}if("glow"===this.mode()){const i=.06666666666666667,t=this.rgbToSvg(this.colorA());return this.paths.forEach((n,l)=>{this.norm=1/this.paths.length*l;let h=this.tip-this.norm;if(h<-(1-i)&&(h+=1),h>=0&&h<i){const u=1-h/i;n.setAttribute("stroke",this.rgbToSvg(this.colorB)),n.setAttribute("stroke-opacity",u.toFixed(3))}else n.setAttribute("stroke",t),n.setAttribute("stroke-opacity","0.005")}),void(this.raf=requestAnimationFrame(this.animate))}if(this.paths.forEach((i,t)=>{this.norm=1/this.paths.length*t,this.mix=this.mixRgb(this.colorA(),this.colorB,Math.max(0,Math.min(1,15*(this.tip-this.norm)))),i.setAttribute("stroke",this.tip*this.paths.length>t&&(this.active()||this.toe*this.paths.length<t)?this.rgbToSvg(this.mix):"transparent")}),this.tip>=1&&(this.active()||this.toe>=1))return this.continuous()?void setTimeout(()=>{this.appearTime=performance.now(),this.tip=0,this.toe=0,this.raf=requestAnimationFrame(this.animate)},500):void(this.raf=-1);this.raf=requestAnimationFrame(this.animate)};activate(){this.appearTime=performance.now(),this.animate(this.appearTime)}deactivate(){this.disappearTime=performance.now(),-1===this.raf&&this.animate(this.disappearTime)}mixChannel(e,i,t){return parseInt((e*t+i*(1-t)).toFixed())}mixRgb(e,i,t){return[this.mixChannel(e[0],i[0],t),this.mixChannel(e[1],i[1],t),this.mixChannel(e[2],i[2],t)]}rgbToSvg(e){return`rgb(${e[0]},${e[1]},${e[2]})`}constructor(){(0,r.QZP)(()=>{"glow"===this.mode()||this.active()?this.activate():this.deactivate()}),(0,r.QZP)(()=>{this.isDarkMode(),this.animate()});const e=(0,r.WQX)(o.aKT);(0,o.mal)({read:()=>{if(this.paths.length)return;const i=e.nativeElement.querySelector("svg"),t=e.nativeElement.querySelector("#original-path");if(!t)return;const n=t.getTotalLength(),h=[];for(let u=0;u<400;u++){const d=t.getPointAtLength(n/400*u);h.push({x:parseFloat(d.x.toFixed(2)),y:parseFloat(d.y.toFixed(2))})}h.push(t.getPointAtLength(n)),h.reverse(),h.forEach((u,d)=>{if(0===d||1===d)return;const M=document.createElementNS("http://www.w3.org/2000/svg","path");M.setAttribute("d",`M${h[d-2].x},${h[d-2].y}L${h[d-1].x},${h[d-1].y}L${u.x},${u.y}`),M.setAttribute("fill","none"),M.setAttribute("stroke","transparent"),M.setAttribute("stroke-width",t?.getAttribute("stroke-width")||"1"),M.setAttribute("stroke-miterlimit",t?.getAttribute("stroke-miterlimit")||"1"),i.appendChild(M),this.paths.push(M)})}})}ngOnDestroy(){this.paths=[],cancelAnimationFrame(this.raf),this.raf=-1}static \u0275fac=function(i){return new(i||g)};static \u0275cmp=o.VBU({type:g,selectors:[["cue-logo"]],hostVars:2,hostBindings:function(i,t){2&i&&o.xc7("width",t.sizeMap[t.size()])},inputs:{size:[1,"size"],active:[1,"active"],continuous:[1,"continuous"],mode:[1,"mode"],isDarkMode:[1,"isDarkMode"]},outputs:{isDarkMode:"isDarkModeChange"},decls:2,vars:0,consts:[["cueDarkMode","","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 221.545 86.191","width","222","height","86","overflow","visible",3,"darkModeChange"],["id","original-path","fill","none","stroke","transparent","stroke-miterlimit","10","stroke-width","12","d","M216.046 56.638s-10.561 24.201-36.192 22.991c-25.631-1.21-22.771-24.751-20.351-37.622 2.42-12.871 10.451-20.351 16.831-18.041 6.283 2.275 8.03 9.68 2.09 21.891-5.94 12.211-21.341 37.567-35.862 33.992-12.413-3.056-13.281-23.162-13.281-23.162V29.762v26.925c0 14.471-12.47 23.212-24.672 23.212s-24.672-8.301-24.672-23.212V29.829l-.006.105v13.031c0 20.416-16.55 36.966-36.966 36.966S6 63.381 6 42.966 22.55 6 42.966 6c6.91 0 13.377 1.896 18.91 5.196"]],template:function(i,t){1&i&&(r.qSk(),o.j41(0,"svg",0),o.bIt("darkModeChange",function(l){return t.handleDarkModeChange(l)}),o.nrm(1,"path",1),o.k0s())},dependencies:[p.R],styles:["[_nghost-%COMP%]{display:block}svg[_ngcontent-%COMP%]{flex:1;display:block;width:100%;height:auto}"]})}return g})()},6170(f,_,s){s.d(_,{R:()=>p});var c=s(7705),r=s(5802),o=s(2271),m=s(5547);let p=(()=>{class a{destroyRef=(0,r.WQX)(r.abz);_isDarkMode=(0,r.vPA)(this.hasDarkClass());isDarkMode=(0,o.EW)(()=>this._isDarkMode());darkModeChange=(0,c.CGW)();constructor(){const v=new MutationObserver(e=>{e.forEach(i=>{if("attributes"===i.type&&"class"===i.attributeName){const t=this.hasDarkClass();t!==this._isDarkMode()&&this._isDarkMode.set(t)}})});v.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.destroyRef.onDestroy(()=>v.disconnect()),(0,r.QZP)(()=>{this.darkModeChange.emit(this._isDarkMode()),document.documentElement.style.colorScheme=this._isDarkMode()?"dark":"light"})}hasDarkClass(){return document.body.classList.contains("dark")}toggleDarkMode(){document.body.classList.toggle("dark")}static \u0275fac=function(e){return new(e||a)};static \u0275dir=m.FsC({type:a,selectors:[["","cueDarkMode",""]],outputs:{darkModeChange:"darkModeChange"},exportAs:["darkModeDetector"]})}return a})()},7851(f,_,s){s.d(_,{k:()=>v});var c=s(7705),r=s(5802),o=s(5547),m=s(4613),p=s(2245);function a(e,i){if(1&e&&(o.j41(0,"cue-typography",1),o.EFF(1),o.k0s()),2&e){const t=o.XpG();o.R7$(),o.JRh(t.message)}}let g=(()=>{class e{message="";static \u0275fac=function(n){return new(n||e)};static \u0275cmp=o.VBU({type:e,selectors:[["cue-logo-loader-overlay"]],decls:2,vars:1,consts:[["size","m","mode","glow"],["size","s",1,"message"]],template:function(n,l){1&n&&(o.nrm(0,"cue-logo",0),o.nVh(1,a,2,1,"cue-typography",1)),2&n&&(o.R7$(),o.vxM(l.message?1:-1))},dependencies:[m.Logo,p.Typography],styles:["[_nghost-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;z-index:1000;pointer-events:none}.message[_ngcontent-%COMP%]{color:var(--color-text-secondary)}"],changeDetection:0})}return e})(),v=(()=>{class e{cueLogoLoader=(0,c.hFB)(!1);cueLogoLoaderMessage=(0,c.hFB)("");el=(0,r.WQX)(o.aKT);appRef=(0,r.WQX)(o.o8S);envInjector=(0,r.WQX)(r.uvJ);renderer=(0,r.WQX)(o.sFG);overlayRef;constructor(){(0,r.QZP)(()=>{const t=this.cueLogoLoader(),n=this.cueLogoLoaderMessage();t?(this.overlayRef||this.createOverlay(),this.overlayRef&&(this.overlayRef.instance.message=n,this.overlayRef.changeDetectorRef.markForCheck())):this.destroyOverlay()})}createOverlay(){this.overlayRef=(0,c.a0P)(g,{environmentInjector:this.envInjector}),this.appRef.attachView(this.overlayRef.hostView),this.renderer.appendChild(this.el.nativeElement,this.overlayRef.hostView.rootNodes[0])}destroyOverlay(){this.overlayRef&&(this.appRef.detachView(this.overlayRef.hostView),this.overlayRef.destroy(),this.overlayRef=void 0)}ngOnDestroy(){this.destroyOverlay()}static \u0275fac=function(n){return new(n||e)};static \u0275dir=o.FsC({type:e,selectors:[["","cueLogoLoader",""]],hostVars:2,hostBindings:function(n,l){2&n&&o.xc7("position","relative")},inputs:{cueLogoLoader:[1,"cueLogoLoader"],cueLogoLoaderMessage:[1,"cueLogoLoaderMessage"]}})}return e})()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[137],{5137(F,B,a){a.d(B,{BlockProjectDocuments:()=>L});var v=a(467),f=a(7705),r=a(5802),u=a(2271),y=a(6114),_=a(7993),C=a(3615),D=a(1493),S=a(9352),P=a(2245),z=a(5381),t=a(5547);const R=i=>({percent:i}),T=i=>({count:i});function O(i,d){if(1&i){const e=t.RV6();t.j41(0,"cue-block-documents-by-suffix",11),t.bIt("navigated",function(c){r.eBV(e);const s=t.XpG();return r.Njj(s.handleNavigated(c))}),t.k0s()}if(2&i){t.XpG();const e=t.r8f(2),n=t.r8f(4);t.Y8G("data",e)("config",n)}}function N(i,d){if(1&i){const e=t.RV6();t.j41(0,"cue-block-documents-by-content-category",11),t.bIt("navigated",function(c){r.eBV(e);const s=t.XpG();return r.Njj(s.handleNavigated(c))}),t.k0s()}if(2&i){t.XpG();const e=t.r8f(3),n=t.r8f(4);t.Y8G("data",e)("config",n)}}function E(i,d){if(1&i&&(t.nrm(0,"cue-typography",7),t.nI1(1,"transloco")),2&i){const e=t.XpG();t.Y8G("innerHTML",t.i5U(1,1,"components.contentBlocks.projectDocuments.pctOpenFormats",t.eq3(4,R,e.openFormatPct())),t.npT)}}function A(i,d){if(1&i){const e=t.RV6();t.j41(0,"cue-typography",12),t.nI1(1,"transloco"),t.bIt("click",function(){r.eBV(e);const c=t.XpG();return r.Njj(c.getDuplicates())}),t.k0s()}2&i&&t.Y8G("innerHTML",t.i5U(1,1,1===d?"components.contentBlocks.projectDocuments.duplicateFilesSingular":"components.contentBlocks.projectDocuments.duplicateFilesPlural",t.eq3(4,T,d)),t.npT)}function G(i,d){if(1&i&&(t.j41(0,"cue-typography",10),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.SpI("\u2696\ufe0f ",e.humanSize()," ")}}function $(i,d){if(1&i&&(t.j41(0,"cue-typography",10),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.E5c("",e.filterKey(),": ",e.humanSizeFiltered()," (",e.countFiltered(),")")}}let L=(()=>{class i{data=(0,f.hFB)(void 0);_data=(0,r.vPA)(void 0);constructor(){let e=null;(0,r.QZP)(()=>{const n=this.data();null!==e&&clearTimeout(e),(0,u.O8)(()=>this._data.set(n)),e=setTimeout(()=>{e=null,(0,u.O8)(()=>this._data.set(this.data()))},100)})}config=f.hFB.required();handlers=(0,u.EW)(()=>this.config().handlers);filterKey=(0,r.vPA)("");bySuffix=(0,u.EW)(()=>{const e=this._data();if(e?.documentsBySuffix&&0!==Object.keys(e.documentsBySuffix).length)return{documents:e.documentsBySuffix}});byContentCategory=(0,u.EW)(()=>{const e=this._data();if(e?.documentsByContentCategory&&0!==Object.keys(e.documentsByContentCategory).length)return{documents:e.documentsByContentCategory}});duplicateCount=(0,u.EW)(()=>this._data()?.duplicateCount??0);size=(0,u.EW)(()=>{const e=this._data();if(!e)return 0;const n=Object.values(e.documentsBySuffix||{}).reduce((s,o)=>s+(o?.size||0),0),c=Object.values(e.documentsByContentCategory||{}).reduce((s,o)=>s+(o?.size||0),0);return Math.max(n,c)});documentCount=(0,u.EW)(()=>{const e=this._data();if(!e)return 0;const n=Object.values(e.documentsBySuffix||{}).reduce((s,o)=>s+(o?.count||0),0),c=Object.values(e.documentsByContentCategory||{}).reduce((s,o)=>s+(o?.count||0),0);return Math.max(n,c)});sizeFiltered=(0,r.vPA)(0);countFiltered=(0,r.vPA)(0);humanSize=(0,u.EW)(()=>(0,D.b)(this.size()));humanSizeFiltered=(0,u.EW)(()=>(0,D.b)(this.sizeFiltered()));openFormatPct=(0,u.EW)(()=>{const e=this._data();if(!e?.documentsBySuffix)return 0;let n=0,c=0;for(const[o,l]of Object.entries(e.documentsBySuffix)){if(!l)continue;const g=Number(l.count||0);n+=g;const b=o.toLowerCase().trim(),x=b.startsWith(".")?b:`.${b}`;y.V[x]?.open&&(c+=g)}return n>0?Math.round(c/n*100):null});configWithFilterResolver=(0,u.EW)(()=>{var e=this;const n=this.config();return{...n,handlers:{...n.handlers,docListFilterRequest:(c=(0,v.A)(function*(s,o){if(console.log("[ProjectDocuments] docListFilterRequest",s,o),!o||0===o.length)return;const l="contentCat"===s?(i=>{const d=i.split("#").pop()??i,e={AgreementDocument:"Agreement",ArchitecturalDesignDocument:"Architectural Design",AsBuiltDocument:"As-Built",BudgetEstimateDocument:"Budget Estimate",CertificationDocument:"Certification",ComplianceDocument:"Compliance",CorrespondenceDocument:"Correspondence",ConstructionContract:"Construction Contract",ConstructionProcessDocument:"Construction Process",ContractCondition:"Contract Condition",ContractRole:"Contract Role",ContractualDocument:"Contract",CostControlDocument:"Cost Control",DesignDocument:"Design Document",EmailAddress:"Email Address",EngineeringDesignDocument:"Engineering Design",FinancialAdministrativeDocument:"Financial/Administrative",FunctionalRequirementsDocument:"Functional Requirements",InspectionDocument:"Inspection",InsuranceBondDocument:"Insurance/Bond",InteriorDesignDocument:"Interior Design",MarketingCloseoutDocument:"Marketing Closeout",MiscDocument:"Miscellaneous",OperationManual:"Operation Manual",OperationsMaintenanceDocument:"Operations & Maintenance",OperationsManualDocument:"Operations Manual",OtherDocument:"Other",OtherContent:"Other Content",ProgressStatusReport:"Progress Status Report",QualityAssuranceDocument:"Quality Assurance",QualityControlDocument:"Quality Control",RegulatoryComplianceDocument:"Regulatory Compliance",SafetyDocument:"Safety",ScheduleDocument:"Schedule",SiteAssessmentDocument:"Site Assessment",TechnicalRequirementsDocument:"Technical Requirements",TechnicalSpecificationDocument:"Technical Specification",TenderingDocument:"Tendering Document",TermsAndConditionsDocument:"Terms & Conditions"};return void 0===e[d]&&console.log(`No pretty label for category: ${d}`),e[d]??d})(o[0]):o[0];if(e.filterKey.set(l),"suffix"===s){const m=e._data()?.documentsBySuffix;if(m){const M=o.reduce((h,p)=>h+(m[p.toLowerCase()]?.size||0),0),k=o.reduce((h,p)=>h+(m[p.toLowerCase()]?.count||0),0);e.sizeFiltered.set(M),e.countFiltered.set(k)}}else if("contentCat"===s){const m=e._data()?.documentsByContentCategory;if(m){const M=o.reduce((h,p)=>h+(m[p]?.size||0),0),k=o.reduce((h,p)=>h+(m[p]?.count||0),0);e.sizeFiltered.set(M),e.countFiltered.set(k)}}const g=n.handlers?.requestDocumentsByFilter;if(!g)return void console.warn("No requestDocumentsByFilter handler defined");const x=yield g([{type:"suffix"===s?"suffix":"content",included:o,excluded:[]}]);return{ids:x.map(m=>({id:m})),totalCount:x.length}}),function(o,l){return c.apply(this,arguments)})}};var c});handleNavigated(e){if(!e)return this.sizeFiltered.set(0),this.countFiltered.set(0),void this.filterKey.set("");this.filterKey.set(e.label);const n=this._data();if(!n)return;let c=0,s=0;if("suffix"===e.filterBy){const o=n.documentsBySuffix;e.values.forEach(l=>{const g=l.toLowerCase();c+=o[g]?.size||0,s+=o[g]?.count||0})}else if("contentCat"===e.filterBy){const o=n.documentsByContentCategory;e.values.forEach(l=>{c+=o[l]?.size||0,s+=o[l]?.count||0})}this.sizeFiltered.set(c),this.countFiltered.set(s)}handleCanvasClick(){this.sizeFiltered.set(0),this.countFiltered.set(0)}getDuplicates(){var e=this;return(0,v.A)(function*(){const n=e.handlers()?.subsequentBlockRequest;if(void 0===n)return void console.warn("No handler for subsequent block request");const c=e.handlers()?.documentDuplicatesRequest;if(!c)return void console.warn("No documentDuplicatesRequest handler defined");const s=yield c();n({id:"document-duplicates",config:e.config(),data:s,focusOnAdd:!0},"Duplicates",!0)})()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-block-project-documents"]],inputs:{data:[1,"data"],config:[1,"config"]},decls:19,vars:13,consts:[["direction","column"],[1,"container",3,"click"],["id","chart-1",1,"chart"],[3,"data","config"],["id","chart-2",1,"chart"],["direction","column","align","center",1,"stats"],[1,"stat-line"],["size","l",3,"innerHTML"],["size","l",1,"clickable",3,"innerHTML"],["direction","column","align","center",1,"sizes"],["size","l"],[3,"navigated","data","config"],["size","l",1,"clickable",3,"click","innerHTML"]],template:function(n,c){if(1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"div",1),t.bIt("click",function(){return c.handleCanvasClick()}),t.SS7(2)(3)(4),t.j41(5,"div",2),t.nVh(6,O,1,2,"cue-block-documents-by-suffix",3),t.k0s(),t.j41(7,"div",4),t.nVh(8,N,1,2,"cue-block-documents-by-content-category",3),t.k0s(),t.j41(9,"cue-flexcontainer",5)(10,"div",6),t.nVh(11,E,2,6,"cue-typography",7),t.k0s(),t.j41(12,"div",6),t.nVh(13,A,2,6,"cue-typography",8),t.k0s()(),t.j41(14,"cue-flexcontainer",9)(15,"div",6),t.nVh(16,G,2,1,"cue-typography",10),t.k0s(),t.j41(17,"div",6),t.nVh(18,$,2,3,"cue-typography",10),t.k0s()()()()),2&n){let s;t.R7$(2);const o=t.bH3(c.bySuffix());t.R7$();const l=t.bH3(c.byContentCategory());t.R7$(),t.bH3(c.configWithFilterResolver()),t.R7$(),t.xc7("opacity",o?1:0),t.R7$(),t.vxM(o?6:-1),t.R7$(),t.xc7("opacity",l?1:0),t.R7$(),t.vxM(l?8:-1),t.R7$(3),t.vxM(null!==c.openFormatPct()?11:-1),t.R7$(2),t.vxM((s=c.duplicateCount())?13:-1,s),t.R7$(3),t.vxM(c.size()>0?16:-1),t.R7$(2),t.vxM(c.sizeFiltered()>0?18:-1)}},dependencies:[P.Typography,z.n,_.o,C.Y,S.Kj],styles:[".container[_ngcontent-%COMP%]{height:700px;width:100%;position:relative;overflow:hidden}.chart[_ngcontent-%COMP%]{position:absolute;width:470px;height:350px;transition:opacity .5s ease-in-out}#chart-1[_ngcontent-%COMP%]{top:20px;left:0}#chart-2[_ngcontent-%COMP%]{bottom:50px;right:0}.stats[_ngcontent-%COMP%]{position:absolute;right:230px;top:180px;transform:translate(50%);min-height:80px;justify-content:center}.sizes[_ngcontent-%COMP%]{position:absolute;left:230px;bottom:180px;transform:translate(-50%);min-height:80px;justify-content:center}.stat-line[_ngcontent-%COMP%]{height:32px;display:flex;align-items:center;justify-content:center}.clickable[_ngcontent-%COMP%]:hover{cursor:pointer;transform:scale(1.05)}"],changeDetection:0})}return i})()},1493(F,B,a){function v(f,r=!1,u=1){const y=r?1e3:1024;if(Math.abs(f)<y)return f+" B";const _=r?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let C=-1;const D=10**u;do{f/=y,++C}while(Math.round(Math.abs(f)*D)/D>=y&&C<_.length-1);return f.toFixed(u)+" "+_[C]}a.d(B,{b:()=>v})}}]);
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[802],{5137(R,v,a){a.d(v,{BlockProjectDocuments:()=>G});var _=a(467),d=a(7705),u=a(5802),r=a(2271),D=a(6114),g=a(7993),M=a(3615),h=a(1493),k=a(9352),B=a(2245),S=a(5381),t=a(5547);const E=i=>({percent:i}),z=i=>({count:i});function O(i,m){if(1&i){const e=t.RV6();t.j41(0,"cue-block-documents-by-suffix",11),t.bIt("navigated",function(c){u.eBV(e);const s=t.XpG();return u.Njj(s.handleNavigated(c))}),t.k0s()}if(2&i){t.XpG();const e=t.r8f(2),n=t.r8f(4);t.Y8G("data",e)("config",n)}}function T(i,m){if(1&i){const e=t.RV6();t.j41(0,"cue-block-documents-by-content-category",11),t.bIt("navigated",function(c){u.eBV(e);const s=t.XpG();return u.Njj(s.handleNavigated(c))}),t.k0s()}if(2&i){t.XpG();const e=t.r8f(3),n=t.r8f(4);t.Y8G("data",e)("config",n)}}function N(i,m){if(1&i&&(t.nrm(0,"cue-typography",7),t.nI1(1,"transloco")),2&i){const e=t.XpG();t.Y8G("innerHTML",t.i5U(1,1,"components.contentBlocks.projectDocuments.pctOpenFormats",t.eq3(4,E,e.openFormatPct())),t.npT)}}function A(i,m){if(1&i){const e=t.RV6();t.j41(0,"cue-typography",12),t.nI1(1,"transloco"),t.bIt("click",function(){u.eBV(e);const c=t.XpG();return u.Njj(c.getDuplicates())}),t.k0s()}2&i&&t.Y8G("innerHTML",t.i5U(1,1,1===m?"components.contentBlocks.projectDocuments.duplicateFilesSingular":"components.contentBlocks.projectDocuments.duplicateFilesPlural",t.eq3(4,z,m)),t.npT)}function W(i,m){if(1&i&&(t.j41(0,"cue-typography",10),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.SpI("\u2696\ufe0f ",e.humanSize()," ")}}function L(i,m){if(1&i&&(t.j41(0,"cue-typography",10),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.E5c("",e.filterKey(),": ",e.humanSizeFiltered()," (",e.countFiltered(),")")}}let G=(()=>{class i{data=(0,d.hFB)(void 0);_data=(0,u.vPA)(void 0);constructor(){let e=null;(0,u.QZP)(()=>{const n=this.data();null!==e&&clearTimeout(e),(0,r.O8)(()=>this._data.set(n)),e=setTimeout(()=>{e=null,(0,r.O8)(()=>this._data.set(this.data()))},100)})}config=d.hFB.required();handlers=(0,r.EW)(()=>this.config().handlers);filterKey=(0,u.vPA)("");bySuffix=(0,r.EW)(()=>{const e=this._data();if(e?.documentsBySuffix&&0!==Object.keys(e.documentsBySuffix).length)return{documents:e.documentsBySuffix}});byContentCategory=(0,r.EW)(()=>{const e=this._data();if(e?.documentsByContentCategory&&0!==Object.keys(e.documentsByContentCategory).length)return{documents:e.documentsByContentCategory}});duplicateCount=(0,r.EW)(()=>this._data()?.duplicateCount??0);size=(0,r.EW)(()=>{const e=this._data();if(!e)return 0;const n=Object.values(e.documentsBySuffix||{}).reduce((s,o)=>s+(o?.size||0),0),c=Object.values(e.documentsByContentCategory||{}).reduce((s,o)=>s+(o?.size||0),0);return Math.max(n,c)});documentCount=(0,r.EW)(()=>{const e=this._data();if(!e)return 0;const n=Object.values(e.documentsBySuffix||{}).reduce((s,o)=>s+(o?.count||0),0),c=Object.values(e.documentsByContentCategory||{}).reduce((s,o)=>s+(o?.count||0),0);return Math.max(n,c)});sizeFiltered=(0,u.vPA)(0);countFiltered=(0,u.vPA)(0);humanSize=(0,r.EW)(()=>(0,h.b)(this.size()));humanSizeFiltered=(0,r.EW)(()=>(0,h.b)(this.sizeFiltered()));openFormatPct=(0,r.EW)(()=>{const e=this._data();if(!e?.documentsBySuffix)return 0;let n=0,c=0;for(const[o,l]of Object.entries(e.documentsBySuffix)){if(!l)continue;const p=Number(l.count||0);n+=p;const x=o.toLowerCase().trim(),F=x.startsWith(".")?x:`.${x}`;D.V[F]?.open&&(c+=p)}return n>0?Math.round(c/n*100):null});configWithFilterResolver=(0,r.EW)(()=>{var e=this;const n=this.config();return{...n,handlers:{...n.handlers,docListFilterRequest:(c=(0,_.A)(function*(s,o){if(console.log("[ProjectDocuments] docListFilterRequest",s,o),!o||0===o.length)return;const l="contentCat"===s?(i=>{const m=i.split("#").pop()??i,e={AgreementDocument:"Agreement",ArchitecturalDesignDocument:"Architectural Design",AsBuiltDocument:"As-Built",BudgetEstimateDocument:"Budget Estimate",CertificationDocument:"Certification",ComplianceDocument:"Compliance",CorrespondenceDocument:"Correspondence",ConstructionContract:"Construction Contract",ConstructionProcessDocument:"Construction Process",ContractCondition:"Contract Condition",ContractRole:"Contract Role",ContractualDocument:"Contract",CostControlDocument:"Cost Control",DesignDocument:"Design Document",EmailAddress:"Email Address",EngineeringDesignDocument:"Engineering Design",FinancialAdministrativeDocument:"Financial/Administrative",FunctionalRequirementsDocument:"Functional Requirements",InspectionDocument:"Inspection",InsuranceBondDocument:"Insurance/Bond",InteriorDesignDocument:"Interior Design",MarketingCloseoutDocument:"Marketing Closeout",MiscDocument:"Miscellaneous",OperationManual:"Operation Manual",OperationsMaintenanceDocument:"Operations & Maintenance",OperationsManualDocument:"Operations Manual",OtherDocument:"Other",OtherContent:"Other Content",ProgressStatusReport:"Progress Status Report",QualityAssuranceDocument:"Quality Assurance",QualityControlDocument:"Quality Control",RegulatoryComplianceDocument:"Regulatory Compliance",SafetyDocument:"Safety",ScheduleDocument:"Schedule",SiteAssessmentDocument:"Site Assessment",TechnicalRequirementsDocument:"Technical Requirements",TechnicalSpecificationDocument:"Technical Specification",TenderingDocument:"Tendering Document",TermsAndConditionsDocument:"Terms & Conditions"};return void 0===e[m]&&console.log(`No pretty label for category: ${m}`),e[m]??m})(o[0]):o[0];if(e.filterKey.set(l),"suffix"===s){const f=e._data()?.documentsBySuffix;if(f){const j=o.reduce((C,y)=>C+(f[y.toLowerCase()]?.size||0),0),P=o.reduce((C,y)=>C+(f[y.toLowerCase()]?.count||0),0);e.sizeFiltered.set(j),e.countFiltered.set(P)}}else if("contentCat"===s){const f=e._data()?.documentsByContentCategory;if(f){const j=o.reduce((C,y)=>C+(f[y]?.size||0),0),P=o.reduce((C,y)=>C+(f[y]?.count||0),0);e.sizeFiltered.set(j),e.countFiltered.set(P)}}const p=n.handlers?.requestDocumentsByFilter;if(!p)return void console.warn("No requestDocumentsByFilter handler defined");const F=yield p([{type:"suffix"===s?"suffix":"content",included:o,excluded:[]}]);return{ids:F.map(f=>({id:f})),totalCount:F.length}}),function(o,l){return c.apply(this,arguments)})}};var c});handleNavigated(e){if(!e)return this.sizeFiltered.set(0),this.countFiltered.set(0),void this.filterKey.set("");this.filterKey.set(e.label);const n=this._data();if(!n)return;let c=0,s=0;if("suffix"===e.filterBy){const o=n.documentsBySuffix;e.values.forEach(l=>{const p=l.toLowerCase();c+=o[p]?.size||0,s+=o[p]?.count||0})}else if("contentCat"===e.filterBy){const o=n.documentsByContentCategory;e.values.forEach(l=>{c+=o[l]?.size||0,s+=o[l]?.count||0})}this.sizeFiltered.set(c),this.countFiltered.set(s)}handleCanvasClick(){this.sizeFiltered.set(0),this.countFiltered.set(0)}getDuplicates(){var e=this;return(0,_.A)(function*(){const n=e.handlers()?.subsequentBlockRequest;if(void 0===n)return void console.warn("No handler for subsequent block request");const c=e.handlers()?.documentDuplicatesRequest;if(!c)return void console.warn("No documentDuplicatesRequest handler defined");const s=yield c();n({id:"document-duplicates",config:e.config(),data:s,focusOnAdd:!0},"Duplicates",!0)})()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=t.VBU({type:i,selectors:[["cue-block-project-documents"]],inputs:{data:[1,"data"],config:[1,"config"]},decls:19,vars:13,consts:[["direction","column"],[1,"container",3,"click"],["id","chart-1",1,"chart"],[3,"data","config"],["id","chart-2",1,"chart"],["direction","column","align","center",1,"stats"],[1,"stat-line"],["size","l",3,"innerHTML"],["size","l",1,"clickable",3,"innerHTML"],["direction","column","align","center",1,"sizes"],["size","l"],[3,"navigated","data","config"],["size","l",1,"clickable",3,"click","innerHTML"]],template:function(n,c){if(1&n&&(t.j41(0,"cue-flexcontainer",0)(1,"div",1),t.bIt("click",function(){return c.handleCanvasClick()}),t.SS7(2)(3)(4),t.j41(5,"div",2),t.nVh(6,O,1,2,"cue-block-documents-by-suffix",3),t.k0s(),t.j41(7,"div",4),t.nVh(8,T,1,2,"cue-block-documents-by-content-category",3),t.k0s(),t.j41(9,"cue-flexcontainer",5)(10,"div",6),t.nVh(11,N,2,6,"cue-typography",7),t.k0s(),t.j41(12,"div",6),t.nVh(13,A,2,6,"cue-typography",8),t.k0s()(),t.j41(14,"cue-flexcontainer",9)(15,"div",6),t.nVh(16,W,2,1,"cue-typography",10),t.k0s(),t.j41(17,"div",6),t.nVh(18,L,2,3,"cue-typography",10),t.k0s()()()()),2&n){let s;t.R7$(2);const o=t.bH3(c.bySuffix());t.R7$();const l=t.bH3(c.byContentCategory());t.R7$(),t.bH3(c.configWithFilterResolver()),t.R7$(),t.xc7("opacity",o?1:0),t.R7$(),t.vxM(o?6:-1),t.R7$(),t.xc7("opacity",l?1:0),t.R7$(),t.vxM(l?8:-1),t.R7$(3),t.vxM(null!==c.openFormatPct()?11:-1),t.R7$(2),t.vxM((s=c.duplicateCount())?13:-1,s),t.R7$(3),t.vxM(c.size()>0?16:-1),t.R7$(2),t.vxM(c.sizeFiltered()>0?18:-1)}},dependencies:[B.Typography,S.n,g.o,M.Y,k.Kj],styles:[".container[_ngcontent-%COMP%]{height:700px;width:100%;position:relative;overflow:hidden}.chart[_ngcontent-%COMP%]{position:absolute;width:470px;height:350px;transition:opacity .5s ease-in-out}#chart-1[_ngcontent-%COMP%]{top:20px;left:0}#chart-2[_ngcontent-%COMP%]{bottom:50px;right:0}.stats[_ngcontent-%COMP%]{position:absolute;right:230px;top:180px;transform:translate(50%);min-height:80px;justify-content:center}.sizes[_ngcontent-%COMP%]{position:absolute;left:230px;bottom:180px;transform:translate(-50%);min-height:80px;justify-content:center}.stat-line[_ngcontent-%COMP%]{height:32px;display:flex;align-items:center;justify-content:center}.clickable[_ngcontent-%COMP%]:hover{cursor:pointer;transform:scale(1.05)}"],changeDetection:0})}return i})()},6170(R,v,a){a.d(v,{R:()=>D});var _=a(7705),d=a(5802),u=a(2271),r=a(5547);let D=(()=>{class g{destroyRef=(0,d.WQX)(d.abz);_isDarkMode=(0,d.vPA)(this.hasDarkClass());isDarkMode=(0,u.EW)(()=>this._isDarkMode());darkModeChange=(0,_.CGW)();constructor(){const h=new MutationObserver(b=>{b.forEach(k=>{if("attributes"===k.type&&"class"===k.attributeName){const B=this.hasDarkClass();B!==this._isDarkMode()&&this._isDarkMode.set(B)}})});h.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.destroyRef.onDestroy(()=>h.disconnect()),(0,d.QZP)(()=>{this.darkModeChange.emit(this._isDarkMode()),document.documentElement.style.colorScheme=this._isDarkMode()?"dark":"light"})}hasDarkClass(){return document.body.classList.contains("dark")}toggleDarkMode(){document.body.classList.toggle("dark")}static \u0275fac=function(b){return new(b||g)};static \u0275dir=r.FsC({type:g,selectors:[["","cueDarkMode",""]],outputs:{darkModeChange:"darkModeChange"},exportAs:["darkModeDetector"]})}return g})()},1493(R,v,a){function _(d,u=!1,r=1){const D=u?1e3:1024;if(Math.abs(d)<D)return d+" B";const g=u?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let M=-1;const h=10**r;do{d/=D,++M}while(Math.round(Math.abs(d)*h)/h>=D&&M<g.length-1);return d.toFixed(r)+" "+g[M]}a.d(v,{b:()=>_})}}]);