PageSourceSearch

https://www.matterhorngotthardbahn.ch/_nuxt/base-page.g9ultDMA.js

js matterhorngotthardbahn.ch collected 2026-10-02 03:10:45 UTC 9,569 bytes, 6 lines download raw bytes

1import{d as b}from"./component.6VmCBwi9.js";import{r as E,y as O,c as _,w as y,aP as R,u as C,e as x,V as U,L as P,ah as v,ad as N,aw as T,ag as D,aR as m,as as h,aQ as l,an as k,aF as B,cA as G}from"./entry.EKnbqgTX.js";import{l as W,u as M}from"./use-log-version-to-console.-m9bsh8c.js";import{u as H}from"./use-swisspass-authentication.1o1p_zsY.js";import"./asyncData.IUzj92Jf.js";const V=2147483647;function j(){const e=E(!1),{$bus:t,$store:s}=x(),i=O(),{mapGetter:c,dispatch:a,commit:u}=R(),g=U(),r=c("user/index/customerObj"),d=c("user/index/isAuthenticated"),w=c("user/index/loadingTravellers"),I=_(()=>!window.location.pathname.includes("/user/logout")),$=_(()=>g.public.STANDARD_LOGIN==="swisspass");y(d,(n,o)=>{n&&n!==o&&(f(),w.value||p())},{immediate:!0});async function L(){const n=window.localStorage.getItem("skipNextLoginVerify")==="true";if(I.value){if(d.value)await a("user/index/getCustomerInfo"),await a("user/index/getUserWithJWTToken");else if(n)window.localStorage.removeItem("skipNextLoginVerify");else{let o;if($.value?o=await a("user/index/getCustomerInfo"):o=await a("user/index/verifyLogin"),o&&o.accessToken){const{loginWithToken:A}=C();await A(o.accessToken),await a("user/index/setFields",o),await a("user/index/getCustomerSegments")}}u("user/index/setInitialized"),u("user/index/setUserLoginCallFinished")}}async function p(){if(e.value||i.path?.includes("guestcard")||i.path?.includes("wallet"))return;e.value=!0;const n=await a("user/index/getTravellers");if(r.value?.firstname&&r.value?.lastname&&!w.value&&(!n||n.length===0)){const o={firstname:r.value.firstname,lastname:r.value.lastname,email:r.value.email};r.value.gender&&(o.gender=r.value.gender.toLowerCase()),await a("user/index/addTraveller",o),await a("user/index/getTravellers"),t?.$emit("defaultTravellerAdded")}u("user/index/setTravellersChecked"),e.value=!1}async function f(){if(!d.value)return;const n=s.$keycloakTokenHandler.getTokenTimeLeft();if(!n)return;if(n<=0){await S();return}const o=Math.min(n*1e3,V);setTimeout(S,o)}async function S(){await a("user/index/refreshKeycloakToken")&&await f()}return{tryToLoginOnMounted:L,checkTravellers:p,scheduleTokenRefreshIfAuthenticated:f,isAuthenticated:d}}const K=b({data(){return{manager:v,searchExpanded:!1,isActiveCookieMessageToast:!1}},computed:{...N({__:"config/__",themeConfig:"configuration/theme/theme",orderItems:"checkout/orderItems",routerBase:"theming/routerBase",isB2B:"query/isB2B",languageCode:"config/currentLanguageCode",headerTransparent:"navigation/transparentHeader",isGuest:"user/index/isGuest",privacySlug:"configuration/privacyPage/slug",applicationConfigs:"config/applicationConfigs",hasSwissPassLogin:"config/hasSwissPassLogin",invalidSession:"user/index/invalidSession",travellersChecked:"user/index/travellersChecked",loginDone:"user/index/loginDone",isAuthenticated:"user/index/isAuthenticated"}),postLoginTrigger(){return this.isAuthenticated&&this.loginDone},pageClasses(){return{"page__main--alert":this.showAlert&&this.headerTransparent&&!this.showHeaderSwitch,"page__main--switch":this.showHeaderSwitch&&this.headerTransparent&&!this.showAlert,"page__main--switch-alert":this.showHeaderSwitch&&this.showAlert&&this.headerTransparent,"page__main--colored":!this.headerTransparent}}},watch:{invalidSession(){this.invalidSession&&this.$bus?.$emit(T.LOGOUT_USER)},$route(){this.$refs.root&&this.$refs.root.focus()},orderItems(){if(this.orderItems==null)return;const e=new CustomEvent("cartCount",{detail:this.orderItems.length,bubbles:!0});document.dispatchEvent(e),window.james=window.james||{},window.james.cartCount=this.orderItems.length},postLoginTrigger:{handler(e){return e&&this.checkTravellers(),this.scheduleTokenRefreshIfAuthenticated()},immediate:!0}},beforeCreate(){const{tryToLoginOnMounted:e,checkTravellers:t,scheduleTokenRefreshIfAuthenticated:s}=j();this.tryToLoginOnMounted=e,this.checkTravellers=t,this.scheduleTokenRefreshIfAuthenticated=s;const{handleSwissPassLogin:i}=H();this.handleSwissPassLogin=i},async beforeMount(){if(this.manager.init(this.$config.public.SWISSPASS_AUTHORITY,this.$config.public.BASE_URL,this.$config.public.SWISSPASS_CLIENT_ID,this.$store.getters["config/currentLanguageCode"]),this.$route.path.includes("/user/logout"))return;!await this.manager.getUser()&&localStorage.getItem(D.SWISS_PASS_STATUS)===m.LOGGED_IN&&(console.info("missing swisspass user -> logout"),this.$store.commit("user/index/performPostLogoutCleanup"),await this.$store.dispatch("user/index/logoutCustomer"),this.$store.commit("checkout/removeAllItems"));const t=h("auth._token.token").value,s=h("auth._refresh_token").value,{setToken:i,setRefreshToken:c}=C();i(t),c(s),this.$store.dispatch("user/index/getCustomerSegments")},async mounted(){if(this.$appboy&&this.$appboy.logCustomEvent("PageLoad"),window&&(window.history.scrollRestoration="auto",window.addEventListener(l.LOGOUT,this.handleLogout),window.addEventListener(l.LOGIN_ERROR_SWISS_PASS,this.handleSwissPassLoginError)),this.$refs.root&&this.$refs.root.focus(),!this.$config.public.ONE_TRUST_ID&&!this.$config.public.DISABLE_DEFAULT_COOKIE_CONSENT&&!this.$config.public.COOKIE_FIRST_ID&&!this.$config.public.COOKIE_BOT_ID&&!this.$config.public.COOKIE_IUBENDA_CONFIG&&!(this.$config.public.COOKIE_IUBENDA_SITE_ID&&this.$config.public.COOKIE_IUBENDA_COOKIE_ID)&&!this.$config.public.USERCENTRICS_ID&&(h("cookies-accepted").value||this.showCookieMessage()),this.registerServiceWorkerDelayed(),window.addEventListener("appinstalled",()=>
1{this.$toast(this.__("Thank you for installing our app."),{autoClose:3e3})}),!this.$route.path.includes("/user/logout")){this.isAuthenticated&&!this.travellersChecked&&this.checkTravellers(),this.scheduleTokenRefreshIfAuthenticated();const s=await this.manager.getUser(),i=s?m.LOGGED_IN:m.NOT_LOGGED_IN;this.$store.dispatch("user/index/setSwissPassStatus",i),s&&v.refresh().then(()=>{}).catch(()=>{this.handleLogout()}),await this.tryToLoginOnMounted()}window&&window.addEventListener(l.LOGIN_SUCCESS_SWISS_PASS,this.handleSwissPassLogin),this.$bus?.$on("redirect",this.handleRedirect),W();const e=k(()=>{document.querySelector("#webkit-gap")&&(new ResizeObserver(s=>{s.forEach(i=>{document.documentElement.style.setProperty("--webkit-footer-gap",`${i.contentRect.height}px`)})}).observe(document.querySelector("#webkit-gap")),clearInterval(e))},500),{initClient:t}=M();await t()},beforeUnmount(){window.removeEventListener(l.LOGIN_SUCCESS_SWISS_PASS,this.handleSwissPassLogin),window.removeEventListener(l.LOGOUT,this.handleLogout),window.removeEventListener(l.LOGIN_ERROR_SWISS_PASS,this.handleSwissPassLoginError)},methods:{handleLogout(){this.$store.commit("user/index/setPostLogoutRedirectUrl",`${this.$config.public.BASE_URL}/${this.languageCode}/user/logged-out`),this.$bus?.$emit(T.LOGOUT_USER)},doThirdPartyLogin(e){const t=`${this.$config.public.BASE_URL}/${this.languageCode}/auth-loading`,s=`${this.$config.public.THIRD_PARTY_AUTH_URL}/auth?client_id=${this.$config.public.THIRD_PARTY_CLIENT_ID}&kc_idp_hint=${e}&redirect_uri=${t}&response_type=token&ui_locales=${this.languageCode}&hl=${this.languageCode}`;h("auth-provider").value=e;const i=500,c=800,a=screen.width/2-i/2,u=screen.height/2-c/2,g=window.open(s,"_blank",`toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes, width=${i},height=${c},left=${a},top=${u}`);this.takingAction=!0;const r=k(()=>{g.closed&&(this.takingAction=!1,clearInterval(r))},1e3)},handleSwissPassLoginError(){console.log("handling swiss pass login error");const e=this.__("Error logging in with SwissPass.");this.$toast.error(e,{autoClose:3e3})},showCookieMessage(){if(this.isB2B||this.isActiveCookieMessageToast||document.querySelector(".toasted-container"))return;const e=`<span>
2        ${this.__("This website uses cookies. If you continue to browse this website without changing the cookie settings in your web browser, you are agreeing to the use of cookies.")}
3        <a href="${this.$config.public.BASE_URL}${this.localePath({name:"pages-slug",params:{slug:this.privacySlug}})}" target="_blank">
4            ${this.__("Privacy Policy")}
5        </a>
6      </span>`;this.isActiveCookieMessageToast=!0,this.$toast(e,{position:"bottom-center",autoClose:!1,clearOnUrlChange:!1,containerId:"cookie-toast",onClose:()=>{this.isActiveCookieMessageToast=!1},closeOnClick:!1,containerClassName:"toasted-container bottom-center",toastClassName:"toasted toasted-primary toastify-wrapper",bodyClassName:"toastify-body",closeButton:t=>B("a",{href:"#",class:"action btn cookie-accept-button",innerHTML:"Accept",onClick:s=>(h("cookies-accepted",{maxAge:365*24*60*60*1e3}).value="1",s.preventDefault(),t.closeToast(s),!1)}),dangerouslyHTMLString:!0,hideProgressBar:!0})},unregisterAllServiceWorkers(){!navigator.serviceWorker||!navigator.serviceWorker.getRegistrations||navigator.serviceWorker.getRegistrations().then(e=>{e.forEach(t=>{t.unregister()})})},registerServiceWorkerDelayed(){navigator.serviceWorker&&("requestIdleCallback"in window?G(()=>{navigator.serviceWorker.register("/sw.js",{scope:"/"})},{timeout:5e3}):setTimeout(()=>{navigator.serviceWorker.register("/sw.js",{scope:"/"})},3e3))},handleRedirect(e){e&&window.location.assign(e)},addScriptToVueMeta(e,t){return e.map(s=>({...s,src:s.src,callback:()=>{this.$bus.$emit(`external-script-loaded-${encode(s.callerHeader||"undefined")}`),this.$bus.$emit(`external-script-loaded-${encode(s.callerFooter||"undefined")}`)},hid:`external-script-${encode(s.caller||s.src)}`,body:t}))}}},"$QmvjdeJEsh"),Q=P(K,[["__scopeId","data-v-194ceab0"]]);export{Q as default};

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.