<template>
  <Html :lang="i18nHead.htmlAttrs.lang" :dir="i18nHead.htmlAttrs.dir">
    <CommonCookiesConsent />

    <div id="top" />

    <LayoutNavigation />

    <nuxt-page />

    <LayoutFooter />
  </Html>
</template>

<script setup lang="ts">
import UrlUtils from '~/services/utils/urlUtils'

const layoutStore = useLayoutStore()

layoutStore.resetAnchoredSections()

const i18nHead = useLocaleHead({
  addDirAttribute: true,
  identifierAttribute: 'id',
  addSeoAttributes: true,
})

const route = useRoute()
const runtimeConfig = useRuntimeConfig()

useHead(() => ({
  link: [
    {
      rel: 'canonical',
      href: UrlUtils.join(runtimeConfig.public.siteUrl as string, route.path),
    },
  ],
}))
</script>
