react-ssr-seo-toolkit 1.0.5 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +633 -460
  2. package/dist/adapters/nextjs.cjs +2 -0
  3. package/dist/adapters/nextjs.cjs.map +1 -0
  4. package/dist/adapters/nextjs.d.cts +86 -0
  5. package/dist/adapters/nextjs.d.ts +86 -0
  6. package/dist/adapters/nextjs.js +2 -0
  7. package/dist/adapters/nextjs.js.map +1 -0
  8. package/dist/adapters/react-router.cjs +2 -0
  9. package/dist/adapters/react-router.cjs.map +1 -0
  10. package/dist/adapters/react-router.d.cts +71 -0
  11. package/dist/adapters/react-router.d.ts +71 -0
  12. package/dist/adapters/react-router.js +2 -0
  13. package/dist/adapters/react-router.js.map +1 -0
  14. package/dist/chunk-3UCLUFOI.js +5 -0
  15. package/dist/chunk-3UCLUFOI.js.map +1 -0
  16. package/dist/chunk-A62THBIS.cjs +3 -0
  17. package/dist/chunk-A62THBIS.cjs.map +1 -0
  18. package/dist/chunk-FKDMHECL.cjs +2 -0
  19. package/dist/chunk-FKDMHECL.cjs.map +1 -0
  20. package/dist/chunk-GNLXGAS6.js +3 -0
  21. package/dist/chunk-GNLXGAS6.js.map +1 -0
  22. package/dist/chunk-LEOORZQY.cjs +5 -0
  23. package/dist/chunk-LEOORZQY.cjs.map +1 -0
  24. package/dist/chunk-LP66SUGR.js +2 -0
  25. package/dist/chunk-LP66SUGR.js.map +1 -0
  26. package/dist/chunk-ROA74LH6.cjs +61 -0
  27. package/dist/chunk-ROA74LH6.cjs.map +1 -0
  28. package/dist/chunk-WM5VVPED.js +61 -0
  29. package/dist/chunk-WM5VVPED.js.map +1 -0
  30. package/dist/chunk-X535MU7Z.js +5 -0
  31. package/dist/chunk-X535MU7Z.js.map +1 -0
  32. package/dist/chunk-ZADUJHVR.cjs +5 -0
  33. package/dist/chunk-ZADUJHVR.cjs.map +1 -0
  34. package/dist/chunk-ZECSTNEE.cjs +3 -0
  35. package/dist/chunk-ZECSTNEE.cjs.map +1 -0
  36. package/dist/chunk-ZVFEGG25.js +3 -0
  37. package/dist/chunk-ZVFEGG25.js.map +1 -0
  38. package/dist/components.cjs +1 -1
  39. package/dist/components.d.cts +2 -2
  40. package/dist/components.d.ts +2 -2
  41. package/dist/components.js +1 -1
  42. package/dist/index-Br7Sh9Ur.d.cts +329 -0
  43. package/dist/index-Br7Sh9Ur.d.ts +329 -0
  44. package/dist/{index-DAGfo2Fc.d.ts → index-CKNcgAj8.d.ts} +10 -2
  45. package/dist/{index-RBSUcdqN.d.cts → index-Wgogf4CX.d.cts} +10 -2
  46. package/dist/index.cjs +1 -1
  47. package/dist/index.d.cts +7 -4
  48. package/dist/index.d.ts +7 -4
  49. package/dist/index.js +1 -1
  50. package/dist/og.cjs +2 -0
  51. package/dist/og.cjs.map +1 -0
  52. package/dist/og.d.cts +5 -0
  53. package/dist/og.d.ts +5 -0
  54. package/dist/og.js +2 -0
  55. package/dist/og.js.map +1 -0
  56. package/dist/schema.cjs +1 -1
  57. package/dist/schema.d.cts +6 -2
  58. package/dist/schema.d.ts +6 -2
  59. package/dist/schema.js +1 -1
  60. package/dist/sitemap.cjs +2 -0
  61. package/dist/sitemap.cjs.map +1 -0
  62. package/dist/sitemap.d.cts +12 -0
  63. package/dist/sitemap.d.ts +12 -0
  64. package/dist/sitemap.js +2 -0
  65. package/dist/sitemap.js.map +1 -0
  66. package/dist/validation.cjs +2 -0
  67. package/dist/validation.cjs.map +1 -0
  68. package/dist/validation.d.cts +8 -0
  69. package/dist/validation.d.ts +8 -0
  70. package/dist/validation.js +2 -0
  71. package/dist/validation.js.map +1 -0
  72. package/package.json +58 -2
  73. package/dist/chunk-63ETSZTD.cjs +0 -3
  74. package/dist/chunk-63ETSZTD.cjs.map +0 -1
  75. package/dist/chunk-ES4OXVOR.js +0 -3
  76. package/dist/chunk-ES4OXVOR.js.map +0 -1
  77. package/dist/chunk-QBHCTDUJ.cjs +0 -2
  78. package/dist/chunk-QBHCTDUJ.cjs.map +0 -1
  79. package/dist/chunk-YMCW2G4X.js +0 -2
  80. package/dist/chunk-YMCW2G4X.js.map +0 -1
  81. package/dist/index-Dr2yktvz.d.cts +0 -136
  82. package/dist/index-Dr2yktvz.d.ts +0 -136
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkFKDMHECL_cjs=require('../chunk-FKDMHECL.cjs');function d(a){let r={};a.title&&(a.titleTemplate?r.title={default:a.title,template:a.titleTemplate}:r.title=a.title),a.description?.trim()&&(r.description=a.description.trim());let o=!!a.canonical?.trim(),s=!!a.alternates?.length;if((o||s)&&(r.alternates={},o&&(r.alternates.canonical=a.canonical.trim()),s)){let t={};for(let e of a.alternates)t[e.hreflang]=e.href;r.alternates.languages=t;}if(a.robots){let t=a.robots,e={};t.index!==void 0&&(e.index=t.index),t.follow!==void 0&&(e.follow=t.follow),t.noarchive&&(e.noarchive=t.noarchive),t.nosnippet&&(e.nosnippet=t.nosnippet),t.noimageindex&&(e.noimageindex=t.noimageindex),t.notranslate&&(e.notranslate=t.notranslate),t.maxSnippet!==void 0&&(e["max-snippet"]=t.maxSnippet),t.maxImagePreview&&(e["max-image-preview"]=t.maxImagePreview),t.maxVideoPreview!==void 0&&(e["max-video-preview"]=t.maxVideoPreview),r.robots=e;}if(a.openGraph){let t=a.openGraph,e={};t.title&&(e.title=t.title),t.description&&(e.description=t.description),t.url&&(e.url=t.url),t.siteName&&(e.siteName=t.siteName),t.type&&(e.type=t.type),t.locale&&(e.locale=t.locale),t.images?.length&&(e.images=t.images.map(i=>{let n={url:i.url};return i.alt&&(n.alt=i.alt),i.width&&(n.width=i.width),i.height&&(n.height=i.height),i.type&&(n.type=i.type),n})),r.openGraph=e;}if(a.twitter){let t=a.twitter,e={};t.card&&(e.card=t.card),t.site&&(e.site=t.site),t.creator&&(e.creator=t.creator),t.title&&(e.title=t.title),t.description&&(e.description=t.description),t.image&&(e.images=[t.image]),r.twitter=e;}if(a.additionalMetaTags?.length){let t={};for(let e of a.additionalMetaTags){let i=e.name??e.property;i&&(t[i]=e.content);}Object.keys(t).length>0&&(r.other=t);}return r}function m(a){return chunkFKDMHECL_cjs.i(a.title,a.titleTemplate)}exports.buildNextTitle=m;exports.toNextMetadata=d;//# sourceMappingURL=nextjs.cjs.map
2
+ //# sourceMappingURL=nextjs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/nextjs/index.ts"],"names":["toNextMetadata","config","meta","hasCanonical","hasAlternates","languages","alt","r","robots","og","openGraph","img","image","tw","twitter","other","tag","key","buildNextTitle","buildTitle"],"mappings":"oEA4FO,SAASA,EAAeC,CAAAA,CAAmC,CAChE,IAAMC,CAAAA,CAAuB,GAGzBD,CAAAA,CAAO,KAAA,GACLA,CAAAA,CAAO,aAAA,CACTC,EAAK,KAAA,CAAQ,CACX,QAASD,CAAAA,CAAO,KAAA,CAChB,SAAUA,CAAAA,CAAO,aACnB,CAAA,CAEAC,CAAAA,CAAK,MAAQD,CAAAA,CAAO,KAAA,CAAA,CAKpBA,EAAO,WAAA,EAAa,IAAA,KACtBC,CAAAA,CAAK,WAAA,CAAcD,EAAO,WAAA,CAAY,IAAA,IAIxC,IAAME,CAAAA,CAAe,CAAC,CAACF,CAAAA,CAAO,WAAW,IAAA,EAAK,CACxCG,CAAAA,CAAgB,CAAC,CAACH,CAAAA,CAAO,UAAA,EAAY,OAE3C,GAAA,CAAIE,CAAAA,EAAgBC,KAClBF,CAAAA,CAAK,UAAA,CAAa,EAAC,CAEfC,CAAAA,GACFD,EAAK,UAAA,CAAW,SAAA,CAAYD,EAAO,SAAA,CAAW,IAAA,IAG5CG,CAAAA,CAAAA,CAAe,CACjB,IAAMC,CAAAA,CAAoC,EAAC,CAC3C,IAAA,IAAWC,KAAOL,CAAAA,CAAO,UAAA,CACvBI,EAAUC,CAAAA,CAAI,QAAQ,EAAIA,CAAAA,CAAI,IAAA,CAEhCJ,EAAK,UAAA,CAAW,SAA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AG,KAAK,CAAA,CAAA,CAExCX,CAAAA,CAAK,QAAUY,EACjB,CAIA,GAAIb,CAAAA,CAAO,kBAAA,EAAoB,OAAQ,CACrC,IAAMc,CAAAA,CAAgC,GACtC,IAAA,IAAWC,CAAAA,IAAOf,EAAO,kBAAA,CAAoB,CAC3C,IAAMgB,CAAAA,CAAMD,CAAAA,CAAI,MAAQA,CAAAA,CAAI,QAAA,CACxBC,IAAKF,CAAAA,CAAME,CAAG,EAAID,CAAAA,CAAI,OAAA,EAC5B,CACI,MAAA,CAAO,IAAA,CAAKD,CAAK,CAAA,CAAE,OAAS,CAAA,GAAGb,CAAAA,CAAK,MAAQa,CAAAA,EAClD,CAEA,OAAOb,CACT,CAMO,SAASgB,CAAAA,CAAejB,CAAAA,CAA2B,CACxD,OAAOkB,mBAAAA,CAAWlB,EAAO,KAAA,CAAOA,CAAAA,CAAO,aAAa,CACtD","file":"nextjs.cjs","sourcesContent":["import type { SEOConfig, OpenGraphImage } from \"../../types/index.js\";\nimport { buildTitle } from \"../../core/index.js\";\n\n// ─── Next.js-compatible Metadata type ────────────────────────\n// Mirrors Next.js App Router's Metadata interface without importing from 'next'.\n// Safe to use even when 'next' is not installed.\n\nexport interface NextJSMetadataTitle {\n /** Page-level title, replaces %s in template */\n default?: string;\n /** Template applied to child pages, e.g. \"%s | MySite\" */\n template?: string;\n /** Absolute title, ignores template */\n absolute?: string;\n}\n\nexport interface NextJSMetadataImage {\n url: string;\n alt?: string;\n width?: number;\n height?: number;\n type?: string;\n}\n\nexport interface NextJSMetadataRobots {\n index?: boolean;\n follow?: boolean;\n noarchive?: boolean;\n nosnippet?: boolean;\n noimageindex?: boolean;\n notranslate?: boolean;\n \"max-snippet\"?: number;\n \"max-image-preview\"?: \"none\" | \"standard\" | \"large\";\n \"max-video-preview\"?: number;\n}\n\nexport interface NextJSMetadataOpenGraph {\n title?: string;\n description?: string;\n url?: string;\n siteName?: string;\n images?: NextJSMetadataImage[];\n locale?: string;\n type?: string;\n}\n\nexport interface NextJSMetadataTwitter {\n card?: \"summary\" | \"summary_large_image\" | \"app\" | \"player\";\n site?: string;\n creator?: string;\n title?: string;\n description?: string;\n images?: string[];\n}\n\nexport interface NextJSMetadataAlternates {\n canonical?: string;\n languages?: Record<string, string>;\n}\n\n/**\n * Minimal subset of Next.js App Router `Metadata` type.\n * Fully compatible — pass this to `generateMetadata()` or `export const metadata`.\n */\nexport interface NextJSMetadata {\n title?: string | NextJSMetadataTitle;\n description?: string;\n robots?: NextJSMetadataRobots;\n openGraph?: NextJSMetadataOpenGraph;\n twitter?: NextJSMetadataTwitter;\n alternates?: NextJSMetadataAlternates;\n other?: Record<string, string | number | Array<string | number>>;\n}\n\n// ─── Converter ────────────────────────────────────────────────\n\n/**\n * Converts a `SEOConfig` to a Next.js App Router compatible `Metadata` object.\n *\n * @example\n * // app/about/page.tsx\n * import { toNextMetadata } from 'react-ssr-seo-toolkit/adapters/nextjs';\n *\n * export function generateMetadata(): Metadata {\n * return toNextMetadata({\n * title: 'About Us',\n * titleTemplate: '%s | MySite',\n * description: 'Learn more about us.',\n * canonical: 'https://mysite.com/about',\n * });\n * }\n */\nexport function toNextMetadata(config: SEOConfig): NextJSMetadata {\n const meta: NextJSMetadata = {};\n\n // Title\n if (config.title) {\n if (config.titleTemplate) {\n meta.title = {\n default: config.title,\n template: config.titleTemplate,\n };\n } else {\n meta.title = config.title;\n }\n }\n\n // Description\n if (config.description?.trim()) {\n meta.description = config.description.trim();\n }\n\n // Canonical + hreflang → alternates\n const hasCanonical = !!config.canonical?.trim();\n const hasAlternates = !!config.alternates?.length;\n\n if (hasCanonical || hasAlternates) {\n meta.alternates = {};\n\n if (hasCanonical) {\n meta.alternates.canonical = config.canonical!.trim();\n }\n\n if (hasAlternates) {\n const languages: Record<string, string> = {};\n for (const alt of config.alternates!) {\n languages[alt.hreflang] = alt.href;\n }\n meta.alternates.languages = languages;\n }\n }\n\n // Robots\n if (config.robots) {\n const r = config.robots;\n const robots: NextJSMetadataRobots = {};\n\n if (r.index !== undefined) robots.index = r.index;\n if (r.follow !== undefined) robots.follow = r.follow;\n if (r.noarchive) robots.noarchive = r.noarchive;\n if (r.nosnippet) robots.nosnippet = r.nosnippet;\n if (r.noimageindex) robots.noimageindex = r.noimageindex;\n if (r.notranslate) robots.notranslate = r.notranslate;\n if (r.maxSnippet !== undefined) robots[\"max-snippet\"] = r.maxSnippet;\n if (r.maxImagePreview) robots[\"max-image-preview\"] = r.maxImagePreview;\n if (r.maxVideoPreview !== undefined)\n robots[\"max-video-preview\"] = r.maxVideoPreview;\n\n meta.robots = robots;\n }\n\n // Open Graph\n if (config.openGraph) {\n const og = config.openGraph;\n const openGraph: NextJSMetadataOpenGraph = {};\n\n if (og.title) openGraph.title = og.title;\n if (og.description) openGraph.description = og.description;\n if (og.url) openGraph.url = og.url;\n if (og.siteName) openGraph.siteName = og.siteName;\n if (og.type) openGraph.type = og.type;\n if (og.locale) openGraph.locale = og.locale;\n\n if (og.images?.length) {\n openGraph.images = og.images.map((img: OpenGraphImage) => {\n const image: NextJSMetadataImage = { url: img.url };\n if (img.alt) image.alt = img.alt;\n if (img.width) image.width = img.width;\n if (img.height) image.height = img.height;\n if (img.type) image.type = img.type;\n return image;\n });\n }\n\n meta.openGraph = openGraph;\n }\n\n // Twitter\n if (config.twitter) {\n const tw = config.twitter;\n const twitter: NextJSMetadataTwitter = {};\n\n if (tw.card) twitter.card = tw.card;\n if (tw.site) twitter.site = tw.site;\n if (tw.creator) twitter.creator = tw.creator;\n if (tw.title) twitter.title = tw.title;\n if (tw.description) twitter.description = tw.description;\n if (tw.image) twitter.images = [tw.image];\n\n meta.twitter = twitter;\n }\n\n // Additional meta tags → other (name-based only; property-based are not\n // expressible in Next.js Metadata.other and are skipped)\n if (config.additionalMetaTags?.length) {\n const other: Record<string, string> = {};\n for (const tag of config.additionalMetaTags) {\n const key = tag.name ?? tag.property;\n if (key) other[key] = tag.content;\n }\n if (Object.keys(other).length > 0) meta.other = other;\n }\n\n return meta;\n}\n\n/**\n * Builds the resolved title string exactly as Next.js would display it.\n * Useful for `<title>` in Pages Router or for og:title overrides.\n */\nexport function buildNextTitle(config: SEOConfig): string {\n return buildTitle(config.title, config.titleTemplate);\n}\n"]}
@@ -0,0 +1,86 @@
1
+ import { d as SEOConfig } from '../index-Br7Sh9Ur.cjs';
2
+
3
+ interface NextJSMetadataTitle {
4
+ /** Page-level title, replaces %s in template */
5
+ default?: string;
6
+ /** Template applied to child pages, e.g. "%s | MySite" */
7
+ template?: string;
8
+ /** Absolute title, ignores template */
9
+ absolute?: string;
10
+ }
11
+ interface NextJSMetadataImage {
12
+ url: string;
13
+ alt?: string;
14
+ width?: number;
15
+ height?: number;
16
+ type?: string;
17
+ }
18
+ interface NextJSMetadataRobots {
19
+ index?: boolean;
20
+ follow?: boolean;
21
+ noarchive?: boolean;
22
+ nosnippet?: boolean;
23
+ noimageindex?: boolean;
24
+ notranslate?: boolean;
25
+ "max-snippet"?: number;
26
+ "max-image-preview"?: "none" | "standard" | "large";
27
+ "max-video-preview"?: number;
28
+ }
29
+ interface NextJSMetadataOpenGraph {
30
+ title?: string;
31
+ description?: string;
32
+ url?: string;
33
+ siteName?: string;
34
+ images?: NextJSMetadataImage[];
35
+ locale?: string;
36
+ type?: string;
37
+ }
38
+ interface NextJSMetadataTwitter {
39
+ card?: "summary" | "summary_large_image" | "app" | "player";
40
+ site?: string;
41
+ creator?: string;
42
+ title?: string;
43
+ description?: string;
44
+ images?: string[];
45
+ }
46
+ interface NextJSMetadataAlternates {
47
+ canonical?: string;
48
+ languages?: Record<string, string>;
49
+ }
50
+ /**
51
+ * Minimal subset of Next.js App Router `Metadata` type.
52
+ * Fully compatible — pass this to `generateMetadata()` or `export const metadata`.
53
+ */
54
+ interface NextJSMetadata {
55
+ title?: string | NextJSMetadataTitle;
56
+ description?: string;
57
+ robots?: NextJSMetadataRobots;
58
+ openGraph?: NextJSMetadataOpenGraph;
59
+ twitter?: NextJSMetadataTwitter;
60
+ alternates?: NextJSMetadataAlternates;
61
+ other?: Record<string, string | number | Array<string | number>>;
62
+ }
63
+ /**
64
+ * Converts a `SEOConfig` to a Next.js App Router compatible `Metadata` object.
65
+ *
66
+ * @example
67
+ * // app/about/page.tsx
68
+ * import { toNextMetadata } from 'react-ssr-seo-toolkit/adapters/nextjs';
69
+ *
70
+ * export function generateMetadata(): Metadata {
71
+ * return toNextMetadata({
72
+ * title: 'About Us',
73
+ * titleTemplate: '%s | MySite',
74
+ * description: 'Learn more about us.',
75
+ * canonical: 'https://mysite.com/about',
76
+ * });
77
+ * }
78
+ */
79
+ declare function toNextMetadata(config: SEOConfig): NextJSMetadata;
80
+ /**
81
+ * Builds the resolved title string exactly as Next.js would display it.
82
+ * Useful for `<title>` in Pages Router or for og:title overrides.
83
+ */
84
+ declare function buildNextTitle(config: SEOConfig): string;
85
+
86
+ export { type NextJSMetadata, type NextJSMetadataAlternates, type NextJSMetadataImage, type NextJSMetadataOpenGraph, type NextJSMetadataRobots, type NextJSMetadataTitle, type NextJSMetadataTwitter, buildNextTitle, toNextMetadata };
@@ -0,0 +1,86 @@
1
+ import { d as SEOConfig } from '../index-Br7Sh9Ur.js';
2
+
3
+ interface NextJSMetadataTitle {
4
+ /** Page-level title, replaces %s in template */
5
+ default?: string;
6
+ /** Template applied to child pages, e.g. "%s | MySite" */
7
+ template?: string;
8
+ /** Absolute title, ignores template */
9
+ absolute?: string;
10
+ }
11
+ interface NextJSMetadataImage {
12
+ url: string;
13
+ alt?: string;
14
+ width?: number;
15
+ height?: number;
16
+ type?: string;
17
+ }
18
+ interface NextJSMetadataRobots {
19
+ index?: boolean;
20
+ follow?: boolean;
21
+ noarchive?: boolean;
22
+ nosnippet?: boolean;
23
+ noimageindex?: boolean;
24
+ notranslate?: boolean;
25
+ "max-snippet"?: number;
26
+ "max-image-preview"?: "none" | "standard" | "large";
27
+ "max-video-preview"?: number;
28
+ }
29
+ interface NextJSMetadataOpenGraph {
30
+ title?: string;
31
+ description?: string;
32
+ url?: string;
33
+ siteName?: string;
34
+ images?: NextJSMetadataImage[];
35
+ locale?: string;
36
+ type?: string;
37
+ }
38
+ interface NextJSMetadataTwitter {
39
+ card?: "summary" | "summary_large_image" | "app" | "player";
40
+ site?: string;
41
+ creator?: string;
42
+ title?: string;
43
+ description?: string;
44
+ images?: string[];
45
+ }
46
+ interface NextJSMetadataAlternates {
47
+ canonical?: string;
48
+ languages?: Record<string, string>;
49
+ }
50
+ /**
51
+ * Minimal subset of Next.js App Router `Metadata` type.
52
+ * Fully compatible — pass this to `generateMetadata()` or `export const metadata`.
53
+ */
54
+ interface NextJSMetadata {
55
+ title?: string | NextJSMetadataTitle;
56
+ description?: string;
57
+ robots?: NextJSMetadataRobots;
58
+ openGraph?: NextJSMetadataOpenGraph;
59
+ twitter?: NextJSMetadataTwitter;
60
+ alternates?: NextJSMetadataAlternates;
61
+ other?: Record<string, string | number | Array<string | number>>;
62
+ }
63
+ /**
64
+ * Converts a `SEOConfig` to a Next.js App Router compatible `Metadata` object.
65
+ *
66
+ * @example
67
+ * // app/about/page.tsx
68
+ * import { toNextMetadata } from 'react-ssr-seo-toolkit/adapters/nextjs';
69
+ *
70
+ * export function generateMetadata(): Metadata {
71
+ * return toNextMetadata({
72
+ * title: 'About Us',
73
+ * titleTemplate: '%s | MySite',
74
+ * description: 'Learn more about us.',
75
+ * canonical: 'https://mysite.com/about',
76
+ * });
77
+ * }
78
+ */
79
+ declare function toNextMetadata(config: SEOConfig): NextJSMetadata;
80
+ /**
81
+ * Builds the resolved title string exactly as Next.js would display it.
82
+ * Useful for `<title>` in Pages Router or for og:title overrides.
83
+ */
84
+ declare function buildNextTitle(config: SEOConfig): string;
85
+
86
+ export { type NextJSMetadata, type NextJSMetadataAlternates, type NextJSMetadataImage, type NextJSMetadataOpenGraph, type NextJSMetadataRobots, type NextJSMetadataTitle, type NextJSMetadataTwitter, buildNextTitle, toNextMetadata };
@@ -0,0 +1,2 @@
1
+ import {i}from'../chunk-LP66SUGR.js';function d(a){let r={};a.title&&(a.titleTemplate?r.title={default:a.title,template:a.titleTemplate}:r.title=a.title),a.description?.trim()&&(r.description=a.description.trim());let o=!!a.canonical?.trim(),s=!!a.alternates?.length;if((o||s)&&(r.alternates={},o&&(r.alternates.canonical=a.canonical.trim()),s)){let t={};for(let e of a.alternates)t[e.hreflang]=e.href;r.alternates.languages=t;}if(a.robots){let t=a.robots,e={};t.index!==void 0&&(e.index=t.index),t.follow!==void 0&&(e.follow=t.follow),t.noarchive&&(e.noarchive=t.noarchive),t.nosnippet&&(e.nosnippet=t.nosnippet),t.noimageindex&&(e.noimageindex=t.noimageindex),t.notranslate&&(e.notranslate=t.notranslate),t.maxSnippet!==void 0&&(e["max-snippet"]=t.maxSnippet),t.maxImagePreview&&(e["max-image-preview"]=t.maxImagePreview),t.maxVideoPreview!==void 0&&(e["max-video-preview"]=t.maxVideoPreview),r.robots=e;}if(a.openGraph){let t=a.openGraph,e={};t.title&&(e.title=t.title),t.description&&(e.description=t.description),t.url&&(e.url=t.url),t.siteName&&(e.siteName=t.siteName),t.type&&(e.type=t.type),t.locale&&(e.locale=t.locale),t.images?.length&&(e.images=t.images.map(i=>{let n={url:i.url};return i.alt&&(n.alt=i.alt),i.width&&(n.width=i.width),i.height&&(n.height=i.height),i.type&&(n.type=i.type),n})),r.openGraph=e;}if(a.twitter){let t=a.twitter,e={};t.card&&(e.card=t.card),t.site&&(e.site=t.site),t.creator&&(e.creator=t.creator),t.title&&(e.title=t.title),t.description&&(e.description=t.description),t.image&&(e.images=[t.image]),r.twitter=e;}if(a.additionalMetaTags?.length){let t={};for(let e of a.additionalMetaTags){let i=e.name??e.property;i&&(t[i]=e.content);}Object.keys(t).length>0&&(r.other=t);}return r}function m(a){return i(a.title,a.titleTemplate)}export{m as buildNextTitle,d as toNextMetadata};//# sourceMappingURL=nextjs.js.map
2
+ //# sourceMappingURL=nextjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/nextjs/index.ts"],"names":["toNextMetadata","config","meta","hasCanonical","hasAlternates","languages","alt","r","robots","og","openGraph","img","image","tw","twitter","other","tag","key","buildNextTitle","buildTitle"],"mappings":"qCA4FO,SAASA,EAAeC,CAAAA,CAAmC,CAChE,IAAMC,CAAAA,CAAuB,GAGzBD,CAAAA,CAAO,KAAA,GACLA,CAAAA,CAAO,aAAA,CACTC,EAAK,KAAA,CAAQ,CACX,QAASD,CAAAA,CAAO,KAAA,CAChB,SAAUA,CAAAA,CAAO,aACnB,CAAA,CAEAC,CAAAA,CAAK,MAAQD,CAAAA,CAAO,KAAA,CAAA,CAKpBA,EAAO,WAAA,EAAa,IAAA,KACtBC,CAAAA,CAAK,WAAA,CAAcD,EAAO,WAAA,CAAY,IAAA,IAIxC,IAAME,CAAAA,CAAe,CAAC,CAACF,CAAAA,CAAO,WAAW,IAAA,EAAK,CACxCG,CAAAA,CAAgB,CAAC,CAACH,CAAAA,CAAO,UAAA,EAAY,OAE3C,GAAA,CAAIE,CAAAA,EAAgBC,KAClBF,CAAAA,CAAK,UAAA,CAAa,EAAC,CAEfC,CAAAA,GACFD,EAAK,UAAA,CAAW,SAAA,CAAYD,EAAO,SAAA,CAAW,IAAA,IAG5CG,CAAAA,CAAAA,CAAe,CACjB,IAAMC,CAAAA,CAAoC,EAAC,CAC3C,IAAA,IAAWC,KAAOL,CAAAA,CAAO,UAAA,CACvBI,EAAUC,CAAAA,CAAI,QAAQ,EAAIA,CAAAA,CAAI,IAAA,CAEhCJ,EAAK,UAAA,CAAW,SAAA,CAAYG,EAC9B,CAIF,GAAIJ,EAAO,MAAA,CAAQ,CACjB,IAAMM,CAAAA,CAAIN,EAAO,MAAA,CACXO,CAAAA,CAA+B,EAAC,CAElCD,CAAAA,CAAE,QAAU,MAAA,GAAWC,CAAAA,CAAO,KAAA,CAAQD,CAAAA,CAAE,OACxCA,CAAAA,CAAE,MAAA,GAAW,SAAWC,CAAAA,CAAO,MAAA,CAASD,EAAE,MAAA,CAAA,CAC1CA,CAAAA,CAAE,SAAA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I,OAAA,EAC5B,CACI,MAAA,CAAO,IAAA,CAAKD,CAAK,CAAA,CAAE,OAAS,CAAA,GAAGb,CAAAA,CAAK,MAAQa,CAAAA,EAClD,CAEA,OAAOb,CACT,CAMO,SAASgB,CAAAA,CAAejB,CAAAA,CAA2B,CACxD,OAAOkB,CAAAA,CAAWlB,EAAO,KAAA,CAAOA,CAAAA,CAAO,aAAa,CACtD","file":"nextjs.js","sourcesContent":["import type { SEOConfig, OpenGraphImage } from \"../../types/index.js\";\nimport { buildTitle } from \"../../core/index.js\";\n\n// ─── Next.js-compatible Metadata type ────────────────────────\n// Mirrors Next.js App Router's Metadata interface without importing from 'next'.\n// Safe to use even when 'next' is not installed.\n\nexport interface NextJSMetadataTitle {\n /** Page-level title, replaces %s in template */\n default?: string;\n /** Template applied to child pages, e.g. \"%s | MySite\" */\n template?: string;\n /** Absolute title, ignores template */\n absolute?: string;\n}\n\nexport interface NextJSMetadataImage {\n url: string;\n alt?: string;\n width?: number;\n height?: number;\n type?: string;\n}\n\nexport interface NextJSMetadataRobots {\n index?: boolean;\n follow?: boolean;\n noarchive?: boolean;\n nosnippet?: boolean;\n noimageindex?: boolean;\n notranslate?: boolean;\n \"max-snippet\"?: number;\n \"max-image-preview\"?: \"none\" | \"standard\" | \"large\";\n \"max-video-preview\"?: number;\n}\n\nexport interface NextJSMetadataOpenGraph {\n title?: string;\n description?: string;\n url?: string;\n siteName?: string;\n images?: NextJSMetadataImage[];\n locale?: string;\n type?: string;\n}\n\nexport interface NextJSMetadataTwitter {\n card?: \"summary\" | \"summary_large_image\" | \"app\" | \"player\";\n site?: string;\n creator?: string;\n title?: string;\n description?: string;\n images?: string[];\n}\n\nexport interface NextJSMetadataAlternates {\n canonical?: string;\n languages?: Record<string, string>;\n}\n\n/**\n * Minimal subset of Next.js App Router `Metadata` type.\n * Fully compatible — pass this to `generateMetadata()` or `export const metadata`.\n */\nexport interface NextJSMetadata {\n title?: string | NextJSMetadataTitle;\n description?: string;\n robots?: NextJSMetadataRobots;\n openGraph?: NextJSMetadataOpenGraph;\n twitter?: NextJSMetadataTwitter;\n alternates?: NextJSMetadataAlternates;\n other?: Record<string, string | number | Array<string | number>>;\n}\n\n// ─── Converter ────────────────────────────────────────────────\n\n/**\n * Converts a `SEOConfig` to a Next.js App Router compatible `Metadata` object.\n *\n * @example\n * // app/about/page.tsx\n * import { toNextMetadata } from 'react-ssr-seo-toolkit/adapters/nextjs';\n *\n * export function generateMetadata(): Metadata {\n * return toNextMetadata({\n * title: 'About Us',\n * titleTemplate: '%s | MySite',\n * description: 'Learn more about us.',\n * canonical: 'https://mysite.com/about',\n * });\n * }\n */\nexport function toNextMetadata(config: SEOConfig): NextJSMetadata {\n const meta: NextJSMetadata = {};\n\n // Title\n if (config.title) {\n if (config.titleTemplate) {\n meta.title = {\n default: config.title,\n template: config.titleTemplate,\n };\n } else {\n meta.title = config.title;\n }\n }\n\n // Description\n if (config.description?.trim()) {\n meta.description = config.description.trim();\n }\n\n // Canonical + hreflang → alternates\n const hasCanonical = !!config.canonical?.trim();\n const hasAlternates = !!config.alternates?.length;\n\n if (hasCanonical || hasAlternates) {\n meta.alternates = {};\n\n if (hasCanonical) {\n meta.alternates.canonical = config.canonical!.trim();\n }\n\n if (hasAlternates) {\n const languages: Record<string, string> = {};\n for (const alt of config.alternates!) {\n languages[alt.hreflang] = alt.href;\n }\n meta.alternates.languages = languages;\n }\n }\n\n // Robots\n if (config.robots) {\n const r = config.robots;\n const robots: NextJSMetadataRobots = {};\n\n if (r.index !== undefined) robots.index = r.index;\n if (r.follow !== undefined) robots.follow = r.follow;\n if (r.noarchive) robots.noarchive = r.noarchive;\n if (r.nosnippet) robots.nosnippet = r.nosnippet;\n if (r.noimageindex) robots.noimageindex = r.noimageindex;\n if (r.notranslate) robots.notranslate = r.notranslate;\n if (r.maxSnippet !== undefined) robots[\"max-snippet\"] = r.maxSnippet;\n if (r.maxImagePreview) robots[\"max-image-preview\"] = r.maxImagePreview;\n if (r.maxVideoPreview !== undefined)\n robots[\"max-video-preview\"] = r.maxVideoPreview;\n\n meta.robots = robots;\n }\n\n // Open Graph\n if (config.openGraph) {\n const og = config.openGraph;\n const openGraph: NextJSMetadataOpenGraph = {};\n\n if (og.title) openGraph.title = og.title;\n if (og.description) openGraph.description = og.description;\n if (og.url) openGraph.url = og.url;\n if (og.siteName) openGraph.siteName = og.siteName;\n if (og.type) openGraph.type = og.type;\n if (og.locale) openGraph.locale = og.locale;\n\n if (og.images?.length) {\n openGraph.images = og.images.map((img: OpenGraphImage) => {\n const image: NextJSMetadataImage = { url: img.url };\n if (img.alt) image.alt = img.alt;\n if (img.width) image.width = img.width;\n if (img.height) image.height = img.height;\n if (img.type) image.type = img.type;\n return image;\n });\n }\n\n meta.openGraph = openGraph;\n }\n\n // Twitter\n if (config.twitter) {\n const tw = config.twitter;\n const twitter: NextJSMetadataTwitter = {};\n\n if (tw.card) twitter.card = tw.card;\n if (tw.site) twitter.site = tw.site;\n if (tw.creator) twitter.creator = tw.creator;\n if (tw.title) twitter.title = tw.title;\n if (tw.description) twitter.description = tw.description;\n if (tw.image) twitter.images = [tw.image];\n\n meta.twitter = twitter;\n }\n\n // Additional meta tags → other (name-based only; property-based are not\n // expressible in Next.js Metadata.other and are skipped)\n if (config.additionalMetaTags?.length) {\n const other: Record<string, string> = {};\n for (const tag of config.additionalMetaTags) {\n const key = tag.name ?? tag.property;\n if (key) other[key] = tag.content;\n }\n if (Object.keys(other).length > 0) meta.other = other;\n }\n\n return meta;\n}\n\n/**\n * Builds the resolved title string exactly as Next.js would display it.\n * Useful for `<title>` in Pages Router or for og:title overrides.\n */\nexport function buildNextTitle(config: SEOConfig): string {\n return buildTitle(config.title, config.titleTemplate);\n}\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkFKDMHECL_cjs=require('../chunk-FKDMHECL.cjs');function h(e){let r=[],n=chunkFKDMHECL_cjs.i(e.title,e.titleTemplate);n&&r.push({title:n}),e.description?.trim()&&r.push({name:"description",content:e.description.trim()}),e.canonical?.trim()&&r.push({tagName:"link",rel:"canonical",href:e.canonical.trim()});let s=chunkFKDMHECL_cjs.l(e.robots);s&&r.push({name:"robots",content:s});for(let t of chunkFKDMHECL_cjs.o(e.openGraph))r.push({property:t.property,content:t.content});for(let t of chunkFKDMHECL_cjs.p(e.twitter))r.push({name:t.name,content:t.content});for(let t of chunkFKDMHECL_cjs.q(e.alternates))r.push({tagName:"link",rel:t.rel,href:t.href,hrefLang:t.hreflang});if(e.additionalMetaTags)for(let t of e.additionalMetaTags)t.name?r.push({name:t.name,content:t.content}):t.property&&r.push({property:t.property,content:t.content});if(e.additionalLinkTags)for(let t of e.additionalLinkTags)r.push({tagName:"link",rel:t.rel,href:t.href,...t.hreflang&&{hrefLang:t.hreflang},...t.type&&{type:t.type},...t.sizes&&{sizes:t.sizes}});return r}function c(e){let r=[];e.canonical?.trim()&&r.push({rel:"canonical",href:e.canonical.trim()});for(let n of chunkFKDMHECL_cjs.q(e.alternates))r.push({rel:n.rel,href:n.href,hrefLang:n.hreflang});if(e.additionalLinkTags)for(let n of e.additionalLinkTags)r.push({rel:n.rel,href:n.href,...n.hreflang&&{hrefLang:n.hreflang},...n.type&&{type:n.type},...n.sizes&&{sizes:n.sizes}});return r}exports.toRouterLinks=c;exports.toRouterMeta=h;//# sourceMappingURL=react-router.cjs.map
2
+ //# sourceMappingURL=react-router.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/react-router/index.ts"],"names":["toRouterMeta","config","descriptors","resolvedTitle","buildTitle","robotsContent","buildRobotsDirectives","tag","buildOpenGraph","buildTwitterMetadata","link","buildAlternateLinks","toRouterLinks","links","alt"],"mappings":"oEAgEO,SAASA,CAAAA,CAAaC,CAAAA,CAA2C,CACtE,IAAMC,EAAsC,EAAC,CAGvCC,CAAAA,CAAgBC,mBAAAA,CAAWH,CAAAA,CAAO,KAAA,CAAOA,CAAAA,CAAO,aAAa,EAC/DE,CAAAA,EACFD,CAAAA,CAAY,I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T,IAAA,IAAWS,KAAQT,CAAAA,CAAO,kBAAA,CACxBY,CAAAA,CAAM,IAAA,CAAK,CACT,GAAA,CAAKH,CAAAA,CAAK,GAAA,CACV,KAAMA,CAAAA,CAAK,IAAA,CACX,GAAIA,CAAAA,CAAK,UAAY,CAAE,QAAA,CAAUA,CAAAA,CAAK,QAAS,EAC/C,GAAIA,CAAAA,CAAK,IAAA,EAAQ,CAAE,IAAA,CAAMA,CAAAA,CAAK,IAAK,CAAA,CACnC,GAAIA,CAAAA,CAAK,KAAA,EAAS,CAAE,KAAA,CAAOA,EAAK,KAAM,CACxC,CAAC,CAAA,CAIL,OAAOG,CACT","file":"react-router.cjs","sourcesContent":["import type { SEOConfig } from \"../../types/index.js\";\nimport {\n buildTitle,\n buildRobotsDirectives,\n buildOpenGraph,\n buildTwitterMetadata,\n buildAlternateLinks,\n} from \"../../core/index.js\";\n\n// ─── Descriptor types ─────────────────────────────────────────\n// Mirrors React Router 7's MetaDescriptor and LinkDescriptor\n// without importing from 'react-router', so no peer dep is needed.\n\nexport type RouterTitleDescriptor = { title: string };\n\nexport type RouterNameMetaDescriptor = {\n name: string;\n content: string;\n};\n\nexport type RouterPropertyMetaDescriptor = {\n property: string;\n content: string;\n};\n\nexport type RouterLinkDescriptor = {\n tagName: \"link\";\n rel: string;\n href: string;\n hrefLang?: string;\n type?: string;\n sizes?: string;\n [key: string]: string | undefined;\n};\n\nexport type RouterMetaDescriptor =\n | RouterTitleDescriptor\n | RouterNameMetaDescriptor\n | RouterPropertyMetaDescriptor\n | RouterLinkDescriptor;\n\n// ─── toRouterMeta ─────────────────────────────────────────────\n\n/**\n * Converts a `SEOConfig` to a React Router 7 meta descriptor array.\n *\n * Use the return value inside your route's `meta()` export.\n * Includes title, description, robots, Open Graph, Twitter, hreflang,\n * canonical, and any additional meta/link tags.\n *\n * @example\n * // routes/about.tsx\n * import { toRouterMeta } from 'react-ssr-seo-toolkit/adapters/react-router';\n *\n * export function meta(): MetaDescriptor[] {\n * return toRouterMeta({\n * title: 'About Us',\n * titleTemplate: '%s | MySite',\n * description: 'Learn more about us.',\n * canonical: 'https://mysite.com/about',\n * openGraph: { type: 'website', title: 'About Us' },\n * });\n * }\n */\nexport function toRouterMeta(config: SEOConfig): RouterMetaDescriptor[] {\n const descriptors: RouterMetaDescriptor[] = [];\n\n // Title\n const resolvedTitle = buildTitle(config.title, config.titleTemplate);\n if (resolvedTitle) {\n descriptors.push({ title: resolvedTitle });\n }\n\n // Description\n if (config.description?.trim()) {\n descriptors.push({ name: \"description\", content: config.description.trim() });\n }\n\n // Canonical\n if (config.canonical?.trim()) {\n descriptors.push({\n tagName: \"link\",\n rel: \"canonical\",\n href: config.canonical.trim(),\n });\n }\n\n // Robots\n const robotsContent = buildRobotsDirectives(config.robots);\n if (robotsContent) {\n descriptors.push({ name: \"robots\", content: robotsContent });\n }\n\n // Open Graph\n for (const tag of buildOpenGraph(config.openGraph)) {\n descriptors.push({ property: tag.property, content: tag.content });\n }\n\n // Twitter\n for (const tag of buildTwitterMetadata(config.twitter)) {\n descriptors.push({ name: tag.name, content: tag.content });\n }\n\n // Hreflang alternates\n for (const link of buildAlternateLinks(config.alternates)) {\n descriptors.push({\n tagName: \"link\",\n rel: link.rel,\n href: link.href,\n hrefLang: link.hreflang,\n });\n }\n\n // Additional meta tags\n if (config.additionalMetaTags) {\n for (const tag of config.additionalMetaTags) {\n if (tag.name) {\n descriptors.push({ name: tag.name, content: tag.content });\n } else if (tag.property) {\n descriptors.push({ property: tag.property, content: tag.content });\n }\n }\n }\n\n // Additional link tags\n if (config.additionalLinkTags) {\n for (const link of config.additionalLinkTags) {\n descriptors.push({\n tagName: \"link\",\n rel: link.rel,\n href: link.href,\n ...(link.hreflang && { hrefLang: link.hreflang }),\n ...(link.type && { type: link.type }),\n ...(link.sizes && { sizes: link.sizes }),\n });\n }\n }\n\n return descriptors;\n}\n\n// ─── toRouterLinks ────────────────────────────────────────────\n\n/**\n * Converts link-type entries from `SEOConfig` to React Router 7 `LinkDescriptor[]`.\n *\n * Use the return value inside your route's `links()` export for canonical\n * and hreflang links. This is an alternative to including them in `meta()`.\n *\n * @example\n * // routes/about.tsx\n * import { toRouterLinks } from 'react-ssr-seo-toolkit/adapters/react-router';\n *\n * export function links() {\n * return toRouterLinks({\n * canonical: 'https://mysite.com/about',\n * alternates: [{ hreflang: 'en', href: 'https://mysite.com/about' }],\n * });\n * }\n */\nexport function toRouterLinks(\n config: Pick<SEOConfig, \"canonical\" | \"alternates\" | \"additionalLinkTags\">\n): Array<{ rel: string; href: string; hrefLang?: string; type?: string; sizes?: string }> {\n const links: Array<{\n rel: string;\n href: string;\n hrefLang?: string;\n type?: string;\n sizes?: string;\n }> = [];\n\n if (config.canonical?.trim()) {\n links.push({ rel: \"canonical\", href: config.canonical.trim() });\n }\n\n for (const alt of buildAlternateLinks(config.alternates)) {\n links.push({ rel: alt.rel, href: alt.href, hrefLang: alt.hreflang });\n }\n\n if (config.additionalLinkTags) {\n for (const link of config.additionalLinkTags) {\n links.push({\n rel: link.rel,\n href: link.href,\n ...(link.hreflang && { hrefLang: link.hreflang }),\n ...(link.type && { type: link.type }),\n ...(link.sizes && { sizes: link.sizes }),\n });\n }\n }\n\n return links;\n}\n"]}
@@ -0,0 +1,71 @@
1
+ import { d as SEOConfig } from '../index-Br7Sh9Ur.cjs';
2
+
3
+ type RouterTitleDescriptor = {
4
+ title: string;
5
+ };
6
+ type RouterNameMetaDescriptor = {
7
+ name: string;
8
+ content: string;
9
+ };
10
+ type RouterPropertyMetaDescriptor = {
11
+ property: string;
12
+ content: string;
13
+ };
14
+ type RouterLinkDescriptor = {
15
+ tagName: "link";
16
+ rel: string;
17
+ href: string;
18
+ hrefLang?: string;
19
+ type?: string;
20
+ sizes?: string;
21
+ [key: string]: string | undefined;
22
+ };
23
+ type RouterMetaDescriptor = RouterTitleDescriptor | RouterNameMetaDescriptor | RouterPropertyMetaDescriptor | RouterLinkDescriptor;
24
+ /**
25
+ * Converts a `SEOConfig` to a React Router 7 meta descriptor array.
26
+ *
27
+ * Use the return value inside your route's `meta()` export.
28
+ * Includes title, description, robots, Open Graph, Twitter, hreflang,
29
+ * canonical, and any additional meta/link tags.
30
+ *
31
+ * @example
32
+ * // routes/about.tsx
33
+ * import { toRouterMeta } from 'react-ssr-seo-toolkit/adapters/react-router';
34
+ *
35
+ * export function meta(): MetaDescriptor[] {
36
+ * return toRouterMeta({
37
+ * title: 'About Us',
38
+ * titleTemplate: '%s | MySite',
39
+ * description: 'Learn more about us.',
40
+ * canonical: 'https://mysite.com/about',
41
+ * openGraph: { type: 'website', title: 'About Us' },
42
+ * });
43
+ * }
44
+ */
45
+ declare function toRouterMeta(config: SEOConfig): RouterMetaDescriptor[];
46
+ /**
47
+ * Converts link-type entries from `SEOConfig` to React Router 7 `LinkDescriptor[]`.
48
+ *
49
+ * Use the return value inside your route's `links()` export for canonical
50
+ * and hreflang links. This is an alternative to including them in `meta()`.
51
+ *
52
+ * @example
53
+ * // routes/about.tsx
54
+ * import { toRouterLinks } from 'react-ssr-seo-toolkit/adapters/react-router';
55
+ *
56
+ * export function links() {
57
+ * return toRouterLinks({
58
+ * canonical: 'https://mysite.com/about',
59
+ * alternates: [{ hreflang: 'en', href: 'https://mysite.com/about' }],
60
+ * });
61
+ * }
62
+ */
63
+ declare function toRouterLinks(config: Pick<SEOConfig, "canonical" | "alternates" | "additionalLinkTags">): Array<{
64
+ rel: string;
65
+ href: string;
66
+ hrefLang?: string;
67
+ type?: string;
68
+ sizes?: string;
69
+ }>;
70
+
71
+ export { type RouterLinkDescriptor, type RouterMetaDescriptor, type RouterNameMetaDescriptor, type RouterPropertyMetaDescriptor, type RouterTitleDescriptor, toRouterLinks, toRouterMeta };
@@ -0,0 +1,71 @@
1
+ import { d as SEOConfig } from '../index-Br7Sh9Ur.js';
2
+
3
+ type RouterTitleDescriptor = {
4
+ title: string;
5
+ };
6
+ type RouterNameMetaDescriptor = {
7
+ name: string;
8
+ content: string;
9
+ };
10
+ type RouterPropertyMetaDescriptor = {
11
+ property: string;
12
+ content: string;
13
+ };
14
+ type RouterLinkDescriptor = {
15
+ tagName: "link";
16
+ rel: string;
17
+ href: string;
18
+ hrefLang?: string;
19
+ type?: string;
20
+ sizes?: string;
21
+ [key: string]: string | undefined;
22
+ };
23
+ type RouterMetaDescriptor = RouterTitleDescriptor | RouterNameMetaDescriptor | RouterPropertyMetaDescriptor | RouterLinkDescriptor;
24
+ /**
25
+ * Converts a `SEOConfig` to a React Router 7 meta descriptor array.
26
+ *
27
+ * Use the return value inside your route's `meta()` export.
28
+ * Includes title, description, robots, Open Graph, Twitter, hreflang,
29
+ * canonical, and any additional meta/link tags.
30
+ *
31
+ * @example
32
+ * // routes/about.tsx
33
+ * import { toRouterMeta } from 'react-ssr-seo-toolkit/adapters/react-router';
34
+ *
35
+ * export function meta(): MetaDescriptor[] {
36
+ * return toRouterMeta({
37
+ * title: 'About Us',
38
+ * titleTemplate: '%s | MySite',
39
+ * description: 'Learn more about us.',
40
+ * canonical: 'https://mysite.com/about',
41
+ * openGraph: { type: 'website', title: 'About Us' },
42
+ * });
43
+ * }
44
+ */
45
+ declare function toRouterMeta(config: SEOConfig): RouterMetaDescriptor[];
46
+ /**
47
+ * Converts link-type entries from `SEOConfig` to React Router 7 `LinkDescriptor[]`.
48
+ *
49
+ * Use the return value inside your route's `links()` export for canonical
50
+ * and hreflang links. This is an alternative to including them in `meta()`.
51
+ *
52
+ * @example
53
+ * // routes/about.tsx
54
+ * import { toRouterLinks } from 'react-ssr-seo-toolkit/adapters/react-router';
55
+ *
56
+ * export function links() {
57
+ * return toRouterLinks({
58
+ * canonical: 'https://mysite.com/about',
59
+ * alternates: [{ hreflang: 'en', href: 'https://mysite.com/about' }],
60
+ * });
61
+ * }
62
+ */
63
+ declare function toRouterLinks(config: Pick<SEOConfig, "canonical" | "alternates" | "additionalLinkTags">): Array<{
64
+ rel: string;
65
+ href: string;
66
+ hrefLang?: string;
67
+ type?: string;
68
+ sizes?: string;
69
+ }>;
70
+
71
+ export { type RouterLinkDescriptor, type RouterMetaDescriptor, type RouterNameMetaDescriptor, type RouterPropertyMetaDescriptor, type RouterTitleDescriptor, toRouterLinks, toRouterMeta };
@@ -0,0 +1,2 @@
1
+ import {i,l,o,p,q}from'../chunk-LP66SUGR.js';function h(e){let r=[],n=i(e.title,e.titleTemplate);n&&r.push({title:n}),e.description?.trim()&&r.push({name:"description",content:e.description.trim()}),e.canonical?.trim()&&r.push({tagName:"link",rel:"canonical",href:e.canonical.trim()});let s=l(e.robots);s&&r.push({name:"robots",content:s});for(let t of o(e.openGraph))r.push({property:t.property,content:t.content});for(let t of p(e.twitter))r.push({name:t.name,content:t.content});for(let t of q(e.alternates))r.push({tagName:"link",rel:t.rel,href:t.href,hrefLang:t.hreflang});if(e.additionalMetaTags)for(let t of e.additionalMetaTags)t.name?r.push({name:t.name,content:t.content}):t.property&&r.push({property:t.property,content:t.content});if(e.additionalLinkTags)for(let t of e.additionalLinkTags)r.push({tagName:"link",rel:t.rel,href:t.href,...t.hreflang&&{hrefLang:t.hreflang},...t.type&&{type:t.type},...t.sizes&&{sizes:t.sizes}});return r}function c(e){let r=[];e.canonical?.trim()&&r.push({rel:"canonical",href:e.canonical.trim()});for(let n of q(e.alternates))r.push({rel:n.rel,href:n.href,hrefLang:n.hreflang});if(e.additionalLinkTags)for(let n of e.additionalLinkTags)r.push({rel:n.rel,href:n.href,...n.hreflang&&{hrefLang:n.hreflang},...n.type&&{type:n.type},...n.sizes&&{sizes:n.sizes}});return r}export{c as toRouterLinks,h as toRouterMeta};//# sourceMappingURL=react-router.js.map
2
+ //# sourceMappingURL=react-router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/react-router/index.ts"],"names":["toRouterMeta","config","descriptors","resolvedTitle","buildTitle","robotsContent","buildRobotsDirectives","tag","buildOpenGraph","buildTwitterMetadata","link","buildAlternateLinks","toRouterLinks","links","alt"],"mappings":"6CAgEO,SAASA,CAAAA,CAAaC,CAAAA,CAA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AA,CAAKC,CAAAA,CAAI,GAAA,CAAK,IAAA,CAAMA,CAAAA,CAAI,KAAM,QAAA,CAAUA,CAAAA,CAAI,QAAS,CAAC,EAGrE,GAAIb,CAAAA,CAAO,kBAAA,CACT,IAAA,IAAWS,KAAQT,CAAAA,CAAO,kBAAA,CACxBY,CAAAA,CAAM,IAAA,CAAK,CACT,GAAA,CAAKH,CAAAA,CAAK,GAAA,CACV,KAAMA,CAAAA,CAAK,IAAA,CACX,GAAIA,CAAAA,CAAK,UAAY,CAAE,QAAA,CAAUA,CAAAA,CAAK,QAAS,EAC/C,GAAIA,CAAAA,CAAK,IAAA,EAAQ,CAAE,IAAA,CAAMA,CAAAA,CAAK,IAAK,CAAA,CACnC,GAAIA,CAAAA,CAAK,KAAA,EAAS,CAAE,KAAA,CAAOA,EAAK,KAAM,CACxC,CAAC,CAAA,CAIL,OAAOG,CACT","file":"react-router.js","sourcesContent":["import type { SEOConfig } from \"../../types/index.js\";\nimport {\n buildTitle,\n buildRobotsDirectives,\n buildOpenGraph,\n buildTwitterMetadata,\n buildAlternateLinks,\n} from \"../../core/index.js\";\n\n// ─── Descriptor types ─────────────────────────────────────────\n// Mirrors React Router 7's MetaDescriptor and LinkDescriptor\n// without importing from 'react-router', so no peer dep is needed.\n\nexport type RouterTitleDescriptor = { title: string };\n\nexport type RouterNameMetaDescriptor = {\n name: string;\n content: string;\n};\n\nexport type RouterPropertyMetaDescriptor = {\n property: string;\n content: string;\n};\n\nexport type RouterLinkDescriptor = {\n tagName: \"link\";\n rel: string;\n href: string;\n hrefLang?: string;\n type?: string;\n sizes?: string;\n [key: string]: string | undefined;\n};\n\nexport type RouterMetaDescriptor =\n | RouterTitleDescriptor\n | RouterNameMetaDescriptor\n | RouterPropertyMetaDescriptor\n | RouterLinkDescriptor;\n\n// ─── toRouterMeta ─────────────────────────────────────────────\n\n/**\n * Converts a `SEOConfig` to a React Router 7 meta descriptor array.\n *\n * Use the return value inside your route's `meta()` export.\n * Includes title, description, robots, Open Graph, Twitter, hreflang,\n * canonical, and any additional meta/link tags.\n *\n * @example\n * // routes/about.tsx\n * import { toRouterMeta } from 'react-ssr-seo-toolkit/adapters/react-router';\n *\n * export function meta(): MetaDescriptor[] {\n * return toRouterMeta({\n * title: 'About Us',\n * titleTemplate: '%s | MySite',\n * description: 'Learn more about us.',\n * canonical: 'https://mysite.com/about',\n * openGraph: { type: 'website', title: 'About Us' },\n * });\n * }\n */\nexport function toRouterMeta(config: SEOConfig): RouterMetaDescriptor[] {\n const descriptors: RouterMetaDescriptor[] = [];\n\n // Title\n const resolvedTitle = buildTitle(config.title, config.titleTemplate);\n if (resolvedTitle) {\n descriptors.push({ title: resolvedTitle });\n }\n\n // Description\n if (config.description?.trim()) {\n descriptors.push({ name: \"description\", content: config.description.trim() });\n }\n\n // Canonical\n if (config.canonical?.trim()) {\n descriptors.push({\n tagName: \"link\",\n rel: \"canonical\",\n href: config.canonical.trim(),\n });\n }\n\n // Robots\n const robotsContent = buildRobotsDirectives(config.robots);\n if (robotsContent) {\n descriptors.push({ name: \"robots\", content: robotsContent });\n }\n\n // Open Graph\n for (const tag of buildOpenGraph(config.openGraph)) {\n descriptors.push({ property: tag.property, content: tag.content });\n }\n\n // Twitter\n for (const tag of buildTwitterMetadata(config.twitter)) {\n descriptors.push({ name: tag.name, content: tag.content });\n }\n\n // Hreflang alternates\n for (const link of buildAlternateLinks(config.alternates)) {\n descriptors.push({\n tagName: \"link\",\n rel: link.rel,\n href: link.href,\n hrefLang: link.hreflang,\n });\n }\n\n // Additional meta tags\n if (config.additionalMetaTags) {\n for (const tag of config.additionalMetaTags) {\n if (tag.name) {\n descriptors.push({ name: tag.name, content: tag.content });\n } else if (tag.property) {\n descriptors.push({ property: tag.property, content: tag.content });\n }\n }\n }\n\n // Additional link tags\n if (config.additionalLinkTags) {\n for (const link of config.additionalLinkTags) {\n descriptors.push({\n tagName: \"link\",\n rel: link.rel,\n href: link.href,\n ...(link.hreflang && { hrefLang: link.hreflang }),\n ...(link.type && { type: link.type }),\n ...(link.sizes && { sizes: link.sizes }),\n });\n }\n }\n\n return descriptors;\n}\n\n// ─── toRouterLinks ────────────────────────────────────────────\n\n/**\n * Converts link-type entries from `SEOConfig` to React Router 7 `LinkDescriptor[]`.\n *\n * Use the return value inside your route's `links()` export for canonical\n * and hreflang links. This is an alternative to including them in `meta()`.\n *\n * @example\n * // routes/about.tsx\n * import { toRouterLinks } from 'react-ssr-seo-toolkit/adapters/react-router';\n *\n * export function links() {\n * return toRouterLinks({\n * canonical: 'https://mysite.com/about',\n * alternates: [{ hreflang: 'en', href: 'https://mysite.com/about' }],\n * });\n * }\n */\nexport function toRouterLinks(\n config: Pick<SEOConfig, \"canonical\" | \"alternates\" | \"additionalLinkTags\">\n): Array<{ rel: string; href: string; hrefLang?: string; type?: string; sizes?: string }> {\n const links: Array<{\n rel: string;\n href: string;\n hrefLang?: string;\n type?: string;\n sizes?: string;\n }> = [];\n\n if (config.canonical?.trim()) {\n links.push({ rel: \"canonical\", href: config.canonical.trim() });\n }\n\n for (const alt of buildAlternateLinks(config.alternates)) {\n links.push({ rel: alt.rel, href: alt.href, hrefLang: alt.hreflang });\n }\n\n if (config.additionalLinkTags) {\n for (const link of config.additionalLinkTags) {\n links.push({\n rel: link.rel,\n href: link.href,\n ...(link.hreflang && { hrefLang: link.hreflang }),\n ...(link.type && { type: link.type }),\n ...(link.sizes && { sizes: link.sizes }),\n });\n }\n }\n\n return links;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ function d(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function h(s,t){return t.endsWith("/*")?s.startsWith(t.slice(0,-2)+"/")||s===t.slice(0,-2):t.endsWith("*")?s.startsWith(t.slice(0,-1)):t.startsWith("*")?s.endsWith(t.slice(1)):s===t}function w(s){let{routes:t,baseUrl:o,exclude:i=[],defaultChangefreq:n,defaultPriority:c}=s,e=o.replace(/\/+$/,"");return ['<?xml version="1.0" encoding="UTF-8"?>','<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',...t.map(r=>typeof r=="string"?{path:r}:r).filter(r=>!i.some(m=>h(r.path,m))).map(r=>{let m=r.path==="/"?e:`${e}${r.path}`,p=[" <url>",` <loc>${d(m)}</loc>`,` <lastmod>${r.lastmod??new Date().toISOString().split("T")[0]}</lastmod>`],g=r.changefreq??n;g&&p.push(` <changefreq>${g}</changefreq>`);let f=r.priority??c;return f!==void 0&&p.push(` <priority>${f.toFixed(1)}</priority>`),p.push(" </url>"),p.join(`
2
+ `)}),"</urlset>"].join(`
3
+ `)}function b(s){let{rules:t=[],sitemap:o}=s,i=Array.isArray(t)?t:[t],n=[];for(let e of i){let a=e.userAgent?Array.isArray(e.userAgent)?e.userAgent:[e.userAgent]:["*"];for(let r of a)n.push(`User-agent: ${r}`);let l=e.allow?Array.isArray(e.allow)?e.allow:[e.allow]:[];for(let r of l)n.push(`Allow: ${r}`);let u=e.disallow?Array.isArray(e.disallow)?e.disallow:[e.disallow]:[];for(let r of u)n.push(`Disallow: ${r}`);e.crawlDelay!==void 0&&n.push(`Crawl-delay: ${e.crawlDelay}`),n.push("");}let c=o?Array.isArray(o)?o:[o]:[];for(let e of c)n.push(`Sitemap: ${e}`);return n.join(`
4
+ `).trim()}function y(s){return s.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function A(s,t={}){let{baseUrl:o="",labels:i={},formatLabel:n=y}=t,c=s.split("/").filter(Boolean),e=[{name:i[""]??i["/"]??"Home",url:`${o}/`}],a="";for(let l of c){a+=`/${l}`;let u=i[a]??i[l]??n(l);e.push({name:u,url:`${o}${a}`});}return e}export{w as a,b,A as c};//# sourceMappingURL=chunk-3UCLUFOI.js.map
5
+ //# sourceMappingURL=chunk-3UCLUFOI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/sitemap/index.ts"],"names":["escapeXml","str","matchesExclude","path","pattern","generateSitemap","options","routes","baseUrl","exclude","defaultChangefreq","defaultPriority","normalizedBase","route","loc","lines","changefreq","priority","generateRobots","rules","sitemap","normalizedRules","rule","agents","agent","allows","disallows","sitemaps","sm","defaultFormatLabel","segment","c","autoBreadcrumb","currentPath","labels","formatLabel","segments","items","accPath","name"],"mappings":"AASA,SAASA,CAAAA,CAAUC,EAAqB,CACtC,OAAOA,EACJ,OAAA,CAAQ,IAAA,CAAM,OAAO,CAAA,CACrB,OAAA,CAAQ,IAAA,CAAM,MAAM,CAAA,CACpB,OAAA,CAAQ,KAAM,MAAM,CAAA,CACpB,QAAQ,IAAA,CAAM,QAAQ,CAAA,CACtB,OAAA,CAAQ,IAAA,CAAM,QAAQ,CAC3B,CAEA,SAASC,EAAeC,CAAAA,CAAcC,CAAAA,CAA0B,CAC9D,OAAIA,CAAAA,CAAQ,QAAA,CAAS,IAAI,CAAA,CAChBD,CAAAA,CAAK,WAAWC,CAAAA,CAAQ,KAAA,CAAM,EAAG,EAAE,CAAA,CAAI,GAAG,CAAA,EAAKD,CAAAA,GAASC,CAAAA,CAAQ,KAAA,CAAM,CAAA,CAAG,EAAE,EAEhFA,CAAAA,CAAQ,QAAA,CAAS,GAAG,CAAA,CACfD,CAAAA,CAAK,WAAWC,CAAAA,CAAQ,KAAA,CAAM,CAAA,CAAG,EAAE,CAAC,CAAA,CAEzCA,EAAQ,UAAA,CAAW,GAAG,EACjBD,CAAAA,CAAK,QAAA,CAASC,EAAQ,KAAA,CAAM,CAAC,CAAC,CAAA,CAEhCD,CAAAA,GAASC,CAClB,CAEO,SAASC,CAAAA,CAAgBC,EAAyC,CACvE,GAAM,CAAE,MAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAAC,CAAAA,CAAS,OAAA,CAAAC,CAAAA,CAAU,EAAC,CAAG,iBAAA,CAAAC,EAAmB,eAAA,CAAAC,CAAgB,EAAIL,CAAAA,CACxEM,CAAAA,CAAiBJ,CAAAA,CAAQ,OAAA,CAAQ,MAAA,CAAQ,EAAE,EA4Bj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D,CACT","file":"chunk-3UCLUFOI.js","sourcesContent":["import type {\n BreadcrumbItem,\n GenerateSitemapOptions,\n GenerateRobotsOptions,\n SitemapRoute,\n} from \"../types/index.js\";\n\n// ─── Sitemap ──────────────────────────────────────────────────\n\nfunction escapeXml(str: string): string {\n return str\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&apos;\");\n}\n\nfunction matchesExclude(path: string, pattern: string): boolean {\n if (pattern.endsWith(\"/*\")) {\n return path.startsWith(pattern.slice(0, -2) + \"/\") || path === pattern.slice(0, -2);\n }\n if (pattern.endsWith(\"*\")) {\n return path.startsWith(pattern.slice(0, -1));\n }\n if (pattern.startsWith(\"*\")) {\n return path.endsWith(pattern.slice(1));\n }\n return path === pattern;\n}\n\nexport function generateSitemap(options: GenerateSitemapOptions): string {\n const { routes, baseUrl, exclude = [], defaultChangefreq, defaultPriority } = options;\n const normalizedBase = baseUrl.replace(/\\/+$/, \"\");\n\n const normalized: SitemapRoute[] = routes.map((r) =>\n typeof r === \"string\" ? { path: r } : r\n );\n\n const filtered = normalized.filter(\n (route) => !exclude.some((pattern) => matchesExclude(route.path, pattern))\n );\n\n const urlEntries = filtered.map((route) => {\n const loc = route.path === \"/\" ? normalizedBase : `${normalizedBase}${route.path}`;\n const lines: string[] = [\n ` <url>`,\n ` <loc>${escapeXml(loc)}</loc>`,\n ` <lastmod>${route.lastmod ?? new Date().toISOString().split(\"T\")[0]}</lastmod>`,\n ];\n\n const changefreq = route.changefreq ?? defaultChangefreq;\n if (changefreq) lines.push(` <changefreq>${changefreq}</changefreq>`);\n\n const priority = route.priority ?? defaultPriority;\n if (priority !== undefined) lines.push(` <priority>${priority.toFixed(1)}</priority>`);\n\n lines.push(` </url>`);\n return lines.join(\"\\n\");\n });\n\n return [\n `<?xml version=\"1.0\" encoding=\"UTF-8\"?>`,\n `<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">`,\n ...urlEntries,\n `</urlset>`,\n ].join(\"\\n\");\n}\n\n// ─── Robots.txt ───────────────────────────────────────────────\n\nexport function generateRobots(options: GenerateRobotsOptions): string {\n const { rules = [], sitemap } = options;\n const normalizedRules = Array.isArray(rules) ? rules : [rules];\n const lines: string[] = [];\n\n for (const rule of normalizedRules) {\n const agents = rule.userAgent\n ? Array.isArray(rule.userAgent)\n ? rule.userAgent\n : [rule.userAgent]\n : [\"*\"];\n\n for (const agent of agents) {\n lines.push(`User-agent: ${agent}`);\n }\n\n const allows = rule.allow\n ? Array.isArray(rule.allow)\n ? rule.allow\n : [rule.allow]\n : [];\n for (const path of allows) lines.push(`Allow: ${path}`);\n\n const disallows = rule.disallow\n ? Array.isArray(rule.disallow)\n ? rule.disallow\n : [rule.disallow]\n : [];\n for (const path of disallows) lines.push(`Disallow: ${path}`);\n\n if (rule.crawlDelay !== undefined) lines.push(`Crawl-delay: ${rule.crawlDelay}`);\n\n lines.push(\"\");\n }\n\n const sitemaps = sitemap\n ? Array.isArray(sitemap)\n ? sitemap\n : [sitemap]\n : [];\n for (const sm of sitemaps) lines.push(`Sitemap: ${sm}`);\n\n return lines.join(\"\\n\").trim();\n}\n\n// ─── Auto Breadcrumb ──────────────────────────────────────────\n\nexport interface AutoBreadcrumbOptions {\n baseUrl?: string;\n labels?: Record<string, string>;\n formatLabel?: (segment: string) => string;\n}\n\nfunction defaultFormatLabel(segment: string): string {\n return segment\n .replace(/[-_]/g, \" \")\n .replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\nexport function autoBreadcrumb(\n currentPath: string,\n options: AutoBreadcrumbOptions = {}\n): BreadcrumbItem[] {\n const { baseUrl = \"\", labels = {}, formatLabel = defaultFormatLabel } = options;\n\n const segments = currentPath.split(\"/\").filter(Boolean);\n const items: BreadcrumbItem[] = [\n { name: labels[\"\"] ?? labels[\"/\"] ?? \"Home\", url: `${baseUrl}/` },\n ];\n\n let accPath = \"\";\n for (const segment of segments) {\n accPath += `/${segment}`;\n const name = labels[accPath] ?? labels[segment] ?? formatLabel(segment);\n items.push({ name, url: `${baseUrl}${accPath}` });\n }\n\n return items;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ 'use strict';var i="https://schema.org";function c(e){let r={"@context":i,"@type":"Organization",name:e.name,url:e.url};if(e.logo&&(r.logo=e.logo),e.description&&(r.description=e.description),e.sameAs?.length&&(r.sameAs=e.sameAs),e.contactPoint){let a={"@type":"ContactPoint"};e.contactPoint.telephone&&(a.telephone=e.contactPoint.telephone),e.contactPoint.contactType&&(a.contactType=e.contactPoint.contactType),e.contactPoint.email&&(a.email=e.contactPoint.email),e.contactPoint.areaServed&&(a.areaServed=e.contactPoint.areaServed),e.contactPoint.availableLanguage&&(a.availableLanguage=e.contactPoint.availableLanguage),r.contactPoint=a;}return r}function m(e){let r={"@context":i,"@type":"WebSite",name:e.name,url:e.url};return e.description&&(r.description=e.description),e.searchUrl&&(r.potentialAction={"@type":"SearchAction",target:{"@type":"EntryPoint",urlTemplate:`${e.searchUrl}?${e.searchQueryParam??"q"}={search_term_string}`},"query-input":"required name=search_term_string"}),r}function l(e){return {"@context":i,"@type":"BreadcrumbList",itemListElement:e.map((r,a)=>({"@type":"ListItem",position:a+1,name:r.name,item:r.url}))}}function d(e){let r={"@context":i,"@type":"Article",headline:e.headline,url:e.url};if(e.description&&(r.description=e.description),e.images?.length&&(r.image=e.images),e.datePublished&&(r.datePublished=e.datePublished),e.dateModified&&(r.dateModified=e.dateModified),e.section&&(r.articleSection=e.section),e.keywords?.length&&(r.keywords=e.keywords),e.author){let a=Array.isArray(e.author)?e.author:[e.author];r.author=a.map(o=>{let t={"@type":"Person",name:o.name};return o.url&&(t.url=o.url),t});}if(e.publisher){let a={"@type":"Organization",name:e.publisher.name};e.publisher.logo&&(a.logo={"@type":"ImageObject",url:e.publisher.logo}),r.publisher=a;}return r}function g(e){let r={"@context":i,"@type":"Product",name:e.name,url:e.url};if(e.description&&(r.description=e.description),e.images?.length&&(r.image=e.images),e.brand&&(r.brand={"@type":"Brand",name:e.brand}),e.sku&&(r.sku=e.sku),e.gtin&&(r.gtin=e.gtin),e.price!==void 0){let a={"@type":"Offer",price:e.price,priceCurrency:e.priceCurrency??"USD"};e.availability&&(a.availability=`https://schema.org/${e.availability}`),r.offers=a;}if(e.ratingValue!==void 0){let a={"@type":"AggregateRating",ratingValue:e.ratingValue};e.reviewCount!==void 0&&(a.reviewCount=e.reviewCount),r.aggregateRating=a;}return r}function f(e){return {"@context":i,"@type":"FAQPage",mainEntity:e.map(r=>({"@type":"Question",name:r.question,acceptedAnswer:{"@type":"Answer",text:r.answer}}))}}function h(e){let r=!!(e.sport??e.homeTeam??e.awayTeam),a={"@context":i,"@type":r?"SportsEvent":"Event",name:e.name,startDate:e.startDate};if(e.endDate&&(a.endDate=e.endDate),e.description&&(a.description=e.description),e.url&&(a.url=e.url),e.images?.length&&(a.image=e.images),e.eventStatus&&(a.eventStatus=`https://schema.org/${e.eventStatus}`),e.eventAttendanceMode&&(a.eventAttendanceMode=`https://schema.org/${e.eventAttendanceMode}`),e.location){let o=e.location;if(o.url&&!o.address)a.location={"@type":"VirtualLocation",name:o.name,url:o.url};else {let t={"@type":"Place",name:o.name};o.url&&(t.url=o.url),o.address&&(t.address=typeof o.address=="string"?o.address:{"@type":"PostalAddress",...o.address}),a.location=t;}}if(e.organizer){let o={"@type":"Organization",name:e.organizer.name};e.organizer.url&&(o.url=e.organizer.url),a.organizer=o;}if(e.performer){let t=(Array.isArray(e.performer)?e.performer:[e.performer]).map(n=>{let s={"@type":"Person",name:n.name};return n.url&&(s.url=n.url),s});a.performer=t.length===1?t[0]:t;}if(r){if(e.sport&&(a.sport=e.sport),e.homeTeam){let o={"@type":"SportsTeam",name:e.homeTeam.name};e.homeTeam.url&&(o.url=e.homeTeam.url),a.homeTeam=o;}if(e.awayTeam){let o={"@type":"SportsTeam",name:e.awayTeam.name};e.awayTeam.url&&(o.url=e.awayTeam.url),a.awayTeam=o;}}return a}function y(e){let r={"@context":i,"@type":"Person",name:e.name};if(e.url&&(r.url=e.url),e.image&&(r.image=e.image),e.jobTitle&&(r.jobTitle=e.jobTitle),e.description&&(r.description=e.description),e.email&&(r.email=e.email),e.telephone&&(r.telephone=e.telephone),e.birthDate&&(r.birthDate=e.birthDate),e.sameAs?.length&&(r.sameAs=e.sameAs),e.worksFor){let a={"@type":"Organization",name:e.worksFor.name};e.worksFor.url&&(a.url=e.worksFor.url),r.worksFor=a;}return e.address&&(r.address=typeof e.address=="string"?e.address:{"@type":"PostalAddress",...e.address}),r}function S(e){let r={"@context":i,"@type":"Recipe",name:e.name};if(e.description&&(r.description=e.description),e.images?.length&&(r.image=e.images),e.datePublished&&(r.datePublished=e.datePublished),e.prepTime&&(r.prepTime=e.prepTime),e.cookTime&&(r.cookTime=e.cookTime),e.totalTime&&(r.totalTime=e.totalTime),e.recipeYield!==void 0&&(r.recipeYield=String(e.recipeYield)),e.recipeCategory&&(r.recipeCategory=e.recipeCategory),e.recipeCuisine&&(r.recipeCuisine=e.recipeCuisine),e.recipeIngredient?.length&&(r.recipeIngredient=e.recipeIngredient),e.keywords?.length&&(r.keywords=e.keywords.join(", ")),e.author){let a={"@type":"Person",name:e.author.name};e.author.url&&(a.url=e.author.url),r.author=a;}if(e.recipeInstructions?.length&&(r.recipeInstructions=e.recipeInstructions.map(a=>{if(typeof a=="string")return {"@type":"HowToStep",text:a};let o={"@type":"HowToStep",text:a.text};return a.name&&(o.name=a.name),a.url&&(o.url=a.url),a.image&&(o.image=a.image),o})),e.nutrition&&Object.keys(e.nutrition).length&&(r.nutrition={"@type":"NutritionInformation",...e.nutrition}),e.ratingValue!==void 0){let a={"@type":"AggregateRating",ratingValue:e.ratingValue};e.reviewCount!==void 0&&(a.reviewCount=e.reviewCount),r.aggregateRating=a;}return r}function b(e){let r={"@context":i,"@type":"JobPosting",title:e.title,description:e.description,datePosted:e.datePosted};e.validThrough&&(r.validThrough=e.validThrough),e.url&&(r.url=e.url),e.experienceRequirements&&(r.experienceRequirements=e.experienceRequirements),e.educationRequirements&&(r.educationRequirements={"@type":"EducationalOccupationalCredential",credentialCategory:e.educationRequirements}),e.employmentType&&(r.employmentType=(Array.isArray(e.employmentType),e.employmentType)),e.skills&&(r.skills=Array.isArray(e.skills)?e.skills.join(", "):e.skills);let a={"@type":"Organization",name:e.hiringOrganization.name};if(e.hiringOrganization.sameAs&&(a.sameAs=e.hiringOrganization.sameAs),e.hiringOrganization.logo&&(a.logo=e.hiringOrganization.logo),r.hiringOrganization=a,e.remote&&(r.jobLocationType="TELECOMMUTE"),e.jobLocation&&(r.jobLocation={"@type":"Place",address:{"@type":"PostalAddress",...e.jobLocation}}),e.baseSalary){let{currency:o,value:t,unitText:n="YEAR"}=e.baseSalary,s={"@type":"MonetaryAmount",currency:o};typeof t=="number"?s.value=t:s.value={"@type":"QuantitativeValue",minValue:t.minValue,maxValue:t.maxValue,unitText:n},r.baseSalary=s;}return e.identifier&&(r.identifier={"@type":"PropertyValue",name:e.identifier.name,value:e.identifier.value}),r}function T(...e){return {"@context":i,"@type":"ItemList","@graph":e.map(({"@context":r,...a})=>a)}}
2
+ exports.a=c;exports.b=m;exports.c=l;exports.d=d;exports.e=g;exports.f=f;exports.g=h;exports.h=y;exports.i=S;exports.j=b;exports.k=T;//# sourceMappingURL=chunk-A62THBIS.cjs.map
3
+ //# sourceMappingURL=chunk-A62THBIS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schema/index.ts"],"names":["CONTEXT","createOrganizationSchema","input","schema","cp","createWebsiteSchema","createBreadcrumbSchema","items","item","index","createArticleSchema","authors","a","person","pub","createProductSchema","offer","rating","createFAQSchema","createEventSchema","isSports","loc","place","org","mapped","p","entry","t","createPersonSchema","createRecipeSchema","step","s","createJobPostingSchema","currency","value","unitText","monetaryAmount","composeSchemas","schemas","_ctx","rest"],"mappings":"aAcA,IAAMA,CAAAA,CAAU,oBAAA,CAIT,SAASC,CAAAA,CACdC,EACY,CAC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A,CAAM,UAAA,CAAW,KAC1B,CAAA,CAAA,CAGKC,CACT,CAQO,SAASkC,KAAkBC,CAAAA,CAAmC,CACnE,OAAO,CACL,WAAYtC,CAAAA,CACZ,OAAA,CAAS,UAAA,CACT,QAAA,CAAUsC,EAAQ,GAAA,CAAI,CAAC,CAAE,UAAA,CAAYC,EAAM,GAAGC,CAAK,CAAA,GAAMA,CAAI,CAC/D,CACF","file":"chunk-A62THBIS.cjs","sourcesContent":["import type {\n JSONLDBase,\n BreadcrumbItem,\n OrganizationSchemaInput,\n WebsiteSchemaInput,\n ArticleSchemaInput,\n ProductSchemaInput,\n FAQItem,\n EventSchemaInput,\n PersonSchemaInput,\n RecipeSchemaInput,\n JobPostingSchemaInput,\n} from \"../types/index.js\";\n\nconst CONTEXT = \"https://schema.org\";\n\n// ─── Organization ─────────────────────────────────────────────\n\nexport function createOrganizationSchema(\n input: OrganizationSchemaInput\n): JSONLDBase {\n const schema: JSONLDBase = {\n \"@context\": CONTEXT,\n \"@type\": \"Organization\",\n name: input.name,\n url: input.url,\n };\n\n if (input.logo) schema.logo = input.logo;\n if (input.description) schema.description = input.description;\n if (input.sameAs?.length) schema.sameAs = input.sameAs;\n\n if (input.contactPoint) {\n const cp: Record<string, unknown> = {\n \"@type\": \"ContactPoint\",\n };\n if (input.contactPoint.telephone)\n cp.telephone = input.contactPoint.telephone;\n if (input.contactPoint.contactType)\n cp.contactType = input.contactPoint.contactType;\n if (input.contactPoint.email) cp.email = input.contactPoint.email;\n if (input.contactPoint.areaServed)\n cp.areaServed = input.contactPoint.areaServed;\n if (input.contactPoint.availableLanguage)\n cp.availableLanguage = input.contactPoint.availableLanguage;\n schema.contactPoint = cp;\n }\n\n return schema;\n}\n\n// ─── Website ──────────────────────────────────────────────────\n\nexport function createWebsiteSchema(input: WebsiteSchemaInput): JSONLDBase {\n const schema: JSONLDBase = {\n \"@context\": CONTEXT,\n \"@type\": \"WebSite\",\n name: input.name,\n url: input.url,\n };\n\n if (input.description) schema.description = input.description;\n\n if (input.searchUrl) {\n schema.potentialAction = {\n \"@type\": \"SearchAction\",\n target: {\n \"@type\": \"EntryPoint\",\n urlTemplate: `${input.searchUrl}?${input.searchQueryParam ?? \"q\"}={search_term_string}`,\n },\n \"query-input\": \"required name=search_term_string\",\n };\n }\n\n return schema;\n}\n\n// ─── Breadcrumb ───────────────────────────────────────────────\n\nexport function createBreadcrumbSchema(items: BreadcrumbItem[]): JSONLDBase {\n return {\n \"@context\": CONTEXT,\n \"@type\": \"BreadcrumbList\",\n itemListElement: items.map((item, index) => ({\n \"@type\": \"ListItem\",\n position: index + 1,\n name: item.name,\n item: item.url,\n })),\n };\n}\n\n// ─── Article ──────────────────────────────────────────────────\n\nexport function createArticleSchema(input: ArticleSchemaInput): JSONLDBase {\n const schema: JSONLDBase = {\n \"@context\": CONTEXT,\n \"@type\": \"Article\",\n headline: input.headline,\n url: input.url,\n };\n\n if (input.description) schema.description = input.description;\n if (input.images?.length) schema.image = input.images;\n if (input.datePublished) schema.datePublished = input.datePublished;\n if (input.dateModified) schema.dateModified = input.dateModified;\n if (input.section) schema.articleSection = input.section;\n if (input.keywords?.length) schema.keywords = input.keywords;\n\n if (input.author) {\n const authors = Array.isArray(input.author)\n ? input.author\n : [input.author];\n schema.author = authors.map((a) => {\n const person: Record<string, string> = {\n \"@type\": \"Person\",\n name: a.name,\n };\n if (a.url) person.url = a.url;\n return person;\n });\n }\n\n if (input.publisher) {\n const pub: Record<string, unknown> = {\n \"@type\": \"Organization\",\n name: input.publisher.name,\n };\n if (input.publisher.logo) {\n pub.logo = {\n \"@type\": \"ImageObject\",\n url: input.publisher.logo,\n };\n }\n schema.publisher = pub;\n }\n\n return schema;\n}\n\n// ─── Product ──────────────────────────────────────────────────\n\nexport function createProductSchema(input: ProductSchemaInput): JSONLDBase {\n const schema: JSONLDBase = {\n \"@context\": CONTEXT,\n \"@type\": \"Product\",\n name: input.name,\n url: input.url,\n };\n\n if (input.description) schema.description = input.description;\n if (input.images?.length) schema.image = input.images;\n if (input.brand) {\n schema.brand = { \"@type\": \"Brand\", name: input.brand };\n }\n if (input.sku) schema.sku = input.sku;\n if (input.gtin) schema.gtin = input.gtin;\n\n if (input.price !== undefined) {\n const offer: Record<string, unknown> = {\n \"@type\": \"Offer\",\n price: input.price,\n priceCurrency: input.priceCurrency ?? \"USD\",\n };\n if (input.availability) {\n offer.availability = `https://schema.org/${input.availability}`;\n }\n schema.offers = offer;\n }\n\n if (input.ratingValue !== undefined) {\n const rating: Record<string, unknown> = {\n \"@type\": \"AggregateRating\",\n ratingValue: input.ratingValue,\n };\n if (input.reviewCount !== undefined) rating.reviewCount = input.reviewCount;\n schema.aggregateRating = rating;\n }\n\n return schema;\n}\n\n// ─── FAQ ──────────────────────────────────────────────────────\n\nexport function createFAQSchema(items: FAQItem[]): JSONLDBase {\n return {\n \"@context\": CONTEXT,\n \"@type\": \"FAQPage\",\n mainEntity: items.map((item) => ({\n \"@type\": \"Question\",\n name: item.question,\n acceptedAnswer: {\n \"@type\": \"Answer\",\n text: item.answer,\n },\n })),\n };\n}\n\n// ─── Event / SportsEvent ─────────────────────────────────────\n\nexport function createEventSchema(input: EventSchemaInput): JSONLDBase {\n const isSports = !!(input.sport ?? input.homeTeam ?? input.awayTeam);\n\n const schema: JSONLDBase = {\n \"@context\": CONTEXT,\n \"@type\": isSports ? \"SportsEvent\" : \"Event\",\n name: input.name,\n startDate: input.startDate,\n };\n\n if (input.endDate) schema.endDate = input.endDate;\n if (input.description) schema.description = input.description;\n if (input.url) schema.url = input.url;\n if (input.images?.length) schema.image = input.images;\n\n if (input.eventStatus) {\n schema.eventStatus = `https://schema.org/${input.eventStatus}`;\n }\n if (input.eventAttendanceMode) {\n schema.eventAttendanceMode = `https://schema.org/${input.eventAttendanceMode}`;\n }\n\n if (input.location) {\n const loc = input.location;\n if (loc.url && !loc.address) {\n schema.location = {\n \"@type\": \"VirtualLocation\",\n name: loc.name,\n url: loc.url,\n };\n } else {\n const place: Record<string, unknown> = {\n \"@type\": \"Place\",\n name: loc.name,\n };\n if (loc.url) place.url = loc.url;\n if (loc.address) {\n place.address =\n typeof loc.address === \"string\"\n ? loc.address\n : { \"@type\": \"PostalAddress\", ...loc.address };\n }\n schema.location = place;\n }\n }\n\n if (input.organizer) {\n const org: Record<string, string> = {\n \"@type\": \"Organization\",\n name: input.organizer.name,\n };\n if (input.organizer.url) org.url = input.organizer.url;\n schema.organizer = org;\n }\n\n if (input.performer) {\n const performers = Array.isArray(input.performer)\n ? input.performer\n : [input.performer];\n const mapped = performers.map((p) => {\n const entry: Record<string, string> = { \"@type\": \"Person\", name: p.name };\n if (p.url) entry.url = p.url;\n return entry;\n });\n schema.performer = mapped.length === 1 ? mapped[0] : mapped;\n }\n\n if (isSports) {\n if (input.sport) schema.sport = input.sport;\n if (input.homeTeam) {\n const t: Record<string, string> = {\n \"@type\": \"SportsTeam\",\n name: input.homeTeam.name,\n };\n if (input.homeTeam.url) t.url = input.homeTeam.url;\n schema.homeTeam = t;\n }\n if (input.awayTeam) {\n const t: Record<string, string> = {\n \"@type\": \"SportsTeam\",\n name: input.awayTeam.name,\n };\n if (input.awayTeam.url) t.url = input.awayTeam.url;\n schema.awayTeam = t;\n }\n }\n\n return schema;\n}\n\n// ─── Person ───────────────────────────────────────────────────\n\nexport function createPersonSchema(input: PersonSchemaInput): JSONLDBase {\n const schema: JSONLDBase = {\n \"@context\": CONTEXT,\n \"@type\": \"Person\",\n name: input.name,\n };\n\n if (input.url) schema.url = input.url;\n if (input.image) schema.image = input.image;\n if (input.jobTitle) schema.jobTitle = input.jobTitle;\n if (input.description) schema.description = input.description;\n if (input.email) schema.email = input.email;\n if (input.telephone) schema.telephone = input.telephone;\n if (input.birthDate) schema.birthDate = input.birthDate;\n if (input.sameAs?.length) schema.sameAs = input.sameAs;\n\n if (input.worksFor) {\n const org: Record<string, string> = { \"@type\": \"Organization\", name: input.worksFor.name };\n if (input.worksFor.url) org.url = input.worksFor.url;\n schema.worksFor = org;\n }\n\n if (input.address) {\n schema.address =\n typeof input.address === \"string\"\n ? input.address\n : { \"@type\": \"PostalAddress\", ...input.address };\n }\n\n return schema;\n}\n\n// ─── Recipe ───────────────────────────────────────────────────\n\nexport function createRecipeSchema(input: RecipeSchemaInput): JSONLDBase {\n const schema: JSONLDBase = {\n \"@context\": CONTEXT,\n \"@type\": \"Recipe\",\n name: input.name,\n };\n\n if (input.description) schema.description = input.description;\n if (input.images?.length) schema.image = input.images;\n if (input.datePublished) schema.datePublished = input.datePublished;\n if (input.prepTime) schema.prepTime = input.prepTime;\n if (input.cookTime) schema.cookTime = input.cookTime;\n if (input.totalTime) schema.totalTime = input.totalTime;\n if (input.recipeYield !== undefined) schema.recipeYield = String(input.recipeYield);\n if (input.recipeCategory) schema.recipeCategory = input.recipeCategory;\n if (input.recipeCuisine) schema.recipeCuisine = input.recipeCuisine;\n if (input.recipeIngredient?.length) schema.recipeIngredient = input.recipeIngredient;\n if (input.keywords?.length) schema.keywords = input.keywords.join(\", \");\n\n if (input.author) {\n const person: Record<string, string> = { \"@type\": \"Person\", name: input.author.name };\n if (input.author.url) person.url = input.author.url;\n schema.author = person;\n }\n\n if (input.recipeInstructions?.length) {\n schema.recipeInstructions = input.recipeInstructions.map((step) => {\n if (typeof step === \"string\") {\n return { \"@type\": \"HowToStep\", text: step };\n }\n const s: Record<string, unknown> = { \"@type\": \"HowToStep\", text: step.text };\n if (step.name) s.name = step.name;\n if (step.url) s.url = step.url;\n if (step.image) s.image = step.image;\n return s;\n });\n }\n\n if (input.nutrition && Object.keys(input.nutrition).length) {\n schema.nutrition = { \"@type\": \"NutritionInformation\", ...input.nutrition };\n }\n\n if (input.ratingValue !== undefined) {\n const rating: Record<string, unknown> = {\n \"@type\": \"AggregateRating\",\n ratingValue: input.ratingValue,\n };\n if (input.reviewCount !== undefined) rating.reviewCount = input.reviewCount;\n schema.aggregateRating = rating;\n }\n\n return schema;\n}\n\n// ─── JobPosting ───────────────────────────────────────────────\n\nexport function createJobPostingSchema(input: JobPostingSchemaInput): JSONLDBase {\n const schema: JSONLDBase = {\n \"@context\": CONTEXT,\n \"@type\": \"JobPosting\",\n title: input.title,\n description: input.description,\n datePosted: input.datePosted,\n };\n\n if (input.validThrough) schema.validThrough = input.validThrough;\n if (input.url) schema.url = input.url;\n if (input.experienceRequirements) schema.experienceRequirements = input.experienceRequirements;\n if (input.educationRequirements) {\n schema.educationRequirements = {\n \"@type\": \"EducationalOccupationalCredential\",\n credentialCategory: input.educationRequirements,\n };\n }\n\n if (input.employmentType) {\n schema.employmentType = Array.isArray(input.employmentType)\n ? input.employmentType\n : input.employmentType;\n }\n\n if (input.skills) {\n schema.skills = Array.isArray(input.skills) ? input.skills.join(\", \") : input.skills;\n }\n\n const org: Record<string, unknown> = {\n \"@type\": \"Organization\",\n name: input.hiringOrganization.name,\n };\n if (input.hiringOrganization.sameAs) org.sameAs = input.hiringOrganization.sameAs;\n if (input.hiringOrganization.logo) org.logo = input.hiringOrganization.logo;\n schema.hiringOrganization = org;\n\n if (input.remote) {\n schema.jobLocationType = \"TELECOMMUTE\";\n }\n\n if (input.jobLocation) {\n schema.jobLocation = {\n \"@type\": \"Place\",\n address: { \"@type\": \"PostalAddress\", ...input.jobLocation },\n };\n }\n\n if (input.baseSalary) {\n const { currency, value, unitText = \"YEAR\" } = input.baseSalary;\n const monetaryAmount: Record<string, unknown> = {\n \"@type\": \"MonetaryAmount\",\n currency,\n };\n if (typeof value === \"number\") {\n monetaryAmount.value = value;\n } else {\n monetaryAmount.value = {\n \"@type\": \"QuantitativeValue\",\n minValue: value.minValue,\n maxValue: value.maxValue,\n unitText,\n };\n }\n schema.baseSalary = monetaryAmount;\n }\n\n if (input.identifier) {\n schema.identifier = {\n \"@type\": \"PropertyValue\",\n name: input.identifier.name,\n value: input.identifier.value,\n };\n }\n\n return schema;\n}\n\n// ─── Schema composition ───────────────────────────────────────\n\n/**\n * Compose multiple JSON-LD schemas into a single @graph array.\n * Useful for embedding multiple structured data blocks in one script tag.\n */\nexport function composeSchemas(...schemas: JSONLDBase[]): JSONLDBase {\n return {\n \"@context\": CONTEXT,\n \"@type\": \"ItemList\",\n \"@graph\": schemas.map(({ \"@context\": _ctx, ...rest }) => rest),\n };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';function f(e){let t=JSON.stringify(e,(n,r)=>{if(r!=null)return r});return t?t.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"):"{}"}function d(e){let t={};for(let n of Object.keys(e)){let r=e[n];r!=null&&r!==""&&(t[n]=r);}return t}function l(e,t){let n={...e},r=t,u=e;for(let i of Object.keys(r)){let s=r[i],a=u[i];s!==void 0&&(s!==null&&typeof s=="object"&&!Array.isArray(s)&&a!==null&&typeof a=="object"&&!Array.isArray(a)?n[i]=l(a,s):n[i]=s);}return n}function o(e){let t=e.trim();return t==="/"||t===""?t:t.replace(/\/+$/,"")}function g(e,t){let n=o(e);if(!t||t==="/")return n;let r=t.startsWith("/")?t:`/${t}`;return n+o(r)}function h(e={}){return p(e)}function y(e,t){let n=l(e,t);return t.alternates!==void 0&&(n.alternates=t.alternates),t.additionalMetaTags!==void 0&&(n.additionalMetaTags=t.additionalMetaTags),t.additionalLinkTags!==void 0&&(n.additionalLinkTags=t.additionalLinkTags),t.jsonLd!==void 0&&(n.jsonLd=t.jsonLd),p(n)}function p(e){let t={...e};return t.title&&(t.title=t.title.trim()),t.description&&(t.description=t.description.trim()),t.canonical&&(t.canonical=o(t.canonical)),t}function x(e,t){if(!e)return "";let n=e.trim();return t?t.replace(/%s/g,n):n}function w(e,t){if(!e)return "";let n=e.trim();return !t||n.length<=t?n:n.slice(0,t).trimEnd()+"\u2026"}function C(e,t){let n=o(e);if(!t||t==="/")return n;let r=t.startsWith("/")?t:`/${t}`;return n+o(r)}function k(e){if(!e)return "";let t=[];return e.index===false?t.push("noindex"):e.index===true&&t.push("index"),e.follow===false?t.push("nofollow"):e.follow===true&&t.push("follow"),e.noarchive&&t.push("noarchive"),e.nosnippet&&t.push("nosnippet"),e.noimageindex&&t.push("noimageindex"),e.notranslate&&t.push("notranslate"),e.maxSnippet!==void 0&&t.push(`max-snippet:${e.maxSnippet}`),e.maxImagePreview&&t.push(`max-image-preview:${e.maxImagePreview}`),e.maxVideoPreview!==void 0&&t.push(`max-video-preview:${e.maxVideoPreview}`),t.join(", ")}function O(){return {index:false,follow:false}}function b(){return {index:false,follow:true}}function T(e){if(!e)return [];let t=[],n=[["title","og:title"],["description","og:description"],["url","og:url"],["siteName","og:site_name"],["type","og:type"],["locale","og:locale"]];for(let[r,u]of n){let i=e[r];typeof i=="string"&&i.trim()&&t.push({property:u,content:i.trim()});}if(e.images)for(let r of e.images)r.url&&(t.push({property:"og:image",content:r.url}),r.alt&&t.push({property:"og:image:alt",content:r.alt}),r.width&&t.push({property:"og:image:width",content:String(r.width)}),r.height&&t.push({property:"og:image:height",content:String(r.height)}),r.type&&t.push({property:"og:image:type",content:r.type}));return t}function S(e){if(!e)return [];let t=[];return e.card&&t.push({name:"twitter:card",content:e.card}),e.site&&t.push({name:"twitter:site",content:e.site}),e.creator&&t.push({name:"twitter:creator",content:e.creator}),e.title&&t.push({name:"twitter:title",content:e.title}),e.description&&t.push({name:"twitter:description",content:e.description}),e.image&&t.push({name:"twitter:image",content:e.image}),e.imageAlt&&t.push({name:"twitter:image:alt",content:e.imageAlt}),t}function A(e){return !e||e.length===0?[]:e.map(t=>({rel:"alternate",hreflang:t.hreflang,href:o(t.href)}))}exports.a=f;exports.b=d;exports.c=l;exports.d=o;exports.e=g;exports.f=h;exports.g=y;exports.h=p;exports.i=x;exports.j=w;exports.k=C;exports.l=k;exports.m=O;exports.n=b;exports.o=T;exports.p=S;exports.q=A;//# sourceMappingURL=chunk-FKDMHECL.cjs.map
2
+ //# sourceMappingURL=chunk-FKDMHECL.cjs.map