1"use strict";(self.webpackChunkCloudRadial=self.webpackChunkCloudRadial||[]).push([[9215],{99215:(W,m,a)=>{a.r(m),a.d(m,{KnowledgeBaseComponent:()=>O});var r=a(99327),p=a(60177),f=a(6744),C=a(35867),v=a(14620),u=a(89417),k=a(8524),c=a(54397),b=a(54106),g=a(54281),e=a(54438),y=a(75417);let _=(()=>{class o{static{this.basePath="api/articles"}constructor(t,i){this.dataService=t,this.userService=i}getArticles(){const t=new c.Yj;return this.dataService.get(t,`${o.basePath}/summary`)}getArticle(t){const i=new c.Yj;return i.filters="id",i.conditions="eq",i.values=t.toString(),this.dataService.get(i,o.basePath)}getRelatedArticled(t){const i=new c.Yj;return i.filters="id",i.conditions="eq",i.values=t.toString(),this.dataService.get(i,`${o.basePath}/view`),this.dataService.get(i,`${o.basePath}/similar`)}postArticleFeedback(t,i){return this.dataService.post({companyId:this.userService.UserProfile.company.companyId,rating:i,articleId:t},`${o.basePath}/feedback`)}getTypedFeedback(t){const i=new c.Yj;return i.filters="updateKey^companyId",i.values=t.updateKey+"^"+this.userService.UserProfile.company.companyId,this.dataService.get(i,`${o.basePath}/feedback`)}static{this.\u0275fac=function(i){return new(i||o)(e.KVO(c.jK),e.KVO(c.DL))}}static{this.\u0275prov=e.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var A=a(81548),F=a(73076),w=a(58544),R=a(47220);const j=()=>[1,2,3,4,5,6];function x(o,s){if(1&o&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.SpI(" ~by ",t.displayArticle.author,"")}}function B(o,s){1&o&&(e.j41(0,"div",13),e.nrm(1,"div",14),e.k0s())}function S(o,s){1&o&&(e.j41(0,"div",6),e.Z7z(1,B,2,0,"div",13,e.fX1),e.k0s()),2&o&&(e.R7$(),e.Dyx(e.lJ4(0,j)))}function $(o,s){if(1&o&&e.nrm(0,"pdfviewer",15),2&o){const t=e.XpG(2);e.Y8G("src",t.pdfSrc)("name",t.displayArticle.subject)("auth",!0)("showClose",!1)}}function I(o,s){if(1&o&&(e.nrm(0,"div",16),e.nI1(1,"SafeHtml")),2&o){const t=e.XpG(2);e.Y8G("innerHTML",e.bMT(1,1,t.displayArticle.body),e.npT)}}function M(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",19),e.bIt("click",function(){const l=e.eBV(t).$implicit,n=e.XpG(3);return e.Njj(n.openAttachment(l))}),e.j41(1,"span",20),e.EFF(2,"Download "),e.j41(3,"var"),e.EFF(4),e.k0s()(),e.j41(5,"span",21),e.EFF(6),e.k0s()()}if(2&o){const t=s.$implicit;e.R7$(4),e.JRh(t.name),e.R7$(2),e.JRh(t.name)}}function T(o,s){if(1&o&&(e.j41(0,"div")(1,"div",17),e.EFF(2,"Attachments"),e.k0s(),e.j41(3,"div"),e.Z7z(4,M,7,2,"button",18,e.Vm6),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(4),e.Dyx(t.displayArticle.files)}}function X(o,s){if(1&o){const t=e.RV6();e.j41(0,"li")(1,"button",22),e.bIt("click",function(){const l=e.eBV(t).$implicit,n=e.XpG(3);return e.Njj(n.openRelated(l.id.toString()))}),e.EFF(2),e.k0s()()}if(2&o){const t=s.$implicit;e.R7$(),e.Y8G("title",t.summary),e.R7$(),e.SpI(" ",t.subject," ")}}function K(o,s){if(1&o&&(e.j41(0,"div")(1,"h6"),e.EFF(2,"Related Articles"),e.k0s(),e.j41(3,"ul"),e.Z7z(4,X,3,2,"li",null,e.Vm6),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(4),e.Dyx(t.relatedArticles)}}function E(o,s){if(1&o&&e.DNE(0,$,1,4,"pdfviewer",15)(1,I,2,3,"div",16)(2,T,6,0,"div")(3,K,6,0,"div"),2&o){const t=e.XpG();e.vxM(t.showPdf?0:1),e.R7$(2),e.vxM((null==t.displayArticle.files?null:t.displayArticle.files.length)>0?2:-1),e.R7$(),e.vxM((null==t.relatedArticles?null:t.relatedArticles.length)>0?3:-1)}}function G(o,s){if(1&o&&(e.j41(0,"div",10),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Lme(" ",t.displayArticle.articleFeedback.helpful," out of ",t.displayArticle.articleFeedback.total," users found this helpful ")}}let V=(()=>{class o{constructor(t,i,l,n,d,J,Q){this.activeModal=t,this.databaseService=i,this.userService=l,this.articlesService=n,this.huduService=d,this.browserutils=J,this.logRocketService=Q,this.title="Knowledge Article",this.showPdf=!1,this.pdfSrc="",this.relatedArticles=[],this.disableFeedback=!1,this.isLoading=!0}ngOnInit(){this.loadRelatedArticles(),this.loadMainArticle()}openAttachment(t){return this.browserutils.busyCursor(),this.databaseService.downloadFileNoAuth(t.viewUrl).subscribe(i=>{this.databaseService.downloadContent(i,t.name),this.browserutils.normalCursor()}),!1}loadRelatedArticles(){this.articlesService.getRelatedArticled(this.articleId).subscribe(t=>{this.relatedArticles=t.data?.length?t.data:[]})}loadMainArticle(){this.articlesService.getArticle(this.articleId).subscribe(t=>{const i=t.data?.[0];if(i)switch(this.displayArticle=i,this.isLoading=!1,i.articleSource){case b.f.Hudu:this.loadHuduArticle(i);break;case b.f.Url:this.loadPdf(i)}})}loadHuduArticle(t){const i=parseInt(t.externalArticleId);isNaN(i)||this.huduService.getArticleAndUpdateContent(i,t.id).subscribe(l=>{l?.content&&(this.displayArticle.body=l.content)})}loadPdf(t){t.url&&(this.showPdf=!0,this.pdfSrc=`/api/articles/pdf?f=id&c=eq&v=${t.id}`)}openRelated(t){const i=parseInt(t);return isNaN(i)||(this.articleId=i,this.isLoading=!0,this.showPdf=!1,this.relatedArticles=[],this.loadMainArticle(),this.loadRelatedArticles()),!1}closeModal(){this.activeModal.close()}helpfulFeedback(t){this.disableFeedback=!0,this.articlesService.postArticleFeedback(this.displayArticle.id,t?1:0).subscribe(l=>{const n=!0===l.data;n&&this.logRocketService.trackCustomEvent(g.hN.FeedbackSubmitted,{feedback_type:"kb_helpfulness"}),n&&this.displayArticle.updateKey&&this.loadTypedFeedback(),this.browserutils.openToast(n?"Your feedback was received.":"Your feedback was not received.",n?"Done!":"Error",n?c.Rm.success:c.Rm.error),this.disableFeedback=!1})}loadTypedFeedback(){this.articlesService.getTypedFeedback(this.displayArticle).subscribe(t=>{const i=t.data;i&&(this.displayArticle.articleFeedback=i)})}static{this.\u0275fac=function(i){return new(i||o)(e.rXU(y.Lw),e.rXU(c.jK),e.rXU(c.DL),e.rXU(_),e.rXU(A.U),e.rXU(c.bl),e.rXU(g.ox))}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["app-service-modal"]],inputs:{articleId:"articleId",title:"title"},standalone:!0,features:[e.aNF],decls:23,vars:9,consts:[[1,"support-modal-header"],["notranslate","",1,"support-modal-title"],[1,"support-modal-header-buttons"],["title","Close",1,"pageHeaderButton",3,"click"],[1,"fal","fa-times","icon-no-margin"],[1,"support-modal-body"],[1,"spinner"],[1,"support-modal-footer","d-flex","justify-content-between","w-100"],["notranslate","",1,"text-start"],[1,"text-end"],[1,"pt-1"],[1,"btn","btn-outline-success","me-2",3,"click","disabled"],[1,"btn","btn-outline-danger",3,"click","disabled"],[1,"spinner__circle-wrapper"],[1,"spinner__circle"],[1,"pdf-viewer",3,"src","name","auth","showClose"],[1,"froalaText","fr-view",3,"innerHTML"],[1,"articleFileAttachmentHeader"],["type","button",1,"downloadBox"],["type","button",1,"downloadBox",3,"click"],[1,"visually-hidden"],["notranslate","","aria-hidden","true"],["type","button","kendoButton","","fillMode","link","notranslate","",3,"click","title"]],template:function(i,l){1&i&&(e.j41(0,"div",0)(1,"div",1),e.EFF(2),e.DNE(3,x,2,1,"span"),e.k0s(),e.j41(4,"div",2)(5,"button",3),e.bIt("click",function(){return l.closeModal()}),e.nrm(6,"span",4),e.k0s()()(),e.j41(7,"div",5),e.DNE(8,S,3,1,"div",6)(9,E,4,3),e.k0s(),e.j41(10,"div",7)(11,"div",8),e.
1EFF(12),e.nI1(13,"localizedMediumDateZ"),e.k0s(),e.j41(14,"div",9)(15,"div"),e.EFF(16,"Was this article helpful?"),e.k0s(),e.j41(17,"div",10)(18,"button",11),e.bIt("click",function(){return l.helpfulFeedback(!0)}),e.EFF(19," Yes "),e.k0s(),e.j41(20,"button",12),e.bIt("click",function(){return l.helpfulFeedback(!1)}),e.EFF(21," No "),e.k0s()(),e.DNE(22,G,2,2,"div",10),e.k0s()()),2&i&&(e.R7$(2),e.SpI(" ",l.title," "),e.R7$(),e.vxM(null!=l.displayArticle&&l.displayArticle.author?3:-1),e.R7$(5),e.vxM(l.isLoading?8:9),e.R7$(4),e.SpI(" ",e.bMT(13,7,l.displayArticle.date)," "),e.R7$(6),e.Y8G("disabled",l.disableFeedback),e.R7$(2),e.Y8G("disabled",l.disableFeedback),e.R7$(2),e.vxM(l.displayArticle.articleFeedback?22:-1))},dependencies:[f.sb,F.H,w.FI,R.$n,u.X1,k.qy],encapsulation:2})}}return o})();var N=a(32394),D=a(25708),h=a(30948);const L=o=>({category:o});function H(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",5),e.bIt("click",function(){const l=e.eBV(t).$implicit,n=e.XpG();return e.Njj(n.filterByCategory(l.category))}),e.EFF(1),e.k0s()}if(2&o){const t=s.$implicit,i=e.XpG();e.Y8G("themeColor",i.selectedCategory===t.category?"primary":"base"),e.R7$(),e.SpI(" ",t.category," ")}}function U(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",11),e.bIt("click",function(){e.eBV(t);const l=e.XpG();return e.Njj(l.filterByCategory(l.selectedCategory))}),e.EFF(1),e.k0s()}if(2&o){const t=e.XpG();e.R7$(),e.SpI(" ",t.selectedCategory," ")}}function Y(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",8)(1,"kendo-dropdownlist",12),e.mxI("ngModelChange",function(l){e.eBV(t);const n=e.XpG();return e.DH7(n.dropdownValue,l)||(n.dropdownValue=l),e.Njj(l)}),e.bIt("valueChange",function(l){e.eBV(t);const n=e.XpG();return e.Njj(n.filterByCategory(l.category))}),e.k0s()()}if(2&o){const t=e.XpG();e.R7$(),e.xc7("width",200,"px"),e.Y8G("defaultItem",e.eq3(5,L,t.placeHolderCategory))("data",t.categories.slice(4)),e.R50("ngModel",t.dropdownValue)}}function P(o,s){if(1&o){const t=e.RV6();e.j41(0,"kendo-tilelayout-item",18),e.bIt("click",function(){const l=e.eBV(t).$implicit,n=e.XpG(2);return e.Njj(n.viewArticle(l))})("keydown.enter",function(){const l=e.eBV(t).$implicit,n=e.XpG(2);return e.Njj(n.viewArticle(l))})("keydown.space",function(l){const n=e.eBV(t).$implicit;return e.XpG(2).viewArticle(n),e.Njj(l.preventDefault())}),e.j41(1,"kendo-tilelayout-item-body",19)(2,"div",20)(3,"div",21),e.EFF(4),e.k0s(),e.j41(5,"div",22),e.EFF(6),e.nI1(7,"slice"),e.k0s(),e.j41(8,"div",23),e.EFF(9),e.nI1(10,"slice"),e.k0s(),e.j41(11,"div",24)(12,"span"),e.EFF(13),e.k0s(),e.j41(14,"span"),e.EFF(15),e.nI1(16,"date"),e.k0s()()()()()}if(2&o){const t=s.$implicit,i=s.$index,l=e.XpG(2);e.Y8G("col",l.getCol(i))("colSpan",2)("rowSpan",1),e.BMQ("aria-labelledby","kb-article-name-"+t.id),e.R7$(3),e.Y8G("id","kb-article-name-"+t.id),e.R7$(),e.SpI(" ",t.subject," "),e.R7$(2),e.SpI(" ",t.subject?e.brH(7,10,t.subject,0,20)+(t.subject.length>20?"...":""):""," "),e.R7$(3),e.SpI(" ",t.summary?e.brH(10,14,t.summary,0,100)+(t.summary.length>100?"...":""):""," "),e.R7$(4),e.JRh(t.author),e.R7$(2),e.JRh(e.i5U(16,18,t.date,"mediumDate"))}}function z(o,s){if(1&o&&(e.j41(0,"div",13)(1,"h3",14),e.EFF(2),e.k0s(),e.nrm(3,"hr",15),e.k0s(),e.j41(4,"kendo-tilelayout",16),e.Z7z(5,P,17,21,"kendo-tilelayout-item",17,e.fX1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG();e.R7$(2),e.JRh(t.category),e.R7$(2),e.Y8G("columns",i.columns)("rowHeight",i.rowHeight)("resizable",!1)("reorderable",!1),e.R7$(),e.Dyx(t.articles)}}function Z(o,s){1&o&&(e.j41(0,"div",10)(1,"p",25),e.EFF(2,"No articles found matching your criteria."),e.k0s()())}let O=(()=>{class o{constructor(t,i,l){this.articlesService=t,this.breakpointObserver=i,this.ngbModal=l,this.categories=[],this.articles=[],this.filteredArticles=[],this.placeHolderCategory="Select a category",this.dropdownValue=null,this.selectedCategory="All Articles",this.searchText="",this.groupedArticles=[],this.columns=6,this.rowHeight=150}ngOnInit(){this.articlesService.getArticles().subscribe(t=>{this.categories=t.data,this.articles=t.extended,this.filteredArticles=this.articles,this.groupArticlesByCategory()}),this.breakpointObserver.observe([r.Rp.XSmall,r.Rp.Small,r.Rp.Medium,r.Rp.Large,r.Rp.XLarge]).subscribe(t=>{const i={[r.Rp.XSmall]:2,[r.Rp.Small]:4,[r.Rp.Medium]:6,[r.Rp.Large]:8,[r.Rp.XLarge]:10},l=Object.keys(i).find(n=>t.breakpoints[n]);this.columns=l?i[l]:6})}getCol(t){return t%(this.columns/2)*2+1}get isSelectedCategoryInMore(){const t=this.categories.slice(0,4).map(i=>i.category);return"All Articles"!==this.selectedCategory&&!!this.selectedCategory&&!t.includes(this.selectedCategory)}filterByCategory(t){this.selectedCategory=t==this.placeHolderCategory?"All Articles":t,this.categories.slice(4).map(l=>l.category).includes(t)||(this.dropdownValue=null),this.applyFilters()}onSearch(t){this.searchText=t,this.applyFilters()}viewArticle(t){const i=this.ngbModal.open(V,{size:"xl",scrollable:!0,centered:!0});i.componentInstance.articleId=t.id,i.componentInstance.title=t.subject}applyFilters(){let t=this.articles;if(this.selectedCategory&&"All Articles"!==this.selectedCategory&&(t=t.filter(i=>i.category===this.selectedCategory)),this.searchText&&""!==this.searchText.trim()){const i=this.searchText.toLowerCase();t=t.filter(l=>l.subject?.toLowerCase().includes(i)||l.author?.toLowerCase().includes(i)||l.body?.toLowerCase().includes(i)||l.tagString?.toLowerCase().includes(i)||l.category?.toLowerCase().includes(i))}this.filteredArticles=t,this.groupArticlesByCategory()}groupArticlesByCategory(){this.groupedArticles=[],this.searchText||this.selectedCategory&&"All Articles"!==this.selectedCategory?this.filteredArticles.length>0&&(this.groupedArticles=[{category:"All Articles"!==this.selectedCategory?this.selectedCategory:"Search Results",articles:this.filteredArticles}]):[...new Set(this.articles.map(i=>
1i.category))].sort().forEach(i=>{const l=this.articles.filter(n=>n.category===i);l.length>0&&this.groupedArticles.push({category:i,articles:l})})}static{this.\u0275fac=function(i){return new(i||o)(e.rXU(_),e.rXU(r.QP),e.rXU(y.Bq))}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["app-knowledge-base"]],hostAttrs:[1,"h-100","overflow-hidden"],standalone:!0,features:[e.aNF],decls:16,vars:5,consts:[[1,"container-fluid","d-flex","flex-column","h-100","overflow-hidden","w-75","pt-4"],[3,"search","placeholder"],[1,"fs-3","fw-bold","my-3"],[1,"toolbar","d-flex","justify-content-between","align-items-start","flex-wrap"],[1,"button-container","d-flex","align-items-center","flex-wrap"],["kendoButton","","rounded","full","type","button","size","small",1,"filter-button","me-2","mb-2",3,"click","themeColor"],["kendoButton","","rounded","full","type","button","size","small",1,"filter-button","me-2","mb-2",3,"themeColor"],["kendoButton","","rounded","full","type","button","size","small","themeColor","primary",1,"filter-button","me-2","mb-2"],[1,"dropdown-container","mb-2"],[1,"h-100","overflow-auto"],[1,"text-center","py-5"],["kendoButton","","rounded","full","type","button","size","small","themeColor","primary",1,"filter-button","me-2","mb-2",3,"click"],["textField","category","valueField","category",3,"ngModelChange","valueChange","defaultItem","data","ngModel"],[1,"mt-4","mb-2"],[1,"fs-4","fw-bold"],[1,"mt-2","mb-3"],[1,"mb-4",3,"columns","rowHeight","resizable","reorderable"],["tabindex","0","role","button",3,"col","colSpan","rowSpan"],["tabindex","0","role","button",3,"click","keydown.enter","keydown.space","col","colSpan","rowSpan"],[1,"h-100","overflow-hidden"],[1,"d-flex","flex-column","p-3","h-100"],["notranslate","",1,"visually-hidden",3,"id"],["notranslate","",1,"fw-semibold","fs-5","mb-2","title-container"],[1,"text-muted","small","mb-auto"],[1,"d-flex","justify-content-between","mt-2","pt-2","border-top","small","text-muted"],[1,"text-muted"]],template:function(i,l){1&i&&(e.j41(0,"div",0)(1,"app-search",1),e.bIt("search",function(d){return l.onSearch(d)}),e.k0s(),e.j41(2,"h2",2),e.EFF(3,"Articles"),e.k0s(),e.j41(4,"div",3)(5,"div",4)(6,"button",5),e.bIt("click",function(){return l.filterByCategory("All Articles")}),e.EFF(7," All Articles "),e.k0s(),e.Z7z(8,H,2,2,"button",6,e.fX1),e.DNE(10,U,2,1,"button",7),e.k0s(),e.DNE(11,Y,2,7,"div",8),e.k0s(),e.j41(12,"div",9),e.Z7z(13,z,7,5,null,null,e.fX1),e.DNE(15,Z,3,0,"div",10),e.k0s()()),2&i&&(e.R7$(),e.Y8G("placeholder","Search KB Articles..."),e.R7$(5),e.Y8G("themeColor","All Articles"===l.selectedCategory?"primary":"base"),e.R7$(2),e.Dyx(l.categories.slice(0,4)),e.R7$(2),e.vxM(l.isSelectedCategoryInMore?10:-1),e.R7$(),e.vxM(l.categories.length>4?11:-1),e.R7$(2),e.Dyx(l.groupedArticles),e.R7$(2),e.vxM(0===l.groupedArticles.length?15:-1))},dependencies:[p.MD,p.P9,p.vh,C._,N.V9,D.Qp,h.iB,h.fu,h.ZP,v.S,f.sb,u.BC,u.vS],encapsulation:2})}}return o})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.