import importlib.metadata
import pathlib

import anywidget
import traitlets

try:
    __version__ = importlib.metadata.version("altgosling")
except importlib.metadata.PackageNotFoundError:
    __version__ = "unknown"


class AltGoslingWidget(anywidget.AnyWidget):
    _esm = pathlib.Path(__file__).parent / "static" / "widget.js"
    spec = traitlets.Unicode().tag(sync=True)
    altSpec = traitlets.Unicode().tag(sync=True)
