1import{a as ie}from"./chunk-INA62EO4.js";import{a as se}from"./chunk-JS4V5R6X.js";import{a as ae,b as oe,c as re,d as _e}from"./chunk-JWNORGST.js";import{a as Q}from"./chunk-MSK2J2MT.js";import{a as Y,b as j}from"./chunk-SNWPR4UZ.js";import{a as K,b as Z,c as h,d as x,g as ee,h as te,j as ne}from"./chunk-WRZXP75E.js";import"./chunk-YWKTO73M.js";import{a as F}from"./chunk-AFHSS2U6.js";import{a as J}from"./chunk-W7LSWKME.js";import"./chunk-MAAJDSYV.js";import"./chunk-I6PWGF2K.js";import"./chunk-K6T4326Q.js";import"./chunk-SQYF6HYD.js";import{c as q}from"./chunk-BE3VEPGG.js";import"./chunk-P3KYTCLI.js";import"./chunk-XHDFESOD.js";import{d as z,g as B,h as k}from"./chunk-UFKPJSCY.js";import{b as V}from"./chunk-NGTGFN4T.js";import"./chunk-4W65S3HV.js";import"./chunk-E4P53QH5.js";import"./chunk-V2HCY7SI.js";import{Aa as b,Ab as u,Ad as X,Cb as d,Fb as I,Gb as U,Hb as p,Ib as a,Jb as o,Jc as m,Kb as E,Pb as P,Ta as r,Tb as c,Wb as w,Yb as s,ba as C,eb as D,ha as N,ia as y,lc as M,nc as A,od as H,pc as W,qc as G,rc as $,ta as l,xb as v,yb as R}from"./chunk-6CMTVMC3.js";import"./chunk-TSX4WT5A.js";var ue=(n,t)=>t.id;function de(n,t){n&1&&E(0,"loading-page");}function ge(n,t){if(n&1){let e=P();a(0,"app-page-tabs",12),$("valueChange",function(_){N(e);let g=s(2);return G(g.selectedNewsTabId,_)||(g.selectedNewsTabId=_),y(_);}),o();}if(n&2){let e=s(2);W("value",e.selectedNewsTabId),p("tabs",e.categoryTabs())("showCounts",!1)("animated",!0);}}function me(n,t){n&1&&E(0,"loading-page");}function pe(n,t){if(n&1&&(a(0,"div",20),E(1,"img",27),o()),n&2){let e=s();r(),p("ngSrc",e.attributes.image)("alt",e.attributes.title);}}function ce(n,t){if(n&1&&(a(0,"span",23),M(1),o()),n&2){let e=s();r(),A(" ",e.attributes.category.name," ");}}function Se(n,t){if(n&1&&(a(0,"div",25),M(1),o()),n&2){let e=s();r(),A(" ",e.attributes.created_at_human," ");}}function Ee(n,t){if(n&1&&(a(0,"a",13),R("news-content-leave"),v("news-content-enter"),a(1,"article",18)(2,"div",19),u(3,pe,2,2,"div",20),a(4,"div",21)(5,"div",22),u(6,ce,2,1,"span",23),a(7,"span"),c(8,0),o()(),a(9,"div")(10,"h2",24),M(11),o(),u(12,Se,2,1,"div",25),o(),a(13,"div")(14,"span",26),c(15,1),o()()()()()()),n&2){let e=t,i=s(3);p("routerLink",i.featuredLink()),r(3),d(e.attributes.image?3:-1),r(3),d(e.attributes.category?6:-1),r(5),A(" ",e.attributes.title," "),r(),d(e.attributes.created_at_human?12:-1);}}function Ce(n,t){if(n&1&&E(0,"news-item",15),n&2){let e=t.$implicit;p("item",e);}}function Ne(n,t){if(n&1){let e=P();a(0,"div",17)(1,"button",28),w("click",function(){N(e);let _=s(3);return y(_.retry());}),c(2,2),o()();}}function ye(n,t){if(n&1){let e=P();u(0,Ee,16,5,"a",13),a(1,"div",14),R("news-content-leave"),v("news-content-enter"),I(2,Ce,1,1,"news-item",15,ue),o(),a(4,"app-pagination",16),w("pageChanged",function(_){N(e);let g=s(2);return y(g.onPageChanged(_));}),o(),u(5,Ne,3,0,"div",17);}if(n&2){let e,i=s(2);d((e=i.featured())?0:-1,e),r(2),U(i.items()),r(2),p("ariaLabel",i.paginationAriaLabel)("disabled",i.isLoadingMore())("itemsPerPage",i.itemsPerPage())("page",i.currentPage())("total",i.totalItems()),r(),d(i.error()?5:-1);}}function Pe(n,t){if(n&1){let e=P();a(0,"ui-empty-content",30)(1,"button",28),w("click",function(){N(e);let _=s(3);return y(_.retry());}),c(2,5),o()();}}function fe(n,t){if(n&1&&(a(0,"div",11)(1,"div",29)(2,"ui-empty")(3,"ui-empty-header")(4,"ui-empty-title"),c(5,3),o(),a(6,"ui-empty-description"),c(7,4),o()(),u(8,Pe,3,0,"ui-empty-content",30),o()()()),n&2){let e=s(2);r(8),d(e.error()?8:-1);}}function be(n,t){if(n&1&&(a(0,"div",7)(1,"div",8),E(2,"app-page-header",9),u(3,ge,1,4,"app-page-tabs",10),o(),u(4,me,1,0,"loading-page")(5,ye,6,7)(6,fe,9,1,"div",11),o()),n&2){let e=s();r(2),p("title",e.pageTitle)("bordered",!1),r(),d(e.categoryTabs().length>0?3:-1),r(),d(e.isLoadingMore()?4:e.hasNewsContent()?5:6);}}var T="all",le=class n{constructor(){this.newsApiService=C(ie);this.seoService=C(J);this.router=C(B);this.route=C(z);this.pageTitle="News";this.pageDescription="Latest news, service updates and useful materials.";this.allNewsLabel="All news";this.pageQueryParam=K;this.paginationAriaLabel="News pagination";this.queryParamMap=q(this.route.queryParamMap,{initialValue:this.route.
1snapshot.queryParamMap});this.requestedCategorySlug=m(()=>(this.queryParamMap().get("category")??"").trim());this.requestedPage=m(()=>ee(this.queryParamMap(),this.pageQueryParam));this.newsResource=X(()=>this.newsApiService.createNewsResourceRequest({page:this.requestedPage(),category:this.requestedCategorySlug()||null}),{debugName:"NewsComponent.news"});this.loadErrorText="Failed to load news.";this.items=l([]);this.featured=l(null);this.categories=l([]);this.isLoadingPage=l(!0);this.isLoadingMore=m(()=>this.newsResource.isLoading()&&!this.isLoadingPage());this.hasNewsContent=m(()=>this.items().length>0||this.featured()!==null);this.currentPage=l(1);this.lastPage=l(1);this.itemsPerPage=l(30);this.totalItems=l(0);this.activeCategorySlug=l("");this.selectedNewsTabId=l(T);this.error=l(null);this.hasActiveCategory=m(()=>this.activeCategorySlug().trim()!=="");this.categoryTabs=m(()=>[{id:T,name:this.allNewsLabel,count:null},...this.categories().map(t=>({id:t.slug,name:t.name,count:t.news_count??null}))]);this.featuredLink=m(()=>{let t=this.featured();return t?["/blog",...t.attributes.page_url.split("/").filter(Boolean)]:["/blog"];});this.seoService.updateSeoTags({title:()=>this.pageTitle}),b(()=>{let t=this.requestedCategorySlug();t!==this.activeCategorySlug()&&this.resetState(t);}),b(()=>{let t=this.selectedNewsTabId(),e=t===T?"":t;e!==this.activeCategorySlug()&&this.router.navigate([],{relativeTo:this.route,queryParams:{category:e||null,[this.pageQueryParam]:null},queryParamsHandling:"merge"});}),b(()=>{this.applyNewsResource();});}onPageChanged(t){this.updatePageQuery(t);}retry(){this.isLoadingMore()||(this.error.set(null),this.categories().length===0&&!this.hasNewsContent()&&this.isLoadingPage.set(!0),this.newsResource.reload());}resetState(t){let e=t.trim(),i=this.categories().length===0&&!this.hasNewsContent();this.activeCategorySlug.set(e),this.selectedNewsTabId.set(e||T),this.items.set([]),this.featured.set(null),this.currentPage.set(1),this.lastPage.set(1),this.itemsPerPage.set(30),this.totalItems.set(0),this.error.set(null),this.isLoadingPage.set(i);}applyNewsResource(){let t=this.newsResource.status();if(t==="idle"||t==="loading"||t==="reloading")return;if(t==="error"){console.error("Error loading news:",this.newsResource.error()),this.error.set(this.loadErrorText),this.isLoadingPage.set(!1);return;}let e=this.newsResource.value(),i=this.requestedPage();if(!e||this.reloadLastAvailablePageIfNeeded(e,i))return;this.applyCategories(e.categories),this.featured.set(e.featured??null);let _=e.featured?.id??null,g=(e.news??[]).filter(f=>f.id!==_);this.items.set(g),this.currentPage.set(h(e.meta?.current_page??i)),this.lastPage.set(h(e.meta?.last_page??1)),this.itemsPerPage.set(x(e.meta?.per_page,30)),this.totalItems.set(x(e.meta?.total,0)),this.error.set(null),this.isLoadingPage.set(!1);}applyCategories(t){Array.isArray(t)&&(t.length>0||this.categories().length===0)&&this.categories.set(t);}updatePageQuery(t,e=!1){te(this.router,this.route,t,{pageQueryParam:this.pageQueryParam,replaceUrl:e});}reloadLastAvailablePageIfNeeded(t,e){let i=ne(t.meta,e);return i===null?!1:(this.lastPage.set(i),this.updatePageQuery(i,!0),!0);}static{this.ɵfac=function(e){return new(e||n)();};}static{this.ɵcmp=D({type:n,selectors:[["app-news"]],decls:3,vars:1,consts:()=>{let t;t="News categories";let e;e="Featured news";let i;i="Read more";let _;_="Try again";let g;g="No news yet";let f;f="There is no news at the moment, check back later.";let O;return O="Try again",[e,i,_,g,f,O,[1,"container","mx-auto","py-5","sm:py-6","lg:py-8"],[1,"space-y-6","sm:space-y-8"],[1,"space-y-4","border-b","border-border","pb-4","sm:pb-5"],["size","md",3,"title","bordered"],["ariaLabel",t,"size","md",3,"value","tabs","showCounts","animated"],[1,"mx-auto","max-w-2xl","rounded-[2rem]","border","border-border","bg-card"],["ariaLabel",t,"size","md",3,"valueChange","value","tabs","showCounts","animated"],[1,"block",3,"routerLink"],[1,"grid","grid-cols-1","gap-4","sm:grid-cols-2","xl:grid-cols-3"],[3,"item"],[3,"pageChanged","ariaLabel","disabled","itemsPerPage","page","total"],[1,"flex","justify-center","pt-2"],[1,"overflow-hidden","rounded-3xl","border","border-border","bg-card","transition-colors","duration-200","hover:border-primary/30"],[1,"grid","gap-0","lg:grid-cols-[0.9fr_1fr]"],[1,"relative","h-72","overflow-hidden","border-b","border-border","bg-muted/20","sm:h-80","lg:h-88","lg:border-b-0","lg:border-e"],[1,"flex","flex-col","justify-center","gap-4","p-5","pb-6","lg:p-6","lg:pb-8"],[1,"flex","flex-wrap","items-center","gap-2","text-sm","text-muted-foreground"],[1,"inline-flex","items-center","rounded-xl","border","border-border","bg-background","px-3","py-1","text-xs","font-medium","text-muted-foreground"],[1,"line-clamp-3","text-xl","font-medium","leading-7","tracking-tight","text-foreground","lg:text-2xl","lg:leading-8"],[1,"mt-2","text-sm","text-muted-foreground"],["uiButton","","variant","outline",1,"rounded-xl"],["fill","","sizes","(min-width: 1024px) 45vw, 100vw","loading","lazy",1,"absolute","
1inset-0","size-full","object-cover",3,"ngSrc","alt"],["uiButton","","type","button","variant","outline",1,"rounded-xl",3,"click"],[1,"py-10"],[1,"pt-2"]];},template:function(e,i){e&1&&(a(0,"div",6),u(1,de,1,0,"loading-page")(2,be,7,4,"div",7),o()),e&2&&(r(),d(i.isLoadingPage()?1:2));},dependencies:[H,k,Q,Z,V,F,ae,oe,re,_e,se,Y,j],styles:["[_nghost-%COMP%]{display:block}.news-content-enter[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_news-content-enter .26s cubic-bezier(.16,1,.3,1)}.news-content-leave[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_news-content-leave .18s ease-in}@keyframes _ngcontent-%COMP%_news-content-enter{0%{opacity:0;transform:translateY(10px);filter:blur(4px)}to{opacity:1;transform:translateY(0);filter:blur(0)}}@keyframes _ngcontent-%COMP%_news-content-leave{0%{opacity:1;transform:translateY(0);filter:blur(0)}to{opacity:0;transform:translateY(6px);filter:blur(3px)}}"]});}};export{le as NewsComponent};/**i18n:4a99b2d0acf14f514ec1a9ad7ce6fd8bc6ad78c9220b1d45912a08891dbf615e*/
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.