PageSourceSearch

https://www.canstar.com.au/chunk-IHCT3ZFN.js

js canstar.com.au collected 2026-10-02 04:00:47 UTC 54,248 bytes, 5 lines download raw bytes

1import{a as Ot,b as Ut,d as Nt}from"./chunk-MSLUJNRZ.js";import{a as $t}from"./chunk-T6KP3CTF.js";import{a as Rt}from"./chunk-GISGRZJY.js";import{a as Pt,b as Ft}from"./chunk-AHHYXS2G.js";import{a as Mt}from"./chunk-YAXQOTVW.js";import{H as Et,a as lt,b as mt,c as pe,d as ht,e as ue,f as de,g as pt,h as ut,i as Z,j as dt,k as ft,l as fe,t as kt,y as At}from"./chunk-TIHQD4JQ.js";import{a as D}from"./chunk-INEKTJWH.js";import{a as Wt}from"./chunk-PLNI6KVC.js";import{a as Ze}from"./chunk-FIRXOPKI.js";import{a as _,b as j}from"./chunk-67OWK55S.js";import{a as Dt}from"./chunk-ILG63YD2.js";import{a as _t,b as Vt}from"./chunk-D6TAFX3I.js";import{a as Lt}from"./chunk-6G256R5T.js";import{a as St,b as bt}from"./chunk-HY4T2ABU.js";import{c as xt,d as Ct}from"./chunk-XDA5GXZL.js";import{p as ct}from"./chunk-PH25ZTOP.js";import{b as ve}from"./chunk-37CIG55A.js";import{a as gt,b as yt}from"./chunk-IALOCFFC.js";import{a as vt}from"./chunk-JU2R552O.js";import{a as wt}from"./chunk-XNFEZRWH.js";import{b as jt,c as re}from"./chunk-NHR52PRU.js";import{b as Ht}from"./chunk-HGT6NSZ3.js";import{b as xr,d as L,h as te,j as ge,k as It,o as Tt,p as k,q as N}from"./chunk-NPVUMORK.js";import{a as ee}from"./chunk-BEHI5GMH.js";import{a as Je}from"./chunk-KFJVQHLZ.js";import{a as Xe}from"./chunk-27PVWDB5.js";import{a as R}from"./chunk-H3GMUKQJ.js";import{c as ye}from"./chunk-D3LXR6UT.js";import{d as T,j as E,p as he,r as Ye}from"./chunk-B7S6BY32.js";import{O as it,P as ot,Q as st,R as at,Z as nt,a as et,b as F,c as tt,g as C}from"./chunk-5CRRRTRQ.js";import{a as rt}from"./chunk-XGHAKONG.js";import{a as d}from"./chunk-J2FK7LHM.js";import{a as w}from"./chunk-LNJ3EIRB.js";import{b as _e,c as Ne,d as De,e as We,f as Ve,g as S,i as He,l as X,m as Qe,o as Ke,p as P}from"./chunk-A2OTBGMY.js";import{$c as Oe,A as q,Ba as O,C as Q,Fc as Pe,G as x,Ic as A,Jc as M,Na as y,R as ke,Sa as Me,Sc as Fe,W as Ae,X as Ee,Xc as U,Yc as me,_c as Le,b as g,ba as m,c as Te,ca as Re,cd as Ue,d as G,ea as a,id as qe,jd as Be,kd as J,lc as I,ld as Ge,p as z,pd as f,q as le,qa as $e,rd as ze,t as $,u as Y,w as je,wa as K,za as v}from"./chunk-JJPZDSOO.js";import{a as Ce,b as Ie,g as ce,j as H}from"./chunk-4ZZIO3ZI.js";var qt=(()=>{class o{constructor(e,t,r,i,s,n){this.injector=e,this.baseUrl=t,this.response=r,this.platformId=i,this.appErrorHandler=s,this.environment=n,this.isBrowser=A(this.platformId)}handleError(e){this.window=this.injector.get(w).nativeWindow,this.storageService=this.injector.get(R);let t=e.message.includes(this.environment.graphqlServerUrl),r=this.injector.get(d),i=this.injector.get(f),s=F(i,"navigations.value.rawUrl","").toString()||i.url;this.isSSRError=!this.isBrowser&&!t;let n=`${s}
2 ${this.getErrorMessage(e)}`;if(r.logError(n),this.callServerErrorHandler(e),this.ignoreError(e)){r.logWarn("Error detected & handled - no redirect");return}if(!s.startsWith("/error")){let c=!1,l=i.events.subscribe(h=>{if(h instanceof Be)c=!0;else if(h instanceof Ge){let p=`Reloaded page as encountered NavigationError which indicates a circular redirect
3${n}`;this.isSSRError&&this.reloadErrorPage(s,p)}else h instanceof J&&l.unsubscribe()});r.logWarn(`${s}
4Loading error route due to JavaScript exception`),this.isBrowser||this.response?.status(400),this.isSSRError&&i.navigate(["/error",{title:"Error",info:"Sorry, something went wrong",path:s}],{skipLocationChange:!0}),setTimeout(()=>{if(!c){let h=`Reloaded page as Angular has crashed
5${n}`;this.isSSRError&&this.reloadErrorPage(s,h)}},50)}}getErrorMessage(e){return e.stack?e.stack:e.message?e.message:e.toString()}reloadErrorPage(e,t){if(!this.isBrowser)return;this.storageService.setSessionItem("reload:error",t);let r=`${this.baseUrl}/error;title=Error;info=Sorry%2C+something+went+wrong;path=${encodeURIComponent(e)}`;this.window.location.assign(r)}callServerErrorHandler(e){typeof this.appErrorHandler=="function"&&this.appErrorHandler(e)}ignoreError(e){let t=["auth/operation-not-supported-in-this-environment"],r=[18];return e.hasOwnProperty("code")&&t.includes(e.code)?!0:!!(e.message.includes("FirebaseError")&&t.some(i=>e.message.includes(i))||e instanceof DOMException&&r.includes(e.code))}static{this.\u0275fac=function(t){return new(t||o)(a($e),a(We),a(_e),a(v),a(De),a(S))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o}
5)();var Bt=(()=>{class o{constructor(){this.defaultUrlSerializer=new qe}parse(e){return e=e.replace(/\+/g,"%20"),this.defaultUrlSerializer.parse(e)}serialize(e){let t=this.defaultUrlSerializer.serialize(e).replace(/%20/g,"+").replace(/%23/g,"#").replace("/(","(");return t.endsWith("/")||t.includes("?")?t:`${t}/`}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var Gt=(()=>{class o{constructor(e,t,r){this.stateTransferService=e,this.window=t.nativeWindow,this.cookies=r}addLoggedInState(){this.stateTransferService.set("isLoggedIn",Object.keys(this.cookies).some(e=>e.indexOf("wordpress_logged_in")!==-1))}static{this.\u0275fac=function(t){return new(t||o)(a(O),a(w),a(Ve))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var zt=(()=>{class o{constructor(e,t){this.abTestToken=e,this.stateTransferService=t,this.abTestState="ABTest"}addABTestState(){this.stateTransferService.set(this.abTestState,this.abTestToken)}static{this.\u0275fac=function(t){return new(t||o)(a(Ne),a(O))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var Yt=(()=>
5{class o{constructor(e,t,r,i){this.stateTransferService=e,this.ngStyleId="ng_styles",this.window=r.nativeWindow,this.document=t,this.renderer=i.createRenderer(this.document,null)}addStylesToState(){if(!this.document.head||!this.document.head.children||!this.document.head.children.length)return;let e=Array.prototype.reduce.call(this.document.head.children,(t,r)=>r.localName==="style"&&!!r.attributes["ng-transition"]&&!!r.firstChild&&!!r.firstChild.data?[...t,r.firstChild.data.replace(/\n/g," ")]:t,[]);this.stateTransferService.set(this.ngStyleId,e)}injectStylesFromState(){this.stateTransferService.get(this.ngStyleId,[]).forEach(t=>{let r=this.renderer.createElement("style");this.renderer.setAttribute(r,"ng-state-transfer",null);let i=this.getCSPNonce();i&&this.renderer.setAttribute(r,"nonce",i),this.renderer.setProperty(r,"innerHTML",t),this.renderer.appendChild(this.document.head,r)})}getCSPNonce(){let e=this.document.querySelector('meta[name="csp-nonce"]');return e?e.getAttribute("content"):this.window&&this.window.cspNonce?this.window.cspNonce:null}cleanupInjectedStyles(){Array.from(this.document.head.children).filter(e=>e.tagName==="STYLE"&&e.hasAttribute("ng-state-transfer")).forEach(e=>this.renderer.removeChild(this.document.head,e))}static{this.\u0275fac=function(t){return new(t||o)(a(O),a(I),a(w),a(y))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();function wr(o,Rr,e,t,r,i){let s=typeof window>"u"?"server":"browser";return new j(o,s,e,t,r,i)}var Qt={provide:j,useFactory:wr,deps:[U,_,d,S,R]};var ie=(()=>{class o{constructor(e,t){this.s3=e,this.platformId=t,this.menu$=this.s3Lookup("menu.json").pipe($(r=>ut(pt(r,(i,s)=>s.replace(/-[^\-]*$/,"")),(i,s)=>this.arrayItems(i)))),this.options$=this.s3Lookup("options.json"),this.sitemap$=this.s3Lookup("sitemap-data.json"),this.redirects$=this.s3Lookup("redirections.json"),this.currentWPConfig$=new lt().pipe($(r=>((r===""||r==="/")&&(r="/home"),this.getConfigFilePath(r))),this.pipeS3Lookup(),mt.asOperator())}s3Lookup(e){return!e.match(/(png)|(gif)|(jpe?g)|(bmp)/g)&&!/\.json$/i.test(e)&&(e+=".json"),e[0]!=="/"&&e.length>2&&(e="/"+e),this.s3.getFile(e).pipe($(t=>t))}pipeS3Lookup(){return e=>e.pipe(Ae(t=>this.s3Lookup(t.file)))}getWPConfig(e){let r=e===""||e==="/"?this.getConfigFilePath("/home"):this.getConfigFilePath(e);return this.s3Lookup(r)}getConfigFilePath(e){return C.isComparePath(e)&&(e=C.getCompareRootUrl(e)),C.getPath(e)}arrayItems(e,t=0){if(e.items){let r=[],i=dt(e.items);for(let s of i)r.push(this.arrayItems(s,t+1));return pe({},ft(e,"items"),{items:r})}else return pe({},e)}static{this.\u0275fac=function(t){return new(t||o)(a(j),a(v))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var Kt=(()=>{class o{constructor(e,t){this.api=e,this.logger=t,this.hasSitemap=!1,this.sitemap$=this.api.sitemap$.pipe($(r=>{this.sitemap=r;let i=this.buildRoutes(r);return this.matchers=i,r}))}canLoad(e){return this.hasSitemap?z(!0):this.api.sitemap$.pipe($(t=>{this.sitemap=t;let r=this.buildRoutes(t);return this.matchers=r,e.data={sitemapRoutes:r},!0}))}buildRoutes(e){return Object.keys(e).filter(t=>t in e&&e[t].length>0).map(t=>({group:t,urls:e[t].filter(r=>typeof r=="string")})).map(({group:t,urls:r})=>this.buildRoute(r,t))}buildActualRoutes(e){let t=de(e.filter(i=>i&&i.data),i=>i.data.group),r=de(this.matchers.filter(i=>i&&i.data),i=>i.group);return ht(t,(i,s)=>{let n=r[s];if(n)return n.data.group=s,{matcher:n.matcher,loadChildren:i.loadChildren,data:n.data}}).filter(i=>i)}matchSegments(e,t){let r=[];for(let i=0;i<t.length;i++)!ue(e[i])&&!ue(t[i])&&e[i].path===t[i]&&r.push(e[i]);return r}matchSegmentsPartial(e,t,r=0){let i=[];for(let s=0;s<(r||t.length);s++)e[s]&&t[s]&&e[s].path&&e[s].path===t[s]&&i.push(e[s]);return i}buildMatcher(e,t){return(r,i,s)=>{try{let n=r.map(h=>h.path),c=t.map(h=>this.matchSegments(r,h)),l=fe(c.filter(h=>h.length>0),h=>h.length);return l&&l.length>0&&l.length===r.length?{consumed:Z(l,h=>h.length)}:null}catch(n){this.logger.logWarn("Crash in buildMatcher for "+e,n,n.stack,r)}}}buildPrefixMatcher(e,t,r=0){return(i,s,n)=>{try{let c=i.map(p=>p.path),l=t.map(p=>this.matchSegmentsPartial(i,p,r)),h=fe(l.filter(p=>p&&p.length>0),p=>p.length);if(h&&h.length>0){let p=Z(h,b=>b.length);if(p)return this.logger.logInfo(`PrefixMatcher: ${e} HIT:`,p),{consumed:p}}return null}catch(c){this.logger.logWarn("Crash in buildPrefixMatcher for "+e,c,i)}}}buildExactMatcher(e,t){return(r,i,s)=>{try{let n=r.map(h=>h.path),c=t.map(h=>n===h?r:this.matchSegments(r,h)),l=Z(c.filter(h=>h&&h.length>0),h=>h.length);return l&&r&&l.length===r.length?{consumed:l}:null}catch(n){this.logger.logWarn("Crash in buildExactMatcher for "+e,n,r)}}}buildRoute(e,t){let r=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/,i=e.map(l=>X(l.replace(r,"$3")).split("/"));return{matcher:({category:l=>this.buildPrefixMatcher(t,l,0),provider:l=>this.buildPrefixMatcher(t,l,1),post:l=>this.buildExactMatcher(t,l),team_member:l=>this.buildExactMatcher(t,l),page:l=>this.buildExactMatcher(t,l),archive:l=>this.buildExactMatcher(t,l),latest_offer:l=>this.buildExactMatcher(t,l),star_rating_new:l=>this.buildExactMatcher(t,l),brand_page:l=>this.buildPrefixMatcher(t,l,0)}[t]||(l=>this.buildMatcher(t,l)))(i),group:t,data:{urls:e}}}static{this.\u0275fac=function(t){return new(t||o)(a(ie),a(d))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o}
5)();var Jt=(()=>{class o{constructor(e,t,r){this.document=t,this.platformId=r,this.renderer=e.createRenderer(this.document,null)}loadStyle(e){let t;A(this.platformId)?t=this.document.querySelector(`link[href="${e}"]`):t=this.document.head.children.filter(r=>r.name==="style"&&r.attribs.href&&r.attribs.href===e)[0],t||(t=this.renderer.createElement("link"),t.type="text/css",t.rel="stylesheet",t.href=e,this.renderer.appendChild(this.document.head,t))}static{this.\u0275fac=function(t){return new(t||o)(a(y),a(I),a(v))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var oe=(()=>{class o{constructor(e){this.userAgent=e}isMobile(){let e=this.userAgent.device.vendor,t=this.userAgent.device.model;return!!(e&&t)}getBrowser(){return this.userAgent.browser.name}static{this.\u0275fac=function(t){return new(t||o)(a(He))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var Xt=(()=>{class o{constructor(e,t,r,i){this.platformId=e,this.userAgentService=t,this.environment=r,this.router=i}canActivateChild(e,t){let r=Qe(Ke(t.url)),i=this.userAgentService.getBrowser()==="IE";return M(this.platformId)?!0:A(this.platformId)?i&&this.environment.envName!=="dev"?this.router.parseUrl(r):!0:this.environment.envName==="dev"?!0:this.router.parseUrl(r)}static{this.\u0275fac=function(t){return new(t||o)(a(v),a(oe),a(S,8),a(f))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var Zt=(()=>{class o{constructor(){this.removeEmpty=e=>(Object.keys(e).forEach(t=>{e[t]&&typeof e[t]=="object"?this.removeEmpty(e[t]):(e[t]==null||!e[t])&&delete e[t]}),e)}getAllDefaultValues(){return this.getDefaultState()}getTextFromDefaultValues(e){let r=this.getAllDefaultValues().find(i=>i.value===e.replace(" ","+"));return r!=null&&(e=r.text),e}getDefaultState(e="",t){let r=[{text:"ACT",value:"ACT"},{text:"NSW",value:"NSW"},{text:"NT",value:"NT"},{text:"QLD",value:"QLD"},{text:"SA",value:"SA"},{text:"TAS",value:"TAS"},{text:"VIC",value:"VIC"},{text:"WA",value:"WA"}];return t!=null&&e===""&&(r=[{text:t,value:e}].concat(r)),this.processDefaultValue(r,e)}processDefaultValue(e,t){if(t!=null){let r=e.findIndex(i=>i.value===t);e[r]!=null&&(e[r].selected=!0)}return e}getReasons(e="",t){let r=[{text:"I would like to know what my borrowing power is",value:"I would like to know what my borrowing power is"},{text:"I would like to ensure my credit information is accurate",value:"I would like to ensure my credit information is accurate"},{text:"I would like to improve my credit score",value:"I would like to improve my credit score"},{text:"I would like to know so I can qualify for better credit card offers",value:"I would like to know so I can qualify for better credit card offers"},{text:"I am interested in my financial health",value:"I am interested in my financial health"},{text:"I would like to know if my score has changed since the introduction of comprehensive credit reporting",value:"I would like to know if my score has changed since the introduction of comprehensive credit reporting"},{text:"I am interested in buying a home",value:"I am interested in buying a home"},{text:"I am looking to buy a car",value:"I am looking to buy a car"}];return t!=null&&e===""&&(r=[{text:t,value:e}].concat(r)),this.processDefaultValue(r,e)}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var er=(()=>{class o{constructor(){this.creditScoreState$=new G(null),this.storageKey="credit-score"}getCreditScoreState(){return this.creditScoreState$.asObservable()}setCreditScoreState(e,t,r){let i={score:e||null,state:t||null,name:r||null};return this.validState(i)?(this.creditScoreState$.next(i),!0):(this.creditScoreState$.next(null),!1)}validState(e){let t=e.score&&!isNaN(e.score),r=typeof e.state=="string"&&e.state!=="",i=typeof e.state=="string"&&e.state!=="";return t&&r&&i}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var V=(()=>{class o{constructor(e,t){this.document=t,this.renderer=e.createRenderer(this.document,null)}addClass(e,t){this.renderer.addClass(e,t)}removeClass(e,t){this.renderer.removeClass(e,t)}static{this.\u0275fac=function(t){return new(t||o)(a(y),a(I))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o}
5)();var rr=(()=>{class o{constructor(e,t){this.document=t,this.renderer=e.createRenderer(this.document,null)}replaceElement(e,t,r,i,s){let n=this.findElements(e,t),c={};n.forEach(l=>{s&&(c=s.reduce((h,p)=>(h[p]=l.attributes[p].value,h),{})),this.replaceElementWithWebComponent(l,r,c,i)})}findElements(e,t){let r=e.map(i=>i.nativeElement?.querySelectorAll(t));return[].concat.apply([],...r)}replaceElementWithWebComponent(e,t,r={},i){let s=this.renderer.createElement(t);Object.keys(r).forEach(n=>{this.renderer.setAttribute(s,n,r[n])}),i&&this.renderer.addClass(s,i),e.replaceWith(s)}static{this.\u0275fac=function(t){return new(t||o)(a(y),a(I))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var ae=(()=>{class o{constructor(e,t){this.store=e,this.router=t,this.advancedRoutesConfig=[{category:"home-loans",routes:[{path:/^(.+)-(variable|[1235]-year-fixed)-rate-home-loans\/?$/,callback:this.checkBrandLoanType,title:"$1 $2 Rate Home Loans",metaDescription:"Compare $1 $2 Rate Home Loans. Compare the interest rates, fee's, and Canstar's Star Rating plus more."},{path:/^(.+)-home-loans-with-([^\/]+)\/?$/,callback:this.checkBrandFeature,title:"$1 Home Loans with $2",featureMap:{"offset-accounts":"Offset Accounts","redraw-facilities":"Redraw Facilities","pre-approval":"Pre-Approval","full-online-application":"Full Online Application"},metaDescription:"Compare $1 Home Loans with $2. Compare the interest rates, fee's, and Canstar's Star Rating plus more."},{path:/^(.+)-vs-([^\/]+)\/?$/,callback:this.checkBrandVersus,title:"$1 vs $2 Home Loans",metaDescription:"Compare $1 vs $2 variable Home Loans. Compare the interest rates, fee's, and Canstar's Star Rating plus more."}]}]}isAdvancedRoutingPath(){return new g(e=>{this.getMatchingRoute().pipe(x(1)).subscribe(t=>{e.next(!!t),e.complete()})})}getAdvancedRoutePageTitle(){return new g(e=>{this.getMatchingRoute().pipe(x(1)).subscribe(t=>{if(t){let r=t.route.title;t.formattedMatches.forEach((i,s)=>r=r.replace(`$${s+1}`,i)),e.next(r)}else e.next(null);e.complete()})})}getAdvancedRoutePageMetaDescription(){return new g(e=>{this.getMatchingRoute().pipe(x(1)).subscribe(t=>{if(t){let r=t.route.metaDescription;t.formattedMatches.forEach((i,s)=>r=r.replace(`$${s+1}`,i)),e.next(r)}else e.next(null);e.complete()})})}getMatchingRoute(){return new g(e=>{let t=[],i=C.getPath(this.router.url).split("/");if(i[0]===""&&(i=i.slice(1)),i.length===3){let s=i[1],n=i[2];for(let c of this.advancedRoutesConfig)if(c.category===s){let l=c.routes;for(let h of l){let p=n.match(h.path);p&&(p=p.slice(1),t.push(h.callback.call(this,h,...p)))}}}t.length===0?(e.next(null),e.complete()):je(t).subscribe(s=>{let n=null;
5s.forEach(c=>{c&&c.formattedMatches&&(n=c)}),e.next(n),e.complete()})})}checkBrandLoanType(e,t,r){return new g(i=>{this.getBrand(t).pipe(x(1)).subscribe(s=>{if(s){let n=r.replace(/\-/g," ").replace(/(^\w)|(\W\w)/g,c=>c.toUpperCase());i.next({route:e,formattedMatches:[s,n]})}else i.next(null);i.complete()})})}checkBrandFeature(e,t,r){return new g(i=>{this.getBrand(t).pipe(x(1)).subscribe(s=>{let n=e.featureMap[r];s&&n?i.next({route:e,formattedMatches:[s,n]}):i.next(null),i.complete()})})}checkBrandVersus(e,t,r){let i=[],s,n;return this.getBrand(t).subscribe(c=>{c&&(s=c)}),this.getBrand(r).subscribe(c=>{c&&(n=c)}),i=s&&s.localeCompare(n)>0?[n,s]:[s,n],new g(c=>{s&&n?c.next({route:e,formattedMatches:i}):c.next(null),c.complete()})}getBrand(e){return new g(t=>{this.store.select(E).pipe(x(1)).subscribe(r=>{r.brands?t.next(r.brands[e]):t.next(null),t.complete()})})}static{this.\u0275fac=function(t){return new(t||o)(a(T),a(f))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var ir=(()=>{class o{constructor(e){this.router=e}parseParent(e){return e.replace("#","")||this.router.url}static{this.\u0275fac=function(t){return new(t||o)(a(f))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var or=(()=>
5{class o{constructor(e,t,r,i){this.authStorageService=e,this.el=r,this.elementClassesService=i,this.validationMessages={"User not found or invalid hash":"Invalid Email or Password.","Missing parameter: username":"Sorry, we need your email.","User already registered":"That email is already in use. Please log in.","Invalid parameter: full_name":"Invalid character. Name must only contain alphabet characters.","User not found":"","Invalid parameter: username":"Please provide a valid email."},this.renderer=t.createRenderer(this.el,null)}submitError(e,t,r=""){this.formName=t,t==="forgot-password"&&r!==""&&(this.username=r),e.status===403&&this.authStorageService.logout(),this.resetValidationClass();let i=this.errorMessage(e,this.validationMessages);return this.appendErrorMessage(i,this.formName,"removeClass")}setTargetForm(e){return e||this.formName}removeInvalidClass(e,t=""){this.formName=this.setTargetForm(t);let r=`#${this.formName} form`,i=this.el.nativeElement.querySelector(`${r} .${e}`);this.elementClassesService.removeClass(i,"invalid-field")}resetValidationClass(e=""){this.formName=this.setTargetForm(e),this.formName==="sign-up"&&this.removeInvalidClass("full_name"),(this.formName==="sign-in"||this.formName==="sign-up")&&(this.removeInvalidClass("username"),this.removeInvalidClass("hash")),this.formName==="forgot-password"&&this.removeInvalidClass("username")}targetInputValidation(e){e==="Invalid parameter: full_name"?this.addClassValidation("full_name"):e==="Invalid parameter: username"||e==="Missing parameter: username"||e==="User already registered"||e==="User not found"?this.addClassValidation("username"):e==="User not found or invalid hash"&&(this.addClassValidation("username"),this.addClassValidation("hash"))}addClassValidation(e,t=""){this.formName=this.setTargetForm(t);let r=`#${this.formName} form .${e}`,i=this.el.nativeElement.querySelector(r);this.elementClassesService.addClass(i,"invalid-field")}errorMessage(e,t){let r="",i=[];try{r=JSON.parse(e._body).errors}catch{r=void 0}let s="Something went wrong with your submission.";return e.status===400?(this.triggerValidationError(r),i=Array.isArray(r)?r.map(n=>{if(tt(t,n))return n==="User not found"?(this.targetInputValidation(n),`No account exists for ${this.username}. Maybe you signed up using a different/incorrect e-mail address.`):(this.targetInputValidation(n),n=t[n],typeof n=="function"&&(n=n()),n)}):void 0,s=i.join("<br/>")):e.status===403&&(s="Not logged in. Please log back in again."),s}triggerValidationError(e){let t=[];Array.isArray(e)?e.forEach(r=>t.push({type:r,field:"N/A"})):e.forEach((r,i)=>t.push({type:r.type,field:i}))}appendErrorMessage(e,t,r){let i,s=`#${t} .invalid > span`,n=`#${t} .invalid`,c=this.el.nativeElement.querySelector(s).innerHTML,l="<br />";t==="sign-in"?i=this.el.nativeElement.querySelector(n):t==="sign-up"?i=this.el.nativeElement.querySelector(n):(i=this.el.nativeElement.querySelector(n),this.el.nativeElement.querySelector(`#${t} .btn-reset`).removeAttribute("disabled")),t!=="forgot-password"&&c.length&&c.indexOf(e)<0&&(e=c+l+e),this.el.nativeElement.querySelector(s).append(e),r==="removeClass"?this.elementClassesService.removeClass(i,"hide"):this.elementClassesService.addClass(i,"hide")}hideError(e,t){this.appendErrorMessage(e,t,"addClass")}static{this.\u0275fac=function(t){return new(t||o)(a(L),a(y),a(K),a(V))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var sr=(()=>{class o{constructor(){this.config={attributes:!0,childList:!0,subtree:!0,characterData:!0}}observeOnMutation(e,t){return new g(r=>{let i=new MutationObserver((n,c)=>{r.next(n)});return i.observe(e,t||this.config),()=>{i.disconnect()}})}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var ne=(()=>
5{class o{constructor(e,t,r,i){this.store=e,this.s3Service=t,this.logger=r,this.primaryCategoryActions=i,this.subs=[]}init(){this.store.select(E).pipe(q(e=>e!==null)).subscribe(e=>{this.subs.forEach(t=>t.unsubscribe()),this.subs=[],nt(e)||(this.setPrimaryCategory(e),this.setSelectorCategory(e))})}setPrimaryCategory(e){let t=e;if(t&&t.yoast&&t.yoast.primary_category){let r=e.yoast.primary_category;this.primaryCategorySlug=r}else{let r=t.route.split("/").filter(i=>!!i);r[1]==="page"&&!Number.isNaN(Number(r[2]))?this.primaryCategorySlug=r[0]:t&&t.categories&&t.categories.length>0?this.primaryCategorySlug=t.categories[t.categories.length-1].slug:t.taxonomy==="category"&&r[1]!==null?this.primaryCategorySlug=r[0]:this.primaryCategorySlug=""}if(this.primaryCategorySlug!==""){let r=`/${this.primaryCategorySlug}`;this.logger.logInfo(`Primary category: ${this.primaryCategorySlug}`),this.primaryCategorySlug.match(/(png)|(gif)|(jpe?g)|(bmp)/g)||(r+=".json"),this.subs.push(this.s3Service.getFile(r).subscribe(i=>{this.store.dispatch(this.primaryCategoryActions.setPrimaryCategory(i))},()=>{this.store.dispatch(this.primaryCategoryActions.setPrimaryCategory(null))}))}else this.store.dispatch(this.primaryCategoryActions.setPrimaryCategory(null))}setSelectorCategory(e){this.selectorSlug$=new G(null),this.subs.push(this.selectorSlug$.pipe(q(t=>t!==null)).subscribe(t=>{if(this.logger.logInfo(`Sidebar selector category: ${t}`),t===e.slug&&F(e,["taxonomy"])==="category")this.store.dispatch(this.primaryCategoryActions.setSelectorCategory(e));else if(t===this.primaryCategorySlug)this.subs.push(this.store.select(he).subscribe(r=>{this.store.dispatch(this.primaryCategoryActions.setSelectorCategory(r))}));else{let r=`/${t}`;r.match(/(png)|(gif)|(jpe?g)|(bmp)/g)||(r+=".json"),this.subs.push(this.s3Service.getFile(r).subscribe(i=>{this.store.dispatch(this.primaryCategoryActions.setSelectorCategory(i))},i=>{this.logger.logInfo(`Set selector category: ${i}`),this.store.dispatch(this.primaryCategoryActions.setSelectorCategory(null))}))}})),this.calcSelectorCategorySlug(e,!0)}calcSelectorCategorySlug(e,t=!1){if(!e)return null;let r=this.getSelectorOverride(e);r?this.selectorSlug$.next(r):t===!0?this.subs.push(this.store.select(he).subscribe(i=>{this.calcSelectorCategorySlug(i)})):this.selectorSlug$.next(e.slug)}getSelectorOverride(e){let t="";if(F(e,["acf","sidebar_content_row"])){let i=e.acf.sidebar_content_row.find(s=>s.acf_fc_layout==="comp_select");i&&(t=i.cat)}return t}extractPrimaryCategory(e){if(e&&e.yoast&&e.yoast.primary_category)return e.yoast.primary_category;if(e&&e.yoast&&e.yoast.primary_comparison_category)return e.yoast.primary_comparison_category;if(e&&e.categories){let t=e.categories[e.categories.length-1];if(t&&t.slug&&t.taxonomy)return t.taxonomy==="comparison_category"?`${t.taxonomy}/${t.slug}`:t.slug;if(t&&t.slug)return t.slug}return""}static{this.\u0275fac=function(t){return new(t||o)(a(T),a(j),a(d),a(kt))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var ar=(()=>{class o{constructor(e){this.router=e}superRiskQuestions(){return[{key:"q[1]",prefix_text:"In general, how would your best friend describe you as a risk taker?",prefix_text_sub:"",options:[{displayText:"A real gambler",choice:"a",value:"4"},{displayText:"Willing to take risks after completing adequate research",choice:"b",value:"3"},{displayText:"Cautious",choice:"c",value:"2"},{displayText:"A real risk avoider",choice:"d",value:"1"}]},{key:"q[2]",prefix_text:"You are on a TV game show and can choose one of the following, which would you take?",prefix_text_sub:"",options:[{displayText:"$1,000 in cash",choice:"a",value:"1"},{displayText:"A 50% chance at winning $5,000",choice:"b",value:"2"},{displayText:"A 25% chance at winning $10,000",choice:"c",value:"3"},{displayText:"A 5% chance at winning $100,000",choice:"d",value:"4"}]},{key:"q[3]",prefix_text:"You have just finished saving for a \u201Conce-in-a-lifetime\u201D holiday. Three weeks before you plan to leave, you lose your job. You would:",prefix_text_sub:"",options:[{displayText:"Cancel the vacation",choice:"a",value:"1"},{displayText:"Take a much more modest vacation",choice:"b",value:"2"},{displayText:"Go as scheduled, reasoning that you need the time to prepare for a job search",choice:"c",value:"3"},{displayText:"Extend your holiday, because this might be your last chance to go first-class",choice:"d",value:"4"}]},{key:"q[4]",prefix_text:"If you unexpectedly received $20,000 to invest, what would you do?",prefix_text_sub:"",options:[{displayText:"Put it in your bank account or a Term Deposit",choice:"a",value:"1"},{displayText:"Invest it in safe High quality Bonds or Bond Managed Funds ",choice:"b",value:"2"},{displayText:"Invest it in stocks or Stock Managed Funds ",choice:"c",value:"3"}]},{key:"q[5]",prefix_text:"In terms of experience, how comfortable are you investing in Stocks or Stock Managed funds?",prefix_text_sub:"",options:[{displayText:"Not at all comfortable",choice:"a",value:"1"},{displayText:"Somewhat comfortable",choice:"b",value:"2"},{displayText:"Very comfortable",choice:"c",value:"3"}]},{key:"q[6]",prefix_text:"When you think of the word \u201Crisk\u201D, which of the following words comes to mind first?",prefix_text_sub:"",options:[{displayText:"Loss",choice:"a",value:"1"},{displayText:"Uncertainty",choice:"b",value:"2"},{displayText:"Opportunity",choice:"c",value:"3"},{displayText:"Thrill",choice:"d",value:"4"}]},{key:"q[7]",prefix_text:"What would you do?",prefix_text_sub:"Some experts are predicting prices of assets such as gold, jewels, collectibles, and real estate (hard assets) to increase in value; bond prices may fall, however, experts tend to agree that government bonds are relatively safe. Most of your investment assets are now in high interest government bonds. ",options:[{displayText:"Hold the bonds",choice:"a",value:"1"},{displayText:"Sell the bonds, put half the proceeds into money market accounts, and the other half into hard assets",choice:"b",value:"2"},{displayText:"Sell the bonds and put the total proceeds into hard assets",choice:"c",value:"3"},{displayText:"Sell the bonds, put all the money into hard assets, and borrow additional money to buy more",choice:"d",value:"4"}]},{key:"q[8]",prefix_text:"Given the best and worst case returns of the four investment choices below, which would you prefer?",prefix_text_sub:"",options:[{displayText:"$200 gain best case; $0 gain/loss worst case",choice:"a",value:"1"},{displayText:"$800 gain best case; $200 loss worst case",choice:"b",value:"2"},{displayText:"$2,600 gain best case; $800 loss worst case",choice:"c",value:"3"},{displayText:"$4,800 gain best case; $2,400 loss worst case",choice:"d",value:"4"}]},{key:"q[9]",prefix_text:"In addition to whatever you own, you have been given $1,000. You are now asked to choose between:",prefix_text_sub:"",options:[{displayText:"A sure gain of $500",choice:"a",value:"1"},{displayText:"A 50% chance to gain $1,000 and a 50% chance to gain 
5nothing",choice:"b",value:"3"}]},{key:"q[10]",prefix_text:"In addition to whatever you own, you have been given $2,000. You are now asked to choose between:",prefix_text_sub:"",options:[{displayText:"A sure loss of $500",choice:"a",value:"1"},{displayText:"A 50% chance to lose $1,000 and a 50% chance to lose nothing",choice:"b",value:"3"}]},{key:"q[11]",prefix_text:"Which one would you select?",prefix_text_sub:"Suppose a relative left you an inheritance of $100,000, stipulating in the will that you invest ALL the money in ONE of the following choices.",options:[{displayText:"A savings account or Term Deposit",choice:"a",value:"1"},{displayText:"A Managed fund that owns stocks and bonds",choice:"b",value:"2"},{displayText:"A portfolio of 15 well known company stocks",choice:"c",value:"3"},{displayText:"Commodities like gold, silver, and oil",choice:"d",value:"4"}]},{key:"q[12]",prefix_text:"If you had to invest $20,000, which of the following investment choices would you find most appealing?",prefix_text_sub:"",options:[{displayText:"60% in low-risk investments, 30% in medium-risk investments, 10% in high-risk investments",choice:"a",value:"1"},{displayText:"30% in low-risk investments, 40% in medium-risk investments, 30% in high-risk investments",choice:"b",value:"2"},{displayText:"10% in low-risk investments, 40% in medium-risk investments, 50% in high-risk investments",choice:"c",value:"3"}]},{key:"q[13]",prefix_text:"If you had the money, how much would you invest?",prefix_text_sub:"Your trusted friend and neighbour, an experienced geologist, is putting together a group of investors to fund an exploratory gold mining venture. The venture could pay back 50 to 100 times the investment if successful. If the mine is a bust, the entire investment is worthless. Your friend estimates the chance of success is only 20%. ",options:[{displayText:"Nothing",choice:"a",value:"1"},{displayText:"One month\u2019s salary",choice:"b",value:"2"},{displayText:"Three month\u2019s salary",choice:"c",value:"3"},{displayText:"Six month\u2019s salary",choice:"d",value:"4"}]}]}getRiskAnswers(e){(Object.keys(e).length<1||!this.validateParams(e))&&this.router.navigate(["/super-risk-tolerance/questionnaire"]);let t=[];return Object.entries(e).forEach(([r,i])=>{let s=i.toString();t.push({qNum:r,selectedOption:s,value:this.getRiskValue(r,s)})}),t}validateParams(e){let t=this.superRiskQuestions(),r=t.map(s=>s.key),i=!0;return Object.entries(e).forEach(([s,n])=>{(r.indexOf(s)===-1||t.find(h=>h.key===s).options.map(h=>h.choice).indexOf(n)===-1)&&(i=!1)}),i}getRiskValue(e,t){let s=this.superRiskQuestions().find(l=>l.key===e).options.filter(l=>l.choice===t);return F(s,["0","value"])?parseInt(s[0].value,10):0}getRiskToleranceDescriptors(){return[{key:"low",level:"Low",minScore:1,maxScore:23,measure:[{desc:"Very Low",value:1},{desc:"Low",value:2}],productIds:["841155742009970253832","136950042469542747032","-103049008319268952132"],investment_approach:"Conservative",investment_mindset:"Uncertain",financial_risk_approach:"Looking to Avoid",image:"https://www.canstar.com.au/wp-content/uploads/2021/05/low-category.png"},{key:"low_to_moderate",level:"Low to Moderate",minScore:24,maxScore:30,measure:[{desc:"Medium to Low",value:3}],productIds:["136950042469542747032","-103049008319268952132","841155742009970253832"],investment_approach:"Conservative to Balanced",investment_mindset:"Investigating",financial_risk_approach:"Generally Avoid",image:"https://www.canstar.com.au/wp-content/uploads/2021/05/low-moderate-category.png"},{key:"moderate",level:"Moderate",minScore:31,maxScore:36,measure:[{desc:"Medium",value:4},{desc:"Medium to High",value:5}],productIds:["-103049008319268952132","841155742009970253832","136950042469542747032"],investment_approach:"Balanced",investment_mindset:"Considered",financial_risk_approach:"Willing to Accept",image:"https://www.canstar.com.au/wp-content/uploads/2021/05/moderate-category.png"},{key:"high",level:"High",minScore:37,maxScore:44,measure:[{desc:"High",value:6}],productIds:["841155742009970253832","136950042469542747032","-103049008319268952132"],investment_approach:"Aggressive",investment_mindset:"Confident",financial_risk_approach:"Accepting",image:"https://www.canstar.com.au/wp-content/uploads/2021/04/high-category.png"}]}computeTotalRiskValue(e){let t=0,r=0;return e.forEach(i=>
5{i.qNum==="q[9]"||i.qNum==="q[10]"?r+=i.value:t+=i.value}),t+=r/2,t}interpretTotalRiskValue(e){let t=this.getRiskToleranceDescriptors(),r={toleranceScore:e,toleranceDescription:"Low",riskMeasure:[]},i=t.find(s=>Ot(e,s.minScore-1,s.maxScore+1));return i&&(r.toleranceDescription=i.level,r.riskMeasure=i.measure),r}static{this.\u0275fac=function(t){return new(t||o)(a(f))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var nr=ce(_t(),1);var cr=(()=>{class o{constructor(e,t,r,i,s,n,c,l,h,p,b){this.store=e,this.titleService=t,this.languageService=r,this.router=s,this.logger=n,this.platformId=c,this.document=l,this.environment=h,this.advancedRoutingService=p,this.primaryCatService=b,this.canonicalExceptions=["providers","compare"],this.siteUrlAu="",this.siteUrlNz="",this.renderer=i.createRenderer(this.document,null),this.siteUrlAu=this.environment.site==="gold"?this.environment.siteUrlGoldAu:this.environment.siteUrlBlueAu,this.siteUrlNz=this.environment.site==="gold"?this.environment.siteUrlGoldNz:this.environment.siteUrlBlueNz}init(){let e=this.store.select(E),t=this.router.events;Y([e,t]).pipe(q(([r,i])=>r!==null&&i instanceof J)).subscribe(([r,i])=>{if(A(this.platformId)){let s=Array.from(this.document?.head?.querySelectorAll('link:not([rel="icon"]):not([rel="stylesheet"]), meta:not([charset]):not([name="viewport"])'));s&&s.forEach(n=>this.renderer.removeChild(this.document.head,n))}this.setPageTitle(r),this.setHrefLang(r),this.setAdvancedRoutingMetaDescription(),this.setNoIndexMeta(),this.setFbInsights(),this.setCategoryAndVerticalMeta(r),r.yoast&&(this.setMetaRobots(r.yoast),this.setYoastMeta(r.yoast),this.setSocialMeta(r.yoast),this.setMetaDescription(r.yoast),r.post_status!=="draft"&&!i.url.startsWith("/preview/")&&this.setCanonicalUrl(r))})}setPageTitle(e){if(/^(\/\?s=)/.test(this.router.url)){let t=this.router.routerState.snapshot.root.queryParams.s;return this.titleService.setTitle(`You searched for ${t} | Canstar`)}this.advancedRoutingService.getAdvancedRoutePageTitle().pipe(x(1)).subscribe(t=>{let r="Canstar";t?(C.isCreditCardsBrandVersus(this.router.url)&&(t=`${t.replace("Cards","Card")} Comparison`),r=`${t} | Canstar`):e.yoast&&e.yoast.title?r=e.yoast.title:e.title?r=`${e.title} | Canstar`:e.label?r=`${e.label} | Canstar`:e.name&&(r=`${e.name} | Canstar`);let i=this.router.url.match(/\/page\/(\d+)\/?$/);if(i){let s=+i[1];return r=r.replace("| Canstar",""),this.titleService.setTitle(`${e.name} - Page ${s} | Canstar`)}this.titleService.setTitle(r)})}setAdvancedRoutingMetaDescription(){this.advancedRoutingService.isAdvancedRoutingPath().pipe(x(1)).subscribe(e=>{e&&this.advancedRoutingService.getAdvancedRoutePageMetaDescription().pipe(x(1)).subscribe(t=>{t&&this.addElement("meta",[{name:"name",val:"description"},{name:"content",val:t}])})})}setCanonicalUrl(e){this.advancedRoutingService.isAdvancedRoutingPath().pipe(x(1)).subscribe(t=>{let r=this.languageService.getCurrentLanguage().urlSpecifier,i,s=this.router.url,{link:n}=e,{yoast:c}=e;if(t){let p=s.split("?");i=P(`${this.siteUrlAu}${p[0]}`)}else{let p=this.primaryCatService.extractPrimaryCategory(e),b=this.router.parseUrl(n.replace(`${this.siteUrlAu}/`,""));this.isExceptionToCanonical(s)?i=P(n):e.type==="sub-hub"?i=c.canonical||n:this.hasSubCategory(p)?(b.root.children.primary.segments[0].path=p.split("/")[0],b.root.children.primary.segments[1].path=p.split("/")[1],i=this.RemoveSubCategory(e,P(`${this.siteUrlAu}${this.router.serializeUrl(b)}`))):p?(b.root.children.primary.segments[0].path=p,c.canonical?i=c.canonical:i=this.RemoveSubCategory(e,P(`${this.siteUrlAu}${this.router.serializeUrl(b)}`))):i=P(c.canonical?c.canonical:n)}let l=i.substring(this.siteUrlAu.length).split("/");if(e.type==="brand_page"&&l[1]!=="providers"){l[1]="providers";let p=l.join("/");i=`${this.siteUrlAu}${p}`}!this.languageService.isEnglishActive()&&!i.startsWith(`${this.siteUrlAu}/${r}/`)&&(i=`${this.siteUrlAu}/${r}${i.substring(this.siteUrlAu.length)}`),this.addElement("link",[{name:"rel",val:"canonical"},{name:"href",val:i}]);let h=i.match(/\/page\/(\d+)\//);if(h){let p=parseInt(h[1],10),b=p+1,Sr=i.replace(/\/page\/\d+\//,`/page/${b}/`);this.addElement("link",[{name:"rel",val:"next"},{name:"href",val:Sr}]);let we=p-1,br=we===1?i.replace(/\/page\/\d+\//,"/"):i.replace(/\/page\/\d+\//,`/page/${we}/`);this.addElement("link",[{name:"rel",val:"prev"},{name:"href",val:br}])}})}RemoveSubCategory(e,t){let r=`${e.route.split("/")[2]}/`;return r&&r.indexOf(e.slug)===-1?t.replace(r,""):t}setMetaDescription(e){let t=e.metadesc||e.desc;t&&this.addElement("meta",[{name:"name",val:"description"},{name:"content",val:t}])}setMetaRobots(e){let t=/^\/[^\s]*\(modal:load\/auth[^\)]*\)\/?$/.test(this.router.url),r=e["newssitemap-robots-index"]==="1"?"noindex":"index",i=t?"noindex":e["meta-robots-noindex"],s=t?"nofollow":e["meta-robots-nofollow"];r==="noindex"&&this.addElement("meta",[{name:"name",val:"Googlebot-News"},{name:"content",val:r}]);let n="";i==="index"&&s==="follow"&&(n=",max-snippet:-1, max-image-preview:large, max-video-preview:-1"),this.addElement("meta",[{name:"name",val:"robots"},{name:"content",val:`${i},${s}${n}`}])}setSocialMeta(e){this.addElement("meta",[{name:"property",val:"og:title"},{name:"content",val:e.title||""}]),this.addElement("meta",[{name:"property",val:"twitter:title"},{name:"content",val:e.title||""}])}setFbInsights(){this.addElement("meta",[{name:"property",val:"fb:app_id"},{name:"content",val:this.environment.facebookAppId}])}setYoastMeta(e){if(e.metatags){let t=[{name:"name",val:"robots"},{name:"name",val:"description"},{name:"rel",val:"canonical"},{name:"property",val:"og:title"},{name:"name",val:"twitter:title"}];nr.load(e.metatags)("meta, link").each((i,{tagName:s,attribs:n})=>{let c=[];for(let l in n)c.push({name:l,val:n[l]});c.some(l=>
5t.some(h=>JSON.stringify(h)===JSON.stringify(l)))||this.addElement(s,c)})}else this.logger.logWarn("No yoast metatags found for this page")}setHrefLang(e){let t=this.router.url.includes("?")?this.router.url.split("?")[0]:this.router.url,r=e.acf&&e.acf.add_hreflang===!0&&e.acf.hreflang_url,i=this.languageService.isChineseEnabled();if(r&&this.addElement("link",[{name:"rel",val:"alternate"},{name:"href",val:`${this.siteUrlNz}/${e.acf.hreflang_url}`},{name:"hreflang",val:"en-nz"}]),i){let s=`${this.siteUrlAu}/zh${t}/`;this.addElement("link",[{name:"rel",val:"alternate"},{name:"href",val:s},{name:"hreflang",val:"zh-au"}])}if(r||i){let s=`${this.siteUrlAu}${t}`;this.addElement("link",[{name:"rel",val:"alternate"},{name:"href",val:s},{name:"hreflang",val:"en-au"}])}}addElement(e,t){let r=this.renderer.createElement(e);t.forEach(i=>{i.name==="href"&&(i.val=P(i.val)),this.renderer.setAttribute(r,i.name,i.val)}),this.renderer.appendChild(this.document.head,r)}isExceptionToCanonical(e){let t=e.split("/").filter(Boolean)[0];return this.canonicalExceptions.some(r=>t===r)}hasSubCategory(e){return e.split("/").length>1}setNoIndexMeta(){this.router.url.split("/")[2]==="gp-422-test-page"&&this.addElement("meta",[{name:"name",val:"robots"},{name:"content",val:"noindex"}])}getPageType(e){let t=e.acf,r=t?.whitelabel_enabled&&t?.whitelabel_page_type||e.type||e.taxonomy;switch(r){case"sub-hub":return"SUB_HUB";case"hub":case"category":return e.acf?.apollo_vertical?.value&&(e.acf?.apollo_table_url||e.acf.apollo_selector_fields.length>0||e.acf.apollo_filter_fields.length>0)?"SUB_HUB":"HUB";case"post":return"ARTICLE";case"star-rating":return"STAR_RATING";case"award":return"AWARD";default:return r}}addMetaTag(e,t){this.addElement("meta",[{name:"name",val:e},{name:"content",val:t}])}setCategoryAndVerticalMeta(e){let t=this.getPageType(e).toLowerCase();this.addMetaTag("cns_category",t),["hub","sub_hub","article"].includes(t)&&this.addMetaTag("cns_vertical",this.router.url.split("/").filter(Boolean)[0])}static{this.\u0275fac=function(t){return new(t||o)(a(T),a(Ue),a(_),a(y),a(f),a(d),a(v),a(I),a(S),a(ae),a(ne))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var lr=ce(_t(),1);var mr=(()=>{class o{constructor(e){this.router=e}formatHashUrls(e){let t=lr.load(e);return t("a[href]").map((r,i)=>{let s=t(i).attr("href"),n=s;return s.indexOf("#")!==-1&&s.indexOf("/#")!==0&&(n=s.indexOf("/#")!==-1?s:s.replace("#","/#"),n.indexOf(this.router.url)===-1&&this.router.url.indexOf(n)===-1&&(n=`${X(this.router.url)}${n}`)),t(i).attr("href",n),s}),t.html()}static{this.\u0275fac=function(t){return new(t||o)(a(f))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var hr=ce(xr(),1);var pr=(()=>{class o{constructor(e,t,r,i,s,n,c,l,h){this.store=e,this.http=t,this.v2cActions=r,this.logger=i,this.digitalService=s,this.authStorageService=n,this.storageService=l,this.environment=h,this.window=c.nativeWindow}initializeSelectorEndpoints(){this.company=new g(i=>{this.store.select(Ye).subscribe(s=>{if(s!=null)i.next(s),i.complete();else{let n=`${this.digitalService.getDigitalApiUrl()}/v2c/companies/mortgages`;this.http.get(n).subscribe(c=>{this.store.dispatch(this.v2cActions.setLenderCompany(c)),i.next(c),i.complete()},c=>{this.logger.logError("Error getting companies",c)})}})});let e=new Fe,t=this.storageService.getSessionItem("canstar_x_forwarded_for");t&&e.set("X-Forwarded-For",t);let r=`${this.environment.widgetsApiUrl}/widgets/api_v2/facets/state`;this.state=this.http.get(r,{headers:e}).pipe(Q(i=>(this.logger.logError("Error getting state",i),z({}))))}getState(){return this.state}getTop5Products(e){return new g(t=>{let r=et(e),i=`${this.digitalService.getDigitalApiUrl()}/v2c/top5`,s=this.authStorageService.getHeader("Bearer");r.sort=this.getProductSortEncoded(),this.http.get(C.generateQueryUrl(i,r),s).subscribe(n=>{t.next(n),t.complete()},n=>{this.logger.logError("Error getting top5",n)})})}getGraphData(e){let t=`${this.digitalService.getDigitalApiUrl()}/v2c/market-comparison/graph`;t=C.generateQueryUrl(t,e);let r=this.authStorageService.getHeader("Bearer");return this.http.get(t,r)}getSavings(e){let t=this.authStorageService.getHeader("Bearer");return new g(r=>{let i=C.generateQueryUrl(`${this.digitalService.getDigitalApiUrl()}/v2c/market-comparison`,e);this.http.get(i,t).subscribe(s=>{r.next(s),r.complete()},s=>{this.logger.logError("Error getting savings results",s)})})}getCompany(){return this.company}processDefaultValue(e,t){if(t!=null){let r=e.findIndex(i=>i.value===t);e[r].selected=!0}return e}getDefaultState(e="NSW"){let t=[{text:"ACT",value:"ACT"},{text:"NSW",value:"NSW"},{text:"NT",value:"NT"},{text:"QLD",value:"QLD"},{text:"SA",value:"SA"},{text:"TAS",value:"TAS"},{text:"VIC",value:"VIC"},{text:"WA",value:"WA"}];return this.processDefaultValue(t,e)}getLoanType(e="Variable"){let t=[{text:"Variable",value:"Variable"},{text:"Fixed 1 Year",value:"Fixed 1 Year"},{text:"Fixed 2 Years",value:"Fixed 2 Years"},{text:"Fixed 3 Years",value:"Fixed 3 Years"},{text:"Fixed 5 Years",value:"Fixed 5 Years"}];return this.processDefaultValue(t,e)}getRepaymentType(e="P+I"){let t=[{text:"Principal & Interest",value:"P+I"},{text:"Interest Only",value:"IO"}];return this.processDefaultValue(t,e)}getRepaymentFrequency(e="monthly"){let t=[{text:"monthly",value:"monthly"},{text:"fortnightly",value:"fortnightly"},{text:"weekly",value:"weekly"}];return this.processDefaultValue(t,e)}getTextFromDefaultValues(e){let r=this.getAllDefaultValues().find(i=>i.value.replace(" ","+")===e.replace(" ","+"));return r!=null&&(e=r.text),e}processFieldConfig(e,t){if(e.popover){let r=this.processShortCode(e.popover,t);e.popover=this.getPopoverConfig(r)}return e}getPopoverConfig(e){return{content:e,html:!0,placement:"top auto"}}processShortCode(e,t){if(t){let r=e.match(/\[([\w-]+)([^]*?)(\/?)\]/g);r&&r.forEach(i=>
5{let s=i,n=i.replace(/(\[|\])/g,"");if(t[n]&&(s=t[n],n==="repayment_type"&&(s=this.getTextFromDefaultValues(t[n])),n==="remaining_year"&&(s=t[n]+(parseInt(t[n],10)>1?" years":" year"))),i.indexOf("cnslib-refinance-link")>=0){let c=i.match(/domain="(.*?)"/)[1],l=i.match(/text="(.*?)"/)[1],h=t.amount.replace(",",""),p=encodeURIComponent(t.repayment_type),b=t.state;s=`<a href="${c}/compare/home-loans/?amount=${h}&purpose=Refinance&repayment_type=${p}&state=${b}">${l}</a>`}e=e.replace(i,s)})}return e}getAllDefaultValues(){return this.getDefaultState().concat(this.getLoanType(),this.getRepaymentType(),this.getRepaymentFrequency())}getProductSortEncoded(){let e=JSON.stringify(this.getProductSortData());return(0,hr.default)(e)}getProductSortData(){return[{name:"Lowest Repayments",column:"AAPRRATE",transform:{replace:["%",""],type:"decimal"},orderby:"ASC"},{name:"Comparison Rate",column:"AAPR150K",transform:{replace:["%",""],type:"decimal"},orderby:"ASC"},{name:"alphabetically",column:"COMPANY_NAME",orderby:"ASC"}]}static{this.\u0275fac=function(t){return new(t||o)(a(T),a(U),a(At),a(d),a(re),a(L),a(w),a(R),a(S))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var ur=(()=>{class o{constructor(e,t,r,i,s){this.http=e,this.elementClassesService=t,this.el=r,this.environment=s,this.renderer=i.createRenderer(this.el,null)}submitSuccess(e){let t=`${this.environment.widgetsApiUrl}/widgets/api/auth/reset_password`;return this.http.post(t,{username:e})}resetPasswordMessage(e,t){let r=this.renderer.createElement("p"),s=this.renderer.createText("A link to reset your password has been sent to "+e);this.renderer.appendChild(r,s);let n=this.el.nativeElement.querySelector("#forgot-password .success-message");n.append(r),this.elementClassesService.removeClass(n,"hide");let c=t.target.parentElement;this.elementClassesService.addClass(c,"hide")}static{this.\u0275fac=function(t){return new(t||o)(a(U),a(V),a(K),a(y),a(S))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var xe=(()=>{class o{constructor(e){this.router=e}intercept(e,t){return t.handle(e).pipe(Q(r=>{if(r.status===0&&r?.error?.currentTarget&&"readyState"in r.error.currentTarget){let i=`http response message: ${r.message}, request readyStatus message: ${r.error.currentTarget.readyState} ${this.readStatusTrans(r.error.currentTarget.readyState)}, current route: ${this.router.url}`;return le(()=>new Error(i))}return le(()=>r)}))}readStatusTrans(e){switch(e){case 0:return"request not initialized";case 1:return"server connection established";case 2:return"request received";case 3:return"processing request";case 4:return"request finished and response is ready";default:return""}}static{this.\u0275fac=function(t){return new(t||o)(a(f))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();function dr(o){return o?"disable_google_one_tap"in o:!1}var gr=(()=>{class o{constructor(e,t,r,i,s,n,c,l,h,p){if(this.firebaseService=e,this.windowRef=t,this.authService=r,this.logger=i,this.ssoService=s,this.analyticsSrvc=n,this.store=c,this.authModalService=l,this.platformId=h,this.environment=p,this.config={client_id:this.environment.googleWebClientUrl,callback:this.handleCredentialResponse.bind(this),auto_
5select:!1,cancel_on_tap_outside:!1},this.window=this.windowRef.nativeWindow,!this.environment.googleWebClientUrl)throw new Error("GoogleOneTapService: googleWebClientUrl is not configured. Check the environment configuration.")}loadGoogleLibrary(){if(M(this.platformId)){this.logger.logInfo("GoogleOneTapService","loadGoogleLibrary","platform server: google one tap is not available");return}if(this.logger.logInfo("GoogleOneTapService","loadGoogleLibrary","setup one tap library callback"),this.windowRef.nativeWindow.onGoogleLibraryLoad=this.onGoogleOneTapLibraryLoad.bind(this),this.windowRef&&this.windowRef.nativeWindow&&this.windowRef.nativeWindow.document){let e=this.windowRef.nativeWindow.document.createElement("script");e.src="https://accounts.google.com/gsi/client",e.async=!0,e.defer=!0,this.windowRef.nativeWindow.document.head.appendChild(e),this.logger.logInfo("Google GSI client script appended to head")}}isGoogleOneTapDisabled(e){return dr(e)?e?.disable_google_one_tap:!1}handleGoogleOneTapLibraryLoad(e,t,r){if(this.isGoogleOneTapDisabled(r?.acf)){this.logger.logInfo("GoogleOneTapService","handleCredentialResponse","disabled by ACF. Not prompting google one tap","loggedIn",e,"sso",t);return}if(e===k.loggedIn||t){this.logger.logInfo("GoogleOneTapService","handleCredentialResponse","logged in, not prompting google one tap");return}this.logger.logInfo("GoogleOneTapService","handleCredentialResponse","prompting google one tap");let i=this.windowRef.nativeWindow;i.google?.accounts?.id.disableAutoSelect(),i.google?.accounts?.id.prompt()}onGoogleOneTapLibraryLoad(){return H(this,null,function*(){this.logger.logInfo("GoogleOneTapService","onGoogleOneTapLibraryLoad()","configuring the google one tap library");try{this.windowRef.nativeWindow.google?.accounts?.id.initialize(Ie(Ce({},this.config),{client_id:this.environment?.googleWebClientUrl})),Y([this.firebaseService.getUserStateWithInitialStatusObservable(),this.ssoService.isLoggedIntoFireBaseWithSSo(),this.store.select(E)]).subscribe(([e,t,r])=>this.handleGoogleOneTapLibraryLoad(e,t,r))}catch(e){this.logger.logError("GoogleOneTapService","onGoogleOneTapLibraryLoad","Unable to initialize google one tap",e)}})}handleCredentialResponse(e){return H(this,null,function*(){this.analyticsSrvc.setEvent(it,{customObjectKey:ot,type:at.LoginSubmit,parent:st.OneTap});let{given_name:t,family_name:r}=JSON.parse(atob(e?.credential.split(".")[1])),i=Tt(),s=e.credential,n=ge.credential(s);try{let l=yield(yield It(i,n)).user.getIdToken();yield this.authService.setWhitelabeLoginCookies(l);let h={firstName:t||"Canstar",lastName:r||"User",provider:"Google",signUpType:"Google SSO",signUpFrom:"one_tap"},p=this.authModalService.getSignupInputs(h);yield this.authService.register(p)}catch(c){let l=ge.credentialFromError(c);console.log(c,l)}})}addGoogleSignInButtonToDiv(e){if(!M(this.platformId))try{return this.windowRef.nativeWindow.google?.accounts?.id.renderButton(e.btnWrapper.nativeElement,{theme:"outline",size:e.size,width:e.width,text:e.text}),!0}catch(t){return console.error("ERROR LOADING GOOGLE ONE TAP LIBRARY",t),!1}}static{this.\u0275fac=function(t){return new(t||o)(a(N),a(w),a(te),a(d),a(D),a(ee),a(T),a(Ht),a(v),a(S))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var vr=(()=>{class o{constructor(e,t,r){this.firebaseService=e,this.logger=t,this.platformId=r}canActivateChild(){return H(this,null,function*(){if(M(this.platformId))return!0;try{return yield this.firebaseService.init(),!0}catch(e){return this.logger.logError(e),!1}})}static{this.\u0275fac=function(t){return new(t||o)(a(N),a(d),a(v))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o})();var yr=(()=>{class o{constructor(e,t){this.firebaseService=e,this.ssoService=t,this.onDestroy=new Te}ngOnDestroy(){this.onDestroy.next()}authStateListener(){this.firebaseService.getUserStateWithInitialStatusObservable().pipe(ke((e,t)=>({last:e.current,current:t}),{last:k.initial,current:k.initial}),Ee(this.onDestroy)).subscribe(({last:e,current:t})=>{e===k.loggedOut&&t===k.loggedIn&&this.ssoService.signInSso_v2(),e===k.loggedIn&&t===k.loggedOut&&this.ssoService.signOutSso_v2()})}static{this.\u0275fac=function(t){return new(t||o)(a(N),a(D))}}static{this.\u0275prov=m({token:o,factory:o.\u0275fac})}}return o}
5)();var Fn=(()=>{class o{constructor(e){if(e)return e}static{this.\u0275fac=function(t){return new(t||o)(a(o,12))}}static{this.\u0275mod=Me({type:o})}static{this.\u0275inj=Re({providers:[ee,L,wt,Gt,Je,ct,zt,d,Yt,w,Qt,ie,j,Kt,rt,gt,vt,yt,Jt,bt,oe,Xt,Ct,Zt,er,re,V,rr,Rt,qt,_,St,ae,R,te,$t,Pt,Mt,Ft,Lt,ir,or,sr,ne,ar,Ut,cr,Nt,mr,Dt,pr,Et,Ze,Bt,Wt,ur,L,Vt,Xe,xt,{provide:me,useClass:xe,multi:!0},{provide:me,useClass:jt,multi:!0},xe,gr,vr,D,yr,Pe,Le(Oe())],imports:[ve,ye,ze,ve,ye]})}}return o})();export{Gt as a,zt as b,Yt as c,Qt as d,Kt as e,Jt as f,oe as g,Xt as h,qt as i,ne as j,cr as k,Bt as l,Fn as m};

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.