import{isTruthy as p}from"../../../shared/jsUtils";function i(t){const{name:e,property:n,content:r}=t;if(e&&n)return{name:e,property:n,content:r};if(e)return{name:e,content:r};if(n)return{property:n,content:r}}function c(t){const e=[];if(t.title&&(e.push(i({name:"title",content:t.title})),e.push(i({property:"og:title",content:t.title})),e.push(i({name:"twitter:title",property:"twitter:title",content:t.title}))),t.description&&(e.push(i({name:"description",content:t.description})),e.push(i({property:"og:description",content:t.description})),e.push(i({name:"twitter:description",property:"twitter:description",content:t.description}))),t.image&&(e.push(i({name:"image",content:t.image})),e.push(i({property:"og:image",content:t.image})),e.push(i({name:"twitter:image",property:"twitter:image",content:t.image}))),t.keywords&&e.push(i({name:"keywords",content:Array.isArray(t.keywords)?t.keywords.join(", "):t.keywords})),t.meta)for(const{name:n,content:r}of t.meta)n.includes("og:")?e.push(i({property:n,content:r})):e.push(i({name:n,content:r}));return e.filter(p)}export{c as getMetaTagsAttributes};
