1import{a as te}from"./chunk-QSNBNNJR.js";import{a as ee}from"./chunk-54FAXO5A.js";import"./chunk-ASUDMA6M.js";import{a as x}from"./chunk-7ASJVOVB.js";import{G as b}from"./chunk-LT5JWPRZ.js";import"./chunk-AAIVK37T.js";import{a as Z}from"./chunk-DIKPGRR2.js";import{l as I}from"./chunk-YHSBM63R.js";import{a as M}from"./chunk-GB7MXHOH.js";import"./chunk-LBG6DDYT.js";import"./chunk-XAWZ52LE.js";import"./chunk-WLHVMLAG.js";import{Aa as F,Dc as B,Ed as Q,G as y,Hb as E,Ib as D,Id as Y,Ja as n,Jc as z,Nc as X,Pc as f,Q as h,cd as V,da as W,ed as J,f as A,o as C,oa as v,ob as U,oc as u,qc as g,rc as G,sa as c,t as H,tb as r,tc as j,uc as k,vc as w,vd as q,wc as a,wd as K,xc as o,yc as l,za as $}from"./chunk-IDYDDYOD.js";import"./chunk-3OXIZCVC.js";function se(i,e){i&1&&l(0,"loading-page");}function re(i,e){if(i&1&&l(0,"news-item",4),i&2){let t=e.$implicit;w("item",t);}}function ae(i,e){i&1&&(a(0,"div",5),l(1,"loading-page"),o());}function le(i,e){if(i&1){let t=B();a(0,"div",3),X("scrolled",function(){$(t);let p=f();return F(p.onScrollDown());}),j(1,re,1,1,"news-item",4,G),o(),u(3,ae,2,0,"div",5);}if(i&2){let t=f();w("infiniteScrollDistance",1)("infiniteScrollThrottle",50)("infiniteScrollDisabled",t.scrollDisabled())("fromRoot",!0),r(),k(t.items()),r(2),g(t.isLoadingMore()?3:-1);}}function me(i,e){i&1&&(a(0,"div",2),z(1,0),o());}var _=class _{constructor(){this.destroy$=new A();this.api=c(b);this.seo=c(x);this.items=n([]);this.isLoadingPage=n(!0);this.isLoadingMore=n(!1);this.scrollDisabled=n(!1);this.currentPage=n(1);this.error=n(null);}ngOnInit(){this.seo.updateSeoTags({title:()=>"News"}),this.loadNews();}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}loadNews(){this.isLoadingMore()||this.scrollDisabled()||(this.isLoadingMore.set(!0),this.error.set(null),this.api.getNews({page:this.currentPage()}).pipe(H(e=>e),W(this.destroy$),y(e=>(console.error("\u041E\u0448\u0438\u0431\u043A\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u0435\u0439:",e),this.error.set(e?.message||"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043D\u043E\u0432\u043E\u0441\u0442\u0438."),this.scrollDisabled.set(!0),C({data:[],links:{next:null}}))),h(()=>{this.isLoadingMore.set(!1),this.isLoadingPage.set(!1);})).subscribe(e=>{let t=e.data??[];if(t.length){let p=new Set(this.items().map(N=>String(N.id??""))),ne=[...this.items(),...t.filter(N=>{let O=String(N.id??"");return!!O&&!p.has(O);})];this.items.set(ne),this.currentPage.update(N=>N+1);}let s=e?.links?.next!=null;this.scrollDisabled.set(!s||t.length===0);}));}onScrollDown(){this.loadNews();}retry(){this.isLoadingMore()||(this.error.set(null),this.scrollDisabled.set(!1),this.loadNews());}};_.ɵfac=function(t){return new(t||_)();},_.ɵcmp=E({type:_,selectors:[["app-news"]],decls:4,vars:1,consts:()=>{let e;return e=" Currently no news available, please check back later ",[e,[1,"container","mx-auto"],[1,"text-center","mt-10","text-gray-500"],["data-infinite-scroll","",1,"grid","grid-cols-1","sm:grid-cols-2","lg:grid-cols-3","gap-3","lg:gap-5",3,"scrolled","infiniteScrollDistance","infiniteScrollThrottle","infiniteScrollDisabled","fromRoot"],[3,"item"],[1,"text-center","mt-5"]];},template:function(t,s){t&1&&(a(0,"div",1),u(1,se,1,0,"loading-page")(2,le,4,5)(3,me,2,0,"div",2),o()),t&2&&(r(),g(s.isLoadingPage()?1:s.items().length>0?2:3));},dependencies:[te,M,ee],encapsulation:2});var T=_;function de(i,e){if(i&1&&(l(0,"div",3),q(1,"safeHtml")),i&2){let t=f();w("innerHTML",K(1,1,t.attributes.body),U);}}function pe(i,e){if(i&1&&(a(0,"div",1)(1,"h1",2),V(2),o(),u(3,de,2,3,"div",3),o()),i&2){let t=f();r(2),J(" ",e.attributes.title," "),r(),g(t.hasContent()?3:-1);}}function ce(i,e){i&1&&l(0,"loading-page");}var S=class S{constructor(){this.slug=Y.required();this.apiService=c(b);this.seoService=c(x);this.isLoadingPage=n(!1);this.item=n(null);this.hasContent=Q(()=>!!this.item()?.attributes?.body);}ngOnInit(){this.isLoadingPage.set(!1),this.apiService.getNewsId(this.slug()).pipe(y(e=>(console.error("\u041E\u0448\u0438\u0431\u043A\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u0438:",e),C(null))),h(()=>this.isLoadingPage.set(!0))).subscribe(e=>{e&&(this.item.set(e),this.seoService.updateSeoTags({title:e.attributes.title}));});}};S.ɵfac=function(t){return new(t||S)();},S.ɵcmp=E({type:S,selectors:[["app-news-slug"]],inputs:{slug:[1,"slug"]},decls:3,vars:1,consts:[[1,"container","mx-auto"],[1,"bg-(--background)","rounded-3xl","shadow","p-8"],[1,"text-2xl","mb-5","font-bold"],[1,"px-3","break-words","formatting__text",3,"innerHTML"]],template:function(t,s){if(t&1&&(a(0,"div",0),u(1,pe,4,2,"div",1)(2,ce,1,0,"loading-page"),o()),t&2){let p;r(),g((p=s.isLoadingPage()&&s.item())?1:2,p);}}
1,dependencies:[M,Z],encapsulation:2});var L=S;var m=class m{};m.ɵfac=function(t){return new(t||m)();},m.ɵmod=D({type:m}),m.ɵinj=v({imports:[I.forChild([{path:"",component:T},{path:":slug",component:L}]),I]});var P=m;var d=class d{};d.ɵfac=function(t){return new(t||d)();},d.ɵmod=D({type:d}),d.ɵinj=v({imports:[P]});var ie=d;export{ie as NewsModule};/**i18n:347c420f4845c186b09f7b18e1064fdae4c9b1da7f5ed52428c13049c675d37a*/
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.