"use strict";(self.webpackChunkegret_angular_latest_test=self.webpackChunkegret_angular_latest_test||[]).push([[2352],{62352:($,a,n)=>{n.r(a),n.d(a,{SearchViewModule:()=>S});var i=n(60177),c=n(78887),t=n(54438),h=n(84412);let u=(()=>{class s{constructor(){this.searchTerm=new h.t(""),this.searchTerm$=this.searchTerm.asObservable()}static#t=this.\u0275fac=function(r){return new(r||s)};static#s=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var l=n(21626);let m=(()=>{class s{constructor(e){this.http=e}getCountries(e){return this.http.get("https://restcountries.com/v3.1/name/"+e)}static#t=this.\u0275fac=function(r){return new(r||s)(t.KVO(l.Qq))};static#s=this.\u0275prov=t.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();function f(s,y){if(1&s&&(t.j41(0,"div",4)(1,"div",5),t.EFF(2),t.k0s(),t.j41(3,"div",5),t.EFF(4),t.k0s(),t.j41(5,"div")(6,"span",6),t.EFF(7,"Official Name:"),t.k0s(),t.EFF(8),t.k0s()()),2&s){const e=y.$implicit;t.R7$(2),t.JRh(e.flag),t.R7$(2),t.JRh(e.name.common),t.R7$(4),t.SpI(" ",e.name.official,"")}}const v=[{path:"",component:(()=>{class s{constructor(e,r){this.searchService=e,this.countryService=r}ngOnInit(){this.searchTermSub=this.searchService.searchTerm$.subscribe(e=>{this.countries$=this.countryService.getCountries(e)})}ngOnDestroy(){this.searchTermSub&&this.searchTermSub.unsubscribe()}static#t=this.\u0275fac=function(r){return new(r||s)(t.rXU(u),t.rXU(m))};static#s=this.\u0275cmp=t.VBU({type:s,selectors:[["app-result-page"]],decls:7,vars:6,consts:[[1,"m-4"],[1,"mt-0"],[1,"mat-box-shadow","m-4"],["class","flex p-4",4,"ngFor","ngForOf"],[1,"flex","p-4"],[1,"mr-32"],[1,"text-muted"]],template:function(r,o){1&r&&(t.j41(0,"div",0)(1,"h2",1),t.EFF(2),t.nI1(3,"async"),t.k0s()(),t.j41(4,"div",2),t.DNE(5,f,9,3,"div",3),t.nI1(6,"async"),t.k0s()),2&r&&(t.R7$(2),t.SpI('Search result for "',t.bMT(3,2,o.searchService.searchTerm$),'"'),t.R7$(3),t.Y8G("ngForOf",t.bMT(6,4,o.countries$)))},dependencies:[i.Sq,i.Jj]})}return s})()}];let d=(()=>{class s{static#t=this.\u0275fac=function(r){return new(r||s)};static#s=this.\u0275mod=t.$C({type:s});static#e=this.\u0275inj=t.G2t({imports:[c.iI.forChild(v),c.iI]})}return s})();var p=n(25596),g=n(9159),F=n(96695);let S=(()=>{class s{static#t=this.\u0275fac=function(r){return new(r||s)};static#s=this.\u0275mod=t.$C({type:s});static#e=this.\u0275inj=t.G2t({imports:[p.Hu,i.MD,g.tP,F.Ou,d]})}return s})()}}]);