load("@rules_closure//closure:defs.bzl", "closure_js_library")

package(default_visibility = ["//visibility:public"])

licenses(["notice"])

closure_js_library(
    name = "useragent",
    exports = [
        ":browser",
        ":device",
        ":engine",
        ":extra",
        ":platform",
        ":verifier",
    ],
)

closure_js_library(
    name = "browser",
    srcs = ["browser.js"],
    lenient = True,
    deps = [
        ":util",
        "//third_party/closure/goog/asserts",
        "//third_party/closure/goog/labs/useragent/highentropy:highentropydata",
        "//third_party/closure/goog/labs/useragent/highentropy:highentropyvalue",
        "//third_party/closure/goog/string:internal",
    ],
)

closure_js_library(
    name = "device",
    srcs = ["device.js"],
    lenient = True,
    deps = [":util"],
)

closure_js_library(
    name = "engine",
    srcs = ["engine.js"],
    lenient = True,
    deps = [
        ":util",
        "//third_party/closure/goog/array",
        "//third_party/closure/goog/string:internal",
    ],
)

closure_js_library(
    name = "extra",
    srcs = ["extra.js"],
    lenient = True,
    deps = [
        ":browser",
        ":platform",
    ],
)

closure_js_library(
    name = "platform",
    srcs = ["platform.js"],
    lenient = True,
    deps = [
        ":util",
        "//third_party/closure/goog/asserts",
        "//third_party/closure/goog/labs/useragent/highentropy:highentropydata",
        "//third_party/closure/goog/labs/useragent/highentropy:highentropyvalue",
        "//third_party/closure/goog/string:internal",
    ],
)

closure_js_library(
    name = "util",
    srcs = [
        "useragent.js",
        "util.js",
    ],
    lenient = True,
    deps = [
        "//third_party/closure/goog/flags",
        "//third_party/closure/goog/string:internal",
    ],
)

closure_js_library(
    name = "verifier",
    srcs = ["verifier.js"],
    lenient = True,
)
