{"version":3,"file":"ngwr-meta.mjs","sources":["../../../projects/lib/meta/tokens.ts","../../../projects/lib/meta/wr-meta.ts","../../../projects/lib/meta/wr-meta-binding.ts","../../../projects/lib/meta/provide-wr-meta.ts","../../../projects/lib/meta/ngwr-meta.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrMetaConfig } from './interfaces';\n\n/** App-wide defaults registered via {@link provideWrMeta}. */\nexport const WR_META_DEFAULTS = new InjectionToken<WrMetaConfig>('WR_META_DEFAULTS', {\n  factory: (): WrMetaConfig => ({}),\n});\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DOCUMENT } from '@angular/common';\nimport { Injector, Service, computed, effect, inject, signal, untracked } from '@angular/core';\nimport { Meta, Title } from '@angular/platform-browser';\n\nimport type { WrMetaConfig, WrMetaHandle } from './interfaces';\nimport { WR_META_DEFAULTS } from './tokens';\n\n/** Deep-merge two `WrMetaConfig` layers — later wins for scalars + nested groups. */\nfunction merge(base: WrMetaConfig, top: WrMetaConfig): WrMetaConfig {\n  return {\n    ...base,\n    ...top,\n    og: { ...base.og, ...top.og },\n    twitter: { ...base.twitter, ...top.twitter },\n  };\n}\n\n/**\n * Centralised `<head>` metadata manager — title, description, keywords,\n * canonical, Open Graph and Twitter Card tags.\n *\n * Stack-based: `push(config)` adds a layer (returned handle pops it),\n * `set(config)` replaces the current top, `reset()` clears all overrides.\n * Layers merge via shallow merge for scalars and a one-level deep merge\n * for `og` / `twitter` groups.\n *\n * The resolved metadata is applied diff-style — only changed tags are\n * touched in the DOM, so reads of `document.head` stay cheap.\n *\n * @example\n * ```ts\n * const meta = inject(WrMeta);\n * meta.set({ title: 'Pricing', description: 'Plans for every team.' });\n *\n * // From a route component — auto-pop on destroy via the directive:\n * <div [wrMeta]=\"{ title: 'Pricing' }\">\n * ```\n *\n * @see https://ngwr.dev/services/meta\n */\n@Service()\nexport class WrMeta {\n  private readonly title = inject(Title);\n  private readonly meta = inject(Meta);\n  private readonly doc = inject(DOCUMENT);\n  private readonly defaults = inject(WR_META_DEFAULTS);\n  private readonly injector = inject(Injector);\n\n  /** Stack of meta layers. Bottom = defaults, top = currently applied. */\n  private readonly stack = signal<readonly WrMetaConfig[]>([this.defaults]);\n\n  /** Resolved (merged) metadata at the top of the stack. */\n  readonly resolved = computed(() => this.stack().reduce((acc, layer) => merge(acc, layer), {} as WrMetaConfig));\n\n  /** Last applied snapshot — used to diff against the next resolution. */\n  private applied: WrMetaConfig = {};\n\n  constructor() {\n    // Apply defaults immediately on construction.\n    this.apply();\n  }\n\n  /** Snapshot of the resolved metadata currently in the DOM. */\n  current(): Readonly<WrMetaConfig> {\n    return this.applied;\n  }\n\n  /** Replace the top layer (or create one if only defaults are present). */\n  set(config: WrMetaConfig): void {\n    this.stack.update(stack => {\n      if (stack.length <= 1) return [...stack, config];\n      return [...stack.slice(0, -1), config];\n    });\n    this.apply();\n  }\n\n  /** Push a new layer. Returns a handle whose `.pop()` removes it. */\n  push(config: WrMetaConfig): WrMetaHandle {\n    this.stack.update(stack => [...stack, config]);\n    this.apply();\n    const target = config;\n    return {\n      pop: () => {\n        this.stack.update(stack => {\n          const idx = stack.lastIndexOf(target);\n          if (idx <= 0) return stack;\n          return [...stack.slice(0, idx), ...stack.slice(idx + 1)];\n        });\n        this.apply();\n      },\n    };\n  }\n\n  /**\n   * Reactive layer. Runs `factory` inside an effect and re-applies the\n   * resolved metadata whenever any signal it reads changes — so a title\n   * (or any field) built from {@link WrI18n}'s `t()` updates live on\n   * locale switch, with no manual re-`set()`.\n   *\n   * Returns a handle whose `.pop()` removes the layer and stops the effect.\n   * Safe to call outside an injection context.\n   *\n   * @example Locale-aware title\n   * ```ts\n   * const meta = inject(WrMeta);\n   * const i18n = inject(WrI18n);\n   *\n   * // `i18n.t(...)` tracks the active locale, so the title re-renders\n   * // every time `i18n.use(...)` switches languages.\n   * meta.bind(() => ({\n   *   title: i18n.t('home.title'),\n   *   description: i18n.t('home.description'),\n   * }));\n   * ```\n   */\n  bind(factory: () => WrMetaConfig): WrMetaHandle {\n    let current: WrMetaConfig | null = null;\n\n    const ref = effect(\n      () => {\n        const next = factory();\n        // Recompute is reactive; the stack write + DOM apply are not, so\n        // the effect only re-runs on `factory`'s own dependencies.\n        untracked(() => {\n          this.stack.update(stack => {\n            if (current === null) return [...stack, next];\n            const idx = stack.lastIndexOf(current);\n            return idx < 0 ? [...stack, next] : [...stack.slice(0, idx), next, ...stack.slice(idx + 1)];\n          });\n          current = next;\n          this.apply();\n        });\n      },\n      { injector: this.injector }\n    );\n\n    return {\n      pop: () => {\n        ref.destroy();\n        if (current === null) return;\n        const target = current;\n        current = null;\n        this.stack.update(stack => {\n          const idx = stack.lastIndexOf(target);\n          if (idx <= 0) return stack;\n          return [...stack.slice(0, idx), ...stack.slice(idx + 1)];\n        });\n        this.apply();\n      },\n    };\n  }\n\n  /** Pop the most recently pushed layer (defaults remain). */\n  pop(): void {\n    this.stack.update(stack => (stack.length <= 1 ? stack : stack.slice(0, -1)));\n    this.apply();\n  }\n\n  /** Clear all overrides, restore the defaults registered via `provideWrMeta`. */\n  reset(): void {\n    this.stack.set([this.defaults]);\n    this.apply();\n  }\n\n  // Internals\n\n  private apply(): void {\n    const next = this.resolved();\n    this.diffTitle(next);\n    this.diffMeta(next);\n    this.diffLink(next);\n    this.applied = next;\n  }\n\n  private diffTitle(next: WrMetaConfig): void {\n    if (next.title === this.applied.title && next.titleTemplate === this.applied.titleTemplate) return;\n    if (next.title) {\n      // `{{ title }}` reads like Angular; `%s` stays for printf fans.\n      const formatted = next.titleTemplate\n        ? next.titleTemplate.replace(/\\{\\{\\s*title\\s*\\}\\}/g, next.title).replace('%s', next.title)\n        : next.title;\n      this.title.setTitle(formatted);\n    } else if (this.applied.title) {\n      this.title.setTitle('');\n    }\n  }\n\n  private diffMeta(next: WrMetaConfig): void {\n    this.updateName('description', next.description);\n    this.updateName('keywords', next.keywords?.join(', '));\n    this.updateName('theme-color', next.themeColor);\n\n    // Open Graph.\n    this.updateProp('og:title', next.og?.title ?? next.title);\n    this.updateProp('og:description', next.og?.description ?? next.description);\n    this.updateProp('og:image', next.og?.image);\n    this.updateProp('og:url', next.og?.url ?? next.canonical);\n    this.updateProp('og:type', next.og?.type);\n    this.updateProp('og:site_name', next.og?.siteName);\n\n    // Twitter.\n    this.updateName('twitter:card', next.twitter?.card);\n    this.updateName('twitter:title', next.twitter?.title ?? next.title);\n    this.updateName('twitter:description', next.twitter?.description ?? next.description);\n    this.updateName('twitter:image', next.twitter?.image ?? next.og?.image);\n    this.updateName('twitter:creator', next.twitter?.creator);\n  }\n\n  private updateName(name: string, content: string | undefined): void {\n    if (content) {\n      this.meta.updateTag({ name, content }, `name='${name}'`);\n    } else {\n      this.meta.removeTag(`name='${name}'`);\n    }\n  }\n\n  private updateProp(property: string, content: string | undefined): void {\n    if (content) {\n      this.meta.updateTag({ property, content }, `property='${property}'`);\n    } else {\n      this.meta.removeTag(`property='${property}'`);\n    }\n  }\n\n  private diffLink(next: WrMetaConfig): void {\n    if (next.canonical === this.applied.canonical) return;\n    const head = this.doc.head;\n    let link = head.querySelector<HTMLLinkElement>(\"link[rel='canonical']\");\n    if (next.canonical) {\n      if (!link) {\n        link = this.doc.createElement('link');\n        link.setAttribute('rel', 'canonical');\n        head.appendChild(link);\n      }\n      link.setAttribute('href', next.canonical);\n    } else if (link) {\n      link.remove();\n    }\n  }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DestroyRef, Directive, effect, inject, input } from '@angular/core';\n\nimport type { WrMetaConfig, WrMetaHandle } from './interfaces';\nimport { WrMeta } from './wr-meta';\n\n/**\n * Declarative wrapper around {@link WrMeta}.\n *\n * - Pushes the bound config on init.\n * - Re-pushes (replacing) when the config reference changes.\n * - Pops the layer on destroy — perfect for route-level meta overrides.\n *\n * @example\n * ```html\n * <div [wrMeta]=\"{ title: 'Pricing', description: 'Plans for every team.' }\">\n * ```\n */\n@Directive({ selector: '[wrMeta]' })\nexport class WrMetaBinding {\n  readonly wrMeta = input.required<WrMetaConfig>();\n\n  private readonly metaService = inject(WrMeta);\n  private handle: WrMetaHandle | null = null;\n\n  constructor() {\n    effect(() => {\n      const next = this.wrMeta();\n      this.handle?.pop();\n      this.handle = this.metaService.push(next);\n    });\n    inject(DestroyRef).onDestroy(() => this.handle?.pop());\n  }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport type { WrMetaConfig } from './interfaces';\nimport { WR_META_DEFAULTS } from './tokens';\n\n/**\n * Register app-wide defaults for {@link WrMeta}. Use to set a\n * consistent baseline `title` / `titleTemplate` / `og` / `twitter` for every\n * route — individual routes / components can override via\n * `metaService.push(...)` or the `[wrMeta]` directive.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideWrMeta({\n *       titleTemplate: '{{ title }} · NGWR',\n *       description: 'Angular UI components library',\n *       og: { siteName: 'NGWR', type: 'website' },\n *       twitter: { card: 'summary_large_image', creator: '@thekhegay' },\n *     }),\n *   ],\n * });\n * ```\n */\nexport function provideWrMeta(defaults: WrMetaConfig = {}): EnvironmentProviders {\n  return makeEnvironmentProviders([{ provide: WR_META_DEFAULTS, useValue: defaults }]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAMH;MACa,gBAAgB,GAAG,IAAI,cAAc,CAAe,kBAAkB,EAAE;AACnF,IAAA,OAAO,EAAE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