"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("../polyfills/tslib.js");
var webmapgl_core_js_1 = require("../webmapgl.core.js");
var chunk_cf921ba9_js_1 = require("./chunk-cf921ba9.js");
var chunk_3488a752_js_1 = require("./chunk-3488a752.js");
var chunk_d32000ae_js_1 = require("./chunk-d32000ae.js");
var chunk_544df5aa_js_1 = require("./chunk-544df5aa.js");
var App = function () { function t() { this.menu = !0, this.menuLabel = chunk_cf921ba9_js_1.a("webmapgl.app.menulabel"), this.splitPane = !0; } return t.prototype.componentDidLoad = function () { this.el.querySelector("gl-map").resizeMap(); }, t.prototype.getMenu = function () { return !0 === this.menu ? webmapgl_core_js_1.h("ion-menu", null, webmapgl_core_js_1.h("ion-header", null, webmapgl_core_js_1.h("ion-toolbar", null, webmapgl_core_js_1.h("ion-title", null, this.menuLabel))), webmapgl_core_js_1.h("ion-content", null, webmapgl_core_js_1.h("div", { class: "gl-menu-content" }, webmapgl_core_js_1.h("slot", { name: "menu" })))) : "custom" === this.menu ? webmapgl_core_js_1.h("slot", { name: "menu" }) : void 0; }, t.prototype.getMenuButton = function () { if (this.menu)
    return webmapgl_core_js_1.h("ion-menu-toggle", null, webmapgl_core_js_1.h("ion-button", null, webmapgl_core_js_1.h("ion-icon", { slot: "icon-only", name: "menu" }))); }, t.prototype.getMain = function () { return webmapgl_core_js_1.h("div", { class: "pane-main", main: !0 }, webmapgl_core_js_1.h("ion-header", null, webmapgl_core_js_1.h("ion-toolbar", null, webmapgl_core_js_1.h("ion-buttons", { slot: "start" }, this.getMenuButton(), webmapgl_core_js_1.h("slot", { name: "start-buttons" })), webmapgl_core_js_1.h("ion-buttons", { slot: "end" }, webmapgl_core_js_1.h("slot", { name: "end-buttons" })), webmapgl_core_js_1.h("ion-title", null, this.label))), webmapgl_core_js_1.h("ion-content", { scrollX: !1, scrollY: !1, class: "map-content" }, webmapgl_core_js_1.h("div", { class: "fixed-content", slot: "fixed" }, webmapgl_core_js_1.h("slot", null))), webmapgl_core_js_1.h("slot", { name: "after-content" }), webmapgl_core_js_1.h("ion-footer", null, webmapgl_core_js_1.h("slot", { name: "footer" }))); }, t.prototype.render = function () { var t = [this.getMenu(), this.getMain()]; return this.splitPane && (t = [webmapgl_core_js_1.h("ion-split-pane", null, t)]), [webmapgl_core_js_1.h("ion-app", null, t)]; }, Object.defineProperty(t, "is", { get: function () { return "gl-app"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "properties", { get: function () { return { el: { elementRef: !0 }, label: { type: String, attr: "label" }, menu: { type: "Any", attr: "menu" }, menuLabel: { type: String, attr: "menu-label" }, splitPane: { type: Boolean, attr: "split-pane" } }; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "style", { get: function () { return "gl-app{display:block;height:100%;width:100%}gl-app .pane-main{bottom:0;right:0}gl-app .map-content .fixed-content,gl-app .pane-main{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:0;position:absolute;top:0;width:100%}gl-app .map-content .fixed-content{height:100%}gl-app .map-content ion-fab.fab-vertical-bottom{bottom:30px}"; }, enumerable: !0, configurable: !0 }), t; }(), App$1 = function () { function t() { } return t.prototype.componentDidLoad = function () { var t = this; chunk_3488a752_js_1.e(function () { var e = t.win, n = t.config, i = t.queue; n.getBoolean("_testing") || importTapClick(e, n), importInputShims(e, n), importStatusTap(e, n, i), importHardwareBackButton(e, n), importFocusVisible(e); }); }, t.prototype.hostData = function () { var t; return { class: (t = {}, t["" + this.mode] = !0, t["ion-page"] = !0, t["force-statusbar-padding"] = this.config.getBoolean("_forceStatusbarPadding"), t) }; }, Object.defineProperty(t, "is", { get: function () { return "ion-app"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "properties", { get: function () { return { config: { context: "config" }, el: { elementRef: !0 }, queue: { context: "queue" }, win: { context: "window" } }; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "style", { get: function () { return "html.plt-mobile ion-app{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-app.force-statusbar-padding{--ion-safe-area-top:20px}"; }, enumerable: !0, configurable: !0 }), t; }();
exports.GlApp = App;
exports.IonApp = App$1;
function importHardwareBackButton(t, e) { e.getBoolean("hardwareBackButton", chunk_d32000ae_js_1.a(t, "hybrid")) && Promise.resolve().then(function () { return require("./chunk-a6c44155.js"); }).then(function (e) { return e.startHardwareBackButton(t); }); }
function importStatusTap(t, e, n) { e.getBoolean("statusTap", chunk_d32000ae_js_1.a(t, "hybrid")) && Promise.resolve().then(function () { return require("./chunk-582d8c19.js"); }).then(function (e) { return e.startStatusTap(t, n); }); }
function importFocusVisible(t) { Promise.resolve().then(function () { return require("./chunk-6fb8e8d5.js"); }).then(function (e) { return e.startFocusVisible(t.document); }); }
function importTapClick(t, e) { Promise.resolve().then(function () { return require("./chunk-2ade216b.js"); }).then(function (n) { return n.startTapClick(t.document, e); }); }
function importInputShims(t, e) { e.getBoolean("inputShims", needInputShims(t)) && Promise.resolve().then(function () { return require("./chunk-58c574ce.js"); }).then(function (n) { return n.startInputShims(t.document, e); }); }
function needInputShims(t) { return chunk_d32000ae_js_1.a(t, "ios") && chunk_d32000ae_js_1.a(t, "mobile"); }
var Footer = function () { function t() { this.translucent = !1; } return t.prototype.hostData = function () { var t; return { class: (t = {}, t["" + this.mode] = !0, t["footer-" + this.mode] = !0, t["footer-translucent"] = this.translucent, t["footer-translucent-" + this.mode] = this.translucent, t) }; }, Object.defineProperty(t, "is", { get: function () { return "ion-footer"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "properties", { get: function () { return { mode: { type: String, attr: "mode" }, translucent: { type: Boolean, attr: "translucent" } }; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "style", { get: function () { return "ion-footer{display:block;position:relative;-ms-flex-order:1;order:1;width:100%;z-index:10}ion-footer ion-toolbar:last-child{padding-bottom:var(--ion-safe-area-bottom,0)}.footer-ios ion-toolbar:first-child{--border-width:0.55px 0 0}.footer-ios[no-border] ion-toolbar:first-child{--border-width:0}.footer-translucent-ios{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}.footer-translucent-ios ion-toolbar{--opacity:.8;--backdrop-filter:saturate(180%) blur(20px)}"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "styleMode", { get: function () { return "ios"; }, enumerable: !0, configurable: !0 }), t; }(), Menu = function () { function t() { this.lastOnEnd = 0, this.blocker = chunk_544df5aa_js_1.GESTURE_CONTROLLER.createBlocker({ disableScroll: !0 }), this.isAnimating = !1, this._isOpen = !1, this.isPaneVisible = !1, this.isEndSide = !1, this.disabled = !1, this.side = "start", this.swipeGesture = !0, this.maxEdgeStart = 50; } return t.prototype.typeChanged = function (t, e) { var n = this.contentEl; n && (void 0 !== e && n.classList.remove("menu-content-" + e), n.classList.add("menu-content-" + t), n.removeAttribute("style")), this.menuInnerEl && this.menuInnerEl.removeAttribute("style"), this.animation = void 0; }, t.prototype.disabledChanged = function () { this.updateState(), this.ionMenuChange.emit({ disabled: this.disabled, open: this._isOpen }); }, t.prototype.sideChanged = function () { this.isEndSide = chunk_3488a752_js_1.f(this.win, this.side); }, t.prototype.swipeGestureChanged = function () { this.updateState(); }, t.prototype.componentWillLoad = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { var t, e, n, i, o, r = this; return tslib_1.__generator(this, function (s) { switch (s.label) {
    case 0: return void 0 === this.type && (this.type = this.config.get("menuType", "ios" === this.mode ? "reveal" : "overlay")), this.isServer ? (this.disabled = !0, [2]) : (e = this, [4, this.lazyMenuCtrl.componentOnReady().then(function (t) { return t._getInstance(); })]);
    case 1: return t = e.menuCtrl = s.sent(), n = this.el.parentNode, (i = void 0 !== this.contentId ? this.doc.getElementById(this.contentId) : n && n.querySelector && n.querySelector("[main]")) && i.tagName ? (this.contentEl = i, i.classList.add("menu-content"), this.typeChanged(this.type, void 0), this.sideChanged(), t._register(this), o = this, [4, Promise.resolve().then(function () { return require("./chunk-544df5aa.js"); })]) : (console.error('Menu: must have a "content" element to listen for drag events on.'), [2]);
    case 2: return o.gesture = s.sent().createGesture({ el: this.doc, queue: this.queue, gestureName: "menu-swipe", gesturePriority: 30, threshold: 10, canStart: function (t) { return r.canStart(t); }, onWillStart: function () { return r.onWillStart(); }, onStart: function () { return r.onStart(); }, onMove: function (t) { return r.onMove(t); }, onEnd: function (t) { return r.onEnd(t); } }), this.updateState(), [2];
} }); }); }, t.prototype.componentDidLoad = function () { this.ionMenuChange.emit({ disabled: this.disabled, open: this._isOpen }); }, t.prototype.componentDidUnload = function () { this.blocker.destroy(), this.menuCtrl._unregister(this), this.animation && this.animation.destroy(), this.gesture && (this.gesture.destroy(), this.gesture = void 0), this.animation = void 0, this.contentEl = this.backdropEl = this.menuInnerEl = void 0; }, t.prototype.onSplitPaneChanged = function (t) { this.isPaneVisible = t.detail.isPane(this.el), this.updateState(); }, t.prototype.onBackdropClick = function (t) { this.lastOnEnd < t.timeStamp - 100 && t.composedPath && !t.composedPath().includes(this.menuInnerEl) && (t.preventDefault(), t.stopPropagation(), this.close()); }, t.prototype.isOpen = function () { return Promise.resolve(this._isOpen); }, t.prototype.isActive = function () { return Promise.resolve(this._isActive()); }, t.prototype.open = function (t) { return void 0 === t && (t = !0), this.setOpen(!0, t); }, t.prototype.close = function (t) { return void 0 === t && (t = !0), this.setOpen(!1, t); }, t.prototype.toggle = function (t) { return void 0 === t && (t = !0), this.setOpen(!this._isOpen, t); }, t.prototype.setOpen = function (t, e) { return void 0 === e && (e = !0), this.menuCtrl._setOpen(this, t, e); }, t.prototype._setOpen = function (t, e) { return void 0 === e && (e = !0), tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (n) { switch (n.label) {
    case 0: return !this._isActive() || this.isAnimating || t === this._isOpen ? [2, !1] : (this.beforeAnimation(t), [4, this.loadAnimation()]);
    case 1: return n.sent(), [4, this.startAnimation(t, e)];
    case 2: return n.sent(), this.afterAnimation(t), [2, !0];
} }); }); }, t.prototype.loadAnimation = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { var t, e; return tslib_1.__generator(this, function (n) { switch (n.label) {
    case 0: return (t = this.menuInnerEl.offsetWidth) === this.width && void 0 !== this.animation ? [2] : (this.width = t, this.animation && (this.animation.destroy(), this.animation = void 0), e = this, [4, this.menuCtrl._createAnimation(this.type, this)]);
    case 1: return e.animation = n.sent(), [2];
} }); }); }, t.prototype.startAnimation = function (t, e) { return tslib_1.__awaiter(this, void 0, void 0, function () { var n; return tslib_1.__generator(this, function (i) { switch (i.label) {
    case 0: return n = this.animation.reverse(!t), e ? [4, n.playAsync()] : [3, 2];
    case 1: return i.sent(), [3, 3];
    case 2: n.playSync(), i.label = 3;
    case 3: return [2];
} }); }); }, t.prototype._isActive = function () { return !this.disabled && !this.isPaneVisible; }, t.prototype.canSwipe = function () { return this.swipeGesture && !this.isAnimating && this._isActive(); }, t.prototype.canStart = function (t) { return !!this.canSwipe() && (!!this._isOpen || !this.menuCtrl.getOpenSync() && checkEdgeSide(this.win, t.currentX, this.isEndSide, this.maxEdgeStart)); }, t.prototype.onWillStart = function () { return this.beforeAnimation(!this._isOpen), this.loadAnimation(); }, t.prototype.onStart = function () { this.isAnimating && this.animation && this.animation.reverse(this._isOpen).progressStart(); }, t.prototype.onMove = function (t) { if (this.isAnimating && this.animation) {
    var e = computeDelta(t.deltaX, this._isOpen, this.isEndSide);
    this.animation.progressStep(e / this.width);
} }, t.prototype.onEnd = function (t) { var e = this; if (this.isAnimating && this.animation) {
    var n = this._isOpen, i = this.isEndSide, o = computeDelta(t.deltaX, n, i), r = this.width, s = o / r, a = t.velocityX, u = r / 2, l = a >= 0 && (a > .2 || t.deltaX > u), c = a <= 0 && (a < -.2 || t.deltaX < -u), h = n ? i ? l : c : i ? c : l, d = !n && h;
    n && !h && (d = !0);
    var p = (h ? 1 - s : s) * r, m = 0;
    if (p > 5) {
        var f = p / Math.abs(a);
        m = Math.min(f, 300);
    }
    this.lastOnEnd = t.timeStamp, this.animation.onFinish(function () { return e.afterAnimation(d); }, { clearExistingCallbacks: !0, oneTimeCallback: !0 }).progressEnd(h, s, m);
} }, t.prototype.beforeAnimation = function (t) { this.el.classList.add(SHOW_MENU), this.backdropEl && this.backdropEl.classList.add(SHOW_BACKDROP), this.blocker.block(), this.isAnimating = !0, t ? this.ionWillOpen.emit() : this.ionWillClose.emit(); }, t.prototype.afterAnimation = function (t) { this._isOpen = t, this.isAnimating = !1, this._isOpen || this.blocker.unblock(), this.enableListener(this, "click", t), t ? (this.contentEl && this.contentEl.classList.add(MENU_CONTENT_OPEN), this.ionDidOpen.emit()) : (this.el.classList.remove(SHOW_MENU), this.contentEl && this.contentEl.classList.remove(MENU_CONTENT_OPEN), this.backdropEl && this.backdropEl.classList.remove(SHOW_BACKDROP), this.ionDidClose.emit()); }, t.prototype.updateState = function () { var t = this._isActive(); this.gesture && this.gesture.setDisabled(!t || !this.swipeGesture), !t && this._isOpen && this.forceClosing(), !this.disabled && this.menuCtrl && this.menuCtrl._setActiveMenu(this); }, t.prototype.forceClosing = function () { this.isAnimating = !0, this.animation.reverse(!0).playSync(), this.afterAnimation(!1); }, t.prototype.hostData = function () { var t, e = this.isEndSide, n = this.type, i = this.disabled, o = this.isPaneVisible; return { role: "complementary", class: (t = {}, t["" + this.mode] = !0, t["menu-type-" + n] = !0, t["menu-enabled"] = !i, t["menu-side-end"] = e, t["menu-side-start"] = !e, t["menu-pane-visible"] = o, t) }; }, t.prototype.render = function () { var t = this; return [webmapgl_core_js_1.h("div", { class: "menu-inner", ref: function (e) { return t.menuInnerEl = e; } }, webmapgl_core_js_1.h("slot", null)), webmapgl_core_js_1.h("ion-backdrop", { ref: function (e) { return t.backdropEl = e; }, class: "menu-backdrop", tappable: !1, stopPropagation: !1 })]; }, Object.defineProperty(t, "is", { get: function () { return "ion-menu"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "encapsulation", { get: function () { return "shadow"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "properties", { get: function () { return { close: { method: !0 }, config: { context: "config" }, contentId: { type: String, attr: "content-id" }, disabled: { type: Boolean, attr: "disabled", mutable: !0, watchCallbacks: ["disabledChanged"] }, doc: { context: "document" }, el: { elementRef: !0 }, enableListener: { context: "enableListener" }, isActive: { method: !0 }, isEndSide: { state: !0 }, isOpen: { method: !0 }, isPaneVisible: { state: !0 }, isServer: { context: "isServer" }, lazyMenuCtrl: { connect: "ion-menu-controller" }, maxEdgeStart: { type: Number, attr: "max-edge-start" }, menuId: { type: String, attr: "menu-id" }, open: { method: !0 }, queue: { context: "queue" }, setOpen: { method: !0 }, side: { type: String, attr: "side", reflectToAttr: !0, watchCallbacks: ["sideChanged"] }, swipeGesture: { type: Boolean, attr: "swipe-gesture", watchCallbacks: ["swipeGestureChanged"] }, toggle: { method: !0 }, type: { type: String, attr: "type", mutable: !0, watchCallbacks: ["typeChanged"] }, win: { context: "window" } }; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "events", { get: function () { return [{ name: "ionWillOpen", method: "ionWillOpen", bubbles: !0, cancelable: !0, composed: !0 }, { name: "ionWillClose", method: "ionWillClose", bubbles: !0, cancelable: !0, composed: !0 }, { name: "ionDidOpen", method: "ionDidOpen", bubbles: !0, cancelable: !0, composed: !0 }, { name: "ionDidClose", method: "ionDidClose", bubbles: !0, cancelable: !0, composed: !0 }, { name: "ionMenuChange", method: "ionMenuChange", bubbles: !0, cancelable: !0, composed: !0 }]; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "listeners", { get: function () { return [{ name: "body:ionSplitPaneVisible", method: "onSplitPaneChanged" }, { name: "click", method: "onBackdropClick", capture: !0, disabled: !0 }]; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "style", { get: function () { return ":host{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color,#fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}:host(.show-menu){display:block}.menu-inner{left:0;right:auto;top:0;bottom:0;-webkit-transform:translate3d(-9999px,0,0);transform:translate3d(-9999px,0,0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}:host-context([dir=rtl]) .menu-inner,[dir=rtl] .menu-inner{left:unset;right:unset;left:auto;right:0;-webkit-transform:translate3d(calc(-1 * -9999px),0,0);transform:translate3d(calc(-1 * -9999px),0,0)}:host(.menu-side-start) .menu-inner{--ion-safe-area-right:0px;right:auto;left:0}:host(.menu-side-end) .menu-inner{--ion-safe-area-left:0px;right:0;left:auto}ion-backdrop{display:none;opacity:.01;z-index:-1}\@media (max-width:340px){.menu-inner{--width:264px}}:host(.menu-type-reveal){z-index:0}:host(.menu-type-reveal.show-menu) .menu-inner{-webkit-transform:translateZ(0);transform:translateZ(0)}:host(.menu-type-overlay){z-index:80}:host(.menu-type-overlay) .show-backdrop{display:block;cursor:pointer}:host(.menu-pane-visible) .menu-inner{left:0;right:0;width:auto;-webkit-transform:none!important;transform:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}:host(.menu-pane-visible) ion-backdrop{display:hidden!important}:host(.menu-type-push){z-index:80}:host(.menu-type-push) .show-backdrop{display:block}"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "styleMode", { get: function () { return "ios"; }, enumerable: !0, configurable: !0 }), t; }();
exports.IonFooter = Footer;
exports.IonMenu = Menu;
function computeDelta(t, e, n) { return Math.max(0, e !== n ? -t : t); }
function checkEdgeSide(t, e, n, i) { return n ? e >= t.innerWidth - i : e <= i; }
var SHOW_MENU = "show-menu", SHOW_BACKDROP = "show-backdrop", MENU_CONTENT_OPEN = "menu-content-open";
function baseAnimation(t) { return Promise.resolve((new t).easing("cubic-bezier(0.0, 0.0, 0.2, 1)").easingReverse("cubic-bezier(0.4, 0.0, 0.6, 1)").duration(300)); }
var BOX_SHADOW_WIDTH = 8;
function menuOverlayAnimation(t, e, n) { var i, o, r = n.width + BOX_SHADOW_WIDTH; n.isEndSide ? (i = r + "px", o = "0px") : (i = -r + "px", o = "0px"); var s = (new t).addElement(n.menuInnerEl).fromTo("translateX", i, o), a = (new t).addElement(n.backdropEl).fromTo("opacity", .01, .32); return baseAnimation(t).then(function (t) { return t.add(s).add(a); }); }
function menuPushAnimation(t, e, n) { var i, o, r = n.width; n.isEndSide ? (i = -r + "px", o = r + "px") : (i = r + "px", o = -r + "px"); var s = (new t).addElement(n.menuInnerEl).fromTo("translateX", o, "0px"), a = (new t).addElement(n.contentEl).fromTo("translateX", "0px", i), u = (new t).addElement(n.backdropEl).fromTo("opacity", .01, .32); return baseAnimation(t).then(function (t) { return t.add(s).add(u).add(a); }); }
function menuRevealAnimation(t, e, n) { var i = n.width * (n.isEndSide ? -1 : 1) + "px", o = (new t).addElement(n.contentEl).fromTo("translateX", "0px", i); return baseAnimation(t).then(function (t) { return t.add(o); }); }
var MenuController = function () { function t() { this.menus = [], this.menuAnimations = new Map, this.registerAnimation("reveal", menuRevealAnimation), this.registerAnimation("push", menuPushAnimation), this.registerAnimation("overlay", menuOverlayAnimation); } return t.prototype.open = function (t) { return tslib_1.__awaiter(this, void 0, void 0, function () { var e; return tslib_1.__generator(this, function (n) { switch (n.label) {
    case 0: return [4, this.get(t)];
    case 1: return (e = n.sent()) ? [2, e.open()] : [2, !1];
} }); }); }, t.prototype.close = function (t) { return tslib_1.__awaiter(this, void 0, void 0, function () { var e; return tslib_1.__generator(this, function (n) { switch (n.label) {
    case 0: return [4, void 0 !== t ? this.get(t) : this.getOpen()];
    case 1: return void 0 !== (e = n.sent()) ? [2, e.close()] : [2, !1];
} }); }); }, t.prototype.toggle = function (t) { return tslib_1.__awaiter(this, void 0, void 0, function () { var e; return tslib_1.__generator(this, function (n) { switch (n.label) {
    case 0: return [4, this.get(t)];
    case 1: return (e = n.sent()) ? [2, e.toggle()] : [2, !1];
} }); }); }, t.prototype.enable = function (t, e) { return tslib_1.__awaiter(this, void 0, void 0, function () { var n; return tslib_1.__generator(this, function (i) { switch (i.label) {
    case 0: return [4, this.get(e)];
    case 1: return (n = i.sent()) && (n.disabled = !t), [2, n];
} }); }); }, t.prototype.swipeGesture = function (t, e) { return tslib_1.__awaiter(this, void 0, void 0, function () { var n; return tslib_1.__generator(this, function (i) { switch (i.label) {
    case 0: return [4, this.get(e)];
    case 1: return (n = i.sent()) && (n.swipeGesture = t), [2, n];
} }); }); }, t.prototype.isOpen = function (t) { return tslib_1.__awaiter(this, void 0, void 0, function () { var e; return tslib_1.__generator(this, function (n) { switch (n.label) {
    case 0: return null == t ? [3, 2] : [4, this.get(t)];
    case 1: return [2, void 0 !== (e = n.sent()) && e.isOpen()];
    case 2: return [4, this.getOpen()];
    case 3: return [2, void 0 !== (e = n.sent())];
} }); }); }, t.prototype.isEnabled = function (t) { return tslib_1.__awaiter(this, void 0, void 0, function () { var e; return tslib_1.__generator(this, function (n) { switch (n.label) {
    case 0: return [4, this.get(t)];
    case 1: return (e = n.sent()) ? [2, !e.disabled] : [2, !1];
} }); }); }, t.prototype.get = function (t) { return tslib_1.__awaiter(this, void 0, void 0, function () { var e, n; return tslib_1.__generator(this, function (i) { switch (i.label) {
    case 0: return [4, this.waitUntilReady()];
    case 1: return i.sent(), "start" === t || "end" === t ? (e = this.find(function (e) { return e.side === t && !e.disabled; })) ? [2, e] : [2, this.find(function (e) { return e.side === t; })] : null != t ? [2, this.find(function (e) { return e.menuId === t; })] : (n = this.find(function (t) { return !t.disabled; })) ? [2, n] : [2, this.menus.length > 0 ? this.menus[0].el : void 0];
} }); }); }, t.prototype.getOpen = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (t) { switch (t.label) {
    case 0: return [4, this.waitUntilReady()];
    case 1: return t.sent(), [2, this.getOpenSync()];
} }); }); }, t.prototype.getMenus = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (t) { switch (t.label) {
    case 0: return [4, this.waitUntilReady()];
    case 1: return t.sent(), [2, this.getMenusSync()];
} }); }); }, t.prototype.isAnimating = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (t) { switch (t.label) {
    case 0: return [4, this.waitUntilReady()];
    case 1: return t.sent(), [2, this.isAnimatingSync()];
} }); }); }, t.prototype.registerAnimation = function (t, e) { this.menuAnimations.set(t, e); }, t.prototype._getInstance = function () { return Promise.resolve(this); }, t.prototype._register = function (t) { var e = this.menus; e.indexOf(t) < 0 && (t.disabled || this._setActiveMenu(t), e.push(t)); }, t.prototype._unregister = function (t) { var e = this.menus.indexOf(t); e > -1 && this.menus.splice(e, 1); }, t.prototype._setActiveMenu = function (t) { var e = t.side; this.menus.filter(function (n) { return n.side === e && n !== t; }).forEach(function (t) { return t.disabled = !0; }); }, t.prototype._setOpen = function (t, e, n) { return tslib_1.__awaiter(this, void 0, void 0, function () { var i; return tslib_1.__generator(this, function (o) { switch (o.label) {
    case 0: return this.isAnimatingSync() ? [2, !1] : e ? [4, this.getOpen()] : [3, 3];
    case 1: return (i = o.sent()) && t.el !== i ? [4, i.setOpen(!1, !1)] : [3, 3];
    case 2: o.sent(), o.label = 3;
    case 3: return [2, t._setOpen(e, n)];
} }); }); }, t.prototype._createAnimation = function (t, e) { return tslib_1.__awaiter(this, void 0, void 0, function () { var n, i; return tslib_1.__generator(this, function (o) { switch (o.label) {
    case 0:
        if (!(n = this.menuAnimations.get(t)))
            throw new Error("animation not registered");
        return [4, Promise.resolve().then(function () { return require("./chunk-3532a9eb.js"); }).then(function (t) { return t.create(n, null, e); })];
    case 1: return i = o.sent(), this.config.getBoolean("animated", !0) || i.duration(0), [2, i];
} }); }); }, t.prototype.getOpenSync = function () { return this.find(function (t) { return t._isOpen; }); }, t.prototype.getMenusSync = function () { return this.menus.map(function (t) { return t.el; }); }, t.prototype.isAnimatingSync = function () { return this.menus.some(function (t) { return t.isAnimating; }); }, t.prototype.find = function (t) { var e = this.menus.find(t); if (void 0 !== e)
    return e.el; }, t.prototype.waitUntilReady = function () { return Promise.all(Array.from(this.doc.querySelectorAll("ion-menu")).map(function (t) { return t.componentOnReady(); })); }, Object.defineProperty(t, "is", { get: function () { return "ion-menu-controller"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "properties", { get: function () { return { _getInstance: { method: !0 }, close: { method: !0 }, config: { context: "config" }, doc: { context: "document" }, enable: { method: !0 }, get: { method: !0 }, getMenus: { method: !0 }, getOpen: { method: !0 }, isAnimating: { method: !0 }, isEnabled: { method: !0 }, isOpen: { method: !0 }, open: { method: !0 }, registerAnimation: { method: !0 }, swipeGesture: { method: !0 }, toggle: { method: !0 } }; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "style", { get: function () { return ".menu-content{-webkit-transform:translateZ(0);transform:translateZ(0)}.menu-content-open{cursor:pointer;-ms-touch-action:manipulation;touch-action:manipulation;pointer-events:none}.ios .menu-content-reveal{-webkit-box-shadow:-8px 0 42px rgba(0,0,0,.08);box-shadow:-8px 0 42px rgba(0,0,0,.08)}[dir=rtl].ios .menu-content-reveal{-webkit-box-shadow:8px 0 42px rgba(0,0,0,.08);box-shadow:8px 0 42px rgba(0,0,0,.08)}.md .menu-content-push,.md .menu-content-reveal{-webkit-box-shadow:0 2px 22px 0 rgba(0,0,0,.09),4px 0 16px 0 rgba(0,0,0,.18);box-shadow:0 2px 22px 0 rgba(0,0,0,.09),4px 0 16px 0 rgba(0,0,0,.18)}"; }, enumerable: !0, configurable: !0 }), t; }(), MenuToggle = function () { function t() { this.visible = !1, this.autoHide = !0; } return t.prototype.componentDidLoad = function () { return this.updateVisibility(); }, t.prototype.onClick = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { var t; return tslib_1.__generator(this, function (e) { switch (e.label) {
    case 0: return [4, getMenuController(this.doc)];
    case 1: return (t = e.sent()) ? [4, t.get(this.menu)] : [3, 3];
    case 2: e.sent() && t.toggle(this.menu), e.label = 3;
    case 3: return [2];
} }); }); }, t.prototype.updateVisibility = function () { return tslib_1.__awaiter(this, void 0, void 0, function () { var t, e, n; return tslib_1.__generator(this, function (i) { switch (i.label) {
    case 0: return [4, getMenuController(this.doc)];
    case 1: return (t = i.sent()) ? [4, t.get(this.menu)] : [3, 5];
    case 2: return e = i.sent(), (n = e) ? [4, e.isActive()] : [3, 4];
    case 3: n = i.sent(), i.label = 4;
    case 4:
        if (n)
            return this.visible = !0, [2];
        i.label = 5;
    case 5: return this.visible = !1, [2];
} }); }); }, t.prototype.hostData = function () { var t, e = this.autoHide && !this.visible; return { "aria-hidden": e ? "true" : null, class: (t = {}, t["" + this.mode] = !0, t["menu-toggle-hidden"] = e, t) }; }, t.prototype.render = function () { return webmapgl_core_js_1.h("slot", null); }, Object.defineProperty(t, "is", { get: function () { return "ion-menu-toggle"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "encapsulation", { get: function () { return "shadow"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "properties", { get: function () { return { autoHide: { type: Boolean, attr: "auto-hide" }, doc: { context: "document" }, menu: { type: String, attr: "menu" }, visible: { state: !0 } }; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "listeners", { get: function () { return [{ name: "click", method: "onClick" }, { name: "body:ionMenuChange", method: "updateVisibility" }, { name: "body:ionSplitPaneVisible", method: "updateVisibility" }]; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "style", { get: function () { return ":host(.menu-toggle-hidden){display:none}"; }, enumerable: !0, configurable: !0 }), t; }();
exports.IonMenuController = MenuController;
exports.IonMenuToggle = MenuToggle;
function getMenuController(t) { var e = t.querySelector("ion-menu-controller"); return e ? e.componentOnReady() : Promise.resolve(void 0); }
var SPLIT_PANE_MAIN = "split-pane-main", SPLIT_PANE_SIDE = "split-pane-side", QUERY = { xs: "(min-width: 0px)", sm: "(min-width: 576px)", md: "(min-width: 768px)", lg: "(min-width: 992px)", xl: "(min-width: 1200px)", never: "" }, SplitPane = function () { function t() { this.visible = !1, this.disabled = !1, this.when = QUERY.lg; } return t.prototype.visibleChanged = function (t) { var e = { visible: t, isPane: this.isPane.bind(this) }; this.ionSplitPaneVisible.emit(e); }, t.prototype.componentDidLoad = function () { this.styleChildren(), this.updateState(); }, t.prototype.componentDidUnload = function () { this.rmL && (this.rmL(), this.rmL = void 0); }, t.prototype.updateState = function () { var t = this; if (!this.isServer)
    if (this.rmL && (this.rmL(), this.rmL = void 0), this.disabled)
        this.visible = !1;
    else {
        var e = this.when;
        if ("boolean" != typeof e) {
            var n = QUERY[e] || e;
            if (0 !== n.length) {
                if (this.win.matchMedia) {
                    var i = function (e) { t.visible = e.matches; }, o = this.win.matchMedia(n);
                    o.addListener(i), this.rmL = function () { return o.removeListener(i); }, this.visible = o.matches;
                }
            }
            else
                this.visible = !1;
        }
        else
            this.visible = e;
    } }, t.prototype.isPane = function (t) { return !!this.visible && t.parentElement === this.el && t.classList.contains(SPLIT_PANE_SIDE); }, t.prototype.styleChildren = function () { if (!this.isServer) {
    for (var t = this.contentId, e = this.el.children, n = this.el.childElementCount, i = !1, o = 0; o < n; o++) {
        var r = e[o], s = void 0 !== t ? r.id === t : r.hasAttribute("main");
        if (s) {
            if (i)
                return void console.warn("split pane cannot have more than one main node");
            i = !0;
        }
        setPaneClass(r, s);
    }
    i || console.warn("split pane does not have a specified main node");
} }, t.prototype.hostData = function () { var t; return { class: (t = {}, t["" + this.mode] = !0, t["split-pane-" + this.mode] = !0, t["split-pane-visible"] = this.visible, t) }; }, Object.defineProperty(t, "is", { get: function () { return "ion-split-pane"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "properties", { get: function () { return { contentId: { type: String, attr: "content-id" }, disabled: { type: Boolean, attr: "disabled", watchCallbacks: ["updateState"] }, el: { elementRef: !0 }, isServer: { context: "isServer" }, visible: { state: !0, watchCallbacks: ["visibleChanged"] }, when: { type: "Any", attr: "when", watchCallbacks: ["updateState"] }, win: { context: "window" } }; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "events", { get: function () { return [{ name: "ionSplitPaneVisible", method: "ionSplitPaneVisible", bubbles: !0, cancelable: !0, composed: !0 }]; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "style", { get: function () { return "ion-split-pane{left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}.split-pane-visible>.split-pane-main,.split-pane-visible>.split-pane-side{left:0;right:0;top:0;bottom:0;position:relative;-ms-flex:1;flex:1;-webkit-box-shadow:none!important;box-shadow:none!important;z-index:0}.split-pane-visible>.split-pane-side:not(ion-menu),.split-pane-visible>ion-menu.split-pane-side.menu-enabled{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0}.split-pane-side:not(ion-menu){display:none}.split-pane-visible>.split-pane-side{-ms-flex-order:-1;order:-1}.split-pane-visible>.split-pane-side[side=end]{-ms-flex-order:1;order:1}.split-pane-ios{--border:0.55px solid var(--ion-item-border-color,var(--ion-border-color,var(--ion-color-step-150,#c8c7cc)))}.split-pane-ios.split-pane-visible>.split-pane-side{min-width:270px;max-width:28%;border-right:var(--border);border-left:0}.split-pane-ios.split-pane-visible>.split-pane-side[side=end]{min-width:270px;max-width:28%;border-right:0;border-left:var(--border)}"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "styleMode", { get: function () { return "ios"; }, enumerable: !0, configurable: !0 }), t; }();
exports.IonSplitPane = SplitPane;
function setPaneClass(t, e) { var n, i; e ? (n = SPLIT_PANE_MAIN, i = SPLIT_PANE_SIDE) : (n = SPLIT_PANE_SIDE, i = SPLIT_PANE_MAIN); var o = t.classList; o.add(n), o.remove(i); }
