PageSourceSearch

https://epaper.tele.ch/chunk-JSH2EFJ4.js

js tele.ch collected 2026-10-02 13:13:14 UTC 7,891 bytes, 1 lines download raw bytes

1import{a as tt,b as et,c as it,d as rt,g as f,i as nt}from"./chunk-3FXDFNBX.js";import{B as G,C as _,La as R,M as K,N as ut,Nc as Q,P as W,Q as B,R as Z,Rb as Y,Vb as C,_ as z,hd as X,kb as w,kc as q,n as v,o as d,pb as J,ub as M,wa as S,za as H}from"./chunk-TSU3S3ZV.js";import{C as s,F as E,G as k,H as g,Hb as L,K as u,Ka as D,Pa as j,S as N,T as I,W as h,Y as V,ca as $,e as T,f as P,ha as n,n as y,r as x,ra as F,s as c,t as A,va as O,za as U}from"./chunk-U2RVF7MF.js";import{a as l,e as ct}from"./chunk-C6Q5SG76.js";var at=ct(ut());function ht(a){return!!a.content}function ot(a){return"redirectTo"in a}var p="initial_view",Lt=(()=>{class a{constructor(){this.ngZone=n(O),this.router=n(z),this.contextService=n(J),this.purpleService=n(Q),this.configLoaderService=n(M),this.globalService=n(q),this.urlResolverService=n(rt),this.eventActionService=n(nt),this.platformId=n(D),this.document=n(F),this.transferState=n(j),this.serverOnlyService=n(Z),this.appData=n(X),this.appRef=n(L),this.pendingTasks=n(U),this.navigationStabilitySubject$=new T,this.viewSubject$=new P(null),this.isFirstNavigation=!0,this.lastPath=null,this.currentPath=null,this.initSsrRunningTask(),this.currentPath=this.contextService.getContext().initialUrl,this.pipeNavigationStartEventsToPathObservable(),this.subscribeToNavigationEndEvents(),this.initNavigationStabilityStream(),this.initViewObservable(),this.view$.subscribe(t=>{this.viewSubject$.next(t)})}async getCurrentView(){return this.viewSubject$.value}getAbsoluteUrl(t,e){let i=this.router.createUrlTree([t],{queryParams:e}),r=this.router.serializeUrl(i);return`${this.document.location.protocol}//${this.document.location.host}${r}`}distinctView$(t){let e=this;return this.view$.pipe(s(i=>t?!!i?.modal:!!i?.default),u((i,r)=>t?e.isSameRouteContext(i.modal,r.modal):e.isSameRouteContext(i.default,r.default)),c(i=>t?{cfg:i.modal,routerEvent:i.routerEvent}:{cfg:i.default,routerEvent:i.routerEvent}))}resolve(t,e){return this.isFirstNavigation?(this.isFirstNavigation=!1,y(void 0)):this.view$.pipe(s(i=>!!i&&i.routerEvent.url===e.url),g(1))}getAbsoluteLastPath(){return this.lastPath?`${this.document.location.protocol}//${this.document.location.host}${this.lastPath}`:""}initSsrRunningTask(){if(n(K,{optional:!0})){this.keepSSRRunningTask=S;return}if(d(this.platformId)){let t=this.pendingTasks.add(),e=!1;this.keepSSRRunningTask=()=>{e||(e=!0,t())}}else this.keepSSRRunningTask=S}pipeNavigationStartEventsToPathObservable(){this.path$=this.router.events.pipe(s(t=>{let e=t instanceof G&&!t.url.includes("oauth/callback");return e||this.keepSSRRunningTask(),e}),h(async t=>
1({navEvent:t,default:await this.extractPathFromOutlet(t),modal:await this.extractPathFromOutlet(t,"modal")})),V(t=>{this.checkForGenericRedirect(t)}),u((t,e)=>t.default===e.default&&t.modal==e.modal))}async extractPathFromOutlet(t,e){let i=this.router.parseUrl(t.url),r=i.root.children.primary?.segments;if(e==="modal"&&(r=!!i.root.children.modal&&[i.root.children.modal.segments[1]]),!(!r&&e==="modal"))return!this.appData.customDomain&&!e&&r&&r.shift(),r?.join("/")||"/"}async checkForGenericRedirect(t){await x(this.purpleService.inited$);try{let e=await this.purpleService.getRedirects({redirectFilter:{AND:[{type:{value:"GENERIC"}},{identifier:{value:"/"+t.default,operation:at.StringOperation.EQUAL}}]}});if(e?.nodes?.length>0){let i=e.nodes[0],r=this.navActionTargetKey(i.target);await this.handleRedirect({path:t.default,redirectTo:{type:f.NAVIGATE,[r]:i.target,statusCode:i.statusCode}},this.contextService.getContext())}}catch{}}subscribeToNavigationEndEvents(){this.router.events.pipe(s(t=>t instanceof _)).subscribe(t=>{R(this.ngZone,"onNavigationEnd",{event:t,viewContext:this.contextService.getContext()}),d(this.platformId)||this.handleNavigationStability(t),this.handlePathChange(t.urlAfterRedirects)})}initNavigationStabilityStream(){this.navigationStabilitySubject$.pipe(u((t,e)=>t.urlAfterRedirects===e.urlAfterRedirects),N((t,e)=>({current:e,previous:t.current}),{current:null,previous:null}),s(({current:t})=>t!==null),E(({current:t,previous:e})=>this.appRef.isStable.pipe(s(i=>i),k(200),g(1),c(()=>({current:t,previous:e}))))).subscribe(({current:t,previous:e})=>{R(this.ngZone,"onNavigationStable",{event:t,viewContext:this.contextService.getContext(),previousUrl:e?.urlAfterRedirects||null,currentUrl:t.urlAfterRedirects})})}handleNavigationStability(t){this.navigationStabilitySubject$.next(t)}handlePathChange(t){let e=this.currentPath?.split("?")[0];t.split("?")[0]!==e&&(this.lastPath=this.currentPath),this.currentPath=t}initViewObservable(){this.view$=A([this.path$,this.configLoaderService.getConfig().pipe(c(t=>t[B.VIEW])),this.purpleService.inited$]).pipe(h(([{default:t,modal:e,navEvent:i},r])=>this.processViewState(t,e,i,r)),h(t=>this.handleRedirects(t)),s(t=>!!t),I({bufferSize:1,refCount:!0}))}async processViewState(t,e,i,r){v(this.platformId)&&!i.url.includes("oauth/callback")&&this.updateVisitedPath(i.url);let o=l(l({},this.contextService.getContext()),this.router.parseUrl(i.url).queryParams),b=r.filter(m=>!m.globalData&&(!m.condition||Y({condition:C(m.condition,o,this.contextService.$functions,this.globalService.getGlobalData())}))),st=await this.getViewFromPath(t,b,i),lt=e&&await this.getViewFromPath(e,b,i);return{default:st,modal:lt,routerEvent:i,targetContext:o}}async handleRedirects(t){if(!t.default?.viewConfig){this.keepSSRRunningTask();return}if(ot(t.default.viewConfig)){await this.handleRedirect(t.default.viewConfig,t.targetContext),this.keepSSRRunningTask();return}return this.keepSSRRunningTask(),t}updateVisitedPath(t){let e=new URL(t,window.location.origin),i=JSON.parse(sessionStorage.getItem(w))||{};i.lastVisitedPath=i.currentPath,i.currentPath=e,sessionStorage.setItem(w,JSON.stringify(i))}async handleRedirect(t,e){let i=typeof t.redirectTo=="object"?l({statusCode:t.statusCode},t.redirectTo):{type:f.NAVIGATE,[this.navActionTargetKey(t.redirectTo)]:t.redirectTo,statusCode:t.statusCode},r=C(i,e,this.contextService.$functions,this.globalService.getGlobalData());return await this.eventActionService.processNavigateAction(r),!0}async getViewFromPath(t,e,i){let r=this.loadInitialView();try{let o=await H(this.pendingTasks,async()=>await this.urlResolverService.getViewFromPath(t,i.url));if(et(o))r=this.loadDynamicView(e,o);else if(tt(o))return this.createRouteConfigWithContext(o,t)}catch(o){if(console.error("Error during dynamic resolving of view: ",o),o instanceof it)throw o}return r||(r=this.loadViewByPath(e,t)),r||(r=this.loadErrorPage(e)),r?d(this.platformId)&&this.transferState.set(p,r):(console.debug(`Cannot find view for the path: ${t}`),this.serverOnlyService.sendError(404,"Not Found")),r}createRouteConfigWithContext(t,e){let i=this.navActionTargetKey(t.redirectTarget);return{viewConfig:{redirectTo:{type:f.NAVIGATE,[i]:t.redirectTarget,params:t.params,mergeParam
1s:t.mergeParams,statusCode:t.statusCode},path:e}}}navActionTargetKey(t){return t.startsWith("http")?"url":"path"}loadInitialView(){if(v(this.platformId)&&this.transferState.hasKey(p)){let t=this.transferState.get(p,null);return this.transferState.remove(p),t}return null}loadDynamicView(t,e){let i=t.find(r=>r.name===e.viewName);return i?{viewConfig:i,viewContext:e.viewContext,pathParams:e.pathParams}:null}loadViewByPath(t,e){for(let i of t){if(i.path.includes("**")&&e.indexOf(i.path.split("/**")[0])!==-1||i.path===e)return{viewConfig:i};{let o=W(i.path,{decode:decodeURIComponent})(e);if(o)return{viewConfig:i,pathParams:o.params?l({},o.params):void 0}}}return null}loadErrorPage(t){let e=t.find(i=>i.errorPage);return e?{viewConfig:e,viewContext:{errorCode:404}}:null}isSameRouteContext(t,e){return t?.viewConfig===e?.viewConfig&&t?.pathParams===e?.pathParams}static{this.\u0275fac=function(e){return new(e||a)}}static{this.\u0275prov=$({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();export{ht as a,Lt as b};

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.