1import{a as fe,b as he}from"./chunk-KGVF3L7J.js";import"./chunk-ZM57GNGR.js";import{l as ye,m as ge,n as ve,o as we}from"./chunk-UDWKHYP4.js";import{b as ce,c as ue,d as me}from"./chunk-YI62GESS.js";import"./chunk-UZQICZZL.js";import"./chunk-KBBGAMIO.js";import"./chunk-KZYIWRAE.js";import{b as h,e as de,f as l}from"./chunk-GZ734HMT.js";import{a as se}from"./chunk-GYHCSKZL.js";import{a as N}from"./chunk-HUII4GRS.js";import{a as pe}from"./chunk-MW6EXFGR.js";import{a as le}from"./chunk-HZCIENFO.js";import{a as p}from"./chunk-RSHJ4ZKB.js";import{a as P,b as te,c as oe,d as ie,g as re,h as ne,i as ae}from"./chunk-56CG4M52.js";import{g as d,l as j,p as X,q as ee}from"./chunk-4SIHOYIU.js";import{g as f,j as Y,l as Q,m as J,n as Z}from"./chunk-3X2Z7MVG.js";import{B as $,E as w,Ka as C,P as n,Pa as H,Q as W,Xa as F,Z as k,_ as O,bb as G,ea as B,fa as u,fb as V,h as g,ha as S,ib as q,j as c,jb as K,lb as I,mb as E,n as L,pa as U,u as v,ub as m,v as D,vc as A,y as x}from"./chunk-HPTOBC6R.js";import"./chunk-RAAKS4ZX.js";var be=()=>[ce];function Me(t,e){t&1&&m(0,"app-auth-modal");}function _e(t,e){t&1&&m(0,"app-ai-chat-widget");}function Re(t,e){t&1&&(G(0,_e,1,0),q(1,0,be),K());}var Te="https://assets.calendly.com/assets/external/widget.css",ze="https://assets.calendly.com/assets/external/widget.js",Le="https://app.waniwani.ai/embed.js",De="https://app.waniwani.ai/api/mcp/chat",xe="wwp_jHYGxoHf5J3w0ZngD-9CUYzw",$e="5902f698-a167-4aab-aa0d-98ce3001e4cc",We=5e3,Se=1200;function Ce(t){return t.split("?")[0].split("#")[0]==="/";}var y=class t{store=n(l);platform=n(U);document=n(k);destroyRef=n(O);env=n(p);router=n(ie);activatedRoute=n(te);seoService=n(de);calendlyInitialized=!1;calendlyLoadStarted=!1;waniwaniLoadStarted=!1;waniwaniScriptLoaded=u(!1);currentUrl=u(this.router.url);routeReady=u(!1);isHomePage=A(()=>Ce(this.currentUrl()));showAiChatWidget=A(()=>this.env.enableAIBots&&(this.store.isAuthenticated()||me(this.currentUrl())));constructor(){this.router.events.pipe(v(e=>e instanceof P),N()).subscribe(e=>{this.syncCurrentUrl(e.urlAfterRedirects),this.refreshEmailVerificationIfNeeded();}),this.router.navigated&&this.syncCurrentUrl(this.router.url),H(()=>{this.syncCurrentUrl(this.router.url);}),S(()=>{d(this.platform)&&this.document.body.classList.toggle("ai-chat-route",this.showAiChatWidget());}),S(()=>{if(!d(this.platform)||!this.routeReady())return;let e=this.isHomePage();e&&this.scheduleWaniwaniLoad(),this.document.body.classList.toggle("waniwani-loaded",e&&this.waniwaniScriptLoaded());}),this.initSeoListener(),this.initEmailVerifyRefreshListener();}initEmailVerifyRefreshListener(){if(!d(this.platform))return;let e=()=>{this.document.visibilityState==="visible"&&this.refreshEmailVerificationIfNeeded();};this.document.addEventListener("visibilitychange",e),this.destroyRef.onDestroy(()=>{this.document.removeEventListener("visibilitychange",e);});}syncCurrentUrl(e){this.currentUrl.set(e),this.routeReady.set(!0);}async refreshEmailVerificationIfNeeded(){d(this.platform)&&(!this.store.isAuthenticated()||this.store.isEmailVerified()||(await this.store.refreshAuthSession()));}ngAfterViewInit(){d(this.platform)&&this.scheduleCalendlyWhenEngaged();}initSeoListener(){this.router.events.pipe(v(e=>e instanceof P),L(()=>this.getRouteData(this.activatedRoute)),N(this.destroyRef)).subscribe(({seo:e,path:o})=>{e&&this.seoService.updatePageSeo(e,o);});}getRouteData(e){let o=e,i=null;for(;o.firstChild;){o=o.firstChild;let r=o.snapshot.data.seo;r&&(i=r);}i||(i=o.snapshot.data.seo??null);let a=this.router.url.split("?")[0].split("#")[0];return{seo:i,path:a};}scheduleCalendlyWhenEngaged(){let e=new AbortController(),{signal:o}=e,i=()=>{this.calendlyLoadStarted||(this.calendlyLoadStarted=!0,e.abort(),window.clearTimeout(a),this.loadCalendlyBadgeAsync());};window.addEventListener("pointerdown",i,{capture:!0,passive:!0,signal:o}),window.addEventListener("scroll",i,{capture:!0,passive:!0,signal:o}),window.addEventListener("keydown",i,{capture:!0,signal:o});let a=window.setTimeout(i,We);this.destroyRef.onDestroy(()=>{e.abort(),window.clearTimeout(a);});}scheduleWaniwaniLoad(){if(this.waniwaniLoadStarted)return;this.waniwaniLoadStarted=!0;let e=()=>{this.loadWaniwaniOnIdle();};window.requestIdleCallback?window.requestIdleCallback(e,{timeout:Se}):setTimeout(e,Se);}async loadWaniwaniOnIdle(){if(!Ce(this.currentUrl())){this.waniwaniLoadStarted=!1;return;}try{await this.loadWithRetry(()=>this.loadScript(Le,{defer:"","data-api":De,"data-token":xe,"data-channel-id":$e,"data-mode":"floating","data-theme":"light"})),this.waniwaniScriptLoaded.set(!0);}catch(e){this.reportThirdPartyLoadFailure("Waniwani",e);}}async loadCalendlyBadgeAsync(){try{await Promise.all([this.loadWithRetry(()=>this.loadStyle(Te)),this.loadWithRetry(()=>this.loadScript(ze))]),this.initializeCalendlyBadge();}catch(e){this.reportThirdPartyLoadFailure("Calendly",e);}}initializeCalendlyBadge(){this.calendlyInitialized||!window.Calendly?.initBadgeWidget||(window.Calendly?.initBadgeWidget({url:"https://calendly.com/adiftar-malbazaar/product-demo?hide_gdpr_banner=1&hide_event_type_details=1",text:"Book a Demo",color:"#005ca9",textColor:"#ffffff",branding:!1}),this.calendlyInitialized=!0);}async loadWithRetry(e,o=1){try{await e();}catch(i){if(o>0){await this.wait(500),await this.loadWithRetry(e,o-1);return;}throw i;}}wait(e){return new Promise(o=>setTimeout(o,e));}reportThirdPartyLoadFailure(e,o){console.warn(`[ThirdParty] Failed to load ${e}`,o);}loadScript(e,o){return this.document.querySelector(`script[src="${e}"]`)?Promise.resolve():new Promise((i,a)=>{let r=this.document.createElement("script");
1if(r.src=e,r.async=!0,o)for(let[z,Pe]of Object.entries(o)){if(z==="defer"){r.defer=!0,r.async=!1;continue;}r.setAttribute(z,Pe);}let s=window.setTimeout(()=>{r.remove(),a(new Error(`Script load timeout: ${e}`));},1e4);r.onload=()=>{window.clearTimeout(s),i();},r.onerror=()=>{window.clearTimeout(s),a(new Error(`Failed to load script: ${e}`));},this.document.head.appendChild(r);});}loadStyle(e){return this.document.querySelector(`link[href="${e}"]`)?Promise.resolve():new Promise((o,i)=>{let a=this.document.createElement("link");a.rel="stylesheet",a.href=e;let r=window.setTimeout(()=>{a.remove(),i(new Error(`Stylesheet load timeout: ${e}`));},1e4);a.onload=()=>{window.clearTimeout(r),o();},a.onerror=()=>{window.clearTimeout(r),i(new Error(`Failed to load stylesheet: ${e}`));},this.document.head.appendChild(a);});}static ɵfac=function(o){return new(o||t)();};static ɵcmp=F({type:t,selectors:[["app-root"]],decls:3,vars:2,template:function(o,i){o&1&&(m(0,"router-outlet"),I(1,Me,1,0,"app-auth-modal"),I(2,Re,3,0)),o&2&&(C(),E(i.store.isOpen()?1:-1),C(),E(i.showAiChatWidget()?2:-1));},dependencies:[oe,fe],encapsulation:2,changeDetection:0});};var Ie=[{path:"",component:he,children:[{path:"",data:{seo:{title:"Compare Insurance Quotes Online in Egypt",description:"Compare insurance quotes online in Egypt with Mal Bazaar. Explore medical, motor, life, and business insurance from trusted insurers with expert support.",ogTitle:"Compare Insurance in Egypt Today",ogDescription:"Compare trusted insurance options in Egypt with expert support.",twitterTitle:"Compare Insurance Quotes Online in Egypt | Mal Bazaar",twitterDescription:"Compare trusted insurance options in Egypt with expert support.",type:"website",schema:ye}},loadComponent:()=>import("./chunk-J7S3XLDR.js").then(t=>t.HomeComponent)},{path:"individual",data:{seo:{title:"Individual Insurance",description:"Personal insurance solutions for individuals and families in Egypt. Compare and buy medical, motor, life, and home insurance with the best coverage and prices.",type:"website",schema:ge}},loadComponent:()=>import("./chunk-GK6KA4YO.js").then(t=>t.IndividualComponent)},{path:"corporate",data:{seo:{title:"Corporate Insurance",description:"Business insurance solutions for companies in Egypt. Group medical, fleet motor, cargo, property, and employee benef
1its insurance tailored for your organization.",type:"website",schema:ve}},loadComponent:()=>import("./chunk-XKZR4UBU.js").then(t=>t.CorporateComponent)},{path:"about",data:{seo:{title:"About Us",description:"Learn about Mal Bazaar - Egypt's leading digital insurance platform. Our mission is to make insurance simple, transparent, and accessible for everyone.",type:"website"}},loadComponent:()=>import("./chunk-JPKL2BBW.js").then(t=>t.AboutComponent)},{path:"privacy",data:{seo:{title:"Privacy Policy",description:"Read how Mal Bazaar collects, uses, and protects your personal information when you use our Services.",type:"website"}},loadComponent:()=>import("./chunk-7RVQXSYP.js").then(t=>t.PrivacyComponent)},{path:"terms",data:{seo:{title:"Terms and Conditions",description:"Review Mal Bazaar's terms and conditions covering our services, your responsibilities, complaints, and governing law.",type:"website"}},loadComponent:()=>import("./chunk-54JPM2C6.js").then(t=>t.TermsComponent)},{path:"contact",data:{seo:{title:"Contact Us",description:"Get in touch with Mal Bazaar. Contact our insurance experts for quotes, claims support, or general inquiries. We're here to help.",type:"website",schema:we}},loadChildren:()=>import("./chunk-MWXNWIHH.js").then(t=>t.contactRoutes)},{path:"quote-selection",data:{seo:{title:"Get Insurance Quote",description:"Start your insurance journey with Mal Bazaar. Select your insurance type and get personalized quotes from top insurers in Egypt.",noIndex:!0}},loadChildren:()=>import("./chunk-Z4LJCWFC.js").then(t=>t.quoteSelectionRoutes)},{path:"insurance",loadChildren:()=>import("./chunk-7GHORO53.js").then(t=>t.insuranceRoutes)},{path:"guides",loadChildren:()=>import("./chunk-Q6YTQ2P3.js").then(t=>t.guidesRoutes)},{path:"auth",data:{seo:{title:"Sign In",description:"Sign in to your Mal Bazaar account to manage your insurance policies, view quotes, and track claims.",noIndex:!0}},loadChildren:()=>import("./chunk-EDUNF4RM.js").then(t=>t.authRoutes)},{path:"payment",data:{seo:{title:"Payment",description:"Complete your insurance purchase securely with Mal Bazaar.",noIndex:!0}},loadChildren:()=>import("./chunk-BZET5AYS.js").then(t=>t.paymentRoutes)},{path:"requests-confirmation",data:{seo:{title:"Request Confirmation",description:"Review and confirm your insurance request with Mal Bazaar.",noIndex:!0}},loadChildren:()=>import("./chunk-I3G6JV7J.js").then(t=>t.requestsConfirmationRoutes)},{path:"profile",data:{seo:{title:"My Profile",description:"Manage your Mal Bazaar profile, view your insurance policies, and track your quotes and claims.",noIndex:!0}},loadChildren:()=>import("./chunk-2JDSJGXX.js").then(t=>t.profileRoutes)},{path:"**",data:{seo:{title:"Page Not Found",description:"The page you are looking for does not exist.",noIndex:!0}},loadComponent:()=>import("./chunk-3VUWPOF6.js").then(t=>t.NotFoundComponent)}]}];var b=new f(()=>!1);function Ee(t,e){return new Y({error:{message:e},status:401,statusText:"Unauthorized",url:t});}var M=(t,e)=>{let o=n(h),i=n(p);if(t.url.startsWith(i.keycloak.url)||t.context.get(b))return e(t);let a=t.context.get(se),r=s=>e(t.clone({setHeaders:{Authorization:`Bearer ${s}`}}));return a?o.isAuthenticated?g(o.getToken()).pipe(w(s=>s?r(s):(o.onSessionExpired?.(),c(()=>Ee(t.url,"Your session has expired. Please sign in again."))))):c(()=>Ee(t.url,"Authentication required. Please sign in.")):o.isAuthenticated?g(o.getToken()).pipe(w(s=>s?r(s):e(t))):e(t);};var _=new f(()=>!1);var R=(t,e)=>{if(t.context.get(_))return e(t);let o=n(l);return o.startLoading(),e(t).pipe(x(()=>o.stopLoading()));};var ke=new Set(["GET","HEAD","OPTIONS"]),T=(t,e)=>{let o=e(t);return ke.has(t.method.toUpperCase())&&(o=o.pipe($({count:2,delay:1e3}))),o.pipe(D(i=>c(()=>pe(i))));};function Ae(){return W([{provide:p,useValue:le},Q(Z(),J([M,T,R])),V(async()=>{let t=n(h),e=n(l);t.onSessionExpired=()=>e.syncFromKeycloak();try{await t.init();}catch{}e.syncFromKeycloak();})]);}var Ne={providers:[B(),re(Ie,ne({scrollPositionRestoration:"top"}),ae()),ee(X()),Ae(),ue()]};j(y,Ne).catch(t=>console.error(t));/**i18n:906d516be38e305f72de4711c4e05469f2d8e215eac60d43e68f01f85d95df71*/
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.