<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/main.css">
		<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/markdown.css">
		<script type="importmap">
		{
			"imports": {
				"api":        "/js/{{ .VERSION }}/api.mjs",
				"sync":       "/js/{{ .VERSION }}/sync.mjs",
				"checklist":  "/js/{{ .VERSION }}/checklist.mjs",
				"node_store": "/js/{{ .VERSION }}/node_store.mjs",
				"node":       "/js/{{ .VERSION }}/page_node.mjs",
				"sidebar":    "/js/{{ .VERSION }}/sidebar.mjs"
			}
		}
		</script>
		<script>
			globalThis._VERSION = "{{ .VERSION }}"

			const token = localStorage.getItem('token')
			if (token && navigator.serviceWorker)
				navigator.serviceWorker.register('/service_worker.js', { type: 'module' })
		</script>
		<script type="module" defer>
			import { MessageBus } from '/js/{{ .VERSION }}/mbus.mjs'
			globalThis._mbus = new MessageBus()
		</script>
	</head>
	<body>
		<div id="app">{{ block "page" . }}{{ end }}</div>
		<div id="op"></div>
	</body>
</html>
