PageSourceSearch

https://www.downtownlouisvilleco.com/site-content/themes/fivesquar…/js/navigation-view-modal.js?ver=6.9.9

js downtownlouisvilleco.com collected 2026-10-02 17:52:03 UTC 11,922 bytes, 202 lines download raw bytes

vendor: 8,939 bytes, lines 1-151
1!function () {
2    "use strict";
3
4    function e(e, t) {
5        for (var o = 0; o < t.length; o++) {
6            var n = t[o];
7            n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n)
8        }
9    }
10
11    function t(e) {
12        return function (e) {
13            if (Array.isArray(e)) return o(e)
14        }(e) || function (e) {
15            if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e)
16        }(e) || function (e, t) {
17            if (e) {
18                if ("string" == typeof e) return o(e, t);
19                var n = Object.prototype.toString.call(e).slice(8, -1);
20                return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? o(e, t) : void 0
21            }
22        }(e) || function () {
23            throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
24        }()
25    }
26
27    function o(e, t) {
28        (null == t || t > e.length) && (t = e.length);
29        for (var o = 0, n = new Array(t); o < t; o++) n[o] = e[o];
30        return n
31    }
32
33    var n, i, a, r, s,
34        l = (n = ["a[href]", "area[href]", 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', "select:not([disabled]):not([aria-hidden])", "textarea:not([disabled]):not([aria-hidden])", "button:not([disabled]):not([aria-hidden])", "iframe", "object", "embed", "[contenteditable]", '[tabindex]:not([tabindex^="-"])'], i = function () {
35            function o(e) {
36                var n = e.targetModal, i = e.triggers,
37                    a = void 0 === i ? [] : i, r = e.onShow,
38                    s = void 0 === r ? function () {
39                    } : r, l = e.onClose, c = void 0 === l ? function () {
40                    } : l, d = e.openTrigger,
41                    u = void 0 === d ? "data-micromodal-trigger" : d,
42                    f = e.closeTrigger,
43                    h = void 0 === f ? "data-micromodal-close" : f,
44                    v = e.openClass, g = void 0 === v ? "is-open" : v,
45                    m = e.disableScroll, b = void 0 !== m && m,
46                    y = e.disableFocus, p = void 0 !== y && y,
47                    w = e.awaitCloseAnimation, k = void 0 !== w && w,
48                    E = e.awaitOpenAnimation, A = void 0 !== E && E,
49                    C = e.debugMode, L = void 0 !== C && C;
50                !function (e, t) {
51                    if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
52                }(this, o), this.modal = document.getElementById(n), this.config = {debugMode: L, disableScroll: b, openTrigger: u, closeTrigger: h, openClass: g, onShow: s, onClose: c, awaitCloseAnimation: k, awaitOpenAnimation: A, disableFocus: p}, a.length > 0 && this.registerTriggers.apply(this, t(a)), this.onClick = this.onClick.bind(this), this.onKeydown = this.onKeydown.bind(this)
53            }
54
55            var i, a;
56            return i = o, (a = [{
57                key: "registerTriggers", value: function () {
58                    for (var e = this, t = arguments.length, o = new Array(t), n = 0; n < t; n++) o[n] = arguments[n];
59                    o.filter(Boolean).forEach((function (t) {
60                        t.addEventListener("click", (function (t) {
61                            return e.showModal(t)
62                        }))
63                    }))
64                }
65            }, {
66                key: "showModal", value: function () {
67                    var e = this,
68                        t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null;
69                    if (this.activeElement = document.activeElement, this.modal.setAttribute("aria-hidden", "false"), this.modal.classList.add(this.config.openClass), this.scrollBehaviour("disable"), this.addEventListeners(), this.config.awaitOpenAnimation) {
70                        var o = function t() {
71                            e.modal.removeEventListener("animationend", t, !1), e.setFocusToFirstNode()
72                        };
73                        this.modal.addEventListener("animationend", o, !1)
74                    } else this.setFocusToFirstNode();
75                    this.config.onShow(this.modal, this.activeElement, t)
76                }
77            }, {
78                key: "closeModal", value: function () {
79                    var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null,
80                        t = this.modal;
81                    if (this.modal.setAttribute("aria-hidden", "true"), this.removeEventListeners(), this.scrollBehaviour("enable"), this.activeElement && this.activeElement.focus && this.activeElement.focus(), this.config.onClose(this.modal, this.activeElement, e), this.config.awaitCloseAnimation) {
82                        var o = this.config.openClass;
83                        this.modal.addEventListener("animationend", (function e() {
84                            t.classList.remove(o), t.removeEventListener("animationend", e, !1)
85                        }), !1)
86                    } else t.classList.remove(this.config.openClass)
87                }
88            }, {
89                key: "closeModalById", value: function (e) {
90                    this.modal = document.getElementById(e), this.modal && this.closeModal()
91                }
92            }, {
93                key: "scrollBehaviour", value: function (e) {
94                    if (this.config.disableScroll) {
95                        var t = document.querySelector("body");
96                        switch (e) {
97                            case"enable":
98                                Object.assign(t.style, {overflow: ""});
99                                break;
100                            case"disable":
101                                Object.assign(t.style, {overflow: "hidden"})
102                        }
103                    }
104                }
105            }, {
106                key: "addEventListeners", value: function () {
107                    this.modal.addEventListener("touchstart", this.onClick), this.modal.addEventListener("click", this.onClick), document.addEventListener("keydown", this.onKeydown)
108                }
109            }, {
110                key: "removeEventListeners", value: function () {
111                    this.modal.removeEventListener("touchstart", this.onClick), this.modal.removeEventListener("click", this.onClick), document.removeEventListener("keydown", this.onKeydown)
112                }
113            }, {
114                key: "onClick", value: function (e) {
115                    (e.target.hasAttribute(this.config.closeTrigger) || e.target.parentNode.hasAttribute(this.config.closeTrigger)) && (e.preventDefault(), e.stopPropagation(), this.closeModal(e))
116                }
117            }, {
118                key: "onKeydown", value: function (e) {
119                    27 === e.keyCode && this.closeModal(e), 9 === e.keyCode && this.retainFocus(e)
120                }
121            }, {
122                key: "getFocusableNodes", value: function () {
123                    var e = this.modal.querySelectorAll(n);
124                    return Array.apply(void 0, t(e))
125                }
126            }, {
127                key: "setFocusToFirstNode", value: function () {
128                    var e = this;
129                    if (!this.config.disableFocus) {
130                        var t = this.getFocusableNodes();
131                        if (0 !== t.length) {
132                            var o = t.filter((function (t) {
133                                return !t.hasAttribute(e.config.closeTrigger)
134                            }));
135                            o.length > 0 && o[0].focus(), 0 === o.length && t[0].focus()
136                        }
137                    }
138                }
139            }, {
140                key: "retainFocus", value: function (e) {
141                    var t = this.getFocusableNodes();
142                    if (0 !== t.length) if (t = t.filter((function (e) {
143                        return null !== e.offsetParent
144                    })), this.modal.contains(document.activeElement)) {
145                        var o = t.indexOf(document.activeElement);
146                        e.shiftKey && 0 === o && (t[t.length - 1].focus(), e.preventDefault()), !e.shiftKey && t.length > 0 && o === t.length - 1 && (t[0].focus(), e.preventDefault())
147                    } else t[0].focus()
148                }
149            }]) && e(i.prototype, a), o
150        }(), a = null, r = function (e) {
151            if (!document.getElementById(e)) return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e, "'"), "background-color: #f8f9fa;color: #50596c;font-weight: bold;", "ID somewhere in your code. Refer example below to resolve it."), c
151onsole.warn("%cExample:", "background-color: #f8f9fa;color: #50596c;font-weight: bold;", '<div class="modal" id="'.concat(e, '"></div>')), !1
152        }, s = function (e, t) {
153            if (function (e) {
154                e.length <= 0 && (console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'", "background-color: #f8f9fa;color: #50596c;font-weight: bold;", "data attribute."), console.warn("%cExample:", "background-color: #f8f9fa;color: #50596c;font-weight: bold;", '<a href="#" data-micromodal-trigger="my-modal"></a>'))
155            }(e), !t) return !0;
156            for (var o in t) r(o);
157            return !0
158        }, {
159            init: function (e) {
160                var o = Object.assign({}, {openTrigger: "data-micromodal-trigger"}, e),
161                    n = t(document.querySelectorAll("[".concat(o.openTrigger, "]"))),
162                    r = function (e, t) {
163                        var o = [];
164                        return e.forEach((function (e) {
165                            var n = e.attributes[t].value;
166                            void 0 === o[n] && (o[n] = []), o[n].push(e)
167                        })), o
168                    }(n, o.openTrigger);
169                if (!0 !== o.debugMode || !1 !== s(n, r)) for (var l in r) {
170                    var c = r[l];
171                    o.targetModal = l, o.triggers = t(c), a = new i(o)
172                }
173            }, show: function (e, t) {
174                var o = t || {};
175                o.targetModal = e, !0 === o.debugMode && !1 === r(e) || (a && a.removeEventListeners(), (a = new i(o)).showModal())
176            }, close: function (e) {
177                e ? a.closeModalById(e) : a.closeModal()
178            }
179        });
180    "undefined" != typeof window && (window.MicroModal = l);
181    var c = l;
182
183    function d(e) {
184        const t = e.querySelector(".wp-block-navigation__responsive-dialog"),
185              o = "true" === e.getAttribute("aria-hidden");
186        e.classList.toggle("has-modal-open", !o), t.toggleAttribute("aria-modal", !o), o ? (t.removeAttribute("role"), t.removeAttribute("aria-modal")) : (t.setAttribute("role", "dialog"), t.setAttribute("aria-modal", "true"));
187        document.documentElement.classList.toggle("has-modal-open")
188    }
189
190    window.addEventListener("load", (() => {
191        c.init({onShow: d, onClose: d, openClass: "is-menu-open"});
192        document.querySelectorAll(".wp-block-navigation-item__content").forEach((function (e) {
193            var t, o;
194            if (null === (t = e.getAttribute("href")) || void 0 === t || !t.startsWith("#") || "_blank" === (null === (o = e.attributes) || void 0 === o ? void 0 : o.target)) return;
195            const n = e.closest(".wp-block-navigation__responsive-container"),
196                  i = null == n ? void 0 : n.getAttribute("id");
197            e.addEventListener("click", (() => {
198                i && n.classList.contains("has-modal-open") && c.close(i)
199            }))
200        }))
201    }))
202}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.