PageSourceSearch

https://www.swica.ch/_next/static/chunks/pages/_app-276d0796a4628531.js

js swica.ch collected 2026-09-24 09:38:43 UTC 12,687 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[636],{37900:()=>{},47411:()=>{},56408:(n,e,t)=>{"use strict";t.d(e,{UM:()=>d,h8:()=>i});var a=t(72223);let i="swica:consent-changed",r="OneTrustGroupsUpdated",o=/(?:^|&)groups=([^&]*)/;function s(n){return n.trim().toUpperCase()}function l(){let n=window.OnetrustActiveGroups;if("string"==typeof n&&n.trim().length>0)return Array.from(new Set(n.split(",").map(n=>s(n)).map(n=>n.endsWith(":1")?n.slice(0,-2):n).filter(Boolean)));let e=function(n){if("undefined"==typeof document)return null;let e=document.cookie.match(new RegExp("(?:^|;\\s*)".concat(n,"=([^;]*)")));if(!(null==e?void 0:e[1]))return null;try{return decodeURIComponent(e[1])}catch(n){return null}}("OptanonConsent");return e?Array.from(new Set(function(n){let e=n.match(o);return(null==e?void 0:e[1])?e[1].split(",").map(n=>s(n)).filter(n=>n.endsWith(":1")).map(n=>n.slice(0,-2)):[]}(e))):[]}function d(n,e,t){let[o,d]=(0,a.useState)([]);(0,a.useEffect)(()=>{let n=()=>{d(l())};return n(),window.addEventListener(r,n),window.addEventListener(i,n),()=>{window.removeEventListener(r,n),window.removeEventListener(i,n)}},[]);let u=(0,a.useMemo)(()=>(function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l(),t=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=s(n);return!t&&!a&&(0!==e.length?!!i&&e.includes(i):void 0)})(n,o,e,t),[o,n,e,t]);return{activeGroups:o,isGranted:u}}},64498:(n,e,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return t(94780)}])},76483:(n,e,t)=>{"use strict";t.d(e,{Vk:()=>a,Wk:()=>r,Yl:()=>o,jU:()=>i});let a="C0011";function i(n){return"\n    function OptanonWrapper() {\n      window.dispatchEvent(new Event('".concat(n,"'));\n      if (window.__swicaBrazeRetryInitialization) {\n        window.__swicaBrazeRetryInitialization();\n      }\n    }\n  ")}function r(n){return"\n    (function(w,d,s,l,i){w._mtm=w._mtm||[];w[l]=w[l]||[];w[l].push({'gtm.start':\n    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;
1j.src=\n    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n    })(window,document,'script','dataLayer','".concat(n,"');\n  ")}function o(n){let{brazeConsentCategory:e,brazeDebug:t,brazeEndpoint:a,brazeKey:i}=n;return"\n  (function() {\n        var brazeReadyEvent = 'braze:ready';\n        var brazeStatusEvent = 'braze:status';\n        var sdkScriptUrl = 'https://js.appboycdn.com/web-sdk/6.10/braze.no-amd.min.js';\n        var win = window;\n\n        function dispatchBrazeEvent(eventName) {\n          win.dispatchEvent(new Event(eventName));\n        }\n\n        function hasBrazeConsent() {\n          return decodeURIComponent(\n            document.cookie.replace(\n              /(?:(?:^|.*;\\s*)OptanonConsent\\s*=\\s*([^;]*).*$)|^.*$/,\n              '$1',\n            ),\n          )\n            .match(/groups=([^&]+)/)?.[1]\n            ?.includes('".concat(e,":1');\n        }\n\n        function setBrazeStatus(status, reason) {\n          win.__swicaBrazeStatus = status;\n          win.__swicaBrazeStatusReason = reason || null;\n          dispatchBrazeEvent(brazeStatusEvent);\n        }\n\n        function markBrazeReady() {\n          setBrazeStatus('ready', null);\n          dispatchBrazeEvent(brazeReadyEvent);\n        }\n\n        function markBrazeFailed(reason) {\n          win.__swicaBrazeInitialized = false;\n          setBrazeStatus('failed', reason);\n\n          if (").concat(t.toString(),") {\n            console.warn('[Braze] ' + reason);\n          }\n        }\n\n        function getLanguageCode() {\n          var htmlLang =\n            (document.documentElement.getAttribute('lang') ||\n              navigator.language ||\n              'en')\n              .toLowerCase();\n          var languageCodeMatch = htmlLang.match(/^[a-z]{2}/);\n\n          return languageCodeMatch ? languageCodeMatch[0] : 'en';\n        }\n\n        function applyInitialPageContext(languageCode) {\n          if (typeof win.braze.getUser === 'function') {\n            var user = win.braze.getUser();\n\n            if (user && typeof user.setLanguage === 'function') {\n              user.setLanguage(languageCode);\n            }\n\n            if (user && typeof user.setCustomUserAttribute === 'function') {\n              user.setCustomUserAttribute(\"page_url\", win.location.href);\n            }\n          }\n\n          if (typeof win.braze.logCustomEvent === 'function') {\n            win.braze.logCustomEvent(\"page_view\", {\n              page: win.location.pathname,\n              timestamp: new Date().toISOString(),\n            });\n          }\n\n          if (typeof win.braze.requestImmediateDataFlush === 'function') {\n            win.braze.requestImmediateDataFlush();\n          }\n        }\n\n        function initializeBraze(resolve) {\n          if (!hasBrazeConsent()) {\n            console.log(\"Braze consent not granted, skipping initialization.\");\n            win.__swicaBrazeInitialized = false;\n            setBrazeStatus('disabled', 'consent_revoked');\n            resolve(null);\n            return;\n          }\n\n          if (!win.braze) {\n            markBrazeFailed('Braze SDK missing after script load');\n            resolve(null);\n            return;\n          }\n\n          if (!win.__swicaBrazeInitialized) {\n            if (typeof win.braze.initialize !== 'function') {\n              markBrazeFailed('Braze SDK initialize unavailable');\n              resolve(null);\n              return;\n            }\n\n            var languageCode = getLanguageCode();\n            braze.enableSDK();\n            var initialized = win.braze.initialize(\"").concat(i,'", {\n              baseUrl: "').concat(a,'",\n              allowUserSuppliedJavascript: true,\n              doNotLoadFontAwesome: true,\n              enableLogging: ').concat(t.toString(),",\n              localization: languageCode,\n              sessionTimeoutInSeconds: 1800,\n            });\n            if (initialized === false) {\n              markBrazeFailed('Braze SDK initialize returned false');\n              resolve(null);\n              return;\n            }\n\n            applyInitialPageContext(languageCode);\n            win.__swicaBrazeInitialized = true;\n          }\n\n          markBrazeReady();\n          resolve(win.braze || null);\n        }\n\n        function removeFailedSdkScript() {\n          var failedScript = document.querySelector('script[data-swica-braze-sdk=\"true\"][data-swica-braze-failed=\"true\"]');\n\n          if (failedScript && failedScript.parentNode) {\n            failedScript.parentNode.removeChild(failedScript);\n          }\n        }\n\n        function loadBrazeSdk() {\n          setBrazeStatus('loading', null);\n\n          return new Promise(function(resolve) {\n            if (win.braze) {\n              console.log(\"Braze SDK already present, initializing immediately.\");\n              initializeBraze(resolve);\n              console.log(\"Braze SDK initialization complete.\");\n              return;\n            }\n\n            removeFailedSdkScript();\n\n            var existingScript = document.querySelector('script[data-swica-braze-sdk=\"true\"]');\n\n            if (existingScript) {\n              existingScript.addEventListener('load', function () {\n                initializeBraze(resolve);\n              }, { once: true });\n              existingScript.addEventListener('error', function () {\n                existingScript.setAttribute('data-swica-braze-failed', 'true');\n                markBrazeFailed('Braze SDK script failed to load');\n                resolve(null);\n              }, { once: true });\n              return;\n            }\n\n            var script = document.createElement('script');\n            script.src = sdkScriptUrl;\n            script.async = true;\n            script.setAttribute('data-swica-braze-sdk', 'true');
1\n            script.onload = function() {\n              console.log(\"Braze SDK loaded successfully.\");\n\n              if (!hasBrazeConsent()) {\n                win.__swicaBrazeInitialized = false;\n                setBrazeStatus('disabled', 'consent_revoked');\n                resolve(null);\n                return;\n              }\n\n              initializeBraze(resolve);\n            };\n            script.onerror = function() {\n              script.setAttribute('data-swica-braze-failed', 'true');\n              markBrazeFailed('Braze SDK script failed to load');\n              resolve(null);\n            };\n\n            document.head.appendChild(script);\n          });\n        }\n\n        function startBrazeInitialization() {\n          if (win.__swicaBrazeInitPromise && win.__swicaBrazeStatus !== 'failed') {\n            win.__swicaBrazeInitPromise.then(function (braze) {\n              if (braze) {\n                markBrazeReady();\n              }\n\n              return braze;\n            });\n\n            return win.__swicaBrazeInitPromise;\n          }\n\n          win.__swicaBrazeInitPromise = loadBrazeSdk();\n\n          return win.__swicaBrazeInitPromise;\n        }\n\n        win.__swicaBrazeRetryInitialization = function() {\n          delete win.__swicaBrazeInitPromise;\n          removeFailedSdkScript();\n          if (hasBrazeConsent()) {\n            return startBrazeInitialization();\n          } else {\n              if (win.braze) {\n                win.braze.disableSDK(); \n              }\n              win.__swicaBrazeInitialized = false;\n              setBrazeStatus('disabled', 'consent_revoked');\n              win.dispatchEvent(new Event('braze:teardown'));\n            };\n        };\n\n        if (hasBrazeConsent()) {\n          console.log(\"First time load: Braze consent granted, initializing Braze SDK.\");\n          startBrazeInitialization();\n        } else {\n          console.log(\"First time load: Braze consent not granted, skipping initialization.\");\n        }\n      })();\n    ")}},76603:(n,e,t)=>{n.exports=t(10214)},94780:(n,e,t)=>{"use strict";t.r(e),t.d(e,{default:()=>d});var a=t(1503),i=t(76603),r=t.n(i),o=t(72223),s=t(56408),l=t(76483);t(47411),t(37900);let d=n=>{var e,t,i,d,u,c,z,w,p;let{Component:f,pageProps:m}=n,v=null==(e=m.environment)?void 0:e.gtmId,g=null==(t=m.environment)?void 0:t.onetrustDomainScript,B=null==(i=m.environment)?void 0:i.brazeKey,_=(null==(d=m.environment)?void 0:d.brazeEndpoint)||"sdk.fra-02.braze.eu",b=null==(u=m.environment)?void 0:u.brazeDebug,S=!!B,h=(null==(c=m.enterpriseBotEnvironment)?void 0:c.ebotScriptUrl)||"",E=(null==(z=m.enterpriseBotEnvironment)?void 0:z.ebotScriptId)||"",y=null!=(p=null==m||null==(w=m.magnoliaContext)?void 0:w.isMagnoliaEdit)&&p,{isGranted:k}=(0,s.UM)(l.Vk,y,!g);return!function(n,e){(0,o.useEffect)(()=>{let t="swica-iq-script",a=document.getElementById(t);if(a&&a.remove(),!n||!e)return;let i=null,r=null,o=!1,s=()=>{if(o)return;let a=document.getElementById(t);a&&a.remove(),window.currentBotId=e,(i=document.createElement("script")).id=t,i.type="text/javascript",i.src=n,i.async=!0,i.addEventListener("error",()=>{let n=window;n.__swicaEnterpriseBotStatus="failed",n.__swicaEnterpriseBotStatusReason="script_failed_to_load",window.dispatchEvent(new Event("enterprise-bot:status"))}),document.body.appendChild(i)},l=()=>{r=setTimeout(s,1e3)};return"complete"===document.readyState?l():window.addEventListener("load",l,{once:!0}),()=>{o=!0,window.removeEventListener("load",l),r&&clearTimeout(r),null==i||i.remove()}},[n,e])}(h,E),!function(n){let{hasBrazeConsent:e,isBrazeSdkEnabled:t,oneTrustDomainScript:a}=n;(0,o.useEffect)(()=>{var n,i,r;if(!t||!a)return;let o=window;if(e){null==(r=o.__swicaBrazeRetryInitialization)||r.call(o);return}null==(i=o.braze)||null==(n=i.disableSDK)||n.call(i),o.__swicaBrazeInitialized=!1,o.__swicaBrazeStatus="disabled",o.__swicaBrazeStatusReason="consent_revoked",window.dispatchEvent(new Event("braze:status")),window.dispatchEvent(new Event("braze:teardown"))},[e,t,a])}({hasBrazeConsent:k,isBrazeSdkEnabled:S,oneTrustDomainScript:g}),(0,a.jsxs)("div",{children:[g&&(0,a.jsx)(r(),{id:"onetrust-optanon-wrapper",strategy:"afterInteractive",children:(0,l.jU)(s.h8)}),v&&(0,a.jsx)(r(),{id:"gtm-script",strategy:"afterInteractive",children:(0,l.Wk)(v)}),S&&(0,a.jsx)(r(),{id:"braze-sdk",strategy:"afterInteractive",children:(0,l.Yl)({brazeConsentCategory:l.Vk,brazeDebug:!!b,brazeEndpoint:_,brazeKey:null!=B?B:""})}),(0,a.jsx)(f,{...m})]})}}},n=>{var e=e=>n(n.s=e);n.O(0,[593,792],()=>(e(64498),e(15384))),_N_E=n.O()}]);

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.