import { r as It, c as ot, h as yi, H as Nt } from "./reactcomponent-44b70bf6.mjs";
import { c as pt, a as bt } from "./_commonjsHelpers-ba3f0406-b96e6d6a.mjs";
import "react";
import "react-dom";
var Zi = pt(function(i, r) {
  ((d, g) => {
    function D(a) {
      for (var u = {}, l = 0; l < a.length; l++)
        u[a[l].toUpperCase()] = a[l];
      return u;
    }
    var B = 500, Ni = "user-agent", A = "", Wi = "?", pi = "function", Z = "undefined", q = "object", fi = "string", S = "browser", U = "cpu", C = "device", z = "engine", x = "os", J = "result", s = "name", t = "type", o = "vendor", n = "version", E = "architecture", ni = "major", e = "model", ri = "console", h = "mobile", N = "tablet", f = "smarttv", _ = "wearable", ji = "xr", ai = "embedded", ci = "inapp", Ai = "brands", G = "formFactors", Si = "fullVersionList", X = "platform", Ei = "platformVersion", bi = "bitness", W = "sec-ch-ua", at = W + "-full-version-list", ct = W + "-arch", ut = W + "-" + bi, Mt = W + "-form-factors", lt = W + "-" + h, dt = W + "-" + e, Hi = W + "-" + X, ht = Hi + "-version", Vi = [Ai, Si, h, e, X, Ei, E, G, bi], Oi = "Amazon", $ = "Apple", Ki = "ASUS", Bi = "BlackBerry", F = "Google", Gi = "Huawei", Pi = "Microsoft", xi = "Motorola", zi = "Nvidia", Fi = "OnePlus", vi = "OPPO", ui = "Samsung", Mi = "Sony", ki = "Xiaomi", Li = "Zebra", qi = "Chromium", H = "Chromecast", li = "Firefox", v = "Opera", Ci = "Facebook", ii = "Mobile ", di = " Browser", _i = "Windows", Ji = typeof d !== Z, P = Ji && d.navigator ? d.navigator : g, V = P && P.userAgentData ? P.userAgentData : g, Ui = function(a, u) {
      if (typeof a === q && 0 < a.length) {
        for (var l in a)
          if (Q(a[l]) == Q(u))
            return !0;
        return !1;
      }
      return !!ti(a) && Q(u).indexOf(Q(a)) !== -1;
    }, Di = function(a, u) {
      for (var l in a)
        return /^(browser|cpu|device|engine|os)$/.test(l) || !!u && Di(a[l]);
    }, ti = function(a) {
      return typeof a === fi;
    }, Qi = function(a) {
      if (!a)
        return g;
      for (var u, l = [], y = ei(/\\?\"/g, a).split(","), M = 0; M < y.length; M++)
        -1 < y[M].indexOf(";") ? (u = gi(y[M]).split(";v="), l[M] = { brand: u[0], version: u[1] }) : l[M] = gi(y[M]);
      return l;
    }, Q = function(a) {
      return ti(a) ? a.toLowerCase() : a;
    }, Yi = function(a) {
      return ti(a) ? ei(/[^\d\.]/g, a).split(".")[0] : g;
    }, Y = function(a) {
      for (var u in a)
        u = a[u], typeof u == q && u.length == 2 ? this[u[0]] = u[1] : this[u] = g;
      return this;
    }, ei = function(a, u) {
      return ti(u) ? u.replace(a, A) : u;
    }, hi = function(a) {
      return ei(/\\?\"/g, a);
    }, gi = function(a, u) {
      if (ti(a))
        return a = ei(/^\s\s*/, a), typeof u === Z ? a : a.substring(0, B);
    }, Ri = function(a, u) {
      if (a && u)
        for (var l, y, M, w, p, b = 0; b < u.length && !w; ) {
          for (var I = u[b], O = u[b + 1], m = l = 0; m < I.length && !w && I[m]; )
            if (w = I[m++].exec(a))
              for (y = 0; y < O.length; y++)
                p = w[++l], typeof (M = O[y]) === q && 0 < M.length ? M.length === 2 ? typeof M[1] == pi ? this[M[0]] = M[1].call(this, p) : this[M[0]] = M[1] : M.length === 3 ? typeof M[1] !== pi || M[1].exec && M[1].test ? this[M[0]] = p ? p.replace(M[1], M[2]) : g : this[M[0]] = p ? M[1].call(this, p, M[2]) : g : M.length === 4 && (this[M[0]] = p ? M[3].call(this, p.replace(M[1], M[2])) : g) : this[M] = p || g;
          b += 2;
        }
    }, K = function(a, u) {
      for (var l in u)
        if (typeof u[l] === q && 0 < u[l].length) {
          for (var y = 0; y < u[l].length; y++)
            if (Ui(u[l][y], a))
              return l === Wi ? g : l;
        } else if (Ui(u[l], a))
          return l === Wi ? g : l;
      return u.hasOwnProperty("*") ? u["*"] : a;
    }, Xi = { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", 8.1: "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" }, $i = { embedded: "Automotive", mobile: "Mobile", tablet: ["Tablet", "EInk"], smarttv: "TV", wearable: "Watch", xr: ["VR", "XR"], "?": ["Desktop", "Unknown"], "*": g }, it = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [n, [s, ii + "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [n, [s, "Edge"]], [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i], [s, n], [/opios[\/ ]+([\w\.]+)/i], [n, [s, v + " Mini"]], [/\bop(?:rg)?x\/([\w\.]+)/i], [n, [s, v + " GX"]], [/\bopr\/([\w\.]+)/i], [n, [s, v]], [/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i], [n, [s, "Baidu"]], [/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i], [n, [s, "Maxthon"]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i, /(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i, /(heytap|ovi|115|surf)browser\/([\d\.]+)/i, /(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i], [s, n], [/quark(?:pc)?\/([-\w\.]+)/i], [n, [s, "Quark"]], [/\bddg\/([\w\.]+)/i], [n, [s, "DuckDuckGo"]], [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i], [n, [s, "UCBrowser"]], [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i, /micromessenger\/([\w\.]+)/i], [n, [s, "WeChat"]], [/konqueror\/([\w\.]+)/i], [n, [s, "Konqueror"]], [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i], [n, [s, "IE"]], [/ya(?:search)?browser\/([\w\.]+)/i], [n, [s, "Yandex"]], [/slbrowser\/([\w\.]+)/i], [n, [s, "Smart Lenovo" + di]], [/(avast|avg)\/([\w\.]+)/i], [[s, /(.+)/, "$1 Secure" + di], n], [/\bfocus\/([\w\.]+)/i], [n, [s, li + " Focus"]], [/\bopt\/([\w\.]+)/i], [n, [s, v + " Touch"]], [/coc_coc\w+\/([\w\.]+)/i], [n, [s, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [n, [s, "Dolphin"]], [/coast\/([\w\.]+)/i], [n, [s, v + " Coast"]], [/miuibrowser\/([\w\.]+)/i], [n, [s, "MIUI" + di]], [/fxios\/([\w\.-]+)/i], [n, [s, ii + li]], [/\bqihoobrowser\/?([\w\.]*)/i], [n, [s, "360"]], [/\b(qq)\/([\w\.]+)/i], [[s, /(.+)/, "$1Browser"], n], [/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i], [[s, /(.+)/, "$1" + di], n], [/samsungbrowser\/([\w\.]+)/i], [n, [s, ui + " Internet"]], [/metasr[\/ ]?([\d\.]+)/i], [n, [s, "Sogou Explorer"]], [/(sogou)mo\w+\/([\d\.]+)/i], [[s, "Sogou Mobile"], n], [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i], [s, n], [/(lbbrowser|rekonq)/i], [s], [/ome\/([\w\.]+) \w* ?(iron) saf/i, /ome\/([\w\.]+).+qihu (360)[es]e/i], [n, s], [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i], [[s, Ci], n, [t, ci]], [/(Klarna)\/([\w\.]+)/i, /(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /(daum)apps[\/ ]([\w\.]+)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(alipay)client\/([\w\.]+)/i, /(twitter)(?:and| f.+e\/([\w\.]+))/i, /(instagram|snapchat)[\/ ]([-\w\.]+)/i], [s, n, [t, ci]], [/\bgsa\/([\w\.]+) .*safari\//i], [n, [s, "GSA"], [t, ci]], [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i], [n, [s, "TikTok"], [t, ci]], [/\[(linkedin)app\]/i], [s, [t, ci]], [/(chromium)[\/ ]([-\w\.]+)/i], [s, n], [/headlesschrome(?:\/([\w\.]+)| )/i], [n, [s, "Chrome Headless"]], [/ wv\).+(chrome)\/([\w\.]+)/i], [[s, "Chrome WebView"], n], [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i], [n, [s, "Android" + di]], [/chrome\/([\w\.]+) mobile/i], [n, [s, ii + "Chrome"]], [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i], [s, n], [/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i], [n, [s, ii + "Safari"]], [/iphone .*mobile(?:\/\w+ | ?)safari/i], [[s, ii + "Safari"]], [/version\/([\w\.\,]+) .*(safari)/i], [n, s], [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i], [s, [n, "1"]], [/(webkit|khtml)\/([\w\.]+)/i], [s, n], [/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i], [[s, ii + li], n], [/(navigator|netscape\d?)\/([-\w\.]+)/i], [[s, "Netscape"], n], [/(wolvic|librewolf)\/([\w\.]+)/i], [s, n], [/mobile vr; rv:([\w\.]+)\).+firefox/i], [n, [s, li + " Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /\b(links) \(([\w\.]+)/i], [s, [n, /_/g, "."]], [/(cobalt)\/([\w\.]+)/i], [s, [n, /[^\d\.]+./, A]]], cpu: [[/\b((amd|x|x86[-_]?|wow|win)64)\b/i], [[E, "amd64"]], [/(ia32(?=;))/i, /\b((i[346]|x)86)(pc)?\b/i], [[E, "ia32"]], [/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i], [[E, "arm64"]], [/\b(arm(v[67])?ht?n?[fl]p?)\b/i], [[E, "armhf"]], [/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i], [[E, "arm"]], [/((ppc|powerpc)(64)?)( mac|;|\))/i], [[E, /ower/, A, Q]], [/ sun4\w[;\)]/i], [[E, "sparc"]], [/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i], [[E, Q]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i], [e, [o, ui], [t, N]], [/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]((?!sm-[lr])[-\w]+)/i, /sec-(sgh\w+)/i], [e, [o, ui], [t, h]], [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i], [e, [o, $], [t, h]], [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [e, [o, $], [t, N]], [/(macintosh);/i], [e, [o, $]], [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i], [e, [o, "Sharp"], [t, h]], [/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i], [e, [o, "Honor"], [t, N]], [/honor([-\w ]+)[;\)]/i], [e, [o, "Honor"], [t, h]], [/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i], [e, [o, Gi], [t, N]], [/(?:huawei)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i], [e, [o, Gi], [t, h]], [/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i, /\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i], [[e, /_/g, " "], [o, ki], [t, N]], [/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i, / ([\w ]+) miui\/v?\d/i], [[e, /_/g, " "], [o, ki], [t, h]], [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i], [e, [o, vi], [t, h]], [/\b(opd2(\d{3}a?))(?: bui|\))/i], [e, [o, K, { OnePlus: ["304", "403", "203"], "*": vi }], [t, N]], [/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i], [e, [o, "BLU"], [t, h]], [/; vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i], [e, [o, "Vivo"], [t, h]], [/\b(rmx[1-3]\d{3})(?: bui|;|\))/i], [e, [o, "Realme"], [t, h]], [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i], [e, [o, xi], [t, h]], [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], [e, [o, xi], [t, N]], [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i], [e, [o, "LG"], [t, N]], [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch))(\w+)/i, /\blg-?([\d\w]+) bui/i], [e, [o, "LG"], [t, h]], [/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i, /lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i], [e, [o, "Lenovo"], [t, N]], [/(nokia) (t[12][01])/i], [o, e, [t, N]], [/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i, /nokia[-_ ]?(([-\w\. ]*))/i], [[e, /_/g, " "], [t, h], [o, "Nokia"]], [/(pixel (c|tablet))\b/i], [e, [o, F], [t, N]], [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i], [e, [o, F], [t, h]], [/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [e, [o, Mi], [t, h]], [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], [[e, "Xperia Tablet"], [o, Mi], [t, N]], [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i], [e, [o, Fi], [t, h]], [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i], [e, [o, Oi], [t, N]], [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i], [[e, /(.+)/g, "Fire Phone $1"], [o, Oi], [t, h]], [/(playbook);[-\w\),; ]+(rim)/i], [e, o, [t, N]], [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i], [e, [o, Bi], [t, h]], [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i], [e, [o, Ki], [t, N]], [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], [e, [o, Ki], [t, h]], [/(nexus 9)/i], [e, [o, "HTC"], [t, N]], [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i], [o, [e, /_/g, " "], [t, h]], [/tcl (xess p17aa)/i, /droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i], [e, [o, "TCL"], [t, N]], [/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i], [e, [o, "TCL"], [t, h]], [/(itel) ((\w+))/i], [[o, Q], e, [t, K, { tablet: ["p10001l", "w7001"], "*": "mobile" }]], [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i], [e, [o, "Acer"], [t, N]], [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i], [e, [o, "Meizu"], [t, h]], [/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i], [e, [o, "Ulefone"], [t, h]], [/; (energy ?\w+)(?: bui|\))/i, /; energizer ([\w ]+)(?: bui|\))/i], [e, [o, "Energizer"], [t, h]], [/; cat (b35);/i, /; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i], [e, [o, "Cat"], [t, h]], [/((?:new )?andromax[\w- ]+)(?: bui|\))/i], [e, [o, "Smartfren"], [t, h]], [/droid.+; (a(?:015|06[35]|142p?))/i], [e, [o, "Nothing"], [t, h]], [/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i, /archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i], [e, [o, "Archos"], [t, N]], [/archos ([\w ]+)( b|\))/i, /; (ac[3-6]\d\w{2,8})( b|\))/i], [e, [o, "Archos"], [t, h]], [/(imo) (tab \w+)/i, /(infinix) (x1101b?)/i], [o, e, [t, N]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i, /; (blu|hmd|imo|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i, /(hp) ([\w ]+\w)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i, /(oppo) ?([\w ]+) bui/i], [o, e, [t, h]], [/(kobo)\s(ereader|touch)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i], [o, e, [t, N]], [/(surface duo)/i], [e, [o, Pi], [t, N]], [/droid [\d\.]+; (fp\du?)(?: b|\))/i], [e, [o, "Fairphone"], [t, h]], [/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i], [e, [o, zi], [t, N]], [/(sprint) (\w+)/i], [o, e, [t, h]], [/(kin\.[onetw]{3})/i], [[e, /\./g, " "], [o, Pi], [t, h]], [/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [e, [o, Li], [t, N]], [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], [e, [o, Li], [t, h]], [/smart-tv.+(samsung)/i], [o, [t, f]], [/hbbtv.+maple;(\d+)/i], [[e, /^/, "SmartTV"], [o, ui], [t, f]], [/tcast.+(lg)e?. ([-\w]+)/i], [o, e, [t, f]], [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i], [[o, "LG"], [t, f]], [/(apple) ?tv/i], [o, [e, $ + " TV"], [t, f]], [/crkey.*devicetype\/chromecast/i], [[e, H + " Third Generation"], [o, F], [t, f]], [/crkey.*devicetype\/([^/]*)/i], [[e, /^/, "Chromecast "], [o, F], [t, f]], [/fuchsia.*crkey/i], [[e, H + " Nest Hub"], [o, F], [t, f]], [/crkey/i], [[e, H], [o, F], [t, f]], [/(portaltv)/i], [e, [o, Ci], [t, f]], [/droid.+aft(\w+)( bui|\))/i], [e, [o, Oi], [t, f]], [/(shield \w+ tv)/i], [e, [o, zi], [t, f]], [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i], [e, [o, "Sharp"], [t, f]], [/(bravia[\w ]+)( bui|\))/i], [e, [o, Mi], [t, f]], [/(mi(tv|box)-?\w+) bui/i], [e, [o, ki], [t, f]], [/Hbbtv.*(technisat) (.*);/i], [o, e, [t, f]], [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i], [[o, gi], [e, gi], [t, f]], [/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i], [e, [t, f]], [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i], [[t, f]], [/(ouya)/i, /(nintendo) (\w+)/i], [o, e, [t, ri]], [/droid.+; (shield)( bui|\))/i], [e, [o, zi], [t, ri]], [/(playstation \w+)/i], [e, [o, Mi], [t, ri]], [/\b(xbox(?: one)?(?!; xbox))[\); ]/i], [e, [o, Pi], [t, ri]], [/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i], [e, [o, ui], [t, _]], [/((pebble))app/i, /(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i], [o, e, [t, _]], [/(ow(?:19|20)?we?[1-3]{1,3})/i], [e, [o, vi], [t, _]], [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i], [e, [o, $], [t, _]], [/(opwwe\d{3})/i], [e, [o, Fi], [t, _]], [/(moto 360)/i], [e, [o, xi], [t, _]], [/(smartwatch 3)/i], [e, [o, Mi], [t, _]], [/(g watch r)/i], [e, [o, "LG"], [t, _]], [/droid.+; (wt63?0{2,3})\)/i], [e, [o, Li], [t, _]], [/droid.+; (glass) \d/i], [e, [o, F], [t, ji]], [/(pico) (4|neo3(?: link|pro)?)/i], [o, e, [t, ji]], [/(quest( \d| pro)?s?).+vr/i], [e, [o, Ci], [t, ji]], [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i], [o, [t, ai]], [/(aeobc)\b/i], [e, [o, Oi], [t, ai]], [/(homepod).+mac os/i], [e, [o, $], [t, ai]], [/windows iot/i], [[t, ai]], [/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i], [e, [t, K, { mobile: "Mobile", xr: "VR", "*": N }]], [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i], [[t, N]], [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i], [[t, h]], [/droid .+?; ([\w\. -]+)( bui|\))/i], [e, [o, "Generic"]]], engine: [[/windows.+ edge\/([\w\.]+)/i], [n, [s, "EdgeHTML"]], [/(arkweb)\/([\w\.]+)/i], [s, n], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [n, [s, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i], [s, n], [/ladybird\//i], [[s, "LibWeb"]], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [n, s]], os: [[/microsoft (windows) (vista|xp)/i], [s, n], [/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i], [s, [n, K, Xi]], [/windows nt 6\.2; (arm)/i, /windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i, /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i], [[n, K, Xi], [s, _i]], [/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i, /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i, /cfnetwork\/.+darwin/i], [[n, /_/g, "."], [s, "iOS"]], [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i], [[s, "macOS"], [n, /_/g, "."]], [/android ([\d\.]+).*crkey/i], [n, [s, H + " Android"]], [/fuchsia.*crkey\/([\d\.]+)/i], [n, [s, H + " Fuchsia"]], [/crkey\/([\d\.]+).*devicetype\/smartspeaker/i], [n, [s, H + " SmartSpeaker"]], [/linux.*crkey\/([\d\.]+)/i], [n, [s, H + " Linux"]], [/crkey\/([\d\.]+)/i], [n, [s, H]], [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i], [n, s], [/(ubuntu) ([\w\.]+) like android/i], [[s, /(.+)/, "$1 Touch"], n], [/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/\.; ]?([\d\.]*)/i], [s, n], [/\(bb(10);/i], [n, [s, Bi]], [/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i], [n, [s, "Symbian"]], [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i], [n, [s, li + " OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [n, [s, "webOS"]], [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i], [n, [s, "watchOS"]], [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i], [[s, "Chrome OS"], n], [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) (\w+)/i, /(xbox); +xbox ([^\);]+)/i, /(pico) .+os([\w\.]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i], [s, n], [/(sunos) ?([\w\.\d]*)/i], [[s, "Solaris"], n], [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i], [s, n]] }, mi = (v = { init: {}, isIgnore: {}, isIgnoreRgx: {}, toString: {} }, Y.call(v.init, [[S, [s, n, ni, t]], [U, [E]], [C, [t, e, o]], [z, [s, n]], [x, [s, n]]]), Y.call(v.isIgnore, [[S, [n, ni]], [z, [n]], [x, [n]]]), Y.call(v.isIgnoreRgx, [[S, / ?browser$/i], [x, / ?os$/i]]), Y.call(v.toString, [[S, [s, n]], [U, [E]], [C, [o, e]], [z, [s, n]], [x, [s, n]]]), v), gt = function(a, u) {
      var l = mi.init[u], y = mi.isIgnore[u] || 0, M = mi.isIgnoreRgx[u] || 0, w = mi.toString[u] || 0;
      function p() {
        Y.call(this, l);
      }
      return p.prototype.getItem = function() {
        return a;
      }, p.prototype.withClientHints = function() {
        return V ? V.getHighEntropyValues(Vi).then(function(b) {
          return a.setCH(new tt(b, !1)).parseCH().get();
        }) : a.parseCH().get();
      }, p.prototype.withFeatureCheck = function() {
        return a.detectFeature().get();
      }, u != J && (p.prototype.is = function(b) {
        var I, O = !1;
        for (I in this)
          if (this.hasOwnProperty(I) && !Ui(y, I) && Q(M ? ei(M, this[I]) : this[I]) == Q(M ? ei(M, b) : b)) {
            if (O = !0, b != Z)
              break;
          } else if (b == Z && O) {
            O = !O;
            break;
          }
        return O;
      }, p.prototype.toString = function() {
        var b, I = A;
        for (b in w)
          typeof this[w[b]] !== Z && (I += (I ? " " : A) + this[w[b]]);
        return I || Z;
      }), V || (p.prototype.then = function(b) {
        function I() {
          for (var R in O)
            O.hasOwnProperty(R) && (this[R] = O[R]);
        }
        var O = this, m = (I.prototype = { is: p.prototype.is, toString: p.prototype.toString }, new I());
        return b(m), m;
      }), new p();
    };
    function tt(a, u) {
      if (a = a || {}, Y.call(this, Vi), u)
        Y.call(this, [[Ai, Qi(a[W])], [Si, Qi(a[at])], [h, /\?1/.test(a[lt])], [e, hi(a[dt])], [X, hi(a[Hi])], [Ei, hi(a[ht])], [E, hi(a[ct])], [G, Qi(a[Mt])], [bi, hi(a[ut])]]);
      else
        for (var l in a)
          this.hasOwnProperty(l) && typeof a[l] !== Z && (this[l] = a[l]);
    }
    function et(a, u, l, y) {
      return this.get = function(M) {
        return M ? this.data.hasOwnProperty(M) ? this.data[M] : g : this.data;
      }, this.set = function(M, w) {
        return this.data[M] = w, this;
      }, this.setCH = function(M) {
        return this.uaCH = M, this;
      }, this.detectFeature = function() {
        if (P && P.userAgent == this.ua)
          switch (this.itemType) {
            case S:
              P.brave && typeof P.brave.isBrave == pi && this.set(s, "Brave");
              break;
            case C:
              !this.get(t) && V && V[h] && this.set(t, h), this.get(e) == "Macintosh" && P && typeof P.standalone !== Z && P.maxTouchPoints && 2 < P.maxTouchPoints && this.set(e, "iPad").set(t, N);
              break;
            case x:
              !this.get(s) && V && V[X] && this.set(s, V[X]);
              break;
            case J:
              var M = this.data, w = function(p) {
                return M[p].getItem().detectFeature().get();
              };
              this.set(S, w(S)).set(U, w(U)).set(C, w(C)).set(z, w(z)).set(x, w(x));
          }
        return this;
      }, this.parseUA = function() {
        return this.itemType != J && Ri.call(this.data, this.ua, this.rgxMap), this.itemType == S && this.set(ni, Yi(this.get(n))), this;
      }, this.parseCH = function() {
        var M, w = this.uaCH, p = this.rgxMap;
        switch (this.itemType) {
          case S:
          case z:
            var b, I = w[Si] || w[Ai];
            if (I)
              for (var O in I) {
                var m = I[O].brand || I[O], O = I[O].version;
                this.itemType != S || /not.a.brand/i.test(m) || b && (!/chrom/i.test(b) || m == qi) || (m = K(m, { Chrome: "Google Chrome", Edge: "Microsoft Edge", "Chrome WebView": "Android WebView", "Chrome Headless": "HeadlessChrome", "Huawei Browser": "HuaweiBrowser", "MIUI Browser": "Miui Browser", "Opera Mobi": "OperaMobile", Yandex: "YaBrowser" }), this.set(s, m).set(n, O).set(ni, Yi(O)), b = m), this.itemType == z && m == qi && this.set(n, O);
              }
            break;
          case U:
            var T = w[E];
            T && (w[bi] == "64" && (T += "64"), Ri.call(this.data, T + ";", p));
            break;
          case C:
            if (w[h] && this.set(t, h), w[e] && (this.set(e, w[e]), this.get(t) && this.get(o) || (Ri.call(T = {}, "droid 9; " + w[e] + ")", p), !this.get(t) && T.type && this.set(t, T.type), !this.get(o) && T.vendor && this.set(o, T.vendor))), w[G]) {
              if (typeof w[G] != "string")
                for (var R = 0; !M && R < w[G].length; )
                  M = K(w[G][R++], $i);
              else
                M = K(w[G], $i);
              this.set(t, M);
            }
            break;
          case x:
            var L, T = w[X];
            T && (L = w[Ei], T == _i && (L = 13 <= parseInt(Yi(L), 10) ? "11" : "10"), this.set(s, T).set(n, L)), this.get(s) == _i && w[e] == "Xbox" && this.set(s, "Xbox").set(n, g);
            break;
          case J:
            var Ti = this.data, T = function(wt) {
              return Ti[wt].getItem().setCH(w).parseCH().get();
            };
            this.set(S, T(S)).set(U, T(U)).set(C, T(C)).set(z, T(z)).set(x, T(x));
        }
        return this;
      }, Y.call(this, [["itemType", a], ["ua", u], ["uaCH", y], ["rgxMap", l], ["data", gt(this, a)]]), this;
    }
    function k(a, u, l) {
      var y, M, w, p, b;
      return typeof a === q ? (u = Di(a, !0) ? (typeof u === q && (l = u), a) : (l = a, g), a = g) : typeof a !== fi || Di(u, !0) || (l = u, u = g), l && typeof l.append === pi && (y = {}, l.forEach(function(I, O) {
        y[O] = I;
      }), l = y), this instanceof k ? (M = typeof a === fi ? a : l && l[Ni] ? l[Ni] : P && P.userAgent ? P.userAgent : A, w = new tt(l, !0), p = u ? ((I, O) => {
        var m, R = {}, L = O;
        if (!Di(O))
          for (var Ti in L = {}, O)
            for (var T in O[Ti])
              L[T] = O[Ti][T].concat(L[T] || []);
        for (m in I)
          R[m] = L[m] && L[m].length % 2 == 0 ? L[m].concat(I[m]) : I[m];
        return R;
      })(it, u) : it, Y.call(this, [["getBrowser", (b = function(I) {
        return I == J ? function() {
          return new et(I, M, p, w).set("ua", M).set(S, this.getBrowser()).set(U, this.getCPU()).set(C, this.getDevice()).set(z, this.getEngine()).set(x, this.getOS()).get();
        } : function() {
          return new et(I, M, p[I], w).parseUA().get();
        };
      })(S)], ["getCPU", b(U)], ["getDevice", b(C)], ["getEngine", b(z)], ["getOS", b(x)], ["getResult", b(J)], ["getUA", function() {
        return M;
      }], ["setUA", function(I) {
        return ti(I) && (M = I.length > B ? gi(I, B) : I), this;
      }]]).setUA(M), this) : new k(a, u, l).getResult();
    }
    k.VERSION = "2.0.3", k.BROWSER = D([s, n, ni, t]), k.CPU = D([E]), k.DEVICE = D([e, o, t, ri, h, f, N, _, ai]), k.ENGINE = k.OS = D([s, n]), (r = i.exports ? i.exports = k : r).UAParser = k;
    var wi, oi = Ji && (d.jQuery || d.Zepto);
    oi && !oi.ua && (wi = new k(), oi.ua = wi.getResult(), oi.ua.get = function() {
      return wi.getUA();
    }, oi.ua.set = function(a) {
      wi.setUA(a);
      var u, l = wi.getResult();
      for (u in l)
        oi.ua[u] = l[u];
    });
  })(typeof window == "object" ? window : bt);
}), Ot = function(r) {
  return Dt(r) && !mt(r);
};
function Dt(i) {
  return !!i && typeof i == "object";
}
function mt(i) {
  var r = Object.prototype.toString.call(i);
  return r === "[object RegExp]" || r === "[object Date]" || ft(i);
}
var Tt = typeof Symbol == "function" && Symbol.for, yt = Tt ? Symbol.for("react.element") : 60103;
function ft(i) {
  return i.$$typeof === yt;
}
function jt(i) {
  return Array.isArray(i) ? [] : {};
}
function Ii(i, r) {
  return r.clone !== !1 && r.isMergeableObject(i) ? si(jt(i), i, r) : i;
}
function At(i, r, d) {
  return i.concat(r).map(function(g) {
    return Ii(g, d);
  });
}
function St(i, r) {
  if (!r.customMerge)
    return si;
  var d = r.customMerge(i);
  return typeof d == "function" ? d : si;
}
function Et(i) {
  return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(i).filter(function(r) {
    return Object.propertyIsEnumerable.call(i, r);
  }) : [];
}
function st(i) {
  return Object.keys(i).concat(Et(i));
}
function rt(i, r) {
  try {
    return r in i;
  } catch {
    return !1;
  }
}
function Pt(i, r) {
  return rt(i, r) && !(Object.hasOwnProperty.call(i, r) && Object.propertyIsEnumerable.call(i, r));
}
function xt(i, r, d) {
  var g = {};
  return d.isMergeableObject(i) && st(i).forEach(function(D) {
    g[D] = Ii(i[D], d);
  }), st(r).forEach(function(D) {
    Pt(i, D) || (rt(i, D) && d.isMergeableObject(r[D]) ? g[D] = St(D, d)(i[D], r[D], d) : g[D] = Ii(r[D], d));
  }), g;
}
function si(i, r, d) {
  d = d || {}, d.arrayMerge = d.arrayMerge || At, d.isMergeableObject = d.isMergeableObject || Ot, d.cloneUnlessOtherwiseSpecified = Ii;
  var g = Array.isArray(r), D = Array.isArray(i), B = g === D;
  return B ? g ? d.arrayMerge(i, r, d) : xt(i, r, d) : Ii(r, d);
}
si.all = function(r, d) {
  if (!Array.isArray(r))
    throw new Error("first argument should be an array");
  return r.reduce(function(g, D) {
    return si(g, D, d);
  }, {});
};
var zt = si, nt = zt;
class j {
  /**
   * Check if it is possible to get the position of the device using the GeoLocation API.
   *
   * @returns {boolean} True if the GeoLocation API is available in the browser, false otherwise.
   */
  isAvailable() {
    return "geolocation" in navigator;
  }
  /**
   * Check if the user has already granted permission to access the device's location.
   *
   * @returns {Promise<boolean>} A promise that resolves to true if permission is granted, false otherwise.
   */
  async isAlreadyGranted() {
    return !("permissions" in navigator) || !("query" in navigator.permissions) ? Promise.resolve(!1) : (await navigator.permissions.query({ name: "geolocation" })).state === "granted";
  }
  /**
   * Listen for position updates from the GeoLocation API.
   *
   * @param {number} maxAccuracy - The maximum accuracy of the position to accept.
   * @param {Function} positionError - Callback function to call when an error occurs while getting the position.
   * @param {Function} positionInaccurate - Callback function to call when the position is inaccurate.
   * @param {Function} positionRequesting - Callback function to call when the position is being requested.
   * @param {Function} positionReceived - Callback function to call when a position is received.
   */
  listenForPosition(r, d, g, D, B) {
    if (!("permissions" in navigator) || !("query" in navigator.permissions)) {
      d();
      return;
    }
    D();
    const Ni = Date.now();
    j.positionWatchId = navigator.geolocation.watchPosition((A) => {
      j.currentPosition && A.coords.accuracy === j.currentPosition.coords.accuracy && A.coords.latitude === j.currentPosition.coords.latitude && A.coords.longitude === j.currentPosition.coords.longitude || (j.currentPosition = A, j.currentPosition.coords.accuracy <= r ? B(A) : g(A.coords.accuracy));
    }, (A) => {
      (A.code !== 3 || !j.currentPosition || j.currentPosition.timestamp <= Ni) && d(A);
    });
  }
  /**
   * Stop listening for position updates from the GeoLocation API.
   * This will clear the watch set by `listenForPosition` and reset the current position.
   *
   * @returns {void}
   */
  stopListeningForPosition() {
    j.positionWatchId !== null && (navigator.geolocation.clearWatch(j.positionWatchId), j.positionWatchId = null), j.currentPosition = null;
  }
}
j.currentPosition = null;
j.positionWatchId = null;
const vt = ".mi-my-position{display:flex;flex-direction:column;pointer-events:auto;gap:16px;right:0}.mi-my-position__position-button,.mi-my-position__compass-button{margin:0;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:48px;height:48px;background-repeat:no-repeat;background-position:center;outline:none;border-color:#e5e7eb;border-style:solid;background-color:#fcfcfc}.mi-my-position__position-button{background-size:23px;border-radius:8px}.mi-my-position__position-button--unknown{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iM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CA5Ljc2Mkw2LjY0NTEyIDguMzAzMDlMOC4xOTE3NyA5Ljg0OTc0TDMuNTg4MTkgMTEuNjI3N0MyLjY4MjI0IDExLjk3NzYgMi43NTY0OCAxMy4yODMzIDMuNjk2MjUgMTMuNTI4Mkw4LjYzMzUgMTQuODE1MUM5LjMzNDQzIDE0Ljk5NzggOS44ODE3OCAxNS41NDUyIDEwLjA2NDQgMTYuMjQ2TDExLjM1MTMgMjEuMTgzMkMxMS41OTYyIDIyLjEyMjkgMTIuOTAxOSAyMi4xOTcyIDEzLjI1MTggMjEuMjkxMloiIGZpbGw9IiM3MzczNzMiLz4KPC9zdmc+Cg==)}.mi-my-position__position-button--requesting{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHZpZXdCb3g9IjAgMCAxOSAxOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYuODkzNDEgMTEuMjgzTDEuOTU2MTYgOS45OTYxMUMwLjA3NjYyOTIgOS41MDYyIC0wLjA3MTg0MTEgNi44OTQ4NSAxLjc0MDA1IDYuMTk1MDdMMTYuMzg4NiAwLjUzNzYxN0MxNy42MTkxIDAuMDYyMzc2NiAxOC44Mjk0IDEuMjcyNjYgMTguMzU0MSAyLjUwMzE2TDEyLjY5NjcgMTcuMTUxN0MxMS45OTY5IDE4Ljk2MzYgOS4zODU2NCAxOC44MTUxIDguODk1NzQgMTYuOTM1Nkw3LjYwODg0IDExLjk5ODRDNy41MTc1NCAxMS42NDggNy4yNDM4NiAxMS4zNzQzIDYuODkzNDEgMTEuMjgzWiIgZmlsbD0iIzczNzM3MyIvPgo8L3N2Zz4K)}.mi-my-position__position-button--known{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHZpZXdCb3g9IjAgMCAxOSAxOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYuODkzNDEgMTEuMjgzTDEuOTU2MTYgOS45OTYxMUMwLjA3NjYyOTIgOS41MDYyIC0wLjA3MTg0MTEgNi44OTQ4NSAxLjc0MDA1IDYuMTk1MDdMMTYuMzg4NiAwLjUzNzYxN0MxNy42MTkxIDAuMDYyMzc2NiAxOC44Mjk0IDEuMjcyNjYgMTguMzU0MSAyLjUwMzE2TDEyLjY5NjcgMTcuMTUxN0MxMS45OTY5IDE4Ljk2MzYgOS4zODU2NCAxOC44MTUxIDguODk1NzQgMTYuOTM1Nkw3LjYwODg0IDExLjk5ODRDNy41MTc1NCAxMS42NDggNy4yNDM4NiAxMS4zNzQzIDYuODkzNDEgMTEuMjgzWiIgZmlsbD0iIzczNzM3MyIvPgo8L3N2Zz4K)}.mi-my-position__position-button--centered{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHZpZXdCb3g9IjAgMCAxOSAxOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTYuODkzNDEgMTEuMjgzTDEuOTU2MTYgOS45OTYxMUMwLjA3NjYyOTIgOS41MDYyIC0wLjA3MTg0MTEgNi44OTQ4NSAxLjc0MDA1IDYuMTk1MDdMMTYuMzg4NiAwLjUzNzYxN0MxNy42MTkxIDAuMDYyMzc2NiAxOC44Mjk0IDEuMjcyNjYgMTguMzU0MSAyLjUwMzE2TDEyLjY5NjcgMTcuMTUxN0MxMS45OTY5IDE4Ljk2MzYgOS4zODU2NCAxOC44MTUxIDguODk1NzQgMTYuOTM1Nkw3LjYwODg0IDExLjk5ODRDNy41MTc1NCAxMS42NDggNy4yNDM4NiAxMS4zNzQzIDYuODkzNDEgMTEuMjgzWiIgZmlsbD0iIzI1NjNFQiIvPgo8L3N2Zz4K)}.mi-my-position__position-button--tracked{background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0ODEzIDIuOTYyNDFaIiBmaWxsPSIjREMyNjI2Ii8+CjxwYXRoIGQ9Ik03LjM3MjUzIDI3Ljg5OTRDNy4wMTkwNiAyOC42ODY1IDUuOTAxNSAyOC42ODY1IDUuNTQ4MDQgMjcuODk5NEwxLjMyNzc5IDE4LjUwMTJDMC45NzE1OTcgMTcuNzA4IDEuNzI3NTkgMTYuODY5NSAyLjU1MzM0IDE3LjE0Mkw2LjE0Njk4IDE4LjMyNzVDNi4zNTA0NiAxOC4zOTQ3IDYuNTcwMTEgMTguMzk0NyA2Ljc3MzU5IDE4LjMyNzVMMTAuMzY3MiAxNy4xNDJDMTEuMTkzIDE2Ljg2OTUgMTEuOTQ5IDE3LjcwOCAxMS41OTI4IDE4LjUwMTJMNy4zNzI1MyAyNy44OTk0WiIgZmlsbD0iIzlDQTNBRiIvPgo8L3N2Zz4K);border-radius:50%}";
var c;
(function(i) {
  i.POSITION_UNKNOWN = "POSITION_UNKNOWN", i.POSITION_REQUESTING = "POSITION_REQUESTING", i.POSITION_INACCURATE = "POSITION_INACCURATE", i.POSITION_KNOWN = "POSITION_KNOWN", i.POSITION_CENTERED = "POSITION_CENTERED", i.POSITION_TRACKED = "POSITION_TRACKED", i.POSITION_UNTRACKED = "POSITION_UNTRACKED", i.POSITION_FOLLOW = "POSITION_FOLLOW";
})(c || (c = {}));
const kt = class {
  constructor(i) {
    It(this, i), this.position_error = ot(this, "position_error", 7), this.position_received = ot(this, "position_received", 7), this.parser = new Zi.UAParser(), this.handleDeviceOrientationReference = this.handleDeviceOrientation.bind(this), this.cachedBuilding = null, this.onPositionReceivedHandler = null, this.onPositionErrorHandler = null, this.floorChangedHandler = null, this.lastAppliedOpacity = 1, this.defaultFillOpacity = 1, this.reducedFillOpacity = 0.3, this.defaultOptions = {
      maxAccuracy: 200,
      positionOptions: {
        timeout: 3e4,
        enableHighAccuracy: !0,
        maximumAge: 0
      },
      positionMarkerStyles: {
        radius: "12px",
        strokeWeight: "2px",
        strokeColor: "white",
        fillColor: "#4169E1",
        fillOpacity: this.defaultFillOpacity
      },
      accuracyCircleStyles: {
        fillColor: "#4169E1",
        fillOpacity: 0.16
      }
    }, this.mapsindoors = void 0, this.myPositionOptions = void 0, this.customPositionProvider = void 0, this.positionState = c.POSITION_UNKNOWN;
  }
  /**
   * Cleans up modern position provider event listeners.
   * Removes registered event handlers and nulls the stored references to prevent memory leaks.
   */
  cleanupModernProviderListeners() {
    if (!this.isModernProvider(this.positionProvider))
      return;
    const i = this.positionProvider;
    this.onPositionReceivedHandler && (i.off("position_received", this.onPositionReceivedHandler), this.onPositionReceivedHandler = null), this.onPositionErrorHandler && (i.off("position_error", this.onPositionErrorHandler), this.onPositionErrorHandler = null);
  }
  /**
   * Sets up event listeners for modern position providers.
   * This ensures that position updates are handled immediately when setPosition() is called.
   *
   * Note: We use this.positionProvider (not this.customPositionProvider) because:
   * - this.positionProvider is the resolved, validated provider
   * - It's guaranteed to exist and be valid
   * - It handles both custom and default providers consistently
   * - All other methods in the component use this.positionProvider for consistency.
   */
  setupModernProviderListeners() {
    if (!this.isModernProvider(this.positionProvider))
      return;
    this.cleanupModernProviderListeners();
    const i = this.positionProvider;
    this.onPositionReceivedHandler = ({ position: r }) => {
      this.currentPosition = r, this.positionIsAccurate = r.coords.accuracy <= this.options.maxAccuracy, this.setPositionProviderOnMapView(), this.positionState === c.POSITION_TRACKED ? this.setPositionState(c.POSITION_UNTRACKED) : this.positionState === c.POSITION_UNKNOWN || this.positionState === c.POSITION_REQUESTING ? this.setPositionState(c.POSITION_FOLLOW) : this.positionState !== c.POSITION_UNTRACKED && this.positionState !== c.POSITION_FOLLOW && this.setPositionState(c.POSITION_KNOWN), this.positionState === c.POSITION_FOLLOW ? (this.handleFollowModePosition(r), this.applyOpacityForPosition(r)) : this.applyOpacityForPosition(r), window.removeEventListener("deviceorientation", this.handleDeviceOrientationReference), this.position_received.emit({
        position: this.currentPosition,
        selfInvoked: !1,
        accurate: this.positionIsAccurate
      });
    }, this.onPositionErrorHandler = (r) => {
      this.setPositionState(c.POSITION_UNKNOWN), this.position_error.emit(r);
    }, i.on("position_received", this.onPositionReceivedHandler), i.on("position_error", this.onPositionErrorHandler);
  }
  /**
   * Sets a custom position. Works with any provider that implements setPosition.
   * Uses this.positionProvider (the resolved provider) instead of this.customPositionProvider
   * to ensure we're working with the validated, active provider.
   */
  async setPosition(i) {
    var r;
    !((r = this.positionProvider) === null || r === void 0) && r.setPosition && this.positionProvider.setPosition(i);
  }
  /**
   * Removes the event listener for the device's orientation and resets the position button.
   */
  resetPositionState() {
    window.removeEventListener("deviceorientation", this.handleDeviceOrientationReference), this.positionState === c.POSITION_TRACKED ? this.setPositionState(c.POSITION_UNTRACKED) : this.positionState === c.POSITION_CENTERED && (this.setPositionState(c.POSITION_KNOWN), this.mapView.tilt(0));
  }
  /**
   * Returns if position is known and accurate.
   *
   * @returns {boolean}
   */
  hasValidPosition() {
    return [c.POSITION_KNOWN, c.POSITION_CENTERED, c.POSITION_INACCURATE, c.POSITION_TRACKED, c.POSITION_UNTRACKED, c.POSITION_FOLLOW].includes(this.positionState);
  }
  /**
   * Sets the PositionControl as PositionProvider on the MapView.
   */
  setPositionProviderOnMapView() {
    this.mapView.isReady ? this.mapView.setPositionProvider(this) : this.mapView.once("ready", () => {
      this.mapView.setPositionProvider(this);
    });
  }
  /**
   * Forces the position provider to refresh by removing and re-adding it.
   * This makes the SDK re-read the updated options and redraw the marker.
   */
  refreshPositionProvider() {
    this.mapView.isReady && (this.mapView.setPositionProvider(null), requestAnimationFrame(() => {
      this.mapView.setPositionProvider(this);
    }));
  }
  /**
   * Sets fillOpacity based on floor match and reapplies the provider so SDK re-reads styles.
   * Only refreshes the marker when opacity actually changes to improve performance.
   */
  applyOpacityForPosition(i) {
    var r;
    if (!(!((r = this.options) === null || r === void 0) && r.positionMarkerStyles))
      return;
    const g = this.isFloorMatching(i) ? this.defaultFillOpacity : this.reducedFillOpacity;
    g !== this.lastAppliedOpacity && (this.options.positionMarkerStyles.fillOpacity = g, this.lastAppliedOpacity = g, this.refreshPositionProvider());
  }
  /**
   * Compares incoming position floor with current map floor and returns the result.
   * Only used for modern providers during position updates.
   *
   * Returns true (full opacity) when:
   * - The incoming floor matches the current map floor
   * - The incoming floor is invalid (doesn't exist in the building) - treated as "no floor data"
   *
   * Returns false (reduced opacity) when:
   * - The incoming floor is valid but different from the current map floor.
   *
   * @param {MapsIndoorsPosition} position - The position to compare.
   * @returns {boolean} - True if the floor matches or is invalid, false otherwise.
   */
  isFloorMatching(i) {
    if (!this.mapsindoors)
      return !1;
    const r = i.floorIndex, d = this.mapsindoors.getFloor();
    if (r == null || d === void 0 || d === null)
      return !1;
    const g = r.toString();
    return this.isValidFloorForCurrentBuilding(g) ? g === d : !0;
  }
  /**
   * Pan map to center on the current position.
   */
  panToCurrentPosition() {
    this.hasValidPosition() && (this.mapView.once("idle", () => {
      this.mapView.on("user_interaction", () => this.resetPositionState());
    }), this.mapView.panTo({ lat: this.currentPosition.coords.latitude, lng: this.currentPosition.coords.longitude }), this.positionState !== c.POSITION_TRACKED && this.positionState !== c.POSITION_FOLLOW && this.setPositionState(c.POSITION_CENTERED), this.canBeTracked && (DeviceOrientationEvent.requestPermission ? DeviceOrientationEvent.requestPermission().then((i) => {
      i === "granted" && this.positionState === c.POSITION_TRACKED ? window.addEventListener("deviceorientation", this.handleDeviceOrientationReference) : window.removeEventListener("deviceorientation", this.handleDeviceOrientationReference);
    }) : this.positionState === c.POSITION_TRACKED ? window.addEventListener("deviceorientation", this.handleDeviceOrientationReference) : window.removeEventListener("deviceorientation", this.handleDeviceOrientationReference)));
  }
  /**
   * Handles position updates in FOLLOW mode.
   * Automatically pans the map and changes floors without user interaction listeners.
   * Device orientation is handled by the existing handleDeviceOrientation method.
   */
  handleFollowModePosition(i) {
    if (this.hasValidPosition() && (this.mapView.panTo({ lat: i.coords.latitude, lng: i.coords.longitude }), i.floorIndex !== void 0 && i.floorIndex !== null && this.mapsindoors)) {
      const r = this.mapsindoors.getFloor(), d = i.floorIndex.toString();
      d !== r && this.isValidFloorForCurrentBuilding(d) && this.mapsindoors.setFloor(d);
    }
  }
  /**
   * Validates if a floor index exists in the current building.
   * Checks the current building's floors to ensure the floor index is valid.
   * Uses caching to avoid repeated lookups on every position update.
   *
   * @param {string} floorIndex - The floor index to validate.
   * @returns {boolean} - True if the floor exists in the current building.
   */
  isValidFloorForCurrentBuilding(i) {
    if (!this.mapsindoors)
      return !1;
    try {
      const r = this.mapsindoors.getBuilding();
      return !r || !r.floors ? (this.clearBuildingFloorsCache(), !1) : ((!this.cachedBuilding || this.cachedBuilding.id !== r.id) && (this.cachedBuilding = r), i in this.cachedBuilding.floors);
    } catch {
      return this.clearBuildingFloorsCache(), !0;
    }
  }
  /**
   * Clears the cached building.
   * Should be called when the building changes to ensure fresh validation.
   */
  clearBuildingFloorsCache() {
    this.cachedBuilding = null;
  }
  /**
   * Rotates and tilts the map.
   *
   * @param {DeviceOrientationEvent} e
   */
  handleDeviceOrientation(i) {
    (!this.orientation || this.orientation - (360 - i.alpha) > 1 || this.orientation - (360 - i.alpha) < -1) && (this.orientation = 360 - i.alpha, this.mapView.easeTo({
      center: [this.currentPosition.coords.longitude, this.currentPosition.coords.latitude],
      rotation: this.orientation,
      tilt: 60,
      easing: (r) => r * (2 - r)
    }));
  }
  /**
   * Rotates the compass button using the transform CSS property.
   *
   * @param {number} bearing
   */
  setCompassStyle(i) {
    this.compassButton && (this.compassButton.style.transform = `rotate(${i}deg)`);
  }
  /**
   * Method for requesting the current position, emitting events and showing position on map based on result.
   *
   * @param {boolean} [selfInvoked=false] - Used to track if call was invoked by clicking on position control or not.
   */
  watchPosition(i = !1) {
    if (this.setPositionProviderOnMapView(), this.isLegacyProvider(this.positionProvider))
      this.positionProvider.listenForPosition(
        this.options.maxAccuracy,
        // Position error callback
        (r) => {
          this.setPositionState(c.POSITION_UNKNOWN), this.position_error.emit(r);
        },
        // Position inaccurate callback
        (r) => {
          this.setPositionState(c.POSITION_INACCURATE), this.position_error.emit({ code: 11, message: "Inaccurate position: " + r });
        },
        // Position requesting callback
        () => {
          this.positionState !== c.POSITION_FOLLOW && this.setPositionState(c.POSITION_REQUESTING);
        },
        // Position received callback
        (r) => {
          this.currentPosition = r, this.positionIsAccurate = this.currentPosition.coords.accuracy <= this.options.maxAccuracy, this.positionState === c.POSITION_TRACKED ? this.setPositionState(c.POSITION_UNTRACKED) : this.positionState !== c.POSITION_UNTRACKED && this.positionState !== c.POSITION_FOLLOW && this.setPositionState(c.POSITION_KNOWN), window.removeEventListener("deviceorientation", this.handleDeviceOrientationReference), this.position_received.emit({
            position: this.currentPosition,
            selfInvoked: i,
            accurate: this.positionIsAccurate
          });
        }
      );
    else {
      const r = this.positionProvider;
      r.hasValidPosition && r.hasValidPosition() ? (this.currentPosition = r.currentPosition, this.positionIsAccurate = this.currentPosition.coords.accuracy <= this.options.maxAccuracy, this.positionState === c.POSITION_TRACKED ? this.setPositionState(c.POSITION_UNTRACKED) : this.positionState !== c.POSITION_UNTRACKED && this.positionState !== c.POSITION_FOLLOW && this.setPositionState(c.POSITION_KNOWN), window.removeEventListener("deviceorientation", this.handleDeviceOrientationReference), this.position_received.emit({
        position: this.currentPosition,
        selfInvoked: i,
        accurate: this.positionIsAccurate
      })) : this.positionState !== c.POSITION_FOLLOW && (r.currentPosition === null ? this.setPositionState(c.POSITION_UNKNOWN) : this.setPositionState(c.POSITION_REQUESTING));
    }
  }
  /**
   * Sets position button state.
   *
   * @param {PositionStateTypes} state
   */
  setPositionState(i) {
    this.positionState = i;
  }
  /**
   * Handle click on the compass button.
   */
  onCompassButtonClicked() {
    this.setCompassStyle(0), this.mapView.rotate(0), this.mapView.tilt(0), window.removeEventListener("deviceorientation", this.handleDeviceOrientationReference), this.positionState === c.POSITION_TRACKED ? this.setPositionState(c.POSITION_CENTERED) : this.positionState === c.POSITION_UNTRACKED && this.setPositionState(c.POSITION_KNOWN);
  }
  /**
   * Handle click on position button.
   * Stops propagation to avoid any map click listeners to fire.
   *
   * @param {Event} event
   */
  onPositionButtonClicked(i) {
    switch (i.stopPropagation(), this.positionState) {
      case c.POSITION_UNKNOWN:
        this.mapView.tilt(0), this.watchPosition(!0);
        break;
      case c.POSITION_KNOWN:
        this.mapView.tilt(0), this.panToCurrentPosition();
        break;
      case c.POSITION_CENTERED:
        this.customPositionProvider && this.isValidPositionProvider(this.customPositionProvider) ? this.setPositionState(c.POSITION_FOLLOW) : this.canBeTracked && this.setPositionState(c.POSITION_TRACKED), this.panToCurrentPosition();
        break;
      case c.POSITION_FOLLOW:
        this.setPositionState(c.POSITION_KNOWN);
        break;
      case c.POSITION_TRACKED:
        this.mapView.tilt(0), this.mapView.rotate(0), this.setCompassStyle(0), this.setPositionState(c.POSITION_CENTERED), this.panToCurrentPosition();
        break;
      case c.POSITION_UNTRACKED:
        this.setPositionState(c.POSITION_TRACKED), this.panToCurrentPosition();
        break;
    }
  }
  /**
   * Called every time the component has connected to the DOM.
   * 1. Assigning the mapView and options attributes.
   * 2. Checking for the navigator's state.
   * 3. Determining whether the device can be tracked.
   * 4. Asking for permission to track the device.
   * 5. Styling the compass button.
   */
  connectedCallback() {
    var i;
    if (this.mapView = this.mapsindoors.getMapView(), this.options = nt(this.defaultOptions, (i = this.myPositionOptions) !== null && i !== void 0 ? i : {}), this.positionProvider && this.cleanupModernProviderListeners(), this.customPositionProvider && this.isValidPositionProvider(this.customPositionProvider) ? (this.positionProvider = this.customPositionProvider, this.isModernProvider(this.positionProvider) && this.positionProvider.options && (this.options = nt(this.options, this.positionProvider.options)), this.setupModernProviderListeners()) : this.positionProvider = new j(), (this.isLegacyProvider(this.positionProvider) ? this.positionProvider.isAvailable() : !0) === !1) {
      this.setPositionState(c.POSITION_UNKNOWN), this.position_error.emit({ code: 10, message: "Location not available" });
      return;
    }
    const d = this.parser.getDevice().type;
    this.canBeTracked = !!(typeof window.DeviceOrientationEvent == "function" && (d === Zi.UAParser.DEVICE.MOBILE || d === Zi.UAParser.DEVICE.TABLET) && this.mapView.rotatable && this.mapView.tiltable), this.isLegacyProvider(this.positionProvider) ? this.positionProvider.isAlreadyGranted().then((g) => {
      g ? this.watchPosition() : this.setPositionState(c.POSITION_UNKNOWN);
    }) : this.positionProvider.hasValidPosition && this.positionProvider.hasValidPosition() ? (this.currentPosition = this.positionProvider.currentPosition, this.setPositionState(c.POSITION_KNOWN), this.position_received.emit({
      position: this.currentPosition,
      selfInvoked: !1,
      accurate: !0
    })) : this.setPositionState(c.POSITION_UNKNOWN), this.mapView.on("rotateend", () => {
      this.setCompassStyle(this.mapView.getBearing());
    }), this.mapsindoors && this.isModernProvider(this.positionProvider) && (this.floorChangedHandler = () => {
      this.currentPosition && this.positionState !== c.POSITION_FOLLOW && this.applyOpacityForPosition(this.currentPosition);
    }, this.mapsindoors.on("floor_changed", this.floorChangedHandler));
  }
  /**
   * Checks if the provider is a valid position provider (either legacy or modern).
   *
   * @param {any} provider - The provider to check.
   * @returns {boolean} True if the provider is valid.
   */
  isValidPositionProvider(i) {
    return i ? typeof i.isAvailable == "function" && typeof i.listenForPosition == "function" ? i.isAvailable() : typeof i.hasValidPosition == "function" && typeof i.on == "function" && typeof i.off == "function" : !1;
  }
  /**
   * Checks if the provider uses the legacy callback-based interface.
   *
   * @param {IPositionProvider} provider - The provider to check.
   * @returns {boolean} True if the provider uses the legacy interface.
   */
  isLegacyProvider(i) {
    return i && typeof i.isAvailable == "function" && typeof i.listenForPosition == "function";
  }
  /**
   * Checks if the provider uses the modern event-based interface.
   *
   * @param {IPositionProvider} provider - The provider to check.
   * @returns {boolean} True if the provider uses the modern interface.
   */
  isModernProvider(i) {
    return i && typeof i.hasValidPosition == "function" && typeof i.on == "function" && typeof i.off == "function";
  }
  /**
   * Component render callback.
   */
  componentDidRender() {
    this.setCompassStyle(this.mapView.getBearing());
  }
  /**
   * Stops listening for position updates.
   */
  disconnectedCallback() {
    this.positionProvider && (this.isLegacyProvider(this.positionProvider) ? this.positionProvider.stopListeningForPosition && this.positionProvider.stopListeningForPosition() : this.cleanupModernProviderListeners(), this.mapsindoors && this.floorChangedHandler && (this.mapsindoors.off("floor_changed", this.floorChangedHandler), this.floorChangedHandler = null));
  }
  /**
   * Renders the floor selector.
   *
   * @returns {JSX.Element}
   */
  render() {
    return yi(Nt, null, yi("div", { class: "mi-my-position" }, yi("button", { class: `mi-my-position__position-button
                            ${this.positionState === c.POSITION_UNKNOWN || this.positionState === c.POSITION_INACCURATE ? "mi-my-position__position-button--unknown" : ""}
                            ${this.positionState === c.POSITION_REQUESTING ? "mi-my-position__position-button--requesting" : ""}
                            ${this.positionState === c.POSITION_KNOWN ? "mi-my-position__position-button--known" : ""}
                            ${this.positionState === c.POSITION_CENTERED ? "mi-my-position__position-button--centered" : ""}
                            ${this.positionState === c.POSITION_TRACKED ? "mi-my-position__position-button--tracked" : ""}
                            ${this.positionState === c.POSITION_UNTRACKED ? "mi-my-position__position-button--untracked" : ""}
                            ${this.positionState === c.POSITION_FOLLOW ? "mi-my-position__position-button--follow" : ""}`, onClick: (i) => this.onPositionButtonClicked(i) }), yi("button", { ref: (i) => this.compassButton = i, class: "mi-my-position__compass-button", onClick: () => this.onCompassButtonClicked() })));
  }
};
kt.style = vt;
export {
  kt as mi_my_position
};
//# sourceMappingURL=mi-my-position.entry-a2bea62b.mjs.map
