(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// node_modules/aos/dist/aos.js
var require_aos = __commonJS({
"node_modules/aos/dist/aos.js"(exports, module) {
!function(e2, t3) {
"object" == typeof exports && "object" == typeof module ? module.exports = t3() : "function" == typeof define && define.amd ? define([], t3) : "object" == typeof exports ? exports.AOS = t3() : e2.AOS = t3();
}(exports, function() {
return function(e2) {
function t3(o) {
if (n2[o]) return n2[o].exports;
var i3 = n2[o] = { exports: {}, id: o, loaded: false };
return e2[o].call(i3.exports, i3, i3.exports, t3), i3.loaded = true, i3.exports;
}
var n2 = {};
return t3.m = e2, t3.c = n2, t3.p = "dist/", t3(0);
}([function(e2, t3, n2) {
"use strict";
function o(e3) {
return e3 && e3.__esModule ? e3 : { default: e3 };
}
var i3 = Object.assign || function(e3) {
for (var t4 = 1; t4 < arguments.length; t4++) {
var n3 = arguments[t4];
for (var o2 in n3) Object.prototype.hasOwnProperty.call(n3, o2) && (e3[o2] = n3[o2]);
}
return e3;
}, r = n2(1), a = (o(r), n2(6)), u = o(a), c = n2(7), s2 = o(c), f = n2(8), d3 = o(f), l = n2(9), p = o(l), m3 = n2(10), b = o(m3), v = n2(11), y3 = o(v), g = n2(14), h = o(g), w = [], k = false, x = { offset: 120, delay: 0, easing: "ease", duration: 400, disable: false, once: false, startEvent: "DOMContentLoaded", throttleDelay: 99, debounceDelay: 50, disableMutationObserver: false }, j = function() {
var e3 = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
if (e3 && (k = true), k) return w = (0, y3.default)(w, x), (0, b.default)(w, x.once), w;
}, O = function() {
w = (0, h.default)(), j();
}, M2 = function() {
w.forEach(function(e3, t4) {
e3.node.removeAttribute("data-aos"), e3.node.removeAttribute("data-aos-easing"), e3.node.removeAttribute("data-aos-duration"), e3.node.removeAttribute("data-aos-delay");
});
}, S = function(e3) {
return e3 === true || "mobile" === e3 && p.default.mobile() || "phone" === e3 && p.default.phone() || "tablet" === e3 && p.default.tablet() || "function" == typeof e3 && e3() === true;
}, _ = function(e3) {
x = i3(x, e3), w = (0, h.default)();
var t4 = document.all && !window.atob;
return S(x.disable) || t4 ? M2() : (x.disableMutationObserver || d3.default.isSupported() || (console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '), x.disableMutationObserver = true), document.querySelector("body").setAttribute("data-aos-easing", x.easing), document.querySelector("body").setAttribute("data-aos-duration", x.duration), document.querySelector("body").setAttribute("data-aos-delay", x.delay), "DOMContentLoaded" === x.startEvent && ["complete", "interactive"].indexOf(document.readyState) > -1 ? j(true) : "load" === x.startEvent ? window.addEventListener(x.startEvent, function() {
j(true);
}) : document.addEventListener(x.startEvent, function() {
j(true);
}), window.addEventListener("resize", (0, s2.default)(j, x.debounceDelay, true)), window.addEventListener("orientationchange", (0, s2.default)(j, x.debounceDelay, true)), window.addEventListener("scroll", (0, u.default)(function() {
(0, b.default)(w, x.once);
}, x.throttleDelay)), x.disableMutationObserver || d3.default.ready("[data-aos]", O), w);
};
e2.exports = { init: _, refresh: j, refreshHard: O };
}, function(e2, t3) {
}, , , , , function(e2, t3) {
(function(t4) {
"use strict";
function n2(e3, t5, n3) {
function o2(t6) {
var n4 = b2, o3 = v2;
return b2 = v2 = void 0, k2 = t6, g2 = e3.apply(o3, n4);
}
function r2(e4) {
return k2 = e4, h2 = setTimeout(f2, t5), M2 ? o2(e4) : g2;
}
function a2(e4) {
var n4 = e4 - w2, o3 = e4 - k2, i4 = t5 - n4;
return S ? j(i4, y4 - o3) : i4;
}
function c2(e4) {
var n4 = e4 - w2, o3 = e4 - k2;
return void 0 === w2 || n4 >= t5 || n4 < 0 || S && o3 >= y4;
}
function f2() {
var e4 = O();
return c2(e4) ? d4(e4) : void (h2 = setTimeout(f2, a2(e4)));
}
function d4(e4) {
return h2 = void 0, _ && b2 ? o2(e4) : (b2 = v2 = void 0, g2);
}
function l2() {
void 0 !== h2 && clearTimeout(h2), k2 = 0, b2 = w2 = v2 = h2 = void 0;
}
function p2() {
return void 0 === h2 ? g2 : d4(O());
}
function m4() {
var e4 = O(), n4 = c2(e4);
if (b2 = arguments, v2 = this, w2 = e4, n4) {
if (void 0 === h2) return r2(w2);
if (S) return h2 = setTimeout(f2, t5), o2(w2);
}
return void 0 === h2 && (h2 = setTimeout(f2, t5)), g2;
}
var b2, v2, y4, g2, h2, w2, k2 = 0, M2 = false, S = false, _ = true;
if ("function" != typeof e3) throw new TypeError(s2);
return t5 = u(t5) || 0, i3(n3) && (M2 = !!n3.leading, S = "maxWait" in n3, y4 = S ? x(u(n3.maxWait) || 0, t5) : y4, _ = "trailing" in n3 ? !!n3.trailing : _), m4.cancel = l2, m4.flush = p2, m4;
}
function o(e3, t5, o2) {
var r2 = true, a2 = true;
if ("function" != typeof e3) throw new TypeError(s2);
return i3(o2) && (r2 = "leading" in o2 ? !!o2.leading : r2, a2 = "trailing" in o2 ? !!o2.trailing : a2), n2(e3, t5, { leading: r2, maxWait: t5, trailing: a2 });
}
function i3(e3) {
var t5 = "undefined" == typeof e3 ? "undefined" : c(e3);
return !!e3 && ("object" == t5 || "function" == t5);
}
function r(e3) {
return !!e3 && "object" == ("undefined" == typeof e3 ? "undefined" : c(e3));
}
function a(e3) {
return "symbol" == ("undefined" == typeof e3 ? "undefined" : c(e3)) || r(e3) && k.call(e3) == d3;
}
function u(e3) {
if ("number" == typeof e3) return e3;
if (a(e3)) return f;
if (i3(e3)) {
var t5 = "function" == typeof e3.valueOf ? e3.valueOf() : e3;
e3 = i3(t5) ? t5 + "" : t5;
}
if ("string" != typeof e3) return 0 === e3 ? e3 : +e3;
e3 = e3.replace(l, "");
var n3 = m3.test(e3);
return n3 || b.test(e3) ? v(e3.slice(2), n3 ? 2 : 8) : p.test(e3) ? f : +e3;
}
var c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) {
return typeof e3;
} : function(e3) {
return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3;
}, s2 = "Expected a function", f = NaN, d3 = "[object Symbol]", l = /^\s+|\s+$/g, p = /^[-+]0x[0-9a-f]+$/i, m3 = /^0b[01]+$/i, b = /^0o[0-7]+$/i, v = parseInt, y3 = "object" == ("undefined" == typeof t4 ? "undefined" : c(t4)) && t4 && t4.Object === Object && t4, g = "object" == ("undefined" == typeof self ? "undefined" : c(self)) && self && self.Object === Object && self, h = y3 || g || Function("return this")(), w = Object.prototype, k = w.toString, x = Math.max, j = Math.min, O = function() {
return h.Date.now();
};
e2.exports = o;
}).call(t3, /* @__PURE__ */ function() {
return this;
}());
}, function(e2, t3) {
(function(t4) {
"use strict";
function n2(e3, t5, n3) {
function i4(t6) {
var n4 = b2, o2 = v2;
return b2 = v2 = void 0, O = t6, g2 = e3.apply(o2, n4);
}
function r2(e4) {
return O = e4, h2 = setTimeout(f2, t5), M2 ? i4(e4) : g2;
}
function u2(e4) {
var n4 = e4 - w2, o2 = e4 - O, i5 = t5 - n4;
return S ? x(i5, y4 - o2) : i5;
}
function s3(e4) {
var n4 = e4 - w2, o2 = e4 - O;
return void 0 === w2 || n4 >= t5 || n4 < 0 || S && o2 >= y4;
}
function f2() {
var e4 = j();
return s3(e4) ? d4(e4) : void (h2 = setTimeout(f2, u2(e4)));
}
function d4(e4) {
return h2 = void 0, _ && b2 ? i4(e4) : (b2 = v2 = void 0, g2);
}
function l2() {
void 0 !== h2 && clearTimeout(h2), O = 0, b2 = w2 = v2 = h2 = void 0;
}
function p2() {
return void 0 === h2 ? g2 : d4(j());
}
function m4() {
var e4 = j(), n4 = s3(e4);
if (b2 = arguments, v2 = this, w2 = e4, n4) {
if (void 0 === h2) return r2(w2);
if (S) return h2 = setTimeout(f2, t5), i4(w2);
}
return void 0 === h2 && (h2 = setTimeout(f2, t5)), g2;
}
var b2, v2, y4, g2, h2, w2, O = 0, M2 = false, S = false, _ = true;
if ("function" != typeof e3) throw new TypeError(c);
return t5 = a(t5) || 0, o(n3) && (M2 = !!n3.leading, S = "maxWait" in n3, y4 = S ? k(a(n3.maxWait) || 0, t5) : y4, _ = "trailing" in n3 ? !!n3.trailing : _), m4.cancel = l2, m4.flush = p2, m4;
}
function o(e3) {
var t5 = "undefined" == typeof e3 ? "undefined" : u(e3);
return !!e3 && ("object" == t5 || "function" == t5);
}
function i3(e3) {
return !!e3 && "object" == ("undefined" == typeof e3 ? "undefined" : u(e3));
}
function r(e3) {
return "symbol" == ("undefined" == typeof e3 ? "undefined" : u(e3)) || i3(e3) && w.call(e3) == f;
}
function a(e3) {
if ("number" == typeof e3) return e3;
if (r(e3)) return s2;
if (o(e3)) {
var t5 = "function" == typeof e3.valueOf ? e3.valueOf() : e3;
e3 = o(t5) ? t5 + "" : t5;
}
if ("string" != typeof e3) return 0 === e3 ? e3 : +e3;
e3 = e3.replace(d3, "");
var n3 = p.test(e3);
return n3 || m3.test(e3) ? b(e3.slice(2), n3 ? 2 : 8) : l.test(e3) ? s2 : +e3;
}
var u = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) {
return typeof e3;
} : function(e3) {
return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3;
}, c = "Expected a function", s2 = NaN, f = "[object Symbol]", d3 = /^\s+|\s+$/g, l = /^[-+]0x[0-9a-f]+$/i, p = /^0b[01]+$/i, m3 = /^0o[0-7]+$/i, b = parseInt, v = "object" == ("undefined" == typeof t4 ? "undefined" : u(t4)) && t4 && t4.Object === Object && t4, y3 = "object" == ("undefined" == typeof self ? "undefined" : u(self)) && self && self.Object === Object && self, g = v || y3 || Function("return this")(), h = Object.prototype, w = h.toString, k = Math.max, x = Math.min, j = function() {
return g.Date.now();
};
e2.exports = n2;
}).call(t3, /* @__PURE__ */ function() {
return this;
}());
}, function(e2, t3) {
"use strict";
function n2(e3) {
var t4 = void 0, o2 = void 0, i4 = void 0;
for (t4 = 0; t4 < e3.length; t4 += 1) {
if (o2 = e3[t4], o2.dataset && o2.dataset.aos) return true;
if (i4 = o2.children && n2(o2.children)) return true;
}
return false;
}
function o() {
return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
}
function i3() {
return !!o();
}
function r(e3, t4) {
var n3 = window.document, i4 = o(), r2 = new i4(a);
u = t4, r2.observe(n3.documentElement, { childList: true, subtree: true, removedNodes: true });
}
function a(e3) {
e3 && e3.forEach(function(e4) {
var t4 = Array.prototype.slice.call(e4.addedNodes), o2 = Array.prototype.slice.call(e4.removedNodes), i4 = t4.concat(o2);
if (n2(i4)) return u();
});
}
Object.defineProperty(t3, "__esModule", { value: true });
var u = function() {
};
t3.default = { isSupported: i3, ready: r };
}, function(e2, t3) {
"use strict";
function n2(e3, t4) {
if (!(e3 instanceof t4)) throw new TypeError("Cannot call a class as a function");
}
function o() {
return navigator.userAgent || navigator.vendor || window.opera || "";
}
Object.defineProperty(t3, "__esModule", { value: true });
var i3 = /* @__PURE__ */ function() {
function e3(e4, t4) {
for (var n3 = 0; n3 < t4.length; n3++) {
var o2 = t4[n3];
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e4, o2.key, o2);
}
}
return function(t4, n3, o2) {
return n3 && e3(t4.prototype, n3), o2 && e3(t4, o2), t4;
};
}(), r = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i, a = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, u = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i, c = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, s2 = function() {
function e3() {
n2(this, e3);
}
return i3(e3, [{ key: "phone", value: function() {
var e4 = o();
return !(!r.test(e4) && !a.test(e4.substr(0, 4)));
} }, { key: "mobile", value: function() {
var e4 = o();
return !(!u.test(e4) && !c.test(e4.substr(0, 4)));
} }, { key: "tablet", value: function() {
return this.mobile() && !this.phone();
} }]), e3;
}();
t3.default = new s2();
}, function(e2, t3) {
"use strict";
Object.defineProperty(t3, "__esModule", { value: true });
var n2 = function(e3, t4, n3) {
var o2 = e3.node.getAttribute("data-aos-once");
t4 > e3.position ? e3.node.classList.add("aos-animate") : "undefined" != typeof o2 && ("false" === o2 || !n3 && "true" !== o2) && e3.node.classList.remove("aos-animate");
}, o = function(e3, t4) {
var o2 = window.pageYOffset, i3 = window.innerHeight;
e3.forEach(function(e4, r) {
n2(e4, i3 + o2, t4);
});
};
t3.default = o;
}, function(e2, t3, n2) {
"use strict";
function o(e3) {
return e3 && e3.__esModule ? e3 : { default: e3 };
}
Object.defineProperty(t3, "__esModule", { value: true });
var i3 = n2(12), r = o(i3), a = function(e3, t4) {
return e3.forEach(function(e4, n3) {
e4.node.classList.add("aos-init"), e4.position = (0, r.default)(e4.node, t4.offset);
}), e3;
};
t3.default = a;
}, function(e2, t3, n2) {
"use strict";
function o(e3) {
return e3 && e3.__esModule ? e3 : { default: e3 };
}
Object.defineProperty(t3, "__esModule", { value: true });
var i3 = n2(13), r = o(i3), a = function(e3, t4) {
var n3 = 0, o2 = 0, i4 = window.innerHeight, a2 = { offset: e3.getAttribute("data-aos-offset"), anchor: e3.getAttribute("data-aos-anchor"), anchorPlacement: e3.getAttribute("data-aos-anchor-placement") };
switch (a2.offset && !isNaN(a2.offset) && (o2 = parseInt(a2.offset)), a2.anchor && document.querySelectorAll(a2.anchor) && (e3 = document.querySelectorAll(a2.anchor)[0]), n3 = (0, r.default)(e3).top, a2.anchorPlacement) {
case "top-bottom":
break;
case "center-bottom":
n3 += e3.offsetHeight / 2;
break;
case "bottom-bottom":
n3 += e3.offsetHeight;
break;
case "top-center":
n3 += i4 / 2;
break;
case "bottom-center":
n3 += i4 / 2 + e3.offsetHeight;
break;
case "center-center":
n3 += i4 / 2 + e3.offsetHeight / 2;
break;
case "top-top":
n3 += i4;
break;
case "bottom-top":
n3 += e3.offsetHeight + i4;
break;
case "center-top":
n3 += e3.offsetHeight / 2 + i4;
}
return a2.anchorPlacement || a2.offset || isNaN(t4) || (o2 = t4), n3 + o2;
};
t3.default = a;
}, function(e2, t3) {
"use strict";
Object.defineProperty(t3, "__esModule", { value: true });
var n2 = function(e3) {
for (var t4 = 0, n3 = 0; e3 && !isNaN(e3.offsetLeft) && !isNaN(e3.offsetTop); ) t4 += e3.offsetLeft - ("BODY" != e3.tagName ? e3.scrollLeft : 0), n3 += e3.offsetTop - ("BODY" != e3.tagName ? e3.scrollTop : 0), e3 = e3.offsetParent;
return { top: n3, left: t4 };
};
t3.default = n2;
}, function(e2, t3) {
"use strict";
Object.defineProperty(t3, "__esModule", { value: true });
var n2 = function(e3) {
return e3 = e3 || document.querySelectorAll("[data-aos]"), Array.prototype.map.call(e3, function(e4) {
return { node: e4 };
});
};
t3.default = n2;
}]);
});
}
});
// node_modules/ev-emitter/ev-emitter.js
var require_ev_emitter = __commonJS({
"node_modules/ev-emitter/ev-emitter.js"(exports, module) {
(function(global, factory) {
if (typeof define == "function" && define.amd) {
define(factory);
} else if (typeof module == "object" && module.exports) {
module.exports = factory();
} else {
global.EvEmitter = factory();
}
})(typeof window != "undefined" ? window : exports, function() {
"use strict";
function EvEmitter() {
}
var proto = EvEmitter.prototype;
proto.on = function(eventName, listener) {
if (!eventName || !listener) {
return;
}
var events2 = this._events = this._events || {};
var listeners = events2[eventName] = events2[eventName] || [];
if (listeners.indexOf(listener) == -1) {
listeners.push(listener);
}
return this;
};
proto.once = function(eventName, listener) {
if (!eventName || !listener) {
return;
}
this.on(eventName, listener);
var onceEvents = this._onceEvents = this._onceEvents || {};
var onceListeners = onceEvents[eventName] = onceEvents[eventName] || {};
onceListeners[listener] = true;
return this;
};
proto.off = function(eventName, listener) {
var listeners = this._events && this._events[eventName];
if (!listeners || !listeners.length) {
return;
}
var index = listeners.indexOf(listener);
if (index != -1) {
listeners.splice(index, 1);
}
return this;
};
proto.emitEvent = function(eventName, args) {
var listeners = this._events && this._events[eventName];
if (!listeners || !listeners.length) {
return;
}
listeners = listeners.slice(0);
args = args || [];
var onceListeners = this._onceEvents && this._onceEvents[eventName];
for (var i3 = 0; i3 < listeners.length; i3++) {
var listener = listeners[i3];
var isOnce = onceListeners && onceListeners[listener];
if (isOnce) {
this.off(eventName, listener);
delete onceListeners[listener];
}
listener.apply(this, args);
}
return this;
};
proto.allOff = function() {
delete this._events;
delete this._onceEvents;
};
return EvEmitter;
});
}
});
// node_modules/get-size/get-size.js
var require_get_size = __commonJS({
"node_modules/get-size/get-size.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define(factory);
} else if (typeof module == "object" && module.exports) {
module.exports = factory();
} else {
window2.getSize = factory();
}
})(window, function factory() {
"use strict";
function getStyleSize(value) {
var num = parseFloat(value);
var isValid = value.indexOf("%") == -1 && !isNaN(num);
return isValid && num;
}
function noop3() {
}
var logError = typeof console == "undefined" ? noop3 : function(message) {
console.error(message);
};
var measurements = [
"paddingLeft",
"paddingRight",
"paddingTop",
"paddingBottom",
"marginLeft",
"marginRight",
"marginTop",
"marginBottom",
"borderLeftWidth",
"borderRightWidth",
"borderTopWidth",
"borderBottomWidth"
];
var measurementsLength = measurements.length;
function getZeroSize() {
var size = {
width: 0,
height: 0,
innerWidth: 0,
innerHeight: 0,
outerWidth: 0,
outerHeight: 0
};
for (var i3 = 0; i3 < measurementsLength; i3++) {
var measurement = measurements[i3];
size[measurement] = 0;
}
return size;
}
function getStyle(elem) {
var style2 = getComputedStyle(elem);
if (!style2) {
logError("Style returned " + style2 + ". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1");
}
return style2;
}
var isSetup = false;
var isBoxSizeOuter;
function setup() {
if (isSetup) {
return;
}
isSetup = true;
var div = document.createElement("div");
div.style.width = "200px";
div.style.padding = "1px 2px 3px 4px";
div.style.borderStyle = "solid";
div.style.borderWidth = "1px 2px 3px 4px";
div.style.boxSizing = "border-box";
var body = document.body || document.documentElement;
body.appendChild(div);
var style2 = getStyle(div);
isBoxSizeOuter = Math.round(getStyleSize(style2.width)) == 200;
getSize.isBoxSizeOuter = isBoxSizeOuter;
body.removeChild(div);
}
function getSize(elem) {
setup();
if (typeof elem == "string") {
elem = document.querySelector(elem);
}
if (!elem || typeof elem != "object" || !elem.nodeType) {
return;
}
var style2 = getStyle(elem);
if (style2.display == "none") {
return getZeroSize();
}
var size = {};
size.width = elem.offsetWidth;
size.height = elem.offsetHeight;
var isBorderBox = size.isBorderBox = style2.boxSizing == "border-box";
for (var i3 = 0; i3 < measurementsLength; i3++) {
var measurement = measurements[i3];
var value = style2[measurement];
var num = parseFloat(value);
size[measurement] = !isNaN(num) ? num : 0;
}
var paddingWidth = size.paddingLeft + size.paddingRight;
var paddingHeight = size.paddingTop + size.paddingBottom;
var marginWidth = size.marginLeft + size.marginRight;
var marginHeight = size.marginTop + size.marginBottom;
var borderWidth = size.borderLeftWidth + size.borderRightWidth;
var borderHeight = size.borderTopWidth + size.borderBottomWidth;
var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
var styleWidth = getStyleSize(style2.width);
if (styleWidth !== false) {
size.width = styleWidth + // add padding and border unless it's already including it
(isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth);
}
var styleHeight = getStyleSize(style2.height);
if (styleHeight !== false) {
size.height = styleHeight + // add padding and border unless it's already including it
(isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight);
}
size.innerWidth = size.width - (paddingWidth + borderWidth);
size.innerHeight = size.height - (paddingHeight + borderHeight);
size.outerWidth = size.width + marginWidth;
size.outerHeight = size.height + marginHeight;
return size;
}
return getSize;
});
}
});
// node_modules/desandro-matches-selector/matches-selector.js
var require_matches_selector = __commonJS({
"node_modules/desandro-matches-selector/matches-selector.js"(exports, module) {
(function(window2, factory) {
"use strict";
if (typeof define == "function" && define.amd) {
define(factory);
} else if (typeof module == "object" && module.exports) {
module.exports = factory();
} else {
window2.matchesSelector = factory();
}
})(window, function factory() {
"use strict";
var matchesMethod = function() {
var ElemProto = window.Element.prototype;
if (ElemProto.matches) {
return "matches";
}
if (ElemProto.matchesSelector) {
return "matchesSelector";
}
var prefixes = ["webkit", "moz", "ms", "o"];
for (var i3 = 0; i3 < prefixes.length; i3++) {
var prefix = prefixes[i3];
var method = prefix + "MatchesSelector";
if (ElemProto[method]) {
return method;
}
}
}();
return function matchesSelector(elem, selector3) {
return elem[matchesMethod](selector3);
};
});
}
});
// node_modules/fizzy-ui-utils/utils.js
var require_utils = __commonJS({
"node_modules/fizzy-ui-utils/utils.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define([
"desandro-matches-selector/matches-selector"
], function(matchesSelector) {
return factory(window2, matchesSelector);
});
} else if (typeof module == "object" && module.exports) {
module.exports = factory(
window2,
require_matches_selector()
);
} else {
window2.fizzyUIUtils = factory(
window2,
window2.matchesSelector
);
}
})(window, function factory(window2, matchesSelector) {
"use strict";
var utils2 = {};
utils2.extend = function(a, b) {
for (var prop in b) {
a[prop] = b[prop];
}
return a;
};
utils2.modulo = function(num, div) {
return (num % div + div) % div;
};
var arraySlice = Array.prototype.slice;
utils2.makeArray = function(obj) {
if (Array.isArray(obj)) {
return obj;
}
if (obj === null || obj === void 0) {
return [];
}
var isArrayLike = typeof obj == "object" && typeof obj.length == "number";
if (isArrayLike) {
return arraySlice.call(obj);
}
return [obj];
};
utils2.removeFrom = function(ary, obj) {
var index = ary.indexOf(obj);
if (index != -1) {
ary.splice(index, 1);
}
};
utils2.getParent = function(elem, selector3) {
while (elem.parentNode && elem != document.body) {
elem = elem.parentNode;
if (matchesSelector(elem, selector3)) {
return elem;
}
}
};
utils2.getQueryElement = function(elem) {
if (typeof elem == "string") {
return document.querySelector(elem);
}
return elem;
};
utils2.handleEvent = function(event) {
var method = "on" + event.type;
if (this[method]) {
this[method](event);
}
};
utils2.filterFindElements = function(elems, selector3) {
elems = utils2.makeArray(elems);
var ffElems = [];
elems.forEach(function(elem) {
if (!(elem instanceof HTMLElement)) {
return;
}
if (!selector3) {
ffElems.push(elem);
return;
}
if (matchesSelector(elem, selector3)) {
ffElems.push(elem);
}
var childElems = elem.querySelectorAll(selector3);
for (var i3 = 0; i3 < childElems.length; i3++) {
ffElems.push(childElems[i3]);
}
});
return ffElems;
};
utils2.debounceMethod = function(_class, methodName, threshold) {
threshold = threshold || 100;
var method = _class.prototype[methodName];
var timeoutName = methodName + "Timeout";
_class.prototype[methodName] = function() {
var timeout = this[timeoutName];
clearTimeout(timeout);
var args = arguments;
var _this = this;
this[timeoutName] = setTimeout(function() {
method.apply(_this, args);
delete _this[timeoutName];
}, threshold);
};
};
utils2.docReady = function(callback) {
var readyState = document.readyState;
if (readyState == "complete" || readyState == "interactive") {
setTimeout(callback);
} else {
document.addEventListener("DOMContentLoaded", callback);
}
};
utils2.toDashed = function(str) {
return str.replace(/(.)([A-Z])/g, function(match, $1, $2) {
return $1 + "-" + $2;
}).toLowerCase();
};
var console2 = window2.console;
utils2.htmlInit = function(WidgetClass, namespace) {
utils2.docReady(function() {
var dashedNamespace = utils2.toDashed(namespace);
var dataAttr = "data-" + dashedNamespace;
var dataAttrElems = document.querySelectorAll("[" + dataAttr + "]");
var jsDashElems = document.querySelectorAll(".js-" + dashedNamespace);
var elems = utils2.makeArray(dataAttrElems).concat(utils2.makeArray(jsDashElems));
var dataOptionsAttr = dataAttr + "-options";
var jQuery = window2.jQuery;
elems.forEach(function(elem) {
var attr = elem.getAttribute(dataAttr) || elem.getAttribute(dataOptionsAttr);
var options;
try {
options = attr && JSON.parse(attr);
} catch (error) {
if (console2) {
console2.error("Error parsing " + dataAttr + " on " + elem.className + ": " + error);
}
return;
}
var instance = new WidgetClass(elem, options);
if (jQuery) {
jQuery.data(elem, namespace, instance);
}
});
});
};
return utils2;
});
}
});
// node_modules/outlayer/item.js
var require_item = __commonJS({
"node_modules/outlayer/item.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define(
[
"ev-emitter/ev-emitter",
"get-size/get-size"
],
factory
);
} else if (typeof module == "object" && module.exports) {
module.exports = factory(
require_ev_emitter(),
require_get_size()
);
} else {
window2.Outlayer = {};
window2.Outlayer.Item = factory(
window2.EvEmitter,
window2.getSize
);
}
})(window, function factory(EvEmitter, getSize) {
"use strict";
function isEmptyObj(obj) {
for (var prop in obj) {
return false;
}
prop = null;
return true;
}
var docElemStyle = document.documentElement.style;
var transitionProperty = typeof docElemStyle.transition == "string" ? "transition" : "WebkitTransition";
var transformProperty = typeof docElemStyle.transform == "string" ? "transform" : "WebkitTransform";
var transitionEndEvent = {
WebkitTransition: "webkitTransitionEnd",
transition: "transitionend"
}[transitionProperty];
var vendorProperties = {
transform: transformProperty,
transition: transitionProperty,
transitionDuration: transitionProperty + "Duration",
transitionProperty: transitionProperty + "Property",
transitionDelay: transitionProperty + "Delay"
};
function Item(element, layout) {
if (!element) {
return;
}
this.element = element;
this.layout = layout;
this.position = {
x: 0,
y: 0
};
this._create();
}
var proto = Item.prototype = Object.create(EvEmitter.prototype);
proto.constructor = Item;
proto._create = function() {
this._transn = {
ingProperties: {},
clean: {},
onEnd: {}
};
this.css({
position: "absolute"
});
};
proto.handleEvent = function(event) {
var method = "on" + event.type;
if (this[method]) {
this[method](event);
}
};
proto.getSize = function() {
this.size = getSize(this.element);
};
proto.css = function(style2) {
var elemStyle = this.element.style;
for (var prop in style2) {
var supportedProp = vendorProperties[prop] || prop;
elemStyle[supportedProp] = style2[prop];
}
};
proto.getPosition = function() {
var style2 = getComputedStyle(this.element);
var isOriginLeft = this.layout._getOption("originLeft");
var isOriginTop = this.layout._getOption("originTop");
var xValue = style2[isOriginLeft ? "left" : "right"];
var yValue = style2[isOriginTop ? "top" : "bottom"];
var x = parseFloat(xValue);
var y3 = parseFloat(yValue);
var layoutSize = this.layout.size;
if (xValue.indexOf("%") != -1) {
x = x / 100 * layoutSize.width;
}
if (yValue.indexOf("%") != -1) {
y3 = y3 / 100 * layoutSize.height;
}
x = isNaN(x) ? 0 : x;
y3 = isNaN(y3) ? 0 : y3;
x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight;
y3 -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom;
this.position.x = x;
this.position.y = y3;
};
proto.layoutPosition = function() {
var layoutSize = this.layout.size;
var style2 = {};
var isOriginLeft = this.layout._getOption("originLeft");
var isOriginTop = this.layout._getOption("originTop");
var xPadding = isOriginLeft ? "paddingLeft" : "paddingRight";
var xProperty = isOriginLeft ? "left" : "right";
var xResetProperty = isOriginLeft ? "right" : "left";
var x = this.position.x + layoutSize[xPadding];
style2[xProperty] = this.getXValue(x);
style2[xResetProperty] = "";
var yPadding = isOriginTop ? "paddingTop" : "paddingBottom";
var yProperty = isOriginTop ? "top" : "bottom";
var yResetProperty = isOriginTop ? "bottom" : "top";
var y3 = this.position.y + layoutSize[yPadding];
style2[yProperty] = this.getYValue(y3);
style2[yResetProperty] = "";
this.css(style2);
this.emitEvent("layout", [this]);
};
proto.getXValue = function(x) {
var isHorizontal = this.layout._getOption("horizontal");
return this.layout.options.percentPosition && !isHorizontal ? x / this.layout.size.width * 100 + "%" : x + "px";
};
proto.getYValue = function(y3) {
var isHorizontal = this.layout._getOption("horizontal");
return this.layout.options.percentPosition && isHorizontal ? y3 / this.layout.size.height * 100 + "%" : y3 + "px";
};
proto._transitionTo = function(x, y3) {
this.getPosition();
var curX = this.position.x;
var curY = this.position.y;
var didNotMove = x == this.position.x && y3 == this.position.y;
this.setPosition(x, y3);
if (didNotMove && !this.isTransitioning) {
this.layoutPosition();
return;
}
var transX = x - curX;
var transY = y3 - curY;
var transitionStyle = {};
transitionStyle.transform = this.getTranslate(transX, transY);
this.transition({
to: transitionStyle,
onTransitionEnd: {
transform: this.layoutPosition
},
isCleaning: true
});
};
proto.getTranslate = function(x, y3) {
var isOriginLeft = this.layout._getOption("originLeft");
var isOriginTop = this.layout._getOption("originTop");
x = isOriginLeft ? x : -x;
y3 = isOriginTop ? y3 : -y3;
return "translate3d(" + x + "px, " + y3 + "px, 0)";
};
proto.goTo = function(x, y3) {
this.setPosition(x, y3);
this.layoutPosition();
};
proto.moveTo = proto._transitionTo;
proto.setPosition = function(x, y3) {
this.position.x = parseFloat(x);
this.position.y = parseFloat(y3);
};
proto._nonTransition = function(args) {
this.css(args.to);
if (args.isCleaning) {
this._removeStyles(args.to);
}
for (var prop in args.onTransitionEnd) {
args.onTransitionEnd[prop].call(this);
}
};
proto.transition = function(args) {
if (!parseFloat(this.layout.options.transitionDuration)) {
this._nonTransition(args);
return;
}
var _transition = this._transn;
for (var prop in args.onTransitionEnd) {
_transition.onEnd[prop] = args.onTransitionEnd[prop];
}
for (prop in args.to) {
_transition.ingProperties[prop] = true;
if (args.isCleaning) {
_transition.clean[prop] = true;
}
}
if (args.from) {
this.css(args.from);
var h = this.element.offsetHeight;
h = null;
}
this.enableTransition(args.to);
this.css(args.to);
this.isTransitioning = true;
};
function toDashedAll(str) {
return str.replace(/([A-Z])/g, function($1) {
return "-" + $1.toLowerCase();
});
}
var transitionProps = "opacity," + toDashedAll(transformProperty);
proto.enableTransition = function() {
if (this.isTransitioning) {
return;
}
var duration = this.layout.options.transitionDuration;
duration = typeof duration == "number" ? duration + "ms" : duration;
this.css({
transitionProperty: transitionProps,
transitionDuration: duration,
transitionDelay: this.staggerDelay || 0
});
this.element.addEventListener(transitionEndEvent, this, false);
};
proto.onwebkitTransitionEnd = function(event) {
this.ontransitionend(event);
};
proto.onotransitionend = function(event) {
this.ontransitionend(event);
};
var dashedVendorProperties = {
"-webkit-transform": "transform"
};
proto.ontransitionend = function(event) {
if (event.target !== this.element) {
return;
}
var _transition = this._transn;
var propertyName = dashedVendorProperties[event.propertyName] || event.propertyName;
delete _transition.ingProperties[propertyName];
if (isEmptyObj(_transition.ingProperties)) {
this.disableTransition();
}
if (propertyName in _transition.clean) {
this.element.style[event.propertyName] = "";
delete _transition.clean[propertyName];
}
if (propertyName in _transition.onEnd) {
var onTransitionEnd = _transition.onEnd[propertyName];
onTransitionEnd.call(this);
delete _transition.onEnd[propertyName];
}
this.emitEvent("transitionEnd", [this]);
};
proto.disableTransition = function() {
this.removeTransitionStyles();
this.element.removeEventListener(transitionEndEvent, this, false);
this.isTransitioning = false;
};
proto._removeStyles = function(style2) {
var cleanStyle = {};
for (var prop in style2) {
cleanStyle[prop] = "";
}
this.css(cleanStyle);
};
var cleanTransitionStyle = {
transitionProperty: "",
transitionDuration: "",
transitionDelay: ""
};
proto.removeTransitionStyles = function() {
this.css(cleanTransitionStyle);
};
proto.stagger = function(delay) {
delay = isNaN(delay) ? 0 : delay;
this.staggerDelay = delay + "ms";
};
proto.removeElem = function() {
this.element.parentNode.removeChild(this.element);
this.css({ display: "" });
this.emitEvent("remove", [this]);
};
proto.remove = function() {
if (!transitionProperty || !parseFloat(this.layout.options.transitionDuration)) {
this.removeElem();
return;
}
this.once("transitionEnd", function() {
this.removeElem();
});
this.hide();
};
proto.reveal = function() {
delete this.isHidden;
this.css({ display: "" });
var options = this.layout.options;
var onTransitionEnd = {};
var transitionEndProperty = this.getHideRevealTransitionEndProperty("visibleStyle");
onTransitionEnd[transitionEndProperty] = this.onRevealTransitionEnd;
this.transition({
from: options.hiddenStyle,
to: options.visibleStyle,
isCleaning: true,
onTransitionEnd
});
};
proto.onRevealTransitionEnd = function() {
if (!this.isHidden) {
this.emitEvent("reveal");
}
};
proto.getHideRevealTransitionEndProperty = function(styleProperty) {
var optionStyle = this.layout.options[styleProperty];
if (optionStyle.opacity) {
return "opacity";
}
for (var prop in optionStyle) {
return prop;
}
};
proto.hide = function() {
this.isHidden = true;
this.css({ display: "" });
var options = this.layout.options;
var onTransitionEnd = {};
var transitionEndProperty = this.getHideRevealTransitionEndProperty("hiddenStyle");
onTransitionEnd[transitionEndProperty] = this.onHideTransitionEnd;
this.transition({
from: options.visibleStyle,
to: options.hiddenStyle,
// keep hidden stuff hidden
isCleaning: true,
onTransitionEnd
});
};
proto.onHideTransitionEnd = function() {
if (this.isHidden) {
this.css({ display: "none" });
this.emitEvent("hide");
}
};
proto.destroy = function() {
this.css({
position: "",
left: "",
right: "",
top: "",
bottom: "",
transition: "",
transform: ""
});
};
return Item;
});
}
});
// node_modules/outlayer/outlayer.js
var require_outlayer = __commonJS({
"node_modules/outlayer/outlayer.js"(exports, module) {
(function(window2, factory) {
"use strict";
if (typeof define == "function" && define.amd) {
define(
[
"ev-emitter/ev-emitter",
"get-size/get-size",
"fizzy-ui-utils/utils",
"./item"
],
function(EvEmitter, getSize, utils2, Item) {
return factory(window2, EvEmitter, getSize, utils2, Item);
}
);
} else if (typeof module == "object" && module.exports) {
module.exports = factory(
window2,
require_ev_emitter(),
require_get_size(),
require_utils(),
require_item()
);
} else {
window2.Outlayer = factory(
window2,
window2.EvEmitter,
window2.getSize,
window2.fizzyUIUtils,
window2.Outlayer.Item
);
}
})(window, function factory(window2, EvEmitter, getSize, utils2, Item) {
"use strict";
var console2 = window2.console;
var jQuery = window2.jQuery;
var noop3 = function() {
};
var GUID = 0;
var instances2 = {};
function Outlayer(element, options) {
var queryElement = utils2.getQueryElement(element);
if (!queryElement) {
if (console2) {
console2.error("Bad element for " + this.constructor.namespace + ": " + (queryElement || element));
}
return;
}
this.element = queryElement;
if (jQuery) {
this.$element = jQuery(this.element);
}
this.options = utils2.extend({}, this.constructor.defaults);
this.option(options);
var id = ++GUID;
this.element.outlayerGUID = id;
instances2[id] = this;
this._create();
var isInitLayout = this._getOption("initLayout");
if (isInitLayout) {
this.layout();
}
}
Outlayer.namespace = "outlayer";
Outlayer.Item = Item;
Outlayer.defaults = {
containerStyle: {
position: "relative"
},
initLayout: true,
originLeft: true,
originTop: true,
resize: true,
resizeContainer: true,
// item options
transitionDuration: "0.4s",
hiddenStyle: {
opacity: 0,
transform: "scale(0.001)"
},
visibleStyle: {
opacity: 1,
transform: "scale(1)"
}
};
var proto = Outlayer.prototype;
utils2.extend(proto, EvEmitter.prototype);
proto.option = function(opts) {
utils2.extend(this.options, opts);
};
proto._getOption = function(option) {
var oldOption = this.constructor.compatOptions[option];
return oldOption && this.options[oldOption] !== void 0 ? this.options[oldOption] : this.options[option];
};
Outlayer.compatOptions = {
// currentName: oldName
initLayout: "isInitLayout",
horizontal: "isHorizontal",
layoutInstant: "isLayoutInstant",
originLeft: "isOriginLeft",
originTop: "isOriginTop",
resize: "isResizeBound",
resizeContainer: "isResizingContainer"
};
proto._create = function() {
this.reloadItems();
this.stamps = [];
this.stamp(this.options.stamp);
utils2.extend(this.element.style, this.options.containerStyle);
var canBindResize = this._getOption("resize");
if (canBindResize) {
this.bindResize();
}
};
proto.reloadItems = function() {
this.items = this._itemize(this.element.children);
};
proto._itemize = function(elems) {
var itemElems = this._filterFindItemElements(elems);
var Item2 = this.constructor.Item;
var items = [];
for (var i3 = 0; i3 < itemElems.length; i3++) {
var elem = itemElems[i3];
var item = new Item2(elem, this);
items.push(item);
}
return items;
};
proto._filterFindItemElements = function(elems) {
return utils2.filterFindElements(elems, this.options.itemSelector);
};
proto.getItemElements = function() {
return this.items.map(function(item) {
return item.element;
});
};
proto.layout = function() {
this._resetLayout();
this._manageStamps();
var layoutInstant = this._getOption("layoutInstant");
var isInstant = layoutInstant !== void 0 ? layoutInstant : !this._isLayoutInited;
this.layoutItems(this.items, isInstant);
this._isLayoutInited = true;
};
proto._init = proto.layout;
proto._resetLayout = function() {
this.getSize();
};
proto.getSize = function() {
this.size = getSize(this.element);
};
proto._getMeasurement = function(measurement, size) {
var option = this.options[measurement];
var elem;
if (!option) {
this[measurement] = 0;
} else {
if (typeof option == "string") {
elem = this.element.querySelector(option);
} else if (option instanceof HTMLElement) {
elem = option;
}
this[measurement] = elem ? getSize(elem)[size] : option;
}
};
proto.layoutItems = function(items, isInstant) {
items = this._getItemsForLayout(items);
this._layoutItems(items, isInstant);
this._postLayout();
};
proto._getItemsForLayout = function(items) {
return items.filter(function(item) {
return !item.isIgnored;
});
};
proto._layoutItems = function(items, isInstant) {
this._emitCompleteOnItems("layout", items);
if (!items || !items.length) {
return;
}
var queue = [];
items.forEach(function(item) {
var position = this._getItemLayoutPosition(item);
position.item = item;
position.isInstant = isInstant || item.isLayoutInstant;
queue.push(position);
}, this);
this._processLayoutQueue(queue);
};
proto._getItemLayoutPosition = function() {
return {
x: 0,
y: 0
};
};
proto._processLayoutQueue = function(queue) {
this.updateStagger();
queue.forEach(function(obj, i3) {
this._positionItem(obj.item, obj.x, obj.y, obj.isInstant, i3);
}, this);
};
proto.updateStagger = function() {
var stagger = this.options.stagger;
if (stagger === null || stagger === void 0) {
this.stagger = 0;
return;
}
this.stagger = getMilliseconds(stagger);
return this.stagger;
};
proto._positionItem = function(item, x, y3, isInstant, i3) {
if (isInstant) {
item.goTo(x, y3);
} else {
item.stagger(i3 * this.stagger);
item.moveTo(x, y3);
}
};
proto._postLayout = function() {
this.resizeContainer();
};
proto.resizeContainer = function() {
var isResizingContainer = this._getOption("resizeContainer");
if (!isResizingContainer) {
return;
}
var size = this._getContainerSize();
if (size) {
this._setContainerMeasure(size.width, true);
this._setContainerMeasure(size.height, false);
}
};
proto._getContainerSize = noop3;
proto._setContainerMeasure = function(measure, isWidth) {
if (measure === void 0) {
return;
}
var elemSize = this.size;
if (elemSize.isBorderBox) {
measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + elemSize.borderLeftWidth + elemSize.borderRightWidth : elemSize.paddingBottom + elemSize.paddingTop + elemSize.borderTopWidth + elemSize.borderBottomWidth;
}
measure = Math.max(measure, 0);
this.element.style[isWidth ? "width" : "height"] = measure + "px";
};
proto._emitCompleteOnItems = function(eventName, items) {
var _this = this;
function onComplete() {
_this.dispatchEvent(eventName + "Complete", null, [items]);
}
var count = items.length;
if (!items || !count) {
onComplete();
return;
}
var doneCount = 0;
function tick() {
doneCount++;
if (doneCount == count) {
onComplete();
}
}
items.forEach(function(item) {
item.once(eventName, tick);
});
};
proto.dispatchEvent = function(type, event, args) {
var emitArgs = event ? [event].concat(args) : args;
this.emitEvent(type, emitArgs);
if (jQuery) {
this.$element = this.$element || jQuery(this.element);
if (event) {
var $event = jQuery.Event(event);
$event.type = type;
this.$element.trigger($event, args);
} else {
this.$element.trigger(type, args);
}
}
};
proto.ignore = function(elem) {
var item = this.getItem(elem);
if (item) {
item.isIgnored = true;
}
};
proto.unignore = function(elem) {
var item = this.getItem(elem);
if (item) {
delete item.isIgnored;
}
};
proto.stamp = function(elems) {
elems = this._find(elems);
if (!elems) {
return;
}
this.stamps = this.stamps.concat(elems);
elems.forEach(this.ignore, this);
};
proto.unstamp = function(elems) {
elems = this._find(elems);
if (!elems) {
return;
}
elems.forEach(function(elem) {
utils2.removeFrom(this.stamps, elem);
this.unignore(elem);
}, this);
};
proto._find = function(elems) {
if (!elems) {
return;
}
if (typeof elems == "string") {
elems = this.element.querySelectorAll(elems);
}
elems = utils2.makeArray(elems);
return elems;
};
proto._manageStamps = function() {
if (!this.stamps || !this.stamps.length) {
return;
}
this._getBoundingRect();
this.stamps.forEach(this._manageStamp, this);
};
proto._getBoundingRect = function() {
var boundingRect = this.element.getBoundingClientRect();
var size = this.size;
this._boundingRect = {
left: boundingRect.left + size.paddingLeft + size.borderLeftWidth,
top: boundingRect.top + size.paddingTop + size.borderTopWidth,
right: boundingRect.right - (size.paddingRight + size.borderRightWidth),
bottom: boundingRect.bottom - (size.paddingBottom + size.borderBottomWidth)
};
};
proto._manageStamp = noop3;
proto._getElementOffset = function(elem) {
var boundingRect = elem.getBoundingClientRect();
var thisRect = this._boundingRect;
var size = getSize(elem);
var offset2 = {
left: boundingRect.left - thisRect.left - size.marginLeft,
top: boundingRect.top - thisRect.top - size.marginTop,
right: thisRect.right - boundingRect.right - size.marginRight,
bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom
};
return offset2;
};
proto.handleEvent = utils2.handleEvent;
proto.bindResize = function() {
window2.addEventListener("resize", this);
this.isResizeBound = true;
};
proto.unbindResize = function() {
window2.removeEventListener("resize", this);
this.isResizeBound = false;
};
proto.onresize = function() {
this.resize();
};
utils2.debounceMethod(Outlayer, "onresize", 100);
proto.resize = function() {
if (!this.isResizeBound || !this.needsResizeLayout()) {
return;
}
this.layout();
};
proto.needsResizeLayout = function() {
var size = getSize(this.element);
var hasSizes = this.size && size;
return hasSizes && size.innerWidth !== this.size.innerWidth;
};
proto.addItems = function(elems) {
var items = this._itemize(elems);
if (items.length) {
this.items = this.items.concat(items);
}
return items;
};
proto.appended = function(elems) {
var items = this.addItems(elems);
if (!items.length) {
return;
}
this.layoutItems(items, true);
this.reveal(items);
};
proto.prepended = function(elems) {
var items = this._itemize(elems);
if (!items.length) {
return;
}
var previousItems = this.items.slice(0);
this.items = items.concat(previousItems);
this._resetLayout();
this._manageStamps();
this.layoutItems(items, true);
this.reveal(items);
this.layoutItems(previousItems);
};
proto.reveal = function(items) {
this._emitCompleteOnItems("reveal", items);
if (!items || !items.length) {
return;
}
var stagger = this.updateStagger();
items.forEach(function(item, i3) {
item.stagger(i3 * stagger);
item.reveal();
});
};
proto.hide = function(items) {
this._emitCompleteOnItems("hide", items);
if (!items || !items.length) {
return;
}
var stagger = this.updateStagger();
items.forEach(function(item, i3) {
item.stagger(i3 * stagger);
item.hide();
});
};
proto.revealItemElements = function(elems) {
var items = this.getItems(elems);
this.reveal(items);
};
proto.hideItemElements = function(elems) {
var items = this.getItems(elems);
this.hide(items);
};
proto.getItem = function(elem) {
for (var i3 = 0; i3 < this.items.length; i3++) {
var item = this.items[i3];
if (item.element == elem) {
return item;
}
}
};
proto.getItems = function(elems) {
elems = utils2.makeArray(elems);
var items = [];
elems.forEach(function(elem) {
var item = this.getItem(elem);
if (item) {
items.push(item);
}
}, this);
return items;
};
proto.remove = function(elems) {
var removeItems = this.getItems(elems);
this._emitCompleteOnItems("remove", removeItems);
if (!removeItems || !removeItems.length) {
return;
}
removeItems.forEach(function(item) {
item.remove();
utils2.removeFrom(this.items, item);
}, this);
};
proto.destroy = function() {
var style2 = this.element.style;
style2.height = "";
style2.position = "";
style2.width = "";
this.items.forEach(function(item) {
item.destroy();
});
this.unbindResize();
var id = this.element.outlayerGUID;
delete instances2[id];
delete this.element.outlayerGUID;
if (jQuery) {
jQuery.removeData(this.element, this.constructor.namespace);
}
};
Outlayer.data = function(elem) {
elem = utils2.getQueryElement(elem);
var id = elem && elem.outlayerGUID;
return id && instances2[id];
};
Outlayer.create = function(namespace, options) {
var Layout2 = subclass(Outlayer);
Layout2.defaults = utils2.extend({}, Outlayer.defaults);
utils2.extend(Layout2.defaults, options);
Layout2.compatOptions = utils2.extend({}, Outlayer.compatOptions);
Layout2.namespace = namespace;
Layout2.data = Outlayer.data;
Layout2.Item = subclass(Item);
utils2.htmlInit(Layout2, namespace);
if (jQuery && jQuery.bridget) {
jQuery.bridget(namespace, Layout2);
}
return Layout2;
};
function subclass(Parent) {
function SubClass() {
Parent.apply(this, arguments);
}
SubClass.prototype = Object.create(Parent.prototype);
SubClass.prototype.constructor = SubClass;
return SubClass;
}
var msUnits = {
ms: 1,
s: 1e3
};
function getMilliseconds(time) {
if (typeof time == "number") {
return time;
}
var matches2 = time.match(/(^\d*\.?\d*)(\w*)/);
var num = matches2 && matches2[1];
var unit2 = matches2 && matches2[2];
if (!num.length) {
return 0;
}
num = parseFloat(num);
var mult = msUnits[unit2] || 1;
return num * mult;
}
Outlayer.Item = Item;
return Outlayer;
});
}
});
// node_modules/isotope-layout/js/item.js
var require_item2 = __commonJS({
"node_modules/isotope-layout/js/item.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define(
[
"outlayer/outlayer"
],
factory
);
} else if (typeof module == "object" && module.exports) {
module.exports = factory(
require_outlayer()
);
} else {
window2.Isotope = window2.Isotope || {};
window2.Isotope.Item = factory(
window2.Outlayer
);
}
})(window, function factory(Outlayer) {
"use strict";
function Item() {
Outlayer.Item.apply(this, arguments);
}
var proto = Item.prototype = Object.create(Outlayer.Item.prototype);
var _create = proto._create;
proto._create = function() {
this.id = this.layout.itemGUID++;
_create.call(this);
this.sortData = {};
};
proto.updateSortData = function() {
if (this.isIgnored) {
return;
}
this.sortData.id = this.id;
this.sortData["original-order"] = this.id;
this.sortData.random = Math.random();
var getSortData = this.layout.options.getSortData;
var sorters = this.layout._sorters;
for (var key in getSortData) {
var sorter = sorters[key];
this.sortData[key] = sorter(this.element, this);
}
};
var _destroy = proto.destroy;
proto.destroy = function() {
_destroy.apply(this, arguments);
this.css({
display: ""
});
};
return Item;
});
}
});
// node_modules/isotope-layout/js/layout-mode.js
var require_layout_mode = __commonJS({
"node_modules/isotope-layout/js/layout-mode.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define(
[
"get-size/get-size",
"outlayer/outlayer"
],
factory
);
} else if (typeof module == "object" && module.exports) {
module.exports = factory(
require_get_size(),
require_outlayer()
);
} else {
window2.Isotope = window2.Isotope || {};
window2.Isotope.LayoutMode = factory(
window2.getSize,
window2.Outlayer
);
}
})(window, function factory(getSize, Outlayer) {
"use strict";
function LayoutMode(isotope) {
this.isotope = isotope;
if (isotope) {
this.options = isotope.options[this.namespace];
this.element = isotope.element;
this.items = isotope.filteredItems;
this.size = isotope.size;
}
}
var proto = LayoutMode.prototype;
var facadeMethods = [
"_resetLayout",
"_getItemLayoutPosition",
"_manageStamp",
"_getContainerSize",
"_getElementOffset",
"needsResizeLayout",
"_getOption"
];
facadeMethods.forEach(function(methodName) {
proto[methodName] = function() {
return Outlayer.prototype[methodName].apply(this.isotope, arguments);
};
});
proto.needsVerticalResizeLayout = function() {
var size = getSize(this.isotope.element);
var hasSizes = this.isotope.size && size;
return hasSizes && size.innerHeight != this.isotope.size.innerHeight;
};
proto._getMeasurement = function() {
this.isotope._getMeasurement.apply(this, arguments);
};
proto.getColumnWidth = function() {
this.getSegmentSize("column", "Width");
};
proto.getRowHeight = function() {
this.getSegmentSize("row", "Height");
};
proto.getSegmentSize = function(segment, size) {
var segmentName = segment + size;
var outerSize = "outer" + size;
this._getMeasurement(segmentName, outerSize);
if (this[segmentName]) {
return;
}
var firstItemSize = this.getFirstItemSize();
this[segmentName] = firstItemSize && firstItemSize[outerSize] || // or size of container
this.isotope.size["inner" + size];
};
proto.getFirstItemSize = function() {
var firstItem = this.isotope.filteredItems[0];
return firstItem && firstItem.element && getSize(firstItem.element);
};
proto.layout = function() {
this.isotope.layout.apply(this.isotope, arguments);
};
proto.getSize = function() {
this.isotope.getSize();
this.size = this.isotope.size;
};
LayoutMode.modes = {};
LayoutMode.create = function(namespace, options) {
function Mode() {
LayoutMode.apply(this, arguments);
}
Mode.prototype = Object.create(proto);
Mode.prototype.constructor = Mode;
if (options) {
Mode.options = options;
}
Mode.prototype.namespace = namespace;
LayoutMode.modes[namespace] = Mode;
return Mode;
};
return LayoutMode;
});
}
});
// node_modules/masonry-layout/masonry.js
var require_masonry = __commonJS({
"node_modules/masonry-layout/masonry.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define(
[
"outlayer/outlayer",
"get-size/get-size"
],
factory
);
} else if (typeof module == "object" && module.exports) {
module.exports = factory(
require_outlayer(),
require_get_size()
);
} else {
window2.Masonry = factory(
window2.Outlayer,
window2.getSize
);
}
})(window, function factory(Outlayer, getSize) {
"use strict";
var Masonry = Outlayer.create("masonry");
Masonry.compatOptions.fitWidth = "isFitWidth";
var proto = Masonry.prototype;
proto._resetLayout = function() {
this.getSize();
this._getMeasurement("columnWidth", "outerWidth");
this._getMeasurement("gutter", "outerWidth");
this.measureColumns();
this.colYs = [];
for (var i3 = 0; i3 < this.cols; i3++) {
this.colYs.push(0);
}
this.maxY = 0;
this.horizontalColIndex = 0;
};
proto.measureColumns = function() {
this.getContainerWidth();
if (!this.columnWidth) {
var firstItem = this.items[0];
var firstItemElem = firstItem && firstItem.element;
this.columnWidth = firstItemElem && getSize(firstItemElem).outerWidth || // if first elem has no width, default to size of container
this.containerWidth;
}
var columnWidth = this.columnWidth += this.gutter;
var containerWidth = this.containerWidth + this.gutter;
var cols = containerWidth / columnWidth;
var excess = columnWidth - containerWidth % columnWidth;
var mathMethod = excess && excess < 1 ? "round" : "floor";
cols = Math[mathMethod](cols);
this.cols = Math.max(cols, 1);
};
proto.getContainerWidth = function() {
var isFitWidth = this._getOption("fitWidth");
var container = isFitWidth ? this.element.parentNode : this.element;
var size = getSize(container);
this.containerWidth = size && size.innerWidth;
};
proto._getItemLayoutPosition = function(item) {
item.getSize();
var remainder = item.size.outerWidth % this.columnWidth;
var mathMethod = remainder && remainder < 1 ? "round" : "ceil";
var colSpan = Math[mathMethod](item.size.outerWidth / this.columnWidth);
colSpan = Math.min(colSpan, this.cols);
var colPosMethod = this.options.horizontalOrder ? "_getHorizontalColPosition" : "_getTopColPosition";
var colPosition = this[colPosMethod](colSpan, item);
var position = {
x: this.columnWidth * colPosition.col,
y: colPosition.y
};
var setHeight = colPosition.y + item.size.outerHeight;
var setMax = colSpan + colPosition.col;
for (var i3 = colPosition.col; i3 < setMax; i3++) {
this.colYs[i3] = setHeight;
}
return position;
};
proto._getTopColPosition = function(colSpan) {
var colGroup = this._getTopColGroup(colSpan);
var minimumY = Math.min.apply(Math, colGroup);
return {
col: colGroup.indexOf(minimumY),
y: minimumY
};
};
proto._getTopColGroup = function(colSpan) {
if (colSpan < 2) {
return this.colYs;
}
var colGroup = [];
var groupCount = this.cols + 1 - colSpan;
for (var i3 = 0; i3 < groupCount; i3++) {
colGroup[i3] = this._getColGroupY(i3, colSpan);
}
return colGroup;
};
proto._getColGroupY = function(col, colSpan) {
if (colSpan < 2) {
return this.colYs[col];
}
var groupColYs = this.colYs.slice(col, col + colSpan);
return Math.max.apply(Math, groupColYs);
};
proto._getHorizontalColPosition = function(colSpan, item) {
var col = this.horizontalColIndex % this.cols;
var isOver = colSpan > 1 && col + colSpan > this.cols;
col = isOver ? 0 : col;
var hasSize = item.size.outerWidth && item.size.outerHeight;
this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex;
return {
col,
y: this._getColGroupY(col, colSpan)
};
};
proto._manageStamp = function(stamp) {
var stampSize = getSize(stamp);
var offset2 = this._getElementOffset(stamp);
var isOriginLeft = this._getOption("originLeft");
var firstX = isOriginLeft ? offset2.left : offset2.right;
var lastX = firstX + stampSize.outerWidth;
var firstCol = Math.floor(firstX / this.columnWidth);
firstCol = Math.max(0, firstCol);
var lastCol = Math.floor(lastX / this.columnWidth);
lastCol -= lastX % this.columnWidth ? 0 : 1;
lastCol = Math.min(this.cols - 1, lastCol);
var isOriginTop = this._getOption("originTop");
var stampMaxY = (isOriginTop ? offset2.top : offset2.bottom) + stampSize.outerHeight;
for (var i3 = firstCol; i3 <= lastCol; i3++) {
this.colYs[i3] = Math.max(stampMaxY, this.colYs[i3]);
}
};
proto._getContainerSize = function() {
this.maxY = Math.max.apply(Math, this.colYs);
var size = {
height: this.maxY
};
if (this._getOption("fitWidth")) {
size.width = this._getContainerFitWidth();
}
return size;
};
proto._getContainerFitWidth = function() {
var unusedCols = 0;
var i3 = this.cols;
while (--i3) {
if (this.colYs[i3] !== 0) {
break;
}
unusedCols++;
}
return (this.cols - unusedCols) * this.columnWidth - this.gutter;
};
proto.needsResizeLayout = function() {
var previousWidth = this.containerWidth;
this.getContainerWidth();
return previousWidth != this.containerWidth;
};
return Masonry;
});
}
});
// node_modules/isotope-layout/js/layout-modes/masonry.js
var require_masonry2 = __commonJS({
"node_modules/isotope-layout/js/layout-modes/masonry.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define(
[
"../layout-mode",
"masonry-layout/masonry"
],
factory
);
} else if (typeof module == "object" && module.exports) {
module.exports = factory(
require_layout_mode(),
require_masonry()
);
} else {
factory(
window2.Isotope.LayoutMode,
window2.Masonry
);
}
})(window, function factory(LayoutMode, Masonry) {
"use strict";
var MasonryMode = LayoutMode.create("masonry");
var proto = MasonryMode.prototype;
var keepModeMethods = {
_getElementOffset: true,
layout: true,
_getMeasurement: true
};
for (var method in Masonry.prototype) {
if (!keepModeMethods[method]) {
proto[method] = Masonry.prototype[method];
}
}
var measureColumns = proto.measureColumns;
proto.measureColumns = function() {
this.items = this.isotope.filteredItems;
measureColumns.call(this);
};
var _getOption = proto._getOption;
proto._getOption = function(option) {
if (option == "fitWidth") {
return this.options.isFitWidth !== void 0 ? this.options.isFitWidth : this.options.fitWidth;
}
return _getOption.apply(this.isotope, arguments);
};
return MasonryMode;
});
}
});
// node_modules/isotope-layout/js/layout-modes/fit-rows.js
var require_fit_rows = __commonJS({
"node_modules/isotope-layout/js/layout-modes/fit-rows.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define(
[
"../layout-mode"
],
factory
);
} else if (typeof exports == "object") {
module.exports = factory(
require_layout_mode()
);
} else {
factory(
window2.Isotope.LayoutMode
);
}
})(window, function factory(LayoutMode) {
"use strict";
var FitRows = LayoutMode.create("fitRows");
var proto = FitRows.prototype;
proto._resetLayout = function() {
this.x = 0;
this.y = 0;
this.maxY = 0;
this._getMeasurement("gutter", "outerWidth");
};
proto._getItemLayoutPosition = function(item) {
item.getSize();
var itemWidth = item.size.outerWidth + this.gutter;
var containerWidth = this.isotope.size.innerWidth + this.gutter;
if (this.x !== 0 && itemWidth + this.x > containerWidth) {
this.x = 0;
this.y = this.maxY;
}
var position = {
x: this.x,
y: this.y
};
this.maxY = Math.max(this.maxY, this.y + item.size.outerHeight);
this.x += itemWidth;
return position;
};
proto._getContainerSize = function() {
return { height: this.maxY };
};
return FitRows;
});
}
});
// node_modules/isotope-layout/js/layout-modes/vertical.js
var require_vertical = __commonJS({
"node_modules/isotope-layout/js/layout-modes/vertical.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define(
[
"../layout-mode"
],
factory
);
} else if (typeof module == "object" && module.exports) {
module.exports = factory(
require_layout_mode()
);
} else {
factory(
window2.Isotope.LayoutMode
);
}
})(window, function factory(LayoutMode) {
"use strict";
var Vertical = LayoutMode.create("vertical", {
horizontalAlignment: 0
});
var proto = Vertical.prototype;
proto._resetLayout = function() {
this.y = 0;
};
proto._getItemLayoutPosition = function(item) {
item.getSize();
var x = (this.isotope.size.innerWidth - item.size.outerWidth) * this.options.horizontalAlignment;
var y3 = this.y;
this.y += item.size.outerHeight;
return { x, y: y3 };
};
proto._getContainerSize = function() {
return { height: this.y };
};
return Vertical;
});
}
});
// node_modules/isotope-layout/js/isotope.js
var require_isotope = __commonJS({
"node_modules/isotope-layout/js/isotope.js"(exports, module) {
(function(window2, factory) {
if (typeof define == "function" && define.amd) {
define(
[
"outlayer/outlayer",
"get-size/get-size",
"desandro-matches-selector/matches-selector",
"fizzy-ui-utils/utils",
"./item",
"./layout-mode",
// include default layout modes
"./layout-modes/masonry",
"./layout-modes/fit-rows",
"./layout-modes/vertical"
],
function(Outlayer, getSize, matchesSelector, utils2, Item, LayoutMode) {
return factory(window2, Outlayer, getSize, matchesSelector, utils2, Item, LayoutMode);
}
);
} else if (typeof module == "object" && module.exports) {
module.exports = factory(
window2,
require_outlayer(),
require_get_size(),
require_matches_selector(),
require_utils(),
require_item2(),
require_layout_mode(),
// include default layout modes
require_masonry2(),
require_fit_rows(),
require_vertical()
);
} else {
window2.Isotope = factory(
window2,
window2.Outlayer,
window2.getSize,
window2.matchesSelector,
window2.fizzyUIUtils,
window2.Isotope.Item,
window2.Isotope.LayoutMode
);
}
})(window, function factory(window2, Outlayer, getSize, matchesSelector, utils2, Item, LayoutMode) {
"use strict";
var jQuery = window2.jQuery;
var trim = String.prototype.trim ? function(str) {
return str.trim();
} : function(str) {
return str.replace(/^\s+|\s+$/g, "");
};
var Isotope2 = Outlayer.create("isotope", {
layoutMode: "masonry",
isJQueryFiltering: true,
sortAscending: true
});
Isotope2.Item = Item;
Isotope2.LayoutMode = LayoutMode;
var proto = Isotope2.prototype;
proto._create = function() {
this.itemGUID = 0;
this._sorters = {};
this._getSorters();
Outlayer.prototype._create.call(this);
this.modes = {};
this.filteredItems = this.items;
this.sortHistory = ["original-order"];
for (var name in LayoutMode.modes) {
this._initLayoutMode(name);
}
};
proto.reloadItems = function() {
this.itemGUID = 0;
Outlayer.prototype.reloadItems.call(this);
};
proto._itemize = function() {
var items = Outlayer.prototype._itemize.apply(this, arguments);
for (var i3 = 0; i3 < items.length; i3++) {
var item = items[i3];
item.id = this.itemGUID++;
}
this._updateItemsSortData(items);
return items;
};
proto._initLayoutMode = function(name) {
var Mode = LayoutMode.modes[name];
var initialOpts = this.options[name] || {};
this.options[name] = Mode.options ? utils2.extend(Mode.options, initialOpts) : initialOpts;
this.modes[name] = new Mode(this);
};
proto.layout = function() {
if (!this._isLayoutInited && this._getOption("initLayout")) {
this.arrange();
return;
}
this._layout();
};
proto._layout = function() {
var isInstant = this._getIsInstant();
this._resetLayout();
this._manageStamps();
this.layoutItems(this.filteredItems, isInstant);
this._isLayoutInited = true;
};
proto.arrange = function(opts) {
this.option(opts);
this._getIsInstant();
var filtered = this._filter(this.items);
this.filteredItems = filtered.matches;
this._bindArrangeComplete();
if (this._isInstant) {
this._noTransition(this._hideReveal, [filtered]);
} else {
this._hideReveal(filtered);
}
this._sort();
this._layout();
};
proto._init = proto.arrange;
proto._hideReveal = function(filtered) {
this.reveal(filtered.needReveal);
this.hide(filtered.needHide);
};
proto._getIsInstant = function() {
var isLayoutInstant = this._getOption("layoutInstant");
var isInstant = isLayoutInstant !== void 0 ? isLayoutInstant : !this._isLayoutInited;
this._isInstant = isInstant;
return isInstant;
};
proto._bindArrangeComplete = function() {
var isLayoutComplete, isHideComplete, isRevealComplete;
var _this = this;
function arrangeParallelCallback() {
if (isLayoutComplete && isHideComplete && isRevealComplete) {
_this.dispatchEvent("arrangeComplete", null, [_this.filteredItems]);
}
}
this.once("layoutComplete", function() {
isLayoutComplete = true;
arrangeParallelCallback();
});
this.once("hideComplete", function() {
isHideComplete = true;
arrangeParallelCallback();
});
this.once("revealComplete", function() {
isRevealComplete = true;
arrangeParallelCallback();
});
};
proto._filter = function(items) {
var filter = this.options.filter;
filter = filter || "*";
var matches2 = [];
var hiddenMatched = [];
var visibleUnmatched = [];
var test = this._getFilterTest(filter);
for (var i3 = 0; i3 < items.length; i3++) {
var item = items[i3];
if (item.isIgnored) {
continue;
}
var isMatched = test(item);
if (isMatched) {
matches2.push(item);
}
if (isMatched && item.isHidden) {
hiddenMatched.push(item);
} else if (!isMatched && !item.isHidden) {
visibleUnmatched.push(item);
}
}
return {
matches: matches2,
needReveal: hiddenMatched,
needHide: visibleUnmatched
};
};
proto._getFilterTest = function(filter) {
if (jQuery && this.options.isJQueryFiltering) {
return function(item) {
return jQuery(item.element).is(filter);
};
}
if (typeof filter == "function") {
return function(item) {
return filter(item.element);
};
}
return function(item) {
return matchesSelector(item.element, filter);
};
};
proto.updateSortData = function(elems) {
var items;
if (elems) {
elems = utils2.makeArray(elems);
items = this.getItems(elems);
} else {
items = this.items;
}
this._getSorters();
this._updateItemsSortData(items);
};
proto._getSorters = function() {
var getSortData = this.options.getSortData;
for (var key in getSortData) {
var sorter = getSortData[key];
this._sorters[key] = mungeSorter(sorter);
}
};
proto._updateItemsSortData = function(items) {
var len = items && items.length;
for (var i3 = 0; len && i3 < len; i3++) {
var item = items[i3];
item.updateSortData();
}
};
var mungeSorter = /* @__PURE__ */ function() {
function mungeSorter2(sorter) {
if (typeof sorter != "string") {
return sorter;
}
var args = trim(sorter).split(" ");
var query2 = args[0];
var attrMatch = query2.match(/^\[(.+)\]$/);
var attr = attrMatch && attrMatch[1];
var getValue = getValueGetter(attr, query2);
var parser = Isotope2.sortDataParsers[args[1]];
sorter = parser ? function(elem) {
return elem && parser(getValue(elem));
} : (
// otherwise just return value
function(elem) {
return elem && getValue(elem);
}
);
return sorter;
}
function getValueGetter(attr, query2) {
if (attr) {
return function getAttribute2(elem) {
return elem.getAttribute(attr);
};
}
return function getChildText(elem) {
var child2 = elem.querySelector(query2);
return child2 && child2.textContent;
};
}
return mungeSorter2;
}();
Isotope2.sortDataParsers = {
"parseInt": function(val) {
return parseInt(val, 10);
},
"parseFloat": function(val) {
return parseFloat(val);
}
};
proto._sort = function() {
if (!this.options.sortBy) {
return;
}
var sortBys = utils2.makeArray(this.options.sortBy);
if (!this._getIsSameSortBy(sortBys)) {
this.sortHistory = sortBys.concat(this.sortHistory);
}
var itemSorter = getItemSorter(this.sortHistory, this.options.sortAscending);
this.filteredItems.sort(itemSorter);
};
proto._getIsSameSortBy = function(sortBys) {
for (var i3 = 0; i3 < sortBys.length; i3++) {
if (sortBys[i3] != this.sortHistory[i3]) {
return false;
}
}
return true;
};
function getItemSorter(sortBys, sortAsc) {
return function sorter(itemA, itemB) {
for (var i3 = 0; i3 < sortBys.length; i3++) {
var sortBy = sortBys[i3];
var a = itemA.sortData[sortBy];
var b = itemB.sortData[sortBy];
if (a > b || a < b) {
var isAscending = sortAsc[sortBy] !== void 0 ? sortAsc[sortBy] : sortAsc;
var direction = isAscending ? 1 : -1;
return (a > b ? 1 : -1) * direction;
}
}
return 0;
};
}
proto._mode = function() {
var layoutMode = this.options.layoutMode;
var mode = this.modes[layoutMode];
if (!mode) {
throw new Error("No layout mode: " + layoutMode);
}
mode.options = this.options[layoutMode];
return mode;
};
proto._resetLayout = function() {
Outlayer.prototype._resetLayout.call(this);
this._mode()._resetLayout();
};
proto._getItemLayoutPosition = function(item) {
return this._mode()._getItemLayoutPosition(item);
};
proto._manageStamp = function(stamp) {
this._mode()._manageStamp(stamp);
};
proto._getContainerSize = function() {
return this._mode()._getContainerSize();
};
proto.needsResizeLayout = function() {
return this._mode().needsResizeLayout();
};
proto.appended = function(elems) {
var items = this.addItems(elems);
if (!items.length) {
return;
}
var filteredItems = this._filterRevealAdded(items);
this.filteredItems = this.filteredItems.concat(filteredItems);
};
proto.prepended = function(elems) {
var items = this._itemize(elems);
if (!items.length) {
return;
}
this._resetLayout();
this._manageStamps();
var filteredItems = this._filterRevealAdded(items);
this.layoutItems(this.filteredItems);
this.filteredItems = filteredItems.concat(this.filteredItems);
this.items = items.concat(this.items);
};
proto._filterRevealAdded = function(items) {
var filtered = this._filter(items);
this.hide(filtered.needHide);
this.reveal(filtered.matches);
this.layoutItems(filtered.matches, true);
return filtered.matches;
};
proto.insert = function(elems) {
var items = this.addItems(elems);
if (!items.length) {
return;
}
var i3, item;
var len = items.length;
for (i3 = 0; i3 < len; i3++) {
item = items[i3];
this.element.appendChild(item.element);
}
var filteredInsertItems = this._filter(items).matches;
for (i3 = 0; i3 < len; i3++) {
items[i3].isLayoutInstant = true;
}
this.arrange();
for (i3 = 0; i3 < len; i3++) {
delete items[i3].isLayoutInstant;
}
this.reveal(filteredInsertItems);
};
var _remove = proto.remove;
proto.remove = function(elems) {
elems = utils2.makeArray(elems);
var removeItems = this.getItems(elems);
_remove.call(this, elems);
var len = removeItems && removeItems.length;
for (var i3 = 0; len && i3 < len; i3++) {
var item = removeItems[i3];
utils2.removeFrom(this.filteredItems, item);
}
};
proto.shuffle = function() {
for (var i3 = 0; i3 < this.items.length; i3++) {
var item = this.items[i3];
item.sortData.random = Math.random();
}
this.options.sortBy = "random";
this._sort();
this._layout();
};
proto._noTransition = function(fn2, args) {
var transitionDuration = this.options.transitionDuration;
this.options.transitionDuration = 0;
var returnValue = fn2.apply(this, args);
this.options.transitionDuration = transitionDuration;
return returnValue;
};
proto.getFilteredItemElements = function() {
return this.filteredItems.map(function(item) {
return item.element;
});
};
return Isotope2;
});
}
});
// node_modules/flowbite/lib/esm/dom/events.js
var Events = (
/** @class */
function() {
function Events2(eventType, eventFunctions) {
if (eventFunctions === void 0) {
eventFunctions = [];
}
this._eventType = eventType;
this._eventFunctions = eventFunctions;
}
Events2.prototype.init = function() {
var _this = this;
this._eventFunctions.forEach(function(eventFunction) {
if (typeof window !== "undefined") {
window.addEventListener(_this._eventType, eventFunction);
}
});
};
return Events2;
}()
);
var events_default = Events;
// node_modules/flowbite/lib/esm/dom/instances.js
var Instances = (
/** @class */
function() {
function Instances2() {
this._instances = {
Accordion: {},
Carousel: {},
Collapse: {},
Dial: {},
Dismiss: {},
Drawer: {},
Dropdown: {},
Modal: {},
Popover: {},
Tabs: {},
Tooltip: {},
InputCounter: {},
CopyClipboard: {},
Datepicker: {}
};
}
Instances2.prototype.addInstance = function(component, instance, id, override) {
if (override === void 0) {
override = false;
}
if (!this._instances[component]) {
console.warn("Flowbite: Component ".concat(component, " does not exist."));
return false;
}
if (this._instances[component][id] && !override) {
console.warn("Flowbite: Instance with ID ".concat(id, " already exists."));
return;
}
if (override && this._instances[component][id]) {
this._instances[component][id].destroyAndRemoveInstance();
}
this._instances[component][id ? id : this._generateRandomId()] = instance;
};
Instances2.prototype.getAllInstances = function() {
return this._instances;
};
Instances2.prototype.getInstances = function(component) {
if (!this._instances[component]) {
console.warn("Flowbite: Component ".concat(component, " does not exist."));
return false;
}
return this._instances[component];
};
Instances2.prototype.getInstance = function(component, id) {
if (!this._componentAndInstanceCheck(component, id)) {
return;
}
if (!this._instances[component][id]) {
console.warn("Flowbite: Instance with ID ".concat(id, " does not exist."));
return;
}
return this._instances[component][id];
};
Instances2.prototype.destroyAndRemoveInstance = function(component, id) {
if (!this._componentAndInstanceCheck(component, id)) {
return;
}
this.destroyInstanceObject(component, id);
this.removeInstance(component, id);
};
Instances2.prototype.removeInstance = function(component, id) {
if (!this._componentAndInstanceCheck(component, id)) {
return;
}
delete this._instances[component][id];
};
Instances2.prototype.destroyInstanceObject = function(component, id) {
if (!this._componentAndInstanceCheck(component, id)) {
return;
}
this._instances[component][id].destroy();
};
Instances2.prototype.instanceExists = function(component, id) {
if (!this._instances[component]) {
return false;
}
if (!this._instances[component][id]) {
return false;
}
return true;
};
Instances2.prototype._generateRandomId = function() {
return Math.random().toString(36).substr(2, 9);
};
Instances2.prototype._componentAndInstanceCheck = function(component, id) {
if (!this._instances[component]) {
console.warn("Flowbite: Component ".concat(component, " does not exist."));
return false;
}
if (!this._instances[component][id]) {
console.warn("Flowbite: Instance with ID ".concat(id, " does not exist."));
return false;
}
return true;
};
return Instances2;
}()
);
var instances = new Instances();
var instances_default = instances;
if (typeof window !== "undefined") {
window.FlowbiteInstances = instances;
}
// node_modules/flowbite/lib/esm/components/accordion/index.js
var __assign = function() {
__assign = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign.apply(this, arguments);
};
var Default = {
alwaysOpen: false,
activeClasses: "bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",
inactiveClasses: "text-gray-500 dark:text-gray-400",
onOpen: function() {
},
onClose: function() {
},
onToggle: function() {
}
};
var DefaultInstanceOptions = {
id: null,
override: true
};
var Accordion = (
/** @class */
function() {
function Accordion2(accordionEl, items, options, instanceOptions) {
if (accordionEl === void 0) {
accordionEl = null;
}
if (items === void 0) {
items = [];
}
if (options === void 0) {
options = Default;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : accordionEl.id;
this._accordionEl = accordionEl;
this._items = items;
this._options = __assign(__assign({}, Default), options);
this._initialized = false;
this.init();
instances_default.addInstance("Accordion", this, this._instanceId, instanceOptions.override);
}
Accordion2.prototype.init = function() {
var _this = this;
if (this._items.length && !this._initialized) {
this._items.forEach(function(item) {
if (item.active) {
_this.open(item.id);
}
var clickHandler = function() {
_this.toggle(item.id);
};
item.triggerEl.addEventListener("click", clickHandler);
item.clickHandler = clickHandler;
});
this._initialized = true;
}
};
Accordion2.prototype.destroy = function() {
if (this._items.length && this._initialized) {
this._items.forEach(function(item) {
item.triggerEl.removeEventListener("click", item.clickHandler);
delete item.clickHandler;
});
this._initialized = false;
}
};
Accordion2.prototype.removeInstance = function() {
instances_default.removeInstance("Accordion", this._instanceId);
};
Accordion2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Accordion2.prototype.getItem = function(id) {
return this._items.filter(function(item) {
return item.id === id;
})[0];
};
Accordion2.prototype.open = function(id) {
var _a, _b;
var _this = this;
var item = this.getItem(id);
if (!this._options.alwaysOpen) {
this._items.map(function(i3) {
var _a2, _b2;
if (i3 !== item) {
(_a2 = i3.triggerEl.classList).remove.apply(_a2, _this._options.activeClasses.split(" "));
(_b2 = i3.triggerEl.classList).add.apply(_b2, _this._options.inactiveClasses.split(" "));
i3.targetEl.classList.add("hidden");
i3.triggerEl.setAttribute("aria-expanded", "false");
i3.active = false;
if (i3.iconEl) {
i3.iconEl.classList.add("rotate-180");
}
}
});
}
(_a = item.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(" "));
(_b = item.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(" "));
item.triggerEl.setAttribute("aria-expanded", "true");
item.targetEl.classList.remove("hidden");
item.active = true;
if (item.iconEl) {
item.iconEl.classList.remove("rotate-180");
}
this._options.onOpen(this, item);
};
Accordion2.prototype.toggle = function(id) {
var item = this.getItem(id);
if (item.active) {
this.close(id);
} else {
this.open(id);
}
this._options.onToggle(this, item);
};
Accordion2.prototype.close = function(id) {
var _a, _b;
var item = this.getItem(id);
(_a = item.triggerEl.classList).remove.apply(_a, this._options.activeClasses.split(" "));
(_b = item.triggerEl.classList).add.apply(_b, this._options.inactiveClasses.split(" "));
item.targetEl.classList.add("hidden");
item.triggerEl.setAttribute("aria-expanded", "false");
item.active = false;
if (item.iconEl) {
item.iconEl.classList.add("rotate-180");
}
this._options.onClose(this, item);
};
Accordion2.prototype.updateOnOpen = function(callback) {
this._options.onOpen = callback;
};
Accordion2.prototype.updateOnClose = function(callback) {
this._options.onClose = callback;
};
Accordion2.prototype.updateOnToggle = function(callback) {
this._options.onToggle = callback;
};
return Accordion2;
}()
);
function initAccordions() {
document.querySelectorAll("[data-accordion]").forEach(function($accordionEl) {
var alwaysOpen = $accordionEl.getAttribute("data-accordion");
var activeClasses = $accordionEl.getAttribute("data-active-classes");
var inactiveClasses = $accordionEl.getAttribute("data-inactive-classes");
var items = [];
$accordionEl.querySelectorAll("[data-accordion-target]").forEach(function($triggerEl) {
if ($triggerEl.closest("[data-accordion]") === $accordionEl) {
var item = {
id: $triggerEl.getAttribute("data-accordion-target"),
triggerEl: $triggerEl,
targetEl: document.querySelector($triggerEl.getAttribute("data-accordion-target")),
iconEl: $triggerEl.querySelector("[data-accordion-icon]"),
active: $triggerEl.getAttribute("aria-expanded") === "true" ? true : false
};
items.push(item);
}
});
new Accordion($accordionEl, items, {
alwaysOpen: alwaysOpen === "open" ? true : false,
activeClasses: activeClasses ? activeClasses : Default.activeClasses,
inactiveClasses: inactiveClasses ? inactiveClasses : Default.inactiveClasses
});
});
}
if (typeof window !== "undefined") {
window.Accordion = Accordion;
window.initAccordions = initAccordions;
}
// node_modules/flowbite/lib/esm/components/collapse/index.js
var __assign2 = function() {
__assign2 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign2.apply(this, arguments);
};
var Default2 = {
onCollapse: function() {
},
onExpand: function() {
},
onToggle: function() {
}
};
var DefaultInstanceOptions2 = {
id: null,
override: true
};
var Collapse = (
/** @class */
function() {
function Collapse2(targetEl, triggerEl, options, instanceOptions) {
if (targetEl === void 0) {
targetEl = null;
}
if (triggerEl === void 0) {
triggerEl = null;
}
if (options === void 0) {
options = Default2;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions2;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : targetEl.id;
this._targetEl = targetEl;
this._triggerEl = triggerEl;
this._options = __assign2(__assign2({}, Default2), options);
this._visible = false;
this._initialized = false;
this.init();
instances_default.addInstance("Collapse", this, this._instanceId, instanceOptions.override);
}
Collapse2.prototype.init = function() {
var _this = this;
if (this._triggerEl && this._targetEl && !this._initialized) {
if (this._triggerEl.hasAttribute("aria-expanded")) {
this._visible = this._triggerEl.getAttribute("aria-expanded") === "true";
} else {
this._visible = !this._targetEl.classList.contains("hidden");
}
this._clickHandler = function() {
_this.toggle();
};
this._triggerEl.addEventListener("click", this._clickHandler);
this._initialized = true;
}
};
Collapse2.prototype.destroy = function() {
if (this._triggerEl && this._initialized) {
this._triggerEl.removeEventListener("click", this._clickHandler);
this._initialized = false;
}
};
Collapse2.prototype.removeInstance = function() {
instances_default.removeInstance("Collapse", this._instanceId);
};
Collapse2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Collapse2.prototype.collapse = function() {
this._targetEl.classList.add("hidden");
if (this._triggerEl) {
this._triggerEl.setAttribute("aria-expanded", "false");
}
this._visible = false;
this._options.onCollapse(this);
};
Collapse2.prototype.expand = function() {
this._targetEl.classList.remove("hidden");
if (this._triggerEl) {
this._triggerEl.setAttribute("aria-expanded", "true");
}
this._visible = true;
this._options.onExpand(this);
};
Collapse2.prototype.toggle = function() {
if (this._visible) {
this.collapse();
} else {
this.expand();
}
this._options.onToggle(this);
};
Collapse2.prototype.updateOnCollapse = function(callback) {
this._options.onCollapse = callback;
};
Collapse2.prototype.updateOnExpand = function(callback) {
this._options.onExpand = callback;
};
Collapse2.prototype.updateOnToggle = function(callback) {
this._options.onToggle = callback;
};
return Collapse2;
}()
);
function initCollapses() {
document.querySelectorAll("[data-collapse-toggle]").forEach(function($triggerEl) {
var targetId = $triggerEl.getAttribute("data-collapse-toggle");
var $targetEl = document.getElementById(targetId);
if ($targetEl) {
if (!instances_default.instanceExists("Collapse", $targetEl.getAttribute("id"))) {
new Collapse($targetEl, $triggerEl);
} else {
new Collapse($targetEl, $triggerEl, {}, {
id: $targetEl.getAttribute("id") + "_" + instances_default._generateRandomId()
});
}
} else {
console.error('The target element with id "'.concat(targetId, '" does not exist. Please check the data-collapse-toggle attribute.'));
}
});
}
if (typeof window !== "undefined") {
window.Collapse = Collapse;
window.initCollapses = initCollapses;
}
// node_modules/flowbite/lib/esm/components/carousel/index.js
var __assign3 = function() {
__assign3 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign3.apply(this, arguments);
};
var Default3 = {
defaultPosition: 0,
indicators: {
items: [],
activeClasses: "bg-white dark:bg-gray-800",
inactiveClasses: "bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800"
},
interval: 3e3,
onNext: function() {
},
onPrev: function() {
},
onChange: function() {
}
};
var DefaultInstanceOptions3 = {
id: null,
override: true
};
var Carousel = (
/** @class */
function() {
function Carousel2(carouselEl, items, options, instanceOptions) {
if (carouselEl === void 0) {
carouselEl = null;
}
if (items === void 0) {
items = [];
}
if (options === void 0) {
options = Default3;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions3;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : carouselEl.id;
this._carouselEl = carouselEl;
this._items = items;
this._options = __assign3(__assign3(__assign3({}, Default3), options), { indicators: __assign3(__assign3({}, Default3.indicators), options.indicators) });
this._activeItem = this.getItem(this._options.defaultPosition);
this._indicators = this._options.indicators.items;
this._intervalDuration = this._options.interval;
this._intervalInstance = null;
this._initialized = false;
this.init();
instances_default.addInstance("Carousel", this, this._instanceId, instanceOptions.override);
}
Carousel2.prototype.init = function() {
var _this = this;
if (this._items.length && !this._initialized) {
this._items.map(function(item) {
item.el.classList.add("absolute", "inset-0", "transition-transform", "transform");
});
if (this.getActiveItem()) {
this.slideTo(this.getActiveItem().position);
} else {
this.slideTo(0);
}
this._indicators.map(function(indicator, position) {
indicator.el.addEventListener("click", function() {
_this.slideTo(position);
});
});
this._initialized = true;
}
};
Carousel2.prototype.destroy = function() {
if (this._initialized) {
this._initialized = false;
}
};
Carousel2.prototype.removeInstance = function() {
instances_default.removeInstance("Carousel", this._instanceId);
};
Carousel2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Carousel2.prototype.getItem = function(position) {
return this._items[position];
};
Carousel2.prototype.slideTo = function(position) {
var nextItem = this._items[position];
var rotationItems = {
left: nextItem.position === 0 ? this._items[this._items.length - 1] : this._items[nextItem.position - 1],
middle: nextItem,
right: nextItem.position === this._items.length - 1 ? this._items[0] : this._items[nextItem.position + 1]
};
this._rotate(rotationItems);
this._setActiveItem(nextItem);
if (this._intervalInstance) {
this.pause();
this.cycle();
}
this._options.onChange(this);
};
Carousel2.prototype.next = function() {
var activeItem = this.getActiveItem();
var nextItem = null;
if (activeItem.position === this._items.length - 1) {
nextItem = this._items[0];
} else {
nextItem = this._items[activeItem.position + 1];
}
this.slideTo(nextItem.position);
this._options.onNext(this);
};
Carousel2.prototype.prev = function() {
var activeItem = this.getActiveItem();
var prevItem = null;
if (activeItem.position === 0) {
prevItem = this._items[this._items.length - 1];
} else {
prevItem = this._items[activeItem.position - 1];
}
this.slideTo(prevItem.position);
this._options.onPrev(this);
};
Carousel2.prototype._rotate = function(rotationItems) {
this._items.map(function(item) {
item.el.classList.add("hidden");
});
if (this._items.length === 1) {
rotationItems.middle.el.classList.remove("-translate-x-full", "translate-x-full", "translate-x-0", "hidden", "z-10");
rotationItems.middle.el.classList.add("translate-x-0", "z-20");
return;
}
rotationItems.left.el.classList.remove("-translate-x-full", "translate-x-full", "translate-x-0", "hidden", "z-20");
rotationItems.left.el.classList.add("-translate-x-full", "z-10");
rotationItems.middle.el.classList.remove("-translate-x-full", "translate-x-full", "translate-x-0", "hidden", "z-10");
rotationItems.middle.el.classList.add("translate-x-0", "z-30");
rotationItems.right.el.classList.remove("-translate-x-full", "translate-x-full", "translate-x-0", "hidden", "z-30");
rotationItems.right.el.classList.add("translate-x-full", "z-20");
};
Carousel2.prototype.cycle = function() {
var _this = this;
if (typeof window !== "undefined") {
this._intervalInstance = window.setInterval(function() {
_this.next();
}, this._intervalDuration);
}
};
Carousel2.prototype.pause = function() {
clearInterval(this._intervalInstance);
};
Carousel2.prototype.getActiveItem = function() {
return this._activeItem;
};
Carousel2.prototype._setActiveItem = function(item) {
var _a, _b;
var _this = this;
this._activeItem = item;
var position = item.position;
if (this._indicators.length) {
this._indicators.map(function(indicator) {
var _a2, _b2;
indicator.el.setAttribute("aria-current", "false");
(_a2 = indicator.el.classList).remove.apply(_a2, _this._options.indicators.activeClasses.split(" "));
(_b2 = indicator.el.classList).add.apply(_b2, _this._options.indicators.inactiveClasses.split(" "));
});
(_a = this._indicators[position].el.classList).add.apply(_a, this._options.indicators.activeClasses.split(" "));
(_b = this._indicators[position].el.classList).remove.apply(_b, this._options.indicators.inactiveClasses.split(" "));
this._indicators[position].el.setAttribute("aria-current", "true");
}
};
Carousel2.prototype.updateOnNext = function(callback) {
this._options.onNext = callback;
};
Carousel2.prototype.updateOnPrev = function(callback) {
this._options.onPrev = callback;
};
Carousel2.prototype.updateOnChange = function(callback) {
this._options.onChange = callback;
};
return Carousel2;
}()
);
function initCarousels() {
document.querySelectorAll("[data-carousel]").forEach(function($carouselEl) {
var interval = $carouselEl.getAttribute("data-carousel-interval");
var slide = $carouselEl.getAttribute("data-carousel") === "slide" ? true : false;
var items = [];
var defaultPosition = 0;
if ($carouselEl.querySelectorAll("[data-carousel-item]").length) {
Array.from($carouselEl.querySelectorAll("[data-carousel-item]")).map(function($carouselItemEl, position) {
items.push({
position,
el: $carouselItemEl
});
if ($carouselItemEl.getAttribute("data-carousel-item") === "active") {
defaultPosition = position;
}
});
}
var indicators = [];
if ($carouselEl.querySelectorAll("[data-carousel-slide-to]").length) {
Array.from($carouselEl.querySelectorAll("[data-carousel-slide-to]")).map(function($indicatorEl) {
indicators.push({
position: parseInt($indicatorEl.getAttribute("data-carousel-slide-to")),
el: $indicatorEl
});
});
}
var carousel = new Carousel($carouselEl, items, {
defaultPosition,
indicators: {
items: indicators
},
interval: interval ? interval : Default3.interval
});
if (slide) {
carousel.cycle();
}
var carouselNextEl = $carouselEl.querySelector("[data-carousel-next]");
var carouselPrevEl = $carouselEl.querySelector("[data-carousel-prev]");
if (carouselNextEl) {
carouselNextEl.addEventListener("click", function() {
carousel.next();
});
}
if (carouselPrevEl) {
carouselPrevEl.addEventListener("click", function() {
carousel.prev();
});
}
});
}
if (typeof window !== "undefined") {
window.Carousel = Carousel;
window.initCarousels = initCarousels;
}
// node_modules/flowbite/lib/esm/components/dismiss/index.js
var __assign4 = function() {
__assign4 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign4.apply(this, arguments);
};
var Default4 = {
transition: "transition-opacity",
duration: 300,
timing: "ease-out",
onHide: function() {
}
};
var DefaultInstanceOptions4 = {
id: null,
override: true
};
var Dismiss = (
/** @class */
function() {
function Dismiss2(targetEl, triggerEl, options, instanceOptions) {
if (targetEl === void 0) {
targetEl = null;
}
if (triggerEl === void 0) {
triggerEl = null;
}
if (options === void 0) {
options = Default4;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions4;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : targetEl.id;
this._targetEl = targetEl;
this._triggerEl = triggerEl;
this._options = __assign4(__assign4({}, Default4), options);
this._initialized = false;
this.init();
instances_default.addInstance("Dismiss", this, this._instanceId, instanceOptions.override);
}
Dismiss2.prototype.init = function() {
var _this = this;
if (this._triggerEl && this._targetEl && !this._initialized) {
this._clickHandler = function() {
_this.hide();
};
this._triggerEl.addEventListener("click", this._clickHandler);
this._initialized = true;
}
};
Dismiss2.prototype.destroy = function() {
if (this._triggerEl && this._initialized) {
this._triggerEl.removeEventListener("click", this._clickHandler);
this._initialized = false;
}
};
Dismiss2.prototype.removeInstance = function() {
instances_default.removeInstance("Dismiss", this._instanceId);
};
Dismiss2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Dismiss2.prototype.hide = function() {
var _this = this;
this._targetEl.classList.add(this._options.transition, "duration-".concat(this._options.duration), this._options.timing, "opacity-0");
setTimeout(function() {
_this._targetEl.classList.add("hidden");
}, this._options.duration);
this._options.onHide(this, this._targetEl);
};
Dismiss2.prototype.updateOnHide = function(callback) {
this._options.onHide = callback;
};
return Dismiss2;
}()
);
function initDismisses() {
document.querySelectorAll("[data-dismiss-target]").forEach(function($triggerEl) {
var targetId = $triggerEl.getAttribute("data-dismiss-target");
var $dismissEl = document.querySelector(targetId);
if ($dismissEl) {
new Dismiss($dismissEl, $triggerEl);
} else {
console.error('The dismiss element with id "'.concat(targetId, '" does not exist. Please check the data-dismiss-target attribute.'));
}
});
}
if (typeof window !== "undefined") {
window.Dismiss = Dismiss;
window.initDismisses = initDismisses;
}
// node_modules/@popperjs/core/lib/enums.js
var top = "top";
var bottom = "bottom";
var right = "right";
var left = "left";
var auto = "auto";
var basePlacements = [top, bottom, right, left];
var start = "start";
var end = "end";
var clippingParents = "clippingParents";
var viewport = "viewport";
var popper = "popper";
var reference = "reference";
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
return acc.concat([placement + "-" + start, placement + "-" + end]);
}, []);
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
}, []);
var beforeRead = "beforeRead";
var read = "read";
var afterRead = "afterRead";
var beforeMain = "beforeMain";
var main = "main";
var afterMain = "afterMain";
var beforeWrite = "beforeWrite";
var write = "write";
var afterWrite = "afterWrite";
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
// node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
function getNodeName(element) {
return element ? (element.nodeName || "").toLowerCase() : null;
}
// node_modules/@popperjs/core/lib/dom-utils/getWindow.js
function getWindow(node) {
if (node == null) {
return window;
}
if (node.toString() !== "[object Window]") {
var ownerDocument = node.ownerDocument;
return ownerDocument ? ownerDocument.defaultView || window : window;
}
return node;
}
// node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
function isElement(node) {
var OwnElement = getWindow(node).Element;
return node instanceof OwnElement || node instanceof Element;
}
function isHTMLElement(node) {
var OwnElement = getWindow(node).HTMLElement;
return node instanceof OwnElement || node instanceof HTMLElement;
}
function isShadowRoot(node) {
if (typeof ShadowRoot === "undefined") {
return false;
}
var OwnElement = getWindow(node).ShadowRoot;
return node instanceof OwnElement || node instanceof ShadowRoot;
}
// node_modules/@popperjs/core/lib/modifiers/applyStyles.js
function applyStyles(_ref) {
var state = _ref.state;
Object.keys(state.elements).forEach(function(name) {
var style2 = state.styles[name] || {};
var attributes = state.attributes[name] || {};
var element = state.elements[name];
if (!isHTMLElement(element) || !getNodeName(element)) {
return;
}
Object.assign(element.style, style2);
Object.keys(attributes).forEach(function(name2) {
var value = attributes[name2];
if (value === false) {
element.removeAttribute(name2);
} else {
element.setAttribute(name2, value === true ? "" : value);
}
});
});
}
function effect(_ref2) {
var state = _ref2.state;
var initialStyles = {
popper: {
position: state.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
Object.assign(state.elements.popper.style, initialStyles.popper);
state.styles = initialStyles;
if (state.elements.arrow) {
Object.assign(state.elements.arrow.style, initialStyles.arrow);
}
return function() {
Object.keys(state.elements).forEach(function(name) {
var element = state.elements[name];
var attributes = state.attributes[name] || {};
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
var style2 = styleProperties.reduce(function(style3, property) {
style3[property] = "";
return style3;
}, {});
if (!isHTMLElement(element) || !getNodeName(element)) {
return;
}
Object.assign(element.style, style2);
Object.keys(attributes).forEach(function(attribute) {
element.removeAttribute(attribute);
});
});
};
}
var applyStyles_default = {
name: "applyStyles",
enabled: true,
phase: "write",
fn: applyStyles,
effect,
requires: ["computeStyles"]
};
// node_modules/@popperjs/core/lib/utils/getBasePlacement.js
function getBasePlacement(placement) {
return placement.split("-")[0];
}
// node_modules/@popperjs/core/lib/utils/math.js
var max = Math.max;
var min = Math.min;
var round = Math.round;
// node_modules/@popperjs/core/lib/utils/userAgent.js
function getUAString() {
var uaData = navigator.userAgentData;
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
return uaData.brands.map(function(item) {
return item.brand + "/" + item.version;
}).join(" ");
}
return navigator.userAgent;
}
// node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
function isLayoutViewport() {
return !/^((?!chrome|android).)*safari/i.test(getUAString());
}
// node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
var clientRect = element.getBoundingClientRect();
var scaleX = 1;
var scaleY = 1;
if (includeScale && isHTMLElement(element)) {
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
}
var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
var y3 = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
var width = clientRect.width / scaleX;
var height = clientRect.height / scaleY;
return {
width,
height,
top: y3,
right: x + width,
bottom: y3 + height,
left: x,
x,
y: y3
};
}
// node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
function getLayoutRect(element) {
var clientRect = getBoundingClientRect(element);
var width = element.offsetWidth;
var height = element.offsetHeight;
if (Math.abs(clientRect.width - width) <= 1) {
width = clientRect.width;
}
if (Math.abs(clientRect.height - height) <= 1) {
height = clientRect.height;
}
return {
x: element.offsetLeft,
y: element.offsetTop,
width,
height
};
}
// node_modules/@popperjs/core/lib/dom-utils/contains.js
function contains(parent, child2) {
var rootNode = child2.getRootNode && child2.getRootNode();
if (parent.contains(child2)) {
return true;
} else if (rootNode && isShadowRoot(rootNode)) {
var next = child2;
do {
if (next && parent.isSameNode(next)) {
return true;
}
next = next.parentNode || next.host;
} while (next);
}
return false;
}
// node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
function getComputedStyle2(element) {
return getWindow(element).getComputedStyle(element);
}
// node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
function isTableElement(element) {
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
}
// node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
function getDocumentElement(element) {
return ((isElement(element) ? element.ownerDocument : (
// $FlowFixMe[prop-missing]
element.document
)) || window.document).documentElement;
}
// node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
function getParentNode(element) {
if (getNodeName(element) === "html") {
return element;
}
return (
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
element.parentNode || // DOM Element detected
(isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
getDocumentElement(element)
);
}
// node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
function getTrueOffsetParent(element) {
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
getComputedStyle2(element).position === "fixed") {
return null;
}
return element.offsetParent;
}
function getContainingBlock(element) {
var isFirefox = /firefox/i.test(getUAString());
var isIE = /Trident/i.test(getUAString());
if (isIE && isHTMLElement(element)) {
var elementCss = getComputedStyle2(element);
if (elementCss.position === "fixed") {
return null;
}
}
var currentNode = getParentNode(element);
if (isShadowRoot(currentNode)) {
currentNode = currentNode.host;
}
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
var css = getComputedStyle2(currentNode);
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
return currentNode;
} else {
currentNode = currentNode.parentNode;
}
}
return null;
}
function getOffsetParent(element) {
var window2 = getWindow(element);
var offsetParent = getTrueOffsetParent(element);
while (offsetParent && isTableElement(offsetParent) && getComputedStyle2(offsetParent).position === "static") {
offsetParent = getTrueOffsetParent(offsetParent);
}
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static")) {
return window2;
}
return offsetParent || getContainingBlock(element) || window2;
}
// node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
function getMainAxisFromPlacement(placement) {
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
}
// node_modules/@popperjs/core/lib/utils/within.js
function within(min4, value, max4) {
return max(min4, min(value, max4));
}
function withinMaxClamp(min4, value, max4) {
var v = within(min4, value, max4);
return v > max4 ? max4 : v;
}
// node_modules/@popperjs/core/lib/utils/getFreshSideObject.js
function getFreshSideObject() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
// node_modules/@popperjs/core/lib/utils/mergePaddingObject.js
function mergePaddingObject(paddingObject) {
return Object.assign({}, getFreshSideObject(), paddingObject);
}
// node_modules/@popperjs/core/lib/utils/expandToHashMap.js
function expandToHashMap(value, keys) {
return keys.reduce(function(hashMap, key) {
hashMap[key] = value;
return hashMap;
}, {});
}
// node_modules/@popperjs/core/lib/modifiers/arrow.js
var toPaddingObject = function toPaddingObject2(padding, state) {
padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
placement: state.placement
})) : padding;
return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
};
function arrow(_ref) {
var _state$modifiersData$;
var state = _ref.state, name = _ref.name, options = _ref.options;
var arrowElement = state.elements.arrow;
var popperOffsets2 = state.modifiersData.popperOffsets;
var basePlacement = getBasePlacement(state.placement);
var axis = getMainAxisFromPlacement(basePlacement);
var isVertical = [left, right].indexOf(basePlacement) >= 0;
var len = isVertical ? "height" : "width";
if (!arrowElement || !popperOffsets2) {
return;
}
var paddingObject = toPaddingObject(options.padding, state);
var arrowRect = getLayoutRect(arrowElement);
var minProp = axis === "y" ? top : left;
var maxProp = axis === "y" ? bottom : right;
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
var arrowOffsetParent = getOffsetParent(arrowElement);
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
var centerToReference = endDiff / 2 - startDiff / 2;
var min4 = paddingObject[minProp];
var max4 = clientSize - arrowRect[len] - paddingObject[maxProp];
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
var offset2 = within(min4, center, max4);
var axisProp = axis;
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
}
function effect2(_ref2) {
var state = _ref2.state, options = _ref2.options;
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
if (arrowElement == null) {
return;
}
if (typeof arrowElement === "string") {
arrowElement = state.elements.popper.querySelector(arrowElement);
if (!arrowElement) {
return;
}
}
if (!contains(state.elements.popper, arrowElement)) {
return;
}
state.elements.arrow = arrowElement;
}
var arrow_default = {
name: "arrow",
enabled: true,
phase: "main",
fn: arrow,
effect: effect2,
requires: ["popperOffsets"],
requiresIfExists: ["preventOverflow"]
};
// node_modules/@popperjs/core/lib/utils/getVariation.js
function getVariation(placement) {
return placement.split("-")[1];
}
// node_modules/@popperjs/core/lib/modifiers/computeStyles.js
var unsetSides = {
top: "auto",
right: "auto",
bottom: "auto",
left: "auto"
};
function roundOffsetsByDPR(_ref, win) {
var x = _ref.x, y3 = _ref.y;
var dpr = win.devicePixelRatio || 1;
return {
x: round(x * dpr) / dpr || 0,
y: round(y3 * dpr) / dpr || 0
};
}
function mapToStyles(_ref2) {
var _Object$assign2;
var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y3 = _offsets$y === void 0 ? 0 : _offsets$y;
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
x,
y: y3
}) : {
x,
y: y3
};
x = _ref3.x;
y3 = _ref3.y;
var hasX = offsets.hasOwnProperty("x");
var hasY = offsets.hasOwnProperty("y");
var sideX = left;
var sideY = top;
var win = window;
if (adaptive) {
var offsetParent = getOffsetParent(popper2);
var heightProp = "clientHeight";
var widthProp = "clientWidth";
if (offsetParent === getWindow(popper2)) {
offsetParent = getDocumentElement(popper2);
if (getComputedStyle2(offsetParent).position !== "static" && position === "absolute") {
heightProp = "scrollHeight";
widthProp = "scrollWidth";
}
}
offsetParent = offsetParent;
if (placement === top || (placement === left || placement === right) && variation === end) {
sideY = bottom;
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
// $FlowFixMe[prop-missing]
offsetParent[heightProp]
);
y3 -= offsetY - popperRect.height;
y3 *= gpuAcceleration ? 1 : -1;
}
if (placement === left || (placement === top || placement === bottom) && variation === end) {
sideX = right;
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
// $FlowFixMe[prop-missing]
offsetParent[widthProp]
);
x -= offsetX - popperRect.width;
x *= gpuAcceleration ? 1 : -1;
}
}
var commonStyles = Object.assign({
position
}, adaptive && unsetSides);
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
x,
y: y3
}, getWindow(popper2)) : {
x,
y: y3
};
x = _ref4.x;
y3 = _ref4.y;
if (gpuAcceleration) {
var _Object$assign;
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y3 + "px)" : "translate3d(" + x + "px, " + y3 + "px, 0)", _Object$assign));
}
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y3 + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
}
function computeStyles(_ref5) {
var state = _ref5.state, options = _ref5.options;
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
var commonStyles = {
placement: getBasePlacement(state.placement),
variation: getVariation(state.placement),
popper: state.elements.popper,
popperRect: state.rects.popper,
gpuAcceleration,
isFixed: state.options.strategy === "fixed"
};
if (state.modifiersData.popperOffsets != null) {
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
offsets: state.modifiersData.popperOffsets,
position: state.options.strategy,
adaptive,
roundOffsets
})));
}
if (state.modifiersData.arrow != null) {
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
offsets: state.modifiersData.arrow,
position: "absolute",
adaptive: false,
roundOffsets
})));
}
state.attributes.popper = Object.assign({}, state.attributes.popper, {
"data-popper-placement": state.placement
});
}
var computeStyles_default = {
name: "computeStyles",
enabled: true,
phase: "beforeWrite",
fn: computeStyles,
data: {}
};
// node_modules/@popperjs/core/lib/modifiers/eventListeners.js
var passive = {
passive: true
};
function effect3(_ref) {
var state = _ref.state, instance = _ref.instance, options = _ref.options;
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
var window2 = getWindow(state.elements.popper);
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
if (scroll) {
scrollParents.forEach(function(scrollParent) {
scrollParent.addEventListener("scroll", instance.update, passive);
});
}
if (resize) {
window2.addEventListener("resize", instance.update, passive);
}
return function() {
if (scroll) {
scrollParents.forEach(function(scrollParent) {
scrollParent.removeEventListener("scroll", instance.update, passive);
});
}
if (resize) {
window2.removeEventListener("resize", instance.update, passive);
}
};
}
var eventListeners_default = {
name: "eventListeners",
enabled: true,
phase: "write",
fn: function fn() {
},
effect: effect3,
data: {}
};
// node_modules/@popperjs/core/lib/utils/getOppositePlacement.js
var hash = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function getOppositePlacement(placement) {
return placement.replace(/left|right|bottom|top/g, function(matched) {
return hash[matched];
});
}
// node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js
var hash2 = {
start: "end",
end: "start"
};
function getOppositeVariationPlacement(placement) {
return placement.replace(/start|end/g, function(matched) {
return hash2[matched];
});
}
// node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
function getWindowScroll(node) {
var win = getWindow(node);
var scrollLeft = win.pageXOffset;
var scrollTop = win.pageYOffset;
return {
scrollLeft,
scrollTop
};
}
// node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
function getWindowScrollBarX(element) {
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
}
// node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js
function getViewportRect(element, strategy) {
var win = getWindow(element);
var html = getDocumentElement(element);
var visualViewport = win.visualViewport;
var width = html.clientWidth;
var height = html.clientHeight;
var x = 0;
var y3 = 0;
if (visualViewport) {
width = visualViewport.width;
height = visualViewport.height;
var layoutViewport = isLayoutViewport();
if (layoutViewport || !layoutViewport && strategy === "fixed") {
x = visualViewport.offsetLeft;
y3 = visualViewport.offsetTop;
}
}
return {
width,
height,
x: x + getWindowScrollBarX(element),
y: y3
};
}
// node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js
function getDocumentRect(element) {
var _element$ownerDocumen;
var html = getDocumentElement(element);
var winScroll = getWindowScroll(element);
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
var y3 = -winScroll.scrollTop;
if (getComputedStyle2(body || html).direction === "rtl") {
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
}
return {
width,
height,
x,
y: y3
};
}
// node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
function isScrollParent(element) {
var _getComputedStyle5 = getComputedStyle2(element), overflow = _getComputedStyle5.overflow, overflowX = _getComputedStyle5.overflowX, overflowY = _getComputedStyle5.overflowY;
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}
// node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
function getScrollParent(node) {
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
return node.ownerDocument.body;
}
if (isHTMLElement(node) && isScrollParent(node)) {
return node;
}
return getScrollParent(getParentNode(node));
}
// node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
function listScrollParents(element, list) {
var _element$ownerDocumen;
if (list === void 0) {
list = [];
}
var scrollParent = getScrollParent(element);
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
var win = getWindow(scrollParent);
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
var updatedList = list.concat(target);
return isBody ? updatedList : (
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
updatedList.concat(listScrollParents(getParentNode(target)))
);
}
// node_modules/@popperjs/core/lib/utils/rectToClientRect.js
function rectToClientRect(rect2) {
return Object.assign({}, rect2, {
left: rect2.x,
top: rect2.y,
right: rect2.x + rect2.width,
bottom: rect2.y + rect2.height
});
}
// node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js
function getInnerBoundingClientRect(element, strategy) {
var rect2 = getBoundingClientRect(element, false, strategy === "fixed");
rect2.top = rect2.top + element.clientTop;
rect2.left = rect2.left + element.clientLeft;
rect2.bottom = rect2.top + element.clientHeight;
rect2.right = rect2.left + element.clientWidth;
rect2.width = element.clientWidth;
rect2.height = element.clientHeight;
rect2.x = rect2.left;
rect2.y = rect2.top;
return rect2;
}
function getClientRectFromMixedType(element, clippingParent, strategy) {
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
}
function getClippingParents(element) {
var clippingParents2 = listScrollParents(getParentNode(element));
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle2(element).position) >= 0;
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
if (!isElement(clipperElement)) {
return [];
}
return clippingParents2.filter(function(clippingParent) {
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
});
}
function getClippingRect(element, boundary, rootBoundary, strategy) {
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
var firstClippingParent = clippingParents2[0];
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
var rect2 = getClientRectFromMixedType(element, clippingParent, strategy);
accRect.top = max(rect2.top, accRect.top);
accRect.right = min(rect2.right, accRect.right);
accRect.bottom = min(rect2.bottom, accRect.bottom);
accRect.left = max(rect2.left, accRect.left);
return accRect;
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
clippingRect.width = clippingRect.right - clippingRect.left;
clippingRect.height = clippingRect.bottom - clippingRect.top;
clippingRect.x = clippingRect.left;
clippingRect.y = clippingRect.top;
return clippingRect;
}
// node_modules/@popperjs/core/lib/utils/computeOffsets.js
function computeOffsets(_ref) {
var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
var basePlacement = placement ? getBasePlacement(placement) : null;
var variation = placement ? getVariation(placement) : null;
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
var commonY = reference2.y + reference2.height / 2 - element.height / 2;
var offsets;
switch (basePlacement) {
case top:
offsets = {
x: commonX,
y: reference2.y - element.height
};
break;
case bottom:
offsets = {
x: commonX,
y: reference2.y + reference2.height
};
break;
case right:
offsets = {
x: reference2.x + reference2.width,
y: commonY
};
break;
case left:
offsets = {
x: reference2.x - element.width,
y: commonY
};
break;
default:
offsets = {
x: reference2.x,
y: reference2.y
};
}
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
if (mainAxis != null) {
var len = mainAxis === "y" ? "height" : "width";
switch (variation) {
case start:
offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
break;
case end:
offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
break;
default:
}
}
return offsets;
}
// node_modules/@popperjs/core/lib/utils/detectOverflow.js
function detectOverflow(state, options) {
if (options === void 0) {
options = {};
}
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
var altContext = elementContext === popper ? reference : popper;
var popperRect = state.rects.popper;
var element = state.elements[altBoundary ? altContext : elementContext];
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
var referenceClientRect = getBoundingClientRect(state.elements.reference);
var popperOffsets2 = computeOffsets({
reference: referenceClientRect,
element: popperRect,
strategy: "absolute",
placement
});
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
var overflowOffsets = {
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
};
var offsetData = state.modifiersData.offset;
if (elementContext === popper && offsetData) {
var offset2 = offsetData[placement];
Object.keys(overflowOffsets).forEach(function(key) {
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
overflowOffsets[key] += offset2[axis] * multiply;
});
}
return overflowOffsets;
}
// node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js
function computeAutoPlacement(state, options) {
if (options === void 0) {
options = {};
}
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
var variation = getVariation(placement);
var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
return getVariation(placement2) === variation;
}) : basePlacements;
var allowedPlacements = placements2.filter(function(placement2) {
return allowedAutoPlacements.indexOf(placement2) >= 0;
});
if (allowedPlacements.length === 0) {
allowedPlacements = placements2;
}
var overflows = allowedPlacements.reduce(function(acc, placement2) {
acc[placement2] = detectOverflow(state, {
placement: placement2,
boundary,
rootBoundary,
padding
})[getBasePlacement(placement2)];
return acc;
}, {});
return Object.keys(overflows).sort(function(a, b) {
return overflows[a] - overflows[b];
});
}
// node_modules/@popperjs/core/lib/modifiers/flip.js
function getExpandedFallbackPlacements(placement) {
if (getBasePlacement(placement) === auto) {
return [];
}
var oppositePlacement = getOppositePlacement(placement);
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
}
function flip(_ref) {
var state = _ref.state, options = _ref.options, name = _ref.name;
if (state.modifiersData[name]._skip) {
return;
}
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
var preferredPlacement = state.options.placement;
var basePlacement = getBasePlacement(preferredPlacement);
var isBasePlacement = basePlacement === preferredPlacement;
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
placement: placement2,
boundary,
rootBoundary,
padding,
flipVariations,
allowedAutoPlacements
}) : placement2);
}, []);
var referenceRect = state.rects.reference;
var popperRect = state.rects.popper;
var checksMap = /* @__PURE__ */ new Map();
var makeFallbackChecks = true;
var firstFittingPlacement = placements2[0];
for (var i3 = 0; i3 < placements2.length; i3++) {
var placement = placements2[i3];
var _basePlacement = getBasePlacement(placement);
var isStartVariation = getVariation(placement) === start;
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
var len = isVertical ? "width" : "height";
var overflow = detectOverflow(state, {
placement,
boundary,
rootBoundary,
altBoundary,
padding
});
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
if (referenceRect[len] > popperRect[len]) {
mainVariationSide = getOppositePlacement(mainVariationSide);
}
var altVariationSide = getOppositePlacement(mainVariationSide);
var checks = [];
if (checkMainAxis) {
checks.push(overflow[_basePlacement] <= 0);
}
if (checkAltAxis) {
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
}
if (checks.every(function(check) {
return check;
})) {
firstFittingPlacement = placement;
makeFallbackChecks = false;
break;
}
checksMap.set(placement, checks);
}
if (makeFallbackChecks) {
var numberOfChecks = flipVariations ? 3 : 1;
var _loop = function _loop2(_i3) {
var fittingPlacement = placements2.find(function(placement2) {
var checks2 = checksMap.get(placement2);
if (checks2) {
return checks2.slice(0, _i3).every(function(check) {
return check;
});
}
});
if (fittingPlacement) {
firstFittingPlacement = fittingPlacement;
return "break";
}
};
for (var _i2 = numberOfChecks; _i2 > 0; _i2--) {
var _ret = _loop(_i2);
if (_ret === "break") break;
}
}
if (state.placement !== firstFittingPlacement) {
state.modifiersData[name]._skip = true;
state.placement = firstFittingPlacement;
state.reset = true;
}
}
var flip_default = {
name: "flip",
enabled: true,
phase: "main",
fn: flip,
requiresIfExists: ["offset"],
data: {
_skip: false
}
};
// node_modules/@popperjs/core/lib/modifiers/hide.js
function getSideOffsets(overflow, rect2, preventedOffsets) {
if (preventedOffsets === void 0) {
preventedOffsets = {
x: 0,
y: 0
};
}
return {
top: overflow.top - rect2.height - preventedOffsets.y,
right: overflow.right - rect2.width + preventedOffsets.x,
bottom: overflow.bottom - rect2.height + preventedOffsets.y,
left: overflow.left - rect2.width - preventedOffsets.x
};
}
function isAnySideFullyClipped(overflow) {
return [top, right, bottom, left].some(function(side) {
return overflow[side] >= 0;
});
}
function hide(_ref) {
var state = _ref.state, name = _ref.name;
var referenceRect = state.rects.reference;
var popperRect = state.rects.popper;
var preventedOffsets = state.modifiersData.preventOverflow;
var referenceOverflow = detectOverflow(state, {
elementContext: "reference"
});
var popperAltOverflow = detectOverflow(state, {
altBoundary: true
});
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
state.modifiersData[name] = {
referenceClippingOffsets,
popperEscapeOffsets,
isReferenceHidden,
hasPopperEscaped
};
state.attributes.popper = Object.assign({}, state.attributes.popper, {
"data-popper-reference-hidden": isReferenceHidden,
"data-popper-escaped": hasPopperEscaped
});
}
var hide_default = {
name: "hide",
enabled: true,
phase: "main",
requiresIfExists: ["preventOverflow"],
fn: hide
};
// node_modules/@popperjs/core/lib/modifiers/offset.js
function distanceAndSkiddingToXY(placement, rects, offset2) {
var basePlacement = getBasePlacement(placement);
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
placement
})) : offset2, skidding = _ref[0], distance = _ref[1];
skidding = skidding || 0;
distance = (distance || 0) * invertDistance;
return [left, right].indexOf(basePlacement) >= 0 ? {
x: distance,
y: skidding
} : {
x: skidding,
y: distance
};
}
function offset(_ref2) {
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
var data = placements.reduce(function(acc, placement) {
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
return acc;
}, {});
var _data$state$placement = data[state.placement], x = _data$state$placement.x, y3 = _data$state$placement.y;
if (state.modifiersData.popperOffsets != null) {
state.modifiersData.popperOffsets.x += x;
state.modifiersData.popperOffsets.y += y3;
}
state.modifiersData[name] = data;
}
var offset_default = {
name: "offset",
enabled: true,
phase: "main",
requires: ["popperOffsets"],
fn: offset
};
// node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
function popperOffsets(_ref) {
var state = _ref.state, name = _ref.name;
state.modifiersData[name] = computeOffsets({
reference: state.rects.reference,
element: state.rects.popper,
strategy: "absolute",
placement: state.placement
});
}
var popperOffsets_default = {
name: "popperOffsets",
enabled: true,
phase: "read",
fn: popperOffsets,
data: {}
};
// node_modules/@popperjs/core/lib/utils/getAltAxis.js
function getAltAxis(axis) {
return axis === "x" ? "y" : "x";
}
// node_modules/@popperjs/core/lib/modifiers/preventOverflow.js
function preventOverflow(_ref) {
var state = _ref.state, options = _ref.options, name = _ref.name;
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
var overflow = detectOverflow(state, {
boundary,
rootBoundary,
padding,
altBoundary
});
var basePlacement = getBasePlacement(state.placement);
var variation = getVariation(state.placement);
var isBasePlacement = !variation;
var mainAxis = getMainAxisFromPlacement(basePlacement);
var altAxis = getAltAxis(mainAxis);
var popperOffsets2 = state.modifiersData.popperOffsets;
var referenceRect = state.rects.reference;
var popperRect = state.rects.popper;
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
placement: state.placement
})) : tetherOffset;
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
mainAxis: tetherOffsetValue,
altAxis: tetherOffsetValue
} : Object.assign({
mainAxis: 0,
altAxis: 0
}, tetherOffsetValue);
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
var data = {
x: 0,
y: 0
};
if (!popperOffsets2) {
return;
}
if (checkMainAxis) {
var _offsetModifierState$;
var mainSide = mainAxis === "y" ? top : left;
var altSide = mainAxis === "y" ? bottom : right;
var len = mainAxis === "y" ? "height" : "width";
var offset2 = popperOffsets2[mainAxis];
var min4 = offset2 + overflow[mainSide];
var max4 = offset2 - overflow[altSide];
var additive = tether ? -popperRect[len] / 2 : 0;
var minLen = variation === start ? referenceRect[len] : popperRect[len];
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
var arrowElement = state.elements.arrow;
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
width: 0,
height: 0
};
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
var arrowPaddingMin = arrowPaddingObject[mainSide];
var arrowPaddingMax = arrowPaddingObject[altSide];
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
var tetherMax = offset2 + maxOffset - offsetModifierValue;
var preventedOffset = within(tether ? min(min4, tetherMin) : min4, offset2, tether ? max(max4, tetherMax) : max4);
popperOffsets2[mainAxis] = preventedOffset;
data[mainAxis] = preventedOffset - offset2;
}
if (checkAltAxis) {
var _offsetModifierState$2;
var _mainSide = mainAxis === "x" ? top : left;
var _altSide = mainAxis === "x" ? bottom : right;
var _offset = popperOffsets2[altAxis];
var _len = altAxis === "y" ? "height" : "width";
var _min = _offset + overflow[_mainSide];
var _max = _offset - overflow[_altSide];
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
popperOffsets2[altAxis] = _preventedOffset;
data[altAxis] = _preventedOffset - _offset;
}
state.modifiersData[name] = data;
}
var preventOverflow_default = {
name: "preventOverflow",
enabled: true,
phase: "main",
fn: preventOverflow,
requiresIfExists: ["offset"]
};
// node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
function getHTMLElementScroll(element) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};
}
// node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
function getNodeScroll(node) {
if (node === getWindow(node) || !isHTMLElement(node)) {
return getWindowScroll(node);
} else {
return getHTMLElementScroll(node);
}
}
// node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
function isElementScaled(element) {
var rect2 = element.getBoundingClientRect();
var scaleX = round(rect2.width) / element.offsetWidth || 1;
var scaleY = round(rect2.height) / element.offsetHeight || 1;
return scaleX !== 1 || scaleY !== 1;
}
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
if (isFixed === void 0) {
isFixed = false;
}
var isOffsetParentAnElement = isHTMLElement(offsetParent);
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
var documentElement = getDocumentElement(offsetParent);
var rect2 = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
var scroll = {
scrollLeft: 0,
scrollTop: 0
};
var offsets = {
x: 0,
y: 0
};
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
isScrollParent(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isHTMLElement(offsetParent)) {
offsets = getBoundingClientRect(offsetParent, true);
offsets.x += offsetParent.clientLeft;
offsets.y += offsetParent.clientTop;
} else if (documentElement) {
offsets.x = getWindowScrollBarX(documentElement);
}
}
return {
x: rect2.left + scroll.scrollLeft - offsets.x,
y: rect2.top + scroll.scrollTop - offsets.y,
width: rect2.width,
height: rect2.height
};
}
// node_modules/@popperjs/core/lib/utils/orderModifiers.js
function order(modifiers) {
var map = /* @__PURE__ */ new Map();
var visited = /* @__PURE__ */ new Set();
var result = [];
modifiers.forEach(function(modifier) {
map.set(modifier.name, modifier);
});
function sort(modifier) {
visited.add(modifier.name);
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
requires.forEach(function(dep) {
if (!visited.has(dep)) {
var depModifier = map.get(dep);
if (depModifier) {
sort(depModifier);
}
}
});
result.push(modifier);
}
modifiers.forEach(function(modifier) {
if (!visited.has(modifier.name)) {
sort(modifier);
}
});
return result;
}
function orderModifiers(modifiers) {
var orderedModifiers = order(modifiers);
return modifierPhases.reduce(function(acc, phase) {
return acc.concat(orderedModifiers.filter(function(modifier) {
return modifier.phase === phase;
}));
}, []);
}
// node_modules/@popperjs/core/lib/utils/debounce.js
function debounce(fn2) {
var pending;
return function() {
if (!pending) {
pending = new Promise(function(resolve) {
Promise.resolve().then(function() {
pending = void 0;
resolve(fn2());
});
});
}
return pending;
};
}
// node_modules/@popperjs/core/lib/utils/mergeByName.js
function mergeByName(modifiers) {
var merged = modifiers.reduce(function(merged2, current) {
var existing = merged2[current.name];
merged2[current.name] = existing ? Object.assign({}, existing, current, {
options: Object.assign({}, existing.options, current.options),
data: Object.assign({}, existing.data, current.data)
}) : current;
return merged2;
}, {});
return Object.keys(merged).map(function(key) {
return merged[key];
});
}
// node_modules/@popperjs/core/lib/createPopper.js
var DEFAULT_OPTIONS = {
placement: "bottom",
modifiers: [],
strategy: "absolute"
};
function areValidElements() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return !args.some(function(element) {
return !(element && typeof element.getBoundingClientRect === "function");
});
}
function popperGenerator(generatorOptions) {
if (generatorOptions === void 0) {
generatorOptions = {};
}
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions2 = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
return function createPopper2(reference2, popper2, options) {
if (options === void 0) {
options = defaultOptions2;
}
var state = {
placement: "bottom",
orderedModifiers: [],
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions2),
modifiersData: {},
elements: {
reference: reference2,
popper: popper2
},
attributes: {},
styles: {}
};
var effectCleanupFns = [];
var isDestroyed = false;
var instance = {
state,
setOptions: function setOptions(setOptionsAction) {
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
cleanupModifierEffects();
state.options = Object.assign({}, defaultOptions2, state.options, options2);
state.scrollParents = {
reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
popper: listScrollParents(popper2)
};
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
state.orderedModifiers = orderedModifiers.filter(function(m3) {
return m3.enabled;
});
runModifierEffects();
return instance.update();
},
// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate: function forceUpdate() {
if (isDestroyed) {
return;
}
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
if (!areValidElements(reference3, popper3)) {
return;
}
state.rects = {
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
popper: getLayoutRect(popper3)
};
state.reset = false;
state.placement = state.options.placement;
state.orderedModifiers.forEach(function(modifier) {
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
});
for (var index = 0; index < state.orderedModifiers.length; index++) {
if (state.reset === true) {
state.reset = false;
index = -1;
continue;
}
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
if (typeof fn2 === "function") {
state = fn2({
state,
options: _options,
name,
instance
}) || state;
}
}
},
// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update: debounce(function() {
return new Promise(function(resolve) {
instance.forceUpdate();
resolve(state);
});
}),
destroy: function destroy() {
cleanupModifierEffects();
isDestroyed = true;
}
};
if (!areValidElements(reference2, popper2)) {
return instance;
}
instance.setOptions(options).then(function(state2) {
if (!isDestroyed && options.onFirstUpdate) {
options.onFirstUpdate(state2);
}
});
function runModifierEffects() {
state.orderedModifiers.forEach(function(_ref) {
var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect4 = _ref.effect;
if (typeof effect4 === "function") {
var cleanupFn = effect4({
state,
name,
instance,
options: options2
});
var noopFn = function noopFn2() {
};
effectCleanupFns.push(cleanupFn || noopFn);
}
});
}
function cleanupModifierEffects() {
effectCleanupFns.forEach(function(fn2) {
return fn2();
});
effectCleanupFns = [];
}
return instance;
};
}
// node_modules/@popperjs/core/lib/popper.js
var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default];
var createPopper = /* @__PURE__ */ popperGenerator({
defaultModifiers
});
// node_modules/flowbite/lib/esm/components/dropdown/index.js
var __assign5 = function() {
__assign5 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign5.apply(this, arguments);
};
var __spreadArray = function(to, from, pack) {
if (pack || arguments.length === 2) for (var i3 = 0, l = from.length, ar; i3 < l; i3++) {
if (ar || !(i3 in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i3);
ar[i3] = from[i3];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var Default5 = {
placement: "bottom",
triggerType: "click",
offsetSkidding: 0,
offsetDistance: 10,
delay: 300,
ignoreClickOutsideClass: false,
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
};
var DefaultInstanceOptions5 = {
id: null,
override: true
};
var Dropdown = (
/** @class */
function() {
function Dropdown2(targetElement, triggerElement, options, instanceOptions) {
if (targetElement === void 0) {
targetElement = null;
}
if (triggerElement === void 0) {
triggerElement = null;
}
if (options === void 0) {
options = Default5;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions5;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : targetElement.id;
this._targetEl = targetElement;
this._triggerEl = triggerElement;
this._options = __assign5(__assign5({}, Default5), options);
this._popperInstance = null;
this._visible = false;
this._initialized = false;
this.init();
instances_default.addInstance("Dropdown", this, this._instanceId, instanceOptions.override);
}
Dropdown2.prototype.init = function() {
if (this._triggerEl && this._targetEl && !this._initialized) {
this._popperInstance = this._createPopperInstance();
this._setupEventListeners();
this._initialized = true;
}
};
Dropdown2.prototype.destroy = function() {
var _this = this;
var triggerEvents = this._getTriggerEvents();
if (this._options.triggerType === "click") {
triggerEvents.showEvents.forEach(function(ev) {
_this._triggerEl.removeEventListener(ev, _this._clickHandler);
});
}
if (this._options.triggerType === "hover") {
triggerEvents.showEvents.forEach(function(ev) {
_this._triggerEl.removeEventListener(ev, _this._hoverShowTriggerElHandler);
_this._targetEl.removeEventListener(ev, _this._hoverShowTargetElHandler);
});
triggerEvents.hideEvents.forEach(function(ev) {
_this._triggerEl.removeEventListener(ev, _this._hoverHideHandler);
_this._targetEl.removeEventListener(ev, _this._hoverHideHandler);
});
}
this._popperInstance.destroy();
this._initialized = false;
};
Dropdown2.prototype.removeInstance = function() {
instances_default.removeInstance("Dropdown", this._instanceId);
};
Dropdown2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Dropdown2.prototype._setupEventListeners = function() {
var _this = this;
var triggerEvents = this._getTriggerEvents();
this._clickHandler = function() {
_this.toggle();
};
if (this._options.triggerType === "click") {
triggerEvents.showEvents.forEach(function(ev) {
_this._triggerEl.addEventListener(ev, _this._clickHandler);
});
}
this._hoverShowTriggerElHandler = function(ev) {
if (ev.type === "click") {
_this.toggle();
} else {
setTimeout(function() {
_this.show();
}, _this._options.delay);
}
};
this._hoverShowTargetElHandler = function() {
_this.show();
};
this._hoverHideHandler = function() {
setTimeout(function() {
if (!_this._targetEl.matches(":hover")) {
_this.hide();
}
}, _this._options.delay);
};
if (this._options.triggerType === "hover") {
triggerEvents.showEvents.forEach(function(ev) {
_this._triggerEl.addEventListener(ev, _this._hoverShowTriggerElHandler);
_this._targetEl.addEventListener(ev, _this._hoverShowTargetElHandler);
});
triggerEvents.hideEvents.forEach(function(ev) {
_this._triggerEl.addEventListener(ev, _this._hoverHideHandler);
_this._targetEl.addEventListener(ev, _this._hoverHideHandler);
});
}
};
Dropdown2.prototype._createPopperInstance = function() {
return createPopper(this._triggerEl, this._targetEl, {
placement: this._options.placement,
modifiers: [
{
name: "offset",
options: {
offset: [
this._options.offsetSkidding,
this._options.offsetDistance
]
}
}
]
});
};
Dropdown2.prototype._setupClickOutsideListener = function() {
var _this = this;
this._clickOutsideEventListener = function(ev) {
_this._handleClickOutside(ev, _this._targetEl);
};
document.body.addEventListener("click", this._clickOutsideEventListener, true);
};
Dropdown2.prototype._removeClickOutsideListener = function() {
document.body.removeEventListener("click", this._clickOutsideEventListener, true);
};
Dropdown2.prototype._handleClickOutside = function(ev, targetEl) {
var clickedEl = ev.target;
var ignoreClickOutsideClass = this._options.ignoreClickOutsideClass;
var isIgnored = false;
if (ignoreClickOutsideClass) {
var ignoredClickOutsideEls = document.querySelectorAll(".".concat(ignoreClickOutsideClass));
ignoredClickOutsideEls.forEach(function(el) {
if (el.contains(clickedEl)) {
isIgnored = true;
return;
}
});
}
if (clickedEl !== targetEl && !targetEl.contains(clickedEl) && !this._triggerEl.contains(clickedEl) && !isIgnored && this.isVisible()) {
this.hide();
}
};
Dropdown2.prototype._getTriggerEvents = function() {
switch (this._options.triggerType) {
case "hover":
return {
showEvents: ["mouseenter", "click"],
hideEvents: ["mouseleave"]
};
case "click":
return {
showEvents: ["click"],
hideEvents: []
};
case "none":
return {
showEvents: [],
hideEvents: []
};
default:
return {
showEvents: ["click"],
hideEvents: []
};
}
};
Dropdown2.prototype.toggle = function() {
if (this.isVisible()) {
this.hide();
} else {
this.show();
}
this._options.onToggle(this);
};
Dropdown2.prototype.isVisible = function() {
return this._visible;
};
Dropdown2.prototype.show = function() {
this._targetEl.classList.remove("hidden");
this._targetEl.classList.add("block");
this._targetEl.removeAttribute("aria-hidden");
this._popperInstance.setOptions(function(options) {
return __assign5(__assign5({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [
{ name: "eventListeners", enabled: true }
], false) });
});
this._setupClickOutsideListener();
this._popperInstance.update();
this._visible = true;
this._options.onShow(this);
};
Dropdown2.prototype.hide = function() {
this._targetEl.classList.remove("block");
this._targetEl.classList.add("hidden");
this._targetEl.setAttribute("aria-hidden", "true");
this._popperInstance.setOptions(function(options) {
return __assign5(__assign5({}, options), { modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [
{ name: "eventListeners", enabled: false }
], false) });
});
this._visible = false;
this._removeClickOutsideListener();
this._options.onHide(this);
};
Dropdown2.prototype.updateOnShow = function(callback) {
this._options.onShow = callback;
};
Dropdown2.prototype.updateOnHide = function(callback) {
this._options.onHide = callback;
};
Dropdown2.prototype.updateOnToggle = function(callback) {
this._options.onToggle = callback;
};
return Dropdown2;
}()
);
function initDropdowns() {
document.querySelectorAll("[data-dropdown-toggle]").forEach(function($triggerEl) {
var dropdownId = $triggerEl.getAttribute("data-dropdown-toggle");
var $dropdownEl = document.getElementById(dropdownId);
if ($dropdownEl) {
var placement = $triggerEl.getAttribute("data-dropdown-placement");
var offsetSkidding = $triggerEl.getAttribute("data-dropdown-offset-skidding");
var offsetDistance = $triggerEl.getAttribute("data-dropdown-offset-distance");
var triggerType = $triggerEl.getAttribute("data-dropdown-trigger");
var delay = $triggerEl.getAttribute("data-dropdown-delay");
var ignoreClickOutsideClass = $triggerEl.getAttribute("data-dropdown-ignore-click-outside-class");
new Dropdown($dropdownEl, $triggerEl, {
placement: placement ? placement : Default5.placement,
triggerType: triggerType ? triggerType : Default5.triggerType,
offsetSkidding: offsetSkidding ? parseInt(offsetSkidding) : Default5.offsetSkidding,
offsetDistance: offsetDistance ? parseInt(offsetDistance) : Default5.offsetDistance,
delay: delay ? parseInt(delay) : Default5.delay,
ignoreClickOutsideClass: ignoreClickOutsideClass ? ignoreClickOutsideClass : Default5.ignoreClickOutsideClass
});
} else {
console.error('The dropdown element with id "'.concat(dropdownId, '" does not exist. Please check the data-dropdown-toggle attribute.'));
}
});
}
if (typeof window !== "undefined") {
window.Dropdown = Dropdown;
window.initDropdowns = initDropdowns;
}
// node_modules/flowbite/lib/esm/components/modal/index.js
var __assign6 = function() {
__assign6 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign6.apply(this, arguments);
};
var Default6 = {
placement: "center",
backdropClasses: "bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-40",
backdrop: "dynamic",
closable: true,
onHide: function() {
},
onShow: function() {
},
onToggle: function() {
}
};
var DefaultInstanceOptions6 = {
id: null,
override: true
};
var Modal = (
/** @class */
function() {
function Modal2(targetEl, options, instanceOptions) {
if (targetEl === void 0) {
targetEl = null;
}
if (options === void 0) {
options = Default6;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions6;
}
this._eventListenerInstances = [];
this._instanceId = instanceOptions.id ? instanceOptions.id : targetEl.id;
this._targetEl = targetEl;
this._options = __assign6(__assign6({}, Default6), options);
this._isHidden = true;
this._backdropEl = null;
this._initialized = false;
this.init();
instances_default.addInstance("Modal", this, this._instanceId, instanceOptions.override);
}
Modal2.prototype.init = function() {
var _this = this;
if (this._targetEl && !this._initialized) {
this._getPlacementClasses().map(function(c) {
_this._targetEl.classList.add(c);
});
this._initialized = true;
}
};
Modal2.prototype.destroy = function() {
if (this._initialized) {
this.removeAllEventListenerInstances();
this._destroyBackdropEl();
this._initialized = false;
}
};
Modal2.prototype.removeInstance = function() {
instances_default.removeInstance("Modal", this._instanceId);
};
Modal2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Modal2.prototype._createBackdrop = function() {
var _a;
if (this._isHidden) {
var backdropEl = document.createElement("div");
(_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(" "));
document.querySelector("body").append(backdropEl);
this._backdropEl = backdropEl;
}
};
Modal2.prototype._destroyBackdropEl = function() {
if (!this._isHidden && this._backdropEl) {
this._backdropEl.remove();
this._backdropEl = null;
}
};
Modal2.prototype._setupModalCloseEventListeners = function() {
var _this = this;
if (this._options.backdrop === "dynamic") {
this._clickOutsideEventListener = function(ev) {
_this._handleOutsideClick(ev.target);
};
this._targetEl.addEventListener("click", this._clickOutsideEventListener, true);
}
this._keydownEventListener = function(ev) {
if (ev.key === "Escape") {
_this.hide();
}
};
document.body.addEventListener("keydown", this._keydownEventListener, true);
};
Modal2.prototype._removeModalCloseEventListeners = function() {
if (this._options.backdrop === "dynamic") {
this._targetEl.removeEventListener("click", this._clickOutsideEventListener, true);
}
document.body.removeEventListener("keydown", this._keydownEventListener, true);
};
Modal2.prototype._handleOutsideClick = function(target) {
if (target === this._targetEl || target === this._backdropEl && this.isVisible()) {
this.hide();
}
};
Modal2.prototype._getPlacementClasses = function() {
switch (this._options.placement) {
case "top-left":
return ["justify-start", "items-start"];
case "top-center":
return ["justify-center", "items-start"];
case "top-right":
return ["justify-end", "items-start"];
case "center-left":
return ["justify-start", "items-center"];
case "center":
return ["justify-center", "items-center"];
case "center-right":
return ["justify-end", "items-center"];
case "bottom-left":
return ["justify-start", "items-end"];
case "bottom-center":
return ["justify-center", "items-end"];
case "bottom-right":
return ["justify-end", "items-end"];
default:
return ["justify-center", "items-center"];
}
};
Modal2.prototype.toggle = function() {
if (this._isHidden) {
this.show();
} else {
this.hide();
}
this._options.onToggle(this);
};
Modal2.prototype.show = function() {
if (this.isHidden) {
this._targetEl.classList.add("flex");
this._targetEl.classList.remove("hidden");
this._targetEl.setAttribute("aria-modal", "true");
this._targetEl.setAttribute("role", "dialog");
this._targetEl.removeAttribute("aria-hidden");
this._createBackdrop();
this._isHidden = false;
if (this._options.closable) {
this._setupModalCloseEventListeners();
}
document.body.classList.add("overflow-hidden");
this._options.onShow(this);
}
};
Modal2.prototype.hide = function() {
if (this.isVisible) {
this._targetEl.classList.add("hidden");
this._targetEl.classList.remove("flex");
this._targetEl.setAttribute("aria-hidden", "true");
this._targetEl.removeAttribute("aria-modal");
this._targetEl.removeAttribute("role");
this._destroyBackdropEl();
this._isHidden = true;
document.body.classList.remove("overflow-hidden");
if (this._options.closable) {
this._removeModalCloseEventListeners();
}
this._options.onHide(this);
}
};
Modal2.prototype.isVisible = function() {
return !this._isHidden;
};
Modal2.prototype.isHidden = function() {
return this._isHidden;
};
Modal2.prototype.addEventListenerInstance = function(element, type, handler) {
this._eventListenerInstances.push({
element,
type,
handler
});
};
Modal2.prototype.removeAllEventListenerInstances = function() {
this._eventListenerInstances.map(function(eventListenerInstance) {
eventListenerInstance.element.removeEventListener(eventListenerInstance.type, eventListenerInstance.handler);
});
this._eventListenerInstances = [];
};
Modal2.prototype.getAllEventListenerInstances = function() {
return this._eventListenerInstances;
};
Modal2.prototype.updateOnShow = function(callback) {
this._options.onShow = callback;
};
Modal2.prototype.updateOnHide = function(callback) {
this._options.onHide = callback;
};
Modal2.prototype.updateOnToggle = function(callback) {
this._options.onToggle = callback;
};
return Modal2;
}()
);
function initModals() {
document.querySelectorAll("[data-modal-target]").forEach(function($triggerEl) {
var modalId = $triggerEl.getAttribute("data-modal-target");
var $modalEl = document.getElementById(modalId);
if ($modalEl) {
var placement = $modalEl.getAttribute("data-modal-placement");
var backdrop = $modalEl.getAttribute("data-modal-backdrop");
new Modal($modalEl, {
placement: placement ? placement : Default6.placement,
backdrop: backdrop ? backdrop : Default6.backdrop
});
} else {
console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?."));
}
});
document.querySelectorAll("[data-modal-toggle]").forEach(function($triggerEl) {
var modalId = $triggerEl.getAttribute("data-modal-toggle");
var $modalEl = document.getElementById(modalId);
if ($modalEl) {
var modal_1 = instances_default.getInstance("Modal", modalId);
if (modal_1) {
var toggleModal = function() {
modal_1.toggle();
};
$triggerEl.addEventListener("click", toggleModal);
modal_1.addEventListenerInstance($triggerEl, "click", toggleModal);
} else {
console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute."));
}
} else {
console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?"));
}
});
document.querySelectorAll("[data-modal-show]").forEach(function($triggerEl) {
var modalId = $triggerEl.getAttribute("data-modal-show");
var $modalEl = document.getElementById(modalId);
if ($modalEl) {
var modal_2 = instances_default.getInstance("Modal", modalId);
if (modal_2) {
var showModal = function() {
modal_2.show();
};
$triggerEl.addEventListener("click", showModal);
modal_2.addEventListenerInstance($triggerEl, "click", showModal);
} else {
console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute."));
}
} else {
console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?"));
}
});
document.querySelectorAll("[data-modal-hide]").forEach(function($triggerEl) {
var modalId = $triggerEl.getAttribute("data-modal-hide");
var $modalEl = document.getElementById(modalId);
if ($modalEl) {
var modal_3 = instances_default.getInstance("Modal", modalId);
if (modal_3) {
var hideModal = function() {
modal_3.hide();
};
$triggerEl.addEventListener("click", hideModal);
modal_3.addEventListenerInstance($triggerEl, "click", hideModal);
} else {
console.error("Modal with id ".concat(modalId, " has not been initialized. Please initialize it using the data-modal-target attribute."));
}
} else {
console.error("Modal with id ".concat(modalId, " does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?"));
}
});
}
if (typeof window !== "undefined") {
window.Modal = Modal;
window.initModals = initModals;
}
// node_modules/flowbite/lib/esm/components/drawer/index.js
var __assign7 = function() {
__assign7 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign7.apply(this, arguments);
};
var Default7 = {
placement: "left",
bodyScrolling: false,
backdrop: true,
edge: false,
edgeOffset: "bottom-[60px]",
backdropClasses: "bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30",
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
};
var DefaultInstanceOptions7 = {
id: null,
override: true
};
var Drawer = (
/** @class */
function() {
function Drawer2(targetEl, options, instanceOptions) {
if (targetEl === void 0) {
targetEl = null;
}
if (options === void 0) {
options = Default7;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions7;
}
this._eventListenerInstances = [];
this._instanceId = instanceOptions.id ? instanceOptions.id : targetEl.id;
this._targetEl = targetEl;
this._options = __assign7(__assign7({}, Default7), options);
this._visible = false;
this._initialized = false;
this.init();
instances_default.addInstance("Drawer", this, this._instanceId, instanceOptions.override);
}
Drawer2.prototype.init = function() {
var _this = this;
if (this._targetEl && !this._initialized) {
this._targetEl.setAttribute("aria-hidden", "true");
this._targetEl.classList.add("transition-transform");
this._getPlacementClasses(this._options.placement).base.map(function(c) {
_this._targetEl.classList.add(c);
});
this._handleEscapeKey = function(event) {
if (event.key === "Escape") {
if (_this.isVisible()) {
_this.hide();
}
}
};
document.addEventListener("keydown", this._handleEscapeKey);
this._initialized = true;
}
};
Drawer2.prototype.destroy = function() {
if (this._initialized) {
this.removeAllEventListenerInstances();
this._destroyBackdropEl();
document.removeEventListener("keydown", this._handleEscapeKey);
this._initialized = false;
}
};
Drawer2.prototype.removeInstance = function() {
instances_default.removeInstance("Drawer", this._instanceId);
};
Drawer2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Drawer2.prototype.hide = function() {
var _this = this;
if (this._options.edge) {
this._getPlacementClasses(this._options.placement + "-edge").active.map(function(c) {
_this._targetEl.classList.remove(c);
});
this._getPlacementClasses(this._options.placement + "-edge").inactive.map(function(c) {
_this._targetEl.classList.add(c);
});
} else {
this._getPlacementClasses(this._options.placement).active.map(function(c) {
_this._targetEl.classList.remove(c);
});
this._getPlacementClasses(this._options.placement).inactive.map(function(c) {
_this._targetEl.classList.add(c);
});
}
this._targetEl.setAttribute("aria-hidden", "true");
this._targetEl.removeAttribute("aria-modal");
this._targetEl.removeAttribute("role");
if (!this._options.bodyScrolling) {
document.body.classList.remove("overflow-hidden");
}
if (this._options.backdrop) {
this._destroyBackdropEl();
}
this._visible = false;
this._options.onHide(this);
};
Drawer2.prototype.show = function() {
var _this = this;
if (this._options.edge) {
this._getPlacementClasses(this._options.placement + "-edge").active.map(function(c) {
_this._targetEl.classList.add(c);
});
this._getPlacementClasses(this._options.placement + "-edge").inactive.map(function(c) {
_this._targetEl.classList.remove(c);
});
} else {
this._getPlacementClasses(this._options.placement).active.map(function(c) {
_this._targetEl.classList.add(c);
});
this._getPlacementClasses(this._options.placement).inactive.map(function(c) {
_this._targetEl.classList.remove(c);
});
}
this._targetEl.setAttribute("aria-modal", "true");
this._targetEl.setAttribute("role", "dialog");
this._targetEl.removeAttribute("aria-hidden");
if (!this._options.bodyScrolling) {
document.body.classList.add("overflow-hidden");
}
if (this._options.backdrop) {
this._createBackdrop();
}
this._visible = true;
this._options.onShow(this);
};
Drawer2.prototype.toggle = function() {
if (this.isVisible()) {
this.hide();
} else {
this.show();
}
};
Drawer2.prototype._createBackdrop = function() {
var _a;
var _this = this;
if (!this._visible) {
var backdropEl = document.createElement("div");
backdropEl.setAttribute("drawer-backdrop", "");
(_a = backdropEl.classList).add.apply(_a, this._options.backdropClasses.split(" "));
document.querySelector("body").append(backdropEl);
backdropEl.addEventListener("click", function() {
_this.hide();
});
}
};
Drawer2.prototype._destroyBackdropEl = function() {
if (this._visible && document.querySelector("[drawer-backdrop]") !== null) {
document.querySelector("[drawer-backdrop]").remove();
}
};
Drawer2.prototype._getPlacementClasses = function(placement) {
switch (placement) {
case "top":
return {
base: ["top-0", "left-0", "right-0"],
active: ["transform-none"],
inactive: ["-translate-y-full"]
};
case "right":
return {
base: ["right-0", "top-0"],
active: ["transform-none"],
inactive: ["translate-x-full"]
};
case "bottom":
return {
base: ["bottom-0", "left-0", "right-0"],
active: ["transform-none"],
inactive: ["translate-y-full"]
};
case "left":
return {
base: ["left-0", "top-0"],
active: ["transform-none"],
inactive: ["-translate-x-full"]
};
case "bottom-edge":
return {
base: ["left-0", "top-0"],
active: ["transform-none"],
inactive: ["translate-y-full", this._options.edgeOffset]
};
default:
return {
base: ["left-0", "top-0"],
active: ["transform-none"],
inactive: ["-translate-x-full"]
};
}
};
Drawer2.prototype.isHidden = function() {
return !this._visible;
};
Drawer2.prototype.isVisible = function() {
return this._visible;
};
Drawer2.prototype.addEventListenerInstance = function(element, type, handler) {
this._eventListenerInstances.push({
element,
type,
handler
});
};
Drawer2.prototype.removeAllEventListenerInstances = function() {
this._eventListenerInstances.map(function(eventListenerInstance) {
eventListenerInstance.element.removeEventListener(eventListenerInstance.type, eventListenerInstance.handler);
});
this._eventListenerInstances = [];
};
Drawer2.prototype.getAllEventListenerInstances = function() {
return this._eventListenerInstances;
};
Drawer2.prototype.updateOnShow = function(callback) {
this._options.onShow = callback;
};
Drawer2.prototype.updateOnHide = function(callback) {
this._options.onHide = callback;
};
Drawer2.prototype.updateOnToggle = function(callback) {
this._options.onToggle = callback;
};
return Drawer2;
}()
);
function initDrawers() {
document.querySelectorAll("[data-drawer-target]").forEach(function($triggerEl) {
var drawerId = $triggerEl.getAttribute("data-drawer-target");
var $drawerEl = document.getElementById(drawerId);
if ($drawerEl) {
var placement = $triggerEl.getAttribute("data-drawer-placement");
var bodyScrolling = $triggerEl.getAttribute("data-drawer-body-scrolling");
var backdrop = $triggerEl.getAttribute("data-drawer-backdrop");
var edge = $triggerEl.getAttribute("data-drawer-edge");
var edgeOffset = $triggerEl.getAttribute("data-drawer-edge-offset");
new Drawer($drawerEl, {
placement: placement ? placement : Default7.placement,
bodyScrolling: bodyScrolling ? bodyScrolling === "true" ? true : false : Default7.bodyScrolling,
backdrop: backdrop ? backdrop === "true" ? true : false : Default7.backdrop,
edge: edge ? edge === "true" ? true : false : Default7.edge,
edgeOffset: edgeOffset ? edgeOffset : Default7.edgeOffset
});
} else {
console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"));
}
});
document.querySelectorAll("[data-drawer-toggle]").forEach(function($triggerEl) {
var drawerId = $triggerEl.getAttribute("data-drawer-toggle");
var $drawerEl = document.getElementById(drawerId);
if ($drawerEl) {
var drawer_1 = instances_default.getInstance("Drawer", drawerId);
if (drawer_1) {
var toggleDrawer = function() {
drawer_1.toggle();
};
$triggerEl.addEventListener("click", toggleDrawer);
drawer_1.addEventListenerInstance($triggerEl, "click", toggleDrawer);
} else {
console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute."));
}
} else {
console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"));
}
});
document.querySelectorAll("[data-drawer-dismiss], [data-drawer-hide]").forEach(function($triggerEl) {
var drawerId = $triggerEl.getAttribute("data-drawer-dismiss") ? $triggerEl.getAttribute("data-drawer-dismiss") : $triggerEl.getAttribute("data-drawer-hide");
var $drawerEl = document.getElementById(drawerId);
if ($drawerEl) {
var drawer_2 = instances_default.getInstance("Drawer", drawerId);
if (drawer_2) {
var hideDrawer = function() {
drawer_2.hide();
};
$triggerEl.addEventListener("click", hideDrawer);
drawer_2.addEventListenerInstance($triggerEl, "click", hideDrawer);
} else {
console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute."));
}
} else {
console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id"));
}
});
document.querySelectorAll("[data-drawer-show]").forEach(function($triggerEl) {
var drawerId = $triggerEl.getAttribute("data-drawer-show");
var $drawerEl = document.getElementById(drawerId);
if ($drawerEl) {
var drawer_3 = instances_default.getInstance("Drawer", drawerId);
if (drawer_3) {
var showDrawer = function() {
drawer_3.show();
};
$triggerEl.addEventListener("click", showDrawer);
drawer_3.addEventListenerInstance($triggerEl, "click", showDrawer);
} else {
console.error("Drawer with id ".concat(drawerId, " has not been initialized. Please initialize it using the data-drawer-target attribute."));
}
} else {
console.error("Drawer with id ".concat(drawerId, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"));
}
});
}
if (typeof window !== "undefined") {
window.Drawer = Drawer;
window.initDrawers = initDrawers;
}
// node_modules/flowbite/lib/esm/components/tabs/index.js
var __assign8 = function() {
__assign8 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign8.apply(this, arguments);
};
var Default8 = {
defaultTabId: null,
activeClasses: "text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500",
inactiveClasses: "dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300",
onShow: function() {
}
};
var DefaultInstanceOptions8 = {
id: null,
override: true
};
var Tabs = (
/** @class */
function() {
function Tabs2(tabsEl, items, options, instanceOptions) {
if (tabsEl === void 0) {
tabsEl = null;
}
if (items === void 0) {
items = [];
}
if (options === void 0) {
options = Default8;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions8;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : tabsEl.id;
this._tabsEl = tabsEl;
this._items = items;
this._activeTab = options ? this.getTab(options.defaultTabId) : null;
this._options = __assign8(__assign8({}, Default8), options);
this._initialized = false;
this.init();
instances_default.addInstance("Tabs", this, this._instanceId, instanceOptions.override);
}
Tabs2.prototype.init = function() {
var _this = this;
if (this._items.length && !this._initialized) {
if (!this._activeTab) {
this.setActiveTab(this._items[0]);
}
this.show(this._activeTab.id, true);
this._items.map(function(tab) {
tab.triggerEl.addEventListener("click", function(event) {
event.preventDefault();
_this.show(tab.id);
});
});
}
};
Tabs2.prototype.destroy = function() {
if (this._initialized) {
this._initialized = false;
}
};
Tabs2.prototype.removeInstance = function() {
this.destroy();
instances_default.removeInstance("Tabs", this._instanceId);
};
Tabs2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Tabs2.prototype.getActiveTab = function() {
return this._activeTab;
};
Tabs2.prototype.setActiveTab = function(tab) {
this._activeTab = tab;
};
Tabs2.prototype.getTab = function(id) {
return this._items.filter(function(t3) {
return t3.id === id;
})[0];
};
Tabs2.prototype.show = function(id, forceShow) {
var _a, _b;
var _this = this;
if (forceShow === void 0) {
forceShow = false;
}
var tab = this.getTab(id);
if (tab === this._activeTab && !forceShow) {
return;
}
this._items.map(function(t3) {
var _a2, _b2;
if (t3 !== tab) {
(_a2 = t3.triggerEl.classList).remove.apply(_a2, _this._options.activeClasses.split(" "));
(_b2 = t3.triggerEl.classList).add.apply(_b2, _this._options.inactiveClasses.split(" "));
t3.targetEl.classList.add("hidden");
t3.triggerEl.setAttribute("aria-selected", "false");
}
});
(_a = tab.triggerEl.classList).add.apply(_a, this._options.activeClasses.split(" "));
(_b = tab.triggerEl.classList).remove.apply(_b, this._options.inactiveClasses.split(" "));
tab.triggerEl.setAttribute("aria-selected", "true");
tab.targetEl.classList.remove("hidden");
this.setActiveTab(tab);
this._options.onShow(this, tab);
};
Tabs2.prototype.updateOnShow = function(callback) {
this._options.onShow = callback;
};
return Tabs2;
}()
);
function initTabs() {
document.querySelectorAll("[data-tabs-toggle]").forEach(function($parentEl) {
var tabItems = [];
var activeClasses = $parentEl.getAttribute("data-tabs-active-classes");
var inactiveClasses = $parentEl.getAttribute("data-tabs-inactive-classes");
var defaultTabId = null;
$parentEl.querySelectorAll('[role="tab"]').forEach(function($triggerEl) {
var isActive = $triggerEl.getAttribute("aria-selected") === "true";
var tab = {
id: $triggerEl.getAttribute("data-tabs-target"),
triggerEl: $triggerEl,
targetEl: document.querySelector($triggerEl.getAttribute("data-tabs-target"))
};
tabItems.push(tab);
if (isActive) {
defaultTabId = tab.id;
}
});
new Tabs($parentEl, tabItems, {
defaultTabId,
activeClasses: activeClasses ? activeClasses : Default8.activeClasses,
inactiveClasses: inactiveClasses ? inactiveClasses : Default8.inactiveClasses
});
});
}
if (typeof window !== "undefined") {
window.Tabs = Tabs;
window.initTabs = initTabs;
}
// node_modules/flowbite/lib/esm/components/tooltip/index.js
var __assign9 = function() {
__assign9 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign9.apply(this, arguments);
};
var __spreadArray2 = function(to, from, pack) {
if (pack || arguments.length === 2) for (var i3 = 0, l = from.length, ar; i3 < l; i3++) {
if (ar || !(i3 in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i3);
ar[i3] = from[i3];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var Default9 = {
placement: "top",
triggerType: "hover",
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
};
var DefaultInstanceOptions9 = {
id: null,
override: true
};
var Tooltip = (
/** @class */
function() {
function Tooltip2(targetEl, triggerEl, options, instanceOptions) {
if (targetEl === void 0) {
targetEl = null;
}
if (triggerEl === void 0) {
triggerEl = null;
}
if (options === void 0) {
options = Default9;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions9;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : targetEl.id;
this._targetEl = targetEl;
this._triggerEl = triggerEl;
this._options = __assign9(__assign9({}, Default9), options);
this._popperInstance = null;
this._visible = false;
this._initialized = false;
this.init();
instances_default.addInstance("Tooltip", this, this._instanceId, instanceOptions.override);
}
Tooltip2.prototype.init = function() {
if (this._triggerEl && this._targetEl && !this._initialized) {
this._setupEventListeners();
this._popperInstance = this._createPopperInstance();
this._initialized = true;
}
};
Tooltip2.prototype.destroy = function() {
var _this = this;
if (this._initialized) {
var triggerEvents = this._getTriggerEvents();
triggerEvents.showEvents.forEach(function(ev) {
_this._triggerEl.removeEventListener(ev, _this._showHandler);
});
triggerEvents.hideEvents.forEach(function(ev) {
_this._triggerEl.removeEventListener(ev, _this._hideHandler);
});
this._removeKeydownListener();
this._removeClickOutsideListener();
if (this._popperInstance) {
this._popperInstance.destroy();
}
this._initialized = false;
}
};
Tooltip2.prototype.removeInstance = function() {
instances_default.removeInstance("Tooltip", this._instanceId);
};
Tooltip2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Tooltip2.prototype._setupEventListeners = function() {
var _this = this;
var triggerEvents = this._getTriggerEvents();
this._showHandler = function() {
_this.show();
};
this._hideHandler = function() {
_this.hide();
};
triggerEvents.showEvents.forEach(function(ev) {
_this._triggerEl.addEventListener(ev, _this._showHandler);
});
triggerEvents.hideEvents.forEach(function(ev) {
_this._triggerEl.addEventListener(ev, _this._hideHandler);
});
};
Tooltip2.prototype._createPopperInstance = function() {
return createPopper(this._triggerEl, this._targetEl, {
placement: this._options.placement,
modifiers: [
{
name: "offset",
options: {
offset: [0, 8]
}
}
]
});
};
Tooltip2.prototype._getTriggerEvents = function() {
switch (this._options.triggerType) {
case "hover":
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
case "click":
return {
showEvents: ["click", "focus"],
hideEvents: ["focusout", "blur"]
};
case "none":
return {
showEvents: [],
hideEvents: []
};
default:
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
}
};
Tooltip2.prototype._setupKeydownListener = function() {
var _this = this;
this._keydownEventListener = function(ev) {
if (ev.key === "Escape") {
_this.hide();
}
};
document.body.addEventListener("keydown", this._keydownEventListener, true);
};
Tooltip2.prototype._removeKeydownListener = function() {
document.body.removeEventListener("keydown", this._keydownEventListener, true);
};
Tooltip2.prototype._setupClickOutsideListener = function() {
var _this = this;
this._clickOutsideEventListener = function(ev) {
_this._handleClickOutside(ev, _this._targetEl);
};
document.body.addEventListener("click", this._clickOutsideEventListener, true);
};
Tooltip2.prototype._removeClickOutsideListener = function() {
document.body.removeEventListener("click", this._clickOutsideEventListener, true);
};
Tooltip2.prototype._handleClickOutside = function(ev, targetEl) {
var clickedEl = ev.target;
if (clickedEl !== targetEl && !targetEl.contains(clickedEl) && !this._triggerEl.contains(clickedEl) && this.isVisible()) {
this.hide();
}
};
Tooltip2.prototype.isVisible = function() {
return this._visible;
};
Tooltip2.prototype.toggle = function() {
if (this.isVisible()) {
this.hide();
} else {
this.show();
}
};
Tooltip2.prototype.show = function() {
this._targetEl.classList.remove("opacity-0", "invisible");
this._targetEl.classList.add("opacity-100", "visible");
this._popperInstance.setOptions(function(options) {
return __assign9(__assign9({}, options), { modifiers: __spreadArray2(__spreadArray2([], options.modifiers, true), [
{ name: "eventListeners", enabled: true }
], false) });
});
this._setupClickOutsideListener();
this._setupKeydownListener();
this._popperInstance.update();
this._visible = true;
this._options.onShow(this);
};
Tooltip2.prototype.hide = function() {
this._targetEl.classList.remove("opacity-100", "visible");
this._targetEl.classList.add("opacity-0", "invisible");
this._popperInstance.setOptions(function(options) {
return __assign9(__assign9({}, options), { modifiers: __spreadArray2(__spreadArray2([], options.modifiers, true), [
{ name: "eventListeners", enabled: false }
], false) });
});
this._removeClickOutsideListener();
this._removeKeydownListener();
this._visible = false;
this._options.onHide(this);
};
Tooltip2.prototype.updateOnShow = function(callback) {
this._options.onShow = callback;
};
Tooltip2.prototype.updateOnHide = function(callback) {
this._options.onHide = callback;
};
Tooltip2.prototype.updateOnToggle = function(callback) {
this._options.onToggle = callback;
};
return Tooltip2;
}()
);
function initTooltips() {
document.querySelectorAll("[data-tooltip-target]").forEach(function($triggerEl) {
var tooltipId = $triggerEl.getAttribute("data-tooltip-target");
var $tooltipEl = document.getElementById(tooltipId);
if ($tooltipEl) {
var triggerType = $triggerEl.getAttribute("data-tooltip-trigger");
var placement = $triggerEl.getAttribute("data-tooltip-placement");
new Tooltip($tooltipEl, $triggerEl, {
placement: placement ? placement : Default9.placement,
triggerType: triggerType ? triggerType : Default9.triggerType
});
} else {
console.error('The tooltip element with id "'.concat(tooltipId, '" does not exist. Please check the data-tooltip-target attribute.'));
}
});
}
if (typeof window !== "undefined") {
window.Tooltip = Tooltip;
window.initTooltips = initTooltips;
}
// node_modules/flowbite/lib/esm/components/popover/index.js
var __assign10 = function() {
__assign10 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign10.apply(this, arguments);
};
var __spreadArray3 = function(to, from, pack) {
if (pack || arguments.length === 2) for (var i3 = 0, l = from.length, ar; i3 < l; i3++) {
if (ar || !(i3 in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i3);
ar[i3] = from[i3];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var Default10 = {
placement: "top",
offset: 10,
triggerType: "hover",
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
};
var DefaultInstanceOptions10 = {
id: null,
override: true
};
var Popover = (
/** @class */
function() {
function Popover2(targetEl, triggerEl, options, instanceOptions) {
if (targetEl === void 0) {
targetEl = null;
}
if (triggerEl === void 0) {
triggerEl = null;
}
if (options === void 0) {
options = Default10;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions10;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : targetEl.id;
this._targetEl = targetEl;
this._triggerEl = triggerEl;
this._options = __assign10(__assign10({}, Default10), options);
this._popperInstance = null;
this._visible = false;
this._initialized = false;
this.init();
instances_default.addInstance("Popover", this, instanceOptions.id ? instanceOptions.id : this._targetEl.id, instanceOptions.override);
}
Popover2.prototype.init = function() {
if (this._triggerEl && this._targetEl && !this._initialized) {
this._setupEventListeners();
this._popperInstance = this._createPopperInstance();
this._initialized = true;
}
};
Popover2.prototype.destroy = function() {
var _this = this;
if (this._initialized) {
var triggerEvents = this._getTriggerEvents();
triggerEvents.showEvents.forEach(function(ev) {
_this._triggerEl.removeEventListener(ev, _this._showHandler);
_this._targetEl.removeEventListener(ev, _this._showHandler);
});
triggerEvents.hideEvents.forEach(function(ev) {
_this._triggerEl.removeEventListener(ev, _this._hideHandler);
_this._targetEl.removeEventListener(ev, _this._hideHandler);
});
this._removeKeydownListener();
this._removeClickOutsideListener();
if (this._popperInstance) {
this._popperInstance.destroy();
}
this._initialized = false;
}
};
Popover2.prototype.removeInstance = function() {
instances_default.removeInstance("Popover", this._instanceId);
};
Popover2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Popover2.prototype._setupEventListeners = function() {
var _this = this;
var triggerEvents = this._getTriggerEvents();
this._showHandler = function() {
_this.show();
};
this._hideHandler = function() {
setTimeout(function() {
if (!_this._targetEl.matches(":hover")) {
_this.hide();
}
}, 100);
};
triggerEvents.showEvents.forEach(function(ev) {
_this._triggerEl.addEventListener(ev, _this._showHandler);
_this._targetEl.addEventListener(ev, _this._showHandler);
});
triggerEvents.hideEvents.forEach(function(ev) {
_this._triggerEl.addEventListener(ev, _this._hideHandler);
_this._targetEl.addEventListener(ev, _this._hideHandler);
});
};
Popover2.prototype._createPopperInstance = function() {
return createPopper(this._triggerEl, this._targetEl, {
placement: this._options.placement,
modifiers: [
{
name: "offset",
options: {
offset: [0, this._options.offset]
}
}
]
});
};
Popover2.prototype._getTriggerEvents = function() {
switch (this._options.triggerType) {
case "hover":
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
case "click":
return {
showEvents: ["click", "focus"],
hideEvents: ["focusout", "blur"]
};
case "none":
return {
showEvents: [],
hideEvents: []
};
default:
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
}
};
Popover2.prototype._setupKeydownListener = function() {
var _this = this;
this._keydownEventListener = function(ev) {
if (ev.key === "Escape") {
_this.hide();
}
};
document.body.addEventListener("keydown", this._keydownEventListener, true);
};
Popover2.prototype._removeKeydownListener = function() {
document.body.removeEventListener("keydown", this._keydownEventListener, true);
};
Popover2.prototype._setupClickOutsideListener = function() {
var _this = this;
this._clickOutsideEventListener = function(ev) {
_this._handleClickOutside(ev, _this._targetEl);
};
document.body.addEventListener("click", this._clickOutsideEventListener, true);
};
Popover2.prototype._removeClickOutsideListener = function() {
document.body.removeEventListener("click", this._clickOutsideEventListener, true);
};
Popover2.prototype._handleClickOutside = function(ev, targetEl) {
var clickedEl = ev.target;
if (clickedEl !== targetEl && !targetEl.contains(clickedEl) && !this._triggerEl.contains(clickedEl) && this.isVisible()) {
this.hide();
}
};
Popover2.prototype.isVisible = function() {
return this._visible;
};
Popover2.prototype.toggle = function() {
if (this.isVisible()) {
this.hide();
} else {
this.show();
}
this._options.onToggle(this);
};
Popover2.prototype.show = function() {
this._targetEl.classList.remove("opacity-0", "invisible");
this._targetEl.classList.add("opacity-100", "visible");
this._popperInstance.setOptions(function(options) {
return __assign10(__assign10({}, options), { modifiers: __spreadArray3(__spreadArray3([], options.modifiers, true), [
{ name: "eventListeners", enabled: true }
], false) });
});
this._setupClickOutsideListener();
this._setupKeydownListener();
this._popperInstance.update();
this._visible = true;
this._options.onShow(this);
};
Popover2.prototype.hide = function() {
this._targetEl.classList.remove("opacity-100", "visible");
this._targetEl.classList.add("opacity-0", "invisible");
this._popperInstance.setOptions(function(options) {
return __assign10(__assign10({}, options), { modifiers: __spreadArray3(__spreadArray3([], options.modifiers, true), [
{ name: "eventListeners", enabled: false }
], false) });
});
this._removeClickOutsideListener();
this._removeKeydownListener();
this._visible = false;
this._options.onHide(this);
};
Popover2.prototype.updateOnShow = function(callback) {
this._options.onShow = callback;
};
Popover2.prototype.updateOnHide = function(callback) {
this._options.onHide = callback;
};
Popover2.prototype.updateOnToggle = function(callback) {
this._options.onToggle = callback;
};
return Popover2;
}()
);
function initPopovers() {
document.querySelectorAll("[data-popover-target]").forEach(function($triggerEl) {
var popoverID = $triggerEl.getAttribute("data-popover-target");
var $popoverEl = document.getElementById(popoverID);
if ($popoverEl) {
var triggerType = $triggerEl.getAttribute("data-popover-trigger");
var placement = $triggerEl.getAttribute("data-popover-placement");
var offset2 = $triggerEl.getAttribute("data-popover-offset");
new Popover($popoverEl, $triggerEl, {
placement: placement ? placement : Default10.placement,
offset: offset2 ? parseInt(offset2) : Default10.offset,
triggerType: triggerType ? triggerType : Default10.triggerType
});
} else {
console.error('The popover element with id "'.concat(popoverID, '" does not exist. Please check the data-popover-target attribute.'));
}
});
}
if (typeof window !== "undefined") {
window.Popover = Popover;
window.initPopovers = initPopovers;
}
// node_modules/flowbite/lib/esm/components/dial/index.js
var __assign11 = function() {
__assign11 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign11.apply(this, arguments);
};
var Default11 = {
triggerType: "hover",
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
};
var DefaultInstanceOptions11 = {
id: null,
override: true
};
var Dial = (
/** @class */
function() {
function Dial2(parentEl, triggerEl, targetEl, options, instanceOptions) {
if (parentEl === void 0) {
parentEl = null;
}
if (triggerEl === void 0) {
triggerEl = null;
}
if (targetEl === void 0) {
targetEl = null;
}
if (options === void 0) {
options = Default11;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions11;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : targetEl.id;
this._parentEl = parentEl;
this._triggerEl = triggerEl;
this._targetEl = targetEl;
this._options = __assign11(__assign11({}, Default11), options);
this._visible = false;
this._initialized = false;
this.init();
instances_default.addInstance("Dial", this, this._instanceId, instanceOptions.override);
}
Dial2.prototype.init = function() {
var _this = this;
if (this._triggerEl && this._targetEl && !this._initialized) {
var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType);
this._showEventHandler = function() {
_this.show();
};
triggerEventTypes.showEvents.forEach(function(ev) {
_this._triggerEl.addEventListener(ev, _this._showEventHandler);
_this._targetEl.addEventListener(ev, _this._showEventHandler);
});
this._hideEventHandler = function() {
if (!_this._parentEl.matches(":hover")) {
_this.hide();
}
};
triggerEventTypes.hideEvents.forEach(function(ev) {
_this._parentEl.addEventListener(ev, _this._hideEventHandler);
});
this._initialized = true;
}
};
Dial2.prototype.destroy = function() {
var _this = this;
if (this._initialized) {
var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType);
triggerEventTypes.showEvents.forEach(function(ev) {
_this._triggerEl.removeEventListener(ev, _this._showEventHandler);
_this._targetEl.removeEventListener(ev, _this._showEventHandler);
});
triggerEventTypes.hideEvents.forEach(function(ev) {
_this._parentEl.removeEventListener(ev, _this._hideEventHandler);
});
this._initialized = false;
}
};
Dial2.prototype.removeInstance = function() {
instances_default.removeInstance("Dial", this._instanceId);
};
Dial2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Dial2.prototype.hide = function() {
this._targetEl.classList.add("hidden");
if (this._triggerEl) {
this._triggerEl.setAttribute("aria-expanded", "false");
}
this._visible = false;
this._options.onHide(this);
};
Dial2.prototype.show = function() {
this._targetEl.classList.remove("hidden");
if (this._triggerEl) {
this._triggerEl.setAttribute("aria-expanded", "true");
}
this._visible = true;
this._options.onShow(this);
};
Dial2.prototype.toggle = function() {
if (this._visible) {
this.hide();
} else {
this.show();
}
};
Dial2.prototype.isHidden = function() {
return !this._visible;
};
Dial2.prototype.isVisible = function() {
return this._visible;
};
Dial2.prototype._getTriggerEventTypes = function(triggerType) {
switch (triggerType) {
case "hover":
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
case "click":
return {
showEvents: ["click", "focus"],
hideEvents: ["focusout", "blur"]
};
case "none":
return {
showEvents: [],
hideEvents: []
};
default:
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
}
};
Dial2.prototype.updateOnShow = function(callback) {
this._options.onShow = callback;
};
Dial2.prototype.updateOnHide = function(callback) {
this._options.onHide = callback;
};
Dial2.prototype.updateOnToggle = function(callback) {
this._options.onToggle = callback;
};
return Dial2;
}()
);
function initDials() {
document.querySelectorAll("[data-dial-init]").forEach(function($parentEl) {
var $triggerEl = $parentEl.querySelector("[data-dial-toggle]");
if ($triggerEl) {
var dialId = $triggerEl.getAttribute("data-dial-toggle");
var $dialEl = document.getElementById(dialId);
if ($dialEl) {
var triggerType = $triggerEl.getAttribute("data-dial-trigger");
new Dial($parentEl, $triggerEl, $dialEl, {
triggerType: triggerType ? triggerType : Default11.triggerType
});
} else {
console.error("Dial with id ".concat(dialId, " does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"));
}
} else {
console.error("Dial with id ".concat($parentEl.id, " does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"));
}
});
}
if (typeof window !== "undefined") {
window.Dial = Dial;
window.initDials = initDials;
}
// node_modules/flowbite/lib/esm/components/input-counter/index.js
var __assign12 = function() {
__assign12 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign12.apply(this, arguments);
};
var Default12 = {
minValue: null,
maxValue: null,
onIncrement: function() {
},
onDecrement: function() {
}
};
var DefaultInstanceOptions12 = {
id: null,
override: true
};
var InputCounter = (
/** @class */
function() {
function InputCounter2(targetEl, incrementEl, decrementEl, options, instanceOptions) {
if (targetEl === void 0) {
targetEl = null;
}
if (incrementEl === void 0) {
incrementEl = null;
}
if (decrementEl === void 0) {
decrementEl = null;
}
if (options === void 0) {
options = Default12;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions12;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : targetEl.id;
this._targetEl = targetEl;
this._incrementEl = incrementEl;
this._decrementEl = decrementEl;
this._options = __assign12(__assign12({}, Default12), options);
this._initialized = false;
this.init();
instances_default.addInstance("InputCounter", this, this._instanceId, instanceOptions.override);
}
InputCounter2.prototype.init = function() {
var _this = this;
if (this._targetEl && !this._initialized) {
this._inputHandler = function(event) {
{
var target = event.target;
if (!/^\d*$/.test(target.value)) {
target.value = target.value.replace(/[^\d]/g, "");
}
if (_this._options.maxValue !== null && parseInt(target.value) > _this._options.maxValue) {
target.value = _this._options.maxValue.toString();
}
if (_this._options.minValue !== null && parseInt(target.value) < _this._options.minValue) {
target.value = _this._options.minValue.toString();
}
}
};
this._incrementClickHandler = function() {
_this.increment();
};
this._decrementClickHandler = function() {
_this.decrement();
};
this._targetEl.addEventListener("input", this._inputHandler);
if (this._incrementEl) {
this._incrementEl.addEventListener("click", this._incrementClickHandler);
}
if (this._decrementEl) {
this._decrementEl.addEventListener("click", this._decrementClickHandler);
}
this._initialized = true;
}
};
InputCounter2.prototype.destroy = function() {
if (this._targetEl && this._initialized) {
this._targetEl.removeEventListener("input", this._inputHandler);
if (this._incrementEl) {
this._incrementEl.removeEventListener("click", this._incrementClickHandler);
}
if (this._decrementEl) {
this._decrementEl.removeEventListener("click", this._decrementClickHandler);
}
this._initialized = false;
}
};
InputCounter2.prototype.removeInstance = function() {
instances_default.removeInstance("InputCounter", this._instanceId);
};
InputCounter2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
InputCounter2.prototype.getCurrentValue = function() {
return parseInt(this._targetEl.value) || 0;
};
InputCounter2.prototype.increment = function() {
if (this._options.maxValue !== null && this.getCurrentValue() >= this._options.maxValue) {
return;
}
this._targetEl.value = (this.getCurrentValue() + 1).toString();
this._options.onIncrement(this);
};
InputCounter2.prototype.decrement = function() {
if (this._options.minValue !== null && this.getCurrentValue() <= this._options.minValue) {
return;
}
this._targetEl.value = (this.getCurrentValue() - 1).toString();
this._options.onDecrement(this);
};
InputCounter2.prototype.updateOnIncrement = function(callback) {
this._options.onIncrement = callback;
};
InputCounter2.prototype.updateOnDecrement = function(callback) {
this._options.onDecrement = callback;
};
return InputCounter2;
}()
);
function initInputCounters() {
document.querySelectorAll("[data-input-counter]").forEach(function($targetEl) {
var targetId = $targetEl.id;
var $incrementEl = document.querySelector('[data-input-counter-increment="' + targetId + '"]');
var $decrementEl = document.querySelector('[data-input-counter-decrement="' + targetId + '"]');
var minValue = $targetEl.getAttribute("data-input-counter-min");
var maxValue = $targetEl.getAttribute("data-input-counter-max");
if ($targetEl) {
if (!instances_default.instanceExists("InputCounter", $targetEl.getAttribute("id"))) {
new InputCounter($targetEl, $incrementEl ? $incrementEl : null, $decrementEl ? $decrementEl : null, {
minValue: minValue ? parseInt(minValue) : null,
maxValue: maxValue ? parseInt(maxValue) : null
});
}
} else {
console.error('The target element with id "'.concat(targetId, '" does not exist. Please check the data-input-counter attribute.'));
}
});
}
if (typeof window !== "undefined") {
window.InputCounter = InputCounter;
window.initInputCounters = initInputCounters;
}
// node_modules/flowbite/lib/esm/components/clipboard/index.js
var __assign13 = function() {
__assign13 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign13.apply(this, arguments);
};
var Default13 = {
htmlEntities: false,
contentType: "input",
onCopy: function() {
}
};
var DefaultInstanceOptions13 = {
id: null,
override: true
};
var CopyClipboard = (
/** @class */
function() {
function CopyClipboard2(triggerEl, targetEl, options, instanceOptions) {
if (triggerEl === void 0) {
triggerEl = null;
}
if (targetEl === void 0) {
targetEl = null;
}
if (options === void 0) {
options = Default13;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions13;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : targetEl.id;
this._triggerEl = triggerEl;
this._targetEl = targetEl;
this._options = __assign13(__assign13({}, Default13), options);
this._initialized = false;
this.init();
instances_default.addInstance("CopyClipboard", this, this._instanceId, instanceOptions.override);
}
CopyClipboard2.prototype.init = function() {
var _this = this;
if (this._targetEl && this._triggerEl && !this._initialized) {
this._triggerElClickHandler = function() {
_this.copy();
};
if (this._triggerEl) {
this._triggerEl.addEventListener("click", this._triggerElClickHandler);
}
this._initialized = true;
}
};
CopyClipboard2.prototype.destroy = function() {
if (this._triggerEl && this._targetEl && this._initialized) {
if (this._triggerEl) {
this._triggerEl.removeEventListener("click", this._triggerElClickHandler);
}
this._initialized = false;
}
};
CopyClipboard2.prototype.removeInstance = function() {
instances_default.removeInstance("CopyClipboard", this._instanceId);
};
CopyClipboard2.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
CopyClipboard2.prototype.getTargetValue = function() {
if (this._options.contentType === "input") {
return this._targetEl.value;
}
if (this._options.contentType === "innerHTML") {
return this._targetEl.innerHTML;
}
if (this._options.contentType === "textContent") {
return this._targetEl.textContent.replace(/\s+/g, " ").trim();
}
};
CopyClipboard2.prototype.copy = function() {
var textToCopy = this.getTargetValue();
if (this._options.htmlEntities) {
textToCopy = this.decodeHTML(textToCopy);
}
var tempTextArea = document.createElement("textarea");
tempTextArea.value = textToCopy;
document.body.appendChild(tempTextArea);
tempTextArea.select();
document.execCommand("copy");
document.body.removeChild(tempTextArea);
this._options.onCopy(this);
return textToCopy;
};
CopyClipboard2.prototype.decodeHTML = function(html) {
var textarea = document.createElement("textarea");
textarea.innerHTML = html;
return textarea.textContent;
};
CopyClipboard2.prototype.updateOnCopyCallback = function(callback) {
this._options.onCopy = callback;
};
return CopyClipboard2;
}()
);
function initCopyClipboards() {
document.querySelectorAll("[data-copy-to-clipboard-target]").forEach(function($triggerEl) {
var targetId = $triggerEl.getAttribute("data-copy-to-clipboard-target");
var $targetEl = document.getElementById(targetId);
var contentType = $triggerEl.getAttribute("data-copy-to-clipboard-content-type");
var htmlEntities = $triggerEl.getAttribute("data-copy-to-clipboard-html-entities");
if ($targetEl) {
if (!instances_default.instanceExists("CopyClipboard", $targetEl.getAttribute("id"))) {
new CopyClipboard($triggerEl, $targetEl, {
htmlEntities: htmlEntities && htmlEntities === "true" ? true : Default13.htmlEntities,
contentType: contentType ? contentType : Default13.contentType
});
}
} else {
console.error('The target element with id "'.concat(targetId, '" does not exist. Please check the data-copy-to-clipboard-target attribute.'));
}
});
}
if (typeof window !== "undefined") {
window.CopyClipboard = CopyClipboard;
window.initClipboards = initCopyClipboards;
}
// node_modules/flowbite-datepicker/dist/main.esm.js
function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e2 = 0, n2 = Array(a); e2 < a; e2++) n2[e2] = r[e2];
return n2;
}
function _arrayWithHoles(r) {
if (Array.isArray(r)) return r;
}
function _arrayWithoutHoles(r) {
if (Array.isArray(r)) return _arrayLikeToArray(r);
}
function _assertThisInitialized(e2) {
if (void 0 === e2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e2;
}
function _callSuper(t3, o, e2) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t3, _isNativeReflectConstruct() ? Reflect.construct(o, e2 || [], _getPrototypeOf(t3).constructor) : o.apply(t3, e2));
}
function _classCallCheck(a, n2) {
if (!(a instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e2, r) {
for (var t3 = 0; t3 < r.length; t3++) {
var o = r[t3];
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e2, _toPropertyKey(o.key), o);
}
}
function _createClass(e2, r, t3) {
return r && _defineProperties(e2.prototype, r), t3 && _defineProperties(e2, t3), Object.defineProperty(e2, "prototype", {
writable: false
}), e2;
}
function _get() {
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e2, t3, r) {
var p = _superPropBase(e2, t3);
if (p) {
var n2 = Object.getOwnPropertyDescriptor(p, t3);
return n2.get ? n2.get.call(arguments.length < 3 ? e2 : r) : n2.value;
}
}, _get.apply(null, arguments);
}
function _getPrototypeOf(t3) {
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t4) {
return t4.__proto__ || Object.getPrototypeOf(t4);
}, _getPrototypeOf(t3);
}
function _inherits(t3, e2) {
if ("function" != typeof e2 && null !== e2) throw new TypeError("Super expression must either be null or a function");
t3.prototype = Object.create(e2 && e2.prototype, {
constructor: {
value: t3,
writable: true,
configurable: true
}
}), Object.defineProperty(t3, "prototype", {
writable: false
}), e2 && _setPrototypeOf(t3, e2);
}
function _isNativeReflectConstruct() {
try {
var t3 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
} catch (t4) {
}
return (_isNativeReflectConstruct = function() {
return !!t3;
})();
}
function _iterableToArray(r) {
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
function _iterableToArrayLimit(r, l) {
var t3 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t3) {
var e2, n2, i3, u, a = [], f = true, o = false;
try {
if (i3 = (t3 = t3.call(r)).next, 0 === l) {
if (Object(t3) !== t3) return;
f = false;
} else for (; !(f = (e2 = i3.call(t3)).done) && (a.push(e2.value), a.length !== l); f = true) ;
} catch (r2) {
o = true, n2 = r2;
} finally {
try {
if (!f && null != t3.return && (u = t3.return(), Object(u) !== u)) return;
} finally {
if (o) throw n2;
}
}
return a;
}
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _possibleConstructorReturn(t3, e2) {
if (e2 && ("object" == typeof e2 || "function" == typeof e2)) return e2;
if (void 0 !== e2) throw new TypeError("Derived constructors may only return object or undefined");
return _assertThisInitialized(t3);
}
function _setPrototypeOf(t3, e2) {
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t4, e3) {
return t4.__proto__ = e3, t4;
}, _setPrototypeOf(t3, e2);
}
function _slicedToArray(r, e2) {
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e2) || _unsupportedIterableToArray(r, e2) || _nonIterableRest();
}
function _superPropBase(t3, o) {
for (; !{}.hasOwnProperty.call(t3, o) && null !== (t3 = _getPrototypeOf(t3)); ) ;
return t3;
}
function _toConsumableArray(r) {
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}
function _toPrimitive(t3, r) {
if ("object" != typeof t3 || !t3) return t3;
var e2 = t3[Symbol.toPrimitive];
if (void 0 !== e2) {
var i3 = e2.call(t3, r || "default");
if ("object" != typeof i3) return i3;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t3);
}
function _toPropertyKey(t3) {
var i3 = _toPrimitive(t3, "string");
return "symbol" == typeof i3 ? i3 : i3 + "";
}
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
return typeof o2;
} : function(o2) {
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
}, _typeof(o);
}
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var t3 = {}.toString.call(r).slice(8, -1);
return "Object" === t3 && r.constructor && (t3 = r.constructor.name), "Map" === t3 || "Set" === t3 ? Array.from(r) : "Arguments" === t3 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t3) ? _arrayLikeToArray(r, a) : void 0;
}
}
function hasProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
function lastItemOf(arr) {
return arr[arr.length - 1];
}
function pushUnique(arr) {
for (var _len = arguments.length, items = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
items[_key - 1] = arguments[_key];
}
items.forEach(function(item) {
if (arr.includes(item)) {
return;
}
arr.push(item);
});
return arr;
}
function stringToArray(str, separator) {
return str ? str.split(separator) : [];
}
function isInRange(testVal, min4, max4) {
var minOK = min4 === void 0 || testVal >= min4;
var maxOK = max4 === void 0 || testVal <= max4;
return minOK && maxOK;
}
function limitToRange(val, min4, max4) {
if (val < min4) {
return min4;
}
if (val > max4) {
return max4;
}
return val;
}
function createTagRepeat(tagName, repeat) {
var attributes = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var index = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
var html = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "";
var openTagSrc = Object.keys(attributes).reduce(function(src, attr) {
var val = attributes[attr];
if (typeof val === "function") {
val = val(index);
}
return "".concat(src, " ").concat(attr, '="').concat(val, '"');
}, tagName);
html += "<".concat(openTagSrc, ">").concat(tagName, ">");
var next = index + 1;
return next < repeat ? createTagRepeat(tagName, repeat, attributes, next, html) : html;
}
function optimizeTemplateHTML(html) {
return html.replace(/>\s+/g, ">").replace(/\s+, "<");
}
function stripTime(timeValue) {
return new Date(timeValue).setHours(0, 0, 0, 0);
}
function today() {
return (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
}
function dateValue() {
switch (arguments.length) {
case 0:
return today();
case 1:
return stripTime(arguments.length <= 0 ? void 0 : arguments[0]);
}
var newDate = /* @__PURE__ */ new Date(0);
newDate.setFullYear.apply(newDate, arguments);
return newDate.setHours(0, 0, 0, 0);
}
function addDays(date, amount) {
var newDate = new Date(date);
return newDate.setDate(newDate.getDate() + amount);
}
function addWeeks(date, amount) {
return addDays(date, amount * 7);
}
function addMonths(date, amount) {
var newDate = new Date(date);
var monthsToSet = newDate.getMonth() + amount;
var expectedMonth = monthsToSet % 12;
if (expectedMonth < 0) {
expectedMonth += 12;
}
var time = newDate.setMonth(monthsToSet);
return newDate.getMonth() !== expectedMonth ? newDate.setDate(0) : time;
}
function addYears(date, amount) {
var newDate = new Date(date);
var expectedMonth = newDate.getMonth();
var time = newDate.setFullYear(newDate.getFullYear() + amount);
return expectedMonth === 1 && newDate.getMonth() === 2 ? newDate.setDate(0) : time;
}
function dayDiff(day, from) {
return (day - from + 7) % 7;
}
function dayOfTheWeekOf(baseDate, dayOfWeek) {
var weekStart = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
var baseDay = new Date(baseDate).getDay();
return addDays(baseDate, dayDiff(dayOfWeek, weekStart) - dayDiff(baseDay, weekStart));
}
function getWeek(date) {
var thuOfTheWeek = dayOfTheWeekOf(date, 4, 1);
var firstThu = dayOfTheWeekOf(new Date(thuOfTheWeek).setMonth(0, 4), 4, 1);
return Math.round((thuOfTheWeek - firstThu) / 6048e5) + 1;
}
function startOfYearPeriod(date, years) {
var year = new Date(date).getFullYear();
return Math.floor(year / years) * years;
}
var reFormatTokens = /dd?|DD?|mm?|MM?|yy?(?:yy)?/;
var reNonDateParts = /[\s!-/:-@[-`{-~年月日]+/;
var knownFormats = {};
var parseFns = {
y: function y(date, year) {
return new Date(date).setFullYear(parseInt(year, 10));
},
m: function m(date, month, locale) {
var newDate = new Date(date);
var monthIndex = parseInt(month, 10) - 1;
if (isNaN(monthIndex)) {
if (!month) {
return NaN;
}
var monthName = month.toLowerCase();
var compareNames = function compareNames2(name) {
return name.toLowerCase().startsWith(monthName);
};
monthIndex = locale.monthsShort.findIndex(compareNames);
if (monthIndex < 0) {
monthIndex = locale.months.findIndex(compareNames);
}
if (monthIndex < 0) {
return NaN;
}
}
newDate.setMonth(monthIndex);
return newDate.getMonth() !== normalizeMonth(monthIndex) ? newDate.setDate(0) : newDate.getTime();
},
d: function d(date, day) {
return new Date(date).setDate(parseInt(day, 10));
}
};
var formatFns = {
d: function d2(date) {
return date.getDate();
},
dd: function dd(date) {
return padZero(date.getDate(), 2);
},
D: function D(date, locale) {
return locale.daysShort[date.getDay()];
},
DD: function DD(date, locale) {
return locale.days[date.getDay()];
},
m: function m2(date) {
return date.getMonth() + 1;
},
mm: function mm(date) {
return padZero(date.getMonth() + 1, 2);
},
M: function M(date, locale) {
return locale.monthsShort[date.getMonth()];
},
MM: function MM(date, locale) {
return locale.months[date.getMonth()];
},
y: function y2(date) {
return date.getFullYear();
},
yy: function yy(date) {
return padZero(date.getFullYear(), 2).slice(-2);
},
yyyy: function yyyy(date) {
return padZero(date.getFullYear(), 4);
}
};
function normalizeMonth(monthIndex) {
return monthIndex > -1 ? monthIndex % 12 : normalizeMonth(monthIndex + 12);
}
function padZero(num, length) {
return num.toString().padStart(length, "0");
}
function parseFormatString(format2) {
if (typeof format2 !== "string") {
throw new Error("Invalid date format.");
}
if (format2 in knownFormats) {
return knownFormats[format2];
}
var separators = format2.split(reFormatTokens);
var parts = format2.match(new RegExp(reFormatTokens, "g"));
if (separators.length === 0 || !parts) {
throw new Error("Invalid date format.");
}
var partFormatters = parts.map(function(token) {
return formatFns[token];
});
var partParserKeys = Object.keys(parseFns).reduce(function(keys, key) {
var token = parts.find(function(part) {
return part[0] !== "D" && part[0].toLowerCase() === key;
});
if (token) {
keys.push(key);
}
return keys;
}, []);
return knownFormats[format2] = {
parser: function parser(dateStr, locale) {
var dateParts = dateStr.split(reNonDateParts).reduce(function(dtParts, part, index) {
if (part.length > 0 && parts[index]) {
var token = parts[index][0];
if (token === "M") {
dtParts.m = part;
} else if (token !== "D") {
dtParts[token] = part;
}
}
return dtParts;
}, {});
return partParserKeys.reduce(function(origDate, key) {
var newDate = parseFns[key](origDate, dateParts[key], locale);
return isNaN(newDate) ? origDate : newDate;
}, today());
},
formatter: function formatter(date, locale) {
var dateStr = partFormatters.reduce(function(str, fn2, index) {
return str += "".concat(separators[index]).concat(fn2(date, locale));
}, "");
return dateStr += lastItemOf(separators);
}
};
}
function parseDate(dateStr, format2, locale) {
if (dateStr instanceof Date || typeof dateStr === "number") {
var date = stripTime(dateStr);
return isNaN(date) ? void 0 : date;
}
if (!dateStr) {
return void 0;
}
if (dateStr === "today") {
return today();
}
if (format2 && format2.toValue) {
var _date = format2.toValue(dateStr, format2, locale);
return isNaN(_date) ? void 0 : stripTime(_date);
}
return parseFormatString(format2).parser(dateStr, locale);
}
function formatDate(date, format2, locale) {
if (isNaN(date) || !date && date !== 0) {
return "";
}
var dateObj = typeof date === "number" ? new Date(date) : date;
if (format2.toDisplay) {
return format2.toDisplay(dateObj, format2, locale);
}
return parseFormatString(format2).formatter(dateObj, locale);
}
var listenerRegistry = /* @__PURE__ */ new WeakMap();
var _EventTarget$prototyp = EventTarget.prototype;
var addEventListener = _EventTarget$prototyp.addEventListener;
var removeEventListener = _EventTarget$prototyp.removeEventListener;
function registerListeners(keyObj, listeners) {
var registered = listenerRegistry.get(keyObj);
if (!registered) {
registered = [];
listenerRegistry.set(keyObj, registered);
}
listeners.forEach(function(listener) {
addEventListener.call.apply(addEventListener, _toConsumableArray(listener));
registered.push(listener);
});
}
function unregisterListeners(keyObj) {
var listeners = listenerRegistry.get(keyObj);
if (!listeners) {
return;
}
listeners.forEach(function(listener) {
removeEventListener.call.apply(removeEventListener, _toConsumableArray(listener));
});
listenerRegistry["delete"](keyObj);
}
if (!Event.prototype.composedPath) {
getComposedPath = function getComposedPath2(node) {
var path = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
path.push(node);
var parent;
if (node.parentNode) {
parent = node.parentNode;
} else if (node.host) {
parent = node.host;
} else if (node.defaultView) {
parent = node.defaultView;
}
return parent ? getComposedPath2(parent, path) : path;
};
Event.prototype.composedPath = function() {
return getComposedPath(this.target);
};
}
var getComposedPath;
function findFromPath(path, criteria, currentTarget) {
var index = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
var el = path[index];
if (criteria(el)) {
return el;
} else if (el === currentTarget || !el.parentElement) {
return;
}
return findFromPath(path, criteria, currentTarget, index + 1);
}
function findElementInEventPath(ev, selector3) {
var criteria = typeof selector3 === "function" ? selector3 : function(el) {
return el.matches(selector3);
};
return findFromPath(ev.composedPath(), criteria, ev.currentTarget);
}
var locales = {
en: {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
today: "Today",
clear: "Clear",
titleFormat: "MM y"
}
};
var defaultOptions = {
autohide: false,
beforeShowDay: null,
beforeShowDecade: null,
beforeShowMonth: null,
beforeShowYear: null,
calendarWeeks: false,
clearBtn: false,
dateDelimiter: ",",
datesDisabled: [],
daysOfWeekDisabled: [],
daysOfWeekHighlighted: [],
defaultViewDate: void 0,
// placeholder, defaults to today() by the program
disableTouchKeyboard: false,
format: "mm/dd/yyyy",
language: "en",
maxDate: null,
maxNumberOfDates: 1,
maxView: 3,
minDate: null,
nextArrow: '',
orientation: "auto",
pickLevel: 0,
prevArrow: '',
showDaysOfWeek: true,
showOnClick: true,
showOnFocus: true,
startView: 0,
title: "",
todayBtn: false,
todayBtnMode: 0,
todayHighlight: false,
updateOnBlur: true,
weekStart: 0
};
var range = null;
function parseHTML(html) {
if (range == null) {
range = document.createRange();
}
return range.createContextualFragment(html);
}
function hideElement(el) {
if (el.style.display === "none") {
return;
}
if (el.style.display) {
el.dataset.styleDisplay = el.style.display;
}
el.style.display = "none";
}
function showElement(el) {
if (el.style.display !== "none") {
return;
}
if (el.dataset.styleDisplay) {
el.style.display = el.dataset.styleDisplay;
delete el.dataset.styleDisplay;
} else {
el.style.display = "";
}
}
function emptyChildNodes(el) {
if (el.firstChild) {
el.removeChild(el.firstChild);
emptyChildNodes(el);
}
}
function replaceChildNodes(el, newChildNodes) {
emptyChildNodes(el);
if (newChildNodes instanceof DocumentFragment) {
el.appendChild(newChildNodes);
} else if (typeof newChildNodes === "string") {
el.appendChild(parseHTML(newChildNodes));
} else if (typeof newChildNodes.forEach === "function") {
newChildNodes.forEach(function(node) {
el.appendChild(node);
});
}
}
var defaultLang = defaultOptions.language;
var defaultFormat = defaultOptions.format;
var defaultWeekStart = defaultOptions.weekStart;
function sanitizeDOW(dow, day) {
return dow.length < 6 && day >= 0 && day < 7 ? pushUnique(dow, day) : dow;
}
function calcEndOfWeek(startOfWeek) {
return (startOfWeek + 6) % 7;
}
function validateDate(value, format2, locale, origValue) {
var date = parseDate(value, format2, locale);
return date !== void 0 ? date : origValue;
}
function validateViewId(value, origValue) {
var max4 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 3;
var viewId = parseInt(value, 10);
return viewId >= 0 && viewId <= max4 ? viewId : origValue;
}
function processOptions(options, datepicker) {
var inOpts = Object.assign({}, options);
var config3 = {};
var locales2 = datepicker.constructor.locales;
var _ref = datepicker.config || {}, format2 = _ref.format, language = _ref.language, locale = _ref.locale, maxDate = _ref.maxDate, maxView = _ref.maxView, minDate = _ref.minDate, pickLevel = _ref.pickLevel, startView = _ref.startView, weekStart = _ref.weekStart;
if (inOpts.language) {
var lang;
if (inOpts.language !== language) {
if (locales2[inOpts.language]) {
lang = inOpts.language;
} else {
lang = inOpts.language.split("-")[0];
if (locales2[lang] === void 0) {
lang = false;
}
}
}
delete inOpts.language;
if (lang) {
language = config3.language = lang;
var origLocale = locale || locales2[defaultLang];
locale = Object.assign({
format: defaultFormat,
weekStart: defaultWeekStart
}, locales2[defaultLang]);
if (language !== defaultLang) {
Object.assign(locale, locales2[language]);
}
config3.locale = locale;
if (format2 === origLocale.format) {
format2 = config3.format = locale.format;
}
if (weekStart === origLocale.weekStart) {
weekStart = config3.weekStart = locale.weekStart;
config3.weekEnd = calcEndOfWeek(locale.weekStart);
}
}
}
if (inOpts.format) {
var hasToDisplay = typeof inOpts.format.toDisplay === "function";
var hasToValue = typeof inOpts.format.toValue === "function";
var validFormatString = reFormatTokens.test(inOpts.format);
if (hasToDisplay && hasToValue || validFormatString) {
format2 = config3.format = inOpts.format;
}
delete inOpts.format;
}
var minDt = minDate;
var maxDt = maxDate;
if (inOpts.minDate !== void 0) {
minDt = inOpts.minDate === null ? dateValue(0, 0, 1) : validateDate(inOpts.minDate, format2, locale, minDt);
delete inOpts.minDate;
}
if (inOpts.maxDate !== void 0) {
maxDt = inOpts.maxDate === null ? void 0 : validateDate(inOpts.maxDate, format2, locale, maxDt);
delete inOpts.maxDate;
}
if (maxDt < minDt) {
minDate = config3.minDate = maxDt;
maxDate = config3.maxDate = minDt;
} else {
if (minDate !== minDt) {
minDate = config3.minDate = minDt;
}
if (maxDate !== maxDt) {
maxDate = config3.maxDate = maxDt;
}
}
if (inOpts.datesDisabled) {
config3.datesDisabled = inOpts.datesDisabled.reduce(function(dates, dt) {
var date = parseDate(dt, format2, locale);
return date !== void 0 ? pushUnique(dates, date) : dates;
}, []);
delete inOpts.datesDisabled;
}
if (inOpts.defaultViewDate !== void 0) {
var viewDate = parseDate(inOpts.defaultViewDate, format2, locale);
if (viewDate !== void 0) {
config3.defaultViewDate = viewDate;
}
delete inOpts.defaultViewDate;
}
if (inOpts.weekStart !== void 0) {
var wkStart = Number(inOpts.weekStart) % 7;
if (!isNaN(wkStart)) {
weekStart = config3.weekStart = wkStart;
config3.weekEnd = calcEndOfWeek(wkStart);
}
delete inOpts.weekStart;
}
if (inOpts.daysOfWeekDisabled) {
config3.daysOfWeekDisabled = inOpts.daysOfWeekDisabled.reduce(sanitizeDOW, []);
delete inOpts.daysOfWeekDisabled;
}
if (inOpts.daysOfWeekHighlighted) {
config3.daysOfWeekHighlighted = inOpts.daysOfWeekHighlighted.reduce(sanitizeDOW, []);
delete inOpts.daysOfWeekHighlighted;
}
if (inOpts.maxNumberOfDates !== void 0) {
var maxNumberOfDates = parseInt(inOpts.maxNumberOfDates, 10);
if (maxNumberOfDates >= 0) {
config3.maxNumberOfDates = maxNumberOfDates;
config3.multidate = maxNumberOfDates !== 1;
}
delete inOpts.maxNumberOfDates;
}
if (inOpts.dateDelimiter) {
config3.dateDelimiter = String(inOpts.dateDelimiter);
delete inOpts.dateDelimiter;
}
var newPickLevel = pickLevel;
if (inOpts.pickLevel !== void 0) {
newPickLevel = validateViewId(inOpts.pickLevel, 2);
delete inOpts.pickLevel;
}
if (newPickLevel !== pickLevel) {
pickLevel = config3.pickLevel = newPickLevel;
}
var newMaxView = maxView;
if (inOpts.maxView !== void 0) {
newMaxView = validateViewId(inOpts.maxView, maxView);
delete inOpts.maxView;
}
newMaxView = pickLevel > newMaxView ? pickLevel : newMaxView;
if (newMaxView !== maxView) {
maxView = config3.maxView = newMaxView;
}
var newStartView = startView;
if (inOpts.startView !== void 0) {
newStartView = validateViewId(inOpts.startView, newStartView);
delete inOpts.startView;
}
if (newStartView < pickLevel) {
newStartView = pickLevel;
} else if (newStartView > maxView) {
newStartView = maxView;
}
if (newStartView !== startView) {
config3.startView = newStartView;
}
if (inOpts.prevArrow) {
var prevArrow = parseHTML(inOpts.prevArrow);
if (prevArrow.childNodes.length > 0) {
config3.prevArrow = prevArrow.childNodes;
}
delete inOpts.prevArrow;
}
if (inOpts.nextArrow) {
var nextArrow = parseHTML(inOpts.nextArrow);
if (nextArrow.childNodes.length > 0) {
config3.nextArrow = nextArrow.childNodes;
}
delete inOpts.nextArrow;
}
if (inOpts.disableTouchKeyboard !== void 0) {
config3.disableTouchKeyboard = "ontouchstart" in document && !!inOpts.disableTouchKeyboard;
delete inOpts.disableTouchKeyboard;
}
if (inOpts.orientation) {
var orientation = inOpts.orientation.toLowerCase().split(/\s+/g);
config3.orientation = {
x: orientation.find(function(x) {
return x === "left" || x === "right";
}) || "auto",
y: orientation.find(function(y3) {
return y3 === "top" || y3 === "bottom";
}) || "auto"
};
delete inOpts.orientation;
}
if (inOpts.todayBtnMode !== void 0) {
switch (inOpts.todayBtnMode) {
case 0:
case 1:
config3.todayBtnMode = inOpts.todayBtnMode;
}
delete inOpts.todayBtnMode;
}
Object.keys(inOpts).forEach(function(key) {
if (inOpts[key] !== void 0 && hasProperty(defaultOptions, key)) {
config3[key] = inOpts[key];
}
});
return config3;
}
var pickerTemplate = optimizeTemplateHTML('
');
var daysTemplate = optimizeTemplateHTML('\n
'.concat(createTagRepeat("span", 7, {
"class": "dow block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm"
}), '
\n
').concat(createTagRepeat("span", 42, {
"class": "block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400"
}), "
\n
"));
var calendarWeeksTemplate = optimizeTemplateHTML('\n
\n
'.concat(createTagRepeat("span", 6, {
"class": "week block flex-1 leading-9 border-0 rounded-lg cursor-default text-center text-gray-900 font-semibold text-sm"
}), "
\n
"));
var View = /* @__PURE__ */ function() {
function View2(picker, config3) {
_classCallCheck(this, View2);
Object.assign(this, config3, {
picker,
element: parseHTML('').firstChild,
selected: []
});
this.init(this.picker.datepicker.config);
}
return _createClass(View2, [{
key: "init",
value: function init4(options) {
if (options.pickLevel !== void 0) {
this.isMinView = this.id === options.pickLevel;
}
this.setOptions(options);
this.updateFocus();
this.updateSelection();
}
// Execute beforeShow() callback and apply the result to the element
// args:
// - current - current value on the iteration on view rendering
// - timeValue - time value of the date to pass to beforeShow()
}, {
key: "performBeforeHook",
value: function performBeforeHook(el, current, timeValue) {
var result = this.beforeShow(new Date(timeValue));
switch (_typeof(result)) {
case "boolean":
result = {
enabled: result
};
break;
case "string":
result = {
classes: result
};
}
if (result) {
if (result.enabled === false) {
el.classList.add("disabled");
pushUnique(this.disabled, current);
}
if (result.classes) {
var _el$classList;
var extraClasses = result.classes.split(/\s+/);
(_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(extraClasses));
if (extraClasses.includes("disabled")) {
pushUnique(this.disabled, current);
}
}
if (result.content) {
replaceChildNodes(el, result.content);
}
}
}
}]);
}();
var DaysView = /* @__PURE__ */ function(_View) {
function DaysView2(picker) {
_classCallCheck(this, DaysView2);
return _callSuper(this, DaysView2, [picker, {
id: 0,
name: "days",
cellClass: "day"
}]);
}
_inherits(DaysView2, _View);
return _createClass(DaysView2, [{
key: "init",
value: function init4(options) {
var onConstruction = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
if (onConstruction) {
var inner = parseHTML(daysTemplate).firstChild;
this.dow = inner.firstChild;
this.grid = inner.lastChild;
this.element.appendChild(inner);
}
_get(_getPrototypeOf(DaysView2.prototype), "init", this).call(this, options);
}
}, {
key: "setOptions",
value: function setOptions(options) {
var _this = this;
var updateDOW;
if (hasProperty(options, "minDate")) {
this.minDate = options.minDate;
}
if (hasProperty(options, "maxDate")) {
this.maxDate = options.maxDate;
}
if (options.datesDisabled) {
this.datesDisabled = options.datesDisabled;
}
if (options.daysOfWeekDisabled) {
this.daysOfWeekDisabled = options.daysOfWeekDisabled;
updateDOW = true;
}
if (options.daysOfWeekHighlighted) {
this.daysOfWeekHighlighted = options.daysOfWeekHighlighted;
}
if (options.todayHighlight !== void 0) {
this.todayHighlight = options.todayHighlight;
}
if (options.weekStart !== void 0) {
this.weekStart = options.weekStart;
this.weekEnd = options.weekEnd;
updateDOW = true;
}
if (options.locale) {
var locale = this.locale = options.locale;
this.dayNames = locale.daysMin;
this.switchLabelFormat = locale.titleFormat;
updateDOW = true;
}
if (options.beforeShowDay !== void 0) {
this.beforeShow = typeof options.beforeShowDay === "function" ? options.beforeShowDay : void 0;
}
if (options.calendarWeeks !== void 0) {
if (options.calendarWeeks && !this.calendarWeeks) {
var weeksElem = parseHTML(calendarWeeksTemplate).firstChild;
this.calendarWeeks = {
element: weeksElem,
dow: weeksElem.firstChild,
weeks: weeksElem.lastChild
};
this.element.insertBefore(weeksElem, this.element.firstChild);
} else if (this.calendarWeeks && !options.calendarWeeks) {
this.element.removeChild(this.calendarWeeks.element);
this.calendarWeeks = null;
}
}
if (options.showDaysOfWeek !== void 0) {
if (options.showDaysOfWeek) {
showElement(this.dow);
if (this.calendarWeeks) {
showElement(this.calendarWeeks.dow);
}
} else {
hideElement(this.dow);
if (this.calendarWeeks) {
hideElement(this.calendarWeeks.dow);
}
}
}
if (updateDOW) {
Array.from(this.dow.children).forEach(function(el, index) {
var dow = (_this.weekStart + index) % 7;
el.textContent = _this.dayNames[dow];
el.className = _this.daysOfWeekDisabled.includes(dow) ? "dow disabled text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400 cursor-not-allowed" : "dow text-center h-6 leading-6 text-sm font-medium text-gray-500 dark:text-gray-400";
});
}
}
// Apply update on the focused date to view's settings
}, {
key: "updateFocus",
value: function updateFocus() {
var viewDate = new Date(this.picker.viewDate);
var viewYear = viewDate.getFullYear();
var viewMonth = viewDate.getMonth();
var firstOfMonth = dateValue(viewYear, viewMonth, 1);
var start3 = dayOfTheWeekOf(firstOfMonth, this.weekStart, this.weekStart);
this.first = firstOfMonth;
this.last = dateValue(viewYear, viewMonth + 1, 0);
this.start = start3;
this.focused = this.picker.viewDate;
}
// Apply update on the selected dates to view's settings
}, {
key: "updateSelection",
value: function updateSelection() {
var _this$picker$datepick = this.picker.datepicker, dates = _this$picker$datepick.dates, rangepicker = _this$picker$datepick.rangepicker;
this.selected = dates;
if (rangepicker) {
this.range = rangepicker.dates;
}
}
// Update the entire view UI
}, {
key: "render",
value: function render3() {
var _this2 = this;
this.today = this.todayHighlight ? today() : void 0;
this.disabled = _toConsumableArray(this.datesDisabled);
var switchLabel = formatDate(this.focused, this.switchLabelFormat, this.locale);
this.picker.setViewSwitchLabel(switchLabel);
this.picker.setPrevBtnDisabled(this.first <= this.minDate);
this.picker.setNextBtnDisabled(this.last >= this.maxDate);
if (this.calendarWeeks) {
var startOfWeek = dayOfTheWeekOf(this.first, 1, 1);
Array.from(this.calendarWeeks.weeks.children).forEach(function(el, index) {
el.textContent = getWeek(addWeeks(startOfWeek, index));
});
}
Array.from(this.grid.children).forEach(function(el, index) {
var classList = el.classList;
var current = addDays(_this2.start, index);
var date = new Date(current);
var day = date.getDay();
el.className = "datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ".concat(_this2.cellClass);
el.dataset.date = current;
el.textContent = date.getDate();
if (current < _this2.first) {
classList.add("prev", "text-gray-500", "dark:text-white");
} else if (current > _this2.last) {
classList.add("next", "text-gray-500", "dark:text-white");
}
if (_this2.today === current) {
classList.add("today", "bg-gray-100", "dark:bg-gray-600");
}
if (current < _this2.minDate || current > _this2.maxDate || _this2.disabled.includes(current)) {
classList.add("disabled", "cursor-not-allowed", "text-gray-400", "dark:text-gray-500");
classList.remove("hover:bg-gray-100", "dark:hover:bg-gray-600", "text-gray-900", "dark:text-white", "cursor-pointer");
}
if (_this2.daysOfWeekDisabled.includes(day)) {
classList.add("disabled", "cursor-not-allowed", "text-gray-400", "dark:text-gray-500");
classList.remove("hover:bg-gray-100", "dark:hover:bg-gray-600", "text-gray-900", "dark:text-white", "cursor-pointer");
pushUnique(_this2.disabled, current);
}
if (_this2.daysOfWeekHighlighted.includes(day)) {
classList.add("highlighted");
}
if (_this2.range) {
var _this2$range = _slicedToArray(_this2.range, 2), rangeStart = _this2$range[0], rangeEnd = _this2$range[1];
if (current > rangeStart && current < rangeEnd) {
classList.add("range", "bg-gray-200", "dark:bg-gray-600");
classList.remove("rounded-lg", "rounded-l-lg", "rounded-r-lg");
}
if (current === rangeStart) {
classList.add("range-start", "bg-gray-100", "dark:bg-gray-600", "rounded-l-lg");
classList.remove("rounded-lg", "rounded-r-lg");
}
if (current === rangeEnd) {
classList.add("range-end", "bg-gray-100", "dark:bg-gray-600", "rounded-r-lg");
classList.remove("rounded-lg", "rounded-l-lg");
}
}
if (_this2.selected.includes(current)) {
classList.add("selected", "bg-blue-700", "!bg-primary-700", "text-white", "dark:bg-blue-600", "dark:!bg-primary-600", "dark:text-white");
classList.remove("text-gray-900", "text-gray-500", "hover:bg-gray-100", "dark:text-white", "dark:hover:bg-gray-600", "dark:bg-gray-600", "bg-gray-100", "bg-gray-200");
}
if (current === _this2.focused) {
classList.add("focused");
}
if (_this2.beforeShow) {
_this2.performBeforeHook(el, current, current);
}
});
}
// Update the view UI by applying the changes of selected and focused items
}, {
key: "refresh",
value: function refresh() {
var _this3 = this;
var _ref = this.range || [], _ref2 = _slicedToArray(_ref, 2), rangeStart = _ref2[0], rangeEnd = _ref2[1];
this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(function(el) {
el.classList.remove("range", "range-start", "range-end", "selected", "bg-blue-700", "!bg-primary-700", "text-white", "dark:bg-blue-600", "dark:!bg-primary-600", "dark:text-white", "focused");
el.classList.add("text-gray-900", "rounded-lg", "dark:text-white");
});
Array.from(this.grid.children).forEach(function(el) {
var current = Number(el.dataset.date);
var classList = el.classList;
classList.remove("bg-gray-200", "dark:bg-gray-600", "rounded-l-lg", "rounded-r-lg");
if (current > rangeStart && current < rangeEnd) {
classList.add("range", "bg-gray-200", "dark:bg-gray-600");
classList.remove("rounded-lg");
}
if (current === rangeStart) {
classList.add("range-start", "bg-gray-200", "dark:bg-gray-600", "rounded-l-lg");
classList.remove("rounded-lg");
}
if (current === rangeEnd) {
classList.add("range-end", "bg-gray-200", "dark:bg-gray-600", "rounded-r-lg");
classList.remove("rounded-lg");
}
if (_this3.selected.includes(current)) {
classList.add("selected", "bg-blue-700", "!bg-primary-700", "text-white", "dark:bg-blue-600", "dark:!bg-primary-600", "dark:text-white");
classList.remove("text-gray-900", "hover:bg-gray-100", "dark:text-white", "dark:hover:bg-gray-600", "bg-gray-100", "bg-gray-200", "dark:bg-gray-600");
}
if (current === _this3.focused) {
classList.add("focused");
}
});
}
// Update the view UI by applying the change of focused item
}, {
key: "refreshFocus",
value: function refreshFocus() {
var index = Math.round((this.focused - this.start) / 864e5);
this.grid.querySelectorAll(".focused").forEach(function(el) {
el.classList.remove("focused");
});
this.grid.children[index].classList.add("focused");
}
}]);
}(View);
function computeMonthRange(range2, thisYear) {
if (!range2 || !range2[0] || !range2[1]) {
return;
}
var _range = _slicedToArray(range2, 2), _range$ = _slicedToArray(_range[0], 2), startY = _range$[0], startM = _range$[1], _range$2 = _slicedToArray(_range[1], 2), endY = _range$2[0], endM = _range$2[1];
if (startY > thisYear || endY < thisYear) {
return;
}
return [startY === thisYear ? startM : -1, endY === thisYear ? endM : 12];
}
var MonthsView = /* @__PURE__ */ function(_View) {
function MonthsView2(picker) {
_classCallCheck(this, MonthsView2);
return _callSuper(this, MonthsView2, [picker, {
id: 1,
name: "months",
cellClass: "month"
}]);
}
_inherits(MonthsView2, _View);
return _createClass(MonthsView2, [{
key: "init",
value: function init4(options) {
var onConstruction = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
if (onConstruction) {
this.grid = this.element;
this.element.classList.add("months", "datepicker-grid", "w-64", "grid", "grid-cols-4");
this.grid.appendChild(parseHTML(createTagRepeat("span", 12, {
"data-month": function dataMonth(ix) {
return ix;
}
})));
}
_get(_getPrototypeOf(MonthsView2.prototype), "init", this).call(this, options);
}
}, {
key: "setOptions",
value: function setOptions(options) {
if (options.locale) {
this.monthNames = options.locale.monthsShort;
}
if (hasProperty(options, "minDate")) {
if (options.minDate === void 0) {
this.minYear = this.minMonth = this.minDate = void 0;
} else {
var minDateObj = new Date(options.minDate);
this.minYear = minDateObj.getFullYear();
this.minMonth = minDateObj.getMonth();
this.minDate = minDateObj.setDate(1);
}
}
if (hasProperty(options, "maxDate")) {
if (options.maxDate === void 0) {
this.maxYear = this.maxMonth = this.maxDate = void 0;
} else {
var maxDateObj = new Date(options.maxDate);
this.maxYear = maxDateObj.getFullYear();
this.maxMonth = maxDateObj.getMonth();
this.maxDate = dateValue(this.maxYear, this.maxMonth + 1, 0);
}
}
if (options.beforeShowMonth !== void 0) {
this.beforeShow = typeof options.beforeShowMonth === "function" ? options.beforeShowMonth : void 0;
}
}
// Update view's settings to reflect the viewDate set on the picker
}, {
key: "updateFocus",
value: function updateFocus() {
var viewDate = new Date(this.picker.viewDate);
this.year = viewDate.getFullYear();
this.focused = viewDate.getMonth();
}
// Update view's settings to reflect the selected dates
}, {
key: "updateSelection",
value: function updateSelection() {
var _this$picker$datepick = this.picker.datepicker, dates = _this$picker$datepick.dates, rangepicker = _this$picker$datepick.rangepicker;
this.selected = dates.reduce(function(selected, timeValue) {
var date = new Date(timeValue);
var year = date.getFullYear();
var month = date.getMonth();
if (selected[year] === void 0) {
selected[year] = [month];
} else {
pushUnique(selected[year], month);
}
return selected;
}, {});
if (rangepicker && rangepicker.dates) {
this.range = rangepicker.dates.map(function(timeValue) {
var date = new Date(timeValue);
return isNaN(date) ? void 0 : [date.getFullYear(), date.getMonth()];
});
}
}
// Update the entire view UI
}, {
key: "render",
value: function render3() {
var _this = this;
this.disabled = [];
this.picker.setViewSwitchLabel(this.year);
this.picker.setPrevBtnDisabled(this.year <= this.minYear);
this.picker.setNextBtnDisabled(this.year >= this.maxYear);
var selected = this.selected[this.year] || [];
var yrOutOfRange = this.year < this.minYear || this.year > this.maxYear;
var isMinYear = this.year === this.minYear;
var isMaxYear = this.year === this.maxYear;
var range2 = computeMonthRange(this.range, this.year);
Array.from(this.grid.children).forEach(function(el, index) {
var classList = el.classList;
var date = dateValue(_this.year, index, 1);
el.className = "datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ".concat(_this.cellClass);
if (_this.isMinView) {
el.dataset.date = date;
}
el.textContent = _this.monthNames[index];
if (yrOutOfRange || isMinYear && index < _this.minMonth || isMaxYear && index > _this.maxMonth) {
classList.add("disabled");
}
if (range2) {
var _range2 = _slicedToArray(range2, 2), rangeStart = _range2[0], rangeEnd = _range2[1];
if (index > rangeStart && index < rangeEnd) {
classList.add("range");
}
if (index === rangeStart) {
classList.add("range-start");
}
if (index === rangeEnd) {
classList.add("range-end");
}
}
if (selected.includes(index)) {
classList.add("selected", "bg-blue-700", "!bg-primary-700", "text-white", "dark:bg-blue-600", "dark:!bg-primary-600", "dark:text-white");
classList.remove("text-gray-900", "hover:bg-gray-100", "dark:text-white", "dark:hover:bg-gray-600");
}
if (index === _this.focused) {
classList.add("focused");
}
if (_this.beforeShow) {
_this.performBeforeHook(el, index, date);
}
});
}
// Update the view UI by applying the changes of selected and focused items
}, {
key: "refresh",
value: function refresh() {
var _this2 = this;
var selected = this.selected[this.year] || [];
var _ref = computeMonthRange(this.range, this.year) || [], _ref2 = _slicedToArray(_ref, 2), rangeStart = _ref2[0], rangeEnd = _ref2[1];
this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(function(el) {
el.classList.remove("range", "range-start", "range-end", "selected", "bg-blue-700", "!bg-primary-700", "dark:bg-blue-600", "dark:!bg-primary-700", "dark:text-white", "text-white", "focused");
el.classList.add("text-gray-900", "hover:bg-gray-100", "dark:text-white", "dark:hover:bg-gray-600");
});
Array.from(this.grid.children).forEach(function(el, index) {
var classList = el.classList;
if (index > rangeStart && index < rangeEnd) {
classList.add("range");
}
if (index === rangeStart) {
classList.add("range-start");
}
if (index === rangeEnd) {
classList.add("range-end");
}
if (selected.includes(index)) {
classList.add("selected", "bg-blue-700", "!bg-primary-700", "text-white", "dark:bg-blue-600", "dark:!bg-primary-600", "dark:text-white");
classList.remove("text-gray-900", "hover:bg-gray-100", "dark:text-white", "dark:hover:bg-gray-600");
}
if (index === _this2.focused) {
classList.add("focused");
}
});
}
// Update the view UI by applying the change of focused item
}, {
key: "refreshFocus",
value: function refreshFocus() {
this.grid.querySelectorAll(".focused").forEach(function(el) {
el.classList.remove("focused");
});
this.grid.children[this.focused].classList.add("focused");
}
}]);
}(View);
function toTitleCase(word) {
return _toConsumableArray(word).reduce(function(str, ch, ix) {
return str += ix ? ch : ch.toUpperCase();
}, "");
}
var YearsView = /* @__PURE__ */ function(_View) {
function YearsView2(picker, config3) {
_classCallCheck(this, YearsView2);
return _callSuper(this, YearsView2, [picker, config3]);
}
_inherits(YearsView2, _View);
return _createClass(YearsView2, [{
key: "init",
value: function init4(options) {
var onConstruction = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
if (onConstruction) {
this.navStep = this.step * 10;
this.beforeShowOption = "beforeShow".concat(toTitleCase(this.cellClass));
this.grid = this.element;
this.element.classList.add(this.name, "datepicker-grid", "w-64", "grid", "grid-cols-4");
this.grid.appendChild(parseHTML(createTagRepeat("span", 12)));
}
_get(_getPrototypeOf(YearsView2.prototype), "init", this).call(this, options);
}
}, {
key: "setOptions",
value: function setOptions(options) {
if (hasProperty(options, "minDate")) {
if (options.minDate === void 0) {
this.minYear = this.minDate = void 0;
} else {
this.minYear = startOfYearPeriod(options.minDate, this.step);
this.minDate = dateValue(this.minYear, 0, 1);
}
}
if (hasProperty(options, "maxDate")) {
if (options.maxDate === void 0) {
this.maxYear = this.maxDate = void 0;
} else {
this.maxYear = startOfYearPeriod(options.maxDate, this.step);
this.maxDate = dateValue(this.maxYear, 11, 31);
}
}
if (options[this.beforeShowOption] !== void 0) {
var beforeShow = options[this.beforeShowOption];
this.beforeShow = typeof beforeShow === "function" ? beforeShow : void 0;
}
}
// Update view's settings to reflect the viewDate set on the picker
}, {
key: "updateFocus",
value: function updateFocus() {
var viewDate = new Date(this.picker.viewDate);
var first = startOfYearPeriod(viewDate, this.navStep);
var last = first + 9 * this.step;
this.first = first;
this.last = last;
this.start = first - this.step;
this.focused = startOfYearPeriod(viewDate, this.step);
}
// Update view's settings to reflect the selected dates
}, {
key: "updateSelection",
value: function updateSelection() {
var _this = this;
var _this$picker$datepick = this.picker.datepicker, dates = _this$picker$datepick.dates, rangepicker = _this$picker$datepick.rangepicker;
this.selected = dates.reduce(function(years, timeValue) {
return pushUnique(years, startOfYearPeriod(timeValue, _this.step));
}, []);
if (rangepicker && rangepicker.dates) {
this.range = rangepicker.dates.map(function(timeValue) {
if (timeValue !== void 0) {
return startOfYearPeriod(timeValue, _this.step);
}
});
}
}
// Update the entire view UI
}, {
key: "render",
value: function render3() {
var _this2 = this;
this.disabled = [];
this.picker.setViewSwitchLabel("".concat(this.first, "-").concat(this.last));
this.picker.setPrevBtnDisabled(this.first <= this.minYear);
this.picker.setNextBtnDisabled(this.last >= this.maxYear);
Array.from(this.grid.children).forEach(function(el, index) {
var classList = el.classList;
var current = _this2.start + index * _this2.step;
var date = dateValue(current, 0, 1);
el.className = "datepicker-cell hover:bg-gray-100 dark:hover:bg-gray-600 block flex-1 leading-9 border-0 rounded-lg cursor-pointer text-center text-gray-900 dark:text-white font-semibold text-sm ".concat(_this2.cellClass);
if (_this2.isMinView) {
el.dataset.date = date;
}
el.textContent = el.dataset.year = current;
if (index === 0) {
classList.add("prev");
} else if (index === 11) {
classList.add("next");
}
if (current < _this2.minYear || current > _this2.maxYear) {
classList.add("disabled");
}
if (_this2.range) {
var _this2$range = _slicedToArray(_this2.range, 2), rangeStart = _this2$range[0], rangeEnd = _this2$range[1];
if (current > rangeStart && current < rangeEnd) {
classList.add("range");
}
if (current === rangeStart) {
classList.add("range-start");
}
if (current === rangeEnd) {
classList.add("range-end");
}
}
if (_this2.selected.includes(current)) {
classList.add("selected", "bg-blue-700", "!bg-primary-700", "text-white", "dark:bg-blue-600", "dark:!bg-primary-600", "dark:text-white");
classList.remove("text-gray-900", "hover:bg-gray-100", "dark:text-white", "dark:hover:bg-gray-600");
}
if (current === _this2.focused) {
classList.add("focused");
}
if (_this2.beforeShow) {
_this2.performBeforeHook(el, current, date);
}
});
}
// Update the view UI by applying the changes of selected and focused items
}, {
key: "refresh",
value: function refresh() {
var _this3 = this;
var _ref = this.range || [], _ref2 = _slicedToArray(_ref, 2), rangeStart = _ref2[0], rangeEnd = _ref2[1];
this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(function(el) {
el.classList.remove("range", "range-start", "range-end", "selected", "bg-blue-700", "!bg-primary-700", "text-white", "dark:bg-blue-600", "dark!bg-primary-600", "dark:text-white", "focused");
});
Array.from(this.grid.children).forEach(function(el) {
var current = Number(el.textContent);
var classList = el.classList;
if (current > rangeStart && current < rangeEnd) {
classList.add("range");
}
if (current === rangeStart) {
classList.add("range-start");
}
if (current === rangeEnd) {
classList.add("range-end");
}
if (_this3.selected.includes(current)) {
classList.add("selected", "bg-blue-700", "!bg-primary-700", "text-white", "dark:bg-blue-600", "dark:!bg-primary-600", "dark:text-white");
classList.remove("text-gray-900", "hover:bg-gray-100", "dark:text-white", "dark:hover:bg-gray-600");
}
if (current === _this3.focused) {
classList.add("focused");
}
});
}
// Update the view UI by applying the change of focused item
}, {
key: "refreshFocus",
value: function refreshFocus() {
var index = Math.round((this.focused - this.start) / this.step);
this.grid.querySelectorAll(".focused").forEach(function(el) {
el.classList.remove("focused");
});
this.grid.children[index].classList.add("focused");
}
}]);
}(View);
function triggerDatepickerEvent(datepicker, type) {
var detail = {
date: datepicker.getDate(),
viewDate: new Date(datepicker.picker.viewDate),
viewId: datepicker.picker.currentView.id,
datepicker
};
datepicker.element.dispatchEvent(new CustomEvent(type, {
detail
}));
}
function goToPrevOrNext(datepicker, direction) {
var _datepicker$config = datepicker.config, minDate = _datepicker$config.minDate, maxDate = _datepicker$config.maxDate;
var _datepicker$picker = datepicker.picker, currentView = _datepicker$picker.currentView, viewDate = _datepicker$picker.viewDate;
var newViewDate;
switch (currentView.id) {
case 0:
newViewDate = addMonths(viewDate, direction);
break;
case 1:
newViewDate = addYears(viewDate, direction);
break;
default:
newViewDate = addYears(viewDate, direction * currentView.navStep);
}
newViewDate = limitToRange(newViewDate, minDate, maxDate);
datepicker.picker.changeFocus(newViewDate).render();
}
function switchView(datepicker) {
var viewId = datepicker.picker.currentView.id;
if (viewId === datepicker.config.maxView) {
return;
}
datepicker.picker.changeView(viewId + 1).render();
}
function unfocus(datepicker) {
if (datepicker.config.updateOnBlur) {
datepicker.update({
autohide: true
});
} else {
datepicker.refresh("input");
datepicker.hide();
}
}
function goToSelectedMonthOrYear(datepicker, selection) {
var picker = datepicker.picker;
var viewDate = new Date(picker.viewDate);
var viewId = picker.currentView.id;
var newDate = viewId === 1 ? addMonths(viewDate, selection - viewDate.getMonth()) : addYears(viewDate, selection - viewDate.getFullYear());
picker.changeFocus(newDate).changeView(viewId - 1).render();
}
function onClickTodayBtn(datepicker) {
var picker = datepicker.picker;
var currentDate = today();
if (datepicker.config.todayBtnMode === 1) {
if (datepicker.config.autohide) {
datepicker.setDate(currentDate);
return;
}
datepicker.setDate(currentDate, {
render: false
});
picker.update();
}
if (picker.viewDate !== currentDate) {
picker.changeFocus(currentDate);
}
picker.changeView(0).render();
}
function onClickClearBtn(datepicker) {
datepicker.setDate({
clear: true
});
}
function onClickViewSwitch(datepicker) {
switchView(datepicker);
}
function onClickPrevBtn(datepicker) {
goToPrevOrNext(datepicker, -1);
}
function onClickNextBtn(datepicker) {
goToPrevOrNext(datepicker, 1);
}
function onClickView(datepicker, ev) {
var target = findElementInEventPath(ev, ".datepicker-cell");
if (!target || target.classList.contains("disabled")) {
return;
}
var _datepicker$picker$cu = datepicker.picker.currentView, id = _datepicker$picker$cu.id, isMinView = _datepicker$picker$cu.isMinView;
if (isMinView) {
datepicker.setDate(Number(target.dataset.date));
} else if (id === 1) {
goToSelectedMonthOrYear(datepicker, Number(target.dataset.month));
} else {
goToSelectedMonthOrYear(datepicker, Number(target.dataset.year));
}
}
function onClickPicker(datepicker) {
if (!datepicker.inline && !datepicker.config.disableTouchKeyboard) {
datepicker.inputField.focus();
}
}
function processPickerOptions(picker, options) {
if (options.title !== void 0) {
if (options.title) {
picker.controls.title.textContent = options.title;
showElement(picker.controls.title);
} else {
picker.controls.title.textContent = "";
hideElement(picker.controls.title);
}
}
if (options.prevArrow) {
var prevBtn = picker.controls.prevBtn;
emptyChildNodes(prevBtn);
options.prevArrow.forEach(function(node) {
prevBtn.appendChild(node.cloneNode(true));
});
}
if (options.nextArrow) {
var nextBtn = picker.controls.nextBtn;
emptyChildNodes(nextBtn);
options.nextArrow.forEach(function(node) {
nextBtn.appendChild(node.cloneNode(true));
});
}
if (options.locale) {
picker.controls.todayBtn.textContent = options.locale.today;
picker.controls.clearBtn.textContent = options.locale.clear;
}
if (options.todayBtn !== void 0) {
if (options.todayBtn) {
showElement(picker.controls.todayBtn);
} else {
hideElement(picker.controls.todayBtn);
}
}
if (hasProperty(options, "minDate") || hasProperty(options, "maxDate")) {
var _picker$datepicker$co = picker.datepicker.config, minDate = _picker$datepicker$co.minDate, maxDate = _picker$datepicker$co.maxDate;
picker.controls.todayBtn.disabled = !isInRange(today(), minDate, maxDate);
}
if (options.clearBtn !== void 0) {
if (options.clearBtn) {
showElement(picker.controls.clearBtn);
} else {
hideElement(picker.controls.clearBtn);
}
}
}
function computeResetViewDate(datepicker) {
var dates = datepicker.dates, config3 = datepicker.config;
var viewDate = dates.length > 0 ? lastItemOf(dates) : config3.defaultViewDate;
return limitToRange(viewDate, config3.minDate, config3.maxDate);
}
function setViewDate(picker, newDate) {
var oldViewDate = new Date(picker.viewDate);
var newViewDate = new Date(newDate);
var _picker$currentView = picker.currentView, id = _picker$currentView.id, year = _picker$currentView.year, first = _picker$currentView.first, last = _picker$currentView.last;
var viewYear = newViewDate.getFullYear();
picker.viewDate = newDate;
if (viewYear !== oldViewDate.getFullYear()) {
triggerDatepickerEvent(picker.datepicker, "changeYear");
}
if (newViewDate.getMonth() !== oldViewDate.getMonth()) {
triggerDatepickerEvent(picker.datepicker, "changeMonth");
}
switch (id) {
case 0:
return newDate < first || newDate > last;
case 1:
return viewYear !== year;
default:
return viewYear < first || viewYear > last;
}
}
function getTextDirection(el) {
return window.getComputedStyle(el).direction;
}
var Picker = /* @__PURE__ */ function() {
function Picker2(datepicker) {
_classCallCheck(this, Picker2);
this.datepicker = datepicker;
var template = pickerTemplate.replace(/%buttonClass%/g, datepicker.config.buttonClass);
var element = this.element = parseHTML(template).firstChild;
var _element$firstChild$c = _slicedToArray(element.firstChild.children, 3), header = _element$firstChild$c[0], main2 = _element$firstChild$c[1], footer = _element$firstChild$c[2];
var title = header.firstElementChild;
var _header$lastElementCh = _slicedToArray(header.lastElementChild.children, 3), prevBtn = _header$lastElementCh[0], viewSwitch = _header$lastElementCh[1], nextBtn = _header$lastElementCh[2];
var _footer$firstChild$ch = _slicedToArray(footer.firstChild.children, 2), todayBtn = _footer$firstChild$ch[0], clearBtn = _footer$firstChild$ch[1];
var controls = {
title,
prevBtn,
viewSwitch,
nextBtn,
todayBtn,
clearBtn
};
this.main = main2;
this.controls = controls;
var elementClass = datepicker.inline ? "inline" : "dropdown";
element.classList.add("datepicker-".concat(elementClass));
elementClass === "dropdown" ? element.classList.add("dropdown", "absolute", "top-0", "left-0", "z-50", "pt-2") : null;
processPickerOptions(this, datepicker.config);
this.viewDate = computeResetViewDate(datepicker);
registerListeners(datepicker, [[element, "click", onClickPicker.bind(null, datepicker), {
capture: true
}], [main2, "click", onClickView.bind(null, datepicker)], [controls.viewSwitch, "click", onClickViewSwitch.bind(null, datepicker)], [controls.prevBtn, "click", onClickPrevBtn.bind(null, datepicker)], [controls.nextBtn, "click", onClickNextBtn.bind(null, datepicker)], [controls.todayBtn, "click", onClickTodayBtn.bind(null, datepicker)], [controls.clearBtn, "click", onClickClearBtn.bind(null, datepicker)]]);
this.views = [new DaysView(this), new MonthsView(this), new YearsView(this, {
id: 2,
name: "years",
cellClass: "year",
step: 1
}), new YearsView(this, {
id: 3,
name: "decades",
cellClass: "decade",
step: 10
})];
this.currentView = this.views[datepicker.config.startView];
this.currentView.render();
this.main.appendChild(this.currentView.element);
datepicker.config.container.appendChild(this.element);
}
return _createClass(Picker2, [{
key: "setOptions",
value: function setOptions(options) {
processPickerOptions(this, options);
this.views.forEach(function(view) {
view.init(options, false);
});
this.currentView.render();
}
}, {
key: "detach",
value: function detach() {
this.datepicker.config.container.removeChild(this.element);
}
}, {
key: "show",
value: function show() {
if (this.active) {
return;
}
this.element.classList.add("active", "block");
this.element.classList.remove("hidden");
this.active = true;
var datepicker = this.datepicker;
if (!datepicker.inline) {
var inputDirection = getTextDirection(datepicker.inputField);
if (inputDirection !== getTextDirection(datepicker.config.container)) {
this.element.dir = inputDirection;
} else if (this.element.dir) {
this.element.removeAttribute("dir");
}
this.place();
if (datepicker.config.disableTouchKeyboard) {
datepicker.inputField.blur();
}
}
triggerDatepickerEvent(datepicker, "show");
}
}, {
key: "hide",
value: function hide2() {
if (!this.active) {
return;
}
this.datepicker.exitEditMode();
this.element.classList.remove("active", "block");
this.element.classList.add("active", "block", "hidden");
this.active = false;
triggerDatepickerEvent(this.datepicker, "hide");
}
}, {
key: "place",
value: function place() {
var _this$element = this.element, classList = _this$element.classList, style2 = _this$element.style;
var _this$datepicker = this.datepicker, config3 = _this$datepicker.config, inputField = _this$datepicker.inputField;
var container = config3.container;
var _this$element$getBoun = this.element.getBoundingClientRect(), calendarWidth = _this$element$getBoun.width, calendarHeight = _this$element$getBoun.height;
var _container$getBoundin = container.getBoundingClientRect(), containerLeft = _container$getBoundin.left, containerTop = _container$getBoundin.top, containerWidth = _container$getBoundin.width;
var _inputField$getBoundi = inputField.getBoundingClientRect(), inputLeft = _inputField$getBoundi.left, inputTop = _inputField$getBoundi.top, inputWidth = _inputField$getBoundi.width, inputHeight = _inputField$getBoundi.height;
var _config$orientation = config3.orientation, orientX = _config$orientation.x, orientY = _config$orientation.y;
var scrollTop;
var left2;
var top2;
if (container === document.body) {
scrollTop = window.scrollY;
left2 = inputLeft + window.scrollX;
top2 = inputTop + scrollTop;
} else {
scrollTop = container.scrollTop;
left2 = inputLeft - containerLeft;
top2 = inputTop - containerTop + scrollTop;
}
if (orientX === "auto") {
if (left2 < 0) {
orientX = "left";
left2 = 10;
} else if (left2 + calendarWidth > containerWidth) {
orientX = "right";
} else {
orientX = getTextDirection(inputField) === "rtl" ? "right" : "left";
}
}
if (orientX === "right") {
left2 -= calendarWidth - inputWidth;
}
if (orientY === "auto") {
orientY = top2 - calendarHeight < scrollTop ? "bottom" : "top";
}
if (orientY === "top") {
top2 -= calendarHeight;
} else {
top2 += inputHeight;
}
classList.remove("datepicker-orient-top", "datepicker-orient-bottom", "datepicker-orient-right", "datepicker-orient-left");
classList.add("datepicker-orient-".concat(orientY), "datepicker-orient-".concat(orientX));
style2.top = top2 ? "".concat(top2, "px") : top2;
style2.left = left2 ? "".concat(left2, "px") : left2;
}
}, {
key: "setViewSwitchLabel",
value: function setViewSwitchLabel(labelText) {
this.controls.viewSwitch.textContent = labelText;
}
}, {
key: "setPrevBtnDisabled",
value: function setPrevBtnDisabled(disabled) {
this.controls.prevBtn.disabled = disabled;
}
}, {
key: "setNextBtnDisabled",
value: function setNextBtnDisabled(disabled) {
this.controls.nextBtn.disabled = disabled;
}
}, {
key: "changeView",
value: function changeView(viewId) {
var oldView = this.currentView;
var newView = this.views[viewId];
if (newView.id !== oldView.id) {
this.currentView = newView;
this._renderMethod = "render";
triggerDatepickerEvent(this.datepicker, "changeView");
this.main.replaceChild(newView.element, oldView.element);
}
return this;
}
// Change the focused date (view date)
}, {
key: "changeFocus",
value: function changeFocus(newViewDate) {
this._renderMethod = setViewDate(this, newViewDate) ? "render" : "refreshFocus";
this.views.forEach(function(view) {
view.updateFocus();
});
return this;
}
// Apply the change of the selected dates
}, {
key: "update",
value: function update() {
var newViewDate = computeResetViewDate(this.datepicker);
this._renderMethod = setViewDate(this, newViewDate) ? "render" : "refresh";
this.views.forEach(function(view) {
view.updateFocus();
view.updateSelection();
});
return this;
}
// Refresh the picker UI
}, {
key: "render",
value: function render3() {
var quickRender = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
var renderMethod = quickRender && this._renderMethod || "render";
delete this._renderMethod;
this.currentView[renderMethod]();
}
}]);
}();
function findNextAvailableOne(date, addFn, increase, testFn, min4, max4) {
if (!isInRange(date, min4, max4)) {
return;
}
if (testFn(date)) {
var newDate = addFn(date, increase);
return findNextAvailableOne(newDate, addFn, increase, testFn, min4, max4);
}
return date;
}
function moveByArrowKey(datepicker, ev, direction, vertical) {
var picker = datepicker.picker;
var currentView = picker.currentView;
var step = currentView.step || 1;
var viewDate = picker.viewDate;
var addFn;
var testFn;
switch (currentView.id) {
case 0:
if (vertical) {
viewDate = addDays(viewDate, direction * 7);
} else if (ev.ctrlKey || ev.metaKey) {
viewDate = addYears(viewDate, direction);
} else {
viewDate = addDays(viewDate, direction);
}
addFn = addDays;
testFn = function testFn2(date) {
return currentView.disabled.includes(date);
};
break;
case 1:
viewDate = addMonths(viewDate, vertical ? direction * 4 : direction);
addFn = addMonths;
testFn = function testFn2(date) {
var dt = new Date(date);
var year = currentView.year, disabled = currentView.disabled;
return dt.getFullYear() === year && disabled.includes(dt.getMonth());
};
break;
default:
viewDate = addYears(viewDate, direction * (vertical ? 4 : 1) * step);
addFn = addYears;
testFn = function testFn2(date) {
return currentView.disabled.includes(startOfYearPeriod(date, step));
};
}
viewDate = findNextAvailableOne(viewDate, addFn, direction < 0 ? -step : step, testFn, currentView.minDate, currentView.maxDate);
if (viewDate !== void 0) {
picker.changeFocus(viewDate).render();
}
}
function onKeydown(datepicker, ev) {
if (ev.key === "Tab") {
unfocus(datepicker);
return;
}
var picker = datepicker.picker;
var _picker$currentView = picker.currentView, id = _picker$currentView.id, isMinView = _picker$currentView.isMinView;
if (!picker.active) {
switch (ev.key) {
case "ArrowDown":
case "Escape":
picker.show();
break;
case "Enter":
datepicker.update();
break;
default:
return;
}
} else if (datepicker.editMode) {
switch (ev.key) {
case "Escape":
picker.hide();
break;
case "Enter":
datepicker.exitEditMode({
update: true,
autohide: datepicker.config.autohide
});
break;
default:
return;
}
} else {
switch (ev.key) {
case "Escape":
picker.hide();
break;
case "ArrowLeft":
if (ev.ctrlKey || ev.metaKey) {
goToPrevOrNext(datepicker, -1);
} else if (ev.shiftKey) {
datepicker.enterEditMode();
return;
} else {
moveByArrowKey(datepicker, ev, -1, false);
}
break;
case "ArrowRight":
if (ev.ctrlKey || ev.metaKey) {
goToPrevOrNext(datepicker, 1);
} else if (ev.shiftKey) {
datepicker.enterEditMode();
return;
} else {
moveByArrowKey(datepicker, ev, 1, false);
}
break;
case "ArrowUp":
if (ev.ctrlKey || ev.metaKey) {
switchView(datepicker);
} else if (ev.shiftKey) {
datepicker.enterEditMode();
return;
} else {
moveByArrowKey(datepicker, ev, -1, true);
}
break;
case "ArrowDown":
if (ev.shiftKey && !ev.ctrlKey && !ev.metaKey) {
datepicker.enterEditMode();
return;
}
moveByArrowKey(datepicker, ev, 1, true);
break;
case "Enter":
if (isMinView) {
datepicker.setDate(picker.viewDate);
} else {
picker.changeView(id - 1).render();
}
break;
case "Backspace":
case "Delete":
datepicker.enterEditMode();
return;
default:
if (ev.key.length === 1 && !ev.ctrlKey && !ev.metaKey) {
datepicker.enterEditMode();
}
return;
}
}
ev.preventDefault();
ev.stopPropagation();
}
function onFocus(datepicker) {
if (datepicker.config.showOnFocus && !datepicker._showing) {
datepicker.show();
}
}
function onMousedown(datepicker, ev) {
var el = ev.target;
if (datepicker.picker.active || datepicker.config.showOnClick) {
el._active = el === document.activeElement;
el._clicking = setTimeout(function() {
delete el._active;
delete el._clicking;
}, 2e3);
}
}
function onClickInput(datepicker, ev) {
var el = ev.target;
if (!el._clicking) {
return;
}
clearTimeout(el._clicking);
delete el._clicking;
if (el._active) {
datepicker.enterEditMode();
}
delete el._active;
if (datepicker.config.showOnClick) {
datepicker.show();
}
}
function onPaste(datepicker, ev) {
if (ev.clipboardData.types.includes("text/plain")) {
datepicker.enterEditMode();
}
}
function onClickOutside(datepicker, ev) {
var element = datepicker.element;
if (element !== document.activeElement) {
return;
}
var pickerElem = datepicker.picker.element;
if (findElementInEventPath(ev, function(el) {
return el === element || el === pickerElem;
})) {
return;
}
unfocus(datepicker);
}
function stringifyDates(dates, config3) {
return dates.map(function(dt) {
return formatDate(dt, config3.format, config3.locale);
}).join(config3.dateDelimiter);
}
function processInputDates(datepicker, inputDates) {
var clear = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
var config3 = datepicker.config, origDates = datepicker.dates, rangepicker = datepicker.rangepicker;
if (inputDates.length === 0) {
return clear ? [] : void 0;
}
var rangeEnd = rangepicker && datepicker === rangepicker.datepickers[1];
var newDates = inputDates.reduce(function(dates, dt) {
var date = parseDate(dt, config3.format, config3.locale);
if (date === void 0) {
return dates;
}
if (config3.pickLevel > 0) {
var _dt = new Date(date);
if (config3.pickLevel === 1) {
date = rangeEnd ? _dt.setMonth(_dt.getMonth() + 1, 0) : _dt.setDate(1);
} else {
date = rangeEnd ? _dt.setFullYear(_dt.getFullYear() + 1, 0, 0) : _dt.setMonth(0, 1);
}
}
if (isInRange(date, config3.minDate, config3.maxDate) && !dates.includes(date) && !config3.datesDisabled.includes(date) && !config3.daysOfWeekDisabled.includes(new Date(date).getDay())) {
dates.push(date);
}
return dates;
}, []);
if (newDates.length === 0) {
return;
}
if (config3.multidate && !clear) {
newDates = newDates.reduce(function(dates, date) {
if (!origDates.includes(date)) {
dates.push(date);
}
return dates;
}, origDates.filter(function(date) {
return !newDates.includes(date);
}));
}
return config3.maxNumberOfDates && newDates.length > config3.maxNumberOfDates ? newDates.slice(config3.maxNumberOfDates * -1) : newDates;
}
function refreshUI(datepicker) {
var mode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 3;
var quickRender = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
var config3 = datepicker.config, picker = datepicker.picker, inputField = datepicker.inputField;
if (mode & 2) {
var newView = picker.active ? config3.pickLevel : config3.startView;
picker.update().changeView(newView).render(quickRender);
}
if (mode & 1 && inputField) {
inputField.value = stringifyDates(datepicker.dates, config3);
}
}
function _setDate(datepicker, inputDates, options) {
var clear = options.clear, render3 = options.render, autohide = options.autohide;
if (render3 === void 0) {
render3 = true;
}
if (!render3) {
autohide = false;
} else if (autohide === void 0) {
autohide = datepicker.config.autohide;
}
var newDates = processInputDates(datepicker, inputDates, clear);
if (!newDates) {
return;
}
if (newDates.toString() !== datepicker.dates.toString()) {
datepicker.dates = newDates;
refreshUI(datepicker, render3 ? 3 : 1);
triggerDatepickerEvent(datepicker, "changeDate");
} else {
refreshUI(datepicker, 1);
}
if (autohide) {
datepicker.hide();
}
}
var Datepicker = /* @__PURE__ */ function() {
function Datepicker3(element) {
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var rangepicker = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
_classCallCheck(this, Datepicker3);
element.datepicker = this;
this.element = element;
var config3 = this.config = Object.assign({
buttonClass: options.buttonClass && String(options.buttonClass) || "button",
container: document.body,
defaultViewDate: today(),
maxDate: void 0,
minDate: void 0
}, processOptions(defaultOptions, this));
this._options = options;
Object.assign(config3, processOptions(options, this));
var inline = this.inline = element.tagName !== "INPUT";
var inputField;
var initialDates;
if (inline) {
config3.container = element;
initialDates = stringToArray(element.dataset.date, config3.dateDelimiter);
delete element.dataset.date;
} else {
var container = options.container ? document.querySelector(options.container) : null;
if (container) {
config3.container = container;
}
inputField = this.inputField = element;
inputField.classList.add("datepicker-input");
initialDates = stringToArray(inputField.value, config3.dateDelimiter);
}
if (rangepicker) {
var index = rangepicker.inputs.indexOf(inputField);
var datepickers = rangepicker.datepickers;
if (index < 0 || index > 1 || !Array.isArray(datepickers)) {
throw Error("Invalid rangepicker object.");
}
datepickers[index] = this;
Object.defineProperty(this, "rangepicker", {
get: function get() {
return rangepicker;
}
});
}
this.dates = [];
var inputDateValues = processInputDates(this, initialDates);
if (inputDateValues && inputDateValues.length > 0) {
this.dates = inputDateValues;
}
if (inputField) {
inputField.value = stringifyDates(this.dates, config3);
}
var picker = this.picker = new Picker(this);
if (inline) {
this.show();
} else {
var onMousedownDocument = onClickOutside.bind(null, this);
var listeners = [[inputField, "keydown", onKeydown.bind(null, this)], [inputField, "focus", onFocus.bind(null, this)], [inputField, "mousedown", onMousedown.bind(null, this)], [inputField, "click", onClickInput.bind(null, this)], [inputField, "paste", onPaste.bind(null, this)], [document, "mousedown", onMousedownDocument], [document, "touchstart", onMousedownDocument], [window, "resize", picker.place.bind(picker)]];
registerListeners(this, listeners);
}
}
return _createClass(Datepicker3, [{
key: "active",
get: (
/**
* @type {Boolean} - Whether the picker element is shown. `true` whne shown
*/
function get() {
return !!(this.picker && this.picker.active);
}
)
/**
* @type {HTMLDivElement} - DOM object of picker element
*/
}, {
key: "pickerElement",
get: function get() {
return this.picker ? this.picker.element : void 0;
}
/**
* Set new values to the config options
* @param {Object} options - config options to update
*/
}, {
key: "setOptions",
value: function setOptions(options) {
var picker = this.picker;
var newOptions = processOptions(options, this);
Object.assign(this._options, options);
Object.assign(this.config, newOptions);
picker.setOptions(newOptions);
refreshUI(this, 3);
}
/**
* Show the picker element
*/
}, {
key: "show",
value: function show() {
if (this.inputField) {
if (this.inputField.disabled) {
return;
}
if (this.inputField !== document.activeElement) {
this._showing = true;
this.inputField.focus();
delete this._showing;
}
}
this.picker.show();
}
/**
* Hide the picker element
* Not available on inline picker
*/
}, {
key: "hide",
value: function hide2() {
if (this.inline) {
return;
}
this.picker.hide();
this.picker.update().changeView(this.config.startView).render();
}
/**
* Destroy the Datepicker instance
* @return {Detepicker} - the instance destroyed
*/
}, {
key: "destroy",
value: function destroy() {
this.hide();
unregisterListeners(this);
this.picker.detach();
if (!this.inline) {
this.inputField.classList.remove("datepicker-input");
}
delete this.element.datepicker;
return this;
}
/**
* Get the selected date(s)
*
* The method returns a Date object of selected date by default, and returns
* an array of selected dates in multidate mode. If format string is passed,
* it returns date string(s) formatted in given format.
*
* @param {String} [format] - Format string to stringify the date(s)
* @return {Date|String|Date[]|String[]} - selected date(s), or if none is
* selected, empty array in multidate mode and untitled in sigledate mode
*/
}, {
key: "getDate",
value: function getDate() {
var _this = this;
var format2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
var callback = format2 ? function(date) {
return formatDate(date, format2, _this.config.locale);
} : function(date) {
return new Date(date);
};
if (this.config.multidate) {
return this.dates.map(callback);
}
if (this.dates.length > 0) {
return callback(this.dates[0]);
}
}
/**
* Set selected date(s)
*
* In multidate mode, you can pass multiple dates as a series of arguments
* or an array. (Since each date is parsed individually, the type of the
* dates doesn't have to be the same.)
* The given dates are used to toggle the select status of each date. The
* number of selected dates is kept from exceeding the length set to
* maxNumberOfDates.
*
* With clear: true option, the method can be used to clear the selection
* and to replace the selection instead of toggling in multidate mode.
* If the option is passed with no date arguments or an empty dates array,
* it works as "clear" (clear the selection then set nothing), and if the
* option is passed with new dates to select, it works as "replace" (clear
* the selection then set the given dates)
*
* When render: false option is used, the method omits re-rendering the
* picker element. In this case, you need to call refresh() method later in
* order for the picker element to reflect the changes. The input field is
* refreshed always regardless of this option.
*
* When invalid (unparsable, repeated, disabled or out-of-range) dates are
* passed, the method ignores them and applies only valid ones. In the case
* that all the given dates are invalid, which is distinguished from passing
* no dates, the method considers it as an error and leaves the selection
* untouched.
*
* @param {...(Date|Number|String)|Array} [dates] - Date strings, Date
* objects, time values or mix of those for new selection
* @param {Object} [options] - function options
* - clear: {boolean} - Whether to clear the existing selection
* defualt: false
* - render: {boolean} - Whether to re-render the picker element
* default: true
* - autohide: {boolean} - Whether to hide the picker element after re-render
* Ignored when used with render: false
* default: config.autohide
*/
}, {
key: "setDate",
value: function setDate() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var dates = [].concat(args);
var opts = {};
var lastArg = lastItemOf(args);
if (_typeof(lastArg) === "object" && !Array.isArray(lastArg) && !(lastArg instanceof Date) && lastArg) {
Object.assign(opts, dates.pop());
}
var inputDates = Array.isArray(dates[0]) ? dates[0] : dates;
_setDate(this, inputDates, opts);
}
/**
* Update the selected date(s) with input field's value
* Not available on inline picker
*
* The input field will be refreshed with properly formatted date string.
*
* @param {Object} [options] - function options
* - autohide: {boolean} - whether to hide the picker element after refresh
* default: false
*/
}, {
key: "update",
value: function update() {
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
if (this.inline) {
return;
}
var opts = {
clear: true,
autohide: !!(options && options.autohide)
};
var inputDates = stringToArray(this.inputField.value, this.config.dateDelimiter);
_setDate(this, inputDates, opts);
}
/**
* Refresh the picker element and the associated input field
* @param {String} [target] - target item when refreshing one item only
* 'picker' or 'input'
* @param {Boolean} [forceRender] - whether to re-render the picker element
* regardless of its state instead of optimized refresh
*/
}, {
key: "refresh",
value: function refresh() {
var target = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
var forceRender = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
if (target && typeof target !== "string") {
forceRender = target;
target = void 0;
}
var mode;
if (target === "picker") {
mode = 2;
} else if (target === "input") {
mode = 1;
} else {
mode = 3;
}
refreshUI(this, mode, !forceRender);
}
/**
* Enter edit mode
* Not available on inline picker or when the picker element is hidden
*/
}, {
key: "enterEditMode",
value: function enterEditMode() {
if (this.inline || !this.picker.active || this.editMode) {
return;
}
this.editMode = true;
this.inputField.classList.add("in-edit", "border-blue-700", "!border-primary-700");
}
/**
* Exit from edit mode
* Not available on inline picker
* @param {Object} [options] - function options
* - update: {boolean} - whether to call update() after exiting
* If false, input field is revert to the existing selection
* default: false
*/
}, {
key: "exitEditMode",
value: function exitEditMode() {
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
if (this.inline || !this.editMode) {
return;
}
var opts = Object.assign({
update: false
}, options);
delete this.editMode;
this.inputField.classList.remove("in-edit", "border-blue-700", "!border-primary-700");
if (opts.update) {
this.update(opts);
}
}
}], [{
key: "formatDate",
value: function formatDate$1(date, format2, lang) {
return formatDate(date, format2, lang && locales[lang] || locales.en);
}
/**
* Parse date string
* @param {String|Date|Number} dateStr - date string, Date object or time
* value to parse
* @param {String|Object} format - format string or object that contains
* toValue() custom parser, whose signature is
* - args:
* - dateStr: {String|Date|Number} - the dateStr passed to the method
* - format: {Object} - the format object passed to the method
* - locale: {Object} - locale for the language specified by `lang`
* - return:
* {Date|Number} parsed date or its time value
* @param {String} [lang=en] - language code for the locale to use
* @return {Number} time value of parsed date
*/
}, {
key: "parseDate",
value: function parseDate$1(dateStr, format2, lang) {
return parseDate(dateStr, format2, lang && locales[lang] || locales.en);
}
/**
* @type {Object} - Installed locales in `[languageCode]: localeObject` format
* en`:_English (US)_ is pre-installed.
*/
}, {
key: "locales",
get: function get() {
return locales;
}
}]);
}();
function filterOptions(options) {
var newOpts = Object.assign({}, options);
delete newOpts.inputs;
delete newOpts.allowOneSidedRange;
delete newOpts.maxNumberOfDates;
return newOpts;
}
function setupDatepicker(rangepicker, changeDateListener, el, options) {
registerListeners(rangepicker, [[el, "changeDate", changeDateListener]]);
new Datepicker(el, options, rangepicker);
}
function onChangeDate(rangepicker, ev) {
if (rangepicker._updating) {
return;
}
rangepicker._updating = true;
var target = ev.target;
if (target.datepicker === void 0) {
return;
}
var datepickers = rangepicker.datepickers;
var setDateOptions = {
render: false
};
var changedSide = rangepicker.inputs.indexOf(target);
var otherSide = changedSide === 0 ? 1 : 0;
var changedDate = datepickers[changedSide].dates[0];
var otherDate = datepickers[otherSide].dates[0];
if (changedDate !== void 0 && otherDate !== void 0) {
if (changedSide === 0 && changedDate > otherDate) {
datepickers[0].setDate(otherDate, setDateOptions);
datepickers[1].setDate(changedDate, setDateOptions);
} else if (changedSide === 1 && changedDate < otherDate) {
datepickers[0].setDate(changedDate, setDateOptions);
datepickers[1].setDate(otherDate, setDateOptions);
}
} else if (!rangepicker.allowOneSidedRange) {
if (changedDate !== void 0 || otherDate !== void 0) {
setDateOptions.clear = true;
datepickers[otherSide].setDate(datepickers[changedSide].dates, setDateOptions);
}
}
datepickers[0].picker.update().render();
datepickers[1].picker.update().render();
delete rangepicker._updating;
}
var DateRangePicker = /* @__PURE__ */ function() {
function DateRangePicker2(element) {
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
_classCallCheck(this, DateRangePicker2);
var inputs = Array.isArray(options.inputs) ? options.inputs : Array.from(element.querySelectorAll("input"));
if (inputs.length < 2) {
return;
}
element.rangepicker = this;
this.element = element;
this.inputs = inputs.slice(0, 2);
this.allowOneSidedRange = !!options.allowOneSidedRange;
var changeDateListener = onChangeDate.bind(null, this);
var cleanOptions = filterOptions(options);
var datepickers = [];
Object.defineProperty(this, "datepickers", {
get: function get() {
return datepickers;
}
});
setupDatepicker(this, changeDateListener, this.inputs[0], cleanOptions);
setupDatepicker(this, changeDateListener, this.inputs[1], cleanOptions);
Object.freeze(datepickers);
if (datepickers[0].dates.length > 0) {
onChangeDate(this, {
target: this.inputs[0]
});
} else if (datepickers[1].dates.length > 0) {
onChangeDate(this, {
target: this.inputs[1]
});
}
}
return _createClass(DateRangePicker2, [{
key: "dates",
get: function get() {
return this.datepickers.length === 2 ? [this.datepickers[0].dates[0], this.datepickers[1].dates[0]] : void 0;
}
/**
* Set new values to the config options
* @param {Object} options - config options to update
*/
}, {
key: "setOptions",
value: function setOptions(options) {
this.allowOneSidedRange = !!options.allowOneSidedRange;
var cleanOptions = filterOptions(options);
this.datepickers[0].setOptions(cleanOptions);
this.datepickers[1].setOptions(cleanOptions);
}
/**
* Destroy the DateRangePicker instance
* @return {DateRangePicker} - the instance destroyed
*/
}, {
key: "destroy",
value: function destroy() {
this.datepickers[0].destroy();
this.datepickers[1].destroy();
unregisterListeners(this);
delete this.element.rangepicker;
}
/**
* Get the start and end dates of the date range
*
* The method returns Date objects by default. If format string is passed,
* it returns date strings formatted in given format.
* The result array always contains 2 items (start date/end date) and
* undefined is used for unselected side. (e.g. If none is selected,
* the result will be [undefined, undefined]. If only the end date is set
* when allowOneSidedRange config option is true, [undefined, endDate] will
* be returned.)
*
* @param {String} [format] - Format string to stringify the dates
* @return {Array} - Start and end dates
*/
}, {
key: "getDates",
value: function getDates() {
var _this = this;
var format2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
var callback = format2 ? function(date) {
return formatDate(date, format2, _this.datepickers[0].config.locale);
} : function(date) {
return new Date(date);
};
return this.dates.map(function(date) {
return date === void 0 ? date : callback(date);
});
}
/**
* Set the start and end dates of the date range
*
* The method calls datepicker.setDate() internally using each of the
* arguments in start→end order.
*
* When a clear: true option object is passed instead of a date, the method
* clears the date.
*
* If an invalid date, the same date as the current one or an option object
* without clear: true is passed, the method considers that argument as an
* "ineffective" argument because calling datepicker.setDate() with those
* values makes no changes to the date selection.
*
* When the allowOneSidedRange config option is false, passing {clear: true}
* to clear the range works only when it is done to the last effective
* argument (in other words, passed to rangeEnd or to rangeStart along with
* ineffective rangeEnd). This is because when the date range is changed,
* it gets normalized based on the last change at the end of the changing
* process.
*
* @param {Date|Number|String|Object} rangeStart - Start date of the range
* or {clear: true} to clear the date
* @param {Date|Number|String|Object} rangeEnd - End date of the range
* or {clear: true} to clear the date
*/
}, {
key: "setDates",
value: function setDates(rangeStart, rangeEnd) {
var _this$datepickers = _slicedToArray(this.datepickers, 2), datepicker0 = _this$datepickers[0], datepicker1 = _this$datepickers[1];
var origDates = this.dates;
this._updating = true;
datepicker0.setDate(rangeStart);
datepicker1.setDate(rangeEnd);
delete this._updating;
if (datepicker1.dates[0] !== origDates[1]) {
onChangeDate(this, {
target: this.inputs[1]
});
} else if (datepicker0.dates[0] !== origDates[0]) {
onChangeDate(this, {
target: this.inputs[0]
});
}
}
}]);
}();
// node_modules/flowbite/lib/esm/components/datepicker/index.js
var __assign14 = function() {
__assign14 = Object.assign || function(t3) {
for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) {
s2 = arguments[i3];
for (var p in s2) if (Object.prototype.hasOwnProperty.call(s2, p))
t3[p] = s2[p];
}
return t3;
};
return __assign14.apply(this, arguments);
};
var Default14 = {
defaultDatepickerId: null,
autohide: false,
format: "mm/dd/yyyy",
maxDate: null,
minDate: null,
orientation: "bottom",
buttons: false,
autoSelectToday: 0,
title: null,
language: "en",
rangePicker: false,
onShow: function() {
},
onHide: function() {
}
};
var DefaultInstanceOptions14 = {
id: null,
override: true
};
var Datepicker2 = (
/** @class */
function() {
function Datepicker3(datepickerEl, options, instanceOptions) {
if (datepickerEl === void 0) {
datepickerEl = null;
}
if (options === void 0) {
options = Default14;
}
if (instanceOptions === void 0) {
instanceOptions = DefaultInstanceOptions14;
}
this._instanceId = instanceOptions.id ? instanceOptions.id : datepickerEl.id;
this._datepickerEl = datepickerEl;
this._datepickerInstance = null;
this._options = __assign14(__assign14({}, Default14), options);
this._initialized = false;
this.init();
instances_default.addInstance("Datepicker", this, this._instanceId, instanceOptions.override);
}
Datepicker3.prototype.init = function() {
if (this._datepickerEl && !this._initialized) {
if (this._options.rangePicker) {
this._datepickerInstance = new DateRangePicker(this._datepickerEl, this._getDatepickerOptions(this._options));
} else {
this._datepickerInstance = new Datepicker(this._datepickerEl, this._getDatepickerOptions(this._options));
}
this._initialized = true;
}
};
Datepicker3.prototype.destroy = function() {
if (this._initialized) {
this._initialized = false;
this._datepickerInstance.destroy();
}
};
Datepicker3.prototype.removeInstance = function() {
this.destroy();
instances_default.removeInstance("Datepicker", this._instanceId);
};
Datepicker3.prototype.destroyAndRemoveInstance = function() {
this.destroy();
this.removeInstance();
};
Datepicker3.prototype.getDatepickerInstance = function() {
return this._datepickerInstance;
};
Datepicker3.prototype.getDate = function() {
if (this._options.rangePicker && this._datepickerInstance instanceof DateRangePicker) {
return this._datepickerInstance.getDates();
}
if (!this._options.rangePicker && this._datepickerInstance instanceof Datepicker) {
return this._datepickerInstance.getDate();
}
};
Datepicker3.prototype.setDate = function(date) {
if (this._options.rangePicker && this._datepickerInstance instanceof DateRangePicker) {
return this._datepickerInstance.setDates(date);
}
if (!this._options.rangePicker && this._datepickerInstance instanceof Datepicker) {
return this._datepickerInstance.setDate(date);
}
};
Datepicker3.prototype.show = function() {
this._datepickerInstance.show();
this._options.onShow(this);
};
Datepicker3.prototype.hide = function() {
this._datepickerInstance.hide();
this._options.onHide(this);
};
Datepicker3.prototype._getDatepickerOptions = function(options) {
var datepickerOptions = {};
if (options.buttons) {
datepickerOptions.todayBtn = true;
datepickerOptions.clearBtn = true;
if (options.autoSelectToday) {
datepickerOptions.todayBtnMode = 1;
}
}
if (options.autohide) {
datepickerOptions.autohide = true;
}
if (options.format) {
datepickerOptions.format = options.format;
}
if (options.maxDate) {
datepickerOptions.maxDate = options.maxDate;
}
if (options.minDate) {
datepickerOptions.minDate = options.minDate;
}
if (options.orientation) {
datepickerOptions.orientation = options.orientation;
}
if (options.title) {
datepickerOptions.title = options.title;
}
if (options.language) {
datepickerOptions.language = options.language;
}
return datepickerOptions;
};
Datepicker3.prototype.updateOnShow = function(callback) {
this._options.onShow = callback;
};
Datepicker3.prototype.updateOnHide = function(callback) {
this._options.onHide = callback;
};
return Datepicker3;
}()
);
function initDatepickers() {
document.querySelectorAll("[datepicker], [inline-datepicker], [date-rangepicker]").forEach(function($datepickerEl) {
if ($datepickerEl) {
var buttons = $datepickerEl.hasAttribute("datepicker-buttons");
var autoselectToday = $datepickerEl.hasAttribute("datepicker-autoselect-today");
var autohide = $datepickerEl.hasAttribute("datepicker-autohide");
var format2 = $datepickerEl.getAttribute("datepicker-format");
var maxDate = $datepickerEl.getAttribute("datepicker-max-date");
var minDate = $datepickerEl.getAttribute("datepicker-min-date");
var orientation_1 = $datepickerEl.getAttribute("datepicker-orientation");
var title = $datepickerEl.getAttribute("datepicker-title");
var language = $datepickerEl.getAttribute("datepicker-language");
var rangePicker = $datepickerEl.hasAttribute("date-rangepicker");
new Datepicker2($datepickerEl, {
buttons: buttons ? buttons : Default14.buttons,
autoSelectToday: autoselectToday ? autoselectToday : Default14.autoSelectToday,
autohide: autohide ? autohide : Default14.autohide,
format: format2 ? format2 : Default14.format,
maxDate: maxDate ? maxDate : Default14.maxDate,
minDate: minDate ? minDate : Default14.minDate,
orientation: orientation_1 ? orientation_1 : Default14.orientation,
title: title ? title : Default14.title,
language: language ? language : Default14.language,
rangePicker: rangePicker ? rangePicker : Default14.rangePicker
});
} else {
console.error("The datepicker element does not exist. Please check the datepicker attribute.");
}
});
}
if (typeof window !== "undefined") {
window.Datepicker = Datepicker2;
window.initDatepickers = initDatepickers;
}
// node_modules/flowbite/lib/esm/components/index.js
function initFlowbite() {
initAccordions();
initCollapses();
initCarousels();
initDismisses();
initDropdowns();
initModals();
initDrawers();
initTabs();
initTooltips();
initPopovers();
initDials();
initInputCounters();
initCopyClipboards();
initDatepickers();
}
if (typeof window !== "undefined") {
window.initFlowbite = initFlowbite;
}
// node_modules/flowbite/lib/esm/index.js
var events = new events_default("load", [
initAccordions,
initCollapses,
initCarousels,
initDismisses,
initDropdowns,
initModals,
initDrawers,
initTabs,
initTooltips,
initPopovers,
initDials,
initInputCounters,
initCopyClipboards,
initDatepickers
]);
events.init();
// src/js/main.js
var import_aos = __toESM(require_aos());
// src/js/init/shrink.js
function shrink() {
var offset2 = 150;
var duration = 300;
window.addEventListener("scroll", function() {
if (window.scrollY > offset2) {
document.body.classList.add("shrink");
} else {
document.body.classList.remove("shrink");
}
});
}
var shrink_default = shrink;
// src/js/init/menu.js
function menu() {
var bodyEl = document.body, content = document.querySelector("#wrapper"), openbtn = document.getElementById("menu-open"), botones = document.querySelectorAll(".sidenav a"), isOpen = false;
function init4() {
initEvents();
}
function initEvents() {
openbtn.addEventListener("click", toggleMenu);
botones.forEach(function(element) {
element.addEventListener("click", toggleMenu);
});
content.addEventListener("click", function(ev) {
var target = ev.target;
if (isOpen && target !== openbtn) {
toggleMenu();
}
});
}
function toggleMenu() {
if (isOpen) {
bodyEl.classList.remove("menu-open");
} else {
bodyEl.classList.add("menu-open");
}
isOpen = !isOpen;
}
init4();
}
var menu_default = menu;
// node_modules/lenis/dist/lenis.mjs
var version = "1.1.20";
function clamp(min4, input, max4) {
return Math.max(min4, Math.min(input, max4));
}
function lerp(x, y3, t3) {
return (1 - t3) * x + t3 * y3;
}
function damp(x, y3, lambda, deltaTime) {
return lerp(x, y3, 1 - Math.exp(-lambda * deltaTime));
}
function modulo(n2, d3) {
return (n2 % d3 + d3) % d3;
}
var Animate = class {
isRunning = false;
value = 0;
from = 0;
to = 0;
currentTime = 0;
// These are instanciated in the fromTo method
lerp;
duration;
easing;
onUpdate;
/**
* Advance the animation by the given delta time
*
* @param deltaTime - The time in seconds to advance the animation
*/
advance(deltaTime) {
if (!this.isRunning) return;
let completed = false;
if (this.duration && this.easing) {
this.currentTime += deltaTime;
const linearProgress = clamp(0, this.currentTime / this.duration, 1);
completed = linearProgress >= 1;
const easedProgress = completed ? 1 : this.easing(linearProgress);
this.value = this.from + (this.to - this.from) * easedProgress;
} else if (this.lerp) {
this.value = damp(this.value, this.to, this.lerp * 60, deltaTime);
if (Math.round(this.value) === this.to) {
this.value = this.to;
completed = true;
}
} else {
this.value = this.to;
completed = true;
}
if (completed) {
this.stop();
}
this.onUpdate?.(this.value, completed);
}
/** Stop the animation */
stop() {
this.isRunning = false;
}
/**
* Set up the animation from a starting value to an ending value
* with optional parameters for lerping, duration, easing, and onUpdate callback
*
* @param from - The starting value
* @param to - The ending value
* @param options - Options for the animation
*/
fromTo(from, to, { lerp: lerp2, duration, easing, onStart, onUpdate }) {
this.from = this.value = from;
this.to = to;
this.lerp = lerp2;
this.duration = duration;
this.easing = easing;
this.currentTime = 0;
this.isRunning = true;
onStart?.();
this.onUpdate = onUpdate;
}
};
function debounce2(callback, delay) {
let timer;
return function(...args) {
let context3 = this;
clearTimeout(timer);
timer = setTimeout(() => {
timer = void 0;
callback.apply(context3, args);
}, delay);
};
}
var Dimensions = class {
constructor(wrapper, content, { autoResize = true, debounce: debounceValue = 250 } = {}) {
this.wrapper = wrapper;
this.content = content;
if (autoResize) {
this.debouncedResize = debounce2(this.resize, debounceValue);
if (this.wrapper instanceof Window) {
window.addEventListener("resize", this.debouncedResize, false);
} else {
this.wrapperResizeObserver = new ResizeObserver(this.debouncedResize);
this.wrapperResizeObserver.observe(this.wrapper);
}
this.contentResizeObserver = new ResizeObserver(this.debouncedResize);
this.contentResizeObserver.observe(this.content);
}
this.resize();
}
width = 0;
height = 0;
scrollHeight = 0;
scrollWidth = 0;
// These are instanciated in the constructor as they need information from the options
debouncedResize;
wrapperResizeObserver;
contentResizeObserver;
destroy() {
this.wrapperResizeObserver?.disconnect();
this.contentResizeObserver?.disconnect();
if (this.wrapper === window && this.debouncedResize) {
window.removeEventListener("resize", this.debouncedResize, false);
}
}
resize = () => {
this.onWrapperResize();
this.onContentResize();
};
onWrapperResize = () => {
if (this.wrapper instanceof Window) {
this.width = window.innerWidth;
this.height = window.innerHeight;
} else {
this.width = this.wrapper.clientWidth;
this.height = this.wrapper.clientHeight;
}
};
onContentResize = () => {
if (this.wrapper instanceof Window) {
this.scrollHeight = this.content.scrollHeight;
this.scrollWidth = this.content.scrollWidth;
} else {
this.scrollHeight = this.wrapper.scrollHeight;
this.scrollWidth = this.wrapper.scrollWidth;
}
};
get limit() {
return {
x: this.scrollWidth - this.width,
y: this.scrollHeight - this.height
};
}
};
var Emitter = class {
events = {};
/**
* Emit an event with the given data
* @param event Event name
* @param args Data to pass to the event handlers
*/
emit(event, ...args) {
let callbacks = this.events[event] || [];
for (let i3 = 0, length = callbacks.length; i3 < length; i3++) {
callbacks[i3]?.(...args);
}
}
/**
* Add a callback to the event
* @param event Event name
* @param cb Callback function
* @returns Unsubscribe function
*/
on(event, cb) {
this.events[event]?.push(cb) || (this.events[event] = [cb]);
return () => {
this.events[event] = this.events[event]?.filter((i3) => cb !== i3);
};
}
/**
* Remove a callback from the event
* @param event Event name
* @param callback Callback function
*/
off(event, callback) {
this.events[event] = this.events[event]?.filter((i3) => callback !== i3);
}
/**
* Remove all event listeners and clean up
*/
destroy() {
this.events = {};
}
};
var LINE_HEIGHT = 100 / 6;
var listenerOptions = { passive: false };
var VirtualScroll = class {
constructor(element, options = { wheelMultiplier: 1, touchMultiplier: 1 }) {
this.element = element;
this.options = options;
window.addEventListener("resize", this.onWindowResize, false);
this.onWindowResize();
this.element.addEventListener("wheel", this.onWheel, listenerOptions);
this.element.addEventListener(
"touchstart",
this.onTouchStart,
listenerOptions
);
this.element.addEventListener(
"touchmove",
this.onTouchMove,
listenerOptions
);
this.element.addEventListener("touchend", this.onTouchEnd, listenerOptions);
}
touchStart = {
x: 0,
y: 0
};
lastDelta = {
x: 0,
y: 0
};
window = {
width: 0,
height: 0
};
emitter = new Emitter();
/**
* Add an event listener for the given event and callback
*
* @param event Event name
* @param callback Callback function
*/
on(event, callback) {
return this.emitter.on(event, callback);
}
/** Remove all event listeners and clean up */
destroy() {
this.emitter.destroy();
window.removeEventListener("resize", this.onWindowResize, false);
this.element.removeEventListener("wheel", this.onWheel, listenerOptions);
this.element.removeEventListener(
"touchstart",
this.onTouchStart,
listenerOptions
);
this.element.removeEventListener(
"touchmove",
this.onTouchMove,
listenerOptions
);
this.element.removeEventListener(
"touchend",
this.onTouchEnd,
listenerOptions
);
}
/**
* Event handler for 'touchstart' event
*
* @param event Touch event
*/
onTouchStart = (event) => {
const { clientX, clientY } = event.targetTouches ? event.targetTouches[0] : event;
this.touchStart.x = clientX;
this.touchStart.y = clientY;
this.lastDelta = {
x: 0,
y: 0
};
this.emitter.emit("scroll", {
deltaX: 0,
deltaY: 0,
event
});
};
/** Event handler for 'touchmove' event */
onTouchMove = (event) => {
const { clientX, clientY } = event.targetTouches ? event.targetTouches[0] : event;
const deltaX = -(clientX - this.touchStart.x) * this.options.touchMultiplier;
const deltaY = -(clientY - this.touchStart.y) * this.options.touchMultiplier;
this.touchStart.x = clientX;
this.touchStart.y = clientY;
this.lastDelta = {
x: deltaX,
y: deltaY
};
this.emitter.emit("scroll", {
deltaX,
deltaY,
event
});
};
onTouchEnd = (event) => {
this.emitter.emit("scroll", {
deltaX: this.lastDelta.x,
deltaY: this.lastDelta.y,
event
});
};
/** Event handler for 'wheel' event */
onWheel = (event) => {
let { deltaX, deltaY, deltaMode } = event;
const multiplierX = deltaMode === 1 ? LINE_HEIGHT : deltaMode === 2 ? this.window.width : 1;
const multiplierY = deltaMode === 1 ? LINE_HEIGHT : deltaMode === 2 ? this.window.height : 1;
deltaX *= multiplierX;
deltaY *= multiplierY;
deltaX *= this.options.wheelMultiplier;
deltaY *= this.options.wheelMultiplier;
this.emitter.emit("scroll", { deltaX, deltaY, event });
};
onWindowResize = () => {
this.window = {
width: window.innerWidth,
height: window.innerHeight
};
};
};
var Lenis = class {
_isScrolling = false;
// true when scroll is animating
_isStopped = false;
// true if user should not be able to scroll - enable/disable programmatically
_isLocked = false;
// same as isStopped but enabled/disabled when scroll reaches target
_preventNextNativeScrollEvent = false;
_resetVelocityTimeout = null;
__rafID = null;
/**
* Whether or not the user is touching the screen
*/
isTouching;
/**
* The time in ms since the lenis instance was created
*/
time = 0;
/**
* User data that will be forwarded through the scroll event
*
* @example
* lenis.scrollTo(100, {
* userData: {
* foo: 'bar'
* }
* })
*/
userData = {};
/**
* The last velocity of the scroll
*/
lastVelocity = 0;
/**
* The current velocity of the scroll
*/
velocity = 0;
/**
* The direction of the scroll
*/
direction = 0;
/**
* The options passed to the lenis instance
*/
options;
/**
* The target scroll value
*/
targetScroll;
/**
* The animated scroll value
*/
animatedScroll;
// These are instanciated here as they don't need information from the options
animate = new Animate();
emitter = new Emitter();
// These are instanciated in the constructor as they need information from the options
dimensions;
// This is not private because it's used in the Snap class
virtualScroll;
constructor({
wrapper = window,
content = document.documentElement,
eventsTarget = wrapper,
smoothWheel = true,
syncTouch = false,
syncTouchLerp = 0.075,
touchInertiaMultiplier = 35,
duration,
// in seconds
easing = (t3) => Math.min(1, 1.001 - Math.pow(2, -10 * t3)),
lerp: lerp2 = 0.1,
infinite = false,
orientation = "vertical",
// vertical, horizontal
gestureOrientation = "vertical",
// vertical, horizontal, both
touchMultiplier = 1,
wheelMultiplier = 1,
autoResize = true,
prevent: prevent2,
virtualScroll,
overscroll = true,
autoRaf = false,
anchors = false,
__experimental__naiveDimensions = false
} = {}) {
window.lenisVersion = version;
if (!wrapper || wrapper === document.documentElement) {
wrapper = window;
}
this.options = {
wrapper,
content,
eventsTarget,
smoothWheel,
syncTouch,
syncTouchLerp,
touchInertiaMultiplier,
duration,
easing,
lerp: lerp2,
infinite,
gestureOrientation,
orientation,
touchMultiplier,
wheelMultiplier,
autoResize,
prevent: prevent2,
virtualScroll,
overscroll,
autoRaf,
anchors,
__experimental__naiveDimensions
};
this.dimensions = new Dimensions(wrapper, content, { autoResize });
this.updateClassName();
this.targetScroll = this.animatedScroll = this.actualScroll;
this.options.wrapper.addEventListener("scroll", this.onNativeScroll, false);
this.options.wrapper.addEventListener("scrollend", this.onScrollEnd, {
capture: true
});
if (this.options.anchors && this.options.wrapper === window) {
this.options.wrapper.addEventListener(
"click",
this.onClick,
false
);
}
this.options.wrapper.addEventListener(
"pointerdown",
this.onPointerDown,
false
);
this.virtualScroll = new VirtualScroll(eventsTarget, {
touchMultiplier,
wheelMultiplier
});
this.virtualScroll.on("scroll", this.onVirtualScroll);
if (this.options.autoRaf) {
this.__rafID = requestAnimationFrame(this.raf);
}
}
/**
* Destroy the lenis instance, remove all event listeners and clean up the class name
*/
destroy() {
this.emitter.destroy();
this.options.wrapper.removeEventListener(
"scroll",
this.onNativeScroll,
false
);
this.options.wrapper.removeEventListener("scrollend", this.onScrollEnd, {
capture: true
});
this.options.wrapper.removeEventListener(
"pointerdown",
this.onPointerDown,
false
);
if (this.options.anchors && this.options.wrapper === window) {
this.options.wrapper.removeEventListener(
"click",
this.onClick,
false
);
}
this.virtualScroll.destroy();
this.dimensions.destroy();
this.cleanUpClassName();
if (this.__rafID) {
cancelAnimationFrame(this.__rafID);
}
}
on(event, callback) {
return this.emitter.on(event, callback);
}
off(event, callback) {
return this.emitter.off(event, callback);
}
onScrollEnd = (e2) => {
if (!(e2 instanceof CustomEvent)) {
if (this.isScrolling === "smooth" || this.isScrolling === false) {
e2.stopPropagation();
}
}
};
dispatchScrollendEvent = () => {
this.options.wrapper.dispatchEvent(
new CustomEvent("scrollend", {
bubbles: this.options.wrapper === window,
// cancelable: false,
detail: {
lenisScrollEnd: true
}
})
);
};
setScroll(scroll) {
if (this.isHorizontal) {
this.options.wrapper.scrollTo({ left: scroll, behavior: "instant" });
} else {
this.options.wrapper.scrollTo({ top: scroll, behavior: "instant" });
}
}
onClick = (event) => {
const path = event.composedPath();
const anchor = path.find(
(node) => node instanceof HTMLAnchorElement && node.getAttribute("href")?.startsWith("#")
);
if (anchor) {
const id = anchor.getAttribute("href");
if (id) {
const options = typeof this.options.anchors === "object" && this.options.anchors ? this.options.anchors : void 0;
this.scrollTo(id, options);
}
}
};
onPointerDown = (event) => {
if (event.button === 1) {
this.reset();
}
};
onVirtualScroll = (data) => {
if (typeof this.options.virtualScroll === "function" && this.options.virtualScroll(data) === false)
return;
const { deltaX, deltaY, event } = data;
this.emitter.emit("virtual-scroll", { deltaX, deltaY, event });
if (event.ctrlKey) return;
if (event.lenisStopPropagation) return;
const isTouch = event.type.includes("touch");
const isWheel = event.type.includes("wheel");
this.isTouching = event.type === "touchstart" || event.type === "touchmove";
const isClickOrTap = deltaX === 0 && deltaY === 0;
const isTapToStop = this.options.syncTouch && isTouch && event.type === "touchstart" && isClickOrTap && !this.isStopped && !this.isLocked;
if (isTapToStop) {
this.reset();
return;
}
const isUnknownGesture = this.options.gestureOrientation === "vertical" && deltaY === 0 || this.options.gestureOrientation === "horizontal" && deltaX === 0;
if (isClickOrTap || isUnknownGesture) {
return;
}
let composedPath = event.composedPath();
composedPath = composedPath.slice(0, composedPath.indexOf(this.rootElement));
const prevent2 = this.options.prevent;
if (!!composedPath.find(
(node) => node instanceof HTMLElement && (typeof prevent2 === "function" && prevent2?.(node) || node.hasAttribute?.("data-lenis-prevent") || isTouch && node.hasAttribute?.("data-lenis-prevent-touch") || isWheel && node.hasAttribute?.("data-lenis-prevent-wheel"))
))
return;
if (this.isStopped || this.isLocked) {
event.preventDefault();
return;
}
const isSmooth = this.options.syncTouch && isTouch || this.options.smoothWheel && isWheel;
if (!isSmooth) {
this.isScrolling = "native";
this.animate.stop();
event.lenisStopPropagation = true;
return;
}
let delta = deltaY;
if (this.options.gestureOrientation === "both") {
delta = Math.abs(deltaY) > Math.abs(deltaX) ? deltaY : deltaX;
} else if (this.options.gestureOrientation === "horizontal") {
delta = deltaX;
}
if (!this.options.overscroll || this.options.infinite || this.options.wrapper !== window && (this.animatedScroll > 0 && this.animatedScroll < this.limit || this.animatedScroll === 0 && deltaY > 0 || this.animatedScroll === this.limit && deltaY < 0)) {
event.lenisStopPropagation = true;
}
event.preventDefault();
const isSyncTouch = isTouch && this.options.syncTouch;
const isTouchEnd = isTouch && event.type === "touchend";
const hasTouchInertia = isTouchEnd && Math.abs(delta) > 5;
if (hasTouchInertia) {
delta = this.velocity * this.options.touchInertiaMultiplier;
}
this.scrollTo(this.targetScroll + delta, {
programmatic: false,
...isSyncTouch ? {
lerp: hasTouchInertia ? this.options.syncTouchLerp : 1
// immediate: !hasTouchInertia,
} : {
lerp: this.options.lerp,
duration: this.options.duration,
easing: this.options.easing
}
});
};
/**
* Force lenis to recalculate the dimensions
*/
resize() {
this.dimensions.resize();
this.animatedScroll = this.targetScroll = this.actualScroll;
this.emit();
}
emit() {
this.emitter.emit("scroll", this);
}
onNativeScroll = () => {
if (this._resetVelocityTimeout !== null) {
clearTimeout(this._resetVelocityTimeout);
this._resetVelocityTimeout = null;
}
if (this._preventNextNativeScrollEvent) {
this._preventNextNativeScrollEvent = false;
return;
}
if (this.isScrolling === false || this.isScrolling === "native") {
const lastScroll = this.animatedScroll;
this.animatedScroll = this.targetScroll = this.actualScroll;
this.lastVelocity = this.velocity;
this.velocity = this.animatedScroll - lastScroll;
this.direction = Math.sign(
this.animatedScroll - lastScroll
);
if (!this.isStopped) {
this.isScrolling = "native";
}
this.emit();
if (this.velocity !== 0) {
this._resetVelocityTimeout = setTimeout(() => {
this.lastVelocity = this.velocity;
this.velocity = 0;
this.isScrolling = false;
this.emit();
}, 400);
}
}
};
reset() {
this.isLocked = false;
this.isScrolling = false;
this.animatedScroll = this.targetScroll = this.actualScroll;
this.lastVelocity = this.velocity = 0;
this.animate.stop();
}
/**
* Start lenis scroll after it has been stopped
*/
start() {
if (!this.isStopped) return;
this.reset();
this.isStopped = false;
}
/**
* Stop lenis scroll
*/
stop() {
if (this.isStopped) return;
this.reset();
this.isStopped = true;
}
/**
* RequestAnimationFrame for lenis
*
* @param time The time in ms from an external clock like `requestAnimationFrame` or Tempus
*/
raf = (time) => {
const deltaTime = time - (this.time || time);
this.time = time;
this.animate.advance(deltaTime * 1e-3);
if (this.options.autoRaf) {
this.__rafID = requestAnimationFrame(this.raf);
}
};
/**
* Scroll to a target value
*
* @param target The target value to scroll to
* @param options The options for the scroll
*
* @example
* lenis.scrollTo(100, {
* offset: 100,
* duration: 1,
* easing: (t) => 1 - Math.cos((t * Math.PI) / 2),
* lerp: 0.1,
* onStart: () => {
* console.log('onStart')
* },
* onComplete: () => {
* console.log('onComplete')
* },
* })
*/
scrollTo(target, {
offset: offset2 = 0,
immediate = false,
lock = false,
duration = this.options.duration,
easing = this.options.easing,
lerp: lerp2 = this.options.lerp,
onStart,
onComplete,
force = false,
// scroll even if stopped
programmatic = true,
// called from outside of the class
userData
} = {}) {
if ((this.isStopped || this.isLocked) && !force) return;
if (typeof target === "string" && ["top", "left", "start"].includes(target)) {
target = 0;
} else if (typeof target === "string" && ["bottom", "right", "end"].includes(target)) {
target = this.limit;
} else {
let node;
if (typeof target === "string") {
node = document.querySelector(target);
} else if (target instanceof HTMLElement && target?.nodeType) {
node = target;
}
if (node) {
if (this.options.wrapper !== window) {
const wrapperRect = this.rootElement.getBoundingClientRect();
offset2 -= this.isHorizontal ? wrapperRect.left : wrapperRect.top;
}
const rect2 = node.getBoundingClientRect();
target = (this.isHorizontal ? rect2.left : rect2.top) + this.animatedScroll;
}
}
if (typeof target !== "number") return;
target += offset2;
target = Math.round(target);
if (this.options.infinite) {
if (programmatic) {
this.targetScroll = this.animatedScroll = this.scroll;
}
} else {
target = clamp(0, target, this.limit);
}
if (target === this.targetScroll) {
onStart?.(this);
onComplete?.(this);
return;
}
this.userData = userData ?? {};
if (immediate) {
this.animatedScroll = this.targetScroll = target;
this.setScroll(this.scroll);
this.reset();
this.preventNextNativeScrollEvent();
this.emit();
onComplete?.(this);
this.userData = {};
requestAnimationFrame(() => {
this.dispatchScrollendEvent();
});
return;
}
if (!programmatic) {
this.targetScroll = target;
}
this.animate.fromTo(this.animatedScroll, target, {
duration,
easing,
lerp: lerp2,
onStart: () => {
if (lock) this.isLocked = true;
this.isScrolling = "smooth";
onStart?.(this);
},
onUpdate: (value, completed) => {
this.isScrolling = "smooth";
this.lastVelocity = this.velocity;
this.velocity = value - this.animatedScroll;
this.direction = Math.sign(this.velocity);
this.animatedScroll = value;
this.setScroll(this.scroll);
if (programmatic) {
this.targetScroll = value;
}
if (!completed) this.emit();
if (completed) {
this.reset();
this.emit();
onComplete?.(this);
this.userData = {};
requestAnimationFrame(() => {
this.dispatchScrollendEvent();
});
this.preventNextNativeScrollEvent();
}
}
});
}
preventNextNativeScrollEvent() {
this._preventNextNativeScrollEvent = true;
requestAnimationFrame(() => {
this._preventNextNativeScrollEvent = false;
});
}
/**
* The root element on which lenis is instanced
*/
get rootElement() {
return this.options.wrapper === window ? document.documentElement : this.options.wrapper;
}
/**
* The limit which is the maximum scroll value
*/
get limit() {
if (this.options.__experimental__naiveDimensions) {
if (this.isHorizontal) {
return this.rootElement.scrollWidth - this.rootElement.clientWidth;
} else {
return this.rootElement.scrollHeight - this.rootElement.clientHeight;
}
} else {
return this.dimensions.limit[this.isHorizontal ? "x" : "y"];
}
}
/**
* Whether or not the scroll is horizontal
*/
get isHorizontal() {
return this.options.orientation === "horizontal";
}
/**
* The actual scroll value
*/
get actualScroll() {
const wrapper = this.options.wrapper;
return this.isHorizontal ? wrapper.scrollX ?? wrapper.scrollLeft : wrapper.scrollY ?? wrapper.scrollTop;
}
/**
* The current scroll value
*/
get scroll() {
return this.options.infinite ? modulo(this.animatedScroll, this.limit) : this.animatedScroll;
}
/**
* The progress of the scroll relative to the limit
*/
get progress() {
return this.limit === 0 ? 1 : this.scroll / this.limit;
}
/**
* Current scroll state
*/
get isScrolling() {
return this._isScrolling;
}
set isScrolling(value) {
if (this._isScrolling !== value) {
this._isScrolling = value;
this.updateClassName();
}
}
/**
* Check if lenis is stopped
*/
get isStopped() {
return this._isStopped;
}
set isStopped(value) {
if (this._isStopped !== value) {
this._isStopped = value;
this.updateClassName();
}
}
/**
* Check if lenis is locked
*/
get isLocked() {
return this._isLocked;
}
set isLocked(value) {
if (this._isLocked !== value) {
this._isLocked = value;
this.updateClassName();
}
}
/**
* Check if lenis is smooth scrolling
*/
get isSmooth() {
return this.isScrolling === "smooth";
}
/**
* The class name applied to the wrapper element
*/
get className() {
let className = "lenis";
if (this.isStopped) className += " lenis-stopped";
if (this.isLocked) className += " lenis-locked";
if (this.isScrolling) className += " lenis-scrolling";
if (this.isScrolling === "smooth") className += " lenis-smooth";
return className;
}
updateClassName() {
this.cleanUpClassName();
this.rootElement.className = `${this.rootElement.className} ${this.className}`.trim();
}
cleanUpClassName() {
this.rootElement.className = this.rootElement.className.replace(/lenis(-\w+)?/g, "").trim();
}
};
// node_modules/gsap/gsap-core.js
function _assertThisInitialized2(self2) {
if (self2 === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self2;
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
var _config = {
autoSleep: 120,
force3D: "auto",
nullTargetWarn: 1,
units: {
lineHeight: ""
}
};
var _defaults = {
duration: 0.5,
overwrite: false,
delay: 0
};
var _suppressOverwrites;
var _reverting;
var _context;
var _bigNum = 1e8;
var _tinyNum = 1 / _bigNum;
var _2PI = Math.PI * 2;
var _HALF_PI = _2PI / 4;
var _gsID = 0;
var _sqrt = Math.sqrt;
var _cos = Math.cos;
var _sin = Math.sin;
var _isString = function _isString2(value) {
return typeof value === "string";
};
var _isFunction = function _isFunction2(value) {
return typeof value === "function";
};
var _isNumber = function _isNumber2(value) {
return typeof value === "number";
};
var _isUndefined = function _isUndefined2(value) {
return typeof value === "undefined";
};
var _isObject = function _isObject2(value) {
return typeof value === "object";
};
var _isNotFalse = function _isNotFalse2(value) {
return value !== false;
};
var _windowExists = function _windowExists2() {
return typeof window !== "undefined";
};
var _isFuncOrString = function _isFuncOrString2(value) {
return _isFunction(value) || _isString(value);
};
var _isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView || function() {
};
var _isArray = Array.isArray;
var _strictNumExp = /(?:-?\.?\d|\.)+/gi;
var _numExp = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g;
var _numWithUnitExp = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g;
var _complexStringNumExp = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi;
var _relExp = /[+-]=-?[.\d]+/;
var _delimitedValueExp = /[^,'"\[\]\s]+/gi;
var _unitExp = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i;
var _globalTimeline;
var _win;
var _coreInitted;
var _doc;
var _globals = {};
var _installScope = {};
var _coreReady;
var _install = function _install2(scope) {
return (_installScope = _merge(scope, _globals)) && gsap;
};
var _missingPlugin = function _missingPlugin2(property, value) {
return console.warn("Invalid property", property, "set to", value, "Missing plugin? gsap.registerPlugin()");
};
var _warn = function _warn2(message, suppress) {
return !suppress && console.warn(message);
};
var _addGlobal = function _addGlobal2(name, obj) {
return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals;
};
var _emptyFunc = function _emptyFunc2() {
return 0;
};
var _startAtRevertConfig = {
suppressEvents: true,
isStart: true,
kill: false
};
var _revertConfigNoKill = {
suppressEvents: true,
kill: false
};
var _revertConfig = {
suppressEvents: true
};
var _reservedProps = {};
var _lazyTweens = [];
var _lazyLookup = {};
var _lastRenderedFrame;
var _plugins = {};
var _effects = {};
var _nextGCFrame = 30;
var _harnessPlugins = [];
var _callbackNames = "";
var _harness = function _harness2(targets) {
var target = targets[0], harnessPlugin, i3;
_isObject(target) || _isFunction(target) || (targets = [targets]);
if (!(harnessPlugin = (target._gsap || {}).harness)) {
i3 = _harnessPlugins.length;
while (i3-- && !_harnessPlugins[i3].targetTest(target)) {
}
harnessPlugin = _harnessPlugins[i3];
}
i3 = targets.length;
while (i3--) {
targets[i3] && (targets[i3]._gsap || (targets[i3]._gsap = new GSCache(targets[i3], harnessPlugin))) || targets.splice(i3, 1);
}
return targets;
};
var _getCache = function _getCache2(target) {
return target._gsap || _harness(toArray(target))[0]._gsap;
};
var _getProperty = function _getProperty2(target, property, v) {
return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v;
};
var _forEachName = function _forEachName2(names, func) {
return (names = names.split(",")).forEach(func) || names;
};
var _round = function _round2(value) {
return Math.round(value * 1e5) / 1e5 || 0;
};
var _roundPrecise = function _roundPrecise2(value) {
return Math.round(value * 1e7) / 1e7 || 0;
};
var _parseRelative = function _parseRelative2(start3, value) {
var operator = value.charAt(0), end2 = parseFloat(value.substr(2));
start3 = parseFloat(start3);
return operator === "+" ? start3 + end2 : operator === "-" ? start3 - end2 : operator === "*" ? start3 * end2 : start3 / end2;
};
var _arrayContainsAny = function _arrayContainsAny2(toSearch, toFind) {
var l = toFind.length, i3 = 0;
for (; toSearch.indexOf(toFind[i3]) < 0 && ++i3 < l; ) {
}
return i3 < l;
};
var _lazyRender = function _lazyRender2() {
var l = _lazyTweens.length, a = _lazyTweens.slice(0), i3, tween;
_lazyLookup = {};
_lazyTweens.length = 0;
for (i3 = 0; i3 < l; i3++) {
tween = a[i3];
tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0);
}
};
var _lazySafeRender = function _lazySafeRender2(animation, time, suppressEvents, force) {
_lazyTweens.length && !_reverting && _lazyRender();
animation.render(time, suppressEvents, force || _reverting && time < 0 && (animation._initted || animation._startAt));
_lazyTweens.length && !_reverting && _lazyRender();
};
var _numericIfPossible = function _numericIfPossible2(value) {
var n2 = parseFloat(value);
return (n2 || n2 === 0) && (value + "").match(_delimitedValueExp).length < 2 ? n2 : _isString(value) ? value.trim() : value;
};
var _passThrough = function _passThrough2(p) {
return p;
};
var _setDefaults = function _setDefaults2(obj, defaults2) {
for (var p in defaults2) {
p in obj || (obj[p] = defaults2[p]);
}
return obj;
};
var _setKeyframeDefaults = function _setKeyframeDefaults2(excludeDuration) {
return function(obj, defaults2) {
for (var p in defaults2) {
p in obj || p === "duration" && excludeDuration || p === "ease" || (obj[p] = defaults2[p]);
}
};
};
var _merge = function _merge2(base, toMerge) {
for (var p in toMerge) {
base[p] = toMerge[p];
}
return base;
};
var _mergeDeep = function _mergeDeep2(base, toMerge) {
for (var p in toMerge) {
p !== "__proto__" && p !== "constructor" && p !== "prototype" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep2(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]);
}
return base;
};
var _copyExcluding = function _copyExcluding2(obj, excluding) {
var copy = {}, p;
for (p in obj) {
p in excluding || (copy[p] = obj[p]);
}
return copy;
};
var _inheritDefaults = function _inheritDefaults2(vars) {
var parent = vars.parent || _globalTimeline, func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults;
if (_isNotFalse(vars.inherit)) {
while (parent) {
func(vars, parent.vars.defaults);
parent = parent.parent || parent._dp;
}
}
return vars;
};
var _arraysMatch = function _arraysMatch2(a1, a2) {
var i3 = a1.length, match = i3 === a2.length;
while (match && i3-- && a1[i3] === a2[i3]) {
}
return i3 < 0;
};
var _addLinkedListItem = function _addLinkedListItem2(parent, child2, firstProp, lastProp, sortBy) {
if (firstProp === void 0) {
firstProp = "_first";
}
if (lastProp === void 0) {
lastProp = "_last";
}
var prev = parent[lastProp], t3;
if (sortBy) {
t3 = child2[sortBy];
while (prev && prev[sortBy] > t3) {
prev = prev._prev;
}
}
if (prev) {
child2._next = prev._next;
prev._next = child2;
} else {
child2._next = parent[firstProp];
parent[firstProp] = child2;
}
if (child2._next) {
child2._next._prev = child2;
} else {
parent[lastProp] = child2;
}
child2._prev = prev;
child2.parent = child2._dp = parent;
return child2;
};
var _removeLinkedListItem = function _removeLinkedListItem2(parent, child2, firstProp, lastProp) {
if (firstProp === void 0) {
firstProp = "_first";
}
if (lastProp === void 0) {
lastProp = "_last";
}
var prev = child2._prev, next = child2._next;
if (prev) {
prev._next = next;
} else if (parent[firstProp] === child2) {
parent[firstProp] = next;
}
if (next) {
next._prev = prev;
} else if (parent[lastProp] === child2) {
parent[lastProp] = prev;
}
child2._next = child2._prev = child2.parent = null;
};
var _removeFromParent = function _removeFromParent2(child2, onlyIfParentHasAutoRemove) {
child2.parent && (!onlyIfParentHasAutoRemove || child2.parent.autoRemoveChildren) && child2.parent.remove && child2.parent.remove(child2);
child2._act = 0;
};
var _uncache = function _uncache2(animation, child2) {
if (animation && (!child2 || child2._end > animation._dur || child2._start < 0)) {
var a = animation;
while (a) {
a._dirty = 1;
a = a.parent;
}
}
return animation;
};
var _recacheAncestors = function _recacheAncestors2(animation) {
var parent = animation.parent;
while (parent && parent.parent) {
parent._dirty = 1;
parent.totalDuration();
parent = parent.parent;
}
return animation;
};
var _rewindStartAt = function _rewindStartAt2(tween, totalTime, suppressEvents, force) {
return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force));
};
var _hasNoPausedAncestors = function _hasNoPausedAncestors2(animation) {
return !animation || animation._ts && _hasNoPausedAncestors2(animation.parent);
};
var _elapsedCycleDuration = function _elapsedCycleDuration2(animation) {
return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0;
};
var _animationCycle = function _animationCycle2(tTime, cycleDuration) {
var whole = Math.floor(tTime /= cycleDuration);
return tTime && whole === tTime ? whole - 1 : whole;
};
var _parentToChildTotalTime = function _parentToChildTotalTime2(parentTime, child2) {
return (parentTime - child2._start) * child2._ts + (child2._ts >= 0 ? 0 : child2._dirty ? child2.totalDuration() : child2._tDur);
};
var _setEnd = function _setEnd2(animation) {
return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0));
};
var _alignPlayhead = function _alignPlayhead2(animation, totalTime) {
var parent = animation._dp;
if (parent && parent.smoothChildTiming && animation._ts) {
animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts));
_setEnd(animation);
parent._dirty || _uncache(parent, animation);
}
return animation;
};
var _postAddChecks = function _postAddChecks2(timeline2, child2) {
var t3;
if (child2._time || !child2._dur && child2._initted || child2._start < timeline2._time && (child2._dur || !child2.add)) {
t3 = _parentToChildTotalTime(timeline2.rawTime(), child2);
if (!child2._dur || _clamp(0, child2.totalDuration(), t3) - child2._tTime > _tinyNum) {
child2.render(t3, true);
}
}
if (_uncache(timeline2, child2)._dp && timeline2._initted && timeline2._time >= timeline2._dur && timeline2._ts) {
if (timeline2._dur < timeline2.duration()) {
t3 = timeline2;
while (t3._dp) {
t3.rawTime() >= 0 && t3.totalTime(t3._tTime);
t3 = t3._dp;
}
}
timeline2._zTime = -_tinyNum;
}
};
var _addToTimeline = function _addToTimeline2(timeline2, child2, position, skipChecks) {
child2.parent && _removeFromParent(child2);
child2._start = _roundPrecise((_isNumber(position) ? position : position || timeline2 !== _globalTimeline ? _parsePosition(timeline2, position, child2) : timeline2._time) + child2._delay);
child2._end = _roundPrecise(child2._start + (child2.totalDuration() / Math.abs(child2.timeScale()) || 0));
_addLinkedListItem(timeline2, child2, "_first", "_last", timeline2._sort ? "_start" : 0);
_isFromOrFromStart(child2) || (timeline2._recent = child2);
skipChecks || _postAddChecks(timeline2, child2);
timeline2._ts < 0 && _alignPlayhead(timeline2, timeline2._tTime);
return timeline2;
};
var _scrollTrigger = function _scrollTrigger2(animation, trigger) {
return (_globals.ScrollTrigger || _missingPlugin("scrollTrigger", trigger)) && _globals.ScrollTrigger.create(trigger, animation);
};
var _attemptInitTween = function _attemptInitTween2(tween, time, force, suppressEvents, tTime) {
_initTween(tween, time, tTime);
if (!tween._initted) {
return 1;
}
if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) {
_lazyTweens.push(tween);
tween._lazy = [tTime, suppressEvents];
return 1;
}
};
var _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart2(_ref) {
var parent = _ref.parent;
return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart2(parent));
};
var _isFromOrFromStart = function _isFromOrFromStart2(_ref2) {
var data = _ref2.data;
return data === "isFromStart" || data === "isStart";
};
var _renderZeroDurationTween = function _renderZeroDurationTween2(tween, totalTime, suppressEvents, force) {
var prevRatio = tween.ratio, ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1, repeatDelay = tween._rDelay, tTime = 0, pt, iteration, prevIteration;
if (repeatDelay && tween._repeat) {
tTime = _clamp(0, tween._tDur, totalTime);
iteration = _animationCycle(tTime, repeatDelay);
tween._yoyo && iteration & 1 && (ratio = 1 - ratio);
if (iteration !== _animationCycle(tween._tTime, repeatDelay)) {
prevRatio = 1 - ratio;
tween.vars.repeatRefresh && tween._initted && tween.invalidate();
}
}
if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) {
if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) {
return;
}
prevIteration = tween._zTime;
tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0);
suppressEvents || (suppressEvents = totalTime && !prevIteration);
tween.ratio = ratio;
tween._from && (ratio = 1 - ratio);
tween._time = 0;
tween._tTime = tTime;
pt = tween._pt;
while (pt) {
pt.r(ratio, pt.d);
pt = pt._next;
}
totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true);
tween._onUpdate && !suppressEvents && _callback(tween, "onUpdate");
tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, "onRepeat");
if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) {
ratio && _removeFromParent(tween, 1);
if (!suppressEvents && !_reverting) {
_callback(tween, ratio ? "onComplete" : "onReverseComplete", true);
tween._prom && tween._prom();
}
}
} else if (!tween._zTime) {
tween._zTime = totalTime;
}
};
var _findNextPauseTween = function _findNextPauseTween2(animation, prevTime, time) {
var child2;
if (time > prevTime) {
child2 = animation._first;
while (child2 && child2._start <= time) {
if (child2.data === "isPause" && child2._start > prevTime) {
return child2;
}
child2 = child2._next;
}
} else {
child2 = animation._last;
while (child2 && child2._start >= time) {
if (child2.data === "isPause" && child2._start < prevTime) {
return child2;
}
child2 = child2._prev;
}
}
};
var _setDuration = function _setDuration2(animation, duration, skipUncache, leavePlayhead) {
var repeat = animation._repeat, dur = _roundPrecise(duration) || 0, totalProgress = animation._tTime / animation._tDur;
totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur);
animation._dur = dur;
animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat);
totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress);
animation.parent && _setEnd(animation);
skipUncache || _uncache(animation.parent, animation);
return animation;
};
var _onUpdateTotalDuration = function _onUpdateTotalDuration2(animation) {
return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur);
};
var _zeroPosition = {
_start: 0,
endTime: _emptyFunc,
totalDuration: _emptyFunc
};
var _parsePosition = function _parsePosition2(animation, position, percentAnimation) {
var labels = animation.labels, recent = animation._recent || _zeroPosition, clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur, i3, offset2, isPercent;
if (_isString(position) && (isNaN(position) || position in labels)) {
offset2 = position.charAt(0);
isPercent = position.substr(-1) === "%";
i3 = position.indexOf("=");
if (offset2 === "<" || offset2 === ">") {
i3 >= 0 && (position = position.replace(/=/, ""));
return (offset2 === "<" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i3 < 0 ? recent : percentAnimation).totalDuration() / 100 : 1);
}
if (i3 < 0) {
position in labels || (labels[position] = clippedDuration);
return labels[position];
}
offset2 = parseFloat(position.charAt(i3 - 1) + position.substr(i3 + 1));
if (isPercent && percentAnimation) {
offset2 = offset2 / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration();
}
return i3 > 1 ? _parsePosition2(animation, position.substr(0, i3 - 1), percentAnimation) + offset2 : clippedDuration + offset2;
}
return position == null ? clippedDuration : +position;
};
var _createTweenType = function _createTweenType2(type, params, timeline2) {
var isLegacy = _isNumber(params[1]), varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1), vars = params[varsIndex], irVars, parent;
isLegacy && (vars.duration = params[1]);
vars.parent = timeline2;
if (type) {
irVars = vars;
parent = timeline2;
while (parent && !("immediateRender" in irVars)) {
irVars = parent.vars.defaults || {};
parent = _isNotFalse(parent.vars.inherit) && parent.parent;
}
vars.immediateRender = _isNotFalse(irVars.immediateRender);
type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1];
}
return new Tween(params[0], vars, params[varsIndex + 1]);
};
var _conditionalReturn = function _conditionalReturn2(value, func) {
return value || value === 0 ? func(value) : func;
};
var _clamp = function _clamp2(min4, max4, value) {
return value < min4 ? min4 : value > max4 ? max4 : value;
};
var getUnit = function getUnit2(value, v) {
return !_isString(value) || !(v = _unitExp.exec(value)) ? "" : v[1];
};
var clamp2 = function clamp3(min4, max4, value) {
return _conditionalReturn(value, function(v) {
return _clamp(min4, max4, v);
});
};
var _slice = [].slice;
var _isArrayLike = function _isArrayLike2(value, nonEmpty) {
return value && _isObject(value) && "length" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win;
};
var _flatten = function _flatten2(ar, leaveStrings, accumulator) {
if (accumulator === void 0) {
accumulator = [];
}
return ar.forEach(function(value) {
var _accumulator;
return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value);
}) || accumulator;
};
var toArray = function toArray2(value, scope, leaveStrings) {
return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : [];
};
var selector = function selector2(value) {
value = toArray(value)[0] || _warn("Invalid scope") || {};
return function(v) {
var el = value.current || value.nativeElement || value;
return toArray(v, el.querySelectorAll ? el : el === value ? _warn("Invalid scope") || _doc.createElement("div") : value);
};
};
var shuffle = function shuffle2(a) {
return a.sort(function() {
return 0.5 - Math.random();
});
};
var distribute = function distribute2(v) {
if (_isFunction(v)) {
return v;
}
var vars = _isObject(v) ? v : {
each: v
}, ease = _parseEase(vars.ease), from = vars.from || 0, base = parseFloat(vars.base) || 0, cache = {}, isDecimal = from > 0 && from < 1, ratios = isNaN(from) || isDecimal, axis = vars.axis, ratioX = from, ratioY = from;
if (_isString(from)) {
ratioX = ratioY = {
center: 0.5,
edges: 0.5,
end: 1
}[from] || 0;
} else if (!isDecimal && ratios) {
ratioX = from[0];
ratioY = from[1];
}
return function(i3, target, a) {
var l = (a || vars).length, distances = cache[l], originX, originY, x, y3, d3, j, max4, min4, wrapAt;
if (!distances) {
wrapAt = vars.grid === "auto" ? 0 : (vars.grid || [1, _bigNum])[1];
if (!wrapAt) {
max4 = -_bigNum;
while (max4 < (max4 = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {
}
wrapAt < l && wrapAt--;
}
distances = cache[l] = [];
originX = ratios ? Math.min(wrapAt, l) * ratioX - 0.5 : from % wrapAt;
originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - 0.5 : from / wrapAt | 0;
max4 = 0;
min4 = _bigNum;
for (j = 0; j < l; j++) {
x = j % wrapAt - originX;
y3 = originY - (j / wrapAt | 0);
distances[j] = d3 = !axis ? _sqrt(x * x + y3 * y3) : Math.abs(axis === "y" ? y3 : x);
d3 > max4 && (max4 = d3);
d3 < min4 && (min4 = d3);
}
from === "random" && shuffle(distances);
distances.max = max4 - min4;
distances.min = min4;
distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === "y" ? l / wrapAt : wrapAt) || 0) * (from === "edges" ? -1 : 1);
distances.b = l < 0 ? base - l : base;
distances.u = getUnit(vars.amount || vars.each) || 0;
ease = ease && l < 0 ? _invertEase(ease) : ease;
}
l = (distances[i3] - distances.min) / distances.max || 0;
return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u;
};
};
var _roundModifier = function _roundModifier2(v) {
var p = Math.pow(10, ((v + "").split(".")[1] || "").length);
return function(raw) {
var n2 = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p);
return (n2 - n2 % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw));
};
};
var snap = function snap2(snapTo, value) {
var isArray3 = _isArray(snapTo), radius, is2D;
if (!isArray3 && _isObject(snapTo)) {
radius = isArray3 = snapTo.radius || _bigNum;
if (snapTo.values) {
snapTo = toArray(snapTo.values);
if (is2D = !_isNumber(snapTo[0])) {
radius *= radius;
}
} else {
snapTo = _roundModifier(snapTo.increment);
}
}
return _conditionalReturn(value, !isArray3 ? _roundModifier(snapTo) : _isFunction(snapTo) ? function(raw) {
is2D = snapTo(raw);
return Math.abs(is2D - raw) <= radius ? is2D : raw;
} : function(raw) {
var x = parseFloat(is2D ? raw.x : raw), y3 = parseFloat(is2D ? raw.y : 0), min4 = _bigNum, closest2 = 0, i3 = snapTo.length, dx, dy;
while (i3--) {
if (is2D) {
dx = snapTo[i3].x - x;
dy = snapTo[i3].y - y3;
dx = dx * dx + dy * dy;
} else {
dx = Math.abs(snapTo[i3] - x);
}
if (dx < min4) {
min4 = dx;
closest2 = i3;
}
}
closest2 = !radius || min4 <= radius ? snapTo[closest2] : raw;
return is2D || closest2 === raw || _isNumber(raw) ? closest2 : closest2 + getUnit(raw);
});
};
var random = function random2(min4, max4, roundingIncrement, returnFunction) {
return _conditionalReturn(_isArray(min4) ? !max4 : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function() {
return _isArray(min4) ? min4[~~(Math.random() * min4.length)] : (roundingIncrement = roundingIncrement || 1e-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + "").length - 2) : 1) && Math.floor(Math.round((min4 - roundingIncrement / 2 + Math.random() * (max4 - min4 + roundingIncrement * 0.99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction;
});
};
var pipe = function pipe2() {
for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) {
functions[_key] = arguments[_key];
}
return function(value) {
return functions.reduce(function(v, f) {
return f(v);
}, value);
};
};
var unitize = function unitize2(func, unit2) {
return function(value) {
return func(parseFloat(value)) + (unit2 || getUnit(value));
};
};
var normalize = function normalize2(min4, max4, value) {
return mapRange(min4, max4, 0, 1, value);
};
var _wrapArray = function _wrapArray2(a, wrapper, value) {
return _conditionalReturn(value, function(index) {
return a[~~wrapper(index)];
});
};
var wrap = function wrap2(min4, max4, value) {
var range2 = max4 - min4;
return _isArray(min4) ? _wrapArray(min4, wrap2(0, min4.length), max4) : _conditionalReturn(value, function(value2) {
return (range2 + (value2 - min4) % range2) % range2 + min4;
});
};
var wrapYoyo = function wrapYoyo2(min4, max4, value) {
var range2 = max4 - min4, total = range2 * 2;
return _isArray(min4) ? _wrapArray(min4, wrapYoyo2(0, min4.length - 1), max4) : _conditionalReturn(value, function(value2) {
value2 = (total + (value2 - min4) % total) % total || 0;
return min4 + (value2 > range2 ? total - value2 : value2);
});
};
var _replaceRandom = function _replaceRandom2(value) {
var prev = 0, s2 = "", i3, nums, end2, isArray3;
while (~(i3 = value.indexOf("random(", prev))) {
end2 = value.indexOf(")", i3);
isArray3 = value.charAt(i3 + 7) === "[";
nums = value.substr(i3 + 7, end2 - i3 - 7).match(isArray3 ? _delimitedValueExp : _strictNumExp);
s2 += value.substr(prev, i3 - prev) + random(isArray3 ? nums : +nums[0], isArray3 ? 0 : +nums[1], +nums[2] || 1e-5);
prev = end2 + 1;
}
return s2 + value.substr(prev, value.length - prev);
};
var mapRange = function mapRange2(inMin, inMax, outMin, outMax, value) {
var inRange = inMax - inMin, outRange = outMax - outMin;
return _conditionalReturn(value, function(value2) {
return outMin + ((value2 - inMin) / inRange * outRange || 0);
});
};
var interpolate = function interpolate2(start3, end2, progress, mutate) {
var func = isNaN(start3 + end2) ? 0 : function(p2) {
return (1 - p2) * start3 + p2 * end2;
};
if (!func) {
var isString2 = _isString(start3), master = {}, p, i3, interpolators, l, il;
progress === true && (mutate = 1) && (progress = null);
if (isString2) {
start3 = {
p: start3
};
end2 = {
p: end2
};
} else if (_isArray(start3) && !_isArray(end2)) {
interpolators = [];
l = start3.length;
il = l - 2;
for (i3 = 1; i3 < l; i3++) {
interpolators.push(interpolate2(start3[i3 - 1], start3[i3]));
}
l--;
func = function func2(p2) {
p2 *= l;
var i4 = Math.min(il, ~~p2);
return interpolators[i4](p2 - i4);
};
progress = end2;
} else if (!mutate) {
start3 = _merge(_isArray(start3) ? [] : {}, start3);
}
if (!interpolators) {
for (p in end2) {
_addPropTween.call(master, start3, p, "get", end2[p]);
}
func = function func2(p2) {
return _renderPropTweens(p2, master) || (isString2 ? start3.p : start3);
};
}
}
return _conditionalReturn(progress, func);
};
var _getLabelInDirection = function _getLabelInDirection2(timeline2, fromTime, backward) {
var labels = timeline2.labels, min4 = _bigNum, p, distance, label;
for (p in labels) {
distance = labels[p] - fromTime;
if (distance < 0 === !!backward && distance && min4 > (distance = Math.abs(distance))) {
label = p;
min4 = distance;
}
}
return label;
};
var _callback = function _callback2(animation, type, executeLazyFirst) {
var v = animation.vars, callback = v[type], prevContext = _context, context3 = animation._ctx, params, scope, result;
if (!callback) {
return;
}
params = v[type + "Params"];
scope = v.callbackScope || animation;
executeLazyFirst && _lazyTweens.length && _lazyRender();
context3 && (_context = context3);
result = params ? callback.apply(scope, params) : callback.call(scope);
_context = prevContext;
return result;
};
var _interrupt = function _interrupt2(animation) {
_removeFromParent(animation);
animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting);
animation.progress() < 1 && _callback(animation, "onInterrupt");
return animation;
};
var _quickTween;
var _registerPluginQueue = [];
var _createPlugin = function _createPlugin2(config3) {
if (!config3) return;
config3 = !config3.name && config3["default"] || config3;
if (_windowExists() || config3.headless) {
var name = config3.name, isFunc = _isFunction(config3), Plugin = name && !isFunc && config3.init ? function() {
this._props = [];
} : config3, instanceDefaults = {
init: _emptyFunc,
render: _renderPropTweens,
add: _addPropTween,
kill: _killPropTweensOf,
modifier: _addPluginModifier,
rawVars: 0
}, statics = {
targetTest: 0,
get: 0,
getSetter: _getSetter,
aliases: {},
register: 0
};
_wake();
if (config3 !== Plugin) {
if (_plugins[name]) {
return;
}
_setDefaults(Plugin, _setDefaults(_copyExcluding(config3, instanceDefaults), statics));
_merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config3, statics)));
_plugins[Plugin.prop = name] = Plugin;
if (config3.targetTest) {
_harnessPlugins.push(Plugin);
_reservedProps[name] = 1;
}
name = (name === "css" ? "CSS" : name.charAt(0).toUpperCase() + name.substr(1)) + "Plugin";
}
_addGlobal(name, Plugin);
config3.register && config3.register(gsap, Plugin, PropTween);
} else {
_registerPluginQueue.push(config3);
}
};
var _255 = 255;
var _colorLookup = {
aqua: [0, _255, _255],
lime: [0, _255, 0],
silver: [192, 192, 192],
black: [0, 0, 0],
maroon: [128, 0, 0],
teal: [0, 128, 128],
blue: [0, 0, _255],
navy: [0, 0, 128],
white: [_255, _255, _255],
olive: [128, 128, 0],
yellow: [_255, _255, 0],
orange: [_255, 165, 0],
gray: [128, 128, 128],
purple: [128, 0, 128],
green: [0, 128, 0],
red: [_255, 0, 0],
pink: [_255, 192, 203],
cyan: [0, _255, _255],
transparent: [_255, _255, _255, 0]
};
var _hue = function _hue2(h, m1, m22) {
h += h < 0 ? 1 : h > 1 ? -1 : 0;
return (h * 6 < 1 ? m1 + (m22 - m1) * h * 6 : h < 0.5 ? m22 : h * 3 < 2 ? m1 + (m22 - m1) * (2 / 3 - h) * 6 : m1) * _255 + 0.5 | 0;
};
var splitColor = function splitColor2(v, toHSL, forceAlpha) {
var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0, r, g, b, h, s2, l, max4, min4, d3, wasHSL;
if (!a) {
if (v.substr(-1) === ",") {
v = v.substr(0, v.length - 1);
}
if (_colorLookup[v]) {
a = _colorLookup[v];
} else if (v.charAt(0) === "#") {
if (v.length < 6) {
r = v.charAt(1);
g = v.charAt(2);
b = v.charAt(3);
v = "#" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : "");
}
if (v.length === 9) {
a = parseInt(v.substr(1, 6), 16);
return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255];
}
v = parseInt(v.substr(1), 16);
a = [v >> 16, v >> 8 & _255, v & _255];
} else if (v.substr(0, 3) === "hsl") {
a = wasHSL = v.match(_strictNumExp);
if (!toHSL) {
h = +a[0] % 360 / 360;
s2 = +a[1] / 100;
l = +a[2] / 100;
g = l <= 0.5 ? l * (s2 + 1) : l + s2 - l * s2;
r = l * 2 - g;
a.length > 3 && (a[3] *= 1);
a[0] = _hue(h + 1 / 3, r, g);
a[1] = _hue(h, r, g);
a[2] = _hue(h - 1 / 3, r, g);
} else if (~v.indexOf("=")) {
a = v.match(_numExp);
forceAlpha && a.length < 4 && (a[3] = 1);
return a;
}
} else {
a = v.match(_strictNumExp) || _colorLookup.transparent;
}
a = a.map(Number);
}
if (toHSL && !wasHSL) {
r = a[0] / _255;
g = a[1] / _255;
b = a[2] / _255;
max4 = Math.max(r, g, b);
min4 = Math.min(r, g, b);
l = (max4 + min4) / 2;
if (max4 === min4) {
h = s2 = 0;
} else {
d3 = max4 - min4;
s2 = l > 0.5 ? d3 / (2 - max4 - min4) : d3 / (max4 + min4);
h = max4 === r ? (g - b) / d3 + (g < b ? 6 : 0) : max4 === g ? (b - r) / d3 + 2 : (r - g) / d3 + 4;
h *= 60;
}
a[0] = ~~(h + 0.5);
a[1] = ~~(s2 * 100 + 0.5);
a[2] = ~~(l * 100 + 0.5);
}
forceAlpha && a.length < 4 && (a[3] = 1);
return a;
};
var _colorOrderData = function _colorOrderData2(v) {
var values = [], c = [], i3 = -1;
v.split(_colorExp).forEach(function(v2) {
var a = v2.match(_numWithUnitExp) || [];
values.push.apply(values, a);
c.push(i3 += a.length + 1);
});
values.c = c;
return values;
};
var _formatColors = function _formatColors2(s2, toHSL, orderMatchData) {
var result = "", colors = (s2 + result).match(_colorExp), type = toHSL ? "hsla(" : "rgba(", i3 = 0, c, shell, d3, l;
if (!colors) {
return s2;
}
colors = colors.map(function(color) {
return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : color.join(",")) + ")";
});
if (orderMatchData) {
d3 = _colorOrderData(s2);
c = orderMatchData.c;
if (c.join(result) !== d3.c.join(result)) {
shell = s2.replace(_colorExp, "1").split(_numWithUnitExp);
l = shell.length - 1;
for (; i3 < l; i3++) {
result += shell[i3] + (~c.indexOf(i3) ? colors.shift() || type + "0,0,0,0)" : (d3.length ? d3 : colors.length ? colors : orderMatchData).shift());
}
}
}
if (!shell) {
shell = s2.split(_colorExp);
l = shell.length - 1;
for (; i3 < l; i3++) {
result += shell[i3] + colors[i3];
}
}
return result + shell[l];
};
var _colorExp = function() {
var s2 = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", p;
for (p in _colorLookup) {
s2 += "|" + p + "\\b";
}
return new RegExp(s2 + ")", "gi");
}();
var _hslExp = /hsl[a]?\(/;
var _colorStringFilter = function _colorStringFilter2(a) {
var combined = a.join(" "), toHSL;
_colorExp.lastIndex = 0;
if (_colorExp.test(combined)) {
toHSL = _hslExp.test(combined);
a[1] = _formatColors(a[1], toHSL);
a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1]));
return true;
}
};
var _tickerActive;
var _ticker = function() {
var _getTime3 = Date.now, _lagThreshold = 500, _adjustedLag = 33, _startTime = _getTime3(), _lastUpdate = _startTime, _gap = 1e3 / 240, _nextTime = _gap, _listeners3 = [], _id, _req, _raf, _self, _delta, _i2, _tick = function _tick2(v) {
var elapsed = _getTime3() - _lastUpdate, manual = v === true, overlap, dispatch, time, frame;
(elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag);
_lastUpdate += elapsed;
time = _lastUpdate - _startTime;
overlap = time - _nextTime;
if (overlap > 0 || manual) {
frame = ++_self.frame;
_delta = time - _self.time * 1e3;
_self.time = time = time / 1e3;
_nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap);
dispatch = 1;
}
manual || (_id = _req(_tick2));
if (dispatch) {
for (_i2 = 0; _i2 < _listeners3.length; _i2++) {
_listeners3[_i2](time, _delta, frame, v);
}
}
};
_self = {
time: 0,
frame: 0,
tick: function tick() {
_tick(true);
},
deltaRatio: function deltaRatio(fps) {
return _delta / (1e3 / (fps || 60));
},
wake: function wake() {
if (_coreReady) {
if (!_coreInitted && _windowExists()) {
_win = _coreInitted = window;
_doc = _win.document || {};
_globals.gsap = gsap;
(_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version);
_install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {});
_registerPluginQueue.forEach(_createPlugin);
}
_raf = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame;
_id && _self.sleep();
_req = _raf || function(f) {
return setTimeout(f, _nextTime - _self.time * 1e3 + 1 | 0);
};
_tickerActive = 1;
_tick(2);
}
},
sleep: function sleep() {
(_raf ? cancelAnimationFrame : clearTimeout)(_id);
_tickerActive = 0;
_req = _emptyFunc;
},
lagSmoothing: function lagSmoothing(threshold, adjustedLag) {
_lagThreshold = threshold || Infinity;
_adjustedLag = Math.min(adjustedLag || 33, _lagThreshold);
},
fps: function fps(_fps) {
_gap = 1e3 / (_fps || 240);
_nextTime = _self.time * 1e3 + _gap;
},
add: function add(callback, once, prioritize) {
var func = once ? function(t3, d3, f, v) {
callback(t3, d3, f, v);
_self.remove(func);
} : callback;
_self.remove(callback);
_listeners3[prioritize ? "unshift" : "push"](func);
_wake();
return func;
},
remove: function remove2(callback, i3) {
~(i3 = _listeners3.indexOf(callback)) && _listeners3.splice(i3, 1) && _i2 >= i3 && _i2--;
},
_listeners: _listeners3
};
return _self;
}();
var _wake = function _wake2() {
return !_tickerActive && _ticker.wake();
};
var _easeMap = {};
var _customEaseExp = /^[\d.\-M][\d.\-,\s]/;
var _quotesExp = /["']/g;
var _parseObjectInString = function _parseObjectInString2(value) {
var obj = {}, split = value.substr(1, value.length - 3).split(":"), key = split[0], i3 = 1, l = split.length, index, val, parsedVal;
for (; i3 < l; i3++) {
val = split[i3];
index = i3 !== l - 1 ? val.lastIndexOf(",") : val.length;
parsedVal = val.substr(0, index);
obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, "").trim() : +parsedVal;
key = val.substr(index + 1).trim();
}
return obj;
};
var _valueInParentheses = function _valueInParentheses2(value) {
var open = value.indexOf("(") + 1, close = value.indexOf(")"), nested = value.indexOf("(", open);
return value.substring(open, ~nested && nested < close ? value.indexOf(")", close + 1) : close);
};
var _configEaseFromString = function _configEaseFromString2(name) {
var split = (name + "").split("("), ease = _easeMap[split[0]];
return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf("{") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(",").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE("", name) : ease;
};
var _invertEase = function _invertEase2(ease) {
return function(p) {
return 1 - ease(1 - p);
};
};
var _propagateYoyoEase = function _propagateYoyoEase2(timeline2, isYoyo) {
var child2 = timeline2._first, ease;
while (child2) {
if (child2 instanceof Timeline) {
_propagateYoyoEase2(child2, isYoyo);
} else if (child2.vars.yoyoEase && (!child2._yoyo || !child2._repeat) && child2._yoyo !== isYoyo) {
if (child2.timeline) {
_propagateYoyoEase2(child2.timeline, isYoyo);
} else {
ease = child2._ease;
child2._ease = child2._yEase;
child2._yEase = ease;
child2._yoyo = isYoyo;
}
}
child2 = child2._next;
}
};
var _parseEase = function _parseEase2(ease, defaultEase) {
return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase;
};
var _insertEase = function _insertEase2(names, easeIn, easeOut, easeInOut) {
if (easeOut === void 0) {
easeOut = function easeOut2(p) {
return 1 - easeIn(1 - p);
};
}
if (easeInOut === void 0) {
easeInOut = function easeInOut2(p) {
return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2;
};
}
var ease = {
easeIn,
easeOut,
easeInOut
}, lowercaseName;
_forEachName(names, function(name) {
_easeMap[name] = _globals[name] = ease;
_easeMap[lowercaseName = name.toLowerCase()] = easeOut;
for (var p in ease) {
_easeMap[lowercaseName + (p === "easeIn" ? ".in" : p === "easeOut" ? ".out" : ".inOut")] = _easeMap[name + "." + p] = ease[p];
}
});
return ease;
};
var _easeInOutFromOut = function _easeInOutFromOut2(easeOut) {
return function(p) {
return p < 0.5 ? (1 - easeOut(1 - p * 2)) / 2 : 0.5 + easeOut((p - 0.5) * 2) / 2;
};
};
var _configElastic = function _configElastic2(type, amplitude, period) {
var p1 = amplitude >= 1 ? amplitude : 1, p2 = (period || (type ? 0.3 : 0.45)) / (amplitude < 1 ? amplitude : 1), p3 = p2 / _2PI * (Math.asin(1 / p1) || 0), easeOut = function easeOut2(p) {
return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1;
}, ease = type === "out" ? easeOut : type === "in" ? function(p) {
return 1 - easeOut(1 - p);
} : _easeInOutFromOut(easeOut);
p2 = _2PI / p2;
ease.config = function(amplitude2, period2) {
return _configElastic2(type, amplitude2, period2);
};
return ease;
};
var _configBack = function _configBack2(type, overshoot) {
if (overshoot === void 0) {
overshoot = 1.70158;
}
var easeOut = function easeOut2(p) {
return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0;
}, ease = type === "out" ? easeOut : type === "in" ? function(p) {
return 1 - easeOut(1 - p);
} : _easeInOutFromOut(easeOut);
ease.config = function(overshoot2) {
return _configBack2(type, overshoot2);
};
return ease;
};
_forEachName("Linear,Quad,Cubic,Quart,Quint,Strong", function(name, i3) {
var power = i3 < 5 ? i3 + 1 : i3;
_insertEase(name + ",Power" + (power - 1), i3 ? function(p) {
return Math.pow(p, power);
} : function(p) {
return p;
}, function(p) {
return 1 - Math.pow(1 - p, power);
}, function(p) {
return p < 0.5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2;
});
});
_easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn;
_insertEase("Elastic", _configElastic("in"), _configElastic("out"), _configElastic());
(function(n2, c) {
var n1 = 1 / c, n22 = 2 * n1, n3 = 2.5 * n1, easeOut = function easeOut2(p) {
return p < n1 ? n2 * p * p : p < n22 ? n2 * Math.pow(p - 1.5 / c, 2) + 0.75 : p < n3 ? n2 * (p -= 2.25 / c) * p + 0.9375 : n2 * Math.pow(p - 2.625 / c, 2) + 0.984375;
};
_insertEase("Bounce", function(p) {
return 1 - easeOut(1 - p);
}, easeOut);
})(7.5625, 2.75);
_insertEase("Expo", function(p) {
return p ? Math.pow(2, 10 * (p - 1)) : 0;
});
_insertEase("Circ", function(p) {
return -(_sqrt(1 - p * p) - 1);
});
_insertEase("Sine", function(p) {
return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1;
});
_insertEase("Back", _configBack("in"), _configBack("out"), _configBack());
_easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = {
config: function config(steps, immediateStart) {
if (steps === void 0) {
steps = 1;
}
var p1 = 1 / steps, p2 = steps + (immediateStart ? 0 : 1), p3 = immediateStart ? 1 : 0, max4 = 1 - _tinyNum;
return function(p) {
return ((p2 * _clamp(0, max4, p) | 0) + p3) * p1;
};
}
};
_defaults.ease = _easeMap["quad.out"];
_forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function(name) {
return _callbackNames += name + "," + name + "Params,";
});
var GSCache = function GSCache2(target, harness) {
this.id = _gsID++;
target._gsap = this;
this.target = target;
this.harness = harness;
this.get = harness ? harness.get : _getProperty;
this.set = harness ? harness.getSetter : _getSetter;
};
var Animation = /* @__PURE__ */ function() {
function Animation2(vars) {
this.vars = vars;
this._delay = +vars.delay || 0;
if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) {
this._rDelay = vars.repeatDelay || 0;
this._yoyo = !!vars.yoyo || !!vars.yoyoEase;
}
this._ts = 1;
_setDuration(this, +vars.duration, 1, 1);
this.data = vars.data;
if (_context) {
this._ctx = _context;
_context.data.push(this);
}
_tickerActive || _ticker.wake();
}
var _proto = Animation2.prototype;
_proto.delay = function delay(value) {
if (value || value === 0) {
this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);
this._delay = value;
return this;
}
return this._delay;
};
_proto.duration = function duration(value) {
return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur;
};
_proto.totalDuration = function totalDuration(value) {
if (!arguments.length) {
return this._tDur;
}
this._dirty = 0;
return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1));
};
_proto.totalTime = function totalTime(_totalTime, suppressEvents) {
_wake();
if (!arguments.length) {
return this._tTime;
}
var parent = this._dp;
if (parent && parent.smoothChildTiming && this._ts) {
_alignPlayhead(this, _totalTime);
!parent._dp || parent.parent || _postAddChecks(parent, this);
while (parent && parent.parent) {
if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) {
parent.totalTime(parent._tTime, true);
}
parent = parent.parent;
}
if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) {
_addToTimeline(this._dp, this, this._start - this._delay);
}
}
if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) {
this._ts || (this._pTime = _totalTime);
_lazySafeRender(this, _totalTime, suppressEvents);
}
return this;
};
_proto.time = function time(value, suppressEvents) {
return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time;
};
_proto.totalProgress = function totalProgress(value, suppressEvents) {
return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() > 0 ? 1 : 0;
};
_proto.progress = function progress(value, suppressEvents) {
return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0;
};
_proto.iteration = function iteration(value, suppressEvents) {
var cycleDuration = this.duration() + this._rDelay;
return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1;
};
_proto.timeScale = function timeScale(value, suppressEvents) {
if (!arguments.length) {
return this._rts === -_tinyNum ? 0 : this._rts;
}
if (this._rts === value) {
return this;
}
var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime;
this._rts = +value || 0;
this._ts = this._ps || value === -_tinyNum ? 0 : this._rts;
this.totalTime(_clamp(-Math.abs(this._delay), this._tDur, tTime), suppressEvents !== false);
_setEnd(this);
return _recacheAncestors(this);
};
_proto.paused = function paused(value) {
if (!arguments.length) {
return this._ps;
}
if (this._ps !== value) {
this._ps = value;
if (value) {
this._pTime = this._tTime || Math.max(-this._delay, this.rawTime());
this._ts = this._act = 0;
} else {
_wake();
this._ts = this._rts;
this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum));
}
}
return this;
};
_proto.startTime = function startTime(value) {
if (arguments.length) {
this._start = value;
var parent = this.parent || this._dp;
parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay);
return this;
}
return this._start;
};
_proto.endTime = function endTime(includeRepeats) {
return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1);
};
_proto.rawTime = function rawTime(wrapRepeats) {
var parent = this.parent || this._dp;
return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this);
};
_proto.revert = function revert(config3) {
if (config3 === void 0) {
config3 = _revertConfig;
}
var prevIsReverting = _reverting;
_reverting = config3;
if (this._initted || this._startAt) {
this.timeline && this.timeline.revert(config3);
this.totalTime(-0.01, config3.suppressEvents);
}
this.data !== "nested" && config3.kill !== false && this.kill();
_reverting = prevIsReverting;
return this;
};
_proto.globalTime = function globalTime(rawTime) {
var animation = this, time = arguments.length ? rawTime : animation.rawTime();
while (animation) {
time = animation._start + time / (Math.abs(animation._ts) || 1);
animation = animation._dp;
}
return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time;
};
_proto.repeat = function repeat(value) {
if (arguments.length) {
this._repeat = value === Infinity ? -2 : value;
return _onUpdateTotalDuration(this);
}
return this._repeat === -2 ? Infinity : this._repeat;
};
_proto.repeatDelay = function repeatDelay(value) {
if (arguments.length) {
var time = this._time;
this._rDelay = value;
_onUpdateTotalDuration(this);
return time ? this.time(time) : this;
}
return this._rDelay;
};
_proto.yoyo = function yoyo(value) {
if (arguments.length) {
this._yoyo = value;
return this;
}
return this._yoyo;
};
_proto.seek = function seek(position, suppressEvents) {
return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents));
};
_proto.restart = function restart(includeDelay, suppressEvents) {
return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));
};
_proto.play = function play(from, suppressEvents) {
from != null && this.seek(from, suppressEvents);
return this.reversed(false).paused(false);
};
_proto.reverse = function reverse(from, suppressEvents) {
from != null && this.seek(from || this.totalDuration(), suppressEvents);
return this.reversed(true).paused(false);
};
_proto.pause = function pause(atTime, suppressEvents) {
atTime != null && this.seek(atTime, suppressEvents);
return this.paused(true);
};
_proto.resume = function resume() {
return this.paused(false);
};
_proto.reversed = function reversed(value) {
if (arguments.length) {
!!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0));
return this;
}
return this._rts < 0;
};
_proto.invalidate = function invalidate() {
this._initted = this._act = 0;
this._zTime = -_tinyNum;
return this;
};
_proto.isActive = function isActive() {
var parent = this.parent || this._dp, start3 = this._start, rawTime;
return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start3 && rawTime < this.endTime(true) - _tinyNum);
};
_proto.eventCallback = function eventCallback(type, callback, params) {
var vars = this.vars;
if (arguments.length > 1) {
if (!callback) {
delete vars[type];
} else {
vars[type] = callback;
params && (vars[type + "Params"] = params);
type === "onUpdate" && (this._onUpdate = callback);
}
return this;
}
return vars[type];
};
_proto.then = function then(onFulfilled) {
var self2 = this;
return new Promise(function(resolve) {
var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough, _resolve = function _resolve2() {
var _then = self2.then;
self2.then = null;
_isFunction(f) && (f = f(self2)) && (f.then || f === self2) && (self2.then = _then);
resolve(f);
self2.then = _then;
};
if (self2._initted && self2.totalProgress() === 1 && self2._ts >= 0 || !self2._tTime && self2._ts < 0) {
_resolve();
} else {
self2._prom = _resolve;
}
});
};
_proto.kill = function kill() {
_interrupt(this);
};
return Animation2;
}();
_setDefaults(Animation.prototype, {
_time: 0,
_start: 0,
_end: 0,
_tTime: 0,
_tDur: 0,
_dirty: 0,
_repeat: 0,
_yoyo: false,
parent: null,
_initted: false,
_rDelay: 0,
_ts: 1,
_dp: 0,
ratio: 0,
_zTime: -_tinyNum,
_prom: 0,
_ps: false,
_rts: 1
});
var Timeline = /* @__PURE__ */ function(_Animation) {
_inheritsLoose(Timeline2, _Animation);
function Timeline2(vars, position) {
var _this;
if (vars === void 0) {
vars = {};
}
_this = _Animation.call(this, vars) || this;
_this.labels = {};
_this.smoothChildTiming = !!vars.smoothChildTiming;
_this.autoRemoveChildren = !!vars.autoRemoveChildren;
_this._sort = _isNotFalse(vars.sortChildren);
_globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized2(_this), position);
vars.reversed && _this.reverse();
vars.paused && _this.paused(true);
vars.scrollTrigger && _scrollTrigger(_assertThisInitialized2(_this), vars.scrollTrigger);
return _this;
}
var _proto2 = Timeline2.prototype;
_proto2.to = function to(targets, vars, position) {
_createTweenType(0, arguments, this);
return this;
};
_proto2.from = function from(targets, vars, position) {
_createTweenType(1, arguments, this);
return this;
};
_proto2.fromTo = function fromTo(targets, fromVars, toVars, position) {
_createTweenType(2, arguments, this);
return this;
};
_proto2.set = function set(targets, vars, position) {
vars.duration = 0;
vars.parent = this;
_inheritDefaults(vars).repeatDelay || (vars.repeat = 0);
vars.immediateRender = !!vars.immediateRender;
new Tween(targets, vars, _parsePosition(this, position), 1);
return this;
};
_proto2.call = function call(callback, params, position) {
return _addToTimeline(this, Tween.delayedCall(0, callback, params), position);
};
_proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {
vars.duration = duration;
vars.stagger = vars.stagger || stagger;
vars.onComplete = onCompleteAll;
vars.onCompleteParams = onCompleteAllParams;
vars.parent = this;
new Tween(targets, vars, _parsePosition(this, position));
return this;
};
_proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {
vars.runBackwards = 1;
_inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender);
return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams);
};
_proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) {
toVars.startAt = fromVars;
_inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender);
return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams);
};
_proto2.render = function render3(totalTime, suppressEvents, force) {
var prevTime = this._time, tDur = this._dirty ? this.totalDuration() : this._tDur, dur = this._dur, tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime), crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur), time, child2, next, iteration, cycleDuration, prevPaused, pauseTween, timeScale, prevStart, prevIteration, yoyo, isYoyo;
this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur);
if (tTime !== this._tTime || force || crossingStart) {
if (prevTime !== this._time && dur) {
tTime += this._time - prevTime;
totalTime += this._time - prevTime;
}
time = tTime;
prevStart = this._start;
timeScale = this._ts;
prevPaused = !timeScale;
if (crossingStart) {
dur || (prevTime = this._zTime);
(totalTime || !suppressEvents) && (this._zTime = totalTime);
}
if (this._repeat) {
yoyo = this._yoyo;
cycleDuration = dur + this._rDelay;
if (this._repeat < -1 && totalTime < 0) {
return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);
}
time = _roundPrecise(tTime % cycleDuration);
if (tTime === tDur) {
iteration = this._repeat;
time = dur;
} else {
iteration = ~~(tTime / cycleDuration);
if (iteration && iteration === tTime / cycleDuration) {
time = dur;
iteration--;
}
time > dur && (time = dur);
}
prevIteration = _animationCycle(this._tTime, cycleDuration);
!prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration);
if (yoyo && iteration & 1) {
time = dur - time;
isYoyo = 1;
}
if (iteration !== prevIteration && !this._lock) {
var rewinding = yoyo && prevIteration & 1, doesWrap = rewinding === (yoyo && iteration & 1);
iteration < prevIteration && (rewinding = !rewinding);
prevTime = rewinding ? 0 : tTime % dur ? dur : tTime;
this._lock = 1;
this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0;
this._tTime = tTime;
!suppressEvents && this.parent && _callback(this, "onRepeat");
this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1);
if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) {
return this;
}
dur = this._dur;
tDur = this._tDur;
if (doesWrap) {
this._lock = 2;
prevTime = rewinding ? dur : -1e-4;
this.render(prevTime, true);
this.vars.repeatRefresh && !isYoyo && this.invalidate();
}
this._lock = 0;
if (!this._ts && !prevPaused) {
return this;
}
_propagateYoyoEase(this, isYoyo);
}
}
if (this._hasPause && !this._forcing && this._lock < 2) {
pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time));
if (pauseTween) {
tTime -= time - (time = pauseTween._start);
}
}
this._tTime = tTime;
this._time = time;
this._act = !timeScale;
if (!this._initted) {
this._onUpdate = this.vars.onUpdate;
this._initted = 1;
this._zTime = totalTime;
prevTime = 0;
}
if (!prevTime && time && !suppressEvents && !iteration) {
_callback(this, "onStart");
if (this._tTime !== tTime) {
return this;
}
}
if (time >= prevTime && totalTime >= 0) {
child2 = this._first;
while (child2) {
next = child2._next;
if ((child2._act || time >= child2._start) && child2._ts && pauseTween !== child2) {
if (child2.parent !== this) {
return this.render(totalTime, suppressEvents, force);
}
child2.render(child2._ts > 0 ? (time - child2._start) * child2._ts : (child2._dirty ? child2.totalDuration() : child2._tDur) + (time - child2._start) * child2._ts, suppressEvents, force);
if (time !== this._time || !this._ts && !prevPaused) {
pauseTween = 0;
next && (tTime += this._zTime = -_tinyNum);
break;
}
}
child2 = next;
}
} else {
child2 = this._last;
var adjustedTime = totalTime < 0 ? totalTime : time;
while (child2) {
next = child2._prev;
if ((child2._act || adjustedTime <= child2._end) && child2._ts && pauseTween !== child2) {
if (child2.parent !== this) {
return this.render(totalTime, suppressEvents, force);
}
child2.render(child2._ts > 0 ? (adjustedTime - child2._start) * child2._ts : (child2._dirty ? child2.totalDuration() : child2._tDur) + (adjustedTime - child2._start) * child2._ts, suppressEvents, force || _reverting && (child2._initted || child2._startAt));
if (time !== this._time || !this._ts && !prevPaused) {
pauseTween = 0;
next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum);
break;
}
}
child2 = next;
}
}
if (pauseTween && !suppressEvents) {
this.pause();
pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1;
if (this._ts) {
this._start = prevStart;
_setEnd(this);
return this.render(totalTime, suppressEvents, force);
}
}
this._onUpdate && !suppressEvents && _callback(this, "onUpdate", true);
if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) {
if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) {
if (!this._lock) {
(totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1);
if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) {
_callback(this, tTime === tDur && totalTime >= 0 ? "onComplete" : "onReverseComplete", true);
this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();
}
}
}
}
}
return this;
};
_proto2.add = function add(child2, position) {
var _this2 = this;
_isNumber(position) || (position = _parsePosition(this, position, child2));
if (!(child2 instanceof Animation)) {
if (_isArray(child2)) {
child2.forEach(function(obj) {
return _this2.add(obj, position);
});
return this;
}
if (_isString(child2)) {
return this.addLabel(child2, position);
}
if (_isFunction(child2)) {
child2 = Tween.delayedCall(0, child2);
} else {
return this;
}
}
return this !== child2 ? _addToTimeline(this, child2, position) : this;
};
_proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) {
if (nested === void 0) {
nested = true;
}
if (tweens === void 0) {
tweens = true;
}
if (timelines === void 0) {
timelines = true;
}
if (ignoreBeforeTime === void 0) {
ignoreBeforeTime = -_bigNum;
}
var a = [], child2 = this._first;
while (child2) {
if (child2._start >= ignoreBeforeTime) {
if (child2 instanceof Tween) {
tweens && a.push(child2);
} else {
timelines && a.push(child2);
nested && a.push.apply(a, child2.getChildren(true, tweens, timelines));
}
}
child2 = child2._next;
}
return a;
};
_proto2.getById = function getById2(id) {
var animations = this.getChildren(1, 1, 1), i3 = animations.length;
while (i3--) {
if (animations[i3].vars.id === id) {
return animations[i3];
}
}
};
_proto2.remove = function remove2(child2) {
if (_isString(child2)) {
return this.removeLabel(child2);
}
if (_isFunction(child2)) {
return this.killTweensOf(child2);
}
_removeLinkedListItem(this, child2);
if (child2 === this._recent) {
this._recent = this._last;
}
return _uncache(this);
};
_proto2.totalTime = function totalTime(_totalTime2, suppressEvents) {
if (!arguments.length) {
return this._tTime;
}
this._forcing = 1;
if (!this._dp && this._ts) {
this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts));
}
_Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents);
this._forcing = 0;
return this;
};
_proto2.addLabel = function addLabel(label, position) {
this.labels[label] = _parsePosition(this, position);
return this;
};
_proto2.removeLabel = function removeLabel(label) {
delete this.labels[label];
return this;
};
_proto2.addPause = function addPause(position, callback, params) {
var t3 = Tween.delayedCall(0, callback || _emptyFunc, params);
t3.data = "isPause";
this._hasPause = 1;
return _addToTimeline(this, t3, _parsePosition(this, position));
};
_proto2.removePause = function removePause(position) {
var child2 = this._first;
position = _parsePosition(this, position);
while (child2) {
if (child2._start === position && child2.data === "isPause") {
_removeFromParent(child2);
}
child2 = child2._next;
}
};
_proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) {
var tweens = this.getTweensOf(targets, onlyActive), i3 = tweens.length;
while (i3--) {
_overwritingTween !== tweens[i3] && tweens[i3].kill(targets, props);
}
return this;
};
_proto2.getTweensOf = function getTweensOf2(targets, onlyActive) {
var a = [], parsedTargets = toArray(targets), child2 = this._first, isGlobalTime = _isNumber(onlyActive), children2;
while (child2) {
if (child2 instanceof Tween) {
if (_arrayContainsAny(child2._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child2._initted && child2._ts) && child2.globalTime(0) <= onlyActive && child2.globalTime(child2.totalDuration()) > onlyActive : !onlyActive || child2.isActive())) {
a.push(child2);
}
} else if ((children2 = child2.getTweensOf(parsedTargets, onlyActive)).length) {
a.push.apply(a, children2);
}
child2 = child2._next;
}
return a;
};
_proto2.tweenTo = function tweenTo(position, vars) {
vars = vars || {};
var tl = this, endTime = _parsePosition(tl, position), _vars = vars, startAt = _vars.startAt, _onStart = _vars.onStart, onStartParams = _vars.onStartParams, immediateRender = _vars.immediateRender, initted, tween = Tween.to(tl, _setDefaults({
ease: vars.ease || "none",
lazy: false,
immediateRender: false,
time: endTime,
overwrite: "auto",
duration: vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum,
onStart: function onStart() {
tl.pause();
if (!initted) {
var duration = vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale());
tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true);
initted = 1;
}
_onStart && _onStart.apply(tween, onStartParams || []);
}
}, vars));
return immediateRender ? tween.render(0) : tween;
};
_proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) {
return this.tweenTo(toPosition, _setDefaults({
startAt: {
time: _parsePosition(this, fromPosition)
}
}, vars));
};
_proto2.recent = function recent() {
return this._recent;
};
_proto2.nextLabel = function nextLabel(afterTime) {
if (afterTime === void 0) {
afterTime = this._time;
}
return _getLabelInDirection(this, _parsePosition(this, afterTime));
};
_proto2.previousLabel = function previousLabel(beforeTime) {
if (beforeTime === void 0) {
beforeTime = this._time;
}
return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1);
};
_proto2.currentLabel = function currentLabel(value) {
return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum);
};
_proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) {
if (ignoreBeforeTime === void 0) {
ignoreBeforeTime = 0;
}
var child2 = this._first, labels = this.labels, p;
while (child2) {
if (child2._start >= ignoreBeforeTime) {
child2._start += amount;
child2._end += amount;
}
child2 = child2._next;
}
if (adjustLabels) {
for (p in labels) {
if (labels[p] >= ignoreBeforeTime) {
labels[p] += amount;
}
}
}
return _uncache(this);
};
_proto2.invalidate = function invalidate(soft) {
var child2 = this._first;
this._lock = 0;
while (child2) {
child2.invalidate(soft);
child2 = child2._next;
}
return _Animation.prototype.invalidate.call(this, soft);
};
_proto2.clear = function clear(includeLabels) {
if (includeLabels === void 0) {
includeLabels = true;
}
var child2 = this._first, next;
while (child2) {
next = child2._next;
this.remove(child2);
child2 = next;
}
this._dp && (this._time = this._tTime = this._pTime = 0);
includeLabels && (this.labels = {});
return _uncache(this);
};
_proto2.totalDuration = function totalDuration(value) {
var max4 = 0, self2 = this, child2 = self2._last, prevStart = _bigNum, prev, start3, parent;
if (arguments.length) {
return self2.timeScale((self2._repeat < 0 ? self2.duration() : self2.totalDuration()) / (self2.reversed() ? -value : value));
}
if (self2._dirty) {
parent = self2.parent;
while (child2) {
prev = child2._prev;
child2._dirty && child2.totalDuration();
start3 = child2._start;
if (start3 > prevStart && self2._sort && child2._ts && !self2._lock) {
self2._lock = 1;
_addToTimeline(self2, child2, start3 - child2._delay, 1)._lock = 0;
} else {
prevStart = start3;
}
if (start3 < 0 && child2._ts) {
max4 -= start3;
if (!parent && !self2._dp || parent && parent.smoothChildTiming) {
self2._start += start3 / self2._ts;
self2._time -= start3;
self2._tTime -= start3;
}
self2.shiftChildren(-start3, false, -Infinity);
prevStart = 0;
}
child2._end > max4 && child2._ts && (max4 = child2._end);
child2 = prev;
}
_setDuration(self2, self2 === _globalTimeline && self2._time > max4 ? self2._time : max4, 1, 1);
self2._dirty = 0;
}
return self2._tDur;
};
Timeline2.updateRoot = function updateRoot(time) {
if (_globalTimeline._ts) {
_lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline));
_lastRenderedFrame = _ticker.frame;
}
if (_ticker.frame >= _nextGCFrame) {
_nextGCFrame += _config.autoSleep || 120;
var child2 = _globalTimeline._first;
if (!child2 || !child2._ts) {
if (_config.autoSleep && _ticker._listeners.length < 2) {
while (child2 && !child2._ts) {
child2 = child2._next;
}
child2 || _ticker.sleep();
}
}
}
};
return Timeline2;
}(Animation);
_setDefaults(Timeline.prototype, {
_lock: 0,
_hasPause: 0,
_forcing: 0
});
var _addComplexStringPropTween = function _addComplexStringPropTween2(target, prop, start3, end2, setter, stringFilter, funcParam) {
var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter), index = 0, matchIndex = 0, result, startNums, color, endNum, chunk, startNum, hasRandom, a;
pt.b = start3;
pt.e = end2;
start3 += "";
end2 += "";
if (hasRandom = ~end2.indexOf("random(")) {
end2 = _replaceRandom(end2);
}
if (stringFilter) {
a = [start3, end2];
stringFilter(a, target, prop);
start3 = a[0];
end2 = a[1];
}
startNums = start3.match(_complexStringNumExp) || [];
while (result = _complexStringNumExp.exec(end2)) {
endNum = result[0];
chunk = end2.substring(index, result.index);
if (color) {
color = (color + 1) % 5;
} else if (chunk.substr(-5) === "rgba(") {
color = 1;
}
if (endNum !== startNums[matchIndex++]) {
startNum = parseFloat(startNums[matchIndex - 1]) || 0;
pt._pt = {
_next: pt._pt,
p: chunk || matchIndex === 1 ? chunk : ",",
//note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
s: startNum,
c: endNum.charAt(1) === "=" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum,
m: color && color < 4 ? Math.round : 0
};
index = _complexStringNumExp.lastIndex;
}
}
pt.c = index < end2.length ? end2.substring(index, end2.length) : "";
pt.fp = funcParam;
if (_relExp.test(end2) || hasRandom) {
pt.e = 0;
}
this._pt = pt;
return pt;
};
var _addPropTween = function _addPropTween2(target, prop, start3, end2, index, targets, modifier, stringFilter, funcParam, optional) {
_isFunction(end2) && (end2 = end2(index || 0, target, targets));
var currentValue = target[prop], parsedStart = start3 !== "get" ? start3 : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf("set") || !_isFunction(target["get" + prop.substr(3)]) ? prop : "get" + prop.substr(3)](funcParam) : target[prop](), setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc, pt;
if (_isString(end2)) {
if (~end2.indexOf("random(")) {
end2 = _replaceRandom(end2);
}
if (end2.charAt(1) === "=") {
pt = _parseRelative(parsedStart, end2) + (getUnit(parsedStart) || 0);
if (pt || pt === 0) {
end2 = pt;
}
}
}
if (!optional || parsedStart !== end2 || _forceAllPropTweens) {
if (!isNaN(parsedStart * end2) && end2 !== "") {
pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end2 - (parsedStart || 0), typeof currentValue === "boolean" ? _renderBoolean : _renderPlain, 0, setter);
funcParam && (pt.fp = funcParam);
modifier && pt.modifier(modifier, this, target);
return this._pt = pt;
}
!currentValue && !(prop in target) && _missingPlugin(prop, end2);
return _addComplexStringPropTween.call(this, target, prop, parsedStart, end2, setter, stringFilter || _config.stringFilter, funcParam);
}
};
var _processVars = function _processVars2(vars, index, target, targets, tween) {
_isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets));
if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) {
return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars;
}
var copy = {}, p;
for (p in vars) {
copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets);
}
return copy;
};
var _checkPlugin = function _checkPlugin2(property, vars, tween, index, target, targets) {
var plugin, pt, ptLookup, i3;
if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) {
tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority);
if (tween !== _quickTween) {
ptLookup = tween._ptLookup[tween._targets.indexOf(target)];
i3 = plugin._props.length;
while (i3--) {
ptLookup[plugin._props[i3]] = pt;
}
}
}
return plugin;
};
var _overwritingTween;
var _forceAllPropTweens;
var _initTween = function _initTween2(tween, time, tTime) {
var vars = tween.vars, ease = vars.ease, startAt = vars.startAt, immediateRender = vars.immediateRender, lazy = vars.lazy, onUpdate = vars.onUpdate, runBackwards = vars.runBackwards, yoyoEase = vars.yoyoEase, keyframes = vars.keyframes, autoRevert = vars.autoRevert, dur = tween._dur, prevStartAt = tween._startAt, targets = tween._targets, parent = tween.parent, fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites, tl = tween.timeline, cleanVars, i3, p, pt, target, hasPriority, gsData, harness, plugin, ptLookup, index, harnessVars, overwritten;
tl && (!keyframes || !ease) && (ease = "none");
tween._ease = _parseEase(ease, _defaults.ease);
tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0;
if (yoyoEase && tween._yoyo && !tween._repeat) {
yoyoEase = tween._yEase;
tween._yEase = tween._ease;
tween._ease = yoyoEase;
}
tween._from = !tl && !!vars.runBackwards;
if (!tl || keyframes && !vars.stagger) {
harness = targets[0] ? _getCache(targets[0]).harness : 0;
harnessVars = harness && vars[harness.prop];
cleanVars = _copyExcluding(vars, _reservedProps);
if (prevStartAt) {
prevStartAt._zTime < 0 && prevStartAt.progress(1);
time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig);
prevStartAt._lazy = 0;
}
if (startAt) {
_removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({
data: "isStart",
overwrite: false,
parent,
immediateRender: true,
lazy: !prevStartAt && _isNotFalse(lazy),
startAt: null,
delay: 0,
onUpdate: onUpdate && function() {
return _callback(tween, "onUpdate");
},
stagger: 0
}, startAt)));
tween._startAt._dp = 0;
tween._startAt._sat = tween;
time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill);
if (immediateRender) {
if (dur && time <= 0 && tTime <= 0) {
time && (tween._zTime = time);
return;
}
}
} else if (runBackwards && dur) {
if (!prevStartAt) {
time && (immediateRender = false);
p = _setDefaults({
overwrite: false,
data: "isFromStart",
//we tag the tween with as "isFromStart" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a "from()" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.
lazy: immediateRender && !prevStartAt && _isNotFalse(lazy),
immediateRender,
//zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)
stagger: 0,
parent
//ensures that nested tweens that had a stagger are handled properly, like gsap.from(".class", {y: gsap.utils.wrap([-100,100]), stagger: 0.5})
}, cleanVars);
harnessVars && (p[harness.prop] = harnessVars);
_removeFromParent(tween._startAt = Tween.set(targets, p));
tween._startAt._dp = 0;
tween._startAt._sat = tween;
time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true));
tween._zTime = time;
if (!immediateRender) {
_initTween2(tween._startAt, _tinyNum, _tinyNum);
} else if (!time) {
return;
}
}
}
tween._pt = tween._ptCache = 0;
lazy = dur && _isNotFalse(lazy) || lazy && !dur;
for (i3 = 0; i3 < targets.length; i3++) {
target = targets[i3];
gsData = target._gsap || _harness(targets)[i3]._gsap;
tween._ptLookup[i3] = ptLookup = {};
_lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender();
index = fullTargets === targets ? i3 : fullTargets.indexOf(target);
if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) {
tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority);
plugin._props.forEach(function(name) {
ptLookup[name] = pt;
});
plugin.priority && (hasPriority = 1);
}
if (!harness || harnessVars) {
for (p in cleanVars) {
if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) {
plugin.priority && (hasPriority = 1);
} else {
ptLookup[p] = pt = _addPropTween.call(tween, target, p, "get", cleanVars[p], index, fullTargets, 0, vars.stringFilter);
}
}
}
tween._op && tween._op[i3] && tween.kill(target, tween._op[i3]);
if (autoOverwrite && tween._pt) {
_overwritingTween = tween;
_globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time));
overwritten = !tween.parent;
_overwritingTween = 0;
}
tween._pt && lazy && (_lazyLookup[gsData.id] = 1);
}
hasPriority && _sortPropTweensByPriority(tween);
tween._onInit && tween._onInit(tween);
}
tween._onUpdate = onUpdate;
tween._initted = (!tween._op || tween._pt) && !overwritten;
keyframes && time <= 0 && tl.render(_bigNum, true, true);
};
var _updatePropTweens = function _updatePropTweens2(tween, property, value, start3, startIsRelative, ratio, time, skipRecursion) {
var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property], pt, rootPT, lookup, i3;
if (!ptCache) {
ptCache = tween._ptCache[property] = [];
lookup = tween._ptLookup;
i3 = tween._targets.length;
while (i3--) {
pt = lookup[i3][property];
if (pt && pt.d && pt.d._pt) {
pt = pt.d._pt;
while (pt && pt.p !== property && pt.fp !== property) {
pt = pt._next;
}
}
if (!pt) {
_forceAllPropTweens = 1;
tween.vars[property] = "+=0";
_initTween(tween, time);
_forceAllPropTweens = 0;
return skipRecursion ? _warn(property + " not eligible for reset") : 1;
}
ptCache.push(pt);
}
}
i3 = ptCache.length;
while (i3--) {
rootPT = ptCache[i3];
pt = rootPT._pt || rootPT;
pt.s = (start3 || start3 === 0) && !startIsRelative ? start3 : pt.s + (start3 || 0) + ratio * pt.c;
pt.c = value - pt.s;
rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e));
rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b));
}
};
var _addAliasesToVars = function _addAliasesToVars2(targets, vars) {
var harness = targets[0] ? _getCache(targets[0]).harness : 0, propertyAliases = harness && harness.aliases, copy, p, i3, aliases;
if (!propertyAliases) {
return vars;
}
copy = _merge({}, vars);
for (p in propertyAliases) {
if (p in copy) {
aliases = propertyAliases[p].split(",");
i3 = aliases.length;
while (i3--) {
copy[aliases[i3]] = copy[p];
}
}
}
return copy;
};
var _parseKeyframe = function _parseKeyframe2(prop, obj, allProps, easeEach) {
var ease = obj.ease || easeEach || "power1.inOut", p, a;
if (_isArray(obj)) {
a = allProps[prop] || (allProps[prop] = []);
obj.forEach(function(value, i3) {
return a.push({
t: i3 / (obj.length - 1) * 100,
v: value,
e: ease
});
});
} else {
for (p in obj) {
a = allProps[p] || (allProps[p] = []);
p === "ease" || a.push({
t: parseFloat(prop),
v: obj[p],
e: ease
});
}
}
};
var _parseFuncOrString = function _parseFuncOrString2(value, tween, i3, target, targets) {
return _isFunction(value) ? value.call(tween, i3, target, targets) : _isString(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value;
};
var _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert";
var _staggerPropsToSkip = {};
_forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function(name) {
return _staggerPropsToSkip[name] = 1;
});
var Tween = /* @__PURE__ */ function(_Animation2) {
_inheritsLoose(Tween2, _Animation2);
function Tween2(targets, vars, position, skipInherit) {
var _this3;
if (typeof vars === "number") {
position.duration = vars;
vars = position;
position = null;
}
_this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this;
var _this3$vars = _this3.vars, duration = _this3$vars.duration, delay = _this3$vars.delay, immediateRender = _this3$vars.immediateRender, stagger = _this3$vars.stagger, overwrite = _this3$vars.overwrite, keyframes = _this3$vars.keyframes, defaults2 = _this3$vars.defaults, scrollTrigger = _this3$vars.scrollTrigger, yoyoEase = _this3$vars.yoyoEase, parent = vars.parent || _globalTimeline, parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : "length" in vars) ? [targets] : toArray(targets), tl, i3, copy, l, p, curTarget, staggerFunc, staggerVarsToMerge;
_this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://gsap.com", !_config.nullTargetWarn) || [];
_this3._ptLookup = [];
_this3._overwrite = overwrite;
if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {
vars = _this3.vars;
tl = _this3.timeline = new Timeline({
data: "nested",
defaults: defaults2 || {},
targets: parent && parent.data === "nested" ? parent.vars.targets : parsedTargets
});
tl.kill();
tl.parent = tl._dp = _assertThisInitialized2(_this3);
tl._start = 0;
if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {
l = parsedTargets.length;
staggerFunc = stagger && distribute(stagger);
if (_isObject(stagger)) {
for (p in stagger) {
if (~_staggerTweenProps.indexOf(p)) {
staggerVarsToMerge || (staggerVarsToMerge = {});
staggerVarsToMerge[p] = stagger[p];
}
}
}
for (i3 = 0; i3 < l; i3++) {
copy = _copyExcluding(vars, _staggerPropsToSkip);
copy.stagger = 0;
yoyoEase && (copy.yoyoEase = yoyoEase);
staggerVarsToMerge && _merge(copy, staggerVarsToMerge);
curTarget = parsedTargets[i3];
copy.duration = +_parseFuncOrString(duration, _assertThisInitialized2(_this3), i3, curTarget, parsedTargets);
copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized2(_this3), i3, curTarget, parsedTargets) || 0) - _this3._delay;
if (!stagger && l === 1 && copy.delay) {
_this3._delay = delay = copy.delay;
_this3._start += delay;
copy.delay = 0;
}
tl.to(curTarget, copy, staggerFunc ? staggerFunc(i3, curTarget, parsedTargets) : 0);
tl._ease = _easeMap.none;
}
tl.duration() ? duration = delay = 0 : _this3.timeline = 0;
} else if (keyframes) {
_inheritDefaults(_setDefaults(tl.vars.defaults, {
ease: "none"
}));
tl._ease = _parseEase(keyframes.ease || vars.ease || "none");
var time = 0, a, kf, v;
if (_isArray(keyframes)) {
keyframes.forEach(function(frame) {
return tl.to(parsedTargets, frame, ">");
});
tl.duration();
} else {
copy = {};
for (p in keyframes) {
p === "ease" || p === "easeEach" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach);
}
for (p in copy) {
a = copy[p].sort(function(a2, b) {
return a2.t - b.t;
});
time = 0;
for (i3 = 0; i3 < a.length; i3++) {
kf = a[i3];
v = {
ease: kf.e,
duration: (kf.t - (i3 ? a[i3 - 1].t : 0)) / 100 * duration
};
v[p] = kf.v;
tl.to(parsedTargets, v, time);
time += v.duration;
}
}
tl.duration() < duration && tl.to({}, {
duration: duration - tl.duration()
});
}
}
duration || _this3.duration(duration = tl.duration());
} else {
_this3.timeline = 0;
}
if (overwrite === true && !_suppressOverwrites) {
_overwritingTween = _assertThisInitialized2(_this3);
_globalTimeline.killTweensOf(parsedTargets);
_overwritingTween = 0;
}
_addToTimeline(parent, _assertThisInitialized2(_this3), position);
vars.reversed && _this3.reverse();
vars.paused && _this3.paused(true);
if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized2(_this3)) && parent.data !== "nested") {
_this3._tTime = -_tinyNum;
_this3.render(Math.max(0, -delay) || 0);
}
scrollTrigger && _scrollTrigger(_assertThisInitialized2(_this3), scrollTrigger);
return _this3;
}
var _proto3 = Tween2.prototype;
_proto3.render = function render3(totalTime, suppressEvents, force) {
var prevTime = this._time, tDur = this._tDur, dur = this._dur, isNegative = totalTime < 0, tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, time, pt, iteration, cycleDuration, prevIteration, isYoyo, ratio, timeline2, yoyoEase;
if (!dur) {
_renderZeroDurationTween(this, totalTime, suppressEvents, force);
} else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) {
time = tTime;
timeline2 = this.timeline;
if (this._repeat) {
cycleDuration = dur + this._rDelay;
if (this._repeat < -1 && isNegative) {
return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);
}
time = _roundPrecise(tTime % cycleDuration);
if (tTime === tDur) {
iteration = this._repeat;
time = dur;
} else {
iteration = ~~(tTime / cycleDuration);
if (iteration && iteration === _roundPrecise(tTime / cycleDuration)) {
time = dur;
iteration--;
}
time > dur && (time = dur);
}
isYoyo = this._yoyo && iteration & 1;
if (isYoyo) {
yoyoEase = this._yEase;
time = dur - time;
}
prevIteration = _animationCycle(this._tTime, cycleDuration);
if (time === prevTime && !force && this._initted && iteration === prevIteration) {
this._tTime = tTime;
return this;
}
if (iteration !== prevIteration) {
timeline2 && this._yEase && _propagateYoyoEase(timeline2, isYoyo);
if (this.vars.repeatRefresh && !isYoyo && !this._lock && this._time !== cycleDuration && this._initted) {
this._lock = force = 1;
this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;
}
}
}
if (!this._initted) {
if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) {
this._tTime = 0;
return this;
}
if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) {
return this;
}
if (dur !== this._dur) {
return this.render(totalTime, suppressEvents, force);
}
}
this._tTime = tTime;
this._time = time;
if (!this._act && this._ts) {
this._act = 1;
this._lazy = 0;
}
this.ratio = ratio = (yoyoEase || this._ease)(time / dur);
if (this._from) {
this.ratio = ratio = 1 - ratio;
}
if (time && !prevTime && !suppressEvents && !iteration) {
_callback(this, "onStart");
if (this._tTime !== tTime) {
return this;
}
}
pt = this._pt;
while (pt) {
pt.r(ratio, pt.d);
pt = pt._next;
}
timeline2 && timeline2.render(totalTime < 0 ? totalTime : timeline2._dur * timeline2._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime);
if (this._onUpdate && !suppressEvents) {
isNegative && _rewindStartAt(this, totalTime, suppressEvents, force);
_callback(this, "onUpdate");
}
this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, "onRepeat");
if ((tTime === this._tDur || !tTime) && this._tTime === tTime) {
isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true);
(totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1);
if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) {
_callback(this, tTime === tDur ? "onComplete" : "onReverseComplete", true);
this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();
}
}
}
return this;
};
_proto3.targets = function targets() {
return this._targets;
};
_proto3.invalidate = function invalidate(soft) {
(!soft || !this.vars.runBackwards) && (this._startAt = 0);
this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0;
this._ptLookup = [];
this.timeline && this.timeline.invalidate(soft);
return _Animation2.prototype.invalidate.call(this, soft);
};
_proto3.resetTo = function resetTo(property, value, start3, startIsRelative, skipRecursion) {
_tickerActive || _ticker.wake();
this._ts || this.play();
var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts), ratio;
this._initted || _initTween(this, time);
ratio = this._ease(time / this._dur);
if (_updatePropTweens(this, property, value, start3, startIsRelative, ratio, time, skipRecursion)) {
return this.resetTo(property, value, start3, startIsRelative, 1);
}
_alignPlayhead(this, 0);
this.parent || _addLinkedListItem(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0);
return this.render(0);
};
_proto3.kill = function kill(targets, vars) {
if (vars === void 0) {
vars = "all";
}
if (!targets && (!vars || vars === "all")) {
this._lazy = this._pt = 0;
return this.parent ? _interrupt(this) : this;
}
if (this.timeline) {
var tDur = this.timeline.totalDuration();
this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this);
this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1);
return this;
}
var parsedTargets = this._targets, killingTargets = targets ? toArray(targets) : parsedTargets, propTweenLookup = this._ptLookup, firstPT = this._pt, overwrittenProps, curLookup, curOverwriteProps, props, p, pt, i3;
if ((!vars || vars === "all") && _arraysMatch(parsedTargets, killingTargets)) {
vars === "all" && (this._pt = 0);
return _interrupt(this);
}
overwrittenProps = this._op = this._op || [];
if (vars !== "all") {
if (_isString(vars)) {
p = {};
_forEachName(vars, function(name) {
return p[name] = 1;
});
vars = p;
}
vars = _addAliasesToVars(parsedTargets, vars);
}
i3 = parsedTargets.length;
while (i3--) {
if (~killingTargets.indexOf(parsedTargets[i3])) {
curLookup = propTweenLookup[i3];
if (vars === "all") {
overwrittenProps[i3] = vars;
props = curLookup;
curOverwriteProps = {};
} else {
curOverwriteProps = overwrittenProps[i3] = overwrittenProps[i3] || {};
props = vars;
}
for (p in props) {
pt = curLookup && curLookup[p];
if (pt) {
if (!("kill" in pt.d) || pt.d.kill(p) === true) {
_removeLinkedListItem(this, pt, "_pt");
}
delete curLookup[p];
}
if (curOverwriteProps !== "all") {
curOverwriteProps[p] = 1;
}
}
}
}
this._initted && !this._pt && firstPT && _interrupt(this);
return this;
};
Tween2.to = function to(targets, vars) {
return new Tween2(targets, vars, arguments[2]);
};
Tween2.from = function from(targets, vars) {
return _createTweenType(1, arguments);
};
Tween2.delayedCall = function delayedCall(delay, callback, params, scope) {
return new Tween2(callback, 0, {
immediateRender: false,
lazy: false,
overwrite: false,
delay,
onComplete: callback,
onReverseComplete: callback,
onCompleteParams: params,
onReverseCompleteParams: params,
callbackScope: scope
});
};
Tween2.fromTo = function fromTo(targets, fromVars, toVars) {
return _createTweenType(2, arguments);
};
Tween2.set = function set(targets, vars) {
vars.duration = 0;
vars.repeatDelay || (vars.repeat = 0);
return new Tween2(targets, vars);
};
Tween2.killTweensOf = function killTweensOf(targets, props, onlyActive) {
return _globalTimeline.killTweensOf(targets, props, onlyActive);
};
return Tween2;
}(Animation);
_setDefaults(Tween.prototype, {
_targets: [],
_lazy: 0,
_startAt: 0,
_op: 0,
_onInit: 0
});
_forEachName("staggerTo,staggerFrom,staggerFromTo", function(name) {
Tween[name] = function() {
var tl = new Timeline(), params = _slice.call(arguments, 0);
params.splice(name === "staggerFromTo" ? 5 : 4, 0, 0);
return tl[name].apply(tl, params);
};
});
var _setterPlain = function _setterPlain2(target, property, value) {
return target[property] = value;
};
var _setterFunc = function _setterFunc2(target, property, value) {
return target[property](value);
};
var _setterFuncWithParam = function _setterFuncWithParam2(target, property, value, data) {
return target[property](data.fp, value);
};
var _setterAttribute = function _setterAttribute2(target, property, value) {
return target.setAttribute(property, value);
};
var _getSetter = function _getSetter2(target, property) {
return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain;
};
var _renderPlain = function _renderPlain2(ratio, data) {
return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e6) / 1e6, data);
};
var _renderBoolean = function _renderBoolean2(ratio, data) {
return data.set(data.t, data.p, !!(data.s + data.c * ratio), data);
};
var _renderComplexString = function _renderComplexString2(ratio, data) {
var pt = data._pt, s2 = "";
if (!ratio && data.b) {
s2 = data.b;
} else if (ratio === 1 && data.e) {
s2 = data.e;
} else {
while (pt) {
s2 = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 1e4) / 1e4) + s2;
pt = pt._next;
}
s2 += data.c;
}
data.set(data.t, data.p, s2, data);
};
var _renderPropTweens = function _renderPropTweens2(ratio, data) {
var pt = data._pt;
while (pt) {
pt.r(ratio, pt.d);
pt = pt._next;
}
};
var _addPluginModifier = function _addPluginModifier2(modifier, tween, target, property) {
var pt = this._pt, next;
while (pt) {
next = pt._next;
pt.p === property && pt.modifier(modifier, tween, target);
pt = next;
}
};
var _killPropTweensOf = function _killPropTweensOf2(property) {
var pt = this._pt, hasNonDependentRemaining, next;
while (pt) {
next = pt._next;
if (pt.p === property && !pt.op || pt.op === property) {
_removeLinkedListItem(this, pt, "_pt");
} else if (!pt.dep) {
hasNonDependentRemaining = 1;
}
pt = next;
}
return !hasNonDependentRemaining;
};
var _setterWithModifier = function _setterWithModifier2(target, property, value, data) {
data.mSet(target, property, data.m.call(data.tween, value, data.mt), data);
};
var _sortPropTweensByPriority = function _sortPropTweensByPriority2(parent) {
var pt = parent._pt, next, pt2, first, last;
while (pt) {
next = pt._next;
pt2 = first;
while (pt2 && pt2.pr > pt.pr) {
pt2 = pt2._next;
}
if (pt._prev = pt2 ? pt2._prev : last) {
pt._prev._next = pt;
} else {
first = pt;
}
if (pt._next = pt2) {
pt2._prev = pt;
} else {
last = pt;
}
pt = next;
}
parent._pt = first;
};
var PropTween = /* @__PURE__ */ function() {
function PropTween2(next, target, prop, start3, change, renderer, data, setter, priority) {
this.t = target;
this.s = start3;
this.c = change;
this.p = prop;
this.r = renderer || _renderPlain;
this.d = data || this;
this.set = setter || _setterPlain;
this.pr = priority || 0;
this._next = next;
if (next) {
next._prev = this;
}
}
var _proto4 = PropTween2.prototype;
_proto4.modifier = function modifier(func, tween, target) {
this.mSet = this.mSet || this.set;
this.set = _setterWithModifier;
this.m = func;
this.mt = target;
this.tween = tween;
};
return PropTween2;
}();
_forEachName(_callbackNames + "parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger", function(name) {
return _reservedProps[name] = 1;
});
_globals.TweenMax = _globals.TweenLite = Tween;
_globals.TimelineLite = _globals.TimelineMax = Timeline;
_globalTimeline = new Timeline({
sortChildren: false,
defaults: _defaults,
autoRemoveChildren: true,
id: "root",
smoothChildTiming: true
});
_config.stringFilter = _colorStringFilter;
var _media = [];
var _listeners = {};
var _emptyArray = [];
var _lastMediaTime = 0;
var _contextID = 0;
var _dispatch = function _dispatch2(type) {
return (_listeners[type] || _emptyArray).map(function(f) {
return f();
});
};
var _onMediaChange = function _onMediaChange2() {
var time = Date.now(), matches2 = [];
if (time - _lastMediaTime > 2) {
_dispatch("matchMediaInit");
_media.forEach(function(c) {
var queries = c.queries, conditions = c.conditions, match, p, anyMatch, toggled;
for (p in queries) {
match = _win.matchMedia(queries[p]).matches;
match && (anyMatch = 1);
if (match !== conditions[p]) {
conditions[p] = match;
toggled = 1;
}
}
if (toggled) {
c.revert();
anyMatch && matches2.push(c);
}
});
_dispatch("matchMediaRevert");
matches2.forEach(function(c) {
return c.onMatch(c, function(func) {
return c.add(null, func);
});
});
_lastMediaTime = time;
_dispatch("matchMedia");
}
};
var Context = /* @__PURE__ */ function() {
function Context2(func, scope) {
this.selector = scope && selector(scope);
this.data = [];
this._r = [];
this.isReverted = false;
this.id = _contextID++;
func && this.add(func);
}
var _proto5 = Context2.prototype;
_proto5.add = function add(name, func, scope) {
if (_isFunction(name)) {
scope = func;
func = name;
name = _isFunction;
}
var self2 = this, f = function f2() {
var prev = _context, prevSelector = self2.selector, result;
prev && prev !== self2 && prev.data.push(self2);
scope && (self2.selector = selector(scope));
_context = self2;
result = func.apply(self2, arguments);
_isFunction(result) && self2._r.push(result);
_context = prev;
self2.selector = prevSelector;
self2.isReverted = false;
return result;
};
self2.last = f;
return name === _isFunction ? f(self2, function(func2) {
return self2.add(null, func2);
}) : name ? self2[name] = f : f;
};
_proto5.ignore = function ignore(func) {
var prev = _context;
_context = null;
func(this);
_context = prev;
};
_proto5.getTweens = function getTweens() {
var a = [];
this.data.forEach(function(e2) {
return e2 instanceof Context2 ? a.push.apply(a, e2.getTweens()) : e2 instanceof Tween && !(e2.parent && e2.parent.data === "nested") && a.push(e2);
});
return a;
};
_proto5.clear = function clear() {
this._r.length = this.data.length = 0;
};
_proto5.kill = function kill(revert, matchMedia3) {
var _this4 = this;
if (revert) {
(function() {
var tweens = _this4.getTweens(), i4 = _this4.data.length, t3;
while (i4--) {
t3 = _this4.data[i4];
if (t3.data === "isFlip") {
t3.revert();
t3.getChildren(true, true, false).forEach(function(tween) {
return tweens.splice(tweens.indexOf(tween), 1);
});
}
}
tweens.map(function(t4) {
return {
g: t4._dur || t4._delay || t4._sat && !t4._sat.vars.immediateRender ? t4.globalTime(0) : -Infinity,
t: t4
};
}).sort(function(a, b) {
return b.g - a.g || -Infinity;
}).forEach(function(o) {
return o.t.revert(revert);
});
i4 = _this4.data.length;
while (i4--) {
t3 = _this4.data[i4];
if (t3 instanceof Timeline) {
if (t3.data !== "nested") {
t3.scrollTrigger && t3.scrollTrigger.revert();
t3.kill();
}
} else {
!(t3 instanceof Tween) && t3.revert && t3.revert(revert);
}
}
_this4._r.forEach(function(f) {
return f(revert, _this4);
});
_this4.isReverted = true;
})();
} else {
this.data.forEach(function(e2) {
return e2.kill && e2.kill();
});
}
this.clear();
if (matchMedia3) {
var i3 = _media.length;
while (i3--) {
_media[i3].id === this.id && _media.splice(i3, 1);
}
}
};
_proto5.revert = function revert(config3) {
this.kill(config3 || {});
};
return Context2;
}();
var MatchMedia = /* @__PURE__ */ function() {
function MatchMedia2(scope) {
this.contexts = [];
this.scope = scope;
_context && _context.data.push(this);
}
var _proto6 = MatchMedia2.prototype;
_proto6.add = function add(conditions, func, scope) {
_isObject(conditions) || (conditions = {
matches: conditions
});
var context3 = new Context(0, scope || this.scope), cond = context3.conditions = {}, mq, p, active;
_context && !context3.selector && (context3.selector = _context.selector);
this.contexts.push(context3);
func = context3.add("onMatch", func);
context3.queries = conditions;
for (p in conditions) {
if (p === "all") {
active = 1;
} else {
mq = _win.matchMedia(conditions[p]);
if (mq) {
_media.indexOf(context3) < 0 && _media.push(context3);
(cond[p] = mq.matches) && (active = 1);
mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener("change", _onMediaChange);
}
}
}
active && func(context3, function(f) {
return context3.add(null, f);
});
return this;
};
_proto6.revert = function revert(config3) {
this.kill(config3 || {});
};
_proto6.kill = function kill(revert) {
this.contexts.forEach(function(c) {
return c.kill(revert, true);
});
};
return MatchMedia2;
}();
var _gsap = {
registerPlugin: function registerPlugin() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
args.forEach(function(config3) {
return _createPlugin(config3);
});
},
timeline: function timeline(vars) {
return new Timeline(vars);
},
getTweensOf: function getTweensOf(targets, onlyActive) {
return _globalTimeline.getTweensOf(targets, onlyActive);
},
getProperty: function getProperty(target, property, unit2, uncache) {
_isString(target) && (target = toArray(target)[0]);
var getter = _getCache(target || {}).get, format2 = unit2 ? _passThrough : _numericIfPossible;
unit2 === "native" && (unit2 = "");
return !target ? target : !property ? function(property2, unit3, uncache2) {
return format2((_plugins[property2] && _plugins[property2].get || getter)(target, property2, unit3, uncache2));
} : format2((_plugins[property] && _plugins[property].get || getter)(target, property, unit2, uncache));
},
quickSetter: function quickSetter(target, property, unit2) {
target = toArray(target);
if (target.length > 1) {
var setters = target.map(function(t3) {
return gsap.quickSetter(t3, property, unit2);
}), l = setters.length;
return function(value) {
var i3 = l;
while (i3--) {
setters[i3](value);
}
};
}
target = target[0] || {};
var Plugin = _plugins[property], cache = _getCache(target), p = cache.harness && (cache.harness.aliases || {})[property] || property, setter = Plugin ? function(value) {
var p2 = new Plugin();
_quickTween._pt = 0;
p2.init(target, unit2 ? value + unit2 : value, _quickTween, 0, [target]);
p2.render(1, p2);
_quickTween._pt && _renderPropTweens(1, _quickTween);
} : cache.set(target, p);
return Plugin ? setter : function(value) {
return setter(target, p, unit2 ? value + unit2 : value, cache, 1);
};
},
quickTo: function quickTo(target, property, vars) {
var _merge22;
var tween = gsap.to(target, _merge((_merge22 = {}, _merge22[property] = "+=0.1", _merge22.paused = true, _merge22), vars || {})), func = function func2(value, start3, startIsRelative) {
return tween.resetTo(property, value, start3, startIsRelative);
};
func.tween = tween;
return func;
},
isTweening: function isTweening(targets) {
return _globalTimeline.getTweensOf(targets, true).length > 0;
},
defaults: function defaults(value) {
value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease));
return _mergeDeep(_defaults, value || {});
},
config: function config2(value) {
return _mergeDeep(_config, value || {});
},
registerEffect: function registerEffect(_ref3) {
var name = _ref3.name, effect4 = _ref3.effect, plugins = _ref3.plugins, defaults2 = _ref3.defaults, extendTimeline = _ref3.extendTimeline;
(plugins || "").split(",").forEach(function(pluginName) {
return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + " effect requires " + pluginName + " plugin.");
});
_effects[name] = function(targets, vars, tl) {
return effect4(toArray(targets), _setDefaults(vars || {}, defaults2), tl);
};
if (extendTimeline) {
Timeline.prototype[name] = function(targets, vars, position) {
return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position);
};
}
},
registerEase: function registerEase(name, ease) {
_easeMap[name] = _parseEase(ease);
},
parseEase: function parseEase(ease, defaultEase) {
return arguments.length ? _parseEase(ease, defaultEase) : _easeMap;
},
getById: function getById(id) {
return _globalTimeline.getById(id);
},
exportRoot: function exportRoot(vars, includeDelayedCalls) {
if (vars === void 0) {
vars = {};
}
var tl = new Timeline(vars), child2, next;
tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming);
_globalTimeline.remove(tl);
tl._dp = 0;
tl._time = tl._tTime = _globalTimeline._time;
child2 = _globalTimeline._first;
while (child2) {
next = child2._next;
if (includeDelayedCalls || !(!child2._dur && child2 instanceof Tween && child2.vars.onComplete === child2._targets[0])) {
_addToTimeline(tl, child2, child2._start - child2._delay);
}
child2 = next;
}
_addToTimeline(_globalTimeline, tl, 0);
return tl;
},
context: function context(func, scope) {
return func ? new Context(func, scope) : _context;
},
matchMedia: function matchMedia2(scope) {
return new MatchMedia(scope);
},
matchMediaRefresh: function matchMediaRefresh() {
return _media.forEach(function(c) {
var cond = c.conditions, found, p;
for (p in cond) {
if (cond[p]) {
cond[p] = false;
found = 1;
}
}
found && c.revert();
}) || _onMediaChange();
},
addEventListener: function addEventListener2(type, callback) {
var a = _listeners[type] || (_listeners[type] = []);
~a.indexOf(callback) || a.push(callback);
},
removeEventListener: function removeEventListener2(type, callback) {
var a = _listeners[type], i3 = a && a.indexOf(callback);
i3 >= 0 && a.splice(i3, 1);
},
utils: {
wrap,
wrapYoyo,
distribute,
random,
snap,
normalize,
getUnit,
clamp: clamp2,
splitColor,
toArray,
selector,
mapRange,
pipe,
unitize,
interpolate,
shuffle
},
install: _install,
effects: _effects,
ticker: _ticker,
updateRoot: Timeline.updateRoot,
plugins: _plugins,
globalTimeline: _globalTimeline,
core: {
PropTween,
globals: _addGlobal,
Tween,
Timeline,
Animation,
getCache: _getCache,
_removeLinkedListItem,
reverting: function reverting() {
return _reverting;
},
context: function context2(toAdd) {
if (toAdd && _context) {
_context.data.push(toAdd);
toAdd._ctx = _context;
}
return _context;
},
suppressOverwrites: function suppressOverwrites(value) {
return _suppressOverwrites = value;
}
}
};
_forEachName("to,from,fromTo,delayedCall,set,killTweensOf", function(name) {
return _gsap[name] = Tween[name];
});
_ticker.add(Timeline.updateRoot);
_quickTween = _gsap.to({}, {
duration: 0
});
var _getPluginPropTween = function _getPluginPropTween2(plugin, prop) {
var pt = plugin._pt;
while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) {
pt = pt._next;
}
return pt;
};
var _addModifiers = function _addModifiers2(tween, modifiers) {
var targets = tween._targets, p, i3, pt;
for (p in modifiers) {
i3 = targets.length;
while (i3--) {
pt = tween._ptLookup[i3][p];
if (pt && (pt = pt.d)) {
if (pt._pt) {
pt = _getPluginPropTween(pt, p);
}
pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i3], p);
}
}
}
};
var _buildModifierPlugin = function _buildModifierPlugin2(name, modifier) {
return {
name,
rawVars: 1,
//don't pre-process function-based values or "random()" strings.
init: function init4(target, vars, tween) {
tween._onInit = function(tween2) {
var temp, p;
if (_isString(vars)) {
temp = {};
_forEachName(vars, function(name2) {
return temp[name2] = 1;
});
vars = temp;
}
if (modifier) {
temp = {};
for (p in vars) {
temp[p] = modifier(vars[p]);
}
vars = temp;
}
_addModifiers(tween2, vars);
};
}
};
};
var gsap = _gsap.registerPlugin({
name: "attr",
init: function init(target, vars, tween, index, targets) {
var p, pt, v;
this.tween = tween;
for (p in vars) {
v = target.getAttribute(p) || "";
pt = this.add(target, "setAttribute", (v || 0) + "", vars[p], index, targets, 0, 0, p);
pt.op = p;
pt.b = v;
this._props.push(p);
}
},
render: function render(ratio, data) {
var pt = data._pt;
while (pt) {
_reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d);
pt = pt._next;
}
}
}, {
name: "endArray",
init: function init2(target, value) {
var i3 = value.length;
while (i3--) {
this.add(target, i3, target[i3] || 0, value[i3], 0, 0, 0, 0, 0, 1);
}
}
}, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap;
Tween.version = Timeline.version = gsap.version = "3.12.5";
_coreReady = 1;
_windowExists() && _wake();
var Power0 = _easeMap.Power0;
var Power1 = _easeMap.Power1;
var Power2 = _easeMap.Power2;
var Power3 = _easeMap.Power3;
var Power4 = _easeMap.Power4;
var Linear = _easeMap.Linear;
var Quad = _easeMap.Quad;
var Cubic = _easeMap.Cubic;
var Quart = _easeMap.Quart;
var Quint = _easeMap.Quint;
var Strong = _easeMap.Strong;
var Elastic = _easeMap.Elastic;
var Back = _easeMap.Back;
var SteppedEase = _easeMap.SteppedEase;
var Bounce = _easeMap.Bounce;
var Sine = _easeMap.Sine;
var Expo = _easeMap.Expo;
var Circ = _easeMap.Circ;
// node_modules/gsap/CSSPlugin.js
var _win2;
var _doc2;
var _docElement;
var _pluginInitted;
var _tempDiv;
var _tempDivStyler;
var _recentSetterPlugin;
var _reverting2;
var _windowExists3 = function _windowExists4() {
return typeof window !== "undefined";
};
var _transformProps = {};
var _RAD2DEG = 180 / Math.PI;
var _DEG2RAD = Math.PI / 180;
var _atan2 = Math.atan2;
var _bigNum2 = 1e8;
var _capsExp = /([A-Z])/g;
var _horizontalExp = /(left|right|width|margin|padding|x)/i;
var _complexExp = /[\s,\(]\S/;
var _propertyAliases = {
autoAlpha: "opacity,visibility",
scale: "scaleX,scaleY",
alpha: "opacity"
};
var _renderCSSProp = function _renderCSSProp2(ratio, data) {
return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
};
var _renderPropWithEnd = function _renderPropWithEnd2(ratio, data) {
return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
};
var _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning2(ratio, data) {
return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data);
};
var _renderRoundedCSSProp = function _renderRoundedCSSProp2(ratio, data) {
var value = data.s + data.c * ratio;
data.set(data.t, data.p, ~~(value + (value < 0 ? -0.5 : 0.5)) + data.u, data);
};
var _renderNonTweeningValue = function _renderNonTweeningValue2(ratio, data) {
return data.set(data.t, data.p, ratio ? data.e : data.b, data);
};
var _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd2(ratio, data) {
return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data);
};
var _setterCSSStyle = function _setterCSSStyle2(target, property, value) {
return target.style[property] = value;
};
var _setterCSSProp = function _setterCSSProp2(target, property, value) {
return target.style.setProperty(property, value);
};
var _setterTransform = function _setterTransform2(target, property, value) {
return target._gsap[property] = value;
};
var _setterScale = function _setterScale2(target, property, value) {
return target._gsap.scaleX = target._gsap.scaleY = value;
};
var _setterScaleWithRender = function _setterScaleWithRender2(target, property, value, data, ratio) {
var cache = target._gsap;
cache.scaleX = cache.scaleY = value;
cache.renderTransform(ratio, cache);
};
var _setterTransformWithRender = function _setterTransformWithRender2(target, property, value, data, ratio) {
var cache = target._gsap;
cache[property] = value;
cache.renderTransform(ratio, cache);
};
var _transformProp = "transform";
var _transformOriginProp = _transformProp + "Origin";
var _saveStyle = function _saveStyle2(property, isNotCSS) {
var _this = this;
var target = this.target, style2 = target.style, cache = target._gsap;
if (property in _transformProps && style2) {
this.tfm = this.tfm || {};
if (property !== "transform") {
property = _propertyAliases[property] || property;
~property.indexOf(",") ? property.split(",").forEach(function(a) {
return _this.tfm[a] = _get2(target, a);
}) : this.tfm[property] = cache.x ? cache[property] : _get2(target, property);
property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin);
} else {
return _propertyAliases.transform.split(",").forEach(function(p) {
return _saveStyle2.call(_this, p, isNotCSS);
});
}
if (this.props.indexOf(_transformProp) >= 0) {
return;
}
if (cache.svg) {
this.svgo = target.getAttribute("data-svg-origin");
this.props.push(_transformOriginProp, isNotCSS, "");
}
property = _transformProp;
}
(style2 || isNotCSS) && this.props.push(property, isNotCSS, style2[property]);
};
var _removeIndependentTransforms = function _removeIndependentTransforms2(style2) {
if (style2.translate) {
style2.removeProperty("translate");
style2.removeProperty("scale");
style2.removeProperty("rotate");
}
};
var _revertStyle = function _revertStyle2() {
var props = this.props, target = this.target, style2 = target.style, cache = target._gsap, i3, p;
for (i3 = 0; i3 < props.length; i3 += 3) {
props[i3 + 1] ? target[props[i3]] = props[i3 + 2] : props[i3 + 2] ? style2[props[i3]] = props[i3 + 2] : style2.removeProperty(props[i3].substr(0, 2) === "--" ? props[i3] : props[i3].replace(_capsExp, "-$1").toLowerCase());
}
if (this.tfm) {
for (p in this.tfm) {
cache[p] = this.tfm[p];
}
if (cache.svg) {
cache.renderTransform();
target.setAttribute("data-svg-origin", this.svgo || "");
}
i3 = _reverting2();
if ((!i3 || !i3.isStart) && !style2[_transformProp]) {
_removeIndependentTransforms(style2);
if (cache.zOrigin && style2[_transformOriginProp]) {
style2[_transformOriginProp] += " " + cache.zOrigin + "px";
cache.zOrigin = 0;
cache.renderTransform();
}
cache.uncache = 1;
}
}
};
var _getStyleSaver = function _getStyleSaver2(target, properties) {
var saver = {
target,
props: [],
revert: _revertStyle,
save: _saveStyle
};
target._gsap || gsap.core.getCache(target);
properties && properties.split(",").forEach(function(p) {
return saver.save(p);
});
return saver;
};
var _supports3D;
var _createElement = function _createElement2(type, ns) {
var e2 = _doc2.createElementNS ? _doc2.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc2.createElement(type);
return e2 && e2.style ? e2 : _doc2.createElement(type);
};
var _getComputedProperty = function _getComputedProperty2(target, property, skipPrefixFallback) {
var cs = getComputedStyle(target);
return cs[property] || cs.getPropertyValue(property.replace(_capsExp, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty2(target, _checkPropPrefix(property) || property, 1) || "";
};
var _prefixes = "O,Moz,ms,Ms,Webkit".split(",");
var _checkPropPrefix = function _checkPropPrefix2(property, element, preferPrefix) {
var e2 = element || _tempDiv, s2 = e2.style, i3 = 5;
if (property in s2 && !preferPrefix) {
return property;
}
property = property.charAt(0).toUpperCase() + property.substr(1);
while (i3-- && !(_prefixes[i3] + property in s2)) {
}
return i3 < 0 ? null : (i3 === 3 ? "ms" : i3 >= 0 ? _prefixes[i3] : "") + property;
};
var _initCore = function _initCore2() {
if (_windowExists3() && window.document) {
_win2 = window;
_doc2 = _win2.document;
_docElement = _doc2.documentElement;
_tempDiv = _createElement("div") || {
style: {}
};
_tempDivStyler = _createElement("div");
_transformProp = _checkPropPrefix(_transformProp);
_transformOriginProp = _transformProp + "Origin";
_tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0";
_supports3D = !!_checkPropPrefix("perspective");
_reverting2 = gsap.core.reverting;
_pluginInitted = 1;
}
};
var _getBBoxHack = function _getBBoxHack2(swapIfPossible) {
var svg = _createElement("svg", this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), oldParent = this.parentNode, oldSibling = this.nextSibling, oldCSS = this.style.cssText, bbox;
_docElement.appendChild(svg);
svg.appendChild(this);
this.style.display = "block";
if (swapIfPossible) {
try {
bbox = this.getBBox();
this._gsapBBox = this.getBBox;
this.getBBox = _getBBoxHack2;
} catch (e2) {
}
} else if (this._gsapBBox) {
bbox = this._gsapBBox();
}
if (oldParent) {
if (oldSibling) {
oldParent.insertBefore(this, oldSibling);
} else {
oldParent.appendChild(this);
}
}
_docElement.removeChild(svg);
this.style.cssText = oldCSS;
return bbox;
};
var _getAttributeFallbacks = function _getAttributeFallbacks2(target, attributesArray) {
var i3 = attributesArray.length;
while (i3--) {
if (target.hasAttribute(attributesArray[i3])) {
return target.getAttribute(attributesArray[i3]);
}
}
};
var _getBBox = function _getBBox2(target) {
var bounds;
try {
bounds = target.getBBox();
} catch (error) {
bounds = _getBBoxHack.call(target, true);
}
bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true));
return bounds && !bounds.width && !bounds.x && !bounds.y ? {
x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0,
y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0,
width: 0,
height: 0
} : bounds;
};
var _isSVG = function _isSVG2(e2) {
return !!(e2.getCTM && (!e2.parentNode || e2.ownerSVGElement) && _getBBox(e2));
};
var _removeProperty = function _removeProperty2(target, property) {
if (property) {
var style2 = target.style, first2Chars;
if (property in _transformProps && property !== _transformOriginProp) {
property = _transformProp;
}
if (style2.removeProperty) {
first2Chars = property.substr(0, 2);
if (first2Chars === "ms" || property.substr(0, 6) === "webkit") {
property = "-" + property;
}
style2.removeProperty(first2Chars === "--" ? property : property.replace(_capsExp, "-$1").toLowerCase());
} else {
style2.removeAttribute(property);
}
}
};
var _addNonTweeningPT = function _addNonTweeningPT2(plugin, target, property, beginning, end2, onlySetAtEnd) {
var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue);
plugin._pt = pt;
pt.b = beginning;
pt.e = end2;
plugin._props.push(property);
return pt;
};
var _nonConvertibleUnits = {
deg: 1,
rad: 1,
turn: 1
};
var _nonStandardLayouts = {
grid: 1,
flex: 1
};
var _convertToUnit = function _convertToUnit2(target, property, value, unit2) {
var curValue = parseFloat(value) || 0, curUnit = (value + "").trim().substr((curValue + "").length) || "px", style2 = _tempDiv.style, horizontal = _horizontalExp.test(property), isRootSVG = target.tagName.toLowerCase() === "svg", measureProperty = (isRootSVG ? "client" : "offset") + (horizontal ? "Width" : "Height"), amount = 100, toPixels = unit2 === "px", toPercent = unit2 === "%", px, parent, cache, isSVG;
if (unit2 === curUnit || !curValue || _nonConvertibleUnits[unit2] || _nonConvertibleUnits[curUnit]) {
return curValue;
}
curUnit !== "px" && !toPixels && (curValue = _convertToUnit2(target, property, value, "px"));
isSVG = target.getCTM && _isSVG(target);
if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) {
px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty];
return _round(toPercent ? curValue / px * amount : curValue / 100 * px);
}
style2[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit2);
parent = ~property.indexOf("adius") || unit2 === "em" && target.appendChild && !isRootSVG ? target : target.parentNode;
if (isSVG) {
parent = (target.ownerSVGElement || {}).parentNode;
}
if (!parent || parent === _doc2 || !parent.appendChild) {
parent = _doc2.body;
}
cache = parent._gsap;
if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) {
return _round(curValue / cache.width * amount);
} else {
if (toPercent && (property === "height" || property === "width")) {
var v = target.style[property];
target.style[property] = amount + unit2;
px = target[measureProperty];
v ? target.style[property] = v : _removeProperty(target, property);
} else {
(toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style2.position = _getComputedProperty(target, "position"));
parent === target && (style2.position = "static");
parent.appendChild(_tempDiv);
px = _tempDiv[measureProperty];
parent.removeChild(_tempDiv);
style2.position = "absolute";
}
if (horizontal && toPercent) {
cache = _getCache(parent);
cache.time = _ticker.time;
cache.width = parent[measureProperty];
}
}
return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0);
};
var _get2 = function _get3(target, property, unit2, uncache) {
var value;
_pluginInitted || _initCore();
if (property in _propertyAliases && property !== "transform") {
property = _propertyAliases[property];
if (~property.indexOf(",")) {
property = property.split(",")[0];
}
}
if (_transformProps[property] && property !== "transform") {
value = _parseTransform(target, uncache);
value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px";
} else {
value = target.style[property];
if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) {
value = _specialProps[property] && _specialProps[property](target, property, unit2) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0);
}
}
return unit2 && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit2) + unit2 : value;
};
var _tweenComplexCSSString = function _tweenComplexCSSString2(target, prop, start3, end2) {
if (!start3 || start3 === "none") {
var p = _checkPropPrefix(prop, target, 1), s2 = p && _getComputedProperty(target, p, 1);
if (s2 && s2 !== start3) {
prop = p;
start3 = s2;
} else if (prop === "borderColor") {
start3 = _getComputedProperty(target, "borderTopColor");
}
}
var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString), index = 0, matchIndex = 0, a, result, startValues, startNum, color, startValue, endValue, endNum, chunk, endUnit, startUnit, endValues;
pt.b = start3;
pt.e = end2;
start3 += "";
end2 += "";
if (end2 === "auto") {
startValue = target.style[prop];
target.style[prop] = end2;
end2 = _getComputedProperty(target, prop) || end2;
startValue ? target.style[prop] = startValue : _removeProperty(target, prop);
}
a = [start3, end2];
_colorStringFilter(a);
start3 = a[0];
end2 = a[1];
startValues = start3.match(_numWithUnitExp) || [];
endValues = end2.match(_numWithUnitExp) || [];
if (endValues.length) {
while (result = _numWithUnitExp.exec(end2)) {
endValue = result[0];
chunk = end2.substring(index, result.index);
if (color) {
color = (color + 1) % 5;
} else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") {
color = 1;
}
if (endValue !== (startValue = startValues[matchIndex++] || "")) {
startNum = parseFloat(startValue) || 0;
startUnit = startValue.substr((startNum + "").length);
endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit);
endNum = parseFloat(endValue);
endUnit = endValue.substr((endNum + "").length);
index = _numWithUnitExp.lastIndex - endUnit.length;
if (!endUnit) {
endUnit = endUnit || _config.units[prop] || startUnit;
if (index === end2.length) {
end2 += endUnit;
pt.e += endUnit;
}
}
if (startUnit !== endUnit) {
startNum = _convertToUnit(target, prop, startValue, endUnit) || 0;
}
pt._pt = {
_next: pt._pt,
p: chunk || matchIndex === 1 ? chunk : ",",
//note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.
s: startNum,
c: endNum - startNum,
m: color && color < 4 || prop === "zIndex" ? Math.round : 0
};
}
}
pt.c = index < end2.length ? end2.substring(index, end2.length) : "";
} else {
pt.r = prop === "display" && end2 === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue;
}
_relExp.test(end2) && (pt.e = 0);
this._pt = pt;
return pt;
};
var _keywordToPercent = {
top: "0%",
bottom: "100%",
left: "0%",
right: "100%",
center: "50%"
};
var _convertKeywordsToPercentages = function _convertKeywordsToPercentages2(value) {
var split = value.split(" "), x = split[0], y3 = split[1] || "50%";
if (x === "top" || x === "bottom" || y3 === "left" || y3 === "right") {
value = x;
x = y3;
y3 = value;
}
split[0] = _keywordToPercent[x] || x;
split[1] = _keywordToPercent[y3] || y3;
return split.join(" ");
};
var _renderClearProps = function _renderClearProps2(ratio, data) {
if (data.tween && data.tween._time === data.tween._dur) {
var target = data.t, style2 = target.style, props = data.u, cache = target._gsap, prop, clearTransforms, i3;
if (props === "all" || props === true) {
style2.cssText = "";
clearTransforms = 1;
} else {
props = props.split(",");
i3 = props.length;
while (--i3 > -1) {
prop = props[i3];
if (_transformProps[prop]) {
clearTransforms = 1;
prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp;
}
_removeProperty(target, prop);
}
}
if (clearTransforms) {
_removeProperty(target, _transformProp);
if (cache) {
cache.svg && target.removeAttribute("transform");
_parseTransform(target, 1);
cache.uncache = 1;
_removeIndependentTransforms(style2);
}
}
}
};
var _specialProps = {
clearProps: function clearProps(plugin, target, property, endValue, tween) {
if (tween.data !== "isFromStart") {
var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps);
pt.u = endValue;
pt.pr = -10;
pt.tween = tween;
plugin._props.push(property);
return 1;
}
}
/* className feature (about 0.4kb gzipped).
, className(plugin, target, property, endValue, tween) {
let _renderClassName = (ratio, data) => {
data.css.render(ratio, data.css);
if (!ratio || ratio === 1) {
let inline = data.rmv,
target = data.t,
p;
target.setAttribute("class", ratio ? data.e : data.b);
for (p in inline) {
_removeProperty(target, p);
}
}
},
_getAllStyles = (target) => {
let styles = {},
computed = getComputedStyle(target),
p;
for (p in computed) {
if (isNaN(p) && p !== "cssText" && p !== "length") {
styles[p] = computed[p];
}
}
_setDefaults(styles, _parseTransform(target, 1));
return styles;
},
startClassList = target.getAttribute("class"),
style = target.style,
cssText = style.cssText,
cache = target._gsap,
classPT = cache.classPT,
inlineToRemoveAtEnd = {},
data = {t:target, plugin:plugin, rmv:inlineToRemoveAtEnd, b:startClassList, e:(endValue.charAt(1) !== "=") ? endValue : startClassList.replace(new RegExp("(?:\\s|^)" + endValue.substr(2) + "(?![\\w-])"), "") + ((endValue.charAt(0) === "+") ? " " + endValue.substr(2) : "")},
changingVars = {},
startVars = _getAllStyles(target),
transformRelated = /(transform|perspective)/i,
endVars, p;
if (classPT) {
classPT.r(1, classPT.d);
_removeLinkedListItem(classPT.d.plugin, classPT, "_pt");
}
target.setAttribute("class", data.e);
endVars = _getAllStyles(target, true);
target.setAttribute("class", startClassList);
for (p in endVars) {
if (endVars[p] !== startVars[p] && !transformRelated.test(p)) {
changingVars[p] = endVars[p];
if (!style[p] && style[p] !== "0") {
inlineToRemoveAtEnd[p] = 1;
}
}
}
cache.classPT = plugin._pt = new PropTween(plugin._pt, target, "className", 0, 0, _renderClassName, data, 0, -11);
if (style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://gsap.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/.
style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity).
}
_parseTransform(target, true); //to clear the caching of transforms
data.css = new gsap.plugins.css();
data.css.init(target, changingVars, tween);
plugin._props.push(...data.css._props);
return 1;
}
*/
};
var _identity2DMatrix = [1, 0, 0, 1, 0, 0];
var _rotationalProperties = {};
var _isNullTransform = function _isNullTransform2(value) {
return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value;
};
var _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray2(target) {
var matrixString = _getComputedProperty(target, _transformProp);
return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round);
};
var _getMatrix = function _getMatrix2(target, force2D) {
var cache = target._gsap || _getCache(target), style2 = target.style, matrix = _getComputedTransformMatrixAsArray(target), parent, nextSibling, temp, addedToDOM;
if (cache.svg && target.getAttribute("transform")) {
temp = target.transform.baseVal.consolidate().matrix;
matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f];
return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix;
} else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) {
temp = style2.display;
style2.display = "block";
parent = target.parentNode;
if (!parent || !target.offsetParent) {
addedToDOM = 1;
nextSibling = target.nextElementSibling;
_docElement.appendChild(target);
}
matrix = _getComputedTransformMatrixAsArray(target);
temp ? style2.display = temp : _removeProperty(target, "display");
if (addedToDOM) {
nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target);
}
}
return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix;
};
var _applySVGOrigin = function _applySVGOrigin2(target, origin, originIsAbsolute, smooth2, matrixArray, pluginToAddPropTweensTo) {
var cache = target._gsap, matrix = matrixArray || _getMatrix(target, true), xOriginOld = cache.xOrigin || 0, yOriginOld = cache.yOrigin || 0, xOffsetOld = cache.xOffset || 0, yOffsetOld = cache.yOffset || 0, a = matrix[0], b = matrix[1], c = matrix[2], d3 = matrix[3], tx = matrix[4], ty = matrix[5], originSplit = origin.split(" "), xOrigin = parseFloat(originSplit[0]) || 0, yOrigin = parseFloat(originSplit[1]) || 0, bounds, determinant, x, y3;
if (!originIsAbsolute) {
bounds = _getBBox(target);
xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin);
yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin);
} else if (matrix !== _identity2DMatrix && (determinant = a * d3 - b * c)) {
x = xOrigin * (d3 / determinant) + yOrigin * (-c / determinant) + (c * ty - d3 * tx) / determinant;
y3 = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant;
xOrigin = x;
yOrigin = y3;
}
if (smooth2 || smooth2 !== false && cache.smooth) {
tx = xOrigin - xOriginOld;
ty = yOrigin - yOriginOld;
cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx;
cache.yOffset = yOffsetOld + (tx * b + ty * d3) - ty;
} else {
cache.xOffset = cache.yOffset = 0;
}
cache.xOrigin = xOrigin;
cache.yOrigin = yOrigin;
cache.smooth = !!smooth2;
cache.origin = origin;
cache.originIsAbsolute = !!originIsAbsolute;
target.style[_transformOriginProp] = "0px 0px";
if (pluginToAddPropTweensTo) {
_addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin);
_addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin);
_addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset);
_addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset);
}
target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin);
};
var _parseTransform = function _parseTransform2(target, uncache) {
var cache = target._gsap || new GSCache(target);
if ("x" in cache && !uncache && !cache.uncache) {
return cache;
}
var style2 = target.style, invertedScaleX = cache.scaleX < 0, px = "px", deg = "deg", cs = getComputedStyle(target), origin = _getComputedProperty(target, _transformOriginProp) || "0", x, y3, z, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY, perspective, xOrigin, yOrigin, matrix, angle, cos, sin, a, b, c, d3, a12, a22, t1, t22, t3, a13, a23, a33, a42, a43, a32;
x = y3 = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0;
scaleX = scaleY = 1;
cache.svg = !!(target.getCTM && _isSVG(target));
if (cs.translate) {
if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") {
style2[_transformProp] = (cs.translate !== "none" ? "translate3d(" + (cs.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (cs.rotate !== "none" ? "rotate(" + cs.rotate + ") " : "") + (cs.scale !== "none" ? "scale(" + cs.scale.split(" ").join(",") + ") " : "") + (cs[_transformProp] !== "none" ? cs[_transformProp] : "");
}
style2.scale = style2.rotate = style2.translate = "none";
}
matrix = _getMatrix(target, cache.svg);
if (cache.svg) {
if (cache.uncache) {
t22 = target.getBBox();
origin = cache.xOrigin - t22.x + "px " + (cache.yOrigin - t22.y) + "px";
t1 = "";
} else {
t1 = !uncache && target.getAttribute("data-svg-origin");
}
_applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix);
}
xOrigin = cache.xOrigin || 0;
yOrigin = cache.yOrigin || 0;
if (matrix !== _identity2DMatrix) {
a = matrix[0];
b = matrix[1];
c = matrix[2];
d3 = matrix[3];
x = a12 = matrix[4];
y3 = a22 = matrix[5];
if (matrix.length === 6) {
scaleX = Math.sqrt(a * a + b * b);
scaleY = Math.sqrt(d3 * d3 + c * c);
rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0;
skewX = c || d3 ? _atan2(c, d3) * _RAD2DEG + rotation : 0;
skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD)));
if (cache.svg) {
x -= xOrigin - (xOrigin * a + yOrigin * c);
y3 -= yOrigin - (xOrigin * b + yOrigin * d3);
}
} else {
a32 = matrix[6];
a42 = matrix[7];
a13 = matrix[8];
a23 = matrix[9];
a33 = matrix[10];
a43 = matrix[11];
x = matrix[12];
y3 = matrix[13];
z = matrix[14];
angle = _atan2(a32, a33);
rotationX = angle * _RAD2DEG;
if (angle) {
cos = Math.cos(-angle);
sin = Math.sin(-angle);
t1 = a12 * cos + a13 * sin;
t22 = a22 * cos + a23 * sin;
t3 = a32 * cos + a33 * sin;
a13 = a12 * -sin + a13 * cos;
a23 = a22 * -sin + a23 * cos;
a33 = a32 * -sin + a33 * cos;
a43 = a42 * -sin + a43 * cos;
a12 = t1;
a22 = t22;
a32 = t3;
}
angle = _atan2(-c, a33);
rotationY = angle * _RAD2DEG;
if (angle) {
cos = Math.cos(-angle);
sin = Math.sin(-angle);
t1 = a * cos - a13 * sin;
t22 = b * cos - a23 * sin;
t3 = c * cos - a33 * sin;
a43 = d3 * sin + a43 * cos;
a = t1;
b = t22;
c = t3;
}
angle = _atan2(b, a);
rotation = angle * _RAD2DEG;
if (angle) {
cos = Math.cos(angle);
sin = Math.sin(angle);
t1 = a * cos + b * sin;
t22 = a12 * cos + a22 * sin;
b = b * cos - a * sin;
a22 = a22 * cos - a12 * sin;
a = t1;
a12 = t22;
}
if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) {
rotationX = rotation = 0;
rotationY = 180 - rotationY;
}
scaleX = _round(Math.sqrt(a * a + b * b + c * c));
scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32));
angle = _atan2(a12, a22);
skewX = Math.abs(angle) > 2e-4 ? angle * _RAD2DEG : 0;
perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0;
}
if (cache.svg) {
t1 = target.getAttribute("transform");
cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp));
t1 && target.setAttribute("transform", t1);
}
}
if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {
if (invertedScaleX) {
scaleX *= -1;
skewX += rotation <= 0 ? 180 : -180;
rotation += rotation <= 0 ? 180 : -180;
} else {
scaleY *= -1;
skewX += skewX <= 0 ? 180 : -180;
}
}
uncache = uncache || cache.uncache;
cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px;
cache.y = y3 - ((cache.yPercent = y3 && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y3) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px;
cache.z = z + px;
cache.scaleX = _round(scaleX);
cache.scaleY = _round(scaleY);
cache.rotation = _round(rotation) + deg;
cache.rotationX = _round(rotationX) + deg;
cache.rotationY = _round(rotationY) + deg;
cache.skewX = skewX + deg;
cache.skewY = skewY + deg;
cache.transformPerspective = perspective + px;
if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || !uncache && cache.zOrigin || 0) {
style2[_transformOriginProp] = _firstTwoOnly(origin);
}
cache.xOffset = cache.yOffset = 0;
cache.force3D = _config.force3D;
cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms;
cache.uncache = 0;
return cache;
};
var _firstTwoOnly = function _firstTwoOnly2(value) {
return (value = value.split(" "))[0] + " " + value[1];
};
var _addPxTranslate = function _addPxTranslate2(target, start3, value) {
var unit2 = getUnit(start3);
return _round(parseFloat(start3) + parseFloat(_convertToUnit(target, "x", value + "px", unit2))) + unit2;
};
var _renderNon3DTransforms = function _renderNon3DTransforms2(ratio, cache) {
cache.z = "0px";
cache.rotationY = cache.rotationX = "0deg";
cache.force3D = 0;
_renderCSSTransforms(ratio, cache);
};
var _zeroDeg = "0deg";
var _zeroPx = "0px";
var _endParenthesis = ") ";
var _renderCSSTransforms = function _renderCSSTransforms2(ratio, cache) {
var _ref = cache || this, xPercent = _ref.xPercent, yPercent = _ref.yPercent, x = _ref.x, y3 = _ref.y, z = _ref.z, rotation = _ref.rotation, rotationY = _ref.rotationY, rotationX = _ref.rotationX, skewX = _ref.skewX, skewY = _ref.skewY, scaleX = _ref.scaleX, scaleY = _ref.scaleY, transformPerspective = _ref.transformPerspective, force3D = _ref.force3D, target = _ref.target, zOrigin = _ref.zOrigin, transforms = "", use3D = force3D === "auto" && ratio && ratio !== 1 || force3D === true;
if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) {
var angle = parseFloat(rotationY) * _DEG2RAD, a13 = Math.sin(angle), a33 = Math.cos(angle), cos;
angle = parseFloat(rotationX) * _DEG2RAD;
cos = Math.cos(angle);
x = _addPxTranslate(target, x, a13 * cos * -zOrigin);
y3 = _addPxTranslate(target, y3, -Math.sin(angle) * -zOrigin);
z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin);
}
if (transformPerspective !== _zeroPx) {
transforms += "perspective(" + transformPerspective + _endParenthesis;
}
if (xPercent || yPercent) {
transforms += "translate(" + xPercent + "%, " + yPercent + "%) ";
}
if (use3D || x !== _zeroPx || y3 !== _zeroPx || z !== _zeroPx) {
transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y3 + ", " + z + ") " : "translate(" + x + ", " + y3 + _endParenthesis;
}
if (rotation !== _zeroDeg) {
transforms += "rotate(" + rotation + _endParenthesis;
}
if (rotationY !== _zeroDeg) {
transforms += "rotateY(" + rotationY + _endParenthesis;
}
if (rotationX !== _zeroDeg) {
transforms += "rotateX(" + rotationX + _endParenthesis;
}
if (skewX !== _zeroDeg || skewY !== _zeroDeg) {
transforms += "skew(" + skewX + ", " + skewY + _endParenthesis;
}
if (scaleX !== 1 || scaleY !== 1) {
transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis;
}
target.style[_transformProp] = transforms || "translate(0, 0)";
};
var _renderSVGTransforms = function _renderSVGTransforms2(ratio, cache) {
var _ref2 = cache || this, xPercent = _ref2.xPercent, yPercent = _ref2.yPercent, x = _ref2.x, y3 = _ref2.y, rotation = _ref2.rotation, skewX = _ref2.skewX, skewY = _ref2.skewY, scaleX = _ref2.scaleX, scaleY = _ref2.scaleY, target = _ref2.target, xOrigin = _ref2.xOrigin, yOrigin = _ref2.yOrigin, xOffset = _ref2.xOffset, yOffset = _ref2.yOffset, forceCSS = _ref2.forceCSS, tx = parseFloat(x), ty = parseFloat(y3), a11, a21, a12, a22, temp;
rotation = parseFloat(rotation);
skewX = parseFloat(skewX);
skewY = parseFloat(skewY);
if (skewY) {
skewY = parseFloat(skewY);
skewX += skewY;
rotation += skewY;
}
if (rotation || skewX) {
rotation *= _DEG2RAD;
skewX *= _DEG2RAD;
a11 = Math.cos(rotation) * scaleX;
a21 = Math.sin(rotation) * scaleX;
a12 = Math.sin(rotation - skewX) * -scaleY;
a22 = Math.cos(rotation - skewX) * scaleY;
if (skewX) {
skewY *= _DEG2RAD;
temp = Math.tan(skewX - skewY);
temp = Math.sqrt(1 + temp * temp);
a12 *= temp;
a22 *= temp;
if (skewY) {
temp = Math.tan(skewY);
temp = Math.sqrt(1 + temp * temp);
a11 *= temp;
a21 *= temp;
}
}
a11 = _round(a11);
a21 = _round(a21);
a12 = _round(a12);
a22 = _round(a22);
} else {
a11 = scaleX;
a22 = scaleY;
a21 = a12 = 0;
}
if (tx && !~(x + "").indexOf("px") || ty && !~(y3 + "").indexOf("px")) {
tx = _convertToUnit(target, "x", x, "px");
ty = _convertToUnit(target, "y", y3, "px");
}
if (xOrigin || yOrigin || xOffset || yOffset) {
tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset);
ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset);
}
if (xPercent || yPercent) {
temp = target.getBBox();
tx = _round(tx + xPercent / 100 * temp.width);
ty = _round(ty + yPercent / 100 * temp.height);
}
temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")";
target.setAttribute("transform", temp);
forceCSS && (target.style[_transformProp] = temp);
};
var _addRotationalPropTween = function _addRotationalPropTween2(plugin, target, property, startNum, endValue) {
var cap = 360, isString2 = _isString(endValue), endNum = parseFloat(endValue) * (isString2 && ~endValue.indexOf("rad") ? _RAD2DEG : 1), change = endNum - startNum, finalValue = startNum + change + "deg", direction, pt;
if (isString2) {
direction = endValue.split("_")[1];
if (direction === "short") {
change %= cap;
if (change !== change % (cap / 2)) {
change += change < 0 ? cap : -cap;
}
}
if (direction === "cw" && change < 0) {
change = (change + cap * _bigNum2) % cap - ~~(change / cap) * cap;
} else if (direction === "ccw" && change > 0) {
change = (change - cap * _bigNum2) % cap - ~~(change / cap) * cap;
}
}
plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);
pt.e = finalValue;
pt.u = "deg";
plugin._props.push(property);
return pt;
};
var _assign = function _assign2(target, source) {
for (var p in source) {
target[p] = source[p];
}
return target;
};
var _addRawTransformPTs = function _addRawTransformPTs2(plugin, transforms, target) {
var startCache = _assign({}, target._gsap), exclude = "perspective,force3D,transformOrigin,svgOrigin", style2 = target.style, endCache, p, startValue, endValue, startNum, endNum, startUnit, endUnit;
if (startCache.svg) {
startValue = target.getAttribute("transform");
target.setAttribute("transform", "");
style2[_transformProp] = transforms;
endCache = _parseTransform(target, 1);
_removeProperty(target, _transformProp);
target.setAttribute("transform", startValue);
} else {
startValue = getComputedStyle(target)[_transformProp];
style2[_transformProp] = transforms;
endCache = _parseTransform(target, 1);
style2[_transformProp] = startValue;
}
for (p in _transformProps) {
startValue = startCache[p];
endValue = endCache[p];
if (startValue !== endValue && exclude.indexOf(p) < 0) {
startUnit = getUnit(startValue);
endUnit = getUnit(endValue);
startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue);
endNum = parseFloat(endValue);
plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp);
plugin._pt.u = endUnit || 0;
plugin._props.push(p);
}
}
_assign(endCache, startCache);
};
_forEachName("padding,margin,Width,Radius", function(name, index) {
var t3 = "Top", r = "Right", b = "Bottom", l = "Left", props = (index < 3 ? [t3, r, b, l] : [t3 + l, t3 + r, b + r, b + l]).map(function(side) {
return index < 2 ? name + side : "border" + side + name;
});
_specialProps[index > 1 ? "border" + name : name] = function(plugin, target, property, endValue, tween) {
var a, vars;
if (arguments.length < 4) {
a = props.map(function(prop) {
return _get2(plugin, prop, property);
});
vars = a.join(" ");
return vars.split(a[0]).length === 5 ? a[0] : vars;
}
a = (endValue + "").split(" ");
vars = {};
props.forEach(function(prop, i3) {
return vars[prop] = a[i3] = a[i3] || a[(i3 - 1) / 2 | 0];
});
plugin.init(target, vars, tween);
};
});
var CSSPlugin = {
name: "css",
register: _initCore,
targetTest: function targetTest(target) {
return target.style && target.nodeType;
},
init: function init3(target, vars, tween, index, targets) {
var props = this._props, style2 = target.style, startAt = tween.vars.startAt, startValue, endValue, endNum, startNum, type, specialProp, p, startUnit, endUnit, relative, isTransformRelated, transformPropTween, cache, smooth2, hasPriority, inlineProps;
_pluginInitted || _initCore();
this.styles = this.styles || _getStyleSaver(target);
inlineProps = this.styles.props;
this.tween = tween;
for (p in vars) {
if (p === "autoRound") {
continue;
}
endValue = vars[p];
if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) {
continue;
}
type = typeof endValue;
specialProp = _specialProps[p];
if (type === "function") {
endValue = endValue.call(tween, index, target, targets);
type = typeof endValue;
}
if (type === "string" && ~endValue.indexOf("random(")) {
endValue = _replaceRandom(endValue);
}
if (specialProp) {
specialProp(this, target, p, endValue, tween) && (hasPriority = 1);
} else if (p.substr(0, 2) === "--") {
startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim();
endValue += "";
_colorExp.lastIndex = 0;
if (!_colorExp.test(startValue)) {
startUnit = getUnit(startValue);
endUnit = getUnit(endValue);
}
endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit);
this.add(style2, "setProperty", startValue, endValue, index, targets, 0, 0, p);
props.push(p);
inlineProps.push(p, 0, style2[p]);
} else if (type !== "undefined") {
if (startAt && p in startAt) {
startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p];
_isString(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue));
getUnit(startValue + "") || startValue === "auto" || (startValue += _config.units[p] || getUnit(_get2(target, p)) || "");
(startValue + "").charAt(1) === "=" && (startValue = _get2(target, p));
} else {
startValue = _get2(target, p);
}
startNum = parseFloat(startValue);
relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2);
relative && (endValue = endValue.substr(2));
endNum = parseFloat(endValue);
if (p in _propertyAliases) {
if (p === "autoAlpha") {
if (startNum === 1 && _get2(target, "visibility") === "hidden" && endNum) {
startNum = 0;
}
inlineProps.push("visibility", 0, style2.visibility);
_addNonTweeningPT(this, style2, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum);
}
if (p !== "scale" && p !== "transform") {
p = _propertyAliases[p];
~p.indexOf(",") && (p = p.split(",")[0]);
}
}
isTransformRelated = p in _transformProps;
if (isTransformRelated) {
this.styles.save(p);
if (!transformPropTween) {
cache = target._gsap;
cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform);
smooth2 = vars.smoothOrigin !== false && cache.smooth;
transformPropTween = this._pt = new PropTween(this._pt, style2, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1);
transformPropTween.dep = 1;
}
if (p === "scale") {
this._pt = new PropTween(this._pt, cache, "scaleY", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp);
this._pt.u = 0;
props.push("scaleY", p);
p += "X";
} else if (p === "transformOrigin") {
inlineProps.push(_transformOriginProp, 0, style2[_transformOriginProp]);
endValue = _convertKeywordsToPercentages(endValue);
if (cache.svg) {
_applySVGOrigin(target, endValue, 0, smooth2, 0, this);
} else {
endUnit = parseFloat(endValue.split(" ")[2]) || 0;
endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit);
_addNonTweeningPT(this, style2, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue));
}
continue;
} else if (p === "svgOrigin") {
_applySVGOrigin(target, endValue, 1, smooth2, 0, this);
continue;
} else if (p in _rotationalProperties) {
_addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue);
continue;
} else if (p === "smoothOrigin") {
_addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue);
continue;
} else if (p === "force3D") {
cache[p] = endValue;
continue;
} else if (p === "transform") {
_addRawTransformPTs(this, endValue, target);
continue;
}
} else if (!(p in style2)) {
p = _checkPropPrefix(p) || p;
}
if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style2) {
startUnit = (startValue + "").substr((startNum + "").length);
endNum || (endNum = 0);
endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit);
startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit));
this._pt = new PropTween(this._pt, isTransformRelated ? cache : style2, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === "px" || p === "zIndex") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp);
this._pt.u = endUnit || 0;
if (startUnit !== endUnit && endUnit !== "%") {
this._pt.b = startValue;
this._pt.r = _renderCSSPropWithBeginning;
}
} else if (!(p in style2)) {
if (p in target) {
this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets);
} else if (p !== "parseTransform") {
_missingPlugin(p, endValue);
continue;
}
} else {
_tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue);
}
isTransformRelated || (p in style2 ? inlineProps.push(p, 0, style2[p]) : inlineProps.push(p, 1, startValue || target[p]));
props.push(p);
}
}
hasPriority && _sortPropTweensByPriority(this);
},
render: function render2(ratio, data) {
if (data.tween._time || !_reverting2()) {
var pt = data._pt;
while (pt) {
pt.r(ratio, pt.d);
pt = pt._next;
}
} else {
data.styles.revert();
}
},
get: _get2,
aliases: _propertyAliases,
getSetter: function getSetter(target, property, plugin) {
var p = _propertyAliases[property];
p && p.indexOf(",") < 0 && (property = p);
return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get2(target, "x")) ? plugin && _recentSetterPlugin === plugin ? property === "scale" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === "scale" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf("-") ? _setterCSSProp : _getSetter(target, property);
},
core: {
_removeProperty,
_getMatrix
}
};
gsap.utils.checkPrefix = _checkPropPrefix;
gsap.core.getStyleSaver = _getStyleSaver;
(function(positionAndScale, rotation, others, aliases) {
var all = _forEachName(positionAndScale + "," + rotation + "," + others, function(name) {
_transformProps[name] = 1;
});
_forEachName(rotation, function(name) {
_config.units[name] = "deg";
_rotationalProperties[name] = 1;
});
_propertyAliases[all[13]] = positionAndScale + "," + rotation;
_forEachName(aliases, function(name) {
var split = name.split(":");
_propertyAliases[split[1]] = all[split[0]];
});
})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent", "rotation,rotationX,rotationY,skewX,skewY", "transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective", "0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");
_forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function(name) {
_config.units[name] = "px";
});
gsap.registerPlugin(CSSPlugin);
// node_modules/gsap/index.js
var gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap;
var TweenMaxWithCSS = gsapWithCSS.core.Tween;
// node_modules/gsap/Observer.js
function _defineProperties2(target, props) {
for (var i3 = 0; i3 < props.length; i3++) {
var descriptor = props[i3];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties2(Constructor.prototype, protoProps);
if (staticProps) _defineProperties2(Constructor, staticProps);
return Constructor;
}
var gsap2;
var _coreInitted2;
var _clamp3;
var _win3;
var _doc3;
var _docEl;
var _body;
var _isTouch;
var _pointerType;
var ScrollTrigger;
var _root;
var _normalizer;
var _eventTypes;
var _context2;
var _getGSAP = function _getGSAP2() {
return gsap2 || typeof window !== "undefined" && (gsap2 = window.gsap) && gsap2.registerPlugin && gsap2;
};
var _startup = 1;
var _observers = [];
var _scrollers = [];
var _proxies = [];
var _getTime = Date.now;
var _bridge = function _bridge2(name, value) {
return value;
};
var _integrate = function _integrate2() {
var core = ScrollTrigger.core, data = core.bridge || {}, scrollers = core._scrollers, proxies = core._proxies;
scrollers.push.apply(scrollers, _scrollers);
proxies.push.apply(proxies, _proxies);
_scrollers = scrollers;
_proxies = proxies;
_bridge = function _bridge3(name, value) {
return data[name](value);
};
};
var _getProxyProp = function _getProxyProp2(element, property) {
return ~_proxies.indexOf(element) && _proxies[_proxies.indexOf(element) + 1][property];
};
var _isViewport = function _isViewport2(el) {
return !!~_root.indexOf(el);
};
var _addListener = function _addListener2(element, type, func, passive2, capture) {
return element.addEventListener(type, func, {
passive: passive2 !== false,
capture: !!capture
});
};
var _removeListener = function _removeListener2(element, type, func, capture) {
return element.removeEventListener(type, func, !!capture);
};
var _scrollLeft = "scrollLeft";
var _scrollTop = "scrollTop";
var _onScroll = function _onScroll2() {
return _normalizer && _normalizer.isPressed || _scrollers.cache++;
};
var _scrollCacheFunc = function _scrollCacheFunc2(f, doNotCache) {
var cachingFunc = function cachingFunc2(value) {
if (value || value === 0) {
_startup && (_win3.history.scrollRestoration = "manual");
var isNormalizing = _normalizer && _normalizer.isPressed;
value = cachingFunc2.v = Math.round(value) || (_normalizer && _normalizer.iOS ? 1 : 0);
f(value);
cachingFunc2.cacheID = _scrollers.cache;
isNormalizing && _bridge("ss", value);
} else if (doNotCache || _scrollers.cache !== cachingFunc2.cacheID || _bridge("ref")) {
cachingFunc2.cacheID = _scrollers.cache;
cachingFunc2.v = f();
}
return cachingFunc2.v + cachingFunc2.offset;
};
cachingFunc.offset = 0;
return f && cachingFunc;
};
var _horizontal = {
s: _scrollLeft,
p: "left",
p2: "Left",
os: "right",
os2: "Right",
d: "width",
d2: "Width",
a: "x",
sc: _scrollCacheFunc(function(value) {
return arguments.length ? _win3.scrollTo(value, _vertical.sc()) : _win3.pageXOffset || _doc3[_scrollLeft] || _docEl[_scrollLeft] || _body[_scrollLeft] || 0;
})
};
var _vertical = {
s: _scrollTop,
p: "top",
p2: "Top",
os: "bottom",
os2: "Bottom",
d: "height",
d2: "Height",
a: "y",
op: _horizontal,
sc: _scrollCacheFunc(function(value) {
return arguments.length ? _win3.scrollTo(_horizontal.sc(), value) : _win3.pageYOffset || _doc3[_scrollTop] || _docEl[_scrollTop] || _body[_scrollTop] || 0;
})
};
var _getTarget = function _getTarget2(t3, self2) {
return (self2 && self2._ctx && self2._ctx.selector || gsap2.utils.toArray)(t3)[0] || (typeof t3 === "string" && gsap2.config().nullTargetWarn !== false ? console.warn("Element not found:", t3) : null);
};
var _getScrollFunc = function _getScrollFunc2(element, _ref) {
var s2 = _ref.s, sc = _ref.sc;
_isViewport(element) && (element = _doc3.scrollingElement || _docEl);
var i3 = _scrollers.indexOf(element), offset2 = sc === _vertical.sc ? 1 : 2;
!~i3 && (i3 = _scrollers.push(element) - 1);
_scrollers[i3 + offset2] || _addListener(element, "scroll", _onScroll);
var prev = _scrollers[i3 + offset2], func = prev || (_scrollers[i3 + offset2] = _scrollCacheFunc(_getProxyProp(element, s2), true) || (_isViewport(element) ? sc : _scrollCacheFunc(function(value) {
return arguments.length ? element[s2] = value : element[s2];
})));
func.target = element;
prev || (func.smooth = gsap2.getProperty(element, "scrollBehavior") === "smooth");
return func;
};
var _getVelocityProp = function _getVelocityProp2(value, minTimeRefresh, useDelta) {
var v1 = value, v2 = value, t1 = _getTime(), t22 = t1, min4 = minTimeRefresh || 50, dropToZeroTime = Math.max(500, min4 * 3), update = function update2(value2, force) {
var t3 = _getTime();
if (force || t3 - t1 > min4) {
v2 = v1;
v1 = value2;
t22 = t1;
t1 = t3;
} else if (useDelta) {
v1 += value2;
} else {
v1 = v2 + (value2 - v2) / (t3 - t22) * (t1 - t22);
}
}, reset = function reset2() {
v2 = v1 = useDelta ? 0 : v1;
t22 = t1 = 0;
}, getVelocity = function getVelocity2(latestValue) {
var tOld = t22, vOld = v2, t3 = _getTime();
(latestValue || latestValue === 0) && latestValue !== v1 && update(latestValue);
return t1 === t22 || t3 - t22 > dropToZeroTime ? 0 : (v1 + (useDelta ? vOld : -vOld)) / ((useDelta ? t3 : t1) - tOld) * 1e3;
};
return {
update,
reset,
getVelocity
};
};
var _getEvent = function _getEvent2(e2, preventDefault) {
preventDefault && !e2._gsapAllow && e2.preventDefault();
return e2.changedTouches ? e2.changedTouches[0] : e2;
};
var _getAbsoluteMax = function _getAbsoluteMax2(a) {
var max4 = Math.max.apply(Math, a), min4 = Math.min.apply(Math, a);
return Math.abs(max4) >= Math.abs(min4) ? max4 : min4;
};
var _setScrollTrigger = function _setScrollTrigger2() {
ScrollTrigger = gsap2.core.globals().ScrollTrigger;
ScrollTrigger && ScrollTrigger.core && _integrate();
};
var _initCore3 = function _initCore4(core) {
gsap2 = core || _getGSAP();
if (!_coreInitted2 && gsap2 && typeof document !== "undefined" && document.body) {
_win3 = window;
_doc3 = document;
_docEl = _doc3.documentElement;
_body = _doc3.body;
_root = [_win3, _doc3, _docEl, _body];
_clamp3 = gsap2.utils.clamp;
_context2 = gsap2.core.context || function() {
};
_pointerType = "onpointerenter" in _body ? "pointer" : "mouse";
_isTouch = Observer.isTouch = _win3.matchMedia && _win3.matchMedia("(hover: none), (pointer: coarse)").matches ? 1 : "ontouchstart" in _win3 || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 ? 2 : 0;
_eventTypes = Observer.eventTypes = ("ontouchstart" in _docEl ? "touchstart,touchmove,touchcancel,touchend" : !("onpointerdown" in _docEl) ? "mousedown,mousemove,mouseup,mouseup" : "pointerdown,pointermove,pointercancel,pointerup").split(",");
setTimeout(function() {
return _startup = 0;
}, 500);
_setScrollTrigger();
_coreInitted2 = 1;
}
return _coreInitted2;
};
_horizontal.op = _vertical;
_scrollers.cache = 0;
var Observer = /* @__PURE__ */ function() {
function Observer2(vars) {
this.init(vars);
}
var _proto = Observer2.prototype;
_proto.init = function init4(vars) {
_coreInitted2 || _initCore3(gsap2) || console.warn("Please gsap.registerPlugin(Observer)");
ScrollTrigger || _setScrollTrigger();
var tolerance = vars.tolerance, dragMinimum = vars.dragMinimum, type = vars.type, target = vars.target, lineHeight = vars.lineHeight, debounce3 = vars.debounce, preventDefault = vars.preventDefault, onStop = vars.onStop, onStopDelay = vars.onStopDelay, ignore = vars.ignore, wheelSpeed = vars.wheelSpeed, event = vars.event, onDragStart = vars.onDragStart, onDragEnd = vars.onDragEnd, onDrag = vars.onDrag, onPress = vars.onPress, onRelease = vars.onRelease, onRight = vars.onRight, onLeft = vars.onLeft, onUp = vars.onUp, onDown = vars.onDown, onChangeX = vars.onChangeX, onChangeY = vars.onChangeY, onChange = vars.onChange, onToggleX = vars.onToggleX, onToggleY = vars.onToggleY, onHover = vars.onHover, onHoverEnd = vars.onHoverEnd, onMove = vars.onMove, ignoreCheck = vars.ignoreCheck, isNormalizer = vars.isNormalizer, onGestureStart = vars.onGestureStart, onGestureEnd = vars.onGestureEnd, onWheel = vars.onWheel, onEnable = vars.onEnable, onDisable = vars.onDisable, onClick = vars.onClick, scrollSpeed = vars.scrollSpeed, capture = vars.capture, allowClicks = vars.allowClicks, lockAxis = vars.lockAxis, onLockAxis = vars.onLockAxis;
this.target = target = _getTarget(target) || _docEl;
this.vars = vars;
ignore && (ignore = gsap2.utils.toArray(ignore));
tolerance = tolerance || 1e-9;
dragMinimum = dragMinimum || 0;
wheelSpeed = wheelSpeed || 1;
scrollSpeed = scrollSpeed || 1;
type = type || "wheel,touch,pointer";
debounce3 = debounce3 !== false;
lineHeight || (lineHeight = parseFloat(_win3.getComputedStyle(_body).lineHeight) || 22);
var id, onStopDelayedCall, dragged, moved, wheeled, locked, axis, self2 = this, prevDeltaX = 0, prevDeltaY = 0, passive2 = vars.passive || !preventDefault, scrollFuncX = _getScrollFunc(target, _horizontal), scrollFuncY = _getScrollFunc(target, _vertical), scrollX = scrollFuncX(), scrollY = scrollFuncY(), limitToTouch = ~type.indexOf("touch") && !~type.indexOf("pointer") && _eventTypes[0] === "pointerdown", isViewport = _isViewport(target), ownerDoc = target.ownerDocument || _doc3, deltaX = [0, 0, 0], deltaY = [0, 0, 0], onClickTime = 0, clickCapture = function clickCapture2() {
return onClickTime = _getTime();
}, _ignoreCheck = function _ignoreCheck2(e2, isPointerOrTouch) {
return (self2.event = e2) && ignore && ~ignore.indexOf(e2.target) || isPointerOrTouch && limitToTouch && e2.pointerType !== "touch" || ignoreCheck && ignoreCheck(e2, isPointerOrTouch);
}, onStopFunc = function onStopFunc2() {
self2._vx.reset();
self2._vy.reset();
onStopDelayedCall.pause();
onStop && onStop(self2);
}, update = function update2() {
var dx = self2.deltaX = _getAbsoluteMax(deltaX), dy = self2.deltaY = _getAbsoluteMax(deltaY), changedX = Math.abs(dx) >= tolerance, changedY = Math.abs(dy) >= tolerance;
onChange && (changedX || changedY) && onChange(self2, dx, dy, deltaX, deltaY);
if (changedX) {
onRight && self2.deltaX > 0 && onRight(self2);
onLeft && self2.deltaX < 0 && onLeft(self2);
onChangeX && onChangeX(self2);
onToggleX && self2.deltaX < 0 !== prevDeltaX < 0 && onToggleX(self2);
prevDeltaX = self2.deltaX;
deltaX[0] = deltaX[1] = deltaX[2] = 0;
}
if (changedY) {
onDown && self2.deltaY > 0 && onDown(self2);
onUp && self2.deltaY < 0 && onUp(self2);
onChangeY && onChangeY(self2);
onToggleY && self2.deltaY < 0 !== prevDeltaY < 0 && onToggleY(self2);
prevDeltaY = self2.deltaY;
deltaY[0] = deltaY[1] = deltaY[2] = 0;
}
if (moved || dragged) {
onMove && onMove(self2);
if (dragged) {
onDrag(self2);
dragged = false;
}
moved = false;
}
locked && !(locked = false) && onLockAxis && onLockAxis(self2);
if (wheeled) {
onWheel(self2);
wheeled = false;
}
id = 0;
}, onDelta = function onDelta2(x, y3, index) {
deltaX[index] += x;
deltaY[index] += y3;
self2._vx.update(x);
self2._vy.update(y3);
debounce3 ? id || (id = requestAnimationFrame(update)) : update();
}, onTouchOrPointerDelta = function onTouchOrPointerDelta2(x, y3) {
if (lockAxis && !axis) {
self2.axis = axis = Math.abs(x) > Math.abs(y3) ? "x" : "y";
locked = true;
}
if (axis !== "y") {
deltaX[2] += x;
self2._vx.update(x, true);
}
if (axis !== "x") {
deltaY[2] += y3;
self2._vy.update(y3, true);
}
debounce3 ? id || (id = requestAnimationFrame(update)) : update();
}, _onDrag = function _onDrag2(e2) {
if (_ignoreCheck(e2, 1)) {
return;
}
e2 = _getEvent(e2, preventDefault);
var x = e2.clientX, y3 = e2.clientY, dx = x - self2.x, dy = y3 - self2.y, isDragging = self2.isDragging;
self2.x = x;
self2.y = y3;
if (isDragging || Math.abs(self2.startX - x) >= dragMinimum || Math.abs(self2.startY - y3) >= dragMinimum) {
onDrag && (dragged = true);
isDragging || (self2.isDragging = true);
onTouchOrPointerDelta(dx, dy);
isDragging || onDragStart && onDragStart(self2);
}
}, _onPress = self2.onPress = function(e2) {
if (_ignoreCheck(e2, 1) || e2 && e2.button) {
return;
}
self2.axis = axis = null;
onStopDelayedCall.pause();
self2.isPressed = true;
e2 = _getEvent(e2);
prevDeltaX = prevDeltaY = 0;
self2.startX = self2.x = e2.clientX;
self2.startY = self2.y = e2.clientY;
self2._vx.reset();
self2._vy.reset();
_addListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, passive2, true);
self2.deltaX = self2.deltaY = 0;
onPress && onPress(self2);
}, _onRelease = self2.onRelease = function(e2) {
if (_ignoreCheck(e2, 1)) {
return;
}
_removeListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true);
var isTrackingDrag = !isNaN(self2.y - self2.startY), wasDragging = self2.isDragging, isDragNotClick = wasDragging && (Math.abs(self2.x - self2.startX) > 3 || Math.abs(self2.y - self2.startY) > 3), eventData = _getEvent(e2);
if (!isDragNotClick && isTrackingDrag) {
self2._vx.reset();
self2._vy.reset();
if (preventDefault && allowClicks) {
gsap2.delayedCall(0.08, function() {
if (_getTime() - onClickTime > 300 && !e2.defaultPrevented) {
if (e2.target.click) {
e2.target.click();
} else if (ownerDoc.createEvent) {
var syntheticEvent = ownerDoc.createEvent("MouseEvents");
syntheticEvent.initMouseEvent("click", true, true, _win3, 1, eventData.screenX, eventData.screenY, eventData.clientX, eventData.clientY, false, false, false, false, 0, null);
e2.target.dispatchEvent(syntheticEvent);
}
}
});
}
}
self2.isDragging = self2.isGesturing = self2.isPressed = false;
onStop && wasDragging && !isNormalizer && onStopDelayedCall.restart(true);
onDragEnd && wasDragging && onDragEnd(self2);
onRelease && onRelease(self2, isDragNotClick);
}, _onGestureStart = function _onGestureStart2(e2) {
return e2.touches && e2.touches.length > 1 && (self2.isGesturing = true) && onGestureStart(e2, self2.isDragging);
}, _onGestureEnd = function _onGestureEnd2() {
return (self2.isGesturing = false) || onGestureEnd(self2);
}, onScroll = function onScroll2(e2) {
if (_ignoreCheck(e2)) {
return;
}
var x = scrollFuncX(), y3 = scrollFuncY();
onDelta((x - scrollX) * scrollSpeed, (y3 - scrollY) * scrollSpeed, 1);
scrollX = x;
scrollY = y3;
onStop && onStopDelayedCall.restart(true);
}, _onWheel = function _onWheel2(e2) {
if (_ignoreCheck(e2)) {
return;
}
e2 = _getEvent(e2, preventDefault);
onWheel && (wheeled = true);
var multiplier = (e2.deltaMode === 1 ? lineHeight : e2.deltaMode === 2 ? _win3.innerHeight : 1) * wheelSpeed;
onDelta(e2.deltaX * multiplier, e2.deltaY * multiplier, 0);
onStop && !isNormalizer && onStopDelayedCall.restart(true);
}, _onMove = function _onMove2(e2) {
if (_ignoreCheck(e2)) {
return;
}
var x = e2.clientX, y3 = e2.clientY, dx = x - self2.x, dy = y3 - self2.y;
self2.x = x;
self2.y = y3;
moved = true;
onStop && onStopDelayedCall.restart(true);
(dx || dy) && onTouchOrPointerDelta(dx, dy);
}, _onHover = function _onHover2(e2) {
self2.event = e2;
onHover(self2);
}, _onHoverEnd = function _onHoverEnd2(e2) {
self2.event = e2;
onHoverEnd(self2);
}, _onClick = function _onClick2(e2) {
return _ignoreCheck(e2) || _getEvent(e2, preventDefault) && onClick(self2);
};
onStopDelayedCall = self2._dc = gsap2.delayedCall(onStopDelay || 0.25, onStopFunc).pause();
self2.deltaX = self2.deltaY = 0;
self2._vx = _getVelocityProp(0, 50, true);
self2._vy = _getVelocityProp(0, 50, true);
self2.scrollX = scrollFuncX;
self2.scrollY = scrollFuncY;
self2.isDragging = self2.isGesturing = self2.isPressed = false;
_context2(this);
self2.enable = function(e2) {
if (!self2.isEnabled) {
_addListener(isViewport ? ownerDoc : target, "scroll", _onScroll);
type.indexOf("scroll") >= 0 && _addListener(isViewport ? ownerDoc : target, "scroll", onScroll, passive2, capture);
type.indexOf("wheel") >= 0 && _addListener(target, "wheel", _onWheel, passive2, capture);
if (type.indexOf("touch") >= 0 && _isTouch || type.indexOf("pointer") >= 0) {
_addListener(target, _eventTypes[0], _onPress, passive2, capture);
_addListener(ownerDoc, _eventTypes[2], _onRelease);
_addListener(ownerDoc, _eventTypes[3], _onRelease);
allowClicks && _addListener(target, "click", clickCapture, true, true);
onClick && _addListener(target, "click", _onClick);
onGestureStart && _addListener(ownerDoc, "gesturestart", _onGestureStart);
onGestureEnd && _addListener(ownerDoc, "gestureend", _onGestureEnd);
onHover && _addListener(target, _pointerType + "enter", _onHover);
onHoverEnd && _addListener(target, _pointerType + "leave", _onHoverEnd);
onMove && _addListener(target, _pointerType + "move", _onMove);
}
self2.isEnabled = true;
e2 && e2.type && _onPress(e2);
onEnable && onEnable(self2);
}
return self2;
};
self2.disable = function() {
if (self2.isEnabled) {
_observers.filter(function(o) {
return o !== self2 && _isViewport(o.target);
}).length || _removeListener(isViewport ? ownerDoc : target, "scroll", _onScroll);
if (self2.isPressed) {
self2._vx.reset();
self2._vy.reset();
_removeListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true);
}
_removeListener(isViewport ? ownerDoc : target, "scroll", onScroll, capture);
_removeListener(target, "wheel", _onWheel, capture);
_removeListener(target, _eventTypes[0], _onPress, capture);
_removeListener(ownerDoc, _eventTypes[2], _onRelease);
_removeListener(ownerDoc, _eventTypes[3], _onRelease);
_removeListener(target, "click", clickCapture, true);
_removeListener(target, "click", _onClick);
_removeListener(ownerDoc, "gesturestart", _onGestureStart);
_removeListener(ownerDoc, "gestureend", _onGestureEnd);
_removeListener(target, _pointerType + "enter", _onHover);
_removeListener(target, _pointerType + "leave", _onHoverEnd);
_removeListener(target, _pointerType + "move", _onMove);
self2.isEnabled = self2.isPressed = self2.isDragging = false;
onDisable && onDisable(self2);
}
};
self2.kill = self2.revert = function() {
self2.disable();
var i3 = _observers.indexOf(self2);
i3 >= 0 && _observers.splice(i3, 1);
_normalizer === self2 && (_normalizer = 0);
};
_observers.push(self2);
isNormalizer && _isViewport(target) && (_normalizer = self2);
self2.enable(event);
};
_createClass2(Observer2, [{
key: "velocityX",
get: function get() {
return this._vx.getVelocity();
}
}, {
key: "velocityY",
get: function get() {
return this._vy.getVelocity();
}
}]);
return Observer2;
}();
Observer.version = "3.12.5";
Observer.create = function(vars) {
return new Observer(vars);
};
Observer.register = _initCore3;
Observer.getAll = function() {
return _observers.slice();
};
Observer.getById = function(id) {
return _observers.filter(function(o) {
return o.vars.id === id;
})[0];
};
_getGSAP() && gsap2.registerPlugin(Observer);
// node_modules/gsap/ScrollTrigger.js
var gsap3;
var _coreInitted3;
var _win4;
var _doc4;
var _docEl2;
var _body2;
var _root2;
var _resizeDelay;
var _toArray;
var _clamp4;
var _time2;
var _syncInterval;
var _refreshing;
var _pointerIsDown;
var _transformProp2;
var _i;
var _prevWidth;
var _prevHeight;
var _autoRefresh;
var _sort;
var _suppressOverwrites2;
var _ignoreResize;
var _normalizer2;
var _ignoreMobileResize;
var _baseScreenHeight;
var _baseScreenWidth;
var _fixIOSBug;
var _context3;
var _scrollRestoration;
var _div100vh;
var _100vh;
var _isReverted;
var _clampingMax;
var _limitCallbacks;
var _startup2 = 1;
var _getTime2 = Date.now;
var _time1 = _getTime2();
var _lastScrollTime = 0;
var _enabled = 0;
var _parseClamp = function _parseClamp2(value, type, self2) {
var clamp6 = _isString3(value) && (value.substr(0, 6) === "clamp(" || value.indexOf("max") > -1);
self2["_" + type + "Clamp"] = clamp6;
return clamp6 ? value.substr(6, value.length - 7) : value;
};
var _keepClamp = function _keepClamp2(value, clamp6) {
return clamp6 && (!_isString3(value) || value.substr(0, 6) !== "clamp(") ? "clamp(" + value + ")" : value;
};
var _rafBugFix = function _rafBugFix2() {
return _enabled && requestAnimationFrame(_rafBugFix2);
};
var _pointerDownHandler = function _pointerDownHandler2() {
return _pointerIsDown = 1;
};
var _pointerUpHandler = function _pointerUpHandler2() {
return _pointerIsDown = 0;
};
var _passThrough3 = function _passThrough4(v) {
return v;
};
var _round3 = function _round4(value) {
return Math.round(value * 1e5) / 1e5 || 0;
};
var _windowExists5 = function _windowExists6() {
return typeof window !== "undefined";
};
var _getGSAP3 = function _getGSAP4() {
return gsap3 || _windowExists5() && (gsap3 = window.gsap) && gsap3.registerPlugin && gsap3;
};
var _isViewport3 = function _isViewport4(e2) {
return !!~_root2.indexOf(e2);
};
var _getViewportDimension = function _getViewportDimension2(dimensionProperty) {
return (dimensionProperty === "Height" ? _100vh : _win4["inner" + dimensionProperty]) || _docEl2["client" + dimensionProperty] || _body2["client" + dimensionProperty];
};
var _getBoundsFunc = function _getBoundsFunc2(element) {
return _getProxyProp(element, "getBoundingClientRect") || (_isViewport3(element) ? function() {
_winOffsets.width = _win4.innerWidth;
_winOffsets.height = _100vh;
return _winOffsets;
} : function() {
return _getBounds(element);
});
};
var _getSizeFunc = function _getSizeFunc2(scroller, isViewport, _ref) {
var d3 = _ref.d, d22 = _ref.d2, a = _ref.a;
return (a = _getProxyProp(scroller, "getBoundingClientRect")) ? function() {
return a()[d3];
} : function() {
return (isViewport ? _getViewportDimension(d22) : scroller["client" + d22]) || 0;
};
};
var _getOffsetsFunc = function _getOffsetsFunc2(element, isViewport) {
return !isViewport || ~_proxies.indexOf(element) ? _getBoundsFunc(element) : function() {
return _winOffsets;
};
};
var _maxScroll = function _maxScroll2(element, _ref2) {
var s2 = _ref2.s, d22 = _ref2.d2, d3 = _ref2.d, a = _ref2.a;
return Math.max(0, (s2 = "scroll" + d22) && (a = _getProxyProp(element, s2)) ? a() - _getBoundsFunc(element)()[d3] : _isViewport3(element) ? (_docEl2[s2] || _body2[s2]) - _getViewportDimension(d22) : element[s2] - element["offset" + d22]);
};
var _iterateAutoRefresh = function _iterateAutoRefresh2(func, events2) {
for (var i3 = 0; i3 < _autoRefresh.length; i3 += 3) {
(!events2 || ~events2.indexOf(_autoRefresh[i3 + 1])) && func(_autoRefresh[i3], _autoRefresh[i3 + 1], _autoRefresh[i3 + 2]);
}
};
var _isString3 = function _isString4(value) {
return typeof value === "string";
};
var _isFunction3 = function _isFunction4(value) {
return typeof value === "function";
};
var _isNumber3 = function _isNumber4(value) {
return typeof value === "number";
};
var _isObject3 = function _isObject4(value) {
return typeof value === "object";
};
var _endAnimation = function _endAnimation2(animation, reversed, pause) {
return animation && animation.progress(reversed ? 0 : 1) && pause && animation.pause();
};
var _callback3 = function _callback4(self2, func) {
if (self2.enabled) {
var result = self2._ctx ? self2._ctx.add(function() {
return func(self2);
}) : func(self2);
result && result.totalTime && (self2.callbackAnimation = result);
}
};
var _abs = Math.abs;
var _left = "left";
var _top = "top";
var _right = "right";
var _bottom = "bottom";
var _width = "width";
var _height = "height";
var _Right = "Right";
var _Left = "Left";
var _Top = "Top";
var _Bottom = "Bottom";
var _padding = "padding";
var _margin = "margin";
var _Width = "Width";
var _Height = "Height";
var _px = "px";
var _getComputedStyle = function _getComputedStyle2(element) {
return _win4.getComputedStyle(element);
};
var _makePositionable = function _makePositionable2(element) {
var position = _getComputedStyle(element).position;
element.style.position = position === "absolute" || position === "fixed" ? position : "relative";
};
var _setDefaults3 = function _setDefaults4(obj, defaults2) {
for (var p in defaults2) {
p in obj || (obj[p] = defaults2[p]);
}
return obj;
};
var _getBounds = function _getBounds2(element, withoutTransforms) {
var tween = withoutTransforms && _getComputedStyle(element)[_transformProp2] !== "matrix(1, 0, 0, 1, 0, 0)" && gsap3.to(element, {
x: 0,
y: 0,
xPercent: 0,
yPercent: 0,
rotation: 0,
rotationX: 0,
rotationY: 0,
scale: 1,
skewX: 0,
skewY: 0
}).progress(1), bounds = element.getBoundingClientRect();
tween && tween.progress(0).kill();
return bounds;
};
var _getSize = function _getSize2(element, _ref3) {
var d22 = _ref3.d2;
return element["offset" + d22] || element["client" + d22] || 0;
};
var _getLabelRatioArray = function _getLabelRatioArray2(timeline2) {
var a = [], labels = timeline2.labels, duration = timeline2.duration(), p;
for (p in labels) {
a.push(labels[p] / duration);
}
return a;
};
var _getClosestLabel = function _getClosestLabel2(animation) {
return function(value) {
return gsap3.utils.snap(_getLabelRatioArray(animation), value);
};
};
var _snapDirectional = function _snapDirectional2(snapIncrementOrArray) {
var snap3 = gsap3.utils.snap(snapIncrementOrArray), a = Array.isArray(snapIncrementOrArray) && snapIncrementOrArray.slice(0).sort(function(a2, b) {
return a2 - b;
});
return a ? function(value, direction, threshold) {
if (threshold === void 0) {
threshold = 1e-3;
}
var i3;
if (!direction) {
return snap3(value);
}
if (direction > 0) {
value -= threshold;
for (i3 = 0; i3 < a.length; i3++) {
if (a[i3] >= value) {
return a[i3];
}
}
return a[i3 - 1];
} else {
i3 = a.length;
value += threshold;
while (i3--) {
if (a[i3] <= value) {
return a[i3];
}
}
}
return a[0];
} : function(value, direction, threshold) {
if (threshold === void 0) {
threshold = 1e-3;
}
var snapped = snap3(value);
return !direction || Math.abs(snapped - value) < threshold || snapped - value < 0 === direction < 0 ? snapped : snap3(direction < 0 ? value - snapIncrementOrArray : value + snapIncrementOrArray);
};
};
var _getLabelAtDirection = function _getLabelAtDirection2(timeline2) {
return function(value, st) {
return _snapDirectional(_getLabelRatioArray(timeline2))(value, st.direction);
};
};
var _multiListener = function _multiListener2(func, element, types, callback) {
return types.split(",").forEach(function(type) {
return func(element, type, callback);
});
};
var _addListener3 = function _addListener4(element, type, func, nonPassive, capture) {
return element.addEventListener(type, func, {
passive: !nonPassive,
capture: !!capture
});
};
var _removeListener3 = function _removeListener4(element, type, func, capture) {
return element.removeEventListener(type, func, !!capture);
};
var _wheelListener = function _wheelListener2(func, el, scrollFunc) {
scrollFunc = scrollFunc && scrollFunc.wheelHandler;
if (scrollFunc) {
func(el, "wheel", scrollFunc);
func(el, "touchmove", scrollFunc);
}
};
var _markerDefaults = {
startColor: "green",
endColor: "red",
indent: 0,
fontSize: "16px",
fontWeight: "normal"
};
var _defaults2 = {
toggleActions: "play",
anticipatePin: 0
};
var _keywords = {
top: 0,
left: 0,
center: 0.5,
bottom: 1,
right: 1
};
var _offsetToPx = function _offsetToPx2(value, size) {
if (_isString3(value)) {
var eqIndex = value.indexOf("="), relative = ~eqIndex ? +(value.charAt(eqIndex - 1) + 1) * parseFloat(value.substr(eqIndex + 1)) : 0;
if (~eqIndex) {
value.indexOf("%") > eqIndex && (relative *= size / 100);
value = value.substr(0, eqIndex - 1);
}
value = relative + (value in _keywords ? _keywords[value] * size : ~value.indexOf("%") ? parseFloat(value) * size / 100 : parseFloat(value) || 0);
}
return value;
};
var _createMarker = function _createMarker2(type, name, container, direction, _ref4, offset2, matchWidthEl, containerAnimation) {
var startColor = _ref4.startColor, endColor = _ref4.endColor, fontSize = _ref4.fontSize, indent = _ref4.indent, fontWeight = _ref4.fontWeight;
var e2 = _doc4.createElement("div"), useFixedPosition = _isViewport3(container) || _getProxyProp(container, "pinType") === "fixed", isScroller = type.indexOf("scroller") !== -1, parent = useFixedPosition ? _body2 : container, isStart = type.indexOf("start") !== -1, color = isStart ? startColor : endColor, css = "border-color:" + color + ";font-size:" + fontSize + ";color:" + color + ";font-weight:" + fontWeight + ";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";
css += "position:" + ((isScroller || containerAnimation) && useFixedPosition ? "fixed;" : "absolute;");
(isScroller || containerAnimation || !useFixedPosition) && (css += (direction === _vertical ? _right : _bottom) + ":" + (offset2 + parseFloat(indent)) + "px;");
matchWidthEl && (css += "box-sizing:border-box;text-align:left;width:" + matchWidthEl.offsetWidth + "px;");
e2._isStart = isStart;
e2.setAttribute("class", "gsap-marker-" + type + (name ? " marker-" + name : ""));
e2.style.cssText = css;
e2.innerText = name || name === 0 ? type + "-" + name : type;
parent.children[0] ? parent.insertBefore(e2, parent.children[0]) : parent.appendChild(e2);
e2._offset = e2["offset" + direction.op.d2];
_positionMarker(e2, 0, direction, isStart);
return e2;
};
var _positionMarker = function _positionMarker2(marker, start3, direction, flipped) {
var vars = {
display: "block"
}, side = direction[flipped ? "os2" : "p2"], oppositeSide = direction[flipped ? "p2" : "os2"];
marker._isFlipped = flipped;
vars[direction.a + "Percent"] = flipped ? -100 : 0;
vars[direction.a] = flipped ? "1px" : 0;
vars["border" + side + _Width] = 1;
vars["border" + oppositeSide + _Width] = 0;
vars[direction.p] = start3 + "px";
gsap3.set(marker, vars);
};
var _triggers = [];
var _ids = {};
var _rafID;
var _sync = function _sync2() {
return _getTime2() - _lastScrollTime > 34 && (_rafID || (_rafID = requestAnimationFrame(_updateAll)));
};
var _onScroll3 = function _onScroll4() {
if (!_normalizer2 || !_normalizer2.isPressed || _normalizer2.startX > _body2.clientWidth) {
_scrollers.cache++;
if (_normalizer2) {
_rafID || (_rafID = requestAnimationFrame(_updateAll));
} else {
_updateAll();
}
_lastScrollTime || _dispatch3("scrollStart");
_lastScrollTime = _getTime2();
}
};
var _setBaseDimensions = function _setBaseDimensions2() {
_baseScreenWidth = _win4.innerWidth;
_baseScreenHeight = _win4.innerHeight;
};
var _onResize = function _onResize2() {
_scrollers.cache++;
!_refreshing && !_ignoreResize && !_doc4.fullscreenElement && !_doc4.webkitFullscreenElement && (!_ignoreMobileResize || _baseScreenWidth !== _win4.innerWidth || Math.abs(_win4.innerHeight - _baseScreenHeight) > _win4.innerHeight * 0.25) && _resizeDelay.restart(true);
};
var _listeners2 = {};
var _emptyArray2 = [];
var _softRefresh = function _softRefresh2() {
return _removeListener3(ScrollTrigger2, "scrollEnd", _softRefresh2) || _refreshAll(true);
};
var _dispatch3 = function _dispatch4(type) {
return _listeners2[type] && _listeners2[type].map(function(f) {
return f();
}) || _emptyArray2;
};
var _savedStyles = [];
var _revertRecorded = function _revertRecorded2(media) {
for (var i3 = 0; i3 < _savedStyles.length; i3 += 5) {
if (!media || _savedStyles[i3 + 4] && _savedStyles[i3 + 4].query === media) {
_savedStyles[i3].style.cssText = _savedStyles[i3 + 1];
_savedStyles[i3].getBBox && _savedStyles[i3].setAttribute("transform", _savedStyles[i3 + 2] || "");
_savedStyles[i3 + 3].uncache = 1;
}
}
};
var _revertAll = function _revertAll2(kill, media) {
var trigger;
for (_i = 0; _i < _triggers.length; _i++) {
trigger = _triggers[_i];
if (trigger && (!media || trigger._ctx === media)) {
if (kill) {
trigger.kill(1);
} else {
trigger.revert(true, true);
}
}
}
_isReverted = true;
media && _revertRecorded(media);
media || _dispatch3("revert");
};
var _clearScrollMemory = function _clearScrollMemory2(scrollRestoration, force) {
_scrollers.cache++;
(force || !_refreshingAll) && _scrollers.forEach(function(obj) {
return _isFunction3(obj) && obj.cacheID++ && (obj.rec = 0);
});
_isString3(scrollRestoration) && (_win4.history.scrollRestoration = _scrollRestoration = scrollRestoration);
};
var _refreshingAll;
var _refreshID = 0;
var _queueRefreshID;
var _queueRefreshAll = function _queueRefreshAll2() {
if (_queueRefreshID !== _refreshID) {
var id = _queueRefreshID = _refreshID;
requestAnimationFrame(function() {
return id === _refreshID && _refreshAll(true);
});
}
};
var _refresh100vh = function _refresh100vh2() {
_body2.appendChild(_div100vh);
_100vh = !_normalizer2 && _div100vh.offsetHeight || _win4.innerHeight;
_body2.removeChild(_div100vh);
};
var _hideAllMarkers = function _hideAllMarkers2(hide2) {
return _toArray(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(el) {
return el.style.display = hide2 ? "none" : "block";
});
};
var _refreshAll = function _refreshAll2(force, skipRevert) {
if (_lastScrollTime && !force && !_isReverted) {
_addListener3(ScrollTrigger2, "scrollEnd", _softRefresh);
return;
}
_refresh100vh();
_refreshingAll = ScrollTrigger2.isRefreshing = true;
_scrollers.forEach(function(obj) {
return _isFunction3(obj) && ++obj.cacheID && (obj.rec = obj());
});
var refreshInits = _dispatch3("refreshInit");
_sort && ScrollTrigger2.sort();
skipRevert || _revertAll();
_scrollers.forEach(function(obj) {
if (_isFunction3(obj)) {
obj.smooth && (obj.target.style.scrollBehavior = "auto");
obj(0);
}
});
_triggers.slice(0).forEach(function(t3) {
return t3.refresh();
});
_isReverted = false;
_triggers.forEach(function(t3) {
if (t3._subPinOffset && t3.pin) {
var prop = t3.vars.horizontal ? "offsetWidth" : "offsetHeight", original = t3.pin[prop];
t3.revert(true, 1);
t3.adjustPinSpacing(t3.pin[prop] - original);
t3.refresh();
}
});
_clampingMax = 1;
_hideAllMarkers(true);
_triggers.forEach(function(t3) {
var max4 = _maxScroll(t3.scroller, t3._dir), endClamp = t3.vars.end === "max" || t3._endClamp && t3.end > max4, startClamp = t3._startClamp && t3.start >= max4;
(endClamp || startClamp) && t3.setPositions(startClamp ? max4 - 1 : t3.start, endClamp ? Math.max(startClamp ? max4 : t3.start + 1, max4) : t3.end, true);
});
_hideAllMarkers(false);
_clampingMax = 0;
refreshInits.forEach(function(result) {
return result && result.render && result.render(-1);
});
_scrollers.forEach(function(obj) {
if (_isFunction3(obj)) {
obj.smooth && requestAnimationFrame(function() {
return obj.target.style.scrollBehavior = "smooth";
});
obj.rec && obj(obj.rec);
}
});
_clearScrollMemory(_scrollRestoration, 1);
_resizeDelay.pause();
_refreshID++;
_refreshingAll = 2;
_updateAll(2);
_triggers.forEach(function(t3) {
return _isFunction3(t3.vars.onRefresh) && t3.vars.onRefresh(t3);
});
_refreshingAll = ScrollTrigger2.isRefreshing = false;
_dispatch3("refresh");
};
var _lastScroll = 0;
var _direction = 1;
var _primary;
var _updateAll = function _updateAll2(force) {
if (force === 2 || !_refreshingAll && !_isReverted) {
ScrollTrigger2.isUpdating = true;
_primary && _primary.update(0);
var l = _triggers.length, time = _getTime2(), recordVelocity = time - _time1 >= 50, scroll = l && _triggers[0].scroll();
_direction = _lastScroll > scroll ? -1 : 1;
_refreshingAll || (_lastScroll = scroll);
if (recordVelocity) {
if (_lastScrollTime && !_pointerIsDown && time - _lastScrollTime > 200) {
_lastScrollTime = 0;
_dispatch3("scrollEnd");
}
_time2 = _time1;
_time1 = time;
}
if (_direction < 0) {
_i = l;
while (_i-- > 0) {
_triggers[_i] && _triggers[_i].update(0, recordVelocity);
}
_direction = 1;
} else {
for (_i = 0; _i < l; _i++) {
_triggers[_i] && _triggers[_i].update(0, recordVelocity);
}
}
ScrollTrigger2.isUpdating = false;
}
_rafID = 0;
};
var _propNamesToCopy = [_left, _top, _bottom, _right, _margin + _Bottom, _margin + _Right, _margin + _Top, _margin + _Left, "display", "flexShrink", "float", "zIndex", "gridColumnStart", "gridColumnEnd", "gridRowStart", "gridRowEnd", "gridArea", "justifySelf", "alignSelf", "placeSelf", "order"];
var _stateProps = _propNamesToCopy.concat([_width, _height, "boxSizing", "max" + _Width, "max" + _Height, "position", _margin, _padding, _padding + _Top, _padding + _Right, _padding + _Bottom, _padding + _Left]);
var _swapPinOut = function _swapPinOut2(pin, spacer, state) {
_setState(state);
var cache = pin._gsap;
if (cache.spacerIsNative) {
_setState(cache.spacerState);
} else if (pin._gsap.swappedIn) {
var parent = spacer.parentNode;
if (parent) {
parent.insertBefore(pin, spacer);
parent.removeChild(spacer);
}
}
pin._gsap.swappedIn = false;
};
var _swapPinIn = function _swapPinIn2(pin, spacer, cs, spacerState) {
if (!pin._gsap.swappedIn) {
var i3 = _propNamesToCopy.length, spacerStyle = spacer.style, pinStyle = pin.style, p;
while (i3--) {
p = _propNamesToCopy[i3];
spacerStyle[p] = cs[p];
}
spacerStyle.position = cs.position === "absolute" ? "absolute" : "relative";
cs.display === "inline" && (spacerStyle.display = "inline-block");
pinStyle[_bottom] = pinStyle[_right] = "auto";
spacerStyle.flexBasis = cs.flexBasis || "auto";
spacerStyle.overflow = "visible";
spacerStyle.boxSizing = "border-box";
spacerStyle[_width] = _getSize(pin, _horizontal) + _px;
spacerStyle[_height] = _getSize(pin, _vertical) + _px;
spacerStyle[_padding] = pinStyle[_margin] = pinStyle[_top] = pinStyle[_left] = "0";
_setState(spacerState);
pinStyle[_width] = pinStyle["max" + _Width] = cs[_width];
pinStyle[_height] = pinStyle["max" + _Height] = cs[_height];
pinStyle[_padding] = cs[_padding];
if (pin.parentNode !== spacer) {
pin.parentNode.insertBefore(spacer, pin);
spacer.appendChild(pin);
}
pin._gsap.swappedIn = true;
}
};
var _capsExp2 = /([A-Z])/g;
var _setState = function _setState2(state) {
if (state) {
var style2 = state.t.style, l = state.length, i3 = 0, p, value;
(state.t._gsap || gsap3.core.getCache(state.t)).uncache = 1;
for (; i3 < l; i3 += 2) {
value = state[i3 + 1];
p = state[i3];
if (value) {
style2[p] = value;
} else if (style2[p]) {
style2.removeProperty(p.replace(_capsExp2, "-$1").toLowerCase());
}
}
}
};
var _getState = function _getState2(element) {
var l = _stateProps.length, style2 = element.style, state = [], i3 = 0;
for (; i3 < l; i3++) {
state.push(_stateProps[i3], style2[_stateProps[i3]]);
}
state.t = element;
return state;
};
var _copyState = function _copyState2(state, override, omitOffsets) {
var result = [], l = state.length, i3 = omitOffsets ? 8 : 0, p;
for (; i3 < l; i3 += 2) {
p = state[i3];
result.push(p, p in override ? override[p] : state[i3 + 1]);
}
result.t = state.t;
return result;
};
var _winOffsets = {
left: 0,
top: 0
};
var _parsePosition3 = function _parsePosition4(value, trigger, scrollerSize, direction, scroll, marker, markerScroller, self2, scrollerBounds, borderWidth, useFixedPosition, scrollerMax, containerAnimation, clampZeroProp) {
_isFunction3(value) && (value = value(self2));
if (_isString3(value) && value.substr(0, 3) === "max") {
value = scrollerMax + (value.charAt(4) === "=" ? _offsetToPx("0" + value.substr(3), scrollerSize) : 0);
}
var time = containerAnimation ? containerAnimation.time() : 0, p1, p2, element;
containerAnimation && containerAnimation.seek(0);
isNaN(value) || (value = +value);
if (!_isNumber3(value)) {
_isFunction3(trigger) && (trigger = trigger(self2));
var offsets = (value || "0").split(" "), bounds, localOffset, globalOffset, display2;
element = _getTarget(trigger, self2) || _body2;
bounds = _getBounds(element) || {};
if ((!bounds || !bounds.left && !bounds.top) && _getComputedStyle(element).display === "none") {
display2 = element.style.display;
element.style.display = "block";
bounds = _getBounds(element);
display2 ? element.style.display = display2 : element.style.removeProperty("display");
}
localOffset = _offsetToPx(offsets[0], bounds[direction.d]);
globalOffset = _offsetToPx(offsets[1] || "0", scrollerSize);
value = bounds[direction.p] - scrollerBounds[direction.p] - borderWidth + localOffset + scroll - globalOffset;
markerScroller && _positionMarker(markerScroller, globalOffset, direction, scrollerSize - globalOffset < 20 || markerScroller._isStart && globalOffset > 20);
scrollerSize -= scrollerSize - globalOffset;
} else {
containerAnimation && (value = gsap3.utils.mapRange(containerAnimation.scrollTrigger.start, containerAnimation.scrollTrigger.end, 0, scrollerMax, value));
markerScroller && _positionMarker(markerScroller, scrollerSize, direction, true);
}
if (clampZeroProp) {
self2[clampZeroProp] = value || -1e-3;
value < 0 && (value = 0);
}
if (marker) {
var position = value + scrollerSize, isStart = marker._isStart;
p1 = "scroll" + direction.d2;
_positionMarker(marker, position, direction, isStart && position > 20 || !isStart && (useFixedPosition ? Math.max(_body2[p1], _docEl2[p1]) : marker.parentNode[p1]) <= position + 1);
if (useFixedPosition) {
scrollerBounds = _getBounds(markerScroller);
useFixedPosition && (marker.style[direction.op.p] = scrollerBounds[direction.op.p] - direction.op.m - marker._offset + _px);
}
}
if (containerAnimation && element) {
p1 = _getBounds(element);
containerAnimation.seek(scrollerMax);
p2 = _getBounds(element);
containerAnimation._caScrollDist = p1[direction.p] - p2[direction.p];
value = value / containerAnimation._caScrollDist * scrollerMax;
}
containerAnimation && containerAnimation.seek(time);
return containerAnimation ? value : Math.round(value);
};
var _prefixExp = /(webkit|moz|length|cssText|inset)/i;
var _reparent = function _reparent2(element, parent, top2, left2) {
if (element.parentNode !== parent) {
var style2 = element.style, p, cs;
if (parent === _body2) {
element._stOrig = style2.cssText;
cs = _getComputedStyle(element);
for (p in cs) {
if (!+p && !_prefixExp.test(p) && cs[p] && typeof style2[p] === "string" && p !== "0") {
style2[p] = cs[p];
}
}
style2.top = top2;
style2.left = left2;
} else {
style2.cssText = element._stOrig;
}
gsap3.core.getCache(element).uncache = 1;
parent.appendChild(element);
}
};
var _interruptionTracker = function _interruptionTracker2(getValueFunc, initialValue, onInterrupt) {
var last1 = initialValue, last2 = last1;
return function(value) {
var current = Math.round(getValueFunc());
if (current !== last1 && current !== last2 && Math.abs(current - last1) > 3 && Math.abs(current - last2) > 3) {
value = current;
onInterrupt && onInterrupt();
}
last2 = last1;
last1 = value;
return value;
};
};
var _shiftMarker = function _shiftMarker2(marker, direction, value) {
var vars = {};
vars[direction.p] = "+=" + value;
gsap3.set(marker, vars);
};
var _getTweenCreator = function _getTweenCreator2(scroller, direction) {
var getScroll = _getScrollFunc(scroller, direction), prop = "_scroll" + direction.p2, getTween = function getTween2(scrollTo, vars, initialValue, change1, change2) {
var tween = getTween2.tween, onComplete = vars.onComplete, modifiers = {};
initialValue = initialValue || getScroll();
var checkForInterruption = _interruptionTracker(getScroll, initialValue, function() {
tween.kill();
getTween2.tween = 0;
});
change2 = change1 && change2 || 0;
change1 = change1 || scrollTo - initialValue;
tween && tween.kill();
vars[prop] = scrollTo;
vars.inherit = false;
vars.modifiers = modifiers;
modifiers[prop] = function() {
return checkForInterruption(initialValue + change1 * tween.ratio + change2 * tween.ratio * tween.ratio);
};
vars.onUpdate = function() {
_scrollers.cache++;
getTween2.tween && _updateAll();
};
vars.onComplete = function() {
getTween2.tween = 0;
onComplete && onComplete.call(tween);
};
tween = getTween2.tween = gsap3.to(scroller, vars);
return tween;
};
scroller[prop] = getScroll;
getScroll.wheelHandler = function() {
return getTween.tween && getTween.tween.kill() && (getTween.tween = 0);
};
_addListener3(scroller, "wheel", getScroll.wheelHandler);
ScrollTrigger2.isTouch && _addListener3(scroller, "touchmove", getScroll.wheelHandler);
return getTween;
};
var ScrollTrigger2 = /* @__PURE__ */ function() {
function ScrollTrigger3(vars, animation) {
_coreInitted3 || ScrollTrigger3.register(gsap3) || console.warn("Please gsap.registerPlugin(ScrollTrigger)");
_context3(this);
this.init(vars, animation);
}
var _proto = ScrollTrigger3.prototype;
_proto.init = function init4(vars, animation) {
this.progress = this.start = 0;
this.vars && this.kill(true, true);
if (!_enabled) {
this.update = this.refresh = this.kill = _passThrough3;
return;
}
vars = _setDefaults3(_isString3(vars) || _isNumber3(vars) || vars.nodeType ? {
trigger: vars
} : vars, _defaults2);
var _vars = vars, onUpdate = _vars.onUpdate, toggleClass3 = _vars.toggleClass, id = _vars.id, onToggle = _vars.onToggle, onRefresh = _vars.onRefresh, scrub = _vars.scrub, trigger = _vars.trigger, pin = _vars.pin, pinSpacing = _vars.pinSpacing, invalidateOnRefresh = _vars.invalidateOnRefresh, anticipatePin = _vars.anticipatePin, onScrubComplete = _vars.onScrubComplete, onSnapComplete = _vars.onSnapComplete, once = _vars.once, snap3 = _vars.snap, pinReparent = _vars.pinReparent, pinSpacer = _vars.pinSpacer, containerAnimation = _vars.containerAnimation, fastScrollEnd = _vars.fastScrollEnd, preventOverlaps = _vars.preventOverlaps, direction = vars.horizontal || vars.containerAnimation && vars.horizontal !== false ? _horizontal : _vertical, isToggle = !scrub && scrub !== 0, scroller = _getTarget(vars.scroller || _win4), scrollerCache = gsap3.core.getCache(scroller), isViewport = _isViewport3(scroller), useFixedPosition = ("pinType" in vars ? vars.pinType : _getProxyProp(scroller, "pinType") || isViewport && "fixed") === "fixed", callbacks = [vars.onEnter, vars.onLeave, vars.onEnterBack, vars.onLeaveBack], toggleActions = isToggle && vars.toggleActions.split(" "), markers = "markers" in vars ? vars.markers : _defaults2.markers, borderWidth = isViewport ? 0 : parseFloat(_getComputedStyle(scroller)["border" + direction.p2 + _Width]) || 0, self2 = this, onRefreshInit = vars.onRefreshInit && function() {
return vars.onRefreshInit(self2);
}, getScrollerSize = _getSizeFunc(scroller, isViewport, direction), getScrollerOffsets = _getOffsetsFunc(scroller, isViewport), lastSnap = 0, lastRefresh = 0, prevProgress = 0, scrollFunc = _getScrollFunc(scroller, direction), tweenTo, pinCache, snapFunc, scroll1, scroll2, start3, end2, markerStart, markerEnd, markerStartTrigger, markerEndTrigger, markerVars, executingOnRefresh, change, pinOriginalState, pinActiveState, pinState, spacer, offset2, pinGetter, pinSetter, pinStart, pinChange, spacingStart, spacerState, markerStartSetter, pinMoves, markerEndSetter, cs, snap1, snap22, scrubTween, scrubSmooth, snapDurClamp, snapDelayedCall, prevScroll, prevAnimProgress, caMarkerSetter, customRevertReturn;
self2._startClamp = self2._endClamp = false;
self2._dir = direction;
anticipatePin *= 45;
self2.scroller = scroller;
self2.scroll = containerAnimation ? containerAnimation.time.bind(containerAnimation) : scrollFunc;
scroll1 = scrollFunc();
self2.vars = vars;
animation = animation || vars.animation;
if ("refreshPriority" in vars) {
_sort = 1;
vars.refreshPriority === -9999 && (_primary = self2);
}
scrollerCache.tweenScroll = scrollerCache.tweenScroll || {
top: _getTweenCreator(scroller, _vertical),
left: _getTweenCreator(scroller, _horizontal)
};
self2.tweenTo = tweenTo = scrollerCache.tweenScroll[direction.p];
self2.scrubDuration = function(value) {
scrubSmooth = _isNumber3(value) && value;
if (!scrubSmooth) {
scrubTween && scrubTween.progress(1).kill();
scrubTween = 0;
} else {
scrubTween ? scrubTween.duration(value) : scrubTween = gsap3.to(animation, {
ease: "expo",
totalProgress: "+=0",
inherit: false,
duration: scrubSmooth,
paused: true,
onComplete: function onComplete() {
return onScrubComplete && onScrubComplete(self2);
}
});
}
};
if (animation) {
animation.vars.lazy = false;
animation._initted && !self2.isReverted || animation.vars.immediateRender !== false && vars.immediateRender !== false && animation.duration() && animation.render(0, true, true);
self2.animation = animation.pause();
animation.scrollTrigger = self2;
self2.scrubDuration(scrub);
snap1 = 0;
id || (id = animation.vars.id);
}
if (snap3) {
if (!_isObject3(snap3) || snap3.push) {
snap3 = {
snapTo: snap3
};
}
"scrollBehavior" in _body2.style && gsap3.set(isViewport ? [_body2, _docEl2] : scroller, {
scrollBehavior: "auto"
});
_scrollers.forEach(function(o) {
return _isFunction3(o) && o.target === (isViewport ? _doc4.scrollingElement || _docEl2 : scroller) && (o.smooth = false);
});
snapFunc = _isFunction3(snap3.snapTo) ? snap3.snapTo : snap3.snapTo === "labels" ? _getClosestLabel(animation) : snap3.snapTo === "labelsDirectional" ? _getLabelAtDirection(animation) : snap3.directional !== false ? function(value, st) {
return _snapDirectional(snap3.snapTo)(value, _getTime2() - lastRefresh < 500 ? 0 : st.direction);
} : gsap3.utils.snap(snap3.snapTo);
snapDurClamp = snap3.duration || {
min: 0.1,
max: 2
};
snapDurClamp = _isObject3(snapDurClamp) ? _clamp4(snapDurClamp.min, snapDurClamp.max) : _clamp4(snapDurClamp, snapDurClamp);
snapDelayedCall = gsap3.delayedCall(snap3.delay || scrubSmooth / 2 || 0.1, function() {
var scroll = scrollFunc(), refreshedRecently = _getTime2() - lastRefresh < 500, tween = tweenTo.tween;
if ((refreshedRecently || Math.abs(self2.getVelocity()) < 10) && !tween && !_pointerIsDown && lastSnap !== scroll) {
var progress = (scroll - start3) / change, totalProgress = animation && !isToggle ? animation.totalProgress() : progress, velocity = refreshedRecently ? 0 : (totalProgress - snap22) / (_getTime2() - _time2) * 1e3 || 0, change1 = gsap3.utils.clamp(-progress, 1 - progress, _abs(velocity / 2) * velocity / 0.185), naturalEnd = progress + (snap3.inertia === false ? 0 : change1), endValue, endScroll, _snap = snap3, onStart = _snap.onStart, _onInterrupt = _snap.onInterrupt, _onComplete = _snap.onComplete;
endValue = snapFunc(naturalEnd, self2);
_isNumber3(endValue) || (endValue = naturalEnd);
endScroll = Math.round(start3 + endValue * change);
if (scroll <= end2 && scroll >= start3 && endScroll !== scroll) {
if (tween && !tween._initted && tween.data <= _abs(endScroll - scroll)) {
return;
}
if (snap3.inertia === false) {
change1 = endValue - progress;
}
tweenTo(endScroll, {
duration: snapDurClamp(_abs(Math.max(_abs(naturalEnd - totalProgress), _abs(endValue - totalProgress)) * 0.185 / velocity / 0.05 || 0)),
ease: snap3.ease || "power3",
data: _abs(endScroll - scroll),
// record the distance so that if another snap tween occurs (conflict) we can prioritize the closest snap.
onInterrupt: function onInterrupt() {
return snapDelayedCall.restart(true) && _onInterrupt && _onInterrupt(self2);
},
onComplete: function onComplete() {
self2.update();
lastSnap = scrollFunc();
if (animation) {
scrubTween ? scrubTween.resetTo("totalProgress", endValue, animation._tTime / animation._tDur) : animation.progress(endValue);
}
snap1 = snap22 = animation && !isToggle ? animation.totalProgress() : self2.progress;
onSnapComplete && onSnapComplete(self2);
_onComplete && _onComplete(self2);
}
}, scroll, change1 * change, endScroll - scroll - change1 * change);
onStart && onStart(self2, tweenTo.tween);
}
} else if (self2.isActive && lastSnap !== scroll) {
snapDelayedCall.restart(true);
}
}).pause();
}
id && (_ids[id] = self2);
trigger = self2.trigger = _getTarget(trigger || pin !== true && pin);
customRevertReturn = trigger && trigger._gsap && trigger._gsap.stRevert;
customRevertReturn && (customRevertReturn = customRevertReturn(self2));
pin = pin === true ? trigger : _getTarget(pin);
_isString3(toggleClass3) && (toggleClass3 = {
targets: trigger,
className: toggleClass3
});
if (pin) {
pinSpacing === false || pinSpacing === _margin || (pinSpacing = !pinSpacing && pin.parentNode && pin.parentNode.style && _getComputedStyle(pin.parentNode).display === "flex" ? false : _padding);
self2.pin = pin;
pinCache = gsap3.core.getCache(pin);
if (!pinCache.spacer) {
if (pinSpacer) {
pinSpacer = _getTarget(pinSpacer);
pinSpacer && !pinSpacer.nodeType && (pinSpacer = pinSpacer.current || pinSpacer.nativeElement);
pinCache.spacerIsNative = !!pinSpacer;
pinSpacer && (pinCache.spacerState = _getState(pinSpacer));
}
pinCache.spacer = spacer = pinSpacer || _doc4.createElement("div");
spacer.classList.add("pin-spacer");
id && spacer.classList.add("pin-spacer-" + id);
pinCache.pinState = pinOriginalState = _getState(pin);
} else {
pinOriginalState = pinCache.pinState;
}
vars.force3D !== false && gsap3.set(pin, {
force3D: true
});
self2.spacer = spacer = pinCache.spacer;
cs = _getComputedStyle(pin);
spacingStart = cs[pinSpacing + direction.os2];
pinGetter = gsap3.getProperty(pin);
pinSetter = gsap3.quickSetter(pin, direction.a, _px);
_swapPinIn(pin, spacer, cs);
pinState = _getState(pin);
}
if (markers) {
markerVars = _isObject3(markers) ? _setDefaults3(markers, _markerDefaults) : _markerDefaults;
markerStartTrigger = _createMarker("scroller-start", id, scroller, direction, markerVars, 0);
markerEndTrigger = _createMarker("scroller-end", id, scroller, direction, markerVars, 0, markerStartTrigger);
offset2 = markerStartTrigger["offset" + direction.op.d2];
var content = _getTarget(_getProxyProp(scroller, "content") || scroller);
markerStart = this.markerStart = _createMarker("start", id, content, direction, markerVars, offset2, 0, containerAnimation);
markerEnd = this.markerEnd = _createMarker("end", id, content, direction, markerVars, offset2, 0, containerAnimation);
containerAnimation && (caMarkerSetter = gsap3.quickSetter([markerStart, markerEnd], direction.a, _px));
if (!useFixedPosition && !(_proxies.length && _getProxyProp(scroller, "fixedMarkers") === true)) {
_makePositionable(isViewport ? _body2 : scroller);
gsap3.set([markerStartTrigger, markerEndTrigger], {
force3D: true
});
markerStartSetter = gsap3.quickSetter(markerStartTrigger, direction.a, _px);
markerEndSetter = gsap3.quickSetter(markerEndTrigger, direction.a, _px);
}
}
if (containerAnimation) {
var oldOnUpdate = containerAnimation.vars.onUpdate, oldParams = containerAnimation.vars.onUpdateParams;
containerAnimation.eventCallback("onUpdate", function() {
self2.update(0, 0, 1);
oldOnUpdate && oldOnUpdate.apply(containerAnimation, oldParams || []);
});
}
self2.previous = function() {
return _triggers[_triggers.indexOf(self2) - 1];
};
self2.next = function() {
return _triggers[_triggers.indexOf(self2) + 1];
};
self2.revert = function(revert, temp) {
if (!temp) {
return self2.kill(true);
}
var r = revert !== false || !self2.enabled, prevRefreshing = _refreshing;
if (r !== self2.isReverted) {
if (r) {
prevScroll = Math.max(scrollFunc(), self2.scroll.rec || 0);
prevProgress = self2.progress;
prevAnimProgress = animation && animation.progress();
}
markerStart && [markerStart, markerEnd, markerStartTrigger, markerEndTrigger].forEach(function(m3) {
return m3.style.display = r ? "none" : "block";
});
if (r) {
_refreshing = self2;
self2.update(r);
}
if (pin && (!pinReparent || !self2.isActive)) {
if (r) {
_swapPinOut(pin, spacer, pinOriginalState);
} else {
_swapPinIn(pin, spacer, _getComputedStyle(pin), spacerState);
}
}
r || self2.update(r);
_refreshing = prevRefreshing;
self2.isReverted = r;
}
};
self2.refresh = function(soft, force, position, pinOffset) {
if ((_refreshing || !self2.enabled) && !force) {
return;
}
if (pin && soft && _lastScrollTime) {
_addListener3(ScrollTrigger3, "scrollEnd", _softRefresh);
return;
}
!_refreshingAll && onRefreshInit && onRefreshInit(self2);
_refreshing = self2;
if (tweenTo.tween && !position) {
tweenTo.tween.kill();
tweenTo.tween = 0;
}
scrubTween && scrubTween.pause();
invalidateOnRefresh && animation && animation.revert({
kill: false
}).invalidate();
self2.isReverted || self2.revert(true, true);
self2._subPinOffset = false;
var size = getScrollerSize(), scrollerBounds = getScrollerOffsets(), max4 = containerAnimation ? containerAnimation.duration() : _maxScroll(scroller, direction), isFirstRefresh = change <= 0.01, offset3 = 0, otherPinOffset = pinOffset || 0, parsedEnd = _isObject3(position) ? position.end : vars.end, parsedEndTrigger = vars.endTrigger || trigger, parsedStart = _isObject3(position) ? position.start : vars.start || (vars.start === 0 || !trigger ? 0 : pin ? "0 0" : "0 100%"), pinnedContainer = self2.pinnedContainer = vars.pinnedContainer && _getTarget(vars.pinnedContainer, self2), triggerIndex = trigger && Math.max(0, _triggers.indexOf(self2)) || 0, i3 = triggerIndex, cs2, bounds, scroll, isVertical, override, curTrigger, curPin, oppositeScroll, initted, revertedPins, forcedOverflow, markerStartOffset, markerEndOffset;
if (markers && _isObject3(position)) {
markerStartOffset = gsap3.getProperty(markerStartTrigger, direction.p);
markerEndOffset = gsap3.getProperty(markerEndTrigger, direction.p);
}
while (i3--) {
curTrigger = _triggers[i3];
curTrigger.end || curTrigger.refresh(0, 1) || (_refreshing = self2);
curPin = curTrigger.pin;
if (curPin && (curPin === trigger || curPin === pin || curPin === pinnedContainer) && !curTrigger.isReverted) {
revertedPins || (revertedPins = []);
revertedPins.unshift(curTrigger);
curTrigger.revert(true, true);
}
if (curTrigger !== _triggers[i3]) {
triggerIndex--;
i3--;
}
}
_isFunction3(parsedStart) && (parsedStart = parsedStart(self2));
parsedStart = _parseClamp(parsedStart, "start", self2);
start3 = _parsePosition3(parsedStart, trigger, size, direction, scrollFunc(), markerStart, markerStartTrigger, self2, scrollerBounds, borderWidth, useFixedPosition, max4, containerAnimation, self2._startClamp && "_startClamp") || (pin ? -1e-3 : 0);
_isFunction3(parsedEnd) && (parsedEnd = parsedEnd(self2));
if (_isString3(parsedEnd) && !parsedEnd.indexOf("+=")) {
if (~parsedEnd.indexOf(" ")) {
parsedEnd = (_isString3(parsedStart) ? parsedStart.split(" ")[0] : "") + parsedEnd;
} else {
offset3 = _offsetToPx(parsedEnd.substr(2), size);
parsedEnd = _isString3(parsedStart) ? parsedStart : (containerAnimation ? gsap3.utils.mapRange(0, containerAnimation.duration(), containerAnimation.scrollTrigger.start, containerAnimation.scrollTrigger.end, start3) : start3) + offset3;
parsedEndTrigger = trigger;
}
}
parsedEnd = _parseClamp(parsedEnd, "end", self2);
end2 = Math.max(start3, _parsePosition3(parsedEnd || (parsedEndTrigger ? "100% 0" : max4), parsedEndTrigger, size, direction, scrollFunc() + offset3, markerEnd, markerEndTrigger, self2, scrollerBounds, borderWidth, useFixedPosition, max4, containerAnimation, self2._endClamp && "_endClamp")) || -1e-3;
offset3 = 0;
i3 = triggerIndex;
while (i3--) {
curTrigger = _triggers[i3];
curPin = curTrigger.pin;
if (curPin && curTrigger.start - curTrigger._pinPush <= start3 && !containerAnimation && curTrigger.end > 0) {
cs2 = curTrigger.end - (self2._startClamp ? Math.max(0, curTrigger.start) : curTrigger.start);
if ((curPin === trigger && curTrigger.start - curTrigger._pinPush < start3 || curPin === pinnedContainer) && isNaN(parsedStart)) {
offset3 += cs2 * (1 - curTrigger.progress);
}
curPin === pin && (otherPinOffset += cs2);
}
}
start3 += offset3;
end2 += offset3;
self2._startClamp && (self2._startClamp += offset3);
if (self2._endClamp && !_refreshingAll) {
self2._endClamp = end2 || -1e-3;
end2 = Math.min(end2, _maxScroll(scroller, direction));
}
change = end2 - start3 || (start3 -= 0.01) && 1e-3;
if (isFirstRefresh) {
prevProgress = gsap3.utils.clamp(0, 1, gsap3.utils.normalize(start3, end2, prevScroll));
}
self2._pinPush = otherPinOffset;
if (markerStart && offset3) {
cs2 = {};
cs2[direction.a] = "+=" + offset3;
pinnedContainer && (cs2[direction.p] = "-=" + scrollFunc());
gsap3.set([markerStart, markerEnd], cs2);
}
if (pin && !(_clampingMax && self2.end >= _maxScroll(scroller, direction))) {
cs2 = _getComputedStyle(pin);
isVertical = direction === _vertical;
scroll = scrollFunc();
pinStart = parseFloat(pinGetter(direction.a)) + otherPinOffset;
if (!max4 && end2 > 1) {
forcedOverflow = (isViewport ? _doc4.scrollingElement || _docEl2 : scroller).style;
forcedOverflow = {
style: forcedOverflow,
value: forcedOverflow["overflow" + direction.a.toUpperCase()]
};
if (isViewport && _getComputedStyle(_body2)["overflow" + direction.a.toUpperCase()] !== "scroll") {
forcedOverflow.style["overflow" + direction.a.toUpperCase()] = "scroll";
}
}
_swapPinIn(pin, spacer, cs2);
pinState = _getState(pin);
bounds = _getBounds(pin, true);
oppositeScroll = useFixedPosition && _getScrollFunc(scroller, isVertical ? _horizontal : _vertical)();
if (pinSpacing) {
spacerState = [pinSpacing + direction.os2, change + otherPinOffset + _px];
spacerState.t = spacer;
i3 = pinSpacing === _padding ? _getSize(pin, direction) + change + otherPinOffset : 0;
if (i3) {
spacerState.push(direction.d, i3 + _px);
spacer.style.flexBasis !== "auto" && (spacer.style.flexBasis = i3 + _px);
}
_setState(spacerState);
if (pinnedContainer) {
_triggers.forEach(function(t3) {
if (t3.pin === pinnedContainer && t3.vars.pinSpacing !== false) {
t3._subPinOffset = true;
}
});
}
useFixedPosition && scrollFunc(prevScroll);
} else {
i3 = _getSize(pin, direction);
i3 && spacer.style.flexBasis !== "auto" && (spacer.style.flexBasis = i3 + _px);
}
if (useFixedPosition) {
override = {
top: bounds.top + (isVertical ? scroll - start3 : oppositeScroll) + _px,
left: bounds.left + (isVertical ? oppositeScroll : scroll - start3) + _px,
boxSizing: "border-box",
position: "fixed"
};
override[_width] = override["max" + _Width] = Math.ceil(bounds.width) + _px;
override[_height] = override["max" + _Height] = Math.ceil(bounds.height) + _px;
override[_margin] = override[_margin + _Top] = override[_margin + _Right] = override[_margin + _Bottom] = override[_margin + _Left] = "0";
override[_padding] = cs2[_padding];
override[_padding + _Top] = cs2[_padding + _Top];
override[_padding + _Right] = cs2[_padding + _Right];
override[_padding + _Bottom] = cs2[_padding + _Bottom];
override[_padding + _Left] = cs2[_padding + _Left];
pinActiveState = _copyState(pinOriginalState, override, pinReparent);
_refreshingAll && scrollFunc(0);
}
if (animation) {
initted = animation._initted;
_suppressOverwrites2(1);
animation.render(animation.duration(), true, true);
pinChange = pinGetter(direction.a) - pinStart + change + otherPinOffset;
pinMoves = Math.abs(change - pinChange) > 1;
useFixedPosition && pinMoves && pinActiveState.splice(pinActiveState.length - 2, 2);
animation.render(0, true, true);
initted || animation.invalidate(true);
animation.parent || animation.totalTime(animation.totalTime());
_suppressOverwrites2(0);
} else {
pinChange = change;
}
forcedOverflow && (forcedOverflow.value ? forcedOverflow.style["overflow" + direction.a.toUpperCase()] = forcedOverflow.value : forcedOverflow.style.removeProperty("overflow-" + direction.a));
} else if (trigger && scrollFunc() && !containerAnimation) {
bounds = trigger.parentNode;
while (bounds && bounds !== _body2) {
if (bounds._pinOffset) {
start3 -= bounds._pinOffset;
end2 -= bounds._pinOffset;
}
bounds = bounds.parentNode;
}
}
revertedPins && revertedPins.forEach(function(t3) {
return t3.revert(false, true);
});
self2.start = start3;
self2.end = end2;
scroll1 = scroll2 = _refreshingAll ? prevScroll : scrollFunc();
if (!containerAnimation && !_refreshingAll) {
scroll1 < prevScroll && scrollFunc(prevScroll);
self2.scroll.rec = 0;
}
self2.revert(false, true);
lastRefresh = _getTime2();
if (snapDelayedCall) {
lastSnap = -1;
snapDelayedCall.restart(true);
}
_refreshing = 0;
animation && isToggle && (animation._initted || prevAnimProgress) && animation.progress() !== prevAnimProgress && animation.progress(prevAnimProgress || 0, true).render(animation.time(), true, true);
if (isFirstRefresh || prevProgress !== self2.progress || containerAnimation || invalidateOnRefresh) {
animation && !isToggle && animation.totalProgress(containerAnimation && start3 < -1e-3 && !prevProgress ? gsap3.utils.normalize(start3, end2, 0) : prevProgress, true);
self2.progress = isFirstRefresh || (scroll1 - start3) / change === prevProgress ? 0 : prevProgress;
}
pin && pinSpacing && (spacer._pinOffset = Math.round(self2.progress * pinChange));
scrubTween && scrubTween.invalidate();
if (!isNaN(markerStartOffset)) {
markerStartOffset -= gsap3.getProperty(markerStartTrigger, direction.p);
markerEndOffset -= gsap3.getProperty(markerEndTrigger, direction.p);
_shiftMarker(markerStartTrigger, direction, markerStartOffset);
_shiftMarker(markerStart, direction, markerStartOffset - (pinOffset || 0));
_shiftMarker(markerEndTrigger, direction, markerEndOffset);
_shiftMarker(markerEnd, direction, markerEndOffset - (pinOffset || 0));
}
isFirstRefresh && !_refreshingAll && self2.update();
if (onRefresh && !_refreshingAll && !executingOnRefresh) {
executingOnRefresh = true;
onRefresh(self2);
executingOnRefresh = false;
}
};
self2.getVelocity = function() {
return (scrollFunc() - scroll2) / (_getTime2() - _time2) * 1e3 || 0;
};
self2.endAnimation = function() {
_endAnimation(self2.callbackAnimation);
if (animation) {
scrubTween ? scrubTween.progress(1) : !animation.paused() ? _endAnimation(animation, animation.reversed()) : isToggle || _endAnimation(animation, self2.direction < 0, 1);
}
};
self2.labelToScroll = function(label) {
return animation && animation.labels && (start3 || self2.refresh() || start3) + animation.labels[label] / animation.duration() * change || 0;
};
self2.getTrailing = function(name) {
var i3 = _triggers.indexOf(self2), a = self2.direction > 0 ? _triggers.slice(0, i3).reverse() : _triggers.slice(i3 + 1);
return (_isString3(name) ? a.filter(function(t3) {
return t3.vars.preventOverlaps === name;
}) : a).filter(function(t3) {
return self2.direction > 0 ? t3.end <= start3 : t3.start >= end2;
});
};
self2.update = function(reset, recordVelocity, forceFake) {
if (containerAnimation && !forceFake && !reset) {
return;
}
var scroll = _refreshingAll === true ? prevScroll : self2.scroll(), p = reset ? 0 : (scroll - start3) / change, clipped = p < 0 ? 0 : p > 1 ? 1 : p || 0, prevProgress2 = self2.progress, isActive, wasActive, toggleState, action, stateChanged, toggled, isAtMax, isTakingAction;
if (recordVelocity) {
scroll2 = scroll1;
scroll1 = containerAnimation ? scrollFunc() : scroll;
if (snap3) {
snap22 = snap1;
snap1 = animation && !isToggle ? animation.totalProgress() : clipped;
}
}
if (anticipatePin && pin && !_refreshing && !_startup2 && _lastScrollTime) {
if (!clipped && start3 < scroll + (scroll - scroll2) / (_getTime2() - _time2) * anticipatePin) {
clipped = 1e-4;
} else if (clipped === 1 && end2 > scroll + (scroll - scroll2) / (_getTime2() - _time2) * anticipatePin) {
clipped = 0.9999;
}
}
if (clipped !== prevProgress2 && self2.enabled) {
isActive = self2.isActive = !!clipped && clipped < 1;
wasActive = !!prevProgress2 && prevProgress2 < 1;
toggled = isActive !== wasActive;
stateChanged = toggled || !!clipped !== !!prevProgress2;
self2.direction = clipped > prevProgress2 ? 1 : -1;
self2.progress = clipped;
if (stateChanged && !_refreshing) {
toggleState = clipped && !prevProgress2 ? 0 : clipped === 1 ? 1 : prevProgress2 === 1 ? 2 : 3;
if (isToggle) {
action = !toggled && toggleActions[toggleState + 1] !== "none" && toggleActions[toggleState + 1] || toggleActions[toggleState];
isTakingAction = animation && (action === "complete" || action === "reset" || action in animation);
}
}
preventOverlaps && (toggled || isTakingAction) && (isTakingAction || scrub || !animation) && (_isFunction3(preventOverlaps) ? preventOverlaps(self2) : self2.getTrailing(preventOverlaps).forEach(function(t3) {
return t3.endAnimation();
}));
if (!isToggle) {
if (scrubTween && !_refreshing && !_startup2) {
scrubTween._dp._time - scrubTween._start !== scrubTween._time && scrubTween.render(scrubTween._dp._time - scrubTween._start);
if (scrubTween.resetTo) {
scrubTween.resetTo("totalProgress", clipped, animation._tTime / animation._tDur);
} else {
scrubTween.vars.totalProgress = clipped;
scrubTween.invalidate().restart();
}
} else if (animation) {
animation.totalProgress(clipped, !!(_refreshing && (lastRefresh || reset)));
}
}
if (pin) {
reset && pinSpacing && (spacer.style[pinSpacing + direction.os2] = spacingStart);
if (!useFixedPosition) {
pinSetter(_round3(pinStart + pinChange * clipped));
} else if (stateChanged) {
isAtMax = !reset && clipped > prevProgress2 && end2 + 1 > scroll && scroll + 1 >= _maxScroll(scroller, direction);
if (pinReparent) {
if (!reset && (isActive || isAtMax)) {
var bounds = _getBounds(pin, true), _offset = scroll - start3;
_reparent(pin, _body2, bounds.top + (direction === _vertical ? _offset : 0) + _px, bounds.left + (direction === _vertical ? 0 : _offset) + _px);
} else {
_reparent(pin, spacer);
}
}
_setState(isActive || isAtMax ? pinActiveState : pinState);
pinMoves && clipped < 1 && isActive || pinSetter(pinStart + (clipped === 1 && !isAtMax ? pinChange : 0));
}
}
snap3 && !tweenTo.tween && !_refreshing && !_startup2 && snapDelayedCall.restart(true);
toggleClass3 && (toggled || once && clipped && (clipped < 1 || !_limitCallbacks)) && _toArray(toggleClass3.targets).forEach(function(el) {
return el.classList[isActive || once ? "add" : "remove"](toggleClass3.className);
});
onUpdate && !isToggle && !reset && onUpdate(self2);
if (stateChanged && !_refreshing) {
if (isToggle) {
if (isTakingAction) {
if (action === "complete") {
animation.pause().totalProgress(1);
} else if (action === "reset") {
animation.restart(true).pause();
} else if (action === "restart") {
animation.restart(true);
} else {
animation[action]();
}
}
onUpdate && onUpdate(self2);
}
if (toggled || !_limitCallbacks) {
onToggle && toggled && _callback3(self2, onToggle);
callbacks[toggleState] && _callback3(self2, callbacks[toggleState]);
once && (clipped === 1 ? self2.kill(false, 1) : callbacks[toggleState] = 0);
if (!toggled) {
toggleState = clipped === 1 ? 1 : 3;
callbacks[toggleState] && _callback3(self2, callbacks[toggleState]);
}
}
if (fastScrollEnd && !isActive && Math.abs(self2.getVelocity()) > (_isNumber3(fastScrollEnd) ? fastScrollEnd : 2500)) {
_endAnimation(self2.callbackAnimation);
scrubTween ? scrubTween.progress(1) : _endAnimation(animation, action === "reverse" ? 1 : !clipped, 1);
}
} else if (isToggle && onUpdate && !_refreshing) {
onUpdate(self2);
}
}
if (markerEndSetter) {
var n2 = containerAnimation ? scroll / containerAnimation.duration() * (containerAnimation._caScrollDist || 0) : scroll;
markerStartSetter(n2 + (markerStartTrigger._isFlipped ? 1 : 0));
markerEndSetter(n2);
}
caMarkerSetter && caMarkerSetter(-scroll / containerAnimation.duration() * (containerAnimation._caScrollDist || 0));
};
self2.enable = function(reset, refresh) {
if (!self2.enabled) {
self2.enabled = true;
_addListener3(scroller, "resize", _onResize);
isViewport || _addListener3(scroller, "scroll", _onScroll3);
onRefreshInit && _addListener3(ScrollTrigger3, "refreshInit", onRefreshInit);
if (reset !== false) {
self2.progress = prevProgress = 0;
scroll1 = scroll2 = lastSnap = scrollFunc();
}
refresh !== false && self2.refresh();
}
};
self2.getTween = function(snap4) {
return snap4 && tweenTo ? tweenTo.tween : scrubTween;
};
self2.setPositions = function(newStart, newEnd, keepClamp, pinOffset) {
if (containerAnimation) {
var st = containerAnimation.scrollTrigger, duration = containerAnimation.duration(), _change = st.end - st.start;
newStart = st.start + _change * newStart / duration;
newEnd = st.start + _change * newEnd / duration;
}
self2.refresh(false, false, {
start: _keepClamp(newStart, keepClamp && !!self2._startClamp),
end: _keepClamp(newEnd, keepClamp && !!self2._endClamp)
}, pinOffset);
self2.update();
};
self2.adjustPinSpacing = function(amount) {
if (spacerState && amount) {
var i3 = spacerState.indexOf(direction.d) + 1;
spacerState[i3] = parseFloat(spacerState[i3]) + amount + _px;
spacerState[1] = parseFloat(spacerState[1]) + amount + _px;
_setState(spacerState);
}
};
self2.disable = function(reset, allowAnimation) {
if (self2.enabled) {
reset !== false && self2.revert(true, true);
self2.enabled = self2.isActive = false;
allowAnimation || scrubTween && scrubTween.pause();
prevScroll = 0;
pinCache && (pinCache.uncache = 1);
onRefreshInit && _removeListener3(ScrollTrigger3, "refreshInit", onRefreshInit);
if (snapDelayedCall) {
snapDelayedCall.pause();
tweenTo.tween && tweenTo.tween.kill() && (tweenTo.tween = 0);
}
if (!isViewport) {
var i3 = _triggers.length;
while (i3--) {
if (_triggers[i3].scroller === scroller && _triggers[i3] !== self2) {
return;
}
}
_removeListener3(scroller, "resize", _onResize);
isViewport || _removeListener3(scroller, "scroll", _onScroll3);
}
}
};
self2.kill = function(revert, allowAnimation) {
self2.disable(revert, allowAnimation);
scrubTween && !allowAnimation && scrubTween.kill();
id && delete _ids[id];
var i3 = _triggers.indexOf(self2);
i3 >= 0 && _triggers.splice(i3, 1);
i3 === _i && _direction > 0 && _i--;
i3 = 0;
_triggers.forEach(function(t3) {
return t3.scroller === self2.scroller && (i3 = 1);
});
i3 || _refreshingAll || (self2.scroll.rec = 0);
if (animation) {
animation.scrollTrigger = null;
revert && animation.revert({
kill: false
});
allowAnimation || animation.kill();
}
markerStart && [markerStart, markerEnd, markerStartTrigger, markerEndTrigger].forEach(function(m3) {
return m3.parentNode && m3.parentNode.removeChild(m3);
});
_primary === self2 && (_primary = 0);
if (pin) {
pinCache && (pinCache.uncache = 1);
i3 = 0;
_triggers.forEach(function(t3) {
return t3.pin === pin && i3++;
});
i3 || (pinCache.spacer = 0);
}
vars.onKill && vars.onKill(self2);
};
_triggers.push(self2);
self2.enable(false, false);
customRevertReturn && customRevertReturn(self2);
if (animation && animation.add && !change) {
var updateFunc = self2.update;
self2.update = function() {
self2.update = updateFunc;
start3 || end2 || self2.refresh();
};
gsap3.delayedCall(0.01, self2.update);
change = 0.01;
start3 = end2 = 0;
} else {
self2.refresh();
}
pin && _queueRefreshAll();
};
ScrollTrigger3.register = function register(core) {
if (!_coreInitted3) {
gsap3 = core || _getGSAP3();
_windowExists5() && window.document && ScrollTrigger3.enable();
_coreInitted3 = _enabled;
}
return _coreInitted3;
};
ScrollTrigger3.defaults = function defaults2(config3) {
if (config3) {
for (var p in config3) {
_defaults2[p] = config3[p];
}
}
return _defaults2;
};
ScrollTrigger3.disable = function disable(reset, kill) {
_enabled = 0;
_triggers.forEach(function(trigger) {
return trigger[kill ? "kill" : "disable"](reset);
});
_removeListener3(_win4, "wheel", _onScroll3);
_removeListener3(_doc4, "scroll", _onScroll3);
clearInterval(_syncInterval);
_removeListener3(_doc4, "touchcancel", _passThrough3);
_removeListener3(_body2, "touchstart", _passThrough3);
_multiListener(_removeListener3, _doc4, "pointerdown,touchstart,mousedown", _pointerDownHandler);
_multiListener(_removeListener3, _doc4, "pointerup,touchend,mouseup", _pointerUpHandler);
_resizeDelay.kill();
_iterateAutoRefresh(_removeListener3);
for (var i3 = 0; i3 < _scrollers.length; i3 += 3) {
_wheelListener(_removeListener3, _scrollers[i3], _scrollers[i3 + 1]);
_wheelListener(_removeListener3, _scrollers[i3], _scrollers[i3 + 2]);
}
};
ScrollTrigger3.enable = function enable() {
_win4 = window;
_doc4 = document;
_docEl2 = _doc4.documentElement;
_body2 = _doc4.body;
if (gsap3) {
_toArray = gsap3.utils.toArray;
_clamp4 = gsap3.utils.clamp;
_context3 = gsap3.core.context || _passThrough3;
_suppressOverwrites2 = gsap3.core.suppressOverwrites || _passThrough3;
_scrollRestoration = _win4.history.scrollRestoration || "auto";
_lastScroll = _win4.pageYOffset;
gsap3.core.globals("ScrollTrigger", ScrollTrigger3);
if (_body2) {
_enabled = 1;
_div100vh = document.createElement("div");
_div100vh.style.height = "100vh";
_div100vh.style.position = "absolute";
_refresh100vh();
_rafBugFix();
Observer.register(gsap3);
ScrollTrigger3.isTouch = Observer.isTouch;
_fixIOSBug = Observer.isTouch && /(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent);
_ignoreMobileResize = Observer.isTouch === 1;
_addListener3(_win4, "wheel", _onScroll3);
_root2 = [_win4, _doc4, _docEl2, _body2];
if (gsap3.matchMedia) {
ScrollTrigger3.matchMedia = function(vars) {
var mm2 = gsap3.matchMedia(), p;
for (p in vars) {
mm2.add(p, vars[p]);
}
return mm2;
};
gsap3.addEventListener("matchMediaInit", function() {
return _revertAll();
});
gsap3.addEventListener("matchMediaRevert", function() {
return _revertRecorded();
});
gsap3.addEventListener("matchMedia", function() {
_refreshAll(0, 1);
_dispatch3("matchMedia");
});
gsap3.matchMedia("(orientation: portrait)", function() {
_setBaseDimensions();
return _setBaseDimensions;
});
} else {
console.warn("Requires GSAP 3.11.0 or later");
}
_setBaseDimensions();
_addListener3(_doc4, "scroll", _onScroll3);
var bodyStyle = _body2.style, border = bodyStyle.borderTopStyle, AnimationProto = gsap3.core.Animation.prototype, bounds, i3;
AnimationProto.revert || Object.defineProperty(AnimationProto, "revert", {
value: function value() {
return this.time(-0.01, true);
}
});
bodyStyle.borderTopStyle = "solid";
bounds = _getBounds(_body2);
_vertical.m = Math.round(bounds.top + _vertical.sc()) || 0;
_horizontal.m = Math.round(bounds.left + _horizontal.sc()) || 0;
border ? bodyStyle.borderTopStyle = border : bodyStyle.removeProperty("border-top-style");
_syncInterval = setInterval(_sync, 250);
gsap3.delayedCall(0.5, function() {
return _startup2 = 0;
});
_addListener3(_doc4, "touchcancel", _passThrough3);
_addListener3(_body2, "touchstart", _passThrough3);
_multiListener(_addListener3, _doc4, "pointerdown,touchstart,mousedown", _pointerDownHandler);
_multiListener(_addListener3, _doc4, "pointerup,touchend,mouseup", _pointerUpHandler);
_transformProp2 = gsap3.utils.checkPrefix("transform");
_stateProps.push(_transformProp2);
_coreInitted3 = _getTime2();
_resizeDelay = gsap3.delayedCall(0.2, _refreshAll).pause();
_autoRefresh = [_doc4, "visibilitychange", function() {
var w = _win4.innerWidth, h = _win4.innerHeight;
if (_doc4.hidden) {
_prevWidth = w;
_prevHeight = h;
} else if (_prevWidth !== w || _prevHeight !== h) {
_onResize();
}
}, _doc4, "DOMContentLoaded", _refreshAll, _win4, "load", _refreshAll, _win4, "resize", _onResize];
_iterateAutoRefresh(_addListener3);
_triggers.forEach(function(trigger) {
return trigger.enable(0, 1);
});
for (i3 = 0; i3 < _scrollers.length; i3 += 3) {
_wheelListener(_removeListener3, _scrollers[i3], _scrollers[i3 + 1]);
_wheelListener(_removeListener3, _scrollers[i3], _scrollers[i3 + 2]);
}
}
}
};
ScrollTrigger3.config = function config3(vars) {
"limitCallbacks" in vars && (_limitCallbacks = !!vars.limitCallbacks);
var ms = vars.syncInterval;
ms && clearInterval(_syncInterval) || (_syncInterval = ms) && setInterval(_sync, ms);
"ignoreMobileResize" in vars && (_ignoreMobileResize = ScrollTrigger3.isTouch === 1 && vars.ignoreMobileResize);
if ("autoRefreshEvents" in vars) {
_iterateAutoRefresh(_removeListener3) || _iterateAutoRefresh(_addListener3, vars.autoRefreshEvents || "none");
_ignoreResize = (vars.autoRefreshEvents + "").indexOf("resize") === -1;
}
};
ScrollTrigger3.scrollerProxy = function scrollerProxy(target, vars) {
var t3 = _getTarget(target), i3 = _scrollers.indexOf(t3), isViewport = _isViewport3(t3);
if (~i3) {
_scrollers.splice(i3, isViewport ? 6 : 2);
}
if (vars) {
isViewport ? _proxies.unshift(_win4, vars, _body2, vars, _docEl2, vars) : _proxies.unshift(t3, vars);
}
};
ScrollTrigger3.clearMatchMedia = function clearMatchMedia(query2) {
_triggers.forEach(function(t3) {
return t3._ctx && t3._ctx.query === query2 && t3._ctx.kill(true, true);
});
};
ScrollTrigger3.isInViewport = function isInViewport(element, ratio, horizontal) {
var bounds = (_isString3(element) ? _getTarget(element) : element).getBoundingClientRect(), offset2 = bounds[horizontal ? _width : _height] * ratio || 0;
return horizontal ? bounds.right - offset2 > 0 && bounds.left + offset2 < _win4.innerWidth : bounds.bottom - offset2 > 0 && bounds.top + offset2 < _win4.innerHeight;
};
ScrollTrigger3.positionInViewport = function positionInViewport(element, referencePoint, horizontal) {
_isString3(element) && (element = _getTarget(element));
var bounds = element.getBoundingClientRect(), size = bounds[horizontal ? _width : _height], offset2 = referencePoint == null ? size / 2 : referencePoint in _keywords ? _keywords[referencePoint] * size : ~referencePoint.indexOf("%") ? parseFloat(referencePoint) * size / 100 : parseFloat(referencePoint) || 0;
return horizontal ? (bounds.left + offset2) / _win4.innerWidth : (bounds.top + offset2) / _win4.innerHeight;
};
ScrollTrigger3.killAll = function killAll(allowListeners) {
_triggers.slice(0).forEach(function(t3) {
return t3.vars.id !== "ScrollSmoother" && t3.kill();
});
if (allowListeners !== true) {
var listeners = _listeners2.killAll || [];
_listeners2 = {};
listeners.forEach(function(f) {
return f();
});
}
};
return ScrollTrigger3;
}();
ScrollTrigger2.version = "3.12.5";
ScrollTrigger2.saveStyles = function(targets) {
return targets ? _toArray(targets).forEach(function(target) {
if (target && target.style) {
var i3 = _savedStyles.indexOf(target);
i3 >= 0 && _savedStyles.splice(i3, 5);
_savedStyles.push(target, target.style.cssText, target.getBBox && target.getAttribute("transform"), gsap3.core.getCache(target), _context3());
}
}) : _savedStyles;
};
ScrollTrigger2.revert = function(soft, media) {
return _revertAll(!soft, media);
};
ScrollTrigger2.create = function(vars, animation) {
return new ScrollTrigger2(vars, animation);
};
ScrollTrigger2.refresh = function(safe) {
return safe ? _onResize() : (_coreInitted3 || ScrollTrigger2.register()) && _refreshAll(true);
};
ScrollTrigger2.update = function(force) {
return ++_scrollers.cache && _updateAll(force === true ? 2 : 0);
};
ScrollTrigger2.clearScrollMemory = _clearScrollMemory;
ScrollTrigger2.maxScroll = function(element, horizontal) {
return _maxScroll(element, horizontal ? _horizontal : _vertical);
};
ScrollTrigger2.getScrollFunc = function(element, horizontal) {
return _getScrollFunc(_getTarget(element), horizontal ? _horizontal : _vertical);
};
ScrollTrigger2.getById = function(id) {
return _ids[id];
};
ScrollTrigger2.getAll = function() {
return _triggers.filter(function(t3) {
return t3.vars.id !== "ScrollSmoother";
});
};
ScrollTrigger2.isScrolling = function() {
return !!_lastScrollTime;
};
ScrollTrigger2.snapDirectional = _snapDirectional;
ScrollTrigger2.addEventListener = function(type, callback) {
var a = _listeners2[type] || (_listeners2[type] = []);
~a.indexOf(callback) || a.push(callback);
};
ScrollTrigger2.removeEventListener = function(type, callback) {
var a = _listeners2[type], i3 = a && a.indexOf(callback);
i3 >= 0 && a.splice(i3, 1);
};
ScrollTrigger2.batch = function(targets, vars) {
var result = [], varsCopy = {}, interval = vars.interval || 0.016, batchMax = vars.batchMax || 1e9, proxyCallback = function proxyCallback2(type, callback) {
var elements = [], triggers = [], delay = gsap3.delayedCall(interval, function() {
callback(elements, triggers);
elements = [];
triggers = [];
}).pause();
return function(self2) {
elements.length || delay.restart(true);
elements.push(self2.trigger);
triggers.push(self2);
batchMax <= elements.length && delay.progress(1);
};
}, p;
for (p in vars) {
varsCopy[p] = p.substr(0, 2) === "on" && _isFunction3(vars[p]) && p !== "onRefreshInit" ? proxyCallback(p, vars[p]) : vars[p];
}
if (_isFunction3(batchMax)) {
batchMax = batchMax();
_addListener3(ScrollTrigger2, "refresh", function() {
return batchMax = vars.batchMax();
});
}
_toArray(targets).forEach(function(target) {
var config3 = {};
for (p in varsCopy) {
config3[p] = varsCopy[p];
}
config3.trigger = target;
result.push(ScrollTrigger2.create(config3));
});
return result;
};
var _clampScrollAndGetDurationMultiplier = function _clampScrollAndGetDurationMultiplier2(scrollFunc, current, end2, max4) {
current > max4 ? scrollFunc(max4) : current < 0 && scrollFunc(0);
return end2 > max4 ? (max4 - current) / (end2 - current) : end2 < 0 ? current / (current - end2) : 1;
};
var _allowNativePanning = function _allowNativePanning2(target, direction) {
if (direction === true) {
target.style.removeProperty("touch-action");
} else {
target.style.touchAction = direction === true ? "auto" : direction ? "pan-" + direction + (Observer.isTouch ? " pinch-zoom" : "") : "none";
}
target === _docEl2 && _allowNativePanning2(_body2, direction);
};
var _overflow = {
auto: 1,
scroll: 1
};
var _nestedScroll = function _nestedScroll2(_ref5) {
var event = _ref5.event, target = _ref5.target, axis = _ref5.axis;
var node = (event.changedTouches ? event.changedTouches[0] : event).target, cache = node._gsap || gsap3.core.getCache(node), time = _getTime2(), cs;
if (!cache._isScrollT || time - cache._isScrollT > 2e3) {
while (node && node !== _body2 && (node.scrollHeight <= node.clientHeight && node.scrollWidth <= node.clientWidth || !(_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]))) {
node = node.parentNode;
}
cache._isScroll = node && node !== target && !_isViewport3(node) && (_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]);
cache._isScrollT = time;
}
if (cache._isScroll || axis === "x") {
event.stopPropagation();
event._gsapAllow = true;
}
};
var _inputObserver = function _inputObserver2(target, type, inputs, nested) {
return Observer.create({
target,
capture: true,
debounce: false,
lockAxis: true,
type,
onWheel: nested = nested && _nestedScroll,
onPress: nested,
onDrag: nested,
onScroll: nested,
onEnable: function onEnable() {
return inputs && _addListener3(_doc4, Observer.eventTypes[0], _captureInputs, false, true);
},
onDisable: function onDisable() {
return _removeListener3(_doc4, Observer.eventTypes[0], _captureInputs, true);
}
});
};
var _inputExp = /(input|label|select|textarea)/i;
var _inputIsFocused;
var _captureInputs = function _captureInputs2(e2) {
var isInput = _inputExp.test(e2.target.tagName);
if (isInput || _inputIsFocused) {
e2._gsapAllow = true;
_inputIsFocused = isInput;
}
};
var _getScrollNormalizer = function _getScrollNormalizer2(vars) {
_isObject3(vars) || (vars = {});
vars.preventDefault = vars.isNormalizer = vars.allowClicks = true;
vars.type || (vars.type = "wheel,touch");
vars.debounce = !!vars.debounce;
vars.id = vars.id || "normalizer";
var _vars2 = vars, normalizeScrollX = _vars2.normalizeScrollX, momentum = _vars2.momentum, allowNestedScroll = _vars2.allowNestedScroll, onRelease = _vars2.onRelease, self2, maxY, target = _getTarget(vars.target) || _docEl2, smoother = gsap3.core.globals().ScrollSmoother, smootherInstance = smoother && smoother.get(), content = _fixIOSBug && (vars.content && _getTarget(vars.content) || smootherInstance && vars.content !== false && !smootherInstance.smooth() && smootherInstance.content()), scrollFuncY = _getScrollFunc(target, _vertical), scrollFuncX = _getScrollFunc(target, _horizontal), scale = 1, initialScale = (Observer.isTouch && _win4.visualViewport ? _win4.visualViewport.scale * _win4.visualViewport.width : _win4.outerWidth) / _win4.innerWidth, wheelRefresh = 0, resolveMomentumDuration = _isFunction3(momentum) ? function() {
return momentum(self2);
} : function() {
return momentum || 2.8;
}, lastRefreshID, skipTouchMove, inputObserver = _inputObserver(target, vars.type, true, allowNestedScroll), resumeTouchMove = function resumeTouchMove2() {
return skipTouchMove = false;
}, scrollClampX = _passThrough3, scrollClampY = _passThrough3, updateClamps = function updateClamps2() {
maxY = _maxScroll(target, _vertical);
scrollClampY = _clamp4(_fixIOSBug ? 1 : 0, maxY);
normalizeScrollX && (scrollClampX = _clamp4(0, _maxScroll(target, _horizontal)));
lastRefreshID = _refreshID;
}, removeContentOffset = function removeContentOffset2() {
content._gsap.y = _round3(parseFloat(content._gsap.y) + scrollFuncY.offset) + "px";
content.style.transform = "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, " + parseFloat(content._gsap.y) + ", 0, 1)";
scrollFuncY.offset = scrollFuncY.cacheID = 0;
}, ignoreDrag = function ignoreDrag2() {
if (skipTouchMove) {
requestAnimationFrame(resumeTouchMove);
var offset2 = _round3(self2.deltaY / 2), scroll = scrollClampY(scrollFuncY.v - offset2);
if (content && scroll !== scrollFuncY.v + scrollFuncY.offset) {
scrollFuncY.offset = scroll - scrollFuncY.v;
var y3 = _round3((parseFloat(content && content._gsap.y) || 0) - scrollFuncY.offset);
content.style.transform = "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, " + y3 + ", 0, 1)";
content._gsap.y = y3 + "px";
scrollFuncY.cacheID = _scrollers.cache;
_updateAll();
}
return true;
}
scrollFuncY.offset && removeContentOffset();
skipTouchMove = true;
}, tween, startScrollX, startScrollY, onStopDelayedCall, onResize2 = function onResize3() {
updateClamps();
if (tween.isActive() && tween.vars.scrollY > maxY) {
scrollFuncY() > maxY ? tween.progress(1) && scrollFuncY(maxY) : tween.resetTo("scrollY", maxY);
}
};
content && gsap3.set(content, {
y: "+=0"
});
vars.ignoreCheck = function(e2) {
return _fixIOSBug && e2.type === "touchmove" && ignoreDrag(e2) || scale > 1.05 && e2.type !== "touchstart" || self2.isGesturing || e2.touches && e2.touches.length > 1;
};
vars.onPress = function() {
skipTouchMove = false;
var prevScale = scale;
scale = _round3((_win4.visualViewport && _win4.visualViewport.scale || 1) / initialScale);
tween.pause();
prevScale !== scale && _allowNativePanning(target, scale > 1.01 ? true : normalizeScrollX ? false : "x");
startScrollX = scrollFuncX();
startScrollY = scrollFuncY();
updateClamps();
lastRefreshID = _refreshID;
};
vars.onRelease = vars.onGestureStart = function(self3, wasDragging) {
scrollFuncY.offset && removeContentOffset();
if (!wasDragging) {
onStopDelayedCall.restart(true);
} else {
_scrollers.cache++;
var dur = resolveMomentumDuration(), currentScroll, endScroll;
if (normalizeScrollX) {
currentScroll = scrollFuncX();
endScroll = currentScroll + dur * 0.05 * -self3.velocityX / 0.227;
dur *= _clampScrollAndGetDurationMultiplier(scrollFuncX, currentScroll, endScroll, _maxScroll(target, _horizontal));
tween.vars.scrollX = scrollClampX(endScroll);
}
currentScroll = scrollFuncY();
endScroll = currentScroll + dur * 0.05 * -self3.velocityY / 0.227;
dur *= _clampScrollAndGetDurationMultiplier(scrollFuncY, currentScroll, endScroll, _maxScroll(target, _vertical));
tween.vars.scrollY = scrollClampY(endScroll);
tween.invalidate().duration(dur).play(0.01);
if (_fixIOSBug && tween.vars.scrollY >= maxY || currentScroll >= maxY - 1) {
gsap3.to({}, {
onUpdate: onResize2,
duration: dur
});
}
}
onRelease && onRelease(self3);
};
vars.onWheel = function() {
tween._ts && tween.pause();
if (_getTime2() - wheelRefresh > 1e3) {
lastRefreshID = 0;
wheelRefresh = _getTime2();
}
};
vars.onChange = function(self3, dx, dy, xArray, yArray) {
_refreshID !== lastRefreshID && updateClamps();
dx && normalizeScrollX && scrollFuncX(scrollClampX(xArray[2] === dx ? startScrollX + (self3.startX - self3.x) : scrollFuncX() + dx - xArray[1]));
if (dy) {
scrollFuncY.offset && removeContentOffset();
var isTouch = yArray[2] === dy, y3 = isTouch ? startScrollY + self3.startY - self3.y : scrollFuncY() + dy - yArray[1], yClamped = scrollClampY(y3);
isTouch && y3 !== yClamped && (startScrollY += yClamped - y3);
scrollFuncY(yClamped);
}
(dy || dx) && _updateAll();
};
vars.onEnable = function() {
_allowNativePanning(target, normalizeScrollX ? false : "x");
ScrollTrigger2.addEventListener("refresh", onResize2);
_addListener3(_win4, "resize", onResize2);
if (scrollFuncY.smooth) {
scrollFuncY.target.style.scrollBehavior = "auto";
scrollFuncY.smooth = scrollFuncX.smooth = false;
}
inputObserver.enable();
};
vars.onDisable = function() {
_allowNativePanning(target, true);
_removeListener3(_win4, "resize", onResize2);
ScrollTrigger2.removeEventListener("refresh", onResize2);
inputObserver.kill();
};
vars.lockAxis = vars.lockAxis !== false;
self2 = new Observer(vars);
self2.iOS = _fixIOSBug;
_fixIOSBug && !scrollFuncY() && scrollFuncY(1);
_fixIOSBug && gsap3.ticker.add(_passThrough3);
onStopDelayedCall = self2._dc;
tween = gsap3.to(self2, {
ease: "power4",
paused: true,
inherit: false,
scrollX: normalizeScrollX ? "+=0.1" : "+=0",
scrollY: "+=0.1",
modifiers: {
scrollY: _interruptionTracker(scrollFuncY, scrollFuncY(), function() {
return tween.pause();
})
},
onUpdate: _updateAll,
onComplete: onStopDelayedCall.vars.onComplete
});
return self2;
};
ScrollTrigger2.sort = function(func) {
return _triggers.sort(func || function(a, b) {
return (a.vars.refreshPriority || 0) * -1e6 + a.start - (b.start + (b.vars.refreshPriority || 0) * -1e6);
});
};
ScrollTrigger2.observe = function(vars) {
return new Observer(vars);
};
ScrollTrigger2.normalizeScroll = function(vars) {
if (typeof vars === "undefined") {
return _normalizer2;
}
if (vars === true && _normalizer2) {
return _normalizer2.enable();
}
if (vars === false) {
_normalizer2 && _normalizer2.kill();
_normalizer2 = vars;
return;
}
var normalizer = vars instanceof Observer ? vars : _getScrollNormalizer(vars);
_normalizer2 && _normalizer2.target === normalizer.target && _normalizer2.kill();
_isViewport3(normalizer.target) && (_normalizer2 = normalizer);
return normalizer;
};
ScrollTrigger2.core = {
// smaller file size way to leverage in ScrollSmoother and Observer
_getVelocityProp,
_inputObserver,
_scrollers,
_proxies,
bridge: {
// when normalizeScroll sets the scroll position (ss = setScroll)
ss: function ss() {
_lastScrollTime || _dispatch3("scrollStart");
_lastScrollTime = _getTime2();
},
// a way to get the _refreshing value in Observer
ref: function ref() {
return _refreshing;
}
}
};
_getGSAP3() && gsap3.registerPlugin(ScrollTrigger2);
// src/js/init/smoothScroll.js
gsapWithCSS.registerPlugin(ScrollTrigger2);
function smooth() {
const lenis = new Lenis();
lenis.on("scroll", (e2) => {
});
lenis.on("scroll", ScrollTrigger2.update);
gsapWithCSS.ticker.add((time) => {
lenis.raf(time * 1e3);
});
gsapWithCSS.ticker.lagSmoothing(0);
}
var smoothScroll_default = smooth;
// node_modules/@splidejs/splide/dist/js/splide.esm.js
function _defineProperties3(target, props) {
for (var i3 = 0; i3 < props.length; i3++) {
var descriptor = props[i3];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass3(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties3(Constructor.prototype, protoProps);
if (staticProps) _defineProperties3(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
var MEDIA_PREFERS_REDUCED_MOTION = "(prefers-reduced-motion: reduce)";
var CREATED = 1;
var MOUNTED = 2;
var IDLE = 3;
var MOVING = 4;
var SCROLLING = 5;
var DRAGGING = 6;
var DESTROYED = 7;
var STATES = {
CREATED,
MOUNTED,
IDLE,
MOVING,
SCROLLING,
DRAGGING,
DESTROYED
};
function empty(array) {
array.length = 0;
}
function slice(arrayLike, start3, end2) {
return Array.prototype.slice.call(arrayLike, start3, end2);
}
function apply(func) {
return func.bind.apply(func, [null].concat(slice(arguments, 1)));
}
var nextTick = setTimeout;
var noop = function noop2() {
};
function raf(func) {
return requestAnimationFrame(func);
}
function typeOf(type, subject) {
return typeof subject === type;
}
function isObject(subject) {
return !isNull(subject) && typeOf("object", subject);
}
var isArray = Array.isArray;
var isFunction = apply(typeOf, "function");
var isString = apply(typeOf, "string");
var isUndefined = apply(typeOf, "undefined");
function isNull(subject) {
return subject === null;
}
function isHTMLElement2(subject) {
try {
return subject instanceof (subject.ownerDocument.defaultView || window).HTMLElement;
} catch (e2) {
return false;
}
}
function toArray3(value) {
return isArray(value) ? value : [value];
}
function forEach(values, iteratee) {
toArray3(values).forEach(iteratee);
}
function includes(array, value) {
return array.indexOf(value) > -1;
}
function push(array, items) {
array.push.apply(array, toArray3(items));
return array;
}
function toggleClass(elm, classes, add) {
if (elm) {
forEach(classes, function(name) {
if (name) {
elm.classList[add ? "add" : "remove"](name);
}
});
}
}
function addClass(elm, classes) {
toggleClass(elm, isString(classes) ? classes.split(" ") : classes, true);
}
function append(parent, children2) {
forEach(children2, parent.appendChild.bind(parent));
}
function before(nodes, ref2) {
forEach(nodes, function(node) {
var parent = (ref2 || node).parentNode;
if (parent) {
parent.insertBefore(node, ref2);
}
});
}
function matches(elm, selector3) {
return isHTMLElement2(elm) && (elm["msMatchesSelector"] || elm.matches).call(elm, selector3);
}
function children(parent, selector3) {
var children2 = parent ? slice(parent.children) : [];
return selector3 ? children2.filter(function(child2) {
return matches(child2, selector3);
}) : children2;
}
function child(parent, selector3) {
return selector3 ? children(parent, selector3)[0] : parent.firstElementChild;
}
var ownKeys = Object.keys;
function forOwn(object, iteratee, right2) {
if (object) {
(right2 ? ownKeys(object).reverse() : ownKeys(object)).forEach(function(key) {
key !== "__proto__" && iteratee(object[key], key);
});
}
return object;
}
function assign(object) {
slice(arguments, 1).forEach(function(source) {
forOwn(source, function(value, key) {
object[key] = source[key];
});
});
return object;
}
function merge(object) {
slice(arguments, 1).forEach(function(source) {
forOwn(source, function(value, key) {
if (isArray(value)) {
object[key] = value.slice();
} else if (isObject(value)) {
object[key] = merge({}, isObject(object[key]) ? object[key] : {}, value);
} else {
object[key] = value;
}
});
});
return object;
}
function omit(object, keys) {
forEach(keys || ownKeys(object), function(key) {
delete object[key];
});
}
function removeAttribute(elms, attrs) {
forEach(elms, function(elm) {
forEach(attrs, function(attr) {
elm && elm.removeAttribute(attr);
});
});
}
function setAttribute(elms, attrs, value) {
if (isObject(attrs)) {
forOwn(attrs, function(value2, name) {
setAttribute(elms, name, value2);
});
} else {
forEach(elms, function(elm) {
isNull(value) || value === "" ? removeAttribute(elm, attrs) : elm.setAttribute(attrs, String(value));
});
}
}
function create(tag, attrs, parent) {
var elm = document.createElement(tag);
if (attrs) {
isString(attrs) ? addClass(elm, attrs) : setAttribute(elm, attrs);
}
parent && append(parent, elm);
return elm;
}
function style(elm, prop, value) {
if (isUndefined(value)) {
return getComputedStyle(elm)[prop];
}
if (!isNull(value)) {
elm.style[prop] = "" + value;
}
}
function display(elm, display2) {
style(elm, "display", display2);
}
function focus(elm) {
elm["setActive"] && elm["setActive"]() || elm.focus({
preventScroll: true
});
}
function getAttribute(elm, attr) {
return elm.getAttribute(attr);
}
function hasClass(elm, className) {
return elm && elm.classList.contains(className);
}
function rect(target) {
return target.getBoundingClientRect();
}
function remove(nodes) {
forEach(nodes, function(node) {
if (node && node.parentNode) {
node.parentNode.removeChild(node);
}
});
}
function parseHtml(html) {
return child(new DOMParser().parseFromString(html, "text/html").body);
}
function prevent(e2, stopPropagation) {
e2.preventDefault();
if (stopPropagation) {
e2.stopPropagation();
e2.stopImmediatePropagation();
}
}
function query(parent, selector3) {
return parent && parent.querySelector(selector3);
}
function queryAll(parent, selector3) {
return selector3 ? slice(parent.querySelectorAll(selector3)) : [];
}
function removeClass(elm, classes) {
toggleClass(elm, classes, false);
}
function timeOf(e2) {
return e2.timeStamp;
}
function unit(value) {
return isString(value) ? value : value ? value + "px" : "";
}
var PROJECT_CODE = "splide";
var DATA_ATTRIBUTE = "data-" + PROJECT_CODE;
function assert(condition, message) {
if (!condition) {
throw new Error("[" + PROJECT_CODE + "] " + (message || ""));
}
}
var min2 = Math.min;
var max2 = Math.max;
var floor = Math.floor;
var ceil = Math.ceil;
var abs = Math.abs;
function approximatelyEqual(x, y3, epsilon) {
return abs(x - y3) < epsilon;
}
function between(number, x, y3, exclusive) {
var minimum = min2(x, y3);
var maximum = max2(x, y3);
return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum;
}
function clamp4(number, x, y3) {
var minimum = min2(x, y3);
var maximum = max2(x, y3);
return min2(max2(minimum, number), maximum);
}
function sign(x) {
return +(x > 0) - +(x < 0);
}
function format(string, replacements) {
forEach(replacements, function(replacement) {
string = string.replace("%s", "" + replacement);
});
return string;
}
function pad(number) {
return number < 10 ? "0" + number : "" + number;
}
var ids = {};
function uniqueId(prefix) {
return "" + prefix + pad(ids[prefix] = (ids[prefix] || 0) + 1);
}
function EventBinder() {
var listeners = [];
function bind(targets, events2, callback, options) {
forEachEvent(targets, events2, function(target, event, namespace) {
var isEventTarget = "addEventListener" in target;
var remover = isEventTarget ? target.removeEventListener.bind(target, event, callback, options) : target["removeListener"].bind(target, callback);
isEventTarget ? target.addEventListener(event, callback, options) : target["addListener"](callback);
listeners.push([target, event, namespace, callback, remover]);
});
}
function unbind(targets, events2, callback) {
forEachEvent(targets, events2, function(target, event, namespace) {
listeners = listeners.filter(function(listener) {
if (listener[0] === target && listener[1] === event && listener[2] === namespace && (!callback || listener[3] === callback)) {
listener[4]();
return false;
}
return true;
});
});
}
function dispatch(target, type, detail) {
var e2;
var bubbles = true;
if (typeof CustomEvent === "function") {
e2 = new CustomEvent(type, {
bubbles,
detail
});
} else {
e2 = document.createEvent("CustomEvent");
e2.initCustomEvent(type, bubbles, false, detail);
}
target.dispatchEvent(e2);
return e2;
}
function forEachEvent(targets, events2, iteratee) {
forEach(targets, function(target) {
target && forEach(events2, function(events22) {
events22.split(" ").forEach(function(eventNS) {
var fragment = eventNS.split(".");
iteratee(target, fragment[0], fragment[1]);
});
});
});
}
function destroy() {
listeners.forEach(function(data) {
data[4]();
});
empty(listeners);
}
return {
bind,
unbind,
dispatch,
destroy
};
}
var EVENT_MOUNTED = "mounted";
var EVENT_READY = "ready";
var EVENT_MOVE = "move";
var EVENT_MOVED = "moved";
var EVENT_CLICK = "click";
var EVENT_ACTIVE = "active";
var EVENT_INACTIVE = "inactive";
var EVENT_VISIBLE = "visible";
var EVENT_HIDDEN = "hidden";
var EVENT_REFRESH = "refresh";
var EVENT_UPDATED = "updated";
var EVENT_RESIZE = "resize";
var EVENT_RESIZED = "resized";
var EVENT_DRAG = "drag";
var EVENT_DRAGGING = "dragging";
var EVENT_DRAGGED = "dragged";
var EVENT_SCROLL = "scroll";
var EVENT_SCROLLED = "scrolled";
var EVENT_OVERFLOW = "overflow";
var EVENT_DESTROY = "destroy";
var EVENT_ARROWS_MOUNTED = "arrows:mounted";
var EVENT_ARROWS_UPDATED = "arrows:updated";
var EVENT_PAGINATION_MOUNTED = "pagination:mounted";
var EVENT_PAGINATION_UPDATED = "pagination:updated";
var EVENT_NAVIGATION_MOUNTED = "navigation:mounted";
var EVENT_AUTOPLAY_PLAY = "autoplay:play";
var EVENT_AUTOPLAY_PLAYING = "autoplay:playing";
var EVENT_AUTOPLAY_PAUSE = "autoplay:pause";
var EVENT_LAZYLOAD_LOADED = "lazyload:loaded";
var EVENT_SLIDE_KEYDOWN = "sk";
var EVENT_SHIFTED = "sh";
var EVENT_END_INDEX_CHANGED = "ei";
function EventInterface(Splide2) {
var bus = Splide2 ? Splide2.event.bus : document.createDocumentFragment();
var binder = EventBinder();
function on(events2, callback) {
binder.bind(bus, toArray3(events2).join(" "), function(e2) {
callback.apply(callback, isArray(e2.detail) ? e2.detail : []);
});
}
function emit(event) {
binder.dispatch(bus, event, slice(arguments, 1));
}
if (Splide2) {
Splide2.event.on(EVENT_DESTROY, binder.destroy);
}
return assign(binder, {
bus,
on,
off: apply(binder.unbind, bus),
emit
});
}
function RequestInterval(interval, onInterval, onUpdate, limit) {
var now = Date.now;
var startTime;
var rate = 0;
var id;
var paused = true;
var count = 0;
function update() {
if (!paused) {
rate = interval ? min2((now() - startTime) / interval, 1) : 1;
onUpdate && onUpdate(rate);
if (rate >= 1) {
onInterval();
startTime = now();
if (limit && ++count >= limit) {
return pause();
}
}
id = raf(update);
}
}
function start3(resume) {
resume || cancel();
startTime = now() - (resume ? rate * interval : 0);
paused = false;
id = raf(update);
}
function pause() {
paused = true;
}
function rewind() {
startTime = now();
rate = 0;
if (onUpdate) {
onUpdate(rate);
}
}
function cancel() {
id && cancelAnimationFrame(id);
rate = 0;
id = 0;
paused = true;
}
function set(time) {
interval = time;
}
function isPaused() {
return paused;
}
return {
start: start3,
rewind,
pause,
cancel,
set,
isPaused
};
}
function State(initialState) {
var state = initialState;
function set(value) {
state = value;
}
function is(states) {
return includes(toArray3(states), state);
}
return {
set,
is
};
}
function Throttle(func, duration) {
var interval = RequestInterval(duration || 0, func, null, 1);
return function() {
interval.isPaused() && interval.start();
};
}
function Media(Splide2, Components2, options) {
var state = Splide2.state;
var breakpoints = options.breakpoints || {};
var reducedMotion = options.reducedMotion || {};
var binder = EventBinder();
var queries = [];
function setup() {
var isMin = options.mediaQuery === "min";
ownKeys(breakpoints).sort(function(n2, m3) {
return isMin ? +n2 - +m3 : +m3 - +n2;
}).forEach(function(key) {
register(breakpoints[key], "(" + (isMin ? "min" : "max") + "-width:" + key + "px)");
});
register(reducedMotion, MEDIA_PREFERS_REDUCED_MOTION);
update();
}
function destroy(completely) {
if (completely) {
binder.destroy();
}
}
function register(options2, query2) {
var queryList = matchMedia(query2);
binder.bind(queryList, "change", update);
queries.push([options2, queryList]);
}
function update() {
var destroyed = state.is(DESTROYED);
var direction = options.direction;
var merged = queries.reduce(function(merged2, entry) {
return merge(merged2, entry[1].matches ? entry[0] : {});
}, {});
omit(options);
set(merged);
if (options.destroy) {
Splide2.destroy(options.destroy === "completely");
} else if (destroyed) {
destroy(true);
Splide2.mount();
} else {
direction !== options.direction && Splide2.refresh();
}
}
function reduce(enable) {
if (matchMedia(MEDIA_PREFERS_REDUCED_MOTION).matches) {
enable ? merge(options, reducedMotion) : omit(options, ownKeys(reducedMotion));
}
}
function set(opts, base, notify) {
merge(options, opts);
base && merge(Object.getPrototypeOf(options), opts);
if (notify || !state.is(CREATED)) {
Splide2.emit(EVENT_UPDATED, options);
}
}
return {
setup,
destroy,
reduce,
set
};
}
var ARROW = "Arrow";
var ARROW_LEFT = ARROW + "Left";
var ARROW_RIGHT = ARROW + "Right";
var ARROW_UP = ARROW + "Up";
var ARROW_DOWN = ARROW + "Down";
var RTL = "rtl";
var TTB = "ttb";
var ORIENTATION_MAP = {
width: ["height"],
left: ["top", "right"],
right: ["bottom", "left"],
x: ["y"],
X: ["Y"],
Y: ["X"],
ArrowLeft: [ARROW_UP, ARROW_RIGHT],
ArrowRight: [ARROW_DOWN, ARROW_LEFT]
};
function Direction(Splide2, Components2, options) {
function resolve(prop, axisOnly, direction) {
direction = direction || options.direction;
var index = direction === RTL && !axisOnly ? 1 : direction === TTB ? 0 : -1;
return ORIENTATION_MAP[prop] && ORIENTATION_MAP[prop][index] || prop.replace(/width|left|right/i, function(match, offset2) {
var replacement = ORIENTATION_MAP[match.toLowerCase()][index] || match;
return offset2 > 0 ? replacement.charAt(0).toUpperCase() + replacement.slice(1) : replacement;
});
}
function orient(value) {
return value * (options.direction === RTL ? 1 : -1);
}
return {
resolve,
orient
};
}
var ROLE = "role";
var TAB_INDEX = "tabindex";
var DISABLED = "disabled";
var ARIA_PREFIX = "aria-";
var ARIA_CONTROLS = ARIA_PREFIX + "controls";
var ARIA_CURRENT = ARIA_PREFIX + "current";
var ARIA_SELECTED = ARIA_PREFIX + "selected";
var ARIA_LABEL = ARIA_PREFIX + "label";
var ARIA_LABELLEDBY = ARIA_PREFIX + "labelledby";
var ARIA_HIDDEN = ARIA_PREFIX + "hidden";
var ARIA_ORIENTATION = ARIA_PREFIX + "orientation";
var ARIA_ROLEDESCRIPTION = ARIA_PREFIX + "roledescription";
var ARIA_LIVE = ARIA_PREFIX + "live";
var ARIA_BUSY = ARIA_PREFIX + "busy";
var ARIA_ATOMIC = ARIA_PREFIX + "atomic";
var ALL_ATTRIBUTES = [ROLE, TAB_INDEX, DISABLED, ARIA_CONTROLS, ARIA_CURRENT, ARIA_LABEL, ARIA_LABELLEDBY, ARIA_HIDDEN, ARIA_ORIENTATION, ARIA_ROLEDESCRIPTION];
var CLASS_PREFIX = PROJECT_CODE + "__";
var STATUS_CLASS_PREFIX = "is-";
var CLASS_ROOT = PROJECT_CODE;
var CLASS_TRACK = CLASS_PREFIX + "track";
var CLASS_LIST = CLASS_PREFIX + "list";
var CLASS_SLIDE = CLASS_PREFIX + "slide";
var CLASS_CLONE = CLASS_SLIDE + "--clone";
var CLASS_CONTAINER = CLASS_SLIDE + "__container";
var CLASS_ARROWS = CLASS_PREFIX + "arrows";
var CLASS_ARROW = CLASS_PREFIX + "arrow";
var CLASS_ARROW_PREV = CLASS_ARROW + "--prev";
var CLASS_ARROW_NEXT = CLASS_ARROW + "--next";
var CLASS_PAGINATION = CLASS_PREFIX + "pagination";
var CLASS_PAGINATION_PAGE = CLASS_PAGINATION + "__page";
var CLASS_PROGRESS = CLASS_PREFIX + "progress";
var CLASS_PROGRESS_BAR = CLASS_PROGRESS + "__bar";
var CLASS_TOGGLE = CLASS_PREFIX + "toggle";
var CLASS_TOGGLE_PLAY = CLASS_TOGGLE + "__play";
var CLASS_TOGGLE_PAUSE = CLASS_TOGGLE + "__pause";
var CLASS_SPINNER = CLASS_PREFIX + "spinner";
var CLASS_SR = CLASS_PREFIX + "sr";
var CLASS_INITIALIZED = STATUS_CLASS_PREFIX + "initialized";
var CLASS_ACTIVE = STATUS_CLASS_PREFIX + "active";
var CLASS_PREV = STATUS_CLASS_PREFIX + "prev";
var CLASS_NEXT = STATUS_CLASS_PREFIX + "next";
var CLASS_VISIBLE = STATUS_CLASS_PREFIX + "visible";
var CLASS_LOADING = STATUS_CLASS_PREFIX + "loading";
var CLASS_FOCUS_IN = STATUS_CLASS_PREFIX + "focus-in";
var CLASS_OVERFLOW = STATUS_CLASS_PREFIX + "overflow";
var STATUS_CLASSES = [CLASS_ACTIVE, CLASS_VISIBLE, CLASS_PREV, CLASS_NEXT, CLASS_LOADING, CLASS_FOCUS_IN, CLASS_OVERFLOW];
var CLASSES = {
slide: CLASS_SLIDE,
clone: CLASS_CLONE,
arrows: CLASS_ARROWS,
arrow: CLASS_ARROW,
prev: CLASS_ARROW_PREV,
next: CLASS_ARROW_NEXT,
pagination: CLASS_PAGINATION,
page: CLASS_PAGINATION_PAGE,
spinner: CLASS_SPINNER
};
function closest(from, selector3) {
if (isFunction(from.closest)) {
return from.closest(selector3);
}
var elm = from;
while (elm && elm.nodeType === 1) {
if (matches(elm, selector3)) {
break;
}
elm = elm.parentElement;
}
return elm;
}
var FRICTION = 5;
var LOG_INTERVAL = 200;
var POINTER_DOWN_EVENTS = "touchstart mousedown";
var POINTER_MOVE_EVENTS = "touchmove mousemove";
var POINTER_UP_EVENTS = "touchend touchcancel mouseup click";
function Elements(Splide2, Components2, options) {
var _EventInterface = EventInterface(Splide2), on = _EventInterface.on, bind = _EventInterface.bind;
var root = Splide2.root;
var i18n = options.i18n;
var elements = {};
var slides = [];
var rootClasses = [];
var trackClasses = [];
var track;
var list;
var isUsingKey;
function setup() {
collect();
init4();
update();
}
function mount() {
on(EVENT_REFRESH, destroy);
on(EVENT_REFRESH, setup);
on(EVENT_UPDATED, update);
bind(document, POINTER_DOWN_EVENTS + " keydown", function(e2) {
isUsingKey = e2.type === "keydown";
}, {
capture: true
});
bind(root, "focusin", function() {
toggleClass(root, CLASS_FOCUS_IN, !!isUsingKey);
});
}
function destroy(completely) {
var attrs = ALL_ATTRIBUTES.concat("style");
empty(slides);
removeClass(root, rootClasses);
removeClass(track, trackClasses);
removeAttribute([track, list], attrs);
removeAttribute(root, completely ? attrs : ["style", ARIA_ROLEDESCRIPTION]);
}
function update() {
removeClass(root, rootClasses);
removeClass(track, trackClasses);
rootClasses = getClasses(CLASS_ROOT);
trackClasses = getClasses(CLASS_TRACK);
addClass(root, rootClasses);
addClass(track, trackClasses);
setAttribute(root, ARIA_LABEL, options.label);
setAttribute(root, ARIA_LABELLEDBY, options.labelledby);
}
function collect() {
track = find("." + CLASS_TRACK);
list = child(track, "." + CLASS_LIST);
assert(track && list, "A track/list element is missing.");
push(slides, children(list, "." + CLASS_SLIDE + ":not(." + CLASS_CLONE + ")"));
forOwn({
arrows: CLASS_ARROWS,
pagination: CLASS_PAGINATION,
prev: CLASS_ARROW_PREV,
next: CLASS_ARROW_NEXT,
bar: CLASS_PROGRESS_BAR,
toggle: CLASS_TOGGLE
}, function(className, key) {
elements[key] = find("." + className);
});
assign(elements, {
root,
track,
list,
slides
});
}
function init4() {
var id = root.id || uniqueId(PROJECT_CODE);
var role = options.role;
root.id = id;
track.id = track.id || id + "-track";
list.id = list.id || id + "-list";
if (!getAttribute(root, ROLE) && root.tagName !== "SECTION" && role) {
setAttribute(root, ROLE, role);
}
setAttribute(root, ARIA_ROLEDESCRIPTION, i18n.carousel);
setAttribute(list, ROLE, "presentation");
}
function find(selector3) {
var elm = query(root, selector3);
return elm && closest(elm, "." + CLASS_ROOT) === root ? elm : void 0;
}
function getClasses(base) {
return [base + "--" + options.type, base + "--" + options.direction, options.drag && base + "--draggable", options.isNavigation && base + "--nav", base === CLASS_ROOT && CLASS_ACTIVE];
}
return assign(elements, {
setup,
mount,
destroy
});
}
var SLIDE = "slide";
var LOOP = "loop";
var FADE = "fade";
function Slide$1(Splide2, index, slideIndex, slide) {
var event = EventInterface(Splide2);
var on = event.on, emit = event.emit, bind = event.bind;
var Components = Splide2.Components, root = Splide2.root, options = Splide2.options;
var isNavigation = options.isNavigation, updateOnMove = options.updateOnMove, i18n = options.i18n, pagination = options.pagination, slideFocus = options.slideFocus;
var resolve = Components.Direction.resolve;
var styles = getAttribute(slide, "style");
var label = getAttribute(slide, ARIA_LABEL);
var isClone = slideIndex > -1;
var container = child(slide, "." + CLASS_CONTAINER);
var destroyed;
function mount() {
if (!isClone) {
slide.id = root.id + "-slide" + pad(index + 1);
setAttribute(slide, ROLE, pagination ? "tabpanel" : "group");
setAttribute(slide, ARIA_ROLEDESCRIPTION, i18n.slide);
setAttribute(slide, ARIA_LABEL, label || format(i18n.slideLabel, [index + 1, Splide2.length]));
}
listen();
}
function listen() {
bind(slide, "click", apply(emit, EVENT_CLICK, self2));
bind(slide, "keydown", apply(emit, EVENT_SLIDE_KEYDOWN, self2));
on([EVENT_MOVED, EVENT_SHIFTED, EVENT_SCROLLED], update);
on(EVENT_NAVIGATION_MOUNTED, initNavigation);
if (updateOnMove) {
on(EVENT_MOVE, onMove);
}
}
function destroy() {
destroyed = true;
event.destroy();
removeClass(slide, STATUS_CLASSES);
removeAttribute(slide, ALL_ATTRIBUTES);
setAttribute(slide, "style", styles);
setAttribute(slide, ARIA_LABEL, label || "");
}
function initNavigation() {
var controls = Splide2.splides.map(function(target) {
var Slide2 = target.splide.Components.Slides.getAt(index);
return Slide2 ? Slide2.slide.id : "";
}).join(" ");
setAttribute(slide, ARIA_LABEL, format(i18n.slideX, (isClone ? slideIndex : index) + 1));
setAttribute(slide, ARIA_CONTROLS, controls);
setAttribute(slide, ROLE, slideFocus ? "button" : "");
slideFocus && removeAttribute(slide, ARIA_ROLEDESCRIPTION);
}
function onMove() {
if (!destroyed) {
update();
}
}
function update() {
if (!destroyed) {
var curr = Splide2.index;
updateActivity();
updateVisibility();
toggleClass(slide, CLASS_PREV, index === curr - 1);
toggleClass(slide, CLASS_NEXT, index === curr + 1);
}
}
function updateActivity() {
var active = isActive();
if (active !== hasClass(slide, CLASS_ACTIVE)) {
toggleClass(slide, CLASS_ACTIVE, active);
setAttribute(slide, ARIA_CURRENT, isNavigation && active || "");
emit(active ? EVENT_ACTIVE : EVENT_INACTIVE, self2);
}
}
function updateVisibility() {
var visible = isVisible();
var hidden = !visible && (!isActive() || isClone);
if (!Splide2.state.is([MOVING, SCROLLING])) {
setAttribute(slide, ARIA_HIDDEN, hidden || "");
}
setAttribute(queryAll(slide, options.focusableNodes || ""), TAB_INDEX, hidden ? -1 : "");
if (slideFocus) {
setAttribute(slide, TAB_INDEX, hidden ? -1 : 0);
}
if (visible !== hasClass(slide, CLASS_VISIBLE)) {
toggleClass(slide, CLASS_VISIBLE, visible);
emit(visible ? EVENT_VISIBLE : EVENT_HIDDEN, self2);
}
if (!visible && document.activeElement === slide) {
var Slide2 = Components.Slides.getAt(Splide2.index);
Slide2 && focus(Slide2.slide);
}
}
function style$1(prop, value, useContainer) {
style(useContainer && container || slide, prop, value);
}
function isActive() {
var curr = Splide2.index;
return curr === index || options.cloneStatus && curr === slideIndex;
}
function isVisible() {
if (Splide2.is(FADE)) {
return isActive();
}
var trackRect = rect(Components.Elements.track);
var slideRect = rect(slide);
var left2 = resolve("left", true);
var right2 = resolve("right", true);
return floor(trackRect[left2]) <= ceil(slideRect[left2]) && floor(slideRect[right2]) <= ceil(trackRect[right2]);
}
function isWithin(from, distance) {
var diff = abs(from - index);
if (!isClone && (options.rewind || Splide2.is(LOOP))) {
diff = min2(diff, Splide2.length - diff);
}
return diff <= distance;
}
var self2 = {
index,
slideIndex,
slide,
container,
isClone,
mount,
destroy,
update,
style: style$1,
isWithin
};
return self2;
}
function Slides(Splide2, Components2, options) {
var _EventInterface2 = EventInterface(Splide2), on = _EventInterface2.on, emit = _EventInterface2.emit, bind = _EventInterface2.bind;
var _Components2$Elements = Components2.Elements, slides = _Components2$Elements.slides, list = _Components2$Elements.list;
var Slides2 = [];
function mount() {
init4();
on(EVENT_REFRESH, destroy);
on(EVENT_REFRESH, init4);
}
function init4() {
slides.forEach(function(slide, index) {
register(slide, index, -1);
});
}
function destroy() {
forEach$12(function(Slide2) {
Slide2.destroy();
});
empty(Slides2);
}
function update() {
forEach$12(function(Slide2) {
Slide2.update();
});
}
function register(slide, index, slideIndex) {
var object = Slide$1(Splide2, index, slideIndex, slide);
object.mount();
Slides2.push(object);
Slides2.sort(function(Slide1, Slide2) {
return Slide1.index - Slide2.index;
});
}
function get(excludeClones) {
return excludeClones ? filter(function(Slide2) {
return !Slide2.isClone;
}) : Slides2;
}
function getIn(page) {
var Controller2 = Components2.Controller;
var index = Controller2.toIndex(page);
var max4 = Controller2.hasFocus() ? 1 : options.perPage;
return filter(function(Slide2) {
return between(Slide2.index, index, index + max4 - 1);
});
}
function getAt(index) {
return filter(index)[0];
}
function add(items, index) {
forEach(items, function(slide) {
if (isString(slide)) {
slide = parseHtml(slide);
}
if (isHTMLElement2(slide)) {
var ref2 = slides[index];
ref2 ? before(slide, ref2) : append(list, slide);
addClass(slide, options.classes.slide);
observeImages(slide, apply(emit, EVENT_RESIZE));
}
});
emit(EVENT_REFRESH);
}
function remove$1(matcher) {
remove(filter(matcher).map(function(Slide2) {
return Slide2.slide;
}));
emit(EVENT_REFRESH);
}
function forEach$12(iteratee, excludeClones) {
get(excludeClones).forEach(iteratee);
}
function filter(matcher) {
return Slides2.filter(isFunction(matcher) ? matcher : function(Slide2) {
return isString(matcher) ? matches(Slide2.slide, matcher) : includes(toArray3(matcher), Slide2.index);
});
}
function style2(prop, value, useContainer) {
forEach$12(function(Slide2) {
Slide2.style(prop, value, useContainer);
});
}
function observeImages(elm, callback) {
var images = queryAll(elm, "img");
var length = images.length;
if (length) {
images.forEach(function(img) {
bind(img, "load error", function() {
if (!--length) {
callback();
}
});
});
} else {
callback();
}
}
function getLength(excludeClones) {
return excludeClones ? slides.length : Slides2.length;
}
function isEnough() {
return Slides2.length > options.perPage;
}
return {
mount,
destroy,
update,
register,
get,
getIn,
getAt,
add,
remove: remove$1,
forEach: forEach$12,
filter,
style: style2,
getLength,
isEnough
};
}
function Layout(Splide2, Components2, options) {
var _EventInterface3 = EventInterface(Splide2), on = _EventInterface3.on, bind = _EventInterface3.bind, emit = _EventInterface3.emit;
var Slides2 = Components2.Slides;
var resolve = Components2.Direction.resolve;
var _Components2$Elements2 = Components2.Elements, root = _Components2$Elements2.root, track = _Components2$Elements2.track, list = _Components2$Elements2.list;
var getAt = Slides2.getAt, styleSlides = Slides2.style;
var vertical;
var rootRect;
var overflow;
function mount() {
init4();
bind(window, "resize load", Throttle(apply(emit, EVENT_RESIZE)));
on([EVENT_UPDATED, EVENT_REFRESH], init4);
on(EVENT_RESIZE, resize);
}
function init4() {
vertical = options.direction === TTB;
style(root, "maxWidth", unit(options.width));
style(track, resolve("paddingLeft"), cssPadding(false));
style(track, resolve("paddingRight"), cssPadding(true));
resize(true);
}
function resize(force) {
var newRect = rect(root);
if (force || rootRect.width !== newRect.width || rootRect.height !== newRect.height) {
style(track, "height", cssTrackHeight());
styleSlides(resolve("marginRight"), unit(options.gap));
styleSlides("width", cssSlideWidth());
styleSlides("height", cssSlideHeight(), true);
rootRect = newRect;
emit(EVENT_RESIZED);
if (overflow !== (overflow = isOverflow())) {
toggleClass(root, CLASS_OVERFLOW, overflow);
emit(EVENT_OVERFLOW, overflow);
}
}
}
function cssPadding(right2) {
var padding = options.padding;
var prop = resolve(right2 ? "right" : "left");
return padding && unit(padding[prop] || (isObject(padding) ? 0 : padding)) || "0px";
}
function cssTrackHeight() {
var height = "";
if (vertical) {
height = cssHeight();
assert(height, "height or heightRatio is missing.");
height = "calc(" + height + " - " + cssPadding(false) + " - " + cssPadding(true) + ")";
}
return height;
}
function cssHeight() {
return unit(options.height || rect(list).width * options.heightRatio);
}
function cssSlideWidth() {
return options.autoWidth ? null : unit(options.fixedWidth) || (vertical ? "" : cssSlideSize());
}
function cssSlideHeight() {
return unit(options.fixedHeight) || (vertical ? options.autoHeight ? null : cssSlideSize() : cssHeight());
}
function cssSlideSize() {
var gap = unit(options.gap);
return "calc((100%" + (gap && " + " + gap) + ")/" + (options.perPage || 1) + (gap && " - " + gap) + ")";
}
function listSize() {
return rect(list)[resolve("width")];
}
function slideSize(index, withoutGap) {
var Slide2 = getAt(index || 0);
return Slide2 ? rect(Slide2.slide)[resolve("width")] + (withoutGap ? 0 : getGap()) : 0;
}
function totalSize(index, withoutGap) {
var Slide2 = getAt(index);
if (Slide2) {
var right2 = rect(Slide2.slide)[resolve("right")];
var left2 = rect(list)[resolve("left")];
return abs(right2 - left2) + (withoutGap ? 0 : getGap());
}
return 0;
}
function sliderSize(withoutGap) {
return totalSize(Splide2.length - 1) - totalSize(0) + slideSize(0, withoutGap);
}
function getGap() {
var Slide2 = getAt(0);
return Slide2 && parseFloat(style(Slide2.slide, resolve("marginRight"))) || 0;
}
function getPadding(right2) {
return parseFloat(style(track, resolve("padding" + (right2 ? "Right" : "Left")))) || 0;
}
function isOverflow() {
return Splide2.is(FADE) || sliderSize(true) > listSize();
}
return {
mount,
resize,
listSize,
slideSize,
sliderSize,
totalSize,
getPadding,
isOverflow
};
}
var MULTIPLIER = 2;
function Clones(Splide2, Components2, options) {
var event = EventInterface(Splide2);
var on = event.on;
var Elements2 = Components2.Elements, Slides2 = Components2.Slides;
var resolve = Components2.Direction.resolve;
var clones = [];
var cloneCount;
function mount() {
on(EVENT_REFRESH, remount);
on([EVENT_UPDATED, EVENT_RESIZE], observe);
if (cloneCount = computeCloneCount()) {
generate(cloneCount);
Components2.Layout.resize(true);
}
}
function remount() {
destroy();
mount();
}
function destroy() {
remove(clones);
empty(clones);
event.destroy();
}
function observe() {
var count = computeCloneCount();
if (cloneCount !== count) {
if (cloneCount < count || !count) {
event.emit(EVENT_REFRESH);
}
}
}
function generate(count) {
var slides = Slides2.get().slice();
var length = slides.length;
if (length) {
while (slides.length < count) {
push(slides, slides);
}
push(slides.slice(-count), slides.slice(0, count)).forEach(function(Slide2, index) {
var isHead = index < count;
var clone = cloneDeep(Slide2.slide, index);
isHead ? before(clone, slides[0].slide) : append(Elements2.list, clone);
push(clones, clone);
Slides2.register(clone, index - count + (isHead ? 0 : length), Slide2.index);
});
}
}
function cloneDeep(elm, index) {
var clone = elm.cloneNode(true);
addClass(clone, options.classes.clone);
clone.id = Splide2.root.id + "-clone" + pad(index + 1);
return clone;
}
function computeCloneCount() {
var clones2 = options.clones;
if (!Splide2.is(LOOP)) {
clones2 = 0;
} else if (isUndefined(clones2)) {
var fixedSize = options[resolve("fixedWidth")] && Components2.Layout.slideSize(0);
var fixedCount = fixedSize && ceil(rect(Elements2.track)[resolve("width")] / fixedSize);
clones2 = fixedCount || options[resolve("autoWidth")] && Splide2.length || options.perPage * MULTIPLIER;
}
return clones2;
}
return {
mount,
destroy
};
}
function Move(Splide2, Components2, options) {
var _EventInterface4 = EventInterface(Splide2), on = _EventInterface4.on, emit = _EventInterface4.emit;
var set = Splide2.state.set;
var _Components2$Layout = Components2.Layout, slideSize = _Components2$Layout.slideSize, getPadding = _Components2$Layout.getPadding, totalSize = _Components2$Layout.totalSize, listSize = _Components2$Layout.listSize, sliderSize = _Components2$Layout.sliderSize;
var _Components2$Directio = Components2.Direction, resolve = _Components2$Directio.resolve, orient = _Components2$Directio.orient;
var _Components2$Elements3 = Components2.Elements, list = _Components2$Elements3.list, track = _Components2$Elements3.track;
var Transition;
function mount() {
Transition = Components2.Transition;
on([EVENT_MOUNTED, EVENT_RESIZED, EVENT_UPDATED, EVENT_REFRESH], reposition);
}
function reposition() {
if (!Components2.Controller.isBusy()) {
Components2.Scroll.cancel();
jump(Splide2.index);
Components2.Slides.update();
}
}
function move(dest, index, prev, callback) {
if (dest !== index && canShift(dest > prev)) {
cancel();
translate(shift(getPosition(), dest > prev), true);
}
set(MOVING);
emit(EVENT_MOVE, index, prev, dest);
Transition.start(index, function() {
set(IDLE);
emit(EVENT_MOVED, index, prev, dest);
callback && callback();
});
}
function jump(index) {
translate(toPosition(index, true));
}
function translate(position, preventLoop) {
if (!Splide2.is(FADE)) {
var destination = preventLoop ? position : loop(position);
style(list, "transform", "translate" + resolve("X") + "(" + destination + "px)");
position !== destination && emit(EVENT_SHIFTED);
}
}
function loop(position) {
if (Splide2.is(LOOP)) {
var index = toIndex(position);
var exceededMax = index > Components2.Controller.getEnd();
var exceededMin = index < 0;
if (exceededMin || exceededMax) {
position = shift(position, exceededMax);
}
}
return position;
}
function shift(position, backwards) {
var excess = position - getLimit(backwards);
var size = sliderSize();
position -= orient(size * (ceil(abs(excess) / size) || 1)) * (backwards ? 1 : -1);
return position;
}
function cancel() {
translate(getPosition(), true);
Transition.cancel();
}
function toIndex(position) {
var Slides2 = Components2.Slides.get();
var index = 0;
var minDistance = Infinity;
for (var i3 = 0; i3 < Slides2.length; i3++) {
var slideIndex = Slides2[i3].index;
var distance = abs(toPosition(slideIndex, true) - position);
if (distance <= minDistance) {
minDistance = distance;
index = slideIndex;
} else {
break;
}
}
return index;
}
function toPosition(index, trimming) {
var position = orient(totalSize(index - 1) - offset2(index));
return trimming ? trim(position) : position;
}
function getPosition() {
var left2 = resolve("left");
return rect(list)[left2] - rect(track)[left2] + orient(getPadding(false));
}
function trim(position) {
if (options.trimSpace && Splide2.is(SLIDE)) {
position = clamp4(position, 0, orient(sliderSize(true) - listSize()));
}
return position;
}
function offset2(index) {
var focus2 = options.focus;
return focus2 === "center" ? (listSize() - slideSize(index, true)) / 2 : +focus2 * slideSize(index) || 0;
}
function getLimit(max4) {
return toPosition(max4 ? Components2.Controller.getEnd() : 0, !!options.trimSpace);
}
function canShift(backwards) {
var shifted = orient(shift(getPosition(), backwards));
return backwards ? shifted >= 0 : shifted <= list[resolve("scrollWidth")] - rect(track)[resolve("width")];
}
function exceededLimit(max4, position) {
position = isUndefined(position) ? getPosition() : position;
var exceededMin = max4 !== true && orient(position) < orient(getLimit(false));
var exceededMax = max4 !== false && orient(position) > orient(getLimit(true));
return exceededMin || exceededMax;
}
return {
mount,
move,
jump,
translate,
shift,
cancel,
toIndex,
toPosition,
getPosition,
getLimit,
exceededLimit,
reposition
};
}
function Controller(Splide2, Components2, options) {
var _EventInterface5 = EventInterface(Splide2), on = _EventInterface5.on, emit = _EventInterface5.emit;
var Move2 = Components2.Move;
var getPosition = Move2.getPosition, getLimit = Move2.getLimit, toPosition = Move2.toPosition;
var _Components2$Slides = Components2.Slides, isEnough = _Components2$Slides.isEnough, getLength = _Components2$Slides.getLength;
var omitEnd = options.omitEnd;
var isLoop = Splide2.is(LOOP);
var isSlide = Splide2.is(SLIDE);
var getNext = apply(getAdjacent, false);
var getPrev = apply(getAdjacent, true);
var currIndex = options.start || 0;
var endIndex;
var prevIndex = currIndex;
var slideCount;
var perMove;
var perPage;
function mount() {
init4();
on([EVENT_UPDATED, EVENT_REFRESH, EVENT_END_INDEX_CHANGED], init4);
on(EVENT_RESIZED, onResized);
}
function init4() {
slideCount = getLength(true);
perMove = options.perMove;
perPage = options.perPage;
endIndex = getEnd();
var index = clamp4(currIndex, 0, omitEnd ? endIndex : slideCount - 1);
if (index !== currIndex) {
currIndex = index;
Move2.reposition();
}
}
function onResized() {
if (endIndex !== getEnd()) {
emit(EVENT_END_INDEX_CHANGED);
}
}
function go(control, allowSameIndex, callback) {
if (!isBusy()) {
var dest = parse(control);
var index = loop(dest);
if (index > -1 && (allowSameIndex || index !== currIndex)) {
setIndex(index);
Move2.move(dest, index, prevIndex, callback);
}
}
}
function scroll(destination, duration, snap3, callback) {
Components2.Scroll.scroll(destination, duration, snap3, function() {
var index = loop(Move2.toIndex(getPosition()));
setIndex(omitEnd ? min2(index, endIndex) : index);
callback && callback();
});
}
function parse(control) {
var index = currIndex;
if (isString(control)) {
var _ref = control.match(/([+\-<>])(\d+)?/) || [], indicator = _ref[1], number = _ref[2];
if (indicator === "+" || indicator === "-") {
index = computeDestIndex(currIndex + +("" + indicator + (+number || 1)), currIndex);
} else if (indicator === ">") {
index = number ? toIndex(+number) : getNext(true);
} else if (indicator === "<") {
index = getPrev(true);
}
} else {
index = isLoop ? control : clamp4(control, 0, endIndex);
}
return index;
}
function getAdjacent(prev, destination) {
var number = perMove || (hasFocus() ? 1 : perPage);
var dest = computeDestIndex(currIndex + number * (prev ? -1 : 1), currIndex, !(perMove || hasFocus()));
if (dest === -1 && isSlide) {
if (!approximatelyEqual(getPosition(), getLimit(!prev), 1)) {
return prev ? 0 : endIndex;
}
}
return destination ? dest : loop(dest);
}
function computeDestIndex(dest, from, snapPage) {
if (isEnough() || hasFocus()) {
var index = computeMovableDestIndex(dest);
if (index !== dest) {
from = dest;
dest = index;
snapPage = false;
}
if (dest < 0 || dest > endIndex) {
if (!perMove && (between(0, dest, from, true) || between(endIndex, from, dest, true))) {
dest = toIndex(toPage(dest));
} else {
if (isLoop) {
dest = snapPage ? dest < 0 ? -(slideCount % perPage || perPage) : slideCount : dest;
} else if (options.rewind) {
dest = dest < 0 ? endIndex : 0;
} else {
dest = -1;
}
}
} else {
if (snapPage && dest !== from) {
dest = toIndex(toPage(from) + (dest < from ? -1 : 1));
}
}
} else {
dest = -1;
}
return dest;
}
function computeMovableDestIndex(dest) {
if (isSlide && options.trimSpace === "move" && dest !== currIndex) {
var position = getPosition();
while (position === toPosition(dest, true) && between(dest, 0, Splide2.length - 1, !options.rewind)) {
dest < currIndex ? --dest : ++dest;
}
}
return dest;
}
function loop(index) {
return isLoop ? (index + slideCount) % slideCount || 0 : index;
}
function getEnd() {
var end2 = slideCount - (hasFocus() || isLoop && perMove ? 1 : perPage);
while (omitEnd && end2-- > 0) {
if (toPosition(slideCount - 1, true) !== toPosition(end2, true)) {
end2++;
break;
}
}
return clamp4(end2, 0, slideCount - 1);
}
function toIndex(page) {
return clamp4(hasFocus() ? page : perPage * page, 0, endIndex);
}
function toPage(index) {
return hasFocus() ? min2(index, endIndex) : floor((index >= endIndex ? slideCount - 1 : index) / perPage);
}
function toDest(destination) {
var closest2 = Move2.toIndex(destination);
return isSlide ? clamp4(closest2, 0, endIndex) : closest2;
}
function setIndex(index) {
if (index !== currIndex) {
prevIndex = currIndex;
currIndex = index;
}
}
function getIndex(prev) {
return prev ? prevIndex : currIndex;
}
function hasFocus() {
return !isUndefined(options.focus) || options.isNavigation;
}
function isBusy() {
return Splide2.state.is([MOVING, SCROLLING]) && !!options.waitForTransition;
}
return {
mount,
go,
scroll,
getNext,
getPrev,
getAdjacent,
getEnd,
setIndex,
getIndex,
toIndex,
toPage,
toDest,
hasFocus,
isBusy
};
}
var XML_NAME_SPACE = "http://www.w3.org/2000/svg";
var PATH = "m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z";
var SIZE = 40;
function Arrows(Splide2, Components2, options) {
var event = EventInterface(Splide2);
var on = event.on, bind = event.bind, emit = event.emit;
var classes = options.classes, i18n = options.i18n;
var Elements2 = Components2.Elements, Controller2 = Components2.Controller;
var placeholder = Elements2.arrows, track = Elements2.track;
var wrapper = placeholder;
var prev = Elements2.prev;
var next = Elements2.next;
var created;
var wrapperClasses;
var arrows = {};
function mount() {
init4();
on(EVENT_UPDATED, remount);
}
function remount() {
destroy();
mount();
}
function init4() {
var enabled = options.arrows;
if (enabled && !(prev && next)) {
createArrows();
}
if (prev && next) {
assign(arrows, {
prev,
next
});
display(wrapper, enabled ? "" : "none");
addClass(wrapper, wrapperClasses = CLASS_ARROWS + "--" + options.direction);
if (enabled) {
listen();
update();
setAttribute([prev, next], ARIA_CONTROLS, track.id);
emit(EVENT_ARROWS_MOUNTED, prev, next);
}
}
}
function destroy() {
event.destroy();
removeClass(wrapper, wrapperClasses);
if (created) {
remove(placeholder ? [prev, next] : wrapper);
prev = next = null;
} else {
removeAttribute([prev, next], ALL_ATTRIBUTES);
}
}
function listen() {
on([EVENT_MOUNTED, EVENT_MOVED, EVENT_REFRESH, EVENT_SCROLLED, EVENT_END_INDEX_CHANGED], update);
bind(next, "click", apply(go, ">"));
bind(prev, "click", apply(go, "<"));
}
function go(control) {
Controller2.go(control, true);
}
function createArrows() {
wrapper = placeholder || create("div", classes.arrows);
prev = createArrow(true);
next = createArrow(false);
created = true;
append(wrapper, [prev, next]);
!placeholder && before(wrapper, track);
}
function createArrow(prev2) {
var arrow2 = '