UNPKG

img-viewer-react

Version:

image viewer for react

1,545 lines (1,541 loc) 203 kB
import or, { useRef as $, useState as bt, useEffect as Ae } from "react"; import Fe from "react-dom"; var ye = { exports: {} }, Dt = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ze; function Xr() { if (ze) return Dt; ze = 1; var o = or, t = Symbol.for("react.element"), e = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 }; function n(a, c, l) { var u, p = {}, g = null, y = null; l !== void 0 && (g = "" + l), c.key !== void 0 && (g = "" + c.key), c.ref !== void 0 && (y = c.ref); for (u in c) r.call(c, u) && !s.hasOwnProperty(u) && (p[u] = c[u]); if (a && a.defaultProps) for (u in c = a.defaultProps, c) p[u] === void 0 && (p[u] = c[u]); return { $$typeof: t, type: a, key: g, ref: y, props: p, _owner: i.current }; } return Dt.Fragment = e, Dt.jsx = n, Dt.jsxs = n, Dt; } var Ct = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Le; function Br() { return Le || (Le = 1, process.env.NODE_ENV !== "production" && function() { var o = or, t = Symbol.for("react.element"), e = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), n = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), m = Symbol.iterator, R = "@@iterator"; function x(h) { if (h === null || typeof h != "object") return null; var f = m && h[m] || h[R]; return typeof f == "function" ? f : null; } var U = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function M(h) { { for (var f = arguments.length, v = new Array(f > 1 ? f - 1 : 0), T = 1; T < f; T++) v[T - 1] = arguments[T]; at("error", h, v); } } function at(h, f, v) { { var T = U.ReactDebugCurrentFrame, P = T.getStackAddendum(); P !== "" && (f += "%s", v = v.concat([P])); var w = v.map(function(b) { return String(b); }); w.unshift("Warning: " + f), Function.prototype.apply.call(console[h], console, w); } } var Mt = !1, we = !1, Jt = !1, $t = !1, q = !1, Yt; Yt = Symbol.for("react.module.reference"); function V(h) { return !!(typeof h == "string" || typeof h == "function" || h === r || h === s || q || h === i || h === l || h === u || $t || h === y || Mt || we || Jt || typeof h == "object" && h !== null && (h.$$typeof === g || h.$$typeof === p || h.$$typeof === n || h.$$typeof === a || h.$$typeof === c || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. h.$$typeof === Yt || h.getModuleId !== void 0)); } function te(h, f, v) { var T = h.displayName; if (T) return T; var P = f.displayName || f.name || ""; return P !== "" ? v + "(" + P + ")" : v; } function Xt(h) { return h.displayName || "Context"; } function Q(h) { if (h == null) return null; if (typeof h.tag == "number" && M("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof h == "function") return h.displayName || h.name || null; if (typeof h == "string") return h; switch (h) { case r: return "Fragment"; case e: return "Portal"; case s: return "Profiler"; case i: return "StrictMode"; case l: return "Suspense"; case u: return "SuspenseList"; } if (typeof h == "object") switch (h.$$typeof) { case a: var f = h; return Xt(f) + ".Consumer"; case n: var v = h; return Xt(v._context) + ".Provider"; case c: return te(h, h.render, "ForwardRef"); case p: var T = h.displayName || null; return T !== null ? T : Q(h.type) || "Memo"; case g: { var P = h, w = P._payload, b = P._init; try { return Q(b(w)); } catch { return null; } } } return null; } var et = Object.assign, lt = 0, Ot, ht, Ht, Bt, It, _, ct; function ut() { } ut.__reactDisabledLog = !0; function ee() { { if (lt === 0) { Ot = console.log, ht = console.info, Ht = console.warn, Bt = console.error, It = console.group, _ = console.groupCollapsed, ct = console.groupEnd; var h = { configurable: !0, enumerable: !0, value: ut, writable: !0 }; Object.defineProperties(console, { info: h, log: h, warn: h, error: h, group: h, groupCollapsed: h, groupEnd: h }); } lt++; } } function Y() { { if (lt--, lt === 0) { var h = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: et({}, h, { value: Ot }), info: et({}, h, { value: ht }), warn: et({}, h, { value: Ht }), error: et({}, h, { value: Bt }), group: et({}, h, { value: It }), groupCollapsed: et({}, h, { value: _ }), groupEnd: et({}, h, { value: ct }) }); } lt < 0 && M("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var J = U.ReactCurrentDispatcher, mt; function pt(h, f, v) { { if (mt === void 0) try { throw Error(); } catch (P) { var T = P.stack.trim().match(/\n( *(at )?)/); mt = T && T[1] || ""; } return ` ` + mt + h; } } var ft = !1, Tt; { var re = typeof WeakMap == "function" ? WeakMap : Map; Tt = new re(); } function Rt(h, f) { if (!h || ft) return ""; { var v = Tt.get(h); if (v !== void 0) return v; } var T; ft = !0; var P = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var w; w = J.current, J.current = null, ee(); try { if (f) { var b = function() { throw Error(); }; if (Object.defineProperty(b.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(b, []); } catch (N) { T = N; } Reflect.construct(h, [], b); } else { try { b.call(); } catch (N) { T = N; } h.call(b.prototype); } } else { try { throw Error(); } catch (N) { T = N; } h(); } } catch (N) { if (N && T && typeof N.stack == "string") { for (var S = N.stack.split(` `), z = T.stack.split(` `), X = S.length - 1, O = z.length - 1; X >= 1 && O >= 0 && S[X] !== z[O]; ) O--; for (; X >= 1 && O >= 0; X--, O--) if (S[X] !== z[O]) { if (X !== 1 || O !== 1) do if (X--, O--, O < 0 || S[X] !== z[O]) { var Z = ` ` + S[X].replace(" at new ", " at "); return h.displayName && Z.includes("<anonymous>") && (Z = Z.replace("<anonymous>", h.displayName)), typeof h == "function" && Tt.set(h, Z), Z; } while (X >= 1 && O >= 0); break; } } } finally { ft = !1, J.current = w, Y(), Error.prepareStackTrace = P; } var St = h ? h.displayName || h.name : "", vt = St ? pt(St) : ""; return typeof h == "function" && Tt.set(h, vt), vt; } function oe(h, f, v) { return Rt(h, !1); } function ie(h) { var f = h.prototype; return !!(f && f.isReactComponent); } function dt(h, f, v) { if (h == null) return ""; if (typeof h == "function") return Rt(h, ie(h)); if (typeof h == "string") return pt(h); switch (h) { case l: return pt("Suspense"); case u: return pt("SuspenseList"); } if (typeof h == "object") switch (h.$$typeof) { case c: return oe(h.render); case p: return dt(h.type, f, v); case g: { var T = h, P = T._payload, w = T._init; try { return dt(w(P), f, v); } catch { } } } return ""; } var it = Object.prototype.hasOwnProperty, d = {}, k = U.ReactDebugCurrentFrame; function B(h) { if (h) { var f = h._owner, v = dt(h.type, h._source, f ? f.type : null); k.setExtraStackFrame(v); } else k.setExtraStackFrame(null); } function D(h, f, v, T, P) { { var w = Function.call.bind(it); for (var b in h) if (w(h, b)) { var S = void 0; try { if (typeof h[b] != "function") { var z = Error((T || "React class") + ": " + v + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw z.name = "Invariant Violation", z; } S = h[b](f, b, T, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (X) { S = X; } S && !(S instanceof Error) && (B(P), M("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", T || "React class", v, b, typeof S), B(null)), S instanceof Error && !(S.message in d) && (d[S.message] = !0, B(P), M("Failed %s type: %s", v, S.message), B(null)); } } } var L = Array.isArray; function C(h) { return L(h); } function At(h) { { var f = typeof Symbol == "function" && Symbol.toStringTag, v = f && h[Symbol.toStringTag] || h.constructor.name || "Object"; return v; } } function Ft(h) { try { return xe(h), !1; } catch { return !0; } } function xe(h) { return "" + h; } function Ee(h) { if (Ft(h)) return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", At(h)), xe(h); } var Me = U.ReactCurrentOwner, ur = { key: !0, ref: !0, __self: !0, __source: !0 }, Ye, Xe; function pr(h) { if (it.call(h, "ref")) { var f = Object.getOwnPropertyDescriptor(h, "ref").get; if (f && f.isReactWarning) return !1; } return h.ref !== void 0; } function fr(h) { if (it.call(h, "key")) { var f = Object.getOwnPropertyDescriptor(h, "key").get; if (f && f.isReactWarning) return !1; } return h.key !== void 0; } function dr(h, f) { typeof h.ref == "string" && Me.current; } function vr(h, f) { { var v = function() { Ye || (Ye = !0, M("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f)); }; v.isReactWarning = !0, Object.defineProperty(h, "key", { get: v, configurable: !0 }); } } function gr(h, f) { { var v = function() { Xe || (Xe = !0, M("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f)); }; v.isReactWarning = !0, Object.defineProperty(h, "ref", { get: v, configurable: !0 }); } } var yr = function(h, f, v, T, P, w, b) { var S = { // This tag allows us to uniquely identify this as a React Element $$typeof: t, // Built-in properties that belong on the element type: h, key: f, ref: v, props: b, // Record the component responsible for creating this element. _owner: w }; return S._store = {}, Object.defineProperty(S._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(S, "_self", { configurable: !1, enumerable: !1, writable: !1, value: T }), Object.defineProperty(S, "_source", { configurable: !1, enumerable: !1, writable: !1, value: P }), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S; }; function mr(h, f, v, T, P) { { var w, b = {}, S = null, z = null; v !== void 0 && (Ee(v), S = "" + v), fr(f) && (Ee(f.key), S = "" + f.key), pr(f) && (z = f.ref, dr(f, P)); for (w in f) it.call(f, w) && !ur.hasOwnProperty(w) && (b[w] = f[w]); if (h && h.defaultProps) { var X = h.defaultProps; for (w in X) b[w] === void 0 && (b[w] = X[w]); } if (S || z) { var O = typeof h == "function" ? h.displayName || h.name || "Unknown" : h; S && vr(b, O), z && gr(b, O); } return yr(h, S, z, P, T, Me.current, b); } } var se = U.ReactCurrentOwner, Be = U.ReactDebugCurrentFrame; function kt(h) { if (h) { var f = h._owner, v = dt(h.type, h._source, f ? f.type : null); Be.setExtraStackFrame(v); } else Be.setExtraStackFrame(null); } var ne; ne = !1; function ae(h) { return typeof h == "object" && h !== null && h.$$typeof === t; } function De() { { if (se.current) { var h = Q(se.current.type); if (h) return ` Check the render method of \`` + h + "`."; } return ""; } } function Tr(h) { return ""; } var Ce = {}; function kr(h) { { var f = De(); if (!f) { var v = typeof h == "string" ? h : h.displayName || h.name; v && (f = ` Check the top-level render call using <` + v + ">."); } return f; } } function Oe(h, f) { { if (!h._store || h._store.validated || h.key != null) return; h._store.validated = !0; var v = kr(f); if (Ce[v]) return; Ce[v] = !0; var T = ""; h && h._owner && h._owner !== se.current && (T = " It was passed a child from " + Q(h._owner.type) + "."), kt(h), M('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, T), kt(null); } } function He(h, f) { { if (typeof h != "object") return; if (C(h)) for (var v = 0; v < h.length; v++) { var T = h[v]; ae(T) && Oe(T, f); } else if (ae(h)) h._store && (h._store.validated = !0); else if (h) { var P = x(h); if (typeof P == "function" && P !== h.entries) for (var w = P.call(h), b; !(b = w.next()).done; ) ae(b.value) && Oe(b.value, f); } } } function Sr(h) { { var f = h.type; if (f == null || typeof f == "string") return; var v; if (typeof f == "function") v = f.propTypes; else if (typeof f == "object" && (f.$$typeof === c || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. f.$$typeof === p)) v = f.propTypes; else return; if (v) { var T = Q(f); D(v, h.props, "prop", T, h); } else if (f.PropTypes !== void 0 && !ne) { ne = !0; var P = Q(f); M("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", P || "Unknown"); } typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && M("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function br(h) { { for (var f = Object.keys(h.props), v = 0; v < f.length; v++) { var T = f[v]; if (T !== "children" && T !== "key") { kt(h), M("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", T), kt(null); break; } } h.ref !== null && (kt(h), M("Invalid attribute `ref` supplied to `React.Fragment`."), kt(null)); } } var Ie = {}; function Re(h, f, v, T, P, w) { { var b = V(h); if (!b) { var S = ""; (h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (S += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var z = Tr(); z ? S += z : S += De(); var X; h === null ? X = "null" : C(h) ? X = "array" : h !== void 0 && h.$$typeof === t ? (X = "<" + (Q(h.type) || "Unknown") + " />", S = " Did you accidentally export a JSX literal instead of a component?") : X = typeof h, M("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", X, S); } var O = mr(h, f, v, P, w); if (O == null) return O; if (b) { var Z = f.children; if (Z !== void 0) if (T) if (C(Z)) { for (var St = 0; St < Z.length; St++) He(Z[St], h); Object.freeze && Object.freeze(Z); } else M("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else He(Z, h); } if (it.call(f, "key")) { var vt = Q(h), N = Object.keys(f).filter(function(Yr) { return Yr !== "key"; }), le = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!Ie[vt + le]) { var Mr = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}"; M(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, le, vt, Mr, vt), Ie[vt + le] = !0; } } return h === r ? br(O) : Sr(O), O; } } function Pr(h, f, v) { return Re(h, f, v, !0); } function wr(h, f, v) { return Re(h, f, v, !1); } var xr = wr, Er = Pr; Ct.Fragment = r, Ct.jsx = xr, Ct.jsxs = Er; }()), Ct; } process.env.NODE_ENV === "production" ? ye.exports = Xr() : ye.exports = Br(); var H = ye.exports; /*! * better-scroll / better-scroll * (c) 2016-2023 ustbhuangyi * Released under the MIT License. */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var me = function(o, t) { return me = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) { e.__proto__ = r; } || function(e, r) { for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]); }, me(o, t); }; function Gt(o, t) { me(o, t); function e() { this.constructor = o; } o.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e()); } var G = function() { return G = Object.assign || function(t) { for (var e, r = 1, i = arguments.length; r < i; r++) { e = arguments[r]; for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && (t[s] = e[s]); } return t; }, G.apply(this, arguments); }; function he(o, t, e, r) { function i(s) { return s instanceof e ? s : new e(function(n) { n(s); }); } return new (e || (e = Promise))(function(s, n) { function a(u) { try { l(r.next(u)); } catch (p) { n(p); } } function c(u) { try { l(r.throw(u)); } catch (p) { n(p); } } function l(u) { u.done ? s(u.value) : i(u.value).then(a, c); } l((r = r.apply(o, [])).next()); }); } function ce(o, t) { var e = { label: 0, sent: function() { if (s[0] & 1) throw s[1]; return s[1]; }, trys: [], ops: [] }, r, i, s, n; return n = { next: a(0), throw: a(1), return: a(2) }, typeof Symbol == "function" && (n[Symbol.iterator] = function() { return this; }), n; function a(l) { return function(u) { return c([l, u]); }; } function c(l) { if (r) throw new TypeError("Generator is already executing."); for (; e; ) try { if (r = 1, i && (s = l[0] & 2 ? i.return : l[0] ? i.throw || ((s = i.return) && s.call(i), 0) : i.next) && !(s = s.call(i, l[1])).done) return s; switch (i = 0, s && (l = [l[0] & 2, s.value]), l[0]) { case 0: case 1: s = l; break; case 4: return e.label++, { value: l[1], done: !1 }; case 5: e.label++, i = l[1], l = [0]; continue; case 7: l = e.ops.pop(), e.trys.pop(); continue; default: if (s = e.trys, !(s = s.length > 0 && s[s.length - 1]) && (l[0] === 6 || l[0] === 2)) { e = 0; continue; } if (l[0] === 3 && (!s || l[1] > s[0] && l[1] < s[3])) { e.label = l[1]; break; } if (l[0] === 6 && e.label < s[1]) { e.label = s[1], s = l; break; } if (s && e.label < s[2]) { e.label = s[2], e.ops.push(l); break; } s[2] && e.ops.pop(), e.trys.pop(); continue; } l = t.call(o, e); } catch (u) { l = [6, u], i = 0; } finally { r = s = 0; } if (l[0] & 5) throw l[1]; return { value: l[0] ? l[1] : void 0, done: !0 }; } } function Kt() { for (var o = 0, t = 0, e = arguments.length; t < e; t++) o += arguments[t].length; for (var r = Array(o), i = 0, t = 0; t < e; t++) for (var s = arguments[t], n = 0, a = s.length; n < a; n++, i++) r[i] = s[n]; return r; } var Dr = [ { sourceKey: "scroller.scrollBehaviorX.currentPos", key: "x" }, { sourceKey: "scroller.scrollBehaviorY.currentPos", key: "y" }, { sourceKey: "scroller.scrollBehaviorX.hasScroll", key: "hasHorizontalScroll" }, { sourceKey: "scroller.scrollBehaviorY.hasScroll", key: "hasVerticalScroll" }, { sourceKey: "scroller.scrollBehaviorX.contentSize", key: "scrollerWidth" }, { sourceKey: "scroller.scrollBehaviorY.contentSize", key: "scrollerHeight" }, { sourceKey: "scroller.scrollBehaviorX.maxScrollPos", key: "maxScrollX" }, { sourceKey: "scroller.scrollBehaviorY.maxScrollPos", key: "maxScrollY" }, { sourceKey: "scroller.scrollBehaviorX.minScrollPos", key: "minScrollX" }, { sourceKey: "scroller.scrollBehaviorY.minScrollPos", key: "minScrollY" }, { sourceKey: "scroller.scrollBehaviorX.movingDirection", key: "movingDirectionX" }, { sourceKey: "scroller.scrollBehaviorY.movingDirection", key: "movingDirectionY" }, { sourceKey: "scroller.scrollBehaviorX.direction", key: "directionX" }, { sourceKey: "scroller.scrollBehaviorY.direction", key: "directionY" }, { sourceKey: "scroller.actions.enabled", key: "enabled" }, { sourceKey: "scroller.animater.pending", key: "pending" }, { sourceKey: "scroller.animater.stop", key: "stop" }, { sourceKey: "scroller.scrollTo", key: "scrollTo" }, { sourceKey: "scroller.scrollBy", key: "scrollBy" }, { sourceKey: "scroller.scrollToElement", key: "scrollToElement" }, { sourceKey: "scroller.resetPosition", key: "resetPosition" } ]; function K(o) { console.error("[BScroll warn]: " + o); } function Ne(o, t) { if (!o) throw new Error("[BScroll] " + t); } var tt = typeof window < "u", xt = tt && navigator.userAgent.toLowerCase(), Cr = !!(xt && /wechatdevtools/.test(xt)), Or = xt && xt.indexOf("android") > 0, Hr = function() { if (typeof xt == "string") { var o = /os (\d\d?_\d(_\d)?)/, t = o.exec(xt); if (!t) return !1; var e = t[1].split("_").map(function(r) { return parseInt(r, 10); }); return e[0] === 13 && e[1] >= 4; } return !1; }(), ir = !1; if (tt) { var Ir = "test-passive"; try { var We = {}; Object.defineProperty(We, "passive", { get: function() { ir = !0; } }), window.addEventListener(Ir, function() { }, We); } catch { } } function j() { return window.performance && window.performance.now && window.performance.timing ? window.performance.now() + window.performance.timing.navigationStart : +/* @__PURE__ */ new Date(); } var F = function(o, t) { for (var e in t) o[e] = t[e]; return o; }; function Te(o) { return o == null; } function Rr(o, t) { return Math.sqrt(o * o + t * t); } function I(o, t, e) { return o < t ? t : o > e ? e : o; } function Pt(o, t) { if (o.findIndex) return o.findIndex(t); var e = -1; return o.some(function(r, i, s) { var n = t(r, i, s); if (n) return e = i, n; }), e; } var be = tt && document.createElement("div").style, wt = function() { if (!tt) return !1; for (var o = [ { key: "standard", value: "transform" }, { key: "webkit", value: "webkitTransform" }, { key: "Moz", value: "MozTransform" }, { key: "O", value: "OTransform" }, { key: "ms", value: "msTransform" } ], t = 0, e = o; t < e.length; t++) { var r = e[t]; if (be[r.value] !== void 0) return r.key; } return !1; }(); function rt(o) { return wt === !1 ? o : wt === "standard" ? o === "transitionEnd" ? "transitionend" : o : wt + o.charAt(0).toUpperCase() + o.substr(1); } function sr(o) { return typeof o == "string" ? document.querySelector(o) : o; } function Ar(o, t, e, r) { var i = ir ? { passive: !1, capture: !!r } : !!r; o.addEventListener(t, e, i); } function Fr(o, t, e, r) { o.removeEventListener(t, e, { capture: !!r }); } function gt(o) { o.cancelable && o.preventDefault(); } function je(o) { for (var t = 0, e = 0; o; ) t -= o.offsetLeft, e -= o.offsetTop, o = o.offsetParent; return { left: t, top: e }; } function zr(o) { var t = o.getBoundingClientRect(); return { left: -(t.left + window.pageXOffset), top: -(t.top + window.pageYOffset) }; } var Lr = wt && wt !== "standard" ? "-" + wt.toLowerCase() + "-" : "", Nr = rt("transform"), nr = rt("transition"), Wr = tt && rt("perspective") in be, Ue = tt && ("ontouchstart" in window || Cr), jr = tt && nr in be, E = { transform: Nr, transition: nr, transitionTimingFunction: rt("transitionTimingFunction"), transitionDuration: rt("transitionDuration"), transitionDelay: rt("transitionDelay"), transformOrigin: rt("transformOrigin"), transitionEnd: rt("transitionEnd"), transitionProperty: rt("transitionProperty") }, ue = { touchstart: 1, touchmove: 1, touchend: 1, touchcancel: 1, mousedown: 2, mousemove: 2, mouseup: 2 }; function yt(o) { if (o instanceof window.SVGElement) { var t = o.getBoundingClientRect(); return { top: t.top, left: t.left, width: t.width, height: t.height }; } else return { top: o.offsetTop, left: o.offsetLeft, width: o.offsetWidth, height: o.offsetHeight }; } function Et(o, t) { for (var e in t) if (t[e].test(o[e])) return !0; return !1; } var Ur = Et; function qr(o, t) { var e = document.createEvent("Event"); e.initEvent(t, !0, !0), e.pageX = o.pageX, e.pageY = o.pageY, o.target.dispatchEvent(e); } function ar(o, t) { t === void 0 && (t = "click"); var e; o.type === "mouseup" ? e = o : (o.type === "touchend" || o.type === "touchcancel") && (e = o.changedTouches[0]); var r = {}; e && (r.screenX = e.screenX || 0, r.screenY = e.screenY || 0, r.clientX = e.clientX || 0, r.clientY = e.clientY || 0); var i, s = !0, n = !0, a = o.ctrlKey, c = o.shiftKey, l = o.altKey, u = o.metaKey, p = { ctrlKey: a, shiftKey: c, altKey: l, metaKey: u }; if (typeof MouseEvent < "u") try { i = new MouseEvent(t, F(G({ bubbles: s, cancelable: n }, p), r)); } catch { g(); } else g(); function g() { i = document.createEvent("Event"), i.initEvent(t, s, n), F(i, r); } i.forwardedTouchEvent = !0, i._constructed = !0, o.target.dispatchEvent(i); } function Vr(o) { ar(o, "dblclick"); } function Zr(o, t) { var e = t.firstChild; e ? Kr(o, e) : t.appendChild(o); } function Kr(o, t) { var e = t.parentNode; e.insertBefore(o, t); } function Gr(o, t) { o.removeChild(t); } function zt(o, t) { var e = new RegExp("(^|\\s)" + t + "(\\s|$)"); return e.test(o.className); } function Qr(o) { return Array.prototype.slice.call(o, 0); } function _r(o) { return { width: o.clientWidth, height: o.clientHeight }; } var A = { // easeOutQuint swipe: { style: "cubic-bezier(0.23, 1, 0.32, 1)", fn: function(o) { return 1 + --o * o * o * o * o; } }, // easeOutQuard swipeBounce: { style: "cubic-bezier(0.25, 0.46, 0.45, 0.94)", fn: function(o) { return o * (2 - o); } }, // easeOutQuart bounce: { style: "cubic-bezier(0.165, 0.84, 0.44, 1)", fn: function(o) { return 1 - --o * o * o * o; } } }, Jr = 1e3 / 60, st = tt && window; function lr() { } var Pe = function() { return tt ? st.requestAnimationFrame || st.webkitRequestAnimationFrame || st.mozRequestAnimationFrame || st.oRequestAnimationFrame || // if all else fails, use setTimeout function(o) { return window.setTimeout(o, o.interval || Jr); } : lr; }(), nt = function() { return tt ? st.cancelAnimationFrame || st.webkitCancelAnimationFrame || st.mozCancelAnimationFrame || st.oCancelAnimationFrame || function(o) { window.clearTimeout(o); } : lr; }(), qe = function(o) { }, pe = { enumerable: !0, configurable: !0, get: qe, set: qe }, $r = function(o, t) { for (var e = t.split("."), r = 0; r < e.length - 1; r++) if (o = o[e[r]], typeof o != "object" || !o) return; var i = e.pop(); return typeof o[i] == "function" ? function() { return o[i].apply(o, arguments); } : o[i]; }, to = function(o, t, e) { for (var r = t.split("."), i, s = 0; s < r.length - 1; s++) i = r[s], o[i] || (o[i] = {}), o = o[i]; o[r.pop()] = e; }; function eo(o, t, e) { pe.get = function() { return $r(this, t); }, pe.set = function(i) { to(this, t, i); }, Object.defineProperty(o, e, pe); } var ot = ( /** @class */ function() { function o(t) { this.events = {}, this.eventTypes = {}, this.registerType(t); } return o.prototype.on = function(t, e, r) { return r === void 0 && (r = this), this.hasType(t), this.events[t] || (this.events[t] = []), this.events[t].push([e, r]), this; }, o.prototype.once = function(t, e, r) { var i = this; r === void 0 && (r = this), this.hasType(t); var s = function() { for (var n = [], a = 0; a < arguments.length; a++) n[a] = arguments[a]; i.off(t, s); var c = e.apply(r, n); if (c === !0) return c; }; return s.fn = e, this.on(t, s), this; }, o.prototype.off = function(t, e) { if (!t && !e) return this.events = {}, this; if (t) { if (this.hasType(t), !e) return this.events[t] = [], this; var r = this.events[t]; if (!r) return this; for (var i = r.length; i--; ) (r[i][0] === e || r[i][0] && r[i][0].fn === e) && r.splice(i, 1); return this; } }, o.prototype.trigger = function(t) { for (var e = [], r = 1; r < arguments.length; r++) e[r - 1] = arguments[r]; this.hasType(t); var i = this.events[t]; if (i) for (var s = i.length, n = Kt(i), a, c = 0; c < s; c++) { var l = n[c], u = l[0], p = l[1]; if (u && (a = u.apply(p, e), a === !0)) return a; } }, o.prototype.registerType = function(t) { var e = this; t.forEach(function(r) { e.eventTypes[r] = r; }); }, o.prototype.destroy = function() { this.events = {}, this.eventTypes = {}; }, o.prototype.hasType = function(t) { var e = this.eventTypes, r = e[t] === t; r || K('EventEmitter has used unknown event type: "' + t + '", should be oneof [' + ("" + Object.keys(e).map(function(i) { return JSON.stringify(i); })) + "]"); }, o; }() ), W = ( /** @class */ function() { function o(t, e) { this.wrapper = t, this.events = e, this.addDOMEvents(); } return o.prototype.destroy = function() { this.removeDOMEvents(), this.events = []; }, o.prototype.addDOMEvents = function() { this.handleDOMEvents(Ar); }, o.prototype.removeDOMEvents = function() { this.handleDOMEvents(Fr); }, o.prototype.handleDOMEvents = function(t) { var e = this, r = this.wrapper; this.events.forEach(function(i) { t(r, i.name, e, !!i.capture); }); }, o.prototype.handleEvent = function(t) { var e = t.type; this.events.some(function(r) { return r.name === e ? (r.handler(t), !0) : !1; }); }, o; }() ), ro = ( /** @class */ /* @__PURE__ */ function() { function o() { } return o; }() ), oo = ( /** @class */ function(o) { Gt(t, o); function t() { var e = o.call(this) || this; return e.startX = 0, e.startY = 0, e.scrollX = !1, e.scrollY = !0, e.freeScroll = !1, e.directionLockThreshold = 0, e.eventPassthrough = "", e.click = !1, e.dblclick = !1, e.tap = "", e.bounce = { top: !0, bottom: !0, left: !0, right: !0 }, e.bounceTime = 800, e.momentum = !0, e.momentumLimitTime = 300, e.momentumLimitDistance = 15, e.swipeTime = 2500, e.swipeBounceTime = 500, e.deceleration = 15e-4, e.flickLimitTime = 200, e.flickLimitDistance = 100, e.resizePolling = 60, e.probeType = 0, e.stopPropagation = !1, e.preventDefault = !0, e.preventDefaultException = { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/ }, e.tagException = { tagName: /^TEXTAREA$/ }, e.HWCompositing = !0, e.useTransition = !0, e.bindToWrapper = !1, e.bindToTarget = !1, e.disableMouse = Ue, e.disableTouch = !Ue, e.autoBlur = !0, e.autoEndDistance = 5, e.outOfBoundaryDampingFactor = 1 / 3, e.specifiedIndexAsContent = 0, e.quadrant = 1, e; } return t.prototype.merge = function(e) { if (!e) return this; for (var r in e) { if (r === "bounce") { this.bounce = this.resolveBounce(e[r]); continue; } this[r] = e[r]; } return this; }, t.prototype.process = function() { return this.translateZ = this.HWCompositing && Wr ? " translateZ(1px)" : "", this.useTransition = this.useTransition && jr, this.preventDefault = !this.eventPassthrough && this.preventDefault, this.scrollX = this.eventPassthrough === "horizontal" ? !1 : this.scrollX, this.scrollY = this.eventPassthrough === "vertical" ? !1 : this.scrollY, this.freeScroll = this.freeScroll && !this.eventPassthrough, this.scrollX = this.freeScroll ? !0 : this.scrollX, this.scrollY = this.freeScroll ? !0 : this.scrollY, this.directionLockThreshold = this.eventPassthrough ? 0 : this.directionLockThreshold, this; }, t.prototype.resolveBounce = function(e) { var r = { top: !0, right: !0, bottom: !0, left: !0 }, i = { top: !1, right: !1, bottom: !1, left: !1 }, s; return typeof e == "object" ? s = F(r, e) : s = e ? r : i, s; }, t; }(ro) ), io = ( /** @class */ function() { function o(t, e) { this.wrapper = t, this.options = e, this.hooks = new ot([ "beforeStart", "start", "move", "end", "click" ]), this.handleDOMEvents(); } return o.prototype.handleDOMEvents = function() { var t = this.options, e = t.bindToWrapper, r = t.disableMouse, i = t.disableTouch, s = t.click, n = this.wrapper, a = e ? n : window, c = [], l = [], u = !i, p = !r; s && c.push({ name: "click", handler: this.click.bind(this), capture: !0 }), u && (c.push({ name: "touchstart", handler: this.start.bind(this) }), l.push({ name: "touchmove", handler: this.move.bind(this) }, { name: "touchend", handler: this.end.bind(this) }, { name: "touchcancel", handler: this.end.bind(this) })), p && (c.push({ name: "mousedown", handler: this.start.bind(this) }), l.push({ name: "mousemove", handler: this.move.bind(this) }, { name: "mouseup", handler: this.end.bind(this) })), this.wrapperEventRegister = new W(n, c), this.targetEventRegister = new W(a, l); }, o.prototype.beforeHandler = function(t, e) { var r = this.options, i = r.preventDefault, s = r.stopPropagation, n = r.preventDefaultException, a = { start: function() { return i && !Et(t.target, n); }, end: function() { return i && !Et(t.target, n); }, move: function() { return i; } }; a[e]() && t.preventDefault(), s && t.stopPropagation(); }, o.prototype.setInitiated = function(t) { t === void 0 && (t = 0), this.initiated = t; }, o.prototype.start = function(t) { var e = ue[t.type]; if (!(this.initiated && this.initiated !== e)) { if (this.setInitiated(e), Ur(t.target, this.options.tagException)) { this.setInitiated(); return; } if (!(e === 2 && t.button !== 0) && !this.hooks.trigger(this.hooks.eventTypes.beforeStart, t)) { this.beforeHandler(t, "start"); var r = t.touches ? t.touches[0] : t; this.pointX = r.pageX, this.pointY = r.pageY, this.hooks.trigger(this.hooks.eventTypes.start, t); } } }, o.prototype.move = function(t) { if (ue[t.type] === this.initiated) { this.beforeHandler(t, "move"); var e = t.touches ? t.touches[0] : t, r = e.pageX - this.pointX, i = e.pageY - this.pointY; if (this.pointX = e.pageX, this.pointY = e.pageY, !this.hooks.trigger(this.hooks.eventTypes.move, { deltaX: r, deltaY: i, e: t })) { var s = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft, n = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop, a = this.pointX - s, c = this.pointY - n, l = this.options.autoEndDistance; (a > document.documentElement.clientWidth - l || c > document.documentElement.clientHeight - l || a < l || c < l) && this.end(t); } } }, o.prototype.end = function(t) { ue[t.type] === this.initiated && (this.setInitiated(), this.beforeHandler(t, "end"), this.hooks.trigger(this.hooks.eventTypes.end, t)); }, o.prototype.click = function(t) { this.hooks.trigger(this.hooks.eventTypes.click, t); }, o.prototype.setContent = function(t) { t !== this.wrapper && (this.wrapper = t, this.rebindDOMEvents()); }, o.prototype.rebindDOMEvents = function() { this.wrapperEventRegister.destroy(), this.targetEventRegister.destroy(), this.handleDOMEvents(); }, o.prototype.destroy = function() { this.wrapperEventRegister.destroy(), this.targetEventRegister.destroy(), this.hooks.destroy(); }, o; }() ), fe = { x: ["translateX", "px"], y: ["translateY", "px"] }, so = ( /** @class */ function() { function o(t) { this.setContent(t), this.hooks = new ot(["beforeTranslate", "translate"]); } return o.prototype.getComputedPosition = function() { var t = window.getComputedStyle(this.content, null), e = t[E.transform].split(")")[0].split(", "), r = +(e[12] || e[4]) || 0, i = +(e[13] || e[5]) || 0; return { x: r, y: i }; }, o.prototype.translate = function(t) { var e = []; Object.keys(t).forEach(function(r) { if (fe[r]) { var i = fe[r][0]; if (i) { var s = fe[r][1], n = t[r]; e.push(i + "(" + n + s + ")"); } } }), this.hooks.trigger(this.hooks.eventTypes.beforeTranslate, e, t), this.style[E.transform] = e.join(" "), this.hooks.trigger(this.hooks.eventTypes.translate, t); }, o.prototype.setContent = function(t) { this.content !== t && (this.content = t, this.style = t.style); }, o.prototype.destroy = function() { this.hooks.destroy(); }, o; }() ), hr = ( /** @class */ function() { function o(t, e, r) { this.translater = e, this.options = r, this.timer = 0, this.hooks = new ot([ "move", "end", "beforeForceStop", "forceStop", "callStop", "time", "timeFunction" ]), this.setContent(t); } return o.prototype.translate = function(t) { this.translater.translate(t); }, o.prototype.setPending = function(t) { this.pending = t; }, o.prototype.setForceStopped = function(t) { this.forceStopped = t; }, o.prototype.setCallStop = function(t) { this.callStopWhenPending = t; }, o.prototype.setContent = function(t) { this.content !== t && (this.content = t, this.style = t.style, this.stop()); }, o.prototype.clearTimer = function() { this.timer && (nt(this.timer), this.timer = 0); }, o.prototype.destroy = function() { this.hooks.destroy(), nt(this.timer); }, o; }() ), no = function(o, t, e, r) { var i = function(l, u) { var p = l - u, g = p > 0 ? -1 : p < 0 ? 1 : 0; return g; }, s = i(t.x, o.x), n = i(t.y, o.y), a = e.x - r.x, c = e.y - r.y; return s * a <= 0 && n * c <= 0; }, ao = ( /** @class */ function(o) { Gt(t, o); function t() { return o !== null && o.apply(this, arguments) || this; } return t.prototype.startProbe = function(e, r) { var i = this, s = e, n = function() { var a = i.translater.getComputedPosition(); no(e, r, a, s) && i.hooks.trigger(i.hooks.eventTypes.move, a), i.pending || (i.callStopWhenPending ? i.callStopWhenPending = !1 : i.hooks.trigger(i.hooks.eventTypes.end, a)), s = a, i.pending && (i.timer = Pe(n)); }; this.callStopWhenPending && this.setCallStop(!1), nt(this.timer), n(); }, t.prototype.transitionTime = function(e) { e === void 0 && (e = 0), this.style[E.transitionDuration] = e + "ms", this.hooks.trigger(this.hooks.eventTypes.time, e); }, t.prototype.transitionTimingFunction = function(e) { this.style[E.transitionTimingFunction] = e, this.hooks.trigger(this.hooks.eventTypes.timeFunction, e); }, t.prototype.transitionProperty = function() { this.style[E.transitionProperty] = E.transform; }, t.prototype.move = function(e, r, i, s) { this.setPending(i > 0), this.transitionTimingFunction(s), this.transitionProperty(), this.transitionTime(i), this.translate(r); var n = this.options.probeType === 3; i && n && this.startProbe(e, r), i || (this._reflow = this.content.offsetHeight, n && this.hooks.trigger(this.hooks.eventTypes.move, r), this.hooks.trigger(this.hooks.eventTypes.end, r)); }, t.prototype.doStop = function() { var e = this.pending; if (this.setForceStopped(!1), this.setCallStop(!1), e) { this.setPending(!1), nt(this.timer); var r = this.translater.getComputedPosition(), i = r.x, s = r.y; this.transitionTime(), this.translate({ x: i, y: s }), this.setForceStopped(!0), this.setCallStop(!0), this.hooks.trigger(this.hooks.eventTypes.forceStop, { x: i, y: s }); } return e; }, t.prototype.stop = function() { var e = this.doStop(); e && this.hooks.trigger(this.hooks.eventTypes.callStop); }, t; }(hr) ), lo = ( /** @class */ function(o) { Gt(t, o); function t() { return o !== null && o.apply(this, arguments) || this; } return t.prototype.move = function(e, r, i, s) { if (!i) { this.translate(r), this.options.probeType === 3 && this.hooks.trigger(this.hooks.eventTypes.move, r), this.hooks.trigger(this.hooks.eventTypes.end, r); return; } this.animate(e, r, i, s); }, t.prototype.animate = function(e, r, i, s) { var n = this, a = j(), c = a + i, l = this.options.probeType === 3, u = function() { var p = j(); if (p >= c) { n.translate(r), l && n.hooks.trigger(n.hooks.eventTypes.move, r), n.hooks.trigger(n.hooks.eventTypes.end, r); return; } p = (p - a) / i; var g = s(p), y = {}; Object.keys(r).forEach(function(m) { var R = e[m], x = r[m]; y[m] = (x - R) * g + R; }), n.translate(y), l && n.hooks.trigger(n.hooks.eventTypes.move, y), n.pending && (n.timer = Pe(u)), n.pending || (n.callStopWhenPending ? n.callStopWhenPending = !1 : n.hooks.trigger(n.hooks.eventTypes.end, r)); }; this.setPending(!0), this.callStopWhenPending && this.setCallStop(!1), nt(this.timer), u(); }, t.prototype.doStop = function() { var e = this.pending; if (this.setForceStopped(!1), this.setCallStop(!1), e) { this.setPending(!1), nt(this.timer); var r = this.translater.getComputedPosition(); this.setForceStopped(!0), this.setCallStop(!0), this.hooks.trigger(this.hooks.eventTypes.forceStop, r); } return e; }, t.prototype.stop = function() { var e = this.doStop(); e && this.hooks.trigger(this.hooks.eventTypes.callStop); }, t; }(hr) ); function ho(o, t, e) { var r = e.useTransition, i = {}; return Object.defineProperty(i, "probeType", { enumerable: !0, configurable: !1, get: function() { return e.probeType; } }), r ? new ao(o, t, i) : new lo(o, t, i); } var Ve = ( /** @class */ function() { function o(t, e, r) { this.wrapper = t, this.options = r, this.hooks = new ot([ "beforeComputeBoundary", "computeBoundary", "momentum", "end", "ignoreHasScroll" ]), this.refresh(e); } return o.prototype.sta