"use strict"; Vue.component('tf-message', { props: ['message', 'messages', 'votes'], data: function() { return { showRaw: false } }, computed: { content_json: function() { try { return JSON.parse(this.message.content); } catch { return undefined; } }, }, methods: { markdown: function(md) { var reader = new commonmark.Parser({safe: true}); var writer = new commonmark.HtmlRenderer(); return writer.render(reader.parse(md)); }, }, template: `

{{new Date(message.timestamp)}}
more_vert View Raw View Message
{{message.content}}
{{content_json.name || 'tildefriends-app'}}
{{content_json.following ? '==>' : '=/=>'}}
{{message.content}}
{{vote + (votes[message.id][vote].length > 1 ? ' (' + votes[message.id][vote].length + ')' : '')}}
`, });