1import{f as G}from"./chunk-II5GPNB3.js";import{G as U,c as L,k as J,r as R}from"./chunk-N6B7OEUW.js";import{f as q}from"./chunk-RZWUF2WE.js";import{a as H}from"./chunk-7WMAZ4BZ.js";import"./chunk-KCEJCXJZ.js";import{c as V,g as W}from"./chunk-I335Z6VX.js";import"./chunk-YYKWFEMG.js";import"./chunk-D2N3WVHQ.js";import"./chunk-OP5LXOJA.js";import"./chunk-ARD6OICO.js";import"./chunk-BBHJ2D5U.js";import"./chunk-RH7YKMCI.js";import"./chunk-2P2IIG2U.js";import"./chunk-J3TYBNDU.js";import"./chunk-4QCSDQDN.js";import"./chunk-W3MH5BOT.js";import{D as F,v as D}from"./chunk-GUQT3FOM.js";import{Dd as E,Eb as r,Ed as B,Ib as A,Jb as M,Jc as I,Lb as p,Oa as v,Qc as w,Sc as g,Ub as P,de as j,fd as d,gd as k,hd as N,kd as y,ld as b,md as S,pc as l,rc as s,sb as x,tc as O,uc as T,vc as z,wc as _,xc as n,ya as u,yc as a,za as C,zc as f}from"./chunk-H5RMQNTW.js";import"./chunk-EU2KAMEK.js";import"./chunk-YNC7RVHT.js";function K(t,c){t&1&&(n(0,"div",7)(1,"div",8)(2,"span",9),d(3,"Loading..."),a()()())}function Q(t,c){if(t&1&&f(0,"img",15),t&2){let e=g().$implicit;_("src",e.document.image_url,x)}}function X(t,c){t&1&&f(0,"img",16)}function Y(t,c){if(t&1&&(n(0,"a",11)(1,"article",14),l(2,Q,1,1,"img",15),l(3,X,1,0,"img",16),n(4,"div",17)(5,"span",18),d(6),E(7,"date"),a(),n(8,"h6",19),d(9),a()()()()),t&2){let e=c.$implicit;_("href",e.document.link,x),r(2),s(e.document.image_url&&e.document.image_url!=="false"?2:-1),r(),s(!e.document.image_url||e.document.image_url==="false"?3:-1),r(3),N(" ",B(7,5,e.document.published_at)," "),r(3),k(e.document.title)}}function Z(t,c){t&1&&(n(0,"div",12)(1,"div",20),f(2,"img",21),n(3,"p",22),d(4,"No Article Found"),a()()())}function $(t,c){if(t&1){let e=I();n(0,"div",13)(1,"ngb-pagination",23),S("pageChange",function(i){u(e);let m=g(2);return b(m.page,i)||(m.page=i),C(i)}),w("pageChange",function(){u(e);let i=g(2);return C(i.searchArticles(i.page))}),a()()}if(t&2){let e=g(2);r(),_("collectionSize",e.collectionSize),y("page",e.page),_("pageSize",e.pageSize)("maxSize",3)}}function ee(t,c){if(t&1&&(n(0,"div")(1,"div",10),T(2,Y,10,7,"a",11,O),a(),l(4,Z,5,0,"div",12),l(5,$,2,4,"div",13),a()),t&2){let e=g();r(2),z(e.articles),r(2),s(e.articles?.length?-1:4),r(),s(e.articles?.length?5:-1)}}var he=(()=>{class t{constructor(e,o,i,m,h){this.typesenseService=e,this.router=o,this.seoService=i,this.cdr=m,this.platformId=h,this.searchTerm="",this.page=1,this.pageSize=9,this.articles=[],this.loading=!1,this.isBrowser=F(this.platformId)}ngOnInit(){if(this.seoService.updateTitle("Musaffa | Academy"),this.seoService.updateDescription(""),this.routeSubscription=this.router.events.subscribe(e=>{e instanceof V&&this.resetPageNo(e.url)}),this.isBrowser){let e=sessionStorage.getItem("articlesPageNo");e===null?(this.page=1,this.searchArticles(this.page)):(this.page=Number(e),this.searchArticles(this.page))}}resetPageNo(e){this.isBrowser&&sessionStorage.setItem("articlesPageNo",JSON.stringify(1))}ngOnDestroy(){this.routeSubscription.unsubscribe()}searchArticles(e){this.loading=!0,this.scrollToTop(),this.typesenseService.getAcademyArticles(this.searchTerm,"status:=publish",9,e,"published_at:desc","title").then(o=>{this.articles=o.hits,this.collectionSize=o.found,this.isBrowser&&sessionStorage.setItem("articlesPageNo",JSON.stringify(e)),this.loading=!1,this.cdr.markForCheck()}).catch(()=>{this.loading=!1,this.cdr.markForCheck()})}searchChange(){this.searchArticles(this.page),this.isBrowser&&sessionStorage.setItem("articlesPageNo",JSON.stringify(this.page))}scrollToTop(){this.isBrowser&&window.scrollTo({top:0,behavior:"smooth"})}static{this.\u0275fac=function(o){return new(o||t)(p(q),p(W),p(H),p(j),p(v))}}static{this.\u0275cmp=P({type:t,selectors:[["app-academy-articles"]],decls:11,vars:3,consts:[[1,"container","cards-and-pagination-wrapper","py-4","py-lg-5"],[1,"form","d-flex","flex-column","flex-lg-row","align-items-lg-center","justify-content-lg-between","mb-4","py-lg-2"],[1,"main-heading","mb-3","mb-lg-0"],[1,"flex-grow-1","search-wrapper"],["for","searchArticle",1,"form-label","sr-only","mb-1"],["type","text","id","searchArticle","placeholder","Search Article",1,"form-control",3,"ngModelChange","input","ngModel"],[1,""],[1,"d-flex","align-items-center","justify-content-center","py-5"],["role","status",1,"spinner-border","text-success"],[1,"visually-hidden"],[1,"articles-grid-container"],["target","_blank","rel","noreferrer noopener",1,"article-card-container","border","bg-white","p-3",3,"href"],[1,"text-center","w-100"],[1,"mt-4","mt-lg-5"],[1,"article-card"],["alt","",1,"article-image","border","rounded-3",3,"src"],["src","/assets/images/article-placeholder-image.webp","alt","academy-section-img",1,"article-image","border","rounded-3"],[1,"bg-white"],[1,"d-block","article-date","fw-bold"],[1,"mb-0","article-title"],[1,"d-flex","flex-column","align-items-center","justify-content-center","py-4","py-lg-5"],["src","../../../assets/images/no-data.svg","alt","",1,"no-data-img","img-fluid","mx-auto"],[1,"mb-0","mt-3","no-data-text","fw-600"],[1,"d-flex","justify-content-center",3,"pageChange","collectionSize","page","pageSize","maxSize"]],template:function(o,i){o&1&&(n(0,"div",0)(1,"div",1)(2,"h3",2),d(3,"Musaffa Academy"),a(),n(4,"div",3)(5,"label",4),d(6,"Search Article"),a(),n(7,"input",5),S("ngModelChange",function(h){return b(i.searchTerm,h)||(i.searchTerm=h),h}),w("input",function(){return i.searchChange()}),a(),A(),a()(),n(8,"section",6),l(9,K,4,0,"div",7),l(10,ee,6,2,"div"),a()()),o&2&&(r(7),y("ngModel",i.searchTerm),M(),r(2),s(i.loading?9:-1),r(),s(i.loading?-1:10))},dependencies:[U,L,J,R,G,D],styles:[".search-wrapper[_ngcontent-%COMP%]{max-width:32rem}@media(min-width:768px)and (max-width:1000px){.search-wrapper[_ngcontent-%COMP%]{max-width:100%}}.section-heading[_ngcontent-%COMP%]{font-weight:700;font-size:1.5rem}@media(max-width:767px){.section-heading[_ngcontent-%COMP%]{font-size:1.25rem}}.form-control[_ngcontent-%COMP%]{padding-block:.875rem}@media(max-width:767px){.form-control[_ngcontent-%COMP%]{padding-block:.75rem}}.no-data-img[_ngcontent-%COMP%]{width:100%;max-width:25rem}.search-btn[_ngcontent-%COMP%]{color:#fff;background-color:#009000;padding-inline:2rem;padding-block:.75rem;font-size:1.125rem}@media(max-width:767px){.search-btn[_ngcontent-%COMP%]{padding-inline:.75rem;padding-block:.55rem;font-size:1.25rem}}@media(min-width:768px)and (max-width:1000px){.cards-and-pagination-wrapper[_ngcontent-%COMP%]{padding-bottom:7rem}}@media(max-width:767px){.cards-and-pagination-wrapper[_ngcontent-%COMP%]{padding-bottom:7rem}}.articles-grid-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:1.75rem;width:100%}@media(min-width:768px)and (max-width:1000px){.articles-grid-container[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr);gap:1.5rem}}@media(max-width:767px){.articles-grid-container[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:1rem}}.article-card-container[_ngcontent-%COMP%]{box-shadow:#0000001a 0 4px 12px;border-radius:.5rem;text-decoration:none}.article-card-container[_ngcontent-%COMP%]:hover .article-title[_ngcontent-%COMP%]{text-decoration:underline;color:#009000}.article-card[_ngcontent-%COMP%]{border-radius:.5rem}.article-card[_ngcontent-%COMP%] .article-image[_ngcontent-%COMP%]{width:100%;min-height:12.5rem;min-width:100%;aspect-ratio:16/9}@media(min-width:768px)and (max-width:1000px){.article-card[_ngcontent-%COMP%] .article-image[_ngcontent-%COMP%]{min-height:10rem}}@media(max-width:767px){.article-card[_ngcontent-%COMP%] .article-image[_ngcontent-%COMP%]{min-height:10.9375rem}}.article-card[_ngcontent-%COMP%] .article-date[_ngcontent-%COMP%]{font-size:.875rem;color:gray;padding:.75rem 0 .5rem}.article-card[_ngcontent-%COMP%] .article-title[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:#000}"]})}}return t})();export{he as AcademyArticlesComponent};
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.