import './polyfills.server.mjs';
import{a as E}from"./chunk-25AU5SIR.mjs";import{a as f}from"./chunk-JNG7LRGD.mjs";import{a as S,b}from"./chunk-AK2QP2SK.mjs";import"./chunk-PEXQ6CP4.mjs";import{E as s,H as o,Ha as d,Pa as v,Ra as g,T as l,Y as c,aa as p,na as m,oa as a,pa as h,s as i,xa as u}from"./chunk-I24PFG4Z.mjs";import"./chunk-N7QBYMCK.mjs";var x=()=>[],C=(n,t)=>({visible:n,label:"Carregar mais eventos",route:t}),M=class n extends E{eventsClient=i(b);searchHelper=i(f);events=s([]);isSearching=s(!1);searchTerm={};ngOnInit(){this.searchTerm=this.searchHelper.terms(),this.search(this.searchTerm)}loadMoreEvents(){this.hasLoadMoreButtonAppear()&&(this.currentPage.update(t=>t+1),this.search(this.searchTerm))}search(t,r=this.currentPage()){this.isSearching.set(!0),this.eventsClient.search(t,r,this.limit()).subscribe({next:e=>{e.next_page_url!==null?this.hasLoadMoreButtonAppear.set(!0):this.hasLoadMoreButtonAppear.set(!1),this.events.set(e.data)}})}static \u0275fac=(()=>{let t;return function(e){return(t||(t=o(n)))(e||n)}})();static \u0275cmp=c({type:n,selectors:[["app-search-result"]],features:[p],decls:7,vars:10,consts:[[1,"section-container"],[3,"loadMoreEventsEmmiter","paginated","isLoading","limit","button","events"],["ngProjectAs","section-header",5,["section-header"],1,"section-header","flex","flex-col","gap-[50px]"],[1,"content","flex","flex-col","gap-12"],[1,"title","text-center","flex","flex-col","items-center","gap-2"],[1,"text-base","xl:text-xl","!font-['Montserrat']"]],template:function(r,e){r&1&&(a(0,"div",0)(1,"app-events-displayer",1),u("loadMoreEventsEmmiter",function(){return e.loadMoreEvents()}),a(2,"div",2)(3,"div",3)(4,"div",4)(5,"h6",5),d(6," Resultados da sua pesquisa: "),h()()()()()()),r&2&&(l(),m("paginated",!0)("isLoading",e.isLoadingEvents())("limit",e.limit())("paginated",!0)("button",g(7,C,e.hasLoadMoreButtonAppear(),v(6,x)))("events",e.events()))},dependencies:[S],encapsulation:2})};export{M as SearchResultComponent};
