1import { fg as useRoute, fJ as useStore, fK as useRequestURL, X as useState, fi as computed, fL as withAsyncContext, fM as navigateTo, fN as resolveNavOffsetStyle, fO as getFirstEligiblePageBlockIndex, fB as useHead, fP as onMounted, fu as createElementBlock, fQ as createCommentVNode, fj as unref, fo as openBlock, fe as Fragment, fR as renderList, fn as createBlock, fC as createBaseVNode, fS as _sfc_main$1 } from "./BMByWOq8.js"; 2import { generateAllPerformanceLinks } from "./C2-mFwZ8.js"; 3const IntegrationsEnum = { 4 OneTrust: 1 5}; 6const getPageFullPath = (siteData, page) => { 7 const handle = [page.handle]; 8 let currentPage = { ...page }; 9 let parentPage; 10 do { 11 parentPage = siteData.pages.find( 12 (p) => currentPage.parentPageId === p.id 13 ); 14 if (parentPage) { 15 handle.unshift(parentPage.handle); 16 currentPage = { ...parentPage }; 17 } else { 18 parentPage = null; 19 handle.unshift(""); 20 } 21 } while (parentPage); 22 return handle.join("/"); 23}; 24const normalizeCanonicalUrl = (url, baseUrl, isProduction = false) => { 25 if (!url) return null; 26 url = url.trim(); 27 if (!url) return null; 28 try { 29 if (/^https?:\/\//i.test(url)) { 30 if (isProduction) { 31 url = url.replace(/^http:\/\//i, "https://"); 32 } 33 return url; 34 } 35 if (url.startsWith("/")) { 36 const normalizedBaseUrl = (baseUrl == null ? void 0 : baseUrl.replace(/\/$/, "")) || ""; 37 return `${normalizedBaseUrl}${url}`; 38 } 39 const protocol = isProduction ? "https://" : "http://"; 40 return `${protocol}${url}`; 41 } catch (e) { 42 return null; 43 } 44}; 45const _hoisted_1 = { key: 0 }; 46const _hoisted_2 = { key: 0 }; 47const _hoisted_3 = { 48 key: 1, 49 class: "block__body" 50}; 51const _hoisted_4 = ["data-expired-preset-id"]; 52const _sfc_main = { 53 __name: "[...slug]", 54 async setup(__props) { 55 let __temp, __restore; 56 const route = useRoute(); 57 const store = useStore(); 58 const requestURL = useRequestURL(); 59 const head = useState("head", () => ({ 60 links: [], 61 scripts: [], 62 styles: [] 63 })); 64 const isMobileSettingsEnabled = computed( 65 () => store.getters["settings/getFeatureFlag"]("MobileSettings") === true 66 ); 67 const { page, themes, siteDomains, site } = ([__temp, __restore] = withAsyncContext(() => (() => { 68 var _a, _b, _c, _d; 69 let page2 = null; 70 if (route.path === "/") { 71 page2 = { ...store.getters.getHomePage }; 72 } else { 73 if (!route.path) { 74 return {}; 75 } 76 page2 = { 77 ...store.getters.getPageByHandle( 78 route.path.slice(route.path.lastIndexOf("/") + 1) 79 ) 80 }; 81 } 82 if (!(page2 == null ? void 0 : page2.id) && (!page2.blocks || ((_a = page2.blocks) == null ? void 0 : _a.length) === 0)) { 83 navigateTo("errors/page404"); 84 return; 85 } 86 page2.blocks = (page2 == null ? void 0 : page2.blocks) || []; 87 if (typeof page2.blocks === "string") { 88 page2.blocks = JSON.parse(page2.blocks); 89 } 90 const themes2 = { 91 color: store.getters.getThemeByKey("color"), 92 font: store.getters.getThemeByKey("font") 93 }; 94 const siteDomains2 = ((_c = (_b = store == null ? void 0 : store.state) == null ? void 0 : _b.site) == null ? void 0 : _c.siteDomains) || []; 95 const site2 = (_d = store.state) == null ? void 0 : _d.site; 96 return { 97 page: page2, 98 themes: themes2, 99 siteDomains: siteDomains2, 100 site: site2 101 }; 102 })()), __temp = await __temp, __restore(), __temp); 103 function getPublicOrigin() { 104 var _a; 105 if ((siteDomains == null ? void 0 : siteDomains.length) > 0) return ((_a = siteDomains[0]) == null ? void 0 : _a.url) ?? null; 106 return requestURL.origin; 107 } 108 const publicOrigin = getPublicOrigin(); 109 const pagePresetId = computed( 110 () => { 111 var _a; 112 return (page == null ? void 0 : page.presetId) ?? ((_a = page == null ? void 0 : page.layout) == null ? void 0 : _a.layoutPresetId); 113 } 114 ); 115 const siteRecord = computed( 116 () => { 117 var _a, _b, _c; 118 return ((_b = (_a = store.state) == null ? void 0 : _a.site) == null ? void 0 : _b.workingSite) ?? ((_c = store.state) == null ? void 0 : _c.site); 119 } 120 ); 121 const getFeatureFlag = (flagName) => store.getters["settings/getFeatureFlag"](flagName) === true; 122 const isNavOffsetActive = computed( 123 () => { 124 var _a, _b; 125 return resolveNavOffsetStyle( 126 (_b = (_a = siteRecord.value) == null ? void 0 : _a.navigation) == null ? void 0 : _b.navStyle, 127 getFeatureFlag 128 ) !== null; 129 } 130 ); 131 const dataDictionary = computed(() => { 132 var _a; 133 return (_a = siteRecord.value) == null ? void 0 : _a.dataDictionary; 134 }); 135 const firstEligibleBlockIndex = computed( 136 () => getFirstEligiblePageBlockIndex( 137 page.blocks, 138 dataDictionary.value, 139 isNavOffsetActive.value 140 ) 141 ); 142 const isPageExpired = computed( 143 () => store.getters["library/isPresetExpired"](pagePresetId.value) 144 ); 145 const showExpiredPresetId = computed( 146 () => store.getters["settings/getFeatureFlag"]("ShowExpiredPresetId") === true 147 ); 148 const expiredPresetId = computed( 149 () => isPageExpired.value && showExpiredPresetId.value ? pagePresetId.value : void 0 150 ); 151 const seoJsonScript = computed(() => { 152 var _a; 153 const featureFlags = ((_a = store.state.settings) == null ? void 0 : _a.featureFlags) || {}; 154 const showJsonLd = featureFlags.SeoJson === true || featureFlags.SeoVideoImprovements === true;
155 if (!showJsonLd || !(page == null ? void 0 : page.seoJson)) { 156 return void 0; 157 } 158 let jsonStrings = []; 159 if (Array.isArray(page.seoJson)) { 160 jsonStrings = page.seoJson.filter( 161 (json) => json && typeof json === "string" 162 ); 163 } else if (typeof page.seoJson === "string") { 164 jsonStrings = [page.seoJson]; 165 } 166 if (jsonStrings.length === 0) { 167 return void 0; 168 } 169 return jsonStrings.map((jsonString) => ({ 170 type: "application/ld+json", 171 children: jsonString 172 })); 173 }); 174 useHead(() => { 175 var _a, _b, _c, _d, _e; 176 const cssText = [themes == null ? void 0 : themes.color, themes == null ? void 0 : themes.font].join("\n"); 177 const prod = true; 178 const pageTitle = (page == null ? void 0 : page.seoTitle) || (site == null ? void 0 : site.title); 179 const pageMetas = [ 180 { 181 property: "og:url", 182 content: `${publicOrigin || "http://localhost:3000"}${(route == null ? void 0 : route.path) || ""}` 183 }, 184 { 185 property: "og:type", 186 content: "website" 187 } 188 ]; 189 if (pageTitle) { 190 pageMetas.push({ 191 property: "og:title", 192 content: pageTitle 193 }); 194 } 195 const metaDescription = (page == null ? void 0 : page.seoDescription) || (site == null ? void 0 : site.seoDescription) || (site == null ? void 0 : site.title) || ""; 196 if (metaDescription) { 197 pageMetas.push({ 198 name: "description", 199 key: "description", 200 content: metaDescription 201 }); 202 pageMetas.push({ 203 property: "og:description", 204 content: metaDescription 205 }); 206 } 207 if ((_a = page == null ? void 0 : page.head) == null ? void 0 : _a.ogImage) { 208 pageMetas.push({ 209 property: "og:image", 210 content: page.head.ogImage 211 }); 212 pageMetas.push({ 213 property: "og:image:width", 214 content: "1200" 215 }); 216 pageMetas.push({ 217 property: "og:image:height", 218 content: "630" 219 }); 220 } 221 const pageLinks = generateAllPerformanceLinks({ 222 existingLinks: ((_b = head.value) == null ? void 0 : _b.links) || [], 223 scripts: ((_c = head.value) == null ? void 0 : _c.scripts) || [], 224 googleFonts: (site == null ? void 0 : site.googleFonts) || [], 225 imageUrl: null, 226 pageBlocks: page == null ? void 0 : page.blocks, 227 pageFavicon: ((_d = page == null ? void 0 : page.head) == null ? void 0 : _d.favicon) || null, 228 mobileSettingsEnabled: isMobileSettingsEnabled.value 229 }); 230 const isCanonicalUrlEnabled = computed( 231 () => store.getters["settings/getFeatureFlag"]("SeoCanonicalUrls") === true 232 ); 233 let canonicalUrl = null; 234 if (isCanonicalUrlEnabled.value) { 235 canonicalUrl = page == null ? void 0 : page.canonicalUrl; 236 const baseUrl = publicOrigin || requestURL.origin; 237 if (!canonicalUrl) { 238 const pagePath = route.path === "/" ? "/" : getPageFullPath(site, page); 239 canonicalUrl = `${baseUrl}${pagePath}`; 240 } else { 241 canonicalUrl = normalizeCanonicalUrl(canonicalUrl, baseUrl, prod); 242 } 243 if (canonicalUrl) { 244 pageLinks.push({ 245 rel: "canonical", 246 href: canonicalUrl 247 }); 248 } 249 } 250 const scripts = [...((_e = head.value) == null ? void 0 : _e.scripts) || []]; 251 if (seoJsonScript.value) { 252 scripts.push(...seoJsonScript.value); 253 } 254 return { 255 title: pageTitle, 256 titleTemplate: pageTitle, 257 style: [ 258 { 259 children: cssText, 260 type: "text/css" 261 } 262 ], 263 link: pageLinks, 264 meta: pageMetas, 265 script: scripts 266 }; 267 }); 268 onMounted(() => { 269 var _a, _b; 270 const oneTrustIntegration = (_a = site == null ? void 0 : site.integrations) == null ? void 0 : _a.find( 271 (i) => i.integration.id === IntegrationsEnum.OneTrust 272 ); 273 const isCoreLite = store.getters["settings/getBrandFeatureFlag"]("CoreLite"); 274 if (oneTrustIntegration && !isCoreLite) { 275 (_b = window == null ? void 0 : window.dataLayer) == null ? void 0 : _b.push({ 276 "onetrust-data-domain-script": oneTrustIntegration.domainId 277 }); 278 } 279 }); 280 return (_ctx, _cache) => { 281 const _component_CoreBlock = _sfc_main$1; 282 return unref(page) ? (openBlock(), createElementBlock("div", _hoisted_1, [ 283 !isPageExpired.value ? (openBlock(), createElementBlock("div", _hoisted_2, [ 284 (openBlock(true), createElementBlock(Fragment, null, renderList(unref(page).blocks, (blockSettings, blockIndex) => { 285 return openBlock(), createBlock(_component_CoreBlock, { 286 key: blockSettings.id, 287 index: blockIndex, 288 settings: blockSettings, 289 "is-first-page-level-block": blockIndex === firstEligibleBlockIndex.value, 290 "is-first-page-level-position": blockIndex === firstEligibleBlockIndex.value 291 }, null, 8, ["index", "settings", "is-first-page-level-block", "is-first-page-level-position"]); 292 }), 128)) 293 ])) : (openBlock(), createElementBlock("div", _hoisted_3, [ 294 createBaseVNode("div", { 295 class: "expired-content", 296 "data-expired-preset-id": expiredPresetId.value 297 }, null, 8, _hoisted_4) 298 ])) 299 ])) : createCommentVNode("", true); 300 }; 301 } 302}; 303const ____slug_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 304 __proto__: null, 305 default: _sfc_main 306}, Symbol.toStringTag, { value: "Module" })); 307export { 308 IntegrationsEnum as I, 309 _sfc_main as _, 310 ____slug_ as a, 311 getPageFullPath as g 312};
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.