111111 副本
111111 副本
getOwnPropertyNames
, __commonJS = (e, t) => function() {
return t || (0,
e[__getOwnPropNames(e)[0]])((t = {
exports: {}
}).exports, t),
t.exports
}
, require_main_001 = __commonJS({
"editorAssets/js/main-500b0d58.js"(exports, module) {
!function() {
const e = document.createElement("link").relList;
if (!(e && e.supports && e.supports("modulepreload"))) {
for (const e of
document.querySelectorAll('link[rel="modulepreload"]'))
t(e);
new MutationObserver((e => {
for (const r of e)
if ("childList" === r.type)
for (const e of r.addedNodes)
"LINK" === e.tagName && "modulepreload" === e.rel
&& t(e)
}
)).observe(document, {
childList: !0,
subtree: !0
})
}
function t(e) {
if (e.ep)
return;
e.ep = !0;
const t = function(e) {
const t = {};
return e.integrity && (t.integrity = e.integrity),
e.referrerPolicy && (t.referrerPolicy = e.referrerPolicy),
"use-credentials" === e.crossOrigin ? t.credentials = "include"
: "anonymous" === e.crossOrigin ? t.credentials = "omit" : t.credentials = "same-
origin",
t
}(e);
fetch(e.href, t)
}
}();
var commonjsGlobal$1 = "undefined" != typeof globalThis ? globalThis :
"undefined" != typeof window ? window : "undefined" != typeof global ? global :
"undefined" != typeof self ? self : {};
function getDefaultExportFromCjs(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e,
"default") ? e.default : e
}
function getAugmentedNamespace(e) {
if (e.__esModule)
return e;
var t = e.default;
if ("function" == typeof t) {
var r = function e() {
return this instanceof e ? Reflect.construct(t, arguments,
this.constructor) : t.apply(this, arguments)
};
r.prototype = t.prototype
} else
r = {};
return Object.defineProperty(r, "__esModule", {
value: !0
}),
Object.keys(e).forEach((function(t) {
var n = Object.getOwnPropertyDescriptor(e, t);
Object.defineProperty(r, t, n.get ? n : {
enumerable: !0,
get: function() {
return e[t]
}
})
}
)),
r
}
var jsxRuntime = {
exports: {}
}
, reactJsxRuntime_production_min = {}
, react = {
exports: {}
}
, react_production_min = {}
, l$d = Symbol.for("react.element")
, n$g = Symbol.for("react.portal")
, p$8 = Symbol.for("react.fragment")
, q$3 = Symbol.for("react.strict_mode")
, r$b = Symbol.for("react.profiler")
, t$a = Symbol.for("react.provider")
, u$a = Symbol.for("react.context")
, v$7 = Symbol.for("react.forward_ref")
, w$4 = Symbol.for("react.suspense")
, x$7 = Symbol.for("react.memo")
, y$5 = Symbol.for("react.lazy")
, z$5 = Symbol.iterator;
function A$4(e) {
return null === e || "object" != typeof e ? null : "function" == typeof
(e = z$5 && e[z$5] || e["@@iterator"]) ? e : null
}
var B$3 = {
isMounted: function() {
return !1
},
enqueueForceUpdate: function() {},
enqueueReplaceState: function() {},
enqueueSetState: function() {}
}
, C$3 = Object.assign
, D$3 = {};
function E$2(e, t, r) {
this.props = e,
this.context = t,
this.refs = D$3,
this.updater = r || B$3
}
function F$2() {}
function G$3(e, t, r) {
this.props = e,
this.context = t,
this.refs = D$3,
this.updater = r || B$3
}
E$2.prototype.isReactComponent = {},
E$2.prototype.setState = function(e, t) {
if ("object" != typeof e && "function" != typeof e && null != e)
throw Error("setState(...): takes an object of state variables to
update or a function which returns an object of state variables.");
this.updater.enqueueSetState(this, e, t, "setState")
}
,
E$2.prototype.forceUpdate = function(e) {
this.updater.enqueueForceUpdate(this, e, "forceUpdate")
}
,
F$2.prototype = E$2.prototype;
var H$3 = G$3.prototype = new F$2;
H$3.constructor = G$3,
C$3(H$3, E$2.prototype),
H$3.isPureReactComponent = !0;
var I$2 = Array.isArray
, J$1 = Object.prototype.hasOwnProperty
, K$2 = {
current: null
}
, L$3 = {
key: !0,
ref: !0,
__self: !0,
__source: !0
};
function M$4(e, t, r) {
var n, i = {}, o = null, s = null;
if (null != t)
for (n in void 0 !== t.ref && (s = t.ref),
void 0 !== t.key && (o = "" + t.key),
t)
J$1.call(t, n) && !L$3.hasOwnProperty(n) && (i[n] = t[n]);
var a = arguments.length - 2;
if (1 === a)
i.children = r;
else if (1 < a) {
for (var l = Array(a), c = 0; c < a; c++)
l[c] = arguments[c + 2];
i.children = l
}
if (e && e.defaultProps)
for (n in a = e.defaultProps)
void 0 === i[n] && (i[n] = a[n]);
return {
$$typeof: l$d,
type: e,
key: o,
ref: s,
props: i,
_owner: K$2.current
}
}
function N$4(e, t) {
return {
$$typeof: l$d,
type: e.type,
key: t,
ref: e.ref,
props: e.props,
_owner: e._owner
}
}
function O$3(e) {
return "object" == typeof e && null !== e && e.$$typeof === l$d
}
function escape$1(e) {
var t = {
"=": "=0",
":": "=2"
};
return "$" + e.replace(/[=:]/g, (function(e) {
return t[e]
}
))
}
var P$5 = /\/+/g;
function Q$3(e, t) {
return "object" == typeof e && null !== e && null != e.key ?
escape$1("" + e.key) : t.toString(36)
}
function R$2(e, t, r, n, i) {
var o = typeof e;
"undefined" !== o && "boolean" !== o || (e = null);
var s = !1;
if (null === e)
s = !0;
else
switch (o) {
case "string":
case "number":
s = !0;
break;
case "object":
switch (e.$$typeof) {
case l$d:
case n$g:
s = !0
}
}
if (s)
return i = i(s = e),
e = "" === n ? "." + Q$3(s, 0) : n,
I$2(i) ? (r = "",
null != e && (r = e.replace(P$5, "$&/") + "/"),
R$2(i, t, r, "", (function(e) {
return e
}
))) : null != i && (O$3(i) && (i = N$4(i, r + (!i.key || s && s.key
=== i.key ? "" : ("" + i.key).replace(P$5, "$&/") + "/") + e)),
t.push(i)),
1;
if (s = 0,
n = "" === n ? "." : n + ":",
I$2(e))
for (var a = 0; a < e.length; a++) {
var l = n + Q$3(o = e[a], a);
s += R$2(o, t, r, l, i)
}
else if ("function" == typeof (l = A$4(e)))
for (e = l.call(e),
a = 0; !(o = e.next()).done; )
s += R$2(o = o.value, t, r, l = n + Q$3(o, a++), i);
else if ("object" === o)
throw t = String(e),
Error("Objects are not valid as a React child (found: " + ("[object
Object]" === t ? "object with keys {" + Object.keys(e).join(", ") + "}" : t) + ").
If you meant to render a collection of children, use an array instead.");
return s
}
function S$4(e, t, r) {
if (null == e)
return e;
var n = []
, i = 0;
return R$2(e, n, "", "", (function(e) {
return t.call(r, e, i++)
}
)),
n
}
function T$3(e) {
if (-1 === e._status) {
var t = e._result;
(t = t()).then((function(t) {
0 !== e._status && -1 !== e._status || (e._status = 1,
e._result = t)
}
), (function(t) {
0 !== e._status && -1 !== e._status || (e._status = 2,
e._result = t)
}
)),
-1 === e._status && (e._status = 0,
e._result = t)
}
if (1 === e._status)
return e._result.default;
throw e._result
}
var U$2 = {
current: null
}
, V$2 = {
transition: null
}
, W$3 = {
ReactCurrentDispatcher: U$2,
ReactCurrentBatchConfig: V$2,
ReactCurrentOwner: K$2
};
function X$2() {
throw Error("act(...) is not supported in production builds of React.")
}
react_production_min.Children = {
map: S$4,
forEach: function(e, t, r) {
S$4(e, (function() {
t.apply(this, arguments)
}
), r)
},
count: function(e) {
var t = 0;
return S$4(e, (function() {
t++
}
)),
t
},
toArray: function(e) {
return S$4(e, (function(e) {
return e
}
)) || []
},
only: function(e) {
if (!O$3(e))
throw Error("React.Children.only expected to receive a single
React element child.");
return e
}
},
react_production_min.Component = E$2,
react_production_min.Fragment = p$8,
react_production_min.Profiler = r$b,
react_production_min.PureComponent = G$3,
react_production_min.StrictMode = q$3,
react_production_min.Suspense = w$4,
react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
W$3,
react_production_min.act = X$2,
react_production_min.cloneElement = function(e, t, r) {
if (null == e)
throw Error("React.cloneElement(...): The argument must be a React
element, but you passed " + e + ".");
var n = C$3({}, e.props)
, i = e.key
, o = e.ref
, s = e._owner;
if (null != t) {
if (void 0 !== t.ref && (o = t.ref,
s = K$2.current),
void 0 !== t.key && (i = "" + t.key),
e.type && e.type.defaultProps)
var a = e.type.defaultProps;
for (l in t)
J$1.call(t, l) && !L$3.hasOwnProperty(l) && (n[l] = void 0 ===
t[l] && void 0 !== a ? a[l] : t[l])
}
var l = arguments.length - 2;
if (1 === l)
n.children = r;
else if (1 < l) {
a = Array(l);
for (var c = 0; c < l; c++)
a[c] = arguments[c + 2];
n.children = a
}
return {
$$typeof: l$d,
type: e.type,
key: i,
ref: o,
props: n,
_owner: s
}
}
,
react_production_min.createContext = function(e) {
return (e = {
$$typeof: u$a,
_currentValue: e,
_currentValue2: e,
_threadCount: 0,
Provider: null,
Consumer: null,
_defaultValue: null,
_globalName: null
}).Provider = {
$$typeof: t$a,
_context: e
},
e.Consumer = e
}
,
react_production_min.createElement = M$4,
react_production_min.createFactory = function(e) {
var t = M$4.bind(null, e);
return t.type = e,
t
}
,
react_production_min.createRef = function() {
return {
current: null
}
}
,
react_production_min.forwardRef = function(e) {
return {
$$typeof: v$7,
render: e
}
}
,
react_production_min.isValidElement = O$3,
react_production_min.lazy = function(e) {
return {
$$typeof: y$5,
_payload: {
_status: -1,
_result: e
},
_init: T$3
}
}
,
react_production_min.memo = function(e, t) {
return {
$$typeof: x$7,
type: e,
compare: void 0 === t ? null : t
}
}
,
react_production_min.startTransition = function(e) {
var t = V$2.transition;
V$2.transition = {};
try {
e()
} finally {
V$2.transition = t
}
}
,
react_production_min.unstable_act = X$2,
react_production_min.useCallback = function(e, t) {
return U$2.current.useCallback(e, t)
}
,
react_production_min.useContext = function(e) {
return U$2.current.useContext(e)
}
,
react_production_min.useDebugValue = function() {}
,
react_production_min.useDeferredValue = function(e) {
return U$2.current.useDeferredValue(e)
}
,
react_production_min.useEffect = function(e, t) {
return U$2.current.useEffect(e, t)
}
,
react_production_min.useId = function() {
return U$2.current.useId()
}
,
react_production_min.useImperativeHandle = function(e, t, r) {
return U$2.current.useImperativeHandle(e, t, r)
}
,
react_production_min.useInsertionEffect = function(e, t) {
return U$2.current.useInsertionEffect(e, t)
}
,
react_production_min.useLayoutEffect = function(e, t) {
return U$2.current.useLayoutEffect(e, t)
}
,
react_production_min.useMemo = function(e, t) {
return U$2.current.useMemo(e, t)
}
,
react_production_min.useReducer = function(e, t, r) {
return U$2.current.useReducer(e, t, r)
}
,
react_production_min.useRef = function(e) {
return U$2.current.useRef(e)
}
,
react_production_min.useState = function(e) {
return U$2.current.useState(e)
}
,
react_production_min.useSyncExternalStore = function(e, t, r) {
return U$2.current.useSyncExternalStore(e, t, r)
}
,
react_production_min.useTransition = function() {
return U$2.current.useTransition()
}
,
react_production_min.version = "18.3.1",
react.exports = react_production_min;
var reactExports = react.exports;
const React = getDefaultExportFromCjs(reactExports);
/**
* @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 f$7 = reactExports
, k$4 = Symbol.for("react.element")
, l$c = Symbol.for("react.fragment")
, m$8 = Object.prototype.hasOwnProperty
, n$f =
f$7.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner
, p$7 = {
key: !0,
ref: !0,
__self: !0,
__source: !0
};
function q$2(e, t, r) {
var n, i = {}, o = null, s = null;
for (n in void 0 !== r && (o = "" + r),
void 0 !== t.key && (o = "" + t.key),
void 0 !== t.ref && (s = t.ref),
t)
m$8.call(t, n) && !p$7.hasOwnProperty(n) && (i[n] = t[n]);
if (e && e.defaultProps)
for (n in t = e.defaultProps)
void 0 === i[n] && (i[n] = t[n]);
return {
$$typeof: k$4,
type: e,
key: o,
ref: s,
props: i,
_owner: n$f.current
}
}
reactJsxRuntime_production_min.Fragment = l$c,
reactJsxRuntime_production_min.jsx = q$2,
reactJsxRuntime_production_min.jsxs = q$2,
jsxRuntime.exports = reactJsxRuntime_production_min;
var jsxRuntimeExports = jsxRuntime.exports;
const initialize = "";
var client = {}
, reactDom = {
exports: {}
}
, reactDom_production_min = {}
, scheduler = {
exports: {}
}
, scheduler_production_min = {};
/**
* @license React
* scheduler.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.
*/
!function(e) {
function t(e, t) {
var r = e.length;
e.push(t);
e: for (; 0 < r; ) {
var n = r - 1 >>> 1
, o = e[n];
if (!(0 < i(o, t)))
break e;
e[n] = t,
e[r] = o,
r = n
}
}
function r(e) {
return 0 === e.length ? null : e[0]
}
function n(e) {
if (0 === e.length)
return null;
var t = e[0]
, r = e.pop();
if (r !== t) {
e[0] = r;
e: for (var n = 0, o = e.length, s = o >>> 1; n < s; ) {
var a = 2 * (n + 1) - 1
, l = e[a]
, c = a + 1
, u = e[c];
if (0 > i(l, r))
c < o && 0 > i(u, l) ? (e[n] = u,
e[c] = r,
n = c) : (e[n] = l,
e[a] = r,
n = a);
else {
if (!(c < o && 0 > i(u, r)))
break e;
e[n] = u,
e[c] = r,
n = c
}
}
}
return t
}
function i(e, t) {
var r = e.sortIndex - t.sortIndex;
return 0 !== r ? r : e.id - t.id
}
if ("object" == typeof performance && "function" == typeof
performance.now) {
var o = performance;
e.unstable_now = function() {
return o.now()
}
} else {
var s = Date
, a = s.now();
e.unstable_now = function() {
return s.now() - a
}
}
var l = []
, c = []
, u = 1
, d = null
, p = 3
, h = !1
, f = !1
, m = !1
, g = "function" == typeof setTimeout ? setTimeout : null
, y = "function" == typeof clearTimeout ? clearTimeout : null
, v = "undefined" != typeof setImmediate ? setImmediate : null;
function b(e) {
for (var i = r(c); null !== i; ) {
if (null === i.callback)
n(c);
else {
if (!(i.startTime <= e))
break;
n(c),
i.sortIndex = i.expirationTime,
t(l, i)
}
i = r(c)
}
}
function x(e) {
if (m = !1,
b(e),
!f)
if (null !== r(l))
f = !0,
I(_);
else {
var t = r(c);
null !== t && O(x, t.startTime - e)
}
}
function _(t, i) {
f = !1,
m && (m = !1,
y(S),
S = -1),
h = !0;
var o = p;
try {
for (b(i),
d = r(l); null !== d && (!(d.expirationTime > i) || t && !P());
) {
var s = d.callback;
if ("function" == typeof s) {
d.callback = null,
p = d.priorityLevel;
var a = s(d.expirationTime <= i);
i = e.unstable_now(),
"function" == typeof a ? d.callback = a : d === r(l) &&
n(l),
b(i)
} else
n(l);
d = r(l)
}
if (null !== d)
var u = !0;
else {
var g = r(c);
null !== g && O(x, g.startTime - i),
u = !1
}
return u
} finally {
d = null,
p = o,
h = !1
}
}
"undefined" != typeof navigator && void 0 !== navigator.scheduling &&
void 0 !== navigator.scheduling.isInputPending &&
navigator.scheduling.isInputPending.bind(navigator.scheduling);
var E, T = !1, C = null, S = -1, $ = 5, w = -1;
function P() {
return !(e.unstable_now() - w < $)
}
function R() {
if (null !== C) {
var t = e.unstable_now();
w = t;
var r = !0;
try {
r = C(!0, t)
} finally {
r ? E() : (T = !1,
C = null)
}
} else
T = !1
}
if ("function" == typeof v)
E = function() {
v(R)
}
;
else if ("undefined" != typeof MessageChannel) {
var k = new MessageChannel
, A = k.port2;
k.port1.onmessage = R,
E = function() {
A.postMessage(null)
}
} else
E = function() {
g(R, 0)
}
;
function I(e) {
C = e,
T || (T = !0,
E())
}
function O(t, r) {
S = g((function() {
t(e.unstable_now())
}
), r)
}
e.unstable_IdlePriority = 5,
e.unstable_ImmediatePriority = 1,
e.unstable_LowPriority = 4,
e.unstable_NormalPriority = 3,
e.unstable_Profiling = null,
e.unstable_UserBlockingPriority = 2,
e.unstable_cancelCallback = function(e) {
e.callback = null
}
,
e.unstable_continueExecution = function() {
f || h || (f = !0,
I(_))
}
,
e.unstable_forceFrameRate = function(e) {
0 > e || 125 < e || ($ = 0 < e ? Math.floor(1e3 / e) : 5)
}
,
e.unstable_getCurrentPriorityLevel = function() {
return p
}
,
e.unstable_getFirstCallbackNode = function() {
return r(l)
}
,
e.unstable_next = function(e) {
switch (p) {
case 1:
case 2:
case 3:
var t = 3;
break;
default:
t = p
}
var r = p;
p = t;
try {
return e()
} finally {
p = r
}
}
,
e.unstable_pauseExecution = function() {}
,
e.unstable_requestPaint = function() {}
,
e.unstable_runWithPriority = function(e, t) {
switch (e) {
case 1:
case 2:
case 3:
case 4:
case 5:
break;
default:
e = 3
}
var r = p;
p = e;
try {
return t()
} finally {
p = r
}
}
,
e.unstable_scheduleCallback = function(n, i, o) {
var s = e.unstable_now();
switch ("object" == typeof o && null !== o ? o = "number" == typeof
(o = o.delay) && 0 < o ? s + o : s : o = s,
n) {
case 1:
var a = -1;
break;
case 2:
a = 250;
break;
case 5:
a = 1073741823;
break;
case 4:
a = 1e4;
break;
default:
a = 5e3
}
return n = {
id: u++,
callback: i,
priorityLevel: n,
startTime: o,
expirationTime: a = o + a,
sortIndex: -1
},
o > s ? (n.sortIndex = o,
t(c, n),
null === r(l) && n === r(c) && (m ? (y(S),
S = -1) : m = !0,
O(x, o - s))) : (n.sortIndex = a,
t(l, n),
f || h || (f = !0,
I(_))),
n
}
,
e.unstable_shouldYield = P,
e.unstable_wrapCallback = function(e) {
var t = p;
return function() {
var r = p;
p = t;
try {
return e.apply(this, arguments)
} finally {
p = r
}
}
}
}(scheduler_production_min),
scheduler.exports = scheduler_production_min;
var schedulerExports = scheduler.exports
, aa$1 = reactExports
, ca$1 = schedulerExports;
/**
* @license React
* react-dom.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.
*/
function p$6(e) {
for (var t = "https://reactjs.org/docs/error-decoder.html?invariant=" +
e, r = 1; r < arguments.length; r++)
t += "&args[]=" + encodeURIComponent(arguments[r]);
return "Minified React error #" + e + "; visit " + t + " for the full
message or use the non-minified dev environment for full errors and additional
helpful warnings."
}
var da$1 = new Set
, ea$1 = {};
function fa$1(e, t) {
ha$1(e, t),
ha$1(e + "Capture", t)
}
function ha$1(e, t) {
for (ea$1[e] = t,
e = 0; e < t.length; e++)
da$1.add(t[e])
}
var ia$1 = !("undefined" == typeof window || void 0 === window.document ||
void 0 === window.document.createElement)
, ja$1 = Object.prototype.hasOwnProperty
, ka = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\
u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\
uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\
u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\
uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/
, la = {}
, ma$1 = {};
function oa$1(e) {
return !!ja$1.call(ma$1, e) || !ja$1.call(la, e) && (ka.test(e) ?
ma$1[e] = !0 : (la[e] = !0,
!1))
}
function pa$1(e, t, r, n) {
if (null !== r && 0 === r.type)
return !1;
switch (typeof t) {
case "function":
case "symbol":
return !0;
case "boolean":
return !n && (null !== r ? !r.acceptsBooleans : "data-" !== (e =
e.toLowerCase().slice(0, 5)) && "aria-" !== e);
default:
return !1
}
}
function qa$1(e, t, r, n) {
if (null == t || pa$1(e, t, r, n))
return !0;
if (n)
return !1;
if (null !== r)
switch (r.type) {
case 3:
return !t;
case 4:
return !1 === t;
case 5:
return isNaN(t);
case 6:
return isNaN(t) || 1 > t
}
return !1
}
function v$6(e, t, r, n, i, o, s) {
this.acceptsBooleans = 2 === t || 3 === t || 4 === t,
this.attributeName = n,
this.attributeNamespace = i,
this.mustUseProperty = r,
this.propertyName = e,
this.type = t,
this.sanitizeURL = o,
this.removeEmptyString = s
}
var z$4 = {};
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML
suppressContentEditableWarning suppressHydrationWarning style".split("
").forEach((function(e) {
z$4[e] = new v$6(e,0,!1,e,null,!1,!1)
}
)),
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor",
"for"], ["httpEquiv", "http-equiv"]].forEach((function(e) {
var t = e[0];
z$4[t] = new v$6(t,1,!1,e[1],null,!1,!1)
}
)),
["contentEditable", "draggable", "spellCheck",
"value"].forEach((function(e) {
z$4[e] = new v$6(e,2,!1,e.toLowerCase(),null,!1,!1)
}
)),
["autoReverse", "externalResourcesRequired", "focusable",
"preserveAlpha"].forEach((function(e) {
z$4[e] = new v$6(e,2,!1,e,null,!1,!1)
}
)),
"allowFullScreen async autoFocus autoPlay controls default defer disabled
disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule
noValidate open playsInline readOnly required reversed scoped seamless
itemScope".split(" ").forEach((function(e) {
z$4[e] = new v$6(e,3,!1,e.toLowerCase(),null,!1,!1)
}
)),
["checked", "multiple", "muted", "selected"].forEach((function(e) {
z$4[e] = new v$6(e,3,!0,e,null,!1,!1)
}
)),
["capture", "download"].forEach((function(e) {
z$4[e] = new v$6(e,4,!1,e,null,!1,!1)
}
)),
["cols", "rows", "size", "span"].forEach((function(e) {
z$4[e] = new v$6(e,6,!1,e,null,!1,!1)
}
)),
["rowSpan", "start"].forEach((function(e) {
z$4[e] = new v$6(e,5,!1,e.toLowerCase(),null,!1,!1)
}
));
var ra$1 = /[\-:]([a-z])/g;
function sa$1(e) {
return e[1].toUpperCase()
}
function ta$1(e, t, r, n) {
var i = z$4.hasOwnProperty(t) ? z$4[t] : null;
(null !== i ? 0 !== i.type : n || !(2 < t.length) || "o" !== t[0] &&
"O" !== t[0] || "n" !== t[1] && "N" !== t[1]) && (qa$1(t, r, i, n) && (r = null),
n || null === i ? oa$1(t) && (null === r ? e.removeAttribute(t) :
e.setAttribute(t, "" + r)) : i.mustUseProperty ? e[i.propertyName] = null === r ? 3
!== i.type && "" : r : (t = i.attributeName,
n = i.attributeNamespace,
null === r ? e.removeAttribute(t) : (r = 3 === (i = i.type) || 4 === i
&& !0 === r ? "" : "" + r,
n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r))))
}
"accent-height alignment-baseline arabic-form baseline-shift cap-height
clip-path clip-rule color-interpolation color-interpolation-filters color-profile
color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-
color flood-opacity font-family font-size font-size-adjust font-stretch font-style
font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-
vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color
marker-end marker-mid marker-start overline-position overline-thickness paint-order
panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity
strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset
stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-
anchor text-decoration text-rendering underline-position underline-thickness
unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-
mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing
writing-mode xmlns:xlink x-height".split(" ").forEach((function(e) {
var t = e.replace(ra$1, sa$1);
z$4[t] = new v$6(t,1,!1,e,null,!1,!1)
}
)),
"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title
xlink:type".split(" ").forEach((function(e) {
var t = e.replace(ra$1, sa$1);
z$4[t] = new v$6(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)
}
)),
["xml:base", "xml:lang", "xml:space"].forEach((function(e) {
var t = e.replace(ra$1, sa$1);
z$4[t] = new v$6(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)
}
)),
["tabIndex", "crossOrigin"].forEach((function(e) {
z$4[e] = new v$6(e,1,!1,e.toLowerCase(),null,!1,!1)
}
)),
z$4.xlinkHref = new
v$6("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),
["src", "href", "action", "formAction"].forEach((function(e) {
z$4[e] = new v$6(e,1,!1,e.toLowerCase(),null,!0,!0)
}
));
var ua = aa$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
, va$1 = Symbol.for("react.element")
, wa$1 = Symbol.for("react.portal")
, ya$1 = Symbol.for("react.fragment")
, za$1 = Symbol.for("react.strict_mode")
, Aa = Symbol.for("react.profiler")
, Ba$1 = Symbol.for("react.provider")
, Ca$1 = Symbol.for("react.context")
, Da$1 = Symbol.for("react.forward_ref")
, Ea$1 = Symbol.for("react.suspense")
, Fa = Symbol.for("react.suspense_list")
, Ga$1 = Symbol.for("react.memo")
, Ha$1 = Symbol.for("react.lazy")
, Ia = Symbol.for("react.offscreen")
, Ja$1 = Symbol.iterator;
function Ka$1(e) {
return null === e || "object" != typeof e ? null : "function" == typeof
(e = Ja$1 && e[Ja$1] || e["@@iterator"]) ? e : null
}
var A$3 = Object.assign, La;
function Ma(e) {
if (void 0 === La)
try {
throw Error()
} catch (r) {
var t = r.stack.trim().match(/\n( *(at )?)/);
La = t && t[1] || ""
}
return "\n" + La + e
}
var Na$1 = !1;
function Oa$1(e, t) {
if (!e || Na$1)
return "";
Na$1 = !0;
var r = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
try {
if (t)
if (t = function() {
throw Error()
}
,
Object.defineProperty(t.prototype, "props", {
set: function() {
throw Error()
}
}),
"object" == typeof Reflect && Reflect.construct) {
try {
Reflect.construct(t, [])
} catch (c) {
var n = c
}
Reflect.construct(e, [], t)
} else {
try {
t.call()
} catch (c) {
n = c
}
e.call(t.prototype)
}
else {
try {
throw Error()
} catch (c) {
n = c
}
e()
}
} catch (c) {
if (c && n && "string" == typeof c.stack) {
for (var i = c.stack.split("\n"), o = n.stack.split("\n"), s =
i.length - 1, a = o.length - 1; 1 <= s && 0 <= a && i[s] !== o[a]; )
a--;
for (; 1 <= s && 0 <= a; s--,
a--)
if (i[s] !== o[a]) {
if (1 !== s || 1 !== a)
do {
if (s--,
0 > --a || i[s] !== o[a]) {
var l = "\n" + i[s].replace(" at new ", "
at ");
return e.displayName &&
l.includes("<anonymous>") && (l = l.replace("<anonymous>", e.displayName)),
l
}
} while (1 <= s && 0 <= a);
break
}
}
} finally {
Na$1 = !1,
Error.prepareStackTrace = r
}
return (e = e ? e.displayName || e.name : "") ? Ma(e) : ""
}
function Pa$1(e) {
switch (e.tag) {
case 5:
return Ma(e.type);
case 16:
return Ma("Lazy");
case 13:
return Ma("Suspense");
case 19:
return Ma("SuspenseList");
case 0:
case 2:
case 15:
return e = Oa$1(e.type, !1);
case 11:
return e = Oa$1(e.type.render, !1);
case 1:
return e = Oa$1(e.type, !0);
default:
return ""
}
}
function Qa$1(e) {
if (null == e)
return null;
if ("function" == typeof e)
return e.displayName || e.name || null;
if ("string" == typeof e)
return e;
switch (e) {
case ya$1:
return "Fragment";
case wa$1:
return "Portal";
case Aa:
return "Profiler";
case za$1:
return "StrictMode";
case Ea$1:
return "Suspense";
case Fa:
return "SuspenseList"
}
if ("object" == typeof e)
switch (e.$$typeof) {
case Ca$1:
return (e.displayName || "Context") + ".Consumer";
case Ba$1:
return (e._context.displayName || "Context") + ".Provider";
case Da$1:
var t = e.render;
return (e = e.displayName) || (e = "" !== (e = t.displayName ||
t.name || "") ? "ForwardRef(" + e + ")" : "ForwardRef"),
e;
case Ga$1:
return null !== (t = e.displayName || null) ? t : Qa$1(e.type)
|| "Memo";
case Ha$1:
t = e._payload,
e = e._init;
try {
return Qa$1(e(t))
} catch (r) {}
}
return null
}
function Ra(e) {
var t = e.type;
switch (e.tag) {
case 24:
return "Cache";
case 9:
return (t.displayName || "Context") + ".Consumer";
case 10:
return (t._context.displayName || "Context") + ".Provider";
case 18:
return "DehydratedFragment";
case 11:
return e = (e = t.render).displayName || e.name || "",
t.displayName || ("" !== e ? "ForwardRef(" + e + ")" :
"ForwardRef");
case 7:
return "Fragment";
case 5:
return t;
case 4:
return "Portal";
case 3:
return "Root";
case 6:
return "Text";
case 16:
return Qa$1(t);
case 8:
return t === za$1 ? "StrictMode" : "Mode";
case 22:
return "Offscreen";
case 12:
return "Profiler";
case 21:
return "Scope";
case 13:
return "Suspense";
case 19:
return "SuspenseList";
case 25:
return "TracingMarker";
case 1:
case 0:
case 17:
case 2:
case 14:
case 15:
if ("function" == typeof t)
return t.displayName || t.name || null;
if ("string" == typeof t)
return t
}
return null
}
function Sa(e) {
switch (typeof e) {
case "boolean":
case "number":
case "string":
case "undefined":
case "object":
return e;
default:
return ""
}
}
function Ta$1(e) {
var t = e.type;
return (e = e.nodeName) && "input" === e.toLowerCase() && ("checkbox"
=== t || "radio" === t)
}
function Ua$1(e) {
var t = Ta$1(e) ? "checked" : "value"
, r = Object.getOwnPropertyDescriptor(e.constructor.prototype, t)
, n = "" + e[t];
if (!e.hasOwnProperty(t) && void 0 !== r && "function" == typeof r.get
&& "function" == typeof r.set) {
var i = r.get
, o = r.set;
return Object.defineProperty(e, t, {
configurable: !0,
get: function() {
return i.call(this)
},
set: function(e) {
n = "" + e,
o.call(this, e)
}
}),
Object.defineProperty(e, t, {
enumerable: r.enumerable
}),
{
getValue: function() {
return n
},
setValue: function(e) {
n = "" + e
},
stopTracking: function() {
e._valueTracker = null,
delete e[t]
}
}
}
}
function Va$1(e) {
e._valueTracker || (e._valueTracker = Ua$1(e))
}
function Wa$1(e) {
if (!e)
return !1;
var t = e._valueTracker;
if (!t)
return !0;
var r = t.getValue()
, n = "";
return e && (n = Ta$1(e) ? e.checked ? "true" : "false" : e.value),
(e = n) !== r && (t.setValue(e),
!0)
}
function Xa$1(e) {
if (void 0 === (e = e || ("undefined" != typeof document ? document :
void 0)))
return null;
try {
return e.activeElement || e.body
} catch (t) {
return e.body
}
}
function Ya$1(e, t) {
var r = t.checked;
return A$3({}, t, {
defaultChecked: void 0,
defaultValue: void 0,
value: void 0,
checked: null != r ? r : e._wrapperState.initialChecked
})
}
function Za$1(e, t) {
var r = null == t.defaultValue ? "" : t.defaultValue
, n = null != t.checked ? t.checked : t.defaultChecked;
r = Sa(null != t.value ? t.value : r),
e._wrapperState = {
initialChecked: n,
initialValue: r,
controlled: "checkbox" === t.type || "radio" === t.type ? null !=
t.checked : null != t.value
}
}
function ab(e, t) {
null != (t = t.checked) && ta$1(e, "checked", t, !1)
}
function bb(e, t) {
ab(e, t);
var r = Sa(t.value)
, n = t.type;
if (null != r)
"number" === n ? (0 === r && "" === e.value || e.value != r) &&
(e.value = "" + r) : e.value !== "" + r && (e.value = "" + r);
else if ("submit" === n || "reset" === n)
return void e.removeAttribute("value");
t.hasOwnProperty("value") ? cb(e, t.type, r) :
t.hasOwnProperty("defaultValue") && cb(e, t.type, Sa(t.defaultValue)),
null == t.checked && null != t.defaultChecked && (e.defaultChecked = !!
t.defaultChecked)
}
function db(e, t, r) {
if (t.hasOwnProperty("value") || t.hasOwnProperty("defaultValue")) {
var n = t.type;
if (!("submit" !== n && "reset" !== n || void 0 !== t.value && null
!== t.value))
return;
t = "" + e._wrapperState.initialValue,
r || t === e.value || (e.value = t),
e.defaultValue = t
}
"" !== (r = e.name) && (e.name = ""),
e.defaultChecked = !!e._wrapperState.initialChecked,
"" !== r && (e.name = r)
}
function cb(e, t, r) {
"number" === t && Xa$1(e.ownerDocument) === e || (null == r ?
e.defaultValue = "" + e._wrapperState.initialValue : e.defaultValue !== "" + r &&
(e.defaultValue = "" + r))
}
var eb = Array.isArray;
function fb(e, t, r, n) {
if (e = e.options,
t) {
t = {};
for (var i = 0; i < r.length; i++)
t["$" + r[i]] = !0;
for (r = 0; r < e.length; r++)
i = t.hasOwnProperty("$" + e[r].value),
e[r].selected !== i && (e[r].selected = i),
i && n && (e[r].defaultSelected = !0)
} else {
for (r = "" + Sa(r),
t = null,
i = 0; i < e.length; i++) {
if (e[i].value === r)
return e[i].selected = !0,
void (n && (e[i].defaultSelected = !0));
null !== t || e[i].disabled || (t = e[i])
}
null !== t && (t.selected = !0)
}
}
function gb(e, t) {
if (null != t.dangerouslySetInnerHTML)
throw Error(p$6(91));
return A$3({}, t, {
value: void 0,
defaultValue: void 0,
children: "" + e._wrapperState.initialValue
})
}
function hb(e, t) {
var r = t.value;
if (null == r) {
if (r = t.children,
t = t.defaultValue,
null != r) {
if (null != t)
throw Error(p$6(92));
if (eb(r)) {
if (1 < r.length)
throw Error(p$6(93));
r = r[0]
}
t = r
}
null == t && (t = ""),
r = t
}
e._wrapperState = {
initialValue: Sa(r)
}
}
function ib(e, t) {
var r = Sa(t.value)
, n = Sa(t.defaultValue);
null != r && ((r = "" + r) !== e.value && (e.value = r),
null == t.defaultValue && e.defaultValue !== r && (e.defaultValue =
r)),
null != n && (e.defaultValue = "" + n)
}
function jb(e) {
var t = e.textContent;
t === e._wrapperState.initialValue && "" !== t && null !== t &&
(e.value = t)
}
function kb(e) {
switch (e) {
case "svg":
return "http://www.w3.org/2000/svg";
case "math":
return "http://www.w3.org/1998/Math/MathML";
default:
return "http://www.w3.org/1999/xhtml"
}
}
function lb(e, t) {
return null == e || "http://www.w3.org/1999/xhtml" === e ? kb(t) :
"http://www.w3.org/2000/svg" === e && "foreignObject" === t ?
"http://www.w3.org/1999/xhtml" : e
}
var mb, nb = (a2 = function(e, t) {
if ("http://www.w3.org/2000/svg" !== e.namespaceURI || "innerHTML"in e)
e.innerHTML = t;
else {
for ((mb = mb || document.createElement("div")).innerHTML = "<svg>"
+ t.valueOf().toString() + "</svg>",
t = mb.firstChild; e.firstChild; )
e.removeChild(e.firstChild);
for (; t.firstChild; )
e.appendChild(t.firstChild)
}
}
,
"undefined" != typeof MSApp && MSApp.execUnsafeLocalFunction ? function(e,
t, r, n) {
MSApp.execUnsafeLocalFunction((function() {
return a2(e, t)
}
))
}
: a2), a2;
function ob(e, t) {
if (t) {
var r = e.firstChild;
if (r && r === e.lastChild && 3 === r.nodeType)
return void (r.nodeValue = t)
}
e.textContent = t
}
var pb = {
animationIterationCount: !0,
aspectRatio: !0,
borderImageOutset: !0,
borderImageSlice: !0,
borderImageWidth: !0,
boxFlex: !0,
boxFlexGroup: !0,
boxOrdinalGroup: !0,
columnCount: !0,
columns: !0,
flex: !0,
flexGrow: !0,
flexPositive: !0,
flexShrink: !0,
flexNegative: !0,
flexOrder: !0,
gridArea: !0,
gridRow: !0,
gridRowEnd: !0,
gridRowSpan: !0,
gridRowStart: !0,
gridColumn: !0,
gridColumnEnd: !0,
gridColumnSpan: !0,
gridColumnStart: !0,
fontWeight: !0,
lineClamp: !0,
lineHeight: !0,
opacity: !0,
order: !0,
orphans: !0,
tabSize: !0,
widows: !0,
zIndex: !0,
zoom: !0,
fillOpacity: !0,
floodOpacity: !0,
stopOpacity: !0,
strokeDasharray: !0,
strokeDashoffset: !0,
strokeMiterlimit: !0,
strokeOpacity: !0,
strokeWidth: !0
}
, qb = ["Webkit", "ms", "Moz", "O"];
function rb(e, t, r) {
return null == t || "boolean" == typeof t || "" === t ? "" : r ||
"number" != typeof t || 0 === t || pb.hasOwnProperty(e) && pb[e] ? ("" +
t).trim() : t + "px"
}
function sb(e, t) {
for (var r in e = e.style,
t)
if (t.hasOwnProperty(r)) {
var n = 0 === r.indexOf("--")
, i = rb(r, t[r], n);
"float" === r && (r = "cssFloat"),
n ? e.setProperty(r, i) : e[r] = i
}
}
Object.keys(pb).forEach((function(e) {
qb.forEach((function(t) {
t = t + e.charAt(0).toUpperCase() + e.substring(1),
pb[t] = pb[e]
}
))
}
));
var tb = A$3({
menuitem: !0
}, {
area: !0,
base: !0,
br: !0,
col: !0,
embed: !0,
hr: !0,
img: !0,
input: !0,
keygen: !0,
link: !0,
meta: !0,
param: !0,
source: !0,
track: !0,
wbr: !0
});
function ub(e, t) {
if (t) {
if (tb[e] && (null != t.children || null !=
t.dangerouslySetInnerHTML))
throw Error(p$6(137, e));
if (null != t.dangerouslySetInnerHTML) {
if (null != t.children)
throw Error(p$6(60));
if ("object" != typeof t.dangerouslySetInnerHTML || !
("__html"in t.dangerouslySetInnerHTML))
throw Error(p$6(61))
}
if (null != t.style && "object" != typeof t.style)
throw Error(p$6(62))
}
}
function vb(e, t) {
if (-1 === e.indexOf("-"))
return "string" == typeof t.is;
switch (e) {
case "annotation-xml":
case "color-profile":
case "font-face":
case "font-face-src":
case "font-face-uri":
case "font-face-format":
case "font-face-name":
case "missing-glyph":
return !1;
default:
return !0
}
}
var wb = null;
function xb(e) {
return (e = e.target || e.srcElement || window).correspondingUseElement
&& (e = e.correspondingUseElement),
3 === e.nodeType ? e.parentNode : e
}
var yb = null
, zb = null
, Ab = null;
function Bb(e) {
if (e = Cb(e)) {
if ("function" != typeof yb)
throw Error(p$6(280));
var t = e.stateNode;
t && (t = Db(t),
yb(e.stateNode, e.type, t))
}
}
function Eb(e) {
zb ? Ab ? Ab.push(e) : Ab = [e] : zb = e
}
function Fb() {
if (zb) {
var e = zb
, t = Ab;
if (Ab = zb = null,
Bb(e),
t)
for (e = 0; e < t.length; e++)
Bb(t[e])
}
}
function Gb(e, t) {
return e(t)
}
function Hb() {}
var Ib = !1;
function Jb(e, t, r) {
if (Ib)
return e(t, r);
Ib = !0;
try {
return Gb(e, t, r)
} finally {
Ib = !1,
(null !== zb || null !== Ab) && (Hb(),
Fb())
}
}
function Kb(e, t) {
var r = e.stateNode;
if (null === r)
return null;
var n = Db(r);
if (null === n)
return null;
r = n[t];
e: switch (t) {
case "onClick":
case "onClickCapture":
case "onDoubleClick":
case "onDoubleClickCapture":
case "onMouseDown":
case "onMouseDownCapture":
case "onMouseMove":
case "onMouseMoveCapture":
case "onMouseUp":
case "onMouseUpCapture":
case "onMouseEnter":
(n = !n.disabled) || (n = !("button" === (e = e.type) || "input"
=== e || "select" === e || "textarea" === e)),
e = !n;
break e;
default:
e = !1
}
if (e)
return null;
if (r && "function" != typeof r)
throw Error(p$6(231, t, typeof r));
return r
}
var Lb = !1;
if (ia$1)
try {
var Mb = {};
Object.defineProperty(Mb, "passive", {
get: function() {
Lb = !0
}
}),
window.addEventListener("test", Mb, Mb),
window.removeEventListener("test", Mb, Mb)
} catch (a2) {
Lb = !1
}
function Nb(e, t, r, n, i, o, s, a, l) {
var c = Array.prototype.slice.call(arguments, 3);
try {
t.apply(r, c)
} catch (u) {
this.onError(u)
}
}
var Ob = !1
, Pb = null
, Qb = !1
, Rb = null
, Sb = {
onError: function(e) {
Ob = !0,
Pb = e
}
};
function Tb(e, t, r, n, i, o, s, a, l) {
Ob = !1,
Pb = null,
Nb.apply(Sb, arguments)
}
function Ub(e, t, r, n, i, o, s, a, l) {
if (Tb.apply(this, arguments),
Ob) {
if (!Ob)
throw Error(p$6(198));
var c = Pb;
Ob = !1,
Pb = null,
Qb || (Qb = !0,
Rb = c)
}
}
function Vb(e) {
var t = e
, r = e;
if (e.alternate)
for (; t.return; )
t = t.return;
else {
e = t;
do {
!!(4098 & (t = e).flags) && (r = t.return),
e = t.return
} while (e)
}
return 3 === t.tag ? r : null
}
function Wb(e) {
if (13 === e.tag) {
var t = e.memoizedState;
if (null === t && (null !== (e = e.alternate) && (t =
e.memoizedState)),
null !== t)
return t.dehydrated
}
return null
}
function Xb(e) {
if (Vb(e) !== e)
throw Error(p$6(188))
}
function Yb(e) {
var t = e.alternate;
if (!t) {
if (null === (t = Vb(e)))
throw Error(p$6(188));
return t !== e ? null : e
}
for (var r = e, n = t; ; ) {
var i = r.return;
if (null === i)
break;
var o = i.alternate;
if (null === o) {
if (null !== (n = i.return)) {
r = n;
continue
}
break
}
if (i.child === o.child) {
for (o = i.child; o; ) {
if (o === r)
return Xb(i),
e;
if (o === n)
return Xb(i),
t;
o = o.sibling
}
throw Error(p$6(188))
}
if (r.return !== n.return)
r = i,
n = o;
else {
for (var s = !1, a = i.child; a; ) {
if (a === r) {
s = !0,
r = i,
n = o;
break
}
if (a === n) {
s = !0,
n = i,
r = o;
break
}
a = a.sibling
}
if (!s) {
for (a = o.child; a; ) {
if (a === r) {
s = !0,
r = o,
n = i;
break
}
if (a === n) {
s = !0,
n = o,
r = i;
break
}
a = a.sibling
}
if (!s)
throw Error(p$6(189))
}
}
if (r.alternate !== n)
throw Error(p$6(190))
}
if (3 !== r.tag)
throw Error(p$6(188));
return r.stateNode.current === r ? e : t
}
function Zb(e) {
return null !== (e = Yb(e)) ? $b(e) : null
}
function $b(e) {
if (5 === e.tag || 6 === e.tag)
return e;
for (e = e.child; null !== e; ) {
var t = $b(e);
if (null !== t)
return t;
e = e.sibling
}
return null
}
var ac = ca$1.unstable_scheduleCallback
, bc = ca$1.unstable_cancelCallback
, cc = ca$1.unstable_shouldYield
, dc = ca$1.unstable_requestPaint
, B$2 = ca$1.unstable_now
, ec = ca$1.unstable_getCurrentPriorityLevel
, fc = ca$1.unstable_ImmediatePriority
, gc = ca$1.unstable_UserBlockingPriority
, hc = ca$1.unstable_NormalPriority
, ic = ca$1.unstable_LowPriority
, jc = ca$1.unstable_IdlePriority
, kc = null
, lc = null;
function mc(e) {
if (lc && "function" == typeof lc.onCommitFiberRoot)
try {
lc.onCommitFiberRoot(kc, e, void 0, !(128 & ~e.current.flags))
} catch (t) {}
}
var oc = Math.clz32 ? Math.clz32 : nc
, pc = Math.log
, qc = Math.LN2;
function nc(e) {
return 0 === (e >>>= 0) ? 32 : 31 - (pc(e) / qc | 0) | 0
}
var rc = 64
, sc = 4194304;
function tc(e) {
switch (e & -e) {
case 1:
return 1;
case 2:
return 2;
case 4:
return 4;
case 8:
return 8;
case 16:
return 16;
case 32:
return 32;
case 64:
case 128:
case 256:
case 512:
case 1024:
case 2048:
case 4096:
case 8192:
case 16384:
case 32768:
case 65536:
case 131072:
case 262144:
case 524288:
case 1048576:
case 2097152:
return 4194240 & e;
case 4194304:
case 8388608:
case 16777216:
case 33554432:
case 67108864:
return 130023424 & e;
case 134217728:
return 134217728;
case 268435456:
return 268435456;
case 536870912:
return 536870912;
case 1073741824:
return 1073741824;
default:
return e
}
}
function uc(e, t) {
var r = e.pendingLanes;
if (0 === r)
return 0;
var n = 0
, i = e.suspendedLanes
, o = e.pingedLanes
, s = 268435455 & r;
if (0 !== s) {
var a = s & ~i;
0 !== a ? n = tc(a) : 0 !== (o &= s) && (n = tc(o))
} else
0 !== (s = r & ~i) ? n = tc(s) : 0 !== o && (n = tc(o));
if (0 === n)
return 0;
if (0 !== t && t !== n && !(t & i) && ((i = n & -n) >= (o = t & -t) ||
16 === i && 4194240 & o))
return t;
if (4 & n && (n |= 16 & r),
0 !== (t = e.entangledLanes))
for (e = e.entanglements,
t &= n; 0 < t; )
i = 1 << (r = 31 - oc(t)),
n |= e[r],
t &= ~i;
return n
}
function vc(e, t) {
switch (e) {
case 1:
case 2:
case 4:
return t + 250;
case 8:
case 16:
case 32:
case 64:
case 128:
case 256:
case 512:
case 1024:
case 2048:
case 4096:
case 8192:
case 16384:
case 32768:
case 65536:
case 131072:
case 262144:
case 524288:
case 1048576:
case 2097152:
return t + 5e3;
default:
return -1
}
}
function wc(e, t) {
for (var r = e.suspendedLanes, n = e.pingedLanes, i =
e.expirationTimes, o = e.pendingLanes; 0 < o; ) {
var s = 31 - oc(o)
, a = 1 << s
, l = i[s];
-1 === l ? a & r && !(a & n) || (i[s] = vc(a, t)) : l <= t &&
(e.expiredLanes |= a),
o &= ~a
}
}
function xc(e) {
return 0 !== (e = -1073741825 & e.pendingLanes) ? e : 1073741824 & e ?
1073741824 : 0
}
function yc() {
var e = rc;
return !(4194240 & (rc <<= 1)) && (rc = 64),
e
}
function zc(e) {
for (var t = [], r = 0; 31 > r; r++)
t.push(e);
return t
}
function Ac(e, t, r) {
e.pendingLanes |= t,
536870912 !== t && (e.suspendedLanes = 0,
e.pingedLanes = 0),
(e = e.eventTimes)[t = 31 - oc(t)] = r
}
function Bc(e, t) {
var r = e.pendingLanes & ~t;
e.pendingLanes = t,
e.suspendedLanes = 0,
e.pingedLanes = 0,
e.expiredLanes &= t,
e.mutableReadLanes &= t,
e.entangledLanes &= t,
t = e.entanglements;
var n = e.eventTimes;
for (e = e.expirationTimes; 0 < r; ) {
var i = 31 - oc(r)
, o = 1 << i;
t[i] = 0,
n[i] = -1,
e[i] = -1,
r &= ~o
}
}
function Cc(e, t) {
var r = e.entangledLanes |= t;
for (e = e.entanglements; r; ) {
var n = 31 - oc(r)
, i = 1 << n;
i & t | e[n] & t && (e[n] |= t),
r &= ~i
}
}
var C$2 = 0;
function Dc(e) {
return 1 < (e &= -e) ? 4 < e ? 268435455 & e ? 16 : 536870912 : 4 : 1
}
var Ec, Fc, Gc, Hc, Ic, Jc = !1, Kc = [], Lc = null, Mc = null, Nc = null,
Oc = new Map, Pc = new Map, Qc = [], Rc = "mousedown mouseup touchcancel touchend
touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart
drop compositionend compositionstart keydown keypress keyup input textInput copy
cut paste click change contextmenu reset submit".split(" ");
function Sc(e, t) {
switch (e) {
case "focusin":
case "focusout":
Lc = null;
break;
case "dragenter":
case "dragleave":
Mc = null;
break;
case "mouseover":
case "mouseout":
Nc = null;
break;
case "pointerover":
case "pointerout":
Oc.delete(t.pointerId);
break;
case "gotpointercapture":
case "lostpointercapture":
Pc.delete(t.pointerId)
}
}
function Tc(e, t, r, n, i, o) {
return null === e || e.nativeEvent !== o ? (e = {
blockedOn: t,
domEventName: r,
eventSystemFlags: n,
nativeEvent: o,
targetContainers: [i]
},
null !== t && (null !== (t = Cb(t)) && Fc(t)),
e) : (e.eventSystemFlags |= n,
t = e.targetContainers,
null !== i && -1 === t.indexOf(i) && t.push(i),
e)
}
function Uc(e, t, r, n, i) {
switch (t) {
case "focusin":
return Lc = Tc(Lc, e, t, r, n, i),
!0;
case "dragenter":
return Mc = Tc(Mc, e, t, r, n, i),
!0;
case "mouseover":
return Nc = Tc(Nc, e, t, r, n, i),
!0;
case "pointerover":
var o = i.pointerId;
return Oc.set(o, Tc(Oc.get(o) || null, e, t, r, n, i)),
!0;
case "gotpointercapture":
return o = i.pointerId,
Pc.set(o, Tc(Pc.get(o) || null, e, t, r, n, i)),
!0
}
return !1
}
function Vc(e) {
var t = Wc(e.target);
if (null !== t) {
var r = Vb(t);
if (null !== r)
if (13 === (t = r.tag)) {
if (null !== (t = Wb(r)))
return e.blockedOn = t,
void Ic(e.priority, (function() {
Gc(r)
}
))
} else if (3 === t &&
r.stateNode.current.memoizedState.isDehydrated)
return void (e.blockedOn = 3 === r.tag ?
r.stateNode.containerInfo : null)
}
e.blockedOn = null
}
function Xc(e) {
if (null !== e.blockedOn)
return !1;
for (var t = e.targetContainers; 0 < t.length; ) {
var r = Yc(e.domEventName, e.eventSystemFlags, t[0],
e.nativeEvent);
if (null !== r)
return null !== (t = Cb(r)) && Fc(t),
e.blockedOn = r,
!1;
var n = new (r = e.nativeEvent).constructor(r.type,r);
wb = n,
r.target.dispatchEvent(n),
wb = null,
t.shift()
}
return !0
}
function Zc(e, t, r) {
Xc(e) && r.delete(t)
}
function $c() {
Jc = !1,
null !== Lc && Xc(Lc) && (Lc = null),
null !== Mc && Xc(Mc) && (Mc = null),
null !== Nc && Xc(Nc) && (Nc = null),
Oc.forEach(Zc),
Pc.forEach(Zc)
}
function ad(e, t) {
e.blockedOn === t && (e.blockedOn = null,
Jc || (Jc = !0,
ca$1.unstable_scheduleCallback(ca$1.unstable_NormalPriority, $c)))
}
function bd(e) {
function t(t) {
return ad(t, e)
}
if (0 < Kc.length) {
ad(Kc[0], e);
for (var r = 1; r < Kc.length; r++) {
var n = Kc[r];
n.blockedOn === e && (n.blockedOn = null)
}
}
for (null !== Lc && ad(Lc, e),
null !== Mc && ad(Mc, e),
null !== Nc && ad(Nc, e),
Oc.forEach(t),
Pc.forEach(t),
r = 0; r < Qc.length; r++)
(n = Qc[r]).blockedOn === e && (n.blockedOn = null);
for (; 0 < Qc.length && null === (r = Qc[0]).blockedOn; )
Vc(r),
null === r.blockedOn && Qc.shift()
}
var cd = ua.ReactCurrentBatchConfig
, dd = !0;
function ed(e, t, r, n) {
var i = C$2
, o = cd.transition;
cd.transition = null;
try {
C$2 = 1,
fd$1(e, t, r, n)
} finally {
C$2 = i,
cd.transition = o
}
}
function gd(e, t, r, n) {
var i = C$2
, o = cd.transition;
cd.transition = null;
try {
C$2 = 4,
fd$1(e, t, r, n)
} finally {
C$2 = i,
cd.transition = o
}
}
function fd$1(e, t, r, n) {
if (dd) {
var i = Yc(e, t, r, n);
if (null === i)
hd(e, t, n, id, r),
Sc(e, n);
else if (Uc(i, e, t, r, n))
n.stopPropagation();
else if (Sc(e, n),
4 & t && -1 < Rc.indexOf(e)) {
for (; null !== i; ) {
var o = Cb(i);
if (null !== o && Ec(o),
null === (o = Yc(e, t, r, n)) && hd(e, t, n, id, r),
o === i)
break;
i = o
}
null !== i && n.stopPropagation()
} else
hd(e, t, n, null, r)
}
}
var id = null;
function Yc(e, t, r, n) {
if (id = null,
null !== (e = Wc(e = xb(n))))
if (null === (t = Vb(e)))
e = null;
else if (13 === (r = t.tag)) {
if (null !== (e = Wb(t)))
return e;
e = null
} else if (3 === r) {
if (t.stateNode.current.memoizedState.isDehydrated)
return 3 === t.tag ? t.stateNode.containerInfo : null;
e = null
} else
t !== e && (e = null);
return id = e,
null
}
function jd(e) {
switch (e) {
case "cancel":
case "click":
case "close":
case "contextmenu":
case "copy":
case "cut":
case "auxclick":
case "dblclick":
case "dragend":
case "dragstart":
case "drop":
case "focusin":
case "focusout":
case "input":
case "invalid":
case "keydown":
case "keypress":
case "keyup":
case "mousedown":
case "mouseup":
case "paste":
case "pause":
case "play":
case "pointercancel":
case "pointerdown":
case "pointerup":
case "ratechange":
case "reset":
case "resize":
case "seeked":
case "submit":
case "touchcancel":
case "touchend":
case "touchstart":
case "volumechange":
case "change":
case "selectionchange":
case "textInput":
case "compositionstart":
case "compositionend":
case "compositionupdate":
case "beforeblur":
case "afterblur":
case "beforeinput":
case "blur":
case "fullscreenchange":
case "focus":
case "hashchange":
case "popstate":
case "select":
case "selectstart":
return 1;
case "drag":
case "dragenter":
case "dragexit":
case "dragleave":
case "dragover":
case "mousemove":
case "mouseout":
case "mouseover":
case "pointermove":
case "pointerout":
case "pointerover":
case "scroll":
case "toggle":
case "touchmove":
case "wheel":
case "mouseenter":
case "mouseleave":
case "pointerenter":
case "pointerleave":
return 4;
case "message":
switch (ec()) {
case fc:
return 1;
case gc:
return 4;
case hc:
case ic:
return 16;
case jc:
return 536870912;
default:
return 16
}
default:
return 16
}
}
var kd = null
, ld = null
, md = null;
function nd() {
if (md)
return md;
var e, t, r = ld, n = r.length, i = "value"in kd ? kd.value :
kd.textContent, o = i.length;
for (e = 0; e < n && r[e] === i[e]; e++)
;
var s = n - e;
for (t = 1; t <= s && r[n - t] === i[o - t]; t++)
;
return md = i.slice(e, 1 < t ? 1 - t : void 0)
}
function od(e) {
var t = e.keyCode;
return "charCode"in e ? 0 === (e = e.charCode) && 13 === t && (e =
13) : e = t,
10 === e && (e = 13),
32 <= e || 13 === e ? e : 0
}
function pd() {
return !0
}
function qd() {
return !1
}
function rd(e) {
function t(t, r, n, i, o) {
for (var s in this._reactName = t,
this._targetInst = n,
this.type = r,
this.nativeEvent = i,
this.target = o,
this.currentTarget = null,
e)
e.hasOwnProperty(s) && (t = e[s],
this[s] = t ? t(i) : i[s]);
return this.isDefaultPrevented = (null != i.defaultPrevented ?
i.defaultPrevented : !1 === i.returnValue) ? pd : qd,
this.isPropagationStopped = qd,
this
}
return A$3(t.prototype, {
preventDefault: function() {
this.defaultPrevented = !0;
var e = this.nativeEvent;
e && (e.preventDefault ? e.preventDefault() : "unknown" !=
typeof e.returnValue && (e.returnValue = !1),
this.isDefaultPrevented = pd)
},
stopPropagation: function() {
var e = this.nativeEvent;
e && (e.stopPropagation ? e.stopPropagation() : "unknown" !=
typeof e.cancelBubble && (e.cancelBubble = !0),
this.isPropagationStopped = pd)
},
persist: function() {},
isPersistent: pd
}),
t
}
var sd = {
eventPhase: 0,
bubbles: 0,
cancelable: 0,
timeStamp: function(e) {
return e.timeStamp || Date.now()
},
defaultPrevented: 0,
isTrusted: 0
}, td$1 = rd(sd), ud = A$3({}, sd, {
view: 0,
detail: 0
}), vd = rd(ud), wd, xd, yd, Ad = A$3({}, ud, {
screenX: 0,
screenY: 0,
clientX: 0,
clientY: 0,
pageX: 0,
pageY: 0,
ctrlKey: 0,
shiftKey: 0,
altKey: 0,
metaKey: 0,
getModifierState: zd,
button: 0,
buttons: 0,
relatedTarget: function(e) {
return void 0 === e.relatedTarget ? e.fromElement ===
e.srcElement ? e.toElement : e.fromElement : e.relatedTarget
},
movementX: function(e) {
return "movementX"in e ? e.movementX : (e !== yd && (yd &&
"mousemove" === e.type ? (wd = e.screenX - yd.screenX,
xd = e.screenY - yd.screenY) : xd = wd = 0,
yd = e),
wd)
},
movementY: function(e) {
return "movementY"in e ? e.movementY : xd
}
}), Bd = rd(Ad), Cd = A$3({}, Ad, {
dataTransfer: 0
}), Dd = rd(Cd), Ed = A$3({}, ud, {
relatedTarget: 0
}), Fd = rd(Ed), Gd = A$3({}, sd, {
animationName: 0,
elapsedTime: 0,
pseudoElement: 0
}), Hd = rd(Gd), Id = A$3({}, sd, {
clipboardData: function(e) {
return "clipboardData"in e ? e.clipboardData : window.clipboardData
}
}), Jd = rd(Id), Kd = A$3({}, sd, {
data: 0
}), Ld = rd(Kd), Md = {
Esc: "Escape",
Spacebar: " ",
Left: "ArrowLeft",
Up: "ArrowUp",
Right: "ArrowRight",
Down: "ArrowDown",
Del: "Delete",
Win: "OS",
Menu: "ContextMenu",
Apps: "ContextMenu",
Scroll: "ScrollLock",
MozPrintableKey: "Unidentified"
}, Nd = {
8: "Backspace",
9: "Tab",
12: "Clear",
13: "Enter",
16: "Shift",
17: "Control",
18: "Alt",
19: "Pause",
20: "CapsLock",
27: "Escape",
32: " ",
33: "PageUp",
34: "PageDown",
35: "End",
36: "Home",
37: "ArrowLeft",
38: "ArrowUp",
39: "ArrowRight",
40: "ArrowDown",
45: "Insert",
46: "Delete",
112: "F1",
113: "F2",
114: "F3",
115: "F4",
116: "F5",
117: "F6",
118: "F7",
119: "F8",
120: "F9",
121: "F10",
122: "F11",
123: "F12",
144: "NumLock",
145: "ScrollLock",
224: "Meta"
}, Od = {
Alt: "altKey",
Control: "ctrlKey",
Meta: "metaKey",
Shift: "shiftKey"
};
function Pd(e) {
var t = this.nativeEvent;
return t.getModifierState ? t.getModifierState(e) : !!(e = Od[e]) && !!
t[e]
}
function zd() {
return Pd
}
var Qd = A$3({}, ud, {
key: function(e) {
if (e.key) {
var t = Md[e.key] || e.key;
if ("Unidentified" !== t)
return t
}
return "keypress" === e.type ? 13 === (e = od(e)) ? "Enter" :
String.fromCharCode(e) : "keydown" === e.type || "keyup" === e.type ? Nd[e.keyCode]
|| "Unidentified" : ""
},
code: 0,
location: 0,
ctrlKey: 0,
shiftKey: 0,
altKey: 0,
metaKey: 0,
repeat: 0,
locale: 0,
getModifierState: zd,
charCode: function(e) {
return "keypress" === e.type ? od(e) : 0
},
keyCode: function(e) {
return "keydown" === e.type || "keyup" === e.type ? e.keyCode : 0
},
which: function(e) {
return "keypress" === e.type ? od(e) : "keydown" === e.type ||
"keyup" === e.type ? e.keyCode : 0
}
})
, Rd = rd(Qd)
, Sd = A$3({}, Ad, {
pointerId: 0,
width: 0,
height: 0,
pressure: 0,
tangentialPressure: 0,
tiltX: 0,
tiltY: 0,
twist: 0,
pointerType: 0,
isPrimary: 0
})
, Td = rd(Sd)
, Ud = A$3({}, ud, {
touches: 0,
targetTouches: 0,
changedTouches: 0,
altKey: 0,
metaKey: 0,
ctrlKey: 0,
shiftKey: 0,
getModifierState: zd
})
, Vd = rd(Ud)
, Wd = A$3({}, sd, {
propertyName: 0,
elapsedTime: 0,
pseudoElement: 0
})
, Xd = rd(Wd)
, Yd = A$3({}, Ad, {
deltaX: function(e) {
return "deltaX"in e ? e.deltaX : "wheelDeltaX"in e ? -e.wheelDeltaX
: 0
},
deltaY: function(e) {
return "deltaY"in e ? e.deltaY : "wheelDeltaY"in e ? -e.wheelDeltaY
: "wheelDelta"in e ? -e.wheelDelta : 0
},
deltaZ: 0,
deltaMode: 0
})
, Zd = rd(Yd)
, $d = [9, 13, 27, 32]
, ae$2 = ia$1 && "CompositionEvent"in window
, be$2 = null;
ia$1 && "documentMode"in document && (be$2 = document.documentMode);
var ce$2 = ia$1 && "TextEvent"in window && !be$2
, de$2 = ia$1 && (!ae$2 || be$2 && 8 < be$2 && 11 >= be$2)
, ee$2 = String.fromCharCode(32)
, fe$2 = !1;
function ge$2(e, t) {
switch (e) {
case "keyup":
return -1 !== $d.indexOf(t.keyCode);
case "keydown":
return 229 !== t.keyCode;
case "keypress":
case "mousedown":
case "focusout":
return !0;
default:
return !1
}
}
function he$2(e) {
return "object" == typeof (e = e.detail) && "data"in e ? e.data : null
}
var ie$2 = !1;
function je$1(e, t) {
switch (e) {
case "compositionend":
return he$2(t);
case "keypress":
return 32 !== t.which ? null : (fe$2 = !0,
ee$2);
case "textInput":
return (e = t.data) === ee$2 && fe$2 ? null : e;
default:
return null
}
}
function ke$1(e, t) {
if (ie$2)
return "compositionend" === e || !ae$2 && ge$2(e, t) ? (e = nd(),
md = ld = kd = null,
ie$2 = !1,
e) : null;
switch (e) {
case "paste":
default:
return null;
case "keypress":
if (!(t.ctrlKey || t.altKey || t.metaKey) || t.ctrlKey && t.altKey)
{
if (t.char && 1 < t.char.length)
return t.char;
if (t.which)
return String.fromCharCode(t.which)
}
return null;
case "compositionend":
return de$2 && "ko" !== t.locale ? null : t.data
}
}
var le$2 = {
color: !0,
date: !0,
datetime: !0,
"datetime-local": !0,
email: !0,
month: !0,
number: !0,
password: !0,
range: !0,
search: !0,
tel: !0,
text: !0,
time: !0,
url: !0,
week: !0
};
function me$2(e) {
var t = e && e.nodeName && e.nodeName.toLowerCase();
return "input" === t ? !!le$2[e.type] : "textarea" === t
}
function ne$2(e, t, r, n) {
Eb(n),
0 < (t = oe$2(t, "onChange")).length && (r = new
td$1("onChange","change",null,r,n),
e.push({
event: r,
listeners: t
}))
}
var pe$2 = null
, qe$1 = null;
function re$2(e) {
se$2(e, 0)
}
function te$2(e) {
if (Wa$1(ue$2(e)))
return e
}
function ve$2(e, t) {
if ("change" === e)
return t
}
var we$1 = !1;
if (ia$1) {
var xe$1;
if (ia$1) {
var ye$2 = "oninput"in document;
if (!ye$2) {
var ze$1 = document.createElement("div");
ze$1.setAttribute("oninput", "return;"),
ye$2 = "function" == typeof ze$1.oninput
}
xe$1 = ye$2
} else
xe$1 = !1;
we$1 = xe$1 && (!document.documentMode || 9 < document.documentMode)
}
function Ae$1() {
pe$2 && (pe$2.detachEvent("onpropertychange", Be$1),
qe$1 = pe$2 = null)
}
function Be$1(e) {
if ("value" === e.propertyName && te$2(qe$1)) {
var t = [];
ne$2(t, qe$1, e, xb(e)),
Jb(re$2, t)
}
}
function Ce$2(e, t, r) {
"focusin" === e ? (Ae$1(),
qe$1 = r,
(pe$2 = t).attachEvent("onpropertychange", Be$1)) : "focusout" === e &&
Ae$1()
}
function De$1(e) {
if ("selectionchange" === e || "keyup" === e || "keydown" === e)
return te$2(qe$1)
}
function Ee$1(e, t) {
if ("click" === e)
return te$2(t)
}
function Fe$1(e, t) {
if ("input" === e || "change" === e)
return te$2(t)
}
function Ge$1(e, t) {
return e === t && (0 !== e || 1 / e == 1 / t) || e != e && t != t
}
var He$1 = "function" == typeof Object.is ? Object.is : Ge$1;
function Ie$1(e, t) {
if (He$1(e, t))
return !0;
if ("object" != typeof e || null === e || "object" != typeof t || null
=== t)
return !1;
var r = Object.keys(e)
, n = Object.keys(t);
if (r.length !== n.length)
return !1;
for (n = 0; n < r.length; n++) {
var i = r[n];
if (!ja$1.call(t, i) || !He$1(e[i], t[i]))
return !1
}
return !0
}
function Je$1(e) {
for (; e && e.firstChild; )
e = e.firstChild;
return e
}
function Ke$1(e, t) {
var r, n = Je$1(e);
for (e = 0; n; ) {
if (3 === n.nodeType) {
if (r = e + n.textContent.length,
e <= t && r >= t)
return {
node: n,
offset: t - e
};
e = r
}
e: {
for (; n; ) {
if (n.nextSibling) {
n = n.nextSibling;
break e
}
n = n.parentNode
}
n = void 0
}
n = Je$1(n)
}
}
function Le$1(e, t) {
return !(!e || !t) && (e === t || (!e || 3 !== e.nodeType) && (t && 3
=== t.nodeType ? Le$1(e, t.parentNode) : "contains"in e ? e.contains(t) : !!
e.compareDocumentPosition && !!(16 & e.compareDocumentPosition(t))))
}
function Me$1() {
for (var e = window, t = Xa$1(); t instanceof e.HTMLIFrameElement; ) {
try {
var r = "string" == typeof t.contentWindow.location.href
} catch (n) {
r = !1
}
if (!r)
break;
t = Xa$1((e = t.contentWindow).document)
}
return t
}
function Ne$1(e) {
var t = e && e.nodeName && e.nodeName.toLowerCase();
return t && ("input" === t && ("text" === e.type || "search" === e.type
|| "tel" === e.type || "url" === e.type || "password" === e.type) || "textarea" ===
t || "true" === e.contentEditable)
}
function Oe$1(e) {
var t = Me$1()
, r = e.focusedElem
, n = e.selectionRange;
if (t !== r && r && r.ownerDocument &&
Le$1(r.ownerDocument.documentElement, r)) {
if (null !== n && Ne$1(r))
if (t = n.start,
void 0 === (e = n.end) && (e = t),
"selectionStart"in r)
r.selectionStart = t,
r.selectionEnd = Math.min(e, r.value.length);
else if ((e = (t = r.ownerDocument || document) &&
t.defaultView || window).getSelection) {
e = e.getSelection();
var i = r.textContent.length
, o = Math.min(n.start, i);
n = void 0 === n.end ? o : Math.min(n.end, i),
!e.extend && o > n && (i = n,
n = o,
o = i),
i = Ke$1(r, o);
var s = Ke$1(r, n);
i && s && (1 !== e.rangeCount || e.anchorNode !== i.node ||
e.anchorOffset !== i.offset || e.focusNode !== s.node || e.focusOffset !==
s.offset) && ((t = t.createRange()).setStart(i.node, i.offset),
e.removeAllRanges(),
o > n ? (e.addRange(t),
e.extend(s.node, s.offset)) : (t.setEnd(s.node, s.offset),
e.addRange(t)))
}
for (t = [],
e = r; e = e.parentNode; )
1 === e.nodeType && t.push({
element: e,
left: e.scrollLeft,
top: e.scrollTop
});
for ("function" == typeof r.focus && r.focus(),
r = 0; r < t.length; r++)
(e = t[r]).element.scrollLeft = e.left,
e.element.scrollTop = e.top
}
}
var Pe$1 = ia$1 && "documentMode"in document && 11 >= document.documentMode
, Qe$1 = null
, Re$1 = null
, Se$1 = null
, Te$1 = !1;
function Ue$1(e, t, r) {
var n = r.window === r ? r.document : 9 === r.nodeType ? r :
r.ownerDocument;
Te$1 || null == Qe$1 || Qe$1 !== Xa$1(n) || ("selectionStart"in (n =
Qe$1) && Ne$1(n) ? n = {
start: n.selectionStart,
end: n.selectionEnd
} : n = {
anchorNode: (n = (n.ownerDocument && n.ownerDocument.defaultView ||
window).getSelection()).anchorNode,
anchorOffset: n.anchorOffset,
focusNode: n.focusNode,
focusOffset: n.focusOffset
},
Se$1 && Ie$1(Se$1, n) || (Se$1 = n,
0 < (n = oe$2(Re$1, "onSelect")).length && (t = new
td$1("onSelect","select",null,t,r),
e.push({
event: t,
listeners: n
}),
t.target = Qe$1)))
}
function Ve$1(e, t) {
var r = {};
return r[e.toLowerCase()] = t.toLowerCase(),
r["Webkit" + e] = "webkit" + t,
r["Moz" + e] = "moz" + t,
r
}
var We$1 = {
animationend: Ve$1("Animation", "AnimationEnd"),
animationiteration: Ve$1("Animation", "AnimationIteration"),
animationstart: Ve$1("Animation", "AnimationStart"),
transitionend: Ve$1("Transition", "TransitionEnd")
}
, Xe$1 = {}
, Ye$1 = {};
function Ze$1(e) {
if (Xe$1[e])
return Xe$1[e];
if (!We$1[e])
return e;
var t, r = We$1[e];
for (t in r)
if (r.hasOwnProperty(t) && t in Ye$1)
return Xe$1[e] = r[t];
return e
}
ia$1 && (Ye$1 = document.createElement("div").style,
"AnimationEvent"in window || (delete We$1.animationend.animation,
delete We$1.animationiteration.animation,
delete We$1.animationstart.animation),
"TransitionEvent"in window || delete We$1.transitionend.transition);
var $e$1 = Ze$1("animationend")
, af = Ze$1("animationiteration")
, bf = Ze$1("animationstart")
, cf = Ze$1("transitionend")
, df = new Map
, ef = "abort auxClick cancel canPlay canPlayThrough click close
contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart
drop durationChange emptied encrypted ended error gotPointerCapture input invalid
keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture
mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing
pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress
rateChange reset resize seeked seeking stalled submit suspend timeUpdate
touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting
wheel".split(" ");
function ff(e, t) {
df.set(e, t),
fa$1(t, [e])
}
for (var gf = 0; gf < ef.length; gf++) {
var hf = ef[gf]
, jf = hf.toLowerCase()
, kf = hf[0].toUpperCase() + hf.slice(1);
ff(jf, "on" + kf)
}
ff($e$1, "onAnimationEnd"),
ff(af, "onAnimationIteration"),
ff(bf, "onAnimationStart"),
ff("dblclick", "onDoubleClick"),
ff("focusin", "onFocus"),
ff("focusout", "onBlur"),
ff(cf, "onTransitionEnd"),
ha$1("onMouseEnter", ["mouseout", "mouseover"]),
ha$1("onMouseLeave", ["mouseout", "mouseover"]),
ha$1("onPointerEnter", ["pointerout", "pointerover"]),
ha$1("onPointerLeave", ["pointerout", "pointerover"]),
fa$1("onChange", "change click focusin focusout input keydown keyup
selectionchange".split(" ")),
fa$1("onSelect", "focusout contextmenu dragend focusin keydown keyup
mousedown mouseup selectionchange".split(" ")),
fa$1("onBeforeInput", ["compositionend", "keypress", "textInput",
"paste"]),
fa$1("onCompositionEnd", "compositionend focusout keydown keypress keyup
mousedown".split(" ")),
fa$1("onCompositionStart", "compositionstart focusout keydown keypress
keyup mousedown".split(" ")),
fa$1("onCompositionUpdate", "compositionupdate focusout keydown keypress
keyup mousedown".split(" "));
var lf = "abort canplay canplaythrough durationchange emptied encrypted
ended error loadeddata loadedmetadata loadstart pause play playing progress
ratechange resize seeked seeking stalled suspend timeupdate volumechange
waiting".split(" ")
, mf = new Set("cancel close invalid load scroll toggle".split("
").concat(lf));
function nf(e, t, r) {
var n = e.type || "unknown-event";
e.currentTarget = r,
Ub(n, t, void 0, e),
e.currentTarget = null
}
function se$2(e, t) {
t = !!(4 & t);
for (var r = 0; r < e.length; r++) {
var n = e[r]
, i = n.event;
n = n.listeners;
e: {
var o = void 0;
if (t)
for (var s = n.length - 1; 0 <= s; s--) {
var a = n[s]
, l = a.instance
, c = a.currentTarget;
if (a = a.listener,
l !== o && i.isPropagationStopped())
break e;
nf(i, a, c),
o = l
}
else
for (s = 0; s < n.length; s++) {
if (l = (a = n[s]).instance,
c = a.currentTarget,
a = a.listener,
l !== o && i.isPropagationStopped())
break e;
nf(i, a, c),
o = l
}
}
}
if (Qb)
throw e = Rb,
Qb = !1,
Rb = null,
e
}
function D$2(e, t) {
var r = t[of];
void 0 === r && (r = t[of] = new Set);
var n = e + "__bubble";
r.has(n) || (pf(t, e, 2, !1),
r.add(n))
}
function qf(e, t, r) {
var n = 0;
t && (n |= 4),
pf(r, e, n, t)
}
var rf = "_reactListening" + Math.random().toString(36).slice(2);
function sf(e) {
if (!e[rf]) {
e[rf] = !0,
da$1.forEach((function(t) {
"selectionchange" !== t && (mf.has(t) || qf(t, !1, e),
qf(t, !0, e))
}
));
var t = 9 === e.nodeType ? e : e.ownerDocument;
null === t || t[rf] || (t[rf] = !0,
qf("selectionchange", !1, t))
}
}
function pf(e, t, r, n) {
switch (jd(t)) {
case 1:
var i = ed;
break;
case 4:
i = gd;
break;
default:
i = fd$1
}
r = i.bind(null, t, r, e),
i = void 0,
!Lb || "touchstart" !== t && "touchmove" !== t && "wheel" !== t || (i =
!0),
n ? void 0 !== i ? e.addEventListener(t, r, {
capture: !0,
passive: i
}) : e.addEventListener(t, r, !0) : void 0 !== i ?
e.addEventListener(t, r, {
passive: i
}) : e.addEventListener(t, r, !1)
}
function hd(e, t, r, n, i) {
var o = n;
if (!(1 & t || 2 & t || null === n))
e: for (; ; ) {
if (null === n)
return;
var s = n.tag;
if (3 === s || 4 === s) {
var a = n.stateNode.containerInfo;
if (a === i || 8 === a.nodeType && a.parentNode === i)
break;
if (4 === s)
for (s = n.return; null !== s; ) {
var l = s.tag;
if ((3 === l || 4 === l) && ((l =
s.stateNode.containerInfo) === i || 8 === l.nodeType && l.parentNode === i))
return;
s = s.return
}
for (; null !== a; ) {
if (null === (s = Wc(a)))
return;
if (5 === (l = s.tag) || 6 === l) {
n = o = s;
continue e
}
a = a.parentNode
}
}
n = n.return
}
Jb((function() {
var n = o
, i = xb(r)
, s = [];
e: {
var a = df.get(e);
if (void 0 !== a) {
var l = td$1
, c = e;
switch (e) {
case "keypress":
if (0 === od(r))
break e;
case "keydown":
case "keyup":
l = Rd;
break;
case "focusin":
c = "focus",
l = Fd;
break;
case "focusout":
c = "blur",
l = Fd;
break;
case "beforeblur":
case "afterblur":
l = Fd;
break;
case "click":
if (2 === r.button)
break e;
case "auxclick":
case "dblclick":
case "mousedown":
case "mousemove":
case "mouseup":
case "mouseout":
case "mouseover":
case "contextmenu":
l = Bd;
break;
case "drag":
case "dragend":
case "dragenter":
case "dragexit":
case "dragleave":
case "dragover":
case "dragstart":
case "drop":
l = Dd;
break;
case "touchcancel":
case "touchend":
case "touchmove":
case "touchstart":
l = Vd;
break;
case $e$1:
case af:
case bf:
l = Hd;
break;
case cf:
l = Xd;
break;
case "scroll":
l = vd;
break;
case "wheel":
l = Zd;
break;
case "copy":
case "cut":
case "paste":
l = Jd;
break;
case "gotpointercapture":
case "lostpointercapture":
case "pointercancel":
case "pointerdown":
case "pointermove":
case "pointerout":
case "pointerover":
case "pointerup":
l = Td
}
var u = !!(4 & t)
, d = !u && "scroll" === e
, p = u ? null !== a ? a + "Capture" : null : a;
u = [];
for (var h, f = n; null !== f; ) {
var m = (h = f).stateNode;
if (5 === h.tag && null !== m && (h = m,
null !== p && (null != (m = Kb(f, p)) && u.push(tf(f,
m, h)))),
d)
break;
f = f.return
}
0 < u.length && (a = new l(a,c,null,r,i),
s.push({
event: a,
listeners: u
}))
}
}
if (!(7 & t)) {
if (l = "mouseout" === e || "pointerout" === e,
(!(a = "mouseover" === e || "pointerover" === e) || r === wb ||
!(c = r.relatedTarget || r.fromElement) || !Wc(c) && !c[uf]) && (l || a) && (a =
i.window === i ? i : (a = i.ownerDocument) ? a.defaultView || a.parentWindow :
window,
l ? (l = n,
null !== (c = (c = r.relatedTarget || r.toElement) ? Wc(c) :
null) && (c !== (d = Vb(c)) || 5 !== c.tag && 6 !== c.tag) && (c = null)) : (l =
null,
c = n),
l !== c)) {
if (u = Bd,
m = "onMouseLeave",
p = "onMouseEnter",
f = "mouse",
"pointerout" !== e && "pointerover" !== e || (u = Td,
m = "onPointerLeave",
p = "onPointerEnter",
f = "pointer"),
d = null == l ? a : ue$2(l),
h = null == c ? a : ue$2(c),
(a = new u(m,f + "leave",l,r,i)).target = d,
a.relatedTarget = h,
m = null,
Wc(i) === n && ((u = new u(p,f + "enter",c,r,i)).target =
h,
u.relatedTarget = d,
m = u),
d = m,
l && c)
e: {
for (p = c,
f = 0,
h = u = l; h; h = vf(h))
f++;
for (h = 0,
m = p; m; m = vf(m))
h++;
for (; 0 < f - h; )
u = vf(u),
f--;
for (; 0 < h - f; )
p = vf(p),
h--;
for (; f--; ) {
if (u === p || null !== p && u === p.alternate)
break e;
u = vf(u),
p = vf(p)
}
u = null
}
else
u = null;
null !== l && wf(s, a, l, u, !1),
null !== c && null !== d && wf(s, d, c, u, !0)
}
if ("select" === (l = (a = n ? ue$2(n) : window).nodeName &&
a.nodeName.toLowerCase()) || "input" === l && "file" === a.type)
var g = ve$2;
else if (me$2(a))
if (we$1)
g = Fe$1;
else {
g = De$1;
var y = Ce$2
}
else
(l = a.nodeName) && "input" === l.toLowerCase() &&
("checkbox" === a.type || "radio" === a.type) && (g = Ee$1);
switch (g && (g = g(e, n)) ? ne$2(s, g, r, i) : (y && y(e, a,
n),
"focusout" === e && (y = a._wrapperState) && y.controlled &&
"number" === a.type && cb(a, "number", a.value)),
y = n ? ue$2(n) : window,
e) {
case "focusin":
(me$2(y) || "true" === y.contentEditable) && (Qe$1 = y,
Re$1 = n,
Se$1 = null);
break;
case "focusout":
Se$1 = Re$1 = Qe$1 = null;
break;
case "mousedown":
Te$1 = !0;
break;
case "contextmenu":
case "mouseup":
case "dragend":
Te$1 = !1,
Ue$1(s, r, i);
break;
case "selectionchange":
if (Pe$1)
break;
case "keydown":
case "keyup":
Ue$1(s, r, i)
}
var v;
if (ae$2)
e: {
switch (e) {
case "compositionstart":
var b = "onCompositionStart";
break e;
case "compositionend":
b = "onCompositionEnd";
break e;
case "compositionupdate":
b = "onCompositionUpdate";
break e
}
b = void 0
}
else
ie$2 ? ge$2(e, r) && (b = "onCompositionEnd") : "keydown"
=== e && 229 === r.keyCode && (b = "onCompositionStart");
b && (de$2 && "ko" !== r.locale && (ie$2 ||
"onCompositionStart" !== b ? "onCompositionEnd" === b && ie$2 && (v = nd()) : (ld =
"value"in (kd = i) ? kd.value : kd.textContent,
ie$2 = !0)),
0 < (y = oe$2(n, b)).length && (b = new Ld(b,e,null,r,i),
s.push({
event: b,
listeners: y
}),
v ? b.data = v : null !== (v = he$2(r)) && (b.data = v))),
(v = ce$2 ? je$1(e, r) : ke$1(e, r)) && (0 < (n = oe$2(n,
"onBeforeInput")).length && (i = new Ld("onBeforeInput","beforeinput",null,r,i),
s.push({
event: i,
listeners: n
}),
i.data = v))
}
se$2(s, t)
}
))
}
function tf(e, t, r) {
return {
instance: e,
listener: t,
currentTarget: r
}
}
function oe$2(e, t) {
for (var r = t + "Capture", n = []; null !== e; ) {
var i = e
, o = i.stateNode;
5 === i.tag && null !== o && (i = o,
null != (o = Kb(e, r)) && n.unshift(tf(e, o, i)),
null != (o = Kb(e, t)) && n.push(tf(e, o, i))),
e = e.return
}
return n
}
function vf(e) {
if (null === e)
return null;
do {
e = e.return
} while (e && 5 !== e.tag);
return e || null
}
function wf(e, t, r, n, i) {
for (var o = t._reactName, s = []; null !== r && r !== n; ) {
var a = r
, l = a.alternate
, c = a.stateNode;
if (null !== l && l === n)
break;
5 === a.tag && null !== c && (a = c,
i ? null != (l = Kb(r, o)) && s.unshift(tf(r, l, a)) : i || null !=
(l = Kb(r, o)) && s.push(tf(r, l, a))),
r = r.return
}
0 !== s.length && e.push({
event: t,
listeners: s
})
}
var xf = /\r\n?/g
, yf = /\u0000|\uFFFD/g;
function zf(e) {
return ("string" == typeof e ? e : "" + e).replace(xf, "\
n").replace(yf, "")
}
function Af(e, t, r) {
if (t = zf(t),
zf(e) !== t && r)
throw Error(p$6(425))
}
function Bf() {}
var Cf = null
, Df = null;
function Ef(e, t) {
return "textarea" === e || "noscript" === e || "string" == typeof
t.children || "number" == typeof t.children || "object" == typeof
t.dangerouslySetInnerHTML && null !== t.dangerouslySetInnerHTML && null !=
t.dangerouslySetInnerHTML.__html
}
var Ff = "function" == typeof setTimeout ? setTimeout : void 0
, Gf = "function" == typeof clearTimeout ? clearTimeout : void 0
, Hf = "function" == typeof Promise ? Promise : void 0
, Jf = "function" == typeof queueMicrotask ? queueMicrotask : void 0 !==
Hf ? function(e) {
return Hf.resolve(null).then(e).catch(If)
}
: Ff;
function If(e) {
setTimeout((function() {
throw e
}
))
}
function Kf(e, t) {
var r = t
, n = 0;
do {
var i = r.nextSibling;
if (e.removeChild(r),
i && 8 === i.nodeType)
if ("/$" === (r = i.data)) {
if (0 === n)
return e.removeChild(i),
void bd(t);
n--
} else
"$" !== r && "$?" !== r && "$!" !== r || n++;
r = i
} while (r);
bd(t)
}
function Lf(e) {
for (; null != e; e = e.nextSibling) {
var t = e.nodeType;
if (1 === t || 3 === t)
break;
if (8 === t) {
if ("$" === (t = e.data) || "$!" === t || "$?" === t)
break;
if ("/$" === t)
return null
}
}
return e
}
function Mf(e) {
e = e.previousSibling;
for (var t = 0; e; ) {
if (8 === e.nodeType) {
var r = e.data;
if ("$" === r || "$!" === r || "$?" === r) {
if (0 === t)
return e;
t--
} else
"/$" === r && t++
}
e = e.previousSibling
}
return null
}
var Nf = Math.random().toString(36).slice(2)
, Of = "__reactFiber$" + Nf
, Pf = "__reactProps$" + Nf
, uf = "__reactContainer$" + Nf
, of = "__reactEvents$" + Nf
, Qf = "__reactListeners$" + Nf
, Rf = "__reactHandles$" + Nf;
function Wc(e) {
var t = e[Of];
if (t)
return t;
for (var r = e.parentNode; r; ) {
if (t = r[uf] || r[Of]) {
if (r = t.alternate,
null !== t.child || null !== r && null !== r.child)
for (e = Mf(e); null !== e; ) {
if (r = e[Of])
return r;
e = Mf(e)
}
return t
}
r = (e = r).parentNode
}
return null
}
function Cb(e) {
return !(e = e[Of] || e[uf]) || 5 !== e.tag && 6 !== e.tag && 13 !==
e.tag && 3 !== e.tag ? null : e
}
function ue$2(e) {
if (5 === e.tag || 6 === e.tag)
return e.stateNode;
throw Error(p$6(33))
}
function Db(e) {
return e[Pf] || null
}
var Sf = []
, Tf = -1;
function Uf(e) {
return {
current: e
}
}
function E$1(e) {
0 > Tf || (e.current = Sf[Tf],
Sf[Tf] = null,
Tf--)
}
function G$2(e, t) {
Tf++,
Sf[Tf] = e.current,
e.current = t
}
var Vf = {}
, H$2 = Uf(Vf)
, Wf = Uf(!1)
, Xf = Vf;
function Yf(e, t) {
var r = e.type.contextTypes;
if (!r)
return Vf;
var n = e.stateNode;
if (n && n.__reactInternalMemoizedUnmaskedChildContext === t)
return n.__reactInternalMemoizedMaskedChildContext;
var i, o = {};
for (i in r)
o[i] = t[i];
return n && ((e =
e.stateNode).__reactInternalMemoizedUnmaskedChildContext = t,
e.__reactInternalMemoizedMaskedChildContext = o),
o
}
function Zf(e) {
return null != (e = e.childContextTypes)
}
function $f() {
E$1(Wf),
E$1(H$2)
}
function ag(e, t, r) {
if (H$2.current !== Vf)
throw Error(p$6(168));
G$2(H$2, t),
G$2(Wf, r)
}
function bg$1(e, t, r) {
var n = e.stateNode;
if (t = t.childContextTypes,
"function" != typeof n.getChildContext)
return r;
for (var i in n = n.getChildContext())
if (!(i in t))
throw Error(p$6(108, Ra(e) || "Unknown", i));
return A$3({}, r, n)
}
function cg(e) {
return e = (e = e.stateNode) &&
e.__reactInternalMemoizedMergedChildContext || Vf,
Xf = H$2.current,
G$2(H$2, e),
G$2(Wf, Wf.current),
!0
}
function dg(e, t, r) {
var n = e.stateNode;
if (!n)
throw Error(p$6(169));
r ? (e = bg$1(e, t, Xf),
n.__reactInternalMemoizedMergedChildContext = e,
E$1(Wf),
E$1(H$2),
G$2(H$2, e)) : E$1(Wf),
G$2(Wf, r)
}
var eg = null
, fg = !1
, gg = !1;
function hg(e) {
null === eg ? eg = [e] : eg.push(e)
}
function ig(e) {
fg = !0,
hg(e)
}
function jg() {
if (!gg && null !== eg) {
gg = !0;
var e = 0
, t = C$2;
try {
var r = eg;
for (C$2 = 1; e < r.length; e++) {
var n = r[e];
do {
n = n(!0)
} while (null !== n)
}
eg = null,
fg = !1
} catch (e2) {
throw null !== eg && (eg = eg.slice(e + 1)),
ac(fc, jg),
e2
} finally {
C$2 = t,
gg = !1
}
}
return null
}
var kg = []
, lg = 0
, mg = null
, ng = 0
, og = []
, pg = 0
, qg = null
, rg = 1
, sg = "";
function tg(e, t) {
kg[lg++] = ng,
kg[lg++] = mg,
mg = e,
ng = t
}
function ug(e, t, r) {
og[pg++] = rg,
og[pg++] = sg,
og[pg++] = qg,
qg = e;
var n = rg;
e = sg;
var i = 32 - oc(n) - 1;
n &= ~(1 << i),
r += 1;
var o = 32 - oc(t) + i;
if (30 < o) {
var s = i - i % 5;
o = (n & (1 << s) - 1).toString(32),
n >>= s,
i -= s,
rg = 1 << 32 - oc(t) + i | r << i | n,
sg = o + e
} else
rg = 1 << o | r << i | n,
sg = e
}
function vg(e) {
null !== e.return && (tg(e, 1),
ug(e, 1, 0))
}
function wg(e) {
for (; e === mg; )
mg = kg[--lg],
kg[lg] = null,
ng = kg[--lg],
kg[lg] = null;
for (; e === qg; )
qg = og[--pg],
og[pg] = null,
sg = og[--pg],
og[pg] = null,
rg = og[--pg],
og[pg] = null
}
var xg = null
, yg = null
, I$1 = !1
, zg = null;
function Ag(e, t) {
var r = Bg(5, null, null, 0);
r.elementType = "DELETED",
r.stateNode = t,
r.return = e,
null === (t = e.deletions) ? (e.deletions = [r],
e.flags |= 16) : t.push(r)
}
function Cg(e, t) {
switch (e.tag) {
case 5:
var r = e.type;
return null !== (t = 1 !== t.nodeType || r.toLowerCase() !==
t.nodeName.toLowerCase() ? null : t) && (e.stateNode = t,
xg = e,
yg = Lf(t.firstChild),
!0);
case 6:
return null !== (t = "" === e.pendingProps || 3 !== t.nodeType ?
null : t) && (e.stateNode = t,
xg = e,
yg = null,
!0);
case 13:
return null !== (t = 8 !== t.nodeType ? null : t) && (r = null !==
qg ? {
id: rg,
overflow: sg
} : null,
e.memoizedState = {
dehydrated: t,
treeContext: r,
retryLane: 1073741824
},
(r = Bg(18, null, null, 0)).stateNode = t,
r.return = e,
e.child = r,
xg = e,
yg = null,
!0);
default:
return !1
}
}
function Dg(e) {
return !(!(1 & e.mode) || 128 & e.flags)
}
function Eg(e) {
if (I$1) {
var t = yg;
if (t) {
var r = t;
if (!Cg(e, t)) {
if (Dg(e))
throw Error(p$6(418));
t = Lf(r.nextSibling);
var n = xg;
t && Cg(e, t) ? Ag(n, r) : (e.flags = -4097 & e.flags | 2,
I$1 = !1,
xg = e)
}
} else {
if (Dg(e))
throw Error(p$6(418));
e.flags = -4097 & e.flags | 2,
I$1 = !1,
xg = e
}
}
}
function Fg(e) {
for (e = e.return; null !== e && 5 !== e.tag && 3 !== e.tag && 13 !==
e.tag; )
e = e.return;
xg = e
}
function Gg(e) {
if (e !== xg)
return !1;
if (!I$1)
return Fg(e),
I$1 = !0,
!1;
var t;
if ((t = 3 !== e.tag) && !(t = 5 !== e.tag) && (t = "head" !== (t =
e.type) && "body" !== t && !Ef(e.type, e.memoizedProps)),
t && (t = yg)) {
if (Dg(e))
throw Hg(),
Error(p$6(418));
for (; t; )
Ag(e, t),
t = Lf(t.nextSibling)
}
if (Fg(e),
13 === e.tag) {
if (!(e = null !== (e = e.memoizedState) ? e.dehydrated : null))
throw Error(p$6(317));
e: {
for (e = e.nextSibling,
t = 0; e; ) {
if (8 === e.nodeType) {
var r = e.data;
if ("/$" === r) {
if (0 === t) {
yg = Lf(e.nextSibling);
break e
}
t--
} else
"$" !== r && "$!" !== r && "$?" !== r || t++
}
e = e.nextSibling
}
yg = null
}
} else
yg = xg ? Lf(e.stateNode.nextSibling) : null;
return !0
}
function Hg() {
for (var e = yg; e; )
e = Lf(e.nextSibling)
}
function Ig() {
yg = xg = null,
I$1 = !1
}
function Jg(e) {
null === zg ? zg = [e] : zg.push(e)
}
var Kg = ua.ReactCurrentBatchConfig;
function Lg(e, t, r) {
if (null !== (e = r.ref) && "function" != typeof e && "object" !=
typeof e) {
if (r._owner) {
if (r = r._owner) {
if (1 !== r.tag)
throw Error(p$6(309));
var n = r.stateNode
}
if (!n)
throw Error(p$6(147, e));
var i = n
, o = "" + e;
return null !== t && null !== t.ref && "function" == typeof
t.ref && t.ref._stringRef === o ? t.ref : ((t = function(e) {
var t = i.refs;
null === e ? delete t[o] : t[o] = e
}
)._stringRef = o,
t)
}
if ("string" != typeof e)
throw Error(p$6(284));
if (!r._owner)
throw Error(p$6(290, e))
}
return e
}
function Mg(e, t) {
throw e = Object.prototype.toString.call(t),
Error(p$6(31, "[object Object]" === e ? "object with keys {" +
Object.keys(t).join(", ") + "}" : e))
}
function Ng(e) {
return (0,
e._init)(e._payload)
}
function Og(e) {
function t(t, r) {
if (e) {
var n = t.deletions;
null === n ? (t.deletions = [r],
t.flags |= 16) : n.push(r)
}
}
function r(r, n) {
if (!e)
return null;
for (; null !== n; )
t(r, n),
n = n.sibling;
return null
}
function n(e, t) {
for (e = new Map; null !== t; )
null !== t.key ? e.set(t.key, t) : e.set(t.index, t),
t = t.sibling;
return e
}
function i(e, t) {
return (e = Pg(e, t)).index = 0,
e.sibling = null,
e
}
function o(t, r, n) {
return t.index = n,
e ? null !== (n = t.alternate) ? (n = n.index) < r ? (t.flags |= 2,
r) : n : (t.flags |= 2,
r) : (t.flags |= 1048576,
r)
}
function s(t) {
return e && null === t.alternate && (t.flags |= 2),
t
}
function a(e, t, r, n) {
return null === t || 6 !== t.tag ? ((t = Qg(r, e.mode, n)).return =
e,
t) : ((t = i(t, r)).return = e,
t)
}
function l(e, t, r, n) {
var o = r.type;
return o === ya$1 ? u(e, t, r.props.children, n, r.key) : null !==
t && (t.elementType === o || "object" == typeof o && null !== o && o.$$typeof ===
Ha$1 && Ng(o) === t.type) ? ((n = i(t, r.props)).ref = Lg(e, t, r),
n.return = e,
n) : ((n = Rg(r.type, r.key, r.props, null, e.mode, n)).ref = Lg(e,
t, r),
n.return = e,
n)
}
function c(e, t, r, n) {
return null === t || 4 !== t.tag || t.stateNode.containerInfo !==
r.containerInfo || t.stateNode.implementation !== r.implementation ? ((t = Sg(r,
e.mode, n)).return = e,
t) : ((t = i(t, r.children || [])).return = e,
t)
}
function u(e, t, r, n, o) {
return null === t || 7 !== t.tag ? ((t = Tg(r, e.mode, n,
o)).return = e,
t) : ((t = i(t, r)).return = e,
t)
}
function d(e, t, r) {
if ("string" == typeof t && "" !== t || "number" == typeof t)
return (t = Qg("" + t, e.mode, r)).return = e,
t;
if ("object" == typeof t && null !== t) {
switch (t.$$typeof) {
case va$1:
return (r = Rg(t.type, t.key, t.props, null, e.mode,
r)).ref = Lg(e, null, t),
r.return = e,
r;
case wa$1:
return (t = Sg(t, e.mode, r)).return = e,
t;
case Ha$1:
return d(e, (0,
t._init)(t._payload), r)
}
if (eb(t) || Ka$1(t))
return (t = Tg(t, e.mode, r, null)).return = e,
t;
Mg(e, t)
}
return null
}
function p(e, t, r, n) {
var i = null !== t ? t.key : null;
if ("string" == typeof r && "" !== r || "number" == typeof r)
return null !== i ? null : a(e, t, "" + r, n);
if ("object" == typeof r && null !== r) {
switch (r.$$typeof) {
case va$1:
return r.key === i ? l(e, t, r, n) : null;
case wa$1:
return r.key === i ? c(e, t, r, n) : null;
case Ha$1:
return p(e, t, (i = r._init)(r._payload), n)
}
if (eb(r) || Ka$1(r))
return null !== i ? null : u(e, t, r, n, null);
Mg(e, r)
}
return null
}
function h(e, t, r, n, i) {
if ("string" == typeof n && "" !== n || "number" == typeof n)
return a(t, e = e.get(r) || null, "" + n, i);
if ("object" == typeof n && null !== n) {
switch (n.$$typeof) {
case va$1:
return l(t, e = e.get(null === n.key ? r : n.key) || null,
n, i);
case wa$1:
return c(t, e = e.get(null === n.key ? r : n.key) || null,
n, i);
case Ha$1:
return h(e, t, r, (0,
n._init)(n._payload), i)
}
if (eb(n) || Ka$1(n))
return u(t, e = e.get(r) || null, n, i, null);
Mg(t, n)
}
return null
}
return function a(l, c, u, f) {
if ("object" == typeof u && null !== u && u.type === ya$1 && null
=== u.key && (u = u.props.children),
"object" == typeof u && null !== u) {
switch (u.$$typeof) {
case va$1:
e: {
for (var m = u.key, g = c; null !== g; ) {
if (g.key === m) {
if ((m = u.type) === ya$1) {
if (7 === g.tag) {
r(l, g.sibling),
(c = i(g, u.props.children)).return =
l,
l = c;
break e
}
} else if (g.elementType === m || "object" ==
typeof m && null !== m && m.$$typeof === Ha$1 && Ng(m) === g.type) {
r(l, g.sibling),
(c = i(g, u.props)).ref = Lg(l, g, u),
c.return = l,
l = c;
break e
}
r(l, g);
break
}
t(l, g),
g = g.sibling
}
u.type === ya$1 ? ((c = Tg(u.props.children, l.mode, f,
u.key)).return = l,
l = c) : ((f = Rg(u.type, u.key, u.props, null, l.mode,
f)).ref = Lg(l, c, u),
f.return = l,
l = f)
}
return s(l);
case wa$1:
e: {
for (g = u.key; null !== c; ) {
if (c.key === g) {
if (4 === c.tag && c.stateNode.containerInfo
=== u.containerInfo && c.stateNode.implementation === u.implementation) {
r(l, c.sibling),
(c = i(c, u.children || [])).return = l,
l = c;
break e
}
r(l, c);
break
}
t(l, c),
c = c.sibling
}
(c = Sg(u, l.mode, f)).return = l,
l = c
}
return s(l);
case Ha$1:
return a(l, c, (g = u._init)(u._payload), f)
}
if (eb(u))
return function(i, s, a, l) {
for (var c = null, u = null, f = s, m = s = 0, g =
null; null !== f && m < a.length; m++) {
f.index > m ? (g = f,
f = null) : g = f.sibling;
var y = p(i, f, a[m], l);
if (null === y) {
null === f && (f = g);
break
}
e && f && null === y.alternate && t(i, f),
s = o(y, s, m),
null === u ? c = y : u.sibling = y,
u = y,
f = g
}
if (m === a.length)
return r(i, f),
I$1 && tg(i, m),
c;
if (null === f) {
for (; m < a.length; m++)
null !== (f = d(i, a[m], l)) && (s = o(f, s,
m),
null === u ? c = f : u.sibling = f,
u = f);
return I$1 && tg(i, m),
c
}
for (f = n(i, f); m < a.length; m++)
null !== (g = h(f, i, m, a[m], l)) && (e && null !
== g.alternate && f.delete(null === g.key ? m : g.key),
s = o(g, s, m),
null === u ? c = g : u.sibling = g,
u = g);
return e && f.forEach((function(e) {
return t(i, e)
}
)),
I$1 && tg(i, m),
c
}(l, c, u, f);
if (Ka$1(u))
return function(i, s, a, l) {
var c = Ka$1(a);
if ("function" != typeof c)
throw Error(p$6(150));
if (null == (a = c.call(a)))
throw Error(p$6(151));
for (var u = c = null, f = s, m = s = 0, g = null, y =
a.next(); null !== f && !y.done; m++,
y = a.next()) {
f.index > m ? (g = f,
f = null) : g = f.sibling;
var v = p(i, f, y.value, l);
if (null === v) {
null === f && (f = g);
break
}
e && f && null === v.alternate && t(i, f),
s = o(v, s, m),
null === u ? c = v : u.sibling = v,
u = v,
f = g
}
if (y.done)
return r(i, f),
I$1 && tg(i, m),
c;
if (null === f) {
for (; !y.done; m++,
y = a.next())
null !== (y = d(i, y.value, l)) && (s = o(y, s,
m),
null === u ? c = y : u.sibling = y,
u = y);
return I$1 && tg(i, m),
c
}
for (f = n(i, f); !y.done; m++,
y = a.next())
null !== (y = h(f, i, m, y.value, l)) && (e && null
!== y.alternate && f.delete(null === y.key ? m : y.key),
s = o(y, s, m),
null === u ? c = y : u.sibling = y,
u = y);
return e && f.forEach((function(e) {
return t(i, e)
}
)),
I$1 && tg(i, m),
c
}(l, c, u, f);
Mg(l, u)
}
return "string" == typeof u && "" !== u || "number" == typeof u ?
(u = "" + u,
null !== c && 6 === c.tag ? (r(l, c.sibling),
(c = i(c, u)).return = l,
l = c) : (r(l, c),
(c = Qg(u, l.mode, f)).return = l,
l = c),
s(l)) : r(l, c)
}
}
var Ug = Og(!0)
, Vg = Og(!1)
, Wg = Uf(null)
, Xg = null
, Yg = null
, Zg = null;
function $g() {
Zg = Yg = Xg = null
}
function ah$1(e) {
var t = Wg.current;
E$1(Wg),
e._currentValue = t
}
function bh$1(e, t, r) {
for (; null !== e; ) {
var n = e.alternate;
if ((e.childLanes & t) !== t ? (e.childLanes |= t,
null !== n && (n.childLanes |= t)) : null !== n && (n.childLanes &
t) !== t && (n.childLanes |= t),
e === r)
break;
e = e.return
}
}
function ch$2(e, t) {
Xg = e,
Zg = Yg = null,
null !== (e = e.dependencies) && null !== e.firstContext && (!!(e.lanes
& t) && (dh$1 = !0),
e.firstContext = null)
}
function eh$1(e) {
var t = e._currentValue;
if (Zg !== e)
if (e = {
context: e,
memoizedValue: t,
next: null
},
null === Yg) {
if (null === Xg)
throw Error(p$6(308));
Yg = e,
Xg.dependencies = {
lanes: 0,
firstContext: e
}
} else
Yg = Yg.next = e;
return t
}
var fh$1 = null;
function gh$1(e) {
null === fh$1 ? fh$1 = [e] : fh$1.push(e)
}
function hh$1(e, t, r, n) {
var i = t.interleaved;
return null === i ? (r.next = r,
gh$1(t)) : (r.next = i.next,
i.next = r),
t.interleaved = r,
ih$1(e, n)
}
function ih$1(e, t) {
e.lanes |= t;
var r = e.alternate;
for (null !== r && (r.lanes |= t),
r = e,
e = e.return; null !== e; )
e.childLanes |= t,
null !== (r = e.alternate) && (r.childLanes |= t),
r = e,
e = e.return;
return 3 === r.tag ? r.stateNode : null
}
var jh$1 = !1;
function kh$1(e) {
e.updateQueue = {
baseState: e.memoizedState,
firstBaseUpdate: null,
lastBaseUpdate: null,
shared: {
pending: null,
interleaved: null,
lanes: 0
},
effects: null
}
}
function lh$1(e, t) {
e = e.updateQueue,
t.updateQueue === e && (t.updateQueue = {
baseState: e.baseState,
firstBaseUpdate: e.firstBaseUpdate,
lastBaseUpdate: e.lastBaseUpdate,
shared: e.shared,
effects: e.effects
})
}
function mh$1(e, t) {
return {
eventTime: e,
lane: t,
tag: 0,
payload: null,
callback: null,
next: null
}
}
function nh$1(e, t, r) {
var n = e.updateQueue;
if (null === n)
return null;
if (n = n.shared,
2 & K$1) {
var i = n.pending;
return null === i ? t.next = t : (t.next = i.next,
i.next = t),
n.pending = t,
ih$1(e, r)
}
return null === (i = n.interleaved) ? (t.next = t,
gh$1(n)) : (t.next = i.next,
i.next = t),
n.interleaved = t,
ih$1(e, r)
}
function oh$1(e, t, r) {
if (null !== (t = t.updateQueue) && (t = t.shared,
4194240 & r)) {
var n = t.lanes;
r |= n &= e.pendingLanes,
t.lanes = r,
Cc(e, r)
}
}
function ph$1(e, t) {
var r = e.updateQueue
, n = e.alternate;
if (null !== n && r === (n = n.updateQueue)) {
var i = null
, o = null;
if (null !== (r = r.firstBaseUpdate)) {
do {
var s = {
eventTime: r.eventTime,
lane: r.lane,
tag: r.tag,
payload: r.payload,
callback: r.callback,
next: null
};
null === o ? i = o = s : o = o.next = s,
r = r.next
} while (null !== r);
null === o ? i = o = t : o = o.next = t
} else
i = o = t;
return r = {
baseState: n.baseState,
firstBaseUpdate: i,
lastBaseUpdate: o,
shared: n.shared,
effects: n.effects
},
void (e.updateQueue = r)
}
null === (e = r.lastBaseUpdate) ? r.firstBaseUpdate = t : e.next = t,
r.lastBaseUpdate = t
}
function qh(e, t, r, n) {
var i = e.updateQueue;
jh$1 = !1;
var o = i.firstBaseUpdate
, s = i.lastBaseUpdate
, a = i.shared.pending;
if (null !== a) {
i.shared.pending = null;
var l = a
, c = l.next;
l.next = null,
null === s ? o = c : s.next = c,
s = l;
var u = e.alternate;
null !== u && ((a = (u = u.updateQueue).lastBaseUpdate) !== s &&
(null === a ? u.firstBaseUpdate = c : a.next = c,
u.lastBaseUpdate = l))
}
if (null !== o) {
var d = i.baseState;
for (s = 0,
u = c = l = null,
a = o; ; ) {
var p = a.lane
, h = a.eventTime;
if ((n & p) === p) {
null !== u && (u = u.next = {
eventTime: h,
lane: 0,
tag: a.tag,
payload: a.payload,
callback: a.callback,
next: null
});
e: {
var f = e
, m = a;
switch (p = t,
h = r,
m.tag) {
case 1:
if ("function" == typeof (f = m.payload)) {
d = f.call(h, d, p);
break e
}
d = f;
break e;
case 3:
f.flags = -65537 & f.flags | 128;
case 0:
if (null == (p = "function" == typeof (f =
m.payload) ? f.call(h, d, p) : f))
break e;
d = A$3({}, d, p);
break e;
case 2:
jh$1 = !0
}
}
null !== a.callback && 0 !== a.lane && (e.flags |= 64,
null === (p = i.effects) ? i.effects = [a] : p.push(a))
} else
h = {
eventTime: h,
lane: p,
tag: a.tag,
payload: a.payload,
callback: a.callback,
next: null
},
null === u ? (c = u = h,
l = d) : u = u.next = h,
s |= p;
if (null === (a = a.next)) {
if (null === (a = i.shared.pending))
break;
a = (p = a).next,
p.next = null,
i.lastBaseUpdate = p,
i.shared.pending = null
}
}
if (null === u && (l = d),
i.baseState = l,
i.firstBaseUpdate = c,
i.lastBaseUpdate = u,
null !== (t = i.shared.interleaved)) {
i = t;
do {
s |= i.lane,
i = i.next
} while (i !== t)
} else
null === o && (i.shared.lanes = 0);
rh$1 |= s,
e.lanes = s,
e.memoizedState = d
}
}
function sh$1(e, t, r) {
if (e = t.effects,
t.effects = null,
null !== e)
for (t = 0; t < e.length; t++) {
var n = e[t]
, i = n.callback;
if (null !== i) {
if (n.callback = null,
n = r,
"function" != typeof i)
throw Error(p$6(191, i));
i.call(n)
}
}
}
var th$1 = {}
, uh$1 = Uf(th$1)
, vh$1 = Uf(th$1)
, wh$1 = Uf(th$1);
function xh$1(e) {
if (e === th$1)
throw Error(p$6(174));
return e
}
function yh$1(e, t) {
switch (G$2(wh$1, t),
G$2(vh$1, e),
G$2(uh$1, th$1),
e = t.nodeType) {
case 9:
case 11:
t = (t = t.documentElement) ? t.namespaceURI : lb(null, "");
break;
default:
t = lb(t = (e = 8 === e ? t.parentNode : t).namespaceURI || null, e
= e.tagName)
}
E$1(uh$1),
G$2(uh$1, t)
}
function zh$2() {
E$1(uh$1),
E$1(vh$1),
E$1(wh$1)
}
function Ah$1(e) {
xh$1(wh$1.current);
var t = xh$1(uh$1.current)
, r = lb(t, e.type);
t !== r && (G$2(vh$1, e),
G$2(uh$1, r))
}
function Bh$1(e) {
vh$1.current === e && (E$1(uh$1),
E$1(vh$1))
}
var L$2 = Uf(0);
function Ch$1(e) {
for (var t = e; null !== t; ) {
if (13 === t.tag) {
var r = t.memoizedState;
if (null !== r && (null === (r = r.dehydrated) || "$?" ===
r.data || "$!" === r.data))
return t
} else if (19 === t.tag && void 0 !== t.memoizedProps.revealOrder)
{
if (128 & t.flags)
return t
} else if (null !== t.child) {
t.child.return = t,
t = t.child;
continue
}
if (t === e)
break;
for (; null === t.sibling; ) {
if (null === t.return || t.return === e)
return null;
t = t.return
}
t.sibling.return = t.return,
t = t.sibling
}
return null
}
var Dh$1 = [];
function Eh$1() {
for (var e = 0; e < Dh$1.length; e++)
Dh$1[e]._workInProgressVersionPrimary = null;
Dh$1.length = 0
}
var Fh$1 = ua.ReactCurrentDispatcher
, Gh$1 = ua.ReactCurrentBatchConfig
, Hh$1 = 0
, M$3 = null
, N$3 = null
, O$2 = null
, Ih$1 = !1
, Jh = !1
, Kh$1 = 0
, Lh$1 = 0;
function P$4() {
throw Error(p$6(321))
}
function Mh$1(e, t) {
if (null === t)
return !1;
for (var r = 0; r < t.length && r < e.length; r++)
if (!He$1(e[r], t[r]))
return !1;
return !0
}
function Nh$1(e, t, r, n, i, o) {
if (Hh$1 = o,
M$3 = t,
t.memoizedState = null,
t.updateQueue = null,
t.lanes = 0,
Fh$1.current = null === e || null === e.memoizedState ? Oh$1 : Ph$1,
e = r(n, i),
Jh) {
o = 0;
do {
if (Jh = !1,
Kh$1 = 0,
25 <= o)
throw Error(p$6(301));
o += 1,
O$2 = N$3 = null,
t.updateQueue = null,
Fh$1.current = Qh,
e = r(n, i)
} while (Jh)
}
if (Fh$1.current = Rh$1,
t = null !== N$3 && null !== N$3.next,
Hh$1 = 0,
O$2 = N$3 = M$3 = null,
Ih$1 = !1,
t)
throw Error(p$6(300));
return e
}
function Sh$1() {
var e = 0 !== Kh$1;
return Kh$1 = 0,
e
}
function Th$1() {
var e = {
memoizedState: null,
baseState: null,
baseQueue: null,
queue: null,
next: null
};
return null === O$2 ? M$3.memoizedState = O$2 = e : O$2 = O$2.next = e,
O$2
}
function Uh$1() {
if (null === N$3) {
var e = M$3.alternate;
e = null !== e ? e.memoizedState : null
} else
e = N$3.next;
var t = null === O$2 ? M$3.memoizedState : O$2.next;
if (null !== t)
O$2 = t,
N$3 = e;
else {
if (null === e)
throw Error(p$6(310));
e = {
memoizedState: (N$3 = e).memoizedState,
baseState: N$3.baseState,
baseQueue: N$3.baseQueue,
queue: N$3.queue,
next: null
},
null === O$2 ? M$3.memoizedState = O$2 = e : O$2 = O$2.next = e
}
return O$2
}
function Vh$1(e, t) {
return "function" == typeof t ? t(e) : t
}
function Wh$1(e) {
var t = Uh$1()
, r = t.queue;
if (null === r)
throw Error(p$6(311));
r.lastRenderedReducer = e;
var n = N$3
, i = n.baseQueue
, o = r.pending;
if (null !== o) {
if (null !== i) {
var s = i.next;
i.next = o.next,
o.next = s
}
n.baseQueue = i = o,
r.pending = null
}
if (null !== i) {
o = i.next,
n = n.baseState;
var a = s = null
, l = null
, c = o;
do {
var u = c.lane;
if ((Hh$1 & u) === u)
null !== l && (l = l.next = {
lane: 0,
action: c.action,
hasEagerState: c.hasEagerState,
eagerState: c.eagerState,
next: null
}),
n = c.hasEagerState ? c.eagerState : e(n, c.action);
else {
var d = {
lane: u,
action: c.action,
hasEagerState: c.hasEagerState,
eagerState: c.eagerState,
next: null
};
null === l ? (a = l = d,
s = n) : l = l.next = d,
M$3.lanes |= u,
rh$1 |= u
}
c = c.next
} while (null !== c && c !== o);
null === l ? s = n : l.next = a,
He$1(n, t.memoizedState) || (dh$1 = !0),
t.memoizedState = n,
t.baseState = s,
t.baseQueue = l,
r.lastRenderedState = n
}
if (null !== (e = r.interleaved)) {
i = e;
do {
o = i.lane,
M$3.lanes |= o,
rh$1 |= o,
i = i.next
} while (i !== e)
} else
null === i && (r.lanes = 0);
return [t.memoizedState, r.dispatch]
}
function Xh$1(e) {
var t = Uh$1()
, r = t.queue;
if (null === r)
throw Error(p$6(311));
r.lastRenderedReducer = e;
var n = r.dispatch
, i = r.pending
, o = t.memoizedState;
if (null !== i) {
r.pending = null;
var s = i = i.next;
do {
o = e(o, s.action),
s = s.next
} while (s !== i);
He$1(o, t.memoizedState) || (dh$1 = !0),
t.memoizedState = o,
null === t.baseQueue && (t.baseState = o),
r.lastRenderedState = o
}
return [o, n]
}
function Yh$1() {}
function Zh(e, t) {
var r = M$3
, n = Uh$1()
, i = t()
, o = !He$1(n.memoizedState, i);
if (o && (n.memoizedState = i,
dh$1 = !0),
n = n.queue,
$h(ai$1.bind(null, r, n, e), [e]),
n.getSnapshot !== t || o || null !== O$2 && 1 & O$2.memoizedState.tag)
{
if (r.flags |= 2048,
bi$1(9, ci$1.bind(null, r, n, i, t), void 0, null),
null === Q$2)
throw Error(p$6(349));
30 & Hh$1 || di$1(r, t, i)
}
return i
}
function di$1(e, t, r) {
e.flags |= 16384,
e = {
getSnapshot: t,
value: r
},
null === (t = M$3.updateQueue) ? (t = {
lastEffect: null,
stores: null
},
M$3.updateQueue = t,
t.stores = [e]) : null === (r = t.stores) ? t.stores = [e] : r.push(e)
}
function ci$1(e, t, r, n) {
t.value = r,
t.getSnapshot = n,
ei$1(t) && fi$1(e)
}
function ai$1(e, t, r) {
return r((function() {
ei$1(t) && fi$1(e)
}
))
}
function ei$1(e) {
var t = e.getSnapshot;
e = e.value;
try {
var r = t();
return !He$1(e, r)
} catch (n) {
return !0
}
}
function fi$1(e) {
var t = ih$1(e, 1);
null !== t && gi$1(t, e, 1, -1)
}
function hi$1(e) {
var t = Th$1();
return "function" == typeof e && (e = e()),
t.memoizedState = t.baseState = e,
e = {
pending: null,
interleaved: null,
lanes: 0,
dispatch: null,
lastRenderedReducer: Vh$1,
lastRenderedState: e
},
t.queue = e,
e = e.dispatch = ii$1.bind(null, M$3, e),
[t.memoizedState, e]
}
function bi$1(e, t, r, n) {
return e = {
tag: e,
create: t,
destroy: r,
deps: n,
next: null
},
null === (t = M$3.updateQueue) ? (t = {
lastEffect: null,
stores: null
},
M$3.updateQueue = t,
t.lastEffect = e.next = e) : null === (r = t.lastEffect) ? t.lastEffect
= e.next = e : (n = r.next,
r.next = e,
e.next = n,
t.lastEffect = e),
e
}
function ji$1() {
return Uh$1().memoizedState
}
function ki$1(e, t, r, n) {
var i = Th$1();
M$3.flags |= e,
i.memoizedState = bi$1(1 | t, r, void 0, void 0 === n ? null : n)
}
function li$1(e, t, r, n) {
var i = Uh$1();
n = void 0 === n ? null : n;
var o = void 0;
if (null !== N$3) {
var s = N$3.memoizedState;
if (o = s.destroy,
null !== n && Mh$1(n, s.deps))
return void (i.memoizedState = bi$1(t, r, o, n))
}
M$3.flags |= e,
i.memoizedState = bi$1(1 | t, r, o, n)
}
function mi$1(e, t) {
return ki$1(8390656, 8, e, t)
}
function $h(e, t) {
return li$1(2048, 8, e, t)
}
function ni$1(e, t) {
return li$1(4, 2, e, t)
}
function oi$1(e, t) {
return li$1(4, 4, e, t)
}
function pi$1(e, t) {
return "function" == typeof t ? (e = e(),
t(e),
function() {
t(null)
}
) : null != t ? (e = e(),
t.current = e,
function() {
t.current = null
}
) : void 0
}
function qi$1(e, t, r) {
return r = null != r ? r.concat([e]) : null,
li$1(4, 4, pi$1.bind(null, t, e), r)
}
function ri$1() {}
function si$1(e, t) {
var r = Uh$1();
t = void 0 === t ? null : t;
var n = r.memoizedState;
return null !== n && null !== t && Mh$1(t, n[1]) ? n[0] :
(r.memoizedState = [e, t],
e)
}
function ti$1(e, t) {
var r = Uh$1();
t = void 0 === t ? null : t;
var n = r.memoizedState;
return null !== n && null !== t && Mh$1(t, n[1]) ? n[0] : (e = e(),
r.memoizedState = [e, t],
e)
}
function ui$1(e, t, r) {
return 21 & Hh$1 ? (He$1(r, t) || (r = yc(),
M$3.lanes |= r,
rh$1 |= r,
e.baseState = !0),
t) : (e.baseState && (e.baseState = !1,
dh$1 = !0),
e.memoizedState = r)
}
function vi$1(e, t) {
var r = C$2;
C$2 = 0 !== r && 4 > r ? r : 4,
e(!0);
var n = Gh$1.transition;
Gh$1.transition = {};
try {
e(!1),
t()
} finally {
C$2 = r,
Gh$1.transition = n
}
}
function wi$1() {
return Uh$1().memoizedState
}
function xi$1(e, t, r) {
var n = yi$1(e);
if (r = {
lane: n,
action: r,
hasEagerState: !1,
eagerState: null,
next: null
},
zi$1(e))
Ai$1(t, r);
else if (null !== (r = hh$1(e, t, r, n))) {
gi$1(r, e, n, R$1()),
Bi$1(r, t, n)
}
}
function ii$1(e, t, r) {
var n = yi$1(e)
, i = {
lane: n,
action: r,
hasEagerState: !1,
eagerState: null,
next: null
};
if (zi$1(e))
Ai$1(t, i);
else {
var o = e.alternate;
if (0 === e.lanes && (null === o || 0 === o.lanes) && null !== (o =
t.lastRenderedReducer))
try {
var s = t.lastRenderedState
, a = o(s, r);
if (i.hasEagerState = !0,
i.eagerState = a,
He$1(a, s)) {
var l = t.interleaved;
return null === l ? (i.next = i,
gh$1(t)) : (i.next = l.next,
l.next = i),
void (t.interleaved = i)
}
} catch (c) {}
null !== (r = hh$1(e, t, i, n)) && (gi$1(r, e, n, i = R$1()),
Bi$1(r, t, n))
}
}
function zi$1(e) {
var t = e.alternate;
return e === M$3 || null !== t && t === M$3
}
function Ai$1(e, t) {
Jh = Ih$1 = !0;
var r = e.pending;
null === r ? t.next = t : (t.next = r.next,
r.next = t),
e.pending = t
}
function Bi$1(e, t, r) {
if (4194240 & r) {
var n = t.lanes;
r |= n &= e.pendingLanes,
t.lanes = r,
Cc(e, r)
}
}
var Rh$1 = {
readContext: eh$1,
useCallback: P$4,
useContext: P$4,
useEffect: P$4,
useImperativeHandle: P$4,
useInsertionEffect: P$4,
useLayoutEffect: P$4,
useMemo: P$4,
useReducer: P$4,
useRef: P$4,
useState: P$4,
useDebugValue: P$4,
useDeferredValue: P$4,
useTransition: P$4,
useMutableSource: P$4,
useSyncExternalStore: P$4,
useId: P$4,
unstable_isNewReconciler: !1
}
, Oh$1 = {
readContext: eh$1,
useCallback: function(e, t) {
return Th$1().memoizedState = [e, void 0 === t ? null : t],
e
},
useContext: eh$1,
useEffect: mi$1,
useImperativeHandle: function(e, t, r) {
return r = null != r ? r.concat([e]) : null,
ki$1(4194308, 4, pi$1.bind(null, t, e), r)
},
useLayoutEffect: function(e, t) {
return ki$1(4194308, 4, e, t)
},
useInsertionEffect: function(e, t) {
return ki$1(4, 2, e, t)
},
useMemo: function(e, t) {
var r = Th$1();
return t = void 0 === t ? null : t,
e = e(),
r.memoizedState = [e, t],
e
},
useReducer: function(e, t, r) {
var n = Th$1();
return t = void 0 !== r ? r(t) : t,
n.memoizedState = n.baseState = t,
e = {
pending: null,
interleaved: null,
lanes: 0,
dispatch: null,
lastRenderedReducer: e,
lastRenderedState: t
},
n.queue = e,
e = e.dispatch = xi$1.bind(null, M$3, e),
[n.memoizedState, e]
},
useRef: function(e) {
return e = {
current: e
},
Th$1().memoizedState = e
},
useState: hi$1,
useDebugValue: ri$1,
useDeferredValue: function(e) {
return Th$1().memoizedState = e
},
useTransition: function() {
var e = hi$1(!1)
, t = e[0];
return e = vi$1.bind(null, e[1]),
Th$1().memoizedState = e,
[t, e]
},
useMutableSource: function() {},
useSyncExternalStore: function(e, t, r) {
var n = M$3
, i = Th$1();
if (I$1) {
if (void 0 === r)
throw Error(p$6(407));
r = r()
} else {
if (r = t(),
null === Q$2)
throw Error(p$6(349));
30 & Hh$1 || di$1(n, t, r)
}
i.memoizedState = r;
var o = {
value: r,
getSnapshot: t
};
return i.queue = o,
mi$1(ai$1.bind(null, n, o, e), [e]),
n.flags |= 2048,
bi$1(9, ci$1.bind(null, n, o, r, t), void 0, null),
r
},
useId: function() {
var e = Th$1()
, t = Q$2.identifierPrefix;
if (I$1) {
var r = sg;
t = ":" + t + "R" + (r = (rg & ~(1 << 32 - oc(rg) -
1)).toString(32) + r),
0 < (r = Kh$1++) && (t += "H" + r.toString(32)),
t += ":"
} else
t = ":" + t + "r" + (r = Lh$1++).toString(32) + ":";
return e.memoizedState = t
},
unstable_isNewReconciler: !1
}
, Ph$1 = {
readContext: eh$1,
useCallback: si$1,
useContext: eh$1,
useEffect: $h,
useImperativeHandle: qi$1,
useInsertionEffect: ni$1,
useLayoutEffect: oi$1,
useMemo: ti$1,
useReducer: Wh$1,
useRef: ji$1,
useState: function() {
return Wh$1(Vh$1)
},
useDebugValue: ri$1,
useDeferredValue: function(e) {
return ui$1(Uh$1(), N$3.memoizedState, e)
},
useTransition: function() {
return [Wh$1(Vh$1)[0], Uh$1().memoizedState]
},
useMutableSource: Yh$1,
useSyncExternalStore: Zh,
useId: wi$1,
unstable_isNewReconciler: !1
}
, Qh = {
readContext: eh$1,
useCallback: si$1,
useContext: eh$1,
useEffect: $h,
useImperativeHandle: qi$1,
useInsertionEffect: ni$1,
useLayoutEffect: oi$1,
useMemo: ti$1,
useReducer: Xh$1,
useRef: ji$1,
useState: function() {
return Xh$1(Vh$1)
},
useDebugValue: ri$1,
useDeferredValue: function(e) {
var t = Uh$1();
return null === N$3 ? t.memoizedState = e : ui$1(t,
N$3.memoizedState, e)
},
useTransition: function() {
return [Xh$1(Vh$1)[0], Uh$1().memoizedState]
},
useMutableSource: Yh$1,
useSyncExternalStore: Zh,
useId: wi$1,
unstable_isNewReconciler: !1
};
function Ci$1(e, t) {
if (e && e.defaultProps) {
for (var r in t = A$3({}, t),
e = e.defaultProps)
void 0 === t[r] && (t[r] = e[r]);
return t
}
return t
}
function Di$1(e, t, r, n) {
r = null == (r = r(n, t = e.memoizedState)) ? t : A$3({}, t, r),
e.memoizedState = r,
0 === e.lanes && (e.updateQueue.baseState = r)
}
var Ei$1 = {
isMounted: function(e) {
return !!(e = e._reactInternals) && Vb(e) === e
},
enqueueSetState: function(e, t, r) {
e = e._reactInternals;
var n = R$1()
, i = yi$1(e)
, o = mh$1(n, i);
o.payload = t,
null != r && (o.callback = r),
null !== (t = nh$1(e, o, i)) && (gi$1(t, e, i, n),
oh$1(t, e, i))
},
enqueueReplaceState: function(e, t, r) {
e = e._reactInternals;
var n = R$1()
, i = yi$1(e)
, o = mh$1(n, i);
o.tag = 1,
o.payload = t,
null != r && (o.callback = r),
null !== (t = nh$1(e, o, i)) && (gi$1(t, e, i, n),
oh$1(t, e, i))
},
enqueueForceUpdate: function(e, t) {
e = e._reactInternals;
var r = R$1()
, n = yi$1(e)
, i = mh$1(r, n);
i.tag = 2,
null != t && (i.callback = t),
null !== (t = nh$1(e, i, n)) && (gi$1(t, e, n, r),
oh$1(t, e, n))
}
};
function Fi$1(e, t, r, n, i, o, s) {
return "function" == typeof (e = e.stateNode).shouldComponentUpdate ?
e.shouldComponentUpdate(n, o, s) : !t.prototype || !
t.prototype.isPureReactComponent || (!Ie$1(r, n) || !Ie$1(i, o))
}
function Gi$1(e, t, r) {
var n = !1
, i = Vf
, o = t.contextType;
return "object" == typeof o && null !== o ? o = eh$1(o) : (i = Zf(t) ?
Xf : H$2.current,
o = (n = null != (n = t.contextTypes)) ? Yf(e, i) : Vf),
t = new t(r,o),
e.memoizedState = null !== t.state && void 0 !== t.state ? t.state :
null,
t.updater = Ei$1,
e.stateNode = t,
t._reactInternals = e,
n && ((e = e.stateNode).__reactInternalMemoizedUnmaskedChildContext =
i,
e.__reactInternalMemoizedMaskedChildContext = o),
t
}
function Hi$1(e, t, r, n) {
e = t.state,
"function" == typeof t.componentWillReceiveProps &&
t.componentWillReceiveProps(r, n),
"function" == typeof t.UNSAFE_componentWillReceiveProps &&
t.UNSAFE_componentWillReceiveProps(r, n),
t.state !== e && Ei$1.enqueueReplaceState(t, t.state, null)
}
function Ii$1(e, t, r, n) {
var i = e.stateNode;
i.props = r,
i.state = e.memoizedState,
i.refs = {},
kh$1(e);
var o = t.contextType;
"object" == typeof o && null !== o ? i.context = eh$1(o) : (o = Zf(t) ?
Xf : H$2.current,
i.context = Yf(e, o)),
i.state = e.memoizedState,
"function" == typeof (o = t.getDerivedStateFromProps) && (Di$1(e, t, o,
r),
i.state = e.memoizedState),
"function" == typeof t.getDerivedStateFromProps || "function" == typeof
i.getSnapshotBeforeUpdate || "function" != typeof i.UNSAFE_componentWillMount &&
"function" != typeof i.componentWillMount || (t = i.state,
"function" == typeof i.componentWillMount && i.componentWillMount(),
"function" == typeof i.UNSAFE_componentWillMount &&
i.UNSAFE_componentWillMount(),
t !== i.state && Ei$1.enqueueReplaceState(i, i.state, null),
qh(e, r, i, n),
i.state = e.memoizedState),
"function" == typeof i.componentDidMount && (e.flags |= 4194308)
}
function Ji$1(e, t) {
try {
var r = ""
, n = t;
do {
r += Pa$1(n),
n = n.return
} while (n);
var i = r
} catch (o) {
i = "\nError generating stack: " + o.message + "\n" + o.stack
}
return {
value: e,
source: t,
stack: i,
digest: null
}
}
function Ki$1(e, t, r) {
return {
value: e,
source: null,
stack: null != r ? r : null,
digest: null != t ? t : null
}
}
function Li$1(e, t) {}
var Mi$1 = "function" == typeof WeakMap ? WeakMap : Map;
function Ni$1(e, t, r) {
(r = mh$1(-1, r)).tag = 3,
r.payload = {
element: null
};
var n = t.value;
return r.callback = function() {
Oi$1 || (Oi$1 = !0,
Pi$1 = n),
Li$1(e, t)
}
,
r
}
function Qi$1(e, t, r) {
(r = mh$1(-1, r)).tag = 3;
var n = e.type.getDerivedStateFromError;
if ("function" == typeof n) {
var i = t.value;
r.payload = function() {
return n(i)
}
,
r.callback = function() {
Li$1(e, t)
}
}
var o = e.stateNode;
return null !== o && "function" == typeof o.componentDidCatch &&
(r.callback = function() {
Li$1(e, t),
"function" != typeof n && (null === Ri$1 ? Ri$1 = new Set([this]) :
Ri$1.add(this));
var r = t.stack;
this.componentDidCatch(t.value, {
componentStack: null !== r ? r : ""
})
}
),
r
}
function Si$1(e, t, r) {
var n = e.pingCache;
if (null === n) {
n = e.pingCache = new Mi$1;
var i = new Set;
n.set(t, i)
} else
void 0 === (i = n.get(t)) && (i = new Set,
n.set(t, i));
i.has(r) || (i.add(r),
e = Ti$1.bind(null, e, t, r),
t.then(e, e))
}
function Ui$1(e) {
do {
var t;
if ((t = 13 === e.tag) && (t = null === (t = e.memoizedState) ||
null !== t.dehydrated),
t)
return e;
e = e.return
} while (null !== e);
return null
}
function Vi$1(e, t, r, n, i) {
return 1 & e.mode ? (e.flags |= 65536,
e.lanes = i,
e) : (e === t ? e.flags |= 65536 : (e.flags |= 128,
r.flags |= 131072,
r.flags &= -52805,
1 === r.tag && (null === r.alternate ? r.tag = 17 : ((t = mh$1(-1,
1)).tag = 2,
nh$1(r, t, 1))),
r.lanes |= 1),
e)
}
var Wi$1 = ua.ReactCurrentOwner
, dh$1 = !1;
function Xi$1(e, t, r, n) {
t.child = null === e ? Vg(t, null, r, n) : Ug(t, e.child, r, n)
}
function Yi$1(e, t, r, n, i) {
r = r.render;
var o = t.ref;
return ch$2(t, i),
n = Nh$1(e, t, r, n, o, i),
r = Sh$1(),
null === e || dh$1 ? (I$1 && r && vg(t),
t.flags |= 1,
Xi$1(e, t, n, i),
t.child) : (t.updateQueue = e.updateQueue,
t.flags &= -2053,
e.lanes &= ~i,
Zi$1(e, t, i))
}
function $i$1(e, t, r, n, i) {
if (null === e) {
var o = r.type;
return "function" != typeof o || aj(o) || void 0 !== o.defaultProps
|| null !== r.compare || void 0 !== r.defaultProps ? ((e = Rg(r.type, null, n, t,
t.mode, i)).ref = t.ref,
e.return = t,
t.child = e) : (t.tag = 15,
t.type = o,
bj(e, t, o, n, i))
}
if (o = e.child,
!(e.lanes & i)) {
var s = o.memoizedProps;
if ((r = null !== (r = r.compare) ? r : Ie$1)(s, n) && e.ref ===
t.ref)
return Zi$1(e, t, i)
}
return t.flags |= 1,
(e = Pg(o, n)).ref = t.ref,
e.return = t,
t.child = e
}
function bj(e, t, r, n, i) {
if (null !== e) {
var o = e.memoizedProps;
if (Ie$1(o, n) && e.ref === t.ref) {
if (dh$1 = !1,
t.pendingProps = n = o,
!(e.lanes & i))
return t.lanes = e.lanes,
Zi$1(e, t, i);
131072 & e.flags && (dh$1 = !0)
}
}
return cj(e, t, r, n, i)
}
function dj(e, t, r) {
var n = t.pendingProps
, i = n.children
, o = null !== e ? e.memoizedState : null;
if ("hidden" === n.mode)
if (1 & t.mode) {
if (!(1073741824 & r))
return e = null !== o ? o.baseLanes | r : r,
t.lanes = t.childLanes = 1073741824,
t.memoizedState = {
baseLanes: e,
cachePool: null,
transitions: null
},
t.updateQueue = null,
G$2(ej, fj),
fj |= e,
null;
t.memoizedState = {
baseLanes: 0,
cachePool: null,
transitions: null
},
n = null !== o ? o.baseLanes : r,
G$2(ej, fj),
fj |= n
} else
t.memoizedState = {
baseLanes: 0,
cachePool: null,
transitions: null
},
G$2(ej, fj),
fj |= r;
else
null !== o ? (n = o.baseLanes | r,
t.memoizedState = null) : n = r,
G$2(ej, fj),
fj |= n;
return Xi$1(e, t, i, r),
t.child
}
function gj(e, t) {
var r = t.ref;
(null === e && null !== r || null !== e && e.ref !== r) && (t.flags |=
512,
t.flags |= 2097152)
}
function cj(e, t, r, n, i) {
var o = Zf(r) ? Xf : H$2.current;
return o = Yf(t, o),
ch$2(t, i),
r = Nh$1(e, t, r, n, o, i),
n = Sh$1(),
null === e || dh$1 ? (I$1 && n && vg(t),
t.flags |= 1,
Xi$1(e, t, r, i),
t.child) : (t.updateQueue = e.updateQueue,
t.flags &= -2053,
e.lanes &= ~i,
Zi$1(e, t, i))
}
function hj(e, t, r, n, i) {
if (Zf(r)) {
var o = !0;
cg(t)
} else
o = !1;
if (ch$2(t, i),
null === t.stateNode)
ij(e, t),
Gi$1(t, r, n),
Ii$1(t, r, n, i),
n = !0;
else if (null === e) {
var s = t.stateNode
, a = t.memoizedProps;
s.props = a;
var l = s.context
, c = r.contextType;
"object" == typeof c && null !== c ? c = eh$1(c) : c = Yf(t, c =
Zf(r) ? Xf : H$2.current);
var u = r.getDerivedStateFromProps
, d = "function" == typeof u || "function" == typeof
s.getSnapshotBeforeUpdate;
d || "function" != typeof s.UNSAFE_componentWillReceiveProps &&
"function" != typeof s.componentWillReceiveProps || (a !== n || l !== c) && Hi$1(t,
s, n, c),
jh$1 = !1;
var p = t.memoizedState;
s.state = p,
qh(t, n, s, i),
l = t.memoizedState,
a !== n || p !== l || Wf.current || jh$1 ? ("function" == typeof u
&& (Di$1(t, r, u, n),
l = t.memoizedState),
(a = jh$1 || Fi$1(t, r, a, n, p, l, c)) ? (d || "function" !=
typeof s.UNSAFE_componentWillMount && "function" != typeof s.componentWillMount ||
("function" == typeof s.componentWillMount && s.componentWillMount(),
"function" == typeof s.UNSAFE_componentWillMount &&
s.UNSAFE_componentWillMount()),
"function" == typeof s.componentDidMount && (t.flags |= 4194308)) :
("function" == typeof s.componentDidMount && (t.flags |= 4194308),
t.memoizedProps = n,
t.memoizedState = l),
s.props = n,
s.state = l,
s.context = c,
n = a) : ("function" == typeof s.componentDidMount && (t.flags |=
4194308),
n = !1)
} else {
s = t.stateNode,
lh$1(e, t),
a = t.memoizedProps,
c = t.type === t.elementType ? a : Ci$1(t.type, a),
s.props = c,
d = t.pendingProps,
p = s.context,
"object" == typeof (l = r.contextType) && null !== l ? l =
eh$1(l) : l = Yf(t, l = Zf(r) ? Xf : H$2.current);
var h = r.getDerivedStateFromProps;
(u = "function" == typeof h || "function" == typeof
s.getSnapshotBeforeUpdate) || "function" != typeof
s.UNSAFE_componentWillReceiveProps && "function" != typeof
s.componentWillReceiveProps || (a !== d || p !== l) && Hi$1(t, s, n, l),
jh$1 = !1,
p = t.memoizedState,
s.state = p,
qh(t, n, s, i);
var f = t.memoizedState;
a !== d || p !== f || Wf.current || jh$1 ? ("function" == typeof h
&& (Di$1(t, r, h, n),
f = t.memoizedState),
(c = jh$1 || Fi$1(t, r, c, n, p, f, l) || !1) ? (u || "function" !=
typeof s.UNSAFE_componentWillUpdate && "function" != typeof s.componentWillUpdate
|| ("function" == typeof s.componentWillUpdate && s.componentWillUpdate(n, f, l),
"function" == typeof s.UNSAFE_componentWillUpdate &&
s.UNSAFE_componentWillUpdate(n, f, l)),
"function" == typeof s.componentDidUpdate && (t.flags |= 4),
"function" == typeof s.getSnapshotBeforeUpdate && (t.flags |=
1024)) : ("function" != typeof s.componentDidUpdate || a === e.memoizedProps && p
=== e.memoizedState || (t.flags |= 4),
"function" != typeof s.getSnapshotBeforeUpdate || a ===
e.memoizedProps && p === e.memoizedState || (t.flags |= 1024),
t.memoizedProps = n,
t.memoizedState = f),
s.props = n,
s.state = f,
s.context = l,
n = c) : ("function" != typeof s.componentDidUpdate || a ===
e.memoizedProps && p === e.memoizedState || (t.flags |= 4),
"function" != typeof s.getSnapshotBeforeUpdate || a ===
e.memoizedProps && p === e.memoizedState || (t.flags |= 1024),
n = !1)
}
return jj(e, t, r, n, o, i)
}
function jj(e, t, r, n, i, o) {
gj(e, t);
var s = !!(128 & t.flags);
if (!n && !s)
return i && dg(t, r, !1),
Zi$1(e, t, o);
n = t.stateNode,
Wi$1.current = t;
var a = s && "function" != typeof r.getDerivedStateFromError ? null :
n.render();
return t.flags |= 1,
null !== e && s ? (t.child = Ug(t, e.child, null, o),
t.child = Ug(t, null, a, o)) : Xi$1(e, t, a, o),
t.memoizedState = n.state,
i && dg(t, r, !0),
t.child
}
function kj(e) {
var t = e.stateNode;
t.pendingContext ? ag(e, t.pendingContext, t.pendingContext !==
t.context) : t.context && ag(e, t.context, !1),
yh$1(e, t.containerInfo)
}
function lj(e, t, r, n, i) {
return Ig(),
Jg(i),
t.flags |= 256,
Xi$1(e, t, r, n),
t.child
}
var mj = {
dehydrated: null,
treeContext: null,
retryLane: 0
}, zj, Aj, Bj, Cj;
function nj(e) {
return {
baseLanes: e,
cachePool: null,
transitions: null
}
}
function oj(e, t, r) {
var n, i = t.pendingProps, o = L$2.current, s = !1, a = !!(128 &
t.flags);
if ((n = a) || (n = (null === e || null !== e.memoizedState) && !!(2 &
o)),
n ? (s = !0,
t.flags &= -129) : null !== e && null === e.memoizedState || (o |= 1),
G$2(L$2, 1 & o),
null === e)
return Eg(t),
null !== (e = t.memoizedState) && null !== (e = e.dehydrated) ? (1
& t.mode ? "$!" === e.data ? t.lanes = 8 : t.lanes = 1073741824 : t.lanes = 1,
null) : (a = i.children,
e = i.fallback,
s ? (i = t.mode,
s = t.child,
a = {
mode: "hidden",
children: a
},
1 & i || null === s ? s = pj(a, i, 0, null) : (s.childLanes = 0,
s.pendingProps = a),
e = Tg(e, i, r, null),
s.return = t,
e.return = t,
s.sibling = e,
t.child = s,
t.child.memoizedState = nj(r),
t.memoizedState = mj,
e) : qj(t, a));
if (null !== (o = e.memoizedState) && null !== (n = o.dehydrated))
return rj(e, t, a, i, n, o, r);
if (s) {
s = i.fallback,
a = t.mode,
n = (o = e.child).sibling;
var l = {
mode: "hidden",
children: i.children
};
return 1 & a || t.child === o ? (i = Pg(o, l)).subtreeFlags =
14680064 & o.subtreeFlags : ((i = t.child).childLanes = 0,
i.pendingProps = l,
t.deletions = null),
null !== n ? s = Pg(n, s) : (s = Tg(s, a, r, null)).flags |= 2,
s.return = t,
i.return = t,
i.sibling = s,
t.child = i,
i = s,
s = t.child,
a = null === (a = e.child.memoizedState) ? nj(r) : {
baseLanes: a.baseLanes | r,
cachePool: null,
transitions: a.transitions
},
s.memoizedState = a,
s.childLanes = e.childLanes & ~r,
t.memoizedState = mj,
i
}
return e = (s = e.child).sibling,
i = Pg(s, {
mode: "visible",
children: i.children
}),
!(1 & t.mode) && (i.lanes = r),
i.return = t,
i.sibling = null,
null !== e && (null === (r = t.deletions) ? (t.deletions = [e],
t.flags |= 16) : r.push(e)),
t.child = i,
t.memoizedState = null,
i
}
function qj(e, t) {
return (t = pj({
mode: "visible",
children: t
}, e.mode, 0, null)).return = e,
e.child = t
}
function sj(e, t, r, n) {
return null !== n && Jg(n),
Ug(t, e.child, null, r),
(e = qj(t, t.pendingProps.children)).flags |= 2,
t.memoizedState = null,
e
}
function rj(e, t, r, n, i, o, s) {
if (r)
return 256 & t.flags ? (t.flags &= -257,
sj(e, t, s, n = Ki$1(Error(p$6(422))))) : null !==
t.memoizedState ? (t.child = e.child,
t.flags |= 128,
null) : (o = n.fallback,
i = t.mode,
n = pj({
mode: "visible",
children: n.children
}, i, 0, null),
(o = Tg(o, i, s, null)).flags |= 2,
n.return = t,
o.return = t,
n.sibling = o,
t.child = n,
1 & t.mode && Ug(t, e.child, null, s),
t.child.memoizedState = nj(s),
t.memoizedState = mj,
o);
if (!(1 & t.mode))
return sj(e, t, s, null);
if ("$!" === i.data) {
if (n = i.nextSibling && i.nextSibling.dataset)
var a = n.dgst;
return n = a,
sj(e, t, s, n = Ki$1(o = Error(p$6(419)), n, void 0))
}
if (a = !!(s & e.childLanes),
dh$1 || a) {
if (null !== (n = Q$2)) {
switch (s & -s) {
case 4:
i = 2;
break;
case 16:
i = 8;
break;
case 64:
case 128:
case 256:
case 512:
case 1024:
case 2048:
case 4096:
case 8192:
case 16384:
case 32768:
case 65536:
case 131072:
case 262144:
case 524288:
case 1048576:
case 2097152:
case 4194304:
case 8388608:
case 16777216:
case 33554432:
case 67108864:
i = 32;
break;
case 536870912:
i = 268435456;
break;
default:
i = 0
}
0 !== (i = i & (n.suspendedLanes | s) ? 0 : i) && i !==
o.retryLane && (o.retryLane = i,
ih$1(e, i),
gi$1(n, e, i, -1))
}
return tj(),
sj(e, t, s, n = Ki$1(Error(p$6(421))))
}
return "$?" === i.data ? (t.flags |= 128,
t.child = e.child,
t = uj.bind(null, e),
i._reactRetry = t,
null) : (e = o.treeContext,
yg = Lf(i.nextSibling),
xg = t,
I$1 = !0,
zg = null,
null !== e && (og[pg++] = rg,
og[pg++] = sg,
og[pg++] = qg,
rg = e.id,
sg = e.overflow,
qg = t),
(t = qj(t, n.children)).flags |= 4096,
t)
}
function vj(e, t, r) {
e.lanes |= t;
var n = e.alternate;
null !== n && (n.lanes |= t),
bh$1(e.return, t, r)
}
function wj(e, t, r, n, i) {
var o = e.memoizedState;
null === o ? e.memoizedState = {
isBackwards: t,
rendering: null,
renderingStartTime: 0,
last: n,
tail: r,
tailMode: i
} : (o.isBackwards = t,
o.rendering = null,
o.renderingStartTime = 0,
o.last = n,
o.tail = r,
o.tailMode = i)
}
function xj(e, t, r) {
var n = t.pendingProps
, i = n.revealOrder
, o = n.tail;
if (Xi$1(e, t, n.children, r),
2 & (n = L$2.current))
n = 1 & n | 2,
t.flags |= 128;
else {
if (null !== e && 128 & e.flags)
e: for (e = t.child; null !== e; ) {
if (13 === e.tag)
null !== e.memoizedState && vj(e, r, t);
else if (19 === e.tag)
vj(e, r, t);
else if (null !== e.child) {
e.child.return = e,
e = e.child;
continue
}
if (e === t)
break e;
for (; null === e.sibling; ) {
if (null === e.return || e.return === t)
break e;
e = e.return
}
e.sibling.return = e.return,
e = e.sibling
}
n &= 1
}
if (G$2(L$2, n),
1 & t.mode)
switch (i) {
case "forwards":
for (r = t.child,
i = null; null !== r; )
null !== (e = r.alternate) && null === Ch$1(e) && (i = r),
r = r.sibling;
null === (r = i) ? (i = t.child,
t.child = null) : (i = r.sibling,
r.sibling = null),
wj(t, !1, i, r, o);
break;
case "backwards":
for (r = null,
i = t.child,
t.child = null; null !== i; ) {
if (null !== (e = i.alternate) && null === Ch$1(e)) {
t.child = i;
break
}
e = i.sibling,
i.sibling = r,
r = i,
i = e
}
wj(t, !0, r, null, o);
break;
case "together":
wj(t, !1, null, null, void 0);
break;
default:
t.memoizedState = null
}
else
t.memoizedState = null;
return t.child
}
function ij(e, t) {
!(1 & t.mode) && null !== e && (e.alternate = null,
t.alternate = null,
t.flags |= 2)
}
function Zi$1(e, t, r) {
if (null !== e && (t.dependencies = e.dependencies),
rh$1 |= t.lanes,
!(r & t.childLanes))
return null;
if (null !== e && t.child !== e.child)
throw Error(p$6(153));
if (null !== t.child) {
for (r = Pg(e = t.child, e.pendingProps),
t.child = r,
r.return = t; null !== e.sibling; )
e = e.sibling,
(r = r.sibling = Pg(e, e.pendingProps)).return = t;
r.sibling = null
}
return t.child
}
function yj(e, t, r) {
switch (t.tag) {
case 3:
kj(t),
Ig();
break;
case 5:
Ah$1(t);
break;
case 1:
Zf(t.type) && cg(t);
break;
case 4:
yh$1(t, t.stateNode.containerInfo);
break;
case 10:
var n = t.type._context
, i = t.memoizedProps.value;
G$2(Wg, n._currentValue),
n._currentValue = i;
break;
case 13:
if (null !== (n = t.memoizedState))
return null !== n.dehydrated ? (G$2(L$2, 1 & L$2.current),
t.flags |= 128,
null) : r & t.child.childLanes ? oj(e, t, r) : (G$2(L$2, 1 &
L$2.current),
null !== (e = Zi$1(e, t, r)) ? e.sibling : null);
G$2(L$2, 1 & L$2.current);
break;
case 19:
if (n = !!(r & t.childLanes),
128 & e.flags) {
if (n)
return xj(e, t, r);
t.flags |= 128
}
if (null !== (i = t.memoizedState) && (i.rendering = null,
i.tail = null,
i.lastEffect = null),
G$2(L$2, L$2.current),
n)
break;
return null;
case 22:
case 23:
return t.lanes = 0,
dj(e, t, r)
}
return Zi$1(e, t, r)
}
function Dj(e, t) {
if (!I$1)
switch (e.tailMode) {
case "hidden":
t = e.tail;
for (var r = null; null !== t; )
null !== t.alternate && (r = t),
t = t.sibling;
null === r ? e.tail = null : r.sibling = null;
break;
case "collapsed":
r = e.tail;
for (var n = null; null !== r; )
null !== r.alternate && (n = r),
r = r.sibling;
null === n ? t || null === e.tail ? e.tail = null :
e.tail.sibling = null : n.sibling = null
}
}
function S$3(e) {
var t = null !== e.alternate && e.alternate.child === e.child
, r = 0
, n = 0;
if (t)
for (var i = e.child; null !== i; )
r |= i.lanes | i.childLanes,
n |= 14680064 & i.subtreeFlags,
n |= 14680064 & i.flags,
i.return = e,
i = i.sibling;
else
for (i = e.child; null !== i; )
r |= i.lanes | i.childLanes,
n |= i.subtreeFlags,
n |= i.flags,
i.return = e,
i = i.sibling;
return e.subtreeFlags |= n,
e.childLanes = r,
t
}
function Ej(e, t, r) {
var n = t.pendingProps;
switch (wg(t),
t.tag) {
case 2:
case 16:
case 15:
case 0:
case 11:
case 7:
case 8:
case 12:
case 9:
case 14:
return S$3(t),
null;
case 1:
case 17:
return Zf(t.type) && $f(),
S$3(t),
null;
case 3:
return n = t.stateNode,
zh$2(),
E$1(Wf),
E$1(H$2),
Eh$1(),
n.pendingContext && (n.context = n.pendingContext,
n.pendingContext = null),
null !== e && null !== e.child || (Gg(t) ? t.flags |= 4 : null ===
e || e.memoizedState.isDehydrated && !(256 & t.flags) || (t.flags |= 1024,
null !== zg && (Fj(zg),
zg = null))),
Aj(e, t),
S$3(t),
null;
case 5:
Bh$1(t);
var i = xh$1(wh$1.current);
if (r = t.type,
null !== e && null != t.stateNode)
Bj(e, t, r, n, i),
e.ref !== t.ref && (t.flags |= 512,
t.flags |= 2097152);
else {
if (!n) {
if (null === t.stateNode)
throw Error(p$6(166));
return S$3(t),
null
}
if (e = xh$1(uh$1.current),
Gg(t)) {
n = t.stateNode,
r = t.type;
var o = t.memoizedProps;
switch (n[Of] = t,
n[Pf] = o,
e = !!(1 & t.mode),
r) {
case "dialog":
D$2("cancel", n),
D$2("close", n);
break;
case "iframe":
case "object":
case "embed":
D$2("load", n);
break;
case "video":
case "audio":
for (i = 0; i < lf.length; i++)
D$2(lf[i], n);
break;
case "source":
D$2("error", n);
break;
case "img":
case "image":
case "link":
D$2("error", n),
D$2("load", n);
break;
case "details":
D$2("toggle", n);
break;
case "input":
Za$1(n, o),
D$2("invalid", n);
break;
case "select":
n._wrapperState = {
wasMultiple: !!o.multiple
},
D$2("invalid", n);
break;
case "textarea":
hb(n, o),
D$2("invalid", n)
}
for (var s in ub(r, o),
i = null,
o)
if (o.hasOwnProperty(s)) {
var a = o[s];
"children" === s ? "string" == typeof a ?
n.textContent !== a && (!0 !== o.suppressHydrationWarning && Af(n.textContent, a,
e),
i = ["children", a]) : "number" == typeof a &&
n.textContent !== "" + a && (!0 !== o.suppressHydrationWarning && Af(n.textContent,
a, e),
i = ["children", "" + a]) : ea$1.hasOwnProperty(s)
&& null != a && "onScroll" === s && D$2("scroll", n)
}
switch (r) {
case "input":
Va$1(n),
db(n, o, !0);
break;
case "textarea":
Va$1(n),
jb(n);
break;
case "select":
case "option":
break;
default:
"function" == typeof o.onClick && (n.onclick = Bf)
}
n = i,
t.updateQueue = n,
null !== n && (t.flags |= 4)
} else {
s = 9 === i.nodeType ? i : i.ownerDocument,
"http://www.w3.org/1999/xhtml" === e && (e = kb(r)),
"http://www.w3.org/1999/xhtml" === e ? "script" === r ? ((e
= s.createElement("div")).innerHTML = "<script><\/script>",
e = e.removeChild(e.firstChild)) : "string" == typeof
n.is ? e = s.createElement(r, {
is: n.is
}) : (e = s.createElement(r),
"select" === r && (s = e,
n.multiple ? s.multiple = !0 : n.size && (s.size =
n.size))) : e = s.createElementNS(e, r),
e[Of] = t,
e[Pf] = n,
zj(e, t, !1, !1),
t.stateNode = e;
e: {
switch (s = vb(r, n),
r) {
case "dialog":
D$2("cancel", e),
D$2("close", e),
i = n;
break;
case "iframe":
case "object":
case "embed":
D$2("load", e),
i = n;
break;
case "video":
case "audio":
for (i = 0; i < lf.length; i++)
D$2(lf[i], e);
i = n;
break;
case "source":
D$2("error", e),
i = n;
break;
case "img":
case "image":
case "link":
D$2("error", e),
D$2("load", e),
i = n;
break;
case "details":
D$2("toggle", e),
i = n;
break;
case "input":
Za$1(e, n),
i = Ya$1(e, n),
D$2("invalid", e);
break;
case "option":
default:
i = n;
break;
case "select":
e._wrapperState = {
wasMultiple: !!n.multiple
},
i = A$3({}, n, {
value: void 0
}),
D$2("invalid", e);
break;
case "textarea":
hb(e, n),
i = gb(e, n),
D$2("invalid", e)
}
for (o in ub(r, i),
a = i)
if (a.hasOwnProperty(o)) {
var l = a[o];
"style" === o ? sb(e, l) :
"dangerouslySetInnerHTML" === o ? null != (l = l ? l.__html : void 0) && nb(e, l) :
"children" === o ? "string" == typeof l ? ("textarea" !== r || "" !== l) && ob(e,
l) : "number" == typeof l && ob(e, "" + l) : "suppressContentEditableWarning" !== o
&& "suppressHydrationWarning" !== o && "autoFocus" !== o && (ea$1.hasOwnProperty(o)
? null != l && "onScroll" === o && D$2("scroll", e) : null != l && ta$1(e, o, l,
s))
}
switch (r) {
case "input":
Va$1(e),
db(e, n, !1);
break;
case "textarea":
Va$1(e),
jb(e);
break;
case "option":
null != n.value && e.setAttribute("value", "" +
Sa(n.value));
break;
case "select":
e.multiple = !!n.multiple,
null != (o = n.value) ? fb(e, !!n.multiple, o, !
1) : null != n.defaultValue && fb(e, !!n.multiple, n.defaultValue, !0);
break;
default:
"function" == typeof i.onClick && (e.onclick = Bf)
}
switch (r) {
case "button":
case "input":
case "select":
case "textarea":
n = !!n.autoFocus;
break e;
case "img":
n = !0;
break e;
default:
n = !1
}
}
n && (t.flags |= 4)
}
null !== t.ref && (t.flags |= 512,
t.flags |= 2097152)
}
return S$3(t),
null;
case 6:
if (e && null != t.stateNode)
Cj(e, t, e.memoizedProps, n);
else {
if ("string" != typeof n && null === t.stateNode)
throw Error(p$6(166));
if (r = xh$1(wh$1.current),
xh$1(uh$1.current),
Gg(t)) {
if (n = t.stateNode,
r = t.memoizedProps,
n[Of] = t,
(o = n.nodeValue !== r) && null !== (e = xg))
switch (e.tag) {
case 3:
Af(n.nodeValue, r, !!(1 & e.mode));
break;
case 5:
!0 !== e.memoizedProps.suppressHydrationWarning &&
Af(n.nodeValue, r, !!(1 & e.mode))
}
o && (t.flags |= 4)
} else
(n = (9 === r.nodeType ? r :
r.ownerDocument).createTextNode(n))[Of] = t,
t.stateNode = n
}
return S$3(t),
null;
case 13:
if (E$1(L$2),
n = t.memoizedState,
null === e || null !== e.memoizedState && null !==
e.memoizedState.dehydrated) {
if (I$1 && null !== yg && 1 & t.mode && !(128 & t.flags))
Hg(),
Ig(),
t.flags |= 98560,
o = !1;
else if (o = Gg(t),
null !== n && null !== n.dehydrated) {
if (null === e) {
if (!o)
throw Error(p$6(318));
if (!(o = null !== (o = t.memoizedState) ? o.dehydrated
: null))
throw Error(p$6(317));
o[Of] = t
} else
Ig(),
!(128 & t.flags) && (t.memoizedState = null),
t.flags |= 4;
S$3(t),
o = !1
} else
null !== zg && (Fj(zg),
zg = null),
o = !0;
if (!o)
return 65536 & t.flags ? t : null
}
return 128 & t.flags ? (t.lanes = r,
t) : ((n = null !== n) !== (null !== e && null !== e.memoizedState)
&& n && (t.child.flags |= 8192,
1 & t.mode && (null === e || 1 & L$2.current ? 0 === T$2 && (T$2 =
3) : tj())),
null !== t.updateQueue && (t.flags |= 4),
S$3(t),
null);
case 4:
return zh$2(),
Aj(e, t),
null === e && sf(t.stateNode.containerInfo),
S$3(t),
null;
case 10:
return ah$1(t.type._context),
S$3(t),
null;
case 19:
if (E$1(L$2),
null === (o = t.memoizedState))
return S$3(t),
null;
if (n = !!(128 & t.flags),
null === (s = o.rendering))
if (n)
Dj(o, !1);
else {
if (0 !== T$2 || null !== e && 128 & e.flags)
for (e = t.child; null !== e; ) {
if (null !== (s = Ch$1(e))) {
for (t.flags |= 128,
Dj(o, !1),
null !== (n = s.updateQueue) && (t.updateQueue
= n,
t.flags |= 4),
t.subtreeFlags = 0,
n = r,
r = t.child; null !== r; )
e = n,
(o = r).flags &= 14680066,
null === (s = o.alternate) ? (o.childLanes
= 0,
o.lanes = e,
o.child = null,
o.subtreeFlags = 0,
o.memoizedProps = null,
o.memoizedState = null,
o.updateQueue = null,
o.dependencies = null,
o.stateNode = null) : (o.childLanes =
s.childLanes,
o.lanes = s.lanes,
o.child = s.child,
o.subtreeFlags = 0,
o.deletions = null,
o.memoizedProps = s.memoizedProps,
o.memoizedState = s.memoizedState,
o.updateQueue = s.updateQueue,
o.type = s.type,
e = s.dependencies,
o.dependencies = null === e ? null : {
lanes: e.lanes,
firstContext: e.firstContext
}),
r = r.sibling;
return G$2(L$2, 1 & L$2.current | 2),
t.child
}
e = e.sibling
}
null !== o.tail && B$2() > Gj && (t.flags |= 128,
n = !0,
Dj(o, !1),
t.lanes = 4194304)
}
else {
if (!n)
if (null !== (e = Ch$1(s))) {
if (t.flags |= 128,
n = !0,
null !== (r = e.updateQueue) && (t.updateQueue = r,
t.flags |= 4),
Dj(o, !0),
null === o.tail && "hidden" === o.tailMode && !
s.alternate && !I$1)
return S$3(t),
null
} else
2 * B$2() - o.renderingStartTime > Gj && 1073741824 !==
r && (t.flags |= 128,
n = !0,
Dj(o, !1),
t.lanes = 4194304);
o.isBackwards ? (s.sibling = t.child,
t.child = s) : (null !== (r = o.last) ? r.sibling = s : t.child
= s,
o.last = s)
}
return null !== o.tail ? (t = o.tail,
o.rendering = t,
o.tail = t.sibling,
o.renderingStartTime = B$2(),
t.sibling = null,
r = L$2.current,
G$2(L$2, n ? 1 & r | 2 : 1 & r),
t) : (S$3(t),
null);
case 22:
case 23:
return Hj(),
n = null !== t.memoizedState,
null !== e && null !== e.memoizedState !== n && (t.flags |= 8192),
n && 1 & t.mode ? !!(1073741824 & fj) && (S$3(t),
6 & t.subtreeFlags && (t.flags |= 8192)) : S$3(t),
null;
case 24:
case 25:
return null
}
throw Error(p$6(156, t.tag))
}
function Ij(e, t) {
switch (wg(t),
t.tag) {
case 1:
return Zf(t.type) && $f(),
65536 & (e = t.flags) ? (t.flags = -65537 & e | 128,
t) : null;
case 3:
return zh$2(),
E$1(Wf),
E$1(H$2),
Eh$1(),
65536 & (e = t.flags) && !(128 & e) ? (t.flags = -65537 & e | 128,
t) : null;
case 5:
return Bh$1(t),
null;
case 13:
if (E$1(L$2),
null !== (e = t.memoizedState) && null !== e.dehydrated) {
if (null === t.alternate)
throw Error(p$6(340));
Ig()
}
return 65536 & (e = t.flags) ? (t.flags = -65537 & e | 128,
t) : null;
case 19:
return E$1(L$2),
null;
case 4:
return zh$2(),
null;
case 10:
return ah$1(t.type._context),
null;
case 22:
case 23:
return Hj(),
null;
default:
return null
}
}
zj = function(e, t) {
for (var r = t.child; null !== r; ) {
if (5 === r.tag || 6 === r.tag)
e.appendChild(r.stateNode);
else if (4 !== r.tag && null !== r.child) {
r.child.return = r,
r = r.child;
continue
}
if (r === t)
break;
for (; null === r.sibling; ) {
if (null === r.return || r.return === t)
return;
r = r.return
}
r.sibling.return = r.return,
r = r.sibling
}
}
,
Aj = function() {}
,
Bj = function(e, t, r, n) {
var i = e.memoizedProps;
if (i !== n) {
e = t.stateNode,
xh$1(uh$1.current);
var o, s = null;
switch (r) {
case "input":
i = Ya$1(e, i),
n = Ya$1(e, n),
s = [];
break;
case "select":
i = A$3({}, i, {
value: void 0
}),
n = A$3({}, n, {
value: void 0
}),
s = [];
break;
case "textarea":
i = gb(e, i),
n = gb(e, n),
s = [];
break;
default:
"function" != typeof i.onClick && "function" == typeof
n.onClick && (e.onclick = Bf)
}
for (c in ub(r, n),
r = null,
i)
if (!n.hasOwnProperty(c) && i.hasOwnProperty(c) && null !=
i[c])
if ("style" === c) {
var a = i[c];
for (o in a)
a.hasOwnProperty(o) && (r || (r = {}),
r[o] = "")
} else
"dangerouslySetInnerHTML" !== c && "children" !== c &&
"suppressContentEditableWarning" !== c && "suppressHydrationWarning" !== c &&
"autoFocus" !== c && (ea$1.hasOwnProperty(c) ? s || (s = []) : (s = s ||
[]).push(c, null));
for (c in n) {
var l = n[c];
if (a = null != i ? i[c] : void 0,
n.hasOwnProperty(c) && l !== a && (null != l || null != a))
if ("style" === c)
if (a) {
for (o in a)
!a.hasOwnProperty(o) || l &&
l.hasOwnProperty(o) || (r || (r = {}),
r[o] = "");
for (o in l)
l.hasOwnProperty(o) && a[o] !== l[o] && (r ||
(r = {}),
r[o] = l[o])
} else
r || (s || (s = []),
s.push(c, r)),
r = l;
else
"dangerouslySetInnerHTML" === c ? (l = l ? l.__html :
void 0,
a = a ? a.__html : void 0,
null != l && a !== l && (s = s || []).push(c, l)) :
"children" === c ? "string" != typeof l && "number" != typeof l || (s = s ||
[]).push(c, "" + l) : "suppressContentEditableWarning" !== c &&
"suppressHydrationWarning" !== c && (ea$1.hasOwnProperty(c) ? (null != l &&
"onScroll" === c && D$2("scroll", e),
s || a === l || (s = [])) : (s = s || []).push(c, l))
}
r && (s = s || []).push("style", r);
var c = s;
(t.updateQueue = c) && (t.flags |= 4)
}
}
,
Cj = function(e, t, r, n) {
r !== n && (t.flags |= 4)
}
;
var Jj = !1
, U$1 = !1
, Kj = "function" == typeof WeakSet ? WeakSet : Set
, V$1 = null;
function Lj(e, t) {
var r = e.ref;
if (null !== r)
if ("function" == typeof r)
try {
r(null)
} catch (n) {
W$2(e, t, n)
}
else
r.current = null
}
function Mj(e, t, r) {
try {
r()
} catch (n) {
W$2(e, t, n)
}
}
var Nj = !1;
function Oj(e, t) {
if (Cf = dd,
Ne$1(e = Me$1())) {
if ("selectionStart"in e)
var r = {
start: e.selectionStart,
end: e.selectionEnd
};
else
e: {
var n = (r = (r = e.ownerDocument) && r.defaultView ||
window).getSelection && r.getSelection();
if (n && 0 !== n.rangeCount) {
r = n.anchorNode;
var i = n.anchorOffset
, o = n.focusNode;
n = n.focusOffset;
try {
r.nodeType,
o.nodeType
} catch (x) {
r = null;
break e
}
var s = 0
, a = -1
, l = -1
, c = 0
, u = 0
, d = e
, p = null;
t: for (; ; ) {
for (var h; d !== r || 0 !== i && 3 !== d.nodeType
|| (a = s + i),
d !== o || 0 !== n && 3 !== d.nodeType || (l = s +
n),
3 === d.nodeType && (s += d.nodeValue.length),
null !== (h = d.firstChild); )
p = d,
d = h;
for (; ; ) {
if (d === e)
break t;
if (p === r && ++c === i && (a = s),
p === o && ++u === n && (l = s),
null !== (h = d.nextSibling))
break;
p = (d = p).parentNode
}
d = h
}
r = -1 === a || -1 === l ? null : {
start: a,
end: l
}
} else
r = null
}
r = r || {
start: 0,
end: 0
}
} else
r = null;
for (Df = {
focusedElem: e,
selectionRange: r
},
dd = !1,
V$1 = t; null !== V$1; )
if (e = (t = V$1).child,
1028 & t.subtreeFlags && null !== e)
e.return = t,
V$1 = e;
else
for (; null !== V$1; ) {
t = V$1;
try {
var f = t.alternate;
if (1024 & t.flags)
switch (t.tag) {
case 0:
case 11:
case 15:
case 5:
case 6:
case 4:
case 17:
break;
case 1:
if (null !== f) {
var m = f.memoizedProps
, g = f.memoizedState
, y = t.stateNode
, v =
y.getSnapshotBeforeUpdate(t.elementType === t.type ? m : Ci$1(t.type, m), g);
y.__reactInternalSnapshotBeforeUpdate = v
}
break;
case 3:
var b = t.stateNode.containerInfo;
1 === b.nodeType ? b.textContent = "" : 9 ===
b.nodeType && b.documentElement && b.removeChild(b.documentElement);
break;
default:
throw Error(p$6(163))
}
} catch (x) {
W$2(t, t.return, x)
}
if (null !== (e = t.sibling)) {
e.return = t.return,
V$1 = e;
break
}
V$1 = t.return
}
return f = Nj,
Nj = !1,
f
}
function Pj(e, t, r) {
var n = t.updateQueue;
if (null !== (n = null !== n ? n.lastEffect : null)) {
var i = n = n.next;
do {
if ((i.tag & e) === e) {
var o = i.destroy;
i.destroy = void 0,
void 0 !== o && Mj(t, r, o)
}
i = i.next
} while (i !== n)
}
}
function Qj(e, t) {
if (null !== (t = null !== (t = t.updateQueue) ? t.lastEffect : null))
{
var r = t = t.next;
do {
if ((r.tag & e) === e) {
var n = r.create;
r.destroy = n()
}
r = r.next
} while (r !== t)
}
}
function Rj(e) {
var t = e.ref;
if (null !== t) {
var r = e.stateNode;
e.tag,
e = r,
"function" == typeof t ? t(e) : t.current = e
}
}
function Sj(e) {
var t = e.alternate;
null !== t && (e.alternate = null,
Sj(t)),
e.child = null,
e.deletions = null,
e.sibling = null,
5 === e.tag && (null !== (t = e.stateNode) && (delete t[Of],
delete t[Pf],
delete t[of],
delete t[Qf],
delete t[Rf])),
e.stateNode = null,
e.return = null,
e.dependencies = null,
e.memoizedProps = null,
e.memoizedState = null,
e.pendingProps = null,
e.stateNode = null,
e.updateQueue = null
}
function Tj(e) {
return 5 === e.tag || 3 === e.tag || 4 === e.tag
}
function Uj(e) {
e: for (; ; ) {
for (; null === e.sibling; ) {
if (null === e.return || Tj(e.return))
return null;
e = e.return
}
for (e.sibling.return = e.return,
e = e.sibling; 5 !== e.tag && 6 !== e.tag && 18 !== e.tag; ) {
if (2 & e.flags)
continue e;
if (null === e.child || 4 === e.tag)
continue e;
e.child.return = e,
e = e.child
}
if (!(2 & e.flags))
return e.stateNode
}
}
function Vj(e, t, r) {
var n = e.tag;
if (5 === n || 6 === n)
e = e.stateNode,
t ? 8 === r.nodeType ? r.parentNode.insertBefore(e, t) :
r.insertBefore(e, t) : (8 === r.nodeType ? (t = r.parentNode).insertBefore(e, r) :
(t = r).appendChild(e),
null != (r = r._reactRootContainer) || null !== t.onclick ||
(t.onclick = Bf));
else if (4 !== n && null !== (e = e.child))
for (Vj(e, t, r),
e = e.sibling; null !== e; )
Vj(e, t, r),
e = e.sibling
}
function Wj(e, t, r) {
var n = e.tag;
if (5 === n || 6 === n)
e = e.stateNode,
t ? r.insertBefore(e, t) : r.appendChild(e);
else if (4 !== n && null !== (e = e.child))
for (Wj(e, t, r),
e = e.sibling; null !== e; )
Wj(e, t, r),
e = e.sibling
}
var X$1 = null
, Xj = !1;
function Yj(e, t, r) {
for (r = r.child; null !== r; )
Zj(e, t, r),
r = r.sibling
}
function Zj(e, t, r) {
if (lc && "function" == typeof lc.onCommitFiberUnmount)
try {
lc.onCommitFiberUnmount(kc, r)
} catch (a) {}
switch (r.tag) {
case 5:
U$1 || Lj(r, t);
case 6:
var n = X$1
, i = Xj;
X$1 = null,
Yj(e, t, r),
Xj = i,
null !== (X$1 = n) && (Xj ? (e = X$1,
r = r.stateNode,
8 === e.nodeType ? e.parentNode.removeChild(r) :
e.removeChild(r)) : X$1.removeChild(r.stateNode));
break;
case 18:
null !== X$1 && (Xj ? (e = X$1,
r = r.stateNode,
8 === e.nodeType ? Kf(e.parentNode, r) : 1 === e.nodeType && Kf(e,
r),
bd(e)) : Kf(X$1, r.stateNode));
break;
case 4:
n = X$1,
i = Xj,
X$1 = r.stateNode.containerInfo,
Xj = !0,
Yj(e, t, r),
X$1 = n,
Xj = i;
break;
case 0:
case 11:
case 14:
case 15:
if (!U$1 && (null !== (n = r.updateQueue) && null !== (n =
n.lastEffect))) {
i = n = n.next;
do {
var o = i
, s = o.destroy;
o = o.tag,
void 0 !== s && (2 & o || 4 & o) && Mj(r, t, s),
i = i.next
} while (i !== n)
}
Yj(e, t, r);
break;
case 1:
if (!U$1 && (Lj(r, t),
"function" == typeof (n = r.stateNode).componentWillUnmount))
try {
n.props = r.memoizedProps,
n.state = r.memoizedState,
n.componentWillUnmount()
} catch (a) {
W$2(r, t, a)
}
Yj(e, t, r);
break;
case 21:
Yj(e, t, r);
break;
case 22:
1 & r.mode ? (U$1 = (n = U$1) || null !== r.memoizedState,
Yj(e, t, r),
U$1 = n) : Yj(e, t, r);
break;
default:
Yj(e, t, r)
}
}
function ak(e) {
var t = e.updateQueue;
if (null !== t) {
e.updateQueue = null;
var r = e.stateNode;
null === r && (r = e.stateNode = new Kj),
t.forEach((function(t) {
var n = bk.bind(null, e, t);
r.has(t) || (r.add(t),
t.then(n, n))
}
))
}
}
function ck(e, t) {
var r = t.deletions;
if (null !== r)
for (var n = 0; n < r.length; n++) {
var i = r[n];
try {
var o = e
, s = t
, a = s;
e: for (; null !== a; ) {
switch (a.tag) {
case 5:
X$1 = a.stateNode,
Xj = !1;
break e;
case 3:
case 4:
X$1 = a.stateNode.containerInfo,
Xj = !0;
break e
}
a = a.return
}
if (null === X$1)
throw Error(p$6(160));
Zj(o, s, i),
X$1 = null,
Xj = !1;
var l = i.alternate;
null !== l && (l.return = null),
i.return = null
} catch (c) {
W$2(i, t, c)
}
}
if (12854 & t.subtreeFlags)
for (t = t.child; null !== t; )
dk(t, e),
t = t.sibling
}
function dk(e, t) {
var r = e.alternate
, n = e.flags;
switch (e.tag) {
case 0:
case 11:
case 14:
case 15:
if (ck(t, e),
ek(e),
4 & n) {
try {
Pj(3, e, e.return),
Qj(3, e)
} catch (t2) {
W$2(e, e.return, t2)
}
try {
Pj(5, e, e.return)
} catch (t2) {
W$2(e, e.return, t2)
}
}
break;
case 1:
ck(t, e),
ek(e),
512 & n && null !== r && Lj(r, r.return);
break;
case 5:
if (ck(t, e),
ek(e),
512 & n && null !== r && Lj(r, r.return),
32 & e.flags) {
var i = e.stateNode;
try {
ob(i, "")
} catch (t2) {
W$2(e, e.return, t2)
}
}
if (4 & n && null != (i = e.stateNode)) {
var o = e.memoizedProps
, s = null !== r ? r.memoizedProps : o
, a = e.type
, l = e.updateQueue;
if (e.updateQueue = null,
null !== l)
try {
"input" === a && "radio" === o.type && null != o.name
&& ab(i, o),
vb(a, s);
var c = vb(a, o);
for (s = 0; s < l.length; s += 2) {
var u = l[s]
, d = l[s + 1];
"style" === u ? sb(i, d) :
"dangerouslySetInnerHTML" === u ? nb(i, d) : "children" === u ? ob(i, d) : ta$1(i,
u, d, c)
}
switch (a) {
case "input":
bb(i, o);
break;
case "textarea":
ib(i, o);
break;
case "select":
var p = i._wrapperState.wasMultiple;
i._wrapperState.wasMultiple = !!o.multiple;
var h = o.value;
null != h ? fb(i, !!o.multiple, h, !1) : p !== !!
o.multiple && (null != o.defaultValue ? fb(i, !!o.multiple, o.defaultValue, !0) :
fb(i, !!o.multiple, o.multiple ? [] : "", !1))
}
i[Pf] = o
} catch (t2) {
W$2(e, e.return, t2)
}
}
break;
case 6:
if (ck(t, e),
ek(e),
4 & n) {
if (null === e.stateNode)
throw Error(p$6(162));
i = e.stateNode,
o = e.memoizedProps;
try {
i.nodeValue = o
} catch (t2) {
W$2(e, e.return, t2)
}
}
break;
case 3:
if (ck(t, e),
ek(e),
4 & n && null !== r && r.memoizedState.isDehydrated)
try {
bd(t.containerInfo)
} catch (t2) {
W$2(e, e.return, t2)
}
break;
case 4:
default:
ck(t, e),
ek(e);
break;
case 13:
ck(t, e),
ek(e),
8192 & (i = e.child).flags && (o = null !== i.memoizedState,
i.stateNode.isHidden = o,
!o || null !== i.alternate && null !== i.alternate.memoizedState ||
(fk = B$2())),
4 & n && ak(e);
break;
case 22:
if (u = null !== r && null !== r.memoizedState,
1 & e.mode ? (U$1 = (c = U$1) || u,
ck(t, e),
U$1 = c) : ck(t, e),
ek(e),
8192 & n) {
if (c = null !== e.memoizedState,
(e.stateNode.isHidden = c) && !u && 1 & e.mode)
for (V$1 = e,
u = e.child; null !== u; ) {
for (d = V$1 = u; null !== V$1; ) {
switch (h = (p = V$1).child,
p.tag) {
case 0:
case 11:
case 14:
case 15:
Pj(4, p, p.return);
break;
case 1:
Lj(p, p.return);
var f = p.stateNode;
if ("function" == typeof
f.componentWillUnmount) {
n = p,
r = p.return;
try {
t = n,
f.props = t.memoizedProps,
f.state = t.memoizedState,
f.componentWillUnmount()
} catch (t2) {
W$2(n, r, t2)
}
}
break;
case 5:
Lj(p, p.return);
break;
case 22:
if (null !== p.memoizedState) {
gk(d);
continue
}
}
null !== h ? (h.return = p,
V$1 = h) : gk(d)
}
u = u.sibling
}
e: for (u = null,
d = e; ; ) {
if (5 === d.tag) {
if (null === u) {
u = d;
try {
i = d.stateNode,
c ? "function" == typeof (o =
i.style).setProperty ? o.setProperty("display", "none", "important") : o.display =
"none" : (a = d.stateNode,
s = null != (l = d.memoizedProps.style) &&
l.hasOwnProperty("display") ? l.display : null,
a.style.display = rb("display", s))
} catch (t2) {
W$2(e, e.return, t2)
}
}
} else if (6 === d.tag) {
if (null === u)
try {
d.stateNode.nodeValue = c ? "" :
d.memoizedProps
} catch (t2) {
W$2(e, e.return, t2)
}
} else if ((22 !== d.tag && 23 !== d.tag || null ===
d.memoizedState || d === e) && null !== d.child) {
d.child.return = d,
d = d.child;
continue
}
if (d === e)
break e;
for (; null === d.sibling; ) {
if (null === d.return || d.return === e)
break e;
u === d && (u = null),
d = d.return
}
u === d && (u = null),
d.sibling.return = d.return,
d = d.sibling
}
}
break;
case 19:
ck(t, e),
ek(e),
4 & n && ak(e);
case 21:
}
}
function ek(e) {
var t = e.flags;
if (2 & t) {
try {
e: {
for (var r = e.return; null !== r; ) {
if (Tj(r)) {
var n = r;
break e
}
r = r.return
}
throw Error(p$6(160))
}
switch (n.tag) {
case 5:
var i = n.stateNode;
32 & n.flags && (ob(i, ""),
n.flags &= -33),
Wj(e, Uj(e), i);
break;
case 3:
case 4:
var o = n.stateNode.containerInfo;
Vj(e, Uj(e), o);
break;
default:
throw Error(p$6(161))
}
} catch (s) {
W$2(e, e.return, s)
}
e.flags &= -3
}
4096 & t && (e.flags &= -4097)
}
function hk(e, t, r) {
V$1 = e,
ik(e)
}
function ik(e, t, r) {
for (var n = !!(1 & e.mode); null !== V$1; ) {
var i = V$1
, o = i.child;
if (22 === i.tag && n) {
var s = null !== i.memoizedState || Jj;
if (!s) {
var a = i.alternate
, l = null !== a && null !== a.memoizedState || U$1;
a = Jj;
var c = U$1;
if (Jj = s,
(U$1 = l) && !c)
for (V$1 = i; null !== V$1; )
l = (s = V$1).child,
22 === s.tag && null !== s.memoizedState ? jk(i) :
null !== l ? (l.return = s,
V$1 = l) : jk(i);
for (; null !== o; )
V$1 = o,
ik(o),
o = o.sibling;
V$1 = i,
Jj = a,
U$1 = c
}
kk(e)
} else
8772 & i.subtreeFlags && null !== o ? (o.return = i,
V$1 = o) : kk(e)
}
}
function kk(e) {
for (; null !== V$1; ) {
var t = V$1;
if (8772 & t.flags) {
var r = t.alternate;
try {
if (8772 & t.flags)
switch (t.tag) {
case 0:
case 11:
case 15:
U$1 || Qj(5, t);
break;
case 1:
var n = t.stateNode;
if (4 & t.flags && !U$1)
if (null === r)
n.componentDidMount();
else {
var i = t.elementType === t.type ?
r.memoizedProps : Ci$1(t.type, r.memoizedProps);
n.componentDidUpdate(i, r.memoizedState,
n.__reactInternalSnapshotBeforeUpdate)
}
var o = t.updateQueue;
null !== o && sh$1(t, o, n);
break;
case 3:
var s = t.updateQueue;
if (null !== s) {
if (r = null,
null !== t.child)
switch (t.child.tag) {
case 5:
case 1:
r = t.child.stateNode
}
sh$1(t, s, r)
}
break;
case 5:
var a = t.stateNode;
if (null === r && 4 & t.flags) {
r = a;
var l = t.memoizedProps;
switch (t.type) {
case "button":
case "input":
case "select":
case "textarea":
l.autoFocus && r.focus();
break;
case "img":
l.src && (r.src = l.src)
}
}
break;
case 6:
case 4:
case 12:
case 19:
case 17:
case 21:
case 22:
case 23:
case 25:
break;
case 13:
if (null === t.memoizedState) {
var c = t.alternate;
if (null !== c) {
var u = c.memoizedState;
if (null !== u) {
var d = u.dehydrated;
null !== d && bd(d)
}
}
}
break;
default:
throw Error(p$6(163))
}
U$1 || 512 & t.flags && Rj(t)
} catch (p) {
W$2(t, t.return, p)
}
}
if (t === e) {
V$1 = null;
break
}
if (null !== (r = t.sibling)) {
r.return = t.return,
V$1 = r;
break
}
V$1 = t.return
}
}
function gk(e) {
for (; null !== V$1; ) {
var t = V$1;
if (t === e) {
V$1 = null;
break
}
var r = t.sibling;
if (null !== r) {
r.return = t.return,
V$1 = r;
break
}
V$1 = t.return
}
}
function jk(e) {
for (; null !== V$1; ) {
var t = V$1;
try {
switch (t.tag) {
case 0:
case 11:
case 15:
var r = t.return;
try {
Qj(4, t)
} catch (l) {
W$2(t, r, l)
}
break;
case 1:
var n = t.stateNode;
if ("function" == typeof n.componentDidMount) {
var i = t.return;
try {
n.componentDidMount()
} catch (l) {
W$2(t, i, l)
}
}
var o = t.return;
try {
Rj(t)
} catch (l) {
W$2(t, o, l)
}
break;
case 5:
var s = t.return;
try {
Rj(t)
} catch (l) {
W$2(t, s, l)
}
}
} catch (l) {
W$2(t, t.return, l)
}
if (t === e) {
V$1 = null;
break
}
var a = t.sibling;
if (null !== a) {
a.return = t.return,
V$1 = a;
break
}
V$1 = t.return
}
}
var lk = Math.ceil, mk = ua.ReactCurrentDispatcher, nk =
ua.ReactCurrentOwner, ok = ua.ReactCurrentBatchConfig, K$1 = 0, Q$2 = null, Y$1 =
null, Z$1 = 0, fj = 0, ej = Uf(0), T$2 = 0, pk = null, rh$1 = 0, qk = 0, rk = 0, sk
= null, tk = null, fk = 0, Gj = 1 / 0, uk = null, Oi$1 = !1, Pi$1 = null, Ri$1 =
null, vk = !1, wk$1 = null, xk = 0, yk = 0, zk = null, Ak = -1, Bk = 0, Vk;
function R$1() {
return 6 & K$1 ? B$2() : -1 !== Ak ? Ak : Ak = B$2()
}
function yi$1(e) {
return 1 & e.mode ? 2 & K$1 && 0 !== Z$1 ? Z$1 & -Z$1 : null !==
Kg.transition ? (0 === Bk && (Bk = yc()),
Bk) : 0 !== (e = C$2) ? e : e = void 0 === (e = window.event) ? 16 :
jd(e.type) : 1
}
function gi$1(e, t, r, n) {
if (50 < yk)
throw yk = 0,
zk = null,
Error(p$6(185));
Ac(e, r, n),
2 & K$1 && e === Q$2 || (e === Q$2 && (!(2 & K$1) && (qk |= r),
4 === T$2 && Ck(e, Z$1)),
Dk(e, n),
1 === r && 0 === K$1 && !(1 & t.mode) && (Gj = B$2() + 500,
fg && jg()))
}
function Dk(e, t) {
var r = e.callbackNode;
wc(e, t);
var n = uc(e, e === Q$2 ? Z$1 : 0);
if (0 === n)
null !== r && bc(r),
e.callbackNode = null,
e.callbackPriority = 0;
else if (t = n & -n,
e.callbackPriority !== t) {
if (null != r && bc(r),
1 === t)
0 === e.tag ? ig(Ek.bind(null, e)) : hg(Ek.bind(null, e)),
Jf((function() {
!(6 & K$1) && jg()
}
)),
r = null;
else {
switch (Dc(n)) {
case 1:
r = fc;
break;
case 4:
r = gc;
break;
case 16:
default:
r = hc;
break;
case 536870912:
r = jc
}
r = Fk(r, Gk.bind(null, e))
}
e.callbackPriority = t,
e.callbackNode = r
}
}
function Gk(e, t) {
if (Ak = -1,
Bk = 0,
6 & K$1)
throw Error(p$6(327));
var r = e.callbackNode;
if (Hk() && e.callbackNode !== r)
return null;
var n = uc(e, e === Q$2 ? Z$1 : 0);
if (0 === n)
return null;
if (30 & n || n & e.expiredLanes || t)
t = Ik(e, n);
else {
t = n;
var i = K$1;
K$1 |= 2;
var o = Jk();
for (Q$2 === e && Z$1 === t || (uk = null,
Gj = B$2() + 500,
Kk(e, t)); ; )
try {
Lk();
break
} catch (a) {
Mk(e, a)
}
$g(),
mk.current = o,
K$1 = i,
null !== Y$1 ? t = 0 : (Q$2 = null,
Z$1 = 0,
t = T$2)
}
if (0 !== t) {
if (2 === t && (0 !== (i = xc(e)) && (n = i,
t = Nk(e, i))),
1 === t)
throw r = pk,
Kk(e, 0),
Ck(e, n),
Dk(e, B$2()),
r;
if (6 === t)
Ck(e, n);
else {
if (i = e.current.alternate,
!(30 & n || Ok(i) || (t = Ik(e, n),
2 === t && (o = xc(e),
0 !== o && (n = o,
t = Nk(e, o))),
1 !== t)))
throw r = pk,
Kk(e, 0),
Ck(e, n),
Dk(e, B$2()),
r;
switch (e.finishedWork = i,
e.finishedLanes = n,
t) {
case 0:
case 1:
throw Error(p$6(345));
case 2:
case 5:
Pk(e, tk, uk);
break;
case 3:
if (Ck(e, n),
(130023424 & n) === n && 10 < (t = fk + 500 - B$2())) {
if (0 !== uc(e, 0))
break;
if (((i = e.suspendedLanes) & n) !== n) {
R$1(),
e.pingedLanes |= e.suspendedLanes & i;
break
}
e.timeoutHandle = Ff(Pk.bind(null, e, tk, uk), t);
break
}
Pk(e, tk, uk);
break;
case 4:
if (Ck(e, n),
(4194240 & n) === n)
break;
for (t = e.eventTimes,
i = -1; 0 < n; ) {
var s = 31 - oc(n);
o = 1 << s,
(s = t[s]) > i && (i = s),
n &= ~o
}
if (n = i,
10 < (n = (120 > (n = B$2() - n) ? 120 : 480 > n ? 480 :
1080 > n ? 1080 : 1920 > n ? 1920 : 3e3 > n ? 3e3 : 4320 > n ? 4320 : 1960 * lk(n /
1960)) - n)) {
e.timeoutHandle = Ff(Pk.bind(null, e, tk, uk), n);
break
}
Pk(e, tk, uk);
break;
default:
throw Error(p$6(329))
}
}
}
return Dk(e, B$2()),
e.callbackNode === r ? Gk.bind(null, e) : null
}
function Nk(e, t) {
var r = sk;
return e.current.memoizedState.isDehydrated && (Kk(e, t).flags |= 256),
2 !== (e = Ik(e, t)) && (t = tk,
tk = r,
null !== t && Fj(t)),
e
}
function Fj(e) {
null === tk ? tk = e : tk.push.apply(tk, e)
}
function Ok(e) {
for (var t = e; ; ) {
if (16384 & t.flags) {
var r = t.updateQueue;
if (null !== r && null !== (r = r.stores))
for (var n = 0; n < r.length; n++) {
var i = r[n]
, o = i.getSnapshot;
i = i.value;
try {
if (!He$1(o(), i))
return !1
} catch (s) {
return !1
}
}
}
if (r = t.child,
16384 & t.subtreeFlags && null !== r)
r.return = t,
t = r;
else {
if (t === e)
break;
for (; null === t.sibling; ) {
if (null === t.return || t.return === e)
return !0;
t = t.return
}
t.sibling.return = t.return,
t = t.sibling
}
}
return !0
}
function Ck(e, t) {
for (t &= ~rk,
t &= ~qk,
e.suspendedLanes |= t,
e.pingedLanes &= ~t,
e = e.expirationTimes; 0 < t; ) {
var r = 31 - oc(t)
, n = 1 << r;
e[r] = -1,
t &= ~n
}
}
function Ek(e) {
if (6 & K$1)
throw Error(p$6(327));
Hk();
var t = uc(e, 0);
if (!(1 & t))
return Dk(e, B$2()),
null;
var r = Ik(e, t);
if (0 !== e.tag && 2 === r) {
var n = xc(e);
0 !== n && (t = n,
r = Nk(e, n))
}
if (1 === r)
throw r = pk,
Kk(e, 0),
Ck(e, t),
Dk(e, B$2()),
r;
if (6 === r)
throw Error(p$6(345));
return e.finishedWork = e.current.alternate,
e.finishedLanes = t,
Pk(e, tk, uk),
Dk(e, B$2()),
null
}
function Qk(e, t) {
var r = K$1;
K$1 |= 1;
try {
return e(t)
} finally {
0 === (K$1 = r) && (Gj = B$2() + 500,
fg && jg())
}
}
function Rk(e) {
null !== wk$1 && 0 === wk$1.tag && !(6 & K$1) && Hk();
var t = K$1;
K$1 |= 1;
var r = ok.transition
, n = C$2;
try {
if (ok.transition = null,
C$2 = 1,
e)
return e()
} finally {
C$2 = n,
ok.transition = r,
!(6 & (K$1 = t)) && jg()
}
}
function Hj() {
fj = ej.current,
E$1(ej)
}
function Kk(e, t) {
e.finishedWork = null,
e.finishedLanes = 0;
var r = e.timeoutHandle;
if (-1 !== r && (e.timeoutHandle = -1,
Gf(r)),
null !== Y$1)
for (r = Y$1.return; null !== r; ) {
var n = r;
switch (wg(n),
n.tag) {
case 1:
null != (n = n.type.childContextTypes) && $f();
break;
case 3:
zh$2(),
E$1(Wf),
E$1(H$2),
Eh$1();
break;
case 5:
Bh$1(n);
break;
case 4:
zh$2();
break;
case 13:
case 19:
E$1(L$2);
break;
case 10:
ah$1(n.type._context);
break;
case 22:
case 23:
Hj()
}
r = r.return
}
if (Q$2 = e,
Y$1 = e = Pg(e.current, null),
Z$1 = fj = t,
T$2 = 0,
pk = null,
rk = qk = rh$1 = 0,
tk = sk = null,
null !== fh$1) {
for (t = 0; t < fh$1.length; t++)
if (null !== (n = (r = fh$1[t]).interleaved)) {
r.interleaved = null;
var i = n.next
, o = r.pending;
if (null !== o) {
var s = o.next;
o.next = i,
n.next = s
}
r.pending = n
}
fh$1 = null
}
return e
}
function Mk(e, t) {
for (; ; ) {
var r = Y$1;
try {
if ($g(),
Fh$1.current = Rh$1,
Ih$1) {
for (var n = M$3.memoizedState; null !== n; ) {
var i = n.queue;
null !== i && (i.pending = null),
n = n.next
}
Ih$1 = !1
}
if (Hh$1 = 0,
O$2 = N$3 = M$3 = null,
Jh = !1,
Kh$1 = 0,
nk.current = null,
null === r || null === r.return) {
T$2 = 1,
pk = t,
Y$1 = null;
break
}
e: {
var o = e
, s = r.return
, a = r
, l = t;
if (t = Z$1,
a.flags |= 32768,
null !== l && "object" == typeof l && "function" == typeof
l.then) {
var c = l
, u = a
, d = u.tag;
if (!(1 & u.mode || 0 !== d && 11 !== d && 15 !== d)) {
var p = u.alternate;
p ? (u.updateQueue = p.updateQueue,
u.memoizedState = p.memoizedState,
u.lanes = p.lanes) : (u.updateQueue = null,
u.memoizedState = null)
}
var h = Ui$1(s);
if (null !== h) {
h.flags &= -257,
Vi$1(h, s, a, o, t),
1 & h.mode && Si$1(o, c, t),
l = c;
var f = (t = h).updateQueue;
if (null === f) {
var m = new Set;
m.add(l),
t.updateQueue = m
} else
f.add(l);
break e
}
if (!(1 & t)) {
Si$1(o, c, t),
tj();
break e
}
l = Error(p$6(426))
} else if (I$1 && 1 & a.mode) {
var g = Ui$1(s);
if (null !== g) {
!(65536 & g.flags) && (g.flags |= 256),
Vi$1(g, s, a, o, t),
Jg(Ji$1(l, a));
break e
}
}
o = l = Ji$1(l, a),
4 !== T$2 && (T$2 = 2),
null === sk ? sk = [o] : sk.push(o),
o = s;
do {
switch (o.tag) {
case 3:
o.flags |= 65536,
t &= -t,
o.lanes |= t,
ph$1(o, Ni$1(o, l, t));
break e;
case 1:
a = l;
var y = o.type
, v = o.stateNode;
if (!(128 & o.flags || "function" != typeof
y.getDerivedStateFromError && (null === v || "function" != typeof
v.componentDidCatch || null !== Ri$1 && Ri$1.has(v)))) {
o.flags |= 65536,
t &= -t,
o.lanes |= t,
ph$1(o, Qi$1(o, a, t));
break e
}
}
o = o.return
} while (null !== o)
}
Sk(r)
} catch (b) {
t = b,
Y$1 === r && null !== r && (Y$1 = r = r.return);
continue
}
break
}
}
function Jk() {
var e = mk.current;
return mk.current = Rh$1,
null === e ? Rh$1 : e
}
function tj() {
0 !== T$2 && 3 !== T$2 && 2 !== T$2 || (T$2 = 4),
null === Q$2 || !(268435455 & rh$1) && !(268435455 & qk) || Ck(Q$2,
Z$1)
}
function Ik(e, t) {
var r = K$1;
K$1 |= 2;
var n = Jk();
for (Q$2 === e && Z$1 === t || (uk = null,
Kk(e, t)); ; )
try {
Tk();
break
} catch (e2) {
Mk(e, e2)
}
if ($g(),
K$1 = r,
mk.current = n,
null !== Y$1)
throw Error(p$6(261));
return Q$2 = null,
Z$1 = 0,
T$2
}
function Tk() {
for (; null !== Y$1; )
Uk(Y$1)
}
function Lk() {
for (; null !== Y$1 && !cc(); )
Uk(Y$1)
}
function Uk(e) {
var t = Vk(e.alternate, e, fj);
e.memoizedProps = e.pendingProps,
null === t ? Sk(e) : Y$1 = t,
nk.current = null
}
function Sk(e) {
var t = e;
do {
var r = t.alternate;
if (e = t.return,
32768 & t.flags) {
if (null !== (r = Ij(r, t)))
return r.flags &= 32767,
void (Y$1 = r);
if (null === e)
return T$2 = 6,
void (Y$1 = null);
e.flags |= 32768,
e.subtreeFlags = 0,
e.deletions = null
} else if (null !== (r = Ej(r, t, fj)))
return void (Y$1 = r);
if (null !== (t = t.sibling))
return void (Y$1 = t);
Y$1 = t = e
} while (null !== t);
0 === T$2 && (T$2 = 5)
}
function Pk(e, t, r) {
var n = C$2
, i = ok.transition;
try {
ok.transition = null,
C$2 = 1,
Wk(e, t, r, n)
} finally {
ok.transition = i,
C$2 = n
}
return null
}
function Wk(e, t, r, n) {
do {
Hk()
} while (null !== wk$1);
if (6 & K$1)
throw Error(p$6(327));
r = e.finishedWork;
var i = e.finishedLanes;
if (null === r)
return null;
if (e.finishedWork = null,
e.finishedLanes = 0,
r === e.current)
throw Error(p$6(177));
e.callbackNode = null,
e.callbackPriority = 0;
var o = r.lanes | r.childLanes;
if (Bc(e, o),
e === Q$2 && (Y$1 = Q$2 = null,
Z$1 = 0),
!(2064 & r.subtreeFlags) && !(2064 & r.flags) || vk || (vk = !0,
Fk(hc, (function() {
return Hk(),
null
}
))),
o = !!(15990 & r.flags),
15990 & r.subtreeFlags || o) {
o = ok.transition,
ok.transition = null;
var s = C$2;
C$2 = 1;
var a = K$1;
K$1 |= 4,
nk.current = null,
Oj(e, r),
dk(r, e),
Oe$1(Df),
dd = !!Cf,
Df = Cf = null,
e.current = r,
hk(r),
dc(),
K$1 = a,
C$2 = s,
ok.transition = o
} else
e.current = r;
if (vk && (vk = !1,
wk$1 = e,
xk = i),
0 === (o = e.pendingLanes) && (Ri$1 = null),
mc(r.stateNode),
Dk(e, B$2()),
null !== t)
for (n = e.onRecoverableError,
r = 0; r < t.length; r++)
n((i = t[r]).value, {
componentStack: i.stack,
digest: i.digest
});
if (Oi$1)
throw Oi$1 = !1,
e = Pi$1,
Pi$1 = null,
e;
return 1 & xk && 0 !== e.tag && Hk(),
1 & (o = e.pendingLanes) ? e === zk ? yk++ : (yk = 0,
zk = e) : yk = 0,
jg(),
null
}
function Hk() {
if (null !== wk$1) {
var e = Dc(xk)
, t = ok.transition
, r = C$2;
try {
if (ok.transition = null,
C$2 = 16 > e ? 16 : e,
null === wk$1)
var n = !1;
else {
if (e = wk$1,
wk$1 = null,
xk = 0,
6 & K$1)
throw Error(p$6(331));
var i = K$1;
for (K$1 |= 4,
V$1 = e.current; null !== V$1; ) {
var o = V$1
, s = o.child;
if (16 & V$1.flags) {
var a = o.deletions;
if (null !== a) {
for (var l = 0; l < a.length; l++) {
var c = a[l];
for (V$1 = c; null !== V$1; ) {
var u = V$1;
switch (u.tag) {
case 0:
case 11:
case 15:
Pj(8, u, o)
}
var d = u.child;
if (null !== d)
d.return = u,
V$1 = d;
else
for (; null !== V$1; ) {
var p = (u = V$1).sibling
, h = u.return;
if (Sj(u),
u === c) {
V$1 = null;
break
}
if (null !== p) {
p.return = h,
V$1 = p;
break
}
V$1 = h
}
}
}
var f = o.alternate;
if (null !== f) {
var m = f.child;
if (null !== m) {
f.child = null;
do {
var g = m.sibling;
m.sibling = null,
m = g
} while (null !== m)
}
}
V$1 = o
}
}
if (2064 & o.subtreeFlags && null !== s)
s.return = o,
V$1 = s;
else
e: for (; null !== V$1; ) {
if (2048 & (o = V$1).flags)
switch (o.tag) {
case 0:
case 11:
case 15:
Pj(9, o, o.return)
}
var y = o.sibling;
if (null !== y) {
y.return = o.return,
V$1 = y;
break e
}
V$1 = o.return
}
}
var v = e.current;
for (V$1 = v; null !== V$1; ) {
var b = (s = V$1).child;
if (2064 & s.subtreeFlags && null !== b)
b.return = s,
V$1 = b;
else
e: for (s = v; null !== V$1; ) {
if (2048 & (a = V$1).flags)
try {
switch (a.tag) {
case 0:
case 11:
case 15:
Qj(9, a)
}
} catch (_) {
W$2(a, a.return, _)
}
if (a === s) {
V$1 = null;
break e
}
var x = a.sibling;
if (null !== x) {
x.return = a.return,
V$1 = x;
break e
}
V$1 = a.return
}
}
if (K$1 = i,
jg(),
lc && "function" == typeof lc.onPostCommitFiberRoot)
try {
lc.onPostCommitFiberRoot(kc, e)
} catch (_) {}
n = !0
}
return n
} finally {
C$2 = r,
ok.transition = t
}
}
return !1
}
function Xk(e, t, r) {
e = nh$1(e, t = Ni$1(e, t = Ji$1(r, t), 1), 1),
t = R$1(),
null !== e && (Ac(e, 1, t),
Dk(e, t))
}
function W$2(e, t, r) {
if (3 === e.tag)
Xk(e, e, r);
else
for (; null !== t; ) {
if (3 === t.tag) {
Xk(t, e, r);
break
}
if (1 === t.tag) {
var n = t.stateNode;
if ("function" == typeof t.type.getDerivedStateFromError ||
"function" == typeof n.componentDidCatch && (null === Ri$1 || !Ri$1.has(n))) {
t = nh$1(t, e = Qi$1(t, e = Ji$1(r, e), 1), 1),
e = R$1(),
null !== t && (Ac(t, 1, e),
Dk(t, e));
break
}
}
t = t.return
}
}
function Ti$1(e, t, r) {
var n = e.pingCache;
null !== n && n.delete(t),
t = R$1(),
e.pingedLanes |= e.suspendedLanes & r,
Q$2 === e && (Z$1 & r) === r && (4 === T$2 || 3 === T$2 && (130023424 &
Z$1) === Z$1 && 500 > B$2() - fk ? Kk(e, 0) : rk |= r),
Dk(e, t)
}
function Yk(e, t) {
0 === t && (1 & e.mode ? (t = sc,
!(130023424 & (sc <<= 1)) && (sc = 4194304)) : t = 1);
var r = R$1();
null !== (e = ih$1(e, t)) && (Ac(e, t, r),
Dk(e, r))
}
function uj(e) {
var t = e.memoizedState
, r = 0;
null !== t && (r = t.retryLane),
Yk(e, r)
}
function bk(e, t) {
var r = 0;
switch (e.tag) {
case 13:
var n = e.stateNode
, i = e.memoizedState;
null !== i && (r = i.retryLane);
break;
case 19:
n = e.stateNode;
break;
default:
throw Error(p$6(314))
}
null !== n && n.delete(t),
Yk(e, r)
}
function Fk(e, t) {
return ac(e, t)
}
function $k(e, t, r, n) {
this.tag = e,
this.key = r,
this.sibling = this.child = this.return = this.stateNode = this.type =
this.elementType = null,
this.index = 0,
this.ref = null,
this.pendingProps = t,
this.dependencies = this.memoizedState = this.updateQueue =
this.memoizedProps = null,
this.mode = n,
this.subtreeFlags = this.flags = 0,
this.deletions = null,
this.childLanes = this.lanes = 0,
this.alternate = null
}
function Bg(e, t, r, n) {
return new $k(e,t,r,n)
}
function aj(e) {
return !(!(e = e.prototype) || !e.isReactComponent)
}
function Zk(e) {
if ("function" == typeof e)
return aj(e) ? 1 : 0;
if (null != e) {
if ((e = e.$$typeof) === Da$1)
return 11;
if (e === Ga$1)
return 14
}
return 2
}
function Pg(e, t) {
var r = e.alternate;
return null === r ? ((r = Bg(e.tag, t, e.key, e.mode)).elementType =
e.elementType,
r.type = e.type,
r.stateNode = e.stateNode,
r.alternate = e,
e.alternate = r) : (r.pendingProps = t,
r.type = e.type,
r.flags = 0,
r.subtreeFlags = 0,
r.deletions = null),
r.flags = 14680064 & e.flags,
r.childLanes = e.childLanes,
r.lanes = e.lanes,
r.child = e.child,
r.memoizedProps = e.memoizedProps,
r.memoizedState = e.memoizedState,
r.updateQueue = e.updateQueue,
t = e.dependencies,
r.dependencies = null === t ? null : {
lanes: t.lanes,
firstContext: t.firstContext
},
r.sibling = e.sibling,
r.index = e.index,
r.ref = e.ref,
r
}
function Rg(e, t, r, n, i, o) {
var s = 2;
if (n = e,
"function" == typeof e)
aj(e) && (s = 1);
else if ("string" == typeof e)
s = 5;
else
e: switch (e) {
case ya$1:
return Tg(r.children, i, o, t);
case za$1:
s = 8,
i |= 8;
break;
case Aa:
return (e = Bg(12, r, t, 2 | i)).elementType = Aa,
e.lanes = o,
e;
case Ea$1:
return (e = Bg(13, r, t, i)).elementType = Ea$1,
e.lanes = o,
e;
case Fa:
return (e = Bg(19, r, t, i)).elementType = Fa,
e.lanes = o,
e;
case Ia:
return pj(r, i, o, t);
default:
if ("object" == typeof e && null !== e)
switch (e.$$typeof) {
case Ba$1:
s = 10;
break e;
case Ca$1:
s = 9;
break e;
case Da$1:
s = 11;
break e;
case Ga$1:
s = 14;
break e;
case Ha$1:
s = 16,
n = null;
break e
}
throw Error(p$6(130, null == e ? e : typeof e, ""))
}
return (t = Bg(s, r, t, i)).elementType = e,
t.type = n,
t.lanes = o,
t
}
function Tg(e, t, r, n) {
return (e = Bg(7, e, n, t)).lanes = r,
e
}
function pj(e, t, r, n) {
return (e = Bg(22, e, n, t)).elementType = Ia,
e.lanes = r,
e.stateNode = {
isHidden: !1
},
e
}
function Qg(e, t, r) {
return (e = Bg(6, e, null, t)).lanes = r,
e
}
function Sg(e, t, r) {
return (t = Bg(4, null !== e.children ? e.children : [], e.key,
t)).lanes = r,
t.stateNode = {
containerInfo: e.containerInfo,
pendingChildren: null,
implementation: e.implementation
},
t
}
function al(e, t, r, n, i) {
this.tag = t,
this.containerInfo = e,
this.finishedWork = this.pingCache = this.current =
this.pendingChildren = null,
this.timeoutHandle = -1,
this.callbackNode = this.pendingContext = this.context = null,
this.callbackPriority = 0,
this.eventTimes = zc(0),
this.expirationTimes = zc(-1),
this.entangledLanes = this.finishedLanes = this.mutableReadLanes =
this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0,
this.entanglements = zc(0),
this.identifierPrefix = n,
this.onRecoverableError = i,
this.mutableSourceEagerHydrationData = null
}
function bl(e, t, r, n, i, o, s, a, l) {
return e = new al(e,t,r,a,l),
1 === t ? (t = 1,
!0 === o && (t |= 8)) : t = 0,
o = Bg(3, null, null, t),
e.current = o,
o.stateNode = e,
o.memoizedState = {
element: n,
isDehydrated: r,
cache: null,
transitions: null,
pendingSuspenseBoundaries: null
},
kh$1(o),
e
}
function cl(e, t, r) {
var n = 3 < arguments.length && void 0 !== arguments[3] ?
arguments[3] : null;
return {
$$typeof: wa$1,
key: null == n ? null : "" + n,
children: e,
containerInfo: t,
implementation: r
}
}
function dl(e) {
if (!e)
return Vf;
e: {
if (Vb(e = e._reactInternals) !== e || 1 !== e.tag)
throw Error(p$6(170));
var t = e;
do {
switch (t.tag) {
case 3:
t = t.stateNode.context;
break e;
case 1:
if (Zf(t.type)) {
t =
t.stateNode.__reactInternalMemoizedMergedChildContext;
break e
}
}
t = t.return
} while (null !== t);
throw Error(p$6(171))
}
if (1 === e.tag) {
var r = e.type;
if (Zf(r))
return bg$1(e, r, t)
}
return t
}
function el(e, t, r, n, i, o, s, a, l) {
return (e = bl(r, n, !0, e, i, o, s, a, l)).context = dl(null),
r = e.current,
(o = mh$1(n = R$1(), i = yi$1(r))).callback = null != t ? t : null,
nh$1(r, o, i),
e.current.lanes = i,
Ac(e, i, n),
Dk(e, n),
e
}
function fl$1(e, t, r, n) {
var i = t.current
, o = R$1()
, s = yi$1(i);
return r = dl(r),
null === t.context ? t.context = r : t.pendingContext = r,
(t = mh$1(o, s)).payload = {
element: e
},
null !== (n = void 0 === n ? null : n) && (t.callback = n),
null !== (e = nh$1(i, t, s)) && (gi$1(e, i, s, o),
oh$1(e, i, s)),
s
}
function gl(e) {
return (e = e.current).child ? (e.child.tag,
e.child.stateNode) : null
}
function hl(e, t) {
if (null !== (e = e.memoizedState) && null !== e.dehydrated) {
var r = e.retryLane;
e.retryLane = 0 !== r && r < t ? r : t
}
}
function il(e, t) {
hl(e, t),
(e = e.alternate) && hl(e, t)
}
function jl() {
return null
}
Vk = function(e, t, r) {
if (null !== e)
if (e.memoizedProps !== t.pendingProps || Wf.current)
dh$1 = !0;
else {
if (!(e.lanes & r || 128 & t.flags))
return dh$1 = !1,
yj(e, t, r);
dh$1 = !!(131072 & e.flags)
}
else
dh$1 = !1,
I$1 && 1048576 & t.flags && ug(t, ng, t.index);
switch (t.lanes = 0,
t.tag) {
case 2:
var n = t.type;
ij(e, t),
e = t.pendingProps;
var i = Yf(t, H$2.current);
ch$2(t, r),
i = Nh$1(null, t, n, e, i, r);
var o = Sh$1();
return t.flags |= 1,
"object" == typeof i && null !== i && "function" == typeof i.render
&& void 0 === i.$$typeof ? (t.tag = 1,
t.memoizedState = null,
t.updateQueue = null,
Zf(n) ? (o = !0,
cg(t)) : o = !1,
t.memoizedState = null !== i.state && void 0 !== i.state ?
i.state : null,
kh$1(t),
i.updater = Ei$1,
t.stateNode = i,
i._reactInternals = t,
Ii$1(t, n, e, r),
t = jj(null, t, n, !0, o, r)) : (t.tag = 0,
I$1 && o && vg(t),
Xi$1(null, t, i, r),
t = t.child),
t;
case 16:
n = t.elementType;
e: {
switch (ij(e, t),
e = t.pendingProps,
n = (i = n._init)(n._payload),
t.type = n,
i = t.tag = Zk(n),
e = Ci$1(n, e),
i) {
case 0:
t = cj(null, t, n, e, r);
break e;
case 1:
t = hj(null, t, n, e, r);
break e;
case 11:
t = Yi$1(null, t, n, e, r);
break e;
case 14:
t = $i$1(null, t, n, Ci$1(n.type, e), r);
break e
}
throw Error(p$6(306, n, ""))
}
return t;
case 0:
return n = t.type,
i = t.pendingProps,
cj(e, t, n, i = t.elementType === n ? i : Ci$1(n, i), r);
case 1:
return n = t.type,
i = t.pendingProps,
hj(e, t, n, i = t.elementType === n ? i : Ci$1(n, i), r);
case 3:
e: {
if (kj(t),
null === e)
throw Error(p$6(387));
n = t.pendingProps,
i = (o = t.memoizedState).element,
lh$1(e, t),
qh(t, n, null, r);
var s = t.memoizedState;
if (n = s.element,
o.isDehydrated) {
if (o = {
element: n,
isDehydrated: !1,
cache: s.cache,
pendingSuspenseBoundaries: s.pendingSuspenseBoundaries,
transitions: s.transitions
},
t.updateQueue.baseState = o,
t.memoizedState = o,
256 & t.flags) {
t = lj(e, t, n, r, i = Ji$1(Error(p$6(423)), t));
break e
}
if (n !== i) {
t = lj(e, t, n, r, i = Ji$1(Error(p$6(424)), t));
break e
}
for (yg = Lf(t.stateNode.containerInfo.firstChild),
xg = t,
I$1 = !0,
zg = null,
r = Vg(t, null, n, r),
t.child = r; r; )
r.flags = -3 & r.flags | 4096,
r = r.sibling
} else {
if (Ig(),
n === i) {
t = Zi$1(e, t, r);
break e
}
Xi$1(e, t, n, r)
}
t = t.child
}
return t;
case 5:
return Ah$1(t),
null === e && Eg(t),
n = t.type,
i = t.pendingProps,
o = null !== e ? e.memoizedProps : null,
s = i.children,
Ef(n, i) ? s = null : null !== o && Ef(n, o) && (t.flags |= 32),
gj(e, t),
Xi$1(e, t, s, r),
t.child;
case 6:
return null === e && Eg(t),
null;
case 13:
return oj(e, t, r);
case 4:
return yh$1(t, t.stateNode.containerInfo),
n = t.pendingProps,
null === e ? t.child = Ug(t, null, n, r) : Xi$1(e, t, n, r),
t.child;
case 11:
return n = t.type,
i = t.pendingProps,
Yi$1(e, t, n, i = t.elementType === n ? i : Ci$1(n, i), r);
case 7:
return Xi$1(e, t, t.pendingProps, r),
t.child;
case 8:
case 12:
return Xi$1(e, t, t.pendingProps.children, r),
t.child;
case 10:
e: {
if (n = t.type._context,
i = t.pendingProps,
o = t.memoizedProps,
s = i.value,
G$2(Wg, n._currentValue),
n._currentValue = s,
null !== o)
if (He$1(o.value, s)) {
if (o.children === i.children && !Wf.current) {
t = Zi$1(e, t, r);
break e
}
} else
for (null !== (o = t.child) && (o.return = t); null !==
o; ) {
var a = o.dependencies;
if (null !== a) {
s = o.child;
for (var l = a.firstContext; null !== l; ) {
if (l.context === n) {
if (1 === o.tag) {
(l = mh$1(-1, r & -r)).tag = 2;
var c = o.updateQueue;
if (null !== c) {
var u = (c = c.shared).pending;
null === u ? l.next = l :
(l.next = u.next,
u.next = l),
c.pending = l
}
}
o.lanes |= r,
null !== (l = o.alternate) && (l.lanes
|= r),
bh$1(o.return, r, t),
a.lanes |= r;
break
}
l = l.next
}
} else if (10 === o.tag)
s = o.type === t.type ? null : o.child;
else if (18 === o.tag) {
if (null === (s = o.return))
throw Error(p$6(341));
s.lanes |= r,
null !== (a = s.alternate) && (a.lanes |= r),
bh$1(s, r, t),
s = o.sibling
} else
s = o.child;
if (null !== s)
s.return = o;
else
for (s = o; null !== s; ) {
if (s === t) {
s = null;
break
}
if (null !== (o = s.sibling)) {
o.return = s.return,
s = o;
break
}
s = s.return
}
o = s
}
Xi$1(e, t, i.children, r),
t = t.child
}
return t;
case 9:
return i = t.type,
n = t.pendingProps.children,
ch$2(t, r),
n = n(i = eh$1(i)),
t.flags |= 1,
Xi$1(e, t, n, r),
t.child;
case 14:
return i = Ci$1(n = t.type, t.pendingProps),
$i$1(e, t, n, i = Ci$1(n.type, i), r);
case 15:
return bj(e, t, t.type, t.pendingProps, r);
case 17:
return n = t.type,
i = t.pendingProps,
i = t.elementType === n ? i : Ci$1(n, i),
ij(e, t),
t.tag = 1,
Zf(n) ? (e = !0,
cg(t)) : e = !1,
ch$2(t, r),
Gi$1(t, n, i),
Ii$1(t, n, i, r),
jj(null, t, n, !0, e, r);
case 19:
return xj(e, t, r);
case 22:
return dj(e, t, r)
}
throw Error(p$6(156, t.tag))
}
;
var kl = "function" == typeof reportError ? reportError : function(e) {}
;
function ll(e) {
this._internalRoot = e
}
function ml(e) {
this._internalRoot = e
}
function nl(e) {
return !(!e || 1 !== e.nodeType && 9 !== e.nodeType && 11 !==
e.nodeType)
}
function ol(e) {
return !(!e || 1 !== e.nodeType && 9 !== e.nodeType && 11 !==
e.nodeType && (8 !== e.nodeType || " react-mount-point-unstable " !== e.nodeValue))
}
function pl() {}
function ql(e, t, r, n, i) {
if (i) {
if ("function" == typeof n) {
var o = n;
n = function() {
var e = gl(s);
o.call(e)
}
}
var s = el(t, n, e, 0, null, !1, !1, "", pl);
return e._reactRootContainer = s,
e[uf] = s.current,
sf(8 === e.nodeType ? e.parentNode : e),
Rk(),
s
}
for (; i = e.lastChild; )
e.removeChild(i);
if ("function" == typeof n) {
var a = n;
n = function() {
var e = gl(l);
a.call(e)
}
}
var l = bl(e, 0, !1, null, null, !1, !1, "", pl);
return e._reactRootContainer = l,
e[uf] = l.current,
sf(8 === e.nodeType ? e.parentNode : e),
Rk((function() {
fl$1(t, l, r, n)
}
)),
l
}
function rl(e, t, r, n, i) {
var o = r._reactRootContainer;
if (o) {
var s = o;
if ("function" == typeof i) {
var a = i;
i = function() {
var e = gl(s);
a.call(e)
}
}
fl$1(t, s, e, i)
} else
s = ql(r, t, e, i, n);
return gl(s)
}
ml.prototype.render = ll.prototype.render = function(e) {
var t = this._internalRoot;
if (null === t)
throw Error(p$6(409));
fl$1(e, t, null, null)
}
,
ml.prototype.unmount = ll.prototype.unmount = function() {
var e = this._internalRoot;
if (null !== e) {
this._internalRoot = null;
var t = e.containerInfo;
Rk((function() {
fl$1(null, e, null, null)
}
)),
t[uf] = null
}
}
,
ml.prototype.unstable_scheduleHydration = function(e) {
if (e) {
var t = Hc();
e = {
blockedOn: null,
target: e,
priority: t
};
for (var r = 0; r < Qc.length && 0 !== t && t < Qc[r].priority; r+
+)
;
Qc.splice(r, 0, e),
0 === r && Vc(e)
}
}
,
Ec = function(e) {
switch (e.tag) {
case 3:
var t = e.stateNode;
if (t.current.memoizedState.isDehydrated) {
var r = tc(t.pendingLanes);
0 !== r && (Cc(t, 1 | r),
Dk(t, B$2()),
!(6 & K$1) && (Gj = B$2() + 500,
jg()))
}
break;
case 13:
Rk((function() {
var t = ih$1(e, 1);
if (null !== t) {
var r = R$1();
gi$1(t, e, 1, r)
}
}
)),
il(e, 1)
}
}
,
Fc = function(e) {
if (13 === e.tag) {
var t = ih$1(e, 134217728);
if (null !== t)
gi$1(t, e, 134217728, R$1());
il(e, 134217728)
}
}
,
Gc = function(e) {
if (13 === e.tag) {
var t = yi$1(e)
, r = ih$1(e, t);
if (null !== r)
gi$1(r, e, t, R$1());
il(e, t)
}
}
,
Hc = function() {
return C$2
}
,
Ic = function(e, t) {
var r = C$2;
try {
return C$2 = e,
t()
} finally {
C$2 = r
}
}
,
yb = function(e, t, r) {
switch (t) {
case "input":
if (bb(e, r),
t = r.name,
"radio" === r.type && null != t) {
for (r = e; r.parentNode; )
r = r.parentNode;
for (r = r.querySelectorAll("input[name=" + JSON.stringify("" +
t) + '][type="radio"]'),
t = 0; t < r.length; t++) {
var n = r[t];
if (n !== e && n.form === e.form) {
var i = Db(n);
if (!i)
throw Error(p$6(90));
Wa$1(n),
bb(n, i)
}
}
}
break;
case "textarea":
ib(e, r);
break;
case "select":
null != (t = r.value) && fb(e, !!r.multiple, t, !1)
}
}
,
Gb = Qk,
Hb = Rk;
var sl = {
usingClientEntryPoint: !1,
Events: [Cb, ue$2, Db, Eb, Fb, Qk]
}
, tl = {
findFiberByHostInstance: Wc,
bundleType: 0,
version: "18.3.1",
rendererPackageName: "react-dom"
}
, ul$1 = {
bundleType: tl.bundleType,
version: tl.version,
rendererPackageName: tl.rendererPackageName,
rendererConfig: tl.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
overrideProps: null,
overridePropsDeletePath: null,
overridePropsRenamePath: null,
setErrorHandler: null,
setSuspenseHandler: null,
scheduleUpdate: null,
currentDispatcherRef: ua.ReactCurrentDispatcher,
findHostInstanceByFiber: function(e) {
return null === (e = Zb(e)) ? null : e.stateNode
},
findFiberByHostInstance: tl.findFiberByHostInstance || jl,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.1-next-f1338f8080-20240426"
};
if ("undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var vl = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (!vl.isDisabled && vl.supportsFiber)
try {
kc = vl.inject(ul$1),
lc = vl
} catch (a2) {}
}
function checkDCE() {
if ("undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function"
== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)
try {
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)
} catch (e) {}
}
reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
= sl,
reactDom_production_min.createPortal = function(e, t) {
var r = 2 < arguments.length && void 0 !== arguments[2] ?
arguments[2] : null;
if (!nl(t))
throw Error(p$6(200));
return cl(e, t, null, r)
}
,
reactDom_production_min.createRoot = function(e, t) {
if (!nl(e))
throw Error(p$6(299));
var r = !1
, n = ""
, i = kl;
return null != t && (!0 === t.unstable_strictMode && (r = !0),
void 0 !== t.identifierPrefix && (n = t.identifierPrefix),
void 0 !== t.onRecoverableError && (i = t.onRecoverableError)),
t = bl(e, 1, !1, null, null, r, !1, n, i),
e[uf] = t.current,
sf(8 === e.nodeType ? e.parentNode : e),
new ll(t)
}
,
reactDom_production_min.findDOMNode = function(e) {
if (null == e)
return null;
if (1 === e.nodeType)
return e;
var t = e._reactInternals;
if (void 0 === t) {
if ("function" == typeof e.render)
throw Error(p$6(188));
throw e = Object.keys(e).join(","),
Error(p$6(268, e))
}
return e = null === (e = Zb(t)) ? null : e.stateNode
}
,
reactDom_production_min.flushSync = function(e) {
return Rk(e)
}
,
reactDom_production_min.hydrate = function(e, t, r) {
if (!ol(t))
throw Error(p$6(200));
return rl(null, e, t, !0, r)
}
,
reactDom_production_min.hydrateRoot = function(e, t, r) {
if (!nl(e))
throw Error(p$6(405));
var n = null != r && r.hydratedSources || null
, i = !1
, o = ""
, s = kl;
if (null != r && (!0 === r.unstable_strictMode && (i = !0),
void 0 !== r.identifierPrefix && (o = r.identifierPrefix),
void 0 !== r.onRecoverableError && (s = r.onRecoverableError)),
t = el(t, null, e, 1, null != r ? r : null, i, !1, o, s),
e[uf] = t.current,
sf(e),
n)
for (e = 0; e < n.length; e++)
i = (i = (r = n[e])._getVersion)(r._source),
null == t.mutableSourceEagerHydrationData ?
t.mutableSourceEagerHydrationData = [r, i] :
t.mutableSourceEagerHydrationData.push(r, i);
return new ml(t)
}
,
reactDom_production_min.render = function(e, t, r) {
if (!ol(t))
throw Error(p$6(200));
return rl(null, e, t, !1, r)
}
,
reactDom_production_min.unmountComponentAtNode = function(e) {
if (!ol(e))
throw Error(p$6(40));
return !!e._reactRootContainer && (Rk((function() {
rl(null, null, e, !1, (function() {
e._reactRootContainer = null,
e[uf] = null
}
))
}
)),
!0)
}
,
reactDom_production_min.unstable_batchedUpdates = Qk,
reactDom_production_min.unstable_renderSubtreeIntoContainer = function(e,
t, r, n) {
if (!ol(r))
throw Error(p$6(200));
if (null == e || void 0 === e._reactInternals)
throw Error(p$6(38));
return rl(e, t, r, !1, n)
}
,
reactDom_production_min.version = "18.3.1-next-f1338f8080-20240426",
checkDCE(),
reactDom.exports = reactDom_production_min;
var reactDomExports = reactDom.exports;
const ReactDOM = getDefaultExportFromCjs(reactDomExports);
var m$7 = reactDomExports;
client.createRoot = m$7.createRoot,
client.hydrateRoot = m$7.hydrateRoot;
const theme$1 = "";
var axios$3 = {
exports: {}
}
, bind$4 = function(e, t) {
return function() {
for (var r = new Array(arguments.length), n = 0; n < r.length; n++)
r[n] = arguments[n];
return e.apply(t, r)
}
}
, bind$3 = bind$4
, toString$7 = Object.prototype.toString;
function isArray$r(e) {
return "[object Array]" === toString$7.call(e)
}
function isUndefined$4(e) {
return void 0 === e
}
function isBuffer$a(e) {
return null !== e && !isUndefined$4(e) && null !== e.constructor && !
isUndefined$4(e.constructor) && "function" == typeof e.constructor.isBuffer &&
e.constructor.isBuffer(e)
}
function isArrayBuffer(e) {
return "[object ArrayBuffer]" === toString$7.call(e)
}
function isFormData(e) {
return "undefined" != typeof FormData && e instanceof FormData
}
function isArrayBufferView(e) {
return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ?
ArrayBuffer.isView(e) : e && e.buffer && e.buffer instanceof ArrayBuffer
}
function isString$5(e) {
return "string" == typeof e
}
function isNumber$6(e) {
return "number" == typeof e
}
function isObject$k(e) {
return null !== e && "object" == typeof e
}
function isPlainObject$7(e) {
if ("[object Object]" !== toString$7.call(e))
return !1;
var t = Object.getPrototypeOf(e);
return null === t || t === Object.prototype
}
function isDate$4(e) {
return "[object Date]" === toString$7.call(e)
}
function isFile(e) {
return "[object File]" === toString$7.call(e)
}
function isBlob(e) {
return "[object Blob]" === toString$7.call(e)
}
function isFunction$9(e) {
return "[object Function]" === toString$7.call(e)
}
function isStream(e) {
return isObject$k(e) && isFunction$9(e.pipe)
}
function isURLSearchParams(e) {
return "undefined" != typeof URLSearchParams && e instanceof
URLSearchParams
}
function trim(e) {
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
}
function isStandardBrowserEnv() {
return ("undefined" == typeof navigator || "ReactNative" !==
navigator.product && "NativeScript" !== navigator.product && "NS" !==
navigator.product) && ("undefined" != typeof window && "undefined" != typeof
document)
}
function forEach$3(e, t) {
if (null != e)
if ("object" != typeof e && (e = [e]),
isArray$r(e))
for (var r = 0, n = e.length; r < n; r++)
t.call(null, e[r], r, e);
else
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && t.call(null,
e[i], i, e)
}
function merge$4() {
var e = {};
function t(t, r) {
isPlainObject$7(e[r]) && isPlainObject$7(t) ? e[r] = merge$4(e[r],
t) : isPlainObject$7(t) ? e[r] = merge$4({}, t) : isArray$r(t) ? e[r] = t.slice() :
e[r] = t
}
for (var r = 0, n = arguments.length; r < n; r++)
forEach$3(arguments[r], t);
return e
}
function extend(e, t, r) {
return forEach$3(t, (function(t, n) {
e[n] = r && "function" == typeof t ? bind$3(t, r) : t
}
)),
e
}
function stripBOM(e) {
return 65279 === e.charCodeAt(0) && (e = e.slice(1)),
e
}
var utils$e = {
isArray: isArray$r,
isArrayBuffer: isArrayBuffer,
isBuffer: isBuffer$a,
isFormData: isFormData,
isArrayBufferView: isArrayBufferView,
isString: isString$5,
isNumber: isNumber$6,
isObject: isObject$k,
isPlainObject: isPlainObject$7,
isUndefined: isUndefined$4,
isDate: isDate$4,
isFile: isFile,
isBlob: isBlob,
isFunction: isFunction$9,
isStream: isStream,
isURLSearchParams: isURLSearchParams,
isStandardBrowserEnv: isStandardBrowserEnv,
forEach: forEach$3,
merge: merge$4,
extend: extend,
trim: trim,
stripBOM: stripBOM
}
, utils$d = utils$e;
function encode$1(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g,
"$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi,
"[").replace(/%5D/gi, "]")
}
var buildURL$1 = function(e, t, r) {
if (!t)
return e;
var n;
if (r)
n = r(t);
else if (utils$d.isURLSearchParams(t))
n = t.toString();
else {
var i = [];
utils$d.forEach(t, (function(e, t) {
null != e && (utils$d.isArray(e) ? t += "[]" : e = [e],
utils$d.forEach(e, (function(e) {
utils$d.isDate(e) ? e = e.toISOString() :
utils$d.isObject(e) && (e = JSON.stringify(e)),
i.push(encode$1(t) + "=" + encode$1(e))
}
)))
}
)),
n = i.join("&")
}
if (n) {
var o = e.indexOf("#");
-1 !== o && (e = e.slice(0, o)),
e += (-1 === e.indexOf("?") ? "?" : "&") + n
}
return e
}
, utils$c = utils$e;
function InterceptorManager$1() {
this.handlers = []
}
InterceptorManager$1.prototype.use = function(e, t, r) {
return this.handlers.push({
fulfilled: e,
rejected: t,
synchronous: !!r && r.synchronous,
runWhen: r ? r.runWhen : null
}),
this.handlers.length - 1
}
,
InterceptorManager$1.prototype.eject = function(e) {
this.handlers[e] && (this.handlers[e] = null)
}
,
InterceptorManager$1.prototype.forEach = function(e) {
utils$c.forEach(this.handlers, (function(t) {
null !== t && e(t)
}
))
}
;
var InterceptorManager_1 = InterceptorManager$1, utils$b = utils$e,
normalizeHeaderName = function(e, t) {
utils$b.forEach(e, (function(r, n) {
n !== t && n.toUpperCase() === t.toUpperCase() && (e[t] = r,
delete e[n])
}
))
}, enhanceError = function(e, t, r, n, i) {
return e.config = t,
r && (e.code = r),
e.request = n,
e.response = i,
e.isAxiosError = !0,
e.toJSON = function() {
return {
message: this.message,
name: this.name,
description: this.description,
number: this.number,
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
config: this.config,
code: this.code,
status: this.response && this.response.status ?
this.response.status : null
}
}
,
e
}, createError, hasRequiredCreateError, settle, hasRequiredSettle, cookies,
hasRequiredCookies, isAbsoluteURL, hasRequiredIsAbsoluteURL, combineURLs,
hasRequiredCombineURLs, buildFullPath, hasRequiredBuildFullPath, parseHeaders,
hasRequiredParseHeaders, isURLSameOrigin, hasRequiredIsURLSameOrigin, Cancel_1,
hasRequiredCancel, xhr, hasRequiredXhr, defaults_1, hasRequiredDefaults;
function requireCreateError() {
if (hasRequiredCreateError)
return createError;
hasRequiredCreateError = 1;
var e = enhanceError;
return createError = function(t, r, n, i, o) {
var s = new Error(t);
return e(s, r, n, i, o)
}
}
function requireSettle() {
if (hasRequiredSettle)
return settle;
hasRequiredSettle = 1;
var e = requireCreateError();
return settle = function(t, r, n) {
var i = n.config.validateStatus;
n.status && i && !i(n.status) ? r(e("Request failed with status
code " + n.status, n.config, null, n.request, n)) : t(n)
}
}
function requireCookies() {
if (hasRequiredCookies)
return cookies;
hasRequiredCookies = 1;
var e = utils$e;
return cookies = e.isStandardBrowserEnv() ? {
write: function(t, r, n, i, o, s) {
var a = [];
a.push(t + "=" + encodeURIComponent(r)),
e.isNumber(n) && a.push("expires=" + new
Date(n).toGMTString()),
e.isString(i) && a.push("path=" + i),
e.isString(o) && a.push("domain=" + o),
!0 === s && a.push("secure"),
document.cookie = a.join("; ")
},
read: function(e) {
var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e +
")=([^;]*)"));
return t ? decodeURIComponent(t[3]) : null
},
remove: function(e) {
this.write(e, "", Date.now() - 864e5)
}
} : {
write: function() {},
read: function() {
return null
},
remove: function() {}
}
}
function requireIsAbsoluteURL() {
return hasRequiredIsAbsoluteURL ? isAbsoluteURL :
(hasRequiredIsAbsoluteURL = 1,
isAbsoluteURL = function(e) {
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)
}
)
}
function requireCombineURLs() {
return hasRequiredCombineURLs ? combineURLs : (hasRequiredCombineURLs =
1,
combineURLs = function(e, t) {
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e
}
)
}
function requireBuildFullPath() {
if (hasRequiredBuildFullPath)
return buildFullPath;
hasRequiredBuildFullPath = 1;
var e = requireIsAbsoluteURL()
, t = requireCombineURLs();
return buildFullPath = function(r, n) {
return r && !e(n) ? t(r, n) : n
}
}
function requireParseHeaders() {
if (hasRequiredParseHeaders)
return parseHeaders;
hasRequiredParseHeaders = 1;
var e = utils$e
, t = ["age", "authorization", "content-length", "content-type",
"etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since",
"last-modified", "location", "max-forwards", "proxy-authorization", "referer",
"retry-after", "user-agent"];
return parseHeaders = function(r) {
var n, i, o, s = {};
return r ? (e.forEach(r.split("\n"), (function(r) {
if (o = r.indexOf(":"),
n = e.trim(r.substr(0, o)).toLowerCase(),
i = e.trim(r.substr(o + 1)),
n) {
if (s[n] && t.indexOf(n) >= 0)
return;
s[n] = "set-cookie" === n ? (s[n] ? s[n] :
[]).concat([i]) : s[n] ? s[n] + ", " + i : i
}
}
)),
s) : s
}
}
function requireIsURLSameOrigin() {
if (hasRequiredIsURLSameOrigin)
return isURLSameOrigin;
hasRequiredIsURLSameOrigin = 1;
var e = utils$e;
return isURLSameOrigin = e.isStandardBrowserEnv() ? function() {
var t, r = /(msie|trident)/i.test(navigator.userAgent), n =
document.createElement("a");
function i(e) {
var t = e;
return r && (n.setAttribute("href", t),
t = n.href),
n.setAttribute("href", t),
{
href: n.href,
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
host: n.host,
search: n.search ? n.search.replace(/^\?/, "") : "",
hash: n.hash ? n.hash.replace(/^#/, "") : "",
hostname: n.hostname,
port: n.port,
pathname: "/" === n.pathname.charAt(0) ? n.pathname : "/" +
n.pathname
}
}
return t = i(window.location.href),
function(r) {
var n = e.isString(r) ? i(r) : r;
return n.protocol === t.protocol && n.host === t.host
}
}() : function() {
return !0
}
}
function requireCancel() {
if (hasRequiredCancel)
return Cancel_1;
function e(e) {
this.message = e
}
return hasRequiredCancel = 1,
e.prototype.toString = function() {
return "Cancel" + (this.message ? ": " + this.message : "")
}
,
e.prototype.__CANCEL__ = !0,
Cancel_1 = e
}
function requireXhr() {
if (hasRequiredXhr)
return xhr;
hasRequiredXhr = 1;
var e = utils$e
, t = requireSettle()
, r = requireCookies()
, n = buildURL$1
, i = requireBuildFullPath()
, o = requireParseHeaders()
, s = requireIsURLSameOrigin()
, a = requireCreateError()
, l = requireDefaults()
, c = requireCancel();
return xhr = function(u) {
return new Promise((function(d, p) {
var h, f = u.data, m = u.headers, g = u.responseType;
function y() {
u.cancelToken && u.cancelToken.unsubscribe(h),
u.signal && u.signal.removeEventListener("abort", h)
}
e.isFormData(f) && delete m["Content-Type"];
var v = new XMLHttpRequest;
if (u.auth) {
var b = u.auth.username || ""
, x = u.auth.password ?
unescape(encodeURIComponent(u.auth.password)) : "";
m.Authorization = "Basic " + btoa(b + ":" + x)
}
var _ = i(u.baseURL, u.url);
function E() {
if (v) {
var e = "getAllResponseHeaders"in v ?
o(v.getAllResponseHeaders()) : null
, r = {
data: g && "text" !== g && "json" !== g ?
v.response : v.responseText,
status: v.status,
statusText: v.statusText,
headers: e,
config: u,
request: v
};
t((function(e) {
d(e),
y()
}
), (function(e) {
p(e),
y()
}
), r),
v = null
}
}
if (v.open(u.method.toUpperCase(), n(_, u.params,
u.paramsSerializer), !0),
v.timeout = u.timeout,
"onloadend"in v ? v.onloadend = E : v.onreadystatechange =
function() {
v && 4 === v.readyState && (0 !== v.status || v.responseURL
&& 0 === v.responseURL.indexOf("file:")) && setTimeout(E)
}
,
v.onabort = function() {
v && (p(a("Request aborted", u, "ECONNABORTED", v)),
v = null)
}
,
v.onerror = function() {
p(a("Network Error", u, null, v)),
v = null
}
,
v.ontimeout = function() {
var e = u.timeout ? "timeout of " + u.timeout + "ms
exceeded" : "timeout exceeded"
, t = u.transitional || l.transitional;
u.timeoutErrorMessage && (e = u.timeoutErrorMessage),
p(a(e, u, t.clarifyTimeoutError ? "ETIMEDOUT" :
"ECONNABORTED", v)),
v = null
}
,
e.isStandardBrowserEnv()) {
var T = (u.withCredentials || s(_)) && u.xsrfCookieName ?
r.read(u.xsrfCookieName) : void 0;
T && (m[u.xsrfHeaderName] = T)
}
"setRequestHeader"in v && e.forEach(m, (function(e, t) {
void 0 === f && "content-type" === t.toLowerCase() ? delete
m[t] : v.setRequestHeader(t, e)
}
)),
e.isUndefined(u.withCredentials) || (v.withCredentials = !!
u.withCredentials),
g && "json" !== g && (v.responseType = u.responseType),
"function" == typeof u.onDownloadProgress &&
v.addEventListener("progress", u.onDownloadProgress),
"function" == typeof u.onUploadProgress && v.upload &&
v.upload.addEventListener("progress", u.onUploadProgress),
(u.cancelToken || u.signal) && (h = function(e) {
v && (p(!e || e && e.type ? new c("canceled") : e),
v.abort(),
v = null)
}
,
u.cancelToken && u.cancelToken.subscribe(h),
u.signal && (u.signal.aborted ? h() :
u.signal.addEventListener("abort", h))),
f || (f = null),
v.send(f)
}
))
}
}
function requireDefaults() {
if (hasRequiredDefaults)
return defaults_1;
hasRequiredDefaults = 1;
var e = utils$e
, t = normalizeHeaderName
, r = enhanceError
, n = {
"Content-Type": "application/x-www-form-urlencoded"
};
function i(t, r) {
!e.isUndefined(t) && e.isUndefined(t["Content-Type"]) &&
(t["Content-Type"] = r)
}
var o, s = {
transitional: {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
},
adapter: (("undefined" != typeof XMLHttpRequest || "undefined" !=
typeof process && "[object process]" === Object.prototype.toString.call(process))
&& (o = requireXhr()),
o),
transformRequest: [function(r, n) {
return t(n, "Accept"),
t(n, "Content-Type"),
e.isFormData(r) || e.isArrayBuffer(r) || e.isBuffer(r) ||
e.isStream(r) || e.isFile(r) || e.isBlob(r) ? r : e.isArrayBufferView(r) ? r.buffer
: e.isURLSearchParams(r) ? (i(n, "application/x-www-form-urlencoded;charset=utf-
8"),
r.toString()) : e.isObject(r) || n && "application/json" ===
n["Content-Type"] ? (i(n, "application/json"),
function(t, r, n) {
if (e.isString(t))
try {
return (r || JSON.parse)(t),
e.trim(t)
} catch (e2) {
if ("SyntaxError" !== e2.name)
throw e2
}
return (n || JSON.stringify)(t)
}(r)) : r
}
],
transformResponse: [function(t) {
var n = this.transitional || s.transitional
, i = n && n.silentJSONParsing
, o = n && n.forcedJSONParsing
, a = !i && "json" === this.responseType;
if (a || o && e.isString(t) && t.length)
try {
return JSON.parse(t)
} catch (e2) {
if (a) {
if ("SyntaxError" === e2.name)
throw r(e2, this, "E_JSON_PARSE");
throw e2
}
}
return t
}
],
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: function(e) {
return e >= 200 && e < 300
},
headers: {
common: {
Accept: "application/json, text/plain, */*"
}
}
};
return e.forEach(["delete", "get", "head"], (function(e) {
s.headers[e] = {}
}
)),
e.forEach(["post", "put", "patch"], (function(t) {
s.headers[t] = e.merge(n)
}
)),
defaults_1 = s
}
var utils$a = utils$e, defaults$4 = requireDefaults(), transformData$1 =
function(e, t, r) {
var n = this || defaults$4;
return utils$a.forEach(r, (function(r) {
e = r.call(n, e, t)
}
)),
e
}, isCancel$1, hasRequiredIsCancel;
function requireIsCancel() {
return hasRequiredIsCancel ? isCancel$1 : (hasRequiredIsCancel = 1,
isCancel$1 = function(e) {
return !(!e || !e.__CANCEL__)
}
)
}
var utils$9 = utils$e
, transformData = transformData$1
, isCancel = requireIsCancel()
, defaults$3 = requireDefaults()
, Cancel = requireCancel();
function throwIfCancellationRequested(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(),
e.signal && e.signal.aborted)
throw new Cancel("canceled")
}
var dispatchRequest$1 = function(e) {
return throwIfCancellationRequested(e),
e.headers = e.headers || {},
e.data = transformData.call(e, e.data, e.headers, e.transformRequest),
e.headers = utils$9.merge(e.headers.common || {}, e.headers[e.method]
|| {}, e.headers),
utils$9.forEach(["delete", "get", "head", "post", "put", "patch",
"common"], (function(t) {
delete e.headers[t]
}
)),
(e.adapter || defaults$3.adapter)(e).then((function(t) {
return throwIfCancellationRequested(e),
t.data = transformData.call(e, t.data, t.headers,
e.transformResponse),
t
}
), (function(t) {
return isCancel(t) || (throwIfCancellationRequested(e),
t && t.response && (t.response.data = transformData.call(e,
t.response.data, t.response.headers, e.transformResponse))),
Promise.reject(t)
}
))
}, utils$8 = utils$e, mergeConfig$2 = function(e, t) {
t = t || {};
var r = {};
function n(e, t) {
return utils$8.isPlainObject(e) && utils$8.isPlainObject(t) ?
utils$8.merge(e, t) : utils$8.isPlainObject(t) ? utils$8.merge({}, t) :
utils$8.isArray(t) ? t.slice() : t
}
function i(r) {
return utils$8.isUndefined(t[r]) ? utils$8.isUndefined(e[r]) ? void
0 : n(void 0, e[r]) : n(e[r], t[r])
}
function o(e) {
if (!utils$8.isUndefined(t[e]))
return n(void 0, t[e])
}
function s(r) {
return utils$8.isUndefined(t[r]) ? utils$8.isUndefined(e[r]) ? void
0 : n(void 0, e[r]) : n(void 0, t[r])
}
function a(r) {
return r in t ? n(e[r], t[r]) : r in e ? n(void 0, e[r]) : void 0
}
var l = {
url: o,
method: o,
data: o,
baseURL: s,
transformRequest: s,
transformResponse: s,
paramsSerializer: s,
timeout: s,
timeoutMessage: s,
withCredentials: s,
adapter: s,
responseType: s,
xsrfCookieName: s,
xsrfHeaderName: s,
onUploadProgress: s,
onDownloadProgress: s,
decompress: s,
maxContentLength: s,
maxBodyLength: s,
transport: s,
httpAgent: s,
httpsAgent: s,
cancelToken: s,
socketPath: s,
responseEncoding: s,
validateStatus: a
};
return utils$8.forEach(Object.keys(e).concat(Object.keys(t)),
(function(e) {
var t = l[e] || i
, n = t(e);
utils$8.isUndefined(n) && t !== a || (r[e] = n)
}
)),
r
}, data$1, hasRequiredData;
function requireData() {
return hasRequiredData ? data$1 : (hasRequiredData = 1,
data$1 = {
version: "0.24.0"
})
}
var VERSION = requireData().version
, validators$2 = {};
["object", "boolean", "number", "function", "string",
"symbol"].forEach((function(e, t) {
validators$2[e] = function(r) {
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e
}
}
));
var deprecatedWarnings = {};
function assertOptions(e, t, r) {
if ("object" != typeof e)
throw new TypeError("options must be an object");
for (var n = Object.keys(e), i = n.length; i-- > 0; ) {
var o = n[i]
, s = t[o];
if (s) {
var a = e[o]
, l = void 0 === a || s(a, o, e);
if (!0 !== l)
throw new TypeError("option " + o + " must be " + l)
} else if (!0 !== r)
throw Error("Unknown option " + o)
}
}
validators$2.transitional = function(e, t, r) {
return function(n, i, o) {
if (!1 === e)
throw new Error(function(e, t) {
return "[Axios v" + VERSION + "] Transitional option '" + e
+ "'" + t + (r ? ". " + r : "")
}(i, " has been removed" + (t ? " in " + t : "")));
return t && !deprecatedWarnings[i] && (deprecatedWarnings[i] = !0),
!e || e(n, i, o)
}
}
;
var validator$1 = {
assertOptions: assertOptions,
validators: validators$2
}
, utils$7 = utils$e
, buildURL = buildURL$1
, InterceptorManager = InterceptorManager_1
, dispatchRequest = dispatchRequest$1
, mergeConfig$1 = mergeConfig$2
, validator = validator$1
, validators$1 = validator.validators;
function Axios$1(e) {
this.defaults = e,
this.interceptors = {
request: new InterceptorManager,
response: new InterceptorManager
}
}
Axios$1.prototype.request = function(e) {
"string" == typeof e ? (e = arguments[1] || {}).url = arguments[0] : e
= e || {},
(e = mergeConfig$1(this.defaults, e)).method ? e.method =
e.method.toLowerCase() : this.defaults.method ? e.method =
this.defaults.method.toLowerCase() : e.method = "get";
var t = e.transitional;
void 0 !== t && validator.assertOptions(t, {
silentJSONParsing: validators$1.transitional(validators$1.boolean),
forcedJSONParsing: validators$1.transitional(validators$1.boolean),
clarifyTimeoutError:
validators$1.transitional(validators$1.boolean)
}, !1);
var r = []
, n = !0;
this.interceptors.request.forEach((function(t) {
"function" == typeof t.runWhen && !1 === t.runWhen(e) || (n = n &&
t.synchronous,
r.unshift(t.fulfilled, t.rejected))
}
));
var i, o = [];
if (this.interceptors.response.forEach((function(e) {
o.push(e.fulfilled, e.rejected)
}
)),
!n) {
var s = [dispatchRequest, void 0];
for (Array.prototype.unshift.apply(s, r),
s = s.concat(o),
i = Promise.resolve(e); s.length; )
i = i.then(s.shift(), s.shift());
return i
}
for (var a = e; r.length; ) {
var l = r.shift()
, c = r.shift();
try {
a = l(a)
} catch (u) {
c(u);
break
}
}
try {
i = dispatchRequest(a)
} catch (u) {
return Promise.reject(u)
}
for (; o.length; )
i = i.then(o.shift(), o.shift());
return i
}
,
Axios$1.prototype.getUri = function(e) {
return e = mergeConfig$1(this.defaults, e),
buildURL(e.url, e.params, e.paramsSerializer).replace(/^\?/, "")
}
,
utils$7.forEach(["delete", "get", "head", "options"], (function(e) {
Axios$1.prototype[e] = function(t, r) {
return this.request(mergeConfig$1(r || {}, {
method: e,
url: t,
data: (r || {}).data
}))
}
}
)),
utils$7.forEach(["post", "put", "patch"], (function(e) {
Axios$1.prototype[e] = function(t, r, n) {
return this.request(mergeConfig$1(n || {}, {
method: e,
url: t,
data: r
}))
}
}
));
var Axios_1 = Axios$1, CancelToken_1, hasRequiredCancelToken, spread,
hasRequiredSpread, isAxiosError, hasRequiredIsAxiosError;
function requireCancelToken() {
if (hasRequiredCancelToken)
return CancelToken_1;
hasRequiredCancelToken = 1;
var e = requireCancel();
function t(t) {
if ("function" != typeof t)
throw new TypeError("executor must be a function.");
var r;
this.promise = new Promise((function(e) {
r = e
}
));
var n = this;
this.promise.then((function(e) {
if (n._listeners) {
var t, r = n._listeners.length;
for (t = 0; t < r; t++)
n._listeners[t](e);
n._listeners = null
}
}
)),
this.promise.then = function(e) {
var t, r = new Promise((function(e) {
n.subscribe(e),
t = e
}
)).then(e);
return r.cancel = function() {
n.unsubscribe(t)
}
,
r
}
,
t((function(t) {
n.reason || (n.reason = new e(t),
r(n.reason))
}
))
}
return t.prototype.throwIfRequested = function() {
if (this.reason)
throw this.reason
}
,
t.prototype.subscribe = function(e) {
this.reason ? e(this.reason) : this._listeners ?
this._listeners.push(e) : this._listeners = [e]
}
,
t.prototype.unsubscribe = function(e) {
if (this._listeners) {
var t = this._listeners.indexOf(e);
-1 !== t && this._listeners.splice(t, 1)
}
}
,
t.source = function() {
var e;
return {
token: new t((function(t) {
e = t
}
)),
cancel: e
}
}
,
CancelToken_1 = t
}
function requireSpread() {
return hasRequiredSpread ? spread : (hasRequiredSpread = 1,
spread = function(e) {
return function(t) {
return e.apply(null, t)
}
}
)
}
function requireIsAxiosError() {
return hasRequiredIsAxiosError ? isAxiosError :
(hasRequiredIsAxiosError = 1,
isAxiosError = function(e) {
return "object" == typeof e && !0 === e.isAxiosError
}
)
}
var utils$6 = utils$e
, bind$2 = bind$4
, Axios = Axios_1
, mergeConfig = mergeConfig$2
, defaults$2 = requireDefaults();
function createInstance(e) {
var t = new Axios(e)
, r = bind$2(Axios.prototype.request, t);
return utils$6.extend(r, Axios.prototype, t),
utils$6.extend(r, t),
r.create = function(t) {
return createInstance(mergeConfig(e, t))
}
,
r
}
var axios$2 = createInstance(defaults$2);
axios$2.Axios = Axios,
axios$2.Cancel = requireCancel(),
axios$2.CancelToken = requireCancelToken(),
axios$2.isCancel = requireIsCancel(),
axios$2.VERSION = requireData().version,
axios$2.all = function(e) {
return Promise.all(e)
}
,
axios$2.spread = requireSpread(),
axios$2.isAxiosError = requireIsAxiosError(),
axios$3.exports = axios$2,
axios$3.exports.default = axios$2;
var axiosExports = axios$3.exports
, axios = axiosExports;
const axios$1 = getDefaultExportFromCjs(axios);
var OBFUSCATED_ERROR = "An invariant failed, however the error is
obfuscated because this is a production build."
, EMPTY_ARRAY = [];
Object.freeze(EMPTY_ARRAY);
var EMPTY_OBJECT$1 = {};
function getNextId() {
return ++globalState.mobxGuid
}
function fail(e) {
throw invariant$1(!1, e),
"X"
}
function invariant$1(e, t) {
if (!e)
throw new Error("[mobx] " + (t || OBFUSCATED_ERROR))
}
function once(e) {
var t = !1;
return function() {
if (!t)
return t = !0,
e.apply(this, arguments)
}
}
Object.freeze(EMPTY_OBJECT$1);
var noop$5 = function() {};
function unique(e) {
var t = [];
return e.forEach((function(e) {
-1 === t.indexOf(e) && t.push(e)
}
)),
t
}
function isObject$j(e) {
return null !== e && "object" == typeof e
}
function isPlainObject$6(e) {
if (null === e || "object" != typeof e)
return !1;
var t = Object.getPrototypeOf(e);
return t === Object.prototype || null === t
}
function convertToMap(e) {
if (isES6Map(e) || isObservableMap(e))
return e;
if (Array.isArray(e))
return new Map(e);
if (isPlainObject$6(e)) {
var t = new Map;
for (var r in e)
t.set(r, e[r]);
return t
}
return fail("Cannot convert to map from '" + e + "'")
}
function addHiddenProp(e, t, r) {
Object.defineProperty(e, t, {
enumerable: !1,
writable: !0,
configurable: !0,
value: r
})
}
function addHiddenFinalProp(e, t, r) {
Object.defineProperty(e, t, {
enumerable: !1,
writable: !1,
configurable: !0,
value: r
})
}
function isPropertyConfigurable(e, t) {
var r = Object.getOwnPropertyDescriptor(e, t);
return !r || !1 !== r.configurable && !1 !== r.writable
}
function createInstanceofPredicate(e, t) {
var r = "isMobX" + e;
return t.prototype[r] = !0,
function(e) {
return isObject$j(e) && !0 === e[r]
}
}
function isES6Map(e) {
return e instanceof Map
}
function isES6Set(e) {
return e instanceof Set
}
function getPlainObjectKeys(e) {
var t = new Set;
for (var r in e)
t.add(r);
return Object.getOwnPropertySymbols(e).forEach((function(r) {
Object.getOwnPropertyDescriptor(e, r).enumerable && t.add(r)
}
)),
Array.from(t)
}
function stringifyKey(e) {
return e && e.toString ? e.toString() : new String(e).toString()
}
function toPrimitive$1(e) {
return null === e ? null : "object" == typeof e ? "" + e : e
}
var ownKeys$2 = "undefined" != typeof Reflect && Reflect.ownKeys ?
Reflect.ownKeys : Object.getOwnPropertySymbols ? function(e) {
return
Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))
}
: Object.getOwnPropertyNames
, $mobx = Symbol("mobx administration")
, Atom = function() {
function e(e) {
void 0 === e && (e = "Atom@" + getNextId()),
this.name = e,
this.isPendingUnobservation = !1,
this.isBeingObserved = !1,
this.observers = new Set,
this.diffValue = 0,
this.lastAccessedBy = 0,
this.lowestObserverState = IDerivationState.NOT_TRACKING
}
return e.prototype.onBecomeObserved = function() {
this.onBecomeObservedListeners &&
this.onBecomeObservedListeners.forEach((function(e) {
return e()
}
))
}
,
e.prototype.onBecomeUnobserved = function() {
this.onBecomeUnobservedListeners &&
this.onBecomeUnobservedListeners.forEach((function(e) {
return e()
}
))
}
,
e.prototype.reportObserved = function() {
return reportObserved(this)
}
,
e.prototype.reportChanged = function() {
startBatch(),
propagateChanged(this),
endBatch()
}
,
e.prototype.toString = function() {
return this.name
}
,
e
}()
, isAtom = createInstanceofPredicate("Atom", Atom);
function createAtom(e, t, r) {
void 0 === t && (t = noop$5),
void 0 === r && (r = noop$5);
var n = new Atom(e);
return t !== noop$5 && onBecomeObserved(n, t),
r !== noop$5 && onBecomeUnobserved(n, r),
n
}
function identityComparer(e, t) {
return e === t
}
function structuralComparer(e, t) {
return deepEqual(e, t)
}
function shallowComparer(e, t) {
return deepEqual(e, t, 1)
}
function defaultComparer(e, t) {
return Object.is(e, t)
}
var comparer = {
identity: identityComparer,
structural: structuralComparer,
default: defaultComparer,
shallow: shallowComparer
}
, extendStatics$9 = function(e, t) {
return (extendStatics$9 = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(e, t) {
e.__proto__ = t
}
|| function(e, t) {
for (var r in t)
t.hasOwnProperty(r) && (e[r] = t[r])
}
)(e, t)
};
/*!
*****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
*****************************************************************************
*/
function __extends$9(e, t) {
function r() {
this.constructor = e
}
extendStatics$9(e, t),
e.prototype = null === t ? Object.create(t) : (r.prototype =
t.prototype,
new r)
}
var __assign$b = function() {
return __assign$b = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$b.apply(this, arguments)
};
function __values$1(e) {
var t = "function" == typeof Symbol && e[Symbol.iterator]
, r = 0;
return t ? t.call(e) : {
next: function() {
return e && r >= e.length && (e = void 0),
{
value: e && e[r++],
done: !e
}
}
}
}
function __read$2(e, t) {
var r = "function" == typeof Symbol && e[Symbol.iterator];
if (!r)
return e;
var n, i, o = r.call(e), s = [];
try {
for (; (void 0 === t || t-- > 0) && !(n = o.next()).done; )
s.push(n.value)
} catch (a) {
i = {
error: a
}
} finally {
try {
n && !n.done && (r = o.return) && r.call(o)
} finally {
if (i)
throw i.error
}
}
return s
}
function __spread() {
for (var e = [], t = 0; t < arguments.length; t++)
e = e.concat(__read$2(arguments[t]));
return e
}
var mobxDidRunLazyInitializersSymbol = Symbol("mobx did run lazy
initializers")
, mobxPendingDecorators = Symbol("mobx pending decorators")
, enumerableDescriptorCache = {}
, nonEnumerableDescriptorCache = {};
function createPropertyInitializerDescriptor(e, t) {
var r = t ? enumerableDescriptorCache : nonEnumerableDescriptorCache;
return r[e] || (r[e] = {
configurable: !0,
enumerable: t,
get: function() {
return initializeInstance(this),
this[e]
},
set: function(t) {
initializeInstance(this),
this[e] = t
}
})
}
function initializeInstance(e) {
var t, r;
if (!0 !== e[mobxDidRunLazyInitializersSymbol]) {
var n = e[mobxPendingDecorators];
if (n) {
addHiddenProp(e, mobxDidRunLazyInitializersSymbol, !0);
var i = __spread(Object.getOwnPropertySymbols(n),
Object.keys(n));
try {
for (var o = __values$1(i), s = o.next(); !s.done; s =
o.next()) {
var a = n[s.value];
a.propertyCreator(e, a.prop, a.descriptor,
a.decoratorTarget, a.decoratorArguments)
}
} catch (l) {
t = {
error: l
}
} finally {
try {
s && !s.done && (r = o.return) && r.call(o)
} finally {
if (t)
throw t.error
}
}
}
}
}
function createPropDecorator(e, t) {
return function() {
var r, n = function(n, i, o, s) {
if (!0 === s)
return t(n, i, o, n, r),
null;
if (!Object.prototype.hasOwnProperty.call(n,
mobxPendingDecorators)) {
var a = n[mobxPendingDecorators];
addHiddenProp(n, mobxPendingDecorators, __assign$b({}, a))
}
return n[mobxPendingDecorators][i] = {
prop: i,
propertyCreator: t,
descriptor: o,
decoratorTarget: n,
decoratorArguments: r
},
createPropertyInitializerDescriptor(i, e)
};
return quacksLikeADecorator(arguments) ? (r = EMPTY_ARRAY,
n.apply(null, arguments)) : (r =
Array.prototype.slice.call(arguments),
n)
}
}
function quacksLikeADecorator(e) {
return (2 === e.length || 3 === e.length) && ("string" == typeof e[1]
|| "symbol" == typeof e[1]) || 4 === e.length && !0 === e[3]
}
function deepEnhancer(e, t, r) {
return isObservable(e) ? e : Array.isArray(e) ? observable.array(e, {
name: r
}) : isPlainObject$6(e) ? observable.object(e, void 0, {
name: r
}) : isES6Map(e) ? observable.map(e, {
name: r
}) : isES6Set(e) ? observable.set(e, {
name: r
}) : e
}
function shallowEnhancer(e, t, r) {
return null == e || isObservableObject(e) || isObservableArray(e) ||
isObservableMap(e) || isObservableSet(e) ? e : Array.isArray(e) ?
observable.array(e, {
name: r,
deep: !1
}) : isPlainObject$6(e) ? observable.object(e, void 0, {
name: r,
deep: !1
}) : isES6Map(e) ? observable.map(e, {
name: r,
deep: !1
}) : isES6Set(e) ? observable.set(e, {
name: r,
deep: !1
}) : fail(!1)
}
function referenceEnhancer(e) {
return e
}
function refStructEnhancer(e, t, r) {
return deepEqual(e, t) ? t : e
}
function createDecoratorForEnhancer(e) {
invariant$1(e);
var t = createPropDecorator(!0, (function(t, r, n, i, o) {
var s = n ? n.initializer ? n.initializer.call(t) : n.value : void
0;
asObservableObject(t).addObservableProp(r, s, e)
}
))
, r = ("undefined" != typeof process && process.env,
t);
return r.enhancer = e,
r
}
var defaultCreateObservableOptions = {
deep: !0,
name: void 0,
defaultDecorator: void 0,
proxy: !0
};
function asCreateObservableOptions(e) {
return null == e ? defaultCreateObservableOptions : "string" == typeof
e ? {
name: e,
deep: !0,
proxy: !0
} : e
}
Object.freeze(defaultCreateObservableOptions);
var deepDecorator = createDecoratorForEnhancer(deepEnhancer)
, shallowDecorator = createDecoratorForEnhancer(shallowEnhancer)
, refDecorator = createDecoratorForEnhancer(referenceEnhancer)
, refStructDecorator = createDecoratorForEnhancer(refStructEnhancer);
function getEnhancerFromOptions(e) {
return e.defaultDecorator ? e.defaultDecorator.enhancer : !1 === e.deep
? referenceEnhancer : deepEnhancer
}
function createObservable(e, t, r) {
if ("string" == typeof arguments[1] || "symbol" == typeof arguments[1])
return deepDecorator.apply(null, arguments);
if (isObservable(e))
return e;
var n = isPlainObject$6(e) ? observable.object(e, t, r) :
Array.isArray(e) ? observable.array(e, t) : isES6Map(e) ? observable.map(e, t) :
isES6Set(e) ? observable.set(e, t) : e;
if (n !== e)
return n;
fail(!1)
}
var observableFactories = {
box: function(e, t) {
arguments.length > 2 && incorrectlyUsedAsDecorator("box");
var r = asCreateObservableOptions(t);
return new ObservableValue(e,getEnhancerFromOptions(r),r.name,!
0,r.equals)
},
array: function(e, t) {
arguments.length > 2 && incorrectlyUsedAsDecorator("array");
var r = asCreateObservableOptions(t);
return createObservableArray(e, getEnhancerFromOptions(r), r.name)
},
map: function(e, t) {
arguments.length > 2 && incorrectlyUsedAsDecorator("map");
var r = asCreateObservableOptions(t);
return new ObservableMap(e,getEnhancerFromOptions(r),r.name)
},
set: function(e, t) {
arguments.length > 2 && incorrectlyUsedAsDecorator("set");
var r = asCreateObservableOptions(t);
return new ObservableSet(e,getEnhancerFromOptions(r),r.name)
},
object: function(e, t, r) {
"string" == typeof arguments[1] &&
incorrectlyUsedAsDecorator("object");
var n = asCreateObservableOptions(r);
if (!1 === n.proxy)
return extendObservable({}, e, t, n);
var i = getDefaultDecoratorFromObjectOptions(n)
, o = createDynamicObservableObject(extendObservable({}, void 0,
void 0, n));
return extendObservableObjectWithProperties(o, e, t, i),
o
},
ref: refDecorator,
shallow: shallowDecorator,
deep: deepDecorator,
struct: refStructDecorator
}
, observable = createObservable;
function incorrectlyUsedAsDecorator(e) {
fail("Expected one or two arguments to observable." + e + ". Did you
accidentally try to use observable." + e + " as decorator?")
}
Object.keys(observableFactories).forEach((function(e) {
return observable[e] = observableFactories[e]
}
));
var computedDecorator = createPropDecorator(!1, (function(e, t, r, n, i) {
var o = r.get
, s = r.set
, a = i[0] || {};
asObservableObject(e).addComputedProp(e, t, __assign$b({
get: o,
set: s,
context: e
}, a))
}
)), IDerivationState, IDerivationState2, TraceMode, TraceMode2;
computedDecorator({
equals: comparer.structural
}),
IDerivationState2 = IDerivationState || (IDerivationState = {}),
IDerivationState2[IDerivationState2.NOT_TRACKING = -1] = "NOT_TRACKING",
IDerivationState2[IDerivationState2.UP_TO_DATE = 0] = "UP_TO_DATE",
IDerivationState2[IDerivationState2.POSSIBLY_STALE = 1] = "POSSIBLY_STALE",
IDerivationState2[IDerivationState2.STALE = 2] = "STALE",
TraceMode2 = TraceMode || (TraceMode = {}),
TraceMode2[TraceMode2.NONE = 0] = "NONE",
TraceMode2[TraceMode2.LOG = 1] = "LOG",
TraceMode2[TraceMode2.BREAK = 2] = "BREAK";
var CaughtException = function(e) {
this.cause = e
};
function isCaughtException(e) {
return e instanceof CaughtException
}
function shouldCompute(e) {
switch (e.dependenciesState) {
case IDerivationState.UP_TO_DATE:
return !1;
case IDerivationState.NOT_TRACKING:
case IDerivationState.STALE:
return !0;
case IDerivationState.POSSIBLY_STALE:
for (var t = allowStateReadsStart(!0), r = untrackedStart(), n =
e.observing, i = n.length, o = 0; o < i; o++) {
var s = n[o];
if (isComputedValue(s)) {
if (globalState.disableErrorBoundaries)
s.get();
else
try {
s.get()
} catch (e2) {
return untrackedEnd(r),
allowStateReadsEnd(t),
!0
}
if (e.dependenciesState === IDerivationState.STALE)
return untrackedEnd(r),
allowStateReadsEnd(t),
!0
}
}
return changeDependenciesStateTo0(e),
untrackedEnd(r),
allowStateReadsEnd(t),
!1
}
}
function checkIfStateModificationsAreAllowed(e) {
var t = e.observers.size > 0;
globalState.computationDepth > 0 && t && fail(!1),
globalState.allowStateChanges || !t && "strict" !==
globalState.enforceActions || fail(!1)
}
function trackDerivedFunction(e, t, r) {
var n = allowStateReadsStart(!0);
changeDependenciesStateTo0(e),
e.newObserving = new Array(e.observing.length + 100),
e.unboundDepsCount = 0,
e.runId = ++globalState.runId;
var i, o = globalState.trackingDerivation;
if (globalState.trackingDerivation = e,
!0 === globalState.disableErrorBoundaries)
i = t.call(r);
else
try {
i = t.call(r)
} catch (e2) {
i = new CaughtException(e2)
}
return globalState.trackingDerivation = o,
bindDependencies(e),
allowStateReadsEnd(n),
i
}
function bindDependencies(e) {
for (var t = e.observing, r = e.observing = e.newObserving, n =
IDerivationState.UP_TO_DATE, i = 0, o = e.unboundDepsCount, s = 0; s < o; s++) {
0 === (a = r[s]).diffValue && (a.diffValue = 1,
i !== s && (r[i] = a),
i++),
a.dependenciesState > n && (n = a.dependenciesState)
}
for (r.length = i,
e.newObserving = null,
o = t.length; o--; ) {
0 === (a = t[o]).diffValue && removeObserver(a, e),
a.diffValue = 0
}
for (; i--; ) {
var a;
1 === (a = r[i]).diffValue && (a.diffValue = 0,
addObserver(a, e))
}
n !== IDerivationState.UP_TO_DATE && (e.dependenciesState = n,
e.onBecomeStale())
}
function clearObserving(e) {
var t = e.observing;
e.observing = [];
for (var r = t.length; r--; )
removeObserver(t[r], e);
e.dependenciesState = IDerivationState.NOT_TRACKING
}
function untracked(e) {
var t = untrackedStart();
try {
return e()
} finally {
untrackedEnd(t)
}
}
function untrackedStart() {
var e = globalState.trackingDerivation;
return globalState.trackingDerivation = null,
e
}
function untrackedEnd(e) {
globalState.trackingDerivation = e
}
function allowStateReadsStart(e) {
var t = globalState.allowStateReads;
return globalState.allowStateReads = e,
t
}
function allowStateReadsEnd(e) {
globalState.allowStateReads = e
}
function changeDependenciesStateTo0(e) {
if (e.dependenciesState !== IDerivationState.UP_TO_DATE) {
e.dependenciesState = IDerivationState.UP_TO_DATE;
for (var t = e.observing, r = t.length; r--; )
t[r].lowestObserverState = IDerivationState.UP_TO_DATE
}
}
var currentActionId = 0
, nextActionId = 1
, functionNameDescriptor = Object.getOwnPropertyDescriptor((function() {}
), "name");
function createAction(e, t, r) {
var n = function() {
return executeAction(e, t, r || this, arguments)
};
return n.isMobxAction = !0,
n
}
function executeAction(e, t, r, n) {
var i = _startAction();
try {
return t.apply(r, n)
} catch (o) {
throw i.error = o,
o
} finally {
_endAction(i)
}
}
function _startAction(e, t, r) {
var n = isSpyEnabled()
, i = untrackedStart();
startBatch();
var o = {
prevDerivation: i,
prevAllowStateChanges: allowStateChangesStart(!0),
prevAllowStateReads: allowStateReadsStart(!0),
notifySpy: n,
startTime: 0,
actionId: nextActionId++,
parentActionId: currentActionId
};
return currentActionId = o.actionId,
o
}
function _endAction(e) {
currentActionId !== e.actionId && fail("invalid action stack. did you
forget to finish an action?"),
currentActionId = e.parentActionId,
void 0 !== e.error && (globalState.suppressReactionErrors = !0),
allowStateChangesEnd(e.prevAllowStateChanges),
allowStateReadsEnd(e.prevAllowStateReads),
endBatch(),
untrackedEnd(e.prevDerivation),
e.notifySpy,
globalState.suppressReactionErrors = !1
}
function allowStateChanges(e, t) {
var r, n = allowStateChangesStart(e);
try {
r = t()
} finally {
allowStateChangesEnd(n)
}
return r
}
function allowStateChangesStart(e) {
var t = globalState.allowStateChanges;
return globalState.allowStateChanges = e,
t
}
function allowStateChangesEnd(e) {
globalState.allowStateChanges = e
}
functionNameDescriptor && functionNameDescriptor.configurable;
var ObservableValue = function(e) {
function t(t, r, n, i, o) {
void 0 === n && (n = "ObservableValue@" + getNextId()),
void 0 === i && (i = !0),
void 0 === o && (o = comparer.default);
var s = e.call(this, n) || this;
return s.enhancer = r,
s.name = n,
s.equals = o,
s.hasUnreportedChange = !1,
s.value = r(t, void 0, n),
i && isSpyEnabled(),
s
}
return __extends$9(t, e),
t.prototype.dehanceValue = function(e) {
return void 0 !== this.dehancer ? this.dehancer(e) : e
}
,
t.prototype.set = function(e) {
this.value;
if ((e = this.prepareNewValue(e)) !== globalState.UNCHANGED) {
isSpyEnabled();
0,
this.setNewValue(e)
}
}
,
t.prototype.prepareNewValue = function(e) {
if (checkIfStateModificationsAreAllowed(this),
hasInterceptors(this)) {
var t = interceptChange(this, {
object: this,
type: "update",
newValue: e
});
if (!t)
return globalState.UNCHANGED;
e = t.newValue
}
return e = this.enhancer(e, this.value, this.name),
this.equals(this.value, e) ? globalState.UNCHANGED : e
}
,
t.prototype.setNewValue = function(e) {
var t = this.value;
this.value = e,
this.reportChanged(),
hasListeners(this) && notifyListeners(this, {
type: "update",
object: this,
newValue: e,
oldValue: t
})
}
,
t.prototype.get = function() {
return this.reportObserved(),
this.dehanceValue(this.value)
}
,
t.prototype.intercept = function(e) {
return registerInterceptor(this, e)
}
,
t.prototype.observe = function(e, t) {
return t && e({
object: this,
type: "update",
newValue: this.value,
oldValue: void 0
}),
registerListener(this, e)
}
,
t.prototype.toJSON = function() {
return this.get()
}
,
t.prototype.toString = function() {
return this.name + "[" + this.value + "]"
}
,
t.prototype.valueOf = function() {
return toPrimitive$1(this.get())
}
,
t.prototype[Symbol.toPrimitive] = function() {
return this.valueOf()
}
,
t
}(Atom);
createInstanceofPredicate("ObservableValue", ObservableValue);
var ComputedValue = function() {
function e(e) {
this.dependenciesState = IDerivationState.NOT_TRACKING,
this.observing = [],
this.newObserving = null,
this.isBeingObserved = !1,
this.isPendingUnobservation = !1,
this.observers = new Set,
this.diffValue = 0,
this.runId = 0,
this.lastAccessedBy = 0,
this.lowestObserverState = IDerivationState.UP_TO_DATE,
this.unboundDepsCount = 0,
this.__mapid = "#" + getNextId(),
this.value = new CaughtException(null),
this.isComputing = !1,
this.isRunningSetter = !1,
this.isTracing = TraceMode.NONE,
invariant$1(e.get, "missing option for computed: get"),
this.derivation = e.get,
this.name = e.name || "ComputedValue@" + getNextId(),
e.set && (this.setter = createAction(this.name + "-setter",
e.set)),
this.equals = e.equals || (e.compareStructural || e.struct ?
comparer.structural : comparer.default),
this.scope = e.context,
this.requiresReaction = !!e.requiresReaction,
this.keepAlive = !!e.keepAlive
}
return e.prototype.onBecomeStale = function() {
propagateMaybeChanged(this)
}
,
e.prototype.onBecomeObserved = function() {
this.onBecomeObservedListeners &&
this.onBecomeObservedListeners.forEach((function(e) {
return e()
}
))
}
,
e.prototype.onBecomeUnobserved = function() {
this.onBecomeUnobservedListeners &&
this.onBecomeUnobservedListeners.forEach((function(e) {
return e()
}
))
}
,
e.prototype.get = function() {
this.isComputing && fail("Cycle detected in computation " +
this.name + ": " + this.derivation),
0 !== globalState.inBatch || 0 !== this.observers.size ||
this.keepAlive ? (reportObserved(this),
shouldCompute(this) && this.trackAndCompute() &&
propagateChangeConfirmed(this)) : shouldCompute(this) &&
(this.warnAboutUntrackedRead(),
startBatch(),
this.value = this.computeValue(!1),
endBatch());
var e = this.value;
if (isCaughtException(e))
throw e.cause;
return e
}
,
e.prototype.peek = function() {
var e = this.computeValue(!1);
if (isCaughtException(e))
throw e.cause;
return e
}
,
e.prototype.set = function(e) {
if (this.setter) {
invariant$1(!this.isRunningSetter, "The setter of computed
value '" + this.name + "' is trying to update itself. Did you intend to update an
_observable_ value, instead of the computed property?"),
this.isRunningSetter = !0;
try {
this.setter.call(this.scope, e)
} finally {
this.isRunningSetter = !1
}
} else
invariant$1(!1, !1)
}
,
e.prototype.trackAndCompute = function() {
var e = this.value
, t = this.dependenciesState === IDerivationState.NOT_TRACKING
, r = this.computeValue(!0)
, n = t || isCaughtException(e) || isCaughtException(r) || !
this.equals(e, r);
return n && (this.value = r),
n
}
,
e.prototype.computeValue = function(e) {
var t;
if (this.isComputing = !0,
globalState.computationDepth++,
e)
t = trackDerivedFunction(this, this.derivation, this.scope);
else if (!0 === globalState.disableErrorBoundaries)
t = this.derivation.call(this.scope);
else
try {
t = this.derivation.call(this.scope)
} catch (e2) {
t = new CaughtException(e2)
}
return globalState.computationDepth--,
this.isComputing = !1,
t
}
,
e.prototype.suspend = function() {
this.keepAlive || (clearObserving(this),
this.value = void 0)
}
,
e.prototype.observe = function(e, t) {
var r = this
, n = !0
, i = void 0;
return autorun((function() {
var o = r.get();
if (!n || t) {
var s = untrackedStart();
e({
type: "update",
object: r,
newValue: o,
oldValue: i
}),
untrackedEnd(s)
}
n = !1,
i = o
}
))
}
,
e.prototype.warnAboutUntrackedRead = function() {}
,
e.prototype.toJSON = function() {
return this.get()
}
,
e.prototype.toString = function() {
return this.name + "[" + this.derivation.toString() + "]"
}
,
e.prototype.valueOf = function() {
return toPrimitive$1(this.get())
}
,
e.prototype[Symbol.toPrimitive] = function() {
return this.valueOf()
}
,
e
}()
, isComputedValue = createInstanceofPredicate("ComputedValue",
ComputedValue)
, MobXGlobals = function() {
this.version = 5,
this.UNCHANGED = {},
this.trackingDerivation = null,
this.computationDepth = 0,
this.runId = 0,
this.mobxGuid = 0,
this.inBatch = 0,
this.pendingUnobservations = [],
this.pendingReactions = [],
this.isRunningReactions = !1,
this.allowStateChanges = !0,
this.allowStateReads = !0,
this.enforceActions = !1,
this.spyListeners = [],
this.globalReactionErrorHandlers = [],
this.computedRequiresReaction = !1,
this.reactionRequiresObservable = !1,
this.observableRequiresReaction = !1,
this.computedConfigurable = !1,
this.disableErrorBoundaries = !1,
this.suppressReactionErrors = !1
}
, mockGlobal$1 = {};
function getGlobal$1() {
return "undefined" != typeof window ? window : "undefined" != typeof
global ? global : "undefined" != typeof self ? self : mockGlobal$1
}
var canMergeGlobalState = !0, isolateCalled = !1, globalState = (global2 =
getGlobal$1(),
global2.__mobxInstanceCount > 0 && !global2.__mobxGlobals &&
(canMergeGlobalState = !1),
global2.__mobxGlobals && global2.__mobxGlobals.version !== (new
MobXGlobals).version && (canMergeGlobalState = !1),
canMergeGlobalState ? global2.__mobxGlobals ? (global2.__mobxInstanceCount
+= 1,
global2.__mobxGlobals.UNCHANGED || (global2.__mobxGlobals.UNCHANGED = {}),
global2.__mobxGlobals) : (global2.__mobxInstanceCount = 1,
global2.__mobxGlobals = new MobXGlobals) : (setTimeout((function() {
isolateCalled || fail("There are multiple, different versions of MobX
active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState:
true })`")
}
), 1),
new MobXGlobals)), global2;
function isolateGlobalState() {
(globalState.pendingReactions.length || globalState.inBatch ||
globalState.isRunningReactions) && fail("isolateGlobalState should be called before
MobX is running any reactions"),
isolateCalled = !0,
canMergeGlobalState && (0 == --getGlobal$1().__mobxInstanceCount &&
(getGlobal$1().__mobxGlobals = void 0),
globalState = new MobXGlobals)
}
function addObserver(e, t) {
e.observers.add(t),
e.lowestObserverState > t.dependenciesState && (e.lowestObserverState =
t.dependenciesState)
}
function removeObserver(e, t) {
e.observers.delete(t),
0 === e.observers.size && queueForUnobservation(e)
}
function queueForUnobservation(e) {
!1 === e.isPendingUnobservation && (e.isPendingUnobservation = !0,
globalState.pendingUnobservations.push(e))
}
function startBatch() {
globalState.inBatch++
}
function endBatch() {
if (0 == --globalState.inBatch) {
runReactions();
for (var e = globalState.pendingUnobservations, t = 0; t <
e.length; t++) {
var r = e[t];
r.isPendingUnobservation = !1,
0 === r.observers.size && (r.isBeingObserved &&
(r.isBeingObserved = !1,
r.onBecomeUnobserved()),
r instanceof ComputedValue && r.suspend())
}
globalState.pendingUnobservations = []
}
}
function reportObserved(e) {
var t = globalState.trackingDerivation;
return null !== t ? (t.runId !== e.lastAccessedBy && (e.lastAccessedBy
= t.runId,
t.newObserving[t.unboundDepsCount++] = e,
e.isBeingObserved || (e.isBeingObserved = !0,
e.onBecomeObserved())),
!0) : (0 === e.observers.size && globalState.inBatch > 0 &&
queueForUnobservation(e),
!1)
}
function propagateChanged(e) {
e.lowestObserverState !== IDerivationState.STALE &&
(e.lowestObserverState = IDerivationState.STALE,
e.observers.forEach((function(t) {
t.dependenciesState === IDerivationState.UP_TO_DATE && (t.isTracing
!== TraceMode.NONE && logTraceInfo(t, e),
t.onBecomeStale()),
t.dependenciesState = IDerivationState.STALE
}
)))
}
function propagateChangeConfirmed(e) {
e.lowestObserverState !== IDerivationState.STALE &&
(e.lowestObserverState = IDerivationState.STALE,
e.observers.forEach((function(t) {
t.dependenciesState === IDerivationState.POSSIBLY_STALE ?
t.dependenciesState = IDerivationState.STALE : t.dependenciesState ===
IDerivationState.UP_TO_DATE && (e.lowestObserverState =
IDerivationState.UP_TO_DATE)
}
)))
}
function propagateMaybeChanged(e) {
e.lowestObserverState === IDerivationState.UP_TO_DATE &&
(e.lowestObserverState = IDerivationState.POSSIBLY_STALE,
e.observers.forEach((function(t) {
t.dependenciesState === IDerivationState.UP_TO_DATE &&
(t.dependenciesState = IDerivationState.POSSIBLY_STALE,
t.isTracing !== TraceMode.NONE && logTraceInfo(t, e),
t.onBecomeStale())
}
)))
}
function logTraceInfo(e, t) {
if (e.isTracing === TraceMode.BREAK) {
var r = [];
printDepTree(getDependencyTree(e), r, 1),
new Function("debugger;\n/*\nTracing '" + e.name + "'\n\nYou are
entering this break point because derivation '" + e.name + "' is being traced and
'" + t.name + "' is now forcing it to update.\nJust follow the stacktrace you
should now see in the devtools to see precisely what piece of your code is causing
this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\
n\n" + (e instanceof ComputedValue ? e.derivation.toString().replace(/[*]\//g, "/")
: "") + "\n\nThe dependencies for this derivation are:\n\n" + r.join("\n") + "\n*/\
n ")()
}
}
function printDepTree(e, t, r) {
t.length >= 1e3 ? t.push("(and many more)") : (t.push("" + new
Array(r).join("\t") + e.name),
e.dependencies && e.dependencies.forEach((function(e) {
return printDepTree(e, t, r + 1)
}
)))
}
var Reaction = function() {
function e(e, t, r, n) {
void 0 === e && (e = "Reaction@" + getNextId()),
void 0 === n && (n = !1),
this.name = e,
this.onInvalidate = t,
this.errorHandler = r,
this.requiresObservable = n,
this.observing = [],
this.newObserving = [],
this.dependenciesState = IDerivationState.NOT_TRACKING,
this.diffValue = 0,
this.runId = 0,
this.unboundDepsCount = 0,
this.__mapid = "#" + getNextId(),
this.isDisposed = !1,
this._isScheduled = !1,
this._isTrackPending = !1,
this._isRunning = !1,
this.isTracing = TraceMode.NONE
}
return e.prototype.onBecomeStale = function() {
this.schedule()
}
,
e.prototype.schedule = function() {
this._isScheduled || (this._isScheduled = !0,
globalState.pendingReactions.push(this),
runReactions())
}
,
e.prototype.isScheduled = function() {
return this._isScheduled
}
,
e.prototype.runReaction = function() {
if (!this.isDisposed) {
if (startBatch(),
this._isScheduled = !1,
shouldCompute(this)) {
this._isTrackPending = !0;
try {
this.onInvalidate(),
this._isTrackPending && isSpyEnabled()
} catch (e2) {
this.reportExceptionInDerivation(e2)
}
}
endBatch()
}
}
,
e.prototype.track = function(e) {
if (!this.isDisposed) {
startBatch(),
this._isRunning = !0;
var t = trackDerivedFunction(this, e, void 0);
this._isRunning = !1,
this._isTrackPending = !1,
this.isDisposed && clearObserving(this),
isCaughtException(t) &&
this.reportExceptionInDerivation(t.cause),
endBatch()
}
}
,
e.prototype.reportExceptionInDerivation = function(e) {
var t = this;
if (this.errorHandler)
this.errorHandler(e, this);
else {
if (globalState.disableErrorBoundaries)
throw e;
globalState.suppressReactionErrors,
globalState.globalReactionErrorHandlers.forEach((function(r) {
return r(e, t)
}
))
}
}
,
e.prototype.dispose = function() {
this.isDisposed || (this.isDisposed = !0,
this._isRunning || (startBatch(),
clearObserving(this),
endBatch()))
}
,
e.prototype.getDisposer = function() {
var e = this.dispose.bind(this);
return e[$mobx] = this,
e
}
,
e.prototype.toString = function() {
return "Reaction[" + this.name + "]"
}
,
e.prototype.trace = function(e) {
void 0 === e && (e = !1),
trace(this, e)
}
,
e
}()
, MAX_REACTION_ITERATIONS = 100
, reactionScheduler = function(e) {
return e()
};
function runReactions() {
globalState.inBatch > 0 || globalState.isRunningReactions ||
reactionScheduler(runReactionsHelper)
}
function runReactionsHelper() {
globalState.isRunningReactions = !0;
for (var e = globalState.pendingReactions, t = 0; e.length > 0; ) {
++t === MAX_REACTION_ITERATIONS && e.splice(0);
for (var r = e.splice(0), n = 0, i = r.length; n < i; n++)
r[n].runReaction()
}
globalState.isRunningReactions = !1
}
var isReaction = createInstanceofPredicate("Reaction", Reaction);
function setReactionScheduler(e) {
var t = reactionScheduler;
reactionScheduler = function(r) {
return e((function() {
return t(r)
}
))
}
}
function isSpyEnabled() {
return !1
}
function spyReport(e) {}
function spyReportStart(e) {}
function spyReportEnd(e) {}
function spy(e) {
return function() {}
}
function dontReassignFields() {
fail(!1)
}
function namedActionDecorator(e) {
return function(t, r, n) {
if (n) {
if (n.value)
return {
value: createAction(e, n.value),
enumerable: !1,
configurable: !0,
writable: !0
};
var i = n.initializer;
return {
enumerable: !1,
configurable: !0,
writable: !0,
initializer: function() {
return createAction(e, i.call(this))
}
}
}
return actionFieldDecorator(e).apply(this, arguments)
}
}
function actionFieldDecorator(e) {
return function(t, r, n) {
Object.defineProperty(t, r, {
configurable: !0,
enumerable: !1,
get: function() {},
set: function(t) {
addHiddenProp(this, r, action(e, t))
}
})
}
}
function boundActionDecorator(e, t, r, n) {
return !0 === n ? (defineBoundAction(e, t, r.value),
null) : r ? {
configurable: !0,
enumerable: !1,
get: function() {
return defineBoundAction(this, t, r.value ||
r.initializer.call(this)),
this[t]
},
set: dontReassignFields
} : {
enumerable: !1,
configurable: !0,
set: function(e) {
defineBoundAction(this, t, e)
},
get: function() {}
}
}
var action = function(e, t, r, n) {
return 1 === arguments.length && "function" == typeof e ?
createAction(e.name || "<unnamed action>", e) : 2 === arguments.length &&
"function" == typeof t ? createAction(e, t) : 1 === arguments.length && "string" ==
typeof e ? namedActionDecorator(e) : !0 !== n ? namedActionDecorator(t).apply(null,
arguments) : void addHiddenProp(e, t, createAction(e.name || t, r.value, this))
};
function defineBoundAction(e, t, r) {
addHiddenProp(e, t, createAction(t, r.bind(e)))
}
function autorun(e, t) {
void 0 === t && (t = EMPTY_OBJECT$1);
var r, n = t && t.name || e.name || "Autorun@" + getNextId();
if (!t.scheduler && !t.delay)
r = new Reaction(n,(function() {
this.track(s)
}
),t.onError,t.requiresObservable);
else {
var i = createSchedulerFromOptions(t)
, o = !1;
r = new Reaction(n,(function() {
o || (o = !0,
i((function() {
o = !1,
r.isDisposed || r.track(s)
}
)))
}
),t.onError,t.requiresObservable)
}
function s() {
e(r)
}
return r.schedule(),
r.getDisposer()
}
action.bound = boundActionDecorator;
var run = function(e) {
return e()
};
function createSchedulerFromOptions(e) {
return e.scheduler ? e.scheduler : e.delay ? function(t) {
return setTimeout(t, e.delay)
}
: run
}
function onBecomeObserved(e, t, r) {
return interceptHook("onBecomeObserved", e, t, r)
}
function onBecomeUnobserved(e, t, r) {
return interceptHook("onBecomeUnobserved", e, t, r)
}
function interceptHook(e, t, r, n) {
var i = "function" == typeof n ? getAtom(t, r) : getAtom(t)
, o = "function" == typeof n ? n : r
, s = e + "Listeners";
return i[s] ? i[s].add(o) : i[s] = new Set([o]),
"function" != typeof i[e] ? fail(!1) : function() {
var e = i[s];
e && (e.delete(o),
0 === e.size && delete i[s])
}
}
function configure(e) {
var t = e.enforceActions
, r = e.computedRequiresReaction
, n = e.computedConfigurable
, i = e.disableErrorBoundaries
, o = e.reactionScheduler
, s = e.reactionRequiresObservable
, a = e.observableRequiresReaction;
if (!0 === e.isolateGlobalState && isolateGlobalState(),
void 0 !== t) {
var l = void 0;
switch (t) {
case !0:
case "observed":
l = !0;
break;
case !1:
case "never":
l = !1;
break;
case "strict":
case "always":
l = "strict";
break;
default:
fail("Invalid value for 'enforceActions': '" + t + "', expected
'never', 'always' or 'observed'")
}
globalState.enforceActions = l,
globalState.allowStateChanges = !0 !== l && "strict" !== l
}
void 0 !== r && (globalState.computedRequiresReaction = !!r),
void 0 !== s && (globalState.reactionRequiresObservable = !!s),
void 0 !== a && (globalState.observableRequiresReaction = !!a,
globalState.allowStateReads = !globalState.observableRequiresReaction),
void 0 !== n && (globalState.computedConfigurable = !!n),
void 0 !== i && (globalState.disableErrorBoundaries = !!i),
o && setReactionScheduler(o)
}
function extendObservable(e, t, r, n) {
var i = getDefaultDecoratorFromObjectOptions(n =
asCreateObservableOptions(n));
return initializeInstance(e),
asObservableObject(e, n.name, i.enhancer),
t && extendObservableObjectWithProperties(e, t, r, i),
e
}
function getDefaultDecoratorFromObjectOptions(e) {
return e.defaultDecorator || (!1 === e.deep ? refDecorator :
deepDecorator)
}
function extendObservableObjectWithProperties(e, t, r, n) {
var i, o;
startBatch();
try {
var s = ownKeys$2(t);
try {
for (var a = __values$1(s), l = a.next(); !l.done; l =
a.next()) {
var c = l.value
, u = Object.getOwnPropertyDescriptor(t, c);
0;
var d = (r && c in r ? r[c] : u.get ? computedDecorator :
n)(e, c, u, !0);
d && Object.defineProperty(e, c, d)
}
} catch (p) {
i = {
error: p
}
} finally {
try {
l && !l.done && (o = a.return) && o.call(a)
} finally {
if (i)
throw i.error
}
}
} finally {
endBatch()
}
}
function getDependencyTree(e, t) {
return nodeToDependencyTree(getAtom(e, t))
}
function nodeToDependencyTree(e) {
var t = {
name: e.name
};
return e.observing && e.observing.length > 0 && (t.dependencies =
unique(e.observing).map(nodeToDependencyTree)),
t
}
function _isComputed(e, t) {
if (null == e)
return !1;
if (void 0 !== t) {
if (!1 === isObservableObject(e))
return !1;
if (!e[$mobx].values.has(t))
return !1;
var r = getAtom(e, t);
return isComputedValue(r)
}
return isComputedValue(e)
}
function isComputed(e) {
return arguments.length > 1 ? fail(!1) : _isComputed(e)
}
function _isObservable(e, t) {
return null != e && (void 0 !== t ? !!isObservableObject(e) &&
e[$mobx].values.has(t) : isObservableObject(e) || !!e[$mobx] || isAtom(e) ||
isReaction(e) || isComputedValue(e))
}
function isObservable(e) {
return 1 !== arguments.length && fail(!1),
_isObservable(e)
}
function set$3(e, t, r) {
if (2 !== arguments.length || isObservableSet(e))
if (isObservableObject(e)) {
var n = e[$mobx];
n.values.get(t) ? n.write(t, r) : n.addObservableProp(t, r,
n.defaultEnhancer)
} else if (isObservableMap(e))
e.set(t, r);
else if (isObservableSet(e))
e.add(t);
else {
if (!isObservableArray(e))
return fail(!1);
"number" != typeof t && (t = parseInt(t, 10)),
invariant$1(t >= 0, "Not a valid index: '" + t + "'"),
startBatch(),
t >= e.length && (e.length = t + 1),
e[t] = r,
endBatch()
}
else {
startBatch();
var i = t;
try {
for (var o in i)
set$3(e, o, i[o])
} finally {
endBatch()
}
}
}
function trace() {
for (var e = [], t = 0; t < arguments.length; t++)
e[t] = arguments[t];
var r = !1;
"boolean" == typeof e[e.length - 1] && (r = e.pop());
var n = getAtomFromArgs(e);
if (!n)
return fail(!1);
n.isTracing,
TraceMode.NONE,
n.isTracing = r ? TraceMode.BREAK : TraceMode.LOG
}
function getAtomFromArgs(e) {
switch (e.length) {
case 0:
return globalState.trackingDerivation;
case 1:
return getAtom(e[0]);
case 2:
return getAtom(e[0], e[1])
}
}
function transaction(e, t) {
void 0 === t && (t = void 0),
startBatch();
try {
return e.apply(t)
} finally {
endBatch()
}
}
function getAdm(e) {
return e[$mobx]
}
function isPropertyKey(e) {
return "string" == typeof e || "number" == typeof e || "symbol" ==
typeof e
}
var objectProxyTraps = {
has: function(e, t) {
if (t === $mobx || "constructor" === t || t ===
mobxDidRunLazyInitializersSymbol)
return !0;
var r = getAdm(e);
return isPropertyKey(t) ? r.has(t) : t in e
},
get: function(e, t) {
if (t === $mobx || "constructor" === t || t ===
mobxDidRunLazyInitializersSymbol)
return e[t];
var r = getAdm(e)
, n = r.values.get(t);
if (n instanceof Atom) {
var i = n.get();
return void 0 === i && r.has(t),
i
}
return isPropertyKey(t) && r.has(t),
e[t]
},
set: function(e, t, r) {
return !!isPropertyKey(t) && (set$3(e, t, r),
!0)
},
deleteProperty: function(e, t) {
return !!isPropertyKey(t) && (getAdm(e).remove(t),
!0)
},
ownKeys: function(e) {
return getAdm(e).keysAtom.reportObserved(),
Reflect.ownKeys(e)
},
preventExtensions: function(e) {
return fail("Dynamic observable objects cannot be frozen"),
!1
}
};
function createDynamicObservableObject(e) {
var t = new Proxy(e,objectProxyTraps);
return e[$mobx].proxy = t,
t
}
function hasInterceptors(e) {
return void 0 !== e.interceptors && e.interceptors.length > 0
}
function registerInterceptor(e, t) {
var r = e.interceptors || (e.interceptors = []);
return r.push(t),
once((function() {
var e = r.indexOf(t);
-1 !== e && r.splice(e, 1)
}
))
}
function interceptChange(e, t) {
var r = untrackedStart();
try {
for (var n = __spread(e.interceptors || []), i = 0, o = n.length; i
< o && (invariant$1(!(t = n[i](t)) || t.type, "Intercept handlers should return
nothing or a change object"),
t); i++)
;
return t
} finally {
untrackedEnd(r)
}
}
function hasListeners(e) {
return void 0 !== e.changeListeners && e.changeListeners.length > 0
}
function registerListener(e, t) {
var r = e.changeListeners || (e.changeListeners = []);
return r.push(t),
once((function() {
var e = r.indexOf(t);
-1 !== e && r.splice(e, 1)
}
))
}
function notifyListeners(e, t) {
var r = untrackedStart()
, n = e.changeListeners;
if (n) {
for (var i = 0, o = (n = n.slice()).length; i < o; i++)
n[i](t);
untrackedEnd(r)
}
}
var MAX_SPLICE_SIZE = 1e4
, arrayTraps = {
get: function(e, t) {
return t === $mobx ? e[$mobx] : "length" === t ?
e[$mobx].getArrayLength() : "number" == typeof t ? arrayExtensions.get.call(e, t) :
"string" != typeof t || isNaN(t) ? arrayExtensions.hasOwnProperty(t) ?
arrayExtensions[t] : e[t] : arrayExtensions.get.call(e, parseInt(t))
},
set: function(e, t, r) {
return "length" === t && e[$mobx].setArrayLength(r),
"number" == typeof t && arrayExtensions.set.call(e, t, r),
"symbol" == typeof t || isNaN(t) ? e[t] = r :
arrayExtensions.set.call(e, parseInt(t), r),
!0
},
preventExtensions: function(e) {
return fail("Observable arrays cannot be frozen"),
!1
}
};
function createObservableArray(e, t, r, n) {
void 0 === r && (r = "ObservableArray@" + getNextId()),
void 0 === n && (n = !1);
var i = new ObservableArrayAdministration(r,t,n);
addHiddenFinalProp(i.values, $mobx, i);
var o = new Proxy(i.values,arrayTraps);
if (i.proxy = o,
e && e.length) {
var s = allowStateChangesStart(!0);
i.spliceWithArray(0, 0, e),
allowStateChangesEnd(s)
}
return o
}
var ObservableArrayAdministration = function() {
function e(e, t, r) {
this.owned = r,
this.values = [],
this.proxy = void 0,
this.lastKnownLength = 0,
this.atom = new Atom(e || "ObservableArray@" + getNextId()),
this.enhancer = function(r, n) {
return t(r, n, e + "[..]")
}
}
return e.prototype.dehanceValue = function(e) {
return void 0 !== this.dehancer ? this.dehancer(e) : e
}
,
e.prototype.dehanceValues = function(e) {
return void 0 !== this.dehancer && e.length > 0 ?
e.map(this.dehancer) : e
}
,
e.prototype.intercept = function(e) {
return registerInterceptor(this, e)
}
,
e.prototype.observe = function(e, t) {
return void 0 === t && (t = !1),
t && e({
object: this.proxy,
type: "splice",
index: 0,
added: this.values.slice(),
addedCount: this.values.length,
removed: [],
removedCount: 0
}),
registerListener(this, e)
}
,
e.prototype.getArrayLength = function() {
return this.atom.reportObserved(),
this.values.length
}
,
e.prototype.setArrayLength = function(e) {
if ("number" != typeof e || e < 0)
throw new Error("[mobx.array] Out of range: " + e);
var t = this.values.length;
if (e !== t)
if (e > t) {
for (var r = new Array(e - t), n = 0; n < e - t; n++)
r[n] = void 0;
this.spliceWithArray(t, 0, r)
} else
this.spliceWithArray(e, t - e)
}
,
e.prototype.updateArrayLength = function(e, t) {
if (e !== this.lastKnownLength)
throw new Error("[mobx] Modification exception: the internal
structure of an observable array was changed.");
this.lastKnownLength += t
}
,
e.prototype.spliceWithArray = function(e, t, r) {
var n = this;
checkIfStateModificationsAreAllowed(this.atom);
var i = this.values.length;
if (void 0 === e ? e = 0 : e > i ? e = i : e < 0 && (e =
Math.max(0, i + e)),
t = 1 === arguments.length ? i - e : null == t ? 0 : Math.max(0,
Math.min(t, i - e)),
void 0 === r && (r = EMPTY_ARRAY),
hasInterceptors(this)) {
var o = interceptChange(this, {
object: this.proxy,
type: "splice",
index: e,
removedCount: t,
added: r
});
if (!o)
return EMPTY_ARRAY;
t = o.removedCount,
r = o.added
}
r = 0 === r.length ? r : r.map((function(e) {
return n.enhancer(e, void 0)
}
));
var s = this.spliceItemsIntoValues(e, t, r);
return 0 === t && 0 === r.length || this.notifyArraySplice(e, r,
s),
this.dehanceValues(s)
}
,
e.prototype.spliceItemsIntoValues = function(e, t, r) {
var n;
if (r.length < MAX_SPLICE_SIZE)
return (n = this.values).splice.apply(n, __spread([e, t], r));
var i = this.values.slice(e, e + t);
return this.values = this.values.slice(0, e).concat(r,
this.values.slice(e + t)),
i
}
,
e.prototype.notifyArrayChildUpdate = function(e, t, r) {
var n = !this.owned && isSpyEnabled()
, i = hasListeners(this)
, o = i || n ? {
object: this.proxy,
type: "update",
index: e,
newValue: t,
oldValue: r
} : null;
this.atom.reportChanged(),
i && notifyListeners(this, o)
}
,
e.prototype.notifyArraySplice = function(e, t, r) {
var n = !this.owned && isSpyEnabled()
, i = hasListeners(this)
, o = i || n ? {
object: this.proxy,
type: "splice",
index: e,
removed: r,
added: t,
removedCount: r.length,
addedCount: t.length
} : null;
this.atom.reportChanged(),
i && notifyListeners(this, o)
}
,
e
}()
, arrayExtensions = {
intercept: function(e) {
return this[$mobx].intercept(e)
},
observe: function(e, t) {
return void 0 === t && (t = !1),
this[$mobx].observe(e, t)
},
clear: function() {
return this.splice(0)
},
replace: function(e) {
var t = this[$mobx];
return t.spliceWithArray(0, t.values.length, e)
},
toJS: function() {
return this.slice()
},
toJSON: function() {
return this.toJS()
},
splice: function(e, t) {
for (var r = [], n = 2; n < arguments.length; n++)
r[n - 2] = arguments[n];
var i = this[$mobx];
switch (arguments.length) {
case 0:
return [];
case 1:
return i.spliceWithArray(e);
case 2:
return i.spliceWithArray(e, t)
}
return i.spliceWithArray(e, t, r)
},
spliceWithArray: function(e, t, r) {
return this[$mobx].spliceWithArray(e, t, r)
},
push: function() {
for (var e = [], t = 0; t < arguments.length; t++)
e[t] = arguments[t];
var r = this[$mobx];
return r.spliceWithArray(r.values.length, 0, e),
r.values.length
},
pop: function() {
return this.splice(Math.max(this[$mobx].values.length - 1, 0), 1)
[0]
},
shift: function() {
return this.splice(0, 1)[0]
},
unshift: function() {
for (var e = [], t = 0; t < arguments.length; t++)
e[t] = arguments[t];
var r = this[$mobx];
return r.spliceWithArray(0, 0, e),
r.values.length
},
reverse: function() {
var e = this.slice();
return e.reverse.apply(e, arguments)
},
sort: function(e) {
var t = this.slice();
return t.sort.apply(t, arguments)
},
remove: function(e) {
var t = this[$mobx]
, r = t.dehanceValues(t.values).indexOf(e);
return r > -1 && (this.splice(r, 1),
!0)
},
get: function(e) {
var t = this[$mobx];
if (t && e < t.values.length)
return t.atom.reportObserved(),
t.dehanceValue(t.values[e])
},
set: function(e, t) {
var r = this[$mobx]
, n = r.values;
if (e < n.length) {
checkIfStateModificationsAreAllowed(r.atom);
var i = n[e];
if (hasInterceptors(r)) {
var o = interceptChange(r, {
type: "update",
object: r.proxy,
index: e,
newValue: t
});
if (!o)
return;
t = o.newValue
}
(t = r.enhancer(t, i)) !== i && (n[e] = t,
r.notifyArrayChildUpdate(e, t, i))
} else {
if (e !== n.length)
throw new Error("[mobx.array] Index out of bounds, " + e +
" is larger than " + n.length);
r.spliceWithArray(e, 0, [t])
}
}
};
["concat", "flat", "includes", "indexOf", "join", "lastIndexOf", "slice",
"toString", "toLocaleString"].forEach((function(e) {
"function" == typeof Array.prototype[e] && (arrayExtensions[e] =
function() {
var t = this[$mobx];
t.atom.reportObserved();
var r = t.dehanceValues(t.values);
return r[e].apply(r, arguments)
}
)
}
)),
["every", "filter", "find", "findIndex", "flatMap", "forEach", "map",
"some"].forEach((function(e) {
"function" == typeof Array.prototype[e] && (arrayExtensions[e] =
function(t, r) {
var n = this
, i = this[$mobx];
return i.atom.reportObserved(),
i.dehanceValues(i.values)[e]((function(e, i) {
return t.call(r, e, i, n)
}
), r)
}
)
}
)),
["reduce", "reduceRight"].forEach((function(e) {
arrayExtensions[e] = function() {
var t = this
, r = this[$mobx];
r.atom.reportObserved();
var n = arguments[0];
return arguments[0] = function(e, i, o) {
return i = r.dehanceValue(i),
n(e, i, o, t)
}
,
r.values[e].apply(r.values, arguments)
}
}
));
var isObservableArrayAdministration =
createInstanceofPredicate("ObservableArrayAdministration",
ObservableArrayAdministration), _a$3;
function isObservableArray(e) {
return isObject$j(e) && isObservableArrayAdministration(e[$mobx])
}
var ObservableMapMarker = {}, ObservableMap = function() {
function e(e, t, r) {
if (void 0 === t && (t = deepEnhancer),
void 0 === r && (r = "ObservableMap@" + getNextId()),
this.enhancer = t,
this.name = r,
this[_a$3] = ObservableMapMarker,
this._keysAtom = createAtom(this.name + ".keys()"),
this[Symbol.toStringTag] = "Map",
"function" != typeof Map)
throw new Error("mobx.map requires Map polyfill for the current
browser. Check babel-polyfill or core-js/es6/map.js");
this._data = new Map,
this._hasMap = new Map,
this.merge(e)
}
return e.prototype._has = function(e) {
return this._data.has(e)
}
,
e.prototype.has = function(e) {
var t = this;
if (!globalState.trackingDerivation)
return this._has(e);
var r = this._hasMap.get(e);
if (!r) {
var n = r = new
ObservableValue(this._has(e),referenceEnhancer,this.name + "." + stringifyKey(e) +
"?",!1);
this._hasMap.set(e, n),
onBecomeUnobserved(n, (function() {
return t._hasMap.delete(e)
}
))
}
return r.get()
}
,
e.prototype.set = function(e, t) {
var r = this._has(e);
if (hasInterceptors(this)) {
var n = interceptChange(this, {
type: r ? "update" : "add",
object: this,
newValue: t,
name: e
});
if (!n)
return this;
t = n.newValue
}
return r ? this._updateValue(e, t) : this._addValue(e, t),
this
}
,
e.prototype.delete = function(e) {
var t = this;
if ((checkIfStateModificationsAreAllowed(this._keysAtom),
hasInterceptors(this)) && !(i = interceptChange(this, {
type: "delete",
object: this,
name: e
})))
return !1;
if (this._has(e)) {
var r = isSpyEnabled()
, n = hasListeners(this)
, i = n || r ? {
type: "delete",
object: this,
oldValue: this._data.get(e).value,
name: e
} : null;
return transaction((function() {
t._keysAtom.reportChanged(),
t._updateHasMapEntry(e, !1),
t._data.get(e).setNewValue(void 0),
t._data.delete(e)
}
)),
n && notifyListeners(this, i),
!0
}
return !1
}
,
e.prototype._updateHasMapEntry = function(e, t) {
var r = this._hasMap.get(e);
r && r.setNewValue(t)
}
,
e.prototype._updateValue = function(e, t) {
var r = this._data.get(e);
if ((t = r.prepareNewValue(t)) !== globalState.UNCHANGED) {
var n = isSpyEnabled()
, i = hasListeners(this)
, o = i || n ? {
type: "update",
object: this,
oldValue: r.value,
name: e,
newValue: t
} : null;
0,
r.setNewValue(t),
i && notifyListeners(this, o)
}
}
,
e.prototype._addValue = function(e, t) {
var r = this;
checkIfStateModificationsAreAllowed(this._keysAtom),
transaction((function() {
var n = new ObservableValue(t,r.enhancer,r.name + "." +
stringifyKey(e),!1);
r._data.set(e, n),
t = n.value,
r._updateHasMapEntry(e, !0),
r._keysAtom.reportChanged()
}
));
var n = isSpyEnabled()
, i = hasListeners(this);
i && notifyListeners(this, i || n ? {
type: "add",
object: this,
name: e,
newValue: t
} : null)
}
,
e.prototype.get = function(e) {
return this.has(e) ? this.dehanceValue(this._data.get(e).get()) :
this.dehanceValue(void 0)
}
,
e.prototype.dehanceValue = function(e) {
return void 0 !== this.dehancer ? this.dehancer(e) : e
}
,
e.prototype.keys = function() {
return this._keysAtom.reportObserved(),
this._data.keys()
}
,
e.prototype.values = function() {
var e = this
, t = this.keys();
return makeIterable({
next: function() {
var r = t.next()
, n = r.done
, i = r.value;
return {
done: n,
value: n ? void 0 : e.get(i)
}
}
})
}
,
e.prototype.entries = function() {
var e = this
, t = this.keys();
return makeIterable({
next: function() {
var r = t.next()
, n = r.done
, i = r.value;
return {
done: n,
value: n ? void 0 : [i, e.get(i)]
}
}
})
}
,
e.prototype[(_a$3 = $mobx,
Symbol.iterator)] = function() {
return this.entries()
}
,
e.prototype.forEach = function(e, t) {
var r, n;
try {
for (var i = __values$1(this), o = i.next(); !o.done; o =
i.next()) {
var s = __read$2(o.value, 2)
, a = s[0]
, l = s[1];
e.call(t, l, a, this)
}
} catch (c) {
r = {
error: c
}
} finally {
try {
o && !o.done && (n = i.return) && n.call(i)
} finally {
if (r)
throw r.error
}
}
}
,
e.prototype.merge = function(e) {
var t = this;
return isObservableMap(e) && (e = e.toJS()),
transaction((function() {
var r = allowStateChangesStart(!0);
try {
isPlainObject$6(e) ?
getPlainObjectKeys(e).forEach((function(r) {
return t.set(r, e[r])
}
)) : Array.isArray(e) ? e.forEach((function(e) {
var r = __read$2(e, 2)
, n = r[0]
, i = r[1];
return t.set(n, i)
}
)) : isES6Map(e) ? (e.constructor !== Map && fail("Cannot
initialize from classes that inherit from Map: " + e.constructor.name),
e.forEach((function(e, r) {
return t.set(r, e)
}
))) : null != e && fail("Cannot initialize map from " + e)
} finally {
allowStateChangesEnd(r)
}
}
)),
this
}
,
e.prototype.clear = function() {
var e = this;
transaction((function() {
untracked((function() {
var t, r;
try {
for (var n = __values$1(e.keys()), i = n.next(); !
i.done; i = n.next()) {
var o = i.value;
e.delete(o)
}
} catch (s) {
t = {
error: s
}
} finally {
try {
i && !i.done && (r = n.return) && r.call(n)
} finally {
if (t)
throw t.error
}
}
}
))
}
))
}
,
e.prototype.replace = function(e) {
var t = this;
return transaction((function() {
var r, n, i, o, s = convertToMap(e), a = new Map, l = !1;
try {
for (var c = __values$1(t._data.keys()), u = c.next(); !
u.done; u = c.next()) {
var d = u.value;
if (!s.has(d))
if (t.delete(d))
l = !0;
else {
var p = t._data.get(d);
a.set(d, p)
}
}
} catch (E) {
r = {
error: E
}
} finally {
try {
u && !u.done && (n = c.return) && n.call(c)
} finally {
if (r)
throw r.error
}
}
try {
for (var h = __values$1(s.entries()), f = h.next(); !
f.done; f = h.next()) {
var m = __read$2(f.value, 2)
, g = (d = m[0],
p = m[1],
t._data.has(d));
if (t.set(d, p),
t._data.has(d)) {
var y = t._data.get(d);
a.set(d, y),
g || (l = !0)
}
}
} catch (T) {
i = {
error: T
}
} finally {
try {
f && !f.done && (o = h.return) && o.call(h)
} finally {
if (i)
throw i.error
}
}
if (!l)
if (t._data.size !== a.size)
t._keysAtom.reportChanged();
else
for (var v = t._data.keys(), b = a.keys(), x =
v.next(), _ = b.next(); !x.done; ) {
if (x.value !== _.value) {
t._keysAtom.reportChanged();
break
}
x = v.next(),
_ = b.next()
}
t._data = a
}
)),
this
}
,
Object.defineProperty(e.prototype, "size", {
get: function() {
return this._keysAtom.reportObserved(),
this._data.size
},
enumerable: !0,
configurable: !0
}),
e.prototype.toPOJO = function() {
var e, t, r = {};
try {
for (var n = __values$1(this), i = n.next(); !i.done; i =
n.next()) {
var o = __read$2(i.value, 2)
, s = o[0]
, a = o[1];
r["symbol" == typeof s ? s : stringifyKey(s)] = a
}
} catch (l) {
e = {
error: l
}
} finally {
try {
i && !i.done && (t = n.return) && t.call(n)
} finally {
if (e)
throw e.error
}
}
return r
}
,
e.prototype.toJS = function() {
return new Map(this)
}
,
e.prototype.toJSON = function() {
return this.toPOJO()
}
,
e.prototype.toString = function() {
var e = this;
return this.name + "[{ " + Array.from(this.keys()).map((function(t)
{
return stringifyKey(t) + ": " + e.get(t)
}
)).join(", ") + " }]"
}
,
e.prototype.observe = function(e, t) {
return registerListener(this, e)
}
,
e.prototype.intercept = function(e) {
return registerInterceptor(this, e)
}
,
e
}(), isObservableMap = createInstanceofPredicate("ObservableMap",
ObservableMap), _a$1$1, ObservableSetMarker = {}, ObservableSet = function() {
function e(e, t, r) {
if (void 0 === t && (t = deepEnhancer),
void 0 === r && (r = "ObservableSet@" + getNextId()),
this.name = r,
this[_a$1$1] = ObservableSetMarker,
this._data = new Set,
this._atom = createAtom(this.name),
this[Symbol.toStringTag] = "Set",
"function" != typeof Set)
throw new Error("mobx.set requires Set polyfill for the current
browser. Check babel-polyfill or core-js/es6/set.js");
this.enhancer = function(e, n) {
return t(e, n, r)
}
,
e && this.replace(e)
}
return e.prototype.dehanceValue = function(e) {
return void 0 !== this.dehancer ? this.dehancer(e) : e
}
,
e.prototype.clear = function() {
var e = this;
transaction((function() {
untracked((function() {
var t, r;
try {
for (var n = __values$1(e._data.values()), i =
n.next(); !i.done; i = n.next()) {
var o = i.value;
e.delete(o)
}
} catch (s) {
t = {
error: s
}
} finally {
try {
i && !i.done && (r = n.return) && r.call(n)
} finally {
if (t)
throw t.error
}
}
}
))
}
))
}
,
e.prototype.forEach = function(e, t) {
var r, n;
try {
for (var i = __values$1(this), o = i.next(); !o.done; o =
i.next()) {
var s = o.value;
e.call(t, s, s, this)
}
} catch (a) {
r = {
error: a
}
} finally {
try {
o && !o.done && (n = i.return) && n.call(i)
} finally {
if (r)
throw r.error
}
}
}
,
Object.defineProperty(e.prototype, "size", {
get: function() {
return this._atom.reportObserved(),
this._data.size
},
enumerable: !0,
configurable: !0
}),
e.prototype.add = function(e) {
var t = this;
if ((checkIfStateModificationsAreAllowed(this._atom),
hasInterceptors(this)) && !(i = interceptChange(this, {
type: "add",
object: this,
newValue: e
})))
return this;
if (!this.has(e)) {
transaction((function() {
t._data.add(t.enhancer(e, void 0)),
t._atom.reportChanged()
}
));
var r = isSpyEnabled()
, n = hasListeners(this)
, i = n || r ? {
type: "add",
object: this,
newValue: e
} : null;
n && notifyListeners(this, i)
}
return this
}
,
e.prototype.delete = function(e) {
var t = this;
if (hasInterceptors(this) && !(i = interceptChange(this, {
type: "delete",
object: this,
oldValue: e
})))
return !1;
if (this.has(e)) {
var r = isSpyEnabled()
, n = hasListeners(this)
, i = n || r ? {
type: "delete",
object: this,
oldValue: e
} : null;
return transaction((function() {
t._atom.reportChanged(),
t._data.delete(e)
}
)),
n && notifyListeners(this, i),
!0
}
return !1
}
,
e.prototype.has = function(e) {
return this._atom.reportObserved(),
this._data.has(this.dehanceValue(e))
}
,
e.prototype.entries = function() {
var e = 0
, t = Array.from(this.keys())
, r = Array.from(this.values());
return makeIterable({
next: function() {
var n = e;
return e += 1,
n < r.length ? {
value: [t[n], r[n]],
done: !1
} : {
done: !0
}
}
})
}
,
e.prototype.keys = function() {
return this.values()
}
,
e.prototype.values = function() {
this._atom.reportObserved();
var e = this
, t = 0
, r = Array.from(this._data.values());
return makeIterable({
next: function() {
return t < r.length ? {
value: e.dehanceValue(r[t++]),
done: !1
} : {
done: !0
}
}
})
}
,
e.prototype.replace = function(e) {
var t = this;
return isObservableSet(e) && (e = e.toJS()),
transaction((function() {
var r = allowStateChangesStart(!0);
try {
Array.isArray(e) || isES6Set(e) ? (t.clear(),
e.forEach((function(e) {
return t.add(e)
}
))) : null != e && fail("Cannot initialize set from " + e)
} finally {
allowStateChangesEnd(r)
}
}
)),
this
}
,
e.prototype.observe = function(e, t) {
return registerListener(this, e)
}
,
e.prototype.intercept = function(e) {
return registerInterceptor(this, e)
}
,
e.prototype.toJS = function() {
return new Set(this)
}
,
e.prototype.toString = function() {
return this.name + "[ " + Array.from(this).join(", ") + " ]"
}
,
e.prototype[(_a$1$1 = $mobx,
Symbol.iterator)] = function() {
return this.values()
}
,
e
}(), isObservableSet = createInstanceofPredicate("ObservableSet",
ObservableSet), ObservableObjectAdministration = function() {
function e(e, t, r, n) {
void 0 === t && (t = new Map),
this.target = e,
this.values = t,
this.name = r,
this.defaultEnhancer = n,
this.keysAtom = new Atom(r + ".keys")
}
return e.prototype.read = function(e) {
return this.values.get(e).get()
}
,
e.prototype.write = function(e, t) {
var r = this.target
, n = this.values.get(e);
if (n instanceof ComputedValue)
n.set(t);
else {
if (hasInterceptors(this)) {
if (!(s = interceptChange(this, {
type: "update",
object: this.proxy || r,
name: e,
newValue: t
})))
return;
t = s.newValue
}
if ((t = n.prepareNewValue(t)) !== globalState.UNCHANGED) {
var i = hasListeners(this)
, o = isSpyEnabled()
, s = i || o ? {
type: "update",
object: this.proxy || r,
oldValue: n.value,
name: e,
newValue: t
} : null;
0,
n.setNewValue(t),
i && notifyListeners(this, s)
}
}
}
,
e.prototype.has = function(e) {
var t = this.pendingKeys || (this.pendingKeys = new Map)
, r = t.get(e);
if (r)
return r.get();
var n = !!this.values.get(e);
return r = new ObservableValue(n,referenceEnhancer,this.name + "."
+ stringifyKey(e) + "?",!1),
t.set(e, r),
r.get()
}
,
e.prototype.addObservableProp = function(e, t, r) {
void 0 === r && (r = this.defaultEnhancer);
var n = this.target;
if (hasInterceptors(this)) {
var i = interceptChange(this, {
object: this.proxy || n,
name: e,
type: "add",
newValue: t
});
if (!i)
return;
t = i.newValue
}
var o = new ObservableValue(t,r,this.name + "." + stringifyKey(e),!
1);
this.values.set(e, o),
t = o.value,
Object.defineProperty(n, e, generateObservablePropConfig(e)),
this.notifyPropertyAddition(e, t)
}
,
e.prototype.addComputedProp = function(e, t, r) {
var n = this.target;
r.name = r.name || this.name + "." + stringifyKey(t),
this.values.set(t, new ComputedValue(r)),
(e === n || isPropertyConfigurable(e, t)) &&
Object.defineProperty(e, t, generateComputedPropConfig(t))
}
,
e.prototype.remove = function(e) {
if (this.values.has(e)) {
var t = this.target;
if (hasInterceptors(this))
if (!(a = interceptChange(this, {
object: this.proxy || t,
name: e,
type: "remove"
})))
return;
try {
startBatch();
var r = hasListeners(this)
, n = isSpyEnabled()
, i = this.values.get(e)
, o = i && i.get();
if (i && i.set(void 0),
this.keysAtom.reportChanged(),
this.values.delete(e),
this.pendingKeys) {
var s = this.pendingKeys.get(e);
s && s.set(!1)
}
delete this.target[e];
var a = r || n ? {
type: "remove",
object: this.proxy || t,
oldValue: o,
name: e
} : null;
0,
r && notifyListeners(this, a)
} finally {
endBatch()
}
}
}
,
e.prototype.illegalAccess = function(e, t) {}
,
e.prototype.observe = function(e, t) {
return registerListener(this, e)
}
,
e.prototype.intercept = function(e) {
return registerInterceptor(this, e)
}
,
e.prototype.notifyPropertyAddition = function(e, t) {
var r = hasListeners(this)
, n = isSpyEnabled()
, i = r || n ? {
type: "add",
object: this.proxy || this.target,
name: e,
newValue: t
} : null;
if (r && notifyListeners(this, i),
this.pendingKeys) {
var o = this.pendingKeys.get(e);
o && o.set(!0)
}
this.keysAtom.reportChanged()
}
,
e.prototype.getKeys = function() {
var e, t;
this.keysAtom.reportObserved();
var r = [];
try {
for (var n = __values$1(this.values), i = n.next(); !i.done; i
= n.next()) {
var o = __read$2(i.value, 2)
, s = o[0];
o[1]instanceof ObservableValue && r.push(s)
}
} catch (a) {
e = {
error: a
}
} finally {
try {
i && !i.done && (t = n.return) && t.call(n)
} finally {
if (e)
throw e.error
}
}
return r
}
,
e
}();
function asObservableObject(e, t, r) {
if (void 0 === t && (t = ""),
void 0 === r && (r = deepEnhancer),
Object.prototype.hasOwnProperty.call(e, $mobx))
return e[$mobx];
isPlainObject$6(e) || (t = (e.constructor.name || "ObservableObject") +
"@" + getNextId()),
t || (t = "ObservableObject@" + getNextId());
var n = new ObservableObjectAdministration(e,new
Map,stringifyKey(t),r);
return addHiddenProp(e, $mobx, n),
n
}
var observablePropertyConfigs = Object.create(null)
, computedPropertyConfigs = Object.create(null);
function generateObservablePropConfig(e) {
return observablePropertyConfigs[e] || (observablePropertyConfigs[e] =
{
configurable: !0,
enumerable: !0,
get: function() {
return this[$mobx].read(e)
},
set: function(t) {
this[$mobx].write(e, t)
}
})
}
function getAdministrationForComputedPropOwner(e) {
var t = e[$mobx];
return t || (initializeInstance(e),
e[$mobx])
}
function generateComputedPropConfig(e) {
return computedPropertyConfigs[e] || (computedPropertyConfigs[e] = {
configurable: globalState.computedConfigurable,
enumerable: !1,
get: function() {
return getAdministrationForComputedPropOwner(this).read(e)
},
set: function(t) {
getAdministrationForComputedPropOwner(this).write(e, t)
}
})
}
var isObservableObjectAdministration =
createInstanceofPredicate("ObservableObjectAdministration",
ObservableObjectAdministration);
function isObservableObject(e) {
return !!isObject$j(e) && (initializeInstance(e),
isObservableObjectAdministration(e[$mobx]))
}
function getAtom(e, t) {
if ("object" == typeof e && null !== e) {
if (isObservableArray(e))
return void 0 !== t && fail(!1),
e[$mobx].atom;
if (isObservableSet(e))
return e[$mobx];
if (isObservableMap(e)) {
var r = e;
return void 0 === t ? r._keysAtom : ((n = r._data.get(t) ||
r._hasMap.get(t)) || fail(!1),
n)
}
var n;
if (initializeInstance(e),
t && !e[$mobx] && e[t],
isObservableObject(e))
return t ? ((n = e[$mobx].values.get(t)) || fail(!1),
n) : fail(!1);
if (isAtom(e) || isComputedValue(e) || isReaction(e))
return e
} else if ("function" == typeof e && isReaction(e[$mobx]))
return e[$mobx];
return fail(!1)
}
function getAdministration(e, t) {
return e || fail("Expecting some object"),
void 0 !== t ? getAdministration(getAtom(e, t)) : isAtom(e) ||
isComputedValue(e) || isReaction(e) || isObservableMap(e) || isObservableSet(e) ? e
: (initializeInstance(e),
e[$mobx] ? e[$mobx] : void fail(!1))
}
function getDebugName(e, t) {
return (void 0 !== t ? getAtom(e, t) : isObservableObject(e) ||
isObservableMap(e) || isObservableSet(e) ? getAdministration(e) : getAtom(e)).name
}
var toString$6 = Object.prototype.toString, g$6;
function deepEqual(e, t, r) {
return void 0 === r && (r = -1),
eq$8(e, t, r)
}
function eq$8(e, t, r, n, i) {
if (e === t)
return 0 !== e || 1 / e == 1 / t;
if (null == e || null == t)
return !1;
if (e != e)
return t != t;
var o = typeof e;
if ("function" !== o && "object" !== o && "object" != typeof t)
return !1;
var s = toString$6.call(e);
if (s !== toString$6.call(t))
return !1;
switch (s) {
case "[object RegExp]":
case "[object String]":
return "" + e == "" + t;
case "[object Number]":
return +e != +e ? +t != +t : 0 == +e ? 1 / +e == 1 / t : +e == +t;
case "[object Date]":
case "[object Boolean]":
return +e == +t;
case "[object Symbol]":
return "undefined" != typeof Symbol && Symbol.valueOf.call(e) ===
Symbol.valueOf.call(t);
case "[object Map]":
case "[object Set]":
r >= 0 && r++
}
e = unwrap(e),
t = unwrap(t);
var a = "[object Array]" === s;
if (!a) {
if ("object" != typeof e || "object" != typeof t)
return !1;
var l = e.constructor
, c = t.constructor;
if (l !== c && !("function" == typeof l && l instanceof l &&
"function" == typeof c && c instanceof c) && "constructor"in e && "constructor"in
t)
return !1
}
if (0 === r)
return !1;
r < 0 && (r = -1),
i = i || [];
for (var u = (n = n || []).length; u--; )
if (n[u] === e)
return i[u] === t;
if (n.push(e),
i.push(t),
a) {
if ((u = e.length) !== t.length)
return !1;
for (; u--; )
if (!eq$8(e[u], t[u], r - 1, n, i))
return !1
} else {
var d = Object.keys(e)
, p = void 0;
if (u = d.length,
Object.keys(t).length !== u)
return !1;
for (; u--; )
if (!has$1$1(t, p = d[u]) || !eq$8(e[p], t[p], r - 1, n, i))
return !1
}
return n.pop(),
i.pop(),
!0
}
function unwrap(e) {
return isObservableArray(e) ? e.slice() : isES6Map(e) ||
isObservableMap(e) || isES6Set(e) || isObservableSet(e) ? Array.from(e.entries()) :
e
}
function has$1$1(e, t) {
return Object.prototype.hasOwnProperty.call(e, t)
}
function makeIterable(e) {
return e[Symbol.iterator] = getSelf,
e
}
function getSelf() {
return this
}
if ("undefined" == typeof Proxy || "undefined" == typeof Symbol)
throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If
your environment doesn't support Symbol or Proxy objects, please downgrade to MobX
4. For React Native Android, consider upgrading JSCore.");
"object" == typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ &&
__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({
spy: spy,
extras: {
getDebugName: getDebugName
},
$mobx: $mobx
});
const config$3 = {
secretKey: "x&S#acLCx",
apiHost: "",
prefix: "video",
resourcesHost: "https://cdn.h5ds.com",
workerPath: "/worker",
host: "https://video.h5ds.com",
basename: "editor",
env: "dev"
};
function safeGet$4(e) {
try {
return JSON.parse(e)
} catch (e2) {
return null
}
}
config$3.env = "prod",
config$3.workerPath = "/assets/worker",
config$3.apiHost = window.apiHost || "";
class WebStorage {
constructor(e) {
this.SECRET_KEY = void 0,
this._storage = void 0,
this.SECRET_KEY = "7NlEQ@10",
this._storage = e
}
randomID(e=8) {
return Number(Math.random().toString().substr(3, e) +
Date.now()).toString(36)
}
get(e) {
let t = null;
return t = this._storage.getItem(`${config$3.prefix}-${e}`),
safeGet$4(t)
}
set(e, t) {
let r = "";
r = "boolean" != typeof t ? JSON.stringify(t) : t,
this._storage.setItem(`${config$3.prefix}-${e}`, r)
}
remove(e) {
this._storage.removeItem(`${config$3.prefix}-${e}`)
}
clear() {
this._storage.clear()
}
}
class MemoryStorage {
constructor() {
this.$dataMap = void 0,
this.$dataMap = new Map
}
get(e) {
this.$dataMap.get(`${config$3.prefix}-${e}`)
}
set(e, t) {
this.$dataMap.set(`${config$3.prefix}-${e}`, t)
}
remove(e) {
this.$dataMap.delete(`${config$3.prefix}-${e}`)
}
}
const storage = {
local: new WebStorage(localStorage),
session: new WebStorage(sessionStorage),
memory: new MemoryStorage
};
var pubsub$1 = {
exports: {}
}, module2, exports2, root2, PubSub;
pubsub$1.exports,
module2 = pubsub$1,
exports2 = pubsub$1.exports,
root2 = "object" == typeof window && window || commonjsGlobal$1,
PubSub = {},
root2.PubSub ? PubSub = root2.PubSub : (root2.PubSub = PubSub,
function(e) {
var t = {}
, r = -1
, n = "*";
function i(e) {
var t;
for (t in e)
if (Object.prototype.hasOwnProperty.call(e, t))
return !0;
return !1
}
function o(e) {
return function() {
throw e
}
}
function s(e, t, r) {
try {
e(t, r)
} catch (n) {
setTimeout(o(n), 0)
}
}
function a(e, t, r) {
e(t, r)
}
function l(e, r, n, i) {
var o, l = t[r], c = i ? a : s;
if (Object.prototype.hasOwnProperty.call(t, r))
for (o in l)
Object.prototype.hasOwnProperty.call(l, o) && c(l[o], e, n)
}
function c(e, t, r) {
return function() {
var i = String(e)
, o = i.lastIndexOf(".");
for (l(e, e, t, r); -1 !== o; )
o = (i = i.substr(0, o)).lastIndexOf("."),
l(e, i, t, r);
l(e, n, t, r)
}
}
function u(e) {
var r = String(e);
return Boolean(Object.prototype.hasOwnProperty.call(t, r) &&
i(t[r]))
}
function d(e) {
for (var t = String(e), r = u(t) || u(n), i = t.lastIndexOf("."); !
r && -1 !== i; )
i = (t = t.substr(0, i)).lastIndexOf("."),
r = u(t);
return r
}
function p(e, t, r, n) {
var i = c(e = "symbol" == typeof e ? e.toString() : e, t, n);
return !!d(e) && (!0 === r ? i() : setTimeout(i, 0),
!0)
}
e.publish = function(t, r) {
return p(t, r, !1, e.immediateExceptions)
}
,
e.publishSync = function(t, r) {
return p(t, r, !0, e.immediateExceptions)
}
,
e.subscribe = function(e, n) {
if ("function" != typeof n)
return !1;
e = "symbol" == typeof e ? e.toString() : e,
Object.prototype.hasOwnProperty.call(t, e) || (t[e] = {});
var i = "uid_" + String(++r);
return t[e][i] = n,
i
}
,
e.subscribeAll = function(t) {
return e.subscribe(n, t)
}
,
e.subscribeOnce = function(t, r) {
var n = e.subscribe(t, (function() {
e.unsubscribe(n),
r.apply(this, arguments)
}
));
return e
}
,
e.clearAllSubscriptions = function() {
t = {}
}
,
e.clearSubscriptions = function(e) {
var r;
for (r in t)
Object.prototype.hasOwnProperty.call(t, r) && 0 ===
r.indexOf(e) && delete t[r]
}
,
e.countSubscriptions = function(e) {
var r, n, i = 0;
for (r in t)
if (Object.prototype.hasOwnProperty.call(t, r) && 0 ===
r.indexOf(e)) {
for (n in t[r])
i++;
break
}
return i
}
,
e.getSubscriptions = function(e) {
var r, n = [];
for (r in t)
Object.prototype.hasOwnProperty.call(t, r) && 0 ===
r.indexOf(e) && n.push(r);
return n
}
,
e.unsubscribe = function(r) {
var n, i, o, s = function(e) {
var r;
for (r in t)
if (Object.prototype.hasOwnProperty.call(t, r) && 0 ===
r.indexOf(e))
return !0;
return !1
}, a = "string" == typeof r &&
(Object.prototype.hasOwnProperty.call(t, r) || s(r)), l = !a && "string" == typeof
r, c = "function" == typeof r, u = !1;
if (!a) {
for (n in t)
if (Object.prototype.hasOwnProperty.call(t, n)) {
if (i = t[n],
l && i[r]) {
delete i[r],
u = r;
break
}
if (c)
for (o in i)
Object.prototype.hasOwnProperty.call(i, o) &&
i[o] === r && (delete i[o],
u = !0)
}
return u
}
e.clearSubscriptions(r)
}
}(PubSub)),
void 0 !== module2 && module2.exports && (exports2 = module2.exports =
PubSub),
exports2.PubSub = PubSub,
module2.exports = exports2 = PubSub;
var pubsubExports = pubsub$1.exports;
const pubsub = getDefaultExportFromCjs(pubsubExports);
var dayjs_min = {
exports: {}
};
!function(e, t) {
e.exports = function() {
var e = 1e3
, t = 6e4
, r = 36e5
, n = "millisecond"
, i = "second"
, o = "minute"
, s = "hour"
, a = "day"
, l = "week"
, c = "month"
, u = "quarter"
, d = "year"
, p = "date"
, h = "Invalid Date"
, f = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\
d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/
, m = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|
m{1,2}|s{1,2}|Z{1,2}|SSS/g
, g = {
name: "en",
weekdays:
"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
months:
"January_February_March_April_May_June_July_August_September_October_November_Decem
ber".split("_"),
ordinal: function(e) {
var t = ["th", "st", "nd", "rd"]
, r = e % 100;
return "[" + e + (t[(r - 20) % 10] || t[r] || t[0]) + "]"
}
}
, y = function(e, t, r) {
var n = String(e);
return !n || n.length >= t ? e : "" + Array(t + 1 -
n.length).join(r) + e
}
, v = {
s: y,
z: function(e) {
var t = -e.utcOffset()
, r = Math.abs(t)
, n = Math.floor(r / 60)
, i = r % 60;
return (t <= 0 ? "+" : "-") + y(n, 2, "0") + ":" + y(i, 2,
"0")
},
m: function e(t, r) {
if (t.date() < r.date())
return -e(r, t);
var n = 12 * (r.year() - t.year()) + (r.month() -
t.month())
, i = t.clone().add(n, c)
, o = r - i < 0
, s = t.clone().add(n + (o ? -1 : 1), c);
return +(-(n + (r - i) / (o ? i - s : s - i)) || 0)
},
a: function(e) {
return e < 0 ? Math.ceil(e) || 0 : Math.floor(e)
},
p: function(e) {
return {
M: c,
y: d,
w: l,
d: a,
D: p,
h: s,
m: o,
s: i,
ms: n,
Q: u
}[e] || String(e || "").toLowerCase().replace(/s$/, "")
},
u: function(e) {
return void 0 === e
}
}
, b = "en"
, x = {};
x[b] = g;
var _ = "$isDayjsObject"
, E = function(e) {
return e instanceof $ || !(!e || !e[_])
}
, T = function e(t, r, n) {
var i;
if (!t)
return b;
if ("string" == typeof t) {
var o = t.toLowerCase();
x[o] && (i = o),
r && (x[o] = r,
i = o);
var s = t.split("-");
if (!i && s.length > 1)
return e(s[0])
} else {
var a = t.name;
x[a] = t,
i = a
}
return !n && i && (b = i),
i || !n && b
}
, C = function(e, t) {
if (E(e))
return e.clone();
var r = "object" == typeof t ? t : {};
return r.date = e,
r.args = arguments,
new $(r)
}
, S = v;
S.l = T,
S.i = E,
S.w = function(e, t) {
return C(e, {
locale: t.$L,
utc: t.$u,
x: t.$x,
$offset: t.$offset
})
}
;
var $ = function() {
function g(e) {
this.$L = T(e.locale, null, !0),
this.parse(e),
this.$x = this.$x || e.x || {},
this[_] = !0
}
var y = g.prototype;
return y.parse = function(e) {
this.$d = function(e) {
var t = e.date
, r = e.utc;
if (null === t)
return new Date(NaN);
if (S.u(t))
return new Date;
if (t instanceof Date)
return new Date(t);
if ("string" == typeof t && !/Z$/i.test(t)) {
var n = t.match(f);
if (n) {
var i = n[2] - 1 || 0
, o = (n[7] || "0").substring(0, 3);
return r ? new Date(Date.UTC(n[1], i, n[3] ||
1, n[4] || 0, n[5] || 0, n[6] || 0, o)) : new Date(n[1],i,n[3] || 1,n[4] || 0,n[5]
|| 0,n[6] || 0,o)
}
}
return new Date(t)
}(e),
this.init()
}
,
y.init = function() {
var e = this.$d;
this.$y = e.getFullYear(),
this.$M = e.getMonth(),
this.$D = e.getDate(),
this.$W = e.getDay(),
this.$H = e.getHours(),
this.$m = e.getMinutes(),
this.$s = e.getSeconds(),
this.$ms = e.getMilliseconds()
}
,
y.$utils = function() {
return S
}
,
y.isValid = function() {
return !(this.$d.toString() === h)
}
,
y.isSame = function(e, t) {
var r = C(e);
return this.startOf(t) <= r && r <= this.endOf(t)
}
,
y.isAfter = function(e, t) {
return C(e) < this.startOf(t)
}
,
y.isBefore = function(e, t) {
return this.endOf(t) < C(e)
}
,
y.$g = function(e, t, r) {
return S.u(e) ? this[t] : this.set(r, e)
}
,
y.unix = function() {
return Math.floor(this.valueOf() / 1e3)
}
,
y.valueOf = function() {
return this.$d.getTime()
}
,
y.startOf = function(e, t) {
var r = this
, n = !!S.u(t) || t
, u = S.p(e)
, h = function(e, t) {
var i = S.w(r.$u ? Date.UTC(r.$y, t, e) : new Date(r.
$y,t,e), r);
return n ? i : i.endOf(a)
}
, f = function(e, t) {
return S.w(r.toDate()[e].apply(r.toDate("s"), (n ? [0,
0, 0, 0] : [23, 59, 59, 999]).slice(t)), r)
}
, m = this.$W
, g = this.$M
, y = this.$D
, v = "set" + (this.$u ? "UTC" : "");
switch (u) {
case d:
return n ? h(1, 0) : h(31, 11);
case c:
return n ? h(1, g) : h(0, g + 1);
case l:
var b = this.$locale().weekStart || 0
, x = (m < b ? m + 7 : m) - b;
return h(n ? y - x : y + (6 - x), g);
case a:
case p:
return f(v + "Hours", 0);
case s:
return f(v + "Minutes", 1);
case o:
return f(v + "Seconds", 2);
case i:
return f(v + "Milliseconds", 3);
default:
return this.clone()
}
}
,
y.endOf = function(e) {
return this.startOf(e, !1)
}
,
y.$set = function(e, t) {
var r, l = S.p(e), u = "set" + (this.$u ? "UTC" : ""), h =
(r = {},
r[a] = u + "Date",
r[p] = u + "Date",
r[c] = u + "Month",
r[d] = u + "FullYear",
r[s] = u + "Hours",
r[o] = u + "Minutes",
r[i] = u + "Seconds",
r[n] = u + "Milliseconds",
r)[l], f = l === a ? this.$D + (t - this.$W) : t;
if (l === c || l === d) {
var m = this.clone().set(p, 1);
m.$d[h](f),
m.init(),
this.$d = m.set(p, Math.min(this.$D, m.daysInMonth())).
$d
} else
h && this.$d[h](f);
return this.init(),
this
}
,
y.set = function(e, t) {
return this.clone().$set(e, t)
}
,
y.get = function(e) {
return this[S.p(e)]()
}
,
y.add = function(n, u) {
var p, h = this;
n = Number(n);
var f = S.p(u)
, m = function(e) {
var t = C(h);
return S.w(t.date(t.date() + Math.round(e * n)), h)
};
if (f === c)
return this.set(c, this.$M + n);
if (f === d)
return this.set(d, this.$y + n);
if (f === a)
return m(1);
if (f === l)
return m(7);
var g = (p = {},
p[o] = t,
p[s] = r,
p[i] = e,
p)[f] || 1
, y = this.$d.getTime() + n * g;
return S.w(y, this)
}
,
y.subtract = function(e, t) {
return this.add(-1 * e, t)
}
,
y.format = function(e) {
var t = this
, r = this.$locale();
if (!this.isValid())
return r.invalidDate || h;
var n = e || "YYYY-MM-DDTHH:mm:ssZ"
, i = S.z(this)
, o = this.$H
, s = this.$m
, a = this.$M
, l = r.weekdays
, c = r.months
, u = r.meridiem
, d = function(e, r, i, o) {
return e && (e[r] || e(t, n)) || i[r].slice(0, o)
}
, p = function(e) {
return S.s(o % 12 || 12, e, "0")
}
, f = u || function(e, t, r) {
var n = e < 12 ? "AM" : "PM";
return r ? n.toLowerCase() : n
}
;
return n.replace(m, (function(e, n) {
return n || function(e) {
switch (e) {
case "YY":
return String(t.$y).slice(-2);
case "YYYY":
return S.s(t.$y, 4, "0");
case "M":
return a + 1;
case "MM":
return S.s(a + 1, 2, "0");
case "MMM":
return d(r.monthsShort, a, c, 3);
case "MMMM":
return d(c, a);
case "D":
return t.$D;
case "DD":
return S.s(t.$D, 2, "0");
case "d":
return String(t.$W);
case "dd":
return d(r.weekdaysMin, t.$W, l, 2);
case "ddd":
return d(r.weekdaysShort, t.$W, l, 3);
case "dddd":
return l[t.$W];
case "H":
return String(o);
case "HH":
return S.s(o, 2, "0");
case "h":
return p(1);
case "hh":
return p(2);
case "a":
return f(o, s, !0);
case "A":
return f(o, s, !1);
case "m":
return String(s);
case "mm":
return S.s(s, 2, "0");
case "s":
return String(t.$s);
case "ss":
return S.s(t.$s, 2, "0");
case "SSS":
return S.s(t.$ms, 3, "0");
case "Z":
return i
}
return null
}(e) || i.replace(":", "")
}
))
}
,
y.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15)
}
,
y.diff = function(n, p, h) {
var f, m = this, g = S.p(p), y = C(n), v = (y.utcOffset() -
this.utcOffset()) * t, b = this - y, x = function() {
return S.m(m, y)
};
switch (g) {
case d:
f = x() / 12;
break;
case c:
f = x();
break;
case u:
f = x() / 3;
break;
case l:
f = (b - v) / 6048e5;
break;
case a:
f = (b - v) / 864e5;
break;
case s:
f = b / r;
break;
case o:
f = b / t;
break;
case i:
f = b / e;
break;
default:
f = b
}
return h ? f : S.a(f)
}
,
y.daysInMonth = function() {
return this.endOf(c).$D
}
,
y.$locale = function() {
return x[this.$L]
}
,
y.locale = function(e, t) {
if (!e)
return this.$L;
var r = this.clone()
, n = T(e, t, !0);
return n && (r.$L = n),
r
}
,
y.clone = function() {
return S.w(this.$d, this)
}
,
y.toDate = function() {
return new Date(this.valueOf())
}
,
y.toJSON = function() {
return this.isValid() ? this.toISOString() : null
}
,
y.toISOString = function() {
return this.$d.toISOString()
}
,
y.toString = function() {
return this.$d.toUTCString()
}
,
g
}()
, w = $.prototype;
return C.prototype = w,
[["$ms", n], ["$s", i], ["$m", o], ["$H", s], ["$W", a], ["$M", c],
["$y", d], ["$D", p]].forEach((function(e) {
w[e[1]] = function(t) {
return this.$g(t, e[0], e[1])
}
}
)),
C.extend = function(e, t) {
return e.$i || (e(t, $, C),
e.$i = !0),
C
}
,
C.locale = T,
C.isDayjs = E,
C.unix = function(e) {
return C(1e3 * e)
}
,
C.en = x[b],
C.Ls = x,
C.p = {},
C
}()
}(dayjs_min);
var dayjs_minExports = dayjs_min.exports;
const dayjs = getDefaultExportFromCjs(dayjs_minExports);
var simplequerystring = {
exports: {}
};
/*! simple-query-string v1.3.2 - MIT license */
!function(e) {
!function(t, r) {
e.exports ? e.exports = r() : t.simpleQueryString = r()
}(commonjsGlobal$1, (function() {
function e(e) {
return void 0 === e ? null : e ? decodeURIComponent(e) : e
}
function t(e) {
switch (typeof e) {
case "string":
return encodeURIComponent(e);
case "boolean":
return e ? "true" : "false";
case "number":
return isFinite(e) ? e : "";
case "object":
return null == e ? "" : JSON && JSON.stringify ?
encodeURIComponent(JSON.stringify(e)) : "";
default:
return ""
}
}
return Array.isArray || (Array.isArray = function(e) {
return "[object Array]" === Object.prototype.toString.call(e)
}
),
{
version: "1.3.2",
parse: function(t, r, n) {
var i;
r = r || "&",
n = n || "=";
var o = Object.create(null);
if ("string" != typeof t)
return o;
if ((i = t.indexOf("?")) < 0 && t.indexOf(n) < 0)
return o;
i >= 0 && (t = t.substr(i + 1)),
(i = (t = t.replace(/^[\s\uFEFF\xA0\?#&]+|[\s\uFEFF\xA0&]+
$/g, "")).lastIndexOf("#")) > 0 && (t = t.substr(0, i));
var s = t.split(r);
for (i = 0; i < s.length; ++i) {
var a, l, c = s[i].replace(/\+/g, " "), u =
c.indexOf(n);
if (0 !== u && 0 !== c.length) {
u < 0 ? (a = e(c),
l = null) : (a = e(c.substr(0, u)),
l = e(c.substr(u + 1)));
var d = o[a];
void 0 === d ? o[a] = l : Array.isArray(d) ?
d.push(l) : o[a] = [d, l]
}
}
return o
},
stringify: function(e, r, n) {
if (r = r || "&",
n = n || "=",
"object" != typeof e && "function" != typeof e || null ===
e)
return "";
var i = function(e) {
var t, r = Object.prototype.hasOwnProperty, n = [];
for (t in e)
r.call(e, t) && n.push(t);
return n
}(e);
if (!i || !i.length)
return "";
for (var o, s, a, l = [], c = 0; c < i.length; c++)
if (void 0 !== (a = e[s = t(i[c])]) && "function" !=
typeof a)
if (Array.isArray(a))
for (o = 0; o < a.length; ++o)
l.push(s + n + (a[o] ? t(a[o]) : ""));
else
null !== a && (a = t(a)),
l.push(null == a ? s : s + n + a);
return l.join(r)
}
}
}
))
}(simplequerystring);
var simplequerystringExports = simplequerystring.exports;
const simpleQueryString = getDefaultExportFromCjs(simplequerystringExports)
, dateFormatPreset = {
datetime: "YYYY/MM/DD HH:mm:ss",
date: "YYYY/MM/DD",
time: "HH:mm:ss"
};
async function checkVideoUrlHasAudio(e) {
const t = getFileExtension$1(e);
if (["aac", "mp3", "wav"].includes(t))
return !0;
if ("mp4" !== t)
return !1;
const r = await getVideoFile$1(e);
return new Promise((e => {
window.MediaInfo.mediaInfoFactory({
format: "object"
}, (t => {
t.analyzeData(r.size, (async (e, t) => new Uint8Array(await
r.slice(t, t + e).arrayBuffer()))).then((t => {
const r = t.media.track.find((e => "Audio" ===
e["@type"]));
e(!!r)
}
)).catch((t => {
e(!1)
}
))
}
))
}
))
}
async function getVideoFile$1(e, t="video.mp4") {
try {
const r = await fetch(e);
if (!r.ok)
throw new Error(`无法获取视频: ${r.statusText}`);
const n = await r.blob();
return new File([n],t,{
type: n.type
})
} catch (r) {
throw r
}
}
function crashRects$1(e, t) {
const {x: r, y: n, width: i, height: o} = e;
let {x: s, y: a, width: l, height: c} = t
, u = !0;
return (r + i < s || s + l < r || n + o < a || a + c < n) && (u = !1),
u
}
function reJSON(e) {
return "string" == typeof e ? JSON.parse(e) : e
}
function getFileExtension$1(e) {
const t = (e = e.split("?")[0]).split(".");
return t.length > 1 ? t.pop().toLowerCase() : null
}
function getFileTypeByURL(e, t) {
if (t || (t = getFileExtension$1(e)),
!t)
return null;
switch (t.toLocaleLowerCase()) {
case "png":
case "jpeg":
case "jpg":
return "image";
case "gif":
return "image/gif";
case "svg":
return "image/svg";
case "aac":
case "wav":
case "mp3":
return "audio";
case "mp4":
return "video";
default:
return null
}
}
async function drawVideoFrame(e, t, r) {
(e = e.cloneNode()).muted = !0,
e.currentTime = r || 1,
await e.play(),
e.pause();
const n = document.createElement("canvas")
, i = e.videoWidth
, o = e.videoHeight
, s = t / i;
n.width = t,
n.height = Math.floor(o * s),
n.getContext("2d").drawImage(e, 0, 0, n.width, n.height);
return n.toDataURL("image/jpeg")
}
function splitArray$1(e, t) {
const r = [];
for (let n = 0; n < e.length; n += t)
r.push(e.slice(n, n + t));
return r
}
const secToTime$1 = (e, t, r) => {
void 0 === t && (t = "hhmmss");
const n = parseInt(e / 3600 + "")
, i = parseInt((e - 3600 * n) / 60 + "")
, o = e - 3600 * n - 60 * i
, s = n > 9 ? n : "0" + n
, a = i > 9 ? i : "0" + i;
let l = o > 9 ? o : "0" + o;
return l = parseFloat(l + "").toFixed(void 0 === r ? 2 : r),
"mmss" === t ? a + ":" + l : s + ":" + a + ":" + l
}
, getUrlQuery = e => {
const t = simpleQueryString.parse(location.href);
return e ? t[e] : t
}
, delUrlParam = e => {
let t = window.location.href;
const r = window.location.search.substr(1);
let n = "";
const i = [];
if ("" != r) {
const t = r.split("&");
for (let r = 0; r < t.length; r++) {
t[r].split("=")[0] != e && i.push(t[r])
}
}
return i.length > 0 && (n = "?" + i.join("&")),
t = n,
t
}
, sleep$1 = e => {
const t = window;
return t.CORE_UTILS_SLEEPS || (t.CORE_UTILS_SLEEPS = []),
new Promise((r => {
const n = setTimeout(( () => {
r()
}
), e);
t.CORE_UTILS_SLEEPS.push(n)
}
))
}
, toJS$1 = e => JSON.parse(JSON.stringify(e))
, imgLazy = e => new Promise(( (t, r) => {
const n = new Image;
n.src = e,
n.onload = function() {
t(n)
}
,
n.onerror = function() {
r(n)
}
}
));
function randomID(e=8) {
return Number(Math.random().toString().substr(3, e) +
Date.now()).toString(36)
}
const formatDate = (e=new Date, t="datetime") =>
dayjs(e).format(dateFormatPreset[t] || t);
function getNumArr(e, t) {
let r = "";
for (t.split("").forEach((e => {
r += e.charCodeAt(0).toString()
}
)); r.length < e.length; )
r += r;
return r.split("")
}
function encrypt(e, t=config$3.secretKey) {
if (!e)
return e;
const r = getNumArr(e, t);
let n = "";
return e.split("").forEach(( (e, t) => {
n += String.fromCharCode(e.charCodeAt(0) + parseInt(r[t], 10))
}
)),
n
}
function decrypt(e="", t=config$3.secretKey) {
if (!e)
return e;
const r = getNumArr(e, t);
let n = "";
return e.split("").forEach(( (e, t) => {
n += String.fromCharCode(e.charCodeAt(0) - parseInt(r[t], 10))
}
)),
n
}
const crypto$1 = {
decrypt: decrypt,
encrypt: encrypt
};
var _class$6, _descriptor$2, _descriptor2$2, _descriptor3$2,
_descriptor4$2, _descriptor5$2, _descriptor6$2, _descriptor7$2, _descriptor8$2,
_descriptor9$1;
function _initializerDefineProperty$2(e, t, r, n) {
r && Object.defineProperty(e, t, {
enumerable: r.enumerable,
configurable: r.configurable,
writable: r.writable,
value: r.initializer ? r.initializer.call(n) : void 0
})
}
function _applyDecoratedDescriptor$6(e, t, r, n, i) {
var o = {};
return Object.keys(n).forEach((function(e) {
o[e] = n[e]
}
)),
o.enumerable = !!o.enumerable,
o.configurable = !!o.configurable,
("value"in o || o.initializer) && (o.writable = !0),
o = r.slice().reverse().reduce((function(r, n) {
return n(e, t, r) || r
}
), o),
i && void 0 !== o.initializer && (o.value = o.initializer ?
o.initializer.call(i) : void 0,
o.initializer = void 0),
void 0 === o.initializer ? (Object.defineProperty(e, t, o),
null) : o
}
let User$2 = (_class$6 = class {
constructor() {
_initializerDefineProperty$2(this, "token", _descriptor$2, this),
_initializerDefineProperty$2(this, "info", _descriptor2$2, this),
_initializerDefineProperty$2(this, "setUserInfo", _descriptor3$2,
this),
_initializerDefineProperty$2(this, "getUserInfo", _descriptor4$2,
this),
_initializerDefineProperty$2(this, "getToken", _descriptor5$2,
this),
_initializerDefineProperty$2(this, "setToken", _descriptor6$2,
this),
_initializerDefineProperty$2(this, "updateUserInfo",
_descriptor7$2, this),
_initializerDefineProperty$2(this, "logout", _descriptor8$2, this),
_initializerDefineProperty$2(this, "clearUserInfo", _descriptor9$1,
this)
}
}
,
_descriptor$2 = _applyDecoratedDescriptor$6(_class$6.prototype, "token",
[observable], {
configurable: !0,
enumerable: !0,
writable: !0,
initializer: function() {
return crypto$1.encrypt(storage.local.get("token")) || ""
}
}),
_descriptor2$2 = _applyDecoratedDescriptor$6(_class$6.prototype, "info",
[observable], {
configurable: !0,
enumerable: !0,
writable: !0,
initializer: function() {
return null
}
}),
_descriptor3$2 = _applyDecoratedDescriptor$6(_class$6.prototype,
"setUserInfo", [action], {
configurable: !0,
enumerable: !0,
writable: !0,
initializer: function() {
return e => {
this.info = e
}
}
}),
_descriptor4$2 = _applyDecoratedDescriptor$6(_class$6.prototype,
"getUserInfo", [action], {
configurable: !0,
enumerable: !0,
writable: !0,
initializer: function() {
return () => this.info
}
}),
_descriptor5$2 = _applyDecoratedDescriptor$6(_class$6.prototype,
"getToken", [action], {
configurable: !0,
enumerable: !0,
writable: !0,
initializer: function() {
return () => this.token
}
}),
_descriptor6$2 = _applyDecoratedDescriptor$6(_class$6.prototype,
"setToken", [action], {
configurable: !0,
enumerable: !0,
writable: !0,
initializer: function() {
return e => {
this.token = e,
globalOptions.headers.Authorization = e,
storage.local.set("token", crypto$1.decrypt(e))
}
}
}),
_descriptor7$2 = _applyDecoratedDescriptor$6(_class$6.prototype,
"updateUserInfo", [action], {
configurable: !0,
enumerable: !0,
writable: !0,
initializer: function() {
return e => {
transaction(( () => {
for (let t in e)
this.info[t] = e[t]
}
))
}
}
}),
_descriptor8$2 = _applyDecoratedDescriptor$6(_class$6.prototype, "logout",
[action], {
configurable: !0,
enumerable: !0,
writable: !0,
initializer: function() {
return async () => {
user$1.clearUserInfo(),
window.RouterHistory.push("/")
}
}
}),
_descriptor9$1 = _applyDecoratedDescriptor$6(_class$6.prototype,
"clearUserInfo", [action], {
configurable: !0,
enumerable: !0,
writable: !0,
initializer: function() {
return () => {
transaction(( () => {
this.info = null,
this.token = ""
}
)),
storage.local.remove("token")
}
}
}),
_class$6);
const user$1 = new User$2;
class AxiosAbort {
constructor() {
this.aborts = {}
}
add(e, t) {
this.aborts[e] = t
}
remove(e) {
this.aborts[e] && delete this.aborts[e]
}
abort(e) {
"function" == typeof this.aborts[e] && (this.aborts[e](),
delete this.aborts[e])
}
abortAll() {
for (let e in this.aborts)
this.abort(e)
}
}
const server$1 = new AxiosAbort
, globalOptions = {
headers: {
"Content-Type": "application/json;charset=utf-8",
Accept: "application/json",
Authorization: user$1.getToken()
}
};
class BasicService {
constructor(e="") {
this.baseURL = void 0,
this.abortKeys = {},
this.baseURL = e
}
_setRqHeaderToken(e) {
user$1.setToken(e),
globalOptions.headers.Authorization = e
}
get(e, t) {
return this._request("get", e, null, t)
}
post(e, t, r) {
return this._request("post", e, t, r)
}
put(e, t, r) {
return this._request("put", e, t, r)
}
delete(e, t) {
return this._request("delete", e, {}, t)
}
abort(e) {
if (e) {
const t = this.abortKeys[e];
server$1.abort(t),
delete this.abortKeys[e]
}
}
abortAll() {
server$1.abortAll()
}
_request(e, t, r, n={}) {
n.abortID && (this.abortKeys[n.abortID] = t);
const i = Object.assign({}, globalOptions.headers, n.headers)
, o = {
baseURL: this.baseURL,
withCredentials: !0,
method: e,
url: /https?:\/\//.test(t) ? t : config$3.apiHost + t,
data: r,
params: Object.assign(n.params || {}),
cancelToken: new axios$1.CancelToken((e => {
server$1.add(t, e)
}
)),
headers: i
};
return axios$1(o).then((e => (e = e.data,
server$1.remove(t),
n.jsonFile ? e.data : 1001 === e.code ? (user$1.clearUserInfo(),
[null, "登录失效"]) : e.error ? [null, e.error.error_code.message, e] :
0 !== e.code ? [null, e.message, e] : [e.data || e || !0, null, e]))).catch((e =>
(null == e ? void 0 : e.__CANCEL__) ? Promise.reject("请求已取消") : Promise.reject(e)))
}
}
const _window$1 = window;
class UserService extends BasicService {
constructor() {
super(),
this.getTypeTree = async () => await
this.get("/api/v1/common/types/tree"),
this.getWxQrcode = async () => await
this.get("/api/v1/account/login/wqr"),
this.seekWxLogin = async e => await
this.get(`/api/v1/account/login/wset?sn=${e}`),
this.getRegisterSMS = async e => await
this.post("/api/v1/account/sms/register", e),
this.getCaptcha = async () => await
this.get("/api/v1/account/captcha"),
this.getBindWeixinCode = async () => await
this.get("/api/v1/account/bind-weixin/wqr"),
this.bindWeixinSeek = async e => await
this.get("/api/v1/account/bind-weixin/wset?sn=" + e),
this.sendEmailCode = async e => await
this.post("/api/v1/account/mail/register", e),
this.bindEmail = async e => await
this.post("/api/v1/account/mail/bind-email", e),
this.bindPhone = async e => await this.post("/api/v1/account/bind-
mobile", e),
this.getCodeBindMobile = async e => await
this.post("/api/v1/account/sms/bind-mobile", e),
this.getCodeResetPassword = async e => await
this.post("/api/v1/account/sms/recover-password", e),
this.register = async e => await
this.post("/api/v1/account/register", e),
this.getStatistics = async () => await this.get("/api/v1/open/app-
statistics"),
this.login = async e => {
const [t,r] = await this.post("/api/v1/account/login", e);
return t && this._setRqHeaderToken(t.token),
[t, r]
}
,
this.loginFvideo = async e => {
const [t,r] = await
this.post("https://fvideo.h5ds.com/api/v1/account/login", e);
return t && this._setRqHeaderToken(t.token),
[t, r]
}
,
this.userSign = async () => {
let e = formatDate(+new Date, "YYYY-MM-DD");
return await this.get("/api/v1/api/user-sign?stDate=" + e)
}
,
this.doUserSign = async () => await this.post("/api/v1/api/user-
sign"),
this.oauthLogin = async e => {
const [t] = await
this.get("/api/v1/account/login/provider/qq/user", {
params: {
code: e
}
});
return !!t && (this._setRqHeaderToken(t.token),
user$1.setToken(t.token),
user$1.setUserInfo(t.user),
t)
}
,
this.logout = async () => {
const e = await this.get("/api/v1/account/logout");
return user$1.clearUserInfo(),
_window$1.RouterHistory.push("/"),
e
}
,
this.updateUserInfo = async e => await
this.put("/api/v1/account/update", e),
this.changePassword = async e => await
this.post("/api/v1/account/change-password", e),
this.findPassword = async e => await
this.post("/api/v1/account/recover-password", e),
this.getUserDetail = async () => {
const [e,t] = await this.get("/api/v1/account/info");
return t ? (user$1.logout(),
[e, t]) : (user$1.setUserInfo(e),
[e, t])
}
,
user$1.token && super._setRqHeaderToken(user$1.token)
}
}
const userService = new UserService;
function _setPrototypeOf$1(e, t) {
return (_setPrototypeOf$1 = Object.setPrototypeOf ?
Object.setPrototypeOf.bind() : function(e, t) {
return e.__proto__ = t,
e
}
)(e, t)
}
function _inheritsLoose$1(e, t) {
e.prototype = Object.create(t.prototype),
e.prototype.constructor = e,
_setPrototypeOf$1(e, t)
}
var propTypes = {
exports: {}
}
, ReactPropTypesSecret$1 = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"
, ReactPropTypesSecret_1 = ReactPropTypesSecret$1
, ReactPropTypesSecret = ReactPropTypesSecret_1;
function emptyFunction() {}
function emptyFunctionWithReset() {}
emptyFunctionWithReset.resetWarningCache = emptyFunction;
var factoryWithThrowingShims = function() {
function e(e, t, r, n, i, o) {
if (o !== ReactPropTypesSecret) {
var s = new Error("Calling PropTypes validators directly is not
supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them.
Read more at http://fb.me/use-check-prop-types");
throw s.name = "Invariant Violation",
s
}
}
function t() {
return e
}
e.isRequired = e;
var r = {
array: e,
bigint: e,
bool: e,
func: e,
number: e,
object: e,
string: e,
symbol: e,
any: e,
arrayOf: t,
element: e,
elementType: e,
instanceOf: t,
node: e,
objectOf: t,
oneOf: t,
oneOfType: t,
shape: t,
exact: t,
checkPropTypes: emptyFunctionWithReset,
resetWarningCache: emptyFunction
};
return r.PropTypes = r,
r
};
propTypes.exports = factoryWithThrowingShims();
var propTypesExports = propTypes.exports;
const PropTypes = getDefaultExportFromCjs(propTypesExports);
function _extends$h() {
return _extends$h = Object.assign ? Object.assign.bind() : function(e)
{
for (var t = 1; t < arguments.length; t++) {
var r = arguments[t];
for (var n in r)
({}).hasOwnProperty.call(r, n) && (e[n] = r[n])
}
return e
}
,
_extends$h.apply(null, arguments)
}
function isAbsolute(e) {
return "/" === e.charAt(0)
}
function spliceOne(e, t) {
for (var r = t, n = r + 1, i = e.length; n < i; r += 1,
n += 1)
e[r] = e[n];
e.pop()
}
function resolvePathname(e, t) {
void 0 === t && (t = "");
var r, n = e && e.split("/") || [], i = t && t.split("/") || [], o = e
&& isAbsolute(e), s = t && isAbsolute(t), a = o || s;
if (e && isAbsolute(e) ? i = n : n.length && (i.pop(),
i = i.concat(n)),
!i.length)
return "/";
if (i.length) {
var l = i[i.length - 1];
r = "." === l || ".." === l || "" === l
} else
r = !1;
for (var c = 0, u = i.length; u >= 0; u--) {
var d = i[u];
"." === d ? spliceOne(i, u) : ".." === d ? (spliceOne(i, u),
c++) : c && (spliceOne(i, u),
c--)
}
if (!a)
for (; c--; c)
i.unshift("..");
!a || "" === i[0] || i[0] && isAbsolute(i[0]) || i.unshift("");
var p = i.join("/");
return r && "/" !== p.substr(-1) && (p += "/"),
p
}
var isProduction = !0
, prefix$8 = "Invariant failed";
function invariant(e, t) {
if (!e) {
if (isProduction)
throw new Error(prefix$8);
var r = "function" == typeof t ? t() : t
, n = r ? "".concat(prefix$8, ": ").concat(r) : prefix$8;
throw new Error(n)
}
}
function addLeadingSlash$1(e) {
return "/" === e.charAt(0) ? e : "/" + e
}
function stripLeadingSlash(e) {
return "/" === e.charAt(0) ? e.substr(1) : e
}
function hasBasename(e, t) {
return 0 === e.toLowerCase().indexOf(t.toLowerCase()) && -1 !== "/?
#".indexOf(e.charAt(t.length))
}
function stripBasename$1(e, t) {
return hasBasename(e, t) ? e.substr(t.length) : e
}
function stripTrailingSlash(e) {
return "/" === e.charAt(e.length - 1) ? e.slice(0, -1) : e
}
function parsePath(e) {
var t = e || "/"
, r = ""
, n = ""
, i = t.indexOf("#");
-1 !== i && (n = t.substr(i),
t = t.substr(0, i));
var o = t.indexOf("?");
return -1 !== o && (r = t.substr(o),
t = t.substr(0, o)),
{
pathname: t,
search: "?" === r ? "" : r,
hash: "#" === n ? "" : n
}
}
function createPath(e) {
var t = e.pathname
, r = e.search
, n = e.hash
, i = t || "/";
return r && "?" !== r && (i += "?" === r.charAt(0) ? r : "?" + r),
n && "#" !== n && (i += "#" === n.charAt(0) ? n : "#" + n),
i
}
function createLocation(e, t, r, n) {
var i;
"string" == typeof e ? (i = parsePath(e)).state = t : (void 0 === (i =
_extends$h({}, e)).pathname && (i.pathname = ""),
i.search ? "?" !== i.search.charAt(0) && (i.search = "?" + i.search) :
i.search = "",
i.hash ? "#" !== i.hash.charAt(0) && (i.hash = "#" + i.hash) : i.hash =
"",
void 0 !== t && void 0 === i.state && (i.state = t));
try {
i.pathname = decodeURI(i.pathname)
} catch (e2) {
throw e2 instanceof URIError ? new URIError('Pathname "' +
i.pathname + '" could not be decoded. This is likely caused by an invalid percent-
encoding.') : e2
}
return r && (i.key = r),
n ? i.pathname ? "/" !== i.pathname.charAt(0) && (i.pathname =
resolvePathname(i.pathname, n.pathname)) : i.pathname = n.pathname : i.pathname ||
(i.pathname = "/"),
i
}
function createTransitionManager() {
var e = null;
var t = [];
return {
setPrompt: function(t) {
return e = t,
function() {
e === t && (e = null)
}
},
confirmTransitionTo: function(t, r, n, i) {
if (null != e) {
var o = "function" == typeof e ? e(t, r) : e;
"string" == typeof o ? "function" == typeof n ? n(o, i) :
i(!0) : i(!1 !== o)
} else
i(!0)
},
appendListener: function(e) {
var r = !0;
function n() {
r && e.apply(void 0, arguments)
}
return t.push(n),
function() {
r = !1,
t = t.filter((function(e) {
return e !== n
}
))
}
},
notifyListeners: function() {
for (var e = arguments.length, r = new Array(e), n = 0; n < e;
n++)
r[n] = arguments[n];
t.forEach((function(e) {
return e.apply(void 0, r)
}
))
}
}
}
var canUseDOM$1 = !("undefined" == typeof window || !window.document || !
window.document.createElement);
function getConfirmation(e, t) {
t(window.confirm(e))
}
function supportsHistory() {
var e = window.navigator.userAgent;
return (-1 === e.indexOf("Android 2.") && -1 === e.indexOf("Android
4.0") || -1 === e.indexOf("Mobile Safari") || -1 !== e.indexOf("Chrome") || -1 !==
e.indexOf("Windows Phone")) && (window.history && "pushState"in window.history)
}
function supportsPopStateOnHashChange() {
return -1 === window.navigator.userAgent.indexOf("Trident")
}
function supportsGoWithoutReloadUsingHash() {
return -1 === window.navigator.userAgent.indexOf("Firefox")
}
function isExtraneousPopstateEvent(e) {
return void 0 === e.state && -1 ===
navigator.userAgent.indexOf("CriOS")
}
var PopStateEvent = "popstate"
, HashChangeEvent = "hashchange";
function getHistoryState() {
try {
return window.history.state || {}
} catch (e2) {
return {}
}
}
function createBrowserHistory(e) {
void 0 === e && (e = {}),
canUseDOM$1 || invariant(!1);
var t = window.history
, r = supportsHistory()
, n = !supportsPopStateOnHashChange()
, i = e
, o = i.forceRefresh
, s = void 0 !== o && o
, a = i.getUserConfirmation
, l = void 0 === a ? getConfirmation : a
, c = i.keyLength
, u = void 0 === c ? 6 : c
, d = e.basename ?
stripTrailingSlash(addLeadingSlash$1(e.basename)) : "";
function p(e) {
var t = e || {}
, r = t.key
, n = t.state
, i = window.location
, o = i.pathname + i.search + i.hash;
return d && (o = stripBasename$1(o, d)),
createLocation(o, n, r)
}
function h() {
return Math.random().toString(36).substr(2, u)
}
var f = createTransitionManager();
function m(e) {
_extends$h(w, e),
w.length = t.length,
f.notifyListeners(w.location, w.action)
}
function g(e) {
isExtraneousPopstateEvent(e) || b(p(e.state))
}
function y() {
b(p(getHistoryState()))
}
var v = !1;
function b(e) {
if (v)
v = !1,
m();
else {
f.confirmTransitionTo(e, "POP", l, (function(t) {
t ? m({
action: "POP",
location: e
}) : function(e) {
var t = w.location
, r = _.indexOf(t.key);
-1 === r && (r = 0);
var n = _.indexOf(e.key);
-1 === n && (n = 0);
var i = r - n;
i && (v = !0,
T(i))
}(e)
}
))
}
}
var x = p(getHistoryState())
, _ = [x.key];
function E(e) {
return d + createPath(e)
}
function T(e) {
t.go(e)
}
var C = 0;
function S(e) {
1 === (C += e) && 1 === e ? (window.addEventListener(PopStateEvent,
g),
n && window.addEventListener(HashChangeEvent, y)) : 0 === C &&
(window.removeEventListener(PopStateEvent, g),
n && window.removeEventListener(HashChangeEvent, y))
}
var $ = !1;
var w = {
length: t.length,
action: "POP",
location: x,
createHref: E,
push: function(e, n) {
var i = "PUSH"
, o = createLocation(e, n, h(), w.location);
f.confirmTransitionTo(o, i, l, (function(e) {
if (e) {
var n = E(o)
, a = o.key
, l = o.state;
if (r)
if (t.pushState({
key: a,
state: l
}, null, n),
s)
window.location.href = n;
else {
var c = _.indexOf(w.location.key)
, u = _.slice(0, c + 1);
u.push(o.key),
_ = u,
m({
action: i,
location: o
})
}
else
window.location.href = n
}
}
))
},
replace: function(e, n) {
var i = "REPLACE"
, o = createLocation(e, n, h(), w.location);
f.confirmTransitionTo(o, i, l, (function(e) {
if (e) {
var n = E(o)
, a = o.key
, l = o.state;
if (r)
if (t.replaceState({
key: a,
state: l
}, null, n),
s)
window.location.replace(n);
else {
var c = _.indexOf(w.location.key);
-1 !== c && (_[c] = o.key),
m({
action: i,
location: o
})
}
else
window.location.replace(n)
}
}
))
},
go: T,
goBack: function() {
T(-1)
},
goForward: function() {
T(1)
},
block: function(e) {
void 0 === e && (e = !1);
var t = f.setPrompt(e);
return $ || (S(1),
$ = !0),
function() {
return $ && ($ = !1,
S(-1)),
t()
}
},
listen: function(e) {
var t = f.appendListener(e);
return S(1),
function() {
S(-1),
t()
}
}
};
return w
}
var HashChangeEvent$1 = "hashchange"
, HashPathCoders = {
hashbang: {
encodePath: function(e) {
return "!" === e.charAt(0) ? e : "!/" + stripLeadingSlash(e)
},
decodePath: function(e) {
return "!" === e.charAt(0) ? e.substr(1) : e
}
},
noslash: {
encodePath: stripLeadingSlash,
decodePath: addLeadingSlash$1
},
slash: {
encodePath: addLeadingSlash$1,
decodePath: addLeadingSlash$1
}
};
function stripHash(e) {
var t = e.indexOf("#");
return -1 === t ? e : e.slice(0, t)
}
function getHashPath() {
var e = window.location.href
, t = e.indexOf("#");
return -1 === t ? "" : e.substring(t + 1)
}
function pushHashPath(e) {
window.location.hash = e
}
function replaceHashPath(e) {
window.location.replace(stripHash(window.location.href) + "#" + e)
}
function createHashHistory(e) {
void 0 === e && (e = {}),
canUseDOM$1 || invariant(!1);
var t = window.history;
supportsGoWithoutReloadUsingHash();
var r = e
, n = r.getUserConfirmation
, i = void 0 === n ? getConfirmation : n
, o = r.hashType
, s = void 0 === o ? "slash" : o
, a = e.basename ?
stripTrailingSlash(addLeadingSlash$1(e.basename)) : ""
, l = HashPathCoders[s]
, c = l.encodePath
, u = l.decodePath;
function d() {
var e = u(getHashPath());
return a && (e = stripBasename$1(e, a)),
createLocation(e)
}
var p = createTransitionManager();
function h(e) {
_extends$h(S, e),
S.length = t.length,
p.notifyListeners(S.location, S.action)
}
var f = !1
, m = null;
function g() {
var e = getHashPath()
, t = c(e);
if (e !== t)
replaceHashPath(t);
else {
var r = d()
, n = S.location;
if (!f && function(e, t) {
return e.pathname === t.pathname && e.search === t.search
&& e.hash === t.hash
}(n, r))
return;
if (m === createPath(r))
return;
m = null,
function(e) {
if (f)
f = !1,
h();
else {
var t = "POP";
p.confirmTransitionTo(e, t, i, (function(r) {
r ? h({
action: t,
location: e
}) : function(e) {
var t = S.location
, r = x.lastIndexOf(createPath(t));
-1 === r && (r = 0);
var n = x.lastIndexOf(createPath(e));
-1 === n && (n = 0);
var i = r - n;
i && (f = !0,
_(i))
}(e)
}
))
}
}(r)
}
}
var y = getHashPath()
, v = c(y);
y !== v && replaceHashPath(v);
var b = d()
, x = [createPath(b)];
function _(e) {
t.go(e)
}
var E = 0;
function T(e) {
1 === (E += e) && 1 === e ?
window.addEventListener(HashChangeEvent$1, g) : 0 === E &&
window.removeEventListener(HashChangeEvent$1, g)
}
var C = !1;
var S = {
length: t.length,
action: "POP",
location: b,
createHref: function(e) {
var t = document.querySelector("base")
, r = "";
return t && t.getAttribute("href") && (r =
stripHash(window.location.href)),
r + "#" + c(a + createPath(e))
},
push: function(e, t) {
var r = "PUSH"
, n = createLocation(e, void 0, void 0, S.location);
p.confirmTransitionTo(n, r, i, (function(e) {
if (e) {
var t = createPath(n)
, i = c(a + t);
if (getHashPath() !== i) {
m = t,
pushHashPath(i);
var o = x.lastIndexOf(createPath(S.location))
, s = x.slice(0, o + 1);
s.push(t),
x = s,
h({
action: r,
location: n
})
} else
h()
}
}
))
},
replace: function(e, t) {
var r = "REPLACE"
, n = createLocation(e, void 0, void 0, S.location);
p.confirmTransitionTo(n, r, i, (function(e) {
if (e) {
var t = createPath(n)
, i = c(a + t);
getHashPath() !== i && (m = t,
replaceHashPath(i));
var o = x.indexOf(createPath(S.location));
-1 !== o && (x[o] = t),
h({
action: r,
location: n
})
}
}
))
},
go: _,
goBack: function() {
_(-1)
},
goForward: function() {
_(1)
},
block: function(e) {
void 0 === e && (e = !1);
var t = p.setPrompt(e);
return C || (T(1),
C = !0),
function() {
return C && (C = !1,
T(-1)),
t()
}
},
listen: function(e) {
var t = p.appendListener(e);
return T(1),
function() {
T(-1),
t()
}
}
};
return S
}
function clamp(e, t, r) {
return Math.min(Math.max(e, t), r)
}
function createMemoryHistory(e) {
void 0 === e && (e = {});
var t = e
, r = t.getUserConfirmation
, n = t.initialEntries
, i = void 0 === n ? ["/"] : n
, o = t.initialIndex
, s = void 0 === o ? 0 : o
, a = t.keyLength
, l = void 0 === a ? 6 : a
, c = createTransitionManager();
function u(e) {
_extends$h(g, e),
g.length = g.entries.length,
c.notifyListeners(g.location, g.action)
}
function d() {
return Math.random().toString(36).substr(2, l)
}
var p = clamp(s, 0, i.length - 1)
, h = i.map((function(e) {
return createLocation(e, void 0, "string" == typeof e ? d() : e.key
|| d())
}
))
, f = createPath;
function m(e) {
var t = clamp(g.index + e, 0, g.entries.length - 1)
, n = g.entries[t];
c.confirmTransitionTo(n, "POP", r, (function(e) {
e ? u({
action: "POP",
location: n,
index: t
}) : u()
}
))
}
var g = {
length: h.length,
action: "POP",
location: h[p],
index: p,
entries: h,
createHref: f,
push: function(e, t) {
var n = "PUSH"
, i = createLocation(e, t, d(), g.location);
c.confirmTransitionTo(i, n, r, (function(e) {
if (e) {
var t = g.index + 1
, r = g.entries.slice(0);
r.length > t ? r.splice(t, r.length - t, i) :
r.push(i),
u({
action: n,
location: i,
index: t,
entries: r
})
}
}
))
},
replace: function(e, t) {
var n = "REPLACE"
, i = createLocation(e, t, d(), g.location);
c.confirmTransitionTo(i, n, r, (function(e) {
e && (g.entries[g.index] = i,
u({
action: n,
location: i
}))
}
))
},
go: m,
goBack: function() {
m(-1)
},
goForward: function() {
m(1)
},
canGo: function(e) {
var t = g.index + e;
return t >= 0 && t < g.entries.length
},
block: function(e) {
return void 0 === e && (e = !1),
c.setPrompt(e)
},
listen: function(e) {
return c.appendListener(e)
}
};
return g
}
var pathToRegexp$2 = {
exports: {}
}
, isarray$1 = Array.isArray || function(e) {
return "[object Array]" == Object.prototype.toString.call(e)
}
, isarray = isarray$1;
pathToRegexp$2.exports = pathToRegexp,
pathToRegexp$2.exports.parse = parse$6,
pathToRegexp$2.exports.compile = compile,
pathToRegexp$2.exports.tokensToFunction = tokensToFunction,
pathToRegexp$2.exports.tokensToRegExp = tokensToRegExp;
var PATH_REGEXP = new RegExp(["(\\\\.)", "([\\/.])?(?:(?:\\:(\\w+)(?:\\
(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\
*))"].join("|"),"g");
function parse$6(e, t) {
for (var r, n = [], i = 0, o = 0, s = "", a = t && t.delimiter || "/";
null != (r = PATH_REGEXP.exec(e)); ) {
var l = r[0]
, c = r[1]
, u = r.index;
if (s += e.slice(o, u),
o = u + l.length,
c)
s += c[1];
else {
var d = e[o]
, p = r[2]
, h = r[3]
, f = r[4]
, m = r[5]
, g = r[6]
, y = r[7];
s && (n.push(s),
s = "");
var v = null != p && null != d && d !== p
, b = "+" === g || "*" === g
, x = "?" === g || "*" === g
, _ = r[2] || a
, E = f || m;
n.push({
name: h || i++,
prefix: p || "",
delimiter: _,
optional: x,
repeat: b,
partial: v,
asterisk: !!y,
pattern: E ? escapeGroup(E) : y ? ".*" : "[^" +
escapeString(_) + "]+?"
})
}
}
return o < e.length && (s += e.substr(o)),
s && n.push(s),
n
}
function compile(e, t) {
return tokensToFunction(parse$6(e, t), t)
}
function encodeURIComponentPretty(e) {
return encodeURI(e).replace(/[\/?#]/g, (function(e) {
return "%" + e.charCodeAt(0).toString(16).toUpperCase()
}
))
}
function encodeAsterisk(e) {
return encodeURI(e).replace(/[?#]/g, (function(e) {
return "%" + e.charCodeAt(0).toString(16).toUpperCase()
}
))
}
function tokensToFunction(e, t) {
for (var r = new Array(e.length), n = 0; n < e.length; n++)
"object" == typeof e[n] && (r[n] = new RegExp("^(?:" + e[n].pattern
+ ")$",flags(t)));
return function(t, n) {
for (var i = "", o = t || {}, s = (n || {}).pretty ?
encodeURIComponentPretty : encodeURIComponent, a = 0; a < e.length; a++) {
var l = e[a];
if ("string" != typeof l) {
var c, u = o[l.name];
if (null == u) {
if (l.optional) {
l.partial && (i += l.prefix);
continue
}
throw new TypeError('Expected "' + l.name + '" to be
defined')
}
if (isarray(u)) {
if (!l.repeat)
throw new TypeError('Expected "' + l.name + '" to
not repeat, but received `' + JSON.stringify(u) + "`");
if (0 === u.length) {
if (l.optional)
continue;
throw new TypeError('Expected "' + l.name + '" to
not be empty')
}
for (var d = 0; d < u.length; d++) {
if (c = s(u[d]),
!r[a].test(c))
throw new TypeError('Expected all "' + l.name +
'" to match "' + l.pattern + '", but received `' + JSON.stringify(c) + "`");
i += (0 === d ? l.prefix : l.delimiter) + c
}
} else {
if (c = l.asterisk ? encodeAsterisk(u) : s(u),
!r[a].test(c))
throw new TypeError('Expected "' + l.name + '" to
match "' + l.pattern + '", but received "' + c + '"');
i += l.prefix + c
}
} else
i += l
}
return i
}
}
function escapeString(e) {
return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g, "\\$1")
}
function escapeGroup(e) {
return e.replace(/([=!:$\/()])/g, "\\$1")
}
function attachKeys(e, t) {
return e.keys = t,
e
}
function flags(e) {
return e && e.sensitive ? "" : "i"
}
function regexpToRegexp(e, t) {
var r = e.source.match(/\((?!\?)/g);
if (r)
for (var n = 0; n < r.length; n++)
t.push({
name: n,
prefix: null,
delimiter: null,
optional: !1,
repeat: !1,
partial: !1,
asterisk: !1,
pattern: null
});
return attachKeys(e, t)
}
function arrayToRegexp(e, t, r) {
for (var n = [], i = 0; i < e.length; i++)
n.push(pathToRegexp(e[i], t, r).source);
return attachKeys(new RegExp("(?:" + n.join("|") + ")",flags(r)), t)
}
function stringToRegexp(e, t, r) {
return tokensToRegExp(parse$6(e, r), t, r)
}
function tokensToRegExp(e, t, r) {
isarray(t) || (r = t || r,
t = []);
for (var n = (r = r || {}).strict, i = !1 !== r.end, o = "", s = 0; s <
e.length; s++) {
var a = e[s];
if ("string" == typeof a)
o += escapeString(a);
else {
var l = escapeString(a.prefix)
, c = "(?:" + a.pattern + ")";
t.push(a),
a.repeat && (c += "(?:" + l + c + ")*"),
o += c = a.optional ? a.partial ? l + "(" + c + ")?" : "(?:" +
l + "(" + c + "))?" : l + "(" + c + ")"
}
}
var u = escapeString(r.delimiter || "/")
, d = o.slice(-u.length) === u;
return n || (o = (d ? o.slice(0, -u.length) : o) + "(?:" + u + "(?
=$))?"),
o += i ? "$" : n && d ? "" : "(?=" + u + "|$)",
attachKeys(new RegExp("^" + o,flags(r)), t)
}
function pathToRegexp(e, t, r) {
return isarray(t) || (r = t || r,
t = []),
r = r || {},
e instanceof RegExp ? regexpToRegexp(e, t) : isarray(e) ?
arrayToRegexp(e, t, r) : stringToRegexp(e, t, r)
}
var pathToRegexpExports = pathToRegexp$2.exports;
const pathToRegexp$1 = getDefaultExportFromCjs(pathToRegexpExports);
var reactIs$1 = {
exports: {}
}
, reactIs_production_min = {}
, b$5 = "function" == typeof Symbol && Symbol.for
, c$d = b$5 ? Symbol.for("react.element") : 60103
, d$6 = b$5 ? Symbol.for("react.portal") : 60106
, e$9 = b$5 ? Symbol.for("react.fragment") : 60107
, f$6 = b$5 ? Symbol.for("react.strict_mode") : 60108
, g$5 = b$5 ? Symbol.for("react.profiler") : 60114
, h$5 = b$5 ? Symbol.for("react.provider") : 60109
, k$3 = b$5 ? Symbol.for("react.context") : 60110
, l$b = b$5 ? Symbol.for("react.async_mode") : 60111
, m$6 = b$5 ? Symbol.for("react.concurrent_mode") : 60111
, n$e = b$5 ? Symbol.for("react.forward_ref") : 60112
, p$5 = b$5 ? Symbol.for("react.suspense") : 60113
, q$1 = b$5 ? Symbol.for("react.suspense_list") : 60120
, r$a = b$5 ? Symbol.for("react.memo") : 60115
, t$9 = b$5 ? Symbol.for("react.lazy") : 60116
, v$5 = b$5 ? Symbol.for("react.block") : 60121
, w$3 = b$5 ? Symbol.for("react.fundamental") : 60117
, x$6 = b$5 ? Symbol.for("react.responder") : 60118
, y$4 = b$5 ? Symbol.for("react.scope") : 60119;
function z$3(e) {
if ("object" == typeof e && null !== e) {
var t = e.$$typeof;
switch (t) {
case c$d:
switch (e = e.type) {
case l$b:
case m$6:
case e$9:
case g$5:
case f$6:
case p$5:
return e;
default:
switch (e = e && e.$$typeof) {
case k$3:
case n$e:
case t$9:
case r$a:
case h$5:
return e;
default:
return t
}
}
case d$6:
return t
}
}
}
function A$2(e) {
return z$3(e) === m$6
}
reactIs_production_min.AsyncMode = l$b,
reactIs_production_min.ConcurrentMode = m$6,
reactIs_production_min.ContextConsumer = k$3,
reactIs_production_min.ContextProvider = h$5,
reactIs_production_min.Element = c$d,
reactIs_production_min.ForwardRef = n$e,
reactIs_production_min.Fragment = e$9,
reactIs_production_min.Lazy = t$9,
reactIs_production_min.Memo = r$a,
reactIs_production_min.Portal = d$6,
reactIs_production_min.Profiler = g$5,
reactIs_production_min.StrictMode = f$6,
reactIs_production_min.Suspense = p$5,
reactIs_production_min.isAsyncMode = function(e) {
return A$2(e) || z$3(e) === l$b
}
,
reactIs_production_min.isConcurrentMode = A$2,
reactIs_production_min.isContextConsumer = function(e) {
return z$3(e) === k$3
}
,
reactIs_production_min.isContextProvider = function(e) {
return z$3(e) === h$5
}
,
reactIs_production_min.isElement = function(e) {
return "object" == typeof e && null !== e && e.$$typeof === c$d
}
,
reactIs_production_min.isForwardRef = function(e) {
return z$3(e) === n$e
}
,
reactIs_production_min.isFragment = function(e) {
return z$3(e) === e$9
}
,
reactIs_production_min.isLazy = function(e) {
return z$3(e) === t$9
}
,
reactIs_production_min.isMemo = function(e) {
return z$3(e) === r$a
}
,
reactIs_production_min.isPortal = function(e) {
return z$3(e) === d$6
}
,
reactIs_production_min.isProfiler = function(e) {
return z$3(e) === g$5
}
,
reactIs_production_min.isStrictMode = function(e) {
return z$3(e) === f$6
}
,
reactIs_production_min.isSuspense = function(e) {
return z$3(e) === p$5
}
,
reactIs_production_min.isValidElementType = function(e) {
return "string" == typeof e || "function" == typeof e || e === e$9 || e
=== m$6 || e === g$5 || e === f$6 || e === p$5 || e === q$1 || "object" == typeof e
&& null !== e && (e.$$typeof === t$9 || e.$$typeof === r$a || e.$$typeof === h$5 ||
e.$$typeof === k$3 || e.$$typeof === n$e || e.$$typeof === w$3 || e.$$typeof ===
x$6 || e.$$typeof === y$4 || e.$$typeof === v$5)
}
,
reactIs_production_min.typeOf = z$3,
reactIs$1.exports = reactIs_production_min;
var reactIsExports = reactIs$1.exports;
function _objectWithoutPropertiesLoose$2(e, t) {
if (null == e)
return {};
var r = {};
for (var n in e)
if ({}.hasOwnProperty.call(e, n)) {
if (t.includes(n))
continue;
r[n] = e[n]
}
return r
}
var reactIs = reactIsExports
, REACT_STATICS = {
childContextTypes: !0,
contextType: !0,
contextTypes: !0,
defaultProps: !0,
displayName: !0,
getDefaultProps: !0,
getDerivedStateFromError: !0,
getDerivedStateFromProps: !0,
mixins: !0,
propTypes: !0,
type: !0
}
, KNOWN_STATICS = {
name: !0,
length: !0,
prototype: !0,
caller: !0,
callee: !0,
arguments: !0,
arity: !0
}
, FORWARD_REF_STATICS = {
$$typeof: !0,
render: !0,
defaultProps: !0,
displayName: !0,
propTypes: !0
}
, MEMO_STATICS = {
$$typeof: !0,
compare: !0,
defaultProps: !0,
displayName: !0,
propTypes: !0,
type: !0
}
, TYPE_STATICS = {};
function getStatics(e) {
return reactIs.isMemo(e) ? MEMO_STATICS : TYPE_STATICS[e.$$typeof] ||
REACT_STATICS
}
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS,
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
var defineProperty$7 = Object.defineProperty
, getOwnPropertyNames$1 = Object.getOwnPropertyNames
, getOwnPropertySymbols$1 = Object.getOwnPropertySymbols
, getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor
, getPrototypeOf$1 = Object.getPrototypeOf
, objectPrototype = Object.prototype;
function hoistNonReactStatics(e, t, r) {
if ("string" != typeof t) {
if (objectPrototype) {
var n = getPrototypeOf$1(t);
n && n !== objectPrototype && hoistNonReactStatics(e, n, r)
}
var i = getOwnPropertyNames$1(t);
getOwnPropertySymbols$1 && (i =
i.concat(getOwnPropertySymbols$1(t)));
for (var o = getStatics(e), s = getStatics(t), a = 0; a < i.length;
++a) {
var l = i[a];
if (!(KNOWN_STATICS[l] || r && r[l] || s && s[l] || o && o[l]))
{
var c = getOwnPropertyDescriptor$1(t, l);
try {
defineProperty$7(e, l, c)
} catch (e2) {}
}
}
}
return e
}
var hoistNonReactStatics_cjs = hoistNonReactStatics;
const hoistStatics = getDefaultExportFromCjs(hoistNonReactStatics_cjs);
var MAX_SIGNED_31_BIT_INT = 1073741823
, commonjsGlobal = "undefined" != typeof globalThis ? globalThis :
"undefined" != typeof window ? window : "undefined" != typeof global ? global : {};
function getUniqueId() {
var e = "__global_unique_id__";
return commonjsGlobal[e] = (commonjsGlobal[e] || 0) + 1
}
function objectIs(e, t) {
return e === t ? 0 !== e || 1 / e == 1 / t : e != e && t != t
}
function createEventEmitter(e) {
var t = [];
return {
on: function(e) {
t.push(e)
},
off: function(e) {
t = t.filter((function(t) {
return t !== e
}
))
},
get: function() {
return e
},
set: function(r, n) {
e = r,
t.forEach((function(t) {
return t(e, n)
}
))
}
}
}
function onlyChild(e) {
return Array.isArray(e) ? e[0] : e
}
function createReactContext(e, t) {
var r, n, i = "__create-react-context-" + getUniqueId() + "__", o =
function(e) {
function r() {
for (var t, r = arguments.length, n = new Array(r), i = 0; i <
r; i++)
n[i] = arguments[i];
return (t = e.call.apply(e, [this].concat(n)) || this).emitter
= createEventEmitter(t.props.value),
t
}
_inheritsLoose$1(r, e);
var n = r.prototype;
return n.getChildContext = function() {
var e;
return (e = {})[i] = this.emitter,
e
}
,
n.componentWillReceiveProps = function(e) {
if (this.props.value !== e.value) {
var r, n = this.props.value, i = e.value;
objectIs(n, i) ? r = 0 : (r = "function" == typeof t ? t(n,
i) : MAX_SIGNED_31_BIT_INT,
0 !== (r |= 0) && this.emitter.set(e.value, r))
}
}
,
n.render = function() {
return this.props.children
}
,
r
}(React.Component);
o.childContextTypes = ((r = {})[i] = PropTypes.object.isRequired,
r);
var s = function(t) {
function r() {
for (var e, r = arguments.length, n = new Array(r), i = 0; i <
r; i++)
n[i] = arguments[i];
return (e = t.call.apply(t, [this].concat(n)) ||
this).observedBits = void 0,
e.state = {
value: e.getValue()
},
e.onUpdate = function(t, r) {
(0 | e.observedBits) & r && e.setState({
value: e.getValue()
})
}
,
e
}
_inheritsLoose$1(r, t);
var n = r.prototype;
return n.componentWillReceiveProps = function(e) {
var t = e.observedBits;
this.observedBits = null == t ? MAX_SIGNED_31_BIT_INT : t
}
,
n.componentDidMount = function() {
this.context[i] && this.context[i].on(this.onUpdate);
var e = this.props.observedBits;
this.observedBits = null == e ? MAX_SIGNED_31_BIT_INT : e
}
,
n.componentWillUnmount = function() {
this.context[i] && this.context[i].off(this.onUpdate)
}
,
n.getValue = function() {
return this.context[i] ? this.context[i].get() : e
}
,
n.render = function() {
return onlyChild(this.props.children)(this.state.value)
}
,
r
}(React.Component);
return s.contextTypes = ((n = {})[i] = PropTypes.object,
n),
{
Provider: o,
Consumer: s
}
}
var createContext = React.createContext || createReactContext
, createNamedContext = function(e) {
var t = createContext();
return t.displayName = e,
t
}
, historyContext = createNamedContext("Router-History")
, context$1 = createNamedContext("Router")
, Router = function(e) {
function t(t) {
var r;
return (r = e.call(this, t) || this).state = {
location: t.history.location
},
r._isMounted = !1,
r._pendingLocation = null,
t.staticContext || (r.unlisten = t.history.listen((function(e) {
r._pendingLocation = e
}
))),
r
}
_inheritsLoose$1(t, e),
t.computeRootMatch = function(e) {
return {
path: "/",
url: "/",
params: {},
isExact: "/" === e
}
}
;
var r = t.prototype;
return r.componentDidMount = function() {
var e = this;
this._isMounted = !0,
this.unlisten && this.unlisten(),
this.props.staticContext || (this.unlisten =
this.props.history.listen((function(t) {
e._isMounted && e.setState({
location: t
})
}
))),
this._pendingLocation && this.setState({
location: this._pendingLocation
})
}
,
r.componentWillUnmount = function() {
this.unlisten && (this.unlisten(),
this._isMounted = !1,
this._pendingLocation = null)
}
,
r.render = function() {
return React.createElement(context$1.Provider, {
value: {
history: this.props.history,
location: this.state.location,
match: t.computeRootMatch(this.state.location.pathname),
staticContext: this.props.staticContext
}
}, React.createElement(historyContext.Provider, {
children: this.props.children || null,
value: this.props.history
}))
}
,
t
}(React.Component);
React.Component,
React.Component;
var cache$1 = {}
, cacheLimit$1 = 1e4
, cacheCount$1 = 0;
function compilePath$1(e, t) {
var r = "" + t.end + t.strict + t.sensitive
, n = cache$1[r] || (cache$1[r] = {});
if (n[e])
return n[e];
var i = []
, o = {
regexp: pathToRegexp$1(e, i, t),
keys: i
};
return cacheCount$1 < cacheLimit$1 && (n[e] = o,
cacheCount$1++),
o
}
function matchPath(e, t) {
void 0 === t && (t = {}),
("string" == typeof t || Array.isArray(t)) && (t = {
path: t
});
var r = t
, n = r.path
, i = r.exact
, o = void 0 !== i && i
, s = r.strict
, a = void 0 !== s && s
, l = r.sensitive
, c = void 0 !== l && l;
return [].concat(n).reduce((function(t, r) {
if (!r && "" !== r)
return null;
if (t)
return t;
var n = compilePath$1(r, {
end: o,
strict: a,
sensitive: c
})
, i = n.regexp
, s = n.keys
, l = i.exec(e);
if (!l)
return null;
var u = l[0]
, d = l.slice(1)
, p = e === u;
return o && !p ? null : {
path: r,
url: "/" === r && "" === u ? "/" : u,
isExact: p,
params: s.reduce((function(e, t, r) {
return e[t.name] = d[r],
e
}
), {})
}
}
), null)
}
function isEmptyChildren$1(e) {
return 0 === React.Children.count(e)
}
var Route = function(e) {
function t() {
return e.apply(this, arguments) || this
}
return _inheritsLoose$1(t, e),
t.prototype.render = function() {
var e = this;
return React.createElement(context$1.Consumer, null, (function(t) {
t || invariant(!1);
var r = e.props.location || t.location
, n = _extends$h({}, t, {
location: r,
match: e.props.computedMatch ? e.props.computedMatch :
e.props.path ? matchPath(r.pathname, e.props) : t.match
})
, i = e.props
, o = i.children
, s = i.component
, a = i.render;
return Array.isArray(o) && isEmptyChildren$1(o) && (o = null),
React.createElement(context$1.Provider, {
value: n
}, n.match ? o ? "function" == typeof o ? o(n) : o : s ?
React.createElement(s, n) : a ? a(n) : null : "function" == typeof o ? o(n) : null)
}
))
}
,
t
}(React.Component);
function addLeadingSlash(e) {
return "/" === e.charAt(0) ? e : "/" + e
}
function addBasename(e, t) {
return e ? _extends$h({}, t, {
pathname: addLeadingSlash(e) + t.pathname
}) : t
}
function stripBasename(e, t) {
if (!e)
return t;
var r = addLeadingSlash(e);
return 0 !== t.pathname.indexOf(r) ? t : _extends$h({}, t, {
pathname: t.pathname.substr(r.length)
})
}
function createURL(e) {
return "string" == typeof e ? e : createPath(e)
}
function staticHandler(e) {
return function() {
invariant(!1)
}
}
function noop$4() {}
React.Component;
var Switch$2 = function(e) {
function t() {
return e.apply(this, arguments) || this
}
return _inheritsLoose$1(t, e),
t.prototype.render = function() {
var e = this;
return React.createElement(context$1.Consumer, null, (function(t) {
t || invariant(!1);
var r, n, i = e.props.location || t.location;
return React.Children.forEach(e.props.children, (function(e) {
if (null == n && React.isValidElement(e)) {
r = e;
var o = e.props.path || e.props.from;
n = o ? matchPath(i.pathname, _extends$h({}, e.props, {
path: o
})) : t.match
}
}
)),
n ? React.cloneElement(r, {
location: i,
computedMatch: n
}) : null
}
))
}
,
t
}(React.Component);
function withRouter(e) {
var t = "withRouter(" + (e.displayName || e.name) + ")"
, r = function(t) {
var r = t.wrappedComponentRef
, n = _objectWithoutPropertiesLoose$2(t,
["wrappedComponentRef"]);
return React.createElement(context$1.Consumer, null, (function(t) {
return t || invariant(!1),
React.createElement(e, _extends$h({}, n, t, {
ref: r
}))
}
))
};
return r.displayName = t,
r.WrappedComponent = e,
hoistStatics(r, e)
}
function matchRoutes(e, t, r) {
return void 0 === r && (r = []),
e.some((function(e) {
var n = e.path ? matchPath(t, e) : r.length ? r[r.length - 1].match
: Router.computeRootMatch(t);
return n && (r.push({
route: e,
match: n
}),
e.routes && matchRoutes(e.routes, t, r)),
n
}
)),
r
}
function renderRoutes(e, t, r) {
return void 0 === t && (t = {}),
void 0 === r && (r = {}),
e ? React.createElement(Switch$2, r, e.map((function(e, r) {
return React.createElement(Route, {
key: e.key || r,
path: e.path,
exact: e.exact,
strict: e.strict,
render: function(r) {
return e.render ? e.render(_extends$h({}, r, {}, t, {
route: e
})) : React.createElement(e.component, _extends$h({}, r, t,
{
route: e
}))
}
})
}
))) : null
}
React.useContext;
class App extends reactExports.Component {
constructor(e) {
super(e),
this.routerRef = void 0,
this.urlTokenLogin = () => {
let e = getUrlQuery("token");
e && (window.history.pushState(null, "", delUrlParam("token")),
e = decodeURI(e),
user$1.setToken(e)),
e && (userService._setRqHeaderToken(e),
userService.getUserDetail())
}
,
this.routerRef = reactExports.createRef()
}
componentDidMount() {
window.RouterHistory = this.routerRef.current.history,
this.urlTokenLogin(),
pubsub.subscribe("setLanguage", ( () => {
this.forceUpdate()
}
))
}
componentWillUnmount() {
pubsub.unsubscribe("setLanguage")
}
render() {
const {Router: e, routes: t, ...r} = this.props;
return jsxRuntimeExports.jsx(e, {
ref: this.routerRef,
basename: config$3.basename,
...r,
children: renderRoutes(t)
})
}
}
if (!reactExports.useState)
throw new Error("mobx-react-lite requires React with Hooks support");
if (!spy)
throw new Error("mobx-react-lite requires mobx at least version 4 to be
available");
var __read$1 = globalThis && globalThis.__read || function(e, t) {
var r = "function" == typeof Symbol && e[Symbol.iterator];
if (!r)
return e;
var n, i, o = r.call(e), s = [];
try {
for (; (void 0 === t || t-- > 0) && !(n = o.next()).done; )
s.push(n.value)
} catch (a) {
i = {
error: a
}
} finally {
try {
n && !n.done && (r = o.return) && r.call(o)
} finally {
if (i)
throw i.error
}
}
return s
}
;
function useForceUpdate() {
var e = __read$1(reactExports.useState(0), 2)[1];
return reactExports.useCallback((function() {
e((function(e) {
return e + 1
}
))
}
), [])
}
function getSymbol(e) {
return "function" == typeof Symbol ? Symbol.for(e) : "__$mobx-react " +
e + "__"
}
var mockGlobal = {};
function getGlobal() {
return "undefined" != typeof window ? window : "undefined" != typeof
global ? global : "undefined" != typeof self ? self : mockGlobal
}
var observerBatchingConfiguredSymbol = getSymbol("observerBatching");
function defaultNoopBatch(e) {
e()
}
function observerBatching(e) {
e || (e = defaultNoopBatch),
configure({
reactionScheduler: e
}),
getGlobal()[observerBatchingConfiguredSymbol] = !0
}
function printDebugValue(e) {
return getDependencyTree(e)
}
function createTrackingData(e) {
return {
cleanAt: Date.now() + CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS,
reaction: e
}
}
var CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS = 1e4, CLEANUP_TIMER_LOOP_MILLIS
= 1e4, uncommittedReactionRefs = new Set, reactionCleanupHandle;
function ensureCleanupTimerRunning() {
void 0 === reactionCleanupHandle && (reactionCleanupHandle =
setTimeout(cleanUncommittedReactions, CLEANUP_TIMER_LOOP_MILLIS))
}
function scheduleCleanupOfReactionIfLeaked(e) {
uncommittedReactionRefs.add(e),
ensureCleanupTimerRunning()
}
function recordReactionAsCommitted(e) {
uncommittedReactionRefs.delete(e)
}
function cleanUncommittedReactions() {
reactionCleanupHandle = void 0;
var e = Date.now();
uncommittedReactionRefs.forEach((function(t) {
var r = t.current;
r && e >= r.cleanAt && (r.reaction.dispose(),
t.current = null,
uncommittedReactionRefs.delete(t))
}
)),
uncommittedReactionRefs.size > 0 && ensureCleanupTimerRunning()
}
var insideRender = !1
, forceUpdateQueue = [];
function useQueuedForceUpdate(e) {
return function() {
insideRender ? forceUpdateQueue.push(e) : e()
}
}
function useQueuedForceUpdateBlock(e) {
insideRender = !0,
forceUpdateQueue = [];
try {
var t = e();
insideRender = !1;
var r = forceUpdateQueue.length > 0 ? forceUpdateQueue : void 0;
return React.useLayoutEffect((function() {
r && r.forEach((function(e) {
return e()
}
))
}
), [r]),
t
} finally {
insideRender = !1
}
}
var EMPTY_OBJECT = {};
function observerComponentNameFor(e) {
return "observer" + e
}
function useObserver(e, t, r) {
void 0 === t && (t = "observed"),
void 0 === r && (r = EMPTY_OBJECT);
var n = useQueuedForceUpdate((r.useForceUpdate || useForceUpdate)())
, i = React.useRef(null);
if (!i.current) {
var o = new Reaction(observerComponentNameFor(t),(function() {
s.mounted ? n() : (o.dispose(),
i.current = null)
}
))
, s = createTrackingData(o);
i.current = s,
scheduleCleanupOfReactionIfLeaked(i)
}
var a = i.current.reaction;
return React.useDebugValue(a, printDebugValue),
React.useEffect((function() {
return recordReactionAsCommitted(i),
i.current ? i.current.mounted = !0 : (i.current = {
reaction: new Reaction(observerComponentNameFor(t),(function()
{
n()
}
)),
cleanAt: 1 / 0
},
n()),
function() {
i.current.reaction.dispose(),
i.current = null
}
}
), []),
useQueuedForceUpdateBlock((function() {
var t, r;
if (a.track((function() {
try {
t = e()
} catch (e2) {
r = e2
}
}
)),
r)
throw r;
return t
}
))
}
var __assign$a = globalThis && globalThis.__assign || function() {
return __assign$a = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$a.apply(this, arguments)
}
;
function observer$1(e, t) {
var r, n = __assign$a({
forwardRef: !1
}, t), i = e.displayName || e.name, o = function(t, r) {
return useObserver((function() {
return e(t, r)
}
), i)
};
return o.displayName = i,
r = n.forwardRef ? reactExports.memo(reactExports.forwardRef(o)) :
reactExports.memo(o),
copyStaticProperties(e, r),
r.displayName = i,
r
}
var hoistBlackList = {
$$typeof: !0,
render: !0,
compare: !0,
type: !0
};
function copyStaticProperties(e, t) {
Object.keys(e).forEach((function(r) {
hoistBlackList[r] || Object.defineProperty(t, r,
Object.getOwnPropertyDescriptor(e, r))
}
))
}
function ObserverComponent(e) {
var t = e.children
, r = e.render
, n = t || r;
return "function" != typeof n ? null : useObserver(n)
}
function ObserverPropsCheck(e, t, r, n, i) {
var o = "children" === t ? "render" : "children"
, s = "function" == typeof e[t]
, a = "function" == typeof e[o];
return s && a ? new Error("MobX Observer: Do not use children and
render in the same time in`" + r) : s || a ? null : new Error("Invalid prop `" + i
+ "` of type `" + typeof e[t] + "` supplied to `" + r + "`, expected `function`.")
}
ObserverComponent.propTypes = {
children: ObserverPropsCheck,
render: ObserverPropsCheck
},
ObserverComponent.displayName = "Observer",
globalThis && globalThis.__read,
observerBatching(reactDomExports.unstable_batchedUpdates);
var symbolId = 0;
function createSymbol$1(e) {
if ("function" == typeof Symbol)
return Symbol(e);
var t = "__$mobx-react " + e + " (" + symbolId + ")";
return symbolId++,
t
}
var createdSymbols = {};
function newSymbol(e) {
return createdSymbols[e] || (createdSymbols[e] = createSymbol$1(e)),
createdSymbols[e]
}
function shallowEqual(e, t) {
if (is$1(e, t))
return !0;
if ("object" != typeof e || null === e || "object" != typeof t || null
=== t)
return !1;
var r = Object.keys(e)
, n = Object.keys(t);
if (r.length !== n.length)
return !1;
for (var i = 0; i < r.length; i++)
if (!Object.hasOwnProperty.call(t, r[i]) || !is$1(e[r[i]],
t[r[i]]))
return !1;
return !0
}
function is$1(e, t) {
return e === t ? 0 !== e || 1 / e == 1 / t : e != e && t != t
}
function setHiddenProp(e, t, r) {
Object.hasOwnProperty.call(e, t) ? e[t] = r : Object.defineProperty(e,
t, {
enumerable: !1,
configurable: !0,
writable: !0,
value: r
})
}
var mobxMixins = newSymbol("patchMixins")
, mobxPatchedDefinition = newSymbol("patchedDefinition");
function getMixins(e, t) {
var r = e[mobxMixins] = e[mobxMixins] || {}
, n = r[t] = r[t] || {};
return n.locks = n.locks || 0,
n.methods = n.methods || [],
n
}
function wrapper(e, t) {
for (var r = this, n = arguments.length, i = new Array(n > 2 ? n - 2 :
0), o = 2; o < n; o++)
i[o - 2] = arguments[o];
t.locks++;
try {
var s;
return null != e && (s = e.apply(this, i)),
s
} finally {
t.locks--,
0 === t.locks && t.methods.forEach((function(e) {
e.apply(r, i)
}
))
}
}
function wrapFunction(e, t) {
return function() {
for (var r = arguments.length, n = new Array(r), i = 0; i < r; i++)
n[i] = arguments[i];
wrapper.call.apply(wrapper, [this, e, t].concat(n))
}
}
function patch(e, t, r) {
var n = getMixins(e, t);
n.methods.indexOf(r) < 0 && n.methods.push(r);
var i = Object.getOwnPropertyDescriptor(e, t);
if (!i || !i[mobxPatchedDefinition]) {
var o = e[t]
, s = createDefinition(e, t, i ? i.enumerable : void 0, n, o);
Object.defineProperty(e, t, s)
}
}
function createDefinition(e, t, r, n, i) {
var o, s = wrapFunction(i, n);
return (o = {})[mobxPatchedDefinition] = !0,
o.get = function() {
return s
}
,
o.set = function(i) {
if (this === e)
s = wrapFunction(i, n);
else {
var o = createDefinition(this, t, r, n, i);
Object.defineProperty(this, t, o)
}
}
,
o.configurable = !0,
o.enumerable = r,
o
}
var mobxAdminProperty = $mobx || "$mobx"
, mobxObserverProperty = newSymbol("isMobXReactObserver")
, mobxIsUnmounted = newSymbol("isUnmounted")
, skipRenderKey = newSymbol("skipRender")
, isForcingUpdateKey = newSymbol("isForcingUpdate");
function makeClassComponentObserver(e) {
var t = e.prototype;
if (e[mobxObserverProperty])
getDisplayName$1(t);
else
e[mobxObserverProperty] = !0;
if (t.componentWillReact)
throw new Error("The componentWillReact life-cycle event is no
longer supported");
if (e.__proto__ !== reactExports.PureComponent)
if (t.shouldComponentUpdate) {
if (t.shouldComponentUpdate !== observerSCU)
throw new Error("It is not allowed to use
shouldComponentUpdate in observer based components.")
} else
t.shouldComponentUpdate = observerSCU;
makeObservableProp(t, "props"),
makeObservableProp(t, "state");
var r = t.render;
return t.render = function() {
return makeComponentReactive.call(this, r)
}
,
patch(t, "componentWillUnmount", (function() {
var e;
if (null === (e = this.render[mobxAdminProperty]) || void 0 === e
|| e.dispose(),
this[mobxIsUnmounted] = !0,
!this.render[mobxAdminProperty])
getDisplayName$1(this)
}
)),
e
}
function getDisplayName$1(e) {
return e.displayName || e.name || e.constructor &&
(e.constructor.displayName || e.constructor.name) || "<component>"
}
function makeComponentReactive(e) {
var t = this;
setHiddenProp(this, skipRenderKey, !1),
setHiddenProp(this, isForcingUpdateKey, !1);
var r = getDisplayName$1(this)
, n = e.bind(this)
, i = !1
, o = new Reaction(r + ".render()",(function() {
if (!i && (i = !0,
!0 !== t[mobxIsUnmounted])) {
var e = !0;
try {
setHiddenProp(t, isForcingUpdateKey, !0),
t[skipRenderKey] ||
reactExports.Component.prototype.forceUpdate.call(t),
e = !1
} finally {
setHiddenProp(t, isForcingUpdateKey, !1),
e && o.dispose()
}
}
}
));
function s() {
i = !1;
var e = void 0
, t = void 0;
if (o.track((function() {
try {
t = allowStateChanges(!1, n)
} catch (e2) {
e = e2
}
}
)),
e)
throw e;
return t
}
return o.reactComponent = this,
s[mobxAdminProperty] = o,
this.render = s,
s.call(this)
}
function observerSCU(e, t) {
return this.state !== t || !shallowEqual(this.props, e)
}
function makeObservableProp(e, t) {
var r = newSymbol("reactProp_" + t + "_valueHolder")
, n = newSymbol("reactProp_" + t + "_atomHolder");
function i() {
return this[n] || setHiddenProp(this, n, createAtom("reactive " +
t)),
this[n]
}
Object.defineProperty(e, t, {
configurable: !0,
enumerable: !0,
get: function() {
var e = !1;
return allowStateReadsStart && allowStateReadsEnd && (e =
allowStateReadsStart(!0)),
i.call(this).reportObserved(),
allowStateReadsStart && allowStateReadsEnd &&
allowStateReadsEnd(e),
this[r]
},
set: function(e) {
this[isForcingUpdateKey] || shallowEqual(this[r], e) ?
setHiddenProp(this, r, e) : (setHiddenProp(this, r, e),
setHiddenProp(this, skipRenderKey, !0),
i.call(this).reportChanged(),
setHiddenProp(this, skipRenderKey, !1))
}
})
}
var hasSymbol = "function" == typeof Symbol && Symbol.for
, ReactForwardRefSymbol = hasSymbol ? Symbol.for("react.forward_ref") :
"function" == typeof reactExports.forwardRef &&
reactExports.forwardRef((function(e) {
return null
}
)).$$typeof
, ReactMemoSymbol = hasSymbol ? Symbol.for("react.memo") : "function" ==
typeof reactExports.memo && reactExports.memo((function(e) {
return null
}
)).$$typeof;
function observer(e) {
if (e.isMobxInjector,
ReactMemoSymbol && e.$$typeof === ReactMemoSymbol)
throw new Error("Mobx observer: You are trying to use 'observer' on
a function component wrapped in either another observer or 'React.memo'. The
observer already applies 'React.memo' for you.");
if (ReactForwardRefSymbol && e.$$typeof === ReactForwardRefSymbol) {
var t = e.render;
if ("function" != typeof t)
throw new Error("render property of ForwardRef was not a
function");
return reactExports.forwardRef((function() {
var e = arguments;
return reactExports.createElement(ObserverComponent, null,
(function() {
return t.apply(void 0, e)
}
))
}
))
}
return "function" != typeof e || e.prototype && e.prototype.render ||
e.isReactClass || Object.prototype.isPrototypeOf.call(reactExports.Component, e) ?
makeClassComponentObserver(e) : observer$1(e)
}
function _extends$g() {
return _extends$g = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var r = arguments[t];
for (var n in r)
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n])
}
return e
}
,
_extends$g.apply(this, arguments)
}
function _objectWithoutPropertiesLoose$1(e, t) {
if (null == e)
return {};
var r, n, i = {}, o = Object.keys(e);
for (n = 0; n < o.length; n++)
r = o[n],
t.indexOf(r) >= 0 || (i[r] = e[r]);
return i
}
var MobXProviderContext = React.createContext({});
function Provider(e) {
var t = e.children
, r = _objectWithoutPropertiesLoose$1(e, ["children"])
, n = React.useContext(MobXProviderContext)
, i = React.useRef(_extends$g({}, n, r)).current;
return React.createElement(MobXProviderContext.Provider, {
value: i
}, t)
}
if (Provider.displayName = "MobXProvider",
!reactExports.Component)
throw new Error("mobx-react requires React to be available");
if (!observable)
throw new Error("mobx-react requires mobx to be available");
function listCacheClear$3() {
this.__data__ = [],
this.size = 0
}
var _listCacheClear = listCacheClear$3;
function eq$7(e, t) {
return e === t || e != e && t != t
}
var eq_1 = eq$7
, eq$6 = eq_1;
function assocIndexOf$6(e, t) {
for (var r = e.length; r--; )
if (eq$6(e[r][0], t))
return r;
return -1
}
var _assocIndexOf = assocIndexOf$6
, assocIndexOf$5 = _assocIndexOf
, arrayProto$3 = Array.prototype
, splice$3 = arrayProto$3.splice;
function listCacheDelete$3(e) {
var t = this.__data__
, r = assocIndexOf$5(t, e);
return !(r < 0) && (r == t.length - 1 ? t.pop() : splice$3.call(t, r,
1),
--this.size,
!0)
}
var _listCacheDelete = listCacheDelete$3
, assocIndexOf$4 = _assocIndexOf;
function listCacheGet$3(e) {
var t = this.__data__
, r = assocIndexOf$4(t, e);
return r < 0 ? void 0 : t[r][1]
}
var _listCacheGet = listCacheGet$3
, assocIndexOf$3 = _assocIndexOf;
function listCacheHas$3(e) {
return assocIndexOf$3(this.__data__, e) > -1
}
var _listCacheHas = listCacheHas$3
, assocIndexOf$2 = _assocIndexOf;
function listCacheSet$3(e, t) {
var r = this.__data__
, n = assocIndexOf$2(r, e);
return n < 0 ? (++this.size,
r.push([e, t])) : r[n][1] = t,
this
}
var _listCacheSet = listCacheSet$3
, listCacheClear$2 = _listCacheClear
, listCacheDelete$2 = _listCacheDelete
, listCacheGet$2 = _listCacheGet
, listCacheHas$2 = _listCacheHas
, listCacheSet$2 = _listCacheSet;
function ListCache$6(e) {
var t = -1
, r = null == e ? 0 : e.length;
for (this.clear(); ++t < r; ) {
var n = e[t];
this.set(n[0], n[1])
}
}
ListCache$6.prototype.clear = listCacheClear$2,
ListCache$6.prototype.delete = listCacheDelete$2,
ListCache$6.prototype.get = listCacheGet$2,
ListCache$6.prototype.has = listCacheHas$2,
ListCache$6.prototype.set = listCacheSet$2;
var _ListCache = ListCache$6
, ListCache$5 = _ListCache;
function stackClear$3() {
this.__data__ = new ListCache$5,
this.size = 0
}
var _stackClear = stackClear$3;
function stackDelete$3(e) {
var t = this.__data__
, r = t.delete(e);
return this.size = t.size,
r
}
var _stackDelete = stackDelete$3;
function stackGet$3(e) {
return this.__data__.get(e)
}
var _stackGet = stackGet$3;
function stackHas$3(e) {
return this.__data__.has(e)
}
var _stackHas = stackHas$3
, freeGlobal$4 = "object" == typeof commonjsGlobal$1 && commonjsGlobal$1
&& commonjsGlobal$1.Object === Object && commonjsGlobal$1
, _freeGlobal = freeGlobal$4
, freeGlobal$3 = _freeGlobal
, freeSelf$2 = "object" == typeof self && self && self.Object === Object
&& self
, root$c = freeGlobal$3 || freeSelf$2 || Function("return this")()
, _root = root$c
, root$b = _root
, Symbol$9 = root$b.Symbol
, _Symbol = Symbol$9
, Symbol$8 = _Symbol
, objectProto$y = Object.prototype
, hasOwnProperty$v = objectProto$y.hasOwnProperty
, nativeObjectToString$4 = objectProto$y.toString
, symToStringTag$4 = Symbol$8 ? Symbol$8.toStringTag : void 0;
function getRawTag$3(e) {
var t = hasOwnProperty$v.call(e, symToStringTag$4)
, r = e[symToStringTag$4];
try {
e[symToStringTag$4] = void 0;
var n = !0
} catch (e2) {}
var i = nativeObjectToString$4.call(e);
return n && (t ? e[symToStringTag$4] = r : delete e[symToStringTag$4]),
i
}
var _getRawTag = getRawTag$3
, objectProto$x = Object.prototype
, nativeObjectToString$3 = objectProto$x.toString;
function objectToString$4(e) {
return nativeObjectToString$3.call(e)
}
var _objectToString = objectToString$4
, Symbol$7 = _Symbol
, getRawTag$2 = _getRawTag
, objectToString$3 = _objectToString
, nullTag$2 = "[object Null]"
, undefinedTag$2 = "[object Undefined]"
, symToStringTag$3 = Symbol$7 ? Symbol$7.toStringTag : void 0;
function baseGetTag$d(e) {
return null == e ? void 0 === e ? undefinedTag$2 : nullTag$2 :
symToStringTag$3 && symToStringTag$3 in Object(e) ? getRawTag$2(e) :
objectToString$3(e)
}
var _baseGetTag = baseGetTag$d;
function isObject$i(e) {
var t = typeof e;
return null != e && ("object" == t || "function" == t)
}
var isObject_1 = isObject$i;
const _isObject = getDefaultExportFromCjs(isObject_1);
var baseGetTag$c = _baseGetTag
, isObject$h = isObject_1
, asyncTag$2 = "[object AsyncFunction]"
, funcTag$5 = "[object Function]"
, genTag$3 = "[object GeneratorFunction]"
, proxyTag$2 = "[object Proxy]";
function isFunction$8(e) {
if (!isObject$h(e))
return !1;
var t = baseGetTag$c(e);
return t == funcTag$5 || t == genTag$3 || t == asyncTag$2 || t ==
proxyTag$2
}
var isFunction_1 = isFunction$8;
const _isFunction = getDefaultExportFromCjs(isFunction_1);
var root$a = _root, coreJsData$4 = root$a["__core-js_shared__"],
_coreJsData = coreJsData$4, coreJsData$3 = _coreJsData, maskSrcKey$2 = (uid2 =
/[^.]+$/.exec(coreJsData$3 && coreJsData$3.keys && coreJsData$3.keys.IE_PROTO ||
""),
uid2 ? "Symbol(src)_1." + uid2 : ""), uid2;
function isMasked$3(e) {
return !!maskSrcKey$2 && maskSrcKey$2 in e
}
var _isMasked = isMasked$3
, funcProto$6 = Function.prototype
, funcToString$6 = funcProto$6.toString;
function toSource$4(e) {
if (null != e) {
try {
return funcToString$6.call(e)
} catch (e2) {}
try {
return e + ""
} catch (e2) {}
}
return ""
}
var _toSource = toSource$4
, isFunction$7 = isFunction_1
, isMasked$2 = _isMasked
, isObject$g = isObject_1
, toSource$3 = _toSource
, reRegExpChar$2 = /[\\^$.*+?()[\]{}|]/g
, reIsHostCtor$2 = /^\[object .+?Constructor\]$/
, funcProto$5 = Function.prototype
, objectProto$w = Object.prototype
, funcToString$5 = funcProto$5.toString
, hasOwnProperty$u = objectProto$w.hasOwnProperty
, reIsNative$2 = RegExp("^" +
funcToString$5.call(hasOwnProperty$u).replace(reRegExpChar$2,
"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?")
+ "$");
function baseIsNative$3(e) {
return !(!isObject$g(e) || isMasked$2(e)) && (isFunction$7(e) ?
reIsNative$2 : reIsHostCtor$2).test(toSource$3(e))
}
var _baseIsNative = baseIsNative$3;
function getValue$3(e, t) {
return null == e ? void 0 : e[t]
}
var _getValue = getValue$3
, baseIsNative$2 = _baseIsNative
, getValue$2 = _getValue;
function getNative$9(e, t) {
var r = getValue$2(e, t);
return baseIsNative$2(r) ? r : void 0
}
var _getNative = getNative$9
, getNative$8 = _getNative
, root$9 = _root
, Map$7 = getNative$8(root$9, "Map")
, _Map = Map$7
, getNative$7 = _getNative
, nativeCreate$7 = getNative$7(Object, "create")
, _nativeCreate = nativeCreate$7
, nativeCreate$6 = _nativeCreate;
function hashClear$3() {
this.__data__ = nativeCreate$6 ? nativeCreate$6(null) : {},
this.size = 0
}
var _hashClear = hashClear$3;
function hashDelete$3(e) {
var t = this.has(e) && delete this.__data__[e];
return this.size -= t ? 1 : 0,
t
}
var _hashDelete = hashDelete$3
, nativeCreate$5 = _nativeCreate
, HASH_UNDEFINED$6 = "__lodash_hash_undefined__"
, objectProto$v = Object.prototype
, hasOwnProperty$t = objectProto$v.hasOwnProperty;
function hashGet$3(e) {
var t = this.__data__;
if (nativeCreate$5) {
var r = t[e];
return r === HASH_UNDEFINED$6 ? void 0 : r
}
return hasOwnProperty$t.call(t, e) ? t[e] : void 0
}
var _hashGet = hashGet$3
, nativeCreate$4 = _nativeCreate
, objectProto$u = Object.prototype
, hasOwnProperty$s = objectProto$u.hasOwnProperty;
function hashHas$3(e) {
var t = this.__data__;
return nativeCreate$4 ? void 0 !== t[e] : hasOwnProperty$s.call(t, e)
}
var _hashHas = hashHas$3
, nativeCreate$3 = _nativeCreate
, HASH_UNDEFINED$5 = "__lodash_hash_undefined__";
function hashSet$3(e, t) {
var r = this.__data__;
return this.size += this.has(e) ? 0 : 1,
r[e] = nativeCreate$3 && void 0 === t ? HASH_UNDEFINED$5 : t,
this
}
var _hashSet = hashSet$3
, hashClear$2 = _hashClear
, hashDelete$2 = _hashDelete
, hashGet$2 = _hashGet
, hashHas$2 = _hashHas
, hashSet$2 = _hashSet;
function Hash$3(e) {
var t = -1
, r = null == e ? 0 : e.length;
for (this.clear(); ++t < r; ) {
var n = e[t];
this.set(n[0], n[1])
}
}
Hash$3.prototype.clear = hashClear$2,
Hash$3.prototype.delete = hashDelete$2,
Hash$3.prototype.get = hashGet$2,
Hash$3.prototype.has = hashHas$2,
Hash$3.prototype.set = hashSet$2;
var _Hash = Hash$3
, Hash$2 = _Hash
, ListCache$4 = _ListCache
, Map$6 = _Map;
function mapCacheClear$3() {
this.size = 0,
this.__data__ = {
hash: new Hash$2,
map: new (Map$6 || ListCache$4),
string: new Hash$2
}
}
var _mapCacheClear = mapCacheClear$3;
function isKeyable$3(e) {
var t = typeof e;
return "string" == t || "number" == t || "symbol" == t || "boolean" ==
t ? "__proto__" !== e : null === e
}
var _isKeyable = isKeyable$3
, isKeyable$2 = _isKeyable;
function getMapData$6(e, t) {
var r = e.__data__;
return isKeyable$2(t) ? r["string" == typeof t ? "string" : "hash"] :
r.map
}
var _getMapData = getMapData$6
, getMapData$5 = _getMapData;
function mapCacheDelete$3(e) {
var t = getMapData$5(this, e).delete(e);
return this.size -= t ? 1 : 0,
t
}
var _mapCacheDelete = mapCacheDelete$3
, getMapData$4 = _getMapData;
function mapCacheGet$3(e) {
return getMapData$4(this, e).get(e)
}
var _mapCacheGet = mapCacheGet$3
, getMapData$3 = _getMapData;
function mapCacheHas$3(e) {
return getMapData$3(this, e).has(e)
}
var _mapCacheHas = mapCacheHas$3
, getMapData$2 = _getMapData;
function mapCacheSet$3(e, t) {
var r = getMapData$2(this, e)
, n = r.size;
return r.set(e, t),
this.size += r.size == n ? 0 : 1,
this
}
var _mapCacheSet = mapCacheSet$3
, mapCacheClear$2 = _mapCacheClear
, mapCacheDelete$2 = _mapCacheDelete
, mapCacheGet$2 = _mapCacheGet
, mapCacheHas$2 = _mapCacheHas
, mapCacheSet$2 = _mapCacheSet;
function MapCache$5(e) {
var t = -1
, r = null == e ? 0 : e.length;
for (this.clear(); ++t < r; ) {
var n = e[t];
this.set(n[0], n[1])
}
}
MapCache$5.prototype.clear = mapCacheClear$2,
MapCache$5.prototype.delete = mapCacheDelete$2,
MapCache$5.prototype.get = mapCacheGet$2,
MapCache$5.prototype.has = mapCacheHas$2,
MapCache$5.prototype.set = mapCacheSet$2;
var _MapCache = MapCache$5
, ListCache$3 = _ListCache
, Map$5 = _Map
, MapCache$4 = _MapCache
, LARGE_ARRAY_SIZE$4 = 200;
function stackSet$3(e, t) {
var r = this.__data__;
if (r instanceof ListCache$3) {
var n = r.__data__;
if (!Map$5 || n.length < LARGE_ARRAY_SIZE$4 - 1)
return n.push([e, t]),
this.size = ++r.size,
this;
r = this.__data__ = new MapCache$4(n)
}
return r.set(e, t),
this.size = r.size,
this
}
var _stackSet = stackSet$3
, ListCache$2 = _ListCache
, stackClear$2 = _stackClear
, stackDelete$2 = _stackDelete
, stackGet$2 = _stackGet
, stackHas$2 = _stackHas
, stackSet$2 = _stackSet;
function Stack$6(e) {
var t = this.__data__ = new ListCache$2(e);
this.size = t.size
}
Stack$6.prototype.clear = stackClear$2,
Stack$6.prototype.delete = stackDelete$2,
Stack$6.prototype.get = stackGet$2,
Stack$6.prototype.has = stackHas$2,
Stack$6.prototype.set = stackSet$2;
var _Stack = Stack$6
, HASH_UNDEFINED$4 = "__lodash_hash_undefined__";
function setCacheAdd$2(e) {
return this.__data__.set(e, HASH_UNDEFINED$4),
this
}
var _setCacheAdd = setCacheAdd$2;
function setCacheHas$2(e) {
return this.__data__.has(e)
}
var _setCacheHas = setCacheHas$2
, MapCache$3 = _MapCache
, setCacheAdd$1 = _setCacheAdd
, setCacheHas$1 = _setCacheHas;
function SetCache$4(e) {
var t = -1
, r = null == e ? 0 : e.length;
for (this.__data__ = new MapCache$3; ++t < r; )
this.add(e[t])
}
SetCache$4.prototype.add = SetCache$4.prototype.push = setCacheAdd$1,
SetCache$4.prototype.has = setCacheHas$1;
var _SetCache = SetCache$4;
function arraySome$2(e, t) {
for (var r = -1, n = null == e ? 0 : e.length; ++r < n; )
if (t(e[r], r, e))
return !0;
return !1
}
var _arraySome = arraySome$2;
function cacheHas$4(e, t) {
return e.has(t)
}
var _cacheHas = cacheHas$4
, SetCache$3 = _SetCache
, arraySome$1 = _arraySome
, cacheHas$3 = _cacheHas
, COMPARE_PARTIAL_FLAG$b = 1
, COMPARE_UNORDERED_FLAG$7 = 2;
function equalArrays$3(e, t, r, n, i, o) {
var s = r & COMPARE_PARTIAL_FLAG$b
, a = e.length
, l = t.length;
if (a != l && !(s && l > a))
return !1;
var c = o.get(e)
, u = o.get(t);
if (c && u)
return c == t && u == e;
var d = -1
, p = !0
, h = r & COMPARE_UNORDERED_FLAG$7 ? new SetCache$3 : void 0;
for (o.set(e, t),
o.set(t, e); ++d < a; ) {
var f = e[d]
, m = t[d];
if (n)
var g = s ? n(m, f, d, t, e, o) : n(f, m, d, e, t, o);
if (void 0 !== g) {
if (g)
continue;
p = !1;
break
}
if (h) {
if (!arraySome$1(t, (function(e, t) {
if (!cacheHas$3(h, t) && (f === e || i(f, e, r, n, o)))
return h.push(t)
}
))) {
p = !1;
break
}
} else if (f !== m && !i(f, m, r, n, o)) {
p = !1;
break
}
}
return o.delete(e),
o.delete(t),
p
}
var _equalArrays = equalArrays$3
, root$8 = _root
, Uint8Array$5 = root$8.Uint8Array
, _Uint8Array = Uint8Array$5;
function mapToArray$2(e) {
var t = -1
, r = Array(e.size);
return e.forEach((function(e, n) {
r[++t] = [n, e]
}
)),
r
}
var _mapToArray = mapToArray$2;
function setToArray$4(e) {
var t = -1
, r = Array(e.size);
return e.forEach((function(e) {
r[++t] = e
}
)),
r
}
var _setToArray = setToArray$4
, Symbol$6 = _Symbol
, Uint8Array$4 = _Uint8Array
, eq$5 = eq_1
, equalArrays$2 = _equalArrays
, mapToArray$1 = _mapToArray
, setToArray$3 = _setToArray
, COMPARE_PARTIAL_FLAG$a = 1
, COMPARE_UNORDERED_FLAG$6 = 2
, boolTag$7 = "[object Boolean]"
, dateTag$7 = "[object Date]"
, errorTag$5 = "[object Error]"
, mapTag$a = "[object Map]"
, numberTag$7 = "[object Number]"
, regexpTag$7 = "[object RegExp]"
, setTag$a = "[object Set]"
, stringTag$7 = "[object String]"
, symbolTag$6 = "[object Symbol]"
, arrayBufferTag$6 = "[object ArrayBuffer]"
, dataViewTag$8 = "[object DataView]"
, symbolProto$5 = Symbol$6 ? Symbol$6.prototype : void 0
, symbolValueOf$3 = symbolProto$5 ? symbolProto$5.valueOf : void 0;
function equalByTag$2(e, t, r, n, i, o, s) {
switch (r) {
case dataViewTag$8:
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
return !1;
e = e.buffer,
t = t.buffer;
case arrayBufferTag$6:
return !(e.byteLength != t.byteLength || !o(new Uint8Array$4(e),
new Uint8Array$4(t)));
case boolTag$7:
case dateTag$7:
case numberTag$7:
return eq$5(+e, +t);
case errorTag$5:
return e.name == t.name && e.message == t.message;
case regexpTag$7:
case stringTag$7:
return e == t + "";
case mapTag$a:
var a = mapToArray$1;
case setTag$a:
var l = n & COMPARE_PARTIAL_FLAG$a;
if (a || (a = setToArray$3),
e.size != t.size && !l)
return !1;
var c = s.get(e);
if (c)
return c == t;
n |= COMPARE_UNORDERED_FLAG$6,
s.set(e, t);
var u = equalArrays$2(a(e), a(t), n, i, o, s);
return s.delete(e),
u;
case symbolTag$6:
if (symbolValueOf$3)
return symbolValueOf$3.call(e) == symbolValueOf$3.call(t)
}
return !1
}
var _equalByTag = equalByTag$2;
function arrayPush$5(e, t) {
for (var r = -1, n = t.length, i = e.length; ++r < n; )
e[i + r] = t[r];
return e
}
var _arrayPush = arrayPush$5
, isArray$q = Array.isArray
, isArray_1 = isArray$q;
const _isArray = getDefaultExportFromCjs(isArray_1);
var arrayPush$4 = _arrayPush
, isArray$p = isArray_1;
function baseGetAllKeys$4(e, t, r) {
var n = t(e);
return isArray$p(e) ? n : arrayPush$4(n, r(e))
}
var _baseGetAllKeys = baseGetAllKeys$4;
function arrayFilter$3(e, t) {
for (var r = -1, n = null == e ? 0 : e.length, i = 0, o = []; ++r <
n; ) {
var s = e[r];
t(s, r, e) && (o[i++] = s)
}
return o
}
var _arrayFilter = arrayFilter$3;
function stubArray$4() {
return []
}
var stubArray_1 = stubArray$4
, arrayFilter$2 = _arrayFilter
, stubArray$3 = stubArray_1
, objectProto$t = Object.prototype
, propertyIsEnumerable$5 = objectProto$t.propertyIsEnumerable
, nativeGetSymbols$3 = Object.getOwnPropertySymbols
, getSymbols$6 = nativeGetSymbols$3 ? function(e) {
return null == e ? [] : (e = Object(e),
arrayFilter$2(nativeGetSymbols$3(e), (function(t) {
return propertyIsEnumerable$5.call(e, t)
}
)))
}
: stubArray$3
, _getSymbols = getSymbols$6;
function baseTimes$4(e, t) {
for (var r = -1, n = Array(e); ++r < e; )
n[r] = t(r);
return n
}
var _baseTimes = baseTimes$4;
function isObjectLike$g(e) {
return null != e && "object" == typeof e
}
var isObjectLike_1 = isObjectLike$g
, baseGetTag$b = _baseGetTag
, isObjectLike$f = isObjectLike_1
, argsTag$7 = "[object Arguments]";
function baseIsArguments$3(e) {
return isObjectLike$f(e) && baseGetTag$b(e) == argsTag$7
}
var _baseIsArguments = baseIsArguments$3
, baseIsArguments$2 = _baseIsArguments
, isObjectLike$e = isObjectLike_1
, objectProto$s = Object.prototype
, hasOwnProperty$r = objectProto$s.hasOwnProperty
, propertyIsEnumerable$4 = objectProto$s.propertyIsEnumerable
, isArguments$8 = baseIsArguments$2(function() {
return arguments
}()) ? baseIsArguments$2 : function(e) {
return isObjectLike$e(e) && hasOwnProperty$r.call(e, "callee") && !
propertyIsEnumerable$4.call(e, "callee")
}
, isArguments_1 = isArguments$8
, isBuffer$9 = {
exports: {}
};
function stubFalse$2() {
return !1
}
var stubFalse_1 = stubFalse$2;
const _stubFalse = getDefaultExportFromCjs(stubFalse_1);
isBuffer$9.exports,
function(e, t) {
var r = _root
, n = stubFalse_1
, i = t && !t.nodeType && t
, o = i && e && !e.nodeType && e
, s = o && o.exports === i ? r.Buffer : void 0
, a = (s ? s.isBuffer : void 0) || n;
e.exports = a
}(isBuffer$9, isBuffer$9.exports);
var isBufferExports = isBuffer$9.exports
, MAX_SAFE_INTEGER$5 = 9007199254740991
, reIsUint$2 = /^(?:0|[1-9]\d*)$/;
function isIndex$7(e, t) {
var r = typeof e;
return !!(t = null == t ? MAX_SAFE_INTEGER$5 : t) && ("number" == r ||
"symbol" != r && reIsUint$2.test(e)) && e > -1 && e % 1 == 0 && e < t
}
var _isIndex = isIndex$7
, MAX_SAFE_INTEGER$4 = 9007199254740991;
function isLength$5(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && e <=
MAX_SAFE_INTEGER$4
}
var isLength_1 = isLength$5
, baseGetTag$a = _baseGetTag
, isLength$4 = isLength_1
, isObjectLike$d = isObjectLike_1
, argsTag$6 = "[object Arguments]"
, arrayTag$5 = "[object Array]"
, boolTag$6 = "[object Boolean]"
, dateTag$6 = "[object Date]"
, errorTag$4 = "[object Error]"
, funcTag$4 = "[object Function]"
, mapTag$9 = "[object Map]"
, numberTag$6 = "[object Number]"
, objectTag$9 = "[object Object]"
, regexpTag$6 = "[object RegExp]"
, setTag$9 = "[object Set]"
, stringTag$6 = "[object String]"
, weakMapTag$5 = "[object WeakMap]"
, arrayBufferTag$5 = "[object ArrayBuffer]"
, dataViewTag$7 = "[object DataView]"
, float32Tag$4 = "[object Float32Array]"
, float64Tag$4 = "[object Float64Array]"
, int8Tag$4 = "[object Int8Array]"
, int16Tag$4 = "[object Int16Array]"
, int32Tag$4 = "[object Int32Array]"
, uint8Tag$4 = "[object Uint8Array]"
, uint8ClampedTag$4 = "[object Uint8ClampedArray]"
, uint16Tag$4 = "[object Uint16Array]"
, uint32Tag$4 = "[object Uint32Array]"
, typedArrayTags$2 = {};
function baseIsTypedArray$3(e) {
return isObjectLike$d(e) && isLength$4(e.length) && !!
typedArrayTags$2[baseGetTag$a(e)]
}
typedArrayTags$2[float32Tag$4] = typedArrayTags$2[float64Tag$4] =
typedArrayTags$2[int8Tag$4] = typedArrayTags$2[int16Tag$4] =
typedArrayTags$2[int32Tag$4] = typedArrayTags$2[uint8Tag$4] =
typedArrayTags$2[uint8ClampedTag$4] = typedArrayTags$2[uint16Tag$4] =
typedArrayTags$2[uint32Tag$4] = !0,
typedArrayTags$2[argsTag$6] = typedArrayTags$2[arrayTag$5] =
typedArrayTags$2[arrayBufferTag$5] = typedArrayTags$2[boolTag$6] =
typedArrayTags$2[dataViewTag$7] = typedArrayTags$2[dateTag$6] =
typedArrayTags$2[errorTag$4] = typedArrayTags$2[funcTag$4] =
typedArrayTags$2[mapTag$9] = typedArrayTags$2[numberTag$6] =
typedArrayTags$2[objectTag$9] = typedArrayTags$2[regexpTag$6] =
typedArrayTags$2[setTag$9] = typedArrayTags$2[stringTag$6] =
typedArrayTags$2[weakMapTag$5] = !1;
var _baseIsTypedArray = baseIsTypedArray$3;
function baseUnary$8(e) {
return function(t) {
return e(t)
}
}
var _baseUnary = baseUnary$8
, _nodeUtil = {
exports: {}
};
_nodeUtil.exports,
function(e, t) {
var r = _freeGlobal
, n = t && !t.nodeType && t
, i = n && e && !e.nodeType && e
, o = i && i.exports === n && r.process
, s = function() {
try {
var e = i && i.require && i.require("util").types;
return e || o && o.binding && o.binding("util")
} catch (e2) {}
}();
e.exports = s
}(_nodeUtil, _nodeUtil.exports);
var _nodeUtilExports = _nodeUtil.exports
, baseIsTypedArray$2 = _baseIsTypedArray
, baseUnary$7 = _baseUnary
, nodeUtil$7 = _nodeUtilExports
, nodeIsTypedArray$2 = nodeUtil$7 && nodeUtil$7.isTypedArray
, isTypedArray$7 = nodeIsTypedArray$2 ? baseUnary$7(nodeIsTypedArray$2) :
baseIsTypedArray$2
, isTypedArray_1 = isTypedArray$7
, baseTimes$3 = _baseTimes
, isArguments$7 = isArguments_1
, isArray$o = isArray_1
, isBuffer$8 = isBufferExports
, isIndex$6 = _isIndex
, isTypedArray$6 = isTypedArray_1
, objectProto$r = Object.prototype
, hasOwnProperty$q = objectProto$r.hasOwnProperty;
function arrayLikeKeys$4(e, t) {
var r = isArray$o(e)
, n = !r && isArguments$7(e)
, i = !r && !n && isBuffer$8(e)
, o = !r && !n && !i && isTypedArray$6(e)
, s = r || n || i || o
, a = s ? baseTimes$3(e.length, String) : []
, l = a.length;
for (var c in e)
!t && !hasOwnProperty$q.call(e, c) || s && ("length" == c || i &&
("offset" == c || "parent" == c) || o && ("buffer" == c || "byteLength" == c ||
"byteOffset" == c) || isIndex$6(c, l)) || a.push(c);
return a
}
var _arrayLikeKeys = arrayLikeKeys$4
, objectProto$q = Object.prototype;
function isPrototype$7(e) {
var t = e && e.constructor;
return e === ("function" == typeof t && t.prototype || objectProto$q)
}
var _isPrototype = isPrototype$7;
function overArg$4(e, t) {
return function(r) {
return e(t(r))
}
}
var _overArg = overArg$4
, overArg$3 = _overArg
, nativeKeys$4 = overArg$3(Object.keys, Object)
, _nativeKeys = nativeKeys$4
, isPrototype$6 = _isPrototype
, nativeKeys$3 = _nativeKeys
, objectProto$p = Object.prototype
, hasOwnProperty$p = objectProto$p.hasOwnProperty;
function baseKeys$4(e) {
if (!isPrototype$6(e))
return nativeKeys$3(e);
var t = [];
for (var r in Object(e))
hasOwnProperty$p.call(e, r) && "constructor" != r && t.push(r);
return t
}
var _baseKeys = baseKeys$4
, isFunction$6 = isFunction_1
, isLength$3 = isLength_1;
function isArrayLike$c(e) {
return null != e && isLength$3(e.length) && !isFunction$6(e)
}
var isArrayLike_1 = isArrayLike$c
, arrayLikeKeys$3 = _arrayLikeKeys
, baseKeys$3 = _baseKeys
, isArrayLike$b = isArrayLike_1;
function keys$a(e) {
return isArrayLike$b(e) ? arrayLikeKeys$3(e) : baseKeys$3(e)
}
var keys_1 = keys$a
, baseGetAllKeys$3 = _baseGetAllKeys
, getSymbols$5 = _getSymbols
, keys$9 = keys_1;
function getAllKeys$4(e) {
return baseGetAllKeys$3(e, keys$9, getSymbols$5)
}
var _getAllKeys = getAllKeys$4
, getAllKeys$3 = _getAllKeys
, COMPARE_PARTIAL_FLAG$9 = 1
, objectProto$o = Object.prototype
, hasOwnProperty$o = objectProto$o.hasOwnProperty;
function equalObjects$2(e, t, r, n, i, o) {
var s = r & COMPARE_PARTIAL_FLAG$9
, a = getAllKeys$3(e)
, l = a.length;
if (l != getAllKeys$3(t).length && !s)
return !1;
for (var c = l; c--; ) {
var u = a[c];
if (!(s ? u in t : hasOwnProperty$o.call(t, u)))
return !1
}
var d = o.get(e)
, p = o.get(t);
if (d && p)
return d == t && p == e;
var h = !0;
o.set(e, t),
o.set(t, e);
for (var f = s; ++c < l; ) {
var m = e[u = a[c]]
, g = t[u];
if (n)
var y = s ? n(g, m, u, t, e, o) : n(m, g, u, e, t, o);
if (!(void 0 === y ? m === g || i(m, g, r, n, o) : y)) {
h = !1;
break
}
f || (f = "constructor" == u)
}
if (h && !f) {
var v = e.constructor
, b = t.constructor;
v == b || !("constructor"in e) || !("constructor"in t) ||
"function" == typeof v && v instanceof v && "function" == typeof b && b instanceof
b || (h = !1)
}
return o.delete(e),
o.delete(t),
h
}
var _equalObjects = equalObjects$2
, getNative$6 = _getNative
, root$7 = _root
, DataView$5 = getNative$6(root$7, "DataView")
, _DataView = DataView$5
, getNative$5 = _getNative
, root$6 = _root
, Promise$4 = getNative$5(root$6, "Promise")
, _Promise = Promise$4
, getNative$4 = _getNative
, root$5 = _root
, Set$6 = getNative$4(root$5, "Set")
, _Set = Set$6
, getNative$3 = _getNative
, root$4 = _root
, WeakMap$5 = getNative$3(root$4, "WeakMap")
, _WeakMap = WeakMap$5
, DataView$4 = _DataView
, Map$4 = _Map
, Promise$3 = _Promise
, Set$5 = _Set
, WeakMap$4 = _WeakMap
, baseGetTag$9 = _baseGetTag
, toSource$2 = _toSource
, mapTag$8 = "[object Map]"
, objectTag$8 = "[object Object]"
, promiseTag$2 = "[object Promise]"
, setTag$8 = "[object Set]"
, weakMapTag$4 = "[object WeakMap]"
, dataViewTag$6 = "[object DataView]"
, dataViewCtorString$2 = toSource$2(DataView$4)
, mapCtorString$2 = toSource$2(Map$4)
, promiseCtorString$2 = toSource$2(Promise$3)
, setCtorString$2 = toSource$2(Set$5)
, weakMapCtorString$2 = toSource$2(WeakMap$4)
, getTag$9 = baseGetTag$9;
(DataView$4 && getTag$9(new DataView$4(new ArrayBuffer(1))) !=
dataViewTag$6 || Map$4 && getTag$9(new Map$4) != mapTag$8 || Promise$3 &&
getTag$9(Promise$3.resolve()) != promiseTag$2 || Set$5 && getTag$9(new Set$5) !=
setTag$8 || WeakMap$4 && getTag$9(new WeakMap$4) != weakMapTag$4) && (getTag$9 =
function(e) {
var t = baseGetTag$9(e)
, r = t == objectTag$8 ? e.constructor : void 0
, n = r ? toSource$2(r) : "";
if (n)
switch (n) {
case dataViewCtorString$2:
return dataViewTag$6;
case mapCtorString$2:
return mapTag$8;
case promiseCtorString$2:
return promiseTag$2;
case setCtorString$2:
return setTag$8;
case weakMapCtorString$2:
return weakMapTag$4
}
return t
}
);
var _getTag = getTag$9
, Stack$5 = _Stack
, equalArrays$1 = _equalArrays
, equalByTag$1 = _equalByTag
, equalObjects$1 = _equalObjects
, getTag$8 = _getTag
, isArray$n = isArray_1
, isBuffer$7 = isBufferExports
, isTypedArray$5 = isTypedArray_1
, COMPARE_PARTIAL_FLAG$8 = 1
, argsTag$5 = "[object Arguments]"
, arrayTag$4 = "[object Array]"
, objectTag$7 = "[object Object]"
, objectProto$n = Object.prototype
, hasOwnProperty$n = objectProto$n.hasOwnProperty;
function baseIsEqualDeep$2(e, t, r, n, i, o) {
var s = isArray$n(e)
, a = isArray$n(t)
, l = s ? arrayTag$4 : getTag$8(e)
, c = a ? arrayTag$4 : getTag$8(t)
, u = (l = l == argsTag$5 ? objectTag$7 : l) == objectTag$7
, d = (c = c == argsTag$5 ? objectTag$7 : c) == objectTag$7
, p = l == c;
if (p && isBuffer$7(e)) {
if (!isBuffer$7(t))
return !1;
s = !0,
u = !1
}
if (p && !u)
return o || (o = new Stack$5),
s || isTypedArray$5(e) ? equalArrays$1(e, t, r, n, i, o) :
equalByTag$1(e, t, l, r, n, i, o);
if (!(r & COMPARE_PARTIAL_FLAG$8)) {
var h = u && hasOwnProperty$n.call(e, "__wrapped__")
, f = d && hasOwnProperty$n.call(t, "__wrapped__");
if (h || f) {
var m = h ? e.value() : e
, g = f ? t.value() : t;
return o || (o = new Stack$5),
i(m, g, r, n, o)
}
}
return !!p && (o || (o = new Stack$5),
equalObjects$1(e, t, r, n, i, o))
}
var _baseIsEqualDeep = baseIsEqualDeep$2
, baseIsEqualDeep$1 = _baseIsEqualDeep
, isObjectLike$c = isObjectLike_1;
function baseIsEqual$4(e, t, r, n, i) {
return e === t || (null == e || null == t || !isObjectLike$c(e) && !
isObjectLike$c(t) ? e != e && t != t : baseIsEqualDeep$1(e, t, r, n, baseIsEqual$4,
i))
}
var _baseIsEqual = baseIsEqual$4
, Stack$4 = _Stack
, baseIsEqual$3 = _baseIsEqual
, COMPARE_PARTIAL_FLAG$7 = 1
, COMPARE_UNORDERED_FLAG$5 = 2;
function baseIsMatch$2(e, t, r, n) {
var i = r.length
, o = i
, s = !n;
if (null == e)
return !o;
for (e = Object(e); i--; ) {
var a = r[i];
if (s && a[2] ? a[1] !== e[a[0]] : !(a[0]in e))
return !1
}
for (; ++i < o; ) {
var l = (a = r[i])[0]
, c = e[l]
, u = a[1];
if (s && a[2]) {
if (void 0 === c && !(l in e))
return !1
} else {
var d = new Stack$4;
if (n)
var p = n(c, u, l, e, t, d);
if (!(void 0 === p ? baseIsEqual$3(u, c, COMPARE_PARTIAL_FLAG$7
| COMPARE_UNORDERED_FLAG$5, n, d) : p))
return !1
}
}
return !0
}
var _baseIsMatch = baseIsMatch$2
, isObject$f = isObject_1;
function isStrictComparable$3(e) {
return e == e && !isObject$f(e)
}
var _isStrictComparable = isStrictComparable$3
, isStrictComparable$2 = _isStrictComparable
, keys$8 = keys_1;
function getMatchData$2(e) {
for (var t = keys$8(e), r = t.length; r--; ) {
var n = t[r]
, i = e[n];
t[r] = [n, i, isStrictComparable$2(i)]
}
return t
}
var _getMatchData = getMatchData$2;
function matchesStrictComparable$3(e, t) {
return function(r) {
return null != r && (r[e] === t && (void 0 !== t || e in
Object(r)))
}
}
var _matchesStrictComparable = matchesStrictComparable$3
, baseIsMatch$1 = _baseIsMatch
, getMatchData$1 = _getMatchData
, matchesStrictComparable$2 = _matchesStrictComparable;
function baseMatches$2(e) {
var t = getMatchData$1(e);
return 1 == t.length && t[0][2] ? matchesStrictComparable$2(t[0][0],
t[0][1]) : function(r) {
return r === e || baseIsMatch$1(r, e, t)
}
}
var _baseMatches = baseMatches$2
, baseGetTag$8 = _baseGetTag
, isObjectLike$b = isObjectLike_1
, symbolTag$5 = "[object Symbol]";
function isSymbol$9(e) {
return "symbol" == typeof e || isObjectLike$b(e) && baseGetTag$8(e) ==
symbolTag$5
}
var isSymbol_1 = isSymbol$9
, isArray$m = isArray_1
, isSymbol$8 = isSymbol_1
, reIsDeepProp$2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/
, reIsPlainProp$2 = /^\w*$/;
function isKey$5(e, t) {
if (isArray$m(e))
return !1;
var r = typeof e;
return !("number" != r && "symbol" != r && "boolean" != r && null != e
&& !isSymbol$8(e)) || (reIsPlainProp$2.test(e) || !reIsDeepProp$2.test(e) || null !
= t && e in Object(t))
}
var _isKey = isKey$5
, MapCache$2 = _MapCache
, FUNC_ERROR_TEXT$6 = "Expected a function";
function memoize$3(e, t) {
if ("function" != typeof e || null != t && "function" != typeof t)
throw new TypeError(FUNC_ERROR_TEXT$6);
var r = function() {
var n = arguments
, i = t ? t.apply(this, n) : n[0]
, o = r.cache;
if (o.has(i))
return o.get(i);
var s = e.apply(this, n);
return r.cache = o.set(i, s) || o,
s
};
return r.cache = new (memoize$3.Cache || MapCache$2),
r
}
memoize$3.Cache = MapCache$2;
var memoize_1 = memoize$3
, memoize$2 = memoize_1
, MAX_MEMOIZE_SIZE$2 = 500;
function memoizeCapped$3(e) {
var t = memoize$2(e, (function(e) {
return r.size === MAX_MEMOIZE_SIZE$2 && r.clear(),
e
}
))
, r = t.cache;
return t
}
var _memoizeCapped = memoizeCapped$3
, memoizeCapped$2 = _memoizeCapped
, rePropName$3 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)
[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g
, reEscapeChar$3 = /\\(\\)?/g
, stringToPath$6 = memoizeCapped$2((function(e) {
var t = [];
return 46 === e.charCodeAt(0) && t.push(""),
e.replace(rePropName$3, (function(e, r, n, i) {
t.push(n ? i.replace(reEscapeChar$3, "$1") : r || e)
}
)),
t
}
))
, _stringToPath = stringToPath$6;
function arrayMap$8(e, t) {
for (var r = -1, n = null == e ? 0 : e.length, i = Array(n); ++r < n; )
i[r] = t(e[r], r, e);
return i
}
var _arrayMap = arrayMap$8
, Symbol$5 = _Symbol
, arrayMap$7 = _arrayMap
, isArray$l = isArray_1
, isSymbol$7 = isSymbol_1
, INFINITY$6 = 1 / 0
, symbolProto$4 = Symbol$5 ? Symbol$5.prototype : void 0
, symbolToString$2 = symbolProto$4 ? symbolProto$4.toString : void 0;
function baseToString$4(e) {
if ("string" == typeof e)
return e;
if (isArray$l(e))
return arrayMap$7(e, baseToString$4) + "";
if (isSymbol$7(e))
return symbolToString$2 ? symbolToString$2.call(e) : "";
var t = e + "";
return "0" == t && 1 / e == -INFINITY$6 ? "-0" : t
}
var _baseToString = baseToString$4
, baseToString$3 = _baseToString;
function toString$5(e) {
return null == e ? "" : baseToString$3(e)
}
var toString_1 = toString$5;
const _toString = getDefaultExportFromCjs(toString_1);
var isArray$k = isArray_1
, isKey$4 = _isKey
, stringToPath$5 = _stringToPath
, toString$4 = toString_1;
function castPath$8(e, t) {
return isArray$k(e) ? e : isKey$4(e, t) ? [e] :
stringToPath$5(toString$4(e))
}
var _castPath = castPath$8
, isSymbol$6 = isSymbol_1
, INFINITY$5 = 1 / 0;
function toKey$9(e) {
if ("string" == typeof e || isSymbol$6(e))
return e;
var t = e + "";
return "0" == t && 1 / e == -INFINITY$5 ? "-0" : t
}
var _toKey = toKey$9
, castPath$7 = _castPath
, toKey$8 = _toKey;
function baseGet$6(e, t) {
for (var r = 0, n = (t = castPath$7(t, e)).length; null != e && r <
n; )
e = e[toKey$8(t[r++])];
return r && r == n ? e : void 0
}
var _baseGet = baseGet$6
, baseGet$5 = _baseGet;
function get$4(e, t, r) {
var n = null == e ? void 0 : baseGet$5(e, t);
return void 0 === n ? r : n
}
var get_1 = get$4;
const _get = getDefaultExportFromCjs(get_1);
function baseHasIn$2(e, t) {
return null != e && t in Object(e)
}
var _baseHasIn = baseHasIn$2
, castPath$6 = _castPath
, isArguments$6 = isArguments_1
, isArray$j = isArray_1
, isIndex$5 = _isIndex
, isLength$2 = isLength_1
, toKey$7 = _toKey;
function hasPath$2(e, t, r) {
for (var n = -1, i = (t = castPath$6(t, e)).length, o = !1; ++n < i; )
{
var s = toKey$7(t[n]);
if (!(o = null != e && r(e, s)))
break;
e = e[s]
}
return o || ++n != i ? o : !!(i = null == e ? 0 : e.length) &&
isLength$2(i) && isIndex$5(s, i) && (isArray$j(e) || isArguments$6(e))
}
var _hasPath = hasPath$2
, baseHasIn$1 = _baseHasIn
, hasPath$1 = _hasPath;
function hasIn$3(e, t) {
return null != e && hasPath$1(e, t, baseHasIn$1)
}
var hasIn_1 = hasIn$3
, baseIsEqual$2 = _baseIsEqual
, get$3 = get_1
, hasIn$2 = hasIn_1
, isKey$3 = _isKey
, isStrictComparable$1 = _isStrictComparable
, matchesStrictComparable$1 = _matchesStrictComparable
, toKey$6 = _toKey
, COMPARE_PARTIAL_FLAG$6 = 1
, COMPARE_UNORDERED_FLAG$4 = 2;
function baseMatchesProperty$2(e, t) {
return isKey$3(e) && isStrictComparable$1(t) ?
matchesStrictComparable$1(toKey$6(e), t) : function(r) {
var n = get$3(r, e);
return void 0 === n && n === t ? hasIn$2(r, e) : baseIsEqual$2(t,
n, COMPARE_PARTIAL_FLAG$6 | COMPARE_UNORDERED_FLAG$4)
}
}
var _baseMatchesProperty = baseMatchesProperty$2;
function identity$7(e) {
return e
}
var identity_1 = identity$7;
function baseProperty$2(e) {
return function(t) {
return null == t ? void 0 : t[e]
}
}
var _baseProperty = baseProperty$2
, baseGet$4 = _baseGet;
function basePropertyDeep$2(e) {
return function(t) {
return baseGet$4(t, e)
}
}
var _basePropertyDeep = basePropertyDeep$2
, baseProperty$1 = _baseProperty
, basePropertyDeep$1 = _basePropertyDeep
, isKey$2 = _isKey
, toKey$5 = _toKey;
function property$2(e) {
return isKey$2(e) ? baseProperty$1(toKey$5(e)) : basePropertyDeep$1(e)
}
var property_1 = property$2
, baseMatches$1 = _baseMatches
, baseMatchesProperty$1 = _baseMatchesProperty
, identity$6 = identity_1
, isArray$i = isArray_1
, property$1 = property_1;
function baseIteratee$6(e) {
return "function" == typeof e ? e : null == e ? identity$6 : "object"
== typeof e ? isArray$i(e) ? baseMatchesProperty$1(e[0], e[1]) : baseMatches$1(e) :
property$1(e)
}
var _baseIteratee = baseIteratee$6;
function last$3(e) {
var t = null == e ? 0 : e.length;
return t ? e[t - 1] : void 0
}
var last_1 = last$3;
function baseSlice$4(e, t, r) {
var n = -1
, i = e.length;
t < 0 && (t = -t > i ? 0 : i + t),
(r = r > i ? i : r) < 0 && (r += i),
i = t > r ? 0 : r - t >>> 0,
t >>>= 0;
for (var o = Array(i); ++n < i; )
o[n] = e[n + t];
return o
}
var _baseSlice = baseSlice$4
, baseGet$3 = _baseGet
, baseSlice$3 = _baseSlice;
function parent$2(e, t) {
return t.length < 2 ? e : baseGet$3(e, baseSlice$3(t, 0, -1))
}
var _parent = parent$2
, castPath$5 = _castPath
, last$2 = last_1
, parent$1 = _parent
, toKey$4 = _toKey;
function baseUnset$4(e, t) {
return t = castPath$5(t, e),
null == (e = parent$1(e, t)) || delete e[toKey$4(last$2(t))]
}
var _baseUnset = baseUnset$4
, baseUnset$3 = _baseUnset
, isIndex$4 = _isIndex
, arrayProto$2 = Array.prototype
, splice$2 = arrayProto$2.splice;
function basePullAt$1(e, t) {
for (var r = e ? t.length : 0, n = r - 1; r--; ) {
var i = t[r];
if (r == n || i !== o) {
var o = i;
isIndex$4(i) ? splice$2.call(e, i, 1) : baseUnset$3(e, i)
}
}
return e
}
var _basePullAt = basePullAt$1
, baseIteratee$5 = _baseIteratee
, basePullAt = _basePullAt;
function remove$1(e, t) {
var r = [];
if (!e || !e.length)
return r;
var n = -1
, i = []
, o = e.length;
for (t = baseIteratee$5(t); ++n < o; ) {
var s = e[n];
t(s, n, e) && (r.push(s),
i.push(n))
}
return basePullAt(e, i),
r
}
var remove_1 = remove$1;
const remove$2 = getDefaultExportFromCjs(remove_1);
var ENV = (e => (e[e.WEBGL_LEGACY = 0] = "WEBGL_LEGACY",
e[e.WEBGL = 1] = "WEBGL",
e[e.WEBGL2 = 2] = "WEBGL2",
e))(ENV || {})
, RENDERER_TYPE = (e => (e[e.UNKNOWN = 0] = "UNKNOWN",
e[e.WEBGL = 1] = "WEBGL",
e[e.CANVAS = 2] = "CANVAS",
e))(RENDERER_TYPE || {})
, BUFFER_BITS = (e => (e[e.COLOR = 16384] = "COLOR",
e[e.DEPTH = 256] = "DEPTH",
e[e.STENCIL = 1024] = "STENCIL",
e))(BUFFER_BITS || {})
, BLEND_MODES = (e => (e[e.NORMAL = 0] = "NORMAL",
e[e.ADD = 1] = "ADD",
e[e.MULTIPLY = 2] = "MULTIPLY",
e[e.SCREEN = 3] = "SCREEN",
e[e.OVERLAY = 4] = "OVERLAY",
e[e.DARKEN = 5] = "DARKEN",
e[e.LIGHTEN = 6] = "LIGHTEN",
e[e.COLOR_DODGE = 7] = "COLOR_DODGE",
e[e.COLOR_BURN = 8] = "COLOR_BURN",
e[e.HARD_LIGHT = 9] = "HARD_LIGHT",
e[e.SOFT_LIGHT = 10] = "SOFT_LIGHT",
e[e.DIFFERENCE = 11] = "DIFFERENCE",
e[e.EXCLUSION = 12] = "EXCLUSION",
e[e.HUE = 13] = "HUE",
e[e.SATURATION = 14] = "SATURATION",
e[e.COLOR = 15] = "COLOR",
e[e.LUMINOSITY = 16] = "LUMINOSITY",
e[e.NORMAL_NPM = 17] = "NORMAL_NPM",
e[e.ADD_NPM = 18] = "ADD_NPM",
e[e.SCREEN_NPM = 19] = "SCREEN_NPM",
e[e.NONE = 20] = "NONE",
e[e.SRC_OVER = 0] = "SRC_OVER",
e[e.SRC_IN = 21] = "SRC_IN",
e[e.SRC_OUT = 22] = "SRC_OUT",
e[e.SRC_ATOP = 23] = "SRC_ATOP",
e[e.DST_OVER = 24] = "DST_OVER",
e[e.DST_IN = 25] = "DST_IN",
e[e.DST_OUT = 26] = "DST_OUT",
e[e.DST_ATOP = 27] = "DST_ATOP",
e[e.ERASE = 26] = "ERASE",
e[e.SUBTRACT = 28] = "SUBTRACT",
e[e.XOR = 29] = "XOR",
e))(BLEND_MODES || {})
, DRAW_MODES = (e => (e[e.POINTS = 0] = "POINTS",
e[e.LINES = 1] = "LINES",
e[e.LINE_LOOP = 2] = "LINE_LOOP",
e[e.LINE_STRIP = 3] = "LINE_STRIP",
e[e.TRIANGLES = 4] = "TRIANGLES",
e[e.TRIANGLE_STRIP = 5] = "TRIANGLE_STRIP",
e[e.TRIANGLE_FAN = 6] = "TRIANGLE_FAN",
e))(DRAW_MODES || {})
, FORMATS = (e => (e[e.RGBA = 6408] = "RGBA",
e[e.RGB = 6407] = "RGB",
e[e.RG = 33319] = "RG",
e[e.RED = 6403] = "RED",
e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER",
e[e.RGB_INTEGER = 36248] = "RGB_INTEGER",
e[e.RG_INTEGER = 33320] = "RG_INTEGER",
e[e.RED_INTEGER = 36244] = "RED_INTEGER",
e[e.ALPHA = 6406] = "ALPHA",
e[e.LUMINANCE = 6409] = "LUMINANCE",
e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA",
e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT",
e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL",
e))(FORMATS || {})
, TARGETS = (e => (e[e.TEXTURE_2D = 3553] = "TEXTURE_2D",
e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP",
e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY",
e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X",
e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X",
e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y",
e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y",
e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z",
e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z",
e))(TARGETS || {})
, TYPES = (e => (e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE",
e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT",
e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5",
e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4",
e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1",
e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT",
e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV",
e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV",
e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8",
e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV",
e[e.BYTE = 5120] = "BYTE",
e[e.SHORT = 5122] = "SHORT",
e[e.INT = 5124] = "INT",
e[e.FLOAT = 5126] = "FLOAT",
e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] =
"FLOAT_32_UNSIGNED_INT_24_8_REV",
e[e.HALF_FLOAT = 36193] = "HALF_FLOAT",
e))(TYPES || {})
, SAMPLER_TYPES = (e => (e[e.FLOAT = 0] = "FLOAT",
e[e.INT = 1] = "INT",
e[e.UINT = 2] = "UINT",
e))(SAMPLER_TYPES || {})
, SCALE_MODES = (e => (e[e.NEAREST = 0] = "NEAREST",
e[e.LINEAR = 1] = "LINEAR",
e))(SCALE_MODES || {})
, WRAP_MODES = (e => (e[e.CLAMP = 33071] = "CLAMP",
e[e.REPEAT = 10497] = "REPEAT",
e[e.MIRRORED_REPEAT = 33648] = "MIRRORED_REPEAT",
e))(WRAP_MODES || {})
, MIPMAP_MODES = (e => (e[e.OFF = 0] = "OFF",
e[e.POW2 = 1] = "POW2",
e[e.ON = 2] = "ON",
e[e.ON_MANUAL = 3] = "ON_MANUAL",
e))(MIPMAP_MODES || {})
, ALPHA_MODES = (e => (e[e.NPM = 0] = "NPM",
e[e.UNPACK = 1] = "UNPACK",
e[e.PMA = 2] = "PMA",
e[e.NO_PREMULTIPLIED_ALPHA = 0] = "NO_PREMULTIPLIED_ALPHA",
e[e.PREMULTIPLY_ON_UPLOAD = 1] = "PREMULTIPLY_ON_UPLOAD",
e[e.PREMULTIPLIED_ALPHA = 2] = "PREMULTIPLIED_ALPHA",
e))(ALPHA_MODES || {})
, CLEAR_MODES = (e => (e[e.NO = 0] = "NO",
e[e.YES = 1] = "YES",
e[e.AUTO = 2] = "AUTO",
e[e.BLEND = 0] = "BLEND",
e[e.CLEAR = 1] = "CLEAR",
e[e.BLIT = 2] = "BLIT",
e))(CLEAR_MODES || {})
, GC_MODES = (e => (e[e.AUTO = 0] = "AUTO",
e[e.MANUAL = 1] = "MANUAL",
e))(GC_MODES || {})
, PRECISION = (e => (e.LOW = "lowp",
e.MEDIUM = "mediump",
e.HIGH = "highp",
e))(PRECISION || {})
, MASK_TYPES = (e => (e[e.NONE = 0] = "NONE",
e[e.SCISSOR = 1] = "SCISSOR",
e[e.STENCIL = 2] = "STENCIL",
e[e.SPRITE = 3] = "SPRITE",
e[e.COLOR = 4] = "COLOR",
e))(MASK_TYPES || {})
, MSAA_QUALITY = (e => (e[e.NONE = 0] = "NONE",
e[e.LOW = 2] = "LOW",
e[e.MEDIUM = 4] = "MEDIUM",
e[e.HIGH = 8] = "HIGH",
e))(MSAA_QUALITY || {})
, BUFFER_TYPE = (e => (e[e.ELEMENT_ARRAY_BUFFER = 34963] =
"ELEMENT_ARRAY_BUFFER",
e[e.ARRAY_BUFFER = 34962] = "ARRAY_BUFFER",
e[e.UNIFORM_BUFFER = 35345] = "UNIFORM_BUFFER",
e))(BUFFER_TYPE || {});
const BrowserAdapter = {
createCanvas: (e, t) => {
const r = document.createElement("canvas");
return r.width = e,
r.height = t,
r
}
,
getCanvasRenderingContext2D: () => CanvasRenderingContext2D,
getWebGLRenderingContext: () => WebGLRenderingContext,
getNavigator: () => navigator,
getBaseUrl: () => document.baseURI ?? window.location.href,
getFontFaceSet: () => document.fonts,
fetch: (e, t) => fetch(e, t),
parseXML: e => (new DOMParser).parseFromString(e, "text/xml")
}
, settings = {
ADAPTER: BrowserAdapter,
RESOLUTION: 1,
CREATE_IMAGE_BITMAP: !1,
ROUND_PIXELS: !1
};
var appleIphone = /iPhone/i
, appleIpod = /iPod/i
, appleTablet = /iPad/i
, appleUniversal = /\biOS-universal(?:.+)Mac\b/i
, androidPhone = /\bAndroid(?:.+)Mobile\b/i
, androidTablet = /Android/i
, amazonPhone = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i
, amazonTablet = /Silk/i
, windowsPhone = /Windows Phone/i
, windowsTablet = /\bWindows(?:.+)ARM\b/i
, otherBlackBerry = /BlackBerry/i
, otherBlackBerry10 = /BB10/i
, otherOpera = /Opera Mini/i
, otherChrome = /\b(CriOS|Chrome)(?:.+)Mobile/i
, otherFirefox = /Mobile(?:.+)Firefox\b/i
, isAppleTabletOnIos13 = function(e) {
return void 0 !== e && "MacIntel" === e.platform && "number" == typeof
e.maxTouchPoints && e.maxTouchPoints > 1 && "undefined" == typeof MSStream
};
function createMatch(e) {
return function(t) {
return t.test(e)
}
}
function isMobile$1(e) {
var t = {
userAgent: "",
platform: "",
maxTouchPoints: 0
};
e || "undefined" == typeof navigator ? "string" == typeof e ?
t.userAgent = e : e && e.userAgent && (t = {
userAgent: e.userAgent,
platform: e.platform,
maxTouchPoints: e.maxTouchPoints || 0
}) : t = {
userAgent: navigator.userAgent,
platform: navigator.platform,
maxTouchPoints: navigator.maxTouchPoints || 0
};
var r = t.userAgent
, n = r.split("[FBAN");
void 0 !== n[1] && (r = n[0]),
void 0 !== (n = r.split("Twitter"))[1] && (r = n[0]);
var i = createMatch(r)
, o = {
apple: {
phone: i(appleIphone) && !i(windowsPhone),
ipod: i(appleIpod),
tablet: !i(appleIphone) && (i(appleTablet) ||
isAppleTabletOnIos13(t)) && !i(windowsPhone),
universal: i(appleUniversal),
device: (i(appleIphone) || i(appleIpod) || i(appleTablet) ||
i(appleUniversal) || isAppleTabletOnIos13(t)) && !i(windowsPhone)
},
amazon: {
phone: i(amazonPhone),
tablet: !i(amazonPhone) && i(amazonTablet),
device: i(amazonPhone) || i(amazonTablet)
},
android: {
phone: !i(windowsPhone) && i(amazonPhone) || !i(windowsPhone)
&& i(androidPhone),
tablet: !i(windowsPhone) && !i(amazonPhone) && !i(androidPhone)
&& (i(amazonTablet) || i(androidTablet)),
device: !i(windowsPhone) && (i(amazonPhone) || i(amazonTablet)
|| i(androidPhone) || i(androidTablet)) || i(/\bokhttp\b/i)
},
windows: {
phone: i(windowsPhone),
tablet: i(windowsTablet),
device: i(windowsPhone) || i(windowsTablet)
},
other: {
blackberry: i(otherBlackBerry),
blackberry10: i(otherBlackBerry10),
opera: i(otherOpera),
firefox: i(otherFirefox),
chrome: i(otherChrome),
device: i(otherBlackBerry) || i(otherBlackBerry10) ||
i(otherOpera) || i(otherFirefox) || i(otherChrome)
},
any: !1,
phone: !1,
tablet: !1
};
return o.any = o.apple.device || o.android.device || o.windows.device
|| o.other.device,
o.phone = o.apple.phone || o.android.phone || o.windows.phone,
o.tablet = o.apple.tablet || o.android.tablet || o.windows.tablet,
o
}
const isMobileCall = isMobile$1.default ?? isMobile$1
, isMobile = isMobileCall(globalThis.navigator);
settings.RETINA_PREFIX = /@([0-9\.]+)x/,
settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = !1;
var eventemitter3 = {
exports: {}
};
!function(e) {
var t = Object.prototype.hasOwnProperty
, r = "~";
function n() {}
function i(e, t, r) {
this.fn = e,
this.context = t,
this.once = r || !1
}
function o(e, t, n, o, s) {
if ("function" != typeof n)
throw new TypeError("The listener must be a function");
var a = new i(n,o || e,s)
, l = r ? r + t : t;
return e._events[l] ? e._events[l].fn ? e._events[l] =
[e._events[l], a] : e._events[l].push(a) : (e._events[l] = a,
e._eventsCount++),
e
}
function s(e, t) {
0 == --e._eventsCount ? e._events = new n : delete e._events[t]
}
function a() {
this._events = new n,
this._eventsCount = 0
}
Object.create && (n.prototype = Object.create(null),
(new n).__proto__ || (r = !1)),
a.prototype.eventNames = function() {
var e, n, i = [];
if (0 === this._eventsCount)
return i;
for (n in e = this._events)
t.call(e, n) && i.push(r ? n.slice(1) : n);
return Object.getOwnPropertySymbols ?
i.concat(Object.getOwnPropertySymbols(e)) : i
}
,
a.prototype.listeners = function(e) {
var t = r ? r + e : e
, n = this._events[t];
if (!n)
return [];
if (n.fn)
return [n.fn];
for (var i = 0, o = n.length, s = new Array(o); i < o; i++)
s[i] = n[i].fn;
return s
}
,
a.prototype.listenerCount = function(e) {
var t = r ? r + e : e
, n = this._events[t];
return n ? n.fn ? 1 : n.length : 0
}
,
a.prototype.emit = function(e, t, n, i, o, s) {
var a = r ? r + e : e;
if (!this._events[a])
return !1;
var l, c, u = this._events[a], d = arguments.length;
if (u.fn) {
switch (u.once && this.removeListener(e, u.fn, void 0, !0),
d) {
case 1:
return u.fn.call(u.context),
!0;
case 2:
return u.fn.call(u.context, t),
!0;
case 3:
return u.fn.call(u.context, t, n),
!0;
case 4:
return u.fn.call(u.context, t, n, i),
!0;
case 5:
return u.fn.call(u.context, t, n, i, o),
!0;
case 6:
return u.fn.call(u.context, t, n, i, o, s),
!0
}
for (c = 1,
l = new Array(d - 1); c < d; c++)
l[c - 1] = arguments[c];
u.fn.apply(u.context, l)
} else {
var p, h = u.length;
for (c = 0; c < h; c++)
switch (u[c].once && this.removeListener(e, u[c].fn, void
0, !0),
d) {
case 1:
u[c].fn.call(u[c].context);
break;
case 2:
u[c].fn.call(u[c].context, t);
break;
case 3:
u[c].fn.call(u[c].context, t, n);
break;
case 4:
u[c].fn.call(u[c].context, t, n, i);
break;
default:
if (!l)
for (p = 1,
l = new Array(d - 1); p < d; p++)
l[p - 1] = arguments[p];
u[c].fn.apply(u[c].context, l)
}
}
return !0
}
,
a.prototype.on = function(e, t, r) {
return o(this, e, t, r, !1)
}
,
a.prototype.once = function(e, t, r) {
return o(this, e, t, r, !0)
}
,
a.prototype.removeListener = function(e, t, n, i) {
var o = r ? r + e : e;
if (!this._events[o])
return this;
if (!t)
return s(this, o),
this;
var a = this._events[o];
if (a.fn)
a.fn !== t || i && !a.once || n && a.context !== n || s(this,
o);
else {
for (var l = 0, c = [], u = a.length; l < u; l++)
(a[l].fn !== t || i && !a[l].once || n && a[l].context !==
n) && c.push(a[l]);
c.length ? this._events[o] = 1 === c.length ? c[0] : c :
s(this, o)
}
return this
}
,
a.prototype.removeAllListeners = function(e) {
var t;
return e ? (t = r ? r + e : e,
this._events[t] && s(this, t)) : (this._events = new n,
this._eventsCount = 0),
this
}
,
a.prototype.off = a.prototype.removeListener,
a.prototype.addListener = a.prototype.on,
a.prefixed = r,
a.EventEmitter = a,
e.exports = a
}(eventemitter3);
var eventemitter3Exports = eventemitter3.exports;
const EventEmitter$2 = getDefaultExportFromCjs(eventemitter3Exports);
var earcut$2 = {
exports: {}
};
function earcut(e, t, r) {
r = r || 2;
var n, i, o, s, a, l, c, u = t && t.length, d = u ? t[0] * r :
e.length, p = linkedList(e, 0, d, r, !0), h = [];
if (!p || p.next === p.prev)
return h;
if (u && (p = eliminateHoles(e, t, p, r)),
e.length > 80 * r) {
n = o = e[0],
i = s = e[1];
for (var f = r; f < d; f += r)
(a = e[f]) < n && (n = a),
(l = e[f + 1]) < i && (i = l),
a > o && (o = a),
l > s && (s = l);
c = 0 !== (c = Math.max(o - n, s - i)) ? 32767 / c : 0
}
return earcutLinked(p, h, r, n, i, c, 0),
h
}
function linkedList(e, t, r, n, i) {
var o, s;
if (i === signedArea(e, t, r, n) > 0)
for (o = t; o < r; o += n)
s = insertNode(o, e[o], e[o + 1], s);
else
for (o = r - n; o >= t; o -= n)
s = insertNode(o, e[o], e[o + 1], s);
return s && equals$1(s, s.next) && (removeNode(s),
s = s.next),
s
}
function filterPoints(e, t) {
if (!e)
return e;
t || (t = e);
var r, n = e;
do {
if (r = !1,
n.steiner || !equals$1(n, n.next) && 0 !== area(n.prev, n, n.next))
n = n.next;
else {
if (removeNode(n),
(n = t = n.prev) === n.next)
break;
r = !0
}
} while (r || n !== t);
return t
}
function earcutLinked(e, t, r, n, i, o, s) {
if (e) {
!s && o && indexCurve(e, n, i, o);
for (var a, l, c = e; e.prev !== e.next; )
if (a = e.prev,
l = e.next,
o ? isEarHashed(e, n, i, o) : isEar(e))
t.push(a.i / r | 0),
t.push(e.i / r | 0),
t.push(l.i / r | 0),
removeNode(e),
e = l.next,
c = l.next;
else if ((e = l) === c) {
s ? 1 === s ? earcutLinked(e =
cureLocalIntersections(filterPoints(e), t, r), t, r, n, i, o, 2) : 2 === s &&
splitEarcut(e, t, r, n, i, o) : earcutLinked(filterPoints(e), t, r, n, i, o, 1);
break
}
}
}
function isEar(e) {
var t = e.prev
, r = e
, n = e.next;
if (area(t, r, n) >= 0)
return !1;
for (var i = t.x, o = r.x, s = n.x, a = t.y, l = r.y, c = n.y, u = i <
o ? i < s ? i : s : o < s ? o : s, d = a < l ? a < c ? a : c : l < c ? l : c, p = i
> o ? i > s ? i : s : o > s ? o : s, h = a > l ? a > c ? a : c : l > c ? l : c, f =
n.next; f !== t; ) {
if (f.x >= u && f.x <= p && f.y >= d && f.y <= h &&
pointInTriangle(i, a, o, l, s, c, f.x, f.y) && area(f.prev, f, f.next) >= 0)
return !1;
f = f.next
}
return !0
}
function isEarHashed(e, t, r, n) {
var i = e.prev
, o = e
, s = e.next;
if (area(i, o, s) >= 0)
return !1;
for (var a = i.x, l = o.x, c = s.x, u = i.y, d = o.y, p = s.y, h = a <
l ? a < c ? a : c : l < c ? l : c, f = u < d ? u < p ? u : p : d < p ? d : p, m = a
> l ? a > c ? a : c : l > c ? l : c, g = u > d ? u > p ? u : p : d > p ? d : p, y =
zOrder(h, f, t, r, n), v = zOrder(m, g, t, r, n), b = e.prevZ, x = e.nextZ; b &&
b.z >= y && x && x.z <= v; ) {
if (b.x >= h && b.x <= m && b.y >= f && b.y <= g && b !== i && b !
== s && pointInTriangle(a, u, l, d, c, p, b.x, b.y) && area(b.prev, b, b.next) >=
0)
return !1;
if (b = b.prevZ,
x.x >= h && x.x <= m && x.y >= f && x.y <= g && x !== i && x !== s
&& pointInTriangle(a, u, l, d, c, p, x.x, x.y) && area(x.prev, x, x.next) >= 0)
return !1;
x = x.nextZ
}
for (; b && b.z >= y; ) {
if (b.x >= h && b.x <= m && b.y >= f && b.y <= g && b !== i && b !
== s && pointInTriangle(a, u, l, d, c, p, b.x, b.y) && area(b.prev, b, b.next) >=
0)
return !1;
b = b.prevZ
}
for (; x && x.z <= v; ) {
if (x.x >= h && x.x <= m && x.y >= f && x.y <= g && x !== i && x !
== s && pointInTriangle(a, u, l, d, c, p, x.x, x.y) && area(x.prev, x, x.next) >=
0)
return !1;
x = x.nextZ
}
return !0
}
function cureLocalIntersections(e, t, r) {
var n = e;
do {
var i = n.prev
, o = n.next.next;
!equals$1(i, o) && intersects(i, n, n.next, o) && locallyInside(i,
o) && locallyInside(o, i) && (t.push(i.i / r | 0),
t.push(n.i / r | 0),
t.push(o.i / r | 0),
removeNode(n),
removeNode(n.next),
n = e = o),
n = n.next
} while (n !== e);
return filterPoints(n)
}
function splitEarcut(e, t, r, n, i, o) {
var s = e;
do {
for (var a = s.next.next; a !== s.prev; ) {
if (s.i !== a.i && isValidDiagonal(s, a)) {
var l = splitPolygon(s, a);
return s = filterPoints(s, s.next),
l = filterPoints(l, l.next),
earcutLinked(s, t, r, n, i, o, 0),
void earcutLinked(l, t, r, n, i, o, 0)
}
a = a.next
}
s = s.next
} while (s !== e)
}
function eliminateHoles(e, t, r, n) {
var i, o, s, a = [];
for (i = 0,
o = t.length; i < o; i++)
(s = linkedList(e, t[i] * n, i < o - 1 ? t[i + 1] * n : e.length,
n, !1)) === s.next && (s.steiner = !0),
a.push(getLeftmost(s));
for (a.sort(compareX),
i = 0; i < a.length; i++)
r = eliminateHole(a[i], r);
return r
}
function compareX(e, t) {
return e.x - t.x
}
function eliminateHole(e, t) {
var r = findHoleBridge(e, t);
if (!r)
return t;
var n = splitPolygon(r, e);
return filterPoints(n, n.next),
filterPoints(r, r.next)
}
function findHoleBridge(e, t) {
var r, n = t, i = e.x, o = e.y, s = -1 / 0;
do {
if (o <= n.y && o >= n.next.y && n.next.y !== n.y) {
var a = n.x + (o - n.y) * (n.next.x - n.x) / (n.next.y - n.y);
if (a <= i && a > s && (s = a,
r = n.x < n.next.x ? n : n.next,
a === i))
return r
}
n = n.next
} while (n !== t);
if (!r)
return null;
var l, c = r, u = r.x, d = r.y, p = 1 / 0;
n = r;
do {
i >= n.x && n.x >= u && i !== n.x && pointInTriangle(o < d ? i : s,
o, u, d, o < d ? s : i, o, n.x, n.y) && (l = Math.abs(o - n.y) / (i - n.x),
locallyInside(n, e) && (l < p || l === p && (n.x > r.x || n.x ===
r.x && sectorContainsSector(r, n))) && (r = n,
p = l)),
n = n.next
} while (n !== c);
return r
}
function sectorContainsSector(e, t) {
return area(e.prev, e, t.prev) < 0 && area(t.next, e, e.next) < 0
}
function indexCurve(e, t, r, n) {
var i = e;
do {
0 === i.z && (i.z = zOrder(i.x, i.y, t, r, n)),
i.prevZ = i.prev,
i.nextZ = i.next,
i = i.next
} while (i !== e);
i.prevZ.nextZ = null,
i.prevZ = null,
sortLinked(i)
}
function sortLinked(e) {
var t, r, n, i, o, s, a, l, c = 1;
do {
for (r = e,
e = null,
o = null,
s = 0; r; ) {
for (s++,
n = r,
a = 0,
t = 0; t < c && (a++,
n = n.nextZ); t++)
;
for (l = c; a > 0 || l > 0 && n; )
0 !== a && (0 === l || !n || r.z <= n.z) ? (i = r,
r = r.nextZ,
a--) : (i = n,
n = n.nextZ,
l--),
o ? o.nextZ = i : e = i,
i.prevZ = o,
o = i;
r = n
}
o.nextZ = null,
c *= 2
} while (s > 1);
return e
}
function zOrder(e, t, r, n, i) {
return (e = 1431655765 & ((e = 858993459 & ((e = 252645135 & ((e =
16711935 & ((e = (e - r) * i | 0) | e << 8)) | e << 4)) | e << 2)) | e << 1)) | (t
= 1431655765 & ((t = 858993459 & ((t = 252645135 & ((t = 16711935 & ((t = (t - n) *
i | 0) | t << 8)) | t << 4)) | t << 2)) | t << 1)) << 1
}
function getLeftmost(e) {
var t = e
, r = e;
do {
(t.x < r.x || t.x === r.x && t.y < r.y) && (r = t),
t = t.next
} while (t !== e);
return r
}
function pointInTriangle(e, t, r, n, i, o, s, a) {
return (i - s) * (t - a) >= (e - s) * (o - a) && (e - s) * (n - a) >=
(r - s) * (t - a) && (r - s) * (o - a) >= (i - s) * (n - a)
}
function isValidDiagonal(e, t) {
return e.next.i !== t.i && e.prev.i !== t.i && !intersectsPolygon(e, t)
&& (locallyInside(e, t) && locallyInside(t, e) && middleInside(e, t) &&
(area(e.prev, e, t.prev) || area(e, t.prev, t)) || equals$1(e, t) && area(e.prev,
e, e.next) > 0 && area(t.prev, t, t.next) > 0)
}
function area(e, t, r) {
return (t.y - e.y) * (r.x - t.x) - (t.x - e.x) * (r.y - t.y)
}
function equals$1(e, t) {
return e.x === t.x && e.y === t.y
}
function intersects(e, t, r, n) {
var i = sign$2(area(e, t, r))
, o = sign$2(area(e, t, n))
, s = sign$2(area(r, n, e))
, a = sign$2(area(r, n, t));
return i !== o && s !== a || (!(0 !== i || !onSegment(e, r, t)) || (!(0
!== o || !onSegment(e, n, t)) || (!(0 !== s || !onSegment(r, e, n)) || !(0 !== a ||
!onSegment(r, t, n)))))
}
function onSegment(e, t, r) {
return t.x <= Math.max(e.x, r.x) && t.x >= Math.min(e.x, r.x) && t.y <=
Math.max(e.y, r.y) && t.y >= Math.min(e.y, r.y)
}
function sign$2(e) {
return e > 0 ? 1 : e < 0 ? -1 : 0
}
function intersectsPolygon(e, t) {
var r = e;
do {
if (r.i !== e.i && r.next.i !== e.i && r.i !== t.i && r.next.i !==
t.i && intersects(r, r.next, e, t))
return !0;
r = r.next
} while (r !== e);
return !1
}
function locallyInside(e, t) {
return area(e.prev, e, e.next) < 0 ? area(e, t, e.next) >= 0 && area(e,
e.prev, t) >= 0 : area(e, t, e.prev) < 0 || area(e, e.next, t) < 0
}
function middleInside(e, t) {
var r = e
, n = !1
, i = (e.x + t.x) / 2
, o = (e.y + t.y) / 2;
do {
r.y > o != r.next.y > o && r.next.y !== r.y && i < (r.next.x - r.x)
* (o - r.y) / (r.next.y - r.y) + r.x && (n = !n),
r = r.next
} while (r !== e);
return n
}
function splitPolygon(e, t) {
var r = new Node(e.i,e.x,e.y)
, n = new Node(t.i,t.x,t.y)
, i = e.next
, o = t.prev;
return e.next = t,
t.prev = e,
r.next = i,
i.prev = r,
n.next = r,
r.prev = n,
o.next = n,
n.prev = o,
n
}
function insertNode(e, t, r, n) {
var i = new Node(e,t,r);
return n ? (i.next = n.next,
i.prev = n,
n.next.prev = i,
n.next = i) : (i.prev = i,
i.next = i),
i
}
function removeNode(e) {
e.next.prev = e.prev,
e.prev.next = e.next,
e.prevZ && (e.prevZ.nextZ = e.nextZ),
e.nextZ && (e.nextZ.prevZ = e.prevZ)
}
function Node(e, t, r) {
this.i = e,
this.x = t,
this.y = r,
this.prev = null,
this.next = null,
this.z = 0,
this.prevZ = null,
this.nextZ = null,
this.steiner = !1
}
function signedArea(e, t, r, n) {
for (var i = 0, o = t, s = r - n; o < r; o += n)
i += (e[s] - e[o]) * (e[o + 1] + e[s + 1]),
s = o;
return i
}
earcut$2.exports = earcut,
earcut$2.exports.default = earcut,
earcut.deviation = function(e, t, r, n) {
var i = t && t.length
, o = i ? t[0] * r : e.length
, s = Math.abs(signedArea(e, 0, o, r));
if (i)
for (var a = 0, l = t.length; a < l; a++) {
var c = t[a] * r
, u = a < l - 1 ? t[a + 1] * r : e.length;
s -= Math.abs(signedArea(e, c, u, r))
}
var d = 0;
for (a = 0; a < n.length; a += 3) {
var p = n[a] * r
, h = n[a + 1] * r
, f = n[a + 2] * r;
d += Math.abs((e[p] - e[f]) * (e[h + 1] - e[p + 1]) - (e[p] - e[h])
* (e[f + 1] - e[p + 1]))
}
return 0 === s && 0 === d ? 0 : Math.abs((d - s) / s)
}
,
earcut.flatten = function(e) {
for (var t = e[0][0].length, r = {
vertices: [],
holes: [],
dimensions: t
}, n = 0, i = 0; i < e.length; i++) {
for (var o = 0; o < e[i].length; o++)
for (var s = 0; s < t; s++)
r.vertices.push(e[i][o][s]);
i > 0 && (n += e[i - 1].length,
r.holes.push(n))
}
return r
}
;
var earcutExports = earcut$2.exports;
const earcut$1 = getDefaultExportFromCjs(earcutExports);
var punycode$1 = {
exports: {}
};
/*! https://mths.be/punycode v1.4.1 by @mathias */
punycode$1.exports,
function(e, t) {
!function(r) {
var n = t && !t.nodeType && t
, i = e && !e.nodeType && e
, o = "object" == typeof commonjsGlobal$1 && commonjsGlobal$1;
o.global !== o && o.window !== o && o.self !== o || (r = o);
var s, a, l = 2147483647, c = 36, u = 1, d = 26, p = 38, h = 700, f
= 72, m = 128, g = "-", y = /^xn--/, v = /[^\x20-\x7E]/, b = /[\x2E\u3002\uFF0E\
uFF61]/g, x = {
overflow: "Overflow: input needs wider integers to process",
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
"invalid-input": "Invalid input"
}, _ = c - u, E = Math.floor, T = String.fromCharCode;
function C(e) {
throw new RangeError(x[e])
}
function S(e, t) {
for (var r = e.length, n = []; r--; )
n[r] = t(e[r]);
return n
}
function $(e, t) {
var r = e.split("@")
, n = "";
return r.length > 1 && (n = r[0] + "@",
e = r[1]),
n + S((e = e.replace(b, ".")).split("."), t).join(".")
}
function w(e) {
for (var t, r, n = [], i = 0, o = e.length; i < o; )
(t = e.charCodeAt(i++)) >= 55296 && t <= 56319 && i < o ?
56320 == (64512 & (r = e.charCodeAt(i++))) ? n.push(((1023 & t) << 10) + (1023 & r)
+ 65536) : (n.push(t),
i--) : n.push(t);
return n
}
function P(e) {
return S(e, (function(e) {
var t = "";
return e > 65535 && (t += T((e -= 65536) >>> 10 & 1023 |
55296),
e = 56320 | 1023 & e),
t += T(e)
}
)).join("")
}
function R(e, t) {
return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
}
function k(e, t, r) {
var n = 0;
for (e = r ? E(e / h) : e >> 1,
e += E(e / t); e > _ * d >> 1; n += c)
e = E(e / _);
return E(n + (_ + 1) * e / (e + p))
}
function A(e) {
var t, r, n, i, o, s, a, p, h, y, v, b = [], x = e.length, _ =
0, T = m, S = f;
for ((r = e.lastIndexOf(g)) < 0 && (r = 0),
n = 0; n < r; ++n)
e.charCodeAt(n) >= 128 && C("not-basic"),
b.push(e.charCodeAt(n));
for (i = r > 0 ? r + 1 : 0; i < x; ) {
for (o = _,
s = 1,
a = c; i >= x && C("invalid-input"),
((p = (v = e.charCodeAt(i++)) - 48 < 10 ? v - 22 : v - 65 <
26 ? v - 65 : v - 97 < 26 ? v - 97 : c) >= c || p > E((l - _) / s)) &&
C("overflow"),
_ += p * s,
!(p < (h = a <= S ? u : a >= S + d ? d : a - S)); a += c)
s > E(l / (y = c - h)) && C("overflow"),
s *= y;
S = k(_ - o, t = b.length + 1, 0 == o),
E(_ / t) > l - T && C("overflow"),
T += E(_ / t),
_ %= t,
b.splice(_++, 0, T)
}
return P(b)
}
function I(e) {
var t, r, n, i, o, s, a, p, h, y, v, b, x, _, S, $ = [];
for (b = (e = w(e)).length,
t = m,
r = 0,
o = f,
s = 0; s < b; ++s)
(v = e[s]) < 128 && $.push(T(v));
for (n = i = $.length,
i && $.push(g); n < b; ) {
for (a = l,
s = 0; s < b; ++s)
(v = e[s]) >= t && v < a && (a = v);
for (a - t > E((l - r) / (x = n + 1)) && C("overflow"),
r += (a - t) * x,
t = a,
s = 0; s < b; ++s)
if ((v = e[s]) < t && ++r > l && C("overflow"),
v == t) {
for (p = r,
h = c; !(p < (y = h <= o ? u : h >= o + d ? d : h -
o)); h += c)
S = p - y,
_ = c - y,
$.push(T(R(y + S % _, 0))),
p = E(S / _);
$.push(T(R(p, 0))),
o = k(r, x, n == i),
r = 0,
++n
}
++r,
++t
}
return $.join("")
}
if (s = {
version: "1.4.1",
ucs2: {
decode: w,
encode: P
},
decode: A,
encode: I,
toASCII: function(e) {
return $(e, (function(e) {
return v.test(e) ? "xn--" + I(e) : e
}
))
},
toUnicode: function(e) {
return $(e, (function(e) {
return y.test(e) ? A(e.slice(4).toLowerCase()) : e
}
))
}
},
n && i)
if (e.exports == n)
i.exports = s;
else
for (a in s)
s.hasOwnProperty(a) && (n[a] = s[a]);
else
r.punycode = s
}(commonjsGlobal$1)
}(punycode$1, punycode$1.exports);
var punycodeExports = punycode$1.exports, esErrors = Error, _eval =
EvalError, range$1 = RangeError, ref$1 = ReferenceError, syntax = SyntaxError,
type$2 = TypeError, uri = URIError, shams = function() {
if ("function" != typeof Symbol || "function" != typeof
Object.getOwnPropertySymbols)
return !1;
if ("symbol" == typeof Symbol.iterator)
return !0;
var e = {}
, t = Symbol("test")
, r = Object(t);
if ("string" == typeof t)
return !1;
if ("[object Symbol]" !== Object.prototype.toString.call(t))
return !1;
if ("[object Symbol]" !== Object.prototype.toString.call(r))
return !1;
for (t in e[t] = 42,
e)
return !1;
if ("function" == typeof Object.keys && 0 !== Object.keys(e).length)
return !1;
if ("function" == typeof Object.getOwnPropertyNames && 0 !==
Object.getOwnPropertyNames(e).length)
return !1;
var n = Object.getOwnPropertySymbols(e);
if (1 !== n.length || n[0] !== t)
return !1;
if (!Object.prototype.propertyIsEnumerable.call(e, t))
return !1;
if ("function" == typeof Object.getOwnPropertyDescriptor) {
var i = Object.getOwnPropertyDescriptor(e, t);
if (42 !== i.value || !0 !== i.enumerable)
return !1
}
return !0
}, origSymbol = "undefined" != typeof Symbol && Symbol, hasSymbolSham =
shams, hasSymbols$1 = function() {
return "function" == typeof origSymbol && ("function" == typeof Symbol
&& ("symbol" == typeof origSymbol("foo") && ("symbol" == typeof Symbol("bar") &&
hasSymbolSham())))
}, test = {
__proto__: null,
foo: {}
}, $Object = Object, hasProto$1 = function() {
return {
__proto__: test
}.foo === test.foo && !(test instanceof $Object)
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ",
toStr$1 = Object.prototype.toString, max$2 = Math.max, funcType = "[object
Function]", concatty = function(e, t) {
for (var r = [], n = 0; n < e.length; n += 1)
r[n] = e[n];
for (var i = 0; i < t.length; i += 1)
r[i + e.length] = t[i];
return r
}, slicy = function(e, t) {
for (var r = [], n = t || 0, i = 0; n < e.length; n += 1,
i += 1)
r[i] = e[n];
return r
}, joiny = function(e, t) {
for (var r = "", n = 0; n < e.length; n += 1)
r += e[n],
n + 1 < e.length && (r += t);
return r
}, implementation$1 = function(e) {
var t = this;
if ("function" != typeof t || toStr$1.apply(t) !== funcType)
throw new TypeError(ERROR_MESSAGE + t);
for (var r, n = slicy(arguments, 1), i = max$2(0, t.length - n.length),
o = [], s = 0; s < i; s++)
o[s] = "$" + s;
if (r = Function("binder", "return function (" + joiny(o, ",") + ")
{ return binder.apply(this,arguments); }")((function() {
if (this instanceof r) {
var i = t.apply(this, concatty(n, arguments));
return Object(i) === i ? i : this
}
return t.apply(e, concatty(n, arguments))
}
)),
t.prototype) {
var a = function() {};
a.prototype = t.prototype,
r.prototype = new a,
a.prototype = null
}
return r
}, implementation = implementation$1, functionBind =
Function.prototype.bind || implementation, call = Function.prototype.call, $hasOwn
= Object.prototype.hasOwnProperty, bind$1 = functionBind, hasown =
bind$1.call(call, $hasOwn), undefined$1, $Error = esErrors, $EvalError = _eval,
$RangeError = range$1, $ReferenceError = ref$1, $SyntaxError$1 = syntax,
$TypeError$3 = type$2, $URIError = uri, $Function = Function, getEvalledConstructor
= function(e) {
try {
return $Function('"use strict"; return (' + e + ").constructor;")()
} catch (e2) {}
}, $gOPD$1 = Object.getOwnPropertyDescriptor;
if ($gOPD$1)
try {
$gOPD$1({}, "")
} catch (e2) {
$gOPD$1 = null
}
var throwTypeError = function() {
throw new $TypeError$3
}
, ThrowTypeError = $gOPD$1 ? function() {
try {
return throwTypeError
} catch (e) {
try {
return $gOPD$1(arguments, "callee").get
} catch (t) {
return throwTypeError
}
}
}() : throwTypeError
, hasSymbols = hasSymbols$1()
, hasProto = hasProto$1()
, getProto = Object.getPrototypeOf || (hasProto ? function(e) {
return e.__proto__
}
: null)
, needsEval = {}
, TypedArray = "undefined" != typeof Uint8Array && getProto ?
getProto(Uint8Array) : undefined$1
, INTRINSICS = {
__proto__: null,
"%AggregateError%": "undefined" == typeof AggregateError ?
undefined$1 : AggregateError,
"%Array%": Array,
"%ArrayBuffer%": "undefined" == typeof ArrayBuffer ? undefined$1 :
ArrayBuffer,
"%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([]
[Symbol.iterator]()) : undefined$1,
"%AsyncFromSyncIteratorPrototype%": undefined$1,
"%AsyncFunction%": needsEval,
"%AsyncGenerator%": needsEval,
"%AsyncGeneratorFunction%": needsEval,
"%AsyncIteratorPrototype%": needsEval,
"%Atomics%": "undefined" == typeof Atomics ? undefined$1 : Atomics,
"%BigInt%": "undefined" == typeof BigInt ? undefined$1 : BigInt,
"%BigInt64Array%": "undefined" == typeof BigInt64Array ? undefined$1 :
BigInt64Array,
"%BigUint64Array%": "undefined" == typeof BigUint64Array ?
undefined$1 : BigUint64Array,
"%Boolean%": Boolean,
"%DataView%": "undefined" == typeof DataView ? undefined$1 : DataView,
"%Date%": Date,
"%decodeURI%": decodeURI,
"%decodeURIComponent%": decodeURIComponent,
"%encodeURI%": encodeURI,
"%encodeURIComponent%": encodeURIComponent,
"%Error%": $Error,
"%eval%": eval,
"%EvalError%": $EvalError,
"%Float32Array%": "undefined" == typeof Float32Array ? undefined$1 :
Float32Array,
"%Float64Array%": "undefined" == typeof Float64Array ? undefined$1 :
Float64Array,
"%FinalizationRegistry%": "undefined" == typeof FinalizationRegistry ?
undefined$1 : FinalizationRegistry,
"%Function%": $Function,
"%GeneratorFunction%": needsEval,
"%Int8Array%": "undefined" == typeof Int8Array ? undefined$1 :
Int8Array,
"%Int16Array%": "undefined" == typeof Int16Array ? undefined$1 :
Int16Array,
"%Int32Array%": "undefined" == typeof Int32Array ? undefined$1 :
Int32Array,
"%isFinite%": isFinite,
"%isNaN%": isNaN,
"%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([]
[Symbol.iterator]())) : undefined$1,
"%JSON%": "object" == typeof JSON ? JSON : undefined$1,
"%Map%": "undefined" == typeof Map ? undefined$1 : Map,
"%MapIteratorPrototype%": "undefined" != typeof Map && hasSymbols &&
getProto ? getProto((new Map)[Symbol.iterator]()) : undefined$1,
"%Math%": Math,
"%Number%": Number,
"%Object%": Object,
"%parseFloat%": parseFloat,
"%parseInt%": parseInt,
"%Promise%": "undefined" == typeof Promise ? undefined$1 : Promise,
"%Proxy%": "undefined" == typeof Proxy ? undefined$1 : Proxy,
"%RangeError%": $RangeError,
"%ReferenceError%": $ReferenceError,
"%Reflect%": "undefined" == typeof Reflect ? undefined$1 : Reflect,
"%RegExp%": RegExp,
"%Set%": "undefined" == typeof Set ? undefined$1 : Set,
"%SetIteratorPrototype%": "undefined" != typeof Set && hasSymbols &&
getProto ? getProto((new Set)[Symbol.iterator]()) : undefined$1,
"%SharedArrayBuffer%": "undefined" == typeof SharedArrayBuffer ?
undefined$1 : SharedArrayBuffer,
"%String%": String,
"%StringIteratorPrototype%": hasSymbols && getProto ?
getProto(""[Symbol.iterator]()) : undefined$1,
"%Symbol%": hasSymbols ? Symbol : undefined$1,
"%SyntaxError%": $SyntaxError$1,
"%ThrowTypeError%": ThrowTypeError,
"%TypedArray%": TypedArray,
"%TypeError%": $TypeError$3,
"%Uint8Array%": "undefined" == typeof Uint8Array ? undefined$1 :
Uint8Array,
"%Uint8ClampedArray%": "undefined" == typeof Uint8ClampedArray ?
undefined$1 : Uint8ClampedArray,
"%Uint16Array%": "undefined" == typeof Uint16Array ? undefined$1 :
Uint16Array,
"%Uint32Array%": "undefined" == typeof Uint32Array ? undefined$1 :
Uint32Array,
"%URIError%": $URIError,
"%WeakMap%": "undefined" == typeof WeakMap ? undefined$1 : WeakMap,
"%WeakRef%": "undefined" == typeof WeakRef ? undefined$1 : WeakRef,
"%WeakSet%": "undefined" == typeof WeakSet ? undefined$1 : WeakSet
};
if (getProto)
try {
null.error
} catch (e2) {
var errorProto = getProto(getProto(e2));
INTRINSICS["%Error.prototype%"] = errorProto
}
var doEval = function e(t) {
var r;
if ("%AsyncFunction%" === t)
r = getEvalledConstructor("async function () {}");
else if ("%GeneratorFunction%" === t)
r = getEvalledConstructor("function* () {}");
else if ("%AsyncGeneratorFunction%" === t)
r = getEvalledConstructor("async function* () {}");
else if ("%AsyncGenerator%" === t) {
var n = e("%AsyncGeneratorFunction%");
n && (r = n.prototype)
} else if ("%AsyncIteratorPrototype%" === t) {
var i = e("%AsyncGenerator%");
i && getProto && (r = getProto(i.prototype))
}
return INTRINSICS[t] = r,
r
}, LEGACY_ALIASES = {
__proto__: null,
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
"%ArrayPrototype%": ["Array", "prototype"],
"%ArrayProto_entries%": ["Array", "prototype", "entries"],
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
"%ArrayProto_keys%": ["Array", "prototype", "keys"],
"%ArrayProto_values%": ["Array", "prototype", "values"],
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype",
"prototype"],
"%BooleanPrototype%": ["Boolean", "prototype"],
"%DataViewPrototype%": ["DataView", "prototype"],
"%DatePrototype%": ["Date", "prototype"],
"%ErrorPrototype%": ["Error", "prototype"],
"%EvalErrorPrototype%": ["EvalError", "prototype"],
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
"%FunctionPrototype%": ["Function", "prototype"],
"%Generator%": ["GeneratorFunction", "prototype"],
"%GeneratorPrototype%": ["GeneratorFunction", "prototype",
"prototype"],
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
"%JSONParse%": ["JSON", "parse"],
"%JSONStringify%": ["JSON", "stringify"],
"%MapPrototype%": ["Map", "prototype"],
"%NumberPrototype%": ["Number", "prototype"],
"%ObjectPrototype%": ["Object", "prototype"],
"%ObjProto_toString%": ["Object", "prototype", "toString"],
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
"%PromisePrototype%": ["Promise", "prototype"],
"%PromiseProto_then%": ["Promise", "prototype", "then"],
"%Promise_all%": ["Promise", "all"],
"%Promise_reject%": ["Promise", "reject"],
"%Promise_resolve%": ["Promise", "resolve"],
"%RangeErrorPrototype%": ["RangeError", "prototype"],
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
"%RegExpPrototype%": ["RegExp", "prototype"],
"%SetPrototype%": ["Set", "prototype"],
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
"%StringPrototype%": ["String", "prototype"],
"%SymbolPrototype%": ["Symbol", "prototype"],
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
"%TypeErrorPrototype%": ["TypeError", "prototype"],
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
"%URIErrorPrototype%": ["URIError", "prototype"],
"%WeakMapPrototype%": ["WeakMap", "prototype"],
"%WeakSetPrototype%": ["WeakSet", "prototype"]
}, bind = functionBind, hasOwn$1 = hasown, $concat$1 =
bind.call(Function.call, Array.prototype.concat), $spliceApply =
bind.call(Function.apply, Array.prototype.splice), $replace$1 =
bind.call(Function.call, String.prototype.replace), $strSlice =
bind.call(Function.call, String.prototype.slice), $exec = bind.call(Function.call,
RegExp.prototype.exec), rePropName$2 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:
(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, reEscapeChar$2 = /\\
(\\)?/g, stringToPath$4 = function(e) {
var t = $strSlice(e, 0, 1)
, r = $strSlice(e, -1);
if ("%" === t && "%" !== r)
throw new $SyntaxError$1("invalid intrinsic syntax, expected
closing `%`");
if ("%" === r && "%" !== t)
throw new $SyntaxError$1("invalid intrinsic syntax, expected
opening `%`");
var n = [];
return $replace$1(e, rePropName$2, (function(e, t, r, i) {
n[n.length] = r ? $replace$1(i, reEscapeChar$2, "$1") : t || e
}
)),
n
}, getBaseIntrinsic = function(e, t) {
var r, n = e;
if (hasOwn$1(LEGACY_ALIASES, n) && (n = "%" + (r = LEGACY_ALIASES[n])
[0] + "%"),
hasOwn$1(INTRINSICS, n)) {
var i = INTRINSICS[n];
if (i === needsEval && (i = doEval(n)),
void 0 === i && !t)
throw new $TypeError$3("intrinsic " + e + " exists, but is not
available. Please file an issue!");
return {
alias: r,
name: n,
value: i
}
}
throw new $SyntaxError$1("intrinsic " + e + " does not exist!")
}, getIntrinsic = function(e, t) {
if ("string" != typeof e || 0 === e.length)
throw new $TypeError$3("intrinsic name must be a non-empty
string");
if (arguments.length > 1 && "boolean" != typeof t)
throw new $TypeError$3('"allowMissing" argument must be a
boolean');
if (null === $exec(/^%?[^%]*%?$/, e))
throw new $SyntaxError$1("`%` may not be present anywhere but at
the beginning and end of the intrinsic name");
var r = stringToPath$4(e)
, n = r.length > 0 ? r[0] : ""
, i = getBaseIntrinsic("%" + n + "%", t)
, o = i.name
, s = i.value
, a = !1
, l = i.alias;
l && (n = l[0],
$spliceApply(r, $concat$1([0, 1], l)));
for (var c = 1, u = !0; c < r.length; c += 1) {
var d = r[c]
, p = $strSlice(d, 0, 1)
, h = $strSlice(d, -1);
if (('"' === p || "'" === p || "`" === p || '"' === h || "'" === h
|| "`" === h) && p !== h)
throw new $SyntaxError$1("property names with quotes must have
matching quotes");
if ("constructor" !== d && u || (a = !0),
hasOwn$1(INTRINSICS, o = "%" + (n += "." + d) + "%"))
s = INTRINSICS[o];
else if (null != s) {
if (!(d in s)) {
if (!t)
throw new $TypeError$3("base intrinsic for " + e + "
exists, but the property is not available.");
return
}
if ($gOPD$1 && c + 1 >= r.length) {
var f = $gOPD$1(s, d);
s = (u = !!f) && "get"in f && !("originalValue"in f.get) ?
f.get : s[d]
} else
u = hasOwn$1(s, d),
s = s[d];
u && !a && (INTRINSICS[o] = s)
}
}
return s
}, callBind$1 = {
exports: {}
}, esDefineProperty, hasRequiredEsDefineProperty;
function requireEsDefineProperty() {
if (hasRequiredEsDefineProperty)
return esDefineProperty;
hasRequiredEsDefineProperty = 1;
var e = getIntrinsic("%Object.defineProperty%", !0) || !1;
if (e)
try {
e({}, "a", {
value: 1
})
} catch (e2) {
e = !1
}
return esDefineProperty = e
}
var GetIntrinsic$3 = getIntrinsic
, $gOPD = GetIntrinsic$3("%Object.getOwnPropertyDescriptor%", !0);
if ($gOPD)
try {
$gOPD([], "length")
} catch (e2) {
$gOPD = null
}
var gopd$1 = $gOPD
, $defineProperty$1 = requireEsDefineProperty()
, $SyntaxError = syntax
, $TypeError$2 = type$2
, gopd = gopd$1
, defineDataProperty = function(e, t, r) {
if (!e || "object" != typeof e && "function" != typeof e)
throw new $TypeError$2("`obj` must be an object or a function`");
if ("string" != typeof t && "symbol" != typeof t)
throw new $TypeError$2("`property` must be a string or a symbol`");
if (arguments.length > 3 && "boolean" != typeof arguments[3] && null !
== arguments[3])
throw new $TypeError$2("`nonEnumerable`, if provided, must be a
boolean or null");
if (arguments.length > 4 && "boolean" != typeof arguments[4] && null !
== arguments[4])
throw new $TypeError$2("`nonWritable`, if provided, must be a
boolean or null");
if (arguments.length > 5 && "boolean" != typeof arguments[5] && null !
== arguments[5])
throw new $TypeError$2("`nonConfigurable`, if provided, must be a
boolean or null");
if (arguments.length > 6 && "boolean" != typeof arguments[6])
throw new $TypeError$2("`loose`, if provided, must be a boolean");
var n = arguments.length > 3 ? arguments[3] : null
, i = arguments.length > 4 ? arguments[4] : null
, o = arguments.length > 5 ? arguments[5] : null
, s = arguments.length > 6 && arguments[6]
, a = !!gopd && gopd(e, t);
if ($defineProperty$1)
$defineProperty$1(e, t, {
configurable: null === o && a ? a.configurable : !o,
enumerable: null === n && a ? a.enumerable : !n,
value: r,
writable: null === i && a ? a.writable : !i
});
else {
if (!s && (n || i || o))
throw new $SyntaxError("This environment does not support
defining a property as non-configurable, non-writable, or non-enumerable.");
e[t] = r
}
}
, $defineProperty = requireEsDefineProperty()
, hasPropertyDescriptors = function() {
return !!$defineProperty
};
hasPropertyDescriptors.hasArrayLengthDefineBug = function() {
if (!$defineProperty)
return null;
try {
return 1 !== $defineProperty([], "length", {
value: 1
}).length
} catch (e2) {
return !0
}
}
;
var hasPropertyDescriptors_1 = hasPropertyDescriptors
, GetIntrinsic$2 = getIntrinsic
, define = defineDataProperty
, hasDescriptors = hasPropertyDescriptors_1()
, gOPD = gopd$1
, $TypeError$1 = type$2
, $floor$1 = GetIntrinsic$2("%Math.floor%")
, setFunctionLength = function(e, t) {
if ("function" != typeof e)
throw new $TypeError$1("`fn` is not a function");
if ("number" != typeof t || t < 0 || t > 4294967295 || $floor$1(t) !==
t)
throw new $TypeError$1("`length` must be a positive 32-bit
integer");
var r = arguments.length > 2 && !!arguments[2]
, n = !0
, i = !0;
if ("length"in e && gOPD) {
var o = gOPD(e, "length");
o && !o.configurable && (n = !1),
o && !o.writable && (i = !1)
}
return (n || i || !r) && (hasDescriptors ? define(e, "length", t, !0, !
0) : define(e, "length", t)),
e
};
!function(e) {
var t = functionBind
, r = getIntrinsic
, n = setFunctionLength
, i = type$2
, o = r("%Function.prototype.apply%")
, s = r("%Function.prototype.call%")
, a = r("%Reflect.apply%", !0) || t.call(s, o)
, l = requireEsDefineProperty()
, c = r("%Math.max%");
e.exports = function(e) {
if ("function" != typeof e)
throw new i("a function is required");
var r = a(t, s, arguments);
return n(r, 1 + c(0, e.length - (arguments.length - 1)), !0)
}
;
var u = function() {
return a(t, o, arguments)
};
l ? l(e.exports, "apply", {
value: u
}) : e.exports.apply = u
}(callBind$1);
var callBindExports = callBind$1.exports
, GetIntrinsic$1 = getIntrinsic
, callBind = callBindExports
, $indexOf = callBind(GetIntrinsic$1("String.prototype.indexOf"))
, callBound$1 = function(e, t) {
var r = GetIntrinsic$1(e, !!t);
return "function" == typeof r && $indexOf(e, ".prototype.") > -1 ?
callBind(r) : r
};
const __viteBrowserExternal = {}
, __viteBrowserExternal$1 = Object.freeze(Object.defineProperty({
__proto__: null,
default: __viteBrowserExternal
}, Symbol.toStringTag, {
value: "Module"
}))
, require$$0 = getAugmentedNamespace(__viteBrowserExternal$1);
var hasMap$1 = "function" == typeof Map && Map.prototype
, mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap$1 ?
Object.getOwnPropertyDescriptor(Map.prototype, "size") : null
, mapSize$1 = hasMap$1 && mapSizeDescriptor && "function" == typeof
mapSizeDescriptor.get ? mapSizeDescriptor.get : null
, mapForEach = hasMap$1 && Map.prototype.forEach
, hasSet$1 = "function" == typeof Set && Set.prototype
, setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet$1 ?
Object.getOwnPropertyDescriptor(Set.prototype, "size") : null
, setSize = hasSet$1 && setSizeDescriptor && "function" == typeof
setSizeDescriptor.get ? setSizeDescriptor.get : null
, setForEach = hasSet$1 && Set.prototype.forEach
, hasWeakMap = "function" == typeof WeakMap && WeakMap.prototype
, weakMapHas = hasWeakMap ? WeakMap.prototype.has : null
, hasWeakSet = "function" == typeof WeakSet && WeakSet.prototype
, weakSetHas = hasWeakSet ? WeakSet.prototype.has : null
, hasWeakRef = "function" == typeof WeakRef && WeakRef.prototype
, weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null
, booleanValueOf = Boolean.prototype.valueOf
, objectToString$2 = Object.prototype.toString
, functionToString = Function.prototype.toString
, $match = String.prototype.match
, $slice = String.prototype.slice
, $replace = String.prototype.replace
, $toUpperCase = String.prototype.toUpperCase
, $toLowerCase = String.prototype.toLowerCase
, $test = RegExp.prototype.test
, $concat = Array.prototype.concat
, $join = Array.prototype.join
, $arrSlice = Array.prototype.slice
, $floor = Math.floor
, bigIntValueOf = "function" == typeof BigInt ?
BigInt.prototype.valueOf : null
, gOPS = Object.getOwnPropertySymbols
, symToString = "function" == typeof Symbol && "symbol" == typeof
Symbol.iterator ? Symbol.prototype.toString : null
, hasShammedSymbols = "function" == typeof Symbol && "object" == typeof
Symbol.iterator
, toStringTag = "function" == typeof Symbol && Symbol.toStringTag &&
(typeof Symbol.toStringTag === hasShammedSymbols || "symbol") ?
Symbol.toStringTag : null
, isEnumerable = Object.prototype.propertyIsEnumerable
, gPO = ("function" == typeof Reflect ? Reflect.getPrototypeOf :
Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(e) {
return e.__proto__
}
: null);
function addNumericSeparator(e, t) {
if (e === 1 / 0 || e === -1 / 0 || e != e || e && e > -1e3 && e < 1e3
|| $test.call(/e/, t))
return t;
var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
if ("number" == typeof e) {
var n = e < 0 ? -$floor(-e) : $floor(e);
if (n !== e) {
var i = String(n)
, o = $slice.call(t, i.length + 1);
return $replace.call(i, r, "$&_") + "." +
$replace.call($replace.call(o, /([0-9]{3})/g, "$&_"), /_$/, "")
}
}
return $replace.call(t, r, "$&_")
}
var utilInspect = require$$0
, inspectCustom = utilInspect.custom
, inspectSymbol = isSymbol$5(inspectCustom) ? inspectCustom : null
, objectInspect = function e(t, r, n, i) {
var o = r || {};
if (has$3(o, "quoteStyle") && "single" !== o.quoteStyle && "double" !==
o.quoteStyle)
throw new TypeError('option "quoteStyle" must be "single" or
"double"');
if (has$3(o, "maxStringLength") && ("number" == typeof
o.maxStringLength ? o.maxStringLength < 0 && o.maxStringLength !== 1 / 0 : null !==
o.maxStringLength))
throw new TypeError('option "maxStringLength", if provided, must be
a positive integer, Infinity, or `null`');
var s = !has$3(o, "customInspect") || o.customInspect;
if ("boolean" != typeof s && "symbol" !== s)
throw new TypeError("option \"customInspect\", if provided, must be
`true`, `false`, or `'symbol'`");
if (has$3(o, "indent") && null !== o.indent && "\t" !== o.indent && !
(parseInt(o.indent, 10) === o.indent && o.indent > 0))
throw new TypeError('option "indent" must be "\\t", an integer > 0,
or `null`');
if (has$3(o, "numericSeparator") && "boolean" != typeof
o.numericSeparator)
throw new TypeError('option "numericSeparator", if provided, must
be `true` or `false`');
var a = o.numericSeparator;
if (void 0 === t)
return "undefined";
if (null === t)
return "null";
if ("boolean" == typeof t)
return t ? "true" : "false";
if ("string" == typeof t)
return inspectString(t, o);
if ("number" == typeof t) {
if (0 === t)
return 1 / 0 / t > 0 ? "0" : "-0";
var l = String(t);
return a ? addNumericSeparator(t, l) : l
}
if ("bigint" == typeof t) {
var c = String(t) + "n";
return a ? addNumericSeparator(t, c) : c
}
var u = void 0 === o.depth ? 5 : o.depth;
if (void 0 === n && (n = 0),
n >= u && u > 0 && "object" == typeof t)
return isArray$h(t) ? "[Array]" : "[Object]";
var d = getIndent(o, n);
if (void 0 === i)
i = [];
else if (indexOf(i, t) >= 0)
return "[Circular]";
function p(t, r, s) {
if (r && (i = $arrSlice.call(i)).push(r),
s) {
var a = {
depth: o.depth
};
return has$3(o, "quoteStyle") && (a.quoteStyle = o.quoteStyle),
e(t, a, n + 1, i)
}
return e(t, o, n + 1, i)
}
if ("function" == typeof t && !isRegExp$3(t)) {
var h = nameOf(t)
, f = arrObjKeys(t, p);
return "[Function" + (h ? ": " + h : " (anonymous)") + "]" +
(f.length > 0 ? " { " + $join.call(f, ", ") + " }" : "")
}
if (isSymbol$5(t)) {
var m = hasShammedSymbols ? $replace.call(String(t), /^(Symbol\
(.*\))_[^)]*$/, "$1") : symToString.call(t);
return "object" != typeof t || hasShammedSymbols ? m : markBoxed(m)
}
if (isElement$2(t)) {
for (var g = "<" + $toLowerCase.call(String(t.nodeName)), y =
t.attributes || [], v = 0; v < y.length; v++)
g += " " + y[v].name + "=" + wrapQuotes(quote(y[v].value),
"double", o);
return g += ">",
t.childNodes && t.childNodes.length && (g += "..."),
g += "</" + $toLowerCase.call(String(t.nodeName)) + ">"
}
if (isArray$h(t)) {
if (0 === t.length)
return "[]";
var b = arrObjKeys(t, p);
return d && !singleLineValues(b) ? "[" + indentedJoin(b, d) + "]" :
"[ " + $join.call(b, ", ") + " ]"
}
if (isError(t)) {
var x = arrObjKeys(t, p);
return "cause"in Error.prototype || !("cause"in t) ||
isEnumerable.call(t, "cause") ? 0 === x.length ? "[" + String(t) + "]" : "{ [" +
String(t) + "] " + $join.call(x, ", ") + " }" : "{ [" + String(t) + "] " +
$join.call($concat.call("[cause]: " + p(t.cause), x), ", ") + " }"
}
if ("object" == typeof t && s) {
if (inspectSymbol && "function" == typeof t[inspectSymbol] &&
utilInspect)
return utilInspect(t, {
depth: u - n
});
if ("symbol" !== s && "function" == typeof t.inspect)
return t.inspect()
}
if (isMap$3(t)) {
var _ = [];
return mapForEach && mapForEach.call(t, (function(e, r) {
_.push(p(r, t, !0) + " => " + p(e, t))
}
)),
collectionOf("Map", mapSize$1.call(t), _, d)
}
if (isSet$3(t)) {
var E = [];
return setForEach && setForEach.call(t, (function(e) {
E.push(p(e, t))
}
)),
collectionOf("Set", setSize.call(t), E, d)
}
if (isWeakMap(t))
return weakCollectionOf("WeakMap");
if (isWeakSet(t))
return weakCollectionOf("WeakSet");
if (isWeakRef(t))
return weakCollectionOf("WeakRef");
if (isNumber$5(t))
return markBoxed(p(Number(t)));
if (isBigInt(t))
return markBoxed(p(bigIntValueOf.call(t)));
if (isBoolean$1(t))
return markBoxed(booleanValueOf.call(t));
if (isString$4(t))
return markBoxed(p(String(t)));
if ("undefined" != typeof window && t === window)
return "{ [object Window] }";
if ("undefined" != typeof globalThis && t === globalThis || void 0 !==
commonjsGlobal$1 && t === commonjsGlobal$1)
return "{ [object globalThis] }";
if (!isDate$3(t) && !isRegExp$3(t)) {
var T = arrObjKeys(t, p)
, C = gPO ? gPO(t) === Object.prototype : t instanceof Object ||
t.constructor === Object
, S = t instanceof Object ? "" : "null prototype"
, $ = !C && toStringTag && Object(t) === t && toStringTag in t ?
$slice.call(toStr(t), 8, -1) : S ? "Object" : ""
, w = (C || "function" != typeof t.constructor ? "" :
t.constructor.name ? t.constructor.name + " " : "") + ($ || S ? "[" +
$join.call($concat.call([], $ || [], S || []), ": ") + "] " : "");
return 0 === T.length ? w + "{}" : d ? w + "{" + indentedJoin(T, d)
+ "}" : w + "{ " + $join.call(T, ", ") + " }"
}
return String(t)
};
function wrapQuotes(e, t, r) {
var n = "double" === (r.quoteStyle || t) ? '"' : "'";
return n + e + n
}
function quote(e) {
return $replace.call(String(e), /"/g, """)
}
function isArray$h(e) {
return !("[object Array]" !== toStr(e) || toStringTag && "object" ==
typeof e && toStringTag in e)
}
function isDate$3(e) {
return !("[object Date]" !== toStr(e) || toStringTag && "object" ==
typeof e && toStringTag in e)
}
function isRegExp$3(e) {
return !("[object RegExp]" !== toStr(e) || toStringTag && "object" ==
typeof e && toStringTag in e)
}
function isError(e) {
return !("[object Error]" !== toStr(e) || toStringTag && "object" ==
typeof e && toStringTag in e)
}
function isString$4(e) {
return !("[object String]" !== toStr(e) || toStringTag && "object" ==
typeof e && toStringTag in e)
}
function isNumber$5(e) {
return !("[object Number]" !== toStr(e) || toStringTag && "object" ==
typeof e && toStringTag in e)
}
function isBoolean$1(e) {
return !("[object Boolean]" !== toStr(e) || toStringTag && "object" ==
typeof e && toStringTag in e)
}
function isSymbol$5(e) {
if (hasShammedSymbols)
return e && "object" == typeof e && e instanceof Symbol;
if ("symbol" == typeof e)
return !0;
if (!e || "object" != typeof e || !symToString)
return !1;
try {
return symToString.call(e),
!0
} catch (e2) {}
return !1
}
function isBigInt(e) {
if (!e || "object" != typeof e || !bigIntValueOf)
return !1;
try {
return bigIntValueOf.call(e),
!0
} catch (e2) {}
return !1
}
var hasOwn = Object.prototype.hasOwnProperty || function(e) {
return e in this
}
;
function has$3(e, t) {
return hasOwn.call(e, t)
}
function toStr(e) {
return objectToString$2.call(e)
}
function nameOf(e) {
if (e.name)
return e.name;
var t = $match.call(functionToString.call(e), /^function\s*([\w$]+)/);
return t ? t[1] : null
}
function indexOf(e, t) {
if (e.indexOf)
return e.indexOf(t);
for (var r = 0, n = e.length; r < n; r++)
if (e[r] === t)
return r;
return -1
}
function isMap$3(e) {
if (!mapSize$1 || !e || "object" != typeof e)
return !1;
try {
mapSize$1.call(e);
try {
setSize.call(e)
} catch (t) {
return !0
}
return e instanceof Map
} catch (e2) {}
return !1
}
function isWeakMap(e) {
if (!weakMapHas || !e || "object" != typeof e)
return !1;
try {
weakMapHas.call(e, weakMapHas);
try {
weakSetHas.call(e, weakSetHas)
} catch (t) {
return !0
}
return e instanceof WeakMap
} catch (e2) {}
return !1
}
function isWeakRef(e) {
if (!weakRefDeref || !e || "object" != typeof e)
return !1;
try {
return weakRefDeref.call(e),
!0
} catch (e2) {}
return !1
}
function isSet$3(e) {
if (!setSize || !e || "object" != typeof e)
return !1;
try {
setSize.call(e);
try {
mapSize$1.call(e)
} catch (t) {
return !0
}
return e instanceof Set
} catch (e2) {}
return !1
}
function isWeakSet(e) {
if (!weakSetHas || !e || "object" != typeof e)
return !1;
try {
weakSetHas.call(e, weakSetHas);
try {
weakMapHas.call(e, weakMapHas)
} catch (t) {
return !0
}
return e instanceof WeakSet
} catch (e2) {}
return !1
}
function isElement$2(e) {
return !(!e || "object" != typeof e) && ("undefined" != typeof
HTMLElement && e instanceof HTMLElement || "string" == typeof e.nodeName &&
"function" == typeof e.getAttribute)
}
function inspectString(e, t) {
if (e.length > t.maxStringLength) {
var r = e.length - t.maxStringLength
, n = "... " + r + " more character" + (r > 1 ? "s" : "");
return inspectString($slice.call(e, 0, t.maxStringLength), t) + n
}
return wrapQuotes($replace.call($replace.call(e, /(['\\])/g, "\\
$1"), /[\x00-\x1f]/g, lowbyte), "single", t)
}
function lowbyte(e) {
var t = e.charCodeAt(0)
, r = {
8: "b",
9: "t",
10: "n",
12: "f",
13: "r"
}[t];
return r ? "\\" + r : "\\x" + (t < 16 ? "0" : "") +
$toUpperCase.call(t.toString(16))
}
function markBoxed(e) {
return "Object(" + e + ")"
}
function weakCollectionOf(e) {
return e + " { ? }"
}
function collectionOf(e, t, r, n) {
return e + " (" + t + ") {" + (n ? indentedJoin(r, n) : $join.call(r,
", ")) + "}"
}
function singleLineValues(e) {
for (var t = 0; t < e.length; t++)
if (indexOf(e[t], "\n") >= 0)
return !1;
return !0
}
function getIndent(e, t) {
var r;
if ("\t" === e.indent)
r = "\t";
else {
if (!("number" == typeof e.indent && e.indent > 0))
return null;
r = $join.call(Array(e.indent + 1), " ")
}
return {
base: r,
prev: $join.call(Array(t + 1), r)
}
}
function indentedJoin(e, t) {
if (0 === e.length)
return "";
var r = "\n" + t.prev + t.base;
return r + $join.call(e, "," + r) + "\n" + t.prev
}
function arrObjKeys(e, t) {
var r = isArray$h(e)
, n = [];
if (r) {
n.length = e.length;
for (var i = 0; i < e.length; i++)
n[i] = has$3(e, i) ? t(e[i], e) : ""
}
var o, s = "function" == typeof gOPS ? gOPS(e) : [];
if (hasShammedSymbols) {
o = {};
for (var a = 0; a < s.length; a++)
o["$" + s[a]] = s[a]
}
for (var l in e)
has$3(e, l) && (r && String(Number(l)) === l && l < e.length ||
hasShammedSymbols && o["$" + l]instanceof Symbol || ($test.call(/[^\w$]/, l) ?
n.push(t(l, e) + ": " + t(e[l], e)) : n.push(l + ": " + t(e[l], e))));
if ("function" == typeof gOPS)
for (var c = 0; c < s.length; c++)
isEnumerable.call(e, s[c]) && n.push("[" + t(s[c]) + "]: " +
t(e[s[c]], e));
return n
}
var GetIntrinsic = getIntrinsic
, callBound = callBound$1
, inspect = objectInspect
, $TypeError = type$2
, $WeakMap = GetIntrinsic("%WeakMap%", !0)
, $Map = GetIntrinsic("%Map%", !0)
, $weakMapGet = callBound("WeakMap.prototype.get", !0)
, $weakMapSet = callBound("WeakMap.prototype.set", !0)
, $weakMapHas = callBound("WeakMap.prototype.has", !0)
, $mapGet = callBound("Map.prototype.get", !0)
, $mapSet = callBound("Map.prototype.set", !0)
, $mapHas = callBound("Map.prototype.has", !0)
, listGetNode = function(e, t) {
for (var r, n = e; null !== (r = n.next); n = r)
if (r.key === t)
return n.next = r.next,
r.next = e.next,
e.next = r,
r
}
, listGet = function(e, t) {
var r = listGetNode(e, t);
return r && r.value
}
, listSet = function(e, t, r) {
var n = listGetNode(e, t);
n ? n.value = r : e.next = {
key: t,
next: e.next,
value: r
}
}
, listHas = function(e, t) {
return !!listGetNode(e, t)
}
, sideChannel = function() {
var e, t, r, n = {
assert: function(e) {
if (!n.has(e))
throw new $TypeError("Side channel does not contain " +
inspect(e))
},
get: function(n) {
if ($WeakMap && n && ("object" == typeof n || "function" ==
typeof n)) {
if (e)
return $weakMapGet(e, n)
} else if ($Map) {
if (t)
return $mapGet(t, n)
} else if (r)
return listGet(r, n)
},
has: function(n) {
if ($WeakMap && n && ("object" == typeof n || "function" ==
typeof n)) {
if (e)
return $weakMapHas(e, n)
} else if ($Map) {
if (t)
return $mapHas(t, n)
} else if (r)
return listHas(r, n);
return !1
},
set: function(n, i) {
$WeakMap && n && ("object" == typeof n || "function" == typeof
n) ? (e || (e = new $WeakMap),
$weakMapSet(e, n, i)) : $Map ? (t || (t = new $Map),
$mapSet(t, n, i)) : (r || (r = {
key: {},
next: null
}),
listSet(r, n, i))
}
};
return n
}
, replace = String.prototype.replace
, percentTwenties = /%20/g
, Format = {
RFC1738: "RFC1738",
RFC3986: "RFC3986"
}
, formats$4 = {
default: Format.RFC3986,
formatters: {
RFC1738: function(e) {
return replace.call(e, percentTwenties, "+")
},
RFC3986: function(e) {
return String(e)
}
},
RFC1738: Format.RFC1738,
RFC3986: Format.RFC3986
}
, formats$3 = formats$4
, has$2 = Object.prototype.hasOwnProperty
, isArray$g = Array.isArray
, hexTable = function() {
for (var e = [], t = 0; t < 256; ++t)
e.push("%" + ((t < 16 ? "0" : "") + t.toString(16)).toUpperCase());
return e
}()
, compactQueue = function(e) {
for (; e.length > 1; ) {
var t = e.pop()
, r = t.obj[t.prop];
if (isArray$g(r)) {
for (var n = [], i = 0; i < r.length; ++i)
void 0 !== r[i] && n.push(r[i]);
t.obj[t.prop] = n
}
}
}
, arrayToObject = function(e, t) {
for (var r = t && t.plainObjects ? Object.create(null) : {}, n = 0; n <
e.length; ++n)
void 0 !== e[n] && (r[n] = e[n]);
return r
}
, merge$3 = function e(t, r, n) {
if (!r)
return t;
if ("object" != typeof r) {
if (isArray$g(t))
t.push(r);
else {
if (!t || "object" != typeof t)
return [t, r];
(n && (n.plainObjects || n.allowPrototypes) || !
has$2.call(Object.prototype, r)) && (t[r] = !0)
}
return t
}
if (!t || "object" != typeof t)
return [t].concat(r);
var i = t;
return isArray$g(t) && !isArray$g(r) && (i = arrayToObject(t, n)),
isArray$g(t) && isArray$g(r) ? (r.forEach((function(r, i) {
if (has$2.call(t, i)) {
var o = t[i];
o && "object" == typeof o && r && "object" == typeof r ? t[i] =
e(o, r, n) : t.push(r)
} else
t[i] = r
}
)),
t) : Object.keys(r).reduce((function(t, i) {
var o = r[i];
return has$2.call(t, i) ? t[i] = e(t[i], o, n) : t[i] = o,
t
}
), i)
}
, assign$5 = function(e, t) {
return Object.keys(t).reduce((function(e, r) {
return e[r] = t[r],
e
}
), e)
}
, decode = function(e, t, r) {
var n = e.replace(/\+/g, " ");
if ("iso-8859-1" === r)
return n.replace(/%[0-9a-f]{2}/gi, unescape);
try {
return decodeURIComponent(n)
} catch (e2) {
return n
}
}
, limit = 1024
, encode = function(e, t, r, n, i) {
if (0 === e.length)
return e;
var o = e;
if ("symbol" == typeof e ? o = Symbol.prototype.toString.call(e) :
"string" != typeof e && (o = String(e)),
"iso-8859-1" === r)
return escape(o).replace(/%u[0-9a-f]{4}/gi, (function(e) {
return "%26%23" + parseInt(e.slice(2), 16) + "%3B"
}
));
for (var s = "", a = 0; a < o.length; a += limit) {
for (var l = o.length >= limit ? o.slice(a, a + limit) : o, c = [],
u = 0; u < l.length; ++u) {
var d = l.charCodeAt(u);
45 === d || 46 === d || 95 === d || 126 === d || d >= 48 && d
<= 57 || d >= 65 && d <= 90 || d >= 97 && d <= 122 || i === formats$3.RFC1738 &&
(40 === d || 41 === d) ? c[c.length] = l.charAt(u) : d < 128 ? c[c.length] =
hexTable[d] : d < 2048 ? c[c.length] = hexTable[192 | d >> 6] + hexTable[128 | 63 &
d] : d < 55296 || d >= 57344 ? c[c.length] = hexTable[224 | d >> 12] + hexTable[128
| d >> 6 & 63] + hexTable[128 | 63 & d] : (u += 1,
d = 65536 + ((1023 & d) << 10 | 1023 & l.charCodeAt(u)),
c[c.length] = hexTable[240 | d >> 18] + hexTable[128 | d >> 12
& 63] + hexTable[128 | d >> 6 & 63] + hexTable[128 | 63 & d])
}
s += c.join("")
}
return s
}
, compact = function(e) {
for (var t = [{
obj: {
o: e
},
prop: "o"
}], r = [], n = 0; n < t.length; ++n)
for (var i = t[n], o = i.obj[i.prop], s = Object.keys(o), a = 0; a
< s.length; ++a) {
var l = s[a]
, c = o[l];
"object" == typeof c && null !== c && -1 === r.indexOf(c) &&
(t.push({
obj: o,
prop: l
}),
r.push(c))
}
return compactQueue(t),
e
}
, isRegExp$2 = function(e) {
return "[object RegExp]" === Object.prototype.toString.call(e)
}
, isBuffer$6 = function(e) {
return !(!e || "object" != typeof e) && !!(e.constructor &&
e.constructor.isBuffer && e.constructor.isBuffer(e))
}
, combine = function(e, t) {
return [].concat(e, t)
}
, maybeMap = function(e, t) {
if (isArray$g(e)) {
for (var r = [], n = 0; n < e.length; n += 1)
r.push(t(e[n]));
return r
}
return t(e)
}
, utils$5 = {
arrayToObject: arrayToObject,
assign: assign$5,
combine: combine,
compact: compact,
decode: decode,
encode: encode,
isBuffer: isBuffer$6,
isRegExp: isRegExp$2,
maybeMap: maybeMap,
merge: merge$3
}
, getSideChannel = sideChannel
, utils$4 = utils$5
, formats$2 = formats$4
, has$1 = Object.prototype.hasOwnProperty
, arrayPrefixGenerators = {
brackets: function(e) {
return e + "[]"
},
comma: "comma",
indices: function(e, t) {
return e + "[" + t + "]"
},
repeat: function(e) {
return e
}
}
, isArray$f = Array.isArray
, push = Array.prototype.push
, pushToArray = function(e, t) {
push.apply(e, isArray$f(t) ? t : [t])
}
, toISO = Date.prototype.toISOString
, defaultFormat = formats$2.default
, defaults$1 = {
addQueryPrefix: !1,
allowDots: !1,
allowEmptyArrays: !1,
arrayFormat: "indices",
charset: "utf-8",
charsetSentinel: !1,
delimiter: "&",
encode: !0,
encodeDotInKeys: !1,
encoder: utils$4.encode,
encodeValuesOnly: !1,
format: defaultFormat,
formatter: formats$2.formatters[defaultFormat],
indices: !1,
serializeDate: function(e) {
return toISO.call(e)
},
skipNulls: !1,
strictNullHandling: !1
}
, isNonNullishPrimitive = function(e) {
return "string" == typeof e || "number" == typeof e || "boolean" ==
typeof e || "symbol" == typeof e || "bigint" == typeof e
}
, sentinel = {}
, stringify$2 = function e(t, r, n, i, o, s, a, l, c, u, d, p, h, f, m,
g, y, v) {
for (var b = t, x = v, _ = 0, E = !1; void 0 !== (x = x.get(sentinel))
&& !E; ) {
var T = x.get(t);
if (_ += 1,
void 0 !== T) {
if (T === _)
throw new RangeError("Cyclic object value");
E = !0
}
void 0 === x.get(sentinel) && (_ = 0)
}
if ("function" == typeof u ? b = u(r, b) : b instanceof Date ? b = h(b)
: "comma" === n && isArray$f(b) && (b = utils$4.maybeMap(b, (function(e) {
return e instanceof Date ? h(e) : e
}
))),
null === b) {
if (s)
return c && !g ? c(r, defaults$1.encoder, y, "key", f) : r;
b = ""
}
if (isNonNullishPrimitive(b) || utils$4.isBuffer(b))
return c ? [m(g ? r : c(r, defaults$1.encoder, y, "key", f)) + "="
+ m(c(b, defaults$1.encoder, y, "value", f))] : [m(r) + "=" + m(String(b))];
var C, S = [];
if (void 0 === b)
return S;
if ("comma" === n && isArray$f(b))
g && c && (b = utils$4.maybeMap(b, c)),
C = [{
value: b.length > 0 ? b.join(",") || null : void 0
}];
else if (isArray$f(u))
C = u;
else {
var $ = Object.keys(b);
C = d ? $.sort(d) : $
}
var w = l ? r.replace(/\./g, "%2E") : r
, P = i && isArray$f(b) && 1 === b.length ? w + "[]" : w;
if (o && isArray$f(b) && 0 === b.length)
return P + "[]";
for (var R = 0; R < C.length; ++R) {
var k = C[R]
, A = "object" == typeof k && void 0 !== k.value ? k.value :
b[k];
if (!a || null !== A) {
var I = p && l ? k.replace(/\./g, "%2E") : k
, O = isArray$f(b) ? "function" == typeof n ? n(P, I) : P : P
+ (p ? "." + I : "[" + I + "]");
v.set(t, _);
var D = getSideChannel();
D.set(sentinel, v),
pushToArray(S, e(A, O, n, i, o, s, a, l, "comma" === n && g &&
isArray$f(b) ? null : c, u, d, p, h, f, m, g, y, D))
}
}
return S
}
, normalizeStringifyOptions = function(e) {
if (!e)
return defaults$1;
if (void 0 !== e.allowEmptyArrays && "boolean" != typeof
e.allowEmptyArrays)
throw new TypeError("`allowEmptyArrays` option can only be `true`
or `false`, when provided");
if (void 0 !== e.encodeDotInKeys && "boolean" != typeof
e.encodeDotInKeys)
throw new TypeError("`encodeDotInKeys` option can only be `true` or
`false`, when provided");
if (null !== e.encoder && void 0 !== e.encoder && "function" != typeof
e.encoder)
throw new TypeError("Encoder has to be a function.");
var t = e.charset || defaults$1.charset;
if (void 0 !== e.charset && "utf-8" !== e.charset && "iso-8859-1" !==
e.charset)
throw new TypeError("The charset option must be either utf-8, iso-
8859-1, or undefined");
var r = formats$2.default;
if (void 0 !== e.format) {
if (!has$1.call(formats$2.formatters, e.format))
throw new TypeError("Unknown format option provided.");
r = e.format
}
var n, i = formats$2.formatters[r], o = defaults$1.filter;
if (("function" == typeof e.filter || isArray$f(e.filter)) && (o =
e.filter),
n = e.arrayFormat in arrayPrefixGenerators ? e.arrayFormat :
"indices"in e ? e.indices ? "indices" : "repeat" : defaults$1.arrayFormat,
"commaRoundTrip"in e && "boolean" != typeof e.commaRoundTrip)
throw new TypeError("`commaRoundTrip` must be a boolean, or
absent");
var s = void 0 === e.allowDots ? !0 === e.encodeDotInKeys ||
defaults$1.allowDots : !!e.allowDots;
return {
addQueryPrefix: "boolean" == typeof e.addQueryPrefix ?
e.addQueryPrefix : defaults$1.addQueryPrefix,
allowDots: s,
allowEmptyArrays: "boolean" == typeof e.allowEmptyArrays ? !!
e.allowEmptyArrays : defaults$1.allowEmptyArrays,
arrayFormat: n,
charset: t,
charsetSentinel: "boolean" == typeof e.charsetSentinel ?
e.charsetSentinel : defaults$1.charsetSentinel,
commaRoundTrip: e.commaRoundTrip,
delimiter: void 0 === e.delimiter ? defaults$1.delimiter :
e.delimiter,
encode: "boolean" == typeof e.encode ? e.encode :
defaults$1.encode,
encodeDotInKeys: "boolean" == typeof e.encodeDotInKeys ?
e.encodeDotInKeys : defaults$1.encodeDotInKeys,
encoder: "function" == typeof e.encoder ? e.encoder :
defaults$1.encoder,
encodeValuesOnly: "boolean" == typeof e.encodeValuesOnly ?
e.encodeValuesOnly : defaults$1.encodeValuesOnly,
filter: o,
format: r,
formatter: i,
serializeDate: "function" == typeof e.serializeDate ?
e.serializeDate : defaults$1.serializeDate,
skipNulls: "boolean" == typeof e.skipNulls ? e.skipNulls :
defaults$1.skipNulls,
sort: "function" == typeof e.sort ? e.sort : null,
strictNullHandling: "boolean" == typeof e.strictNullHandling ?
e.strictNullHandling : defaults$1.strictNullHandling
}
}
, stringify_1 = function(e, t) {
var r, n = e, i = normalizeStringifyOptions(t);
"function" == typeof i.filter ? n = (0,
i.filter)("", n) : isArray$f(i.filter) && (r = i.filter);
var o = [];
if ("object" != typeof n || null === n)
return "";
var s = arrayPrefixGenerators[i.arrayFormat]
, a = "comma" === s && i.commaRoundTrip;
r || (r = Object.keys(n)),
i.sort && r.sort(i.sort);
for (var l = getSideChannel(), c = 0; c < r.length; ++c) {
var u = r[c];
i.skipNulls && null === n[u] || pushToArray(o, stringify$2(n[u], u,
s, a, i.allowEmptyArrays, i.strictNullHandling, i.skipNulls, i.encodeDotInKeys,
i.encode ? i.encoder : null, i.filter, i.sort, i.allowDots, i.serializeDate,
i.format, i.formatter, i.encodeValuesOnly, i.charset, l))
}
var d = o.join(i.delimiter)
, p = !0 === i.addQueryPrefix ? "?" : "";
return i.charsetSentinel && ("iso-8859-1" === i.charset ? p += "utf8=
%26%2310003%3B&" : p += "utf8=%E2%9C%93&"),
d.length > 0 ? p + d : ""
}
, utils$3 = utils$5
, has = Object.prototype.hasOwnProperty
, isArray$e = Array.isArray
, defaults = {
allowDots: !1,
allowEmptyArrays: !1,
allowPrototypes: !1,
allowSparse: !1,
arrayLimit: 20,
charset: "utf-8",
charsetSentinel: !1,
comma: !1,
decodeDotInKeys: !1,
decoder: utils$3.decode,
delimiter: "&",
depth: 5,
duplicates: "combine",
ignoreQueryPrefix: !1,
interpretNumericEntities: !1,
parameterLimit: 1e3,
parseArrays: !0,
plainObjects: !1,
strictDepth: !1,
strictNullHandling: !1
}
, interpretNumericEntities = function(e) {
return e.replace(/&#(\d+);/g, (function(e, t) {
return String.fromCharCode(parseInt(t, 10))
}
))
}
, parseArrayValue = function(e, t) {
return e && "string" == typeof e && t.comma && e.indexOf(",") > -1 ?
e.split(",") : e
}
, isoSentinel = "utf8=%26%2310003%3B"
, charsetSentinel = "utf8=%E2%9C%93"
, parseValues = function(e, t) {
var r = {
__proto__: null
}
, n = t.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
n = n.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
var i, o = t.parameterLimit === 1 / 0 ? void 0 : t.parameterLimit, s =
n.split(t.delimiter, o), a = -1, l = t.charset;
if (t.charsetSentinel)
for (i = 0; i < s.length; ++i)
0 === s[i].indexOf("utf8=") && (s[i] === charsetSentinel ? l =
"utf-8" : s[i] === isoSentinel && (l = "iso-8859-1"),
a = i,
i = s.length);
for (i = 0; i < s.length; ++i)
if (i !== a) {
var c, u, d = s[i], p = d.indexOf("]="), h = -1 === p ?
d.indexOf("=") : p + 1;
-1 === h ? (c = t.decoder(d, defaults.decoder, l, "key"),
u = t.strictNullHandling ? null : "") : (c =
t.decoder(d.slice(0, h), defaults.decoder, l, "key"),
u = utils$3.maybeMap(parseArrayValue(d.slice(h + 1), t),
(function(e) {
return t.decoder(e, defaults.decoder, l, "value")
}
))),
u && t.interpretNumericEntities && "iso-8859-1" === l && (u =
interpretNumericEntities(u)),
d.indexOf("[]=") > -1 && (u = isArray$e(u) ? [u] : u);
var f = has.call(r, c);
f && "combine" === t.duplicates ? r[c] = utils$3.combine(r[c],
u) : f && "last" !== t.duplicates || (r[c] = u)
}
return r
}
, parseObject = function(e, t, r, n) {
for (var i = n ? t : parseArrayValue(t, r), o = e.length - 1; o >= 0;
--o) {
var s, a = e[o];
if ("[]" === a && r.parseArrays)
s = r.allowEmptyArrays && ("" === i || r.strictNullHandling &&
null === i) ? [] : [].concat(i);
else {
s = r.plainObjects ? Object.create(null) : {};
var l = "[" === a.charAt(0) && "]" === a.charAt(a.length - 1) ?
a.slice(1, -1) : a
, c = r.decodeDotInKeys ? l.replace(/%2E/g, ".") : l
, u = parseInt(c, 10);
r.parseArrays || "" !== c ? !isNaN(u) && a !== c && String(u)
=== c && u >= 0 && r.parseArrays && u <= r.arrayLimit ? (s = [])[u] = i :
"__proto__" !== c && (s[c] = i) : s = {
0: i
}
}
i = s
}
return i
}
, parseKeys = function(e, t, r, n) {
if (e) {
var i = r.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e
, o = /(\[[^[\]]*])/g
, s = r.depth > 0 && /(\[[^[\]]*])/.exec(i)
, a = s ? i.slice(0, s.index) : i
, l = [];
if (a) {
if (!r.plainObjects && has.call(Object.prototype, a) && !
r.allowPrototypes)
return;
l.push(a)
}
for (var c = 0; r.depth > 0 && null !== (s = o.exec(i)) && c <
r.depth; ) {
if (c += 1,
!r.plainObjects && has.call(Object.prototype, s[1].slice(1, -
1)) && !r.allowPrototypes)
return;
l.push(s[1])
}
if (s) {
if (!0 === r.strictDepth)
throw new RangeError("Input depth exceeded depth option of
" + r.depth + " and strictDepth is true");
l.push("[" + i.slice(s.index) + "]")
}
return parseObject(l, t, r, n)
}
}
, normalizeParseOptions = function(e) {
if (!e)
return defaults;
if (void 0 !== e.allowEmptyArrays && "boolean" != typeof
e.allowEmptyArrays)
throw new TypeError("`allowEmptyArrays` option can only be `true`
or `false`, when provided");
if (void 0 !== e.decodeDotInKeys && "boolean" != typeof
e.decodeDotInKeys)
throw new TypeError("`decodeDotInKeys` option can only be `true` or
`false`, when provided");
if (null !== e.decoder && void 0 !== e.decoder && "function" != typeof
e.decoder)
throw new TypeError("Decoder has to be a function.");
if (void 0 !== e.charset && "utf-8" !== e.charset && "iso-8859-1" !==
e.charset)
throw new TypeError("The charset option must be either utf-8, iso-
8859-1, or undefined");
var t = void 0 === e.charset ? defaults.charset : e.charset
, r = void 0 === e.duplicates ? defaults.duplicates : e.duplicates;
if ("combine" !== r && "first" !== r && "last" !== r)
throw new TypeError("The duplicates option must be either combine,
first, or last");
return {
allowDots: void 0 === e.allowDots ? !0 === e.decodeDotInKeys ||
defaults.allowDots : !!e.allowDots,
allowEmptyArrays: "boolean" == typeof e.allowEmptyArrays ? !!
e.allowEmptyArrays : defaults.allowEmptyArrays,
allowPrototypes: "boolean" == typeof e.allowPrototypes ?
e.allowPrototypes : defaults.allowPrototypes,
allowSparse: "boolean" == typeof e.allowSparse ? e.allowSparse :
defaults.allowSparse,
arrayLimit: "number" == typeof e.arrayLimit ? e.arrayLimit :
defaults.arrayLimit,
charset: t,
charsetSentinel: "boolean" == typeof e.charsetSentinel ?
e.charsetSentinel : defaults.charsetSentinel,
comma: "boolean" == typeof e.comma ? e.comma : defaults.comma,
decodeDotInKeys: "boolean" == typeof e.decodeDotInKeys ?
e.decodeDotInKeys : defaults.decodeDotInKeys,
decoder: "function" == typeof e.decoder ? e.decoder :
defaults.decoder,
delimiter: "string" == typeof e.delimiter ||
utils$3.isRegExp(e.delimiter) ? e.delimiter : defaults.delimiter,
depth: "number" == typeof e.depth || !1 === e.depth ? +e.depth :
defaults.depth,
duplicates: r,
ignoreQueryPrefix: !0 === e.ignoreQueryPrefix,
interpretNumericEntities: "boolean" == typeof
e.interpretNumericEntities ? e.interpretNumericEntities :
defaults.interpretNumericEntities,
parameterLimit: "number" == typeof e.parameterLimit ?
e.parameterLimit : defaults.parameterLimit,
parseArrays: !1 !== e.parseArrays,
plainObjects: "boolean" == typeof e.plainObjects ? e.plainObjects :
defaults.plainObjects,
strictDepth: "boolean" == typeof e.strictDepth ? !!e.strictDepth :
defaults.strictDepth,
strictNullHandling: "boolean" == typeof e.strictNullHandling ?
e.strictNullHandling : defaults.strictNullHandling
}
}
, parse$5 = function(e, t) {
var r = normalizeParseOptions(t);
if ("" === e || null == e)
return r.plainObjects ? Object.create(null) : {};
for (var n = "string" == typeof e ? parseValues(e, r) : e, i =
r.plainObjects ? Object.create(null) : {}, o = Object.keys(n), s = 0; s < o.length;
++s) {
var a = o[s]
, l = parseKeys(a, n[a], r, "string" == typeof e);
i = utils$3.merge(i, l, r)
}
return !0 === r.allowSparse ? i : utils$3.compact(i)
}
, stringify$1 = stringify_1
, parse$4 = parse$5
, formats$1 = formats$4
, lib$3 = {
formats: formats$1,
parse: parse$4,
stringify: stringify$1
}
, punycode = punycodeExports;
function Url() {
this.protocol = null,
this.slashes = null,
this.auth = null,
this.host = null,
this.port = null,
this.hostname = null,
this.hash = null,
this.search = null,
this.query = null,
this.pathname = null,
this.path = null,
this.href = null
}
var protocolPattern = /^([a-z0-9.+-]+:)/i
, portPattern = /:[0-9]*$/
, simplePathPattern = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/
, delims = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
, unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims)
, autoEscape = ["'"].concat(unwise)
, nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape)
, hostEndingChars = ["/", "?", "#"]
, hostnameMaxLen = 255
, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/
, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
, unsafeProtocol = {
javascript: !0,
"javascript:": !0
}
, hostlessProtocol = {
javascript: !0,
"javascript:": !0
}
, slashedProtocol = {
http: !0,
https: !0,
ftp: !0,
gopher: !0,
file: !0,
"http:": !0,
"https:": !0,
"ftp:": !0,
"gopher:": !0,
"file:": !0
}
, querystring = lib$3;
function urlParse(e, t, r) {
if (e && "object" == typeof e && e instanceof Url)
return e;
var n = new Url;
return n.parse(e, t, r),
n
}
Url.prototype.parse = function(e, t, r) {
if ("string" != typeof e)
throw new TypeError("Parameter 'url' must be a string, not " +
typeof e);
var n = e.indexOf("?")
, i = -1 !== n && n < e.indexOf("#") ? "?" : "#"
, o = e.split(i);
o[0] = o[0].replace(/\\/g, "/");
var s = e = o.join(i);
if (s = s.trim(),
!r && 1 === e.split("#").length) {
var a = simplePathPattern.exec(s);
if (a)
return this.path = s,
this.href = s,
this.pathname = a[1],
a[2] ? (this.search = a[2],
this.query = t ? querystring.parse(this.search.substr(1)) :
this.search.substr(1)) : t && (this.search = "",
this.query = {}),
this
}
var l = protocolPattern.exec(s);
if (l) {
var c = (l = l[0]).toLowerCase();
this.protocol = c,
s = s.substr(l.length)
}
if (r || l || s.match(/^\/\/[^@/]+@[^@/]+/)) {
var u = "//" === s.substr(0, 2);
!u || l && hostlessProtocol[l] || (s = s.substr(2),
this.slashes = !0)
}
if (!hostlessProtocol[l] && (u || l && !slashedProtocol[l])) {
for (var d, p, h = -1, f = 0; f < hostEndingChars.length; f++) {
-1 !== (m = s.indexOf(hostEndingChars[f])) && (-1 === h || m <
h) && (h = m)
}
-1 !== (p = -1 === h ? s.lastIndexOf("@") : s.lastIndexOf("@", h))
&& (d = s.slice(0, p),
s = s.slice(p + 1),
this.auth = decodeURIComponent(d)),
h = -1;
for (f = 0; f < nonHostChars.length; f++) {
var m;
-1 !== (m = s.indexOf(nonHostChars[f])) && (-1 === h || m < h)
&& (h = m)
}
-1 === h && (h = s.length),
this.host = s.slice(0, h),
s = s.slice(h),
this.parseHost(),
this.hostname = this.hostname || "";
var g = "[" === this.hostname[0] && "]" ===
this.hostname[this.hostname.length - 1];
if (!g)
for (var y = this.hostname.split(/\./), v = (f = 0,
y.length); f < v; f++) {
var b = y[f];
if (b && !b.match(hostnamePartPattern)) {
for (var x = "", _ = 0, E = b.length; _ < E; _++)
b.charCodeAt(_) > 127 ? x += "x" : x += b[_];
if (!x.match(hostnamePartPattern)) {
var T = y.slice(0, f)
, C = y.slice(f + 1)
, S = b.match(hostnamePartStart);
S && (T.push(S[1]),
C.unshift(S[2])),
C.length && (s = "/" + C.join(".") + s),
this.hostname = T.join(".");
break
}
}
}
this.hostname.length > hostnameMaxLen ? this.hostname = "" :
this.hostname = this.hostname.toLowerCase(),
g || (this.hostname = punycode.toASCII(this.hostname));
var $ = this.port ? ":" + this.port : ""
, w = this.hostname || "";
this.host = w + $,
this.href += this.host,
g && (this.hostname = this.hostname.substr(1, this.hostname.length
- 2),
"/" !== s[0] && (s = "/" + s))
}
if (!unsafeProtocol[c])
for (f = 0,
v = autoEscape.length; f < v; f++) {
var P = autoEscape[f];
if (-1 !== s.indexOf(P)) {
var R = encodeURIComponent(P);
R === P && (R = escape(P)),
s = s.split(P).join(R)
}
}
var k = s.indexOf("#");
-1 !== k && (this.hash = s.substr(k),
s = s.slice(0, k));
var A = s.indexOf("?");
if (-1 !== A ? (this.search = s.substr(A),
this.query = s.substr(A + 1),
t && (this.query = querystring.parse(this.query)),
s = s.slice(0, A)) : t && (this.search = "",
this.query = {}),
s && (this.pathname = s),
slashedProtocol[c] && this.hostname && !this.pathname && (this.pathname
= "/"),
this.pathname || this.search) {
$ = this.pathname || "";
var I = this.search || "";
this.path = $ + I
}
return this.href = this.format(),
this
}
,
Url.prototype.format = function() {
var e = this.auth || "";
e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
e += "@");
var t = this.protocol || ""
, r = this.pathname || ""
, n = this.hash || ""
, i = !1
, o = "";
this.host ? i = e + this.host : this.hostname && (i = e + (-1 ===
this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
this.port && (i += ":" + this.port)),
this.query && "object" == typeof this.query &&
Object.keys(this.query).length && (o = querystring.stringify(this.query, {
arrayFormat: "repeat",
addQueryPrefix: !1
}));
var s = this.search || o && "?" + o || "";
return t && ":" !== t.substr(-1) && (t += ":"),
this.slashes || (!t || slashedProtocol[t]) && !1 !== i ? (i = "//" + (i
|| ""),
r && "/" !== r.charAt(0) && (r = "/" + r)) : i || (i = ""),
n && "#" !== n.charAt(0) && (n = "#" + n),
s && "?" !== s.charAt(0) && (s = "?" + s),
t + i + (r = r.replace(/[?#]/g, (function(e) {
return encodeURIComponent(e)
}
))) + (s = s.replace("#", "%23")) + n
}
,
Url.prototype.resolve = function(e) {
return this.resolveObject(urlParse(e, !1, !0)).format()
}
,
Url.prototype.resolveObject = function(e) {
if ("string" == typeof e) {
var t = new Url;
t.parse(e, !1, !0),
e = t
}
for (var r = new Url, n = Object.keys(this), i = 0; i < n.length; i++)
{
var o = n[i];
r[o] = this[o]
}
if (r.hash = e.hash,
"" === e.href)
return r.href = r.format(),
r;
if (e.slashes && !e.protocol) {
for (var s = Object.keys(e), a = 0; a < s.length; a++) {
var l = s[a];
"protocol" !== l && (r[l] = e[l])
}
return slashedProtocol[r.protocol] && r.hostname && !r.pathname &&
(r.pathname = "/",
r.path = r.pathname),
r.href = r.format(),
r
}
if (e.protocol && e.protocol !== r.protocol) {
if (!slashedProtocol[e.protocol]) {
for (var c = Object.keys(e), u = 0; u < c.length; u++) {
var d = c[u];
r[d] = e[d]
}
return r.href = r.format(),
r
}
if (r.protocol = e.protocol,
e.host || hostlessProtocol[e.protocol])
r.pathname = e.pathname;
else {
for (var p = (e.pathname || "").split("/"); p.length && !
(e.host = p.shift()); )
;
e.host || (e.host = ""),
e.hostname || (e.hostname = ""),
"" !== p[0] && p.unshift(""),
p.length < 2 && p.unshift(""),
r.pathname = p.join("/")
}
if (r.search = e.search,
r.query = e.query,
r.host = e.host || "",
r.auth = e.auth,
r.hostname = e.hostname || e.host,
r.port = e.port,
r.pathname || r.search) {
var h = r.pathname || ""
, f = r.search || "";
r.path = h + f
}
return r.slashes = r.slashes || e.slashes,
r.href = r.format(),
r
}
var m = r.pathname && "/" === r.pathname.charAt(0)
, g = e.host || e.pathname && "/" === e.pathname.charAt(0)
, y = g || m || r.host && e.pathname
, v = y
, b = r.pathname && r.pathname.split("/") || []
, x = (p = e.pathname && e.pathname.split("/") || [],
r.protocol && !slashedProtocol[r.protocol]);
if (x && (r.hostname = "",
r.port = null,
r.host && ("" === b[0] ? b[0] = r.host : b.unshift(r.host)),
r.host = "",
e.protocol && (e.hostname = null,
e.port = null,
e.host && ("" === p[0] ? p[0] = e.host : p.unshift(e.host)),
e.host = null),
y = y && ("" === p[0] || "" === b[0])),
g)
r.host = e.host || "" === e.host ? e.host : r.host,
r.hostname = e.hostname || "" === e.hostname ? e.hostname :
r.hostname,
r.search = e.search,
r.query = e.query,
b = p;
else if (p.length)
b || (b = []),
b.pop(),
b = b.concat(p),
r.search = e.search,
r.query = e.query;
else if (null != e.search) {
if (x)
r.host = b.shift(),
r.hostname = r.host,
(S = !!(r.host && r.host.indexOf("@") > 0) &&
r.host.split("@")) && (r.auth = S.shift(),
r.hostname = S.shift(),
r.host = r.hostname);
return r.search = e.search,
r.query = e.query,
null === r.pathname && null === r.search || (r.path = (r.pathname ?
r.pathname : "") + (r.search ? r.search : "")),
r.href = r.format(),
r
}
if (!b.length)
return r.pathname = null,
r.search ? r.path = "/" + r.search : r.path = null,
r.href = r.format(),
r;
for (var _ = b.slice(-1)[0], E = (r.host || e.host || b.length > 1) &&
("." === _ || ".." === _) || "" === _, T = 0, C = b.length; C >= 0; C--)
"." === (_ = b[C]) ? b.splice(C, 1) : ".." === _ ? (b.splice(C, 1),
T++) : T && (b.splice(C, 1),
T--);
if (!y && !v)
for (; T--; T)
b.unshift("..");
!y || "" === b[0] || b[0] && "/" === b[0].charAt(0) || b.unshift(""),
E && "/" !== b.join("/").substr(-1) && b.push("");
var S, $ = "" === b[0] || b[0] && "/" === b[0].charAt(0);
x && (r.hostname = $ ? "" : b.length ? b.shift() : "",
r.host = r.hostname,
(S = !!(r.host && r.host.indexOf("@") > 0) && r.host.split("@")) &&
(r.auth = S.shift(),
r.hostname = S.shift(),
r.host = r.hostname));
return (y = y || r.host && b.length) && !$ && b.unshift(""),
b.length > 0 ? r.pathname = b.join("/") : (r.pathname = null,
r.path = null),
null === r.pathname && null === r.search || (r.path = (r.pathname ?
r.pathname : "") + (r.search ? r.search : "")),
r.auth = e.auth || r.auth,
r.slashes = r.slashes || e.slashes,
r.href = r.format(),
r
}
,
Url.prototype.parseHost = function() {
var e = this.host
, t = portPattern.exec(e);
t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
e = e.substr(0, e.length - t.length)),
e && (this.hostname = e)
}
;
const warnings = {};
function deprecation(e, t, r=3) {
if (warnings[t])
return;
let n = (new Error).stack;
typeof n > "u" || (n = n.split("\n").splice(r).join("\n"),
console.groupCollapsed),
warnings[t] = !0
}
function assertPath(e) {
if ("string" != typeof e)
throw new TypeError(`Path must be a string. Received $
{JSON.stringify(e)}`)
}
function removeUrlParams(e) {
return e.split("?")[0].split("#")[0]
}
function escapeRegExp(e) {
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
}
function replaceAll(e, t, r) {
return e.replace(new RegExp(escapeRegExp(t),"g"), r)
}
function normalizeStringPosix(e, t) {
let r = ""
, n = 0
, i = -1
, o = 0
, s = -1;
for (let a = 0; a <= e.length; ++a) {
if (a < e.length)
s = e.charCodeAt(a);
else {
if (47 === s)
break;
s = 47
}
if (47 === s) {
if (i !== a - 1 && 1 !== o)
if (i !== a - 1 && 2 === o) {
if (r.length < 2 || 2 !== n || 46 !==
r.charCodeAt(r.length - 1) || 46 !== r.charCodeAt(r.length - 2))
if (r.length > 2) {
const e = r.lastIndexOf("/");
if (e !== r.length - 1) {
-1 === e ? (r = "",
n = 0) : (r = r.slice(0, e),
n = r.length - 1 - r.lastIndexOf("/")),
i = a,
o = 0;
continue
}
} else if (2 === r.length || 1 === r.length) {
r = "",
n = 0,
i = a,
o = 0;
continue
}
t && (r.length > 0 ? r += "/.." : r = "..",
n = 2)
} else
r.length > 0 ? r += `/${e.slice(i + 1, a)}` : r =
e.slice(i + 1, a),
n = a - i - 1;
i = a,
o = 0
} else
46 === s && -1 !== o ? ++o : o = -1
}
return r
}
const path$1 = {
toPosix: e => replaceAll(e, "\\", "/"),
isUrl(e) {
return /^https?:/.test(this.toPosix(e))
},
isDataUrl: e => /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]
+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)
$/i.test(e),
isBlobUrl: e => e.startsWith("blob:"),
hasProtocol(e) {
return /^[^/:]+:/.test(this.toPosix(e))
},
getProtocol(e) {
assertPath(e),
e = this.toPosix(e);
const t = /^file:\/\/\//.exec(e);
if (t)
return t[0];
const r = /^[^/:]+:\/{0,2}/.exec(e);
return r ? r[0] : ""
},
toAbsolute(e, t, r) {
if (assertPath(e),
this.isDataUrl(e) || this.isBlobUrl(e))
return e;
const n = removeUrlParams(this.toPosix(t ??
settings.ADAPTER.getBaseUrl()))
, i = removeUrlParams(this.toPosix(r ?? this.rootname(n)));
return (e = this.toPosix(e)).startsWith("/") ? path$1.join(i,
e.slice(1)) : this.isAbsolute(e) ? e : this.join(n, e)
},
normalize(e) {
if (assertPath(e),
0 === e.length)
return ".";
if (this.isDataUrl(e) || this.isBlobUrl(e))
return e;
let t = "";
const r = (e = this.toPosix(e)).startsWith("/");
this.hasProtocol(e) && (t = this.rootname(e),
e = e.slice(t.length));
const n = e.endsWith("/");
return (e = normalizeStringPosix(e, !1)).length > 0 && n && (e +=
"/"),
r ? `/${e}` : t + e
},
isAbsolute(e) {
return assertPath(e),
e = this.toPosix(e),
!!this.hasProtocol(e) || e.startsWith("/")
},
join(...e) {
if (0 === e.length)
return ".";
let t;
for (let r = 0; r < e.length; ++r) {
const n = e[r];
if (assertPath(n),
n.length > 0)
if (void 0 === t)
t = n;
else {
const i = e[r - 1] ?? "";
this.joinExtensions.includes(this.extname(i).toLowerCase()) ? t += `/../${n}` : t
+= `/${n}`
}
}
return void 0 === t ? "." : this.normalize(t)
},
dirname(e) {
if (assertPath(e),
0 === e.length)
return ".";
let t = (e = this.toPosix(e)).charCodeAt(0);
const r = 47 === t;
let n = -1
, i = !0;
const o = this.getProtocol(e)
, s = e;
for (let a = (e = e.slice(o.length)).length - 1; a >= 1; --a)
if (t = e.charCodeAt(a),
47 === t) {
if (!i) {
n = a;
break
}
} else
i = !1;
return -1 === n ? r ? "/" : this.isUrl(s) ? o + e : o : r && 1 ===
n ? "//" : o + e.slice(0, n)
},
rootname(e) {
assertPath(e);
let t = "";
if (t = (e = this.toPosix(e)).startsWith("/") ? "/" :
this.getProtocol(e),
this.isUrl(e)) {
const r = e.indexOf("/", t.length);
t = -1 !== r ? e.slice(0, r) : e,
t.endsWith("/") || (t += "/")
}
return t
},
basename(e, t) {
assertPath(e),
t && assertPath(t),
e = removeUrlParams(this.toPosix(e));
let r, n = 0, i = -1, o = !0;
if (void 0 !== t && t.length > 0 && t.length <= e.length) {
if (t.length === e.length && t === e)
return "";
let s = t.length - 1
, a = -1;
for (r = e.length - 1; r >= 0; --r) {
const l = e.charCodeAt(r);
if (47 === l) {
if (!o) {
n = r + 1;
break
}
} else
-1 === a && (o = !1,
a = r + 1),
s >= 0 && (l === t.charCodeAt(s) ? -1 == --s && (i = r)
: (s = -1,
i = a))
}
return n === i ? i = a : -1 === i && (i = e.length),
e.slice(n, i)
}
for (r = e.length - 1; r >= 0; --r)
if (47 === e.charCodeAt(r)) {
if (!o) {
n = r + 1;
break
}
} else
-1 === i && (o = !1,
i = r + 1);
return -1 === i ? "" : e.slice(n, i)
},
extname(e) {
assertPath(e);
let t = -1
, r = 0
, n = -1
, i = !0
, o = 0;
for (let s = (e = removeUrlParams(this.toPosix(e))).length - 1; s
>= 0; --s) {
const a = e.charCodeAt(s);
if (47 !== a)
-1 === n && (i = !1,
n = s + 1),
46 === a ? -1 === t ? t = s : 1 !== o && (o = 1) : -1 !== t
&& (o = -1);
else if (!i) {
r = s + 1;
break
}
}
return -1 === t || -1 === n || 0 === o || 1 === o && t === n - 1 &&
t === r + 1 ? "" : e.slice(t, n)
},
parse(e) {
assertPath(e);
const t = {
root: "",
dir: "",
base: "",
ext: "",
name: ""
};
if (0 === e.length)
return t;
let r = (e = removeUrlParams(this.toPosix(e))).charCodeAt(0);
const n = this.isAbsolute(e);
let i;
t.root = this.rootname(e),
i = n || this.hasProtocol(e) ? 1 : 0;
let o = -1
, s = 0
, a = -1
, l = !0
, c = e.length - 1
, u = 0;
for (; c >= i; --c)
if (r = e.charCodeAt(c),
47 !== r)
-1 === a && (l = !1,
a = c + 1),
46 === r ? -1 === o ? o = c : 1 !== u && (u = 1) : -1 !== o
&& (u = -1);
else if (!l) {
s = c + 1;
break
}
return -1 === o || -1 === a || 0 === u || 1 === u && o === a - 1 &&
o === s + 1 ? -1 !== a && (t.base = t.name = 0 === s && n ? e.slice(1, a) :
e.slice(s, a)) : (0 === s && n ? (t.name = e.slice(1, o),
t.base = e.slice(1, a)) : (t.name = e.slice(s, o),
t.base = e.slice(s, a)),
t.ext = e.slice(o, a)),
t.dir = this.dirname(e),
t
},
sep: "/",
delimiter: ":",
joinExtensions: [".html"]
};
let promise, supported;
async function detectVideoAlphaMode() {
return promise ?? (promise = (async () => {
var e;
const t = document.createElement("canvas").getContext("webgl");
if (!t)
return ALPHA_MODES.UNPACK;
const r = await new Promise((e => {
const t = document.createElement("video");
t.onloadeddata = () => e(t),
t.onerror = () => e(null),
t.autoplay = !1,
t.crossOrigin = "anonymous",
t.preload = "auto",
t.src =
"data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAA
AAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1
OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GE
TGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA
5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0
VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH
0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///
4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",
t.load()
}
));
if (!r)
return ALPHA_MODES.UNPACK;
const n = t.createTexture();
t.bindTexture(t.TEXTURE_2D, n);
const i = t.createFramebuffer();
t.bindFramebuffer(t.FRAMEBUFFER, i),
t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0,
t.TEXTURE_2D, n, 0),
t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1),
t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL, t.NONE),
t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, r);
const o = new Uint8Array(4);
return t.readPixels(0, 0, 1, 1, t.RGBA, t.UNSIGNED_BYTE, o),
t.deleteFramebuffer(i),
t.deleteTexture(n),
null == (e = t.getExtension("WEBGL_lose_context")) ||
e.loseContext(),
o[0] <= o[3] ? ALPHA_MODES.PMA : ALPHA_MODES.UNPACK
}
)()),
promise
}
function isWebGLSupported() {
return typeof supported > "u" && (supported = function() {
var e;
const t = {
stencil: !0,
failIfMajorPerformanceCaveat:
settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT
};
try {
if (!settings.ADAPTER.getWebGLRenderingContext())
return !1;
const r = settings.ADAPTER.createCanvas();
let n = r.getContext("webgl", t) || r.getContext("experimental-
webgl", t);
const i = !!(null == (e = null == n ? void 0 :
n.getContextAttributes()) ? void 0 : e.stencil);
if (n) {
const e = n.getExtension("WEBGL_lose_context");
e && e.loseContext()
}
return n = null,
i
} catch {
return !1
}
}()),
supported
}
var r$9 = {
grad: .9,
turn: 360,
rad: 360 / (2 * Math.PI)
}
, t$8 = function(e) {
return "string" == typeof e ? e.length > 0 : "number" == typeof e
}
, n$d = function(e, t, r) {
return void 0 === t && (t = 0),
void 0 === r && (r = Math.pow(10, t)),
Math.round(r * e) / r + 0
}
, e$8 = function(e, t, r) {
return void 0 === t && (t = 0),
void 0 === r && (r = 1),
e > r ? r : e > t ? e : t
}
, u$9 = function(e) {
return (e = isFinite(e) ? e % 360 : 0) > 0 ? e : e + 360
}
, a$d = function(e) {
return {
r: e$8(e.r, 0, 255),
g: e$8(e.g, 0, 255),
b: e$8(e.b, 0, 255),
a: e$8(e.a)
}
}
, o$c = function(e) {
return {
r: n$d(e.r),
g: n$d(e.g),
b: n$d(e.b),
a: n$d(e.a, 3)
}
}
, i$g = /^#([0-9a-f]{3,8})$/i
, s$8 = function(e) {
var t = e.toString(16);
return t.length < 2 ? "0" + t : t
}
, h$4 = function(e) {
var t = e.r
, r = e.g
, n = e.b
, i = e.a
, o = Math.max(t, r, n)
, s = o - Math.min(t, r, n)
, a = s ? o === t ? (r - n) / s : o === r ? 2 + (n - t) / s : 4 + (t
- r) / s : 0;
return {
h: 60 * (a < 0 ? a + 6 : a),
s: o ? s / o * 100 : 0,
v: o / 255 * 100,
a: i
}
}
, b$4 = function(e) {
var t = e.h
, r = e.s
, n = e.v
, i = e.a;
t = t / 360 * 6,
r /= 100,
n /= 100;
var o = Math.floor(t)
, s = n * (1 - r)
, a = n * (1 - (t - o) * r)
, l = n * (1 - (1 - t + o) * r)
, c = o % 6;
return {
r: 255 * [n, a, s, s, l, n][c],
g: 255 * [l, n, n, a, s, s][c],
b: 255 * [s, s, l, n, n, a][c],
a: i
}
}
, g$4 = function(e) {
return {
h: u$9(e.h),
s: e$8(e.s, 0, 100),
l: e$8(e.l, 0, 100),
a: e$8(e.a)
}
}
, d$5 = function(e) {
return {
h: n$d(e.h),
s: n$d(e.s),
l: n$d(e.l),
a: n$d(e.a, 3)
}
}
, f$5 = function(e) {
return b$4((r = (t = e).s,
{
h: t.h,
s: (r *= ((n = t.l) < 50 ? n : 100 - n) / 100) > 0 ? 2 * r / (n +
r) * 100 : 0,
v: n + r,
a: t.a
}));
var t, r, n
}
, c$c = function(e) {
return {
h: (t = h$4(e)).h,
s: (i = (200 - (r = t.s)) * (n = t.v) / 100) > 0 && i < 200 ? r * n
/ 100 / (i <= 100 ? i : 200 - i) * 100 : 0,
l: i / 2,
a: t.a
};
var t, r, n, i
}
, l$a = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\
d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i
, p$4 = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\
d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i
, v$4 = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\
s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i
, m$5 = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\
d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i
, y$3 = {
string: [[function(e) {
var t = i$g.exec(e);
return t ? (e = t[1]).length <= 4 ? {
r: parseInt(e[0] + e[0], 16),
g: parseInt(e[1] + e[1], 16),
b: parseInt(e[2] + e[2], 16),
a: 4 === e.length ? n$d(parseInt(e[3] + e[3], 16) / 255, 2) : 1
} : 6 === e.length || 8 === e.length ? {
r: parseInt(e.substr(0, 2), 16),
g: parseInt(e.substr(2, 2), 16),
b: parseInt(e.substr(4, 2), 16),
a: 8 === e.length ? n$d(parseInt(e.substr(6, 2), 16) / 255,
2) : 1
} : null : null
}
, "hex"], [function(e) {
var t = v$4.exec(e) || m$5.exec(e);
return t ? t[2] !== t[4] || t[4] !== t[6] ? null : a$d({
r: Number(t[1]) / (t[2] ? 100 / 255 : 1),
g: Number(t[3]) / (t[4] ? 100 / 255 : 1),
b: Number(t[5]) / (t[6] ? 100 / 255 : 1),
a: void 0 === t[7] ? 1 : Number(t[7]) / (t[8] ? 100 : 1)
}) : null
}
, "rgb"], [function(e) {
var t = l$a.exec(e) || p$4.exec(e);
if (!t)
return null;
var r, n, i = g$4({
h: (r = t[1],
n = t[2],
void 0 === n && (n = "deg"),
Number(r) * (r$9[n] || 1)),
s: Number(t[3]),
l: Number(t[4]),
a: void 0 === t[5] ? 1 : Number(t[5]) / (t[6] ? 100 : 1)
});
return f$5(i)
}
, "hsl"]],
object: [[function(e) {
var t = e.r
, r = e.g
, n = e.b
, i = e.a
, o = void 0 === i ? 1 : i;
return t$8(t) && t$8(r) && t$8(n) ? a$d({
r: Number(t),
g: Number(r),
b: Number(n),
a: Number(o)
}) : null
}
, "rgb"], [function(e) {
var t = e.h
, r = e.s
, n = e.l
, i = e.a
, o = void 0 === i ? 1 : i;
if (!t$8(t) || !t$8(r) || !t$8(n))
return null;
var s = g$4({
h: Number(t),
s: Number(r),
l: Number(n),
a: Number(o)
});
return f$5(s)
}
, "hsl"], [function(e) {
var t = e.h
, r = e.s
, n = e.v
, i = e.a
, o = void 0 === i ? 1 : i;
if (!t$8(t) || !t$8(r) || !t$8(n))
return null;
var s, a = (s = {
h: Number(t),
s: Number(r),
v: Number(n),
a: Number(o)
},
{
h: u$9(s.h),
s: e$8(s.s, 0, 100),
v: e$8(s.v, 0, 100),
a: e$8(s.a)
});
return b$4(a)
}
, "hsv"]]
}
, N$2 = function(e, t) {
for (var r = 0; r < t.length; r++) {
var n = t[r][0](e);
if (n)
return [n, t[r][1]]
}
return [null, void 0]
}
, x$5 = function(e) {
return "string" == typeof e ? N$2(e.trim(), y$3.string) : "object" ==
typeof e && null !== e ? N$2(e, y$3.object) : [null, void 0]
}
, M$2 = function(e, t) {
var r = c$c(e);
return {
h: r.h,
s: e$8(r.s + 100 * t, 0, 100),
l: r.l,
a: r.a
}
}
, H$1 = function(e) {
return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255
}
, $$2 = function(e, t) {
var r = c$c(e);
return {
h: r.h,
s: r.s,
l: e$8(r.l + 100 * t, 0, 100),
a: r.a
}
}
, j$2 = function() {
function e(e) {
this.parsed = x$5(e)[0],
this.rgba = this.parsed || {
r: 0,
g: 0,
b: 0,
a: 1
}
}
return e.prototype.isValid = function() {
return null !== this.parsed
}
,
e.prototype.brightness = function() {
return n$d(H$1(this.rgba), 2)
}
,
e.prototype.isDark = function() {
return H$1(this.rgba) < .5
}
,
e.prototype.isLight = function() {
return H$1(this.rgba) >= .5
}
,
e.prototype.toHex = function() {
return t = (e = o$c(this.rgba)).r,
r = e.g,
n = e.b,
o = (i = e.a) < 1 ? s$8(n$d(255 * i)) : "",
"#" + s$8(t) + s$8(r) + s$8(n) + o;
var e, t, r, n, i, o
}
,
e.prototype.toRgb = function() {
return o$c(this.rgba)
}
,
e.prototype.toRgbString = function() {
return t = (e = o$c(this.rgba)).r,
r = e.g,
n = e.b,
(i = e.a) < 1 ? "rgba(" + t + ", " + r + ", " + n + ", " + i +
")" : "rgb(" + t + ", " + r + ", " + n + ")";
var e, t, r, n, i
}
,
e.prototype.toHsl = function() {
return d$5(c$c(this.rgba))
}
,
e.prototype.toHslString = function() {
return t = (e = d$5(c$c(this.rgba))).h,
r = e.s,
n = e.l,
(i = e.a) < 1 ? "hsla(" + t + ", " + r + "%, " + n + "%, " + i +
")" : "hsl(" + t + ", " + r + "%, " + n + "%)";
var e, t, r, n, i
}
,
e.prototype.toHsv = function() {
return e = h$4(this.rgba),
{
h: n$d(e.h),
s: n$d(e.s),
v: n$d(e.v),
a: n$d(e.a, 3)
};
var e
}
,
e.prototype.invert = function() {
return w$2({
r: 255 - (e = this.rgba).r,
g: 255 - e.g,
b: 255 - e.b,
a: e.a
});
var e
}
,
e.prototype.saturate = function(e) {
return void 0 === e && (e = .1),
w$2(M$2(this.rgba, e))
}
,
e.prototype.desaturate = function(e) {
return void 0 === e && (e = .1),
w$2(M$2(this.rgba, -e))
}
,
e.prototype.grayscale = function() {
return w$2(M$2(this.rgba, -1))
}
,
e.prototype.lighten = function(e) {
return void 0 === e && (e = .1),
w$2($$2(this.rgba, e))
}
,
e.prototype.darken = function(e) {
return void 0 === e && (e = .1),
w$2($$2(this.rgba, -e))
}
,
e.prototype.rotate = function(e) {
return void 0 === e && (e = 15),
this.hue(this.hue() + e)
}
,
e.prototype.alpha = function(e) {
return "number" == typeof e ? w$2({
r: (t = this.rgba).r,
g: t.g,
b: t.b,
a: e
}) : n$d(this.rgba.a, 3);
var t
}
,
e.prototype.hue = function(e) {
var t = c$c(this.rgba);
return "number" == typeof e ? w$2({
h: e,
s: t.s,
l: t.l,
a: t.a
}) : n$d(t.h)
}
,
e.prototype.isEqual = function(e) {
return this.toHex() === w$2(e).toHex()
}
,
e
}()
, w$2 = function(e) {
return e instanceof j$2 ? e : new j$2(e)
}
, S$2 = []
, k$2 = function(e) {
e.forEach((function(e) {
S$2.indexOf(e) < 0 && (e(j$2, y$3),
S$2.push(e))
}
))
};
function namesPlugin(e, t) {
var r = {
white: "#ffffff",
bisque: "#ffe4c4",
blue: "#0000ff",
cadetblue: "#5f9ea0",
chartreuse: "#7fff00",
chocolate: "#d2691e",
coral: "#ff7f50",
antiquewhite: "#faebd7",
aqua: "#00ffff",
azure: "#f0ffff",
whitesmoke: "#f5f5f5",
papayawhip: "#ffefd5",
plum: "#dda0dd",
blanchedalmond: "#ffebcd",
black: "#000000",
gold: "#ffd700",
goldenrod: "#daa520",
gainsboro: "#dcdcdc",
cornsilk: "#fff8dc",
cornflowerblue: "#6495ed",
burlywood: "#deb887",
aquamarine: "#7fffd4",
beige: "#f5f5dc",
crimson: "#dc143c",
cyan: "#00ffff",
darkblue: "#00008b",
darkcyan: "#008b8b",
darkgoldenrod: "#b8860b",
darkkhaki: "#bdb76b",
darkgray: "#a9a9a9",
darkgreen: "#006400",
darkgrey: "#a9a9a9",
peachpuff: "#ffdab9",
darkmagenta: "#8b008b",
darkred: "#8b0000",
darkorchid: "#9932cc",
darkorange: "#ff8c00",
darkslateblue: "#483d8b",
gray: "#808080",
darkslategray: "#2f4f4f",
darkslategrey: "#2f4f4f",
deeppink: "#ff1493",
deepskyblue: "#00bfff",
wheat: "#f5deb3",
firebrick: "#b22222",
floralwhite: "#fffaf0",
ghostwhite: "#f8f8ff",
darkviolet: "#9400d3",
magenta: "#ff00ff",
green: "#008000",
dodgerblue: "#1e90ff",
grey: "#808080",
honeydew: "#f0fff0",
hotpink: "#ff69b4",
blueviolet: "#8a2be2",
forestgreen: "#228b22",
lawngreen: "#7cfc00",
indianred: "#cd5c5c",
indigo: "#4b0082",
fuchsia: "#ff00ff",
brown: "#a52a2a",
maroon: "#800000",
mediumblue: "#0000cd",
lightcoral: "#f08080",
darkturquoise: "#00ced1",
lightcyan: "#e0ffff",
ivory: "#fffff0",
lightyellow: "#ffffe0",
lightsalmon: "#ffa07a",
lightseagreen: "#20b2aa",
linen: "#faf0e6",
mediumaquamarine: "#66cdaa",
lemonchiffon: "#fffacd",
lime: "#00ff00",
khaki: "#f0e68c",
mediumseagreen: "#3cb371",
limegreen: "#32cd32",
mediumspringgreen: "#00fa9a",
lightskyblue: "#87cefa",
lightblue: "#add8e6",
midnightblue: "#191970",
lightpink: "#ffb6c1",
mistyrose: "#ffe4e1",
moccasin: "#ffe4b5",
mintcream: "#f5fffa",
lightslategray: "#778899",
lightslategrey: "#778899",
navajowhite: "#ffdead",
navy: "#000080",
mediumvioletred: "#c71585",
powderblue: "#b0e0e6",
palegoldenrod: "#eee8aa",
oldlace: "#fdf5e6",
paleturquoise: "#afeeee",
mediumturquoise: "#48d1cc",
mediumorchid: "#ba55d3",
rebeccapurple: "#663399",
lightsteelblue: "#b0c4de",
mediumslateblue: "#7b68ee",
thistle: "#d8bfd8",
tan: "#d2b48c",
orchid: "#da70d6",
mediumpurple: "#9370db",
purple: "#800080",
pink: "#ffc0cb",
skyblue: "#87ceeb",
springgreen: "#00ff7f",
palegreen: "#98fb98",
red: "#ff0000",
yellow: "#ffff00",
slateblue: "#6a5acd",
lavenderblush: "#fff0f5",
peru: "#cd853f",
palevioletred: "#db7093",
violet: "#ee82ee",
teal: "#008080",
slategray: "#708090",
slategrey: "#708090",
aliceblue: "#f0f8ff",
darkseagreen: "#8fbc8f",
darkolivegreen: "#556b2f",
greenyellow: "#adff2f",
seagreen: "#2e8b57",
seashell: "#fff5ee",
tomato: "#ff6347",
silver: "#c0c0c0",
sienna: "#a0522d",
lavender: "#e6e6fa",
lightgreen: "#90ee90",
orange: "#ffa500",
orangered: "#ff4500",
steelblue: "#4682b4",
royalblue: "#4169e1",
turquoise: "#40e0d0",
yellowgreen: "#9acd32",
salmon: "#fa8072",
saddlebrown: "#8b4513",
sandybrown: "#f4a460",
rosybrown: "#bc8f8f",
darksalmon: "#e9967a",
lightgoldenrodyellow: "#fafad2",
snow: "#fffafa",
lightgrey: "#d3d3d3",
lightgray: "#d3d3d3",
dimgray: "#696969",
dimgrey: "#696969",
olivedrab: "#6b8e23",
olive: "#808000"
}
, n = {};
for (var i in r)
n[r[i]] = i;
var o = {};
e.prototype.toName = function(t) {
if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b))
return "transparent";
var i, s, a = n[this.toHex()];
if (a)
return a;
if (null == t ? void 0 : t.closest) {
var l = this.toRgb()
, c = 1 / 0
, u = "black";
if (!o.length)
for (var d in r)
o[d] = new e(r[d]).toRgb();
for (var p in r) {
var h = (i = l,
s = o[p],
Math.pow(i.r - s.r, 2) + Math.pow(i.g - s.g, 2) +
Math.pow(i.b - s.b, 2));
h < c && (c = h,
u = p)
}
return u
}
}
,
t.string.push([function(t) {
var n = t.toLowerCase()
, i = "transparent" === n ? "#0000" : r[n];
return i ? new e(i).toRgb() : null
}
, "name"])
}
k$2([namesPlugin]);
const _Color = class e {
constructor(e=16777215) {
this._value = null,
this._components = new Float32Array(4),
this._components.fill(1),
this._int = 16777215,
this.value = e
}
get red() {
return this._components[0]
}
get green() {
return this._components[1]
}
get blue() {
return this._components[2]
}
get alpha() {
return this._components[3]
}
setValue(e) {
return this.value = e,
this
}
set value(t) {
if (t instanceof e)
this._value = this.cloneSource(t._value),
this._int = t._int,
this._components.set(t._components);
else {
if (null === t)
throw new Error("Cannot set PIXI.Color#value to null");
(null === this._value || !this.isSourceEqual(this._value, t))
&& (this.normalize(t),
this._value = this.cloneSource(t))
}
}
get value() {
return this._value
}
cloneSource(e) {
return "string" == typeof e || "number" == typeof e || e instanceof
Number || null === e ? e : Array.isArray(e) || ArrayBuffer.isView(e) ? e.slice(0) :
"object" == typeof e && null !== e ? {
...e
} : e
}
isSourceEqual(e, t) {
const r = typeof e;
if (r !== typeof t)
return !1;
if ("number" === r || "string" === r || e instanceof Number)
return e === t;
if (Array.isArray(e) && Array.isArray(t) || ArrayBuffer.isView(e)
&& ArrayBuffer.isView(t))
return e.length === t.length && e.every(( (e, r) => e ===
t[r]));
if (null !== e && null !== t) {
const r = Object.keys(e)
, n = Object.keys(t);
return r.length === n.length && r.every((r => e[r] === t[r]))
}
return e === t
}
toRgba() {
const [e,t,r,n] = this._components;
return {
r: e,
g: t,
b: r,
a: n
}
}
toRgb() {
const [e,t,r] = this._components;
return {
r: e,
g: t,
b: r
}
}
toRgbaString() {
const [e,t,r] = this.toUint8RgbArray();
return `rgba(${e},${t},${r},${this.alpha})`
}
toUint8RgbArray(e) {
const [t,r,n] = this._components;
return (e = e ?? [])[0] = Math.round(255 * t),
e[1] = Math.round(255 * r),
e[2] = Math.round(255 * n),
e
}
toRgbArray(e) {
e = e ?? [];
const [t,r,n] = this._components;
return e[0] = t,
e[1] = r,
e[2] = n,
e
}
toNumber() {
return this._int
}
toLittleEndianNumber() {
const e = this._int;
return (e >> 16) + (65280 & e) + ((255 & e) << 16)
}
multiply(t) {
const [r,n,i,o] = e.temp.setValue(t)._components;
return this._components[0] *= r,
this._components[1] *= n,
this._components[2] *= i,
this._components[3] *= o,
this.refreshInt(),
this._value = null,
this
}
premultiply(e, t=!0) {
return t && (this._components[0] *= e,
this._components[1] *= e,
this._components[2] *= e),
this._components[3] = e,
this.refreshInt(),
this._value = null,
this
}
toPremultiplied(e, t=!0) {
if (1 === e)
return (255 << 24) + this._int;
if (0 === e)
return t ? 0 : this._int;
let r = this._int >> 16 & 255
, n = this._int >> 8 & 255
, i = 255 & this._int;
return t && (r = r * e + .5 | 0,
n = n * e + .5 | 0,
i = i * e + .5 | 0),
(255 * e << 24) + (r << 16) + (n << 8) + i
}
toHex() {
const e = this._int.toString(16);
return `#${"000000".substring(0, 6 - e.length) + e}`
}
toHexa() {
const e = Math.round(255 * this._components[3]).toString(16);
return this.toHex() + "00".substring(0, 2 - e.length) + e
}
setAlpha(e) {
return this._components[3] = this._clamp(e),
this
}
round(e) {
const [t,r,n] = this._components;
return this._components[0] = Math.round(t * e) / e,
this._components[1] = Math.round(r * e) / e,
this._components[2] = Math.round(n * e) / e,
this.refreshInt(),
this._value = null,
this
}
toArray(e) {
e = e ?? [];
const [t,r,n,i] = this._components;
return e[0] = t,
e[1] = r,
e[2] = n,
e[3] = i,
e
}
normalize(t) {
let r, n, i, o;
if (("number" == typeof t || t instanceof Number) && t >= 0 && t <=
16777215) {
r = (t >> 16 & 255) / 255,
n = (t >> 8 & 255) / 255,
i = (255 & t) / 255,
o = 1
} else if ((Array.isArray(t) || t instanceof Float32Array) &&
t.length >= 3 && t.length <= 4)
t = this._clamp(t),
[r,n,i,o=1] = t;
else if ((t instanceof Uint8Array || t instanceof
Uint8ClampedArray) && t.length >= 3 && t.length <= 4)
t = this._clamp(t, 0, 255),
[r,n,i,o=255] = t,
r /= 255,
n /= 255,
i /= 255,
o /= 255;
else if ("string" == typeof t || "object" == typeof t) {
if ("string" == typeof t) {
const r = e.HEX_PATTERN.exec(t);
r && (t = `#${r[2]}`)
}
const s = w$2(t);
s.isValid() && (({r: r, g: n, b: i, a: o} = s.rgba),
r /= 255,
n /= 255,
i /= 255)
}
if (void 0 === r)
throw new Error(`Unable to convert color ${t}`);
this._components[0] = r,
this._components[1] = n,
this._components[2] = i,
this._components[3] = o,
this.refreshInt()
}
refreshInt() {
this._clamp(this._components);
const [e,t,r] = this._components;
this._int = (255 * e << 16) + (255 * t << 8) + (255 * r | 0)
}
_clamp(e, t=0, r=1) {
return "number" == typeof e ? Math.min(Math.max(e, t), r) :
(e.forEach(( (n, i) => {
e[i] = Math.min(Math.max(n, t), r)
}
)),
e)
}
}
;
_Color.shared = new _Color,
_Color.temp = new _Color,
_Color.HEX_PATTERN = /^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;
let Color$2 = _Color;
function hex2rgb(e, t=[]) {
return deprecation("7.2.0", "utils.hex2rgb is deprecated, use
Color#toRgbArray instead"),
Color$2.shared.setValue(e).toRgbArray(t)
}
function hex2string(e) {
return deprecation("7.2.0", "utils.hex2string is deprecated, use
Color#toHex instead"),
Color$2.shared.setValue(e).toHex()
}
function string2hex(e) {
return deprecation("7.2.0", "utils.string2hex is deprecated, use
Color#toNumber instead"),
Color$2.shared.setValue(e).toNumber()
}
function rgb2hex(e) {
return deprecation("7.2.0", "utils.rgb2hex is deprecated, use
Color#toNumber instead"),
Color$2.shared.setValue(e).toNumber()
}
function mapPremultipliedBlendModes() {
const e = []
, t = [];
for (let n = 0; n < 32; n++)
e[n] = n,
t[n] = n;
e[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL,
e[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD,
e[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN,
t[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM,
t[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM,
t[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM;
const r = [];
return r.push(t),
r.push(e),
r
}
const premultiplyBlendMode = mapPremultipliedBlendModes();
function correctBlendMode(e, t) {
return premultiplyBlendMode[t ? 1 : 0][e]
}
function createIndicesForQuads(e, t=null) {
const r = 6 * e;
if ((t = t || new Uint16Array(r)).length !== r)
throw new Error(`Out buffer length is incorrect, got ${t.length}
and expected ${r}`);
for (let n = 0, i = 0; n < r; n += 6,
i += 4)
t[n + 0] = i + 0,
t[n + 1] = i + 1,
t[n + 2] = i + 2,
t[n + 3] = i + 0,
t[n + 4] = i + 2,
t[n + 5] = i + 3;
return t
}
function getBufferType(e) {
if (4 === e.BYTES_PER_ELEMENT)
return e instanceof Float32Array ? "Float32Array" : e instanceof
Uint32Array ? "Uint32Array" : "Int32Array";
if (2 === e.BYTES_PER_ELEMENT) {
if (e instanceof Uint16Array)
return "Uint16Array"
} else if (1 === e.BYTES_PER_ELEMENT && e instanceof Uint8Array)
return "Uint8Array";
return null
}
function nextPow2(e) {
return e += 0 === e ? 1 : 0,
--e,
e |= e >>> 1,
e |= e >>> 2,
e |= e >>> 4,
e |= e >>> 8,
(e |= e >>> 16) + 1
}
function isPow2(e) {
return !(e & e - 1 || !e)
}
function log2(e) {
let t = (e > 65535 ? 1 : 0) << 4
, r = ((e >>>= t) > 255 ? 1 : 0) << 3;
return t |= r,
r = ((e >>>= r) > 15 ? 1 : 0) << 2,
t |= r,
r = ((e >>>= r) > 3 ? 1 : 0) << 1,
t |= r,
t | (e >>>= r) >> 1
}
function removeItems(e, t, r) {
const n = e.length;
let i;
if (t >= n || 0 === r)
return;
const o = n - (r = t + r > n ? n - t : r);
for (i = t; i < o; ++i)
e[i] = e[i + r];
e.length = o
}
function sign$1(e) {
return 0 === e ? 0 : e < 0 ? -1 : 1
}
let nextUid = 0;
function uid() {
return ++nextUid
}
const _BoundingBox = class {
constructor(e, t, r, n) {
this.left = e,
this.top = t,
this.right = r,
this.bottom = n
}
get width() {
return this.right - this.left
}
get height() {
return this.bottom - this.top
}
isEmpty() {
return this.left === this.right || this.top === this.bottom
}
}
;
_BoundingBox.EMPTY = new _BoundingBox(0,0,0,0);
let BoundingBox = _BoundingBox;
const ProgramCache = {}
, TextureCache = Object.create(null)
, BaseTextureCache = Object.create(null);
class CanvasRenderTarget {
constructor(e, t, r) {
this._canvas = settings.ADAPTER.createCanvas(),
this._context = this._canvas.getContext("2d"),
this.resolution = r || settings.RESOLUTION,
this.resize(e, t)
}
clear() {
this._checkDestroyed(),
this._context.setTransform(1, 0, 0, 1, 0, 0),
this._context.clearRect(0, 0, this._canvas.width,
this._canvas.height)
}
resize(e, t) {
this._checkDestroyed(),
this._canvas.width = Math.round(e * this.resolution),
this._canvas.height = Math.round(t * this.resolution)
}
destroy() {
this._context = null,
this._canvas = null
}
get width() {
return this._checkDestroyed(),
this._canvas.width
}
set width(e) {
this._checkDestroyed(),
this._canvas.width = Math.round(e)
}
get height() {
return this._checkDestroyed(),
this._canvas.height
}
set height(e) {
this._checkDestroyed(),
this._canvas.height = Math.round(e)
}
get canvas() {
return this._checkDestroyed(),
this._canvas
}
get context() {
return this._checkDestroyed(),
this._context
}
_checkDestroyed() {
if (null === this._canvas)
throw new TypeError("The CanvasRenderTarget has already been
destroyed")
}
}
function checkRow(e, t, r) {
for (let n = 0, i = 4 * r * t; n < t; ++n,
i += 4)
if (0 !== e[i + 3])
return !1;
return !0
}
function checkColumn(e, t, r, n, i) {
const o = 4 * t;
for (let s = n, a = n * o + 4 * r; s <= i; ++s,
a += o)
if (0 !== e[a + 3])
return !1;
return !0
}
function getCanvasBoundingBox(e) {
const {width: t, height: r} = e
, n = e.getContext("2d", {
willReadFrequently: !0
});
if (null === n)
throw new TypeError("Failed to get canvas 2D context");
const i = n.getImageData(0, 0, t, r).data;
let o = 0
, s = 0
, a = t - 1
, l = r - 1;
for (; s < r && checkRow(i, t, s); )
++s;
if (s === r)
return BoundingBox.EMPTY;
for (; checkRow(i, t, l); )
--l;
for (; checkColumn(i, t, o, s, l); )
++o;
for (; checkColumn(i, t, a, s, l); )
--a;
return ++a,
++l,
new BoundingBox(o,s,a,l)
}
function trimCanvas(e) {
const t = getCanvasBoundingBox(e)
, {width: r, height: n} = t;
let i = null;
if (!t.isEmpty()) {
const o = e.getContext("2d");
if (null === o)
throw new TypeError("Failed to get canvas 2D context");
i = o.getImageData(t.left, t.top, r, n)
}
return {
width: r,
height: n,
data: i
}
}
function determineCrossOrigin(e, t=globalThis.location) {
if (e.startsWith("data:"))
return "";
t = t || globalThis.location;
const r = new URL(e,document.baseURI);
return r.hostname !== t.hostname || r.port !== t.port || r.protocol !==
t.protocol ? "anonymous" : ""
}
function getResolutionOfUrl(e, t=1) {
var r;
const n = null == (r = settings.RETINA_PREFIX) ? void 0 : r.exec(e);
return n ? parseFloat(n[1]) : t
}
var ExtensionType = (e => (e.Renderer = "renderer",
e.Application = "application",
e.RendererSystem = "renderer-webgl-system",
e.RendererPlugin = "renderer-webgl-plugin",
e.CanvasRendererSystem = "renderer-canvas-system",
e.CanvasRendererPlugin = "renderer-canvas-plugin",
e.Asset = "asset",
e.LoadParser = "load-parser",
e.ResolveParser = "resolve-parser",
e.CacheParser = "cache-parser",
e.DetectionParser = "detection-parser",
e))(ExtensionType || {});
const normalizeExtension = e => {
if ("function" == typeof e || "object" == typeof e && e.extension) {
if (!e.extension)
throw new Error("Extension class must have an extension
object");
e = {
..."object" != typeof e.extension ? {
type: e.extension
} : e.extension,
ref: e
}
}
if ("object" != typeof e)
throw new Error("Invalid extension type");
return "string" == typeof (e = {
...e
}).type && (e.type = [e.type]),
e
}
, normalizePriority = (e, t) => normalizeExtension(e).priority ?? t
, extensions$1 = {
_addHandlers: {},
_removeHandlers: {},
_queue: {},
remove(...e) {
return e.map(normalizeExtension).forEach((e => {
e.type.forEach((t => {
var r, n;
return null == (n = (r = this._removeHandlers)[t]) ? void 0
: n.call(r, e)
}
))
}
)),
this
},
add(...e) {
return e.map(normalizeExtension).forEach((e => {
e.type.forEach((t => {
var r, n;
const i = this._addHandlers
, o = this._queue;
i[t] ? null == (r = i[t]) || r.call(i, e) : (o[t] = o[t] ||
[],
null == (n = o[t]) || n.push(e))
}
))
}
)),
this
},
handle(e, t, r) {
var n;
const i = this._addHandlers
, o = this._removeHandlers;
if (i[e] || o[e])
throw new Error(`Extension type ${e} already has a handler`);
i[e] = t,
o[e] = r;
const s = this._queue;
return s[e] && (null == (n = s[e]) || n.forEach((e => t(e))),
delete s[e]),
this
},
handleByMap(e, t) {
return this.handle(e, (e => {
e.name && (t[e.name] = e.ref)
}
), (e => {
e.name && delete t[e.name]
}
))
},
handleByList(e, t, r=-1) {
return this.handle(e, (e => {
t.includes(e.ref) || (t.push(e.ref),
t.sort(( (e, t) => normalizePriority(t, r) -
normalizePriority(e, r))))
}
), (e => {
const r = t.indexOf(e.ref);
-1 !== r && t.splice(r, 1)
}
))
}
};
class ViewableBuffer {
constructor(e) {
"number" == typeof e ? this.rawBinaryData = new ArrayBuffer(e) : e
instanceof Uint8Array ? this.rawBinaryData = e.buffer : this.rawBinaryData = e,
this.uint32View = new Uint32Array(this.rawBinaryData),
this.float32View = new Float32Array(this.rawBinaryData)
}
get int8View() {
return this._int8View || (this._int8View = new
Int8Array(this.rawBinaryData)),
this._int8View
}
get uint8View() {
return this._uint8View || (this._uint8View = new
Uint8Array(this.rawBinaryData)),
this._uint8View
}
get int16View() {
return this._int16View || (this._int16View = new
Int16Array(this.rawBinaryData)),
this._int16View
}
get uint16View() {
return this._uint16View || (this._uint16View = new
Uint16Array(this.rawBinaryData)),
this._uint16View
}
get int32View() {
return this._int32View || (this._int32View = new
Int32Array(this.rawBinaryData)),
this._int32View
}
view(e) {
return this[`${e}View`]
}
destroy() {
this.rawBinaryData = null,
this._int8View = null,
this._uint8View = null,
this._int16View = null,
this._uint16View = null,
this._int32View = null,
this.uint32View = null,
this.float32View = null
}
static sizeOf(e) {
switch (e) {
case "int8":
case "uint8":
return 1;
case "int16":
case "uint16":
return 2;
case "int32":
case "uint32":
case "float32":
return 4;
default:
throw new Error(`${e} isn't a valid view type`)
}
}
}
const fragTemplate$1 = ["precision mediump float;", "void main(void){",
"float test = 0.1;", "%forloop%", "gl_FragColor = vec4(0.0);", "}"].join("\n");
function generateIfTestSrc(e) {
let t = "";
for (let r = 0; r < e; ++r)
r > 0 && (t += "\nelse "),
r < e - 1 && (t += `if(test == ${r}.0){}`);
return t
}
function checkMaxIfStatementsInShader(e, t) {
if (0 === e)
throw new Error("Invalid value of `0` passed to
`checkMaxIfStatementsInShader`");
const r = t.createShader(t.FRAGMENT_SHADER);
for (; ; ) {
const n = fragTemplate$1.replace(/%forloop%/gi,
generateIfTestSrc(e));
if (t.shaderSource(r, n),
t.compileShader(r),
t.getShaderParameter(r, t.COMPILE_STATUS))
break;
e = e / 2 | 0
}
return e
}
const BLEND$1 = 0
, OFFSET$1 = 1
, CULLING$1 = 2
, DEPTH_TEST$1 = 3
, WINDING$1 = 4
, DEPTH_MASK$1 = 5;
class State {
constructor() {
this.data = 0,
this.blendMode = BLEND_MODES.NORMAL,
this.polygonOffset = 0,
this.blend = !0,
this.depthMask = !0
}
get blend() {
return !!(this.data & 1 << BLEND$1)
}
set blend(e) {
!!(this.data & 1 << BLEND$1) !== e && (this.data ^= 1 << BLEND$1)
}
get offsets() {
return !!(this.data & 1 << OFFSET$1)
}
set offsets(e) {
!!(this.data & 1 << OFFSET$1) !== e && (this.data ^= 1 << OFFSET$1)
}
get culling() {
return !!(this.data & 1 << CULLING$1)
}
set culling(e) {
!!(this.data & 1 << CULLING$1) !== e && (this.data ^= 1 <<
CULLING$1)
}
get depthTest() {
return !!(this.data & 1 << DEPTH_TEST$1)
}
set depthTest(e) {
!!(this.data & 1 << DEPTH_TEST$1) !== e && (this.data ^= 1 <<
DEPTH_TEST$1)
}
get depthMask() {
return !!(this.data & 1 << DEPTH_MASK$1)
}
set depthMask(e) {
!!(this.data & 1 << DEPTH_MASK$1) !== e && (this.data ^= 1 <<
DEPTH_MASK$1)
}
get clockwiseFrontFace() {
return !!(this.data & 1 << WINDING$1)
}
set clockwiseFrontFace(e) {
!!(this.data & 1 << WINDING$1) !== e && (this.data ^= 1 <<
WINDING$1)
}
get blendMode() {
return this._blendMode
}
set blendMode(e) {
this.blend = e !== BLEND_MODES.NONE,
this._blendMode = e
}
get polygonOffset() {
return this._polygonOffset
}
set polygonOffset(e) {
this.offsets = !!e,
this._polygonOffset = e
}
static for2d() {
const e = new State;
return e.depthTest = !1,
e.blend = !0,
e
}
}
State.prototype.toString = function() {
return `[@pixi/core:State blendMode=${this.blendMode}
clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=$
{this.depthMask} polygonOffset=${this.polygonOffset}]`
}
;
const INSTALLED = [];
function autoDetectResource(e, t) {
if (!e)
return null;
let r = "";
if ("string" == typeof e) {
const t = /\.(\w{3,4})(?:$|\?|#)/i.exec(e);
t && (r = t[1].toLowerCase())
}
for (let n = INSTALLED.length - 1; n >= 0; --n) {
const i = INSTALLED[n];
if (i.test && i.test(e, r))
return new i(e,t)
}
throw new Error("Unrecognized source type to auto-detect Resource")
}
class Runner {
constructor(e) {
this.items = [],
this._name = e,
this._aliasCount = 0
}
emit(e, t, r, n, i, o, s, a) {
if (arguments.length > 8)
throw new Error("max arguments reached");
const {name: l, items: c} = this;
this._aliasCount++;
for (let u = 0, d = c.length; u < d; u++)
c[u][l](e, t, r, n, i, o, s, a);
return c === this.items && this._aliasCount--,
this
}
ensureNonAliasedItems() {
this._aliasCount > 0 && this.items.length > 1 && (this._aliasCount
= 0,
this.items = this.items.slice(0))
}
add(e) {
return e[this._name] && (this.ensureNonAliasedItems(),
this.remove(e),
this.items.push(e)),
this
}
remove(e) {
const t = this.items.indexOf(e);
return -1 !== t && (this.ensureNonAliasedItems(),
this.items.splice(t, 1)),
this
}
contains(e) {
return this.items.includes(e)
}
removeAll() {
return this.ensureNonAliasedItems(),
this.items.length = 0,
this
}
destroy() {
this.removeAll(),
this.items.length = 0,
this._name = ""
}
get empty() {
return 0 === this.items.length
}
get name() {
return this._name
}
}
Object.defineProperties(Runner.prototype, {
dispatch: {
value: Runner.prototype.emit
},
run: {
value: Runner.prototype.emit
}
});
class Resource {
constructor(e=0, t=0) {
this._width = e,
this._height = t,
this.destroyed = !1,
this.internal = !1,
this.onResize = new Runner("setRealSize"),
this.onUpdate = new Runner("update"),
this.onError = new Runner("onError")
}
bind(e) {
this.onResize.add(e),
this.onUpdate.add(e),
this.onError.add(e),
(this._width || this._height) && this.onResize.emit(this._width,
this._height)
}
unbind(e) {
this.onResize.remove(e),
this.onUpdate.remove(e),
this.onError.remove(e)
}
resize(e, t) {
(e !== this._width || t !== this._height) && (this._width = e,
this._height = t,
this.onResize.emit(e, t))
}
get valid() {
return !!this._width && !!this._height
}
update() {
this.destroyed || this.onUpdate.emit()
}
load() {
return Promise.resolve(this)
}
get width() {
return this._width
}
get height() {
return this._height
}
style(e, t, r) {
return !1
}
dispose() {}
destroy() {
this.destroyed || (this.destroyed = !0,
this.dispose(),
this.onError.removeAll(),
this.onError = null,
this.onResize.removeAll(),
this.onResize = null,
this.onUpdate.removeAll(),
this.onUpdate = null)
}
static test(e, t) {
return !1
}
}
class BufferResource extends Resource {
constructor(e, t) {
const {width: r, height: n} = t || {};
if (!r || !n)
throw new Error("BufferResource width or height invalid");
super(r, n),
this.data = e,
this.unpackAlignment = t.unpackAlignment ?? 4
}
upload(e, t, r) {
const n = e.gl;
n.pixelStorei(n.UNPACK_ALIGNMENT, this.unpackAlignment),
n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.alphaMode ===
ALPHA_MODES.UNPACK);
const i = t.realWidth
, o = t.realHeight;
return r.width === i && r.height === o ? n.texSubImage2D(t.target,
0, 0, 0, i, o, t.format, r.type, this.data) : (r.width = i,
r.height = o,
n.texImage2D(t.target, 0, r.internalFormat, i, o, 0, t.format,
r.type, this.data)),
!0
}
dispose() {
this.data = null
}
static test(e) {
return null === e || e instanceof Int8Array || e instanceof
Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int16Array || e
instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e
instanceof Float32Array
}
}
const defaultBufferOptions = {
scaleMode: SCALE_MODES.NEAREST,
alphaMode: ALPHA_MODES.NPM
}
, _BaseTexture = class e extends EventEmitter$2 {
constructor(t=null, r=null) {
super(),
r = Object.assign({}, e.defaultOptions, r);
const {alphaMode: n, mipmap: i, anisotropicLevel: o, scaleMode: s,
width: a, height: l, wrapMode: c, format: u, type: d, target: p, resolution: h,
resourceOptions: f} = r;
t && !(t instanceof Resource) && ((t = autoDetectResource(t,
f)).internal = !0),
this.resolution = h || settings.RESOLUTION,
this.width = Math.round((a || 0) * this.resolution) /
this.resolution,
this.height = Math.round((l || 0) * this.resolution) /
this.resolution,
this._mipmap = i,
this.anisotropicLevel = o,
this._wrapMode = c,
this._scaleMode = s,
this.format = u,
this.type = d,
this.target = p,
this.alphaMode = n,
this.uid = uid(),
this.touched = 0,
this.isPowerOfTwo = !1,
this._refreshPOT(),
this._glTextures = {},
this.dirtyId = 0,
this.dirtyStyleId = 0,
this.cacheId = null,
this.valid = a > 0 && l > 0,
this.textureCacheIds = [],
this.destroyed = !1,
this.resource = null,
this._batchEnabled = 0,
this._batchLocation = 0,
this.parentTextureArray = null,
this.setResource(t)
}
get realWidth() {
return Math.round(this.width * this.resolution)
}
get realHeight() {
return Math.round(this.height * this.resolution)
}
get mipmap() {
return this._mipmap
}
set mipmap(e) {
this._mipmap !== e && (this._mipmap = e,
this.dirtyStyleId++)
}
get scaleMode() {
return this._scaleMode
}
set scaleMode(e) {
this._scaleMode !== e && (this._scaleMode = e,
this.dirtyStyleId++)
}
get wrapMode() {
return this._wrapMode
}
set wrapMode(e) {
this._wrapMode !== e && (this._wrapMode = e,
this.dirtyStyleId++)
}
setStyle(e, t) {
let r;
return void 0 !== e && e !== this.scaleMode && (this.scaleMode = e,
r = !0),
void 0 !== t && t !== this.mipmap && (this.mipmap = t,
r = !0),
r && this.dirtyStyleId++,
this
}
setSize(e, t, r) {
return r = r || this.resolution,
this.setRealSize(e * r, t * r, r)
}
setRealSize(e, t, r) {
return this.resolution = r || this.resolution,
this.width = Math.round(e) / this.resolution,
this.height = Math.round(t) / this.resolution,
this._refreshPOT(),
this.update(),
this
}
_refreshPOT() {
this.isPowerOfTwo = isPow2(this.realWidth) &&
isPow2(this.realHeight)
}
setResolution(e) {
const t = this.resolution;
return t === e || (this.resolution = e,
this.valid && (this.width = Math.round(this.width * t) / e,
this.height = Math.round(this.height * t) / e,
this.emit("update", this)),
this._refreshPOT()),
this
}
setResource(e) {
if (this.resource === e)
return this;
if (this.resource)
throw new Error("Resource can be set only once");
return e.bind(this),
this.resource = e,
this
}
update() {
this.valid ? (this.dirtyId++,
this.dirtyStyleId++,
this.emit("update", this)) : this.width > 0 && this.height > 0 &&
(this.valid = !0,
this.emit("loaded", this),
this.emit("update", this))
}
onError(e) {
this.emit("error", this, e)
}
destroy() {
this.resource && (this.resource.unbind(this),
this.resource.internal && this.resource.destroy(),
this.resource = null),
this.cacheId && (delete BaseTextureCache[this.cacheId],
delete TextureCache[this.cacheId],
this.cacheId = null),
this.valid = !1,
this.dispose(),
e.removeFromCache(this),
this.textureCacheIds = null,
this.destroyed = !0,
this.emit("destroyed", this),
this.removeAllListeners()
}
dispose() {
this.emit("dispose", this)
}
castToBaseTexture() {
return this
}
static from(t, r, n=settings.STRICT_TEXTURE_CACHE) {
const i = "string" == typeof t;
let o = null;
if (i)
o = t;
else {
if (!t._pixiId) {
const e = (null == r ? void 0 : r.pixiIdPrefix) ||
"pixiid";
t._pixiId = `${e}_${uid()}`
}
o = t._pixiId
}
let s = BaseTextureCache[o];
if (i && n && !s)
throw new Error(`The cacheId "${o}" does not exist in
BaseTextureCache.`);
return s || (s = new e(t,r),
s.cacheId = o,
e.addToCache(s, o)),
s
}
static fromBuffer(t, r, n, i) {
t = t || new Float32Array(r * n * 4);
const o = new BufferResource(t,{
width: r,
height: n,
...null == i ? void 0 : i.resourceOptions
});
let s, a;
return t instanceof Float32Array ? (s = FORMATS.RGBA,
a = TYPES.FLOAT) : t instanceof Int32Array ? (s =
FORMATS.RGBA_INTEGER,
a = TYPES.INT) : t instanceof Uint32Array ? (s =
FORMATS.RGBA_INTEGER,
a = TYPES.UNSIGNED_INT) : t instanceof Int16Array ? (s =
FORMATS.RGBA_INTEGER,
a = TYPES.SHORT) : t instanceof Uint16Array ? (s =
FORMATS.RGBA_INTEGER,
a = TYPES.UNSIGNED_SHORT) : t instanceof Int8Array ? (s =
FORMATS.RGBA,
a = TYPES.BYTE) : (s = FORMATS.RGBA,
a = TYPES.UNSIGNED_BYTE),
o.internal = !0,
new e(o,Object.assign({}, defaultBufferOptions, {
type: a,
format: s
}, i))
}
static addToCache(e, t) {
t && (e.textureCacheIds.includes(t) || e.textureCacheIds.push(t),
BaseTextureCache[t] && BaseTextureCache[t],
BaseTextureCache[t] = e)
}
static removeFromCache(e) {
if ("string" == typeof e) {
const t = BaseTextureCache[e];
if (t) {
const r = t.textureCacheIds.indexOf(e);
return r > -1 && t.textureCacheIds.splice(r, 1),
delete BaseTextureCache[e],
t
}
} else if (null == e ? void 0 : e.textureCacheIds) {
for (let t = 0; t < e.textureCacheIds.length; ++t)
delete BaseTextureCache[e.textureCacheIds[t]];
return e.textureCacheIds.length = 0,
e
}
return null
}
}
;
_BaseTexture.defaultOptions = {
mipmap: MIPMAP_MODES.POW2,
anisotropicLevel: 0,
scaleMode: SCALE_MODES.LINEAR,
wrapMode: WRAP_MODES.CLAMP,
alphaMode: ALPHA_MODES.UNPACK,
target: TARGETS.TEXTURE_2D,
format: FORMATS.RGBA,
type: TYPES.UNSIGNED_BYTE
},
_BaseTexture._globalBatch = 0;
let BaseTexture = _BaseTexture;
class BatchDrawCall {
constructor() {
this.texArray = null,
this.blend = 0,
this.type = DRAW_MODES.TRIANGLES,
this.start = 0,
this.size = 0,
this.data = null
}
}
let UID$4 = 0
, Buffer$3 = class e {
constructor(e, t=!0, r=!1) {
this.data = e || new Float32Array(1),
this._glBuffers = {},
this._updateID = 0,
this.index = r,
this.static = t,
this.id = UID$4++,
this.disposeRunner = new Runner("disposeBuffer")
}
update(e) {
e instanceof Array && (e = new Float32Array(e)),
this.data = e || this.data,
this._updateID++
}
dispose() {
this.disposeRunner.emit(this, !1)
}
destroy() {
this.dispose(),
this.data = null
}
set index(e) {
this.type = e ? BUFFER_TYPE.ELEMENT_ARRAY_BUFFER :
BUFFER_TYPE.ARRAY_BUFFER
}
get index() {
return this.type === BUFFER_TYPE.ELEMENT_ARRAY_BUFFER
}
static from(t) {
return t instanceof Array && (t = new Float32Array(t)),
new e(t)
}
}
;
class Attribute {
constructor(e, t=0, r=!1, n=TYPES.FLOAT, i, o, s, a=1) {
this.buffer = e,
this.size = t,
this.normalized = r,
this.type = n,
this.stride = i,
this.start = o,
this.instance = s,
this.divisor = a
}
destroy() {
this.buffer = null
}
static from(e, t, r, n, i) {
return new Attribute(e,t,r,n,i)
}
}
const map$4 = {
Float32Array: Float32Array,
Uint32Array: Uint32Array,
Int32Array: Int32Array,
Uint8Array: Uint8Array
};
function interleaveTypedArrays(e, t) {
let r = 0
, n = 0;
const i = {};
for (let l = 0; l < e.length; l++)
n += t[l],
r += e[l].length;
const o = new ArrayBuffer(4 * r);
let s = null
, a = 0;
for (let l = 0; l < e.length; l++) {
const r = t[l]
, c = e[l]
, u = getBufferType(c);
i[u] || (i[u] = new map$4[u](o)),
s = i[u];
for (let e = 0; e < c.length; e++) {
s[(e / r | 0) * n + a + e % r] = c[e]
}
a += r
}
return new Float32Array(o)
}
const byteSizeMap$1 = {
5126: 4,
5123: 2,
5121: 1
};
let UID$3 = 0;
const map$3 = {
Float32Array: Float32Array,
Uint32Array: Uint32Array,
Int32Array: Int32Array,
Uint8Array: Uint8Array,
Uint16Array: Uint16Array
};
class Geometry {
constructor(e=[], t={}) {
this.buffers = e,
this.indexBuffer = null,
this.attributes = t,
this.glVertexArrayObjects = {},
this.id = UID$3++,
this.instanced = !1,
this.instanceCount = 1,
this.disposeRunner = new Runner("disposeGeometry"),
this.refCount = 0
}
addAttribute(e, t, r=0, n=!1, i, o, s, a=!1) {
if (!t)
throw new Error("You must pass a buffer when creating an
attribute");
t instanceof Buffer$3 || (t instanceof Array && (t = new
Float32Array(t)),
t = new Buffer$3(t));
const l = e.split("|");
if (l.length > 1) {
for (let e = 0; e < l.length; e++)
this.addAttribute(l[e], t, r, n, i);
return this
}
let c = this.buffers.indexOf(t);
return -1 === c && (this.buffers.push(t),
c = this.buffers.length - 1),
this.attributes[e] = new Attribute(c,r,n,i,o,s,a),
this.instanced = this.instanced || a,
this
}
getAttribute(e) {
return this.attributes[e]
}
getBuffer(e) {
return this.buffers[this.getAttribute(e).buffer]
}
addIndex(e) {
return e instanceof Buffer$3 || (e instanceof Array && (e = new
Uint16Array(e)),
e = new Buffer$3(e)),
e.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER,
this.indexBuffer = e,
this.buffers.includes(e) || this.buffers.push(e),
this
}
getIndex() {
return this.indexBuffer
}
interleave() {
if (1 === this.buffers.length || 2 === this.buffers.length &&
this.indexBuffer)
return this;
const e = []
, t = []
, r = new Buffer$3;
let n;
for (n in this.attributes) {
const r = this.attributes[n]
, i = this.buffers[r.buffer];
e.push(i.data),
t.push(r.size * byteSizeMap$1[r.type] / 4),
r.buffer = 0
}
for (r.data = interleaveTypedArrays(e, t),
n = 0; n < this.buffers.length; n++)
this.buffers[n] !== this.indexBuffer &&
this.buffers[n].destroy();
return this.buffers = [r],
this.indexBuffer && this.buffers.push(this.indexBuffer),
this
}
getSize() {
for (const e in this.attributes) {
const t = this.attributes[e];
return this.buffers[t.buffer].data.length / (t.stride / 4 ||
t.size)
}
return 0
}
dispose() {
this.disposeRunner.emit(this, !1)
}
destroy() {
this.dispose(),
this.buffers = null,
this.indexBuffer = null,
this.attributes = null
}
clone() {
const e = new Geometry;
for (let t = 0; t < this.buffers.length; t++)
e.buffers[t] = new Buffer$3(this.buffers[t].data.slice(0));
for (const t in this.attributes) {
const r = this.attributes[t];
e.attributes[t] = new
Attribute(r.buffer,r.size,r.normalized,r.type,r.stride,r.start,r.instance)
}
return this.indexBuffer && (e.indexBuffer =
e.buffers[this.buffers.indexOf(this.indexBuffer)],
e.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER),
e
}
static merge(e) {
const t = new Geometry
, r = []
, n = []
, i = [];
let o;
for (let s = 0; s < e.length; s++) {
o = e[s];
for (let e = 0; e < o.buffers.length; e++)
n[e] = n[e] || 0,
n[e] += o.buffers[e].data.length,
i[e] = 0
}
for (let s = 0; s < o.buffers.length; s++)
r[s] = new (map$3[getBufferType(o.buffers[s].data)])(n[s]),
t.buffers[s] = new Buffer$3(r[s]);
for (let s = 0; s < e.length; s++) {
o = e[s];
for (let e = 0; e < o.buffers.length; e++)
r[e].set(o.buffers[e].data, i[e]),
i[e] += o.buffers[e].data.length
}
if (t.attributes = o.attributes,
o.indexBuffer) {
t.indexBuffer = t.buffers[o.buffers.indexOf(o.indexBuffer)],
t.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;
let r = 0
, n = 0
, i = 0
, s = 0;
for (let e = 0; e < o.buffers.length; e++)
if (o.buffers[e] !== o.indexBuffer) {
s = e;
break
}
for (const e in o.attributes) {
const t = o.attributes[e];
(0 | t.buffer) === s && (n += t.size *
byteSizeMap$1[t.type] / 4)
}
for (let o = 0; o < e.length; o++) {
const a = e[o].indexBuffer.data;
for (let e = 0; e < a.length; e++)
t.indexBuffer.data[e + i] += r;
r += e[o].buffers[s].data.length / n,
i += a.length
}
}
return t
}
}
class BatchGeometry extends Geometry {
constructor(e=!1) {
super(),
this._buffer = new Buffer$3(null,e,!1),
this._indexBuffer = new Buffer$3(null,e,!0),
this.addAttribute("aVertexPosition", this._buffer, 2, !1,
TYPES.FLOAT).addAttribute("aTextureCoord", this._buffer, 2, !1,
TYPES.FLOAT).addAttribute("aColor", this._buffer, 4, !0,
TYPES.UNSIGNED_BYTE).addAttribute("aTextureId", this._buffer, 1, !0,
TYPES.FLOAT).addIndex(this._indexBuffer)
}
}
const PI_2 = 2 * Math.PI
, RAD_TO_DEG = 180 / Math.PI
, DEG_TO_RAD = Math.PI / 180;
var SHAPES = (e => (e[e.POLY = 0] = "POLY",
e[e.RECT = 1] = "RECT",
e[e.CIRC = 2] = "CIRC",
e[e.ELIP = 3] = "ELIP",
e[e.RREC = 4] = "RREC",
e))(SHAPES || {});
class Point {
constructor(e=0, t=0) {
this.x = 0,
this.y = 0,
this.x = e,
this.y = t
}
clone() {
return new Point(this.x,this.y)
}
copyFrom(e) {
return this.set(e.x, e.y),
this
}
copyTo(e) {
return e.set(this.x, this.y),
e
}
equals(e) {
return e.x === this.x && e.y === this.y
}
set(e=0, t=e) {
return this.x = e,
this.y = t,
this
}
}
Point.prototype.toString = function() {
return `[@pixi/math:Point x=${this.x} y=${this.y}]`
}
;
const tempPoints$1 = [new Point, new Point, new Point, new Point];
class Rectangle {
constructor(e=0, t=0, r=0, n=0) {
this.x = Number(e),
this.y = Number(t),
this.width = Number(r),
this.height = Number(n),
this.type = SHAPES.RECT
}
get left() {
return this.x
}
get right() {
return this.x + this.width
}
get top() {
return this.y
}
get bottom() {
return this.y + this.height
}
static get EMPTY() {
return new Rectangle(0,0,0,0)
}
clone() {
return new Rectangle(this.x,this.y,this.width,this.height)
}
copyFrom(e) {
return this.x = e.x,
this.y = e.y,
this.width = e.width,
this.height = e.height,
this
}
copyTo(e) {
return e.x = this.x,
e.y = this.y,
e.width = this.width,
e.height = this.height,
e
}
contains(e, t) {
return !(this.width <= 0 || this.height <= 0) && (e >= this.x && e
< this.x + this.width && t >= this.y && t < this.y + this.height)
}
intersects(e, t) {
if (!t) {
const t = this.x < e.x ? e.x : this.x;
if ((this.right > e.right ? e.right : this.right) <= t)
return !1;
const r = this.y < e.y ? e.y : this.y;
return (this.bottom > e.bottom ? e.bottom : this.bottom) > r
}
const r = this.left
, n = this.right
, i = this.top
, o = this.bottom;
if (n <= r || o <= i)
return !1;
const s = tempPoints$1[0].set(e.left, e.top)
, a = tempPoints$1[1].set(e.left, e.bottom)
, l = tempPoints$1[2].set(e.right, e.top)
, c = tempPoints$1[3].set(e.right, e.bottom);
if (l.x <= s.x || a.y <= s.y)
return !1;
const u = Math.sign(t.a * t.d - t.b * t.c);
if (0 === u || (t.apply(s, s),
t.apply(a, a),
t.apply(l, l),
t.apply(c, c),
Math.max(s.x, a.x, l.x, c.x) <= r || Math.min(s.x, a.x, l.x, c.x)
>= n || Math.max(s.y, a.y, l.y, c.y) <= i || Math.min(s.y, a.y, l.y, c.y) >= o))
return !1;
const d = u * (a.y - s.y)
, p = u * (s.x - a.x)
, h = d * r + p * i
, f = d * n + p * i
, m = d * r + p * o
, g = d * n + p * o;
if (Math.max(h, f, m, g) <= d * s.x + p * s.y || Math.min(h, f, m,
g) >= d * c.x + p * c.y)
return !1;
const y = u * (s.y - l.y)
, v = u * (l.x - s.x)
, b = y * r + v * i
, x = y * n + v * i
, _ = y * r + v * o
, E = y * n + v * o;
return !(Math.max(b, x, _, E) <= y * s.x + v * s.y || Math.min(b,
x, _, E) >= y * c.x + v * c.y)
}
pad(e=0, t=e) {
return this.x -= e,
this.y -= t,
this.width += 2 * e,
this.height += 2 * t,
this
}
fit(e) {
const t = Math.max(this.x, e.x)
, r = Math.min(this.x + this.width, e.x + e.width)
, n = Math.max(this.y, e.y)
, i = Math.min(this.y + this.height, e.y + e.height);
return this.x = t,
this.width = Math.max(r - t, 0),
this.y = n,
this.height = Math.max(i - n, 0),
this
}
ceil(e=1, t=.001) {
const r = Math.ceil((this.x + this.width - t) * e) / e
, n = Math.ceil((this.y + this.height - t) * e) / e;
return this.x = Math.floor((this.x + t) * e) / e,
this.y = Math.floor((this.y + t) * e) / e,
this.width = r - this.x,
this.height = n - this.y,
this
}
enlarge(e) {
const t = Math.min(this.x, e.x)
, r = Math.max(this.x + this.width, e.x + e.width)
, n = Math.min(this.y, e.y)
, i = Math.max(this.y + this.height, e.y + e.height);
return this.x = t,
this.width = r - t,
this.y = n,
this.height = i - n,
this
}
}
Rectangle.prototype.toString = function() {
return `[@pixi/math:Rectangle x=${this.x} y=${this.y} width=$
{this.width} height=${this.height}]`
}
;
let Circle$1 = class e {
constructor(e=0, t=0, r=0) {
this.x = e,
this.y = t,
this.radius = r,
this.type = SHAPES.CIRC
}
clone() {
return new e(this.x,this.y,this.radius)
}
contains(e, t) {
if (this.radius <= 0)
return !1;
const r = this.radius * this.radius;
let n = this.x - e
, i = this.y - t;
return n *= n,
i *= i,
n + i <= r
}
getBounds() {
return new Rectangle(this.x - this.radius,this.y - this.radius,2 *
this.radius,2 * this.radius)
}
}
;
Circle$1.prototype.toString = function() {
return `[@pixi/math:Circle x=${this.x} y=${this.y} radius=$
{this.radius}]`
}
;
class Ellipse {
constructor(e=0, t=0, r=0, n=0) {
this.x = e,
this.y = t,
this.width = r,
this.height = n,
this.type = SHAPES.ELIP
}
clone() {
return new Ellipse(this.x,this.y,this.width,this.height)
}
contains(e, t) {
if (this.width <= 0 || this.height <= 0)
return !1;
let r = (e - this.x) / this.width
, n = (t - this.y) / this.height;
return r *= r,
n *= n,
r + n <= 1
}
getBounds() {
return new Rectangle(this.x - this.width,this.y -
this.height,this.width,this.height)
}
}
Ellipse.prototype.toString = function() {
return `[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width}
height=${this.height}]`
}
;
class Polygon {
constructor(...e) {
let t = Array.isArray(e[0]) ? e[0] : e;
if ("number" != typeof t[0]) {
const e = [];
for (let r = 0, n = t.length; r < n; r++)
e.push(t[r].x, t[r].y);
t = e
}
this.points = t,
this.type = SHAPES.POLY,
this.closeStroke = !0
}
clone() {
const e = this.points.slice()
, t = new Polygon(e);
return t.closeStroke = this.closeStroke,
t
}
contains(e, t) {
let r = !1;
const n = this.points.length / 2;
for (let i = 0, o = n - 1; i < n; o = i++) {
const n = this.points[2 * i]
, s = this.points[2 * i + 1]
, a = this.points[2 * o]
, l = this.points[2 * o + 1];
s > t != l > t && e < (t - s) / (l - s) * (a - n) + n && (r = !
r)
}
return r
}
}
Polygon.prototype.toString = function() {
return `[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=$
{this.points.reduce(( (e, t) => `${e}, ${t}`), "")}]`
}
;
class RoundedRectangle {
constructor(e=0, t=0, r=0, n=0, i=20) {
this.x = e,
this.y = t,
this.width = r,
this.height = n,
this.radius = i,
this.type = SHAPES.RREC
}
clone() {
return new
RoundedRectangle(this.x,this.y,this.width,this.height,this.radius)
}
contains(e, t) {
if (this.width <= 0 || this.height <= 0)
return !1;
if (e >= this.x && e <= this.x + this.width && t >= this.y && t <=
this.y + this.height) {
const r = Math.max(0, Math.min(this.radius,
Math.min(this.width, this.height) / 2));
if (t >= this.y + r && t <= this.y + this.height - r || e >=
this.x + r && e <= this.x + this.width - r)
return !0;
let n = e - (this.x + r)
, i = t - (this.y + r);
const o = r * r;
if (n * n + i * i <= o || (n = e - (this.x + this.width - r),
n * n + i * i <= o) || (i = t - (this.y + this.height - r),
n * n + i * i <= o) || (n = e - (this.x + r),
n * n + i * i <= o))
return !0
}
return !1
}
}
RoundedRectangle.prototype.toString = function() {
return `[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=$
{this.width} height=${this.height} radius=${this.radius}]`
}
;
class Matrix {
constructor(e=1, t=0, r=0, n=1, i=0, o=0) {
this.array = null,
this.a = e,
this.b = t,
this.c = r,
this.d = n,
this.tx = i,
this.ty = o
}
fromArray(e) {
this.a = e[0],
this.b = e[1],
this.c = e[3],
this.d = e[4],
this.tx = e[2],
this.ty = e[5]
}
set(e, t, r, n, i, o) {
return this.a = e,
this.b = t,
this.c = r,
this.d = n,
this.tx = i,
this.ty = o,
this
}
toArray(e, t) {
this.array || (this.array = new Float32Array(9));
const r = t || this.array;
return e ? (r[0] = this.a,
r[1] = this.b,
r[2] = 0,
r[3] = this.c,
r[4] = this.d,
r[5] = 0,
r[6] = this.tx,
r[7] = this.ty,
r[8] = 1) : (r[0] = this.a,
r[1] = this.c,
r[2] = this.tx,
r[3] = this.b,
r[4] = this.d,
r[5] = this.ty,
r[6] = 0,
r[7] = 0,
r[8] = 1),
r
}
apply(e, t) {
t = t || new Point;
const r = e.x
, n = e.y;
return t.x = this.a * r + this.c * n + this.tx,
t.y = this.b * r + this.d * n + this.ty,
t
}
applyInverse(e, t) {
t = t || new Point;
const r = 1 / (this.a * this.d + this.c * -this.b)
, n = e.x
, i = e.y;
return t.x = this.d * r * n + -this.c * r * i + (this.ty * this.c -
this.tx * this.d) * r,
t.y = this.a * r * i + -this.b * r * n + (-this.ty * this.a +
this.tx * this.b) * r,
t
}
translate(e, t) {
return this.tx += e,
this.ty += t,
this
}
scale(e, t) {
return this.a *= e,
this.d *= t,
this.c *= e,
this.b *= t,
this.tx *= e,
this.ty *= t,
this
}
rotate(e) {
const t = Math.cos(e)
, r = Math.sin(e)
, n = this.a
, i = this.c
, o = this.tx;
return this.a = n * t - this.b * r,
this.b = n * r + this.b * t,
this.c = i * t - this.d * r,
this.d = i * r + this.d * t,
this.tx = o * t - this.ty * r,
this.ty = o * r + this.ty * t,
this
}
append(e) {
const t = this.a
, r = this.b
, n = this.c
, i = this.d;
return this.a = e.a * t + e.b * n,
this.b = e.a * r + e.b * i,
this.c = e.c * t + e.d * n,
this.d = e.c * r + e.d * i,
this.tx = e.tx * t + e.ty * n + this.tx,
this.ty = e.tx * r + e.ty * i + this.ty,
this
}
setTransform(e, t, r, n, i, o, s, a, l) {
return this.a = Math.cos(s + l) * i,
this.b = Math.sin(s + l) * i,
this.c = -Math.sin(s - a) * o,
this.d = Math.cos(s - a) * o,
this.tx = e - (r * this.a + n * this.c),
this.ty = t - (r * this.b + n * this.d),
this
}
prepend(e) {
const t = this.tx;
if (1 !== e.a || 0 !== e.b || 0 !== e.c || 1 !== e.d) {
const t = this.a
, r = this.c;
this.a = t * e.a + this.b * e.c,
this.b = t * e.b + this.b * e.d,
this.c = r * e.a + this.d * e.c,
this.d = r * e.b + this.d * e.d
}
return this.tx = t * e.a + this.ty * e.c + e.tx,
this.ty = t * e.b + this.ty * e.d + e.ty,
this
}
decompose(e) {
const t = this.a
, r = this.b
, n = this.c
, i = this.d
, o = e.pivot
, s = -Math.atan2(-n, i)
, a = Math.atan2(r, t)
, l = Math.abs(s + a);
return l < 1e-5 || Math.abs(PI_2 - l) < 1e-5 ? (e.rotation = a,
e.skew.x = e.skew.y = 0) : (e.rotation = 0,
e.skew.x = s,
e.skew.y = a),
e.scale.x = Math.sqrt(t * t + r * r),
e.scale.y = Math.sqrt(n * n + i * i),
e.position.x = this.tx + (o.x * t + o.y * n),
e.position.y = this.ty + (o.x * r + o.y * i),
e
}
invert() {
const e = this.a
, t = this.b
, r = this.c
, n = this.d
, i = this.tx
, o = e * n - t * r;
return this.a = n / o,
this.b = -t / o,
this.c = -r / o,
this.d = e / o,
this.tx = (r * this.ty - n * i) / o,
this.ty = -(e * this.ty - t * i) / o,
this
}
identity() {
return this.a = 1,
this.b = 0,
this.c = 0,
this.d = 1,
this.tx = 0,
this.ty = 0,
this
}
clone() {
const e = new Matrix;
return e.a = this.a,
e.b = this.b,
e.c = this.c,
e.d = this.d,
e.tx = this.tx,
e.ty = this.ty,
e
}
copyTo(e) {
return e.a = this.a,
e.b = this.b,
e.c = this.c,
e.d = this.d,
e.tx = this.tx,
e.ty = this.ty,
e
}
copyFrom(e) {
return this.a = e.a,
this.b = e.b,
this.c = e.c,
this.d = e.d,
this.tx = e.tx,
this.ty = e.ty,
this
}
static get IDENTITY() {
return new Matrix
}
static get TEMP_MATRIX() {
return new Matrix
}
}
Matrix.prototype.toString = function() {
return `[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=$
{this.d} tx=${this.tx} ty=${this.ty}]`
}
;
const ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1]
, uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1]
, vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1]
, vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1]
, rotationCayley = []
, rotationMatrices = []
, signum = Math.sign;
function init() {
for (let e = 0; e < 16; e++) {
const t = [];
rotationCayley.push(t);
for (let r = 0; r < 16; r++) {
const n = signum(ux[e] * ux[r] + vx[e] * uy[r])
, i = signum(uy[e] * ux[r] + vy[e] * uy[r])
, o = signum(ux[e] * vx[r] + vx[e] * vy[r])
, s = signum(uy[e] * vx[r] + vy[e] * vy[r]);
for (let e = 0; e < 16; e++)
if (ux[e] === n && uy[e] === i && vx[e] === o && vy[e] ===
s) {
t.push(e);
break
}
}
}
for (let e = 0; e < 16; e++) {
const t = new Matrix;
t.set(ux[e], uy[e], vx[e], vy[e], 0, 0),
rotationMatrices.push(t)
}
}
init();
const groupD8 = {
E: 0,
SE: 1,
S: 2,
SW: 3,
W: 4,
NW: 5,
N: 6,
NE: 7,
MIRROR_VERTICAL: 8,
MAIN_DIAGONAL: 10,
MIRROR_HORIZONTAL: 12,
REVERSE_DIAGONAL: 14,
uX: e => ux[e],
uY: e => uy[e],
vX: e => vx[e],
vY: e => vy[e],
inv: e => 8 & e ? 15 & e : 7 & -e,
add: (e, t) => rotationCayley[e][t],
sub: (e, t) => rotationCayley[e][groupD8.inv(t)],
rotate180: e => 4 ^ e,
isVertical: e => 2 == (3 & e),
byDirection: (e, t) => 2 * Math.abs(e) <= Math.abs(t) ? t >= 0 ?
groupD8.S : groupD8.N : 2 * Math.abs(t) <= Math.abs(e) ? e > 0 ? groupD8.E :
groupD8.W : t > 0 ? e > 0 ? groupD8.SE : groupD8.SW : e > 0 ? groupD8.NE :
groupD8.NW,
matrixAppendRotationInv: (e, t, r=0, n=0) => {
const i = rotationMatrices[groupD8.inv(t)];
i.tx = r,
i.ty = n,
e.append(i)
}
};
class ObservablePoint {
constructor(e, t, r=0, n=0) {
this._x = r,
this._y = n,
this.cb = e,
this.scope = t
}
clone(e=this.cb, t=this.scope) {
return new ObservablePoint(e,t,this._x,this._y)
}
set(e=0, t=e) {
return (this._x !== e || this._y !== t) && (this._x = e,
this._y = t,
this.cb.call(this.scope)),
this
}
copyFrom(e) {
return (this._x !== e.x || this._y !== e.y) && (this._x = e.x,
this._y = e.y,
this.cb.call(this.scope)),
this
}
copyTo(e) {
return e.set(this._x, this._y),
e
}
equals(e) {
return e.x === this._x && e.y === this._y
}
get x() {
return this._x
}
set x(e) {
this._x !== e && (this._x = e,
this.cb.call(this.scope))
}
get y() {
return this._y
}
set y(e) {
this._y !== e && (this._y = e,
this.cb.call(this.scope))
}
}
ObservablePoint.prototype.toString = function() {
return `[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=$
{this.scope}]`
}
;
const _Transform = class {
constructor() {
this.worldTransform = new Matrix,
this.localTransform = new Matrix,
this.position = new ObservablePoint(this.onChange,this,0,0),
this.scale = new ObservablePoint(this.onChange,this,1,1),
this.pivot = new ObservablePoint(this.onChange,this,0,0),
this.skew = new ObservablePoint(this.updateSkew,this,0,0),
this._rotation = 0,
this._cx = 1,
this._sx = 0,
this._cy = 0,
this._sy = 1,
this._localID = 0,
this._currentLocalID = 0,
this._worldID = 0,
this._parentID = 0
}
onChange() {
this._localID++
}
updateSkew() {
this._cx = Math.cos(this._rotation + this.skew.y),
this._sx = Math.sin(this._rotation + this.skew.y),
this._cy = -Math.sin(this._rotation - this.skew.x),
this._sy = Math.cos(this._rotation - this.skew.x),
this._localID++
}
updateLocalTransform() {
const e = this.localTransform;
this._localID !== this._currentLocalID && (e.a = this._cx *
this.scale.x,
e.b = this._sx * this.scale.x,
e.c = this._cy * this.scale.y,
e.d = this._sy * this.scale.y,
e.tx = this.position.x - (this.pivot.x * e.a + this.pivot.y * e.c),
e.ty = this.position.y - (this.pivot.x * e.b + this.pivot.y * e.d),
this._currentLocalID = this._localID,
this._parentID = -1)
}
updateTransform(e) {
const t = this.localTransform;
if (this._localID !== this._currentLocalID && (t.a = this._cx *
this.scale.x,
t.b = this._sx * this.scale.x,
t.c = this._cy * this.scale.y,
t.d = this._sy * this.scale.y,
t.tx = this.position.x - (this.pivot.x * t.a + this.pivot.y * t.c),
t.ty = this.position.y - (this.pivot.x * t.b + this.pivot.y * t.d),
this._currentLocalID = this._localID,
this._parentID = -1),
this._parentID !== e._worldID) {
const r = e.worldTransform
, n = this.worldTransform;
n.a = t.a * r.a + t.b * r.c,
n.b = t.a * r.b + t.b * r.d,
n.c = t.c * r.a + t.d * r.c,
n.d = t.c * r.b + t.d * r.d,
n.tx = t.tx * r.a + t.ty * r.c + r.tx,
n.ty = t.tx * r.b + t.ty * r.d + r.ty,
this._parentID = e._worldID,
this._worldID++
}
}
setFromMatrix(e) {
e.decompose(this),
this._localID++
}
get rotation() {
return this._rotation
}
set rotation(e) {
this._rotation !== e && (this._rotation = e,
this.updateSkew())
}
}
;
_Transform.IDENTITY = new _Transform;
let Transform = _Transform;
Transform.prototype.toString = function() {
return `[@pixi/math:Transform position=(${this.position.x}, $
{this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, $
{this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`
}
;
var defaultFragment$2 = "varying vec2 vTextureCoord;\n\nuniform sampler2D
uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler,
vTextureCoord);\n}"
, defaultVertex$3 = "attribute vec2 aVertexPosition;\nattribute vec2
aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\
nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n";
function compileShader(e, t, r) {
const n = e.createShader(t);
return e.shaderSource(n, r),
e.compileShader(n),
n
}
function booleanArray(e) {
const t = new Array(e);
for (let r = 0; r < t.length; r++)
t[r] = !1;
return t
}
function defaultValue$3(e, t) {
switch (e) {
case "float":
case "int":
case "uint":
case "sampler2D":
case "sampler2DArray":
return 0;
case "vec2":
return new Float32Array(2 * t);
case "vec3":
return new Float32Array(3 * t);
case "vec4":
return new Float32Array(4 * t);
case "ivec2":
return new Int32Array(2 * t);
case "ivec3":
return new Int32Array(3 * t);
case "ivec4":
return new Int32Array(4 * t);
case "uvec2":
return new Uint32Array(2 * t);
case "uvec3":
return new Uint32Array(3 * t);
case "uvec4":
return new Uint32Array(4 * t);
case "bool":
return !1;
case "bvec2":
return booleanArray(2 * t);
case "bvec3":
return booleanArray(3 * t);
case "bvec4":
return booleanArray(4 * t);
case "mat2":
return new Float32Array([1, 0, 0, 1]);
case "mat3":
return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
case "mat4":
return new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,
0, 1])
}
return null
}
const uniformParsers = [{
test: e => "float" === e.type && 1 === e.size && !e.isArray,
code: e => `\n if(uv["${e}"] !== ud["${e}"].value)\n
{\n ud["${e}"].value = uv["${e}"]\n
gl.uniform1f(ud["${e}"].location, uv["${e}"])\n }\n `
}, {
test: (e, t) => !("sampler2D" !== e.type && "samplerCube" !== e.type &&
"sampler2DArray" !== e.type || 1 !== e.size || e.isArray || null != t && void 0 ===
t.castToBaseTexture),
code: e => `t = syncData.textureCount++;\n\n
renderer.texture.bind(uv["${e}"], t);\n\n if(ud["${e}"].value !== t)\n
{\n ud["${e}"].value = t;\n gl.uniform1i(ud["$
{e}"].location, t);\n; // eslint-disable-line max-len\n }`
}, {
test: (e, t) => "mat3" === e.type && 1 === e.size && !e.isArray && void
0 !== t.a,
code: e => `\n gl.uniformMatrix3fv(ud["${e}"].location,
false, uv["${e}"].toArray(true));\n `,
codeUbo: e => `\n var ${e}_matrix = uv.$
{e}.toArray(true);\n\n data[offset] = ${e}_matrix[0];\n
data[offset+1] = ${e}_matrix[1];\n data[offset+2] = ${e}_matrix[2];\
n \n data[offset + 4] = ${e}_matrix[3];\n
data[offset + 5] = ${e}_matrix[4];\n data[offset + 6] = $
{e}_matrix[5];\n \n data[offset + 8] = ${e}_matrix[6];\n
data[offset + 9] = ${e}_matrix[7];\n data[offset + 10] = $
{e}_matrix[8];\n `
}, {
test: (e, t) => "vec2" === e.type && 1 === e.size && !e.isArray && void
0 !== t.x,
code: e => `\n cv = ud["${e}"].value;\n v
= uv["${e}"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n
{\n cv[0] = v.x;\n cv[1] = v.y;\n
gl.uniform2f(ud["${e}"].location, v.x, v.y);\n }`,
codeUbo: e => `\n v = uv.${e};\n\n
data[offset] = v.x;\n data[offset+1] = v.y;\n `
}, {
test: e => "vec2" === e.type && 1 === e.size && !e.isArray,
code: e => `\n cv = ud["${e}"].value;\n v
= uv["${e}"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n
{\n cv[0] = v[0];\n cv[1] = v[1];\n
gl.uniform2f(ud["${e}"].location, v[0], v[1]);\n }\n `
}, {
test: (e, t) => "vec4" === e.type && 1 === e.size && !e.isArray && void
0 !== t.width,
code: e => `\n cv = ud["${e}"].value;\n v
= uv["${e}"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !==
v.width || cv[3] !== v.height)\n {\n cv[0] =
v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n
cv[3] = v.height;\n gl.uniform4f(ud["${e}"].location, v.x, v.y,
v.width, v.height)\n }`,
codeUbo: e => `\n v = uv.${e};\n\n
data[offset] = v.x;\n data[offset+1] = v.y;\n
data[offset+2] = v.width;\n data[offset+3] = v.height;\n
`
}, {
test: (e, t) => "vec4" === e.type && 1 === e.size && !e.isArray && void
0 !== t.red,
code: e => `\n cv = ud["${e}"].value;\n v
= uv["${e}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !
== v.blue || cv[3] !== v.alpha)\n {\n cv[0] =
v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n
cv[3] = v.alpha;\n gl.uniform4f(ud["${e}"].location, v.red,
v.green, v.blue, v.alpha)\n }`,
codeUbo: e => `\n v = uv.${e};\n\n
data[offset] = v.red;\n data[offset+1] = v.green;\n
data[offset+2] = v.blue;\n data[offset+3] = v.alpha;\n
`
}, {
test: (e, t) => "vec3" === e.type && 1 === e.size && !e.isArray && void
0 !== t.red,
code: e => `\n cv = ud["${e}"].value;\n v
= uv["${e}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !
== v.blue || cv[3] !== v.a)\n {\n cv[0] = v.red;\
n cv[1] = v.green;\n cv[2] = v.blue;\n \n
gl.uniform3f(ud["${e}"].location, v.red, v.green, v.blue)\n }`,
codeUbo: e => `\n v = uv.${e};\n\n
data[offset] = v.red;\n data[offset+1] = v.green;\n
data[offset+2] = v.blue;\n `
}, {
test: e => "vec4" === e.type && 1 === e.size && !e.isArray,
code: e => `\n cv = ud["${e}"].value;\n v
= uv["${e}"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !==
v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n
cv[1] = v[1];\n cv[2] = v[2];\n cv[3] =
v[3];\n\n gl.uniform4f(ud["${e}"].location, v[0], v[1], v[2],
v[3])\n }`
}]
, GLSL_TO_SINGLE_SETTERS_CACHED = {
float: "\n if (cv !== v)\n {\n cu.value = v;\n
gl.uniform1f(location, v);\n }",
vec2: "\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n
cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\
n }",
vec3: "\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n
{\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n
gl.uniform3f(location, v[0], v[1], v[2])\n }",
vec4: "\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] ||
cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2]
= v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2],
v[3]);\n }",
int: "\n if (cv !== v)\n {\n cu.value = v;\n\n
gl.uniform1i(location, v);\n }",
ivec2: "\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n
cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0],
v[1]);\n }",
ivec3: "\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n
{\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n
gl.uniform3i(location, v[0], v[1], v[2]);\n }",
ivec4: "\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] ||
cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2]
= v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2],
v[3]);\n }",
uint: "\n if (cv !== v)\n {\n cu.value = v;\n\n
gl.uniform1ui(location, v);\n }",
uvec2: "\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n
cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0],
v[1]);\n }",
uvec3: "\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n
{\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n
gl.uniform3ui(location, v[0], v[1], v[2]);\n }",
uvec4: "\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] ||
cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2]
= v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2],
v[3]);\n }",
bool: "\n if (cv !== v)\n {\n cu.value = v;\n
gl.uniform1i(location, v);\n }",
bvec2: "\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0]
= v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\
n }",
bvec3: "\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n
{\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n
gl.uniform3i(location, v[0], v[1], v[2]);\n }",
bvec4: "\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] ||
cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2]
= v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2],
v[3]);\n }",
mat2: "gl.uniformMatrix2fv(location, false, v)",
mat3: "gl.uniformMatrix3fv(location, false, v)",
mat4: "gl.uniformMatrix4fv(location, false, v)",
sampler2D: "\n if (cv !== v)\n {\n cu.value = v;\n\n
gl.uniform1i(location, v);\n }",
samplerCube: "\n if (cv !== v)\n {\n cu.value = v;\n\n
gl.uniform1i(location, v);\n }",
sampler2DArray: "\n if (cv !== v)\n {\n cu.value = v;\n\n
gl.uniform1i(location, v);\n }"
}
, GLSL_TO_ARRAY_SETTERS = {
float: "gl.uniform1fv(location, v)",
vec2: "gl.uniform2fv(location, v)",
vec3: "gl.uniform3fv(location, v)",
vec4: "gl.uniform4fv(location, v)",
mat4: "gl.uniformMatrix4fv(location, false, v)",
mat3: "gl.uniformMatrix3fv(location, false, v)",
mat2: "gl.uniformMatrix2fv(location, false, v)",
int: "gl.uniform1iv(location, v)",
ivec2: "gl.uniform2iv(location, v)",
ivec3: "gl.uniform3iv(location, v)",
ivec4: "gl.uniform4iv(location, v)",
uint: "gl.uniform1uiv(location, v)",
uvec2: "gl.uniform2uiv(location, v)",
uvec3: "gl.uniform3uiv(location, v)",
uvec4: "gl.uniform4uiv(location, v)",
bool: "gl.uniform1iv(location, v)",
bvec2: "gl.uniform2iv(location, v)",
bvec3: "gl.uniform3iv(location, v)",
bvec4: "gl.uniform4iv(location, v)",
sampler2D: "gl.uniform1iv(location, v)",
samplerCube: "gl.uniform1iv(location, v)",
sampler2DArray: "gl.uniform1iv(location, v)"
};
function generateUniformsSync(e, t) {
var r;
const n = ["\n var v = null;\n var cv = null;\n
var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];
for (const i in e.uniforms) {
const o = t[i];
if (!o) {
!0 === (null == (r = e.uniforms[i]) ? void 0 : r.group) &&
(e.uniforms[i].ubo ? n.push(`\n
renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}');\n `) :
n.push(`\n renderer.shader.syncUniformGroup(uv.${i},
syncData);\n `));
continue
}
const s = e.uniforms[i];
let a = !1;
for (let e = 0; e < uniformParsers.length; e++)
if (uniformParsers[e].test(o, s)) {
n.push(uniformParsers[e].code(i, s)),
a = !0;
break
}
if (!a) {
const e = (1 !== o.size || o.isArray ? GLSL_TO_ARRAY_SETTERS :
GLSL_TO_SINGLE_SETTERS_CACHED)[o.type].replace("location", `ud["${i}"].location`);
n.push(`\n cu = ud["${i}"];\n cv =
cu.value;\n v = uv["${i}"];\n ${e};`)
}
}
return new Function("ud","uv","renderer","syncData",n.join("\n"))
}
const unknownContext = {};
let context = unknownContext, maxFragmentPrecision;
function getTestContext() {
if (context === unknownContext || (null == context ? void 0 :
context.isContextLost())) {
const e = settings.ADAPTER.createCanvas();
let t;
settings.PREFER_ENV >= ENV.WEBGL2 && (t = e.getContext("webgl2",
{})),
t || (t = e.getContext("webgl", {}) || e.getContext("experimental-
webgl", {}),
t ? t.getExtension("WEBGL_draw_buffers") : t = null),
context = t
}
return context
}
function getMaxFragmentPrecision() {
if (!maxFragmentPrecision) {
maxFragmentPrecision = PRECISION.MEDIUM;
const e = getTestContext();
if (e && e.getShaderPrecisionFormat) {
const t = e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,
e.HIGH_FLOAT);
t && (maxFragmentPrecision = t.precision ? PRECISION.HIGH :
PRECISION.MEDIUM)
}
}
return maxFragmentPrecision
}
function logPrettyShaderError(e, t) {
const r = e.getShaderSource(t).split("\n").map(( (e, t) => `${t}: $
{e}`))
, n = e.getShaderInfoLog(t).split("\n")
, i = {}
, o = n.map((e => parseFloat(e.replace(/^ERROR\: 0\:([\d]+)\:.*$/,
"$1")))).filter((e => !(!e || i[e]) && (i[e] = !0,
!0)))
, s = [""];
o.forEach((e => {
r[e - 1] = `%c${r[e - 1]}%c`,
s.push("background: #FF0000; color:#FFFFFF; font-size: 10px",
"font-size: 10px")
}
));
const a = r.join("\n");
s[0] = a
}
function logProgramError(e, t, r, n) {
e.getProgramParameter(t, e.LINK_STATUS) || (e.getShaderParameter(r,
e.COMPILE_STATUS) || logPrettyShaderError(e, r),
e.getShaderParameter(n, e.COMPILE_STATUS) || logPrettyShaderError(e,
n),
e.getProgramInfoLog(t))
}
const GLSL_TO_SIZE = {
float: 1,
vec2: 2,
vec3: 3,
vec4: 4,
int: 1,
ivec2: 2,
ivec3: 3,
ivec4: 4,
uint: 1,
uvec2: 2,
uvec3: 3,
uvec4: 4,
bool: 1,
bvec2: 2,
bvec3: 3,
bvec4: 4,
mat2: 4,
mat3: 9,
mat4: 16,
sampler2D: 1
};
function mapSize(e) {
return GLSL_TO_SIZE[e]
}
let GL_TABLE = null;
const GL_TO_GLSL_TYPES = {
FLOAT: "float",
FLOAT_VEC2: "vec2",
FLOAT_VEC3: "vec3",
FLOAT_VEC4: "vec4",
INT: "int",
INT_VEC2: "ivec2",
INT_VEC3: "ivec3",
INT_VEC4: "ivec4",
UNSIGNED_INT: "uint",
UNSIGNED_INT_VEC2: "uvec2",
UNSIGNED_INT_VEC3: "uvec3",
UNSIGNED_INT_VEC4: "uvec4",
BOOL: "bool",
BOOL_VEC2: "bvec2",
BOOL_VEC3: "bvec3",
BOOL_VEC4: "bvec4",
FLOAT_MAT2: "mat2",
FLOAT_MAT3: "mat3",
FLOAT_MAT4: "mat4",
SAMPLER_2D: "sampler2D",
INT_SAMPLER_2D: "sampler2D",
UNSIGNED_INT_SAMPLER_2D: "sampler2D",
SAMPLER_CUBE: "samplerCube",
INT_SAMPLER_CUBE: "samplerCube",
UNSIGNED_INT_SAMPLER_CUBE: "samplerCube",
SAMPLER_2D_ARRAY: "sampler2DArray",
INT_SAMPLER_2D_ARRAY: "sampler2DArray",
UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
};
function mapType(e, t) {
if (!GL_TABLE) {
const t = Object.keys(GL_TO_GLSL_TYPES);
GL_TABLE = {};
for (let r = 0; r < t.length; ++r) {
const n = t[r];
GL_TABLE[e[n]] = GL_TO_GLSL_TYPES[n]
}
}
return GL_TABLE[t]
}
function setPrecision(e, t, r) {
if ("precision" !== e.substring(0, 9)) {
let n = t;
return t === PRECISION.HIGH && r !== PRECISION.HIGH && (n =
PRECISION.MEDIUM),
`precision ${n} float;\n${e}`
}
return r !== PRECISION.HIGH && "precision highp" === e.substring(0, 15)
? e.replace("precision highp", "precision mediump") : e
}
let unsafeEval;
function unsafeEvalSupported() {
if ("boolean" == typeof unsafeEval)
return unsafeEval;
try {
unsafeEval = !0 === new Function("param1","param2","param3","return
param1[param2] === param3;")({
a: "b"
}, "a", "b")
} catch {
unsafeEval = !1
}
return unsafeEval
}
let UID$2 = 0;
const nameCache = {}
, _Program = class e {
constructor(t, r, n="pixi-shader", i={}) {
this.extra = {},
this.id = UID$2++,
this.vertexSrc = t || e.defaultVertexSrc,
this.fragmentSrc = r || e.defaultFragmentSrc,
this.vertexSrc = this.vertexSrc.trim(),
this.fragmentSrc = this.fragmentSrc.trim(),
this.extra = i,
"#version" !== this.vertexSrc.substring(0, 8) && (n = n.replace(/\
s+/g, "-"),
nameCache[n] ? (nameCache[n]++,
n += `-${nameCache[n]}`) : nameCache[n] = 1,
this.vertexSrc = `#define SHADER_NAME ${n}\n${this.vertexSrc}`,
this.fragmentSrc = `#define SHADER_NAME ${n}\n${this.fragmentSrc}`,
this.vertexSrc = setPrecision(this.vertexSrc,
e.defaultVertexPrecision, PRECISION.HIGH),
this.fragmentSrc = setPrecision(this.fragmentSrc,
e.defaultFragmentPrecision, getMaxFragmentPrecision())),
this.glPrograms = {},
this.syncUniforms = null
}
static get defaultVertexSrc() {
return defaultVertex$3
}
static get defaultFragmentSrc() {
return defaultFragment$2
}
static from(t, r, n) {
const i = t + r;
let o = ProgramCache[i];
return o || (ProgramCache[i] = o = new e(t,r,n)),
o
}
}
;
_Program.defaultVertexPrecision = PRECISION.HIGH,
_Program.defaultFragmentPrecision = isMobile.apple.device ?
PRECISION.HIGH : PRECISION.MEDIUM;
let Program = _Program
, UID$1 = 0;
class UniformGroup {
constructor(e, t, r) {
this.group = !0,
this.syncUniforms = {},
this.dirtyId = 0,
this.id = UID$1++,
this.static = !!t,
this.ubo = !!r,
e instanceof Buffer$3 ? (this.buffer = e,
this.buffer.type = BUFFER_TYPE.UNIFORM_BUFFER,
this.autoManage = !1,
this.ubo = !0) : (this.uniforms = e,
this.ubo && (this.buffer = new Buffer$3(new Float32Array(1)),
this.buffer.type = BUFFER_TYPE.UNIFORM_BUFFER,
this.autoManage = !0))
}
update() {
this.dirtyId++,
!this.autoManage && this.buffer && this.buffer.update()
}
add(e, t, r) {
if (this.ubo)
throw new Error("[UniformGroup] uniform groups in ubo mode
cannot be modified, or have uniform groups nested in them");
this.uniforms[e] = new UniformGroup(t,r)
}
static from(e, t, r) {
return new UniformGroup(e,t,r)
}
static uboFrom(e, t) {
return new UniformGroup(e,t ?? !0,!0)
}
}
class Shader {
constructor(e, t) {
this.uniformBindCount = 0,
this.program = e,
this.uniformGroup = t ? t instanceof UniformGroup ? t : new
UniformGroup(t) : new UniformGroup({}),
this.disposeRunner = new Runner("disposeShader")
}
checkUniformExists(e, t) {
if (t.uniforms[e])
return !0;
for (const r in t.uniforms) {
const n = t.uniforms[r];
if (!0 === n.group && this.checkUniformExists(e, n))
return !0
}
return !1
}
destroy() {
this.uniformGroup = null,
this.disposeRunner.emit(this),
this.disposeRunner.destroy()
}
get uniforms() {
return this.uniformGroup.uniforms
}
static from(e, t, r) {
const n = Program.from(e, t);
return new Shader(n,r)
}
}
class BatchShaderGenerator {
constructor(e, t) {
if (this.vertexSrc = e,
this.fragTemplate = t,
this.programCache = {},
this.defaultGroupCache = {},
!t.includes("%count%"))
throw new Error('Fragment template must contain "%count%".');
if (!t.includes("%forloop%"))
throw new Error('Fragment template must contain "%forloop%".')
}
generateShader(e) {
if (!this.programCache[e]) {
const t = new Int32Array(e);
for (let n = 0; n < e; n++)
t[n] = n;
this.defaultGroupCache[e] = UniformGroup.from({
uSamplers: t
}, !0);
let r = this.fragTemplate;
r = r.replace(/%count%/gi, `${e}`),
r = r.replace(/%forloop%/gi, this.generateSampleSrc(e)),
this.programCache[e] = new Program(this.vertexSrc,r)
}
const t = {
tint: new Float32Array([1, 1, 1, 1]),
translationMatrix: new Matrix,
default: this.defaultGroupCache[e]
};
return new Shader(this.programCache[e],t)
}
generateSampleSrc(e) {
let t = "";
t += "\n",
t += "\n";
for (let r = 0; r < e; r++)
r > 0 && (t += "\nelse "),
r < e - 1 && (t += `if(vTextureId < ${r}.5)`),
t += "\n{",
t += `\n\tcolor = texture2D(uSamplers[${r}], vTextureCoord);`,
t += "\n}";
return t += "\n",
t += "\n",
t
}
}
class BatchTextureArray {
constructor() {
this.elements = [],
this.ids = [],
this.count = 0
}
clear() {
for (let e = 0; e < this.count; e++)
this.elements[e] = null;
this.count = 0
}
}
function canUploadSameBuffer() {
return !isMobile.apple.device
}
function maxRecommendedTextures(e) {
let t = !0;
const r = settings.ADAPTER.getNavigator();
if (isMobile.tablet || isMobile.phone) {
if (isMobile.apple.device) {
const e = r.userAgent.match(/OS (\d+)_(\d+)?/);
e && parseInt(e[1], 10) < 11 && (t = !1)
}
if (isMobile.android.device) {
const e = r.userAgent.match(/Android\s([0-9.]*)/);
e && parseInt(e[1], 10) < 7 && (t = !1)
}
}
return t ? e : 4
}
class ObjectRenderer {
constructor(e) {
this.renderer = e
}
flush() {}
destroy() {
this.renderer = null
}
start() {}
stop() {
this.flush()
}
render(e) {}
}
var defaultFragment$1 = "varying vec2 vTextureCoord;\nvarying vec4 vColor;\
nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid
main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\
n"
, defaultVertex$2 = "precision highp float;\nattribute vec2
aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute
float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3
translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4
vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position =
vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0,
1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n
vColor = aColor * tint;\n}\n";
const _BatchRenderer = class e extends ObjectRenderer {
constructor(t) {
super(t),
this.setShaderGenerator(),
this.geometryClass = BatchGeometry,
this.vertexSize = 6,
this.state = State.for2d(),
this.size = 4 * e.defaultBatchSize,
this._vertexCount = 0,
this._indexCount = 0,
this._bufferedElements = [],
this._bufferedTextures = [],
this._bufferSize = 0,
this._shader = null,
this._packedGeometries = [],
this._packedGeometryPoolSize = 2,
this._flushId = 0,
this._aBuffers = {},
this._iBuffers = {},
this.maxTextures = 1,
this.renderer.on("prerender", this.onPrerender, this),
t.runners.contextChange.add(this),
this._dcIndex = 0,
this._aIndex = 0,
this._iIndex = 0,
this._attributeBuffer = null,
this._indexBuffer = null,
this._tempBoundTextures = []
}
static get defaultMaxTextures() {
return this._defaultMaxTextures = this._defaultMaxTextures ??
maxRecommendedTextures(32),
this._defaultMaxTextures
}
static set defaultMaxTextures(e) {
this._defaultMaxTextures = e
}
static get canUploadSameBuffer() {
return this._canUploadSameBuffer = this._canUploadSameBuffer ??
canUploadSameBuffer(),
this._canUploadSameBuffer
}
static set canUploadSameBuffer(e) {
this._canUploadSameBuffer = e
}
get MAX_TEXTURES() {
return deprecation("7.1.0", "BatchRenderer#MAX_TEXTURES renamed to
BatchRenderer#maxTextures"),
this.maxTextures
}
static get defaultVertexSrc() {
return defaultVertex$2
}
static get defaultFragmentTemplate() {
return defaultFragment$1
}
setShaderGenerator({vertex: t=e.defaultVertexSrc, fragment:
r=e.defaultFragmentTemplate}={}) {
this.shaderGenerator = new BatchShaderGenerator(t,r)
}
contextChange() {
const t = this.renderer.gl;
settings.PREFER_ENV === ENV.WEBGL_LEGACY ? this.maxTextures = 1 :
(this.maxTextures = Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
e.defaultMaxTextures),
this.maxTextures = checkMaxIfStatementsInShader(this.maxTextures,
t)),
this._shader =
this.shaderGenerator.generateShader(this.maxTextures);
for (let e = 0; e < this._packedGeometryPoolSize; e++)
this._packedGeometries[e] = new this.geometryClass;
this.initFlushBuffers()
}
initFlushBuffers() {
const {_drawCallPool: t, _textureArrayPool: r} = e
, n = this.size / 4
, i = Math.floor(n / this.maxTextures) + 1;
for (; t.length < n; )
t.push(new BatchDrawCall);
for (; r.length < i; )
r.push(new BatchTextureArray);
for (let e = 0; e < this.maxTextures; e++)
this._tempBoundTextures[e] = null
}
onPrerender() {
this._flushId = 0
}
render(e) {
e._texture.valid && (this._vertexCount + e.vertexData.length / 2 >
this.size && this.flush(),
this._vertexCount += e.vertexData.length / 2,
this._indexCount += e.indices.length,
this._bufferedTextures[this._bufferSize] = e._texture.baseTexture,
this._bufferedElements[this._bufferSize++] = e)
}
buildTexturesAndDrawCalls() {
const {_bufferedTextures: t, maxTextures: r} = this
, n = e._textureArrayPool
, i = this.renderer.batch
, o = this._tempBoundTextures
, s = this.renderer.textureGC.count;
let a = ++BaseTexture._globalBatch
, l = 0
, c = n[0]
, u = 0;
i.copyBoundTextures(o, r);
for (let e = 0; e < this._bufferSize; ++e) {
const d = t[e];
t[e] = null,
d._batchEnabled !== a && (c.count >= r && (i.boundArray(c, o,
a, r),
this.buildDrawCalls(c, u, e),
u = e,
c = n[++l],
++a),
d._batchEnabled = a,
d.touched = s,
c.elements[c.count++] = d)
}
c.count > 0 && (i.boundArray(c, o, a, r),
this.buildDrawCalls(c, u, this._bufferSize),
++l,
++a);
for (let e = 0; e < o.length; e++)
o[e] = null;
BaseTexture._globalBatch = a
}
buildDrawCalls(t, r, n) {
const {_bufferedElements: i, _attributeBuffer: o, _indexBuffer: s,
vertexSize: a} = this
, l = e._drawCallPool;
let c = this._dcIndex
, u = this._aIndex
, d = this._iIndex
, p = l[c];
p.start = this._iIndex,
p.texArray = t;
for (let e = r; e < n; ++e) {
const n = i[e]
, h = n._texture.baseTexture
, f = premultiplyBlendMode[h.alphaMode ? 1 : 0][n.blendMode];
i[e] = null,
r < e && p.blend !== f && (p.size = d - p.start,
r = e,
p = l[++c],
p.texArray = t,
p.start = d),
this.packInterleavedGeometry(n, o, s, u, d),
u += n.vertexData.length / 2 * a,
d += n.indices.length,
p.blend = f
}
r < n && (p.size = d - p.start,
++c),
this._dcIndex = c,
this._aIndex = u,
this._iIndex = d
}
bindAndClearTexArray(e) {
const t = this.renderer.texture;
for (let r = 0; r < e.count; r++)
t.bind(e.elements[r], e.ids[r]),
e.elements[r] = null;
e.count = 0
}
updateGeometry() {
const {_packedGeometries: t, _attributeBuffer: r, _indexBuffer: n}
= this;
e.canUploadSameBuffer ?
(t[this._flushId]._buffer.update(r.rawBinaryData),
t[this._flushId]._indexBuffer.update(n),
this.renderer.geometry.updateBuffers()) :
(this._packedGeometryPoolSize <= this._flushId && (this._packedGeometryPoolSize++,
t[this._flushId] = new this.geometryClass),
t[this._flushId]._buffer.update(r.rawBinaryData),
t[this._flushId]._indexBuffer.update(n),
this.renderer.geometry.bind(t[this._flushId]),
this.renderer.geometry.updateBuffers(),
this._flushId++)
}
drawBatches() {
const t = this._dcIndex
, {gl: r, state: n} = this.renderer
, i = e._drawCallPool;
let o = null;
for (let e = 0; e < t; e++) {
const {texArray: t, type: s, size: a, start: l, blend: c} =
i[e];
o !== t && (o = t,
this.bindAndClearTexArray(t)),
this.state.blendMode = c,
n.set(this.state),
r.drawElements(s, a, r.UNSIGNED_SHORT, 2 * l)
}
}
flush() {
0 !== this._vertexCount && (this._attributeBuffer =
this.getAttributeBuffer(this._vertexCount),
this._indexBuffer = this.getIndexBuffer(this._indexCount),
this._aIndex = 0,
this._iIndex = 0,
this._dcIndex = 0,
this.buildTexturesAndDrawCalls(),
this.updateGeometry(),
this.drawBatches(),
this._bufferSize = 0,
this._vertexCount = 0,
this._indexCount = 0)
}
start() {
this.renderer.state.set(this.state),
this.renderer.texture.ensureSamplerType(this.maxTextures),
this.renderer.shader.bind(this._shader),
e.canUploadSameBuffer &&
this.renderer.geometry.bind(this._packedGeometries[this._flushId])
}
stop() {
this.flush()
}
destroy() {
for (let e = 0; e < this._packedGeometryPoolSize; e++)
this._packedGeometries[e] &&
this._packedGeometries[e].destroy();
this.renderer.off("prerender", this.onPrerender, this),
this._aBuffers = null,
this._iBuffers = null,
this._packedGeometries = null,
this._attributeBuffer = null,
this._indexBuffer = null,
this._shader && (this._shader.destroy(),
this._shader = null),
super.destroy()
}
getAttributeBuffer(e) {
const t = nextPow2(Math.ceil(e / 8))
, r = log2(t)
, n = 8 * t;
this._aBuffers.length <= r && (this._iBuffers.length = r + 1);
let i = this._aBuffers[n];
return i || (this._aBuffers[n] = i = new ViewableBuffer(n *
this.vertexSize * 4)),
i
}
getIndexBuffer(e) {
const t = nextPow2(Math.ceil(e / 12))
, r = log2(t)
, n = 12 * t;
this._iBuffers.length <= r && (this._iBuffers.length = r + 1);
let i = this._iBuffers[r];
return i || (this._iBuffers[r] = i = new Uint16Array(n)),
i
}
packInterleavedGeometry(e, t, r, n, i) {
const {uint32View: o, float32View: s} = t
, a = n / this.vertexSize
, l = e.uvs
, c = e.indices
, u = e.vertexData
, d = e._texture.baseTexture._batchLocation
, p = Math.min(e.worldAlpha, 1)
, h = Color$2.shared.setValue(e._tintRGB).toPremultiplied(p,
e._texture.baseTexture.alphaMode > 0);
for (let f = 0; f < u.length; f += 2)
s[n++] = u[f],
s[n++] = u[f + 1],
s[n++] = l[f],
s[n++] = l[f + 1],
o[n++] = h,
s[n++] = d;
for (let f = 0; f < c.length; f++)
r[i++] = a + c[f]
}
}
;
_BatchRenderer.defaultBatchSize = 4096,
_BatchRenderer.extension = {
name: "batch",
type: ExtensionType.RendererPlugin
},
_BatchRenderer._drawCallPool = [],
_BatchRenderer._textureArrayPool = [];
let BatchRenderer = _BatchRenderer;
extensions$1.add(BatchRenderer);
var defaultFragment = "varying vec2 vTextureCoord;\n\nuniform sampler2D
uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler,
vTextureCoord);\n}\n"
, defaultVertex$1 = "attribute vec2 aVertexPosition;\n\nuniform mat3
projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\
nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2
position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2
filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw *
inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\
n vTextureCoord = filterTextureCoord();\n}\n";
const _Filter = class e extends Shader {
constructor(t, r, n) {
super(Program.from(t || e.defaultVertexSrc, r ||
e.defaultFragmentSrc), n),
this.padding = 0,
this.resolution = e.defaultResolution,
this.multisample = e.defaultMultisample,
this.enabled = !0,
this.autoFit = !0,
this.state = new State
}
apply(e, t, r, n, i) {
e.applyFilter(this, t, r, n)
}
get blendMode() {
return this.state.blendMode
}
set blendMode(e) {
this.state.blendMode = e
}
get resolution() {
return this._resolution
}
set resolution(e) {
this._resolution = e
}
static get defaultVertexSrc() {
return defaultVertex$1
}
static get defaultFragmentSrc() {
return defaultFragment
}
}
;
_Filter.defaultResolution = 1,
_Filter.defaultMultisample = MSAA_QUALITY.NONE;
let Filter$2 = _Filter;
class BackgroundSystem {
constructor() {
this.clearBeforeRender = !0,
this._backgroundColor = new Color$2(0),
this.alpha = 1
}
init(e) {
this.clearBeforeRender = e.clearBeforeRender;
const {backgroundColor: t, background: r, backgroundAlpha: n} = e
, i = r ?? t;
void 0 !== i && (this.color = i),
this.alpha = n
}
get color() {
return this._backgroundColor.value
}
set color(e) {
this._backgroundColor.setValue(e)
}
get alpha() {
return this._backgroundColor.alpha
}
set alpha(e) {
this._backgroundColor.setAlpha(e)
}
get backgroundColor() {
return this._backgroundColor
}
destroy() {}
}
BackgroundSystem.defaultOptions = {
backgroundAlpha: 1,
backgroundColor: 0,
clearBeforeRender: !0
},
BackgroundSystem.extension = {
type: [ExtensionType.RendererSystem,
ExtensionType.CanvasRendererSystem],
name: "background"
},
extensions$1.add(BackgroundSystem);
class BatchSystem {
constructor(e) {
this.renderer = e,
this.emptyRenderer = new ObjectRenderer(e),
this.currentRenderer = this.emptyRenderer
}
setObjectRenderer(e) {
this.currentRenderer !== e && (this.currentRenderer.stop(),
this.currentRenderer = e,
this.currentRenderer.start())
}
flush() {
this.setObjectRenderer(this.emptyRenderer)
}
reset() {
this.setObjectRenderer(this.emptyRenderer)
}
copyBoundTextures(e, t) {
const {boundTextures: r} = this.renderer.texture;
for (let n = t - 1; n >= 0; --n)
e[n] = r[n] || null,
e[n] && (e[n]._batchLocation = n)
}
boundArray(e, t, r, n) {
const {elements: i, ids: o, count: s} = e;
let a = 0;
for (let l = 0; l < s; l++) {
const e = i[l]
, s = e._batchLocation;
if (s >= 0 && s < n && t[s] === e)
o[l] = s;
else
for (; a < n; ) {
const n = t[a];
if (!n || n._batchEnabled !== r || n._batchLocation !==
a) {
o[l] = a,
e._batchLocation = a,
t[a] = e;
break
}
a++
}
}
}
destroy() {
this.renderer = null
}
}
BatchSystem.extension = {
type: ExtensionType.RendererSystem,
name: "batch"
},
extensions$1.add(BatchSystem);
let CONTEXT_UID_COUNTER = 0;
class ContextSystem {
constructor(e) {
this.renderer = e,
this.webGLVersion = 1,
this.extensions = {},
this.supports = {
uint32Indices: !1
},
this.handleContextLost = this.handleContextLost.bind(this),
this.handleContextRestored = this.handleContextRestored.bind(this)
}
get isLost() {
return !this.gl || this.gl.isContextLost()
}
contextChange(e) {
this.gl = e,
this.renderer.gl = e,
this.renderer.CONTEXT_UID = CONTEXT_UID_COUNTER++
}
init(e) {
if (e.context)
this.initFromContext(e.context);
else {
const t = this.renderer.background.alpha < 1
, r = e.premultipliedAlpha;
this.preserveDrawingBuffer = e.preserveDrawingBuffer,
this.useContextAlpha = e.useContextAlpha,
this.powerPreference = e.powerPreference,
this.initFromOptions({
alpha: t,
premultipliedAlpha: r,
antialias: e.antialias,
stencil: !0,
preserveDrawingBuffer: e.preserveDrawingBuffer,
powerPreference: e.powerPreference
})
}
}
initFromContext(e) {
this.gl = e,
this.validateContext(e),
this.renderer.gl = e,
this.renderer.CONTEXT_UID = CONTEXT_UID_COUNTER++,
this.renderer.runners.contextChange.emit(e);
const t = this.renderer.view;
void 0 !== t.addEventListener &&
(t.addEventListener("webglcontextlost", this.handleContextLost, !1),
t.addEventListener("webglcontextrestored",
this.handleContextRestored, !1))
}
initFromOptions(e) {
const t = this.createContext(this.renderer.view, e);
this.initFromContext(t)
}
createContext(e, t) {
let r;
if (settings.PREFER_ENV >= ENV.WEBGL2 && (r =
e.getContext("webgl2", t)),
r)
this.webGLVersion = 2;
else if (this.webGLVersion = 1,
r = e.getContext("webgl", t) || e.getContext("experimental-webgl",
t),
!r)
throw new Error("This browser does not support WebGL. Try using
the canvas renderer");
return this.gl = r,
this.getExtensions(),
this.gl
}
getExtensions() {
const {gl: e} = this
, t = {
loseContext: e.getExtension("WEBGL_lose_context"),
anisotropicFiltering:
e.getExtension("EXT_texture_filter_anisotropic"),
floatTextureLinear: e.getExtension("OES_texture_float_linear"),
s3tc: e.getExtension("WEBGL_compressed_texture_s3tc"),
s3tc_sRGB:
e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
etc: e.getExtension("WEBGL_compressed_texture_etc"),
etc1: e.getExtension("WEBGL_compressed_texture_etc1"),
pvrtc: e.getExtension("WEBGL_compressed_texture_pvrtc") ||
e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
atc: e.getExtension("WEBGL_compressed_texture_atc"),
astc: e.getExtension("WEBGL_compressed_texture_astc"),
bptc: e.getExtension("EXT_texture_compression_bptc")
};
1 === this.webGLVersion ? Object.assign(this.extensions, t, {
drawBuffers: e.getExtension("WEBGL_draw_buffers"),
depthTexture: e.getExtension("WEBGL_depth_texture"),
vertexArrayObject: e.getExtension("OES_vertex_array_object") ||
e.getExtension("MOZ_OES_vertex_array_object") ||
e.getExtension("WEBKIT_OES_vertex_array_object"),
uint32ElementIndex: e.getExtension("OES_element_index_uint"),
floatTexture: e.getExtension("OES_texture_float"),
floatTextureLinear: e.getExtension("OES_texture_float_linear"),
textureHalfFloat: e.getExtension("OES_texture_half_float"),
textureHalfFloatLinear:
e.getExtension("OES_texture_half_float_linear")
}) : 2 === this.webGLVersion && Object.assign(this.extensions, t, {
colorBufferFloat: e.getExtension("EXT_color_buffer_float")
})
}
handleContextLost(e) {
e.preventDefault(),
setTimeout(( () => {
this.gl.isContextLost() && this.extensions.loseContext &&
this.extensions.loseContext.restoreContext()
}
), 0)
}
handleContextRestored() {
this.renderer.runners.contextChange.emit(this.gl)
}
destroy() {
const e = this.renderer.view;
this.renderer = null,
void 0 !== e.removeEventListener &&
(e.removeEventListener("webglcontextlost", this.handleContextLost),
e.removeEventListener("webglcontextrestored",
this.handleContextRestored)),
this.gl.useProgram(null),
this.extensions.loseContext &&
this.extensions.loseContext.loseContext()
}
postrender() {
this.renderer.objectRenderer.renderingToScreen && this.gl.flush()
}
validateContext(e) {
const t = e.getContextAttributes()
, r = "WebGL2RenderingContext"in globalThis && e instanceof
globalThis.WebGL2RenderingContext;
r && (this.webGLVersion = 2),
t && t.stencil;
const n = r || !!e.getExtension("OES_element_index_uint");
this.supports.uint32Indices = n
}
}
ContextSystem.defaultOptions = {
context: null,
antialias: !1,
premultipliedAlpha: !0,
preserveDrawingBuffer: !1,
powerPreference: "default"
},
ContextSystem.extension = {
type: ExtensionType.RendererSystem,
name: "context"
},
extensions$1.add(ContextSystem);
class Framebuffer {
constructor(e, t) {
if (this.width = Math.round(e),
this.height = Math.round(t),
!this.width || !this.height)
throw new Error("Framebuffer width or height is zero");
this.stencil = !1,
this.depth = !1,
this.dirtyId = 0,
this.dirtyFormat = 0,
this.dirtySize = 0,
this.depthTexture = null,
this.colorTextures = [],
this.glFramebuffers = {},
this.disposeRunner = new Runner("disposeFramebuffer"),
this.multisample = MSAA_QUALITY.NONE
}
get colorTexture() {
return this.colorTextures[0]
}
addColorTexture(e=0, t) {
return this.colorTextures[e] = t || new BaseTexture(null,{
scaleMode: SCALE_MODES.NEAREST,
resolution: 1,
mipmap: MIPMAP_MODES.OFF,
width: this.width,
height: this.height
}),
this.dirtyId++,
this.dirtyFormat++,
this
}
addDepthTexture(e) {
return this.depthTexture = e || new BaseTexture(null,{
scaleMode: SCALE_MODES.NEAREST,
resolution: 1,
width: this.width,
height: this.height,
mipmap: MIPMAP_MODES.OFF,
format: FORMATS.DEPTH_COMPONENT,
type: TYPES.UNSIGNED_SHORT
}),
this.dirtyId++,
this.dirtyFormat++,
this
}
enableDepth() {
return this.depth = !0,
this.dirtyId++,
this.dirtyFormat++,
this
}
enableStencil() {
return this.stencil = !0,
this.dirtyId++,
this.dirtyFormat++,
this
}
resize(e, t) {
if (e = Math.round(e),
t = Math.round(t),
!e || !t)
throw new Error("Framebuffer width and height must not be
zero");
if (e !== this.width || t !== this.height) {
this.width = e,
this.height = t,
this.dirtyId++,
this.dirtySize++;
for (let r = 0; r < this.colorTextures.length; r++) {
const n = this.colorTextures[r]
, i = n.resolution;
n.setSize(e / i, t / i)
}
if (this.depthTexture) {
const r = this.depthTexture.resolution;
this.depthTexture.setSize(e / r, t / r)
}
}
}
dispose() {
this.disposeRunner.emit(this, !1)
}
destroyDepthTexture() {
this.depthTexture && (this.depthTexture.destroy(),
this.depthTexture = null,
++this.dirtyId,
++this.dirtyFormat)
}
}
class BaseRenderTexture extends BaseTexture {
constructor(e={}) {
if ("number" == typeof e) {
e = {
width: arguments[0],
height: arguments[1],
scaleMode: arguments[2],
resolution: arguments[3]
}
}
e.width = e.width ?? 100,
e.height = e.height ?? 100,
e.multisample ?? (e.multisample = MSAA_QUALITY.NONE),
super(null, e),
this.mipmap = MIPMAP_MODES.OFF,
this.valid = !0,
this._clear = new Color$2([0, 0, 0, 0]),
this.framebuffer = new
Framebuffer(this.realWidth,this.realHeight).addColorTexture(0, this),
this.framebuffer.multisample = e.multisample,
this.maskStack = [],
this.filterStack = [{}]
}
set clearColor(e) {
this._clear.setValue(e)
}
get clearColor() {
return this._clear.value
}
get clear() {
return this._clear
}
get multisample() {
return this.framebuffer.multisample
}
set multisample(e) {
this.framebuffer.multisample = e
}
resize(e, t) {
this.framebuffer.resize(e * this.resolution, t * this.resolution),
this.setRealSize(this.framebuffer.width, this.framebuffer.height)
}
dispose() {
this.framebuffer.dispose(),
super.dispose()
}
destroy() {
super.destroy(),
this.framebuffer.destroyDepthTexture(),
this.framebuffer = null
}
}
class BaseImageResource extends Resource {
constructor(e) {
const t = e;
super(t.naturalWidth || t.videoWidth || t.displayWidth || t.width,
t.naturalHeight || t.videoHeight || t.displayHeight || t.height),
this.source = e,
this.noSubImage = !1
}
static crossOrigin(e, t, r) {
void 0 !== r || t.startsWith("data:") ? !1 !== r && (e.crossOrigin
= "string" == typeof r ? r : "anonymous") : e.crossOrigin = determineCrossOrigin(t)
}
upload(e, t, r, n) {
const i = e.gl
, o = t.realWidth
, s = t.realHeight;
if (n = n || this.source,
typeof HTMLImageElement < "u" && n instanceof HTMLImageElement) {
if (!n.complete || 0 === n.naturalWidth)
return !1
} else if (typeof HTMLVideoElement < "u" && n instanceof
HTMLVideoElement && n.readyState <= 1)
return !1;
return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.alphaMode
=== ALPHA_MODES.UNPACK),
this.noSubImage || t.target !== i.TEXTURE_2D || r.width !== o ||
r.height !== s ? (r.width = o,
r.height = s,
i.texImage2D(t.target, 0, r.internalFormat, t.format, r.type, n)) :
i.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, t.format, r.type, n),
!0
}
update() {
if (this.destroyed)
return;
const e = this.source
, t = e.naturalWidth || e.videoWidth || e.width
, r = e.naturalHeight || e.videoHeight || e.height;
this.resize(t, r),
super.update()
}
dispose() {
this.source = null
}
}
class ImageResource extends BaseImageResource {
constructor(e, t) {
if (t = t || {},
"string" == typeof e) {
const r = new Image;
BaseImageResource.crossOrigin(r, e, t.crossorigin),
r.src = e,
e = r
}
super(e),
!e.complete && this._width && this._height && (this._width = 0,
this._height = 0),
this.url = e.src,
this._process = null,
this.preserveBitmap = !1,
this.createBitmap = (t.createBitmap ??
settings.CREATE_IMAGE_BITMAP) && !!globalThis.createImageBitmap,
this.alphaMode = "number" == typeof t.alphaMode ? t.alphaMode :
null,
this.bitmap = null,
this._load = null,
!1 !== t.autoLoad && this.load()
}
load(e) {
return this._load || (void 0 !== e && (this.createBitmap = e),
this._load = new Promise(( (e, t) => {
const r = this.source;
this.url = r.src;
const n = () => {
this.destroyed || (r.onload = null,
r.onerror = null,
this.update(),
this._load = null,
this.createBitmap ? e(this.process()) : e(this))
}
;
r.complete && r.src ? n() : (r.onload = n,
r.onerror = e => {
t(e),
this.onError.emit(e)
}
)
}
))),
this._load
}
process() {
const e = this.source;
if (null !== this._process)
return this._process;
if (null !== this.bitmap || !globalThis.createImageBitmap)
return Promise.resolve(this);
const t = globalThis.createImageBitmap
, r = !e.crossOrigin || "anonymous" === e.crossOrigin;
return this._process = fetch(e.src, {
mode: r ? "cors" : "no-cors"
}).then((e => e.blob())).then((r => t(r, 0, 0, e.width, e.height, {
premultiplyAlpha: null === this.alphaMode || this.alphaMode ===
ALPHA_MODES.UNPACK ? "premultiply" : "none"
}))).then((e => this.destroyed ? Promise.reject() : (this.bitmap =
e,
this.update(),
this._process = null,
Promise.resolve(this)))),
this._process
}
upload(e, t, r) {
if ("number" == typeof this.alphaMode && (t.alphaMode =
this.alphaMode),
!this.createBitmap)
return super.upload(e, t, r);
if (!this.bitmap && (this.process(),
!this.bitmap))
return !1;
if (super.upload(e, t, r, this.bitmap),
!this.preserveBitmap) {
let e = !0;
const n = t._glTextures;
for (const i in n) {
const o = n[i];
if (o !== r && o.dirtyId !== t.dirtyId) {
e = !1;
break
}
}
e && (this.bitmap.close && this.bitmap.close(),
this.bitmap = null)
}
return !0
}
dispose() {
this.source.onload = null,
this.source.onerror = null,
super.dispose(),
this.bitmap && (this.bitmap.close(),
this.bitmap = null),
this._process = null,
this._load = null
}
static test(e) {
return typeof HTMLImageElement < "u" && ("string" == typeof e || e
instanceof HTMLImageElement)
}
}
class TextureUvs {
constructor() {
this.x0 = 0,
this.y0 = 0,
this.x1 = 1,
this.y1 = 0,
this.x2 = 1,
this.y2 = 1,
this.x3 = 0,
this.y3 = 1,
this.uvsFloat32 = new Float32Array(8)
}
set(e, t, r) {
const n = t.width
, i = t.height;
if (r) {
const t = e.width / 2 / n
, o = e.height / 2 / i
, s = e.x / n + t
, a = e.y / i + o;
r = groupD8.add(r, groupD8.NW),
this.x0 = s + t * groupD8.uX(r),
this.y0 = a + o * groupD8.uY(r),
r = groupD8.add(r, 2),
this.x1 = s + t * groupD8.uX(r),
this.y1 = a + o * groupD8.uY(r),
r = groupD8.add(r, 2),
this.x2 = s + t * groupD8.uX(r),
this.y2 = a + o * groupD8.uY(r),
r = groupD8.add(r, 2),
this.x3 = s + t * groupD8.uX(r),
this.y3 = a + o * groupD8.uY(r)
} else
this.x0 = e.x / n,
this.y0 = e.y / i,
this.x1 = (e.x + e.width) / n,
this.y1 = e.y / i,
this.x2 = (e.x + e.width) / n,
this.y2 = (e.y + e.height) / i,
this.x3 = e.x / n,
this.y3 = (e.y + e.height) / i;
this.uvsFloat32[0] = this.x0,
this.uvsFloat32[1] = this.y0,
this.uvsFloat32[2] = this.x1,
this.uvsFloat32[3] = this.y1,
this.uvsFloat32[4] = this.x2,
this.uvsFloat32[5] = this.y2,
this.uvsFloat32[6] = this.x3,
this.uvsFloat32[7] = this.y3
}
}
TextureUvs.prototype.toString = function() {
return `[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=$
{this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`
}
;
const DEFAULT_UVS = new TextureUvs;
function removeAllHandlers(e) {
e.destroy = function() {}
,
e.on = function() {}
,
e.once = function() {}
,
e.emit = function() {}
}
class Texture extends EventEmitter$2 {
constructor(e, t, r, n, i, o, s) {
if (super(),
this.noFrame = !1,
t || (this.noFrame = !0,
t = new Rectangle(0,0,1,1)),
e instanceof Texture && (e = e.baseTexture),
this.baseTexture = e,
this._frame = t,
this.trim = n,
this.valid = !1,
this.destroyed = !1,
this._uvs = DEFAULT_UVS,
this.uvMatrix = null,
this.orig = r || t,
this._rotate = Number(i || 0),
!0 === i)
this._rotate = 2;
else if (this._rotate % 2 != 0)
throw new Error("attempt to use diamond-shaped UVs. If you are
sure, set rotation manually");
this.defaultAnchor = o ? new Point(o.x,o.y) : new Point(0,0),
this.defaultBorders = s,
this._updateID = 0,
this.textureCacheIds = [],
e.valid ? this.noFrame ? e.valid && this.onBaseTextureUpdated(e) :
this.frame = t : e.once("loaded", this.onBaseTextureUpdated, this),
this.noFrame && e.on("update", this.onBaseTextureUpdated, this)
}
update() {
this.baseTexture.resource && this.baseTexture.resource.update()
}
onBaseTextureUpdated(e) {
if (this.noFrame) {
if (!this.baseTexture.valid)
return;
this._frame.width = e.width,
this._frame.height = e.height,
this.valid = !0,
this.updateUvs()
} else
this.frame = this._frame;
this.emit("update", this)
}
destroy(e) {
if (this.baseTexture) {
if (e) {
const {resource: e} = this.baseTexture;
(null == e ? void 0 : e.url) && TextureCache[e.url] &&
Texture.removeFromCache(e.url),
this.baseTexture.destroy()
}
this.baseTexture.off("loaded", this.onBaseTextureUpdated,
this),
this.baseTexture.off("update", this.onBaseTextureUpdated,
this),
this.baseTexture = null
}
this._frame = null,
this._uvs = null,
this.trim = null,
this.orig = null,
this.valid = !1,
Texture.removeFromCache(this),
this.textureCacheIds = null,
this.destroyed = !0,
this.emit("destroyed", this),
this.removeAllListeners()
}
clone() {
var e;
const t = this._frame.clone()
, r = this._frame === this.orig ? t : this.orig.clone()
, n = new Texture(this.baseTexture,!this.noFrame && t,r,null ==
(e = this.trim) ? void 0 :
e.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);
return this.noFrame && (n._frame = t),
n
}
updateUvs() {
this._uvs === DEFAULT_UVS && (this._uvs = new TextureUvs),
this._uvs.set(this._frame, this.baseTexture, this.rotate),
this._updateID++
}
static from(e, t={}, r=settings.STRICT_TEXTURE_CACHE) {
const n = "string" == typeof e;
let i = null;
if (n)
i = e;
else if (e instanceof BaseTexture) {
if (!e.cacheId) {
const r = (null == t ? void 0 : t.pixiIdPrefix) ||
"pixiid";
e.cacheId = `${r}-${uid()}`,
BaseTexture.addToCache(e, e.cacheId)
}
i = e.cacheId
} else {
if (!e._pixiId) {
const r = (null == t ? void 0 : t.pixiIdPrefix) ||
"pixiid";
e._pixiId = `${r}_${uid()}`
}
i = e._pixiId
}
let o = TextureCache[i];
if (n && r && !o)
throw new Error(`The cacheId "${i}" does not exist in
TextureCache.`);
return o || e instanceof BaseTexture ? !o && e instanceof
BaseTexture && (o = new Texture(e),
Texture.addToCache(o, i)) : (t.resolution || (t.resolution =
getResolutionOfUrl(e)),
o = new Texture(new BaseTexture(e,t)),
o.baseTexture.cacheId = i,
BaseTexture.addToCache(o.baseTexture, i),
Texture.addToCache(o, i)),
o
}
static fromURL(e, t) {
const r = Object.assign({
autoLoad: !1
}, null == t ? void 0 : t.resourceOptions)
, n = Texture.from(e, Object.assign({
resourceOptions: r
}, t), !1)
, i = n.baseTexture.resource;
return n.baseTexture.valid ? Promise.resolve(n) :
i.load().then(( () => Promise.resolve(n)))
}
static fromBuffer(e, t, r, n) {
return new Texture(BaseTexture.fromBuffer(e, t, r, n))
}
static fromLoader(e, t, r, n) {
const i = new BaseTexture(e,Object.assign({
scaleMode: BaseTexture.defaultOptions.scaleMode,
resolution: getResolutionOfUrl(t)
}, n))
, {resource: o} = i;
o instanceof ImageResource && (o.url = t);
const s = new Texture(i);
return r || (r = t),
BaseTexture.addToCache(s.baseTexture, r),
Texture.addToCache(s, r),
r !== t && (BaseTexture.addToCache(s.baseTexture, t),
Texture.addToCache(s, t)),
s.baseTexture.valid ? Promise.resolve(s) : new Promise((e => {
s.baseTexture.once("loaded", ( () => e(s)))
}
))
}
static addToCache(e, t) {
t && (e.textureCacheIds.includes(t) || e.textureCacheIds.push(t),
TextureCache[t] && TextureCache[t],
TextureCache[t] = e)
}
static removeFromCache(e) {
if ("string" == typeof e) {
const t = TextureCache[e];
if (t) {
const r = t.textureCacheIds.indexOf(e);
return r > -1 && t.textureCacheIds.splice(r, 1),
delete TextureCache[e],
t
}
} else if (null == e ? void 0 : e.textureCacheIds) {
for (let t = 0; t < e.textureCacheIds.length; ++t)
TextureCache[e.textureCacheIds[t]] === e && delete
TextureCache[e.textureCacheIds[t]];
return e.textureCacheIds.length = 0,
e
}
return null
}
get resolution() {
return this.baseTexture.resolution
}
get frame() {
return this._frame
}
set frame(e) {
this._frame = e,
this.noFrame = !1;
const {x: t, y: r, width: n, height: i} = e
, o = t + n > this.baseTexture.width
, s = r + i > this.baseTexture.height;
if (o || s) {
const e = o && s ? "and" : "or"
, a = `X: ${t} + ${n} = ${t + n} > ${this.baseTexture.width}`
, l = `Y: ${r} + ${i} = ${r + i} > $
{this.baseTexture.height}`;
throw new Error(`Texture Error: frame does not fit inside the
base Texture dimensions: ${a} ${e} ${l}`)
}
this.valid = n && i && this.baseTexture.valid,
!this.trim && !this.rotate && (this.orig = e),
this.valid && this.updateUvs()
}
get rotate() {
return this._rotate
}
set rotate(e) {
this._rotate = e,
this.valid && this.updateUvs()
}
get width() {
return this.orig.width
}
get height() {
return this.orig.height
}
castToBaseTexture() {
return this.baseTexture
}
static get EMPTY() {
return Texture._EMPTY || (Texture._EMPTY = new Texture(new
BaseTexture),
removeAllHandlers(Texture._EMPTY),
removeAllHandlers(Texture._EMPTY.baseTexture)),
Texture._EMPTY
}
static get WHITE() {
if (!Texture._WHITE) {
const e = settings.ADAPTER.createCanvas(16, 16)
, t = e.getContext("2d");
e.width = 16,
e.height = 16,
t.fillStyle = "white",
t.fillRect(0, 0, 16, 16),
Texture._WHITE = new Texture(BaseTexture.from(e)),
removeAllHandlers(Texture._WHITE),
removeAllHandlers(Texture._WHITE.baseTexture)
}
return Texture._WHITE
}
}
class RenderTexture extends Texture {
constructor(e, t) {
super(e, t),
this.valid = !0,
this.filterFrame = null,
this.filterPoolKey = null,
this.updateUvs()
}
get framebuffer() {
return this.baseTexture.framebuffer
}
get multisample() {
return this.framebuffer.multisample
}
set multisample(e) {
this.framebuffer.multisample = e
}
resize(e, t, r=!0) {
const n = this.baseTexture.resolution
, i = Math.round(e * n) / n
, o = Math.round(t * n) / n;
this.valid = i > 0 && o > 0,
this._frame.width = this.orig.width = i,
this._frame.height = this.orig.height = o,
r && this.baseTexture.resize(i, o),
this.updateUvs()
}
setResolution(e) {
const {baseTexture: t} = this;
t.resolution !== e && (t.setResolution(e),
this.resize(t.width, t.height, !1))
}
static create(e) {
return new RenderTexture(new BaseRenderTexture(e))
}
}
class RenderTexturePool {
constructor(e) {
this.texturePool = {},
this.textureOptions = e || {},
this.enableFullScreen = !1,
this._pixelsWidth = 0,
this._pixelsHeight = 0
}
createTexture(e, t, r=MSAA_QUALITY.NONE) {
const n = new BaseRenderTexture(Object.assign({
width: e,
height: t,
resolution: 1,
multisample: r
}, this.textureOptions));
return new RenderTexture(n)
}
getOptimalTexture(e, t, r=1, n=MSAA_QUALITY.NONE) {
let i;
e = Math.max(Math.ceil(e * r - 1e-6), 1),
t = Math.max(Math.ceil(t * r - 1e-6), 1),
this.enableFullScreen && e === this._pixelsWidth && t ===
this._pixelsHeight ? i = n > 1 ? -n : -1 : (i = ((65535 & (e = nextPow2(e))) << 16
| 65535 & (t = nextPow2(t))) >>> 0,
n > 1 && (i += 4294967296 * n)),
this.texturePool[i] || (this.texturePool[i] = []);
let o = this.texturePool[i].pop();
return o || (o = this.createTexture(e, t, n)),
o.filterPoolKey = i,
o.setResolution(r),
o
}
getFilterTexture(e, t, r) {
const n = this.getOptimalTexture(e.width, e.height, t ||
e.resolution, r || MSAA_QUALITY.NONE);
return n.filterFrame = e.filterFrame,
n
}
returnTexture(e) {
const t = e.filterPoolKey;
e.filterFrame = null,
this.texturePool[t].push(e)
}
returnFilterTexture(e) {
this.returnTexture(e)
}
clear(e) {
if (e = !1 !== e)
for (const t in this.texturePool) {
const e = this.texturePool[t];
if (e)
for (let t = 0; t < e.length; t++)
e[t].destroy(!0)
}
this.texturePool = {}
}
setScreenSize(e) {
if (e.width !== this._pixelsWidth || e.height !==
this._pixelsHeight) {
this.enableFullScreen = e.width > 0 && e.height > 0;
for (const e in this.texturePool) {
if (!(Number(e) < 0))
continue;
const t = this.texturePool[e];
if (t)
for (let e = 0; e < t.length; e++)
t[e].destroy(!0);
this.texturePool[e] = []
}
this._pixelsWidth = e.width,
this._pixelsHeight = e.height
}
}
}
RenderTexturePool.SCREEN_KEY = -1;
class Quad extends Geometry {
constructor() {
super(),
this.addAttribute("aVertexPosition", new Float32Array([0, 0, 1, 0,
1, 1, 0, 1])).addIndex([0, 1, 3, 2])
}
}
class QuadUv extends Geometry {
constructor() {
super(),
this.vertices = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]),
this.uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
this.vertexBuffer = new Buffer$3(this.vertices),
this.uvBuffer = new Buffer$3(this.uvs),
this.addAttribute("aVertexPosition",
this.vertexBuffer).addAttribute("aTextureCoord", this.uvBuffer).addIndex([0, 1, 2,
0, 2, 3])
}
map(e, t) {
let r = 0
, n = 0;
return this.uvs[0] = r,
this.uvs[1] = n,
this.uvs[2] = r + t.width / e.width,
this.uvs[3] = n,
this.uvs[4] = r + t.width / e.width,
this.uvs[5] = n + t.height / e.height,
this.uvs[6] = r,
this.uvs[7] = n + t.height / e.height,
r = t.x,
n = t.y,
this.vertices[0] = r,
this.vertices[1] = n,
this.vertices[2] = r + t.width,
this.vertices[3] = n,
this.vertices[4] = r + t.width,
this.vertices[5] = n + t.height,
this.vertices[6] = r,
this.vertices[7] = n + t.height,
this.invalidate(),
this
}
invalidate() {
return this.vertexBuffer._updateID++,
this.uvBuffer._updateID++,
this
}
}
class FilterState {
constructor() {
this.renderTexture = null,
this.target = null,
this.legacy = !1,
this.resolution = 1,
this.multisample = MSAA_QUALITY.NONE,
this.sourceFrame = new Rectangle,
this.destinationFrame = new Rectangle,
this.bindingSourceFrame = new Rectangle,
this.bindingDestinationFrame = new Rectangle,
this.filters = [],
this.transform = null
}
clear() {
this.target = null,
this.filters = null,
this.renderTexture = null
}
}
const tempPoints = [new Point, new Point, new Point, new Point]
, tempMatrix$2 = new Matrix;
class FilterSystem {
constructor(e) {
this.renderer = e,
this.defaultFilterStack = [{}],
this.texturePool = new RenderTexturePool,
this.statePool = [],
this.quad = new Quad,
this.quadUv = new QuadUv,
this.tempRect = new Rectangle,
this.activeState = {},
this.globalUniforms = new UniformGroup({
outputFrame: new Rectangle,
inputSize: new Float32Array(4),
inputPixel: new Float32Array(4),
inputClamp: new Float32Array(4),
resolution: 1,
filterArea: new Float32Array(4),
filterClamp: new Float32Array(4)
},!0),
this.forceClear = !1,
this.useMaxPadding = !1
}
init() {
this.texturePool.setScreenSize(this.renderer.view)
}
push(e, t) {
const r = this.renderer
, n = this.defaultFilterStack
, i = this.statePool.pop() || new FilterState
, o = r.renderTexture;
let s, a;
if (o.current) {
const e = o.current;
s = e.resolution,
a = e.multisample
} else
s = r.resolution,
a = r.multisample;
let l = t[0].resolution || s
, c = t[0].multisample ?? a
, u = t[0].padding
, d = t[0].autoFit
, p = t[0].legacy ?? !0;
for (let m = 1; m < t.length; m++) {
const e = t[m];
l = Math.min(l, e.resolution || s),
c = Math.min(c, e.multisample ?? a),
u = this.useMaxPadding ? Math.max(u, e.padding) : u +
e.padding,
d = d && e.autoFit,
p = p || (e.legacy ?? !0)
}
1 === n.length && (this.defaultFilterStack[0].renderTexture =
o.current),
n.push(i),
i.resolution = l,
i.multisample = c,
i.legacy = p,
i.target = e,
i.sourceFrame.copyFrom(e.filterArea || e.getBounds(!0)),
i.sourceFrame.pad(u);
const h = this.tempRect.copyFrom(o.sourceFrame);
r.projection.transform &&
this.transformAABB(tempMatrix$2.copyFrom(r.projection.transform).invert(), h),
d ? (i.sourceFrame.fit(h),
(i.sourceFrame.width <= 0 || i.sourceFrame.height <= 0) &&
(i.sourceFrame.width = 0,
i.sourceFrame.height = 0)) : i.sourceFrame.intersects(h) ||
(i.sourceFrame.width = 0,
i.sourceFrame.height = 0),
this.roundFrame(i.sourceFrame, o.current ? o.current.resolution :
r.resolution, o.sourceFrame, o.destinationFrame, r.projection.transform),
i.renderTexture = this.getOptimalFilterTexture(i.sourceFrame.width,
i.sourceFrame.height, l, c),
i.filters = t,
i.destinationFrame.width = i.renderTexture.width,
i.destinationFrame.height = i.renderTexture.height;
const f = this.tempRect;
f.x = 0,
f.y = 0,
f.width = i.sourceFrame.width,
f.height = i.sourceFrame.height,
i.renderTexture.filterFrame = i.sourceFrame,
i.bindingSourceFrame.copyFrom(o.sourceFrame),
i.bindingDestinationFrame.copyFrom(o.destinationFrame),
i.transform = r.projection.transform,
r.projection.transform = null,
o.bind(i.renderTexture, i.sourceFrame, f),
r.framebuffer.clear(0, 0, 0, 0)
}
pop() {
const e = this.defaultFilterStack
, t = e.pop()
, r = t.filters;
this.activeState = t;
const n = this.globalUniforms.uniforms;
n.outputFrame = t.sourceFrame,
n.resolution = t.resolution;
const i = n.inputSize
, o = n.inputPixel
, s = n.inputClamp;
if (i[0] = t.destinationFrame.width,
i[1] = t.destinationFrame.height,
i[2] = 1 / i[0],
i[3] = 1 / i[1],
o[0] = Math.round(i[0] * t.resolution),
o[1] = Math.round(i[1] * t.resolution),
o[2] = 1 / o[0],
o[3] = 1 / o[1],
s[0] = .5 * o[2],
s[1] = .5 * o[3],
s[2] = t.sourceFrame.width * i[2] - .5 * o[2],
s[3] = t.sourceFrame.height * i[3] - .5 * o[3],
t.legacy) {
const e = n.filterArea;
e[0] = t.destinationFrame.width,
e[1] = t.destinationFrame.height,
e[2] = t.sourceFrame.x,
e[3] = t.sourceFrame.y,
n.filterClamp = n.inputClamp
}
this.globalUniforms.update();
const a = e[e.length - 1];
if (this.renderer.framebuffer.blit(),
1 === r.length)
r[0].apply(this, t.renderTexture, a.renderTexture,
CLEAR_MODES.BLEND, t),
this.returnFilterTexture(t.renderTexture);
else {
let e = t.renderTexture
, n = this.getOptimalFilterTexture(e.width, e.height,
t.resolution);
n.filterFrame = e.filterFrame;
let i = 0;
for (i = 0; i < r.length - 1; ++i) {
1 === i && t.multisample > 1 && (n =
this.getOptimalFilterTexture(e.width, e.height, t.resolution),
n.filterFrame = e.filterFrame),
r[i].apply(this, e, n, CLEAR_MODES.CLEAR, t);
const o = e;
e = n,
n = o
}
r[i].apply(this, e, a.renderTexture, CLEAR_MODES.BLEND, t),
i > 1 && t.multisample > 1 &&
this.returnFilterTexture(t.renderTexture),
this.returnFilterTexture(e),
this.returnFilterTexture(n)
}
t.clear(),
this.statePool.push(t)
}
bindAndClear(e, t=CLEAR_MODES.CLEAR) {
const {renderTexture: r, state: n} = this.renderer;
if (e === this.defaultFilterStack[this.defaultFilterStack.length -
1].renderTexture ? this.renderer.projection.transform =
this.activeState.transform : this.renderer.projection.transform = null,
null == e ? void 0 : e.filterFrame) {
const t = this.tempRect;
t.x = 0,
t.y = 0,
t.width = e.filterFrame.width,
t.height = e.filterFrame.height,
r.bind(e, e.filterFrame, t)
} else
e !== this.defaultFilterStack[this.defaultFilterStack.length -
1].renderTexture ? r.bind(e) : this.renderer.renderTexture.bind(e,
this.activeState.bindingSourceFrame, this.activeState.bindingDestinationFrame);
const i = 1 & n.stateId || this.forceClear;
(t === CLEAR_MODES.CLEAR || t === CLEAR_MODES.BLIT && i) &&
this.renderer.framebuffer.clear(0, 0, 0, 0)
}
applyFilter(e, t, r, n) {
const i = this.renderer;
i.state.set(e.state),
this.bindAndClear(r, n),
e.uniforms.uSampler = t,
e.uniforms.filterGlobals = this.globalUniforms,
i.shader.bind(e),
e.legacy = !!e.program.attributeData.aTextureCoord,
e.legacy ? (this.quadUv.map(t._frame, t.filterFrame),
i.geometry.bind(this.quadUv),
i.geometry.draw(DRAW_MODES.TRIANGLES)) :
(i.geometry.bind(this.quad),
i.geometry.draw(DRAW_MODES.TRIANGLE_STRIP))
}
calculateSpriteMatrix(e, t) {
const {sourceFrame: r, destinationFrame: n} = this.activeState
, {orig: i} = t._texture
, o = e.set(n.width, 0, 0, n.height, r.x, r.y)
, s = t.worldTransform.copyTo(Matrix.TEMP_MATRIX);
return s.invert(),
o.prepend(s),
o.scale(1 / i.width, 1 / i.height),
o.translate(t.anchor.x, t.anchor.y),
o
}
destroy() {
this.renderer = null,
this.texturePool.clear(!1)
}
getOptimalFilterTexture(e, t, r=1, n=MSAA_QUALITY.NONE) {
return this.texturePool.getOptimalTexture(e, t, r, n)
}
getFilterTexture(e, t, r) {
if ("number" == typeof e) {
const r = e;
e = t,
t = r
}
e = e || this.activeState.renderTexture;
const n = this.texturePool.getOptimalTexture(e.width, e.height, t
|| e.resolution, r || MSAA_QUALITY.NONE);
return n.filterFrame = e.filterFrame,
n
}
returnFilterTexture(e) {
this.texturePool.returnTexture(e)
}
emptyPool() {
this.texturePool.clear(!0)
}
resize() {
this.texturePool.setScreenSize(this.renderer.view)
}
transformAABB(e, t) {
const r = tempPoints[0]
, n = tempPoints[1]
, i = tempPoints[2]
, o = tempPoints[3];
r.set(t.left, t.top),
n.set(t.left, t.bottom),
i.set(t.right, t.top),
o.set(t.right, t.bottom),
e.apply(r, r),
e.apply(n, n),
e.apply(i, i),
e.apply(o, o);
const s = Math.min(r.x, n.x, i.x, o.x)
, a = Math.min(r.y, n.y, i.y, o.y)
, l = Math.max(r.x, n.x, i.x, o.x)
, c = Math.max(r.y, n.y, i.y, o.y);
t.x = s,
t.y = a,
t.width = l - s,
t.height = c - a
}
roundFrame(e, t, r, n, i) {
if (!(e.width <= 0 || e.height <= 0 || r.width <= 0 || r.height <=
0)) {
if (i) {
const {a: e, b: t, c: r, d: n} = i;
if ((Math.abs(t) > 1e-4 || Math.abs(r) > 1e-4) &&
(Math.abs(e) > 1e-4 || Math.abs(n) > 1e-4))
return
}
(i = i ? tempMatrix$2.copyFrom(i) :
tempMatrix$2.identity()).translate(-r.x, -r.y).scale(n.width / r.width, n.height /
r.height).translate(n.x, n.y),
this.transformAABB(i, e),
e.ceil(t),
this.transformAABB(i.invert(), e)
}
}
}
FilterSystem.extension = {
type: ExtensionType.RendererSystem,
name: "filter"
},
extensions$1.add(FilterSystem);
class GLFramebuffer {
constructor(e) {
this.framebuffer = e,
this.stencil = null,
this.dirtyId = -1,
this.dirtyFormat = -1,
this.dirtySize = -1,
this.multisample = MSAA_QUALITY.NONE,
this.msaaBuffer = null,
this.blitFramebuffer = null,
this.mipLevel = 0
}
}
const tempRectangle = new Rectangle;
class FramebufferSystem {
constructor(e) {
this.renderer = e,
this.managedFramebuffers = [],
this.unknownFramebuffer = new Framebuffer(10,10),
this.msaaSamples = null
}
contextChange() {
this.disposeAll(!0);
const e = this.gl = this.renderer.gl;
if (this.CONTEXT_UID = this.renderer.CONTEXT_UID,
this.current = this.unknownFramebuffer,
this.viewport = new Rectangle,
this.hasMRT = !0,
this.writeDepthTexture = !0,
1 === this.renderer.context.webGLVersion) {
let t = this.renderer.context.extensions.drawBuffers
, r = this.renderer.context.extensions.depthTexture;
settings.PREFER_ENV === ENV.WEBGL_LEGACY && (t = null,
r = null),
t ? e.drawBuffers = e => t.drawBuffersWEBGL(e) : (this.hasMRT =
!1,
e.drawBuffers = () => {}
),
r || (this.writeDepthTexture = !1)
} else
this.msaaSamples = e.getInternalformatParameter(e.RENDERBUFFER,
e.RGBA8, e.SAMPLES)
}
bind(e, t, r=0) {
const {gl: n} = this;
if (e) {
const i = e.glFramebuffers[this.CONTEXT_UID] ||
this.initFramebuffer(e);
this.current !== e && (this.current = e,
n.bindFramebuffer(n.FRAMEBUFFER, i.framebuffer)),
i.mipLevel !== r && (e.dirtyId++,
e.dirtyFormat++,
i.mipLevel = r),
i.dirtyId !== e.dirtyId && (i.dirtyId = e.dirtyId,
i.dirtyFormat !== e.dirtyFormat ? (i.dirtyFormat =
e.dirtyFormat,
i.dirtySize = e.dirtySize,
this.updateFramebuffer(e, r)) : i.dirtySize !== e.dirtySize &&
(i.dirtySize = e.dirtySize,
this.resizeFramebuffer(e)));
for (let t = 0; t < e.colorTextures.length; t++) {
const r = e.colorTextures[t];
this.renderer.texture.unbind(r.parentTextureArray || r)
}
if (e.depthTexture &&
this.renderer.texture.unbind(e.depthTexture),
t) {
const e = t.width >> r
, n = t.height >> r
, i = e / t.width;
this.setViewport(t.x * i, t.y * i, e, n)
} else {
const t = e.width >> r
, n = e.height >> r;
this.setViewport(0, 0, t, n)
}
} else
this.current && (this.current = null,
n.bindFramebuffer(n.FRAMEBUFFER, null)),
t ? this.setViewport(t.x, t.y, t.width, t.height) :
this.setViewport(0, 0, this.renderer.width, this.renderer.height)
}
setViewport(e, t, r, n) {
const i = this.viewport;
e = Math.round(e),
t = Math.round(t),
r = Math.round(r),
n = Math.round(n),
(i.width !== r || i.height !== n || i.x !== e || i.y !== t) && (i.x
= e,
i.y = t,
i.width = r,
i.height = n,
this.gl.viewport(e, t, r, n))
}
get size() {
return this.current ? {
x: 0,
y: 0,
width: this.current.width,
height: this.current.height
} : {
x: 0,
y: 0,
width: this.renderer.width,
height: this.renderer.height
}
}
clear(e, t, r, n, i=BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH) {
const {gl: o} = this;
o.clearColor(e, t, r, n),
o.clear(i)
}
initFramebuffer(e) {
const {gl: t} = this
, r = new GLFramebuffer(t.createFramebuffer());
return r.multisample = this.detectSamples(e.multisample),
e.glFramebuffers[this.CONTEXT_UID] = r,
this.managedFramebuffers.push(e),
e.disposeRunner.add(this),
r
}
resizeFramebuffer(e) {
const {gl: t} = this
, r = e.glFramebuffers[this.CONTEXT_UID];
if (r.stencil) {
let n;
t.bindRenderbuffer(t.RENDERBUFFER, r.stencil),
n = 1 === this.renderer.context.webGLVersion ?
t.DEPTH_STENCIL : e.depth && e.stencil ? t.DEPTH24_STENCIL8 : e.depth ?
t.DEPTH_COMPONENT24 : t.STENCIL_INDEX8,
r.msaaBuffer ? t.renderbufferStorageMultisample(t.RENDERBUFFER,
r.multisample, n, e.width, e.height) : t.renderbufferStorage(t.RENDERBUFFER, n,
e.width, e.height)
}
const n = e.colorTextures;
let i = n.length;
t.drawBuffers || (i = Math.min(i, 1));
for (let o = 0; o < i; o++) {
const i = n[o]
, s = i.parentTextureArray || i;
this.renderer.texture.bind(s, 0),
0 === o && r.msaaBuffer && (t.bindRenderbuffer(t.RENDERBUFFER,
r.msaaBuffer),
t.renderbufferStorageMultisample(t.RENDERBUFFER, r.multisample,
s._glTextures[this.CONTEXT_UID].internalFormat, e.width, e.height))
}
e.depthTexture && this.writeDepthTexture &&
this.renderer.texture.bind(e.depthTexture, 0)
}
updateFramebuffer(e, t) {
const {gl: r} = this
, n = e.glFramebuffers[this.CONTEXT_UID]
, i = e.colorTextures;
let o = i.length;
r.drawBuffers || (o = Math.min(o, 1)),
n.multisample > 1 && this.canMultisampleFramebuffer(e) ?
n.msaaBuffer = n.msaaBuffer || r.createRenderbuffer() : n.msaaBuffer &&
(r.deleteRenderbuffer(n.msaaBuffer),
n.msaaBuffer = null,
n.blitFramebuffer && (n.blitFramebuffer.dispose(),
n.blitFramebuffer = null));
const s = [];
for (let a = 0; a < o; a++) {
const o = i[a]
, l = o.parentTextureArray || o;
this.renderer.texture.bind(l, 0),
0 === a && n.msaaBuffer ? (r.bindRenderbuffer(r.RENDERBUFFER,
n.msaaBuffer),
r.renderbufferStorageMultisample(r.RENDERBUFFER, n.multisample,
l._glTextures[this.CONTEXT_UID].internalFormat, e.width, e.height),
r.framebufferRenderbuffer(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0,
r.RENDERBUFFER, n.msaaBuffer)) : (r.framebufferTexture2D(r.FRAMEBUFFER,
r.COLOR_ATTACHMENT0 + a, o.target, l._glTextures[this.CONTEXT_UID].texture, t),
s.push(r.COLOR_ATTACHMENT0 + a))
}
if (s.length > 1 && r.drawBuffers(s),
e.depthTexture && this.writeDepthTexture) {
const n = e.depthTexture;
this.renderer.texture.bind(n, 0),
r.framebufferTexture2D(r.FRAMEBUFFER, r.DEPTH_ATTACHMENT,
r.TEXTURE_2D, n._glTextures[this.CONTEXT_UID].texture, t)
}
if (!e.stencil && !e.depth || e.depthTexture &&
this.writeDepthTexture)
n.stencil && (r.deleteRenderbuffer(n.stencil),
n.stencil = null);
else {
let t, i;
n.stencil = n.stencil || r.createRenderbuffer(),
1 === this.renderer.context.webGLVersion ? (t =
r.DEPTH_STENCIL_ATTACHMENT,
i = r.DEPTH_STENCIL) : e.depth && e.stencil ? (t =
r.DEPTH_STENCIL_ATTACHMENT,
i = r.DEPTH24_STENCIL8) : e.depth ? (t = r.DEPTH_ATTACHMENT,
i = r.DEPTH_COMPONENT24) : (t = r.STENCIL_ATTACHMENT,
i = r.STENCIL_INDEX8),
r.bindRenderbuffer(r.RENDERBUFFER, n.stencil),
n.msaaBuffer ? r.renderbufferStorageMultisample(r.RENDERBUFFER,
n.multisample, i, e.width, e.height) : r.renderbufferStorage(r.RENDERBUFFER, i,
e.width, e.height),
r.framebufferRenderbuffer(r.FRAMEBUFFER, t, r.RENDERBUFFER,
n.stencil)
}
}
canMultisampleFramebuffer(e) {
return 1 !== this.renderer.context.webGLVersion &&
e.colorTextures.length <= 1 && !e.depthTexture
}
detectSamples(e) {
const {msaaSamples: t} = this;
let r = MSAA_QUALITY.NONE;
if (e <= 1 || null === t)
return r;
for (let n = 0; n < t.length; n++)
if (t[n] <= e) {
r = t[n];
break
}
return 1 === r && (r = MSAA_QUALITY.NONE),
r
}
blit(e, t, r) {
const {current: n, renderer: i, gl: o, CONTEXT_UID: s} = this;
if (2 !== i.context.webGLVersion || !n)
return;
const a = n.glFramebuffers[s];
if (!a)
return;
if (!e) {
if (!a.msaaBuffer)
return;
const t = n.colorTextures[0];
if (!t)
return;
a.blitFramebuffer || (a.blitFramebuffer = new
Framebuffer(n.width,n.height),
a.blitFramebuffer.addColorTexture(0, t)),
(e = a.blitFramebuffer).colorTextures[0] !== t &&
(e.colorTextures[0] = t,
e.dirtyId++,
e.dirtyFormat++),
(e.width !== n.width || e.height !== n.height) && (e.width =
n.width,
e.height = n.height,
e.dirtyId++,
e.dirtySize++)
}
t || ((t = tempRectangle).width = n.width,
t.height = n.height),
r || (r = t);
const l = t.width === r.width && t.height === r.height;
this.bind(e),
o.bindFramebuffer(o.READ_FRAMEBUFFER, a.framebuffer),
o.blitFramebuffer(t.left, t.top, t.right, t.bottom, r.left, r.top,
r.right, r.bottom, o.COLOR_BUFFER_BIT, l ? o.NEAREST : o.LINEAR),
o.bindFramebuffer(o.READ_FRAMEBUFFER,
e.glFramebuffers[this.CONTEXT_UID].framebuffer)
}
disposeFramebuffer(e, t) {
const r = e.glFramebuffers[this.CONTEXT_UID]
, n = this.gl;
if (!r)
return;
delete e.glFramebuffers[this.CONTEXT_UID];
const i = this.managedFramebuffers.indexOf(e);
i >= 0 && this.managedFramebuffers.splice(i, 1),
e.disposeRunner.remove(this),
t || (n.deleteFramebuffer(r.framebuffer),
r.msaaBuffer && n.deleteRenderbuffer(r.msaaBuffer),
r.stencil && n.deleteRenderbuffer(r.stencil)),
r.blitFramebuffer && this.disposeFramebuffer(r.blitFramebuffer, t)
}
disposeAll(e) {
const t = this.managedFramebuffers;
this.managedFramebuffers = [];
for (let r = 0; r < t.length; r++)
this.disposeFramebuffer(t[r], e)
}
forceStencil() {
const e = this.current;
if (!e)
return;
const t = e.glFramebuffers[this.CONTEXT_UID];
if (!t || t.stencil && e.stencil)
return;
e.stencil = !0;
const r = e.width
, n = e.height
, i = this.gl
, o = t.stencil = i.createRenderbuffer();
let s, a;
i.bindRenderbuffer(i.RENDERBUFFER, o),
1 === this.renderer.context.webGLVersion ? (s =
i.DEPTH_STENCIL_ATTACHMENT,
a = i.DEPTH_STENCIL) : e.depth ? (s = i.DEPTH_STENCIL_ATTACHMENT,
a = i.DEPTH24_STENCIL8) : (s = i.STENCIL_ATTACHMENT,
a = i.STENCIL_INDEX8),
t.msaaBuffer ? i.renderbufferStorageMultisample(i.RENDERBUFFER,
t.multisample, a, r, n) : i.renderbufferStorage(i.RENDERBUFFER, a, r, n),
i.framebufferRenderbuffer(i.FRAMEBUFFER, s, i.RENDERBUFFER, o)
}
reset() {
this.current = this.unknownFramebuffer,
this.viewport = new Rectangle
}
destroy() {
this.renderer = null
}
}
FramebufferSystem.extension = {
type: ExtensionType.RendererSystem,
name: "framebuffer"
},
extensions$1.add(FramebufferSystem);
const byteSizeMap = {
5126: 4,
5123: 2,
5121: 1
};
class GeometrySystem {
constructor(e) {
this.renderer = e,
this._activeGeometry = null,
this._activeVao = null,
this.hasVao = !0,
this.hasInstance = !0,
this.canUseUInt32ElementIndex = !1,
this.managedGeometries = {}
}
contextChange() {
this.disposeAll(!0);
const e = this.gl = this.renderer.gl
, t = this.renderer.context;
if (this.CONTEXT_UID = this.renderer.CONTEXT_UID,
2 !== t.webGLVersion) {
let t = this.renderer.context.extensions.vertexArrayObject;
settings.PREFER_ENV === ENV.WEBGL_LEGACY && (t = null),
t ? (e.createVertexArray = () => t.createVertexArrayOES(),
e.bindVertexArray = e => t.bindVertexArrayOES(e),
e.deleteVertexArray = e => t.deleteVertexArrayOES(e)) :
(this.hasVao = !1,
e.createVertexArray = () => null,
e.bindVertexArray = () => null,
e.deleteVertexArray = () => null)
}
if (2 !== t.webGLVersion) {
const t = e.getExtension("ANGLE_instanced_arrays");
t ? (e.vertexAttribDivisor = (e, r) =>
t.vertexAttribDivisorANGLE(e, r),
e.drawElementsInstanced = (e, r, n, i, o) =>
t.drawElementsInstancedANGLE(e, r, n, i, o),
e.drawArraysInstanced = (e, r, n, i) =>
t.drawArraysInstancedANGLE(e, r, n, i)) : this.hasInstance = !1
}
this.canUseUInt32ElementIndex = 2 === t.webGLVersion || !!
t.extensions.uint32ElementIndex
}
bind(e, t) {
t = t || this.renderer.shader.shader;
const {gl: r} = this;
let n = e.glVertexArrayObjects[this.CONTEXT_UID]
, i = !1;
n || (this.managedGeometries[e.id] = e,
e.disposeRunner.add(this),
e.glVertexArrayObjects[this.CONTEXT_UID] = n = {},
i = !0);
const o = n[t.program.id] || this.initGeometryVao(e, t, i);
this._activeGeometry = e,
this._activeVao !== o && (this._activeVao = o,
this.hasVao ? r.bindVertexArray(o) : this.activateVao(e,
t.program)),
this.updateBuffers()
}
reset() {
this.unbind()
}
updateBuffers() {
const e = this._activeGeometry
, t = this.renderer.buffer;
for (let r = 0; r < e.buffers.length; r++) {
const n = e.buffers[r];
t.update(n)
}
}
checkCompatibility(e, t) {
const r = e.attributes
, n = t.attributeData;
for (const i in n)
if (!r[i])
throw new Error(`shader and geometry incompatible, geometry
missing the "${i}" attribute`)
}
getSignature(e, t) {
const r = e.attributes
, n = t.attributeData
, i = ["g", e.id];
for (const o in r)
n[o] && i.push(o, n[o].location);
return i.join("-")
}
initGeometryVao(e, t, r=!0) {
const n = this.gl
, i = this.CONTEXT_UID
, o = this.renderer.buffer
, s = t.program;
s.glPrograms[i] || this.renderer.shader.generateProgram(t),
this.checkCompatibility(e, s);
const a = this.getSignature(e, s)
, l = e.glVertexArrayObjects[this.CONTEXT_UID];
let c = l[a];
if (c)
return l[s.id] = c,
c;
const u = e.buffers
, d = e.attributes
, p = {}
, h = {};
for (const f in u)
p[f] = 0,
h[f] = 0;
for (const f in d)
!d[f].size && s.attributeData[f] ? d[f].size =
s.attributeData[f].size : d[f].size,
p[d[f].buffer] += d[f].size * byteSizeMap[d[f].type];
for (const f in d) {
const e = d[f]
, t = e.size;
void 0 === e.stride && (p[e.buffer] === t * byteSizeMap[e.type]
? e.stride = 0 : e.stride = p[e.buffer]),
void 0 === e.start && (e.start = h[e.buffer],
h[e.buffer] += t * byteSizeMap[e.type])
}
c = n.createVertexArray(),
n.bindVertexArray(c);
for (let f = 0; f < u.length; f++) {
const e = u[f];
o.bind(e),
r && e._glBuffers[i].refCount++
}
return this.activateVao(e, s),
l[s.id] = c,
l[a] = c,
n.bindVertexArray(null),
o.unbind(BUFFER_TYPE.ARRAY_BUFFER),
c
}
disposeGeometry(e, t) {
var r;
if (!this.managedGeometries[e.id])
return;
delete this.managedGeometries[e.id];
const n = e.glVertexArrayObjects[this.CONTEXT_UID]
, i = this.gl
, o = e.buffers
, s = null == (r = this.renderer) ? void 0 : r.buffer;
if (e.disposeRunner.remove(this),
n) {
if (s)
for (let e = 0; e < o.length; e++) {
const r = o[e]._glBuffers[this.CONTEXT_UID];
r && (r.refCount--,
0 === r.refCount && !t && s.dispose(o[e], t))
}
if (!t)
for (const e in n)
if ("g" === e[0]) {
const t = n[e];
this._activeVao === t && this.unbind(),
i.deleteVertexArray(t)
}
delete e.glVertexArrayObjects[this.CONTEXT_UID]
}
}
disposeAll(e) {
const t = Object.keys(this.managedGeometries);
for (let r = 0; r < t.length; r++)
this.disposeGeometry(this.managedGeometries[t[r]], e)
}
activateVao(e, t) {
const r = this.gl
, n = this.CONTEXT_UID
, i = this.renderer.buffer
, o = e.buffers
, s = e.attributes;
e.indexBuffer && i.bind(e.indexBuffer);
let a = null;
for (const l in s) {
const e = s[l]
, c = o[e.buffer]
, u = c._glBuffers[n];
if (t.attributeData[l]) {
a !== u && (i.bind(c),
a = u);
const n = t.attributeData[l].location;
if (r.enableVertexAttribArray(n),
r.vertexAttribPointer(n, e.size, e.type || r.FLOAT,
e.normalized, e.stride, e.start),
e.instance) {
if (!this.hasInstance)
throw new Error("geometry error, GPU Instancing is
not supported on this device");
r.vertexAttribDivisor(n, e.divisor)
}
}
}
}
draw(e, t, r, n) {
const {gl: i} = this
, o = this._activeGeometry;
if (o.indexBuffer) {
const s = o.indexBuffer.data.BYTES_PER_ELEMENT
, a = 2 === s ? i.UNSIGNED_SHORT : i.UNSIGNED_INT;
(2 === s || 4 === s && this.canUseUInt32ElementIndex) &&
(o.instanced ? i.drawElementsInstanced(e, t || o.indexBuffer.data.length, a, (r ||
0) * s, n || 1) : i.drawElements(e, t || o.indexBuffer.data.length, a, (r || 0) *
s))
} else
o.instanced ? i.drawArraysInstanced(e, r, t || o.getSize(), n
|| 1) : i.drawArrays(e, r, t || o.getSize());
return this
}
unbind() {
this.gl.bindVertexArray(null),
this._activeVao = null,
this._activeGeometry = null
}
destroy() {
this.renderer = null
}
}
GeometrySystem.extension = {
type: ExtensionType.RendererSystem,
name: "geometry"
},
extensions$1.add(GeometrySystem);
const tempMat$1 = new Matrix;
class TextureMatrix {
constructor(e, t) {
this._texture = e,
this.mapCoord = new Matrix,
this.uClampFrame = new Float32Array(4),
this.uClampOffset = new Float32Array(2),
this._textureID = -1,
this._updateID = 0,
this.clampOffset = 0,
this.clampMargin = typeof t > "u" ? .5 : t,
this.isSimple = !1
}
get texture() {
return this._texture
}
set texture(e) {
this._texture = e,
this._textureID = -1
}
multiplyUvs(e, t) {
void 0 === t && (t = e);
const r = this.mapCoord;
for (let n = 0; n < e.length; n += 2) {
const i = e[n]
, o = e[n + 1];
t[n] = i * r.a + o * r.c + r.tx,
t[n + 1] = i * r.b + o * r.d + r.ty
}
return t
}
update(e) {
const t = this._texture;
if (!t || !t.valid || !e && this._textureID === t._updateID)
return !1;
this._textureID = t._updateID,
this._updateID++;
const r = t._uvs;
this.mapCoord.set(r.x1 - r.x0, r.y1 - r.y0, r.x3 - r.x0, r.y3 -
r.y0, r.x0, r.y0);
const n = t.orig
, i = t.trim;
i && (tempMat$1.set(n.width / i.width, 0, 0, n.height / i.height, -
i.x / i.width, -i.y / i.height),
this.mapCoord.append(tempMat$1));
const o = t.baseTexture
, s = this.uClampFrame
, a = this.clampMargin / o.resolution
, l = this.clampOffset;
return s[0] = (t._frame.x + a + l) / o.width,
s[1] = (t._frame.y + a + l) / o.height,
s[2] = (t._frame.x + t._frame.width - a + l) / o.width,
s[3] = (t._frame.y + t._frame.height - a + l) / o.height,
this.uClampOffset[0] = l / o.realWidth,
this.uClampOffset[1] = l / o.realHeight,
this.isSimple = t._frame.width === o.width && t._frame.height ===
o.height && 0 === t.rotate,
!0
}
}
var fragment$y = "varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\
nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\
nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float
clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n
step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n
step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler,
vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul
= 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha
* clip);\n\n gl_FragColor = original;\n}\n"
, vertex$4 = "attribute vec2 aVertexPosition;\nattribute vec2
aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\
nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\
n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix *
vec3( aTextureCoord, 1.0) ).xy;\n}\n";
class SpriteMaskFilter extends Filter$2 {
constructor(e, t, r) {
let n = null;
"string" != typeof e && void 0 === t && void 0 === r && (n = e,
e = void 0,
t = void 0,
r = void 0),
super(e || vertex$4, t || fragment$y, r),
this.maskSprite = n,
this.maskMatrix = new Matrix
}
get maskSprite() {
return this._maskSprite
}
set maskSprite(e) {
this._maskSprite = e,
this._maskSprite && (this._maskSprite.renderable = !1)
}
apply(e, t, r, n) {
const i = this._maskSprite
, o = i._texture;
o.valid && (o.uvMatrix || (o.uvMatrix = new TextureMatrix(o,0)),
o.uvMatrix.update(),
this.uniforms.npmAlpha = o.baseTexture.alphaMode ? 0 : 1,
this.uniforms.mask = o,
this.uniforms.otherMatrix =
e.calculateSpriteMatrix(this.maskMatrix, i).prepend(o.uvMatrix.mapCoord),
this.uniforms.alpha = i.worldAlpha,
this.uniforms.maskClamp = o.uvMatrix.uClampFrame,
e.applyFilter(this, t, r, n))
}
}
class MaskData {
constructor(e=null) {
this.type = MASK_TYPES.NONE,
this.autoDetect = !0,
this.maskObject = e || null,
this.pooled = !1,
this.isMaskData = !0,
this.resolution = null,
this.multisample = Filter$2.defaultMultisample,
this.enabled = !0,
this.colorMask = 15,
this._filters = null,
this._stencilCounter = 0,
this._scissorCounter = 0,
this._scissorRect = null,
this._scissorRectLocal = null,
this._colorMask = 15,
this._target = null
}
get filter() {
return this._filters ? this._filters[0] : null
}
set filter(e) {
e ? this._filters ? this._filters[0] = e : this._filters = [e] :
this._filters = null
}
reset() {
this.pooled && (this.maskObject = null,
this.type = MASK_TYPES.NONE,
this.autoDetect = !0),
this._target = null,
this._scissorRectLocal = null
}
copyCountersOrReset(e) {
e ? (this._stencilCounter = e._stencilCounter,
this._scissorCounter = e._scissorCounter,
this._scissorRect = e._scissorRect) : (this._stencilCounter = 0,
this._scissorCounter = 0,
this._scissorRect = null)
}
}
class MaskSystem {
constructor(e) {
this.renderer = e,
this.enableScissor = !0,
this.alphaMaskPool = [],
this.maskDataPool = [],
this.maskStack = [],
this.alphaMaskIndex = 0
}
setMaskStack(e) {
this.maskStack = e,
this.renderer.scissor.setMaskStack(e),
this.renderer.stencil.setMaskStack(e)
}
push(e, t) {
let r = t;
if (!r.isMaskData) {
const e = this.maskDataPool.pop() || new MaskData;
e.pooled = !0,
e.maskObject = t,
r = e
}
const n = 0 !== this.maskStack.length ?
this.maskStack[this.maskStack.length - 1] : null;
if (r.copyCountersOrReset(n),
r._colorMask = n ? n._colorMask : 15,
r.autoDetect && this.detect(r),
r._target = e,
r.type !== MASK_TYPES.SPRITE && this.maskStack.push(r),
r.enabled)
switch (r.type) {
case MASK_TYPES.SCISSOR:
this.renderer.scissor.push(r);
break;
case MASK_TYPES.STENCIL:
this.renderer.stencil.push(r);
break;
case MASK_TYPES.SPRITE:
r.copyCountersOrReset(null),
this.pushSpriteMask(r);
break;
case MASK_TYPES.COLOR:
this.pushColorMask(r)
}
r.type === MASK_TYPES.SPRITE && this.maskStack.push(r)
}
pop(e) {
const t = this.maskStack.pop();
if (t && t._target === e) {
if (t.enabled)
switch (t.type) {
case MASK_TYPES.SCISSOR:
this.renderer.scissor.pop(t);
break;
case MASK_TYPES.STENCIL:
this.renderer.stencil.pop(t.maskObject);
break;
case MASK_TYPES.SPRITE:
this.popSpriteMask(t);
break;
case MASK_TYPES.COLOR:
this.popColorMask(t)
}
if (t.reset(),
t.pooled && this.maskDataPool.push(t),
0 !== this.maskStack.length) {
const e = this.maskStack[this.maskStack.length - 1];
e.type === MASK_TYPES.SPRITE && e._filters &&
(e._filters[0].maskSprite = e.maskObject)
}
}
}
detect(e) {
const t = e.maskObject;
t ? t.isSprite ? e.type = MASK_TYPES.SPRITE : this.enableScissor &&
this.renderer.scissor.testScissor(e) ? e.type = MASK_TYPES.SCISSOR : e.type =
MASK_TYPES.STENCIL : e.type = MASK_TYPES.COLOR
}
pushSpriteMask(e) {
const {maskObject: t} = e
, r = e._target;
let n = e._filters;
n || (n = this.alphaMaskPool[this.alphaMaskIndex],
n || (n = this.alphaMaskPool[this.alphaMaskIndex] = [new
SpriteMaskFilter])),
n[0].resolution = e.resolution,
n[0].multisample = e.multisample,
n[0].maskSprite = t;
const i = r.filterArea;
r.filterArea = t.getBounds(!0),
this.renderer.filter.push(r, n),
r.filterArea = i,
e._filters || this.alphaMaskIndex++
}
popSpriteMask(e) {
this.renderer.filter.pop(),
e._filters ? e._filters[0].maskSprite = null :
(this.alphaMaskIndex--,
this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite = null)
}
pushColorMask(e) {
const t = e._colorMask
, r = e._colorMask = t & e.colorMask;
r !== t && this.renderer.gl.colorMask(!!(1 & r), !!(2 & r), !!(4 &
r), !!(8 & r))
}
popColorMask(e) {
const t = e._colorMask
, r = this.maskStack.length > 0 ?
this.maskStack[this.maskStack.length - 1]._colorMask : 15;
r !== t && this.renderer.gl.colorMask(!!(1 & r), !!(2 & r), !!(4 &
r), !!(8 & r))
}
destroy() {
this.renderer = null
}
}
MaskSystem.extension = {
type: ExtensionType.RendererSystem,
name: "mask"
},
extensions$1.add(MaskSystem);
class AbstractMaskSystem {
constructor(e) {
this.renderer = e,
this.maskStack = [],
this.glConst = 0
}
getStackLength() {
return this.maskStack.length
}
setMaskStack(e) {
const {gl: t} = this.renderer
, r = this.getStackLength();
this.maskStack = e;
const n = this.getStackLength();
n !== r && (0 === n ? t.disable(this.glConst) :
(t.enable(this.glConst),
this._useCurrent()))
}
_useCurrent() {}
destroy() {
this.renderer = null,
this.maskStack = null
}
}
const tempMatrix$1 = new Matrix
, rectPool = []
, _ScissorSystem = class e extends AbstractMaskSystem {
constructor(e) {
super(e),
this.glConst =
settings.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST
}
getStackLength() {
const e = this.maskStack[this.maskStack.length - 1];
return e ? e._scissorCounter : 0
}
calcScissorRect(e) {
if (e._scissorRectLocal)
return;
const t = e._scissorRect
, {maskObject: r} = e
, {renderer: n} = this
, i = n.renderTexture
, o = r.getBounds(!0, rectPool.pop() ?? new Rectangle);
this.roundFrameToPixels(o, i.current ? i.current.resolution :
n.resolution, i.sourceFrame, i.destinationFrame, n.projection.transform),
t && o.fit(t),
e._scissorRectLocal = o
}
static isMatrixRotated(e) {
if (!e)
return !1;
const {a: t, b: r, c: n, d: i} = e;
return (Math.abs(r) > 1e-4 || Math.abs(n) > 1e-4) && (Math.abs(t) >
1e-4 || Math.abs(i) > 1e-4)
}
testScissor(t) {
const {maskObject: r} = t;
if (!r.isFastRect || !r.isFastRect() ||
e.isMatrixRotated(r.worldTransform) ||
e.isMatrixRotated(this.renderer.projection.transform))
return !1;
this.calcScissorRect(t);
const n = t._scissorRectLocal;
return n.width > 0 && n.height > 0
}
roundFrameToPixels(t, r, n, i, o) {
e.isMatrixRotated(o) || ((o = o ? tempMatrix$1.copyFrom(o) :
tempMatrix$1.identity()).translate(-n.x, -n.y).scale(i.width / n.width, i.height /
n.height).translate(i.x, i.y),
this.renderer.filter.transformAABB(o, t),
t.fit(i),
t.x = Math.round(t.x * r),
t.y = Math.round(t.y * r),
t.width = Math.round(t.width * r),
t.height = Math.round(t.height * r))
}
push(e) {
e._scissorRectLocal || this.calcScissorRect(e);
const {gl: t} = this.renderer;
e._scissorRect || t.enable(t.SCISSOR_TEST),
e._scissorCounter++,
e._scissorRect = e._scissorRectLocal,
this._useCurrent()
}
pop(e) {
const {gl: t} = this.renderer;
e && rectPool.push(e._scissorRectLocal),
this.getStackLength() > 0 ? this._useCurrent() :
t.disable(t.SCISSOR_TEST)
}
_useCurrent() {
const e = this.maskStack[this.maskStack.length - 1]._scissorRect;
let t;
t = this.renderer.renderTexture.current ? e.y :
this.renderer.height - e.height - e.y,
this.renderer.gl.scissor(e.x, t, e.width, e.height)
}
}
;
_ScissorSystem.extension = {
type: ExtensionType.RendererSystem,
name: "scissor"
};
let ScissorSystem = _ScissorSystem;
extensions$1.add(ScissorSystem);
class StencilSystem extends AbstractMaskSystem {
constructor(e) {
super(e),
this.glConst =
settings.ADAPTER.getWebGLRenderingContext().STENCIL_TEST
}
getStackLength() {
const e = this.maskStack[this.maskStack.length - 1];
return e ? e._stencilCounter : 0
}
push(e) {
const t = e.maskObject
, {gl: r} = this.renderer
, n = e._stencilCounter;
0 === n && (this.renderer.framebuffer.forceStencil(),
r.clearStencil(0),
r.clear(r.STENCIL_BUFFER_BIT),
r.enable(r.STENCIL_TEST)),
e._stencilCounter++;
const i = e._colorMask;
0 !== i && (e._colorMask = 0,
r.colorMask(!1, !1, !1, !1)),
r.stencilFunc(r.EQUAL, n, 4294967295),
r.stencilOp(r.KEEP, r.KEEP, r.INCR),
t.renderable = !0,
t.render(this.renderer),
this.renderer.batch.flush(),
t.renderable = !1,
0 !== i && (e._colorMask = i,
r.colorMask(!!(1 & i), !!(2 & i), !!(4 & i), !!(8 & i))),
this._useCurrent()
}
pop(e) {
const t = this.renderer.gl;
if (0 === this.getStackLength())
t.disable(t.STENCIL_TEST);
else {
const r = 0 !== this.maskStack.length ?
this.maskStack[this.maskStack.length - 1] : null
, n = r ? r._colorMask : 15;
0 !== n && (r._colorMask = 0,
t.colorMask(!1, !1, !1, !1)),
t.stencilOp(t.KEEP, t.KEEP, t.DECR),
e.renderable = !0,
e.render(this.renderer),
this.renderer.batch.flush(),
e.renderable = !1,
0 !== n && (r._colorMask = n,
t.colorMask(!!(1 & n), !!(2 & n), !!(4 & n), !!(8 & n))),
this._useCurrent()
}
}
_useCurrent() {
const e = this.renderer.gl;
e.stencilFunc(e.EQUAL, this.getStackLength(), 4294967295),
e.stencilOp(e.KEEP, e.KEEP, e.KEEP)
}
}
StencilSystem.extension = {
type: ExtensionType.RendererSystem,
name: "stencil"
},
extensions$1.add(StencilSystem);
class PluginSystem {
constructor(e) {
this.renderer = e,
this.plugins = {},
Object.defineProperties(this.plugins, {
extract: {
enumerable: !1,
get: () => (deprecation("7.0.0", "renderer.plugins.extract
has moved to renderer.extract"),
e.extract)
},
prepare: {
enumerable: !1,
get: () => (deprecation("7.0.0", "renderer.plugins.prepare
has moved to renderer.prepare"),
e.prepare)
},
interaction: {
enumerable: !1,
get: () => (deprecation("7.0.0",
"renderer.plugins.interaction has been deprecated, use renderer.events"),
e.events)
}
})
}
init() {
const e = this.rendererPlugins;
for (const t in e)
this.plugins[t] = new e[t](this.renderer)
}
destroy() {
for (const e in this.plugins)
this.plugins[e].destroy(),
this.plugins[e] = null
}
}
PluginSystem.extension = {
type: [ExtensionType.RendererSystem,
ExtensionType.CanvasRendererSystem],
name: "_plugin"
},
extensions$1.add(PluginSystem);
class ProjectionSystem {
constructor(e) {
this.renderer = e,
this.destinationFrame = null,
this.sourceFrame = null,
this.defaultFrame = null,
this.projectionMatrix = new Matrix,
this.transform = null
}
update(e, t, r, n) {
this.destinationFrame = e || this.destinationFrame ||
this.defaultFrame,
this.sourceFrame = t || this.sourceFrame || e,
this.calculateProjection(this.destinationFrame, this.sourceFrame,
r, n),
this.transform && this.projectionMatrix.append(this.transform);
const i = this.renderer;
i.globalUniforms.uniforms.projectionMatrix = this.projectionMatrix,
i.globalUniforms.update(),
i.shader.shader &&
i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)
}
calculateProjection(e, t, r, n) {
const i = this.projectionMatrix
, o = n ? -1 : 1;
i.identity(),
i.a = 1 / t.width * 2,
i.d = o * (1 / t.height * 2),
i.tx = -1 - t.x * i.a,
i.ty = -o - t.y * i.d
}
setTransform(e) {}
destroy() {
this.renderer = null
}
}
ProjectionSystem.extension = {
type: ExtensionType.RendererSystem,
name: "projection"
},
extensions$1.add(ProjectionSystem);
const tempTransform = new Transform
, tempRect$1 = new Rectangle;
class GenerateTextureSystem {
constructor(e) {
this.renderer = e,
this._tempMatrix = new Matrix
}
generateTexture(e, t) {
const {region: r, ...n} = t || {}
, i = (null == r ? void 0 : r.copyTo(tempRect$1)) ||
e.getLocalBounds(tempRect$1, !0)
, o = n.resolution || this.renderer.resolution;
i.width = Math.max(i.width, 1 / o),
i.height = Math.max(i.height, 1 / o),
n.width = i.width,
n.height = i.height,
n.resolution = o,
n.multisample ?? (n.multisample = this.renderer.multisample);
const s = RenderTexture.create(n);
this._tempMatrix.tx = -i.x,
this._tempMatrix.ty = -i.y;
const a = e.transform;
return e.transform = tempTransform,
this.renderer.render(e, {
renderTexture: s,
transform: this._tempMatrix,
skipUpdateTransform: !!e.parent,
blit: !0
}),
e.transform = a,
s
}
destroy() {}
}
GenerateTextureSystem.extension = {
type: [ExtensionType.RendererSystem,
ExtensionType.CanvasRendererSystem],
name: "textureGenerator"
},
extensions$1.add(GenerateTextureSystem);
const tempRect = new Rectangle
, tempRect2 = new Rectangle;
class RenderTextureSystem {
constructor(e) {
this.renderer = e,
this.defaultMaskStack = [],
this.current = null,
this.sourceFrame = new Rectangle,
this.destinationFrame = new Rectangle,
this.viewportFrame = new Rectangle
}
contextChange() {
var e;
const t = null == (e = this.renderer) ? void 0 :
e.gl.getContextAttributes();
this._rendererPremultipliedAlpha = !!(t && t.alpha &&
t.premultipliedAlpha)
}
bind(e=null, t, r) {
const n = this.renderer;
let i, o, s;
this.current = e,
e ? (i = e.baseTexture,
s = i.resolution,
t || (tempRect.width = e.frame.width,
tempRect.height = e.frame.height,
t = tempRect),
r || (tempRect2.x = e.frame.x,
tempRect2.y = e.frame.y,
tempRect2.width = t.width,
tempRect2.height = t.height,
r = tempRect2),
o = i.framebuffer) : (s = n.resolution,
t || (tempRect.width = n._view.screen.width,
tempRect.height = n._view.screen.height,
t = tempRect),
r || ((r = tempRect).width = t.width,
r.height = t.height));
const a = this.viewportFrame;
a.x = r.x * s,
a.y = r.y * s,
a.width = r.width * s,
a.height = r.height * s,
e || (a.y = n.view.height - (a.y + a.height)),
a.ceil(),
this.renderer.framebuffer.bind(o, a),
this.renderer.projection.update(r, t, s, !o),
e ? this.renderer.mask.setMaskStack(i.maskStack) :
this.renderer.mask.setMaskStack(this.defaultMaskStack),
this.sourceFrame.copyFrom(t),
this.destinationFrame.copyFrom(r)
}
clear(e, t) {
const r = this.current ? this.current.baseTexture.clear :
this.renderer.background.backgroundColor
, n = Color$2.shared.setValue(e || r);
(this.current && this.current.baseTexture.alphaMode > 0 || !
this.current && this._rendererPremultipliedAlpha) && n.premultiply(n.alpha);
const i = this.destinationFrame
, o = this.current ? this.current.baseTexture :
this.renderer._view.screen
, s = i.width !== o.width || i.height !== o.height;
if (s) {
let {x: e, y: t, width: r, height: n} = this.viewportFrame;
e = Math.round(e),
t = Math.round(t),
r = Math.round(r),
n = Math.round(n),
this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),
this.renderer.gl.scissor(e, t, r, n)
}
this.renderer.framebuffer.clear(n.red, n.green, n.blue, n.alpha,
t),
s && this.renderer.scissor.pop()
}
resize() {
this.bind(null)
}
reset() {
this.bind(null)
}
destroy() {
this.renderer = null
}
}
RenderTextureSystem.extension = {
type: ExtensionType.RendererSystem,
name: "renderTexture"
},
extensions$1.add(RenderTextureSystem);
class GLProgram {
constructor(e, t) {
this.program = e,
this.uniformData = t,
this.uniformGroups = {},
this.uniformDirtyGroups = {},
this.uniformBufferBindings = {}
}
destroy() {
this.uniformData = null,
this.uniformGroups = null,
this.uniformDirtyGroups = null,
this.uniformBufferBindings = null,
this.program = null
}
}
function getAttributeData(e, t) {
const r = {}
, n = t.getProgramParameter(e, t.ACTIVE_ATTRIBUTES);
for (let i = 0; i < n; i++) {
const n = t.getActiveAttrib(e, i);
if (n.name.startsWith("gl_"))
continue;
const o = mapType(t, n.type)
, s = {
type: o,
name: n.name,
size: mapSize(o),
location: t.getAttribLocation(e, n.name)
};
r[n.name] = s
}
return r
}
function getUniformData(e, t) {
const r = {}
, n = t.getProgramParameter(e, t.ACTIVE_UNIFORMS);
for (let i = 0; i < n; i++) {
const n = t.getActiveUniform(e, i)
, o = n.name.replace(/\[.*?\]$/, "")
, s = !!n.name.match(/\[.*?\]$/)
, a = mapType(t, n.type);
r[o] = {
name: o,
index: i,
type: a,
size: n.size,
isArray: s,
value: defaultValue$3(a, n.size)
}
}
return r
}
function generateProgram(e, t) {
var r;
const n = compileShader(e, e.VERTEX_SHADER, t.vertexSrc)
, i = compileShader(e, e.FRAGMENT_SHADER, t.fragmentSrc)
, o = e.createProgram();
e.attachShader(o, n),
e.attachShader(o, i);
const s = null == (r = t.extra) ? void 0 : r.transformFeedbackVaryings;
if (s && ("function" != typeof e.transformFeedbackVaryings ||
e.transformFeedbackVaryings(o, s.names, "separate" === s.bufferMode ?
e.SEPARATE_ATTRIBS : e.INTERLEAVED_ATTRIBS)),
e.linkProgram(o),
e.getProgramParameter(o, e.LINK_STATUS) || logProgramError(e, o, n, i),
t.attributeData = getAttributeData(o, e),
t.uniformData = getUniformData(o, e),
!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)) {
const r = Object.keys(t.attributeData);
r.sort(( (e, t) => e > t ? 1 : -1));
for (let n = 0; n < r.length; n++)
t.attributeData[r[n]].location = n,
e.bindAttribLocation(o, n, r[n]);
e.linkProgram(o)
}
e.deleteShader(n),
e.deleteShader(i);
const a = {};
for (const l in t.uniformData) {
const r = t.uniformData[l];
a[l] = {
location: e.getUniformLocation(o, l),
value: defaultValue$3(r.type, r.size)
}
}
return new GLProgram(o,a)
}
function uboUpdate(e, t, r, n, i) {
r.buffer.update(i)
}
const UBO_TO_SINGLE_SETTERS = {
float: "\n data[offset] = v;\n ",
vec2: "\n data[offset] = v[0];\n data[offset+1] = v[1];\n
",
vec3: "\n data[offset] = v[0];\n data[offset+1] = v[1];\n
data[offset+2] = v[2];\n\n ",
vec4: "\n data[offset] = v[0];\n data[offset+1] = v[1];\n
data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",
mat2: "\n data[offset] = v[0];\n data[offset+1] = v[1];\
n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",
mat3: "\n data[offset] = v[0];\n data[offset+1] = v[1];\n
data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset +
5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n
data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",
mat4: "\n for(var i = 0; i < 16; i++)\n {\n
data[offset + i] = v[i];\n }\n "
}
, GLSL_TO_STD40_SIZE = {
float: 4,
vec2: 8,
vec3: 12,
vec4: 16,
int: 4,
ivec2: 8,
ivec3: 12,
ivec4: 16,
uint: 4,
uvec2: 8,
uvec3: 12,
uvec4: 16,
bool: 4,
bvec2: 8,
bvec3: 12,
bvec4: 16,
mat2: 32,
mat3: 48,
mat4: 64
};
function createUBOElements(e) {
const t = e.map((e => ({
data: e,
offset: 0,
dataLen: 0,
dirty: 0
})));
let r = 0
, n = 0
, i = 0;
for (let o = 0; o < t.length; o++) {
const e = t[o];
if (r = GLSL_TO_STD40_SIZE[e.data.type],
e.data.size > 1 && (r = Math.max(r, 16) * e.data.size),
e.dataLen = r,
n % r != 0 && n < 16) {
const e = n % r % 16;
n += e,
i += e
}
n + r > 16 ? (i = 16 * Math.ceil(i / 16),
e.offset = i,
i += r,
n = r) : (e.offset = i,
n += r,
i += r)
}
return i = 16 * Math.ceil(i / 16),
{
uboElements: t,
size: i
}
}
function getUBOData(e, t) {
const r = [];
for (const n in e)
t[n] && r.push(t[n]);
return r.sort(( (e, t) => e.index - t.index)),
r
}
function generateUniformBufferSync(e, t) {
if (!e.autoManage)
return {
size: 0,
syncFunc: uboUpdate
};
const r = getUBOData(e.uniforms, t)
, {uboElements: n, size: i} = createUBOElements(r)
, o = ["\n var v = null;\n var v2 = null;\n var cv = null;\n
var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data =
buffer.data;\n "];
for (let s = 0; s < n.length; s++) {
const t = n[s]
, r = e.uniforms[t.data.name]
, i = t.data.name;
let a = !1;
for (let e = 0; e < uniformParsers.length; e++) {
const n = uniformParsers[e];
if (n.codeUbo && n.test(t.data, r)) {
o.push(`offset = ${t.offset / 4};`,
uniformParsers[e].codeUbo(t.data.name, r)),
a = !0;
break
}
}
if (!a)
if (t.data.size > 1) {
const e = mapSize(t.data.type)
, r = Math.max(GLSL_TO_STD40_SIZE[t.data.type] / 16, 1)
, n = e / r
, s = (4 - n % 4) % 4;
o.push(`\n cv = ud.${i}.value;\n
v = uv.${i};\n offset = ${t.offset / 4};\n\n t = 0;\
n\n for(var i=0; i < ${t.data.size * r}; i++)\n {\n
for(var j = 0; j < ${n}; j++)\n {\n
data[offset++] = v[t++];\n }\n offset += $
{s};\n }\n\n `)
} else {
const e = UBO_TO_SINGLE_SETTERS[t.data.type];
o.push(`\n cv = ud.${i}.value;\n
v = uv.${i};\n offset = ${t.offset / 4};\n ${e};\n
`)
}
}
return o.push("\n renderer.buffer.update(buffer);\n "),
{
size: i,
syncFunc: new
Function("ud","uv","renderer","syncData","buffer",o.join("\n"))
}
}
let UID = 0;
const defaultSyncData = {
textureCount: 0,
uboCount: 0
};
class ShaderSystem {
constructor(e) {
this.destroyed = !1,
this.renderer = e,
this.systemCheck(),
this.gl = null,
this.shader = null,
this.program = null,
this.cache = {},
this._uboCache = {},
this.id = UID++
}
systemCheck() {
if (!unsafeEvalSupported())
throw new Error("Current environment does not allow unsafe-
eval, please use @pixi/unsafe-eval module to enable support.")
}
contextChange(e) {
this.gl = e,
this.reset()
}
bind(e, t) {
e.disposeRunner.add(this),
e.uniforms.globals = this.renderer.globalUniforms;
const r = e.program
, n = r.glPrograms[this.renderer.CONTEXT_UID] ||
this.generateProgram(e);
return this.shader = e,
this.program !== r && (this.program = r,
this.gl.useProgram(n.program)),
t || (defaultSyncData.textureCount = 0,
defaultSyncData.uboCount = 0,
this.syncUniformGroup(e.uniformGroup, defaultSyncData)),
n
}
setUniforms(e) {
const t = this.shader.program
, r = t.glPrograms[this.renderer.CONTEXT_UID];
t.syncUniforms(r.uniformData, e, this.renderer)
}
syncUniformGroup(e, t) {
const r = this.getGlProgram();
(!e.static || e.dirtyId !== r.uniformDirtyGroups[e.id]) &&
(r.uniformDirtyGroups[e.id] = e.dirtyId,
this.syncUniforms(e, r, t))
}
syncUniforms(e, t, r) {
(e.syncUniforms[this.shader.program.id] ||
this.createSyncGroups(e))(t.uniformData, e.uniforms, this.renderer, r)
}
createSyncGroups(e) {
const t = this.getSignature(e, this.shader.program.uniformData,
"u");
return this.cache[t] || (this.cache[t] = generateUniformsSync(e,
this.shader.program.uniformData)),
e.syncUniforms[this.shader.program.id] = this.cache[t],
e.syncUniforms[this.shader.program.id]
}
syncUniformBufferGroup(e, t) {
const r = this.getGlProgram();
if (!e.static || 0 !== e.dirtyId || !r.uniformGroups[e.id]) {
e.dirtyId = 0;
const n = r.uniformGroups[e.id] ||
this.createSyncBufferGroup(e, r, t);
e.buffer.update(),
n(r.uniformData, e.uniforms, this.renderer, defaultSyncData,
e.buffer)
}
this.renderer.buffer.bindBufferBase(e.buffer,
r.uniformBufferBindings[t])
}
createSyncBufferGroup(e, t, r) {
const {gl: n} = this.renderer;
this.renderer.buffer.bind(e.buffer);
const i = this.gl.getUniformBlockIndex(t.program, r);
t.uniformBufferBindings[r] = this.shader.uniformBindCount,
n.uniformBlockBinding(t.program, i, this.shader.uniformBindCount),
this.shader.uniformBindCount++;
const o = this.getSignature(e, this.shader.program.uniformData,
"ubo");
let s = this._uboCache[o];
if (s || (s = this._uboCache[o] = generateUniformBufferSync(e,
this.shader.program.uniformData)),
e.autoManage) {
const t = new Float32Array(s.size / 4);
e.buffer.update(t)
}
return t.uniformGroups[e.id] = s.syncFunc,
t.uniformGroups[e.id]
}
getSignature(e, t, r) {
const n = e.uniforms
, i = [`${r}-`];
for (const o in n)
i.push(o),
t[o] && i.push(t[o].type);
return i.join("-")
}
getGlProgram() {
return this.shader ?
this.shader.program.glPrograms[this.renderer.CONTEXT_UID] : null
}
generateProgram(e) {
const t = this.gl
, r = e.program
, n = generateProgram(t, r);
return r.glPrograms[this.renderer.CONTEXT_UID] = n,
n
}
reset() {
this.program = null,
this.shader = null
}
disposeShader(e) {
this.shader === e && (this.shader = null)
}
destroy() {
this.renderer = null,
this.destroyed = !0
}
}
ShaderSystem.extension = {
type: ExtensionType.RendererSystem,
name: "shader"
},
extensions$1.add(ShaderSystem);
class StartupSystem {
constructor(e) {
this.renderer = e
}
run(e) {
const {renderer: t} = this;
t.runners.init.emit(t.options),
e.hello,
t.resize(t.screen.width, t.screen.height)
}
destroy() {}
}
function mapWebGLBlendModesToPixi(e, t=[]) {
return t[BLEND_MODES.NORMAL] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.ADD] = [e.ONE, e.ONE],
t[BLEND_MODES.MULTIPLY] = [e.DST_COLOR, e.ONE_MINUS_SRC_ALPHA, e.ONE,
e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.SCREEN] = [e.ONE, e.ONE_MINUS_SRC_COLOR, e.ONE,
e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.OVERLAY] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.DARKEN] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.LIGHTEN] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.COLOR_DODGE] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.COLOR_BURN] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.HARD_LIGHT] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.SOFT_LIGHT] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.DIFFERENCE] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.EXCLUSION] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.HUE] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.SATURATION] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.COLOR] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.LUMINOSITY] = [e.ONE, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.NONE] = [0, 0],
t[BLEND_MODES.NORMAL_NPM] = [e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE,
e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.ADD_NPM] = [e.SRC_ALPHA, e.ONE, e.ONE, e.ONE],
t[BLEND_MODES.SCREEN_NPM] = [e.SRC_ALPHA, e.ONE_MINUS_SRC_COLOR, e.ONE,
e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.SRC_IN] = [e.DST_ALPHA, e.ZERO],
t[BLEND_MODES.SRC_OUT] = [e.ONE_MINUS_DST_ALPHA, e.ZERO],
t[BLEND_MODES.SRC_ATOP] = [e.DST_ALPHA, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.DST_OVER] = [e.ONE_MINUS_DST_ALPHA, e.ONE],
t[BLEND_MODES.DST_IN] = [e.ZERO, e.SRC_ALPHA],
t[BLEND_MODES.DST_OUT] = [e.ZERO, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.DST_ATOP] = [e.ONE_MINUS_DST_ALPHA, e.SRC_ALPHA],
t[BLEND_MODES.XOR] = [e.ONE_MINUS_DST_ALPHA, e.ONE_MINUS_SRC_ALPHA],
t[BLEND_MODES.SUBTRACT] = [e.ONE, e.ONE, e.ONE, e.ONE,
e.FUNC_REVERSE_SUBTRACT, e.FUNC_ADD],
t
}
StartupSystem.defaultOptions = {
hello: !1
},
StartupSystem.extension = {
type: [ExtensionType.RendererSystem,
ExtensionType.CanvasRendererSystem],
name: "startup"
},
extensions$1.add(StartupSystem);
const BLEND = 0
, OFFSET = 1
, CULLING = 2
, DEPTH_TEST = 3
, WINDING = 4
, DEPTH_MASK = 5
, _StateSystem = class e {
constructor() {
this.gl = null,
this.stateId = 0,
this.polygonOffset = 0,
this.blendMode = BLEND_MODES.NONE,
this._blendEq = !1,
this.map = [],
this.map[BLEND] = this.setBlend,
this.map[OFFSET] = this.setOffset,
this.map[CULLING] = this.setCullFace,
this.map[DEPTH_TEST] = this.setDepthTest,
this.map[WINDING] = this.setFrontFace,
this.map[DEPTH_MASK] = this.setDepthMask,
this.checks = [],
this.defaultState = new State,
this.defaultState.blend = !0
}
contextChange(e) {
this.gl = e,
this.blendModes = mapWebGLBlendModesToPixi(e),
this.set(this.defaultState),
this.reset()
}
set(e) {
if (e = e || this.defaultState,
this.stateId !== e.data) {
let t = this.stateId ^ e.data
, r = 0;
for (; t; )
1 & t && this.map[r].call(this, !!(e.data & 1 << r)),
t >>= 1,
r++;
this.stateId = e.data
}
for (let t = 0; t < this.checks.length; t++)
this.checks[t](this, e)
}
forceState(e) {
e = e || this.defaultState;
for (let t = 0; t < this.map.length; t++)
this.map[t].call(this, !!(e.data & 1 << t));
for (let t = 0; t < this.checks.length; t++)
this.checks[t](this, e);
this.stateId = e.data
}
setBlend(t) {
this.updateCheck(e.checkBlendMode, t),
this.gl[t ? "enable" : "disable"](this.gl.BLEND)
}
setOffset(t) {
this.updateCheck(e.checkPolygonOffset, t),
this.gl[t ? "enable" : "disable"](this.gl.POLYGON_OFFSET_FILL)
}
setDepthTest(e) {
this.gl[e ? "enable" : "disable"](this.gl.DEPTH_TEST)
}
setDepthMask(e) {
this.gl.depthMask(e)
}
setCullFace(e) {
this.gl[e ? "enable" : "disable"](this.gl.CULL_FACE)
}
setFrontFace(e) {
this.gl.frontFace(this.gl[e ? "CW" : "CCW"])
}
setBlendMode(e) {
if (e === this.blendMode)
return;
this.blendMode = e;
const t = this.blendModes[e]
, r = this.gl;
2 === t.length ? r.blendFunc(t[0], t[1]) :
r.blendFuncSeparate(t[0], t[1], t[2], t[3]),
6 === t.length ? (this._blendEq = !0,
r.blendEquationSeparate(t[4], t[5])) : this._blendEq &&
(this._blendEq = !1,
r.blendEquationSeparate(r.FUNC_ADD, r.FUNC_ADD))
}
setPolygonOffset(e, t) {
this.gl.polygonOffset(e, t)
}
reset() {
this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, !1),
this.forceState(this.defaultState),
this._blendEq = !0,
this.blendMode = -1,
this.setBlendMode(0)
}
updateCheck(e, t) {
const r = this.checks.indexOf(e);
t && -1 === r ? this.checks.push(e) : !t && -1 !== r &&
this.checks.splice(r, 1)
}
static checkBlendMode(e, t) {
e.setBlendMode(t.blendMode)
}
static checkPolygonOffset(e, t) {
e.setPolygonOffset(1, t.polygonOffset)
}
destroy() {
this.gl = null
}
}
;
_StateSystem.extension = {
type: ExtensionType.RendererSystem,
name: "state"
};
let StateSystem = _StateSystem;
extensions$1.add(StateSystem);
class SystemManager extends EventEmitter$2 {
constructor() {
super(...arguments),
this.runners = {},
this._systemsHash = {}
}
setup(e) {
this.addRunners(...e.runners);
const t = (e.priority ?? []).filter((t => e.systems[t]))
, r = [...t, ...Object.keys(e.systems).filter((e => !
t.includes(e)))];
for (const n of r)
this.addSystem(e.systems[n], n)
}
addRunners(...e) {
e.forEach((e => {
this.runners[e] = new Runner(e)
}
))
}
addSystem(e, t) {
const r = new e(this);
if (this[t])
throw new Error(`Whoops! The name "${t}" is already in use`);
this[t] = r,
this._systemsHash[t] = r;
for (const n in this.runners)
this.runners[n].add(r);
return this
}
emitWithCustomOptions(e, t) {
const r = Object.keys(this._systemsHash);
e.items.forEach((n => {
const i = r.find((e => this._systemsHash[e] === n));
n[e.name](t[i])
}
))
}
destroy() {
Object.values(this.runners).forEach((e => {
e.destroy()
}
)),
this._systemsHash = {}
}
}
const _TextureGCSystem = class e {
constructor(t) {
this.renderer = t,
this.count = 0,
this.checkCount = 0,
this.maxIdle = e.defaultMaxIdle,
this.checkCountMax = e.defaultCheckCountMax,
this.mode = e.defaultMode
}
postrender() {
this.renderer.objectRenderer.renderingToScreen && (this.count++,
this.mode !== GC_MODES.MANUAL && (this.checkCount++,
this.checkCount > this.checkCountMax && (this.checkCount = 0,
this.run())))
}
run() {
const e = this.renderer.texture
, t = e.managedTextures;
let r = !1;
for (let n = 0; n < t.length; n++) {
const i = t[n];
i.resource && this.count - i.touched > this.maxIdle &&
(e.destroyTexture(i, !0),
t[n] = null,
r = !0)
}
if (r) {
let e = 0;
for (let r = 0; r < t.length; r++)
null !== t[r] && (t[e++] = t[r]);
t.length = e
}
}
unload(e) {
const t = this.renderer.texture
, r = e._texture;
r && !r.framebuffer && t.destroyTexture(r);
for (let n = e.children.length - 1; n >= 0; n--)
this.unload(e.children[n])
}
destroy() {
this.renderer = null
}
}
;
_TextureGCSystem.defaultMode = GC_MODES.AUTO,
_TextureGCSystem.defaultMaxIdle = 3600,
_TextureGCSystem.defaultCheckCountMax = 600,
_TextureGCSystem.extension = {
type: ExtensionType.RendererSystem,
name: "textureGC"
};
let TextureGCSystem = _TextureGCSystem;
extensions$1.add(TextureGCSystem);
class GLTexture {
constructor(e) {
this.texture = e,
this.width = -1,
this.height = -1,
this.dirtyId = -1,
this.dirtyStyleId = -1,
this.mipmap = !1,
this.wrapMode = 33071,
this.type = TYPES.UNSIGNED_BYTE,
this.internalFormat = FORMATS.RGBA,
this.samplerType = 0
}
}
function mapInternalFormatToSamplerType(e) {
let t;
return t = "WebGL2RenderingContext"in globalThis && e instanceof
globalThis.WebGL2RenderingContext ? {
[e.RGB]: SAMPLER_TYPES.FLOAT,
[e.RGBA]: SAMPLER_TYPES.FLOAT,
[e.ALPHA]: SAMPLER_TYPES.FLOAT,
[e.LUMINANCE]: SAMPLER_TYPES.FLOAT,
[e.LUMINANCE_ALPHA]: SAMPLER_TYPES.FLOAT,
[e.R8]: SAMPLER_TYPES.FLOAT,
[e.R8_SNORM]: SAMPLER_TYPES.FLOAT,
[e.RG8]: SAMPLER_TYPES.FLOAT,
[e.RG8_SNORM]: SAMPLER_TYPES.FLOAT,
[e.RGB8]: SAMPLER_TYPES.FLOAT,
[e.RGB8_SNORM]: SAMPLER_TYPES.FLOAT,
[e.RGB565]: SAMPLER_TYPES.FLOAT,
[e.RGBA4]: SAMPLER_TYPES.FLOAT,
[e.RGB5_A1]: SAMPLER_TYPES.FLOAT,
[e.RGBA8]: SAMPLER_TYPES.FLOAT,
[e.RGBA8_SNORM]: SAMPLER_TYPES.FLOAT,
[e.RGB10_A2]: SAMPLER_TYPES.FLOAT,
[e.RGB10_A2UI]: SAMPLER_TYPES.FLOAT,
[e.SRGB8]: SAMPLER_TYPES.FLOAT,
[e.SRGB8_ALPHA8]: SAMPLER_TYPES.FLOAT,
[e.R16F]: SAMPLER_TYPES.FLOAT,
[e.RG16F]: SAMPLER_TYPES.FLOAT,
[e.RGB16F]: SAMPLER_TYPES.FLOAT,
[e.RGBA16F]: SAMPLER_TYPES.FLOAT,
[e.R32F]: SAMPLER_TYPES.FLOAT,
[e.RG32F]: SAMPLER_TYPES.FLOAT,
[e.RGB32F]: SAMPLER_TYPES.FLOAT,
[e.RGBA32F]: SAMPLER_TYPES.FLOAT,
[e.R11F_G11F_B10F]: SAMPLER_TYPES.FLOAT,
[e.RGB9_E5]: SAMPLER_TYPES.FLOAT,
[e.R8I]: SAMPLER_TYPES.INT,
[e.R8UI]: SAMPLER_TYPES.UINT,
[e.R16I]: SAMPLER_TYPES.INT,
[e.R16UI]: SAMPLER_TYPES.UINT,
[e.R32I]: SAMPLER_TYPES.INT,
[e.R32UI]: SAMPLER_TYPES.UINT,
[e.RG8I]: SAMPLER_TYPES.INT,
[e.RG8UI]: SAMPLER_TYPES.UINT,
[e.RG16I]: SAMPLER_TYPES.INT,
[e.RG16UI]: SAMPLER_TYPES.UINT,
[e.RG32I]: SAMPLER_TYPES.INT,
[e.RG32UI]: SAMPLER_TYPES.UINT,
[e.RGB8I]: SAMPLER_TYPES.INT,
[e.RGB8UI]: SAMPLER_TYPES.UINT,
[e.RGB16I]: SAMPLER_TYPES.INT,
[e.RGB16UI]: SAMPLER_TYPES.UINT,
[e.RGB32I]: SAMPLER_TYPES.INT,
[e.RGB32UI]: SAMPLER_TYPES.UINT,
[e.RGBA8I]: SAMPLER_TYPES.INT,
[e.RGBA8UI]: SAMPLER_TYPES.UINT,
[e.RGBA16I]: SAMPLER_TYPES.INT,
[e.RGBA16UI]: SAMPLER_TYPES.UINT,
[e.RGBA32I]: SAMPLER_TYPES.INT,
[e.RGBA32UI]: SAMPLER_TYPES.UINT,
[e.DEPTH_COMPONENT16]: SAMPLER_TYPES.FLOAT,
[e.DEPTH_COMPONENT24]: SAMPLER_TYPES.FLOAT,
[e.DEPTH_COMPONENT32F]: SAMPLER_TYPES.FLOAT,
[e.DEPTH_STENCIL]: SAMPLER_TYPES.FLOAT,
[e.DEPTH24_STENCIL8]: SAMPLER_TYPES.FLOAT,
[e.DEPTH32F_STENCIL8]: SAMPLER_TYPES.FLOAT
} : {
[e.RGB]: SAMPLER_TYPES.FLOAT,
[e.RGBA]: SAMPLER_TYPES.FLOAT,
[e.ALPHA]: SAMPLER_TYPES.FLOAT,
[e.LUMINANCE]: SAMPLER_TYPES.FLOAT,
[e.LUMINANCE_ALPHA]: SAMPLER_TYPES.FLOAT,
[e.DEPTH_STENCIL]: SAMPLER_TYPES.FLOAT
},
t
}
function mapTypeAndFormatToInternalFormat(e) {
let t;
return t = "WebGL2RenderingContext"in globalThis && e instanceof
globalThis.WebGL2RenderingContext ? {
[TYPES.UNSIGNED_BYTE]: {
[FORMATS.RGBA]: e.RGBA8,
[FORMATS.RGB]: e.RGB8,
[FORMATS.RG]: e.RG8,
[FORMATS.RED]: e.R8,
[FORMATS.RGBA_INTEGER]: e.RGBA8UI,
[FORMATS.RGB_INTEGER]: e.RGB8UI,
[FORMATS.RG_INTEGER]: e.RG8UI,
[FORMATS.RED_INTEGER]: e.R8UI,
[FORMATS.ALPHA]: e.ALPHA,
[FORMATS.LUMINANCE]: e.LUMINANCE,
[FORMATS.LUMINANCE_ALPHA]: e.LUMINANCE_ALPHA
},
[TYPES.BYTE]: {
[FORMATS.RGBA]: e.RGBA8_SNORM,
[FORMATS.RGB]: e.RGB8_SNORM,
[FORMATS.RG]: e.RG8_SNORM,
[FORMATS.RED]: e.R8_SNORM,
[FORMATS.RGBA_INTEGER]: e.RGBA8I,
[FORMATS.RGB_INTEGER]: e.RGB8I,
[FORMATS.RG_INTEGER]: e.RG8I,
[FORMATS.RED_INTEGER]: e.R8I
},
[TYPES.UNSIGNED_SHORT]: {
[FORMATS.RGBA_INTEGER]: e.RGBA16UI,
[FORMATS.RGB_INTEGER]: e.RGB16UI,
[FORMATS.RG_INTEGER]: e.RG16UI,
[FORMATS.RED_INTEGER]: e.R16UI,
[FORMATS.DEPTH_COMPONENT]: e.DEPTH_COMPONENT16
},
[TYPES.SHORT]: {
[FORMATS.RGBA_INTEGER]: e.RGBA16I,
[FORMATS.RGB_INTEGER]: e.RGB16I,
[FORMATS.RG_INTEGER]: e.RG16I,
[FORMATS.RED_INTEGER]: e.R16I
},
[TYPES.UNSIGNED_INT]: {
[FORMATS.RGBA_INTEGER]: e.RGBA32UI,
[FORMATS.RGB_INTEGER]: e.RGB32UI,
[FORMATS.RG_INTEGER]: e.RG32UI,
[FORMATS.RED_INTEGER]: e.R32UI,
[FORMATS.DEPTH_COMPONENT]: e.DEPTH_COMPONENT24
},
[TYPES.INT]: {
[FORMATS.RGBA_INTEGER]: e.RGBA32I,
[FORMATS.RGB_INTEGER]: e.RGB32I,
[FORMATS.RG_INTEGER]: e.RG32I,
[FORMATS.RED_INTEGER]: e.R32I
},
[TYPES.FLOAT]: {
[FORMATS.RGBA]: e.RGBA32F,
[FORMATS.RGB]: e.RGB32F,
[FORMATS.RG]: e.RG32F,
[FORMATS.RED]: e.R32F,
[FORMATS.DEPTH_COMPONENT]: e.DEPTH_COMPONENT32F
},
[TYPES.HALF_FLOAT]: {
[FORMATS.RGBA]: e.RGBA16F,
[FORMATS.RGB]: e.RGB16F,
[FORMATS.RG]: e.RG16F,
[FORMATS.RED]: e.R16F
},
[TYPES.UNSIGNED_SHORT_5_6_5]: {
[FORMATS.RGB]: e.RGB565
},
[TYPES.UNSIGNED_SHORT_4_4_4_4]: {
[FORMATS.RGBA]: e.RGBA4
},
[TYPES.UNSIGNED_SHORT_5_5_5_1]: {
[FORMATS.RGBA]: e.RGB5_A1
},
[TYPES.UNSIGNED_INT_2_10_10_10_REV]: {
[FORMATS.RGBA]: e.RGB10_A2,
[FORMATS.RGBA_INTEGER]: e.RGB10_A2UI
},
[TYPES.UNSIGNED_INT_10F_11F_11F_REV]: {
[FORMATS.RGB]: e.R11F_G11F_B10F
},
[TYPES.UNSIGNED_INT_5_9_9_9_REV]: {
[FORMATS.RGB]: e.RGB9_E5
},
[TYPES.UNSIGNED_INT_24_8]: {
[FORMATS.DEPTH_STENCIL]: e.DEPTH24_STENCIL8
},
[TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]: {
[FORMATS.DEPTH_STENCIL]: e.DEPTH32F_STENCIL8
}
} : {
[TYPES.UNSIGNED_BYTE]: {
[FORMATS.RGBA]: e.RGBA,
[FORMATS.RGB]: e.RGB,
[FORMATS.ALPHA]: e.ALPHA,
[FORMATS.LUMINANCE]: e.LUMINANCE,
[FORMATS.LUMINANCE_ALPHA]: e.LUMINANCE_ALPHA
},
[TYPES.UNSIGNED_SHORT_5_6_5]: {
[FORMATS.RGB]: e.RGB
},
[TYPES.UNSIGNED_SHORT_4_4_4_4]: {
[FORMATS.RGBA]: e.RGBA
},
[TYPES.UNSIGNED_SHORT_5_5_5_1]: {
[FORMATS.RGBA]: e.RGBA
}
},
t
}
class TextureSystem {
constructor(e) {
this.renderer = e,
this.boundTextures = [],
this.currentLocation = -1,
this.managedTextures = [],
this._unknownBoundTextures = !1,
this.unknownTexture = new BaseTexture,
this.hasIntegerTextures = !1
}
contextChange() {
const e = this.gl = this.renderer.gl;
this.CONTEXT_UID = this.renderer.CONTEXT_UID,
this.webGLVersion = this.renderer.context.webGLVersion,
this.internalFormats = mapTypeAndFormatToInternalFormat(e),
this.samplerTypes = mapInternalFormatToSamplerType(e);
const t = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);
this.boundTextures.length = t;
for (let n = 0; n < t; n++)
this.boundTextures[n] = null;
this.emptyTextures = {};
const r = new GLTexture(e.createTexture());
e.bindTexture(e.TEXTURE_2D, r.texture),
e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, 1, 1, 0, e.RGBA,
e.UNSIGNED_BYTE, new Uint8Array(4)),
this.emptyTextures[e.TEXTURE_2D] = r,
this.emptyTextures[e.TEXTURE_CUBE_MAP] = new
GLTexture(e.createTexture()),
e.bindTexture(e.TEXTURE_CUBE_MAP,
this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);
for (let n = 0; n < 6; n++)
e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + n, 0, e.RGBA, 1,
1, 0, e.RGBA, e.UNSIGNED_BYTE, null);
e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_MAG_FILTER,
e.LINEAR),
e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_MIN_FILTER,
e.LINEAR);
for (let n = 0; n < this.boundTextures.length; n++)
this.bind(null, n)
}
bind(e, t=0) {
const {gl: r} = this;
if ((null == (e = null == e ? void 0 : e.castToBaseTexture()) ?
void 0 : e.valid) && !e.parentTextureArray) {
e.touched = this.renderer.textureGC.count;
const n = e._glTextures[this.CONTEXT_UID] ||
this.initTexture(e);
this.boundTextures[t] !== e && (this.currentLocation !== t &&
(this.currentLocation = t,
r.activeTexture(r.TEXTURE0 + t)),
r.bindTexture(e.target, n.texture)),
n.dirtyId !== e.dirtyId ? (this.currentLocation !== t &&
(this.currentLocation = t,
r.activeTexture(r.TEXTURE0 + t)),
this.updateTexture(e)) : n.dirtyStyleId !== e.dirtyStyleId &&
this.updateTextureStyle(e),
this.boundTextures[t] = e
} else
this.currentLocation !== t && (this.currentLocation = t,
r.activeTexture(r.TEXTURE0 + t)),
r.bindTexture(r.TEXTURE_2D,
this.emptyTextures[r.TEXTURE_2D].texture),
this.boundTextures[t] = null
}
reset() {
this._unknownBoundTextures = !0,
this.hasIntegerTextures = !1,
this.currentLocation = -1;
for (let e = 0; e < this.boundTextures.length; e++)
this.boundTextures[e] = this.unknownTexture
}
unbind(e) {
const {gl: t, boundTextures: r} = this;
if (this._unknownBoundTextures) {
this._unknownBoundTextures = !1;
for (let e = 0; e < r.length; e++)
r[e] === this.unknownTexture && this.bind(null, e)
}
for (let n = 0; n < r.length; n++)
r[n] === e && (this.currentLocation !== n &&
(t.activeTexture(t.TEXTURE0 + n),
this.currentLocation = n),
t.bindTexture(e.target, this.emptyTextures[e.target].texture),
r[n] = null)
}
ensureSamplerType(e) {
const {boundTextures: t, hasIntegerTextures: r, CONTEXT_UID: n} =
this;
if (r)
for (let i = e - 1; i >= 0; --i) {
const e = t[i];
e && e._glTextures[n].samplerType !== SAMPLER_TYPES.FLOAT
&& this.renderer.texture.unbind(e)
}
}
initTexture(e) {
const t = new GLTexture(this.gl.createTexture());
return t.dirtyId = -1,
e._glTextures[this.CONTEXT_UID] = t,
this.managedTextures.push(e),
e.on("dispose", this.destroyTexture, this),
t
}
initTextureType(e, t) {
var r;
t.internalFormat = (null == (r = this.internalFormats[e.type]) ?
void 0 : r[e.format]) ?? e.format,
t.samplerType = this.samplerTypes[t.internalFormat] ??
SAMPLER_TYPES.FLOAT,
2 === this.webGLVersion && e.type === TYPES.HALF_FLOAT ? t.type =
this.gl.HALF_FLOAT : t.type = e.type
}
updateTexture(e) {
var t;
const r = e._glTextures[this.CONTEXT_UID];
if (!r)
return;
const n = this.renderer;
if (this.initTextureType(e, r),
null == (t = e.resource) ? void 0 : t.upload(n, e, r))
r.samplerType !== SAMPLER_TYPES.FLOAT &&
(this.hasIntegerTextures = !0);
else {
const t = e.realWidth
, i = e.realHeight
, o = n.gl;
(r.width !== t || r.height !== i || r.dirtyId < 0) && (r.width
= t,
r.height = i,
o.texImage2D(e.target, 0, r.internalFormat, t, i, 0, e.format,
r.type, null))
}
e.dirtyStyleId !== r.dirtyStyleId && this.updateTextureStyle(e),
r.dirtyId = e.dirtyId
}
destroyTexture(e, t) {
const {gl: r} = this;
if ((e = e.castToBaseTexture())._glTextures[this.CONTEXT_UID] &&
(this.unbind(e),
r.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),
e.off("dispose", this.destroyTexture, this),
delete e._glTextures[this.CONTEXT_UID],
!t)) {
const t = this.managedTextures.indexOf(e);
-1 !== t && removeItems(this.managedTextures, t, 1)
}
}
updateTextureStyle(e) {
var t;
const r = e._glTextures[this.CONTEXT_UID];
r && (e.mipmap !== MIPMAP_MODES.POW2 && 2 === this.webGLVersion ||
e.isPowerOfTwo ? r.mipmap = e.mipmap >= 1 : r.mipmap = !1,
2 === this.webGLVersion || e.isPowerOfTwo ? r.wrapMode = e.wrapMode
: r.wrapMode = WRAP_MODES.CLAMP,
(null == (t = e.resource) ? void 0 : t.style(this.renderer, e, r))
|| this.setStyle(e, r),
r.dirtyStyleId = e.dirtyStyleId)
}
setStyle(e, t) {
const r = this.gl;
if (t.mipmap && e.mipmap !== MIPMAP_MODES.ON_MANUAL &&
r.generateMipmap(e.target),
r.texParameteri(e.target, r.TEXTURE_WRAP_S, t.wrapMode),
r.texParameteri(e.target, r.TEXTURE_WRAP_T, t.wrapMode),
t.mipmap) {
r.texParameteri(e.target, r.TEXTURE_MIN_FILTER, e.scaleMode ===
SCALE_MODES.LINEAR ? r.LINEAR_MIPMAP_LINEAR : r.NEAREST_MIPMAP_NEAREST);
const t =
this.renderer.context.extensions.anisotropicFiltering;
if (t && e.anisotropicLevel > 0 && e.scaleMode ===
SCALE_MODES.LINEAR) {
const n = Math.min(e.anisotropicLevel,
r.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
r.texParameterf(e.target, t.TEXTURE_MAX_ANISOTROPY_EXT, n)
}
} else
r.texParameteri(e.target, r.TEXTURE_MIN_FILTER, e.scaleMode ===
SCALE_MODES.LINEAR ? r.LINEAR : r.NEAREST);
r.texParameteri(e.target, r.TEXTURE_MAG_FILTER, e.scaleMode ===
SCALE_MODES.LINEAR ? r.LINEAR : r.NEAREST)
}
destroy() {
this.renderer = null
}
}
TextureSystem.extension = {
type: ExtensionType.RendererSystem,
name: "texture"
},
extensions$1.add(TextureSystem);
class TransformFeedbackSystem {
constructor(e) {
this.renderer = e
}
contextChange() {
this.gl = this.renderer.gl,
this.CONTEXT_UID = this.renderer.CONTEXT_UID
}
bind(e) {
const {gl: t, CONTEXT_UID: r} = this
, n = e._glTransformFeedbacks[r] ||
this.createGLTransformFeedback(e);
t.bindTransformFeedback(t.TRANSFORM_FEEDBACK, n)
}
unbind() {
const {gl: e} = this;
e.bindTransformFeedback(e.TRANSFORM_FEEDBACK, null)
}
beginTransformFeedback(e, t) {
const {gl: r, renderer: n} = this;
t && n.shader.bind(t),
r.beginTransformFeedback(e)
}
endTransformFeedback() {
const {gl: e} = this;
e.endTransformFeedback()
}
createGLTransformFeedback(e) {
const {gl: t, renderer: r, CONTEXT_UID: n} = this
, i = t.createTransformFeedback();
e._glTransformFeedbacks[n] = i,
t.bindTransformFeedback(t.TRANSFORM_FEEDBACK, i);
for (let o = 0; o < e.buffers.length; o++) {
const i = e.buffers[o];
i && (r.buffer.update(i),
i._glBuffers[n].refCount++,
t.bindBufferBase(t.TRANSFORM_FEEDBACK_BUFFER, o,
i._glBuffers[n].buffer || null))
}
return t.bindTransformFeedback(t.TRANSFORM_FEEDBACK, null),
e.disposeRunner.add(this),
i
}
disposeTransformFeedback(e, t) {
const r = e._glTransformFeedbacks[this.CONTEXT_UID]
, n = this.gl;
e.disposeRunner.remove(this);
const i = this.renderer.buffer;
if (i)
for (let o = 0; o < e.buffers.length; o++) {
const r = e.buffers[o];
if (!r)
continue;
const n = r._glBuffers[this.CONTEXT_UID];
n && (n.refCount--,
0 === n.refCount && !t && i.dispose(r, t))
}
r && (t || n.deleteTransformFeedback(r),
delete e._glTransformFeedbacks[this.CONTEXT_UID])
}
destroy() {
this.renderer = null
}
}
TransformFeedbackSystem.extension = {
type: ExtensionType.RendererSystem,
name: "transformFeedback"
},
extensions$1.add(TransformFeedbackSystem);
class ViewSystem {
constructor(e) {
this.renderer = e
}
init(e) {
this.screen = new Rectangle(0,0,e.width,e.height),
this.element = e.view || settings.ADAPTER.createCanvas(),
this.resolution = e.resolution || settings.RESOLUTION,
this.autoDensity = !!e.autoDensity
}
resizeView(e, t) {
this.element.width = Math.round(e * this.resolution),
this.element.height = Math.round(t * this.resolution);
const r = this.element.width / this.resolution
, n = this.element.height / this.resolution;
this.screen.width = r,
this.screen.height = n,
this.autoDensity && (this.element.style.width = `${r}px`,
this.element.style.height = `${n}px`),
this.renderer.emit("resize", r, n),
this.renderer.runners.resize.emit(this.screen.width,
this.screen.height)
}
destroy(e) {
var t;
e && (null == (t = this.element.parentNode) ||
t.removeChild(this.element)),
this.renderer = null,
this.element = null,
this.screen = null
}
}
ViewSystem.defaultOptions = {
width: 800,
height: 600,
resolution: void 0,
autoDensity: !1
},
ViewSystem.extension = {
type: [ExtensionType.RendererSystem,
ExtensionType.CanvasRendererSystem],
name: "_view"
},
extensions$1.add(ViewSystem),
settings.PREFER_ENV = ENV.WEBGL2,
settings.STRICT_TEXTURE_CACHE = !1,
settings.RENDER_OPTIONS = {
...ContextSystem.defaultOptions,
...BackgroundSystem.defaultOptions,
...ViewSystem.defaultOptions,
...StartupSystem.defaultOptions
},
Object.defineProperties(settings, {
WRAP_MODE: {
get: () => BaseTexture.defaultOptions.wrapMode,
set(e) {
deprecation("7.1.0", "settings.WRAP_MODE is deprecated, use
BaseTexture.defaultOptions.wrapMode"),
BaseTexture.defaultOptions.wrapMode = e
}
},
SCALE_MODE: {
get: () => BaseTexture.defaultOptions.scaleMode,
set(e) {
deprecation("7.1.0", "settings.SCALE_MODE is deprecated, use
BaseTexture.defaultOptions.scaleMode"),
BaseTexture.defaultOptions.scaleMode = e
}
},
MIPMAP_TEXTURES: {
get: () => BaseTexture.defaultOptions.mipmap,
set(e) {
deprecation("7.1.0", "settings.MIPMAP_TEXTURES is deprecated,
use BaseTexture.defaultOptions.mipmap"),
BaseTexture.defaultOptions.mipmap = e
}
},
ANISOTROPIC_LEVEL: {
get: () => BaseTexture.defaultOptions.anisotropicLevel,
set(e) {
deprecation("7.1.0", "settings.ANISOTROPIC_LEVEL is deprecated,
use BaseTexture.defaultOptions.anisotropicLevel"),
BaseTexture.defaultOptions.anisotropicLevel = e
}
},
FILTER_RESOLUTION: {
get: () => (deprecation("7.1.0", "settings.FILTER_RESOLUTION is
deprecated, use Filter.defaultResolution"),
Filter$2.defaultResolution),
set(e) {
Filter$2.defaultResolution = e
}
},
FILTER_MULTISAMPLE: {
get: () => (deprecation("7.1.0", "settings.FILTER_MULTISAMPLE is
deprecated, use Filter.defaultMultisample"),
Filter$2.defaultMultisample),
set(e) {
Filter$2.defaultMultisample = e
}
},
SPRITE_MAX_TEXTURES: {
get: () => BatchRenderer.defaultMaxTextures,
set(e) {
deprecation("7.1.0", "settings.SPRITE_MAX_TEXTURES is
deprecated, use BatchRenderer.defaultMaxTextures"),
BatchRenderer.defaultMaxTextures = e
}
},
SPRITE_BATCH_SIZE: {
get: () => BatchRenderer.defaultBatchSize,
set(e) {
deprecation("7.1.0", "settings.SPRITE_BATCH_SIZE is deprecated,
use BatchRenderer.defaultBatchSize"),
BatchRenderer.defaultBatchSize = e
}
},
CAN_UPLOAD_SAME_BUFFER: {
get: () => BatchRenderer.canUploadSameBuffer,
set(e) {
deprecation("7.1.0", "settings.CAN_UPLOAD_SAME_BUFFER is
deprecated, use BatchRenderer.canUploadSameBuffer"),
BatchRenderer.canUploadSameBuffer = e
}
},
GC_MODE: {
get: () => TextureGCSystem.defaultMode,
set(e) {
deprecation("7.1.0", "settings.GC_MODE is deprecated, use
TextureGCSystem.defaultMode"),
TextureGCSystem.defaultMode = e
}
},
GC_MAX_IDLE: {
get: () => TextureGCSystem.defaultMaxIdle,
set(e) {
deprecation("7.1.0", "settings.GC_MAX_IDLE is deprecated, use
TextureGCSystem.defaultMaxIdle"),
TextureGCSystem.defaultMaxIdle = e
}
},
GC_MAX_CHECK_COUNT: {
get: () => TextureGCSystem.defaultCheckCountMax,
set(e) {
deprecation("7.1.0", "settings.GC_MAX_CHECK_COUNT is
deprecated, use TextureGCSystem.defaultCheckCountMax"),
TextureGCSystem.defaultCheckCountMax = e
}
},
PRECISION_VERTEX: {
get: () => Program.defaultVertexPrecision,
set(e) {
deprecation("7.1.0", "settings.PRECISION_VERTEX is deprecated,
use Program.defaultVertexPrecision"),
Program.defaultVertexPrecision = e
}
},
PRECISION_FRAGMENT: {
get: () => Program.defaultFragmentPrecision,
set(e) {
deprecation("7.1.0", "settings.PRECISION_FRAGMENT is
deprecated, use Program.defaultFragmentPrecision"),
Program.defaultFragmentPrecision = e
}
}
});
var UPDATE_PRIORITY = (e => (e[e.INTERACTION = 50] = "INTERACTION",
e[e.HIGH = 25] = "HIGH",
e[e.NORMAL = 0] = "NORMAL",
e[e.LOW = -25] = "LOW",
e[e.UTILITY = -50] = "UTILITY",
e))(UPDATE_PRIORITY || {});
class TickerListener {
constructor(e, t=null, r=0, n=!1) {
this.next = null,
this.previous = null,
this._destroyed = !1,
this.fn = e,
this.context = t,
this.priority = r,
this.once = n
}
match(e, t=null) {
return this.fn === e && this.context === t
}
emit(e) {
this.fn && (this.context ? this.fn.call(this.context, e) :
this.fn(e));
const t = this.next;
return this.once && this.destroy(!0),
this._destroyed && (this.next = null),
t
}
connect(e) {
this.previous = e,
e.next && (e.next.previous = this),
this.next = e.next,
e.next = this
}
destroy(e=!1) {
this._destroyed = !0,
this.fn = null,
this.context = null,
this.previous && (this.previous.next = this.next),
this.next && (this.next.previous = this.previous);
const t = this.next;
return this.next = e ? null : t,
this.previous = null,
t
}
}
const _Ticker = class e {
constructor() {
this.autoStart = !1,
this.deltaTime = 1,
this.lastTime = -1,
this.speed = 1,
this.started = !1,
this._requestId = null,
this._maxElapsedMS = 100,
this._minElapsedMS = 0,
this._protected = !1,
this._lastFrame = -1,
this._head = new TickerListener(null,null,1 / 0),
this.deltaMS = 1 / e.targetFPMS,
this.elapsedMS = 1 / e.targetFPMS,
this._tick = e => {
this._requestId = null,
this.started && (this.update(e),
this.started && null === this._requestId && this._head.next &&
(this._requestId = requestAnimationFrame(this._tick)))
}
}
_requestIfNeeded() {
null === this._requestId && this._head.next && (this.lastTime =
performance.now(),
this._lastFrame = this.lastTime,
this._requestId = requestAnimationFrame(this._tick))
}
_cancelIfNeeded() {
null !== this._requestId && (cancelAnimationFrame(this._requestId),
this._requestId = null)
}
_startIfPossible() {
this.started ? this._requestIfNeeded() : this.autoStart &&
this.start()
}
add(e, t, r=UPDATE_PRIORITY.NORMAL) {
return this._addListener(new TickerListener(e,t,r))
}
addOnce(e, t, r=UPDATE_PRIORITY.NORMAL) {
return this._addListener(new TickerListener(e,t,r,!0))
}
_addListener(e) {
let t = this._head.next
, r = this._head;
if (t) {
for (; t; ) {
if (e.priority > t.priority) {
e.connect(r);
break
}
r = t,
t = t.next
}
e.previous || e.connect(r)
} else
e.connect(r);
return this._startIfPossible(),
this
}
remove(e, t) {
let r = this._head.next;
for (; r; )
r = r.match(e, t) ? r.destroy() : r.next;
return this._head.next || this._cancelIfNeeded(),
this
}
get count() {
if (!this._head)
return 0;
let e = 0
, t = this._head;
for (; t = t.next; )
e++;
return e
}
start() {
this.started || (this.started = !0,
this._requestIfNeeded())
}
stop() {
this.started && (this.started = !1,
this._cancelIfNeeded())
}
destroy() {
if (!this._protected) {
this.stop();
let e = this._head.next;
for (; e; )
e = e.destroy(!0);
this._head.destroy(),
this._head = null
}
}
update(t=performance.now()) {
let r;
if (t > this.lastTime) {
if (r = this.elapsedMS = t - this.lastTime,
r > this._maxElapsedMS && (r = this._maxElapsedMS),
r *= this.speed,
this._minElapsedMS) {
const e = t - this._lastFrame | 0;
if (e < this._minElapsedMS)
return;
this._lastFrame = t - e % this._minElapsedMS
}
this.deltaMS = r,
this.deltaTime = this.deltaMS * e.targetFPMS;
const n = this._head;
let i = n.next;
for (; i; )
i = i.emit(this.deltaTime);
n.next || this._cancelIfNeeded()
} else
this.deltaTime = this.deltaMS = this.elapsedMS = 0;
this.lastTime = t
}
get FPS() {
return 1e3 / this.elapsedMS
}
get minFPS() {
return 1e3 / this._maxElapsedMS
}
set minFPS(t) {
const r = Math.min(this.maxFPS, t)
, n = Math.min(Math.max(0, r) / 1e3, e.targetFPMS);
this._maxElapsedMS = 1 / n
}
get maxFPS() {
return this._minElapsedMS ? Math.round(1e3 / this._minElapsedMS) :
0
}
set maxFPS(e) {
if (0 === e)
this._minElapsedMS = 0;
else {
const t = Math.max(this.minFPS, e);
this._minElapsedMS = 1 / (t / 1e3)
}
}
static get shared() {
if (!e._shared) {
const t = e._shared = new e;
t.autoStart = !0,
t._protected = !0
}
return e._shared
}
static get system() {
if (!e._system) {
const t = e._system = new e;
t.autoStart = !0,
t._protected = !0
}
return e._system
}
}
;
_Ticker.targetFPMS = .06;
let Ticker = _Ticker;
Object.defineProperties(settings, {
TARGET_FPMS: {
get: () => Ticker.targetFPMS,
set(e) {
deprecation("7.1.0", "settings.TARGET_FPMS is deprecated, use
Ticker.targetFPMS"),
Ticker.targetFPMS = e
}
}
});
class TickerPlugin {
static init(e) {
e = Object.assign({
autoStart: !0,
sharedTicker: !1
}, e),
Object.defineProperty(this, "ticker", {
set(e) {
this._ticker && this._ticker.remove(this.render, this),
this._ticker = e,
e && e.add(this.render, this, UPDATE_PRIORITY.LOW)
},
get() {
return this._ticker
}
}),
this.stop = () => {
this._ticker.stop()
}
,
this.start = () => {
this._ticker.start()
}
,
this._ticker = null,
this.ticker = e.sharedTicker ? Ticker.shared : new Ticker,
e.autoStart && this.start()
}
static destroy() {
if (this._ticker) {
const e = this._ticker;
this.ticker = null,
e.destroy()
}
}
}
TickerPlugin.extension = ExtensionType.Application,
extensions$1.add(TickerPlugin);
const renderers = [];
function autoDetectRenderer(e) {
for (const t of renderers)
if (t.test(e))
return new t(e);
throw new Error("Unable to auto-detect a suitable renderer.")
}
extensions$1.handleByList(ExtensionType.Renderer, renderers);
var $defaultVertex = "attribute vec2 aVertexPosition;\nattribute vec2
aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\
nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix *
vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, $defaultFilterVertex = "attribute vec2 aVertexPosition;\n\nuniform mat3
projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\
nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2
position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2
filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw *
inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\
n vTextureCoord = filterTextureCoord();\n}\n";
const defaultVertex = $defaultVertex
, defaultFilterVertex = $defaultFilterVertex;
class MultisampleSystem {
constructor(e) {
this.renderer = e
}
contextChange(e) {
let t;
if (1 === this.renderer.context.webGLVersion) {
const r = e.getParameter(e.FRAMEBUFFER_BINDING);
e.bindFramebuffer(e.FRAMEBUFFER, null),
t = e.getParameter(e.SAMPLES),
e.bindFramebuffer(e.FRAMEBUFFER, r)
} else {
const r = e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);
e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null),
t = e.getParameter(e.SAMPLES),
e.bindFramebuffer(e.DRAW_FRAMEBUFFER, r)
}
t >= MSAA_QUALITY.HIGH ? this.multisample = MSAA_QUALITY.HIGH : t
>= MSAA_QUALITY.MEDIUM ? this.multisample = MSAA_QUALITY.MEDIUM : t >=
MSAA_QUALITY.LOW ? this.multisample = MSAA_QUALITY.LOW : this.multisample =
MSAA_QUALITY.NONE
}
destroy() {}
}
MultisampleSystem.extension = {
type: ExtensionType.RendererSystem,
name: "_multisample"
},
extensions$1.add(MultisampleSystem);
class GLBuffer {
constructor(e) {
this.buffer = e || null,
this.updateID = -1,
this.byteLength = -1,
this.refCount = 0
}
}
class BufferSystem {
constructor(e) {
this.renderer = e,
this.managedBuffers = {},
this.boundBufferBases = {}
}
destroy() {
this.renderer = null
}
contextChange() {
this.disposeAll(!0),
this.gl = this.renderer.gl,
this.CONTEXT_UID = this.renderer.CONTEXT_UID
}
bind(e) {
const {gl: t, CONTEXT_UID: r} = this
, n = e._glBuffers[r] || this.createGLBuffer(e);
t.bindBuffer(e.type, n.buffer)
}
unbind(e) {
const {gl: t} = this;
t.bindBuffer(e, null)
}
bindBufferBase(e, t) {
const {gl: r, CONTEXT_UID: n} = this;
if (this.boundBufferBases[t] !== e) {
const i = e._glBuffers[n] || this.createGLBuffer(e);
this.boundBufferBases[t] = e,
r.bindBufferBase(r.UNIFORM_BUFFER, t, i.buffer)
}
}
bindBufferRange(e, t, r) {
const {gl: n, CONTEXT_UID: i} = this;
r = r || 0;
const o = e._glBuffers[i] || this.createGLBuffer(e);
n.bindBufferRange(n.UNIFORM_BUFFER, t || 0, o.buffer, 256 * r, 256)
}
update(e) {
const {gl: t, CONTEXT_UID: r} = this
, n = e._glBuffers[r] || this.createGLBuffer(e);
if (e._updateID !== n.updateID)
if (n.updateID = e._updateID,
t.bindBuffer(e.type, n.buffer),
n.byteLength >= e.data.byteLength)
t.bufferSubData(e.type, 0, e.data);
else {
const r = e.static ? t.STATIC_DRAW : t.DYNAMIC_DRAW;
n.byteLength = e.data.byteLength,
t.bufferData(e.type, e.data, r)
}
}
dispose(e, t) {
if (!this.managedBuffers[e.id])
return;
delete this.managedBuffers[e.id];
const r = e._glBuffers[this.CONTEXT_UID]
, n = this.gl;
e.disposeRunner.remove(this),
r && (t || n.deleteBuffer(r.buffer),
delete e._glBuffers[this.CONTEXT_UID])
}
disposeAll(e) {
const t = Object.keys(this.managedBuffers);
for (let r = 0; r < t.length; r++)
this.dispose(this.managedBuffers[t[r]], e)
}
createGLBuffer(e) {
const {CONTEXT_UID: t, gl: r} = this;
return e._glBuffers[t] = new GLBuffer(r.createBuffer()),
this.managedBuffers[e.id] = e,
e.disposeRunner.add(this),
e._glBuffers[t]
}
}
BufferSystem.extension = {
type: ExtensionType.RendererSystem,
name: "buffer"
},
extensions$1.add(BufferSystem);
class ObjectRendererSystem {
constructor(e) {
this.renderer = e
}
render(e, t) {
const r = this.renderer;
let n, i, o, s;
if (t && (n = t.renderTexture,
i = t.clear,
o = t.transform,
s = t.skipUpdateTransform),
this.renderingToScreen = !n,
r.runners.prerender.emit(),
r.emit("prerender"),
r.projection.transform = o,
!r.context.isLost) {
if (n || (this.lastObjectRendered = e),
!s) {
const t = e.enableTempParent();
e.updateTransform(),
e.disableTempParent(t)
}
r.renderTexture.bind(n),
r.batch.currentRenderer.start(),
(i ?? r.background.clearBeforeRender) &&
r.renderTexture.clear(),
e.render(r),
r.batch.currentRenderer.flush(),
n && (t.blit && r.framebuffer.blit(),
n.baseTexture.update()),
r.runners.postrender.emit(),
r.projection.transform = null,
r.emit("postrender")
}
}
destroy() {
this.renderer = null,
this.lastObjectRendered = null
}
}
ObjectRendererSystem.extension = {
type: ExtensionType.RendererSystem,
name: "objectRenderer"
},
extensions$1.add(ObjectRendererSystem);
const _Renderer = class e extends SystemManager {
constructor(t) {
super(),
this.type = RENDERER_TYPE.WEBGL,
t = Object.assign({}, settings.RENDER_OPTIONS, t),
this.gl = null,
this.CONTEXT_UID = 0,
this.globalUniforms = new UniformGroup({
projectionMatrix: new Matrix
},!0);
const r = {
runners: ["init", "destroy", "contextChange",
"resolutionChange", "reset", "update", "postrender", "prerender", "resize"],
systems: e.__systems,
priority: ["_view", "textureGenerator", "background",
"_plugin", "startup", "context", "state", "texture", "buffer", "geometry",
"framebuffer", "transformFeedback", "mask", "scissor", "stencil", "projection",
"textureGC", "filter", "renderTexture", "batch", "objectRenderer", "_multisample"]
};
this.setup(r),
"useContextAlpha"in t && (deprecation("7.0.0",
"options.useContextAlpha is deprecated, use options.premultipliedAlpha and
options.backgroundAlpha instead"),
t.premultipliedAlpha = t.useContextAlpha && "notMultiplied" !==
t.useContextAlpha,
t.backgroundAlpha = !1 === t.useContextAlpha ? 1 :
t.backgroundAlpha),
this._plugin.rendererPlugins = e.__plugins,
this.options = t,
this.startup.run(this.options)
}
static test(e) {
return !(null == e ? void 0 : e.forceCanvas) && isWebGLSupported()
}
render(e, t) {
this.objectRenderer.render(e, t)
}
resize(e, t) {
this._view.resizeView(e, t)
}
reset() {
return this.runners.reset.emit(),
this
}
clear() {
this.renderTexture.bind(),
this.renderTexture.clear()
}
destroy(e=!1) {
this.runners.destroy.items.reverse(),
this.emitWithCustomOptions(this.runners.destroy, {
_view: e
}),
super.destroy()
}
get plugins() {
return this._plugin.plugins
}
get multisample() {
return this._multisample.multisample
}
get width() {
return this._view.element.width
}
get height() {
return this._view.element.height
}
get resolution() {
return this._view.resolution
}
set resolution(e) {
this._view.resolution = e,
this.runners.resolutionChange.emit(e)
}
get autoDensity() {
return this._view.autoDensity
}
get view() {
return this._view.element
}
get screen() {
return this._view.screen
}
get lastObjectRendered() {
return this.objectRenderer.lastObjectRendered
}
get renderingToScreen() {
return this.objectRenderer.renderingToScreen
}
get rendererLogId() {
return `WebGL ${this.context.webGLVersion}`
}
get clearBeforeRender() {
return deprecation("7.0.0", "renderer.clearBeforeRender has been
deprecated, please use renderer.background.clearBeforeRender instead."),
this.background.clearBeforeRender
}
get useContextAlpha() {
return deprecation("7.0.0", "renderer.useContextAlpha has been
deprecated, please use renderer.context.premultipliedAlpha instead."),
this.context.useContextAlpha
}
get preserveDrawingBuffer() {
return deprecation("7.0.0", "renderer.preserveDrawingBuffer has
been deprecated, we cannot truly know this unless pixi created the context"),
this.context.preserveDrawingBuffer
}
get backgroundColor() {
return deprecation("7.0.0", "renderer.backgroundColor has been
deprecated, use renderer.background.color instead."),
this.background.color
}
set backgroundColor(e) {
deprecation("7.0.0", "renderer.backgroundColor has been deprecated,
use renderer.background.color instead."),
this.background.color = e
}
get backgroundAlpha() {
return deprecation("7.0.0", "renderer.backgroundAlpha has been
deprecated, use renderer.background.alpha instead."),
this.background.alpha
}
set backgroundAlpha(e) {
deprecation("7.0.0", "renderer.backgroundAlpha has been deprecated,
use renderer.background.alpha instead."),
this.background.alpha = e
}
get powerPreference() {
return deprecation("7.0.0", "renderer.powerPreference has been
deprecated, we can only know this if pixi creates the context"),
this.context.powerPreference
}
generateTexture(e, t) {
return this.textureGenerator.generateTexture(e, t)
}
}
;
_Renderer.extension = {
type: ExtensionType.Renderer,
priority: 1
},
_Renderer.__plugins = {},
_Renderer.__systems = {};
let Renderer = _Renderer;
extensions$1.handleByMap(ExtensionType.RendererPlugin, Renderer.__plugins),
extensions$1.handleByMap(ExtensionType.RendererSystem, Renderer.__systems),
extensions$1.add(Renderer);
class AbstractMultiResource extends Resource {
constructor(e, t) {
const {width: r, height: n} = t || {};
super(r, n),
this.items = [],
this.itemDirtyIds = [];
for (let i = 0; i < e; i++) {
const e = new BaseTexture;
this.items.push(e),
this.itemDirtyIds.push(-2)
}
this.length = e,
this._load = null,
this.baseTexture = null
}
initFromArray(e, t) {
for (let r = 0; r < this.length; r++)
e[r] && (e[r].castToBaseTexture ?
this.addBaseTextureAt(e[r].castToBaseTexture(), r) : e[r]instanceof Resource ?
this.addResourceAt(e[r], r) : this.addResourceAt(autoDetectResource(e[r], t), r))
}
dispose() {
for (let e = 0, t = this.length; e < t; e++)
this.items[e].destroy();
this.items = null,
this.itemDirtyIds = null,
this._load = null
}
addResourceAt(e, t) {
if (!this.items[t])
throw new Error(`Index ${t} is out of bounds`);
return e.valid && !this.valid && this.resize(e.width, e.height),
this.items[t].setResource(e),
this
}
bind(e) {
if (null !== this.baseTexture)
throw new Error("Only one base texture per TextureArray is
allowed");
super.bind(e);
for (let t = 0; t < this.length; t++)
this.items[t].parentTextureArray = e,
this.items[t].on("update", e.update, e)
}
unbind(e) {
super.unbind(e);
for (let t = 0; t < this.length; t++)
this.items[t].parentTextureArray = null,
this.items[t].off("update", e.update, e)
}
load() {
if (this._load)
return this._load;
const e = this.items.map((e => e.resource)).filter((e => e)).map((e
=> e.load()));
return this._load = Promise.all(e).then(( () => {
const {realWidth: e, realHeight: t} = this.items[0];
return this.resize(e, t),
this.update(),
Promise.resolve(this)
}
)),
this._load
}
}
class ArrayResource extends AbstractMultiResource {
constructor(e, t) {
const {width: r, height: n} = t || {};
let i, o;
Array.isArray(e) ? (i = e,
o = e.length) : o = e,
super(o, {
width: r,
height: n
}),
i && this.initFromArray(i, t)
}
addBaseTextureAt(e, t) {
if (!e.resource)
throw new Error("ArrayResource does not support
RenderTexture");
return this.addResourceAt(e.resource, t),
this
}
bind(e) {
super.bind(e),
e.target = TARGETS.TEXTURE_2D_ARRAY
}
upload(e, t, r) {
const {length: n, itemDirtyIds: i, items: o} = this
, {gl: s} = e;
r.dirtyId < 0 && s.texImage3D(s.TEXTURE_2D_ARRAY, 0,
r.internalFormat, this._width, this._height, n, 0, t.format, r.type, null);
for (let a = 0; a < n; a++) {
const e = o[a];
i[a] < e.dirtyId && (i[a] = e.dirtyId,
e.valid && s.texSubImage3D(s.TEXTURE_2D_ARRAY, 0, 0, 0, a,
e.resource.width, e.resource.height, 1, t.format, r.type, e.resource.source))
}
return !0
}
}
class CanvasResource extends BaseImageResource {
constructor(e) {
super(e)
}
static test(e) {
const {OffscreenCanvas: t} = globalThis;
return !!(t && e instanceof t) || globalThis.HTMLCanvasElement && e
instanceof HTMLCanvasElement
}
}
const _CubeResource = class e extends AbstractMultiResource {
constructor(t, r) {
const {width: n, height: i, autoLoad: o, linkBaseTexture: s} = r ||
{};
if (t && t.length !== e.SIDES)
throw new Error(`Invalid length. Got ${t.length}, expected 6`);
super(6, {
width: n,
height: i
});
for (let a = 0; a < e.SIDES; a++)
this.items[a].target = TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + a;
this.linkBaseTexture = !1 !== s,
t && this.initFromArray(t, r),
!1 !== o && this.load()
}
bind(e) {
super.bind(e),
e.target = TARGETS.TEXTURE_CUBE_MAP
}
addBaseTextureAt(e, t, r) {
if (void 0 === r && (r = this.linkBaseTexture),
!this.items[t])
throw new Error(`Index ${t} is out of bounds`);
if (!this.linkBaseTexture || e.parentTextureArray ||
Object.keys(e._glTextures).length > 0) {
if (!e.resource)
throw new Error("CubeResource does not support copying of
renderTexture.");
this.addResourceAt(e.resource, t)
} else
e.target = TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + t,
e.parentTextureArray = this.baseTexture,
this.items[t] = e;
return e.valid && !this.valid && this.resize(e.realWidth,
e.realHeight),
this.items[t] = e,
this
}
upload(t, r, n) {
const i = this.itemDirtyIds;
for (let o = 0; o < e.SIDES; o++) {
const e = this.items[o];
(i[o] < e.dirtyId || n.dirtyId < r.dirtyId) && (e.valid &&
e.resource ? (e.resource.upload(t, e, n),
i[o] = e.dirtyId) : i[o] < -1 && (t.gl.texImage2D(e.target, 0,
n.internalFormat, r.realWidth, r.realHeight, 0, r.format, n.type, null),
i[o] = -1))
}
return !0
}
static test(t) {
return Array.isArray(t) && t.length === e.SIDES
}
}
;
_CubeResource.SIDES = 6;
let CubeResource = _CubeResource;
class ImageBitmapResource extends BaseImageResource {
constructor(e, t) {
let r, n, i;
t = t || {},
"string" == typeof e ? (r = ImageBitmapResource.EMPTY,
n = e,
i = !0) : (r = e,
n = null,
i = !1),
super(r),
this.url = n,
this.crossOrigin = t.crossOrigin ?? !0,
this.alphaMode = "number" == typeof t.alphaMode ? t.alphaMode :
null,
this.ownsImageBitmap = t.ownsImageBitmap ?? i,
this._load = null,
!1 !== t.autoLoad && this.load()
}
load() {
return this._load || (this._load = new Promise((async (e, t) => {
if (null !== this.url)
try {
const t = await settings.ADAPTER.fetch(this.url, {
mode: this.crossOrigin ? "cors" : "no-cors"
});
if (this.destroyed)
return;
const r = await t.blob();
if (this.destroyed)
return;
const n = await createImageBitmap(r, {
premultiplyAlpha: null === this.alphaMode ||
this.alphaMode === ALPHA_MODES.UNPACK ? "premultiply" : "none"
});
if (this.destroyed)
return void n.close();
this.source = n,
this.update(),
e(this)
} catch (e2) {
if (this.destroyed)
return;
t(e2),
this.onError.emit(e2)
}
else
e(this)
}
))),
this._load
}
upload(e, t, r) {
return this.source instanceof ImageBitmap ? ("number" == typeof
this.alphaMode && (t.alphaMode = this.alphaMode),
super.upload(e, t, r)) : (this.load(),
!1)
}
dispose() {
this.ownsImageBitmap && this.source instanceof ImageBitmap &&
this.source.close(),
super.dispose(),
this._load = null
}
static test(e) {
return !!globalThis.createImageBitmap && typeof ImageBitmap < "u"
&& ("string" == typeof e || e instanceof ImageBitmap)
}
static get EMPTY() {
return ImageBitmapResource._EMPTY = ImageBitmapResource._EMPTY ??
settings.ADAPTER.createCanvas(0, 0),
ImageBitmapResource._EMPTY
}
}
const _SVGResource = class e extends BaseImageResource {
constructor(e, t) {
t = t || {},
super(settings.ADAPTER.createCanvas()),
this._width = 0,
this._height = 0,
this.svg = e,
this.scale = t.scale || 1,
this._overrideWidth = t.width,
this._overrideHeight = t.height,
this._resolve = null,
this._crossorigin = t.crossorigin,
this._load = null,
!1 !== t.autoLoad && this.load()
}
load() {
return this._load || (this._load = new Promise((t => {
if (this._resolve = () => {
this.update(),
t(this)
}
,
e.SVG_XML.test(this.svg.trim())) {
if (!btoa)
throw new Error("Your browser doesn't support base64
conversions.");
this.svg = `data:image/svg+xml;base64,$
{btoa(unescape(encodeURIComponent(this.svg)))}`
}
this._loadSvg()
}
))),
this._load
}
_loadSvg() {
const e = new Image;
BaseImageResource.crossOrigin(e, this.svg, this._crossorigin),
e.src = this.svg,
e.onerror = t => {
this._resolve && (e.onerror = null,
this.onError.emit(t))
}
,
e.onload = () => {
if (!this._resolve)
return;
const t = e.width
, r = e.height;
if (!t || !r)
throw new Error("The SVG image must have width and height
defined (in pixels), canvas API needs them.");
let n = t * this.scale
, i = r * this.scale;
(this._overrideWidth || this._overrideHeight) && (n =
this._overrideWidth || this._overrideHeight / r * t,
i = this._overrideHeight || this._overrideWidth / t * r),
n = Math.round(n),
i = Math.round(i);
const o = this.source;
o.width = n,
o.height = i,
o._pixiId = `canvas_${uid()}`,
o.getContext("2d").drawImage(e, 0, 0, t, r, 0, 0, n, i),
this._resolve(),
this._resolve = null
}
}
static getSize(t) {
const r = e.SVG_SIZE.exec(t)
, n = {};
return r && (n[r[1]] = Math.round(parseFloat(r[3])),
n[r[5]] = Math.round(parseFloat(r[7]))),
n
}
dispose() {
super.dispose(),
this._resolve = null,
this._crossorigin = null
}
static test(t, r) {
return "svg" === r || "string" == typeof t &&
t.startsWith("data:image/svg+xml") || "string" == typeof t && e.SVG_XML.test(t)
}
}
;
_SVGResource.SVG_XML = /^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,
_SVGResource.SVG_SIZE = /<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)
(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;
let SVGResource = _SVGResource;
class VideoFrameResource extends BaseImageResource {
constructor(e) {
super(e)
}
static test(e) {
return !!globalThis.VideoFrame && e instanceof
globalThis.VideoFrame
}
}
const _VideoResource = class e extends BaseImageResource {
constructor(t, r) {
if (r = r || {},
!(t instanceof HTMLVideoElement)) {
const n = document.createElement("video");
!1 !== r.autoLoad && n.setAttribute("preload", "auto"),
!1 !== r.playsinline && (n.setAttribute("webkit-playsinline",
""),
n.setAttribute("playsinline", "")),
!0 === r.muted && (n.setAttribute("muted", ""),
n.muted = !0),
!0 === r.loop && n.setAttribute("loop", ""),
!1 !== r.autoPlay && n.setAttribute("autoplay", ""),
"string" == typeof t && (t = [t]);
const i = t[0].src || t[0];
BaseImageResource.crossOrigin(n, i, r.crossorigin);
for (let r = 0; r < t.length; ++r) {
const i = document.createElement("source");
let {src: o, mime: s} = t[r];
if (o = o || t[r],
o.startsWith("data:"))
s = o.slice(5, o.indexOf(";"));
else if (!o.startsWith("blob:")) {
const t = o.split("?").shift().toLowerCase()
, r = t.slice(t.lastIndexOf(".") + 1);
s = s || e.MIME_TYPES[r] || `video/${r}`
}
i.src = o,
s && (i.type = s),
n.appendChild(i)
}
t = n
}
super(t),
this.noSubImage = !0,
this._autoUpdate = !0,
this._isConnectedToTicker = !1,
this._updateFPS = r.updateFPS || 0,
this._msToNextUpdate = 0,
this.autoPlay = !1 !== r.autoPlay,
this._videoFrameRequestCallback =
this._videoFrameRequestCallback.bind(this),
this._videoFrameRequestCallbackHandle = null,
this._load = null,
this._resolve = null,
this._reject = null,
this._onCanPlay = this._onCanPlay.bind(this),
this._onError = this._onError.bind(this),
this._onPlayStart = this._onPlayStart.bind(this),
this._onPlayStop = this._onPlayStop.bind(this),
this._onSeeked = this._onSeeked.bind(this),
!1 !== r.autoLoad && this.load()
}
update(e=0) {
if (!this.destroyed) {
if (this._updateFPS) {
const e = Ticker.shared.elapsedMS *
this.source.playbackRate;
this._msToNextUpdate = Math.floor(this._msToNextUpdate - e)
}
(!this._updateFPS || this._msToNextUpdate <= 0) &&
(super.update(),
this._msToNextUpdate = this._updateFPS ? Math.floor(1e3 /
this._updateFPS) : 0)
}
}
_videoFrameRequestCallback() {
this.update(),
this.destroyed ? this._videoFrameRequestCallbackHandle = null :
this._videoFrameRequestCallbackHandle =
this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)
}
load() {
if (this._load)
return this._load;
const e = this.source;
return (e.readyState === e.HAVE_ENOUGH_DATA || e.readyState ===
e.HAVE_FUTURE_DATA) && e.width && e.height && (e.complete = !0),
e.addEventListener("play", this._onPlayStart),
e.addEventListener("pause", this._onPlayStop),
e.addEventListener("seeked", this._onSeeked),
this._isSourceReady() ? this._onCanPlay() :
(e.addEventListener("canplay", this._onCanPlay),
e.addEventListener("canplaythrough", this._onCanPlay),
e.addEventListener("error", this._onError, !0)),
this._load = new Promise(( (t, r) => {
this.valid ? t(this) : (this._resolve = t,
this._reject = r,
e.load())
}
)),
this._load
}
_onError(e) {
this.source.removeEventListener("error", this._onError, !0),
this.onError.emit(e),
this._reject && (this._reject(e),
this._reject = null,
this._resolve = null)
}
_isSourcePlaying() {
const e = this.source;
return !e.paused && !e.ended
}
_isSourceReady() {
return this.source.readyState > 2
}
_onPlayStart() {
this.valid || this._onCanPlay(),
this._configureAutoUpdate()
}
_onPlayStop() {
this._configureAutoUpdate()
}
_onSeeked() {
this._autoUpdate && !this._isSourcePlaying() &&
(this._msToNextUpdate = 0,
this.update(),
this._msToNextUpdate = 0)
}
_onCanPlay() {
const e = this.source;
e.removeEventListener("canplay", this._onCanPlay),
e.removeEventListener("canplaythrough", this._onCanPlay);
const t = this.valid;
this._msToNextUpdate = 0,
this.update(),
this._msToNextUpdate = 0,
!t && this._resolve && (this._resolve(this),
this._resolve = null,
this._reject = null),
this._isSourcePlaying() ? this._onPlayStart() : this.autoPlay &&
e.play()
}
dispose() {
this._configureAutoUpdate();
const e = this.source;
e && (e.removeEventListener("play", this._onPlayStart),
e.removeEventListener("pause", this._onPlayStop),
e.removeEventListener("seeked", this._onSeeked),
e.removeEventListener("canplay", this._onCanPlay),
e.removeEventListener("canplaythrough", this._onCanPlay),
e.removeEventListener("error", this._onError, !0),
e.pause(),
e.src = "",
e.load()),
super.dispose()
}
get autoUpdate() {
return this._autoUpdate
}
set autoUpdate(e) {
e !== this._autoUpdate && (this._autoUpdate = e,
this._configureAutoUpdate())
}
get updateFPS() {
return this._updateFPS
}
set updateFPS(e) {
e !== this._updateFPS && (this._updateFPS = e,
this._configureAutoUpdate())
}
_configureAutoUpdate() {
this._autoUpdate && this._isSourcePlaying() ? !this._updateFPS &&
this.source.requestVideoFrameCallback ? (this._isConnectedToTicker &&
(Ticker.shared.remove(this.update, this),
this._isConnectedToTicker = !1,
this._msToNextUpdate = 0),
null === this._videoFrameRequestCallbackHandle &&
(this._videoFrameRequestCallbackHandle =
this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))) : (null !
== this._videoFrameRequestCallbackHandle &&
(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),
this._videoFrameRequestCallbackHandle = null),
this._isConnectedToTicker || (Ticker.shared.add(this.update, this),
this._isConnectedToTicker = !0,
this._msToNextUpdate = 0)) : (null !==
this._videoFrameRequestCallbackHandle &&
(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),
this._videoFrameRequestCallbackHandle = null),
this._isConnectedToTicker && (Ticker.shared.remove(this.update,
this),
this._isConnectedToTicker = !1,
this._msToNextUpdate = 0))
}
static test(t, r) {
return globalThis.HTMLVideoElement && t instanceof HTMLVideoElement
|| e.TYPES.includes(r)
}
}
;
_VideoResource.TYPES = ["mp4", "m4v", "webm", "ogg", "ogv", "h264", "avi",
"mov"],
_VideoResource.MIME_TYPES = {
ogv: "video/ogg",
mov: "video/quicktime",
m4v: "video/mp4"
};
let VideoResource = _VideoResource;
INSTALLED.push(ImageBitmapResource, ImageResource, CanvasResource,
VideoResource, VideoFrameResource, SVGResource, BufferResource, CubeResource,
ArrayResource);
class Bounds {
constructor() {
this.minX = 1 / 0,
this.minY = 1 / 0,
this.maxX = -1 / 0,
this.maxY = -1 / 0,
this.rect = null,
this.updateID = -1
}
isEmpty() {
return this.minX > this.maxX || this.minY > this.maxY
}
clear() {
this.minX = 1 / 0,
this.minY = 1 / 0,
this.maxX = -1 / 0,
this.maxY = -1 / 0
}
getRectangle(e) {
return this.minX > this.maxX || this.minY > this.maxY ?
Rectangle.EMPTY : ((e = e || new Rectangle(0,0,1,1)).x = this.minX,
e.y = this.minY,
e.width = this.maxX - this.minX,
e.height = this.maxY - this.minY,
e)
}
addPoint(e) {
this.minX = Math.min(this.minX, e.x),
this.maxX = Math.max(this.maxX, e.x),
this.minY = Math.min(this.minY, e.y),
this.maxY = Math.max(this.maxY, e.y)
}
addPointMatrix(e, t) {
const {a: r, b: n, c: i, d: o, tx: s, ty: a} = e
, l = r * t.x + i * t.y + s
, c = n * t.x + o * t.y + a;
this.minX = Math.min(this.minX, l),
this.maxX = Math.max(this.maxX, l),
this.minY = Math.min(this.minY, c),
this.maxY = Math.max(this.maxY, c)
}
addQuad(e) {
let t = this.minX
, r = this.minY
, n = this.maxX
, i = this.maxY
, o = e[0]
, s = e[1];
t = o < t ? o : t,
r = s < r ? s : r,
n = o > n ? o : n,
i = s > i ? s : i,
o = e[2],
s = e[3],
t = o < t ? o : t,
r = s < r ? s : r,
n = o > n ? o : n,
i = s > i ? s : i,
o = e[4],
s = e[5],
t = o < t ? o : t,
r = s < r ? s : r,
n = o > n ? o : n,
i = s > i ? s : i,
o = e[6],
s = e[7],
t = o < t ? o : t,
r = s < r ? s : r,
n = o > n ? o : n,
i = s > i ? s : i,
this.minX = t,
this.minY = r,
this.maxX = n,
this.maxY = i
}
addFrame(e, t, r, n, i) {
this.addFrameMatrix(e.worldTransform, t, r, n, i)
}
addFrameMatrix(e, t, r, n, i) {
const o = e.a
, s = e.b
, a = e.c
, l = e.d
, c = e.tx
, u = e.ty;
let d = this.minX
, p = this.minY
, h = this.maxX
, f = this.maxY
, m = o * t + a * r + c
, g = s * t + l * r + u;
d = m < d ? m : d,
p = g < p ? g : p,
h = m > h ? m : h,
f = g > f ? g : f,
m = o * n + a * r + c,
g = s * n + l * r + u,
d = m < d ? m : d,
p = g < p ? g : p,
h = m > h ? m : h,
f = g > f ? g : f,
m = o * t + a * i + c,
g = s * t + l * i + u,
d = m < d ? m : d,
p = g < p ? g : p,
h = m > h ? m : h,
f = g > f ? g : f,
m = o * n + a * i + c,
g = s * n + l * i + u,
d = m < d ? m : d,
p = g < p ? g : p,
h = m > h ? m : h,
f = g > f ? g : f,
this.minX = d,
this.minY = p,
this.maxX = h,
this.maxY = f
}
addVertexData(e, t, r) {
let n = this.minX
, i = this.minY
, o = this.maxX
, s = this.maxY;
for (let a = t; a < r; a += 2) {
const t = e[a]
, r = e[a + 1];
n = t < n ? t : n,
i = r < i ? r : i,
o = t > o ? t : o,
s = r > s ? r : s
}
this.minX = n,
this.minY = i,
this.maxX = o,
this.maxY = s
}
addVertices(e, t, r, n) {
this.addVerticesMatrix(e.worldTransform, t, r, n)
}
addVerticesMatrix(e, t, r, n, i=0, o=i) {
const s = e.a
, a = e.b
, l = e.c
, c = e.d
, u = e.tx
, d = e.ty;
let p = this.minX
, h = this.minY
, f = this.maxX
, m = this.maxY;
for (let g = r; g < n; g += 2) {
const e = t[g]
, r = t[g + 1]
, n = s * e + l * r + u
, y = c * r + a * e + d;
p = Math.min(p, n - i),
f = Math.max(f, n + i),
h = Math.min(h, y - o),
m = Math.max(m, y + o)
}
this.minX = p,
this.minY = h,
this.maxX = f,
this.maxY = m
}
addBounds(e) {
const t = this.minX
, r = this.minY
, n = this.maxX
, i = this.maxY;
this.minX = e.minX < t ? e.minX : t,
this.minY = e.minY < r ? e.minY : r,
this.maxX = e.maxX > n ? e.maxX : n,
this.maxY = e.maxY > i ? e.maxY : i
}
addBoundsMask(e, t) {
const r = e.minX > t.minX ? e.minX : t.minX
, n = e.minY > t.minY ? e.minY : t.minY
, i = e.maxX < t.maxX ? e.maxX : t.maxX
, o = e.maxY < t.maxY ? e.maxY : t.maxY;
if (r <= i && n <= o) {
const e = this.minX
, t = this.minY
, s = this.maxX
, a = this.maxY;
this.minX = r < e ? r : e,
this.minY = n < t ? n : t,
this.maxX = i > s ? i : s,
this.maxY = o > a ? o : a
}
}
addBoundsMatrix(e, t) {
this.addFrameMatrix(t, e.minX, e.minY, e.maxX, e.maxY)
}
addBoundsArea(e, t) {
const r = e.minX > t.x ? e.minX : t.x
, n = e.minY > t.y ? e.minY : t.y
, i = e.maxX < t.x + t.width ? e.maxX : t.x + t.width
, o = e.maxY < t.y + t.height ? e.maxY : t.y + t.height;
if (r <= i && n <= o) {
const e = this.minX
, t = this.minY
, s = this.maxX
, a = this.maxY;
this.minX = r < e ? r : e,
this.minY = n < t ? n : t,
this.maxX = i > s ? i : s,
this.maxY = o > a ? o : a
}
}
pad(e=0, t=e) {
this.isEmpty() || (this.minX -= e,
this.maxX += e,
this.minY -= t,
this.maxY += t)
}
addFramePad(e, t, r, n, i, o) {
e -= i,
t -= o,
r += i,
n += o,
this.minX = this.minX < e ? this.minX : e,
this.maxX = this.maxX > r ? this.maxX : r,
this.minY = this.minY < t ? this.minY : t,
this.maxY = this.maxY > n ? this.maxY : n
}
}
class DisplayObject extends EventEmitter$2 {
constructor() {
super(),
this.tempDisplayObjectParent = null,
this.transform = new Transform,
this.alpha = 1,
this.visible = !0,
this.renderable = !0,
this.cullable = !1,
this.cullArea = null,
this.parent = null,
this.worldAlpha = 1,
this._lastSortedIndex = 0,
this._zIndex = 0,
this.filterArea = null,
this.filters = null,
this._enabledFilters = null,
this._bounds = new Bounds,
this._localBounds = null,
this._boundsID = 0,
this._boundsRect = null,
this._localBoundsRect = null,
this._mask = null,
this._maskRefCount = 0,
this._destroyed = !1,
this.isSprite = !1,
this.isMask = !1
}
static mixin(e) {
const t = Object.keys(e);
for (let r = 0; r < t.length; ++r) {
const n = t[r];
Object.defineProperty(DisplayObject.prototype, n,
Object.getOwnPropertyDescriptor(e, n))
}
}
get destroyed() {
return this._destroyed
}
_recursivePostUpdateTransform() {
this.parent ? (this.parent._recursivePostUpdateTransform(),
this.transform.updateTransform(this.parent.transform)) :
this.transform.updateTransform(this._tempDisplayObjectParent.transform)
}
updateTransform() {
this._boundsID++,
this.transform.updateTransform(this.parent.transform),
this.worldAlpha = this.alpha * this.parent.worldAlpha
}
getBounds(e, t) {
return e || (this.parent ? (this._recursivePostUpdateTransform(),
this.updateTransform()) : (this.parent =
this._tempDisplayObjectParent,
this.updateTransform(),
this.parent = null)),
this._bounds.updateID !== this._boundsID &&
(this.calculateBounds(),
this._bounds.updateID = this._boundsID),
t || (this._boundsRect || (this._boundsRect = new Rectangle),
t = this._boundsRect),
this._bounds.getRectangle(t)
}
getLocalBounds(e) {
e || (this._localBoundsRect || (this._localBoundsRect = new
Rectangle),
e = this._localBoundsRect),
this._localBounds || (this._localBounds = new Bounds);
const t = this.transform
, r = this.parent;
this.parent = null,
this._tempDisplayObjectParent.worldAlpha = (null == r ? void 0 :
r.worldAlpha) ?? 1,
this.transform = this._tempDisplayObjectParent.transform;
const n = this._bounds
, i = this._boundsID;
this._bounds = this._localBounds;
const o = this.getBounds(!1, e);
return this.parent = r,
this.transform = t,
this._bounds = n,
this._bounds.updateID += this._boundsID - i,
o
}
toGlobal(e, t, r=!1) {
return r || (this._recursivePostUpdateTransform(),
this.parent ? this.displayObjectUpdateTransform() : (this.parent =
this._tempDisplayObjectParent,
this.displayObjectUpdateTransform(),
this.parent = null)),
this.worldTransform.apply(e, t)
}
toLocal(e, t, r, n) {
return t && (e = t.toGlobal(e, r, n)),
n || (this._recursivePostUpdateTransform(),
this.parent ? this.displayObjectUpdateTransform() : (this.parent =
this._tempDisplayObjectParent,
this.displayObjectUpdateTransform(),
this.parent = null)),
this.worldTransform.applyInverse(e, r)
}
setParent(e) {
if (!e || !e.addChild)
throw new Error("setParent: Argument must be a Container");
return e.addChild(this),
e
}
removeFromParent() {
var e;
null == (e = this.parent) || e.removeChild(this)
}
setTransform(e=0, t=0, r=1, n=1, i=0, o=0, s=0, a=0, l=0) {
return this.position.x = e,
this.position.y = t,
this.scale.x = r || 1,
this.scale.y = n || 1,
this.rotation = i,
this.skew.x = o,
this.skew.y = s,
this.pivot.x = a,
this.pivot.y = l,
this
}
destroy(e) {
this.removeFromParent(),
this._destroyed = !0,
this.transform = null,
this.parent = null,
this._bounds = null,
this.mask = null,
this.cullArea = null,
this.filters = null,
this.filterArea = null,
this.hitArea = null,
this.eventMode = "auto",
this.interactiveChildren = !1,
this.emit("destroyed"),
this.removeAllListeners()
}
get _tempDisplayObjectParent() {
return null === this.tempDisplayObjectParent &&
(this.tempDisplayObjectParent = new TemporaryDisplayObject),
this.tempDisplayObjectParent
}
enableTempParent() {
const e = this.parent;
return this.parent = this._tempDisplayObjectParent,
e
}
disableTempParent(e) {
this.parent = e
}
get x() {
return this.position.x
}
set x(e) {
this.transform.position.x = e
}
get y() {
return this.position.y
}
set y(e) {
this.transform.position.y = e
}
get worldTransform() {
return this.transform.worldTransform
}
get localTransform() {
return this.transform.localTransform
}
get position() {
return this.transform.position
}
set position(e) {
this.transform.position.copyFrom(e)
}
get scale() {
return this.transform.scale
}
set scale(e) {
this.transform.scale.copyFrom(e)
}
get pivot() {
return this.transform.pivot
}
set pivot(e) {
this.transform.pivot.copyFrom(e)
}
get skew() {
return this.transform.skew
}
set skew(e) {
this.transform.skew.copyFrom(e)
}
get rotation() {
return this.transform.rotation
}
set rotation(e) {
this.transform.rotation = e
}
get angle() {
return this.transform.rotation * RAD_TO_DEG
}
set angle(e) {
this.transform.rotation = e * DEG_TO_RAD
}
get zIndex() {
return this._zIndex
}
set zIndex(e) {
this._zIndex !== e && (this._zIndex = e,
this.parent && (this.parent.sortDirty = !0))
}
get worldVisible() {
let e = this;
do {
if (!e.visible)
return !1;
e = e.parent
} while (e);
return !0
}
get mask() {
return this._mask
}
set mask(e) {
if (this._mask !== e) {
if (this._mask) {
const e = this._mask.isMaskData ? this._mask.maskObject :
this._mask;
e && (e._maskRefCount--,
0 === e._maskRefCount && (e.renderable = !0,
e.isMask = !1))
}
if (this._mask = e,
this._mask) {
const e = this._mask.isMaskData ? this._mask.maskObject :
this._mask;
e && (0 === e._maskRefCount && (e.renderable = !1,
e.isMask = !0),
e._maskRefCount++)
}
}
}
}
class TemporaryDisplayObject extends DisplayObject {
constructor() {
super(...arguments),
this.sortDirty = null
}
}
DisplayObject.prototype.displayObjectUpdateTransform =
DisplayObject.prototype.updateTransform;
const tempMatrix = new Matrix;
function sortChildren(e, t) {
return e.zIndex === t.zIndex ? e._lastSortedIndex -
t._lastSortedIndex : e.zIndex - t.zIndex
}
const _Container = class e extends DisplayObject {
constructor() {
super(),
this.children = [],
this.sortableChildren = e.defaultSortableChildren,
this.sortDirty = !1
}
onChildrenChange(e) {}
addChild(...e) {
if (e.length > 1)
for (let t = 0; t < e.length; t++)
this.addChild(e[t]);
else {
const t = e[0];
t.parent && t.parent.removeChild(t),
t.parent = this,
this.sortDirty = !0,
t.transform._parentID = -1,
this.children.push(t),
this._boundsID++,
this.onChildrenChange(this.children.length - 1),
this.emit("childAdded", t, this, this.children.length - 1),
t.emit("added", this)
}
return e[0]
}
addChildAt(e, t) {
if (t < 0 || t > this.children.length)
throw new Error(`${e}addChildAt: The index ${t} supplied is out
of bounds ${this.children.length}`);
return e.parent && e.parent.removeChild(e),
e.parent = this,
this.sortDirty = !0,
e.transform._parentID = -1,
this.children.splice(t, 0, e),
this._boundsID++,
this.onChildrenChange(t),
e.emit("added", this),
this.emit("childAdded", e, this, t),
e
}
swapChildren(e, t) {
if (e === t)
return;
const r = this.getChildIndex(e)
, n = this.getChildIndex(t);
this.children[r] = t,
this.children[n] = e,
this.onChildrenChange(r < n ? r : n)
}
getChildIndex(e) {
const t = this.children.indexOf(e);
if (-1 === t)
throw new Error("The supplied DisplayObject must be a child of
the caller");
return t
}
setChildIndex(e, t) {
if (t < 0 || t >= this.children.length)
throw new Error(`The index ${t} supplied is out of bounds $
{this.children.length}`);
const r = this.getChildIndex(e);
removeItems(this.children, r, 1),
this.children.splice(t, 0, e),
this.onChildrenChange(t)
}
getChildAt(e) {
if (e < 0 || e >= this.children.length)
throw new Error(`getChildAt: Index (${e}) does not exist.`);
return this.children[e]
}
removeChild(...e) {
if (e.length > 1)
for (let t = 0; t < e.length; t++)
this.removeChild(e[t]);
else {
const t = e[0]
, r = this.children.indexOf(t);
if (-1 === r)
return null;
t.parent = null,
t.transform._parentID = -1,
removeItems(this.children, r, 1),
this._boundsID++,
this.onChildrenChange(r),
t.emit("removed", this),
this.emit("childRemoved", t, this, r)
}
return e[0]
}
removeChildAt(e) {
const t = this.getChildAt(e);
return t.parent = null,
t.transform._parentID = -1,
removeItems(this.children, e, 1),
this._boundsID++,
this.onChildrenChange(e),
t.emit("removed", this),
this.emit("childRemoved", t, this, e),
t
}
removeChildren(e=0, t=this.children.length) {
const r = e
, n = t - r;
let i;
if (n > 0 && n <= t) {
i = this.children.splice(r, n);
for (let e = 0; e < i.length; ++e)
i[e].parent = null,
i[e].transform && (i[e].transform._parentID = -1);
this._boundsID++,
this.onChildrenChange(e);
for (let e = 0; e < i.length; ++e)
i[e].emit("removed", this),
this.emit("childRemoved", i[e], this, e);
return i
}
if (0 === n && 0 === this.children.length)
return [];
throw new RangeError("removeChildren: numeric values are outside
the acceptable range.")
}
sortChildren() {
let e = !1;
for (let t = 0, r = this.children.length; t < r; ++t) {
const r = this.children[t];
r._lastSortedIndex = t,
!e && 0 !== r.zIndex && (e = !0)
}
e && this.children.length > 1 && this.children.sort(sortChildren),
this.sortDirty = !1
}
updateTransform() {
this.sortableChildren && this.sortDirty && this.sortChildren(),
this._boundsID++,
this.transform.updateTransform(this.parent.transform),
this.worldAlpha = this.alpha * this.parent.worldAlpha;
for (let e = 0, t = this.children.length; e < t; ++e) {
const t = this.children[e];
t.visible && t.updateTransform()
}
}
calculateBounds() {
this._bounds.clear(),
this._calculateBounds();
for (let e = 0; e < this.children.length; e++) {
const t = this.children[e];
if (t.visible && t.renderable)
if (t.calculateBounds(),
t._mask) {
const e = t._mask.isMaskData ? t._mask.maskObject :
t._mask;
e ? (e.calculateBounds(),
this._bounds.addBoundsMask(t._bounds, e._bounds)) :
this._bounds.addBounds(t._bounds)
} else
t.filterArea ? this._bounds.addBoundsArea(t._bounds,
t.filterArea) : this._bounds.addBounds(t._bounds)
}
this._bounds.updateID = this._boundsID
}
getLocalBounds(e, t=!1) {
const r = super.getLocalBounds(e);
if (!t)
for (let n = 0, i = this.children.length; n < i; ++n) {
const e = this.children[n];
e.visible && e.updateTransform()
}
return r
}
_calculateBounds() {}
_renderWithCulling(t) {
const r = t.renderTexture.sourceFrame;
if (!(r.width > 0 && r.height > 0))
return;
let n, i;
this.cullArea ? (n = this.cullArea,
i = this.worldTransform) : this._render !== e.prototype._render &&
(n = this.getBounds(!0));
const o = t.projection.transform;
if (o && (i ? (i = tempMatrix.copyFrom(i),
i.prepend(o)) : i = o),
n && r.intersects(n, i))
this._render(t);
else if (this.cullArea)
return;
for (let e = 0, s = this.children.length; e < s; ++e) {
const r = this.children[e]
, n = r.cullable;
r.cullable = n || !this.cullArea,
r.render(t),
r.cullable = n
}
}
render(e) {
var t;
if (this.visible && !(this.worldAlpha <= 0) && this.renderable)
if (this._mask || (null == (t = this.filters) ? void 0 :
t.length))
this.renderAdvanced(e);
else if (this.cullable)
this._renderWithCulling(e);
else {
this._render(e);
for (let t = 0, r = this.children.length; t < r; ++t)
this.children[t].render(e)
}
}
renderAdvanced(e) {
var t, r, n;
const i = this.filters
, o = this._mask;
if (i) {
this._enabledFilters || (this._enabledFilters = []),
this._enabledFilters.length = 0;
for (let e = 0; e < i.length; e++)
i[e].enabled && this._enabledFilters.push(i[e])
}
const s = i && (null == (t = this._enabledFilters) ? void 0 :
t.length) || o && (!o.isMaskData || o.enabled && (o.autoDetect || o.type !==
MASK_TYPES.NONE));
if (s && e.batch.flush(),
i && (null == (r = this._enabledFilters) ? void 0 : r.length) &&
e.filter.push(this, this._enabledFilters),
o && e.mask.push(this, this._mask),
this.cullable)
this._renderWithCulling(e);
else {
this._render(e);
for (let t = 0, r = this.children.length; t < r; ++t)
this.children[t].render(e)
}
s && e.batch.flush(),
o && e.mask.pop(this),
i && (null == (n = this._enabledFilters) ? void 0 : n.length) &&
e.filter.pop()
}
_render(e) {}
destroy(e) {
super.destroy(),
this.sortDirty = !1;
const t = "boolean" == typeof e ? e : null == e ? void 0 :
e.children
, r = this.removeChildren(0, this.children.length);
if (t)
for (let n = 0; n < r.length; ++n)
r[n].destroy(e)
}
get width() {
return this.scale.x * this.getLocalBounds().width
}
set width(e) {
const t = this.getLocalBounds().width;
this.scale.x = 0 !== t ? e / t : 1,
this._width = e
}
get height() {
return this.scale.y * this.getLocalBounds().height
}
set height(e) {
const t = this.getLocalBounds().height;
this.scale.y = 0 !== t ? e / t : 1,
this._height = e
}
}
;
_Container.defaultSortableChildren = !1;
let Container = _Container;
Container.prototype.containerUpdateTransform =
Container.prototype.updateTransform,
Object.defineProperties(settings, {
SORTABLE_CHILDREN: {
get: () => Container.defaultSortableChildren,
set(e) {
deprecation("7.1.0", "settings.SORTABLE_CHILDREN is deprecated,
use Container.defaultSortableChildren"),
Container.defaultSortableChildren = e
}
}
});
const tempPoint$1 = new Point
, indices = new Uint16Array([0, 1, 2, 0, 2, 3]);
class Sprite extends Container {
constructor(e) {
super(),
this._anchor = new ObservablePoint(this._onAnchorUpdate,this,e ?
e.defaultAnchor.x : 0,e ? e.defaultAnchor.y : 0),
this._texture = null,
this._width = 0,
this._height = 0,
this._tintColor = new Color$2(16777215),
this._tintRGB = null,
this.tint = 16777215,
this.blendMode = BLEND_MODES.NORMAL,
this._cachedTint = 16777215,
this.uvs = null,
this.texture = e || Texture.EMPTY,
this.vertexData = new Float32Array(8),
this.vertexTrimmedData = null,
this._transformID = -1,
this._textureID = -1,
this._transformTrimmedID = -1,
this._textureTrimmedID = -1,
this.indices = indices,
this.pluginName = "batch",
this.isSprite = !0,
this._roundPixels = settings.ROUND_PIXELS
}
_onTextureUpdate() {
this._textureID = -1,
this._textureTrimmedID = -1,
this._cachedTint = 16777215,
this._width && (this.scale.x = sign$1(this.scale.x) * this._width /
this._texture.orig.width),
this._height && (this.scale.y = sign$1(this.scale.y) * this._height
/ this._texture.orig.height)
}
_onAnchorUpdate() {
this._transformID = -1,
this._transformTrimmedID = -1
}
calculateVertices() {
const e = this._texture;
if (this._transformID === this.transform._worldID &&
this._textureID === e._updateID)
return;
this._textureID !== e._updateID && (this.uvs =
this._texture._uvs.uvsFloat32),
this._transformID = this.transform._worldID,
this._textureID = e._updateID;
const t = this.transform.worldTransform
, r = t.a
, n = t.b
, i = t.c
, o = t.d
, s = t.tx
, a = t.ty
, l = this.vertexData
, c = e.trim
, u = e.orig
, d = this._anchor;
let p = 0
, h = 0
, f = 0
, m = 0;
if (c ? (h = c.x - d._x * u.width,
p = h + c.width,
m = c.y - d._y * u.height,
f = m + c.height) : (h = -d._x * u.width,
p = h + u.width,
m = -d._y * u.height,
f = m + u.height),
l[0] = r * h + i * m + s,
l[1] = o * m + n * h + a,
l[2] = r * p + i * m + s,
l[3] = o * m + n * p + a,
l[4] = r * p + i * f + s,
l[5] = o * f + n * p + a,
l[6] = r * h + i * f + s,
l[7] = o * f + n * h + a,
this._roundPixels) {
const e = settings.RESOLUTION;
for (let t = 0; t < l.length; ++t)
l[t] = Math.round(l[t] * e) / e
}
}
calculateTrimmedVertices() {
if (this.vertexTrimmedData) {
if (this._transformTrimmedID === this.transform._worldID &&
this._textureTrimmedID === this._texture._updateID)
return
} else
this.vertexTrimmedData = new Float32Array(8);
this._transformTrimmedID = this.transform._worldID,
this._textureTrimmedID = this._texture._updateID;
const e = this._texture
, t = this.vertexTrimmedData
, r = e.orig
, n = this._anchor
, i = this.transform.worldTransform
, o = i.a
, s = i.b
, a = i.c
, l = i.d
, c = i.tx
, u = i.ty
, d = -n._x * r.width
, p = d + r.width
, h = -n._y * r.height
, f = h + r.height;
if (t[0] = o * d + a * h + c,
t[1] = l * h + s * d + u,
t[2] = o * p + a * h + c,
t[3] = l * h + s * p + u,
t[4] = o * p + a * f + c,
t[5] = l * f + s * p + u,
t[6] = o * d + a * f + c,
t[7] = l * f + s * d + u,
this._roundPixels) {
const e = settings.RESOLUTION;
for (let r = 0; r < t.length; ++r)
t[r] = Math.round(t[r] * e) / e
}
}
_render(e) {
this.calculateVertices(),
e.batch.setObjectRenderer(e.plugins[this.pluginName]),
e.plugins[this.pluginName].render(this)
}
_calculateBounds() {
const e = this._texture.trim
, t = this._texture.orig;
!e || e.width === t.width && e.height === t.height ?
(this.calculateVertices(),
this._bounds.addQuad(this.vertexData)) :
(this.calculateTrimmedVertices(),
this._bounds.addQuad(this.vertexTrimmedData))
}
getLocalBounds(e) {
return 0 === this.children.length ? (this._localBounds ||
(this._localBounds = new Bounds),
this._localBounds.minX = this._texture.orig.width * -
this._anchor._x,
this._localBounds.minY = this._texture.orig.height * -
this._anchor._y,
this._localBounds.maxX = this._texture.orig.width * (1 -
this._anchor._x),
this._localBounds.maxY = this._texture.orig.height * (1 -
this._anchor._y),
e || (this._localBoundsRect || (this._localBoundsRect = new
Rectangle),
e = this._localBoundsRect),
this._localBounds.getRectangle(e)) :
super.getLocalBounds.call(this, e)
}
containsPoint(e) {
this.worldTransform.applyInverse(e, tempPoint$1);
const t = this._texture.orig.width
, r = this._texture.orig.height
, n = -t * this.anchor.x;
let i = 0;
return tempPoint$1.x >= n && tempPoint$1.x < n + t && (i = -r *
this.anchor.y,
tempPoint$1.y >= i && tempPoint$1.y < i + r)
}
destroy(e) {
if (super.destroy(e),
this._texture.off("update", this._onTextureUpdate, this),
this._anchor = null,
"boolean" == typeof e ? e : null == e ? void 0 : e.texture) {
const t = "boolean" == typeof e ? e : null == e ? void 0 :
e.baseTexture;
this._texture.destroy(!!t)
}
this._texture = null
}
static from(e, t) {
const r = e instanceof Texture ? e : Texture.from(e, t);
return new Sprite(r)
}
set roundPixels(e) {
this._roundPixels !== e && (this._transformID = -1,
this._transformTrimmedID = -1),
this._roundPixels = e
}
get roundPixels() {
return this._roundPixels
}
get width() {
return Math.abs(this.scale.x) * this._texture.orig.width
}
set width(e) {
const t = sign$1(this.scale.x) || 1;
this.scale.x = t * e / this._texture.orig.width,
this._width = e
}
get height() {
return Math.abs(this.scale.y) * this._texture.orig.height
}
set height(e) {
const t = sign$1(this.scale.y) || 1;
this.scale.y = t * e / this._texture.orig.height,
this._height = e
}
get anchor() {
return this._anchor
}
set anchor(e) {
this._anchor.copyFrom(e)
}
get tint() {
return this._tintColor.value
}
set tint(e) {
this._tintColor.setValue(e),
this._tintRGB = this._tintColor.toLittleEndianNumber()
}
get tintValue() {
return this._tintColor.toNumber()
}
get texture() {
return this._texture
}
set texture(e) {
this._texture !== e && (this._texture &&
this._texture.off("update", this._onTextureUpdate, this),
this._texture = e || Texture.EMPTY,
this._cachedTint = 16777215,
this._textureID = -1,
this._textureTrimmedID = -1,
e && (e.baseTexture.valid ? this._onTextureUpdate() :
e.once("update", this._onTextureUpdate, this)))
}
}
const _tempMatrix = new Matrix;
DisplayObject.prototype._cacheAsBitmap = !1,
DisplayObject.prototype._cacheData = null,
DisplayObject.prototype._cacheAsBitmapResolution = null,
DisplayObject.prototype._cacheAsBitmapMultisample = null;
class CacheData {
constructor() {
this.textureCacheId = null,
this.originalRender = null,
this.originalRenderCanvas = null,
this.originalCalculateBounds = null,
this.originalGetLocalBounds = null,
this.originalUpdateTransform = null,
this.originalDestroy = null,
this.originalMask = null,
this.originalFilterArea = null,
this.originalContainsPoint = null,
this.sprite = null
}
}
Object.defineProperties(DisplayObject.prototype, {
cacheAsBitmapResolution: {
get() {
return this._cacheAsBitmapResolution
},
set(e) {
e !== this._cacheAsBitmapResolution &&
(this._cacheAsBitmapResolution = e,
this.cacheAsBitmap && (this.cacheAsBitmap = !1,
this.cacheAsBitmap = !0))
}
},
cacheAsBitmapMultisample: {
get() {
return this._cacheAsBitmapMultisample
},
set(e) {
e !== this._cacheAsBitmapMultisample &&
(this._cacheAsBitmapMultisample = e,
this.cacheAsBitmap && (this.cacheAsBitmap = !1,
this.cacheAsBitmap = !0))
}
},
cacheAsBitmap: {
get() {
return this._cacheAsBitmap
},
set(e) {
if (this._cacheAsBitmap === e)
return;
let t;
this._cacheAsBitmap = e,
e ? (this._cacheData || (this._cacheData = new CacheData),
t = this._cacheData,
t.originalRender = this.render,
t.originalRenderCanvas = this.renderCanvas,
t.originalUpdateTransform = this.updateTransform,
t.originalCalculateBounds = this.calculateBounds,
t.originalGetLocalBounds = this.getLocalBounds,
t.originalDestroy = this.destroy,
t.originalContainsPoint = this.containsPoint,
t.originalMask = this._mask,
t.originalFilterArea = this.filterArea,
this.render = this._renderCached,
this.renderCanvas = this._renderCachedCanvas,
this.destroy = this._cacheAsBitmapDestroy) : (t =
this._cacheData,
t.sprite && this._destroyCachedDisplayObject(),
this.render = t.originalRender,
this.renderCanvas = t.originalRenderCanvas,
this.calculateBounds = t.originalCalculateBounds,
this.getLocalBounds = t.originalGetLocalBounds,
this.destroy = t.originalDestroy,
this.updateTransform = t.originalUpdateTransform,
this.containsPoint = t.originalContainsPoint,
this._mask = t.originalMask,
this.filterArea = t.originalFilterArea)
}
}
}),
DisplayObject.prototype._renderCached = function(e) {
!this.visible || this.worldAlpha <= 0 || !this.renderable ||
(this._initCachedDisplayObject(e),
this._cacheData.sprite.transform._worldID = this.transform._worldID,
this._cacheData.sprite.worldAlpha = this.worldAlpha,
this._cacheData.sprite._render(e))
}
,
DisplayObject.prototype._initCachedDisplayObject = function(e) {
var t, r;
if (null == (t = this._cacheData) ? void 0 : t.sprite)
return;
const n = this.alpha;
this.alpha = 1,
e.batch.flush();
const i = this.getLocalBounds(new Rectangle, !0);
if (null == (r = this.filters) ? void 0 : r.length) {
const e = this.filters[0].padding;
i.pad(e)
}
const o = this.cacheAsBitmapResolution || e.resolution;
i.ceil(o),
i.width = Math.max(i.width, 1 / o),
i.height = Math.max(i.height, 1 / o);
const s = e.renderTexture.current
, a = e.renderTexture.sourceFrame.clone()
, l = e.renderTexture.destinationFrame.clone()
, c = e.projection.transform
, u = RenderTexture.create({
width: i.width,
height: i.height,
resolution: o,
multisample: this.cacheAsBitmapMultisample ?? e.multisample
})
, d = `cacheAsBitmap_${uid()}`;
this._cacheData.textureCacheId = d,
BaseTexture.addToCache(u.baseTexture, d),
Texture.addToCache(u, d);
const p =
this.transform.localTransform.copyTo(_tempMatrix).invert().translate(-i.x, -i.y);
this.render = this._cacheData.originalRender,
e.render(this, {
renderTexture: u,
clear: !0,
transform: p,
skipUpdateTransform: !1
}),
e.framebuffer.blit(),
e.projection.transform = c,
e.renderTexture.bind(s, a, l),
this.render = this._renderCached,
this.updateTransform = this.displayObjectUpdateTransform,
this.calculateBounds = this._calculateCachedBounds,
this.getLocalBounds = this._getCachedLocalBounds,
this._mask = null,
this.filterArea = null,
this.alpha = n;
const h = new Sprite(u);
h.transform.worldTransform = this.transform.worldTransform,
h.anchor.x = -i.x / i.width,
h.anchor.y = -i.y / i.height,
h.alpha = n,
h._bounds = this._bounds,
this._cacheData.sprite = h,
this.transform._parentID = -1,
this.parent ? this.updateTransform() : (this.enableTempParent(),
this.updateTransform(),
this.disableTempParent(null)),
this.containsPoint = h.containsPoint.bind(h)
}
,
DisplayObject.prototype._renderCachedCanvas = function(e) {
!this.visible || this.worldAlpha <= 0 || !this.renderable ||
(this._initCachedDisplayObjectCanvas(e),
this._cacheData.sprite.worldAlpha = this.worldAlpha,
this._cacheData.sprite._renderCanvas(e))
}
,
DisplayObject.prototype._initCachedDisplayObjectCanvas = function(e) {
var t;
if (null == (t = this._cacheData) ? void 0 : t.sprite)
return;
const r = this.getLocalBounds(new Rectangle, !0)
, n = this.alpha;
this.alpha = 1;
const i = e.canvasContext.activeContext
, o = e._projTransform
, s = this.cacheAsBitmapResolution || e.resolution;
r.ceil(s),
r.width = Math.max(r.width, 1 / s),
r.height = Math.max(r.height, 1 / s);
const a = RenderTexture.create({
width: r.width,
height: r.height,
resolution: s
})
, l = `cacheAsBitmap_${uid()}`;
this._cacheData.textureCacheId = l,
BaseTexture.addToCache(a.baseTexture, l),
Texture.addToCache(a, l);
const c = _tempMatrix;
this.transform.localTransform.copyTo(c),
c.invert(),
c.tx -= r.x,
c.ty -= r.y,
this.renderCanvas = this._cacheData.originalRenderCanvas,
e.render(this, {
renderTexture: a,
clear: !0,
transform: c,
skipUpdateTransform: !1
}),
e.canvasContext.activeContext = i,
e._projTransform = o,
this.renderCanvas = this._renderCachedCanvas,
this.updateTransform = this.displayObjectUpdateTransform,
this.calculateBounds = this._calculateCachedBounds,
this.getLocalBounds = this._getCachedLocalBounds,
this._mask = null,
this.filterArea = null,
this.alpha = n;
const u = new Sprite(a);
u.transform.worldTransform = this.transform.worldTransform,
u.anchor.x = -r.x / r.width,
u.anchor.y = -r.y / r.height,
u.alpha = n,
u._bounds = this._bounds,
this._cacheData.sprite = u,
this.transform._parentID = -1,
this.parent ? this.updateTransform() : (this.parent =
e._tempDisplayObjectParent,
this.updateTransform(),
this.parent = null),
this.containsPoint = u.containsPoint.bind(u)
}
,
DisplayObject.prototype._calculateCachedBounds = function() {
this._bounds.clear(),
this._cacheData.sprite.transform._worldID = this.transform._worldID,
this._cacheData.sprite._calculateBounds(),
this._bounds.updateID = this._boundsID
}
,
DisplayObject.prototype._getCachedLocalBounds = function() {
return this._cacheData.sprite.getLocalBounds(null)
}
,
DisplayObject.prototype._destroyCachedDisplayObject = function() {
this._cacheData.sprite._texture.destroy(!0),
this._cacheData.sprite = null,
BaseTexture.removeFromCache(this._cacheData.textureCacheId),
Texture.removeFromCache(this._cacheData.textureCacheId),
this._cacheData.textureCacheId = null
}
,
DisplayObject.prototype._cacheAsBitmapDestroy = function(e) {
this.cacheAsBitmap = !1,
this.destroy(e)
}
,
DisplayObject.prototype.name = null,
Container.prototype.getChildByName = function(e, t) {
for (let r = 0, n = this.children.length; r < n; r++)
if (this.children[r].name === e)
return this.children[r];
if (t)
for (let r = 0, n = this.children.length; r < n; r++) {
const t = this.children[r];
if (!t.getChildByName)
continue;
const n = t.getChildByName(e, !0);
if (n)
return n
}
return null
}
,
DisplayObject.prototype.getGlobalPosition = function(e=new Point, t=!1) {
return this.parent ? this.parent.toGlobal(this.position, e, t) : (e.x =
this.position.x,
e.y = this.position.y),
e
}
;
var fragment$x = "varying vec2 vTextureCoord;\n\nuniform sampler2D
uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor =
texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n";
class AlphaFilter extends Filter$2 {
constructor(e=1) {
super(defaultVertex, fragment$x, {
uAlpha: 1
}),
this.alpha = e
}
get alpha() {
return this.uniforms.uAlpha
}
set alpha(e) {
this.uniforms.uAlpha = e
}
}
const GAUSSIAN_VALUES = {
5: [.153388, .221461, .250301],
7: [.071303, .131514, .189879, .214607],
9: [.028532, .067234, .124009, .179044, .20236],
11: [.0093, .028002, .065984, .121703, .175713, .198596],
13: [.002406, .009255, .027867, .065666, .121117, .174868, .197641],
15: [489e-
6, .002403, .009246, .02784, .065602, .120999, .174697, .197448]
}
, fragTemplate = ["varying vec2 vBlurTexCoords[%size%];", "uniform
sampler2D uSampler;", "void main(void)", "{", " gl_FragColor = vec4(0.0);", "
%blur%", "}"].join("\n");
function generateBlurFragSource(e) {
const t = GAUSSIAN_VALUES[e]
, r = t.length;
let n = fragTemplate
, i = "";
let o;
for (let s = 0; s < e; s++) {
let n = "gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index
%]) * %value%;".replace("%index%", s.toString());
o = s,
s >= r && (o = e - s - 1),
n = n.replace("%value%", t[o].toString()),
i += n,
i += "\n"
}
return n = n.replace("%blur%", i),
n = n.replace("%size%", e.toString()),
n
}
const vertTemplate = "\n attribute vec2 aVertexPosition;\n\n uniform
mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2
vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4
outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position
= aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n
vec2 filterTextureCoord( void )\n {\n return aVertexPosition *
(outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n
gl_Position = filterVertexPosition();\n\n vec2 textureCoord =
filterTextureCoord();\n %blur%\n }";
function generateBlurVertSource(e, t) {
const r = Math.ceil(e / 2);
let n, i = vertTemplate, o = "";
n = t ? "vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% *
strength, 0.0);" : "vBlurTexCoords[%index%] = textureCoord + vec2(0.0,
%sampleIndex% * strength);";
for (let s = 0; s < e; s++) {
let e = n.replace("%index%", s.toString());
e = e.replace("%sampleIndex%", s - (r - 1) + ".0"),
o += e,
o += "\n"
}
return i = i.replace("%blur%", o),
i = i.replace("%size%", e.toString()),
i
}
class BlurFilterPass extends Filter$2 {
constructor(e, t=8, r=4, n=Filter$2.defaultResolution, i=5) {
super(generateBlurVertSource(i, e), generateBlurFragSource(i)),
this.horizontal = e,
this.resolution = n,
this._quality = 0,
this.quality = r,
this.blur = t
}
apply(e, t, r, n) {
if (r ? this.horizontal ? this.uniforms.strength = 1 / r.width *
(r.width / t.width) : this.uniforms.strength = 1 / r.height * (r.height / t.height)
: this.horizontal ? this.uniforms.strength = 1 / e.renderer.width *
(e.renderer.width / t.width) : this.uniforms.strength = 1 / e.renderer.height *
(e.renderer.height / t.height),
this.uniforms.strength *= this.strength,
this.uniforms.strength /= this.passes,
1 === this.passes)
e.applyFilter(this, t, r, n);
else {
const i = e.getFilterTexture()
, o = e.renderer;
let s = t
, a = i;
this.state.blend = !1,
e.applyFilter(this, s, a, CLEAR_MODES.CLEAR);
for (let t = 1; t < this.passes - 1; t++) {
e.bindAndClear(s, CLEAR_MODES.BLIT),
this.uniforms.uSampler = a;
const t = a;
a = s,
s = t,
o.shader.bind(this),
o.geometry.draw(5)
}
this.state.blend = !0,
e.applyFilter(this, a, r, n),
e.returnFilterTexture(i)
}
}
get blur() {
return this.strength
}
set blur(e) {
this.padding = 1 + 2 * Math.abs(e),
this.strength = e
}
get quality() {
return this._quality
}
set quality(e) {
this._quality = e,
this.passes = e
}
}
class BlurFilter extends Filter$2 {
constructor(e=8, t=4, r=Filter$2.defaultResolution, n=5) {
super(),
this._repeatEdgePixels = !1,
this.blurXFilter = new BlurFilterPass(!0,e,t,r,n),
this.blurYFilter = new BlurFilterPass(!1,e,t,r,n),
this.resolution = r,
this.quality = t,
this.blur = e,
this.repeatEdgePixels = !1
}
apply(e, t, r, n) {
const i = Math.abs(this.blurXFilter.strength)
, o = Math.abs(this.blurYFilter.strength);
if (i && o) {
const i = e.getFilterTexture();
this.blurXFilter.apply(e, t, i, CLEAR_MODES.CLEAR),
this.blurYFilter.apply(e, i, r, n),
e.returnFilterTexture(i)
} else
o ? this.blurYFilter.apply(e, t, r, n) :
this.blurXFilter.apply(e, t, r, n)
}
updatePadding() {
this._repeatEdgePixels ? this.padding = 0 : this.padding = 2 *
Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength))
}
get blur() {
return this.blurXFilter.blur
}
set blur(e) {
this.blurXFilter.blur = this.blurYFilter.blur = e,
this.updatePadding()
}
get quality() {
return this.blurXFilter.quality
}
set quality(e) {
this.blurXFilter.quality = this.blurYFilter.quality = e
}
get blurX() {
return this.blurXFilter.blur
}
set blurX(e) {
this.blurXFilter.blur = e,
this.updatePadding()
}
get blurY() {
return this.blurYFilter.blur
}
set blurY(e) {
this.blurYFilter.blur = e,
this.updatePadding()
}
get blendMode() {
return this.blurYFilter.blendMode
}
set blendMode(e) {
this.blurYFilter.blendMode = e
}
get repeatEdgePixels() {
return this._repeatEdgePixels
}
set repeatEdgePixels(e) {
this._repeatEdgePixels = e,
this.updatePadding()
}
}
var fragment$w = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c =
texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n
gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before
applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /=
c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r
+= (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] *
c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g
+= (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] *
c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b
+= (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] *
c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a
+= (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] *
c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\
n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor =
vec4(rgb, result.a);\n}\n";
class ColorMatrixFilter extends Filter$2 {
constructor() {
const e = {
m: new Float32Array([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,
0, 0, 0, 0, 1, 0]),
uAlpha: 1
};
super(defaultFilterVertex, fragment$w, e),
this.alpha = 1
}
_loadMatrix(e, t=!1) {
let r = e;
t && (this._multiply(r, this.uniforms.m, e),
r = this._colorMatrix(r)),
this.uniforms.m = r
}
_multiply(e, t, r) {
return e[0] = t[0] * r[0] + t[1] * r[5] + t[2] * r[10] + t[3] *
r[15],
e[1] = t[0] * r[1] + t[1] * r[6] + t[2] * r[11] + t[3] * r[16],
e[2] = t[0] * r[2] + t[1] * r[7] + t[2] * r[12] + t[3] * r[17],
e[3] = t[0] * r[3] + t[1] * r[8] + t[2] * r[13] + t[3] * r[18],
e[4] = t[0] * r[4] + t[1] * r[9] + t[2] * r[14] + t[3] * r[19] +
t[4],
e[5] = t[5] * r[0] + t[6] * r[5] + t[7] * r[10] + t[8] * r[15],
e[6] = t[5] * r[1] + t[6] * r[6] + t[7] * r[11] + t[8] * r[16],
e[7] = t[5] * r[2] + t[6] * r[7] + t[7] * r[12] + t[8] * r[17],
e[8] = t[5] * r[3] + t[6] * r[8] + t[7] * r[13] + t[8] * r[18],
e[9] = t[5] * r[4] + t[6] * r[9] + t[7] * r[14] + t[8] * r[19] +
t[9],
e[10] = t[10] * r[0] + t[11] * r[5] + t[12] * r[10] + t[13] *
r[15],
e[11] = t[10] * r[1] + t[11] * r[6] + t[12] * r[11] + t[13] *
r[16],
e[12] = t[10] * r[2] + t[11] * r[7] + t[12] * r[12] + t[13] *
r[17],
e[13] = t[10] * r[3] + t[11] * r[8] + t[12] * r[13] + t[13] *
r[18],
e[14] = t[10] * r[4] + t[11] * r[9] + t[12] * r[14] + t[13] * r[19]
+ t[14],
e[15] = t[15] * r[0] + t[16] * r[5] + t[17] * r[10] + t[18] *
r[15],
e[16] = t[15] * r[1] + t[16] * r[6] + t[17] * r[11] + t[18] *
r[16],
e[17] = t[15] * r[2] + t[16] * r[7] + t[17] * r[12] + t[18] *
r[17],
e[18] = t[15] * r[3] + t[16] * r[8] + t[17] * r[13] + t[18] *
r[18],
e[19] = t[15] * r[4] + t[16] * r[9] + t[17] * r[14] + t[18] * r[19]
+ t[19],
e
}
_colorMatrix(e) {
const t = new Float32Array(e);
return t[4] /= 255,
t[9] /= 255,
t[14] /= 255,
t[19] /= 255,
t
}
brightness(e, t) {
const r = [e, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 1,
0];
this._loadMatrix(r, t)
}
tint(e, t) {
const [r,n,i] = Color$2.shared.setValue(e).toArray()
, o = [r, 0, 0, 0, 0, 0, n, 0, 0, 0, 0, 0, i, 0, 0, 0, 0, 0, 1,
0];
this._loadMatrix(o, t)
}
greyscale(e, t) {
const r = [e, e, e, 0, 0, e, e, e, 0, 0, e, e, e, 0, 0, 0, 0, 0, 1,
0];
this._loadMatrix(r, t)
}
blackAndWhite(e) {
this._loadMatrix([.3, .6, .1, 0, 0, .3, .6, .1, 0, 0, .3, .6, .1,
0, 0, 0, 0, 0, 1, 0], e)
}
hue(e, t) {
e = (e || 0) / 180 * Math.PI;
const r = Math.cos(e)
, n = Math.sin(e)
, i = 1 / 3
, o = (0,
Math.sqrt)(i)
, s = [r + (1 - r) * i, i * (1 - r) - o * n, i * (1 - r) + o * n,
0, 0, i * (1 - r) + o * n, r + i * (1 - r), i * (1 - r) - o * n, 0, 0, i * (1 - r)
- o * n, i * (1 - r) + o * n, r + i * (1 - r), 0, 0, 0, 0, 0, 1, 0];
this._loadMatrix(s, t)
}
contrast(e, t) {
const r = (e || 0) + 1
, n = -.5 * (r - 1)
, i = [r, 0, 0, 0, n, 0, r, 0, 0, n, 0, 0, r, 0, n, 0, 0, 0, 1,
0];
this._loadMatrix(i, t)
}
saturate(e=0, t) {
const r = 2 * e / 3 + 1
, n = -.5 * (r - 1)
, i = [r, n, n, 0, 0, n, r, n, 0, 0, n, n, r, 0, 0, 0, 0, 0, 1,
0];
this._loadMatrix(i, t)
}
desaturate() {
this.saturate(-1)
}
negative(e) {
this._loadMatrix([-1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0,
0, 0, 0, 1, 0], e)
}
sepia(e) {
this._loadMatrix([.393, .7689999, .18899999, 0,
0, .349, .6859999, .16799999, 0, 0, .272, .5339999, .13099999, 0, 0, 0, 0, 0, 1,
0], e)
}
technicolor(e) {
this._loadMatrix([1.9125277891456083, -.8545344976951645,
-.09155508482755585, 0, 11.793603434377337, -.3087833385928097, 1.7658908555458428,
-.10601743074722245, 0, -70.35205161461398, -.231103377548616, -.7501899197440212,
1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0], e)
}
polaroid(e) {
this._loadMatrix([1.438, -.062, -.062, 0, 0, -.122, 1.378, -.122,
0, 0, -.016, -.016, 1.483, 0, 0, 0, 0, 0, 1, 0], e)
}
toBGR(e) {
this._loadMatrix([0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 1, 0], e)
}
kodachrome(e) {
this._loadMatrix([1.1285582396593525, -.3967382283601348,
-.03992559172921793, 0, 63.72958762196502, -.16404339962244616, 1.0835251566291304,
-.05498805115633132, 0, 24.732407896706203, -.16786010706155763,
-.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0], e)
}
browni(e) {
this._loadMatrix([.5997023498159715, .34553243048391263,
-.2708298674538042, 0, 47.43192855600873,
-.037703249837783157, .8609577587992641, .15059552388459913, 0, -36.96841498319127,
.24113635128153335, -.07441037908422492, .44972182064877153, 0, -7.562075277591283,
0, 0, 0, 1, 0], e)
}
vintage(e) {
this._loadMatrix([.6279345635605994, .3202183420819367,
-.03965408211312453, 0,
9.651285835294123, .02578397704808868, .6441188644374771, .03259127616149294, 0,
7.462829176470591, .0466055556782719, -.0851232987247891, .5241648018700465, 0,
5.159190588235296, 0, 0, 0, 1, 0], e)
}
colorTone(e, t, r, n, i) {
e = e || .2,
t = t || .15,
r = r || 16770432,
n = n || 3375104;
const o = Color$2.shared
, [s,a,l] = o.setValue(r).toArray()
, [c,u,d] = o.setValue(n).toArray()
, p = [.3, .59, .11, 0, 0, s, a, l, e, 0, c, u, d, t, 0, s - c, a
- u, l - d, 0, 0];
this._loadMatrix(p, i)
}
night(e, t) {
const r = [-2 * (e = e || .1), -e, 0, 0, 0, -e, 0, e, 0, 0, 0, e, 2
* e, 0, 0, 0, 0, 0, 1, 0];
this._loadMatrix(r, t)
}
predator(e, t) {
const r = [11.224130630493164 * e, -4.794486999511719 * e, -
2.8746118545532227 * e, 0 * e, .40342438220977783 * e, -3.6330697536468506 * e,
9.193157196044922 * e, -2.951810836791992 * e, 0 * e, -1.316135048866272 * e, -
3.2184197902679443 * e, -4.2375030517578125 * e, 7.476448059082031 * e, 0 *
e, .8044459223747253 * e, 0, 0, 0, 1, 0];
this._loadMatrix(r, t)
}
lsd(e) {
this._loadMatrix([2, -.4, .5, 0, 0, -.5, 2, -.4, 0, 0, -.4, -.5, 3,
0, 0, 0, 0, 0, 1, 0], e)
}
reset() {
this._loadMatrix([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
0, 0, 1, 0], !1)
}
get matrix() {
return this.uniforms.m
}
set matrix(e) {
this.uniforms.m = e
}
get alpha() {
return this.uniforms.uAlpha
}
set alpha(e) {
this.uniforms.uAlpha = e
}
}
ColorMatrixFilter.prototype.grayscale =
ColorMatrixFilter.prototype.greyscale;
var fragment$v = "varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\
n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\
nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4
inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler,
vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation *
map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x +
map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n"
, vertex$3 = "attribute vec2 aVertexPosition;\n\nuniform mat3
projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\
nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\
n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition *
max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return
vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2
filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw *
inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\
tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix *
vec3( vTextureCoord, 1.0) ).xy;\n}\n";
class DisplacementFilter extends Filter$2 {
constructor(e, t) {
const r = new Matrix;
e.renderable = !1,
super(vertex$3, fragment$v, {
mapSampler: e._texture,
filterMatrix: r,
scale: {
x: 1,
y: 1
},
rotation: new Float32Array([1, 0, 0, 1])
}),
this.maskSprite = e,
this.maskMatrix = r,
null == t && (t = 20),
this.scale = new Point(t,t)
}
apply(e, t, r, n) {
this.uniforms.filterMatrix =
e.calculateSpriteMatrix(this.maskMatrix, this.maskSprite),
this.uniforms.scale.x = this.scale.x,
this.uniforms.scale.y = this.scale.y;
const i = this.maskSprite.worldTransform
, o = Math.sqrt(i.a * i.a + i.b * i.b)
, s = Math.sqrt(i.c * i.c + i.d * i.d);
0 !== o && 0 !== s && (this.uniforms.rotation[0] = i.a / o,
this.uniforms.rotation[1] = i.b / o,
this.uniforms.rotation[2] = i.c / s,
this.uniforms.rotation[3] = i.d / s),
e.applyFilter(this, t, r, n)
}
get map() {
return this.uniforms.mapSampler
}
set map(e) {
this.uniforms.mapSampler = e
}
}
var fragment$u = 'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying
vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2
vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n
Basic FXAA implementation based on the code on geeks3d.com with the\n modification
that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\
n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by
Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and
binary forms, with or without\n modification, are permitted provided that the
following conditions are\n met:\n\n * Redistributions of source code must retain
the above copyright\n notice, this list of conditions and the following
disclaimer.\n\n * Redistributions in binary form must reproduce the above\n
copyright notice, this list of conditions and the following\n disclaimer in the
documentation and/or other materials provided\n with the distribution.\n\n * The
names of the contributors may not be used to endorse or\n promote products derived
from this software without specific\n prior written permission.\n\n THIS SOFTWARE
IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define
FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define
FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX
8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can
be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n
vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2
v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3
rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex,
v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor =
texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma =
vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE
= dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE =
dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin =
min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax =
max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2
dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW
+ lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE +
lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL),
FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) +
dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) *
inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex,
fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n
texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3
rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex,
fragCoord * inverseVP + dir * -0.5).xyz +\n
texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB =
dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color =
vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n
return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color =
fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE,
v_rgbM);\n\n gl_FragColor = color;\n}\n'
, vertex$2 = "\nattribute vec2 aVertexPosition;\n\nuniform mat3
projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2
v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\
n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition(
void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) +
outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy,
0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out
vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2
v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0,
-1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n
v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord +
vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid
main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord =
aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw,
v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n";
class FXAAFilter extends Filter$2 {
constructor() {
super(vertex$2, fragment$u)
}
}
var fragment$t = "precision highp float;\n\nvarying vec2 vTextureCoord;\
nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform
sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy,
vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color =
texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy *
uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply
alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\
n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g +=
diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *=
color.a;\n\n gl_FragColor = color;\n}\n";
class NoiseFilter extends Filter$2 {
constructor(e=.5, t=Math.random()) {
super(defaultFilterVertex, fragment$t, {
uNoise: 0,
uSeed: 0
}),
this.noise = e,
this.seed = t
}
get noise() {
return this.uniforms.uNoise
}
set noise(e) {
this.uniforms.uNoise = e
}
get seed() {
return this.uniforms.uSeed
}
set seed(e) {
this.uniforms.uSeed = e
}
}
const filters$2 = {
AlphaFilter: AlphaFilter,
BlurFilter: BlurFilter,
BlurFilterPass: BlurFilterPass,
ColorMatrixFilter: ColorMatrixFilter,
DisplacementFilter: DisplacementFilter,
FXAAFilter: FXAAFilter,
NoiseFilter: NoiseFilter
};
Object.entries(filters$2).forEach(( ([e,t]) => {
Object.defineProperty(filters$2, e, {
get: () => (deprecation("7.1.0", `filters.${e} has moved to ${e}`),
t)
})
}
));
class EventsTickerClass {
constructor() {
this.interactionFrequency = 10,
this._deltaTime = 0,
this._didMove = !1,
this.tickerAdded = !1,
this._pauseUpdate = !0
}
init(e) {
this.removeTickerListener(),
this.events = e,
this.interactionFrequency = 10,
this._deltaTime = 0,
this._didMove = !1,
this.tickerAdded = !1,
this._pauseUpdate = !0
}
get pauseUpdate() {
return this._pauseUpdate
}
set pauseUpdate(e) {
this._pauseUpdate = e
}
addTickerListener() {
this.tickerAdded || !this.domElement ||
(Ticker.system.add(this.tickerUpdate, this, UPDATE_PRIORITY.INTERACTION),
this.tickerAdded = !0)
}
removeTickerListener() {
this.tickerAdded && (Ticker.system.remove(this.tickerUpdate, this),
this.tickerAdded = !1)
}
pointerMoved() {
this._didMove = !0
}
update() {
if (!this.domElement || this._pauseUpdate)
return;
if (this._didMove)
return void (this._didMove = !1);
const e = this.events.rootPointerEvent;
this.events.supportsTouchEvents && "touch" === e.pointerType ||
globalThis.document.dispatchEvent(new PointerEvent("pointermove",{
clientX: e.clientX,
clientY: e.clientY
}))
}
tickerUpdate(e) {
this._deltaTime += e,
!(this._deltaTime < this.interactionFrequency) && (this._deltaTime
= 0,
this.update())
}
}
const EventsTicker = new EventsTickerClass;
class FederatedEvent {
constructor(e) {
this.bubbles = !0,
this.cancelBubble = !0,
this.cancelable = !1,
this.composed = !1,
this.defaultPrevented = !1,
this.eventPhase = FederatedEvent.prototype.NONE,
this.propagationStopped = !1,
this.propagationImmediatelyStopped = !1,
this.layer = new Point,
this.page = new Point,
this.NONE = 0,
this.CAPTURING_PHASE = 1,
this.AT_TARGET = 2,
this.BUBBLING_PHASE = 3,
this.manager = e
}
get layerX() {
return this.layer.x
}
get layerY() {
return this.layer.y
}
get pageX() {
return this.page.x
}
get pageY() {
return this.page.y
}
get data() {
return this
}
composedPath() {
return this.manager && (!this.path || this.path[this.path.length -
1] !== this.target) && (this.path = this.target ?
this.manager.propagationPath(this.target) : []),
this.path
}
initEvent(e, t, r) {
throw new Error("initEvent() is a legacy DOM API. It is not
implemented in the Federated Events API.")
}
initUIEvent(e, t, r, n, i) {
throw new Error("initUIEvent() is a legacy DOM API. It is not
implemented in the Federated Events API.")
}
preventDefault() {
this.nativeEvent instanceof Event && this.nativeEvent.cancelable &&
this.nativeEvent.preventDefault(),
this.defaultPrevented = !0
}
stopImmediatePropagation() {
this.propagationImmediatelyStopped = !0
}
stopPropagation() {
this.propagationStopped = !0
}
}
class FederatedMouseEvent extends FederatedEvent {
constructor() {
super(...arguments),
this.client = new Point,
this.movement = new Point,
this.offset = new Point,
this.global = new Point,
this.screen = new Point
}
get clientX() {
return this.client.x
}
get clientY() {
return this.client.y
}
get x() {
return this.clientX
}
get y() {
return this.clientY
}
get movementX() {
return this.movement.x
}
get movementY() {
return this.movement.y
}
get offsetX() {
return this.offset.x
}
get offsetY() {
return this.offset.y
}
get globalX() {
return this.global.x
}
get globalY() {
return this.global.y
}
get screenX() {
return this.screen.x
}
get screenY() {
return this.screen.y
}
getLocalPosition(e, t, r) {
return e.worldTransform.applyInverse(r || this.global, t)
}
getModifierState(e) {
return "getModifierState"in this.nativeEvent &&
this.nativeEvent.getModifierState(e)
}
initMouseEvent(e, t, r, n, i, o, s, a, l, c, u, d, p, h, f) {
throw new Error("Method not implemented.")
}
}
class FederatedPointerEvent extends FederatedMouseEvent {
constructor() {
super(...arguments),
this.width = 0,
this.height = 0,
this.isPrimary = !1
}
getCoalescedEvents() {
return "pointermove" === this.type || "mousemove" === this.type ||
"touchmove" === this.type ? [this] : []
}
getPredictedEvents() {
throw new Error("getPredictedEvents is not supported!")
}
}
class FederatedWheelEvent extends FederatedMouseEvent {
constructor() {
super(...arguments),
this.DOM_DELTA_PIXEL = 0,
this.DOM_DELTA_LINE = 1,
this.DOM_DELTA_PAGE = 2
}
}
FederatedWheelEvent.DOM_DELTA_PIXEL = 0,
FederatedWheelEvent.DOM_DELTA_LINE = 1,
FederatedWheelEvent.DOM_DELTA_PAGE = 2;
const PROPAGATION_LIMIT = 2048
, tempHitLocation = new Point
, tempLocalMapping = new Point;
class EventBoundary {
constructor(e) {
this.dispatch = new EventEmitter$2,
this.moveOnAll = !1,
this.enableGlobalMoveEvents = !0,
this.mappingState = {
trackingData: {}
},
this.eventPool = new Map,
this._allInteractiveElements = [],
this._hitElements = [],
this._isPointerMoveEvent = !1,
this.rootTarget = e,
this.hitPruneFn = this.hitPruneFn.bind(this),
this.hitTestFn = this.hitTestFn.bind(this),
this.mapPointerDown = this.mapPointerDown.bind(this),
this.mapPointerMove = this.mapPointerMove.bind(this),
this.mapPointerOut = this.mapPointerOut.bind(this),
this.mapPointerOver = this.mapPointerOver.bind(this),
this.mapPointerUp = this.mapPointerUp.bind(this),
this.mapPointerUpOutside = this.mapPointerUpOutside.bind(this),
this.mapWheel = this.mapWheel.bind(this),
this.mappingTable = {},
this.addEventMapping("pointerdown", this.mapPointerDown),
this.addEventMapping("pointermove", this.mapPointerMove),
this.addEventMapping("pointerout", this.mapPointerOut),
this.addEventMapping("pointerleave", this.mapPointerOut),
this.addEventMapping("pointerover", this.mapPointerOver),
this.addEventMapping("pointerup", this.mapPointerUp),
this.addEventMapping("pointerupoutside", this.mapPointerUpOutside),
this.addEventMapping("wheel", this.mapWheel)
}
addEventMapping(e, t) {
this.mappingTable[e] || (this.mappingTable[e] = []),
this.mappingTable[e].push({
fn: t,
priority: 0
}),
this.mappingTable[e].sort(( (e, t) => e.priority - t.priority))
}
dispatchEvent(e, t) {
e.propagationStopped = !1,
e.propagationImmediatelyStopped = !1,
this.propagate(e, t),
this.dispatch.emit(t || e.type, e)
}
mapEvent(e) {
if (!this.rootTarget)
return;
const t = this.mappingTable[e.type];
if (t)
for (let r = 0, n = t.length; r < n; r++)
t[r].fn(e)
}
hitTest(e, t) {
EventsTicker.pauseUpdate = !0;
const r = this[this._isPointerMoveEvent &&
this.enableGlobalMoveEvents ? "hitTestMoveRecursive" : "hitTestRecursive"]
(this.rootTarget, this.rootTarget.eventMode, tempHitLocation.set(e, t),
this.hitTestFn, this.hitPruneFn);
return r && r[0]
}
propagate(e, t) {
if (!e.target)
return;
const r = e.composedPath();
e.eventPhase = e.CAPTURING_PHASE;
for (let n = 0, i = r.length - 1; n < i; n++)
if (e.currentTarget = r[n],
this.notifyTarget(e, t),
e.propagationStopped || e.propagationImmediatelyStopped)
return;
if (e.eventPhase = e.AT_TARGET,
e.currentTarget = e.target,
this.notifyTarget(e, t),
!e.propagationStopped && !e.propagationImmediatelyStopped) {
e.eventPhase = e.BUBBLING_PHASE;
for (let n = r.length - 2; n >= 0; n--)
if (e.currentTarget = r[n],
this.notifyTarget(e, t),
e.propagationStopped || e.propagationImmediatelyStopped)
return
}
}
all(e, t, r=this._allInteractiveElements) {
if (0 === r.length)
return;
e.eventPhase = e.BUBBLING_PHASE;
const n = Array.isArray(t) ? t : [t];
for (let i = r.length - 1; i >= 0; i--)
n.forEach((t => {
e.currentTarget = r[i],
this.notifyTarget(e, t)
}
))
}
propagationPath(e) {
const t = [e];
for (let r = 0; r < PROPAGATION_LIMIT && e !== this.rootTarget; r+
+) {
if (!e.parent)
throw new Error("Cannot find propagation path to
disconnected target");
t.push(e.parent),
e = e.parent
}
return t.reverse(),
t
}
hitTestMoveRecursive(e, t, r, n, i, o=!1) {
let s = !1;
if (this._interactivePrune(e))
return null;
if (("dynamic" === e.eventMode || "dynamic" === t) &&
(EventsTicker.pauseUpdate = !1),
e.interactiveChildren && e.children) {
const a = e.children;
for (let l = a.length - 1; l >= 0; l--) {
const c = a[l]
, u = this.hitTestMoveRecursive(c, this._isInteractive(t)
? t : c.eventMode, r, n, i, o || i(e, r));
if (u) {
if (u.length > 0 && !u[u.length - 1].parent)
continue;
const t = e.isInteractive();
(u.length > 0 || t) && (t &&
this._allInteractiveElements.push(e),
u.push(e)),
0 === this._hitElements.length && (this._hitElements =
u),
s = !0
}
}
}
const a = this._isInteractive(t)
, l = e.isInteractive();
return a && l && this._allInteractiveElements.push(e),
o || this._hitElements.length > 0 ? null : s ? this._hitElements :
a && !i(e, r) && n(e, r) ? l ? [e] : [] : null
}
hitTestRecursive(e, t, r, n, i) {
if (this._interactivePrune(e) || i(e, r))
return null;
if (("dynamic" === e.eventMode || "dynamic" === t) &&
(EventsTicker.pauseUpdate = !1),
e.interactiveChildren && e.children) {
const o = e.children;
for (let s = o.length - 1; s >= 0; s--) {
const a = o[s]
, l = this.hitTestRecursive(a, this._isInteractive(t) ? t
: a.eventMode, r, n, i);
if (l) {
if (l.length > 0 && !l[l.length - 1].parent)
continue;
const t = e.isInteractive();
return (l.length > 0 || t) && l.push(e),
l
}
}
}
const o = this._isInteractive(t)
, s = e.isInteractive();
return o && n(e, r) ? s ? [e] : [] : null
}
_isInteractive(e) {
return "static" === e || "dynamic" === e
}
_interactivePrune(e) {
return !(e && !e.isMask && e.visible && e.renderable && "none" !==
e.eventMode && ("passive" !== e.eventMode || e.interactiveChildren) && !e.isMask)
}
hitPruneFn(e, t) {
var r;
if (e.hitArea && (e.worldTransform.applyInverse(t,
tempLocalMapping),
!e.hitArea.contains(tempLocalMapping.x, tempLocalMapping.y)))
return !0;
if (e._mask) {
const n = e._mask.isMaskData ? e._mask.maskObject : e._mask;
if (n && !(null == (r = n.containsPoint) ? void 0 : r.call(n,
t)))
return !0
}
return !1
}
hitTestFn(e, t) {
return "passive" !== e.eventMode && (!!e.hitArea || !!
e.containsPoint && e.containsPoint(t))
}
notifyTarget(e, t) {
var r, n;
const i = `on${t = t ?? e.type}`;
null == (n = (r = e.currentTarget)[i]) || n.call(r, e);
const o = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase ===
e.AT_TARGET ? `${t}capture` : t;
this.notifyListeners(e, o),
e.eventPhase === e.AT_TARGET && this.notifyListeners(e, t)
}
mapPointerDown(e) {
if (!(e instanceof FederatedPointerEvent))
return;
const t = this.createPointerEvent(e);
if (this.dispatchEvent(t, "pointerdown"),
"touch" === t.pointerType)
this.dispatchEvent(t, "touchstart");
else if ("mouse" === t.pointerType || "pen" === t.pointerType) {
const e = 2 === t.button;
this.dispatchEvent(t, e ? "rightdown" : "mousedown")
}
this.trackingData(e.pointerId).pressTargetsByButton[e.button] =
t.composedPath(),
this.freeEvent(t)
}
mapPointerMove(e) {
var t, r;
if (!(e instanceof FederatedPointerEvent))
return;
this._allInteractiveElements.length = 0,
this._hitElements.length = 0,
this._isPointerMoveEvent = !0;
const n = this.createPointerEvent(e);
this._isPointerMoveEvent = !1;
const i = "mouse" === n.pointerType || "pen" === n.pointerType
, o = this.trackingData(e.pointerId)
, s = this.findMountedTarget(o.overTargets);
if ((null == (t = o.overTargets) ? void 0 : t.length) > 0 && s !==
n.target) {
const t = "mousemove" === e.type ? "mouseout" : "pointerout"
, r = this.createPointerEvent(e, t, s);
if (this.dispatchEvent(r, "pointerout"),
i && this.dispatchEvent(r, "mouseout"),
!n.composedPath().includes(s)) {
const t = this.createPointerEvent(e, "pointerleave", s);
for (t.eventPhase = t.AT_TARGET; t.target && !
n.composedPath().includes(t.target); )
t.currentTarget = t.target,
this.notifyTarget(t),
i && this.notifyTarget(t, "mouseleave"),
t.target = t.target.parent;
this.freeEvent(t)
}
this.freeEvent(r)
}
if (s !== n.target) {
const t = "mousemove" === e.type ? "mouseover" : "pointerover"
, r = this.clonePointerEvent(n, t);
this.dispatchEvent(r, "pointerover"),
i && this.dispatchEvent(r, "mouseover");
let o = null == s ? void 0 : s.parent;
for (; o && o !== this.rootTarget.parent && o !== n.target; )
o = o.parent;
if (!o || o === this.rootTarget.parent) {
const e = this.clonePointerEvent(n, "pointerenter");
for (e.eventPhase = e.AT_TARGET; e.target && e.target !== s
&& e.target !== this.rootTarget.parent; )
e.currentTarget = e.target,
this.notifyTarget(e),
i && this.notifyTarget(e, "mouseenter"),
e.target = e.target.parent;
this.freeEvent(e)
}
this.freeEvent(r)
}
const a = []
, l = this.enableGlobalMoveEvents ?? !0;
this.moveOnAll ? a.push("pointermove") : this.dispatchEvent(n,
"pointermove"),
l && a.push("globalpointermove"),
"touch" === n.pointerType && (this.moveOnAll ? a.splice(1, 0,
"touchmove") : this.dispatchEvent(n, "touchmove"),
l && a.push("globaltouchmove")),
i && (this.moveOnAll ? a.splice(1, 0, "mousemove") :
this.dispatchEvent(n, "mousemove"),
l && a.push("globalmousemove"),
this.cursor = null == (r = n.target) ? void 0 : r.cursor),
a.length > 0 && this.all(n, a),
this._allInteractiveElements.length = 0,
this._hitElements.length = 0,
o.overTargets = n.composedPath(),
this.freeEvent(n)
}
mapPointerOver(e) {
var t;
if (!(e instanceof FederatedPointerEvent))
return;
const r = this.trackingData(e.pointerId)
, n = this.createPointerEvent(e)
, i = "mouse" === n.pointerType || "pen" === n.pointerType;
this.dispatchEvent(n, "pointerover"),
i && this.dispatchEvent(n, "mouseover"),
"mouse" === n.pointerType && (this.cursor = null == (t =
n.target) ? void 0 : t.cursor);
const o = this.clonePointerEvent(n, "pointerenter");
for (o.eventPhase = o.AT_TARGET; o.target && o.target !==
this.rootTarget.parent; )
o.currentTarget = o.target,
this.notifyTarget(o),
i && this.notifyTarget(o, "mouseenter"),
o.target = o.target.parent;
r.overTargets = n.composedPath(),
this.freeEvent(n),
this.freeEvent(o)
}
mapPointerOut(e) {
if (!(e instanceof FederatedPointerEvent))
return;
const t = this.trackingData(e.pointerId);
if (t.overTargets) {
const r = "mouse" === e.pointerType || "pen" === e.pointerType
, n = this.findMountedTarget(t.overTargets)
, i = this.createPointerEvent(e, "pointerout", n);
this.dispatchEvent(i),
r && this.dispatchEvent(i, "mouseout");
const o = this.createPointerEvent(e, "pointerleave", n);
for (o.eventPhase = o.AT_TARGET; o.target && o.target !==
this.rootTarget.parent; )
o.currentTarget = o.target,
this.notifyTarget(o),
r && this.notifyTarget(o, "mouseleave"),
o.target = o.target.parent;
t.overTargets = null,
this.freeEvent(i),
this.freeEvent(o)
}
this.cursor = null
}
mapPointerUp(e) {
if (!(e instanceof FederatedPointerEvent))
return;
const t = performance.now()
, r = this.createPointerEvent(e);
if (this.dispatchEvent(r, "pointerup"),
"touch" === r.pointerType)
this.dispatchEvent(r, "touchend");
else if ("mouse" === r.pointerType || "pen" === r.pointerType) {
const e = 2 === r.button;
this.dispatchEvent(r, e ? "rightup" : "mouseup")
}
const n = this.trackingData(e.pointerId)
, i = this.findMountedTarget(n.pressTargetsByButton[e.button]);
let o = i;
if (i && !r.composedPath().includes(i)) {
let t = i;
for (; t && !r.composedPath().includes(t); ) {
if (r.currentTarget = t,
this.notifyTarget(r, "pointerupoutside"),
"touch" === r.pointerType)
this.notifyTarget(r, "touchendoutside");
else if ("mouse" === r.pointerType || "pen" ===
r.pointerType) {
const e = 2 === r.button;
this.notifyTarget(r, e ? "rightupoutside" :
"mouseupoutside")
}
t = t.parent
}
delete n.pressTargetsByButton[e.button],
o = t
}
if (o) {
const i = this.clonePointerEvent(r, "click");
i.target = o,
i.path = null,
n.clicksByButton[e.button] || (n.clicksByButton[e.button] = {
clickCount: 0,
target: i.target,
timeStamp: t
});
const s = n.clicksByButton[e.button];
if (s.target === i.target && t - s.timeStamp < 200 ? +
+s.clickCount : s.clickCount = 1,
s.target = i.target,
s.timeStamp = t,
i.detail = s.clickCount,
"mouse" === i.pointerType) {
const e = 2 === i.button;
this.dispatchEvent(i, e ? "rightclick" : "click")
} else
"touch" === i.pointerType && this.dispatchEvent(i, "tap");
this.dispatchEvent(i, "pointertap"),
this.freeEvent(i)
}
this.freeEvent(r)
}
mapPointerUpOutside(e) {
if (!(e instanceof FederatedPointerEvent))
return;
const t = this.trackingData(e.pointerId)
, r = this.findMountedTarget(t.pressTargetsByButton[e.button])
, n = this.createPointerEvent(e);
if (r) {
let i = r;
for (; i; )
n.currentTarget = i,
this.notifyTarget(n, "pointerupoutside"),
"touch" === n.pointerType ? this.notifyTarget(n,
"touchendoutside") : ("mouse" === n.pointerType || "pen" === n.pointerType) &&
this.notifyTarget(n, 2 === n.button ? "rightupoutside" : "mouseupoutside"),
i = i.parent;
delete t.pressTargetsByButton[e.button]
}
this.freeEvent(n)
}
mapWheel(e) {
if (!(e instanceof FederatedWheelEvent))
return;
const t = this.createWheelEvent(e);
this.dispatchEvent(t),
this.freeEvent(t)
}
findMountedTarget(e) {
if (!e)
return null;
let t = e[0];
for (let r = 1; r < e.length && e[r].parent === t; r++)
t = e[r];
return t
}
createPointerEvent(e, t, r) {
const n = this.allocateEvent(FederatedPointerEvent);
return this.copyPointerData(e, n),
this.copyMouseData(e, n),
this.copyData(e, n),
n.nativeEvent = e.nativeEvent,
n.originalEvent = e,
n.target = r ?? this.hitTest(n.global.x, n.global.y) ??
this._hitElements[0],
"string" == typeof t && (n.type = t),
n
}
createWheelEvent(e) {
const t = this.allocateEvent(FederatedWheelEvent);
return this.copyWheelData(e, t),
this.copyMouseData(e, t),
this.copyData(e, t),
t.nativeEvent = e.nativeEvent,
t.originalEvent = e,
t.target = this.hitTest(t.global.x, t.global.y),
t
}
clonePointerEvent(e, t) {
const r = this.allocateEvent(FederatedPointerEvent);
return r.nativeEvent = e.nativeEvent,
r.originalEvent = e.originalEvent,
this.copyPointerData(e, r),
this.copyMouseData(e, r),
this.copyData(e, r),
r.target = e.target,
r.path = e.composedPath().slice(),
r.type = t ?? r.type,
r
}
copyWheelData(e, t) {
t.deltaMode = e.deltaMode,
t.deltaX = e.deltaX,
t.deltaY = e.deltaY,
t.deltaZ = e.deltaZ
}
copyPointerData(e, t) {
e instanceof FederatedPointerEvent && t instanceof
FederatedPointerEvent && (t.pointerId = e.pointerId,
t.width = e.width,
t.height = e.height,
t.isPrimary = e.isPrimary,
t.pointerType = e.pointerType,
t.pressure = e.pressure,
t.tangentialPressure = e.tangentialPressure,
t.tiltX = e.tiltX,
t.tiltY = e.tiltY,
t.twist = e.twist)
}
copyMouseData(e, t) {
e instanceof FederatedMouseEvent && t instanceof
FederatedMouseEvent && (t.altKey = e.altKey,
t.button = e.button,
t.buttons = e.buttons,
t.client.copyFrom(e.client),
t.ctrlKey = e.ctrlKey,
t.metaKey = e.metaKey,
t.movement.copyFrom(e.movement),
t.screen.copyFrom(e.screen),
t.shiftKey = e.shiftKey,
t.global.copyFrom(e.global))
}
copyData(e, t) {
t.isTrusted = e.isTrusted,
t.srcElement = e.srcElement,
t.timeStamp = performance.now(),
t.type = e.type,
t.detail = e.detail,
t.view = e.view,
t.which = e.which,
t.layer.copyFrom(e.layer),
t.page.copyFrom(e.page)
}
trackingData(e) {
return this.mappingState.trackingData[e] ||
(this.mappingState.trackingData[e] = {
pressTargetsByButton: {},
clicksByButton: {},
overTarget: null
}),
this.mappingState.trackingData[e]
}
allocateEvent(e) {
this.eventPool.has(e) || this.eventPool.set(e, []);
const t = this.eventPool.get(e).pop() || new e(this);
return t.eventPhase = t.NONE,
t.currentTarget = null,
t.path = null,
t.target = null,
t
}
freeEvent(e) {
if (e.manager !== this)
throw new Error("It is illegal to free an event not managed by
this EventBoundary!");
const t = e.constructor;
this.eventPool.has(t) || this.eventPool.set(t, []),
this.eventPool.get(t).push(e)
}
notifyListeners(e, t) {
const r = e.currentTarget._events[t];
if (r && e.currentTarget.isInteractive())
if ("fn"in r)
r.once && e.currentTarget.removeListener(t, r.fn, void 0, !
0),
r.fn.call(r.context, e);
else
for (let n = 0, i = r.length; n < i && !
e.propagationImmediatelyStopped; n++)
r[n].once && e.currentTarget.removeListener(t, r[n].fn,
void 0, !0),
r[n].fn.call(r[n].context, e)
}
}
const MOUSE_POINTER_ID = 1
, TOUCH_TO_POINTER = {
touchstart: "pointerdown",
touchend: "pointerup",
touchendoutside: "pointerupoutside",
touchmove: "pointermove",
touchcancel: "pointercancel"
}
, _EventSystem = class e {
constructor(t) {
this.supportsTouchEvents = "ontouchstart"in globalThis,
this.supportsPointerEvents = !!globalThis.PointerEvent,
this.domElement = null,
this.resolution = 1,
this.renderer = t,
this.rootBoundary = new EventBoundary(null),
EventsTicker.init(this),
this.autoPreventDefault = !0,
this.eventsAdded = !1,
this.rootPointerEvent = new FederatedPointerEvent(null),
this.rootWheelEvent = new FederatedWheelEvent(null),
this.cursorStyles = {
default: "inherit",
pointer: "pointer"
},
this.features = new Proxy({
...e.defaultEventFeatures
},{
set: (e, t, r) => ("globalMove" === t &&
(this.rootBoundary.enableGlobalMoveEvents = r),
e[t] = r,
!0)
}),
this.onPointerDown = this.onPointerDown.bind(this),
this.onPointerMove = this.onPointerMove.bind(this),
this.onPointerUp = this.onPointerUp.bind(this),
this.onPointerOverOut = this.onPointerOverOut.bind(this),
this.onWheel = this.onWheel.bind(this)
}
static get defaultEventMode() {
return this._defaultEventMode
}
init(t) {
const {view: r, resolution: n} = this.renderer;
this.setTargetElement(r),
this.resolution = n,
e._defaultEventMode = t.eventMode ?? "auto",
Object.assign(this.features, t.eventFeatures ?? {}),
this.rootBoundary.enableGlobalMoveEvents = this.features.globalMove
}
resolutionChange(e) {
this.resolution = e
}
destroy() {
this.setTargetElement(null),
this.renderer = null
}
setCursor(e) {
e = e || "default";
let t = !0;
if (globalThis.OffscreenCanvas && this.domElement instanceof
OffscreenCanvas && (t = !1),
this.currentCursor === e)
return;
this.currentCursor = e;
const r = this.cursorStyles[e];
if (r)
switch (typeof r) {
case "string":
t && (this.domElement.style.cursor = r);
break;
case "function":
r(e);
break;
case "object":
t && Object.assign(this.domElement.style, r)
}
else
t && "string" == typeof e && !
Object.prototype.hasOwnProperty.call(this.cursorStyles, e) &&
(this.domElement.style.cursor = e)
}
get pointer() {
return this.rootPointerEvent
}
onPointerDown(e) {
if (!this.features.click)
return;
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
const t = this.normalizeToPointerData(e);
this.autoPreventDefault && t[0].isNormalized && (e.cancelable || !
("cancelable"in e)) && e.preventDefault();
for (let r = 0, n = t.length; r < n; r++) {
const e = t[r]
, n = this.bootstrapEvent(this.rootPointerEvent, e);
this.rootBoundary.mapEvent(n)
}
this.setCursor(this.rootBoundary.cursor)
}
onPointerMove(e) {
if (!this.features.move)
return;
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered,
EventsTicker.pointerMoved();
const t = this.normalizeToPointerData(e);
for (let r = 0, n = t.length; r < n; r++) {
const e = this.bootstrapEvent(this.rootPointerEvent, t[r]);
this.rootBoundary.mapEvent(e)
}
this.setCursor(this.rootBoundary.cursor)
}
onPointerUp(e) {
if (!this.features.click)
return;
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
let t = e.target;
e.composedPath && e.composedPath().length > 0 && (t =
e.composedPath()[0]);
const r = t !== this.domElement ? "outside" : ""
, n = this.normalizeToPointerData(e);
for (let i = 0, o = n.length; i < o; i++) {
const e = this.bootstrapEvent(this.rootPointerEvent, n[i]);
e.type += r,
this.rootBoundary.mapEvent(e)
}
this.setCursor(this.rootBoundary.cursor)
}
onPointerOverOut(e) {
if (!this.features.click)
return;
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
const t = this.normalizeToPointerData(e);
for (let r = 0, n = t.length; r < n; r++) {
const e = this.bootstrapEvent(this.rootPointerEvent, t[r]);
this.rootBoundary.mapEvent(e)
}
this.setCursor(this.rootBoundary.cursor)
}
onWheel(e) {
if (!this.features.wheel)
return;
const t = this.normalizeWheelEvent(e);
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered,
this.rootBoundary.mapEvent(t)
}
setTargetElement(e) {
this.removeEvents(),
this.domElement = e,
EventsTicker.domElement = e,
this.addEvents()
}
addEvents() {
if (this.eventsAdded || !this.domElement)
return;
EventsTicker.addTickerListener();
const e = this.domElement.style;
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming =
"none",
e.msTouchAction = "none") : this.supportsPointerEvents &&
(e.touchAction = "none")),
this.supportsPointerEvents ?
(globalThis.document.addEventListener("pointermove", this.onPointerMove, !0),
this.domElement.addEventListener("pointerdown", this.onPointerDown,
!0),
this.domElement.addEventListener("pointerleave",
this.onPointerOverOut, !0),
this.domElement.addEventListener("pointerover",
this.onPointerOverOut, !0),
globalThis.addEventListener("pointerup", this.onPointerUp, !0)) :
(globalThis.document.addEventListener("mousemove", this.onPointerMove, !0),
this.domElement.addEventListener("mousedown", this.onPointerDown, !
0),
this.domElement.addEventListener("mouseout", this.onPointerOverOut,
!0),
this.domElement.addEventListener("mouseover",
this.onPointerOverOut, !0),
globalThis.addEventListener("mouseup", this.onPointerUp, !0),
this.supportsTouchEvents &&
(this.domElement.addEventListener("touchstart", this.onPointerDown, !0),
this.domElement.addEventListener("touchend", this.onPointerUp, !0),
this.domElement.addEventListener("touchmove", this.onPointerMove, !
0))),
this.domElement.addEventListener("wheel", this.onWheel, {
passive: !0,
capture: !0
}),
this.eventsAdded = !0
}
removeEvents() {
if (!this.eventsAdded || !this.domElement)
return;
EventsTicker.removeTickerListener();
const e = this.domElement.style;
globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "",
e.msTouchAction = "") : this.supportsPointerEvents &&
(e.touchAction = ""),
this.supportsPointerEvents ?
(globalThis.document.removeEventListener("pointermove", this.onPointerMove, !0),
this.domElement.removeEventListener("pointerdown",
this.onPointerDown, !0),
this.domElement.removeEventListener("pointerleave",
this.onPointerOverOut, !0),
this.domElement.removeEventListener("pointerover",
this.onPointerOverOut, !0),
globalThis.removeEventListener("pointerup", this.onPointerUp, !
0)) : (globalThis.document.removeEventListener("mousemove", this.onPointerMove, !
0),
this.domElement.removeEventListener("mousedown",
this.onPointerDown, !0),
this.domElement.removeEventListener("mouseout",
this.onPointerOverOut, !0),
this.domElement.removeEventListener("mouseover",
this.onPointerOverOut, !0),
globalThis.removeEventListener("mouseup", this.onPointerUp, !0),
this.supportsTouchEvents &&
(this.domElement.removeEventListener("touchstart", this.onPointerDown, !0),
this.domElement.removeEventListener("touchend", this.onPointerUp, !
0),
this.domElement.removeEventListener("touchmove",
this.onPointerMove, !0))),
this.domElement.removeEventListener("wheel", this.onWheel, !0),
this.domElement = null,
this.eventsAdded = !1
}
mapPositionToPoint(e, t, r) {
const n = this.domElement.isConnected ?
this.domElement.getBoundingClientRect() : {
x: 0,
y: 0,
width: this.domElement.width,
height: this.domElement.height,
left: 0,
top: 0
}
, i = 1 / this.resolution;
e.x = (t - n.left) * (this.domElement.width / n.width) * i,
e.y = (r - n.top) * (this.domElement.height / n.height) * i
}
normalizeToPointerData(e) {
const t = [];
if (this.supportsTouchEvents && e instanceof TouchEvent)
for (let r = 0, n = e.changedTouches.length; r < n; r++) {
const n = e.changedTouches[r];
typeof n.button > "u" && (n.button = 0),
typeof n.buttons > "u" && (n.buttons = 1),
typeof n.isPrimary > "u" && (n.isPrimary = 1 ===
e.touches.length && "touchstart" === e.type),
typeof n.width > "u" && (n.width = n.radiusX || 1),
typeof n.height > "u" && (n.height = n.radiusY || 1),
typeof n.tiltX > "u" && (n.tiltX = 0),
typeof n.tiltY > "u" && (n.tiltY = 0),
typeof n.pointerType > "u" && (n.pointerType = "touch"),
typeof n.pointerId > "u" && (n.pointerId = n.identifier ||
0),
typeof n.pressure > "u" && (n.pressure = n.force || .5),
typeof n.twist > "u" && (n.twist = 0),
typeof n.tangentialPressure > "u" && (n.tangentialPressure
= 0),
typeof n.layerX > "u" && (n.layerX = n.offsetX =
n.clientX),
typeof n.layerY > "u" && (n.layerY = n.offsetY =
n.clientY),
n.isNormalized = !0,
n.type = e.type,
t.push(n)
}
else if (globalThis.MouseEvent && (!(e instanceof MouseEvent) ||
this.supportsPointerEvents && e instanceof globalThis.PointerEvent))
t.push(e);
else {
const r = e;
typeof r.isPrimary > "u" && (r.isPrimary = !0),
typeof r.width > "u" && (r.width = 1),
typeof r.height > "u" && (r.height = 1),
typeof r.tiltX > "u" && (r.tiltX = 0),
typeof r.tiltY > "u" && (r.tiltY = 0),
typeof r.pointerType > "u" && (r.pointerType = "mouse"),
typeof r.pointerId > "u" && (r.pointerId = MOUSE_POINTER_ID),
typeof r.pressure > "u" && (r.pressure = .5),
typeof r.twist > "u" && (r.twist = 0),
typeof r.tangentialPressure > "u" && (r.tangentialPressure =
0),
r.isNormalized = !0,
t.push(r)
}
return t
}
normalizeWheelEvent(e) {
const t = this.rootWheelEvent;
return this.transferMouseData(t, e),
t.deltaX = e.deltaX,
t.deltaY = e.deltaY,
t.deltaZ = e.deltaZ,
t.deltaMode = e.deltaMode,
this.mapPositionToPoint(t.screen, e.clientX, e.clientY),
t.global.copyFrom(t.screen),
t.offset.copyFrom(t.screen),
t.nativeEvent = e,
t.type = e.type,
t
}
bootstrapEvent(e, t) {
return e.originalEvent = null,
e.nativeEvent = t,
e.pointerId = t.pointerId,
e.width = t.width,
e.height = t.height,
e.isPrimary = t.isPrimary,
e.pointerType = t.pointerType,
e.pressure = t.pressure,
e.tangentialPressure = t.tangentialPressure,
e.tiltX = t.tiltX,
e.tiltY = t.tiltY,
e.twist = t.twist,
this.transferMouseData(e, t),
this.mapPositionToPoint(e.screen, t.clientX, t.clientY),
e.global.copyFrom(e.screen),
e.offset.copyFrom(e.screen),
e.isTrusted = t.isTrusted,
"pointerleave" === e.type && (e.type = "pointerout"),
e.type.startsWith("mouse") && (e.type = e.type.replace("mouse",
"pointer")),
e.type.startsWith("touch") && (e.type = TOUCH_TO_POINTER[e.type] ||
e.type),
e
}
transferMouseData(e, t) {
e.isTrusted = t.isTrusted,
e.srcElement = t.srcElement,
e.timeStamp = performance.now(),
e.type = t.type,
e.altKey = t.altKey,
e.button = t.button,
e.buttons = t.buttons,
e.client.x = t.clientX,
e.client.y = t.clientY,
e.ctrlKey = t.ctrlKey,
e.metaKey = t.metaKey,
e.movement.x = t.movementX,
e.movement.y = t.movementY,
e.page.x = t.pageX,
e.page.y = t.pageY,
e.relatedTarget = null,
e.shiftKey = t.shiftKey
}
}
;
_EventSystem.extension = {
name: "events",
type: [ExtensionType.RendererSystem,
ExtensionType.CanvasRendererSystem]
},
_EventSystem.defaultEventFeatures = {
move: !0,
globalMove: !0,
click: !0,
wheel: !0
};
let EventSystem = _EventSystem;
function convertEventModeToInteractiveMode(e) {
return "dynamic" === e || "static" === e
}
extensions$1.add(EventSystem);
const FederatedDisplayObject = {
onclick: null,
onmousedown: null,
onmouseenter: null,
onmouseleave: null,
onmousemove: null,
onglobalmousemove: null,
onmouseout: null,
onmouseover: null,
onmouseup: null,
onmouseupoutside: null,
onpointercancel: null,
onpointerdown: null,
onpointerenter: null,
onpointerleave: null,
onpointermove: null,
onglobalpointermove: null,
onpointerout: null,
onpointerover: null,
onpointertap: null,
onpointerup: null,
onpointerupoutside: null,
onrightclick: null,
onrightdown: null,
onrightup: null,
onrightupoutside: null,
ontap: null,
ontouchcancel: null,
ontouchend: null,
ontouchendoutside: null,
ontouchmove: null,
onglobaltouchmove: null,
ontouchstart: null,
onwheel: null,
_internalInteractive: void 0,
get interactive() {
return this._internalInteractive ??
convertEventModeToInteractiveMode(EventSystem.defaultEventMode)
},
set interactive(e) {
deprecation("7.2.0", "Setting interactive is deprecated, use
eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),
this._internalInteractive = e,
this.eventMode = e ? "static" : "auto"
},
_internalEventMode: void 0,
get eventMode() {
return this._internalEventMode ?? EventSystem.defaultEventMode
},
set eventMode(e) {
this._internalInteractive = convertEventModeToInteractiveMode(e),
this._internalEventMode = e
},
isInteractive() {
return "static" === this.eventMode || "dynamic" === this.eventMode
},
interactiveChildren: !0,
hitArea: null,
addEventListener(e, t, r) {
const n = "boolean" == typeof r && r || "object" == typeof r &&
r.capture
, i = "object" == typeof r ? r.signal : void 0
, o = "object" == typeof r && !0 === r.once
, s = "function" == typeof t ? void 0 : t;
e = n ? `${e}capture` : e;
const a = "function" == typeof t ? t : t.handleEvent
, l = this;
i && i.addEventListener("abort", ( () => {
l.off(e, a, s)
}
)),
o ? l.once(e, a, s) : l.on(e, a, s)
},
removeEventListener(e, t, r) {
const n = "function" == typeof t ? void 0 : t;
e = "boolean" == typeof r && r || "object" == typeof r && r.capture
? `${e}capture` : e,
t = "function" == typeof t ? t : t.handleEvent,
this.off(e, t, n)
},
dispatchEvent(e) {
if (!(e instanceof FederatedEvent))
throw new Error("DisplayObject cannot propagate events outside
of the Federated Events API");
return e.defaultPrevented = !1,
e.path = null,
e.target = this,
e.manager.dispatchEvent(e),
!e.defaultPrevented
}
};
DisplayObject.mixin(FederatedDisplayObject);
const accessibleTarget = {
accessible: !1,
accessibleTitle: null,
accessibleHint: null,
tabIndex: 0,
_accessibleActive: !1,
_accessibleDiv: null,
accessibleType: "button",
accessiblePointerEvents: "auto",
accessibleChildren: !0,
renderId: -1
};
DisplayObject.mixin(accessibleTarget);
const KEY_CODE_TAB$1 = 9
, DIV_TOUCH_SIZE = 100
, DIV_TOUCH_POS_X = 0
, DIV_TOUCH_POS_Y = 0
, DIV_TOUCH_ZINDEX = 2
, DIV_HOOK_SIZE = 1
, DIV_HOOK_POS_X = -1e3
, DIV_HOOK_POS_Y = -1e3
, DIV_HOOK_ZINDEX = 2;
class AccessibilityManager {
constructor(e) {
this.debug = !1,
this._isActive = !1,
this._isMobileAccessibility = !1,
this.pool = [],
this.renderId = 0,
this.children = [],
this.androidUpdateCount = 0,
this.androidUpdateFrequency = 500,
this._hookDiv = null,
(isMobile.tablet || isMobile.phone) && this.createTouchHook();
const t = document.createElement("div");
t.style.width = `${DIV_TOUCH_SIZE}px`,
t.style.height = `${DIV_TOUCH_SIZE}px`,
t.style.position = "absolute",
t.style.top = `${DIV_TOUCH_POS_X}px`,
t.style.left = `${DIV_TOUCH_POS_Y}px`,
t.style.zIndex = DIV_TOUCH_ZINDEX.toString(),
this.div = t,
this.renderer = e,
this._onKeyDown = this._onKeyDown.bind(this),
this._onMouseMove = this._onMouseMove.bind(this),
globalThis.addEventListener("keydown", this._onKeyDown, !1)
}
get isActive() {
return this._isActive
}
get isMobileAccessibility() {
return this._isMobileAccessibility
}
createTouchHook() {
const e = document.createElement("button");
e.style.width = `${DIV_HOOK_SIZE}px`,
e.style.height = `${DIV_HOOK_SIZE}px`,
e.style.position = "absolute",
e.style.top = `${DIV_HOOK_POS_X}px`,
e.style.left = `${DIV_HOOK_POS_Y}px`,
e.style.zIndex = DIV_HOOK_ZINDEX.toString(),
e.style.backgroundColor = "#FF0000",
e.title = "select to enable accessibility for this content",
e.addEventListener("focus", ( () => {
this._isMobileAccessibility = !0,
this.activate(),
this.destroyTouchHook()
}
)),
document.body.appendChild(e),
this._hookDiv = e
}
destroyTouchHook() {
this._hookDiv && (document.body.removeChild(this._hookDiv),
this._hookDiv = null)
}
activate() {
var e;
this._isActive || (this._isActive = !0,
globalThis.document.addEventListener("mousemove",
this._onMouseMove, !0),
globalThis.removeEventListener("keydown", this._onKeyDown, !1),
this.renderer.on("postrender", this.update, this),
null == (e = this.renderer.view.parentNode) ||
e.appendChild(this.div))
}
deactivate() {
var e;
!this._isActive || this._isMobileAccessibility || (this._isActive =
!1,
globalThis.document.removeEventListener("mousemove",
this._onMouseMove, !0),
globalThis.addEventListener("keydown", this._onKeyDown, !1),
this.renderer.off("postrender", this.update),
null == (e = this.div.parentNode) || e.removeChild(this.div))
}
updateAccessibleObjects(e) {
if (!e.visible || !e.accessibleChildren)
return;
e.accessible && e.isInteractive() && (e._accessibleActive ||
this.addChild(e),
e.renderId = this.renderId);
const t = e.children;
if (t)
for (let r = 0; r < t.length; r++)
this.updateAccessibleObjects(t[r])
}
update() {
const e = performance.now();
if (isMobile.android.device && e < this.androidUpdateCount ||
(this.androidUpdateCount = e + this.androidUpdateFrequency,
!this.renderer.renderingToScreen))
return;
this.renderer.lastObjectRendered &&
this.updateAccessibleObjects(this.renderer.lastObjectRendered);
const {x: t, y: r, width: n, height: i} =
this.renderer.view.getBoundingClientRect()
, {width: o, height: s, resolution: a} = this.renderer
, l = n / o * a
, c = i / s * a;
let u = this.div;
u.style.left = `${t}px`,
u.style.top = `${r}px`,
u.style.width = `${o}px`,
u.style.height = `${s}px`;
for (let d = 0; d < this.children.length; d++) {
const e = this.children[d];
if (e.renderId !== this.renderId)
e._accessibleActive = !1,
removeItems(this.children, d, 1),
this.div.removeChild(e._accessibleDiv),
this.pool.push(e._accessibleDiv),
e._accessibleDiv = null,
d--;
else {
u = e._accessibleDiv;
let t = e.hitArea;
const r = e.worldTransform;
e.hitArea ? (u.style.left = (r.tx + t.x * r.a) * l + "px",
u.style.top = (r.ty + t.y * r.d) * c + "px",
u.style.width = t.width * r.a * l + "px",
u.style.height = t.height * r.d * c + "px") : (t =
e.getBounds(),
this.capHitArea(t),
u.style.left = t.x * l + "px",
u.style.top = t.y * c + "px",
u.style.width = t.width * l + "px",
u.style.height = t.height * c + "px",
u.title !== e.accessibleTitle && null !== e.accessibleTitle
&& (u.title = e.accessibleTitle),
u.getAttribute("aria-label") !== e.accessibleHint && null !
== e.accessibleHint && u.setAttribute("aria-label", e.accessibleHint)),
(e.accessibleTitle !== u.title || e.tabIndex !==
u.tabIndex) && (u.title = e.accessibleTitle,
u.tabIndex = e.tabIndex,
this.debug && this.updateDebugHTML(u))
}
}
this.renderId++
}
updateDebugHTML(e) {
e.innerHTML = `type: ${e.type}</br> title : ${e.title}</br>
tabIndex: ${e.tabIndex}`
}
capHitArea(e) {
e.x < 0 && (e.width += e.x,
e.x = 0),
e.y < 0 && (e.height += e.y,
e.y = 0);
const {width: t, height: r} = this.renderer;
e.x + e.width > t && (e.width = t - e.x),
e.y + e.height > r && (e.height = r - e.y)
}
addChild(e) {
let t = this.pool.pop();
t || (t = document.createElement("button"),
t.style.width = `${DIV_TOUCH_SIZE}px`,
t.style.height = `${DIV_TOUCH_SIZE}px`,
t.style.backgroundColor = this.debug ? "rgba(255,255,255,0.5)" :
"transparent",
t.style.position = "absolute",
t.style.zIndex = DIV_TOUCH_ZINDEX.toString(),
t.style.borderStyle = "none",
navigator.userAgent.toLowerCase().includes("chrome") ?
t.setAttribute("aria-live", "off") : t.setAttribute("aria-live", "polite"),
navigator.userAgent.match(/rv:.*Gecko\//) ? t.setAttribute("aria-
relevant", "additions") : t.setAttribute("aria-relevant", "text"),
t.addEventListener("click", this._onClick.bind(this)),
t.addEventListener("focus", this._onFocus.bind(this)),
t.addEventListener("focusout", this._onFocusOut.bind(this))),
t.style.pointerEvents = e.accessiblePointerEvents,
t.type = e.accessibleType,
e.accessibleTitle && null !== e.accessibleTitle ? t.title =
e.accessibleTitle : (!e.accessibleHint || null === e.accessibleHint) && (t.title =
`displayObject ${e.tabIndex}`),
e.accessibleHint && null !== e.accessibleHint &&
t.setAttribute("aria-label", e.accessibleHint),
this.debug && this.updateDebugHTML(t),
e._accessibleActive = !0,
e._accessibleDiv = t,
t.displayObject = e,
this.children.push(e),
this.div.appendChild(e._accessibleDiv),
e._accessibleDiv.tabIndex = e.tabIndex
}
_dispatchEvent(e, t) {
const {displayObject: r} = e.target
, n = this.renderer.events.rootBoundary
, i = Object.assign(new FederatedEvent(n), {
target: r
});
n.rootTarget = this.renderer.lastObjectRendered,
t.forEach((e => n.dispatchEvent(i, e)))
}
_onClick(e) {
this._dispatchEvent(e, ["click", "pointertap", "tap"])
}
_onFocus(e) {
e.target.getAttribute("aria-live") || e.target.setAttribute("aria-
live", "assertive"),
this._dispatchEvent(e, ["mouseover"])
}
_onFocusOut(e) {
e.target.getAttribute("aria-live") || e.target.setAttribute("aria-
live", "polite"),
this._dispatchEvent(e, ["mouseout"])
}
_onKeyDown(e) {
e.keyCode === KEY_CODE_TAB$1 && this.activate()
}
_onMouseMove(e) {
0 === e.movementX && 0 === e.movementY || this.deactivate()
}
destroy() {
this.destroyTouchHook(),
this.div = null,
globalThis.document.removeEventListener("mousemove",
this._onMouseMove, !0),
globalThis.removeEventListener("keydown", this._onKeyDown),
this.pool = null,
this.children = null,
this.renderer = null
}
}
AccessibilityManager.extension = {
name: "accessibility",
type: [ExtensionType.RendererPlugin,
ExtensionType.CanvasRendererPlugin]
},
extensions$1.add(AccessibilityManager);
const _Application = class e {
constructor(t) {
this.stage = new Container,
t = Object.assign({
forceCanvas: !1
}, t),
this.renderer = autoDetectRenderer(t),
e._plugins.forEach((e => {
e.init.call(this, t)
}
))
}
render() {
this.renderer.render(this.stage)
}
get view() {
var e;
return null == (e = this.renderer) ? void 0 : e.view
}
get screen() {
var e;
return null == (e = this.renderer) ? void 0 : e.screen
}
destroy(t, r) {
const n = e._plugins.slice(0);
n.reverse(),
n.forEach((e => {
e.destroy.call(this)
}
)),
this.stage.destroy(r),
this.stage = null,
this.renderer.destroy(t),
this.renderer = null
}
}
;
_Application._plugins = [];
let Application = _Application;
extensions$1.handleByList(ExtensionType.Application, Application._plugins);
class ResizePlugin {
static init(e) {
Object.defineProperty(this, "resizeTo", {
set(e) {
globalThis.removeEventListener("resize", this.queueResize),
this._resizeTo = e,
e && (globalThis.addEventListener("resize",
this.queueResize),
this.resize())
},
get() {
return this._resizeTo
}
}),
this.queueResize = () => {
this._resizeTo && (this.cancelResize(),
this._resizeId = requestAnimationFrame(( () => this.resize())))
}
,
this.cancelResize = () => {
this._resizeId && (cancelAnimationFrame(this._resizeId),
this._resizeId = null)
}
,
this.resize = () => {
if (!this._resizeTo)
return;
let e, t;
if (this.cancelResize(),
this._resizeTo === globalThis.window)
e = globalThis.innerWidth,
t = globalThis.innerHeight;
else {
const {clientWidth: r, clientHeight: n} = this._resizeTo;
e = r,
t = n
}
this.renderer.resize(e, t),
this.render()
}
,
this._resizeId = null,
this._resizeTo = null,
this.resizeTo = e.resizeTo || null
}
static destroy() {
globalThis.removeEventListener("resize", this.queueResize),
this.cancelResize(),
this.cancelResize = null,
this.queueResize = null,
this.resizeTo = null,
this.resize = null
}
}
ResizePlugin.extension = ExtensionType.Application,
extensions$1.add(ResizePlugin);
const assetKeyMap = {
loader: ExtensionType.LoadParser,
resolver: ExtensionType.ResolveParser,
cache: ExtensionType.CacheParser,
detection: ExtensionType.DetectionParser
};
extensions$1.handle(ExtensionType.Asset, (e => {
const t = e.ref;
Object.entries(assetKeyMap).filter(( ([e]) => !!
t[e])).forEach(( ([e,r]) => extensions$1.add(Object.assign(t[e], {
extension: t[e].extension ?? r
}))))
}
), (e => {
const t = e.ref;
Object.keys(assetKeyMap).filter((e => !!t[e])).forEach((e =>
extensions$1.remove(t[e])))
}
));
class BackgroundLoader {
constructor(e, t=!1) {
this._loader = e,
this._assetList = [],
this._isLoading = !1,
this._maxConcurrent = 1,
this.verbose = t
}
add(e) {
e.forEach((e => {
this._assetList.push(e)
}
)),
this.verbose,
this._isActive && !this._isLoading && this._next()
}
async _next() {
if (this._assetList.length && this._isActive) {
this._isLoading = !0;
const e = []
, t = Math.min(this._assetList.length, this._maxConcurrent);
for (let r = 0; r < t; r++)
e.push(this._assetList.pop());
await this._loader.load(e),
this._isLoading = !1,
this._next()
}
}
get active() {
return this._isActive
}
set active(e) {
this._isActive !== e && (this._isActive = e,
e && !this._isLoading && this._next())
}
}
function checkDataUrl(e, t) {
if (Array.isArray(t)) {
for (const r of t)
if (e.startsWith(`data:${r}`))
return !0;
return !1
}
return e.startsWith(`data:${t}`)
}
function checkExtension(e, t) {
const r = e.split("?")[0]
, n = path$1.extname(r).toLowerCase();
return Array.isArray(t) ? t.includes(n) : n === t
}
const convertToList = (e, t, r=!1) => (Array.isArray(e) || (e = [e]),
t ? e.map((e => "string" == typeof e || r ? t(e) : e)) : e)
, copySearchParams = (e, t) => {
const r = t.split("?")[1];
return r && (e += `?${r}`),
e
}
;
function processX(e, t, r, n, i) {
const o = t[r];
for (let s = 0; s < o.length; s++) {
const a = o[s];
r < t.length - 1 ? processX(e.replace(n[r], a), t, r + 1, n, i) :
i.push(e.replace(n[r], a))
}
}
function createStringVariations(e) {
const t = e.match(/\{(.*?)\}/g)
, r = [];
if (t) {
const n = [];
t.forEach((e => {
const t = e.substring(1, e.length - 1).split(",");
n.push(t)
}
)),
processX(e, n, 0, t, r)
} else
r.push(e);
return r
}
const isSingleItem = e => !Array.isArray(e);
class CacheClass {
constructor() {
this._parsers = [],
this._cache = new Map,
this._cacheMap = new Map
}
reset() {
this._cacheMap.clear(),
this._cache.clear()
}
has(e) {
return this._cache.has(e)
}
get(e) {
const t = this._cache.get(e);
return t
}
set(e, t) {
const r = convertToList(e);
let n;
for (let s = 0; s < this.parsers.length; s++) {
const e = this.parsers[s];
if (e.test(t)) {
n = e.getCacheableAssets(r, t);
break
}
}
n || (n = {},
r.forEach((e => {
n[e] = t
}
)));
const i = Object.keys(n)
, o = {
cacheKeys: i,
keys: r
};
if (r.forEach((e => {
this._cacheMap.set(e, o)
}
)),
i.forEach((e => {
this._cache.has(e) && this._cache.get(e),
this._cache.set(e, n[e])
}
)),
t instanceof Texture) {
const e = t;
r.forEach((t => {
e.baseTexture !== Texture.EMPTY.baseTexture &&
BaseTexture.addToCache(e.baseTexture, t),
Texture.addToCache(e, t)
}
))
}
}
remove(e) {
if (!this._cacheMap.has(e))
return;
const t = this._cacheMap.get(e);
t.cacheKeys.forEach((e => {
this._cache.delete(e)
}
)),
t.keys.forEach((e => {
this._cacheMap.delete(e)
}
))
}
get parsers() {
return this._parsers
}
}
const Cache = new CacheClass;
class Loader {
constructor() {
this._parsers = [],
this._parsersValidated = !1,
this.parsers = new Proxy(this._parsers,{
set: (e, t, r) => (this._parsersValidated = !1,
e[t] = r,
!0)
}),
this.promiseCache = {}
}
reset() {
this._parsersValidated = !1,
this.promiseCache = {}
}
_getLoadPromiseAndParser(e, t) {
const r = {
promise: null,
parser: null
};
return r.promise = (async () => {
var n, i;
let o = null
, s = null;
if (t.loadParser && (s = this._parserHash[t.loadParser]),
!s) {
for (let r = 0; r < this.parsers.length; r++) {
const i = this.parsers[r];
if (i.load && (null == (n = i.test) ? void 0 :
n.call(i, e, t, this))) {
s = i;
break
}
}
if (!s)
return null
}
o = await s.load(e, t, this),
r.parser = s;
for (let e = 0; e < this.parsers.length; e++) {
const n = this.parsers[e];
n.parse && n.parse && await (null == (i = n.testParse) ?
void 0 : i.call(n, o, t, this)) && (o = await n.parse(o, t, this) || o,
r.parser = n)
}
return o
}
)(),
r
}
async load(e, t) {
this._parsersValidated || this._validateParsers();
let r = 0;
const n = {}
, i = isSingleItem(e)
, o = convertToList(e, (e => ({
alias: [e],
src: e
})))
, s = o.length
, a = o.map((async e => {
const i = path$1.toAbsolute(e.src);
if (!n[e.src])
try {
this.promiseCache[i] || (this.promiseCache[i] =
this._getLoadPromiseAndParser(i, e)),
n[e.src] = await this.promiseCache[i].promise,
t && t(++r / s)
} catch (e2) {
throw delete this.promiseCache[i],
delete n[e.src],
new Error(`[Loader.load] Failed to load ${i}.\n${e2}`)
}
}
));
return await Promise.all(a),
i ? n[o[0].src] : n
}
async unload(e) {
const t = convertToList(e, (e => ({
alias: [e],
src: e
}))).map((async e => {
var t, r;
const n = path$1.toAbsolute(e.src)
, i = this.promiseCache[n];
if (i) {
const o = await i.promise;
delete this.promiseCache[n],
null == (r = null == (t = i.parser) ? void 0 : t.unload) ||
r.call(t, o, e, this)
}
}
));
await Promise.all(t)
}
_validateParsers() {
this._parsersValidated = !0,
this._parserHash = this._parsers.filter((e => e.name)).reduce(( (e,
t) => (e[t.name],
{
...e,
[t.name]: t
})), {})
}
}
var LoaderParserPriority = (e => (e[e.Low = 0] = "Low",
e[e.Normal = 1] = "Normal",
e[e.High = 2] = "High",
e))(LoaderParserPriority || {});
const validJSONExtension = ".json"
, validJSONMIME = "application/json"
, loadJson = {
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.Low
},
name: "loadJson",
test: e => checkDataUrl(e, validJSONMIME) || checkExtension(e,
validJSONExtension),
load: async e => await (await settings.ADAPTER.fetch(e)).json()
};
extensions$1.add(loadJson);
const validTXTExtension = ".txt"
, validTXTMIME = "text/plain"
, loadTxt = {
name: "loadTxt",
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.Low
},
test: e => checkDataUrl(e, validTXTMIME) || checkExtension(e,
validTXTExtension),
load: async e => await (await settings.ADAPTER.fetch(e)).text()
};
extensions$1.add(loadTxt);
const validWeights = ["normal", "bold", "100", "200", "300", "400", "500",
"600", "700", "800", "900"]
, validFontExtensions = [".ttf", ".otf", ".woff", ".woff2"]
, validFontMIMEs = ["font/ttf", "font/otf", "font/woff", "font/woff2"]
, CSS_IDENT_TOKEN_REGEX = /^(--|-?[A-Z_])[0-9A-Z_-]*$/i;
function getFontFamilyName(e) {
const t = path$1.extname(e)
, r = path$1.basename(e, t).replace(/(-|_)/g, "
").toLowerCase().split(" ").map((e => e.charAt(0).toUpperCase() + e.slice(1)));
let n = r.length > 0;
for (const o of r)
if (!o.match(CSS_IDENT_TOKEN_REGEX)) {
n = !1;
break
}
let i = r.join(" ");
return n || (i = `"${i.replace(/[\\"]/g, "\\$&")}"`),
i
}
const validURICharactersRegex = /^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\
+,;=\-._~]*$/;
function encodeURIWhenNeeded(e) {
return validURICharactersRegex.test(e) ? e : encodeURI(e)
}
const loadWebFont = {
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.Low
},
name: "loadWebFont",
test: e => checkDataUrl(e, validFontMIMEs) || checkExtension(e,
validFontExtensions),
async load(e, t) {
var r, n, i;
const o = settings.ADAPTER.getFontFaceSet();
if (o) {
const s = []
, a = (null == (r = t.data) ? void 0 : r.family) ??
getFontFamilyName(e)
, l = (null == (i = null == (n = t.data) ? void 0 :
n.weights) ? void 0 : i.filter((e => validWeights.includes(e)))) ?? ["normal"]
, c = t.data ?? {};
for (let t = 0; t < l.length; t++) {
const r = l[t]
, n = new FontFace(a,`url(${encodeURIWhenNeeded(e)})`,{
...c,
weight: r
});
await n.load(),
o.add(n),
s.push(n)
}
return 1 === s.length ? s[0] : s
}
return null
},
unload(e) {
(Array.isArray(e) ? e : [e]).forEach((e =>
settings.ADAPTER.getFontFaceSet().delete(e)))
}
};
extensions$1.add(loadWebFont);
const WORKER_CODE$1 = '(function() {\n "use strict";\n const WHITE_PNG =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8
/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";\n async function checkImageBitmap() {\n try
{\n if (typeof createImageBitmap != "function")\n return !1;\n
const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await
createImageBitmap(imageBlob);\n return imageBitmap.width === 1 &&
imageBitmap.height === 1;\n } catch {\n return !1;\n }\n }\n
checkImageBitmap().then((result) => {\n self.postMessage(result);\n });\n})();\
n';
let WORKER_URL$1 = null
, WorkerInstance$1 = class extends Worker {
constructor() {
WORKER_URL$1 || (WORKER_URL$1 = URL.createObjectURL(new
Blob([WORKER_CODE$1],{
type: "application/javascript"
}))),
super(WORKER_URL$1)
}
}
;
WorkerInstance$1.revokeObjectURL = function() {
WORKER_URL$1 && (URL.revokeObjectURL(WORKER_URL$1),
WORKER_URL$1 = null)
}
;
const WORKER_CODE = '(function() {\n "use strict";\n async function
loadImageBitmap(url) {\n const response = await fetch(url);\n if (!
response.ok)\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to
fetch ${url}: ${response.status} ${response.statusText}`);\n const imageBlob =
await response.blob();\n return await createImageBitmap(imageBlob);\n }\n
self.onmessage = async (event) => {\n try {\n const imageBitmap = await
loadImageBitmap(event.data.data[0]);\n self.postMessage({\n data:
imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n },
[imageBitmap]);\n } catch (e) {\n self.postMessage({\n error: e,\n
uuid: event.data.uuid,\n id: event.data.id\n });\n }\n };\n})();\
n';
let WORKER_URL = null;
class WorkerInstance extends Worker {
constructor() {
WORKER_URL || (WORKER_URL = URL.createObjectURL(new
Blob([WORKER_CODE],{
type: "application/javascript"
}))),
super(WORKER_URL)
}
}
WorkerInstance.revokeObjectURL = function() {
WORKER_URL && (URL.revokeObjectURL(WORKER_URL),
WORKER_URL = null)
}
;
let UUID = 0, MAX_WORKERS;
class WorkerManagerClass {
constructor() {
this._initialized = !1,
this._createdWorkers = 0,
this.workerPool = [],
this.queue = [],
this.resolveHash = {}
}
isImageBitmapSupported() {
return void 0 !== this._isImageBitmapSupported ||
(this._isImageBitmapSupported = new Promise((e => {
const t = new WorkerInstance$1;
t.addEventListener("message", (r => {
t.terminate(),
WorkerInstance$1.revokeObjectURL(),
e(r.data)
}
))
}
))),
this._isImageBitmapSupported
}
loadImageBitmap(e) {
return this._run("loadImageBitmap", [e])
}
async _initWorkers() {
this._initialized || (this._initialized = !0)
}
getWorker() {
void 0 === MAX_WORKERS && (MAX_WORKERS =
navigator.hardwareConcurrency || 4);
let e = this.workerPool.pop();
return !e && this._createdWorkers < MAX_WORKERS &&
(this._createdWorkers++,
e = new WorkerInstance,
e.addEventListener("message", (e => {
this.complete(e.data),
this.returnWorker(e.target),
this.next()
}
))),
e
}
returnWorker(e) {
this.workerPool.push(e)
}
complete(e) {
void 0 !== e.error ? this.resolveHash[e.uuid].reject(e.error) :
this.resolveHash[e.uuid].resolve(e.data),
this.resolveHash[e.uuid] = null
}
async _run(e, t) {
await this._initWorkers();
const r = new Promise(( (r, n) => {
this.queue.push({
id: e,
arguments: t,
resolve: r,
reject: n
})
}
));
return this.next(),
r
}
next() {
if (!this.queue.length)
return;
const e = this.getWorker();
if (!e)
return;
const t = this.queue.pop()
, r = t.id;
this.resolveHash[UUID] = {
resolve: t.resolve,
reject: t.reject
},
e.postMessage({
data: t.arguments,
uuid: UUID++,
id: r
})
}
}
const WorkerManager = new WorkerManagerClass;
function createTexture(e, t, r) {
e.resource.internal = !0;
const n = new Texture(e)
, i = () => {
delete t.promiseCache[r],
Cache.has(r) && Cache.remove(r)
}
;
return n.baseTexture.once("destroyed", ( () => {
r in t.promiseCache && i()
}
)),
n.once("destroyed", ( () => {
e.destroyed || i()
}
)),
n
}
const validImageExtensions = [".jpeg", ".jpg", ".png", ".webp", ".avif"]
, validImageMIMEs = ["image/jpeg", "image/png", "image/webp",
"image/avif"];
async function loadImageBitmap(e) {
const t = await settings.ADAPTER.fetch(e);
if (!t.ok)
throw new Error(`[loadImageBitmap] Failed to fetch ${e}: $
{t.status} ${t.statusText}`);
const r = await t.blob();
return await createImageBitmap(r)
}
const loadTextures = {
name: "loadTextures",
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.High
},
config: {
preferWorkers: !0,
preferCreateImageBitmap: !0,
crossOrigin: "anonymous"
},
test: e => checkDataUrl(e, validImageMIMEs) || checkExtension(e,
validImageExtensions),
async load(e, t, r) {
var n;
const i = globalThis.createImageBitmap &&
this.config.preferCreateImageBitmap;
let o;
o = i ? this.config.preferWorkers && await
WorkerManager.isImageBitmapSupported() ? await WorkerManager.loadImageBitmap(e) :
await loadImageBitmap(e) : await new Promise(( (t, r) => {
const n = new Image;
n.crossOrigin = this.config.crossOrigin,
n.src = e,
n.complete ? t(n) : (n.onload = () => t(n),
n.onerror = e => r(e))
}
));
const s = {
...t.data
};
s.resolution ?? (s.resolution = getResolutionOfUrl(e)),
i && void 0 === (null == (n = s.resourceOptions) ? void 0 :
n.ownsImageBitmap) && (s.resourceOptions = {
...s.resourceOptions
},
s.resourceOptions.ownsImageBitmap = !0);
const a = new BaseTexture(o,s);
return a.resource.src = e,
createTexture(a, r, e)
},
unload(e) {
e.destroy(!0)
}
};
extensions$1.add(loadTextures);
const validSVGExtension = ".svg"
, validSVGMIME = "image/svg+xml"
, loadSVG = {
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.High
},
name: "loadSVG",
test: e => checkDataUrl(e, validSVGMIME) || checkExtension(e,
validSVGExtension),
testParse: async e => SVGResource.test(e),
async parse(e, t, r) {
var n;
const i = new SVGResource(e,null == (n = null == t ? void 0 :
t.data) ? void 0 : n.resourceOptions);
await i.load();
const o = new BaseTexture(i,{
resolution: getResolutionOfUrl(e),
...null == t ? void 0 : t.data
});
return o.resource.src = t.src,
createTexture(o, r, t.src)
},
load: async (e, t) => (await settings.ADAPTER.fetch(e)).text(),
unload: loadTextures.unload
};
extensions$1.add(loadSVG);
const validVideoExtensions = [".mp4", ".m4v", ".webm", ".ogv"]
, validVideoMIMEs = ["video/mp4", "video/webm", "video/ogg"]
, loadVideo = {
name: "loadVideo",
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.High
},
config: {
defaultAutoPlay: !0,
defaultUpdateFPS: 0,
defaultLoop: !1,
defaultMuted: !1,
defaultPlaysinline: !0
},
test: e => checkDataUrl(e, validVideoMIMEs) || checkExtension(e,
validVideoExtensions),
async load(e, t, r) {
var n;
let i;
const o = await (await settings.ADAPTER.fetch(e)).blob()
, s = URL.createObjectURL(o);
try {
const o = {
autoPlay: this.config.defaultAutoPlay,
updateFPS: this.config.defaultUpdateFPS,
loop: this.config.defaultLoop,
muted: this.config.defaultMuted,
playsinline: this.config.defaultPlaysinline,
...null == (n = null == t ? void 0 : t.data) ? void 0 :
n.resourceOptions,
autoLoad: !0
}
, a = new VideoResource(s,o);
await a.load();
const l = new BaseTexture(a,{
alphaMode: await detectVideoAlphaMode(),
resolution: getResolutionOfUrl(e),
...null == t ? void 0 : t.data
});
l.resource.src = e,
i = createTexture(l, r, e),
i.baseTexture.once("destroyed", ( () => {
URL.revokeObjectURL(s)
}
))
} catch (e2) {
throw URL.revokeObjectURL(s),
e2
}
return i
},
unload(e) {
e.destroy(!0)
}
};
extensions$1.add(loadVideo);
class Resolver {
constructor() {
this._defaultBundleIdentifierOptions = {
connector: "-",
createBundleAssetId: (e, t) => `${e}${this._bundleIdConnector}$
{t}`,
extractAssetIdFromBundle: (e, t) => t.replace(`${e}$
{this._bundleIdConnector}`, "")
},
this._bundleIdConnector =
this._defaultBundleIdentifierOptions.connector,
this._createBundleAssetId =
this._defaultBundleIdentifierOptions.createBundleAssetId,
this._extractAssetIdFromBundle =
this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,
this._assetMap = {},
this._preferredOrder = [],
this._parsers = [],
this._resolverHash = {},
this._bundles = {}
}
setBundleIdentifier(e) {
if (this._bundleIdConnector = e.connector ??
this._bundleIdConnector,
this._createBundleAssetId = e.createBundleAssetId ??
this._createBundleAssetId,
this._extractAssetIdFromBundle = e.extractAssetIdFromBundle ??
this._extractAssetIdFromBundle,
"bar" !== this._extractAssetIdFromBundle("foo",
this._createBundleAssetId("foo", "bar")))
throw new Error("[Resolver] GenerateBundleAssetId are not
working correctly")
}
prefer(...e) {
e.forEach((e => {
this._preferredOrder.push(e),
e.priority || (e.priority = Object.keys(e.params))
}
)),
this._resolverHash = {}
}
set basePath(e) {
this._basePath = e
}
get basePath() {
return this._basePath
}
set rootPath(e) {
this._rootPath = e
}
get rootPath() {
return this._rootPath
}
get parsers() {
return this._parsers
}
reset() {
this.setBundleIdentifier(this._defaultBundleIdentifierOptions),
this._assetMap = {},
this._preferredOrder = [],
this._resolverHash = {},
this._rootPath = null,
this._basePath = null,
this._manifest = null,
this._bundles = {},
this._defaultSearchParams = null
}
setDefaultSearchParams(e) {
if ("string" == typeof e)
this._defaultSearchParams = e;
else {
const t = e;
this._defaultSearchParams = Object.keys(t).map((e => `$
{encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&")
}
}
getAlias(e) {
const {alias: t, name: r, src: n, srcs: i} = e;
return convertToList(t || r || n || i, (e => "string" == typeof e ?
e : Array.isArray(e) ? e.map((e => (null == e ? void 0 : e.src) ?? (null == e ?
void 0 : e.srcs) ?? e)) : (null == e ? void 0 : e.src) || (null == e ? void 0 :
e.srcs) ? e.src ?? e.srcs : e), !0)
}
addManifest(e) {
this._manifest,
this._manifest = e,
e.bundles.forEach((e => {
this.addBundle(e.name, e.assets)
}
))
}
addBundle(e, t) {
const r = [];
Array.isArray(t) ? t.forEach((t => {
const n = t.src ?? t.srcs
, i = t.alias ?? t.name;
let o;
if ("string" == typeof i) {
const t = this._createBundleAssetId(e, i);
r.push(t),
o = [i, t]
} else {
const t = i.map((t => this._createBundleAssetId(e, t)));
r.push(...t),
o = [...i, ...t]
}
this.add({
...t,
alias: o,
src: n
})
}
)) : Object.keys(t).forEach((n => {
const i = [n, this._createBundleAssetId(e, n)];
if ("string" == typeof t[n])
this.add({
alias: i,
src: t[n]
});
else if (Array.isArray(t[n]))
this.add({
alias: i,
src: t[n]
});
else {
const e = t[n]
, r = e.src ?? e.srcs;
this.add({
...e,
alias: i,
src: Array.isArray(r) ? r : [r]
})
}
r.push(...i)
}
)),
this._bundles[e] = r
}
add(e, t, r, n, i) {
const o = [];
let s;
"string" == typeof e || Array.isArray(e) && "string" == typeof e[0]
? (deprecation("7.2.0", "Assets.add now uses an object instead of individual
parameters.\nPlease use Assets.add({ alias, src, data, format, loadParser })
instead."),
o.push({
alias: e,
src: t,
data: r,
format: n,
loadParser: i
})) : Array.isArray(e) ? o.push(...e) : o.push(e),
s = e => {
this.hasKey(e)
}
,
convertToList(o).forEach((e => {
const {src: t, srcs: r} = e;
let {data: n, format: i, loadParser: o} = e;
const a = convertToList(t || r).map((e => "string" == typeof
e ? createStringVariations(e) : Array.isArray(e) ? e : [e]))
, l = this.getAlias(e);
Array.isArray(l) ? l.forEach(s) : s(l);
const c = [];
a.forEach((e => {
e.forEach((e => {
let t = {};
if ("object" != typeof e) {
t.src = e;
for (let r = 0; r < this._parsers.length; r++) {
const n = this._parsers[r];
if (n.test(e)) {
t = n.parse(e);
break
}
}
} else
n = e.data ?? n,
i = e.format ?? i,
o = e.loadParser ?? o,
t = {
...t,
...e
};
if (!l)
throw new Error(`[Resolver] alias is undefined for
this asset: ${t.src}`);
t = this.buildResolvedAsset(t, {
aliases: l,
data: n,
format: i,
loadParser: o
}),
c.push(t)
}
))
}
)),
l.forEach((e => {
this._assetMap[e] = c
}
))
}
))
}
resolveBundle(e) {
const t = isSingleItem(e);
e = convertToList(e);
const r = {};
return e.forEach((e => {
const t = this._bundles[e];
if (t) {
const n = this.resolve(t)
, i = {};
for (const t in n) {
const r = n[t];
i[this._extractAssetIdFromBundle(e, t)] = r
}
r[e] = i
}
}
)),
t ? r[e[0]] : r
}
resolveUrl(e) {
const t = this.resolve(e);
if ("string" != typeof e) {
const e = {};
for (const r in t)
e[r] = t[r].src;
return e
}
return t.src
}
resolve(e) {
const t = isSingleItem(e);
e = convertToList(e);
const r = {};
return e.forEach((e => {
if (!this._resolverHash[e])
if (this._assetMap[e]) {
let t = this._assetMap[e];
const r = t[0]
, n = this._getPreferredOrder(t);
null == n || n.priority.forEach((e => {
n.params[e].forEach((r => {
const n = t.filter((t => !!t[e] && t[e] ===
r));
n.length && (t = n)
}
))
}
)),
this._resolverHash[e] = t[0] ?? r
} else
this._resolverHash[e] = this.buildResolvedAsset({
alias: [e],
src: e
}, {});
r[e] = this._resolverHash[e]
}
)),
t ? r[e[0]] : r
}
hasKey(e) {
return !!this._assetMap[e]
}
hasBundle(e) {
return !!this._bundles[e]
}
_getPreferredOrder(e) {
for (let t = 0; t < e.length; t++) {
const t = e[0]
, r = this._preferredOrder.find((e =>
e.params.format.includes(t.format)));
if (r)
return r
}
return this._preferredOrder[0]
}
_appendDefaultSearchParams(e) {
if (!this._defaultSearchParams)
return e;
return `${e}${/\?/.test(e) ? "&" : "?"}$
{this._defaultSearchParams}`
}
buildResolvedAsset(e, t) {
const {aliases: r, data: n, loadParser: i, format: o} = t;
return (this._basePath || this._rootPath) && (e.src =
path$1.toAbsolute(e.src, this._basePath, this._rootPath)),
e.alias = r ?? e.alias ?? [e.src],
e.src = this._appendDefaultSearchParams(e.src),
e.data = {
...n || {},
...e.data
},
e.loadParser = i ?? e.loadParser,
e.format = o ?? path$1.extname(e.src).slice(1),
e.srcs = e.src,
e.name = e.alias,
e
}
}
class AssetsClass {
constructor() {
this._detections = [],
this._initialized = !1,
this.resolver = new Resolver,
this.loader = new Loader,
this.cache = Cache,
this._backgroundLoader = new BackgroundLoader(this.loader),
this._backgroundLoader.active = !0,
this.reset()
}
async init(e={}) {
var t, r;
if (this._initialized)
return;
if (this._initialized = !0,
e.defaultSearchParams &&
this.resolver.setDefaultSearchParams(e.defaultSearchParams),
e.basePath && (this.resolver.basePath = e.basePath),
e.bundleIdentifier &&
this.resolver.setBundleIdentifier(e.bundleIdentifier),
e.manifest) {
let t = e.manifest;
"string" == typeof t && (t = await this.load(t)),
this.resolver.addManifest(t)
}
const n = (null == (t = e.texturePreference) ? void 0 :
t.resolution) ?? 1
, i = "number" == typeof n ? [n] : n
, o = await this._detectFormats({
preferredFormats: null == (r = e.texturePreference) ? void 0 :
r.format,
skipDetections: e.skipDetections,
detections: this._detections
});
this.resolver.prefer({
params: {
format: o,
resolution: i
}
}),
e.preferences && this.setPreferences(e.preferences)
}
add(e, t, r, n, i) {
this.resolver.add(e, t, r, n, i)
}
async load(e, t) {
this._initialized || await this.init();
const r = isSingleItem(e)
, n = convertToList(e).map((e => {
if ("string" != typeof e) {
const t = this.resolver.getAlias(e);
return t.some((e => !this.resolver.hasKey(e))) &&
this.add(e),
Array.isArray(t) ? t[0] : t
}
return this.resolver.hasKey(e) || this.add({
alias: e,
src: e
}),
e
}
))
, i = this.resolver.resolve(n)
, o = await this._mapLoadToResolve(i, t);
return r ? o[n[0]] : o
}
addBundle(e, t) {
this.resolver.addBundle(e, t)
}
async loadBundle(e, t) {
this._initialized || await this.init();
let r = !1;
"string" == typeof e && (r = !0,
e = [e]);
const n = this.resolver.resolveBundle(e)
, i = {}
, o = Object.keys(n);
let s = 0
, a = 0;
const l = () => {
null == t || t(++s / a)
}
, c = o.map((e => {
const t = n[e];
return a += Object.keys(t).length,
this._mapLoadToResolve(t, l).then((t => {
i[e] = t
}
))
}
));
return await Promise.all(c),
r ? i[e[0]] : i
}
async backgroundLoad(e) {
this._initialized || await this.init(),
"string" == typeof e && (e = [e]);
const t = this.resolver.resolve(e);
this._backgroundLoader.add(Object.values(t))
}
async backgroundLoadBundle(e) {
this._initialized || await this.init(),
"string" == typeof e && (e = [e]);
const t = this.resolver.resolveBundle(e);
Object.values(t).forEach((e => {
this._backgroundLoader.add(Object.values(e))
}
))
}
reset() {
this.resolver.reset(),
this.loader.reset(),
this.cache.reset(),
this._initialized = !1
}
get(e) {
if ("string" == typeof e)
return Cache.get(e);
const t = {};
for (let r = 0; r < e.length; r++)
t[r] = Cache.get(e[r]);
return t
}
async _mapLoadToResolve(e, t) {
const r = Object.values(e)
, n = Object.keys(e);
this._backgroundLoader.active = !1;
const i = await this.loader.load(r, t);
this._backgroundLoader.active = !0;
const o = {};
return r.forEach(( (e, t) => {
const r = i[e.src]
, s = [e.src];
e.alias && s.push(...e.alias),
o[n[t]] = r,
Cache.set(s, r)
}
)),
o
}
async unload(e) {
this._initialized || await this.init();
const t = convertToList(e).map((e => "string" != typeof e ? e.src :
e))
, r = this.resolver.resolve(t);
await this._unloadFromResolved(r)
}
async unloadBundle(e) {
this._initialized || await this.init(),
e = convertToList(e);
const t = this.resolver.resolveBundle(e)
, r = Object.keys(t).map((e => this._unloadFromResolved(t[e])));
await Promise.all(r)
}
async _unloadFromResolved(e) {
const t = Object.values(e);
t.forEach((e => {
Cache.remove(e.src)
}
)),
await this.loader.unload(t)
}
async _detectFormats(e) {
let t = [];
e.preferredFormats && (t = Array.isArray(e.preferredFormats) ?
e.preferredFormats : [e.preferredFormats]);
for (const r of e.detections)
e.skipDetections || await r.test() ? t = await r.add(t) :
e.skipDetections || (t = await r.remove(t));
return t = t.filter(( (e, r) => t.indexOf(e) === r)),
t
}
get detections() {
return this._detections
}
get preferWorkers() {
return loadTextures.config.preferWorkers
}
set preferWorkers(e) {
deprecation("7.2.0", "Assets.prefersWorkers is deprecated, use
Assets.setPreferences({ preferWorkers: true }) instead."),
this.setPreferences({
preferWorkers: e
})
}
setPreferences(e) {
this.loader.parsers.forEach((t => {
t.config && Object.keys(t.config).filter((t => t in
e)).forEach((r => {
t.config[r] = e[r]
}
))
}
))
}
}
const Assets = new AssetsClass;
extensions$1.handleByList(ExtensionType.LoadParser,
Assets.loader.parsers).handleByList(ExtensionType.ResolveParser,
Assets.resolver.parsers).handleByList(ExtensionType.CacheParser,
Assets.cache.parsers).handleByList(ExtensionType.DetectionParser,
Assets.detections);
const cacheTextureArray = {
extension: ExtensionType.CacheParser,
test: e => Array.isArray(e) && e.every((e => e instanceof Texture)),
getCacheableAssets: (e, t) => {
const r = {};
return e.forEach((e => {
t.forEach(( (t, n) => {
r[e + (0 === n ? "" : n + 1)] = t
}
))
}
)),
r
}
};
async function testImageFormat(e) {
if ("Image"in globalThis)
return new Promise((t => {
const r = new Image;
r.onload = () => {
t(!0)
}
,
r.onerror = () => {
t(!1)
}
,
r.src = e
}
));
if ("createImageBitmap"in globalThis && "fetch"in globalThis) {
try {
const t = await (await fetch(e)).blob();
await createImageBitmap(t)
} catch {
return !1
}
return !0
}
return !1
}
extensions$1.add(cacheTextureArray);
const detectAvif = {
extension: {
type: ExtensionType.DetectionParser,
priority: 1
},
test: async () =>
testImageFormat("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUI
AAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAA
AAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABA
ABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgI
CAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF
0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),
add: async e => [...e, "avif"],
remove: async e => e.filter((e => "avif" !== e))
};
extensions$1.add(detectAvif);
const detectWebp = {
extension: {
type: ExtensionType.DetectionParser,
priority: 0
},
test: async () =>
testImageFormat("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/
+BiOh/AAA="),
add: async e => [...e, "webp"],
remove: async e => e.filter((e => "webp" !== e))
};
extensions$1.add(detectWebp);
const imageFormats = ["png", "jpg", "jpeg"]
, detectDefaults = {
extension: {
type: ExtensionType.DetectionParser,
priority: -1
},
test: () => Promise.resolve(!0),
add: async e => [...e, ...imageFormats],
remove: async e => e.filter((e => !imageFormats.includes(e)))
};
extensions$1.add(detectDefaults);
const inWorker = "WorkerGlobalScope"in globalThis && globalThis instanceof
globalThis.WorkerGlobalScope;
function testVideoFormat(e) {
return !inWorker && "" !==
document.createElement("video").canPlayType(e)
}
const detectWebm = {
extension: {
type: ExtensionType.DetectionParser,
priority: 0
},
test: async () => testVideoFormat("video/webm"),
add: async e => [...e, "webm"],
remove: async e => e.filter((e => "webm" !== e))
};
extensions$1.add(detectWebm);
const detectMp4 = {
extension: {
type: ExtensionType.DetectionParser,
priority: 0
},
test: async () => testVideoFormat("video/mp4"),
add: async e => [...e, "mp4", "m4v"],
remove: async e => e.filter((e => "mp4" !== e && "m4v" !== e))
};
extensions$1.add(detectMp4);
const detectOgv = {
extension: {
type: ExtensionType.DetectionParser,
priority: 0
},
test: async () => testVideoFormat("video/ogg"),
add: async e => [...e, "ogv"],
remove: async e => e.filter((e => "ogv" !== e))
};
extensions$1.add(detectOgv);
const resolveTextureUrl = {
extension: ExtensionType.ResolveParser,
test: loadTextures.test,
parse: e => {
var t;
return {
resolution: parseFloat((null == (t =
settings.RETINA_PREFIX.exec(e)) ? void 0 : t[1]) ?? "1"),
format: path$1.extname(e).slice(1),
src: e
}
}
};
extensions$1.add(resolveTextureUrl);
var INTERNAL_FORMATS = (e => (e[e.COMPRESSED_RGB_S3TC_DXT1_EXT = 33776] =
"COMPRESSED_RGB_S3TC_DXT1_EXT",
e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777] =
"COMPRESSED_RGBA_S3TC_DXT1_EXT",
e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778] =
"COMPRESSED_RGBA_S3TC_DXT3_EXT",
e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779] =
"COMPRESSED_RGBA_S3TC_DXT5_EXT",
e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917] =
"COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",
e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918] =
"COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",
e[e.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919] =
"COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",
e[e.COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916] =
"COMPRESSED_SRGB_S3TC_DXT1_EXT",
e[e.COMPRESSED_R11_EAC = 37488] = "COMPRESSED_R11_EAC",
e[e.COMPRESSED_SIGNED_R11_EAC = 37489] = "COMPRESSED_SIGNED_R11_EAC",
e[e.COMPRESSED_RG11_EAC = 37490] = "COMPRESSED_RG11_EAC",
e[e.COMPRESSED_SIGNED_RG11_EAC = 37491] = "COMPRESSED_SIGNED_RG11_EAC",
e[e.COMPRESSED_RGB8_ETC2 = 37492] = "COMPRESSED_RGB8_ETC2",
e[e.COMPRESSED_RGBA8_ETC2_EAC = 37496] = "COMPRESSED_RGBA8_ETC2_EAC",
e[e.COMPRESSED_SRGB8_ETC2 = 37493] = "COMPRESSED_SRGB8_ETC2",
e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497] =
"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",
e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494] =
"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",
e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495] =
"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",
e[e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840] =
"COMPRESSED_RGB_PVRTC_4BPPV1_IMG",
e[e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842] =
"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",
e[e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841] =
"COMPRESSED_RGB_PVRTC_2BPPV1_IMG",
e[e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843] =
"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",
e[e.COMPRESSED_RGB_ETC1_WEBGL = 36196] = "COMPRESSED_RGB_ETC1_WEBGL",
e[e.COMPRESSED_RGB_ATC_WEBGL = 35986] = "COMPRESSED_RGB_ATC_WEBGL",
e[e.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 35987] =
"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",
e[e.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 34798] =
"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",
e[e.COMPRESSED_RGBA_ASTC_4x4_KHR = 37808] = "COMPRESSED_RGBA_ASTC_4x4_KHR",
e[e.COMPRESSED_RGBA_BPTC_UNORM_EXT = 36492] =
"COMPRESSED_RGBA_BPTC_UNORM_EXT",
e[e.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 36493] =
"COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",
e[e.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 36494] =
"COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",
e[e.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 36495] =
"COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",
e))(INTERNAL_FORMATS || {});
const INTERNAL_FORMAT_TO_BYTES_PER_PIXEL = {
33776: .5,
33777: .5,
33778: 1,
33779: 1,
35916: .5,
35917: .5,
35918: 1,
35919: 1,
37488: .5,
37489: .5,
37490: 1,
37491: 1,
37492: .5,
37496: 1,
37493: .5,
37497: 1,
37494: .5,
37495: .5,
35840: .5,
35842: .5,
35841: .25,
35843: .25,
36196: .5,
35986: .5,
35987: 1,
34798: 1,
37808: 1,
36492: 1,
36493: 1,
36494: 1,
36495: 1
};
let storedGl, extensions;
function getCompressedTextureExtensions() {
extensions = {
s3tc: storedGl.getExtension("WEBGL_compressed_texture_s3tc"),
s3tc_sRGB:
storedGl.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
etc: storedGl.getExtension("WEBGL_compressed_texture_etc"),
etc1: storedGl.getExtension("WEBGL_compressed_texture_etc1"),
pvrtc: storedGl.getExtension("WEBGL_compressed_texture_pvrtc") ||
storedGl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
atc: storedGl.getExtension("WEBGL_compressed_texture_atc"),
astc: storedGl.getExtension("WEBGL_compressed_texture_astc"),
bptc: storedGl.getExtension("EXT_texture_compression_bptc")
}
}
const detectCompressedTextures = {
extension: {
type: ExtensionType.DetectionParser,
priority: 2
},
test: async () => {
const e = settings.ADAPTER.createCanvas().getContext("webgl");
return !!e && (storedGl = e,
!0)
}
,
add: async e => {
extensions || getCompressedTextureExtensions();
const t = [];
for (const r in extensions)
extensions[r] && t.push(r);
return [...t, ...e]
}
,
remove: async e => (extensions || getCompressedTextureExtensions(),
e.filter((e => !(e in extensions))))
};
extensions$1.add(detectCompressedTextures);
class BlobResource extends BufferResource {
constructor(e, t={
width: 1,
height: 1,
autoLoad: !0
}) {
let r, n;
"string" == typeof e ? (r = e,
n = new Uint8Array) : (r = null,
n = e),
super(n, t),
this.origin = r,
this.buffer = n ? new ViewableBuffer(n) : null,
this._load = null,
this.loaded = !1,
null !== this.origin && !1 !== t.autoLoad && this.load(),
null === this.origin && this.buffer && (this._load =
Promise.resolve(this),
this.loaded = !0,
this.onBlobLoaded(this.buffer.rawBinaryData))
}
onBlobLoaded(e) {}
load() {
return this._load || (this._load = fetch(this.origin).then((e =>
e.blob())).then((e => e.arrayBuffer())).then((e => (this.data = new Uint32Array(e),
this.buffer = new ViewableBuffer(e),
this.loaded = !0,
this.onBlobLoaded(e),
this.update(),
this)))),
this._load
}
}
class CompressedTextureResource extends BlobResource {
constructor(e, t) {
super(e, t),
this.format = t.format,
this.levels = t.levels || 1,
this._width = t.width,
this._height = t.height,
this._extension =
CompressedTextureResource._formatToExtension(this.format),
(t.levelBuffers || this.buffer) && (this._levelBuffers =
t.levelBuffers || CompressedTextureResource._createLevelBuffers(e instanceof
Uint8Array ? e : this.buffer.uint8View, this.format, this.levels, 4, 4, this.width,
this.height))
}
upload(e, t, r) {
const n = e.gl;
if (!e.context.extensions[this._extension])
throw new Error(`${this._extension} textures are not supported
on the current machine`);
if (!this._levelBuffers)
return !1;
n.pixelStorei(n.UNPACK_ALIGNMENT, 4);
for (let i = 0, o = this.levels; i < o; i++) {
const {levelID: e, levelWidth: t, levelHeight: r, levelBuffer:
o} = this._levelBuffers[i];
n.compressedTexImage2D(n.TEXTURE_2D, e, this.format, t, r, 0,
o)
}
return !0
}
onBlobLoaded() {
this._levelBuffers =
CompressedTextureResource._createLevelBuffers(this.buffer.uint8View, this.format,
this.levels, 4, 4, this.width, this.height)
}
static _formatToExtension(e) {
if (e >= 33776 && e <= 33779)
return "s3tc";
if (e >= 35916 && e <= 35919)
return "s3tc_sRGB";
if (e >= 37488 && e <= 37497)
return "etc";
if (e >= 35840 && e <= 35843)
return "pvrtc";
if (36196 === e)
return "etc1";
if (35986 === e || 35987 === e || 34798 === e)
return "atc";
if (e >= 36492 && e <= 36495)
return "bptc";
if (37808 === e)
return "astc";
throw new Error(`Invalid (compressed) texture format given: ${e}`)
}
static _createLevelBuffers(e, t, r, n, i, o, s) {
const a = new Array(r);
let l = e.byteOffset
, c = o
, u = s
, d = c + n - 1 & ~(n - 1)
, p = u + i - 1 & ~(i - 1)
, h = d * p * INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[t];
for (let f = 0; f < r; f++)
a[f] = {
levelID: f,
levelWidth: r > 1 ? c : d,
levelHeight: r > 1 ? u : p,
levelBuffer: new Uint8Array(e.buffer,l,h)
},
l += h,
c = c >> 1 || 1,
u = u >> 1 || 1,
d = c + n - 1 & ~(n - 1),
p = u + i - 1 & ~(i - 1),
h = d * p * INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[t];
return a
}
}
const DDS_MAGIC_SIZE = 4
, DDS_HEADER_SIZE = 124
, DDS_HEADER_PF_SIZE = 32
, DDS_HEADER_DX10_SIZE = 20
, DDS_MAGIC = 542327876
, DDS_FIELDS = {
SIZE: 1,
FLAGS: 2,
HEIGHT: 3,
WIDTH: 4,
MIPMAP_COUNT: 7,
PIXEL_FORMAT: 19
}
, DDS_PF_FIELDS = {
SIZE: 0,
FLAGS: 1,
FOURCC: 2,
RGB_BITCOUNT: 3,
R_BIT_MASK: 4,
G_BIT_MASK: 5,
B_BIT_MASK: 6,
A_BIT_MASK: 7
}
, DDS_DX10_FIELDS = {
DXGI_FORMAT: 0,
RESOURCE_DIMENSION: 1,
MISC_FLAG: 2,
ARRAY_SIZE: 3,
MISC_FLAGS2: 4
}
, PF_FLAGS = 1
, DDPF_ALPHA = 2
, DDPF_FOURCC = 4
, DDPF_RGB = 64
, DDPF_YUV = 512
, DDPF_LUMINANCE = 131072
, FOURCC_DXT1 = 827611204
, FOURCC_DXT3 = 861165636
, FOURCC_DXT5 = 894720068
, FOURCC_DX10 = 808540228
, DDS_RESOURCE_MISC_TEXTURECUBE = 4
, FOURCC_TO_FORMAT = {
[FOURCC_DXT1]: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
[FOURCC_DXT3]: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
[FOURCC_DXT5]: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT
}
, DXGI_TO_FORMAT = {
70: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
71: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,
73: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
74: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,
76: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
77: INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,
72: INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
75: INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
78: INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
96: INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
95: INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
98: INTERNAL_FORMATS.COMPRESSED_RGBA_BPTC_UNORM_EXT,
99: INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT
};
function parseDDS(e) {
const t = new Uint32Array(e);
if (t[0] !== DDS_MAGIC)
throw new Error("Invalid DDS file magic word");
const r = new Uint32Array(e,0,DDS_HEADER_SIZE /
Uint32Array.BYTES_PER_ELEMENT)
, n = r[DDS_FIELDS.HEIGHT]
, i = r[DDS_FIELDS.WIDTH]
, o = r[DDS_FIELDS.MIPMAP_COUNT]
, s = new Uint32Array(e,DDS_FIELDS.PIXEL_FORMAT *
Uint32Array.BYTES_PER_ELEMENT,DDS_HEADER_PF_SIZE / Uint32Array.BYTES_PER_ELEMENT)
, a = s[PF_FLAGS];
if (a & DDPF_FOURCC) {
const r = s[DDS_PF_FIELDS.FOURCC];
if (r !== FOURCC_DX10) {
const t = FOURCC_TO_FORMAT[r]
, s = new Uint8Array(e,DDS_MAGIC_SIZE + DDS_HEADER_SIZE);
return [new CompressedTextureResource(s,{
format: t,
width: i,
height: n,
levels: o
})]
}
const a = DDS_MAGIC_SIZE + DDS_HEADER_SIZE
, l = new Uint32Array(t.buffer,a,DDS_HEADER_DX10_SIZE /
Uint32Array.BYTES_PER_ELEMENT)
, c = l[DDS_DX10_FIELDS.DXGI_FORMAT]
, u = l[DDS_DX10_FIELDS.RESOURCE_DIMENSION]
, d = l[DDS_DX10_FIELDS.MISC_FLAG]
, p = l[DDS_DX10_FIELDS.ARRAY_SIZE]
, h = DXGI_TO_FORMAT[c];
if (void 0 === h)
throw new Error(`DDSParser cannot parse texture data with DXGI
format ${c}`);
if (d === DDS_RESOURCE_MISC_TEXTURECUBE)
throw new Error("DDSParser does not support cubemap textures");
if (6 === u)
throw new Error("DDSParser does not supported 3D texture
data");
const f = new Array
, m = DDS_MAGIC_SIZE + DDS_HEADER_SIZE + DDS_HEADER_DX10_SIZE;
if (1 === p)
f.push(new Uint8Array(e,m));
else {
const t = INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[h];
let r = 0
, s = i
, a = n;
for (let e = 0; e < o; e++) {
r += Math.max(1, s + 3 & -4) * Math.max(1, a + 3 & -4) * t,
s >>>= 1,
a >>>= 1
}
let l = m;
for (let n = 0; n < p; n++)
f.push(new Uint8Array(e,l,r)),
l += r
}
return f.map((e => new CompressedTextureResource(e,{
format: h,
width: i,
height: n,
levels: o
})))
}
throw a & DDPF_RGB ? new Error("DDSParser does not support uncompressed
texture data.") : a & DDPF_YUV ? new Error("DDSParser does not supported YUV
uncompressed texture data.") : a & DDPF_LUMINANCE ? new Error("DDSParser does not
support single-channel (lumninance) texture data!") : a & DDPF_ALPHA ? new
Error("DDSParser does not support single-channel (alpha) texture data!") : new
Error("DDSParser failed to load a texture file due to an unknown reason!")
}
const FILE_IDENTIFIER = [171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10]
, ENDIANNESS = 67305985
, KTX_FIELDS = {
FILE_IDENTIFIER: 0,
ENDIANNESS: 12,
GL_TYPE: 16,
GL_TYPE_SIZE: 20,
GL_FORMAT: 24,
GL_INTERNAL_FORMAT: 28,
GL_BASE_INTERNAL_FORMAT: 32,
PIXEL_WIDTH: 36,
PIXEL_HEIGHT: 40,
PIXEL_DEPTH: 44,
NUMBER_OF_ARRAY_ELEMENTS: 48,
NUMBER_OF_FACES: 52,
NUMBER_OF_MIPMAP_LEVELS: 56,
BYTES_OF_KEY_VALUE_DATA: 60
}
, FILE_HEADER_SIZE = 64
, TYPES_TO_BYTES_PER_COMPONENT = {
[TYPES.UNSIGNED_BYTE]: 1,
[TYPES.UNSIGNED_SHORT]: 2,
[TYPES.INT]: 4,
[TYPES.UNSIGNED_INT]: 4,
[TYPES.FLOAT]: 4,
[TYPES.HALF_FLOAT]: 8
}
, FORMATS_TO_COMPONENTS = {
[FORMATS.RGBA]: 4,
[FORMATS.RGB]: 3,
[FORMATS.RG]: 2,
[FORMATS.RED]: 1,
[FORMATS.LUMINANCE]: 1,
[FORMATS.LUMINANCE_ALPHA]: 2,
[FORMATS.ALPHA]: 1
}
, TYPES_TO_BYTES_PER_PIXEL = {
[TYPES.UNSIGNED_SHORT_4_4_4_4]: 2,
[TYPES.UNSIGNED_SHORT_5_5_5_1]: 2,
[TYPES.UNSIGNED_SHORT_5_6_5]: 2
};
function parseKTX(e, t, r=!1) {
const n = new DataView(t);
if (!validate(e, n))
return null;
const i = n.getUint32(KTX_FIELDS.ENDIANNESS, !0) === ENDIANNESS
, o = n.getUint32(KTX_FIELDS.GL_TYPE, i)
, s = n.getUint32(KTX_FIELDS.GL_FORMAT, i)
, a = n.getUint32(KTX_FIELDS.GL_INTERNAL_FORMAT, i)
, l = n.getUint32(KTX_FIELDS.PIXEL_WIDTH, i)
, c = n.getUint32(KTX_FIELDS.PIXEL_HEIGHT, i) || 1
, u = n.getUint32(KTX_FIELDS.PIXEL_DEPTH, i) || 1
, d = n.getUint32(KTX_FIELDS.NUMBER_OF_ARRAY_ELEMENTS, i) || 1
, p = n.getUint32(KTX_FIELDS.NUMBER_OF_FACES, i)
, h = n.getUint32(KTX_FIELDS.NUMBER_OF_MIPMAP_LEVELS, i)
, f = n.getUint32(KTX_FIELDS.BYTES_OF_KEY_VALUE_DATA, i);
if (0 === c || 1 !== u)
throw new Error("Only 2D textures are supported");
if (1 !== p)
throw new Error("CubeTextures are not supported by KTXLoader
yet!");
if (1 !== d)
throw new Error("WebGL does not support array textures");
const m = l + 3 & -4
, g = c + 3 & -4
, y = new Array(d);
let v, b = l * c;
if (0 === o && (b = m * g),
v = 0 !== o ? TYPES_TO_BYTES_PER_COMPONENT[o] ?
TYPES_TO_BYTES_PER_COMPONENT[o] * FORMATS_TO_COMPONENTS[s] :
TYPES_TO_BYTES_PER_PIXEL[o] : INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[a],
void 0 === v)
throw new Error("Unable to resolve the pixel format stored in the
*.ktx file!");
const x = r ? parseKvData(n, f, i) : null;
let _ = b * v
, E = l
, T = c
, C = m
, S = g
, $ = FILE_HEADER_SIZE + f;
for (let w = 0; w < h; w++) {
const e = n.getUint32($, i);
let r = $ + 4;
for (let n = 0; n < d; n++) {
let e = y[n];
e || (e = y[n] = new Array(h)),
e[w] = {
levelID: w,
levelWidth: h > 1 || 0 !== o ? E : C,
levelHeight: h > 1 || 0 !== o ? T : S,
levelBuffer: new Uint8Array(t,r,_)
},
r += _
}
$ += e + 4,
$ = $ % 4 != 0 ? $ + 4 - $ % 4 : $,
E = E >> 1 || 1,
T = T >> 1 || 1,
C = E + 4 - 1 & -4,
S = T + 4 - 1 & -4,
_ = C * S * v
}
return 0 !== o ? {
uncompressed: y.map((e => {
let t = e[0].levelBuffer
, r = !1;
return o === TYPES.FLOAT ? t = new
Float32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.b
yteLength / 4) : o === TYPES.UNSIGNED_INT ? (r = !0,
t = new
Uint32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.by
teLength / 4)) : o === TYPES.INT && (r = !0,
t = new
Int32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byt
eLength / 4)),
{
resource: new BufferResource(t,{
width: e[0].levelWidth,
height: e[0].levelHeight
}),
type: o,
format: r ? convertFormatToInteger(s) : s
}
}
)),
kvData: x
} : {
compressed: y.map((e => new CompressedTextureResource(null,{
format: a,
width: l,
height: c,
levels: h,
levelBuffers: e
}))),
kvData: x
}
}
function validate(e, t) {
for (let r = 0; r < FILE_IDENTIFIER.length; r++)
if (t.getUint8(r) !== FILE_IDENTIFIER[r])
return !1;
return !0
}
function convertFormatToInteger(e) {
switch (e) {
case FORMATS.RGBA:
return FORMATS.RGBA_INTEGER;
case FORMATS.RGB:
return FORMATS.RGB_INTEGER;
case FORMATS.RG:
return FORMATS.RG_INTEGER;
case FORMATS.RED:
return FORMATS.RED_INTEGER;
default:
return e
}
}
function parseKvData(e, t, r) {
const n = new Map;
let i = 0;
for (; i < t; ) {
const o = e.getUint32(FILE_HEADER_SIZE + i, r)
, s = FILE_HEADER_SIZE + i + 4
, a = 3 - (o + 3) % 4;
if (0 === o || o > t - i)
break;
let l = 0;
for (; l < o && 0 !== e.getUint8(s + l); l++)
;
if (-1 === l)
break;
const c = (new TextDecoder).decode(new Uint8Array(e.buffer,s,l))
, u = new DataView(e.buffer,s + l + 1,o - l - 1);
n.set(c, u),
i += 4 + o + a
}
return n
}
const loadDDS = {
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.High
},
name: "loadDDS",
test: e => checkExtension(e, ".dds"),
async load(e, t, r) {
const n = parseDDS(await (await
settings.ADAPTER.fetch(e)).arrayBuffer()).map((n => createTexture(new
BaseTexture(n,{
mipmap: MIPMAP_MODES.OFF,
alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,
resolution: getResolutionOfUrl(e),
...t.data
}), r, e)));
return 1 === n.length ? n[0] : n
},
unload(e) {
Array.isArray(e) ? e.forEach((e => e.destroy(!0))) : e.destroy(!0)
}
};
extensions$1.add(loadDDS);
const loadKTX = {
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.High
},
name: "loadKTX",
test: e => checkExtension(e, ".ktx"),
async load(e, t, r) {
const n = await (await settings.ADAPTER.fetch(e)).arrayBuffer()
, {compressed: i, uncompressed: o, kvData: s} = parseKTX(e, n)
, a = i ?? o
, l = {
mipmap: MIPMAP_MODES.OFF,
alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,
resolution: getResolutionOfUrl(e),
...t.data
}
, c = a.map((t => {
a === o && Object.assign(l, {
type: t.type,
format: t.format
});
const n = t.resource ?? t
, i = new BaseTexture(n,l);
return i.ktxKeyValueData = s,
createTexture(i, r, e)
}
));
return 1 === c.length ? c[0] : c
},
unload(e) {
Array.isArray(e) ? e.forEach((e => e.destroy(!0))) : e.destroy(!0)
}
};
extensions$1.add(loadKTX);
const resolveCompressedTextureUrl = {
extension: ExtensionType.ResolveParser,
test: e => {
const t = path$1.extname(e).slice(1);
return ["basis", "ktx", "dds"].includes(t)
}
,
parse: e => {
var t, r;
const n = path$1.extname(e).slice(1);
if ("ktx" === n) {
const r = [".s3tc.ktx", ".s3tc_sRGB.ktx", ".etc.ktx",
".etc1.ktx", ".pvrt.ktx", ".atc.ktx", ".astc.ktx", ".bptc.ktx"];
if (r.some((t => e.endsWith(t))))
return {
resolution: parseFloat((null == (t =
settings.RETINA_PREFIX.exec(e)) ? void 0 : t[1]) ?? "1"),
format: r.find((t => e.endsWith(t))),
src: e
}
}
return {
resolution: parseFloat((null == (r =
settings.RETINA_PREFIX.exec(e)) ? void 0 : r[1]) ?? "1"),
format: n,
src: e
}
}
};
extensions$1.add(resolveCompressedTextureUrl);
const TEMP_RECT = new Rectangle
, BYTES_PER_PIXEL = 4
, _Extract = class e {
constructor(e) {
this.renderer = e,
this._rendererPremultipliedAlpha = !1
}
contextChange() {
var e;
const t = null == (e = this.renderer) ? void 0 :
e.gl.getContextAttributes();
this._rendererPremultipliedAlpha = !!(t && t.alpha &&
t.premultipliedAlpha)
}
async image(e, t, r, n) {
const i = new Image;
return i.src = await this.base64(e, t, r, n),
i
}
async base64(e, t, r, n) {
const i = this.canvas(e, n);
if (void 0 !== i.toBlob)
return new Promise(( (e, n) => {
i.toBlob((t => {
if (!t)
return void n(new Error("ICanvas.toBlob failed!"));
const r = new FileReader;
r.onload = () => e(r.result),
r.onerror = n,
r.readAsDataURL(t)
}
), t, r)
}
));
if (void 0 !== i.toDataURL)
return i.toDataURL(t, r);
if (void 0 !== i.convertToBlob) {
const e = await i.convertToBlob({
type: t,
quality: r
});
return new Promise(( (t, r) => {
const n = new FileReader;
n.onload = () => t(n.result),
n.onerror = r,
n.readAsDataURL(e)
}
))
}
throw new Error("Extract.base64() requires ICanvas.toDataURL,
ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")
}
canvas(t, r) {
const {pixels: n, width: i, height: o, flipY: s,
premultipliedAlpha: a} = this._rawPixels(t, r);
s && e._flipY(n, i, o),
a && e._unpremultiplyAlpha(n);
const l = new CanvasRenderTarget(i,o,1)
, c = new ImageData(new Uint8ClampedArray(n.buffer),i,o);
return l.context.putImageData(c, 0, 0),
l.canvas
}
pixels(t, r) {
const {pixels: n, width: i, height: o, flipY: s,
premultipliedAlpha: a} = this._rawPixels(t, r);
return s && e._flipY(n, i, o),
a && e._unpremultiplyAlpha(n),
n
}
_rawPixels(e, t) {
const r = this.renderer;
if (!r)
throw new Error("The Extract has already been destroyed");
let n, i, o = !1, s = !1, a = !1;
e && (e instanceof RenderTexture ? i = e : (i =
r.generateTexture(e, {
region: t,
resolution: r.resolution,
multisample: r.multisample
}),
a = !0,
t && (TEMP_RECT.width = t.width,
TEMP_RECT.height = t.height,
t = TEMP_RECT)));
const l = r.gl;
if (i) {
if (n = i.baseTexture.resolution,
t = t ?? i.frame,
o = !1,
s = i.baseTexture.alphaMode > 0 && i.baseTexture.format ===
FORMATS.RGBA,
!a) {
r.renderTexture.bind(i);
const e = i.framebuffer.glFramebuffers[r.CONTEXT_UID];
e.blitFramebuffer && r.framebuffer.bind(e.blitFramebuffer)
}
} else
n = r.resolution,
t || ((t = TEMP_RECT).width = r.width / n,
t.height = r.height / n),
o = !0,
s = this._rendererPremultipliedAlpha,
r.renderTexture.bind();
const c = Math.max(Math.round(t.width * n), 1)
, u = Math.max(Math.round(t.height * n), 1)
, d = new Uint8Array(BYTES_PER_PIXEL * c * u);
return l.readPixels(Math.round(t.x * n), Math.round(t.y * n), c, u,
l.RGBA, l.UNSIGNED_BYTE, d),
a && (null == i || i.destroy(!0)),
{
pixels: d,
width: c,
height: u,
flipY: o,
premultipliedAlpha: s
}
}
destroy() {
this.renderer = null
}
static _flipY(e, t, r) {
const n = t << 2
, i = r >> 1
, o = new Uint8Array(n);
for (let s = 0; s < i; s++) {
const t = s * n
, i = (r - s - 1) * n;
o.set(e.subarray(t, t + n)),
e.copyWithin(t, i, i + n),
e.set(o, i)
}
}
static _unpremultiplyAlpha(e) {
e instanceof Uint8ClampedArray && (e = new Uint8Array(e.buffer));
const t = e.length;
for (let r = 0; r < t; r += 4) {
const t = e[r + 3];
if (0 !== t) {
const n = 255.001 / t;
e[r] = e[r] * n + .5,
e[r + 1] = e[r + 1] * n + .5,
e[r + 2] = e[r + 2] * n + .5
}
}
}
}
;
_Extract.extension = {
name: "extract",
type: ExtensionType.RendererSystem
};
let Extract = _Extract;
extensions$1.add(Extract);
const buildCircle = {
build(e) {
const t = e.points;
let r, n, i, o, s, a;
if (e.type === SHAPES.CIRC) {
const t = e.shape;
r = t.x,
n = t.y,
s = a = t.radius,
i = o = 0
} else if (e.type === SHAPES.ELIP) {
const t = e.shape;
r = t.x,
n = t.y,
s = t.width,
a = t.height,
i = o = 0
} else {
const t = e.shape
, l = t.width / 2
, c = t.height / 2;
r = t.x + l,
n = t.y + c,
s = a = Math.max(0, Math.min(t.radius, Math.min(l, c))),
i = l - s,
o = c - a
}
if (!(s >= 0 && a >= 0 && i >= 0 && o >= 0))
return void (t.length = 0);
const l = Math.ceil(2.3 * Math.sqrt(s + a))
, c = 8 * l + (i ? 4 : 0) + (o ? 4 : 0);
if (t.length = c,
0 === c)
return;
if (0 === l)
return t.length = 8,
t[0] = t[6] = r + i,
t[1] = t[3] = n + o,
t[2] = t[4] = r - i,
void (t[5] = t[7] = n - o);
let u = 0
, d = 4 * l + (i ? 2 : 0) + 2
, p = d
, h = c;
{
const e = i + s
, a = o
, l = r + e
, c = r - e
, f = n + a;
if (t[u++] = l,
t[u++] = f,
t[--d] = f,
t[--d] = c,
o) {
const e = n - a;
t[p++] = c,
t[p++] = e,
t[--h] = e,
t[--h] = l
}
}
for (let f = 1; f < l; f++) {
const e = Math.PI / 2 * (f / l)
, c = i + Math.cos(e) * s
, m = o + Math.sin(e) * a
, g = r + c
, y = r - c
, v = n + m
, b = n - m;
t[u++] = g,
t[u++] = v,
t[--d] = v,
t[--d] = y,
t[p++] = y,
t[p++] = b,
t[--h] = b,
t[--h] = g
}
{
const e = o + a
, s = r + i
, l = r - i
, c = n + e
, d = n - e;
t[u++] = s,
t[u++] = c,
t[--h] = d,
t[--h] = s,
i && (t[u++] = l,
t[u++] = c,
t[--h] = d,
t[--h] = l)
}
},
triangulate(e, t) {
const r = e.points
, n = t.points
, i = t.indices;
if (0 === r.length)
return;
let o = n.length / 2;
const s = o;
let a, l;
if (e.type !== SHAPES.RREC) {
const t = e.shape;
a = t.x,
l = t.y
} else {
const t = e.shape;
a = t.x + t.width / 2,
l = t.y + t.height / 2
}
const c = e.matrix;
n.push(e.matrix ? c.a * a + c.c * l + c.tx : a, e.matrix ? c.b * a
+ c.d * l + c.ty : l),
o++,
n.push(r[0], r[1]);
for (let u = 2; u < r.length; u += 2)
n.push(r[u], r[u + 1]),
i.push(o++, s, o);
i.push(s + 1, s, o)
}
};
function fixOrientation(e, t=!1) {
const r = e.length;
if (r < 6)
return;
let n = 0;
for (let i = 0, o = e[r - 2], s = e[r - 1]; i < r; i += 2) {
const t = e[i]
, r = e[i + 1];
n += (t - o) * (r + s),
o = t,
s = r
}
if (!t && n > 0 || t && n <= 0) {
const t = r / 2;
for (let n = t + t % 2; n < r; n += 2) {
const t = r - n - 2
, i = r - n - 1
, o = n
, s = n + 1;
[e[t],e[o]] = [e[o], e[t]],
[e[i],e[s]] = [e[s], e[i]]
}
}
}
const buildPoly = {
build(e) {
e.points = e.shape.points.slice()
},
triangulate(e, t) {
let r = e.points;
const n = e.holes
, i = t.points
, o = t.indices;
if (r.length >= 6) {
fixOrientation(r, !1);
const e = [];
for (let i = 0; i < n.length; i++) {
const t = n[i];
fixOrientation(t.points, !0),
e.push(r.length / 2),
r = r.concat(t.points)
}
const t = earcut$1(r, e, 2);
if (!t)
return;
const s = i.length / 2;
for (let r = 0; r < t.length; r += 3)
o.push(t[r] + s),
o.push(t[r + 1] + s),
o.push(t[r + 2] + s);
for (let n = 0; n < r.length; n++)
i.push(r[n])
}
}
}
, buildRectangle = {
build(e) {
const t = e.shape
, r = t.x
, n = t.y
, i = t.width
, o = t.height
, s = e.points;
s.length = 0,
i >= 0 && o >= 0 && s.push(r, n, r + i, n, r + i, n + o, r, n + o)
},
triangulate(e, t) {
const r = e.points
, n = t.points;
if (0 === r.length)
return;
const i = n.length / 2;
n.push(r[0], r[1], r[2], r[3], r[6], r[7], r[4], r[5]),
t.indices.push(i, i + 1, i + 2, i + 1, i + 2, i + 3)
}
}
, buildRoundedRectangle = {
build(e) {
buildCircle.build(e)
},
triangulate(e, t) {
buildCircle.triangulate(e, t)
}
};
var LINE_JOIN = (e => (e.MITER = "miter",
e.BEVEL = "bevel",
e.ROUND = "round",
e))(LINE_JOIN || {})
, LINE_CAP = (e => (e.BUTT = "butt",
e.ROUND = "round",
e.SQUARE = "square",
e))(LINE_CAP || {});
const curves = {
adaptive: !0,
maxLength: 10,
minSegments: 8,
maxSegments: 2048,
epsilon: 1e-4,
_segmentsCount(e, t=20) {
if (!this.adaptive || !e || isNaN(e))
return t;
let r = Math.ceil(e / this.maxLength);
return r < this.minSegments ? r = this.minSegments : r >
this.maxSegments && (r = this.maxSegments),
r
}
};
class ArcUtils {
static curveTo(e, t, r, n, i, o) {
const s = o[o.length - 2]
, a = o[o.length - 1] - t
, l = s - e
, c = n - t
, u = r - e
, d = Math.abs(a * u - l * c);
if (d < 1e-8 || 0 === i)
return (o[o.length - 2] !== e || o[o.length - 1] !== t) &&
o.push(e, t),
null;
const p = a * a + l * l
, h = c * c + u * u
, f = a * c + l * u
, m = i * Math.sqrt(p) / d
, g = i * Math.sqrt(h) / d
, y = m * f / p
, v = g * f / h
, b = m * u + g * l
, x = m * c + g * a
, _ = l * (g + y)
, E = a * (g + y)
, T = u * (m + v)
, C = c * (m + v);
return {
cx: b + e,
cy: x + t,
radius: i,
startAngle: Math.atan2(E - x, _ - b),
endAngle: Math.atan2(C - x, T - b),
anticlockwise: l * c > u * a
}
}
static arc(e, t, r, n, i, o, s, a, l) {
const c = s - o
, u = curves._segmentsCount(Math.abs(c) * i, 40 *
Math.ceil(Math.abs(c) / PI_2))
, d = c / (2 * u)
, p = 2 * d
, h = Math.cos(d)
, f = Math.sin(d)
, m = u - 1
, g = m % 1 / m;
for (let y = 0; y <= m; ++y) {
const e = d + o + p * (y + g * y)
, t = Math.cos(e)
, s = -Math.sin(e);
l.push((h * t + f * s) * i + r, (h * -s + f * t) * i + n)
}
}
}
class BatchPart {
constructor() {
this.reset()
}
begin(e, t, r) {
this.reset(),
this.style = e,
this.start = t,
this.attribStart = r
}
end(e, t) {
this.attribSize = t - this.attribStart,
this.size = e - this.start
}
reset() {
this.style = null,
this.size = 0,
this.start = 0,
this.attribStart = 0,
this.attribSize = 0
}
}
class BezierUtils {
static curveLength(e, t, r, n, i, o, s, a) {
let l = 0
, c = 0
, u = 0
, d = 0
, p = 0
, h = 0
, f = 0
, m = 0
, g = 0
, y = 0
, v = 0
, b = e
, x = t;
for (let _ = 1; _ <= 10; ++_)
c = _ / 10,
u = c * c,
d = u * c,
p = 1 - c,
h = p * p,
f = h * p,
m = f * e + 3 * h * c * r + 3 * p * u * i + d * s,
g = f * t + 3 * h * c * n + 3 * p * u * o + d * a,
y = b - m,
v = x - g,
b = m,
x = g,
l += Math.sqrt(y * y + v * v);
return l
}
static curveTo(e, t, r, n, i, o, s) {
const a = s[s.length - 2]
, l = s[s.length - 1];
s.length -= 2;
const c = curves._segmentsCount(BezierUtils.curveLength(a, l, e, t,
r, n, i, o));
let u = 0
, d = 0
, p = 0
, h = 0
, f = 0;
s.push(a, l);
for (let m = 1, g = 0; m <= c; ++m)
g = m / c,
u = 1 - g,
d = u * u,
p = d * u,
h = g * g,
f = h * g,
s.push(p * a + 3 * d * g * e + 3 * u * h * r + f * i, p * l + 3
* d * g * t + 3 * u * h * n + f * o)
}
}
function square(e, t, r, n, i, o, s, a) {
let l, c;
s ? (l = n,
c = -r) : (l = -n,
c = r);
const u = e - r * i + l
, d = t - n * i + c
, p = e + r * o + l
, h = t + n * o + c;
return a.push(u, d, p, h),
2
}
function round$1(e, t, r, n, i, o, s, a) {
const l = r - e
, c = n - t;
let u = Math.atan2(l, c)
, d = Math.atan2(i - e, o - t);
a && u < d ? u += 2 * Math.PI : !a && u > d && (d += 2 * Math.PI);
let p = u;
const h = d - u
, f = Math.abs(h)
, m = Math.sqrt(l * l + c * c)
, g = 1 + (15 * f * Math.sqrt(m) / Math.PI | 0)
, y = h / g;
if (p += y,
a) {
s.push(e, t, r, n);
for (let r = 1, n = p; r < g; r++,
n += y)
s.push(e, t, e + Math.sin(n) * m, t + Math.cos(n) * m);
s.push(e, t, i, o)
} else {
s.push(r, n, e, t);
for (let r = 1, n = p; r < g; r++,
n += y)
s.push(e + Math.sin(n) * m, t + Math.cos(n) * m, e, t);
s.push(i, o, e, t)
}
return 2 * g
}
function buildNonNativeLine(e, t) {
const r = e.shape;
let n = e.points || r.points.slice();
const i = t.closePointEps;
if (0 === n.length)
return;
const o = e.lineStyle
, s = new Point(n[0],n[1])
, a = new Point(n[n.length - 2],n[n.length - 1])
, l = r.type !== SHAPES.POLY || r.closeStroke
, c = Math.abs(s.x - a.x) < i && Math.abs(s.y - a.y) < i;
if (l) {
n = n.slice(),
c && (n.pop(),
n.pop(),
a.set(n[n.length - 2], n[n.length - 1]));
const e = .5 * (s.x + a.x)
, t = .5 * (a.y + s.y);
n.unshift(e, t),
n.push(e, t)
}
const u = t.points
, d = n.length / 2;
let p = n.length;
const h = u.length / 2
, f = o.width / 2
, m = f * f
, g = o.miterLimit * o.miterLimit;
let y = n[0]
, v = n[1]
, b = n[2]
, x = n[3]
, _ = 0
, E = 0
, T = -(v - x)
, C = y - b
, S = 0
, $ = 0
, w = Math.sqrt(T * T + C * C);
T /= w,
C /= w,
T *= f,
C *= f;
const P = o.alignment
, R = 2 * (1 - P)
, k = 2 * P;
l || (o.cap === LINE_CAP.ROUND ? p += round$1(y - T * (R - k) * .5, v -
C * (R - k) * .5, y - T * R, v - C * R, y + T * k, v + C * k, u, !0) + 2 : o.cap
=== LINE_CAP.SQUARE && (p += square(y, v, T, C, R, k, !0, u))),
u.push(y - T * R, v - C * R, y + T * k, v + C * k);
for (let O = 1; O < d - 1; ++O) {
y = n[2 * (O - 1)],
v = n[2 * (O - 1) + 1],
b = n[2 * O],
x = n[2 * O + 1],
_ = n[2 * (O + 1)],
E = n[2 * (O + 1) + 1],
T = -(v - x),
C = y - b,
w = Math.sqrt(T * T + C * C),
T /= w,
C /= w,
T *= f,
C *= f,
S = -(x - E),
$ = b - _,
w = Math.sqrt(S * S + $ * $),
S /= w,
$ /= w,
S *= f,
$ *= f;
const e = b - y
, t = v - x
, r = b - _
, i = E - x
, s = e * r + t * i
, a = t * r - i * e
, l = a < 0;
if (Math.abs(a) < .001 * Math.abs(s)) {
u.push(b - T * R, x - C * R, b + T * k, x + C * k),
s >= 0 && (o.join === LINE_JOIN.ROUND ? p += round$1(b, x, b -
T * R, x - C * R, b - S * R, x - $ * R, u, !1) + 4 : p += 2,
u.push(b - S * k, x - $ * k, b + S * R, x + $ * R));
continue
}
const c = (-T + y) * (-C + x) - (-T + b) * (-C + v)
, d = (-S + _) * (-$ + x) - (-S + b) * (-$ + E)
, h = (e * d - r * c) / a
, P = (i * c - t * d) / a
, A = (h - b) * (h - b) + (P - x) * (P - x)
, I = b + (h - b) * R
, D = x + (P - x) * R
, M = b - (h - b) * k
, L = x - (P - x) * k
, j = l ? R : k
, F = A <= Math.min(e * e + t * t, r * r + i * i) + j * j * m;
let N = o.join;
if (N === LINE_JOIN.MITER && A / m > g && (N = LINE_JOIN.BEVEL),
F)
switch (N) {
case LINE_JOIN.MITER:
u.push(I, D, M, L);
break;
case LINE_JOIN.BEVEL:
l ? u.push(I, D, b + T * k, x + C * k, I, D, b + S * k, x +
$ * k) : u.push(b - T * R, x - C * R, M, L, b - S * R, x - $ * R, M, L),
p += 2;
break;
case LINE_JOIN.ROUND:
l ? (u.push(I, D, b + T * k, x + C * k),
p += round$1(b, x, b + T * k, x + C * k, b + S * k, x + $ *
k, u, !0) + 4,
u.push(I, D, b + S * k, x + $ * k)) : (u.push(b - T * R, x
- C * R, M, L),
p += round$1(b, x, b - T * R, x - C * R, b - S * R, x - $ *
R, u, !1) + 4,
u.push(b - S * R, x - $ * R, M, L))
}
else {
switch (u.push(b - T * R, x - C * R, b + T * k, x + C * k),
N) {
case LINE_JOIN.MITER:
l ? u.push(M, L, M, L) : u.push(I, D, I, D),
p += 2;
break;
case LINE_JOIN.ROUND:
p += l ? round$1(b, x, b + T * k, x + C * k, b + S * k, x +
$ * k, u, !0) + 2 : round$1(b, x, b - T * R, x - C * R, b - S * R, x - $ * R, u, !
1) + 2
}
u.push(b - S * R, x - $ * R, b + S * k, x + $ * k),
p += 2
}
}
y = n[2 * (d - 2)],
v = n[2 * (d - 2) + 1],
b = n[2 * (d - 1)],
x = n[2 * (d - 1) + 1],
T = -(v - x),
C = y - b,
w = Math.sqrt(T * T + C * C),
T /= w,
C /= w,
T *= f,
C *= f,
u.push(b - T * R, x - C * R, b + T * k, x + C * k),
l || (o.cap === LINE_CAP.ROUND ? p += round$1(b - T * (R - k) * .5, x -
C * (R - k) * .5, b - T * R, x - C * R, b + T * k, x + C * k, u, !1) + 2 : o.cap
=== LINE_CAP.SQUARE && (p += square(b, x, T, C, R, k, !1, u)));
const A = t.indices
, I = curves.epsilon * curves.epsilon;
for (let O = h; O < p + h - 2; ++O)
y = u[2 * O],
v = u[2 * O + 1],
b = u[2 * (O + 1)],
x = u[2 * (O + 1) + 1],
_ = u[2 * (O + 2)],
E = u[2 * (O + 2) + 1],
!(Math.abs(y * (x - E) + b * (E - v) + _ * (v - x)) < I) &&
A.push(O, O + 1, O + 2)
}
function buildNativeLine(e, t) {
let r = 0;
const n = e.shape
, i = e.points || n.points
, o = n.type !== SHAPES.POLY || n.closeStroke;
if (0 === i.length)
return;
const s = t.points
, a = t.indices
, l = i.length / 2
, c = s.length / 2;
let u = c;
for (s.push(i[0], i[1]),
r = 1; r < l; r++)
s.push(i[2 * r], i[2 * r + 1]),
a.push(u, u + 1),
u++;
o && a.push(u, c)
}
function buildLine(e, t) {
e.lineStyle.native ? buildNativeLine(e, t) : buildNonNativeLine(e, t)
}
class QuadraticUtils {
static curveLength(e, t, r, n, i, o) {
const s = e - 2 * r + i
, a = t - 2 * n + o
, l = 2 * r - 2 * e
, c = 2 * n - 2 * t
, u = 4 * (s * s + a * a)
, d = 4 * (s * l + a * c)
, p = l * l + c * c
, h = 2 * Math.sqrt(u + d + p)
, f = Math.sqrt(u)
, m = 2 * u * f
, g = 2 * Math.sqrt(p)
, y = d / f;
return (m * h + f * d * (h - g) + (4 * p * u - d * d) * Math.log((2
* f + y + h) / (y + g))) / (4 * m)
}
static curveTo(e, t, r, n, i) {
const o = i[i.length - 2]
, s = i[i.length - 1]
, a = curves._segmentsCount(QuadraticUtils.curveLength(o, s, e,
t, r, n));
let l = 0
, c = 0;
for (let u = 1; u <= a; ++u) {
const d = u / a;
l = o + (e - o) * d,
c = s + (t - s) * d,
i.push(l + (e + (r - e) * d - l) * d, c + (t + (n - t) * d - c)
* d)
}
}
}
const FILL_COMMANDS = {
[SHAPES.POLY]: buildPoly,
[SHAPES.CIRC]: buildCircle,
[SHAPES.ELIP]: buildCircle,
[SHAPES.RECT]: buildRectangle,
[SHAPES.RREC]: buildRoundedRectangle
}
, BATCH_POOL = []
, DRAW_CALL_POOL = [];
class GraphicsData {
constructor(e, t=null, r=null, n=null) {
this.points = [],
this.holes = [],
this.shape = e,
this.lineStyle = r,
this.fillStyle = t,
this.matrix = n,
this.type = e.type
}
clone() {
return new
GraphicsData(this.shape,this.fillStyle,this.lineStyle,this.matrix)
}
destroy() {
this.shape = null,
this.holes.length = 0,
this.holes = null,
this.points.length = 0,
this.points = null,
this.lineStyle = null,
this.fillStyle = null
}
}
const tmpPoint = new Point
, _GraphicsGeometry = class e extends BatchGeometry {
constructor() {
super(),
this.closePointEps = 1e-4,
this.boundsPadding = 0,
this.uvsFloat32 = null,
this.indicesUint16 = null,
this.batchable = !1,
this.points = [],
this.colors = [],
this.uvs = [],
this.indices = [],
this.textureIds = [],
this.graphicsData = [],
this.drawCalls = [],
this.batchDirty = -1,
this.batches = [],
this.dirty = 0,
this.cacheDirty = -1,
this.clearDirty = 0,
this.shapeIndex = 0,
this._bounds = new Bounds,
this.boundsDirty = -1
}
get bounds() {
return this.updateBatches(),
this.boundsDirty !== this.dirty && (this.boundsDirty = this.dirty,
this.calculateBounds()),
this._bounds
}
invalidate() {
this.boundsDirty = -1,
this.dirty++,
this.batchDirty++,
this.shapeIndex = 0,
this.points.length = 0,
this.colors.length = 0,
this.uvs.length = 0,
this.indices.length = 0,
this.textureIds.length = 0;
for (let e = 0; e < this.drawCalls.length; e++)
this.drawCalls[e].texArray.clear(),
DRAW_CALL_POOL.push(this.drawCalls[e]);
this.drawCalls.length = 0;
for (let e = 0; e < this.batches.length; e++) {
const t = this.batches[e];
t.reset(),
BATCH_POOL.push(t)
}
this.batches.length = 0
}
clear() {
return this.graphicsData.length > 0 && (this.invalidate(),
this.clearDirty++,
this.graphicsData.length = 0),
this
}
drawShape(e, t=null, r=null, n=null) {
const i = new GraphicsData(e,t,r,n);
return this.graphicsData.push(i),
this.dirty++,
this
}
drawHole(e, t=null) {
if (!this.graphicsData.length)
return null;
const r = new GraphicsData(e,null,null,t)
, n = this.graphicsData[this.graphicsData.length - 1];
return r.lineStyle = n.lineStyle,
n.holes.push(r),
this.dirty++,
this
}
destroy() {
super.destroy();
for (let e = 0; e < this.graphicsData.length; ++e)
this.graphicsData[e].destroy();
this.points.length = 0,
this.points = null,
this.colors.length = 0,
this.colors = null,
this.uvs.length = 0,
this.uvs = null,
this.indices.length = 0,
this.indices = null,
this.indexBuffer.destroy(),
this.indexBuffer = null,
this.graphicsData.length = 0,
this.graphicsData = null,
this.drawCalls.length = 0,
this.drawCalls = null,
this.batches.length = 0,
this.batches = null,
this._bounds = null
}
containsPoint(e) {
const t = this.graphicsData;
for (let r = 0; r < t.length; ++r) {
const n = t[r];
if (n.fillStyle.visible && n.shape && (n.matrix ?
n.matrix.applyInverse(e, tmpPoint) : tmpPoint.copyFrom(e),
n.shape.contains(tmpPoint.x, tmpPoint.y))) {
let e = !1;
if (n.holes)
for (let t = 0; t < n.holes.length; t++)
if (n.holes[t].shape.contains(tmpPoint.x,
tmpPoint.y)) {
e = !0;
break
}
if (!e)
return !0
}
}
return !1
}
updateBatches() {
if (!this.graphicsData.length)
return void (this.batchable = !0);
if (!this.validateBatching())
return;
this.cacheDirty = this.dirty;
const e = this.uvs
, t = this.graphicsData;
let r = null
, n = null;
this.batches.length > 0 && (r = this.batches[this.batches.length -
1],
n = r.style);
for (let a = this.shapeIndex; a < t.length; a++) {
this.shapeIndex++;
const i = t[a]
, o = i.fillStyle
, s = i.lineStyle;
FILL_COMMANDS[i.type].build(i),
i.matrix && this.transformPoints(i.points, i.matrix),
(o.visible || s.visible) && this.processHoles(i.holes);
for (let t = 0; t < 2; t++) {
const a = 0 === t ? o : s;
if (!a.visible)
continue;
const l = a.texture.baseTexture
, c = this.indices.length
, u = this.points.length / 2;
l.wrapMode = WRAP_MODES.REPEAT,
0 === t ? this.processFill(i) : this.processLine(i);
const d = this.points.length / 2 - u;
0 !== d && (r && !this._compareStyles(n, a) && (r.end(c,
u),
r = null),
r || (r = BATCH_POOL.pop() || new BatchPart,
r.begin(a, c, u),
this.batches.push(r),
n = a),
this.addUvs(this.points, e, a.texture, u, d, a.matrix))
}
}
const i = this.indices.length
, o = this.points.length / 2;
if (r && r.end(i, o),
0 === this.batches.length)
return void (this.batchable = !0);
const s = o > 65535;
this.indicesUint16 && this.indices.length ===
this.indicesUint16.length && s === this.indicesUint16.BYTES_PER_ELEMENT > 2 ?
this.indicesUint16.set(this.indices) : this.indicesUint16 = s ? new
Uint32Array(this.indices) : new Uint16Array(this.indices),
this.batchable = this.isBatchable(),
this.batchable ? this.packBatches() : this.buildDrawCalls()
}
_compareStyles(e, t) {
return !(!e || !t || e.texture.baseTexture !==
t.texture.baseTexture || e.color + e.alpha !== t.color + t.alpha || !!e.native !
= !!t.native)
}
validateBatching() {
if (this.dirty === this.cacheDirty || !this.graphicsData.length)
return !1;
for (let e = 0, t = this.graphicsData.length; e < t; e++) {
const t = this.graphicsData[e]
, r = t.fillStyle
, n = t.lineStyle;
if (r && !r.texture.baseTexture.valid || n && !
n.texture.baseTexture.valid)
return !1
}
return !0
}
packBatches() {
this.batchDirty++,
this.uvsFloat32 = new Float32Array(this.uvs);
const e = this.batches;
for (let t = 0, r = e.length; t < r; t++) {
const r = e[t];
for (let e = 0; e < r.size; e++) {
const t = r.start + e;
this.indicesUint16[t] = this.indicesUint16[t] -
r.attribStart
}
}
}
isBatchable() {
if (this.points.length > 131070)
return !1;
const t = this.batches;
for (let e = 0; e < t.length; e++)
if (t[e].style.native)
return !1;
return this.points.length < 2 * e.BATCHABLE_SIZE
}
buildDrawCalls() {
let e = ++BaseTexture._globalBatch;
for (let u = 0; u < this.drawCalls.length; u++)
this.drawCalls[u].texArray.clear(),
DRAW_CALL_POOL.push(this.drawCalls[u]);
this.drawCalls.length = 0;
const t = this.colors
, r = this.textureIds;
let n = DRAW_CALL_POOL.pop();
n || (n = new BatchDrawCall,
n.texArray = new BatchTextureArray),
n.texArray.count = 0,
n.start = 0,
n.size = 0,
n.type = DRAW_MODES.TRIANGLES;
let i = 0
, o = null
, s = 0
, a = !1
, l = DRAW_MODES.TRIANGLES
, c = 0;
this.drawCalls.push(n);
for (let u = 0; u < this.batches.length; u++) {
const d = this.batches[u]
, p = 8
, h = d.style
, f = h.texture.baseTexture;
a !== !!h.native && (a = !!h.native,
l = a ? DRAW_MODES.LINES : DRAW_MODES.TRIANGLES,
o = null,
i = p,
e++),
o !== f && (o = f,
f._batchEnabled !== e && (i === p && (e++,
i = 0,
n.size > 0 && (n = DRAW_CALL_POOL.pop(),
n || (n = new BatchDrawCall,
n.texArray = new BatchTextureArray),
this.drawCalls.push(n)),
n.start = c,
n.size = 0,
n.texArray.count = 0,
n.type = l),
f.touched = 1,
f._batchEnabled = e,
f._batchLocation = i,
f.wrapMode = WRAP_MODES.REPEAT,
n.texArray.elements[n.texArray.count++] = f,
i++)),
n.size += d.size,
c += d.size,
s = f._batchLocation,
this.addColors(t, h.color, h.alpha, d.attribSize,
d.attribStart),
this.addTextureIds(r, s, d.attribSize, d.attribStart)
}
BaseTexture._globalBatch = e,
this.packAttributes()
}
packAttributes() {
const e = this.points
, t = this.uvs
, r = this.colors
, n = this.textureIds
, i = new ArrayBuffer(3 * e.length * 4)
, o = new Float32Array(i)
, s = new Uint32Array(i);
let a = 0;
for (let l = 0; l < e.length / 2; l++)
o[a++] = e[2 * l],
o[a++] = e[2 * l + 1],
o[a++] = t[2 * l],
o[a++] = t[2 * l + 1],
s[a++] = r[l],
o[a++] = n[l];
this._buffer.update(i),
this._indexBuffer.update(this.indicesUint16)
}
processFill(e) {
e.holes.length ? buildPoly.triangulate(e, this) :
FILL_COMMANDS[e.type].triangulate(e, this)
}
processLine(e) {
buildLine(e, this);
for (let t = 0; t < e.holes.length; t++)
buildLine(e.holes[t], this)
}
processHoles(e) {
for (let t = 0; t < e.length; t++) {
const r = e[t];
FILL_COMMANDS[r.type].build(r),
r.matrix && this.transformPoints(r.points, r.matrix)
}
}
calculateBounds() {
const e = this._bounds;
e.clear(),
e.addVertexData(this.points, 0, this.points.length),
e.pad(this.boundsPadding, this.boundsPadding)
}
transformPoints(e, t) {
for (let r = 0; r < e.length / 2; r++) {
const n = e[2 * r]
, i = e[2 * r + 1];
e[2 * r] = t.a * n + t.c * i + t.tx,
e[2 * r + 1] = t.b * n + t.d * i + t.ty
}
}
addColors(e, t, r, n, i=0) {
const o = Color$2.shared.setValue(t).toLittleEndianNumber()
, s = Color$2.shared.setValue(o).toPremultiplied(r);
e.length = Math.max(e.length, i + n);
for (let a = 0; a < n; a++)
e[i + a] = s
}
addTextureIds(e, t, r, n=0) {
e.length = Math.max(e.length, n + r);
for (let i = 0; i < r; i++)
e[n + i] = t
}
addUvs(e, t, r, n, i, o=null) {
let s = 0;
const a = t.length
, l = r.frame;
for (; s < i; ) {
let r = e[2 * (n + s)]
, i = e[2 * (n + s) + 1];
if (o) {
const e = o.a * r + o.c * i + o.tx;
i = o.b * r + o.d * i + o.ty,
r = e
}
s++,
t.push(r / l.width, i / l.height)
}
const c = r.baseTexture;
(l.width < c.width || l.height < c.height) && this.adjustUvs(t, r,
a, i)
}
adjustUvs(e, t, r, n) {
const i = t.baseTexture
, o = 1e-6
, s = r + 2 * n
, a = t.frame
, l = a.width / i.width
, c = a.height / i.height;
let u = a.x / a.width
, d = a.y / a.height
, p = Math.floor(e[r] + o)
, h = Math.floor(e[r + 1] + o);
for (let f = r + 2; f < s; f += 2)
p = Math.min(p, Math.floor(e[f] + o)),
h = Math.min(h, Math.floor(e[f + 1] + o));
u -= p,
d -= h;
for (let f = r; f < s; f += 2)
e[f] = (e[f] + u) * l,
e[f + 1] = (e[f + 1] + d) * c
}
}
;
_GraphicsGeometry.BATCHABLE_SIZE = 100;
let GraphicsGeometry = _GraphicsGeometry;
class FillStyle {
constructor() {
this.color = 16777215,
this.alpha = 1,
this.texture = Texture.WHITE,
this.matrix = null,
this.visible = !1,
this.reset()
}
clone() {
const e = new FillStyle;
return e.color = this.color,
e.alpha = this.alpha,
e.texture = this.texture,
e.matrix = this.matrix,
e.visible = this.visible,
e
}
reset() {
this.color = 16777215,
this.alpha = 1,
this.texture = Texture.WHITE,
this.matrix = null,
this.visible = !1
}
destroy() {
this.texture = null,
this.matrix = null
}
}
class LineStyle extends FillStyle {
constructor() {
super(...arguments),
this.width = 0,
this.alignment = .5,
this.native = !1,
this.cap = LINE_CAP.BUTT,
this.join = LINE_JOIN.MITER,
this.miterLimit = 10
}
clone() {
const e = new LineStyle;
return e.color = this.color,
e.alpha = this.alpha,
e.texture = this.texture,
e.matrix = this.matrix,
e.visible = this.visible,
e.width = this.width,
e.alignment = this.alignment,
e.native = this.native,
e.cap = this.cap,
e.join = this.join,
e.miterLimit = this.miterLimit,
e
}
reset() {
super.reset(),
this.color = 0,
this.alignment = .5,
this.width = 0,
this.native = !1,
this.cap = LINE_CAP.BUTT,
this.join = LINE_JOIN.MITER,
this.miterLimit = 10
}
}
const DEFAULT_SHADERS = {}
, _Graphics = class e extends Container {
constructor(e=null) {
super(),
this.shader = null,
this.pluginName = "batch",
this.currentPath = null,
this.batches = [],
this.batchTint = -1,
this.batchDirty = -1,
this.vertexData = null,
this._fillStyle = new FillStyle,
this._lineStyle = new LineStyle,
this._matrix = null,
this._holeMode = !1,
this.state = State.for2d(),
this._geometry = e || new GraphicsGeometry,
this._geometry.refCount++,
this._transformID = -1,
this._tintColor = new Color$2(16777215),
this.blendMode = BLEND_MODES.NORMAL
}
get geometry() {
return this._geometry
}
clone() {
return this.finishPoly(),
new e(this._geometry)
}
set blendMode(e) {
this.state.blendMode = e
}
get blendMode() {
return this.state.blendMode
}
get tint() {
return this._tintColor.value
}
set tint(e) {
this._tintColor.setValue(e)
}
get fill() {
return this._fillStyle
}
get line() {
return this._lineStyle
}
lineStyle(e=null, t=0, r, n=.5, i=!1) {
return "number" == typeof e && (e = {
width: e,
color: t,
alpha: r,
alignment: n,
native: i
}),
this.lineTextureStyle(e)
}
lineTextureStyle(e) {
const t = {
width: 0,
texture: Texture.WHITE,
color: (null == e ? void 0 : e.texture) ? 16777215 : 0,
matrix: null,
alignment: .5,
native: !1,
cap: LINE_CAP.BUTT,
join: LINE_JOIN.MITER,
miterLimit: 10
};
e = Object.assign(t, e),
this.normalizeColor(e),
this.currentPath && this.startPoly();
const r = e.width > 0 && e.alpha > 0;
return r ? (e.matrix && (e.matrix = e.matrix.clone(),
e.matrix.invert()),
Object.assign(this._lineStyle, {
visible: r
}, e)) : this._lineStyle.reset(),
this
}
startPoly() {
if (this.currentPath) {
const e = this.currentPath.points
, t = this.currentPath.points.length;
t > 2 && (this.drawShape(this.currentPath),
this.currentPath = new Polygon,
this.currentPath.closeStroke = !1,
this.currentPath.points.push(e[t - 2], e[t - 1]))
} else
this.currentPath = new Polygon,
this.currentPath.closeStroke = !1
}
finishPoly() {
this.currentPath && (this.currentPath.points.length > 2 ?
(this.drawShape(this.currentPath),
this.currentPath = null) : this.currentPath.points.length = 0)
}
moveTo(e, t) {
return this.startPoly(),
this.currentPath.points[0] = e,
this.currentPath.points[1] = t,
this
}
lineTo(e, t) {
this.currentPath || this.moveTo(0, 0);
const r = this.currentPath.points
, n = r[r.length - 2]
, i = r[r.length - 1];
return (n !== e || i !== t) && r.push(e, t),
this
}
_initCurve(e=0, t=0) {
this.currentPath ? 0 === this.currentPath.points.length &&
(this.currentPath.points = [e, t]) : this.moveTo(e, t)
}
quadraticCurveTo(e, t, r, n) {
this._initCurve();
const i = this.currentPath.points;
return 0 === i.length && this.moveTo(0, 0),
QuadraticUtils.curveTo(e, t, r, n, i),
this
}
bezierCurveTo(e, t, r, n, i, o) {
return this._initCurve(),
BezierUtils.curveTo(e, t, r, n, i, o, this.currentPath.points),
this
}
arcTo(e, t, r, n, i) {
this._initCurve(e, t);
const o = this.currentPath.points
, s = ArcUtils.curveTo(e, t, r, n, i, o);
if (s) {
const {cx: e, cy: t, radius: r, startAngle: n, endAngle: i,
anticlockwise: o} = s;
this.arc(e, t, r, n, i, o)
}
return this
}
arc(e, t, r, n, i, o=!1) {
if (n === i)
return this;
if (!o && i <= n ? i += PI_2 : o && n <= i && (n += PI_2),
i - n == 0)
return this;
const s = e + Math.cos(n) * r
, a = t + Math.sin(n) * r
, l = this._geometry.closePointEps;
let c = this.currentPath ? this.currentPath.points : null;
if (c) {
const e = Math.abs(c[c.length - 2] - s)
, t = Math.abs(c[c.length - 1] - a);
e < l && t < l || c.push(s, a)
} else
this.moveTo(s, a),
c = this.currentPath.points;
return ArcUtils.arc(s, a, e, t, r, n, i, o, c),
this
}
beginFill(e=0, t) {
return this.beginTextureFill({
texture: Texture.WHITE,
color: e,
alpha: t
})
}
normalizeColor(e) {
const t = Color$2.shared.setValue(e.color ?? 0);
e.color = t.toNumber(),
e.alpha ?? (e.alpha = t.alpha)
}
beginTextureFill(e) {
const t = {
texture: Texture.WHITE,
color: 16777215,
matrix: null
};
e = Object.assign(t, e),
this.normalizeColor(e),
this.currentPath && this.startPoly();
const r = e.alpha > 0;
return r ? (e.matrix && (e.matrix = e.matrix.clone(),
e.matrix.invert()),
Object.assign(this._fillStyle, {
visible: r
}, e)) : this._fillStyle.reset(),
this
}
endFill() {
return this.finishPoly(),
this._fillStyle.reset(),
this
}
drawRect(e, t, r, n) {
return this.drawShape(new Rectangle(e,t,r,n))
}
drawRoundedRect(e, t, r, n, i) {
return this.drawShape(new RoundedRectangle(e,t,r,n,i))
}
drawCircle(e, t, r) {
return this.drawShape(new Circle$1(e,t,r))
}
drawEllipse(e, t, r, n) {
return this.drawShape(new Ellipse(e,t,r,n))
}
drawPolygon(...e) {
let t, r = !0;
const n = e[0];
n.points ? (r = n.closeStroke,
t = n.points) : t = Array.isArray(e[0]) ? e[0] : e;
const i = new Polygon(t);
return i.closeStroke = r,
this.drawShape(i),
this
}
drawShape(e) {
return this._holeMode ? this._geometry.drawHole(e, this._matrix) :
this._geometry.drawShape(e, this._fillStyle.clone(), this._lineStyle.clone(),
this._matrix),
this
}
clear() {
return this._geometry.clear(),
this._lineStyle.reset(),
this._fillStyle.reset(),
this._boundsID++,
this._matrix = null,
this._holeMode = !1,
this.currentPath = null,
this
}
isFastRect() {
const e = this._geometry.graphicsData;
return !(1 !== e.length || e[0].shape.type !== SHAPES.RECT ||
e[0].matrix || e[0].holes.length || e[0].lineStyle.visible && e[0].lineStyle.width)
}
_render(e) {
this.finishPoly();
const t = this._geometry;
t.updateBatches(),
t.batchable ? (this.batchDirty !== t.batchDirty &&
this._populateBatches(),
this._renderBatched(e)) : (e.batch.flush(),
this._renderDirect(e))
}
_populateBatches() {
const e = this._geometry
, t = this.blendMode
, r = e.batches.length;
this.batchTint = -1,
this._transformID = -1,
this.batchDirty = e.batchDirty,
this.batches.length = r,
this.vertexData = new Float32Array(e.points);
for (let n = 0; n < r; n++) {
const r = e.batches[n]
, i = r.style.color
, o = new Float32Array(this.vertexData.buffer,4 *
r.attribStart * 2,2 * r.attribSize)
, s = new Float32Array(e.uvsFloat32.buffer,4 * r.attribStart
* 2,2 * r.attribSize)
, a = {
vertexData: o,
blendMode: t,
indices: new Uint16Array(e.indicesUint16.buffer,2 *
r.start,r.size),
uvs: s,
_batchRGB: Color$2.shared.setValue(i).toRgbArray(),
_tintRGB: i,
_texture: r.style.texture,
alpha: r.style.alpha,
worldAlpha: 1
};
this.batches[n] = a
}
}
_renderBatched(e) {
if (this.batches.length) {
e.batch.setObjectRenderer(e.plugins[this.pluginName]),
this.calculateVertices(),
this.calculateTints();
for (let t = 0, r = this.batches.length; t < r; t++) {
const r = this.batches[t];
r.worldAlpha = this.worldAlpha * r.alpha,
e.plugins[this.pluginName].render(r)
}
}
}
_renderDirect(e) {
const t = this._resolveDirectShader(e)
, r = this._geometry
, n = this.worldAlpha
, i = t.uniforms
, o = r.drawCalls;
i.translationMatrix = this.transform.worldTransform,
Color$2.shared.setValue(this._tintColor).premultiply(n).toArray(i.tint),
e.shader.bind(t),
e.geometry.bind(r, t),
e.state.set(this.state);
for (let s = 0, a = o.length; s < a; s++)
this._renderDrawCallDirect(e, r.drawCalls[s])
}
_renderDrawCallDirect(e, t) {
const {texArray: r, type: n, size: i, start: o} = t
, s = r.count;
for (let a = 0; a < s; a++)
e.texture.bind(r.elements[a], a);
e.geometry.draw(n, i, o)
}
_resolveDirectShader(e) {
let t = this.shader;
const r = this.pluginName;
if (!t) {
if (!DEFAULT_SHADERS[r]) {
const {maxTextures: t} = e.plugins[r]
, n = new Int32Array(t);
for (let e = 0; e < t; e++)
n[e] = e;
const i = {
tint: new Float32Array([1, 1, 1, 1]),
translationMatrix: new Matrix,
default: UniformGroup.from({
uSamplers: n
}, !0)
}
, o = e.plugins[r]._shader.program;
DEFAULT_SHADERS[r] = new Shader(o,i)
}
t = DEFAULT_SHADERS[r]
}
return t
}
_calculateBounds() {
this.finishPoly();
const e = this._geometry;
if (!e.graphicsData.length)
return;
const {minX: t, minY: r, maxX: n, maxY: i} = e.bounds;
this._bounds.addFrame(this.transform, t, r, n, i)
}
containsPoint(t) {
return this.worldTransform.applyInverse(t, e._TEMP_POINT),
this._geometry.containsPoint(e._TEMP_POINT)
}
calculateTints() {
if (this.batchTint !== this.tint) {
this.batchTint = this._tintColor.toNumber();
for (let e = 0; e < this.batches.length; e++) {
const t = this.batches[e];
t._tintRGB =
Color$2.shared.setValue(this._tintColor).multiply(t._batchRGB).toLittleEndianNumber
()
}
}
}
calculateVertices() {
const e = this.transform._worldID;
if (this._transformID === e)
return;
this._transformID = e;
const t = this.transform.worldTransform
, r = t.a
, n = t.b
, i = t.c
, o = t.d
, s = t.tx
, a = t.ty
, l = this._geometry.points
, c = this.vertexData;
let u = 0;
for (let d = 0; d < l.length; d += 2) {
const e = l[d]
, t = l[d + 1];
c[u++] = r * e + i * t + s,
c[u++] = o * t + n * e + a
}
}
closePath() {
const e = this.currentPath;
return e && (e.closeStroke = !0,
this.finishPoly()),
this
}
setMatrix(e) {
return this._matrix = e,
this
}
beginHole() {
return this.finishPoly(),
this._holeMode = !0,
this
}
endHole() {
return this.finishPoly(),
this._holeMode = !1,
this
}
destroy(e) {
this._geometry.refCount--,
0 === this._geometry.refCount && this._geometry.dispose(),
this._matrix = null,
this.currentPath = null,
this._lineStyle.destroy(),
this._lineStyle = null,
this._fillStyle.destroy(),
this._fillStyle = null,
this._geometry = null,
this.shader = null,
this.vertexData = null,
this.batches.length = 0,
this.batches = null,
super.destroy(e)
}
}
;
_Graphics.curves = curves,
_Graphics._TEMP_POINT = new Point;
let Graphics = _Graphics;
class MeshBatchUvs {
constructor(e, t) {
this.uvBuffer = e,
this.uvMatrix = t,
this.data = null,
this._bufferUpdateId = -1,
this._textureUpdateId = -1,
this._updateID = 0
}
update(e) {
if (!e && this._bufferUpdateId === this.uvBuffer._updateID &&
this._textureUpdateId === this.uvMatrix._updateID)
return;
this._bufferUpdateId = this.uvBuffer._updateID,
this._textureUpdateId = this.uvMatrix._updateID;
const t = this.uvBuffer.data;
(!this.data || this.data.length !== t.length) && (this.data = new
Float32Array(t.length)),
this.uvMatrix.multiplyUvs(t, this.data),
this._updateID++
}
}
const tempPoint = new Point
, tempPolygon = new Polygon
, _Mesh = class e extends Container {
constructor(e, t, r, n=DRAW_MODES.TRIANGLES) {
super(),
this.geometry = e,
this.shader = t,
this.state = r || State.for2d(),
this.drawMode = n,
this.start = 0,
this.size = 0,
this.uvs = null,
this.indices = null,
this.vertexData = new Float32Array(1),
this.vertexDirty = -1,
this._transformID = -1,
this._roundPixels = settings.ROUND_PIXELS,
this.batchUvs = null
}
get geometry() {
return this._geometry
}
set geometry(e) {
this._geometry !== e && (this._geometry &&
(this._geometry.refCount--,
0 === this._geometry.refCount && this._geometry.dispose()),
this._geometry = e,
this._geometry && this._geometry.refCount++,
this.vertexDirty = -1)
}
get uvBuffer() {
return this.geometry.buffers[1]
}
get verticesBuffer() {
return this.geometry.buffers[0]
}
set material(e) {
this.shader = e
}
get material() {
return this.shader
}
set blendMode(e) {
this.state.blendMode = e
}
get blendMode() {
return this.state.blendMode
}
set roundPixels(e) {
this._roundPixels !== e && (this._transformID = -1),
this._roundPixels = e
}
get roundPixels() {
return this._roundPixels
}
get tint() {
return "tint"in this.shader ? this.shader.tint : null
}
set tint(e) {
this.shader.tint = e
}
get tintValue() {
return this.shader.tintValue
}
get texture() {
return "texture"in this.shader ? this.shader.texture : null
}
set texture(e) {
this.shader.texture = e
}
_render(t) {
const r = this.geometry.buffers[0].data;
this.shader.batchable && this.drawMode === DRAW_MODES.TRIANGLES &&
r.length < 2 * e.BATCHABLE_SIZE ? this._renderToBatch(t) : this._renderDefault(t)
}
_renderDefault(e) {
const t = this.shader;
t.alpha = this.worldAlpha,
t.update && t.update(),
e.batch.flush(),
t.uniforms.translationMatrix =
this.transform.worldTransform.toArray(!0),
e.shader.bind(t),
e.state.set(this.state),
e.geometry.bind(this.geometry, t),
e.geometry.draw(this.drawMode, this.size, this.start,
this.geometry.instanceCount)
}
_renderToBatch(e) {
const t = this.geometry
, r = this.shader;
r.uvMatrix && (r.uvMatrix.update(),
this.calculateUvs()),
this.calculateVertices(),
this.indices = t.indexBuffer.data,
this._tintRGB = r._tintRGB,
this._texture = r.texture;
const n = this.material.pluginName;
e.batch.setObjectRenderer(e.plugins[n]),
e.plugins[n].render(this)
}
calculateVertices() {
const e = this.geometry.buffers[0]
, t = e.data
, r = e._updateID;
if (r === this.vertexDirty && this._transformID ===
this.transform._worldID)
return;
this._transformID = this.transform._worldID,
this.vertexData.length !== t.length && (this.vertexData = new
Float32Array(t.length));
const n = this.transform.worldTransform
, i = n.a
, o = n.b
, s = n.c
, a = n.d
, l = n.tx
, c = n.ty
, u = this.vertexData;
for (let d = 0; d < u.length / 2; d++) {
const e = t[2 * d]
, r = t[2 * d + 1];
u[2 * d] = i * e + s * r + l,
u[2 * d + 1] = o * e + a * r + c
}
if (this._roundPixels) {
const e = settings.RESOLUTION;
for (let t = 0; t < u.length; ++t)
u[t] = Math.round(u[t] * e) / e
}
this.vertexDirty = r
}
calculateUvs() {
const e = this.geometry.buffers[1]
, t = this.shader;
t.uvMatrix.isSimple ? this.uvs = e.data : (this.batchUvs ||
(this.batchUvs = new MeshBatchUvs(e,t.uvMatrix)),
this.batchUvs.update(),
this.uvs = this.batchUvs.data)
}
_calculateBounds() {
this.calculateVertices(),
this._bounds.addVertexData(this.vertexData, 0,
this.vertexData.length)
}
containsPoint(e) {
if (!this.getBounds().contains(e.x, e.y))
return !1;
this.worldTransform.applyInverse(e, tempPoint);
const t = this.geometry.getBuffer("aVertexPosition").data
, r = tempPolygon.points
, n = this.geometry.getIndex().data
, i = n.length
, o = 4 === this.drawMode ? 3 : 1;
for (let s = 0; s + 2 < i; s += o) {
const e = 2 * n[s]
, i = 2 * n[s + 1]
, o = 2 * n[s + 2];
if (r[0] = t[e],
r[1] = t[e + 1],
r[2] = t[i],
r[3] = t[i + 1],
r[4] = t[o],
r[5] = t[o + 1],
tempPolygon.contains(tempPoint.x, tempPoint.y))
return !0
}
return !1
}
destroy(e) {
super.destroy(e),
this._cachedTexture && (this._cachedTexture.destroy(),
this._cachedTexture = null),
this.geometry = null,
this.shader = null,
this.state = null,
this.uvs = null,
this.indices = null,
this.vertexData = null
}
}
;
_Mesh.BATCHABLE_SIZE = 100;
let Mesh = _Mesh;
class MeshGeometry extends Geometry {
constructor(e, t, r) {
super();
const n = new Buffer$3(e)
, i = new Buffer$3(t,!0)
, o = new Buffer$3(r,!0,!0);
this.addAttribute("aVertexPosition", n, 2, !1,
TYPES.FLOAT).addAttribute("aTextureCoord", i, 2, !1, TYPES.FLOAT).addIndex(o),
this._updateId = -1
}
get vertexDirtyId() {
return this.buffers[0]._updateID
}
}
var fragment$s = "varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\
nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor =
texture2D(uSampler, vTextureCoord) * uColor;\n}\n"
, vertex$1 = "attribute vec2 aVertexPosition;\nattribute vec2
aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\
nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\
n gl_Position = vec4((projectionMatrix * translationMatrix *
vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix *
vec3(aTextureCoord, 1.0)).xy;\n}\n";
class MeshMaterial extends Shader {
constructor(e, t) {
const r = {
uSampler: e,
alpha: 1,
uTextureMatrix: Matrix.IDENTITY,
uColor: new Float32Array([1, 1, 1, 1])
};
(t = Object.assign({
tint: 16777215,
alpha: 1,
pluginName: "batch"
}, t)).uniforms && Object.assign(r, t.uniforms),
super(t.program || Program.from(vertex$1, fragment$s), r),
this._colorDirty = !1,
this.uvMatrix = new TextureMatrix(e),
this.batchable = void 0 === t.program,
this.pluginName = t.pluginName,
this._tintColor = new Color$2(t.tint),
this._tintRGB = this._tintColor.toLittleEndianNumber(),
this._colorDirty = !0,
this.alpha = t.alpha
}
get texture() {
return this.uniforms.uSampler
}
set texture(e) {
this.uniforms.uSampler !== e && (!
this.uniforms.uSampler.baseTexture.alphaMode != !e.baseTexture.alphaMode &&
(this._colorDirty = !0),
this.uniforms.uSampler = e,
this.uvMatrix.texture = e)
}
set alpha(e) {
e !== this._alpha && (this._alpha = e,
this._colorDirty = !0)
}
get alpha() {
return this._alpha
}
set tint(e) {
e !== this.tint && (this._tintColor.setValue(e),
this._tintRGB = this._tintColor.toLittleEndianNumber(),
this._colorDirty = !0)
}
get tint() {
return this._tintColor.value
}
get tintValue() {
return this._tintColor.toNumber()
}
update() {
if (this._colorDirty) {
this._colorDirty = !1;
const e = this.texture.baseTexture.alphaMode;
Color$2.shared.setValue(this._tintColor).premultiply(this._alpha,
e).toArray(this.uniforms.uColor)
}
this.uvMatrix.update() && (this.uniforms.uTextureMatrix =
this.uvMatrix.mapCoord)
}
}
class ParticleBuffer {
constructor(e, t, r) {
this.geometry = new Geometry,
this.indexBuffer = null,
this.size = r,
this.dynamicProperties = [],
this.staticProperties = [];
for (let n = 0; n < e.length; ++n) {
let r = e[n];
r = {
attributeName: r.attributeName,
size: r.size,
uploadFunction: r.uploadFunction,
type: r.type || TYPES.FLOAT,
offset: r.offset
},
t[n] ? this.dynamicProperties.push(r) :
this.staticProperties.push(r)
}
this.staticStride = 0,
this.staticBuffer = null,
this.staticData = null,
this.staticDataUint32 = null,
this.dynamicStride = 0,
this.dynamicBuffer = null,
this.dynamicData = null,
this.dynamicDataUint32 = null,
this._updateID = 0,
this.initBuffers()
}
initBuffers() {
const e = this.geometry;
let t = 0;
this.indexBuffer = new Buffer$3(createIndicesForQuads(this.size),!
0,!0),
e.addIndex(this.indexBuffer),
this.dynamicStride = 0;
for (let o = 0; o < this.dynamicProperties.length; ++o) {
const e = this.dynamicProperties[o];
e.offset = t,
t += e.size,
this.dynamicStride += e.size
}
const r = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);
this.dynamicData = new Float32Array(r),
this.dynamicDataUint32 = new Uint32Array(r),
this.dynamicBuffer = new Buffer$3(this.dynamicData,!1,!1);
let n = 0;
this.staticStride = 0;
for (let o = 0; o < this.staticProperties.length; ++o) {
const e = this.staticProperties[o];
e.offset = n,
n += e.size,
this.staticStride += e.size
}
const i = new ArrayBuffer(this.size * this.staticStride * 4 * 4);
this.staticData = new Float32Array(i),
this.staticDataUint32 = new Uint32Array(i),
this.staticBuffer = new Buffer$3(this.staticData,!0,!1);
for (let o = 0; o < this.dynamicProperties.length; ++o) {
const t = this.dynamicProperties[o];
e.addAttribute(t.attributeName, this.dynamicBuffer, 0, t.type
=== TYPES.UNSIGNED_BYTE, t.type, 4 * this.dynamicStride, 4 * t.offset)
}
for (let o = 0; o < this.staticProperties.length; ++o) {
const t = this.staticProperties[o];
e.addAttribute(t.attributeName, this.staticBuffer, 0, t.type
=== TYPES.UNSIGNED_BYTE, t.type, 4 * this.staticStride, 4 * t.offset)
}
}
uploadDynamic(e, t, r) {
for (let n = 0; n < this.dynamicProperties.length; n++) {
const i = this.dynamicProperties[n];
i.uploadFunction(e, t, r, i.type === TYPES.UNSIGNED_BYTE ?
this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, i.offset)
}
this.dynamicBuffer._updateID++
}
uploadStatic(e, t, r) {
for (let n = 0; n < this.staticProperties.length; n++) {
const i = this.staticProperties[n];
i.uploadFunction(e, t, r, i.type === TYPES.UNSIGNED_BYTE ?
this.staticDataUint32 : this.staticData, this.staticStride, i.offset)
}
this.staticBuffer._updateID++
}
destroy() {
this.indexBuffer = null,
this.dynamicProperties = null,
this.dynamicBuffer = null,
this.dynamicData = null,
this.dynamicDataUint32 = null,
this.staticProperties = null,
this.staticBuffer = null,
this.staticData = null,
this.staticDataUint32 = null,
this.geometry.destroy()
}
}
var fragment$r = "varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\
nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color =
texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}"
, vertex = "attribute vec2 aVertexPosition;\nattribute vec2
aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute
float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\
nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x
= (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n
float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) *
cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n
gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n
vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n";
class ParticleRenderer extends ObjectRenderer {
constructor(e) {
super(e),
this.shader = null,
this.properties = null,
this.tempMatrix = new Matrix,
this.properties = [{
attributeName: "aVertexPosition",
size: 2,
uploadFunction: this.uploadVertices,
offset: 0
}, {
attributeName: "aPositionCoord",
size: 2,
uploadFunction: this.uploadPosition,
offset: 0
}, {
attributeName: "aRotation",
size: 1,
uploadFunction: this.uploadRotation,
offset: 0
}, {
attributeName: "aTextureCoord",
size: 2,
uploadFunction: this.uploadUvs,
offset: 0
}, {
attributeName: "aColor",
size: 1,
type: TYPES.UNSIGNED_BYTE,
uploadFunction: this.uploadTint,
offset: 0
}],
this.shader = Shader.from(vertex, fragment$r, {}),
this.state = State.for2d()
}
render(e) {
const t = e.children
, r = e._maxSize
, n = e._batchSize
, i = this.renderer;
let o = t.length;
if (0 === o)
return;
o > r && !e.autoResize && (o = r);
let s = e._buffers;
s || (s = e._buffers = this.generateBuffers(e));
const a = t[0]._texture.baseTexture
, l = a.alphaMode > 0;
this.state.blendMode = correctBlendMode(e.blendMode, l),
i.state.set(this.state);
const c = i.gl
, u = e.worldTransform.copyTo(this.tempMatrix);
u.prepend(i.globalUniforms.uniforms.projectionMatrix),
this.shader.uniforms.translationMatrix = u.toArray(!0),
this.shader.uniforms.uColor =
Color$2.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,
l).toArray(this.shader.uniforms.uColor),
this.shader.uniforms.uSampler = a,
this.renderer.shader.bind(this.shader);
let d = !1;
for (let p = 0, h = 0; p < o; p += n,
h += 1) {
let r = o - p;
r > n && (r = n),
h >= s.length && s.push(this._generateOneMoreBuffer(e));
const a = s[h];
a.uploadDynamic(t, p, r);
const l = e._bufferUpdateIDs[h] || 0;
d = d || a._updateID < l,
d && (a._updateID = e._updateID,
a.uploadStatic(t, p, r)),
i.geometry.bind(a.geometry),
c.drawElements(c.TRIANGLES, 6 * r, c.UNSIGNED_SHORT, 0)
}
}
generateBuffers(e) {
const t = []
, r = e._maxSize
, n = e._batchSize
, i = e._properties;
for (let o = 0; o < r; o += n)
t.push(new ParticleBuffer(this.properties,i,n));
return t
}
_generateOneMoreBuffer(e) {
const t = e._batchSize
, r = e._properties;
return new ParticleBuffer(this.properties,r,t)
}
uploadVertices(e, t, r, n, i, o) {
let s = 0
, a = 0
, l = 0
, c = 0;
for (let u = 0; u < r; ++u) {
const r = e[t + u]
, d = r._texture
, p = r.scale.x
, h = r.scale.y
, f = d.trim
, m = d.orig;
f ? (a = f.x - r.anchor.x * m.width,
s = a + f.width,
c = f.y - r.anchor.y * m.height,
l = c + f.height) : (s = m.width * (1 - r.anchor.x),
a = m.width * -r.anchor.x,
l = m.height * (1 - r.anchor.y),
c = m.height * -r.anchor.y),
n[o] = a * p,
n[o + 1] = c * h,
n[o + i] = s * p,
n[o + i + 1] = c * h,
n[o + 2 * i] = s * p,
n[o + 2 * i + 1] = l * h,
n[o + 3 * i] = a * p,
n[o + 3 * i + 1] = l * h,
o += 4 * i
}
}
uploadPosition(e, t, r, n, i, o) {
for (let s = 0; s < r; s++) {
const r = e[t + s].position;
n[o] = r.x,
n[o + 1] = r.y,
n[o + i] = r.x,
n[o + i + 1] = r.y,
n[o + 2 * i] = r.x,
n[o + 2 * i + 1] = r.y,
n[o + 3 * i] = r.x,
n[o + 3 * i + 1] = r.y,
o += 4 * i
}
}
uploadRotation(e, t, r, n, i, o) {
for (let s = 0; s < r; s++) {
const r = e[t + s].rotation;
n[o] = r,
n[o + i] = r,
n[o + 2 * i] = r,
n[o + 3 * i] = r,
o += 4 * i
}
}
uploadUvs(e, t, r, n, i, o) {
for (let s = 0; s < r; ++s) {
const r = e[t + s]._texture._uvs;
r ? (n[o] = r.x0,
n[o + 1] = r.y0,
n[o + i] = r.x1,
n[o + i + 1] = r.y1,
n[o + 2 * i] = r.x2,
n[o + 2 * i + 1] = r.y2,
n[o + 3 * i] = r.x3,
n[o + 3 * i + 1] = r.y3,
o += 4 * i) : (n[o] = 0,
n[o + 1] = 0,
n[o + i] = 0,
n[o + i + 1] = 0,
n[o + 2 * i] = 0,
n[o + 2 * i + 1] = 0,
n[o + 3 * i] = 0,
n[o + 3 * i + 1] = 0,
o += 4 * i)
}
}
uploadTint(e, t, r, n, i, o) {
for (let s = 0; s < r; ++s) {
const r = e[t + s]
, a =
Color$2.shared.setValue(r._tintRGB).toPremultiplied(r.alpha,
r.texture.baseTexture.alphaMode > 0);
n[o] = a,
n[o + i] = a,
n[o + 2 * i] = a,
n[o + 3 * i] = a,
o += 4 * i
}
}
destroy() {
super.destroy(),
this.shader && (this.shader.destroy(),
this.shader = null),
this.tempMatrix = null
}
}
ParticleRenderer.extension = {
name: "particle",
type: ExtensionType.RendererPlugin
},
extensions$1.add(ParticleRenderer);
var TEXT_GRADIENT = (e => (e[e.LINEAR_VERTICAL = 0] = "LINEAR_VERTICAL",
e[e.LINEAR_HORIZONTAL = 1] = "LINEAR_HORIZONTAL",
e))(TEXT_GRADIENT || {});
const contextSettings = {
willReadFrequently: !0
}
, _TextMetrics = class e {
static get experimentalLetterSpacingSupported() {
let t = e._experimentalLetterSpacingSupported;
if (void 0 !== t) {
const r =
settings.ADAPTER.getCanvasRenderingContext2D().prototype;
t = e._experimentalLetterSpacingSupported = "letterSpacing"in r
|| "textLetterSpacing"in r
}
return t
}
constructor(e, t, r, n, i, o, s, a, l) {
this.text = e,
this.style = t,
this.width = r,
this.height = n,
this.lines = i,
this.lineWidths = o,
this.lineHeight = s,
this.maxLineWidth = a,
this.fontProperties = l
}
static measureText(t, r, n, i=e._canvas) {
n = n ?? r.wordWrap;
const o = r.toFontString()
, s = e.measureFont(o);
0 === s.fontSize && (s.fontSize = r.fontSize,
s.ascent = r.fontSize);
const a = i.getContext("2d", contextSettings);
a.font = o;
const l = (n ? e.wordWrap(t, r, i) : t).split(/(?:\r\n|\r|\n)/)
, c = new Array(l.length);
let u = 0;
for (let f = 0; f < l.length; f++) {
const t = e._measureText(l[f], r.letterSpacing, a);
c[f] = t,
u = Math.max(u, t)
}
let d = u + r.strokeThickness;
r.dropShadow && (d += r.dropShadowDistance);
const p = r.lineHeight || s.fontSize + r.strokeThickness;
let h = Math.max(p, s.fontSize + 2 * r.strokeThickness) + r.leading
+ (l.length - 1) * (p + r.leading);
return r.dropShadow && (h += r.dropShadowDistance),
new e(t,r,d,h,l,c,p + r.leading,u,s)
}
static _measureText(t, r, n) {
let i = !1;
e.experimentalLetterSpacingSupported &&
(e.experimentalLetterSpacing ? (n.letterSpacing = `${r}px`,
n.textLetterSpacing = `${r}px`,
i = !0) : (n.letterSpacing = "0px",
n.textLetterSpacing = "0px"));
let o = n.measureText(t).width;
return o > 0 && (i ? o -= r : o += (e.graphemeSegmenter(t).length -
1) * r),
o
}
static wordWrap(t, r, n=e._canvas) {
const i = n.getContext("2d", contextSettings);
let o = 0
, s = ""
, a = "";
const l = Object.create(null)
, {letterSpacing: c, whiteSpace: u} = r
, d = e.collapseSpaces(u)
, p = e.collapseNewlines(u);
let h = !d;
const f = r.wordWrapWidth + c
, m = e.tokenize(t);
for (let g = 0; g < m.length; g++) {
let t = m[g];
if (e.isNewline(t)) {
if (!p) {
a += e.addLine(s),
h = !d,
s = "",
o = 0;
continue
}
t = " "
}
if (d) {
const r = e.isBreakingSpace(t)
, n = e.isBreakingSpace(s[s.length - 1]);
if (r && n)
continue
}
const n = e.getFromCache(t, c, l, i);
if (n > f)
if ("" !== s && (a += e.addLine(s),
s = "",
o = 0),
e.canBreakWords(t, r.breakWords)) {
const n = e.wordWrapSplit(t);
for (let u = 0; u < n.length; u++) {
let d = n[u]
, p = d
, m = 1;
for (; n[u + m]; ) {
const i = n[u + m];
if (e.canBreakChars(p, i, t, u, r.breakWords))
break;
d += i,
p = i,
m++
}
u += m - 1;
const g = e.getFromCache(d, c, l, i);
g + o > f && (a += e.addLine(s),
h = !1,
s = "",
o = 0),
s += d,
o += g
}
} else {
s.length > 0 && (a += e.addLine(s),
s = "",
o = 0);
const r = g === m.length - 1;
a += e.addLine(t, !r),
h = !1,
s = "",
o = 0
}
else
n + o > f && (h = !1,
a += e.addLine(s),
s = "",
o = 0),
(s.length > 0 || !e.isBreakingSpace(t) || h) && (s += t,
o += n)
}
return a += e.addLine(s, !1),
a
}
static addLine(t, r=!0) {
return t = e.trimRight(t),
t = r ? `${t}\n` : t
}
static getFromCache(t, r, n, i) {
let o = n[t];
return "number" != typeof o && (o = e._measureText(t, r, i) + r,
n[t] = o),
o
}
static collapseSpaces(e) {
return "normal" === e || "pre-line" === e
}
static collapseNewlines(e) {
return "normal" === e
}
static trimRight(t) {
if ("string" != typeof t)
return "";
for (let r = t.length - 1; r >= 0; r--) {
const n = t[r];
if (!e.isBreakingSpace(n))
break;
t = t.slice(0, -1)
}
return t
}
static isNewline(t) {
return "string" == typeof t &&
e._newlines.includes(t.charCodeAt(0))
}
static isBreakingSpace(t, r) {
return "string" == typeof t &&
e._breakingSpaces.includes(t.charCodeAt(0))
}
static tokenize(t) {
const r = [];
let n = "";
if ("string" != typeof t)
return r;
for (let i = 0; i < t.length; i++) {
const o = t[i]
, s = t[i + 1];
e.isBreakingSpace(o, s) || e.isNewline(o) ? ("" !== n &&
(r.push(n),
n = ""),
r.push(o)) : n += o
}
return "" !== n && r.push(n),
r
}
static canBreakWords(e, t) {
return t
}
static canBreakChars(e, t, r, n, i) {
return !0
}
static wordWrapSplit(t) {
return e.graphemeSegmenter(t)
}
static measureFont(t) {
if (e._fonts[t])
return e._fonts[t];
const r = {
ascent: 0,
descent: 0,
fontSize: 0
}
, n = e._canvas
, i = e._context;
i.font = t;
const o = e.METRICS_STRING + e.BASELINE_SYMBOL
, s = Math.ceil(i.measureText(o).width);
let a = Math.ceil(i.measureText(e.BASELINE_SYMBOL).width);
const l = Math.ceil(e.HEIGHT_MULTIPLIER * a);
if (a = a * e.BASELINE_MULTIPLIER | 0,
0 === s || 0 === l)
return e._fonts[t] = r,
r;
n.width = s,
n.height = l,
i.fillStyle = "#f00",
i.fillRect(0, 0, s, l),
i.font = t,
i.textBaseline = "alphabetic",
i.fillStyle = "#000",
i.fillText(o, 0, a);
const c = i.getImageData(0, 0, s, l).data
, u = c.length
, d = 4 * s;
let p = 0
, h = 0
, f = !1;
for (p = 0; p < a; ++p) {
for (let e = 0; e < d; e += 4)
if (255 !== c[h + e]) {
f = !0;
break
}
if (f)
break;
h += d
}
for (r.ascent = a - p,
h = u - d,
f = !1,
p = l; p > a; --p) {
for (let e = 0; e < d; e += 4)
if (255 !== c[h + e]) {
f = !0;
break
}
if (f)
break;
h -= d
}
return r.descent = p - a,
r.fontSize = r.ascent + r.descent,
e._fonts[t] = r,
r
}
static clearMetrics(t="") {
t ? delete e._fonts[t] : e._fonts = {}
}
static get _canvas() {
var t;
if (!e.__canvas) {
let r;
try {
const n = new OffscreenCanvas(0,0);
if (null == (t = n.getContext("2d", contextSettings)) ?
void 0 : t.measureText)
return e.__canvas = n,
n;
r = settings.ADAPTER.createCanvas()
} catch {
r = settings.ADAPTER.createCanvas()
}
r.width = r.height = 10,
e.__canvas = r
}
return e.__canvas
}
static get _context() {
return e.__context || (e.__context = e._canvas.getContext("2d",
contextSettings)),
e.__context
}
}
;
_TextMetrics.METRICS_STRING = "|ÉqÅ",
_TextMetrics.BASELINE_SYMBOL = "M",
_TextMetrics.BASELINE_MULTIPLIER = 1.4,
_TextMetrics.HEIGHT_MULTIPLIER = 2,
_TextMetrics.graphemeSegmenter = ( () => {
if ("function" == typeof (null == Intl ? void 0 : Intl.Segmenter)) {
const e = new Intl.Segmenter;
return t => [...e.segment(t)].map((e => e.segment))
}
return e => [...e]
}
)(),
_TextMetrics.experimentalLetterSpacing = !1,
_TextMetrics._fonts = {},
_TextMetrics._newlines = [10, 13],
_TextMetrics._breakingSpaces = [9, 32, 8192, 8193, 8194, 8195, 8196, 8197,
8198, 8200, 8201, 8202, 8287, 12288];
let TextMetrics = _TextMetrics;
const genericFontFamilies = ["serif", "sans-serif", "monospace", "cursive",
"fantasy", "system-ui"]
, _TextStyle = class e {
constructor(e) {
this.styleID = 0,
this.reset(),
deepCopyProperties(this, e, e)
}
clone() {
const t = {};
return deepCopyProperties(t, this, e.defaultStyle),
new e(t)
}
reset() {
deepCopyProperties(this, e.defaultStyle, e.defaultStyle)
}
get align() {
return this._align
}
set align(e) {
this._align !== e && (this._align = e,
this.styleID++)
}
get breakWords() {
return this._breakWords
}
set breakWords(e) {
this._breakWords !== e && (this._breakWords = e,
this.styleID++)
}
get dropShadow() {
return this._dropShadow
}
set dropShadow(e) {
this._dropShadow !== e && (this._dropShadow = e,
this.styleID++)
}
get dropShadowAlpha() {
return this._dropShadowAlpha
}
set dropShadowAlpha(e) {
this._dropShadowAlpha !== e && (this._dropShadowAlpha = e,
this.styleID++)
}
get dropShadowAngle() {
return this._dropShadowAngle
}
set dropShadowAngle(e) {
this._dropShadowAngle !== e && (this._dropShadowAngle = e,
this.styleID++)
}
get dropShadowBlur() {
return this._dropShadowBlur
}
set dropShadowBlur(e) {
this._dropShadowBlur !== e && (this._dropShadowBlur = e,
this.styleID++)
}
get dropShadowColor() {
return this._dropShadowColor
}
set dropShadowColor(e) {
const t = getColor(e);
this._dropShadowColor !== t && (this._dropShadowColor = t,
this.styleID++)
}
get dropShadowDistance() {
return this._dropShadowDistance
}
set dropShadowDistance(e) {
this._dropShadowDistance !== e && (this._dropShadowDistance = e,
this.styleID++)
}
get fill() {
return this._fill
}
set fill(e) {
const t = getColor(e);
this._fill !== t && (this._fill = t,
this.styleID++)
}
get fillGradientType() {
return this._fillGradientType
}
set fillGradientType(e) {
this._fillGradientType !== e && (this._fillGradientType = e,
this.styleID++)
}
get fillGradientStops() {
return this._fillGradientStops
}
set fillGradientStops(e) {
areArraysEqual(this._fillGradientStops, e) ||
(this._fillGradientStops = e,
this.styleID++)
}
get fontFamily() {
return this._fontFamily
}
set fontFamily(e) {
this.fontFamily !== e && (this._fontFamily = e,
this.styleID++)
}
get fontSize() {
return this._fontSize
}
set fontSize(e) {
this._fontSize !== e && (this._fontSize = e,
this.styleID++)
}
get fontStyle() {
return this._fontStyle
}
set fontStyle(e) {
this._fontStyle !== e && (this._fontStyle = e,
this.styleID++)
}
get fontVariant() {
return this._fontVariant
}
set fontVariant(e) {
this._fontVariant !== e && (this._fontVariant = e,
this.styleID++)
}
get fontWeight() {
return this._fontWeight
}
set fontWeight(e) {
this._fontWeight !== e && (this._fontWeight = e,
this.styleID++)
}
get letterSpacing() {
return this._letterSpacing
}
set letterSpacing(e) {
this._letterSpacing !== e && (this._letterSpacing = e,
this.styleID++)
}
get lineHeight() {
return this._lineHeight
}
set lineHeight(e) {
this._lineHeight !== e && (this._lineHeight = e,
this.styleID++)
}
get leading() {
return this._leading
}
set leading(e) {
this._leading !== e && (this._leading = e,
this.styleID++)
}
get lineJoin() {
return this._lineJoin
}
set lineJoin(e) {
this._lineJoin !== e && (this._lineJoin = e,
this.styleID++)
}
get miterLimit() {
return this._miterLimit
}
set miterLimit(e) {
this._miterLimit !== e && (this._miterLimit = e,
this.styleID++)
}
get padding() {
return this._padding
}
set padding(e) {
this._padding !== e && (this._padding = e,
this.styleID++)
}
get stroke() {
return this._stroke
}
set stroke(e) {
const t = getColor(e);
this._stroke !== t && (this._stroke = t,
this.styleID++)
}
get strokeThickness() {
return this._strokeThickness
}
set strokeThickness(e) {
this._strokeThickness !== e && (this._strokeThickness = e,
this.styleID++)
}
get textBaseline() {
return this._textBaseline
}
set textBaseline(e) {
this._textBaseline !== e && (this._textBaseline = e,
this.styleID++)
}
get trim() {
return this._trim
}
set trim(e) {
this._trim !== e && (this._trim = e,
this.styleID++)
}
get whiteSpace() {
return this._whiteSpace
}
set whiteSpace(e) {
this._whiteSpace !== e && (this._whiteSpace = e,
this.styleID++)
}
get wordWrap() {
return this._wordWrap
}
set wordWrap(e) {
this._wordWrap !== e && (this._wordWrap = e,
this.styleID++)
}
get wordWrapWidth() {
return this._wordWrapWidth
}
set wordWrapWidth(e) {
this._wordWrapWidth !== e && (this._wordWrapWidth = e,
this.styleID++)
}
toFontString() {
const e = "number" == typeof this.fontSize ? `${this.fontSize}px` :
this.fontSize;
let t = this.fontFamily;
Array.isArray(this.fontFamily) || (t = this.fontFamily.split(","));
for (let r = t.length - 1; r >= 0; r--) {
let e = t[r].trim();
!/([\"\'])[^\'\"]+\1/.test(e) && !
genericFontFamilies.includes(e) && (e = `"${e}"`),
t[r] = e
}
return `${this.fontStyle} ${this.fontVariant} ${this.fontWeight} $
{e} ${t.join(",")}`
}
}
;
_TextStyle.defaultStyle = {
align: "left",
breakWords: !1,
dropShadow: !1,
dropShadowAlpha: 1,
dropShadowAngle: Math.PI / 6,
dropShadowBlur: 0,
dropShadowColor: "black",
dropShadowDistance: 5,
fill: "black",
fillGradientType: TEXT_GRADIENT.LINEAR_VERTICAL,
fillGradientStops: [],
fontFamily: "Arial",
fontSize: 26,
fontStyle: "normal",
fontVariant: "normal",
fontWeight: "normal",
leading: 0,
letterSpacing: 0,
lineHeight: 0,
lineJoin: "miter",
miterLimit: 10,
padding: 0,
stroke: "black",
strokeThickness: 0,
textBaseline: "alphabetic",
trim: !1,
whiteSpace: "pre",
wordWrap: !1,
wordWrapWidth: 100
};
let TextStyle$3 = _TextStyle;
function getColor(e) {
const t = Color$2.shared
, r = e => {
const r = t.setValue(e);
return 1 === r.alpha ? r.toHex() : r.toRgbaString()
}
;
return Array.isArray(e) ? e.map(r) : r(e)
}
function areArraysEqual(e, t) {
if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length)
return !1;
for (let r = 0; r < e.length; ++r)
if (e[r] !== t[r])
return !1;
return !0
}
function deepCopyProperties(e, t, r) {
for (const n in r)
Array.isArray(t[n]) ? e[n] = t[n].slice() : e[n] = t[n]
}
const defaultDestroyOptions = {
texture: !0,
children: !1,
baseTexture: !0
}
, _Text = class e extends Sprite {
constructor(t, r, n) {
let i = !1;
n || (n = settings.ADAPTER.createCanvas(),
i = !0),
n.width = 3,
n.height = 3;
const o = Texture.from(n);
o.orig = new Rectangle,
o.trim = new Rectangle,
super(o),
this._ownCanvas = i,
this.canvas = n,
this.context = n.getContext("2d", {
willReadFrequently: !0
}),
this._resolution = e.defaultResolution ?? settings.RESOLUTION,
this._autoResolution = e.defaultAutoResolution,
this._text = null,
this._style = null,
this._styleListener = null,
this._font = "",
this.text = t,
this.style = r,
this.localStyleID = -1
}
static get experimentalLetterSpacing() {
return TextMetrics.experimentalLetterSpacing
}
static set experimentalLetterSpacing(e) {
deprecation("7.1.0", "Text.experimentalLetterSpacing is deprecated,
use TextMetrics.experimentalLetterSpacing"),
TextMetrics.experimentalLetterSpacing = e
}
updateText(e) {
const t = this._style;
if (this.localStyleID !== t.styleID && (this.dirty = !0,
this.localStyleID = t.styleID),
!this.dirty && e)
return;
this._font = this._style.toFontString();
const r = this.context
, n = TextMetrics.measureText(this._text || " ", this._style,
this._style.wordWrap, this.canvas)
, i = n.width
, o = n.height
, s = n.lines
, a = n.lineHeight
, l = n.lineWidths
, c = n.maxLineWidth
, u = n.fontProperties;
let d, p;
this.canvas.width = Math.ceil(Math.ceil(Math.max(1, i) + 2 *
t.padding) * this._resolution),
this.canvas.height = Math.ceil(Math.ceil(Math.max(1, o) + 2 *
t.padding) * this._resolution),
r.scale(this._resolution, this._resolution),
r.clearRect(0, 0, this.canvas.width, this.canvas.height),
r.font = this._font,
r.lineWidth = t.strokeThickness,
r.textBaseline = t.textBaseline,
r.lineJoin = t.lineJoin,
r.miterLimit = t.miterLimit;
const h = t.dropShadow ? 2 : 1;
for (let f = 0; f < h; ++f) {
const e = t.dropShadow && 0 === f
, i = e ? Math.ceil(Math.max(1, o) + 2 * t.padding) : 0
, h = i * this._resolution;
if (e) {
r.fillStyle = "black",
r.strokeStyle = "black";
const e = t.dropShadowColor
, n = t.dropShadowBlur * this._resolution
, i = t.dropShadowDistance * this._resolution;
r.shadowColor =
Color$2.shared.setValue(e).setAlpha(t.dropShadowAlpha).toRgbaString(),
r.shadowBlur = n,
r.shadowOffsetX = Math.cos(t.dropShadowAngle) * i,
r.shadowOffsetY = Math.sin(t.dropShadowAngle) * i + h
} else
r.fillStyle = this._generateFillStyle(t, s, n),
r.strokeStyle = t.stroke,
r.shadowColor = "black",
r.shadowBlur = 0,
r.shadowOffsetX = 0,
r.shadowOffsetY = 0;
let m = (a - u.fontSize) / 2;
a - u.fontSize < 0 && (m = 0);
for (let r = 0; r < s.length; r++)
d = t.strokeThickness / 2,
p = t.strokeThickness / 2 + r * a + u.ascent + m,
"right" === t.align ? d += c - l[r] : "center" === t.align
&& (d += (c - l[r]) / 2),
t.stroke && t.strokeThickness &&
this.drawLetterSpacing(s[r], d + t.padding, p + t.padding - i, !0),
t.fill && this.drawLetterSpacing(s[r], d + t.padding, p +
t.padding - i)
}
this.updateTexture()
}
drawLetterSpacing(e, t, r, n=!1) {
const i = this._style.letterSpacing;
let o = !1;
if (TextMetrics.experimentalLetterSpacingSupported &&
(TextMetrics.experimentalLetterSpacing ? (this.context.letterSpacing = `${i}px`,
this.context.textLetterSpacing = `${i}px`,
o = !0) : (this.context.letterSpacing = "0px",
this.context.textLetterSpacing = "0px")),
0 === i || o)
return void (n ? this.context.strokeText(e, t, r) :
this.context.fillText(e, t, r));
let s = t;
const a = TextMetrics.graphemeSegmenter(e);
let l = this.context.measureText(e).width
, c = 0;
for (let u = 0; u < a.length; ++u) {
const e = a[u];
n ? this.context.strokeText(e, s, r) : this.context.fillText(e,
s, r);
let t = "";
for (let r = u + 1; r < a.length; ++r)
t += a[r];
c = this.context.measureText(t).width,
s += l - c + i,
l = c
}
}
updateTexture() {
const e = this.canvas;
if (this._style.trim) {
const t = trimCanvas(e);
t.data && (e.width = t.width,
e.height = t.height,
this.context.putImageData(t.data, 0, 0))
}
const t = this._texture
, r = this._style
, n = r.trim ? 0 : r.padding
, i = t.baseTexture;
t.trim.width = t._frame.width = e.width / this._resolution,
t.trim.height = t._frame.height = e.height / this._resolution,
t.trim.x = -n,
t.trim.y = -n,
t.orig.width = t._frame.width - 2 * n,
t.orig.height = t._frame.height - 2 * n,
this._onTextureUpdate(),
i.setRealSize(e.width, e.height, this._resolution),
t.updateUvs(),
this.dirty = !1
}
_render(e) {
this._autoResolution && this._resolution !== e.resolution &&
(this._resolution = e.resolution,
this.dirty = !0),
this.updateText(!0),
super._render(e)
}
updateTransform() {
this.updateText(!0),
super.updateTransform()
}
getBounds(e, t) {
return this.updateText(!0),
-1 === this._textureID && (e = !1),
super.getBounds(e, t)
}
getLocalBounds(e) {
return this.updateText(!0),
super.getLocalBounds.call(this, e)
}
_calculateBounds() {
this.calculateVertices(),
this._bounds.addQuad(this.vertexData)
}
_generateFillStyle(e, t, r) {
const n = e.fill;
if (!Array.isArray(n))
return n;
if (1 === n.length)
return n[0];
let i;
const o = e.dropShadow ? e.dropShadowDistance : 0
, s = e.padding || 0
, a = this.canvas.width / this._resolution - o - 2 * s
, l = this.canvas.height / this._resolution - o - 2 * s
, c = n.slice()
, u = e.fillGradientStops.slice();
if (!u.length) {
const e = c.length + 1;
for (let t = 1; t < e; ++t)
u.push(t / e)
}
if (c.unshift(n[0]),
u.unshift(0),
c.push(n[n.length - 1]),
u.push(1),
e.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {
i = this.context.createLinearGradient(a / 2, s, a / 2, l + s);
const n = r.fontProperties.fontSize + e.strokeThickness;
for (let e = 0; e < t.length; e++) {
const o = r.lineHeight * (e - 1) + n
, s = r.lineHeight * e;
let a = s;
e > 0 && o > s && (a = (s + o) / 2);
const d = s + n
, p = r.lineHeight * (e + 1);
let h = d;
e + 1 < t.length && p < d && (h = (d + p) / 2);
const f = (h - a) / l;
for (let e = 0; e < c.length; e++) {
let t = 0;
t = "number" == typeof u[e] ? u[e] : e / c.length;
let r = Math.min(1, Math.max(0, a / l + t * f));
r = Number(r.toFixed(5)),
i.addColorStop(r, c[e])
}
}
} else {
i = this.context.createLinearGradient(s, l / 2, a + s, l / 2);
const e = c.length + 1;
let t = 1;
for (let r = 0; r < c.length; r++) {
let n;
n = "number" == typeof u[r] ? u[r] : t / e,
i.addColorStop(n, c[r]),
t++
}
}
return i
}
destroy(e) {
"boolean" == typeof e && (e = {
children: e
}),
e = Object.assign({}, defaultDestroyOptions, e),
super.destroy(e),
this._ownCanvas && (this.canvas.height = this.canvas.width = 0),
this.context = null,
this.canvas = null,
this._style = null
}
get width() {
return this.updateText(!0),
Math.abs(this.scale.x) * this._texture.orig.width
}
set width(e) {
this.updateText(!0);
const t = sign$1(this.scale.x) || 1;
this.scale.x = t * e / this._texture.orig.width,
this._width = e
}
get height() {
return this.updateText(!0),
Math.abs(this.scale.y) * this._texture.orig.height
}
set height(e) {
this.updateText(!0);
const t = sign$1(this.scale.y) || 1;
this.scale.y = t * e / this._texture.orig.height,
this._height = e
}
get style() {
return this._style
}
set style(e) {
e = e || {},
this._style = e instanceof TextStyle$3 ? e : new TextStyle$3(e),
this.localStyleID = -1,
this.dirty = !0
}
get text() {
return this._text
}
set text(e) {
e = String(e ?? ""),
this._text !== e && (this._text = e,
this.dirty = !0)
}
get resolution() {
return this._resolution
}
set resolution(e) {
this._autoResolution = !1,
this._resolution !== e && (this._resolution = e,
this.dirty = !0)
}
}
;
_Text.defaultAutoResolution = !0;
let Text$4 = _Text;
class CountLimiter {
constructor(e) {
this.maxItemsPerFrame = e,
this.itemsLeft = 0
}
beginFrame() {
this.itemsLeft = this.maxItemsPerFrame
}
allowedToUpload() {
return this.itemsLeft-- > 0
}
}
function findMultipleBaseTextures(e, t) {
var r;
let n = !1;
if (null == (r = null == e ? void 0 : e._textures) ? void 0 : r.length)
for (let i = 0; i < e._textures.length; i++)
if (e._textures[i]instanceof Texture) {
const r = e._textures[i].baseTexture;
t.includes(r) || (t.push(r),
n = !0)
}
return n
}
function findBaseTexture(e, t) {
if (e.baseTexture instanceof BaseTexture) {
const r = e.baseTexture;
return t.includes(r) || t.push(r),
!0
}
return !1
}
function findTexture(e, t) {
if (e._texture && e._texture instanceof Texture) {
const r = e._texture.baseTexture;
return t.includes(r) || t.push(r),
!0
}
return !1
}
function drawText(e, t) {
return t instanceof Text$4 && (t.updateText(!0),
!0)
}
function calculateTextStyle(e, t) {
if (t instanceof TextStyle$3) {
const e = t.toFontString();
return TextMetrics.measureFont(e),
!0
}
return !1
}
function findText(e, t) {
if (e instanceof Text$4) {
t.includes(e.style) || t.push(e.style),
t.includes(e) || t.push(e);
const r = e._texture.baseTexture;
return t.includes(r) || t.push(r),
!0
}
return !1
}
function findTextStyle(e, t) {
return e instanceof TextStyle$3 && (t.includes(e) || t.push(e),
!0)
}
const _BasePrepare = class e {
constructor(t) {
this.limiter = new CountLimiter(e.uploadsPerFrame),
this.renderer = t,
this.uploadHookHelper = null,
this.queue = [],
this.addHooks = [],
this.uploadHooks = [],
this.completes = [],
this.ticking = !1,
this.delayedTick = () => {
this.queue && this.prepareItems()
}
,
this.registerFindHook(findText),
this.registerFindHook(findTextStyle),
this.registerFindHook(findMultipleBaseTextures),
this.registerFindHook(findBaseTexture),
this.registerFindHook(findTexture),
this.registerUploadHook(drawText),
this.registerUploadHook(calculateTextStyle)
}
upload(e) {
return new Promise((t => {
e && this.add(e),
this.queue.length ? (this.completes.push(t),
this.ticking || (this.ticking = !0,
Ticker.system.addOnce(this.tick, this,
UPDATE_PRIORITY.UTILITY))) : t()
}
))
}
tick() {
setTimeout(this.delayedTick, 0)
}
prepareItems() {
for (this.limiter.beginFrame(); this.queue.length &&
this.limiter.allowedToUpload(); ) {
const e = this.queue[0];
let t = !1;
if (e && !e._destroyed)
for (let r = 0, n = this.uploadHooks.length; r < n; r++)
if (this.uploadHooks[r](this.uploadHookHelper, e)) {
this.queue.shift(),
t = !0;
break
}
t || this.queue.shift()
}
if (this.queue.length)
Ticker.system.addOnce(this.tick, this,
UPDATE_PRIORITY.UTILITY);
else {
this.ticking = !1;
const e = this.completes.slice(0);
this.completes.length = 0;
for (let t = 0, r = e.length; t < r; t++)
e[t]()
}
}
registerFindHook(e) {
return e && this.addHooks.push(e),
this
}
registerUploadHook(e) {
return e && this.uploadHooks.push(e),
this
}
add(e) {
for (let t = 0, r = this.addHooks.length; t < r && !
this.addHooks[t](e, this.queue); t++)
;
if (e instanceof Container)
for (let t = e.children.length - 1; t >= 0; t--)
this.add(e.children[t]);
return this
}
destroy() {
this.ticking && Ticker.system.remove(this.tick, this),
this.ticking = !1,
this.addHooks = null,
this.uploadHooks = null,
this.renderer = null,
this.completes = null,
this.queue = null,
this.limiter = null,
this.uploadHookHelper = null
}
}
;
_BasePrepare.uploadsPerFrame = 4;
let BasePrepare = _BasePrepare;
function uploadBaseTextures(e, t) {
return t instanceof BaseTexture && (t._glTextures[e.CONTEXT_UID] ||
e.texture.bind(t),
!0)
}
function uploadGraphics(e, t) {
if (!(t instanceof Graphics))
return !1;
const {geometry: r} = t;
t.finishPoly(),
r.updateBatches();
const {batches: n} = r;
for (let i = 0; i < n.length; i++) {
const {texture: t} = n[i].style;
t && uploadBaseTextures(e, t.baseTexture)
}
return r.batchable || e.geometry.bind(r, t._resolveDirectShader(e)),
!0
}
function findGraphics(e, t) {
return e instanceof Graphics && (t.push(e),
!0)
}
Object.defineProperties(settings, {
UPLOADS_PER_FRAME: {
get: () => BasePrepare.uploadsPerFrame,
set(e) {
deprecation("7.1.0", "settings.UPLOADS_PER_FRAME is deprecated,
use prepare.BasePrepare.uploadsPerFrame"),
BasePrepare.uploadsPerFrame = e
}
}
});
class Prepare extends BasePrepare {
constructor(e) {
super(e),
this.uploadHookHelper = this.renderer,
this.registerFindHook(findGraphics),
this.registerUploadHook(uploadBaseTextures),
this.registerUploadHook(uploadGraphics)
}
}
Prepare.extension = {
name: "prepare",
type: ExtensionType.RendererSystem
},
extensions$1.add(Prepare);
var gl2FragmentSrc = "#version 300 es\n#define SHADER_NAME Tiling-Sprite-
100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\
n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\
nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n
vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord =
(uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord =
clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample =
texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very
negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n"
, gl2VertexSrc = "#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\
n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\
nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3
uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position =
vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0,
1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n"
, gl1FragmentSrc = "#version 100\n#ifdef GL_EXT_shader_texture_lod\n
#extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-
Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform
sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4
uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord =
vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord *
vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord,
uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n
vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n
: texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample =
texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\
n}\n"
, gl1VertexSrc = "#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\
nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2
aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\
nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord,
1.0)).xy;\n}\n"
, fragmentSimpleSrc = "#version 100\n#define SHADER_NAME Tiling-Sprite-
Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform
sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 texSample
= texture2D(uSampler, vTextureCoord);\n gl_FragColor = texSample * uColor;\n}\
n";
const tempMat = new Matrix;
class TilingSpriteRenderer extends ObjectRenderer {
constructor(e) {
super(e),
e.runners.contextChange.add(this),
this.quad = new QuadUv,
this.state = State.for2d()
}
contextChange() {
const e = this.renderer
, t = {
globals: e.globalUniforms
};
this.simpleShader = Shader.from(gl1VertexSrc, fragmentSimpleSrc,
t),
this.shader = e.context.webGLVersion > 1 ?
Shader.from(gl2VertexSrc, gl2FragmentSrc, t) : Shader.from(gl1VertexSrc,
gl1FragmentSrc, t)
}
render(e) {
const t = this.renderer
, r = this.quad;
let n = r.vertices;
n[0] = n[6] = e._width * -e.anchor.x,
n[1] = n[3] = e._height * -e.anchor.y,
n[2] = n[4] = e._width * (1 - e.anchor.x),
n[5] = n[7] = e._height * (1 - e.anchor.y);
const i = e.uvRespectAnchor ? e.anchor.x : 0
, o = e.uvRespectAnchor ? e.anchor.y : 0;
n = r.uvs,
n[0] = n[6] = -i,
n[1] = n[3] = -o,
n[2] = n[4] = 1 - i,
n[5] = n[7] = 1 - o,
r.invalidate();
const s = e._texture
, a = s.baseTexture
, l = a.alphaMode > 0
, c = e.tileTransform.localTransform
, u = e.uvMatrix;
let d = a.isPowerOfTwo && s.frame.width === a.width &&
s.frame.height === a.height;
d && (a._glTextures[t.CONTEXT_UID] ? d = a.wrapMode !==
WRAP_MODES.CLAMP : a.wrapMode === WRAP_MODES.CLAMP && (a.wrapMode =
WRAP_MODES.REPEAT));
const p = d ? this.simpleShader : this.shader
, h = s.width
, f = s.height
, m = e._width
, g = e._height;
tempMat.set(c.a * h / m, c.b * h / g, c.c * f / m, c.d * f / g,
c.tx / m, c.ty / g),
tempMat.invert(),
d ? tempMat.prepend(u.mapCoord) : (p.uniforms.uMapCoord =
u.mapCoord.toArray(!0),
p.uniforms.uClampFrame = u.uClampFrame,
p.uniforms.uClampOffset = u.uClampOffset),
p.uniforms.uTransform = tempMat.toArray(!0),
p.uniforms.uColor =
Color$2.shared.setValue(e.tint).premultiply(e.worldAlpha,
l).toArray(p.uniforms.uColor),
p.uniforms.translationMatrix = e.transform.worldTransform.toArray(!
0),
p.uniforms.uSampler = s,
t.shader.bind(p),
t.geometry.bind(r),
this.state.blendMode = correctBlendMode(e.blendMode, l),
t.state.set(this.state),
t.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0)
}
}
TilingSpriteRenderer.extension = {
name: "tilingSprite",
type: ExtensionType.RendererPlugin
},
extensions$1.add(TilingSpriteRenderer);
const _Spritesheet = class e {
constructor(e, t, r) {
this.linkedSheets = [],
(e instanceof BaseTexture || e instanceof Texture) && (e = {
texture: e,
data: t,
resolutionFilename: r
});
const {texture: n, data: i, resolutionFilename: o=null,
cachePrefix: s=""} = e;
this.cachePrefix = s,
this._texture = n instanceof Texture ? n : null,
this.baseTexture = n instanceof BaseTexture ? n :
this._texture.baseTexture,
this.textures = {},
this.animations = {},
this.data = i;
const a = this.baseTexture.resource;
this.resolution = this._updateResolution(o || (a ? a.url : null)),
this._frames = this.data.frames,
this._frameKeys = Object.keys(this._frames),
this._batchIndex = 0,
this._callback = null
}
_updateResolution(e=null) {
const {scale: t} = this.data.meta;
let r = getResolutionOfUrl(e, null);
return null === r && (r = "number" == typeof t ? t :
parseFloat(t ?? "1")),
1 !== r && this.baseTexture.setResolution(r),
r
}
parse() {
return new Promise((t => {
this._callback = t,
this._batchIndex = 0,
this._frameKeys.length <= e.BATCH_SIZE ?
(this._processFrames(0),
this._processAnimations(),
this._parseComplete()) : this._nextBatch()
}
))
}
_processFrames(t) {
let r = t;
const n = e.BATCH_SIZE;
for (; r - t < n && r < this._frameKeys.length; ) {
const e = this._frameKeys[r]
, t = this._frames[e]
, n = t.frame;
if (n) {
let r = null
, i = null;
const o = !1 !== t.trimmed && t.sourceSize ? t.sourceSize :
t.frame
, s = new Rectangle(0,0,Math.floor(o.w) /
this.resolution,Math.floor(o.h) / this.resolution);
r = t.rotated ? new Rectangle(Math.floor(n.x) /
this.resolution,Math.floor(n.y) / this.resolution,Math.floor(n.h) /
this.resolution,Math.floor(n.w) / this.resolution) : new
Rectangle(Math.floor(n.x) / this.resolution,Math.floor(n.y) /
this.resolution,Math.floor(n.w) / this.resolution,Math.floor(n.h) /
this.resolution),
!1 !== t.trimmed && t.spriteSourceSize && (i = new
Rectangle(Math.floor(t.spriteSourceSize.x) /
this.resolution,Math.floor(t.spriteSourceSize.y) /
this.resolution,Math.floor(n.w) / this.resolution,Math.floor(n.h) /
this.resolution)),
this.textures[e] = new
Texture(this.baseTexture,r,s,i,t.rotated ? 2 : 0,t.anchor,t.borders),
Texture.addToCache(this.textures[e], this.cachePrefix +
e.toString())
}
r++
}
}
_processAnimations() {
const e = this.data.animations || {};
for (const t in e) {
this.animations[t] = [];
for (let r = 0; r < e[t].length; r++) {
const n = e[t][r];
this.animations[t].push(this.textures[n])
}
}
}
_parseComplete() {
const e = this._callback;
this._callback = null,
this._batchIndex = 0,
e.call(this, this.textures)
}
_nextBatch() {
this._processFrames(this._batchIndex * e.BATCH_SIZE),
this._batchIndex++,
setTimeout(( () => {
this._batchIndex * e.BATCH_SIZE < this._frameKeys.length ?
this._nextBatch() : (this._processAnimations(),
this._parseComplete())
}
), 0)
}
destroy(e=!1) {
var t;
for (const r in this.textures)
this.textures[r].destroy();
this._frames = null,
this._frameKeys = null,
this.data = null,
this.textures = null,
e && (null == (t = this._texture) || t.destroy(),
this.baseTexture.destroy()),
this._texture = null,
this.baseTexture = null,
this.linkedSheets = []
}
}
;
_Spritesheet.BATCH_SIZE = 1e3;
let Spritesheet = _Spritesheet;
const validImages = ["jpg", "png", "jpeg", "avif", "webp"];
function getCacheableAssets(e, t, r) {
const n = {};
if (e.forEach((e => {
n[e] = t
}
)),
Object.keys(t.textures).forEach((e => {
n[`${t.cachePrefix}${e}`] = t.textures[e]
}
)),
!r) {
const r = path$1.dirname(e[0]);
t.linkedSheets.forEach(( (e, i) => {
Object.assign(n, getCacheableAssets([`${r}/$
{t.data.meta.related_multi_packs[i]}`], e, !0))
}
))
}
return n
}
const spritesheetAsset = {
extension: ExtensionType.Asset,
cache: {
test: e => e instanceof Spritesheet,
getCacheableAssets: (e, t) => getCacheableAssets(e, t, !1)
},
resolver: {
test: e => {
const t = e.split("?")[0].split(".")
, r = t.pop()
, n = t.pop();
return "json" === r && validImages.includes(n)
}
,
parse: e => {
var t;
const r = e.split(".");
return {
resolution: parseFloat((null == (t =
settings.RETINA_PREFIX.exec(e)) ? void 0 : t[1]) ?? "1"),
format: r[r.length - 2],
src: e
}
}
},
loader: {
name: "spritesheetLoader",
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.Normal
},
testParse: async (e, t) => ".json" ===
path$1.extname(t.src).toLowerCase() && !!e.frames,
async parse(e, t, r) {
var n, i;
const {texture: o, imageFilename: s, cachePrefix: a} = (null ==
t ? void 0 : t.data) ?? {};
let l, c = path$1.dirname(t.src);
if (c && c.lastIndexOf("/") !== c.length - 1 && (c += "/"),
o && o.baseTexture)
l = o;
else {
const n = copySearchParams(c + (s ?? e.meta.image), t.src);
l = (await r.load([n]))[n]
}
const u = new Spritesheet({
texture: l.baseTexture,
data: e,
resolutionFilename: t.src,
cachePrefix: a
});
await u.parse();
const d = null == (n = null == e ? void 0 : e.meta) ? void 0 :
n.related_multi_packs;
if (Array.isArray(d)) {
const e = [];
for (const o of d) {
if ("string" != typeof o)
continue;
let n = c + o;
(null == (i = t.data) ? void 0 : i.ignoreMultiPack) ||
(n = copySearchParams(n, t.src),
e.push(r.load({
src: n,
data: {
ignoreMultiPack: !0
}
})))
}
const n = await Promise.all(e);
u.linkedSheets = n,
n.forEach((e => {
e.linkedSheets = [u].concat(u.linkedSheets.filter((t =>
t !== e)))
}
))
}
return u
},
unload(e) {
e.destroy(!0)
}
}
};
extensions$1.add(spritesheetAsset);
class BitmapFontData {
constructor() {
this.info = [],
this.common = [],
this.page = [],
this.char = [],
this.kerning = [],
this.distanceField = []
}
}
class TextFormat {
static test(e) {
return "string" == typeof e && e.startsWith("info face=")
}
static parse(e) {
const t = e.match(/^[a-z]+\s+.+$/gm)
, r = {
info: [],
common: [],
page: [],
char: [],
chars: [],
kerning: [],
kernings: [],
distanceField: []
};
for (const i in t) {
const e = t[i].match(/^[a-z]+/gm)[0]
, n = t[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm)
, o = {};
for (const t in n) {
const e = n[t].split("=")
, r = e[0]
, i = e[1].replace(/"/gm, "")
, s = parseFloat(i)
, a = isNaN(s) ? i : s;
o[r] = a
}
r[e].push(o)
}
const n = new BitmapFontData;
return r.info.forEach((e => n.info.push({
face: e.face,
size: parseInt(e.size, 10)
}))),
r.common.forEach((e => n.common.push({
lineHeight: parseInt(e.lineHeight, 10)
}))),
r.page.forEach((e => n.page.push({
id: parseInt(e.id, 10),
file: e.file
}))),
r.char.forEach((e => n.char.push({
id: parseInt(e.id, 10),
page: parseInt(e.page, 10),
x: parseInt(e.x, 10),
y: parseInt(e.y, 10),
width: parseInt(e.width, 10),
height: parseInt(e.height, 10),
xoffset: parseInt(e.xoffset, 10),
yoffset: parseInt(e.yoffset, 10),
xadvance: parseInt(e.xadvance, 10)
}))),
r.kerning.forEach((e => n.kerning.push({
first: parseInt(e.first, 10),
second: parseInt(e.second, 10),
amount: parseInt(e.amount, 10)
}))),
r.distanceField.forEach((e => n.distanceField.push({
distanceRange: parseInt(e.distanceRange, 10),
fieldType: e.fieldType
}))),
n
}
}
class XMLFormat {
static test(e) {
const t = e;
return "string" != typeof e && "getElementsByTagName"in e &&
t.getElementsByTagName("page").length && null !== t.getElementsByTagName("info")
[0].getAttribute("face")
}
static parse(e) {
const t = new BitmapFontData
, r = e.getElementsByTagName("info")
, n = e.getElementsByTagName("common")
, i = e.getElementsByTagName("page")
, o = e.getElementsByTagName("char")
, s = e.getElementsByTagName("kerning")
, a = e.getElementsByTagName("distanceField");
for (let l = 0; l < r.length; l++)
t.info.push({
face: r[l].getAttribute("face"),
size: parseInt(r[l].getAttribute("size"), 10)
});
for (let l = 0; l < n.length; l++)
t.common.push({
lineHeight: parseInt(n[l].getAttribute("lineHeight"), 10)
});
for (let l = 0; l < i.length; l++)
t.page.push({
id: parseInt(i[l].getAttribute("id"), 10) || 0,
file: i[l].getAttribute("file")
});
for (let l = 0; l < o.length; l++) {
const e = o[l];
t.char.push({
id: parseInt(e.getAttribute("id"), 10),
page: parseInt(e.getAttribute("page"), 10) || 0,
x: parseInt(e.getAttribute("x"), 10),
y: parseInt(e.getAttribute("y"), 10),
width: parseInt(e.getAttribute("width"), 10),
height: parseInt(e.getAttribute("height"), 10),
xoffset: parseInt(e.getAttribute("xoffset"), 10),
yoffset: parseInt(e.getAttribute("yoffset"), 10),
xadvance: parseInt(e.getAttribute("xadvance"), 10)
})
}
for (let l = 0; l < s.length; l++)
t.kerning.push({
first: parseInt(s[l].getAttribute("first"), 10),
second: parseInt(s[l].getAttribute("second"), 10),
amount: parseInt(s[l].getAttribute("amount"), 10)
});
for (let l = 0; l < a.length; l++)
t.distanceField.push({
fieldType: a[l].getAttribute("fieldType"),
distanceRange: parseInt(a[l].getAttribute("distanceRange"),
10)
});
return t
}
}
class XMLStringFormat {
static test(e) {
return !("string" != typeof e || !e.includes("<font>")) &&
XMLFormat.test(settings.ADAPTER.parseXML(e))
}
static parse(e) {
return XMLFormat.parse(settings.ADAPTER.parseXML(e))
}
}
const formats = [TextFormat, XMLFormat, XMLStringFormat];
function autoDetectFormat(e) {
for (let t = 0; t < formats.length; t++)
if (formats[t].test(e))
return formats[t];
return null
}
function generateFillStyle(e, t, r, n, i, o) {
const s = r.fill;
if (!Array.isArray(s))
return s;
if (1 === s.length)
return s[0];
let a;
const l = r.dropShadow ? r.dropShadowDistance : 0
, c = r.padding || 0
, u = e.width / n - l - 2 * c
, d = e.height / n - l - 2 * c
, p = s.slice()
, h = r.fillGradientStops.slice();
if (!h.length) {
const e = p.length + 1;
for (let t = 1; t < e; ++t)
h.push(t / e)
}
if (p.unshift(s[0]),
h.unshift(0),
p.push(s[s.length - 1]),
h.push(1),
r.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {
a = t.createLinearGradient(u / 2, c, u / 2, d + c);
let e = 0;
const n = (o.fontProperties.fontSize + r.strokeThickness) / d;
for (let t = 0; t < i.length; t++) {
const r = o.lineHeight * t;
for (let t = 0; t < p.length; t++) {
let i = 0;
i = "number" == typeof h[t] ? h[t] : t / p.length;
const o = r / d + i * n;
let s = Math.max(e, o);
s = Math.min(s, 1),
a.addColorStop(s, p[t]),
e = s
}
}
} else {
a = t.createLinearGradient(c, d / 2, u + c, d / 2);
const e = p.length + 1;
let r = 1;
for (let t = 0; t < p.length; t++) {
let n;
n = "number" == typeof h[t] ? h[t] : r / e,
a.addColorStop(n, p[t]),
r++
}
}
return a
}
function drawGlyph(e, t, r, n, i, o, s) {
const a = r.text
, l = r.fontProperties;
t.translate(n, i),
t.scale(o, o);
const c = s.strokeThickness / 2
, u = -s.strokeThickness / 2;
if (t.font = s.toFontString(),
t.lineWidth = s.strokeThickness,
t.textBaseline = s.textBaseline,
t.lineJoin = s.lineJoin,
t.miterLimit = s.miterLimit,
t.fillStyle = generateFillStyle(e, t, s, o, [a], r),
t.strokeStyle = s.stroke,
s.dropShadow) {
const e = s.dropShadowColor
, r = s.dropShadowBlur * o
, n = s.dropShadowDistance * o;
t.shadowColor =
Color$2.shared.setValue(e).setAlpha(s.dropShadowAlpha).toRgbaString(),
t.shadowBlur = r,
t.shadowOffsetX = Math.cos(s.dropShadowAngle) * n,
t.shadowOffsetY = Math.sin(s.dropShadowAngle) * n
} else
t.shadowColor = "black",
t.shadowBlur = 0,
t.shadowOffsetX = 0,
t.shadowOffsetY = 0;
s.stroke && s.strokeThickness && t.strokeText(a, c, u + r.lineHeight -
l.descent),
s.fill && t.fillText(a, c, u + r.lineHeight - l.descent),
t.setTransform(1, 0, 0, 1, 0, 0),
t.fillStyle = "rgba(0, 0, 0, 0)"
}
function extractCharCode(e) {
return e.codePointAt ? e.codePointAt(0) : e.charCodeAt(0)
}
function splitTextToCharacters(e) {
return Array.from ? Array.from(e) : e.split("")
}
function resolveCharacters(e) {
"string" == typeof e && (e = [e]);
const t = [];
for (let r = 0, n = e.length; r < n; r++) {
const n = e[r];
if (Array.isArray(n)) {
if (2 !== n.length)
throw new Error(`[BitmapFont]: Invalid character range
length, expecting 2 got ${n.length}.`);
const e = n[0].charCodeAt(0)
, r = n[1].charCodeAt(0);
if (r < e)
throw new Error("[BitmapFont]: Invalid character range.");
for (let n = e, i = r; n <= i; n++)
t.push(String.fromCharCode(n))
} else
t.push(...splitTextToCharacters(n))
}
if (0 === t.length)
throw new Error("[BitmapFont]: Empty set when resolving
characters.");
return t
}
const _BitmapFont = class e {
constructor(e, t, r) {
var n;
const [i] = e.info
, [o] = e.common
, [s] = e.page
, [a] = e.distanceField
, l = getResolutionOfUrl(s.file)
, c = {};
this._ownsTextures = r,
this.font = i.face,
this.size = i.size,
this.lineHeight = o.lineHeight / l,
this.chars = {},
this.pageTextures = c;
for (let u = 0; u < e.page.length; u++) {
const {id: r, file: n} = e.page[u];
c[r] = t instanceof Array ? t[u] : t[n],
(null == a ? void 0 : a.fieldType) && "none" !== a.fieldType &&
(c[r].baseTexture.alphaMode = ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,
c[r].baseTexture.mipmap = MIPMAP_MODES.OFF)
}
for (let u = 0; u < e.char.length; u++) {
const {id: t, page: r} = e.char[u];
let {x: n, y: i, width: o, height: s, xoffset: a, yoffset: d,
xadvance: p} = e.char[u];
n /= l,
i /= l,
o /= l,
s /= l,
a /= l,
d /= l,
p /= l;
const h = new Rectangle(n + c[r].frame.x / l,i + c[r].frame.y /
l,o,s);
this.chars[t] = {
xOffset: a,
yOffset: d,
xAdvance: p,
kerning: {},
texture: new Texture(c[r].baseTexture,h),
page: r
}
}
for (let u = 0; u < e.kerning.length; u++) {
let {first: t, second: r, amount: n} = e.kerning[u];
t /= l,
r /= l,
n /= l,
this.chars[r] && (this.chars[r].kerning[t] = n)
}
this.distanceFieldRange = null == a ? void 0 : a.distanceRange,
this.distanceFieldType = (null == (n = null == a ? void 0 :
a.fieldType) ? void 0 : n.toLowerCase()) ?? "none"
}
destroy() {
for (const e in this.chars)
this.chars[e].texture.destroy(),
this.chars[e].texture = null;
for (const e in this.pageTextures)
this._ownsTextures && this.pageTextures[e].destroy(!0),
this.pageTextures[e] = null;
this.chars = null,
this.pageTextures = null
}
static install(t, r, n) {
let i;
if (t instanceof BitmapFontData)
i = t;
else {
const e = autoDetectFormat(t);
if (!e)
throw new Error("Unrecognized data format for font.");
i = e.parse(t)
}
r instanceof Texture && (r = [r]);
const o = new e(i,r,n);
return e.available[o.font] = o,
o
}
static uninstall(t) {
const r = e.available[t];
if (!r)
throw new Error(`No font found named '${t}'`);
r.destroy(),
delete e.available[t]
}
static from(t, r, n) {
if (!t)
throw new Error("[BitmapFont] Property `name` is required.");
const {chars: i, padding: o, resolution: s, textureWidth: a,
textureHeight: l, ...c} = Object.assign({}, e.defaultOptions, n)
, u = resolveCharacters(i)
, d = r instanceof TextStyle$3 ? r : new TextStyle$3(r)
, p = a
, h = new BitmapFontData;
h.info[0] = {
face: d.fontFamily,
size: d.fontSize
},
h.common[0] = {
lineHeight: d.fontSize
};
let f, m, g, y = 0, v = 0, b = 0;
const x = [];
for (let e = 0; e < u.length; e++) {
f || (f = settings.ADAPTER.createCanvas(),
f.width = a,
f.height = l,
m = f.getContext("2d"),
g = new BaseTexture(f,{
resolution: s,
...c
}),
x.push(new Texture(g)),
h.page.push({
id: x.length - 1,
file: ""
}));
const t = u[e]
, r = TextMetrics.measureText(t, d, !1, f)
, n = r.width
, i = Math.ceil(r.height)
, _ = Math.ceil(("italic" === d.fontStyle ? 2 : 1) * n);
if (v >= l - i * s) {
if (0 === v)
throw new Error(`[BitmapFont] textureHeight ${l}px is
too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '$
{t}')`);
--e,
f = null,
m = null,
g = null,
v = 0,
y = 0,
b = 0;
continue
}
if (b = Math.max(i + r.fontProperties.descent, b),
_ * s + y >= p) {
if (0 === y)
throw new Error(`[BitmapFont] textureWidth ${a}px is
too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '$
{t}')`);
--e,
v += b * s,
v = Math.ceil(v),
y = 0,
b = 0;
continue
}
drawGlyph(f, m, r, y, v, s, d);
const E = extractCharCode(r.text);
h.char.push({
id: E,
page: x.length - 1,
x: y / s,
y: v / s,
width: _,
height: i,
xoffset: 0,
yoffset: 0,
xadvance: n - (d.dropShadow ? d.dropShadowDistance : 0) -
(d.stroke ? d.strokeThickness : 0)
}),
y += (_ + 2 * o) * s,
y = Math.ceil(y)
}
if (!(null == n ? void 0 : n.skipKerning))
for (let e = 0, E = u.length; e < E; e++) {
const t = u[e];
for (let e = 0; e < E; e++) {
const r = u[e]
, n = m.measureText(t).width
, i = m.measureText(r).width
, o = m.measureText(t + r).width - (n + i);
o && h.kerning.push({
first: extractCharCode(t),
second: extractCharCode(r),
amount: o
})
}
}
const _ = new e(h,x,!0);
return void 0 !== e.available[t] && e.uninstall(t),
e.available[t] = _,
_
}
}
;
_BitmapFont.ALPHA = [["a", "z"], ["A", "Z"], " "],
_BitmapFont.NUMERIC = [["0", "9"]],
_BitmapFont.ALPHANUMERIC = [["a", "z"], ["A", "Z"], ["0", "9"], " "],
_BitmapFont.ASCII = [[" ", "~"]],
_BitmapFont.defaultOptions = {
resolution: 1,
textureWidth: 512,
textureHeight: 512,
padding: 4,
chars: _BitmapFont.ALPHANUMERIC
},
_BitmapFont.available = {};
let BitmapFont = _BitmapFont;
var msdfFrag = "// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\
nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D
applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\
nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n // To stack MSDF and SDF
we need a non-pre-multiplied-alpha texture.\r\n vec4 texColor =
texture2D(uSampler, vTextureCoord);\r\n\r\n // MSDF\r\n float median = texColor.r
+ texColor.g + texColor.b -\r\n min(texColor.r, min(texColor.g,
texColor.b)) -\r\n max(texColor.r, max(texColor.g, texColor.b));\
r\n // SDF\r\n median = min(median, texColor.a);\r\n\r\n float screenPxDistance
= uFWidth * (median - 0.5);\r\n float alpha = clamp(screenPxDistance + 0.5, 0.0,
1.0);\r\n if (median < 0.01) {\r\n alpha = 0.0;\r\n } else if (median > 0.99)
{\r\n alpha = 1.0;\r\n }\r\n\r\n // Gamma correction for coverage-like alpha\
r\n float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r\n float gamma =
mix(1.0, 1.0 / 2.2, luma);\r\n float coverage = pow(uColor.a * alpha, gamma); \r\
n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb,
coverage);\r\n}\r\n"
, msdfVert = "// Mesh material default fragment\r\nattribute vec2
aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3
projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3
uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\r\n\r\n vTextureCoord = (uTextureMatrix *
vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n";
const pageMeshDataDefaultPageMeshData = []
, pageMeshDataMSDFPageMeshData = []
, charRenderDataPool = []
, _BitmapText = class e extends Container {
constructor(t, r={}) {
super();
const {align: n, tint: i, maxWidth: o, letterSpacing: s, fontName:
a, fontSize: l} = Object.assign({}, e.styleDefaults, r);
if (!BitmapFont.available[a])
throw new Error(`Missing BitmapFont "${a}"`);
this._activePagesMeshData = [],
this._textWidth = 0,
this._textHeight = 0,
this._align = n,
this._tintColor = new Color$2(i),
this._font = void 0,
this._fontName = a,
this._fontSize = l,
this.text = t,
this._maxWidth = o,
this._maxLineHeight = 0,
this._letterSpacing = s,
this._anchor = new ObservablePoint(( () => {
this.dirty = !0
}
),this,0,0),
this._roundPixels = settings.ROUND_PIXELS,
this.dirty = !0,
this._resolution = settings.RESOLUTION,
this._autoResolution = !0,
this._textureCache = {}
}
updateText() {
var e;
const t = BitmapFont.available[this._fontName]
, r = this.fontSize
, n = r / t.size
, i = new Point
, o = []
, s = []
, a = []
, l = splitTextToCharacters(this._text.replace(/(?:\r\n|\r)/g, "\
n") || " ")
, c = this._maxWidth * t.size / r
, u = "none" === t.distanceFieldType ?
pageMeshDataDefaultPageMeshData : pageMeshDataMSDFPageMeshData;
let d = null
, p = 0
, h = 0
, f = 0
, m = -1
, g = 0
, y = 0
, v = 0
, b = 0;
for (let $ = 0; $ < l.length; $++) {
const e = l[$]
, r = extractCharCode(e);
if (/(?:\s)/.test(e) && (m = $,
g = p,
b++),
"\r" === e || "\n" === e) {
s.push(p),
a.push(-1),
h = Math.max(h, p),
++f,
++y,
i.x = 0,
i.y += t.lineHeight,
d = null,
b = 0;
continue
}
const n = t.chars[r];
if (!n)
continue;
d && n.kerning[d] && (i.x += n.kerning[d]);
const u = charRenderDataPool.pop() || {
texture: Texture.EMPTY,
line: 0,
charCode: 0,
prevSpaces: 0,
position: new Point
};
u.texture = n.texture,
u.line = f,
u.charCode = r,
u.position.x = Math.round(i.x + n.xOffset + this._letterSpacing
/ 2),
u.position.y = Math.round(i.y + n.yOffset),
u.prevSpaces = b,
o.push(u),
p = u.position.x + Math.max(n.xAdvance - n.xOffset,
n.texture.orig.width),
i.x += n.xAdvance + this._letterSpacing,
v = Math.max(v, n.yOffset + n.texture.height),
d = r,
-1 !== m && c > 0 && i.x > c && (++y,
removeItems(o, 1 + m - y, 1 + $ - m),
$ = m,
m = -1,
s.push(g),
a.push(o.length > 0 ? o[o.length - 1].prevSpaces : 0),
h = Math.max(h, g),
f++,
i.x = 0,
i.y += t.lineHeight,
d = null,
b = 0)
}
const x = l[l.length - 1];
"\r" !== x && "\n" !== x && (/(?:\s)/.test(x) && (p = g),
s.push(p),
h = Math.max(h, p),
a.push(-1));
const _ = [];
for (let $ = 0; $ <= f; $++) {
let e = 0;
"right" === this._align ? e = h - s[$] : "center" ===
this._align ? e = (h - s[$]) / 2 : "justify" === this._align && (e = a[$] < 0 ? 0 :
(h - s[$]) / a[$]),
_.push(e)
}
const E = o.length
, T = {}
, C = []
, S = this._activePagesMeshData;
u.push(...S);
for (let $ = 0; $ < E; $++) {
const e = o[$].texture
, r = e.baseTexture.uid;
if (!T[r]) {
let n = u.pop();
if (!n) {
const e = new MeshGeometry;
let r, i;
"none" === t.distanceFieldType ? (r = new
MeshMaterial(Texture.EMPTY),
i = BLEND_MODES.NORMAL) : (r = new
MeshMaterial(Texture.EMPTY,{
program: Program.from(msdfVert, msdfFrag),
uniforms: {
uFWidth: 0
}
}),
i = BLEND_MODES.NORMAL_NPM);
const o = new Mesh(e,r);
o.blendMode = i,
n = {
index: 0,
indexCount: 0,
vertexCount: 0,
uvsCount: 0,
total: 0,
mesh: o,
vertices: null,
uvs: null,
indices: null
}
}
n.index = 0,
n.indexCount = 0,
n.vertexCount = 0,
n.uvsCount = 0,
n.total = 0;
const {_textureCache: i} = this;
i[r] = i[r] || new Texture(e.baseTexture),
n.mesh.texture = i[r],
n.mesh.tint = this._tintColor.value,
C.push(n),
T[r] = n
}
T[r].total++
}
for (let $ = 0; $ < S.length; $++)
C.includes(S[$]) || this.removeChild(S[$].mesh);
for (let $ = 0; $ < C.length; $++)
C[$].mesh.parent !== this && this.addChild(C[$].mesh);
this._activePagesMeshData = C;
for (const $ in T) {
const t = T[$]
, r = t.total;
if (!((null == (e = t.indices) ? void 0 : e.length) > 6 * r) ||
t.vertices.length < 2 * Mesh.BATCHABLE_SIZE)
t.vertices = new Float32Array(8 * r),
t.uvs = new Float32Array(8 * r),
t.indices = new Uint16Array(6 * r);
else {
const e = t.total
, r = t.vertices;
for (let t = 4 * e * 2; t < r.length; t++)
r[t] = 0
}
t.mesh.size = 6 * r
}
for (let $ = 0; $ < E; $++) {
const e = o[$];
let t = e.position.x + _[e.line] * ("justify" === this._align ?
e.prevSpaces : 1);
this._roundPixels && (t = Math.round(t));
const r = t * n
, i = e.position.y * n
, s = e.texture
, a = T[s.baseTexture.uid]
, l = s.frame
, c = s._uvs
, u = a.index++;
a.indices[6 * u + 0] = 0 + 4 * u,
a.indices[6 * u + 1] = 1 + 4 * u,
a.indices[6 * u + 2] = 2 + 4 * u,
a.indices[6 * u + 3] = 0 + 4 * u,
a.indices[6 * u + 4] = 2 + 4 * u,
a.indices[6 * u + 5] = 3 + 4 * u,
a.vertices[8 * u + 0] = r,
a.vertices[8 * u + 1] = i,
a.vertices[8 * u + 2] = r + l.width * n,
a.vertices[8 * u + 3] = i,
a.vertices[8 * u + 4] = r + l.width * n,
a.vertices[8 * u + 5] = i + l.height * n,
a.vertices[8 * u + 6] = r,
a.vertices[8 * u + 7] = i + l.height * n,
a.uvs[8 * u + 0] = c.x0,
a.uvs[8 * u + 1] = c.y0,
a.uvs[8 * u + 2] = c.x1,
a.uvs[8 * u + 3] = c.y1,
a.uvs[8 * u + 4] = c.x2,
a.uvs[8 * u + 5] = c.y2,
a.uvs[8 * u + 6] = c.x3,
a.uvs[8 * u + 7] = c.y3
}
this._textWidth = h * n,
this._textHeight = (i.y + t.lineHeight) * n;
for (const $ in T) {
const e = T[$];
if (0 !== this.anchor.x || 0 !== this.anchor.y) {
let t = 0;
const r = this._textWidth * this.anchor.x
, n = this._textHeight * this.anchor.y;
for (let i = 0; i < e.total; i++)
e.vertices[t++] -= r,
e.vertices[t++] -= n,
e.vertices[t++] -= r,
e.vertices[t++] -= n,
e.vertices[t++] -= r,
e.vertices[t++] -= n,
e.vertices[t++] -= r,
e.vertices[t++] -= n
}
this._maxLineHeight = v * n;
const t = e.mesh.geometry.getBuffer("aVertexPosition")
, r = e.mesh.geometry.getBuffer("aTextureCoord")
, i = e.mesh.geometry.getIndex();
t.data = e.vertices,
r.data = e.uvs,
i.data = e.indices,
t.update(),
r.update(),
i.update()
}
for (let $ = 0; $ < o.length; $++)
charRenderDataPool.push(o[$]);
this._font = t,
this.dirty = !1
}
updateTransform() {
this.validate(),
this.containerUpdateTransform()
}
_render(e) {
this._autoResolution && this._resolution !== e.resolution &&
(this._resolution = e.resolution,
this.dirty = !0);
const {distanceFieldRange: t, distanceFieldType: r, size: n} =
BitmapFont.available[this._fontName];
if ("none" !== r) {
const {a: r, b: i, c: o, d: s} = this.worldTransform
, a = Math.sqrt(r * r + i * i)
, l = Math.sqrt(o * o + s * s)
, c = (Math.abs(a) + Math.abs(l)) / 2
, u = this.fontSize / n
, d = e._view.resolution;
for (const e of this._activePagesMeshData)
e.mesh.shader.uniforms.uFWidth = c * t * u * d
}
super._render(e)
}
getLocalBounds() {
return this.validate(),
super.getLocalBounds()
}
validate() {
const e = BitmapFont.available[this._fontName];
if (!e)
throw new Error(`Missing BitmapFont "${this._fontName}"`);
this._font !== e && (this.dirty = !0),
this.dirty && this.updateText()
}
get tint() {
return this._tintColor.value
}
set tint(e) {
if (this.tint !== e) {
this._tintColor.setValue(e);
for (let t = 0; t < this._activePagesMeshData.length; t++)
this._activePagesMeshData[t].mesh.tint = e
}
}
get align() {
return this._align
}
set align(e) {
this._align !== e && (this._align = e,
this.dirty = !0)
}
get fontName() {
return this._fontName
}
set fontName(e) {
if (!BitmapFont.available[e])
throw new Error(`Missing BitmapFont "${e}"`);
this._fontName !== e && (this._fontName = e,
this.dirty = !0)
}
get fontSize() {
return this._fontSize ?? BitmapFont.available[this._fontName].size
}
set fontSize(e) {
this._fontSize !== e && (this._fontSize = e,
this.dirty = !0)
}
get anchor() {
return this._anchor
}
set anchor(e) {
"number" == typeof e ? this._anchor.set(e) :
this._anchor.copyFrom(e)
}
get text() {
return this._text
}
set text(e) {
e = String(e ?? ""),
this._text !== e && (this._text = e,
this.dirty = !0)
}
get maxWidth() {
return this._maxWidth
}
set maxWidth(e) {
this._maxWidth !== e && (this._maxWidth = e,
this.dirty = !0)
}
get maxLineHeight() {
return this.validate(),
this._maxLineHeight
}
get textWidth() {
return this.validate(),
this._textWidth
}
get letterSpacing() {
return this._letterSpacing
}
set letterSpacing(e) {
this._letterSpacing !== e && (this._letterSpacing = e,
this.dirty = !0)
}
get roundPixels() {
return this._roundPixels
}
set roundPixels(e) {
e !== this._roundPixels && (this._roundPixels = e,
this.dirty = !0)
}
get textHeight() {
return this.validate(),
this._textHeight
}
get resolution() {
return this._resolution
}
set resolution(e) {
this._autoResolution = !1,
this._resolution !== e && (this._resolution = e,
this.dirty = !0)
}
destroy(e) {
const {_textureCache: t} = this
, r = "none" ===
BitmapFont.available[this._fontName].distanceFieldType ?
pageMeshDataDefaultPageMeshData : pageMeshDataMSDFPageMeshData;
r.push(...this._activePagesMeshData);
for (const n of this._activePagesMeshData)
this.removeChild(n.mesh);
this._activePagesMeshData = [],
r.filter((e => t[e.mesh.texture.baseTexture.uid])).forEach((e => {
e.mesh.texture = Texture.EMPTY
}
));
for (const n in t)
t[n].destroy(),
delete t[n];
this._font = null,
this._tintColor = null,
this._textureCache = null,
super.destroy(e)
}
}
;
_BitmapText.styleDefaults = {
align: "left",
tint: 16777215,
maxWidth: 0,
letterSpacing: 0
};
const validExtensions = [".xml", ".fnt"]
, loadBitmapFont = {
extension: {
type: ExtensionType.LoadParser,
priority: LoaderParserPriority.Normal
},
name: "loadBitmapFont",
test: e => validExtensions.includes(path$1.extname(e).toLowerCase()),
testParse: async e => TextFormat.test(e) || XMLStringFormat.test(e),
async parse(e, t, r) {
const n = TextFormat.test(e) ? TextFormat.parse(e) :
XMLStringFormat.parse(e)
, {src: i} = t
, {page: o} = n
, s = [];
for (let c = 0; c < o.length; ++c) {
const e = o[c].file;
let t = path$1.join(path$1.dirname(i), e);
t = copySearchParams(t, i),
s.push(t)
}
const a = await r.load(s)
, l = s.map((e => a[e]));
return BitmapFont.install(n, l, !0)
},
load: async (e, t) => (await settings.ADAPTER.fetch(e)).text(),
unload(e) {
e.destroy()
}
};
extensions$1.add(loadBitmapFont);
const _HTMLTextStyle = class e extends TextStyle$3 {
constructor() {
super(...arguments),
this._fonts = [],
this._overrides = [],
this._stylesheet = "",
this.fontsDirty = !1
}
static from(t) {
return new e(Object.keys(e.defaultOptions).reduce(( (e, r) => ({
...e,
[r]: t[r]
})), {}))
}
cleanFonts() {
this._fonts.length > 0 && (this._fonts.forEach((t => {
URL.revokeObjectURL(t.src),
t.refs--,
0 === t.refs && (t.fontFace &&
document.fonts.delete(t.fontFace),
delete e.availableFonts[t.originalUrl])
}
)),
this.fontFamily = "Arial",
this._fonts.length = 0,
this.styleID++,
this.fontsDirty = !0)
}
loadFont(t, r={}) {
const {availableFonts: n} = e;
if (n[t]) {
const e = n[t];
return this._fonts.push(e),
e.refs++,
this.styleID++,
this.fontsDirty = !0,
Promise.resolve()
}
return settings.ADAPTER.fetch(t).then((e => e.blob())).then((async
e => new Promise(( (t, r) => {
const n = URL.createObjectURL(e)
, i = new FileReader;
i.onload = () => t([n, i.result]),
i.onerror = r,
i.readAsDataURL(e)
}
)))).then((async ([e,i]) => {
const o = Object.assign({
family: path$1.basename(t, path$1.extname(t)),
weight: "normal",
style: "normal",
display: "auto",
src: e,
dataSrc: i,
refs: 1,
originalUrl: t,
fontFace: null
}, r);
n[t] = o,
this._fonts.push(o),
this.styleID++;
const s = new FontFace(o.family,`url(${o.src})`,{
weight: o.weight,
style: o.style,
display: o.display
});
o.fontFace = s,
await s.load(),
document.fonts.add(s),
await document.fonts.ready,
this.styleID++,
this.fontsDirty = !0
}
))
}
addOverride(...e) {
const t = e.filter((e => !this._overrides.includes(e)));
t.length > 0 && (this._overrides.push(...t),
this.styleID++)
}
removeOverride(...e) {
const t = e.filter((e => this._overrides.includes(e)));
t.length > 0 && (this._overrides = this._overrides.filter((e => !
t.includes(e))),
this.styleID++)
}
toCSS(e) {
return [`transform: scale(${e})`, "transform-origin: top left",
"display: inline-block", `color: ${this.normalizeColor(this.fill)}`, `font-size: $
{this.fontSize}px`, `font-family: ${this.fontFamily}`, `font-weight: $
{this.fontWeight}`, `font-style: ${this.fontStyle}`, `font-variant: $
{this.fontVariant}`, `letter-spacing: ${this.letterSpacing}px`, `text-align: $
{this.align}`, `padding: ${this.padding}px`, `white-space: $
{this.whiteSpace}`, ...this.lineHeight ? [`line-height: ${this.lineHeight}px`] :
[], ...this.wordWrap ? ["word-wrap: " + (this.breakWords ? "break-all" : "break-
word"), `max-width: ${this.wordWrapWidth}px`] : [], ...this.strokeThickness ? [`-
webkit-text-stroke-width: ${this.strokeThickness}px`, `-webkit-text-stroke-color: $
{this.normalizeColor(this.stroke)}`, `text-stroke-width: $
{this.strokeThickness}px`, `text-stroke-color: $
{this.normalizeColor(this.stroke)}`, "paint-order: stroke"] :
[], ...this.dropShadow ? [this.dropShadowToCSS()] :
[], ...this._overrides].join(";")
}
toGlobalCSS() {
return this._fonts.reduce(( (e, t) => `${e}\n @font-face
{\n font-family: "${t.family}";\n src: url('$
{t.dataSrc}');\n font-weight: ${t.weight};\n font-
style: ${t.style};\n font-display: ${t.display};\n }`),
this._stylesheet)
}
get stylesheet() {
return this._stylesheet
}
set stylesheet(e) {
this._stylesheet !== e && (this._stylesheet = e,
this.styleID++)
}
normalizeColor(e) {
return Array.isArray(e) && (e = rgb2hex(e)),
"number" == typeof e ? hex2string(e) : e
}
dropShadowToCSS() {
let e = this.normalizeColor(this.dropShadowColor);
const t = this.dropShadowAlpha
, r = Math.round(Math.cos(this.dropShadowAngle) *
this.dropShadowDistance)
, n = Math.round(Math.sin(this.dropShadowAngle) *
this.dropShadowDistance);
e.startsWith("#") && t < 1 && (e += (255 * t |
0).toString(16).padStart(2, "0"));
const i = `${r}px ${n}px`;
return this.dropShadowBlur > 0 ? `text-shadow: ${i} $
{this.dropShadowBlur}px ${e}` : `text-shadow: ${i} ${e}`
}
reset() {
Object.assign(this, e.defaultOptions)
}
onBeforeDraw() {
const {fontsDirty: e} = this;
return this.fontsDirty = !1,
this.isSafari && this._fonts.length > 0 && e ? new Promise((e =>
setTimeout(e, 100))) : Promise.resolve()
}
get isSafari() {
const {userAgent: e} = settings.ADAPTER.getNavigator();
return /^((?!chrome|android).)*safari/i.test(e)
}
set fillGradientStops(e) {}
get fillGradientStops() {
return super.fillGradientStops
}
set fillGradientType(e) {}
get fillGradientType() {
return super.fillGradientType
}
set miterLimit(e) {}
get miterLimit() {
return super.miterLimit
}
set trim(e) {}
get trim() {
return super.trim
}
set textBaseline(e) {}
get textBaseline() {
return super.textBaseline
}
set leading(e) {}
get leading() {
return super.leading
}
set lineJoin(e) {}
get lineJoin() {
return super.lineJoin
}
}
;
_HTMLTextStyle.availableFonts = {},
_HTMLTextStyle.defaultOptions = {
align: "left",
breakWords: !1,
dropShadow: !1,
dropShadowAlpha: 1,
dropShadowAngle: Math.PI / 6,
dropShadowBlur: 0,
dropShadowColor: "black",
dropShadowDistance: 5,
fill: "black",
fontFamily: "Arial",
fontSize: 26,
fontStyle: "normal",
fontVariant: "normal",
fontWeight: "normal",
letterSpacing: 0,
lineHeight: 0,
padding: 0,
stroke: "black",
strokeThickness: 0,
whiteSpace: "normal",
wordWrap: !1,
wordWrapWidth: 100
};
let HTMLTextStyle = _HTMLTextStyle;
const _HTMLText = class e extends Sprite {
constructor(t="", r={}) {
super(Texture.EMPTY),
this._text = null,
this._style = null,
this._autoResolution = !0,
this.localStyleID = -1,
this.dirty = !1,
this._updateID = 0,
this.ownsStyle = !1;
const n = new Image
, i = Texture.from(n, {
scaleMode: settings.SCALE_MODE,
resourceOptions: {
autoLoad: !1
}
});
i.orig = new Rectangle,
i.trim = new Rectangle,
this.texture = i;
const o = "http://www.w3.org/2000/svg"
, s = "http://www.w3.org/1999/xhtml"
, a = document.createElementNS(o, "svg")
, l = document.createElementNS(o, "foreignObject")
, c = document.createElementNS(s, "div")
, u = document.createElementNS(s, "style");
l.setAttribute("width", "10000"),
l.setAttribute("height", "10000"),
l.style.overflow = "hidden",
a.appendChild(l),
this.maxWidth = e.defaultMaxWidth,
this.maxHeight = e.defaultMaxHeight,
this._domElement = c,
this._styleElement = u,
this._svgRoot = a,
this._foreignObject = l,
this._foreignObject.appendChild(u),
this._foreignObject.appendChild(c),
this._image = n,
this._loadImage = new Image,
this._autoResolution = e.defaultAutoResolution,
this._resolution = e.defaultResolution ?? settings.RESOLUTION,
this.text = t,
this.style = r
}
measureText(e) {
var t, r;
const {text: n, style: i, resolution: o} = Object.assign({
text: this._text,
style: this._style,
resolution: this._resolution
}, e);
Object.assign(this._domElement, {
innerHTML: n,
style: i.toCSS(o)
}),
this._styleElement.textContent = i.toGlobalCSS(),
document.body.appendChild(this._svgRoot);
const s = this._domElement.getBoundingClientRect();
this._svgRoot.remove();
const {width: a, height: l} = s;
a > this.maxWidth || this.maxHeight;
const c = Math.min(this.maxWidth, Math.ceil(a))
, u = Math.min(this.maxHeight, Math.ceil(l));
return this._svgRoot.setAttribute("width", c.toString()),
this._svgRoot.setAttribute("height", u.toString()),
n !== this._text && (this._domElement.innerHTML = this._text),
i !== this._style && (Object.assign(this._domElement, {
style: null == (t = this._style) ? void 0 : t.toCSS(o)
}),
this._styleElement.textContent = null == (r = this._style) ? void 0
: r.toGlobalCSS()),
{
width: c + 2 * i.padding,
height: u + 2 * i.padding
}
}
async updateText(e=!0) {
const {style: t, _image: r, _loadImage: n} = this;
if (this.localStyleID !== t.styleID && (this.dirty = !0,
this.localStyleID = t.styleID),
!this.dirty && e)
return;
const {width: i, height: o} = this.measureText();
r.width = n.width = Math.ceil(Math.max(1, i)),
r.height = n.height = Math.ceil(Math.max(1, o)),
this._updateID++;
const s = this._updateID;
await new Promise((e => {
n.onload = async () => {
s < this._updateID || (await t.onBeforeDraw(),
r.src = n.src,
n.onload = null,
n.src = "",
this.updateTexture()),
e()
}
;
const i = (new XMLSerializer).serializeToString(this._svgRoot);
n.src = `data:image/svg+xml;charset=utf8,$
{encodeURIComponent(i)}`
}
))
}
get source() {
return this._image
}
updateTexture() {
const {style: e, texture: t, _image: r, resolution: n} = this
, {padding: i} = e
, {baseTexture: o} = t;
t.trim.width = t._frame.width = r.width / n,
t.trim.height = t._frame.height = r.height / n,
t.trim.x = -i,
t.trim.y = -i,
t.orig.width = t._frame.width - 2 * i,
t.orig.height = t._frame.height - 2 * i,
this._onTextureUpdate(),
o.setRealSize(r.width, r.height, n),
this.dirty = !1
}
_render(e) {
this._autoResolution && this._resolution !== e.resolution &&
(this._resolution = e.resolution,
this.dirty = !0),
this.updateText(!0),
super._render(e)
}
_renderCanvas(e) {
this._autoResolution && this._resolution !== e.resolution &&
(this._resolution = e.resolution,
this.dirty = !0),
this.updateText(!0),
super._renderCanvas(e)
}
getLocalBounds(e) {
return this.updateText(!0),
super.getLocalBounds(e)
}
_calculateBounds() {
this.updateText(!0),
this.calculateVertices(),
this._bounds.addQuad(this.vertexData)
}
_onStyleChange() {
this.dirty = !0
}
destroy(t) {
var r, n, i, o, s;
"boolean" == typeof t && (t = {
children: t
}),
t = Object.assign({}, e.defaultDestroyOptions, t),
super.destroy(t);
const a = null;
this.ownsStyle && (null == (r = this._style) || r.cleanFonts()),
this._style = a,
null == (n = this._svgRoot) || n.remove(),
this._svgRoot = a,
null == (i = this._domElement) || i.remove(),
this._domElement = a,
null == (o = this._foreignObject) || o.remove(),
this._foreignObject = a,
null == (s = this._styleElement) || s.remove(),
this._styleElement = a,
this._loadImage.src = "",
this._loadImage.onload = null,
this._loadImage = a,
this._image.src = "",
this._image = a
}
get width() {
return this.updateText(!0),
Math.abs(this.scale.x) * this._image.width / this.resolution
}
set width(e) {
this.updateText(!0);
const t = sign$1(this.scale.x) || 1;
this.scale.x = t * e / this._image.width / this.resolution,
this._width = e
}
get height() {
return this.updateText(!0),
Math.abs(this.scale.y) * this._image.height / this.resolution
}
set height(e) {
this.updateText(!0);
const t = sign$1(this.scale.y) || 1;
this.scale.y = t * e / this._image.height / this.resolution,
this._height = e
}
get style() {
return this._style
}
set style(e) {
this._style !== e && ((e = e || {})instanceof HTMLTextStyle ?
(this.ownsStyle = !1,
this._style = e) : e instanceof TextStyle$3 ? (this.ownsStyle = !0,
this._style = HTMLTextStyle.from(e)) : (this.ownsStyle = !0,
this._style = new HTMLTextStyle(e)),
this.localStyleID = -1,
this.dirty = !0)
}
get text() {
return this._text
}
set text(e) {
e = String("" === e || null == e ? " " : e),
e = this.sanitiseText(e),
this._text !== e && (this._text = e,
this.dirty = !0)
}
get resolution() {
return this._resolution
}
set resolution(e) {
this._autoResolution = !1,
this._resolution !== e && (this._resolution = e,
this.dirty = !0)
}
sanitiseText(e) {
return e.replace(/<br>/gi, "<br/>").replace(/<hr>/gi,
"<hr/>").replace(/ /gi, " ")
}
}
;
_HTMLText.defaultDestroyOptions = {
texture: !0,
children: !1,
baseTexture: !0
},
_HTMLText.defaultMaxWidth = 2024,
_HTMLText.defaultMaxHeight = 2024,
_HTMLText.defaultAutoResolution = !0;
let nanoid = (e=21) => crypto.getRandomValues(new
Uint8Array(e)).reduce(( (e, t) => e += (t &= 63) < 36 ? t.toString(36) : t < 62 ?
(t - 26).toString(36).toUpperCase() : t > 62 ? "-" : "_"), "");
const config$2 = {
MAX_TRACKINDEX: 1e4,
cdnHost: "https://cdn.h5ds.com",
img404: "https://cdn.h5ds.com/assets/images/404.png",
fps: 60,
emptyBase64:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8
/wcAAwAB/1IApAAAAABJRU5ErkJggg=="
};
var arrayMap$6 = _arrayMap;
function baseValues$1(e, t) {
return arrayMap$6(t, (function(t) {
return e[t]
}
))
}
var _baseValues = baseValues$1
, baseValues = _baseValues
, keys$7 = keys_1;
function values$1(e) {
return null == e ? [] : baseValues(e, keys$7(e))
}
var values_1 = values$1;
const _values = getDefaultExportFromCjs(values_1);
var getNative$2 = _getNative
, defineProperty$6 = function() {
try {
var e = getNative$2(Object, "defineProperty");
return e({}, "", {}),
e
} catch (e2) {}
}()
, _defineProperty$4 = defineProperty$6
, defineProperty$5 = _defineProperty$4;
function baseAssignValue$6(e, t, r) {
"__proto__" == t && defineProperty$5 ? defineProperty$5(e, t, {
configurable: !0,
enumerable: !0,
value: r,
writable: !0
}) : e[t] = r
}
var _baseAssignValue = baseAssignValue$6;
function arrayAggregator$1(e, t, r, n) {
for (var i = -1, o = null == e ? 0 : e.length; ++i < o; ) {
var s = e[i];
t(n, s, r(s), e)
}
return n
}
var _arrayAggregator = arrayAggregator$1;
function createBaseFor$2(e) {
return function(t, r, n) {
for (var i = -1, o = Object(t), s = n(t), a = s.length; a--; ) {
var l = s[e ? a : ++i];
if (!1 === r(o[l], l, o))
break
}
return t
}
}
var _createBaseFor = createBaseFor$2
, createBaseFor$1 = _createBaseFor
, baseFor$4 = createBaseFor$1()
, _baseFor = baseFor$4
, baseFor$3 = _baseFor
, keys$6 = keys_1;
function baseForOwn$3(e, t) {
return e && baseFor$3(e, t, keys$6)
}
var _baseForOwn = baseForOwn$3
, isArrayLike$a = isArrayLike_1;
function createBaseEach$2(e, t) {
return function(r, n) {
if (null == r)
return r;
if (!isArrayLike$a(r))
return e(r, n);
for (var i = r.length, o = t ? i : -1, s = Object(r); (t ? o-- : +
+o < i) && !1 !== n(s[o], o, s); )
;
return r
}
}
var _createBaseEach = createBaseEach$2
, baseForOwn$2 = _baseForOwn
, createBaseEach$1 = _createBaseEach
, baseEach$5 = createBaseEach$1(baseForOwn$2)
, _baseEach = baseEach$5
, baseEach$4 = _baseEach;
function baseAggregator$1(e, t, r, n) {
return baseEach$4(e, (function(e, i, o) {
t(n, e, r(e), o)
}
)),
n
}
var _baseAggregator = baseAggregator$1
, arrayAggregator = _arrayAggregator
, baseAggregator = _baseAggregator
, baseIteratee$4 = _baseIteratee
, isArray$d = isArray_1;
function createAggregator$1(e, t) {
return function(r, n) {
var i = isArray$d(r) ? arrayAggregator : baseAggregator
, o = t ? t() : {};
return i(r, e, baseIteratee$4(n), o)
}
}
var _createAggregator = createAggregator$1
, baseAssignValue$5 = _baseAssignValue
, createAggregator = _createAggregator
, objectProto$m = Object.prototype
, hasOwnProperty$m = objectProto$m.hasOwnProperty
, groupBy$1 = createAggregator((function(e, t, r) {
hasOwnProperty$m.call(e, r) ? e[r].push(t) : baseAssignValue$5(e, r,
[t])
}
))
, groupBy_1 = groupBy$1;
const groupBy$2 = getDefaultExportFromCjs(groupBy_1);
var DP = 20
, RM = 1
, MAX_DP = 1e6
, MAX_POWER = 1e6
, NE = -7
, PE = 21
, STRICT = !1
, NAME = "[big.js] "
, INVALID = NAME + "Invalid "
, INVALID_DP = INVALID + "decimal places"
, INVALID_RM = INVALID + "rounding mode"
, DIV_BY_ZERO = NAME + "Division by zero"
, P$3 = {}
, UNDEFINED$1 = void 0
, NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
function _Big_() {
function e(t) {
var r = this;
if (!(r instanceof e))
return t === UNDEFINED$1 ? _Big_() : new e(t);
if (t instanceof e)
r.s = t.s,
r.e = t.e,
r.c = t.c.slice();
else {
if ("string" != typeof t) {
if (!0 === e.strict && "bigint" != typeof t)
throw TypeError(INVALID + "value");
t = 0 === t && 1 / t < 0 ? "-0" : String(t)
}
parse$3(r, t)
}
r.constructor = e
}
return e.prototype = P$3,
e.DP = DP,
e.RM = RM,
e.NE = NE,
e.PE = PE,
e.strict = STRICT,
e.roundDown = 0,
e.roundHalfUp = 1,
e.roundHalfEven = 2,
e.roundUp = 3,
e
}
function parse$3(e, t) {
var r, n, i;
if (!NUMERIC.test(t))
throw Error(INVALID + "number");
for (e.s = "-" == t.charAt(0) ? (t = t.slice(1),
-1) : 1,
(r = t.indexOf(".")) > -1 && (t = t.replace(".", "")),
(n = t.search(/e/i)) > 0 ? (r < 0 && (r = n),
r += +t.slice(n + 1),
t = t.substring(0, n)) : r < 0 && (r = t.length),
i = t.length,
n = 0; n < i && "0" == t.charAt(n); )
++n;
if (n == i)
e.c = [e.e = 0];
else {
for (; i > 0 && "0" == t.charAt(--i); )
;
for (e.e = r - n - 1,
e.c = [],
r = 0; n <= i; )
e.c[r++] = +t.charAt(n++)
}
return e
}
function round(e, t, r, n) {
var i = e.c;
if (r === UNDEFINED$1 && (r = e.constructor.RM),
0 !== r && 1 !== r && 2 !== r && 3 !== r)
throw Error(INVALID_RM);
if (t < 1)
n = 3 === r && (n || !!i[0]) || 0 === t && (1 === r && i[0] >= 5 ||
2 === r && (i[0] > 5 || 5 === i[0] && (n || i[1] !== UNDEFINED$1))),
i.length = 1,
n ? (e.e = e.e - t + 1,
i[0] = 1) : i[0] = e.e = 0;
else if (t < i.length) {
if (n = 1 === r && i[t] >= 5 || 2 === r && (i[t] > 5 || 5 === i[t]
&& (n || i[t + 1] !== UNDEFINED$1 || 1 & i[t - 1])) || 3 === r && (n || !!i[0]),
i.length = t,
n)
for (; ++i[--t] > 9; )
if (i[t] = 0,
0 === t) {
++e.e,
i.unshift(1);
break
}
for (t = i.length; !i[--t]; )
i.pop()
}
return e
}
function stringify(e, t, r) {
var n = e.e
, i = e.c.join("")
, o = i.length;
if (t)
i = i.charAt(0) + (o > 1 ? "." + i.slice(1) : "") + (n < 0 ? "e" :
"e+") + n;
else if (n < 0) {
for (; ++n; )
i = "0" + i;
i = "0." + i
} else if (n > 0)
if (++n > o)
for (n -= o; n--; )
i += "0";
else
n < o && (i = i.slice(0, n) + "." + i.slice(n));
else
o > 1 && (i = i.charAt(0) + "." + i.slice(1));
return e.s < 0 && r ? "-" + i : i
}
P$3.abs = function() {
var e = new this.constructor(this);
return e.s = 1,
e
}
,
P$3.cmp = function(e) {
var t, r = this, n = r.c, i = (e = new r.constructor(e)).c, o = r.s, s
= e.s, a = r.e, l = e.e;
if (!n[0] || !i[0])
return n[0] ? o : i[0] ? -s : 0;
if (o != s)
return o;
if (t = o < 0,
a != l)
return a > l ^ t ? 1 : -1;
for (s = (a = n.length) < (l = i.length) ? a : l,
o = -1; ++o < s; )
if (n[o] != i[o])
return n[o] > i[o] ^ t ? 1 : -1;
return a == l ? 0 : a > l ^ t ? 1 : -1
}
,
P$3.div = function(e) {
var t = this
, r = t.constructor
, n = t.c
, i = (e = new r(e)).c
, o = t.s == e.s ? 1 : -1
, s = r.DP;
if (s !== ~~s || s < 0 || s > MAX_DP)
throw Error(INVALID_DP);
if (!i[0])
throw Error(DIV_BY_ZERO);
if (!n[0])
return e.s = o,
e.c = [e.e = 0],
e;
var a, l, c, u, d, p = i.slice(), h = a = i.length, f = n.length, m =
n.slice(0, a), g = m.length, y = e, v = y.c = [], b = 0, x = s + (y.e = t.e - e.e)
+ 1;
for (y.s = o,
o = x < 0 ? 0 : x,
p.unshift(0); g++ < a; )
m.push(0);
do {
for (c = 0; c < 10; c++) {
if (a != (g = m.length))
u = a > g ? 1 : -1;
else
for (d = -1,
u = 0; ++d < a; )
if (i[d] != m[d]) {
u = i[d] > m[d] ? 1 : -1;
break
}
if (!(u < 0))
break;
for (l = g == a ? i : p; g; ) {
if (m[--g] < l[g]) {
for (d = g; d && !m[--d]; )
m[d] = 9;
--m[d],
m[g] += 10
}
m[g] -= l[g]
}
for (; !m[0]; )
m.shift()
}
v[b++] = u ? c : ++c,
m[0] && u ? m[g] = n[h] || 0 : m = [n[h]]
} while ((h++ < f || m[0] !== UNDEFINED$1) && o--);
return v[0] || 1 == b || (v.shift(),
y.e--,
x--),
b > x && round(y, x, r.RM, m[0] !== UNDEFINED$1),
y
}
,
P$3.eq = function(e) {
return 0 === this.cmp(e)
}
,
P$3.gt = function(e) {
return this.cmp(e) > 0
}
,
P$3.gte = function(e) {
return this.cmp(e) > -1
}
,
P$3.lt = function(e) {
return this.cmp(e) < 0
}
,
P$3.lte = function(e) {
return this.cmp(e) < 1
}
,
P$3.minus = P$3.sub = function(e) {
var t, r, n, i, o = this, s = o.constructor, a = o.s, l = (e = new
s(e)).s;
if (a != l)
return e.s = -l,
o.plus(e);
var c = o.c.slice()
, u = o.e
, d = e.c
, p = e.e;
if (!c[0] || !d[0])
return d[0] ? e.s = -l : c[0] ? e = new s(o) : e.s = 1,
e;
if (a = u - p) {
for ((i = a < 0) ? (a = -a,
n = c) : (p = u,
n = d),
n.reverse(),
l = a; l--; )
n.push(0);
n.reverse()
} else
for (r = ((i = c.length < d.length) ? c : d).length,
a = l = 0; l < r; l++)
if (c[l] != d[l]) {
i = c[l] < d[l];
break
}
if (i && (n = c,
c = d,
d = n,
e.s = -e.s),
(l = (r = d.length) - (t = c.length)) > 0)
for (; l--; )
c[t++] = 0;
for (l = t; r > a; ) {
if (c[--r] < d[r]) {
for (t = r; t && !c[--t]; )
c[t] = 9;
--c[t],
c[r] += 10
}
c[r] -= d[r]
}
for (; 0 === c[--l]; )
c.pop();
for (; 0 === c[0]; )
c.shift(),
--p;
return c[0] || (e.s = 1,
c = [p = 0]),
e.c = c,
e.e = p,
e
}
,
P$3.mod = function(e) {
var t, r = this, n = r.constructor, i = r.s, o = (e = new n(e)).s;
if (!e.c[0])
throw Error(DIV_BY_ZERO);
return r.s = e.s = 1,
t = 1 == e.cmp(r),
r.s = i,
e.s = o,
t ? new n(r) : (i = n.DP,
o = n.RM,
n.DP = n.RM = 0,
r = r.div(e),
n.DP = i,
n.RM = o,
this.minus(r.times(e)))
}
,
P$3.neg = function() {
var e = new this.constructor(this);
return e.s = -e.s,
e
}
,
P$3.plus = P$3.add = function(e) {
var t, r, n, i = this, o = i.constructor;
if (e = new o(e),
i.s != e.s)
return e.s = -e.s,
i.minus(e);
var s = i.e
, a = i.c
, l = e.e
, c = e.c;
if (!a[0] || !c[0])
return c[0] || (a[0] ? e = new o(i) : e.s = i.s),
e;
if (a = a.slice(),
t = s - l) {
for (t > 0 ? (l = s,
n = c) : (t = -t,
n = a),
n.reverse(); t--; )
n.push(0);
n.reverse()
}
for (a.length - c.length < 0 && (n = c,
c =
a,
a =
n),
t =
c.length,
r =
0; t; a[t] %= 10)
r = (a[--t] = a[t] + c[t] + r) / 10 | 0;
for (r && (a.unshift(r),
++l),
t = a.length; 0 === a[--t]; )
a.pop();
return e.c = a,
e.e = l,
e
}
,
P$3.pow = function(e) {
var t = this
, r = new t.constructor("1")
, n = r
, i = e < 0;
if (e !== ~~e || e < -MAX_POWER || e > MAX_POWER)
throw Error(INVALID + "exponent");
for (i && (e = -e); 1 & e && (n = n.times(t)),
e >>= 1; )
t = t.times(t);
return i ? r.div(n) : n
}
,
P$3.prec = function(e, t) {
if (e !== ~~e || e < 1 || e > MAX_DP)
throw Error(INVALID + "precision");
return round(new this.constructor(this), e, t)
}
,
P$3.round = function(e, t) {
if (e === UNDEFINED$1)
e = 0;
else if (e !== ~~e || e < -MAX_DP || e > MAX_DP)
throw Error(INVALID_DP);
return round(new this.constructor(this), e + this.e + 1, t)
}
,
P$3.sqrt = function() {
var e, t, r, n = this, i = n.constructor, o = n.s, s = n.e, a = new
i("0.5");
if (!n.c[0])
return new i(n);
if (o < 0)
throw Error(NAME + "No square root");
0 === (o = Math.sqrt(n + "")) || o === 1 / 0 ? ((t =
n.c.join("")).length + s & 1 || (t += "0"),
s = ((s + 1) / 2 | 0) - (s < 0 || 1 & s),
e = new i(((o = Math.sqrt(t)) == 1 / 0 ? "5e" : (o =
o.toExponential()).slice(0, o.indexOf("e") + 1)) + s)) : e = new i(o + ""),
s = e.e + (i.DP += 4);
do {
r = e,
e = a.times(r.plus(n.div(r)))
} while (r.c.slice(0, s).join("") !== e.c.slice(0, s).join(""));
return round(e, (i.DP -= 4) + e.e + 1, i.RM)
}
,
P$3.times = P$3.mul = function(e) {
var t, r = this, n = r.constructor, i = r.c, o = (e = new n(e)).c, s =
i.length, a = o.length, l = r.e, c = e.e;
if (e.s = r.s == e.s ? 1 : -1,
!i[0] || !o[0])
return e.c = [e.e = 0],
e;
for (e.e = l + c,
s < a && (t = i,
i = o,
o = t,
c = s,
s = a,
a = c),
t = new Array(c = s + a); c--; )
t[c] = 0;
for (l = a; l--; ) {
for (a = 0,
c = s + l; c > l; )
a = t[c] + o[l] * i[c - l - 1] + a,
t[c--] = a % 10,
a = a / 10 | 0;
t[c] = a
}
for (a ? ++e.e : t.shift(),
l = t.length; !t[--l]; )
t.pop();
return e.c = t,
e
}
,
P$3.toExponential = function(e, t) {
var r = this
, n = r.c[0];
if (e !== UNDEFINED$1) {
if (e !== ~~e || e < 0 || e > MAX_DP)
throw Error(INVALID_DP);
for (r = round(new r.constructor(r), ++e, t); r.c.length < e; )
r.c.push(0)
}
return stringify(r, !0, !!n)
}
,
P$3.toFixed = function(e, t) {
var r = this
, n = r.c[0];
if (e !== UNDEFINED$1) {
if (e !== ~~e || e < 0 || e > MAX_DP)
throw Error(INVALID_DP);
for (e = e + (r = round(new r.constructor(r), e + r.e + 1, t)).e +
1; r.c.length < e; )
r.c.push(0)
}
return stringify(r, !1, !!n)
}
,
P$3[Symbol.for("nodejs.util.inspect.custom")] = P$3.toJSON = P$3.toString =
function() {
var e = this
, t = e.constructor;
return stringify(e, e.e <= t.NE || e.e >= t.PE, !!e.c[0])
}
,
P$3.toNumber = function() {
var e = Number(stringify(this, !0, !0));
if (!0 === this.constructor.strict && !this.eq(e.toString()))
throw Error(NAME + "Imprecise conversion");
return e
}
,
P$3.toPrecision = function(e, t) {
var r = this
, n = r.constructor
, i = r.c[0];
if (e !== UNDEFINED$1) {
if (e !== ~~e || e < 1 || e > MAX_DP)
throw Error(INVALID + "precision");
for (r = round(new n(r), e, t); r.c.length < e; )
r.c.push(0)
}
return stringify(r, e <= r.e || r.e <= n.NE || r.e >= n.PE, !!i)
}
,
P$3.valueOf = function() {
var e = this
, t = e.constructor;
if (!0 === t.strict)
throw Error(NAME + "valueOf disallowed");
return stringify(e, e.e <= t.NE || e.e >= t.PE, !0)
}
;
var Big = _Big_();
function insertFrameItem(e, t) {
t.frames || (t.frames = []);
const r = t.frames.find((t => t.startTime === e.startTime));
if (r) {
const t = r.id;
Object.assign(r, {
...e
}, {
id: t
})
} else
t.frames.push(e);
return t.frames.sort(( (e, t) => e.startTime - t.startTime)),
!0
}
function removeReplayResource(e) {
const t = [];
e.elements.forEach((e => {
var r;
e.resourceId && t.push(e.resourceId),
(null == (r = e.mask) ? void 0 : r.resourceId) &&
t.push(e.mask.resourceId)
}
)),
e.resouces.forEach((e => {
"audio" === e.type && e.noAudioTracks && (e.noAudioTracks = !1)
}
)),
remove$2(e.resouces, (e => !t.includes(e.id)))
}
function createFrameItem(e, t) {
const r = {
id: createID(),
startTime: e
};
return t.style && ["x", "y", "width", "height", "alpha",
"rotation"].forEach((e => {
r[e] = t.style[e],
"alpha" === e && void 0 === r.alpha && (r.alpha = 1)
}
)),
t.mask && ["x", "y", "width", "height", "alpha", "rotation",
"blur"].forEach((e => {
const n = e.charAt(0).toUpperCase() + e.slice(1);
r["mask" + n] = t.mask[e],
"alpha" === e && void 0 === r.alpha && (r.alpha = 1)
}
)),
t.filters && ["saturation", "tint", "hue", "brightness", "exposure",
"contrast", "highlights", "sharpen", "clarity", "smooth", "blur", "grain",
"vignetteWhite", "vignetteBlack", "fill"].forEach((e => {
var n;
const i = null == (n = t.filters) ? void 0 : n.find((t => t.name
=== e));
i && (r[e] = i.params.value)
}
)),
void 0 !== t.intensity && (r.intensity = t.intensity),
r
}
function childrenInjectProps(e, t) {
return t instanceof Array ? t.map((t =>
React.Children.toArray(t).map((t => React.cloneElement(t, {
...e
}))))) : React.Children.toArray(t).map((t => React.cloneElement(t, {
...e
})))
}
function syncControlToElement(e, t) {
const r = t.controlElements.find((t => t.elementId === e));
if (r) {
const n = getElementById(e, t.data);
if (n) {
if ("editMask" === t.controlModeType) {
const {elementId: e, ...t} = r;
for (const i in t)
switch (i) {
case "x":
case "y":
case "width":
case "height":
n.mask[i] = toNum(r[i]);
default:
n.mask[i] = toNum(r[i], 2)
}
return !0
}
if ("caption" === n.type) {
const {elementId: e, ...i} = r;
return t.data.captions.forEach((e => {
for (const t in i)
switch (t) {
case "x":
case "y":
e.style[t] = toNum(r[t]);
break;
case "width":
case "height":
n.style[t] = toNum(r[t]);
break;
default:
e.style[t] = toNum(r[t], 2)
}
}
)),
!0
}
if (n.style) {
const {elementId: e, ...t} = r;
for (const i in t)
switch (i) {
case "x":
case "y":
case "width":
case "height":
n.style[i] = toNum(r[i]);
default:
n.style[i] = toNum(r[i], 2)
}
return !0
}
return !1
}
return !1
}
return !1
}
function getElementById(e, t) {
const {elements: r, captions: n} = t
, i = r.find((t => t.id === e))
, o = n.find((t => t.id === e));
return i || o
}
function truncateDecimals(e, t) {
const r = Math.pow(10, t);
return Math.trunc(e * r) / r
}
function getInsertTrackIndex(e, t, r, n) {
const i = groupByTrackIndex(r.elements);
let o = 0
, s = 1 / 0;
for (let a = 0; a < i.length; a++) {
const {trackIndex: t} = i[a][0];
t === e && (o = i[a - 1] ? i[a - 1][0].trackIndex : 0,
s = i[a + 1] ? i[a + 1][0].trackIndex : 1 / 0)
}
switch (t) {
case "up":
return new Big(o),
inserValAB(o, e);
case "down":
return s === 1 / 0 ? e + 1 : (new Big(e),
inserValAB(o, e));
case "auto":
{
if (!n)
return new Big(o),
inserValAB(o, e);
const t = [];
["video", "image"].includes(n.elementType) ? t.push("video",
"image") : t.push(n.elementType);
const i = groupByTrackIndex(r.elements.filter((e =>
t.includes(e.type))));
for (const r of i) {
let t = !1;
for (const e of r) {
const r = e.speed || 1;
if (crashRects({
x: e.startTime,
y: 0,
width: e.duration / r,
height: 1
}, {
x: n.time,
y: 0,
width: n.duration || 5,
height: 1
})) {
t = !0;
break
}
}
return t ? inserValAB(o, e) : r[0].trackIndex
}
return inserValAB(o, e)
}
}
}
function groupByTrackIndex(e) {
const t = groupBy$2(e, "trackIndex")
, r = _values(t);
return r.forEach((e => {
e.sort(( (e, t) => e.startTime - t.startTime))
}
)),
r.sort(( (e, t) => e[0].trackIndex - t[0].trackIndex))
}
function getTotalTime(e) {
const {captions: t, elements: r} = e;
let n = 0;
return t.forEach((e => {
const t = e.startTime + e.duration;
n = Math.max(n, t)
}
)),
r.forEach((e => {
const {startTime: t, duration: r} = e
, i = t + r / (e.speed || 1);
n = Math.max(n, i)
}
)),
n
}
function getElementsByIds(e, t) {
let r = null;
return t.forEach((t => {
if (e.includes(t.id)) {
r || (r = []),
r.push(t);
const n = t.children;
n && getElementsByIds(e, n)
}
}
)),
r
}
function getAllElements(e, t) {
e || (e = [...t.elements]);
const r = [];
return e.forEach((e => {
r.push(e);
const n = e.children;
n && getAllElements(n, t)
}
)),
r
}
function geVideoSizeResolution(e="720P", t) {
const [r,n] = t.split(":").map((e => Number(e)));
if (!r || !n)
return !1;
let i = null
, o = 0;
switch (e.toLocaleUpperCase()) {
case "480P":
i = getAutoSize(480, [r, n]),
o = 1e6;
break;
case "720P":
i = getAutoSize(720, [r, n]),
o = 6e6;
break;
case "1080P":
i = getAutoSize(1080, [r, n]),
o = 8e6;
break;
case "2K":
i = getAutoSize(1440, [r, n]),
o = 8e6;
break;
case "4K":
i = getAutoSize(2160, [r, n]),
o = 12e6
}
return !!i && {
bitrate: o,
...i
}
}
async function getFFmpegAudioCMD(e, t) {
const r = []
, n = []
, i = []
, o = [];
let s = "";
const a = {};
let l = 0;
for (let c = 0; c < e.length; c++) {
const u = e[c];
if (0 === u.volume || u.muted)
continue;
const d = `input${l}${u.exec}`;
a[u.originURL] || ("server" === t ? o.push({
name: d,
data: u.originURL
}) : o.push({
name: d,
data: await fetchFile(u.url)
}),
a[u.originURL] = d),
n.push("-ss", String(toNum((u.clipTime || 0) * u.speed, 2)), "-t",
String(toNum(u.duration * u.speed, 2)), "-i", a[u.originURL] || d);
const p = [];
if (void 0 !== u.startTime) {
const e = 1e3 * toNum(u.startTime || .001, 3);
p.push(`adelay=${e}|${e}|${e}`)
}
u.volume && 1 !== u.volume && p.push(`volume=${u.volume}`),
u.speed && 1 !== u.speed && p.push(`atempo=${u.speed}`),
0 === u.fadeInTime && 0 === u.fadeOutTime ||
p.push(`afade=t=in:st=0:d=${u.fadeInTime / u.speed},afade=t=out:st=$
{u.fadeOutTime}:d=${toNum((u.duration * u.speed - u.fadeOutTime) / u.speed, 2)}`),
r.push(`[${l}:a]${p.join(",")}[aout_${l}]`),
i.push(`[aout_${l}]`),
s = `[aout_${l}]`,
l++
}
return i.length >= 1 && (s = "[aout]",
r.push(`${i.join("")}amix=inputs=$
{i.length}:duration=longest:normalize=0${s}`),
n.push("-filter_complex", r.join(";")),
n.push("-c:a", "libmp3lame", "-map_chapters", "-1", "-map", s)),
n.push("remix.mp3"),
{
files: [...o],
arguments: [...n],
fileType: "audio/mp3"
}
}
async function fetchFile(e) {
return await fetch(e).then((async e => {
let t = await e.arrayBuffer();
return new Uint8Array(t)
}
))
}
function getAllMedia(e, t, r) {
const [n,i] = r || [0, getTotalTime(e)];
return (getElementDataByTypes(["audio", "video"], e) || []).map((e => {
if (e.noAudioTracks)
return null;
const r = {
...e
};
if (n > r.startTime + r.duration)
return null;
if (i < r.startTime)
return null;
n >= r.startTime && n <= r.startTime + r.duration && (r.startTime =
n),
i >= r.startTime && i <= r.startTime + r.duration && (r.duration =
i - r.startTime);
const o = t.resourceManage.getCacheItemBySourceId(r.resourceId);
return o && !o.resource.noAudioTracks ? {
originURL: o.resource.url,
url: o.bolbURL || o.resource.url,
duration: r.duration,
volume: r.volume,
speed: r.speed,
muted: r.muted,
startTime: r.startTime,
clipTime: r.clipTime,
fadeInTime: r.fadeInTime || 0,
fadeOutTime: r.fadeOutTime || 0,
exec: exec(o.resource.url)
} : null
}
)).filter((e => e))
}
function getAutoSize(e, [t,r]) {
const n = {
width: 0,
height: 0
};
return t > r ? (n.height = e,
n.width = e * (t / r)) : (n.width = e,
n.height = e * (r / t)),
n.width = 2 * Math.round(n.width / 2),
n.height = 2 * Math.round(n.height / 2),
n
}
function fitVideoSize(e, t, r) {
const n = {
width: e.width,
height: e.height
}
, i = Math.min(t.width / e.width, t.height / e.height);
getAllElements(e.elements, e).forEach((e => {
const o = e;
if (o.style) {
let e = i;
const s = r.getResouceById(o.resourceId)
, a = calcSizeAndPosition({
...null == s ? void 0 : s.styleSize
}, {
...n
});
e = o.style.width / a.width * calcSizeAndPosition({
...null == s ? void 0 : s.styleSize
}, {
...t
}).width / o.style.width,
o.style.width *= e,
o.style.height *= e;
const l = o.style.x - n.width / 2
, c = o.style.y - n.height / 2;
o.style.x = t.width / 2 + l * e,
o.style.y = t.height / 2 + c * e
}
}
))
}
function getElementDataByTypes(e, t) {
const r = []
, n = t => {
t.forEach((t => {
t.children ? n(t.children) : e.includes(t.type) && r.push(t)
}
))
}
;
return n(t.elements),
r
}
function getEffectiveAudio(e) {
const t = getElementDataByTypes(["audio", "video"], e);
let r = 0;
return t.length && t.forEach((e => {
const t = e;
!t.volume || t.muted || t.separate || r++
}
)),
r
}
function deleteElementByIds(e, t) {
remove$2(t.elements, (t => e.includes(t.id))),
remove$2(t.cameras, (t => e.includes(t.id))),
remove$2(t.transitions, (t => e.includes(t.id))),
remove$2(t.captions, (t => e.includes(t.id)))
}
function addElement(e, t, r) {
switch (t) {
case "camera":
r.cameras.push(e),
r.cameras.sort(( (e, t) => e.startTime - t.startTime));
break;
case "caption":
r.captions.push(e),
r.captions.sort(( (e, t) => e.startTime - t.startTime));
break;
default:
r.elements.push(e),
r.elements.sort(( (e, t) => e.trackIndex - t.trackIndex))
}
}
const helper = Object.freeze(Object.defineProperty({
__proto__: null,
addElement: addElement,
childrenInjectProps: childrenInjectProps,
createFrameItem: createFrameItem,
deleteElementByIds: deleteElementByIds,
fetchFile: fetchFile,
fitVideoSize: fitVideoSize,
geVideoSizeResolution: geVideoSizeResolution,
getAllElements: getAllElements,
getAllMedia: getAllMedia,
getAutoSize: getAutoSize,
getEffectiveAudio: getEffectiveAudio,
getElementById: getElementById,
getElementDataByTypes: getElementDataByTypes,
getElementsByIds: getElementsByIds,
getFFmpegAudioCMD: getFFmpegAudioCMD,
getInsertTrackIndex: getInsertTrackIndex,
getTotalTime: getTotalTime,
groupByTrackIndex: groupByTrackIndex,
insertFrameItem: insertFrameItem,
removeReplayResource: removeReplayResource,
syncControlToElement: syncControlToElement,
truncateDecimals: truncateDecimals
}, Symbol.toStringTag, {
value: "Module"
}));
function solveCubic(e, t, r, n) {
const i = [];
function o(e, t, r) {
let n = r;
for (let i = 0; i < 100; i++) {
const r = e(n)
, i = t(n);
if (Math.abs(r) < 1e-6)
return n;
n -= r / i
}
return null
}
const s = i => e * i ** 3 + t * i ** 2 + r * i + n
, a = n => 3 * e * n ** 2 + 2 * t * n + r;
for (let l = 0; l <= 1; l += .1) {
const e = o(s, a, l);
null !== e && e >= 0 && e <= 1 && i.push(e)
}
return i
}
function findIntersection(e, t) {
const {p1: r, cp1: n, cp2: i, p2: o} = e
, [s,a] = r
, [l,c] = n
, [u,d] = i
, [p,h] = o
, f = solveCubic(3 * l - s - 3 * u + p, 3 * s - 6 * l + 3 * u, -3 * s
+ 3 * l, s - t)
, m = [];
for (const g of f) {
const e = (1 - g) ** 3 * s + 3 * (1 - g) ** 2 * g * l + 3 * (1 - g)
* g ** 2 * u + g ** 3 * p
, t = (1 - g) ** 3 * a + 3 * (1 - g) ** 2 * g * c + 3 * (1 - g) *
g ** 2 * d + g ** 3 * h;
m.push([e, t])
}
return filterClosePoints(m)
}
function filterClosePoints(e, t=1e-6) {
const r = [];
for (const n of e) {
r.every((e => Math.abs(e[0] - n[0]) > t || Math.abs(e[1] - n[1]) >
t)) && r.push(n)
}
return r[0]
}
function getLinesNeighbor(e, t) {}
function mediaInfo$1(e) {
return new Promise((async t => {
const r = await getVideoFile(e);
window.MediaInfo.mediaInfoFactory({
format: "JSON"
}, (async e => {
const n = await e.analyzeData(r.size, (async (e, t) => new
Uint8Array(await r.slice(t, t + e).arrayBuffer()))).then((e => e)).catch((e => {}
));
t(JSON.parse(n))
}
))
}
))
}
async function getVideoFile(e, t="video.mp4") {
try {
const r = await fetch(e);
if (!r.ok)
throw new Error(`无法获取视频: ${r.statusText}`);
const n = await r.blob();
return new File([n],t,{
type: n.type
})
} catch (r) {
throw r
}
}
function createID(e) {
return nanoid(e || 10)
}
function exec(e) {
e = e.split("?")[0];
const [t] = /\.[^.]+$/.exec(e) || [];
return t.split("&")[0]
}
function inserValAB(e, t) {
return (e + t) / 2
}
function crashRects(e, t) {
const {x: r, y: n, width: i, height: o} = e;
let {x: s, y: a, width: l, height: c} = t
, u = !0;
return (r + i < s || s + l < r || n + o < a || a + c < n) && (u = !1),
u
}
async function loadFont(e, t) {
if ("Default" === e && (e = "siYuanHeiTi",
t = ""),
e && !t && (t = `${config$2.cdnHost}/assets/fonts/${e}/font.woff`),
t) {
/^http/.test(t) || (t = config$2.cdnHost + t);
const n = new FontFace(e,`url("${t}")`);
try {
const e = await n.load();
document.fonts.add(e)
} catch (r) {}
}
}
function readFileAsArrayBuffer(e) {
return new Promise(( (t, r) => {
const n = new FileReader;
n.onload = function(e) {
const r = e.target.result;
t(r)
}
,
n.onerror = function(e) {
r()
}
,
n.readAsArrayBuffer(e)
}
))
}
function readFileAsText(e) {
return new Promise(( (t, r) => {
const n = new FileReader;
n.onload = function(e) {
const r = e.target.result;
t(r)
}
,
n.onerror = function(e) {
r()
}
,
n.readAsText(e)
}
))
}
function blobURL2Data(e) {
return new Promise((t => {
var r = new XMLHttpRequest;
r.open("GET", e),
r.responseType = "blob",
r.onload = function() {
var e = r.response
, n = new FileReader;
n.onloadend = function() {
var e = n.result;
t(e)
}
,
n.readAsDataURL(e)
}
,
r.send()
}
))
}
function base642URL(e) {
return URL.createObjectURL(dataURLtoBlob$1(e))
}
function toNum(e, t) {
void 0 === t && (t = 0),
null == e && (e = 0);
try {
let r = Number(e.toFixed(t));
return isNaN(r) && (r = 0),
r
} catch (r) {
return 0
}
}
function sleep(e) {
return new Promise((t => {
setTimeout(( () => {
t(!0)
}
), e)
}
))
}
function uniqArr(e) {
return Array.from(new Set(e))
}
function toJS(e) {
try {
return JSON.parse(JSON.stringify(e))
} catch (t) {}
}
function updateTrackIndex(e) {
e.elements.sort(( (e, t) => e.trackIndex - t.trackIndex));
return groupByTrackIndex(e.elements).forEach(( (e, t) => {
e.forEach((e => {
e.trackIndex = t + 1
}
))
}
)),
e
}
function setCropSize(e, t) {
const r = toNum(e.style.width / e.style.height, 1)
, n = toNum(t.width / t.height, 1);
r !== n ? e.cropSize = n < r ? {
x: 0,
y: (t.height - t.width / r) / 2,
width: t.width,
height: t.width / r
} : {
x: (t.width - t.height * r) / 2,
y: 0,
width: t.height * r,
height: t.height
} : delete e.cropSize
}
function calcSizeAndPosition(e, t) {
const r = {
width: 0,
height: 0,
x: 0,
y: 0
}
, n = t.width
, i = t.height
, o = e.width
, s = e.height;
let a, l;
const c = o / s;
return n / i > c ? (l = i,
a = l * c) : (a = n,
l = a / c),
a > o && (a = o),
l > s && (l = s),
r.width = a,
r.height = l,
r.x = (n - a) / 2,
r.y = (i - l) / 2,
r.x += r.width / 2,
r.y += r.height / 2,
r
}
function bindSelf(e, t, r) {
const n = r.value;
return r.value = function(...e) {
return n.apply(this, e)
}
,
r
}
function objectCopyValue(e, t) {
for (const r in e)
e.hasOwnProperty(r) && ("object" != typeof e[r] ||
Array.isArray(e[r]) ? t[r] = e[r] : t[r] = objectCopyValue(e[r], t[r] || {}));
return t
}
function getTargetByIds(e) {
const t = [];
return e.forEach((e => {
const r = document.querySelector(`[data-elementid="${e}"]`);
r && t.push(r)
}
)),
t
}
function getVideoFrameAtTime(e, t) {
return new Promise(( (r, n) => {
const i = document.createElement("canvas")
, o = i.getContext("2d");
t.onloadeddata = () => {
t.currentTime = e,
t.onseeked = () => {
i.width = t.videoWidth,
i.height = t.videoHeight,
o.drawImage(t, 0, 0, i.width, i.height),
r(i),
t.onseeked = null
}
}
,
t.onerror = e => n(e),
t.load()
}
))
}
function mediaCanplay(e) {
return new Promise((t => {
e.onloadeddata = () => {
t(e)
}
}
))
}
async function createMediaTransitionCapture(e, t, r, n, i) {
const o = document.createElement("canvas");
o.width = r.width,
o.height = r.height;
const s = o.getContext("2d");
i && (s.fillStyle = i,
s.fillRect(0, 0, o.width, o.height));
let a = null;
e instanceof HTMLVideoElement ? (a = e.cloneNode(),
a.muted = !0,
a.currentTime = t,
await mediaCanplay(a),
await a.play(),
a.paused || a.pause()) : a = e;
return s.translate(n.x + 1 * n.width / 2, n.y + 1 * n.height / 2),
n.rotation && s.rotate(n.rotation),
a && s.drawImage(a, 1 * -n.width / 2, 1 * -n.height / 2, 1 * n.width, 1
* n.height),
s.resetTransform(),
o
}
async function createImageTransitionCapture(e, t, r, n) {
const i = document.createElement("canvas");
i.width = t.width,
i.height = t.height;
const o = i.getContext("2d");
n && (o.fillStyle = n,
o.fillRect(0, 0, i.width, i.height));
const s = await lazyImage(e);
return o.translate(r.x + 1 * r.width / 2, r.y + 1 * r.height / 2),
r.rotation && o.rotate(r.rotation),
o.drawImage(s, 1 * -r.width / 2, 1 * -r.height / 2, 1 * r.width, 1 *
r.height),
o.resetTransform(),
i
}
function dataURLtoBlob$1(e) {
const t = e.split(",")
, r = t[0].match(/:(.*?);/)[1]
, n = atob(t[1]);
let i = n.length;
const o = new Uint8Array(i);
for (; i--; )
o[i] = n.charCodeAt(i);
return new Blob([o],{
type: r
})
}
function mediaLazy(e, t, r) {
return new Promise(( (n, i) => {
const o = document.createElement(r || "video");
o.preload = "auto",
o.crossOrigin = "Anonymous",
o.autoplay = !1,
o.src = e,
o.setAttribute("playsinline", ""),
o.setAttribute("webkit-playsinline", ""),
void 0 !== t && (o.currentTime = t),
o.onerror = e => {
i()
}
,
o.oncanplaythrough = () => {
n(o)
}
}
))
}
function lastItem(e) {
return e[e.length - 1]
}
function lazyImage(e) {
return new Promise((t => {
const r = new Image;
r.onload = () => {
t(r)
}
,
r.src = e
}
))
}
function getFileExtension(e="") {
const t = (e = e.split("?")[0]).split(".");
return t.length > 1 ? (t.pop() || "").toLowerCase() : null
}
function getFileTypeFromFileName(e) {
const t = getFileExtension(e);
if (t) {
if (t.match(/(mp4|webm|ogg)$/))
return "video";
if (t.match(/(jpg|jpeg|png|gif|svg|bmp)$/))
return "image";
if (t.match(/(mp3|wav|ogg)$/))
return "audio"
}
return null
}
const secToTime = (e, t="hh:mm:ss:ms", r) => {
const n = Math.floor(e / 3600)
, i = Math.floor(e % 3600 / 60)
, o = Math.floor(e % 60)
, [s,a="0"] = e.toString().split(".")
, l = a;
let c = {
hh: n.toString().padStart(2, "0"),
"h?": n.toString().padStart(2, "0"),
h: n.toString(),
mm: i.toString().padStart(2, "0"),
m: i.toString(),
ss: o.toString().padStart(2, "0"),
s: o.toString(),
ms: l.padEnd(2, "0").slice(0, 2),
mss: l.padEnd(3, "0").slice(0, 3)
};
const u = [];
t.split(":").forEach((e => {
-1 !== e.indexOf("?") ? "00" !== c[e] && u.push(c[e]) :
u.push(c[e])
}
));
let d = u.join(":");
return "min1" === r && "00:00" === d ? "00:01" : d
}
;
function hitRect(e, t) {
return e.x < toNum(t.x + t.width, 2) && toNum(e.x + e.width, 2) > t.x
&& e.y < toNum(t.y + t.height, 2) && toNum(e.y + e.height, 2) > t.y
}
function splitArray(e) {
const t = Math.ceil(e.length / 2);
return [e.slice(0, t), e.slice(t)]
}
const utils$2 = Object.freeze(Object.defineProperty({
__proto__: null,
base642URL: base642URL,
bindSelf: bindSelf,
blobURL2Data: blobURL2Data,
calcSizeAndPosition: calcSizeAndPosition,
crashRects: crashRects,
createID: createID,
createImageTransitionCapture: createImageTransitionCapture,
createMediaTransitionCapture: createMediaTransitionCapture,
dataURLtoBlob: dataURLtoBlob$1,
exec: exec,
filterClosePoints: filterClosePoints,
findIntersection: findIntersection,
getFileExtension: getFileExtension,
getFileTypeFromFileName: getFileTypeFromFileName,
getLinesNeighbor: getLinesNeighbor,
getTargetByIds: getTargetByIds,
getVideoFile: getVideoFile,
getVideoFrameAtTime: getVideoFrameAtTime,
hitRect: hitRect,
inserValAB: inserValAB,
lastItem: lastItem,
lazyImage: lazyImage,
loadFont: loadFont,
mediaCanplay: mediaCanplay,
mediaInfo: mediaInfo$1,
mediaLazy: mediaLazy,
objectCopyValue: objectCopyValue,
readFileAsArrayBuffer: readFileAsArrayBuffer,
readFileAsText: readFileAsText,
secToTime: secToTime,
setCropSize: setCropSize,
sleep: sleep,
splitArray: splitArray,
toJS: toJS,
toNum: toNum,
uniqArr: uniqArr,
updateTrackIndex: updateTrackIndex
}, Symbol.toStringTag, {
value: "Module"
}));
var hasElementType = "undefined" != typeof Element
, hasMap = "function" == typeof Map
, hasSet = "function" == typeof Set
, hasArrayBuffer = "function" == typeof ArrayBuffer && !!
ArrayBuffer.isView;
function equal(e, t) {
if (e === t)
return !0;
if (e && t && "object" == typeof e && "object" == typeof t) {
if (e.constructor !== t.constructor)
return !1;
var r, n, i, o;
if (Array.isArray(e)) {
if ((r = e.length) != t.length)
return !1;
for (n = r; 0 != n--; )
if (!equal(e[n], t[n]))
return !1;
return !0
}
if (hasMap && e instanceof Map && t instanceof Map) {
if (e.size !== t.size)
return !1;
for (o = e.entries(); !(n = o.next()).done; )
if (!t.has(n.value[0]))
return !1;
for (o = e.entries(); !(n = o.next()).done; )
if (!equal(n.value[1], t.get(n.value[0])))
return !1;
return !0
}
if (hasSet && e instanceof Set && t instanceof Set) {
if (e.size !== t.size)
return !1;
for (o = e.entries(); !(n = o.next()).done; )
if (!t.has(n.value[0]))
return !1;
return !0
}
if (hasArrayBuffer && ArrayBuffer.isView(e) &&
ArrayBuffer.isView(t)) {
if ((r = e.length) != t.length)
return !1;
for (n = r; 0 != n--; )
if (e[n] !== t[n])
return !1;
return !0
}
if (e.constructor === RegExp)
return e.source === t.source && e.flags === t.flags;
if (e.valueOf !== Object.prototype.valueOf && "function" == typeof
e.valueOf && "function" == typeof t.valueOf)
return e.valueOf() === t.valueOf();
if (e.toString !== Object.prototype.toString && "function" ==
typeof e.toString && "function" == typeof t.toString)
return e.toString() === t.toString();
if ((r = (i = Object.keys(e)).length) !== Object.keys(t).length)
return !1;
for (n = r; 0 != n--; )
if (!Object.prototype.hasOwnProperty.call(t, i[n]))
return !1;
if (hasElementType && e instanceof Element)
return !1;
for (n = r; 0 != n--; )
if (("_owner" !== i[n] && "__v" !== i[n] && "__o" !== i[n] || !
e.$$typeof) && !equal(e[i[n]], t[i[n]]))
return !1;
return !0
}
return e != e && t != t
}
var reactFastCompare = function(e, t) {
try {
return equal(e, t)
} catch (r) {
if ((r.message || "").match(/stack|recursion/i))
return !1;
throw r
}
};
const isEqual$3 = getDefaultExportFromCjs(reactFastCompare);
function Stage(e) {
const {viewSize: t, debug: r, env: n, target: i, options: o, children:
s} = e
, [a,l] = reactExports.useState(!1)
, c = reactExports.useRef(null)
, [,u] = reactExports.useReducer((e => e + 1), 0)
, d = e.store;
reactExports.useEffect(( () => {
const n = c.current ? c.current : i || document.body
, s = new Application(Object.assign({
...t
}, {
...o
}, {
antialias: !0,
powerPreference: "high-performance"
}));
return s._tempScale = 1,
r && (globalThis.__PIXI_APP__ = s),
n.appendChild(s.view),
d.app = s,
s.stage.sortableChildren = !0,
l(!0),
pubsub.subscribe(d.events.UPDATE_STAGE, ( () => {
u()
}
)),
(async () => {
if (await sleep(500),
Object.keys(d.elementReadyMark).length)
for (; 0 !== Object.keys(d.elementReadyMark).length; ) {
for (let e in d.elementReadyMark)
"success" === d.elementReadyMark[e] && delete
d.elementReadyMark[e];
if (0 === Object.keys(d.elementReadyMark).length)
break;
await sleep(100)
}
e.callback && e.callback(e.store)
}
)(),
() => {
pubsub.unsubscribe(d.events.UPDATE_STAGE),
s.destroy(!0, {
children: !0,
texture: !0,
baseTexture: !0
})
}
}
), []),
reactExports.useEffect(( () => {
d.data && (d.app && !isEqual$3(t, {
width: d.app.renderer.width,
height: d.app.renderer.height
}) && d.app.renderer.resize(t.width, t.height),
d.movieSize.width = d.data.width,
d.movieSize.height = d.data.height)
}
), [t]);
const p = () => childrenInjectProps({
parent: d.app.stage
}, s);
return "editor" === n ?
jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
children: jsxRuntimeExports.jsx("div", {
ref: c,
style: {
...t,
position: "relative",
zIndex: 0,
transform: "scale(1)",
transformOrigin: "0 0"
},
children: a ? p() : null
})
}) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
children: a ? p() : null
})
}
function useSyncPixiElement$1(e, t, r, n) {
const i = t.store;
n && void 0 === n.scale && (n.scale = 1);
const o = t => {
s(t, e),
i.captionContainer.children.forEach((r => {
e.name !== r.name && s(t, r)
}
))
}
, s = (e, i) => {
var o, s;
r.forEach((t => {
switch (t) {
case "x":
case "y":
i.position[t] = toNum(e[t] || 0, 6);
break;
case "alpha":
i.alpha = toNum(e[t] ?? 1, 6);
break;
case "rotation":
i[t] = toNum(e[t] || 0, 6);
break;
case "width":
case "height":
const r = i.children.find((e => "element" === e.name))
, o = n ? n.scale : 1;
r[t] = toNum(e[t] || 0, 6) * o
}
}
));
const {flipx: a} = n;
void 0 === a || i.scaleFlipXLock || (i.scale.x = a ? -1 : 1);
const {width: l, height: c} = i.getLocalBounds();
i.pivot.set(toNum(l / 2, 6), toNum(c / 2, 6)),
(null == (o = t.animateRef) ? void 0 : o.current) && (null == (s =
t.animateRef) || s.current.update(t.relativeTime ?? 0))
}
, a = n ? n.style : null
, l = n ? n.flipx : null;
return reactExports.useEffect(( () => {
a && ("caption" === (null == n ? void 0 : n.type) ? o(a) : s(a, e))
}
), [null == a ? void 0 : a.x, null == a ? void 0 : a.y, null == a ?
void 0 : a.alpha, null == a ? void 0 : a.height, null == a ? void 0 : a.width, null
== a ? void 0 : a.rotation, l, null == n ? void 0 : n.scale, null == n ? void 0 :
n.cropSize]),
reactExports.useEffect(( () => {
n && (e.name = null == n ? void 0 : n.id),
e.elementData = n,
e.visible = t.visible,
t.hide && (e.visible = !1),
"editor" === i.env && pubsub.publish(i.events.VISIBLE_CONTROL, {
visible: t.visible,
elementId: null == n ? void 0 : n.id
})
}
), [t.visible, t.hide]),
reactExports.useEffect(( () => {
t.lock ? e.interactive = !1 : e.interactive = !0
}
), [t.lock]),
reactExports.useEffect(( () => {
if (t.parent)
return t.parent.addChild(e),
() => {
e.destroy({
children: 0 !== e.children.length
})
}
}
), []),
[s, o]
}
function ContainerElement(e) {
const {visible: t, scale: r, sortableChildren: n, sortChildrenUpdate:
i, placeholderGraphics: o, backgroundColor: s, store: a, trackIndex: l} = e
, c = reactExports.useMemo(( () => {
const t = new Container;
return e.name && (t.name = e.name),
t
}
), []);
"body" === e.name && (a.bodyContainer = c),
"caption" === e.name && (a.captionContainer = c),
reactExports.useEffect(( () => {
c.zIndex = config$2.MAX_TRACKINDEX - l
}
), [l]),
reactExports.useEffect(( () => {
void 0 !== r && c.scale.set(r)
}
), [r]),
reactExports.useEffect(( () => {
n && (c.sortableChildren = !0,
c.sortDirty = !0)
}
), [i]);
const u = {
width: a.data.width,
height: a.data.height
};
reactExports.useEffect(( () => {
if (o) {
const e = c.children.find((e => "placeholderGraphics" ===
e.name));
if (e)
e.clear(),
e.lineStyle(1, 0, 1e-5, 1),
e.drawRect(u.width / 2, u.height / 2, u.width, u.height),
e.endFill(),
e.pivot.set(u.width / 2, u.height / 2);
else {
const e = new Graphics;
e.lineStyle(1, 0, 1e-5, 1),
e.drawRect(u.width / 2, u.height / 2, u.width, u.height),
e.endFill(),
e.pivot.set(u.width / 2, u.height / 2),
e.name = "placeholderGraphics",
c.addChild(e)
}
}
if (s) {
const e = c.children.find((e => "backgroundColor" === e.name));
if (e)
e.clear(),
e.beginFill(s),
e.drawRect(u.width / 2, u.height / 2, u.width, u.height),
e.endFill(),
e.pivot.set(u.width / 2, u.height / 2);
else {
const e = new Graphics;
e.beginFill(s),
e.drawRect(u.width / 2, u.height / 2, u.width, u.height),
e.endFill(),
e.pivot.set(u.width / 2, u.height / 2),
e.name = "backgroundColor",
c.addChild(e)
}
}
}
), [o, s, u.width, u.height]),
useSyncPixiElement$1(c, {
parent: e.parent,
style: {
x: e.x || 0,
y: e.y || 0,
alpha: 1
},
visible: t,
hide: e.hide,
lock: e.lock,
store: e.store
}, ["x", "y"]);
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
children: childrenInjectProps({
parent: c
}, e.children)
})
}
var root$3 = _root
, now$6 = function() {
return root$3.Date.now()
}
, now_1 = now$6
, reWhitespace$1 = /\s/;
function trimmedEndIndex$2(e) {
for (var t = e.length; t-- && reWhitespace$1.test(e.charAt(t)); )
;
return t
}
var _trimmedEndIndex = trimmedEndIndex$2
, trimmedEndIndex$1 = _trimmedEndIndex
, reTrimStart$1 = /^\s+/;
function baseTrim$2(e) {
return e ? e.slice(0, trimmedEndIndex$1(e) + 1).replace(reTrimStart$1,
"") : e
}
var _baseTrim = baseTrim$2
, baseTrim$1 = _baseTrim
, isObject$e = isObject_1
, isSymbol$4 = isSymbol_1
, NAN$1 = NaN
, reIsBadHex$1 = /^[-+]0x[0-9a-f]+$/i
, reIsBinary$1 = /^0b[01]+$/i
, reIsOctal$1 = /^0o[0-7]+$/i
, freeParseInt$1 = parseInt;
function toNumber$3(e) {
if ("number" == typeof e)
return e;
if (isSymbol$4(e))
return NAN$1;
if (isObject$e(e)) {
var t = "function" == typeof e.valueOf ? e.valueOf() : e;
e = isObject$e(t) ? t + "" : t
}
if ("string" != typeof e)
return 0 === e ? e : +e;
e = baseTrim$1(e);
var r = reIsBinary$1.test(e);
return r || reIsOctal$1.test(e) ? freeParseInt$1(e.slice(2), r ? 2 : 8)
: reIsBadHex$1.test(e) ? NAN$1 : +e
}
var toNumber_1 = toNumber$3;
const _toNumber = getDefaultExportFromCjs(toNumber_1);
var isObject$d = isObject_1
, now$5 = now_1
, toNumber$2 = toNumber_1
, FUNC_ERROR_TEXT$5 = "Expected a function"
, nativeMax$6 = Math.max
, nativeMin$2 = Math.min;
function debounce$2(e, t, r) {
var n, i, o, s, a, l, c = 0, u = !1, d = !1, p = !0;
if ("function" != typeof e)
throw new TypeError(FUNC_ERROR_TEXT$5);
function h(t) {
var r = n
, o = i;
return n = i = void 0,
c = t,
s = e.apply(o, r)
}
function f(e) {
var r = e - l;
return void 0 === l || r >= t || r < 0 || d && e - c >= o
}
function m() {
var e = now$5();
if (f(e))
return g(e);
a = setTimeout(m, function(e) {
var r = t - (e - l);
return d ? nativeMin$2(r, o - (e - c)) : r
}(e))
}
function g(e) {
return a = void 0,
p && n ? h(e) : (n = i = void 0,
s)
}
function y() {
var e = now$5()
, r = f(e);
if (n = arguments,
i = this,
l = e,
r) {
if (void 0 === a)
return function(e) {
return c = e,
a = setTimeout(m, t),
u ? h(e) : s
}(l);
if (d)
return clearTimeout(a),
a = setTimeout(m, t),
h(l)
}
return void 0 === a && (a = setTimeout(m, t)),
s
}
return t = toNumber$2(t) || 0,
isObject$d(r) && (u = !!r.leading,
o = (d = "maxWait"in r) ? nativeMax$6(toNumber$2(r.maxWait) || 0, t) :
o,
p = "trailing"in r ? !!r.trailing : p),
y.cancel = function() {
void 0 !== a && clearTimeout(a),
c = 0,
n = l = i = a = void 0
}
,
y.flush = function() {
return void 0 === a ? s : g(now$5())
}
,
y
}
var debounce_1 = debounce$2;
const debounce$3 = getDefaultExportFromCjs(debounce_1)
, pow = Math.pow
, sqrt = Math.sqrt
, sin = Math.sin
, cos = Math.cos
, PI = Math.PI
, c1 = 1.70158
, c2 = 1.525 * c1
, c3 = c1 + 1
, c4 = 2 * PI / 3
, c5 = 2 * PI / 4.5
, bounceOut = function(e) {
const t = 7.5625
, r = 2.75;
return e < 1 / r ? t * e * e : e < 2 / r ? t * (e -= 1.5 / r) * e + .75
: e < 2.5 / r ? t * (e -= 2.25 / r) * e + .9375 : t * (e -= 2.625 / r) * e
+ .984375
}
, easingsFunctions = {
linear: e => e,
easeInQuad: function(e) {
return e * e
},
easeOutQuad: function(e) {
return 1 - (1 - e) * (1 - e)
},
easeInOutQuad: function(e) {
return e < .5 ? 2 * e * e : 1 - pow(-2 * e + 2, 2) / 2
},
easeInCubic: function(e) {
return e * e * e
},
easeOutCubic: function(e) {
return 1 - pow(1 - e, 3)
},
easeInOutCubic: function(e) {
return e < .5 ? 4 * e * e * e : 1 - pow(-2 * e + 2, 3) / 2
},
easeInQuart: function(e) {
return e * e * e * e
},
easeOutQuart: function(e) {
return 1 - pow(1 - e, 4)
},
easeInOutQuart: function(e) {
return e < .5 ? 8 * e * e * e * e : 1 - pow(-2 * e + 2, 4) / 2
},
easeInQuint: function(e) {
return e * e * e * e * e
},
easeOutQuint: function(e) {
return 1 - pow(1 - e, 5)
},
easeInOutQuint: function(e) {
return e < .5 ? 16 * e * e * e * e * e : 1 - pow(-2 * e + 2, 5) / 2
},
easeInSine: function(e) {
return 1 - cos(e * PI / 2)
},
easeOutSine: function(e) {
return sin(e * PI / 2)
},
easeInOutSine: function(e) {
return -(cos(PI * e) - 1) / 2
},
easeInExpo: function(e) {
return 0 === e ? 0 : pow(2, 10 * e - 10)
},
easeOutExpo: function(e) {
return 1 === e ? 1 : 1 - pow(2, -10 * e)
},
easeInOutExpo: function(e) {
return 0 === e ? 0 : 1 === e ? 1 : e < .5 ? pow(2, 20 * e - 10) / 2
: (2 - pow(2, -20 * e + 10)) / 2
},
easeInCirc: function(e) {
return 1 - sqrt(1 - pow(e, 2))
},
easeOutCirc: function(e) {
return sqrt(1 - pow(e - 1, 2))
},
easeInOutCirc: function(e) {
return e < .5 ? (1 - sqrt(1 - pow(2 * e, 2))) / 2 : (sqrt(1 - pow(-
2 * e + 2, 2)) + 1) / 2
},
easeInBack: function(e) {
return c3 * e * e * e - c1 * e * e
},
easeOutBack: function(e) {
return 1 + c3 * pow(e - 1, 3) + c1 * pow(e - 1, 2)
},
easeInOutBack: function(e) {
return e < .5 ? pow(2 * e, 2) * (2 * (c2 + 1) * e - c2) / 2 :
(pow(2 * e - 2, 2) * ((c2 + 1) * (2 * e - 2) + c2) + 2) / 2
},
easeInElastic: function(e) {
return 0 === e ? 0 : 1 === e ? 1 : -pow(2, 10 * e - 10) * sin((10 *
e - 10.75) * c4)
},
easeOutElastic: function(e) {
return 0 === e ? 0 : 1 === e ? 1 : pow(2, -10 * e) * sin((10 * e
- .75) * c4) + 1
},
easeInOutElastic: function(e) {
return 0 === e ? 0 : 1 === e ? 1 : e < .5 ? -pow(2, 20 * e - 10) *
sin((20 * e - 11.125) * c5) / 2 : pow(2, -20 * e + 10) * sin((20 * e - 11.125) *
c5) / 2 + 1
},
easeInBounce: function(e) {
return 1 - bounceOut(1 - e)
},
easeOutBounce: bounceOut,
easeInOutBounce: function(e) {
return e < .5 ? (1 - bounceOut(1 - 2 * e)) / 2 : (1 + bounceOut(2 *
e - 1)) / 2
}
};
function getNowFrame(e) {
const {animateStatusFrames: t, time: r, duration: n, getStyleValue: i}
= e;
let o = null;
if (t.length) {
const e = t.length
, s = toJS(t[e - 1]);
s.time = n;
for (let n = 0; n < e + 1; n++) {
const e = t[n] || s;
if (r <= e.time) {
let s = t[n - 1]
, a = e;
s || (s = a);
const l = a.time - s.time == 0 ? 0 : (r - s.time) / (a.time
- s.time);
let c = l;
if (s.ease && (c = easingsFunctions[s.ease](l)),
a && s) {
const e = {
translateX: 0,
translateY: 0,
rotation: 0,
scaleX: 1,
scaleY: 1,
skewX: 0,
skewY: 0
};
i ? (s.width = s.width ?? i("width"),
s.height = s.height ?? i("height"),
s.alpha = s.alpha ?? i("alpha"),
a.width = a.width ?? i("width"),
a.height = a.height ?? i("height"),
a.alpha = a.alpha ?? i("alpha")) : (s.width = s.width,
s.height = s.height,
s.alpha = s.alpha,
a.width = a.width,
a.height = a.height,
a.alpha = a.alpha),
s.transform = Object.assign({
...e
}, s.transform),
a.transform = Object.assign({
...e
}, a.transform),
o = {
width: (a.width - s.width) * c + s.width,
height: (a.height - s.height) * c + s.height,
alpha: (a.alpha - s.alpha) * l + s.alpha,
transform: {
translateX: (a.transform.translateX -
s.transform.translateX) * c + s.transform.translateX,
translateY: (a.transform.translateY -
s.transform.translateY) * c + s.transform.translateY,
rotation: (a.transform.rotation -
s.transform.rotation) * c + s.transform.rotation,
scaleX: (a.transform.scaleX -
s.transform.scaleX) * c + s.transform.scaleX,
scaleY: (a.transform.scaleY -
s.transform.scaleY) * c + s.transform.scaleY,
skewX: (a.transform.skewX - s.transform.skewX)
* c + s.transform.skewX,
skewY: (a.transform.skewY - s.transform.skewY)
* c + s.transform.skewY
}
}
}
break
}
}
return o
}
return o
}
function Animate$1(e, t) {
const {elementData: r, pixiElem: n, linkPixiElems: i, relativeTime: o,
currentTime: s} = e
, a = reactExports.useRef([])
, l = reactExports.useRef(null)
, c = reactExports.useRef();
return reactExports.useEffect(( () => {
const e = e => {
const {style: t} = r;
return t ? "alpha" === e && void 0 === t.alpha ? 1 : t[e] ??
0 : 0
}
, t = (t, n) => {
const {flipx: i} = r;
t.nowStatus = n,
t.width = n.width + e("width"),
t.height = n.width + e("height"),
t.alpha = n.alpha * e("alpha"),
t.position.x = n.transform.translateX + e("x"),
t.position.y = n.transform.translateY + e("y"),
t.rotation = n.transform.rotation + e("rotation"),
t.scale.x = n.transform.scaleX * (i ? -1 : 1),
t.scale.y = n.transform.scaleY,
t.skew.x = n.transform.skewX + 0,
t.skew.y = n.transform.skewY + 0
}
;
c.current = {
update(o) {
l.current = getNowFrame({
animateStatusFrames: a.current,
time: o,
duration: r.duration,
getStyleValue: e
}),
l.current && (t(n, l.current),
i && i.forEach((e => {
t(e, l.current)
}
)))
}
}
}
), []),
reactExports.useImperativeHandle(t, ( () => ({
getNowStatusFrame: () => ({
...l.current
}),
update: e => {
var t;
null == (t = c.current) || t.update(e)
}
}))),
reactExports.useEffect(( () => (( () => {
const {animates: e} = r;
a.current = [],
e && e.length && e.sort(( (e, t) => e.start - t.start)).forEach((e
=> {
const {duration: t, start: r, ease: n} = e;
e.frames.forEach((e => {
const i = e.progress * t + r;
a.current.push({
time: i,
id: createID(),
ease: n,
transform: {
...e.transform
},
alpha: e.alpha,
width: e.width,
height: e.height,
_dirty: createID()
})
}
))
}
))
}
)(),
setTimeout(( () => {
var e;
null == (e = c.current) || e.update(o || 0)
}
), 0),
() => {
delete n.nowStatus
}
)), [r.animates, r._animationDirty]),
reactExports.useEffect(( () => {
var e;
null !== o ? null == (e = c.current) || e.update(o) : l.current =
null
}
), [o, r.animates, r._dirty]),
null
}
const Animate$2 = reactExports.forwardRef(Animate$1);
function ControlElment$1(e) {
const t = e.element;
void 0 === t.scale && (t.scale = 1);
const r = e.scale
, {x: n=0, y: i=0, width: o=0, height: s=0, rotation: a=0} = t.style
, l = e.isCaption ? config$2.MAX_TRACKINDEX + 100 :
e.store.zIndexObjects[t.id];
reactExports.useEffect(( () =>
(e.store.cacheControlElementIds.includes(t.id) &&
e.store.updateControl("triggerNoCallback", [t.id]),
() => {
e.store.updateControl("triggerNoCallback", [])
}
)), [t._dirty]);
let c = "initial";
e.visible || (c = "none"),
e.hide && (c = "none"),
e.lock && (c = "none");
const u = t.mask;
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
children: jsxRuntimeExports.jsx("div", {
"data-pixi": "sprite",
"data-elementid": t.id,
"data-scale": t.scale,
"data-trackindex": e.trackIndex,
style: {
opacity: e.visible ? 1 : 0,
pointerEvents: c,
position: "absolute",
zIndex: l,
top: 0,
left: 0,
width: o * r * t.scale,
height: s * r * t.scale,
transform: `translate(${(n - o * t.scale / 2) * r}px, ${(i
- s * t.scale / 2) * r}px) rotate(${180 * a / Math.PI}deg)`
},
children: u && jsxRuntimeExports.jsx("div", {
"data-maskid": t.id,
style: {
position: "absolute",
top: 0,
left: 0,
width: (u.width || 0) * r,
height: (u.height || 0) * r,
transformOrigin: "center",
transform: `translate(${(u.x - (u.width || 0) / 2) *
r}px, ${(u.y - (u.height || 0) / 2) * r}px) rotate(${180 * (u.rotation || 0) /
Math.PI}deg)`
}
})
})
})
}
var glTransitions = [{
name: "Bounce",
paramsTypes: {
shadow_colour: "vec4",
shadow_height: "float",
bounces: "float"
},
defaultParams: {
shadow_colour: [0, 0, 0, .6],
shadow_height: .075,
bounces: 3
},
glsl: "// Author: Adrian Purser\n// License: MIT\n\nuniform vec4
shadow_colour; // = vec4(0.,0.,0.,.6)\nuniform float shadow_height; // = 0.075\
nuniform float bounces; // = 3.0\n\nconst float PI = 3.14159265358;\n\nvec4
transition (vec2 uv) {\n float time = progress;\n float stime = sin(time * PI /
2.);\n float phase = time * PI * bounces;\n float y = (abs(cos(phase))) * (1.0 -
stime);\n float d = uv.y - y;\n return mix(\n mix(\n getToColor(uv),\n
shadow_colour,\n step(d, shadow_height) * (1. - mix(\n ((d /
shadow_height) * shadow_colour.a) + (1.0 - shadow_colour.a),\n 1.0,\n
smoothstep(0.95, 1., progress) // fade-out the shadow at the end\n ))\n ),\
n getFromColor(vec2(uv.x, uv.y + (1.0 - y))),\n step(d, 0.0)\n );\n}\n",
author: "Adrian Purser",
license: "MIT",
createdAt: "Fri, 10 Nov 2017 17:01:45 +0000",
updatedAt: "Sat, 11 Nov 2017 08:50:40 +0100"
}, {
name: "BowTieHorizontal",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: huynx\n// License: MIT\n\nvec2 bottom_left =
vec2(0.0, 1.0);\nvec2 bottom_right = vec2(1.0, 1.0);\nvec2 top_left = vec2(0.0,
0.0);\nvec2 top_right = vec2(1.0, 0.0);\nvec2 center = vec2(0.5, 0.5);\n\nfloat
check(vec2 p1, vec2 p2, vec2 p3)\n{\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x
- p3.x) * (p1.y - p3.y);\n}\n\nbool PointInTriangle (vec2 pt, vec2 p1, vec2 p2,
vec2 p3)\n{\n bool b1, b2, b3;\n b1 = check(pt, p1, p2) < 0.0;\n b2 =
check(pt, p2, p3) < 0.0;\n b3 = check(pt, p3, p1) < 0.0;\n return ((b1 == b2)
&& (b2 == b3));\n}\n\nbool in_left_triangle(vec2 p){\n vec2 vertex1, vertex2,
vertex3;\n vertex1 = vec2(progress, 0.5);\n vertex2 = vec2(0.0, 0.5-progress);\n
vertex3 = vec2(0.0, 0.5+progress);\n if (PointInTriangle(p, vertex1, vertex2,
vertex3))\n {\n return true;\n }\n return false;\n}\n\nbool
in_right_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 =
vec2(1.0-progress, 0.5);\n vertex2 = vec2(1.0, 0.5-progress);\n vertex3 =
vec2(1.0, 0.5+progress);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n
{\n return true;\n }\n return false;\n}\n\nfloat blur_edge(vec2 bot1, vec2
bot2, vec2 top, vec2 testPt)\n{\n vec2 lineDir = bot1 - top;\n vec2 perpDir =
vec2(lineDir.y, -lineDir.x);\n vec2 dirToPt1 = bot1 - testPt;\n float dist1 =
abs(dot(normalize(perpDir), dirToPt1));\n \n lineDir = bot2 - top;\n perpDir =
vec2(lineDir.y, -lineDir.x);\n dirToPt1 = bot2 - testPt;\n float min_dist =
min(abs(dot(normalize(perpDir), dirToPt1)), dist1);\n \n if (min_dist < 0.005) {\
n return min_dist / 0.005;\n }\n else {\n return 1.0;\n };\n}\n\n\nvec4
transition (vec2 uv) {\n if (in_left_triangle(uv))\n {\n if (progress < 0.1)\n
{\n return getFromColor(uv);\n }\n if (uv.x < 0.5)\n {\n vec2
vertex1 = vec2(progress, 0.5);\n vec2 vertex2 = vec2(0.0, 0.5-progress);\n
vec2 vertex3 = vec2(0.0, 0.5+progress);\n return mix(\n
getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3,
vertex1, uv)\n );\n }\n else\n {\n if (progress > 0.0)\n {\
n return getToColor(uv);\n }\n else\n {\n return
getFromColor(uv);\n }\n } \n }\n else if (in_right_triangle(uv))\n {\
n if (uv.x >= 0.5)\n {\n vec2 vertex1 = vec2(1.0-progress, 0.5);\n
vec2 vertex2 = vec2(1.0, 0.5-progress);\n vec2 vertex3 = vec2(1.0,
0.5+progress);\n return mix(\n getFromColor(uv),\n
getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n ); \
n }\n else\n {\n return getFromColor(uv);\n }\n }\n else {\n
return getFromColor(uv);\n }\n}",
author: "huynx",
license: "MIT",
createdAt: "Sat, 24 Mar 2018 12:54:26 +0100",
updatedAt: "Sat, 24 Mar 2018 12:54:26 +0100"
}, {
name: "BowTieVertical",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: huynx\r\n// License: MIT\r\n\r\nfloat check(vec2 p1,
vec2 p2, vec2 p3)\r\n{\r\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) *
(p1.y - p3.y);\r\n}\r\n\r\nbool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2
p3)\r\n{\r\n bool b1, b2, b3;\r\n b1 = check(pt, p1, p2) < 0.0;\r\n b2 =
check(pt, p2, p3) < 0.0;\r\n b3 = check(pt, p3, p1) < 0.0;\r\n return ((b1 ==
b2) && (b2 == b3));\r\n}\r\n\r\nbool in_top_triangle(vec2 p){\r\n vec2 vertex1,
vertex2, vertex3;\r\n vertex1 = vec2(0.5, progress);\r\n vertex2 = vec2(0.5-
progress, 0.0);\r\n vertex3 = vec2(0.5+progress, 0.0);\r\n if (PointInTriangle(p,
vertex1, vertex2, vertex3))\r\n {\r\n return true;\r\n }\r\n return false;\r\
n}\r\n\r\nbool in_bottom_triangle(vec2 p){\r\n vec2 vertex1, vertex2, vertex3;\r\n
vertex1 = vec2(0.5, 1.0 - progress);\r\n vertex2 = vec2(0.5-progress, 1.0);\r\n
vertex3 = vec2(0.5+progress, 1.0);\r\n if (PointInTriangle(p, vertex1, vertex2,
vertex3))\r\n {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nfloat
blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)\r\n{\r\n vec2 lineDir =
bot1 - top;\r\n vec2 perpDir = vec2(lineDir.y, -lineDir.x);\r\n vec2 dirToPt1 =
bot1 - testPt;\r\n float dist1 = abs(dot(normalize(perpDir), dirToPt1));\r\n \r\n
lineDir = bot2 - top;\r\n perpDir = vec2(lineDir.y, -lineDir.x);\r\n dirToPt1 =
bot2 - testPt;\r\n float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)),
dist1);\r\n \r\n if (min_dist < 0.005) {\r\n return min_dist / 0.005;\r\n }\
r\n else {\r\n return 1.0;\r\n };\r\n}\r\n\r\n\r\nvec4 transition (vec2 uv)
{\r\n if (in_top_triangle(uv))\r\n {\r\n if (progress < 0.1)\r\n {\r\n
return getFromColor(uv);\r\n }\r\n if (uv.y < 0.5)\r\n {\r\n vec2
vertex1 = vec2(0.5, progress);\r\n vec2 vertex2 = vec2(0.5-progress, 0.0);\r\n
vec2 vertex3 = vec2(0.5+progress, 0.0);\r\n return mix(\r\n
getFromColor(uv),\r\n getToColor(uv),\r\n blur_edge(vertex2, vertex3,
vertex1, uv)\r\n );\r\n }\r\n else\r\n {\r\n if (progress >
0.0)\r\n {\r\n return getToColor(uv);\r\n }\r\n else\r\n
{\r\n return getFromColor(uv);\r\n }\r\n } \r\n }\r\n else if
(in_bottom_triangle(uv))\r\n {\r\n if (uv.y >= 0.5)\r\n {\r\n vec2
vertex1 = vec2(0.5, 1.0-progress);\r\n vec2 vertex2 = vec2(0.5-progress,
1.0);\r\n vec2 vertex3 = vec2(0.5+progress, 1.0);\r\n return mix(\r\n
getFromColor(uv),\r\n getToColor(uv),\r\n blur_edge(vertex2, vertex3,
vertex1, uv)\r\n ); \r\n }\r\n else\r\n {\r\n return
getFromColor(uv);\r\n }\r\n }\r\n else {\r\n return getFromColor(uv);\r\
n }\r\n}",
author: "huynx",
license: "MIT",
createdAt: "Tue, 27 Mar 2018 10:07:54 +0700",
updatedAt: "Tue, 27 Mar 2018 10:07:54 +0700"
}, {
name: "ButterflyWaveScrawler",
paramsTypes: {
amplitude: "float",
waves: "float",
colorSeparation: "float"
},
defaultParams: {
amplitude: 1,
waves: 30,
colorSeparation: .3
},
glsl: "// Author: mandubian\n// License: MIT\nuniform float
amplitude; // = 1.0\nuniform float waves; // = 30.0\nuniform float colorSeparation;
// = 0.3\nfloat PI = 3.14159265358979323846264;\nfloat compute(vec2 p, float
progress, vec2 center) {\nvec2 o = p*sin(progress * amplitude)-center;\n//
horizontal vector\nvec2 h = vec2(1., 0.);\n// butterfly polar function (don't ask
me why this one :))\nfloat theta = acos(dot(o, h)) * waves;\nreturn
(exp(cos(theta)) - 2.*cos(4.*theta) + pow(sin((2.*theta - PI) / 24.), 5.)) / 10.;\
n}\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n float inv = 1.
- progress;\n vec2 dir = p - vec2(.5);\n float dist = length(dir);\n float disp
= compute(p, progress, vec2(0.5, 0.5)) ;\n vec4 texTo = getToColor(p + inv*disp);\
n vec4 texFrom = vec4(\n getFromColor(p + progress*disp*(1.0 -
colorSeparation)).r,\n getFromColor(p + progress*disp).g,\n getFromColor(p +
progress*disp*(1.0 + colorSeparation)).b,\n 1.0);\n return texTo*progress +
texFrom*inv;\n}\n",
author: "mandubian",
license: "MIT",
createdAt: "Thu, 1 Jun 2017 11:47:17 +0200",
updatedAt: "Thu, 1 Jun 2017 11:47:17 +0200"
}, {
name: "CircleCrop",
paramsTypes: {
bgcolor: "vec4"
},
defaultParams: {
bgcolor: [0, 0, 0, 1]
},
glsl: "// License: MIT\n// Author: fkuteken\n// ported by gre from
https://gist.github.com/fkuteken/f63e3009c1143950dee9063c3b83fb88\n\nuniform vec4
bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0)\n\nvec2 ratio2 = vec2(1.0, 1.0 / ratio);\
nfloat s = pow(2.0 * abs(progress - 0.5), 3.0);\n\nvec4 transition(vec2 p) {\n
float dist = length((vec2(p) - 0.5) * ratio2);\n return mix(\n progress < 0.5 ?
getFromColor(p) : getToColor(p), // branching is ok here as we statically depend on
progress uniform (branching won't change over pixels)\n bgcolor,\n step(s,
dist)\n );\n}\n",
license: "MIT",
author: "fkuteken",
createdAt: "Mon, 12 Jun 2017 12:52:34 +0800",
updatedAt: "Mon, 12 Jun 2017 12:52:34 +0800"
}, {
name: "ColourDistance",
paramsTypes: {
power: "float"
},
defaultParams: {
power: 5
},
glsl: "// License: MIT\n// Author: P-Seebauer\n// ported by gre from
https://gist.github.com/P-Seebauer/2a5fa2f77c883dd661f9\n\nuniform float power; //
= 5.0\n\nvec4 transition(vec2 p) {\n vec4 fTex = getFromColor(p);\n vec4 tTex =
getToColor(p);\n float m = step(distance(fTex, tTex), progress);\n return mix(\n
mix(fTex, tTex, m),\n tTex,\n pow(progress, power)\n );\n}\n",
license: "MIT",
author: "P-Seebauer",
createdAt: "Mon, 12 Jun 2017 12:57:42 +0800",
updatedAt: "Mon, 12 Jun 2017 12:57:42 +0800"
}, {
name: "CrazyParametricFun",
paramsTypes: {
a: "float",
b: "float",
amplitude: "float",
smoothness: "float"
},
defaultParams: {
a: 4,
b: 1,
amplitude: 120,
smoothness: .1
},
glsl: "// Author: mandubian\n// License: MIT\n\nuniform float a; // =
4\nuniform float b; // = 1\nuniform float amplitude; // = 120\nuniform float
smoothness; // = 0.1\n\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy /
vec2(1.0).xy;\n vec2 dir = p - vec2(.5);\n float dist = length(dir);\n float x =
(a - b) * cos(progress) + b * cos(progress * ((a / b) - 1.) );\n float y = (a - b)
* sin(progress) - b * sin(progress * ((a / b) - 1.));\n vec2 offset = dir *
vec2(sin(progress * dist * amplitude * x), sin(progress * dist * amplitude * y)) /
smoothness;\n return mix(getFromColor(p + offset), getToColor(p), smoothstep(0.2,
1.0, progress));\n}\n",
author: "mandubian",
license: "MIT",
createdAt: "Thu, 1 Jun 2017 13:03:12 +0200",
updatedAt: "Thu, 1 Jun 2017 13:03:12 +0200"
}, {
name: "CrossZoom",
paramsTypes: {
strength: "float"
},
defaultParams: {
strength: .4
},
glsl: "// License: MIT\n// Author: rectalogic\n// ported by gre from
https://gist.github.com/rectalogic/b86b90161503a0023231\n\n// Converted from
https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/
rendermix/CrossZoom/CrossZoom.frag\n// Which is based on
https://github.com/evanw/glfx.js/blob/master/src/filters/blur/zoomblur.js\n// With
additional easing functions from https://github.com/rectalogic/rendermix-basic-
effects/blob/master/assets/com/rendermix/Easing/Easing.glsllib\n\nuniform float
strength; // = 0.4\n\nconst float PI = 3.141592653589793;\n\nfloat Linear_ease(in
float begin, in float change, in float duration, in float time) {\n return
change * time / duration + begin;\n}\n\nfloat Exponential_easeInOut(in float begin,
in float change, in float duration, in float time) {\n if (time == 0.0)\n
return begin;\n else if (time == duration)\n return begin + change;\n
time = time / (duration / 2.0);\n if (time < 1.0)\n return change / 2.0 *
pow(2.0, 10.0 * (time - 1.0)) + begin;\n return change / 2.0 * (-pow(2.0, -10.0
* (time - 1.0)) + 2.0) + begin;\n}\n\nfloat Sinusoidal_easeInOut(in float begin, in
float change, in float duration, in float time) {\n return -change / 2.0 *
(cos(PI * time / duration) - 1.0) + begin;\n}\n\nfloat rand (vec2 co) {\n return
fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 crossFade(in
vec2 uv, in float dissolve) {\n return mix(getFromColor(uv).rgb,
getToColor(uv).rgb, dissolve);\n}\n\nvec4 transition(vec2 uv) {\n vec2 texCoord
= uv.xy / vec2(1.0).xy;\n\n // Linear interpolate center across center half of
the image\n vec2 center = vec2(Linear_ease(0.25, 0.5, 1.0, progress), 0.5);\n
float dissolve = Exponential_easeInOut(0.0, 1.0, 1.0, progress);\n\n // Mirrored
sinusoidal loop. 0->strength then strength->0\n float strength =
Sinusoidal_easeInOut(0.0, strength, 0.5, progress);\n\n vec3 color = vec3(0.0);\
n float total = 0.0;\n vec2 toCenter = center - texCoord;\n\n /* randomize
the lookup values to hide the fixed number of samples */\n float offset =
rand(uv);\n\n for (float t = 0.0; t <= 40.0; t++) {\n float percent = (t
+ offset) / 40.0;\n float weight = 4.0 * (percent - percent * percent);\n
color += crossFade(texCoord + toCenter * percent * strength, dissolve) * weight;\n
total += weight;\n }\n return vec4(color / total, 1.0);\n}\n",
license: "MIT",
author: "rectalogic",
createdAt: "Mon, 12 Jun 2017 12:33:07 +0800",
updatedAt: "Mon, 12 Jun 2017 12:33:07 +0800"
}, {
name: "Directional",
paramsTypes: {
direction: "vec2"
},
defaultParams: {
direction: [0, 1]
},
glsl: "// Author: Gaëtan Renaudeau\n// License: MIT\n\nuniform vec2
direction; // = vec2(0.0, 1.0)\n\nvec4 transition (vec2 uv) {\n vec2 p = uv +
progress * sign(direction);\n vec2 f = fract(p);\n return mix(\n
getToColor(f),\n getFromColor(f),\n step(0.0, p.y) * step(p.y, 1.0) *
step(0.0, p.x) * step(p.x, 1.0)\n );\n}\n",
author: "Gaëtan Renaudeau",
license: "MIT",
createdAt: "Thu, 19 Apr 2018 12:20:29 +0200",
updatedAt: "Thu, 19 Apr 2018 12:20:29 +0200"
}, {
name: "DoomScreenTransition",
paramsTypes: {
bars: "int",
amplitude: "float",
noise: "float",
frequency: "float",
dripScale: "float"
},
defaultParams: {
bars: 30,
amplitude: 2,
noise: .1,
frequency: .5,
dripScale: .5
},
glsl: '// Author: Zeh Fernando\n// License: MIT\n\n\n// Transition
parameters --------\n\n// Number of total bars/columns\nuniform int bars; // = 30\
n\n// Multiplier for speed ratio. 0 = no variation when going down, higher = some
elements go much faster\nuniform float amplitude; // = 2\n\n// Further variations
in speed. 0 = no noise, 1 = super noisy (ignore frequency)\nuniform float noise; //
= 0.1\n\n// Speed variation horizontally. the bigger the value, the shorter the
waves\nuniform float frequency; // = 0.5\n\n// How much the bars seem to "run" from
the middle of the screen first (sticking to the sides). 0 = no drip, 1 = curved
drip\nuniform float dripScale; // = 0.5\n\n\n// The code proper --------\n\nfloat
rand(int num) {\n return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num)
* 10.3) * cos(float(num)));\n}\n\nfloat wave(int num) {\n float fn = float(num) *
frequency * 0.1 * float(bars);\n return cos(fn * 0.5) * cos(fn * 0.13) *
sin((fn+10.0) * 0.3) / 2.0 + 0.5;\n}\n\nfloat drip(int num) {\n return
sin(float(num) / float(bars - 1) * 3.141592) * dripScale;\n}\n\nfloat pos(int num)
{\n return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) +
(dripScale == 0.0 ? 0.0 : drip(num));\n}\n\nvec4 transition(vec2 uv) {\n int bar =
int(uv.x * (float(bars)));\n float scale = 1.0 + pos(bar) * amplitude;\n float
phase = progress * scale;\n float posY = uv.y / vec2(1.0).y;\n vec2 p;\n vec4
c;\n if (phase + posY < 1.0) {\n p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y,
phase)) / vec2(1.0).xy;\n c = getFromColor(p);\n } else {\n p = uv.xy /
vec2(1.0).xy;\n c = getToColor(p);\n }\n\n // Finally, apply the color\n
return c;\n}\n',
author: "Zeh Fernando",
license: "MIT",
createdAt: "Tue, 30 May 2017 09:39:09 -0700",
updatedAt: "Tue, 30 May 2017 09:39:09 -0700"
}, {
name: "Dreamy",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: mikolalysenko\n// License: MIT\n\nvec2 offset(float
progress, float x, float theta) {\n float phase = progress*progress + progress +
theta;\n float shifty = 0.03*progress*cos(10.0*(progress+x));\n return vec2(0,
shifty);\n}\nvec4 transition(vec2 p) {\n return mix(getFromColor(p +
offset(progress, p.x, 0.0)), getToColor(p + offset(1.0-progress, p.x, 3.14)),
progress);\n}\n",
author: "mikolalysenko",
license: "MIT",
createdAt: "Mon, 12 Jun 2017 12:27:38 +0800",
updatedAt: "Mon, 12 Jun 2017 12:27:38 +0800"
}, {
name: "DreamyZoom",
paramsTypes: {
rotation: "float",
scale: "float"
},
defaultParams: {
rotation: 6,
scale: 1.2
},
glsl: "// Author: Zeh Fernando\n// License: MIT\n\n// Definitions
--------\n#define DEG2RAD 0.03926990816987241548078304229099 // 1/180*PI\n\n\n//
Transition parameters --------\n\n// In degrees\nuniform float rotation; // = 6\n\
n// Multiplier\nuniform float scale; // = 1.2\n\n\n// The code proper --------\n\
nvec4 transition(vec2 uv) {\n // Massage parameters\n float phase = progress <
0.5 ? progress * 2.0 : (progress - 0.5) * 2.0;\n float angleOffset = progress <
0.5 ? mix(0.0, rotation * DEG2RAD, phase) : mix(-rotation * DEG2RAD, 0.0, phase);\n
float newScale = progress < 0.5 ? mix(1.0, scale, phase) : mix(scale, 1.0, phase);\
n \n vec2 center = vec2(0, 0);\n\n // Calculate the source point\n vec2
assumedCenter = vec2(0.5, 0.5);\n vec2 p = (uv.xy - vec2(0.5, 0.5)) / newScale *
vec2(ratio, 1.0);\n\n // This can probably be optimized (with distance())\n float
angle = atan(p.y, p.x) + angleOffset;\n float dist = distance(center, p);\n p.x =
cos(angle) * dist / ratio + 0.5;\n p.y = sin(angle) * dist + 0.5;\n vec4 c =
progress < 0.5 ? getFromColor(p) : getToColor(p);\n\n // Finally, apply the color\
n return c + (progress < 0.5 ? mix(0.0, 1.0, phase) : mix(1.0, 0.0, phase));\n}\
n",
author: "Zeh Fernando",
license: "MIT",
createdAt: "Tue, 30 May 2017 10:44:06 -0700",
updatedAt: "Tue, 30 May 2017 10:44:06 -0700"
}, {
name: "GlitchDisplace",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: Matt DesLauriers\n// License: MIT\n\nhighp float
random(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n
highp float c = 43758.5453;\n highp float dt= dot(co.xy ,vec2(a,b));\n highp
float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\nfloat voronoi( in vec2
x ) {\n vec2 p = floor( x );\n vec2 f = fract( x );\n float res = 8.0;\n
for( float j=-1.; j<=1.; j++ )\n for( float i=-1.; i<=1.; i++ ) {\n vec2
b = vec2( i, j );\n vec2 r = b - f + random( p + b );\n float d =
dot( r, r );\n res = min( res, d );\n }\n return sqrt( res );\n}\n\
nvec2 displace(vec4 tex, vec2 texCoord, float dotDepth, float textureDepth, float
strength) {\n float b = voronoi(.003 * texCoord + 2.0);\n float g =
voronoi(0.2 * texCoord);\n float r = voronoi(texCoord - 1.0);\n vec4 dt = tex
* 1.0;\n vec4 dis = dt * dotDepth + 1.0 - tex * textureDepth;\n\n dis.x =
dis.x - 1.0 + textureDepth*dotDepth;\n dis.y = dis.y - 1.0 +
textureDepth*dotDepth;\n dis.x *= strength;\n dis.y *= strength;\n vec2
res_uv = texCoord ;\n res_uv.x = res_uv.x + dis.x - 0.0;\n res_uv.y =
res_uv.y + dis.y;\n return res_uv;\n}\n\nfloat ease1(float t) {\n return t ==
0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) -
10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\nfloat ease2(float t)
{\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\n\n\nvec4
transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n vec4 color1 =
getFromColor(p);\n vec4 color2 = getToColor(p);\n vec2 disp = displace(color1, p,
0.33, 0.7, 1.0-ease1(progress));\n vec2 disp2 = displace(color2, p, 0.33, 0.5,
ease2(progress));\n vec4 dColor1 = getToColor(disp);\n vec4 dColor2 =
getFromColor(disp2);\n float val = ease1(progress);\n vec3 gray =
vec3(dot(min(dColor2, dColor1).rgb, vec3(0.299, 0.587, 0.114)));\n dColor2 =
vec4(gray, 1.0);\n dColor2 *= 2.0;\n color1 = mix(color1, dColor2,
smoothstep(0.0, 0.5, progress));\n color2 = mix(color2, dColor1, smoothstep(1.0,
0.5, progress));\n return mix(color1, color2, val);\n //gl_FragColor =
mix(gl_FragColor, dColor, smoothstep(0.0, 0.5, progress));\n \n //gl_FragColor =
mix(texture2D(from, p), texture2D(to, p), progress);\n}\n",
author: "Matt DesLauriers",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:53:04 -0400",
updatedAt: "Tue, 30 May 2017 14:53:04 -0400"
}, {
name: "GlitchMemories",
paramsTypes: {},
defaultParams: {},
glsl: "// author: Gunnar Roth\n// based on work from natewave\n//
license: MIT\nvec4 transition(vec2 p) {\n vec2 block = floor(p.xy / vec2(16));\n
vec2 uv_noise = block / vec2(64);\n uv_noise += floor(vec2(progress) *
vec2(1200.0, 3500.0)) / vec2(64);\n vec2 dist = progress > 0.0 ? (fract(uv_noise)
- 0.5) * 0.3 *(1.0 -progress) : vec2(0.0);\n vec2 red = p + dist * 0.2;\n vec2
green = p + dist * .3;\n vec2 blue = p + dist * .5;\n\n return
vec4(mix(getFromColor(red), getToColor(red), progress).r,mix(getFromColor(green),
getToColor(green), progress).g,mix(getFromColor(blue), getToColor(blue),
progress).b,1.0);\n}\n\n",
author: "Gunnar Roth",
license: "MIT",
createdAt: "Wed, 21 Feb 2018 00:52:15 +0100",
updatedAt: "Wed, 21 Feb 2018 19:32:02 +0100"
}, {
name: "GridFlip",
paramsTypes: {
size: "ivec2",
pause: "float",
dividerWidth: "float",
bgcolor: "vec4",
randomness: "float"
},
defaultParams: {
size: [4, 4],
pause: .1,
dividerWidth: .05,
bgcolor: [0, 0, 0, 1],
randomness: .1
},
glsl: "// License: MIT\n// Author: TimDonselaar\n// ported by gre from
https://gist.github.com/TimDonselaar/9bcd1c4b5934ba60087bdb55c2ea92e5\n\nuniform
ivec2 size; // = ivec2(4)\nuniform float pause; // = 0.1\nuniform float
dividerWidth; // = 0.05\nuniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0)\
nuniform float randomness; // = 0.1\n \nfloat rand (vec2 co) {\n return
fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nfloat
getDelta(vec2 p) {\n vec2 rectanglePos = floor(vec2(size) * p);\n vec2
rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y);\n float top =
rectangleSize.y * (rectanglePos.y + 1.0);\n float bottom = rectangleSize.y *
rectanglePos.y;\n float left = rectangleSize.x * rectanglePos.x;\n float right =
rectangleSize.x * (rectanglePos.x + 1.0);\n float minX = min(abs(p.x - left),
abs(p.x - right));\n float minY = min(abs(p.y - top), abs(p.y - bottom));\n
return min(minX, minY);\n}\n\nfloat getDividerSize() {\n vec2 rectangleSize =
vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y);\n return min(rectangleSize.x,
rectangleSize.y) * dividerWidth;\n}\n\nvec4 transition(vec2 p) {\n if(progress <
pause) {\n float currentProg = progress / pause;\n float a = 1.0;\n
if(getDelta(p) < getDividerSize()) {\n a = 1.0 - currentProg;\n }\n
return mix(bgcolor, getFromColor(p), a);\n }\n else if(progress < 1.0 - pause){\n
if(getDelta(p) < getDividerSize()) {\n return bgcolor;\n } else {\n
float currentProg = (progress - pause) / (1.0 - pause * 2.0);\n vec2 q = p;\n
vec2 rectanglePos = floor(vec2(size) * q);\n \n float r =
rand(rectanglePos) - randomness;\n float cp = smoothstep(0.0, 1.0 - r,
currentProg);\n \n float rectangleSize = 1.0 / vec2(size).x;\n float
delta = rectanglePos.x * rectangleSize;\n float offset = rectangleSize / 2.0 +
delta;\n \n p.x = (p.x - offset)/abs(cp - 0.5)*0.5 + offset;\n vec4
a = getFromColor(p);\n vec4 b = getToColor(p);\n \n float s =
step(abs(vec2(size).x * (q.x - delta) - 0.5), abs(cp - 0.5));\n return
mix(bgcolor, mix(b, a, step(cp, 0.5)), s);\n }\n }\n else {\n float
currentProg = (progress - 1.0 + pause) / pause;\n float a = 1.0;\n
if(getDelta(p) < getDividerSize()) {\n a = currentProg;\n }\n return
mix(bgcolor, getToColor(p), a);\n }\n}\n",
license: "MIT",
author: "TimDonselaar",
createdAt: "Mon, 12 Jun 2017 11:32:51 +0800",
updatedAt: "Mon, 12 Jun 2017 11:32:51 +0800"
}, {
name: "InvertedPageCurl",
paramsTypes: {},
defaultParams: {},
glsl: '// author: Hewlett-Packard\n// license: BSD 3 Clause\n// Adapted
by Sergey Kosarevsky from:\n//
http://rectalogic.github.io/webvfx/examples_2transition-shader-pagecurl_8html-
example.html\n\n/*\nCopyright (c) 2010 Hewlett-Packard Development Company, L.P.
All rights reserved.\n\nRedistribution and use in source and binary forms, with or
without\nmodification, are permitted provided that the following conditions are\
nmet:\n\n * Redistributions of source code must retain the above copyright\n
notice, this list of conditions and the following disclaimer.\n * Redistributions
in binary form must reproduce the above\n copyright notice, this list of
conditions and the following disclaimer\n in the documentation and/or other
materials provided with the\n distribution.\n * Neither the name of Hewlett-
Packard nor the names of its\n contributors may be used to endorse or promote
products derived from\n this software without specific prior written
permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\
n"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\
nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\nin vec2 texCoord;\n*/\n\nconst float
MIN_AMOUNT = -0.16;\nconst float MAX_AMOUNT = 1.5;\nfloat amount = progress *
(MAX_AMOUNT - MIN_AMOUNT) + MIN_AMOUNT;\n\nconst float PI = 3.141592653589793;\n\
nconst float scale = 512.0;\nconst float sharpness = 3.0;\n\nfloat cylinderCenter =
amount;\n// 360 degrees * amount\nfloat cylinderAngle = 2.0 * PI * amount;\n\nconst
float cylinderRadius = 1.0 / PI / 2.0;\n\nvec3 hitPoint(float hitAngle, float yc,
vec3 point, mat3 rrotation)\n{\n float hitPoint = hitAngle / (2.0 * PI);\n
point.y = hitPoint;\n return rrotation * point;\n}\n\nvec4 antiAlias(vec4
color1, vec4 color2, float distanc)\n{\n distanc *= scale;\n if
(distanc < 0.0) return color2;\n if (distanc > 2.0) return color1;\n
float dd = pow(1.0 - distanc / 2.0, sharpness);\n return ((color2 - color1)
* dd) + color1;\n}\n\nfloat distanceToEdge(vec3 point)\n{\n float dx =
abs(point.x > 0.5 ? 1.0 - point.x : point.x);\n float dy = abs(point.y > 0.5
? 1.0 - point.y : point.y);\n if (point.x < 0.0) dx = -point.x;\n if
(point.x > 1.0) dx = point.x - 1.0;\n if (point.y < 0.0) dy = -point.y;\n
if (point.y > 1.0) dy = point.y - 1.0;\n if ((point.x < 0.0 || point.x >
1.0) && (point.y < 0.0 || point.y > 1.0)) return sqrt(dx * dx + dy * dy);\n
return min(dx, dy);\n}\n\nvec4 seeThrough(float yc, vec2 p, mat3 rotation, mat3
rrotation)\n{\n float hitAngle = PI - (acos(yc / cylinderRadius) -
cylinderAngle);\n vec3 point = hitPoint(hitAngle, yc, rotation * vec3(p,
1.0), rrotation);\n if (yc <= 0.0 && (point.x < 0.0 || point.y < 0.0 ||
point.x > 1.0 || point.y > 1.0))\n {\n return getToColor(p);\n
}\n\n if (yc > 0.0) return getFromColor(p);\n\n vec4 color =
getFromColor(point.xy);\n vec4 tcolor = vec4(0.0);\n\n return
antiAlias(color, tcolor, distanceToEdge(point));\n}\n\nvec4
seeThroughWithShadow(float yc, vec2 p, vec3 point, mat3 rotation, mat3 rrotation)\
n{\n float shadow = distanceToEdge(point) * 30.0;\n shadow = (1.0 -
shadow) / 3.0;\n\n if (shadow < 0.0) shadow = 0.0; else shadow *= amount;\n\
n vec4 shadowColor = seeThrough(yc, p, rotation, rrotation);\n
shadowColor.r -= shadow;\n shadowColor.g -= shadow;\n shadowColor.b -
= shadow;\n\n return shadowColor;\n}\n\nvec4 backside(float yc, vec3 point)\
n{\n vec4 color = getFromColor(point.xy);\n float gray = (color.r +
color.b + color.g) / 15.0;\n gray += (8.0 / 10.0) * (pow(1.0 - abs(yc /
cylinderRadius), 2.0 / 10.0) / 2.0 + (5.0 / 10.0));\n color.rgb =
vec3(gray);\n return color;\n}\n\nvec4 behindSurface(vec2 p, float yc, vec3
point, mat3 rrotation)\n{\n float shado = (1.0 - ((-cylinderRadius - yc) /
amount * 7.0)) / 6.0;\n shado *= 1.0 - abs(point.x - 0.5);\n\n yc =
(-cylinderRadius - cylinderRadius - yc);\n\n float hitAngle = (acos(yc /
cylinderRadius) + cylinderAngle) - PI;\n point = hitPoint(hitAngle, yc,
point, rrotation);\n\n if (yc < 0.0 && point.x >= 0.0 && point.y >= 0.0 &&
point.x <= 1.0 && point.y <= 1.0 && (hitAngle < PI || amount > 0.5))\n {\n
shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y - 0.5, 2.0)) / (71.0 /
100.0));\n shado *= pow(-yc / cylinderRadius, 3.0);\n
shado *= 0.5;\n }\n else\n {\n shado = 0.0;\n
}\n return vec4(getToColor(p).rgb - shado, 1.0);\n}\n\nvec4 transition(vec2
p) {\n\n const float angle = 100.0 * PI / 180.0;\n float c = cos(-angle);\n
float s = sin(-angle);\n\n mat3 rotation = mat3( c, s, 0,\n
-s, c, 0,\n -0.801,
0.8900, 1\n );\n
c = cos(angle);\n s = sin(angle);\n\n mat3 rrotation = mat3(\tc, s,
0,\n -s, c,
0,\n
0.98500, 0.985, 1\
n );\n\n vec3
point = rotation * vec3(p, 1.0);\n\n float yc = point.y - cylinderCenter;\n\
n if (yc < -cylinderRadius)\n {\n // Behind surface\n
return behindSurface(p,yc, point, rrotation);\n }\n\n if (yc >
cylinderRadius)\n {\n // Flat surface\n return
getFromColor(p);\n }\n\n float hitAngle = (acos(yc / cylinderRadius)
+ cylinderAngle) - PI;\n\n float hitAngleMod = mod(hitAngle, 2.0 * PI);\n
if ((hitAngleMod > PI && amount < 0.5) || (hitAngleMod > PI/2.0 && amount < 0.0))\n
{\n return seeThrough(yc, p, rotation, rrotation);\n }\n\n
point = hitPoint(hitAngle, yc, point, rrotation);\n\n if (point.x < 0.0 ||
point.y < 0.0 || point.x > 1.0 || point.y > 1.0)\n {\n return
seeThroughWithShadow(yc, p, point, rotation, rrotation);\n }\n\n vec4
color = backside(yc, point);\n\n vec4 otherColor;\n if (yc < 0.0)\n
{\n float shado = 1.0 - (sqrt(pow(point.x - 0.5, 2.0) + pow(point.y
- 0.5, 2.0)) / 0.71);\n shado *= pow(-yc / cylinderRadius, 3.0);\n
shado *= 0.5;\n otherColor = vec4(0.0, 0.0, 0.0, shado);\n }\
n else\n {\n otherColor = getFromColor(p);\n }\
n\n color = antiAlias(color, otherColor, cylinderRadius - abs(yc));\n\n
vec4 cl = seeThroughWithShadow(yc, p, point, rotation, rrotation);\n float
dist = distanceToEdge(point);\n\n return antiAlias(color, cl, dist);\n}\n',
author: "Hewlett-Packard",
license: "BSD 3 Clause",
createdAt: "Wed, 21 Feb 2018 01:13:49 +0100",
updatedAt: "Wed, 21 Feb 2018 16:00:02 +0100"
}, {
name: "LinearBlur",
paramsTypes: {
intensity: "float"
},
defaultParams: {
intensity: .1
},
glsl: "// author: gre\n// license: MIT\nuniform float intensity; // =
0.1\nconst int passes = 6;\n\nvec4 transition(vec2 uv) {\n vec4 c1 = vec4(0.0);\
n vec4 c2 = vec4(0.0);\n\n float disp = intensity*(0.5-distance(0.5,
progress));\n for (int xi=0; xi<passes; xi++)\n {\n float x =
float(xi) / float(passes) - 0.5;\n for (int yi=0; yi<passes; yi++)\n
{\n float y = float(yi) / float(passes) - 0.5;\n vec2 v =
vec2(x,y);\n float d = disp;\n c1 += getFromColor( uv +
d*v);\n c2 += getToColor( uv + d*v);\n }\n }\n c1 /=
float(passes*passes);\n c2 /= float(passes*passes);\n return mix(c1, c2,
progress);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Fri, 23 Feb 2018 15:18:22 +0100",
updatedAt: "Fri, 23 Feb 2018 15:18:22 +0100"
}, {
name: "Mosaic",
paramsTypes: {
endx: "int",
endy: "int"
},
defaultParams: {
endx: 2,
endy: -1
},
glsl: "// License: MIT\n// Author: Xaychru\n// ported by gre from
https://gist.github.com/Xaychru/130bb7b7affedbda9df5\n\n#define PI
3.14159265358979323\n#define POW2(X) X*X\n#define POW3(X) X*X*X\nuniform int
endx; // = 2\nuniform int endy; // = -1\n\nfloat Rand(vec2 v) {\n return
fract(sin(dot(v.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nvec2 Rotate(vec2 v,
float a) {\n mat2 rm = mat2(cos(a), -sin(a),\n sin(a), cos(a));\n
return rm*v;\n}\nfloat CosInterpolation(float x) {\n return -cos(x*PI)/2.+.5;\n}\
nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy - .5;\n vec2 rp = p;\
n float rpr = (progress*2.-1.);\n float z = -(rpr*rpr*2.) + 3.;\n float az =
abs(z);\n rp *= az;\n rp += mix(vec2(.5, .5), vec2(float(endx) + .5, float(endy)
+ .5), POW2(CosInterpolation(progress)));\n vec2 mrp = mod(rp, 1.);\n vec2 crp =
rp;\n bool onEnd = int(floor(crp.x))==endx&&int(floor(crp.y))==endy;\n if(!onEnd)
{\n float ang = float(int(Rand(floor(crp))*4.))*.5*PI;\n mrp = vec2(.5) +
Rotate(mrp-vec2(.5), ang);\n }\n if(onEnd || Rand(floor(crp))>.5) {\n return
getToColor(mrp);\n } else {\n return getFromColor(mrp);\n }\n}\n",
license: "MIT",
author: "Xaychru",
createdAt: "Mon, 12 Jun 2017 10:26:51 +0800",
updatedAt: "Mon, 12 Jun 2017 10:26:51 +0800"
}, {
name: "PolkaDotsCurtain",
paramsTypes: {
dots: "float",
center: "vec2"
},
defaultParams: {
dots: 20,
center: [0, 0]
},
glsl: "// author: bobylito\n// license: MIT\nconst float SQRT_2 =
1.414213562373;\nuniform float dots;// = 20.0;\nuniform vec2 center;// = vec2(0,
0);\n\nvec4 transition(vec2 uv) {\n bool nextImage = distance(fract(uv * dots),
vec2(0.5, 0.5)) < ( progress / distance(uv, center));\n return nextImage ?
getToColor(uv) : getFromColor(uv);\n}\n",
author: "bobylito",
license: "MIT",
createdAt: "Tue, 20 Feb 2018 23:41:45 +0100",
updatedAt: "Tue, 20 Feb 2018 23:41:45 +0100"
}, {
name: "Radial",
paramsTypes: {
smoothness: "float"
},
defaultParams: {
smoothness: 1
},
glsl: "// License: MIT\n// Author: Xaychru\n// ported by gre from
https://gist.github.com/Xaychru/ce1d48f0ce00bb379750\n\nuniform float
smoothness; // = 1.0\n\nconst float PI = 3.141592653589;\n\nvec4 transition(vec2 p)
{\n vec2 rp = p*2.-1.;\n return mix(\n getToColor(p),\n getFromColor(p),\n
smoothstep(0., smoothness, atan(rp.y,rp.x) - (progress-.5) * PI * 2.5)\n );\n}\n",
license: "MIT",
author: "Xaychru",
createdAt: "Mon, 12 Jun 2017 10:36:24 +0800",
updatedAt: "Mon, 12 Jun 2017 10:36:24 +0800"
}, {
name: "SimpleZoom",
paramsTypes: {
zoom_quickness: "float"
},
defaultParams: {
zoom_quickness: .8
},
glsl: "// Author: 0gust1\n// License: MIT\n\nuniform float
zoom_quickness; // = 0.8\nfloat nQuick = clamp(zoom_quickness,0.2,1.0);\n\nvec2
zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * (1.0-amount));\t\n}\n\
nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(zoom(uv,
smoothstep(0.0, nQuick, progress))),\n getToColor(uv),\n smoothstep(nQuick-
0.2, 1.0, progress)\n );\n}",
author: "0gust1",
license: "MIT",
createdAt: "Tue, 6 Mar 2018 00:43:47 +0100",
updatedAt: "Tue, 6 Mar 2018 00:43:47 +0100"
}, {
name: "StereoViewer",
paramsTypes: {
zoom: "float",
corner_radius: "float"
},
defaultParams: {
zoom: .88,
corner_radius: .22
},
glsl: "// Tunable parameters\n// How much to zoom (out) for the effect
~ 0.5 - 1.0\nuniform float zoom; // = 0.88\n// Corner radius as a fraction of the
image height\nuniform float corner_radius; // = 0.22\n\n// author: Ted Schundler\
n// license: BSD 2 Clause\n// Free for use and modification by anyone with credit\
n\n// Copyright (c) 2016, Theodore K Schundler\n// All rights reserved.\n\n//
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:\n\n// 1.
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.\n\n// 2. Redistributions in binary form
must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with the
distribution.\n\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\
n///////////////////////////////////////////////////////////////////////////////\
n// Stereo Viewer Toy Transition //\
n// //\
n// Inspired by ViewMaster / Image3D image viewer devices. //\
n// This effect is similar to what you see when you press the device's lever. //\
n// There is a quick zoom in / out to make the transition 'valid' for GLSL.io //\
n///////////////////////////////////////////////////////////////////////////////\n\
nconst vec4 black = vec4(0.0, 0.0, 0.0, 1.0);\nconst vec2 c00 = vec2(0.0, 0.0); //
the four corner points\nconst vec2 c01 = vec2(0.0, 1.0);\nconst vec2 c11 =
vec2(1.0, 1.0);\nconst vec2 c10 = vec2(1.0, 0.0);\n\n// Check if a point is within
a given corner\nbool in_corner(vec2 p, vec2 corner, vec2 radius) {\n // determine
the direction we want to be filled\n vec2 axis = (c11 - corner) - corner;\n\n //
warp the point so we are always testing the bottom left point with the\n // circle
centered on the origin\n p = p - (corner + axis * radius);\n p *= axis / radius;\
n return (p.x > 0.0 && p.y > -1.0) || (p.y > 0.0 && p.x > -1.0) || dot(p, p) <
1.0;\n}\n\n// Check all four corners\n// return a float for v2 for anti-aliasing?\
nbool test_rounded_mask(vec2 p, vec2 corner_size) {\n return\n in_corner(p,
c00, corner_size) &&\n in_corner(p, c01, corner_size) &&\n in_corner(p,
c10, corner_size) &&\n in_corner(p, c11, corner_size);\n}\n\n// Screen blend
mode - https://en.wikipedia.org/wiki/Blend_modes\n// This more closely approximates
what you see than linear blending\nvec4 screen(vec4 a, vec4 b) {\n return 1.0 -
(1.0 - a) * (1.0 -b);\n}\n\n// Given RGBA, find a value that when screened with
itself\n// will yield the original value.\nvec4 unscreen(vec4 c) {\n return 1.0 -
sqrt(1.0 - c);\n}\n\n// Grab a pixel, only if it isn't masked out by the rounded
corners\nvec4 sample_with_corners_from(vec2 p, vec2 corner_size) {\n p = (p - 0.5)
/ zoom + 0.5;\n if (!test_rounded_mask(p, corner_size)) {\n return black;\n }\
n return unscreen(getFromColor(p));\n}\n\nvec4 sample_with_corners_to(vec2 p, vec2
corner_size) {\n p = (p - 0.5) / zoom + 0.5;\n if (!test_rounded_mask(p,
corner_size)) {\n return black;\n }\n return unscreen(getToColor(p));\n}\n\n//
special sampling used when zooming - extra zoom parameter and don't unscreen\nvec4
simple_sample_with_corners_from(vec2 p, vec2 corner_size, float zoom_amt) {\n p =
(p - 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5;\n if (!test_rounded_mask(p,
corner_size)) {\n return black;\n }\n return getFromColor(p);\n}\n\nvec4
simple_sample_with_corners_to(vec2 p, vec2 corner_size, float zoom_amt) {\n p = (p
- 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5;\n if (!test_rounded_mask(p,
corner_size)) {\n return black;\n }\n return getToColor(p);\n}\n\n// Basic 2D
affine transform matrix helpers\n// These really shouldn't be used in a fragment
shader - I should work out the\n// the math for a translate & rotate function as a
pair of dot products instead\n\nmat3 rotate2d(float angle, float ratio) {\n float
s = sin(angle);\n float c = cos(angle);\n return mat3(\n c, s ,0.0,\n -s,
c, 0.0,\n 0.0, 0.0, 1.0);\n}\n\nmat3 translate2d(float x, float y) {\n return
mat3(\n 1.0, 0.0, 0,\n 0.0, 1.0, 0,\n -x, -y, 1.0);\n}\n\nmat3
scale2d(float x, float y) {\n return mat3(\n x, 0.0, 0,\n 0.0, y, 0,\n 0,
0, 1.0);\n}\n\n// Split an image and rotate one up and one down along off screen
pivot points\nvec4 get_cross_rotated(vec3 p3, float angle, vec2 corner_size, float
ratio) {\n angle = angle * angle; // easing\n angle /= 2.4; // works out to be a
good number of radians\n\n mat3 center_and_scale = translate2d(-0.5, -0.5) *
scale2d(1.0, ratio);\n mat3 unscale_and_uncenter = scale2d(1.0, 1.0/ratio) *
translate2d(0.5,0.5);\n mat3 slide_left = translate2d(-2.0,0.0);\n mat3
slide_right = translate2d(2.0,0.0);\n mat3 rotate = rotate2d(angle, ratio);\n\n
mat3 op_a = center_and_scale * slide_right * rotate * slide_left *
unscale_and_uncenter;\n mat3 op_b = center_and_scale * slide_left * rotate *
slide_right * unscale_and_uncenter;\n\n vec4 a = sample_with_corners_from((op_a *
p3).xy, corner_size);\n vec4 b = sample_with_corners_from((op_b * p3).xy,
corner_size);\n\n return screen(a, b);\n}\n\n// Image stays put, but this time
move two masks\nvec4 get_cross_masked(vec3 p3, float angle, vec2 corner_size, float
ratio) {\n angle = 1.0 - angle;\n angle = angle * angle; // easing\n angle /=
2.4;\n\n vec4 img;\n\n mat3 center_and_scale = translate2d(-0.5, -0.5) *
scale2d(1.0, ratio);\n mat3 unscale_and_uncenter = scale2d(1.0 / zoom, 1.0 / (zoom
* ratio)) * translate2d(0.5,0.5);\n mat3 slide_left = translate2d(-2.0,0.0);\n
mat3 slide_right = translate2d(2.0,0.0);\n mat3 rotate = rotate2d(angle, ratio);\
n\n mat3 op_a = center_and_scale * slide_right * rotate * slide_left *
unscale_and_uncenter;\n mat3 op_b = center_and_scale * slide_left * rotate *
slide_right * unscale_and_uncenter;\n\n bool mask_a = test_rounded_mask((op_a *
p3).xy, corner_size);\n bool mask_b = test_rounded_mask((op_b * p3).xy,
corner_size);\n\n if (mask_a || mask_b) {\n img = sample_with_corners_to(p3.xy,
corner_size);\n return screen(mask_a ? img : black, mask_b ? img : black);\n }
else {\n return black;\n }\n}\n\nvec4 transition(vec2 uv) {\n float a;\n vec2
p=uv.xy/vec2(1.0).xy;\n vec3 p3 = vec3(p.xy, 1.0); // for 2D matrix transforms\n\n
// corner is warped to represent to size after mapping to 1.0, 1.0\n vec2
corner_size = vec2(corner_radius / ratio, corner_radius);\n\n if (progress <= 0.0)
{\n // 0.0: start with the base frame always\n return getFromColor(p);\n }
else if (progress < 0.1) {\n // 0.0-0.1: zoom out and add rounded corners\n a
= progress / 0.1;\n return simple_sample_with_corners_from(p, corner_size * a,
a);\n } else if (progress < 0.48) {\n // 0.1-0.48: Split original image apart\n
a = (progress - 0.1)/0.38;\n return get_cross_rotated(p3, a, corner_size,
ratio);\n } else if (progress < 0.9) {\n // 0.48-0.52: black\n // 0.52 -
0.9: unmask new image\n return get_cross_masked(p3, (progress - 0.52)/0.38,
corner_size, ratio);\n } else if (progress < 1.0) {\n // zoom out and add
rounded corners\n a = (1.0 - progress) / 0.1;\n return
simple_sample_with_corners_to(p, corner_size * a, a);\n } else {\n // 1.0 end
with base frame\n return getToColor(p);\n }\n}\n",
author: "Ted Schundler",
license: "BSD 2 Clause",
createdAt: "Tue, 20 Feb 2018 23:20:29 +0100",
updatedAt: "Wed, 21 Feb 2018 15:42:00 +0100"
}, {
name: "Swirl",
paramsTypes: {},
defaultParams: {},
glsl: "// License: MIT\n// Author: Sergey Kosarevsky\n// (
http://www.linderdaum.com )\n// ported by gre from
https://gist.github.com/corporateshark/cacfedb8cca0f5ce3f7c\n\nvec4 transition(vec2
UV)\n{\n\tfloat Radius = 1.0;\n\n\tfloat T = progress;\n\n\tUV -= vec2( 0.5,
0.5 );\n\n\tfloat Dist = length(UV);\n\n\tif ( Dist < Radius )\n\t{\n\t\tfloat
Percent = (Radius - Dist) / Radius;\n\t\tfloat A = ( T <= 0.5 ) ? mix( 0.0, 1.0,
T/0.5 ) : mix( 1.0, 0.0, (T-0.5)/0.5 );\n\t\tfloat Theta = Percent * Percent * A *
8.0 * 3.14159;\n\t\tfloat S = sin( Theta );\n\t\tfloat C = cos( Theta );\n\t\tUV =
vec2( dot(UV, vec2(C, -S)), dot(UV, vec2(S, C)) );\n\t}\n\tUV += vec2( 0.5, 0.5 );\
n\n\tvec4 C0 = getFromColor(UV);\n\tvec4 C1 = getToColor(UV);\n\n\treturn mix( C0,
C1, T );\n}\n",
license: "MIT",
author: "Sergey Kosarevsky",
createdAt: "Mon, 12 Jun 2017 12:38:27 +0800",
updatedAt: "Mon, 12 Jun 2017 12:38:27 +0800"
}, {
name: "WaterDrop",
paramsTypes: {
amplitude: "float",
speed: "float"
},
defaultParams: {
amplitude: 30,
speed: 30
},
glsl: "// author: Paweł Płóciennik\n// license: MIT\nuniform float
amplitude; // = 30\nuniform float speed; // = 30\n\nvec4 transition(vec2 p) {\n
vec2 dir = p - vec2(.5);\n float dist = length(dir);\n\n if (dist > progress) {\n
return mix(getFromColor( p), getToColor( p), progress);\n } else {\n vec2
offset = dir * sin(dist * amplitude - progress * speed);\n return
mix(getFromColor( p + offset), getToColor( p), progress);\n }\n}\n",
author: "Paweł Płóciennik",
license: "MIT",
createdAt: "Wed, 21 Feb 2018 19:37:15 +0100",
updatedAt: "Wed, 21 Feb 2018 19:37:15 +0100"
}, {
name: "ZoomInCircles",
paramsTypes: {},
defaultParams: {},
glsl: "// License: MIT\n// Author: dycm8009\n// ported by gre from
https://gist.github.com/dycm8009/948e99b1800e81ad909a\n\nvec2 zoom(vec2 uv, float
amount) {\n return 0.5 + ((uv - 0.5) * amount);\t\n}\n\nvec2 ratio2 = vec2(1.0,
1.0 / ratio);\n\nvec4 transition(vec2 uv) {\n // TODO: some timing are hardcoded
but should be one or many parameters\n // TODO: should also be able to configure
how much circles\n // TODO: if() branching should be avoided when possible, prefer
use of step() & other functions\n vec2 r = 2.0 * ((vec2(uv.xy) - 0.5) * ratio2);\n
float pro = progress / 0.8;\n float z = pro * 0.2;\n float t = 0.0;\n if (pro >
1.0) {\n z = 0.2 + (pro - 1.0) * 5.;\n t = clamp((progress - 0.8) / 0.07,
0.0, 1.0);\n }\n if (length(r) < 0.5+z) {\n // uv = zoom(uv, 0.9 - 0.1 *
pro);\n }\n else if (length(r) < 0.8+z*1.5) {\n uv = zoom(uv, 1.0 - 0.15 *
pro);\n t = t * 0.5;\n }\n else if (length(r) < 1.2+z*2.5) {\n uv =
zoom(uv, 1.0 - 0.2 * pro);\n t = t * 0.2;\n }\n else {\n uv = zoom(uv, 1.0
- 0.25 * pro);\n }\n return mix(getFromColor(uv), getToColor(uv), t);\n}\n",
license: "MIT",
author: "dycm8009",
createdAt: "Mon, 12 Jun 2017 11:24:34 +0800",
updatedAt: "Mon, 12 Jun 2017 11:24:34 +0800"
}, {
name: "angular",
paramsTypes: {
startingAngle: "float"
},
defaultParams: {
startingAngle: 90
},
glsl: "// Author: Fernando Kuteken\n// License: MIT\n\n#define PI
3.141592653589\n\nuniform float startingAngle; // = 90;\n\nvec4 transition (vec2
uv) {\n \n float offset = startingAngle * PI / 180.0;\n float angle = atan(uv.y
- 0.5, uv.x - 0.5) + offset;\n float normalizedAngle = (angle + PI) / (2.0 * PI);\
n \n normalizedAngle = normalizedAngle - floor(normalizedAngle);\n\n return
mix(\n getFromColor(uv),\n getToColor(uv),\n step(normalizedAngle,
progress)\n );\n}\n",
author: "Fernando Kuteken",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "burn",
paramsTypes: {
color: "vec3"
},
defaultParams: {
color: [.9, .4, .2]
},
glsl: "// author: gre\n// License: MIT\nuniform vec3 color /* =
vec3(0.9, 0.4, 0.2) */;\nvec4 transition (vec2 uv) {\n return mix(\n
getFromColor(uv) + vec4(progress*color, 1.0),\n getToColor(uv) + vec4((1.0-
progress)*color, 1.0),\n progress\n );\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "cannabisleaf",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: @Flexi23\n// License: MIT\n\n// inspired by
http://www.wolframalpha.com/input/?i=cannabis+curve\n\nvec4 transition (vec2 uv) {\
n if(progress == 0.0){\n return getFromColor(uv);\n }\n vec2 leaf_uv = (uv -
vec2(0.5))/10./pow(progress,3.5);\n\tleaf_uv.y += 0.35;\n\tfloat r = 0.18;\n\tfloat
o = atan(leaf_uv.y, leaf_uv.x);\n return mix(getFromColor(uv), getToColor(uv), 1.-
step(1. - length(leaf_uv)+r*(1.+sin(o))*(1.+0.9 *
cos(8.*o))*(1.+0.1*cos(24.*o))*(0.9+0.05*cos(200.*o)), 1.));\n}\n",
author: "@Flexi23",
license: "MIT",
createdAt: "Thu, 1 Jun 2017 15:58:58 +0200",
updatedAt: "Thu, 1 Jun 2017 15:58:58 +0200"
}, {
name: "circle",
paramsTypes: {
center: "vec2",
backColor: "vec3"
},
defaultParams: {
center: [.5, .5],
backColor: [.1, .1, .1]
},
glsl: "// Author: Fernando Kuteken\n// License: MIT\n\nuniform vec2
center; // = vec2(0.5, 0.5);\nuniform vec3 backColor; // = vec3(0.1, 0.1, 0.1);\n\
nvec4 transition (vec2 uv) {\n \n float distance = length(uv - center);\n float
radius = sqrt(8.0) * abs(progress - 0.5);\n \n if (distance > radius) {\n
return vec4(backColor, 1.0);\n }\n else {\n if (progress < 0.5) return
getFromColor(uv);\n else return getToColor(uv);\n }\n}\n",
author: "Fernando Kuteken",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "circleopen",
paramsTypes: {
smoothness: "float",
opening: "bool"
},
defaultParams: {
smoothness: .3,
opening: !0
},
glsl: "// author: gre\n// License: MIT\nuniform float smoothness; // =
0.3\nuniform bool opening; // = true\n\nconst vec2 center = vec2(0.5, 0.5);\nconst
float SQRT_2 = 1.414213562373;\n\nvec4 transition (vec2 uv) {\n float x =
opening ? progress : 1.-progress;\n float m = smoothstep(-smoothness, 0.0,
SQRT_2*distance(center, uv) - x*(1.+smoothness));\n return mix(getFromColor(uv),
getToColor(uv), opening ? 1.-m : m);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "colorphase",
paramsTypes: {
fromStep: "vec4",
toStep: "vec4"
},
defaultParams: {
fromStep: [0, .2, .4, 0],
toStep: [.6, .8, 1, 1]
},
glsl: "// Author: gre\n// License: MIT\n\n// Usage: fromStep and toStep
must be in [0.0, 1.0] range \n// and all(fromStep) must be < all(toStep)\n\nuniform
vec4 fromStep; // = vec4(0.0, 0.2, 0.4, 0.0)\nuniform vec4 toStep; // = vec4(0.6,
0.8, 1.0, 1.0)\n\nvec4 transition (vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4
b = getToColor(uv);\n return mix(a, b, smoothstep(fromStep, toStep,
vec4(progress)));\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "crosshatch",
paramsTypes: {
center: "vec2",
threshold: "float",
fadeEdge: "float"
},
defaultParams: {
center: [.5, .5],
threshold: 3,
fadeEdge: .1
},
glsl: "// License: MIT\n// Author: pthrasher\n// adapted by gre from
https://gist.github.com/pthrasher/04fd9a7de4012cbb03f6\n\nuniform vec2 center; // =
vec2(0.5)\nuniform float threshold; // = 3.0\nuniform float fadeEdge; // = 0.1\n\
nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) *
43758.5453);\n}\nvec4 transition(vec2 p) {\n float dist = distance(center, p) /
threshold;\n float r = progress - min(rand(vec2(p.y, 0.0)), rand(vec2(0.0,
p.x)));\n return mix(getFromColor(p), getToColor(p), mix(0.0, mix(step(dist, r),
1.0, smoothstep(1.0-fadeEdge, 1.0, progress)), smoothstep(0.0, fadeEdge,
progress))); \n}\n",
license: "MIT",
author: "pthrasher",
createdAt: "Mon, 12 Jun 2017 10:02:12 +0800",
updatedAt: "Mon, 12 Jun 2017 10:02:12 +0800"
}, {
name: "crosswarp",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: Eke Péter <[email protected]>\n// License: MIT\
nvec4 transition(vec2 p) {\n float x = progress;\n x=smoothstep(.0,1.0,
(x*2.0+p.x-1.0));\n return mix(getFromColor((p-.5)*(1.-x)+.5),
getToColor((p-.5)*x+.5), x);\n}\n",
author: "Eke Péter <[email protected]>",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "cube",
paramsTypes: {
persp: "float",
unzoom: "float",
reflection: "float",
floating: "float"
},
defaultParams: {
persp: .7,
unzoom: .3,
reflection: .4,
floating: 3
},
glsl: "// Author: gre\n// License: MIT\nuniform float persp; // = 0.7\
nuniform float unzoom; // = 0.3\nuniform float reflection; // = 0.4\nuniform float
floating; // = 3.0\n\nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) +
vec2(0.0, -floating/100.);\n}\n\nbool inBounds (vec2 p) {\n return
all(lessThan(vec2(0.0), p)) && all(lessThan(p, vec2(1.0)));\n}\n\nvec4 bgColor
(vec2 p, vec2 pfr, vec2 pto) {\n vec4 c = vec4(0.0, 0.0, 0.0, 1.0);\n pfr =
project(pfr);\n // FIXME avoid branching might help perf!\n if (inBounds(pfr)) {\
n c += mix(vec4(0.0), getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y));\
n }\n pto = project(pto);\n if (inBounds(pto)) {\n c += mix(vec4(0.0),
getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return c;\n}\n\n// p :
the position\n// persp : the perspective in [ 0, 1 ]\n// center : the xcenter in
[0, 1] \\ 0.5 excluded\nvec2 xskew (vec2 p, float persp, float center) {\n float x
= mix(p.x, 1.0-p.x, center);\n return (\n (\n vec2( x, (p.y - 0.5*(1.0-
persp) * x) / (1.0+(persp-1.0)*x) )\n - vec2(0.5-distance(center, 0.5), 0.0)\n
)\n * vec2(0.5 / distance(center, 0.5) * (center<0.5 ? 1.0 : -1.0), 1.0)\n +
vec2(center<0.5 ? 0.0 : 1.0, 0.0)\n );\n}\n\nvec4 transition(vec2 op) {\n float
uz = unzoom * 2.0*(0.5-distance(0.5, progress));\n vec2 p = -uz*0.5+(1.0+uz) *
op;\n vec2 fromP = xskew(\n (p - vec2(progress, 0.0)) / vec2(1.0-progress,
1.0),\n 1.0-mix(progress, 0.0, persp),\n 0.0\n );\n vec2 toP = xskew(\n
p / vec2(progress, 1.0),\n mix(pow(progress, 2.0), 1.0, persp),\n 1.0\n );\n
// FIXME avoid branching might help perf!\n if (inBounds(fromP)) {\n return
getFromColor(fromP);\n }\n else if (inBounds(toP)) {\n return
getToColor(toP);\n }\n return bgColor(op, fromP, toP);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "directionalwarp",
paramsTypes: {
direction: "vec2"
},
defaultParams: {
direction: [-1, 1]
},
glsl: "// Author: pschroen\n// License: MIT\n\nuniform vec2
direction; // = vec2(-1.0, 1.0)\n\nconst float smoothness = 0.5;\nconst vec2 center
= vec2(0.5, 0.5);\n\nvec4 transition (vec2 uv) {\n vec2 v = normalize(direction);\
n v /= abs(v.x) + abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float
m = 1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d - 0.5 +
progress * (1.0 + smoothness)));\n return mix(getFromColor((uv - 0.5) * (1.0 - m)
+ 0.5), getToColor((uv - 0.5) * m + 0.5), m);\n}\n",
author: "pschroen",
license: "MIT",
createdAt: "Wed, 13 Dec 2017 12:08:49 -0500",
updatedAt: "Wed, 13 Dec 2017 12:08:49 -0500"
}, {
name: "directionalwipe",
paramsTypes: {
direction: "vec2",
smoothness: "float"
},
defaultParams: {
direction: [1, -1],
smoothness: .5
},
glsl: "// Author: gre\n// License: MIT\n\nuniform vec2 direction; // =
vec2(1.0, -1.0)\nuniform float smoothness; // = 0.5\n \nconst vec2 center =
vec2(0.5, 0.5);\n \nvec4 transition (vec2 uv) {\n vec2 v = normalize(direction);\n
v /= abs(v.x)+abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float m =\
n (1.0-step(progress, 0.0)) * // there is something wrong with our formula that
makes m not equals 0.0 with progress is 0.0\n (1.0 - smoothstep(-smoothness,
0.0, v.x * uv.x + v.y * uv.y - (d-0.5+progress*(1.+smoothness))));\n return
mix(getFromColor(uv), getToColor(uv), m);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "displacement",
paramsTypes: {
displacementMap: "sampler2D",
strength: "float"
},
defaultParams: {
displacementMap: null,
strength: .5
},
glsl: "// Author: Travis Fischer\n// License: MIT\n//\n// Adapted from
a Codrops article by Robin Delaporte\n//
https://tympanus.net/Development/DistortionHoverEffect\n\nuniform sampler2D
displacementMap;\n\nuniform float strength; // = 0.5\n\nvec4 transition (vec2 uv)
{\n float displacement = texture2D(displacementMap, uv).r * strength;\n\n vec2
uvFrom = vec2(uv.x + progress * displacement, uv.y);\n vec2 uvTo = vec2(uv.x -
(1.0 - progress) * displacement, uv.y);\n\n return mix(\n
getFromColor(uvFrom),\n getToColor(uvTo),\n progress\n );\n}\n",
author: "Travis Fischer",
license: "MIT",
createdAt: "Tue, 10 Apr 2018 23:03:38 -0400",
updatedAt: "Tue, 10 Apr 2018 23:03:38 -0400"
}, {
name: "doorway",
paramsTypes: {
reflection: "float",
perspective: "float",
depth: "float"
},
defaultParams: {
reflection: .4,
perspective: .4,
depth: 3
},
glsl: "// author: gre\n// License: MIT \nuniform float reflection; // =
0.4\nuniform float perspective; // = 0.4\nuniform float depth; // = 3\n\nconst vec4
black = vec4(0.0, 0.0, 0.0, 1.0);\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst
vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return
all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec2 project (vec2
p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);\n}\n\nvec4 bgColor (vec2 p,
vec2 pto) {\n vec4 c = black;\n pto = project(pto);\n if (inBounds(pto)) {\n
c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return
c;\n}\n\n\nvec4 transition (vec2 p) {\n vec2 pfr = vec2(-1.), pto = vec2(-1.);\n
float middleSlit = 2.0 * abs(p.x-0.5) - progress;\n if (middleSlit > 0.0) {\n
pfr = p + (p.x > 0.5 ? -1.0 : 1.0) * vec2(0.5*progress, 0.0);\n float d =
1.0/(1.0+perspective*progress*(1.0-middleSlit));\n pfr.y -= d/2.;\n pfr.y *=
d;\n pfr.y += d/2.;\n }\n float size = mix(1.0, depth, 1.-progress);\n pto =
(p + vec2(-0.5, -0.5)) * vec2(size, size) + vec2(0.5, 0.5);\n if (inBounds(pfr))
{\n return getFromColor(pfr);\n }\n else if (inBounds(pto)) {\n return
getToColor(pto);\n }\n else {\n return bgColor(p, pto);\n }\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "fade",
paramsTypes: {},
defaultParams: {},
glsl: "// author: gre\n// license: MIT\n\nvec4 transition (vec2 uv) {\n
return mix(\n getFromColor(uv),\n getToColor(uv),\n progress\n );\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "fadecolor",
paramsTypes: {
color: "vec3",
colorPhase: "float"
},
defaultParams: {
color: [0, 0, 0],
colorPhase: .4
},
glsl: "// author: gre\n// License: MIT\nuniform vec3 color;// =
vec3(0.0)\nuniform float colorPhase/* = 0.4 */; // if 0.0, there is no black phase,
if 0.9, the black phase is very important\nvec4 transition (vec2 uv) {\n return
mix(\n mix(vec4(color, 1.0), getFromColor(uv), smoothstep(1.0-colorPhase, 0.0,
progress)),\n mix(vec4(color, 1.0), getToColor(uv), smoothstep( colorPhase,
1.0, progress)),\n progress);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "fadegrayscale",
paramsTypes: {
intensity: "float"
},
defaultParams: {
intensity: .3
},
glsl: "// Author: gre\n// License: MIT\n\nuniform float intensity; // =
0.3; // if 0.0, the image directly turn grayscale, if 0.9, the grayscale transition
phase is very important\n \nvec3 grayscale (vec3 color) {\n return
vec3(0.2126*color.r + 0.7152*color.g + 0.0722*color.b);\n}\n \nvec4 transition
(vec2 uv) {\n vec4 fc = getFromColor(uv);\n vec4 tc = getToColor(uv);\n return
mix(\n mix(vec4(grayscale(fc.rgb), 1.0), fc, smoothstep(1.0-intensity, 0.0,
progress)),\n mix(vec4(grayscale(tc.rgb), 1.0), tc, smoothstep( intensity,
1.0, progress)),\n progress);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "flyeye",
paramsTypes: {
size: "float",
zoom: "float",
colorSeparation: "float"
},
defaultParams: {
size: .04,
zoom: 50,
colorSeparation: .3
},
glsl: "// Author: gre\n// License: MIT\nuniform float size; // = 0.04\
nuniform float zoom; // = 50.0\nuniform float colorSeparation; // = 0.3\n\nvec4
transition(vec2 p) {\n float inv = 1. - progress;\n vec2 disp =
size*vec2(cos(zoom*p.x), sin(zoom*p.y));\n vec4 texTo = getToColor(p + inv*disp);\
n vec4 texFrom = vec4(\n getFromColor(p + progress*disp*(1.0 -
colorSeparation)).r,\n getFromColor(p + progress*disp).g,\n getFromColor(p +
progress*disp*(1.0 + colorSeparation)).b,\n 1.0);\n return texTo*progress +
texFrom*inv;\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "heart",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: gre\n// License: MIT\n\nfloat inHeart (vec2 p, vec2
center, float size) {\n if (size==0.0) return 0.0;\n vec2 o =
(p-center)/(1.6*size);\n float a = o.x*o.x+o.y*o.y-0.3;\n return step(a*a*a,
o.x*o.x*o.y*o.y*o.y);\n}\nvec4 transition (vec2 uv) {\n return mix(\n
getFromColor(uv),\n getToColor(uv),\n inHeart(uv, vec2(0.5, 0.4), progress)\n
);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "hexagonalize",
paramsTypes: {
steps: "int",
horizontalHexagons: "float"
},
defaultParams: {
steps: 50,
horizontalHexagons: 20
},
glsl: "// Author: Fernando Kuteken\n// License: MIT\n// Hexagonal math
from: http://www.redblobgames.com/grids/hexagons/\n\nuniform int steps; // = 50;\
nuniform float horizontalHexagons; //= 20;\n\nstruct Hexagon {\n float q;\n float
r;\n float s;\n};\n\nHexagon createHexagon(float q, float r){\n Hexagon hex;\n
hex.q = q;\n hex.r = r;\n hex.s = -q - r;\n return hex;\n}\n\nHexagon
roundHexagon(Hexagon hex){\n \n float q = floor(hex.q + 0.5);\n float r =
floor(hex.r + 0.5);\n float s = floor(hex.s + 0.5);\n\n float deltaQ = abs(q -
hex.q);\n float deltaR = abs(r - hex.r);\n float deltaS = abs(s - hex.s);\n\n if
(deltaQ > deltaR && deltaQ > deltaS)\n q = -r - s;\n else if (deltaR > deltaS)\
n r = -q - s;\n else\n s = -q - r;\n\n return createHexagon(q, r);\n}\n\
nHexagon hexagonFromPoint(vec2 point, float size) {\n \n point.y /= ratio;\n
point = (point - 0.5) / size;\n \n float q = (sqrt(3.0) / 3.0) * point.x + (-
1.0 / 3.0) * point.y;\n float r = 0.0 * point.x + 2.0 / 3.0 * point.y;\n\n
Hexagon hex = createHexagon(q, r);\n return roundHexagon(hex);\n \n}\n\nvec2
pointFromHexagon(Hexagon hex, float size) {\n \n float x = (sqrt(3.0) * hex.q +
(sqrt(3.0) / 2.0) * hex.r) * size + 0.5;\n float y = (0.0 * hex.q + (3.0 / 2.0) *
hex.r) * size + 0.5;\n \n return vec2(x, y * ratio);\n}\n\nvec4 transition (vec2
uv) {\n \n float dist = 2.0 * min(progress, 1.0 - progress);\n dist = steps >
0 ? ceil(dist * float(steps)) / float(steps) : dist;\n \n float size = (sqrt(3.0)
/ 3.0) * dist / horizontalHexagons;\n \n vec2 point = dist > 0.0 ?
pointFromHexagon(hexagonFromPoint(uv, size), size) : uv;\n\n return
mix(getFromColor(point), getToColor(point), progress);\n \n}\n",
author: "Fernando Kuteken",
license: "MIT",
createdAt: "Tue, 30 May 2017 21:55:47 -0300",
updatedAt: "Tue, 30 May 2017 21:55:47 -0300"
}, {
name: "kaleidoscope",
paramsTypes: {
speed: "float",
angle: "float",
power: "float"
},
defaultParams: {
speed: 1,
angle: 1,
power: 1.5
},
glsl: "// Author: nwoeanhinnogaehr\n// License: MIT\n\nuniform float
speed; // = 1.0;\nuniform float angle; // = 1.0;\nuniform float power; // = 1.5;\n\
nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n vec2 q = p;\n
float t = pow(progress, power)*speed;\n p = p -0.5;\n for (int i = 0; i < 7; i++)
{\n p = vec2(sin(t)*p.x + cos(t)*p.y, sin(t)*p.y - cos(t)*p.x);\n t +=
angle;\n p = abs(mod(p, 2.0) - 1.0);\n }\n abs(mod(p, 1.0));\n return mix(\n
mix(getFromColor(q), getToColor(q), progress),\n mix(getFromColor(p),
getToColor(p), progress), 1.0 - 2.0*abs(progress - 0.5));\n}\n",
author: "nwoeanhinnogaehr",
license: "MIT",
createdAt: "Wed, 31 May 2017 21:48:26 -0400",
updatedAt: "Wed, 31 May 2017 21:48:26 -0400"
}, {
name: "luma",
paramsTypes: {
luma: "sampler2D"
},
defaultParams: {
luma: null
},
glsl: "// Author: gre\n// License: MIT\n\nuniform sampler2D luma;\n\
nvec4 transition(vec2 uv) {\n return mix(\n getToColor(uv),\n
getFromColor(uv),\n step(progress, texture2D(luma, uv).r)\n );\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "luminance_melt",
paramsTypes: {
direction: "bool",
l_threshold: "float",
above: "bool"
},
defaultParams: {
direction: !0,
l_threshold: .8,
above: !1
},
glsl: "// Author: 0gust1\n// License: MIT\n//My own first transition —
based on crosshatch code (from pthrasher), using simplex noise formula (copied and
pasted)\n//-> cooler with high contrasted images (isolated dark subject on light
background f.e.)\n//TODO : try to rebase it on DoomTransition (from
zeh)?\n//optimizations :\n//luminance (see
http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-
color#answer-596241)\n// Y = (R+R+B+G+G+G)/6\n//or Y = (R+R+R+B+G+G+G+G)>>3 \n\n\
n//direction of movement : 0 : up, 1, down\nuniform bool direction; // = 1
\n//luminance threshold\nuniform float l_threshold; // = 0.8 \n//does the movement
takes effect above or below luminance threshold ?\nuniform bool above; // = false \
n\n\n//Random function borrowed from everywhere\nfloat rand(vec2 co){\n return
fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n\n// Simplex noise
:\n// Description : Array and textureless GLSL 2D simplex noise function.\n//
Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110822
(ijm)\n// License : MIT \n// 2011 Ashima Arts. All rights
reserved.\n// Distributed under the MIT License. See LICENSE file.\
n// https://github.com/ashima/webgl-noise\n// \n\nvec3 mod289(vec3 x)
{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n
return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return
mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n {\n const vec4 C =
vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n
0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n -
0.577350269189626, // -1.0 + 2.0 * C.x\n
0.024390243902439); // 1.0 / 41.0\n// First corner\n vec2 i = floor(v + dot(v,
C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n// Other corners\n vec2 i1;\
n //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0\n //i1.y = 1.0 - i1.x;\
n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n // x0 = x0 - 0.0 + 0.0
* C.xx ;\n // x1 = x0 - i1 + 1.0 * C.xx ;\n // x2 = x0 - 1.0 + 2.0 * C.xx ;\n
vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n// Permutations\n i =
mod289(i); // Avoid truncation effects in permutation\n vec3 p = permute( permute(
i.y + vec3(0.0, i1.y, 1.0 ))\n\t\t+ i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m =
max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m =
m*m ;\n m = m*m ;\n\n// Gradients: 41 points uniformly over a line, mapped onto a
diamond.\n// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)\n\
n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox =
floor(x + 0.5);\n vec3 a0 = x - ox;\n\n// Normalise gradients implicitly by
scaling m\n// Approximation of: m *= inversesqrt( a0*a0 + h*h );\n m *=
1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n// Compute final noise
value at P\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz *
x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\n// Simplex noise -- end\
n\nfloat luminance(vec4 color){\n //(0.299*R + 0.587*G + 0.114*B)\n return
color.r*0.299+color.g*0.587+color.b*0.114;\n}\n\nvec2 center = vec2(1.0,
direction);\n\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n if
(progress == 0.0) {\n return getFromColor(p);\n } else if (progress == 1.0) {\n
return getToColor(p);\n } else {\n float x = progress;\n float dist =
distance(center, p)- progress*exp(snoise(vec2(p.x, 0.0)));\n float r = x -
rand(vec2(p.x, 0.1));\n float m;\n if(above){\n m = dist <= r &&
luminance(getFromColor(p))>l_threshold ? 1.0 : (progress*progress*progress);\
n }\n else{\n m = dist <= r && luminance(getFromColor(p))<l_threshold ?
1.0 : (progress*progress*progress); \n }\n return mix(getFromColor(p),
getToColor(p), m); \n }\n}\n",
author: "0gust1",
license: "MIT",
createdAt: "Wed, 24 Jan 2018 19:02:32 +0100",
updatedAt: "Wed, 24 Jan 2018 19:02:32 +0100"
}, {
name: "morph",
paramsTypes: {
strength: "float"
},
defaultParams: {
strength: .1
},
glsl: "// Author: paniq\n// License: MIT\nuniform float strength; // =
0.1\n\nvec4 transition(vec2 p) {\n vec4 ca = getFromColor(p);\n vec4 cb =
getToColor(p);\n \n vec2 oa = (((ca.rg+ca.b)*0.5)*2.0-1.0);\n vec2 ob =
(((cb.rg+cb.b)*0.5)*2.0-1.0);\n vec2 oc = mix(oa,ob,0.5)*strength;\n \n float w0
= progress;\n float w1 = 1.0-w0;\n return mix(getFromColor(p+oc*w0),
getToColor(p-oc*w1), progress);\n}\n",
author: "paniq",
license: "MIT",
createdAt: "Thu, 10 Aug 2017 00:27:36 +0200",
updatedAt: "Thu, 10 Aug 2017 00:32:01 +0200"
}, {
name: "multiply_blend",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: Fernando Kuteken\n// License: MIT\n\nvec4 blend(vec4
a, vec4 b) {\n return a * b;\n}\n\nvec4 transition (vec2 uv) {\n \n vec4 blended
= blend(getFromColor(uv), getToColor(uv));\n \n if (progress < 0.5)\n return
mix(getFromColor(uv), blended, 2.0 * progress);\n else\n return mix(blended,
getToColor(uv), 2.0 * progress - 1.0);\n}\n\n",
author: "Fernando Kuteken",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "perlin",
paramsTypes: {
scale: "float",
smoothness: "float",
seed: "float"
},
defaultParams: {
scale: 4,
smoothness: .01,
seed: 12.9898
},
glsl: "// Author: Rich Harris\n// License: MIT\n\n#ifdef GL_ES\
nprecision mediump float;\n#endif\n\nuniform float scale; // = 4.0\nuniform float
smoothness; // = 0.01\n\nuniform float seed; // = 12.9898\n\n//
http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-
opengl-es-2-0/\nfloat random(vec2 co)\n{\n highp float a = seed;\n highp
float b = 78.233;\n highp float c = 43758.5453;\n highp float dt=
dot(co.xy ,vec2(a,b));\n highp float sn= mod(dt,3.14);\n return fract(sin(sn)
* c);\n}\n\n// 2D Noise based on Morgan McGuire @morgan3d\n//
https://www.shadertoy.com/view/4dS3Wd\nfloat noise (in vec2 st) {\n vec2 i =
floor(st);\n vec2 f = fract(st);\n\n // Four corners in 2D of a tile\n
float a = random(i);\n float b = random(i + vec2(1.0, 0.0));\n float c =
random(i + vec2(0.0, 1.0));\n float d = random(i + vec2(1.0, 1.0));\n\n //
Smooth Interpolation\n\n // Cubic Hermine Curve. Same as SmoothStep()\n vec2
u = f*f*(3.0-2.0*f);\n // u = smoothstep(0.,1.,f);\n\n // Mix 4 coorners
porcentages\n return mix(a, b, u.x) +\n (c - a)* u.y * (1.0 - u.x) +\
n (d - b) * u.x * u.y;\n}\n\nvec4 transition (vec2 uv) {\n vec4 from =
getFromColor(uv);\n vec4 to = getToColor(uv);\n float n = noise(uv * scale);\n \
n float p = mix(-smoothness, 1.0 + smoothness, progress);\n float lower = p -
smoothness;\n float higher = p + smoothness;\n \n float q = smoothstep(lower,
higher, n);\n \n return mix(\n from,\n to,\n 1.0 - q\n );\n}\n",
author: "Rich Harris",
license: "MIT",
createdAt: "Tue, 23 Jan 2018 21:35:10 -0500",
updatedAt: "Wed, 24 Jan 2018 07:35:04 -0500"
}, {
name: "pinwheel",
paramsTypes: {
speed: "float"
},
defaultParams: {
speed: 2
},
glsl: "// Author: Mr Speaker\n// License: MIT\n\nuniform float
speed; // = 2.0;\n\nvec4 transition(vec2 uv) {\n \n vec2 p = uv.xy /
vec2(1.0).xy;\n \n float circPos = atan(p.y - 0.5, p.x - 0.5) + progress *
speed;\n float modPos = mod(circPos, 3.1415 / 4.);\n float signed = sign(progress
- modPos);\n \n return mix(getToColor(p), getFromColor(p), step(signed, 0.5));\n
\n}\n",
author: "Mr Speaker",
license: "MIT",
createdAt: "Tue, 30 May 2017 09:04:31 -0400",
updatedAt: "Tue, 30 May 2017 09:04:31 -0400"
}, {
name: "pixelize",
paramsTypes: {
squaresMin: "ivec2",
steps: "int"
},
defaultParams: {
squaresMin: [20, 20],
steps: 50
},
glsl: "// Author: gre\n// License: MIT\n// forked from
https://gist.github.com/benraziel/c528607361d90a072e98\n\nuniform ivec2
squaresMin/* = ivec2(20) */; // minimum number of squares (when the effect is at
its higher level)\nuniform int steps /* = 50 */; // zero disable the stepping\n\
nfloat d = min(progress, 1.0 - progress);\nfloat dist = steps>0 ? ceil(d *
float(steps)) / float(steps) : d;\nvec2 squareSize = 2.0 * dist /
vec2(squaresMin);\n\nvec4 transition(vec2 uv) {\n vec2 p = dist>0.0 ? (floor(uv /
squareSize) + 0.5) * squareSize : uv;\n return mix(getFromColor(p), getToColor(p),
progress);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Wed, 31 May 2017 10:58:26 +0200"
}, {
name: "polar_function",
paramsTypes: {
segments: "int"
},
defaultParams: {
segments: 5
},
glsl: "// Author: Fernando Kuteken\n// License: MIT\n\n#define PI
3.14159265359\n\nuniform int segments; // = 5;\n\nvec4 transition (vec2 uv) {\n \n
float angle = atan(uv.y - 0.5, uv.x - 0.5) - 0.5 * PI;\n float normalized = (angle
+ 1.5 * PI) * (2.0 * PI);\n \n float radius = (cos(float(segments) * angle) +
4.0) / 4.0;\n float difference = length(uv - vec2(0.5, 0.5));\n \n if
(difference > radius * progress)\n return getFromColor(uv);\n else\n return
getToColor(uv);\n}\n",
author: "Fernando Kuteken",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "randomsquares",
paramsTypes: {
size: "ivec2",
smoothness: "float"
},
defaultParams: {
size: [10, 10],
smoothness: .5
},
glsl: "// Author: gre\n// License: MIT\n\nuniform ivec2 size; // =
ivec2(10, 10)\nuniform float smoothness; // = 0.5\n \nfloat rand (vec2 co) {\n
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4
transition(vec2 p) {\n float r = rand(floor(vec2(size) * p));\n float m =
smoothstep(0.0, -smoothness, r - (progress * (1.0 + smoothness)));\n return
mix(getFromColor(p), getToColor(p), m);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "ripple",
paramsTypes: {
amplitude: "float",
speed: "float"
},
defaultParams: {
amplitude: 100,
speed: 50
},
glsl: "// Author: gre\n// License: MIT\nuniform float amplitude; // =
100.0\nuniform float speed; // = 50.0\n\nvec4 transition (vec2 uv) {\n vec2 dir =
uv - vec2(.5);\n float dist = length(dir);\n vec2 offset = dir * (sin(progress *
dist * amplitude - progress * speed) + .5) / 30.;\n return mix(\n
getFromColor(uv + offset),\n getToColor(uv),\n smoothstep(0.2, 1.0,
progress)\n );\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 15:15:27 +0200",
updatedAt: "Tue, 30 May 2017 15:15:27 +0200"
}, {
name: "rotate_scale_fade",
paramsTypes: {
center: "vec2",
rotations: "float",
scale: "float",
backColor: "vec4"
},
defaultParams: {
center: [.5, .5],
rotations: 1,
scale: 8,
backColor: [.15, .15, .15, 1]
},
glsl: "// Author: Fernando Kuteken\n// License: MIT\n\n#define PI
3.14159265359\n\nuniform vec2 center; // = vec2(0.5, 0.5);\nuniform float
rotations; // = 1;\nuniform float scale; // = 8;\nuniform vec4 backColor; // =
vec4(0.15, 0.15, 0.15, 1.0);\n\nvec4 transition (vec2 uv) {\n \n vec2 difference
= uv - center;\n vec2 dir = normalize(difference);\n float dist =
length(difference);\n \n float angle = 2.0 * PI * rotations * progress;\n \n
float c = cos(angle);\n float s = sin(angle);\n \n float currentScale =
mix(scale, 1.0, 2.0 * abs(progress - 0.5));\n \n vec2 rotatedDir = vec2(dir.x *
c - dir.y * s, dir.x * s + dir.y * c);\n vec2 rotatedUv = center + rotatedDir *
dist / currentScale;\n \n if (rotatedUv.x < 0.0 || rotatedUv.x > 1.0 ||\n
rotatedUv.y < 0.0 || rotatedUv.y > 1.0)\n return backColor;\n \n return
mix(getFromColor(rotatedUv), getToColor(rotatedUv), progress);\n}\n",
author: "Fernando Kuteken",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "squareswire",
paramsTypes: {
squares: "ivec2",
direction: "vec2",
smoothness: "float"
},
defaultParams: {
squares: [10, 10],
direction: [1, -.5],
smoothness: 1.6
},
glsl: "// Author: gre\n// License: MIT\n \nuniform ivec2 squares;// =
ivec2(10,10)\nuniform vec2 direction;// = vec2(1.0, -0.5)\nuniform float
smoothness; // = 1.6\n\nconst vec2 center = vec2(0.5, 0.5);\nvec4 transition (vec2
p) {\n vec2 v = normalize(direction);\n v /= abs(v.x)+abs(v.y);\n float d = v.x
* center.x + v.y * center.y;\n float offset = smoothness;\n float pr =
smoothstep(-offset, 0.0, v.x * p.x + v.y * p.y - (d-0.5+progress*(1.+offset)));\n
vec2 squarep = fract(p*vec2(squares));\n vec2 squaremin = vec2(pr/2.0);\n vec2
squaremax = vec2(1.0 - pr/2.0);\n float a = (1.0 - step(progress, 0.0)) *
step(squaremin.x, squarep.x) * step(squaremin.y, squarep.y) * step(squarep.x,
squaremax.x) * step(squarep.y, squaremax.y);\n return mix(getFromColor(p),
getToColor(p), a);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "squeeze",
paramsTypes: {
colorSeparation: "float"
},
defaultParams: {
colorSeparation: .04
},
glsl: "// Author: gre\n// License: MIT\n \nuniform float
colorSeparation; // = 0.04\n \nvec4 transition (vec2 uv) {\n float y = 0.5 +
(uv.y-0.5) / (1.0-progress);\n if (y < 0.0 || y > 1.0) {\n return
getToColor(uv);\n }\n else {\n vec2 fp = vec2(uv.x, y);\n vec2 off =
progress * vec2(0.0, colorSeparation);\n vec4 c = getFromColor(fp);\n vec4 cn
= getFromColor(fp - off);\n vec4 cp = getFromColor(fp + off);\n return
vec4(cn.r, c.g, cp.b, c.a);\n }\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "swap",
paramsTypes: {
reflection: "float",
perspective: "float",
depth: "float"
},
defaultParams: {
reflection: .4,
perspective: .2,
depth: 3
},
glsl: "// Author: gre\n// License: MIT\n// General parameters\nuniform
float reflection; // = 0.4\nuniform float perspective; // = 0.2\nuniform float
depth; // = 3.0\n \nconst vec4 black = vec4(0.0, 0.0, 0.0, 1.0);\nconst vec2
boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n \nbool inBounds
(vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n
\nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);\n}\n \
nvec4 bgColor (vec2 p, vec2 pfr, vec2 pto) {\n vec4 c = black;\n pfr =
project(pfr);\n if (inBounds(pfr)) {\n c += mix(black, getFromColor(pfr),
reflection * mix(1.0, 0.0, pfr.y));\n }\n pto = project(pto);\n if
(inBounds(pto)) {\n c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0,
pto.y));\n }\n return c;\n}\n \nvec4 transition(vec2 p) {\n vec2 pfr, pto =
vec2(-1.);\n \n float size = mix(1.0, depth, progress);\n float persp =
perspective * progress;\n pfr = (p + vec2(-0.0, -0.5)) * vec2(size/(1.0-
perspective*progress), size/(1.0-size*persp*p.x)) + vec2(0.0, 0.5);\n \n size =
mix(1.0, depth, 1.-progress);\n persp = perspective * (1.-progress);\n pto = (p +
vec2(-1.0, -0.5)) * vec2(size/(1.0-perspective*(1.0-progress)), size/(1.0-
size*persp*(0.5-p.x))) + vec2(1.0, 0.5);\n\n if (progress < 0.5) {\n if
(inBounds(pfr)) {\n return getFromColor(pfr);\n }\n if (inBounds(pto))
{\n return getToColor(pto);\n } \n }\n if (inBounds(pto)) {\n return
getToColor(pto);\n }\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n
return bgColor(p, pfr, pto);\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Sun, 18 Feb 2018 17:45:50 +0100"
}, {
name: "undulatingBurnOut",
paramsTypes: {
smoothness: "float",
center: "vec2",
color: "vec3"
},
defaultParams: {
smoothness: .03,
center: [.5, .5],
color: [0, 0, 0]
},
glsl: "// License: MIT\n// Author: pthrasher\n// adapted by gre from
https://gist.github.com/pthrasher/8e6226b215548ba12734\n\nuniform float smoothness;
// = 0.03\nuniform vec2 center; // = vec2(0.5)\nuniform vec3 color; // = vec3(0.0)\
n\nconst float M_PI = 3.14159265358979323846;\n\nfloat quadraticInOut(float t) {\n
float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\nfloat
getGradient(float r, float dist) {\n float d = r - dist;\n return mix(\n
smoothstep(-smoothness, 0.0, r - dist * (1.0 + smoothness)),\n -1.0 -
step(0.005, d),\n step(-0.005, d) * step(d, 0.01)\n );\n}\n\nfloat getWave(vec2
p){\n vec2 _p = p - center; // offset from center\n float rads = atan(_p.y,
_p.x);\n float degs = degrees(rads) + 180.0;\n vec2 range = vec2(0.0, M_PI *
30.0);\n vec2 domain = vec2(0.0, 360.0);\n float ratio = (M_PI * 30.0) / 360.0;\n
degs = degs * ratio;\n float x = progress;\n float magnitude = mix(0.02, 0.09,
smoothstep(0.0, 1.0, x));\n float offset = mix(40.0, 30.0, smoothstep(0.0, 1.0,
x));\n float ease_degs = quadraticInOut(sin(degs));\n float deg_wave_pos =
(ease_degs * magnitude) * sin(x * offset);\n return x + deg_wave_pos;\n}\n\nvec4
transition(vec2 p) {\n float dist = distance(center, p);\n float m =
getGradient(getWave(p), dist);\n vec4 cfrom = getFromColor(p);\n vec4 cto =
getToColor(p);\n return mix(mix(cfrom, cto, m), mix(cfrom, vec4(color, 1.0),
0.75), step(m, -2.0));\n}\n",
license: "MIT",
author: "pthrasher",
createdAt: "Mon, 12 Jun 2017 10:23:37 +0800",
updatedAt: "Mon, 12 Jun 2017 10:23:37 +0800"
}, {
name: "wind",
paramsTypes: {
size: "float"
},
defaultParams: {
size: .2
},
glsl: "// Author: gre\n// License: MIT\n\n// Custom parameters\nuniform
float size; // = 0.2\n\nfloat rand (vec2 co) {\n return
fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 transition
(vec2 uv) {\n float r = rand(vec2(0, uv.y));\n float m = smoothstep(0.0, -size,
uv.x*(1.0-size) + size*r - (progress * (1.0 + size)));\n return mix(\n
getFromColor(uv),\n getToColor(uv),\n m\n );\n}\n",
author: "gre",
license: "MIT",
createdAt: "Tue, 30 May 2017 14:26:44 +0200",
updatedAt: "Tue, 30 May 2017 14:26:44 +0200"
}, {
name: "windowblinds",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: Fabien Benetou\n// License: MIT\n\nvec4 transition
(vec2 uv) {\n float t = progress;\n \n if
(mod(floor(uv.y*100.*progress),2.)==0.)\n t*=2.-.5;\n \n return mix(\n
getFromColor(uv),\n getToColor(uv),\n mix(t, progress, smoothstep(0.8, 1.0,
progress))\n );\n}\n",
author: "Fabien Benetou",
license: "MIT",
createdAt: "Wed, 31 May 2017 14:11:48 +0200",
updatedAt: "Wed, 31 May 2017 14:11:48 +0200"
}, {
name: "windowslice",
paramsTypes: {
count: "float",
smoothness: "float"
},
defaultParams: {
count: 10,
smoothness: .5
},
glsl: "// Author: gre\n// License: MIT\n\nuniform float count; // =
10.0\nuniform float smoothness; // = 0.5\n\nvec4 transition (vec2 p) {\n float pr
= smoothstep(-smoothness, 0.0, p.x - progress * (1.0 + smoothness));\n float s =
step(pr, fract(count * p.x));\n return mix(getFromColor(p), getToColor(p), s);\n}\
n",
author: "gre",
license: "MIT",
createdAt: "Wed, 28 Mar 2018 17:23:26 +0200",
updatedAt: "Wed, 28 Mar 2018 17:23:26 +0200"
}, {
name: "wipeDown",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: Jake Nelson\n// License: MIT\n\nvec4 transition(vec2
uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4
b=getToColor(p);\n return mix(a, b, step(1.0-p.y,progress));\n}\n",
author: "Jake Nelson",
license: "MIT",
createdAt: "Wed, 1 Nov 2017 15:26:01 -0500",
updatedAt: "Thu, 2 Nov 2017 18:39:26 -0500"
}, {
name: "wipeLeft",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: Jake Nelson\n// License: MIT\n\nvec4 transition(vec2
uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4
b=getToColor(p);\n return mix(a, b, step(1.0-p.x,progress));\n}\n",
author: "Jake Nelson",
license: "MIT",
createdAt: "Wed, 1 Nov 2017 15:26:28 -0500",
updatedAt: "Fri, 3 Nov 2017 18:03:50 +0100"
}, {
name: "wipeRight",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: Jake Nelson\n// License: MIT\n\nvec4 transition(vec2
uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4
b=getToColor(p);\n return mix(a, b, step(0.0+p.x,progress));\n}\n",
author: "Jake Nelson",
license: "MIT",
createdAt: "Wed, 1 Nov 2017 15:27:02 -0500",
updatedAt: "Thu, 2 Nov 2017 18:40:22 -0500"
}, {
name: "wipeUp",
paramsTypes: {},
defaultParams: {},
glsl: "// Author: Jake Nelson\n// License: MIT\n\nvec4 transition(vec2
uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4
b=getToColor(p);\n return mix(a, b, step(0.0+p.y,progress));\n}\n",
author: "Jake Nelson",
license: "MIT",
createdAt: "Wed, 1 Nov 2017 15:24:36 -0500",
updatedAt: "Thu, 2 Nov 2017 18:37:42 -0500"
}];
const transitions = getDefaultExportFromCjs(glTransitions);
class TransitionFilter extends Filter$2 {
constructor(e) {
let t = e.coding;
e.tname && (t = transitions.find((t => t.name === e.tname)));
super("attribute vec2 aVertexPosition;\n varying vec2 _uv; //
gl-transition\n uniform mat3 projectionMatrix;\n uniform vec4 inputSize;\n
uniform vec4 outputFrame;\n varying vec2 vTextureCoord;\n\n vec4
filterVertexPosition( void )\n {\n vec2 position = aVertexPosition *
max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n return vec4((projectionMatrix
* vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2
filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw *
inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position =
filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n _uv =
vec2(0.5, 0.5) * (aVertexPosition+vec2(1.0, 1.0)); // gl-transition\n }", `\n
precision highp float;\n varying vec2 vTextureCoord;\n varying vec2 _uv;\n
uniform sampler2D uSampler, to, from;\n uniform float progress;\n\n vec4
customTexture2D(sampler2D texture, vec2 uv) {\n uv.y = 1.0 - uv.y;\n vec2
vt = 0.5 + (uv - 0.5) * vec2(min(1.0, 1.0), min(1.0, 1.0));\n return
texture2D(texture, vt);\n }\n\n vec4 getFromColor(vec2 uv){\n if
(progress > 0.5) {\n return customTexture2D(from, uv);\n } else if
(progress == 0.5) {\n return customTexture2D(from, uv);\n } else {\n
return customTexture2D(uSampler, uv);\n }\n }\n vec4 getToColor(vec2 uv)
{\n if (progress > 0.5) {\n return customTexture2D(uSampler, uv);\n
} else {\n return customTexture2D(to, uv);\n }\n }\n\n // gl-
transition code here\n ${t.glsl}\n // gl-transition code end\n\n void
main(){\n // 解决上下颠倒的问题\n vec2 vc = vec2(vTextureCoord.x, 1.0 -
vTextureCoord.y);\n vec4 color = transition(vc);\n gl_FragColor = color;\
n }`, {
progress: 0,
to: e.to,
from: e.from,
...t.defaultParams,
...e.options || {}
}),
this._params = void 0,
this.id = "",
this._params = e
}
setTexture(e, t) {
this._params.from = e,
this._params.to = t
}
set progress(e) {
e = Number(e.toFixed(2)),
this.uniforms.progress = e,
this.uniforms.to = e > .5 ? this._params.from : this._params.to
}
}
function TransitionElement(e) {
const t = e.element
, r = e.nextElement
, {currentTime: n, transitionElement: i, store: o, trackIndex: s,
env: a} = e;
let l = !1;
n >= t.startTime + t.duration - i.duration / 2 && n <= t.startTime +
t.duration + i.duration / 2 && (l = !0);
const c = reactExports.useRef()
, u = reactExports.useRef({});
if (reactExports.useEffect(( () => {
"export" === a && (o.elementReadyMark[t.id] = "start");
return (async () => {
var e, n, l, c;
let d = null
, p = null;
if (null == (e = u.current.from) || e.cav.remove(),
null == (n = u.current.from) || n.fromTexture.destroy(),
null == (l = u.current.to) || l.cav.remove(),
null == (c = u.current.to) || c.fromTexture.destroy(),
"video" === t.type) {
let e = null;
if ("export" === a) {
const n =
o.resourceManage.getBlobURLBySourceId(t.resourceId)
, i = document.createElement("video");
i.preload = "auto",
i.crossOrigin = "Anonymous",
i.autoplay = !1,
i.src = n,
i.setAttribute("playsinline", ""),
i.setAttribute("webkit-playsinline", ""),
e = await getVideoFrameAtTime(r.clipTime, i)
} else {
const {target: r} =
o.resourceManage.getCacheBlobURLById(t.resourceId, s);
e = r
}
const n = await createMediaTransitionCapture(e, t.clipTime
+ t.duration, {
width: o.data.width,
height: o.data.height
}, {
x: t.style.x - t.style.width / 2,
y: t.style.y - t.style.height / 2,
width: t.style.width,
height: t.style.height,
rotation: t.style.rotation
});
d = Texture.from(n),
u.current.from = {
cav: n,
fromTexture: d
}
} else {
const e =
o.resourceManage.getCacheBlobURLById(t.resourceId, s)
, r = await createImageTransitionCapture(e, {
width: o.data.width,
height: o.data.height
}, {
x: t.style.x - t.style.width / 2,
y: t.style.y - t.style.height / 2,
width: t.style.width,
height: t.style.height,
rotation: t.style.rotation
});
d = Texture.from(r),
u.current.from = {
cav: r,
fromTexture: d
}
}
if ("video" === r.type) {
let e = null;
if ("export" === a) {
const t =
o.resourceManage.getBlobURLBySourceId(r.resourceId)
, n = document.createElement("video");
n.preload = "auto",
n.crossOrigin = "Anonymous",
n.autoplay = !1,
n.src = t,
n.setAttribute("playsinline", ""),
n.setAttribute("webkit-playsinline", ""),
e = await getVideoFrameAtTime(r.clipTime || 0, n)
} else {
const {target: t} =
o.resourceManage.getCacheBlobURLById(r.resourceId, s);
e = t
}
const t = await createMediaTransitionCapture(e, r.clipTime,
{
width: o.data.width,
height: o.data.height
}, {
x: r.style.x - r.style.width / 2,
y: r.style.y - r.style.height / 2,
width: r.style.width,
height: r.style.height,
rotation: r.style.rotation
});
p = Texture.from(t),
u.current.to = {
cav: t,
fromTexture: d
}
} else {
const e =
o.resourceManage.getCacheBlobURLById(r.resourceId, s)
, n = await createImageTransitionCapture(e, {
width: o.data.width,
height: o.data.height
}, {
x: r.style.x - r.style.width / 2,
y: r.style.y - r.style.height / 2,
width: r.style.width,
height: r.style.height,
rotation: t.style.rotation
});
p = Texture.from(n),
u.current.to = {
cav: n,
fromTexture: d
}
}
const h = new TransitionFilter({
tname: i.transitionName,
width: o.data.width,
height: o.data.height,
from: d,
to: p
});
h.id = t.id;
const f = o.bodyContainer.children.find((e => e.name ===
"trackIndex_" + s));
return f && (f.filters || (f.filters = []),
f.filters.find((e => e.id === h.id)) || f.filters.push(h)),
h
}
)().then((e => {
e.id = t.id,
c.current = e;
const r = o.bodyContainer.children.find((e => e.name ===
"trackIndex_" + s));
r && (r.filters || (r.filters = []),
r.filters.find((t => t.id === e.id)) ||
r.filters.push(c.current)),
"export" === a && (o.elementReadyMark[t.id] = "success")
}
)).catch((e => {
"export" === a && (o.elementReadyMark[t.id] = "success")
}
)),
() => {
var e;
const r = o.bodyContainer.children.find((e => e.name ===
"trackIndex_" + s));
r && (r.filters = (null == (e = r.filters) ? void 0 :
e.filter((e => e.id !== t.id))) || []),
c.current && u.current.to && u.current.from && (u.current = {},
c.current.destroy(),
c.current = void 0)
}
}
), [e.dirty]),
reactExports.useEffect(( () => {
c.current && (c.current.enabled = l)
}
), [l, c.current]),
l) {
const e = Number((n - (t.startTime + t.duration)).toFixed(2));
l && c.current && (c.current.uniforms.progress = (i.duration / 2 +
e) / i.duration)
}
return null
}
var fragment$q = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;void main(){vec4
col=texture2D(uSampler,vTextureCoord.xy);vec3 color=col.rgb;float
luminance=color.r*0.299+color.g*0.587+color.b*0.114;float
mn=min(min(color.r,color.g),color.b);float
mx=max(max(color.r,color.g),color.b);float sat=(1.0-(mx-mn))*(1.0-
mx)*luminance*5.0;vec3
lightness=vec3((mn+mx)/2.0);color=mix(color,mix(color,lightness,-
value),sat);gl_FragColor=vec4(mix(color,lightness,(1.0-lightness)*(1.0-value)/
2.0*abs(value)),col.a);}"
, freeGlobal$2 = "object" == typeof global && global && global.Object ===
Object && global
, freeGlobal$1$1 = freeGlobal$2
, freeSelf$1 = "object" == typeof self && self && self.Object === Object
&& self
, root$2 = freeGlobal$1$1 || freeSelf$1 || Function("return this")()
, root$1$1 = root$2
, Symbol$1$1 = root$1$1.Symbol
, Symbol$2$1 = Symbol$1$1
, objectProto$d$1 = Object.prototype
, hasOwnProperty$a$1 = objectProto$d$1.hasOwnProperty
, nativeObjectToString$1$1 = objectProto$d$1.toString
, symToStringTag$1$1 = Symbol$2$1 ? Symbol$2$1.toStringTag : void 0;
function getRawTag$1(e) {
var t = hasOwnProperty$a$1.call(e, symToStringTag$1$1)
, r = e[symToStringTag$1$1];
try {
e[symToStringTag$1$1] = void 0;
var n = !0
} catch (e2) {}
var i = nativeObjectToString$1$1.call(e);
return n && (t ? e[symToStringTag$1$1] = r : delete
e[symToStringTag$1$1]),
i
}
var objectProto$c$1 = Object.prototype
, nativeObjectToString$2 = objectProto$c$1.toString;
function objectToString$1(e) {
return nativeObjectToString$2.call(e)
}
var nullTag$1 = "[object Null]"
, undefinedTag$1 = "[object Undefined]"
, symToStringTag$2 = Symbol$2$1 ? Symbol$2$1.toStringTag : void 0;
function baseGetTag$7(e) {
return null == e ? void 0 === e ? undefinedTag$1 : nullTag$1 :
symToStringTag$2 && symToStringTag$2 in Object(e) ? getRawTag$1(e) :
objectToString$1(e)
}
function isObjectLike$a(e) {
return null != e && "object" == typeof e
}
var symbolTag$2$1 = "[object Symbol]";
function isSymbol$3(e) {
return "symbol" == typeof e || isObjectLike$a(e) && baseGetTag$7(e) ==
symbolTag$2$1
}
function arrayMap$5(e, t) {
for (var r = -1, n = null == e ? 0 : e.length, i = Array(n); ++r < n; )
i[r] = t(e[r], r, e);
return i
}
var isArray$c = Array.isArray
, isArray$1$1 = isArray$c
, INFINITY$1$1 = 1 / 0
, symbolProto$1$1 = Symbol$2$1 ? Symbol$2$1.prototype : void 0
, symbolToString$1 = symbolProto$1$1 ? symbolProto$1$1.toString : void 0;
function baseToString$2(e) {
if ("string" == typeof e)
return e;
if (isArray$1$1(e))
return arrayMap$5(e, baseToString$2) + "";
if (isSymbol$3(e))
return symbolToString$1 ? symbolToString$1.call(e) : "";
var t = e + "";
return "0" == t && 1 / e == -INFINITY$1$1 ? "-0" : t
}
function isObject$c(e) {
var t = typeof e;
return null != e && ("object" == t || "function" == t)
}
function identity$5(e) {
return e
}
var asyncTag$1 = "[object AsyncFunction]"
, funcTag$2$1 = "[object Function]"
, genTag$1$1 = "[object GeneratorFunction]"
, proxyTag$1 = "[object Proxy]";
function isFunction$5(e) {
if (!isObject$c(e))
return !1;
var t = baseGetTag$7(e);
return t == funcTag$2$1 || t == genTag$1$1 || t == asyncTag$1 || t ==
proxyTag$1
}
var coreJsData$2 = root$1$1["__core-js_shared__"]
, coreJsData$1$1 = coreJsData$2
, maskSrcKey$1 = function() {
var e = /[^.]+$/.exec(coreJsData$1$1 && coreJsData$1$1.keys &&
coreJsData$1$1.keys.IE_PROTO || "");
return e ? "Symbol(src)_1." + e : ""
}();
function isMasked$1(e) {
return !!maskSrcKey$1 && maskSrcKey$1 in e
}
var funcProto$2$1 = Function.prototype
, funcToString$2$1 = funcProto$2$1.toString;
function toSource$1(e) {
if (null != e) {
try {
return funcToString$2$1.call(e)
} catch (e2) {}
try {
return e + ""
} catch (e2) {}
}
return ""
}
var reRegExpChar$1 = /[\\^$.*+?()[\]{}|]/g
, reIsHostCtor$1 = /^\[object .+?Constructor\]$/
, funcProto$1$1 = Function.prototype
, objectProto$b$1 = Object.prototype
, funcToString$1$1 = funcProto$1$1.toString
, hasOwnProperty$9$1 = objectProto$b$1.hasOwnProperty
, reIsNative$1 = RegExp("^" +
funcToString$1$1.call(hasOwnProperty$9$1).replace(reRegExpChar$1, "\\
$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") +
"$");
function baseIsNative$1(e) {
return !(!isObject$c(e) || isMasked$1(e)) && (isFunction$5(e) ?
reIsNative$1 : reIsHostCtor$1).test(toSource$1(e))
}
function getValue$1(e, t) {
return null == e ? void 0 : e[t]
}
function getNative$1(e, t) {
var r = getValue$1(e, t);
return baseIsNative$1(r) ? r : void 0
}
var WeakMap$3 = getNative$1(root$1$1, "WeakMap")
, WeakMap$1$1 = WeakMap$3
, objectCreate$2 = Object.create
, baseCreate$4 = function() {
function e() {}
return function(t) {
if (!isObject$c(t))
return {};
if (objectCreate$2)
return objectCreate$2(t);
e.prototype = t;
var r = new e;
return e.prototype = void 0,
r
}
}()
, baseCreate$1$1 = baseCreate$4;
function apply$3(e, t, r) {
switch (r.length) {
case 0:
return e.call(t);
case 1:
return e.call(t, r[0]);
case 2:
return e.call(t, r[0], r[1]);
case 3:
return e.call(t, r[0], r[1], r[2])
}
return e.apply(t, r)
}
function copyArray$5(e, t) {
var r = -1
, n = e.length;
for (t || (t = Array(n)); ++r < n; )
t[r] = e[r];
return t
}
var HOT_COUNT$2 = 800
, HOT_SPAN$2 = 16
, nativeNow$2 = Date.now;
function shortOut$3(e) {
var t = 0
, r = 0;
return function() {
var n = nativeNow$2()
, i = HOT_SPAN$2 - (n - r);
if (r = n,
i > 0) {
if (++t >= HOT_COUNT$2)
return arguments[0]
} else
t = 0;
return e.apply(void 0, arguments)
}
}
function constant$3(e) {
return function() {
return e
}
}
var defineProperty$4 = function() {
try {
var e = getNative$1(Object, "defineProperty");
return e({}, "", {}),
e
} catch (e2) {}
}()
, defineProperty$1$1 = defineProperty$4
, baseSetToString$4 = defineProperty$1$1 ? function(e, t) {
return defineProperty$1$1(e, "toString", {
configurable: !0,
enumerable: !1,
value: constant$3(t),
writable: !0
})
}
: identity$5
, baseSetToString$1$1 = baseSetToString$4
, setToString$5 = shortOut$3(baseSetToString$1$1)
, setToString$1$1 = setToString$5;
function arrayEach$4(e, t) {
for (var r = -1, n = null == e ? 0 : e.length; ++r < n && !1 !==
t(e[r], r, e); )
;
return e
}
var MAX_SAFE_INTEGER$1$1 = 9007199254740991
, reIsUint$1 = /^(?:0|[1-9]\d*)$/;
function isIndex$3(e, t) {
var r = typeof e;
return !!(t = null == t ? MAX_SAFE_INTEGER$1$1 : t) && ("number" == r
|| "symbol" != r && reIsUint$1.test(e)) && e > -1 && e % 1 == 0 && e < t
}
function baseAssignValue$4(e, t, r) {
"__proto__" == t && defineProperty$1$1 ? defineProperty$1$1(e, t, {
configurable: !0,
enumerable: !0,
value: r,
writable: !0
}) : e[t] = r
}
function eq$4(e, t) {
return e === t || e != e && t != t
}
var objectProto$a$1 = Object.prototype
, hasOwnProperty$8$1 = objectProto$a$1.hasOwnProperty;
function assignValue$6(e, t, r) {
var n = e[t];
hasOwnProperty$8$1.call(e, t) && eq$4(n, r) && (void 0 !== r || t in e)
|| baseAssignValue$4(e, t, r)
}
function copyObject$9(e, t, r, n) {
var i = !r;
r || (r = {});
for (var o = -1, s = t.length; ++o < s; ) {
var a = t[o]
, l = n ? n(r[a], e[a], a, r, e) : void 0;
void 0 === l && (l = e[a]),
i ? baseAssignValue$4(r, a, l) : assignValue$6(r, a, l)
}
return r
}
var nativeMax$5 = Math.max;
function overRest$4(e, t, r) {
return t = nativeMax$5(void 0 === t ? e.length - 1 : t, 0),
function() {
for (var n = arguments, i = -1, o = nativeMax$5(n.length - t, 0), s
= Array(o); ++i < o; )
s[i] = n[t + i];
i = -1;
for (var a = Array(t + 1); ++i < t; )
a[i] = n[i];
return a[t] = r(s),
apply$3(e, this, a)
}
}
var MAX_SAFE_INTEGER$3 = 9007199254740991;
function isLength$1(e) {
return "number" == typeof e && e > -1 && e % 1 == 0 && e <=
MAX_SAFE_INTEGER$3
}
function isArrayLike$9(e) {
return null != e && isLength$1(e.length) && !isFunction$5(e)
}
var objectProto$9$1 = Object.prototype;
function isPrototype$5(e) {
var t = e && e.constructor;
return e === ("function" == typeof t && t.prototype || objectProto$9$1)
}
function baseTimes$2(e, t) {
for (var r = -1, n = Array(e); ++r < e; )
n[r] = t(r);
return n
}
var argsTag$2$1 = "[object Arguments]";
function baseIsArguments$1(e) {
return isObjectLike$a(e) && baseGetTag$7(e) == argsTag$2$1
}
var objectProto$8$1 = Object.prototype
, hasOwnProperty$7$1 = objectProto$8$1.hasOwnProperty
, propertyIsEnumerable$1$1 = objectProto$8$1.propertyIsEnumerable
, isArguments$5 = baseIsArguments$1(function() {
return arguments
}()) ? baseIsArguments$1 : function(e) {
return isObjectLike$a(e) && hasOwnProperty$7$1.call(e, "callee") && !
propertyIsEnumerable$1$1.call(e, "callee")
}
, isArguments$1$1 = isArguments$5;
function stubFalse$1() {
return !1
}
var freeExports$2$1 = "object" == typeof exports && exports && !
exports.nodeType && exports
, freeModule$2$1 = freeExports$2$1 && "object" == typeof module && module
&& !module.nodeType && module
, moduleExports$2$1 = freeModule$2$1 && freeModule$2$1.exports ===
freeExports$2$1
, Buffer$1$1 = moduleExports$2$1 ? root$1$1.Buffer : void 0
, nativeIsBuffer$1 = Buffer$1$1 ? Buffer$1$1.isBuffer : void 0
, isBuffer$5 = nativeIsBuffer$1 || stubFalse$1
, isBuffer$1$1 = isBuffer$5
, argsTag$1$1 = "[object Arguments]"
, arrayTag$1$1 = "[object Array]"
, boolTag$2$1 = "[object Boolean]"
, dateTag$2$1 = "[object Date]"
, errorTag$1$1 = "[object Error]"
, funcTag$1$1 = "[object Function]"
, mapTag$4$1 = "[object Map]"
, numberTag$2$1 = "[object Number]"
, objectTag$3$1 = "[object Object]"
, regexpTag$2$1 = "[object RegExp]"
, setTag$4$1 = "[object Set]"
, stringTag$2$1 = "[object String]"
, weakMapTag$2$1 = "[object WeakMap]"
, arrayBufferTag$2$1 = "[object ArrayBuffer]"
, dataViewTag$3$1 = "[object DataView]"
, float32Tag$2$1 = "[object Float32Array]"
, float64Tag$2$1 = "[object Float64Array]"
, int8Tag$2$1 = "[object Int8Array]"
, int16Tag$2$1 = "[object Int16Array]"
, int32Tag$2$1 = "[object Int32Array]"
, uint8Tag$2$1 = "[object Uint8Array]"
, uint8ClampedTag$2$1 = "[object Uint8ClampedArray]"
, uint16Tag$2$1 = "[object Uint16Array]"
, uint32Tag$2$1 = "[object Uint32Array]"
, typedArrayTags$1 = {};
function baseIsTypedArray$1(e) {
return isObjectLike$a(e) && isLength$1(e.length) && !!
typedArrayTags$1[baseGetTag$7(e)]
}
function baseUnary$6(e) {
return function(t) {
return e(t)
}
}
typedArrayTags$1[float32Tag$2$1] = typedArrayTags$1[float64Tag$2$1] =
typedArrayTags$1[int8Tag$2$1] = typedArrayTags$1[int16Tag$2$1] =
typedArrayTags$1[int32Tag$2$1] = typedArrayTags$1[uint8Tag$2$1] =
typedArrayTags$1[uint8ClampedTag$2$1] = typedArrayTags$1[uint16Tag$2$1] =
typedArrayTags$1[uint32Tag$2$1] = !0,
typedArrayTags$1[argsTag$1$1] = typedArrayTags$1[arrayTag$1$1] =
typedArrayTags$1[arrayBufferTag$2$1] = typedArrayTags$1[boolTag$2$1] =
typedArrayTags$1[dataViewTag$3$1] = typedArrayTags$1[dateTag$2$1] =
typedArrayTags$1[errorTag$1$1] = typedArrayTags$1[funcTag$1$1] =
typedArrayTags$1[mapTag$4$1] = typedArrayTags$1[numberTag$2$1] =
typedArrayTags$1[objectTag$3$1] = typedArrayTags$1[regexpTag$2$1] =
typedArrayTags$1[setTag$4$1] = typedArrayTags$1[stringTag$2$1] =
typedArrayTags$1[weakMapTag$2$1] = !1;
var freeExports$1$1 = "object" == typeof exports && exports && !
exports.nodeType && exports
, freeModule$1$1 = freeExports$1$1 && "object" == typeof module && module
&& !module.nodeType && module
, moduleExports$1$1 = freeModule$1$1 && freeModule$1$1.exports ===
freeExports$1$1
, freeProcess$1 = moduleExports$1$1 && freeGlobal$1$1.process
, nodeUtil$6 = function() {
try {
var e = freeModule$1$1 && freeModule$1$1.require &&
freeModule$1$1.require("util").types;
return e || freeProcess$1 && freeProcess$1.binding &&
freeProcess$1.binding("util")
} catch (e2) {}
}()
, nodeUtil$1$1 = nodeUtil$6
, nodeIsTypedArray$1 = nodeUtil$1$1 && nodeUtil$1$1.isTypedArray
, isTypedArray$4 = nodeIsTypedArray$1 ? baseUnary$6(nodeIsTypedArray$1) :
baseIsTypedArray$1
, isTypedArray$1$1 = isTypedArray$4
, objectProto$7$1 = Object.prototype
, hasOwnProperty$6$1 = objectProto$7$1.hasOwnProperty;
function arrayLikeKeys$2(e, t) {
var r = isArray$1$1(e)
, n = !r && isArguments$1$1(e)
, i = !r && !n && isBuffer$1$1(e)
, o = !r && !n && !i && isTypedArray$1$1(e)
, s = r || n || i || o
, a = s ? baseTimes$2(e.length, String) : []
, l = a.length;
for (var c in e)
!t && !hasOwnProperty$6$1.call(e, c) || s && ("length" == c || i &&
("offset" == c || "parent" == c) || o && ("buffer" == c || "byteLength" == c ||
"byteOffset" == c) || isIndex$3(c, l)) || a.push(c);
return a
}
function overArg$2(e, t) {
return function(r) {
return e(t(r))
}
}
var nativeKeys$2 = overArg$2(Object.keys, Object)
, nativeKeys$1$1 = nativeKeys$2
, objectProto$6$1 = Object.prototype
, hasOwnProperty$5$1 = objectProto$6$1.hasOwnProperty;
function baseKeys$2(e) {
if (!isPrototype$5(e))
return nativeKeys$1$1(e);
var t = [];
for (var r in Object(e))
hasOwnProperty$5$1.call(e, r) && "constructor" != r && t.push(r);
return t
}
function keys$5(e) {
return isArrayLike$9(e) ? arrayLikeKeys$2(e) : baseKeys$2(e)
}
function nativeKeysIn$3(e) {
var t = [];
if (null != e)
for (var r in Object(e))
t.push(r);
return t
}
var objectProto$5$1 = Object.prototype
, hasOwnProperty$4$1 = objectProto$5$1.hasOwnProperty;
function baseKeysIn$3(e) {
if (!isObject$c(e))
return nativeKeysIn$3(e);
var t = isPrototype$5(e)
, r = [];
for (var n in e)
("constructor" != n || !t && hasOwnProperty$4$1.call(e, n)) &&
r.push(n);
return r
}
function keysIn$7(e) {
return isArrayLike$9(e) ? arrayLikeKeys$2(e, !0) : baseKeysIn$3(e)
}
var reIsDeepProp$1 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/
, reIsPlainProp$1 = /^\w*$/;
function isKey$1(e, t) {
if (isArray$1$1(e))
return !1;
var r = typeof e;
return !("number" != r && "symbol" != r && "boolean" != r && null != e
&& !isSymbol$3(e)) || (reIsPlainProp$1.test(e) || !reIsDeepProp$1.test(e) || null !
= t && e in Object(t))
}
var nativeCreate$2 = getNative$1(Object, "create")
, nativeCreate$1$1 = nativeCreate$2;
function hashClear$1() {
this.__data__ = nativeCreate$1$1 ? nativeCreate$1$1(null) : {},
this.size = 0
}
function hashDelete$1(e) {
var t = this.has(e) && delete this.__data__[e];
return this.size -= t ? 1 : 0,
t
}
var HASH_UNDEFINED$1$1 = "__lodash_hash_undefined__"
, objectProto$4$1 = Object.prototype
, hasOwnProperty$3$1 = objectProto$4$1.hasOwnProperty;
function hashGet$1(e) {
var t = this.__data__;
if (nativeCreate$1$1) {
var r = t[e];
return r === HASH_UNDEFINED$1$1 ? void 0 : r
}
return hasOwnProperty$3$1.call(t, e) ? t[e] : void 0
}
var objectProto$3$1 = Object.prototype
, hasOwnProperty$2$1 = objectProto$3$1.hasOwnProperty;
function hashHas$1(e) {
var t = this.__data__;
return nativeCreate$1$1 ? void 0 !== t[e] : hasOwnProperty$2$1.call(t,
e)
}
var HASH_UNDEFINED$3 = "__lodash_hash_undefined__";
function hashSet$1(e, t) {
var r = this.__data__;
return this.size += this.has(e) ? 0 : 1,
r[e] = nativeCreate$1$1 && void 0 === t ? HASH_UNDEFINED$3 : t,
this
}
function Hash$1(e) {
var t = -1
, r = null == e ? 0 : e.length;
for (this.clear(); ++t < r; ) {
var n = e[t];
this.set(n[0], n[1])
}
}
function listCacheClear$1() {
this.__data__ = [],
this.size = 0
}
function assocIndexOf$1(e, t) {
for (var r = e.length; r--; )
if (eq$4(e[r][0], t))
return r;
return -1
}
Hash$1.prototype.clear = hashClear$1,
Hash$1.prototype.delete = hashDelete$1,
Hash$1.prototype.get = hashGet$1,
Hash$1.prototype.has = hashHas$1,
Hash$1.prototype.set = hashSet$1;
var arrayProto$1 = Array.prototype
, splice$1 = arrayProto$1.splice;
function listCacheDelete$1(e) {
var t = this.__data__
, r = assocIndexOf$1(t, e);
return !(r < 0) && (r == t.length - 1 ? t.pop() : splice$1.call(t, r,
1),
--this.size,
!0)
}
function listCacheGet$1(e) {
var t = this.__data__
, r = assocIndexOf$1(t, e);
return r < 0 ? void 0 : t[r][1]
}
function listCacheHas$1(e) {
return assocIndexOf$1(this.__data__, e) > -1
}
function listCacheSet$1(e, t) {
var r = this.__data__
, n = assocIndexOf$1(r, e);
return n < 0 ? (++this.size,
r.push([e, t])) : r[n][1] = t,
this
}
function ListCache$1(e) {
var t = -1
, r = null == e ? 0 : e.length;
for (this.clear(); ++t < r; ) {
var n = e[t];
this.set(n[0], n[1])
}
}
ListCache$1.prototype.clear = listCacheClear$1,
ListCache$1.prototype.delete = listCacheDelete$1,
ListCache$1.prototype.get = listCacheGet$1,
ListCache$1.prototype.has = listCacheHas$1,
ListCache$1.prototype.set = listCacheSet$1;
var Map$3 = getNative$1(root$1$1, "Map")
, Map$1$1 = Map$3;
function mapCacheClear$1() {
this.size = 0,
this.__data__ = {
hash: new Hash$1,
map: new (Map$1$1 || ListCache$1),
string: new Hash$1
}
}
function isKeyable$1(e) {
var t = typeof e;
return "string" == t || "number" == t || "symbol" == t || "boolean" ==
t ? "__proto__" !== e : null === e
}
function getMapData$1(e, t) {
var r = e.__data__;
return isKeyable$1(t) ? r["string" == typeof t ? "string" : "hash"] :
r.map
}
function mapCacheDelete$1(e) {
var t = getMapData$1(this, e).delete(e);
return this.size -= t ? 1 : 0,
t
}
function mapCacheGet$1(e) {
return getMapData$1(this, e).get(e)
}
function mapCacheHas$1(e) {
return getMapData$1(this, e).has(e)
}
function mapCacheSet$1(e, t) {
var r = getMapData$1(this, e)
, n = r.size;
return r.set(e, t),
this.size += r.size == n ? 0 : 1,
this
}
function MapCache$1(e) {
var t = -1
, r = null == e ? 0 : e.length;
for (this.clear(); ++t < r; ) {
var n = e[t];
this.set(n[0], n[1])
}
}
MapCache$1.prototype.clear = mapCacheClear$1,
MapCache$1.prototype.delete = mapCacheDelete$1,
MapCache$1.prototype.get = mapCacheGet$1,
MapCache$1.prototype.has = mapCacheHas$1,
MapCache$1.prototype.set = mapCacheSet$1;
var FUNC_ERROR_TEXT$4 = "Expected a function";
function memoize$1(e, t) {
if ("function" != typeof e || null != t && "function" != typeof t)
throw new TypeError(FUNC_ERROR_TEXT$4);
var r = function() {
var n = arguments
, i = t ? t.apply(this, n) : n[0]
, o = r.cache;
if (o.has(i))
return o.get(i);
var s = e.apply(this, n);
return r.cache = o.set(i, s) || o,
s
};
return r.cache = new (memoize$1.Cache || MapCache$1),
r
}
memoize$1.Cache = MapCache$1;
var MAX_MEMOIZE_SIZE$1 = 500;
function memoizeCapped$1(e) {
var t = memoize$1(e, (function(e) {
return r.size === MAX_MEMOIZE_SIZE$1 && r.clear(),
e
}
))
, r = t.cache;
return t
}
var rePropName$1 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)
[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g
, reEscapeChar$1 = /\\(\\)?/g
, stringToPath$3 = memoizeCapped$1((function(e) {
var t = [];
return 46 === e.charCodeAt(0) && t.push(""),
e.replace(rePropName$1, (function(e, r, n, i) {
t.push(n ? i.replace(reEscapeChar$1, "$1") : r || e)
}
)),
t
}
))
, stringToPath$1$1 = stringToPath$3;
function toString$3(e) {
return null == e ? "" : baseToString$2(e)
}
function castPath$4(e, t) {
return isArray$1$1(e) ? e : isKey$1(e, t) ? [e] :
stringToPath$1$1(toString$3(e))
}
var INFINITY$4 = 1 / 0;
function toKey$3(e) {
if ("string" == typeof e || isSymbol$3(e))
return e;
var t = e + "";
return "0" == t && 1 / e == -INFINITY$4 ? "-0" : t
}
function baseGet$2(e, t) {
for (var r = 0, n = (t = castPath$4(t, e)).length; null != e && r <
n; )
e = e[toKey$3(t[r++])];
return r && r == n ? e : void 0
}
function arrayPush$3(e, t) {
for (var r = -1, n = t.length, i = e.length; ++r < n; )
e[i + r] = t[r];
return e
}
var spreadableSymbol$1 = Symbol$2$1 ? Symbol$2$1.isConcatSpreadable : void
0;
function isFlattenable$2(e) {
return isArray$1$1(e) || isArguments$1$1(e) || !!(spreadableSymbol$1 &&
e && e[spreadableSymbol$1])
}
function baseFlatten$3(e, t, r, n, i) {
var o = -1
, s = e.length;
for (r || (r = isFlattenable$2),
i || (i = []); ++o < s; ) {
var a = e[o];
t > 0 && r(a) ? t > 1 ? baseFlatten$3(a, t - 1, r, n, i) :
arrayPush$3(i, a) : n || (i[i.length] = a)
}
return i
}
function flatten$3(e) {
return (null == e ? 0 : e.length) ? baseFlatten$3(e, 1) : []
}
function flatRest$3(e) {
return setToString$1$1(overRest$4(e, void 0, flatten$3), e + "")
}
var getPrototype$6 = overArg$2(Object.getPrototypeOf, Object)
, getPrototype$1$1 = getPrototype$6
, objectTag$2$1 = "[object Object]"
, funcProto$4 = Function.prototype
, objectProto$2$1 = Object.prototype
, funcToString$4 = funcProto$4.toString
, hasOwnProperty$1$1 = objectProto$2$1.hasOwnProperty
, objectCtorString$2 = funcToString$4.call(Object);
function isPlainObject$5(e) {
if (!isObjectLike$a(e) || baseGetTag$7(e) != objectTag$2$1)
return !1;
var t = getPrototype$1$1(e);
if (null === t)
return !0;
var r = hasOwnProperty$1$1.call(t, "constructor") && t.constructor;
return "function" == typeof r && r instanceof r &&
funcToString$4.call(r) == objectCtorString$2
}
function baseSlice$2(e, t, r) {
var n = -1
, i = e.length;
t < 0 && (t = -t > i ? 0 : i + t),
(r = r > i ? i : r) < 0 && (r += i),
i = t > r ? 0 : r - t >>> 0,
t >>>= 0;
for (var o = Array(i); ++n < i; )
o[n] = e[n + t];
return o
}
function stackClear$1() {
this.__data__ = new ListCache$1,
this.size = 0
}
function stackDelete$1(e) {
var t = this.__data__
, r = t.delete(e);
return this.size = t.size,
r
}
function stackGet$1(e) {
return this.__data__.get(e)
}
function stackHas$1(e) {
return this.__data__.has(e)
}
var LARGE_ARRAY_SIZE$3 = 200;
function stackSet$1(e, t) {
var r = this.__data__;
if (r instanceof ListCache$1) {
var n = r.__data__;
if (!Map$1$1 || n.length < LARGE_ARRAY_SIZE$3 - 1)
return n.push([e, t]),
this.size = ++r.size,
this;
r = this.__data__ = new MapCache$1(n)
}
return r.set(e, t),
this.size = r.size,
this
}
function Stack$3(e) {
var t = this.__data__ = new ListCache$1(e);
this.size = t.size
}
function baseAssign$2(e, t) {
return e && copyObject$9(t, keys$5(t), e)
}
function baseAssignIn$2(e, t) {
return e && copyObject$9(t, keysIn$7(t), e)
}
Stack$3.prototype.clear = stackClear$1,
Stack$3.prototype.delete = stackDelete$1,
Stack$3.prototype.get = stackGet$1,
Stack$3.prototype.has = stackHas$1,
Stack$3.prototype.set = stackSet$1;
var freeExports$3 = "object" == typeof exports && exports && !
exports.nodeType && exports
, freeModule$3 = freeExports$3 && "object" == typeof module && module
&& !module.nodeType && module
, moduleExports$3 = freeModule$3 && freeModule$3.exports ===
freeExports$3
, Buffer$2 = moduleExports$3 ? root$1$1.Buffer : void 0
, allocUnsafe$1 = Buffer$2 ? Buffer$2.allocUnsafe : void 0;
function cloneBuffer$3(e, t) {
if (t)
return e.slice();
var r = e.length
, n = allocUnsafe$1 ? allocUnsafe$1(r) : new e.constructor(r);
return e.copy(n),
n
}
function arrayFilter$1(e, t) {
for (var r = -1, n = null == e ? 0 : e.length, i = 0, o = []; ++r <
n; ) {
var s = e[r];
t(s, r, e) && (o[i++] = s)
}
return o
}
function stubArray$2() {
return []
}
var objectProto$1$1 = Object.prototype
, propertyIsEnumerable$3 = objectProto$1$1.propertyIsEnumerable
, nativeGetSymbols$1$1 = Object.getOwnPropertySymbols
, getSymbols$4 = nativeGetSymbols$1$1 ? function(e) {
return null == e ? [] : (e = Object(e),
arrayFilter$1(nativeGetSymbols$1$1(e), (function(t) {
return propertyIsEnumerable$3.call(e, t)
}
)))
}
: stubArray$2
, getSymbols$1$1 = getSymbols$4;
function copySymbols$2(e, t) {
return copyObject$9(e, getSymbols$1$1(e), t)
}
var nativeGetSymbols$2 = Object.getOwnPropertySymbols
, getSymbolsIn$3 = nativeGetSymbols$2 ? function(e) {
for (var t = []; e; )
arrayPush$3(t, getSymbols$1$1(e)),
e = getPrototype$1$1(e);
return t
}
: stubArray$2
, getSymbolsIn$1$1 = getSymbolsIn$3;
function copySymbolsIn$2(e, t) {
return copyObject$9(e, getSymbolsIn$1$1(e), t)
}
function baseGetAllKeys$2(e, t, r) {
var n = t(e);
return isArray$1$1(e) ? n : arrayPush$3(n, r(e))
}
function getAllKeys$2(e) {
return baseGetAllKeys$2(e, keys$5, getSymbols$1$1)
}
function getAllKeysIn$3(e) {
return baseGetAllKeys$2(e, keysIn$7, getSymbolsIn$1$1)
}
var DataView$3 = getNative$1(root$1$1, "DataView")
, DataView$1$1 = DataView$3
, Promise$1$1 = getNative$1(root$1$1, "Promise")
, Promise$2$1 = Promise$1$1
, Set$4 = getNative$1(root$1$1, "Set")
, Set$1$1 = Set$4
, mapTag$3$1 = "[object Map]"
, objectTag$1$1 = "[object Object]"
, promiseTag$1 = "[object Promise]"
, setTag$3$1 = "[object Set]"
, weakMapTag$1$1 = "[object WeakMap]"
, dataViewTag$2$1 = "[object DataView]"
, dataViewCtorString$1 = toSource$1(DataView$1$1)
, mapCtorString$1 = toSource$1(Map$1$1)
, promiseCtorString$1 = toSource$1(Promise$2$1)
, setCtorString$1 = toSource$1(Set$1$1)
, weakMapCtorString$1 = toSource$1(WeakMap$1$1)
, getTag$7 = baseGetTag$7;
(DataView$1$1 && getTag$7(new DataView$1$1(new ArrayBuffer(1))) !=
dataViewTag$2$1 || Map$1$1 && getTag$7(new Map$1$1) != mapTag$3$1 || Promise$2$1 &&
getTag$7(Promise$2$1.resolve()) != promiseTag$1 || Set$1$1 && getTag$7(new Set$1$1)
!= setTag$3$1 || WeakMap$1$1 && getTag$7(new WeakMap$1$1) != weakMapTag$1$1) &&
(getTag$7 = function(e) {
var t = baseGetTag$7(e)
, r = t == objectTag$1$1 ? e.constructor : void 0
, n = r ? toSource$1(r) : "";
if (n)
switch (n) {
case dataViewCtorString$1:
return dataViewTag$2$1;
case mapCtorString$1:
return mapTag$3$1;
case promiseCtorString$1:
return promiseTag$1;
case setCtorString$1:
return setTag$3$1;
case weakMapCtorString$1:
return weakMapTag$1$1
}
return t
}
);
var getTag$1$1 = getTag$7
, objectProto$l = Object.prototype
, hasOwnProperty$l = objectProto$l.hasOwnProperty;
function initCloneArray$2(e) {
var t = e.length
, r = new e.constructor(t);
return t && "string" == typeof e[0] && hasOwnProperty$l.call(e,
"index") && (r.index = e.index,
r.input = e.input),
r
}
var Uint8Array$1$1 = root$1$1.Uint8Array
, Uint8Array$2$1 = Uint8Array$1$1;
function cloneArrayBuffer$5(e) {
var t = new e.constructor(e.byteLength);
return new Uint8Array$2$1(t).set(new Uint8Array$2$1(e)),
t
}
function cloneDataView$2(e, t) {
var r = t ? cloneArrayBuffer$5(e.buffer) : e.buffer;
return new e.constructor(r,e.byteOffset,e.byteLength)
}
var reFlags$1 = /\w*$/;
function cloneRegExp$2(e) {
var t = new e.constructor(e.source,reFlags$1.exec(e));
return t.lastIndex = e.lastIndex,
t
}
var symbolProto$3 = Symbol$2$1 ? Symbol$2$1.prototype : void 0
, symbolValueOf$2 = symbolProto$3 ? symbolProto$3.valueOf : void 0;
function cloneSymbol$2(e) {
return symbolValueOf$2 ? Object(symbolValueOf$2.call(e)) : {}
}
function cloneTypedArray$4(e, t) {
var r = t ? cloneArrayBuffer$5(e.buffer) : e.buffer;
return new e.constructor(r,e.byteOffset,e.length)
}
var boolTag$1$1 = "[object Boolean]"
, dateTag$1$1 = "[object Date]"
, mapTag$2$1 = "[object Map]"
, numberTag$1$1 = "[object Number]"
, regexpTag$1$1 = "[object RegExp]"
, setTag$2$1 = "[object Set]"
, stringTag$1$1 = "[object String]"
, symbolTag$1$1 = "[object Symbol]"
, arrayBufferTag$1$1 = "[object ArrayBuffer]"
, dataViewTag$1$1 = "[object DataView]"
, float32Tag$1$1 = "[object Float32Array]"
, float64Tag$1$1 = "[object Float64Array]"
, int8Tag$1$1 = "[object Int8Array]"
, int16Tag$1$1 = "[object Int16Array]"
, int32Tag$1$1 = "[object Int32Array]"
, uint8Tag$1$1 = "[object Uint8Array]"
, uint8ClampedTag$1$1 = "[object Uint8ClampedArray]"
, uint16Tag$1$1 = "[object Uint16Array]"
, uint32Tag$1$1 = "[object Uint32Array]";
function initCloneByTag$2(e, t, r) {
var n = e.constructor;
switch (t) {
case arrayBufferTag$1$1:
return cloneArrayBuffer$5(e);
case boolTag$1$1:
case dateTag$1$1:
return new n(+e);
case dataViewTag$1$1:
return cloneDataView$2(e, r);
case float32Tag$1$1:
case float64Tag$1$1:
case int8Tag$1$1:
case int16Tag$1$1:
case int32Tag$1$1:
case uint8Tag$1$1:
case uint8ClampedTag$1$1:
case uint16Tag$1$1:
case uint32Tag$1$1:
return cloneTypedArray$4(e, r);
case mapTag$2$1:
return new n;
case numberTag$1$1:
case stringTag$1$1:
return new n(e);
case regexpTag$1$1:
return cloneRegExp$2(e);
case setTag$2$1:
return new n;
case symbolTag$1$1:
return cloneSymbol$2(e)
}
}
function initCloneObject$4(e) {
return "function" != typeof e.constructor || isPrototype$5(e) ? {} :
baseCreate$1$1(getPrototype$1$1(e))
}
var mapTag$1$1 = "[object Map]";
function baseIsMap$2(e) {
return isObjectLike$a(e) && getTag$1$1(e) == mapTag$1$1
}
var nodeIsMap$1 = nodeUtil$1$1 && nodeUtil$1$1.isMap
, isMap$2 = nodeIsMap$1 ? baseUnary$6(nodeIsMap$1) : baseIsMap$2
, isMap$1$1 = isMap$2
, setTag$1$1 = "[object Set]";
function baseIsSet$2(e) {
return isObjectLike$a(e) && getTag$1$1(e) == setTag$1$1
}
var nodeIsSet$1 = nodeUtil$1$1 && nodeUtil$1$1.isSet
, isSet$2 = nodeIsSet$1 ? baseUnary$6(nodeIsSet$1) : baseIsSet$2
, isSet$1$1 = isSet$2
, CLONE_DEEP_FLAG$1$1 = 1
, CLONE_FLAT_FLAG$1$1 = 2
, CLONE_SYMBOLS_FLAG$1$1 = 4
, argsTag$4 = "[object Arguments]"
, arrayTag$3 = "[object Array]"
, boolTag$5 = "[object Boolean]"
, dateTag$5 = "[object Date]"
, errorTag$3 = "[object Error]"
, funcTag$3 = "[object Function]"
, genTag$2 = "[object GeneratorFunction]"
, mapTag$7 = "[object Map]"
, numberTag$5 = "[object Number]"
, objectTag$6 = "[object Object]"
, regexpTag$5 = "[object RegExp]"
, setTag$7 = "[object Set]"
, stringTag$5 = "[object String]"
, symbolTag$4 = "[object Symbol]"
, weakMapTag$3 = "[object WeakMap]"
, arrayBufferTag$4 = "[object ArrayBuffer]"
, dataViewTag$5 = "[object DataView]"
, float32Tag$3 = "[object Float32Array]"
, float64Tag$3 = "[object Float64Array]"
, int8Tag$3 = "[object Int8Array]"
, int16Tag$3 = "[object Int16Array]"
, int32Tag$3 = "[object Int32Array]"
, uint8Tag$3 = "[object Uint8Array]"
, uint8ClampedTag$3 = "[object Uint8ClampedArray]"
, uint16Tag$3 = "[object Uint16Array]"
, uint32Tag$3 = "[object Uint32Array]"
, cloneableTags$1 = {};
function baseClone$4(e, t, r, n, i, o) {
var s, a = t & CLONE_DEEP_FLAG$1$1, l = t & CLONE_FLAT_FLAG$1$1, c = t
& CLONE_SYMBOLS_FLAG$1$1;
if (r && (s = i ? r(e, n, i, o) : r(e)),
void 0 !== s)
return s;
if (!isObject$c(e))
return e;
var u = isArray$1$1(e);
if (u) {
if (s = initCloneArray$2(e),
!a)
return copyArray$5(e, s)
} else {
var d = getTag$1$1(e)
, p = d == funcTag$3 || d == genTag$2;
if (isBuffer$1$1(e))
return cloneBuffer$3(e, a);
if (d == objectTag$6 || d == argsTag$4 || p && !i) {
if (s = l || p ? {} : initCloneObject$4(e),
!a)
return l ? copySymbolsIn$2(e, baseAssignIn$2(s, e)) :
copySymbols$2(e, baseAssign$2(s, e))
} else {
if (!cloneableTags$1[d])
return i ? e : {};
s = initCloneByTag$2(e, d, a)
}
}
o || (o = new Stack$3);
var h = o.get(e);
if (h)
return h;
o.set(e, s),
isSet$1$1(e) ? e.forEach((function(n) {
s.add(baseClone$4(n, t, r, n, e, o))
}
)) : isMap$1$1(e) && e.forEach((function(n, i) {
s.set(i, baseClone$4(n, t, r, i, e, o))
}
));
var f = u ? void 0 : (c ? l ? getAllKeysIn$3 : getAllKeys$2 : l ?
keysIn$7 : keys$5)(e);
return arrayEach$4(f || e, (function(n, i) {
f && (n = e[i = n]),
assignValue$6(s, i, baseClone$4(n, t, r, i, e, o))
}
)),
s
}
function last$1(e) {
var t = null == e ? 0 : e.length;
return t ? e[t - 1] : void 0
}
function parent(e, t) {
return t.length < 2 ? e : baseGet$2(e, baseSlice$2(t, 0, -1))
}
function baseUnset$2(e, t) {
return null == (e = parent(e, t = castPath$4(t, e))) || delete
e[toKey$3(last$1(t))]
}
function customOmitClone$2(e) {
return isPlainObject$5(e) ? void 0 : e
}
cloneableTags$1[argsTag$4] = cloneableTags$1[arrayTag$3] =
cloneableTags$1[arrayBufferTag$4] = cloneableTags$1[dataViewTag$5] =
cloneableTags$1[boolTag$5] = cloneableTags$1[dateTag$5] =
cloneableTags$1[float32Tag$3] = cloneableTags$1[float64Tag$3] =
cloneableTags$1[int8Tag$3] = cloneableTags$1[int16Tag$3] =
cloneableTags$1[int32Tag$3] = cloneableTags$1[mapTag$7] =
cloneableTags$1[numberTag$5] = cloneableTags$1[objectTag$6] =
cloneableTags$1[regexpTag$5] = cloneableTags$1[setTag$7] =
cloneableTags$1[stringTag$5] = cloneableTags$1[symbolTag$4] =
cloneableTags$1[uint8Tag$3] = cloneableTags$1[uint8ClampedTag$3] =
cloneableTags$1[uint16Tag$3] = cloneableTags$1[uint32Tag$3] = !0,
cloneableTags$1[errorTag$3] = cloneableTags$1[funcTag$3] =
cloneableTags$1[weakMapTag$3] = !1;
var CLONE_DEEP_FLAG$4 = 1
, CLONE_FLAT_FLAG$2 = 2
, CLONE_SYMBOLS_FLAG$4 = 4
, omit$1 = flatRest$3((function(e, t) {
var r = {};
if (null == e)
return r;
var n = !1;
t = arrayMap$5(t, (function(t) {
return t = castPath$4(t, e),
n || (n = t.length > 1),
t
}
)),
copyObject$9(e, getAllKeysIn$3(e), r),
n && (r = baseClone$4(r, CLONE_DEEP_FLAG$4 | CLONE_FLAT_FLAG$2 |
CLONE_SYMBOLS_FLAG$4, customOmitClone$2));
for (var i = t.length; i--; )
baseUnset$2(r, t[i]);
return r
}
))
, omit$1$1 = omit$1;
class ColorEffectsFilter extends Filter$2 {
constructor(...e) {
super(...e)
}
_getEffectArgs() {
return Object.assign({}, omit$1$1(this.uniforms, ["uSampler",
"globals", "filterGlobals", "px", "size", "paletteMap", "width", "height", "timer",
"m"]))
}
getEffectConfig() {
return {
name: this.effectName,
type: this.effectType,
args: this._getEffectArgs()
}
}
}
class Vibrance extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$q),
this.effectName = "vibrance",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e
}
}
let Saturation$1 = class extends ColorEffectsFilter {
constructor(e=0) {
super(null, null),
this.effectName = "saturation",
this.effectType = "filter",
this._colorMatrixFilter = new ColorMatrixFilter,
this.value = e
}
apply(e, t, r, n, i) {
this._colorMatrixFilter.apply(e, t, r, n)
}
get value() {
return this.uniforms.value
}
set value(e) {
let t = 2 * Number(e) / 3 + 1
, r = -.5 * (t - 1);
this._colorMatrixFilter.matrix = [t, r, r, 0, 0, r, t, r, 0, 0, r,
r, t, 0, 0, 0, 0, 0, 1, 0],
this.uniforms.value = e
}
}
;
var fragment$p = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;void main(){vec4
color=texture2D(uSampler,vTextureCoord);color.r=clamp(color.r+value,0.0,1.0);color.
b=clamp(color.b-value,0.0,1.0);gl_FragColor=color;}";
class Temperature extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$p),
this.effectName = "temperature",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e / 6
}
}
var fragment$o = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;void main(){vec4
color=texture2D(uSampler,vTextureCoord);color.g=clamp(color.g+value,0.0,1.0);gl_Fra
gColor=color;}";
class Tint extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$o),
this.effectName = "tint",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e / 6
}
}
let Hue$1 = class extends ColorEffectsFilter {
constructor(e=0) {
super(null, null),
this.effectName = "hue",
this.effectType = "filter",
this._colorMatrixFilter = new ColorMatrixFilter,
this.value = e
}
apply(e, t, r, n, i) {
this._colorMatrixFilter.apply(e, t, r, n)
}
get value() {
return this.uniforms.value
}
set value(e) {
this._colorMatrixFilter.reset(),
this._colorMatrixFilter.hue(180 * e, !0),
this.uniforms.value = e
}
}
;
class Brightness extends ColorEffectsFilter {
constructor(e=0) {
super(null, null),
this.effectName = "brightness",
this.effectType = "filter",
this._colorMatrixFilter = new ColorMatrixFilter,
this.value = e
}
apply(e, t, r, n, i) {
this._colorMatrixFilter.apply(e, t, r, n)
}
get value() {
return this.uniforms.value
}
set value(e) {
this._colorMatrixFilter.brightness(e + 1, !1),
this.uniforms.value = e
}
}
var fragment$n = "#define GLSLIFY 1\nprecision highp float;varying vec2
vTextureCoord;uniform sampler2D uSampler;uniform float value;const float
epsilon=0.000001;const float mx=1.0-epsilon;const mat3
matRGBtoROMM=mat3(0.5293459296226501,0.3300727903842926,0.14058130979537964,0.09837
432950735092,0.8734610080718994,0.028164653107523918,0.01688321679830551,0.11767247
319221497,0.8654443025588989);const mat3 matROMMtoRGB=mat3(2.0340757369995117,-
0.727334201335907,-0.3067416846752167,-0.22881317138671875,1.2317301034927368,-
0.0029169507324695587,-0.008569774217903614,-
0.1532866358757019,1.1618564128875732);float ramp(in float t){t*=2.0;if(t>=1.0){t-
=1.0;t=log(0.5)/log(0.5*(1.0-t)+0.9332*t);}return clamp(t,0.001,10.0);}vec3
rgb2hsv(in vec3 c){vec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4
p=mix(vec4(c.bg,K.wz),vec4(c.gb,K.xy),step(c.b,c.g));vec4
q=mix(vec4(p.xyw,c.r),vec4(c.r,p.yzx),step(p.x,c.r));float d=q.x-min(q.w,q.y);float
e=1.0e-10;return vec3(abs(q.z+(q.w-q.y)/(6.0*d+e)),d/(q.x+e),q.x);}vec3 hsv2rgb(in
vec3 c){vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(c.xxx+K.xyz)*6.0-
K.www);return c.z*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),c.y);}vec3 setHue(in vec3 res,in
vec3 base){vec3 hsv=rgb2hsv(base);vec3 res_hsv=rgb2hsv(res);return
hsv2rgb(vec3(hsv.x,res_hsv.y,res_hsv.z));}void main(){lowp vec4
col=texture2D(uSampler,vTextureCoord.xy);vec3 base=col.rgb*matRGBtoROMM;float
a=abs(value)*col.a+epsilon;float v=pow(2.0,a*2.0+1.0)-2.0;float m=mx-exp(-v);vec3
res=(value>0.0)?(1.0-exp(-v*base))/m : log(1.0-base*m)/-
v;res=mix(base,res,min(a*100.0,1.0));res=setHue(res,base);res=pow(res,vec3(ramp(1.0
-(0.0*col.a+1.0)/2.0)));res=res*matROMMtoRGB;gl_FragColor=vec4(res,col.a);}";
class Exposure extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$n),
this.effectName = "exposure",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e
}
}
class Contrast extends ColorEffectsFilter {
constructor(e=0) {
super(null, null),
this.effectName = "contrast",
this.effectType = "filter",
this._colorMatrixFilter = new ColorMatrixFilter,
this.value = e
}
apply(e, t, r, n, i) {
this._colorMatrixFilter.apply(e, t, r, n)
}
get value() {
return this.uniforms.value
}
set value(e) {
this._colorMatrixFilter.contrast(e, !1),
this.uniforms.value = e
}
}
var fragment$m = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;void main(){float bval=value/255.0;float
wval=(255.0/(255.0-value));vec3
color=texture2D(uSampler,vTextureCoord).rgb;color=color*wval-
(bval*wval);gl_FragColor=vec4(color,texture2D(uSampler,vTextureCoord).a);}";
class Black extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$m),
this.effectName = "black",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = 127.5 * e
}
}
var fragment$l = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;void main(){float bval=0.0/255.0;float
wval=(255.0/(value-255.0)*-1.0);vec3
color=texture2D(uSampler,vTextureCoord).rgb;color=color*wval-
(bval*wval);gl_FragColor=vec4(color,texture2D(uSampler,vTextureCoord).a);}";
class White extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$l),
this.effectName = "white",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = 127.5 * e
}
}
var fragment$k = "#define GLSLIFY 1\nprecision highp float;varying vec2
vTextureCoord;uniform sampler2D uSampler;uniform float value;const float
epsilon=0.000001;const float mx=1.0-epsilon;const float
PI=3.1415926535897932384626433832795;const mat3
matRGBtoROMM=mat3(0.5293459296226501,0.3300727903842926,0.14058130979537964,0.09837
432950735092,0.8734610080718994,0.028164653107523918,0.01688321679830551,0.11767247
319221497,0.8654443025588989);const mat3 matROMMtoRGB=mat3(2.0340757369995117,-
0.727334201335907,-0.3067416846752167,-0.22881317138671875,1.2317301034927368,-
0.0029169507324695587,-0.008569774217903614,-
0.1532866358757019,1.1618564128875732);float luma_romm(in vec3 color){return
dot(color,vec3(0.242655,0.755158,0.002187));}float luma(in vec3 color){return
dot(color,vec3(0.298839,0.586811,0.11435));}vec3 rgb2hsv(in vec3 c){vec4
K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);vec4
p=mix(vec4(c.bg,K.wz),vec4(c.gb,K.xy),step(c.b,c.g));vec4
q=mix(vec4(p.xyw,c.r),vec4(c.r,p.yzx),step(p.x,c.r));float d=q.x-min(q.w,q.y);float
e=1.0e-10;return vec3(abs(q.z+(q.w-q.y)/(6.0*d+e)),d/(q.x+e),q.x);}vec3 hsv2rgb(in
vec3 c){vec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);vec3 p=abs(fract(c.xxx+K.xyz)*6.0-
K.www);return c.z*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),c.y);}vec3 setHue(in vec3 res,in
vec3 base){vec3 hsv=rgb2hsv(base);vec3 res_hsv=rgb2hsv(res);return
hsv2rgb(vec3(hsv.x,res_hsv.y,res_hsv.z));}float gaussian(in float x){return 1.0-
exp(-PI*2.0*x*x);}void main(){lowp vec4
col=texture2D(uSampler,vTextureCoord.xy);lowp vec3 map=col.rgb;vec3
base=col.rgb*matRGBtoROMM;float base_lum=luma(col.rgb);float
map_lum=luma_romm(map*matRGBtoROMM);float exposure=mix(value,0.0,1.0-
map_lum)*col.a;float a=abs(exposure)*col.a+epsilon;float v=pow(2.0,a+1.0)-2.0;float
m=mx-exp(-v);vec3 res=(exposure>0.0)?(1.0-exp(-v*base))/m : log(1.0-base*m)/-
v;res=mix(base,res,min(a*100.0,1.0));res=setHue(res,base);res=res*matROMMtoRGB;gl_F
ragColor=vec4(res,col.a);}";
class Highlights extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$k),
this.effectName = "highlights",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e
}
}
class Shadows extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$k),
this.effectName = "shadows",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = -1 * e
}
}
var fragment$j = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform vec2 px;uniform float m[9];uniform float value;void
main(void){vec4 c11=texture2D(uSampler,vTextureCoord-px);vec4
c12=texture2D(uSampler,vec2(vTextureCoord.x,vTextureCoord.y-px.y));vec4
c13=texture2D(uSampler,vec2(vTextureCoord.x+px.x,vTextureCoord.y-px.y));vec4
c21=texture2D(uSampler,vec2(vTextureCoord.x-px.x,vTextureCoord.y));vec4
c22=texture2D(uSampler,vTextureCoord);vec4
c23=texture2D(uSampler,vec2(vTextureCoord.x+px.x,vTextureCoord.y));vec4
c31=texture2D(uSampler,vec2(vTextureCoord.x-px.x,vTextureCoord.y+px.y));vec4
c32=texture2D(uSampler,vec2(vTextureCoord.x,vTextureCoord.y+px.y));vec4
c33=texture2D(uSampler,vTextureCoord+px);vec4
color=c11*m[0]+c12*m[1]+c13*m[2]+c21*m[3]+c22*m[4]+c23*m[5]+c31*m[6]+c32*m[7]+c33*m
[8];gl_FragColor=color*value+(c22*(1.0-value));}";
class Sharpen extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$j),
this.effectName = "sharpen",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
var t, r, n, i;
let[o,s] = null != (i = null == (n = null == (r = null == (t =
this.uniforms) ? void 0 : t.filterGlobals) ? void 0 : r.uniforms) ? void 0 :
n.inputSize) ? i : [1920, 1080];
this.uniforms.m = new Float32Array([-1, -1, -1, -1, 9, -1, -1, -1,
-1]),
this.uniforms.px = [1 / o, 1 / s],
this.uniforms.value = e / 2
}
}
var fragment$i = "#define GLSLIFY 1\nprecision highp float;varying vec2
vTextureCoord;uniform sampler2D uSampler;uniform float value;uniform vec2 px;float
Lum(vec3 c){return 0.299*c.r+0.587*c.g+0.114*c.b;}float BlendOverlayf(float
base,float blend){return(base<0.5 ?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-
blend)));}vec3 BlendOverlay(vec3 base,vec3 blend){return
vec3(BlendOverlayf(base.r,blend.r),BlendOverlayf(base.g,blend.g),BlendOverlayf(base
.b,blend.b));}float BlendVividLightf(float base,float blend){float
BlendColorBurnf=(((2.0*blend)==0.0)?(2.0*blend):
max((1.0-((1.0-base)/(2.0*blend))),0.0));float BlendColorDodgef=(((2.0*(blend-
0.5))==1.0)?(2.0*(blend-0.5)): min(base/(1.0-(2.0*(blend-
0.5))),1.0));return((blend<0.5)? BlendColorBurnf : BlendColorDodgef);}vec3
BlendVividLight(vec3 base,vec3 blend){return
vec3(BlendVividLightf(base.r,blend.r),BlendVividLightf(base.g,blend.g),BlendVividLi
ghtf(base.b,blend.b));}float normpdf(in float x,in float sigma){return
0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;}vec3 blurMap(){const int mSize=11;const
int kSize=(mSize-1)/2;float kernel[mSize];vec3 final_colour=vec3(0.0);float
sigma=7.0;float Z=0.0;for(int j=0;j<=kSize;++j){kernel[kSize+j]=kernel[kSize-
j]=normpdf(float(j),sigma);}for(int j=0;j<mSize;++j){Z+=kernel[j];}for(int i=-
kSize;i<=kSize;++i){for(int j=-kSize;j<=kSize;++j)
{final_colour+=kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler,
(vTextureCoord.xy+vec2(float(i),float(j))*px)).rgb;}}return
vec3(final_colour/(Z*Z));}void main(){vec4
base4=texture2D(uSampler,vTextureCoord.xy);vec3 blurMap=blurMap();vec3
base=base4.rgb;float intensity=(value<0.0)?(value/2.0): value;float
lum=Lum(base);vec3 col=vec3(lum);vec3 mask=vec3(1.0-pow(lum,1.8));vec3
layer=vec3(1.0-Lum(blurMap));vec3
detail=clamp(BlendVividLight(col,layer),0.0,1.0);vec3 inverse=mix(1.0-
detail,detail,(intensity+1.0)/2.0);gl_FragColor=vec4(BlendOverlay(base,mix(vec3(0.5
),inverse,mask)),base4.a);}";
class Clarity extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$i),
this.effectName = "clarity",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
var t, r, n, i;
let[o,s] = null != (i = null == (n = null == (r = null == (t =
this.uniforms) ? void 0 : t.filterGlobals) ? void 0 : r.uniforms) ? void 0 :
n.inputSize) ? i : [1920, 1080];
this.uniforms.px = [1 / o, 1 / s],
this.uniforms.value = 2 * e
}
}
var fragment$h = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform vec2 px;uniform float m[9];uniform float value;void
main(void){vec4 c11=texture2D(uSampler,vTextureCoord-px);vec4
c12=texture2D(uSampler,vec2(vTextureCoord.x,vTextureCoord.y-px.y));vec4
c13=texture2D(uSampler,vec2(vTextureCoord.x+px.x,vTextureCoord.y-px.y));vec4
c21=texture2D(uSampler,vec2(vTextureCoord.x-px.x,vTextureCoord.y));vec4
c22=texture2D(uSampler,vTextureCoord);vec4
c23=texture2D(uSampler,vec2(vTextureCoord.x+px.x,vTextureCoord.y));vec4
c31=texture2D(uSampler,vec2(vTextureCoord.x-px.x,vTextureCoord.y+px.y));vec4
c32=texture2D(uSampler,vec2(vTextureCoord.x,vTextureCoord.y+px.y));vec4
c33=texture2D(uSampler,vTextureCoord+px);vec4
color=c11*m[0]+c12*m[1]+c13*m[2]+c21*m[3]+c22*m[4]+c23*m[5]+c31*m[6]+c32*m[7]+c33*m
[8];gl_FragColor=color*value+(c22*(1.0-value));}";
class Smooth extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$h),
this.effectName = "smooth",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
var t, r, n, i;
let[o,s] = null != (i = null == (n = null == (r = null == (t =
this.uniforms) ? void 0 : t.filterGlobals) ? void 0 : r.uniforms) ? void 0 :
n.inputSize) ? i : [1920, 1080];
this.uniforms.m = new Float32Array([1 / 16, 2 / 16, 1 / 16, 2 / 16,
.25, 2 / 16, 1 / 16, 2 / 16, 1 / 16]),
this.uniforms.px = [1 / o, 1 / s],
this.uniforms.value = e
}
}
class Blur extends ColorEffectsFilter {
constructor(e=0) {
super(null, null),
this.effectName = "blur",
this.effectType = "filter",
this._blurFilter = new BlurFilter,
this.value = e
}
apply(e, t, r, n, i) {
this._blurFilter.apply(e, t, r, n)
}
get value() {
return this.uniforms.value
}
set value(e) {
this._blurFilter.blur = 10 * e,
this.uniforms.value = e
}
}
var fragment$g = "precision highp float;uniform sampler2D uSampler;varying
vec2 vTextureCoord;uniform float width;uniform float height;uniform float
value;uniform float timer;const float permTexUnit=1.0/256.0;const float
permTexUnitHalf=0.5/256.0;float grainsize=1.8;float lumamount=1.0;vec4 rnm(in vec2
tc){float
noise=sin(dot(tc+vec2(timer,timer),vec2(12.9898,78.233)))*43758.5453;float
noiseR=fract(noise)*2.0-1.0;float noiseG=fract(noise*1.2154)*2.0-1.0;float
noiseB=fract(noise*1.3453)*2.0-1.0;float noiseA=fract(noise*1.3647)*2.0-1.0;return
vec4(noiseR,noiseG,noiseB,noiseA);}float fade(in float t){return t*t*t*(t*(t*6.0-
15.0)+10.0);}float pnoise3D(in vec3 p){vec3 pi=permTexUnit*floor(p)
+permTexUnitHalf;vec3 pf=fract(p);float perm00=rnm(pi.xy).a;vec3
grad000=rnm(vec2(perm00,pi.z)).rgb*4.0-1.0;float n000=dot(grad000,pf);vec3
grad001=rnm(vec2(perm00,pi.z+permTexUnit)).rgb*4.0-1.0;float n001=dot(grad001,pf-
vec3(0.0,0.0,1.0));float perm01=rnm(pi.xy+vec2(0.0,permTexUnit)).a;vec3
grad010=rnm(vec2(perm01,pi.z)).rgb*4.0-1.0;float n010=dot(grad010,pf-
vec3(0.0,1.0,0.0));vec3 grad011=rnm(vec2(perm01,pi.z+permTexUnit)).rgb*4.0-
1.0;float n011=dot(grad011,pf-vec3(0.0,1.0,1.0));float
perm10=rnm(pi.xy+vec2(permTexUnit,0.0)).a;vec3
grad100=rnm(vec2(perm10,pi.z)).rgb*4.0-1.0;float n100=dot(grad100,pf-
vec3(1.0,0.0,0.0));vec3 grad101=rnm(vec2(perm10,pi.z+permTexUnit)).rgb*4.0-
1.0;float n101=dot(grad101,pf-vec3(1.0,0.0,1.0));float
perm11=rnm(pi.xy+vec2(permTexUnit,permTexUnit)).a;vec3
grad110=rnm(vec2(perm11,pi.z)).rgb*4.0-1.0;float n110=dot(grad110,pf-
vec3(1.0,1.0,0.0));vec3 grad111=rnm(vec2(perm11,pi.z+permTexUnit)).rgb*4.0-
1.0;float n111=dot(grad111,pf-vec3(1.0,1.0,1.0));vec4
n_x=mix(vec4(n000,n001,n010,n011),vec4(n100,n101,n110,n111),fade(pf.x));vec2
n_xy=mix(n_x.xy,n_x.zw,fade(pf.y));float n_xyz=mix(n_xy.x,n_xy.y,fade(pf.z));return
n_xyz;}vec2 coordRot(in vec2 tc,in float angle){float aspect=width/height;float
rotX=((tc.x*2.0-1.0)*aspect*cos(angle))-((tc.y*2.0-1.0)*sin(angle));float
rotY=((tc.y*2.0-1.0)*cos(angle))+((tc.x*2.0-1.0)*aspect*sin(angle));rotX=((rotX/
aspect)*0.5+0.5);rotY=rotY*0.5+0.5;return vec2(rotX,rotY);}void main(){vec3
rotOffset=vec3(1.425,3.892,5.835);vec2
rotCoordsR=coordRot(vTextureCoord,timer+rotOffset.x);vec3
noise=vec3(pnoise3D(vec3(rotCoordsR*vec2(width/grainsize,height/grainsize),0.0)));v
ec4 tex=texture2D(uSampler,vTextureCoord);vec3 col=tex.rgb;vec3
lumcoeff=vec3(0.299,0.587,0.114);float
luminance=mix(0.0,dot(col,lumcoeff),lumamount);float
lum=smoothstep(0.2,0.0,luminance);lum+=luminance;noise=mix(noise,vec3(0.0),pow(lum,
4.0));col=col+noise*value;gl_FragColor=vec4(col,tex.w);}";
class Grain extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$g),
this.effectName = "grain",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
var t, r, n, i;
let[o,s] = null != (i = null == (n = null == (r = null == (t =
this.uniforms) ? void 0 : t.filterGlobals) ? void 0 : r.uniforms) ? void 0 :
n.inputSize) ? i : [1920, 1080];
this.uniforms.width = o,
this.uniforms.height = s,
this.uniforms.timer = 1,
this.uniforms.value = e / 10
}
}
var fragment$f = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform float size;void main(){vec4
color=texture2D(uSampler,vTextureCoord);float
dist=distance(vTextureCoord,vec2(0.5,0.5));float
grd=smoothstep(0.8,size*0.799,dist*(value*0.6+size*2.0));color.rgb+=vec3(1.0,1.0,1.
0)*(1.0-grd);gl_FragColor=color;}";
class VignetteWhite extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$f),
this.effectName = "vignetteWhite",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.size = .25,
this.uniforms.value = 2 * (e - .1)
}
}
var fragment$e = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform float size;void main(){vec4
color=texture2D(uSampler,vTextureCoord);float
dist=distance(vTextureCoord,vec2(0.5,0.5));color.rgb*=smoothstep(0.8,size*0.799,dis
t*(value*0.75+size*2.0));gl_FragColor=color;}";
class VignetteBlack extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$e),
this.effectName = "vignetteBlack",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.size = .25,
this.uniforms.value = 2 * (e - .1)
}
}
var fragment$d = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec2 px;float normpdf(in float x,in
float sigma){return 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;}vec3 blurMap(){const
int mSize=11;const int kSize=(mSize-1)/2;float kernel[mSize];vec3
final_colour=vec3(0.0);float sigma=7.0;float Z=0.0;for(int j=0;j<=kSize;++j)
{kernel[kSize+j]=kernel[kSize-j]=normpdf(float(j),sigma);}for(int j=0;j<mSize;++j)
{Z+=kernel[j];}for(int i=-kSize;i<=kSize;++i){for(int j=-kSize;j<=kSize;++j)
{final_colour+=kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler,
(vTextureCoord.xy+vec2(float(i),float(j))*px)).rgb;}}return
vec3(final_colour/(Z*Z));}float luma(vec3 color){return
dot(color,vec3(0.299,0.587,0.114));}void main(){vec4
base=texture2D(uSampler,vTextureCoord);vec3
color=blurMap();color=vec3(luma(color));color=vec3((base.r<=0.5)?
(2.0*base.r*color.r):(1.0-2.0*(1.0-base.r)*(1.0-color.r)),(base.g<=0.5)?
(2.0*base.g*color.g):(1.0-2.0*(1.0-base.g)*(1.0-color.g)),(base.b<=0.5)?
(2.0*base.b*color.b):(1.0-2.0*(1.0-base.b)*(1.0-
color.b)));gl_FragColor=mix(base,vec4(color,base.a),value);}";
class Glamour extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$d),
this.effectName = "glamour",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
var t, r, n, i;
let[o,s] = null != (i = null == (n = null == (r = null == (t =
this.uniforms) ? void 0 : t.filterGlobals) ? void 0 : r.uniforms) ? void 0 :
n.inputSize) ? i : [1920, 1080];
this.uniforms.px = [1 / o, 1 / s],
this.uniforms.value = e
}
}
var fragment$c = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec2 px;float thresh=.5;void main()
{vec4 sum=vec4(0);int j=-2;for(int i=-2;i<=2;i+
+)sum+=texture2D(uSampler,vTextureCoord+vec2(i,j)*px);j=-1;for(int i=-2;i<=2;i+
+)sum+=texture2D(uSampler,vTextureCoord+vec2(i,j)*px);j=0;for(int i=-2;i<=2;i+
+)sum+=texture2D(uSampler,vTextureCoord+vec2(i,j)*px);j=1;for(int i=-2;i<=2;i+
+)sum+=texture2D(uSampler,vTextureCoord+vec2(i,j)*px);j=2;for(int i=-2;i<=2;i+
+)sum+=texture2D(uSampler,vTextureCoord+vec2(i,j)*px);sum/
=25.0;gl_FragColor=texture2D(uSampler,vTextureCoord);if(length(sum)>thresh)
{gl_FragColor+=sum*value;}}";
class Bloom extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$c),
this.effectName = "bloom",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
var t, r, n, i;
let[o,s] = null != (i = null == (n = null == (r = null == (t =
this.uniforms) ? void 0 : t.filterGlobals) ? void 0 : r.uniforms) ? void 0 :
n.inputSize) ? i : [1920, 1080];
this.uniforms.px = [1 / o, 1 / s],
this.uniforms.value = e
}
}
var fragment$b = "#define GLSLIFY 1;\nprecision highp float;varying vec2
vTextureCoord;uniform sampler2D uSampler;uniform float value;uniform vec2
size;float hazeMap(vec4 base){vec3 color=vec3(1.0,1.0,1.0);vec2
step=vec2(1.0/size.xy);const int patchRadius=1;for(int i=-
patchRadius;i<=patchRadius;++i){for(int j=-patchRadius;j<=patchRadius;++j){vec2
uv=clamp(vTextureCoord+(vec2(i,j)*step),0.0,1.0);color=min(color,base.rgb);}}return
min(color.r,min(color.g,color.b));}void main(){lowp vec4
base=texture2D(uSampler,vTextureCoord.xy);lowp float haze=hazeMap(base);float
transmission=1.0-0.95*haze;const float A=0.95;const float t0=0.1;float
t=mix(1.0,max(t0,transmission),value);vec3
J=(base.rgb-A)/t+A;gl_FragColor=vec4(J,base.a);}";
class Dehaze extends ColorEffectsFilter {
constructor(e=0) {
super(null, fragment$b),
this.effectName = "dehaze",
this.effectType = "filter",
this.value = e
}
get value() {
return this.uniforms.value
}
set value(e) {
var t, r, n, i;
let[o,s] = null != (i = null == (n = null == (r = null == (t =
this.uniforms) ? void 0 : t.filterGlobals) ? void 0 : r.uniforms) ? void 0 :
n.inputSize) ? i : [1920, 1080];
this.uniforms.size = [1 / o, 1 / s],
this.uniforms.value = e
}
}
var fragment$a = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform sampler2D paletteMap;uniform float value;float luma(vec3
color){return dot(color,vec3(0.299,0.587,0.114));}void main(){lowp vec4
base=texture2D(uSampler,vTextureCoord.xy);float avg=luma(base.rgb);float
r=texture2D(paletteMap,vec2(avg,0)).r;float
g=texture2D(paletteMap,vec2(avg,0)).g;float
b=texture2D(paletteMap,vec2(avg,0)).b;gl_FragColor=mix(base,vec4(r,g,b,base.a),valu
e);}";
class Toning extends ColorEffectsFilter {
constructor(e=0, t="#ff2200", r="#ff00ff") {
super(null, fragment$a),
this.effectName = "toning",
this.effectType = "filter",
this._imageData = new ImageData(256,1),
this.value = e,
this.lightColor = t,
this.darkColor = r
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.lightColor))
, [n,i,o] = hex2rgb(string2hex(this.uniforms.darkColor));
let s = this._imageData;
Toning.fillPaletteMap({
value: this.uniforms.value,
lightColor: {
r: 255 * e,
g: 255 * t,
b: 255 * r
},
darkColor: {
r: 255 * n,
g: 255 * i,
b: 255 * o
}
}, s);
const a = new Uint8Array(Array.from(s.data));
this.uniforms.paletteMap = Texture.fromBuffer(a, a.length / 4, 1)
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
get lightColor() {
return this.uniforms.lightColor
}
set lightColor(e) {
this.uniforms.lightColor = e,
this.update()
}
get darkColor() {
return this.uniforms.darkColor
}
set darkColor(e) {
this.uniforms.darkColor = e,
this.update()
}
static fillPaletteMap(e, t) {
for (let r = 0; r < 256; ++r) {
let n = r / 255;
t.data[4 * r] = Math.round(e.lightColor.r * n + e.darkColor.r *
(1 - n)),
t.data[4 * r + 1] = Math.round(e.lightColor.g * n +
e.darkColor.g * (1 - n)),
t.data[4 * r + 2] = Math.round(e.lightColor.b * n +
e.darkColor.b * (1 - n))
}
}
}
var fragment$9 = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec4 color;float
blendSoftLight(float base,float blend){return(blend<0.5)?
(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-
1.0)+2.0*base*(1.0-blend));}vec3 blendSoftLight(vec3 base,vec3 blend){return
vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(b
ase.b,blend.b));}vec3 blendSoftLight(vec3 base,vec3 blend,float opacity)
{return(blendSoftLight(base,blend)*opacity+base*(1.0-opacity));}void main(){vec4
base=texture2D(uSampler,vTextureCoord.xy);gl_FragColor=vec4(blendSoftLight(base.rgb
,color.rgb,value),base.a);}";
class SoftLight extends Filter$2 {
constructor(e=0, t="#f20") {
super(null, fragment$9),
this.value = e,
this.fillColor = t
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.fillColor));
this.uniforms.color = [e, t, r, 1]
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
var fragment$8 = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec4 color;float blendOverlay(float
base,float blend){return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-
blend));}vec3 blendOverlay(vec3 base,vec3 blend){return
vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,
blend.b));}vec3 blendHardLight(vec3 base,vec3 blend){return
blendOverlay(blend,base);}vec3 blendHardLight(vec3 base,vec3 blend,float opacity)
{return(blendHardLight(base,blend)*opacity+base*(1.0-opacity));}void main(){vec4
base=texture2D(uSampler,vTextureCoord.xy);gl_FragColor=vec4(blendHardLight(base.rgb
,color.rgb,value),base.a);}";
class HardLight extends Filter$2 {
constructor(e=0, t="#f20") {
super(null, fragment$8),
this.value = e,
this.fillColor = t
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.fillColor));
this.uniforms.color = [e, t, r, 1]
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
var fragment$7 = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec4 color;float
blendColorBurn(float base,float blend){return(blend==0.0)?blend:max((1.0-((1.0-
base)/blend)),0.0);}float blendColorDodge(float base,float blend)
{return(blend==1.0)?blend:min(base/(1.0-blend),1.0);}float blendVividLight(float
base,float blend){return(blend<0.5)?blendColorBurn(base,
(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));}vec3 blendVividLight(vec3
base,vec3 blend){return
vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLigh
t(base.b,blend.b));}vec3 blendVividLight(vec3 base,vec3 blend,float opacity)
{return(blendVividLight(base,blend)*opacity+base*(1.0-opacity));}void main(){vec4
base=texture2D(uSampler,vTextureCoord.xy);gl_FragColor=vec4(blendVividLight(base.rg
b,color.rgb,value),base.a);}";
class VividLight extends Filter$2 {
constructor(e=0, t="#f20") {
super(null, fragment$7),
this.value = e,
this.fillColor = t
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.fillColor));
this.uniforms.color = [e, t, r, 1]
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
var fragment$6 = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec4 color;float blendOverlay(float
base,float blend){return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-
blend));}vec3 blendOverlay(vec3 base,vec3 blend){return
vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,
blend.b));}vec3 blendOverlay(vec3 base,vec3 blend,float opacity)
{return(blendOverlay(base,blend)*opacity+base*(1.0-opacity));}void main(){vec4
base=texture2D(uSampler,vTextureCoord.xy);gl_FragColor=vec4(blendOverlay(base.rgb,c
olor.rgb,value),base.a);}";
class Overlay extends Filter$2 {
constructor(e=0, t="#f20") {
super(null, fragment$6),
this.value = e,
this.fillColor = t
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.fillColor));
this.uniforms.color = [e, t, r, 1]
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
var fragment$5 = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec4 color;vec3 blendMultiply(vec3
base,vec3 blend){return base*blend;}vec3 blendMultiply(vec3 base,vec3 blend,float
opacity){return(blendMultiply(base,blend)*opacity+base*(1.0-opacity));}void main()
{vec4
base=texture2D(uSampler,vTextureCoord.xy);gl_FragColor=vec4(blendMultiply(base.rgb,
color.rgb,value),base.a);}";
class Multiply extends Filter$2 {
constructor(e=0, t="#f20") {
super(null, fragment$5),
this.value = e,
this.fillColor = t
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.fillColor));
this.uniforms.color = [e, t, r, 1]
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
var fragment$4 = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec4 color;float
blendColorDodge(float base,float blend){return(blend==1.0)?blend:min(base/(1.0-
blend),1.0);}vec3 blendColorDodge(vec3 base,vec3 blend){return
vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodg
e(base.b,blend.b));}vec3 blendColorDodge(vec3 base,vec3 blend,float opacity)
{return(blendColorDodge(base,blend)*opacity+base*(1.0-opacity));}void main(){vec4
base=texture2D(uSampler,vTextureCoord.xy);gl_FragColor=vec4(blendColorDodge(base.rg
b,color.rgb,value),base.a);}";
class ColorDodge extends Filter$2 {
constructor(e=0, t="#f20") {
super(null, fragment$4),
this.value = e,
this.fillColor = t
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.fillColor));
this.uniforms.color = [e, t, r, 1]
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
var fragment$3 = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec4 color;float
blendColorBurn(float base,float blend){return(blend==0.0)?blend:max((1.0-((1.0-
base)/blend)),0.0);}vec3 blendColorBurn(vec3 base,vec3 blend){return
vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(b
ase.b,blend.b));}vec3 blendColorBurn(vec3 base,vec3 blend,float opacity)
{return(blendColorBurn(base,blend)*opacity+base*(1.0-opacity));}void main(){vec4
base=texture2D(uSampler,vTextureCoord.xy);gl_FragColor=vec4(blendColorBurn(base.rgb
,color.rgb,value),base.a);}";
class ColorBurn extends Filter$2 {
constructor(e=0, t="#f20") {
super(null, fragment$3),
this.value = e,
this.fillColor = t
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.fillColor));
this.uniforms.color = [e, t, r, 1]
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
var fragment$2 = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec4 color;float blendScreen(float
base,float blend){return 1.0-((1.0-base)*(1.0-blend));}vec3 blendScreen(vec3
base,vec3 blend){return
vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,ble
nd.b));}vec3 blendScreen(vec3 base,vec3 blend,float opacity)
{return(blendScreen(base,blend)*opacity+base*(1.0-opacity));}void main(){vec4
base=texture2D(uSampler,vTextureCoord.xy);gl_FragColor=vec4(blendScreen(base.rgb,co
lor.rgb,value),base.a);}";
class Screen extends Filter$2 {
constructor(e=0, t="#f20") {
super(null, fragment$2),
this.value = e,
this.fillColor = t
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.fillColor));
this.uniforms.color = [e, t, r, 1]
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
var fragment$1 = "precision highp float;varying vec2 vTextureCoord;uniform
sampler2D uSampler;uniform float value;uniform vec4 color;void main(){vec4
base=texture2D(uSampler,vTextureCoord.xy);gl_FragColor=mix(base,color,value);}";
let Default$1 = class extends Filter$2 {
constructor(e=0, t="#f20") {
super(null, fragment$1),
this.value = e,
this.fillColor = t
}
update() {
const [e,t,r] = hex2rgb(string2hex(this.uniforms.fillColor));
this.uniforms.color = [e, t, r, 1]
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
;
const fillMode = {
default: Default$1,
screen: Screen,
overlay: Overlay,
multiply: Multiply,
colorDodge: ColorDodge,
colorBurn: ColorBurn,
hardLight: HardLight,
softLight: SoftLight,
vividLight: VividLight
};
class Fill extends ColorEffectsFilter {
constructor(e=0, t="#ff2200", r="softLight") {
super(null, null),
this.effectName = "fill",
this.effectType = "filter",
this._fillFilter = new fillMode[r],
this.mode = r,
this.value = e,
this.fillColor = t
}
apply(e, t, r, n, i) {
this._fillFilter.apply(e, t, r, n)
}
update() {
this._fillFilter.value = this.uniforms.value,
this._fillFilter.fillColor = this.uniforms.fillColor
}
get mode() {
return this.uniforms.mode
}
set mode(e) {
this._fillFilter = new fillMode[e],
this.uniforms.mode = e,
this.update()
}
get fillColor() {
return this.uniforms.fillColor
}
set fillColor(e) {
this.uniforms.fillColor = e,
this.update()
}
get value() {
return this.uniforms.value
}
set value(e) {
this.uniforms.value = e,
this.update()
}
}
const presetConfig = {
flower: [{
name: "vibrance",
value: .2
}, {
name: "saturation",
value: .1
}, {
name: "temperature",
value: .1
}],
forest: [{
name: "saturation",
value: -.2
}, {
name: "vibrance",
value: 1
}, {
name: "clarity",
value: .2
}, {
name: "temperature",
value: .16
}, {
name: "tint",
value: .2
}, {
name: "curves",
value: {
preset: [[0, 0, 65, 52, 173, 190, 236, 255], [0, 0, 255, 255],
[0, 0, 255, 255], [0, 0, 255, 255]]
}
}],
beach: [{
name: "saturation",
value: .2
}, {
name: "vibrance",
value: .2
}, {
name: "curves",
value: {
preset: [[0, 0, 68, 56, 199, 208, 255, 255], [0, 0, 255, 255],
[0, 0, 98, 97, 196, 201, 255, 255], [0, 0, 87, 85, 201, 182, 255, 255]]
}
}, {
name: "temperature",
value: .1
}],
sham: [{
name: "saturation",
value: -.3
}, {
name: "fill",
value: {
value: .3,
mode: "overlay",
fillColor: "#99ddff"
}
}, {
name: "curves",
value: {
preset: [[60, 31, 191, 217], [0, 0, 120, 134, 255, 255], [0, 0,
255, 255], [0, 0, 120, 144, 255, 255]]
}
}],
stalker: [{
name: "curves",
value: {
preset: [[62, 64, 190, 191], [0, 0, 133, 125, 255, 255], [0, 0,
54, 65, 209, 208, 255, 255], [60, 62, 96, 99, 240, 230, 255, 255]]
}
}, {
name: "contrast",
value: .1
}, {
name: "saturation",
value: -.2
}],
shimmer: [{
name: "temperature",
value: -.2
}, {
name: "tint",
value: -.12
}, {
name: "fill",
value: {
value: .12,
mode: "screen",
fillColor: "#be0bff"
}
}, {
name: "curves",
value: {
preset: [[8, 23, 244, 227], [0, 0, 255, 255], [0, 0, 131, 124,
255, 255], [0, 0, 149, 112, 255, 255]]
}
}],
mold: [{
name: "curves",
value: {
preset: [[65, 64, 233, 233], [0, 0, 138, 121, 255, 255], [0, 0,
60, 75, 184, 184, 255, 255], [0, 0, 64, 75, 181, 176, 255, 255]]
}
}, {
name: "contrast",
value: .1
}, {
name: "saturation",
value: -.12
}],
style: [{
name: "curves",
value: {
preset: [[0, 0, 73, 74, 191, 177, 235, 221, 255, 255], [0, 26,
89, 64, 121, 126, 180, 213, 255, 255], [0, 0, 71, 50, 190, 210, 255, 255], [61, 64,
112, 97, 199, 198, 255, 255]]
}
}, {
name: "vibrance",
value: -.1
}, {
name: "saturation",
value: -.4
}, {
name: "temperature",
value: .1
}],
cement: [{
name: "curves",
value: {
preset: [[0, 0, 73, 74, 191, 177, 235, 221, 255, 255], [0, 0,
255, 255], [0, 0, 60, 54, 198, 210, 255, 255], [0, 0, 73, 37, 150, 149, 199, 198,
255, 255]]
}
}, {
name: "vibrance",
value: -.1
}, {
name: "saturation",
value: -.1
}],
sharp: [{
name: "curves",
value: {
preset: [[0, 0, 42, 20, 199, 218, 224, 246, 255, 255], [0, 0,
255, 255], [0, 0, 255, 255], [0, 0, 255, 255]]
}
}, {
name: "vibrance",
value: .1
}, {
name: "sharpen",
value: .1
}, {
name: "clarity",
value: .1
}],
corn: [{
name: "temperature",
value: .1
}, {
name: "vibrance",
value: .3
}, {
name: "contrast",
value: .1
}, {
name: "curves",
value: {
preset: [[0, 0, 66, 78, 255, 255], [0, 0, 255, 255], [0, 0,
255, 255], [0, 0, 255, 255]]
}
}],
morning: [{
name: "tint",
value: .18
}, {
name: "temperature",
value: .1
}, {
name: "highlights",
value: .08
}, {
name: "levels",
value: {
minin: 0,
maxin: 245,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "curves",
value: {
preset: [[64, 64, 150, 181, 254, 255], [0, 0, 122, 138, 255,
255], [0, 0, 255, 255], [0, 0, 255, 255]]
}
}, {
name: "fill",
value: {
value: .2,
mode: "overlay",
fillColor: "#c27829"
}
}],
ensalat: [{
name: "highlights",
value: .2
}, {
name: "shadows",
value: -.2
}, {
name: "brightness",
value: .1
}, {
name: "levels",
value: {
minin: 10,
maxin: 245,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "curves",
value: {
preset: [[0, 0, 135, 119, 191, 193, 255, 255], [0, 0, 255,
255], [0, 0, 129, 121, 255, 255], [0, 0, 255, 255]]
}
}, {
name: "clarity",
value: .2
}, {
name: "sharpen",
value: .15
}],
berry: [{
name: "vibrance",
value: .44
}, {
name: "curves",
value: {
preset: [[0, 0, 62, 66, 121, 135, 255, 255], [0, 0, 255, 255],
[0, 0, 255, 255], [0, 0, 255, 255]]
}
}, {
name: "contrast",
value: .2
}, {
name: "highlights",
value: .4
}, {
name: "shadows",
value: -.2
}, {
name: "levels",
value: {
minin: 20,
maxin: 255,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}],
gritty: [{
name: "saturation",
value: -.4
}, {
name: "levels",
value: {
minin: 20,
maxin: 255,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "curves",
value: {
preset: [[0, 0, 50, 33, 128, 112, 190, 215, 255, 255], [0, 0,
255, 255], [0, 0, 255, 255], [0, 0, 255, 255]]
}
}, {
name: "clarity",
value: 1
}, {
name: "grain",
value: .3
}],
sunny: [{
name: "fill",
value: {
value: .2,
mode: "overlay",
fillColor: "#ffc260"
}
}, {
name: "temperature",
value: .1
}, {
name: "glamour",
value: .4
}, {
name: "clarity",
value: .3
}],
film: [{
name: "sharpen",
value: .2
}, {
name: "glamour",
value: .5
}, {
name: "grain",
value: .5
}, {
name: "highlights",
value: -.2
}, {
name: "shadows",
value: -.2
}, {
name: "saturation",
value: -.2
}],
matte: [{
name: "curves",
value: {
preset: [[0, 50, 38, 56, 79, 82, 152, 153, 255, 255], [0, 0,
255, 255], [0, 0, 255, 255], [0, 0, 255, 255]]
}
}, {
name: "contrast",
value: .12
}, {
name: "saturation",
value: -.1
}],
deep: [{
name: "curves",
value: {
preset: [[0, 0, 117, 99, 191, 198, 255, 255], [0, 0, 71, 38,
177, 209, 255, 255], [0, 0, 236, 255], [0, 28, 75, 101, 190, 171, 254, 233]]
}
}, {
name: "saturation",
value: -.3
}],
aladin: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 52, 87, 99, 255, 255], [0, 0,
106, 107, 194, 190, 254, 212], [0, 0, 166, 129, 254, 142]]
}
}],
amber: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 98, 150, 255, 255], [0, 0,
138, 117, 255, 255], [0, 128, 254, 129]]
}
}],
anne: [{
name: "contrast",
value: .25
}, {
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 78, 66, 135, 171, 255, 255],
[0, 0, 99, 87, 180, 208, 255, 255], [0, 0, 94, 93, 171, 161, 255, 255]]
}
}],
antonio: [{
name: "glamour",
value: .8
}],
alex: [{
name: "glamour",
value: .6
}],
bob: [{
name: "saturation",
value: -.6
}, {
name: "highlights",
value: .5
}],
greg: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 74, 50, 181, 198, 255, 255],
[0, 0, 61, 41, 108, 170, 158, 207, 254, 208], [0, 0, 83, 56, 168, 204, 255, 255]]
}
}],
hagrid: [{
name: "vibrance",
value: .9
}, {
name: "saturation",
value: .1
}, {
name: "clarity",
value: .5
}, {
name: "shadows",
value: -.3
}],
harry: [{
name: "fill",
value: {
value: .7,
mode: "overlay",
fillColor: "#d6b277"
}
}, {
name: "grain",
value: .5
}],
ivan: [{
name: "fill",
value: {
value: .4,
mode: "overlay",
fillColor: "#ff0044"
}
}, {
name: "shadows",
value: .15
}, {
name: "levels",
value: {
minin: 6,
maxin: 255,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}],
jean: [{
name: "levels",
value: {
minin: 56,
maxin: 233,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "saturation",
value: -1
}, {
name: "tint",
value: .1
}, {
name: "exposure",
value: .78
}, {
name: "bloom",
value: .1
}],
josh: [{
name: "curves",
value: {
preset: [[0, 0, 78, 52, 175, 207, 255, 255], [0, 0, 255, 255],
[0, 0, 255, 255], [0, 64, 87, 129, 254, 193]]
}
}],
karen: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 89, 144, 255, 255], [0, 0,
138, 112, 255, 255], [0, 0, 162, 88, 255, 255]]
}
}],
lucas: [{
name: "tint",
value: 1
}, {
name: "saturation",
value: -.85
}, {
name: "contrast",
value: .4
}, {
name: "shadows",
value: 1
}, {
name: "temperature",
value: .1
}],
melissa: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 62, 255, 255], [0, 0, 255, 255],
[0, 61, 254, 193]]
}
}],
peter: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 6, 31, 20, 65, 26, 87, 51, 195,
190, 254, 230], [0, 11, 24, 27, 102, 131, 189, 195, 255, 255], [0, 40, 126, 148,
254, 177]]
}
}],
salomon: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 83, 50, 177, 213, 255, 255],
[0, 0, 69, 55, 186, 205, 255, 255], [11, 56, 254, 212]]
}
}, {
name: "contrast",
value: -.2
}],
sara: [{
name: "vibrance",
value: 1
}, {
name: "contrast",
value: .1
}, {
name: "highlights",
value: .3
}],
sophia: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 140, 116, 222, 254], [0, 0,
70, 59, 182, 201, 255, 255], [0, 29, 252, 227]]
}
}, {
name: "saturation",
value: .3
}],
tony: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 92, 42, 218, 252], [0, 0, 73,
75, 157, 194, 255, 255], [0, 27, 254, 227]]
}
}],
agnes: [{
name: "desaturate",
value: 1
}, {
name: "contrast",
value: .5
}],
conny: [{
name: "saturation",
value: -.55
}, {
name: "temperature",
value: .25
}, {
name: "brightness",
value: -.25
}, {
name: "levels",
value: {
minin: 14,
maxin: 233,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "exposure",
value: .35
}, {
name: "highlights",
value: -.9
}],
gordon: [{
name: "desaturate",
value: 1
}, {
name: "temperature",
value: .7
}, {
name: "tint",
value: .3
}, {
name: "saturation",
value: -.2
}],
harrison: [{
name: "toning",
value: {
value: 1,
lightColor: "#fff0d7",
darkColor: "#301a18"
}
}, {
name: "grain",
value: .2
}],
henry: [{
name: "toning",
value: {
value: 1,
lightColor: "#fff0d7",
darkColor: "#301a18"
}
}, {
name: "saturation",
value: -.5
}],
logan: [{
name: "glamour",
value: .5
}, {
name: "tint",
value: .4
}, {
name: "saturation",
value: -.35
}, {
name: "toning",
value: {
value: .8,
lightColor: "#fff0d7",
darkColor: "#301a18"
}
}],
olay: [{
name: "saturation",
value: -1
}, {
name: "grain",
value: .5
}, {
name: "vignette",
value: .5
}],
porter: [{
name: "saturation",
value: -1
}, {
name: "vignette",
value: .4
}, {
name: "levels",
value: {
minin: 50,
maxin: 205,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}],
tom: [{
name: "desaturate",
value: 1
}],
sampi: [{
name: "toning",
value: {
value: 1,
lightColor: "#ffe4c4",
darkColor: "#000000"
}
}, {
name: "levels",
value: {
minin: 0,
maxin: 217,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "temperature",
value: .3
}],
vinny: [{
name: "curves",
value: {
preset: [[0, 0, 133, 111, 255, 255], [0, 0, 255, 255], [0, 0,
255, 255], [0, 0, 133, 138, 255, 255]]
}
}, {
name: "vibrance",
value: -1
}, {
name: "saturation",
value: 1
}, {
name: "temperature",
value: .8
}, {
name: "contrast",
value: -.1
}, {
name: "highlights",
value: .1
}],
borg: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 94, 66, 227, 255], [0, 0, 93,
94, 179, 198, 255, 255], [0, 19, 254, 228]]
}
}, {
name: "fill",
value: {
value: .1,
mode: "default",
fillColor: "#ccff00"
}
}],
carl: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 93, 64, 227, 255], [0, 0, 93,
94, 181, 189, 255, 255], [0, 19, 254, 228]]
}
}, {
name: "vignette",
value: .3
}, {
name: "contrast",
value: .15
}, {
name: "saturation",
value: -.3
}],
coco: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 64, 97, 255, 255], [0, 0,
142, 122, 255, 255], [0, 0, 144, 112, 255, 255]]
}
}],
doris: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 78, 48, 177, 209, 255, 255],
[0, 0, 92, 94, 179, 208, 255, 255], [0, 52, 254, 215]]
}
}, {
name: "saturation",
value: -.2
}],
doug: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 64, 255, 255], [0, 0, 255, 255],
[1, 64, 252, 193]]
}
}],
earl: [{
name: "vignette",
value: .4
}, {
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 222, 254], [0, 47, 223, 254],
[0, 129, 222, 255]]
}
}, {
name: "fill",
value: {
value: .8,
mode: "multiply",
fillColor: "#f7daae"
}
}],
kevin: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 75, 164, 126, 212, 255, 255],
[1, 37, 111, 147, 217, 217], [73, 80, 149, 111, 200, 173]]
}
}, {
name: "contrast",
value: .15
}],
nash: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 221, 255], [0, 48, 222, 252],
[0, 129, 226, 255]]
}
}, {
name: "fill",
value: {
value: 1,
mode: "multiply",
fillColor: "#f7daae"
}
}, {
name: "levels",
value: {
minin: 0,
maxin: 225,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}],
stan: [{
name: "curves",
value: {
preset: [[0, 0, 69, 54, 180, 199, 255, 255], [0, 117, 64, 158,
147, 185, 208, 228, 255, 255], [0, 69, 101, 131, 180, 182, 209, 224, 254, 233], [1,
87, 83, 110, 168, 149, 215, 145, 254, 184]]
}
}],
sun: [{
name: "fill",
value: {
value: .8,
mode: "multiply",
fillColor: "#fbf2a3"
}
}, {
name: "vignette",
value: -.25
}],
"bd orange": [{
name: "curves",
value: {
preset: [[1, 34, 43, 43, 77, 70, 97, 108, 138, 158, 173, 184,
223, 208, 254, 231], [28, 3, 55, 38, 110, 92, 152, 148, 201, 208, 255, 255], [0, 0,
62, 55, 193, 189, 255, 255], [0, 27, 55, 75, 116, 110, 190, 149, 254, 163]]
}
}, {
name: "grain",
value: .33
}],
blues: [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 77, 54, 181, 207, 255, 255],
[0, 0, 73, 51, 180, 209, 255, 255], [0, 0, 54, 75, 201, 185, 255, 255]]
}
}],
country: [{
name: "curves",
value: {
preset: [[0, 0, 84, 74, 115, 105, 255, 255], [0, 0, 73, 80, 93,
124, 255, 255], [0, 0, 50, 34, 93, 105, 119, 142, 255, 255], [0, 0, 85, 85, 125,
112, 255, 255]]
}
}],
lemonpell: [{
name: "curves",
value: {
preset: [[0, 36, 80, 84, 156, 190, 255, 255], [0, 0, 255, 255],
[0, 0, 103, 105, 158, 176, 255, 255], [0, 19, 107, 83, 198, 196, 255, 255]]
}
}],
joyful: [{
name: "vibrance",
value: .3
}, {
name: "saturation",
value: .4
}, {
name: "temperature",
value: -.35
}, {
name: "tint",
value: .8
}, {
name: "exposure",
value: .3
}],
"tiny dc": [{
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 79, 46, 199, 217, 255, 255],
[9, 1, 110, 126, 254, 232], [0, 46, 92, 103, 191, 158, 254, 205]]
}
}, {
name: "grain",
value: .3
}],
sheberios: [{
name: "temperature",
value: .5
}, {
name: "saturation",
value: .25
}],
superone: [{
name: "toning",
value: {
value: .8,
lightColor: "#ffd899",
darkColor: "#4d0033"
}
}, {
name: "levels",
value: {
minin: 50,
maxin: 175,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}],
tonola: [{
name: "toning",
value: {
value: .8,
lightColor: "#ddff99",
darkColor: "#4d0033"
}
}, {
name: "levels",
value: {
minin: 26,
maxin: 213,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "saturation",
value: .36
}, {
name: "temperature",
value: .22
}],
reddish: [{
name: "toning",
value: {
value: .8,
lightColor: "#ffd693",
darkColor: "#6e2500"
}
}, {
name: "contrast",
value: .3
}, {
name: "highlights",
value: 1
}],
fellowing: [{
name: "toning",
value: {
value: .8,
lightColor: "#ffd899",
darkColor: "#4d2f00"
}
}, {
name: "levels",
value: {
minin: 24,
maxin: 203,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "contrast",
value: .14
}, {
name: "saturation",
value: .3
}, {
name: "temperature",
value: .18
}],
grassland: [{
name: "toning",
value: {
value: .7,
lightColor: "#ddff99",
darkColor: "#004d19"
}
}, {
name: "levels",
value: {
minin: 18,
maxin: 227,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "contrast",
value: .16
}],
springs: [{
name: "toning",
value: {
value: 1,
lightColor: "#ddff99",
darkColor: "#001a26"
}
}, {
name: "highlights",
value: 1
}, {
name: "levels",
value: {
minin: 40,
maxin: 155,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "shadows",
value: 1
}],
justblues: [{
name: "toning",
value: {
value: .79,
lightColor: "#c6ecff",
darkColor: "#1a004d"
}
}, {
name: "levels",
value: {
minin: 16,
maxin: 189,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "saturation",
value: .2
}, {
name: "contrast",
value: .2
}],
bluesteel: [{
name: "toning",
value: {
value: .8,
lightColor: "#ffd899",
darkColor: "#1a004d"
}
}, {
name: "levels",
value: {
minin: 0,
maxin: 215,
minout: 12,
maxout: 255,
midin: 1,
mid: .5
}
}],
flowerpot: [{
name: "toning",
value: {
value: .8,
lightColor: "#ff99dd",
darkColor: "#334d00"
}
}, {
name: "levels",
value: {
minin: 22,
maxin: 215,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "vignette",
value: -.2
}],
stinker: [{
name: "toning",
value: {
value: .8,
lightColor: "#ffd899",
darkColor: "#1a004d"
}
}, {
name: "levels",
value: {
minin: 0,
maxin: 247,
minout: 8,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "brightness",
value: .14
}, {
name: "contrast",
value: .4
}],
violiin: [{
name: "contrast",
value: .32
}, {
name: "toning",
value: {
value: 1,
lightColor: "#c3a6ff",
darkColor: "#210000"
}
}, {
name: "levels",
value: {
minin: 22,
maxin: 223,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "exposure",
value: .22
}, {
name: "brightness",
value: .12
}],
blupur: [{
name: "toning",
value: {
value: .8,
lightColor: "#ff99dd",
darkColor: "#074461"
}
}, {
name: "vibrance",
value: .7
}, {
name: "contrast",
value: .3
}],
beyllo: [{
name: "vibrance",
value: 1
}, {
name: "saturation",
value: 1
}, {
name: "temperature",
value: -.55
}, {
name: "tint",
value: .1
}, {
name: "levels",
value: {
minin: 0,
maxin: 255,
minout: 24,
maxout: 249,
midin: 1,
mid: .5
}
}, {
name: "toning",
value: {
value: .76,
lightColor: "#ffd500",
darkColor: "#7d0354"
}
}, {
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 131, 115, 255, 255], [0, 0,
136, 128, 255, 255], [0, 0, 122, 145, 255, 255]]
}
}, {
name: "vignette",
value: .28
}],
wifortress: [{
name: "toning",
value: {
value: 1,
lightColor: "#6cceff",
darkColor: "#001a26"
}
}, {
name: "highlights",
value: 1
}, {
name: "levels",
value: {
minin: 40,
maxin: 155,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "shadows",
value: 1
}],
vib: [{
name: "vibrance",
value: .1
}, {
name: "saturation",
value: .5
}, {
name: "brightness",
value: .1
}, {
name: "temperature",
value: .5
}, {
name: "levels",
value: {
minin: 12,
maxin: 253,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "highlights",
value: .2
}, {
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 70, 80, 198, 181, 255, 255],
[0, 0, 140, 135, 255, 255], [0, 0, 74, 96, 200, 172, 255, 255]]
}
}, {
name: "toning",
value: {
value: .07,
lightColor: "#ffeed2",
darkColor: "#360606"
}
}, {
name: "contrast",
value: -.1
}],
ranguit: [{
name: "saturation",
value: .22
}, {
name: "temperature",
value: .96
}, {
name: "tint",
value: -.28
}, {
name: "contrast",
value: .14
}, {
name: "brightness",
value: -.2
}, {
name: "levels",
value: {
minin: 0,
maxin: 237,
minout: 56,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "toning",
value: {
value: .26,
lightColor: "#ddff99",
darkColor: "#292321"
}
}],
rangeen: [{
name: "vibrance",
value: 1
}, {
name: "saturation",
value: .46
}, {
name: "temperature",
value: .36
}, {
name: "levels",
value: {
minin: 0,
maxin: 251,
minout: 14,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "shadows",
value: .34
}, {
name: "highlights",
value: .12
}, {
name: "toning",
value: {
value: .12,
lightColor: "#79ffe0",
darkColor: "#f5166b"
}
}, {
name: "contrast",
value: -.1
}, {
name: "curves",
value: {
preset: [[0, 0, 144, 152, 255, 255], [0, 0, 136, 107, 255,
255], [0, 0, 115, 102, 255, 255], [0, 0, 106, 91, 255, 255]]
}
}],
creamlow: [{
name: "vibrance",
value: .82
}, {
name: "saturation",
value: -.24
}, {
name: "temperature",
value: 1
}, {
name: "tint",
value: .78
}, {
name: "contrast",
value: -.3
}, {
name: "levels",
value: {
minin: 40,
maxin: 247,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "highlights",
value: .64
}, {
name: "toning",
value: {
value: .29,
lightColor: "#ddff99",
darkColor: "#912709"
}
}, {
name: "curves",
value: {
preset: [[0, 0, 5, 13, 78, 83, 172, 162, 255, 255], [0, 0, 255,
255], [0, 0, 131, 120, 255, 255], [0, 0, 68, 61, 175, 184, 255, 255]]
}
}],
sven: [{
name: "vibrance",
value: .7
}, {
name: "temperature",
value: .5
}, {
name: "tint",
value: .3
}, {
name: "exposure",
value: .2
}, {
name: "contrast",
value: -.2
}, {
name: "levels",
value: {
minin: 4,
maxin: 255,
minout: 0,
maxout: 235,
midin: 1,
mid: .5
}
}, {
name: "highlights",
value: -.3
}, {
name: "shadows",
value: .3
}, {
name: "grain",
value: .3
}, {
name: "vignette",
value: .45
}],
yenely: [{
name: "tint",
value: .5
}, {
name: "levels",
value: {
minin: 0,
maxin: 235,
minout: 20,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "saturation",
value: -.62
}, {
name: "contrast",
value: -.3
}, {
name: "shadows",
value: -.6
}, {
name: "curves",
value: {
preset: [[0, 0, 148, 105, 255, 255], [0, 0, 92, 79, 128, 227,
255, 255], [0, 0, 74, 103, 119, 172, 255, 255], [0, 0, 111, 148, 255, 255]]
}
}, {
name: "highlights",
value: 1
}, {
name: "brightness",
value: .14
}, {
name: "temperature",
value: .3
}, {
name: "vibrance",
value: 1
}, {
name: "exposure",
value: -.1
}],
ragwarm: [{
name: "temperature",
value: .62
}, {
name: "levels",
value: {
minin: 32,
maxin: 255,
minout: 0,
maxout: 243,
midin: 1,
mid: .5
}
}, {
name: "highlights",
value: -.14
}, {
name: "vignette",
value: .28
}, {
name: "toning",
value: {
value: .07,
lightColor: "#99ffbb",
darkColor: "#15378f"
}
}, {
name: "curves",
value: {
preset: [[0, 0, 126, 125, 255, 255], [0, 0, 255, 255], [0, 0,
130, 121, 255, 255], [0, 0, 138, 124, 255, 255]]
}
}],
greered: [{
name: "vibrance",
value: .32
}, {
name: "temperature",
value: .4
}, {
name: "tint",
value: -.5
}, {
name: "brightness",
value: .24
}, {
name: "contrast",
value: -.1
}, {
name: "vignette",
value: .31
}, {
name: "shadows",
value: .38
}],
danligter: [{
name: "saturation",
value: .86
}, {
name: "temperature",
value: -1
}, {
name: "tint",
value: -.92
}, {
name: "brightness",
value: .22
}, {
name: "exposure",
value: .22
}, {
name: "contrast",
value: .1
}, {
name: "levels",
value: {
minin: 0,
maxin: 239,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "highlights",
value: -.12
}, {
name: "dehaze",
value: -.12
}, {
name: "toning",
value: {
value: .14,
lightColor: "#ffd899",
darkColor: "#00344d"
}
}, {
name: "curves",
value: {
preset: [[0, 0, 255, 255], [0, 0, 96, 115, 162, 194, 255, 255],
[0, 0, 101, 97, 185, 189, 255, 255], [0, 0, 144, 130, 222, 228, 255, 255]]
}
}],
trotto: [{
name: "vibrance",
value: 1
}, {
name: "saturation",
value: -.34
}, {
name: "temperature",
value: 1
}, {
name: "tint",
value: -.26
}, {
name: "levels",
value: {
minin: 24,
maxin: 229,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "shadows",
value: .14
}, {
name: "dehaze",
value: .38
}, {
name: "toning",
value: {
value: .5,
lightColor: "#46fa82",
darkColor: "#bf5a20"
}
}, {
name: "curves",
value: {
preset: [[0, 0, 66, 56, 168, 171, 255, 255], [0, 0, 68, 77,
191, 179, 255, 255], [0, 0, 73, 80, 173, 166, 255, 255], [0, 0, 82, 110, 171, 185,
255, 255]]
}
}, {
name: "vignette",
value: .14
}],
rasky: [{
name: "vibrance",
value: 1
}, {
name: "saturation",
value: 1
}, {
name: "temperature",
value: -.84
}, {
name: "tint",
value: .34
}, {
name: "dehaze",
value: .52
}, {
name: "toning",
value: {
value: .39,
lightColor: "#cbd420",
darkColor: "#d9180a"
}
}],
garage: [{
name: "tint",
value: .6
}, {
name: "saturation",
value: -.04
}, {
name: "shadows",
value: -1
}, {
name: "grain",
value: .42
}, {
name: "glamour",
value: .3
}],
travelster: [{
name: "vibrance",
value: .84
}, {
name: "saturation",
value: .66
}, {
name: "contrast",
value: .24
}, {
name: "levels",
value: {
minin: 62,
maxin: 255,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "highlights",
value: .62
}, {
name: "shadows",
value: -.3
}, {
name: "curves",
value: {
preset: [[0, 32, 136, 111, 255, 255], [0, 0, 149, 161, 255,
255], [0, 0, 148, 139, 255, 255], [0, 0, 99, 173, 164, 213, 255, 255]]
}
}, {
name: "toning",
value: {
value: .3,
lightColor: "#ffd899",
darkColor: "#334d00"
}
}, {
name: "sharpen",
value: .24
}, {
name: "grain",
value: .23
}, {
name: "temperature",
value: .72
}, {
name: "vignette",
value: .13
}],
strawberry: [{
name: "fill",
value: {
value: .5,
mode: "softLight",
fillColor: "#ff0000"
}
}],
clementine: [{
name: "fill",
value: {
value: .5,
mode: "softLight",
fillColor: "#ff9e00"
}
}],
pear: [{
name: "fill",
value: {
value: .5,
mode: "softLight",
fillColor: "#aaff00"
}
}],
apple: [{
name: "fill",
value: {
value: .5,
mode: "softLight",
fillColor: "#00ff55"
}
}],
blueberry: [{
name: "fill",
value: {
value: .5,
mode: "softLight",
fillColor: "#00aaff"
}
}],
grapes: [{
name: "fill",
value: {
value: .5,
mode: "softLight",
fillColor: "#5500ff"
}
}],
dragon: [{
name: "fill",
value: {
value: .5,
mode: "softLight",
fillColor: "#ff00aa"
}
}],
punch: [{
name: "curves",
value: {
preset: [[0, 0, 80, 64, 173, 193, 255, 255], [0, 0, 255, 255],
[0, 0, 255, 255], [0, 0, 255, 255]]
}
}, {
name: "vibrance",
value: .5
}],
bright: [{
name: "highlights",
value: -.3
}, {
name: "shadows",
value: .5
}, {
name: "levels",
value: {
minin: 0,
maxin: 215,
minout: 10,
maxout: 255,
midin: 1,
mid: .5
}
}],
contrast: [{
name: "contrast",
value: .2
}, {
name: "highlights",
value: .2
}, {
name: "levels",
value: {
minin: 20,
maxin: 215,
minout: 0,
maxout: 255,
midin: 1,
mid: .5
}
}, {
name: "shadows",
value: .4
}],
vivid: [{
name: "vibrance",
value: .4
}, {
name: "shadows",
value: .25
}],
clairify: [{
name: "clarity",
value: .6
}, {
name: "sharpen",
value: .1
}, {
name: "glamour",
value: .2
}]
};
class CanvasSQ {
constructor(e=0, t=0) {
this.x = e,
this.y = t
}
distanceTo(e) {
return Math.sqrt(Math.pow(this.x - e.x, 2) + Math.pow(this.y - e.y,
2))
}
angleTo(e) {
let t = -(this.x - e.x)
, r = this.y - e.y
, n = 360 - Math.atan2(r, t) * (180 / Math.PI);
return n < 0 && (n += 360),
n > 360 && (n -= 360),
n
}
dot(e) {
return this.x * e.x + this.y * e.y
}
lengthSQ() {
return this.dot(this)
}
length() {
return Math.sqrt(this.lengthSQ())
}
hypot2() {
return this.dot(this)
}
hypot() {
return Math.hypot(this.x, this.y)
}
add(e) {
return e ? e instanceof CanvasSQ ? new CanvasSQ(this.x + e.x,this.y
+ e.y) : new CanvasSQ(this.x + e,this.y + e) : this
}
neg(e) {
return e instanceof CanvasSQ ? new CanvasSQ(this.x - e.x,this.y -
e.y) : new CanvasSQ(this.x - e,this.y - e)
}
mul(e) {
return e instanceof CanvasSQ ? new CanvasSQ(this.x * e.x,this.y *
e.y) : new CanvasSQ(this.x * e,this.y * e)
}
rotateAround(e, t) {
let r = Math.sin(t)
, n = Math.cos(t)
, i = this.x - e.x
, o = this.y - e.y
, s = i * r + o * n;
return new CanvasSQ(i * n - o * r + e.x,s + e.y)
}
equalTo(e) {
return this.x === e.x && this.y === e.y
}
clone() {
return new CanvasSQ(this.x,this.y)
}
}
class interpolate {
constructor(e, t) {
var r, n, i, o, s, a, l, c, u, d, p, h, f;
if (null != e && null != t) {
for (c = e.length - 1,
o = [],
p = [],
l = [],
d = [],
h = [],
n = [],
r =
[],
i =
[],
a =
[],
u =
[],
s =
0; 0 <= c ? s < c : s > c; 0 <= c ? s += 1 : s -= 1)
o[s] = e[s + 1] - e[s],
a[s] = t[s + 1] - t[s],
u[s] = a[s] / o[s];
for (s = 1; 1 <= c ? s < c : s > c; 1 <= c ? s += 1 : s -= 1)
p[s] = 3 / o[s] * (t[s + 1] - t[s]) - 3 / o[s - 1] * (t[s]
- t[s - 1]);
for (l[0] = 1,
d[0] = 0,
h[0] = 0,
s = 1; 1 <= c ? s < c : s > c; 1 <= c ? s += 1 : s -= 1)
l[s] = 2 * (e[s + 1] - e[s - 1]) - o[s - 1] * d[s - 1],
d[s] = o[s] / l[s],
h[s] = (p[s] - o[s - 1] * h[s - 1]) / l[s];
for (l[c] = 1,
h[c] = 0,
n[c] = 0,
s = f = c - 1; f <= 0 ? s <= 0 : s >= 0; f <= 0 ? s += 1 : s -=
1)
n[s] = h[s] - d[s] * n[s + 1],
r[s] = (t[s + 1] - t[s]) / o[s] - o[s] * (n[s + 1] + 2 *
n[s]) / 3,
i[s] = (n[s + 1] - n[s]) / (3 * o[s]);
this.x = e.slice(0, c + 1),
this.a = t.slice(0, c),
this.b = r,
this.c = n.slice(0, c),
this.d = i
}
}
interpolate(e) {
var t, r, n;
for (r = n = this.x.length - 1; (n <= 0 ? r <= 0 : r >= 0) && !
(this.x[r] <= e); n <= 0 ? r += 1 : r -= 1)
;
return t = e - this.x[r],
this.a[r] + this.b[r] * t + this.c[r] * Math.pow(t, 2) + this.d[r]
* Math.pow(t, 3)
}
}
var fragment = "#define GLSLIFY 1\nprecision highp float;varying vec2
vTextureCoord;uniform sampler2D uSampler;uniform sampler2D paletteMap;void main()
{lowp vec4 base=texture2D(uSampler,vTextureCoord.xy);float
r=texture2D(paletteMap,vec2(base.r,0)).r;float
g=texture2D(paletteMap,vec2(base.g,0)).g;float
b=texture2D(paletteMap,vec2(base.b,0)).b;gl_FragColor=vec4(r,g,b,base.a);}";
class Mapping extends Filter$2 {
constructor(e) {
super(null, fragment),
this.paletteMap = e
}
get paletteMap() {
return this.uniforms.paletteMap
}
set paletteMap(e) {
const t = new Uint8Array(Array.from(e.data));
this.uniforms.paletteMap = Texture.fromBuffer(t, t.length / 4, 1)
}
}
class Curves extends Filter$2 {
constructor(e) {
super(null, null),
this._imageData = new ImageData(256,1),
this.options = e
}
apply(e, t, r, n, i) {
this._mapping.apply(e, t, r, n)
}
update() {
let e = this._imageData;
interpolateCanvas.fillPaletteMap(Curves.createCurveSet(this.uniforms.options), e),
this.uniforms.paletteMap = e,
this._mapping ? this._mapping.paletteMap = this.uniforms.paletteMap
: this._mapping = new Mapping(this.uniforms.paletteMap)
}
get options() {
return this.uniforms.options
}
set options(e) {
this.uniforms.options = e,
this.update()
}
static createCurveSet(e) {
const t = new Array
, r = new Array
, n = new Array
, i = new Array;
for (let o = 0; o < e.preset[0].length; o += 2)
t.push(new CanvasSQ(e.preset[0][o],e.preset[0][o + 1]));
for (let o = 0; o < e.preset[1].length; o += 2)
r.push(new CanvasSQ(e.preset[1][o],e.preset[1][o + 1]));
for (let o = 0; o < e.preset[2].length; o += 2)
n.push(new CanvasSQ(e.preset[2][o],e.preset[2][o + 1]));
for (let o = 0; o < e.preset[3].length; o += 2)
i.push(new CanvasSQ(e.preset[3][o],e.preset[3][o + 1]));
return new interpolateCanvas(1,t,r,n,i)
}
}
class interpolateCanvas {
constructor(e=255, t=[], r=[], n=[], i=[]) {
this.scale = e,
this.rgb = t,
this.red = r,
this.green = n,
this.blue = i,
this.percent = 1
}
static getInterpolation(e, t) {
let r = []
, n = []
, i = new Float32Array(256);
for (var o = 0; o < t.length; o++)
r.push(t[o].x * e),
n.push(t[o].y * e);
let s = new interpolate(r,n);
for (var a = 0; a < Math.ceil(r[0]); a++)
i[a] = n[0];
for (a = Math.ceil(r[0]); a < Math.ceil(r[r.length - 1]); a++)
i[a] = s.interpolate(a);
for (a = Math.ceil(r[r.length - 1]); a < 256; a++)
i[a] = n[n.length - 1];
return i
}
static fillPaletteMap(e, t) {
let r = interpolateCanvas.getInterpolation(e.scale, e.rgb)
, n = interpolateCanvas.getInterpolation(e.scale, e.red)
, i = interpolateCanvas.getInterpolation(e.scale, e.green)
, o = interpolateCanvas.getInterpolation(e.scale, e.blue);
for (let s = 0; s < 256; ++s) {
let a = s - r[s];
t.data[4 * s] = s - Math.round((s - (n[s] - a)) * e.percent),
t.data[4 * s + 1] = s - Math.round((s - (i[s] - a)) *
e.percent),
t.data[4 * s + 2] = s - Math.round((s - (o[s] - a)) *
e.percent)
}
}
}
class LevelMapping {
constructor(e=0, t=255, r=0, n=255, i=1, o=.5) {
this.minin = e,
this.maxin = t,
this.minout = r,
this.maxout = n,
this.midin = i,
this.mid = o,
this.map = e => (e = (e - this.minin) / (this.maxin - this.minin),
e = Math.pow(e, this.midin),
(e = this.minout + e * (this.maxout - this.minout)) > this.maxout ?
e = this.maxout : e < this.minout && (e = this.minout),
Math.round(e))
}
reset() {
this.minout = 0,
this.maxout = 255,
this.midin = 1,
this.minin = 0,
this.maxin = 255,
this.mid = .5
}
isFlat() {
return Boolean(0 == this.minout && 255 == this.maxout && .5 ==
this.mid && 0 == this.minin && 255 == this.maxin)
}
setMid(e) {
this.mid = (e - this.minin) / (this.maxin - this.minin),
this.midin = this.midToIn(this.mid)
}
midToIn(e) {
return Math.min(Math.max(Math.pow(9.99, 2 * e - 1), .1), 9.99)
}
static fillPaletteMap(e, t) {
for (let r = 0; r < 256; ++r) {
let n = e.map(r);
t.data[4 * r] = n,
t.data[4 * r + 1] = n,
t.data[4 * r + 2] = n
}
}
static fillRGBPaletteMap(e, t, r, n) {
for (let i = 0; i < 256; ++i)
n.data[4 * i] = e ? e.map(i) : i,
n.data[4 * i + 1] = t ? t.map(i) : i,
n.data[4 * i + 2] = r ? r.map(i) : i
}
}
class Levels extends Filter$2 {
constructor(e) {
super(null, null),
this._imageData = new ImageData(256,1),
this.options = e
}
apply(e, t, r, n, i) {
this._mapping.apply(e, t, r, n)
}
update() {
let e = this._imageData;
this.uniforms.paletteMap = e,
LevelMapping.fillPaletteMap(this.uniforms.options, e),
this._mapping ? this._mapping.paletteMap = this.uniforms.paletteMap
: this._mapping = new Mapping(this.uniforms.paletteMap)
}
get options() {
return this.uniforms.options
}
set options(e) {
this.uniforms.options = e,
this.update()
}
}
class Preset extends ColorEffectsFilter {
constructor(e) {
super(null, null),
this.filtersArr = [],
this.effectName = e,
this.effectType = "preset",
this.filtersArr = presetConfig[e].map((e => {
if ("curves" === e.name)
return new Curves(e.value);
if ("fill" === e.name) {
const {value: t, fillColor: r, mode: n} = e.value;
return new filters$1[e.name](t,r,n)
}
if ("levels" === e.name) {
const t = e.value
, r = new LevelMapping(Math.round(1 *
t.minin),Math.round(255 - 1 * (255 - t.maxin)));
return new Levels(r)
}
if ("toning" === e.name) {
const {value: t, lightColor: r, darkColor: n} = e.value;
return new filters$1[e.name](t,r,n)
}
return "desaturate" === e.name ? new filters$1.saturation(-1) :
"vignette" === e.name ? e.value < 0 ? new filters$1.vignetteWhite(e.value) : new
filters$1.vignetteBlack(Math.abs(e.value)) : new filters$1[e.name](e.value)
}
))
}
apply(e, t, r, n, i) {
const o = e.getFilterTexture()
, s = [o];
for (let a = 0; a < this.filtersArr.length; a++)
if (0 === a)
this.filtersArr[a].apply(e, t, o, 1, i);
else {
const t = e.getFilterTexture();
s.push(t),
this.filtersArr[a].apply(e, s[a - 1], t, 1)
}
e.applyFilter(this, s[s.length - 1], r, n),
s.reverse().map((t => {
e.returnFilterTexture(t)
}
))
}
}
const filters$1 = {
vibrance: Vibrance,
saturation: Saturation$1,
temperature: Temperature,
tint: Tint,
hue: Hue$1,
brightness: Brightness,
exposure: Exposure,
contrast: Contrast,
black: Black,
white: White,
highlights: Highlights,
shadows: Shadows,
sharpen: Sharpen,
clarity: Clarity,
smooth: Smooth,
blur: Blur,
grain: Grain,
vignetteWhite: VignetteWhite,
vignetteBlack: VignetteBlack,
glamour: Glamour,
bloom: Bloom,
dehaze: Dehaze,
toning: Toning,
fill: Fill
}
, effects = Object.freeze(Object.defineProperty({
__proto__: null,
Black: Black,
Bloom: Bloom,
Blur: Blur,
Brightness: Brightness,
Clarity: Clarity,
Contrast: Contrast,
Dehaze: Dehaze,
Exposure: Exposure,
Fill: Fill,
Glamour: Glamour,
Grain: Grain,
Highlights: Highlights,
Hue: Hue$1,
Preset: Preset,
Saturation: Saturation$1,
Shadows: Shadows,
Sharpen: Sharpen,
Smooth: Smooth,
Temperature: Temperature,
Tint: Tint,
Toning: Toning,
Vibrance: Vibrance,
VignetteBlack: VignetteBlack,
VignetteWhite: VignetteWhite,
White: White,
filters: filters$1,
presetConfig: presetConfig
}, Symbol.toStringTag, {
value: "Module"
}));
function useElementFilter(e, t) {
reactExports.useEffect(( () => {
if (t.filters) {
const r = e.filters || [];
t.filters.forEach((t => {
const n = (e.filters || []).find((e => e.name === t.name));
if (n)
Object.assign(n.uniforms, {
...t.params
}),
n.enabled = t.enabled;
else {
const e = new effects[t.name];
e.name = t.name,
Object.assign(e.uniforms, {
...t.params
}),
e.enabled = t.enabled,
r.push(e)
}
}
)),
e.filters = [...r]
} else
e.filters = []
}
), [t._filtersDirty])
}
const VertexShader$1 = "\n attribute vec2 aVertexPosition;\n
attribute vec2 aTextureCoord;\n uniform mat3 projectionMatrix;\n varying vec2
vTextureCoord;\n void main(void){\n gl_Position = vec4((projectionMatrix
* vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord =
aTextureCoord;\n }\n"
, FragmentShader$1 = "\nprecision mediump float;\nuniform sampler2D
uSampler;\nuniform vec3 color;\nuniform float videowidth;\nuniform float
videoheight;\nuniform int filterType;\nuniform float gridSize;\nuniform float
lightLevel;\nuniform float emergence; // 羽化强度\nvarying vec2 vTextureCoord;\n\n// 外边
框 xx\nuniform vec4 filterClamp;\nvec2 uThickness = vec2(-0.00390625, -0.00390625);\
nconst float DOUBLE_PI = 2. * 3.14159265358979323846264;\nconst float ANGLE_STEP =
0.6283185;\nfloat uAlpha = 1.0;\nvec4 uColor = vec4(1.0,1.0,1.0,1.0);\n\nfloat
outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.)
{\n return 0.;\n }\n\n vec4 displacedColor;\n vec2 displacedPos;\n float
maxAlpha = 0.;\n\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ANGLE_STEP)
{\n displacedPos.x = vTextureCoord.x + uThickness.x * cos(angle);\n
displacedPos.y = vTextureCoord.y + uThickness.y * sin(angle);\n displacedColor
= texture2D(uSampler, clamp(displacedPos, filterClamp.xy, filterClamp.zw));\n
maxAlpha = max(maxAlpha, displacedColor.a);\n }\n\n return maxAlpha;\n}\n\nvec4
outlineMain(vec4 sourceColor) {\n vec4 contentColor = sourceColor * 1.0;\n float
outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vTextureCoord.xy) * (1.-
sourceColor.a);\n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha,
outlineAlpha);\n return contentColor + outlineColor;\n}\n// END 外边框\n\nfloat
rgb2cb(float r, float g, float b){\n return 0.5 + -0.168736*r - 0.331264*g +
0.5*b;\n}\nfloat rgb2cr(float r, float g, float b){\n return 0.5 + 0.5*r -
0.418688*g - 0.081312*b;\n}\nfloat smoothclip(float low, float high, float x){\n
if (x <= low){\n return 0.0;\n }\n if(x >= high){\n return 1.0;\n }\n
return (x-low)/(high-low);\n}\nvec4 greenscreen(vec4 colora, float Cb_key, float
Cr_key, float tola, float tolb, float clipBlack, float clipWhite){\n float cb =
rgb2cb(colora.r,colora.g,colora.b);\n float cr =
rgb2cr(colora.r,colora.g,colora.b);\n float alpha = distance(vec2(cb, cr),
vec2(Cb_key, Cr_key));\n alpha = smoothclip(tola, tolb, alpha);\n\n float r =
max(gl_FragColor.r - (1.0-alpha)*color.r, 0.0);\n float g = max(gl_FragColor.g -
(1.0-alpha)*color.g, 0.0);\n float b = max(gl_FragColor.b - (1.0-alpha)*color.b,
0.0);\n\n // alpha < 0.5\n if(alpha < clipBlack){\n alpha = r = g = b = 0.0;\n
} else {\n alpha = 1.0;\n }\n\n // alpha > 1.0\n if(alpha > clipWhite){\n
alpha = 1.0;\n }\n\n // // 1.0 < 1.0\n // if(clipWhite < 1.0){\n // alpha =
alpha/max(clipWhite, 0.9);\n // }\n\n return vec4(r,g,b,alpha);\n}\n\nfloat
u_threshold=1.0;\nfloat u_clipBlack=0.5;\nfloat u_clipWhite=1.0;\nvoid main()\n{\n\
n vec4 frag = texture2D(uSampler, vTextureCoord);\n\n gl_FragColor = frag;\n\
n // 绿幕\n float tola = 0.0;\n float tolb = u_threshold/2.0;\n float cb_key =
rgb2cb(color.r, color.g, color.b);\n float cr_key = rgb2cr(color.r, color.g,
color.b);\n gl_FragColor = greenscreen(gl_FragColor, cb_key, cr_key, tola, tolb,
u_clipBlack, u_clipWhite);\n\n // 去掉旋转后黑色的背景\n if(gl_FragColor.r == 0.0 &&
gl_FragColor.g == 0.0 && gl_FragColor.b == 0.0) {\n gl_FragColor.a = 0.0;\n }\
n\n if(filterType==1){\n //灰阶\n float gray =
0.2989*gl_FragColor.r+0.5870*gl_FragColor.g+0.1140*gl_FragColor.b;\n
gl_FragColor = vec4(gray,gray,gray , gl_FragColor.a);\n }else if(filterType==2){\n
//模糊\n vec3 tColor2 = texture2D( uSampler,
vec2(vTextureCoord[0]+(1.0/videowidth) , vTextureCoord[1]) ).rgb;\n vec3 tColor3
= texture2D( uSampler, vec2(vTextureCoord[0]-(1.0/videowidth) ,
vTextureCoord[1]) ).rgb;\n vec3 tColor4 = texture2D( uSampler,
vec2(vTextureCoord[0]+(1.0/videowidth) ,
vTextureCoord[1]+(1.0/videoheight)) ).rgb;\n vec3 tColor5 = texture2D( uSampler,
vec2(vTextureCoord[0]-(1.0/videowidth) ,
vTextureCoord[1]-(1.0/videoheight)) ).rgb;\n vec3 tColor6 = texture2D( uSampler,
vec2(vTextureCoord[0]+(1.0/videowidth) ,
vTextureCoord[1]-(1.0/videoheight)) ).rgb;\n vec3 tColor7 = texture2D( uSampler,
vec2(vTextureCoord[0]-(1.0/videowidth) ,
vTextureCoord[1]+(1.0/videoheight)) ).rgb;\n vec3 tColor8 = texture2D( uSampler,
vec2(vTextureCoord[0] , vTextureCoord[1]+(1.0/videoheight)) ).rgb;\n vec3
tColor9 = texture2D( uSampler, vec2(vTextureCoord[0] ,
vTextureCoord[1]+(1.0/videoheight)) ).rgb;\n vec3 tColor10 =
texture2D( uSampler, vec2(vTextureCoord[0]+(2.0/videowidth) ,
vTextureCoord[1]) ).rgb;\n vec3 tColor11 = texture2D( uSampler,
vec2(vTextureCoord[0]+(2.0/videowidth) , vTextureCoord[1]) ).rgb;\n gl_FragColor
=
vec4( (gl_FragColor.r+tColor2[0]+tColor3[0]+tColor4[0]+tColor5[0]+tColor6[0]+tColor
7[0]+tColor8[0]+tColor9[0]+tColor10[0]+tColor11[0])/11.0,\n
(gl_FragColor.g+tColor2[1]+tColor3[1]+tColor4[1]+tColor5[1]+tColor6[1]+tColor7[1]+t
Color8[1]+tColor9[1]+tColor10[1]+tColor11[1])/11.0,\n
(gl_FragColor.b+tColor2[2]+tColor3[2]+tColor4[2]+tColor5[2]+tColor6[2]+tColor7[2]+t
Color8[2]+tColor9[2]+tColor10[2]+tColor11[2])/11.0,\n gl_FragColor.a);\n }else
if(filterType==3){\n // 变亮\n float brightr=gl_FragColor.r+lightLevel;\n
float brightg=gl_FragColor.g+lightLevel;\n float
brightb=gl_FragColor.b+lightLevel;\n gl_FragColor = vec4(brightr,brightg,brightb
, gl_FragColor.a);\n }else if(filterType==4){\n // 反像素\n float reverser=1.0
- gl_FragColor.r;\n float reverseg=1.0 - gl_FragColor.g;\n float reverseb=1.0
- gl_FragColor.b;\n gl_FragColor =
vec4(reverser,reverseg,reverseb,gl_FragColor.a);\n }else if(filterType==5){\
n // 噪点\n float dx = fract(sin(dot(vTextureCoord ,vec2(12.9898,78.233))) *
43758.5453);\n vec3 cResult = gl_FragColor.rgb + gl_FragColor.rgb * clamp( 0.1 +
dx, 0.0, 1.0 );\n vec2 sc = vec2( sin( vTextureCoord.y * 4096.0 ),
cos( vTextureCoord.y * 4096.0 ) );\n cResult += gl_FragColor.rgb * vec3( sc.x,
sc.y, sc.x ) * 0.025;\n cResult = gl_FragColor.rgb + clamp( 0.35, 0.0,1.0 ) *
( cResult - gl_FragColor.rgb );\n if( false ) {\n cResult = vec3( cResult.r
* 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );\n }\n float
oldr=0.393*cResult[0]+0.769*cResult[1]+0.189*cResult[2];\n float
oldg=0.349*cResult[0]+0.686*cResult[1]+0.168*cResult[2];\n float
oldb=0.272*cResult[0]+0.534*cResult[1]+0.131*cResult[2];\n gl_FragColor = vec4(
oldr,oldg,oldb , gl_FragColor.a);\n }else if(filterType==6){\n //网点\n float
average = ( gl_FragColor.r + gl_FragColor.g + gl_FragColor.b ) / 2.0;\n float s
= sin( 0.5 ), c = cos( 0.5 );\n vec2 tex = vTextureCoord.xy *
vec2(videowidth,videoheight) - vec2(0,0);\n vec2 point = vec2( c * tex.x - s *
tex.y, s * tex.x + c * tex.y ) * gridSize;\n float pattern = ( sin( point.x ) *
sin( point.y ) ) * 4.0;\n float seed = average * 10.0 - 5.0 + pattern ;\n
gl_FragColor =
vec4( seed*0.3+gl_FragColor.r*0.7,seed*0.3+gl_FragColor.g*0.7 ,seed*0.3+gl_FragCol
or.b*0.7, gl_FragColor.a );\n }else if(filterType==7){\n //纯色\n vec3 tColor
= texture2D(uSampler, vTextureCoord.xy).rgb;\n gl_FragColor =
vec4(gl_FragColor.r + tColor[0], gl_FragColor.g + tColor[1], gl_FragColor.b +
tColor[2], gl_FragColor.a);\n }else if(filterType==8) {\n // 如果颜色不是完全黑色,则保留,否则设
为透明\n vec3 tColor = texture2D(uSampler, vTextureCoord.xy).rgb;\n float
colorDifference = distance(tColor, color);\n if (colorDifference < emergence) {\
n // iscard; // 丢弃完全黑色的片段\n // gl_FragColor = frag;\n gl_FragColor.a
= 0.0;\n // frag.a = 0.0;\n } else {\n gl_FragColor = frag;\n }\
n }\n}\n";
class ScreenFilter extends Filter$2 {
constructor(e) {
e = Object.assign({
color: [0, 1, .0015176349176470587],
filterType: 0,
lightLevel: .2,
gridSize: .8,
emergence: .1
}, e),
super(VertexShader$1, FragmentShader$1, {
...e
}),
this.id = ""
}
setTexture(e) {
e.baseTexture.mipmap = MIPMAP_MODES.OFF,
this.uniforms.texture = e
}
get filterType() {
return this.uniforms.filterType
}
set filterType(e) {
this.uniforms.filterType = e
}
get lightLevel() {
return this.uniforms.lightLevel
}
set lightLevel(e) {
this.uniforms.lightLevel = e
}
get gridSize() {
return this.uniforms.gridSize
}
set gridSize(e) {
this.uniforms.gridSize = e
}
get emergence() {
return this.uniforms.emergence
}
set emergence(e) {
this.uniforms.emergence = e
}
get color() {
return this.uniforms.color
}
set color(e) {
this.uniforms.color = e
}
}
ScreenFilter.filterType = "ScreenFilterParams";
var lib$2 = {}
, gif$1 = {}
, lib$1 = {};
Object.defineProperty(lib$1, "__esModule", {
value: !0
}),
lib$1.loop = lib$1.conditional = lib$1.parse = void 0;
var parse$2 = function e(t, r) {
var n = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : {}
, i = arguments.length > 3 && void 0 !== arguments[3] ?
arguments[3] : n;
if (Array.isArray(r))
r.forEach((function(r) {
return e(t, r, n, i)
}
));
else if ("function" == typeof r)
r(t, n, i, e);
else {
var o = Object.keys(r)[0];
Array.isArray(r[o]) ? (i[o] = {},
e(t, r[o], n, i[o])) : i[o] = r[o](t, n, i, e)
}
return n
};
lib$1.parse = parse$2;
var conditional = function(e, t) {
return function(r, n, i, o) {
t(r, n, i) && o(r, e, n, i)
}
};
lib$1.conditional = conditional;
var loop$1 = function(e, t) {
return function(r, n, i, o) {
for (var s = [], a = r.pos; t(r, n, i); ) {
var l = {};
if (o(r, e, n, l),
r.pos === a)
break;
a = r.pos,
s.push(l)
}
return s
}
};
lib$1.loop = loop$1;
var uint8 = {};
Object.defineProperty(uint8, "__esModule", {
value: !0
}),
uint8.readBits = uint8.readArray = uint8.readUnsigned = uint8.readString =
uint8.peekBytes = uint8.readBytes = uint8.peekByte = uint8.readByte =
uint8.buildStream = void 0;
var buildStream = function(e) {
return {
data: e,
pos: 0
}
};
uint8.buildStream = buildStream;
var readByte = function() {
return function(e) {
return e.data[e.pos++]
}
};
uint8.readByte = readByte;
var peekByte = function() {
var e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : 0;
return function(t) {
return t.data[t.pos + e]
}
};
uint8.peekByte = peekByte;
var readBytes = function(e) {
return function(t) {
return t.data.subarray(t.pos, t.pos += e)
}
};
uint8.readBytes = readBytes;
var peekBytes = function(e) {
return function(t) {
return t.data.subarray(t.pos, t.pos + e)
}
};
uint8.peekBytes = peekBytes;
var readString = function(e) {
return function(t) {
return Array.from(readBytes(e)(t)).map((function(e) {
return String.fromCharCode(e)
}
)).join("")
}
};
uint8.readString = readString;
var readUnsigned = function(e) {
return function(t) {
var r = readBytes(2)(t);
return e ? (r[1] << 8) + r[0] : (r[0] << 8) + r[1]
}
};
uint8.readUnsigned = readUnsigned;
var readArray = function(e, t) {
return function(r, n, i) {
for (var o = "function" == typeof t ? t(r, n, i) : t, s =
readBytes(e), a = new Array(o), l = 0; l < o; l++)
a[l] = s(r);
return a
}
};
uint8.readArray = readArray;
var subBitsTotal = function(e, t, r) {
for (var n = 0, i = 0; i < r; i++)
n += e[t + i] && Math.pow(2, r - i - 1);
return n
}
, readBits = function(e) {
return function(t) {
for (var r = readByte()(t), n = new Array(8), i = 0; i < 8; i++)
n[7 - i] = !!(r & 1 << i);
return Object.keys(e).reduce((function(t, r) {
var i = e[r];
return i.length ? t[r] = subBitsTotal(n, i.index, i.length) :
t[r] = n[i.index],
t
}
), {})
}
};
uint8.readBits = readBits,
function(e) {
Object.defineProperty(e, "__esModule", {
value: !0
}),
e.default = void 0;
var t = lib$1
, r = uint8
, n = {
blocks: function(e) {
for (var t = [], n = e.data.length, i = 0, o = (0,
r.readByte)()(e); 0 !== o && o; o = (0,
r.readByte)()(e)) {
if (e.pos + o >= n) {
var s = n - e.pos;
t.push((0,
r.readBytes)(s)(e)),
i += s;
break
}
t.push((0,
r.readBytes)(o)(e)),
i += o
}
for (var a = new Uint8Array(i), l = 0, c = 0; c < t.length; c+
+)
a.set(t[c], l),
l += t[c].length;
return a
}
}
, i = (0,
t.conditional)({
gce: [{
codes: (0,
r.readBytes)(2)
}, {
byteSize: (0,
r.readByte)()
}, {
extras: (0,
r.readBits)({
future: {
index: 0,
length: 3
},
disposal: {
index: 3,
length: 3
},
userInput: {
index: 6
},
transparentColorGiven: {
index: 7
}
})
}, {
delay: (0,
r.readUnsigned)(!0)
}, {
transparentColorIndex: (0,
r.readByte)()
}, {
terminator: (0,
r.readByte)()
}]
}, (function(e) {
var t = (0,
r.peekBytes)(2)(e);
return 33 === t[0] && 249 === t[1]
}
))
, o = (0,
t.conditional)({
image: [{
code: (0,
r.readByte)()
}, {
descriptor: [{
left: (0,
r.readUnsigned)(!0)
}, {
top: (0,
r.readUnsigned)(!0)
}, {
width: (0,
r.readUnsigned)(!0)
}, {
height: (0,
r.readUnsigned)(!0)
}, {
lct: (0,
r.readBits)({
exists: {
index: 0
},
interlaced: {
index: 1
},
sort: {
index: 2
},
future: {
index: 3,
length: 2
},
size: {
index: 5,
length: 3
}
})
}]
}, (0,
t.conditional)({
lct: (0,
r.readArray)(3, (function(e, t, r) {
return Math.pow(2, r.descriptor.lct.size + 1)
}
))
}, (function(e, t, r) {
return r.descriptor.lct.exists
}
)), {
data: [{
minCodeSize: (0,
r.readByte)()
}, n]
}]
}, (function(e) {
return 44 === (0,
r.peekByte)()(e)
}
))
, s = (0,
t.conditional)({
text: [{
codes: (0,
r.readBytes)(2)
}, {
blockSize: (0,
r.readByte)()
}, {
preData: function(e, t, n) {
return (0,
r.readBytes)(n.text.blockSize)(e)
}
}, n]
}, (function(e) {
var t = (0,
r.peekBytes)(2)(e);
return 33 === t[0] && 1 === t[1]
}
))
, a = (0,
t.conditional)({
application: [{
codes: (0,
r.readBytes)(2)
}, {
blockSize: (0,
r.readByte)()
}, {
id: function(e, t, n) {
return (0,
r.readString)(n.blockSize)(e)
}
}, n]
}, (function(e) {
var t = (0,
r.peekBytes)(2)(e);
return 33 === t[0] && 255 === t[1]
}
))
, l = (0,
t.conditional)({
comment: [{
codes: (0,
r.readBytes)(2)
}, n]
}, (function(e) {
var t = (0,
r.peekBytes)(2)(e);
return 33 === t[0] && 254 === t[1]
}
))
, c = [{
header: [{
signature: (0,
r.readString)(3)
}, {
version: (0,
r.readString)(3)
}]
}, {
lsd: [{
width: (0,
r.readUnsigned)(!0)
}, {
height: (0,
r.readUnsigned)(!0)
}, {
gct: (0,
r.readBits)({
exists: {
index: 0
},
resolution: {
index: 1,
length: 3
},
sort: {
index: 4
},
size: {
index: 5,
length: 3
}
})
}, {
backgroundColorIndex: (0,
r.readByte)()
}, {
pixelAspectRatio: (0,
r.readByte)()
}]
}, (0,
t.conditional)({
gct: (0,
r.readArray)(3, (function(e, t) {
return Math.pow(2, t.lsd.gct.size + 1)
}
))
}, (function(e, t) {
return t.lsd.gct.exists
}
)), {
frames: (0,
t.loop)([i, a, l, o, s], (function(e) {
var t = (0,
r.peekByte)()(e);
return 33 === t || 44 === t
}
))
}];
e.default = c
}(gif$1);
var deinterlace$1 = {};
Object.defineProperty(deinterlace$1, "__esModule", {
value: !0
}),
deinterlace$1.deinterlace = void 0;
var deinterlace = function(e, t) {
for (var r, n, i, o = new Array(e.length), s = e.length / t, a = [0, 4,
2, 1], l = [8, 8, 4, 2], c = 0, u = 0; u < 4; u++)
for (var d = a[u]; d < s; d += l[u])
r = d,
n = c,
i = void 0,
i = e.slice(n * t, (n + 1) * t),
o.splice.apply(o, [r * t, t].concat(i)),
c++;
return o
};
deinterlace$1.deinterlace = deinterlace;
var lzw$1 = {};
Object.defineProperty(lzw$1, "__esModule", {
value: !0
}),
lzw$1.lzw = void 0;
var lzw = function(e, t, r) {
var n, i, o, s, a, l, c, u, d, p, h, f, m, g, y, v, b = 4096, x = r, _
= new Array(r), E = new Array(b), T = new Array(b), C = new Array(4097);
for (a = (i = 1 << (p = e)) + 1,
n = i + 2,
c = -1,
o = (1 << (s = p + 1)) - 1,
u = 0; u < i; u++)
E[u] = 0,
T[u] = u;
for (h = f = m = g = y = v = 0,
d = 0; d < x; ) {
if (0 === g) {
if (f < s) {
h += t[v] << f,
f += 8,
v++;
continue
}
if (u = h & o,
h >>= s,
f -= s,
u > n || u == a)
break;
if (u == i) {
o = (1 << (s = p + 1)) - 1,
n = i + 2,
c = -1;
continue
}
if (-1 == c) {
C[g++] = T[u],
c = u,
m = u;
continue
}
for (l = u,
u == n && (C[g++] = m,
u = c); u > i; )
C[g++] = T[u],
u = E[u];
m = 255 & T[u],
C[g++] = m,
n < b && (E[n] = c,
T[n] = m,
!(++n & o) && n < b && (s++,
o += n)),
c = l
}
g--,
_[y++] = C[g],
d++
}
for (d = y; d < x; d++)
_[d] = 0;
return _
};
lzw$1.lzw = lzw,
Object.defineProperty(lib$2, "__esModule", {
value: !0
});
var decompressFrames_1 = lib$2.decompressFrames = lib$2.decompressFrame =
parseGIF_1 = lib$2.parseGIF = void 0
, _gif = _interopRequireDefault$8(gif$1)
, _jsBinarySchemaParser = lib$1
, _uint = uint8
, _deinterlace = deinterlace$1
, _lzw = lzw$1;
function _interopRequireDefault$8(e) {
return e && e.__esModule ? e : {
default: e
}
}
var parseGIF = function(e) {
var t = new Uint8Array(e);
return (0,
_jsBinarySchemaParser.parse)((0,
_uint.buildStream)(t), _gif.default)
}
, parseGIF_1 = lib$2.parseGIF = parseGIF
, generatePatch = function(e) {
for (var t = e.pixels.length, r = new Uint8ClampedArray(4 * t), n = 0;
n < t; n++) {
var i = 4 * n
, o = e.pixels[n]
, s = e.colorTable[o] || [0, 0, 0];
r[i] = s[0],
r[i + 1] = s[1],
r[i + 2] = s[2],
r[i + 3] = o !== e.transparentIndex ? 255 : 0
}
return r
}
, decompressFrame = function(e, t, r) {
if (e.image) {
var n = e.image
, i = n.descriptor.width * n.descriptor.height
, o = (0,
_lzw.lzw)(n.data.minCodeSize, n.data.blocks, i);
n.descriptor.lct.interlaced && (o = (0,
_deinterlace.deinterlace)(o, n.descriptor.width));
var s = {
pixels: o,
dims: {
top: e.image.descriptor.top,
left: e.image.descriptor.left,
width: e.image.descriptor.width,
height: e.image.descriptor.height
}
};
return n.descriptor.lct && n.descriptor.lct.exists ? s.colorTable =
n.lct : s.colorTable = t,
e.gce && (s.delay = 10 * (e.gce.delay || 10),
s.disposalType = e.gce.extras.disposal,
e.gce.extras.transparentColorGiven && (s.transparentIndex =
e.gce.transparentColorIndex)),
r && (s.patch = generatePatch(s)),
s
}
};
lib$2.decompressFrame = decompressFrame;
var decompressFrames = function(e, t) {
return e.frames.filter((function(e) {
return e.image
}
)).map((function(r) {
return decompressFrame(r, e.gct, t)
}
))
};
function toFrames(e, t, r) {
let n = null;
const i = []
, o = document.createElement("canvas")
, s = o.getContext("2d", {
willReadFrequently: !0
})
, a = document.createElement("canvas")
, l = a.getContext("2d");
o.width = r.lsd.width,
o.height = r.lsd.height;
for (const u of e) {
var c = u.dims;
if (n && c.width == n.width && c.height == n.height || (a.width =
c.width,
a.height = c.height,
n = l.createImageData(c.width, c.height)),
n.data.set(u.patch),
l.putImageData(n, 0, 0),
s.drawImage(a, c.left, c.top),
"base64" === t)
i.push(o.toDataURL());
else {
const e = o.toDataURL();
i.push(e)
}
}
return i
}
decompressFrames_1 = lib$2.decompressFrames = decompressFrames;
const validateAndFix = e => {
let t = null;
for (const r of e.frames)
t = r.gce ?? t,
"image"in r && !("gce"in r) && (r.gce = t)
}
;
async function gif2frames(e, t="base64") {
var r, n;
const i = await fetch(e)
, o = await i.arrayBuffer()
, s = parseGIF_1(o);
validateAndFix(s);
const a = s.frames[~~(s.frames.length / 2)] || {
gce: {
delay: .1
}
}
, l = decompressFrames_1(s, !0);
try {
return {
gifArr: "base64" === t ? toFrames(l, t, s) : l,
totalFrame: s.frames.length,
delayFrame: a.gce && a.gce.delay / 100 || .1,
width: null == (r = s.lsd) ? void 0 : r.width,
height: null == (n = s.lsd) ? void 0 : n.height
}
} catch (c) {
return null
}
}
function _typeof$3(e) {
return (_typeof$3 = "function" == typeof Symbol && "symbol" == typeof
Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol
&& e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
var trimLeft = /^\s+/
, trimRight = /\s+$/;
function tinycolor(e, t) {
if (t = t || {},
(e = e || "")instanceof tinycolor)
return e;
if (!(this instanceof tinycolor))
return new tinycolor(e,t);
var r = inputToRGB(e);
this._originalInput = e,
this._r = r.r,
this._g = r.g,
this._b = r.b,
this._a = r.a,
this._roundA = Math.round(100 * this._a) / 100,
this._format = t.format || r.format,
this._gradientType = t.gradientType,
this._r < 1 && (this._r = Math.round(this._r)),
this._g < 1 && (this._g = Math.round(this._g)),
this._b < 1 && (this._b = Math.round(this._b)),
this._ok = r.ok
}
function inputToRGB(e) {
var t = {
r: 0,
g: 0,
b: 0
}
, r = 1
, n = null
, i = null
, o = null
, s = !1
, a = !1;
return "string" == typeof e && (e = stringInputToObject(e)),
"object" == _typeof$3(e) && (isValidCSSUnit(e.r) && isValidCSSUnit(e.g)
&& isValidCSSUnit(e.b) ? (t = rgbToRgb(e.r, e.g, e.b),
s = !0,
a = "%" === String(e.r).substr(-1) ? "prgb" : "rgb") :
isValidCSSUnit(e.h) && isValidCSSUnit(e.s) && isValidCSSUnit(e.v) ? (n =
convertToPercentage(e.s),
i = convertToPercentage(e.v),
t = hsvToRgb(e.h, n, i),
s = !0,
a = "hsv") : isValidCSSUnit(e.h) && isValidCSSUnit(e.s) &&
isValidCSSUnit(e.l) && (n = convertToPercentage(e.s),
o = convertToPercentage(e.l),
t = hslToRgb(e.h, n, o),
s = !0,
a = "hsl"),
e.hasOwnProperty("a") && (r = e.a)),
r = boundAlpha(r),
{
ok: s,
format: e.format || a,
r: Math.min(255, Math.max(t.r, 0)),
g: Math.min(255, Math.max(t.g, 0)),
b: Math.min(255, Math.max(t.b, 0)),
a: r
}
}
function rgbToRgb(e, t, r) {
return {
r: 255 * bound01(e, 255),
g: 255 * bound01(t, 255),
b: 255 * bound01(r, 255)
}
}
function rgbToHsl(e, t, r) {
e = bound01(e, 255),
t = bound01(t, 255),
r = bound01(r, 255);
var n, i, o = Math.max(e, t, r), s = Math.min(e, t, r), a = (o + s) /
2;
if (o == s)
n = i = 0;
else {
var l = o - s;
switch (i = a > .5 ? l / (2 - o - s) : l / (o + s),
o) {
case e:
n = (t - r) / l + (t < r ? 6 : 0);
break;
case t:
n = (r - e) / l + 2;
break;
case r:
n = (e - t) / l + 4
}
n /= 6
}
return {
h: n,
s: i,
l: a
}
}
function hslToRgb(e, t, r) {
var n, i, o;
function s(e, t, r) {
return r < 0 && (r += 1),
r > 1 && (r -= 1),
r < 1 / 6 ? e + 6 * (t - e) * r : r < .5 ? t : r < 2 / 3 ? e + (t -
e) * (2 / 3 - r) * 6 : e
}
if (e = bound01(e, 360),
t = bound01(t, 100),
r = bound01(r, 100),
0 === t)
n = i = o = r;
else {
var a = r < .5 ? r * (1 + t) : r + t - r * t
, l = 2 * r - a;
n = s(l, a, e + 1 / 3),
i = s(l, a, e),
o = s(l, a, e - 1 / 3)
}
return {
r: 255 * n,
g: 255 * i,
b: 255 * o
}
}
function rgbToHsv(e, t, r) {
e = bound01(e, 255),
t = bound01(t, 255),
r = bound01(r, 255);
var n, i, o = Math.max(e, t, r), s = Math.min(e, t, r), a = o, l = o -
s;
if (i = 0 === o ? 0 : l / o,
o == s)
n = 0;
else {
switch (o) {
case e:
n = (t - r) / l + (t < r ? 6 : 0);
break;
case t:
n = (r - e) / l + 2;
break;
case r:
n = (e - t) / l + 4
}
n /= 6
}
return {
h: n,
s: i,
v: a
}
}
function hsvToRgb(e, t, r) {
e = 6 * bound01(e, 360),
t = bound01(t, 100),
r = bound01(r, 100);
var n = Math.floor(e)
, i = e - n
, o = r * (1 - t)
, s = r * (1 - i * t)
, a = r * (1 - (1 - i) * t)
, l = n % 6;
return {
r: 255 * [r, s, o, o, a, r][l],
g: 255 * [a, r, r, s, o, o][l],
b: 255 * [o, o, a, r, r, s][l]
}
}
function rgbToHex(e, t, r, n) {
var i = [pad2(Math.round(e).toString(16)),
pad2(Math.round(t).toString(16)), pad2(Math.round(r).toString(16))];
return n && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) ==
i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) +
i[1].charAt(0) + i[2].charAt(0) : i.join("")
}
function rgbaToHex(e, t, r, n, i) {
var o = [pad2(Math.round(e).toString(16)),
pad2(Math.round(t).toString(16)), pad2(Math.round(r).toString(16)),
pad2(convertDecimalToHex(n))];
return i && o[0].charAt(0) == o[0].charAt(1) && o[1].charAt(0) ==
o[1].charAt(1) && o[2].charAt(0) == o[2].charAt(1) && o[3].charAt(0) ==
o[3].charAt(1) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) +
o[3].charAt(0) : o.join("")
}
function rgbaToArgbHex(e, t, r, n) {
return [pad2(convertDecimalToHex(n)), pad2(Math.round(e).toString(16)),
pad2(Math.round(t).toString(16)), pad2(Math.round(r).toString(16))].join("")
}
function _desaturate(e, t) {
t = 0 === t ? 0 : t || 10;
var r = tinycolor(e).toHsl();
return r.s -= t / 100,
r.s = clamp01(r.s),
tinycolor(r)
}
function _saturate(e, t) {
t = 0 === t ? 0 : t || 10;
var r = tinycolor(e).toHsl();
return r.s += t / 100,
r.s = clamp01(r.s),
tinycolor(r)
}
function _greyscale(e) {
return tinycolor(e).desaturate(100)
}
function _lighten(e, t) {
t = 0 === t ? 0 : t || 10;
var r = tinycolor(e).toHsl();
return r.l += t / 100,
r.l = clamp01(r.l),
tinycolor(r)
}
function _brighten(e, t) {
t = 0 === t ? 0 : t || 10;
var r = tinycolor(e).toRgb();
return r.r = Math.max(0, Math.min(255, r.r - Math.round(-t / 100 *
255))),
r.g = Math.max(0, Math.min(255, r.g - Math.round(-t / 100 * 255))),
r.b = Math.max(0, Math.min(255, r.b - Math.round(-t / 100 * 255))),
tinycolor(r)
}
function _darken(e, t) {
t = 0 === t ? 0 : t || 10;
var r = tinycolor(e).toHsl();
return r.l -= t / 100,
r.l = clamp01(r.l),
tinycolor(r)
}
function _spin(e, t) {
var r = tinycolor(e).toHsl()
, n = (r.h + t) % 360;
return r.h = n < 0 ? 360 + n : n,
tinycolor(r)
}
function _complement(e) {
var t = tinycolor(e).toHsl();
return t.h = (t.h + 180) % 360,
tinycolor(t)
}
function polyad(e, t) {
if (isNaN(t) || t <= 0)
throw new Error("Argument to polyad must be a positive number");
for (var r = tinycolor(e).toHsl(), n = [tinycolor(e)], i = 360 / t, o =
1; o < t; o++)
n.push(tinycolor({
h: (r.h + o * i) % 360,
s: r.s,
l: r.l
}));
return n
}
function _splitcomplement(e) {
var t = tinycolor(e).toHsl()
, r = t.h;
return [tinycolor(e), tinycolor({
h: (r + 72) % 360,
s: t.s,
l: t.l
}), tinycolor({
h: (r + 216) % 360,
s: t.s,
l: t.l
})]
}
function _analogous(e, t, r) {
t = t || 6,
r = r || 30;
var n = tinycolor(e).toHsl()
, i = 360 / r
, o = [tinycolor(e)];
for (n.h = (n.h - (i * t >> 1) + 720) % 360; --t; )
n.h = (n.h + i) % 360,
o.push(tinycolor(n));
return o
}
function _monochromatic(e, t) {
t = t || 6;
for (var r = tinycolor(e).toHsv(), n = r.h, i = r.s, o = r.v, s = [], a
= 1 / t; t--; )
s.push(tinycolor({
h: n,
s: i,
v: o
})),
o = (o + a) % 1;
return s
}
tinycolor.prototype = {
isDark: function() {
return this.getBrightness() < 128
},
isLight: function() {
return !this.isDark()
},
isValid: function() {
return this._ok
},
getOriginalInput: function() {
return this._originalInput
},
getFormat: function() {
return this._format
},
getAlpha: function() {
return this._a
},
getBrightness: function() {
var e = this.toRgb();
return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3
},
getLuminance: function() {
var e, t, r, n = this.toRgb();
return e = n.r / 255,
t = n.g / 255,
r = n.b / 255,
.2126 * (e <= .03928 ? e / 12.92 : Math.pow((e + .055) / 1.055,
2.4)) + .7152 * (t <= .03928 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4))
+ .0722 * (r <= .03928 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4))
},
setAlpha: function(e) {
return this._a = boundAlpha(e),
this._roundA = Math.round(100 * this._a) / 100,
this
},
toHsv: function() {
var e = rgbToHsv(this._r, this._g, this._b);
return {
h: 360 * e.h,
s: e.s,
v: e.v,
a: this._a
}
},
toHsvString: function() {
var e = rgbToHsv(this._r, this._g, this._b)
, t = Math.round(360 * e.h)
, r = Math.round(100 * e.s)
, n = Math.round(100 * e.v);
return 1 == this._a ? "hsv(" + t + ", " + r + "%, " + n + "%)" :
"hsva(" + t + ", " + r + "%, " + n + "%, " + this._roundA + ")"
},
toHsl: function() {
var e = rgbToHsl(this._r, this._g, this._b);
return {
h: 360 * e.h,
s: e.s,
l: e.l,
a: this._a
}
},
toHslString: function() {
var e = rgbToHsl(this._r, this._g, this._b)
, t = Math.round(360 * e.h)
, r = Math.round(100 * e.s)
, n = Math.round(100 * e.l);
return 1 == this._a ? "hsl(" + t + ", " + r + "%, " + n + "%)" :
"hsla(" + t + ", " + r + "%, " + n + "%, " + this._roundA + ")"
},
toHex: function(e) {
return rgbToHex(this._r, this._g, this._b, e)
},
toHexString: function(e) {
return "#" + this.toHex(e)
},
toHex8: function(e) {
return rgbaToHex(this._r, this._g, this._b, this._a, e)
},
toHex8String: function(e) {
return "#" + this.toHex8(e)
},
toRgb: function() {
return {
r: Math.round(this._r),
g: Math.round(this._g),
b: Math.round(this._b),
a: this._a
}
},
toRgbString: function() {
return 1 == this._a ? "rgb(" + Math.round(this._r) + ", " +
Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" +
Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ",
" + this._roundA + ")"
},
toPercentageRgb: function() {
return {
r: Math.round(100 * bound01(this._r, 255)) + "%",
g: Math.round(100 * bound01(this._g, 255)) + "%",
b: Math.round(100 * bound01(this._b, 255)) + "%",
a: this._a
}
},
toPercentageRgbString: function() {
return 1 == this._a ? "rgb(" + Math.round(100 * bound01(this._r,
255)) + "%, " + Math.round(100 * bound01(this._g, 255)) + "%, " + Math.round(100 *
bound01(this._b, 255)) + "%)" : "rgba(" + Math.round(100 * bound01(this._r, 255)) +
"%, " + Math.round(100 * bound01(this._g, 255)) + "%, " + Math.round(100 *
bound01(this._b, 255)) + "%, " + this._roundA + ")"
},
toName: function() {
return 0 === this._a ? "transparent" : !(this._a < 1) &&
(hexNames[rgbToHex(this._r, this._g, this._b, !0)] || !1)
},
toFilter: function(e) {
var t = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a)
, r = t
, n = this._gradientType ? "GradientType = 1, " : "";
if (e) {
var i = tinycolor(e);
r = "#" + rgbaToArgbHex(i._r, i._g, i._b, i._a)
}
return "progid:DXImageTransform.Microsoft.gradient(" + n +
"startColorstr=" + t + ",endColorstr=" + r + ")"
},
toString: function(e) {
var t = !!e;
e = e || this._format;
var r = !1
, n = this._a < 1 && this._a >= 0;
return t || !n || "hex" !== e && "hex6" !== e && "hex3" !== e &&
"hex4" !== e && "hex8" !== e && "name" !== e ? ("rgb" === e && (r =
this.toRgbString()),
"prgb" === e && (r = this.toPercentageRgbString()),
"hex" !== e && "hex6" !== e || (r = this.toHexString()),
"hex3" === e && (r = this.toHexString(!0)),
"hex4" === e && (r = this.toHex8String(!0)),
"hex8" === e && (r = this.toHex8String()),
"name" === e && (r = this.toName()),
"hsl" === e && (r = this.toHslString()),
"hsv" === e && (r = this.toHsvString()),
r || this.toHexString()) : "name" === e && 0 === this._a ?
this.toName() : this.toRgbString()
},
clone: function() {
return tinycolor(this.toString())
},
_applyModification: function(e, t) {
var r = e.apply(null, [this].concat([].slice.call(t)));
return this._r = r._r,
this._g = r._g,
this._b = r._b,
this.setAlpha(r._a),
this
},
lighten: function() {
return this._applyModification(_lighten, arguments)
},
brighten: function() {
return this._applyModification(_brighten, arguments)
},
darken: function() {
return this._applyModification(_darken, arguments)
},
desaturate: function() {
return this._applyModification(_desaturate, arguments)
},
saturate: function() {
return this._applyModification(_saturate, arguments)
},
greyscale: function() {
return this._applyModification(_greyscale, arguments)
},
spin: function() {
return this._applyModification(_spin, arguments)
},
_applyCombination: function(e, t) {
return e.apply(null, [this].concat([].slice.call(t)))
},
analogous: function() {
return this._applyCombination(_analogous, arguments)
},
complement: function() {
return this._applyCombination(_complement, arguments)
},
monochromatic: function() {
return this._applyCombination(_monochromatic, arguments)
},
splitcomplement: function() {
return this._applyCombination(_splitcomplement, arguments)
},
triad: function() {
return this._applyCombination(polyad, [3])
},
tetrad: function() {
return this._applyCombination(polyad, [4])
}
},
tinycolor.fromRatio = function(e, t) {
if ("object" == _typeof$3(e)) {
var r = {};
for (var n in e)
e.hasOwnProperty(n) && (r[n] = "a" === n ? e[n] :
convertToPercentage(e[n]));
e = r
}
return tinycolor(e, t)
}
,
tinycolor.equals = function(e, t) {
return !(!e || !t) && tinycolor(e).toRgbString() ==
tinycolor(t).toRgbString()
}
,
tinycolor.random = function() {
return tinycolor.fromRatio({
r: Math.random(),
g: Math.random(),
b: Math.random()
})
}
,
tinycolor.mix = function(e, t, r) {
r = 0 === r ? 0 : r || 50;
var n = tinycolor(e).toRgb()
, i = tinycolor(t).toRgb()
, o = r / 100;
return tinycolor({
r: (i.r - n.r) * o + n.r,
g: (i.g - n.g) * o + n.g,
b: (i.b - n.b) * o + n.b,
a: (i.a - n.a) * o + n.a
})
}
,
tinycolor.readability = function(e, t) {
var r = tinycolor(e)
, n = tinycolor(t);
return (Math.max(r.getLuminance(), n.getLuminance()) + .05) /
(Math.min(r.getLuminance(), n.getLuminance()) + .05)
}
,
tinycolor.isReadable = function(e, t, r) {
var n, i, o = tinycolor.readability(e, t);
switch (i = !1,
(n = validateWCAG2Parms(r)).level + n.size) {
case "AAsmall":
case "AAAlarge":
i = o >= 4.5;
break;
case "AAlarge":
i = o >= 3;
break;
case "AAAsmall":
i = o >= 7
}
return i
}
,
tinycolor.mostReadable = function(e, t, r) {
var n, i, o, s, a = null, l = 0;
i = (r = r || {}).includeFallbackColors,
o = r.level,
s = r.size;
for (var c = 0; c < t.length; c++)
(n = tinycolor.readability(e, t[c])) > l && (l = n,
a = tinycolor(t[c]));
return tinycolor.isReadable(e, a, {
level: o,
size: s
}) || !i ? a : (r.includeFallbackColors = !1,
tinycolor.mostReadable(e, ["#fff", "#000"], r))
}
;
var names$1 = tinycolor.names = {
aliceblue: "f0f8ff",
antiquewhite: "faebd7",
aqua: "0ff",
aquamarine: "7fffd4",
azure: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "000",
blanchedalmond: "ffebcd",
blue: "00f",
blueviolet: "8a2be2",
brown: "a52a2a",
burlywood: "deb887",
burntsienna: "ea7e5d",
cadetblue: "5f9ea0",
chartreuse: "7fff00",
chocolate: "d2691e",
coral: "ff7f50",
cornflowerblue: "6495ed",
cornsilk: "fff8dc",
crimson: "dc143c",
cyan: "0ff",
darkblue: "00008b",
darkcyan: "008b8b",
darkgoldenrod: "b8860b",
darkgray: "a9a9a9",
darkgreen: "006400",
darkgrey: "a9a9a9",
darkkhaki: "bdb76b",
darkmagenta: "8b008b",
darkolivegreen: "556b2f",
darkorange: "ff8c00",
darkorchid: "9932cc",
darkred: "8b0000",
darksalmon: "e9967a",
darkseagreen: "8fbc8f",
darkslateblue: "483d8b",
darkslategray: "2f4f4f",
darkslategrey: "2f4f4f",
darkturquoise: "00ced1",
darkviolet: "9400d3",
deeppink: "ff1493",
deepskyblue: "00bfff",
dimgray: "696969",
dimgrey: "696969",
dodgerblue: "1e90ff",
firebrick: "b22222",
floralwhite: "fffaf0",
forestgreen: "228b22",
fuchsia: "f0f",
gainsboro: "dcdcdc",
ghostwhite: "f8f8ff",
gold: "ffd700",
goldenrod: "daa520",
gray: "808080",
green: "008000",
greenyellow: "adff2f",
grey: "808080",
honeydew: "f0fff0",
hotpink: "ff69b4",
indianred: "cd5c5c",
indigo: "4b0082",
ivory: "fffff0",
khaki: "f0e68c",
lavender: "e6e6fa",
lavenderblush: "fff0f5",
lawngreen: "7cfc00",
lemonchiffon: "fffacd",
lightblue: "add8e6",
lightcoral: "f08080",
lightcyan: "e0ffff",
lightgoldenrodyellow: "fafad2",
lightgray: "d3d3d3",
lightgreen: "90ee90",
lightgrey: "d3d3d3",
lightpink: "ffb6c1",
lightsalmon: "ffa07a",
lightseagreen: "20b2aa",
lightskyblue: "87cefa",
lightslategray: "789",
lightslategrey: "789",
lightsteelblue: "b0c4de",
lightyellow: "ffffe0",
lime: "0f0",
limegreen: "32cd32",
linen: "faf0e6",
magenta: "f0f",
maroon: "800000",
mediumaquamarine: "66cdaa",
mediumblue: "0000cd",
mediumorchid: "ba55d3",
mediumpurple: "9370db",
mediumseagreen: "3cb371",
mediumslateblue: "7b68ee",
mediumspringgreen: "00fa9a",
mediumturquoise: "48d1cc",
mediumvioletred: "c71585",
midnightblue: "191970",
mintcream: "f5fffa",
mistyrose: "ffe4e1",
moccasin: "ffe4b5",
navajowhite: "ffdead",
navy: "000080",
oldlace: "fdf5e6",
olive: "808000",
olivedrab: "6b8e23",
orange: "ffa500",
orangered: "ff4500",
orchid: "da70d6",
palegoldenrod: "eee8aa",
palegreen: "98fb98",
paleturquoise: "afeeee",
palevioletred: "db7093",
papayawhip: "ffefd5",
peachpuff: "ffdab9",
peru: "cd853f",
pink: "ffc0cb",
plum: "dda0dd",
powderblue: "b0e0e6",
purple: "800080",
rebeccapurple: "663399",
red: "f00",
rosybrown: "bc8f8f",
royalblue: "4169e1",
saddlebrown: "8b4513",
salmon: "fa8072",
sandybrown: "f4a460",
seagreen: "2e8b57",
seashell: "fff5ee",
sienna: "a0522d",
silver: "c0c0c0",
skyblue: "87ceeb",
slateblue: "6a5acd",
slategray: "708090",
slategrey: "708090",
snow: "fffafa",
springgreen: "00ff7f",
steelblue: "4682b4",
tan: "d2b48c",
teal: "008080",
thistle: "d8bfd8",
tomato: "ff6347",
turquoise: "40e0d0",
violet: "ee82ee",
wheat: "f5deb3",
white: "fff",
whitesmoke: "f5f5f5",
yellow: "ff0",
yellowgreen: "9acd32"
}
, hexNames = tinycolor.hexNames = flip(names$1);
function flip(e) {
var t = {};
for (var r in e)
e.hasOwnProperty(r) && (t[e[r]] = r);
return t
}
function boundAlpha(e) {
return e = parseFloat(e),
(isNaN(e) || e < 0 || e > 1) && (e = 1),
e
}
function bound01(e, t) {
isOnePointZero(e) && (e = "100%");
var r = isPercentage(e);
return e = Math.min(t, Math.max(0, parseFloat(e))),
r && (e = parseInt(e * t, 10) / 100),
Math.abs(e - t) < 1e-6 ? 1 : e % t / parseFloat(t)
}
function clamp01(e) {
return Math.min(1, Math.max(0, e))
}
function parseIntFromHex(e) {
return parseInt(e, 16)
}
function isOnePointZero(e) {
return "string" == typeof e && -1 != e.indexOf(".") && 1 ===
parseFloat(e)
}
function isPercentage(e) {
return "string" == typeof e && -1 != e.indexOf("%")
}
function pad2(e) {
return 1 == e.length ? "0" + e : "" + e
}
function convertToPercentage(e) {
return e <= 1 && (e = 100 * e + "%"),
e
}
function convertDecimalToHex(e) {
return Math.round(255 * parseFloat(e)).toString(16)
}
function convertHexToDecimal(e) {
return parseIntFromHex(e) / 255
}
var matchers = (CSS_UNIT = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",
PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")
[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?",
PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")
[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?",
{
CSS_UNIT: new RegExp(CSS_UNIT),
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]
{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]
{2})$/
}), CSS_UNIT, PERMISSIVE_MATCH3, PERMISSIVE_MATCH4;
function isValidCSSUnit(e) {
return !!matchers.CSS_UNIT.exec(e)
}
function stringInputToObject(e) {
e = e.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
var t, r = !1;
if (names$1[e])
e = names$1[e],
r = !0;
else if ("transparent" == e)
return {
r: 0,
g: 0,
b: 0,
a: 0,
format: "name"
};
return (t = matchers.rgb.exec(e)) ? {
r: t[1],
g: t[2],
b: t[3]
} : (t = matchers.rgba.exec(e)) ? {
r: t[1],
g: t[2],
b: t[3],
a: t[4]
} : (t = matchers.hsl.exec(e)) ? {
h: t[1],
s: t[2],
l: t[3]
} : (t = matchers.hsla.exec(e)) ? {
h: t[1],
s: t[2],
l: t[3],
a: t[4]
} : (t = matchers.hsv.exec(e)) ? {
h: t[1],
s: t[2],
v: t[3]
} : (t = matchers.hsva.exec(e)) ? {
h: t[1],
s: t[2],
v: t[3],
a: t[4]
} : (t = matchers.hex8.exec(e)) ? {
r: parseIntFromHex(t[1]),
g: parseIntFromHex(t[2]),
b: parseIntFromHex(t[3]),
a: convertHexToDecimal(t[4]),
format: r ? "name" : "hex8"
} : (t = matchers.hex6.exec(e)) ? {
r: parseIntFromHex(t[1]),
g: parseIntFromHex(t[2]),
b: parseIntFromHex(t[3]),
format: r ? "name" : "hex"
} : (t = matchers.hex4.exec(e)) ? {
r: parseIntFromHex(t[1] + "" + t[1]),
g: parseIntFromHex(t[2] + "" + t[2]),
b: parseIntFromHex(t[3] + "" + t[3]),
a: convertHexToDecimal(t[4] + "" + t[4]),
format: r ? "name" : "hex8"
} : !!(t = matchers.hex3.exec(e)) && {
r: parseIntFromHex(t[1] + "" + t[1]),
g: parseIntFromHex(t[2] + "" + t[2]),
b: parseIntFromHex(t[3] + "" + t[3]),
format: r ? "name" : "hex"
}
}
function validateWCAG2Parms(e) {
var t, r;
return "AA" !== (t = ((e = e || {
level: "AA",
size: "small"
}).level || "AA").toUpperCase()) && "AAA" !== t && (t = "AA"),
"small" !== (r = (e.size || "small").toLowerCase()) && "large" !== r &&
(r = "small"),
{
level: t,
size: r
}
}
function useScreen(e, t, r) {
var n, i, o, s, a, l;
return reactExports.useEffect(( () => {
if (e.matting && t) {
t.enabled = e.matting.enabled,
t.filterType = e.matting.filterType,
t.gridSize = e.matting.gridSize,
t.lightLevel = e.matting.lightLevel,
t.emergence = e.matting.emergence,
t.scale = r;
const n = tinycolor(e.matting.color).toRgb();
t.color = [n.r / 255, n.g / 255, n.b / 255]
}
}
), [e.matting, null == (n = e.matting) ? void 0 : n.enabled, null == (i
= e.matting) ? void 0 : i.filterType, null == (o = e.matting) ? void 0 :
o.gridSize, null == (s = e.matting) ? void 0 : s.lightLevel, null == (a =
e.matting) ? void 0 : a.color, null == (l = e.matting) ? void 0 : l.emergence, r]),
[t]
}
function useMask(e, t, r, n) {
var i, o, s, a, l, c, u, d, p;
const h = reactExports.useRef()
, f = reactExports.useRef()
, m = reactExports.useRef()
, g = reactExports.useRef()
, y = reactExports.useRef()
, [v,b] = reactExports.useMemo(( () => {
if (e.mask) {
if (!f.current) {
const r = document.createElement("canvas");
r.width = e.style.width,
r.height = e.style.height,
f.current = r;
const n = r.getContext("2d");
m.current = n,
n.fillStyle = "#0000ff",
n.fillRect(0, 0, r.width, r.height);
const i = Sprite.from(f.current);
y.current = i,
i.width = e.style.width,
i.height = e.style.height,
i.anchor.set(.5),
i.position.x = i.width / 2,
i.position.y = i.height / 2,
i.name = "mask",
t.addChild(i)
}
"export" === r.env && (r.elementReadyMark[`${e.id}_mask`] =
"start");
const n = async () => {
var t;
if (!g.current) {
const t =
r.resourceManage.getResouceById(e.mask.resourceId);
if (!t)
return void (r.elementReadyMark[`${e.id}_mask`] =
"success");
await i(t.url)
}
const n = f.current
, o = m.current;
if (o.fillStyle = "#0000ff",
o.fillRect(0, 0, n.width, n.height),
e.mask) {
o.filter = `blur(${e.mask.blur || 0}px)`,
void 0 === e.mask.alpha && (e.mask.alpha = 1),
o.globalAlpha = e.mask.alpha;
const r = {
width: e.mask.width,
height: e.mask.height
};
r.x = e.mask.x - r.width / 2,
r.y = e.mask.y - r.height / 2;
const n = r.x + e.mask.width / 2
, i = r.y + e.mask.height / 2;
o.translate(n, i),
o.rotate(e.mask.rotation || 0),
o.drawImage(g.current, r.x - n, r.y - i, r.width,
r.height),
o.rotate(-(e.mask.rotation || 0)),
o.translate(-n, -i),
y.current && y.current.texture && (null == (t =
y.current.texture.baseTexture) || t.update())
}
}
, i = t => new Promise((n => {
const i = new Image;
i.src = t,
i.onload = function() {
g.current = i,
"export" === r.env && (r.elementReadyMark[`$
{e.id}_mask`] = "success"),
n(null)
}
}
));
return [y.current, n, i]
}
return f.current && (f.current.width = 0,
f.current.height = 0,
f.current.remove(),
f.current = void 0),
[null, null, null]
}
), [null == (i = e.mask) ? void 0 : i.resourceId]);
reactExports.useEffect(( () => {
b && (g.current = "",
b())
}
), [null == (o = e.mask) ? void 0 : o.resourceId]),
reactExports.useEffect(( () => {
if (f.current && b) {
const t = h.current;
if (e.mask && t) {
const r = e.style.width / t.elementWidth;
e.mask.width = r * t.width,
e.mask.height = r * t.height,
e.mask.x = r * t.x,
e.mask.y = r * t.y,
e.mask.rotation = t.rotation || 0
}
b()
}
}
), [e.style.width, e.style.height]),
reactExports.useEffect(( () => {
e.mask && b && b()
}
), [null == (s = e.mask) ? void 0 : s.x, null == (a = e.mask) ? void
0 : a.y, null == (l = e.mask) ? void 0 : l.width, null == (c = e.mask) ? void 0 :
c.height, null == (u = e.mask) ? void 0 : u.rotation, null == (d = e.mask) ? void 0
: d.alpha, null == (p = e.mask) ? void 0 : p.blur]),
reactExports.useEffect(( () =>
(pubsub.subscribe(r.events.CONTROL_CHANGE_START + "." + e.id, ( () => {
h.current = {
...e.mask || {},
elementWidth: e.style.width
}
}
)),
pubsub.subscribe(r.events.CONTROL_CHANGE_END + "." + e.id, ( () => {
h.current = null
}
)),
() => {
r.controlModeType = "editElement",
pubsub.unsubscribe(r.events.CONTROL_CHANGE_START + "." + e.id),
pubsub.unsubscribe(r.events.CONTROL_CHANGE_END + "." + e.id),
f.current && (f.current.width = 0,
f.current.height = 0,
f.current.remove())
}
)), []),
reactExports.useEffect(( () => {
const r = t.children.find((e => "element" === e.name));
return e.mask && v ? r.mask = v : r.mask = null,
() => {
v && !v.destroyed && v.destroy()
}
}
), [v])
}
function SpriteElement(e) {
const {visible: t, env: r, trackIndex: n} = e
, i = e.element
, o = reactExports.useRef()
, s = e.store
, [a,l] = reactExports.useState("1")
, c = reactExports.useRef()
, [u,d] = reactExports.useState(1)
, p = reactExports.useMemo(( () => {
var e, t;
const r = new Container
, n = s.resourceManage.getCacheBlobURLById(i.resourceId)
, o = Texture.from(n)
, a = new Sprite(o.clone());
o.on("update", ( () => {
d(+new Date)
}
));
const l = s.resourceManage.getResouceById(i.resourceId);
return c.current = new ScreenFilter({
videowidth: null == (e = null == l ? void 0 : l.styleSize) ?
void 0 : e.width,
videoheight: null == (t = null == l ? void 0 : l.styleSize) ?
void 0 : t.height,
texture: o
}),
c.current.id = "ScreenFilter",
c.current.enabled = i.matting && i.matting.enabled,
a.filters = [c.current],
a.name = "element",
r.addChild(a),
r
}
), [i.resourceId, n]);
useMask(i, p, e.store, e.scale),
useScreen(i, c.current, e.scale),
reactExports.useEffect(( () => {
const t = s.resourceManage.getTempData(i.id + "_gif");
t && null !== e.relativeTime && t.drawFrame(Math.round(1 *
e.relativeTime / t.delayFrame) % t.totalFrame)
}
), [e.relativeTime]),
reactExports.useEffect(( () => {
if (i.isGif) {
if (!s.resourceManage.getTempData(i.id + "_gif") && i.isGif) {
const e =
s.resourceManage.getCacheBlobURLById(i.resourceId)
, t = p.children.find((e => "element" === e.name))
, r = s.resourceManage.getTempData(`${e}_gifparse`)
, n = r => {
if (r) {
s.resourceManage.setTempData(`${e}_gifparse`, r);
const n = document.createElement("canvas")
, o = n.getContext("2d", {
willReadFrequently: !0
})
, a = document.createElement("canvas")
, l = a.getContext("2d");
l.clearRect(0, 0, r.width, r.height),
n.width = r.width,
n.height = r.height;
const c = Texture.from(n);
t.texture = c;
const u = .1
, d = [];
for (let e = 0; e < r.gifArr.length; e++) {
const t = r.gifArr[e];
if (!t)
return;
const {disposalType: i=2, delay: s=u, patch: c}
= t
, p = t.dims;
a.width = p.width,
a.height = p.height,
l.clearRect(0, 0, p.width, p.height);
const h = l.createImageData(p.width, p.height);
h.data.set(c),
l.putImageData(h, 0, 0),
o.drawImage(a, p.left, p.top);
const f = o.getImageData(0, 0, n.width,
n.height);
2 !== i && 3 !== i || o.clearRect(0, 0,
n.width, n.height),
d.push(f)
}
const p = e => {
const t = d[e];
t && (o.putImageData(t, 0, 0),
c.update())
}
;
p(0),
s.resourceManage.setTempData(i.id + "_gif", {
totalFrame: r.totalFrame,
delayFrame: r.delayFrame,
width: r.width,
height: r.height,
drawFrame: p,
destroy: () => {
n.width = n.height = 0,
a.width = a.height = 0
}
})
}
}
;
r ? n(r) : gif2frames(e, "buffer").then((e => n(e)))
}
return () => s.resourceManage.removeTempData(i.id + "_gif")
}
}
), []),
useElementFilter(p, i),
reactExports.useEffect(( () => {
if (void 0 !== i.blendMode) {
p.children.find((e => "element" === e.name)).blendMode =
i.blendMode
}
}
), [i.blendMode]),
void 0 === i.scale && (i.scale = 1);
const [h] = useSyncPixiElement$1(p, {
style: {
...i.style
},
parent: e.parent,
animateRef: o,
visible: t,
hide: e.hide,
lock: e.lock,
relativeTime: e.relativeTime,
store: e.store
}, ["x", "y", "width", "height", "alpha", "rotation"], i)
, f = e.transitionElement
, m = reactExports.useCallback(debounce$3(( () => {
l(createID())
}
), 300), [])
, {x: g, y: y, width: v, height: b} = i.style;
return reactExports.useEffect(( () => {
e.hasTransition && m()
}
), [g, y, v, b]),
reactExports.useEffect(( () => {
const e = s.resourceManage.getResouceById(i.resourceId);
if (i.resourceId && e && i.cropSize) {
const e = p.children.find((e => "element" === e.name));
if ("1_1" != `${e.texture.width}_${e.texture.height}`) {
const {x: t, y: r, width: n, height: o} = i.cropSize;
e.texture.frame = new Rectangle(t,r,n,o)
}
h({
...i.style
}, p)
}
}
), [i.cropSize, i.resourceId, u]),
jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
children: jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
children: ["editor" === r &&
jsxRuntimeExports.jsx(ControlElment$1, {
hide: e.hide,
lock: e.lock,
trackIndex: n,
scale: e.scale,
store: e.store,
element: i,
visible: t
}), e.hasTransition && jsxRuntimeExports.jsx(TransitionElement,
{
currentTime: e.currentTime,
relativeTime: e.relativeTime,
trackIndex: n,
transitionElement: f,
nextElement: e.nextElement,
element: i,
dirty: f._dirty,
store: e.store,
env: e.env
}, a + f._dirty), jsxRuntimeExports.jsx(Animate$2, {
ref: o,
store: e.store,
pixiElem: p,
elementData: i,
currentTime: e.currentTime,
relativeTime: e.relativeTime
})]
})
})
}
var e$7 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, o$b = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\
nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform
float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\
nuniform float alpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler,
vTextureCoord);\n\n if (c.a > 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb
= pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5),
mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n
rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb
* brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\
n";
let s$7 = class extends Filter$2 {
constructor(e) {
super(e$7, o$b),
this.gamma = 1,
this.saturation = 1,
this.contrast = 1,
this.brightness = 1,
this.red = 1,
this.green = 1,
this.blue = 1,
this.alpha = 1,
Object.assign(this, e)
}
apply(e, t, r, n) {
this.uniforms.gamma = Math.max(this.gamma, 1e-4),
this.uniforms.saturation = this.saturation,
this.uniforms.contrast = this.contrast,
this.uniforms.brightness = this.brightness,
this.uniforms.red = this.red,
this.uniforms.green = this.green,
this.uniforms.blue = this.blue,
this.uniforms.alpha = this.alpha,
e.applyFilter(this, t, r, n)
}
}
;
var c$b = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, v$3 = "\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\
nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n //
Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x -
uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n
color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y +
uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler,
vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample
bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x -
uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n
gl_FragColor = color;\n}"
, y$2 = "\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\
nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4
color = vec4(0.0);\n\n // Sample top left pixel\n color +=
texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y +
uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n
color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x,
vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample
bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x +
uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\
n // Sample bottom left pixel\n color += texture2D(uSampler,
clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y),
filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n
gl_FragColor = color;\n}\n";
let _$2 = class extends Filter$2 {
constructor(e=4, t=3, r=!1) {
super(c$b, r ? y$2 : v$3),
this._kernels = [],
this._blur = 4,
this._quality = 3,
this.uniforms.uOffset = new Float32Array(2),
this._pixelSize = new Point,
this.pixelSize = 1,
this._clamp = r,
Array.isArray(e) ? this.kernels = e : (this._blur = e,
this.quality = t)
}
apply(e, t, r, n) {
const i = this._pixelSize.x / t._frame.width
, o = this._pixelSize.y / t._frame.height;
let s;
if (1 === this._quality || 0 === this._blur)
s = this._kernels[0] + .5,
this.uniforms.uOffset[0] = s * i,
this.uniforms.uOffset[1] = s * o,
e.applyFilter(this, t, r, n);
else {
const a = e.getFilterTexture();
let l, c = t, u = a;
const d = this._quality - 1;
for (let t = 0; t < d; t++)
s = this._kernels[t] + .5,
this.uniforms.uOffset[0] = s * i,
this.uniforms.uOffset[1] = s * o,
e.applyFilter(this, c, u, 1),
l = c,
c = u,
u = l;
s = this._kernels[d] + .5,
this.uniforms.uOffset[0] = s * i,
this.uniforms.uOffset[1] = s * o,
e.applyFilter(this, c, r, n),
e.returnFilterTexture(a)
}
}
_updatePadding() {
this.padding = Math.ceil(this._kernels.reduce(( (e, t) => e + t
+ .5), 0))
}
_generateKernels() {
const e = this._blur
, t = this._quality
, r = [e];
if (e > 0) {
let n = e;
const i = e / t;
for (let e = 1; e < t; e++)
n -= i,
r.push(n)
}
this._kernels = r,
this._updatePadding()
}
get kernels() {
return this._kernels
}
set kernels(e) {
Array.isArray(e) && e.length > 0 ? (this._kernels = e,
this._quality = e.length,
this._blur = Math.max(...e)) : (this._kernels = [0],
this._quality = 1)
}
get clamp() {
return this._clamp
}
set pixelSize(e) {
"number" == typeof e ? (this._pixelSize.x = e,
this._pixelSize.y = e) : Array.isArray(e) ? (this._pixelSize.x =
e[0],
this._pixelSize.y = e[1]) : e instanceof Point ? (this._pixelSize.x
= e.x,
this._pixelSize.y = e.y) : (this._pixelSize.x = 1,
this._pixelSize.y = 1)
}
get pixelSize() {
return this._pixelSize
}
get quality() {
return this._quality
}
set quality(e) {
this._quality = Math.max(1, Math.round(e)),
this._generateKernels()
}
get blur() {
return this._blur
}
set blur(e) {
this._blur = e,
this._generateKernels()
}
}
;
var a$c = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, m$4 = "\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\
nuniform float threshold;\n\nvoid main() {\n vec4 color = texture2D(uSampler,
vTextureCoord);\n\n // A simple & fast algorithm for getting brightness.\n //
It's inaccuracy , but good enought for this feature.\n float _max =
max(max(color.r, color.g), color.b);\n float _min = min(min(color.r, color.g),
color.b);\n float brightness = (_max + _min) * 0.5;\n\n if(brightness >
threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor =
vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n";
let x$4 = class extends Filter$2 {
constructor(e=.5) {
super(a$c, m$4),
this.threshold = e
}
get threshold() {
return this.uniforms.threshold
}
set threshold(e) {
this.uniforms.threshold = e
}
}
;
var g$3 = "uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\
nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float
brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\
n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture,
vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor =
color + bloomColor;\n}\n";
const c$a = class extends Filter$2 {
constructor(e) {
super(a$c, g$3),
this.bloomScale = 1,
this.brightness = 1,
this._resolution = settings.FILTER_RESOLUTION,
"number" == typeof e && (e = {
threshold: e
});
const t = Object.assign(c$a.defaults, e);
this.bloomScale = t.bloomScale,
this.brightness = t.brightness;
const {kernels: r, blur: n, quality: i, pixelSize: o, resolution:
s} = t;
this._extractFilter = new x$4(t.threshold),
this._extractFilter.resolution = s,
this._blurFilter = r ? new _$2(r) : new _$2(n,i),
this.pixelSize = o,
this.resolution = s
}
apply(e, t, r, n, i) {
const o = e.getFilterTexture();
this._extractFilter.apply(e, t, o, 1, i);
const s = e.getFilterTexture();
this._blurFilter.apply(e, o, s, 1),
this.uniforms.bloomScale = this.bloomScale,
this.uniforms.brightness = this.brightness,
this.uniforms.bloomTexture = s,
e.applyFilter(this, t, r, n),
e.returnFilterTexture(s),
e.returnFilterTexture(o)
}
get resolution() {
return this._resolution
}
set resolution(e) {
this._resolution = e,
this._extractFilter && (this._extractFilter.resolution = e),
this._blurFilter && (this._blurFilter.resolution = e)
}
get threshold() {
return this._extractFilter.threshold
}
set threshold(e) {
this._extractFilter.threshold = e
}
get kernels() {
return this._blurFilter.kernels
}
set kernels(e) {
this._blurFilter.kernels = e
}
get blur() {
return this._blurFilter.blur
}
set blur(e) {
this._blurFilter.blur = e
}
get quality() {
return this._blurFilter.quality
}
set quality(e) {
this._blurFilter.quality = e
}
get pixelSize() {
return this._blurFilter.pixelSize
}
set pixelSize(e) {
this._blurFilter.pixelSize = e
}
}
;
let b$3 = c$a;
b$3.defaults = {
threshold: .5,
bloomScale: 1,
brightness: 1,
kernels: null,
blur: 8,
quality: 4,
pixelSize: 1,
resolution: settings.FILTER_RESOLUTION
};
var o$a = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, r$8 = "varying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform
float pixelSize;\nuniform sampler2D uSampler;\n\nvec2 mapCoord( vec2 coord )\n{\n
coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\
nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /=
filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n
return floor(coord / size) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n
return mod(coord, size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p =
floor(p*vec2(4.0, 4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n
if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x +
5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid
main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the grid
position\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord =
unmapCoord(pixCoord);\n\n // sample the color at grid position\n vec4 color =
texture2D(uSampler, pixCoord);\n\n // brightness of the color as it's perceived
by the human eye\n float gray = 0.3 * color.r + 0.59 * color.g + 0.11 *
color.b;\n\n // determine the character to use\n float n = 65536.0;
// .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0;
// *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0;
// &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0;
// @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2
modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n,
vec2(-1.0) + modd * 2.0);\n\n}\n";
let i$f = class extends Filter$2 {
constructor(e=8) {
super(o$a, r$8),
this.size = e
}
get size() {
return this.uniforms.pixelSize
}
set size(e) {
this.uniforms.pixelSize = e
}
}
;
var n$c = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, e$6 = "precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform
sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform
float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform
vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2
transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color
= texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler,
vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord
+ transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a -
light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor,
clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor =
vec4(color.rgb * color.a, color.a);\n}\n";
let s$6 = class extends Filter$2 {
constructor(e) {
super(n$c, e$6),
this._thickness = 2,
this._angle = 0,
this.uniforms.lightColor = new Float32Array(3),
this.uniforms.shadowColor = new Float32Array(3),
Object.assign(this, {
rotation: 45,
thickness: 2,
lightColor: 16777215,
lightAlpha: .7,
shadowColor: 0,
shadowAlpha: .7
}, e),
this.padding = 1
}
_updateTransform() {
this.uniforms.transformX = this._thickness * Math.cos(this._angle),
this.uniforms.transformY = this._thickness * Math.sin(this._angle)
}
get rotation() {
return this._angle / DEG_TO_RAD
}
set rotation(e) {
this._angle = e * DEG_TO_RAD,
this._updateTransform()
}
get thickness() {
return this._thickness
}
set thickness(e) {
this._thickness = e,
this._updateTransform()
}
get lightColor() {
return rgb2hex(this.uniforms.lightColor)
}
set lightColor(e) {
hex2rgb(e, this.uniforms.lightColor)
}
get lightAlpha() {
return this.uniforms.lightAlpha
}
set lightAlpha(e) {
this.uniforms.lightAlpha = e
}
get shadowColor() {
return rgb2hex(this.uniforms.shadowColor)
}
set shadowColor(e) {
hex2rgb(e, this.uniforms.shadowColor)
}
get shadowAlpha() {
return this.uniforms.shadowAlpha
}
set shadowAlpha(e) {
this.uniforms.shadowAlpha = e
}
}
, p$3 = class extends Filter$2 {
constructor(e=2, t=4, r=settings.FILTER_RESOLUTION, n=5) {
let i, o;
super(),
"number" == typeof e ? (i = e,
o = e) : e instanceof Point ? (i = e.x,
o = e.y) : Array.isArray(e) && (i = e[0],
o = e[1]),
this.blurXFilter = new BlurFilterPass(!0,i,t,r,n),
this.blurYFilter = new BlurFilterPass(!1,o,t,r,n),
this.blurYFilter.blendMode = BLEND_MODES.SCREEN,
this.defaultFilter = new AlphaFilter
}
apply(e, t, r, n) {
const i = e.getFilterTexture();
this.defaultFilter.apply(e, t, r, n),
this.blurXFilter.apply(e, t, i, 1),
this.blurYFilter.apply(e, i, r, 0),
e.returnFilterTexture(i)
}
get blur() {
return this.blurXFilter.blur
}
set blur(e) {
this.blurXFilter.blur = this.blurYFilter.blur = e
}
get blurX() {
return this.blurXFilter.blur
}
set blurX(e) {
this.blurXFilter.blur = e
}
get blurY() {
return this.blurYFilter.blur
}
set blurY(e) {
this.blurYFilter.blur = e
}
}
;
var d$4 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, u$8 = "uniform float radius;\nuniform float strength;\nuniform vec2
center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4
filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\
n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center *
dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n
float percent = distance / radius;\n if (strength > 0.0) {\n
coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n
} else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) *
radius / distance, 1.0 - percent);\n }\n }\n coord += center *
dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord,
filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler,
clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 -
length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n";
const n$b = class extends Filter$2 {
constructor(e) {
super(d$4, u$8),
this.uniforms.dimensions = new Float32Array(2),
Object.assign(this, n$b.defaults, e)
}
apply(e, t, r, n) {
const {width: i, height: o} = t.filterFrame;
this.uniforms.dimensions[0] = i,
this.uniforms.dimensions[1] = o,
e.applyFilter(this, t, r, n)
}
get radius() {
return this.uniforms.radius
}
set radius(e) {
this.uniforms.radius = e
}
get strength() {
return this.uniforms.strength
}
set strength(e) {
this.uniforms.strength = e
}
get center() {
return this.uniforms.center
}
set center(e) {
this.uniforms.center = e
}
}
;
let t$7 = n$b;
t$7.defaults = {
center: [.5, .5],
radius: 100,
strength: 1
};
var Q$1 = "const float PI = 3.1415926538;\nconst float PI_2 = PI*2.;\n\
nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\nuniform sampler2D
uSampler;\n\nconst int TYPE_LINEAR = 0;\nconst int TYPE_RADIAL = 1;\nconst int
TYPE_CONIC = 2;\nconst int MAX_STOPS = 32;\n\nuniform int uNumStops;\nuniform float
uAlphas[3*MAX_STOPS];\nuniform vec3 uColors[MAX_STOPS];\nuniform float
uOffsets[MAX_STOPS];\nuniform int uType;\nuniform float uAngle;\nuniform float
uAlpha;\nuniform int uMaxColors;\nuniform bool uReplace;\n\nstruct ColorStop {\n
float offset;\n vec3 color;\n float alpha;\n};\n\nmat2 rotate2d(float angle)
{\n return mat2(cos(angle), -sin(angle),\n sin(angle), cos(angle));\n}\n\
nfloat projectLinearPosition(vec2 pos, float angle){\n vec2 center = vec2(0.5);\
n vec2 result = pos - center;\n result = rotate2d(angle) * result;\n
result = result + center;\n return clamp(result.x, 0., 1.);\n}\n\nfloat
projectRadialPosition(vec2 pos) {\n float r = distance(vFilterCoord,
vec2(0.5));\n return clamp(2.*r, 0., 1.);\n}\n\nfloat projectAnglePosition(vec2
pos, float angle) {\n vec2 center = pos - vec2(0.5);\n float
polarAngle=atan(-center.y, center.x);\n return mod(polarAngle + angle, PI_2) /
PI_2;\n}\n\nfloat projectPosition(vec2 pos, int type, float angle) {\n if (type
== TYPE_LINEAR) {\n return projectLinearPosition(pos, angle);\n } else if
(type == TYPE_RADIAL) {\n return projectRadialPosition(pos);\n } else if
(type == TYPE_CONIC) {\n return projectAnglePosition(pos, angle);\n }\n\n
return pos.y;\n}\n\nvoid main(void) {\n // current/original color\n vec4
currentColor = texture2D(uSampler, vTextureCoord);\n\n // skip calculations if
gradient alpha is 0\n if (0.0 == uAlpha) {\n gl_FragColor =
currentColor;\n return;\n }\n\n // project position\n float y =
projectPosition(vFilterCoord, uType, radians(uAngle));\n\n // check gradient
bounds\n float offsetMin = uOffsets[0];\n float offsetMax = 0.0;\n\n for
(int i = 0; i < MAX_STOPS; i++) {\n if (i == uNumStops-1){ // last index\n
offsetMax = uOffsets[i];\n }\n }\n\n if (y < offsetMin || y >
offsetMax) {\n gl_FragColor = currentColor;\n return;\n }\n\
n // limit colors\n if (uMaxColors > 0) {\n float stepSize =
1./float(uMaxColors);\n float stepNumber = float(floor(y/stepSize));\n
y = stepSize * (stepNumber + 0.5);// offset by 0.5 to use color from middle of
segment\n }\n\n // find color stops\n ColorStop from;\n ColorStop to;\
n\n for (int i = 0; i < MAX_STOPS; i++) {\n if (y >= uOffsets[i]) {\n
from = ColorStop(uOffsets[i], uColors[i], uAlphas[i]);\n to =
ColorStop(uOffsets[i+1], uColors[i+1], uAlphas[i+1]);\n }\n\n if (i
== uNumStops-1){ // last index\n break;\n }\n }\n\n // mix
colors from stops\n vec4 colorFrom = vec4(from.color * from.alpha, from.alpha);\
n vec4 colorTo = vec4(to.color * to.alpha, to.alpha);\n\n float segmentHeight
= to.offset - from.offset;\n float relativePos = y - from.offset;// position
from 0 to [segmentHeight]\n float relativePercent = relativePos /
segmentHeight;// position in percent between [from.offset] and [to.offset].\n\n
float gradientAlpha = uAlpha * currentColor.a;\n vec4 gradientColor =
mix(colorFrom, colorTo, relativePercent) * gradientAlpha;\n\n if (uReplace ==
false) {\n // mix resulting color with current color\n gl_FragColor =
gradientColor + currentColor*(1.-gradientColor.a);\n } else {\n //
replace with gradient color\n gl_FragColor = gradientColor;\n }\n}\n",
W$1 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform
mat3 projectionMatrix;\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\
nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nvoid main(void)\n{\n
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n
vTextureCoord = aTextureCoord;\n vFilterCoord = vTextureCoord * inputSize.xy /
outputFrame.zw;\n}\n", v$2 = v$2 || {}, e2;
v$2.stringify = (e2 = {
"visit_linear-gradient": function(e) {
return e2.visit_gradient(e)
},
"visit_repeating-linear-gradient": function(e) {
return e2.visit_gradient(e)
},
"visit_radial-gradient": function(e) {
return e2.visit_gradient(e)
},
"visit_repeating-radial-gradient": function(e) {
return e2.visit_gradient(e)
},
visit_gradient: function(e) {
var t = e2.visit(e.orientation);
return t && (t += ", "),
e.type + "(" + t + e2.visit(e.colorStops) + ")"
},
visit_shape: function(e) {
var t = e.value
, r = e2.visit(e.at)
, n = e2.visit(e.style);
return n && (t += " " + n),
r && (t += " at " + r),
t
},
"visit_default-radial": function(e) {
var t = ""
, r = e2.visit(e.at);
return r && (t += r),
t
},
"visit_extent-keyword": function(e) {
var t = e.value
, r = e2.visit(e.at);
return r && (t += " at " + r),
t
},
"visit_position-keyword": function(e) {
return e.value
},
visit_position: function(e) {
return e2.visit(e.value.x) + " " + e2.visit(e.value.y)
},
"visit_%": function(e) {
return e.value + "%"
},
visit_em: function(e) {
return e.value + "em"
},
visit_px: function(e) {
return e.value + "px"
},
visit_literal: function(e) {
return e2.visit_color(e.value, e)
},
visit_hex: function(e) {
return e2.visit_color("#" + e.value, e)
},
visit_rgb: function(e) {
return e2.visit_color("rgb(" + e.value.join(", ") + ")", e)
},
visit_rgba: function(e) {
return e2.visit_color("rgba(" + e.value.join(", ") + ")", e)
},
visit_color: function(e, t) {
var r = e
, n = e2.visit(t.length);
return n && (r += " " + n),
r
},
visit_angular: function(e) {
return e.value + "deg"
},
visit_directional: function(e) {
return "to " + e.value
},
visit_array: function(e) {
var t = ""
, r = e.length;
return e.forEach((function(e, n) {
t += e2.visit(e),
n < r - 1 && (t += ", ")
}
)),
t
},
visit: function(e) {
if (!e)
return "";
if (e instanceof Array)
return e2.visit_array(e, "");
if (e.type) {
var t = e2["visit_" + e.type];
if (t)
return t(e);
throw Error("Missing visitor visit_" + e.type)
}
throw Error("Invalid node.")
}
},
function(e) {
return e2.visit(e)
}
);
var v$2 = v$2 || {};
v$2.parse = function() {
var e = {
linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,
repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-
linear\-gradient)/i,
radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,
repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-
radial\-gradient)/i,
sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|
right|top|bottom)/i,
extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|
farthest\-corner|contain|cover)/,
positionKeywords: /^(left|center|right|top|bottom)/i,
pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
startCall: /^\(/,
endCall: /^\)/,
comma: /^,/,
hexColor: /^\#([0-9a-fA-F]+)/,
literalColor: /^([a-zA-Z]+)/,
rgbColor: /^rgb/i,
rgbaColor: /^rgba/i,
number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/
}
, t = "";
function r(e) {
var r = new Error(t + ": " + e);
throw r.source = t,
r
}
function n() {
var e = h(i);
return t.length > 0 && r("Invalid input not EOF"),
e
}
function i() {
return o("linear-gradient", e.linearGradient, a) || o("repeating-
linear-gradient", e.repeatingLinearGradient, a) || o("radial-gradient",
e.radialGradient, l) || o("repeating-radial-gradient", e.repeatingRadialGradient,
l)
}
function o(t, n, i) {
return s(n, (function(n) {
var o = i();
return o && (b(e.comma) || r("Missing comma before color
stops")),
{
type: t,
orientation: o,
colorStops: h(f)
}
}
))
}
function s(t, n) {
var i = b(t);
if (i) {
b(e.startCall) || r("Missing (");
var o = n(i);
return b(e.endCall) || r("Missing )"),
o
}
}
function a() {
return v("directional", e.sideOrCorner, 1) || v("angular",
e.angleValue, 1)
}
function l() {
var r, n, i = c();
return i && ((r = []).push(i),
n = t,
b(e.comma) && ((i = c()) ? r.push(i) : t = n)),
r
}
function c() {
var e = function() {
var e = v("shape", /^(circle)/i, 0);
return e && (e.style = y() || u()),
e
}() || function() {
var e = v("shape", /^(ellipse)/i, 0);
return e && (e.style = g() || u()),
e
}();
if (e)
e.at = d();
else {
var t = u();
if (t) {
e = t;
var r = d();
r && (e.at = r)
} else {
var n = p();
n && (e = {
type: "default-radial",
at: n
})
}
}
return e
}
function u() {
return v("extent-keyword", e.extentKeywords, 1)
}
function d() {
if (v("position", /^at/, 0)) {
var e = p();
return e || r("Missing positioning value"),
e
}
}
function p() {
var e = {
x: g(),
y: g()
};
if (e.x || e.y)
return {
type: "position",
value: e
}
}
function h(t) {
var n = t()
, i = [];
if (n)
for (i.push(n); b(e.comma); )
(n = t()) ? i.push(n) : r("One extra comma");
return i
}
function f() {
var t = v("hex", e.hexColor, 1) || s(e.rgbaColor, (function() {
return {
type: "rgba",
value: h(m)
}
}
)) || s(e.rgbColor, (function() {
return {
type: "rgb",
value: h(m)
}
}
)) || v("literal", e.literalColor, 0);
return t || r("Expected color definition"),
t.length = g(),
t
}
function m() {
return b(e.number)[1]
}
function g() {
return v("%", e.percentageValue, 1) || v("position-keyword",
e.positionKeywords, 1) || y()
}
function y() {
return v("px", e.pixelValue, 1) || v("em", e.emValue, 1)
}
function v(e, t, r) {
var n = b(t);
if (n)
return {
type: e,
value: n[r]
}
}
function b(e) {
var r, n;
return (n = /^[\n\r\t\s]+/.exec(t)) && x(n[0].length),
(r = e.exec(t)) && x(r[0].length),
r
}
function x(e) {
t = t.substr(e)
}
return function(e) {
return t = e.toString(),
n()
}
}();
var ee$1 = v$2.parse;
v$2.stringify;
var j$1 = {
aliceblue: [240, 248, 255],
antiquewhite: [250, 235, 215],
aqua: [0, 255, 255],
aquamarine: [127, 255, 212],
azure: [240, 255, 255],
beige: [245, 245, 220],
bisque: [255, 228, 196],
black: [0, 0, 0],
blanchedalmond: [255, 235, 205],
blue: [0, 0, 255],
blueviolet: [138, 43, 226],
brown: [165, 42, 42],
burlywood: [222, 184, 135],
cadetblue: [95, 158, 160],
chartreuse: [127, 255, 0],
chocolate: [210, 105, 30],
coral: [255, 127, 80],
cornflowerblue: [100, 149, 237],
cornsilk: [255, 248, 220],
crimson: [220, 20, 60],
cyan: [0, 255, 255],
darkblue: [0, 0, 139],
darkcyan: [0, 139, 139],
darkgoldenrod: [184, 134, 11],
darkgray: [169, 169, 169],
darkgreen: [0, 100, 0],
darkgrey: [169, 169, 169],
darkkhaki: [189, 183, 107],
darkmagenta: [139, 0, 139],
darkolivegreen: [85, 107, 47],
darkorange: [255, 140, 0],
darkorchid: [153, 50, 204],
darkred: [139, 0, 0],
darksalmon: [233, 150, 122],
darkseagreen: [143, 188, 143],
darkslateblue: [72, 61, 139],
darkslategray: [47, 79, 79],
darkslategrey: [47, 79, 79],
darkturquoise: [0, 206, 209],
darkviolet: [148, 0, 211],
deeppink: [255, 20, 147],
deepskyblue: [0, 191, 255],
dimgray: [105, 105, 105],
dimgrey: [105, 105, 105],
dodgerblue: [30, 144, 255],
firebrick: [178, 34, 34],
floralwhite: [255, 250, 240],
forestgreen: [34, 139, 34],
fuchsia: [255, 0, 255],
gainsboro: [220, 220, 220],
ghostwhite: [248, 248, 255],
gold: [255, 215, 0],
goldenrod: [218, 165, 32],
gray: [128, 128, 128],
green: [0, 128, 0],
greenyellow: [173, 255, 47],
grey: [128, 128, 128],
honeydew: [240, 255, 240],
hotpink: [255, 105, 180],
indianred: [205, 92, 92],
indigo: [75, 0, 130],
ivory: [255, 255, 240],
khaki: [240, 230, 140],
lavender: [230, 230, 250],
lavenderblush: [255, 240, 245],
lawngreen: [124, 252, 0],
lemonchiffon: [255, 250, 205],
lightblue: [173, 216, 230],
lightcoral: [240, 128, 128],
lightcyan: [224, 255, 255],
lightgoldenrodyellow: [250, 250, 210],
lightgray: [211, 211, 211],
lightgreen: [144, 238, 144],
lightgrey: [211, 211, 211],
lightpink: [255, 182, 193],
lightsalmon: [255, 160, 122],
lightseagreen: [32, 178, 170],
lightskyblue: [135, 206, 250],
lightslategray: [119, 136, 153],
lightslategrey: [119, 136, 153],
lightsteelblue: [176, 196, 222],
lightyellow: [255, 255, 224],
lime: [0, 255, 0],
limegreen: [50, 205, 50],
linen: [250, 240, 230],
magenta: [255, 0, 255],
maroon: [128, 0, 0],
mediumaquamarine: [102, 205, 170],
mediumblue: [0, 0, 205],
mediumorchid: [186, 85, 211],
mediumpurple: [147, 112, 219],
mediumseagreen: [60, 179, 113],
mediumslateblue: [123, 104, 238],
mediumspringgreen: [0, 250, 154],
mediumturquoise: [72, 209, 204],
mediumvioletred: [199, 21, 133],
midnightblue: [25, 25, 112],
mintcream: [245, 255, 250],
mistyrose: [255, 228, 225],
moccasin: [255, 228, 181],
navajowhite: [255, 222, 173],
navy: [0, 0, 128],
oldlace: [253, 245, 230],
olive: [128, 128, 0],
olivedrab: [107, 142, 35],
orange: [255, 165, 0],
orangered: [255, 69, 0],
orchid: [218, 112, 214],
palegoldenrod: [238, 232, 170],
palegreen: [152, 251, 152],
paleturquoise: [175, 238, 238],
palevioletred: [219, 112, 147],
papayawhip: [255, 239, 213],
peachpuff: [255, 218, 185],
peru: [205, 133, 63],
pink: [255, 192, 203],
plum: [221, 160, 221],
powderblue: [176, 224, 230],
purple: [128, 0, 128],
rebeccapurple: [102, 51, 153],
red: [255, 0, 0],
rosybrown: [188, 143, 143],
royalblue: [65, 105, 225],
saddlebrown: [139, 69, 19],
salmon: [250, 128, 114],
sandybrown: [244, 164, 96],
seagreen: [46, 139, 87],
seashell: [255, 245, 238],
sienna: [160, 82, 45],
silver: [192, 192, 192],
skyblue: [135, 206, 235],
slateblue: [106, 90, 205],
slategray: [112, 128, 144],
slategrey: [112, 128, 144],
snow: [255, 250, 250],
springgreen: [0, 255, 127],
steelblue: [70, 130, 180],
tan: [210, 180, 140],
teal: [0, 128, 128],
thistle: [216, 191, 216],
tomato: [255, 99, 71],
turquoise: [64, 224, 208],
violet: [238, 130, 238],
wheat: [245, 222, 179],
white: [255, 255, 255],
whitesmoke: [245, 245, 245],
yellow: [255, 255, 0],
yellowgreen: [154, 205, 50]
}
, G$1 = {
red: 0,
orange: 60,
yellow: 120,
green: 180,
blue: 240,
purple: 300
};
function te$1(e) {
var t, r, n = [], i = 1;
if ("string" == typeof e)
if (j$1[e])
n = j$1[e].slice(),
r = "rgb";
else if ("transparent" === e)
i = 0,
r = "rgb",
n = [0, 0, 0];
else if (/^#[A-Fa-f0-9]+$/.test(e)) {
var o = e.slice(1);
i = 1,
(l = o.length) <= 4 ? (n = [parseInt(o[0] + o[0], 16),
parseInt(o[1] + o[1], 16), parseInt(o[2] + o[2], 16)],
4 === l && (i = parseInt(o[3] + o[3], 16) / 255)) : (n =
[parseInt(o[0] + o[1], 16), parseInt(o[2] + o[3], 16), parseInt(o[4] + o[5], 16)],
8 === l && (i = parseInt(o[6] + o[7], 16) / 255)),
n[0] || (n[0] = 0),
n[1] || (n[1] = 0),
n[2] || (n[2] = 0),
r = "rgb"
} else if (t = /^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|
[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)) {
var s = t[1]
, a = "rgb" === s;
r = o = s.replace(/a$/, "");
var l = "cmyk" === o ? 4 : "gray" === o ? 1 : 3;
n = t[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(e, t) {
if (/%$/.test(e))
return t === l ? parseFloat(e) / 100 : "rgb" === o ?
255 * parseFloat(e) / 100 : parseFloat(e);
if ("h" === o[t]) {
if (/deg$/.test(e))
return parseFloat(e);
if (void 0 !== G$1[e])
return G$1[e]
}
return parseFloat(e)
}
)),
s === o && n.push(1),
i = a || void 0 === n[l] ? 1 : n[l],
n = n.slice(0, l)
} else
e.length > 10 && /[0-9](?:\s|\/)/.test(e) && (n = e.match(/([0-
9]+)/g).map((function(e) {
return parseFloat(e)
}
)),
r = e.match(/([a-z])/gi).join("").toLowerCase());
else
isNaN(e) ? Array.isArray(e) || e.length ? (n = [e[0], e[1], e[2]],
r = "rgb",
i = 4 === e.length ? e[3] : 1) : e instanceof Object && (null !=
e.r || null != e.red || null != e.R ? (r = "rgb",
n = [e.r || e.red || e.R || 0, e.g || e.green || e.G || 0, e.b ||
e.blue || e.B || 0]) : (r = "hsl",
n = [e.h || e.hue || e.H || 0, e.s || e.saturation || e.S || 0, e.l
|| e.lightness || e.L || e.b || e.brightness]),
i = e.a || e.alpha || e.opacity || 1,
null != e.opacity && (i /= 100)) : (r = "rgb",
n = [e >>> 16, (65280 & e) >>> 8, 255 & e]);
return {
space: r,
values: n,
alpha: i
}
}
var S$1 = {
name: "rgb",
min: [0, 0, 0],
max: [255, 255, 255],
channel: ["red", "green", "blue"],
alias: ["RGB"]
}
, k$1 = {
name: "hsl",
min: [0, 0, 0],
max: [360, 100, 100],
channel: ["hue", "saturation", "lightness"],
alias: ["HSL"],
rgb: function(e) {
var t, r, n, i, o, s = e[0] / 360, a = e[1] / 100, l = e[2] / 100;
if (0 === a)
return [o = 255 * l, o, o];
t = 2 * l - (r = l < .5 ? l * (1 + a) : l + a - l * a),
i = [0, 0, 0];
for (var c = 0; c < 3; c++)
(n = s + 1 / 3 * -(c - 1)) < 0 ? n++ : n > 1 && n--,
o = 6 * n < 1 ? t + 6 * (r - t) * n : 2 * n < 1 ? r : 3 * n < 2
? t + (r - t) * (2 / 3 - n) * 6 : t,
i[c] = 255 * o;
return i
}
};
function re$1(e) {
Array.isArray(e) && e.raw && (e = String.raw(...arguments));
var t, r = te$1(e);
if (!r.space)
return [];
const n = "h" === r.space[0] ? k$1.min : S$1.min
, i = "h" === r.space[0] ? k$1.max : S$1.max;
return (t = Array(3))[0] = Math.min(Math.max(r.values[0], n[0]), i[0]),
t[1] = Math.min(Math.max(r.values[1], n[1]), i[1]),
t[2] = Math.min(Math.max(r.values[2], n[2]), i[2]),
"h" === r.space[0] && (t = k$1.rgb(t)),
t.push(Math.min(Math.max(r.alpha, 0), 1)),
t
}
function L$1(e) {
switch (typeof e) {
case "string":
return ne$1(e);
case "number":
return hex2rgb(e);
default:
return e
}
}
function ne$1(e) {
const t = re$1(e);
if (!t)
throw new Error(`Unable to parse color "${e}" as RGBA.`);
return [t[0] / 255, t[1] / 255, t[2] / 255, t[3]]
}
function ie$1(e) {
const t = ee$1(ge$1(e));
if (0 === t.length)
throw new Error("Invalid CSS gradient.");
if (1 !== t.length)
throw new Error("Unsupported CSS gradient (multiple gradients is
not supported).");
const r = t[0];
return {
type: oe$1(r.type),
stops: ae$1(r.colorStops),
angle: ce$1(r.orientation)
}
}
function oe$1(e) {
const t = {
"linear-gradient": 0,
"radial-gradient": 1
};
if (!(e in t))
throw new Error(`Unsupported gradient type "${e}"`);
return t[e]
}
function ae$1(e) {
const t = ue$1(e)
, r = [];
for (let n = 0; n < e.length; n++) {
const i = le$1(e[n]);
r.push({
offset: t[n],
color: i.slice(0, 3),
alpha: i[3]
})
}
return r
}
function le$1(e) {
return L$1(se$1(e))
}
function se$1(e) {
switch (e.type) {
case "hex":
return `#${e.value}`;
case "literal":
return e.value;
default:
return `${e.type}(${e.value.join(",")})`
}
}
function ue$1(e) {
const t = [];
for (let i = 0; i < e.length; i++) {
const r = e[i];
let n = -1;
"literal" === r.type && r.length && "type"in r.length && "%" ===
r.length.type && "value"in r.length && (n = parseFloat(r.length.value) / 100),
t.push(n)
}
const r = e => {
for (let r = e; r < t.length; r++)
if (-1 !== t[r])
return {
indexDelta: r - e,
offset: t[r]
};
return {
indexDelta: t.length - 1 - e,
offset: 1
}
}
;
let n = 0;
for (let i = 0; i < t.length; i++) {
const e = t[i];
if (-1 !== e)
n = e;
else if (0 === i)
t[i] = 0;
else if (i + 1 === t.length)
t[i] = 1;
else {
const e = r(i)
, o = (e.offset - n) / (1 + e.indexDelta);
for (let r = 0; r <= e.indexDelta; r++)
t[i + r] = n + (r + 1) * o;
i += e.indexDelta,
n = t[i]
}
}
return t.map(fe$1)
}
function fe$1(e) {
return e.toString().length > 6 ? parseFloat(e.toString().substring(0,
6)) : e
}
function ce$1(e) {
if (void 0 === e)
return 0;
if ("type"in e && "value"in e)
switch (e.type) {
case "angular":
return parseFloat(e.value);
case "directional":
return pe$1(e.value)
}
return 0
}
function pe$1(e) {
const t = {
left: 270,
top: 0,
bottom: 180,
right: 90,
"left top": 315,
"top left": 315,
"left bottom": 225,
"bottom left": 225,
"right top": 45,
"top right": 45,
"right bottom": 135,
"bottom right": 135
};
if (!(e in t))
throw new Error(`Unsupported directional value "${e}"`);
return t[e]
}
function ge$1(e) {
let t = e.replace(/\s{2,}/gu, " ");
return t = t.replace(/;/g, ""),
t = t.replace(/ ,/g, ","),
t = t.replace(/\( /g, "("),
t = t.replace(/ \)/g, ")"),
t.trim()
}
S$1.hsl = function(e) {
var t, r, n = e[0] / 255, i = e[1] / 255, o = e[2] / 255, s =
Math.min(n, i, o), a = Math.max(n, i, o), l = a - s;
return a === s ? t = 0 : n === a ? t = (i - o) / l : i === a ? t = 2 +
(o - n) / l : o === a && (t = 4 + (n - i) / l),
(t = Math.min(60 * t, 360)) < 0 && (t += 360),
r = (s + a) / 2,
[t, 100 * (a === s ? 0 : r <= .5 ? l / (a + s) : l / (2 - a - s)), 100
* r]
}
;
var he$1 = Object.defineProperty
, me$1 = Object.defineProperties
, de$1 = Object.getOwnPropertyDescriptors
, N$1 = Object.getOwnPropertySymbols
, ve$1 = Object.prototype.hasOwnProperty
, ye$1 = Object.prototype.propertyIsEnumerable
, z$2 = (e, t, r) => t in e ? he$1(e, t, {
enumerable: !0,
configurable: !0,
writable: !0,
value: r
}) : e[t] = r
, P$2 = (e, t) => {
for (var r in t || (t = {}))
ve$1.call(t, r) && z$2(e, r, t[r]);
if (N$1)
for (var r of N$1(t))
ye$1.call(t, r) && z$2(e, r, t[r]);
return e
}
, be$1 = (e, t) => me$1(e, de$1(t));
const D$1 = 90;
function Ce$1(e) {
return [...e].sort(( (e, t) => e.offset - t.offset))
}
const y$1 = class extends Filter$2 {
constructor(e) {
var t, r;
let n;
if (n = e && "css"in e ? be$1(P$2({}, ie$1(e.css || "")), {
alpha: null != (t = e.alpha) ? t : y$1.defaults.alpha,
maxColors: null != (r = e.maxColors) ? r :
y$1.defaults.maxColors
}) : P$2(P$2({}, y$1.defaults), e),
!n.stops || n.stops.length < 2)
throw new Error("ColorGradientFilter requires at least 2 color
stops.");
super(W$1, Q$1),
this._stops = [],
this.autoFit = !1,
Object.assign(this, n)
}
get stops() {
return this._stops
}
set stops(e) {
const t = Ce$1(e)
, r = new Float32Array(3 * t.length);
for (let n = 0; n < t.length; n++) {
const e = L$1(t[n].color)
, i = 3 * n;
r[i + 0] = e[0],
r[i + 1] = e[1],
r[i + 2] = e[2]
}
this.uniforms.uColors = r,
this.uniforms.uOffsets = t.map((e => e.offset)),
this.uniforms.uAlphas = t.map((e => e.alpha)),
this.uniforms.uNumStops = t.length,
this._stops = t
}
set type(e) {
this.uniforms.uType = e
}
get type() {
return this.uniforms.uType
}
set angle(e) {
this.uniforms.uAngle = e - D$1
}
get angle() {
return this.uniforms.uAngle + D$1
}
set alpha(e) {
this.uniforms.uAlpha = e
}
get alpha() {
return this.uniforms.uAlpha
}
set maxColors(e) {
this.uniforms.uMaxColors = e
}
get maxColors() {
return this.uniforms.uMaxColors
}
set replace(e) {
this.uniforms.uReplace = e
}
get replace() {
return this.uniforms.uReplace
}
}
;
let b$2 = y$1;
b$2.LINEAR = 0,
b$2.RADIAL = 1,
b$2.CONIC = 2,
b$2.defaults = {
type: y$1.LINEAR,
stops: [{
offset: 0,
color: 16711680,
alpha: 1
}, {
offset: 1,
color: 255,
alpha: 1
}],
alpha: 1,
angle: 90,
maxColors: 0,
replace: !1
};
var a$b = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, c$9 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform
float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\
nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4
adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float
innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth),
innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n
float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float
s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 *
_sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 -
_sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n
vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset =
fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color,
zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor =
vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}";
let u$7 = class extends Filter$2 {
constructor(e, t=!1, r=1) {
super(a$b, c$9),
this.mix = 1,
this._size = 0,
this._sliceSize = 0,
this._slicePixelSize = 0,
this._sliceInnerSize = 0,
this._nearest = !1,
this._scaleMode = null,
this._colorMap = null,
this._scaleMode = null,
this.nearest = t,
this.mix = r,
this.colorMap = e
}
apply(e, t, r, n) {
this.uniforms._mix = this.mix,
e.applyFilter(this, t, r, n)
}
get colorSize() {
return this._size
}
get colorMap() {
return this._colorMap
}
set colorMap(e) {
!e || (e instanceof Texture || (e = Texture.from(e)),
null != e && e.baseTexture && (e.baseTexture.scaleMode =
this._scaleMode,
e.baseTexture.mipmap = MIPMAP_MODES.OFF,
this._size = e.height,
this._sliceSize = 1 / this._size,
this._slicePixelSize = this._sliceSize / this._size,
this._sliceInnerSize = this._slicePixelSize * (this._size - 1),
this.uniforms._size = this._size,
this.uniforms._sliceSize = this._sliceSize,
this.uniforms._slicePixelSize = this._slicePixelSize,
this.uniforms._sliceInnerSize = this._sliceInnerSize,
this.uniforms.colorMap = e),
this._colorMap = e)
}
get nearest() {
return this._nearest
}
set nearest(e) {
this._nearest = e,
this._scaleMode = e ? SCALE_MODES.NEAREST : SCALE_MODES.LINEAR;
const t = this._colorMap;
t && t.baseTexture && (t.baseTexture._glTextures = {},
t.baseTexture.scaleMode = this._scaleMode,
t.baseTexture.mipmap = MIPMAP_MODES.OFF,
t._updateID++,
t.baseTexture.emit("update", t.baseTexture))
}
updateColorMap() {
const e = this._colorMap;
e && e.baseTexture && (e._updateID++,
e.baseTexture.emit("update", e.baseTexture),
this.colorMap = e)
}
destroy(e=!1) {
this._colorMap && this._colorMap.destroy(e),
super.destroy()
}
}
;
var n$a = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, a$a = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform vec3 color;\nuniform float alpha;\n\nvoid main(void) {\n vec4
currentColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor =
vec4(mix(currentColor.rgb, color.rgb, currentColor.a * alpha), currentColor.a);\n}\
n";
let i$e = class extends Filter$2 {
constructor(e=0, t=1) {
super(n$a, a$a),
this._color = 0,
this._alpha = 1,
this.uniforms.color = new Float32Array(3),
this.color = e,
this.alpha = t
}
set color(e) {
const t = this.uniforms.color;
"number" == typeof e ? (hex2rgb(e, t),
this._color = e) : (t[0] = e[0],
t[1] = e[1],
t[2] = e[2],
this._color = rgb2hex(t))
}
get color() {
return this._color
}
set alpha(e) {
this.uniforms.alpha = e,
this._alpha = e
}
get alpha() {
return this._alpha
}
}
;
var t$6 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, l$9 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid
main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3
colorDiff = originalColor - (currentColor.rgb / max(currentColor.a,
0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace
= step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb,
(newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n";
let s$5 = class extends Filter$2 {
constructor(e=16711680, t=0, r=.4) {
super(t$6, l$9),
this._originalColor = 16711680,
this._newColor = 0,
this.uniforms.originalColor = new Float32Array(3),
this.uniforms.newColor = new Float32Array(3),
this.originalColor = e,
this.newColor = t,
this.epsilon = r
}
set originalColor(e) {
const t = this.uniforms.originalColor;
"number" == typeof e ? (hex2rgb(e, t),
this._originalColor = e) : (t[0] = e[0],
t[1] = e[1],
t[2] = e[2],
this._originalColor = rgb2hex(t))
}
get originalColor() {
return this._originalColor
}
set newColor(e) {
const t = this.uniforms.newColor;
"number" == typeof e ? (hex2rgb(e, t),
this._newColor = e) : (t[0] = e[0],
t[1] = e[1],
t[2] = e[2],
this._newColor = rgb2hex(t))
}
get newColor() {
return this._newColor
}
set epsilon(e) {
this.uniforms.epsilon = e
}
get epsilon() {
return this.uniforms.epsilon
}
}
;
var o$9 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, x$3 = "precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\
n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\
n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord -
texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x,
vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler,
vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\
n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x,
vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler,
vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler,
vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31
= texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y +
texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler,
vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4
c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n
gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n
c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32
* matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n";
let n$9 = class extends Filter$2 {
constructor(e, t=200, r=200) {
super(o$9, x$3),
this.uniforms.texelSize = new Float32Array(2),
this.uniforms.matrix = new Float32Array(9),
void 0 !== e && (this.matrix = e),
this.width = t,
this.height = r
}
get matrix() {
return this.uniforms.matrix
}
set matrix(e) {
e.forEach(( (e, t) => {
this.uniforms.matrix[t] = e
}
))
}
get width() {
return 1 / this.uniforms.texelSize[0]
}
set width(e) {
this.uniforms.texelSize[0] = 1 / e
}
get height() {
return 1 / this.uniforms.texelSize[1]
}
set height(e) {
this.uniforms.texelSize[1] = 1 / e
}
}
;
var r$7 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, o$8 = "precision mediump float;\n\nvarying vec2 vTextureCoord;\n\
nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum =
length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0,
1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x +
gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0,
0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if
(mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n
{\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\
n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if
(lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) ==
0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n
}\n}\n";
let e$5 = class extends Filter$2 {
constructor() {
super(r$7, o$8)
}
}
;
var a$9 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, g$2 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\
nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 =
1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float
lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float
noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float
vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform
float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898,
78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord =
vTextureCoord.xy * filterArea.xy;\n vec2 dir = vec2(vTextureCoord.xy *
filterArea.xy / dimensions - vec2(0.5, 0.5));\n \n gl_FragColor =
texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n if
(noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x =
floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y /
noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n
rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0)\n {\n float _c
= curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir *
dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n
float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0
/ lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 *
lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x
+ .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *=
0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n
float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter
- length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n
rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n
gl_FragColor.rgb = rgb;\n}\n";
const e$4 = class extends Filter$2 {
constructor(e) {
super(a$9, g$2),
this.time = 0,
this.seed = 0,
this.uniforms.dimensions = new Float32Array(2),
Object.assign(this, e$4.defaults, e)
}
apply(e, t, r, n) {
const {width: i, height: o} = t.filterFrame;
this.uniforms.dimensions[0] = i,
this.uniforms.dimensions[1] = o,
this.uniforms.seed = this.seed,
this.uniforms.time = this.time,
e.applyFilter(this, t, r, n)
}
set curvature(e) {
this.uniforms.curvature = e
}
get curvature() {
return this.uniforms.curvature
}
set lineWidth(e) {
this.uniforms.lineWidth = e
}
get lineWidth() {
return this.uniforms.lineWidth
}
set lineContrast(e) {
this.uniforms.lineContrast = e
}
get lineContrast() {
return this.uniforms.lineContrast
}
set verticalLine(e) {
this.uniforms.verticalLine = e
}
get verticalLine() {
return this.uniforms.verticalLine
}
set noise(e) {
this.uniforms.noise = e
}
get noise() {
return this.uniforms.noise
}
set noiseSize(e) {
this.uniforms.noiseSize = e
}
get noiseSize() {
return this.uniforms.noiseSize
}
set vignetting(e) {
this.uniforms.vignetting = e
}
get vignetting() {
return this.uniforms.vignetting
}
set vignettingAlpha(e) {
this.uniforms.vignettingAlpha = e
}
get vignettingAlpha() {
return this.uniforms.vignettingAlpha
}
set vignettingBlur(e) {
this.uniforms.vignettingBlur = e
}
get vignettingBlur() {
return this.uniforms.vignettingBlur
}
}
;
let t$5 = e$4;
t$5.defaults = {
curvature: 1,
lineWidth: 1,
lineContrast: .25,
verticalLine: !1,
noise: 0,
noiseSize: 1,
seed: 0,
vignetting: .3,
vignettingAlpha: 1,
vignettingBlur: .3,
time: 0
};
var t$4 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, a$8 = "precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying
vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform
float angle;\nuniform float scale;\nuniform bool grayscale;\n\nfloat pattern()\n{\n
float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord *
filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s *
tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\
n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n vec3
colorRGB = vec3(color);\n\n if (grayscale)\n {\n colorRGB = vec3(color.r
+ color.g + color.b) / 3.0;\n }\n\n gl_FragColor = vec4(colorRGB * 10.0 - 5.0 +
pattern(), color.a);\n}\n";
let i$d = class extends Filter$2 {
constructor(e=1, t=5, r=!0) {
super(t$4, a$8),
this.scale = e,
this.angle = t,
this.grayscale = r
}
get scale() {
return this.uniforms.scale
}
set scale(e) {
this.uniforms.scale = e
}
get angle() {
return this.uniforms.angle
}
set angle(e) {
this.uniforms.angle = e
}
get grayscale() {
return this.uniforms.grayscale
}
set grayscale(e) {
this.uniforms.grayscale = e
}
}
;
var w$1 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, O$1 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform float alpha;\nuniform vec3 color;\n\nuniform vec2 shift;\nuniform vec4
inputSize;\n\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord
- shift * inputSize.zw);\n\n // Premultiply alpha\n sample.rgb = color.rgb *
sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor =
sample;\n}"
, P$1 = Object.defineProperty
, c$8 = Object.getOwnPropertySymbols
, T$1 = Object.prototype.hasOwnProperty
, z$1 = Object.prototype.propertyIsEnumerable
, _$1 = (e, t, r) => t in e ? P$1(e, t, {
enumerable: !0,
configurable: !0,
writable: !0,
value: r
}) : e[t] = r
, b$1 = (e, t) => {
for (var r in t || (t = {}))
T$1.call(t, r) && _$1(e, r, t[r]);
if (c$8)
for (var r of c$8(t))
z$1.call(t, r) && _$1(e, r, t[r]);
return e
}
;
const o$7 = class extends Filter$2 {
constructor(e) {
super(),
this.angle = 45,
this._distance = 5,
this._resolution = settings.FILTER_RESOLUTION;
const t = e ? b$1(b$1({}, o$7.defaults), e) : o$7.defaults
, {kernels: r, blur: n, quality: i, pixelSize: o, resolution: s}
= t;
this._offset = new ObservablePoint(this._updatePadding,this),
this._tintFilter = new Filter$2(w$1,O$1),
this._tintFilter.uniforms.color = new Float32Array(4),
this._tintFilter.uniforms.shift = this._offset,
this._tintFilter.resolution = s,
this._blurFilter = r ? new _$2(r) : new _$2(n,i),
this.pixelSize = o,
this.resolution = s;
const {shadowOnly: a, rotation: l, distance: c, offset: u, alpha:
d, color: p} = t;
this.shadowOnly = a,
void 0 !== l && void 0 !== c ? (this.rotation = l,
this.distance = c) : this.offset = u,
this.alpha = d,
this.color = p
}
apply(e, t, r, n) {
const i = e.getFilterTexture();
this._tintFilter.apply(e, t, i, 1),
this._blurFilter.apply(e, i, r, n),
!0 !== this.shadowOnly && e.applyFilter(this, t, r, 0),
e.returnFilterTexture(i)
}
_updatePadding() {
const e = Math.max(Math.abs(this._offset.x),
Math.abs(this._offset.y));
this.padding = e + 2 * this.blur
}
_updateShift() {
this._tintFilter.uniforms.shift.set(this.distance *
Math.cos(this.angle), this.distance * Math.sin(this.angle))
}
set offset(e) {
this._offset.copyFrom(e),
this._updatePadding()
}
get offset() {
return this._offset
}
get resolution() {
return this._resolution
}
set resolution(e) {
this._resolution = e,
this._tintFilter && (this._tintFilter.resolution = e),
this._blurFilter && (this._blurFilter.resolution = e)
}
get distance() {
return this._distance
}
set distance(e) {
deprecation("5.3.0", "DropShadowFilter distance is deprecated, use
offset"),
this._distance = e,
this._updatePadding(),
this._updateShift()
}
get rotation() {
return this.angle / DEG_TO_RAD
}
set rotation(e) {
deprecation("5.3.0", "DropShadowFilter rotation is deprecated, use
offset"),
this.angle = e * DEG_TO_RAD,
this._updateShift()
}
get alpha() {
return this._tintFilter.uniforms.alpha
}
set alpha(e) {
this._tintFilter.uniforms.alpha = e
}
get color() {
return rgb2hex(this._tintFilter.uniforms.color)
}
set color(e) {
hex2rgb(e, this._tintFilter.uniforms.color)
}
get kernels() {
return this._blurFilter.kernels
}
set kernels(e) {
this._blurFilter.kernels = e
}
get blur() {
return this._blurFilter.blur
}
set blur(e) {
this._blurFilter.blur = e,
this._updatePadding()
}
get quality() {
return this._blurFilter.quality
}
set quality(e) {
this._blurFilter.quality = e
}
get pixelSize() {
return this._blurFilter.pixelSize
}
set pixelSize(e) {
this._blurFilter.pixelSize = e
}
}
;
let F$1 = o$7;
F$1.defaults = {
offset: {
x: 4,
y: 4
},
color: 0,
alpha: .5,
shadowOnly: !1,
kernels: null,
blur: 2,
quality: 3,
pixelSize: 1,
resolution: settings.FILTER_RESOLUTION
};
var t$3 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, o$6 = "precision mediump float;\n\nvarying vec2 vTextureCoord;\n\
nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\
n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\
n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord -
onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) *
strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat
alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb *
alpha, alpha);\n}\n";
let n$8 = class extends Filter$2 {
constructor(e=5) {
super(t$3, o$6),
this.strength = e
}
get strength() {
return this.uniforms.strength
}
set strength(e) {
this.uniforms.strength = e
}
}
;
var p$2 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, M$1 = "// precision highp float;\n\nvarying vec2 vTextureCoord;\
nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4
filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D
displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float
cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform
vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL =
1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid
main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n
if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx =
coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir *
cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny
> 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n
ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc =
texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r -
dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir *
displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n
coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n
if( coord.x > filterClamp.z ) {\n if (fillMode == TRANSPARENT) {\n
discard;\n } else if (fillMode == LOOP) {\n coord.x -=
filterClamp.z;\n } else if (fillMode == MIRROR) {\n
coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if( coord.x
< filterClamp.x ) {\n if (fillMode == TRANSPARENT) {\n
discard;\n } else if (fillMode == LOOP) {\n coord.x +=
filterClamp.z;\n } else if (fillMode == MIRROR) {\n
coord.x *= -filterClamp.z;\n }\n }\n\n if( coord.y >
filterClamp.w ) {\n if (fillMode == TRANSPARENT) {\n
discard;\n } else if (fillMode == LOOP) {\n coord.y -=
filterClamp.w;\n } else if (fillMode == MIRROR) {\n
coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if( coord.y
< filterClamp.y ) {\n if (fillMode == TRANSPARENT) {\n
discard;\n } else if (fillMode == LOOP) {\n coord.y +=
filterClamp.w;\n } else if (fillMode == MIRROR) {\n
coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r =
texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n
gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) /
filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 -
seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler,
coord).a;\n}\n";
const c$7 = class extends Filter$2 {
constructor(e) {
super(p$2, M$1),
this.offset = 100,
this.fillMode = c$7.TRANSPARENT,
this.average = !1,
this.seed = 0,
this.minSize = 8,
this.sampleSize = 512,
this._slices = 0,
this._offsets = new Float32Array(1),
this._sizes = new Float32Array(1),
this._direction = -1,
this.uniforms.dimensions = new Float32Array(2),
this._canvas = document.createElement("canvas"),
this._canvas.width = 4,
this._canvas.height = this.sampleSize,
this.texture = Texture.from(this._canvas, {
scaleMode: SCALE_MODES.NEAREST
}),
Object.assign(this, c$7.defaults, e)
}
apply(e, t, r, n) {
const {width: i, height: o} = t.filterFrame;
this.uniforms.dimensions[0] = i,
this.uniforms.dimensions[1] = o,
this.uniforms.aspect = o / i,
this.uniforms.seed = this.seed,
this.uniforms.offset = this.offset,
this.uniforms.fillMode = this.fillMode,
e.applyFilter(this, t, r, n)
}
_randomizeSizes() {
const e = this._sizes
, t = this._slices - 1
, r = this.sampleSize
, n = Math.min(this.minSize / r, .9 / this._slices);
if (this.average) {
const r = this._slices;
let i = 1;
for (let o = 0; o < t; o++) {
const t = i / (r - o)
, s = Math.max(t * (1 - .6 * Math.random()), n);
e[o] = s,
i -= s
}
e[t] = i
} else {
let r = 1;
const i = Math.sqrt(1 / this._slices);
for (let o = 0; o < t; o++) {
const t = Math.max(i * r * Math.random(), n);
e[o] = t,
r -= t
}
e[t] = r
}
this.shuffle()
}
shuffle() {
const e = this._sizes;
for (let t = this._slices - 1; t > 0; t--) {
const r = Math.random() * t | 0
, n = e[t];
e[t] = e[r],
e[r] = n
}
}
_randomizeOffsets() {
for (let e = 0; e < this._slices; e++)
this._offsets[e] = Math.random() * (Math.random() < .5 ? -1 :
1)
}
refresh() {
this._randomizeSizes(),
this._randomizeOffsets(),
this.redraw()
}
redraw() {
const e = this.sampleSize
, t = this.texture
, r = this._canvas.getContext("2d");
r.clearRect(0, 0, 8, e);
let n, i = 0;
for (let o = 0; o < this._slices; o++) {
n = Math.floor(256 * this._offsets[o]);
const t = this._sizes[o] * e
, s = n > 0 ? n : 0
, a = n < 0 ? -n : 0;
r.fillStyle = `rgba(${s}, ${a}, 0, 1)`,
r.fillRect(0, i | 0, e, t + 1 | 0),
i += t
}
t.baseTexture.update(),
this.uniforms.displacementMap = t
}
set sizes(e) {
const t = Math.min(this._slices, e.length);
for (let r = 0; r < t; r++)
this._sizes[r] = e[r]
}
get sizes() {
return this._sizes
}
set offsets(e) {
const t = Math.min(this._slices, e.length);
for (let r = 0; r < t; r++)
this._offsets[r] = e[r]
}
get offsets() {
return this._offsets
}
get slices() {
return this._slices
}
set slices(e) {
this._slices !== e && (this._slices = e,
this.uniforms.slices = e,
this._sizes = this.uniforms.slicesWidth = new Float32Array(e),
this._offsets = this.uniforms.slicesOffset = new Float32Array(e),
this.refresh())
}
get direction() {
return this._direction
}
set direction(e) {
if (this._direction === e)
return;
this._direction = e;
const t = e * DEG_TO_RAD;
this.uniforms.sinDir = Math.sin(t),
this.uniforms.cosDir = Math.cos(t)
}
get red() {
return this.uniforms.red
}
set red(e) {
this.uniforms.red = e
}
get green() {
return this.uniforms.green
}
set green(e) {
this.uniforms.green = e
}
get blue() {
return this.uniforms.blue
}
set blue(e) {
this.uniforms.blue = e
}
destroy() {
var e;
null == (e = this.texture) || e.destroy(!0),
this.texture = this._canvas = this.red = this.green = this.blue =
this._sizes = this._offsets = null
}
}
;
let l$8 = c$7;
l$8.defaults = {
slices: 5,
offset: 100,
direction: 0,
fillMode: 0,
average: !1,
seed: 0,
red: [0, 0],
green: [0, 0],
blue: [0, 0],
minSize: 8,
sampleSize: 512
},
l$8.TRANSPARENT = 0,
l$8.ORIGINAL = 1,
l$8.LOOP = 2,
l$8.CLAMP = 3,
l$8.MIRROR = 4;
var f$4 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, p$1 = "varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform
sampler2D uSampler;\n\nuniform float outerStrength;\nuniform float innerStrength;\
n\nuniform vec4 glowColor;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\
nuniform bool knockout;\nuniform float alpha;\n\nconst float PI =
3.14159265358979323846264;\n\nconst float DIST = __DIST__;\nconst float
ANGLE_STEP_SIZE = min(__ANGLE_STEP_SIZE__, PI * 2.0);\nconst float ANGLE_STEP_NUM =
ceil(PI * 2.0 / ANGLE_STEP_SIZE);\n\nconst float MAX_TOTAL_ALPHA = ANGLE_STEP_NUM *
DIST * (DIST + 1.0) / 2.0;\n\nvoid main(void) {\n vec2 px = vec2(1.0 /
filterArea.x, 1.0 / filterArea.y);\n\n float totalAlpha = 0.0;\n\n vec2
direction;\n vec2 displaced;\n vec4 curColor;\n\n for (float angle = 0.0;
angle < PI * 2.0; angle += ANGLE_STEP_SIZE) {\n direction = vec2(cos(angle),
sin(angle)) * px;\n\n for (float curDistance = 0.0; curDistance < DIST;
curDistance++) {\n displaced = clamp(vTextureCoord + direction * \n
(curDistance + 1.0), filterClamp.xy, filterClamp.zw);\n\n curColor =
texture2D(uSampler, displaced);\n\n totalAlpha += (DIST - curDistance) *
curColor.a;\n }\n }\n \n curColor = texture2D(uSampler,
vTextureCoord);\n\n float alphaRatio = (totalAlpha / MAX_TOTAL_ALPHA);\n\n
float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * curColor.a;\n float
innerGlowStrength = min(1.0, innerGlowAlpha);\n \n vec4 innerColor =
mix(curColor, glowColor, innerGlowStrength);\n\n float outerGlowAlpha =
alphaRatio * outerStrength * (1. - curColor.a);\n float outerGlowStrength =
min(1.0 - innerColor.a, outerGlowAlpha);\n\n if (knockout) {\n float
resultAlpha = (outerGlowAlpha + innerGlowAlpha) * alpha;\n gl_FragColor =
vec4(glowColor.rgb * resultAlpha, resultAlpha);\n }\n else {\n vec4
outerGlowColor = outerGlowStrength * glowColor.rgba * alpha;\n gl_FragColor =
innerColor + outerGlowColor;\n }\n}\n";
const e$3 = class extends Filter$2 {
constructor(e) {
const t = Object.assign({}, e$3.defaults, e)
, {outerStrength: r, innerStrength: n, color: i, knockout: o,
quality: s, alpha: a} = t
, l = Math.round(t.distance);
super(f$4, p$1.replace(/__ANGLE_STEP_SIZE__/gi, `${(1 / s /
l).toFixed(7)}`).replace(/__DIST__/gi, `${l.toFixed(0)}.0`)),
this.uniforms.glowColor = new Float32Array([0, 0, 0, 1]),
this.uniforms.alpha = 1,
Object.assign(this, {
color: i,
outerStrength: r,
innerStrength: n,
padding: l,
knockout: o,
alpha: a
})
}
get color() {
return rgb2hex(this.uniforms.glowColor)
}
set color(e) {
hex2rgb(e, this.uniforms.glowColor)
}
get outerStrength() {
return this.uniforms.outerStrength
}
set outerStrength(e) {
this.uniforms.outerStrength = e
}
get innerStrength() {
return this.uniforms.innerStrength
}
set innerStrength(e) {
this.uniforms.innerStrength = e
}
get knockout() {
return this.uniforms.knockout
}
set knockout(e) {
this.uniforms.knockout = e
}
get alpha() {
return this.uniforms.alpha
}
set alpha(e) {
this.uniforms.alpha = e
}
}
;
let l$7 = e$3;
l$7.defaults = {
distance: 10,
outerStrength: 4,
innerStrength: 0,
color: 16777215,
quality: .1,
knockout: !1,
alpha: 1
};
var v$1 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, f$3 = "vec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0))
* 289.0;\n}\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) *
289.0;\n}\nvec4 permute(vec4 x)\n{\n return mod289(((x * 34.0) + 1.0) * x);\n}\
nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 *
r;\n}\nvec3 fade(vec3 t)\n{\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\
n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep)\n{\n
vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 =
mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\
n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for
interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4
ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n
vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix)
+ iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n
vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) -
0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n
vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0
-= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1
= fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 =
vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -=
sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3
g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n
vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\
n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y,
gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w,
gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010,
g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *=
norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 =
taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111,
g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n
g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100,
vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n
float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001,
vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n
float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n
vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110),
vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw,
fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 *
n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain)\n{\n float
sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i =
0.0; i < 6.0; i++)\n {\n sum += totalgain * pnoise(P * sc, rep);\n
sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}\n"
, x$2 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nuniform vec2 light;\nuniform
bool parallel;\nuniform float aspect;\n\nuniform float gain;\nuniform float
lacunarity;\nuniform float time;\nuniform float alpha;\n\n${perlin}\n\nvoid
main(void) {\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n
float d;\n\n if (parallel) {\n float _cos = light.x;\n float _sin
= light.y;\n d = (_cos * coord.x) + (_sin * coord.y * aspect);\n } else
{\n float dx = coord.x - light.x / dimensions.x;\n float dy =
(coord.y - light.y / dimensions.y) * aspect;\n float dis = sqrt(dx * dx + dy
* dy) + 0.00001;\n d = dy / dis;\n }\n\n vec3 dir = vec3(d, d, 0.0);\
n\n float noise = turb(dir + vec3(time, 0.0, 62.1 + time) * 0.05, vec3(480.0,
320.0, 480.0), lacunarity, gain);\n noise = mix(noise, 0.0, 0.3);\n //fade
vertically.\n vec4 mist = vec4(noise, noise, noise, 1.0) * (1.0 - coord.y);\n
mist.a = 1.0;\n // apply user alpha\n mist *= alpha;\n\n gl_FragColor =
texture2D(uSampler, vTextureCoord) + mist;\n\n}\n";
const a$7 = class extends Filter$2 {
constructor(e) {
super(v$1, x$2.replace("${perlin}", f$3)),
this.parallel = !0,
this.time = 0,
this._angle = 0,
this.uniforms.dimensions = new Float32Array(2);
const t = Object.assign(a$7.defaults, e);
this._angleLight = new Point,
this.angle = t.angle,
this.gain = t.gain,
this.lacunarity = t.lacunarity,
this.alpha = t.alpha,
this.parallel = t.parallel,
this.center = t.center,
this.time = t.time
}
apply(e, t, r, n) {
const {width: i, height: o} = t.filterFrame;
this.uniforms.light = this.parallel ? this._angleLight :
this.center,
this.uniforms.parallel = this.parallel,
this.uniforms.dimensions[0] = i,
this.uniforms.dimensions[1] = o,
this.uniforms.aspect = o / i,
this.uniforms.time = this.time,
this.uniforms.alpha = this.alpha,
e.applyFilter(this, t, r, n)
}
get angle() {
return this._angle
}
set angle(e) {
this._angle = e;
const t = e * DEG_TO_RAD;
this._angleLight.x = Math.cos(t),
this._angleLight.y = Math.sin(t)
}
get gain() {
return this.uniforms.gain
}
set gain(e) {
this.uniforms.gain = e
}
get lacunarity() {
return this.uniforms.lacunarity
}
set lacunarity(e) {
this.uniforms.lacunarity = e
}
get alpha() {
return this.uniforms.alpha
}
set alpha(e) {
this.uniforms.alpha = e
}
}
;
let r$6 = a$7;
r$6.defaults = {
angle: 30,
gain: .5,
lacunarity: 2.5,
time: 0,
parallel: !0,
center: [0, 0],
alpha: 1
};
var o$5 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, r$5 = "precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform
sampler2D uSampler;\n\n// https://en.wikipedia.org/wiki/Luma_(video)\nconst vec3
weight = vec3(0.299, 0.587, 0.114);\n\nvoid main()\n{\n vec4 color =
texture2D(uSampler, vTextureCoord);\n gl_FragColor = vec4(\n vec3(color.r
* weight.r + color.g * weight.g + color.b * weight.b),\n color.a\n );\
n}\n";
let n$7 = class extends Filter$2 {
constructor() {
super(o$5, r$5)
}
}
;
var i$c = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, s$4 = "precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform
sampler2D uSampler;\nuniform float uHue;\nuniform float uAlpha;\nuniform bool
uColorize;\nuniform float uSaturation;\nuniform float uLightness;\n\n//
https://en.wikipedia.org/wiki/Luma_(video)\nconst vec3 weight = vec3(0.299, 0.587,
0.114);\n\nfloat getWeightedAverage(vec3 rgb) {\n return rgb.r * weight.r +
rgb.g * weight.g + rgb.b * weight.b;\n}\n\n//
https://gist.github.com/mairod/a75e7b44f68110e1576d77419d608786?
permalink_comment_id=3195243#gistcomment-3195243\nconst vec3 k = vec3(0.57735,
0.57735, 0.57735);\n\nvec3 hueShift(vec3 color, float angle) {\n float cosAngle
= cos(angle);\n return vec3(\n color * cosAngle +\n cross(k, color) *
sin(angle) +\n k * dot(k, color) * (1.0 - cosAngle)\n );\n}\n\nvoid main()\
n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n vec4 result = color;\
n\n // colorize\n if (uColorize) {\n result.rgb =
vec3(getWeightedAverage(result.rgb), 0., 0.);\n }\n\n // hue\n result.rgb
= hueShift(result.rgb, uHue);\n\n // saturation\n //
https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/huesaturation.js\n
float average = (result.r + result.g + result.b) / 3.0;\n\n if (uSaturation >
0.) {\n result.rgb += (average - result.rgb) * (1. - 1. / (1.001 -
uSaturation));\n } else {\n result.rgb -= (average - result.rgb) *
uSaturation;\n }\n\n // lightness\n result.rgb = mix(result.rgb,
vec3(ceil(uLightness)) * color.a, abs(uLightness));\n\n // alpha\n
gl_FragColor = mix(color, result, uAlpha);\n}\n";
const t$2 = class extends Filter$2 {
constructor(e) {
super(i$c, s$4),
this._hue = 0;
const t = Object.assign({}, t$2.defaults, e);
Object.assign(this, t)
}
get hue() {
return this._hue
}
set hue(e) {
this._hue = e,
this.uniforms.uHue = this._hue * (Math.PI / 180)
}
get alpha() {
return this.uniforms.uAlpha
}
set alpha(e) {
this.uniforms.uAlpha = e
}
get colorize() {
return this.uniforms.uColorize
}
set colorize(e) {
this.uniforms.uColorize = e
}
get lightness() {
return this.uniforms.uLightness
}
set lightness(e) {
this.uniforms.uLightness = e
}
get saturation() {
return this.uniforms.uSaturation
}
set saturation(e) {
this.uniforms.uSaturation = e
}
}
;
let n$6 = t$2;
n$6.defaults = {
hue: 0,
saturation: 0,
lightness: 0,
colorize: !1,
alpha: 1
};
var a$6 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, c$6 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform vec4 filterArea;\n\nuniform vec2 uVelocity;\nuniform int uKernelSize;\
nuniform float uOffset;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\n// Notice:\n// the
perfect way:\n// int kernelSize = min(uKernelSize, MAX_KERNELSIZE);\n// BUT in
real use-case , uKernelSize < MAX_KERNELSIZE almost always.\n// So use uKernelSize
directly.\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler,
vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\
n return;\n }\n\n vec2 velocity = uVelocity / filterArea.xy;\n
float offset = -uOffset / length(uVelocity) - 0.5;\n int k = uKernelSize - 1;\n\
n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n
break;\n }\n vec2 bias = velocity * (float(i) / float(k) + offset);\n
color += texture2D(uSampler, vTextureCoord + bias);\n }\n gl_FragColor =
color / float(uKernelSize);\n}\n";
let u$6 = class extends Filter$2 {
constructor(e=[0, 0], t=5, r=0) {
super(a$6, c$6),
this.kernelSize = 5,
this.uniforms.uVelocity = new Float32Array(2),
this._velocity = new ObservablePoint(this.velocityChanged,this),
this.setVelocity(e),
this.kernelSize = t,
this.offset = r
}
apply(e, t, r, n) {
const {x: i, y: o} = this.velocity;
this.uniforms.uKernelSize = 0 !== i || 0 !== o ? this.kernelSize :
0,
e.applyFilter(this, t, r, n)
}
set velocity(e) {
this.setVelocity(e)
}
get velocity() {
return this._velocity
}
setVelocity(e) {
if (Array.isArray(e)) {
const [t,r] = e;
this._velocity.set(t, r)
} else
this._velocity.copyFrom(e)
}
velocityChanged() {
this.uniforms.uVelocity[0] = this._velocity.x,
this.uniforms.uVelocity[1] = this._velocity.y,
this.padding = 1 + (Math.max(Math.abs(this._velocity.x),
Math.abs(this._velocity.y)) | 0)
}
set offset(e) {
this.uniforms.uOffset = e
}
get offset() {
return this.uniforms.uOffset
}
}
;
var c$5 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, g$1 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\
nuniform float epsilon;\n\nconst int MAX_COLORS = %maxColors%;\n\nuniform vec3
originalColors[MAX_COLORS];\nuniform vec3 targetColors[MAX_COLORS];\n\nvoid
main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n\n float
alpha = gl_FragColor.a;\n if (alpha < 0.0001)\n {\n return;\n }\n\n
vec3 color = gl_FragColor.rgb / alpha;\n\n for(int i = 0; i < MAX_COLORS; i++)\n
{\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0)\n
{\n break;\n }\n vec3 colorDiff = origColor - color;\n if
(length(colorDiff) < epsilon)\n {\n vec3 targetColor =
targetColors[i];\n gl_FragColor = vec4((targetColor + colorDiff) * alpha,
alpha);\n return;\n }\n }\n}\n";
let h$3 = class extends Filter$2 {
constructor(e, t=.05, r=e.length) {
super(c$5, g$1.replace(/%maxColors%/g, r.toFixed(0))),
this._replacements = [],
this._maxColors = 0,
this.epsilon = t,
this._maxColors = r,
this.uniforms.originalColors = new Float32Array(3 * r),
this.uniforms.targetColors = new Float32Array(3 * r),
this.replacements = e
}
set replacements(e) {
const t = this.uniforms.originalColors
, r = this.uniforms.targetColors
, n = e.length;
if (n > this._maxColors)
throw new Error(`Length of replacements (${n}) exceeds the
maximum colors length (${this._maxColors})`);
t[3 * n] = -1;
for (let i = 0; i < n; i++) {
const n = e[i];
let o = n[0];
"number" == typeof o ? o = hex2rgb(o) : n[0] = rgb2hex(o),
t[3 * i] = o[0],
t[3 * i + 1] = o[1],
t[3 * i + 2] = o[2];
let s = n[1];
"number" == typeof s ? s = hex2rgb(s) : n[1] = rgb2hex(s),
r[3 * i] = s[0],
r[3 * i + 1] = s[1],
r[3 * i + 2] = s[2]
}
this._replacements = e
}
get replacements() {
return this._replacements
}
refresh() {
this.replacements = this._replacements
}
get maxColors() {
return this._maxColors
}
set epsilon(e) {
this.uniforms.epsilon = e
}
get epsilon() {
return this.uniforms.epsilon
}
}
;
var l$6 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, d$3 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nuniform float sepia;\
nuniform float noise;\nuniform float noiseSize;\nuniform float scratch;\nuniform
float scratchDensity;\nuniform float scratchWidth;\nuniform float vignetting;\
nuniform float vignettingAlpha;\nuniform float vignettingBlur;\nuniform float
seed;\n\nconst float SQRT_2 = 1.414213;\nconst vec3 SEPIA_RGB = vec3(112.0 / 255.0,
66.0 / 255.0, 20.0 / 255.0);\n\nfloat rand(vec2 co) {\n return
fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvec3 Overlay(vec3
src, vec3 dst)\n{\n // if (dst <= 0.5) then: 2 * src * dst\n // if (dst >
0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 *
src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n
(dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 -
src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 *
(1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor =
texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if
(sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n
vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n
color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord =
vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\
n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir =
vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n
float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur *
SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 -
vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n
{\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n
float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed *
dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n
highp float period = scratchDensity * 10.0;\n\n float xx = coord.x *
period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float
bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0
- aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth
/ dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n
float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n
float _sign = sign(scratch);\n\n tine = s * tine / period + scratch
+ 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign *
0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n
if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord =
vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x /
noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n //
vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed *
512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise =
rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\
n }\n\n gl_FragColor.rgb = color;\n}\n";
const s$3 = class extends Filter$2 {
constructor(e, t=0) {
super(l$6, d$3),
this.seed = 0,
this.uniforms.dimensions = new Float32Array(2),
"number" == typeof e ? (this.seed = e,
e = void 0) : this.seed = t,
Object.assign(this, s$3.defaults, e)
}
apply(e, t, r, n) {
var i, o;
this.uniforms.dimensions[0] = null == (i = t.filterFrame) ? void
0 : i.width,
this.uniforms.dimensions[1] = null == (o = t.filterFrame) ? void
0 : o.height,
this.uniforms.seed = this.seed,
e.applyFilter(this, t, r, n)
}
set sepia(e) {
this.uniforms.sepia = e
}
get sepia() {
return this.uniforms.sepia
}
set noise(e) {
this.uniforms.noise = e
}
get noise() {
return this.uniforms.noise
}
set noiseSize(e) {
this.uniforms.noiseSize = e
}
get noiseSize() {
return this.uniforms.noiseSize
}
set scratch(e) {
this.uniforms.scratch = e
}
get scratch() {
return this.uniforms.scratch
}
set scratchDensity(e) {
this.uniforms.scratchDensity = e
}
get scratchDensity() {
return this.uniforms.scratchDensity
}
set scratchWidth(e) {
this.uniforms.scratchWidth = e
}
get scratchWidth() {
return this.uniforms.scratchWidth
}
set vignetting(e) {
this.uniforms.vignetting = e
}
get vignetting() {
return this.uniforms.vignetting
}
set vignettingAlpha(e) {
this.uniforms.vignettingAlpha = e
}
get vignettingAlpha() {
return this.uniforms.vignettingAlpha
}
set vignettingBlur(e) {
this.uniforms.vignettingBlur = e
}
get vignettingBlur() {
return this.uniforms.vignettingBlur
}
}
;
let r$4 = s$3;
r$4.defaults = {
sepia: .3,
noise: .3,
noiseSize: 1,
scratch: .5,
scratchDensity: .3,
scratchWidth: 1,
vignetting: .3,
vignettingAlpha: 1,
vignettingBlur: .3
};
var u$5 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, c$4 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform vec4 filterClamp;\n\nuniform float uAlpha;\nuniform vec2 uThickness;\
nuniform vec4 uColor;\nuniform bool uKnockout;\n\nconst float DOUBLE_PI = 2. *
3.14159265358979323846264;\nconst float ANGLE_STEP = ${angleStep};\n\nfloat
outlineMaxAlphaAtPos(vec2 pos) {\n if (uThickness.x == 0. || uThickness.y == 0.)
{\n return 0.;\n }\n\n vec4 displacedColor;\n vec2 displacedPos;\n
float maxAlpha = 0.;\n\n for (float angle = 0.; angle <= DOUBLE_PI; angle +=
ANGLE_STEP) {\n displacedPos.x = vTextureCoord.x + uThickness.x *
cos(angle);\n displacedPos.y = vTextureCoord.y + uThickness.y * sin(angle);\
n displacedColor = texture2D(uSampler, clamp(displacedPos, filterClamp.xy,
filterClamp.zw));\n maxAlpha = max(maxAlpha, displacedColor.a);\n }\n\n
return maxAlpha;\n}\n\nvoid main(void) {\n vec4 sourceColor =
texture2D(uSampler, vTextureCoord);\n vec4 contentColor = sourceColor * float(!
uKnockout);\n float outlineAlpha = uAlpha *
outlineMaxAlphaAtPos(vTextureCoord.xy) * (1.-sourceColor.a);\n vec4 outlineColor
= vec4(vec3(uColor) * outlineAlpha, outlineAlpha);\n gl_FragColor = contentColor
+ outlineColor;\n}\n";
const r$3 = class extends Filter$2 {
constructor(e=1, t=0, r=.1, n=1, i=!1) {
super(u$5, c$4.replace(/\$\{angleStep\}/, r$3.getAngleStep(r))),
this._thickness = 1,
this._alpha = 1,
this._knockout = !1,
this.uniforms.uThickness = new Float32Array([0, 0]),
this.uniforms.uColor = new Float32Array([0, 0, 0, 1]),
this.uniforms.uAlpha = n,
this.uniforms.uKnockout = i,
Object.assign(this, {
thickness: e,
color: t,
quality: r,
alpha: n,
knockout: i
})
}
static getAngleStep(e) {
const t = Math.max(e * r$3.MAX_SAMPLES, r$3.MIN_SAMPLES);
return (2 * Math.PI / t).toFixed(7)
}
apply(e, t, r, n) {
this.uniforms.uThickness[0] = this._thickness / t._frame.width,
this.uniforms.uThickness[1] = this._thickness / t._frame.height,
this.uniforms.uAlpha = this._alpha,
this.uniforms.uKnockout = this._knockout,
e.applyFilter(this, t, r, n)
}
get alpha() {
return this._alpha
}
set alpha(e) {
this._alpha = e
}
get color() {
return rgb2hex(this.uniforms.uColor)
}
set color(e) {
hex2rgb(e, this.uniforms.uColor)
}
get knockout() {
return this._knockout
}
set knockout(e) {
this._knockout = e
}
get thickness() {
return this._thickness
}
set thickness(e) {
this._thickness = e,
this.padding = e
}
}
;
let i$b = r$3;
i$b.MIN_SAMPLES = 1,
i$b.MAX_SAMPLES = 100;
var e$2 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, n$5 = "precision mediump float;\n\nvarying vec2 vTextureCoord;\n\
nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\n\
nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord +=
filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n
coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\
nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\
n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord =
pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor =
texture2D(uSampler, coord);\n}\n";
let i$a = class extends Filter$2 {
constructor(e=10) {
super(e$2, n$5),
this.size = e
}
get size() {
return this.uniforms.size
}
set size(e) {
"number" == typeof e && (e = [e, e]),
this.uniforms.size = e
}
}
;
var a$5 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, o$4 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform
float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\
nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if
(uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\
n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy /
filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float
radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n
vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist =
length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if
(radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n
float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if
(scale <= 0.0) {\n gl_FragColor = color;\n return;\
n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n
float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix
= mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i+
+) {\n if (i == k) {\n break;\n }\n\n coord -=
center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n
coord.y /= aspect;\n coord += center;\n\n vec4 sample =
texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to
correctly blur transparent images\n // sample.rgb *= sample.a;\n\n
color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n";
let l$5 = class extends Filter$2 {
constructor(e=0, t=[0, 0], r=5, n=-1) {
super(a$5, o$4),
this._angle = 0,
this.angle = e,
this.center = t,
this.kernelSize = r,
this.radius = n
}
apply(e, t, r, n) {
this.uniforms.uKernelSize = 0 !== this._angle ? this.kernelSize :
0,
e.applyFilter(this, t, r, n)
}
set angle(e) {
this._angle = e,
this.uniforms.uRadian = e * Math.PI / 180
}
get angle() {
return this._angle
}
get center() {
return this.uniforms.uCenter
}
set center(e) {
this.uniforms.uCenter = e
}
get radius() {
return this.uniforms.uRadius
}
set radius(e) {
(e < 0 || e === 1 / 0) && (e = -1),
this.uniforms.uRadius = e
}
}
;
var m$3 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, s$2 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\
nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\
nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform
vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co)
{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\
nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n
vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n
gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n
float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY =
boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY -
vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float
_amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n
float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) /
filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x
= vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x =
clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler,
vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n";
const i$9 = class extends Filter$2 {
constructor(e) {
super(m$3, s$2),
this.time = 0,
this.uniforms.amplitude = new Float32Array(2),
this.uniforms.waveLength = new Float32Array(2),
this.uniforms.alpha = new Float32Array(2),
this.uniforms.dimensions = new Float32Array(2),
Object.assign(this, i$9.defaults, e)
}
apply(e, t, r, n) {
var i, o;
this.uniforms.dimensions[0] = null == (i = t.filterFrame) ? void
0 : i.width,
this.uniforms.dimensions[1] = null == (o = t.filterFrame) ? void
0 : o.height,
this.uniforms.time = this.time,
e.applyFilter(this, t, r, n)
}
set mirror(e) {
this.uniforms.mirror = e
}
get mirror() {
return this.uniforms.mirror
}
set boundary(e) {
this.uniforms.boundary = e
}
get boundary() {
return this.uniforms.boundary
}
set amplitude(e) {
this.uniforms.amplitude[0] = e[0],
this.uniforms.amplitude[1] = e[1]
}
get amplitude() {
return this.uniforms.amplitude
}
set waveLength(e) {
this.uniforms.waveLength[0] = e[0],
this.uniforms.waveLength[1] = e[1]
}
get waveLength() {
return this.uniforms.waveLength
}
set alpha(e) {
this.uniforms.alpha[0] = e[0],
this.uniforms.alpha[1] = e[1]
}
get alpha() {
return this.uniforms.alpha
}
}
;
let o$3 = i$9;
o$3.defaults = {
mirror: !0,
boundary: .5,
amplitude: [0, 20],
waveLength: [30, 100],
alpha: [1, 1],
time: 0
};
var o$2 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, i$8 = "precision mediump float;\n\nvarying vec2 vTextureCoord;\n\
nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform
vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r =
texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g =
texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b =
texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a =
texture2D(uSampler, vTextureCoord).a;\n}\n";
let u$4 = class extends Filter$2 {
constructor(e=[-10, 0], t=[0, 10], r=[0, 0]) {
super(o$2, i$8),
this.red = e,
this.green = t,
this.blue = r
}
get red() {
return this.uniforms.red
}
set red(e) {
this.uniforms.red = e
}
get green() {
return this.uniforms.green
}
set green(e) {
this.uniforms.green = e
}
get blue() {
return this.uniforms.blue
}
set blue(e) {
this.uniforms.blue = e
}
}
;
var s$1 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, f$2 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\
nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\
nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform
float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float
halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius /
filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float
fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius)
{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n
return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\
n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y
*= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <=
0.0 || dist < currentRadius - halfWavelength || dist > currentRadius +
halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n
return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist -
currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n
// float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff =
1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV *
powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord +
offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n
vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n
color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\
n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n
color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\
n";
const n$4 = class extends Filter$2 {
constructor(e=[0, 0], t, r=0) {
super(s$1, f$2),
this.center = e,
Object.assign(this, n$4.defaults, t),
this.time = r
}
apply(e, t, r, n) {
this.uniforms.time = this.time,
e.applyFilter(this, t, r, n)
}
get center() {
return this.uniforms.center
}
set center(e) {
this.uniforms.center = e
}
get amplitude() {
return this.uniforms.amplitude
}
set amplitude(e) {
this.uniforms.amplitude = e
}
get wavelength() {
return this.uniforms.wavelength
}
set wavelength(e) {
this.uniforms.wavelength = e
}
get brightness() {
return this.uniforms.brightness
}
set brightness(e) {
this.uniforms.brightness = e
}
get speed() {
return this.uniforms.speed
}
set speed(e) {
this.uniforms.speed = e
}
get radius() {
return this.uniforms.radius
}
set radius(e) {
this.uniforms.radius = e
}
}
;
let i$7 = n$4;
i$7.defaults = {
amplitude: 30,
wavelength: 160,
brightness: 1,
speed: 500,
radius: -1
};
var l$4 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, u$3 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\
nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor =
texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord *
filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n
vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient +
light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor =
vec4(finalColor, diffuseColor.a);\n}\n";
let m$2 = class extends Filter$2 {
constructor(e, t=0, r=1) {
super(l$4, u$3),
this._color = 0,
this.uniforms.dimensions = new Float32Array(2),
this.uniforms.ambientColor = new Float32Array([0, 0, 0, r]),
this.texture = e,
this.color = t
}
apply(e, t, r, n) {
var i, o;
this.uniforms.dimensions[0] = null == (i = t.filterFrame) ? void
0 : i.width,
this.uniforms.dimensions[1] = null == (o = t.filterFrame) ? void
0 : o.height,
e.applyFilter(this, t, r, n)
}
get texture() {
return this.uniforms.uLightmap
}
set texture(e) {
this.uniforms.uLightmap = e
}
set color(e) {
const t = this.uniforms.ambientColor;
"number" == typeof e ? (hex2rgb(e, t),
this._color = e) : (t[0] = e[0],
t[1] = e[1],
t[2] = e[2],
t[3] = e[3],
this._color = rgb2hex(t))
}
get color() {
return this._color
}
get alpha() {
return this.uniforms.ambientColor[3]
}
set alpha(e) {
this.uniforms.ambientColor[3] = e
}
}
;
var m$1 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, c$3 = "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\
nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform
vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale,
float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) *
43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n
float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182),
0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n
float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start,
normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n
{\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 -
abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta /
texSize * percent * radius);\n sample.rgb *= sample.a;\n color +=
sample * weight;\n total += weight;\n }\n\n color /= total;\n
color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n";
let l$3 = class extends Filter$2 {
constructor(e) {
var t, r;
super(m$1, c$3),
this.uniforms.blur = e.blur,
this.uniforms.gradientBlur = e.gradientBlur,
this.uniforms.start = null != (t = e.start) ? t : new
Point(0,window.innerHeight / 2),
this.uniforms.end = null != (r = e.end) ? r : new
Point(600,window.innerHeight / 2),
this.uniforms.delta = new Point(30,30),
this.uniforms.texSize = new
Point(window.innerWidth,window.innerHeight),
this.updateDelta()
}
updateDelta() {
this.uniforms.delta.x = 0,
this.uniforms.delta.y = 0
}
get blur() {
return this.uniforms.blur
}
set blur(e) {
this.uniforms.blur = e
}
get gradientBlur() {
return this.uniforms.gradientBlur
}
set gradientBlur(e) {
this.uniforms.gradientBlur = e
}
get start() {
return this.uniforms.start
}
set start(e) {
this.uniforms.start = e,
this.updateDelta()
}
get end() {
return this.uniforms.end
}
set end(e) {
this.uniforms.end = e,
this.updateDelta()
}
}
, a$4 = class extends l$3 {
updateDelta() {
const e = this.uniforms.end.x - this.uniforms.start.x
, t = this.uniforms.end.y - this.uniforms.start.y
, r = Math.sqrt(e * e + t * t);
this.uniforms.delta.x = e / r,
this.uniforms.delta.y = t / r
}
}
, u$2 = class extends l$3 {
updateDelta() {
const e = this.uniforms.end.x - this.uniforms.start.x
, t = this.uniforms.end.y - this.uniforms.start.y
, r = Math.sqrt(e * e + t * t);
this.uniforms.delta.x = -t / r,
this.uniforms.delta.y = e / r
}
}
;
const d$2 = class extends Filter$2 {
constructor(e, t, r, n) {
super(),
"number" == typeof e && (deprecation("5.3.0", "TiltShiftFilter
constructor arguments is deprecated, use options."),
e = {
blur: e,
gradientBlur: t,
start: r,
end: n
}),
e = Object.assign({}, d$2.defaults, e),
this.tiltShiftXFilter = new a$4(e),
this.tiltShiftYFilter = new u$2(e)
}
apply(e, t, r, n) {
const i = e.getFilterTexture();
this.tiltShiftXFilter.apply(e, t, i, 1),
this.tiltShiftYFilter.apply(e, i, r, n),
e.returnFilterTexture(i)
}
get blur() {
return this.tiltShiftXFilter.blur
}
set blur(e) {
this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = e
}
get gradientBlur() {
return this.tiltShiftXFilter.gradientBlur
}
set gradientBlur(e) {
this.tiltShiftXFilter.gradientBlur =
this.tiltShiftYFilter.gradientBlur = e
}
get start() {
return this.tiltShiftXFilter.start
}
set start(e) {
this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = e
}
get end() {
return this.tiltShiftXFilter.end
}
set end(e) {
this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = e
}
}
;
let h$2 = d$2;
h$2.defaults = {
blur: 100,
gradientBlur: 600,
start: void 0,
end: void 0
};
var i$6 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, a$3 = "varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\
nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4
filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n
coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\
n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\
n}\n\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist =
length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius
- dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n
float s = sin(angleMod);\n float c = cos(angleMod);\n coord =
vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord +=
offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord =
mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord =
unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n";
const n$3 = class extends Filter$2 {
constructor(e) {
super(i$6, a$3),
Object.assign(this, n$3.defaults, e)
}
get offset() {
return this.uniforms.offset
}
set offset(e) {
this.uniforms.offset = e
}
get radius() {
return this.uniforms.radius
}
set radius(e) {
this.uniforms.radius = e
}
get angle() {
return this.uniforms.angle
}
set angle(e) {
this.uniforms.angle = e
}
}
;
let r$2 = n$3;
r$2.defaults = {
radius: 200,
angle: 4,
padding: 20,
offset: new Point
};
var l$2 = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\
n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid
main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition,
1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}"
, u$1 = "varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\
nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\
nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE
= ${maxKernelSize};\n\n// author: http://byteblacksmith.com/improvements-to-the-
canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float
seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp
float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return
fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient =
uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) /
filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius -
gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n
vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist =
length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength =
uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius)
{\n delta = innerRadius - dist;\n gap = minGradient;\n } else if
(radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta
= dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n
float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) /
normalCount;\n countLimit *= delta;\n strength *= delta;\n if
(countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler,
vTextureCoord);\n return;\n }\n }\n\n // randomize the
lookup values to hide the fixed number of samples\n float offset =
rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\
n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n
float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 *
(percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n
vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha
to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n
color += sample * weight;\n total += weight;\n\n if (t > countLimit)
{\n break;\n }\n }\n\n color /= total;\n // switch back
from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n
gl_FragColor = color;\n}\n"
, i$5 = Object.getOwnPropertySymbols
, d$1 = Object.prototype.hasOwnProperty
, f$1 = Object.prototype.propertyIsEnumerable
, c$2 = (e, t) => {
var r = {};
for (var n in e)
d$1.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
if (null != e && i$5)
for (var n of i$5(e))
t.indexOf(n) < 0 && f$1.call(e, n) && (r[n] = e[n]);
return r
}
;
const a$2 = class extends Filter$2 {
constructor(e) {
const t = Object.assign(a$2.defaults, e)
, {maxKernelSize: r} = t
, n = c$2(t, ["maxKernelSize"]);
super(l$2, u$1.replace("${maxKernelSize}", r.toFixed(1))),
Object.assign(this, n)
}
get center() {
return this.uniforms.uCenter
}
set center(e) {
this.uniforms.uCenter = e
}
get strength() {
return this.uniforms.uStrength
}
set strength(e) {
this.uniforms.uStrength = e
}
get innerRadius() {
return this.uniforms.uInnerRadius
}
set innerRadius(e) {
this.uniforms.uInnerRadius = e
}
get radius() {
return this.uniforms.uRadius
}
set radius(e) {
(e < 0 || e === 1 / 0) && (e = -1),
this.uniforms.uRadius = e
}
}
;
let o$1 = a$2;
o$1.defaults = {
strength: .1,
center: [0, 0],
innerRadius: 0,
radius: -1,
maxKernelSize: 32
};
const pxFilters = Object.freeze(Object.defineProperty({
__proto__: null,
AdjustmentFilter: s$7,
AdvancedBloomFilter: b$3,
AsciiFilter: i$f,
BevelFilter: s$6,
BloomFilter: p$3,
BulgePinchFilter: t$7,
CRTFilter: t$5,
ColorGradientFilter: b$2,
ColorMapFilter: u$7,
ColorOverlayFilter: i$e,
ColorReplaceFilter: s$5,
ConvolutionFilter: n$9,
CrossHatchFilter: e$5,
DotFilter: i$d,
DropShadowFilter: F$1,
EmbossFilter: n$8,
GlitchFilter: l$8,
GlowFilter: l$7,
GodrayFilter: r$6,
GrayscaleFilter: n$7,
HslAdjustmentFilter: n$6,
KawaseBlurFilter: _$2,
MotionBlurFilter: u$6,
MultiColorReplaceFilter: h$3,
OldFilmFilter: r$4,
OutlineFilter: i$b,
PixelateFilter: i$a,
RGBSplitFilter: u$4,
RadialBlurFilter: l$5,
ReflectionFilter: o$3,
ShockwaveFilter: i$7,
SimpleLightmapFilter: m$2,
TiltShiftAxisFilter: l$3,
TiltShiftFilter: h$2,
TiltShiftXFilter: a$4,
TiltShiftYFilter: u$2,
TwistFilter: r$2,
ZoomBlurFilter: o$1
}, Symbol.toStringTag, {
value: "Module"
}));
function VElement$1(e) {
const t = e.element
, {visible: r, currentTime: n, relativeTime: i, env: o, trackIndex:
s} = e
, a = e.store
, [l,c] = reactExports.useState("1")
, u = reactExports.useRef()
, d = reactExports.useRef(null)
, [p,h] = reactExports.useState(1)
, f = reactExports.useRef(!1)
, m = reactExports.useRef()
, g = reactExports.useRef()
, y = reactExports.useRef()
, v = reactExports.useMemo(( () => {
var e, r, n, i;
const l = new Container;
let c;
if ("export" === o) {
a.elementReadyMark[t.id] = "start";
(async () => {
var e, r;
const n = a.resourceManage.getResouceById(t.resourceId);
if (!n)
throw new Error("资源不存在" + t.resourceId);
m.current = document.createElement("canvas"),
m.current.width = null == (e = n.styleSize) ? void 0 :
e.width,
m.current.height = null == (r = n.styleSize) ? void 0 :
r.height;
const i = m.current.transferControlToOffscreen();
g.current = new Worker(a.workerPath),
g.current.elementid = t.id;
const o =
a.resourceManage.getBlobURLBySourceId(t.resourceId);
g.current.onmessage = e => {
"ready" === e.data.type ? a.elementReadyMark[t.id] =
"success" : "decodeMP4DemuxerSuccess" === e.data.type ? a.renderAsyncMark[t.id +
"_decodeMP4DemuxerSuccess"] = "success" : "draw" === e.data.type &&
(b.texture.update(),
a.renderAsyncMark[t.id] = "success")
}
;
let s = t.clipTime;
if (a.times) {
s += a.times[0] - t.startTime
}
a.renderAsyncMark[t.id + "_decodeMP4DemuxerSuccess"] =
"start";
const l = (await mediaInfo$1(o)).media.track.find((e =>
"Video" === e["@type"]));
g.current.postMessage({
canvas: i,
type: "initDecodeVideo",
options: {
url: o,
rotation: Number(l.Rotation) || 0,
noAudioTracks: n.noAudioTracks,
clipTime: s,
elementId: t.id,
aspectRatio: n.attrs.videoWidth /
n.attrs.videoHeight
}
}, [i])
}
)(),
c = Texture.from(m.current)
} else {
const e = a.resourceManage.getCacheBlobURLById(t.resourceId,
s);
if (!e)
throw new Error("轨道资源未设置");
e.target.muted = t.muted,
e.target.volume = t.volume,
e.target.playbackRate = t.speed,
c = Texture.from(e.target);
const r = c.baseTexture.resource;
r.autoPlay = !1,
r.source.paused || r.source.pause()
}
const u = new Sprite(c);
c.on("update", ( () => {
h(+new Date)
}
));
const d = a.resourceManage.getResouceById(t.resourceId);
(null == d ? void 0 : d.styleSize) && (d.styleSize.width =
Number(d.styleSize.width),
d.styleSize.height = Number(d.styleSize.height)),
y.current = new ScreenFilter({
videowidth: null == (r = null == (e = null == d ? void 0 :
d.styleSize) ? void 0 : e.width) ? void 0 : r.toFixed(1),
videoheight: null == (i = null == (n = null == d ? void 0 :
d.styleSize) ? void 0 : n.height) ? void 0 : i.toFixed(1),
texture: c
}),
y.current.id = "ScreenFilter",
y.current.enabled = t.matting && t.matting.enabled;
const p = new i$b;
return p.alpha = 0,
p.color = 16777215,
p.thickness = -1,
u.filters = [y.current, p],
u.name = "element",
u.blendMode = t.blendMode,
l.addChild(u),
l
}
), [t.resourceId, s]);
useMask(t, v, e.store, e.scale),
useScreen(t, y.current, e.scale);
const b = v.children[0];
reactExports.useEffect(( () => {
if (a.usedMediaInfo[t.id] || (a.usedMediaInfo[t.id] = {
resourceId: t.resourceId,
volume: t.volume,
startTime: t.startTime,
duration: t.duration,
clipTime: t.clipTime,
speed: t.speed,
muted: t.muted
}),
"export" !== o) {
const e = a.resourceManage.getCacheBlobURLById(t.resourceId,
s);
e && (e.target.muted = t.muted,
e.target.volume = t.volume,
e.target.playbackRate = t.speed),
1 === t.separate && (e.target.muted = !0),
a.usedMediaInfo[t.id].muted = t.muted,
a.usedMediaInfo[t.id].volume = t.volume,
a.usedMediaInfo[t.id].speed = t.speed
}
}
), [t.muted, t.separate, t.volume, t.speed, t.clipTime]),
reactExports.useEffect(( () => {
const e = b.texture.baseTexture.resource
, r = () => {
f.current = !0
}
;
return "export" !== o && (d.current || (d.current = () => {
e.update()
}
,
e.source.addEventListener("seeked", d.current),
e.source.addEventListener("canplay", r))),
() => {
d.current && (e.source.removeEventListener("seeked",
d.current),
e.source.removeEventListener("canplay", r),
d.current = null),
delete a.usedMediaInfo[t.id],
m.current && (m.current.remove(),
m.current = null)
}
}
), []),
reactExports.useEffect(( () => {
if (null !== i) {
const e = i.toFixed(1) === t.duration.toFixed(1);
if ("export" === o) {
if ("start" === a.renderAsyncMark[t.id +
"_decodeMP4DemuxerSuccess"])
return;
a.renderAsyncMark[t.id] = "start",
g.current.postMessage({
type: "decodeFrameByTime",
time: toNum(i + t.clipTime, 3),
relativeTime: i,
duration: t.duration
}),
e && setTimeout(( () => {
g.current && (g.current.terminate(),
g.current = null)
}
), 500)
} else {
const r = b.texture.baseTexture.resource;
if (a.playing) {
if (r.source.paused && f.current &&
r.source.play().then(( () => {
r.source.currentTime = toNum(i + t.clipTime, 3)
}
)),
t.fadeOutTime && i >= t.duration - t.fadeOutTime) {
const e = Math.min((t.duration - i) /
t.fadeOutTime, 1)
, n = t.volume * e;
r.source.volume = n
}
if (t.fadeInTime && i <= t.fadeInTime) {
const e = Math.min(i / t.fadeInTime, 1)
, n = t.volume * e;
r.source.volume = n
}
} else
r.source.currentTime = i + t.clipTime;
e && !r.source.paused && r.source.pause()
}
} else if ("export" !== o) {
const e = a.resourceManage.getCacheBlobURLById(t.resourceId,
s);
e.target.paused || e.target.pause()
}
}
), [i, t.clipTime]),
useElementFilter(v, t),
reactExports.useEffect(( () => {
var e;
if (void 0 !== t.blendMode) {
const r = v.children.find((e => "element" === e.name));
r.blendMode = t.blendMode,
null == (e = r.texture) || e.update()
}
}
), [t.blendMode]);
const [x] = useSyncPixiElement$1(v, {
style: {
...t.style
},
parent: e.parent,
visible: r,
hide: e.hide,
lock: e.lock,
animateRef: u,
relativeTime: e.relativeTime,
store: e.store
}, ["x", "y", "width", "height", "alpha", "rotation"], t);
reactExports.useEffect(( () => {
const e = a.resourceManage.getResouceById(t.resourceId);
if (t.resourceId && t.cropSize && e) {
const e = v.children.find((e => "element" === e.name));
if ("1_1" != `${e.texture.width}_${e.texture.height}`) {
const {x: r, y: n, width: i, height: o} = t.cropSize;
e.texture.frame = new Rectangle(r,n,i,o)
}
x({
...t.style
}, v)
}
}
), [t.cropSize, t.resourceId, p]);
const _ = e.transitionElement
, E = reactExports.useCallback(debounce$3(( () => {
c(createID())
}
), 500), [])
, {x: T, y: C, width: S, height: $} = t.style;
return reactExports.useEffect(( () => {
e.hasTransition && E()
}
), [T, C, S, $]),
jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
children: ["editor" === o && jsxRuntimeExports.jsx(ControlElment$1,
{
store: e.store,
scale: e.scale,
hide: e.hide,
lock: e.lock,
element: t,
trackIndex: s,
visible: r
}), e.hasTransition && jsxRuntimeExports.jsx(TransitionElement, {
canvas: m,
currentTime: n,
relativeTime: i,
trackIndex: s,
transitionElement: _,
nextElement: e.nextElement,
element: t,
dirty: _._dirty,
store: e.store,
env: e.env
}), jsxRuntimeExports.jsx(Animate$2, {
ref: u,
store: e.store,
pixiElem: v,
elementData: t,
currentTime: n,
relativeTime: i
})]
})
}
const VertexShader = "\n attribute vec2 aVertexPosition;\n attribute
vec2 aTextureCoord;\n uniform mat3 projectionMatrix;\n varying vec2
vTextureCoord;\n void main(void){\n gl_Position = vec4((projectionMatrix
* vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord =
aTextureCoord;\n }\n"
, FragmentShader = "\n varying vec2 vTextureCoord;\n uniform
sampler2D uSampler;\n uniform sampler2D lut;\n uniform float intensity;\n
void main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n
highp float blueColor = color.b * 63.0;\n //向下取值\n highp vec2 quad1;\
n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x =
floor(blueColor) - (quad1.y * 8.0);\n //向上取值\n highp vec2 quad2;\n
quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) -
(quad2.y * 8.0);\n\n //根据小正方形格子和 RG 通道,获取纹理坐标,每个大格子的大小:1/8=0.125,每个小格子的大
小:1/512\n highp vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) +
0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y *
0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n\n highp vec2
texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0)
* color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 -
1.0/512.0) * color.g);\n\n lowp vec4 newColor1 = texture2D(lut, texPos1);\n
lowp vec4 newColor2 = texture2D(lut, texPos2);\n lowp vec4 newColor =
mix(newColor1, newColor2, fract(blueColor));\n\n gl_FragColor = mix(color,
vec4(newColor.rgb, color.w), intensity);\n }\n";
class LutFilter extends Filter$2 {
constructor(e) {
e.texture.baseTexture.mipmap = MIPMAP_MODES.OFF,
super(VertexShader, FragmentShader, {
intensity: e.intensity,
lut: e.texture
}),
this.id = "",
this.intensity = e.intensity
}
setLutImg(e) {
e.baseTexture.mipmap = MIPMAP_MODES.OFF,
this.uniforms.lut = e
}
get intensity() {
return this.uniforms.intensity
}
set intensity(e) {
this.uniforms.intensity = e
}
}
function LutFilterElement(e) {
const t = e.element
, {visible: r} = e
, n = e.store
, i = reactExports.useMemo(( () => {
const e = n.resourceManage.getCacheBlobURLById(t.resourceId)
, r = Texture.from(e)
, i = new LutFilter({
intensity: 1,
texture: r
});
i.id = t.id,
i.blendMode = 0;
const o = [...n.bodyContainer.filters || []].filter((e => e.id !==
t.id));
return o.push(i),
n.bodyContainer.filters = o,
i
}
), [t.resourceId]);
return reactExports.useEffect(( () => {
const e = [...n.bodyContainer.filters || []].filter((e => e.id !==
t.id));
return e.push(i),
n.bodyContainer.filters = e,
() => {
var e;
n.bodyContainer.filters = (null == (e =
n.bodyContainer.filters) ? void 0 : e.filter((e => e.id !== t.id))) || [],
i.destroy()
}
}
), []),
reactExports.useEffect(( () => {
i.enabled = r,
i.uniforms.intensity !== t.intensity && (i.uniforms.intensity =
t.intensity)
}
), [r, t.intensity]),
null
}
LutFilter.filterType = "lutfilter";
class TxtTexture {
constructor(e, t, r) {
this._text = void 0,
this._textStyle = void 0,
this._rectText = void 0,
this._bgContext = void 0,
this._bgCanvas = void 0,
this._textContext = void 0,
this._textCanvas = void 0,
this._rect = void 0,
this._points = void 0,
this._lines = void 0,
this._lineWidths = void 0,
this._lineWidthMax = void 0,
this._cacheImg = {},
this._texture = void 0,
this._scale = void 0,
this._text = e,
this._textStyle = t,
this._scale = r
}
get rectText() {
return this._rectText
}
get points() {
return this._points
}
get rect() {
return this._rect
}
_drawBackground() {
const {radius: e=[0, 0, 0, 0], backgroundColor: t} =
this._textStyle;
t && (this._bgContext.fillStyle = this.getColor(t, 1),
this._bgContext.roundRect(0, 0, this._textCanvas.width,
this._textCanvas.height, [...e].map((e => e * this._scale))),
this._bgContext.fill())
}
update(e, t) {
return e !== this._text && (this._text = e),
t && (this._textStyle = t),
this._textContext.clearRect(0, 0, this._textCanvas.width,
this._textCanvas.height),
this.init(),
this.getTextRect()
}
setScale(e) {
return this._scale = e,
this.update(this._text)
}
getColor(e, t) {
if (!e)
return "";
if ("string" == typeof e)
return e;
{
const r = this._rect.width * this._scale
, n = this._rect.height * this._scale
, {type: i, value: o} = e;
if ("linear" === i) {
const e = (o.angle || 0) % 360;
let i, s, a, l;
if (o.points)
i = o.points.x0 / t,
s = o.points.y0 / t,
a = o.points.x1 / t,
l = o.points.y1 / t;
else {
const t = getIntersectionPoints(r, n, e);
i = t.point1.x,
s = t.point1.y,
a = t.point2.x,
l = t.point2.y
}
const c = this._textContext.createLinearGradient(i, s, a,
l);
return o.colors.forEach((e => {
c.addColorStop(e.offset, e.color)
}
)),
c
}
if ("radial" === i) {
const {x0: e, y0: t, x1: i, y1: s, r0: a, r1: l} = o.points
|| {
x0: r / 2,
y0: n / 2,
r0: 0,
x1: r / 2,
y1: n / 2,
r1: Math.sqrt(Math.pow(r, 2) + Math.pow(n, 2)) / 2
}
, c = this._textContext.createRadialGradient(e, t, a, i,
s, l);
return o.colors.forEach((e => {
c.addColorStop(e.offset, e.color)
}
)),
c
}
if ("conic" === i) {
let {startAngle: e=0, x: t, y: i} = o.points || {
startAngle: 0,
x: r / 2,
y: n / 2
};
void 0 === t && (t = r / 2),
void 0 === i && (i = n / 2);
const s = this._textContext.createConicGradient(e, t, i);
return o.colors.forEach((e => {
s.addColorStop(e.offset, e.color)
}
)),
s
}
if ("image" === i) {
const {repeat: e, url: t} = o;
return this.createPattern(t, e)
}
return "#000"
}
}
run(e) {
this._texture && (this._textContext.clearRect(0, 0,
this._textCanvas.width / this._scale, this._textCanvas.height / this._scale),
this._textContext.save(),
this._textContext.scale(1 / this._scale, 1 / this._scale),
this._textContext.drawImage(this._bgCanvas, 0, 0),
this._textContext.restore(),
this._setWordPosition("strokeText", null, this._points),
this._setWordPosition("fillText", null, this._points),
this._texture.update())
}
destroys() {
this._texture.destroy(!0);
for (let e in this._cacheImg)
this._cacheImg[e].remove();
this._texture = null,
this._cacheImg = {},
this._text = null,
this._textStyle = null,
this._lineWidths = null,
this._points = null,
this._bgCanvas.width = 0,
this._bgCanvas.height = 0,
this._bgCanvas.remove(),
this._textCanvas.width = 0,
this._textCanvas.height = 0,
this._textCanvas.remove()
}
createPattern(e, t) {
return new Promise(( (r, n) => {
if (this._cacheImg[e]) {
const n =
this._textContext.createPattern(this._cacheImg[e], t);
return void r(n)
}
const i = new Image;
i.crossOrigin = "Anonymous",
i.src = e,
i.onload = () => {
this._cacheImg[e] = i;
const n = this._textContext.createPattern(i, t);
r(n)
}
,
i.onerror = () => {
n(i)
}
}
))
}
async loadFont(e, t) {
if (e && !t && (t = `/assets/fonts/${e}/font.woff`),
t) {
const n = new FontFace(e,`url("${t}")`);
try {
const e = await n.load();
document.fonts.add(e)
} catch (r) {}
}
}
init() {
this._points = [];
const {fontSize: e=24, fill: t, fontFamily: r="", fontStyle:
n="normal", stroke: i, shadow: o} = this._textStyle;
if (this._lines = this._text.split("\n"),
this._rect = this.getTextRect(),
!this._textCanvas) {
const e = document.createElement("canvas");
this._textCanvas = e
}
if (this._textCanvas.width = this._rect.width * this._scale,
this._textCanvas.height = this._rect.height * this._scale,
this._textContext = this._textCanvas.getContext("2d"),
this._textContext.scale(this._scale, this._scale),
!this._bgCanvas) {
const e = document.createElement("canvas");
this._bgCanvas = e
}
if (this._bgCanvas.width = this._rect.width * this._scale,
this._bgCanvas.height = this._rect.height * this._scale,
this._bgContext = this._bgCanvas.getContext("2d"),
this._drawBackground(),
this._textContext.save(),
this._textContext.scale(1 / this._scale, 1 / this._scale),
this._textContext.drawImage(this._bgCanvas, 0, 0),
this._textContext.restore(),
this._textContext.textBaseline = "middle",
this._textContext.font = `${n} ${e}px ${r}`,
i && (this._textContext.strokeStyle = this.getColor(i.color,
this._scale),
this._textContext.lineJoin = i.lineJoin || "round",
this._textContext.lineWidth = i.lineWidth),
t && (this._textContext.fillStyle = this.getColor(t, this._scale)),
o) {
this._textContext.shadowColor = o.color || "#000000";
const {x: e, y: t} = calculateVector(o.angle, o.distance *
this._scale);
this._textContext.shadowOffsetX = e,
this._textContext.shadowOffsetY = t,
this._textContext.shadowBlur = o.blur || 0
}
return this._countLines(),
this._setWordPosition("strokeText", this._points),
this._setWordPosition("fillText", null),
this._texture ? this._texture.update() : this._texture =
Texture.from(this._textCanvas),
this._texture &&
this._texture.baseTexture.setSize(this._rect.width, this._rect.height,
this._scale),
this._texture
}
_setWordPosition(e, t, r) {
const {lineHeight: n, shadow: i, align: o, stroke: s, fontSize:
a=24, padding: l=[0, 0, 0, 0], letterSpacing: c=0} = this._textStyle
, u = void 0 === n ? a : n
, d = u / 2 + l[0];
i && (this._textContext.shadowColor = "strokeText" === e ?
i.color : "rgba(0,0,0,0)");
let p = d;
this._lines.forEach(( (n, i) => {
let a = 0;
a = "right" === o ? this._lineWidthMax - this._lineWidths[i] :
"center" === o ? (this._lineWidthMax - this._lineWidths[i]) / 2 : 0;
const d = r ? r[i] : [];
let h = (s ? s.lineWidth : 0) + a + l[3];
for (let t = 0; t < n.length; t++)
if (r) {
this._textContext.save();
const r = d[t]
, {offsetX: i=0, offsetY: o=0, offsetScaleX: s=0,
offsetScaleY: a=0, offsetOpacity: l, offsetRotate: c=0} = r;
this._textContext.translate(r.x + r.width / 2 + i, r.y
+ o),
void 0 !== c ? this._textContext.rotate(c) :
this._textContext.rotate(r.rotate || 0),
void 0 !== l && (this._textContext.globalAlpha = l),
void 0 !== s ? this._textContext.scale(s, a) :
this._textContext.scale(r.scalex || 1, r.scaley || 1),
this._textContext.translate(-r.x + i, -r.y + o),
this._textContext[e](n[t], r.x - r.width / 2 + i, r.y +
o),
this._textContext.globalAlpha = 1,
this._textContext.restore()
} else {
this._textContext[e](n[t], h, p);
const r = this._textContext.measureText(n[t]).width;
d.push({
x: h,
y: p,
width: r
}),
h += r + c
}
t && t.push(d),
p += u
}
))
}
_countLines() {
const {letterSpacing: e=0} = this._textStyle;
this._lineWidths = this._lines.map(( (t, r) => {
let n = 0;
for (let i = 0; i < t.length; i++) {
n += this._textContext.measureText(t[i]).width + e
}
return n - e
}
)),
this._lineWidthMax = Math.max(...this._lineWidths)
}
getTextRect() {
const e = {}
, {padding: t, letterSpacing: r, lineHeight: n, fontFamily: i,
fontSize: o, fontStyle: s, stroke: a, shadow: l} = this._textStyle;
e.textBaseline = "middle",
void 0 !== r && (e.letterSpacing = r);
const c = void 0 === n ? o : n;
e.lineHeight = c,
void 0 !== i && (e.fontFamily = i),
void 0 !== o && (e.fontSize = o),
void 0 !== s && (e.fontStyle = s),
void 0 !== a && (e.stroke = "red",
e.lineJoin = a.lineJoin,
e.strokeThickness = a.lineWidth),
void 0 !== l && (e.dropShadow = !0,
e.dropShadowAngle = l.angle,
e.dropShadowDistance = l.distance,
e.dropShadowBlur = l.blur,
e.dropShadowColor = l.color),
this._rectText = new Text$4(this._text,e);
const u = this._rectText.getLocalBounds();
let d = [0, 0, 0, 0];
void 0 !== t && (d = [...t]);
const [p,h,f,m] = d;
return u.width += h + m,
u.height = c * this._text.split("\n").length + p + f,
u
}
}
function calculateVector(e, t) {
const r = e * (Math.PI / 180);
return {
x: t * Math.cos(r),
y: t * Math.sin(r)
}
}
function compatibilityTextStyle(e) {
if ("newTextStyle" === e.type)
return {
...e
};
e.fill || (e.fill = "#fff");
const t = {
radius: [0, 0, 0, 0],
type: "newTextStyle",
direction: "horizontal",
fillType: "string" == typeof e.fill ? "normal" : "gradual",
fill: "#ffffff",
padding: [5, 5, 5, 5],
fontSize: e.fontSize || 200,
letterSpacing: e.letterSpacing || 0,
lineHeight: e.lineHeight || 200,
align: e.align || "left",
fontFamily: e.fontFamily,
fontWeight: e.fontWeight,
fontStyle: e.fontStyle,
stroke: {
color: "#000000",
lineJoin: "round",
lineWidth: 10
}
};
if (e.textBgColor) {
const {textBgColor: r} = e;
t.backgroundColor = `rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`
}
if (e.dropShadow) {
const {dropShadowAlpha: r, dropShadowAngle: n, dropShadowBlur: i,
dropShadowColor: o, dropShadowDistance: s} = e
, a = tinycolor(o);
a.setAlpha(r),
t.shadow = {
distance: s,
angle: n,
color: a.toRgbString(),
blur: i
}
}
if (e.stroke) {
const {stroke: r, strokeThickness: n} = e
, i = tinycolor(r);
t.stroke = {
color: i.toRgbString(),
lineJoin: "round",
lineWidth: n
}
}
if (e.fill) {
const {fill: r, fillGradientType: n} = e;
t.fill = "string" == typeof r ? r : {
type: "linear",
value: {
angle: 0 === n ? 0 : Math.PI / 2,
colors: r.map(( (e, t) => ({
color: e,
offset: t / (r.length - 1)
})))
}
}
}
return t
}
function getIntersectionPoints(e, t, r) {
let n = r * (Math.PI / 180)
, i = Math.cos(n)
, o = Math.sin(n)
, s = t / 2
, a = e / 2 / Math.abs(i)
, l = s / Math.abs(o)
, c = Math.min(a, l)
, u = c * i
, d = c * o
, p = e / 2
, h = t / 2;
return {
point1: {
x: p + u,
y: h - d
},
point2: {
x: p + -u,
y: h - -d
}
}
}
function TaggedTextElement(e) {
const {visible: t, env: r, trackIndex: n} = e
, i = e.element
, o = reactExports.useRef()
, [,s] = reactExports.useReducer((e => e + 1), 0)
, a = e.store
, l = reactExports.useRef();
void 0 === i.scale && (i.scale = 1);
const c = reactExports.useMemo(( () => {
const {text: e, textStyle: t} = i;
t.fontSize = 200,
t.lineHeight = t.fontSize;
const r = compatibilityTextStyle(t);
r.lineHeight || (r.lineHeight = r.fontSize);
for (let l in i.textStyle)
delete i.textStyle[l];
Object.assign(i.textStyle, r);
let n = i.textScale ? i.textScale : 1;
i.textScale = n;
const o = new TxtTexture(e,r,n);
l.current = o;
const s = l.current.init()
, {width: a, height: c} = l.current.rect;
i.style.width = a / n,
i.style.height = c / n;
const u = new Sprite(s);
u.tt = o,
u.name = "element";
const d = new Container;
return d.addChild(u),
d
}
), [n]);
return reactExports.useEffect(( () => {
const e = l.current.update(i.text, {
...i.textStyle
});
i.style.width = e.width * i.textScale,
i.style.height = e.height * i.textScale,
s(),
setTimeout(( () => {
pubsub.publish(a.events.UPDATE_CONTROL_TARGET)
}
), 0)
}
), [i.text, i.textStyle, i._textStyleDirty, i.textScale]),
reactExports.useEffect(( () => {
if (i.textEnterAnimate) {
const t = e => {
const {style: t} = i;
return t ? "alpha" === e && void 0 === t.alpha ? 1 :
t[e] ?? 0 : 0
}
, r = []
, {duration: n} = i.textEnterAnimate
, o = Math.max(n / i.text.length, .01);
i.textEnterAnimate.frames.forEach((e => {
const t = e.progress * n;
r.push({
time: t,
id: createID(),
ease: i.textEnterAnimate.ease,
transform: {
...e.transform
},
alpha: e.alpha,
width: e.width,
height: e.height,
_dirty: createID()
})
}
));
let s = 0;
l.current.points.forEach(( (n, a) => {
n.forEach(( (n, a) => {
const l = getNowFrame({
animateStatusFrames: r,
time: e.relativeTime - s * o,
duration: i.duration,
getStyleValue: t
});
if (l) {
const {alpha: e, transform: t} = l;
t && (void 0 !== t.translateX && (n.offsetX =
t.translateX),
void 0 !== t.translateY && (n.offsetY =
t.translateY),
void 0 !== t.scaleX && (n.offsetScaleX = t.scaleX),
void 0 !== t.scaleY && (n.offsetScaleY = t.scaleY),
void 0 !== t.rotation && (n.offsetRotate =
t.rotation)),
void 0 !== e && (n.offsetOpacity = e)
}
s++
}
))
}
)),
l.current.run()
}
}
), [i.textEnterAnimate, e.relativeTime]),
reactExports.useEffect(( () => {
i.textStyle.fontFamily || (i.textStyle.fontFamily = "Default"),
i.textStyle.fontFamily && loadFont(i.textStyle.fontFamily,
i.textStyle.fontFamilyURL).then(( () => {
const e = l.current.update(i.text, i.textStyle);
i.style.width = e.width * i.textScale,
i.style.height = e.height * i.textScale,
s(),
setTimeout(( () => {
pubsub.publish(a.events.UPDATE_CONTROL_TARGET)
}
), 0)
}
))
}
), [i.textStyle.fontFamily]),
reactExports.useEffect(( () => {
if (void 0 !== i.style.width && void 0 !== i.style.height) {
i.style.width = Math.max(i.style.width, 1),
i.style.height = Math.max(i.style.height, 1);
const e = Math.max(i.style.width / l.current.rect.width, .1)
, t = c.children.find((e => "element" === e.name));
t.width = i.style.width,
t.height = i.style.height,
i.textScale = e,
l.current.setScale(i.textScale)
}
}
), [i.style.width]),
reactExports.useEffect(( () => () => {
l.current.destroys()
}
), []),
useSyncPixiElement$1(c, {
style: {
...i.style
},
parent: e.parent,
animateRef: o,
visible: t,
hide: e.hide,
lock: e.lock,
relativeTime: e.relativeTime,
store: e.store
}, ["x", "y", "alpha", "rotation"], i),
jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
children: ["editor" === r && jsxRuntimeExports.jsx(ControlElment$1,
{
store: e.store,
trackIndex: n,
scale: e.scale,
hide: e.hide,
lock: e.lock,
element: i,
visible: t
}), jsxRuntimeExports.jsx(Animate$2, {
ref: o,
store: e.store,
pixiElem: c,
elementData: i,
currentTime: e.currentTime,
relativeTime: e.relativeTime
})]
})
}
function CaptionText(e) {
const {visible: t, env: r, trackIndex: n, scale: i} = e
, o = e.element
, s = reactExports.useRef()
, [,a] = reactExports.useReducer((e => e + 1), 0)
, l = e.store
, c = reactExports.useRef();
void 0 === o.scale && (o.scale = 1);
const u = reactExports.useMemo(( () => {
const e = new Container;
let {text: t, textStyle: r} = o;
r.fontSize = 200,
r.lineHeight = r.fontSize;
const n = compatibilityTextStyle(r);
n.lineHeight || (n.lineHeight = n.fontSize);
for (let c in o.textStyle)
delete o.textStyle[c];
Object.assign(o.textStyle, n);
let i = o.textScale ? o.textScale : 1;
o.textScale = i;
const s = new TxtTexture(t,o.textStyle,i);
c.current = s;
const a = s.init()
, {width: l, height: u} = s.rect
, d = new Sprite(a);
return d.tt = s,
d.name = "element",
o.style.width = l / i,
o.style.height = u / i,
e.addChild(d),
e
}
), [n])
, d = u.children.find((e => "element" === e.name));
reactExports.useEffect(( () => {
const e = d.tt.update(o.text, o.textStyle);
o.style.width = e.width * o.textScale,
o.style.height = e.height * o.textScale,
l.captionContainer.children.forEach((e => {
const t = e.children.find((e => "element" === e.name));
if (d.name !== t.name) {
const r = t.tt.update(e.elementData.text, o.textStyle);
e.elementData.style.width = r.width *
e.elementData.textScale,
e.elementData.style.height = r.height *
e.elementData.textScale
}
}
)),
a(),
setTimeout(( () => {
pubsub.publish(l.events.UPDATE_CONTROL_TARGET)
}
), 0)
}
), [o.text, o.textStyle, o._textStyleDirty, o.textScale]),
reactExports.useEffect(( () => {
if (o.textEnterAnimate) {
const t = e => {
const {style: t} = o;
return t ? "alpha" === e && void 0 === t.alpha ? 1 :
t[e] ?? 0 : 0
}
, r = []
, {duration: n} = o.textEnterAnimate
, i = Math.max(n / o.text.length, .01);
o.textEnterAnimate.frames.forEach((e => {
const t = e.progress * n;
r.push({
time: t,
id: createID(),
ease: o.textEnterAnimate.ease,
transform: {
...e.transform
},
alpha: e.alpha,
width: e.width,
height: e.height,
_dirty: createID()
})
}
));
let s = 0;
d.tt.points.forEach(( (n, a) => {
n.forEach(( (n, a) => {
const {alpha: l, transform: c} = getNowFrame({
animateStatusFrames: r,
time: e.relativeTime - s * i,
duration: o.duration,
getStyleValue: t
});
c && (void 0 !== c.translateX && (n.offsetX =
c.translateX),
void 0 !== c.translateY && (n.offsetY = c.translateY),
void 0 !== c.scaleX && (n.offsetScaleX = c.scaleX),
void 0 !== c.scaleY && (n.offsetScaleY = c.scaleY),
void 0 !== c.rotation && (n.offsetRotate =
c.rotation)),
void 0 !== l && (n.offsetOpacity = l),
s++
}
))
}
)),
d.tt.run()
}
}
), [o.textEnterAnimate, e.relativeTime]),
reactExports.useEffect(( () => {
o.textStyle.fontFamily || (o.textStyle.fontFamily = "Default"),
loadFont(o.textStyle.fontFamily,
o.textStyle.fontFamilyURL).then(( () => {
const e = d.tt.update(o.text, o.textStyle);
o.style.width = e.width * o.textScale,
o.style.height = e.height * o.textScale,
l.captionContainer.children.forEach((e => {
const t = e.children.find((e => "element" === e.name));
if (d.name !== t.name) {
const r = t.tt.update(e.elementData.text, o.textStyle);
e.elementData.style.width = r.width *
e.elementData.textScale,
e.elementData.style.height = r.height *
e.elementData.textScale
}
}
)),
a(),
setTimeout(( () => {
pubsub.publish(l.events.UPDATE_CONTROL_TARGET)
}
), 0)
}
))
}
), [o.textStyle.fontFamily]);
const p = reactExports.useCallback((t => {
if (void 0 !== o.style.width && void 0 !== o.style.height) {
o.style.width = Math.max(t, 1),
o.style.height = Math.max(o.style.height, 1);
const r = Math.max(t / d.tt.rect.width, .1);
r.toFixed(3) !== o.textScale.toFixed(3) &&
e.store.captionContainer.children.forEach((e => {
const t = e.children.find((e => "element" === e.name));
e.elementData.textScale = r,
t.tt.setScale(o.textScale)
}
));
const n = u.children.find((e => "element" === e.name));
if (!n)
return;
n.width = t,
n.height = o.style.height,
o.textScale = r,
d.tt.setScale(o.textScale),
f(o.style, d)
}
}
), []);
reactExports.useEffect(( () => {
p(o.style.width)
}
), [o.style.width]),
reactExports.useEffect(( () => () => {
d.tt.destroys()
}
), []);
const [h,f] = useSyncPixiElement$1(u, {
style: {
...o.style
},
parent: e.parent,
animateRef: s,
visible: t,
hide: e.hide,
lock: e.lock,
relativeTime: e.relativeTime,
store: e.store
}, ["x", "y", "alpha", "rotation"], o);
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
children: ["editor" === r && jsxRuntimeExports.jsx(ControlElment$1,
{
store: e.store,
trackIndex: n,
scale: i,
hide: e.hide,
lock: e.lock,
isCaption: !0,
element: o,
visible: t
}), jsxRuntimeExports.jsx(Animate$2, {
ref: s,
store: e.store,
pixiElem: u,
elementData: o,
currentTime: e.currentTime,
relativeTime: e.relativeTime
})]
})
}
function VElement(e) {
const t = e.element
, {visible: r, currentTime: n, relativeTime: i, env: o, trackIndex:
s} = e
, a = e.store
, l = reactExports.useRef(!1);
return reactExports.useMemo(( () => {
const e = new Container;
if ("export" === o)
a.elementReadyMark[t.id] = "start";
else {
const e = a.resourceManage.getCacheBlobURLById(t.resourceId,
s);
if (!e)
throw new Error("轨道资源未设置");
e.target.muted = t.muted,
e.target.volume = t.volume,
e.target.playbackRate = t.speed,
e.target.autoplay = !1,
e.target.paused || e.target.pause()
}
return e
}
), [t.resourceId, s]),
reactExports.useEffect(( () => {
if (a.usedMediaInfo[t.id] || (a.usedMediaInfo[t.id] = {
resourceId: t.resourceId,
volume: t.volume,
startTime: t.startTime,
duration: t.duration,
clipTime: t.clipTime,
speed: t.speed,
muted: t.muted
}),
"export" !== o) {
const e = a.resourceManage.getCacheBlobURLById(t.resourceId,
s);
e && (e.target.muted = t.muted,
e.target.volume = t.volume,
e.target.playbackRate = t.speed),
a.usedMediaInfo[t.id].muted = t.muted,
a.usedMediaInfo[t.id].volume = t.volume,
a.usedMediaInfo[t.id].speed = t.speed
}
}
), [t.muted, t.volume, t.speed]),
reactExports.useEffect(( () => {
const e = () => {
l.current = !0
}
, r = a.resourceManage.getCacheBlobURLById(t.resourceId, s);
return "export" === o ? a.elementReadyMark[t.id] = "success" :
r.target.addEventListener("canplay", e),
() => {
delete a.usedMediaInfo[t.id],
"export" !== o && r.target.removeEventListener("canplay", e)
}
}
), []),
reactExports.useEffect(( () => {
if (null !== i) {
const e = i.toFixed(1) === t.duration.toFixed(1);
if ("export" === o)
;
else {
const r =
a.resourceManage.getCacheBlobURLById(t.resourceId, s);
if (a.playing) {
if (r.target.paused && l.current &&
r.target.play().then(( () => {
r.target.currentTime = toNum(i + t.clipTime, 3)
}
)),
t.fadeOutTime && i >= t.duration - t.fadeOutTime) {
const e = Math.min((t.duration - i) /
t.fadeOutTime, 1)
, n = t.volume * e;
r.target.volume = n
}
if (t.fadeInTime && i <= t.fadeInTime) {
const e = Math.min(i / t.fadeInTime, 1)
, n = t.volume * e;
r.target.volume = n
}
} else
r.target.currentTime = i;
e && !r.target.paused && r.target.pause()
}
} else if ("export" !== o) {
const e = a.resourceManage.getCacheBlobURLById(t.resourceId,
s);
e.target.paused || e.target.pause()
}
}
), [i, t.clipTime]),
null
}
const filters = {
BlurFilter: BlurFilter,
AlphaFilter: AlphaFilter,
FXAAFilter: FXAAFilter,
NoiseFilter: NoiseFilter,
ColorMatrixFilter: ColorMatrixFilter,
SpriteMaskFilter: SpriteMaskFilter,
DisplacementFilter: DisplacementFilter
};
function Effect$1(e) {
const t = e.element
, {visible: r, relativeTime: n, scale: i} = e
, o = e.store
, s = reactExports.useRef([])
, a = reactExports.useCallback(( (e, t) => {
const r = {};
for (let n = 0; n < t.length; n++) {
const i = t[n - 1]
, o = t[n]
, s = t[n + 1];
if (i) {
const t = (e - i.progress) / (o.progress - i.progress);
if (!(t > i.progress && t <= o.progress))
continue;
for (let e in o.params) {
const n = i.params[e]
, s = o.params[e];
switch (s) {
case "color":
case "lightColor":
case "shadowColor":
case "stops[0].color":
case "stops[1].color":
case "originalColor":
case "newColor":
case "original 0":
case "target 0":
case "original 1":
case "target 1":
case "original 2":
case "target 2":
r[e] = tinycolor.mix(n, s, ~~(100 * t));
break;
default:
r[e] = (s - n) * t + n
}
}
return r
}
if (s) {
const t = (e - o.progress) / (s.progress - o.progress);
if (!(t > o.progress && t <= s.progress))
continue;
for (let e in s.params) {
const n = o.params[e]
, i = s.params[e];
switch (n) {
case "color":
case "lightColor":
case "shadowColor":
case "stops[0].color":
case "stops[1].color":
case "originalColor":
case "newColor":
case "original 0":
case "target 0":
case "original 1":
case "target 1":
case "original 2":
case "target 2":
r[e] = tinycolor.mix(n, i, ~~(100 * t));
break;
default:
r[e] = (i - n) * t + n
}
}
return r
}
}
return r
}
), []);
return reactExports.useEffect(( () => {
s.current = [],
t.effects.forEach((e => {
const t = {
...pxFilters,
...filters
}[e.name];
if (t) {
const r = new t;
r.id = e.id,
r.enabled = !1,
s.current.push(r)
}
}
)),
o.bodyContainer.filters = [...s.current, ...o.bodyContainer.filters
|| []];
const e = t.effects.map((e => e.id));
return () => {
o.bodyContainer.filters = (o.bodyContainer.filters ||
[]).filter((t => !e.includes(t.id))),
s.current.forEach((e => {
e.destroy()
}
)),
s.current = []
}
}
), []),
reactExports.useEffect(( () => {
if (r && null !== n) {
const e = n / t.duration
, {width: r, height: i} = o.data;
s.current.forEach((n => {
const {frames: o} = t.effects.find((e => e.id === n.id)) ||
{};
if (o) {
const t = a(e, o);
for (let e in t)
switch (e) {
case "center.x":
n.center[0] = r / 2 * 1;
break;
case "center.y":
n.center[1] = i / 2 * 1;
break;
default:
n[e] = t[e]
}
}
n.enabled = !0
}
))
} else
s.current.forEach((e => {
e.enabled = !1
}
))
}
), [r, n]),
null
}
var lottie$1 = {
exports: {}
};
(function(module, exports) {
var factory;
"undefined" != typeof navigator && (factory = function() {
var svgNS = "http://www.w3.org/2000/svg"
, locationHref = ""
, _useWebWorker = !1
, initialDefaultFrame = -999999
, setWebWorker = function(e) {
_useWebWorker = !!e
}
, getWebWorker = function() {
return _useWebWorker
}
, setLocationHref = function(e) {
locationHref = e
}
, getLocationHref = function() {
return locationHref
};
function createTag(e) {
return document.createElement(e)
}
function extendPrototype(e, t) {
var r, n, i = e.length;
for (r = 0; r < i; r += 1)
for (var o in n = e[r].prototype)
Object.prototype.hasOwnProperty.call(n, o) &&
(t.prototype[o] = n[o])
}
function getDescriptor(e, t) {
return Object.getOwnPropertyDescriptor(e, t)
}
function createProxyFunction(e) {
function t() {}
return t.prototype = e,
t
}
var audioControllerFactory = function() {
function e(e) {
this.audios = [],
this.audioFactory = e,
this._volume = 1,
this._isMuted = !1
}
return e.prototype = {
addAudio: function(e) {
this.audios.push(e)
},
pause: function() {
var e, t = this.audios.length;
for (e = 0; e < t; e += 1)
this.audios[e].pause()
},
resume: function() {
var e, t = this.audios.length;
for (e = 0; e < t; e += 1)
this.audios[e].resume()
},
setRate: function(e) {
var t, r = this.audios.length;
for (t = 0; t < r; t += 1)
this.audios[t].setRate(e)
},
createAudio: function(e) {
return this.audioFactory ? this.audioFactory(e) :
window.Howl ? new window.Howl({
src: [e]
}) : {
isPlaying: !1,
play: function() {
this.isPlaying = !0
},
seek: function() {
this.isPlaying = !1
},
playing: function() {},
rate: function() {},
setVolume: function() {}
}
},
setAudioFactory: function(e) {
this.audioFactory = e
},
setVolume: function(e) {
this._volume = e,
this._updateVolume()
},
mute: function() {
this._isMuted = !0,
this._updateVolume()
},
unmute: function() {
this._isMuted = !1,
this._updateVolume()
},
getVolume: function() {
return this._volume
},
_updateVolume: function() {
var e, t = this.audios.length;
for (e = 0; e < t; e += 1)
this.audios[e].volume(this._volume * (this._isMuted
? 0 : 1))
}
},
function() {
return new e
}
}()
, createTypedArray = function() {
function e(e, t) {
var r, n = 0, i = [];
switch (e) {
case "int16":
case "uint8c":
r = 1;
break;
default:
r = 1.1
}
for (n = 0; n < t; n += 1)
i.push(r);
return i
}
return "function" == typeof Uint8ClampedArray && "function" ==
typeof Float32Array ? function(t, r) {
return "float32" === t ? new Float32Array(r) : "int16" ===
t ? new Int16Array(r) : "uint8c" === t ? new Uint8ClampedArray(r) : e(t, r)
}
: e
}();
function createSizedArray(e) {
return Array.apply(null, {
length: e
})
}
function _typeof$6(e) {
return (_typeof$6 = "function" == typeof Symbol && "symbol" ==
typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor
=== Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
var subframeEnabled = !0
, expressionsPlugin = null
, expressionsInterfaces = null
, idPrefix$1 = ""
, isSafari =
/^((?!chrome|android).)*safari/i.test(navigator.userAgent)
, bmPow = Math.pow
, bmSqrt = Math.sqrt
, bmFloor = Math.floor
, bmMax = Math.max
, bmMin = Math.min
, BMMath = {};
!function() {
var e, t = ["abs", "acos", "acosh", "asin", "asinh", "atan",
"atanh", "atan2", "ceil", "cbrt", "expm1", "clz32", "cos", "cosh", "exp", "floor",
"fround", "hypot", "imul", "log", "log1p", "log2", "log10", "max", "min", "pow",
"random", "round", "sign", "sin", "sinh", "sqrt", "tan", "tanh", "trunc", "E",
"LN10", "LN2", "LOG10E", "LOG2E", "PI", "SQRT1_2", "SQRT2"], r = t.length;
for (e = 0; e < r; e += 1)
BMMath[t[e]] = Math[t[e]]
}(),
BMMath.random = Math.random,
BMMath.abs = function(e) {
if ("object" === _typeof$6(e) && e.length) {
var t, r = createSizedArray(e.length), n = e.length;
for (t = 0; t < n; t += 1)
r[t] = Math.abs(e[t]);
return r
}
return Math.abs(e)
}
;
var defaultCurveSegments = 150
, degToRads = Math.PI / 180
, roundCorner = .5519;
function styleDiv(e) {
e.style.position = "absolute",
e.style.top = 0,
e.style.left = 0,
e.style.display = "block",
e.style.transformOrigin = "0 0",
e.style.webkitTransformOrigin = "0 0",
e.style.backfaceVisibility = "visible",
e.style.webkitBackfaceVisibility = "visible",
e.style.transformStyle = "preserve-3d",
e.style.webkitTransformStyle = "preserve-3d",
e.style.mozTransformStyle = "preserve-3d"
}
function BMEnterFrameEvent(e, t, r, n) {
this.type = e,
this.currentTime = t,
this.totalTime = r,
this.direction = n < 0 ? -1 : 1
}
function BMCompleteEvent(e, t) {
this.type = e,
this.direction = t < 0 ? -1 : 1
}
function BMCompleteLoopEvent(e, t, r, n) {
this.type = e,
this.currentLoop = r,
this.totalLoops = t,
this.direction = n < 0 ? -1 : 1
}
function BMSegmentStartEvent(e, t, r) {
this.type = e,
this.firstFrame = t,
this.totalFrames = r
}
function BMDestroyEvent(e, t) {
this.type = e,
this.target = t
}
function BMRenderFrameErrorEvent(e, t) {
this.type = "renderFrameError",
this.nativeError = e,
this.currentTime = t
}
function BMConfigErrorEvent(e) {
this.type = "configError",
this.nativeError = e
}
var createElementID = (_count = 0,
function() {
return idPrefix$1 + "__lottie_element_" + (_count += 1)
}
), _count;
function HSVtoRGB(e, t, r) {
var n, i, o, s, a, l, c, u;
switch (l = r * (1 - t),
c = r * (1 - (a = 6 * e - (s = Math.floor(6 * e))) * t),
u = r * (1 - (1 - a) * t),
s % 6) {
case 0:
n = r,
i = u,
o = l;
break;
case 1:
n = c,
i = r,
o = l;
break;
case 2:
n = l,
i = r,
o = u;
break;
case 3:
n = l,
i = c,
o = r;
break;
case 4:
n = u,
i = l,
o = r;
break;
case 5:
n = r,
i = l,
o = c
}
return [n, i, o]
}
function RGBtoHSV(e, t, r) {
var n, i = Math.max(e, t, r), o = Math.min(e, t, r), s = i - o,
a = 0 === i ? 0 : s / i, l = i / 255;
switch (i) {
case o:
n = 0;
break;
case e:
n = t - r + s * (t < r ? 6 : 0),
n /= 6 * s;
break;
case t:
n = r - e + 2 * s,
n /= 6 * s;
break;
case r:
n = e - t + 4 * s,
n /= 6 * s
}
return [n, a, l]
}
function addSaturationToRGB(e, t) {
var r = RGBtoHSV(255 * e[0], 255 * e[1], 255 * e[2]);
return r[1] += t,
r[1] > 1 ? r[1] = 1 : r[1] <= 0 && (r[1] = 0),
HSVtoRGB(r[0], r[1], r[2])
}
function addBrightnessToRGB(e, t) {
var r = RGBtoHSV(255 * e[0], 255 * e[1], 255 * e[2]);
return r[2] += t,
r[2] > 1 ? r[2] = 1 : r[2] < 0 && (r[2] = 0),
HSVtoRGB(r[0], r[1], r[2])
}
function addHueToRGB(e, t) {
var r = RGBtoHSV(255 * e[0], 255 * e[1], 255 * e[2]);
return r[0] += t / 360,
r[0] > 1 ? r[0] -= 1 : r[0] < 0 && (r[0] += 1),
HSVtoRGB(r[0], r[1], r[2])
}
var rgbToHex = function() {
var e, t, r = [];
for (e = 0; e < 256; e += 1)
t = e.toString(16),
r[e] = 1 === t.length ? "0" + t : t;
return function(e, t, n) {
return e < 0 && (e = 0),
t < 0 && (t = 0),
n < 0 && (n = 0),
"#" + r[e] + r[t] + r[n]
}
}()
, setSubframeEnabled = function(e) {
subframeEnabled = !!e
}
, getSubframeEnabled = function() {
return subframeEnabled
}
, setExpressionsPlugin = function(e) {
expressionsPlugin = e
}
, getExpressionsPlugin = function() {
return expressionsPlugin
}
, setExpressionInterfaces = function(e) {
expressionsInterfaces = e
}
, getExpressionInterfaces = function() {
return expressionsInterfaces
}
, setDefaultCurveSegments = function(e) {
defaultCurveSegments = e
}
, getDefaultCurveSegments = function() {
return defaultCurveSegments
}
, setIdPrefix = function(e) {
idPrefix$1 = e
};
function createNS(e) {
return document.createElementNS(svgNS, e)
}
function _typeof$5(e) {
return (_typeof$5 = "function" == typeof Symbol && "symbol" ==
typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor
=== Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
var dataManager = function() {
var e, t, r = 1, n = [], i = {
onmessage: function() {},
postMessage: function(t) {
e({
data: t
})
}
}, o = {
postMessage: function(e) {
i.onmessage({
data: e
})
}
};
function s() {
t || (t = function(t) {
if (window.Worker && window.Blob && getWebWorker()) {
var r = new Blob(["var _workerSelf = self;
self.onmessage = ", t.toString()],{
type: "text/javascript"
})
, n = URL.createObjectURL(r);
return new Worker(n)
}
return e = t,
i
}((function(e) {
if (o.dataManager || (o.dataManager = function() {
function e(i, o) {
var s, a, l, c, u, p, h = i.length;
for (a = 0; a < h; a += 1)
if ("ks"in (s = i[a]) && !s.completed) {
if (s.completed = !0,
s.hasMask) {
var f = s.masksProperties;
for (c = f.length,
l = 0; l < c; l += 1)
if (f[l].pt.k.i)
n(f[l].pt.k);
else
for (p = f[l].pt.k.length,
u = 0; u < p; u += 1)
f[l].pt.k[u].s &&
n(f[l].pt.k[u].s[0]),
f[l].pt.k[u].e &&
n(f[l].pt.k[u].e[0])
}
0 === s.ty ? (s.layers = t(s.refId, o),
e(s.layers, o)) : 4 === s.ty ?
r(s.shapes) : 5 === s.ty && d(s)
}
}
function t(e, t) {
var r = function(e, t) {
for (var r = 0, n = t.length; r < n; ) {
if (t[r].id === e)
return t[r];
r += 1
}
return null
}(e, t);
return r ? r.layers.__used ?
JSON.parse(JSON.stringify(r.layers)) : (r.layers.__used = !0,
r.layers) : null
}
function r(e) {
var t, i, o;
for (t = e.length - 1; t >= 0; t -= 1)
if ("sh" === e[t].ty)
if (e[t].ks.k.i)
n(e[t].ks.k);
else
for (o = e[t].ks.k.length,
i = 0; i < o; i += 1)
e[t].ks.k[i].s &&
n(e[t].ks.k[i].s[0]),
e[t].ks.k[i].e &&
n(e[t].ks.k[i].e[0]);
else
"gr" === e[t].ty && r(e[t].it)
}
function n(e) {
var t, r = e.i.length;
for (t = 0; t < r; t += 1)
e.i[t][0] += e.v[t][0],
e.i[t][1] += e.v[t][1],
e.o[t][0] += e.v[t][0],
e.o[t][1] += e.v[t][1]
}
function i(e, t) {
var r = t ? t.split(".") : [100, 100, 100];
return e[0] > r[0] || !(r[0] > e[0]) && (e[1] >
r[1] || !(r[1] > e[1]) && (e[2] > r[2] || !(r[2] > e[2]) && null))
}
var o, s = function() {
var e = [4, 4, 14];
function t(e) {
var t, r, n, i = e.length;
for (t = 0; t < i; t += 1)
5 === e[t].ty && (n = void 0,
n = (r = e[t]).t.d,
r.t.d = {
k: [{
s: n,
t: 0
}]
})
}
return function(r) {
if (i(e, r.v) && (t(r.layers),
r.assets)) {
var n, o = r.assets.length;
for (n = 0; n < o; n += 1)
r.assets[n].layers &&
t(r.assets[n].layers)
}
}
}(), a = (o = [4, 7, 99],
function(e) {
if (e.chars && !i(o, e.v)) {
var t, n = e.chars.length;
for (t = 0; t < n; t += 1) {
var s = e.chars[t];
s.data && s.data.shapes &&
(r(s.data.shapes),
s.data.ip = 0,
s.data.op = 99999,
s.data.st = 0,
s.data.sr = 1,
s.data.ks = {
p: {
k: [0, 0],
a: 0
},
s: {
k: [100, 100],
a: 0
},
a: {
k: [0, 0],
a: 0
},
r: {
k: 0,
a: 0
},
o: {
k: 100,
a: 0
}
},
e.chars[t].t || (s.data.shapes.push({
ty: "no"
}),
s.data.shapes[0].it.push({
p: {
k: [0, 0],
a: 0
},
s: {
k: [100, 100],
a: 0
},
a: {
k: [0, 0],
a: 0
},
r: {
k: 0,
a: 0
},
o: {
k: 100,
a: 0
},
sk: {
k: 0,
a: 0
},
sa: {
k: 0,
a: 0
},
ty: "tr"
})))
}
}
}
), l = function() {
var e = [5, 7, 15];
function t(e) {
var t, r, n = e.length;
for (t = 0; t < n; t += 1)
5 === e[t].ty && (r = void 0,
"number" == typeof (r = e[t].t.p).a &&
(r.a = {
a: 0,
k: r.a
}),
"number" == typeof r.p && (r.p = {
a: 0,
k: r.p
}),
"number" == typeof r.r && (r.r = {
a: 0,
k: r.r
}))
}
return function(r) {
if (i(e, r.v) && (t(r.layers),
r.assets)) {
var n, o = r.assets.length;
for (n = 0; n < o; n += 1)
r.assets[n].layers &&
t(r.assets[n].layers)
}
}
}(), c = function() {
var e = [4, 1, 9];
function t(e) {
var r, n, i, o = e.length;
for (r = 0; r < o; r += 1)
if ("gr" === e[r].ty)
t(e[r].it);
else if ("fl" === e[r].ty || "st" ===
e[r].ty)
if (e[r].c.k && e[r].c.k[0].i)
for (i = e[r].c.k.length,
n = 0; n < i; n += 1)
e[r].c.k[n].s &&
(e[r].c.k[n].s[0] /= 255,
e[r].c.k[n].s[1] /= 255,
e[r].c.k[n].s[2] /= 255,
e[r].c.k[n].s[3] /= 255),
e[r].c.k[n].e &&
(e[r].c.k[n].e[0] /= 255,
e[r].c.k[n].e[1] /= 255,
e[r].c.k[n].e[2] /= 255,
e[r].c.k[n].e[3] /= 255);
else
e[r].c.k[0] /= 255,
e[r].c.k[1] /= 255,
e[r].c.k[2] /= 255,
e[r].c.k[3] /= 255
}
function r(e) {
var r, n = e.length;
for (r = 0; r < n; r += 1)
4 === e[r].ty && t(e[r].shapes)
}
return function(t) {
if (i(e, t.v) && (r(t.layers),
t.assets)) {
var n, o = t.assets.length;
for (n = 0; n < o; n += 1)
t.assets[n].layers &&
r(t.assets[n].layers)
}
}
}(), u = function() {
var e = [4, 4, 18];
function t(e) {
var r, n, i;
for (r = e.length - 1; r >= 0; r -= 1)
if ("sh" === e[r].ty)
if (e[r].ks.k.i)
e[r].ks.k.c = e[r].closed;
else
for (i = e[r].ks.k.length,
n = 0; n < i; n += 1)
e[r].ks.k[n].s &&
(e[r].ks.k[n].s[0].c = e[r].closed),
e[r].ks.k[n].e &&
(e[r].ks.k[n].e[0].c = e[r].closed);
else
"gr" === e[r].ty && t(e[r].it)
}
function r(e) {
var r, n, i, o, s, a, l = e.length;
for (n = 0; n < l; n += 1) {
if ((r = e[n]).hasMask) {
var c = r.masksProperties;
for (o = c.length,
i = 0; i < o; i += 1)
if (c[i].pt.k.i)
c[i].pt.k.c = c[i].cl;
else
for (a = c[i].pt.k.length,
s = 0; s < a; s += 1)
c[i].pt.k[s].s &&
(c[i].pt.k[s].s[0].c = c[i].cl),
c[i].pt.k[s].e &&
(c[i].pt.k[s].e[0].c = c[i].cl)
}
4 === r.ty && t(r.shapes)
}
}
return function(t) {
if (i(e, t.v) && (r(t.layers),
t.assets)) {
var n, o = t.assets.length;
for (n = 0; n < o; n += 1)
t.assets[n].layers &&
r(t.assets[n].layers)
}
}
}();
function d(e) {
0 === e.t.a.length && e.t.p
}
var p = {
completeData: function(r) {
r.__complete || (c(r),
s(r),
a(r),
l(r),
u(r),
e(r.layers, r.assets),
function(r, n) {
if (r) {
var i = 0
, o = r.length;
for (i = 0; i < o; i += 1)
1 === r[i].t &&
(r[i].data.layers = t(r[i].data.refId, n),
e(r[i].data.layers, n))
}
}(r.chars, r.assets),
r.__complete = !0)
}
};
return p.checkColors = c,
p.checkChars = a,
p.checkPathProperties = l,
p.checkShapes = u,
p.completeLayers = e,
p
}()),
o.assetLoader || (o.assetLoader = function() {
function e(e) {
var t = e.getResponseHeader("content-type");
return t && "json" === e.responseType && -1 !==
t.indexOf("json") || e.response && "object" === _typeof$5(e.response) ?
e.response : e.response && "string" == typeof e.response ? JSON.parse(e.response) :
e.responseText ? JSON.parse(e.responseText) : null
}
return {
load: function(t, r, n, i) {
var o, s = new XMLHttpRequest;
try {
s.responseType = "json"
} catch (a) {}
s.onreadystatechange = function() {
if (4 === s.readyState)
if (200 === s.status)
o = e(s),
n(o);
else
try {
o = e(s),
n(o)
} catch (a) {
i && i(a)
}
}
;
try {
s.open(["G", "E", "T"].join(""), t, !0)
} catch (l) {
s.open(["G", "E", "T"].join(""), r +
"/" + t, !0)
}
s.send()
}
}
}()),
"loadAnimation" === e.data.type)
o.assetLoader.load(e.data.path, e.data.fullPath,
(function(t) {
o.dataManager.completeData(t),
o.postMessage({
id: e.data.id,
payload: t,
status: "success"
})
}
), (function() {
o.postMessage({
id: e.data.id,
status: "error"
})
}
));
else if ("complete" === e.data.type) {
var t = e.data.animation;
o.dataManager.completeData(t),
o.postMessage({
id: e.data.id,
payload: t,
status: "success"
})
} else
"loadData" === e.data.type &&
o.assetLoader.load(e.data.path, e.data.fullPath, (function(t) {
o.postMessage({
id: e.data.id,
payload: t,
status: "success"
})
}
), (function() {
o.postMessage({
id: e.data.id,
status: "error"
})
}
))
}
)),
t.onmessage = function(e) {
var t = e.data
, r = t.id
, i = n[r];
n[r] = null,
"success" === t.status ? i.onComplete(t.payload) :
i.onError && i.onError()
}
)
}
function a(e, t) {
var i = "processId_" + (r += 1);
return n[i] = {
onComplete: e,
onError: t
},
i
}
return {
loadAnimation: function(e, r, n) {
s();
var i = a(r, n);
t.postMessage({
type: "loadAnimation",
path: e,
fullPath: window.location.origin +
window.location.pathname,
id: i
})
},
loadData: function(e, r, n) {
s();
var i = a(r, n);
t.postMessage({
type: "loadData",
path: e,
fullPath: window.location.origin +
window.location.pathname,
id: i
})
},
completeAnimation: function(e, r, n) {
s();
var i = a(r, n);
t.postMessage({
type: "complete",
animation: e,
id: i
})
}
}
}()
, ImagePreloader = function() {
var e = function() {
var e = createTag("canvas");
e.width = 1,
e.height = 1;
var t = e.getContext("2d");
return t.fillStyle = "rgba(0,0,0,0)",
t.fillRect(0, 0, 1, 1),
e
}();
function t() {
this.loadedAssets += 1,
this.loadedAssets === this.totalImages &&
this.loadedFootagesCount === this.totalFootages && this.imagesLoadedCb &&
this.imagesLoadedCb(null)
}
function r() {
this.loadedFootagesCount += 1,
this.loadedAssets === this.totalImages &&
this.loadedFootagesCount === this.totalFootages && this.imagesLoadedCb &&
this.imagesLoadedCb(null)
}
function n(e, t, r) {
var n = "";
if (e.e)
n = e.p;
else if (t) {
var i = e.p;
-1 !== i.indexOf("images/") && (i = i.split("/")[1]),
n = t + i
} else
n = r,
n += e.u ? e.u : "",
n += e.p;
return n
}
function i(e) {
var t = 0
, r = setInterval(function() {
(e.getBBox().width || t > 500) && (this._imageLoaded(),
clearInterval(r)),
t += 1
}
.bind(this), 50)
}
function o(e) {
var t = {
assetData: e
}
, r = n(e, this.assetsPath, this.path);
return dataManager.loadData(r, function(e) {
t.img = e,
this._footageLoaded()
}
.bind(this), function() {
t.img = {},
this._footageLoaded()
}
.bind(this)),
t
}
function s() {
this._imageLoaded = t.bind(this),
this._footageLoaded = r.bind(this),
this.testImageLoaded = i.bind(this),
this.createFootageData = o.bind(this),
this.assetsPath = "",
this.path = "",
this.totalImages = 0,
this.totalFootages = 0,
this.loadedAssets = 0,
this.loadedFootagesCount = 0,
this.imagesLoadedCb = null,
this.images = []
}
return s.prototype = {
loadAssets: function(e, t) {
var r;
this.imagesLoadedCb = t;
var n = e.length;
for (r = 0; r < n; r += 1)
e[r].layers || (e[r].t && "seq" !== e[r].t ? 3 ===
e[r].t && (this.totalFootages += 1,
this.images.push(this.createFootageData(e[r]))) :
(this.totalImages += 1,
this.images.push(this._createImageData(e[r]))))
},
setAssetsPath: function(e) {
this.assetsPath = e || ""
},
setPath: function(e) {
this.path = e || ""
},
loadedImages: function() {
return this.totalImages === this.loadedAssets
},
loadedFootages: function() {
return this.totalFootages === this.loadedFootagesCount
},
destroy: function() {
this.imagesLoadedCb = null,
this.images.length = 0
},
getAsset: function(e) {
for (var t = 0, r = this.images.length; t < r; ) {
if (this.images[t].assetData === e)
return this.images[t].img;
t += 1
}
return null
},
createImgData: function(t) {
var r = n(t, this.assetsPath, this.path)
, i = createTag("img");
i.crossOrigin = "anonymous",
i.addEventListener("load", this._imageLoaded, !1),
i.addEventListener("error", function() {
o.img = e,
this._imageLoaded()
}
.bind(this), !1),
i.src = r;
var o = {
img: i,
assetData: t
};
return o
},
createImageData: function(t) {
var r = n(t, this.assetsPath, this.path)
, i = createNS("image");
isSafari ? this.testImageLoaded(i) :
i.addEventListener("load", this._imageLoaded, !1),
i.addEventListener("error", function() {
o.img = e,
this._imageLoaded()
}
.bind(this), !1),
i.setAttributeNS("http://www.w3.org/1999/xlink",
"href", r),
this._elementHelper.append ?
this._elementHelper.append(i) : this._elementHelper.appendChild(i);
var o = {
img: i,
assetData: t
};
return o
},
imageLoaded: t,
footageLoaded: r,
setCacheType: function(e, t) {
"svg" === e ? (this._elementHelper = t,
this._createImageData =
this.createImageData.bind(this)) : this._createImageData =
this.createImgData.bind(this)
}
},
s
}();
function BaseEvent() {}
BaseEvent.prototype = {
triggerEvent: function(e, t) {
if (this._cbs[e])
for (var r = this._cbs[e], n = 0; n < r.length; n += 1)
r[n](t)
},
addEventListener: function(e, t) {
return this._cbs[e] || (this._cbs[e] = []),
this._cbs[e].push(t),
function() {
this.removeEventListener(e, t)
}
.bind(this)
},
removeEventListener: function(e, t) {
if (t) {
if (this._cbs[e]) {
for (var r = 0, n = this._cbs[e].length; r < n; )
this._cbs[e][r] === t &&
(this._cbs[e].splice(r, 1),
r -= 1,
n -= 1),
r += 1;
this._cbs[e].length || (this._cbs[e] = null)
}
} else
this._cbs[e] = null
}
};
var markerParser = function() {
function e(e) {
for (var t, r = e.split("\r\n"), n = {}, i = 0, o = 0; o <
r.length; o += 1)
2 === (t = r[o].split(":")).length && (n[t[0]] =
t[1].trim(),
i += 1);
if (0 === i)
throw new Error;
return n
}
return function(t) {
for (var r = [], n = 0; n < t.length; n += 1) {
var i = t[n]
, o = {
time: i.tm,
duration: i.dr
};
try {
o.payload = JSON.parse(t[n].cm)
} catch (s) {
try {
o.payload = e(t[n].cm)
} catch (a) {
o.payload = {
name: t[n].cm
}
}
}
r.push(o)
}
return r
}
}()
, ProjectInterface = function() {
function e(e) {
this.compositions.push(e)
}
return function() {
function t(e) {
for (var t = 0, r = this.compositions.length; t < r; )
{
if (this.compositions[t].data &&
this.compositions[t].data.nm === e)
return this.compositions[t].prepareFrame &&
this.compositions[t].data.xt &&
this.compositions[t].prepareFrame(this.currentFrame),
this.compositions[t].compInterface;
t += 1
}
return null
}
return t.compositions = [],
t.currentFrame = 0,
t.registerComposition = e,
t
}
}()
, renderers = {}
, registerRenderer = function(e, t) {
renderers[e] = t
};
function getRenderer(e) {
return renderers[e]
}
function getRegisteredRenderer() {
if (renderers.canvas)
return "canvas";
for (var e in renderers)
if (renderers[e])
return e;
return ""
}
function _typeof$4(e) {
return (_typeof$4 = "function" == typeof Symbol && "symbol" ==
typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor
=== Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
var AnimationItem = function() {
this._cbs = [],
this.name = "",
this.path = "",
this.isLoaded = !1,
this.currentFrame = 0,
this.currentRawFrame = 0,
this.firstFrame = 0,
this.totalFrames = 0,
this.frameRate = 0,
this.frameMult = 0,
this.playSpeed = 1,
this.playDirection = 1,
this.playCount = 0,
this.animationData = {},
this.assets = [],
this.isPaused = !0,
this.autoplay = !1,
this.loop = !0,
this.renderer = null,
this.animationID = createElementID(),
this.assetsPath = "",
this.timeCompleted = 0,
this.segmentPos = 0,
this.isSubframeEnabled = getSubframeEnabled(),
this.segments = [],
this._idle = !0,
this._completedLoop = !1,
this.projectInterface = ProjectInterface(),
this.imagePreloader = new ImagePreloader,
this.audioController = audioControllerFactory(),
this.markers = [],
this.configAnimation = this.configAnimation.bind(this),
this.onSetupError = this.onSetupError.bind(this),
this.onSegmentComplete = this.onSegmentComplete.bind(this),
this.drawnFrameEvent = new
BMEnterFrameEvent("drawnFrame",0,0,0),
this.expressionsPlugin = getExpressionsPlugin()
};
extendPrototype([BaseEvent], AnimationItem),
AnimationItem.prototype.setParams = function(e) {
(e.wrapper || e.container) && (this.wrapper = e.wrapper ||
e.container);
var t = "svg";
e.animType ? t = e.animType : e.renderer && (t = e.renderer);
var r = getRenderer(t);
this.renderer = new r(this,e.rendererSettings),
this.imagePreloader.setCacheType(t,
this.renderer.globalData.defs),
this.renderer.setProjectInterface(this.projectInterface),
this.animType = t,
"" === e.loop || null === e.loop || void 0 === e.loop || !0 ===
e.loop ? this.loop = !0 : !1 === e.loop ? this.loop = !1 : this.loop =
parseInt(e.loop, 10),
this.autoplay = !("autoplay"in e) || e.autoplay,
this.name = e.name ? e.name : "",
this.autoloadSegments = !
Object.prototype.hasOwnProperty.call(e, "autoloadSegments") || e.autoloadSegments,
this.assetsPath = e.assetsPath,
this.initialSegment = e.initialSegment,
e.audioFactory &&
this.audioController.setAudioFactory(e.audioFactory),
e.animationData ? this.setupAnimation(e.animationData) : e.path
&& (-1 !== e.path.lastIndexOf("\\") ? this.path = e.path.substr(0,
e.path.lastIndexOf("\\") + 1) : this.path = e.path.substr(0,
e.path.lastIndexOf("/") + 1),
this.fileName = e.path.substr(e.path.lastIndexOf("/") + 1),
this.fileName = this.fileName.substr(0,
this.fileName.lastIndexOf(".json")),
dataManager.loadAnimation(e.path, this.configAnimation,
this.onSetupError))
}
,
AnimationItem.prototype.onSetupError = function() {
this.trigger("data_failed")
}
,
AnimationItem.prototype.setupAnimation = function(e) {
dataManager.completeAnimation(e, this.configAnimation)
}
,
AnimationItem.prototype.setData = function(e, t) {
t && "object" !== _typeof$4(t) && (t = JSON.parse(t));
var r = {
wrapper: e,
animationData: t
}
, n = e.attributes;
r.path = n.getNamedItem("data-animation-path") ?
n.getNamedItem("data-animation-path").value : n.getNamedItem("data-bm-path") ?
n.getNamedItem("data-bm-path").value : n.getNamedItem("bm-path") ?
n.getNamedItem("bm-path").value : "",
r.animType = n.getNamedItem("data-anim-type") ?
n.getNamedItem("data-anim-type").value : n.getNamedItem("data-bm-type") ?
n.getNamedItem("data-bm-type").value : n.getNamedItem("bm-type") ?
n.getNamedItem("bm-type").value : n.getNamedItem("data-bm-renderer") ?
n.getNamedItem("data-bm-renderer").value : n.getNamedItem("bm-renderer") ?
n.getNamedItem("bm-renderer").value : getRegisteredRenderer() || "canvas";
var i = n.getNamedItem("data-anim-loop") ?
n.getNamedItem("data-anim-loop").value : n.getNamedItem("data-bm-loop") ?
n.getNamedItem("data-bm-loop").value : n.getNamedItem("bm-loop") ?
n.getNamedItem("bm-loop").value : "";
"false" === i ? r.loop = !1 : "true" === i ? r.loop = !0 : "" !
== i && (r.loop = parseInt(i, 10));
var o = n.getNamedItem("data-anim-autoplay") ?
n.getNamedItem("data-anim-autoplay").value : n.getNamedItem("data-bm-autoplay") ?
n.getNamedItem("data-bm-autoplay").value : !n.getNamedItem("bm-autoplay") ||
n.getNamedItem("bm-autoplay").value;
r.autoplay = "false" !== o,
r.name = n.getNamedItem("data-name") ? n.getNamedItem("data-
name").value : n.getNamedItem("data-bm-name") ? n.getNamedItem("data-bm-
name").value : n.getNamedItem("bm-name") ? n.getNamedItem("bm-name").value : "",
"false" === (n.getNamedItem("data-anim-prerender") ?
n.getNamedItem("data-anim-prerender").value : n.getNamedItem("data-bm-prerender") ?
n.getNamedItem("data-bm-prerender").value : n.getNamedItem("bm-prerender") ?
n.getNamedItem("bm-prerender").value : "") && (r.prerender = !1),
r.path ? this.setParams(r) : this.trigger("destroy")
}
,
AnimationItem.prototype.includeLayers = function(e) {
e.op > this.animationData.op && (this.animationData.op = e.op,
this.totalFrames = Math.floor(e.op - this.animationData.ip));
var t, r, n = this.animationData.layers, i = n.length, o =
e.layers, s = o.length;
for (r = 0; r < s; r += 1)
for (t = 0; t < i; ) {
if (n[t].id === o[r].id) {
n[t] = o[r];
break
}
t += 1
}
if ((e.chars || e.fonts) &&
(this.renderer.globalData.fontManager.addChars(e.chars),
this.renderer.globalData.fontManager.addFonts(e.fonts,
this.renderer.globalData.defs)),
e.assets)
for (i = e.assets.length,
t = 0; t < i; t += 1)
this.animationData.assets.push(e.assets[t]);
this.animationData.__complete = !1,
dataManager.completeAnimation(this.animationData,
this.onSegmentComplete)
}
,
AnimationItem.prototype.onSegmentComplete = function(e) {
this.animationData = e;
var t = getExpressionsPlugin();
t && t.initExpressions(this),
this.loadNextSegment()
}
,
AnimationItem.prototype.loadNextSegment = function() {
var e = this.animationData.segments;
if (!e || 0 === e.length || !this.autoloadSegments)
return this.trigger("data_ready"),
void (this.timeCompleted = this.totalFrames);
var t = e.shift();
this.timeCompleted = t.time * this.frameRate;
var r = this.path + this.fileName + "_" + this.segmentPos +
".json";
this.segmentPos += 1,
dataManager.loadData(r, this.includeLayers.bind(this),
function() {
this.trigger("data_failed")
}
.bind(this))
}
,
AnimationItem.prototype.loadSegments = function() {
this.animationData.segments || (this.timeCompleted =
this.totalFrames),
this.loadNextSegment()
}
,
AnimationItem.prototype.imagesLoaded = function() {
this.trigger("loaded_images"),
this.checkLoaded()
}
,
AnimationItem.prototype.preloadImages = function() {
this.imagePreloader.setAssetsPath(this.assetsPath),
this.imagePreloader.setPath(this.path),
this.imagePreloader.loadAssets(this.animationData.assets,
this.imagesLoaded.bind(this))
}
,
AnimationItem.prototype.configAnimation = function(e) {
if (this.renderer)
try {
this.animationData = e,
this.initialSegment ? (this.totalFrames =
Math.floor(this.initialSegment[1] - this.initialSegment[0]),
this.firstFrame = Math.round(this.initialSegment[0])) :
(this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip),
this.firstFrame = Math.round(this.animationData.ip)),
this.renderer.configAnimation(e),
e.assets || (e.assets = []),
this.assets = this.animationData.assets,
this.frameRate = this.animationData.fr,
this.frameMult = this.animationData.fr / 1e3,
this.renderer.searchExtraCompositions(e.assets),
this.markers = markerParser(e.markers || []),
this.trigger("config_ready"),
this.preloadImages(),
this.loadSegments(),
this.updaFrameModifier(),
this.waitForFontsLoaded(),
this.isPaused && this.audioController.pause()
} catch (t) {
this.triggerConfigError(t)
}
}
,
AnimationItem.prototype.waitForFontsLoaded = function() {
this.renderer && (this.renderer.globalData.fontManager.isLoaded
? this.checkLoaded() : setTimeout(this.waitForFontsLoaded.bind(this), 20))
}
,
AnimationItem.prototype.checkLoaded = function() {
if (!this.isLoaded &&
this.renderer.globalData.fontManager.isLoaded &&
(this.imagePreloader.loadedImages() || "canvas" !== this.renderer.rendererType) &&
this.imagePreloader.loadedFootages()) {
this.isLoaded = !0;
var e = getExpressionsPlugin();
e && e.initExpressions(this),
this.renderer.initItems(),
setTimeout(function() {
this.trigger("DOMLoaded")
}
.bind(this), 0),
this.gotoFrame(),
this.autoplay && this.play()
}
}
,
AnimationItem.prototype.resize = function(e, t) {
var r = "number" == typeof e ? e : void 0
, n = "number" == typeof t ? t : void 0;
this.renderer.updateContainerSize(r, n)
}
,
AnimationItem.prototype.setSubframe = function(e) {
this.isSubframeEnabled = !!e
}
,
AnimationItem.prototype.gotoFrame = function() {
this.currentFrame = this.isSubframeEnabled ?
this.currentRawFrame : ~~this.currentRawFrame,
this.timeCompleted !== this.totalFrames && this.currentFrame >
this.timeCompleted && (this.currentFrame = this.timeCompleted),
this.trigger("enterFrame"),
this.renderFrame(),
this.trigger("drawnFrame")
}
,
AnimationItem.prototype.renderFrame = function() {
if (!1 !== this.isLoaded && this.renderer)
try {
this.expressionsPlugin &&
this.expressionsPlugin.resetFrame(),
this.renderer.renderFrame(this.currentFrame +
this.firstFrame)
} catch (e) {
this.triggerRenderFrameError(e)
}
}
,
AnimationItem.prototype.play = function(e) {
e && this.name !== e || !0 === this.isPaused && (this.isPaused
= !1,
this.trigger("_play"),
this.audioController.resume(),
this._idle && (this._idle = !1,
this.trigger("_active")))
}
,
AnimationItem.prototype.pause = function(e) {
e && this.name !== e || !1 === this.isPaused && (this.isPaused
= !0,
this.trigger("_pause"),
this._idle = !0,
this.trigger("_idle"),
this.audioController.pause())
}
,
AnimationItem.prototype.togglePause = function(e) {
e && this.name !== e || (!0 === this.isPaused ? this.play() :
this.pause())
}
,
AnimationItem.prototype.stop = function(e) {
e && this.name !== e || (this.pause(),
this.playCount = 0,
this._completedLoop = !1,
this.setCurrentRawFrameValue(0))
}
,
AnimationItem.prototype.getMarkerData = function(e) {
for (var t, r = 0; r < this.markers.length; r += 1)
if ((t = this.markers[r]).payload && t.payload.name === e)
return t;
return null
}
,
AnimationItem.prototype.goToAndStop = function(e, t, r) {
if (!r || this.name === r) {
var n = Number(e);
if (isNaN(n)) {
var i = this.getMarkerData(e);
i && this.goToAndStop(i.time, !0)
} else
t ? this.setCurrentRawFrameValue(e) :
this.setCurrentRawFrameValue(e * this.frameModifier);
this.pause()
}
}
,
AnimationItem.prototype.goToAndPlay = function(e, t, r) {
if (!r || this.name === r) {
var n = Number(e);
if (isNaN(n)) {
var i = this.getMarkerData(e);
i && (i.duration ? this.playSegments([i.time, i.time +
i.duration], !0) : this.goToAndStop(i.time, !0))
} else
this.goToAndStop(n, t, r);
this.play()
}
}
,
AnimationItem.prototype.advanceTime = function(e) {
if (!0 !== this.isPaused && !1 !== this.isLoaded) {
var t = this.currentRawFrame + e * this.frameModifier
, r = !1;
t >= this.totalFrames - 1 && this.frameModifier > 0 ?
this.loop && this.playCount !== this.loop ? t >= this.totalFrames ? (this.playCount
+= 1,
this.checkSegments(t % this.totalFrames) ||
(this.setCurrentRawFrameValue(t % this.totalFrames),
this._completedLoop = !0,
this.trigger("loopComplete"))) :
this.setCurrentRawFrameValue(t) : this.checkSegments(t > this.totalFrames ? t %
this.totalFrames : 0) || (r = !0,
t = this.totalFrames - 1) : t < 0 ? this.checkSegments(t %
this.totalFrames) || (!this.loop || this.playCount-- <= 0 && !0 !== this.loop ? (r
= !0,
t = 0) : (this.setCurrentRawFrameValue(this.totalFrames + t
% this.totalFrames),
this._completedLoop ? this.trigger("loopComplete") :
this._completedLoop = !0)) : this.setCurrentRawFrameValue(t),
r && (this.setCurrentRawFrameValue(t),
this.pause(),
this.trigger("complete"))
}
}
,
AnimationItem.prototype.adjustSegment = function(e, t) {
this.playCount = 0,
e[1] < e[0] ? (this.frameModifier > 0 && (this.playSpeed < 0 ?
this.setSpeed(-this.playSpeed) : this.setDirection(-1)),
this.totalFrames = e[0] - e[1],
this.timeCompleted = this.totalFrames,
this.firstFrame = e[1],
this.setCurrentRawFrameValue(this.totalFrames - .001 - t)) :
e[1] > e[0] && (this.frameModifier < 0 && (this.playSpeed < 0 ? this.setSpeed(-
this.playSpeed) : this.setDirection(1)),
this.totalFrames = e[1] - e[0],
this.timeCompleted = this.totalFrames,
this.firstFrame = e[0],
this.setCurrentRawFrameValue(.001 + t)),
this.trigger("segmentStart")
}
,
AnimationItem.prototype.setSegment = function(e, t) {
var r = -1;
this.isPaused && (this.currentRawFrame + this.firstFrame < e ?
r = e : this.currentRawFrame + this.firstFrame > t && (r = t - e)),
this.firstFrame = e,
this.totalFrames = t - e,
this.timeCompleted = this.totalFrames,
-1 !== r && this.goToAndStop(r, !0)
}
,
AnimationItem.prototype.playSegments = function(e, t) {
if (t && (this.segments.length = 0),
"object" === _typeof$4(e[0])) {
var r, n = e.length;
for (r = 0; r < n; r += 1)
this.segments.push(e[r])
} else
this.segments.push(e);
this.segments.length && t &&
this.adjustSegment(this.segments.shift(), 0),
this.isPaused && this.play()
}
,
AnimationItem.prototype.resetSegments = function(e) {
this.segments.length = 0,
this.segments.push([this.animationData.ip,
this.animationData.op]),
e && this.checkSegments(0)
}
,
AnimationItem.prototype.checkSegments = function(e) {
return !!this.segments.length &&
(this.adjustSegment(this.segments.shift(), e),
!0)
}
,
AnimationItem.prototype.destroy = function(e) {
e && this.name !== e || !this.renderer ||
(this.renderer.destroy(),
this.imagePreloader.destroy(),
this.trigger("destroy"),
this._cbs = null,
this.onEnterFrame = null,
this.onLoopComplete = null,
this.onComplete = null,
this.onSegmentStart = null,
this.onDestroy = null,
this.renderer = null,
this.expressionsPlugin = null,
this.imagePreloader = null,
this.projectInterface = null)
}
,
AnimationItem.prototype.setCurrentRawFrameValue = function(e) {
this.currentRawFrame = e,
this.gotoFrame()
}
,
AnimationItem.prototype.setSpeed = function(e) {
this.playSpeed = e,
this.updaFrameModifier()
}
,
AnimationItem.prototype.setDirection = function(e) {
this.playDirection = e < 0 ? -1 : 1,
this.updaFrameModifier()
}
,
AnimationItem.prototype.setLoop = function(e) {
this.loop = e
}
,
AnimationItem.prototype.setVolume = function(e, t) {
t && this.name !== t || this.audioController.setVolume(e)
}
,
AnimationItem.prototype.getVolume = function() {
return this.audioController.getVolume()
}
,
AnimationItem.prototype.mute = function(e) {
e && this.name !== e || this.audioController.mute()
}
,
AnimationItem.prototype.unmute = function(e) {
e && this.name !== e || this.audioController.unmute()
}
,
AnimationItem.prototype.updaFrameModifier = function() {
this.frameModifier = this.frameMult * this.playSpeed *
this.playDirection,
this.audioController.setRate(this.playSpeed *
this.playDirection)
}
,
AnimationItem.prototype.getPath = function() {
return this.path
}
,
AnimationItem.prototype.getAssetsPath = function(e) {
var t = "";
if (e.e)
t = e.p;
else if (this.assetsPath) {
var r = e.p;
-1 !== r.indexOf("images/") && (r = r.split("/")[1]),
t = this.assetsPath + r
} else
t = this.path,
t += e.u ? e.u : "",
t += e.p;
return t
}
,
AnimationItem.prototype.getAssetData = function(e) {
for (var t = 0, r = this.assets.length; t < r; ) {
if (e === this.assets[t].id)
return this.assets[t];
t += 1
}
return null
}
,
AnimationItem.prototype.hide = function() {
this.renderer.hide()
}
,
AnimationItem.prototype.show = function() {
this.renderer.show()
}
,
AnimationItem.prototype.getDuration = function(e) {
return e ? this.totalFrames : this.totalFrames / this.frameRate
}
,
AnimationItem.prototype.updateDocumentData = function(e, t, r) {
try {
this.renderer.getElementByPath(e).updateDocumentData(t, r)
} catch (n) {}
}
,
AnimationItem.prototype.trigger = function(e) {
if (this._cbs && this._cbs[e])
switch (e) {
case "enterFrame":
this.triggerEvent(e, new
BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameModifier));
break;
case "drawnFrame":
this.drawnFrameEvent.currentTime = this.currentFrame,
this.drawnFrameEvent.totalTime = this.totalFrames,
this.drawnFrameEvent.direction = this.frameModifier,
this.triggerEvent(e, this.drawnFrameEvent);
break;
case "loopComplete":
this.triggerEvent(e, new
BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult));
break;
case "complete":
this.triggerEvent(e, new
BMCompleteEvent(e,this.frameMult));
break;
case "segmentStart":
this.triggerEvent(e, new
BMSegmentStartEvent(e,this.firstFrame,this.totalFrames));
break;
case "destroy":
this.triggerEvent(e, new BMDestroyEvent(e,this));
break;
default:
this.triggerEvent(e)
}
"enterFrame" === e && this.onEnterFrame &&
this.onEnterFrame.call(this, new
BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameMult)),
"loopComplete" === e && this.onLoopComplete &&
this.onLoopComplete.call(this, new
BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult)),
"complete" === e && this.onComplete &&
this.onComplete.call(this, new BMCompleteEvent(e,this.frameMult)),
"segmentStart" === e && this.onSegmentStart &&
this.onSegmentStart.call(this, new
BMSegmentStartEvent(e,this.firstFrame,this.totalFrames)),
"destroy" === e && this.onDestroy && this.onDestroy.call(this,
new BMDestroyEvent(e,this))
}
,
AnimationItem.prototype.triggerRenderFrameError = function(e) {
var t = new BMRenderFrameErrorEvent(e,this.currentFrame);
this.triggerEvent("error", t),
this.onError && this.onError.call(this, t)
}
,
AnimationItem.prototype.triggerConfigError = function(e) {
var t = new BMConfigErrorEvent(e,this.currentFrame);
this.triggerEvent("error", t),
this.onError && this.onError.call(this, t)
}
;
var animationManager = function() {
var e = {}
, t = []
, r = 0
, n = 0
, i = 0
, o = !0
, s = !1;
function a(e) {
for (var r = 0, i = e.target; r < n; )
t[r].animation === i && (t.splice(r, 1),
r -= 1,
n -= 1,
i.isPaused || u()),
r += 1
}
function l(e, r) {
if (!e)
return null;
for (var i = 0; i < n; ) {
if (t[i].elem === e && null !== t[i].elem)
return t[i].animation;
i += 1
}
var o = new AnimationItem;
return d(o, e),
o.setData(e, r),
o
}
function c() {
i += 1,
f()
}
function u() {
i -= 1
}
function d(e, r) {
e.addEventListener("destroy", a),
e.addEventListener("_active", c),
e.addEventListener("_idle", u),
t.push({
elem: r,
animation: e
}),
n += 1
}
function p(e) {
var a, l = e - r;
for (a = 0; a < n; a += 1)
t[a].animation.advanceTime(l);
r = e,
i && !s ? window.requestAnimationFrame(p) : o = !0
}
function h(e) {
r = e,
window.requestAnimationFrame(p)
}
function f() {
!s && i && o && (window.requestAnimationFrame(h),
o = !1)
}
return e.registerAnimation = l,
e.loadAnimation = function(e) {
var t = new AnimationItem;
return d(t, null),
t.setParams(e),
t
}
,
e.setSpeed = function(e, r) {
var i;
for (i = 0; i < n; i += 1)
t[i].animation.setSpeed(e, r)
}
,
e.setDirection = function(e, r) {
var i;
for (i = 0; i < n; i += 1)
t[i].animation.setDirection(e, r)
}
,
e.play = function(e) {
var r;
for (r = 0; r < n; r += 1)
t[r].animation.play(e)
}
,
e.pause = function(e) {
var r;
for (r = 0; r < n; r += 1)
t[r].animation.pause(e)
}
,
e.stop = function(e) {
var r;
for (r = 0; r < n; r += 1)
t[r].animation.stop(e)
}
,
e.togglePause = function(e) {
var r;
for (r = 0; r < n; r += 1)
t[r].animation.togglePause(e)
}
,
e.searchAnimations = function(e, t, r) {
var n, i =
[].concat([].slice.call(document.getElementsByClassName("lottie")),
[].slice.call(document.getElementsByClassName("bodymovin"))), o = i.length;
for (n = 0; n < o; n += 1)
r && i[n].setAttribute("data-bm-type", r),
l(i[n], e);
if (t && 0 === o) {
r || (r = "svg");
var s = document.getElementsByTagName("body")[0];
s.innerText = "";
var a = createTag("div");
a.style.width = "100%",
a.style.height = "100%",
a.setAttribute("data-bm-type", r),
s.appendChild(a),
l(a, e)
}
}
,
e.resize = function() {
var e;
for (e = 0; e < n; e += 1)
t[e].animation.resize()
}
,
e.goToAndStop = function(e, r, i) {
var o;
for (o = 0; o < n; o += 1)
t[o].animation.goToAndStop(e, r, i)
}
,
e.destroy = function(e) {
var r;
for (r = n - 1; r >= 0; r -= 1)
t[r].animation.destroy(e)
}
,
e.freeze = function() {
s = !0
}
,
e.unfreeze = function() {
s = !1,
f()
}
,
e.setVolume = function(e, r) {
var i;
for (i = 0; i < n; i += 1)
t[i].animation.setVolume(e, r)
}
,
e.mute = function(e) {
var r;
for (r = 0; r < n; r += 1)
t[r].animation.mute(e)
}
,
e.unmute = function(e) {
var r;
for (r = 0; r < n; r += 1)
t[r].animation.unmute(e)
}
,
e.getRegisteredAnimations = function() {
var e, r = t.length, n = [];
for (e = 0; e < r; e += 1)
n.push(t[e].animation);
return n
}
,
e
}()
, BezierFactory = function() {
var e = {
getBezierEasing: function(e, r, n, i, o) {
var s = o || ("bez_" + e + "_" + r + "_" + n + "_" +
i).replace(/\./g, "p");
if (t[s])
return t[s];
var a = new u([e, r, n, i]);
return t[s] = a,
a
}
}
, t = {}
, r = 11
, n = 1 / (r - 1)
, i = "function" == typeof Float32Array;
function o(e, t) {
return 1 - 3 * t + 3 * e
}
function s(e, t) {
return 3 * t - 6 * e
}
function a(e) {
return 3 * e
}
function l(e, t, r) {
return ((o(t, r) * e + s(t, r)) * e + a(t)) * e
}
function c(e, t, r) {
return 3 * o(t, r) * e * e + 2 * s(t, r) * e + a(t)
}
function u(e) {
this._p = e,
this._mSampleValues = i ? new Float32Array(r) : new
Array(r),
this._precomputed = !1,
this.get = this.get.bind(this)
}
return u.prototype = {
get: function(e) {
var t = this._p[0]
, r = this._p[1]
, n = this._p[2]
, i = this._p[3];
return this._precomputed || this._precompute(),
t === r && n === i ? e : 0 === e ? 0 : 1 === e ? 1 :
l(this._getTForX(e), r, i)
},
_precompute: function() {
var e = this._p[0]
, t = this._p[1]
, r = this._p[2]
, n = this._p[3];
this._precomputed = !0,
e === t && r === n || this._calcSampleValues()
},
_calcSampleValues: function() {
for (var e = this._p[0], t = this._p[2], i = 0; i < r;
++i)
this._mSampleValues[i] = l(i * n, e, t)
},
_getTForX: function(e) {
for (var t = this._p[0], i = this._p[2], o =
this._mSampleValues, s = 0, a = 1, u = r - 1; a !== u && o[a] <= e; ++a)
s += n;
var d = s + (e - o[--a]) / (o[a + 1] - o[a]) * n
, p = c(d, t, i);
return p >= .001 ? function(e, t, r, n) {
for (var i = 0; i < 4; ++i) {
var o = c(t, r, n);
if (0 === o)
return t;
t -= (l(t, r, n) - e) / o
}
return t
}(e, d, t, i) : 0 === p ? d : function(e, t, r, n, i) {
var o, s, a = 0;
do {
(o = l(s = t + (r - t) / 2, n, i) - e) > 0 ? r
= s : t = s
} while (Math.abs(o) > 1e-7 && ++a < 10);
return s
}(e, s, s + n, t, i)
}
},
e
}()
, pooling = {
double: function(e) {
return e.concat(createSizedArray(e.length))
}
}
, poolFactory = function(e, t, r) {
var n = 0
, i = e
, o = createSizedArray(i);
return {
newElement: function() {
return n ? o[n -= 1] : t()
},
release: function(e) {
n === i && (o = pooling.double(o),
i *= 2),
r && r(e),
o[n] = e,
n += 1
}
}
}
, bezierLengthPool = poolFactory(8, (function() {
return {
addedLength: 0,
percents: createTypedArray("float32",
getDefaultCurveSegments()),
lengths: createTypedArray("float32",
getDefaultCurveSegments())
}
}
))
, segmentsLengthPool = poolFactory(8, (function() {
return {
lengths: [],
totalLength: 0
}
}
), (function(e) {
var t, r = e.lengths.length;
for (t = 0; t < r; t += 1)
bezierLengthPool.release(e.lengths[t]);
e.lengths.length = 0
}
));
function bezFunction() {
var e = Math;
function t(e, t, r, n, i, o) {
var s = e * n + t * i + r * o - i * n - o * e - r * t;
return s > -.001 && s < .001
}
var r = function(e, t, r, n) {
var i, o, s, a, l, c, u = getDefaultCurveSegments(), d = 0,
p = [], h = [], f = bezierLengthPool.newElement();
for (s = r.length,
i = 0; i < u; i += 1) {
for (l = i / (u - 1),
c = 0,
o = 0; o < s; o += 1)
a = bmPow(1 - l, 3) * e[o] + 3 * bmPow(1 - l, 2) *
l * r[o] + 3 * (1 - l) * bmPow(l, 2) * n[o] + bmPow(l, 3) * t[o],
p[o] = a,
null !== h[o] && (c += bmPow(p[o] - h[o], 2)),
h[o] = p[o];
c && (d += c = bmSqrt(c)),
f.percents[i] = l,
f.lengths[i] = d
}
return f.addedLength = d,
f
};
function n(e) {
this.segmentLength = 0,
this.points = new Array(e)
}
function i(e, t) {
this.partialLength = e,
this.point = t
}
var o, s = (o = {},
function(e, r, s, a) {
var l = (e[0] + "_" + e[1] + "_" + r[0] + "_" + r[1] + "_"
+ s[0] + "_" + s[1] + "_" + a[0] + "_" + a[1]).replace(/\./g, "p");
if (!o[l]) {
var c, u, d, p, h, f, m, g = getDefaultCurveSegments(),
y = 0, v = null;
2 === e.length && (e[0] !== r[0] || e[1] !== r[1]) &&
t(e[0], e[1], r[0], r[1], e[0] + s[0], e[1] + s[1]) && t(e[0], e[1], r[0], r[1],
r[0] + a[0], r[1] + a[1]) && (g = 2);
var b = new n(g);
for (d = s.length,
c = 0; c < g; c += 1) {
for (m = createSizedArray(d),
h = c / (g - 1),
f = 0,
u = 0; u < d; u += 1)
p = bmPow(1 - h, 3) * e[u] + 3 * bmPow(1 - h,
2) * h * (e[u] + s[u]) + 3 * (1 - h) * bmPow(h, 2) * (r[u] + a[u]) + bmPow(h, 3) *
r[u],
m[u] = p,
null !== v && (f += bmPow(m[u] - v[u], 2));
y += f = bmSqrt(f),
b.points[c] = new i(f,m),
v = m
}
b.segmentLength = y,
o[l] = b
}
return o[l]
}
);
function a(e, t) {
var r = t.percents
, n = t.lengths
, i = r.length
, o = bmFloor((i - 1) * e)
, s = e * t.addedLength
, a = 0;
if (o === i - 1 || 0 === o || s === n[o])
return r[o];
for (var l = n[o] > s ? -1 : 1, c = !0; c; )
if (n[o] <= s && n[o + 1] > s ? (a = (s - n[o]) / (n[o
+ 1] - n[o]),
c = !1) : o += l,
o < 0 || o >= i - 1) {
if (o === i - 1)
return r[o];
c = !1
}
return r[o] + (r[o + 1] - r[o]) * a
}
var l = createTypedArray("float32", 8);
return {
getSegmentsLength: function(e) {
var t, n = segmentsLengthPool.newElement(), i = e.c, o
= e.v, s = e.o, a = e.i, l = e._length, c = n.lengths, u = 0;
for (t = 0; t < l - 1; t += 1)
c[t] = r(o[t], o[t + 1], s[t], a[t + 1]),
u += c[t].addedLength;
return i && l && (c[t] = r(o[t], o[0], s[t], a[0]),
u += c[t].addedLength),
n.totalLength = u,
n
},
getNewSegment: function(t, r, n, i, o, s, c) {
o < 0 ? o = 0 : o > 1 && (o = 1);
var u, d = a(o, c), p = a(s = s > 1 ? 1 : s, c), h =
t.length, f = 1 - d, m = 1 - p, g = f * f * f, y = d * f * f * 3, v = d * d * f *
3, b = d * d * d, x = f * f * m, _ = d * f * m + f * d * m + f * f * p, E = d * d *
m +f * d * p + d * f * p, T = d * d * p, C = f * m * m, S = d * m * m + f * p * m
+ f* m * p, $ = d * p * m + f * p * p + d * m * p, w = d * p * p, P = m * m * m, R
= p* m * m + m * p * m + m * m * p, k = p * p * m + m * p * p + p * m * p, A = p *
p *p;
for (u = 0; u < h; u += 1)
l[4 * u] = e.round(1e3 * (g * t[u] + y * n[u] + v *
i[u] + b * r[u])) / 1e3,
l[4 * u + 1] = e.round(1e3 * (x * t[u] + _ * n[u] +
E * i[u] + T * r[u])) / 1e3,
l[4 * u + 2] = e.round(1e3 * (C * t[u] + S * n[u] +
$ * i[u] + w * r[u])) / 1e3,
l[4 * u + 3] = e.round(1e3 * (P * t[u] + R * n[u] +
k * i[u] + A * r[u])) / 1e3;
return l
},
getPointInSegment: function(t, r, n, i, o, s) {
var l = a(o, s)
, c = 1 - l;
return [e.round(1e3 * (c * c * c * t[0] + (l * c * c +
c * l * c + c * c * l) * n[0] + (l * l * c + c * l * l + l * c * l) * i[0] + l * l
* l * r[0])) / 1e3, e.round(1e3 * (c * c * c * t[1] + (l * c * c + c * l * c + c *
c * l) * n[1] + (l * l * c + c * l * l + l * c * l) * i[1] + l * l * l * r[1])) /
1e3]
},
buildBezierData: s,
pointOnLine2D: t,
pointOnLine3D: function(r, n, i, o, s, a, l, c, u) {
if (0 === i && 0 === a && 0 === u)
return t(r, n, o, s, l, c);
var d, p = e.sqrt(e.pow(o - r, 2) + e.pow(s - n, 2) +
e.pow(a - i, 2)), h = e.sqrt(e.pow(l - r, 2) + e.pow(c - n, 2) + e.pow(u - i, 2)),
f = e.sqrt(e.pow(l - o, 2) + e.pow(c - s, 2) + e.pow(u - a, 2));
return (d = p > h ? p > f ? p - h - f : f - h - p : f >
h ? f - h - p : h - p - f) > -1e-4 && d < 1e-4
}
}
}
var bez = bezFunction()
, initFrame = initialDefaultFrame
, mathAbs = Math.abs;
function interpolateValue(e, t) {
var r, n = this.offsetTime;
"multidimensional" === this.propType && (r =
createTypedArray("float32", this.pv.length));
for (var i, o, s, a, l, c, u, d, p, h = t.lastIndex, f = h, m =
this.keyframes.length - 1, g = !0; g; ) {
if (i = this.keyframes[f],
o = this.keyframes[f + 1],
f === m - 1 && e >= o.t - n) {
i.h && (i = o),
h = 0;
break
}
if (o.t - n > e) {
h = f;
break
}
f < m - 1 ? f += 1 : (h = 0,
g = !1)
}
s = this.keyframesMetadata[f] || {};
var y, v = o.t - n, b = i.t - n;
if (i.to) {
s.bezierData || (s.bezierData = bez.buildBezierData(i.s,
o.s || i.e, i.to, i.ti));
var x = s.bezierData;
if (e >= v || e < b) {
var _ = e >= v ? x.points.length - 1 : 0;
for (l = x.points[_].point.length,
a = 0; a < l; a += 1)
r[a] = x.points[_].point[a]
} else {
s.__fnct ? p = s.__fnct : (p =
BezierFactory.getBezierEasing(i.o.x, i.o.y, i.i.x, i.i.y, i.n).get,
s.__fnct = p),
c = p((e - b) / (v - b));
var E, T = x.segmentLength * c, C = t.lastFrame < e &&
t._lastKeyframeIndex === f ? t._lastAddedLength : 0;
for (d = t.lastFrame < e && t._lastKeyframeIndex ===
f ? t._lastPoint : 0,
g = !0,
u = x.points.length; g; ) {
if (C += x.points[d].partialLength,
0 === T || 0 === c || d === x.points.length - 1) {
for (l = x.points[d].point.length,
a = 0; a < l; a += 1)
r[a] = x.points[d].point[a];
break
}
if (T >= C && T < C + x.points[d +
1].partialLength) {
for (E = (T - C) / x.points[d +
1].partialLength,
l = x.points[d].point.length,
a = 0; a < l; a += 1)
r[a] = x.points[d].point[a] + (x.points[d +
1].point[a] - x.points[d].point[a]) * E;
break
}
d < u - 1 ? d += 1 : g = !1
}
t._lastPoint = d,
t._lastAddedLength = C - x.points[d].partialLength,
t._lastKeyframeIndex = f
}
} else {
var S, $, w, P, R;
if (m = i.s.length,
y = o.s || i.e,
this.sh && 1 !== i.h)
e >= v ? (r[0] = y[0],
r[1] = y[1],
r[2] = y[2]) : e <= b ? (r[0] = i.s[0],
r[1] = i.s[1],
r[2] = i.s[2]) : quaternionToEuler(r,
slerp(createQuaternion(i.s), createQuaternion(y), (e - b) / (v - b)));
else
for (f = 0; f < m; f += 1)
1 !== i.h && (e >= v ? c = 1 : e < b ? c = 0 :
(i.o.x.constructor === Array ? (s.__fnct || (s.__fnct = []),
s.__fnct[f] ? p = s.__fnct[f] : (S = void 0 ===
i.o.x[f] ? i.o.x[0] : i.o.x[f],
$ = void 0 === i.o.y[f] ? i.o.y[0] : i.o.y[f],
w = void 0 === i.i.x[f] ? i.i.x[0] : i.i.x[f],
P = void 0 === i.i.y[f] ? i.i.y[0] : i.i.y[f],
p = BezierFactory.getBezierEasing(S, $, w, P).get,
s.__fnct[f] = p)) : s.__fnct ? p = s.__fnct : (S =
i.o.x,
$ = i.o.y,
w = i.i.x,
P = i.i.y,
p = BezierFactory.getBezierEasing(S, $, w, P).get,
i.keyframeMetadata = p),
c = p((e - b) / (v - b)))),
y = o.s || i.e,
R = 1 === i.h ? i.s[f] : i.s[f] + (y[f] - i.s[f]) *
c,
"multidimensional" === this.propType ? r[f] = R : r
= R
}
return t.lastIndex = h,
r
}
function slerp(e, t, r) {
var n, i, o, s, a, l = [], c = e[0], u = e[1], d = e[2], p =
e[3], h = t[0], f = t[1], m = t[2], g = t[3];
return (i = c * h + u * f + d * m + p * g) < 0 && (i = -i,
h = -h,
f = -f,
m = -m,
g = -g),
1 - i > 1e-6 ? (n = Math.acos(i),
o = Math.sin(n),
s = Math.sin((1 - r) * n) / o,
a = Math.sin(r * n) / o) : (s = 1 - r,
a = r),
l[0] = s * c + a * h,
l[1] = s * u + a * f,
l[2] = s * d + a * m,
l[3] = s * p + a * g,
l
}
function quaternionToEuler(e, t) {
var r = t[0]
, n = t[1]
, i = t[2]
, o = t[3]
, s = Math.atan2(2 * n * o - 2 * r * i, 1 - 2 * n * n - 2 * i
* i)
, a = Math.asin(2 * r * n + 2 * i * o)
, l = Math.atan2(2 * r * o - 2 * n * i, 1 - 2 * r * r - 2 * i
* i);
e[0] = s / degToRads,
e[1] = a / degToRads,
e[2] = l / degToRads
}
function createQuaternion(e) {
var t = e[0] * degToRads
, r = e[1] * degToRads
, n = e[2] * degToRads
, i = Math.cos(t / 2)
, o = Math.cos(r / 2)
, s = Math.cos(n / 2)
, a = Math.sin(t / 2)
, l = Math.sin(r / 2)
, c = Math.sin(n / 2);
return [a * l * s + i * o * c, a * o * s + i * l * c, i * l * s
- a * o * c, i * o * s - a * l * c]
}
function getValueAtCurrentTime() {
var e = this.comp.renderedFrame - this.offsetTime
, t = this.keyframes[0].t - this.offsetTime
, r = this.keyframes[this.keyframes.length - 1].t -
this.offsetTime;
if (!(e === this._caching.lastFrame ||
this._caching.lastFrame !== initFrame && (this._caching.lastFrame >= r && e >= r ||
this._caching.lastFrame < t && e < t))) {
this._caching.lastFrame >= e &&
(this._caching._lastKeyframeIndex = -1,
this._caching.lastIndex = 0);
var n = this.interpolateValue(e, this._caching);
this.pv = n
}
return this._caching.lastFrame = e,
this.pv
}
function setVValue(e) {
var t;
if ("unidimensional" === this.propType)
t = e * this.mult,
mathAbs(this.v - t) > 1e-5 && (this.v = t,
this._mdf = !0);
else
for (var r = 0, n = this.v.length; r < n; )
t = e[r] * this.mult,
mathAbs(this.v[r] - t) > 1e-5 && (this.v[r] = t,
this._mdf = !0),
r += 1
}
function processEffectsSequence() {
if (this.elem.globalData.frameId !== this.frameId &&
this.effectsSequence.length)
if (this.lock)
this.setVValue(this.pv);
else {
var e;
this.lock = !0,
this._mdf = this._isFirstFrame;
var t = this.effectsSequence.length
, r = this.kf ? this.pv : this.data.k;
for (e = 0; e < t; e += 1)
r = this.effectsSequence[e](r);
this.setVValue(r),
this._isFirstFrame = !1,
this.lock = !1,
this.frameId = this.elem.globalData.frameId
}
}
function addEffect(e) {
this.effectsSequence.push(e),
this.container.addDynamicProperty(this)
}
function ValueProperty(e, t, r, n) {
this.propType = "unidimensional",
this.mult = r || 1,
this.data = t,
this.v = r ? t.k * r : t.k,
this.pv = t.k,
this._mdf = !1,
this.elem = e,
this.container = n,
this.comp = e.comp,
this.k = !1,
this.kf = !1,
this.vel = 0,
this.effectsSequence = [],
this._isFirstFrame = !0,
this.getValue = processEffectsSequence,
this.setVValue = setVValue,
this.addEffect = addEffect
}
function MultiDimensionalProperty(e, t, r, n) {
var i;
this.propType = "multidimensional",
this.mult = r || 1,
this.data = t,
this._mdf = !1,
this.elem = e,
this.container = n,
this.comp = e.comp,
this.k = !1,
this.kf = !1,
this.frameId = -1;
var o = t.k.length;
for (this.v = createTypedArray("float32", o),
this.pv = createTypedArray("float32", o),
this.vel = createTypedArray("float32", o),
i = 0; i < o; i += 1)
this.v[i] = t.k[i] * this.mult,
this.pv[i] = t.k[i];
this._isFirstFrame = !0,
this.effectsSequence = [],
this.getValue = processEffectsSequence,
this.setVValue = setVValue,
this.addEffect = addEffect
}
function KeyframedValueProperty(e, t, r, n) {
this.propType = "unidimensional",
this.keyframes = t.k,
this.keyframesMetadata = [],
this.offsetTime = e.data.st,
this.frameId = -1,
this._caching = {
lastFrame: initFrame,
lastIndex: 0,
value: 0,
_lastKeyframeIndex: -1
},
this.k = !0,
this.kf = !0,
this.data = t,
this.mult = r || 1,
this.elem = e,
this.container = n,
this.comp = e.comp,
this.v = initFrame,
this.pv = initFrame,
this._isFirstFrame = !0,
this.getValue = processEffectsSequence,
this.setVValue = setVValue,
this.interpolateValue = interpolateValue,
this.effectsSequence = [getValueAtCurrentTime.bind(this)],
this.addEffect = addEffect
}
function KeyframedMultidimensionalProperty(e, t, r, n) {
var i;
this.propType = "multidimensional";
var o, s, a, l, c = t.k.length;
for (i = 0; i < c - 1; i += 1)
t.k[i].to && t.k[i].s && t.k[i + 1] && t.k[i + 1].s && (o =
t.k[i].s,
s = t.k[i + 1].s,
a = t.k[i].to,
l = t.k[i].ti,
(2 === o.length && (o[0] !== s[0] || o[1] !== s[1]) &&
bez.pointOnLine2D(o[0], o[1], s[0], s[1], o[0] + a[0], o[1] + a[1]) &&
bez.pointOnLine2D(o[0], o[1], s[0], s[1], s[0] + l[0], s[1] + l[1]) || 3 ===
o.length && (o[0] !== s[0] || o[1] !== s[1] || o[2] !== s[2]) &&
bez.pointOnLine3D(o[0], o[1], o[2], s[0], s[1], s[2], o[0] + a[0], o[1] + a[1],
o[2] + a[2]) && bez.pointOnLine3D(o[0], o[1], o[2], s[0], s[1], s[2], s[0] + l[0],
s[1] + l[1], s[2] + l[2])) && (t.k[i].to = null,
t.k[i].ti = null),
o[0] === s[0] && o[1] === s[1] && 0 === a[0] && 0 === a[1]
&& 0 === l[0] && 0 === l[1] && (2 === o.length || o[2] === s[2] && 0 === a[2] && 0
=== l[2]) && (t.k[i].to = null,
t.k[i].ti = null));
this.effectsSequence = [getValueAtCurrentTime.bind(this)],
this.data = t,
this.keyframes = t.k,
this.keyframesMetadata = [],
this.offsetTime = e.data.st,
this.k = !0,
this.kf = !0,
this._isFirstFrame = !0,
this.mult = r || 1,
this.elem = e,
this.container = n,
this.comp = e.comp,
this.getValue = processEffectsSequence,
this.setVValue = setVValue,
this.interpolateValue = interpolateValue,
this.frameId = -1;
var u = t.k[0].s.length;
for (this.v = createTypedArray("float32", u),
this.pv = createTypedArray("float32", u),
i = 0; i < u; i += 1)
this.v[i] = initFrame,
this.pv[i] = initFrame;
this._caching = {
lastFrame: initFrame,
lastIndex: 0,
value: createTypedArray("float32", u)
},
this.addEffect = addEffect
}
var PropertyFactory = {
getProp: function(e, t, r, n, i) {
var o;
if (t.sid && (t = e.globalData.slotManager.getProp(t)),
t.k.length)
if ("number" == typeof t.k[0])
o = new MultiDimensionalProperty(e,t,n,i);
else
switch (r) {
case 0:
o = new KeyframedValueProperty(e,t,n,i);
break;
case 1:
o = new
KeyframedMultidimensionalProperty(e,t,n,i)
}
else
o = new ValueProperty(e,t,n,i);
return o.effectsSequence.length && i.addDynamicProperty(o),
o
}
};
function DynamicPropertyContainer() {}
DynamicPropertyContainer.prototype = {
addDynamicProperty: function(e) {
-1 === this.dynamicProperties.indexOf(e) &&
(this.dynamicProperties.push(e),
this.container.addDynamicProperty(this),
this._isAnimated = !0)
},
iterateDynamicProperties: function() {
var e;
this._mdf = !1;
var t = this.dynamicProperties.length;
for (e = 0; e < t; e += 1)
this.dynamicProperties[e].getValue(),
this.dynamicProperties[e]._mdf && (this._mdf = !0)
},
initDynamicPropertyContainer: function(e) {
this.container = e,
this.dynamicProperties = [],
this._mdf = !1,
this._isAnimated = !1
}
};
var pointPool = poolFactory(8, (function() {
return createTypedArray("float32", 2)
}
));
function ShapePath() {
this.c = !1,
this._length = 0,
this._maxLength = 8,
this.v = createSizedArray(this._maxLength),
this.o = createSizedArray(this._maxLength),
this.i = createSizedArray(this._maxLength)
}
ShapePath.prototype.setPathData = function(e, t) {
this.c = e,
this.setLength(t);
for (var r = 0; r < t; )
this.v[r] = pointPool.newElement(),
this.o[r] = pointPool.newElement(),
this.i[r] = pointPool.newElement(),
r += 1
}
,
ShapePath.prototype.setLength = function(e) {
for (; this._maxLength < e; )
this.doubleArrayLength();
this._length = e
}
,
ShapePath.prototype.doubleArrayLength = function() {
this.v = this.v.concat(createSizedArray(this._maxLength)),
this.i = this.i.concat(createSizedArray(this._maxLength)),
this.o = this.o.concat(createSizedArray(this._maxLength)),
this._maxLength *= 2
}
,
ShapePath.prototype.setXYAt = function(e, t, r, n, i) {
var o;
switch (this._length = Math.max(this._length, n + 1),
this._length >= this._maxLength && this.doubleArrayLength(),
r) {
case "v":
o = this.v;
break;
case "i":
o = this.i;
break;
case "o":
o = this.o;
break;
default:
o = []
}
(!o[n] || o[n] && !i) && (o[n] = pointPool.newElement()),
o[n][0] = e,
o[n][1] = t
}
,
ShapePath.prototype.setTripleAt = function(e, t, r, n, i, o, s, a)
{
this.setXYAt(e, t, "v", s, a),
this.setXYAt(r, n, "o", s, a),
this.setXYAt(i, o, "i", s, a)
}
,
ShapePath.prototype.reverse = function() {
var e = new ShapePath;
e.setPathData(this.c, this._length);
var t = this.v
, r = this.o
, n = this.i
, i = 0;
this.c && (e.setTripleAt(t[0][0], t[0][1], n[0][0], n[0][1],
r[0][0], r[0][1], 0, !1),
i = 1);
var o, s = this._length - 1, a = this._length;
for (o = i; o < a; o += 1)
e.setTripleAt(t[s][0], t[s][1], n[s][0], n[s][1], r[s][0],
r[s][1], o, !1),
s -= 1;
return e
}
,
ShapePath.prototype.length = function() {
return this._length
}
;
var shapePool = (factory = poolFactory(4, (function() {
return new ShapePath
}
), (function(e) {
var t, r = e._length;
for (t = 0; t < r; t += 1)
pointPool.release(e.v[t]),
pointPool.release(e.i[t]),
pointPool.release(e.o[t]),
e.v[t] = null,
e.i[t] = null,
e.o[t] = null;
e._length = 0,
e.c = !1
}
)),
factory.clone = function(e) {
var t, r = factory.newElement(), n = void 0 === e._length ?
e.v.length : e._length;
for (r.setLength(n),
r.c = e.c,
t = 0; t < n; t += 1)
r.setTripleAt(e.v[t][0], e.v[t][1], e.o[t][0], e.o[t][1],
e.i[t][0], e.i[t][1], t);
return r
}
,
factory), factory;
function ShapeCollection() {
this._length = 0,
this._maxLength = 4,
this.shapes = createSizedArray(this._maxLength)
}
ShapeCollection.prototype.addShape = function(e) {
this._length === this._maxLength && (this.shapes =
this.shapes.concat(createSizedArray(this._maxLength)),
this._maxLength *= 2),
this.shapes[this._length] = e,
this._length += 1
}
,
ShapeCollection.prototype.releaseShapes = function() {
var e;
for (e = 0; e < this._length; e += 1)
shapePool.release(this.shapes[e]);
this._length = 0
}
;
var shapeCollectionPool = (ob2 = {
newShapeCollection: function() {
return _length ? pool[_length -= 1] : new ShapeCollection
},
release: function(e) {
var t, r = e._length;
for (t = 0; t < r; t += 1)
shapePool.release(e.shapes[t]);
e._length = 0,
_length === _maxLength && (pool = pooling.double(pool),
_maxLength *= 2),
pool[_length] = e,
_length += 1
}
},
_length = 0,
_maxLength = 4,
pool = createSizedArray(_maxLength),
ob2), ob2, _length, _maxLength, pool, ShapePropertyFactory =
function() {
var e = -999999;
function t(e, t, r) {
var n, i, o, s, a, l, c, u, d, p = r.lastIndex, h =
this.keyframes;
if (e < h[0].t - this.offsetTime)
n = h[0].s[0],
o = !0,
p = 0;
else if (e >= h[h.length - 1].t - this.offsetTime)
n = h[h.length - 1].s ? h[h.length - 1].s[0] :
h[h.length - 2].e[0],
o = !0;
else {
for (var f, m, g, y = p, v = h.length - 1, b = !0; b &&
(f = h[y],
!((m = h[y + 1]).t - this.offsetTime > e)); )
y < v - 1 ? y += 1 : b = !1;
if (g = this.keyframesMetadata[y] || {},
p = y,
!(o = 1 === f.h)) {
if (e >= m.t - this.offsetTime)
u = 1;
else if (e < f.t - this.offsetTime)
u = 0;
else {
var x;
g.__fnct ? x = g.__fnct : (x =
BezierFactory.getBezierEasing(f.o.x, f.o.y, f.i.x, f.i.y).get,
g.__fnct = x),
u = x((e - (f.t - this.offsetTime)) / (m.t -
this.offsetTime - (f.t - this.offsetTime)))
}
i = m.s ? m.s[0] : f.e[0]
}
n = f.s[0]
}
for (l = t._length,
c = n.i[0].length,
r.lastIndex = p,
s = 0; s < l; s += 1)
for (a = 0; a < c; a += 1)
d = o ? n.i[s][a] : n.i[s][a] + (i.i[s][a] - n.i[s]
[a]) * u,
t.i[s][a] = d,
d = o ? n.o[s][a] : n.o[s][a] + (i.o[s][a] - n.o[s]
[a]) * u,
t.o[s][a] = d,
d = o ? n.v[s][a] : n.v[s][a] + (i.v[s][a] - n.v[s]
[a]) * u,
t.v[s][a] = d
}
function r() {
var t = this.comp.renderedFrame - this.offsetTime
, r = this.keyframes[0].t - this.offsetTime
, n = this.keyframes[this.keyframes.length - 1].t -
this.offsetTime
, i = this._caching.lastFrame;
return i !== e && (i < r && t < r || i > n && t > n) ||
(this._caching.lastIndex = i < t ? this._caching.lastIndex : 0,
this.interpolateShape(t, this.pv, this._caching)),
this._caching.lastFrame = t,
this.pv
}
function n() {
this.paths = this.localShapeCollection
}
function i(e) {
(function(e, t) {
if (e._length !== t._length || e.c !== t.c)
return !1;
var r, n = e._length;
for (r = 0; r < n; r += 1)
if (e.v[r][0] !== t.v[r][0] || e.v[r][1] !== t.v[r]
[1] || e.o[r][0] !== t.o[r][0] || e.o[r][1] !== t.o[r][1] || e.i[r][0] !== t.i[r]
[0] || e.i[r][1] !== t.i[r][1])
return !1;
return !0
}
)(this.v, e) || (this.v = shapePool.clone(e),
this.localShapeCollection.releaseShapes(),
this.localShapeCollection.addShape(this.v),
this._mdf = !0,
this.paths = this.localShapeCollection)
}
function o() {
if (this.elem.globalData.frameId !== this.frameId)
if (this.effectsSequence.length)
if (this.lock)
this.setVValue(this.pv);
else {
var e, t;
this.lock = !0,
this._mdf = !1,
e = this.kf ? this.pv : this.data.ks ?
this.data.ks.k : this.data.pt.k;
var r = this.effectsSequence.length;
for (t = 0; t < r; t += 1)
e = this.effectsSequence[t](e);
this.setVValue(e),
this.lock = !1,
this.frameId = this.elem.globalData.frameId
}
else
this._mdf = !1
}
function s(e, t, r) {
this.propType = "shape",
this.comp = e.comp,
this.container = e,
this.elem = e,
this.data = t,
this.k = !1,
this.kf = !1,
this._mdf = !1;
var i = 3 === r ? t.pt.k : t.ks.k;
this.v = shapePool.clone(i),
this.pv = shapePool.clone(this.v),
this.localShapeCollection =
shapeCollectionPool.newShapeCollection(),
this.paths = this.localShapeCollection,
this.paths.addShape(this.v),
this.reset = n,
this.effectsSequence = []
}
function a(e) {
this.effectsSequence.push(e),
this.container.addDynamicProperty(this)
}
function l(t, i, o) {
this.propType = "shape",
this.comp = t.comp,
this.elem = t,
this.container = t,
this.offsetTime = t.data.st,
this.keyframes = 3 === o ? i.pt.k : i.ks.k,
this.keyframesMetadata = [],
this.k = !0,
this.kf = !0;
var s = this.keyframes[0].s[0].i.length;
this.v = shapePool.newElement(),
this.v.setPathData(this.keyframes[0].s[0].c, s),
this.pv = shapePool.clone(this.v),
this.localShapeCollection =
shapeCollectionPool.newShapeCollection(),
this.paths = this.localShapeCollection,
this.paths.addShape(this.v),
this.lastFrame = e,
this.reset = n,
this._caching = {
lastFrame: e,
lastIndex: 0
},
this.effectsSequence = [r.bind(this)]
}
s.prototype.interpolateShape = t,
s.prototype.getValue = o,
s.prototype.setVValue = i,
s.prototype.addEffect = a,
l.prototype.getValue = o,
l.prototype.interpolateShape = t,
l.prototype.setVValue = i,
l.prototype.addEffect = a;
var c = function() {
var e = roundCorner;
function t(e, t) {
this.v = shapePool.newElement(),
this.v.setPathData(!0, 4),
this.localShapeCollection =
shapeCollectionPool.newShapeCollection(),
this.paths = this.localShapeCollection,
this.localShapeCollection.addShape(this.v),
this.d = t.d,
this.elem = e,
this.comp = e.comp,
this.frameId = -1,
this.initDynamicPropertyContainer(e),
this.p = PropertyFactory.getProp(e, t.p, 1, 0, this),
this.s = PropertyFactory.getProp(e, t.s, 1, 0, this),
this.dynamicProperties.length ? this.k = !0 : (this.k =
!1,
this.convertEllToPath())
}
return t.prototype = {
reset: n,
getValue: function() {
this.elem.globalData.frameId !== this.frameId &&
(this.frameId = this.elem.globalData.frameId,
this.iterateDynamicProperties(),
this._mdf && this.convertEllToPath())
},
convertEllToPath: function() {
var t = this.p.v[0]
, r = this.p.v[1]
, n = this.s.v[0] / 2
, i = this.s.v[1] / 2
, o = 3 !== this.d
, s = this.v;
s.v[0][0] = t,
s.v[0][1] = r - i,
s.v[1][0] = o ? t + n : t - n,
s.v[1][1] = r,
s.v[2][0] = t,
s.v[2][1] = r + i,
s.v[3][0] = o ? t - n : t + n,
s.v[3][1] = r,
s.i[0][0] = o ? t - n * e : t + n * e,
s.i[0][1] = r - i,
s.i[1][0] = o ? t + n : t - n,
s.i[1][1] = r - i * e,
s.i[2][0] = o ? t + n * e : t - n * e,
s.i[2][1] = r + i,
s.i[3][0] = o ? t - n : t + n,
s.i[3][1] = r + i * e,
s.o[0][0] = o ? t + n * e : t - n * e,
s.o[0][1] = r - i,
s.o[1][0] = o ? t + n : t - n,
s.o[1][1] = r + i * e,
s.o[2][0] = o ? t - n * e : t + n * e,
s.o[2][1] = r + i,
s.o[3][0] = o ? t - n : t + n,
s.o[3][1] = r - i * e
}
},
extendPrototype([DynamicPropertyContainer], t),
t
}()
, u = function() {
function e(e, t) {
this.v = shapePool.newElement(),
this.v.setPathData(!0, 0),
this.elem = e,
this.comp = e.comp,
this.data = t,
this.frameId = -1,
this.d = t.d,
this.initDynamicPropertyContainer(e),
1 === t.sy ? (this.ir = PropertyFactory.getProp(e,
t.ir, 0, 0, this),
this.is = PropertyFactory.getProp(e, t.is, 0, .01,
this),
this.convertToPath = this.convertStarToPath) :
this.convertToPath = this.convertPolygonToPath,
this.pt = PropertyFactory.getProp(e, t.pt, 0, 0, this),
this.p = PropertyFactory.getProp(e, t.p, 1, 0, this),
this.r = PropertyFactory.getProp(e, t.r, 0, degToRads,
this),
this.or = PropertyFactory.getProp(e, t.or, 0, 0, this),
this.os = PropertyFactory.getProp(e, t.os, 0, .01,
this),
this.localShapeCollection =
shapeCollectionPool.newShapeCollection(),
this.localShapeCollection.addShape(this.v),
this.paths = this.localShapeCollection,
this.dynamicProperties.length ? this.k = !0 : (this.k =
!1,
this.convertToPath())
}
return e.prototype = {
reset: n,
getValue: function() {
this.elem.globalData.frameId !== this.frameId &&
(this.frameId = this.elem.globalData.frameId,
this.iterateDynamicProperties(),
this._mdf && this.convertToPath())
},
convertStarToPath: function() {
var e, t, r, n, i = 2 * Math.floor(this.pt.v), o =
2 * Math.PI / i, s = !0, a = this.or.v, l = this.ir.v, c = this.os.v, u =
this.is.v, d = 2 * Math.PI * a / (2 * i), p = 2 * Math.PI * l / (2 * i), h = -
Math.PI / 2;
h += this.r.v;
var f = 3 === this.data.d ? -1 : 1;
for (this.v._length = 0,
e = 0; e < i; e += 1) {
r = s ? c : u,
n = s ? d : p;
var m = (t = s ? a : l) * Math.cos(h)
, g = t * Math.sin(h)
, y = 0 === m && 0 === g ? 0 : g /
Math.sqrt(m * m + g * g)
, v = 0 === m && 0 === g ? 0 : -m /
Math.sqrt(m * m + g * g);
m += +this.p.v[0],
g += +this.p.v[1],
this.v.setTripleAt(m, g, m - y * n * r * f, g -
v * n * r * f, m + y * n * r * f, g + v * n * r * f, e, !0),
s = !s,
h += o * f
}
},
convertPolygonToPath: function() {
var e, t = Math.floor(this.pt.v), r = 2 * Math.PI /
t, n = this.or.v, i = this.os.v, o = 2 * Math.PI * n / (4 * t), s = .5 * -Math.PI,
a = 3 === this.data.d ? -1 : 1;
for (s += this.r.v,
this.v._length = 0,
e = 0; e < t; e += 1) {
var l = n * Math.cos(s)
, c = n * Math.sin(s)
, u = 0 === l && 0 === c ? 0 : c /
Math.sqrt(l * l + c * c)
, d = 0 === l && 0 === c ? 0 : -l /
Math.sqrt(l * l + c * c);
l += +this.p.v[0],
c += +this.p.v[1],
this.v.setTripleAt(l, c, l - u * o * i * a, c -
d * o * i * a, l + u * o * i * a, c + d * o * i * a, e, !0),
s += r * a
}
this.paths.length = 0,
this.paths[0] = this.v
}
},
extendPrototype([DynamicPropertyContainer], e),
e
}()
, d = function() {
function e(e, t) {
this.v = shapePool.newElement(),
this.v.c = !0,
this.localShapeCollection =
shapeCollectionPool.newShapeCollection(),
this.localShapeCollection.addShape(this.v),
this.paths = this.localShapeCollection,
this.elem = e,
this.comp = e.comp,
this.frameId = -1,
this.d = t.d,
this.initDynamicPropertyContainer(e),
this.p = PropertyFactory.getProp(e, t.p, 1, 0, this),
this.s = PropertyFactory.getProp(e, t.s, 1, 0, this),
this.r = PropertyFactory.getProp(e, t.r, 0, 0, this),
this.dynamicProperties.length ? this.k = !0 : (this.k =
!1,
this.convertRectToPath())
}
return e.prototype = {
convertRectToPath: function() {
var e = this.p.v[0]
, t = this.p.v[1]
, r = this.s.v[0] / 2
, n = this.s.v[1] / 2
, i = bmMin(r, n, this.r.v)
, o = i * (1 - roundCorner);
this.v._length = 0,
2 === this.d || 1 === this.d ?
(this.v.setTripleAt(e + r, t - n + i, e + r, t - n + i, e + r, t - n + o, 0, !0),
this.v.setTripleAt(e + r, t + n - i, e + r, t + n -
o, e + r, t + n - i, 1, !0),
0 !== i ? (this.v.setTripleAt(e + r - i, t + n, e +
r - i, t + n, e + r - o, t + n, 2, !0),
this.v.setTripleAt(e - r + i, t + n, e - r + o, t +
n, e - r + i, t + n, 3, !0),
this.v.setTripleAt(e - r, t + n - i, e - r, t + n -
i, e - r, t + n - o, 4, !0),
this.v.setTripleAt(e - r, t - n + i, e - r, t - n +
o, e - r, t - n + i, 5, !0),
this.v.setTripleAt(e - r + i, t - n, e - r + i, t -
n, e - r + o, t - n, 6, !0),
this.v.setTripleAt(e + r - i, t - n, e + r - o, t -
n, e + r - i, t - n, 7, !0)) : (this.v.setTripleAt(e - r, t + n, e - r + o, t + n,
e - r, t + n, 2),
this.v.setTripleAt(e - r, t - n, e - r, t - n + o,
e - r, t - n, 3))) : (this.v.setTripleAt(e + r, t - n + i, e + r, t - n + o, e + r,
t - n + i, 0, !0),
0 !== i ? (this.v.setTripleAt(e + r - i, t - n, e +
r - i, t - n, e + r - o, t - n, 1, !0),
this.v.setTripleAt(e - r + i, t - n, e - r + o, t -
n, e - r + i, t - n, 2, !0),
this.v.setTripleAt(e - r, t - n + i, e - r, t - n +
i, e - r, t - n + o, 3, !0),
this.v.setTripleAt(e - r, t + n - i, e - r, t + n -
o, e - r, t + n - i, 4, !0),
this.v.setTripleAt(e - r + i, t + n, e - r + i, t +
n, e - r + o, t + n, 5, !0),
this.v.setTripleAt(e + r - i, t + n, e + r - o, t +
n, e + r - i, t + n, 6, !0),
this.v.setTripleAt(e + r, t + n - i, e + r, t + n -
i, e + r, t + n - o, 7, !0)) : (this.v.setTripleAt(e - r, t - n, e - r + o, t - n,
e - r, t - n, 1, !0),
this.v.setTripleAt(e - r, t + n, e - r, t + n - o,
e - r, t + n, 2, !0),
this.v.setTripleAt(e + r, t + n, e + r - o, t + n,
e + r, t + n, 3, !0)))
},
getValue: function() {
this.elem.globalData.frameId !== this.frameId &&
(this.frameId = this.elem.globalData.frameId,
this.iterateDynamicProperties(),
this._mdf && this.convertRectToPath())
},
reset: n
},
extendPrototype([DynamicPropertyContainer], e),
e
}()
, p = {
getShapeProp: function(e, t, r) {
var n;
return 3 === r || 4 === r ? n = (3 === r ? t.pt :
t.ks).k.length ? new l(e,t,r) : new s(e,t,r) : 5 === r ? n = new d(e,t) : 6 === r ?
n = new c(e,t) : 7 === r && (n = new u(e,t)),
n.k && e.addDynamicProperty(n),
n
},
getConstructorFunction: function() {
return s
},
getKeyframedConstructorFunction: function() {
return l
}
};
return p
}(), Matrix = function() {
var e = Math.cos
, t = Math.sin
, r = Math.tan
, n = Math.round;
function i() {
return this.props[0] = 1,
this.props[1] = 0,
this.props[2] = 0,
this.props[3] = 0,
this.props[4] = 0,
this.props[5] = 1,
this.props[6] = 0,
this.props[7] = 0,
this.props[8] = 0,
this.props[9] = 0,
this.props[10] = 1,
this.props[11] = 0,
this.props[12] = 0,
this.props[13] = 0,
this.props[14] = 0,
this.props[15] = 1,
this
}
function o(r) {
if (0 === r)
return this;
var n = e(r)
, i = t(r);
return this._t(n, -i, 0, 0, i, n, 0, 0, 0, 0, 1, 0, 0, 0,
0, 1)
}
function s(r) {
if (0 === r)
return this;
var n = e(r)
, i = t(r);
return this._t(1, 0, 0, 0, 0, n, -i, 0, 0, i, n, 0, 0, 0,
0, 1)
}
function a(r) {
if (0 === r)
return this;
var n = e(r)
, i = t(r);
return this._t(n, 0, i, 0, 0, 1, 0, 0, -i, 0, n, 0, 0, 0,
0, 1)
}
function l(r) {
if (0 === r)
return this;
var n = e(r)
, i = t(r);
return this._t(n, -i, 0, 0, i, n, 0, 0, 0, 0, 1, 0, 0, 0,
0, 1)
}
function c(e, t) {
return this._t(1, t, e, 1, 0, 0)
}
function u(e, t) {
return this.shear(r(e), r(t))
}
function d(n, i) {
var o = e(i)
, s = t(i);
return this._t(o, s, 0, 0, -s, o, 0, 0, 0, 0, 1, 0, 0, 0,
0, 1)._t(1, 0, 0, 0, r(n), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)._t(o, -s, 0, 0, s, o,
0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
}
function p(e, t, r) {
return r || 0 === r || (r = 1),
1 === e && 1 === t && 1 === r ? this : this._t(e, 0, 0, 0,
0, t, 0, 0, 0, 0, r, 0, 0, 0, 0, 1)
}
function h(e, t, r, n, i, o, s, a, l, c, u, d, p, h, f, m) {
return this.props[0] = e,
this.props[1] = t,
this.props[2] = r,
this.props[3] = n,
this.props[4] = i,
this.props[5] = o,
this.props[6] = s,
this.props[7] = a,
this.props[8] = l,
this.props[9] = c,
this.props[10] = u,
this.props[11] = d,
this.props[12] = p,
this.props[13] = h,
this.props[14] = f,
this.props[15] = m,
this
}
function f(e, t, r) {
return r = r || 0,
0 !== e || 0 !== t || 0 !== r ? this._t(1, 0, 0, 0, 0, 1,
0, 0, 0, 0, 1, 0, e, t, r, 1) : this
}
function m(e, t, r, n, i, o, s, a, l, c, u, d, p, h, f, m) {
var g = this.props;
if (1 === e && 0 === t && 0 === r && 0 === n && 0 === i &&
1 === o && 0 === s && 0 === a && 0 === l && 0 === c && 1 === u && 0 === d)
return g[12] = g[12] * e + g[15] * p,
g[13] = g[13] * o + g[15] * h,
g[14] = g[14] * u + g[15] * f,
g[15] *= m,
this._identityCalculated = !1,
this;
var y = g[0]
, v = g[1]
, b = g[2]
, x = g[3]
, _ = g[4]
, E = g[5]
, T = g[6]
, C = g[7]
, S = g[8]
, $ = g[9]
, w = g[10]
, P = g[11]
, R = g[12]
, k = g[13]
, A = g[14]
, I = g[15];
return g[0] = y * e + v * i + b * l + x * p,
g[1] = y * t + v * o + b * c + x * h,
g[2] = y * r + v * s + b * u + x * f,
g[3] = y * n + v * a + b * d + x * m,
g[4] = _ * e + E * i + T * l + C * p,
g[5] = _ * t + E * o + T * c + C * h,
g[6] = _ * r + E * s + T * u + C * f,
g[7] = _ * n + E * a + T * d + C * m,
g[8] = S * e + $ * i + w * l + P * p,
g[9] = S * t + $ * o + w * c + P * h,
g[10] = S * r + $ * s + w * u + P * f,
g[11] = S * n + $ * a + w * d + P * m,
g[12] = R * e + k * i + A * l + I * p,
g[13] = R * t + k * o + A * c + I * h,
g[14] = R * r + k * s + A * u + I * f,
g[15] = R * n + k * a + A * d + I * m,
this._identityCalculated = !1,
this
}
function g(e) {
var t = e.props;
return this.transform(t[0], t[1], t[2], t[3], t[4], t[5],
t[6], t[7], t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15])
}
function y() {
return this._identityCalculated || (this._identity = !(1 !
== this.props[0] || 0 !== this.props[1] || 0 !== this.props[2] || 0 !==
this.props[3] || 0 !== this.props[4] || 1 !== this.props[5] || 0 !== this.props[6]
|| 0 !== this.props[7] || 0 !== this.props[8] || 0 !== this.props[9] || 1 !==
this.props[10] || 0 !== this.props[11] || 0 !== this.props[12] || 0 !==
this.props[13] || 0 !== this.props[14] || 1 !== this.props[15]),
this._identityCalculated = !0),
this._identity
}
function v(e) {
for (var t = 0; t < 16; ) {
if (e.props[t] !== this.props[t])
return !1;
t += 1
}
return !0
}
function b(e) {
var t;
for (t = 0; t < 16; t += 1)
e.props[t] = this.props[t];
return e
}
function x(e) {
var t;
for (t = 0; t < 16; t += 1)
this.props[t] = e[t]
}
function _(e, t, r) {
return {
x: e * this.props[0] + t * this.props[4] + r *
this.props[8] + this.props[12],
y: e * this.props[1] + t * this.props[5] + r *
this.props[9] + this.props[13],
z: e * this.props[2] + t * this.props[6] + r *
this.props[10] + this.props[14]
}
}
function E(e, t, r) {
return e * this.props[0] + t * this.props[4] + r *
this.props[8] + this.props[12]
}
function T(e, t, r) {
return e * this.props[1] + t * this.props[5] + r *
this.props[9] + this.props[13]
}
function C(e, t, r) {
return e * this.props[2] + t * this.props[6] + r *
this.props[10] + this.props[14]
}
function S() {
var e = this.props[0] * this.props[5] - this.props[1] *
this.props[4]
, t = this.props[5] / e
, r = -this.props[1] / e
, n = -this.props[4] / e
, i = this.props[0] / e
, o = (this.props[4] * this.props[13] - this.props[5] *
this.props[12]) / e
, s = -(this.props[0] * this.props[13] - this.props[1] *
this.props[12]) / e
, a = new Matrix;
return a.props[0] = t,
a.props[1] = r,
a.props[4] = n,
a.props[5] = i,
a.props[12] = o,
a.props[13] = s,
a
}
function $(e) {
return this.getInverseMatrix().applyToPointArray(e[0],
e[1], e[2] || 0)
}
function w(e) {
var t, r = e.length, n = [];
for (t = 0; t < r; t += 1)
n[t] = $(e[t]);
return n
}
function P(e, t, r) {
var n = createTypedArray("float32", 6);
if (this.isIdentity())
n[0] = e[0],
n[1] = e[1],
n[2] = t[0],
n[3] = t[1],
n[4] = r[0],
n[5] = r[1];
else {
var i = this.props[0]
, o = this.props[1]
, s = this.props[4]
, a = this.props[5]
, l = this.props[12]
, c = this.props[13];
n[0] = e[0] * i + e[1] * s + l,
n[1] = e[0] * o + e[1] * a + c,
n[2] = t[0] * i + t[1] * s + l,
n[3] = t[0] * o + t[1] * a + c,
n[4] = r[0] * i + r[1] * s + l,
n[5] = r[0] * o + r[1] * a + c
}
return n
}
function R(e, t, r) {
return this.isIdentity() ? [e, t, r] : [e * this.props[0] +
t * this.props[4] + r * this.props[8] + this.props[12], e * this.props[1] + t *
this.props[5] + r * this.props[9] + this.props[13], e * this.props[2] + t *
this.props[6] + r * this.props[10] + this.props[14]]
}
function k(e, t) {
if (this.isIdentity())
return e + "," + t;
var r = this.props;
return Math.round(100 * (e * r[0] + t * r[4] + r[12])) /
100 + "," + Math.round(100 * (e * r[1] + t * r[5] + r[13])) / 100
}
function A() {
for (var e = 0, t = this.props, r = "matrix3d("; e < 16; )
r += n(1e4 * t[e]) / 1e4,
r += 15 === e ? ")" : ",",
e += 1;
return r
}
function I(e) {
return e < 1e-6 && e > 0 || e > -1e-6 && e < 0 ? n(1e4 * e)
/ 1e4 : e
}
function O() {
var e = this.props;
return "matrix(" + I(e[0]) + "," + I(e[1]) + "," + I(e[4])
+ "," + I(e[5]) + "," + I(e[12]) + "," + I(e[13]) + ")"
}
return function() {
this.reset = i,
this.rotate = o,
this.rotateX = s,
this.rotateY = a,
this.rotateZ = l,
this.skew = u,
this.skewFromAxis = d,
this.shear = c,
this.scale = p,
this.setTransform = h,
this.translate = f,
this.transform = m,
this.multiply = g,
this.applyToPoint = _,
this.applyToX = E,
this.applyToY = T,
this.applyToZ = C,
this.applyToPointArray = R,
this.applyToTriplePoints = P,
this.applyToPointStringified = k,
this.toCSS = A,
this.to2dCSS = O,
this.clone = b,
this.cloneFromProps = x,
this.equals = v,
this.inversePoints = w,
this.inversePoint = $,
this.getInverseMatrix = S,
this._t = this.transform,
this.isIdentity = y,
this._identity = !0,
this._identityCalculated = !1,
this.props = createTypedArray("float32", 16),
this.reset()
}
}();
function _typeof$3(e) {
return (_typeof$3 = "function" == typeof Symbol && "symbol" ==
typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor
=== Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
var lottie = {};
function setLocation(e) {
setLocationHref(e)
}
function searchAnimations() {
animationManager.searchAnimations()
}
function setSubframeRendering(e) {
setSubframeEnabled(e)
}
function setPrefix(e) {
setIdPrefix(e)
}
function loadAnimation(e) {
return animationManager.loadAnimation(e)
}
function setQuality(e) {
if ("string" == typeof e)
switch (e) {
case "high":
setDefaultCurveSegments(200);
break;
default:
case "medium":
setDefaultCurveSegments(50);
break;
case "low":
setDefaultCurveSegments(10)
}
else
!isNaN(e) && e > 1 && setDefaultCurveSegments(e)
}
function inBrowser() {
return "undefined" != typeof navigator
}
function installPlugin(e, t) {
"expressions" === e && setExpressionsPlugin(t)
}
function getFactory(e) {
switch (e) {
case "propertyFactory":
return PropertyFactory;
case "shapePropertyFactory":
return ShapePropertyFactory;
case "matrix":
return Matrix;
default:
return null
}
}
function checkReady() {
"complete" === document.readyState &&
(clearInterval(readyStateCheckInterval),
searchAnimations())
}
function getQueryVariable(e) {
for (var t = queryString.split("&"), r = 0; r < t.length; r +=
1) {
var n = t[r].split("=");
if (decodeURIComponent(n[0]) == e)
return decodeURIComponent(n[1])
}
return null
}
lottie.play = animationManager.play,
lottie.pause = animationManager.pause,
lottie.setLocationHref = setLocation,
lottie.togglePause = animationManager.togglePause,
lottie.setSpeed = animationManager.setSpeed,
lottie.setDirection = animationManager.setDirection,
lottie.stop = animationManager.stop,
lottie.searchAnimations = searchAnimations,
lottie.registerAnimation = animationManager.registerAnimation,
lottie.loadAnimation = loadAnimation,
lottie.setSubframeRendering = setSubframeRendering,
lottie.resize = animationManager.resize,
lottie.goToAndStop = animationManager.goToAndStop,
lottie.destroy = animationManager.destroy,
lottie.setQuality = setQuality,
lottie.inBrowser = inBrowser,
lottie.installPlugin = installPlugin,
lottie.freeze = animationManager.freeze,
lottie.unfreeze = animationManager.unfreeze,
lottie.setVolume = animationManager.setVolume,
lottie.mute = animationManager.mute,
lottie.unmute = animationManager.unmute,
lottie.getRegisteredAnimations =
animationManager.getRegisteredAnimations,
lottie.useWebWorker = setWebWorker,
lottie.setIDPrefix = setPrefix,
lottie.__getFactory = getFactory,
lottie.version = "5.12.2";
var queryString = ""
, scripts = document.getElementsByTagName("script")
, index = scripts.length - 1
, myScript = scripts[index] || {
src: ""
};
queryString = myScript.src ? myScript.src.replace(/^[^\?]+\??/, "")
: "",
getQueryVariable("renderer");
var readyStateCheckInterval = setInterval(checkReady, 100);
try {
"object" !== _typeof$3(exports) && (window.bodymovin = lottie)
} catch (err) {}
var ShapeModifiers = function() {
var e = {}
, t = {};
return e.registerModifier = function(e, r) {
t[e] || (t[e] = r)
}
,
e.getModifier = function(e, r, n) {
return new t[e](r,n)
}
,
e
}();
function ShapeModifier() {}
function TrimModifier() {}
function PuckerAndBloatModifier() {}
ShapeModifier.prototype.initModifierProperties = function() {}
,
ShapeModifier.prototype.addShapeToModifier = function() {}
,
ShapeModifier.prototype.addShape = function(e) {
if (!this.closed) {
e.sh.container.addDynamicProperty(e.sh);
var t = {
shape: e.sh,
data: e,
localShapeCollection:
shapeCollectionPool.newShapeCollection()
};
this.shapes.push(t),
this.addShapeToModifier(t),
this._isAnimated && e.setAsAnimated()
}
}
,
ShapeModifier.prototype.init = function(e, t) {
this.shapes = [],
this.elem = e,
this.initDynamicPropertyContainer(e),
this.initModifierProperties(e, t),
this.frameId = initialDefaultFrame,
this.closed = !1,
this.k = !1,
this.dynamicProperties.length ? this.k = !0 : this.getValue(!0)
}
,
ShapeModifier.prototype.processKeys = function() {
this.elem.globalData.frameId !== this.frameId && (this.frameId
= this.elem.globalData.frameId,
this.iterateDynamicProperties())
}
,
extendPrototype([DynamicPropertyContainer], ShapeModifier),
extendPrototype([ShapeModifier], TrimModifier),
TrimModifier.prototype.initModifierProperties = function(e, t) {
this.s = PropertyFactory.getProp(e, t.s, 0, .01, this),
this.e = PropertyFactory.getProp(e, t.e, 0, .01, this),
this.o = PropertyFactory.getProp(e, t.o, 0, 0, this),
this.sValue = 0,
this.eValue = 0,
this.getValue = this.processKeys,
this.m = t.m,
this._isAnimated = !!this.s.effectsSequence.length || !!
this.e.effectsSequence.length || !!this.o.effectsSequence.length
}
,
TrimModifier.prototype.addShapeToModifier = function(e) {
e.pathsData = []
}
,
TrimModifier.prototype.calculateShapeEdges = function(e, t, r, n,
i) {
var o = [];
t <= 1 ? o.push({
s: e,
e: t
}) : e >= 1 ? o.push({
s: e - 1,
e: t - 1
}) : (o.push({
s: e,
e: 1
}),
o.push({
s: 0,
e: t - 1
}));
var s, a, l = [], c = o.length;
for (s = 0; s < c; s += 1) {
var u, d;
(a = o[s]).e * i < n || a.s * i > n + r || (u = a.s * i <=
n ? 0 : (a.s * i - n) / r,
d = a.e * i >= n + r ? 1 : (a.e * i - n) / r,
l.push([u, d]))
}
return l.length || l.push([0, 0]),
l
}
,
TrimModifier.prototype.releasePathsData = function(e) {
var t, r = e.length;
for (t = 0; t < r; t += 1)
segmentsLengthPool.release(e[t]);
return e.length = 0,
e
}
,
TrimModifier.prototype.processShapes = function(e) {
var t, r, n, i;
if (this._mdf || e) {
var o = this.o.v % 360 / 360;
if (o < 0 && (o += 1),
(t = this.s.v > 1 ? 1 + o : this.s.v < 0 ? 0 + o : this.s.v
+ o) > (r = this.e.v > 1 ? 1 + o : this.e.v < 0 ? 0 + o : this.e.v + o)) {
var s = t;
t = r,
r = s
}
t = 1e-4 * Math.round(1e4 * t),
r = 1e-4 * Math.round(1e4 * r),
this.sValue = t,
this.eValue = r
} else
t = this.sValue,
r = this.eValue;
var a, l, c, u, d, p = this.shapes.length, h = 0;
if (r === t)
for (i = 0; i < p; i += 1)
this.shapes[i].localShapeCollection.releaseShapes(),
this.shapes[i].shape._mdf = !0,
this.shapes[i].shape.paths =
this.shapes[i].localShapeCollection,
this._mdf && (this.shapes[i].pathsData.length = 0);
else if (1 === r && 0 === t || 0 === r && 1 === t) {
if (this._mdf)
for (i = 0; i < p; i += 1)
this.shapes[i].pathsData.length = 0,
this.shapes[i].shape._mdf = !0
} else {
var f, m, g = [];
for (i = 0; i < p; i += 1)
if ((f = this.shapes[i]).shape._mdf || this._mdf || e
|| 2 === this.m) {
if (l = (n = f.shape.paths)._length,
d = 0,
!f.shape._mdf && f.pathsData.length)
d = f.totalShapeLength;
else {
for (c = this.releasePathsData(f.pathsData),
a = 0; a < l; a += 1)
u = bez.getSegmentsLength(n.shapes[a]),
c.push(u),
d += u.totalLength;
f.totalShapeLength = d,
f.pathsData = c
}
h += d,
f.shape._mdf = !0
} else
f.shape.paths = f.localShapeCollection;
var y, v = t, b = r, x = 0;
for (i = p - 1; i >= 0; i -= 1)
if ((f = this.shapes[i]).shape._mdf) {
for ((m = f.localShapeCollection).releaseShapes(),
2 === this.m && p > 1 ? (y =
this.calculateShapeEdges(t, r, f.totalShapeLength, x, h),
x += f.totalShapeLength) : y = [[v, b]],
l = y.length,
a = 0; a < l; a += 1) {
v = y[a][0],
b = y[a][1],
g.length = 0,
b <= 1 ? g.push({
s: f.totalShapeLength * v,
e: f.totalShapeLength * b
}) : v >= 1 ? g.push({
s: f.totalShapeLength * (v - 1),
e: f.totalShapeLength * (b - 1)
}) : (g.push({
s: f.totalShapeLength * v,
e: f.totalShapeLength
}),
g.push({
s: 0,
e: f.totalShapeLength * (b - 1)
}));
var _ = this.addShapes(f, g[0]);
if (g[0].s !== g[0].e) {
if (g.length > 1)
if
(f.shape.paths.shapes[f.shape.paths._length - 1].c) {
var E = _.pop();
this.addPaths(_, m),
_ = this.addShapes(f, g[1], E)
} else
this.addPaths(_, m),
_ = this.addShapes(f, g[1]);
this.addPaths(_, m)
}
}
f.shape.paths = m
}
}
}
,
TrimModifier.prototype.addPaths = function(e, t) {
var r, n = e.length;
for (r = 0; r < n; r += 1)
t.addShape(e[r])
}
,
TrimModifier.prototype.addSegment = function(e, t, r, n, i, o, s) {
i.setXYAt(t[0], t[1], "o", o),
i.setXYAt(r[0], r[1], "i", o + 1),
s && i.setXYAt(e[0], e[1], "v", o),
i.setXYAt(n[0], n[1], "v", o + 1)
}
,
TrimModifier.prototype.addSegmentFromArray = function(e, t, r, n) {
t.setXYAt(e[1], e[5], "o", r),
t.setXYAt(e[2], e[6], "i", r + 1),
n && t.setXYAt(e[0], e[4], "v", r),
t.setXYAt(e[3], e[7], "v", r + 1)
}
,
TrimModifier.prototype.addShapes = function(e, t, r) {
var n, i, o, s, a, l, c, u, d = e.pathsData, p =
e.shape.paths.shapes, h = e.shape.paths._length, f = 0, m = [], g = !0;
for (r ? (a = r._length,
u = r._length) : (r = shapePool.newElement(),
a = 0,
u = 0),
m.push(r),
n = 0; n < h; n += 1) {
for (l = d[n].lengths,
r.c = p[n].c,
o = p[n].c ? l.length : l.length + 1,
i = 1; i < o; i += 1)
if (f + (s = l[i - 1]).addedLength < t.s)
f += s.addedLength,
r.c = !1;
else {
if (f > t.e) {
r.c = !1;
break
}
t.s <= f && t.e >= f + s.addedLength ?
(this.addSegment(p[n].v[i - 1], p[n].o[i - 1], p[n].i[i], p[n].v[i], r, a, g),
g = !1) : (c = bez.getNewSegment(p[n].v[i - 1],
p[n].v[i], p[n].o[i - 1], p[n].i[i], (t.s - f) / s.addedLength, (t.e - f) /
s.addedLength, l[i - 1]),
this.addSegmentFromArray(c, r, a, g),
g = !1,
r.c = !1),
f += s.addedLength,
a += 1
}
if (p[n].c && l.length) {
if (s = l[i - 1],
f <= t.e) {
var y = l[i - 1].addedLength;
t.s <= f && t.e >= f + y ?
(this.addSegment(p[n].v[i - 1], p[n].o[i - 1], p[n].i[0], p[n].v[0], r, a, g),
g = !1) : (c = bez.getNewSegment(p[n].v[i - 1],
p[n].v[0], p[n].o[i - 1], p[n].i[0], (t.s - f) / y, (t.e - f) / y, l[i - 1]),
this.addSegmentFromArray(c, r, a, g),
g = !1,
r.c = !1)
} else
r.c = !1;
f += s.addedLength,
a += 1
}
if (r._length && (r.setXYAt(r.v[u][0], r.v[u][1], "i", u),
r.setXYAt(r.v[r._length - 1][0], r.v[r._length - 1][1],
"o", r._length - 1)),
f > t.e)
break;
n < h - 1 && (r = shapePool.newElement(),
g = !0,
m.push(r),
a = 0)
}
return m
}
,
extendPrototype([ShapeModifier], PuckerAndBloatModifier),
PuckerAndBloatModifier.prototype.initModifierProperties =
function(e, t) {
this.getValue = this.processKeys,
this.amount = PropertyFactory.getProp(e, t.a, 0, null, this),
this._isAnimated = !!this.amount.effectsSequence.length
}
,
PuckerAndBloatModifier.prototype.processPath = function(e, t) {
var r = t / 100
, n = [0, 0]
, i = e._length
, o = 0;
for (o = 0; o < i; o += 1)
n[0] += e.v[o][0],
n[1] += e.v[o][1];
n[0] /= i,
n[1] /= i;
var s, a, l, c, u, d, p = shapePool.newElement();
for (p.c = e.c,
o = 0; o < i; o += 1)
s = e.v[o][0] + (n[0] - e.v[o][0]) * r,
a = e.v[o][1] + (n[1] - e.v[o][1]) * r,
l = e.o[o][0] + (n[0] - e.o[o][0]) * -r,
c = e.o[o][1] + (n[1] - e.o[o][1]) * -r,
u = e.i[o][0] + (n[0] - e.i[o][0]) * -r,
d = e.i[o][1] + (n[1] - e.i[o][1]) * -r,
p.setTripleAt(s, a, l, c, u, d, o);
return p
}
,
PuckerAndBloatModifier.prototype.processShapes = function(e) {
var t, r, n, i, o, s, a = this.shapes.length, l =
this.amount.v;
if (0 !== l)
for (r = 0; r < a; r += 1) {
if (s = (o = this.shapes[r]).localShapeCollection,
o.shape._mdf || this._mdf || e)
for (s.releaseShapes(),
o.shape._mdf = !0,
t = o.shape.paths.shapes,
i = o.shape.paths._length,
n = 0; n < i; n += 1)
s.addShape(this.processPath(t[n], l));
o.shape.paths = o.localShapeCollection
}
this.dynamicProperties.length || (this._mdf = !1)
}
;
var TransformPropertyFactory = function() {
var e = [0, 0];
function t(e, t, r) {
if (this.elem = e,
this.frameId = -1,
this.propType = "transform",
this.data = t,
this.v = new Matrix,
this.pre = new Matrix,
this.appliedTransformations = 0,
this.initDynamicPropertyContainer(r || e),
t.p && t.p.s ? (this.px = PropertyFactory.getProp(e, t.p.x,
0, 0, this),
this.py = PropertyFactory.getProp(e, t.p.y, 0, 0, this),
t.p.z && (this.pz = PropertyFactory.getProp(e, t.p.z, 0, 0,
this))) : this.p = PropertyFactory.getProp(e, t.p || {
k: [0, 0, 0]
}, 1, 0, this),
t.rx) {
if (this.rx = PropertyFactory.getProp(e, t.rx, 0,
degToRads, this),
this.ry = PropertyFactory.getProp(e, t.ry, 0,
degToRads, this),
this.rz = PropertyFactory.getProp(e, t.rz, 0,
degToRads, this),
t.or.k[0].ti) {
var n, i = t.or.k.length;
for (n = 0; n < i; n += 1)
t.or.k[n].to = null,
t.or.k[n].ti = null
}
this.or = PropertyFactory.getProp(e, t.or, 1,
degToRads, this),
this.or.sh = !0
} else
this.r = PropertyFactory.getProp(e, t.r || {
k: 0
}, 0, degToRads, this);
t.sk && (this.sk = PropertyFactory.getProp(e, t.sk, 0,
degToRads, this),
this.sa = PropertyFactory.getProp(e, t.sa, 0, degToRads,
this)),
this.a = PropertyFactory.getProp(e, t.a || {
k: [0, 0, 0]
}, 1, 0, this),
this.s = PropertyFactory.getProp(e, t.s || {
k: [100, 100, 100]
}, 1, .01, this),
t.o ? this.o = PropertyFactory.getProp(e, t.o, 0, .01, e) :
this.o = {
_mdf: !1,
v: 1
},
this._isDirty = !0,
this.dynamicProperties.length || this.getValue(!0)
}
return t.prototype = {
applyToMatrix: function(e) {
var t = this._mdf;
this.iterateDynamicProperties(),
this._mdf = this._mdf || t,
this.a && e.translate(-this.a.v[0], -this.a.v[1],
this.a.v[2]),
this.s && e.scale(this.s.v[0], this.s.v[1],
this.s.v[2]),
this.sk && e.skewFromAxis(-this.sk.v, this.sa.v),
this.r ? e.rotate(-this.r.v) : e.rotateZ(-
this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-
this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),
this.data.p.s ? this.data.p.z ? e.translate(this.px.v,
this.py.v, -this.pz.v) : e.translate(this.px.v, this.py.v, 0) :
e.translate(this.p.v[0], this.p.v[1], -this.p.v[2])
},
getValue: function(t) {
if (this.elem.globalData.frameId !== this.frameId) {
if (this._isDirty && (this.precalculateMatrix(),
this._isDirty = !1),
this.iterateDynamicProperties(),
this._mdf || t) {
var r;
if (this.v.cloneFromProps(this.pre.props),
this.appliedTransformations < 1 &&
this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]),
this.appliedTransformations < 2 &&
this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]),
this.sk && this.appliedTransformations < 3 &&
this.v.skewFromAxis(-this.sk.v, this.sa.v),
this.r && this.appliedTransformations < 4 ?
this.v.rotate(-this.r.v) : !this.r && this.appliedTransformations < 4 &&
this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-
this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),
this.autoOriented) {
var n, i;
if (r = this.elem.globalData.frameRate,
this.p && this.p.keyframes &&
this.p.getValueAtTime)
this.p._caching.lastFrame +
this.p.offsetTime <= this.p.keyframes[0].t ? (n =
this.p.getValueAtTime((this.p.keyframes[0].t + .01) / r, 0),
i =
this.p.getValueAtTime(this.p.keyframes[0].t / r, 0)) : this.p._caching.lastFrame +
this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t ? (n =
this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length - 1].t / r, 0),
i =
this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - .05) / r,
0)) : (n = this.p.pv,
i =
this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - .01) / r,
this.p.offsetTime));
else if (this.px && this.px.keyframes &&
this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
n = [],
i = [];
var o = this.px
, s = this.py;
o._caching.lastFrame + o.offsetTime <=
o.keyframes[0].t ? (n[0] = o.getValueAtTime((o.keyframes[0].t + .01) / r, 0),
n[1] =
s.getValueAtTime((s.keyframes[0].t + .01) / r, 0),
i[0] =
o.getValueAtTime(o.keyframes[0].t / r, 0),
i[1] =
s.getValueAtTime(s.keyframes[0].t / r, 0)) : o._caching.lastFrame + o.offsetTime >=
o.keyframes[o.keyframes.length - 1].t ? (n[0] =
o.getValueAtTime(o.keyframes[o.keyframes.length - 1].t / r, 0),
n[1] =
s.getValueAtTime(s.keyframes[s.keyframes.length - 1].t / r, 0),
i[0] =
o.getValueAtTime((o.keyframes[o.keyframes.length - 1].t - .01) / r, 0),
i[1] =
s.getValueAtTime((s.keyframes[s.keyframes.length - 1].t - .01) / r, 0)) : (n =
[o.pv, s.pv],
i[0] =
o.getValueAtTime((o._caching.lastFrame + o.offsetTime - .01) / r, o.offsetTime),
i[1] =
s.getValueAtTime((s._caching.lastFrame + s.offsetTime - .01) / r, s.offsetTime))
} else
n = i = e;
this.v.rotate(-Math.atan2(n[1] - i[1], n[0]
- i[0]))
}
this.data.p && this.data.p.s ? this.data.p.z ?
this.v.translate(this.px.v, this.py.v, -this.pz.v) : this.v.translate(this.px.v,
this.py.v, 0) : this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2])
}
this.frameId = this.elem.globalData.frameId
}
},
precalculateMatrix: function() {
if (this.appliedTransformations = 0,
this.pre.reset(),
!this.a.effectsSequence.length && (this.pre.translate(-
this.a.v[0], -this.a.v[1], this.a.v[2]),
this.appliedTransformations = 1,
!this.s.effectsSequence.length)) {
if (this.pre.scale(this.s.v[0], this.s.v[1],
this.s.v[2]),
this.appliedTransformations = 2,
this.sk) {
if (this.sk.effectsSequence.length ||
this.sa.effectsSequence.length)
return;
this.pre.skewFromAxis(-this.sk.v, this.sa.v),
this.appliedTransformations = 3
}
this.r ? this.r.effectsSequence.length ||
(this.pre.rotate(-this.r.v),
this.appliedTransformations = 4) :
this.rz.effectsSequence.length || this.ry.effectsSequence.length ||
this.rx.effectsSequence.length || this.or.effectsSequence.length ||
(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-
this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),
this.appliedTransformations = 4)
}
},
autoOrient: function() {}
},
extendPrototype([DynamicPropertyContainer], t),
t.prototype.addDynamicProperty = function(e) {
this._addDynamicProperty(e),
this.elem.addDynamicProperty(e),
this._isDirty = !0
}
,
t.prototype._addDynamicProperty =
DynamicPropertyContainer.prototype.addDynamicProperty,
{
getTransformProperty: function(e, r, n) {
return new t(e,r,n)
}
}
}();
function RepeaterModifier() {}
function RoundCornersModifier() {}
function floatEqual(e, t) {
return 1e5 * Math.abs(e - t) <= Math.min(Math.abs(e),
Math.abs(t))
}
function floatZero(e) {
return Math.abs(e) <= 1e-5
}
function lerp(e, t, r) {
return e * (1 - r) + t * r
}
function lerpPoint(e, t, r) {
return [lerp(e[0], t[0], r), lerp(e[1], t[1], r)]
}
function quadRoots(e, t, r) {
if (0 === e)
return [];
var n = t * t - 4 * e * r;
if (n < 0)
return [];
var i = -t / (2 * e);
if (0 === n)
return [i];
var o = Math.sqrt(n) / (2 * e);
return [i - o, i + o]
}
function polynomialCoefficients(e, t, r, n) {
return [3 * t - e - 3 * r + n, 3 * e - 6 * t + 3 * r, -3 * e +
3 * t, e]
}
function singlePoint(e) {
return new PolynomialBezier(e,e,e,e,!1)
}
function PolynomialBezier(e, t, r, n, i) {
i && pointEqual(e, t) && (t = lerpPoint(e, n, 1 / 3)),
i && pointEqual(r, n) && (r = lerpPoint(e, n, 2 / 3));
var o = polynomialCoefficients(e[0], t[0], r[0], n[0])
, s = polynomialCoefficients(e[1], t[1], r[1], n[1]);
this.a = [o[0], s[0]],
this.b = [o[1], s[1]],
this.c = [o[2], s[2]],
this.d = [o[3], s[3]],
this.points = [e, t, r, n]
}
function extrema(e, t) {
var r = e.points[0][t]
, n = e.points[e.points.length - 1][t];
if (r > n) {
var i = n;
n = r,
r = i
}
for (var o = quadRoots(3 * e.a[t], 2 * e.b[t], e.c[t]), s = 0;
s < o.length; s += 1)
if (o[s] > 0 && o[s] < 1) {
var a = e.point(o[s])[t];
a < r ? r = a : a > n && (n = a)
}
return {
min: r,
max: n
}
}
function intersectData(e, t, r) {
var n = e.boundingBox();
return {
cx: n.cx,
cy: n.cy,
width: n.width,
height: n.height,
bez: e,
t: (t + r) / 2,
t1: t,
t2: r
}
}
function splitData(e) {
var t = e.bez.split(.5);
return [intersectData(t[0], e.t1, e.t), intersectData(t[1],
e.t, e.t2)]
}
function boxIntersect(e, t) {
return 2 * Math.abs(e.cx - t.cx) < e.width + t.width && 2 *
Math.abs(e.cy - t.cy) < e.height + t.height
}
function intersectsImpl(e, t, r, n, i, o) {
if (boxIntersect(e, t))
if (r >= o || e.width <= n && e.height <= n && t.width <= n
&& t.height <= n)
i.push([e.t, t.t]);
else {
var s = splitData(e)
, a = splitData(t);
intersectsImpl(s[0], a[0], r + 1, n, i, o),
intersectsImpl(s[0], a[1], r + 1, n, i, o),
intersectsImpl(s[1], a[0], r + 1, n, i, o),
intersectsImpl(s[1], a[1], r + 1, n, i, o)
}
}
function crossProduct(e, t) {
return [e[1] * t[2] - e[2] * t[1], e[2] * t[0] - e[0] * t[2],
e[0] * t[1] - e[1] * t[0]]
}
function lineIntersection(e, t, r, n) {
var i = [e[0], e[1], 1]
, o = [t[0], t[1], 1]
, s = [r[0], r[1], 1]
, a = [n[0], n[1], 1]
, l = crossProduct(crossProduct(i, o), crossProduct(s, a));
return floatZero(l[2]) ? null : [l[0] / l[2], l[1] / l[2]]
}
function polarOffset(e, t, r) {
return [e[0] + Math.cos(t) * r, e[1] - Math.sin(t) * r]
}
function pointDistance(e, t) {
return Math.hypot(e[0] - t[0], e[1] - t[1])
}
function pointEqual(e, t) {
return floatEqual(e[0], t[0]) && floatEqual(e[1], t[1])
}
function ZigZagModifier() {}
function setPoint(e, t, r, n, i, o, s) {
var a = r - Math.PI / 2
, l = r + Math.PI / 2
, c = t[0] + Math.cos(r) * n * i
, u = t[1] - Math.sin(r) * n * i;
e.setTripleAt(c, u, c + Math.cos(a) * o, u - Math.sin(a) * o, c
+ Math.cos(l) * s, u - Math.sin(l) * s, e.length())
}
function getPerpendicularVector(e, t) {
var r = [t[0] - e[0], t[1] - e[1]]
, n = .5 * -Math.PI;
return [Math.cos(n) * r[0] - Math.sin(n) * r[1], Math.sin(n) *
r[0] + Math.cos(n) * r[1]]
}
function getProjectingAngle(e, t) {
var r = 0 === t ? e.length() - 1 : t - 1
, n = (t + 1) % e.length()
, i = getPerpendicularVector(e.v[r], e.v[n]);
return Math.atan2(0, 1) - Math.atan2(i[1], i[0])
}
function zigZagCorner(e, t, r, n, i, o, s) {
var a = getProjectingAngle(t, r)
, l = t.v[r % t._length]
, c = t.v[0 === r ? t._length - 1 : r - 1]
, u = t.v[(r + 1) % t._length]
, d = 2 === o ? Math.sqrt(Math.pow(l[0] - c[0], 2) +
Math.pow(l[1] - c[1], 2)) : 0
, p = 2 === o ? Math.sqrt(Math.pow(l[0] - u[0], 2) +
Math.pow(l[1] - u[1], 2)) : 0;
setPoint(e, t.v[r % t._length], a, s, n, p / (2 * (i + 1)), d /
(2 * (i + 1)))
}
function zigZagSegment(e, t, r, n, i, o) {
for (var s = 0; s < n; s += 1) {
var a = (s + 1) / (n + 1)
, l = 2 === i ? Math.sqrt(Math.pow(t.points[3][0] -
t.points[0][0], 2) + Math.pow(t.points[3][1] - t.points[0][1], 2)) : 0
, c = t.normalAngle(a);
setPoint(e, t.point(a), c, o, r, l / (2 * (n + 1)), l / (2
* (n + 1))),
o = -o
}
return o
}
function linearOffset(e, t, r) {
var n = Math.atan2(t[0] - e[0], t[1] - e[1]);
return [polarOffset(e, n, r), polarOffset(t, n, r)]
}
function offsetSegment(e, t) {
var r, n, i, o, s, a, l;
r = (l = linearOffset(e.points[0], e.points[1], t))[0],
n = l[1],
i = (l = linearOffset(e.points[1], e.points[2], t))[0],
o = l[1],
s = (l = linearOffset(e.points[2], e.points[3], t))[0],
a = l[1];
var c = lineIntersection(r, n, i, o);
null === c && (c = n);
var u = lineIntersection(s, a, i, o);
return null === u && (u = s),
new PolynomialBezier(r,c,u,a)
}
function joinLines(e, t, r, n, i) {
var o = t.points[3]
, s = r.points[0];
if (3 === n)
return o;
if (pointEqual(o, s))
return o;
if (2 === n) {
var a = -t.tangentAngle(1)
, l = -r.tangentAngle(0) + Math.PI
, c = lineIntersection(o, polarOffset(o, a + Math.PI / 2,
100), s, polarOffset(s, a + Math.PI / 2, 100))
, u = c ? pointDistance(c, o) : pointDistance(o, s) / 2
, d = polarOffset(o, a, 2 * u * roundCorner);
return e.setXYAt(d[0], d[1], "o", e.length() - 1),
d = polarOffset(s, l, 2 * u * roundCorner),
e.setTripleAt(s[0], s[1], s[0], s[1], d[0], d[1],
e.length()),
s
}
var p = lineIntersection(pointEqual(o, t.points[2]) ?
t.points[0] : t.points[2], o, s, pointEqual(s, r.points[1]) ? r.points[3] :
r.points[1]);
return p && pointDistance(p, o) < i ? (e.setTripleAt(p[0],
p[1], p[0], p[1], p[0], p[1], e.length()),
p) : o
}
function getIntersection(e, t) {
var r = e.intersections(t);
return r.length && floatEqual(r[0][0], 1) && r.shift(),
r.length ? r[0] : null
}
function pruneSegmentIntersection(e, t) {
var r = e.slice()
, n = t.slice()
, i = getIntersection(e[e.length - 1], t[0]);
return i && (r[e.length - 1] = e[e.length - 1].split(i[0])[0],
n[0] = t[0].split(i[1])[1]),
e.length > 1 && t.length > 1 && (i = getIntersection(e[0],
t[t.length - 1])) ? [[e[0].split(i[0])[0]], [t[t.length - 1].split(i[1])[1]]] : [r,
n]
}
function pruneIntersections(e) {
for (var t, r = 1; r < e.length; r += 1)
t = pruneSegmentIntersection(e[r - 1], e[r]),
e[r - 1] = t[0],
e[r] = t[1];
return e.length > 1 && (t = pruneSegmentIntersection(e[e.length
- 1], e[0]),
e[e.length - 1] = t[0],
e[0] = t[1]),
e
}
function offsetSegmentSplit(e, t) {
var r, n, i, o, s = e.inflectionPoints();
if (0 === s.length)
return [offsetSegment(e, t)];
if (1 === s.length || floatEqual(s[1], 1))
return r = (i = e.split(s[0]))[0],
n = i[1],
[offsetSegment(r, t), offsetSegment(n, t)];
r = (i = e.split(s[0]))[0];
var a = (s[1] - s[0]) / (1 - s[0]);
return o = (i = i[1].split(a))[0],
n = i[1],
[offsetSegment(r, t), offsetSegment(o, t), offsetSegment(n, t)]
}
function OffsetPathModifier() {}
function getFontProperties(e) {
for (var t = e.fStyle ? e.fStyle.split(" ") : [], r = "normal",
n = "normal", i = t.length, o = 0; o < i; o += 1)
switch (t[o].toLowerCase()) {
case "italic":
n = "italic";
break;
case "bold":
r = "700";
break;
case "black":
r = "900";
break;
case "medium":
r = "500";
break;
case "regular":
case "normal":
r = "400";
break;
case "light":
case "thin":
r = "200"
}
return {
style: n,
weight: e.fWeight || r
}
}
extendPrototype([ShapeModifier], RepeaterModifier),
RepeaterModifier.prototype.initModifierProperties = function(e, t)
{
this.getValue = this.processKeys,
this.c = PropertyFactory.getProp(e, t.c, 0, null, this),
this.o = PropertyFactory.getProp(e, t.o, 0, null, this),
this.tr = TransformPropertyFactory.getTransformProperty(e,
t.tr, this),
this.so = PropertyFactory.getProp(e, t.tr.so, 0, .01, this),
this.eo = PropertyFactory.getProp(e, t.tr.eo, 0, .01, this),
this.data = t,
this.dynamicProperties.length || this.getValue(!0),
this._isAnimated = !!this.dynamicProperties.length,
this.pMatrix = new Matrix,
this.rMatrix = new Matrix,
this.sMatrix = new Matrix,
this.tMatrix = new Matrix,
this.matrix = new Matrix
}
,
RepeaterModifier.prototype.applyTransforms = function(e, t, r, n,
i, o) {
var s = o ? -1 : 1
, a = n.s.v[0] + (1 - n.s.v[0]) * (1 - i)
, l = n.s.v[1] + (1 - n.s.v[1]) * (1 - i);
e.translate(n.p.v[0] * s * i, n.p.v[1] * s * i, n.p.v[2]),
t.translate(-n.a.v[0], -n.a.v[1], n.a.v[2]),
t.rotate(-n.r.v * s * i),
t.translate(n.a.v[0], n.a.v[1], n.a.v[2]),
r.translate(-n.a.v[0], -n.a.v[1], n.a.v[2]),
r.scale(o ? 1 / a : a, o ? 1 / l : l),
r.translate(n.a.v[0], n.a.v[1], n.a.v[2])
}
,
RepeaterModifier.prototype.init = function(e, t, r, n) {
for (this.elem = e,
this.arr = t,
this.pos = r,
this.elemsData = n,
this._currentCopies = 0,
this._elements = [],
this._groups = [],
this.frameId = -1,
this.initDynamicPropertyContainer(e),
this.initModifierProperties(e, t[r]); r > 0; )
r -= 1,
this._elements.unshift(t[r]);
this.dynamicProperties.length ? this.k = !0 : this.getValue(!0)
}
,
RepeaterModifier.prototype.resetElements = function(e) {
var t, r = e.length;
for (t = 0; t < r; t += 1)
e[t]._processed = !1,
"gr" === e[t].ty && this.resetElements(e[t].it)
}
,
RepeaterModifier.prototype.cloneElements = function(e) {
var t = JSON.parse(JSON.stringify(e));
return this.resetElements(t),
t
}
,
RepeaterModifier.prototype.changeGroupRender = function(e, t) {
var r, n = e.length;
for (r = 0; r < n; r += 1)
e[r]._render = t,
"gr" === e[r].ty && this.changeGroupRender(e[r].it, t)
}
,
RepeaterModifier.prototype.processShapes = function(e) {
var t, r, n, i, o, s = !1;
if (this._mdf || e) {
var a, l = Math.ceil(this.c.v);
if (this._groups.length < l) {
for (; this._groups.length < l; ) {
var c = {
it: this.cloneElements(this._elements),
ty: "gr"
};
c.it.push({
a: {
a: 0,
ix: 1,
k: [0, 0]
},
nm: "Transform",
o: {
a: 0,
ix: 7,
k: 100
},
p: {
a: 0,
ix: 2,
k: [0, 0]
},
r: {
a: 1,
ix: 6,
k: [{
s: 0,
e: 0,
t: 0
}, {
s: 0,
e: 0,
t: 1
}]
},
s: {
a: 0,
ix: 3,
k: [100, 100]
},
sa: {
a: 0,
ix: 5,
k: 0
},
sk: {
a: 0,
ix: 4,
k: 0
},
ty: "tr"
}),
this.arr.splice(0, 0, c),
this._groups.splice(0, 0, c),
this._currentCopies += 1
}
this.elem.reloadShapes(),
s = !0
}
for (o = 0,
n = 0; n <= this._groups.length - 1; n += 1) {
if (a = o < l,
this._groups[n]._render = a,
this.changeGroupRender(this._groups[n].it, a),
!a) {
var u = this.elemsData[n].it
, d = u[u.length - 1];
0 !== d.transform.op.v ? (d.transform.op._mdf = !0,
d.transform.op.v = 0) : d.transform.op._mdf = !1
}
o += 1
}
this._currentCopies = l;
var p = this.o.v
, h = p % 1
, f = p > 0 ? Math.floor(p) : Math.ceil(p)
, m = this.pMatrix.props
, g = this.rMatrix.props
, y = this.sMatrix.props;
this.pMatrix.reset(),
this.rMatrix.reset(),
this.sMatrix.reset(),
this.tMatrix.reset(),
this.matrix.reset();
var v, b, x = 0;
if (p > 0) {
for (; x < f; )
this.applyTransforms(this.pMatrix, this.rMatrix,
this.sMatrix, this.tr, 1, !1),
x += 1;
h && (this.applyTransforms(this.pMatrix, this.rMatrix,
this.sMatrix, this.tr, h, !1),
x += h)
} else if (p < 0) {
for (; x > f; )
this.applyTransforms(this.pMatrix, this.rMatrix,
this.sMatrix, this.tr, 1, !0),
x -= 1;
h && (this.applyTransforms(this.pMatrix, this.rMatrix,
this.sMatrix, this.tr, -h, !0),
x -= h)
}
for (n = 1 === this.data.m ? 0 : this._currentCopies - 1,
i = 1 === this.data.m ? 1 : -1,
o = this._currentCopies; o; ) {
if (b = (r = (t = this.elemsData[n].it)[t.length -
1].transform.mProps.v.props).length,
t[t.length - 1].transform.mProps._mdf = !0,
t[t.length - 1].transform.op._mdf = !0,
t[t.length - 1].transform.op.v = 1 ===
this._currentCopies ? this.so.v : this.so.v + (this.eo.v - this.so.v) * (n /
(this._currentCopies - 1)),
0 !== x) {
for ((0 !== n && 1 === i || n !==
this._currentCopies - 1 && -1 === i) && this.applyTransforms(this.pMatrix,
this.rMatrix, this.sMatrix, this.tr, 1, !1),
this.matrix.transform(g[0], g[1], g[2], g[3], g[4],
g[5], g[6], g[7], g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15]),
this.matrix.transform(y[0], y[1], y[2], y[3], y[4],
y[5], y[6], y[7], y[8], y[9], y[10], y[11], y[12], y[13], y[14], y[15]),
this.matrix.transform(m[0], m[1], m[2], m[3], m[4],
m[5], m[6], m[7], m[8], m[9], m[10], m[11], m[12], m[13], m[14], m[15]),
v = 0; v < b; v += 1)
r[v] = this.matrix.props[v];
this.matrix.reset()
} else
for (this.matrix.reset(),
v = 0; v < b; v += 1)
r[v] = this.matrix.props[v];
x += 1,
o -= 1,
n += i
}
} else
for (o = this._currentCopies,
n = 0,
i = 1; o; )
r = (t = this.elemsData[n].it)[t.length -
1].transform.mProps.v.props,
t[t.length - 1].transform.mProps._mdf = !1,
t[t.length - 1].transform.op._mdf = !1,
o -= 1,
n += i;
return s
}
,
RepeaterModifier.prototype.addShape = function() {}
,
extendPrototype([ShapeModifier], RoundCornersModifier),
RoundCornersModifier.prototype.initModifierProperties = function(e,
t) {
this.getValue = this.processKeys,
this.rd = PropertyFactory.getProp(e, t.r, 0, null, this),
this._isAnimated = !!this.rd.effectsSequence.length
}
,
RoundCornersModifier.prototype.processPath = function(e, t) {
var r, n = shapePool.newElement();
n.c = e.c;
var i, o, s, a, l, c, u, d, p, h, f, m, g = e._length, y = 0;
for (r = 0; r < g; r += 1)
i = e.v[r],
s = e.o[r],
o = e.i[r],
i[0] === s[0] && i[1] === s[1] && i[0] === o[0] && i[1] ===
o[1] ? 0 !== r && r !== g - 1 || e.c ? (a = 0 === r ? e.v[g - 1] : e.v[r - 1],
c = (l = Math.sqrt(Math.pow(i[0] - a[0], 2) + Math.pow(i[1]
- a[1], 2))) ? Math.min(l / 2, t) / l : 0,
u = f = i[0] + (a[0] - i[0]) * c,
d = m = i[1] - (i[1] - a[1]) * c,
p = u - (u - i[0]) * roundCorner,
h = d - (d - i[1]) * roundCorner,
n.setTripleAt(u, d, p, h, f, m, y),
y += 1,
a = r === g - 1 ? e.v[0] : e.v[r + 1],
c = (l = Math.sqrt(Math.pow(i[0] - a[0], 2) + Math.pow(i[1]
- a[1], 2))) ? Math.min(l / 2, t) / l : 0,
u = p = i[0] + (a[0] - i[0]) * c,
d = h = i[1] + (a[1] - i[1]) * c,
f = u - (u - i[0]) * roundCorner,
m = d - (d - i[1]) * roundCorner,
n.setTripleAt(u, d, p, h, f, m, y),
y += 1) : (n.setTripleAt(i[0], i[1], s[0], s[1], o[0],
o[1], y),
y += 1) : (n.setTripleAt(e.v[r][0], e.v[r][1], e.o[r][0],
e.o[r][1], e.i[r][0], e.i[r][1], y),
y += 1);
return n
}
,
RoundCornersModifier.prototype.processShapes = function(e) {
var t, r, n, i, o, s, a = this.shapes.length, l = this.rd.v;
if (0 !== l)
for (r = 0; r < a; r += 1) {
if (s = (o = this.shapes[r]).localShapeCollection,
o.shape._mdf || this._mdf || e)
for (s.releaseShapes(),
o.shape._mdf = !0,
t = o.shape.paths.shapes,
i = o.shape.paths._length,
n = 0; n < i; n += 1)
s.addShape(this.processPath(t[n], l));
o.shape.paths = o.localShapeCollection
}
this.dynamicProperties.length || (this._mdf = !1)
}
,
PolynomialBezier.prototype.point = function(e) {
return [((this.a[0] * e + this.b[0]) * e + this.c[0]) * e +
this.d[0], ((this.a[1] * e + this.b[1]) * e + this.c[1]) * e + this.d[1]]
}
,
PolynomialBezier.prototype.derivative = function(e) {
return [(3 * e * this.a[0] + 2 * this.b[0]) * e + this.c[0], (3
* e * this.a[1] + 2 * this.b[1]) * e + this.c[1]]
}
,
PolynomialBezier.prototype.tangentAngle = function(e) {
var t = this.derivative(e);
return Math.atan2(t[1], t[0])
}
,
PolynomialBezier.prototype.normalAngle = function(e) {
var t = this.derivative(e);
return Math.atan2(t[0], t[1])
}
,
PolynomialBezier.prototype.inflectionPoints = function() {
var e = this.a[1] * this.b[0] - this.a[0] * this.b[1];
if (floatZero(e))
return [];
var t = -.5 * (this.a[1] * this.c[0] - this.a[0] * this.c[1]) /
e
, r = t * t - 1 / 3 * (this.b[1] * this.c[0] - this.b[0] *
this.c[1]) / e;
if (r < 0)
return [];
var n = Math.sqrt(r);
return floatZero(n) ? n > 0 && n < 1 ? [t] : [] : [t - n, t +
n].filter((function(e) {
return e > 0 && e < 1
}
))
}
,
PolynomialBezier.prototype.split = function(e) {
if (e <= 0)
return [singlePoint(this.points[0]), this];
if (e >= 1)
return [this, singlePoint(this.points[this.points.length -
1])];
var t = lerpPoint(this.points[0], this.points[1], e)
, r = lerpPoint(this.points[1], this.points[2], e)
, n = lerpPoint(this.points[2], this.points[3], e)
, i = lerpPoint(t, r, e)
, o = lerpPoint(r, n, e)
, s = lerpPoint(i, o, e);
return [new PolynomialBezier(this.points[0],t,i,s,!0), new
PolynomialBezier(s,o,n,this.points[3],!0)]
}
,
PolynomialBezier.prototype.bounds = function() {
return {
x: extrema(this, 0),
y: extrema(this, 1)
}
}
,
PolynomialBezier.prototype.boundingBox = function() {
var e = this.bounds();
return {
left: e.x.min,
right: e.x.max,
top: e.y.min,
bottom: e.y.max,
width: e.x.max - e.x.min,
height: e.y.max - e.y.min,
cx: (e.x.max + e.x.min) / 2,
cy: (e.y.max + e.y.min) / 2
}
}
,
PolynomialBezier.prototype.intersections = function(e, t, r) {
void 0 === t && (t = 2),
void 0 === r && (r = 7);
var n = [];
return intersectsImpl(intersectData(this, 0, 1),
intersectData(e, 0, 1), 0, t, n, r),
n
}
,
PolynomialBezier.shapeSegment = function(e, t) {
var r = (t + 1) % e.length();
return new PolynomialBezier(e.v[t],e.o[t],e.i[r],e.v[r],!0)
}
,
PolynomialBezier.shapeSegmentInverted = function(e, t) {
var r = (t + 1) % e.length();
return new PolynomialBezier(e.v[r],e.i[r],e.o[t],e.v[t],!0)
}
,
extendPrototype([ShapeModifier], ZigZagModifier),
ZigZagModifier.prototype.initModifierProperties = function(e, t) {
this.getValue = this.processKeys,
this.amplitude = PropertyFactory.getProp(e, t.s, 0, null,
this),
this.frequency = PropertyFactory.getProp(e, t.r, 0, null,
this),
this.pointsType = PropertyFactory.getProp(e, t.pt, 0, null,
this),
this._isAnimated = 0 !== this.amplitude.effectsSequence.length
|| 0 !== this.frequency.effectsSequence.length || 0 !==
this.pointsType.effectsSequence.length
}
,
ZigZagModifier.prototype.processPath = function(e, t, r, n) {
var i = e._length
, o = shapePool.newElement();
if (o.c = e.c,
e.c || (i -= 1),
0 === i)
return o;
var s = -1
, a = PolynomialBezier.shapeSegment(e, 0);
zigZagCorner(o, e, 0, t, r, n, s);
for (var l = 0; l < i; l += 1)
s = zigZagSegment(o, a, t, r, n, -s),
a = l !== i - 1 || e.c ? PolynomialBezier.shapeSegment(e,
(l + 1) % i) : null,
zigZagCorner(o, e, l + 1, t, r, n, s);
return o
}
,
ZigZagModifier.prototype.processShapes = function(e) {
var t, r, n, i, o, s, a = this.shapes.length, l =
this.amplitude.v, c = Math.max(0, Math.round(this.frequency.v)), u =
this.pointsType.v;
if (0 !== l)
for (r = 0; r < a; r += 1) {
if (s = (o = this.shapes[r]).localShapeCollection,
o.shape._mdf || this._mdf || e)
for (s.releaseShapes(),
o.shape._mdf = !0,
t = o.shape.paths.shapes,
i = o.shape.paths._length,
n = 0; n < i; n += 1)
s.addShape(this.processPath(t[n], l, c, u));
o.shape.paths = o.localShapeCollection
}
this.dynamicProperties.length || (this._mdf = !1)
}
,
extendPrototype([ShapeModifier], OffsetPathModifier),
OffsetPathModifier.prototype.initModifierProperties = function(e,
t) {
this.getValue = this.processKeys,
this.amount = PropertyFactory.getProp(e, t.a, 0, null, this),
this.miterLimit = PropertyFactory.getProp(e, t.ml, 0, null,
this),
this.lineJoin = t.lj,
this._isAnimated = 0 !== this.amount.effectsSequence.length
}
,
OffsetPathModifier.prototype.processPath = function(e, t, r, n) {
var i = shapePool.newElement();
i.c = e.c;
var o, s, a, l = e.length();
e.c || (l -= 1);
var c = [];
for (o = 0; o < l; o += 1)
a = PolynomialBezier.shapeSegment(e, o),
c.push(offsetSegmentSplit(a, t));
if (!e.c)
for (o = l - 1; o >= 0; o -= 1)
a = PolynomialBezier.shapeSegmentInverted(e, o),
c.push(offsetSegmentSplit(a, t));
c = pruneIntersections(c);
var u = null
, d = null;
for (o = 0; o < c.length; o += 1) {
var p = c[o];
for (d && (u = joinLines(i, d, p[0], r, n)),
d = p[p.length - 1],
s = 0; s < p.length; s += 1)
a = p[s],
u && pointEqual(a.points[0], u) ? i.setXYAt(a.points[1]
[0], a.points[1][1], "o", i.length() - 1) : i.setTripleAt(a.points[0][0],
a.points[0][1], a.points[1][0], a.points[1][1], a.points[0][0], a.points[0][1],
i.length()),
i.setTripleAt(a.points[3][0], a.points[3][1],
a.points[3][0], a.points[3][1], a.points[2][0], a.points[2][1], i.length()),
u = a.points[3]
}
return c.length && joinLines(i, d, c[0][0], r, n),
i
}
,
OffsetPathModifier.prototype.processShapes = function(e) {
var t, r, n, i, o, s, a = this.shapes.length, l =
this.amount.v, c = this.miterLimit.v, u = this.lineJoin;
if (0 !== l)
for (r = 0; r < a; r += 1) {
if (s = (o = this.shapes[r]).localShapeCollection,
o.shape._mdf || this._mdf || e)
for (s.releaseShapes(),
o.shape._mdf = !0,
t = o.shape.paths.shapes,
i = o.shape.paths._length,
n = 0; n < i; n += 1)
s.addShape(this.processPath(t[n], l, u, c));
o.shape.paths = o.localShapeCollection
}
this.dynamicProperties.length || (this._mdf = !1)
}
;
var FontManager = function() {
var e = {
w: 0,
size: 0,
shapes: [],
data: {
shapes: []
}
}
, t = [];
t = t.concat([2304, 2305, 2306, 2307, 2362, 2363, 2364, 2364,
2366, 2367, 2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379,
2380, 2381, 2382, 2383, 2387, 2388, 2389, 2390, 2391, 2402, 2403]);
var r = 127988
, n = 127462
, i = 127487
, o = ["d83cdffb", "d83cdffc", "d83cdffd", "d83cdffe",
"d83cdfff"];
function s(e, t) {
var r = createTag("span");
r.setAttribute("aria-hidden", !0),
r.style.fontFamily = t;
var n = createTag("span");
n.innerText = "giItT1WQy@!-/#",
r.style.position = "absolute",
r.style.left = "-10000px",
r.style.top = "-10000px",
r.style.fontSize = "300px",
r.style.fontVariant = "normal",
r.style.fontStyle = "normal",
r.style.fontWeight = "normal",
r.style.letterSpacing = "0",
r.appendChild(n),
document.body.appendChild(r);
var i = n.offsetWidth;
return n.style.fontFamily = function(e) {
var t, r = e.split(","), n = r.length, i = [];
for (t = 0; t < n; t += 1)
"sans-serif" !== r[t] && "monospace" !== r[t] &&
i.push(r[t]);
return i.join(",")
}(e) + ", " + t,
{
node: n,
w: i,
parent: r
}
}
function a(e, t) {
var r, n = document.body && t ? "svg" : "canvas", i =
getFontProperties(e);
if ("svg" === n) {
var o = createNS("text");
o.style.fontSize = "100px",
o.setAttribute("font-family", e.fFamily),
o.setAttribute("font-style", i.style),
o.setAttribute("font-weight", i.weight),
o.textContent = "1",
e.fClass ? (o.style.fontFamily = "inherit",
o.setAttribute("class", e.fClass)) : o.style.fontFamily
= e.fFamily,
t.appendChild(o),
r = o
} else {
var s = new OffscreenCanvas(500,500).getContext("2d");
s.font = i.style + " " + i.weight + " 100px " +
e.fFamily,
r = s
}
return {
measureText: function(e) {
return "svg" === n ? (r.textContent = e,
r.getComputedTextLength()) : r.measureText(e).width
}
}
}
function l(e) {
var t = 0
, r = e.charCodeAt(0);
if (r >= 55296 && r <= 56319) {
var n = e.charCodeAt(1);
n >= 56320 && n <= 57343 && (t = 1024 * (r - 55296) + n
- 56320 + 65536)
}
return t
}
function c(e) {
var t = l(e);
return t >= n && t <= i
}
var u = function() {
this.fonts = [],
this.chars = null,
this.typekitLoaded = 0,
this.isLoaded = !1,
this._warned = !1,
this.initTime = Date.now(),
this.setIsLoadedBinded = this.setIsLoaded.bind(this),
this.checkLoadedFontsBinded =
this.checkLoadedFonts.bind(this)
};
return u.isModifier = function(e, t) {
var r = e.toString(16) + t.toString(16);
return -1 !== o.indexOf(r)
}
,
u.isZeroWidthJoiner = function(e) {
return 8205 === e
}
,
u.isFlagEmoji = function(e) {
return c(e.substr(0, 2)) && c(e.substr(2, 2))
}
,
u.isRegionalCode = c,
u.isCombinedCharacter = function(e) {
return -1 !== t.indexOf(e)
}
,
u.isRegionalFlag = function(e, t) {
var n = l(e.substr(t, 2));
if (n !== r)
return !1;
var i = 0;
for (t += 2; i < 5; ) {
if ((n = l(e.substr(t, 2))) < 917601 || n > 917626)
return !1;
i += 1,
t += 2
}
return 917631 === l(e.substr(t, 2))
}
,
u.isVariationSelector = function(e) {
return 65039 === e
}
,
u.BLACK_FLAG_CODE_POINT = r,
u.prototype = {
addChars: function(e) {
if (e) {
var t;
this.chars || (this.chars = []);
var r, n, i = e.length, o = this.chars.length;
for (t = 0; t < i; t += 1) {
for (r = 0,
n = !1; r < o; )
this.chars[r].style === e[t].style &&
this.chars[r].fFamily === e[t].fFamily && this.chars[r].ch === e[t].ch && (n = !0),
r += 1;
n || (this.chars.push(e[t]),
o += 1)
}
}
},
addFonts: function(e, t) {
if (e) {
if (this.chars)
return this.isLoaded = !0,
void (this.fonts = e.list);
if (!document.body)
return this.isLoaded = !0,
e.list.forEach((function(e) {
e.helper = a(e),
e.cache = {}
}
)),
void (this.fonts = e.list);
var r, n = e.list, i = n.length, o = i;
for (r = 0; r < i; r += 1) {
var l, c, u = !0;
if (n[r].loaded = !1,
n[r].monoCase = s(n[r].fFamily, "monospace"),
n[r].sansCase = s(n[r].fFamily, "sans-serif"),
n[r].fPath) {
if ("p" === n[r].fOrigin || 3 ===
n[r].origin) {
if ((l =
document.querySelectorAll('style[f-forigin="p"][f-family="' + n[r].fFamily + '"],
style[f-origin="3"][f-family="' + n[r].fFamily + '"]')).length > 0 && (u = !1),
u) {
var d = createTag("style");
d.setAttribute("f-forigin",
n[r].fOrigin),
d.setAttribute("f-origin",
n[r].origin),
d.setAttribute("f-family",
n[r].fFamily),
d.type = "text/css",
d.innerText = "@font-face {font-
family: " + n[r].fFamily + "; font-style: normal; src: url('" + n[r].fPath +
"');}",
t.appendChild(d)
}
} else if ("g" === n[r].fOrigin || 1 ===
n[r].origin) {
for (l =
document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),
c = 0; c < l.length; c += 1)
-1 !==
l[c].href.indexOf(n[r].fPath) && (u = !1);
if (u) {
var p = createTag("link");
p.setAttribute("f-forigin",
n[r].fOrigin),
p.setAttribute("f-origin",
n[r].origin),
p.type = "text/css",
p.rel = "stylesheet",
p.href = n[r].fPath,
document.body.appendChild(p)
}
} else if ("t" === n[r].fOrigin || 2 ===
n[r].origin) {
for (l =
document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),
c = 0; c < l.length; c += 1)
n[r].fPath === l[c].src && (u = !
1);
if (u) {
var h = createTag("link");
h.setAttribute("f-forigin",
n[r].fOrigin),
h.setAttribute("f-origin",
n[r].origin),
h.setAttribute("rel",
"stylesheet"),
h.setAttribute("href", n[r].fPath),
t.appendChild(h)
}
}
} else
n[r].loaded = !0,
o -= 1;
n[r].helper = a(n[r], t),
n[r].cache = {},
this.fonts.push(n[r])
}
0 === o ? this.isLoaded = !0 :
setTimeout(this.checkLoadedFonts.bind(this), 100)
} else
this.isLoaded = !0
},
getCharData: function(t, r, n) {
for (var i = 0, o = this.chars.length; i < o; ) {
if (this.chars[i].ch === t && this.chars[i].style
=== r && this.chars[i].fFamily === n)
return this.chars[i];
i += 1
}
return ("string" == typeof t && 13 !== t.charCodeAt(0)
|| !t) && console && console.warn && !this._warned && (this._warned = !0),
e
},
getFontByName: function(e) {
for (var t = 0, r = this.fonts.length; t < r; ) {
if (this.fonts[t].fName === e)
return this.fonts[t];
t += 1
}
return this.fonts[0]
},
measureText: function(e, t, r) {
var n = this.getFontByName(t)
, i = e;
if (!n.cache[i]) {
var o = n.helper;
if (" " === e) {
var s = o.measureText("|" + e + "|")
, a = o.measureText("||");
n.cache[i] = (s - a) / 100
} else
n.cache[i] = o.measureText(e) / 100
}
return n.cache[i] * r
},
checkLoadedFonts: function() {
var e, t, r, n = this.fonts.length, i = n;
for (e = 0; e < n; e += 1)
this.fonts[e].loaded ? i -= 1 : "n" ===
this.fonts[e].fOrigin || 0 === this.fonts[e].origin ? this.fonts[e].loaded = !0 :
(t = this.fonts[e].monoCase.node,
r = this.fonts[e].monoCase.w,
t.offsetWidth !== r ? (i -= 1,
this.fonts[e].loaded = !0) : (t =
this.fonts[e].sansCase.node,
r = this.fonts[e].sansCase.w,
t.offsetWidth !== r && (i -= 1,
this.fonts[e].loaded = !0)),
this.fonts[e].loaded &&
(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent
),
this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)
));
0 !== i && Date.now() - this.initTime < 5e3 ?
setTimeout(this.checkLoadedFontsBinded, 20) : setTimeout(this.setIsLoadedBinded,
10)
},
setIsLoaded: function() {
this.isLoaded = !0
}
},
u
}();
function SlotManager(e) {
this.animationData = e
}
function slotFactory(e) {
return new SlotManager(e)
}
function RenderableElement() {}
SlotManager.prototype.getProp = function(e) {
return this.animationData.slots &&
this.animationData.slots[e.sid] ? Object.assign(e,
this.animationData.slots[e.sid].p) : e
}
,
RenderableElement.prototype = {
initRenderable: function() {
this.isInRange = !1,
this.hidden = !1,
this.isTransparent = !1,
this.renderableComponents = []
},
addRenderableComponent: function(e) {
-1 === this.renderableComponents.indexOf(e) &&
this.renderableComponents.push(e)
},
removeRenderableComponent: function(e) {
-1 !== this.renderableComponents.indexOf(e) &&
this.renderableComponents.splice(this.renderableComponents.indexOf(e), 1)
},
prepareRenderableFrame: function(e) {
this.checkLayerLimits(e)
},
checkTransparency: function() {
this.finalTransform.mProp.o.v <= 0 ? !this.isTransparent &&
this.globalData.renderConfig.hideOnTransparent && (this.isTransparent = !0,
this.hide()) : this.isTransparent && (this.isTransparent
= !1,
this.show())
},
checkLayerLimits: function(e) {
this.data.ip - this.data.st <= e && this.data.op -
this.data.st > e ? !0 !== this.isInRange && (this.globalData._mdf = !0,
this._mdf = !0,
this.isInRange = !0,
this.show()) : !1 !== this.isInRange &&
(this.globalData._mdf = !0,
this.isInRange = !1,
this.hide())
},
renderRenderable: function() {
var e, t = this.renderableComponents.length;
for (e = 0; e < t; e += 1)
this.renderableComponents[e].renderFrame(this._isFirstFrame)
},
sourceRectAtTime: function() {
return {
top: 0,
left: 0,
width: 100,
height: 100
}
},
getLayerSize: function() {
return 5 === this.data.ty ? {
w: this.data.textData.width,
h: this.data.textData.height
} : {
w: this.data.width,
h: this.data.height
}
}
};
var getBlendMode = (blendModeEnums = {
0: "source-over",
1: "multiply",
2: "screen",
3: "overlay",
4: "darken",
5: "lighten",
6: "color-dodge",
7: "color-burn",
8: "hard-light",
9: "soft-light",
10: "difference",
11: "exclusion",
12: "hue",
13: "saturation",
14: "color",
15: "luminosity"
},
function(e) {
return blendModeEnums[e] || ""
}
), blendModeEnums;
function SliderEffect(e, t, r) {
this.p = PropertyFactory.getProp(t, e.v, 0, 0, r)
}
function AngleEffect(e, t, r) {
this.p = PropertyFactory.getProp(t, e.v, 0, 0, r)
}
function ColorEffect(e, t, r) {
this.p = PropertyFactory.getProp(t, e.v, 1, 0, r)
}
function PointEffect(e, t, r) {
this.p = PropertyFactory.getProp(t, e.v, 1, 0, r)
}
function LayerIndexEffect(e, t, r) {
this.p = PropertyFactory.getProp(t, e.v, 0, 0, r)
}
function MaskIndexEffect(e, t, r) {
this.p = PropertyFactory.getProp(t, e.v, 0, 0, r)
}
function CheckboxEffect(e, t, r) {
this.p = PropertyFactory.getProp(t, e.v, 0, 0, r)
}
function NoValueEffect() {
this.p = {}
}
function EffectsManager(e, t) {
var r, n = e.ef || [];
this.effectElements = [];
var i, o = n.length;
for (r = 0; r < o; r += 1)
i = new GroupEffect(n[r],t),
this.effectElements.push(i)
}
function GroupEffect(e, t) {
this.init(e, t)
}
function BaseElement() {}
function FrameElement() {}
function FootageElement(e, t, r) {
this.initFrame(),
this.initRenderable(),
this.assetData = t.getAssetData(e.refId),
this.footageData = t.imageLoader.getAsset(this.assetData),
this.initBaseData(e, t, r)
}
function AudioElement(e, t, r) {
this.initFrame(),
this.initRenderable(),
this.assetData = t.getAssetData(e.refId),
this.initBaseData(e, t, r),
this._isPlaying = !1,
this._canPlay = !1;
var n = this.globalData.getAssetsPath(this.assetData);
this.audio = this.globalData.audioController.createAudio(n),
this._currentTime = 0,
this.globalData.audioController.addAudio(this),
this._volumeMultiplier = 1,
this._volume = 1,
this._previousVolume = null,
this.tm = e.tm ? PropertyFactory.getProp(this, e.tm, 0,
t.frameRate, this) : {
_placeholder: !0
},
this.lv = PropertyFactory.getProp(this, e.au && e.au.lv ?
e.au.lv : {
k: [100]
}, 1, .01, this)
}
function BaseRenderer() {}
extendPrototype([DynamicPropertyContainer], GroupEffect),
GroupEffect.prototype.getValue =
GroupEffect.prototype.iterateDynamicProperties,
GroupEffect.prototype.init = function(e, t) {
var r;
this.data = e,
this.effectElements = [],
this.initDynamicPropertyContainer(t);
var n, i = this.data.ef.length, o = this.data.ef;
for (r = 0; r < i; r += 1) {
switch (n = null,
o[r].ty) {
case 0:
n = new SliderEffect(o[r],t,this);
break;
case 1:
n = new AngleEffect(o[r],t,this);
break;
case 2:
n = new ColorEffect(o[r],t,this);
break;
case 3:
n = new PointEffect(o[r],t,this);
break;
case 4:
case 7:
n = new CheckboxEffect(o[r],t,this);
break;
case 10:
n = new LayerIndexEffect(o[r],t,this);
break;
case 11:
n = new MaskIndexEffect(o[r],t,this);
break;
case 5:
n = new EffectsManager(o[r],t);
break;
default:
n = new NoValueEffect(o[r])
}
n && this.effectElements.push(n)
}
}
,
BaseElement.prototype = {
checkMasks: function() {
if (!this.data.hasMask)
return !1;
for (var e = 0, t = this.data.masksProperties.length; e <
t; ) {
if ("n" !== this.data.masksProperties[e].mode && !1 !==
this.data.masksProperties[e].cl)
return !0;
e += 1
}
return !1
},
initExpressions: function() {
var e = getExpressionInterfaces();
if (e) {
var t = e("layer")
, r = e("effects")
, n = e("shape")
, i = e("text")
, o = e("comp");
this.layerInterface = t(this),
this.data.hasMask && this.maskManager &&
this.layerInterface.registerMaskInterface(this.maskManager);
var s = r.createEffectsInterface(this,
this.layerInterface);
this.layerInterface.registerEffectsInterface(s),
0 === this.data.ty || this.data.xt ? this.compInterface
= o(this) : 4 === this.data.ty ? (this.layerInterface.shapeInterface =
n(this.shapesData, this.itemsData, this.layerInterface),
this.layerInterface.content =
this.layerInterface.shapeInterface) : 5 === this.data.ty &&
(this.layerInterface.textInterface = i(this),
this.layerInterface.text =
this.layerInterface.textInterface)
}
},
setBlendMode: function() {
var e = getBlendMode(this.data.bm);
(this.baseElement || this.layerElement).style["mix-blend-
mode"] = e
},
initBaseData: function(e, t, r) {
this.globalData = t,
this.comp = r,
this.data = e,
this.layerId = createElementID(),
this.data.sr || (this.data.sr = 1),
this.effectsManager = new
EffectsManager(this.data,this,this.dynamicProperties)
},
getType: function() {
return this.type
},
sourceRectAtTime: function() {}
},
FrameElement.prototype = {
initFrame: function() {
this._isFirstFrame = !1,
this.dynamicProperties = [],
this._mdf = !1
},
prepareProperties: function(e, t) {
var r, n = this.dynamicProperties.length;
for (r = 0; r < n; r += 1)
(t || this._isParent && "transform" ===
this.dynamicProperties[r].propType) && (this.dynamicProperties[r].getValue(),
this.dynamicProperties[r]._mdf && (this.globalData._mdf
= !0,
this._mdf = !0))
},
addDynamicProperty: function(e) {
-1 === this.dynamicProperties.indexOf(e) &&
this.dynamicProperties.push(e)
}
},
FootageElement.prototype.prepareFrame = function() {}
,
extendPrototype([RenderableElement, BaseElement, FrameElement],
FootageElement),
FootageElement.prototype.getBaseElement = function() {
return null
}
,
FootageElement.prototype.renderFrame = function() {}
,
FootageElement.prototype.destroy = function() {}
,
FootageElement.prototype.initExpressions = function() {
var e = getExpressionInterfaces();
if (e) {
var t = e("footage");
this.layerInterface = t(this)
}
}
,
FootageElement.prototype.getFootageData = function() {
return this.footageData
}
,
AudioElement.prototype.prepareFrame = function(e) {
if (this.prepareRenderableFrame(e, !0),
this.prepareProperties(e, !0),
this.tm._placeholder)
this._currentTime = e / this.data.sr;
else {
var t = this.tm.v;
this._currentTime = t
}
this._volume = this.lv.v[0];
var r = this._volume * this._volumeMultiplier;
this._previousVolume !== r && (this._previousVolume = r,
this.audio.volume(r))
}
,
extendPrototype([RenderableElement, BaseElement, FrameElement],
AudioElement),
AudioElement.prototype.renderFrame = function() {
this.isInRange && this._canPlay && (this._isPlaying ? (!
this.audio.playing() || Math.abs(this._currentTime / this.globalData.frameRate -
this.audio.seek()) > .1) && this.audio.seek(this._currentTime /
this.globalData.frameRate) : (this.audio.play(),
this.audio.seek(this._currentTime / this.globalData.frameRate),
this._isPlaying = !0))
}
,
AudioElement.prototype.show = function() {}
,
AudioElement.prototype.hide = function() {
this.audio.pause(),
this._isPlaying = !1
}
,
AudioElement.prototype.pause = function() {
this.audio.pause(),
this._isPlaying = !1,
this._canPlay = !1
}
,
AudioElement.prototype.resume = function() {
this._canPlay = !0
}
,
AudioElement.prototype.setRate = function(e) {
this.audio.rate(e)
}
,
AudioElement.prototype.volume = function(e) {
this._volumeMultiplier = e,
this._previousVolume = e * this._volume,
this.audio.volume(this._previousVolume)
}
,
AudioElement.prototype.getBaseElement = function() {
return null
}
,
AudioElement.prototype.destroy = function() {}
,
AudioElement.prototype.sourceRectAtTime = function() {}
,
AudioElement.prototype.initExpressions = function() {}
,
BaseRenderer.prototype.checkLayers = function(e) {
var t, r, n = this.layers.length;
for (this.completeLayers = !0,
t = n - 1; t >= 0; t -= 1)
this.elements[t] || (r = this.layers[t]).ip - r.st <= e -
this.layers[t].st && r.op - r.st > e - this.layers[t].st && this.buildItem(t),
this.completeLayers = !!this.elements[t] &&
this.completeLayers;
this.checkPendingElements()
}
,
BaseRenderer.prototype.createItem = function(e) {
switch (e.ty) {
case 2:
return this.createImage(e);
case 0:
return this.createComp(e);
case 1:
return this.createSolid(e);
case 3:
default:
return this.createNull(e);
case 4:
return this.createShape(e);
case 5:
return this.createText(e);
case 6:
return this.createAudio(e);
case 13:
return this.createCamera(e);
case 15:
return this.createFootage(e)
}
}
,
BaseRenderer.prototype.createCamera = function() {
throw new Error("You're using a 3d camera. Try the html
renderer.")
}
,
BaseRenderer.prototype.createAudio = function(e) {
return new AudioElement(e,this.globalData,this)
}
,
BaseRenderer.prototype.createFootage = function(e) {
return new FootageElement(e,this.globalData,this)
}
,
BaseRenderer.prototype.buildAllItems = function() {
var e, t = this.layers.length;
for (e = 0; e < t; e += 1)
this.buildItem(e);
this.checkPendingElements()
}
,
BaseRenderer.prototype.includeLayers = function(e) {
var t;
this.completeLayers = !1;
var r, n = e.length, i = this.layers.length;
for (t = 0; t < n; t += 1)
for (r = 0; r < i; ) {
if (this.layers[r].id === e[t].id) {
this.layers[r] = e[t];
break
}
r += 1
}
}
,
BaseRenderer.prototype.setProjectInterface = function(e) {
this.globalData.projectInterface = e
}
,
BaseRenderer.prototype.initItems = function() {
this.globalData.progressiveLoad || this.buildAllItems()
}
,
BaseRenderer.prototype.buildElementParenting = function(e, t, r) {
for (var n = this.elements, i = this.layers, o = 0, s =
i.length; o < s; )
i[o].ind == t && (n[o] && !0 !== n[o] ? (r.push(n[o]),
n[o].setAsParent(),
void 0 !== i[o].parent ? this.buildElementParenting(e,
i[o].parent, r) : e.setHierarchy(r)) : (this.buildItem(o),
this.addPendingElement(e))),
o += 1
}
,
BaseRenderer.prototype.addPendingElement = function(e) {
this.pendingElements.push(e)
}
,
BaseRenderer.prototype.searchExtraCompositions = function(e) {
var t, r = e.length;
for (t = 0; t < r; t += 1)
if (e[t].xt) {
var n = this.createComp(e[t]);
n.initExpressions(),
this.globalData.projectInterface.registerComposition(n)
}
}
,
BaseRenderer.prototype.getElementById = function(e) {
var t, r = this.elements.length;
for (t = 0; t < r; t += 1)
if (this.elements[t].data.ind === e)
return this.elements[t];
return null
}
,
BaseRenderer.prototype.getElementByPath = function(e) {
var t, r = e.shift();
if ("number" == typeof r)
t = this.elements[r];
else {
var n, i = this.elements.length;
for (n = 0; n < i; n += 1)
if (this.elements[n].data.nm === r) {
t = this.elements[n];
break
}
}
return 0 === e.length ? t : t.getElementByPath(e)
}
,
BaseRenderer.prototype.setupGlobalData = function(e, t) {
this.globalData.fontManager = new FontManager,
this.globalData.slotManager = slotFactory(e),
this.globalData.fontManager.addChars(e.chars),
this.globalData.fontManager.addFonts(e.fonts, t),
this.globalData.getAssetData =
this.animationItem.getAssetData.bind(this.animationItem),
this.globalData.getAssetsPath =
this.animationItem.getAssetsPath.bind(this.animationItem),
this.globalData.imageLoader =
this.animationItem.imagePreloader,
this.globalData.audioController =
this.animationItem.audioController,
this.globalData.frameId = 0,
this.globalData.frameRate = e.fr,
this.globalData.nm = e.nm,
this.globalData.compSize = {
w: e.w,
h: e.h
}
}
;
var effectTypes = {
TRANSFORM_EFFECT: "transformEFfect"
};
function TransformElement() {}
function MaskElement(e, t, r) {
this.data = e,
this.element = t,
this.globalData = r,
this.storedData = [],
this.masksProperties = this.data.masksProperties || [],
this.maskElement = null;
var n, i, o = this.globalData.defs, s = this.masksProperties ?
this.masksProperties.length : 0;
this.viewData = createSizedArray(s),
this.solidPath = "";
var a, l, c, u, d, p, h = this.masksProperties, f = 0, m = [],
g = createElementID(), y = "clipPath", v = "clip-path";
for (n = 0; n < s; n += 1)
if (("a" !== h[n].mode && "n" !== h[n].mode || h[n].inv ||
100 !== h[n].o.k || h[n].o.x) && (y = "mask",
v = "mask"),
"s" !== h[n].mode && "i" !== h[n].mode || 0 !== f ? c =
null : ((c = createNS("rect")).setAttribute("fill", "#ffffff"),
c.setAttribute("width", this.element.comp.data.w || 0),
c.setAttribute("height", this.element.comp.data.h || 0),
m.push(c)),
i = createNS("path"),
"n" === h[n].mode)
this.viewData[n] = {
op: PropertyFactory.getProp(this.element, h[n].o,
0, .01, this.element),
prop:
ShapePropertyFactory.getShapeProp(this.element, h[n], 3),
elem: i,
lastPath: ""
},
o.appendChild(i);
else {
var b;
if (f += 1,
i.setAttribute("fill", "s" === h[n].mode ? "#000000" :
"#ffffff"),
i.setAttribute("clip-rule", "nonzero"),
0 !== h[n].x.k ? (y = "mask",
v = "mask",
p = PropertyFactory.getProp(this.element, h[n].x, 0,
null, this.element),
b = createElementID(),
(u = createNS("filter")).setAttribute("id", b),
(d = createNS("feMorphology")).setAttribute("operator",
"erode"),
d.setAttribute("in", "SourceGraphic"),
d.setAttribute("radius", "0"),
u.appendChild(d),
o.appendChild(u),
i.setAttribute("stroke", "s" === h[n].mode ?
"#000000" : "#ffffff")) : (d = null,
p = null),
this.storedData[n] = {
elem: i,
x: p,
expan: d,
lastPath: "",
lastOperator: "",
filterId: b,
lastRadius: 0
},
"i" === h[n].mode) {
l = m.length;
var x = createNS("g");
for (a = 0; a < l; a += 1)
x.appendChild(m[a]);
var _ = createNS("mask");
_.setAttribute("mask-type", "alpha"),
_.setAttribute("id", g + "_" + f),
_.appendChild(i),
o.appendChild(_),
x.setAttribute("mask", "url(" + getLocationHref() +
"#" + g + "_" + f + ")"),
m.length = 0,
m.push(x)
} else
m.push(i);
h[n].inv && !this.solidPath && (this.solidPath =
this.createLayerSolidPath()),
this.viewData[n] = {
elem: i,
lastPath: "",
op: PropertyFactory.getProp(this.element, h[n].o,
0, .01, this.element),
prop:
ShapePropertyFactory.getShapeProp(this.element, h[n], 3),
invRect: c
},
this.viewData[n].prop.k || this.drawPath(h[n],
this.viewData[n].prop.v, this.viewData[n])
}
for (this.maskElement = createNS(y),
s = m.length,
n = 0; n < s; n += 1)
this.maskElement.appendChild(m[n]);
f > 0 && (this.maskElement.setAttribute("id", g),
this.element.maskedElement.setAttribute(v, "url(" +
getLocationHref() + "#" + g + ")"),
o.appendChild(this.maskElement)),
this.viewData.length &&
this.element.addRenderableComponent(this)
}
TransformElement.prototype = {
initTransform: function() {
var e = new Matrix;
this.finalTransform = {
mProp: this.data.ks ?
TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {
o: 0
},
_matMdf: !1,
_localMatMdf: !1,
_opMdf: !1,
mat: e,
localMat: e,
localOpacity: 1
},
this.data.ao && (this.finalTransform.mProp.autoOriented = !
0),
this.data.ty
},
renderTransform: function() {
if (this.finalTransform._opMdf =
this.finalTransform.mProp.o._mdf || this._isFirstFrame,
this.finalTransform._matMdf =
this.finalTransform.mProp._mdf || this._isFirstFrame,
this.hierarchy) {
var e, t = this.finalTransform.mat, r = 0, n =
this.hierarchy.length;
if (!this.finalTransform._matMdf)
for (; r < n; ) {
if
(this.hierarchy[r].finalTransform.mProp._mdf) {
this.finalTransform._matMdf = !0;
break
}
r += 1
}
if (this.finalTransform._matMdf)
for (e = this.finalTransform.mProp.v.props,
t.cloneFromProps(e),
r = 0; r < n; r += 1)
t.multiply(this.hierarchy[r].finalTransform.mProp.v)
}
this.finalTransform._matMdf &&
(this.finalTransform._localMatMdf = this.finalTransform._matMdf),
this.finalTransform._opMdf &&
(this.finalTransform.localOpacity = this.finalTransform.mProp.o.v)
},
renderLocalTransform: function() {
if (this.localTransforms) {
var e = 0
, t = this.localTransforms.length;
if (this.finalTransform._localMatMdf =
this.finalTransform._matMdf,
!this.finalTransform._localMatMdf || !
this.finalTransform._opMdf)
for (; e < t; )
this.localTransforms[e]._mdf &&
(this.finalTransform._localMatMdf = !0),
this.localTransforms[e]._opMdf && !
this.finalTransform._opMdf && (this.finalTransform.localOpacity =
this.finalTransform.mProp.o.v,
this.finalTransform._opMdf = !0),
e += 1;
if (this.finalTransform._localMatMdf) {
var r = this.finalTransform.localMat;
for (this.localTransforms[0].matrix.clone(r),
e = 1; e < t; e += 1) {
var n = this.localTransforms[e].matrix;
r.multiply(n)
}
r.multiply(this.finalTransform.mat)
}
if (this.finalTransform._opMdf) {
var i = this.finalTransform.localOpacity;
for (e = 0; e < t; e += 1)
i *= .01 * this.localTransforms[e].opacity;
this.finalTransform.localOpacity = i
}
}
},
searchEffectTransforms: function() {
if (this.renderableEffectsManager) {
var e =
this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);
if (e.length) {
this.localTransforms = [],
this.finalTransform.localMat = new Matrix;
var t = 0
, r = e.length;
for (t = 0; t < r; t += 1)
this.localTransforms.push(e[t])
}
}
},
globalToLocal: function(e) {
var t = [];
t.push(this.finalTransform);
for (var r, n = !0, i = this.comp; n; )
i.finalTransform ? (i.data.hasMask && t.splice(0, 0,
i.finalTransform),
i = i.comp) : n = !1;
var o, s = t.length;
for (r = 0; r < s; r += 1)
o = t[r].mat.applyToPointArray(0, 0, 0),
e = [e[0] - o[0], e[1] - o[1], 0];
return e
},
mHelper: new Matrix
},
MaskElement.prototype.getMaskProperty = function(e) {
return this.viewData[e].prop
}
,
MaskElement.prototype.renderFrame = function(e) {
var t, r = this.element.finalTransform.mat, n =
this.masksProperties.length;
for (t = 0; t < n; t += 1)
if ((this.viewData[t].prop._mdf || e) &&
this.drawPath(this.masksProperties[t], this.viewData[t].prop.v, this.viewData[t]),
(this.viewData[t].op._mdf || e) &&
this.viewData[t].elem.setAttribute("fill-opacity", this.viewData[t].op.v),
"n" !== this.masksProperties[t].mode &&
(this.viewData[t].invRect && (this.element.finalTransform.mProp._mdf || e) &&
this.viewData[t].invRect.setAttribute("transform", r.getInverseMatrix().to2dCSS()),
this.storedData[t].x && (this.storedData[t].x._mdf || e)))
{
var i = this.storedData[t].expan;
this.storedData[t].x.v < 0 ? ("erode" !==
this.storedData[t].lastOperator && (this.storedData[t].lastOperator = "erode",
this.storedData[t].elem.setAttribute("filter", "url(" +
getLocationHref() + "#" + this.storedData[t].filterId + ")")),
i.setAttribute("radius", -this.storedData[t].x.v)) :
("dilate" !== this.storedData[t].lastOperator && (this.storedData[t].lastOperator =
"dilate",
this.storedData[t].elem.setAttribute("filter", null)),
this.storedData[t].elem.setAttribute("stroke-width", 2
* this.storedData[t].x.v))
}
}
,
MaskElement.prototype.getMaskelement = function() {
return this.maskElement
}
,
MaskElement.prototype.createLayerSolidPath = function() {
var e = "M0,0 ";
return e += " h" + this.globalData.compSize.w,
e += " v" + this.globalData.compSize.h,
e += " h-" + this.globalData.compSize.w,
e += " v-" + this.globalData.compSize.h + " "
}
,
MaskElement.prototype.drawPath = function(e, t, r) {
var n, i, o = " M" + t.v[0][0] + "," + t.v[0][1];
for (i = t._length,
n = 1; n < i; n += 1)
o += " C" + t.o[n - 1][0] + "," + t.o[n - 1][1] + " " +
t.i[n][0] + "," + t.i[n][1] + " " + t.v[n][0] + "," + t.v[n][1];
if (t.c && i > 1 && (o += " C" + t.o[n - 1][0] + "," + t.o[n -
1][1] + " " + t.i[0][0] + "," + t.i[0][1] + " " + t.v[0][0] + "," + t.v[0][1]),
r.lastPath !== o) {
var s = "";
r.elem && (t.c && (s = e.inv ? this.solidPath + o : o),
r.elem.setAttribute("d", s)),
r.lastPath = o
}
}
,
MaskElement.prototype.destroy = function() {
this.element = null,
this.globalData = null,
this.maskElement = null,
this.data = null,
this.masksProperties = null
}
;
var filtersFactory = function() {
var e = {
createFilter: function(e, t) {
var r = createNS("filter");
return r.setAttribute("id", e),
!0 !== t && (r.setAttribute("filterUnits",
"objectBoundingBox"),
r.setAttribute("x", "0%"),
r.setAttribute("y", "0%"),
r.setAttribute("width", "100%"),
r.setAttribute("height", "100%")),
r
},
createAlphaToLuminanceFilter: function() {
var e = createNS("feColorMatrix");
return e.setAttribute("type", "matrix"),
e.setAttribute("color-interpolation-filters", "sRGB"),
e.setAttribute("values", "0 0 0 1 0 0 0 0 1 0 0 0 0 1
0 0 0 0 1 1"),
e
}
};
return e
}()
, featureSupport = function() {
var e = {
maskType: !0,
svgLumaHidden: !0,
offscreenCanvas: "undefined" != typeof OffscreenCanvas
};
return (/MSIE 10/i.test(navigator.userAgent) || /MSIE
9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent) || /Edge\/\
d./i.test(navigator.userAgent)) && (e.maskType = !1),
/firefox/i.test(navigator.userAgent) && (e.svgLumaHidden = !1),
e
}()
, registeredEffects$1 = {}
, idPrefix = "filter_result_";
function SVGEffects(e) {
var t, r, n = "SourceGraphic", i = e.data.ef ? e.data.ef.length
: 0, o = createElementID(), s = filtersFactory.createFilter(o, !0), a = 0;
for (this.filters = [],
t = 0; t < i; t += 1) {
r = null;
var l = e.data.ef[t].ty;
registeredEffects$1[l] && (r = new (0,
registeredEffects$1[l].effect)
(s,e.effectsManager.effectElements[t],e,idPrefix + a,n),
n = idPrefix + a,
registeredEffects$1[l].countsAsEffect && (a += 1)),
r && this.filters.push(r)
}
a && (e.globalData.defs.appendChild(s),
e.layerElement.setAttribute("filter", "url(" +
getLocationHref() + "#" + o + ")")),
this.filters.length && e.addRenderableComponent(this)
}
function registerEffect$1(e, t, r) {
registeredEffects$1[e] = {
effect: t,
countsAsEffect: r
}
}
function SVGBaseElement() {}
function HierarchyElement() {}
function RenderableDOMElement() {}
function IImageElement(e, t, r) {
this.assetData = t.getAssetData(e.refId),
this.assetData && this.assetData.sid && (this.assetData =
t.slotManager.getProp(this.assetData)),
this.initElement(e, t, r),
this.sourceRect = {
top: 0,
left: 0,
width: this.assetData.w,
height: this.assetData.h
}
}
function ProcessedElement(e, t) {
this.elem = e,
this.pos = t
}
function IShapeElement() {}
SVGEffects.prototype.renderFrame = function(e) {
var t, r = this.filters.length;
for (t = 0; t < r; t += 1)
this.filters[t].renderFrame(e)
}
,
SVGEffects.prototype.getEffects = function(e) {
var t, r = this.filters.length, n = [];
for (t = 0; t < r; t += 1)
this.filters[t].type === e && n.push(this.filters[t]);
return n
}
,
SVGBaseElement.prototype = {
initRendererElement: function() {
this.layerElement = createNS("g")
},
createContainerElements: function() {
this.matteElement = createNS("g"),
this.transformedElement = this.layerElement,
this.maskedElement = this.layerElement,
this._sizeChanged = !1;
var e = null;
if (this.data.td) {
this.matteMasks = {};
var t = createNS("g");
t.setAttribute("id", this.layerId),
t.appendChild(this.layerElement),
e = t,
this.globalData.defs.appendChild(t)
} else
this.data.tt ?
(this.matteElement.appendChild(this.layerElement),
e = this.matteElement,
this.baseElement = this.matteElement) :
this.baseElement = this.layerElement;
if (this.data.ln && this.layerElement.setAttribute("id",
this.data.ln),
this.data.cl && this.layerElement.setAttribute("class",
this.data.cl),
0 === this.data.ty && !this.data.hd) {
var r = createNS("clipPath")
, n = createNS("path");
n.setAttribute("d", "M0,0 L" + this.data.w + ",0 L" +
this.data.w + "," + this.data.h + " L0," + this.data.h + "z");
var i = createElementID();
if (r.setAttribute("id", i),
r.appendChild(n),
this.globalData.defs.appendChild(r),
this.checkMasks()) {
var o = createNS("g");
o.setAttribute("clip-path", "url(" +
getLocationHref() + "#" + i + ")"),
o.appendChild(this.layerElement),
this.transformedElement = o,
e ? e.appendChild(this.transformedElement) :
this.baseElement = this.transformedElement
} else
this.layerElement.setAttribute("clip-path", "url("
+ getLocationHref() + "#" + i + ")")
}
0 !== this.data.bm && this.setBlendMode()
},
renderElement: function() {
this.finalTransform._localMatMdf &&
this.transformedElement.setAttribute("transform",
this.finalTransform.localMat.to2dCSS()),
this.finalTransform._opMdf &&
this.transformedElement.setAttribute("opacity", this.finalTransform.localOpacity)
},
destroyBaseElement: function() {
this.layerElement = null,
this.matteElement = null,
this.maskManager.destroy()
},
getBaseElement: function() {
return this.data.hd ? null : this.baseElement
},
createRenderableComponents: function() {
this.maskManager = new
MaskElement(this.data,this,this.globalData),
this.renderableEffectsManager = new SVGEffects(this),
this.searchEffectTransforms()
},
getMatte: function(e) {
if (this.matteMasks || (this.matteMasks = {}),
!this.matteMasks[e]) {
var t, r, n, i, o = this.layerId + "_" + e;
if (1 === e || 3 === e) {
var s = createNS("mask");
s.setAttribute("id", o),
s.setAttribute("mask-type", 3 === e ? "luminance" :
"alpha"),
(n =
createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink", "href", "#" +
this.layerId),
s.appendChild(n),
this.globalData.defs.appendChild(s),
featureSupport.maskType || 1 !== e ||
(s.setAttribute("mask-type", "luminance"),
t = createElementID(),
r = filtersFactory.createFilter(t),
this.globalData.defs.appendChild(r),
r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),
(i = createNS("g")).appendChild(n),
s.appendChild(i),
i.setAttribute("filter", "url(" + getLocationHref()
+ "#" + t + ")"))
} else if (2 === e) {
var a = createNS("mask");
a.setAttribute("id", o),
a.setAttribute("mask-type", "alpha");
var l = createNS("g");
a.appendChild(l),
t = createElementID(),
r = filtersFactory.createFilter(t);
var c = createNS("feComponentTransfer");
c.setAttribute("in", "SourceGraphic"),
r.appendChild(c);
var u = createNS("feFuncA");
u.setAttribute("type", "table"),
u.setAttribute("tableValues", "1.0 0.0"),
c.appendChild(u),
this.globalData.defs.appendChild(r);
var d = createNS("rect");
d.setAttribute("width", this.comp.data.w),
d.setAttribute("height", this.comp.data.h),
d.setAttribute("x", "0"),
d.setAttribute("y", "0"),
d.setAttribute("fill", "#ffffff"),
d.setAttribute("opacity", "0"),
l.setAttribute("filter", "url(" + getLocationHref()
+ "#" + t + ")"),
l.appendChild(d),
(n =
createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink", "href", "#" +
this.layerId),
l.appendChild(n),
featureSupport.maskType || (a.setAttribute("mask-
type", "luminance"),
r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),
i = createNS("g"),
l.appendChild(d),
i.appendChild(this.layerElement),
l.appendChild(i)),
this.globalData.defs.appendChild(a)
}
this.matteMasks[e] = o
}
return this.matteMasks[e]
},
setMatte: function(e) {
this.matteElement && this.matteElement.setAttribute("mask",
"url(" + getLocationHref() + "#" + e + ")")
}
},
HierarchyElement.prototype = {
initHierarchy: function() {
this.hierarchy = [],
this._isParent = !1,
this.checkParenting()
},
setHierarchy: function(e) {
this.hierarchy = e
},
setAsParent: function() {
this._isParent = !0
},
checkParenting: function() {
void 0 !== this.data.parent &&
this.comp.buildElementParenting(this, this.data.parent, [])
}
},
extendPrototype([RenderableElement, createProxyFunction({
initElement: function(e, t, r) {
this.initFrame(),
this.initBaseData(e, t, r),
this.initTransform(e, t, r),
this.initHierarchy(),
this.initRenderable(),
this.initRendererElement(),
this.createContainerElements(),
this.createRenderableComponents(),
this.createContent(),
this.hide()
},
hide: function() {
this.hidden || this.isInRange && !this.isTransparent ||
((this.baseElement || this.layerElement).style.display = "none",
this.hidden = !0)
},
show: function() {
this.isInRange && !this.isTransparent && (this.data.hd ||
((this.baseElement || this.layerElement).style.display = "block"),
this.hidden = !1,
this._isFirstFrame = !0)
},
renderFrame: function() {
this.data.hd || this.hidden || (this.renderTransform(),
this.renderRenderable(),
this.renderLocalTransform(),
this.renderElement(),
this.renderInnerContent(),
this._isFirstFrame && (this._isFirstFrame = !1))
},
renderInnerContent: function() {},
prepareFrame: function(e) {
this._mdf = !1,
this.prepareRenderableFrame(e),
this.prepareProperties(e, this.isInRange),
this.checkTransparency()
},
destroy: function() {
this.innerElem = null,
this.destroyBaseElement()
}
})], RenderableDOMElement),
extendPrototype([BaseElement, TransformElement, SVGBaseElement,
HierarchyElement, FrameElement, RenderableDOMElement], IImageElement),
IImageElement.prototype.createContent = function() {
var e = this.globalData.getAssetsPath(this.assetData);
this.innerElem = createNS("image"),
this.innerElem.setAttribute("width", this.assetData.w + "px"),
this.innerElem.setAttribute("height", this.assetData.h + "px"),
this.innerElem.setAttribute("preserveAspectRatio",
this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio),
this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink",
"href", e),
this.layerElement.appendChild(this.innerElem)
}
,
IImageElement.prototype.sourceRectAtTime = function() {
return this.sourceRect
}
,
IShapeElement.prototype = {
addShapeToModifiers: function(e) {
var t, r = this.shapeModifiers.length;
for (t = 0; t < r; t += 1)
this.shapeModifiers[t].addShape(e)
},
isShapeInAnimatedModifiers: function(e) {
for (var t = this.shapeModifiers.length; 0 < t; )
if (this.shapeModifiers[0].isAnimatedWithShape(e))
return !0;
return !1
},
renderModifiers: function() {
if (this.shapeModifiers.length) {
var e, t = this.shapes.length;
for (e = 0; e < t; e += 1)
this.shapes[e].sh.reset();
for (e = (t = this.shapeModifiers.length) - 1; e >= 0
&& !this.shapeModifiers[e].processShapes(this._isFirstFrame); e -= 1)
;
}
},
searchProcessedElement: function(e) {
for (var t = this.processedElements, r = 0, n = t.length; r
< n; ) {
if (t[r].elem === e)
return t[r].pos;
r += 1
}
return 0
},
addProcessedElement: function(e, t) {
for (var r = this.processedElements, n = r.length; n; )
if (r[n -= 1].elem === e)
return void (r[n].pos = t);
r.push(new ProcessedElement(e,t))
},
prepareFrame: function(e) {
this.prepareRenderableFrame(e),
this.prepareProperties(e, this.isInRange)
}
};
var lineCapEnum = {
1: "butt",
2: "round",
3: "square"
}
, lineJoinEnum = {
1: "miter",
2: "round",
3: "bevel"
};
function SVGShapeData(e, t, r) {
this.caches = [],
this.styles = [],
this.transformers = e,
this.lStr = "",
this.sh = r,
this.lvl = t,
this._isAnimated = !!r.k;
for (var n = 0, i = e.length; n < i; ) {
if (e[n].mProps.dynamicProperties.length) {
this._isAnimated = !0;
break
}
n += 1
}
}
function SVGStyleData(e, t) {
this.data = e,
this.type = e.ty,
this.d = "",
this.lvl = t,
this._mdf = !1,
this.closed = !0 === e.hd,
this.pElem = createNS("path"),
this.msElem = null
}
function DashProperty(e, t, r, n) {
var i;
this.elem = e,
this.frameId = -1,
this.dataProps = createSizedArray(t.length),
this.renderer = r,
this.k = !1,
this.dashStr = "",
this.dashArray = createTypedArray("float32", t.length ?
t.length - 1 : 0),
this.dashoffset = createTypedArray("float32", 1),
this.initDynamicPropertyContainer(n);
var o, s = t.length || 0;
for (i = 0; i < s; i += 1)
o = PropertyFactory.getProp(e, t[i].v, 0, 0, this),
this.k = o.k || this.k,
this.dataProps[i] = {
n: t[i].n,
p: o
};
this.k || this.getValue(!0),
this._isAnimated = this.k
}
function SVGStrokeStyleData(e, t, r) {
this.initDynamicPropertyContainer(e),
this.getValue = this.iterateDynamicProperties,
this.o = PropertyFactory.getProp(e, t.o, 0, .01, this),
this.w = PropertyFactory.getProp(e, t.w, 0, null, this),
this.d = new DashProperty(e,t.d || {},"svg",this),
this.c = PropertyFactory.getProp(e, t.c, 1, 255, this),
this.style = r,
this._isAnimated = !!this._isAnimated
}
function SVGFillStyleData(e, t, r) {
this.initDynamicPropertyContainer(e),
this.getValue = this.iterateDynamicProperties,
this.o = PropertyFactory.getProp(e, t.o, 0, .01, this),
this.c = PropertyFactory.getProp(e, t.c, 1, 255, this),
this.style = r
}
function SVGNoStyleData(e, t, r) {
this.initDynamicPropertyContainer(e),
this.getValue = this.iterateDynamicProperties,
this.style = r
}
function GradientProperty(e, t, r) {
this.data = t,
this.c = createTypedArray("uint8c", 4 * t.p);
var n = t.k.k[0].s ? t.k.k[0].s.length - 4 * t.p : t.k.k.length
- 4 * t.p;
this.o = createTypedArray("float32", n),
this._cmdf = !1,
this._omdf = !1,
this._collapsable = this.checkCollapsable(),
this._hasOpacity = n,
this.initDynamicPropertyContainer(r),
this.prop = PropertyFactory.getProp(e, t.k, 1, null, this),
this.k = this.prop.k,
this.getValue(!0)
}
function SVGGradientFillStyleData(e, t, r) {
this.initDynamicPropertyContainer(e),
this.getValue = this.iterateDynamicProperties,
this.initGradientData(e, t, r)
}
function SVGGradientStrokeStyleData(e, t, r) {
this.initDynamicPropertyContainer(e),
this.getValue = this.iterateDynamicProperties,
this.w = PropertyFactory.getProp(e, t.w, 0, null, this),
this.d = new DashProperty(e,t.d || {},"svg",this),
this.initGradientData(e, t, r),
this._isAnimated = !!this._isAnimated
}
function ShapeGroupData() {
this.it = [],
this.prevViewData = [],
this.gr = createNS("g")
}
function SVGTransformData(e, t, r) {
this.transform = {
mProps: e,
op: t,
container: r
},
this.elements = [],
this._isAnimated =
this.transform.mProps.dynamicProperties.length ||
this.transform.op.effectsSequence.length
}
SVGShapeData.prototype.setAsAnimated = function() {
this._isAnimated = !0
}
,
SVGStyleData.prototype.reset = function() {
this.d = "",
this._mdf = !1
}
,
DashProperty.prototype.getValue = function(e) {
if ((this.elem.globalData.frameId !== this.frameId || e) &&
(this.frameId = this.elem.globalData.frameId,
this.iterateDynamicProperties(),
this._mdf = this._mdf || e,
this._mdf)) {
var t = 0
, r = this.dataProps.length;
for ("svg" === this.renderer && (this.dashStr = ""),
t = 0; t < r; t += 1)
"o" !== this.dataProps[t].n ? "svg" === this.renderer ?
this.dashStr += " " + this.dataProps[t].p.v : this.dashArray[t] =
this.dataProps[t].p.v : this.dashoffset[0] = this.dataProps[t].p.v
}
}
,
extendPrototype([DynamicPropertyContainer], DashProperty),
extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData),
extendPrototype([DynamicPropertyContainer], SVGFillStyleData),
extendPrototype([DynamicPropertyContainer], SVGNoStyleData),
GradientProperty.prototype.comparePoints = function(e, t) {
for (var r = 0, n = this.o.length / 2; r < n; ) {
if (Math.abs(e[4 * r] - e[4 * t + 2 * r]) > .01)
return !1;
r += 1
}
return !0
}
,
GradientProperty.prototype.checkCollapsable = function() {
if (this.o.length / 2 != this.c.length / 4)
return !1;
if (this.data.k.k[0].s)
for (var e = 0, t = this.data.k.k.length; e < t; ) {
if (!this.comparePoints(this.data.k.k[e].s,
this.data.p))
return !1;
e += 1
}
else if (!this.comparePoints(this.data.k.k, this.data.p))
return !1;
return !0
}
,
GradientProperty.prototype.getValue = function(e) {
if (this.prop.getValue(),
this._mdf = !1,
this._cmdf = !1,
this._omdf = !1,
this.prop._mdf || e) {
var t, r, n, i = 4 * this.data.p;
for (t = 0; t < i; t += 1)
r = t % 4 == 0 ? 100 : 255,
n = Math.round(this.prop.v[t] * r),
this.c[t] !== n && (this.c[t] = n,
this._cmdf = !e);
if (this.o.length)
for (i = this.prop.v.length,
t = 4 * this.data.p; t < i; t += 1)
r = t % 2 == 0 ? 100 : 1,
n = t % 2 == 0 ? Math.round(100 * this.prop.v[t]) :
this.prop.v[t],
this.o[t - 4 * this.data.p] !== n && (this.o[t - 4
* this.data.p] = n,
this._omdf = !e);
this._mdf = !e
}
}
,
extendPrototype([DynamicPropertyContainer], GradientProperty),
SVGGradientFillStyleData.prototype.initGradientData = function(e,
t, r) {
this.o = PropertyFactory.getProp(e, t.o, 0, .01, this),
this.s = PropertyFactory.getProp(e, t.s, 1, null, this),
this.e = PropertyFactory.getProp(e, t.e, 1, null, this),
this.h = PropertyFactory.getProp(e, t.h || {
k: 0
}, 0, .01, this),
this.a = PropertyFactory.getProp(e, t.a || {
k: 0
}, 0, degToRads, this),
this.g = new GradientProperty(e,t.g,this),
this.style = r,
this.stops = [],
this.setGradientData(r.pElem, t),
this.setGradientOpacity(t, r),
this._isAnimated = !!this._isAnimated
}
,
SVGGradientFillStyleData.prototype.setGradientData = function(e, t)
{
var r = createElementID()
, n = createNS(1 === t.t ? "linearGradient" :
"radialGradient");
n.setAttribute("id", r),
n.setAttribute("spreadMethod", "pad"),
n.setAttribute("gradientUnits", "userSpaceOnUse");
var i, o, s, a = [];
for (s = 4 * t.g.p,
o = 0; o < s; o += 4)
i = createNS("stop"),
n.appendChild(i),
a.push(i);
e.setAttribute("gf" === t.ty ? "fill" : "stroke", "url(" +
getLocationHref() + "#" + r + ")"),
this.gf = n,
this.cst = a
}
,
SVGGradientFillStyleData.prototype.setGradientOpacity = function(e,
t) {
if (this.g._hasOpacity && !this.g._collapsable) {
var r, n, i, o = createNS("mask"), s = createNS("path");
o.appendChild(s);
var a = createElementID()
, l = createElementID();
o.setAttribute("id", l);
var c = createNS(1 === e.t ? "linearGradient" :
"radialGradient");
c.setAttribute("id", a),
c.setAttribute("spreadMethod", "pad"),
c.setAttribute("gradientUnits", "userSpaceOnUse"),
i = e.g.k.k[0].s ? e.g.k.k[0].s.length : e.g.k.k.length;
var u = this.stops;
for (n = 4 * e.g.p; n < i; n += 2)
(r = createNS("stop")).setAttribute("stop-color",
"rgb(255,255,255)"),
c.appendChild(r),
u.push(r);
s.setAttribute("gf" === e.ty ? "fill" : "stroke", "url(" +
getLocationHref() + "#" + a + ")"),
"gs" === e.ty && (s.setAttribute("stroke-linecap",
lineCapEnum[e.lc || 2]),
s.setAttribute("stroke-linejoin", lineJoinEnum[e.lj || 2]),
1 === e.lj && s.setAttribute("stroke-miterlimit", e.ml)),
this.of = c,
this.ms = o,
this.ost = u,
this.maskId = l,
t.msElem = s
}
}
,
extendPrototype([DynamicPropertyContainer],
SVGGradientFillStyleData),
extendPrototype([SVGGradientFillStyleData,
DynamicPropertyContainer], SVGGradientStrokeStyleData);
var buildShapeString = function(e, t, r, n) {
if (0 === t)
return "";
var i, o = e.o, s = e.i, a = e.v, l = " M" +
n.applyToPointStringified(a[0][0], a[0][1]);
for (i = 1; i < t; i += 1)
l += " C" + n.applyToPointStringified(o[i - 1][0], o[i - 1]
[1]) + " " + n.applyToPointStringified(s[i][0], s[i][1]) + " " +
n.applyToPointStringified(a[i][0], a[i][1]);
return r && t && (l += " C" + n.applyToPointStringified(o[i -
1][0], o[i - 1][1]) + " " + n.applyToPointStringified(s[0][0], s[0][1]) + " " +
n.applyToPointStringified(a[0][0], a[0][1]),
l += "z"),
l
}
, SVGElementsRenderer = function() {
var e = new Matrix
, t = new Matrix;
function r(e, t, r) {
(r || t.transform.op._mdf) &&
t.transform.container.setAttribute("opacity", t.transform.op.v),
(r || t.transform.mProps._mdf) &&
t.transform.container.setAttribute("transform", t.transform.mProps.v.to2dCSS())
}
function n() {}
function i(r, n, i) {
var o, s, a, l, c, u, d, p, h, f, m = n.styles.length, g =
n.lvl;
for (u = 0; u < m; u += 1) {
if (l = n.sh._mdf || i,
n.styles[u].lvl < g) {
for (p = t.reset(),
h = g - n.styles[u].lvl,
f = n.transformers.length - 1; !l && h > 0; )
l = n.transformers[f].mProps._mdf || l,
h -= 1,
f -= 1;
if (l)
for (h = g - n.styles[u].lvl,
f = n.transformers.length - 1; h > 0; )
p.multiply(n.transformers[f].mProps.v),
h -= 1,
f -= 1
} else
p = e;
if (s = (d = n.sh.paths)._length,
l) {
for (a = "",
o = 0; o < s; o += 1)
(c = d.shapes[o]) && c._length && (a +=
buildShapeString(c, c._length, c.c, p));
n.caches[u] = a
} else
a = n.caches[u];
n.styles[u].d += !0 === r.hd ? "" : a,
n.styles[u]._mdf = l || n.styles[u]._mdf
}
}
function o(e, t, r) {
var n = t.style;
(t.c._mdf || r) && n.pElem.setAttribute("fill", "rgb(" +
bmFloor(t.c.v[0]) + "," + bmFloor(t.c.v[1]) + "," + bmFloor(t.c.v[2]) + ")"),
(t.o._mdf || r) && n.pElem.setAttribute("fill-opacity",
t.o.v)
}
function s(e, t, r) {
a(e, t, r),
l(0, t, r)
}
function a(e, t, r) {
var n, i, o, s, a, l = t.gf, c = t.g._hasOpacity, u =
t.s.v, d = t.e.v;
if (t.o._mdf || r) {
var p = "gf" === e.ty ? "fill-opacity" : "stroke-
opacity";
t.style.pElem.setAttribute(p, t.o.v)
}
if (t.s._mdf || r) {
var h = 1 === e.t ? "x1" : "cx"
, f = "x1" === h ? "y1" : "cy";
l.setAttribute(h, u[0]),
l.setAttribute(f, u[1]),
c && !t.g._collapsable && (t.of.setAttribute(h, u[0]),
t.of.setAttribute(f, u[1]))
}
if (t.g._cmdf || r) {
n = t.cst;
var m = t.g.c;
for (o = n.length,
i = 0; i < o; i += 1)
(s = n[i]).setAttribute("offset", m[4 * i] + "%"),
s.setAttribute("stop-color", "rgb(" + m[4 * i + 1]
+ "," + m[4 * i + 2] + "," + m[4 * i + 3] + ")")
}
if (c && (t.g._omdf || r)) {
var g = t.g.o;
for (o = (n = t.g._collapsable ? t.cst : t.ost).length,
i = 0; i < o; i += 1)
s = n[i],
t.g._collapsable || s.setAttribute("offset", g[2 *
i] + "%"),
s.setAttribute("stop-opacity", g[2 * i + 1])
}
if (1 === e.t)
(t.e._mdf || r) && (l.setAttribute("x2", d[0]),
l.setAttribute("y2", d[1]),
c && !t.g._collapsable && (t.of.setAttribute("x2",
d[0]),
t.of.setAttribute("y2", d[1])));
else if ((t.s._mdf || t.e._mdf || r) && (a =
Math.sqrt(Math.pow(u[0] - d[0], 2) + Math.pow(u[1] - d[1], 2)),
l.setAttribute("r", a),
c && !t.g._collapsable && t.of.setAttribute("r", a)),
t.e._mdf || t.h._mdf || t.a._mdf || r) {
a || (a = Math.sqrt(Math.pow(u[0] - d[0], 2) +
Math.pow(u[1] - d[1], 2)));
var y = Math.atan2(d[1] - u[1], d[0] - u[0])
, v = t.h.v;
v >= 1 ? v = .99 : v <= -1 && (v = -.99);
var b = a * v
, x = Math.cos(y + t.a.v) * b + u[0]
, _ = Math.sin(y + t.a.v) * b + u[1];
l.setAttribute("fx", x),
l.setAttribute("fy", _),
c && !t.g._collapsable && (t.of.setAttribute("fx", x),
t.of.setAttribute("fy", _))
}
}
function l(e, t, r) {
var n = t.style
, i = t.d;
i && (i._mdf || r) && i.dashStr &&
(n.pElem.setAttribute("stroke-dasharray", i.dashStr),
n.pElem.setAttribute("stroke-dashoffset",
i.dashoffset[0])),
t.c && (t.c._mdf || r) && n.pElem.setAttribute("stroke",
"rgb(" + bmFloor(t.c.v[0]) + "," + bmFloor(t.c.v[1]) + "," + bmFloor(t.c.v[2]) +
")"),
(t.o._mdf || r) && n.pElem.setAttribute("stroke-opacity",
t.o.v),
(t.w._mdf || r) && (n.pElem.setAttribute("stroke-width",
t.w.v),
n.msElem && n.msElem.setAttribute("stroke-width", t.w.v))
}
return {
createRenderFunction: function(e) {
switch (e.ty) {
case "fl":
return o;
case "gf":
return a;
case "gs":
return s;
case "st":
return l;
case "sh":
case "el":
case "rc":
case "sr":
return i;
case "tr":
return r;
case "no":
return n;
default:
return null
}
}
}
}();
function SVGShapeElement(e, t, r) {
this.shapes = [],
this.shapesData = e.shapes,
this.stylesList = [],
this.shapeModifiers = [],
this.itemsData = [],
this.processedElements = [],
this.animatedContents = [],
this.initElement(e, t, r),
this.prevViewData = []
}
function LetterProps(e, t, r, n, i, o) {
this.o = e,
this.sw = t,
this.sc = r,
this.fc = n,
this.m = i,
this.p = o,
this._mdf = {
o: !0,
sw: !!t,
sc: !!r,
fc: !!n,
m: !0,
p: !0
}
}
function TextProperty(e, t) {
this._frameId = initialDefaultFrame,
this.pv = "",
this.v = "",
this.kf = !1,
this._isFirstFrame = !0,
this._mdf = !1,
t.d && t.d.sid && (t.d =
e.globalData.slotManager.getProp(t.d)),
this.data = t,
this.elem = e,
this.comp = this.elem.comp,
this.keysIndex = 0,
this.canResize = !1,
this.minimumFontSize = 1,
this.effectsSequence = [],
this.currentData = {
ascent: 0,
boxWidth: this.defaultBoxWidth,
f: "",
fStyle: "",
fWeight: "",
fc: "",
j: "",
justifyOffset: "",
l: [],
lh: 0,
lineWidths: [],
ls: "",
of: "",
s: "",
sc: "",
sw: 0,
t: 0,
tr: 0,
sz: 0,
ps: null,
fillColorAnim: !1,
strokeColorAnim: !1,
strokeWidthAnim: !1,
yOffset: 0,
finalSize: 0,
finalText: [],
finalLineHeight: 0,
__complete: !1
},
this.copyData(this.currentData, this.data.d.k[0].s),
this.searchProperty() ||
this.completeTextData(this.currentData)
}
extendPrototype([BaseElement, TransformElement, SVGBaseElement,
IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement],
SVGShapeElement),
SVGShapeElement.prototype.initSecondaryElement = function() {}
,
SVGShapeElement.prototype.identityMatrix = new Matrix,
SVGShapeElement.prototype.buildExpressionInterface = function() {}
,
SVGShapeElement.prototype.createContent = function() {
this.searchShapes(this.shapesData, this.itemsData,
this.prevViewData, this.layerElement, 0, [], !0),
this.filterUniqueShapes()
}
,
SVGShapeElement.prototype.filterUniqueShapes = function() {
var e, t, r, n, i = this.shapes.length, o =
this.stylesList.length, s = [], a = !1;
for (r = 0; r < o; r += 1) {
for (n = this.stylesList[r],
a = !1,
s.length = 0,
e = 0; e < i; e += 1)
-1 !== (t = this.shapes[e]).styles.indexOf(n) &&
(s.push(t),
a = t._isAnimated || a);
s.length > 1 && a && this.setShapesAsAnimated(s)
}
}
,
SVGShapeElement.prototype.setShapesAsAnimated = function(e) {
var t, r = e.length;
for (t = 0; t < r; t += 1)
e[t].setAsAnimated()
}
,
SVGShapeElement.prototype.createStyleElement = function(e, t) {
var r, n = new SVGStyleData(e,t), i = n.pElem;
return "st" === e.ty ? r = new SVGStrokeStyleData(this,e,n) :
"fl" === e.ty ? r = new SVGFillStyleData(this,e,n) : "gf" === e.ty || "gs" === e.ty
? (r = new ("gf" === e.ty ? SVGGradientFillStyleData : SVGGradientStrokeStyleData)
(this,e,n),
this.globalData.defs.appendChild(r.gf),
r.maskId && (this.globalData.defs.appendChild(r.ms),
this.globalData.defs.appendChild(r.of),
i.setAttribute("mask", "url(" + getLocationHref() + "#" +
r.maskId + ")"))) : "no" === e.ty && (r = new SVGNoStyleData(this,e,n)),
"st" !== e.ty && "gs" !== e.ty || (i.setAttribute("stroke-
linecap", lineCapEnum[e.lc || 2]),
i.setAttribute("stroke-linejoin", lineJoinEnum[e.lj || 2]),
i.setAttribute("fill-opacity", "0"),
1 === e.lj && i.setAttribute("stroke-miterlimit", e.ml)),
2 === e.r && i.setAttribute("fill-rule", "evenodd"),
e.ln && i.setAttribute("id", e.ln),
e.cl && i.setAttribute("class", e.cl),
e.bm && (i.style["mix-blend-mode"] = getBlendMode(e.bm)),
this.stylesList.push(n),
this.addToAnimatedContents(e, r),
r
}
,
SVGShapeElement.prototype.createGroupElement = function(e) {
var t = new ShapeGroupData;
return e.ln && t.gr.setAttribute("id", e.ln),
e.cl && t.gr.setAttribute("class", e.cl),
e.bm && (t.gr.style["mix-blend-mode"] = getBlendMode(e.bm)),
t
}
,
SVGShapeElement.prototype.createTransformElement = function(e, t) {
var r = TransformPropertyFactory.getTransformProperty(this, e,
this)
, n = new SVGTransformData(r,r.o,t);
return this.addToAnimatedContents(e, n),
n
}
,
SVGShapeElement.prototype.createShapeElement = function(e, t, r) {
var n = 4;
"rc" === e.ty ? n = 5 : "el" === e.ty ? n = 6 : "sr" === e.ty
&& (n = 7);
var i = new
SVGShapeData(t,r,ShapePropertyFactory.getShapeProp(this, e, n, this));
return this.shapes.push(i),
this.addShapeToModifiers(i),
this.addToAnimatedContents(e, i),
i
}
,
SVGShapeElement.prototype.addToAnimatedContents = function(e, t) {
for (var r = 0, n = this.animatedContents.length; r < n; ) {
if (this.animatedContents[r].element === t)
return;
r += 1
}
this.animatedContents.push({
fn: SVGElementsRenderer.createRenderFunction(e),
element: t,
data: e
})
}
,
SVGShapeElement.prototype.setElementStyles = function(e) {
var t, r = e.styles, n = this.stylesList.length;
for (t = 0; t < n; t += 1)
this.stylesList[t].closed || r.push(this.stylesList[t])
}
,
SVGShapeElement.prototype.reloadShapes = function() {
var e;
this._isFirstFrame = !0;
var t = this.itemsData.length;
for (e = 0; e < t; e += 1)
this.prevViewData[e] = this.itemsData[e];
for (this.searchShapes(this.shapesData, this.itemsData,
this.prevViewData, this.layerElement, 0, [], !0),
this.filterUniqueShapes(),
t = this.dynamicProperties.length,
e = 0; e < t; e += 1)
this.dynamicProperties[e].getValue();
this.renderModifiers()
}
,
SVGShapeElement.prototype.searchShapes = function(e, t, r, n, i, o,
s) {
var a, l, c, u, d, p, h = [].concat(o), f = e.length - 1, m =
[], g = [];
for (a = f; a >= 0; a -= 1) {
if ((p = this.searchProcessedElement(e[a])) ? t[a] = r[p -
1] : e[a]._render = s,
"fl" === e[a].ty || "st" === e[a].ty || "gf" === e[a].ty ||
"gs" === e[a].ty || "no" === e[a].ty)
p ? t[a].style.closed = !1 : t[a] =
this.createStyleElement(e[a], i),
e[a]._render && t[a].style.pElem.parentNode !== n &&
n.appendChild(t[a].style.pElem),
m.push(t[a].style);
else if ("gr" === e[a].ty) {
if (p)
for (c = t[a].it.length,
l = 0; l < c; l += 1)
t[a].prevViewData[l] = t[a].it[l];
else
t[a] = this.createGroupElement(e[a]);
this.searchShapes(e[a].it, t[a].it, t[a].prevViewData,
t[a].gr, i + 1, h, s),
e[a]._render && t[a].gr.parentNode !== n &&
n.appendChild(t[a].gr)
} else
"tr" === e[a].ty ? (p || (t[a] =
this.createTransformElement(e[a], n)),
u = t[a].transform,
h.push(u)) : "sh" === e[a].ty || "rc" === e[a].ty ||
"el" === e[a].ty || "sr" === e[a].ty ? (p || (t[a] = this.createShapeElement(e[a],
h, i)),
this.setElementStyles(t[a])) : "tm" === e[a].ty || "rd"
=== e[a].ty || "ms" === e[a].ty || "pb" === e[a].ty || "zz" === e[a].ty || "op" ===
e[a].ty ? (p ? (d = t[a]).closed = !1 : ((d =
ShapeModifiers.getModifier(e[a].ty)).init(this, e[a]),
t[a] = d,
this.shapeModifiers.push(d)),
g.push(d)) : "rp" === e[a].ty && (p ? (d = t[a]).closed
= !0 : (d = ShapeModifiers.getModifier(e[a].ty),
t[a] = d,
d.init(this, e, a, t),
this.shapeModifiers.push(d),
s = !1),
g.push(d));
this.addProcessedElement(e[a], a + 1)
}
for (f = m.length,
a = 0; a < f; a += 1)
m[a].closed = !0;
for (f = g.length,
a = 0; a < f; a += 1)
g[a].closed = !0
}
,
SVGShapeElement.prototype.renderInnerContent = function() {
var e;
this.renderModifiers();
var t = this.stylesList.length;
for (e = 0; e < t; e += 1)
this.stylesList[e].reset();
for (this.renderShape(),
e = 0; e < t; e += 1)
(this.stylesList[e]._mdf || this._isFirstFrame) &&
(this.stylesList[e].msElem && (this.stylesList[e].msElem.setAttribute("d",
this.stylesList[e].d),
this.stylesList[e].d = "M0 0" + this.stylesList[e].d),
this.stylesList[e].pElem.setAttribute("d",
this.stylesList[e].d || "M0 0"))
}
,
SVGShapeElement.prototype.renderShape = function() {
var e, t, r = this.animatedContents.length;
for (e = 0; e < r; e += 1)
t = this.animatedContents[e],
(this._isFirstFrame || t.element._isAnimated) && !0 !==
t.data && t.fn(t.data, t.element, this._isFirstFrame)
}
,
SVGShapeElement.prototype.destroy = function() {
this.destroyBaseElement(),
this.shapesData = null,
this.itemsData = null
}
,
LetterProps.prototype.update = function(e, t, r, n, i, o) {
this._mdf.o = !1,
this._mdf.sw = !1,
this._mdf.sc = !1,
this._mdf.fc = !1,
this._mdf.m = !1,
this._mdf.p = !1;
var s = !1;
return this.o !== e && (this.o = e,
this._mdf.o = !0,
s = !0),
this.sw !== t && (this.sw = t,
this._mdf.sw = !0,
s = !0),
this.sc !== r && (this.sc = r,
this._mdf.sc = !0,
s = !0),
this.fc !== n && (this.fc = n,
this._mdf.fc = !0,
s = !0),
this.m !== i && (this.m = i,
this._mdf.m = !0,
s = !0),
!o.length || this.p[0] === o[0] && this.p[1] === o[1] &&
this.p[4] === o[4] && this.p[5] === o[5] && this.p[12] === o[12] && this.p[13] ===
o[13] || (this.p = o,
this._mdf.p = !0,
s = !0),
s
}
,
TextProperty.prototype.defaultBoxWidth = [0, 0],
TextProperty.prototype.copyData = function(e, t) {
for (var r in t)
Object.prototype.hasOwnProperty.call(t, r) && (e[r] =
t[r]);
return e
}
,
TextProperty.prototype.setCurrentData = function(e) {
e.__complete || this.completeTextData(e),
this.currentData = e,
this.currentData.boxWidth = this.currentData.boxWidth ||
this.defaultBoxWidth,
this._mdf = !0
}
,
TextProperty.prototype.searchProperty = function() {
return this.searchKeyframes()
}
,
TextProperty.prototype.searchKeyframes = function() {
return this.kf = this.data.d.k.length > 1,
this.kf && this.addEffect(this.getKeyframeValue.bind(this)),
this.kf
}
,
TextProperty.prototype.addEffect = function(e) {
this.effectsSequence.push(e),
this.elem.addDynamicProperty(this)
}
,
TextProperty.prototype.getValue = function(e) {
if (this.elem.globalData.frameId !== this.frameId &&
this.effectsSequence.length || e) {
this.currentData.t = this.data.d.k[this.keysIndex].s.t;
var t = this.currentData
, r = this.keysIndex;
if (this.lock)
this.setCurrentData(this.currentData);
else {
var n;
this.lock = !0,
this._mdf = !1;
var i = this.effectsSequence.length
, o = e || this.data.d.k[this.keysIndex].s;
for (n = 0; n < i; n += 1)
o = r !== this.keysIndex ? this.effectsSequence[n]
(o, o.t) : this.effectsSequence[n](this.currentData, o.t);
t !== o && this.setCurrentData(o),
this.v = this.currentData,
this.pv = this.v,
this.lock = !1,
this.frameId = this.elem.globalData.frameId
}
}
}
,
TextProperty.prototype.getKeyframeValue = function() {
for (var e = this.data.d.k, t = this.elem.comp.renderedFrame, r
= 0, n = e.length; r <= n - 1 && !(r === n - 1 || e[r + 1].t > t); )
r += 1;
return this.keysIndex !== r && (this.keysIndex = r),
this.data.d.k[this.keysIndex].s
}
,
TextProperty.prototype.buildFinalText = function(e) {
for (var t, r, n = [], i = 0, o = e.length, s = !1, a = !1, l =
""; i < o; )
s = a,
a = !1,
t = e.charCodeAt(i),
l = e.charAt(i),
FontManager.isCombinedCharacter(t) ? s = !0 : t >= 55296 &&
t <= 56319 ? FontManager.isRegionalFlag(e, i) ? l = e.substr(i, 14) : (r =
e.charCodeAt(i + 1)) >= 56320 && r <= 57343 && (FontManager.isModifier(t, r) ? (l =
e.substr(i, 2),
s = !0) : l = FontManager.isFlagEmoji(e.substr(i, 4)) ?
e.substr(i, 4) : e.substr(i, 2)) : t > 56319 ? (r = e.charCodeAt(i + 1),
FontManager.isVariationSelector(t) && (s = !0)) :
FontManager.isZeroWidthJoiner(t) && (s = !0,
a = !0),
s ? (n[n.length - 1] += l,
s = !1) : n.push(l),
i += l.length;
return n
}
,
TextProperty.prototype.completeTextData = function(e) {
e.__complete = !0;
var t, r, n, i, o, s, a, l = this.elem.globalData.fontManager,
c = this.data, u = [], d = 0, p = c.m.g, h = 0, f = 0, m = 0, g = [], y = 0, v = 0,
b = l.getFontByName(e.f), x = 0, _ = getFontProperties(b);
e.fWeight = _.weight,
e.fStyle = _.style,
e.finalSize = e.s,
e.finalText = this.buildFinalText(e.t),
r = e.finalText.length,
e.finalLineHeight = e.lh;
var E, T = e.tr / 1e3 * e.finalSize;
if (e.sz)
for (var C, S, $ = !0, w = e.sz[0], P = e.sz[1]; $; ) {
C = 0,
y = 0,
r = (S = this.buildFinalText(e.t)).length,
T = e.tr / 1e3 * e.finalSize;
var R = -1;
for (t = 0; t < r; t += 1)
E = S[t].charCodeAt(0),
n = !1,
" " === S[t] ? R = t : 13 !== E && 3 !== E || (y =
0,
n = !0,
C += e.finalLineHeight || 1.2 * e.finalSize),
l.chars ? (a = l.getCharData(S[t], b.fStyle,
b.fFamily),
x = n ? 0 : a.w * e.finalSize / 100) : x =
l.measureText(S[t], e.f, e.finalSize),
y + x > w && " " !== S[t] ? (-1 === R ? r += 1 : t
= R,
C += e.finalLineHeight || 1.2 * e.finalSize,
S.splice(t, R === t ? 1 : 0, "\r"),
R = -1,
y = 0) : (y += x,
y += T);
C += b.ascent * e.finalSize / 100,
this.canResize && e.finalSize > this.minimumFontSize &&
P < C ? (e.finalSize -= 1,
e.finalLineHeight = e.finalSize * e.lh / e.s) :
(e.finalText = S,
r = e.finalText.length,
$ = !1)
}
y = -T,
x = 0;
var k, A = 0;
for (t = 0; t < r; t += 1)
if (n = !1,
13 === (E = (k = e.finalText[t]).charCodeAt(0)) || 3 ===
E ? (A = 0,
g.push(y),
v = y > v ? y : v,
y = -2 * T,
i = "",
n = !0,
m += 1) : i = k,
l.chars ? (a = l.getCharData(k, b.fStyle,
l.getFontByName(e.f).fFamily),
x = n ? 0 : a.w * e.finalSize / 100) : x = l.measureText(i,
e.f, e.finalSize),
" " === k ? A += x + T : (y += x + T + A,
A = 0),
u.push({
l: x,
an: x,
add: h,
n: n,
anIndexes: [],
val: i,
line: m,
animatorJustifyOffset: 0
}),
2 == p) {
if (h += x,
"" === i || " " === i || t === r - 1) {
for ("" !== i && " " !== i || (h -= x); f <= t; )
u[f].an = h,
u[f].ind = d,
u[f].extra = x,
f += 1;
d += 1,
h = 0
}
} else if (3 == p) {
if (h += x,
"" === i || t === r - 1) {
for ("" === i && (h -= x); f <= t; )
u[f].an = h,
u[f].ind = d,
u[f].extra = x,
f += 1;
h = 0,
d += 1
}
} else
u[d].ind = d,
u[d].extra = 0,
d += 1;
if (e.l = u,
v = y > v ? y : v,
g.push(y),
e.sz)
e.boxWidth = e.sz[0],
e.justifyOffset = 0;
else
switch (e.boxWidth = v,
e.j) {
case 1:
e.justifyOffset = -e.boxWidth;
break;
case 2:
e.justifyOffset = -e.boxWidth / 2;
break;
default:
e.justifyOffset = 0
}
e.lineWidths = g;
var I, O, D, M, L = c.a;
s = L.length;
var j = [];
for (o = 0; o < s; o += 1) {
for ((I = L[o]).a.sc && (e.strokeColorAnim = !0),
I.a.sw && (e.strokeWidthAnim = !0),
(I.a.fc || I.a.fh || I.a.fs || I.a.fb) && (e.fillColorAnim
= !0),
M = 0,
D = I.s.b,
t = 0; t < r; t += 1)
(O = u[t]).anIndexes[o] = M,
(1 == D && "" !== O.val || 2 == D && "" !== O.val && "
" !== O.val || 3 == D && (O.n || " " == O.val || t == r - 1) || 4 == D && (O.n || t
== r - 1)) && (1 === I.s.rn && j.push(M),
M += 1);
c.a[o].s.totalChars = M;
var F, N = -1;
if (1 === I.s.rn)
for (t = 0; t < r; t += 1)
N != (O = u[t]).anIndexes[o] && (N =
O.anIndexes[o],
F = j.splice(Math.floor(Math.random() * j.length),
1)[0]),
O.anIndexes[o] = F
}
e.yOffset = e.finalLineHeight || 1.2 * e.finalSize,
e.ls = e.ls || 0,
e.ascent = b.ascent * e.finalSize / 100
}
,
TextProperty.prototype.updateDocumentData = function(e, t) {
t = void 0 === t ? this.keysIndex : t;
var r = this.copyData({}, this.data.d.k[t].s);
r = this.copyData(r, e),
this.data.d.k[t].s = r,
this.recalculate(t),
this.setCurrentData(r),
this.elem.addDynamicProperty(this)
}
,
TextProperty.prototype.recalculate = function(e) {
var t = this.data.d.k[e].s;
t.__complete = !1,
this.keysIndex = 0,
this._isFirstFrame = !0,
this.getValue(t)
}
,
TextProperty.prototype.canResizeFont = function(e) {
this.canResize = e,
this.recalculate(this.keysIndex),
this.elem.addDynamicProperty(this)
}
,
TextProperty.prototype.setMinimumFontSize = function(e) {
this.minimumFontSize = Math.floor(e) || 1,
this.recalculate(this.keysIndex),
this.elem.addDynamicProperty(this)
}
;
var TextSelectorProp = function() {
var e = Math.max
, t = Math.min
, r = Math.floor;
function n(e, t) {
this._currentTextLength = -1,
this.k = !1,
this.data = t,
this.elem = e,
this.comp = e.comp,
this.finalS = 0,
this.finalE = 0,
this.initDynamicPropertyContainer(e),
this.s = PropertyFactory.getProp(e, t.s || {
k: 0
}, 0, 0, this),
this.e = "e"in t ? PropertyFactory.getProp(e, t.e, 0, 0,
this) : {
v: 100
},
this.o = PropertyFactory.getProp(e, t.o || {
k: 0
}, 0, 0, this),
this.xe = PropertyFactory.getProp(e, t.xe || {
k: 0
}, 0, 0, this),
this.ne = PropertyFactory.getProp(e, t.ne || {
k: 0
}, 0, 0, this),
this.sm = PropertyFactory.getProp(e, t.sm || {
k: 100
}, 0, 0, this),
this.a = PropertyFactory.getProp(e, t.a, 0, .01, this),
this.dynamicProperties.length || this.getValue()
}
return n.prototype = {
getMult: function(n) {
this._currentTextLength !==
this.elem.textProperty.currentData.l.length && this.getValue();
var i = 0
, o = 0
, s = 1
, a = 1;
this.ne.v > 0 ? i = this.ne.v / 100 : o = -this.ne.v /
100,
this.xe.v > 0 ? s = 1 - this.xe.v / 100 : a = 1 +
this.xe.v / 100;
var l = BezierFactory.getBezierEasing(i, o, s, a).get
, c = 0
, u = this.finalS
, d = this.finalE
, p = this.data.sh;
if (2 === p)
c = l(c = d === u ? n >= d ? 1 : 0 : e(0, t(.5 / (d
- u) + (n - u) / (d - u), 1)));
else if (3 === p)
c = l(c = d === u ? n >= d ? 0 : 1 : 1 - e(0,
t(.5 / (d - u) + (n - u) / (d - u), 1)));
else if (4 === p)
d === u ? c = 0 : (c = e(0, t(.5 / (d - u) + (n -
u) / (d - u), 1))) < .5 ? c *= 2 : c = 1 - 2 * (c - .5),
c = l(c);
else if (5 === p) {
if (d === u)
c = 0;
else {
var h = d - u
, f = -h / 2 + (n = t(e(0, n + .5 - u), d -
u))
, m = h / 2;
c = Math.sqrt(1 - f * f / (m * m))
}
c = l(c)
} else
6 === p ? (d === u ? c = 0 : (n = t(e(0, n + .5 -
u), d - u),
c = (1 + Math.cos(Math.PI + 2 * Math.PI * n / (d -
u))) / 2),
c = l(c)) : (n >= r(u) && (c = e(0, t(n - u < 0 ?
t(d, 1) - (u - n) : d - n, 1))),
c = l(c));
if (100 !== this.sm.v) {
var g = .01 * this.sm.v;
0 === g && (g = 1e-8);
var y = .5 - .5 * g;
c < y ? c = 0 : (c = (c - y) / g) > 1 && (c = 1)
}
return c * this.a.v
},
getValue: function(e) {
this.iterateDynamicProperties(),
this._mdf = e || this._mdf,
this._currentTextLength =
this.elem.textProperty.currentData.l.length || 0,
e && 2 === this.data.r && (this.e.v =
this._currentTextLength);
var t = 2 === this.data.r ? 1 : 100 /
this.data.totalChars
, r = this.o.v / t
, n = this.s.v / t + r
, i = this.e.v / t + r;
if (n > i) {
var o = n;
n = i,
i = o
}
this.finalS = n,
this.finalE = i
}
},
extendPrototype([DynamicPropertyContainer], n),
{
getTextSelectorProp: function(e, t, r) {
return new n(e,t)
}
}
}();
function TextAnimatorDataProperty(e, t, r) {
var n = {
propType: !1
}
, i = PropertyFactory.getProp
, o = t.a;
this.a = {
r: o.r ? i(e, o.r, 0, degToRads, r) : n,
rx: o.rx ? i(e, o.rx, 0, degToRads, r) : n,
ry: o.ry ? i(e, o.ry, 0, degToRads, r) : n,
sk: o.sk ? i(e, o.sk, 0, degToRads, r) : n,
sa: o.sa ? i(e, o.sa, 0, degToRads, r) : n,
s: o.s ? i(e, o.s, 1, .01, r) : n,
a: o.a ? i(e, o.a, 1, 0, r) : n,
o: o.o ? i(e, o.o, 0, .01, r) : n,
p: o.p ? i(e, o.p, 1, 0, r) : n,
sw: o.sw ? i(e, o.sw, 0, 0, r) : n,
sc: o.sc ? i(e, o.sc, 1, 0, r) : n,
fc: o.fc ? i(e, o.fc, 1, 0, r) : n,
fh: o.fh ? i(e, o.fh, 0, 0, r) : n,
fs: o.fs ? i(e, o.fs, 0, .01, r) : n,
fb: o.fb ? i(e, o.fb, 0, .01, r) : n,
t: o.t ? i(e, o.t, 0, 0, r) : n
},
this.s = TextSelectorProp.getTextSelectorProp(e, t.s, r),
this.s.t = t.s.t
}
function TextAnimatorProperty(e, t, r) {
this._isFirstFrame = !0,
this._hasMaskedPath = !1,
this._frameId = -1,
this._textData = e,
this._renderType = t,
this._elem = r,
this._animatorsData =
createSizedArray(this._textData.a.length),
this._pathData = {},
this._moreOptions = {
alignment: {}
},
this.renderedLetters = [],
this.lettersChangedFlag = !1,
this.initDynamicPropertyContainer(r)
}
function ITextElement() {}
TextAnimatorProperty.prototype.searchProperties = function() {
var e, t, r = this._textData.a.length, n =
PropertyFactory.getProp;
for (e = 0; e < r; e += 1)
t = this._textData.a[e],
this._animatorsData[e] = new
TextAnimatorDataProperty(this._elem,t,this);
this._textData.p && "m"in this._textData.p ? (this._pathData =
{
a: n(this._elem, this._textData.p.a, 0, 0, this),
f: n(this._elem, this._textData.p.f, 0, 0, this),
l: n(this._elem, this._textData.p.l, 0, 0, this),
r: n(this._elem, this._textData.p.r, 0, 0, this),
p: n(this._elem, this._textData.p.p, 0, 0, this),
m:
this._elem.maskManager.getMaskProperty(this._textData.p.m)
},
this._hasMaskedPath = !0) : this._hasMaskedPath = !1,
this._moreOptions.alignment = n(this._elem, this._textData.m.a,
1, 0, this)
}
,
TextAnimatorProperty.prototype.getMeasures = function(e, t) {
if (this.lettersChangedFlag = t,
this._mdf || this._isFirstFrame || t || this._hasMaskedPath &&
this._pathData.m._mdf) {
this._isFirstFrame = !1;
var r, n, i, o, s, a, l, c, u, d, p, h, f, m, g, y, v, b,
x, _ = this._moreOptions.alignment.v, E = this._animatorsData, T = this._textData,
C = this.mHelper, S = this._renderType, $ = this.renderedLetters.length, w = e.l;
if (this._hasMaskedPath) {
if (x = this._pathData.m,
!this._pathData.n || this._pathData._mdf) {
var P, R = x.v;
for (this._pathData.r.v && (R = R.reverse()),
s = {
tLength: 0,
segments: []
},
o = R._length - 1,
y = 0,
i = 0; i < o; i += 1)
P = bez.buildBezierData(R.v[i], R.v[i + 1],
[R.o[i][0] - R.v[i][0], R.o[i][1] - R.v[i][1]], [R.i[i + 1][0] - R.v[i + 1][0],
R.i[i + 1][1] - R.v[i + 1][1]]),
s.tLength += P.segmentLength,
s.segments.push(P),
y += P.segmentLength;
i = o,
x.v.c && (P = bez.buildBezierData(R.v[i], R.v[0],
[R.o[i][0] - R.v[i][0], R.o[i][1] - R.v[i][1]], [R.i[0][0] - R.v[0][0], R.i[0][1] -
R.v[0][1]]),
s.tLength += P.segmentLength,
s.segments.push(P),
y += P.segmentLength),
this._pathData.pi = s
}
if (s = this._pathData.pi,
a = this._pathData.f.v,
p = 0,
d = 1,
c = 0,
u = !0,
m = s.segments,
a < 0 && x.v.c)
for (s.tLength < Math.abs(a) && (a = -Math.abs(a) %
s.tLength),
d = (f = m[p = m.length - 1].points).length - 1; a
< 0; )
a += f[d].partialLength,
(d -= 1) < 0 && (d = (f = m[p -=
1].points).length - 1);
h = (f = m[p].points)[d - 1],
g = (l = f[d]).partialLength
}
o = w.length,
r = 0,
n = 0;
var k, A, I, O, D, M = 1.2 * e.finalSize * .714, L = !0;
I = E.length;
var j, F, N, B, z, U, V, H, G, W, Y, K, X = -1, q = a, Z =
p, Q = d, J = -1, ee = "", te = this.defaultPropsArray;
if (2 === e.j || 1 === e.j) {
var re = 0
, ne = 0
, ie = 2 === e.j ? -.5 : -1
, oe = 0
, se = !0;
for (i = 0; i < o; i += 1)
if (w[i].n) {
for (re && (re += ne); oe < i; )
w[oe].animatorJustifyOffset = re,
oe += 1;
re = 0,
se = !0
} else {
for (A = 0; A < I; A += 1)
(k = E[A].a).t.propType && (se && 2 === e.j
&& (ne += k.t.v * ie),
(D = E[A].s.getMult(w[i].anIndexes[A],
T.a[A].s.totalChars)).length ? re += k.t.v * D[0] * ie : re += k.t.v * D * ie);
se = !1
}
for (re && (re += ne); oe < i; )
w[oe].animatorJustifyOffset = re,
oe += 1
}
for (i = 0; i < o; i += 1) {
if (C.reset(),
B = 1,
w[i].n)
r = 0,
n += e.yOffset,
n += L ? 1 : 0,
a = q,
L = !1,
this._hasMaskedPath && (d = Q,
h = (f = m[p = Z].points)[d - 1],
g = (l = f[d]).partialLength,
c = 0),
ee = "",
Y = "",
G = "",
K = "",
te = this.defaultPropsArray;
else {
if (this._hasMaskedPath) {
if (J !== w[i].line) {
switch (e.j) {
case 1:
a += y - e.lineWidths[w[i].line];
break;
case 2:
a += (y - e.lineWidths[w[i].line]) / 2
}
J = w[i].line
}
X !== w[i].ind && (w[X] && (a += w[X].extra),
a += w[i].an / 2,
X = w[i].ind),
a += _[0] * w[i].an * .005;
var ae = 0;
for (A = 0; A < I; A += 1)
(k = E[A].a).p.propType && ((D =
E[A].s.getMult(w[i].anIndexes[A], T.a[A].s.totalChars)).length ? ae += k.p.v[0] *
D[0] : ae += k.p.v[0] * D),
k.a.propType && ((D =
E[A].s.getMult(w[i].anIndexes[A], T.a[A].s.totalChars)).length ? ae += k.a.v[0] *
D[0] : ae += k.a.v[0] * D);
for (u = !0,
this._pathData.a.v && (a = .5 * w[0].an + (y -
this._pathData.f.v - .5 * w[0].an - .5 * w[w.length - 1].an) * X / (o - 1),
a += this._pathData.f.v); u; )
c + g >= a + ae || !f ? (v = (a + ae - c) /
l.partialLength,
F = h.point[0] + (l.point[0] - h.point[0])
* v,
N = h.point[1] + (l.point[1] - h.point[1])
* v,
C.translate(-_[0] * w[i].an * .005, -_[1] *
M * .01),
u = !1) : f && (c += l.partialLength,
(d += 1) >= f.length && (d = 0,
m[p += 1] ? f = m[p].points : x.v.c ? (d =
0,
f = m[p = 0].points) : (c -=
l.partialLength,
f = null)),
f && (h = l,
g = (l = f[d]).partialLength));
j = w[i].an / 2 - w[i].add,
C.translate(-j, 0, 0)
} else
j = w[i].an / 2 - w[i].add,
C.translate(-j, 0, 0),
C.translate(-_[0] * w[i].an * .005, -_[1] * M *
.01, 0);
for (A = 0; A < I; A += 1)
(k = E[A].a).t.propType && (D =
E[A].s.getMult(w[i].anIndexes[A], T.a[A].s.totalChars),
0 === r && 0 === e.j || (this._hasMaskedPath ?
D.length ? a += k.t.v * D[0] : a += k.t.v * D : D.length ? r += k.t.v * D[0] : r +=
k.t.v * D));
for (e.strokeWidthAnim && (U = e.sw || 0),
e.strokeColorAnim && (z = e.sc ? [e.sc[0], e.sc[1],
e.sc[2]] : [0, 0, 0]),
e.fillColorAnim && e.fc && (V = [e.fc[0], e.fc[1],
e.fc[2]]),
A = 0; A < I; A += 1)
(k = E[A].a).a.propType && ((D =
E[A].s.getMult(w[i].anIndexes[A], T.a[A].s.totalChars)).length ? C.translate(-
k.a.v[0] * D[0], -k.a.v[1] * D[1], k.a.v[2] * D[2]) : C.translate(-k.a.v[0] * D, -
k.a.v[1] * D, k.a.v[2] * D));
for (A = 0; A < I; A += 1)
(k = E[A].a).s.propType && ((D =
E[A].s.getMult(w[i].anIndexes[A], T.a[A].s.totalChars)).length ? C.scale(1 +
(k.s.v[0] - 1) * D[0], 1 + (k.s.v[1] - 1) * D[1], 1) : C.scale(1 + (k.s.v[0] - 1) *
D, 1 + (k.s.v[1] - 1) * D, 1));
for (A = 0; A < I; A += 1) {
if (k = E[A].a,
D = E[A].s.getMult(w[i].anIndexes[A],
T.a[A].s.totalChars),
k.sk.propType && (D.length ? C.skewFromAxis(-
k.sk.v * D[0], k.sa.v * D[1]) : C.skewFromAxis(-k.sk.v * D, k.sa.v * D)),
k.r.propType && (D.length ? C.rotateZ(-k.r.v *
D[2]) : C.rotateZ(-k.r.v * D)),
k.ry.propType && (D.length ? C.rotateY(k.ry.v *
D[1]) : C.rotateY(k.ry.v * D)),
k.rx.propType && (D.length ? C.rotateX(k.rx.v *
D[0]) : C.rotateX(k.rx.v * D)),
k.o.propType && (D.length ? B += (k.o.v * D[0]
- B) * D[0] : B += (k.o.v * D - B) * D),
e.strokeWidthAnim && k.sw.propType && (D.length
? U += k.sw.v * D[0] : U += k.sw.v * D),
e.strokeColorAnim && k.sc.propType)
for (H = 0; H < 3; H += 1)
D.length ? z[H] += (k.sc.v[H] - z[H]) *
D[0] : z[H] += (k.sc.v[H] - z[H]) * D;
if (e.fillColorAnim && e.fc) {
if (k.fc.propType)
for (H = 0; H < 3; H += 1)
D.length ? V[H] += (k.fc.v[H] -
V[H]) * D[0] : V[H] += (k.fc.v[H] - V[H]) * D;
k.fh.propType && (V = D.length ?
addHueToRGB(V, k.fh.v * D[0]) : addHueToRGB(V, k.fh.v * D)),
k.fs.propType && (V = D.length ?
addSaturationToRGB(V, k.fs.v * D[0]) : addSaturationToRGB(V, k.fs.v * D)),
k.fb.propType && (V = D.length ?
addBrightnessToRGB(V, k.fb.v * D[0]) : addBrightnessToRGB(V, k.fb.v * D))
}
}
for (A = 0; A < I; A += 1)
(k = E[A].a).p.propType && (D =
E[A].s.getMult(w[i].anIndexes[A], T.a[A].s.totalChars),
this._hasMaskedPath ? D.length ? C.translate(0,
k.p.v[1] * D[0], -k.p.v[2] * D[1]) : C.translate(0, k.p.v[1] * D, -k.p.v[2] * D) :
D.length ? C.translate(k.p.v[0] * D[0], k.p.v[1] * D[1], -k.p.v[2] * D[2]) :
C.translate(k.p.v[0] * D, k.p.v[1] * D, -k.p.v[2] * D));
if (e.strokeWidthAnim && (G = U < 0 ? 0 : U),
e.strokeColorAnim && (W = "rgb(" + Math.round(255 *
z[0]) + "," + Math.round(255 * z[1]) + "," + Math.round(255 * z[2]) + ")"),
e.fillColorAnim && e.fc && (Y = "rgb(" +
Math.round(255 * V[0]) + "," + Math.round(255 * V[1]) + "," + Math.round(255 *
V[2]) + ")"),
this._hasMaskedPath) {
if (C.translate(0, -e.ls),
C.translate(0, _[1] * M * .01 + n, 0),
this._pathData.p.v) {
b = (l.point[1] - h.point[1]) / (l.point[0]
- h.point[0]);
var le = 180 * Math.atan(b) / Math.PI;
l.point[0] < h.point[0] && (le += 180),
C.rotate(-le * Math.PI / 180)
}
C.translate(F, N, 0),
a -= _[0] * w[i].an * .005,
w[i + 1] && X !== w[i + 1].ind && (a += w[i].an
/ 2,
a += .001 * e.tr * e.finalSize)
} else {
switch (C.translate(r, n, 0),
e.ps && C.translate(e.ps[0], e.ps[1] +
e.ascent, 0),
e.j) {
case 1:
C.translate(w[i].animatorJustifyOffset +
e.justifyOffset + (e.boxWidth - e.lineWidths[w[i].line]), 0, 0);
break;
case 2:
C.translate(w[i].animatorJustifyOffset +
e.justifyOffset + (e.boxWidth - e.lineWidths[w[i].line]) / 2, 0, 0)
}
C.translate(0, -e.ls),
C.translate(j, 0, 0),
C.translate(_[0] * w[i].an * .005, _[1] * M
* .01, 0),
r += w[i].l + .001 * e.tr * e.finalSize
}
"html" === S ? ee = C.toCSS() : "svg" === S ? ee =
C.to2dCSS() : te = [C.props[0], C.props[1], C.props[2], C.props[3], C.props[4],
C.props[5], C.props[6], C.props[7], C.props[8], C.props[9], C.props[10],
C.props[11], C.props[12], C.props[13], C.props[14], C.props[15]],
K = B
}
$ <= i ? (O = new LetterProps(K,G,W,Y,ee,te),
this.renderedLetters.push(O),
$ += 1,
this.lettersChangedFlag = !0) : (O =
this.renderedLetters[i],
this.lettersChangedFlag = O.update(K, G, W, Y, ee, te)
|| this.lettersChangedFlag)
}
}
}
,
TextAnimatorProperty.prototype.getValue = function() {
this._elem.globalData.frameId !== this._frameId &&
(this._frameId = this._elem.globalData.frameId,
this.iterateDynamicProperties())
}
,
TextAnimatorProperty.prototype.mHelper = new Matrix,
TextAnimatorProperty.prototype.defaultPropsArray = [],
extendPrototype([DynamicPropertyContainer], TextAnimatorProperty),
ITextElement.prototype.initElement = function(e, t, r) {
this.lettersChangedFlag = !0,
this.initFrame(),
this.initBaseData(e, t, r),
this.textProperty = new
TextProperty(this,e.t,this.dynamicProperties),
this.textAnimator = new
TextAnimatorProperty(e.t,this.renderType,this),
this.initTransform(e, t, r),
this.initHierarchy(),
this.initRenderable(),
this.initRendererElement(),
this.createContainerElements(),
this.createRenderableComponents(),
this.createContent(),
this.hide(),
this.textAnimator.searchProperties(this.dynamicProperties)
}
,
ITextElement.prototype.prepareFrame = function(e) {
this._mdf = !1,
this.prepareRenderableFrame(e),
this.prepareProperties(e, this.isInRange)
}
,
ITextElement.prototype.createPathShape = function(e, t) {
var r, n, i = t.length, o = "";
for (r = 0; r < i; r += 1)
"sh" === t[r].ty && (n = t[r].ks.k,
o += buildShapeString(n, n.i.length, !0, e));
return o
}
,
ITextElement.prototype.updateDocumentData = function(e, t) {
this.textProperty.updateDocumentData(e, t)
}
,
ITextElement.prototype.canResizeFont = function(e) {
this.textProperty.canResizeFont(e)
}
,
ITextElement.prototype.setMinimumFontSize = function(e) {
this.textProperty.setMinimumFontSize(e)
}
,
ITextElement.prototype.applyTextPropertiesToMatrix = function(e, t,
r, n, i) {
switch (e.ps && t.translate(e.ps[0], e.ps[1] + e.ascent, 0),
t.translate(0, -e.ls, 0),
e.j) {
case 1:
t.translate(e.justifyOffset + (e.boxWidth -
e.lineWidths[r]), 0, 0);
break;
case 2:
t.translate(e.justifyOffset + (e.boxWidth -
e.lineWidths[r]) / 2, 0, 0)
}
t.translate(n, i, 0)
}
,
ITextElement.prototype.buildColor = function(e) {
return "rgb(" + Math.round(255 * e[0]) + "," + Math.round(255 *
e[1]) + "," + Math.round(255 * e[2]) + ")"
}
,
ITextElement.prototype.emptyProp = new LetterProps,
ITextElement.prototype.destroy = function() {}
,
ITextElement.prototype.validateText = function() {
(this.textProperty._mdf || this.textProperty._isFirstFrame) &&
(this.buildNewText(),
this.textProperty._isFirstFrame = !1,
this.textProperty._mdf = !1)
}
;
var emptyShapeData = {
shapes: []
};
function SVGTextLottieElement(e, t, r) {
this.textSpans = [],
this.renderType = "svg",
this.initElement(e, t, r)
}
function ISolidElement(e, t, r) {
this.initElement(e, t, r)
}
function NullElement(e, t, r) {
this.initFrame(),
this.initBaseData(e, t, r),
this.initFrame(),
this.initTransform(e, t, r),
this.initHierarchy()
}
function SVGRendererBase() {}
function ICompElement() {}
function SVGCompElement(e, t, r) {
this.layers = e.layers,
this.supports3d = !0,
this.completeLayers = !1,
this.pendingElements = [],
this.elements = this.layers ?
createSizedArray(this.layers.length) : [],
this.initElement(e, t, r),
this.tm = e.tm ? PropertyFactory.getProp(this, e.tm, 0,
t.frameRate, this) : {
_placeholder: !0
}
}
function SVGRenderer(e, t) {
this.animationItem = e,
this.layers = null,
this.renderedFrame = -1,
this.svgElement = createNS("svg");
var r = "";
if (t && t.title) {
var n = createNS("title")
, i = createElementID();
n.setAttribute("id", i),
n.textContent = t.title,
this.svgElement.appendChild(n),
r += i
}
if (t && t.description) {
var o = createNS("desc")
, s = createElementID();
o.setAttribute("id", s),
o.textContent = t.description,
this.svgElement.appendChild(o),
r += " " + s
}
r && this.svgElement.setAttribute("aria-labelledby", r);
var a = createNS("defs");
this.svgElement.appendChild(a);
var l = createNS("g");
this.svgElement.appendChild(l),
this.layerElement = l,
this.renderConfig = {
preserveAspectRatio: t && t.preserveAspectRatio ||
"xMidYMid meet",
imagePreserveAspectRatio: t && t.imagePreserveAspectRatio
|| "xMidYMid slice",
contentVisibility: t && t.contentVisibility || "visible",
progressiveLoad: t && t.progressiveLoad || !1,
hideOnTransparent: !(t && !1 === t.hideOnTransparent),
viewBoxOnly: t && t.viewBoxOnly || !1,
viewBoxSize: t && t.viewBoxSize || !1,
className: t && t.className || "",
id: t && t.id || "",
focusable: t && t.focusable,
filterSize: {
width: t && t.filterSize && t.filterSize.width ||
"100%",
height: t && t.filterSize && t.filterSize.height ||
"100%",
x: t && t.filterSize && t.filterSize.x || "0%",
y: t && t.filterSize && t.filterSize.y || "0%"
},
width: t && t.width,
height: t && t.height,
runExpressions: !t || void 0 === t.runExpressions ||
t.runExpressions
},
this.globalData = {
_mdf: !1,
frameNum: -1,
defs: a,
renderConfig: this.renderConfig
},
this.elements = [],
this.pendingElements = [],
this.destroyed = !1,
this.rendererType = "svg"
}
function ShapeTransformManager() {
this.sequences = {},
this.sequenceList = [],
this.transform_key_count = 0
}
extendPrototype([BaseElement, TransformElement, SVGBaseElement,
HierarchyElement, FrameElement, RenderableDOMElement, ITextElement],
SVGTextLottieElement),
SVGTextLottieElement.prototype.createContent = function() {
this.data.singleShape && !this.globalData.fontManager.chars &&
(this.textContainer = createNS("text"))
}
,
SVGTextLottieElement.prototype.buildTextContents = function(e) {
for (var t = 0, r = e.length, n = [], i = ""; t < r; )
e[t] === String.fromCharCode(13) || e[t] ===
String.fromCharCode(3) ? (n.push(i),
i = "") : i += e[t],
t += 1;
return n.push(i),
n
}
,
SVGTextLottieElement.prototype.buildShapeData = function(e, t) {
if (e.shapes && e.shapes.length) {
var r = e.shapes[0];
if (r.it) {
var n = r.it[r.it.length - 1];
n.s && (n.s.k[0] = t,
n.s.k[1] = t)
}
}
return e
}
,
SVGTextLottieElement.prototype.buildNewText = function() {
var e, t;
this.addDynamicProperty(this);
var r = this.textProperty.currentData;
this.renderedLetters = createSizedArray(r ? r.l.length : 0),
r.fc ? this.layerElement.setAttribute("fill",
this.buildColor(r.fc)) : this.layerElement.setAttribute("fill", "rgba(0,0,0,0)"),
r.sc && (this.layerElement.setAttribute("stroke",
this.buildColor(r.sc)),
this.layerElement.setAttribute("stroke-width", r.sw)),
this.layerElement.setAttribute("font-size", r.finalSize);
var n = this.globalData.fontManager.getFontByName(r.f);
if (n.fClass)
this.layerElement.setAttribute("class", n.fClass);
else {
this.layerElement.setAttribute("font-family", n.fFamily);
var i = r.fWeight
, o = r.fStyle;
this.layerElement.setAttribute("font-style", o),
this.layerElement.setAttribute("font-weight", i)
}
this.layerElement.setAttribute("aria-label", r.t);
var s, a = r.l || [], l = !!this.globalData.fontManager.chars;
t = a.length;
var c = this.mHelper
, u = this.data.singleShape
, d = 0
, p = 0
, h = !0
, f = .001 * r.tr * r.finalSize;
if (!u || l || r.sz) {
var m, g = this.textSpans.length;
for (e = 0; e < t; e += 1) {
if (this.textSpans[e] || (this.textSpans[e] = {
span: null,
childSpan: null,
glyph: null
}),
!l || !u || 0 === e) {
if (s = g > e ? this.textSpans[e].span : createNS(l
? "g" : "text"),
g <= e) {
if (s.setAttribute("stroke-linecap", "butt"),
s.setAttribute("stroke-linejoin", "round"),
s.setAttribute("stroke-miterlimit", "4"),
this.textSpans[e].span = s,
l) {
var y = createNS("g");
s.appendChild(y),
this.textSpans[e].childSpan = y
}
this.textSpans[e].span = s,
this.layerElement.appendChild(s)
}
s.style.display = "inherit"
}
if (c.reset(),
u && (a[e].n && (d = -f,
p += r.yOffset,
p += h ? 1 : 0,
h = !1),
this.applyTextPropertiesToMatrix(r, c, a[e].line, d,
p),
d += a[e].l || 0,
d += f),
l) {
var v;
if (1 === (m =
this.globalData.fontManager.getCharData(r.finalText[e], n.fStyle,
this.globalData.fontManager.getFontByName(r.f).fFamily)).t)
v = new
SVGCompElement(m.data,this.globalData,this);
else {
var b = emptyShapeData;
m.data && m.data.shapes && (b =
this.buildShapeData(m.data, r.finalSize)),
v = new SVGShapeElement(b,this.globalData,this)
}
if (this.textSpans[e].glyph) {
var x = this.textSpans[e].glyph;
this.textSpans[e].childSpan.removeChild(x.layerElement),
x.destroy()
}
this.textSpans[e].glyph = v,
v._debug = !0,
v.prepareFrame(0),
v.renderFrame(),
this.textSpans[e].childSpan.appendChild(v.layerElement),
1 === m.t &&
this.textSpans[e].childSpan.setAttribute("transform", "scale(" + r.finalSize / 100
+ "," + r.finalSize / 100 + ")")
} else
u && s.setAttribute("transform", "translate(" +
c.props[12] + "," + c.props[13] + ")"),
s.textContent = a[e].val,
e.finalTransform.multiply(e.transforms[r].transform.mProps.v);
e._mdf = i
},
processSequences: function(e) {
var t, r = this.sequenceList.length;
for (t = 0; t < r; t += 1)
this.processSequence(this.sequenceList[t], e)
},
getNewKey: function() {
return this.transform_key_count += 1,
"_" + this.transform_key_count
}
};
var lumaLoader = function() {
var e = "__lottie_element_luma_buffer"
, t = null
, r = null
, n = null;
function i() {
var i, o, s;
t || (i = createNS("svg"),
o = createNS("filter"),
s = createNS("feColorMatrix"),
o.setAttribute("id", e),
s.setAttribute("type", "matrix"),
s.setAttribute("color-interpolation-filters", "sRGB"),
s.setAttribute("values", "0.3, 0.3, 0.3, 0, 0, 0.3, 0.3,
0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),
o.appendChild(s),
i.appendChild(o),
i.setAttribute("id", e + "_svg"),
featureSupport.svgLumaHidden && (i.style.display = "none"),
n = i,
document.body.appendChild(n),
t = createTag("canvas"),
(r = t.getContext("2d")).filter = "url(#" + e + ")",
r.fillStyle = "rgba(0,0,0,0)",
r.fillRect(0, 0, 1, 1))
}
return {
load: i,
get: function(n) {
return t || i(),
t.width = n.width,
t.height = n.height,
r.filter = "url(#" + e + ")",
t
}
}
};
function createCanvas(e, t) {
if (featureSupport.offscreenCanvas)
return new OffscreenCanvas(e,t);
var r = createTag("canvas");
return r.width = e,
r.height = t,
r
}
var assetLoader = {
loadLumaCanvas: lumaLoader.load,
getLumaCanvas: lumaLoader.get,
createCanvas: createCanvas
}
, registeredEffects = {};
function CVEffects(e) {
var t, r, n = e.data.ef ? e.data.ef.length : 0;
for (this.filters = [],
t = 0; t < n; t += 1) {
r = null;
var i = e.data.ef[t].ty;
registeredEffects[i] && (r = new (0,
registeredEffects[i].effect)
(e.effectsManager.effectElements[t],e)),
r && this.filters.push(r)
}
this.filters.length && e.addRenderableComponent(this)
}
function registerEffect(e, t) {
registeredEffects[e] = {
effect: t
}
}
function CVMaskElement(e, t) {
var r;
this.data = e,
this.element = t,
this.masksProperties = this.data.masksProperties || [],
this.viewData = createSizedArray(this.masksProperties.length);
var n = this.masksProperties.length
, i = !1;
for (r = 0; r < n; r += 1)
"n" !== this.masksProperties[r].mode && (i = !0),
this.viewData[r] =
ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[r], 3);
this.hasMasks = i,
i && this.element.addRenderableComponent(this)
}
function CVBaseElement() {}
CVEffects.prototype.renderFrame = function(e) {
var t, r = this.filters.length;
for (t = 0; t < r; t += 1)
this.filters[t].renderFrame(e)
}
,
CVEffects.prototype.getEffects = function(e) {
var t, r = this.filters.length, n = [];
for (t = 0; t < r; t += 1)
this.filters[t].type === e && n.push(this.filters[t]);
return n
}
,
CVMaskElement.prototype.renderFrame = function() {
if (this.hasMasks) {
var e, t, r, n, i = this.element.finalTransform.mat, o =
this.element.canvasContext, s = this.masksProperties.length;
for (o.beginPath(),
e = 0; e < s; e += 1)
if ("n" !== this.masksProperties[e].mode) {
var a;
this.masksProperties[e].inv && (o.moveTo(0, 0),
o.lineTo(this.element.globalData.compSize.w, 0),
o.lineTo(this.element.globalData.compSize.w,
this.element.globalData.compSize.h),
o.lineTo(0, this.element.globalData.compSize.h),
o.lineTo(0, 0)),
n = this.viewData[e].v,
t = i.applyToPointArray(n.v[0][0], n.v[0][1], 0),
o.moveTo(t[0], t[1]);
var l = n._length;
for (a = 1; a < l; a += 1)
r = i.applyToTriplePoints(n.o[a - 1], n.i[a],
n.v[a]),
o.bezierCurveTo(r[0], r[1], r[2], r[3], r[4],
r[5]);
r = i.applyToTriplePoints(n.o[a - 1], n.i[0],
n.v[0]),
o.bezierCurveTo(r[0], r[1], r[2], r[3], r[4], r[5])
}
this.element.globalData.renderer.save(!0),
o.clip()
}
}
,
CVMaskElement.prototype.getMaskProperty =
MaskElement.prototype.getMaskProperty,
CVMaskElement.prototype.destroy = function() {
this.element = null
}
;
var operationsMap = {
1: "source-in",
2: "source-out",
3: "source-in",
4: "source-out"
};
function CVShapeData(e, t, r, n) {
this.styledShapes = [],
this.tr = [0, 0, 0, 0, 0, 0];
var i, o = 4;
"rc" === t.ty ? o = 5 : "el" === t.ty ? o = 6 : "sr" === t.ty
&& (o = 7),
this.sh = ShapePropertyFactory.getShapeProp(e, t, o, e);
var s, a = r.length;
for (i = 0; i < a; i += 1)
r[i].closed || (s = {
transforms: n.addTransformSequence(r[i].transforms),
trNodes: []
},
this.styledShapes.push(s),
r[i].elements.push(s))
}
function CVShapeElement(e, t, r) {
this.shapes = [],
this.shapesData = e.shapes,
this.stylesList = [],
this.itemsData = [],
this.prevViewData = [],
this.shapeModifiers = [],
this.processedElements = [],
this.transformsManager = new ShapeTransformManager,
this.initElement(e, t, r)
}
function CVTextElement(e, t, r) {
this.textSpans = [],
this.yOffset = 0,
this.fillColorAnim = !1,
this.strokeColorAnim = !1,
this.strokeWidthAnim = !1,
this.stroke = !1,
this.fill = !1,
this.justifyOffset = 0,
this.currentRender = null,
this.renderType = "canvas",
this.values = {
fill: "rgba(0,0,0,0)",
stroke: "rgba(0,0,0,0)",
sWidth: 0,
fValue: ""
},
this.initElement(e, t, r)
}
function CVImageElement(e, t, r) {
this.assetData = t.getAssetData(e.refId),
this.img = t.imageLoader.getAsset(this.assetData),
this.initElement(e, t, r)
}
function CVSolidElement(e, t, r) {
this.initElement(e, t, r)
}
function CanvasRendererBase() {}
function CanvasContext() {
this.opacity = -1,
this.transform = createTypedArray("float32", 16),
this.fillStyle = "",
this.strokeStyle = "",
this.lineWidth = "",
this.lineCap = "",
this.lineJoin = "",
this.miterLimit = "",
this.id = Math.random()
}
function CVContextData() {
var e;
for (this.stack = [],
this.cArrPos = 0,
this.cTr = new Matrix,
e = 0; e < 15; e += 1) {
var t = new CanvasContext;
this.stack[e] = t
}
this._length = 15,
this.nativeContext = null,
this.transformMat = new Matrix,
this.currentOpacity = 1,
this.currentFillStyle = "",
this.appliedFillStyle = "",
this.currentStrokeStyle = "",
this.appliedStrokeStyle = "",
this.currentLineWidth = "",
this.appliedLineWidth = "",
this.currentLineCap = "",
this.appliedLineCap = "",
this.currentLineJoin = "",
this.appliedLineJoin = "",
this.appliedMiterLimit = "",
this.currentMiterLimit = ""
}
function CVCompElement(e, t, r) {
this.completeLayers = !1,
this.layers = e.layers,
this.pendingElements = [],
this.elements = createSizedArray(this.layers.length),
this.initElement(e, t, r),
this.tm = e.tm ? PropertyFactory.getProp(this, e.tm, 0,
t.frameRate, this) : {
_placeholder: !0
}
}
function CanvasRenderer(e, t) {
this.animationItem = e,
this.renderConfig = {
clearCanvas: !t || void 0 === t.clearCanvas ||
t.clearCanvas,
context: t && t.context || null,
progressiveLoad: t && t.progressiveLoad || !1,
preserveAspectRatio: t && t.preserveAspectRatio ||
"xMidYMid meet",
imagePreserveAspectRatio: t && t.imagePreserveAspectRatio
|| "xMidYMid slice",
contentVisibility: t && t.contentVisibility || "visible",
className: t && t.className || "",
id: t && t.id || "",
runExpressions: !t || void 0 === t.runExpressions ||
t.runExpressions
},
this.renderConfig.dpr = t && t.dpr || 1,
this.animationItem.wrapper && (this.renderConfig.dpr = t &&
t.dpr || window.devicePixelRatio || 1),
this.renderedFrame = -1,
this.globalData = {
frameNum: -1,
_mdf: !1,
renderConfig: this.renderConfig,
currentGlobalAlpha: -1
},
this.contextData = new CVContextData,
this.elements = [],
this.pendingElements = [],
this.transformMat = new Matrix,
this.completeLayers = !1,
this.rendererType = "canvas",
this.renderConfig.clearCanvas && (this.ctxTransform =
this.contextData.transform.bind(this.contextData),
this.ctxOpacity =
this.contextData.opacity.bind(this.contextData),
this.ctxFillStyle =
this.contextData.fillStyle.bind(this.contextData),
this.ctxStrokeStyle =
this.contextData.strokeStyle.bind(this.contextData),
this.ctxLineWidth =
this.contextData.lineWidth.bind(this.contextData),
this.ctxLineCap =
this.contextData.lineCap.bind(this.contextData),
this.ctxLineJoin =
this.contextData.lineJoin.bind(this.contextData),
this.ctxMiterLimit =
this.contextData.miterLimit.bind(this.contextData),
this.ctxFill = this.contextData.fill.bind(this.contextData),
this.ctxFillRect =
this.contextData.fillRect.bind(this.contextData),
this.ctxStroke =
this.contextData.stroke.bind(this.contextData),
this.save = this.contextData.save.bind(this.contextData))
}
function HBaseElement() {}
function HSolidElement(e, t, r) {
this.initElement(e, t, r)
}
function HShapeElement(e, t, r) {
this.shapes = [],
this.shapesData = e.shapes,
this.stylesList = [],
this.shapeModifiers = [],
this.itemsData = [],
this.processedElements = [],
this.animatedContents = [],
this.shapesContainer = createNS("g"),
this.initElement(e, t, r),
this.prevViewData = [],
this.currentBBox = {
x: 999999,
y: -999999,
h: 0,
w: 0
}
}
function HTextElement(e, t, r) {
this.textSpans = [],
this.textPaths = [],
this.currentBBox = {
x: 999999,
y: -999999,
h: 0,
w: 0
},
this.renderType = "svg",
this.isMasked = !1,
this.initElement(e, t, r)
}
function HCameraElement(e, t, r) {
this.initFrame(),
this.initBaseData(e, t, r),
this.initHierarchy();
var n = PropertyFactory.getProp;
if (this.pe = n(this, e.pe, 0, 0, this),
e.ks.p.s ? (this.px = n(this, e.ks.p.x, 1, 0, this),
this.py = n(this, e.ks.p.y, 1, 0, this),
this.pz = n(this, e.ks.p.z, 1, 0, this)) : this.p = n(this,
e.ks.p, 1, 0, this),
e.ks.a && (this.a = n(this, e.ks.a, 1, 0, this)),
e.ks.or.k.length && e.ks.or.k[0].to) {
var i, o = e.ks.or.k.length;
for (i = 0; i < o; i += 1)
e.ks.or.k[i].to = null,
e.ks.or.k[i].ti = null
}
this.or = n(this, e.ks.or, 1, degToRads, this),
this.or.sh = !0,
this.rx = n(this, e.ks.rx, 0, degToRads, this),
this.ry = n(this, e.ks.ry, 0, degToRads, this),
this.rz = n(this, e.ks.rz, 0, degToRads, this),
this.mat = new Matrix,
this._prevMat = new Matrix,
this._isFirstFrame = !0,
this.finalTransform = {
mProp: this
}
}
function HImageElement(e, t, r) {
this.assetData = t.getAssetData(e.refId),
this.initElement(e, t, r)
}
function HybridRendererBase(e, t) {
this.animationItem = e,
this.layers = null,
this.renderedFrame = -1,
this.renderConfig = {
className: t && t.className || "",
imagePreserveAspectRatio: t && t.imagePreserveAspectRatio
|| "xMidYMid slice",
hideOnTransparent: !(t && !1 === t.hideOnTransparent),
filterSize: {
width: t && t.filterSize && t.filterSize.width ||
"400%",
height: t && t.filterSize && t.filterSize.height ||
"400%",
x: t && t.filterSize && t.filterSize.x || "-100%",
y: t && t.filterSize && t.filterSize.y || "-100%"
}
},
this.globalData = {
_mdf: !1,
frameNum: -1,
renderConfig: this.renderConfig
},
this.pendingElements = [],
this.elements = [],
this.threeDElements = [],
this.destroyed = !1,
this.camera = null,
this.supports3d = !0,
this.rendererType = "html"
}
function HCompElement(e, t, r) {
this.layers = e.layers,
this.supports3d = !e.hasMask,
this.completeLayers = !1,
this.pendingElements = [],
this.elements = this.layers ?
createSizedArray(this.layers.length) : [],
this.initElement(e, t, r),
this.tm = e.tm ? PropertyFactory.getProp(this, e.tm, 0,
t.frameRate, this) : {
_placeholder: !0
}
}
function HybridRenderer(e, t) {
this.animationItem = e,
this.layers = null,
this.renderedFrame = -1,
this.renderConfig = {
className: t && t.className || "",
imagePreserveAspectRatio: t && t.imagePreserveAspectRatio
|| "xMidYMid slice",
hideOnTransparent: !(t && !1 === t.hideOnTransparent),
filterSize: {
width: t && t.filterSize && t.filterSize.width ||
"400%",
height: t && t.filterSize && t.filterSize.height ||
"400%",
x: t && t.filterSize && t.filterSize.x || "-100%",
y: t && t.filterSize && t.filterSize.y || "-100%"
},
runExpressions: !t || void 0 === t.runExpressions ||
t.runExpressions
},
this.globalData = {
_mdf: !1,
frameNum: -1,
renderConfig: this.renderConfig
},
this.pendingElements = [],
this.elements = [],
this.threeDElements = [],
this.destroyed = !1,
this.camera = null,
this.supports3d = !0,
this.rendererType = "html"
}
CVBaseElement.prototype = {
createElements: function() {},
initRendererElement: function() {},
createContainerElements: function() {
if (this.data.tt >= 1) {
this.buffers = [];
var e = this.globalData.canvasContext
, t = assetLoader.createCanvas(e.canvas.width,
e.canvas.height);
this.buffers.push(t);
var r = assetLoader.createCanvas(e.canvas.width,
e.canvas.height);
this.buffers.push(r),
this.data.tt >= 3 && !document._isProxy &&
assetLoader.loadLumaCanvas()
}
this.canvasContext = this.globalData.canvasContext,
this.transformCanvas = this.globalData.transformCanvas,
this.renderableEffectsManager = new CVEffects(this),
this.searchEffectTransforms()
},
createContent: function() {},
setBlendMode: function() {
var e = this.globalData;
if (e.blendMode !== this.data.bm) {
e.blendMode = this.data.bm;
var t = getBlendMode(this.data.bm);
e.canvasContext.globalCompositeOperation = t
}
},
createRenderableComponents: function() {
this.maskManager = new CVMaskElement(this.data,this),
this.transformEffects =
this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)
},
hideElement: function() {
this.hidden || this.isInRange && !this.isTransparent ||
(this.hidden = !0)
},
showElement: function() {
this.isInRange && !this.isTransparent && (this.hidden = !1,
this._isFirstFrame = !0,
this.maskManager._isFirstFrame = !0)
},
clearCanvas: function(e) {
e.clearRect(this.transformCanvas.tx,
this.transformCanvas.ty, this.transformCanvas.w * this.transformCanvas.sx,
this.transformCanvas.h * this.transformCanvas.sy)
},
prepareLayer: function() {
if (this.data.tt >= 1) {
var e = this.buffers[0].getContext("2d");
this.clearCanvas(e),
e.drawImage(this.canvasContext.canvas, 0, 0),
this.currentTransform =
this.canvasContext.getTransform(),
this.canvasContext.setTransform(1, 0, 0, 1, 0, 0),
this.clearCanvas(this.canvasContext),
this.canvasContext.setTransform(this.currentTransform)
}
},
exitLayer: function() {
if (this.data.tt >= 1) {
var e = this.buffers[1]
, t = e.getContext("2d");
if (this.clearCanvas(t),
t.drawImage(this.canvasContext.canvas, 0, 0),
this.canvasContext.setTransform(1, 0, 0, 1, 0, 0),
this.clearCanvas(this.canvasContext),
this.canvasContext.setTransform(this.currentTransform),
this.comp.getElementById("tp"in this.data ?
this.data.tp : this.data.ind - 1).renderFrame(!0),
this.canvasContext.setTransform(1, 0, 0, 1, 0, 0),
this.data.tt >= 3 && !document._isProxy) {
var r =
assetLoader.getLumaCanvas(this.canvasContext.canvas);
r.getContext("2d").drawImage(this.canvasContext.canvas, 0, 0),
this.clearCanvas(this.canvasContext),
this.canvasContext.drawImage(r, 0, 0)
}
this.canvasContext.globalCompositeOperation =
operationsMap[this.data.tt],
this.canvasContext.drawImage(e, 0, 0),
this.canvasContext.globalCompositeOperation =
"destination-over",
this.canvasContext.drawImage(this.buffers[0], 0, 0),
this.canvasContext.setTransform(this.currentTransform),
this.canvasContext.globalCompositeOperation = "source-
over"
}
},
renderFrame: function(e) {
if (!this.hidden && !this.data.hd && (1 !== this.data.td ||
e)) {
this.renderTransform(),
this.renderRenderable(),
this.renderLocalTransform(),
this.setBlendMode();
var t = 0 === this.data.ty;
this.prepareLayer(),
this.globalData.renderer.save(t),
this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),
this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),
this.renderInnerContent(),
this.globalData.renderer.restore(t),
this.exitLayer(),
this.maskManager.hasMasks &&
this.globalData.renderer.restore(!0),
this._isFirstFrame && (this._isFirstFrame = !1)
}
},
destroy: function() {
this.canvasContext = null,
this.data = null,
this.globalData = null,
this.maskManager.destroy()
},
mHelper: new Matrix
},
CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement,
CVBaseElement.prototype.show = CVBaseElement.prototype.showElement,
CVShapeData.prototype.setAsAnimated =
SVGShapeData.prototype.setAsAnimated,
extendPrototype([BaseElement, TransformElement, CVBaseElement,
IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement),
CVShapeElement.prototype.initElement =
RenderableDOMElement.prototype.initElement,
CVShapeElement.prototype.transformHelper = {
opacity: 1,
_opMdf: !1
},
CVShapeElement.prototype.dashResetter = [],
CVShapeElement.prototype.createContent = function() {
this.searchShapes(this.shapesData, this.itemsData,
this.prevViewData, !0, [])
}
,
CVShapeElement.prototype.createStyleElement = function(e, t) {
var r = {
data: e,
type: e.ty,
preTransforms:
this.transformsManager.addTransformSequence(t),
transforms: [],
elements: [],
closed: !0 === e.hd
}
, n = {};
if ("fl" === e.ty || "st" === e.ty ? (n.c =
PropertyFactory.getProp(this, e.c, 1, 255, this),
n.c.k || (r.co = "rgb(" + bmFloor(n.c.v[0]) + "," +
bmFloor(n.c.v[1]) + "," + bmFloor(n.c.v[2]) + ")")) : "gf" !== e.ty && "gs" !==
e.ty || (n.s = PropertyFactory.getProp(this, e.s, 1, null, this),
n.e = PropertyFactory.getProp(this, e.e, 1, null, this),
n.h = PropertyFactory.getProp(this, e.h || {
k: 0
}, 0, .01, this),
n.a = PropertyFactory.getProp(this, e.a || {
k: 0
}, 0, degToRads, this),
n.g = new GradientProperty(this,e.g,this)),
n.o = PropertyFactory.getProp(this, e.o, 0, .01, this),
"st" === e.ty || "gs" === e.ty) {
if (r.lc = lineCapEnum[e.lc || 2],
r.lj = lineJoinEnum[e.lj || 2],
1 == e.lj && (r.ml = e.ml),
n.w = PropertyFactory.getProp(this, e.w, 0, null, this),
n.w.k || (r.wi = n.w.v),
e.d) {
var i = new DashProperty(this,e.d,"canvas",this);
n.d = i,
n.d.k || (r.da = n.d.dashArray,
r.do = n.d.dashoffset[0])
}
} else
r.r = 2 === e.r ? "evenodd" : "nonzero";
return this.stylesList.push(r),
n.style = r,
n
}
,
CVShapeElement.prototype.createGroupElement = function() {
return {
it: [],
prevViewData: []
}
}
,
CVShapeElement.prototype.createTransformElement = function(e) {
return {
transform: {
opacity: 1,
_opMdf: !1,
key: this.transformsManager.getNewKey(),
op: PropertyFactory.getProp(this, e.o, 0, .01, this),
mProps:
TransformPropertyFactory.getTransformProperty(this, e, this)
}
}
}
,
CVShapeElement.prototype.createShapeElement = function(e) {
var t = new
CVShapeData(this,e,this.stylesList,this.transformsManager);
return this.shapes.push(t),
this.addShapeToModifiers(t),
t
}
,
CVShapeElement.prototype.reloadShapes = function() {
var e;
this._isFirstFrame = !0;
var t = this.itemsData.length;
for (e = 0; e < t; e += 1)
this.prevViewData[e] = this.itemsData[e];
for (this.searchShapes(this.shapesData, this.itemsData,
this.prevViewData, !0, []),
t = this.dynamicProperties.length,
e = 0; e < t; e += 1)
this.dynamicProperties[e].getValue();
this.renderModifiers(),
this.transformsManager.processSequences(this._isFirstFrame)
}
,
CVShapeElement.prototype.addTransformToStyleList = function(e) {
var t, r = this.stylesList.length;
for (t = 0; t < r; t += 1)
this.stylesList[t].closed ||
this.stylesList[t].transforms.push(e)
}
,
CVShapeElement.prototype.removeTransformFromStyleList = function()
{
var e, t = this.stylesList.length;
for (e = 0; e < t; e += 1)
this.stylesList[e].closed ||
this.stylesList[e].transforms.pop()
}
,
CVShapeElement.prototype.closeStyles = function(e) {
var t, r = e.length;
for (t = 0; t < r; t += 1)
e[t].closed = !0
}
,
CVShapeElement.prototype.searchShapes = function(e, t, r, n, i) {
var o, s, a, l, c, u, d = e.length - 1, p = [], h = [], f =
[].concat(i);
for (o = d; o >= 0; o -= 1) {
if ((l = this.searchProcessedElement(e[o])) ? t[o] = r[l -
1] : e[o]._shouldRender = n,
"fl" === e[o].ty || "st" === e[o].ty || "gf" === e[o].ty ||
"gs" === e[o].ty)
l ? t[o].style.closed = !1 : t[o] =
this.createStyleElement(e[o], f),
p.push(t[o].style);
else if ("gr" === e[o].ty) {
if (l)
for (a = t[o].it.length,
s = 0; s < a; s += 1)
t[o].prevViewData[s] = t[o].it[s];
else
t[o] = this.createGroupElement(e[o]);
this.searchShapes(e[o].it, t[o].it, t[o].prevViewData,
n, f)
} else
"tr" === e[o].ty ? (l || (u =
this.createTransformElement(e[o]),
t[o] = u),
f.push(t[o]),
this.addTransformToStyleList(t[o])) : "sh" === e[o].ty
|| "rc" === e[o].ty || "el" === e[o].ty || "sr" === e[o].ty ? l || (t[o] =
this.createShapeElement(e[o])) : "tm" === e[o].ty || "rd" === e[o].ty || "pb" ===
e[o].ty || "zz" === e[o].ty || "op" === e[o].ty ? (l ? (c = t[o]).closed = !1 : ((c
= ShapeModifiers.getModifier(e[o].ty)).init(this, e[o]),
t[o] = c,
this.shapeModifiers.push(c)),
h.push(c)) : "rp" === e[o].ty && (l ? (c = t[o]).closed
= !0 : (c = ShapeModifiers.getModifier(e[o].ty),
t[o] = c,
c.init(this, e, o, t),
this.shapeModifiers.push(c),
n = !1),
h.push(c));
this.addProcessedElement(e[o], o + 1)
}
for (this.removeTransformFromStyleList(),
this.closeStyles(p),
d = h.length,
o = 0; o < d; o += 1)
h[o].closed = !0
}
,
CVShapeElement.prototype.renderInnerContent = function() {
this.transformHelper.opacity = 1,
this.transformHelper._opMdf = !1,
this.renderModifiers(),
this.transformsManager.processSequences(this._isFirstFrame),
this.renderShape(this.transformHelper, this.shapesData,
this.itemsData, !0)
}
,
CVShapeElement.prototype.renderShapeTransform = function(e, t) {
(e._opMdf || t.op._mdf || this._isFirstFrame) && (t.opacity =
e.opacity,
t.opacity *= t.op.v,
t._opMdf = !0)
}
,
CVShapeElement.prototype.drawLayer = function() {
var e, t, r, n, i, o, s, a, l, c = this.stylesList.length, u =
this.globalData.renderer, d = this.globalData.canvasContext;
for (e = 0; e < c; e += 1)
if (("st" !== (a = (l = this.stylesList[e]).type) && "gs" !
== a || 0 !== l.wi) && l.data._shouldRender && 0 !== l.coOp && 0 !==
this.globalData.currentGlobalAlpha) {
for (u.save(),
o = l.elements,
"st" === a || "gs" === a ? (u.ctxStrokeStyle("st" === a
? l.co : l.grd),
u.ctxLineWidth(l.wi),
u.ctxLineCap(l.lc),
u.ctxLineJoin(l.lj),
u.ctxMiterLimit(l.ml || 0)) : u.ctxFillStyle("fl" === a
? l.co : l.grd),
u.ctxOpacity(l.coOp),
"st" !== a && "gs" !== a && d.beginPath(),
u.ctxTransform(l.preTransforms.finalTransform.props),
r = o.length,
t = 0; t < r; t += 1) {
for ("st" !== a && "gs" !== a || (d.beginPath(),
l.da && (d.setLineDash(l.da),
d.lineDashOffset = l.do)),
i = (s = o[t].trNodes).length,
n = 0; n < i; n += 1)
"m" === s[n].t ? d.moveTo(s[n].p[0], s[n].p[1])
: "c" === s[n].t ? d.bezierCurveTo(s[n].pts[0], s[n].pts[1], s[n].pts[2],
s[n].pts[3], s[n].pts[4], s[n].pts[5]) : d.closePath();
"st" !== a && "gs" !== a || (u.ctxStroke(),
l.da && d.setLineDash(this.dashResetter))
}
"st" !== a && "gs" !== a &&
this.globalData.renderer.ctxFill(l.r),
u.restore()
}
}
,
CVShapeElement.prototype.renderShape = function(e, t, r, n) {
var i, o;
for (o = e,
i = t.length - 1; i >= 0; i -= 1)
"tr" === t[i].ty ? (o = r[i].transform,
this.renderShapeTransform(e, o)) : "sh" === t[i].ty || "el"
=== t[i].ty || "rc" === t[i].ty || "sr" === t[i].ty ? this.renderPath(t[i], r[i]) :
"fl" === t[i].ty ? this.renderFill(t[i], r[i], o) : "st" === t[i].ty ?
this.renderStroke(t[i], r[i], o) : "gf" === t[i].ty || "gs" === t[i].ty ?
this.renderGradientFill(t[i], r[i], o) : "gr" === t[i].ty ? this.renderShape(o,
t[i].it, r[i].it) : t[i].ty;
n && this.drawLayer()
}
,
CVShapeElement.prototype.renderStyledShape = function(e, t) {
if (this._isFirstFrame || t._mdf || e.transforms._mdf) {
var r, n, i, o = e.trNodes, s = t.paths, a = s._length;
o.length = 0;
var l = e.transforms.finalTransform;
for (i = 0; i < a; i += 1) {
var c = s.shapes[i];
if (c && c.v) {
for (n = c._length,
r = 1; r < n; r += 1)
1 === r && o.push({
t: "m",
p: l.applyToPointArray(c.v[0][0], c.v[0]
[1], 0)
}),
o.push({
t: "c",
pts: l.applyToTriplePoints(c.o[r - 1],
c.i[r], c.v[r])
});
1 === n && o.push({
t: "m",
p: l.applyToPointArray(c.v[0][0], c.v[0][1], 0)
}),
c.c && n && (o.push({
t: "c",
pts: l.applyToTriplePoints(c.o[r - 1], c.i[0],
c.v[0])
}),
o.push({
t: "z"
}))
}
}
e.trNodes = o
}
}
,
CVShapeElement.prototype.renderPath = function(e, t) {
if (!0 !== e.hd && e._shouldRender) {
var r, n = t.styledShapes.length;
for (r = 0; r < n; r += 1)
this.renderStyledShape(t.styledShapes[r], t.sh)
}
}
,
CVShapeElement.prototype.renderFill = function(e, t, r) {
var n = t.style;
(t.c._mdf || this._isFirstFrame) && (n.co = "rgb(" +
bmFloor(t.c.v[0]) + "," + bmFloor(t.c.v[1]) + "," + bmFloor(t.c.v[2]) + ")"),
(t.o._mdf || r._opMdf || this._isFirstFrame) && (n.coOp = t.o.v
* r.opacity)
}
,
CVShapeElement.prototype.renderGradientFill = function(e, t, r) {
var n, i = t.style;
if (!i.grd || t.g._mdf || t.s._mdf || t.e._mdf || 1 !== e.t &&
(t.h._mdf || t.a._mdf)) {
var o, s = this.globalData.canvasContext, a = t.s.v, l =
t.e.v;
if (1 === e.t)
n = s.createLinearGradient(a[0], a[1], l[0], l[1]);
else {
var c = Math.sqrt(Math.pow(a[0] - l[0], 2) +
Math.pow(a[1] - l[1], 2))
, u = Math.atan2(l[1] - a[1], l[0] - a[0])
, d = t.h.v;
d >= 1 ? d = .99 : d <= -1 && (d = -.99);
var p = c * d
, h = Math.cos(u + t.a.v) * p + a[0]
, f = Math.sin(u + t.a.v) * p + a[1];
n = s.createRadialGradient(h, f, 0, a[0], a[1], c)
}
var m = e.g.p
, g = t.g.c
, y = 1;
for (o = 0; o < m; o += 1)
t.g._hasOpacity && t.g._collapsable && (y = t.g.o[2 * o
+ 1]),
n.addColorStop(g[4 * o] / 100, "rgba(" + g[4 * o + 1] +
"," + g[4 * o + 2] + "," + g[4 * o + 3] + "," + y + ")");
i.grd = n
}
i.coOp = t.o.v * r.opacity
}
,
CVShapeElement.prototype.renderStroke = function(e, t, r) {
var n = t.style
, i = t.d;
i && (i._mdf || this._isFirstFrame) && (n.da = i.dashArray,
n.do = i.dashoffset[0]),
(t.c._mdf || this._isFirstFrame) && (n.co = "rgb(" +
bmFloor(t.c.v[0]) + "," + bmFloor(t.c.v[1]) + "," + bmFloor(t.c.v[2]) + ")"),
(t.o._mdf || r._opMdf || this._isFirstFrame) && (n.coOp = t.o.v
* r.opacity),
(t.w._mdf || this._isFirstFrame) && (n.wi = t.w.v)
}
,
CVShapeElement.prototype.destroy = function() {
this.shapesData = null,
this.globalData = null,
this.canvasContext = null,
this.stylesList.length = 0,
this.itemsData.length = 0
}
,
extendPrototype([BaseElement, TransformElement, CVBaseElement,
HierarchyElement, FrameElement, RenderableElement, ITextElement], CVTextElement),
CVTextElement.prototype.tHelper =
createTag("canvas").getContext("2d"),
CVTextElement.prototype.buildNewText = function() {
var e = this.textProperty.currentData;
this.renderedLetters = createSizedArray(e.l ? e.l.length : 0);
var t = !1;
e.fc ? (t = !0,
this.values.fill = this.buildColor(e.fc)) : this.values.fill =
"rgba(0,0,0,0)",
this.fill = t;
var r = !1;
e.sc && (r = !0,
this.values.stroke = this.buildColor(e.sc),
this.values.sWidth = e.sw);
var n, i, o, s, a, l, c, u, d, p, h, f, m =
this.globalData.fontManager.getFontByName(e.f), g = e.l, y = this.mHelper;
this.stroke = r,
this.values.fValue = e.finalSize + "px " +
this.globalData.fontManager.getFontByName(e.f).fFamily,
i = e.finalText.length;
var v = this.data.singleShape
, b = .001 * e.tr * e.finalSize
, x = 0
, _ = 0
, E = !0
, T = 0;
for (n = 0; n < i; n += 1) {
s = (o =
this.globalData.fontManager.getCharData(e.finalText[n], m.fStyle,
this.globalData.fontManager.getFontByName(e.f).fFamily)) && o.data || {},
y.reset(),
v && g[n].n && (x = -b,
_ += e.yOffset,
_ += E ? 1 : 0,
E = !1),
d = (c = s.shapes ? s.shapes[0].it : []).length,
y.scale(e.finalSize / 100, e.finalSize / 100),
v && this.applyTextPropertiesToMatrix(e, y, g[n].line, x,
_),
h = createSizedArray(d - 1);
var C = 0;
for (u = 0; u < d; u += 1)
if ("sh" === c[u].ty) {
for (l = c[u].ks.k.i.length,
p = c[u].ks.k,
f = [],
a = 1; a < l; a += 1)
1 === a && f.push(y.applyToX(p.v[0][0], p.v[0]
[1], 0), y.applyToY(p.v[0][0], p.v[0][1], 0)),
f.push(y.applyToX(p.o[a - 1][0], p.o[a - 1][1],
0), y.applyToY(p.o[a - 1][0], p.o[a - 1][1], 0), y.applyToX(p.i[a][0], p.i[a][1],
0), y.applyToY(p.i[a][0], p.i[a][1], 0), y.applyToX(p.v[a][0], p.v[a][1], 0),
y.applyToY(p.v[a][0], p.v[a][1], 0));
f.push(y.applyToX(p.o[a - 1][0], p.o[a - 1][1], 0),
y.applyToY(p.o[a - 1][0], p.o[a - 1][1], 0), y.applyToX(p.i[0][0], p.i[0][1], 0),
y.applyToY(p.i[0][0], p.i[0][1], 0), y.applyToX(p.v[0][0], p.v[0][1], 0),
y.applyToY(p.v[0][0], p.v[0][1], 0)),
h[C] = f,
C += 1
}
v && (x += g[n].l,
x += b),
this.textSpans[T] ? this.textSpans[T].elem = h :
this.textSpans[T] = {
elem: h
},
T += 1
}
}
,
CVTextElement.prototype.renderInnerContent = function() {
var e, t, r, n, i, o;
this.validateText(),
this.canvasContext.font = this.values.fValue,
this.globalData.renderer.ctxLineCap("butt"),
this.globalData.renderer.ctxLineJoin("miter"),
this.globalData.renderer.ctxMiterLimit(4),
this.data.singleShape ||
this.textAnimator.getMeasures(this.textProperty.currentData,
this.lettersChangedFlag);
var s, a = this.textAnimator.renderedLetters, l =
this.textProperty.currentData.l;
t = l.length;
var c, u, d = null, p = null, h = null, f =
this.globalData.renderer;
for (e = 0; e < t; e += 1)
if (!l[e].n) {
if ((s = a[e]) && (f.save(),
f.ctxTransform(s.p),
f.ctxOpacity(s.o)),
this.fill) {
for (s && s.fc ? d !== s.fc &&
(f.ctxFillStyle(s.fc),
d = s.fc) : d !== this.values.fill && (d =
this.values.fill,
f.ctxFillStyle(this.values.fill)),
n = (c = this.textSpans[e].elem).length,
this.globalData.canvasContext.beginPath(),
r = 0; r < n; r += 1)
for (o = (u = c[r]).length,
this.globalData.canvasContext.moveTo(u[0],
u[1]),
i = 2; i < o; i += 6)
this.animationItem.wrapper.appendChild(this.animationItem.container),
this.canvasContext =
this.animationItem.container.getContext("2d"),
this.renderConfig.className &&
this.animationItem.container.setAttribute("class", this.renderConfig.className),
this.renderConfig.id &&
this.animationItem.container.setAttribute("id", this.renderConfig.id)
} else
this.canvasContext = this.renderConfig.context;
this.contextData.setContext(this.canvasContext),
this.data = e,
this.layers = e.layers,
this.transformCanvas = {
w: e.w,
h: e.h,
sx: 0,
sy: 0,
tx: 0,
ty: 0
},
this.setupGlobalData(e, document.body),
this.globalData.canvasContext = this.canvasContext,
this.globalData.renderer = this,
this.globalData.isDashed = !1,
this.globalData.progressiveLoad =
this.renderConfig.progressiveLoad,
this.globalData.transformCanvas = this.transformCanvas,
this.elements = createSizedArray(e.layers.length),
this.updateContainerSize()
}
,
CanvasRendererBase.prototype.updateContainerSize = function(e, t) {
var r, n, i, o;
if (this.reset(),
e ? (r = e,
n = t,
this.canvasContext.canvas.width = r,
this.canvasContext.canvas.height = n) :
(this.animationItem.wrapper && this.animationItem.container ? (r =
this.animationItem.wrapper.offsetWidth,
n = this.animationItem.wrapper.offsetHeight) : (r =
this.canvasContext.canvas.width,
n = this.canvasContext.canvas.height),
this.canvasContext.canvas.width = r * this.renderConfig.dpr,
this.canvasContext.canvas.height = n * this.renderConfig.dpr),
-1 !== this.renderConfig.preserveAspectRatio.indexOf("meet") ||
-1 !== this.renderConfig.preserveAspectRatio.indexOf("slice")) {
var s = this.renderConfig.preserveAspectRatio.split(" ")
, a = s[1] || "meet"
, l = s[0] || "xMidYMid"
, c = l.substr(0, 4)
, u = l.substr(4);
i = r / n,
(o = this.transformCanvas.w / this.transformCanvas.h) > i
&& "meet" === a || o < i && "slice" === a ? (this.transformCanvas.sx = r /
(this.transformCanvas.w / this.renderConfig.dpr),
this.transformCanvas.sy = r / (this.transformCanvas.w /
this.renderConfig.dpr)) : (this.transformCanvas.sx = n / (this.transformCanvas.h /
this.renderConfig.dpr),
this.transformCanvas.sy = n / (this.transformCanvas.h /
this.renderConfig.dpr)),
this.transformCanvas.tx = "xMid" === c && (o < i && "meet"
=== a || o > i && "slice" === a) ? (r - this.transformCanvas.w * (n /
this.transformCanvas.h)) / 2 * this.renderConfig.dpr : "xMax" === c && (o < i &&
"meet" === a || o > i && "slice" === a) ? (r - this.transformCanvas.w * (n /
this.transformCanvas.h)) * this.renderConfig.dpr : 0,
this.transformCanvas.ty = "YMid" === u && (o > i && "meet"
=== a || o < i && "slice" === a) ? (n - this.transformCanvas.h * (r /
this.transformCanvas.w)) / 2 * this.renderConfig.dpr : "YMax" === u && (o > i &&
"meet" === a || o < i && "slice" === a) ? (n - this.transformCanvas.h * (r /
this.transformCanvas.w)) * this.renderConfig.dpr : 0
} else
"none" === this.renderConfig.preserveAspectRatio ?
(this.transformCanvas.sx = r / (this.transformCanvas.w / this.renderConfig.dpr),
this.transformCanvas.sy = n / (this.transformCanvas.h /
this.renderConfig.dpr),
this.transformCanvas.tx = 0,
this.transformCanvas.ty = 0) : (this.transformCanvas.sx =
this.renderConfig.dpr,
this.transformCanvas.sy = this.renderConfig.dpr,
this.transformCanvas.tx = 0,
this.transformCanvas.ty = 0);
this.transformCanvas.props = [this.transformCanvas.sx, 0, 0, 0,
0, this.transformCanvas.sy, 0, 0, 0, 0, 1, 0, this.transformCanvas.tx,
this.transformCanvas.ty, 0, 1],
this.ctxTransform(this.transformCanvas.props),
this.canvasContext.beginPath(),
this.canvasContext.rect(0, 0, this.transformCanvas.w,
this.transformCanvas.h),
this.canvasContext.closePath(),
this.canvasContext.clip(),
this.renderFrame(this.renderedFrame, !0)
}
,
CanvasRendererBase.prototype.destroy = function() {
var e;
for (this.renderConfig.clearCanvas &&
this.animationItem.wrapper && (this.animationItem.wrapper.innerText = ""),
e = (this.layers ? this.layers.length : 0) - 1; e >= 0; e -= 1)
this.elements[e] && this.elements[e].destroy &&
this.elements[e].destroy();
this.elements.length = 0,
this.globalData.canvasContext = null,
this.animationItem.container = null,
this.destroyed = !0
}
,
CanvasRendererBase.prototype.renderFrame = function(e, t) {
if ((this.renderedFrame !== e || !0 !==
this.renderConfig.clearCanvas || t) && !this.destroyed && -1 !== e) {
var r;
this.renderedFrame = e,
this.globalData.frameNum = e -
this.animationItem._isFirstFrame,
this.globalData.frameId += 1,
this.globalData._mdf = !this.renderConfig.clearCanvas || t,
this.globalData.projectInterface.currentFrame = e;
var n = this.layers.length;
for (this.completeLayers || this.checkLayers(e),
r = n - 1; r >= 0; r -= 1)
(this.completeLayers || this.elements[r]) &&
this.elements[r].prepareFrame(e - this.layers[r].st);
if (this.globalData._mdf) {
for (!0 === this.renderConfig.clearCanvas ?
this.canvasContext.clearRect(0, 0, this.transformCanvas.w,
this.transformCanvas.h) : this.save(),
r = n - 1; r >= 0; r -= 1)
(this.completeLayers || this.elements[r]) &&
this.elements[r].renderFrame();
!0 !== this.renderConfig.clearCanvas && this.restore()
}
}
}
,
CanvasRendererBase.prototype.buildItem = function(e) {
var t = this.elements;
if (!t[e] && 99 !== this.layers[e].ty) {
var r = this.createItem(this.layers[e], this,
this.globalData);
t[e] = r,
r.initExpressions()
}
}
,
CanvasRendererBase.prototype.checkPendingElements = function() {
for (; this.pendingElements.length; )
this.pendingElements.pop().checkParenting()
}
,
CanvasRendererBase.prototype.hide = function() {
this.animationItem.container.style.display = "none"
}
,
CanvasRendererBase.prototype.show = function() {
this.animationItem.container.style.display = "block"
}
,
CVContextData.prototype.duplicate = function() {
var e = 2 * this._length
, t = 0;
for (t = this._length; t < e; t += 1)
this.stack[t] = new CanvasContext;
this._length = e
}
,
CVContextData.prototype.reset = function() {
this.cArrPos = 0,
this.cTr.reset(),
this.stack[this.cArrPos].opacity = 1
}
,
CVContextData.prototype.restore = function(e) {
this.cArrPos -= 1;
var t, r = this.stack[this.cArrPos], n = r.transform, i =
this.cTr.props;
for (t = 0; t < 16; t += 1)
i[t] = n[t];
if (e) {
this.nativeContext.restore();
var o = this.stack[this.cArrPos + 1];
this.appliedFillStyle = o.fillStyle,
this.appliedStrokeStyle = o.strokeStyle,
this.appliedLineWidth = o.lineWidth,
this.appliedLineCap = o.lineCap,
this.appliedLineJoin = o.lineJoin,
this.appliedMiterLimit = o.miterLimit
}
this.nativeContext.setTransform(n[0], n[1], n[4], n[5], n[12],
n[13]),
(e || -1 !== r.opacity && this.currentOpacity !== r.opacity) &&
(this.nativeContext.globalAlpha = r.opacity,
this.currentOpacity = r.opacity),
this.currentFillStyle = r.fillStyle,
this.currentStrokeStyle = r.strokeStyle,
this.currentLineWidth = r.lineWidth,
this.currentLineCap = r.lineCap,
this.currentLineJoin = r.lineJoin,
this.currentMiterLimit = r.miterLimit
}
,
CVContextData.prototype.save = function(e) {
e && this.nativeContext.save();
var t = this.cTr.props;
this._length <= this.cArrPos && this.duplicate();
var r, n = this.stack[this.cArrPos];
for (r = 0; r < 16; r += 1)
n.transform[r] = t[r];
this.cArrPos += 1;
var i = this.stack[this.cArrPos];
i.opacity = n.opacity,
i.fillStyle = n.fillStyle,
i.strokeStyle = n.strokeStyle,
i.lineWidth = n.lineWidth,
i.lineCap = n.lineCap,
i.lineJoin = n.lineJoin,
i.miterLimit = n.miterLimit
}
,
CVContextData.prototype.setOpacity = function(e) {
this.stack[this.cArrPos].opacity = e
}
,
CVContextData.prototype.setContext = function(e) {
this.nativeContext = e
}
,
CVContextData.prototype.fillStyle = function(e) {
this.stack[this.cArrPos].fillStyle !== e &&
(this.currentFillStyle = e,
this.stack[this.cArrPos].fillStyle = e)
}
,
CVContextData.prototype.strokeStyle = function(e) {
this.stack[this.cArrPos].strokeStyle !== e &&
(this.currentStrokeStyle = e,
this.stack[this.cArrPos].strokeStyle = e)
}
,
CVContextData.prototype.lineWidth = function(e) {
this.stack[this.cArrPos].lineWidth !== e &&
(this.currentLineWidth = e,
this.stack[this.cArrPos].lineWidth = e)
}
,
CVContextData.prototype.lineCap = function(e) {
this.stack[this.cArrPos].lineCap !== e && (this.currentLineCap
= e,
this.stack[this.cArrPos].lineCap = e)
}
,
CVContextData.prototype.lineJoin = function(e) {
this.stack[this.cArrPos].lineJoin !== e &&
(this.currentLineJoin = e,
this.stack[this.cArrPos].lineJoin = e)
}
,
CVContextData.prototype.miterLimit = function(e) {
this.stack[this.cArrPos].miterLimit !== e &&
(this.currentMiterLimit = e,
this.stack[this.cArrPos].miterLimit = e)
}
,
CVContextData.prototype.transform = function(e) {
this.transformMat.cloneFromProps(e);
var t = this.cTr;
this.transformMat.multiply(t),
t.cloneFromProps(this.transformMat.props);
var r = t.props;
this.nativeContext.setTransform(r[0], r[1], r[4], r[5], r[12],
r[13])
}
,
CVContextData.prototype.opacity = function(e) {
var t = this.stack[this.cArrPos].opacity;
t *= e < 0 ? 0 : e,
this.stack[this.cArrPos].opacity !== t &&
(this.currentOpacity !== e && (this.nativeContext.globalAlpha = e,
this.currentOpacity = e),
this.stack[this.cArrPos].opacity = t)
}
,
CVContextData.prototype.fill = function(e) {
this.appliedFillStyle !== this.currentFillStyle &&
(this.appliedFillStyle = this.currentFillStyle,
this.nativeContext.fillStyle = this.appliedFillStyle),
this.nativeContext.fill(e)
}
,
CVContextData.prototype.fillRect = function(e, t, r, n) {
this.appliedFillStyle !== this.currentFillStyle &&
(this.appliedFillStyle = this.currentFillStyle,
this.nativeContext.fillStyle = this.appliedFillStyle),
this.nativeContext.fillRect(e, t, r, n)
}
,
CVContextData.prototype.stroke = function() {
this.appliedStrokeStyle !== this.currentStrokeStyle &&
(this.appliedStrokeStyle = this.currentStrokeStyle,
this.nativeContext.strokeStyle = this.appliedStrokeStyle),
this.appliedLineWidth !== this.currentLineWidth &&
(this.appliedLineWidth = this.currentLineWidth,
this.nativeContext.lineWidth = this.appliedLineWidth),
this.appliedLineCap !== this.currentLineCap &&
(this.appliedLineCap = this.currentLineCap,
this.nativeContext.lineCap = this.appliedLineCap),
this.appliedLineJoin !== this.currentLineJoin &&
(this.appliedLineJoin = this.currentLineJoin,
this.nativeContext.lineJoin = this.appliedLineJoin),
this.appliedMiterLimit !== this.currentMiterLimit &&
(this.appliedMiterLimit = this.currentMiterLimit,
this.nativeContext.miterLimit = this.appliedMiterLimit),
this.nativeContext.stroke()
}
,
extendPrototype([CanvasRendererBase, ICompElement, CVBaseElement],
CVCompElement),
CVCompElement.prototype.renderInnerContent = function() {
var e, t = this.canvasContext;
for (t.beginPath(),
t.moveTo(0, 0),
t.lineTo(this.data.w, 0),
t.lineTo(this.data.w, this.data.h),
t.lineTo(0, this.data.h),
t.lineTo(0, 0),
t.clip(),
e = this.layers.length - 1; e >= 0; e -= 1)
(this.completeLayers || this.elements[e]) &&
this.elements[e].renderFrame()
}
,
CVCompElement.prototype.destroy = function() {
var e;
for (e = this.layers.length - 1; e >= 0; e -= 1)
this.elements[e] && this.elements[e].destroy();
this.layers = null,
this.elements = null
}
,
CVCompElement.prototype.createComp = function(e) {
return new CVCompElement(e,this.globalData,this)
}
,
extendPrototype([CanvasRendererBase], CanvasRenderer),
CanvasRenderer.prototype.createComp = function(e) {
return new CVCompElement(e,this.globalData,this)
}
,
HBaseElement.prototype = {
checkBlendMode: function() {},
initRendererElement: function() {
this.baseElement = createTag(this.data.tg || "div"),
this.data.hasMask ? (this.svgElement = createNS("svg"),
this.layerElement = createNS("g"),
this.maskedElement = this.layerElement,
this.svgElement.appendChild(this.layerElement),
this.baseElement.appendChild(this.svgElement)) :
this.layerElement = this.baseElement,
styleDiv(this.baseElement)
},
createContainerElements: function() {
this.renderableEffectsManager = new CVEffects(this),
this.transformedElement = this.baseElement,
this.maskedElement = this.layerElement,
this.data.ln && this.layerElement.setAttribute("id",
this.data.ln),
this.data.cl && this.layerElement.setAttribute("class",
this.data.cl),
0 !== this.data.bm && this.setBlendMode()
},
renderElement: function() {
var e = this.transformedElement ?
this.transformedElement.style : {};
if (this.finalTransform._matMdf) {
var t = this.finalTransform.mat.toCSS();
e.transform = t,
e.webkitTransform = t
}
this.finalTransform._opMdf && (e.opacity =
this.finalTransform.mProp.o.v)
},
renderFrame: function() {
this.data.hd || this.hidden || (this.renderTransform(),
this.renderRenderable(),
this.renderElement(),
this.renderInnerContent(),
this._isFirstFrame && (this._isFirstFrame = !1))
},
destroy: function() {
this.layerElement = null,
this.transformedElement = null,
this.matteElement && (this.matteElement = null),
this.maskManager && (this.maskManager.destroy(),
this.maskManager = null)
},
createRenderableComponents: function() {
this.maskManager = new
MaskElement(this.data,this,this.globalData)
},
addEffects: function() {},
setMatte: function() {}
},
HBaseElement.prototype.getBaseElement =
SVGBaseElement.prototype.getBaseElement,
HBaseElement.prototype.destroyBaseElement =
HBaseElement.prototype.destroy,
HBaseElement.prototype.buildElementParenting =
BaseRenderer.prototype.buildElementParenting,
extendPrototype([BaseElement, TransformElement, HBaseElement,
HierarchyElement, FrameElement, RenderableDOMElement], HSolidElement),
HSolidElement.prototype.createContent = function() {
var e;
this.data.hasMask ? ((e =
createNS("rect")).setAttribute("width", this.data.sw),
e.setAttribute("height", this.data.sh),
e.setAttribute("fill", this.data.sc),
this.svgElement.setAttribute("width", this.data.sw),
this.svgElement.setAttribute("height", this.data.sh)) : ((e =
createTag("div")).style.width = this.data.sw + "px",
e.style.height = this.data.sh + "px",
e.style.backgroundColor = this.data.sc),
this.layerElement.appendChild(e)
}
,
extendPrototype([BaseElement, TransformElement, HSolidElement,
SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement],
HShapeElement),
HShapeElement.prototype._renderShapeFrame =
HShapeElement.prototype.renderInnerContent,
HShapeElement.prototype.createContent = function() {
var e;
if (this.baseElement.style.fontSize = 0,
this.data.hasMask)
this.layerElement.appendChild(this.shapesContainer),
e = this.svgElement;
else {
e = createNS("svg");
var t = this.comp.data ? this.comp.data :
this.globalData.compSize;
e.setAttribute("width", t.w),
e.setAttribute("height", t.h),
e.appendChild(this.shapesContainer),
this.layerElement.appendChild(e)
}
this.searchShapes(this.shapesData, this.itemsData,
this.prevViewData, this.shapesContainer, 0, [], !0),
this.filterUniqueShapes(),
this.shapeCont = e
}
,
HShapeElement.prototype.getTransformedPoint = function(e, t) {
var r, n = e.length;
for (r = 0; r < n; r += 1)
t = e[r].mProps.v.applyToPointArray(t[0], t[1], 0);
return t
}
,
HShapeElement.prototype.calculateShapeBoundingBox = function(e, t)
{
var r, n, i, o, s, a = e.sh.v, l = e.transformers, c =
a._length;
if (!(c <= 1)) {
for (r = 0; r < c - 1; r += 1)
n = this.getTransformedPoint(l, a.v[r]),
i = this.getTransformedPoint(l, a.o[r]),
o = this.getTransformedPoint(l, a.i[r + 1]),
s = this.getTransformedPoint(l, a.v[r + 1]),
this.checkBounds(n, i, o, s, t);
a.c && (n = this.getTransformedPoint(l, a.v[r]),
i = this.getTransformedPoint(l, a.o[r]),
o = this.getTransformedPoint(l, a.i[0]),
s = this.getTransformedPoint(l, a.v[0]),
this.checkBounds(n, i, o, s, t))
}
}
,
HShapeElement.prototype.checkBounds = function(e, t, r, n, i) {
this.getBoundsOfCurve(e, t, r, n);
var o = this.shapeBoundingBox;
i.x = bmMin(o.left, i.x),
i.xMax = bmMax(o.right, i.xMax),
i.y = bmMin(o.top, i.y),
i.yMax = bmMax(o.bottom, i.yMax)
}
,
HShapeElement.prototype.shapeBoundingBox = {
left: 0,
right: 0,
top: 0,
bottom: 0
},
HShapeElement.prototype.tempBoundingBox = {
x: 0,
xMax: 0,
y: 0,
yMax: 0,
width: 0,
height: 0
},
HShapeElement.prototype.getBoundsOfCurve = function(e, t, r, n) {
for (var i, o, s, a, l, c, u, d = [[e[0], n[0]], [e[1], n[1]]],
p = 0; p < 2; ++p)
o = 6 * e[p] - 12 * t[p] + 6 * r[p],
i = -3 * e[p] + 9 * t[p] - 9 * r[p] + 3 * n[p],
s = 3 * t[p] - 3 * e[p],
o |= 0,
s |= 0,
0 == (i |= 0) && 0 === o || (0 === i ? (a = -s / o) > 0 &&
a < 1 && d[p].push(this.calculateF(a, e, t, r, n, p)) : (l = o * o - 4 * s * i) >=
0 && ((c = (-o + bmSqrt(l)) / (2 * i)) > 0 && c < 1 && d[p].push(this.calculateF(c,
e, t, r, n, p)),
(u = (-o - bmSqrt(l)) / (2 * i)) > 0 && u < 1 &&
d[p].push(this.calculateF(u, e, t, r, n, p))));
this.shapeBoundingBox.left = bmMin.apply(null, d[0]),
this.shapeBoundingBox.top = bmMin.apply(null, d[1]),
this.shapeBoundingBox.right = bmMax.apply(null, d[0]),
this.shapeBoundingBox.bottom = bmMax.apply(null, d[1])
}
,
HShapeElement.prototype.calculateF = function(e, t, r, n, i, o) {
return bmPow(1 - e, 3) * t[o] + 3 * bmPow(1 - e, 2) * e * r[o]
+ 3 * (1 - e) * bmPow(e, 2) * n[o] + bmPow(e, 3) * i[o]
}
,
HShapeElement.prototype.calculateBoundingBox = function(e, t) {
var r, n = e.length;
for (r = 0; r < n; r += 1)
e[r] && e[r].sh ? this.calculateShapeBoundingBox(e[r], t) :
e[r] && e[r].it ? this.calculateBoundingBox(e[r].it, t) : e[r] && e[r].style &&
e[r].w && this.expandStrokeBoundingBox(e[r].w, t)
}
,
HShapeElement.prototype.expandStrokeBoundingBox = function(e, t) {
var r = 0;
if (e.keyframes) {
for (var n = 0; n < e.keyframes.length; n += 1) {
var i = e.keyframes[n].s;
i > r && (r = i)
}
r *= e.mult
} else
r = e.v * e.mult;
t.x -= r,
t.xMax += r,
t.y -= r,
t.yMax += r
}
,
HShapeElement.prototype.currentBoxContains = function(e) {
return this.currentBBox.x <= e.x && this.currentBBox.y <= e.y
&& this.currentBBox.width + this.currentBBox.x >= e.x + e.width &&
this.currentBBox.height + this.currentBBox.y >= e.y + e.height
}
,
HShapeElement.prototype.renderInnerContent = function() {
if (this._renderShapeFrame(),
!this.hidden && (this._isFirstFrame || this._mdf)) {
var e = this.tempBoundingBox
, t = 999999;
if (e.x = t,
e.xMax = -t,
e.y = t,
e.yMax = -t,
this.calculateBoundingBox(this.itemsData, e),
e.width = e.xMax < e.x ? 0 : e.xMax - e.x,
e.height = e.yMax < e.y ? 0 : e.yMax - e.y,
this.currentBoxContains(e))
return;
var r = !1;
if (this.currentBBox.w !== e.width && (this.currentBBox.w =
e.width,
this.shapeCont.setAttribute("width", e.width),
r = !0),
this.currentBBox.h !== e.height && (this.currentBBox.h =
e.height,
this.shapeCont.setAttribute("height", e.height),
r = !0),
r || this.currentBBox.x !== e.x || this.currentBBox.y !==
e.y) {
this.currentBBox.w = e.width,
this.currentBBox.h = e.height,
this.currentBBox.x = e.x,
this.currentBBox.y = e.y,
this.shapeCont.setAttribute("viewBox",
this.currentBBox.x + " " + this.currentBBox.y + " " + this.currentBBox.w + " " +
this.currentBBox.h);
var n = this.shapeCont.style
, i = "translate(" + this.currentBBox.x + "px," +
this.currentBBox.y + "px)";
n.transform = i,
n.webkitTransform = i
}
}
}
,
extendPrototype([BaseElement, TransformElement, HBaseElement,
HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], HTextElement),
HTextElement.prototype.createContent = function() {
if (this.isMasked = this.checkMasks(),
this.isMasked) {
this.renderType = "svg",
this.compW = this.comp.data.w,
this.compH = this.comp.data.h,
this.svgElement.setAttribute("width", this.compW),
this.svgElement.setAttribute("height", this.compH);
var e = createNS("g");
this.maskedElement.appendChild(e),
this.innerElem = e
} else
this.renderType = "html",
this.innerElem = this.layerElement;
this.checkParenting()
}
,
HTextElement.prototype.buildNewText = function() {
var e = this.textProperty.currentData;
this.renderedLetters = createSizedArray(e.l ? e.l.length : 0);
var t = this.innerElem.style
, r = e.fc ? this.buildColor(e.fc) : "rgba(0,0,0,0)";
t.fill = r,
t.color = r,
e.sc && (t.stroke = this.buildColor(e.sc),
t.strokeWidth = e.sw + "px");
var n, i, o = this.globalData.fontManager.getFontByName(e.f);
if (!this.globalData.fontManager.chars)
if (t.fontSize = e.finalSize + "px",
t.lineHeight = e.finalSize + "px",
o.fClass)
this.innerElem.className = o.fClass;
else {
t.fontFamily = o.fFamily;
var s = e.fWeight
, a = e.fStyle;
t.fontStyle = a,
t.fontWeight = s
}
var l, c, u, d = e.l;
i = d.length;
var p, h = this.mHelper, f = "", m = 0;
for (n = 0; n < i; n += 1) {
if (this.globalData.fontManager.chars ?
(this.textPaths[m] ? l = this.textPaths[m] : ((l =
createNS("path")).setAttribute("stroke-linecap", lineCapEnum[1]),
l.setAttribute("stroke-linejoin", lineJoinEnum[2]),
l.setAttribute("stroke-miterlimit", "4")),
this.isMasked || (this.textSpans[m] ? u = (c =
this.textSpans[m]).children[0] : ((c = createTag("div")).style.lineHeight = 0,
(u = createNS("svg")).appendChild(l),
styleDiv(c)))) : this.isMasked ? l = this.textPaths[m] ?
this.textPaths[m] : createNS("text") : this.textSpans[m] ? (c = this.textSpans[m],
l = this.textPaths[m]) : (styleDiv(c = createTag("span")),
styleDiv(l = createTag("span")),
c.appendChild(l)),
this.globalData.fontManager.chars) {
var g, y =
this.globalData.fontManager.getCharData(e.finalText[n], o.fStyle,
this.globalData.fontManager.getFontByName(e.f).fFamily);
if (g = y ? y.data : null,
h.reset(),
g && g.shapes && g.shapes.length && (p =
g.shapes[0].it,
h.scale(e.finalSize / 100, e.finalSize / 100),
f = this.createPathShape(h, p),
l.setAttribute("d", f)),
this.isMasked)
this.innerElem.appendChild(l);
else {
if (this.innerElem.appendChild(c),
g && g.shapes) {
document.body.appendChild(u);
var v = u.getBBox();
u.setAttribute("width", v.width + 2),
u.setAttribute("height", v.height + 2),
u.setAttribute("viewBox", v.x - 1 + " " + (v.y
- 1) + " " + (v.width + 2) + " " + (v.height + 2));
var b = u.style
, x = "translate(" + (v.x - 1) + "px," + (v.y
- 1) + "px)";
b.transform = x,
b.webkitTransform = x,
d[n].yOffset = v.y - 1
} else
u.setAttribute("width", 1),
u.setAttribute("height", 1);
c.appendChild(u)
}
} else if (l.textContent = d[n].val,
l.setAttributeNS("http://www.w3.org/XML/1998/namespace",
"xml:space", "preserve"),
this.isMasked)
this.innerElem.appendChild(l);
else {
this.innerElem.appendChild(c);
var _ = l.style
, E = "translate3d(0," + -e.finalSize / 1.2 +
"px,0)";
_.transform = E,
_.webkitTransform = E
}
this.isMasked ? this.textSpans[m] = l : this.textSpans[m] =
c,
this.textSpans[m].style.display = "block",
this.textPaths[m] = l,
m += 1
}
for (; m < this.textSpans.length; )
this.textSpans[m].style.display = "none",
m += 1
}
,
HTextElement.prototype.renderInnerContent = function() {
var e;
if (this.validateText(),
this.data.singleShape) {
if (!this._isFirstFrame && !this.lettersChangedFlag)
return;
if (this.isMasked && this.finalTransform._matMdf) {
this.svgElement.setAttribute("viewBox", -
this.finalTransform.mProp.p.v[0] + " " + -this.finalTransform.mProp.p.v[1] + " " +
this.compW + " " + this.compH),
e = this.svgElement.style;
var t = "translate(" + -
this.finalTransform.mProp.p.v[0] + "px," + -this.finalTransform.mProp.p.v[1] +
"px)";
e.transform = t,
e.webkitTransform = t
}
}
if
(this.textAnimator.getMeasures(this.textProperty.currentData,
this.lettersChangedFlag),
this.lettersChangedFlag ||
this.textAnimator.lettersChangedFlag) {
var r, n, i, o, s, a = 0, l =
this.textAnimator.renderedLetters, c = this.textProperty.currentData.l;
for (n = c.length,
r = 0; r < n; r += 1)
c[r].n ? a += 1 : (o = this.textSpans[r],
s = this.textPaths[r],
i = l[a],
a += 1,
i._mdf.m && (this.isMasked ?
o.setAttribute("transform", i.m) : (o.style.webkitTransform = i.m,
o.style.transform = i.m)),
o.style.opacity = i.o,
i.sw && i._mdf.sw && s.setAttribute("stroke-width",
i.sw),
i.sc && i._mdf.sc && s.setAttribute("stroke", i.sc),
i.fc && i._mdf.fc && (s.setAttribute("fill", i.fc),
s.style.color = i.fc));
if (this.innerElem.getBBox && !this.hidden &&
(this._isFirstFrame || this._mdf)) {
var u = this.innerElem.getBBox();
if (this.currentBBox.w !== u.width &&
(this.currentBBox.w = u.width,
this.svgElement.setAttribute("width", u.width)),
this.currentBBox.h !== u.height && (this.currentBBox.h
= u.height,
this.svgElement.setAttribute("height", u.height)),
this.currentBBox.w !== u.width + 2 ||
this.currentBBox.h !== u.height + 2 || this.currentBBox.x !== u.x - 1 ||
this.currentBBox.y !== u.y - 1) {
this.currentBBox.w = u.width + 2,
this.currentBBox.h = u.height + 2,
this.currentBBox.x = u.x - 1,
this.currentBBox.y = u.y - 1,
this.svgElement.setAttribute("viewBox",
this.currentBBox.x + " " + this.currentBBox.y + " " + this.currentBBox.w + " " +
this.currentBBox.h),
e = this.svgElement.style;
var d = "translate(" + this.currentBBox.x + "px," +
this.currentBBox.y + "px)";
e.transform = d,
e.webkitTransform = d
}
}
}
}
,
extendPrototype([BaseElement, FrameElement, HierarchyElement],
HCameraElement),
HCameraElement.prototype.setup = function() {
var e, t, r, n, i = this.comp.threeDElements.length;
for (e = 0; e < i; e += 1)
if ("3d" === (t = this.comp.threeDElements[e]).type) {
r = t.perspectiveElem.style,
n = t.container.style;
var o = this.pe.v + "px"
, s = "0px 0px 0px"
, a = "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";
r.perspective = o,
r.webkitPerspective = o,
n.transformOrigin = s,
n.mozTransformOrigin = s,
n.webkitTransformOrigin = s,
r.transform = a,
r.webkitTransform = a
}
}
,
HCameraElement.prototype.createElements = function() {}
,
HCameraElement.prototype.hide = function() {}
,
HCameraElement.prototype.renderFrame = function() {
var e, t, r = this._isFirstFrame;
if (this.hierarchy)
for (t = this.hierarchy.length,
e = 0; e < t; e += 1)
r = this.hierarchy[e].finalTransform.mProp._mdf || r;
if (r || this.pe._mdf || this.p && this.p._mdf || this.px &&
(this.px._mdf || this.py._mdf || this.pz._mdf) || this.rx._mdf || this.ry._mdf ||
this.rz._mdf || this.or._mdf || this.a && this.a._mdf) {
if (this.mat.reset(),
this.hierarchy)
for (e = t = this.hierarchy.length - 1; e >= 0; e -= 1)
{
var n = this.hierarchy[e].finalTransform.mProp;
this.mat.translate(-n.p.v[0], -n.p.v[1], n.p.v[2]),
this.mat.rotateX(-n.or.v[0]).rotateY(-
n.or.v[1]).rotateZ(n.or.v[2]),
this.mat.rotateX(-n.rx.v).rotateY(-
n.ry.v).rotateZ(n.rz.v),
this.mat.scale(1 / n.s.v[0], 1 / n.s.v[1], 1 /
n.s.v[2]),
this.mat.translate(n.a.v[0], n.a.v[1], n.a.v[2])
}
if (this.p ? this.mat.translate(-this.p.v[0], -this.p.v[1],
this.p.v[2]) : this.mat.translate(-this.px.v, -this.py.v, this.pz.v),
this.a) {
var i;
i = this.p ? [this.p.v[0] - this.a.v[0], this.p.v[1] -
this.a.v[1], this.p.v[2] - this.a.v[2]] : [this.px.v - this.a.v[0], this.py.v -
this.a.v[1], this.pz.v - this.a.v[2]];
var o = Math.sqrt(Math.pow(i[0], 2) + Math.pow(i[1], 2)
+ Math.pow(i[2], 2))
, s = [i[0] / o, i[1] / o, i[2] / o]
, a = Math.sqrt(s[2] * s[2] + s[0] * s[0])
, l = Math.atan2(s[1], a)
, c = Math.atan2(s[0], -s[2]);
this.mat.rotateY(c).rotateX(-l)
}
this.mat.rotateX(-this.rx.v).rotateY(-
this.ry.v).rotateZ(this.rz.v),
this.mat.rotateX(-this.or.v[0]).rotateY(-
this.or.v[1]).rotateZ(this.or.v[2]),
this.mat.translate(this.globalData.compSize.w / 2,
this.globalData.compSize.h / 2, 0),
this.mat.translate(0, 0, this.pe.v);
var u = !this._prevMat.equals(this.mat);
if ((u || this.pe._mdf) && this.comp.threeDElements) {
var d, p, h;
for (t = this.comp.threeDElements.length,
e = 0; e < t; e += 1)
if ("3d" === (d =
this.comp.threeDElements[e]).type) {
if (u) {
var f = this.mat.toCSS();
(h = d.container.style).transform = f,
h.webkitTransform = f
}
this.pe._mdf && ((p =
d.perspectiveElem.style).perspective = this.pe.v + "px",
p.webkitPerspective = this.pe.v + "px")
}
this.mat.clone(this._prevMat)
}
}
this._isFirstFrame = !1
}
,
HCameraElement.prototype.prepareFrame = function(e) {
this.prepareProperties(e, !0)
}
,
HCameraElement.prototype.destroy = function() {}
,
HCameraElement.prototype.getBaseElement = function() {
return null
}
,
extendPrototype([BaseElement, TransformElement, HBaseElement,
HSolidElement, HierarchyElement, FrameElement, RenderableElement], HImageElement),
HImageElement.prototype.createContent = function() {
var e = this.globalData.getAssetsPath(this.assetData)
, t = new Image;
this.data.hasMask ? (this.imageElem = createNS("image"),
this.imageElem.setAttribute("width", this.assetData.w + "px"),
this.imageElem.setAttribute("height", this.assetData.h + "px"),
this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink",
"href", e),
this.layerElement.appendChild(this.imageElem),
this.baseElement.setAttribute("width", this.assetData.w),
this.baseElement.setAttribute("height", this.assetData.h)) :
this.layerElement.appendChild(t),
t.crossOrigin = "anonymous",
t.src = e,
this.data.ln && this.baseElement.setAttribute("id",
this.data.ln)
}
,
extendPrototype([BaseRenderer], HybridRendererBase),
HybridRendererBase.prototype.buildItem =
SVGRenderer.prototype.buildItem,
HybridRendererBase.prototype.checkPendingElements = function() {
for (; this.pendingElements.length; )
this.pendingElements.pop().checkParenting()
}
,
HybridRendererBase.prototype.appendElementInPos = function(e, t) {
var r = e.getBaseElement();
if (r) {
var n = this.layers[t];
if (n.ddd && this.supports3d)
this.addTo3dContainer(r, t);
else if (this.threeDElements)
this.addTo3dContainer(r, t);
else {
for (var i, o, s = 0; s < t; )
this.elements[s] && !0 !== this.elements[s] &&
this.elements[s].getBaseElement && (o = this.elements[s],
i = (this.layers[s].ddd ?
this.getThreeDContainerByPos(s) : o.getBaseElement()) || i),
s += 1;
i ? n.ddd && this.supports3d ||
this.layerElement.insertBefore(r, i) : n.ddd && this.supports3d ||
this.layerElement.appendChild(r)
}
}
}
,
HybridRendererBase.prototype.createShape = function(e) {
return this.supports3d ? new
HShapeElement(e,this.globalData,this) : new SVGShapeElement(e,this.globalData,this)
}
,
HybridRendererBase.prototype.createText = function(e) {
return this.supports3d ? new
HTextElement(e,this.globalData,this) : new
SVGTextLottieElement(e,this.globalData,this)
}
,
HybridRendererBase.prototype.createCamera = function(e) {
return this.camera = new
HCameraElement(e,this.globalData,this),
this.camera
}
,
HybridRendererBase.prototype.createImage = function(e) {
return this.supports3d ? new
HImageElement(e,this.globalData,this) : new IImageElement(e,this.globalData,this)
}
,
HybridRendererBase.prototype.createSolid = function(e) {
return this.supports3d ? new
HSolidElement(e,this.globalData,this) : new ISolidElement(e,this.globalData,this)
}
,
HybridRendererBase.prototype.createNull =
SVGRenderer.prototype.createNull,
HybridRendererBase.prototype.getThreeDContainerByPos = function(e)
{
for (var t = 0, r = this.threeDElements.length; t < r; ) {
if (this.threeDElements[t].startPos <= e &&
this.threeDElements[t].endPos >= e)
return this.threeDElements[t].perspectiveElem;
t += 1
}
return null
}
,
HybridRendererBase.prototype.createThreeDContainer = function(e, t)
{
var r, n, i = createTag("div");
styleDiv(i);
var o = createTag("div");
if (styleDiv(o),
"3d" === t) {
(r = i.style).width = this.globalData.compSize.w + "px",
r.height = this.globalData.compSize.h + "px";
var s = "50% 50%";
r.webkitTransformOrigin = s,
r.mozTransformOrigin = s,
r.transformOrigin = s;
var a = "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";
(n = o.style).transform = a,
n.webkitTransform = a
}
i.appendChild(o);
var l = {
container: o,
perspectiveElem: i,
startPos: e,
endPos: e,
type: t
};
return this.threeDElements.push(l),
l
}
,
HybridRendererBase.prototype.build3dContainers = function() {
var e, t, r = this.layers.length, n = "";
for (e = 0; e < r; e += 1)
this.layers[e].ddd && 3 !== this.layers[e].ty ? ("3d" !== n
&& (n = "3d",
t = this.createThreeDContainer(e, "3d")),
t.endPos = Math.max(t.endPos, e)) : ("2d" !== n && (n =
"2d",
t = this.createThreeDContainer(e, "2d")),
t.endPos = Math.max(t.endPos, e));
for (e = (r = this.threeDElements.length) - 1; e >= 0; e -= 1)
this.resizerElem.appendChild(this.threeDElements[e].perspectiveElem)
}
,
HybridRendererBase.prototype.addTo3dContainer = function(e, t) {
for (var r = 0, n = this.threeDElements.length; r < n; ) {
if (t <= this.threeDElements[r].endPos) {
for (var i, o = this.threeDElements[r].startPos; o < t;
)
this.elements[o] && this.elements[o].getBaseElement
&& (i = this.elements[o].getBaseElement()),
o += 1;
i ? this.threeDElements[r].container.insertBefore(e, i)
: this.threeDElements[r].container.appendChild(e);
break
}
r += 1
}
}
,
HybridRendererBase.prototype.configAnimation = function(e) {
var t = createTag("div")
, r = this.animationItem.wrapper
, n = t.style;
n.width = e.w + "px",
n.height = e.h + "px",
this.resizerElem = t,
styleDiv(t),
n.transformStyle = "flat",
n.mozTransformStyle = "flat",
n.webkitTransformStyle = "flat",
this.renderConfig.className && t.setAttribute("class",
this.renderConfig.className),
r.appendChild(t),
n.overflow = "hidden";
var i = createNS("svg");
i.setAttribute("width", "1"),
i.setAttribute("height", "1"),
styleDiv(i),
this.resizerElem.appendChild(i);
var o = createNS("defs");
i.appendChild(o),
this.data = e,
this.setupGlobalData(e, i),
this.globalData.defs = o,
this.layers = e.layers,
this.layerElement = this.resizerElem,
this.build3dContainers(),
this.updateContainerSize()
}
,
HybridRendererBase.prototype.destroy = function() {
var e;
this.animationItem.wrapper &&
(this.animationItem.wrapper.innerText = ""),
this.animationItem.container = null,
this.globalData.defs = null;
var t = this.layers ? this.layers.length : 0;
for (e = 0; e < t; e += 1)
this.elements[e] && this.elements[e].destroy &&
this.elements[e].destroy();
this.elements.length = 0,
this.destroyed = !0,
this.animationItem = null
}
,
HybridRendererBase.prototype.updateContainerSize = function() {
var e, t, r, n, i = this.animationItem.wrapper.offsetWidth, o =
this.animationItem.wrapper.offsetHeight, s = i / o;
this.globalData.compSize.w / this.globalData.compSize.h > s ?
(e = i / this.globalData.compSize.w,
t = i / this.globalData.compSize.w,
r = 0,
n = (o - this.globalData.compSize.h * (i /
this.globalData.compSize.w)) / 2) : (e = o / this.globalData.compSize.h,
t = o / this.globalData.compSize.h,
r = (i - this.globalData.compSize.w * (o /
this.globalData.compSize.h)) / 2,
n = 0);
var a = this.resizerElem.style;
a.webkitTransform = "matrix3d(" + e + ",0,0,0,0," + t +
",0,0,0,0,1,0," + r + "," + n + ",0,1)",
a.transform = a.webkitTransform
}
,
HybridRendererBase.prototype.renderFrame =
SVGRenderer.prototype.renderFrame,
HybridRendererBase.prototype.hide = function() {
this.resizerElem.style.display = "none"
}
,
HybridRendererBase.prototype.show = function() {
this.resizerElem.style.display = "block"
}
,
HybridRendererBase.prototype.initItems = function() {
if (this.buildAllItems(),
this.camera)
this.camera.setup();
else {
var e, t = this.globalData.compSize.w, r =
this.globalData.compSize.h, n = this.threeDElements.length;
for (e = 0; e < n; e += 1) {
var i = this.threeDElements[e].perspectiveElem.style;
i.webkitPerspective = Math.sqrt(Math.pow(t, 2) +
Math.pow(r, 2)) + "px",
i.perspective = i.webkitPerspective
}
}
}
,
HybridRendererBase.prototype.searchExtraCompositions = function(e)
{
var t, r = e.length, n = createTag("div");
for (t = 0; t < r; t += 1)
if (e[t].xt) {
var i = this.createComp(e[t], n, this.globalData.comp,
null);
i.initExpressions(),
this.globalData.projectInterface.registerComposition(i)
}
}
,
extendPrototype([HybridRendererBase, ICompElement, HBaseElement],
HCompElement),
HCompElement.prototype._createBaseContainerElements =
HCompElement.prototype.createContainerElements,
HCompElement.prototype.createContainerElements = function() {
this._createBaseContainerElements(),
this.data.hasMask ? (this.svgElement.setAttribute("width",
this.data.w),
this.svgElement.setAttribute("height", this.data.h),
this.transformedElement = this.baseElement) :
this.transformedElement = this.layerElement
}
,
HCompElement.prototype.addTo3dContainer = function(e, t) {
for (var r, n = 0; n < t; )
this.elements[n] && this.elements[n].getBaseElement && (r =
this.elements[n].getBaseElement()),
n += 1;
r ? this.layerElement.insertBefore(e, r) :
this.layerElement.appendChild(e)
}
,
HCompElement.prototype.createComp = function(e) {
return this.supports3d ? new
HCompElement(e,this.globalData,this) : new SVGCompElement(e,this.globalData,this)
}
,
extendPrototype([HybridRendererBase], HybridRenderer),
HybridRenderer.prototype.createComp = function(e) {
return this.supports3d ? new
HCompElement(e,this.globalData,this) : new SVGCompElement(e,this.globalData,this)
}
;
var CompExpressionInterface = function(e) {
function t(t) {
for (var r = 0, n = e.layers.length; r < n; ) {
if (e.layers[r].nm === t || e.layers[r].ind === t)
return e.elements[r].layerInterface;
r += 1
}
return null
}
return Object.defineProperty(t, "_name", {
value: e.data.nm
}),
t.layer = t,
t.pixelAspect = 1,
t.height = e.data.h || e.globalData.compSize.h,
t.width = e.data.w || e.globalData.compSize.w,
t.pixelAspect = 1,
t.frameDuration = 1 / e.globalData.frameRate,
t.displayStartTime = 0,
t.numLayers = e.layers.length,
t
};
function _typeof$2(e) {
return (_typeof$2 = "function" == typeof Symbol && "symbol" ==
typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor
=== Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
function seedRandom(e, t) {
var r = this
, n = 256
, i = "random"
, o = t.pow(n, 6)
, s = t.pow(2, 52)
, a = 2 * s
, l = n - 1;
function c(e) {
var t, r = e.length, i = this, o = 0, s = i.i = i.j = 0, a
= i.S = [];
for (r || (e = [r++]); o < n; )
a[o] = o++;
for (o = 0; o < n; o++)
a[o] = a[s = l & s + e[o % r] + (t = a[o])],
a[s] = t;
i.g = function(e) {
for (var t, r = 0, o = i.i, s = i.j, a = i.S; e--; )
t = a[o = l & o + 1],
r = r * n + a[l & (a[o] = a[s = l & s + t]) + (a[s]
= t)];
return i.i = o,
i.j = s,
r
}
}
function u(e, t) {
return t.i = e.i,
t.j = e.j,
t.S = e.S.slice(),
t
}
function d(e, t) {
var r, n = [], i = _typeof$2(e);
if (t && "object" == i)
for (r in e)
try {
n.push(d(e[r], t - 1))
} catch (e2) {}
return n.length ? n : "string" == i ? e : e + "\0"
}
function p(e, t) {
for (var r, n = e + "", i = 0; i < n.length; )
t[l & i] = l & (r ^= 19 * t[l & i]) + n.charCodeAt(i+
+);
return h(t)
}
function h(e) {
return String.fromCharCode.apply(0, e)
}
t["seed" + i] = function(l, f, m) {
var g = []
, y = p(d((f = !0 === f ? {
entropy: !0
} : f || {}).entropy ? [l, h(e)] : null === l ? function()
{
try {
var t = new Uint8Array(n);
return (r.crypto || r.msCrypto).getRandomValues(t),
h(t)
} catch (e2) {
var i = r.navigator
, o = i && i.plugins;
return [+new Date, r, o, r.screen, h(e)]
}
}() : l, 3), g)
, v = new c(g)
, b = function() {
for (var e = v.g(6), t = o, r = 0; e < s; )
e = (e + r) * n,
t *= n,
r = v.g(1);
for (; e >= a; )
e /= 2,
t /= 2,
r >>>= 1;
return (e + r) / t
};
return b.int32 = function() {
return 0 | v.g(4)
}
,
b.quick = function() {
return v.g(4) / 4294967296
}
,
b.double = b,
p(h(v.S), e),
(f.pass || m || function(e, r, n, o) {
return o && (o.S && u(o, v),
e.state = function() {
return u(v, {})
}
),
n ? (t[i] = e,
r) : e
}
)(b, y, "global"in f ? f.global : this == t, f.state)
}
,
p(t.random(), e)
}
function initialize$2(e) {
seedRandom([], e)
}
var propTypes = {
SHAPE: "shape"
};
function _typeof$1(e) {
return (_typeof$1 = "function" == typeof Symbol && "symbol" ==
typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor
=== Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
var ExpressionManager = function() {
var ob = {}
, Math = BMMath
, window = null
, document = null
, XMLHttpRequest = null
, fetch = null
, frames = null
, _lottieGlobal = {};
function resetFrame() {
_lottieGlobal = {}
}
function $bm_isInstanceOfArray(e) {
return e.constructor === Array || e.constructor ===
Float32Array
}
function isNumerable(e, t) {
return "number" === e || t instanceof Number || "boolean"
=== e || "string" === e
}
function $bm_neg(e) {
var t = _typeof$1(e);
if ("number" === t || e instanceof Number || "boolean" ===
t)
return -e;
if ($bm_isInstanceOfArray(e)) {
var r, n = e.length, i = [];
for (r = 0; r < n; r += 1)
i[r] = -e[r];
return i
}
return e.propType ? e.v : -e
}
initialize$2(BMMath);
var easeInBez = BezierFactory.getBezierEasing(.333,
0, .833, .833, "easeIn").get
, easeOutBez =
BezierFactory.getBezierEasing(.167, .167, .667, 1, "easeOut").get
, easeInOutBez = BezierFactory.getBezierEasing(.33, 0, .667,
1, "easeInOut").get;
function sum(e, t) {
var r = _typeof$1(e)
, n = _typeof$1(t);
if (isNumerable(r, e) && isNumerable(n, t) || "string" ===
r || "string" === n)
return e + t;
if ($bm_isInstanceOfArray(e) && isNumerable(n, t))
return (e = e.slice(0))[0] += t,
e;
if (isNumerable(r, e) && $bm_isInstanceOfArray(t))
return (t = t.slice(0))[0] = e + t[0],
t;
if ($bm_isInstanceOfArray(e) && $bm_isInstanceOfArray(t)) {
for (var i = 0, o = e.length, s = t.length, a = []; i <
o || i < s; )
("number" == typeof e[i] || e[i]instanceof Number)
&& ("number" == typeof t[i] || t[i]instanceof Number) ? a[i] = e[i] + t[i] : a[i] =
void 0 === t[i] ? e[i] : e[i] || t[i],
i += 1;
return a
}
return 0
}
var add = sum;
function sub(e, t) {
var r = _typeof$1(e)
, n = _typeof$1(t);
if (isNumerable(r, e) && isNumerable(n, t))
return "string" === r && (e = parseInt(e, 10)),
"string" === n && (t = parseInt(t, 10)),
e - t;
if ($bm_isInstanceOfArray(e) && isNumerable(n, t))
return (e = e.slice(0))[0] -= t,
e;
if (isNumerable(r, e) && $bm_isInstanceOfArray(t))
return (t = t.slice(0))[0] = e - t[0],
t;
if ($bm_isInstanceOfArray(e) && $bm_isInstanceOfArray(t)) {
for (var i = 0, o = e.length, s = t.length, a = []; i <
o || i < s; )
("number" == typeof e[i] || e[i]instanceof Number)
&& ("number" == typeof t[i] || t[i]instanceof Number) ? a[i] = e[i] - t[i] : a[i] =
void 0 === t[i] ? e[i] : e[i] || t[i],
i += 1;
return a
}
return 0
}
function mul(e, t) {
var r, n, i, o = _typeof$1(e), s = _typeof$1(t);
if (isNumerable(o, e) && isNumerable(s, t))
return e * t;
if ($bm_isInstanceOfArray(e) && isNumerable(s, t)) {
for (i = e.length,
r = createTypedArray("float32", i),
n = 0; n < i; n += 1)
r[n] = e[n] * t;
return r
}
if (isNumerable(o, e) && $bm_isInstanceOfArray(t)) {
for (i = t.length,
r = createTypedArray("float32", i),
n = 0; n < i; n += 1)
r[n] = e * t[n];
return r
}
return 0
}
function div(e, t) {
var r, n, i, o = _typeof$1(e), s = _typeof$1(t);
if (isNumerable(o, e) && isNumerable(s, t))
return e / t;
if ($bm_isInstanceOfArray(e) && isNumerable(s, t)) {
for (i = e.length,
r = createTypedArray("float32", i),
n = 0; n < i; n += 1)
r[n] = e[n] / t;
return r
}
if (isNumerable(o, e) && $bm_isInstanceOfArray(t)) {
for (i = t.length,
r = createTypedArray("float32", i),
n = 0; n < i; n += 1)
r[n] = e / t[n];
return r
}
return 0
}
function mod(e, t) {
return "string" == typeof e && (e = parseInt(e, 10)),
"string" == typeof t && (t = parseInt(t, 10)),
e % t
}
var $bm_sum = sum
, $bm_sub = sub
, $bm_mul = mul
, $bm_div = div
, $bm_mod = mod;
function clamp(e, t, r) {
if (t > r) {
var n = r;
r = t,
t = n
}
return Math.min(Math.max(e, t), r)
}
function radiansToDegrees(e) {
return e / degToRads
}
var radians_to_degrees = radiansToDegrees;
function degreesToRadians(e) {
return e * degToRads
}
var degrees_to_radians = radiansToDegrees
, helperLengthArray = [0, 0, 0, 0, 0, 0];
function length(e, t) {
if ("number" == typeof e || e instanceof Number)
return t = t || 0,
Math.abs(e - t);
var r;
t || (t = helperLengthArray);
var n = Math.min(e.length, t.length)
, i = 0;
for (r = 0; r < n; r += 1)
i += Math.pow(t[r] - e[r], 2);
return Math.sqrt(i)
}
function normalize(e) {
return div(e, length(e))
}
function rgbToHsl(e) {
var t, r, n = e[0], i = e[1], o = e[2], s = Math.max(n, i,
o), a = Math.min(n, i, o), l = (s + a) / 2;
if (s === a)
t = 0,
r = 0;
else {
var c = s - a;
switch (r = l > .5 ? c / (2 - s - a) : c / (s + a),
s) {
case n:
t = (i - o) / c + (i < o ? 6 : 0);
break;
case i:
t = (o - n) / c + 2;
break;
case o:
t = (n - i) / c + 4
}
t /= 6
}
return [t, r, l, e[3]]
}
function hue2rgb(e, t, r) {
return r < 0 && (r += 1),
r > 1 && (r -= 1),
r < 1 / 6 ? e + 6 * (t - e) * r : r < .5 ? t : r < 2 / 3 ?
e + (t - e) * (2 / 3 - r) * 6 : e
}
function hslToRgb(e) {
var t, r, n, i = e[0], o = e[1], s = e[2];
if (0 === o)
t = s,
n = s,
r = s;
else {
var a = s < .5 ? s * (1 + o) : s + o - s * o
, l = 2 * s - a;
t = hue2rgb(l, a, i + 1 / 3),
r = hue2rgb(l, a, i),
n = hue2rgb(l, a, i - 1 / 3)
}
return [t, r, n, e[3]]
}
function linear(e, t, r, n, i) {
if (void 0 !== n && void 0 !== i || (n = t,
i = r,
t = 0,
r = 1),
r < t) {
var o = r;
r = t,
t = o
}
if (e <= t)
return n;
if (e >= r)
return i;
var s, a = r === t ? 0 : (e - t) / (r - t);
if (!n.length)
return n + (i - n) * a;
var l = n.length
, c = createTypedArray("float32", l);
for (s = 0; s < l; s += 1)
c[s] = n[s] + (i[s] - n[s]) * a;
return c
}
function random(e, t) {
if (void 0 === t && (void 0 === e ? (e = 0,
t = 1) : (t = e,
e = void 0)),
t.length) {
var r, n = t.length;
e || (e = createTypedArray("float32", n));
var i = createTypedArray("float32", n)
, o = BMMath.random();
for (r = 0; r < n; r += 1)
i[r] = e[r] + o * (t[r] - e[r]);
return i
}
return void 0 === e && (e = 0),
e + BMMath.random() * (t - e)
}
function createPath(e, t, r, n) {
var i, o = e.length, s = shapePool.newElement();
s.setPathData(!!n, o);
var a, l, c = [0, 0];
for (i = 0; i < o; i += 1)
a = t && t[i] ? t[i] : c,
l = r && r[i] ? r[i] : c,
s.setTripleAt(e[i][0], e[i][1], l[0] + e[i][0], l[1] +
e[i][1], a[0] + e[i][0], a[1] + e[i][1], i, !0);
return s
}
function initiateExpression(elem, data, property) {
function noOp(e) {
return e
}
if (!elem.globalData.renderConfig.runExpressions)
return noOp;
var val = data.x, needsVelocity = /velocity(?![\w\
d])/.test(val), _needsRandom = -1 !== val.indexOf("random"), elemType =
elem.data.ty, transform, $bm_transform, content, effect, thisProperty = property;
thisProperty.valueAtTime = thisProperty.getValueAtTime,
Object.defineProperty(thisProperty, "value", {
get: function() {
return thisProperty.v
}
}),
elem.comp.frameDuration = 1 /
elem.comp.globalData.frameRate,
elem.comp.displayStartTime = 0;
var inPoint = elem.data.ip /
elem.comp.globalData.frameRate, outPoint = elem.data.op /
elem.comp.globalData.frameRate, width = elem.data.sw ? elem.data.sw : 0, height =
elem.data.sh ? elem.data.sh : 0, name = elem.data.nm, loopIn, loop_in, loopOut,
loop_out, smooth, toWorld, fromWorld, fromComp, toComp, fromCompToSurface,
position, rotation, anchorPoint, scale, thisLayer, thisComp, mask, valueAtTime,
velocityAtTime, scoped_bm_rt, expression_function = eval("[function
_expression_function(){" + val + ";scoped_bm_rt=$bm_rt}]")[0], numKeys =
property.kf ? data.k.length : 0, active = !this.data || !0 !== this.data.hd, wiggle
= function(e, t) {
var r, n, i = this.pv.length ? this.pv.length : 1, o =
createTypedArray("float32", i), s = Math.floor(5 * time);
for (r = 0,
n = 0; r < s; ) {
for (n = 0; n < i; n += 1)
o[n] += -t + 2 * t * BMMath.random();
r += 1
}
var a = 5 * time
, l = a - Math.floor(a)
, c = createTypedArray("float32", i);
if (i > 1) {
for (n = 0; n < i; n += 1)
c[n] = this.pv[n] + o[n] + (-t + 2 * t *
BMMath.random()) * l;
return c
}
return this.pv + o[0] + (-t + 2 * t * BMMath.random())
* l
}
.bind(this);
function loopInDuration(e, t) {
return loopIn(e, t, !0)
}
function loopOutDuration(e, t) {
return loopOut(e, t, !0)
}
thisProperty.loopIn && (loopIn =
thisProperty.loopIn.bind(thisProperty),
loop_in = loopIn),
thisProperty.loopOut && (loopOut =
thisProperty.loopOut.bind(thisProperty),
loop_out = loopOut),
thisProperty.smooth && (smooth =
thisProperty.smooth.bind(thisProperty)),
this.getValueAtTime && (valueAtTime =
this.getValueAtTime.bind(this)),
this.getVelocityAtTime && (velocityAtTime =
this.getVelocityAtTime.bind(this));
var comp =
elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),
time, velocity, value, text, textIndex, textTotal, selectorValue;
function lookAt(e, t) {
var r = [t[0] - e[0], t[1] - e[1], t[2] - e[2]]
, n = Math.atan2(r[0], Math.sqrt(r[1] * r[1] + r[2] *
r[2])) / degToRads;
return [-Math.atan2(r[1], r[2]) / degToRads, n, 0]
}
function easeOut(e, t, r, n, i) {
return applyEase(easeOutBez, e, t, r, n, i)
}
function easeIn(e, t, r, n, i) {
return applyEase(easeInBez, e, t, r, n, i)
}
function ease(e, t, r, n, i) {
return applyEase(easeInOutBez, e, t, r, n, i)
}
function applyEase(e, t, r, n, i, o) {
void 0 === i ? (i = r,
o = n) : t = (t - r) / (n - r),
t > 1 ? t = 1 : t < 0 && (t = 0);
var s = e(t);
if ($bm_isInstanceOfArray(i)) {
var a, l = i.length, c =
createTypedArray("float32", l);
for (a = 0; a < l; a += 1)
c[a] = (o[a] - i[a]) * s + i[a];
return c
}
return (o - i) * s + i
}
function nearestKey(e) {
var t, r, n, i = data.k.length;
if (data.k.length && "number" != typeof data.k[0])
if (r = -1,
(e *= elem.comp.globalData.frameRate) <
data.k[0].t)
r = 1,
n = data.k[0].t;
else {
for (t = 0; t < i - 1; t += 1) {
if (e === data.k[t].t) {
r = t + 1,
n = data.k[t].t;
break
}
if (e > data.k[t].t && e < data.k[t + 1].t)
{
e - data.k[t].t > data.k[t + 1].t - e ?
(r = t + 2,
n = data.k[t + 1].t) : (r = t + 1,
n = data.k[t].t);
break
}
}
-1 === r && (r = t + 1,
n = data.k[t].t)
}
else
r = 0,
n = 0;
var o = {};
return o.index = r,
o.time = n / elem.comp.globalData.frameRate,
o
}
function key(e) {
var t, r, n;
if (!data.k.length || "number" == typeof data.k[0])
throw new Error("The property has no keyframe at
index " + e);
e -= 1,
t = {
time: data.k[e].t / elem.comp.globalData.frameRate,
value: []
};
var i = Object.prototype.hasOwnProperty.call(data.k[e],
"s") ? data.k[e].s : data.k[e - 1].e;
for (n = i.length,
r = 0; r < n; r += 1)
t[r] = i[r],
t.value[r] = i[r];
return t
}
function framesToTime(e, t) {
return t || (t = elem.comp.globalData.frameRate),
e / t
}
function timeToFrames(e, t) {
return e || 0 === e || (e = time),
t || (t = elem.comp.globalData.frameRate),
e * t
}
function seedRandom(e) {
BMMath.seedrandom(randSeed + e)
}
function sourceRectAtTime() {
return elem.sourceRectAtTime()
}
function substring(e, t) {
return "string" == typeof value ? void 0 === t ?
value.substring(e) : value.substring(e, t) : ""
}
function substr(e, t) {
return "string" == typeof value ? void 0 === t ?
value.substr(e) : value.substr(e, t) : ""
}
function posterizeTime(e) {
time = 0 === e ? 0 : Math.floor(time * e) / e,
value = valueAtTime(time)
}
var index = elem.data.ind, hasParent = !(!elem.hierarchy ||
!elem.hierarchy.length), parent, randSeed = Math.floor(1e6 * Math.random()),
globalData = elem.globalData;
function executeExpression(e) {
return value = e,
this.frameExpressionId === elem.globalData.frameId &&
"textSelector" !== this.propType ? value : ("textSelector" === this.propType &&
(textIndex = this.textIndex,
textTotal = this.textTotal,
selectorValue = this.selectorValue),
thisLayer || (text = elem.layerInterface.text,
thisLayer = elem.layerInterface,
thisComp = elem.comp.compInterface,
toWorld = thisLayer.toWorld.bind(thisLayer),
fromWorld = thisLayer.fromWorld.bind(thisLayer),
fromComp = thisLayer.fromComp.bind(thisLayer),
toComp = thisLayer.toComp.bind(thisLayer),
mask = thisLayer.mask ?
thisLayer.mask.bind(thisLayer) : null,
fromCompToSurface = fromComp),
transform || (transform = elem.layerInterface("ADBE
Transform Group"),
$bm_transform = transform,
transform && (anchorPoint = transform.anchorPoint)),
4 !== elemType || content || (content = thisLayer("ADBE
Root Vectors Group")),
effect || (effect = thisLayer(4)),
(hasParent = !(!elem.hierarchy || !
elem.hierarchy.length)) && !parent && (parent = elem.hierarchy[0].layerInterface),
time = this.comp.renderedFrame /
this.comp.globalData.frameRate,
_needsRandom && seedRandom(randSeed + time),
needsVelocity && (velocity = velocityAtTime(time)),
expression_function(),
this.frameExpressionId = elem.globalData.frameId,
scoped_bm_rt = scoped_bm_rt.propType ===
propTypes.SHAPE ? scoped_bm_rt.v : scoped_bm_rt)
}
return executeExpression.__preventDeadCodeRemoval =
[$bm_transform, anchorPoint, time, velocity, inPoint, outPoint, width, height,
name, loop_in, loop_out, smooth, toComp, fromCompToSurface, toWorld, fromWorld,
mask, position, rotation, scale, thisComp, numKeys, active, wiggle, loopInDuration,
loopOutDuration, comp, lookAt, easeOut, easeIn, ease, nearestKey, key, text,
textIndex, textTotal, selectorValue, framesToTime, timeToFrames, sourceRectAtTime,
substring, substr, posterizeTime, index, globalData],
executeExpression
}
return ob.initiateExpression = initiateExpression,
ob.__preventDeadCodeRemoval = [window, document,
XMLHttpRequest, fetch, frames, $bm_neg, add, $bm_sum, $bm_sub, $bm_mul, $bm_div,
$bm_mod, clamp, radians_to_degrees, degreesToRadians, degrees_to_radians,
normalize, rgbToHsl, hslToRgb, linear, random, createPath, _lottieGlobal],
ob.resetFrame = resetFrame,
ob
}()
, Expressions = function() {
var e = {
initExpressions: function(e) {
var t = 0
, r = [];
e.renderer.compInterface =
CompExpressionInterface(e.renderer),
e.renderer.globalData.projectInterface.registerComposition(e.renderer),
e.renderer.globalData.pushExpression = function() {
t += 1
}
,
e.renderer.globalData.popExpression = function() {
0 == (t -= 1) && function() {
var e, t = r.length;
for (e = 0; e < t; e += 1)
r[e].release();
r.length = 0
}()
}
,
e.renderer.globalData.registerExpressionProperty =
function(e) {
-1 === r.indexOf(e) && r.push(e)
}
}
};
return e.resetFrame = ExpressionManager.resetFrame,
e
}()
, MaskManagerInterface = function() {
function e(e, t) {
this._mask = e,
this._data = t
}
return Object.defineProperty(e.prototype, "maskPath", {
get: function() {
return this._mask.prop.k && this._mask.prop.getValue(),
this._mask.prop
}
}),
Object.defineProperty(e.prototype, "maskOpacity", {
get: function() {
return this._mask.op.k && this._mask.op.getValue(),
100 * this._mask.op.v
}
}),
function(t) {
var r, n = createSizedArray(t.viewData.length), i =
t.viewData.length;
for (r = 0; r < i; r += 1)
n[r] = new e(t.viewData[r],t.masksProperties[r]);
return function(e) {
for (r = 0; r < i; ) {
if (t.masksProperties[r].nm === e)
return n[r];
r += 1
}
return null
}
}
}()
, ExpressionPropertyInterface = function() {
var e = {
pv: 0,
v: 0,
mult: 1
}
, t = {
pv: [0, 0, 0],
v: [0, 0, 0],
mult: 1
};
function r(e, t, r) {
Object.defineProperty(e, "velocity", {
get: function() {
return t.getVelocityAtTime(t.comp.currentFrame)
}
}),
e.numKeys = t.keyframes ? t.keyframes.length : 0,
e.key = function(n) {
if (!e.numKeys)
return 0;
var i = "";
i = "s"in t.keyframes[n - 1] ? t.keyframes[n - 1].s :
"e"in t.keyframes[n - 2] ? t.keyframes[n - 2].e : t.keyframes[n - 2].s;
var o = "unidimensional" === r ? new Number(i) :
Object.assign({}, i);
return o.time = t.keyframes[n - 1].t /
t.elem.comp.globalData.frameRate,
o.value = "unidimensional" === r ? i[0] : i,
o
}
,
e.valueAtTime = t.getValueAtTime,
e.speedAtTime = t.getSpeedAtTime,
e.velocityAtTime = t.getVelocityAtTime,
e.propertyGroup = t.propertyGroup
}
function n() {
return e
}
return function(i) {
return i ? "unidimensional" === i.propType ? function(t) {
t && "pv"in t || (t = e);
var n = 1 / t.mult
, i = t.pv * n
, o = new Number(i);
return o.value = i,
r(o, t, "unidimensional"),
function() {
return t.k && t.getValue(),
i = t.v * n,
o.value !== i && ((o = new Number(i)).value = i,
r(o, t, "unidimensional")),
o
}
}(i) : function(e) {
e && "pv"in e || (e = t);
var n = 1 / e.mult
, i = e.data && e.data.l || e.pv.length
, o = createTypedArray("float32", i)
, s = createTypedArray("float32", i);
return o.value = s,
r(o, e, "multidimensional"),
function() {
e.k && e.getValue();
for (var t = 0; t < i; t += 1)
s[t] = e.v[t] * n,
o[t] = s[t];
return o
}
}(i) : n
}
}()
, TransformExpressionInterface = function(e) {
function t(e) {
switch (e) {
case "scale":
case "Scale":
case "ADBE Scale":
case 6:
return t.scale;
case "rotation":
case "Rotation":
case "ADBE Rotation":
case "ADBE Rotate Z":
case 10:
return t.rotation;
case "ADBE Rotate X":
return t.xRotation;
case "ADBE Rotate Y":
return t.yRotation;
case "position":
case "Position":
case "ADBE Position":
case 2:
return t.position;
case "ADBE Position_0":
return t.xPosition;
case "ADBE Position_1":
return t.yPosition;
case "ADBE Position_2":
return t.zPosition;
case "anchorPoint":
case "AnchorPoint":
case "Anchor Point":
case "ADBE AnchorPoint":
case 1:
return t.anchorPoint;
case "opacity":
case "Opacity":
case 11:
return t.opacity;
default:
return null
}
}
var r, n, i, o;
return Object.defineProperty(t, "rotation", {
get: ExpressionPropertyInterface(e.r || e.rz)
}),
Object.defineProperty(t, "zRotation", {
get: ExpressionPropertyInterface(e.rz || e.r)
}),
Object.defineProperty(t, "xRotation", {
get: ExpressionPropertyInterface(e.rx)
}),
Object.defineProperty(t, "yRotation", {
get: ExpressionPropertyInterface(e.ry)
}),
Object.defineProperty(t, "scale", {
get: ExpressionPropertyInterface(e.s)
}),
e.p ? o = ExpressionPropertyInterface(e.p) : (r =
ExpressionPropertyInterface(e.px),
n = ExpressionPropertyInterface(e.py),
e.pz && (i = ExpressionPropertyInterface(e.pz))),
Object.defineProperty(t, "position", {
get: function() {
return e.p ? o() : [r(), n(), i ? i() : 0]
}
}),
Object.defineProperty(t, "xPosition", {
get: ExpressionPropertyInterface(e.px)
}),
Object.defineProperty(t, "yPosition", {
get: ExpressionPropertyInterface(e.py)
}),
Object.defineProperty(t, "zPosition", {
get: ExpressionPropertyInterface(e.pz)
}),
Object.defineProperty(t, "anchorPoint", {
get: ExpressionPropertyInterface(e.a)
}),
Object.defineProperty(t, "opacity", {
get: ExpressionPropertyInterface(e.o)
}),
Object.defineProperty(t, "skew", {
get: ExpressionPropertyInterface(e.sk)
}),
Object.defineProperty(t, "skewAxis", {
get: ExpressionPropertyInterface(e.sa)
}),
Object.defineProperty(t, "orientation", {
get: ExpressionPropertyInterface(e.or)
}),
t
}
, LayerExpressionInterface = function() {
function e(e) {
var t = new Matrix;
return void 0 !== e ?
this._elem.finalTransform.mProp.getValueAtTime(e).clone(t) :
this._elem.finalTransform.mProp.applyToMatrix(t),
t
}
function t(e, t) {
var r = this.getMatrix(t);
return r.props[12] = 0,
r.props[13] = 0,
r.props[14] = 0,
this.applyPoint(r, e)
}
function r(e, t) {
var r = this.getMatrix(t);
return this.applyPoint(r, e)
}
function n(e, t) {
var r = this.getMatrix(t);
return r.props[12] = 0,
r.props[13] = 0,
r.props[14] = 0,
this.invertPoint(r, e)
}
function i(e, t) {
var r = this.getMatrix(t);
return this.invertPoint(r, e)
}
function o(e, t) {
if (this._elem.hierarchy && this._elem.hierarchy.length) {
var r, n = this._elem.hierarchy.length;
for (r = 0; r < n; r += 1)
this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)
}
return e.applyToPointArray(t[0], t[1], t[2] || 0)
}
function s(e, t) {
if (this._elem.hierarchy && this._elem.hierarchy.length) {
var r, n = this._elem.hierarchy.length;
for (r = 0; r < n; r += 1)
this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)
}
return e.inversePoint(t)
}
function a(e) {
var t = new Matrix;
if (t.reset(),
this._elem.finalTransform.mProp.applyToMatrix(t),
this._elem.hierarchy && this._elem.hierarchy.length) {
var r, n = this._elem.hierarchy.length;
for (r = 0; r < n; r += 1)
this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t);
return t.inversePoint(e)
}
return t.inversePoint(e)
}
function l() {
return [1, 1, 1, 1]
}
return function(c) {
var u;
function d(e) {
switch (e) {
case "ADBE Root Vectors Group":
case "Contents":
case 2:
return d.shapeInterface;
case 1:
case 6:
case "Transform":
case "transform":
case "ADBE Transform Group":
return u;
case 4:
case "ADBE Effect Parade":
case "effects":
case "Effects":
return d.effect;
case "ADBE Text Properties":
return d.textInterface;
default:
return null
}
}
d.getMatrix = e,
d.invertPoint = s,
d.applyPoint = o,
d.toWorld = r,
d.toWorldVec = t,
d.fromWorld = i,
d.fromWorldVec = n,
d.toComp = r,
d.fromComp = a,
d.sampleImage = l,
d.sourceRectAtTime = c.sourceRectAtTime.bind(c),
d._elem = c;
var p = getDescriptor(u =
TransformExpressionInterface(c.finalTransform.mProp), "anchorPoint");
return Object.defineProperties(d, {
hasParent: {
get: function() {
return c.hierarchy.length
}
},
parent: {
get: function() {
return c.hierarchy[0].layerInterface
}
},
rotation: getDescriptor(u, "rotation"),
scale: getDescriptor(u, "scale"),
position: getDescriptor(u, "position"),
opacity: getDescriptor(u, "opacity"),
anchorPoint: p,
anchor_point: p,
transform: {
get: function() {
return u
}
},
active: {
get: function() {
return c.isInRange
}
}
}),
d.startTime = c.data.st,
d.index = c.data.ind,
d.source = c.data.refId,
d.height = 0 === c.data.ty ? c.data.h : 100,
d.width = 0 === c.data.ty ? c.data.w : 100,
d.inPoint = c.data.ip / c.comp.globalData.frameRate,
d.outPoint = c.data.op / c.comp.globalData.frameRate,
d._name = c.data.nm,
d.registerMaskInterface = function(e) {
d.mask = new MaskManagerInterface(e,c)
}
,
d.registerEffectsInterface = function(e) {
d.effect = e
}
,
d
}
}()
, propertyGroupFactory = function(e, t) {
return function(r) {
return (r = void 0 === r ? 1 : r) <= 0 ? e : t(r - 1)
}
}
, PropertyInterface = function(e, t) {
var r = {
_name: e
};
return function(e) {
return (e = void 0 === e ? 1 : e) <= 0 ? r : t(e - 1)
}
}
, EffectsExpressionInterface = function() {
function e(r, n, i, o) {
function s(e) {
for (var t = r.ef, n = 0, i = t.length; n < i; ) {
if (e === t[n].nm || e === t[n].mn || e ===
t[n].ix)
return 5 === t[n].ty ? c[n] : c[n]();
n += 1
}
throw new Error
}
var a, l = propertyGroupFactory(s, i), c = [], u =
r.ef.length;
for (a = 0; a < u; a += 1)
5 === r.ef[a].ty ? c.push(e(r.ef[a],
n.effectElements[a], n.effectElements[a].propertyGroup, o)) :
c.push(t(n.effectElements[a], r.ef[a].ty, o, l));
return "ADBE Color Control" === r.mn &&
Object.defineProperty(s, "color", {
get: function() {
return c[0]()
}
}),
Object.defineProperties(s, {
numProperties: {
get: function() {
return r.np
}
},
_name: {
value: r.nm
},
propertyGroup: {
value: l
}
}),
s.enabled = 0 !== r.en,
s.active = s.enabled,
s
}
function t(e, t, r, n) {
var i = ExpressionPropertyInterface(e.p);
return e.p.setGroupProperty &&
e.p.setGroupProperty(PropertyInterface("", n)),
function() {
return 10 === t ? r.comp.compInterface(e.p.v) : i()
}
}
return {
createEffectsInterface: function(t, r) {
if (t.effectsManager) {
var n, i = [], o = t.data.ef, s =
t.effectsManager.effectElements.length;
for (n = 0; n < s; n += 1)
i.push(e(o[n],
t.effectsManager.effectElements[n], r, t));
var a = t.data.ef || []
, l = function(e) {
for (n = 0,
s = a.length; n < s; ) {
if (e === a[n].nm || e === a[n].mn || e ===
a[n].ix)
return i[n];
n += 1
}
return null
};
return Object.defineProperty(l, "numProperties", {
get: function() {
return a.length
}
}),
l
}
return null
}
}
}()
, ShapePathInterface = function(e, t, r) {
var n = t.sh;
function i(e) {
return "Shape" === e || "shape" === e || "Path" === e ||
"path" === e || "ADBE Vector Shape" === e || 2 === e ? i.path : null
}
var o = propertyGroupFactory(i, r);
return n.setGroupProperty(PropertyInterface("Path", o)),
Object.defineProperties(i, {
path: {
get: function() {
return n.k && n.getValue(),
n
}
},
shape: {
get: function() {
return n.k && n.getValue(),
n
}
},
_name: {
value: e.nm
},
ix: {
value: e.ix
},
propertyIndex: {
value: e.ix
},
mn: {
value: e.mn
},
propertyGroup: {
value: r
}
}),
i
}
, ShapeExpressionInterface = function() {
function e(e, s, p) {
var h, f = [], m = e ? e.length : 0;
for (h = 0; h < m; h += 1)
"gr" === e[h].ty ? f.push(t(e[h], s[h], p)) : "fl" ===
e[h].ty ? f.push(r(e[h], s[h], p)) : "st" === e[h].ty ? f.push(i(e[h], s[h], p)) :
"tm" === e[h].ty ? f.push(o(e[h], s[h], p)) : "tr" === e[h].ty || ("el" === e[h].ty
? f.push(a(e[h], s[h], p)) : "sr" === e[h].ty ? f.push(l(e[h], s[h], p)) : "sh" ===
e[h].ty ? f.push(ShapePathInterface(e[h], s[h], p)) : "rc" === e[h].ty ?
f.push(c(e[h], s[h], p)) : "rd" === e[h].ty ? f.push(u(e[h], s[h], p)) : "rp" ===
e[h].ty ? f.push(d(e[h], s[h], p)) : "gf" === e[h].ty ? f.push(n(e[h], s[h], p)) :
f.push((e[h],
s[h],
function() {
return null
}
)));
return f
}
function t(t, r, n) {
var i = function(e) {
switch (e) {
case "ADBE Vectors Group":
case "Contents":
case 2:
return i.content;
default:
return i.transform
}
};
i.propertyGroup = propertyGroupFactory(i, n);
var o = function(t, r, n) {
var i, o = function(e) {
for (var t = 0, r = i.length; t < r; ) {
if (i[t]._name === e || i[t].mn === e ||
i[t].propertyIndex === e || i[t].ix === e || i[t].ind === e)
return i[t];
t += 1
}
return "number" == typeof e ? i[e - 1] : null
};
o.propertyGroup = propertyGroupFactory(o, n),
i = e(t.it, r.it, o.propertyGroup),
o.numProperties = i.length;
var a = s(t.it[t.it.length - 1], r.it[r.it.length - 1],
o.propertyGroup);
return o.transform = a,
o.propertyIndex = t.cix,
o._name = t.nm,
o
}(t, r, i.propertyGroup)
, a = s(t.it[t.it.length - 1], r.it[r.it.length - 1],
i.propertyGroup);
return i.content = o,
i.transform = a,
Object.defineProperty(i, "_name", {
get: function() {
return t.nm
}
}),
i.numProperties = t.np,
i.propertyIndex = t.ix,
i.nm = t.nm,
i.mn = t.mn,
i
}
function r(e, t, r) {
function n(e) {
return "Color" === e || "color" === e ? n.color :
"Opacity" === e || "opacity" === e ? n.opacity : null
}
return Object.defineProperties(n, {
color: {
get: ExpressionPropertyInterface(t.c)
},
opacity: {
get: ExpressionPropertyInterface(t.o)
},
_name: {
value: e.nm
},
mn: {
value: e.mn
}
}),
t.c.setGroupProperty(PropertyInterface("Color", r)),
t.o.setGroupProperty(PropertyInterface("Opacity", r)),
n
}
function n(e, t, r) {
function n(e) {
return "Start Point" === e || "start point" === e ?
n.startPoint : "End Point" === e || "end point" === e ? n.endPoint : "Opacity" ===
e || "opacity" === e ? n.opacity : null
}
return Object.defineProperties(n, {
startPoint: {
get: ExpressionPropertyInterface(t.s)
},
endPoint: {
get: ExpressionPropertyInterface(t.e)
},
opacity: {
get: ExpressionPropertyInterface(t.o)
},
type: {
get: function() {
return "a"
}
},
_name: {
value: e.nm
},
mn: {
value: e.mn
}
}),
t.s.setGroupProperty(PropertyInterface("Start Point", r)),
t.e.setGroupProperty(PropertyInterface("End Point", r)),
t.o.setGroupProperty(PropertyInterface("Opacity", r)),
n
}
function i(e, t, r) {
var n, i, o = propertyGroupFactory(c, r), s =
propertyGroupFactory(l, o), a = e.d ? e.d.length : 0, l = {};
for (n = 0; n < a; n += 1)
i = n,
Object.defineProperty(l, e.d[i].nm, {
get:
ExpressionPropertyInterface(t.d.dataProps[i].p)
}),
t.d.dataProps[n].p.setGroupProperty(s);
function c(e) {
return "Color" === e || "color" === e ? c.color :
"Opacity" === e || "opacity" === e ? c.opacity : "Stroke Width" === e || "stroke
width" === e ? c.strokeWidth : null
}
return Object.defineProperties(c, {
color: {
get: ExpressionPropertyInterface(t.c)
},
opacity: {
get: ExpressionPropertyInterface(t.o)
},
strokeWidth: {
get: ExpressionPropertyInterface(t.w)
},
dash: {
get: function() {
return l
}
},
_name: {
value: e.nm
},
mn: {
value: e.mn
}
}),
t.c.setGroupProperty(PropertyInterface("Color", o)),
t.o.setGroupProperty(PropertyInterface("Opacity", o)),
t.w.setGroupProperty(PropertyInterface("Stroke Width", o)),
c
}
function o(e, t, r) {
function n(t) {
return t === e.e.ix || "End" === t || "end" === t ?
n.end : t === e.s.ix ? n.start : t === e.o.ix ? n.offset : null
}
var i = propertyGroupFactory(n, r);
return n.propertyIndex = e.ix,
t.s.setGroupProperty(PropertyInterface("Start", i)),
t.e.setGroupProperty(PropertyInterface("End", i)),
t.o.setGroupProperty(PropertyInterface("Offset", i)),
n.propertyIndex = e.ix,
n.propertyGroup = r,
Object.defineProperties(n, {
start: {
get: ExpressionPropertyInterface(t.s)
},
end: {
get: ExpressionPropertyInterface(t.e)
},
offset: {
get: ExpressionPropertyInterface(t.o)
},
_name: {
value: e.nm
}
}),
n.mn = e.mn,
n
}
function s(e, t, r) {
function n(t) {
return e.a.ix === t || "Anchor Point" === t ?
n.anchorPoint : e.o.ix === t || "Opacity" === t ? n.opacity : e.p.ix === t ||
"Position" === t ? n.position : e.r.ix === t || "Rotation" === t || "ADBE Vector
Rotation" === t ? n.rotation : e.s.ix === t || "Scale" === t ? n.scale : e.sk &&
e.sk.ix === t || "Skew" === t ? n.skew : e.sa && e.sa.ix === t || "Skew Axis" === t
? n.skewAxis : null
}
var i = propertyGroupFactory(n, r);
return
t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity", i)),
t.transform.mProps.p.setGroupProperty(PropertyInterface("Position", i)),
t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale", i)),
t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation", i)),
t.transform.mProps.sk &&
(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew", i)),
t.transform.op.setGroupProperty(PropertyInterface("Opacity", i)),
Object.defineProperties(n, {
opacity: {
get:
ExpressionPropertyInterface(t.transform.mProps.o)
},
position: {
get:
ExpressionPropertyInterface(t.transform.mProps.p)
},
anchorPoint: {
get:
ExpressionPropertyInterface(t.transform.mProps.a)
},
scale: {
get:
ExpressionPropertyInterface(t.transform.mProps.s)
},
rotation: {
get:
ExpressionPropertyInterface(t.transform.mProps.r)
},
skew: {
get:
ExpressionPropertyInterface(t.transform.mProps.sk)
},
skewAxis: {
get:
ExpressionPropertyInterface(t.transform.mProps.sa)
},
_name: {
value: e.nm
}
}),
n.ty = "tr",
n.mn = e.mn,
n.propertyGroup = r,
n
}
function a(e, t, r) {
function n(t) {
return e.p.ix === t ? n.position : e.s.ix === t ?
n.size : null
}
var i = propertyGroupFactory(n, r);
n.propertyIndex = e.ix;
var o = "tm" === t.sh.ty ? t.sh.prop : t.sh;
return o.s.setGroupProperty(PropertyInterface("Size", i)),
o.p.setGroupProperty(PropertyInterface("Position", i)),
Object.defineProperties(n, {
size: {
get: ExpressionPropertyInterface(o.s)
},
position: {
get: ExpressionPropertyInterface(o.p)
},
_name: {
value: e.nm
}
}),
n.mn = e.mn,
n
}
function l(e, t, r) {
function n(t) {
return e.p.ix === t ? n.position : e.r.ix === t ?
n.rotation : e.pt.ix === t ? n.points : e.or.ix === t || "ADBE Vector Star Outer
Radius" === t ? n.outerRadius : e.os.ix === t ? n.outerRoundness : !e.ir || e.ir.ix
!== t && "ADBE Vector Star Inner Radius" !== t ? e.is && e.is.ix === t ?
n.innerRoundness : null : n.innerRadius
}
var i = propertyGroupFactory(n, r)
, o = "tm" === t.sh.ty ? t.sh.prop : t.sh;
return n.propertyIndex = e.ix,
o.or.setGroupProperty(PropertyInterface("Outer Radius",
i)),
o.os.setGroupProperty(PropertyInterface("Outer Roundness",
i)),
o.pt.setGroupProperty(PropertyInterface("Points", i)),
o.p.setGroupProperty(PropertyInterface("Position", i)),
o.r.setGroupProperty(PropertyInterface("Rotation", i)),
e.ir && (o.ir.setGroupProperty(PropertyInterface("Inner
Radius", i)),
o.is.setGroupProperty(PropertyInterface("Inner Roundness",
i))),
Object.defineProperties(n, {
position: {
get: ExpressionPropertyInterface(o.p)
},
rotation: {
get: ExpressionPropertyInterface(o.r)
},
points: {
get: ExpressionPropertyInterface(o.pt)
},
outerRadius: {
get: ExpressionPropertyInterface(o.or)
},
outerRoundness: {
get: ExpressionPropertyInterface(o.os)
},
innerRadius: {
get: ExpressionPropertyInterface(o.ir)
},
innerRoundness: {
get: ExpressionPropertyInterface(o.is)
},
_name: {
value: e.nm
}
}),
n.mn = e.mn,
n
}
function c(e, t, r) {
function n(t) {
return e.p.ix === t ? n.position : e.r.ix === t ?
n.roundness : e.s.ix === t || "Size" === t || "ADBE Vector Rect Size" === t ?
n.size : null
}
var i = propertyGroupFactory(n, r)
, o = "tm" === t.sh.ty ? t.sh.prop : t.sh;
return n.propertyIndex = e.ix,
o.p.setGroupProperty(PropertyInterface("Position", i)),
o.s.setGroupProperty(PropertyInterface("Size", i)),
o.r.setGroupProperty(PropertyInterface("Rotation", i)),
Object.defineProperties(n, {
position: {
get: ExpressionPropertyInterface(o.p)
},
roundness: {
get: ExpressionPropertyInterface(o.r)
},
size: {
get: ExpressionPropertyInterface(o.s)
},
_name: {
value: e.nm
}
}),
n.mn = e.mn,
n
}
function u(e, t, r) {
function n(t) {
return e.r.ix === t || "Round Corners 1" === t ?
n.radius : null
}
var i = propertyGroupFactory(n, r)
, o = t;
return n.propertyIndex = e.ix,
o.rd.setGroupProperty(PropertyInterface("Radius", i)),
Object.defineProperties(n, {
radius: {
get: ExpressionPropertyInterface(o.rd)
},
_name: {
value: e.nm
}
}),
n.mn = e.mn,
n
}
function d(e, t, r) {
function n(t) {
return e.c.ix === t || "Copies" === t ? n.copies :
e.o.ix === t || "Offset" === t ? n.offset : null
}
var i = propertyGroupFactory(n, r)
, o = t;
return n.propertyIndex = e.ix,
o.c.setGroupProperty(PropertyInterface("Copies", i)),
o.o.setGroupProperty(PropertyInterface("Offset", i)),
Object.defineProperties(n, {
copies: {
get: ExpressionPropertyInterface(o.c)
},
offset: {
get: ExpressionPropertyInterface(o.o)
},
_name: {
value: e.nm
}
}),
n.mn = e.mn,
n
}
return function(t, r, n) {
var i;
function o(e) {
if ("number" == typeof e)
return 0 === (e = void 0 === e ? 1 : e) ? n : i[e -
1];
for (var t = 0, r = i.length; t < r; ) {
if (i[t]._name === e)
return i[t];
t += 1
}
return null
}
return o.propertyGroup = propertyGroupFactory(o,
(function() {
return n
}
)),
i = e(t, r, o.propertyGroup),
o.numProperties = i.length,
o._name = "Contents",
o
}
}()
, TextExpressionInterface = function(e) {
var t;
function r(e) {
return "ADBE Text Document" === e ? r.sourceText : null
}
return Object.defineProperty(r, "sourceText", {
get: function() {
e.textProperty.getValue();
var r = e.textProperty.currentData.t;
return t && r === t.value || ((t = new String(r)).value
= r || new String(r),
Object.defineProperty(t, "style", {
get: function() {
return {
fillColor: e.textProperty.currentData.fc
}
}
})),
t
}
}),
r
};
function _typeof(e) {
return (_typeof = "function" == typeof Symbol && "symbol" ==
typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor
=== Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
var FootageInterface = (dataInterfaceFactory = function(e) {
function t(e) {
return "Outline" === e ? t.outlineInterface() : null
}
return t._name = "Outline",
t.outlineInterface = function(e) {
var t = ""
, r = e.getFootageData();
function n(e) {
if (r[e])
return t = e,
"object" === _typeof(r = r[e]) ? n : r;
var i = e.indexOf(t);
if (-1 !== i) {
var o = parseInt(e.substr(i + t.length), 10);
return "object" === _typeof(r = r[o]) ? n : r
}
return ""
}
return function() {
return t = "",
r = e.getFootageData(),
n
}
}(e),
t
}
,
function(e) {
function t(e) {
return "Data" === e ? t.dataInterface : null
}
return t._name = "Data",
t.dataInterface = dataInterfaceFactory(e),
t
}
), dataInterfaceFactory, interfaces = {
layer: LayerExpressionInterface,
effects: EffectsExpressionInterface,
comp: CompExpressionInterface,
shape: ShapeExpressionInterface,
text: TextExpressionInterface,
footage: FootageInterface
};
function getInterface(e) {
return interfaces[e] || null
}
var expressionHelpers = {
searchExpressions: function(e, t, r) {
t.x && (r.k = !0,
r.x = !0,
r.initiateExpression =
ExpressionManager.initiateExpression,
r.effectsSequence.push(r.initiateExpression(e, t,
r).bind(r)))
},
getSpeedAtTime: function(e) {
var t = this.getValueAtTime(e)
, r = this.getValueAtTime(e + -.01)
, n = 0;
if (t.length) {
var i;
for (i = 0; i < t.length; i += 1)
n += Math.pow(r[i] - t[i], 2);
n = 100 * Math.sqrt(n)
} else
n = 0;
return n
},
getVelocityAtTime: function(e) {
if (void 0 !== this.vel)
return this.vel;
var t, r, n = -.001, i = this.getValueAtTime(e), o =
this.getValueAtTime(e + n);
if (i.length)
for (t = createTypedArray("float32", i.length),
r = 0; r < i.length; r += 1)
t[r] = (o[r] - i[r]) / n;
else
t = (o - i) / n;
return t
},
getValueAtTime: function(e) {
return e *= this.elem.globalData.frameRate,
(e -= this.offsetTime) !== this._cachingAtTime.lastFrame &&
(this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < e ?
this._cachingAtTime.lastIndex : 0,
this._cachingAtTime.value = this.interpolateValue(e,
this._cachingAtTime),
this._cachingAtTime.lastFrame = e),
this._cachingAtTime.value
},
getStaticValueAtTime: function() {
return this.pv
},
setGroupProperty: function(e) {
this.propertyGroup = e
}
};
function addPropertyDecorator() {
function e(e, t, r) {
if (!this.k || !this.keyframes)
return this.pv;
e = e ? e.toLowerCase() : "";
var n, i, o, s, a, l = this.comp.renderedFrame, c =
this.keyframes, u = c[c.length - 1].t;
if (l <= u)
return this.pv;
if (r ? i = u - (n = t ? Math.abs(u -
this.elem.comp.globalData.frameRate * t) : Math.max(0, u - this.elem.data.ip)) :
((!t || t > c.length - 1) && (t = c.length - 1),
n = u - (i = c[c.length - 1 - t].t)),
"pingpong" === e) {
if (Math.floor((l - i) / n) % 2 != 0)
return this.getValueAtTime((n - (l - i) % n + i) /
this.comp.globalData.frameRate, 0)
} else {
if ("offset" === e) {
var d = this.getValueAtTime(i /
this.comp.globalData.frameRate, 0)
, p = this.getValueAtTime(u /
this.comp.globalData.frameRate, 0)
, h = this.getValueAtTime(((l - i) % n + i) /
this.comp.globalData.frameRate, 0)
, f = Math.floor((l - i) / n);
if (this.pv.length) {
for (s = (a = new Array(d.length)).length,
o = 0; o < s; o += 1)
a[o] = (p[o] - d[o]) * f + h[o];
return a
}
return (p - d) * f + h
}
if ("continue" === e) {
var m = this.getValueAtTime(u /
this.comp.globalData.frameRate, 0)
, g = this.getValueAtTime((u - .001) /
this.comp.globalData.frameRate, 0);
if (this.pv.length) {
for (s = (a = new Array(m.length)).length,
o = 0; o < s; o += 1)
a[o] = m[o] + (m[o] - g[o]) * ((l - u) /
this.comp.globalData.frameRate) / 5e-4;
return a
}
return m + (l - u) / .001 * (m - g)
}
}
return this.getValueAtTime(((l - i) % n + i) /
this.comp.globalData.frameRate, 0)
}
function t(e, t, r) {
if (!this.k)
return this.pv;
e = e ? e.toLowerCase() : "";
var n, i, o, s, a, l = this.comp.renderedFrame, c =
this.keyframes, u = c[0].t;
if (l >= u)
return this.pv;
if (r ? i = u + (n = t ?
Math.abs(this.elem.comp.globalData.frameRate * t) : Math.max(0, this.elem.data.op -
u)) : ((!t || t > c.length - 1) && (t = c.length - 1),
n = (i = c[t].t) - u),
"pingpong" === e) {
if (Math.floor((u - l) / n) % 2 == 0)
return this.getValueAtTime(((u - l) % n + u) /
this.comp.globalData.frameRate, 0)
} else {
if ("offset" === e) {
var d = this.getValueAtTime(u /
this.comp.globalData.frameRate, 0)
, p = this.getValueAtTime(i /
this.comp.globalData.frameRate, 0)
, h = this.getValueAtTime((n - (u - l) % n + u) /
this.comp.globalData.frameRate, 0)
, f = Math.floor((u - l) / n) + 1;
if (this.pv.length) {
for (s = (a = new Array(d.length)).length,
o = 0; o < s; o += 1)
a[o] = h[o] - (p[o] - d[o]) * f;
return a
}
return h - (p - d) * f
}
if ("continue" === e) {
var m = this.getValueAtTime(u /
this.comp.globalData.frameRate, 0)
, g = this.getValueAtTime((u + .001) /
this.comp.globalData.frameRate, 0);
if (this.pv.length) {
for (s = (a = new Array(m.length)).length,
o = 0; o < s; o += 1)
a[o] = m[o] + (m[o] - g[o]) * (u -
l) / .001;
return a
}
return m + (m - g) * (u - l) / .001
}
}
return this.getValueAtTime((n - ((u - l) % n + u)) /
this.comp.globalData.frameRate, 0)
}
function r(e, t) {
if (!this.k)
return this.pv;
if (e = .5 * (e || .4),
(t = Math.floor(t || 5)) <= 1)
return this.pv;
var r, n, i = this.comp.renderedFrame /
this.comp.globalData.frameRate, o = i - e, s = t > 1 ? (i + e - o) / (t - 1) : 1, a
= 0, l = 0;
for (r = this.pv.length ? createTypedArray("float32",
this.pv.length) : 0; a < t; ) {
if (n = this.getValueAtTime(o + a * s),
this.pv.length)
for (l = 0; l < this.pv.length; l += 1)
r[l] += n[l];
else
r += n;
a += 1
}
if (this.pv.length)
for (l = 0; l < this.pv.length; l += 1)
r[l] /= t;
else
r /= t;
return r
}
function n(e) {
this._transformCachingAtTime ||
(this._transformCachingAtTime = {
v: new Matrix
});
var t = this._transformCachingAtTime.v;
if (t.cloneFromProps(this.pre.props),
this.appliedTransformations < 1) {
var r = this.a.getValueAtTime(e);
t.translate(-r[0] * this.a.mult, -r[1] * this.a.mult,
r[2] * this.a.mult)
}
if (this.appliedTransformations < 2) {
var n = this.s.getValueAtTime(e);
t.scale(n[0] * this.s.mult, n[1] * this.s.mult, n[2] *
this.s.mult)
}
if (this.sk && this.appliedTransformations < 3) {
var i = this.sk.getValueAtTime(e)
, o = this.sa.getValueAtTime(e);
t.skewFromAxis(-i * this.sk.mult, o * this.sa.mult)
}
if (this.r && this.appliedTransformations < 4) {
var s = this.r.getValueAtTime(e);
t.rotate(-s * this.r.mult)
} else if (!this.r && this.appliedTransformations < 4) {
var a = this.rz.getValueAtTime(e)
, l = this.ry.getValueAtTime(e)
, c = this.rx.getValueAtTime(e)
, u = this.or.getValueAtTime(e);
t.rotateZ(-a * this.rz.mult).rotateY(l *
this.ry.mult).rotateX(c * this.rx.mult).rotateZ(-u[2] * this.or.mult).rotateY(u[1]
* this.or.mult).rotateX(u[0] * this.or.mult)
}
if (this.data.p && this.data.p.s) {
var d = this.px.getValueAtTime(e)
, p = this.py.getValueAtTime(e);
if (this.data.p.z) {
var h = this.pz.getValueAtTime(e);
t.translate(d * this.px.mult, p * this.py.mult, -h
* this.pz.mult)
} else
t.translate(d * this.px.mult, p * this.py.mult, 0)
} else {
var f = this.p.getValueAtTime(e);
t.translate(f[0] * this.p.mult, f[1] * this.p.mult, -
f[2] * this.p.mult)
}
return t
}
function i() {
return this.v.clone(new Matrix)
}
var o = TransformPropertyFactory.getTransformProperty;
TransformPropertyFactory.getTransformProperty = function(e, t,
r) {
var s = o(e, t, r);
return s.dynamicProperties.length ? s.getValueAtTime =
n.bind(s) : s.getValueAtTime = i.bind(s),
s.setGroupProperty = expressionHelpers.setGroupProperty,
s
}
;
var s = PropertyFactory.getProp;
PropertyFactory.getProp = function(n, i, o, a, l) {
var c = s(n, i, o, a, l);
c.kf ? c.getValueAtTime =
expressionHelpers.getValueAtTime.bind(c) : c.getValueAtTime =
expressionHelpers.getStaticValueAtTime.bind(c),
c.setGroupProperty = expressionHelpers.setGroupProperty,
c.loopOut = e,
c.loopIn = t,
c.smooth = r,
c.getVelocityAtTime =
expressionHelpers.getVelocityAtTime.bind(c),
c.getSpeedAtTime =
expressionHelpers.getSpeedAtTime.bind(c),
c.numKeys = 1 === i.a ? i.k.length : 0,
c.propertyIndex = i.ix;
var u = 0;
return 0 !== o && (u = createTypedArray("float32", 1 ===
i.a ? i.k[0].s.length : i.k.length)),
c._cachingAtTime = {
lastFrame: initialDefaultFrame,
lastIndex: 0,
value: u
},
expressionHelpers.searchExpressions(n, i, c),
c.k && l.addDynamicProperty(c),
c
}
;
var a = ShapePropertyFactory.getConstructorFunction()
, l = ShapePropertyFactory.getKeyframedConstructorFunction();
function c() {}
c.prototype = {
vertices: function(e, t) {
this.k && this.getValue();
var r, n = this.v;
void 0 !== t && (n = this.getValueAtTime(t, 0));
var i = n._length
, o = n[e]
, s = n.v
, a = createSizedArray(i);
for (r = 0; r < i; r += 1)
a[r] = "i" === e || "o" === e ? [o[r][0] - s[r][0],
o[r][1] - s[r][1]] : [o[r][0], o[r][1]];
return a
},
points: function(e) {
return this.vertices("v", e)
},
inTangents: function(e) {
return this.vertices("i", e)
},
outTangents: function(e) {
return this.vertices("o", e)
},
isClosed: function() {
return this.v.c
},
pointOnPath: function(e, t) {
var r = this.v;
void 0 !== t && (r = this.getValueAtTime(t, 0)),
this._segmentsLength || (this._segmentsLength =
bez.getSegmentsLength(r));
for (var n, i = this._segmentsLength, o = i.lengths, s
= i.totalLength * e, a = 0, l = o.length, c = 0; a < l; ) {
if (c + o[a].addedLength > s) {
var u = a
, d = r.c && a === l - 1 ? 0 : a + 1
, p = (s - c) / o[a].addedLength;
n = bez.getPointInSegment(r.v[u], r.v[d],
r.o[u], r.i[d], p, o[a]);
break
}
c += o[a].addedLength,
a += 1
}
return n || (n = r.c ? [r.v[0][0], r.v[0][1]] :
[r.v[r._length - 1][0], r.v[r._length - 1][1]]),
n
},
vectorOnPath: function(e, t, r) {
1 == e ? e = this.v.c : 0 == e && (e = .999);
var n = this.pointOnPath(e, t)
, i = this.pointOnPath(e + .001, t)
, o = i[0] - n[0]
, s = i[1] - n[1]
, a = Math.sqrt(Math.pow(o, 2) + Math.pow(s, 2));
return 0 === a ? [0, 0] : "tangent" === r ? [o / a, s /
a] : [-s / a, o / a]
},
tangentOnPath: function(e, t) {
return this.vectorOnPath(e, t, "tangent")
},
normalOnPath: function(e, t) {
return this.vectorOnPath(e, t, "normal")
},
setGroupProperty: expressionHelpers.setGroupProperty,
getValueAtTime: expressionHelpers.getStaticValueAtTime
},
extendPrototype([c], a),
extendPrototype([c], l),
l.prototype.getValueAtTime = function(e) {
return this._cachingAtTime || (this._cachingAtTime = {
shapeValue: shapePool.clone(this.pv),
lastIndex: 0,
lastTime: initialDefaultFrame
}),
e *= this.elem.globalData.frameRate,
(e -= this.offsetTime) !== this._cachingAtTime.lastTime &&
(this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < e ?
this._caching.lastIndex : 0,
this._cachingAtTime.lastTime = e,
this.interpolateShape(e, this._cachingAtTime.shapeValue,
this._cachingAtTime)),
this._cachingAtTime.shapeValue
}
,
l.prototype.initiateExpression =
ExpressionManager.initiateExpression;
var u = ShapePropertyFactory.getShapeProp;
ShapePropertyFactory.getShapeProp = function(e, t, r, n, i) {
var o = u(e, t, r, n, i);
return o.propertyIndex = t.ix,
o.lock = !1,
3 === r ? expressionHelpers.searchExpressions(e, t.pt, o) :
4 === r && expressionHelpers.searchExpressions(e, t.ks, o),
o.k && e.addDynamicProperty(o),
o
}
}
function initialize$1() {
addPropertyDecorator()
}
function addDecorator() {
TextProperty.prototype.getExpressionValue = function(e, t) {
var r = this.calculateExpression(t);
if (e.t !== r) {
var n = {};
return this.copyData(n, e),
n.t = r.toString(),
n.__complete = !1,
n
}
return e
}
,
TextProperty.prototype.searchProperty = function() {
var e = this.searchKeyframes()
, t = this.searchExpressions();
return this.kf = e || t,
this.kf
}
,
TextProperty.prototype.searchExpressions = function() {
return this.data.d.x ? (this.calculateExpression =
ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this),
this.addEffect(this.getExpressionValue.bind(this)),
!0) : null
}
}
function initialize() {
addDecorator()
}
function SVGComposableEffect() {}
SVGComposableEffect.prototype = {
createMergeNode: function(e, t) {
var r, n, i = createNS("feMerge");
for (i.setAttribute("result", e),
n = 0; n < t.length; n += 1)
(r = createNS("feMergeNode")).setAttribute("in", t[n]),
i.appendChild(r),
i.appendChild(r);
return i
}
};
var linearFilterValue = "0.3333 0.3333 0.3333 0 0 0.3333 0.3333
0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";
function SVGTintFilter(e, t, r, n, i) {
this.filterManager = t;
var o = createNS("feColorMatrix");
o.setAttribute("type", "matrix"),
o.setAttribute("color-interpolation-filters", "linearRGB"),
o.setAttribute("values", linearFilterValue + " 1 0"),
this.linearFilter = o,
o.setAttribute("result", n + "_tint_1"),
e.appendChild(o),
(o = createNS("feColorMatrix")).setAttribute("type", "matrix"),
o.setAttribute("color-interpolation-filters", "sRGB"),
o.setAttribute("values", "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1
0"),
o.setAttribute("result", n + "_tint_2"),
e.appendChild(o),
this.matrixFilter = o;
var s = this.createMergeNode(n, [i, n + "_tint_1", n +
"_tint_2"]);
e.appendChild(s)
}
function SVGFillFilter(e, t, r, n) {
this.filterManager = t;
var i = createNS("feColorMatrix");
i.setAttribute("type", "matrix"),
i.setAttribute("color-interpolation-filters", "sRGB"),
i.setAttribute("values", "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1
0"),
i.setAttribute("result", n),
e.appendChild(i),
this.matrixFilter = i
}
function SVGStrokeEffect(e, t, r) {
this.initialized = !1,
this.filterManager = t,
this.elem = r,
this.paths = []
}
function SVGTritoneFilter(e, t, r, n) {
this.filterManager = t;
var i = createNS("feColorMatrix");
i.setAttribute("type", "matrix"),
i.setAttribute("color-interpolation-filters", "linearRGB"),
i.setAttribute("values", "0.3333 0.3333 0.3333 0 0 0.3333
0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),
e.appendChild(i);
var o = createNS("feComponentTransfer");
o.setAttribute("color-interpolation-filters", "sRGB"),
o.setAttribute("result", n),
this.matrixFilter = o;
var s = createNS("feFuncR");
s.setAttribute("type", "table"),
o.appendChild(s),
this.feFuncR = s;
var a = createNS("feFuncG");
a.setAttribute("type", "table"),
o.appendChild(a),
this.feFuncG = a;
var l = createNS("feFuncB");
l.setAttribute("type", "table"),
o.appendChild(l),
this.feFuncB = l,
e.appendChild(o)
}
function SVGProLevelsFilter(e, t, r, n) {
this.filterManager = t;
var i = this.filterManager.effectElements
, o = createNS("feComponentTransfer");
(i[10].p.k || 0 !== i[10].p.v || i[11].p.k || 1 !== i[11].p.v
|| i[12].p.k || 1 !== i[12].p.v || i[13].p.k || 0 !== i[13].p.v || i[14].p.k || 1 !
== i[14].p.v) && (this.feFuncR = this.createFeFunc("feFuncR", o)),
(i[17].p.k || 0 !== i[17].p.v || i[18].p.k || 1 !== i[18].p.v
|| i[19].p.k || 1 !== i[19].p.v || i[20].p.k || 0 !== i[20].p.v || i[21].p.k || 1 !
== i[21].p.v) && (this.feFuncG = this.createFeFunc("feFuncG", o)),
(i[24].p.k || 0 !== i[24].p.v || i[25].p.k || 1 !== i[25].p.v
|| i[26].p.k || 1 !== i[26].p.v || i[27].p.k || 0 !== i[27].p.v || i[28].p.k || 1 !
== i[28].p.v) && (this.feFuncB = this.createFeFunc("feFuncB", o)),
(i[31].p.k || 0 !== i[31].p.v || i[32].p.k || 1 !== i[32].p.v
|| i[33].p.k || 1 !== i[33].p.v || i[34].p.k || 0 !== i[34].p.v || i[35].p.k || 1 !
== i[35].p.v) && (this.feFuncA = this.createFeFunc("feFuncA", o)),
(this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA)
&& (o.setAttribute("color-interpolation-filters", "sRGB"),
e.appendChild(o)),
(i[3].p.k || 0 !== i[3].p.v || i[4].p.k || 1 !== i[4].p.v ||
i[5].p.k || 1 !== i[5].p.v || i[6].p.k || 0 !== i[6].p.v || i[7].p.k || 1 !==
i[7].p.v) && ((o = createNS("feComponentTransfer")).setAttribute("color-
interpolation-filters", "sRGB"),
o.setAttribute("result", n),
e.appendChild(o),
this.feFuncRComposed = this.createFeFunc("feFuncR", o),
this.feFuncGComposed = this.createFeFunc("feFuncG", o),
this.feFuncBComposed = this.createFeFunc("feFuncB", o))
}
function SVGDropShadowEffect(e, t, r, n, i) {
var o = t.container.globalData.renderConfig.filterSize
, s = t.data.fs || o;
e.setAttribute("x", s.x || o.x),
e.setAttribute("y", s.y || o.y),
e.setAttribute("width", s.width || o.width),
e.setAttribute("height", s.height || o.height),
this.filterManager = t;
var a = createNS("feGaussianBlur");
a.setAttribute("in", "SourceAlpha"),
a.setAttribute("result", n + "_drop_shadow_1"),
a.setAttribute("stdDeviation", "0"),
this.feGaussianBlur = a,
e.appendChild(a);
var l = createNS("feOffset");
l.setAttribute("dx", "25"),
l.setAttribute("dy", "0"),
l.setAttribute("in", n + "_drop_shadow_1"),
l.setAttribute("result", n + "_drop_shadow_2"),
this.feOffset = l,
e.appendChild(l);
var c = createNS("feFlood");
c.setAttribute("flood-color", "#00ff00"),
c.setAttribute("flood-opacity", "1"),
c.setAttribute("result", n + "_drop_shadow_3"),
this.feFlood = c,
e.appendChild(c);
var u = createNS("feComposite");
u.setAttribute("in", n + "_drop_shadow_3"),
u.setAttribute("in2", n + "_drop_shadow_2"),
u.setAttribute("operator", "in"),
u.setAttribute("result", n + "_drop_shadow_4"),
e.appendChild(u);
var d = this.createMergeNode(n, [n + "_drop_shadow_4", i]);
e.appendChild(d)
}
extendPrototype([SVGComposableEffect], SVGTintFilter),
SVGTintFilter.prototype.renderFrame = function(e) {
if (e || this.filterManager._mdf) {
var t = this.filterManager.effectElements[0].p.v
, r = this.filterManager.effectElements[1].p.v
, n = this.filterManager.effectElements[2].p.v / 100;
this.linearFilter.setAttribute("values", linearFilterValue
+ " " + n + " 0"),
this.matrixFilter.setAttribute("values", r[0] - t[0] + " 0
0 0 " + t[0] + " " + (r[1] - t[1]) + " 0 0 0 " + t[1] + " " + (r[2] - t[2]) + " 0 0
0 " + t[2] + " 0 0 0 1 0")
}
}
,
SVGFillFilter.prototype.renderFrame = function(e) {
if (e || this.filterManager._mdf) {
var t = this.filterManager.effectElements[2].p.v
, r = this.filterManager.effectElements[6].p.v;
this.matrixFilter.setAttribute("values", "0 0 0 0 " + t[0]
+ " 0 0 0 0 " + t[1] + " 0 0 0 0 " + t[2] + " 0 0 0 " + r + " 0")
}
}
,
SVGStrokeEffect.prototype.initialize = function() {
var e, t, r, n, i = this.elem.layerElement.children ||
this.elem.layerElement.childNodes;
for (1 === this.filterManager.effectElements[1].p.v ? (n =
this.elem.maskManager.masksProperties.length,
r = 0) : n = 1 + (r = this.filterManager.effectElements[0].p.v
- 1),
(t = createNS("g")).setAttribute("fill", "none"),
t.setAttribute("stroke-linecap", "round"),
t.setAttribute("stroke-dashoffset", 1); r < n; r += 1)
e = createNS("path"),
t.appendChild(e),
this.paths.push({
p: e,
m: r
});
if (3 === this.filterManager.effectElements[10].p.v) {
var o = createNS("mask")
, s = createElementID();
o.setAttribute("id", s),
o.setAttribute("mask-type", "alpha"),
o.appendChild(t),
this.elem.globalData.defs.appendChild(o);
var a = createNS("g");
for (a.setAttribute("mask", "url(" + getLocationHref() +
"#" + s + ")"); i[0]; )
a.appendChild(i[0]);
this.elem.layerElement.appendChild(a),
this.masker = o,
t.setAttribute("stroke", "#fff")
} else if (1 === this.filterManager.effectElements[10].p.v || 2
=== this.filterManager.effectElements[10].p.v) {
if (2 === this.filterManager.effectElements[10].p.v)
for (i = this.elem.layerElement.children ||
this.elem.layerElement.childNodes; i.length; )
this.elem.layerElement.removeChild(i[0]);
this.elem.layerElement.appendChild(t),
this.elem.layerElement.removeAttribute("mask"),
t.setAttribute("stroke", "#fff")
}
this.initialized = !0,
this.pathMasker = t
}
,
SVGStrokeEffect.prototype.renderFrame = function(e) {
var t;
this.initialized || this.initialize();
var r, n, i = this.paths.length;
for (t = 0; t < i; t += 1)
if (-1 !== this.paths[t].m && (r =
this.elem.maskManager.viewData[this.paths[t].m],
n = this.paths[t].p,
(e || this.filterManager._mdf || r.prop._mdf) &&
n.setAttribute("d", r.lastPath),
e || this.filterManager.effectElements[9].p._mdf ||
this.filterManager.effectElements[4].p._mdf ||
this.filterManager.effectElements[7].p._mdf ||
this.filterManager.effectElements[8].p._mdf || r.prop._mdf)) {
var o;
if (0 !== this.filterManager.effectElements[7].p.v ||
100 !== this.filterManager.effectElements[8].p.v) {
var s = .01 *
Math.min(this.filterManager.effectElements[7].p.v,
this.filterManager.effectElements[8].p.v)
, a = .01 *
Math.max(this.filterManager.effectElements[7].p.v,
this.filterManager.effectElements[8].p.v)
, l = n.getTotalLength();
o = "0 0 0 " + l * s + " ";
var c, u = l * (a - s), d = 1 + 2 *
this.filterManager.effectElements[4].p.v * this.filterManager.effectElements[9].p.v
* .01, p = Math.floor(u / d);
for (c = 0; c < p; c += 1)
o += "1 " + 2 *
this.filterManager.effectElements[4].p.v * this.filterManager.effectElements[9].p.v
* .01 + " ";
o += "0 " + 10 * l + " 0 0"
} else
o = "1 " + 2 *
this.filterManager.effectElements[4].p.v * this.filterManager.effectElements[9].p.v
* .01;
n.setAttribute("stroke-dasharray", o)
}
if ((e || this.filterManager.effectElements[4].p._mdf) &&
this.pathMasker.setAttribute("stroke-width", 2 *
this.filterManager.effectElements[4].p.v),
(e || this.filterManager.effectElements[6].p._mdf) &&
this.pathMasker.setAttribute("opacity", this.filterManager.effectElements[6].p.v),
(1 === this.filterManager.effectElements[10].p.v || 2 ===
this.filterManager.effectElements[10].p.v) && (e ||
this.filterManager.effectElements[3].p._mdf)) {
var h = this.filterManager.effectElements[3].p.v;
this.pathMasker.setAttribute("stroke", "rgb(" + bmFloor(255
* h[0]) + "," + bmFloor(255 * h[1]) + "," + bmFloor(255 * h[2]) + ")")
}
}
,
SVGTritoneFilter.prototype.renderFrame = function(e) {
if (e || this.filterManager._mdf) {
var t = this.filterManager.effectElements[0].p.v
, r = this.filterManager.effectElements[1].p.v
, n = this.filterManager.effectElements[2].p.v
, i = n[0] + " " + r[0] + " " + t[0]
, o = n[1] + " " + r[1] + " " + t[1]
, s = n[2] + " " + r[2] + " " + t[2];
this.feFuncR.setAttribute("tableValues", i),
this.feFuncG.setAttribute("tableValues", o),
this.feFuncB.setAttribute("tableValues", s)
}
}
,
SVGProLevelsFilter.prototype.createFeFunc = function(e, t) {
var r = createNS(e);
return r.setAttribute("type", "table"),
t.appendChild(r),
r
}
,
SVGProLevelsFilter.prototype.getTableValue = function(e, t, r, n,
i) {
for (var o, s, a = 0, l = Math.min(e, t), c = Math.max(e, t), u
= Array.call(null, {
length: 256
}), d = 0, p = i - n, h = t - e; a <= 256; )
s = (o = a / 256) <= l ? h < 0 ? i : n : o >= c ? h < 0 ? n
: i : n + p * Math.pow((o - e) / h, 1 / r),
u[d] = s,
d += 1,
a += 256 / 255;
return u.join(" ")
}
,
SVGProLevelsFilter.prototype.renderFrame = function(e) {
if (e || this.filterManager._mdf) {
var t, r = this.filterManager.effectElements;
this.feFuncRComposed && (e || r[3].p._mdf || r[4].p._mdf ||
r[5].p._mdf || r[6].p._mdf || r[7].p._mdf) && (t = this.getTableValue(r[3].p.v,
r[4].p.v, r[5].p.v, r[6].p.v, r[7].p.v),
this.feFuncRComposed.setAttribute("tableValues", t),
this.feFuncGComposed.setAttribute("tableValues", t),
this.feFuncBComposed.setAttribute("tableValues", t)),
this.feFuncR && (e || r[10].p._mdf || r[11].p._mdf ||
r[12].p._mdf || r[13].p._mdf || r[14].p._mdf) && (t = this.getTableValue(r[10].p.v,
r[11].p.v, r[12].p.v, r[13].p.v, r[14].p.v),
this.feFuncR.setAttribute("tableValues", t)),
this.feFuncG && (e || r[17].p._mdf || r[18].p._mdf ||
r[19].p._mdf || r[20].p._mdf || r[21].p._mdf) && (t = this.getTableValue(r[17].p.v,
r[18].p.v, r[19].p.v, r[20].p.v, r[21].p.v),
this.feFuncG.setAttribute("tableValues", t)),
this.feFuncB && (e || r[24].p._mdf || r[25].p._mdf ||
r[26].p._mdf || r[27].p._mdf || r[28].p._mdf) && (t = this.getTableValue(r[24].p.v,
r[25].p.v, r[26].p.v, r[27].p.v, r[28].p.v),
this.feFuncB.setAttribute("tableValues", t)),
this.feFuncA && (e || r[31].p._mdf || r[32].p._mdf ||
r[33].p._mdf || r[34].p._mdf || r[35].p._mdf) && (t = this.getTableValue(r[31].p.v,
r[32].p.v, r[33].p.v, r[34].p.v, r[35].p.v),
this.feFuncA.setAttribute("tableValues", t))
}
}
,
extendPrototype([SVGComposableEffect], SVGDropShadowEffect),
SVGDropShadowEffect.prototype.renderFrame = function(e) {
if (e || this.filterManager._mdf) {
if ((e || this.filterManager.effectElements[4].p._mdf) &&
this.feGaussianBlur.setAttribute("stdDeviation",
this.filterManager.effectElements[4].p.v / 4),
e || this.filterManager.effectElements[0].p._mdf) {
var t = this.filterManager.effectElements[0].p.v;
this.feFlood.setAttribute("flood-color",
rgbToHex(Math.round(255 * t[0]), Math.round(255 * t[1]), Math.round(255 * t[2])))
}
if ((e || this.filterManager.effectElements[1].p._mdf) &&
this.feFlood.setAttribute("flood-opacity", this.filterManager.effectElements[1].p.v
/ 255),
e || this.filterManager.effectElements[2].p._mdf ||
this.filterManager.effectElements[3].p._mdf) {
var r = this.filterManager.effectElements[3].p.v
, n = (this.filterManager.effectElements[2].p.v - 90)
* degToRads
, i = r * Math.cos(n)
, o = r * Math.sin(n);
this.feOffset.setAttribute("dx", i),
this.feOffset.setAttribute("dy", o)
}
}
}
;
var _svgMatteSymbols = [];
function SVGMatte3Effect(e, t, r) {
this.initialized = !1,
this.filterManager = t,
this.filterElem = e,
this.elem = r,
r.matteElement = createNS("g"),
r.matteElement.appendChild(r.layerElement),
r.matteElement.appendChild(r.transformedElement),
r.baseElement = r.matteElement
}
function SVGGaussianBlurEffect(e, t, r, n) {
e.setAttribute("x", "-100%"),
e.setAttribute("y", "-100%"),
e.setAttribute("width", "300%"),
e.setAttribute("height", "300%"),
this.filterManager = t;
var i = createNS("feGaussianBlur");
i.setAttribute("result", n),
e.appendChild(i),
this.feGaussianBlur = i
}
function TransformEffect() {}
function SVGTransformEffect(e, t) {
this.init(t)
}
function CVTransformEffect(e) {
this.init(e)
}
return SVGMatte3Effect.prototype.findSymbol = function(e) {
for (var t = 0, r = _svgMatteSymbols.length; t < r; ) {
if (_svgMatteSymbols[t] === e)
return _svgMatteSymbols[t];
t += 1
}
return null
}
,
SVGMatte3Effect.prototype.replaceInParent = function(e, t) {
var r = e.layerElement.parentNode;
if (r) {
for (var n, i = r.children, o = 0, s = i.length; o < s &&
i[o] !== e.layerElement; )
o += 1;
o <= s - 2 && (n = i[o + 1]);
var a = createNS("use");
a.setAttribute("href", "#" + t),
n ? r.insertBefore(a, n) : r.appendChild(a)
}
}
,
SVGMatte3Effect.prototype.setElementAsMask = function(e, t) {
if (!this.findSymbol(t)) {
var r = createElementID()
, n = createNS("mask");
n.setAttribute("id", t.layerId),
n.setAttribute("mask-type", "alpha"),
_svgMatteSymbols.push(t);
var i = e.globalData.defs;
i.appendChild(n);
var o = createNS("symbol");
o.setAttribute("id", r),
this.replaceInParent(t, r),
o.appendChild(t.layerElement),
i.appendChild(o);
var s = createNS("use");
s.setAttribute("href", "#" + r),
n.appendChild(s),
t.data.hd = !1,
t.show()
}
e.setMatte(t.layerId)
}
,
SVGMatte3Effect.prototype.initialize = function() {
for (var e = this.filterManager.effectElements[0].p.v, t =
this.elem.comp.elements, r = 0, n = t.length; r < n; )
t[r] && t[r].data.ind === e &&
this.setElementAsMask(this.elem, t[r]),
r += 1;
this.initialized = !0
}
,
SVGMatte3Effect.prototype.renderFrame = function() {
this.initialized || this.initialize()
}
,
SVGGaussianBlurEffect.prototype.renderFrame = function(e) {
if (e || this.filterManager._mdf) {
var t = .3 * this.filterManager.effectElements[0].p.v
, r = this.filterManager.effectElements[1].p.v
, n = 3 == r ? 0 : t
, i = 2 == r ? 0 : t;
this.feGaussianBlur.setAttribute("stdDeviation", n + " " +
i);
var o = 1 == this.filterManager.effectElements[2].p.v ?
"wrap" : "duplicate";
this.feGaussianBlur.setAttribute("edgeMode", o)
}
}
,
TransformEffect.prototype.init = function(e) {
this.effectsManager = e,
this.type = effectTypes.TRANSFORM_EFFECT,
this.matrix = new Matrix,
this.opacity = -1,
this._mdf = !1,
this._opMdf = !1
}
,
TransformEffect.prototype.renderFrame = function(e) {
if (this._opMdf = !1,
this._mdf = !1,
e || this.effectsManager._mdf) {
var t = this.effectsManager.effectElements
, r = t[0].p.v
, n = t[1].p.v
, i = 1 === t[2].p.v
, o = t[3].p.v
, s = i ? o : t[4].p.v
, a = t[5].p.v
, l = t[6].p.v
, c = t[7].p.v;
this.matrix.reset(),
this.matrix.translate(-r[0], -r[1], r[2]),
this.matrix.scale(.01 * s, .01 * o, 1),
this.matrix.rotate(-c * degToRads),
this.matrix.skewFromAxis(-a * degToRads, (l + 90) *
degToRads),
this.matrix.translate(n[0], n[1], 0),
this._mdf = !0,
this.opacity !== t[8].p.v && (this.opacity = t[8].p.v,
this._opMdf = !0)
}
}
,
extendPrototype([TransformEffect], SVGTransformEffect),
extendPrototype([TransformEffect], CVTransformEffect),
registerRenderer("canvas", CanvasRenderer),
registerRenderer("html", HybridRenderer),
registerRenderer("svg", SVGRenderer),
ShapeModifiers.registerModifier("tm", TrimModifier),
ShapeModifiers.registerModifier("pb", PuckerAndBloatModifier),
ShapeModifiers.registerModifier("rp", RepeaterModifier),
ShapeModifiers.registerModifier("rd", RoundCornersModifier),
ShapeModifiers.registerModifier("zz", ZigZagModifier),
ShapeModifiers.registerModifier("op", OffsetPathModifier),
setExpressionsPlugin(Expressions),
setExpressionInterfaces(getInterface),
initialize$1(),
initialize(),
registerEffect$1(20, SVGTintFilter, !0),
registerEffect$1(21, SVGFillFilter, !0),
registerEffect$1(22, SVGStrokeEffect, !1),
registerEffect$1(23, SVGTritoneFilter, !0),
registerEffect$1(24, SVGProLevelsFilter, !0),
registerEffect$1(25, SVGDropShadowEffect, !0),
registerEffect$1(28, SVGMatte3Effect, !1),
registerEffect$1(29, SVGGaussianBlurEffect, !0),
registerEffect$1(35, SVGTransformEffect, !1),
registerEffect(35, CVTransformEffect),
lottie
}
,
module.exports = factory())
}
)(lottie$1, lottie$1.exports);
var lottieExports = lottie$1.exports;
const lottie = getDefaultExportFromCjs(lottieExports);
var ch2 = {}
, wk = function(e, t, r, n, i) {
var o = new Worker(ch2[t] || (ch2[t] = URL.createObjectURL(new
Blob([e],{
type: "text/javascript"
}))));
return o.onerror = function(e) {
return i(e.error, null)
}
,
o.onmessage = function(e) {
return i(null, e.data)
}
,
o.postMessage(r, n),
o
}
, u8$1 = Uint8Array
, u16$1 = Uint16Array
, u32$1 = Uint32Array
, fleb = new u8$1([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3,
3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0])
, fdeb = new u8$1([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0])
, clim = new u8$1([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2,
14, 1, 15])
, freb = function(e, t) {
for (var r = new u16$1(31), n = 0; n < 31; ++n)
r[n] = t += 1 << e[n - 1];
var i = new u32$1(r[30]);
for (n = 1; n < 30; ++n)
for (var o = r[n]; o < r[n + 1]; ++o)
i[o] = o - r[n] << 5 | n;
return [r, i]
}
, _a$2 = freb(fleb, 2)
, fl = _a$2[0]
, revfl = _a$2[1];
fl[28] = 258,
revfl[258] = 28;
for (var _b = freb(fdeb, 0), fd = _b[0], rev = new u16$1(32768), i$4 = 0;
i$4 < 32768; ++i$4) {
var x$1 = (43690 & i$4) >>> 1 | (21845 & i$4) << 1;
x$1 = (52428 & x$1) >>> 2 | (13107 & x$1) << 2,
x$1 = (61680 & x$1) >>> 4 | (3855 & x$1) << 4,
rev[i$4] = ((65280 & x$1) >>> 8 | (255 & x$1) << 8) >>> 1
}
for (var hMap = function(e, t, r) {
for (var n = e.length, i = 0, o = new u16$1(t); i < n; ++i)
++o[e[i] - 1];
var s, a = new u16$1(t);
for (i = 0; i < t; ++i)
a[i] = a[i - 1] + o[i - 1] << 1;
if (r) {
s = new u16$1(1 << t);
var l = 15 - t;
for (i = 0; i < n; ++i)
if (e[i])
for (var c = i << 4 | e[i], u = t - e[i], d = a[e[i] - 1]++
<< u, p = d | (1 << u) - 1; d <= p; ++d)
s[rev[d] >>> l] = c
} else
for (s = new u16$1(n),
i = 0; i < n; ++i)
e[i] && (s[i] = rev[a[e[i] - 1]++] >>> 15 - e[i]);
return s
}, flt = new u8$1(288), i$4 = 0; i$4 < 144; ++i$4)
flt[i$4] = 8;
for (var i$4 = 144; i$4 < 256; ++i$4)
flt[i$4] = 9;
for (var i$4 = 256; i$4 < 280; ++i$4)
flt[i$4] = 7;
for (var i$4 = 280; i$4 < 288; ++i$4)
flt[i$4] = 8;
for (var fdt = new u8$1(32), i$4 = 0; i$4 < 32; ++i$4)
fdt[i$4] = 5;
var flrm = hMap(flt, 9, 1)
, fdrm = hMap(fdt, 5, 1)
, max$1 = function(e) {
for (var t = e[0], r = 1; r < e.length; ++r)
e[r] > t && (t = e[r]);
return t
}
, bits = function(e, t, r) {
var n = t / 8 | 0;
return (e[n] | e[n + 1] << 8) >> (7 & t) & r
}
, bits16 = function(e, t) {
var r = t / 8 | 0;
return (e[r] | e[r + 1] << 8 | e[r + 2] << 16) >> (7 & t)
}
, shft = function(e) {
return (e / 8 | 0) + (7 & e && 1)
}
, slc = function(e, t, r) {
(null == t || t < 0) && (t = 0),
(null == r || r > e.length) && (r = e.length);
var n = new (e instanceof u16$1 ? u16$1 : e instanceof u32$1 ? u32$1 :
u8$1)(r - t);
return n.set(e.subarray(t, r)),
n
}
, inflt = function(e, t, r) {
var n = e.length;
if (!n || r && !r.l && n < 5)
return t || new u8$1(0);
var i = !t || r
, o = !r || r.i;
r || (r = {}),
t || (t = new u8$1(3 * n));
var s = function(e) {
var r = t.length;
if (e > r) {
var n = new u8$1(Math.max(2 * r, e));
n.set(t),
t = n
}
}
, a = r.f || 0
, l = r.p || 0
, c = r.b || 0
, u = r.l
, d = r.d
, p = r.m
, h = r.n
, f = 8 * n;
do {
if (!u) {
r.f = a = bits(e, l, 1);
var m = bits(e, l + 1, 3);
if (l += 3,
!m) {
var g = e[(w = shft(l) + 4) - 4] | e[w - 3] << 8
, y = w + g;
if (y > n) {
if (o)
throw "unexpected EOF";
break
}
i && s(c + g),
t.set(e.subarray(w, y), c),
r.b = c += g,
r.p = l = 8 * y;
continue
}
if (1 == m)
u = flrm,
d = fdrm,
p = 9,
h = 5;
else {
if (2 != m)
throw "invalid block type";
var v = bits(e, l, 31) + 257
, b = bits(e, l + 10, 15) + 4
, x = v + bits(e, l + 5, 31) + 1;
l += 14;
for (var _ = new u8$1(x), E = new u8$1(19), T = 0; T < b; +
+T)
E[clim[T]] = bits(e, l + 3 * T, 7);
l += 3 * b;
var C = max$1(E)
, S = (1 << C) - 1
, $ = hMap(E, C, 1);
for (T = 0; T < x; ) {
var w, P = $[bits(e, l, S)];
if (l += 15 & P,
(w = P >>> 4) < 16)
_[T++] = w;
else {
var R = 0
, k = 0;
for (16 == w ? (k = 3 + bits(e, l, 3),
l += 2,
R = _[T - 1]) : 17 == w ? (k = 3 + bits(e, l, 7),
l += 3) : 18 == w && (k = 11 + bits(e, l, 127),
l += 7); k--; )
_[T++] = R
}
}
var A = _.subarray(0, v)
, I = _.subarray(v);
p = max$1(A),
h = max$1(I),
u = hMap(A, p, 1),
d = hMap(I, h, 1)
}
if (l > f) {
if (o)
throw "unexpected EOF";
break
}
}
i && s(c + 131072);
for (var O = (1 << p) - 1, D = (1 << h) - 1, M = l; ; M = l) {
var L = (R = u[bits16(e, l) & O]) >>> 4;
if ((l += 15 & R) > f) {
if (o)
throw "unexpected EOF";
break
}
if (!R)
throw "invalid length/literal";
if (L < 256)
t[c++] = L;
else {
if (256 == L) {
M = l,
u = null;
break
}
var j = L - 254;
if (L > 264) {
var F = fleb[T = L - 257];
j = bits(e, l, (1 << F) - 1) + fl[T],
l += F
}
var N = d[bits16(e, l) & D]
, B = N >>> 4;
if (!N)
throw "invalid distance";
l += 15 & N;
I = fd[B];
if (B > 3) {
F = fdeb[B];
I += bits16(e, l) & (1 << F) - 1,
l += F
}
if (l > f) {
if (o)
throw "unexpected EOF";
break
}
i && s(c + 131072);
for (var z = c + j; c < z; c += 4)
t[c] = t[c - I],
t[c + 1] = t[c + 1 - I],
t[c + 2] = t[c + 2 - I],
t[c + 3] = t[c + 3 - I];
c = z
}
}
r.l = u,
r.p = M,
r.b = c,
u && (a = 1,
r.m = p,
r.d = d,
r.n = h)
} while (!a);
return c == t.length ? t : slc(t, 0, c)
}
, et$1 = new u8$1(0)
, mrg = function(e, t) {
var r = {};
for (var n in e)
r[n] = e[n];
for (var n in t)
r[n] = t[n];
return r
}
, wcln = function(e, t, r) {
for (var n = e(), i = e.toString(), o = i.slice(i.indexOf("[") + 1,
i.lastIndexOf("]")).replace(/ /g, "").split(","), s = 0; s < n.length; ++s) {
var a = n[s]
, l = o[s];
if ("function" == typeof a) {
t += ";" + l + "=";
var c = a.toString();
if (a.prototype)
if (-1 != c.indexOf("[native code]")) {
var u = c.indexOf(" ", 8) + 1;
t += c.slice(u, c.indexOf("(", u))
} else
for (var d in t += c,
a.prototype)
t += ";" + l + ".prototype." + d + "=" +
a.prototype[d].toString();
else
t += c
} else
r[l] = a
}
return [t, r]
}
, ch$1 = []
, cbfs = function(e) {
var t = [];
for (var r in e)
(e[r]instanceof u8$1 || e[r]instanceof u16$1 || e[r]instanceof
u32$1) && t.push((e[r] = new e[r].constructor(e[r])).buffer);
return t
}
, wrkr = function(e, t, r, n) {
var i;
if (!ch$1[r]) {
for (var o = "", s = {}, a = e.length - 1, l = 0; l < a; ++l)
o = (i = wcln(e[l], o, s))[0],
s = i[1];
ch$1[r] = wcln(e[a], o, s)
}
var c = mrg({}, ch$1[r][1]);
return wk(ch$1[r][0] + ";onmessage=function(e){for(var k in
e.data)self[k]=e.data[k];onmessage=" + t.toString() + "}", r, c, cbfs(c), n)
}
, bInflt = function() {
return [u8$1, u16$1, u32$1, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev,
hMap, max$1, bits, bits16, shft, slc, inflt, inflateSync, pbf, gu8]
}
, pbf = function(e) {
return postMessage(e, [e.buffer])
}
, gu8 = function(e) {
return e && e.size && new u8$1(e.size)
}
, cbify = function(e, t, r, n, i, o) {
var s = wrkr(r, n, i, (function(e, t) {
s.terminate(),
o(e, t)
}
));
return s.postMessage([e, t], t.consume ? [e.buffer] : []),
function() {
s.terminate()
}
}
, b2 = function(e, t) {
return e[t] | e[t + 1] << 8
}
, b4 = function(e, t) {
return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0
}
, b8 = function(e, t) {
return b4(e, t) + 4294967296 * b4(e, t + 4)
};
function inflate(e, t, r) {
if (r || (r = t,
t = {}),
"function" != typeof r)
throw "no callback";
return cbify(e, t, [bInflt], (function(e) {
return pbf(inflateSync(e.data[0], gu8(e.data[1])))
}
), 1, r)
}
function inflateSync(e, t) {
return inflt(e, t)
}
var td = "undefined" != typeof TextDecoder && new TextDecoder
, tds = 0;
try {
td.decode(et$1, {
stream: !0
}),
tds = 1
} catch (e2) {}
var dutf8 = function(e) {
for (var t = "", r = 0; ; ) {
var n = e[r++]
, i = (n > 127) + (n > 223) + (n > 239);
if (r + i > e.length)
return [t, slc(e, r - 1)];
i ? 3 == i ? (n = ((15 & n) << 18 | (63 & e[r++]) << 12 | (63 &
e[r++]) << 6 | 63 & e[r++]) - 65536,
t += String.fromCharCode(55296 | n >> 10, 56320 | 1023 & n)) : t +=
1 & i ? String.fromCharCode((31 & n) << 6 | 63 & e[r++]) : String.fromCharCode((15
& n) << 12 | (63 & e[r++]) << 6 | 63 & e[r++]) : t += String.fromCharCode(n)
}
};
function strFromU8(e, t) {
if (t) {
for (var r = "", n = 0; n < e.length; n += 16384)
r += String.fromCharCode.apply(null, e.subarray(n, n + 16384));
return r
}
if (td)
return td.decode(e);
var i = dutf8(e)
, o = i[0];
if (i[1].length)
throw "invalid utf-8 data";
return o
}
var slzh = function(e, t) {
return t + 30 + b2(e, t + 26) + b2(e, t + 28)
}
, zh$1 = function(e, t, r) {
var n = b2(e, t + 28)
, i = strFromU8(e.subarray(t + 46, t + 46 + n), !(2048 & b2(e, t +
8)))
, o = t + 46 + n
, s = b4(e, t + 20)
, a = r && 4294967295 == s ? z64e(e, o) : [s, b4(e, t + 24), b4(e, t
+ 42)]
, l = a[0]
, c = a[1]
, u = a[2];
return [b2(e, t + 10), l, c, i, o + b2(e, t + 30) + b2(e, t + 32), u]
}
, z64e = function(e, t) {
for (; 1 != b2(e, t); t += 4 + b2(e, t + 2))
;
return [b8(e, t + 12), b8(e, t + 4), b8(e, t + 20)]
};
function unzip(e, t) {
if ("function" != typeof t)
throw "no callback";
for (var r = [], n = function() {
for (var e = 0; e < r.length; ++e)
r[e]()
}, i = {}, o = e.length - 22; 101010256 != b4(e, o); --o)
if (!o || e.length - o > 65558)
return void t("invalid zip file", null);
var s = b2(e, o + 8);
s || t(null, {});
var a = s
, l = b4(e, o + 16)
, c = 4294967295 == l;
if (c) {
if (o = b4(e, o - 12),
101075792 != b4(e, o))
return void t("invalid zip file", null);
a = s = b4(e, o + 32),
l = b4(e, o + 48)
}
for (var u = function(o) {
var a = zh$1(e, l, c)
, u = a[0]
, d = a[1]
, p = a[2]
, h = a[3]
, f = a[4]
, m = a[5]
, g = slzh(e, m);
l = f;
var y = function(e, r) {
e ? (n(),
t(e, null)) : (i[h] = r,
--s || t(null, i))
};
if (u)
if (8 == u) {
var v = e.subarray(g, g + d);
if (d < 32e4)
try {
y(null, inflateSync(v, new u8$1(p)))
} catch (b) {
y(b, null)
}
else
r.push(inflate(v, {
size: p
}, y))
} else
y("unknown compression type " + u, null);
else
y(null, slc(e, g, g + d))
}, d = 0; d < a; ++d)
u();
return n
}
var buffer = {}
, base64Js = {};
base64Js.byteLength = byteLength,
base64Js.toByteArray = toByteArray,
base64Js.fromByteArray = fromByteArray;
for (var lookup = [], revLookup = [], Arr = "undefined" != typeof
Uint8Array ? Uint8Array : Array, code =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i$3 = 0, len =
code.length; i$3 < len; ++i$3)
lookup[i$3] = code[i$3],
revLookup[code.charCodeAt(i$3)] = i$3;
function getLens(e) {
var t = e.length;
if (t % 4 > 0)
throw new Error("Invalid string. Length must be a multiple of 4");
var r = e.indexOf("=");
return -1 === r && (r = t),
[r, r === t ? 0 : 4 - r % 4]
}
function byteLength(e) {
var t = getLens(e)
, r = t[0]
, n = t[1];
return 3 * (r + n) / 4 - n
}
function _byteLength(e, t, r) {
return 3 * (t + r) / 4 - r
}
function toByteArray(e) {
var t, r, n = getLens(e), i = n[0], o = n[1], s = new
Arr(_byteLength(e, i, o)), a = 0, l = o > 0 ? i - 4 : i;
for (r = 0; r < l; r += 4)
t = revLookup[e.charCodeAt(r)] << 18 | revLookup[e.charCodeAt(r +
1)] << 12 | revLookup[e.charCodeAt(r + 2)] << 6 | revLookup[e.charCodeAt(r + 3)],
s[a++] = t >> 16 & 255,
s[a++] = t >> 8 & 255,
s[a++] = 255 & t;
return 2 === o && (t = revLookup[e.charCodeAt(r)] << 2 |
revLookup[e.charCodeAt(r + 1)] >> 4,
s[a++] = 255 & t),
1 === o && (t = revLookup[e.charCodeAt(r)] << 10 |
revLookup[e.charCodeAt(r + 1)] << 4 | revLookup[e.charCodeAt(r + 2)] >> 2,
s[a++] = t >> 8 & 255,
s[a++] = 255 & t),
s
}
function tripletToBase64(e) {
return lookup[e >> 18 & 63] + lookup[e >> 12 & 63] + lookup[e >> 6 &
63] + lookup[63 & e]
}
function encodeChunk(e, t, r) {
for (var n, i = [], o = t; o < r; o += 3)
n = (e[o] << 16 & 16711680) + (e[o + 1] << 8 & 65280) + (255 & e[o
+ 2]),
i.push(tripletToBase64(n));
return i.join("")
}
function fromByteArray(e) {
for (var t, r = e.length, n = r % 3, i = [], o = 16383, s = 0, a = r -
n; s < a; s += o)
i.push(encodeChunk(e, s, s + o > a ? a : s + o));
return 1 === n ? (t = e[r - 1],
i.push(lookup[t >> 2] + lookup[t << 4 & 63] + "==")) : 2 === n && (t =
(e[r - 2] << 8) + e[r - 1],
i.push(lookup[t >> 10] + lookup[t >> 4 & 63] + lookup[t << 2 & 63] +
"=")),
i.join("")
}
revLookup["-".charCodeAt(0)] = 62,
revLookup["_".charCodeAt(0)] = 63;
var ieee754 = {
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh
<https://feross.org/opensource> */
read: function(e, t, r, n, i) {
var o, s, a = 8 * i - n - 1, l = (1 << a) - 1, c = l >> 1, u = -7,
d = r ? i - 1 : 0, p = r ? -1 : 1, h = e[t + d];
for (d += p,
o = h & (1 << -u) - 1,
h >>= -u,
u += a; u > 0; o = 256 * o + e[t + d],
d += p,
u -= 8)
;
for (s = o & (1 << -u) - 1,
o >>= -u,
u += n; u > 0; s = 256 * s + e[t + d],
d += p,
u -= 8)
;
if (0 === o)
o = 1 - c;
else {
if (o === l)
return s ? NaN : 1 / 0 * (h ? -1 : 1);
s += Math.pow(2, n),
o -= c
}
return (h ? -1 : 1) * s * Math.pow(2, o - n)
},
write: function(e, t, r, n, i, o) {
var s, a, l, c = 8 * o - i - 1, u = (1 << c) - 1, d = u >> 1, p =
23 === i ? Math.pow(2, -24) - Math.pow(2, -77) : 0, h = n ? 0 : o - 1, f = n ? 1 :
-1, m = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
for (t = Math.abs(t),
isNaN(t) || t === 1 / 0 ? (a = isNaN(t) ? 1 : 0,
s = u) : (s = Math.floor(Math.log(t) / Math.LN2),
t * (l = Math.pow(2, -s)) < 1 && (s--,
l *= 2),
(t += s + d >= 1 ? p / l : p * Math.pow(2, 1 - d)) * l >= 2 && (s+
+,
l /= 2),
s + d >= u ? (a = 0,
s = u) : s + d >= 1 ? (a = (t * l - 1) * Math.pow(2, i),
s += d) : (a = t * Math.pow(2, d - 1) * Math.pow(2, i),
s = 0)); i >= 8; e[r + h] = 255 & a,
h += f,
a /= 256,
i -= 8)
;
for (s = s << i | a,
c += i; c > 0; e[r + h] = 255 & s,
h += f,
s /= 256,
c -= 8)
;
e[r + h - f] |= 128 * m
}
};
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
!function(e) {
var t = base64Js
, r = ieee754
, n = "function" == typeof Symbol && "function" == typeof
Symbol.for ? Symbol.for("nodejs.util.inspect.custom") : null;
e.Buffer = s,
e.SlowBuffer = function(e) {
+e != e && (e = 0);
return s.alloc(+e)
}
,
e.INSPECT_MAX_BYTES = 50;
var i = 2147483647;
function o(e) {
if (e > i)
throw new RangeError('The value "' + e + '" is invalid for
option "size"');
var t = new Uint8Array(e);
return Object.setPrototypeOf(t, s.prototype),
t
}
function s(e, t, r) {
if ("number" == typeof e) {
if ("string" == typeof t)
throw new TypeError('The "string" argument must be of type
string. Received type number');
return c(e)
}
return a(e, t, r)
}
function a(e, t, r) {
if ("string" == typeof e)
return function(e, t) {
"string" == typeof t && "" !== t || (t = "utf8");
if (!s.isEncoding(t))
throw new TypeError("Unknown encoding: " + t);
var r = 0 | h(e, t)
, n = o(r)
, i = n.write(e, t);
i !== r && (n = n.slice(0, i));
return n
}(e, t);
if (ArrayBuffer.isView(e))
return function(e) {
if (N(e, Uint8Array)) {
var t = new Uint8Array(e);
return d(t.buffer, t.byteOffset, t.byteLength)
}
return u(e)
}(e);
if (null == e)
throw new TypeError("The first argument must be one of type
string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof
e);
if (N(e, ArrayBuffer) || e && N(e.buffer, ArrayBuffer))
return d(e, t, r);
if ("undefined" != typeof SharedArrayBuffer && (N(e,
SharedArrayBuffer) || e && N(e.buffer, SharedArrayBuffer)))
return d(e, t, r);
if ("number" == typeof e)
throw new TypeError('The "value" argument must not be of type
number. Received type number');
var n = e.valueOf && e.valueOf();
if (null != n && n !== e)
return s.from(n, t, r);
var i = function(e) {
if (s.isBuffer(e)) {
var t = 0 | p(e.length)
, r = o(t);
return 0 === r.length || e.copy(r, 0, 0, t),
r
}
if (void 0 !== e.length)
return "number" != typeof e.length || B(e.length) ? o(0) :
u(e);
if ("Buffer" === e.type && Array.isArray(e.data))
return u(e.data)
}(e);
if (i)
return i;
if ("undefined" != typeof Symbol && null != Symbol.toPrimitive &&
"function" == typeof e[Symbol.toPrimitive])
return s.from(e[Symbol.toPrimitive]("string"), t, r);
throw new TypeError("The first argument must be one of type string,
Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e)
}
function l(e) {
if ("number" != typeof e)
throw new TypeError('"size" argument must be of type number');
if (e < 0)
throw new RangeError('The value "' + e + '" is invalid for
option "size"')
}
function c(e) {
return l(e),
o(e < 0 ? 0 : 0 | p(e))
}
function u(e) {
for (var t = e.length < 0 ? 0 : 0 | p(e.length), r = o(t), n = 0; n
< t; n += 1)
r[n] = 255 & e[n];
return r
}
function d(e, t, r) {
if (t < 0 || e.byteLength < t)
throw new RangeError('"offset" is outside of buffer bounds');
if (e.byteLength < t + (r || 0))
throw new RangeError('"length" is outside of buffer bounds');
var n;
return n = void 0 === t && void 0 === r ? new Uint8Array(e) : void
0 === r ? new Uint8Array(e,t) : new Uint8Array(e,t,r),
Object.setPrototypeOf(n, s.prototype),
n
}
function p(e) {
if (e >= i)
throw new RangeError("Attempt to allocate Buffer larger than
maximum size: 0x" + i.toString(16) + " bytes");
return 0 | e
}
function h(e, t) {
if (s.isBuffer(e))
return e.length;
if (ArrayBuffer.isView(e) || N(e, ArrayBuffer))
return e.byteLength;
if ("string" != typeof e)
throw new TypeError('The "string" argument must be one of type
string, Buffer, or ArrayBuffer. Received type ' + typeof e);
var r = e.length
, n = arguments.length > 2 && !0 === arguments[2];
if (!n && 0 === r)
return 0;
for (var i = !1; ; )
switch (t) {
case "ascii":
case "latin1":
case "binary":
return r;
case "utf8":
case "utf-8":
return L(e).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * r;
case "hex":
return r >>> 1;
case "base64":
return j(e).length;
default:
if (i)
return n ? -1 : L(e).length;
t = ("" + t).toLowerCase(),
i = !0
}
}
function f(e, t, r) {
var n = !1;
if ((void 0 === t || t < 0) && (t = 0),
t > this.length)
return "";
if ((void 0 === r || r > this.length) && (r = this.length),
r <= 0)
return "";
if ((r >>>= 0) <= (t >>>= 0))
return "";
for (e || (e = "utf8"); ; )
switch (e) {
case "hex":
return P(this, t, r);
case "utf8":
case "utf-8":
return C(this, t, r);
case "ascii":
return $(this, t, r);
case "latin1":
case "binary":
return w(this, t, r);
case "base64":
return T(this, t, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return R(this, t, r);
default:
if (n)
throw new TypeError("Unknown encoding: " + e);
e = (e + "").toLowerCase(),
n = !0
}
}
function m(e, t, r) {
var n = e[t];
e[t] = e[r],
e[r] = n
}
function g(e, t, r, n, i) {
if (0 === e.length)
return -1;
if ("string" == typeof r ? (n = r,
r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r =
-2147483648),
B(r = +r) && (r = i ? 0 : e.length - 1),
r < 0 && (r = e.length + r),
r >= e.length) {
if (i)
return -1;
r = e.length - 1
} else if (r < 0) {
if (!i)
return -1;
r = 0
}
if ("string" == typeof t && (t = s.from(t, n)),
s.isBuffer(t))
return 0 === t.length ? -1 : y(e, t, r, n, i);
if ("number" == typeof t)
return t &= 255,
"function" == typeof Uint8Array.prototype.indexOf ? i ?
Uint8Array.prototype.indexOf.call(e, t, r) :
Uint8Array.prototype.lastIndexOf.call(e, t, r) : y(e, [t], r, n, i);
throw new TypeError("val must be string, number or Buffer")
}
function y(e, t, r, n, i) {
var o, s = 1, a = e.length, l = t.length;
if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) ||
"ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
if (e.length < 2 || t.length < 2)
return -1;
s = 2,
a /= 2,
l /= 2,
r /= 2
}
function c(e, t) {
return 1 === s ? e[t] : e.readUInt16BE(t * s)
}
if (i) {
var u = -1;
for (o = r; o < a; o++)
if (c(e, o) === c(t, -1 === u ? 0 : o - u)) {
if (-1 === u && (u = o),
o - u + 1 === l)
return u * s
} else
-1 !== u && (o -= o - u),
u = -1
} else
for (r + l > a && (r = a - l),
o = r; o >= 0; o--) {
for (var d = !0, p = 0; p < l; p++)
if (c(e, o + p) !== c(t, p)) {
d = !1;
break
}
if (d)
return o
}
return -1
}
function v(e, t, r, n) {
r = Number(r) || 0;
var i = e.length - r;
n ? (n = Number(n)) > i && (n = i) : n = i;
var o = t.length;
n > o / 2 && (n = o / 2);
for (var s = 0; s < n; ++s) {
var a = parseInt(t.substr(2 * s, 2), 16);
if (B(a))
return s;
e[r + s] = a
}
return s
}
function b(e, t, r, n) {
return F(L(t, e.length - r), e, r, n)
}
function x(e, t, r, n) {
return F(function(e) {
for (var t = [], r = 0; r < e.length; ++r)
t.push(255 & e.charCodeAt(r));
return t
}(t), e, r, n)
}
function _(e, t, r, n) {
return F(j(t), e, r, n)
}
function E(e, t, r, n) {
return F(function(e, t) {
for (var r, n, i, o = [], s = 0; s < e.length && !((t -= 2) <
0); ++s)
n = (r = e.charCodeAt(s)) >> 8,
i = r % 256,
o.push(i),
o.push(n);
return o
}(t, e.length - r), e, r, n)
}
function T(e, r, n) {
return 0 === r && n === e.length ? t.fromByteArray(e) :
t.fromByteArray(e.slice(r, n))
}
function C(e, t, r) {
r = Math.min(e.length, r);
for (var n = [], i = t; i < r; ) {
var o, s, a, l, c = e[i], u = null, d = c > 239 ? 4 : c > 223 ?
3 : c > 191 ? 2 : 1;
if (i + d <= r)
switch (d) {
case 1:
c < 128 && (u = c);
break;
case 2:
128 == (192 & (o = e[i + 1])) && (l = (31 & c) << 6 |
63 & o) > 127 && (u = l);
break;
case 3:
o = e[i + 1],
s = e[i + 2],
128 == (192 & o) && 128 == (192 & s) && (l = (15 & c)
<< 12 | (63 & o) << 6 | 63 & s) > 2047 && (l < 55296 || l > 57343) && (u = l);
break;
case 4:
o = e[i + 1],
s = e[i + 2],
a = e[i + 3],
128 == (192 & o) && 128 == (192 & s) && 128 == (192 &
a) && (l = (15 & c) << 18 | (63 & o) << 12 | (63 & s) << 6 | 63 & a) > 65535 && l <
1114112 && (u = l)
}
null === u ? (u = 65533,
d = 1) : u > 65535 && (u -= 65536,
n.push(u >>> 10 & 1023 | 55296),
u = 56320 | 1023 & u),
n.push(u),
i += d
}
return function(e) {
var t = e.length;
if (t <= S)
return String.fromCharCode.apply(String, e);
var r = ""
, n = 0;
for (; n < t; )
r += String.fromCharCode.apply(String, e.slice(n, n += S));
return r
}(n)
}
e.kMaxLength = i,
s.TYPED_ARRAY_SUPPORT = function() {
try {
var e = new Uint8Array(1)
, t = {
foo: function() {
return 42
}
};
return Object.setPrototypeOf(t, Uint8Array.prototype),
Object.setPrototypeOf(e, t),
42 === e.foo()
} catch (e2) {
return !1
}
}(),
!s.TYPED_ARRAY_SUPPORT && "undefined" != typeof console &&
console.error,
Object.defineProperty(s.prototype, "parent", {
enumerable: !0,
get: function() {
if (s.isBuffer(this))
return this.buffer
}
}),
Object.defineProperty(s.prototype, "offset", {
enumerable: !0,
get: function() {
if (s.isBuffer(this))
return this.byteOffset
}
}),
s.poolSize = 8192,
s.from = function(e, t, r) {
return a(e, t, r)
}
,
Object.setPrototypeOf(s.prototype, Uint8Array.prototype),
Object.setPrototypeOf(s, Uint8Array),
s.alloc = function(e, t, r) {
return function(e, t, r) {
return l(e),
e <= 0 ? o(e) : void 0 !== t ? "string" == typeof r ?
o(e).fill(t, r) : o(e).fill(t) : o(e)
}(e, t, r)
}
,
s.allocUnsafe = function(e) {
return c(e)
}
,
s.allocUnsafeSlow = function(e) {
return c(e)
}
,
s.isBuffer = function(e) {
return null != e && !0 === e._isBuffer && e !== s.prototype
}
,
s.compare = function(e, t) {
if (N(e, Uint8Array) && (e = s.from(e, e.offset, e.byteLength)),
N(t, Uint8Array) && (t = s.from(t, t.offset, t.byteLength)),
!s.isBuffer(e) || !s.isBuffer(t))
throw new TypeError('The "buf1", "buf2" arguments must be one
of type Buffer or Uint8Array');
if (e === t)
return 0;
for (var r = e.length, n = t.length, i = 0, o = Math.min(r, n); i <
o; ++i)
if (e[i] !== t[i]) {
r = e[i],
n = t[i];
break
}
return r < n ? -1 : n < r ? 1 : 0
}
,
s.isEncoding = function(e) {
switch (String(e).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return !0;
default:
return !1
}
}
,
s.concat = function(e, t) {
if (!Array.isArray(e))
throw new TypeError('"list" argument must be an Array of
Buffers');
if (0 === e.length)
return s.alloc(0);
var r;
if (void 0 === t)
for (t = 0,
r = 0; r < e.length; ++r)
t += e[r].length;
var n = s.allocUnsafe(t)
, i = 0;
for (r = 0; r < e.length; ++r) {
var o = e[r];
if (N(o, Uint8Array))
i + o.length > n.length ? s.from(o).copy(n, i) :
Uint8Array.prototype.set.call(n, o, i);
else {
if (!s.isBuffer(o))
throw new TypeError('"list" argument must be an Array
of Buffers');
o.copy(n, i)
}
i += o.length
}
return n
}
,
s.byteLength = h,
s.prototype._isBuffer = !0,
s.prototype.swap16 = function() {
var e = this.length;
if (e % 2 != 0)
throw new RangeError("Buffer size must be a multiple of 16-
bits");
for (var t = 0; t < e; t += 2)
m(this, t, t + 1);
return this
}
,
s.prototype.swap32 = function() {
var e = this.length;
if (e % 4 != 0)
throw new RangeError("Buffer size must be a multiple of 32-
bits");
for (var t = 0; t < e; t += 4)
m(this, t, t + 3),
m(this, t + 1, t + 2);
return this
}
,
s.prototype.swap64 = function() {
var e = this.length;
if (e % 8 != 0)
throw new RangeError("Buffer size must be a multiple of 64-
bits");
for (var t = 0; t < e; t += 8)
m(this, t, t + 7),
m(this, t + 1, t + 6),
m(this, t + 2, t + 5),
m(this, t + 3, t + 4);
return this
}
,
s.prototype.toString = function() {
var e = this.length;
return 0 === e ? "" : 0 === arguments.length ? C(this, 0, e) :
f.apply(this, arguments)
}
,
s.prototype.toLocaleString = s.prototype.toString,
s.prototype.equals = function(e) {
if (!s.isBuffer(e))
throw new TypeError("Argument must be a Buffer");
return this === e || 0 === s.compare(this, e)
}
,
s.prototype.inspect = function() {
var t = ""
, r = e.INSPECT_MAX_BYTES;
return t = this.toString("hex", 0, r).replace(/(.{2})/g, "$1
").trim(),
this.length > r && (t += " ... "),
"<Buffer " + t + ">"
}
,
n && (s.prototype[n] = s.prototype.inspect),
s.prototype.compare = function(e, t, r, n, i) {
if (N(e, Uint8Array) && (e = s.from(e, e.offset, e.byteLength)),
!s.isBuffer(e))
throw new TypeError('The "target" argument must be one of type
Buffer or Uint8Array. Received type ' + typeof e);
if (void 0 === t && (t = 0),
void 0 === r && (r = e ? e.length : 0),
void 0 === n && (n = 0),
void 0 === i && (i = this.length),
t < 0 || r > e.length || n < 0 || i > this.length)
throw new RangeError("out of range index");
if (n >= i && t >= r)
return 0;
if (n >= i)
return -1;
if (t >= r)
return 1;
if (this === e)
return 0;
for (var o = (i >>>= 0) - (n >>>= 0), a = (r >>>= 0) - (t >>>= 0),
l = Math.min(o, a), c = this.slice(n, i), u = e.slice(t, r), d = 0; d < l; ++d)
if (c[d] !== u[d]) {
o = c[d],
a = u[d];
break
}
return o < a ? -1 : a < o ? 1 : 0
}
,
s.prototype.includes = function(e, t, r) {
return -1 !== this.indexOf(e, t, r)
}
,
s.prototype.indexOf = function(e, t, r) {
return g(this, e, t, r, !0)
}
,
s.prototype.lastIndexOf = function(e, t, r) {
return g(this, e, t, r, !1)
}
,
s.prototype.write = function(e, t, r, n) {
if (void 0 === t)
n = "utf8",
r = this.length,
t = 0;
else if (void 0 === r && "string" == typeof t)
n = t,
r = this.length,
t = 0;
else {
if (!isFinite(t))
throw new Error("Buffer.write(string, encoding, offset[,
length]) is no longer supported");
t >>>= 0,
isFinite(r) ? (r >>>= 0,
void 0 === n && (n = "utf8")) : (n = r,
r = void 0)
}
var i = this.length - t;
if ((void 0 === r || r > i) && (r = i),
e.length > 0 && (r < 0 || t < 0) || t > this.length)
throw new RangeError("Attempt to write outside buffer bounds");
n || (n = "utf8");
for (var o = !1; ; )
switch (n) {
case "hex":
return v(this, e, t, r);
case "utf8":
case "utf-8":
return b(this, e, t, r);
case "ascii":
case "latin1":
case "binary":
return x(this, e, t, r);
case "base64":
return _(this, e, t, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return E(this, e, t, r);
default:
if (o)
throw new TypeError("Unknown encoding: " + n);
n = ("" + n).toLowerCase(),
o = !0
}
}
,
s.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
;
var S = 4096;
function $(e, t, r) {
var n = "";
r = Math.min(e.length, r);
for (var i = t; i < r; ++i)
n += String.fromCharCode(127 & e[i]);
return n
}
function w(e, t, r) {
var n = "";
r = Math.min(e.length, r);
for (var i = t; i < r; ++i)
n += String.fromCharCode(e[i]);
return n
}
function P(e, t, r) {
var n = e.length;
(!t || t < 0) && (t = 0),
(!r || r < 0 || r > n) && (r = n);
for (var i = "", o = t; o < r; ++o)
i += z[e[o]];
return i
}
function R(e, t, r) {
for (var n = e.slice(t, r), i = "", o = 0; o < n.length - 1; o +=
2)
i += String.fromCharCode(n[o] + 256 * n[o + 1]);
return i
}
function k(e, t, r) {
if (e % 1 != 0 || e < 0)
throw new RangeError("offset is not uint");
if (e + t > r)
throw new RangeError("Trying to access beyond buffer length")
}
function A(e, t, r, n, i, o) {
if (!s.isBuffer(e))
throw new TypeError('"buffer" argument must be a Buffer
instance');
if (t > i || t < o)
throw new RangeError('"value" argument is out of bounds');
if (r + n > e.length)
throw new RangeError("Index out of range")
}
function I(e, t, r, n, i, o) {
if (r + n > e.length)
throw new RangeError("Index out of range");
if (r < 0)
throw new RangeError("Index out of range")
}
function O(e, t, n, i, o) {
return t = +t,
n >>>= 0,
o || I(e, 0, n, 4),
r.write(e, t, n, i, 23, 4),
n + 4
}
function D(e, t, n, i, o) {
return t = +t,
n >>>= 0,
o || I(e, 0, n, 8),
r.write(e, t, n, i, 52, 8),
n + 8
}
s.prototype.slice = function(e, t) {
var r = this.length;
(e = ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r),
(t = void 0 === t ? r : ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r
&& (t = r),
t < e && (t = e);
var n = this.subarray(e, t);
return Object.setPrototypeOf(n, s.prototype),
n
}
,
s.prototype.readUintLE = s.prototype.readUIntLE = function(e, t, r) {
e >>>= 0,
t >>>= 0,
r || k(e, t, this.length);
for (var n = this[e], i = 1, o = 0; ++o < t && (i *= 256); )
n += this[e + o] * i;
return n
}
,
s.prototype.readUintBE = s.prototype.readUIntBE = function(e, t, r) {
e >>>= 0,
t >>>= 0,
r || k(e, t, this.length);
for (var n = this[e + --t], i = 1; t > 0 && (i *= 256); )
n += this[e + --t] * i;
return n
}
,
s.prototype.readUint8 = s.prototype.readUInt8 = function(e, t) {
return e >>>= 0,
t || k(e, 1, this.length),
this[e]
}
,
s.prototype.readUint16LE = s.prototype.readUInt16LE = function(e, t) {
return e >>>= 0,
t || k(e, 2, this.length),
this[e] | this[e + 1] << 8
}
,
s.prototype.readUint16BE = s.prototype.readUInt16BE = function(e, t) {
return e >>>= 0,
t || k(e, 2, this.length),
this[e] << 8 | this[e + 1]
}
,
s.prototype.readUint32LE = s.prototype.readUInt32LE = function(e, t) {
return e >>>= 0,
t || k(e, 4, this.length),
(this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 *
this[e + 3]
}
,
s.prototype.readUint32BE = s.prototype.readUInt32BE = function(e, t) {
return e >>>= 0,
t || k(e, 4, this.length),
16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e
+ 3])
}
,
s.prototype.readIntLE = function(e, t, r) {
e >>>= 0,
t >>>= 0,
r || k(e, t, this.length);
for (var n = this[e], i = 1, o = 0; ++o < t && (i *= 256); )
n += this[e + o] * i;
return n >= (i *= 128) && (n -= Math.pow(2, 8 * t)),
n
}
,
s.prototype.readIntBE = function(e, t, r) {
e >>>= 0,
t >>>= 0,
r || k(e, t, this.length);
for (var n = t, i = 1, o = this[e + --n]; n > 0 && (i *= 256); )
o += this[e + --n] * i;
return o >= (i *= 128) && (o -= Math.pow(2, 8 * t)),
o
}
,
s.prototype.readInt8 = function(e, t) {
return e >>>= 0,
t || k(e, 1, this.length),
128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
}
,
s.prototype.readInt16LE = function(e, t) {
e >>>= 0,
t || k(e, 2, this.length);
var r = this[e] | this[e + 1] << 8;
return 32768 & r ? 4294901760 | r : r
}
,
s.prototype.readInt16BE = function(e, t) {
e >>>= 0,
t || k(e, 2, this.length);
var r = this[e + 1] | this[e] << 8;
return 32768 & r ? 4294901760 | r : r
}
,
s.prototype.readInt32LE = function(e, t) {
return e >>>= 0,
t || k(e, 4, this.length),
this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
}
,
s.prototype.readInt32BE = function(e, t) {
return e >>>= 0,
t || k(e, 4, this.length),
this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
}
,
s.prototype.readFloatLE = function(e, t) {
return e >>>= 0,
t || k(e, 4, this.length),
r.read(this, e, !0, 23, 4)
}
,
s.prototype.readFloatBE = function(e, t) {
return e >>>= 0,
t || k(e, 4, this.length),
r.read(this, e, !1, 23, 4)
}
,
s.prototype.readDoubleLE = function(e, t) {
return e >>>= 0,
t || k(e, 8, this.length),
r.read(this, e, !0, 52, 8)
}
,
s.prototype.readDoubleBE = function(e, t) {
return e >>>= 0,
t || k(e, 8, this.length),
r.read(this, e, !1, 52, 8)
}
,
s.prototype.writeUintLE = s.prototype.writeUIntLE = function(e, t, r,
n) {
(e = +e,
t >>>= 0,
r >>>= 0,
n) || A(this, e, t, r, Math.pow(2, 8 * r) - 1, 0);
var i = 1
, o = 0;
for (this[t] = 255 & e; ++o < r && (i *= 256); )
this[t + o] = e / i & 255;
return t + r
}
,
s.prototype.writeUintBE = s.prototype.writeUIntBE = function(e, t, r,
n) {
(e = +e,
t >>>= 0,
r >>>= 0,
n) || A(this, e, t, r, Math.pow(2, 8 * r) - 1, 0);
var i = r - 1
, o = 1;
for (this[t + i] = 255 & e; --i >= 0 && (o *= 256); )
this[t + i] = e / o & 255;
return t + r
}
,
s.prototype.writeUint8 = s.prototype.writeUInt8 = function(e, t, r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 1, 255, 0),
this[t] = 255 & e,
t + 1
}
,
s.prototype.writeUint16LE = s.prototype.writeUInt16LE = function(e, t,
r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 2, 65535, 0),
this[t] = 255 & e,
this[t + 1] = e >>> 8,
t + 2
}
,
s.prototype.writeUint16BE = s.prototype.writeUInt16BE = function(e, t,
r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 2, 65535, 0),
this[t] = e >>> 8,
this[t + 1] = 255 & e,
t + 2
}
,
s.prototype.writeUint32LE = s.prototype.writeUInt32LE = function(e, t,
r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 4, 4294967295, 0),
this[t + 3] = e >>> 24,
this[t + 2] = e >>> 16,
this[t + 1] = e >>> 8,
this[t] = 255 & e,
t + 4
}
,
s.prototype.writeUint32BE = s.prototype.writeUInt32BE = function(e, t,
r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 4, 4294967295, 0),
this[t] = e >>> 24,
this[t + 1] = e >>> 16,
this[t + 2] = e >>> 8,
this[t + 3] = 255 & e,
t + 4
}
,
s.prototype.writeIntLE = function(e, t, r, n) {
if (e = +e,
t >>>= 0,
!n) {
var i = Math.pow(2, 8 * r - 1);
A(this, e, t, r, i - 1, -i)
}
var o = 0
, s = 1
, a = 0;
for (this[t] = 255 & e; ++o < r && (s *= 256); )
e < 0 && 0 === a && 0 !== this[t + o - 1] && (a = 1),
this[t + o] = (e / s | 0) - a & 255;
return t + r
}
,
s.prototype.writeIntBE = function(e, t, r, n) {
if (e = +e,
t >>>= 0,
!n) {
var i = Math.pow(2, 8 * r - 1);
A(this, e, t, r, i - 1, -i)
}
var o = r - 1
, s = 1
, a = 0;
for (this[t + o] = 255 & e; --o >= 0 && (s *= 256); )
e < 0 && 0 === a && 0 !== this[t + o + 1] && (a = 1),
this[t + o] = (e / s | 0) - a & 255;
return t + r
}
,
s.prototype.writeInt8 = function(e, t, r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 1, 127, -128),
e < 0 && (e = 255 + e + 1),
this[t] = 255 & e,
t + 1
}
,
s.prototype.writeInt16LE = function(e, t, r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 2, 32767, -32768),
this[t] = 255 & e,
this[t + 1] = e >>> 8,
t + 2
}
,
s.prototype.writeInt16BE = function(e, t, r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 2, 32767, -32768),
this[t] = e >>> 8,
this[t + 1] = 255 & e,
t + 2
}
,
s.prototype.writeInt32LE = function(e, t, r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 4, 2147483647, -2147483648),
this[t] = 255 & e,
this[t + 1] = e >>> 8,
this[t + 2] = e >>> 16,
this[t + 3] = e >>> 24,
t + 4
}
,
s.prototype.writeInt32BE = function(e, t, r) {
return e = +e,
t >>>= 0,
r || A(this, e, t, 4, 2147483647, -2147483648),
e < 0 && (e = 4294967295 + e + 1),
this[t] = e >>> 24,
this[t + 1] = e >>> 16,
this[t + 2] = e >>> 8,
this[t + 3] = 255 & e,
t + 4
}
,
s.prototype.writeFloatLE = function(e, t, r) {
return O(this, e, t, !0, r)
}
,
s.prototype.writeFloatBE = function(e, t, r) {
return O(this, e, t, !1, r)
}
,
s.prototype.writeDoubleLE = function(e, t, r) {
return D(this, e, t, !0, r)
}
,
s.prototype.writeDoubleBE = function(e, t, r) {
return D(this, e, t, !1, r)
}
,
s.prototype.copy = function(e, t, r, n) {
if (!s.isBuffer(e))
throw new TypeError("argument should be a Buffer");
if (r || (r = 0),
n || 0 === n || (n = this.length),
t >= e.length && (t = e.length),
t || (t = 0),
n > 0 && n < r && (n = r),
n === r)
return 0;
if (0 === e.length || 0 === this.length)
return 0;
if (t < 0)
throw new RangeError("targetStart out of bounds");
if (r < 0 || r >= this.length)
throw new RangeError("Index out of range");
if (n < 0)
throw new RangeError("sourceEnd out of bounds");
n > this.length && (n = this.length),
e.length - t < n - r && (n = e.length - t + r);
var i = n - r;
return this === e && "function" == typeof
Uint8Array.prototype.copyWithin ? this.copyWithin(t, r, n) :
Uint8Array.prototype.set.call(e, this.subarray(r, n), t),
i
}
,
s.prototype.fill = function(e, t, r, n) {
if ("string" == typeof e) {
if ("string" == typeof t ? (n = t,
t = 0,
r = this.length) : "string" == typeof r && (n = r,
r = this.length),
void 0 !== n && "string" != typeof n)
throw new TypeError("encoding must be a string");
if ("string" == typeof n && !s.isEncoding(n))
throw new TypeError("Unknown encoding: " + n);
if (1 === e.length) {
var i = e.charCodeAt(0);
("utf8" === n && i < 128 || "latin1" === n) && (e = i)
}
} else
"number" == typeof e ? e &= 255 : "boolean" == typeof e && (e =
Number(e));
if (t < 0 || this.length < t || this.length < r)
throw new RangeError("Out of range index");
if (r <= t)
return this;
var o;
if (t >>>= 0,
r = void 0 === r ? this.length : r >>> 0,
e || (e = 0),
"number" == typeof e)
for (o = t; o < r; ++o)
this[o] = e;
else {
var a = s.isBuffer(e) ? e : s.from(e, n)
, l = a.length;
if (0 === l)
throw new TypeError('The value "' + e + '" is invalid for
argument "value"');
for (o = 0; o < r - t; ++o)
this[o + t] = a[o % l]
}
return this
}
;
var M = /[^+/0-9A-Za-z-_]/g;
function L(e, t) {
var r;
t = t || 1 / 0;
for (var n = e.length, i = null, o = [], s = 0; s < n; ++s) {
if ((r = e.charCodeAt(s)) > 55295 && r < 57344) {
if (!i) {
if (r > 56319) {
(t -= 3) > -1 && o.push(239, 191, 189);
continue
}
if (s + 1 === n) {
(t -= 3) > -1 && o.push(239, 191, 189);
continue
}
i = r;
continue
}
if (r < 56320) {
(t -= 3) > -1 && o.push(239, 191, 189),
i = r;
continue
}
r = 65536 + (i - 55296 << 10 | r - 56320)
} else
i && (t -= 3) > -1 && o.push(239, 191, 189);
if (i = null,
r < 128) {
if ((t -= 1) < 0)
break;
o.push(r)
} else if (r < 2048) {
if ((t -= 2) < 0)
break;
o.push(r >> 6 | 192, 63 & r | 128)
} else if (r < 65536) {
if ((t -= 3) < 0)
break;
o.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128)
} else {
if (!(r < 1114112))
throw new Error("Invalid code point");
if ((t -= 4) < 0)
break;
o.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 |
128, 63 & r | 128)
}
}
return o
}
function j(e) {
return t.toByteArray(function(e) {
if ((e = (e = e.split("=")[0]).trim().replace(M, "")).length <
2)
return "";
for (; e.length % 4 != 0; )
e += "=";
return e
}(e))
}
function F(e, t, r, n) {
for (var i = 0; i < n && !(i + r >= t.length || i >= e.length); +
+i)
t[i + r] = e[i];
return i
}
function N(e, t) {
return e instanceof t || null != e && null != e.constructor && null
!= e.constructor.name && e.constructor.name === t.name
}
function B(e) {
return e != e
}
var z = function() {
for (var e = "0123456789abcdef", t = new Array(256), r = 0; r < 16;
++r)
for (var n = 16 * r, i = 0; i < 16; ++i)
t[n + i] = e[r] + e[i];
return t
}()
}(buffer);
const fetchLottie = async (e, t) => {
var r;
t || (t = null == (r = e.split(".").pop()) ? void 0 : r.toLowerCase());
let n = 200;
try {
const r = await fetch(e);
if (n = r.status,
"json" === t)
return await r.json();
const i = new Uint8Array(await r.arrayBuffer())
, o = await new Promise(( (e, t) => {
unzip(i, ( (r, n) => {
r && t(r),
e(n)
}
))
}
))
, s = strFromU8(o["manifest.json"])
, a = JSON.parse(s);
if (!("animations"in a))
throw new Error("Manifest not found");
if (!a.animations.length)
throw new Error("No animations listed in manifest");
const {id: l} = a.animations[0]
, c = strFromU8(null == o ? void 0 : o[`animations/${l}.json`])
, u = await JSON.parse(c);
return "assets"in u && Promise.all(u.assets.map((e => {
const {p: t} = e;
if (t && (null == o ? void 0 : o[`images/${t}`]))
return new Promise((r => {
var n;
const i = t.split(".").pop()
, s = null == (n = buffer.Buffer.from(null == o ?
void 0 : o[`images/${t}`])) ? void 0 : n.toString("base64");
switch (i) {
case "svg":
case "svg+xml":
e.p = `data:image/svg+xml;base64,${s}`;
break;
case "png":
case "jpg":
case "jpeg":
case "gif":
case "webp":
e.p = `data:image/${i};base64,${s}`;
break;
default:
e.p = `data:;base64,${s}`
}
e.e = 1,
r()
}
))
}
))),
u
} catch (i) {
throw 404 === n ? new Error("File not found") : new Error("Unable
to load file")
}
}
;
function LottieEl$1(e) {
const {visible: t, env: r, trackIndex: n, relativeTime: i} = e
, o = e.element
, s = reactExports.useRef()
, a = e.store
, [l,c] = reactExports.useState(!1)
, u = reactExports.useRef()
, d = reactExports.useRef()
, p = reactExports.useRef()
, h = reactExports.useMemo(( () => {
const e = new Container
, t = a.resourceManage.getCacheBlobURLById(o.resourceId);
p.current = document.createElement("div"),
p.current.style.position = "absolute",
p.current.style.top = "0px",
p.current.style.left = "0px",
p.current.style.width = "1px",
p.current.style.height = "1px",
p.current.style.overflow = "hidden",
document.body.appendChild(p.current),
a.renderAsyncMark[o.id] = "start";
const r = new Image;
r.src = config$2.emptyBase64;
const n = Texture.from(r)
, i = new Sprite(n.clone());
d.current = i.texture;
const s = a.resourceManage.getCacheItemBySourceId(o.resourceId);
return fetchLottie(t, null == s ? void 0 :
s.resource.url.split(".").pop()).then((e => {
var t, r;
u.current = lottie.loadAnimation({
container: p.current,
renderer: "canvas",
loop: !0,
autoplay: !1,
animationData: e
}),
null == (t = p.current) || t.remove();
const [s,l] = [o.style.width, o.style.height];
u.current.renderer.renderConfig.dpr = 1,
u.current.resize(s, l),
i.texture = Texture.from(u.current.container),
d.current = i.texture,
n.on("update", ( () => {
c(!0)
}
)),
u.current.goToAndStop(o.initStartFrame || 0),
u.current.setSpeed(o.lottieSpeed),
null == (r = d.current) || r.update(),
a.renderAsyncMark[o.id] = "success"
}
)),
n.on("update", ( () => {
c(!0)
}
)),
i.name = "element",
e.addChild(i),
e
}
), [o.resourceId]);
reactExports.useEffect(( () => {
var e;
u.current && (u.current.destroy(),
null == (e = p.current) || e.remove())
}
), []),
reactExports.useEffect(( () => {
var e;
if (u.current) {
const {currentFrame: t, totalFrames: r} = u.current
, n = o.initStartFrame + t;
u.current.goToAndStop(n % r, !0),
u.current.setSpeed(o.lottieSpeed),
null == (e = d.current) || e.update()
}
}
), [o.initStartFrame, o.lottieSpeed]),
useElementFilter(h, o),
reactExports.useEffect(( () => {
var e;
u.current && (u.current.resize(o.style.width, o.style.height),
null == (e = d.current) || e.update())
}
), [o.style.width, o.style.height]);
const [f] = useSyncPixiElement$1(h, {
style: {
...o.style
},
parent: e.parent,
animateRef: s,
visible: t,
hide: e.hide,
lock: e.lock,
relativeTime: e.relativeTime,
store: e.store
}, ["x", "y", "width", "height", "alpha", "rotation"], o);
return reactExports.useEffect(( () => {
const e = a.resourceManage.getResouceById(o.resourceId);
if (l && o.cropSize && e) {
const e = h.children.find((e => "element" === e.name))
, {x: t, y: r, width: n, height: i} = o.cropSize;
e.texture.frame = new Rectangle(t,r,n,i),
f({
...o.style
}, h)
}
}
), [o.cropSize, l]),
reactExports.useEffect(( () => {
var e;
if ("export" === r && (a.elementReadyMark[o.id] = "start"),
null !== i && u.current) {
const {frameRate: t, totalFrames: r} = u.current
, n = ~~((i * t + o.initStartFrame) * o.lottieSpeed % r);
u.current.goToAndStop(n, !0),
null == (e = d.current) || e.update()
}
"export" === r && (a.elementReadyMark[o.id] = "success")
}
), [i]),
jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
children: ["editor" === r && jsxRuntimeExports.jsx(ControlElment$1,
{
trackIndex: n,
hide: e.hide,
lock: e.lock,
scale: e.scale,
store: e.store,
element: o,
visible: t
}), jsxRuntimeExports.jsx(Animate$2, {
ref: s,
store: e.store,
pixiElem: h,
elementData: o,
currentTime: e.currentTime,
relativeTime: e.relativeTime
})]
})
}
function arrayEach$3(e, t) {
for (var r = -1, n = null == e ? 0 : e.length; ++r < n && !1 !==
t(e[r], r, e); )
;
return e
}
var _arrayEach = arrayEach$3
, baseAssignValue$3 = _baseAssignValue
, eq$3 = eq_1
, objectProto$k = Object.prototype
, hasOwnProperty$k = objectProto$k.hasOwnProperty;
function assignValue$5(e, t, r) {
var n = e[t];
hasOwnProperty$k.call(e, t) && eq$3(n, r) && (void 0 !== r || t in e)
|| baseAssignValue$3(e, t, r)
}
var _assignValue = assignValue$5
, assignValue$4 = _assignValue
, baseAssignValue$2 = _baseAssignValue;
function copyObject$8(e, t, r, n) {
var i = !r;
r || (r = {});
for (var o = -1, s = t.length; ++o < s; ) {
var a = t[o]
, l = n ? n(r[a], e[a], a, r, e) : void 0;
void 0 === l && (l = e[a]),
i ? baseAssignValue$2(r, a, l) : assignValue$4(r, a, l)
}
return r
}
var _copyObject = copyObject$8
, copyObject$7 = _copyObject
, keys$4 = keys_1;
function baseAssign$1(e, t) {
return e && copyObject$7(t, keys$4(t), e)
}
var _baseAssign = baseAssign$1;
function nativeKeysIn$2(e) {
var t = [];
if (null != e)
for (var r in Object(e))
t.push(r);
return t
}
var _nativeKeysIn = nativeKeysIn$2
, isObject$b = isObject_1
, isPrototype$4 = _isPrototype
, nativeKeysIn$1 = _nativeKeysIn
, objectProto$j = Object.prototype
, hasOwnProperty$j = objectProto$j.hasOwnProperty;
function baseKeysIn$2(e) {
if (!isObject$b(e))
return nativeKeysIn$1(e);
var t = isPrototype$4(e)
, r = [];
for (var n in e)
("constructor" != n || !t && hasOwnProperty$j.call(e, n)) &&
r.push(n);
return r
}
var _baseKeysIn = baseKeysIn$2
, arrayLikeKeys$1 = _arrayLikeKeys
, baseKeysIn$1 = _baseKeysIn
, isArrayLike$8 = isArrayLike_1;
function keysIn$6(e) {
return isArrayLike$8(e) ? arrayLikeKeys$1(e, !0) : baseKeysIn$1(e)
}
var keysIn_1 = keysIn$6
, copyObject$6 = _copyObject
, keysIn$5 = keysIn_1;
function baseAssignIn$1(e, t) {
return e && copyObject$6(t, keysIn$5(t), e)
}
var _baseAssignIn = baseAssignIn$1
, _cloneBuffer = {
exports: {}
};
_cloneBuffer.exports,
function(e, t) {
var r = _root
, n = t && !t.nodeType && t
, i = n && e && !e.nodeType && e
, o = i && i.exports === n ? r.Buffer : void 0
, s = o ? o.allocUnsafe : void 0;
e.exports = function(e, t) {
if (t)
return e.slice();
var r = e.length
, n = s ? s(r) : new e.constructor(r);
return e.copy(n),
n
}
}(_cloneBuffer, _cloneBuffer.exports);
var _cloneBufferExports = _cloneBuffer.exports;
function copyArray$4(e, t) {
var r = -1
, n = e.length;
for (t || (t = Array(n)); ++r < n; )
t[r] = e[r];
return t
}
var _copyArray = copyArray$4
, copyObject$5 = _copyObject
, getSymbols$3 = _getSymbols;
function copySymbols$1(e, t) {
return copyObject$5(e, getSymbols$3(e), t)
}
var _copySymbols = copySymbols$1
, overArg$1 = _overArg
, getPrototype$5 = overArg$1(Object.getPrototypeOf, Object)
, _getPrototype = getPrototype$5
, arrayPush$2 = _arrayPush
, getPrototype$4 = _getPrototype
, getSymbols$2 = _getSymbols
, stubArray$1 = stubArray_1
, nativeGetSymbols$1 = Object.getOwnPropertySymbols
, getSymbolsIn$2 = nativeGetSymbols$1 ? function(e) {
for (var t = []; e; )
arrayPush$2(t, getSymbols$2(e)),
e = getPrototype$4(e);
return t
}
: stubArray$1
, _getSymbolsIn = getSymbolsIn$2
, copyObject$4 = _copyObject
, getSymbolsIn$1 = _getSymbolsIn;
function copySymbolsIn$1(e, t) {
return copyObject$4(e, getSymbolsIn$1(e), t)
}
var _copySymbolsIn = copySymbolsIn$1
, baseGetAllKeys$1 = _baseGetAllKeys
, getSymbolsIn = _getSymbolsIn
, keysIn$4 = keysIn_1;
function getAllKeysIn$2(e) {
return baseGetAllKeys$1(e, keysIn$4, getSymbolsIn)
}
var _getAllKeysIn = getAllKeysIn$2
, objectProto$i = Object.prototype
, hasOwnProperty$i = objectProto$i.hasOwnProperty;
function initCloneArray$1(e) {
var t = e.length
, r = new e.constructor(t);
return t && "string" == typeof e[0] && hasOwnProperty$i.call(e,
"index") && (r.index = e.index,
r.input = e.input),
r
}
var _initCloneArray = initCloneArray$1
, Uint8Array$3 = _Uint8Array;
function cloneArrayBuffer$4(e) {
var t = new e.constructor(e.byteLength);
return new Uint8Array$3(t).set(new Uint8Array$3(e)),
t
}
var _cloneArrayBuffer = cloneArrayBuffer$4
, cloneArrayBuffer$3 = _cloneArrayBuffer;
function cloneDataView$1(e, t) {
var r = t ? cloneArrayBuffer$3(e.buffer) : e.buffer;
return new e.constructor(r,e.byteOffset,e.byteLength)
}
var _cloneDataView = cloneDataView$1
, reFlags = /\w*$/;
function cloneRegExp$1(e) {
var t = new e.constructor(e.source,reFlags.exec(e));
return t.lastIndex = e.lastIndex,
t
}
var _cloneRegExp = cloneRegExp$1
, Symbol$4 = _Symbol
, symbolProto$2 = Symbol$4 ? Symbol$4.prototype : void 0
, symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : void 0;
function cloneSymbol$1(e) {
return symbolValueOf$1 ? Object(symbolValueOf$1.call(e)) : {}
}
var _cloneSymbol = cloneSymbol$1
, cloneArrayBuffer$2 = _cloneArrayBuffer;
function cloneTypedArray$3(e, t) {
var r = t ? cloneArrayBuffer$2(e.buffer) : e.buffer;
return new e.constructor(r,e.byteOffset,e.length)
}
var _cloneTypedArray = cloneTypedArray$3
, cloneArrayBuffer$1 = _cloneArrayBuffer
, cloneDataView = _cloneDataView
, cloneRegExp = _cloneRegExp
, cloneSymbol = _cloneSymbol
, cloneTypedArray$2 = _cloneTypedArray
, boolTag$4 = "[object Boolean]"
, dateTag$4 = "[object Date]"
, mapTag$6 = "[object Map]"
, numberTag$4 = "[object Number]"
, regexpTag$4 = "[object RegExp]"
, setTag$6 = "[object Set]"
, stringTag$4 = "[object String]"
, symbolTag$3 = "[object Symbol]"
, arrayBufferTag$3 = "[object ArrayBuffer]"
, dataViewTag$4 = "[object DataView]"
, float32Tag$2 = "[object Float32Array]"
, float64Tag$2 = "[object Float64Array]"
, int8Tag$2 = "[object Int8Array]"
, int16Tag$2 = "[object Int16Array]"
, int32Tag$2 = "[object Int32Array]"
, uint8Tag$2 = "[object Uint8Array]"
, uint8ClampedTag$2 = "[object Uint8ClampedArray]"
, uint16Tag$2 = "[object Uint16Array]"
, uint32Tag$2 = "[object Uint32Array]";
function initCloneByTag$1(e, t, r) {
var n = e.constructor;
switch (t) {
case arrayBufferTag$3:
return cloneArrayBuffer$1(e);
case boolTag$4:
case dateTag$4:
return new n(+e);
case dataViewTag$4:
return cloneDataView(e, r);
case float32Tag$2:
case float64Tag$2:
case int8Tag$2:
case int16Tag$2:
case int32Tag$2:
case uint8Tag$2:
case uint8ClampedTag$2:
case uint16Tag$2:
case uint32Tag$2:
return cloneTypedArray$2(e, r);
case mapTag$6:
return new n;
case numberTag$4:
case stringTag$4:
return new n(e);
case regexpTag$4:
return cloneRegExp(e);
case setTag$6:
return new n;
case symbolTag$3:
return cloneSymbol(e)
}
}
var _initCloneByTag = initCloneByTag$1
, isObject$a = isObject_1
, objectCreate$1 = Object.create
, baseCreate$3 = function() {
function e() {}
return function(t) {
if (!isObject$a(t))
return {};
if (objectCreate$1)
return objectCreate$1(t);
e.prototype = t;
var r = new e;
return e.prototype = void 0,
r
}
}()
, _baseCreate = baseCreate$3
, baseCreate$2 = _baseCreate
, getPrototype$3 = _getPrototype
, isPrototype$3 = _isPrototype;
function initCloneObject$3(e) {
return "function" != typeof e.constructor || isPrototype$3(e) ? {} :
baseCreate$2(getPrototype$3(e))
}
var _initCloneObject = initCloneObject$3
, getTag$6 = _getTag
, isObjectLike$9 = isObjectLike_1
, mapTag$5 = "[object Map]";
function baseIsMap$1(e) {
return isObjectLike$9(e) && getTag$6(e) == mapTag$5
}
var _baseIsMap = baseIsMap$1
, baseIsMap = _baseIsMap
, baseUnary$5 = _baseUnary
, nodeUtil$5 = _nodeUtilExports
, nodeIsMap = nodeUtil$5 && nodeUtil$5.isMap
, isMap$1 = nodeIsMap ? baseUnary$5(nodeIsMap) : baseIsMap
, isMap_1 = isMap$1
, getTag$5 = _getTag
, isObjectLike$8 = isObjectLike_1
, setTag$5 = "[object Set]";
function baseIsSet$1(e) {
return isObjectLike$8(e) && getTag$5(e) == setTag$5
}
var _baseIsSet = baseIsSet$1
, baseIsSet = _baseIsSet
, baseUnary$4 = _baseUnary
, nodeUtil$4 = _nodeUtilExports
, nodeIsSet = nodeUtil$4 && nodeUtil$4.isSet
, isSet$1 = nodeIsSet ? baseUnary$4(nodeIsSet) : baseIsSet
, isSet_1 = isSet$1;
const _isSet = getDefaultExportFromCjs(isSet_1);
var Stack$2 = _Stack
, arrayEach$2 = _arrayEach
, assignValue$3 = _assignValue
, baseAssign = _baseAssign
, baseAssignIn = _baseAssignIn
, cloneBuffer$2 = _cloneBufferExports
, copyArray$3 = _copyArray
, copySymbols = _copySymbols
, copySymbolsIn = _copySymbolsIn
, getAllKeys$1 = _getAllKeys
, getAllKeysIn$1 = _getAllKeysIn
, getTag$4 = _getTag
, initCloneArray = _initCloneArray
, initCloneByTag = _initCloneByTag
, initCloneObject$2 = _initCloneObject
, isArray$b = isArray_1
, isBuffer$4 = isBufferExports
, isMap = isMap_1
, isObject$9 = isObject_1
, isSet = isSet_1
, keys$3 = keys_1
, keysIn$3 = keysIn_1
, CLONE_DEEP_FLAG$3 = 1
, CLONE_FLAT_FLAG$1 = 2
, CLONE_SYMBOLS_FLAG$3 = 4
, argsTag$3 = "[object Arguments]"
, arrayTag$2 = "[object Array]"
, boolTag$3 = "[object Boolean]"
, dateTag$3 = "[object Date]"
, errorTag$2 = "[object Error]"
, funcTag$2 = "[object Function]"
, genTag$1 = "[object GeneratorFunction]"
, mapTag$4 = "[object Map]"
, numberTag$3 = "[object Number]"
, objectTag$5 = "[object Object]"
, regexpTag$3 = "[object RegExp]"
, setTag$4 = "[object Set]"
, stringTag$3 = "[object String]"
, symbolTag$2 = "[object Symbol]"
, weakMapTag$2 = "[object WeakMap]"
, arrayBufferTag$2 = "[object ArrayBuffer]"
, dataViewTag$3 = "[object DataView]"
, float32Tag$1 = "[object Float32Array]"
, float64Tag$1 = "[object Float64Array]"
, int8Tag$1 = "[object Int8Array]"
, int16Tag$1 = "[object Int16Array]"
, int32Tag$1 = "[object Int32Array]"
, uint8Tag$1 = "[object Uint8Array]"
, uint8ClampedTag$1 = "[object Uint8ClampedArray]"
, uint16Tag$1 = "[object Uint16Array]"
, uint32Tag$1 = "[object Uint32Array]"
, cloneableTags = {};
function baseClone$3(e, t, r, n, i, o) {
var s, a = t & CLONE_DEEP_FLAG$3, l = t & CLONE_FLAT_FLAG$1, c = t &
CLONE_SYMBOLS_FLAG$3;
if (r && (s = i ? r(e, n, i, o) : r(e)),
void 0 !== s)
return s;
if (!isObject$9(e))
return e;
var u = isArray$b(e);
if (u) {
if (s = initCloneArray(e),
!a)
return copyArray$3(e, s)
} else {
var d = getTag$4(e)
, p = d == funcTag$2 || d == genTag$1;
if (isBuffer$4(e))
return cloneBuffer$2(e, a);
if (d == objectTag$5 || d == argsTag$3 || p && !i) {
if (s = l || p ? {} : initCloneObject$2(e),
!a)
return l ? copySymbolsIn(e, baseAssignIn(s, e)) :
copySymbols(e, baseAssign(s, e))
} else {
if (!cloneableTags[d])
return i ? e : {};
s = initCloneByTag(e, d, a)
}
}
o || (o = new Stack$2);
var h = o.get(e);
if (h)
return h;
o.set(e, s),
isSet(e) ? e.forEach((function(n) {
s.add(baseClone$3(n, t, r, n, e, o))
}
)) : isMap(e) && e.forEach((function(n, i) {
s.set(i, baseClone$3(n, t, r, i, e, o))
}
));
var f = u ? void 0 : (c ? l ? getAllKeysIn$1 : getAllKeys$1 : l ?
keysIn$3 : keys$3)(e);
return arrayEach$2(f || e, (function(n, i) {
f && (n = e[i = n]),
assignValue$3(s, i, baseClone$3(n, t, r, i, e, o))
}
)),
s
}
cloneableTags[argsTag$3] = cloneableTags[arrayTag$2] =
cloneableTags[arrayBufferTag$2] = cloneableTags[dataViewTag$3] =
cloneableTags[boolTag$3] = cloneableTags[dateTag$3] = cloneableTags[float32Tag$1] =
cloneableTags[float64Tag$1] = cloneableTags[int8Tag$1] = cloneableTags[int16Tag$1]
= cloneableTags[int32Tag$1] = cloneableTags[mapTag$4] = cloneableTags[numberTag$3]
= cloneableTags[objectTag$5] = cloneableTags[regexpTag$3] = cloneableTags[setTag$4]
= cloneableTags[stringTag$3] = cloneableTags[symbolTag$2] =
cloneableTags[uint8Tag$1] = cloneableTags[uint8ClampedTag$1] =
cloneableTags[uint16Tag$1] = cloneableTags[uint32Tag$1] = !0,
cloneableTags[errorTag$2] = cloneableTags[funcTag$2] =
cloneableTags[weakMapTag$2] = !1;
var _baseClone = baseClone$3
, baseClone$2 = _baseClone
, CLONE_DEEP_FLAG$2 = 1
, CLONE_SYMBOLS_FLAG$2 = 4;
function cloneDeep$2(e) {
return baseClone$2(e, CLONE_DEEP_FLAG$2 | CLONE_SYMBOLS_FLAG$2)
}
var cloneDeep_1 = cloneDeep$2;
const cloneDeep$3 = getDefaultExportFromCjs(cloneDeep_1);
var _dec$3, _dec2$3, _dec3$3, _dec4$3, _dec5$3, _dec6$2, _dec7$2, _dec8$2,
_dec9$2, _dec10$2, _dec11$2, _dec12$2, _dec13$2, _dec14$2, _dec15$1, _dec16$1,
_dec17$1, _dec18$1, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _dec25, _dec26,
_dec27, _dec28, _dec29, _dec30, _dec31, _dec32, _dec33, _class$5;
function _applyDecoratedDescriptor$5(e, t, r, n, i) {
var o = {};
return Object.keys(n).forEach((function(e) {
o[e] = n[e]
}
)),
o.enumerable = !!o.enumerable,
o.configurable = !!o.configurable,
("value"in o || o.initializer) && (o.writable = !0),
o = r.slice().reverse().reduce((function(r, n) {
return n(e, t, r) || r
}
), o),
i && void 0 !== o.initializer && (o.value = o.initializer ?
o.initializer.call(i) : void 0,
o.initializer = void 0),
void 0 === o.initializer ? (Object.defineProperty(e, t, o),
null) : o
}
let Store = (_dec$3 = bindSelf,
_dec2$3 = bindSelf,
_dec3$3 = bindSelf,
_dec4$3 = bindSelf,
_dec5$3 = bindSelf,
_dec6$2 = bindSelf,
_dec7$2 = bindSelf,
_dec8$2 = bindSelf,
_dec9$2 = bindSelf,
_dec10$2 = bindSelf,
_dec11$2 = bindSelf,
_dec12$2 = bindSelf,
_dec13$2 = bindSelf,
_dec14$2 = bindSelf,
_dec15$1 = bindSelf,
_dec16$1 = bindSelf,
_dec17$1 = bindSelf,
_dec18$1 = bindSelf,
_dec19 = bindSelf,
_dec20 = bindSelf,
_dec21 = bindSelf,
_dec22 = bindSelf,
_dec23 = bindSelf,
_dec24 = bindSelf,
_dec25 = bindSelf,
_dec26 = bindSelf,
_dec27 = bindSelf,
_dec28 = bindSelf,
_dec29 = bindSelf,
_dec30 = bindSelf,
_dec31 = bindSelf,
_dec32 = bindSelf,
_dec33 = bindSelf,
_class$5 = class {
constructor() {
this.block = null,
this.onControlChangeEnd = void 0,
this.onControlChangeStart = void 0,
this.triggerCurrentTime = void 0,
this.onEachSourceProgress = void 0,
this.triggerRecordSelectElements = void 0,
this.movieId = "movieId",
this.workerPath = "",
this.currentTime = 0,
this._startPlayTime = 0,
this.times = null,
this.controlModeType = "editElement",
this.bodyContainer = void 0,
this.captionContainer = void 0,
this.onPause = null,
this.data = void 0,
this.events = void 0,
this.record = void 0,
this.resourceManage = void 0,
this.movieSize = {
width: 0,
height: 0
},
this.app = void 0,
this.playing = !1,
this.env = "editor",
this.groups = [],
this.zIndexObjects = {},
this.cacheControlElementIds = [],
this._totalTime = 0,
this.usedMediaInfo = {},
this.elementReadyMark = {},
this.renderAsyncMark = {},
this._hideLockData = {},
this.controlElements = []
}
get hideLockData() {
return this._hideLockData
}
getPixiContainerById(e) {
const t = [];
return
[...this.captionContainer.children, ...this.bodyContainer.children].forEach((r => {
r.children.forEach((r => {
e.includes(r.name) && t.push(r)
}
))
}
)),
t
}
pixiContainerToImageById(e) {
const [t] = this.getPixiContainerById([e]);
return t ? this.app.renderer.extract.image(t) : null
}
updateGroup() {
const e = groupByTrackIndex(this.data.elements);
this.groups = e,
this.zIndexObjects = {},
e.forEach(( (e, t) => {
const r = e[0].trackIndex
, n = this.getHideLock(r);
n ? this.setHideLock({
...n,
trackIndex: r
}) : this.setHideLock({
trackIndex: r
}),
e.forEach((e => {
this.zIndexObjects[e.id] = config$2.MAX_TRACKINDEX - t
}
))
}
))
}
initHideLock(e) {
this._hideLockData = e
}
getHideLock(e) {
return this._hideLockData[e] || {
hide: !1,
lock: !1
}
}
changeControlMode(e, t) {
this.controlModeType = e;
let r = null;
if ("editElement" === e)
r = document.querySelector(`[data-elementid="${t}"]`);
else {
if ("editMask" !== e)
return;
r = document.querySelector(`[data-maskid="${t}"]`)
}
r ? this.updateControl("trigger", [r]) :
this.updateControl("trigger", [])
}
getFrameItem(e) {
const t = e.frames || [];
for (const r of t)
if (Math.abs(this.currentTime - (r.startTime + e.startTime))
< .1)
return r;
return null
}
asyncFrameAnimateStatus(e, t) {
if (e && t) {
const {x: r, y: n, width: i, height: o, alpha: s, rotation:
a=0, intensity: l, volume: c, maskX: u, maskY: d, maskBlur: p, maskHeight: h,
maskRotation: f, maskAlpha: m, maskWidth: g, textScale: y, textColor: v,
textBgColor: b, textBorderColor: x, textGradientStops: _} = t
, E = e;
void 0 !== r && (E.style.x = r),
void 0 !== n && (E.style.y = n),
void 0 !== i && (E.style.width = i),
void 0 !== o && (E.style.height = o),
void 0 !== s && (E.style.alpha = s),
void 0 !== a && (E.style.rotation = a),
void 0 !== l && (e.intensity = l),
void 0 !== c && (e.volume = c),
void 0 !== y && (e.textScale = y),
void 0 !== v && (e.textStyle.fill = v),
void 0 !== _ && (e.textStyle.fillGradientStops = _),
void 0 !== x && (e.textStyle.stroke = x),
void 0 !== b && (e.textStyle.textBgColor = b),
E.mask && (void 0 !== u && (E.mask.x = u),
void 0 !== d && (E.mask.y = d),
void 0 !== h && (E.mask.height = h),
void 0 !== g && (E.mask.width = g),
void 0 !== p && (E.mask.blur = p),
void 0 !== f && (E.mask.rotation = f || 0),
E.mask.alpha = void 0 !== m ? m : 1)
}
}
getFrameKeys(e) {
const t = [];
return e.frames && e.frames.forEach((e => {
t.push(...Object.keys(e))
}
)),
[...new Set(t)].filter((e => !["id", "startTime"].includes(e)))
}
getFrameStatusByCurrentTime(e, t) {
const {startTime: r, duration: n} = e
, i = e.speed || 1;
void 0 === t && (t = this.currentTime);
const o = t >= r && t <= n / i + r ? (t - r) * i : null;
return this.getFrameStatus(e, o)
}
getFrameStatus(e, t) {
if (null === t)
return null;
if (e.frames && e.frames.length > 0) {
const r = [{
...e.frames[0],
startTime: 0,
id: "start"
}, ...e.frames, {
...e.frames[e.frames.length - 1],
startTime: e.duration,
id: "end"
}];
for (let e = 1; e < r.length; e++) {
if (r[e].startTime >= t) {
const n = r[e - 1]
, i = r[e]
, o = Object.keys(Object.assign({
...n
}, {
...i
})).filter((e => "id" !== e && "startTime" !== e))
, s = {
id: n.id + "_" + i.id,
startTime: t
};
for (let e of o) {
if (i.startTime === n.startTime)
return Object.assign({
...n
}, {
...s
});
const r = (t - n.startTime) / (i.startTime -
n.startTime);
"alpha" === e && (void 0 === n[e] && (n[e] = 1),
void 0 === i[e] && (i[e] = 1));
let o = n[e] || 0
, a = i[e] || 0;
s[e] = (a - o) * r + o
}
return s
}
}
return null
}
return null
}
setHideLock(e, t) {
let r = !1;
this._hideLockData[e.trackIndex] || (r = !0),
r ? this._hideLockData[e.trackIndex] = {
hide: e.hide,
lock: e.lock
} : (void 0 !== e.hide && (this._hideLockData[e.trackIndex].hide =
e.hide),
void 0 !== e.lock && (this._hideLockData[e.trackIndex].lock =
e.lock)),
t && pubsub.publish(this.events.UPDATE_MOVIE)
}
removeTrackMedias(e, t) {
this.resourceManage.removeTrackMedias(e, t)
}
checkSupportTransition(e) {
const t = groupByTrackIndex(this.data.elements);
let r = !1;
return t.forEach((t => {
t.forEach(( (n, i) => {
if (n.id === e) {
const e = t[i + 1];
e && n.startTime + n.duration === e.startTime && (r = !
0)
}
}
))
}
)),
r
}
removeInvalidTransition() {
const e = groupByTrackIndex(this.data.elements)
, t = this.data.transitions;
e.forEach((e => {
e.forEach(( (r, n) => {
const i = e[n + 1]
, o = t.findIndex((e => e.startElementId === r.id));
(-1 !== o && i && r.startTime + r.duration !== i.startTime
|| -1 !== o && !i) && t.splice(o, 1)
}
))
}
))
}
play() {
this._totalTime = this.getTotalTime(),
this.playing = !0,
this._startPlayTime = performance.now() - 1e3 * this.currentTime,
this.runAnimate()
}
pause() {
this.onPause && this.onPause(),
this.playing = !1;
for (const e in this.resourceManage.trackMedias) {
const t = this.resourceManage.trackMedias[e].target;
t.paused || t.pause()
}
}
sortZIndexNewData() {
const e = toJS(this.data);
e.elements.sort(( (e, t) => e.trackIndex - t.trackIndex));
return groupByTrackIndex(e.elements).forEach(( (e, t) => {
e.forEach((e => {
e.trackIndex = t + 1
}
))
}
)),
e
}
step(e) {
this.pause(),
this.triggerCurrentTime && this.triggerCurrentTime(e)
}
runAnimate() {
const e = (performance.now() - this._startPlayTime) / 1e3;
e >= this._totalTime ? this.pause() : (e - this.currentTime >= 1 /
config$2.fps && this.triggerCurrentTime && this.triggerCurrentTime(e),
this.playing && requestAnimationFrame(this.runAnimate.bind(this)))
}
updateControl(e, t) {
if ("editor" === this.env)
switch (e) {
case "updateTarget":
pubsub.publish(this.events.UPDATE_CONTROL_TARGET);
break;
case "updateList":
pubsub.publish(this.events.UPDATE_CONTROL_LIST);
break;
case "trigger":
pubsub.publish(this.events.TRIGGER_CONTROL, t);
break;
case "triggerNoCallback":
pubsub.publish(this.events.TRIGGER_CONTROL_NO_CALLBACK, t);
break;
case "visible":
pubsub.publish(this.events.VISIBLE_CONTROL, t);
break;
case "stopGroupDrag":
pubsub.publish(this.events.STOP_GROUP_DRAG, t)
}
}
updateSortTracks() {
pubsub.publish(this.events.SORT_CONTAINER)
}
getTotalTime() {
return getTotalTime(this.data)
}
getElementDataByIds(e) {
return getElementsByIds(e, this.data.elements) ||
getElementsByIds(e, this.data.captions) || getElementsByIds(e,
this.data.transitions)
}
getElementDataByTypes(e, t) {
return getElementDataByTypes(e, t || this.data)
}
getCloneData() {
const e = toJS(this.data);
return e.elements.sort(( (e, t) => e.trackIndex -
t.trackIndex)).forEach(( (e, t) => {
e.trackIndex = t + 1
}
)),
e
}
async addResource(e, t) {
let r = this.data.resouces.find((t => t.url === e));
if (r)
return r;
{
await this.resourceManage.fetchBlob(e);
const r = {
id: createID(),
name: "mask_image",
type: "image",
url: e,
mustFetch: !0,
fileType: getFileTypeFromFileName(e) || "unknown",
from: "system",
styleSize: t
};
return this.data.resouces.push(r),
r
}
}
async addElementByResource(e, t) {
const r = this.data;
let n = r.resouces.find((t => t.url === e.url));
n || (n = cloneDeep$3(e),
r.resouces.push(n));
const {elementType: i, time: o, duration: s} = t;
let a, l = t.trackIndex;
if (void 0 === l) {
l = getInsertTrackIndex(((this.groups[0] || [])[0] || {
trackIndex: 1
}).trackIndex, "auto", r, t)
} else if (l <= 0)
throw new Error("trackIndex 不能是 0 或者小于 0 的数");
switch (i) {
case "image":
{
"image" === n.type && await
this.resourceManage.fetchBlob(n.url);
const e = calcSizeAndPosition(n.styleSize, {
width: r.width,
height: r.height
});
a = {
id: createID(),
name: n.name,
_dirty: "1",
type: i,
trackIndex: l,
resourceId: n.id,
startTime: o,
duration: s || 5,
blendMode: 0,
style: {
...e
},
flipx: !1
}
}
break;
case "lottie":
{
"lottie" === n.type && await
this.resourceManage.fetchBlob(n.url);
const e = calcSizeAndPosition(n.styleSize, {
width: r.width,
height: r.height
});
a = {
id: createID(),
name: n.name,
_dirty: "1",
type: i,
trackIndex: l,
resourceId: n.id,
startTime: o,
duration: s || 5,
blendMode: 0,
style: {
...e
},
lottieSpeed: 1,
initStartFrame: 0,
flipx: !1
}
}
break;
case "video":
{
"video" === n.type && await mediaLazy(n.url).then((e => {
this.resourceManage.medias[n.url] = e
}
));
const e = calcSizeAndPosition(n.styleSize, {
width: r.width,
height: r.height
});
a = {
id: createID(),
name: n.name,
_dirty: "1",
type: i,
trackIndex: l,
resourceId: n.id,
startTime: o,
matting: {
enabled: !1,
color: "#008000",
filterType: 0,
lightLevel: .2,
gridSize: .8
},
duration: s || 5,
muted: !1,
volume: 1,
speed: 1,
clipTime: 0,
blendMode: 0,
style: {
...e
},
flipx: !1
}
}
break;
case "audio":
["audio", "video"].includes(n.type) && await
mediaLazy(n.url).then((e => {
this.resourceManage.medias[n.url] = e
}
)),
a = {
id: createID(),
name: n.name,
_dirty: "1",
_noControl: !0,
type: i,
trackIndex: l,
resourceId: n.id,
startTime: o,
duration: s || 10,
muted: !1,
volume: 1,
speed: 1,
clipTime: 0,
fadeInTime: 0,
fadeOutTime: 0
};
break;
case "filter":
"image" === n.type && await
this.resourceManage.fetchBlob(n.url),
a = {
id: createID(),
name: n.name,
_dirty: "1",
_noControl: !0,
type: i,
trackIndex: l,
resourceId: n.id,
startTime: o,
duration: s || 5,
intensity: 1
};
break;
default:
throw new Error("元素类型还没做" + i)
}
return r.elements.push(a),
r.elements.sort(( (e, t) => e.trackIndex - t.trackIndex)),
pubsub.publish(this.events.SORT_CONTAINER),
a
}
async addElementNoSource(e, t) {
const {elementType: r, time: n, duration: i} = t;
let o, s = t.trackIndex;
if (void 0 === s) {
s = getInsertTrackIndex(((this.groups[0] || [])[0] || {
trackIndex: 1
}).trackIndex, "up", this.data)
} else if (s <= 0)
throw new Error("trackIndex 不能是 0 或者小于 0 的数");
switch (t.elementType) {
case "text":
case "caption":
o = {
id: createID(),
name: e.text.slice(0, 20),
text: e.text,
textStyle: {
fontSize: 48,
fill: "#fff",
align: "center",
fontFamily: "",
letterSpacing: 0,
strokeThickness: 6,
...e.attrs,
lineHeight: 0
},
style: {
x: this.data.width / 2,
y: this.data.height / 2
},
_dirty: "1",
type: r,
trackIndex: s,
startTime: n,
duration: i || 5
};
break;
case "effect":
o = {
id: createID(),
name: e.name,
effects: toJS(e.attrs),
_dirty: "1",
_noControl: !0,
type: r,
trackIndex: s,
startTime: n,
duration: i || 5
};
break;
default:
throw Error("暂无此类型元素的添加方法 addElementNoSource:" + t)
}
return t.onlyGetJSON || (this.data.elements.push(o),
this.data.elements.sort(( (e, t) => e.trackIndex - t.trackIndex)),
pubsub.publish(this.events.SORT_CONTAINER)),
o
}
async update(e) {
if ("export" === this.env && void 0 !== e && (this.currentTime =
e),
pubsub.publish(this.events.UPDATE_MOVIE),
"export" === this.env)
for (; ; ) {
for (let e in this.renderAsyncMark)
"success" === this.renderAsyncMark[e] && delete
this.renderAsyncMark[e];
if (0 === Object.values(this.renderAsyncMark).length)
break;
await sleep(8)
}
"editor" === this.env &&
pubsub.publish(this.events.UPDATE_CONTROL_TARGET)
}
capture() {
var e;
const t = null == (e = this.app) ? void 0 : e.view;
return t ? t.toDataURL("image/png") : ""
}
controlChangeStart(e) {
e.forEach((t => {
pubsub.publish(this.events.CONTROL_CHANGE_START + "." + t, e)
}
)),
this.onControlChangeStart && this.onControlChangeStart(e)
}
controlChangeEnd(e) {
var t;
e.forEach((t => {
pubsub.publish(this.events.CONTROL_CHANGE_END + "." + t, e)
}
));
const r = [...getAllElements(null,
this.data), ...this.data.cameras, ...this.data.captions]
, n = [];
r.forEach((t => {
e.includes(t.id) && n.push(t)
}
)),
null == (t = this.record) || t.add({
desc: "控制器修改元素",
type: "elements_update",
selecteds: [...e],
data: n
}),
this.onControlChangeEnd && this.onControlChangeEnd(e)
}
destroy() {
this.resourceManage.clearTempData(),
this.resourceManage.destroy(),
this.groups = [],
this.data = null,
this.app = null
}
}
,
_applyDecoratedDescriptor$5(_class$5.prototype, "getPixiContainerById",
[_dec$3], Object.getOwnPropertyDescriptor(_class$5.prototype,
"getPixiContainerById"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "pixiContainerToImageById",
[_dec2$3], Object.getOwnPropertyDescriptor(_class$5.prototype,
"pixiContainerToImageById"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "updateGroup", [_dec3$3],
Object.getOwnPropertyDescriptor(_class$5.prototype, "updateGroup"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "initHideLock", [_dec4$3],
Object.getOwnPropertyDescriptor(_class$5.prototype, "initHideLock"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "getHideLock", [_dec5$3],
Object.getOwnPropertyDescriptor(_class$5.prototype, "getHideLock"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "changeControlMode",
[_dec6$2], Object.getOwnPropertyDescriptor(_class$5.prototype,
"changeControlMode"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "getFrameItem", [_dec7$2],
Object.getOwnPropertyDescriptor(_class$5.prototype, "getFrameItem"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "asyncFrameAnimateStatus",
[_dec8$2], Object.getOwnPropertyDescriptor(_class$5.prototype,
"asyncFrameAnimateStatus"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "getFrameKeys", [_dec9$2],
Object.getOwnPropertyDescriptor(_class$5.prototype, "getFrameKeys"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype,
"getFrameStatusByCurrentTime", [_dec10$2],
Object.getOwnPropertyDescriptor(_class$5.prototype, "getFrameStatusByCurrentTime"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "getFrameStatus",
[_dec11$2], Object.getOwnPropertyDescriptor(_class$5.prototype, "getFrameStatus"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "setHideLock", [_dec12$2],
Object.getOwnPropertyDescriptor(_class$5.prototype, "setHideLock"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "checkSupportTransition",
[_dec13$2], Object.getOwnPropertyDescriptor(_class$5.prototype,
"checkSupportTransition"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "removeInvalidTransition",
[_dec14$2], Object.getOwnPropertyDescriptor(_class$5.prototype,
"removeInvalidTransition"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "play", [_dec15$1],
Object.getOwnPropertyDescriptor(_class$5.prototype, "play"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "pause", [_dec16$1],
Object.getOwnPropertyDescriptor(_class$5.prototype, "pause"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "sortZIndexNewData",
[_dec17$1], Object.getOwnPropertyDescriptor(_class$5.prototype,
"sortZIndexNewData"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "step", [_dec18$1],
Object.getOwnPropertyDescriptor(_class$5.prototype, "step"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "runAnimate", [_dec19],
Object.getOwnPropertyDescriptor(_class$5.prototype, "runAnimate"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "updateControl", [_dec20],
Object.getOwnPropertyDescriptor(_class$5.prototype, "updateControl"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "updateSortTracks",
[_dec21], Object.getOwnPropertyDescriptor(_class$5.prototype, "updateSortTracks"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "getTotalTime", [_dec22],
Object.getOwnPropertyDescriptor(_class$5.prototype, "getTotalTime"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "getElementDataByIds",
[_dec23], Object.getOwnPropertyDescriptor(_class$5.prototype,
"getElementDataByIds"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "getElementDataByTypes",
[_dec24], Object.getOwnPropertyDescriptor(_class$5.prototype,
"getElementDataByTypes"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "getCloneData", [_dec25],
Object.getOwnPropertyDescriptor(_class$5.prototype, "getCloneData"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "addResource", [_dec26],
Object.getOwnPropertyDescriptor(_class$5.prototype, "addResource"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "addElementByResource",
[_dec27], Object.getOwnPropertyDescriptor(_class$5.prototype,
"addElementByResource"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "addElementNoSource",
[_dec28], Object.getOwnPropertyDescriptor(_class$5.prototype,
"addElementNoSource"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "update", [_dec29],
Object.getOwnPropertyDescriptor(_class$5.prototype, "update"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "capture", [_dec30],
Object.getOwnPropertyDescriptor(_class$5.prototype, "capture"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "controlChangeStart",
[_dec31], Object.getOwnPropertyDescriptor(_class$5.prototype,
"controlChangeStart"), _class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "controlChangeEnd",
[_dec32], Object.getOwnPropertyDescriptor(_class$5.prototype, "controlChangeEnd"),
_class$5.prototype),
_applyDecoratedDescriptor$5(_class$5.prototype, "destroy", [_dec33],
Object.getOwnPropertyDescriptor(_class$5.prototype, "destroy"),
_class$5.prototype),
_class$5);
var FUNCTION = "function"
, OBJECT = "object"
, STRING = "string"
, NUMBER = "number"
, UNDEFINED = "undefined"
, IS_WINDOW = typeof window !== UNDEFINED
, doc = typeof document !== UNDEFINED && document
, OPEN_CLOSED_CHARACTERS = [{
open: "(",
close: ")"
}, {
open: '"',
close: '"'
}, {
open: "'",
close: "'"
}, {
open: '\\"',
close: '\\"'
}, {
open: "\\'",
close: "\\'"
}]
, TINY_NUM$1 = 1e-7
, DEFAULT_UNIT_PRESETS = {
cm: function(e) {
return 96 * e / 2.54
},
mm: function(e) {
return 96 * e / 254
},
in: function(e) {
return 96 * e
},
pt: function(e) {
return 96 * e / 72
},
pc: function(e) {
return 96 * e / 6
},
"%": function(e, t) {
return e * t / 100
},
vw: function(e, t) {
return void 0 === t && (t = window.innerWidth),
e / 100 * t
},
vh: function(e, t) {
return void 0 === t && (t = window.innerHeight),
e / 100 * t
},
vmax: function(e, t) {
return void 0 === t && (t = Math.max(window.innerWidth,
window.innerHeight)),
e / 100 * t
},
vmin: function(e, t) {
return void 0 === t && (t = Math.min(window.innerWidth,
window.innerHeight)),
e / 100 * t
}
};
/*!
*****************************************************************************
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.
*****************************************************************************
*/
function __spreadArrays$2() {
for (var e = 0, t = 0, r = arguments.length; t < r; t++)
e += arguments[t].length;
var n = Array(e)
, i = 0;
for (t = 0; t < r; t++)
for (var o = arguments[t], s = 0, a = o.length; s < a; s++,
i++)
n[i] = o[s];
return n
}
function dot$1(e, t, r, n) {
return (e * n + t * r) / (r + n)
}
function isUndefined$3(e) {
return typeof e === UNDEFINED
}
function isObject$8(e) {
return e && typeof e === OBJECT
}
function isArray$a(e) {
return Array.isArray(e)
}
function isString$3(e) {
return typeof e === STRING
}
function isNumber$4(e) {
return typeof e === NUMBER
}
function isFunction$4(e) {
return typeof e === FUNCTION
}
function isEqualSeparator(e, t) {
return ("" === t || " " == t) && ("" === e || " " == e) || e === t
}
function findOpen(e, t, r, n, i) {
return findIgnore(e, t, r) ? r : findClose(e, t, r + 1, n, i)
}
function findIgnore(e, t, r) {
if (!e.ignore)
return null;
var n = t.slice(Math.max(r - 3, 0), r + 3).join("");
return new RegExp(e.ignore).exec(n)
}
function findClose(e, t, r, n, i) {
for (var o, s = function(r) {
var s = t[r].trim();
if (s === e.close && !findIgnore(e, t, r))
return {
value: r
};
var a = r
, l = find$2(i, (function(e) {
return e.open === s
}
));
if (l && (a = findOpen(l, t, r, n, i)),
-1 === a)
return o = r,
"break";
o = r = a
}, a = r; a < n; ++a) {
var l = s(a);
if (a = o,
"object" == typeof l)
return l.value;
if ("break" === l)
break
}
return -1
}
function splitText(e, t) {
var r = isString$3(t) ? {
separator: t
} : t
, n = r.separator
, i = void 0 === n ? "," : n
, o = r.isSeparateFirst
, s = r.isSeparateOnlyOpenClose
, a = r.isSeparateOpenClose
, l = void 0 === a ? s : a
, c = r.openCloseCharacters
, u = void 0 === c ? OPEN_CLOSED_CHARACTERS : c
, d = u.map((function(e) {
var t = e.open
, r = e.close;
return t === r ? t : t + "|" + r
}
)).join("|")
, p = new RegExp("(\\s*" + i + "\\s*|" + d + "|\\s+)","g")
, h = e.split(p).filter((function(e) {
return e && "undefined" !== e
}
))
, f = h.length
, m = []
, g = [];
function y() {
return !!g.length && (m.push(g.join("")),
g = [],
!0)
}
for (var v, b = function(t) {
var r = h[t].trim()
, n = t
, a = find$2(u, (function(e) {
return e.open === r
}
))
, c = find$2(u, (function(e) {
return e.close === r
}
));
if (a) {
if (-1 !== (n = findOpen(a, h, t, f, u)) && l)
return y() && o ? (v = t,
"break") : (m.push(h.slice(t, n + 1).join("")),
t = n,
o ? (v = t,
"break") : (v = t,
"continue"))
} else {
if (c && !findIgnore(c, h, t)) {
var d = __spreadArrays$2(u);
return d.splice(u.indexOf(c), 1),
{
value: splitText(e, {
separator: i,
isSeparateFirst: o,
isSeparateOnlyOpenClose: s,
isSeparateOpenClose: l,
openCloseCharacters: d
})
}
}
if (isEqualSeparator(r, i) && !s)
return y(),
o ? (v = t,
"break") : (v = t,
"continue")
}
-1 === n && (n = f - 1),
g.push(h.slice(t, n + 1).join("")),
v = t = n
}, x = 0; x < f; ++x) {
var _ = b(x);
if (x = v,
"object" == typeof _)
return _.value;
if ("break" === _)
break
}
return g.length && m.push(g.join("")),
m
}
function splitSpace(e) {
return splitText(e, "")
}
function splitComma(e) {
return splitText(e, ",")
}
function splitBracket(e) {
var t = /([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);
return !t || t.length < 4 ? {} : {
prefix: t[1],
value: t[2],
suffix: t[3]
}
}
function splitUnit(e) {
var t = /^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);
if (!t)
return {
prefix: "",
unit: "",
value: NaN
};
var r = t[1]
, n = t[2];
return {
prefix: r,
unit: t[3],
value: parseFloat(n)
}
}
function camelize(e) {
return e.replace(/[\s-_]+([^\s-_])/g, (function(e, t) {
return t.toUpperCase()
}
))
}
function decamelize(e, t) {
return void 0 === t && (t = "-"),
e.replace(/([a-z])([A-Z])/g, (function(e, r, n) {
return "" + r + t + n.toLowerCase()
}
))
}
function now$4() {
return Date.now ? Date.now() : (new Date).getTime()
}
function findIndex$3(e, t, r) {
void 0 === r && (r = -1);
for (var n = e.length, i = 0; i < n; ++i)
if (t(e[i], i, e))
return i;
return r
}
function find$2(e, t, r) {
var n = findIndex$3(e, t);
return n > -1 ? e[n] : r
}
var requestAnimationFrame$1 = function() {
var e = now$4()
, t = IS_WINDOW && (window.requestAnimationFrame ||
window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
window.msRequestAnimationFrame);
return t ? t.bind(window) : function(t) {
var r = now$4();
return setTimeout((function() {
t(r - e)
}
), 1e3 / 60)
}
}()
, cancelAnimationFrame$1 = function() {
var e = IS_WINDOW && (window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame ||
window.msCancelAnimationFrame);
return e ? e.bind(window) : function(e) {
clearTimeout(e)
}
}();
function getKeys(e) {
return Object.keys(e)
}
function convertUnitSize(e, t) {
var r = splitUnit(e)
, n = r.value
, i = r.unit;
if (isObject$8(t)) {
var o = t[i];
if (o) {
if (isFunction$4(o))
return o(n);
if (DEFAULT_UNIT_PRESETS[i])
return DEFAULT_UNIT_PRESETS[i](n, o)
}
} else if ("%" === i)
return n * t / 100;
return DEFAULT_UNIT_PRESETS[i] ? DEFAULT_UNIT_PRESETS[i](n) : n
}
function between(e, t, r) {
return Math.max(t, Math.min(e, r))
}
function checkBoundSize(e, t, r, n) {
return void 0 === n && (n = e[0] / e[1]),
[[throttle$4(t[0], TINY_NUM$1), throttle$4(t[0] / n, TINY_NUM$1)],
[throttle$4(t[1] * n, TINY_NUM$1), throttle$4(t[1],
TINY_NUM$1)]].filter((function(e) {
return e.every((function(e, n) {
var i = t[n]
, o = throttle$4(i, TINY_NUM$1);
return r ? e <= i || e <= o : e >= i || e >= o
}
))
}
))[0] || e
}
function calculateBoundSize(e, t, r, n) {
if (!n)
return e.map((function(e, n) {
return between(e, t[n], r[n])
}
));
var i = e[0]
, o = e[1]
, s = !0 === n ? i / o : n
, a = checkBoundSize(e, t, !1, s)
, l = a[0]
, c = a[1]
, u = checkBoundSize(e, r, !0, s)
, d = u[0]
, p = u[1];
return i < l || o < c ? (i = l,
o = c) : (i > d || o > p) && (i = d,
o = p),
[i, o]
}
function sum(e) {
for (var t = 0, r = e.length - 1; r >= 0; --r)
t += e[r];
return t
}
function average(e) {
for (var t = e.length, r = 0, n = t - 1; n >= 0; --n)
r += e[n];
return t ? r / t : 0
}
function getRad$1(e, t) {
var r = t[0] - e[0]
, n = t[1] - e[1]
, i = Math.atan2(n, r);
return i >= 0 ? i : i + 2 * Math.PI
}
function getCenterPoint(e) {
return [0, 1].map((function(t) {
return average(e.map((function(e) {
return e[t]
}
)))
}
))
}
function getShapeDirection(e) {
var t = getCenterPoint(e)
, r = getRad$1(t, e[0])
, n = getRad$1(t, e[1]);
return r < n && n - r < Math.PI || r > n && n - r < -Math.PI ? 1 : -1
}
function getDist$2(e, t) {
return Math.sqrt(Math.pow((t ? t[0] : 0) - e[0], 2) + Math.pow((t ?
t[1] : 0) - e[1], 2))
}
function throttle$4(e, t) {
if (!t)
return e;
var r = 1 / t;
return Math.round(e / t) / r
}
function throttleArray(e, t) {
return e.forEach((function(r, n) {
e[n] = throttle$4(e[n], t)
}
)),
e
}
function counter(e) {
for (var t = [], r = 0; r < e; ++r)
t.push(r);
return t
}
function hasClass$1(e, t) {
return e.classList ? e.classList.contains(t) : !!e.className.match(new
RegExp("(\\s|^)" + t + "(\\s|$)"))
}
function addClass$1(e, t) {
e.classList ? e.classList.add(t) : e.className += " " + t
}
function removeClass$1(e, t) {
if (e.classList)
e.classList.remove(t);
else {
var r = new RegExp("(\\s|^)" + t + "(\\s|$)");
e.className = e.className.replace(r, " ")
}
}
function addEvent(e, t, r, n) {
e.addEventListener(t, r, n)
}
function removeEvent(e, t, r, n) {
e.removeEventListener(t, r, n)
}
function getDocument(e) {
return (null == e ? void 0 : e.ownerDocument) || doc
}
function getDocumentElement(e) {
return getDocument(e).documentElement
}
function getDocumentBody(e) {
return getDocument(e).body
}
function getWindow$1(e) {
var t;
return (null === (t = null == e ? void 0 : e.ownerDocument) || void 0
=== t ? void 0 : t.defaultView) || window
}
function isWindow$1(e) {
return e && "postMessage"in e && "blur"in e && "self"in e
}
function isNode$1(e) {
return isObject$8(e) && e.nodeName && e.nodeType && "ownerDocument"in e
}
/*!
*****************************************************************************
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 __assign$9 = function() {
return __assign$9 = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$9.apply(this, arguments)
};
function __spreadArrays$1() {
for (var e = 0, t = 0, r = arguments.length; t < r; t++)
e += arguments[t].length;
var n = Array(e)
, i = 0;
for (t = 0; t < r; t++)
for (var o = arguments[t], s = 0, a = o.length; s < a; s++,
i++)
n[i] = o[s];
return n
}
var EventEmitter = function() {
function e() {
this._events = {}
}
var t = e.prototype;
return t.on = function(e, t) {
if (isObject$8(e))
for (var r in e)
this.on(r, e[r]);
else
this._addEvent(e, t, {});
return this
}
,
t.off = function(e, t) {
if (e)
if (isObject$8(e))
for (var r in e)
this.off(r);
else if (t) {
var n = this._events[e];
if (n) {
var i = findIndex$3(n, (function(e) {
return e.listener === t
}
));
i > -1 && n.splice(i, 1)
}
} else
this._events[e] = [];
else
this._events = {};
return this
}
,
t.once = function(e, t) {
var r = this;
return t && this._addEvent(e, t, {
once: !0
}),
new Promise((function(t) {
r._addEvent(e, t, {
once: !0
})
}
))
}
,
t.emit = function(e, t) {
var r = this;
void 0 === t && (t = {});
var n = this._events[e];
if (!e || !n)
return !0;
var i = !1;
return t.eventType = e,
t.stop = function() {
i = !0
}
,
t.currentTarget = this,
__spreadArrays$1(n).forEach((function(n) {
n.listener(t),
n.once && r.off(e, n.listener)
}
)),
!i
}
,
t.trigger = function(e, t) {
return void 0 === t && (t = {}),
this.emit(e, t)
}
,
t._addEvent = function(e, t, r) {
var n = this._events;
n[e] = n[e] || [],
n[e].push(__assign$9({
listener: t
}, r))
}
,
e
}();
const EventEmitter$1 = EventEmitter;
/*!
*****************************************************************************
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 extendStatics$8 = function(e, t) {
return (extendStatics$8 = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(e, t) {
e.__proto__ = t
}
|| function(e, t) {
for (var r in t)
t.hasOwnProperty(r) && (e[r] = t[r])
}
)(e, t)
};
function __extends$8(e, t) {
function r() {
this.constructor = e
}
extendStatics$8(e, t),
e.prototype = null === t ? Object.create(t) : (r.prototype =
t.prototype,
new r)
}
var __assign$8 = function() {
return __assign$8 = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$8.apply(this, arguments)
};
function getRad(e, t) {
var r = t[0] - e[0]
, n = t[1] - e[1]
, i = Math.atan2(n, r);
return i >= 0 ? i : i + 2 * Math.PI
}
function getRotatiion(e) {
return getRad([e[0].clientX, e[0].clientY], [e[1].clientX,
e[1].clientY]) / Math.PI * 180
}
function isMultiTouch(e) {
return e.touches && e.touches.length >= 2
}
function getEventClients(e) {
return e ? e.touches ? getClients(e.touches) : [getClient$1(e)] : []
}
function isMouseEvent(e) {
return e && (e.type.indexOf("mouse") > -1 || "button"in e)
}
function getPosition$2(e, t, r) {
var n = r.length
, i = getAverageClient(e, n)
, o = i.clientX
, s = i.clientY
, a = i.originalClientX
, l = i.originalClientY
, c = getAverageClient(t, n)
, u = c.clientX
, d = c.clientY
, p = getAverageClient(r, n);
return {
clientX: a,
clientY: l,
deltaX: o - u,
deltaY: s - d,
distX: o - p.clientX,
distY: s - p.clientY
}
}
function getDist$1(e) {
return Math.sqrt(Math.pow(e[0].clientX - e[1].clientX, 2) +
Math.pow(e[0].clientY - e[1].clientY, 2))
}
function getClients(e) {
for (var t = Math.min(e.length, 2), r = [], n = 0; n < t; ++n)
r.push(getClient$1(e[n]));
return r
}
function getClient$1(e) {
return {
clientX: e.clientX,
clientY: e.clientY
}
}
function getAverageClient(e, t) {
void 0 === t && (t = e.length);
for (var r = {
clientX: 0,
clientY: 0,
originalClientX: 0,
originalClientY: 0
}, n = Math.min(e.length, t), i = 0; i < n; ++i) {
var o = e[i];
r.originalClientX += "originalClientX"in o ? o.originalClientX :
o.clientX,
r.originalClientY += "originalClientY"in o ? o.originalClientY :
o.clientY,
r.clientX += o.clientX,
r.clientY += o.clientY
}
return t ? {
clientX: r.clientX / t,
clientY: r.clientY / t,
originalClientX: r.originalClientX / t,
originalClientY: r.originalClientY / t
} : r
}
var ClientStore = function() {
function e(e) {
this.prevClients = [],
this.startClients = [],
this.movement = 0,
this.length = 0,
this.startClients = e,
this.prevClients = e,
this.length = e.length
}
return e.prototype.getAngle = function(e) {
return void 0 === e && (e = this.prevClients),
getRotatiion(e)
}
,
e.prototype.getRotation = function(e) {
return void 0 === e && (e = this.prevClients),
getRotatiion(e) - getRotatiion(this.startClients)
}
,
e.prototype.getPosition = function(e, t) {
void 0 === e && (e = this.prevClients);
var r = getPosition$2(e || this.prevClients, this.prevClients,
this.startClients)
, n = r.deltaX
, i = r.deltaY;
return this.movement += Math.sqrt(n * n + i * i),
this.prevClients = e,
r
}
,
e.prototype.getPositions = function(e) {
void 0 === e && (e = this.prevClients);
for (var t = this.prevClients, r = this.startClients, n =
Math.min(this.length, t.length), i = [], o = 0; o < n; ++o)
i[o] = getPosition$2([e[o]], [t[o]], [r[o]]);
return i
}
,
e.prototype.getMovement = function(e) {
var t = this.movement;
if (!e)
return t;
var r = getAverageClient(e, this.length)
, n = getAverageClient(this.prevClients, this.length)
, i = r.clientX - n.clientX
, o = r.clientY - n.clientY;
return Math.sqrt(i * i + o * o) + t
}
,
e.prototype.getDistance = function(e) {
return void 0 === e && (e = this.prevClients),
getDist$1(e)
}
,
e.prototype.getScale = function(e) {
return void 0 === e && (e = this.prevClients),
getDist$1(e) / getDist$1(this.startClients)
}
,
e.prototype.move = function(e, t) {
this.startClients.forEach((function(r) {
r.clientX -= e,
r.clientY -= t
}
)),
this.prevClients.forEach((function(r) {
r.clientX -= e,
r.clientY -= t
}
))
}
,
e
}()
, INPUT_TAGNAMES = ["textarea", "input"]
, Gesto = function(e) {
function t(t, r) {
void 0 === r && (r = {});
var n = e.call(this) || this;
n.options = {},
n.flag = !1,
n.pinchFlag = !1,
n.data = {},
n.isDrag = !1,
n.isPinch = !1,
n.clientStores = [],
n.targets = [],
n.prevTime = 0,
n.doubleFlag = !1,
n._useMouse = !1,
n._useTouch = !1,
n._useDrag = !1,
n._dragFlag = !1,
n._isTrusted = !1,
n._isMouseEvent = !1,
n._isSecondaryButton = !1,
n._preventMouseEvent = !1,
n._prevInputEvent = null,
n._isDragAPI = !1,
n._isIdle = !0,
n._preventMouseEventId = 0,
n._window = window,
n.onDragStart = function(e, t) {
if (void 0 === t && (t = !0),
n.flag || !1 !== e.cancelable) {
var r = e.type.indexOf("drag") >= -1;
if (!n.flag || !r) {
n._isDragAPI = !0;
var i = n.options
, o = i.container
, s = i.pinchOutside
, a = i.preventWheelClick
, l = i.preventRightClick
, c = i.preventDefault
, u = i.checkInput
, d = i.dragFocusedInput
, p = i.preventClickEventOnDragStart
, h = i.preventClickEventOnDrag
, f = i.preventClickEventByCondition
, m = n._useTouch
, g = !n.flag;
if (n._isSecondaryButton = 3 === e.which || 2 ===
e.button,
a && (2 === e.which || 1 === e.button) || l && (3 ===
e.which || 2 === e.button))
return n.stop(),
!1;
if (g) {
var y = n._window.document.activeElement
, v = e.target;
if (v) {
var b = v.tagName.toLowerCase()
, x = INPUT_TAGNAMES.indexOf(b) > -1
, _ = v.isContentEditable;
if (x || _) {
if (u || !d && y === v)
return !1;
if (y && (y === v || _ &&
y.isContentEditable && y.contains(v))) {
if (!d)
return !1;
v.blur()
}
} else if ((c || "touchstart" === e.type) && y)
{
var E = y.tagName.toLowerCase();
(y.isContentEditable ||
INPUT_TAGNAMES.indexOf(E) > -1) && y.blur()
}
(p || h || f) && addEvent(n._window, "click",
n._onClick, !0)
}
n.clientStores = [new
ClientStore(getEventClients(e))],
n._isIdle = !1,
n.flag = !0,
n.isDrag = !1,
n._isTrusted = t,
n._dragFlag = !0,
n._prevInputEvent = e,
n.data = {},
n.doubleFlag = now$4() - n.prevTime < 200,
n._isMouseEvent = isMouseEvent(e),
!n._isMouseEvent && n._preventMouseEvent &&
n._allowMouseEvent(),
!1 === (n._preventMouseEvent || n.emit("dragStart",
__assign$8(__assign$8({
data: n.data,
datas: n.data,
inputEvent: e,
isMouseEvent: n._isMouseEvent,
isSecondaryButton: n._isSecondaryButton,
isTrusted: t,
isDouble: n.doubleFlag
}, n.getCurrentStore().getPosition()), {
preventDefault: function() {
e.preventDefault()
},
preventDrag: function() {
n._dragFlag = !1
}
}))) && n.stop(),
n._isMouseEvent && n.flag && c &&
e.preventDefault()
}
if (!n.flag)
return !1;
var T = 0;
if (g ? (n._attchDragEvent(),
m && s && (T = setTimeout((function() {
addEvent(o, "touchstart", n.onDragStart, {
passive: !1
})
}
)))) : m && s && removeEvent(o, "touchstart",
n.onDragStart),
n.flag && isMultiTouch(e)) {
if (clearTimeout(T),
g && e.touches.length !== e.changedTouches.length)
return;
n.pinchFlag || n.onPinchStart(e)
}
}
}
}
,
n.onDrag = function(e, t) {
if (n.flag) {
var r = n.options.preventDefault;
!n._isMouseEvent && r && e.preventDefault(),
n._prevInputEvent = e;
var i = getEventClients(e)
, o = n.moveClients(i, e, !1);
if (n._dragFlag) {
if (n.pinchFlag || o.deltaX || o.deltaY)
if (!1 === (n._preventMouseEvent || n.emit("drag",
__assign$8(__assign$8({}, o), {
isScroll: !!t,
inputEvent: e
}))))
return void n.stop();
n.pinchFlag && n.onPinch(e, i)
}
n.getCurrentStore().getPosition(i, !0)
}
}
,
n.onDragEnd = function(e) {
if (n.flag) {
var t = n.options
, r = t.pinchOutside
, i = t.container
, o = t.preventClickEventOnDrag
, s = t.preventClickEventOnDragStart
, a = t.preventClickEventByCondition
, l = n.isDrag;
(o || s || a) && requestAnimationFrame((function() {
n._allowClickEvent()
}
)),
a || s || !o || l || n._allowClickEvent(),
n._useTouch && r && removeEvent(i, "touchstart",
n.onDragStart),
n.pinchFlag && n.onPinchEnd(e);
var c = (null == e ? void 0 : e.touches) ?
getEventClients(e) : [];
0 !== c.length && n.options.keepDragging ? n._addStore(new
ClientStore(c)) : n.flag = !1;
var u = n._getPosition()
, d = now$4()
, p = !l && n.doubleFlag;
n._prevInputEvent = null,
n.prevTime = l || p ? 0 : d,
n.flag || (n._dettachDragEvent(),
n._preventMouseEvent || n.emit("dragEnd", __assign$8({
data: n.data,
datas: n.data,
isDouble: p,
isDrag: l,
isClick: !l,
isMouseEvent: n._isMouseEvent,
isSecondaryButton: n._isSecondaryButton,
inputEvent: e,
isTrusted: n._isTrusted
}, u)),
n.clientStores = [],
n._isMouseEvent || (n._preventMouseEvent = !0,
clearTimeout(n._preventMouseEventId),
n._preventMouseEventId = setTimeout((function() {
n._preventMouseEvent = !1
}
), 200)),
n._isIdle = !0)
}
}
,
n.onBlur = function() {
n.onDragEnd()
}
,
n._allowClickEvent = function() {
removeEvent(n._window, "click", n._onClick, !0)
}
,
n._onClick = function(e) {
n._allowClickEvent(),
n._allowMouseEvent();
var t = n.options.preventClickEventByCondition;
(null == t ? void 0 : t(e)) || (e.stopPropagation(),
e.preventDefault())
}
,
n._onContextMenu = function(e) {
n.options.preventRightClick ? n.onDragEnd(e) :
e.preventDefault()
}
,
n._passCallback = function() {}
;
var i = [].concat(t)
, o = i[0];
n._window = isWindow$1(o) ? o : getWindow$1(o),
n.options = __assign$8({
checkInput: !1,
container: o && !("document"in o) ? getWindow$1(o) : o,
preventRightClick: !0,
preventWheelClick: !0,
preventClickEventOnDragStart: !1,
preventClickEventOnDrag: !1,
preventClickEventByCondition: null,
preventDefault: !0,
checkWindowBlur: !1,
keepDragging: !1,
pinchThreshold: 0,
events: ["touch", "mouse"]
}, r);
var s = n.options
, a = s.container
, l = s.events
, c = s.checkWindowBlur;
if (n._useDrag = l.indexOf("drag") > -1,
n._useTouch = l.indexOf("touch") > -1,
n._useMouse = l.indexOf("mouse") > -1,
n.targets = i,
n._useDrag && i.forEach((function(e) {
addEvent(e, "dragstart", n.onDragStart)
}
)),
n._useMouse && (i.forEach((function(e) {
addEvent(e, "mousedown", n.onDragStart),
addEvent(e, "mousemove", n._passCallback)
}
)),
addEvent(a, "contextmenu", n._onContextMenu)),
c && addEvent(getWindow$1(), "blur", n.onBlur),
n._useTouch) {
var u = {
passive: !1
};
i.forEach((function(e) {
addEvent(e, "touchstart", n.onDragStart, u),
addEvent(e, "touchmove", n._passCallback, u)
}
))
}
return n
}
return __extends$8(t, e),
t.prototype.stop = function() {
this.isDrag = !1,
this.data = {},
this.clientStores = [],
this.pinchFlag = !1,
this.doubleFlag = !1,
this.prevTime = 0,
this.flag = !1,
this._isIdle = !0,
this._allowClickEvent(),
this._dettachDragEvent(),
this._isDragAPI = !1
}
,
t.prototype.getMovement = function(e) {
return this.getCurrentStore().getMovement(e) +
this.clientStores.slice(1).reduce((function(e, t) {
return e + t.movement
}
), 0)
}
,
t.prototype.isDragging = function() {
return this.isDrag
}
,
t.prototype.isIdle = function() {
return this._isIdle
}
,
t.prototype.isFlag = function() {
return this.flag
}
,
t.prototype.isPinchFlag = function() {
return this.pinchFlag
}
,
t.prototype.isDoubleFlag = function() {
return this.doubleFlag
}
,
t.prototype.isPinching = function() {
return this.isPinch
}
,
t.prototype.scrollBy = function(e, t, r, n) {
void 0 === n && (n = !0),
this.flag && (this.clientStores[0].move(e, t),
n && this.onDrag(r, !0))
}
,
t.prototype.move = function(e, t) {
var r = e[0]
, n = e[1]
, i = this.getCurrentStore().prevClients;
return this.moveClients(i.map((function(e) {
var t = e.clientX
, i = e.clientY;
return {
clientX: t + r,
clientY: i + n,
originalClientX: t,
originalClientY: i
}
}
)), t, !0)
}
,
t.prototype.triggerDragStart = function(e) {
this.onDragStart(e, !1)
}
,
t.prototype.setEventData = function(e) {
var t = this.data;
for (var r in e)
t[r] = e[r];
return this
}
,
t.prototype.setEventDatas = function(e) {
return this.setEventData(e)
}
,
t.prototype.getCurrentEvent = function(e) {
return void 0 === e && (e = this._prevInputEvent),
__assign$8(__assign$8({
data: this.data,
datas: this.data
}, this._getPosition()), {
movement: this.getMovement(),
isDrag: this.isDrag,
isPinch: this.isPinch,
isScroll: !1,
inputEvent: e
})
}
,
t.prototype.getEventData = function() {
return this.data
}
,
t.prototype.getEventDatas = function() {
return this.data
}
,
t.prototype.unset = function() {
var e = this
, t = this.targets
, r = this.options.container;
this.off(),
removeEvent(this._window, "blur", this.onBlur),
this._useDrag && t.forEach((function(t) {
removeEvent(t, "dragstart", e.onDragStart)
}
)),
this._useMouse && (t.forEach((function(t) {
removeEvent(t, "mousedown", e.onDragStart)
}
)),
removeEvent(r, "contextmenu", this._onContextMenu)),
this._useTouch && (t.forEach((function(t) {
removeEvent(t, "touchstart", e.onDragStart)
}
)),
removeEvent(r, "touchstart", this.onDragStart)),
this._prevInputEvent = null,
this._allowClickEvent(),
this._dettachDragEvent()
}
,
t.prototype.onPinchStart = function(e) {
var t = this
, r = this.options.pinchThreshold;
if (!(this.isDrag && this.getMovement() > r)) {
var n = new ClientStore(getEventClients(e));
this.pinchFlag = !0,
this._addStore(n),
!1 === this.emit("pinchStart", __assign$8(__assign$8({
data: this.data,
datas: this.data,
angle: n.getAngle(),
touches: this.getCurrentStore().getPositions()
}, n.getPosition()), {
inputEvent: e,
isTrusted: this._isTrusted,
preventDefault: function() {
e.preventDefault()
},
preventDrag: function() {
t._dragFlag = !1
}
})) && (this.pinchFlag = !1)
}
}
,
t.prototype.onPinch = function(e, t) {
if (this.flag && this.pinchFlag && !(t.length < 2)) {
var r = this.getCurrentStore();
this.isPinch = !0,
this.emit("pinch", __assign$8(__assign$8({
data: this.data,
datas: this.data,
movement: this.getMovement(t),
angle: r.getAngle(t),
rotation: r.getRotation(t),
touches: r.getPositions(t),
scale: r.getScale(t),
distance: r.getDistance(t)
}, r.getPosition(t)), {
inputEvent: e,
isTrusted: this._isTrusted
}))
}
}
,
t.prototype.onPinchEnd = function(e) {
if (this.pinchFlag) {
var t = this.isPinch;
this.isPinch = !1,
this.pinchFlag = !1;
var r = this.getCurrentStore();
this.emit("pinchEnd", __assign$8(__assign$8({
data: this.data,
datas: this.data,
isPinch: t,
touches: r.getPositions()
}, r.getPosition()), {
inputEvent: e
}))
}
}
,
t.prototype.getCurrentStore = function() {
return this.clientStores[0]
}
,
t.prototype.moveClients = function(e, t, r) {
var n = this._getPosition(e, r)
, i = this.isDrag;
(n.deltaX || n.deltaY) && (this.isDrag = !0);
var o = !1;
return !i && this.isDrag && (o = !0),
__assign$8(__assign$8({
data: this.data,
datas: this.data
}, n), {
movement: this.getMovement(e),
isDrag: this.isDrag,
isPinch: this.isPinch,
isScroll: !1,
isMouseEvent: this._isMouseEvent,
isSecondaryButton: this._isSecondaryButton,
inputEvent: t,
isTrusted: this._isTrusted,
isFirstDrag: o
})
}
,
t.prototype._addStore = function(e) {
this.clientStores.splice(0, 0, e)
}
,
t.prototype._getPosition = function(e, t) {
var r = this.getCurrentStore().getPosition(e, t)
, n = this.clientStores.slice(1).reduce((function(e, t) {
var r = t.getPosition();
return e.distX += r.distX,
e.distY += r.distY,
e
}
), r)
, i = n.distX
, o = n.distY;
return __assign$8(__assign$8({}, r), {
distX: i,
distY: o
})
}
,
t.prototype._attchDragEvent = function() {
var e = this._window
, t = this.options.container
, r = {
passive: !1
};
this._isDragAPI && (addEvent(t, "dragover", this.onDrag, r),
addEvent(e, "dragend", this.onDragEnd)),
this._useMouse && (addEvent(t, "mousemove", this.onDrag),
addEvent(e, "mouseup", this.onDragEnd)),
this._useTouch && (addEvent(t, "touchmove", this.onDrag, r),
addEvent(e, "touchend", this.onDragEnd, r),
addEvent(e, "touchcancel", this.onDragEnd, r))
}
,
t.prototype._dettachDragEvent = function() {
var e = this._window
, t = this.options.container;
this._isDragAPI && (removeEvent(t, "dragover", this.onDrag),
removeEvent(e, "dragend", this.onDragEnd)),
this._useMouse && (removeEvent(t, "mousemove", this.onDrag),
removeEvent(e, "mouseup", this.onDragEnd)),
this._useTouch && (removeEvent(t, "touchstart", this.onDragStart),
removeEvent(t, "touchmove", this.onDrag),
removeEvent(e, "touchend", this.onDragEnd),
removeEvent(e, "touchcancel", this.onDragEnd))
}
,
t.prototype._allowMouseEvent = function() {
this._preventMouseEvent = !1,
clearTimeout(this._preventMouseEventId)
}
,
t
}(EventEmitter$1);
function prefixNames(e) {
for (var t = [], r = 1; r < arguments.length; r++)
t[r - 1] = arguments[r];
return t.map((function(t) {
return t.split(" ").map((function(t) {
return t ? "" + e + t : ""
}
)).join(" ")
}
)).join(" ")
}
function prefixCSS(e, t) {
return t.replace(/([^}{]*){/gm, (function(t, r) {
return r.replace(/\.([^{,\s\d.]+)/g, "." + e + "$1") + "{"
}
))
}
function ref(e, t) {
return function(r) {
r && (e[t] = r)
}
}
function refs(e, t, r) {
return function(n) {
n && (e[t][r] = n)
}
}
function Properties(e, t) {
return function(r) {
var n = r.prototype;
e.forEach((function(e) {
t(n, e)
}
))
}
}
function withMethods(e, t) {
return void 0 === t && (t = {}),
function(r, n) {
e.forEach((function(e) {
var i = t[e] || e;
i in r || (r[i] = function() {
for (var t, r = [], i = 0; i < arguments.length; i++)
r[i] = arguments[i];
var o = (t = this[n])[e].apply(t, r);
return o === this[n] ? this : o
}
)
}
))
}
}
var PolyMap = function() {
function e() {
this.keys = [],
this.values = []
}
var t = e.prototype;
return t.get = function(e) {
return this.values[this.keys.indexOf(e)]
}
,
t.set = function(e, t) {
var r = this.keys
, n = this.values
, i = r.indexOf(e)
, o = -1 === i ? r.length : i;
r[o] = e,
n[o] = t
}
,
e
}()
, HashMap = function() {
function e() {
this.object = {}
}
var t = e.prototype;
return t.get = function(e) {
return this.object[e]
}
,
t.set = function(e, t) {
this.object[e] = t
}
,
e
}()
, SUPPORT_MAP = "function" == typeof Map
, Link$1 = function() {
function e() {}
var t = e.prototype;
return t.connect = function(e, t) {
this.prev = e,
this.next = t,
e && (e.next = this),
t && (t.prev = this)
}
,
t.disconnect = function() {
var e = this.prev
, t = this.next;
e && (e.next = t),
t && (t.prev = e)
}
,
t.getIndex = function() {
for (var e = this, t = -1; e; )
e = e.prev,
++t;
return t
}
,
e
}();
function orderChanged(e, t) {
var r = []
, n = [];
return e.forEach((function(e) {
var t = e[0]
, i = e[1]
, o = new Link$1;
r[t] = o,
n[i] = o
}
)),
r.forEach((function(e, t) {
e.connect(r[t - 1])
}
)),
e.filter((function(e, r) {
return !t[r]
}
)).map((function(e, t) {
var i = e[0]
, o = e[1];
if (i === o)
return [0, 0];
var s = r[i]
, a = n[o - 1]
, l = s.getIndex();
return s.disconnect(),
a ? s.connect(a, a.next) : s.connect(void 0, r[0]),
[l, s.getIndex()]
}
))
}
var Result = function() {
function e(e, t, r, n, i, o, s, a) {
this.prevList = e,
this.list = t,
this.added = r,
this.removed = n,
this.changed = i,
this.maintained = o,
this.changedBeforeAdded = s,
this.fixed = a
}
var t = e.prototype;
return Object.defineProperty(t, "ordered", {
get: function() {
return this.cacheOrdered || this.caculateOrdered(),
this.cacheOrdered
},
enumerable: !0,
configurable: !0
}),
Object.defineProperty(t, "pureChanged", {
get: function() {
return this.cachePureChanged || this.caculateOrdered(),
this.cachePureChanged
},
enumerable: !0,
configurable: !0
}),
t.caculateOrdered = function() {
var e = orderChanged(this.changedBeforeAdded, this.fixed)
, t = this.changed
, r = [];
this.cacheOrdered = e.filter((function(e, n) {
var i = e[0]
, o = e[1]
, s = t[n]
, a = s[0]
, l = s[1];
if (i !== o)
return r.push([a, l]),
!0
}
)),
this.cachePureChanged = r
}
,
e
}();
function diff$1(e, t, r) {
var n = SUPPORT_MAP ? Map : r ? HashMap : PolyMap
, i = r || function(e) {
return e
}
, o = []
, s = []
, a = []
, l = e.map(i)
, c = t.map(i)
, u = new n
, d = new n
, p = []
, h = []
, f = {}
, m = []
, g = 0
, y = 0;
return l.forEach((function(e, t) {
u.set(e, t)
}
)),
c.forEach((function(e, t) {
d.set(e, t)
}
)),
l.forEach((function(e, t) {
var r = d.get(e);
void 0 === r ? (++y,
s.push(t)) : f[r] = y
}
)),
c.forEach((function(e, t) {
var r = u.get(e);
void 0 === r ? (o.push(t),
++g) : (a.push([r, t]),
y = f[t] || 0,
p.push([r - y, t - g]),
h.push(t === r),
r !== t && m.push([r, t]))
}
)),
s.reverse(),
new Result(e,t,o,s,m,a,p,h)
}
var ListDiffer = function() {
function e(e, t) {
void 0 === e && (e = []),
this.findKeyCallback = t,
this.list = [].slice.call(e)
}
return e.prototype.update = function(e) {
var t = [].slice.call(e)
, r = diff$1(this.list, t, this.findKeyCallback);
return this.list = t,
r
}
,
e
}()
, extendStatics$7 = function(e, t) {
return (extendStatics$7 = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(e, t) {
e.__proto__ = t
}
|| function(e, t) {
for (var r in t)
t.hasOwnProperty(r) && (e[r] = t[r])
}
)(e, t)
};
/*!
*****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
*****************************************************************************
*/
function __extends$7(e, t) {
function r() {
this.constructor = e
}
extendStatics$7(e, t),
e.prototype = null === t ? Object.create(t) : (r.prototype =
t.prototype,
new r)
}
var findKeyCallback = "function" == typeof Map ? void 0 : (childrenCount =
0,
function(e) {
return e.__DIFF_KEY__ || (e.__DIFF_KEY__ = ++childrenCount)
}
), childrenCount, ChildrenDiffer = function(e) {
function t(t) {
return void 0 === t && (t = []),
e.call(this, t, findKeyCallback) || this
}
return __extends$7(t, e),
t
}(ListDiffer);
function diff(e, t) {
return diff$1(e, t, findKeyCallback)
}
const ChildrenDiffer$1 = ChildrenDiffer;
/*!
*****************************************************************************
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 extendStatics$6 = function(e, t) {
return (extendStatics$6 = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(e, t) {
e.__proto__ = t
}
|| function(e, t) {
for (var r in t)
t.hasOwnProperty(r) && (e[r] = t[r])
}
)(e, t)
};
function __extends$6(e, t) {
function r() {
this.constructor = e
}
extendStatics$6(e, t),
e.prototype = null === t ? Object.create(t) : (r.prototype =
t.prototype,
new r)
}
var __assign$7 = function() {
return __assign$7 = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$7.apply(this, arguments)
};
function getDefaultScrollPosition$1(e) {
var t = e.container;
return t === document.body ? [t.scrollLeft ||
document.documentElement.scrollLeft, t.scrollTop ||
document.documentElement.scrollTop] : [t.scrollLeft, t.scrollTop]
}
function checkDefaultScrollEvent(e, t) {
return e.addEventListener("scroll", t),
function() {
e.removeEventListener("scroll", t)
}
}
function getContainerElement(e) {
return e ? isString$3(e) ? document.querySelector(e) :
isFunction$4(e) ? e() : e instanceof Element ? e : "current"in e ? e.current :
"value"in e ? e.value : void 0 : null
}
var DragScroll = function(e) {
function t() {
var t = null !== e && e.apply(this, arguments) || this;
return t._startRect = null,
t._startPos = [],
t._prevTime = 0,
t._timer = 0,
t._prevScrollPos = [0, 0],
t._isWait = !1,
t._flag = !1,
t._currentOptions = null,
t._lock = !1,
t._unregister = null,
t._onScroll = function() {
var e = t._currentOptions;
!t._lock && e && t.emit("scrollDrag", {
next: function(r) {
t.checkScroll({
container: e.container,
inputEvent: r
})
}
})
}
,
t
}
__extends$6(t, e);
var r = t.prototype;
return r.dragStart = function(e, t) {
var r = getContainerElement(t.container);
if (r) {
var n = 0
, i = 0
, o = 0
, s = 0;
if (r === document.body)
o = window.innerWidth,
s = window.innerHeight;
else {
var a = r.getBoundingClientRect();
n = a.top,
i = a.left,
o = a.width,
s = a.height
}
this._flag = !0,
this._startPos = [e.clientX, e.clientY],
this._startRect = {
top: n,
left: i,
width: o,
height: s
},
this._prevScrollPos = this._getScrollPosition([0, 0], t),
this._currentOptions = t,
this._registerScrollEvent(t)
} else
this._flag = !1
}
,
r.drag = function(e, t) {
if (clearTimeout(this._timer),
this._flag) {
var r = e.clientX
, n = e.clientY
, i = t.threshold
, o = void 0 === i ? 0 : i
, s = this._startRect
, a = this._startPos;
this._currentOptions = t;
var l = [0, 0];
return s.top > n - o ? (a[1] > s.top || n < a[1]) && (l[1] = -
1) : s.top + s.height < n + o && (a[1] < s.top + s.height || n > a[1]) && (l[1] =
1),
s.left > r - o ? (a[0] > s.left || r < a[0]) && (l[0] = -1) :
s.left + s.width < r + o && (a[0] < s.left + s.width || r > a[0]) && (l[0] = 1),
!(!l[0] && !l[1]) &&
this._continueDrag(__assign$7(__assign$7({}, t), {
direction: l,
inputEvent: e,
isDrag: !0
}))
}
}
,
r.checkScroll = function(e) {
var t = this;
if (this._isWait)
return !1;
var r = e.prevScrollPos
, n = void 0 === r ? this._prevScrollPos : r
, i = e.direction
, o = e.throttleTime
, s = void 0 === o ? 0 : o
, a = e.inputEvent
, l = e.isDrag
, c = this._getScrollPosition(i || [0, 0], e)
, u = c[0] - n[0]
, d = c[1] - n[1]
, p = i || [u ? Math.abs(u) / u : 0, d ? Math.abs(d) / d : 0];
return this._prevScrollPos = c,
this._lock = !1,
!(!u && !d) && (this.emit("move", {
offsetX: p[0] ? u : 0,
offsetY: p[1] ? d : 0,
inputEvent: a
}),
s && l && (clearTimeout(this._timer),
this._timer = window.setTimeout((function() {
t._continueDrag(e)
}
), s)),
!0)
}
,
r.dragEnd = function() {
this._flag = !1,
this._lock = !1,
clearTimeout(this._timer),
this._unregisterScrollEvent()
}
,
r._getScrollPosition = function(e, t) {
var r = t.container
, n = t.getScrollPosition;
return (void 0 === n ? getDefaultScrollPosition$1 : n)({
container: getContainerElement(r),
direction: e
})
}
,
r._continueDrag = function(e) {
var t, r = this, n = e.container, i = e.direction, o =
e.throttleTime, s = e.useScroll, a = e.isDrag, l = e.inputEvent;
if (!(!this._flag || a && this._isWait)) {
var c = now$4()
, u = Math.max(o + this._prevTime - c, 0);
if (u > 0)
return clearTimeout(this._timer),
this._timer = window.setTimeout((function() {
r._continueDrag(e)
}
), u),
!1;
this._prevTime = c;
var d = this._getScrollPosition(i, e);
this._prevScrollPos = d,
a && (this._isWait = !0),
s || (this._lock = !0);
var p = {
container: getContainerElement(n),
direction: i,
inputEvent: l
};
return null === (t = e.requestScroll) || void 0 === t ||
t.call(e, p),
this.emit("scroll", p),
this._isWait = !1,
s || this.checkScroll(__assign$7(__assign$7({}, e), {
prevScrollPos: d,
direction: i,
inputEvent: l
}))
}
}
,
r._registerScrollEvent = function(e) {
this._unregisterScrollEvent();
var t = e.checkScrollEvent;
if (t) {
var r = !0 === t ? checkDefaultScrollEvent : t
, n = getContainerElement(e.container);
!0 !== t || n !== document.body && n !==
document.documentElement ? this._unregister = r(n, this._onScroll) :
this._unregister = checkDefaultScrollEvent(window, this._onScroll)
}
}
,
r._unregisterScrollEvent = function() {
var e;
null === (e = this._unregister) || void 0 === e || e.call(this),
this._unregister = null
}
,
t
}(EventEmitter$1);
const DragScroll$1 = DragScroll;
var extendStatics$5 = function(e, t) {
return (extendStatics$5 = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(e, t) {
e.__proto__ = t
}
|| function(e, t) {
for (var r in t)
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r])
}
)(e, t)
};
function __extends$5(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Class extends value " + String(t) + " is not a
constructor or null");
function r() {
this.constructor = e
}
extendStatics$5(e, t),
e.prototype = null === t ? Object.create(t) : (r.prototype =
t.prototype,
new r)
}
function createCommonjsModule(e, t) {
return e(t = {
exports: {}
}, t.exports),
t.exports
}
var keycode = createCommonjsModule((function(e, t) {
function r(e) {
if (e && "object" == typeof e) {
var t = e.which || e.keyCode || e.charCode;
t && (e = t)
}
if ("number" == typeof e)
return s[e];
var r, o = String(e);
return (r = n[o.toLowerCase()]) ? r : (r = i[o.toLowerCase()]) ||
(1 === o.length ? o.charCodeAt(0) : void 0)
}
r.isEventKey = function(e, t) {
if (e && "object" == typeof e) {
var r = e.which || e.keyCode || e.charCode;
if (null == r)
return !1;
if ("string" == typeof t) {
var o;
if (o = n[t.toLowerCase()])
return o === r;
if (o = i[t.toLowerCase()])
return o === r
} else if ("number" == typeof t)
return t === r;
return !1
}
}
;
var n = (t = e.exports = r).code = t.codes = {
backspace: 8,
tab: 9,
enter: 13,
shift: 16,
ctrl: 17,
alt: 18,
"pause/break": 19,
"caps lock": 20,
esc: 27,
space: 32,
"page up": 33,
"page down": 34,
end: 35,
home: 36,
left: 37,
up: 38,
right: 39,
down: 40,
insert: 45,
delete: 46,
command: 91,
"left command": 91,
"right command": 93,
"numpad *": 106,
"numpad +": 107,
"numpad -": 109,
"numpad .": 110,
"numpad /": 111,
"num lock": 144,
"scroll lock": 145,
"my computer": 182,
"my calculator": 183,
";": 186,
"=": 187,
",": 188,
"-": 189,
".": 190,
"/": 191,
"`": 192,
"[": 219,
"\\": 220,
"]": 221,
"'": 222
}
, i = t.aliases = {
windows: 91,
"⇧": 16,
"⌥": 18,
"⌃": 17,
"⌘": 91,
ctl: 17,
control: 17,
option: 18,
pause: 19,
break: 19,
caps: 20,
return: 13,
escape: 27,
spc: 32,
spacebar: 32,
pgup: 33,
pgdn: 34,
ins: 45,
del: 46,
cmd: 91
};
/*!
* Programatically add the following
*/
for (o = 97; o < 123; o++)
n[String.fromCharCode(o)] = o - 32;
for (var o = 48; o < 58; o++)
n[o - 48] = o;
for (o = 1; o < 13; o++)
n["f" + o] = o + 111;
for (o = 0; o < 10; o++)
n["numpad " + o] = o + 96;
var s = t.names = t.title = {};
for (o in n)
s[n[o]] = o;
for (var a in i)
n[a] = i[a]
}
));
keycode.code,
keycode.codes,
keycode.aliases;
var keycode_4 = keycode.names;
keycode.title;
var codeData = {
"+": "plus",
"left command": "meta",
"right command": "meta"
}, keysSort = {
shift: 1,
ctrl: 2,
alt: 3,
meta: 4
}, globalKeyController;
function getKey(e, t) {
var r = (keycode_4[e] || t || "").toLowerCase();
for (var n in codeData)
r = r.replace(n, codeData[n]);
return r.replace(/\s/g, "")
}
function getCombi(e, t) {
void 0 === t && (t = getKey(e.keyCode, e.key));
var r = getModifierCombi(e);
return -1 === r.indexOf(t) && r.push(t),
r.filter(Boolean)
}
function getModifierCombi(e) {
return [e.shiftKey && "shift", e.ctrlKey && "ctrl", e.altKey && "alt",
e.metaKey && "meta"].filter(Boolean)
}
function getArrangeCombi(e) {
var t = e.slice();
return t.sort((function(e, t) {
return (keysSort[e] || 5) - (keysSort[t] || 5)
}
)),
t
}
var KeyController = function(e) {
function t(t) {
void 0 === t && (t = window);
var r = e.call(this) || this;
return r.container = t,
r.ctrlKey = !1,
r.altKey = !1,
r.shiftKey = !1,
r.metaKey = !1,
r.clear = function() {
return r.ctrlKey = !1,
r.altKey = !1,
r.shiftKey = !1,
r.metaKey = !1,
r
}
,
r.keydownEvent = function(e) {
r.triggerEvent("keydown", e)
}
,
r.keyupEvent = function(e) {
r.triggerEvent("keyup", e)
}
,
r.blur = function() {
r.clear(),
r.trigger("blur")
}
,
addEvent(t, "blur", r.blur),
addEvent(t, "keydown", r.keydownEvent),
addEvent(t, "keyup", r.keyupEvent),
r
}
__extends$5(t, e);
var r = t.prototype;
return Object.defineProperty(t, "global", {
get: function() {
return globalKeyController || (globalKeyController = new t)
},
enumerable: !1,
configurable: !0
}),
t.setGlobal = function() {
return this.global
}
,
r.destroy = function() {
var e = this.container;
this.clear(),
this.off(),
removeEvent(e, "blur", this.blur),
removeEvent(e, "keydown", this.keydownEvent),
removeEvent(e, "keyup", this.keyupEvent)
}
,
r.keydown = function(e, t) {
return this.addEvent("keydown", e, t)
}
,
r.offKeydown = function(e, t) {
return this.removeEvent("keydown", e, t)
}
,
r.offKeyup = function(e, t) {
return this.removeEvent("keyup", e, t)
}
,
r.keyup = function(e, t) {
return this.addEvent("keyup", e, t)
}
,
r.addEvent = function(e, t, r) {
return isArray$a(t) ? this.on("".concat(e,
".").concat(getArrangeCombi(t).join(".")), r) : isString$3(t) ?
this.on("".concat(e, ".").concat(t), r) : this.on(e, t),
this
}
,
r.removeEvent = function(e, t, r) {
return isArray$a(t) ? this.off("".concat(e,
".").concat(getArrangeCombi(t).join(".")), r) : isString$3(t) ?
this.off("".concat(e, ".").concat(t), r) : this.off(e, t),
this
}
,
r.triggerEvent = function(e, t) {
this.ctrlKey = t.ctrlKey,
this.shiftKey = t.shiftKey,
this.altKey = t.altKey,
this.metaKey = t.metaKey;
var r = getKey(t.keyCode, t.key)
, n = {
key: r,
isToggle: "ctrl" === r || "shift" === r || "meta" === r ||
"alt" === r,
inputEvent: t,
keyCode: t.keyCode,
ctrlKey: t.ctrlKey,
altKey: t.altKey,
shiftKey: t.shiftKey,
metaKey: t.metaKey
};
this.trigger(e, n),
this.trigger("".concat(e, ".").concat(r), n);
var i = getCombi(t, r);
i.length > 1 && this.trigger("".concat(e, ".").concat(i.join(".")),
n)
}
,
t
}(EventEmitter$1);
const KeyController$1 = KeyController;
/*!
*****************************************************************************
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.
*****************************************************************************
*/
function __spreadArrays() {
for (var e = 0, t = 0, r = arguments.length; t < r; t++)
e += arguments[t].length;
var n = Array(e)
, i = 0;
for (t = 0; t < r; t++)
for (var o = arguments[t], s = 0, a = o.length; s < a; s++,
i++)
n[i] = o[s];
return n
}
function tinyThrottle(e) {
return throttle$4(e, TINY_NUM$1)
}
function isSameConstants(e, t) {
return e.every((function(e, r) {
return 0 === tinyThrottle(e - t[r])
}
))
}
function isSamePoint(e, t) {
return !tinyThrottle(e[0] - t[0]) && !tinyThrottle(e[1] - t[1])
}
function getAreaSize(e) {
return e.length < 3 ? 0 : Math.abs(sum(e.map((function(t, r) {
var n = e[r + 1] || e[0];
return t[0] * n[1] - n[0] * t[1]
}
)))) / 2
}
function fitPoints(e, t) {
var r = t.width
, n = t.height
, i = t.left
, o = t.top
, s = getMinMaxs(e)
, a = s.minX
, l = s.minY
, c = s.maxX
, u = s.maxY
, d = r / (c - a)
, p = n / (u - l);
return e.map((function(e) {
return [i + (e[0] - a) * d, o + (e[1] - l) * p]
}
))
}
function getMinMaxs(e) {
var t = e.map((function(e) {
return e[0]
}
))
, r = e.map((function(e) {
return e[1]
}
));
return {
minX: Math.min.apply(Math, t),
minY: Math.min.apply(Math, r),
maxX: Math.max.apply(Math, t),
maxY: Math.max.apply(Math, r)
}
}
function isInside(e, t, r) {
var n = e[0]
, i = e[1]
, o = getMinMaxs(t)
, s = o.minX
, a = o.maxX
, l = [[s, i], [a, i]]
, c = getLinearConstants(l[0], l[1])
, u = convertLines(t)
, d = [];
if (u.forEach((function(t) {
var r = getLinearConstants(t[0], t[1])
, n = t[0];
isSameConstants(c, r) ? d.push({
pos: e,
line: t,
type: "line"
}) : getPointsOnLines(getIntersectionPointsByConstants(c, r), [l,
t]).forEach((function(e) {
t.some((function(t) {
return isSamePoint(t, e)
}
)) ? d.push({
pos: e,
line: t,
type: "point"
}) : 0 !== tinyThrottle(n[1] - i) && d.push({
pos: e,
line: t,
type: "intersection"
})
}
))
}
)),
!r && find$2(d, (function(e) {
return e[0] === n
}
)))
return !0;
var p = 0
, h = {};
return d.forEach((function(e) {
var t = e.pos
, r = e.type
, o = e.line;
if (!(t[0] > n))
if ("intersection" === r)
++p;
else {
if ("line" === r)
return;
if ("point" === r) {
var s = find$2(o, (function(e) {
return e[1] !== i
}
))
, a = h[t[0]]
, l = s[1] > i ? 1 : -1;
a ? a !== l && ++p : h[t[0]] = l
}
}
}
)),
p % 2 == 1
}
function getLinearConstants(e, t) {
var r = e[0]
, n = e[1]
, i = t[0] - r
, o = t[1] - n;
Math.abs(i) < TINY_NUM$1 && (i = 0),
Math.abs(o) < TINY_NUM$1 && (o = 0);
var s = 0
, a = 0
, l = 0;
return i ? o ? (a = 1,
l = -(s = -o / i) * r - n) : (a = 1,
l = -n) : o && (s = -1,
l = r),
[s, a, l]
}
function getIntersectionPointsByConstants(e, t) {
var r = e[0]
, n = e[1]
, i = e[2]
, o = t[0]
, s = t[1]
, a = t[2]
, l = 0 === r && 0 === o
, c = 0 === n && 0 === s
, u = [];
if (l && c)
return [];
if (l) {
var d = -i / n;
return d !== -a / s ? [] : [[-1 / 0, d], [1 / 0, d]]
}
if (c) {
var p = -i / r;
return p !== -a / o ? [] : [[p, -1 / 0], [p, 1 / 0]]
}
if (0 === r)
u = [[h = -(s * (f = -i / n) + a) / o, f]];
else if (0 === o) {
u = [[h = -(n * (f = -a / s) + i) / r, f]]
} else if (0 === n) {
u = [[h = -i / r, f = -(o * h + a) / s]]
} else if (0 === s) {
u = [[h = -a / o, f = -(r * h + i) / n]]
} else {
var h, f;
u = [[h = (n * a - s * i) / (s * r - n * o), f = -(r * h + i) / n]]
}
return u.map((function(e) {
return [e[0], e[1]]
}
))
}
function getPointsOnLines(e, t) {
var r = t.map((function(e) {
return [0, 1].map((function(t) {
return [Math.min(e[0][t], e[1][t]), Math.max(e[0][t], e[1][t])]
}
))
}
))
, n = [];
if (2 === e.length) {
var i = e[0]
, o = i[0]
, s = i[1];
if (tinyThrottle(o - e[1][0])) {
if (!tinyThrottle(s - e[1][1])) {
var a = Math.max.apply(Math, r.map((function(e) {
return e[0][0]
}
)))
, l = Math.min.apply(Math, r.map((function(e) {
return e[0][1]
}
)));
if (tinyThrottle(a - l) > 0)
return [];
n = [[a, s], [l, s]]
}
} else {
var c = Math.max.apply(Math, r.map((function(e) {
return e[1][0]
}
)))
, u = Math.min.apply(Math, r.map((function(e) {
return e[1][1]
}
)));
if (tinyThrottle(c - u) > 0)
return [];
n = [[o, c], [o, u]]
}
}
return n.length || (n = e.filter((function(e) {
var t = e[0]
, n = e[1];
return r.every((function(e) {
return 0 <= tinyThrottle(t - e[0][0]) && 0 <= tinyThrottle(e[0]
[1] - t) && 0 <= tinyThrottle(n - e[1][0]) && 0 <= tinyThrottle(e[1][1] - n)
}
))
}
))),
n.map((function(e) {
return [tinyThrottle(e[0]), tinyThrottle(e[1])]
}
))
}
function convertLines(e) {
return __spreadArrays(e.slice(1), [e[0]]).map((function(t, r) {
return [e[r], t]
}
))
}
function getOverlapPointInfos(e, t) {
var r = e.slice()
, n = t.slice();
-1 === getShapeDirection(r) && r.reverse(),
-1 === getShapeDirection(n) && n.reverse();
var i = convertLines(r)
, o = convertLines(n)
, s = i.map((function(e) {
return getLinearConstants(e[0], e[1])
}
))
, a = o.map((function(e) {
return getLinearConstants(e[0], e[1])
}
))
, l = [];
s.forEach((function(e, t) {
var r = i[t]
, s = [];
a.forEach((function(n, i) {
var a = getPointsOnLines(getIntersectionPointsByConstants(e,
n), [r, o[i]]);
s.push.apply(s, a.map((function(e) {
return {
index1: t,
index2: i,
pos: e,
type: "intersection"
}
}
)))
}
)),
s.sort((function(e, t) {
return getDist$2(r[0], e.pos) - getDist$2(r[0], t.pos)
}
)),
l.push.apply(l, s),
isInside(r[1], n) && l.push({
index1: t,
index2: -1,
pos: r[1],
type: "inside"
})
}
)),
o.forEach((function(e, t) {
if (isInside(e[1], r)) {
var n = !1
, i = findIndex$3(l, (function(e) {
return e.index2 === t ? (n = !0,
!1) : !!n
}
));
-1 === i && (n = !1,
i = findIndex$3(l, (function(e) {
var r = e.index1
, i = e.index2;
return -1 === r && i + 1 === t ? (n = !0,
!1) : !!n
}
))),
-1 === i ? l.push({
index1: -1,
index2: t,
pos: e[1],
type: "inside"
}) : l.splice(i, 0, {
index1: -1,
index2: t,
pos: e[1],
type: "inside"
})
}
}
));
var c = {};
return l.filter((function(e) {
var t = e.pos
, r = t[0] + "x" + t[1];
return !c[r] && (c[r] = !0,
!0)
}
))
}
function getOverlapPoints(e, t) {
return getOverlapPointInfos(e, t).map((function(e) {
return e.pos
}
))
}
function getOverlapSize(e, t) {
return getAreaSize(getOverlapPoints(e, t))
}
function add$3(e, t, r, n, i, o) {
for (var s = 0; s < i; ++s) {
var a = r + s * i
, l = n + s * i;
e[a] += e[l] * o,
t[a] += t[l] * o
}
}
function swap(e, t, r, n, i) {
for (var o = 0; o < i; ++o) {
var s = r + o * i
, a = n + o * i
, l = e[s]
, c = t[s];
e[s] = e[a],
e[a] = l,
t[s] = t[a],
t[a] = c
}
}
function divide(e, t, r, n, i) {
for (var o = 0; o < n; ++o) {
var s = r + o * n;
e[s] /= i,
t[s] /= i
}
}
function ignoreDimension(e, t, r) {
void 0 === r && (r = Math.sqrt(e.length));
for (var n = e.slice(), i = 0; i < r; ++i)
n[i * r + t - 1] = 0,
n[(t - 1) * r + i] = 0;
return n[(t - 1) * (r + 1)] = 1,
n
}
function invert(e, t) {
void 0 === t && (t = Math.sqrt(e.length));
for (var r = e.slice(), n = createIdentityMatrix(t), i = 0; i < t; ++i)
{
var o = t * i + i;
if (!throttle$4(r[o], TINY_NUM$1))
for (var s = i + 1; s < t; ++s)
if (r[t * i + s]) {
swap(r, n, i, s, t);
break
}
if (!throttle$4(r[o], TINY_NUM$1))
return [];
divide(r, n, i, t, r[o]);
for (s = 0; s < t; ++s) {
var a = s
, l = r[s + i * t];
throttle$4(l, TINY_NUM$1) && i !== s && add$3(r, n, a, i, t, -
l)
}
}
return n
}
function transpose(e, t) {
void 0 === t && (t = Math.sqrt(e.length));
for (var r = [], n = 0; n < t; ++n)
for (var i = 0; i < t; ++i)
r[i * t + n] = e[t * n + i];
return r
}
function getOrigin(e, t) {
void 0 === t && (t = Math.sqrt(e.length));
for (var r = [], n = e[t * t - 1], i = 0; i < t - 1; ++i)
r[i] = e[t * (t - 1) + i] / n;
return r[t - 1] = 0,
r
}
function fromTranslation(e, t) {
for (var r = createIdentityMatrix(t), n = 0; n < t - 1; ++n)
r[t * (t - 1) + n] = e[n] || 0;
return r
}
function convertPositionMatrix(e, t) {
for (var r = e.slice(), n = e.length; n < t - 1; ++n)
r[n] = 0;
return r[t - 1] = 1,
r
}
function convertDimension(e, t, r) {
if (void 0 === t && (t = Math.sqrt(e.length)),
t === r)
return e;
for (var n = createIdentityMatrix(r), i = Math.min(t, r), o = 0; o < i
- 1; ++o) {
for (var s = 0; s < i - 1; ++s)
n[o * r + s] = e[o * t + s];
n[(o + 1) * r - 1] = e[(o + 1) * t - 1],
n[(r - 1) * r + o] = e[(t - 1) * t + o]
}
return n[r * r - 1] = e[t * t - 1],
n
}
function multiplies(e) {
for (var t = [], r = 1; r < arguments.length; r++)
t[r - 1] = arguments[r];
var n = createIdentityMatrix(e);
return t.forEach((function(t) {
n = multiply(n, t, e)
}
)),
n
}
function multiply(e, t, r) {
void 0 === r && (r = Math.sqrt(e.length));
var n = []
, i = e.length / r
, o = t.length / i;
if (!i)
return t;
if (!o)
return e;
for (var s = 0; s < r; ++s)
for (var a = 0; a < o; ++a) {
n[a * r + s] = 0;
for (var l = 0; l < i; ++l)
n[a * r + s] += e[l * r + s] * t[a * i + l]
}
return n
}
function plus$1(e, t) {
for (var r = Math.min(e.length, t.length), n = e.slice(), i = 0; i < r;
++i)
n[i] = n[i] + t[i];
return n
}
function minus$1(e, t) {
for (var r = Math.min(e.length, t.length), n = e.slice(), i = 0; i < r;
++i)
n[i] = n[i] - t[i];
return n
}
function convertCSStoMatrix(e, t) {
return void 0 === t && (t = 6 === e.length),
t ? [e[0], e[1], 0, e[2], e[3], 0, e[4], e[5], 1] : e
}
function convertMatrixtoCSS(e, t) {
return void 0 === t && (t = 9 === e.length),
t ? [e[0], e[1], e[3], e[4], e[6], e[7]] : e
}
function calculate(e, t, r) {
void 0 === r && (r = t.length);
var n = multiply(e, t, r)
, i = n[r - 1];
return n.map((function(e) {
return e / i
}
))
}
function rotateX3d(e, t) {
return multiply(e, [1, 0, 0, 0, 0, Math.cos(t), Math.sin(t), 0, 0, -
Math.sin(t), Math.cos(t), 0, 0, 0, 0, 1], 4)
}
function rotateY3d(e, t) {
return multiply(e, [Math.cos(t), 0, -Math.sin(t), 0, 0, 1, 0, 0,
Math.sin(t), 0, Math.cos(t), 0, 0, 0, 0, 1], 4)
}
function rotateZ3d(e, t) {
return multiply(e, createRotateMatrix(t, 4))
}
function scale3d(e, t) {
var r = t[0]
, n = void 0 === r ? 1 : r
, i = t[1]
, o = void 0 === i ? 1 : i
, s = t[2];
return multiply(e, [n, 0, 0, 0, 0, o, 0, 0, 0, 0, void 0 === s ? 1 : s,
0, 0, 0, 0, 1], 4)
}
function rotate(e, t) {
return calculate(createRotateMatrix(t, 3), convertPositionMatrix(e, 3))
}
function translate3d(e, t) {
var r = t[0]
, n = void 0 === r ? 0 : r
, i = t[1]
, o = void 0 === i ? 0 : i
, s = t[2];
return multiply(e, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, n, o, void 0
=== s ? 0 : s, 1], 4)
}
function matrix3d(e, t) {
return multiply(e, t, 4)
}
function createRotateMatrix(e, t) {
var r = Math.cos(e)
, n = Math.sin(e)
, i = createIdentityMatrix(t);
return i[0] = r,
i[1] = n,
i[t] = -n,
i[t + 1] = r,
i
}
function createIdentityMatrix(e) {
for (var t = e * e, r = [], n = 0; n < t; ++n)
r[n] = n % (e + 1) ? 0 : 1;
return r
}
function createScaleMatrix(e, t) {
for (var r = createIdentityMatrix(t), n = Math.min(e.length, t - 1), i
= 0; i < n; ++i)
r[(t + 1) * i] = e[i];
return r
}
function createOriginMatrix(e, t) {
for (var r = createIdentityMatrix(t), n = Math.min(e.length, t - 1), i
= 0; i < n; ++i)
r[t * (t - 1) + i] = e[i];
return r
}
function createWarpMatrix(e, t, r, n, i, o, s, a) {
var l = e[0]
, c = e[1]
, u = t[0]
, d = t[1]
, p = r[0]
, h = r[1]
, f = n[0]
, m = n[1]
, g = i[0]
, y = i[1]
, v = o[0]
, b = o[1]
, x = s[0]
, _ = s[1]
, E = a[0]
, T = a[1]
, C = invert([l, 0, u, 0, p, 0, f, 0, c, 0, d, 0, h, 0, m, 0, 1, 0,
1, 0, 1, 0, 1, 0, 0, l, 0, u, 0, p, 0, f, 0, c, 0, d, 0, h, 0, m, 0, 1, 0, 1, 0, 1,
0, 1, -g * l, -y * l, -v * u, -b * u, -x * p, -_ * p, -E * f, -T * f, -g * c, -y *
c, -v * d, -b * d, -x * h, -_ * h, -E * m, -T * m], 8);
if (!C.length)
return [];
var S = multiply(C, [g, y, v, b, x, _, E, T], 8);
return S[8] = 1,
convertDimension(transpose(S), 3, 4)
}
var __assign$6 = function() {
return __assign$6 = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$6.apply(this, arguments)
};
function createMatrix() {
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
}
function parseMat(e, t) {
return void 0 === t && (t = 0),
toMat(parse$1(e, t))
}
function calculateMatrixDist(e, t) {
var r = calculate(e, [t[0], t[1] || 0, t[2] || 0, 1], 4)
, n = r[3] || 1;
return [r[0] / n, r[1] / n, r[2] / n]
}
function getDistElementMatrix(e, t) {
void 0 === t && (t = document.body);
for (var r = e, n = createMatrix(); r; ) {
if (n = matrix3d(parseMat(getComputedStyle(r).transform), n),
r === t)
break;
r = r.parentElement
}
return (n = invert(n, 4))[12] = 0,
n[13] = 0,
n[14] = 0,
n
}
function toMat(e) {
var t = createMatrix();
return e.forEach((function(e) {
var r = e.matrixFunction
, n = e.functionValue;
r && (t = r(t, n))
}
)),
t
}
function parse$1(e, t) {
return void 0 === t && (t = 0),
(isArray$a(e) ? e : splitSpace(e)).map((function(e) {
var r = splitBracket(e)
, n = r.prefix
, i = r.value
, o = null
, s = n
, a = "";
if ("translate" === n || "translateX" === n || "translate3d" === n)
{
var l = isObject$8(t) ? __assign$6(__assign$6({}, t), {
"o%": t["%"]
}) : {
"%": t,
"o%": t
}
, c = splitComma(i).map((function(e, r) {
return l["%"] = 0 === r && "x%"in l ? t["x%"] : 1 === r &&
"y%"in l ? t["y%"] : t["o%"],
convertUnitSize(e, l)
}
))
, u = c[0]
, d = c[1]
, p = void 0 === d ? 0 : d
, h = c[2];
o = translate3d,
a = [u, p, void 0 === h ? 0 : h]
} else if ("translateY" === n) {
o = translate3d,
a = [0, p = convertUnitSize(i, isObject$8(t) ? __assign$6({
"%": t["y%"]
}, t) : {
"%": t
}), 0]
} else if ("translateZ" === n) {
o = translate3d,
a = [0, 0, parseFloat(i)]
} else if ("scale" === n || "scale3d" === n) {
var f = splitComma(i).map((function(e) {
return parseFloat(e)
}
))
, m = f[0]
, g = f[1]
, y = void 0 === g ? m : g
, v = f[2];
o = scale3d,
a = [m, y, void 0 === v ? 1 : v]
} else if ("scaleX" === n) {
o = scale3d,
a = [m = parseFloat(i), 1, 1]
} else if ("scaleY" === n) {
o = scale3d,
a = [1, y = parseFloat(i), 1]
} else if ("scaleZ" === n) {
o = scale3d,
a = [1, 1, parseFloat(i)]
} else if ("rotate" === n || "rotateZ" === n || "rotateX" === n ||
"rotateY" === n) {
var b = splitUnit(i)
, x = b.unit
, _ = b.value;
"rotate" === n || "rotateZ" === n ? (s = "rotateZ",
o = rotateZ3d) : "rotateX" === n ? o = rotateX3d : "rotateY"
=== n && (o = rotateY3d),
a = "rad" === x ? _ : _ * Math.PI / 180
} else if ("matrix3d" === n)
o = matrix3d,
a = splitComma(i).map((function(e) {
return parseFloat(e)
}
));
else if ("matrix" === n) {
var E = splitComma(i).map((function(e) {
return parseFloat(e)
}
));
o = matrix3d,
a = [E[0], E[1], 0, 0, E[2], E[3], 0, 0, 0, 0, 1, 0, E[4],
E[5], 0, 1]
} else
s = "";
return {
name: n,
functionName: s,
value: i,
matrixFunction: o,
functionValue: a
}
}
))
}
function hash(e) {
for (var t = 5381, r = e.length; r; )
t = 33 * t ^ e.charCodeAt(--r);
return t >>> 0
}
var stringHash = hash;
function getHash(e) {
return stringHash(e).toString(36)
}
function getShadowRoot$1(e) {
if (e && e.getRootNode) {
var t = e.getRootNode();
if (11 === t.nodeType)
return t
}
}
function replaceStyle(e, t, r) {
return r.original ? t : t.replace(/([^};{\s}][^};{]*|^\s*){/gm,
(function(t, r) {
var n = r.trim();
return (n ? splitComma(n) : [""]).map((function(t) {
var r = t.trim();
return 0 === r.indexOf("@") ? r : r.indexOf(":global") > -1 ?
r.replace(/\:global/g, "") : r.indexOf(":host") > -1 ?
"".concat(r.replace(/\:host/g, ".".concat(e))) : r ? ".".concat(e, " ").concat(r) :
".".concat(e)
}
)).join(", ") + " {"
}
))
}
function injectStyle(e, t, r, n, i) {
var o = getDocument(n)
, s = o.createElement("style");
return s.setAttribute("type", "text/css"),
s.setAttribute("data-styled-id", e),
s.setAttribute("data-styled-count", "1"),
r.nonce && s.setAttribute("nonce", r.nonce),
s.innerHTML = replaceStyle(e, t, r),
(i || o.head || o.body).appendChild(s),
s
}
function styled$1(e) {
var t = "rCS" + getHash(e);
return {
className: t,
inject: function(r, n) {
void 0 === n && (n = {});
var i = getShadowRoot$1(r)
, o = (i || r.ownerDocument ||
document).querySelector('style[data-styled-id="'.concat(t, '"]'));
if (o) {
var s = parseFloat(o.getAttribute("data-styled-count")) ||
0;
o.setAttribute("data-styled-count", "".concat(s + 1))
} else
o = injectStyle(t, e, n, r, i);
return {
destroy: function() {
var e, t = parseFloat(o.getAttribute("data-styled-
count")) || 0;
t <= 1 ? (o.remove ? o.remove() : null === (e =
o.parentNode) || void 0 === e || e.removeChild(o),
o = null) : o.setAttribute("data-styled-count",
"".concat(t - 1))
}
}
}
}
}
var extendStatics$4 = function(e, t) {
return (extendStatics$4 = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(e, t) {
e.__proto__ = t
}
|| function(e, t) {
for (var r in t)
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r])
}
)(e, t)
};
function __extends$4(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Class extends value " + String(t) + " is not a
constructor or null");
function r() {
this.constructor = e
}
extendStatics$4(e, t),
e.prototype = null === t ? Object.create(t) : (r.prototype =
t.prototype,
new r)
}
var __assign$5 = function() {
return __assign$5 = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$5.apply(this, arguments)
};
function __rest$11(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
function __decorate$2(e, t, r, n) {
var i, o = arguments.length, s = o < 3 ? t : null === n ? n =
Object.getOwnPropertyDescriptor(t, r) : n;
if ("object" == typeof Reflect && "function" == typeof
Reflect.decorate)
s = Reflect.decorate(e, t, r, n);
else
for (var a = e.length - 1; a >= 0; a--)
(i = e[a]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, r, s) : i(t,
r)) || s);
return o > 3 && s && Object.defineProperty(t, r, s),
s
}
function __spreadArray$1(e, t, r) {
if (r || 2 === arguments.length)
for (var n, i = 0, o = t.length; i < o; i++)
!n && i in t || (n || (n = Array.prototype.slice.call(t, 0,
i)),
n[i] = t[i]);
return e.concat(n || Array.prototype.slice.call(t))
}
function getClient(e) {
if ("touches"in e) {
var t = e.touches[0] || e.changedTouches[0];
return {
clientX: t.clientX,
clientY: t.clientY
}
}
return {
clientX: e.clientX,
clientY: e.clientY
}
}
function filterDuplicated(e) {
if ("undefined" == typeof Map)
return e.filter((function(t, r) {
return e.indexOf(t) === r
}
));
var t = new Map;
return e.filter((function(e) {
return !t.has(e) && (t.set(e, !0),
!0)
}
))
}
function elementFromPoint(e, t, r) {
var n = getDocument(e);
return n.elementFromPoint && n.elementFromPoint(t, r) || null
}
function createElement(e, t, r) {
var n = e.tag
, i = e.children
, o = e.attributes
, s = e.className
, a = e.style
, l = t || getDocument(r).createElement(n);
for (var c in o)
l.setAttribute(c, o[c]);
var u = l.children;
if (i.forEach((function(e, t) {
createElement(e, u[t], l)
}
)),
s && s.split(/\s+/g).forEach((function(e) {
e && !hasClass$1(l, e) && addClass$1(l, e)
}
)),
a) {
var d = l.style;
for (var c in a)
d[c] = a[c]
}
return !t && r && r.appendChild(l),
l
}
function h$1(e, t) {
for (var r = [], n = 2; n < arguments.length; n++)
r[n - 2] = arguments[n];
var i = t || {}
, o = i.className
, s = void 0 === o ? "" : o
, a = i.style;
return {
tag: e,
className: s,
style: void 0 === a ? {} : a,
attributes: __rest$11(i, ["className", "style"]),
children: r
}
}
function diffValue(e, t, r) {
e !== t && r(e, t)
}
function getRect$1(e, t, r) {
var n;
void 0 === r && (r = e.data.boundArea);
var i = e.distX
, o = void 0 === i ? 0 : i
, s = e.distY
, a = void 0 === s ? 0 : s
, l = e.data
, c = l.startX
, u = l.startY;
if (t > 0) {
var d = Math.sqrt((o * o + a * a) / (1 + t * t));
o = (o >= 0 ? 1 : -1) * (t * d),
a = (a >= 0 ? 1 : -1) * d
}
var p = Math.abs(o)
, h = Math.abs(a);
o = (o >= 0 ? 1 : -1) * (p = (n = calculateBoundSize([p, h], [0, 0], [o
< 0 ? c - r.left : r.right - c, a < 0 ? u - r.top : r.bottom - u], !!t))[0]),
a = (a >= 0 ? 1 : -1) * (h = n[1]);
var f = c + Math.min(0, o)
, m = u + Math.min(0, a);
return {
left: f,
top: m,
right: f + p,
bottom: m + h,
width: p,
height: h
}
}
function getDefaultElementRect(e) {
var t = e.getBoundingClientRect()
, r = t.left
, n = t.top
, i = t.width
, o = t.height;
return {
pos1: [r, n],
pos2: [r + i, n],
pos3: [r, n + o],
pos4: [r + i, n + o]
}
}
function passTargets(e, t, r) {
var n = diff(e, t)
, i = n.list
, o = n.prevList
, s = n.added
, a = n.removed
, l = n.maintained;
return __spreadArray$1(__spreadArray$1(__spreadArray$1([],
s.map((function(e) {
return i[e]
}
)), !0), a.map((function(e) {
return o[e]
}
)), !0), r ? l.map((function(e) {
var t = e[1];
return i[t]
}
)) : [], !0)
}
function getLineSize(e) {
for (var t = 0, r = e.length, n = 1; n < r; ++n)
t = Math.max(getDist$2(e[n], e[n - 1]), t);
return t
}
var injector = styled$1("\n:host {\n position: fixed;\n display:
none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n
pointer-events: none;\n will-change: transform;\n z-index: 100;\n}\n")
, CLASS_NAME = "selecto-selection ".concat(injector.className)
, PROPERTIES = ["className", "boundContainer", "selectableTargets",
"selectByClick", "selectFromInside", "continueSelect",
"continueSelectWithoutDeselect", "toggleContinueSelect",
"toggleContinueSelectWithoutDeselect", "keyContainer", "hitRate", "scrollOptions",
"checkInput", "preventDefault", "ratio", "getElementRect", "preventDragFromInside",
"rootContainer", "dragCondition", "clickBySelectEnd", "checkOverflow",
"innerScrollOptions"]
, OPTIONS = __spreadArray$1(["dragContainer", "cspNonce",
"preventClickEventOnDrag", "preventClickEventOnDragStart", "preventRightClick"],
PROPERTIES, !0)
, EVENTS = ["dragStart", "drag", "dragEnd", "selectStart", "select",
"selectEnd", "keydown", "keyup", "scroll", "innerScroll"]
, METHODS = ["clickTarget", "getSelectableElements",
"setSelectedTargets", "getElementPoints", "getSelectedTargets",
"findSelectableTargets", "triggerDragStart", "checkScroll",
"selectTargetsByPoints", "setSelectedTargetsByPoints"]
, Selecto$2 = function(e) {
function t(t) {
void 0 === t && (t = {});
var r = e.call(this) || this;
r.selectedTargets = [],
r.dragScroll = new DragScroll$1,
r._onDragStart = function(e, t) {
var n = e.data
, i = e.clientX
, o = e.clientY
, s = e.inputEvent
, a = r.options
, l = a.selectFromInside
, c = a.selectByClick
, u = a.rootContainer
, d = a.boundContainer
, p = a.preventDragFromInside
, h = void 0 === p || p
, f = a.clickBySelectEnd
, m = a.dragCondition;
if (!m || m(e)) {
n.data = {};
var g = getWindow$1(r.container);
n.innerWidth = g.innerWidth,
n.innerHeight = g.innerHeight,
r.findSelectableTargets(n),
n.startSelectedTargets = r.selectedTargets,
n.scaleMatrix = createMatrix(),
n.containerX = 0,
n.containerY = 0;
var y = r.container
, v = {
left: -1 / 0,
top: -1 / 0,
right: 1 / 0,
bottom: 1 / 0
};
if (u) {
var b = r.container.getBoundingClientRect();
n.containerX = b.left,
n.containerY = b.top,
n.scaleMatrix = getDistElementMatrix(r.container, u)
}
if (d) {
var x = isObject$8(d) && "element"in d ? __assign$5({
left: !0,
top: !0,
bottom: !0,
right: !0
}, d) : {
element: d,
left: !0,
top: !0,
bottom: !0,
right: !0
}
, _ = x.element;
if (_) {
var E = (isString$3(_) ?
getDocument(y).querySelector(_) : !0 === _ ? r.container :
_).getBoundingClientRect();
x.left && (v.left = E.left),
x.top && (v.top = E.top),
x.right && (v.right = E.right),
x.bottom && (v.bottom = E.bottom)
}
}
n.boundArea = v;
var T = {
left: i,
top: o,
right: i,
bottom: o,
width: 0,
height: 0
}
, C = []
, S = c && !f
, $ = !1;
if (!l || S) {
var w = r._findElement(t || s.target,
n.selectableTargets);
$ = !!w,
S && (C = w ? [w] : [])
}
var P = !l && $;
if (P && !c)
return e.stop(),
!1;
var R = s.type
, k = "mousedown" === R || "touchstart" === R;
if (!(!(!e.isClick && k) || r.emit("dragStart",
__assign$5(__assign$5({}, e), {
data: n.data
}))))
return e.stop(),
!1;
if (r.continueSelect ? (C = passTargets(r.selectedTargets,
C, r.continueSelectWithoutDeselect),
n.startPassedTargets = r.selectedTargets) :
n.startPassedTargets = [],
r._select(C, T, e, !0, P && c && !f && h),
n.startX = i,
n.startY = o,
n.selectFlag = !1,
n.preventDragFromInside = !1,
s.target) {
var A = calculateMatrixDist(n.scaleMatrix, [i -
n.containerX, o - n.containerY]);
r.target.style.cssText += "position: ".concat(u ?
"absolute" : "fixed", ";") + "left:0px;top:0px;" + "transform:
translate(".concat(A[0], "px, ").concat(A[1], "px)")
}
if (P && c && !f)
s.preventDefault(),
h && (r._selectEnd(n.startSelectedTargets,
n.startPassedTargets, T, e, !0),
n.preventDragFromInside = !0);
else {
n.selectFlag = !0;
var I = r.options
, O = I.scrollOptions
, D = I.innerScrollOptions
, M = !1;
if (D) {
for (var L = null, j = e.inputEvent.target; j &&
j !== getDocument(y).body; ) {
if ("visible" !== getComputedStyle(j).overflow)
{
L = j;
break
}
j = j.parentElement
}
L && (n.innerScrollOptions = __assign$5({
container: L,
checkScrollEvent: !0
}, !0 === D ? {} : D),
r.dragScroll.dragStart(e, n.innerScrollOptions),
M = !0)
}
!M && O && O.container && r.dragScroll.dragStart(e, O),
P && c && f && (n.selectFlag = !1,
e.preventDrag())
}
return !0
}
e.stop()
}
,
r._onDrag = function(e) {
if (e.data.selectFlag) {
var t = r.scrollOptions
, n = e.data.innerScrollOptions;
if ((n || (null == t ? void 0 : t.container)) && !
e.isScroll && r.dragScroll.drag(e, n || t))
return
}
r._checkSelected(e)
}
,
r._onDragEnd = function(e) {
var t = e.data
, n = e.inputEvent
, i = getRect$1(e, r.options.ratio)
, o = t.selectFlag
, s = r.container;
if (n && r.emit("dragEnd", __assign$5(__assign$5({
isDouble: !!e.isDouble,
isClick: !!e.isClick,
isDrag: !1,
isSelect: o
}, e), {
data: t.data,
rect: i
})),
r.target.style.cssText += "display: none;",
o)
t.selectFlag = !1,
r.dragScroll.dragEnd();
else if (r.selectByClick && r.clickBySelectEnd) {
var a = r._findElement((null == n ? void 0 : n.target) ||
elementFromPoint(s, e.clientX, e.clientY), t.selectableTargets);
r._select(a ? [a] : [], i, e)
}
t.preventDragFromInside || r._selectEnd(t.startSelectedTargets,
t.startPassedTargets, i, e)
}
,
r._onKeyDown = function(e) {
var t = r.options
, n = !1;
if (!r._keydownContinueSelect) {
var i = r._sameCombiKey(e, t.toggleContinueSelect);
r._keydownContinueSelect = i,
n || (n = i)
}
if (!r._keydownContinueSelectWithoutDeselection) {
i = r._sameCombiKey(e,
t.toggleContinueSelectWithoutDeselect);
r._keydownContinueSelectWithoutDeselection = i,
n || (n = i)
}
n && r.emit("keydown", {
keydownContinueSelect: r._keydownContinueSelect,
keydownContinueSelectWithoutDeselection:
r._keydownContinueSelectWithoutDeselection
})
}
,
r._onKeyUp = function(e) {
var t = r.options
, n = !1;
if (r._keydownContinueSelect) {
var i = r._sameCombiKey(e, t.toggleContinueSelect, !0);
r._keydownContinueSelect = !i,
n || (n = i)
}
if (r._keydownContinueSelectWithoutDeselection) {
i = r._sameCombiKey(e,
t.toggleContinueSelectWithoutDeselect, !0);
r._keydownContinueSelectWithoutDeselection = !i,
n || (n = i)
}
n && r.emit("keyup", {
keydownContinueSelect: r._keydownContinueSelect,
keydownContinueSelectWithoutDeselection:
r._keydownContinueSelectWithoutDeselection
})
}
,
r._onBlur = function() {
(r._keydownContinueSelect ||
r._keydownContinueSelectWithoutDeselection) && (r._keydownContinueSelect = !1,
r._keydownContinueSelectWithoutDeselection = !1,
r.emit("keyup", {
keydownContinueSelect: r._keydownContinueSelect,
keydownContinueSelectWithoutDeselection:
r._keydownContinueSelectWithoutDeselection
}))
}
,
r._onDocumentSelectStart = function(e) {
var t = getDocument(r.container);
if (r.gesto.isFlag()) {
var n = r.dragContainer;
n === getWindow$1(r.container) && (n = t.documentElement);
var i = isNode$1(n) ? [n] : [].slice.call(n)
, o = e.target;
i.some((function(t) {
if (t === o || t.contains(o))
return e.preventDefault(),
!0
}
))
}
}
,
r.target = t.portalContainer;
var n = t.container;
r.options = __assign$5({
className: "",
portalContainer: null,
container: null,
dragContainer: null,
selectableTargets: [],
selectByClick: !0,
selectFromInside: !0,
clickBySelectEnd: !1,
hitRate: 100,
continueSelect: !1,
continueSelectWithoutDeselect: !1,
toggleContinueSelect: null,
toggleContinueSelectWithoutDeselect: null,
keyContainer: null,
scrollOptions: null,
checkInput: !1,
preventDefault: !1,
boundContainer: !1,
preventDragFromInside: !0,
dragCondition: null,
rootContainer: null,
checkOverflow: !1,
innerScrollOptions: !1,
getElementRect: getDefaultElementRect,
cspNonce: "",
ratio: 0
}, t);
var i = r.options.portalContainer;
return i && (n = i.parentElement),
r.container = n || document.body,
r.initElement(),
r.initDragScroll(),
r.setKeyController(),
r
}
__extends$4(t, e);
var r = t.prototype;
return r.setSelectedTargets = function(e) {
var t = this.selectedTargets
, r = diff(t, e)
, n = r.added
, i = r.removed
, o = r.prevList
, s = r.list;
return this.selectedTargets = e,
{
added: n.map((function(e) {
return s[e]
}
)),
removed: i.map((function(e) {
return o[e]
}
)),
beforeSelected: t,
selected: e
}
}
,
r.setSelectedTargetsByPoints = function(e, t) {
var r = Math.min(e[0], t[0])
, n = Math.min(e[1], t[1])
, i = Math.max(e[0], t[0])
, o = Math.max(e[1], t[1])
, s = {
left: r,
top: n,
right: i,
bottom: o,
width: i - r,
height: o - n
}
, a = {
ignoreClick: !0
};
this.findSelectableTargets(a);
var l = this.hitTest(s, a, !0, null)
, c = this.setSelectedTargets(l);
return __assign$5(__assign$5({}, c), {
rect: s
})
}
,
r.selectTargetsByPoints = function(e, t) {
var r = new MouseEvent("mousedown",{
clientX: e[0],
clientY: e[1],
cancelable: !0,
bubbles: !0
})
, n = new MouseEvent("mousemove",{
clientX: t[0],
clientY: t[1],
cancelable: !0,
bubbles: !0
})
, i = new MouseEvent("mousemove",{
clientX: t[0],
clientY: t[1],
cancelable: !0,
bubbles: !0
})
, o = this.gesto;
!1 !== o.onDragStart(r) && (o.onDrag(n),
o.onDragEnd(i))
}
,
r.getSelectedTargets = function() {
return this.selectedTargets
}
,
r.triggerDragStart = function(e) {
return this.gesto.triggerDragStart(e),
this
}
,
r.destroy = function() {
var e;
this.off(),
this.keycon && this.keycon.destroy(),
this.gesto.unset(),
this.injectResult.destroy(),
this.dragScroll.dragEnd(),
removeEvent(document, "selectstart", this._onDocumentSelectStart),
this.options.portalContainer || null === (e =
this.target.parentElement) || void 0 === e || e.removeChild(this.target),
this.keycon = null,
this.gesto = null,
this.injectResult = null,
this.target = null,
this.container = null,
this.options = null
}
,
r.getElementPoints = function(e) {
var t = this.getElementRect || getDefaultElementRect
, r = t(e)
, n = [r.pos1, r.pos2, r.pos4, r.pos3];
return t !== getDefaultElementRect ? fitPoints(n,
e.getBoundingClientRect()) : n
}
,
r.getSelectableElements = function() {
var e = this.container
, t = [];
return this.options.selectableTargets.forEach((function(r) {
if (isFunction$4(r)) {
var n = r();
n && t.push.apply(t, [].slice.call(n))
} else if (isNode$1(r))
t.push(r);
else if (isObject$8(r))
t.push(r.value || r.current);
else {
var i = [].slice.call(getDocument(e).querySelectorAll(r));
t.push.apply(t, i)
}
}
)),
t
}
,
r.checkScroll = function() {
if (this.gesto.isFlag()) {
var e = this.scrollOptions
, t = this.gesto.getEventData().innerScrollOptions;
(t || (null == e ? void 0 : e.container)) &&
this.dragScroll.checkScroll(__assign$5({
inputEvent: this.gesto.getCurrentEvent()
}, t || e))
}
}
,
r.findSelectableTargets = function(e) {
var t = this;
void 0 === e && (e = this.gesto.getEventData());
var r = this.getSelectableElements()
, n = r.map((function(e) {
return t.getElementPoints(e)
}
));
e.selectableTargets = r,
e.selectablePoints = n,
e.selectableParentMap = null;
var i = this.options
, o = i.checkOverflow || i.innerScrollOptions
, s = getDocument(this.container);
if (o) {
var a = new Map;
e.selectableInnerScrollParentMap = a,
e.selectableInnerScrollPathsList = r.map((function(e, t) {
for (var r = e.parentElement, n = [], i = [], o =
function() {
var e = a.get(r);
if (!e && "visible" !== getComputedStyle(r).overflow) {
var o = getDefaultElementRect(r);
e = {
parentElement: r,
indexes: [],
points: [o.pos1, o.pos2, o.pos4, o.pos3],
paths: __spreadArray$1([], i, !0)
},
n.push(r),
n.forEach((function(t) {
a.set(t, e)
}
)),
n = []
}
e ? (r = e.parentElement,
a.get(r).indexes.push(t),
i.push(r)) : n.push(r),
r = r.parentElement
}; r && r !== s.body; )
o();
return i
}
))
}
return i.checkOverflow || (e.selectableInners = r.map((function() {
return !0
}
))),
this._refreshGroups(e),
r
}
,
r.clickTarget = function(e, t) {
var r = getClient(e)
, n = {
data: {
selectFlag: !1
},
clientX: r.clientX,
clientY: r.clientY,
inputEvent: e,
isClick: !0,
isTrusted: !1,
stop: function() {
return !1
}
};
return this._onDragStart(n, t) && this._onDragEnd(n),
this
}
,
r.setKeyController = function() {
var e = this.options
, t = e.keyContainer
, r = e.toggleContinueSelect
, n = e.toggleContinueSelectWithoutDeselect;
this.keycon && (this.keycon.destroy(),
this.keycon = null),
(r || n) && (this.keycon = new KeyController$1(t ||
getWindow$1(this.container)),
this.keycon.keydown(this._onKeyDown).keyup(this._onKeyUp).on("blur", this._onBlur))
}
,
r.setClassName = function(e) {
this.options.className = e,
this.target.setAttribute("class", "".concat(CLASS_NAME, "
").concat(e || ""))
}
,
r.setKeyEvent = function() {
var e = this.options
, t = e.toggleContinueSelect
, r = e.toggleContinueSelectWithoutDeselect;
!t && !r || this.keycon || this.setKeyController()
}
,
r.setKeyContainer = function(e) {
var t = this
, r = this.options;
diffValue(r.keyContainer, e, (function() {
r.keyContainer = e,
t.setKeyController()
}
))
}
,
r.getContinueSelect = function() {
var e = this.options
, t = e.continueSelect;
return e.toggleContinueSelect && this._keydownContinueSelect ? !t :
t
}
,
r.getContinueSelectWithoutDeselect = function() {
var e = this.options
, t = e.continueSelectWithoutDeselect;
return e.toggleContinueSelectWithoutDeselect &&
this._keydownContinueSelectWithoutDeselection ? !t : t
}
,
r.setToggleContinueSelect = function(e) {
var t = this
, r = this.options;
diffValue(r.toggleContinueSelect, e, (function() {
r.toggleContinueSelect = e,
t.setKeyEvent()
}
))
}
,
r.setToggleContinueSelectWithoutDeselect = function(e) {
var t = this
, r = this.options;
diffValue(r.toggleContinueSelectWithoutDeselect, e, (function() {
r.toggleContinueSelectWithoutDeselect = e,
t.setKeyEvent()
}
))
}
,
r.setPreventDefault = function(e) {
this.gesto.options.preventDefault = e
}
,
r.setCheckInput = function(e) {
this.gesto.options.checkInput = e
}
,
r.initElement = function() {
var e = this.options
, t = e.dragContainer
, r = e.checkInput
, n = e.preventDefault
, i = e.preventClickEventOnDragStart
, o = e.preventClickEventOnDrag
, s = e.preventClickEventByCondition
, a = e.preventRightClick
, l = void 0 === a || a
, c = e.className
, u = this.container;
this.target = createElement(h$1("div", {
className: "".concat(CLASS_NAME, " ").concat(c || "")
}), this.target, u);
var d = this.target;
this.dragContainer = "string" == typeof t ?
[].slice.call(getDocument(u).querySelectorAll(t)) : t || this.target.parentNode,
this.gesto = new Gesto(this.dragContainer,{
checkWindowBlur: !0,
container: getWindow$1(u),
checkInput: r,
preventDefault: n,
preventClickEventOnDragStart: i,
preventClickEventOnDrag: o,
preventClickEventByCondition: s,
preventRightClick: l
}).on({
dragStart: this._onDragStart,
drag: this._onDrag,
dragEnd: this._onDragEnd
}),
addEvent(document, "selectstart", this._onDocumentSelectStart),
this.injectResult = injector.inject(d, {
nonce: this.options.cspNonce
})
}
,
r.hitTest = function(e, t, r, n) {
var i = this.options
, o = i.hitRate
, s = i.selectByClick
, a = e.left
, l = e.top
, c = e.right
, u = e.bottom
, d = t.innerGroups
, p = t.innerWidth
, h = t.innerHeight
, f = null == n ? void 0 : n.clientX
, m = null == n ? void 0 : n.clientY
, g = t.ignoreClick
, y = [[a, l], [c, l], [c, u], [a, u]]
, v = function(e, t) {
var n = splitUnit("".concat("function" == typeof o ? o(t) : o))
, i = !g && isInside([f, m], e);
if (!r && s && i)
return !0;
var a = getOverlapPoints(y, e);
if (!a.length)
return !1;
var l = getAreaSize(a)
, c = 0;
return 0 === l && 0 === getAreaSize(e) ? (c = getLineSize(e),
l = getLineSize(a)) : c = getAreaSize(e),
"px" === n.unit ? l >= n.value : between(Math.round(l / c *
100), 0, 100) >= Math.min(100, n.value)
}
, b = t.selectableTargets
, x = t.selectablePoints
, _ = t.selectableInners;
if (!d)
return b.filter((function(e, t) {
return !!_[t] && v(x[t], b[t])
}
));
for (var E = [], T = Math.floor(a / p), C = Math.floor(c / p), S =
Math.floor(l / h), $ = Math.floor(u / h), w = T; w <= C; ++w) {
var P = d[w];
if (P)
for (var R = S; R <= $; ++R) {
var k = P[R];
k && k.forEach((function(e) {
var t = x[e]
, r = _[e]
, n = b[e];
r && v(t, n) && E.push(n)
}
))
}
}
return filterDuplicated(E)
}
,
r.initDragScroll = function() {
var e = this;
this.dragScroll.on("scrollDrag", (function(t) {
(0,
t.next)(e.gesto.getCurrentEvent())
}
)).on("scroll", (function(t) {
var r = t.container
, n = t.direction;
e.gesto.getEventData().innerScrollOptions ?
e.emit("innerScroll", {
container: r,
direction: n
}) : e.emit("scroll", {
container: r,
direction: n
})
}
)).on("move", (function(t) {
var r = t.offsetX
, n = t.offsetY
, i = t.inputEvent
, o = e.gesto;
if (o && o.isFlag()) {
var s = e.gesto.getEventData()
, a = s.boundArea;
s.startX -= r,
s.startY -= n;
var l = e.gesto.getEventData().innerScrollOptions
, c = null == l ? void 0 : l.container
, u = !1;
if (c) {
var d = s.selectableInnerScrollParentMap
, p = d.get(c);
p && (p.paths.forEach((function(e) {
d.get(e).points.forEach((function(e) {
e[0] -= r,
e[1] -= n
}
))
}
)),
p.indexes.forEach((function(e) {
s.selectablePoints[e].forEach((function(e) {
e[0] -= r,
e[1] -= n
}
))
}
)),
u = !0)
}
u || s.selectablePoints.forEach((function(e) {
e.forEach((function(e) {
e[0] -= r,
e[1] -= n
}
))
}
)),
e._refreshGroups(s),
a.left -= r,
a.right -= r,
a.top -= n,
a.bottom -= n,
e.gesto.scrollBy(r, n, i.inputEvent),
e._checkSelected(e.gesto.getCurrentEvent())
}
}
))
}
,
r._select = function(e, t, r, n, i) {
void 0 === i && (i = !1);
var o = r.inputEvent
, s = r.data
, a = this.setSelectedTargets(e)
, l = diff(s.startSelectedTargets, e)
, c = l.added
, u = l.removed
, d = l.prevList
, p = l.list
, h = {
startSelected: d,
startAdded: c.map((function(e) {
return p[e]
}
)),
startRemoved: u.map((function(e) {
return d[e]
}
))
};
n && this.emit("selectStart", __assign$5(__assign$5(__assign$5({},
a), h), {
rect: t,
inputEvent: o,
data: s.data,
isTrusted: r.isTrusted,
isDragStartEnd: i
})),
(a.added.length || a.removed.length) && this.emit("select",
__assign$5(__assign$5(__assign$5({}, a), h), {
rect: t,
inputEvent: o,
data: s.data,
isTrusted: r.isTrusted,
isDragStartEnd: i
}))
}
,
r._selectEnd = function(e, t, r, n, i) {
void 0 === i && (i = !1);
var o = n.inputEvent
, s = n.isDouble
, a = n.data
, l = o && o.type
, c = "mousedown" === l || "touchstart" === l
, u = diff(e, this.selectedTargets)
, d = u.added
, p = u.removed
, h = u.prevList
, f = u.list
, m = diff(t, this.selectedTargets)
, g = m.added
, y = m.removed
, v = m.prevList
, b = m.list;
this.emit("selectEnd", {
startSelected: e,
beforeSelected: t,
selected: this.selectedTargets,
added: d.map((function(e) {
return f[e]
}
)),
removed: p.map((function(e) {
return h[e]
}
)),
afterAdded: g.map((function(e) {
return b[e]
}
)),
afterRemoved: y.map((function(e) {
return v[e]
}
)),
isDragStart: c && i,
isDragStartEnd: c && i,
isClick: !!n.isClick,
isDouble: !!s,
rect: r,
inputEvent: o,
data: a.data,
isTrusted: n.isTrusted
})
}
,
r._checkSelected = function(e, t) {
void 0 === t && (t = getRect$1(e, this.options.ratio));
var r = e.data
, n = t.top
, i = t.left
, o = t.width
, s = t.height
, a = r.selectFlag
, l = r.containerX
, c = r.containerY
, u = r.scaleMatrix
, d = calculateMatrixDist(u, [i - l, n - c])
, p = calculateMatrixDist(u, [o, s])
, h = [];
if (a) {
this.target.style.cssText += "display: block;left:0px;top:0px;"
+ "transform: translate(".concat(d[0], "px, ").concat(d[1], "px);") +
"width:".concat(p[0], "px;height:").concat(p[1], "px;");
var f = this.hitTest(t, r, !0, e);
h = passTargets(r.startPassedTargets, f, this.continueSelect &&
this.continueSelectWithoutDeselect)
}
if (!1 === this.emit("drag", __assign$5(__assign$5({}, e), {
data: r.data,
isSelect: a,
rect: t
})))
return this.target.style.cssText += "display: none;",
void e.stop();
a && this._select(h, t, e)
}
,
r._sameCombiKey = function(e, t, r) {
if (!t)
return !1;
var n = getCombi(e.inputEvent, e.key)
, i = [].concat(t)
, o = isArray$a(i[0]) ? i : [i];
if (r) {
var s = e.key;
return o.some((function(e) {
return e.some((function(e) {
return e === s
}
))
}
))
}
return o.some((function(e) {
return e.every((function(e) {
return n.indexOf(e) > -1
}
))
}
))
}
,
r._findElement = function(e, t) {
for (var r = e; r && !(t.indexOf(r) > -1); )
r = r.parentElement;
return r
}
,
r._refreshGroups = function(e) {
var t, r = e.innerWidth, n = e.innerHeight, i = e.selectablePoints;
if (this.options.checkOverflow) {
var o = null === (t =
this.gesto.getEventData().innerScrollOptions) || void 0 === t ? void 0 :
t.container
, s = e.selectableInnerScrollParentMap
, a = e.selectableInnerScrollPathsList;
e.selectableInners = a.map((function(e, t) {
var r = !1;
return e.every((function(e) {
if (r)
return !0;
if (e === o)
return r = !0,
!0;
var n = s.get(e);
if (n && !getOverlapPoints(i[t], n.points).length)
return !1;
return !0
}
))
}
))
}
if (r && n) {
var l = e.selectablePoints
, c = {};
l.forEach((function(e, t) {
var i = 1 / 0
, o = -1 / 0
, s = 1 / 0
, a = -1 / 0;
e.forEach((function(e) {
var t = Math.floor(e[0] / r)
, l = Math.floor(e[1] / n);
i = Math.min(t, i),
o = Math.max(t, o),
s = Math.min(l, s),
a = Math.max(l, a)
}
));
for (var l = i; l <= o; ++l)
for (var u = s; u <= a; ++u)
c[l] = c[l] || {},
c[l][u] = c[l][u] || [],
c[l][u].push(t)
}
)),
e.innerGroups = c
} else
e.innerGroups = null
}
,
t = __decorate$2([Properties(PROPERTIES, (function(e, t) {
var r = {
enumerable: !0,
configurable: !0,
get: function() {
return this.options[t]
}
}
, n = camelize("get ".concat(t));
e[n] ? r.get = function() {
return this[n]()
}
: r.get = function() {
return this.options[t]
}
;
var i = camelize("set ".concat(t));
e[i] ? r.set = function(e) {
this[i](e)
}
: r.set = function(e) {
this.options[t] = e
}
,
Object.defineProperty(e, t, r)
}
))], t)
}(EventEmitter$1)
, Selecto$1$1 = function(e) {
function t() {
return null !== e && e.apply(this, arguments) || this
}
return __extends$4(t, e),
t
}(Selecto$2);
const VanillaSelecto = Selecto$1$1;
var extendStatics$3 = function(e, t) {
return (extendStatics$3 = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(e, t) {
e.__proto__ = t
}
|| function(e, t) {
for (var r in t)
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r])
}
)(e, t)
};
function __extends$3(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Class extends value " + String(t) + " is not a
constructor or null");
function r() {
this.constructor = e
}
extendStatics$3(e, t),
e.prototype = null === t ? Object.create(t) : (r.prototype =
t.prototype,
new r)
}
var __assign$4 = function() {
return __assign$4 = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$4.apply(this, arguments)
};
function __decorate$1(e, t, r, n) {
var i, o = arguments.length, s = o < 3 ? t : null === n ? n =
Object.getOwnPropertyDescriptor(t, r) : n;
if ("object" == typeof Reflect && "function" == typeof
Reflect.decorate)
s = Reflect.decorate(e, t, r, n);
else
for (var a = e.length - 1; a >= 0; a--)
(i = e[a]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, r, s) : i(t,
r)) || s);
return o > 3 && s && Object.defineProperty(t, r, s),
s
}
var REACT_EVENTS = EVENTS.map((function(e) {
return camelize("on ".concat(e))
}
))
, Selecto = function(e) {
function t() {
return null !== e && e.apply(this, arguments) || this
}
__extends$3(t, e);
var r = t.prototype;
return r.render = function() {
return reactExports.createElement("div", {
className: CLASS_NAME,
ref: ref(this, "selectionElement")
})
}
,
r.componentDidMount = function() {
var e = this
, t = this.props
, r = {};
OPTIONS.forEach((function(e) {
e in t && (r[e] = t[e])
}
)),
this.selecto = new VanillaSelecto(__assign$4(__assign$4({}, r), {
portalContainer: this.selectionElement
})),
EVENTS.forEach((function(t, r) {
e.selecto.on(t, (function(t) {
var n = e.props;
!1 === (n[REACT_EVENTS[r]] && n[REACT_EVENTS[r]](t)) &&
t.stop()
}
))
}
))
}
,
r.componentDidUpdate = function(e) {
var t = this.props
, r = this.selecto;
PROPERTIES.forEach((function(n) {
e[n] !== t[n] && (r[n] = t[n])
}
))
}
,
r.componentWillUnmount = function() {
this.selecto.destroy()
}
,
__decorate$1([withMethods(METHODS)], t.prototype, "selecto", void 0),
t
}(reactExports.PureComponent);
const Selecto$1 = Selecto;
function some(e, t) {
for (var r = e.length, n = 0; n < r; ++n)
if (t(e[n], n))
return !0;
return !1
}
function find$1(e, t) {
for (var r = e.length, n = 0; n < r; ++n)
if (t(e[n], n))
return e[n];
return null
}
function getUserAgentString(e) {
var t = e;
if (void 0 === t) {
if ("undefined" == typeof navigator || !navigator)
return "";
t = navigator.userAgent || ""
}
return t.toLowerCase()
}
function execRegExp(e, t) {
try {
return new RegExp(e,"g").exec(t)
} catch (e2) {
return null
}
}
function hasUserAgentData() {
if ("undefined" == typeof navigator || !navigator || !
navigator.userAgentData)
return !1;
var e = navigator.userAgentData
, t = e.brands || e.uaList;
return !(!t || !t.length)
}
function findVersion(e, t) {
var r = execRegExp("(" + e + ")((?:\\/|\\s|:)([0-9|\\.|_]+))", t);
return r ? r[3] : ""
}
function convertVersion(e) {
return e.replace(/_/g, ".")
}
function findPreset(e, t) {
var r = null
, n = "-1";
return some(e, (function(e) {
var i = execRegExp("(" + e.test + ")((?:\\/|\\s|:)([0-9|\\.|_]
+))?", t);
return !(!i || e.brand) && (r = e,
n = i[3] || "-1",
e.versionAlias ? n = e.versionAlias : e.versionTest && (n =
findVersion(e.versionTest.toLowerCase(), t) || n),
n = convertVersion(n),
!0)
}
)),
{
preset: r,
version: n
}
}
function findPresetBrand(e, t) {
var r = {
brand: "",
version: "-1"
};
return some(e, (function(e) {
var n = findBrand(t, e);
return !!n && (r.brand = e.id,
r.version = e.versionAlias || n.version,
"-1" !== r.version)
}
)),
r
}
function findBrand(e, t) {
return find$1(e, (function(e) {
var r = e.brand;
return execRegExp("" + t.test, r.toLowerCase())
}
))
}
var BROWSER_PRESETS = [{
test: "phantomjs",
id: "phantomjs"
}, {
test: "whale",
id: "whale"
}, {
test: "edgios|edge|edg",
id: "edge"
}, {
test: "msie|trident|windows phone",
id: "ie",
versionTest: "iemobile|msie|rv"
}, {
test: "miuibrowser",
id: "miui browser"
}, {
test: "samsungbrowser",
id: "samsung internet"
}, {
test: "samsung",
id: "samsung internet",
versionTest: "version"
}, {
test: "chrome|crios",
id: "chrome"
}, {
test: "firefox|fxios",
id: "firefox"
}, {
test: "android",
id: "android browser",
versionTest: "version"
}, {
test: "safari|iphone|ipad|ipod",
id: "safari",
versionTest: "version"
}]
, CHROMIUM_PRESETS = [{
test: "(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",
id: "chrome",
versionTest: "chrome"
}, {
test: "chromium",
id: "chrome"
}, {
test: "whale",
id: "chrome",
versionAlias: "-1",
brand: !0
}]
, WEBKIT_PRESETS = [{
test: "applewebkit",
id: "webkit",
versionTest: "applewebkit|safari"
}]
, WEBVIEW_PRESETS = [{
test: "(?=(iphone|ipad))(?!(.*version))",
id: "webview"
}, {
test: "(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",
id: "webview"
}, {
test: "webview",
id: "webview"
}]
, OS_PRESETS = [{
test: "windows phone",
id: "windows phone"
}, {
test: "windows 2000",
id: "window",
versionAlias: "5.0"
}, {
test: "windows nt",
id: "window"
}, {
test: "win32|windows",
id: "window"
}, {
test: "iphone|ipad|ipod",
id: "ios",
versionTest: "iphone os|cpu os"
}, {
test: "macos|macintel|mac os x",
id: "mac"
}, {
test: "android|linux armv81",
id: "android"
}, {
test: "tizen",
id: "tizen"
}, {
test: "webos|web0s",
id: "webos"
}];
function isWebView(e) {
return !!findPreset(WEBVIEW_PRESETS, e).preset
}
function getLegacyAgent(e) {
var t = getUserAgentString(e)
, r = !!/mobi/g.exec(t)
, n = {
name: "unknown",
version: "-1",
majorVersion: -1,
webview: isWebView(t),
chromium: !1,
chromiumVersion: "-1",
webkit: !1,
webkitVersion: "-1"
}
, i = {
name: "unknown",
version: "-1",
majorVersion: -1
}
,
o = findPreset(BROWSER_PRESETS, t)
,
s = o.preset
,
a = o.version
,
l = findPreset(OS_PRESETS, t)
,
c = l.preset
,
u = l.version
,
d = findPreset(CHROMIUM_PRESETS, t);
if (n.chromium = !!d.preset,
n.chromiumVersion = d.version,
!n.chromium) {
var p = findPreset(WEBKIT_PRESETS, t);
n.webkit = !!p.preset,
n.webkitVersion = p.version
}
return c && (i.name = c.id,
i.version = u,
i.majorVersion = parseInt(u, 10)),
s && (n.name = s.id,
n.version = a,
n.webview && "ios" === i.name && "safari" !== n.name && (n.webview = !
1)),
n.majorVersion = parseInt(n.version, 10),
{
browser: n,
os: i,
isMobile: r,
isHints: !1
}
}
function getClientHintsAgent(e) {
var t = navigator.userAgentData
, r = (t.uaList || t.brands).slice()
, n = e && e.fullVersionList
, i = t.mobile || !1
, o = r[0]
, s = (e && e.platform || t.platform ||
navigator.platform).toLowerCase()
, a = {
name: o.brand,
version: o.version,
majorVersion: -1,
webkit: !1,
webkitVersion: "-1",
chromium: !1,
chromiumVersion: "-1",
webview: !!findPresetBrand(WEBVIEW_PRESETS, r).brand ||
isWebView(getUserAgentString())
}
, l = {
name: "unknown",
version: "-1",
majorVersion: -1
};
a.webkit = !a.chromium && some(WEBKIT_PRESETS, (function(e) {
return findBrand(r, e)
}
));
var c = findPresetBrand(CHROMIUM_PRESETS, r);
if (a.chromium = !!c.brand,
a.chromiumVersion = c.version || "-1",
!a.chromium) {
var u = findPresetBrand(WEBKIT_PRESETS, r);
a.webkit = !!u.brand,
a.webkitVersion = u.version || "-1"
}
var d = find$1(OS_PRESETS, (function(e) {
return new RegExp("" + e.test,"g").exec(s)
}
));
if (l.name = d ? d.id : "",
e && (l.version = e.platformVersion || "-1"),
n && n.length) {
var p = findPresetBrand(BROWSER_PRESETS, n);
a.name = p.brand || a.name,
a.version = p.version || a.version
} else {
var h = findPresetBrand(BROWSER_PRESETS, r);
a.name = h.brand || a.name,
a.version = h.brand && e ? e.uaFullVersion : h.version
}
return a.webkit && (l.name = i ? "ios" : "mac"),
"ios" === l.name && a.webview && (a.version = "-1"),
l.version = convertVersion(l.version),
a.version = convertVersion(a.version),
l.majorVersion = parseInt(l.version, 10),
a.majorVersion = parseInt(a.version, 10),
{
browser: a,
os: l,
isMobile: i,
isHints: !0
}
}
function agent$1(e) {
return void 0 === e && hasUserAgentData() ? getClientHintsAgent() :
getLegacyAgent(e)
}
var __assign$3 = function() {
return __assign$3 = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$3.apply(this, arguments)
};
function __rest$10(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
function styled(e, t) {
var r = styled$1(t)
, n = r.className;
return reactExports.forwardRef((function(t, i) {
var o = t.className
, s = void 0 === o ? "" : o;
t.cspNonce;
var a = __rest$10(t, ["className", "cspNonce"])
, l = reactExports.useRef();
return reactExports.useImperativeHandle(i, (function() {
return l.current
}
), []),
reactExports.useEffect((function() {
var e = r.inject(l.current, {
nonce: t.cspNonce
});
return function() {
e.destroy()
}
}
), []),
reactExports.createElement(e, __assign$3({
ref: l,
"data-styled-id": n,
className: "".concat(s, " ").concat(n)
}, a))
}
))
}
var extendStatics$2 = function(e, t) {
return (extendStatics$2 = Object.setPrototypeOf || {
__proto__: []
}instanceof Array && function(e, t) {
e.__proto__ = t
}
|| function(e, t) {
for (var r in t)
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r])
}
)(e, t)
};
function __extends$2(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Class extends value " + String(t) + " is not a
constructor or null");
function r() {
this.constructor = e
}
extendStatics$2(e, t),
e.prototype = null === t ? Object.create(t) : (r.prototype =
t.prototype,
new r)
}
var __assign$2 = function() {
return __assign$2 = Object.assign || function(e) {
for (var t, r = 1, n = arguments.length; r < n; r++)
for (var i in t = arguments[r])
Object.prototype.hasOwnProperty.call(t, i) && (e[i] =
t[i]);
return e
}
,
__assign$2.apply(this, arguments)
};
function __rest$$(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
function __decorate(e, t, r, n) {
var i, o = arguments.length, s = o < 3 ? t : null === n ? n =
Object.getOwnPropertyDescriptor(t, r) : n;
if ("object" == typeof Reflect && "function" == typeof
Reflect.decorate)
s = Reflect.decorate(e, t, r, n);
else
for (var a = e.length - 1; a >= 0; a--)
(i = e[a]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, r, s) : i(t,
r)) || s);
return o > 3 && s && Object.defineProperty(t, r, s),
s
}
function __values(e) {
var t = "function" == typeof Symbol && Symbol.iterator
, r = t && e[t]
, n = 0;
if (r)
return r.call(e);
if (e && "number" == typeof e.length)
return {
next: function() {
return e && n >= e.length && (e = void 0),
{
value: e && e[n++],
done: !e
}
}
};
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is
not defined.")
}
function __read(e, t) {
var r = "function" == typeof Symbol && e[Symbol.iterator];
if (!r)
return e;
var n, i, o = r.call(e), s = [];
try {
for (; (void 0 === t || t-- > 0) && !(n = o.next()).done; )
s.push(n.value)
} catch (a) {
i = {
error: a
}
} finally {
try {
n && !n.done && (r = o.return) && r.call(o)
} finally {
if (i)
throw i.error
}
}
return s
}
function __spreadArray(e, t, r) {
if (r || 2 === arguments.length)
for (var n, i = 0, o = t.length; i < o; i++)
!n && i in t || (n || (n = Array.prototype.slice.call(t, 0,
i)),
n[i] = t[i]);
return e.concat(n || Array.prototype.slice.call(t))
}
function makeAble(e, t) {
return __assign$2({
events: [],
props: [],
name: e
}, t)
}
var DIRECTIONS4 = ["n", "w", "s", "e"]
, DIRECTIONS = ["n", "w", "s", "e", "nw", "ne", "sw", "se"];
function getSVGCursor(e, t) {
return 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"
width="'.concat(32 * e, 'px" height="').concat(32 * e, 'px" viewBox="0 0 32 32"
><path d="M 16,5 L 12,10 L 14.5,10 L 14.5,22 L 12,22 L 16,27 L 20,22 L 17.5,22 L
17.5,10 L 20, 10 L 16,5 Z" stroke-linejoin="round" stroke-width="1.2" fill="black"
stroke="white" style="transform:rotate(').concat(t, 'deg);transform-origin: 16px
16px"></path></svg>')
}
function getCursorCSS(e) {
var t = getSVGCursor(1, e)
, r = 45 * Math.round(e / 45) % 180
, n = "ns-resize";
return 135 === r ? n = "nwse-resize" : 45 === r ? n = "nesw-resize" :
90 === r && (n = "ew-resize"),
"cursor:".concat(n, ";cursor: url('").concat(t, "') 16 16, ").concat(n,
";")
}
var agent = agent$1(), IS_WEBKIT = agent.browser.webkit, IS_WEBKIT605 =
IS_WEBKIT && (navi = "undefined" == typeof window ? {
userAgent: ""
} : window.navigator,
res = /applewebkit\/([^\s]+)/g.exec(navi.userAgent.toLowerCase()),
!!res && parseFloat(res[1]) < 605), navi, res, browserName =
agent.browser.name, browserVersion = parseInt(agent.browser.version, 10), IS_CHROME
= "chrome" === browserName, IS_CHROMIUM = agent.browser.chromium, chromiumVersion =
parseInt(agent.browser.chromiumVersion, 10) || 0, IS_CHROMIUM109 = IS_CHROME &&
browserVersion >= 109 || IS_CHROMIUM && chromiumVersion >= 109, IS_FIREFOX =
"firefox" === browserName, IS_SAFARI_ABOVE15 =
parseInt(agent.browser.webkitVersion, 10) >= 612 || browserVersion >= 15, PREFIX$3
= "moveable-", directionCSS = DIRECTIONS.map((function(e) {
var t = ""
, r = ""
, n = "center"
, i = "center"
, o = "calc(var(--moveable-control-padding, 20) * -1px)";
return e.indexOf("n") > -1 && (t = "top: ".concat(o, ";"),
i = "bottom"),
e.indexOf("s") > -1 && (t = "top: 0px;",
i = "top"),
e.indexOf("w") > -1 && (r = "left: ".concat(o, ";"),
n = "right"),
e.indexOf("e") > -1 && (r = "left: 0px;",
n = "left"),
'.around-control[data-direction*="'.concat(e, '"] {\n
').concat(r).concat(t, "\n transform-origin: ").concat(n, " ").concat(i, ";\
n }")
}
)).join("\n"), MOVEABLE_CSS = "\n{\nposition: absolute;\nwidth: 1px;\
nheight: 1px;\nleft: 0;\ntop: 0;\nz-index: 3000;\n--moveable-color: #4af;\n--zoom:
1;\n--zoompx: 1px;\n--moveable-line-padding: 0;\n--moveable-control-padding: 0;\
nwill-change: transform;\noutline: 1px solid transparent;\n}\n.control-box {\nz-
index: 0;\n}\n.line, .control {\nposition: absolute;\nleft: 0;\ntop: 0;\nwill-
change: transform;\n}\n.control {\nwidth: 14px;\nheight: 14px;\nborder-radius:
50%;\nborder: 2px solid #fff;\nbox-sizing: border-box;\nbackground: #4af;\
nbackground: var(--moveable-color);\nmargin-top: -7px;\nmargin-left: -7px;\nborder:
2px solid #fff;\nz-index: 10;\n}\n.around-control {\nposition: absolute;\nwill-
change: transform;\nwidth: calc(var(--moveable-control-padding, 20) * 1px);\
nheight: calc(var(--moveable-control-padding, 20) * 1px);\nleft: calc(var(--
moveable-control-padding, 20) * -0.5px);\ntop: calc(var(--moveable-control-padding,
20) * -0.5px);\nbox-sizing: border-box;\nbackground: transparent;\nz-index: 8;\
ncursor: alias;\ntransform-origin: center center;\n}\n".concat(directionCSS, "\
n.padding {\nposition: absolute;\ntop: 0px;\nleft: 0px;\nwidth: 100px;\nheight:
100px;\ntransform-origin: 0 0;\n}\n.line {\nwidth: 1px;\nheight: 1px;\nbackground:
#4af;\nbackground: var(--moveable-color);\ntransform-origin: 0px 50%;\n}\
n.line.edge {\nz-index: 1;\nbackground: transparent;\n}\n.line.dashed {\nbox-
sizing: border-box;\nbackground: transparent;\n}\n.line.dashed.horizontal {\
nborder-top: 1px dashed #4af;\nborder-top-color: #4af;\nborder-top-color: var(--
moveable-color);\n}\n.line.dashed.vertical {\nborder-left: 1px dashed #4af;\
nborder-left-color: #4af;\nborder-left-color: var(--moveable-color);\n}\
n.line.vertical {\ntransform: translateX(-50%);\n}\n.line.horizontal {\ntransform:
translateY(-50%);\n}\n.line.vertical.bold {\nwidth: 2px;\n}\n.line.horizontal.bold
{\nheight: 2px;\n}\n\n.control.origin {\nborder-color: #f55;\nbackground: #fff;\
nwidth: 12px;\nheight: 12px;\nmargin-top: -6px;\nmargin-left: -6px;\npointer-
events: none;\n}\n").concat([0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150,
165].map((function(e) {
return '\n.direction[data-rotation="'.concat(e, '"], :global .view-
control-rotation').concat(e, " {\n").concat(getCursorCSS(e), "\n}\n")
}
)).join("\n"), '\n\n.line.direction:before {\ncontent: "";\nposition:
absolute;\nwidth: 100%;\nheight: calc(var(--moveable-line-padding, 0) * 1px);\
nbottom: 0;\nleft: 0;\n}\n.group {\nz-index: -1;\n}\n.area {\nposition: absolute;\
n}\n.area-pieces {\nposition: absolute;\ntop: 0;\nleft: 0;\ndisplay: none;\n}\
n.area.avoid, .area.pass {\npointer-events: none;\n}\n.area.avoid+.area-pieces {\
ndisplay: block;\n}\n.area-piece {\nposition: absolute;\n}\n\
n').concat(IS_WEBKIT605 ? ':global svg *:before {\ncontent:"";\ntransform-origin:
inherit;\n}' : "", "\n"), NEARBY_POS = [[0, 1, 2], [1, 0, 3], [2, 0, 3], [3, 1,
2]], FLOAT_POINT_NUM = 1e-4, TINY_NUM = 1e-7, MIN_SCALE = 1e-9, MAX_NUM =
Math.pow(10, 10), MIN_NUM = -MAX_NUM, DIRECTION_REGION_TO_DIRECTION = {
n: [0, -1],
e: [1, 0],
s: [0, 1],
w: [-1, 0],
nw: [-1, -1],
ne: [1, -1],
sw: [-1, 1],
se: [1, 1]
}, DIRECTION_INDEXES = {
n: [0, 1],
e: [1, 3],
s: [3, 2],
w: [2, 0],
nw: [0],
ne: [1],
sw: [2],
se: [3]
}, DIRECTION_ROTATIONS = {
n: 0,
s: 180,
w: 270,
e: 90,
nw: 315,
ne: 45,
sw: 225,
se: 135
}, MOVEABLE_METHODS = ["isMoveableElement", "updateRect", "updateTarget",
"destroy", "dragStart", "isInside", "hitTest", "setState", "getRect", "request",
"isDragging", "getManager", "forceUpdate", "waitToChangeTarget", "updateSelectors",
"getTargets", "stopDrag", "getControlBoxElement", "getMoveables",
"getDragElement"];
function setCustomDrag(e, t, r, n, i, o) {
var s, a;
void 0 === o && (o = "draggable");
var l = null !== (a = null === (s = t.gestos[o]) || void 0 === s ? void
0 : s.move(r, e.inputEvent)) && void 0 !== a ? a : {}
, c = l.originalDatas || l.datas
, u = c[o] || (c[o] = {});
return __assign$2(__assign$2({}, i ? convertDragDist(t, l) : l), {
isPinch: !!n,
parentEvent: !0,
datas: u,
originalDatas: e.originalDatas
})
}
var CustomGesto = function() {
function e(e) {
var t;
void 0 === e && (e = "draggable"),
this.ableName = e,
this.prevX = 0,
this.prevY = 0,
this.startX = 0,
this.startY = 0,
this.isDrag = !1,
this.isFlag = !1,
this.datas = {
draggable: {}
},
this.datas = ((t = {})[e] = {},
t)
}
return e.prototype.dragStart = function(e, t) {
this.isDrag = !1,
this.isFlag = !1;
var r = t.originalDatas;
return this.datas = r,
r[this.ableName] || (r[this.ableName] = {}),
__assign$2(__assign$2({}, this.move(e, t.inputEvent)), {
type: "dragstart"
})
}
,
e.prototype.drag = function(e, t) {
return this.move([e[0] - this.prevX, e[1] - this.prevY], t)
}
,
e.prototype.move = function(e, t) {
var r, n, i = !1;
if (this.isFlag) {
var o = this.isDrag;
r = this.prevX + e[0],
n = this.prevY + e[1],
(e[0] || e[1]) && (this.isDrag = !0),
!o && this.isDrag && (i = !0)
} else
this.prevX = e[0],
this.prevY = e[1],
this.startX = e[0],
this.startY = e[1],
r = e[0],
n = e[1],
this.isFlag = !0;
return this.prevX = r,
this.prevY = n,
{
type: "drag",
clientX: r,
clientY: n,
inputEvent: t,
isFirstDrag: i,
isDrag: this.isDrag,
distX: r - this.startX,
distY: n - this.startY,
deltaX: e[0],
deltaY: e[1],
datas: this.datas[this.ableName],
originalDatas: this.datas,
parentEvent: !0,
parentGesto: this
}
}
,
e
}();
function calculateElementPosition(e, t, r, n) {
var i = 16 === e.length ? 4 : 3
, o = __read(calculatePoses(e, r, n, i), 4)
, s = __read(o[0], 2)
, a = s[0]
, l = s[1]
, c = __read(o[1], 2)
, u = c[0]
, d = c[1]
, p = __read(o[2], 2)
, h = p[0]
, f = p[1]
, m = __read(o[3], 2)
, g = m[0]
, y = m[1]
, v = __read(calculatePosition(e, t, i), 2)
, b = v[0]
, x = v[1]
, _ = Math.min(a, u, h, g)
, E = Math.min(l, d, f, y)
, T = Math.max(a, u, h, g);
return a = a - _ || 0,
{
left: _,
top: E,
right: T,
bottom: Math.max(l, d, f, y),
origin: [b = b - _ || 0, x = x - E || 0],
pos1: [a, l = l - E || 0],
pos2: [u = u - _ || 0, d = d - E || 0],
pos3: [h = h - _ || 0, f = f - E || 0],
pos4: [g = g - _ || 0, y = y - E || 0],
direction: sign(e[0] * e[i + 1])
}
}
function calculatePointerDist(e, t) {
var r = t.clientX
, n = t.clientY
, i = t.datas
, o = e.state
, s = o.moveableClientRect
, a = o.rootMatrix
, l = o.is3d
, c = o.pos1
, u = __read(minus$1(calculateInversePosition(a, [r - s.left, n -
s.top], l ? 4 : 3), c), 2)
, d = __read(getDragDist({
datas: i,
distX: u[0],
distY: u[1]
}), 2);
return [d[0], d[1]]
}
function setDragStart(e, t) {
var r = t.datas
, n = e.state
, i = n.allMatrix
, o = n.beforeMatrix
, s = n.is3d
, a = n.left
, l = n.top
, c = n.origin
, u = n.offsetMatrix
, d = n.targetMatrix
, p = n.transformOrigin
, h = s ? 4 : 3;
r.is3d = s,
r.matrix = i,
r.targetMatrix = d,
r.beforeMatrix = o,
r.offsetMatrix = u,
r.transformOrigin = p,
r.inverseMatrix = invert(i, h),
r.inverseBeforeMatrix = invert(o, h),
r.absoluteOrigin = convertPositionMatrix(plus$1([a, l], c), h),
r.startDragBeforeDist = calculate(r.inverseBeforeMatrix,
r.absoluteOrigin, h),
r.startDragDist = calculate(r.inverseMatrix, r.absoluteOrigin, h)
}
function getTransformDirection(e) {
return calculateElementPosition(e.datas.beforeTransform, [50, 50], 100,
100).direction
}
function resolveTransformEvent(e, t, r) {
var n = t.datas
, i = t.originalDatas.beforeRenderable
, o = n.transformIndex
, s = i.nextTransforms
, a = s.length
, l = i.nextTransformAppendedIndexes
, c = -1;
-1 === o ? ("translate" === r ? c = 0 : "rotate" === r && (c =
findIndex$3(s, (function(e) {
return e.match(/scale\(/g)
}
))),
-1 === c && (c = s.length),
n.transformIndex = c) : c = find$2(l, (function(e) {
return e.index === o && e.functionName === r
}
)) ? o : o + l.filter((function(e) {
return e.index < o
}
)).length;
var u = convertTransformInfo(s, e.state, c)
, d = u.targetFunction
, p = "rotate" === r ? "rotateZ" : r;
n.beforeFunctionTexts = u.beforeFunctionTexts,
n.afterFunctionTexts = u.afterFunctionTexts,
n.beforeTransform = u.beforeFunctionMatrix,
n.beforeTransform2 = u.beforeFunctionMatrix2,
n.targetTansform = u.targetFunctionMatrix,
n.afterTransform = u.afterFunctionMatrix,
n.afterTransform2 = u.afterFunctionMatrix2,
n.targetAllTransform = u.allFunctionMatrix,
d.functionName === p ? (n.afterFunctionTexts.splice(0, 1),
n.isAppendTransform = !1) : a > c && (n.isAppendTransform = !0,
i.nextTransformAppendedIndexes = __spreadArray(__spreadArray([],
__read(l), !1), [{
functionName: r,
index: c,
isAppend: !0
}], !1))
}
function convertTransformFormat(e, t, r) {
return "".concat(e.beforeFunctionTexts.join(" "), "
").concat(e.isAppendTransform ? r : t, " ").concat(e.afterFunctionTexts.join(" "))
}
function getTransformDist(e) {
var t = e.datas
, r = __read(getBeforeDragDist({
datas: t,
distX: e.distX,
distY: e.distY
}), 2);
return calculate(getTransfromMatrix(t, fromTranslation([r[0], r[1]],
4)), convertPositionMatrix([0, 0, 0], 4), 4)
}
function getTransfromMatrix(e, t, r) {
var n = e.beforeTransform
, i = e.afterTransform
, o = e.beforeTransform2
, s = e.afterTransform2
, a = e.targetAllTransform
, l = r ? multiply(a, t, 4) : multiply(t, a, 4)
, c = multiply(invert(r ? o : n, 4), l, 4);
return multiply(c, invert(r ? s : i, 4), 4)
}
function getBeforeDragDist(e) {
var t = e.datas
, r = e.distX
, n = e.distY
, i = t.inverseBeforeMatrix
, o = t.is3d
, s = t.startDragBeforeDist
, a = o ? 4 : 3;
return minus$1(calculate(i, plus$1(t.absoluteOrigin, [r, n]), a), s)
}
function getDragDist(e, t) {
var r = e.datas
, n = e.distX
, i = e.distY
, o = r.inverseBeforeMatrix
, s = r.inverseMatrix
, a = r.is3d
, l = r.startDragBeforeDist
, c = r.startDragDist
, u = a ? 4 : 3;
return minus$1(calculate(t ? o : s, plus$1(r.absoluteOrigin, [n, i]),
u), t ? l : c)
}
function getInverseDragDist(e, t) {
var r = e.datas
, n = e.distX
, i = e.distY
, o = r.beforeMatrix
, s = r.matrix
, a = r.is3d
, l = r.startDragBeforeDist
, c = r.startDragDist
, u = r.absoluteOrigin
, d = a ? 4 : 3;
return minus$1(calculate(t ? o : s, plus$1(t ? l : c, [n, i]), d), u)
}
function calculateTransformOrigin(e, t, r, n, i, o) {
return void 0 === n && (n = t),
void 0 === i && (i = r),
void 0 === o && (o = [0, 0]),
e ? e.map((function(e, s) {
var a = splitUnit(e)
, l = a.value
, c = a.unit
, u = s ? i : n
, d = s ? r : t;
return "%" === e || isNaN(l) ? d * (u ? o[s] / u : 0) : "%" !== c ?
l : d * l / 100
}
)) : o
}
function getPosIndexesByDirection(e) {
var t = [];
return e[1] >= 0 && (e[0] >= 0 && t.push(3),
e[0] <= 0 && t.push(2)),
e[1] <= 0 && (e[0] >= 0 && t.push(1),
e[0] <= 0 && t.push(0)),
t
}
function getPosesByDirection(e, t) {
return getPosIndexesByDirection(t).map((function(t) {
return e[t]
}
))
}
function getPosByDirection(e, t) {
var r = (t[0] + 1) / 2
, n = (t[1] + 1) / 2
, i = [dot$1(e[0][0], e[1][0], r, 1 - r), dot$1(e[0][1], e[1][1], r,
1 - r)]
, o = [dot$1(e[2][0], e[3][0], r, 1 - r), dot$1(e[2][1], e[3][1], r,
1 - r)];
return [dot$1(i[0], o[0], n, 1 - n), dot$1(i[1], o[1], n, 1 - n)]
}
function getDist(e, t, r, n, i, o) {
var s = getPosByDirection(calculatePoses(t, r, n, i), o);
return [e[0] - s[0], e[1] - s[1]]
}
function getNextMatrix(e, t, r, n) {
return multiply(e, getAbsoluteMatrix(t, n, r), n)
}
function getNextTransformMatrix(e, t, r, n) {
var i, o = e.transformOrigin, s = e.offsetMatrix, a = e.is3d ? 4 : 3;
if (isString$3(r)) {
var l = t.beforeTransform
, c = t.afterTransform;
i = convertDimension(n ? parseMat(r) : multiply(multiply(l,
parseMat([r]), 4), c, 4), 4, a)
} else
i = r;
return getNextMatrix(s, i, o, a)
}
function scaleMatrix(e, t) {
var r = e.transformOrigin
, n = e.offsetMatrix
, i = e.is3d
, o = e.targetMatrix
, s = i ? 4 : 3;
return getNextMatrix(n, multiply(e.targetAllTransform || o,
createScaleMatrix(t, s), s), r, s)
}
function fillTransformStartEvent(e, t) {
var r = getBeforeRenderableDatas(t);
return {
setTransform: function(n, i) {
void 0 === i && (i = -1),
r.startTransforms = isArray$a(n) ? n : splitSpace(n),
setTransformIndex(e, t, i)
},
setTransformIndex: function(r) {
setTransformIndex(e, t, r)
}
}
}
function setDefaultTransformIndex(e, t, r) {
setTransformIndex(e, t,
findIndex$3(getBeforeRenderableDatas(t).startTransforms, (function(e) {
return 0 === e.indexOf("".concat(r, "("))
}
)))
}
function setTransformIndex(e, t, r) {
var n = getBeforeRenderableDatas(t)
, i = t.datas;
if (i.transformIndex = r,
-1 !== r) {
var o = n.startTransforms[r];
if (o) {
var s = e.state
, a = parse$1([o], {
"x%": function(e) {
return e / 100 * s.offsetWidth
},
"y%": function(e) {
return e / 100 * s.offsetHeight
}
});
i.startValue = a[0].functionValue
}
}
}
function fillOriginalTransform(e, t) {
getBeforeRenderableDatas(e).nextTransforms = splitSpace(t)
}
function getBeforeRenderableDatas(e) {
return e.originalDatas.beforeRenderable
}
function getNextTransforms(e) {
return e.originalDatas.beforeRenderable.nextTransforms
}
function getNextTransformText(e) {
return (getNextTransforms(e) || []).join(" ")
}
function getNextStyle(e) {
return getBeforeRenderableDatas(e).nextStyle
}
function fillTransformEvent(e, t, r, n, i) {
fillOriginalTransform(i, t);
var o = Draggable.drag(e, setCustomDrag(i, e.state, r, n, !1))
, s = o ? o.transform : t;
return __assign$2(__assign$2({
transform: t,
drag: o
}, fillCSSObject({
transform: s
}, i)), {
afterTransform: s
})
}
function getTranslateFixedPosition(e, t, r, n, i, o) {
return getDirectionOffset(e, r, n, getNextTransformMatrix(e.state, i,
t, o))
}
function getTranslateDist(e, t, r, n, i, o, s) {
var a = getTranslateFixedPosition(e, t, r, i, o, s)
, l = e.state
, c = l.left
, u = l.top
, d = e.props.groupable
, p = d ? c : 0
, h = d ? u : 0
, f = minus$1(n, a);
return minus$1(f, [p, h])
}
function getScaleDist(e, t, r, n, i, o, s) {
return getTranslateDist(e, t, r, n, i, o, s)
}
function getDirectionByPos(e, t, r) {
return [t ? e[0] / (t / 2) - 1 : 0, r ? e[1] / (r / 2) - 1 : 0]
}
function getDirectionOffset(e, t, r, n) {
void 0 === n && (n = e.state.allMatrix);
var i = e.state
, o = i.width
, s = i.height
, a = i.is3d ? 4 : 3;
return calculatePosition(n, [o / 2 * (1 + t[0]) + r[0], s / 2 * (1 +
t[1]) + r[1]], a)
}
function getRotateDist(e, t, r) {
var n = r.fixedDirection
, i = r.fixedPosition
, o = r.fixedOffset;
return getTranslateDist(e, "rotate(".concat(t, "deg)"), n, i, o, r)
}
function getResizeDist(e, t, r, n, i, o) {
var s = e.props.groupable
, a = e.state
, l = a.transformOrigin
, c = a.offsetMatrix
, u = a.is3d
, d = a.width
, p = a.height
, h = a.left
, f = a.top
, m = o.fixedDirection
, g = u ? 4 : 3
, y = s ? h : 0
, v = s ? f : 0;
return minus$1(getDist(n, getNextMatrix(c, o.nextTargetMatrix ||
a.targetMatrix, calculateTransformOrigin(i, t, r, d, p, l), g), t, r, g, m), [y,
v])
}
function getAbsolutePosition(e, t) {
return getPosByDirection(getAbsolutePosesByState(e.state), t)
}
function getGestoData(e, t) {
var r, n = e.targetGesto, i = e.controlGesto;
return (null == n ? void 0 : n.isFlag()) && (r = n.getEventData()[t]),
!r && (null == i ? void 0 : i.isFlag()) && (r = i.getEventData()[t]),
r || {}
}
function getShadowRoot(e) {
if (e && e.getRootNode) {
var t = e.getRootNode();
if (11 === t.nodeType)
return t
}
}
function getIndividualTransforms(e) {
var t = e("scale")
, r = e("rotate")
, n = e("translate")
, i = [];
return n && "0px" !== n && "none" !== n &&
i.push("translate(".concat(n.split(/\s+/).join(","), ")")),
r && "1" !== r && "none" !== r && i.push("rotate(".concat(r, ")")),
t && "1" !== t && "none" !== t && i.push("scale(".concat(t.split(/\
s+/).join(","), ")")),
i
}
function getMatrixStackInfo(e, t, r) {
for (var n, i, o, s = e, a = [], l = getDocumentElement(e) ||
getDocumentBody(e), c = !r && e === t || e === l, u = c, d = !1, p = 3, h = !1, f =
getOffsetInfo(t, t, !0).offsetParent, m = 1; s && !u; ) {
u = c;
var g = getCachedStyle(s)
, y = g("position")
, v = getElementTransform(s)
, b = "fixed" === y
, x = getIndividualTransforms(g)
, _ = convertCSStoMatrix(getTransformMatrix(v))
, E = void 0
, T = !1
, C = !1
, S = 0
, $ = 0
, w = 0
, P = 0
, R = {
hasTransform: !1,
fixedContainer: null
};
b && (h = !0,
f = (R = getPositionFixedInfo(s)).fixedContainer);
var k = _.length;
d || 16 !== k && !x.length || (d = !0,
p = 4,
convert3DMatrixes(a),
o && (o = convertDimension(o, 3, 4))),
d && 9 === k && (_ = convertDimension(_, 3, 4));
var A = getOffsetPosInfo(s, e)
, I = A.tagName
, O = A.hasOffset
, D = A.isSVG
, M = A.origin
, L = A.targetOrigin
, j = __read(A.offset, 2)
, F = j[0]
, N = j[1];
"svg" === I && o && (a.push({
type: "target",
target: s,
matrix: getSVGMatrix(s, p)
}),
a.push({
type: "offset",
target: s,
matrix: createIdentityMatrix(p)
}));
var B = parseFloat(g("zoom")) || 1;
if (b)
E = R.fixedContainer,
T = !0;
else {
var z = getOffsetInfo(s, t, !1, !0, g)
, U = z.offsetZoom;
if (E = z.offsetParent,
T = z.isEnd,
C = z.isStatic,
m *= U,
(z.isCustomElement || 1 !== U) && C)
F -= E.offsetLeft,
N -= E.offsetTop;
else if (IS_FIREFOX || IS_CHROMIUM109) {
if (z.parentSlotElement) {
for (var V = E, H = 0, G = 0; V && getShadowRoot(V); )
H += V.offsetLeft,
G += V.offsetTop,
V = V.offsetParent;
F -= H,
N -= G
}
}
}
if (!IS_WEBKIT || IS_SAFARI_ABOVE15 || !O || D || !C ||
"relative" !== y && "static" !== y || (F -= E.offsetLeft,
N -= E.offsetTop,
c = c || T),
b)
O && R.hasTransform && (w = E.clientLeft,
P = E.clientTop);
else if (O && f !== E && (S = E.clientLeft,
$ = E.clientTop),
O && E === l) {
var W = getBodyOffset(s, !1);
F += W[0],
N += W[1]
}
if (a.push({
type: "target",
target: s,
matrix: getAbsoluteMatrix(_, p, M)
}),
x.length && (a.push({
type: "offset",
target: s,
matrix: createIdentityMatrix(p)
}),
a.push({
type: "target",
target: s,
matrix: getAbsoluteMatrix(parseMat(x), p, M)
})),
O) {
var Y = s === e
, K = Y ? 0 : s.scrollLeft
, X = Y ? 0 : s.scrollTop;
a.push({
type: "offset",
target: s,
matrix: createOriginMatrix([F - K + S - w, N - X + $ - P],
p)
})
} else
a.push({
type: "offset",
target: s,
origin: M
});
if (1 !== B && a.push({
type: "zoom",
target: s,
matrix: getAbsoluteMatrix(createScaleMatrix([B, B], p), p, [0,
0])
}),
o || (o = _),
n || (n = M),
i || (i = L),
u || b)
break;
s = E,
c = T,
r && s !== l || (u = c)
}
return o || (o = createIdentityMatrix(p)),
n || (n = [0, 0]),
i || (i = [0, 0]),
{
zoom: m,
offsetContainer: f,
matrixes: a,
targetMatrix: o,
transformOrigin: n,
targetOrigin: i,
is3d: d,
hasFixed: h
}
}
var cacheStyleMap = null
, clientRectStyleMap = null
, matrixContainerInfos = null;
function setStoreCache(e) {
e ? (window.Map && (cacheStyleMap = new Map,
clientRectStyleMap = new Map),
matrixContainerInfos = []) : (cacheStyleMap = null,
matrixContainerInfos = null,
clientRectStyleMap = null)
}
function getCachedClientRect(e) {
var t = null == clientRectStyleMap ? void 0 :
clientRectStyleMap.get(e);
if (t)
return t;
var r = getClientRect$1(e, !0);
return clientRectStyleMap && clientRectStyleMap.set(e, r),
r
}
function getCachedMatrixContainerInfo(e, t) {
if (matrixContainerInfos) {
var r = find$2(matrixContainerInfos, (function(r) {
return r[0][0] == e && r[0][1] == t
}
));
if (r)
return r[1]
}
var n = getMatrixStackInfo(e, t, !0);
return matrixContainerInfos && matrixContainerInfos.push([[e, t], n]),
n
}
function getCachedStyle(e) {
var t = null == cacheStyleMap ? void 0 : cacheStyleMap.get(e);
if (!t) {
var r = getWindow$1(e).getComputedStyle(e);
if (!cacheStyleMap)
return function(e) {
return r[e]
}
;
t = {
style: r,
cached: {}
},
cacheStyleMap.set(e, t)
}
var n = t.cached
, i = t.style;
return function(e) {
return e in n || (n[e] = i[e]),
n[e]
}
}
function fillChildEvents(e, t, r) {
var n = r.originalDatas;
n.groupable = n.groupable || {};
var i = n.groupable;
i.childDatas = i.childDatas || [];
var o = i.childDatas;
return e.moveables.map((function(e, n) {
return o[n] = o[n] || {},
o[n][t] = o[n][t] || {},
__assign$2(__assign$2({}, r), {
isRequestChild: !0,
datas: o[n][t],
originalDatas: o[n]
})
}
))
}
function triggerChildGesto(e, t, r, n, i, o, s) {
var a = !!r.match(/Start$/g)
, l = !!r.match(/End$/g)
, c = i.isPinch
, u = i.datas
, d = fillChildEvents(e, t.name, i)
, p = e.moveables
, h = d.map((function(e, i) {
var d = p[i]
, h = d.state
, f = h.gestos
, m = e;
if (a)
m = new CustomGesto(s).dragStart(n, e);
else {
if (f[s] || (f[s] = u.childGestos[i]),
!f[s])
return;
m = setCustomDrag(e, h, n, c, o, s)
}
var g = t[r](d, __assign$2(__assign$2({}, m), {
parentFlag: !0
}));
return l && (f[s] = null),
g
}
));
return a && (u.childGestos = p.map((function(e) {
return e.state.gestos[s]
}
))),
h
}
function triggerChildAbles(e, t, r, n, i, o) {
void 0 === i && (i = function(e, t) {
return t
}
);
var s = !!r.match(/End$/g)
, a = fillChildEvents(e, t.name, n)
, l = e.moveables;
return a.map((function(e, n) {
var a, c = l[n];
a = i(c, e);
var u = t[r](c, __assign$2(__assign$2({}, a), {
parentFlag: !0
}));
return u && o && o(c, e, u, n),
s && (c.state.gestos = {}),
u
}
))
}
function startChildDist(e, t, r, n) {
var i = r.fixedDirection
, o = r.fixedPosition
, s = getPosByDirection(n.datas.startPositions ||
getAbsolutePosesByState(t.state), i)
, a = __read(calculate(createRotateMatrix(-e.rotation / 180 *
Math.PI, 3), [s[0] - o[0], s[1] - o[1], 1], 3), 2)
, l = a[0]
, c = a[1];
return n.datas.originalX = l,
n.datas.originalY = c,
n
}
function renderDirectionControlsByInfos(e, t, r, n) {
var i = e.getState()
, o = i.renderPoses
, s = i.rotation
, a = i.direction
, l = getProps(e.props, t).zoom
, c = absDegree(s / Math.PI * 180)
, u = {}
, d = e.renderState;
d.renderDirectionMap || (d.renderDirectionMap = {});
var p = d.renderDirectionMap;
r.forEach((function(e) {
var t = e.dir;
u[t] = !0
}
));
var h = sign(a);
return r.map((function(e) {
var r = e.data
, i = e.classNames
, a = e.dir
, d = DIRECTION_INDEXES[a];
if (!d || !u[a])
return null;
p[a] = !0;
var f = (throttle$4(c, 15) + h * DIRECTION_ROTATIONS[a] + 720) %
180
, m = {};
return getKeys(r).forEach((function(e) {
m["data-".concat(e)] = r[e]
}
)),
n.createElement("div", __assign$2({
className: prefix$7.apply(void 0, __spreadArray(["control",
"direction", a, t], __read(i), !1)),
"data-rotation": f,
"data-direction": a
}, m, {
key: "direction-".concat(a),
style: getControlTransform.apply(void 0, __spreadArray([s, l],
__read(d.map((function(e) {
return o[e]
}
))), !1))
}))
}
))
}
function renderDirectionControls(e, t, r, n) {
var i = getProps(e.props, r)
, o = i.renderDirections
, s = void 0 === o ? t : o
, a = i.displayAroundControls;
if (!s)
return [];
var l = !0 === s ? DIRECTIONS : s;
return __spreadArray(__spreadArray([], __read(a ?
renderAroundControls(e, n, r, l) : []), !1),
__read(renderDirectionControlsByInfos(e, r, l.map((function(e) {
return {
data: {},
classNames: [],
dir: e
}
}
)), n)), !1)
}
function renderLine(e, t, r, n, i, o) {
for (var s = [], a = 6; a < arguments.length; a++)
s[a - 6] = arguments[a];
var l = getRad$1(r, n)
, c = t ? throttle$4(l / Math.PI * 180, 15) % 180 : -1;
return e.createElement("div", {
key: "line-".concat(o),
className: prefix$7.apply(void 0, __spreadArray(["line",
"direction", t ? "edge" : "", t], __read(s), !1)),
"data-rotation": c,
"data-line-key": o,
"data-direction": t,
style: getLineStyle(r, n, i, l)
})
}
function renderEdgeLines(e, t, r, n, i) {
return (!0 === r ? DIRECTIONS4 : r).map((function(r, o) {
var s = __read(DIRECTION_INDEXES[r], 2)
, a = s[0]
, l = s[1];
if (null != l)
return renderLine(e, r, n[a], n[l], i, "".concat(t,
"Edge").concat(o), t)
}
)).filter(Boolean)
}
function getRenderDirections(e) {
return function(t, r) {
var n = getProps(t.props, e).edge;
return n && (!0 === n || n.length) ?
__spreadArray(__spreadArray([], __read(renderEdgeLines(r, e, n,
t.getState().renderPoses, t.props.zoom)), !1), __read(renderDiagonalDirections(t,
e, r)), !1) : renderAllDirections(t, e, r)
}
}
function renderAllDirections(e, t, r) {
return renderDirectionControls(e, DIRECTIONS, t, r)
}
function renderDiagonalDirections(e, t, r) {
return renderDirectionControls(e, ["nw", "ne", "sw", "se"], t, r)
}
function renderAroundControls(e, t, r, n) {
var i = e.renderState;
i.renderDirectionMap || (i.renderDirectionMap = {});
var o = e.getState()
, s = o.renderPoses
, a = o.rotation
, l = o.direction
, c = i.renderDirectionMap
, u = e.props.zoom
, d = sign(l)
, p = a / Math.PI * 180;
return (n || getKeys(c)).map((function(e) {
var n = DIRECTION_INDEXES[e];
if (!n)
return null;
var i = (throttle$4(p, 15) + d * DIRECTION_ROTATIONS[e] + 720) %
180
, o = ["around-control"];
return r && o.push("direction", r),
t.createElement("div", {
className: prefix$7.apply(void 0, __spreadArray([],
__read(o), !1)),
"data-rotation": i,
"data-direction": e,
key: "direction-around-".concat(e),
style: getControlTransform.apply(void 0, __spreadArray([a, u],
__read(n.map((function(e) {
return s[e]
}
))), !1))
})
}
))
}
function checkBoundPoses(e, t, r) {
var n = e || {}
, i = n.position
, o = void 0 === i ? "client" : i
, s = n.left
, a = void 0 === s ? -1 / 0 : s
, l = n.top
, c = void 0 === l ? -1 / 0 : l
, u = n.right
, d = void 0 === u ? 1 / 0 : u
, p = n.bottom
, h = {
position: o,
left: a,
top: c,
right: d,
bottom: void 0 === p ? 1 / 0 : p
};
return {
vertical: checkBounds(h, t, !0),
horizontal: checkBounds(h, r, !1)
}
}
function getBounds(e, t) {
var r = e.state
, n = r.containerClientRect
, i = n.clientHeight
, o = n.clientWidth
, s = n.clientLeft
, a = n.clientTop
, l = r.snapOffset
, c = l.left
, u = l.top
, d = l.right
, p = l.bottom
, h = t || e.props.bounds || {}
, f = "css" === (h.position || "client")
, m = h.left
, g = void 0 === m ? -1 / 0 : m
, y = h.top
, v = void 0 === y ? -1 / 0 : y
, b = h.right
, x = void 0 === b ? f ? -1 / 0 : 1 / 0 : b
, _ = h.bottom
, E = void 0 === _ ? f ? -1 / 0 : 1 / 0 : _;
return f && (x = o + d - c - x,
E = i + p - u - E),
{
left: g + c - s,
right: x + c - s,
top: v + u - a,
bottom: E + u - a
}
}
function checkBoundKeepRatio(e, t, r) {
var n = getBounds(e)
, i = n.left
, o = n.top
, s = n.right
, a = n.bottom
, l = __read(r, 2)
, c = l[0]
, u = l[1]
, d = __read(minus$1(r, t), 2)
, p = d[0]
, h = d[1];
abs(p) < TINY_NUM && (p = 0),
abs(h) < TINY_NUM && (h = 0);
var f = h > 0
, m = p > 0
, g = {
isBound: !1,
offset: 0,
pos: 0
}
, y = {
isBound: !1,
offset: 0,
pos: 0
};
if (0 === p && 0 === h)
return {
vertical: g,
horizontal: y
};
if (0 === p)
f ? a < u && (y.pos = a,
y.offset = u - a) : o > u && (y.pos = o,
y.offset = u - o);
else if (0 === h)
m ? s < c && (g.pos = s,
g.offset = c - s) : i > c && (g.pos = i,
g.offset = c - i);
else {
var v = h / p
, b = r[1] - v * c
, x = 0
, _ = 0
, E = !1;
m && s <= c ? (x = v * s + b,
_ = s,
E = !0) : !m && c <= i && (x = v * i + b,
_ = i,
E = !0),
E && (x < o || x > a) && (E = !1),
E || (f && a <= u ? (_ = ((x = a) - b) / v,
E = !0) : !f && u <= o && (_ = ((x = o) - b) / v,
E = !0)),
E && (g.isBound = !0,
g.pos = _,
g.offset = c - _,
y.isBound = !0,
y.pos = x,
y.offset = u - x)
}
return {
vertical: g,
horizontal: y
}
}
function checkBounds(e, t, r) {
var n = e[r ? "left" : "top"]
, i = e[r ? "right" : "bottom"]
, o = Math.min.apply(Math, __spreadArray([], __read(t), !1))
, s = Math.max.apply(Math, __spreadArray([], __read(t), !1))
, a = [];
return n + 1 > o && a.push({
direction: "start",
isBound: !0,
offset: o - n,
pos: n
}),
i - 1 < s && a.push({
direction: "end",
isBound: !0,
offset: s - i,
pos: i
}),
a.length || a.push({
isBound: !1,
offset: 0,
pos: 0
}),
a.sort((function(e, t) {
return abs(t.offset) - abs(e.offset)
}
))
}
function isBoundRotate$1(e, t, r) {
return (r ? e.map((function(e) {
return rotate(e, r)
}
)) : e).some((function(e) {
return e[0] < t.left && abs(e[0] - t.left) > .1 || e[0] > t.right
&& abs(e[0] - t.right) > .1 || e[1] < t.top && abs(e[1] - t.top) > .1 || e[1] >
t.bottom && abs(e[1] - t.bottom) > .1
}
))
}
function boundRotate(e, t, r) {
var n = getDistSize(e)
, i = Math.sqrt(n * n - t * t) || 0;
return [i, -i].sort((function(t, n) {
return abs(t - e[r ? 0 : 1]) - abs(n - e[r ? 0 : 1])
}
)).map((function(e) {
return getRad$1([0, 0], r ? [e, t] : [t, e])
}
))
}
function checkRotateBounds(e, t, r, n, i) {
if (!e.props.bounds)
return [];
var o = i * Math.PI / 180
, s = getBounds(e)
, a = s.left
, l = s.top
, c = s.right
, u = s.bottom
, d = a - n[0]
, p = c - n[0]
, h = l - n[1]
, f = u - n[1]
, m = {
left: d,
top: h,
right: p,
bottom: f
};
if (!isBoundRotate$1(r, m, 0))
return [];
var g = [];
return [[d, 0], [p, 0], [h, 1], [f, 1]].forEach((function(e) {
var n = __read(e, 2)
, i = n[0]
, s = n[1];
r.forEach((function(e) {
var r = getRad$1([0, 0], e);
g.push.apply(g, __spreadArray([], __read(boundRotate(e, i,
s).map((function(e) {
return o + e - r
}
)).filter((function(e) {
return !isBoundRotate$1(t, m, e)
}
)).map((function(e) {
return throttle$4(180 * e / Math.PI, TINY_NUM)
}
))), !1))
}
))
}
)),
g
}
var VERTICAL_NAMES = ["left", "right", "center"]
, HORIZONTAL_NAMES = ["top", "bottom", "middle"]
, SNAP_SKIP_NAMES_MAP = {
left: "start",
right: "end",
center: "center",
top: "start",
bottom: "end",
middle: "center"
}
, VERTICAL_NAMES_MAP = {
start: "left",
end: "right",
center: "center"
}
, HORIZONTAL_NAMES_MAP = {
start: "top",
end: "bottom",
center: "middle"
};
function getInitialBounds() {
return {
left: !1,
top: !1,
right: !1,
bottom: !1
}
}
function hasGuidelines(e, t) {
var r = e.props
, n = r.snappable
, i = r.bounds
, o = r.innerBounds
, s = r.verticalGuidelines
, a = r.horizontalGuidelines
, l = r.snapGridWidth
, c = r.snapGridHeight
, u = e.state
, d = u.guidelines
, p = u.enableSnap;
return !(!n || !p || t && !0 !== n && n.indexOf(t) < 0) && !!(l || c ||
i || o || d && d.length || s && s.length || a && a.length)
}
function getSnapDirections(e) {
return !1 === e ? {} : !0 !== e && e ? e : {
left: !0,
right: !0,
top: !0,
bottom: !0
}
}
function mapSnapDirectionPoses(e, t) {
var r = getSnapDirections(e)
, n = {};
for (var i in r)
i in t && r[i] && (n[i] = t[i]);
return n
}
function splitSnapDirectionPoses(e, t) {
var r = mapSnapDirectionPoses(e, t)
, n = HORIZONTAL_NAMES.filter((function(e) {
return e in r
}
))
, i = VERTICAL_NAMES.filter((function(e) {
return e in r
}
));
return {
horizontalNames: n,
verticalNames: i,
horizontal: n.map((function(e) {
return r[e]
}
)),
vertical: i.map((function(e) {
return r[e]
}
))
}
}
function calculateContainerPos(e, t, r) {
var n = calculatePosition(e, [t.clientLeft, t.clientTop], r);
return [t.left + n[0], t.top + n[1]]
}
function solveLineConstants(e) {
var t = __read(e, 2)
, r = t[0]
, n = t[1]
, i = n[0] - r[0]
, o = n[1] - r[1];
Math.abs(i) < TINY_NUM$1 && (i = 0),
Math.abs(o) < TINY_NUM$1 && (o = 0);
var s = 0
, a = 0
, l = 0;
return i ? o ? (a = 1,
l = (s = -o / i) * r[0] - r[1]) : (a = 1,
l = -r[1]) : (s = -1,
l = r[0]),
[s, a, l].map((function(e) {
return throttle$4(e, TINY_NUM$1)
}
))
}
function checkMoveableSnapPoses(e, t, r, n, i, o) {
void 0 === n && (n = []),
void 0 === i && (i = []);
var s = selectValue(o, e.props.snapThreshold, 5);
return checkSnapPoses(e.state.guidelines, t, r, n, i, s)
}
function checkSnapPoses(e, t, r, n, i, o) {
return {
vertical: checkSnap(e, "vertical", t, o, n),
horizontal: checkSnap(e, "horizontal", r, o, i)
}
}
function checkSnapKeepRatio(e, t, r) {
var n = __read(r, 2)
, i = n[0]
, o = n[1]
, s = __read(t, 2)
, a = s[0]
, l = s[1]
, c = __read(minus$1(r, t), 2)
, u = c[0]
, d = c[1]
, p = d > 0
, h = u > 0;
u = getTinyDist(u),
d = getTinyDist(d);
var f = {
isSnap: !1,
offset: 0,
pos: 0
}
, m = {
isSnap: !1,
offset: 0,
pos: 0
};
if (0 === u && 0 === d)
return {
vertical: f,
horizontal: m
};
var g = checkMoveableSnapPoses(e, u ? [i] : [], d ? [o] : [])
, y = g.vertical
, v = g.horizontal;
y.posInfos.filter((function(e) {
var t = e.pos;
return h ? t >= a : t <= a
}
)),
v.posInfos.filter((function(e) {
var t = e.pos;
return p ? t >= l : t <= l
}
)),
y.isSnap = y.posInfos.length > 0,
v.isSnap = v.posInfos.length > 0;
var b = getNearestSnapGuidelineInfo(y)
, x = b.isSnap
, _ = b.guideline
, E = getNearestSnapGuidelineInfo(v)
, T = E.isSnap
, C = E.guideline
, S = T ? C.pos[1] : 0
, $ = x ? _.pos[0] : 0;
if (0 === u)
T && (m.isSnap = !0,
m.pos = C.pos[1],
m.offset = o - m.pos);
else if (0 === d)
x && (f.isSnap = !0,
f.pos = $,
f.offset = i - $);
else {
var w = d / u
, P = r[1] - w * i
, R = 0
, k = 0
, A = !1;
x ? (R = w * (k = $) + P,
A = !0) : T && (k = ((R = S) - P) / w,
A = !0),
A && (f.isSnap = !0,
f.pos = k,
f.offset = i - k,
m.isSnap = !0,
m.pos = R,
m.offset = o - R)
}
return {
vertical: f,
horizontal: m
}
}
function getStringDirection(e) {
var t = "";
return -1 === e || "top" === e || "left" === e ? t = "start" : 0 === e
|| "center" === e || "middle" === e ? t = "center" : 1 !== e && "right" !== e &&
"bottom" !== e || (t = "end"),
t
}
function checkSnaps(e, t, r) {
var n = splitSnapDirectionPoses(e.props.snapDirections, t)
, i = checkMoveableSnapPoses(e, n.vertical, n.horizontal,
n.verticalNames.map((function(e) {
return getStringDirection(e)
}
)), n.horizontalNames.map((function(e) {
return getStringDirection(e)
}
)), r)
, o = getStringDirection(n.horizontalNames[i.horizontal.index])
, s = getStringDirection(n.verticalNames[i.vertical.index]);
return {
vertical: __assign$2(__assign$2({}, i.vertical), {
direction: s
}),
horizontal: __assign$2(__assign$2({}, i.horizontal), {
direction: o
})
}
}
function getNearestSnapGuidelineInfo(e) {
var t = e.isSnap;
if (!t)
return {
isSnap: !1,
offset: 0,
dist: -1,
pos: 0,
guideline: null
};
var r = e.posInfos[0]
, n = r.guidelineInfos[0]
, i = n.offset
, o = n.dist
, s = n.guideline;
return {
isSnap: t,
offset: i,
dist: o,
pos: r.pos,
guideline: s
}
}
function checkSnap(e, t, r, n, i) {
var o, s;
if (void 0 === i && (i = []),
!e || !e.length)
return {
isSnap: !1,
index: -1,
direction: "",
posInfos: []
};
var a = "vertical" === t ? 0 : 1
, l = r.map((function(r, o) {
var s = i[o] || ""
, l = e.map((function(e) {
var t = e.pos
, n = r - t[a];
return {
offset: n,
dist: abs(n),
guideline: e,
direction: s
}
}
)).filter((function(e) {
var r = e.guideline
, i = e.dist;
return !(r.type !== t || i > n)
}
)).sort((function(e, t) {
return e.dist - t.dist
}
));
return {
pos: r,
index: o,
guidelineInfos: l,
direction: s
}
}
)).filter((function(e) {
return e.guidelineInfos.length > 0
}
)).sort((function(e, t) {
return e.guidelineInfos[0].dist - t.guidelineInfos[0].dist
}
))
, c = l.length > 0;
return {
isSnap: c,
index: c ? l[0].index : -1,
direction: null !== (s = null === (o = l[0]) || void 0 === o ? void
0 : o.direction) && void 0 !== s ? s : "",
posInfos: l
}
}
function getSnapInfosByDirection(e, t, r, n) {
void 0 === n && (n = 1);
var i = [];
r[0] && r[1] ? i = [r, [-r[0], r[1]], [r[0], -r[1]]] : r[0] || r[1] ?
e.props.keepRatio ? i.push([-1, -1], [-1, 1], [1, -1], [1, 1], r) :
(i.push.apply(i, __spreadArray([], __read(getPosesByDirection([[-1, -1], [1, -1],
[-1, -1], [1, 1]], r)), !1)),
i.length > 1 && i.push([(i[0][0] + i[1][0]) / 2, (i[0][1] + i[1][1]) /
2])) : [[-1, -1], [1, -1], [1, 1], [-1, 1]].forEach((function(e, t, r) {
var n = r[t + 1] || r[0];
i.push(e),
i.push([(e[0] + n[0]) / 2, (e[1] + n[1]) / 2])
}
));
var o = i.map((function(e) {
return getPosByDirection(t, e)
}
))
, s = checkMoveableSnapPoses(e, o.map((function(e) {
return e[0]
}
)), o.map((function(e) {
return e[1]
}
)), i.map((function(e) {
return getStringDirection(e[0])
}
)), i.map((function(e) {
return getStringDirection(e[1])
}
)), n)
, a = getStringDirection(i.map((function(e) {
return e[0]
}
))[s.vertical.index])
, l = getStringDirection(i.map((function(e) {
return e[1]
}
))[s.horizontal.index]);
return {
vertical: __assign$2(__assign$2({}, s.vertical), {
direction: a
}),
horizontal: __assign$2(__assign$2({}, s.horizontal), {
direction: l
})
}
}
function checkSnapBoundPriority(e, t) {
var r = abs(e.offset)
, n = abs(t.offset);
return e.isBound && t.isBound ? n - r : e.isBound ? -1 : t.isBound ?
1 : e.isSnap && t.isSnap ? n - r : e.isSnap ? -1 : t.isSnap || r < TINY_NUM ? 1 : n
< TINY_NUM ? -1 : r - n
}
function getNearOffsetInfo(e, t) {
return e.slice().sort((function(e, r) {
var n = e.sign[t]
, i = r.sign[t]
, o = e.offset[t]
, s = r.offset[t];
return n ? i ? checkSnapBoundPriority({
isBound: e.isBound,
isSnap: e.isSnap,
offset: o
}, {
isBound: r.isBound,
isSnap: r.isSnap,
offset: s
}) : -1 : 1
}
))[0]
}
function getCheckSnapDirections(e, t, r) {
var n = [];
if (r)
1 !== abs(t[0]) || 1 !== abs(t[1]) ? n.push([t, [-1, -1]], [t, [-1,
1]], [t, [1, -1]], [t, [1, 1]]) : n.push([t, [e[0], -e[1]]], [t, [-e[0], e[1]]]),
n.push([t, e]);
else if (e[0] && e[1] || !e[0] && !e[1]) {
var i = e[0] ? e : [1, 1];
[1, -1].forEach((function(e) {
[1, -1].forEach((function(r) {
var o = [e * i[0], r * i[1]];
t[0] === o[0] && t[1] === o[1] || n.push([t, o])
}
))
}
))
} else if (e[0]) {
(1 === abs(t[0]) ? [1] : [1, -1]).forEach((function(r) {
n.push([[t[0], -1], [r * e[0], -1]], [[t[0], 0], [r * e[0],
0]], [[t[0], 1], [r * e[0], 1]])
}
))
} else if (e[1]) {
(1 === abs(t[1]) ? [1] : [1, -1]).forEach((function(r) {
n.push([[-1, t[1]], [-1, r * e[1]]], [[0, t[1]], [0, r *
e[1]]], [[1, t[1]], [1, r * e[1]]])
}
))
}
return n
}
function isStartLine(e, t) {
var r = average([t[0][0], t[1][0]])
, n = average([t[0][1], t[1][1]]);
return {
vertical: r <= e[0],
horizontal: n <= e[1]
}
}
function hitTestLine(e, t) {
var r, n, i = __read(t, 2), o = i[0], s = i[1], a = s[0] - o[0], l =
s[1] - o[1];
if (abs(a) < TINY_NUM && (a = 0),
abs(l) < TINY_NUM && (l = 0),
a)
if (l) {
r = l / a * (e[0] - o[0]) + o[1],
n = e[1]
} else
r = o[1],
n = e[1];
else
r = o[0],
n = e[0];
return r - n
}
function isSameStartLine(e, t, r, n) {
return void 0 === n && (n = TINY_NUM),
e.every((function(e) {
var i = hitTestLine(e, t);
return i <= 0 === r || abs(i) <= n
}
))
}
function checkInnerBoundDot(e, t, r, n, i) {
return void 0 === i && (i = 0),
n && t - i <= e || !n && e <= r + i ? {
isBound: !0,
offset: n ? t - e : r - e
} : {
isBound: !1,
offset: 0
}
}
function checkInnerBound(e, t) {
var r = t.line
, n = t.centerSign
, i = t.verticalSign
, o = t.horizontalSign
, s = t.lineConstants
, a = e.props.innerBounds;
if (!a)
return {
isAllBound: !1,
isBound: !1,
isVerticalBound: !1,
isHorizontalBound: !1,
offset: [0, 0]
};
var l = a.left
, c = a.top
, u = a.width
, d = a.height
, p = [[l, c], [l, c + d]]
, h = [[l, c], [l + u, c]]
, f = [[l + u, c], [l + u, c + d]]
, m = [[l, c + d], [l + u, c + d]];
if (isSameStartLine([[l, c], [l + u, c], [l, c + d], [l + u, c + d]],
r, n))
return {
isAllBound: !1,
isBound: !1,
isVerticalBound: !1,
isHorizontalBound: !1,
offset: [0, 0]
};
var g = checkLineBoundCollision(r, s, h, i)
, y = checkLineBoundCollision(r, s, m, i)
, v = checkLineBoundCollision(r, s, p, o)
, b = checkLineBoundCollision(r, s, f, o)
, x = g.isBound && y.isBound
, _ = g.isBound || y.isBound
, E = v.isBound && b.isBound
, T = v.isBound || b.isBound
, C = maxOffset(g.offset, y.offset)
, S = maxOffset(v.offset, b.offset)
, $ = [0, 0]
, w = !1
, P = !1;
return abs(S) < abs(C) ? ($ = [C, 0],
w = _,
P = x) : ($ = [0, S],
w = T,
P = E),
{
isAllBound: P,
isVerticalBound: _,
isHorizontalBound: T,
isBound: w,
offset: $
}
}
function checkLineBoundCollision(e, t, r, n, i, o) {
var s, a, l = __read(t, 2), c = l[0], u = l[1], d = e[0], p = r[0], h =
r[1], f = getTinyDist(h[1] - p[1]), m = u, g = c, y = -c / u;
return getTinyDist(h[0] - p[0]) ? f || o && !m ? {
isBound: !1,
offset: 0
} : g ? checkInnerBoundDot((p[1] - d[1]) / y + d[0], p[0], h[0], n,
i) : {
isBound: a = abs(s = p[1] - d[1]) <= (i || 0),
offset: a ? s : 0
} : o && !g ? {
isBound: !1,
offset: 0
} : m ? checkInnerBoundDot(y * (p[0] - d[0]) + d[1], p[1], h[1], n,
i) : {
isBound: a = abs(s = p[0] - d[0]) <= (i || 0),
offset: a ? s : 0
}
}
function getInnerBoundInfo(e, t, r) {
return t.map((function(t) {
var n = checkInnerBound(e, t)
, i = n.isBound
, o = n.offset
, s = n.isVerticalBound
, a = n.isHorizontalBound
, l = t.multiple
, c = getDragDist({
datas: r,
distX: o[0],
distY: o[1]
}).map((function(e, t) {
return e * (l[t] ? 2 / l[t] : 0)
}
));
return {
sign: l,
isBound: i,
isVerticalBound: s,
isHorizontalBound: a,
isSnap: !1,
offset: c
}
}
))
}
function getInnerBoundDragInfo(e, t, r) {
var n, i = getInnerBoundInfo(e, getCheckInnerBoundLineInfos(e, t, [0,
0], !1).map((function(e) {
return __assign$2(__assign$2({}, e), {
multiple: e.multiple.map((function(e) {
return 2 * abs(e)
}
))
})
}
)), r), o = getNearOffsetInfo(i, 0), s = getNearOffsetInfo(i, 1), a =
0, l = 0, c = o.isVerticalBound || s.isVerticalBound, u = o.isHorizontalBound ||
s.isHorizontalBound;
return (c || u) && (a = (n = __read(getInverseDragDist({
datas: r,
distX: -o.offset[0],
distY: -s.offset[1]
}), 2))[0],
l = n[1]),
{
vertical: {
isBound: c,
offset: a
},
horizontal: {
isBound: u,
offset: l
}
}
}
function getCheckSnapLineDirections(e, t) {
var r = []
, n = e[0]
, i = e[1];
return n && i ? r.push([[0, 2 * i], e, [-n, i]], [[2 * n, 0], e, [n, -
i]]) : n ? (r.push([[2 * n, 0], [n, 1], [n, -1]]),
t && r.push([[0, -1], [n, -1], [-n, -1]], [[0, 1], [n, 1], [-n, 1]])) :
i ? (r.push([[0, 2 * i], [1, i], [-1, i]]),
t && r.push([[-1, 0], [-1, i], [-1, -i]], [[1, 0], [1, i], [1, -i]])) :
r.push([[-1, 0], [-1, -1], [-1, 1]], [[1, 0], [1, -1], [1, 1]], [[0, -1], [-1, -1],
[1, -1]], [[0, 1], [-1, 1], [1, 1]]),
r
}
function getCheckInnerBoundLineInfos(e, t, r, n) {
var i = e.state
, o = calculatePoses(i.allMatrix, 100, 100, i.is3d ? 4 : 3)
, s = getPosByDirection(o, [0, 0]);
return getCheckSnapLineDirections(r, n).map((function(e) {
var r = __read(e, 3)
, n = r[0]
, i = r[1]
, a = r[2]
, l = [getPosByDirection(o, i), getPosByDirection(o, a)]
, c = solveLineConstants(l)
, u = isStartLine(s, l)
, d = u.vertical
, p = u.horizontal;
return {
multiple: n,
centerSign: hitTestLine(s, l) <= 0,
verticalSign: d,
horizontalSign: p,
lineConstants: c,
line: [getPosByDirection(t, i), getPosByDirection(t, a)]
}
}
))
}
function isBoundRotate(e, t, r, n) {
var i = n ? e.map((function(e) {
return rotate(e, n)
}
)) : e;
return [[i[0], i[1]], [i[1], i[3]], [i[3], i[2]], [i[2],
i[0]]].some((function(e) {
var n = hitTestLine(r, e) <= 0;
return !isSameStartLine(t, e, n)
}
))
}
function getDistPointLine(e) {
var t = __read(e, 2)
, r = t[0]
, n = t[1]
, i = n[0] - r[0]
, o = n[1] - r[1];
if (!i)
return abs(r[0]);
if (!o)
return abs(r[1]);
var s = o / i;
return abs((-s * r[0] + r[1]) / Math.sqrt(Math.pow(s, 2) + 1))
}
function solveReverseLine(e) {
var t = __read(e, 2)
, r = t[0]
, n = t[1]
, i = n[0] - r[0]
, o = n[1] - r[1];
if (!i)
return [r[0], 0];
if (!o)
return [0, r[1]];
var s = o / i
, a = -s * r[0] + r[1];
return [-a / (s + 1 / s), a / (s * s + 1)]
}
function checkRotateInnerBounds(e, t, r, n, i) {
var o = e.props.innerBounds
, s = i * Math.PI / 180;
if (!o)
return [];
var a = o.left
, l = o.top
, c = o.width
, u = o.height
, d = a - n[0]
, p = a + c - n[0]
, h = l - n[1]
, f = l + u - n[1]
, m = [[d, h], [p, h], [d, f], [p, f]]
, g = getPosByDirection(r, [0, 0]);
if (!isBoundRotate(r, m, g, 0))
return [];
var y = []
, v = m.map((function(e) {
return [getDistSize(e), getRad$1([0, 0], e)]
}
));
return [[r[0], r[1]], [r[1], r[3]], [r[3], r[2]], [r[2],
r[0]]].forEach((function(e) {
var r = getRad$1([0, 0], solveReverseLine(e))
, n = getDistPointLine(e);
y.push.apply(y, __spreadArray([], __read(v.filter((function(e) {
var t = __read(e, 1)[0];
return t && n <= t
}
)).map((function(e) {
var t = __read(e, 2)
, i = t[0]
, o = t[1]
, a = Math.acos(i ? n / i : 0);
return [s + (o + a) - r, s + (o - a) - r]
}
)).reduce((function(e, t) {
return e.push.apply(e, __spreadArray([], __read(t), !1)),
e
}
), []).filter((function(e) {
return !isBoundRotate(t, m, g, e)
}
)).map((function(e) {
return throttle$4(180 * e / Math.PI, TINY_NUM)
}
))), !1))
}
)),
y
}
function checkInnerBoundPoses(e) {
var t = e.props.innerBounds
, r = getInitialBounds();
if (!t)
return {
boundMap: r,
vertical: [],
horizontal: []
};
var n = e.getRect()
, i = [n.pos1, n.pos2, n.pos3, n.pos4]
, o = getPosByDirection(i, [0, 0])
, s = t.left
, a = t.top
, l = t.width
, c = t.height
, u = [[s, a], [s, a + c]]
, d = [[s, a], [s + l, a]]
, p = [[s + l, a], [s + l, a + c]]
, h = [[s, a + c], [s + l, a + c]]
, f = getCheckInnerBoundLineInfos(e, i, [0, 0], !1)
, m = []
, g = [];
return f.forEach((function(e) {
var t = e.line
, n = e.lineConstants
, i = isStartLine(o, t)
, f = i.horizontal
, y = i.vertical
, v = checkLineBoundCollision(t, n, d, y, 1, !0)
, b = checkLineBoundCollision(t, n, h, y, 1, !0)
, x = checkLineBoundCollision(t, n, u, f, 1, !0)
, _ = checkLineBoundCollision(t, n, p, f, 1, !0);
v.isBound && !r.top && (m.push(a),
r.top = !0),
b.isBound && !r.bottom && (m.push(a + c),
r.bottom = !0),
x.isBound && !r.left && (g.push(s),
r.left = !0),
_.isBound && !r.right && (g.push(s + l),
r.right = !0)
}
)),
{
boundMap: r,
horizontal: m,
vertical: g
}
}
function solveEquation(e, t, r, n) {
var i = t[0] - e[0]
, o = t[1] - e[1];
if (abs(i) < TINY_NUM$1 && (i = 0),
abs(o) < TINY_NUM$1 && (o = 0),
!i)
return n ? [0, 0] : [0, r];
if (!o)
return n ? [r, 0] : [0, 0];
var s = o / i
, a = e[1] - s * e[0];
return n ? [r, s * (t[0] + r) + a - t[1]] : [(t[1] + r - a) / s - t[0],
r]
}
function solveNextOffset(e, t, r, n, i) {
var o = solveEquation(e, t, r, n);
if (!o)
return {
isOutside: !1,
offset: [0, 0]
};
var s = getDist$2(e, t)
, a = getDist$2(o, e)
, l = getDist$2(o, t)
, c = a > s || l > s
, u = __read(getDragDist({
datas: i,
distX: o[0],
distY: o[1]
}), 2);
return {
offset: [u[0], u[1]],
isOutside: c
}
}
function getSnapBound(e, t) {
return e.isBound ? e.offset : t.isSnap ?
getNearestSnapGuidelineInfo(t).offset : 0
}
function checkThrottleDragRotate(e, t, r, n, i) {
var o = __read(t, 2)
, s = o[0]
, a = o[1]
, l = __read(r, 2)
, c = l[0]
, u = l[1]
, d = __read(n, 2)
, p = d[0]
, h = d[1]
, f = __read(i, 2)
, m = f[0]
, g = f[1]
, y = -m
, v = -g;
if (e && s && a) {
y = 0,
v = 0;
var b = [];
if (c && u ? b.push([0, g], [m, 0]) : c ? b.push([m, 0]) : u ?
b.push([0, g]) : p && h ? b.push([0, g], [m, 0]) : p ? b.push([m, 0]) : h &&
b.push([0, g]),
b.length) {
b.sort((function(e, t) {
return getDistSize(minus$1([s, a], e)) -
getDistSize(minus$1([s, a], t))
}
));
var x = b[0];
if (x[0] && abs(s) > TINY_NUM$1)
y = -x[0],
v = a * abs(s + y) / abs(s) - a;
else if (x[1] && abs(a) > TINY_NUM$1) {
var _ = a;
v = -x[1],
y = s * abs(a + v) / abs(_) - s
}
if (e && u && c)
if (abs(y) > TINY_NUM$1 && abs(y) < abs(m))
y *= E = abs(m) / abs(y),
v *= E;
else if (abs(v) > TINY_NUM$1 && abs(v) < abs(g)) {
var E;
y *= E = abs(g) / abs(v),
v *= E
} else
y = maxOffset(-m, y),
v = maxOffset(-g, v)
}
} else
y = s || c ? -m : 0,
v = a || u ? -g : 0;
return [y, v]
}
function checkSnapBoundsDrag(e, t, r, n, i, o) {
if (!hasGuidelines(e, "draggable"))
return [{
isSnap: !1,
isBound: !1,
offset: 0
}, {
isSnap: !1,
isBound: !1,
offset: 0
}];
var s = getAbsolutePoses(o.absolutePoses, [t, r])
, a = getRect(s)
, l = a.left
, c = a.right
, u = a.top
, d = a.bottom
, p = {
horizontal: s.map((function(e) {
return e[1]
}
)),
vertical: s.map((function(e) {
return e[0]
}
))
}
, h = checkMoveableSnapBounds(e, i,
splitSnapDirectionPoses(getSnapDirections(e.props.snapDirections), {
left: l,
right: c,
top: u,
bottom: d,
center: (l + c) / 2,
middle: (u + d) / 2
}), p)
, f = h.vertical
, m = h.horizontal
, g = getInnerBoundDragInfo(e, s, o)
, y = g.vertical
, v = g.horizontal
, b = f.isSnap
, x = m.isSnap
, _ = f.isBound || y.isBound
, E = m.isBound || v.isBound
, T = __read(checkThrottleDragRotate(n, [t, r], [_, E], [b, x],
[maxOffset(f.offset, y.offset), maxOffset(m.offset, v.offset)]), 2);
return [{
isBound: _,
isSnap: b,
offset: T[0]
}, {
isBound: E,
isSnap: x,
offset: T[1]
}]
}
function checkMoveableSnapBounds(e, t, r, n) {
void 0 === n && (n = r);
var i = checkBoundPoses(getBounds(e), n.vertical, n.horizontal)
, o = i.horizontal
, s = i.vertical
, a = t ? {
horizontal: {
isSnap: !1,
index: -1
},
vertical: {
isSnap: !1,
index: -1
}
} : checkMoveableSnapPoses(e, r.vertical, r.horizontal)
, l = a.horizontal
, c = a.vertical
, u = getSnapBound(o[0], l)
, d = getSnapBound(s[0], c)
, p = abs(u)
, h = abs(d);
return {
horizontal: {
isBound: o[0].isBound,
isSnap: l.isSnap,
snapIndex: l.index,
offset: u,
dist: p,
bounds: o,
snap: l
},
vertical: {
isBound: s[0].isBound,
isSnap: c.isSnap,
snapIndex: c.index,
offset: d,
dist: h,
bounds: s,
snap: c
}
}
}
function checkSnapBounds(e, t, r, n, i) {
var o = checkBoundPoses(t, r, n)
, s = o.horizontal
, a = o.vertical
, l = checkSnapPoses(e, r, n, [], [], i)
, c = l.horizontal
, u = l.vertical
, d = getSnapBound(s[0], c)
, p = getSnapBound(a[0], u)
, h = abs(d)
, f = abs(p);
return {
horizontal: {
isBound: s[0].isBound,
isSnap: c.isSnap,
snapIndex: c.index,
offset: d,
dist: h,
bounds: s,
snap: c
},
vertical: {
isBound: a[0].isBound,
isSnap: u.isSnap,
snapIndex: u.index,
offset: p,
dist: f,
bounds: a,
snap: u
}
}
}
function checkSnapRightLine(e, t, r, n) {
var i = getRad$1(e, t) / Math.PI * 180
, o = r.vertical
, s = o.isBound
, a = o.isSnap
, l = o.dist
, c = r.horizontal
, u = c.isBound
, d = c.isSnap
, p = i % 180
, h = p < 3 || p > 177
, f = p > 87 && p < 93;
return c.dist < l && (s || a && !f && (!n || !h)) ? "vertical" : !u &&
(!d || h || n && f) ? "" : "horizontal"
}
function getSnapBoundInfo(e, t, r, n, i, o) {
return r.map((function(r) {
var s = __read(r, 2)
, a = s[0]
, l = s[1]
, c = getPosByDirection(t, a)
, u = getPosByDirection(t, l)
, d = n ? checkSnapBoundsKeepRatio(e, c, u, i) :
checkMoveableSnapBounds(e, i, {
vertical: [u[0]],
horizontal: [u[1]]
})
, p = d.horizontal
, h = p.offset
, f = p.isBound
, m = p.isSnap
, g = d.vertical
, y = g.offset
, v = g.isBound
, b = g.isSnap
, x = minus$1(l, a);
if (!y && !h)
return {
isBound: v || f,
isSnap: b || m,
sign: x,
offset: [0, 0]
};
var _ = checkSnapRightLine(c, u, d, n);
if (!_)
return {
sign: x,
isBound: !1,
isSnap: !1,
offset: [0, 0]
};
var E = "vertical" === _
, T = [0, 0];
return T = (T = n || 1 !== abs(l[0]) || 1 !== abs(l[1]) || a[0] ===
l[0] || a[1] === l[1] ? solveNextOffset(c, u, -(E ? y : h), E, o).offset :
getDragDist({
datas: o,
distX: -y,
distY: -h
})).map((function(e, t) {
return e * (x[t] ? 2 / x[t] : 0)
}
)),
{
sign: x,
isBound: E ? v : f,
isSnap: E ? b : m,
offset: T
}
}
))
}
function getSnapBoundOffset(e, t) {
return e.isBound ? e.offset : t.isSnap ? t.offset : 0
}
function checkSnapBoundsKeepRatio(e, t, r, n) {
var i = checkBoundKeepRatio(e, t, r)
, o = i.horizontal
, s = i.vertical
, a = n ? {
horizontal: {
isSnap: !1
},
vertical: {
isSnap: !1
}
} : checkSnapKeepRatio(e, t, r)
, l = a.horizontal
, c = a.vertical
, u = getSnapBoundOffset(o, l)
, d = getSnapBoundOffset(s, c)
, p = abs(u)
, h = abs(d);
return {
horizontal: {
isBound: o.isBound,
isSnap: l.isSnap,
offset: u,
dist: p
},
vertical: {
isBound: s.isBound,
isSnap: c.isSnap,
offset: d,
dist: h
}
}
}
function checkMaxBounds(e, t, r, n, i) {
var o = [-r[0], -r[1]]
, s = e.state
, a = s.width
, l = s.height
, c = e.props.bounds
, u = 1 / 0
, d = 1 / 0;
if (c) {
var p = [[r[0], -r[1]], [-r[0], r[1]]]
, h = c.left
, f = void 0 === h ? -1 / 0 : h
, m = c.top
, g = void 0 === m ? -1 / 0 : m
, y = c.right
, v = void 0 === y ? 1 / 0 : y
, b = c.bottom
, x = void 0 === b ? 1 / 0 : b;
p.forEach((function(e) {
var r = e[0] !== o[0]
, s = e[1] !== o[1]
, c = getPosByDirection(t, e)
, p = 360 * getRad$1(n, c) / Math.PI;
if (s) {
var h = c.slice();
(abs(p - 360) < 2 || abs(p - 180) < 2) && (h[1] = n[1]);
var m = solveNextOffset(n, h, (n[1] < c[1] ? x : g) - c[1],
!1, i)
, y = __read(m.offset, 2)[1]
, b = m.isOutside;
isNaN(y) || (d = l + (b ? 1 : -1) * abs(y))
}
if (r) {
h = c.slice();
(abs(p - 90) < 2 || abs(p - 270) < 2) && (h[0] = n[0]);
var _ = solveNextOffset(n, h, (n[0] < c[0] ? v : f) - c[0],
!0, i)
, E = __read(_.offset, 1)[0]
, T = _.isOutside;
isNaN(E) || (u = a + (T ? 1 : -1) * abs(E))
}
}
))
}
return {
maxWidth: u,
maxHeight: d
}
}
var Draggable = {
name: "draggable",
props: ["draggable", "throttleDrag", "throttleDragRotate",
"hideThrottleDragRotateLine", "startDragRotate", "edgeDraggable"],
events: ["dragStart", "drag", "dragEnd", "dragGroupStart", "dragGroup",
"dragGroupEnd"],
requestStyle: function() {
return ["left", "top", "right", "bottom"]
},
requestChildStyle: function() {
return ["left", "top", "right", "bottom"]
},
render: function(e, t) {
var r = e.props
, n = r.hideThrottleDragRotateLine
, i = r.throttleDragRotate
, o = r.zoom
, s = e.getState()
, a = s.dragInfo
, l = s.beforeOrigin;
if (n || !i || !a)
return [];
var c = a.dist;
if (!c[0] && !c[1])
return [];
var u = getDistSize(c)
, d = getRad$1(c, [0, 0]);
return [t.createElement("div", {
className: prefix$7("line", "horizontal", "dragline",
"dashed"),
key: "dragRotateGuideline",
style: {
width: "".concat(u, "px"),
transform: "translate(".concat(l[0], "px, ").concat(l[1],
"px) rotate(").concat(d, "rad) scaleY(").concat(o, ")")
}
})]
},
dragStart: function(e, t) {
var r = t.datas
, n = t.parentEvent
, i = t.parentGesto
, o = e.state
, s = o.gestos
, a = o.style;
if (s.draggable)
return !1;
s.draggable = i || e.targetGesto,
r.datas = {},
r.left = parseFloat(a.left || "") || 0,
r.top = parseFloat(a.top || "") || 0,
r.bottom = parseFloat(a.bottom || "") || 0,
r.right = parseFloat(a.right || "") || 0,
r.startValue = [0, 0],
setDragStart(e, t),
setDefaultTransformIndex(e, t, "translate"),
startCheckSnapDrag(e, r),
r.prevDist = [0, 0],
r.prevBeforeDist = [0, 0],
r.isDrag = !1,
r.deltaOffset = [0, 0];
var l = fillParams(e, t, __assign$2({
set: function(e) {
r.startValue = e
}
}, fillTransformStartEvent(e, t)));
return !1 !== (n || triggerEvent(e, "onDragStart", l)) ? (r.isDrag
= !0,
e.state.dragInfo = {
startRect: e.getRect(),
dist: [0, 0]
}) : (s.draggable = null,
r.isPinch = !1),
!!r.isDrag && l
},
drag: function(e, t) {
if (t) {
resolveTransformEvent(e, t, "translate");
var r = t.datas
, n = t.parentEvent
, i = t.parentFlag
, o = t.isPinch
, s = t.deltaOffset
, a = t.useSnap
, l = t.isRequest
, c = t.distX
, u = t.distY
, d = r.isDrag
, p = r.prevDist
, h = r.prevBeforeDist
, f = r.startValue;
if (d) {
s && (c += s[0],
u += s[1]);
var m = e.props
, g = m.parentMoveable
, y = n ? 0 : m.throttleDrag || 0
, v = n ? 0 : m.throttleDragRotate || 0
, b = 0
, x = !1
, _ = !1
, E = !1
, T = !1;
if (!n && v > 0 && (c || u)) {
var C = m.startDragRotate || 0
, S = throttle$4(C + 180 * getRad$1([0, 0], [c, u]) /
Math.PI, v) - C
, $ = u * Math.abs(Math.cos((S - 90) / 180 *
Math.PI))
, w = getDistSize([c * Math.abs(Math.cos(S / 180 *
Math.PI)), $]);
b = S * Math.PI / 180,
c = w * Math.cos(b),
u = w * Math.sin(b)
}
if (!o && !n && !i) {
var P = __read(checkSnapBoundsDrag(e, c, u, v, !a && l
|| s, r), 2)
, R = P[0]
, k = P[1];
x = R.isSnap,
_ = R.isBound,
E = k.isSnap,
T = k.isBound,
c += R.offset,
u += k.offset
}
var A = plus$1(getBeforeDragDist({
datas: r,
distX: c,
distY: u
}), f)
, I = plus$1(getTransformDist({
datas: r,
distX: c,
distY: u
}), f);
throttleArray(I, TINY_NUM),
throttleArray(A, TINY_NUM),
v || (x || _ || (I[0] = throttle$4(I[0], y),
A[0] = throttle$4(A[0], y)),
E || T || (I[1] = throttle$4(I[1], y),
A[1] = throttle$4(A[1], y)));
var O = minus$1(A, f)
, D = minus$1(I, f)
, M = minus$1(D, p)
, L = minus$1(O, h);
r.prevDist = D,
r.prevBeforeDist = O,
r.passDelta = M,
r.passDist = D;
var j = r.left + O[0]
, F = r.top + O[1]
, N = r.right - O[0]
, B = r.bottom - O[1]
, z = convertTransformFormat(r, "translate(".concat(I[0],
"px, ").concat(I[1], "px)"), "translate(".concat(D[0], "px, ").concat(D[1],
"px)"));
if (fillOriginalTransform(t, z),
e.state.dragInfo.dist = n ? [0, 0] : D,
n || g || !M.every((function(e) {
return !e
}
)) || !L.some((function(e) {
return !e
}
))) {
var U = e.state
, V = U.width
, H = U.height
, G = fillParams(e, t, __assign$2({
transform: z,
dist: D,
delta: M,
translate: I,
beforeDist: O,
beforeDelta: L,
beforeTranslate: A,
left: j,
top: F,
right: N,
bottom: B,
width: V,
height: H,
isPinch: o
}, fillCSSObject({
transform: z
}, t)));
return !n && triggerEvent(e, "onDrag", G),
G
}
}
}
},
dragAfter: function(e, t) {
var r = t.datas
, n = r.deltaOffset;
return !(!n[0] && !n[1]) && (r.deltaOffset = [0, 0],
this.drag(e, __assign$2(__assign$2({}, t), {
deltaOffset: n
})))
},
dragEnd: function(e, t) {
var r = t.parentEvent
, n = t.datas;
if (e.state.dragInfo = null,
n.isDrag) {
n.isDrag = !1;
var i = fillEndParams(e, t, {});
return !r && triggerEvent(e, "onDragEnd", i),
i
}
},
dragGroupStart: function(e, t) {
var r = t.datas
, n = t.clientX
, i = t.clientY
, o = this.dragStart(e, t);
if (!o)
return !1;
var s = triggerChildGesto(e, this, "dragStart", [n || 0, i || 0],
t, !1, "draggable")
, a = triggerEvent(e, "onDragGroupStart",
__assign$2(__assign$2({}, o), {
targets: e.props.targets,
events: s
}));
return r.isDrag = !1 !== a,
!!r.isDrag && o
},
dragGroup: function(e, t) {
if (t.datas.isDrag) {
var r = this.drag(e, t)
, n = triggerChildGesto(e, this, "drag", t.datas.passDelta,
t, !1, "draggable");
if (r) {
var i = __assign$2({
targets: e.props.targets,
events: n
}, r);
return triggerEvent(e, "onDragGroup", i),
i
}
}
},
dragGroupEnd: function(e, t) {
var r = t.isDrag;
if (t.datas.isDrag) {
this.dragEnd(e, t);
var n = triggerChildGesto(e, this, "dragEnd", [0, 0], t, !1,
"draggable");
return triggerEvent(e, "onDragGroupEnd", fillEndParams(e, t, {
targets: e.props.targets,
events: n
})),
r
}
},
request: function(e) {
var t = {}
, r = e.getRect()
, n = 0
, i = 0
, o = !1;
return {
isControl: !1,
requestStart: function(e) {
return o = e.useSnap,
{
datas: t,
useSnap: o
}
},
request: function(e) {
return "x"in e ? n = e.x - r.left : "deltaX"in e && (n +=
e.deltaX),
"y"in e ? i = e.y - r.top : "deltaY"in e && (i +=
e.deltaY),
{
datas: t,
distX: n,
distY: i,
useSnap: o
}
},
requestEnd: function() {
return {
datas: t,
isDrag: !0,
useSnap: o
}
}
}
},
unset: function(e) {
e.state.gestos.draggable = null,
e.state.dragInfo = null
}
};
function getFixedDirectionInfo(e, t) {
return {
fixedPosition: getPosByDirection(e, t),
fixedDirection: t,
fixedOffset: [0, 0]
}
}
function getOffsetFixedDirectionInfo(e, t) {
var r = e.allMatrix
, n = e.is3d
, i = e.width
, o = e.height
, s = n ? 4 : 3;
return {
fixedPosition: calculatePosition(r, [i / 2 * (1 + t[0]), o / 2 * (1
+ t[1])], s),
fixedDirection: t,
fixedOffset: [0, 0]
}
}
function getOffsetFixedPositionInfo(e, t) {
var r = e.allMatrix
, n = e.is3d
, i = e.width
, o = e.height
, s = n ? 4 : 3
, a = getDirectionByPos(t, i, o);
return {
fixedPosition: calculatePosition(r, t, s),
fixedDirection: a,
fixedOffset: [i ? 0 : t[0], o ? 0 : t[1]]
}
}
var directionCondition$2 = getDirectionCondition("resizable")
, Resizable = {
name: "resizable",
ableGroup: "size",
canPinch: !0,
props: ["resizable", "throttleResize", "renderDirections",
"displayAroundControls", "keepRatio", "resizeFormat", "keepRatioFinally", "edge",
"checkResizableError"],
events: ["resizeStart", "beforeResize", "resize", "resizeEnd",
"resizeGroupStart", "beforeResizeGroup", "resizeGroup", "resizeGroupEnd"],
render: getRenderDirections("resizable"),
dragControlCondition: directionCondition$2,
viewClassName: getDirectionViewClassName("resizable"),
dragControlStart: function(e, t) {
var r, n = t.inputEvent, i = t.isPinch, o = t.isGroup, s =
t.parentDirection, a = t.parentGesto, l = t.datas, c = t.parentFixedDirection, u =
t.parentEvent, d = getTotalDirection(s, i, n, l), p = e.state, h = p.target, f =
p.width, m = p.height, g = p.gestos;
if (!d || !h)
return !1;
if (g.resizable)
return !1;
g.resizable = a || e.controlGesto,
!i && setDragStart(e, t),
l.datas = {},
l.direction = d,
l.startOffsetWidth = f,
l.startOffsetHeight = m,
l.prevWidth = 0,
l.prevHeight = 0,
l.minSize = [0, 0],
l.startWidth = p.inlineCSSWidth || p.cssWidth,
l.startHeight = p.inlineCSSHeight || p.cssHeight,
l.maxSize = [1 / 0, 1 / 0],
o || (l.minSize = [p.minOffsetWidth, p.minOffsetHeight],
l.maxSize = [p.maxOffsetWidth, p.maxOffsetHeight]);
var y = e.props.transformOrigin || "% %";
function v(e) {
l.ratio = e && isFinite(e) ? e : 0
}
function b(e) {
var t = getFixedDirectionInfo(l.startPositions, e);
l.fixedDirection = t.fixedDirection,
l.fixedPosition = t.fixedPosition,
l.fixedOffset = t.fixedOffset
}
function x(t) {
var r = getOffsetFixedPositionInfo(e.state, t);
l.fixedDirection = r.fixedDirection,
l.fixedPosition = r.fixedPosition,
l.fixedOffset = r.fixedOffset
}
function _(e) {
l.minSize = [convertUnitSize("".concat(e[0]), 0) || 0,
convertUnitSize("".concat(e[1]), 0) || 0]
}
function E(e) {
var t = [e[0] || 1 / 0, e[1] || 1 / 0];
isNumber$4(t[0]) && !isFinite(t[0]) || (t[0] =
convertUnitSize("".concat(t[0]), 0) || 1 / 0),
isNumber$4(t[1]) && !isFinite(t[1]) || (t[1] =
convertUnitSize("".concat(t[1]), 0) || 1 / 0),
l.maxSize = t
}
l.transformOrigin = y && isString$3(y) ? y.split(" ") : y,
l.startOffsetMatrix = p.offsetMatrix,
l.startTransformOrigin = p.transformOrigin,
l.isWidth = null !== (r = null == t ? void 0 : t.parentIsWidth) &&
void 0 !== r ? r : !d[0] && !d[1] || d[0] || !d[1],
l.startPositions = getAbsolutePosesByState(e.state),
v(f / m),
b(c || [-d[0], -d[1]]),
l.setFixedDirection = b,
l.setFixedPosition = x,
l.setMin = _,
l.setMax = E;
var T = fillParams(e, t, {
direction: d,
startRatio: l.ratio,
set: function(e) {
var t = __read(e, 2)
, r = t[0]
, n = t[1];
l.startWidth = r,
l.startHeight = n
},
setMin: _,
setMax: E,
setRatio: v,
setFixedDirection: b,
setFixedPosition: x,
setOrigin: function(e) {
l.transformOrigin = e
},
dragStart: Draggable.dragStart(e, (new
CustomGesto).dragStart([0, 0], t))
})
, C = u || triggerEvent(e, "onResizeStart", T);
return l.startFixedDirection = l.fixedDirection,
l.startFixedPosition = l.fixedPosition,
!1 !== C && (l.isResize = !0,
e.state.snapRenderInfo = {
request: t.isRequest,
direction: d
}),
!!l.isResize && T
},
dragControl: function(e, t) {
var r, n = t.datas, i = t.parentFlag, o = t.isPinch, s =
t.parentKeepRatio, a = t.dragClient, l = t.parentDist, c = t.useSnap, u =
t.isRequest, d = t.isGroup, p = t.parentEvent, h = t.resolveMatrix, f = n.isResize,
m = n.transformOrigin, g = n.startWidth, y = n.startHeight, v = n.prevWidth, b =
n.prevHeight, x = n.minSize, _ = n.maxSize, E = n.ratio, T = n.startOffsetWidth, C
= n.startOffsetHeight, S = n.isWidth;
if (f) {
if (h) {
var $ = e.state.is3d
, w = n.startOffsetMatrix
, P = n.startTransformOrigin
, R = $ ? 4 : 3
, k = parseMat(getNextTransforms(t))
, A = Math.sqrt(k.length);
R !== A && (k = convertDimension(k, A, R));
var I = getNextMatrix(w, k, P, R)
, O = calculatePoses(I, T, C, R);
n.startPositions = O,
n.nextTargetMatrix = k,
n.nextAllMatrix = I
}
var D = getProps(e.props, "resizable")
, M = D.resizeFormat
, L = D.throttleResize
, j = void 0 === L ? i ? 0 : 1 : L
, F = D.parentMoveable
, N = D.keepRatioFinally
, B = n.direction
, z = B
, U = 0
, V = 0;
B[0] || B[1] || (z = [1, 1]);
var H = E && (null != s ? s : D.keepRatio) || !1
, G = __read(ie(), 2)
, W = G[0]
, Y = G[1];
p || (n.setFixedDirection(n.fixedDirection),
triggerEvent(e, "onBeforeResize", fillParams(e, t, {
startFixedDirection: n.startFixedDirection,
startFixedPosition: n.startFixedPosition,
setFixedDirection: function(e) {
var t;
return n.setFixedDirection(e),
t = __read(ie(), 2),
W = t[0],
Y = t[1],
[W, Y]
},
setFixedPosition: function(e) {
var t;
return n.setFixedPosition(e),
t = __read(ie(), 2),
W = t[0],
Y = t[1],
[W, Y]
},
boundingWidth: W,
boundingHeight: Y,
setSize: function(e) {
var t;
t = __read(e, 2),
W = t[0],
Y = t[1]
}
}, !0)));
var K = a;
a || (K = !i && o ? getAbsolutePosition(e, [0, 0]) :
n.fixedPosition);
var X = [0, 0];
if (o || (X = checkSnapResize(e, W, Y, B, K, !c && u, n)),
l && (!l[0] && (X[0] = 0),
!l[1] && (X[1] = 0)),
H) {
z[0] && z[1] && X[0] && X[1] && (abs(X[0]) > abs(X[1]) ?
X[1] = 0 : X[0] = 0);
var q = !X[0] && !X[1];
q && oe(),
z[0] && !z[1] || X[0] && !X[1] || q && S ? (W += X[0],
Y = W / E) : (!z[0] && z[1] || !X[0] && X[1] || q && !S) &&
(Y += X[1],
W = Y * E)
} else
W += X[0],
Y += X[1],
W = Math.max(0, W),
Y = Math.max(0, Y);
r = __read(calculateBoundSize([W, Y], x, _, !!H && E), 2),
W = r[0],
Y = r[1],
oe(),
H && (d || N) && (S ? Y = W / E : W = Y * E);
var Z = [(U = W - T) - v, (V = Y - C) - b];
n.prevWidth = U,
n.prevHeight = V;
var Q = getResizeDist(e, W, Y, K, m, n);
if (F || !Z.every((function(e) {
return !e
}
)) || !Q.every((function(e) {
return !e
}
))) {
var J = Draggable.drag(e, setCustomDrag(t, e.state, Q, !!o,
!1, "draggable"))
, ee = J.transform
, te = g + U
, re = y + V
, ne = fillParams(e, t, __assign$2({
width: te,
height: re,
offsetWidth: Math.round(W),
offsetHeight: Math.round(Y),
startRatio: E,
boundingWidth: W,
boundingHeight: Y,
direction: B,
dist: [U, V],
delta: Z,
isPinch: !!o,
drag: J
}, fillAfterTransform({
style: {
width: "".concat(te, "px"),
height: "".concat(re, "px")
},
transform: ee
}, J, t)));
return !p && triggerEvent(e, "onResize", ne),
ne
}
}
function ie() {
var e = n.fixedDirection
, r = getOffsetSizeDist(z, H, n, t);
U = r.distWidth,
V = r.distHeight;
var i = z[0] - e[0] || H ? Math.max(T + U, TINY_NUM) : T
, o = z[1] - e[1] || H ? Math.max(C + V, TINY_NUM) : C;
return H && T && C && (S ? o = i / E : i = o * E),
[i, o]
}
function oe() {
var e;
M && (e = __read(M([W, Y]), 2),
W = e[0],
Y = e[1]),
W = throttle$4(W, j),
Y = throttle$4(Y, j)
}
},
dragControlAfter: function(e, t) {
var r = t.datas
, n = r.isResize
, i = r.startOffsetWidth
, o = r.startOffsetHeight
, s = r.prevWidth
, a = r.prevHeight;
if (n && !1 !== e.props.checkResizableError) {
var l = e.state
, c = l.width - (i + s)
, u = l.height - (o + a)
, d = abs(c) > 3
, p = abs(u) > 3;
return d && (r.startWidth += c,
r.startOffsetWidth += c,
r.prevWidth += c),
p && (r.startHeight += u,
r.startOffsetHeight += u,
r.prevHeight += u),
d || p ? this.dragControl(e, t) : void 0
}
},
dragControlEnd: function(e, t) {
var r = t.datas
, n = t.parentEvent;
if (r.isResize) {
r.isResize = !1;
var i = fillEndParams(e, t, {});
return !n && triggerEvent(e, "onResizeEnd", i),
i
}
},
dragGroupControlCondition: directionCondition$2,
dragGroupControlStart: function(e, t) {
var r = t.datas
, n = this.dragControlStart(e, __assign$2(__assign$2({}, t), {
isGroup: !0
}));
if (!n)
return !1;
var i = fillChildEvents(e, "resizable", t)
, o = r.startOffsetWidth
, s = r.startOffsetHeight;
function a() {
var e = r.minSize;
i.forEach((function(t) {
var r = t.datas
, n = r.minSize
, i = r.startOffsetWidth
, a = r.startOffsetHeight
, l = o * (i ? n[0] / i : 0)
, c = s * (a ? n[1] / a : 0);
e[0] = Math.max(e[0], l),
e[1] = Math.max(e[1], c)
}
))
}
function l() {
var e = r.maxSize;
i.forEach((function(t) {
var r = t.datas
, n = r.maxSize
, i = r.startOffsetWidth
, a = r.startOffsetHeight
, l = o * (i ? n[0] / i : 0)
, c = s * (a ? n[1] / a : 0);
e[0] = Math.min(e[0], l),
e[1] = Math.min(e[1], c)
}
))
}
var c = triggerChildAbles(e, this, "dragControlStart", t,
(function(t, n) {
return startChildDist(e, t, r, n)
}
));
a(),
l();
var u = function(t) {
n.setFixedDirection(t),
c.forEach((function(n, o) {
n.setFixedDirection(t),
startChildDist(e, n.moveable, r, i[o])
}
))
};
r.setFixedDirection = u;
var d = __assign$2(__assign$2({}, n), {
targets: e.props.targets,
events: c.map((function(e) {
return __assign$2(__assign$2({}, e), {
setMin: function(t) {
e.setMin(t),
a()
},
setMax: function(t) {
e.setMax(t),
l()
}
})
}
)),
setFixedDirection: u,
setMin: function(e) {
n.setMin(e),
a()
},
setMax: function(e) {
n.setMax(e),
l()
}
})
, p = triggerEvent(e, "onResizeGroupStart", d);
return r.isResize = !1 !== p,
!!r.isResize && n
},
dragGroupControl: function(e, t) {
var r = t.datas;
if (r.isResize) {
var n = getProps(e.props, "resizable");
catchEvent(e, "onBeforeResize", (function(r) {
triggerEvent(e, "onBeforeResizeGroup", fillParams(e, t,
__assign$2(__assign$2({}, r), {
targets: n.targets
}), !0))
}
));
var i = this.dragControl(e, __assign$2(__assign$2({}, t), {
isGroup: !0
}));
if (i) {
var o = i.boundingWidth
, s = i.boundingHeight
, a = i.dist
, l = n.keepRatio
, c = [o / (o - a[0]), s / (s - a[1])]
, u = r.fixedPosition
, d = triggerChildAbles(e, this, "dragControl", t,
(function(t, r) {
var n =
__read(calculate(createRotateMatrix(e.rotation / 180 * Math.PI, 3),
[r.datas.originalX * c[0], r.datas.originalY * c[1], 1], 3), 2)
, i = n[0]
, o = n[1];
return __assign$2(__assign$2({}, r), {
parentDist: null,
parentScale: c,
dragClient: plus$1(u, [i, o]),
parentKeepRatio: l
})
}
))
, p = __assign$2({
targets: n.targets,
events: d
}, i);
return triggerEvent(e, "onResizeGroup", p),
p
}
}
},
dragGroupControlEnd: function(e, t) {
var r = t.isDrag;
if (t.datas.isResize) {
this.dragControlEnd(e, t);
var n = triggerChildAbles(e, this, "dragControlEnd", t);
return triggerEvent(e, "onResizeGroupEnd", fillEndParams(e, t,
{
targets: e.props.targets,
events: n
})),
r
}
},
request: function(e) {
var t = {}
, r = 0
, n = 0
, i = !1
, o = e.getRect();
return {
isControl: !0,
requestStart: function(e) {
var r;
return i = e.useSnap,
{
datas: t,
parentDirection: e.direction || [1, 1],
parentIsWidth: null === (r = null == e ? void 0 :
e.horizontal) || void 0 === r || r,
useSnap: i
}
},
request: function(e) {
return "offsetWidth"in e ? r = e.offsetWidth -
o.offsetWidth : "deltaWidth"in e && (r += e.deltaWidth),
"offsetHeight"in e ? n = e.offsetHeight - o.offsetHeight :
"deltaHeight"in e && (n += e.deltaHeight),
{
datas: t,
parentDist: [r, n],
parentKeepRatio: e.keepRatio,
useSnap: i
}
},
requestEnd: function() {
return {
datas: t,
isDrag: !0,
useSnap: i
}
}
}
},
unset: function(e) {
e.state.gestos.resizable = null
}
};
function setRotateStartInfo(e, t, r, n, i) {
var o = e.props.groupable
, s = e.state
, a = s.is3d ? 4 : 3
, l = t.origin
, c = calculatePosition(e.state.rootMatrix, minus$1([l[0], l[1]], o ?
[0, 0] : [s.left, s.top]), a)
, u = plus$1([i.left, i.top], c);
t.startAbsoluteOrigin = u,
t.prevDeg = getRad$1(u, [r, n]) / Math.PI * 180,
t.defaultDeg = t.prevDeg,
t.prevSnapDeg = 0,
t.loop = 0,
t.startDist = getDist$2(u, [r, n])
}
function getAbsoluteDist(e, t, r) {
var n = r.defaultDeg
, i = r.prevDeg
, o = i % 360
, s = Math.floor(i / 360);
o < 0 && (o += 360),
o > e && o > 270 && e < 90 ? ++s : o < e && o < 90 && e > 270 && --s;
var a = t * (360 * s + e - n);
return r.prevDeg = n + a,
a
}
function getAbsoluteDistByClient(e, t, r, n) {
return getAbsoluteDist(getRad$1(n.startAbsoluteOrigin, [e, t]) /
Math.PI * 180, r, n)
}
function getRotateInfo(e, t, r, n, i, o) {
var s = e.props.throttleRotate
, a = void 0 === s ? 0 : s
, l = r.prevSnapDeg
, c = 0
, u = !1;
if (o) {
var d = checkSnapRotate(e, t, n, i + n);
u = d.isSnap,
c = i + d.dist
}
u || (c = throttle$4(i + n, a));
var p = c - i;
return r.prevSnapDeg = p,
[p - l, p, c]
}
function getRotationPositions(e, t, r) {
var n = __read(t, 4)
, i = n[0]
, o = n[1]
, s = n[2]
, a = n[3];
if ("none" === e)
return [];
if (isArray$a(e))
return e.map((function(e) {
return getRotationPositions(e, [i, o, s, a], r)[0]
}
));
var l = __read((e || "top").split("-"), 2)
, c = l[0]
, u = l[1]
, d = [i, o];
"left" === c ? d = [s, i] : "right" === c ? d = [o, a] : "bottom" === c
&& (d = [a, s]);
var p = [(d[0][0] + d[1][0]) / 2, (d[0][1] + d[1][1]) / 2]
, h = getRotationRad(d, r);
if (u) {
var f = "top" === u || "left" === u
, m = "bottom" === c || "left" === c;
p = d[f && !m || !f && m ? 0 : 1]
}
return [[p, h]]
}
function dragControlCondition(e, t) {
if (t.isRequest)
return "rotatable" === t.requestAble;
var r = t.inputEvent.target;
if (hasClass$1(r, prefix$7("rotation-control")) ||
e.props.rotateAroundControls && hasClass$1(r, prefix$7("around-control")) ||
hasClass$1(r, prefix$7("control")) && hasClass$1(r, prefix$7("rotatable")))
return !0;
var n = e.props.rotationTarget;
return !!n && getRefTargets(n, !0).some((function(e) {
return !!e && (r === e || r.contains(e))
}
))
}
var css = ".rotation {\nposition: absolute;\nheight: 40px;\nwidth: 1px;\
ntransform-origin: 50% 100%;\nheight: calc(40px * var(--zoom));\ntop: auto;\nleft:
0;\nbottom: 100%;\nwill-change: transform;\n}\n.rotation .rotation-line {\ndisplay:
block;\nwidth: 100%;\nheight: 100%;\ntransform-origin: 50% 50%;\n}\
n.rotation .rotation-control {\nborder-color: #4af;\nborder-color: var(--moveable-
color);\nbackground:#fff;\ncursor: alias;\n}\n:global .view-rotation-
dragging, .rotatable.direction.control {\ncursor: alias;\n}\
n.rotatable.direction.control.move {\ncursor: move;\n}\n"
, Rotatable = {
name: "rotatable",
canPinch: !0,
props: ["rotatable", "rotationPosition", "throttleRotate",
"renderDirections", "rotationTarget", "rotateAroundControls", "edge",
"resolveAblesWithRotatable", "displayAroundControls"],
events: ["rotateStart", "beforeRotate", "rotate", "rotateEnd",
"rotateGroupStart", "beforeRotateGroup", "rotateGroup", "rotateGroupEnd"],
css: [css],
viewClassName: function(e) {
return e.isDragging("rotatable") ? prefix$7("view-rotation-
dragging") : ""
},
render: function(e, t) {
var r = getProps(e.props, "rotatable")
, n = r.rotatable
, i = r.rotationPosition
, o = r.zoom
, s = r.renderDirections
, a = r.rotateAroundControls
, l = r.resolveAblesWithRotatable
, c = e.getState()
, u = c.renderPoses
, d = c.direction;
if (!n)
return null;
var p = getRotationPositions(i, u, d)
, h = [];
if (p.forEach((function(e, r) {
var n = __read(e, 2)
, i = n[0]
, s = n[1];
h.push(t.createElement("div", {
key: "rotation".concat(r),
className: prefix$7("rotation"),
style: {
transform: "translate(-50%) translate(".concat(i[0],
"px, ").concat(i[1], "px) rotate(").concat(s, "rad)")
}
}, t.createElement("div", {
className: prefix$7("line rotation-line"),
style: {
transform: "scaleX(".concat(o, ")")
}
}), t.createElement("div", {
className: prefix$7("control rotation-control"),
style: {
transform: "translate(0.5px) scale(".concat(o, ")")
}
})))
}
)),
s) {
var f = getKeys(l || {})
, m = {};
f.forEach((function(e) {
l[e].forEach((function(t) {
m[t] = e
}
))
}
));
var g = [];
isArray$a(s) && (g = s.map((function(e) {
var t = m[e];
return {
data: t ? {
resolve: t
} : {},
classNames: t ? ["move"] : [],
dir: e
}
}
))),
h.push.apply(h, __spreadArray([],
__read(renderDirectionControlsByInfos(e, "rotatable", g, t)), !1))
}
return a && h.push.apply(h, __spreadArray([],
__read(renderAroundControls(e, t)), !1)),
h
},
dragControlCondition: dragControlCondition,
dragControlStart: function(e, t) {
var r, n, i = t.datas, o = t.clientX, s = t.clientY, a =
t.parentRotate, l = t.parentFlag, c = t.isPinch, u = t.isRequest, d = e.state, p =
d.target, h = d.left, f = d.top, m = d.direction, g = d.beforeDirection, y =
d.targetTransform, v = d.moveableClientRect, b = d.offsetMatrix, x =
d.targetMatrix, _ = d.allMatrix, E = d.width, T = d.height;
if (!u && !p)
return !1;
var C = e.getRect();
i.rect = C,
i.transform = y,
i.left = h,
i.top = f;
var S = function(t) {
var r = getOffsetFixedPositionInfo(e.state, t);
i.fixedDirection = r.fixedDirection,
i.fixedOffset = r.fixedOffset,
i.fixedPosition = r.fixedPosition,
L && L.setFixedPosition(t)
}
, $ = function(t) {
var r = getOffsetFixedDirectionInfo(e.state, t);
i.fixedDirection = r.fixedDirection,
i.fixedOffset = r.fixedOffset,
i.fixedPosition = r.fixedPosition,
L && L.setFixedDirection(t)
}
, w = o
, P = s;
if (u || c || l) {
var R = a || 0;
i.beforeInfo = {
origin: C.beforeOrigin,
prevDeg: R,
defaultDeg: R,
prevSnapDeg: 0,
startDist: 0
},
i.afterInfo = __assign$2(__assign$2({}, i.beforeInfo), {
origin: C.origin
}),
i.absoluteInfo = __assign$2(__assign$2({}, i.beforeInfo), {
origin: C.origin,
startValue: R
})
} else {
var k = null === (n = t.inputEvent) || void 0 === n ? void 0 :
n.target;
if (k) {
var A = k.getAttribute("data-direction") || ""
, I = DIRECTION_REGION_TO_DIRECTION[A];
if (I) {
i.isControl = !0,
i.isAroundControl = hasClass$1(k, prefix$7("around-
control")),
i.controlDirection = I;
var O = k.getAttribute("data-resolve");
O && (i.resolveAble = O),
r =
__read(getPosByDirection(calculateMoveableClientPositions(d.rootMatrix,
d.renderPoses, v), I), 2),
w = r[0],
P = r[1]
}
}
i.beforeInfo = {
origin: C.beforeOrigin
},
i.afterInfo = {
origin: C.origin
},
i.absoluteInfo = {
origin: C.origin,
startValue: C.rotation
};
var D = S;
S = function(t) {
var r = d.is3d ? 4 : 3
, n = __read(plus$1(getOrigin(x, r), t), 2)
, o = n[0]
, s = n[1]
, a = calculate(b, convertPositionMatrix([o, s], r))
, l = calculate(_, convertPositionMatrix([t[0], t[1]],
r));
D(t);
var c = d.posDelta;
i.beforeInfo.origin = minus$1(a, c),
i.afterInfo.origin = minus$1(l, c),
i.absoluteInfo.origin = minus$1(l, c),
setRotateStartInfo(e, i.beforeInfo, w, P, v),
setRotateStartInfo(e, i.afterInfo, w, P, v),
setRotateStartInfo(e, i.absoluteInfo, w, P, v)
}
,
$ = function(e) {
var t = getPosByDirection([[0, 0], [E, 0], [0, T], [E, T]],
e);
S(t)
}
}
i.startClientX = w,
i.startClientY = P,
i.direction = m,
i.beforeDirection = g,
i.startValue = 0,
i.datas = {},
setDefaultTransformIndex(e, t, "rotate");
var M = !1
, L = !1;
i.isControl && i.resolveAble && ("resizable" === i.resolveAble &&
(L = Resizable.dragControlStart(e, __assign$2(__assign$2({}, new
CustomGesto("resizable").dragStart([0, 0], t)), {
parentPosition: i.controlPosition,
parentFixedPosition: i.fixedPosition
}))));
L || (M = Draggable.dragStart(e, (new CustomGesto).dragStart([0,
0], t))),
S(getTotalOrigin(e));
var j = fillParams(e, t, __assign$2(__assign$2({
set: function(e) {
i.startValue = e * Math.PI / 180
},
setFixedDirection: $,
setFixedPosition: S
}, fillTransformStartEvent(e, t)), {
dragStart: M,
resizeStart: L
}))
, F = triggerEvent(e, "onRotateStart", j);
return i.isRotate = !1 !== F,
d.snapRenderInfo = {
request: t.isRequest
},
!!i.isRotate && j
},
dragControl: function(e, t) {
var r, n, i, o = t.datas, s = t.clientDistX, a = t.clientDistY, l =
t.parentRotate, c = t.parentFlag, u = t.isPinch, d = t.groupDelta, p =
t.resolveMatrix, h = o.beforeDirection, f = o.beforeInfo, m = o.afterInfo, g =
o.absoluteInfo, y = o.isRotate, v = o.startValue, b = o.rect, x = o.startClientX, _
= o.startClientY;
if (y) {
resolveTransformEvent(e, t, "rotate");
var E, T, C, S, $, w, P, R, k, A = h *
getTransformDirection(t), I = e.props.parentMoveable, O = 180 / Math.PI * v, D =
g.startValue, M = !1, L = x + s, j = _ + a;
if (!c && "parentDist"in t) {
var F = t.parentDist;
T = F,
$ = F,
R = F
} else
u || c ? (T = getAbsoluteDist(l, h, f),
$ = getAbsoluteDist(l, A, m),
R = getAbsoluteDist(l, A, g)) : (T =
getAbsoluteDistByClient(L, j, h, f),
$ = getAbsoluteDistByClient(L, j, A, m),
R = getAbsoluteDistByClient(L, j, A, g),
M = !0);
if (triggerEvent(e, "onBeforeRotate", fillParams(e, t, {
beforeRotation: C = O + T,
rotation: w = O + $,
absoluteRotation: k = D + R,
setRotation: function(e) {
T = $ = e - O,
R = $
}
}, !0)),
E = (r = __read(getRotateInfo(e, b, f, T, O, M), 3))[0],
T = r[1],
C = r[2],
S = (n = __read(getRotateInfo(e, b, m, $, O, M), 3))[0],
$ = n[1],
w = n[2],
P = (i = __read(getRotateInfo(e, b, g, R, D, M), 3))[0],
R = i[1],
k = i[2],
P || S || E || I || p) {
var N = convertTransformFormat(o, "rotate(".concat(w,
"deg)"), "rotate(".concat($, "deg)"));
p && (o.fixedPosition = getTranslateFixedPosition(e,
o.targetAllTransform, o.fixedDirection, o.fixedOffset, o));
var B = getRotateDist(e, $, o)
, z = minus$1(plus$1(d || [0, 0], B), o.prevInverseDist
|| [0, 0]);
o.prevInverseDist = B,
o.requestValue = null;
var U = fillTransformEvent(e, N, z, u, t)
, V = U
, H = getDist$2([L, j], g.startAbsoluteOrigin) -
g.startDist
, G = void 0;
if ("resizable" === o.resolveAble) {
var W = Resizable.dragControl(e,
__assign$2(__assign$2({}, setCustomDrag(t, e.state, [t.deltaX, t.deltaY], !!u, !1,
"resizable")), {
resolveMatrix: !0,
parentDistance: H
}));
W && (G = W,
V = fillAfterTransform(V, W, t))
}
var Y = fillParams(e, t, __assign$2(__assign$2({
delta: S,
dist: $,
rotate: w,
rotation: w,
beforeDist: T,
beforeDelta: E,
beforeRotate: C,
beforeRotation: C,
absoluteDist: R,
absoluteDelta: P,
absoluteRotate: k,
absoluteRotation: k,
isPinch: !!u,
resize: G
}, U), V));
return triggerEvent(e, "onRotate", Y),
Y
}
}
},
dragControlEnd: function(e, t) {
var r = t.datas;
if (r.isRotate) {
r.isRotate = !1;
var n = fillEndParams(e, t, {});
return triggerEvent(e, "onRotateEnd", n),
n
}
},
dragGroupControlCondition: dragControlCondition,
dragGroupControlStart: function(e, t) {
var r = t.datas
, n = e.state
, i = n.left
, o = n.top
, s = n.beforeOrigin
, a = this.dragControlStart(e, t);
if (!a)
return !1;
a.set(r.beforeDirection * e.rotation);
var l = triggerChildAbles(e, this, "dragControlStart", t,
(function(e, t) {
var r = e.state
, n = r.left
, a = r.top
, l = r.beforeOrigin
, c = plus$1(minus$1([n, a], [i, o]), minus$1(l, s));
return t.datas.startGroupClient = c,
t.datas.groupClient = c,
__assign$2(__assign$2({}, t), {
parentRotate: 0
})
}
))
, c = triggerEvent(e, "onRotateGroupStart",
__assign$2(__assign$2({}, a), {
targets: e.props.targets,
events: l
}));
return r.isRotate = !1 !== c,
!!r.isRotate && a
},
dragGroupControl: function(e, t) {
var r = t.datas;
if (r.isRotate) {
catchEvent(e, "onBeforeRotate", (function(r) {
triggerEvent(e, "onBeforeRotateGroup", fillParams(e, t,
__assign$2(__assign$2({}, r), {
targets: e.props.targets
}), !0))
}
));
var n = this.dragControl(e, t);
if (n) {
var i = r.beforeDirection
, o = n.beforeDist
, s = o / 180 * Math.PI
, a = triggerChildAbles(e, this, "dragControl", t,
(function(e, t) {
var r = t.datas.startGroupClient
, n = __read(t.datas.groupClient, 2)
, a = n[0]
, l = n[1]
, c = __read(rotate(r, s * i), 2)
, u = c[0]
, d = c[1]
, p = [u - a, d - l];
return t.datas.groupClient = [u, d],
__assign$2(__assign$2({}, t), {
parentRotate: o,
groupDelta: p
})
}
));
e.rotation = i * n.beforeRotation;
var l = __assign$2({
targets: e.props.targets,
events: a,
set: function(t) {
e.rotation = t
},
setGroupRotation: function(t) {
e.rotation = t
}
}, n);
return triggerEvent(e, "onRotateGroup", l),
l
}
}
},
dragGroupControlEnd: function(e, t) {
var r = t.isDrag;
if (t.datas.isRotate) {
this.dragControlEnd(e, t);
var n = triggerChildAbles(e, this, "dragControlEnd", t);
return triggerEvent(e, "onRotateGroupEnd", fillEndParams(e, t,
{
targets: e.props.targets,
events: n
})),
r
}
},
request: function(e) {
var t = {}
, r = 0
, n = e.getRotation();
return {
isControl: !0,
requestStart: function() {
return {
datas: t
}
},
request: function(e) {
return "deltaRotate"in e ? r += e.deltaRotate : "rotate"in
e && (r = e.rotate - n),
{
datas: t,
parentDist: r
}
},
requestEnd: function() {
return {
datas: t,
isDrag: !0
}
}
}
}
};
function renderGuideline(e, t) {
var r, n = e.direction, i = e.classNames, o = e.size, s = e.pos, a =
e.zoom, l = e.key, c = "horizontal" === n, u = c ? "Y" : "X";
return t.createElement("div", {
key: l,
className: i.join(" "),
style: (r = {},
r[c ? "width" : "height"] = "".concat(o),
r.transform = "translate(".concat(s[0], ", ").concat(s[1], ")
translate").concat(u, "(-50%) scale").concat(u, "(").concat(a, ")"),
r)
})
}
function renderInnerGuideline(e, t) {
return renderGuideline(__assign$2(__assign$2({}, e), {
classNames: __spreadArray([prefix$7("line", "guideline",
e.direction)], __read(e.classNames), !1).filter((function(e) {
return e
}
)),
size: e.size || "".concat(e.sizeValue, "px"),
pos: e.pos || e.posValue.map((function(e) {
return "".concat(throttle$4(e, .1), "px")
}
))
}), t)
}
function renderSnapPoses(e, t, r, n, i, o, s, a) {
var l = e.props.zoom;
return r.map((function(e, r) {
var c = e.type
, u = e.pos
, d = [0, 0];
return d[s] = n,
d[s ? 0 : 1] = -i + u,
renderInnerGuideline({
key: "".concat(t, "TargetGuideline").concat(r),
classNames: [prefix$7("target", "bold", c)],
posValue: d,
sizeValue: o,
zoom: l,
direction: t
}, a)
}
))
}
function renderGuidelines(e, t, r, n, i, o) {
var s = e.props
, a = s.zoom
, l = s.isDisplayInnerSnapDigit
, c = "horizontal" === t ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP
, u = i[c.start]
, d = i[c.end];
return r.filter((function(e) {
var t = e.hide
, r = e.elementRect;
if (t)
return !1;
if (l && r) {
var n = r.rect;
if (n[c.start] <= u && d <= n[c.end])
return !1
}
return !0
}
)).map((function(e, r) {
var i = e.pos
, s = e.size
, l = e.element
, c = e.className
, u = [-n[0] + i[0], -n[1] + i[1]];
return renderInnerGuideline({
key: "".concat(t, "-default-guideline-").concat(r),
classNames: l ? [prefix$7("bold"), c] : [prefix$7("normal"),
c],
direction: t,
posValue: u,
sizeValue: s,
zoom: a
}, o)
}
))
}
function renderDigitLine(e, t, r, n, i, o, s, a) {
var l, c = e.props, u = c.snapDigit, d = void 0 === u ? 0 : u, p =
c.isDisplaySnapDigit, h = void 0 === p || p, f = c.snapDistFormat, m = void 0 === f
? function(e, t) {
return e
}
: f, g = c.zoom, y = "horizontal" === t ? "X" : "Y", v = "vertical" ===
t ? "height" : "width", b = Math.abs(i), x = h ? parseFloat(b.toFixed(d)) : 0;
return a.createElement("div", {
key: "".concat(t, "-").concat(r, "-guideline-").concat(n),
className: prefix$7("guideline-group", t),
style: (l = {
left: "".concat(o[0], "px"),
top: "".concat(o[1], "px")
},
l[v] = "".concat(b, "px"),
l)
}, renderInnerGuideline({
direction: t,
classNames: [prefix$7(r), s],
size: "100%",
posValue: [0, 0],
sizeValue: b,
zoom: g
}, a), a.createElement("div", {
className: prefix$7("size-value", "gap"),
style: {
transform: "translate".concat(y, "(-50%) scale(").concat(g,
")")
}
}, x > 0 ? m(x, t) : ""))
}
function groupByElementGuidelines(e, t, r, n) {
var i = "vertical" === e ? 0 : 1
, o = "vertical" === e ? 1 : 0
, s = i ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP
, a = r[s.start]
, l = r[s.end];
return groupBy(t, (function(e) {
return e.pos[i]
}
)).map((function(t) {
var r = []
, c = [];
return t.forEach((function(t) {
var u, d, p = t.element, h = t.elementRect.rect;
if (h[s.end] < a)
r.push(t);
else if (l < h[s.start])
c.push(t);
else if (h[s.start] <= a && l <= h[s.end] && n) {
var f = t.pos
, m = {
element: p,
rect: __assign$2(__assign$2({}, h), (u = {},
u[s.end] = h[s.start],
u))
}
, g = {
element: p,
rect: __assign$2(__assign$2({}, h), (d = {},
d[s.start] = h[s.end],
d))
}
, y = [0, 0]
, v = [0, 0];
y[i] = f[i],
y[o] = f[o],
v[i] = f[i],
v[o] = f[o] + t.size,
r.push({
type: e,
pos: y,
size: 0,
elementRect: m,
direction: "",
elementDirection: "end"
}),
c.push({
type: e,
pos: v,
size: 0,
elementRect: g,
direction: "",
elementDirection: "start"
})
}
}
)),
r.sort((function(e, t) {
return t.pos[o] - e.pos[o]
}
)),
c.sort((function(e, t) {
return e.pos[o] - t.pos[o]
}
)),
{
total: t,
start: r,
end: c,
inner: []
}
}
))
}
function renderDashedGuidelines(e, t, r, n, i) {
var o = e.props.isDisplayInnerSnapDigit
, s = [];
return ["vertical", "horizontal"].forEach((function(a) {
var l = t.filter((function(e) {
return e.type === a
}
))
, c = "vertical" === a ? 1 : 0
, u = c ? 0 : 1
, d = groupByElementGuidelines(a, l, n, o)
, p = c ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP
, h = c ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP
, f = n[p.start]
, m = n[p.end];
d.forEach((function(t) {
var o = t.total
, l = t.start
, d = t.end
, g = t.inner
, y = r[u] + o[0].pos[u] - n[h.start]
, v = n;
l.forEach((function(t) {
var n = t.elementRect.rect
, o = v[p.start] - n[p.end];
if (o > 0) {
var l = [0, 0];
l[c] = r[c] + v[p.start] - f - o,
l[u] = y,
s.push(renderDigitLine(e, a, "dashed", s.length, o, l,
t.className, i))
}
v = n
}
)),
v = n,
d.forEach((function(t) {
var n = t.elementRect.rect
, o = n[p.start] - v[p.end];
if (o > 0) {
var l = [0, 0];
l[c] = r[c] + v[p.end] - f,
l[u] = y,
s.push(renderDigitLine(e, a, "dashed", s.length, o, l,
t.className, i))
}
v = n
}
)),
g.forEach((function(t) {
var n = t.elementRect.rect
, o = f - n[p.start]
, l = n[p.end] - m
, d = [0, 0]
, h = [0, 0];
d[c] = r[c] - o,
d[u] = y,
h[c] = r[c] + m - f,
h[u] = y,
s.push(renderDigitLine(e, a, "dashed", s.length, o, d,
t.className, i)),
s.push(renderDigitLine(e, a, "dashed", s.length, l, h,
t.className, i))
}
))
}
))
}
)),
s
}
function renderGapGuidelines(e, t, r, n, i) {
var o = [];
return ["horizontal", "vertical"].forEach((function(s) {
var a = t.filter((function(e) {
return e.type === s
}
)).slice(0, 1)
, l = "vertical" === s ? 0 : 1
, c = l ? 0 : 1
, u = l ? HORIZONTAL_NAMES_MAP : VERTICAL_NAMES_MAP
, d = l ? VERTICAL_NAMES_MAP : HORIZONTAL_NAMES_MAP
, p = n[u.start]
, h = n[u.end]
, f = n[d.start]
, m = n[d.end];
a.forEach((function(t) {
var n = t.gap
, s = t.gapRects
, a = Math.max.apply(Math, __spreadArray([f],
__read(s.map((function(e) {
return e.rect[d.start]
}
))), !1))
, g = Math.min.apply(Math, __spreadArray([m],
__read(s.map((function(e) {
return e.rect[d.end]
}
))), !1))
, y = (a + g) / 2;
a !== g && y !== (f + m) / 2 && s.forEach((function(t) {
var s = t.rect
, a = t.className
, d = [r[0], r[1]];
if (s[u.end] < p)
d[l] += s[u.end] - p;
else {
if (!(h < s[u.start]))
return;
d[l] += s[u.start] - p - n
}
d[c] += y - f,
o.push(renderDigitLine(e, l ? "vertical" : "horizontal",
"gap", o.length, n, d, a, i))
}
))
}
))
}
)),
o
}
function getTotalGuidelines(e) {
var t = e.state
, r = t.containerClientRect
, n = t.hasFixed
, i = r.overflow
, o = r.scrollHeight
, s = r.scrollWidth
, a = r.clientHeight
, l = r.clientWidth
, c = r.clientLeft
, u = r.clientTop
, d = e.props
, p = d.snapGap
, h = void 0 === p || p
, f = d.verticalGuidelines
, m = d.horizontalGuidelines
, g = d.snapThreshold
, y = void 0 === g ? 5 : g
, v = d.snapGridWidth
, b = void 0 === v ? 0 : v
, x = d.snapGridHeight
, _ = void 0 === x ? 0 : x
, E = d.maxSnapElementGuidelineDistance
, T = void 0 === E ? 1 / 0 : E
, C = d.isDisplayGridGuidelines
, S = getRect(getAbsolutePosesByState(e.state))
, $ = S.top
, w = S.left
, P = S.bottom
, R = S.right
, k = {
top: $,
left: w,
bottom: P,
right: R,
center: (w + R) / 2,
middle: ($ + P) / 2
}
, A = __spreadArray([], __read(getElementGuidelines(e)), !1);
h && A.push.apply(A, __spreadArray([], __read(getGapGuidelines(e, k,
y)), !1));
var I = __assign$2({}, t.snapOffset || {
left: 0,
top: 0,
bottom: 0,
right: 0
});
if (A.push.apply(A, __spreadArray([], __read(getGridGuidelines(b, _,
i ? s : l, i ? o : a, c, u, I, C)), !1)),
n) {
var O = r.left
, D = r.top;
I.left += O,
I.top += D,
I.right += O,
I.bottom += D
}
return A.push.apply(A, __spreadArray([], __read(getDefaultGuidelines(m
|| !1, f || !1, i ? s : l, i ? o : a, c, u, I)), !1)),
A = A.filter((function(e) {
var t = e.element
, r = e.elementRect
, n = e.type;
if (!t || !r)
return !0;
var i = r.rect;
return checkBetweenRects(k, i, n, T)
}
))
}
function getGapGuidelines(e, t, r) {
var n = e.props
, i = n.maxSnapElementGuidelineDistance
, o = void 0 === i ? 1 / 0 : i
, s = n.maxSnapElementGapDistance
, a = void 0 === s ? 1 / 0 : s
, l = e.state.elementRects
, c = [];
return [["vertical", VERTICAL_NAMES_MAP, HORIZONTAL_NAMES_MAP],
["horizontal", HORIZONTAL_NAMES_MAP, VERTICAL_NAMES_MAP]].forEach((function(e) {
var n = __read(e, 3)
, i = n[0]
, s = n[1]
, u = n[2]
, d = t[s.start]
, p = t[s.end]
, h = t[s.center]
, f = t[u.start]
, m = t[u.end];
function g(e) {
var t = e.rect;
return t[s.end] < d + r ? d - t[s.end] : p - r < t[s.start] ?
t[s.start] - p : -1
}
var y = l.filter((function(e) {
var t = e.rect;
return !(t[u.start] > m || t[u.end] < f) && g(e) > 0
}
)).sort((function(e, t) {
return g(e) - g(t)
}
))
, v = [];
y.forEach((function(e) {
y.forEach((function(t) {
if (e !== t) {
var r = e.rect
, n = t.rect
, i = r[u.start]
, o = r[u.end]
, s = n[u.start];
i > n[u.end] || s > o || v.push([e, t])
}
}
))
}
)),
v.forEach((function(e) {
var n = __read(e, 2)
, l = n[0]
, u = n[1]
, f = l.rect
, m = u.rect
, g = f[s.start]
, y = f[s.end]
, v = m[s.start]
, b = m[s.end]
, x = 0
, _ = 0
, E = !1
, T = !1
, C = !1;
if (y <= d && p <= v) {
if (T = !0,
abs((_ = y + (x = (v - y - (p - d)) / 2) + (p - d) / 2) -
h) > r)
return
} else if (y < v && b < d + r) {
if (E = !0,
abs((_ = b + (x = v - y)) - d) > r)
return
} else {
if (!(y < v && p - r < g))
return;
if (C = !0,
abs((_ = g - (x = v - y)) - p) > r)
return
}
x && checkBetweenRects(t, m, i, o) && (x > a || c.push({
type: i,
pos: "vertical" === i ? [_, 0] : [0, _],
element: u.element,
size: 0,
className: u.className,
isStart: E,
isCenter: T,
isEnd: C,
gap: x,
hide: !0,
gapRects: [l, u],
direction: "",
elementDirection: ""
}))
}
))
}
)),
c
}
function getGridGuidelines(e, t, r, n, i, o, s, a) {
void 0 === i && (i = 0),
void 0 === o && (o = 0);
var l = []
, c = s.left
, u = s.top;
if (t)
for (var d = 0; d <= n; d += t)
l.push({
type: "horizontal",
pos: [c, throttle$4(d - o + u, .1)],
className: prefix$7("grid-guideline"),
size: r,
hide: !a,
direction: ""
});
if (e)
for (d = 0; d <= r; d += e)
l.push({
type: "vertical",
pos: [throttle$4(d - i + c, .1), u],
className: prefix$7("grid-guideline"),
size: n,
hide: !a,
direction: ""
});
return l
}
function checkBetweenRects(e, t, r, n) {
return "horizontal" === r ? abs(e.right - t.left) <= n || abs(e.left -
t.right) <= n || e.left <= t.right && t.left <= e.right : "vertical" !== r ||
(abs(e.bottom - t.top) <= n || abs(e.top - t.bottom) <= n || e.top <= t.bottom &&
t.top <= e.bottom)
}
function getElementGuidelines(e) {
var t = e.state
, r = e.props.elementGuidelines
, n = void 0 === r ? [] : r;
if (!n.length)
return t.elementRects = [],
[];
var i = (t.elementRects || []).filter((function(e) {
return !e.refresh
}
))
, o = n.map((function(e) {
return isObject$8(e) && "element"in e ? __assign$2(__assign$2({},
e), {
element: getRefTarget(e.element, !0)
}) : {
element: getRefTarget(e, !0)
}
}
)).filter((function(e) {
return e.element
}
))
, s = diff(i.map((function(e) {
return e.element
}
)), o.map((function(e) {
return e.element
}
)))
, a = s.maintained
, l = s.added
, c = [];
a.forEach((function(e) {
var t = __read(e, 2)
, r = t[0]
, n = t[1];
c[n] = i[r]
}
)),
getSnapElementRects(e, l.map((function(e) {
return o[e]
}
))).map((function(e, t) {
c[l[t]] = e
}
)),
t.elementRects = c;
var u = getSnapDirections(e.props.elementSnapDirections)
, d = [];
return c.forEach((function(e) {
var t = e.element
, r = e.top
, n = void 0 === r ? u.top : r
, i = e.left
, o = void 0 === i ? u.left : i
, s = e.right
, a = void 0 === s ? u.right : s
, l = e.bottom
, c = void 0 === l ? u.bottom : l
, p = e.center
, h = void 0 === p ? u.center : p
, f = e.middle
, m = void 0 === f ? u.middle : f
, g = e.className
, y = e.rect
, v = splitSnapDirectionPoses({
top: n,
right: a,
left: o,
bottom: c,
center: h,
middle: m
}, y)
, b = v.horizontal
, x = v.vertical
, _ = v.horizontalNames
, E = v.verticalNames
, T = y.top
, C = y.left
, S = y.right - C
, $ = y.bottom - T
, w = [S, $];
x.forEach((function(r, n) {
d.push({
type: "vertical",
element: t,
pos: [throttle$4(r, .1), T],
size: $,
sizes: w,
className: g,
elementRect: e,
elementDirection: SNAP_SKIP_NAMES_MAP[E[n]] || E[n],
direction: ""
})
}
)),
b.forEach((function(r, n) {
d.push({
type: "horizontal",
element: t,
pos: [C, throttle$4(r, .1)],
size: S,
sizes: w,
className: g,
elementRect: e,
elementDirection: SNAP_SKIP_NAMES_MAP[_[n]] || _[n],
direction: ""
})
}
))
}
)),
d
}
function getObjectGuidelines(e, t) {
return e ? e.map((function(e) {
var r = isObject$8(e) ? e : {
pos: e
}
, n = r.pos;
return isNumber$4(n) ? r : __assign$2(__assign$2({}, r), {
pos: convertUnitSize(n, t)
})
}
)) : []
}
function getDefaultGuidelines(e, t, r, n, i, o, s) {
void 0 === i && (i = 0),
void 0 === o && (o = 0),
void 0 === s && (s = {
left: 0,
top: 0,
right: 0,
bottom: 0
});
var a = []
, l = s.left
, c = s.top
, u = s.bottom
, d = r + s.right - l
, p = n + u - c;
return getObjectGuidelines(e, p).forEach((function(e) {
a.push({
type: "horizontal",
pos: [l, throttle$4(e.pos - o + c, .1)],
size: d,
className: e.className,
direction: ""
})
}
)),
getObjectGuidelines(t, d).forEach((function(e) {
a.push({
type: "vertical",
pos: [throttle$4(e.pos - i + l, .1), c],
size: p,
className: e.className,
direction: ""
})
}
)),
a
}
function getSnapElementRects(e, t) {
if (!t.length)
return [];
var r = e.props.groupable
, n = e.state
, i = n.containerClientRect
, o = n.rootMatrix
, s = n.is3d
, a = n.offsetDelta
, l = s ? 4 : 3
, c = __read(calculateContainerPos(o, i, l), 2)
, u = c[0]
, d = c[1]
, p = r ? 0 : a[0]
, h = r ? 0 : a[1];
return t.map((function(e) {
var t = e.element.getBoundingClientRect()
, r = t.left - u - p
, n = t.top - d - h
, i = n + t.height
, s = r + t.width
, a = __read(calculateInversePosition(o, [r, n], l), 2)
, c = a[0]
, f = a[1]
, m = __read(calculateInversePosition(o, [s, i], l), 2)
, g = m[0]
, y = m[1];
return __assign$2(__assign$2({}, e), {
rect: {
left: c,
right: g,
top: f,
bottom: y,
center: (c + g) / 2,
middle: (f + y) / 2
}
})
}
))
}
function checkSnapInfo(e) {
var t = e.state
, r = t.container
, n = e.props.snapContainer || r;
if (t.snapContainer === n && t.guidelines && t.guidelines.length)
return !1;
var i = t.containerClientRect
, o = {
left: 0,
top: 0,
bottom: 0,
right: 0
};
if (r !== n) {
var s = getRefTarget(n, !0);
if (s) {
var a = getClientRect$1(s)
, l = getDragDistByState(t, [a.left - i.left, a.top - i.top])
, c = getDragDistByState(t, [a.right - i.right, a.bottom -
i.bottom]);
o.left = throttle$4(l[0], 1e-5),
o.top = throttle$4(l[1], 1e-5),
o.right = throttle$4(c[0], 1e-5),
o.bottom = throttle$4(c[1], 1e-5)
}
}
return t.snapContainer = n,
t.snapOffset = o,
t.guidelines = getTotalGuidelines(e),
t.enableSnap = !0,
!0
}
function getNextFixedPoses(e, t, r, n, i, o) {
var s = calculatePoses(e, t, r, o ? 4 : 3);
return getAbsolutePoses(s, minus$1(i, getPosByDirection(s, n)))
}
function normalized(e) {
return e ? e / abs(e) : 0
}
function getSizeOffsetInfo(e, t, r, n, i, o) {
var s = getCheckSnapDirections(r, o.fixedDirection, n)
, a = getCheckInnerBoundLineInfos(e, t, r, n)
, l = __spreadArray(__spreadArray([], __read(getSnapBoundInfo(e, t,
s, n, i, o)), !1), __read(getInnerBoundInfo(e, a, o)), !1)
, c = getNearOffsetInfo(l, 0)
, u = getNearOffsetInfo(l, 1);
return {
width: {
isBound: c.isBound,
offset: c.offset[0]
},
height: {
isBound: u.isBound,
offset: u.offset[1]
}
}
}
function recheckSizeByTwoDirection(e, t, r, n, i, o, s, a, l) {
var c = getPosByDirection(t, s)
, u = checkMoveableSnapBounds(e, a, {
vertical: [c[0]],
horizontal: [c[1]]
})
, d = u.horizontal.offset
, p = u.vertical.offset;
if (throttle$4(p, FLOAT_POINT_NUM) || throttle$4(d, FLOAT_POINT_NUM)) {
var h = __read(getDragDist({
datas: l,
distX: -p,
distY: -d
}), 2)
, f = h[0]
, m = h[1];
return [Math.min(i || 1 / 0, r + s[0] * f) - r, Math.min(o || 1 /
0, n + s[1] * m) - n]
}
return [0, 0]
}
function checkSizeDist(e, t, r, n, i, o, s, a) {
for (var l = getAbsolutePosesByState(e.state), c = e.props.keepRatio, u
= 0, d = 0, p = 0; p < 2; ++p) {
var h = getSizeOffsetInfo(e, t(u, d), i, c, s, a)
, f = h.width
, m = h.height
, g = f.isBound
, y = m.isBound
, v = f.offset
, b = m.offset;
if (1 === p && (g || (v = 0),
y || (b = 0)),
0 === p && s && !g && !y)
return [0, 0];
if (c) {
var x = abs(v) * (r ? 1 / r : 1)
, _ = abs(b) * (n ? 1 / n : 1);
(g && y ? x < _ : y || !g && x < _) ? v = r * b / n : b = n * v
/ r
}
u += v,
d += b
}
if (!c && i[0] && i[1]) {
var E = checkMaxBounds(e, l, i, o, a)
, T = E.maxWidth
, C = E.maxHeight
, S = __read(recheckSizeByTwoDirection(e, t(u,
d).map((function(e) {
return e.map((function(e) {
return throttle$4(e, FLOAT_POINT_NUM)
}
))
}
)), r + u, n + d, T, C, i, s, a), 2);
u += v = S[0],
d += b = S[1]
}
return [u, d]
}
function absDegree(e) {
return e < 0 && (e = e % 360 + 360),
e %= 360
}
function bumpDegree(e, t) {
t = absDegree(t);
var r = Math.floor(e / 360)
, n = 360 * r + 360 - t
, i = 360 * r + t;
return abs(e - n) < abs(e - i) ? n : i
}
function getMinDegreeDistance(e, t) {
e = absDegree(e),
t = absDegree(t);
var r = absDegree(e - t);
return Math.min(r, 360 - r)
}
function checkSnapRotate(e, t, r, n) {
var i, o = e.props, s = null !== (i = o[NAME_snapRotationThreshold]) &&
void 0 !== i ? i : 5, a = o[NAME_snapRotationDegrees];
if (hasGuidelines(e, "rotatable")) {
var l = t.pos1
, c = t.pos2
, u = t.pos3
, d = t.pos4
, p = t.origin
, h = r * Math.PI / 180
, f = [l, c, u, d].map((function(e) {
return minus$1(e, p)
}
))
, m = f.map((function(e) {
return rotate(e, h)
}
))
, g = __spreadArray(__spreadArray([], __read(checkRotateBounds(e,
f, m, p, r)), !1), __read(checkRotateInnerBounds(e, f, m, p, r)), !1);
g.sort((function(e, t) {
return abs(e - r) - abs(t - r)
}
));
var y = g.length > 0;
if (y)
return {
isSnap: y,
dist: y ? g[0] : r
}
}
if ((null == a ? void 0 : a.length) && s) {
var v = a.slice().sort((function(e, t) {
return getMinDegreeDistance(e, n) - getMinDegreeDistance(t, n)
}
))
, b = v[0];
if (getMinDegreeDistance(b, n) <= s)
return {
isSnap: !0,
dist: r + bumpDegree(n, b) - n
}
}
return {
isSnap: !1,
dist: r
}
}
function checkSnapResize(e, t, r, n, i, o, s) {
if (!hasGuidelines(e, "resizable"))
return [0, 0];
var a = s.fixedDirection
, l = s.nextAllMatrix
, c = e.state
, u = c.allMatrix
, d = c.is3d;
return checkSizeDist(e, (function(e, n) {
return getNextFixedPoses(l || u, t + e, r + n, a, i, d)
}
), t, r, n, i, o, s)
}
function checkSnapScale(e, t, r, n, i) {
if (!hasGuidelines(e, "scalable"))
return [0, 0];
var o = i.startOffsetWidth
, s = i.startOffsetHeight
, a = i.fixedPosition
, l = i.fixedDirection
, c = i.is3d
, u = checkSizeDist(e, (function(e, r) {
return getNextFixedPoses(scaleMatrix(i, plus$1(t, [e / o, r / s])),
o, s, l, a, c)
}
), o, s, r, a, n, i);
return [u[0] / o, u[1] / s]
}
function startCheckSnapDrag(e, t) {
t.absolutePoses = getAbsolutePosesByState(e.state)
}
function getSnapGuidelines(e) {
var t = [];
return e.forEach((function(e) {
e.guidelineInfos.forEach((function(r) {
var n = r.guideline;
find$2(t, (function(e) {
return e.guideline === n
}
)) || (n.direction = "",
t.push({
guideline: n,
posInfo: e
}))
}
))
}
)),
t.map((function(e) {
var t = e.guideline
, r = e.posInfo;
return __assign$2(__assign$2({}, t), {
direction: r.direction
})
}
))
}
function addBoundGuidelines(e, t, r, n, i, o) {
var s = checkBoundPoses(getBounds(e, o), t, r)
, a = s.vertical
, l = s.horizontal
, c = getInitialBounds();
a.forEach((function(e) {
e.isBound && ("start" === e.direction && (c.left = !0),
"end" === e.direction && (c.right = !0),
n.push({
type: "bounds",
pos: e.pos
}))
}
)),
l.forEach((function(e) {
e.isBound && ("start" === e.direction && (c.top = !0),
"end" === e.direction && (c.bottom = !0),
i.push({
type: "bounds",
pos: e.pos
}))
}
));
var u = checkInnerBoundPoses(e)
, d = u.boundMap
, p = u.vertical
, h = u.horizontal;
return p.forEach((function(e) {
findIndex$3(n, (function(t) {
var r = t.type
, n = t.pos;
return "bounds" === r && n === e
}
)) >= 0 || n.push({
type: "bounds",
pos: e
})
}
)),
h.forEach((function(e) {
findIndex$3(i, (function(t) {
var r = t.type
, n = t.pos;
return "bounds" === r && n === e
}
)) >= 0 || i.push({
type: "bounds",
pos: e
})
}
)),
{
boundMap: c,
innerBoundMap: d
}
}
var directionCondition$1 = getDirectionCondition("", ["resizable",
"scalable"])
, NAME_snapRotationThreshold = "snapRotationThreshold"
, NAME_snapRotationDegrees = "snapRotationDegrees"
, Snappable = {
name: "snappable",
dragRelation: "strong",
props: ["snappable", "snapContainer", "snapDirections",
"elementSnapDirections", "snapGap", "snapGridWidth", "snapGridHeight",
"isDisplaySnapDigit", "isDisplayInnerSnapDigit", "isDisplayGridGuidelines",
"snapDigit", "snapThreshold", "snapRenderThreshold", NAME_snapRotationThreshold,
NAME_snapRotationDegrees, "horizontalGuidelines", "verticalGuidelines",
"elementGuidelines", "bounds", "innerBounds", "snapDistFormat",
"maxSnapElementGuidelineDistance", "maxSnapElementGapDistance"],
events: ["snap", "bound"],
css: [":host {\n--bounds-color: #d66;\n}\n.guideline {\npointer-events:
none;\nz-index: 2;\n}\n.guideline.bounds {\nbackground: #d66;\nbackground: var(--
bounds-color);\n}\n.guideline-group {\nposition: absolute;\ntop: 0;\nleft: 0;\n}\
n.guideline-group .size-value {\nposition: absolute;\ncolor: #f55;\nfont-size:
12px;\nfont-size: calc(12px * var(--zoom));\nfont-weight: bold;\n}\n.guideline-
group.horizontal .size-value {\ntransform-origin: 50% 100%;\ntransform:
translateX(-50%);\nleft: 50%;\nbottom: 5px;\nbottom: calc(2px + 3px * var(--
zoom));\n}\n.guideline-group.vertical .size-value {\ntransform-origin: 0% 50%;\
ntop: 50%;\ntransform: translateY(-50%);\nleft: 5px;\nleft: calc(2px + 3px * var(--
zoom));\n}\n.guideline.gap {\nbackground: #f55;\n}\n.size-value.gap {\ncolor:
#f55;\n}\n"],
render: function(e, t) {
var r = e.state
, n = r.top
, i = r.left
, o = r.pos1
, s = r.pos2
, a = r.pos3
, l = r.pos4
, c = r.snapRenderInfo
, u = e.props.snapRenderThreshold
, d = void 0 === u ? 1 : u;
if (!c || !c.render || !hasGuidelines(e, ""))
return watchValue(e, "boundMap", getInitialBounds(),
(function(e) {
return JSON.stringify(e)
}
)),
watchValue(e, "innerBoundMap", getInitialBounds(), (function(e)
{
return JSON.stringify(e)
}
)),
[];
r.guidelines = getTotalGuidelines(e);
var p = Math.min(o[0], s[0], a[0], l[0])
, h = Math.min(o[1], s[1], a[1], l[1])
, f = c.externalPoses || []
, m = getAbsolutePosesByState(e.state)
, g = []
, y = []
, v = []
, b = []
, x = []
, _ = getRect(m)
, E = _.width
, T = _.height
, C = _.top
, S = _.left
, $ = _.bottom
, w = _.right
, P = {
left: S,
right: w,
top: C,
bottom: $,
center: (S + w) / 2,
middle: (C + $) / 2
}
, R = f.length > 0
, k = R ? getRect(f) : {};
if (!c.request) {
if (c.direction && x.push(getSnapInfosByDirection(e, m,
c.direction, d)),
c.snap) {
var A = getRect(m);
c.center && (A.middle = (A.top + A.bottom) / 2,
A.center = (A.left + A.right) / 2),
x.push(checkSnaps(e, A, d))
}
R && (c.center && (k.middle = (k.top + k.bottom) / 2,
k.center = (k.left + k.right) / 2),
x.push(checkSnaps(e, k, d))),
x.forEach((function(e) {
var t = e.vertical.posInfos
, r = e.horizontal.posInfos;
g.push.apply(g, __spreadArray([],
__read(t.filter((function(e) {
return e.guidelineInfos.some((function(e) {
return !e.guideline.hide
}
))
}
)).map((function(e) {
return {
type: "snap",
pos: e.pos
}
}
))), !1)),
y.push.apply(y, __spreadArray([],
__read(r.filter((function(e) {
return e.guidelineInfos.some((function(e) {
return !e.guideline.hide
}
))
}
)).map((function(e) {
return {
type: "snap",
pos: e.pos
}
}
))), !1)),
v.push.apply(v, __spreadArray([],
__read(getSnapGuidelines(t)), !1)),
b.push.apply(b, __spreadArray([],
__read(getSnapGuidelines(r)), !1))
}
))
}
var I = addBoundGuidelines(e, [S, w], [C, $], g, y)
, O = I.boundMap
, D = I.innerBoundMap;
R && addBoundGuidelines(e, [k.left, k.right], [k.top, k.bottom], g,
y, c.externalBounds);
var M = __spreadArray(__spreadArray([], __read(v), !1),
__read(b), !1)
, L = M.filter((function(e) {
return e.element && !e.gapRects
}
))
, j = M.filter((function(e) {
return e.gapRects
}
)).sort((function(e, t) {
return e.gap - t.gap
}
));
triggerEvent(e, "onSnap", {
guidelines: M.filter((function(e) {
return !e.element
}
)),
elements: L,
gaps: j
}, !0);
var F = watchValue(e, "boundMap", O, (function(e) {
return JSON.stringify(e)
}
), getInitialBounds())
, N = watchValue(e, "innerBoundMap", D, (function(e) {
return JSON.stringify(e)
}
), getInitialBounds());
return O !== F && D !== N || triggerEvent(e, "onBound", {
bounds: O,
innerBounds: D
}, !0),
__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray
([], __read(renderDashedGuidelines(e, L, [p, h], P, t)), !1),
__read(renderGapGuidelines(e, j, [p, h], P, t)), !1), __read(renderGuidelines(e,
"horizontal", b, [i, n], P, t)), !1), __read(renderGuidelines(e, "vertical", v, [i,
n], P, t)), !1), __read(renderSnapPoses(e, "horizontal", y, p, n, E, 0, t)), !1),
__read(renderSnapPoses(e, "vertical", g, h, i, T, 1, t)), !1)
},
dragStart: function(e, t) {
e.state.snapRenderInfo = {
request: t.isRequest,
snap: !0,
center: !0
},
checkSnapInfo(e)
},
drag: function(e) {
var t = e.state;
checkSnapInfo(e) || (t.guidelines = getTotalGuidelines(e)),
t.snapRenderInfo && (t.snapRenderInfo.render = !0)
},
pinchStart: function(e) {
this.unset(e)
},
dragEnd: function(e) {
this.unset(e)
},
dragControlCondition: function(e, t) {
return !(!directionCondition$1(e, t) && !dragControlCondition(e,
t)) || (!t.isRequest && t.inputEvent ? hasClass$1(t.inputEvent.target,
prefix$7("snap-control")) : void 0)
},
dragControlStart: function(e) {
e.state.snapRenderInfo = null,
checkSnapInfo(e)
},
dragControl: function(e) {
this.drag(e)
},
dragControlEnd: function(e) {
this.unset(e)
},
dragGroupStart: function(e, t) {
this.dragStart(e, t)
},
dragGroup: function(e) {
this.drag(e)
},
dragGroupEnd: function(e) {
this.unset(e)
},
dragGroupControlStart: function(e) {
e.state.snapRenderInfo = null,
checkSnapInfo(e)
},
dragGroupControl: function(e) {
this.drag(e)
},
dragGroupControlEnd: function(e) {
this.unset(e)
},
unset: function(e) {
var t = e.state;
t.enableSnap = !1,
t.guidelines = [],
t.snapRenderInfo = null,
t.elementRects = []
}
};
function multiply2(e, t) {
return [e[0] * t[0], e[1] * t[1]]
}
function prefix$7() {
for (var e = [], t = 0; t < arguments.length; t++)
e[t] = arguments[t];
return prefixNames.apply(void 0, __spreadArray([PREFIX$3], __read(e), !
1))
}
function defaultSync(e) {
e()
}
function getTransformMatrix(e) {
return e && "none" !== e ? isObject$8(e) ? e : parseMat(e) : [1, 0, 0,
1, 0, 0]
}
function getAbsoluteMatrix(e, t, r) {
return multiplies(t, createOriginMatrix(r, t), e,
createOriginMatrix(r.map((function(e) {
return -e
}
)), t))
}
function measureSVGSize(e, t, r) {
return "%" === t ? getSVGViewBox(e.ownerSVGElement)[r ? "width" :
"height"] / 100 : 1
}
function getBeforeTransformOrigin(e) {
return getTransformOrigin(getComputedStyle$1(e,
":before")).map((function(t, r) {
var n = splitUnit(t)
, i = n.value
, o = n.unit;
return i * measureSVGSize(e, o, 0 === r)
}
))
}
function getTransformOriginArray(e) {
return e ? e.split(" ") : ["0", "0"]
}
function getTransformOrigin(e) {
return getTransformOriginArray(e.transformOrigin)
}
function getElementTransform(e) {
var t = getCachedStyle(e)("transform");
if (t && "none" !== t)
return t;
if ("transform"in e) {
var r = e.transform.baseVal;
if (!r)
return "";
var n = r.length;
if (!n)
return "";
for (var i = [], o = function(e) {
var t = r[e].matrix;
i.push("matrix(".concat(["a", "b", "c", "d", "e",
"f"].map((function(e) {
return t[e]
}
)).join(", "), ")"))
}, s = 0; s < n; ++s)
o(s);
return i.join(" ")
}
return ""
}
function getOffsetInfo(e, t, r, n, i) {
var o, s, a, l, c = getDocumentElement(e) || getDocumentBody(e), u = !
1;
if (!e || r)
a = e;
else {
var d = null === (o = null == e ? void 0 : e.assignedSlot) || void
0 === o ? void 0 : o.parentElement
, p = e.parentElement;
d ? (u = !0,
l = p,
a = d) : a = p
}
for (var h = !1, f = e === t || a === t, m = "relative", g = 1, y =
parseFloat(null == i ? void 0 : i("zoom")) || 1, v = null == i ? void 0 :
i("position"); a && a !== c; ) {
t === a && (f = !0);
var b = getCachedStyle(a)
, x = a.tagName.toLowerCase()
, _ = getElementTransform(a)
, E = b("willChange")
, T = parseFloat(b("zoom")) || 1;
if (m = b("position"),
n && 1 !== T) {
g = T;
break
}
if (!r && n && 1 !== y && v && "absolute" !== v || "svg" === x ||
"static" !== m || _ && "none" !== _ || "transform" === E)
break;
var C = null === (s = null == e ? void 0 : e.assignedSlot) || void
0 === s ? void 0 : s.parentNode
, S = a.parentNode;
C && (u = !0,
l = S);
var $ = S;
if ($ && 11 === $.nodeType) {
h = !0,
m = getCachedStyle(a = $.host)("position");
break
}
a = $,
m = "relative"
}
return {
offsetZoom: g,
hasSlot: u,
parentSlotElement: l,
isCustomElement: h,
isStatic: "static" === m,
isEnd: f || !a || a === c,
offsetParent: a || c
}
}
function getOffsetPosInfo(e, t) {
var r, n, i, o = e.tagName.toLowerCase(), s = e.offsetLeft, a =
e.offsetTop, l = getCachedStyle(e), c = isUndefined$3(s), u = !c;
return u || "svg" === o ? i = (n =
getTransformOriginArray(l("transformOrigin")).map((function(e) {
return parseFloat(e)
}
))).slice() : (i = (n = IS_WEBKIT605 ? getBeforeTransformOrigin(e) :
getTransformOriginArray(l("transformOrigin")).map((function(e) {
return parseFloat(e)
}
))).slice(),
u = !0,
s = (r = __read(getSVGGraphicsOffset(e, n, e === t && "g" ===
t.tagName.toLowerCase()), 4))[0],
a = r[1],
n[0] = r[2],
n[1] = r[3]),
{
tagName: o,
isSVG: c,
hasOffset: u,
offset: [s || 0, a || 0],
origin: n,
targetOrigin: i
}
}
function getBodyOffset(e, t) {
var r = getCachedStyle(e)
, n = getCachedStyle(getDocumentBody(e))
, i = n("position");
if (!(t || i && "static" !== i))
return [0, 0];
var o = parseInt(n("marginLeft"), 10)
, s = parseInt(n("marginTop"), 10);
return "absolute" === r("position") && ("auto" === r("top") && "auto"
=== r("bottom") || (s = 0),
"auto" === r("left") && "auto" === r("right") || (o = 0)),
[o, s]
}
function convert3DMatrixes(e) {
e.forEach((function(e) {
var t = e.matrix;
t && (e.matrix = convertDimension(t, 3, 4))
}
))
}
function getPositionFixedInfo(e) {
for (var t = e.parentElement, r = !1, n = getDocumentBody(e); t; ) {
var i = getComputedStyle$1(t).transform;
if (i && "none" !== i) {
r = !0;
break
}
if (t === n)
break;
t = t.parentElement
}
return {
fixedContainer: t || n,
hasTransform: r
}
}
function makeMatrixCSS(e, t) {
return void 0 === t && (t = e.length > 9),
"".concat(t ? "matrix3d" : "matrix",
"(").concat(convertMatrixtoCSS(e, !t).join(","), ")")
}
function getSVGViewBox(e) {
var t = e.clientWidth
, r = e.clientHeight;
if (!e)
return {
x: 0,
y: 0,
width: 0,
height: 0,
clientWidth: t,
clientHeight: r
};
var n = e.viewBox
, i = n && n.baseVal || {
x: 0,
y: 0,
width: 0,
height: 0
};
return {
x: i.x,
y: i.y,
width: i.width || t,
height: i.height || r,
clientWidth: t,
clientHeight: r
}
}
function getSVGMatrix(e, t) {
var r, n = getSVGViewBox(e), i = n.width, o = n.height, s =
n.clientWidth, a = n.clientHeight, l = s / i, c = a / o, u =
e.preserveAspectRatio.baseVal, d = u.align, p = u.meetOrSlice, h = [0, 0], f = [l,
c], m = [0, 0];
if (1 !== d) {
var g = (d - 2) % 3
, y = Math.floor((d - 2) / 3);
h[0] = i * g / 2,
h[1] = o * y / 2;
var v = 2 === p ? Math.max(c, l) : Math.min(l, c);
f[0] = v,
f[1] = v,
m[0] = (s - i) / 2 * g,
m[1] = (a - o) / 2 * y
}
var b = createScaleMatrix(f, t);
return r = __read(m, 2),
b[t * (t - 1)] = r[0],
b[t * (t - 1) + 1] = r[1],
getAbsoluteMatrix(b, t, h)
}
function getSVGGraphicsOffset(e, t, r) {
if (!e.getBBox || !r && "g" === e.tagName.toLowerCase())
return [0, 0, 0, 0];
var n = "fill-box" === getCachedStyle(e)("transform-box")
, i = e.getBBox()
, o = getSVGViewBox(e.ownerSVGElement)
, s = i.x - o.x
, a = i.y - o.y;
return [s, a, n ? t[0] : t[0] - s, n ? t[1] : t[1] - a]
}
function calculatePosition(e, t, r) {
return calculate(e, convertPositionMatrix(t, r), r)
}
function calculatePoses(e, t, r, n) {
return [[0, 0], [t, 0], [0, r], [t, r]].map((function(t) {
return calculatePosition(e, t, n)
}
))
}
function getRect(e) {
var t = e.map((function(e) {
return e[0]
}
))
, r = e.map((function(e) {
return e[1]
}
))
, n = Math.min.apply(Math, __spreadArray([], __read(t), !1))
, i = Math.min.apply(Math, __spreadArray([], __read(r), !1))
, o = Math.max.apply(Math, __spreadArray([], __read(t), !1))
, s = Math.max.apply(Math, __spreadArray([], __read(r), !1));
return {
left: n,
top: i,
right: o,
bottom: s,
width: o - n,
height: s - i
}
}
function calculateRect(e, t, r, n) {
return getRect(calculatePoses(e, t, r, n))
}
function getSVGOffset(e, t, r, n, i) {
var o, s = e.target, a = e.origin, l = t.matrix, c = getSize(s), u =
c.offsetWidth, d = c.offsetHeight, p = r.getBoundingClientRect(), h = [0, 0];
r === getDocumentBody(r) && (h = getBodyOffset(s, !0));
for (var f = s.getBoundingClientRect(), m = f.left - p.left +
r.scrollLeft - (r.clientLeft || 0) + h[0], g = f.top - p.top + r.scrollTop -
(r.clientTop || 0) + h[1], y = f.width, v = f.height, b = multiplies(n, i, l), x =
calculateRect(b, u, d, n), _ = x.left, E = x.top, T = x.width, C = x.height, S =
calculatePosition(b, a, n), $ = minus$1(S, [_, E]), w = [m + $[0] * y / T, g + $[1]
* v / C], P = [0, 0], R = 0; ++R < 10; ) {
var k = invert(i, n);
o = __read(minus$1(calculatePosition(k, w, n), calculatePosition(k,
S, n)), 2),
P[0] = o[0],
P[1] = o[1];
var A = calculateRect(multiplies(n, i, createOriginMatrix(P, n),
l), u, d, n)
, I = A.left - m
, O = A.top - g;
if (abs(I) < 2 && abs(O) < 2)
break;
w[0] -= I,
w[1] -= O
}
return P.map((function(e) {
return Math.round(e)
}
))
}
function calculateMoveableClientPositions(e, t, r) {
var n = 16 === e.length ? 4 : 3
, i = t.map((function(t) {
return calculatePosition(e, t, n)
}
))
, o = r.left
, s = r.top;
return i.map((function(e) {
return [e[0] + o, e[1] + s]
}
))
}
function getDistSize(e) {
return Math.sqrt(e[0] * e[0] + e[1] * e[1])
}
function getDiagonalSize(e, t) {
return getDistSize([t[0] - e[0], t[1] - e[1]])
}
function getLineStyle(e, t, r, n) {
void 0 === r && (r = 1),
void 0 === n && (n = getRad$1(e, t));
var i = getDiagonalSize(e, t);
return {
transform: "translateY(-50%) translate(".concat(e[0], "px,
").concat(e[1], "px) rotate(").concat(n, "rad) scaleY(").concat(r, ")"),
width: "".concat(i, "px")
}
}
function getControlTransform(e, t) {
for (var r = [], n = 2; n < arguments.length; n++)
r[n - 2] = arguments[n];
var i = r.length
, o = r.reduce((function(e, t) {
return e + t[0]
}
), 0) / i
, s = r.reduce((function(e, t) {
return e + t[1]
}
), 0) / i;
return {
transform: "translateZ(0px) translate(".concat(o, "px, ").concat(s,
"px) rotate(").concat(e, "rad) scale(").concat(t, ")")
}
}
function getProps(e, t) {
var r = e[t];
return isObject$8(r) ? __assign$2(__assign$2({}, e), r) : e
}
function getSize(e) {
var t = e && !isUndefined$3(e.offsetWidth)
, r = 0
, n = 0
, i = 0
, o = 0
, s = 0
, a = 0
, l = 0
, c = 0
, u = 0
, d = 0
, p = 0
, h = 0
, f = 1 / 0
, m = 1 / 0
, g = 1 / 0
, y = 1 / 0
, v = 0
, b = 0
, x = !1;
if (e)
if (t || "svg" === e.tagName.toLowerCase()) {
var _ = getCachedStyle(e)
, E = e.style
, T = "border-box" === _("boxSizing")
, C = parseFloat(_("borderLeftWidth")) || 0
, S = parseFloat(_("borderRightWidth")) || 0
, $ = parseFloat(_("borderTopWidth")) || 0
, w = parseFloat(_("borderBottomWidth")) || 0
, P = (parseFloat(_("paddingLeft")) || 0) +
(parseFloat(_("paddingRight")) || 0)
, R = (parseFloat(_("paddingTop")) || 0) +
(parseFloat(_("paddingBottom")) || 0)
, k = P + (C + S)
, A = R + ($ + w)
, I = _("position")
, O = 0
, D = 0;
if ("clientLeft"in e) {
var M = null;
if ("absolute" === I)
M = getOffsetInfo(e, getDocumentBody(e)).offsetParent;
else
M = e.parentElement;
if (M) {
var L = getCachedStyle(M);
O = parseFloat(L("width")),
D = parseFloat(L("height"))
}
}
u = Math.max(P, convertUnitSize(_("minWidth"), O) || 0),
d = Math.max(R, convertUnitSize(_("minHeight"), D) || 0),
f = convertUnitSize(_("maxWidth"), O),
m = convertUnitSize(_("maxHeight"), D),
isNaN(f) && (f = 1 / 0),
isNaN(m) && (m = 1 / 0),
v = convertUnitSize(E.width, 0) || 0,
b = convertUnitSize(E.height, 0) || 0,
s = parseFloat(_("width")) || 0,
a = parseFloat(_("height")) || 0,
r = l = abs(s - v) < 1 ? between(u, v || s, f) : s,
n = c = abs(a - b) < 1 ? between(d, b || a, m) : a,
i = l,
o = c,
T ? (g = f,
y = m,
p = u,
h = d,
l = r - k,
c = n - A) : (g = f + k,
y = m + A,
p = u + k,
h = d + A,
r = l + k,
n = c + A),
i = l + P,
o = c + R
} else {
var j = e.getBBox();
x = !0,
s = r = j.width,
a = n = j.height,
l = r,
c = n,
i = r,
o = n
}
return {
svg: x,
offsetWidth: r,
offsetHeight: n,
clientWidth: i,
clientHeight: o,
contentWidth: l,
contentHeight: c,
inlineCSSWidth: v,
inlineCSSHeight: b,
cssWidth: s,
cssHeight: a,
minWidth: u,
minHeight: d,
maxWidth: f,
maxHeight: m,
minOffsetWidth: p,
minOffsetHeight: h,
maxOffsetWidth: g,
maxOffsetHeight: y
}
}
function getRotationRad(e, t) {
return getRad$1(t > 0 ? e[0] : e[1], t > 0 ? e[1] : e[0])
}
function resetClientRect() {
return {
left: 0,
top: 0,
width: 0,
height: 0,
right: 0,
bottom: 0,
clientLeft: 0,
clientTop: 0,
clientWidth: 0,
clientHeight: 0,
scrollWidth: 0,
scrollHeight: 0
}
}
function getExtendsRect(e, t) {
var r = e === getDocumentBody(e) || e === getDocumentElement(e)
, n = {
clientLeft: e.clientLeft,
clientTop: e.clientTop,
clientWidth: e.clientWidth,
clientHeight: e.clientHeight,
scrollWidth: e.scrollWidth,
scrollHeight: e.scrollHeight,
overflow: !1
};
return r && (n.clientHeight = Math.max(t.height, n.clientHeight),
n.scrollHeight = Math.max(t.height, n.scrollHeight)),
n.overflow = "visible" !== getCachedStyle(e)("overflow"),
__assign$2(__assign$2({}, t), n)
}
function getClientRectByPosition(e, t, r, n) {
var i = e.left
, o = e.right
, s = e.top
, a = e.bottom
, l = t.top
, c = t.left
, u = {
left: c + i,
top: l + s,
right: c + o,
bottom: l + a,
width: o - i,
height: a - s
};
return r && n ? getExtendsRect(r, u) : u
}
function getClientRect$1(e, t) {
var r = 0
, n = 0
, i = 0
, o = 0;
if (e) {
var s = e.getBoundingClientRect();
r = s.left,
n = s.top,
i = s.width,
o = s.height
}
var a = {
left: r,
top: n,
width: i,
height: o,
right: r + i,
bottom: n + o
};
return e && t ? getExtendsRect(e, a) : a
}
function getTotalOrigin(e) {
var t = e.props
, r = t.groupable
, n = t.svgOrigin
, i = e.getState()
, o = i.offsetWidth
, s = i.offsetHeight
, a = i.svg
, l = i.transformOrigin;
return !r && a && n ? convertTransformOriginArray(n, o, s) : l
}
function getTotalDirection(e, t, r, n) {
var i;
if (e)
i = e;
else if (t)
i = [0, 0];
else {
i = getDirection(r.target, n)
}
return i
}
function getDirection(e, t) {
if (e) {
var r = e.getAttribute("data-rotation") || ""
, n = e.getAttribute("data-direction");
if (t.deg = r,
n) {
var i = [0, 0];
return n.indexOf("w") > -1 && (i[0] = -1),
n.indexOf("e") > -1 && (i[0] = 1),
n.indexOf("n") > -1 && (i[1] = -1),
n.indexOf("s") > -1 && (i[1] = 1),
i
}
}
}
function getAbsolutePoses(e, t) {
return [plus$1(t, e[0]), plus$1(t, e[1]), plus$1(t, e[2]), plus$1(t,
e[3])]
}
function getAbsolutePosesByState(e) {
var t = e.left
, r = e.top;
return getAbsolutePoses([e.pos1, e.pos2, e.pos3, e.pos4], [t, r])
}
function unsetAbles(e, t) {
e[t ? "controlAbles" : "targetAbles"].forEach((function(t) {
t.unset && t.unset(e)
}
))
}
function unsetGesto(e, t) {
var r = t ? "controlGesto" : "targetGesto"
, n = e[r];
!1 === (null == n ? void 0 : n.isIdle()) && unsetAbles(e, t),
null == n || n.unset(),
e[r] = null
}
function fillCSSObject(e, t) {
if (t) {
var r = getBeforeRenderableDatas(t);
r.nextStyle = __assign$2(__assign$2({}, r.nextStyle), e)
}
return {
style: e,
cssText: getKeys(e).map((function(t) {
return "".concat(decamelize(t, "-"), ": ").concat(e[t], ";")
}
)).join("")
}
}
function fillAfterTransform(e, t, r) {
var n = t.afterTransform || t.transform;
return __assign$2(__assign$2({},
fillCSSObject(__assign$2(__assign$2(__assign$2({}, e.style), t.style), {
transform: n
}), r)), {
afterTransform: n,
transform: e.transform
})
}
function fillParams(e, t, r, n) {
var i = t.datas;
i.datas || (i.datas = {});
var o = __assign$2(__assign$2({}, r), {
target: e.state.target,
clientX: t.clientX,
clientY: t.clientY,
inputEvent: t.inputEvent,
currentTarget: e,
moveable: e,
datas: i.datas,
isRequest: t.isRequest,
isRequestChild: t.isRequestChild,
isFirstDrag: !!t.isFirstDrag,
isTrusted: !1 !== t.isTrusted,
stopAble: function() {
i.isEventStart = !1
},
stopDrag: function() {
var e;
null === (e = t.stop) || void 0 === e || e.call(t)
}
});
return i.isStartEvent ? n || (i.lastEvent = o) : i.isStartEvent = !0,
o
}
function fillEndParams(e, t, r) {
var n = t.datas
, i = "isDrag"in r ? r.isDrag : t.isDrag;
return n.datas || (n.datas = {}),
__assign$2(__assign$2({
isDrag: i
}, r), {
moveable: e,
target: e.state.target,
clientX: t.clientX,
clientY: t.clientY,
inputEvent: t.inputEvent,
currentTarget: e,
lastEvent: n.lastEvent,
isDouble: t.isDouble,
datas: n.datas,
isFirstDrag: !!t.isFirstDrag
})
}
function catchEvent(e, t, r) {
e._emitter.on(t, r)
}
function triggerEvent(e, t, r, n, i) {
return e.triggerEvent(t, r, n, i)
}
function getComputedStyle$1(e, t) {
return getWindow$1(e).getComputedStyle(e, t)
}
function filterAbles(e, t, r) {
var n = {}
, i = {};
return e.filter((function(e) {
var o = e.name;
if (n[o] || !t.some((function(t) {
return e[t]
}
)))
return !1;
if (!r && e.ableGroup) {
if (i[e.ableGroup])
return !1;
i[e.ableGroup] = !0
}
return n[o] = !0,
!0
}
))
}
function equals(e, t) {
return e === t || null == e && null == t
}
function selectValue() {
for (var e = [], t = 0; t < arguments.length; t++)
e[t] = arguments[t];
for (var r = e.length - 1, n = 0; n < r; ++n) {
var i = e[n];
if (!isUndefined$3(i))
return i
}
return e[r]
}
function groupBy(e, t) {
var r = []
, n = [];
return e.forEach((function(i, o) {
var s = t(i, o, e)
, a = n.indexOf(s)
, l = r[a] || [];
-1 === a && (n.push(s),
r.push(l)),
l.push(i)
}
)),
r
}
function groupByMap(e, t) {
var r = []
, n = {};
return e.forEach((function(i, o) {
var s = t(i, o, e)
, a = n[s];
a || (a = [],
n[s] = a,
r.push(a)),
a.push(i)
}
)),
r
}
function flat(e) {
return e.reduce((function(e, t) {
return e.concat(t)
}
), [])
}
function maxOffset() {
for (var e = [], t = 0; t < arguments.length; t++)
e[t] = arguments[t];
return e.sort((function(e, t) {
return abs(t) - abs(e)
}
)),
e[0]
}
function calculateInversePosition(e, t, r) {
return calculate(invert(e, r), convertPositionMatrix(t, r), r)
}
function convertDragDist(e, t) {
var r, n = e.is3d ? 4 : 3;
return r = __read(calculateInversePosition(e.rootMatrix, [t.distX,
t.distY], n), 2),
t.distX = r[0],
t.distY = r[1],
t
}
function calculatePadding(e, t, r, n) {
if (!r[0] && !r[1])
return t;
var i = calculatePosition(e, [normalized(r[0]), 0], n)
, o = calculatePosition(e, [0, normalized(r[1])], n);
return plus$1(t, calculatePosition(e, [r[0] / getDistSize(i), r[1] /
getDistSize(o)], n))
}
function convertCSSSize(e, t, r) {
return r ? "".concat(e / t * 100, "%") : "".concat(e, "px")
}
function getTinyDist(e) {
return abs(e) <= TINY_NUM ? 0 : e
}
function getDirectionViewClassName(e) {
return function(t) {
if (!t.isDragging(e))
return "";
var r = getGestoData(t, e).deg;
return r ? prefix$7("view-control-rotation".concat(r)) : ""
}
}
function getDirectionCondition(e, t) {
return void 0 === t && (t = [e]),
function(r, n) {
if (n.isRequest)
return !!t.some((function(e) {
return n.requestAble === e
}
)) && n.parentDirection;
var i = n.inputEvent.target;
return hasClass$1(i, prefix$7("direction")) && (!e || hasClass$1(i,
prefix$7(e)))
}
}
function convertTransformInfo(e, t, r) {
var n, i = parse$1(e, {
"x%": function(e) {
return e / 100 * t.offsetWidth
},
"y%": function(e) {
return e / 100 * t.offsetHeight
}
}), o = e.slice(0, r < 0 ? void 0 : r), s = e.slice(0, r < 0 ? void 0 :
r + 1), a = e[r] || "", l = r < 0 ? [] : e.slice(r), c = r < 0 ? [] : e.slice(r +
1), u = i.slice(0, r < 0 ? void 0 : r), d = i.slice(0, r < 0 ? void 0 : r + 1), p =
null !== (n = i[r]) && void 0 !== n ? n : parse$1([""])[0], h = r < 0 ? [] :
i.slice(r), f = r < 0 ? [] : i.slice(r + 1), m = p ? [p] : [], g = toMat(u), y =
toMat(d), v = toMat(h), b = toMat(f), x = multiply(g, v, 4);
return {
transforms: e,
beforeFunctionMatrix: g,
beforeFunctionMatrix2: y,
targetFunctionMatrix: toMat(m),
afterFunctionMatrix: v,
afterFunctionMatrix2: b,
allFunctionMatrix: x,
beforeFunctions: u,
beforeFunctions2: d,
targetFunction: m[0],
afterFunctions: h,
afterFunctions2: f,
beforeFunctionTexts: o,
beforeFunctionTexts2: s,
targetFunctionText: a,
afterFunctionTexts: l,
afterFunctionTexts2: c
}
}
function isArrayFormat(e) {
return !(!e || !isObject$8(e)) && (!isNode$1(e) && (isArray$a(e) ||
"length"in e))
}
function getRefTarget(e, t) {
return e ? isNode$1(e) ? e : isString$3(e) ? t ?
document.querySelector(e) : e : isFunction$4(e) ? e() : isWindow$1(e) ? e :
"current"in e ? e.current : e : null
}
function getRefTargets(e, t) {
return e ? (isArrayFormat(e) ? [].slice.call(e) :
[e]).reduce((function(e, r) {
return isString$3(r) && t ? __spreadArray(__spreadArray([],
__read(e), !1), __read([].slice.call(document.querySelectorAll(r))), !1) :
(isArray$a(r) ? e.push(getRefTargets(r, t)) : e.push(getRefTarget(r, t)),
e)
}
), []) : []
}
function getAbsoluteRotation(e, t, r) {
var n = getRad$1(e, t) / Math.PI * 180;
return n = (n = r >= 0 ? n : 180 - n) >= 0 ? n : 360 + n
}
function getDragDistByState(e, t) {
var r = e.rootMatrix
, n = e.is3d
, i = invert(r, n ? 4 : 3);
return n || (i = convertDimension(i, 3, 4)),
i[12] = 0,
i[13] = 0,
i[14] = 0,
calculateMatrixDist(i, t)
}
function getSizeDistByDist(e, t, r, n, i) {
var o = __read(e, 2)
, s = o[0]
, a = o[1]
, l = 0
, c = 0;
if (i && s && a) {
var u = getRad$1([0, 0], t)
, d = getRad$1([0, 0], n)
, p = getDistSize(t)
, h = Math.cos(u - d) * p;
if (n[0])
if (n[1]) {
var f = n[0] * s
, m = n[1] * a
, g = Math.atan2(f + t[0], m + t[1])
, y = Math.atan2(f, m);
g < 0 && (g += 2 * Math.PI),
y < 0 && (y += 2 * Math.PI);
var v = 0;
(v = abs(g - y) < Math.PI / 2 || abs(g - y) > Math.PI / 2 *
3 ? g - y : g - (y += Math.PI)) > 2 * Math.PI ? v -= 2 * Math.PI : v > Math.PI ? v
= 2 * Math.PI - v : v < -Math.PI && (v = -2 * Math.PI - v);
var b = getDistSize([f + t[0], m + t[1]]) * Math.cos(v);
l = b * Math.sin(y) - f,
c = b * Math.cos(y) - m,
n[0] < 0 && (l *= -1),
n[1] < 0 && (c *= -1)
} else
c = (l = h) / r;
else
l = (c = h) * r
} else
l = n[0] * t[0],
c = n[1] * t[1];
return [l, c]
}
function getOffsetSizeDist(e, t, r, n) {
var i, o = r.ratio, s = r.startOffsetWidth, a = r.startOffsetHeight, l
= 0, c = 0, u = n.distX, d = n.distY, p = n.pinchScale, h = n.parentDistance, f =
n.parentDist, m = n.parentScale, g = r.fixedDirection, y = [0, 1].map((function(t)
{
return abs(e[t] - g[t])
}
)), v = [0, 1].map((function(e) {
var t = y[e];
return 0 !== t && (t = 2 / t),
t
}
));
if (f)
l = f[0],
c = f[1],
t && (l ? c || (c = l / o) : l = c * o);
else if (isNumber$4(p))
l = (p - 1) * s,
c = (p - 1) * a;
else if (m)
l = (m[0] - 1) * s,
c = (m[1] - 1) * a;
else if (h) {
var b = s * y[0]
, x = a * y[1]
, _ = getDistSize([b, x]);
l = h / _ * b * v[0],
c = h / _ * x * v[1]
} else {
var E = getDragDist({
datas: r,
distX: u,
distY: d
});
l = (i = __read(getSizeDistByDist([s, a], E = v.map((function(e, t)
{
return E[t] * e
}
)), o, e, t), 2))[0],
c = i[1]
}
return {
distWidth: l,
distHeight: c
}
}
function convertTransformUnit(e, t) {
if (t) {
if ("left" === e)
return {
x: "0%",
y: "50%"
};
if ("top" === e)
return {
x: "50%",
y: "50%"
};
if ("center" === e)
return {
x: "50%",
y: "50%"
};
if ("right" === e)
return {
x: "100%",
y: "50%"
};
if ("bottom" === e)
return {
x: "50%",
y: "100%"
};
var r = __read(e.split(" "), 2)
, n = r[0]
, i = r[1]
, o = convertTransformUnit(n || "")
, s = convertTransformUnit(i || "")
, a = __assign$2(__assign$2({}, o), s)
, l = {
x: "50%",
y: "50%"
};
return a.x && (l.x = a.x),
a.y && (l.y = a.y),
a.value && (a.x && !a.y && (l.y = a.value),
!a.x && a.y && (l.x = a.value)),
l
}
return "left" === e ? {
x: "0%"
} : "right" === e ? {
x: "100%"
} : "top" === e ? {
y: "0%"
} : "bottom" === e ? {
y: "100%"
} : e ? "center" === e ? {
value: "50%"
} : {
value: e
} : {}
}
function convertTransformOriginArray(e, t, r) {
var n = convertTransformUnit(e, !0)
, i = n.x
, o = n.y;
return [convertUnitSize(i, t) || 0, convertUnitSize(o, r) || 0]
}
function rotatePosesInfo(e, t, r) {
var n = e.map((function(e) {
return minus$1(e, t)
}
))
, i = n.map((function(e) {
return rotate(e, r)
}
));
return {
prev: n,
next: i,
result: i.map((function(e) {
return plus$1(e, t)
}
))
}
}
function isDeepArrayEquals(e, t) {
return e.length === t.length && e.every((function(e, r) {
var n = t[r]
, i = isArray$a(e)
, o = isArray$a(n);
return i && o ? isDeepArrayEquals(e, n) : !i && !o && e === n
}
))
}
function watchValue(e, t, r, n, i) {
var o = e._store
, s = o[t];
if (!(t in o)) {
if (null == i)
return o[t] = r,
r;
o[t] = i,
s = i
}
return s === r || n(s) === n(r) ? s : (o[t] = r,
r)
}
function sign(e) {
return e >= 0 ? 1 : -1
}
function abs(e) {
return Math.abs(e)
}
function countEach(e, t) {
return counter(e).map((function(e) {
return t(e)
}
))
}
function getPaddingBox(e) {
return isNumber$4(e) ? {
top: e,
left: e,
right: e,
bottom: e
} : {
left: e.left || 0,
top: e.top || 0,
right: e.right || 0,
bottom: e.bottom || 0
}
}
var Pinchable = makeAble("pinchable", {
props: ["pinchable"],
events: ["pinchStart", "pinch", "pinchEnd", "pinchGroupStart",
"pinchGroup", "pinchGroupEnd"],
dragStart: function() {
return !0
},
pinchStart: function(e, t) {
var r = t.datas
, n = t.targets
, i = t.angle
, o = t.originalDatas
, s = e.props
, a = s.pinchable
, l = s.ables;
if (!a)
return !1;
var c = "onPinch".concat(n ? "Group" : "", "Start")
, u = "drag".concat(n ? "Group" : "", "ControlStart")
, d = (!0 === a ? e.controlAbles : l.filter((function(e) {
return a.indexOf(e.name) > -1
}
))).filter((function(e) {
return e.canPinch && e[u]
}
))
, p = fillParams(e, t, {});
n && (p.targets = n);
var h = triggerEvent(e, c, p);
r.isPinch = !1 !== h,
r.ables = d;
var f = r.isPinch;
return !!f && (d.forEach((function(r) {
if (o[r.name] = o[r.name] || {},
r[u]) {
var n = __assign$2(__assign$2({}, t), {
datas: o[r.name],
parentRotate: i,
isPinch: !0
});
r[u](e, n)
}
}
)),
e.state.snapRenderInfo = {
request: t.isRequest,
direction: [0, 0]
},
f)
},
pinch: function(e, t) {
var r = t.datas
, n = t.scale
, i = t.distance
, o = t.originalDatas
, s = t.inputEvent
, a = t.targets
, l = t.angle;
if (r.isPinch) {
var c = i * (1 - 1 / n)
, u = fillParams(e, t, {});
a && (u.targets = a);
var d = "onPinch".concat(a ? "Group" : "");
triggerEvent(e, d, u);
var p = r.ables
, h = "drag".concat(a ? "Group" : "", "Control");
return p.forEach((function(r) {
r[h] && r[h](e, __assign$2(__assign$2({}, t), {
datas: o[r.name],
inputEvent: s,
resolveMatrix: !0,
pinchScale: n,
parentDistance: c,
parentRotate: l,
isPinch: !0
}))
}
)),
u
}
},
pinchEnd: function(e, t) {
var r = t.datas
, n = t.isPinch
, i = t.inputEvent
, o = t.targets
, s = t.originalDatas;
if (r.isPinch) {
var a = "onPinch".concat(o ? "Group" : "", "End")
, l = fillEndParams(e, t, {
isDrag: n
});
o && (l.targets = o),
triggerEvent(e, a, l);
var c = r.ables
, u = "drag".concat(o ? "Group" : "", "ControlEnd");
return c.forEach((function(r) {
r[u] && r[u](e, __assign$2(__assign$2({}, t), {
isDrag: n,
datas: s[r.name],
inputEvent: i,
isPinch: !0
}))
}
)),
n
}
},
pinchGroupStart: function(e, t) {
return this.pinchStart(e, __assign$2(__assign$2({}, t), {
targets: e.props.targets
}))
},
pinchGroup: function(e, t) {
return this.pinch(e, __assign$2(__assign$2({}, t), {
targets: e.props.targets
}))
},
pinchGroupEnd: function(e, t) {
return this.pinchEnd(e, __assign$2(__assign$2({}, t), {
targets: e.props.targets
}))
}
})
, directionCondition = getDirectionCondition("scalable")
, Scalable = {
name: "scalable",
ableGroup: "size",
canPinch: !0,
props: ["scalable", "throttleScale", "renderDirections", "keepRatio",
"edge", "displayAroundControls"],
events: ["scaleStart", "beforeScale", "scale", "scaleEnd",
"scaleGroupStart", "beforeScaleGroup", "scaleGroup", "scaleGroupEnd"],
render: getRenderDirections("scalable"),
dragControlCondition: directionCondition,
viewClassName: getDirectionViewClassName("scalable"),
dragControlStart: function(e, t) {
var r = t.datas
, n = t.isPinch
, i = t.inputEvent
, o = getTotalDirection(t.parentDirection, n, i, r)
, s = e.state
, a = s.width
, l = s.height
, c = s.targetTransform
, u = s.target
, d = s.pos1
, p = s.pos2
, h = s.pos4;
if (!o || !u)
return !1;
n || setDragStart(e, t),
r.datas = {},
r.transform = c,
r.prevDist = [1, 1],
r.direction = o,
r.startOffsetWidth = a,
r.startOffsetHeight = l,
r.startValue = [1, 1];
var f = !o[0] && !o[1] || o[0] || !o[1];
function m(e) {
r.ratio = e && isFinite(e) ? e : 0
}
function g(e) {
var t = getFixedDirectionInfo(r.startPositions, e);
r.fixedDirection = t.fixedDirection,
r.fixedPosition = t.fixedPosition,
r.fixedOffset = t.fixedOffset
}
setDefaultTransformIndex(e, t, "scale"),
r.isWidth = f,
r.startPositions = getAbsolutePosesByState(e.state),
r.setFixedDirection = g,
m(getDist$2(d, p) / getDist$2(p, h)),
g([-o[0], -o[1]]);
var y = function(e) {
r.minScaleSize = e
}
, v = function(e) {
r.maxScaleSize = e
};
y([-1 / 0, -1 / 0]),
v([1 / 0, 1 / 0]);
var b = fillParams(e, t, __assign$2(__assign$2({
direction: o,
set: function(e) {
r.startValue = e
},
setRatio: m,
setFixedDirection: g,
setMinScaleSize: y,
setMaxScaleSize: v
}, fillTransformStartEvent(e, t)), {
dragStart: Draggable.dragStart(e, (new
CustomGesto).dragStart([0, 0], t))
}))
, x = triggerEvent(e, "onScaleStart", b);
return r.startFixedDirection = r.fixedDirection,
!1 !== x && (r.isScale = !0,
e.state.snapRenderInfo = {
request: t.isRequest,
direction: o
}),
!!r.isScale && b
},
dragControl: function(e, t) {
resolveTransformEvent(e, t, "scale");
var r = t.datas
, n = t.parentKeepRatio
, i = t.parentFlag
, o = t.isPinch
, s = t.dragClient
, a = t.isRequest
, l = t.useSnap
, c = t.resolveMatrix
, u = r.prevDist
, d = r.direction
, p = r.startOffsetWidth
, h = r.startOffsetHeight
, f = r.isScale
, m = r.startValue
, g = r.isWidth
, y = r.ratio;
if (!f)
return !1;
var v = e.props
, b = v.throttleScale
, x = v.parentMoveable
, _ = d;
d[0] || d[1] || (_ = [1, 1]);
var E = y && (null != n ? n : v.keepRatio) || !1
, T = e.state
, C = [m[0], m[1]];
function S() {
var e = getOffsetSizeDist(_, E, r, t)
, n = e.distWidth
, i = e.distHeight
, o = p ? (p + n) / p : 1
, s = h ? (h + i) / h : 1;
m[0] || (C[0] = n / p),
m[1] || (C[1] = i / h);
var a = (_[0] || E ? o : 1) * C[0]
, l = (_[1] || E ? s : 1) * C[1];
return 0 === a && (a = sign(u[0]) * MIN_SCALE),
0 === l && (l = sign(u[1]) * MIN_SCALE),
[a, l]
}
var $ = S();
if (!o && e.props.groupable) {
var w = (T.snapRenderInfo || {}).direction;
isArray$a(w) && (w[0] || w[1]) && (T.snapRenderInfo = {
direction: d,
request: t.isRequest
})
}
triggerEvent(e, "onBeforeScale", fillParams(e, t, {
scale: $,
setFixedDirection: function(e) {
return r.setFixedDirection(e),
$ = S()
},
startFixedDirection: r.startFixedDirection,
setScale: function(e) {
$ = e
}
}, !0));
var P = [$[0] / C[0], $[1] / C[1]]
, R = s
, k = [0, 0]
, A = !s && !i && o;
if (A || c ? R = getTranslateFixedPosition(e, r.targetAllTransform,
[0, 0], [0, 0], r) : s || (R = r.fixedPosition),
o || (k = checkSnapScale(e, P, d, !l && a, r)),
E) {
_[0] && _[1] && k[0] && k[1] && (Math.abs(k[0] * p) >
Math.abs(k[1] * h) ? k[1] = 0 : k[0] = 0);
var I = !k[0] && !k[1];
if (I && (g ? P[0] = throttle$4(P[0] * C[0], b) / C[0] : P[1] =
throttle$4(P[1] * C[1], b) / C[1]),
_[0] && !_[1] || k[0] && !k[1] || I && g) {
P[0] += k[0];
var O = p * P[0] * C[0] / y;
P[1] = O / h / C[1]
} else if (!_[0] && _[1] || !k[0] && k[1] || I && !g) {
P[1] += k[1];
var D = h * P[1] * C[1] * y;
P[0] = D / p / C[0]
}
} else
P[0] += k[0],
P[1] += k[1],
k[0] || (P[0] = throttle$4(P[0] * C[0], b) / C[0]),
k[1] || (P[1] = throttle$4(P[1] * C[1], b) / C[1]);
0 === P[0] && (P[0] = sign(u[0]) * MIN_SCALE),
0 === P[1] && (P[1] = sign(u[1]) * MIN_SCALE),
$ = multiply2(P, [C[0], C[1]]);
var M = [p, h]
, L = [p * $[0], h * $[1]];
L = calculateBoundSize(L, r.minScaleSize, r.maxScaleSize, !!E &&
y),
$ = countEach(2, (function(e) {
return M[e] ? L[e] / M[e] : L[e]
}
)),
P = countEach(2, (function(e) {
return $[e] / C[e]
}
));
var j = countEach(2, (function(e) {
return u[e] ? P[e] / u[e] : P[e]
}
))
, F = "scale(".concat(P.join(", "), ")")
, N = "scale(".concat($.join(", "), ")")
, B = convertTransformFormat(r, N, F)
, z = !m[0] || !m[1]
, U = getScaleDist(e, z ? N : F, r.fixedDirection, R,
r.fixedOffset, r, z)
, V = A ? U : minus$1(U, r.prevInverseDist || [0, 0]);
if (r.prevDist = P,
r.prevInverseDist = U,
$[0] === u[0] && $[1] === u[1] && V.every((function(e) {
return !e
}
)) && !x && !A)
return !1;
var H = fillParams(e, t, __assign$2({
offsetWidth: p,
offsetHeight: h,
direction: d,
scale: $,
dist: P,
delta: j,
isPinch: !!o
}, fillTransformEvent(e, B, V, o, t)));
return triggerEvent(e, "onScale", H),
H
},
dragControlEnd: function(e, t) {
var r = t.datas;
if (!r.isScale)
return !1;
r.isScale = !1;
var n = fillEndParams(e, t, {});
return triggerEvent(e, "onScaleEnd", n),
n
},
dragGroupControlCondition: directionCondition,
dragGroupControlStart: function(e, t) {
var r = t.datas
, n = this.dragControlStart(e, t);
if (!n)
return !1;
var i = fillChildEvents(e, "resizable", t);
r.moveableScale = e.scale;
var o = triggerChildAbles(e, this, "dragControlStart", t,
(function(t, n) {
return startChildDist(e, t, r, n)
}
))
, s = function(t) {
n.setFixedDirection(t),
o.forEach((function(n, o) {
n.setFixedDirection(t),
startChildDist(e, n.moveable, r, i[o])
}
))
};
r.setFixedDirection = s;
var a = __assign$2(__assign$2({}, n), {
targets: e.props.targets,
events: o,
setFixedDirection: s
})
, l = triggerEvent(e, "onScaleGroupStart", a);
return r.isScale = !1 !== l,
!!r.isScale && a
},
dragGroupControl: function(e, t) {
var r = t.datas;
if (r.isScale) {
catchEvent(e, "onBeforeScale", (function(r) {
triggerEvent(e, "onBeforeScaleGroup", fillParams(e, t,
__assign$2(__assign$2({}, r), {
targets: e.props.targets
}), !0))
}
));
var n = this.dragControl(e, t);
if (n) {
var i = n.dist
, o = r.moveableScale;
e.scale = [i[0] * o[0], i[1] * o[1]];
var s = e.props.keepRatio
, a = r.fixedPosition
, l = triggerChildAbles(e, this, "dragControl", t,
(function(t, r) {
var n =
__read(calculate(createRotateMatrix(e.rotation / 180 * Math.PI, 3),
[r.datas.originalX * i[0], r.datas.originalY * i[1], 1], 3), 2)
, o = n[0]
, l = n[1];
return __assign$2(__assign$2({}, r), {
parentDist: null,
parentScale: i,
parentKeepRatio: s,
dragClient: plus$1(a, [o, l])
})
}
))
, c = __assign$2({
targets: e.props.targets,
events: l
}, n);
return triggerEvent(e, "onScaleGroup", c),
c
}
}
},
dragGroupControlEnd: function(e, t) {
var r = t.isDrag;
if (t.datas.isScale) {
this.dragControlEnd(e, t);
var n = triggerChildAbles(e, this, "dragControlEnd", t);
return triggerEvent(e, "onScaleGroupEnd", fillEndParams(e, t, {
targets: e.props.targets,
events: n
})),
r
}
},
request: function() {
var e = {}
, t = 0
, r = 0
, n = !1;
return {
isControl: !0,
requestStart: function(t) {
return n = t.useSnap,
{
datas: e,
parentDirection: t.direction || [1, 1],
useSnap: n
}
},
request: function(i) {
return t += i.deltaWidth,
r += i.deltaHeight,
{
datas: e,
parentDist: [t, r],
parentKeepRatio: i.keepRatio,
useSnap: n
}
},
requestEnd: function() {
return {
datas: e,
isDrag: !0,
useSnap: n
}
}
}
}
};
function getMiddleLinePos(e, t) {
return e.map((function(e, r) {
return dot$1(e, t[r], 1, 2)
}
))
}
function getTriangleRad(e, t, r) {
var n = getRad$1(e, t)
, i = getRad$1(e, r) - n;
return i >= 0 ? i : i + 2 * Math.PI
}
function isValidPos(e, t) {
var r = getTriangleRad(e[0], e[1], e[2])
, n = getTriangleRad(t[0], t[1], t[2])
, i = Math.PI;
return !(r >= i && n <= i || r <= i && n >= i)
}
var Warpable = {
name: "warpable",
ableGroup: "size",
props: ["warpable", "renderDirections", "edge",
"displayAroundControls"],
events: ["warpStart", "warp", "warpEnd"],
viewClassName: getDirectionViewClassName("warpable"),
render: function(e, t) {
var r = e.props
, n = r.resizable
, i = r.scalable
, o = r.warpable
, s = r.zoom;
if (n || i || !o)
return [];
var a = e.state
, l = a.pos1
, c = a.pos2
, u = a.pos3
, d = a.pos4
, p = getMiddleLinePos(l, c)
, h = getMiddleLinePos(c, l)
, f = getMiddleLinePos(l, u)
, m = getMiddleLinePos(u, l)
, g = getMiddleLinePos(u, d)
, y = getMiddleLinePos(d, u)
, v = getMiddleLinePos(c, d)
, b = getMiddleLinePos(d, c);
return __spreadArray([t.createElement("div", {
className: prefix$7("line"),
key: "middeLine1",
style: getLineStyle(p, g, s)
}), t.createElement("div", {
className: prefix$7("line"),
key: "middeLine2",
style: getLineStyle(h, y, s)
}), t.createElement("div", {
className: prefix$7("line"),
key: "middeLine3",
style: getLineStyle(f, v, s)
}), t.createElement("div", {
className: prefix$7("line"),
key: "middeLine4",
style: getLineStyle(m, b, s)
})], __read(renderAllDirections(e, "warpable", t)), !1)
},
dragControlCondition: function(e, t) {
if (t.isRequest)
return !1;
var r = t.inputEvent.target;
return hasClass$1(r, prefix$7("direction")) && hasClass$1(r,
prefix$7("warpable"))
},
dragControlStart: function(e, t) {
var r = t.datas
, n = t.inputEvent
, i = e.props.target
, o = getDirection(n.target, r);
if (!o || !i)
return !1;
var s = e.state
, a = s.transformOrigin
, l = s.is3d
, c = s.targetTransform
, u = s.targetMatrix
, d = s.width
, p = s.height
, h = s.left
, f = s.top;
return r.datas = {},
r.targetTransform = c,
r.warpTargetMatrix = l ? u : convertDimension(u, 3, 4),
r.targetInverseMatrix = ignoreDimension(invert(r.warpTargetMatrix,
4), 3, 4),
r.direction = o,
r.left = h,
r.top = f,
r.poses = [[0, 0], [d, 0], [0, p], [d, p]].map((function(e) {
return minus$1(e, a)
}
)),
r.nextPoses = r.poses.map((function(e) {
var t = __read(e, 2)
, n = t[0]
, i = t[1];
return calculate(r.warpTargetMatrix, [n, i, 0, 1], 4)
}
)),
r.startValue = createIdentityMatrix(4),
r.prevMatrix = createIdentityMatrix(4),
r.absolutePoses = getAbsolutePosesByState(s),
r.posIndexes = getPosIndexesByDirection(o),
setDragStart(e, t),
setDefaultTransformIndex(e, t, "matrix3d"),
s.snapRenderInfo = {
request: t.isRequest,
direction: o
},
!1 !== triggerEvent(e, "onWarpStart", fillParams(e, t, __assign$2({
set: function(e) {
r.startValue = e
}
}, fillTransformStartEvent(e, t)))) && (r.isWarp = !0),
r.isWarp
},
dragControl: function(e, t) {
var r = t.datas
, n = t.isRequest
, i = t.distX
, o = t.distY
, s = r.targetInverseMatrix
, a = r.prevMatrix
, l = r.isWarp
, c = r.startValue
, u = r.poses
, d = r.posIndexes
, p = r.absolutePoses;
if (!l)
return !1;
if (resolveTransformEvent(e, t, "matrix3d"),
hasGuidelines(e, "warpable")) {
var h = d.map((function(e) {
return p[e]
}
));
h.length > 1 && h.push([(h[0][0] + h[1][0]) / 2, (h[0][1] +
h[1][1]) / 2]);
var f = checkMoveableSnapBounds(e, n, {
horizontal: h.map((function(e) {
return e[1] + o
}
)),
vertical: h.map((function(e) {
return e[0] + i
}
))
})
, m = f.horizontal
, g = f.vertical;
o -= m.offset,
i -= g.offset
}
var y = getDragDist({
datas: r,
distX: i,
distY: o
}, !0)
, v = r.nextPoses.slice();
if (d.forEach((function(e) {
v[e] = plus$1(v[e], y)
}
)),
!NEARBY_POS.every((function(e) {
return isValidPos(e.map((function(e) {
return u[e]
}
)), e.map((function(e) {
return v[e]
}
)))
}
)))
return !1;
var b = createWarpMatrix(u[0], u[2], u[1], u[3], v[0], v[2], v[1],
v[3]);
if (!b.length)
return !1;
var x = getTransfromMatrix(r, multiply(s, b, 4), !0)
, _ = multiply(invert(a, 4), x, 4);
r.prevMatrix = x;
var E = multiply(c, x, 4)
, T = convertTransformFormat(r, "matrix3d(".concat(E.join(", "),
")"), "matrix3d(".concat(x.join(", "), ")"));
return fillOriginalTransform(t, T),
triggerEvent(e, "onWarp", fillParams(e, t, __assign$2({
delta: _,
matrix: E,
dist: x,
multiply: multiply,
transform: T
}, fillCSSObject({
transform: T
}, t)))),
!0
},
dragControlEnd: function(e, t) {
var r = t.datas
, n = t.isDrag;
return !!r.isWarp && (r.isWarp = !1,
triggerEvent(e, "onWarpEnd", fillEndParams(e, t, {})),
n)
}
}
, AREA_PIECES = prefix$7("area-pieces")
, AREA_PIECE = prefix$7("area-piece")
, AVOID = prefix$7("avoid")
, VIEW_DRAGGING = prefix$7("view-dragging");
function restoreStyle(e) {
var t = e.areaElement;
if (t) {
var r = e.state
, n = r.width
, i = r.height;
removeClass$1(t, AVOID),
t.style.cssText += "left: 0px; top: 0px; width: ".concat(n, "px;
height: ").concat(i, "px")
}
}
function renderPieces(e) {
return e.createElement("div", {
key: "area_pieces",
className: AREA_PIECES
}, e.createElement("div", {
className: AREA_PIECE
}), e.createElement("div", {
className: AREA_PIECE
}), e.createElement("div", {
className: AREA_PIECE
}), e.createElement("div", {
className: AREA_PIECE
}))
}
var DragArea = {
name: "dragArea",
props: ["dragArea", "passDragArea"],
events: ["click", "clickGroup"],
render: function(e, t) {
var r = e.props
, n = r.target
, i = r.dragArea
, o = r.groupable
, s = r.passDragArea
, a = e.getState()
, l = a.width
, c = a.height
, u = a.renderPoses
, d = s ? prefix$7("area", "pass") : prefix$7("area");
if (o)
return [t.createElement("div", {
key: "area",
ref: ref(e, "areaElement"),
className: d
}), renderPieces(t)];
if (!n || !i)
return [];
var p = createWarpMatrix([0, 0], [l, 0], [0, c], [l, c], u[0],
u[1], u[2], u[3])
, h = p.length ? makeMatrixCSS(p, !0) : "none";
return [t.createElement("div", {
key: "area",
ref: ref(e, "areaElement"),
className: d,
style: {
top: "0px",
left: "0px",
width: "".concat(l, "px"),
height: "".concat(c, "px"),
transformOrigin: "0 0",
transform: h
}
}), renderPieces(t)]
},
dragStart: function(e, t) {
var r = t.datas
, n = t.clientX
, i = t.clientY;
if (!t.inputEvent)
return !1;
r.isDragArea = !1;
var o = e.areaElement
, s = e.state
, a = s.moveableClientRect
, l = s.renderPoses
, c = s.rootMatrix
, u = s.is3d
, d = a.left
, p = a.top
, h = getRect(l)
, f = h.left
, m = h.top
, g = h.width
, y = h.height
, v = __read(calculateInversePosition(c, [n - d, i - p], u ? 4 :
3), 2)
, b = v[0]
, x = v[1]
, _ = [{
left: f,
top: m,
width: g,
height: (x -= m) - 10
}, {
left: f,
top: m,
width: (b -= f) - 10,
height: y
}, {
left: f,
top: m + x + 10,
width: g,
height: y - x - 10
}, {
left: f + b + 10,
top: m,
width: g - b - 10,
height: y
}]
, E = [].slice.call(o.nextElementSibling.children);
_.forEach((function(e, t) {
E[t].style.cssText = "left: ".concat(e.left, "px;top:
").concat(e.top, "px; width: ").concat(e.width, "px; height: ").concat(e.height,
"px;")
}
)),
addClass$1(o, AVOID),
s.disableNativeEvent = !0
},
drag: function(e, t) {
var r = t.datas
, n = t.inputEvent;
if (this.enableNativeEvent(e),
!n)
return !1;
r.isDragArea || (r.isDragArea = !0,
restoreStyle(e))
},
dragEnd: function(e, t) {
this.enableNativeEvent(e);
var r = t.inputEvent
, n = t.datas;
if (!r)
return !1;
n.isDragArea || restoreStyle(e)
},
dragGroupStart: function(e, t) {
return this.dragStart(e, t)
},
dragGroup: function(e, t) {
return this.drag(e, t)
},
dragGroupEnd: function(e, t) {
return this.dragEnd(e, t)
},
unset: function(e) {
restoreStyle(e),
e.state.disableNativeEvent = !1
},
enableNativeEvent: function(e) {
var t = e.state;
t.disableNativeEvent && requestAnimationFrame$1((function() {
t.disableNativeEvent = !1
}
))
}
}
, Origin = makeAble("origin", {
props: ["origin", "svgOrigin"],
render: function(e, t) {
var r, n = e.props, i = n.zoom, o = n.svgOrigin, s = n.groupable, a
= e.getState(), l = a.beforeOrigin, c = a.rotation, u = a.svg, d = a.allMatrix, p =
a.is3d, h = a.left, f = a.top, m = a.offsetWidth, g = a.offsetHeight;
if (!s && u && o) {
var y = __read(convertTransformOriginArray(o, m, g), 2);
r = getControlTransform(c, i, minus$1(calculatePosition(d,
[y[0], y[1]], p ? 4 : 3), [h, f]))
} else
r = getControlTransform(c, i, l);
return [t.createElement("div", {
className: prefix$7("control", "origin"),
style: r,
key: "beforeOrigin"
})]
}
});
function getDefaultScrollPosition(e) {
var t = e.scrollContainer;
return [t.scrollLeft, t.scrollTop]
}
var Scrollable = {
name: "scrollable",
canPinch: !0,
props: ["scrollable", "scrollContainer", "scrollThreshold",
"scrollThrottleTime", "getScrollPosition", "scrollOptions"],
events: ["scroll", "scrollGroup"],
dragRelation: "strong",
dragStart: function(e, t) {
var r = e.props
, n = r.scrollContainer
, i = void 0 === n ? e.getContainer() : n
, o = r.scrollOptions
, s = new DragScroll$1
, a = getRefTarget(i, !0);
t.datas.dragScroll = s,
e.state.dragScroll = s;
var l = t.isControl ? "controlGesto" : "targetGesto"
, c = t.targets;
s.on("scroll", (function(r) {
var n = r.container
, i = r.direction
, o = fillParams(e, t, {
scrollContainer: n,
direction: i
})
, s = c ? "onScrollGroup" : "onScroll";
c && (o.targets = c),
triggerEvent(e, s, o)
}
)).on("move", (function(t) {
var r = t.offsetX
, n = t.offsetY
, i = t.inputEvent;
e[l].scrollBy(r, n, i.inputEvent, !1)
}
)).on("scrollDrag", (function(t) {
(0,
t.next)(e[l].getCurrentEvent())
}
)),
s.dragStart(t, __assign$2({
container: a
}, o))
},
checkScroll: function(e, t) {
var r = t.datas.dragScroll;
if (r) {
var n = e.props
, i = n.scrollContainer
, o = void 0 === i ? e.getContainer() : i
, s = n.scrollThreshold
, a = void 0 === s ? 0 : s
, l = n.scrollThrottleTime
, c = void 0 === l ? 0 : l
, u = n.getScrollPosition
, d = void 0 === u ? getDefaultScrollPosition : u
, p = n.scrollOptions;
return r.drag(t, __assign$2({
container: o,
threshold: a,
throttleTime: c,
getScrollPosition: function(e) {
return d({
scrollContainer: e.container,
direction: e.direction
})
}
}, p)),
!0
}
},
drag: function(e, t) {
return this.checkScroll(e, t)
},
dragEnd: function(e, t) {
t.datas.dragScroll.dragEnd(),
t.datas.dragScroll = null
},
dragControlStart: function(e, t) {
return this.dragStart(e, __assign$2(__assign$2({}, t), {
isControl: !0
}))
},
dragControl: function(e, t) {
return this.drag(e, t)
},
dragControlEnd: function(e, t) {
return this.dragEnd(e, t)
},
dragGroupStart: function(e, t) {
return this.dragStart(e, __assign$2(__assign$2({}, t), {
targets: e.props.targets
}))
},
dragGroup: function(e, t) {
return this.drag(e, __assign$2(__assign$2({}, t), {
targets: e.props.targets
}))
},
dragGroupEnd: function(e, t) {
return this.dragEnd(e, __assign$2(__assign$2({}, t), {
targets: e.props.targets
}))
},
dragGroupControlStart: function(e, t) {
return this.dragStart(e, __assign$2(__assign$2({}, t), {
targets: e.props.targets,
isControl: !0
}))
},
dragGroupControl: function(e, t) {
return this.drag(e, __assign$2(__assign$2({}, t), {
targets: e.props.targets
}))
},
dragGroupControEnd: function(e, t) {
return this.dragEnd(e, __assign$2(__assign$2({}, t), {
targets: e.props.targets
}))
},
unset: function(e) {
var t, r = e.state;
null === (t = r.dragScroll) || void 0 === t || t.dragEnd(),
r.dragScroll = null
}
}
, Default = {
name: "",
props: ["target", "dragTargetSelf", "dragTarget", "dragContainer",
"container", "warpSelf", "rootContainer", "useResizeObserver",
"useMutationObserver", "zoom", "dragFocusedInput", "transformOrigin", "ables",
"className", "pinchThreshold", "pinchOutside", "triggerAblesSimultaneously",
"checkInput", "cspNonce", "translateZ", "hideDefaultLines", "props", "flushSync",
"stopPropagation", "preventClickEventOnDrag", "preventClickDefault",
"viewContainer", "persistData", "useAccuratePosition", "firstRenderState",
"linePadding", "controlPadding", "preventDefault", "requestStyles"],
events: ["changeTargets"]
}
, Padding = makeAble("padding", {
props: ["padding"],
render: function(e, t) {
var r = e.props;
if (r.dragArea)
return [];
var n = getPaddingBox(r.padding || {})
, i = n.left
, o = n.top
, s = n.right
, a = n.bottom
, l = e.getState()
, c = l.renderPoses
, u = [l.pos1, l.pos2, l.pos3, l.pos4]
, d = [];
return i > 0 && d.push([0, 2]),
o > 0 && d.push([0, 1]),
s > 0 && d.push([1, 3]),
a > 0 && d.push([2, 3]),
d.map((function(e, r) {
var n = __read(e, 2)
, i = n[0]
, o = n[1]
, s = createWarpMatrix([0, 0], [100, 0], [0, 100], [100,
100], u[i], u[o], c[i], c[o]);
if (s.length)
return t.createElement("div", {
key: "padding".concat(r),
className: prefix$7("padding"),
style: {
transform: makeMatrixCSS(s, !0)
}
})
}
))
}
})
, RADIUS_DIRECTIONS = ["nw", "ne", "se", "sw"];
function calculateRatio(e, t) {
var r = e[0] + e[1]
, n = r > t ? t / r : 1;
return e[0] *= n,
e[1] = t - e[1] * n,
e
}
var HORIZONTAL_RADIUS_ORDER = [1, 2, 5, 6]
, VERTICAL_RADIUS_ORDER = [0, 3, 4, 7]
, HORIZONTAL_RADIUS_DIRECTIONS = [1, -1, -1, 1]
, VERTICAL_RADIUS_DIRECTIONS = [1, 1, -1, -1];
function getRadiusStyles(e, t, r, n, i, o, s, a) {
void 0 === i && (i = 0),
void 0 === o && (o = 0),
void 0 === s && (s = r),
void 0 === a && (a = n);
var l = []
, c = !1
, u = e.filter((function(e) {
return !e.virtual
}
))
, d = u.map((function(e) {
var u = e.horizontal
, d = e.vertical
, p = e.pos;
if (d && !c && (c = !0,
l.push("/")),
c) {
var h = Math.max(0, 1 === d ? p[1] - o : a - p[1]);
return l.push(convertCSSSize(h, n, t)),
h
}
h = Math.max(0, 1 === u ? p[0] - i : s - p[0]);
return l.push(convertCSSSize(h, r, t)),
h
}
));
return {
radiusPoses: u,
styles: l,
raws: d
}
}
function getRadiusRange(e) {
for (var t = [0, 0], r = [0, 0], n = e.length, i = 0; i < n; ++i) {
var o = e[i];
o.sub && (o.horizontal && (0 === t[1] && (t[0] = i),
t[1] = i - t[0] + 1,
r[0] = i + 1),
o.vertical && (0 === r[1] && (r[0] = i),
r[1] = i - r[0] + 1))
}
return {
horizontalRange: t,
verticalRange: r
}
}
function getRadiusValues(e, t, r, n, i, o, s) {
var a, l, c, u;
void 0 === o && (o = [0, 0]),
void 0 === s && (s = !1);
var d = e.indexOf("/")
, p = (d > -1 ? e.slice(0, d) : e).length
, h = e.slice(0, p)
, f = e.slice(p + 1)
, m = h.length
, g = f.length
, y = g > 0
, v = __read(h, 4)
, b = v[0]
, x = void 0 === b ? "0px" : b
, _ = v[1]
, E = void 0 === _ ? x : _
, T = v[2]
, C = void 0 === T ? x : T
, S = v[3]
, $ = void 0 === S ? E : S
, w = __read(f, 4)
, P = w[0]
, R = void 0 === P ? x : P
, k = w[1]
, A = void 0 === k ? y ? R : E : k
, I = w[2]
, O = void 0 === I ? y ? R : C : I
, D = w[3]
, M = void 0 === D ? y ? A : $ : D
, L = [x, E, C, $].map((function(e) {
return convertUnitSize(e, t)
}
))
, j = [R, A, O, M].map((function(e) {
return convertUnitSize(e, r)
}
))
, F = L.slice()
, N = j.slice();
a = __read(calculateRatio([F[0], F[1]], t), 2),
F[0] = a[0],
F[1] = a[1],
l = __read(calculateRatio([F[3], F[2]], t), 2),
F[3] = l[0],
F[2] = l[1],
c = __read(calculateRatio([N[0], N[3]], r), 2),
N[0] = c[0],
N[3] = c[1],
u = __read(calculateRatio([N[1], N[2]], r), 2),
N[1] = u[0],
N[2] = u[1];
var B = s ? F : F.slice(0, Math.max(o[0], m))
, z = s ? N : N.slice(0, Math.max(o[1], g));
return __spreadArray(__spreadArray([], __read(B.map((function(e, t) {
var o = RADIUS_DIRECTIONS[t];
return {
virtual: t >= m,
horizontal: HORIZONTAL_RADIUS_DIRECTIONS[t],
vertical: 0,
pos: [n + e, i + (-1 === VERTICAL_RADIUS_DIRECTIONS[t] ? r :
0)],
sub: !0,
raw: L[t],
direction: o
}
}
))), !1), __read(z.map((function(e, r) {
var o = RADIUS_DIRECTIONS[r];
return {
virtual: r >= g,
horizontal: 0,
vertical: VERTICAL_RADIUS_DIRECTIONS[r],
pos: [n + (-1 === HORIZONTAL_RADIUS_DIRECTIONS[r] ? t : 0), i +
e],
sub: !0,
raw: j[r],
direction: o
}
}
))), !1)
}
function removeRadiusPos(e, t, r, n, i) {
void 0 === i && (i = t.length);
var o = getRadiusRange(e.slice(n))
, s = o.horizontalRange
, a = o.verticalRange
, l = r - n
, c = 0;
if (0 === l)
c = i;
else if (l > 0 && l < s[1])
c = s[1] - l;
else {
if (!(l >= a[0]))
return;
c = a[0] + a[1] - l
}
e.splice(r, c),
t.splice(r, c)
}
function addRadiusPos(e, t, r, n, i, o, s, a, l, c, u) {
void 0 === c && (c = 0),
void 0 === u && (u = 0);
var d = getRadiusRange(e.slice(r))
, p = d.horizontalRange
, h = d.verticalRange;
if (n > -1)
for (var f = 1 === HORIZONTAL_RADIUS_DIRECTIONS[n] ? o - c : a - o,
m = p[1]; m <= n; ++m) {
var g = 1 === VERTICAL_RADIUS_DIRECTIONS[m] ? u : l
, y = 0;
if (n === m ? y = o : 0 === m ? y = c + f : -1 ===
HORIZONTAL_RADIUS_DIRECTIONS[m] && (y = a - (t[r][0] - c)),
e.splice(r + m, 0, {
horizontal: HORIZONTAL_RADIUS_DIRECTIONS[m],
vertical: 0,
pos: [y, g]
}),
t.splice(r + m, 0, [y, g]),
0 === m)
break
}
else if (i > -1) {
var v = 1 === VERTICAL_RADIUS_DIRECTIONS[i] ? s - u : l - s;
if (0 === p[1] && 0 === h[1]) {
var b = [c + v, u];
e.push({
horizontal: HORIZONTAL_RADIUS_DIRECTIONS[0],
vertical: 0,
pos: b
}),
t.push(b)
}
var x = h[0];
for (m = h[1]; m <= i; ++m) {
y = 1 === HORIZONTAL_RADIUS_DIRECTIONS[m] ? c : a,
g = 0;
if (i === m ? g = s : 0 === m ? g = u + v : 1 ===
VERTICAL_RADIUS_DIRECTIONS[m] ? g = t[r + x][1] : -1 ===
VERTICAL_RADIUS_DIRECTIONS[m] && (g = l - (t[r + x][1] - u)),
e.push({
horizontal: 0,
vertical: VERTICAL_RADIUS_DIRECTIONS[m],
pos: [y, g]
}),
t.push([y, g]),
0 === m)
break
}
}
}
function splitRadiusPoses(e, t) {
return void 0 === t && (t = e.map((function(e) {
return e.raw
}
))),
{
horizontals: e.map((function(e, r) {
return e.horizontal ? t[r] : null
}
)).filter((function(e) {
return null != e
}
)),
verticals: e.map((function(e, r) {
return e.vertical ? t[r] : null
}
)).filter((function(e) {
return null != e
}
))
}
}
var CLIP_DIRECTIONS = [[0, -1, "n"], [1, 0, "e"]]
, CLIP_RECT_DIRECTIONS = [[-1, -1, "nw"], [0, -1, "n"], [1, -1, "ne"],
[1, 0, "e"], [1, 1, "se"], [0, 1, "s"], [-1, 1, "sw"], [-1, 0, "w"]];
function getClipStyles(e, t, r) {
var n = e.props.clipRelative
, i = e.state
, o = i.width
, s = i.height
, a = t
, l = a.type
, c = a.poses
, u = "rect" === l
, d = "circle" === l;
if ("polygon" === l)
return r.map((function(e) {
return "".concat(convertCSSSize(e[0], o, n), "
").concat(convertCSSSize(e[1], s, n))
}
));
if (u || "inset" === l) {
var p = r[1][1]
, h = r[3][0]
, f = r[7][0]
, m = r[5][1];
if (u)
return [p, h, m, f].map((function(e) {
return "".concat(e, "px")
}
));
var g = [p, o - h, s - m, f].map((function(e, t) {
return convertCSSSize(e, t % 2 ? o : s, n)
}
));
if (r.length > 8) {
var y = __read(minus$1(r[4], r[0]), 2)
, v = y[0]
, b = y[1];
g.push.apply(g, __spreadArray(["round"],
__read(getRadiusStyles(c.slice(8).map((function(e, t) {
return __assign$2(__assign$2({}, e), {
pos: r[t]
})
}
)), n, v, b, f, p, h, m).styles), !1))
}
return g
}
if (d || "ellipse" === l) {
var x = r[0]
, _ = convertCSSSize(abs(r[1][1] - x[1]), d ? Math.sqrt((o * o +
s * s) / 2) : s, n);
return (g = d ? [_] : [convertCSSSize(abs(r[2][0] - x[0]), o, n),
_]).push("at", convertCSSSize(x[0], o, n), convertCSSSize(x[1], s, n)),
g
}
}
function getRectPoses(e, t, r, n) {
var i = [n, (n + t) / 2, t]
, o = [e, (e + r) / 2, r];
return CLIP_RECT_DIRECTIONS.map((function(e) {
var t = __read(e, 3)
, r = t[0]
, n = t[1]
, s = t[2]
, a = i[r + 1]
, l = o[n + 1];
return {
vertical: abs(n),
horizontal: abs(r),
direction: s,
pos: [a, l]
}
}
))
}
function getControlSize(e) {
var t = [1 / 0, -1 / 0]
, r = [1 / 0, -1 / 0];
return e.forEach((function(e) {
var n = e.pos;
t[0] = Math.min(t[0], n[0]),
t[1] = Math.max(t[1], n[0]),
r[0] = Math.min(r[0], n[1]),
r[1] = Math.max(r[1], n[1])
}
)),
[abs(t[1] - t[0]), abs(r[1] - r[0])]
}
function getClipPath(e, t, r, n, i) {
var o, s, a, l, c, u, d, p, h;
if (e) {
var f = i;
if (!f) {
var m = getCachedStyle(e)
, g = m("clipPath");
f = "none" !== g ? g : m("clip")
}
if (f && "none" !== f && "auto" !== f || (f = n)) {
var y = splitBracket(f)
, v = y.prefix
, b = void 0 === v ? f : v
, x = y.value
, _ = void 0 === x ? "" : x
, E = "circle" === b
, T = " ";
if ("polygon" === b) {
T = ",";
var C = getMinMaxs((D = (R = splitComma(_ || "0% 0%, 100%
0%, 100% 100%, 0% 100%")).map((function(e) {
var n = __read(e.split(" "), 2)
, i = n[0]
, o = n[1];
return {
vertical: 1,
horizontal: 1,
pos: [convertUnitSize(i, t), convertUnitSize(o, r)]
}
}
))).map((function(e) {
return e.pos
}
)));
return {
type: b,
clipText: f,
poses: D,
splitter: T,
left: C.minX,
right: C.maxX,
top: C.minY,
bottom: C.maxY
}
}
if (E || "ellipse" === b) {
var S = ""
, $ = ""
, w = 0
, P = 0
, R = splitSpace(_);
if (E) {
var k;
k = void 0 === (s = (o = __read(R, 4))[0]) ? "50%" : s,
S = void 0 === (a = o[2]) ? "50%" : a,
$ = void 0 === (l = o[3]) ? "50%" : l,
w = convertUnitSize(k, Math.sqrt((t * t + r * r) / 2)),
P = w
} else {
var A, I;
A = void 0 === (u = (c = __read(R, 5))[0]) ? "50%" : u,
I = void 0 === (d = c[1]) ? "50%" : d,
S = void 0 === (p = c[3]) ? "50%" : p,
$ = void 0 === (h = c[4]) ? "50%" : h,
w = convertUnitSize(A, t),
P = convertUnitSize(I, r)
}
var O = [convertUnitSize(S, t), convertUnitSize($, r)]
, D = __spreadArray([{
vertical: 1,
horizontal: 1,
pos: O,
direction: "nesw"
}], __read(CLIP_DIRECTIONS.slice(0, E ? 1 :
2).map((function(e) {
return {
vertical: abs(e[1]),
horizontal: e[0],
direction: e[2],
sub: !0,
pos: [O[0] + e[0] * w, O[1] + e[1] * P]
}
}
))), !1);
return {
type: b,
clipText: f,
radiusX: w,
radiusY: P,
left: O[0] - w,
top: O[1] - P,
right: O[0] + w,
bottom: O[1] + P,
poses: D,
splitter: T
}
}
if ("inset" === b) {
var M = (R = splitSpace(_ || "0 0 0 0")).indexOf("round")
, L = (M > -1 ? R.slice(0, M) : R).length
, j = R.slice(L + 1)
, F = __read(R.slice(0, L), 4)
, N = F[0]
, B = F[1]
, z = void 0 === B ? N : B
, U = F[2]
, V = void 0 === U ? N : U
, H = F[3]
, G = void 0 === H ? z : H
, W = __read([N, V].map((function(e) {
return convertUnitSize(e, r)
}
)), 2)
, Y = W[0]
, K = W[1]
, X = __read([G, z].map((function(e) {
return convertUnitSize(e, t)
}
)), 2)
, q = X[0]
, Z = X[1]
, Q = t - Z
, J = r - K
, ee = getRadiusValues(j, Q - q, J - Y, q, Y);
return {
type: "inset",
clipText: f,
poses: D = __spreadArray(__spreadArray([],
__read(getRectPoses(Y, Q, J, q)), !1), __read(ee), !1),
top: Y,
left: q,
right: Q,
bottom: J,
radius: j,
splitter: T
}
}
if ("rect" === b) {
T = ",";
var te = __read((R = splitComma(_ || "0px, ".concat(t, "px,
").concat(r, "px, 0px"))).map((function(e) {
return splitUnit(e).value
}
)), 4)
, re = te[0];
return {
type: "rect",
clipText: f,
poses: D = getRectPoses(re, Z = te[1], K = te[2], q =
te[3]),
top: re,
right: Z,
bottom: K,
left: q,
values: R,
splitter: T
}
}
}
}
}
function moveControlPos(e, t, r, n, i) {
var o = e[t]
, s = o.direction
, a = o.sub
, l = e.map((function() {
return [0, 0]
}
))
, c = s ? s.split("") : [];
if (n && t < 8) {
var u = c.filter((function(e) {
return "w" === e || "e" === e
}
))
, d = c.filter((function(e) {
return "n" === e || "s" === e
}
))
, p = u[0]
, h = d[0];
l[t] = r;
var f = __read(getControlSize(e), 2)
, m = f[0]
, g = f[1]
, y = m && g ? m / g : 0;
if (y && i) {
var v = e[(t + 4) % 8].pos
, b = [0, 0];
s.indexOf("w") > -1 ? b[0] = -1 : s.indexOf("e") > -1 && (b[0]
= 1),
s.indexOf("n") > -1 ? b[1] = -1 : s.indexOf("s") > -1 && (b[1]
= 1);
var x = getSizeDistByDist([m, g], r, y, b, !0)
, _ = m + x[0]
, E = g + x[1]
, T = v[1]
, C = v[1]
, S = v[0]
, $ = v[0];
-1 === b[0] ? S = $ - _ : 1 === b[0] ? $ = S + _ : (S -= _ / 2,
$ += _ / 2),
-1 === b[1] ? T = C - E : C = 1 === b[1] ? T + E : (T = C - E /
2) + E;
var w = getRectPoses(T, $, C, S);
e.forEach((function(e, t) {
l[t][0] = w[t].pos[0] - e.pos[0],
l[t][1] = w[t].pos[1] - e.pos[1]
}
))
} else
e.forEach((function(e, t) {
var n = e.direction;
n && (n.indexOf(p) > -1 && (l[t][0] = r[0]),
n.indexOf(h) > -1 && (l[t][1] = r[1]))
}
)),
p && (l[1][0] = r[0] / 2,
l[5][0] = r[0] / 2),
h && (l[3][1] = r[1] / 2,
l[7][1] = r[1] / 2)
} else
s && !a ? c.forEach((function(t) {
var n = "n" === t || "s" === t;
e.forEach((function(e, i) {
var o = e.direction
, s = e.horizontal
, a = e.vertical;
o && -1 !== o.indexOf(t) && (l[i] = [n || !s ? 0 : r[0], n
&& a ? r[1] : 0])
}
))
}
)) : l[t] = r;
return l
}
function addClipPath(e, t) {
var r = __read(calculatePointerDist(e, t), 2)
, n = r[0]
, i = r[1]
, o = t.datas
, s = o.clipPath
, a = o.clipIndex
, l = s
, c = l.type
, u = l.poses
, d = l.splitter
, p = u.map((function(e) {
return e.pos
}
));
if ("polygon" === c)
p.splice(a, 0, [n, i]);
else {
if ("inset" !== c)
return;
var h = HORIZONTAL_RADIUS_ORDER.indexOf(a)
, f = VERTICAL_RADIUS_ORDER.indexOf(a)
, m = u.length;
if (addRadiusPos(u, p, 8, h, f, n, i, p[4][0], p[4][1], p[0][0],
p[0][1]),
m === u.length)
return
}
var g = getClipStyles(e, s, p)
, y = "".concat(c, "(").concat(g.join(d), ")");
triggerEvent(e, "onClip", fillParams(e, t, __assign$2({
clipEventType: "added",
clipType: c,
poses: p,
clipStyles: g,
clipStyle: y,
distX: 0,
distY: 0
}, fillCSSObject({
clipPath: y
}, t))))
}
function removeClipPath(e, t) {
var r = t.datas
, n = r.clipPath
, i = r.clipIndex
, o = n
, s = o.type
, a = o.poses
, l = o.splitter
, c = a.map((function(e) {
return e.pos
}
))
, u = c.length;
if ("polygon" === s)
a.splice(i, 1),
c.splice(i, 1);
else {
if ("inset" !== s)
return;
if (i < 8)
return;
if (removeRadiusPos(a, c, i, 8, u),
u === a.length)
return
}
var d = getClipStyles(e, n, c)
, p = "".concat(s, "(").concat(d.join(l), ")");
triggerEvent(e, "onClip", fillParams(e, t, __assign$2({
clipEventType: "removed",
clipType: s,
poses: c,
clipStyles: d,
clipStyle: p,
distX: 0,
distY: 0
}, fillCSSObject({
clipPath: p
}, t))))
}
var Clippable = {
name: "clippable",
props: ["clippable", "defaultClipPath", "customClipPath", "keepRatio",
"clipRelative", "clipArea", "dragWithClip", "clipTargetBounds",
"clipVerticalGuidelines", "clipHorizontalGuidelines", "clipSnapThreshold"],
events: ["clipStart", "clip", "clipEnd"],
css: [".control.clip-control {\nbackground: #6d6;\ncursor: pointer;\n}\
n.control.clip-control.clip-radius {\nbackground: #d66;\n}\n.line.clip-line {\
nbackground: #6e6;\ncursor: move;\nz-index: 1;\n}\n.clip-area {\nposition:
absolute;\ntop: 0;\nleft: 0;\n}\n.clip-ellipse {\nposition: absolute;\ncursor:
move;\nborder: 1px solid #6d6;\nborder: var(--zoompx) solid #6d6;\nborder-radius:
50%;\ntransform-origin: 0px 0px;\n}", ":host {\n--bounds-color: #d66;\n}",
".guideline {\npointer-events: none;\nz-index: 2;\n}", ".line.guideline.bounds {\
nbackground: #d66;\nbackground: var(--bounds-color);\n}"],
render: function(e, t) {
var r = e.props
, n = r.customClipPath
, i = r.defaultClipPath
, o = r.clipArea
, s = r.zoom
, a = r.groupable
, l = e.getState()
, c = l.target
, u = l.width
, d = l.height
, p = l.allMatrix
, h = l.is3d
, f = l.left
, m = l.top
, g = l.pos1
, y = l.pos2
, v = l.pos3
, b = l.pos4
, x = l.clipPathState
, _ = l.snapBoundInfos
, E = l.rotation;
if (!c || a)
return [];
var T = getClipPath(c, u, d, i || "inset", x || n);
if (!T)
return [];
var C = h ? 4 : 3
, S = T.type
, $ = T.poses.map((function(e) {
var t = calculatePosition(p, e.pos, C);
return [t[0] - f, t[1] - m]
}
))
, w = []
, P = []
, R = "rect" === S
, k = "inset" === S
, A = "polygon" === S;
if (R || k || A) {
var I = k ? $.slice(0, 8) : $;
P = I.map((function(e, r) {
var n = 0 === r ? I[I.length - 1] : I[r - 1]
, i = getRad$1(n, e)
, o = getDiagonalSize(n, e);
return t.createElement("div", {
key: "clipLine".concat(r),
className: prefix$7("line", "clip-line", "snap-
control"),
"data-clip-index": r,
style: {
width: "".concat(o, "px"),
transform: "translate(".concat(n[0], "px,
").concat(n[1], "px) rotate(").concat(i, "rad) scaleY(").concat(s, ")")
}
})
}
))
}
if (w = $.map((function(e, r) {
return t.createElement("div", {
key: "clipControl".concat(r),
className: prefix$7("control", "clip-control", "snap-
control"),
"data-clip-index": r,
style: {
transform: "translate(".concat(e[0], "px,
").concat(e[1], "px) rotate(").concat(E, "rad) scale(").concat(s, ")")
}
})
}
)),
k && w.push.apply(w, __spreadArray([],
__read($.slice(8).map((function(e, r) {
return t.createElement("div", {
key: "clipRadiusControl".concat(r),
className: prefix$7("control", "clip-control", "clip-
radius", "snap-control"),
"data-clip-index": 8 + r,
style: {
transform: "translate(".concat(e[0], "px,
").concat(e[1], "px) rotate(").concat(E, "rad) scale(").concat(s, ")")
}
})
}
))), !1)),
"circle" === S || "ellipse" === S) {
var O = T.left
, D = T.top
, M = T.radiusX
, L = T.radiusY
, j = __read(minus$1(calculatePosition(p, [O, D], C),
calculatePosition(p, [0, 0], C)), 2)
, F = j[0]
, N = j[1]
, B = "none";
if (!o) {
for (var z = Math.max(10, M / 5, L / 5), U = [], V = 0; V
<= z; ++V) {
var H = 2 * Math.PI / z * V;
U.push([M + (M - s) * Math.cos(H), L + (L - s) *
Math.sin(H)])
}
U.push([M, -2]),
U.push([-2, -2]),
U.push([-2, 2 * L + 2]),
U.push([2 * M + 2, 2 * L + 2]),
U.push([2 * M + 2, -2]),
U.push([M, -2]),
B = "polygon(".concat(U.map((function(e) {
return "".concat(e[0], "px ").concat(e[1], "px")
}
)).join(", "), ")")
}
w.push(t.createElement("div", {
key: "clipEllipse",
className: prefix$7("clip-ellipse", "snap-control"),
style: {
width: "".concat(2 * M, "px"),
height: "".concat(2 * L, "px"),
clipPath: B,
transform: "translate(".concat(-f + F, "px, ").concat(-
m + N, "px) ").concat(makeMatrixCSS(p))
}
}))
}
if (o) {
var G = getRect(__spreadArray([g, y, v, b], __read($), !1))
, W = G.width
, Y = G.height
, K = G.left
, X = G.top;
if (A || R || k) {
U = k ? $.slice(0, 8) : $;
w.push(t.createElement("div", {
key: "clipArea",
className: prefix$7("clip-area", "snap-control"),
style: {
width: "".concat(W, "px"),
height: "".concat(Y, "px"),
transform: "translate(".concat(K, "px, ").concat(X,
"px)"),
clipPath: "polygon(".concat(U.map((function(e) {
return "".concat(e[0] - K, "px ").concat(e[1] -
X, "px")
}
)).join(", "), ")")
}
}))
}
}
return _ && ["vertical", "horizontal"].forEach((function(e) {
var r = _[e]
, n = "horizontal" === e;
r.isSnap && P.push.apply(P, __spreadArray([],
__read(r.snap.posInfos.map((function(r, i) {
var o = r.pos
, a = minus$1(calculatePosition(p, n ? [0, o] : [o, 0],
C), [f, m])
, l = minus$1(calculatePosition(p, n ? [u, o] : [o, d],
C), [f, m]);
return renderLine(t, "", a, l, s, "clip".concat(e,
"snap").concat(i), "guideline")
}
))), !1)),
r.isBound && P.push.apply(P, __spreadArray([],
__read(r.bounds.map((function(r, i) {
var o = r.pos
, a = minus$1(calculatePosition(p, n ? [0, o] : [o, 0],
C), [f, m])
, l = minus$1(calculatePosition(p, n ? [u, o] : [o, d],
C), [f, m]);
return renderLine(t, "", a, l, s, "clip".concat(e,
"bounds").concat(i), "guideline", "bounds", "bold")
}
))), !1))
}
)),
__spreadArray(__spreadArray([], __read(w), !1), __read(P), !1)
},
dragControlCondition: function(e, t) {
return t.inputEvent && (t.inputEvent.target.getAttribute("class")
|| "").indexOf("clip") > -1
},
dragStart: function(e, t) {
var r = e.props.dragWithClip;
return !(void 0 === r || r) && this.dragControlStart(e, t)
},
drag: function(e, t) {
return this.dragControl(e, __assign$2(__assign$2({}, t), {
isDragTarget: !0
}))
},
dragEnd: function(e, t) {
return this.dragControlEnd(e, t)
},
dragControlStart: function(e, t) {
var r = e.state
, n = e.props
, i = n.defaultClipPath
, o = n.customClipPath
, s = r.target
, a = r.width
, l = r.height
, c = t.inputEvent ? t.inputEvent.target : null
, u = c && c.getAttribute("class") || ""
, d = t.datas
, p = getClipPath(s, a, l, i || "inset", o);
if (!p)
return !1;
var h = p.clipText;
return !1 === triggerEvent(e, "onClipStart", fillParams(e, t, {
clipType: p.type,
clipStyle: h,
poses: p.poses.map((function(e) {
return e.pos
}
))
})) ? (d.isClipStart = !1,
!1) : (d.isControl = u && u.indexOf("clip-control") > -1,
d.isLine = u.indexOf("clip-line") > -1,
d.isArea = u.indexOf("clip-area") > -1 || u.indexOf("clip-ellipse")
> -1,
d.clipIndex = c ? parseInt(c.getAttribute("data-clip-index"), 10) :
-1,
d.clipPath = p,
d.isClipStart = !0,
r.clipPathState = h,
setDragStart(e, t),
!0)
},
dragControl: function(e, t) {
var r, n, i, o = t.datas, s = t.originalDatas, a = t.isDragTarget;
if (!o.isClipStart)
return !1;
var l = o
, c = l.isControl
, u = l.isLine
, d = l.isArea
, p = l.clipIndex
, h = l.clipPath;
if (!h)
return !1;
var f = getProps(e.props, "clippable")
, m = f.keepRatio
, g = 0
, y = 0
, v = s.draggable
, b = getDragDist(t);
a && v ? (r = __read(v.prevBeforeDist, 2),
g = r[0],
y = r[1]) : (n = __read(b, 2),
g = n[0],
y = n[1]);
var x = [g, y]
, _ = e.state
, E = _.width
, T = _.height
, C = !d && !c && !u
, S = h.type
, $ = h.poses
, w = h.splitter
, P = $.map((function(e) {
return e.pos
}
));
C && (g = -g,
y = -y);
var R = !c || "nesw" === $[p].direction
, k = "inset" === S || "rect" === S
, A = $.map((function() {
return [0, 0]
}
));
if (c && !R) {
var I = $[p]
, O = I.horizontal
, D = I.vertical
, M = [g * abs(O), y * abs(D)];
A = moveControlPos($, p, M, k, m)
} else
R && (A = P.map((function() {
return [g, y]
}
)));
var L = P.map((function(e, t) {
return plus$1(e, A[t])
}
))
, j = __spreadArray([], __read(L), !1);
_.snapBoundInfos = null;
var F = "circle" === h.type
, N = "ellipse" === h.type;
if (F || N) {
var B = abs((re = getRect(L)).bottom - re.top)
, z = abs(N ? re.right - re.left : B)
, U = L[0][1] + B
, V = L[0][0] - z
, H = L[0][0] + z;
F && (j.push([H, re.bottom]),
A.push([1, 0])),
j.push([re.left, U]),
A.push([0, 1]),
j.push([V, re.bottom]),
A.push([1, 0])
}
var G = getDefaultGuidelines((f.clipHorizontalGuidelines ||
[]).map((function(e) {
return convertUnitSize("".concat(e), T)
}
)), (f.clipVerticalGuidelines || []).map((function(e) {
return convertUnitSize("".concat(e), E)
}
)), E, T)
, W = []
, Y = [];
if (F || N)
W = [j[4][0], j[2][0]],
Y = [j[1][1], j[3][1]];
else if (k) {
var K = [j[0], j[2], j[4], j[6]]
, X = [A[0], A[2], A[4], A[6]];
W = K.filter((function(e, t) {
return X[t][0]
}
)).map((function(e) {
return e[0]
}
)),
Y = K.filter((function(e, t) {
return X[t][1]
}
)).map((function(e) {
return e[1]
}
))
} else
W = j.filter((function(e, t) {
return A[t][0]
}
)).map((function(e) {
return e[0]
}
)),
Y = j.filter((function(e, t) {
return A[t][1]
}
)).map((function(e) {
return e[1]
}
));
var q = [0, 0]
, Z = checkSnapBounds(G, f.clipTargetBounds && {
left: 0,
top: 0,
right: E,
bottom: T
}, W, Y, 5)
, Q = Z.horizontal
, J = Z.vertical
, ee = Q.offset
, te = J.offset;
if (Q.isBound && (q[1] += ee),
J.isBound && (q[0] += te),
(N || F) && 0 === A[0][0] && 0 === A[0][1]) {
var re, ne = (re = getRect(L)).bottom - re.top, ie = N ?
re.right - re.left : ne;
ie -= J.isBound ? abs(te) : 0 === J.snapIndex ? -te : te,
ne -= Q.isBound ? abs(ee) : 0 === Q.snapIndex ? -ee : ee,
F && (ie = ne = checkSnapBoundPriority(J, Q) > 0 ? ne : ie);
var oe = j[0];
j[1][1] = oe[1] - ne,
j[2][0] = oe[0] + ie,
j[3][1] = oe[1] + ne,
j[4][0] = oe[0] - ie
} else if (k && m && c) {
var se = __read(getControlSize($), 2)
, ae = se[0]
, le = se[1]
, ce = ae && le ? ae / le : 0
, ue = $[p].direction || ""
, de = j[1][1];
U = j[5][1],
V = j[7][0],
H = j[3][0];
abs(ee) <= abs(te) ? ee = sign(ee) * abs(te) / ce : te =
sign(te) * abs(ee) * ce,
ue.indexOf("w") > -1 ? V -= te : ue.indexOf("e") > -1 ? H -= te
: (V += te / 2,
H -= te / 2),
ue.indexOf("n") > -1 ? de -= ee : ue.indexOf("s") > -1 ? U -=
ee : (de += ee / 2,
U -= ee / 2);
var pe = getRectPoses(de, H, U, V);
j.forEach((function(e, t) {
var r;
r = __read(pe[t].pos, 2),
e[0] = r[0],
e[1] = r[1]
}
))
} else
j.forEach((function(e, t) {
var r = A[t];
r[0] && (e[0] -= te),
r[1] && (e[1] -= ee)
}
));
var he = getClipStyles(e, h, L)
, fe = "".concat(S, "(").concat(he.join(w), ")");
if (_.clipPathState = fe,
F || N)
W = [j[4][0], j[2][0]],
Y = [j[1][1], j[3][1]];
else if (k) {
W = (K = [j[0], j[2], j[4], j[6]]).map((function(e) {
return e[0]
}
)),
Y = K.map((function(e) {
return e[1]
}
))
} else
W = j.map((function(e) {
return e[0]
}
)),
Y = j.map((function(e) {
return e[1]
}
));
if (_.snapBoundInfos = checkSnapBounds(G, f.clipTargetBounds && {
left: 0,
top: 0,
right: E,
bottom: T
}, W, Y, 1),
v) {
var me = _.is3d
, ge = _.allMatrix
, ye = me ? 4 : 3
, ve = q;
a && (ve = [x[0] + q[0] - b[0], x[1] + q[1] - b[1]]),
v.deltaOffset = multiply(ge, [ve[0], ve[1], 0, 0], ye)
}
return triggerEvent(e, "onClip", fillParams(e, t, __assign$2({
clipEventType: "changed",
clipType: S,
poses: L,
clipStyle: fe,
clipStyles: he,
distX: g,
distY: y
}, fillCSSObject(((i = {})["rect" === S ? "clip" : "clipPath"] =
fe,
i), t)))),
!0
},
dragControlEnd: function(e, t) {
this.unset(e);
var r = t.isDrag
, n = t.datas
, i = t.isDouble
, o = n.isLine
, s = n.isClipStart
, a = n.isControl;
return !!s && (triggerEvent(e, "onClipEnd", fillEndParams(e, t,
{})),
i && (a ? removeClipPath(e, t) : o && addClipPath(e, t)),
i || r)
},
unset: function(e) {
e.state.clipPathState = "",
e.state.snapBoundInfos = null
}
}
, OriginDraggable = {
name: "originDraggable",
props: ["originDraggable", "originRelative"],
events: ["dragOriginStart", "dragOrigin", "dragOriginEnd"],
css: [":host[data-able-origindraggable] .control.origin {\npointer-
events: auto;\n}"],
dragControlCondition: function(e, t) {
return t.isRequest ? "originDraggable" === t.requestAble :
hasClass$1(t.inputEvent.target, prefix$7("origin"))
},
dragControlStart: function(e, t) {
var r = t.datas;
setDragStart(e, t);
var n = fillParams(e, t, {
dragStart: Draggable.dragStart(e, (new
CustomGesto).dragStart([0, 0], t))
})
, i = triggerEvent(e, "onDragOriginStart", n);
return r.startOrigin = e.state.transformOrigin,
r.startTargetOrigin = e.state.targetOrigin,
r.prevOrigin = [0, 0],
r.isDragOrigin = !0,
!1 === i ? (r.isDragOrigin = !1,
!1) : n
},
dragControl: function(e, t) {
var r = t.datas
, n = t.isPinch
, i = t.isRequest;
if (!r.isDragOrigin)
return !1;
var o = __read(getDragDist(t), 2)
, s = o[0]
, a = o[1]
, l = e.state
, c = l.width
, u = l.height
, d = l.offsetMatrix
, p = l.targetMatrix
, h = l.is3d
, f = e.props.originRelative
, m = void 0 === f || f
, g = h ? 4 : 3
, y = [s, a];
if (i) {
var v = t.distOrigin;
(v[0] || v[1]) && (y = v)
}
var b = plus$1(r.startOrigin, y)
, x = plus$1(r.startTargetOrigin, y)
, _ = minus$1(y, r.prevOrigin)
, E = getNextMatrix(d, p, b, g)
, T = e.getRect()
, C = getRect(calculatePoses(E, c, u, g))
, S = [T.left - C.left, T.top - C.top];
r.prevOrigin = y;
var $ = [convertCSSSize(x[0], c, m), convertCSSSize(x[1], u,
m)].join(" ")
, w = Draggable.drag(e, setCustomDrag(t, e.state, S, !!n, !1))
, P = fillParams(e, t, __assign$2(__assign$2({
width: c,
height: u,
origin: b,
dist: y,
delta: _,
transformOrigin: $,
drag: w
}, fillCSSObject({
transformOrigin: $,
transform: w.transform
}, t)), {
afterTransform: w.transform
}));
return triggerEvent(e, "onDragOrigin", P),
P
},
dragControlEnd: function(e, t) {
return !!t.datas.isDragOrigin && (triggerEvent(e,
"onDragOriginEnd", fillEndParams(e, t, {})),
!0)
},
dragGroupControlCondition: function(e, t) {
return this.dragControlCondition(e, t)
},
dragGroupControlStart: function(e, t) {
return !!this.dragControlStart(e, t)
},
dragGroupControl: function(e, t) {
var r = this.dragControl(e, t);
return !!r && (e.transformOrigin = r.transformOrigin,
!0)
},
request: function(e) {
var t = {}
, r = e.getRect()
, n = 0
, i = 0
, o = r.transformOrigin
, s = [0, 0];
return {
isControl: !0,
requestStart: function() {
return {
datas: t
}
},
request: function(e) {
return "deltaOrigin"in e ? (s[0] += e.deltaOrigin[0],
s[1] += e.deltaOrigin[1]) : "origin"in e ? (s[0] =
e.origin[0] - o[0],
s[1] = e.origin[1] - o[1]) : ("x"in e ? n = e.x - r.left :
"deltaX"in e && (n += e.deltaX),
"y"in e ? i = e.y - r.top : "deltaY"in e && (i +=
e.deltaY)),
{
datas: t,
distX: n,
distY: i,
distOrigin: s
}
},
requestEnd: function() {
return {
datas: t,
isDrag: !0
}
}
}
}
};
function addBorderRadiusByLine(e, t, r, n) {
var i = e.filter((function(e) {
var t = e.virtual;
return e.horizontal && !t
}
)).length
, o = e.filter((function(e) {
var t = e.virtual;
return e.vertical && !t
}
)).length
, s = -1;
if (0 === t && (0 === i ? s = 0 : 1 === i && (s = 1)),
2 === t && (i <= 2 ? s = 2 : i <= 3 && (s = 3)),
3 === t && (0 === o ? s = 4 : o < 4 && (s = 7)),
1 === t && (o <= 1 ? s = 5 : o <= 2 && (s = 6)),
-1 !== s && e[s].virtual) {
var a = e[s];
addBorderRadius(e, s),
s < 4 ? a.pos[0] = r : a.pos[1] = n
}
}
function addBorderRadius(e, t) {
t < 4 ? e.slice(0, t + 1).forEach((function(e) {
e.virtual = !1
}
)) : (e[0].virtual && (e[0].virtual = !1),
e.slice(4, t + 1).forEach((function(e) {
e.virtual = !1
}
)))
}
function removeBorderRadius(e, t) {
t < 4 ? e.slice(t, 4).forEach((function(e) {
e.virtual = !0
}
)) : e.slice(t).forEach((function(e) {
e.virtual = !0
}
))
}
function getBorderRadius(e, t, r, n, i) {
void 0 === n && (n = [0, 0]);
return getRadiusValues(e && "0px" !== e ? splitSpace(e) : [], t, r, 0,
0, n, i)
}
function triggerRoundEvent(e, t, r, n, i) {
var o = e.state
, s = o.width
, a = o.height
, l = getRadiusStyles(i, e.props.roundRelative, s, a)
, c = l.raws
, u = l.styles
, d = splitRadiusPoses(l.radiusPoses, c)
, p = d.horizontals
, h = d.verticals
, f = u.join(" ");
o.borderRadiusState = f;
var m = fillParams(e, t, __assign$2({
horizontals: p,
verticals: h,
borderRadius: f,
width: s,
height: a,
delta: n,
dist: r
}, fillCSSObject({
borderRadius: f
}, t)));
return triggerEvent(e, "onRound", m),
m
}
function getStyleBorderRadius(e) {
var t, r, n = e.getState().style, i = n.borderRadius || "";
if (!i && e.props.groupable) {
var o = e.moveables[0]
, s = e.getTargets()[0];
s && ((null == o ? void 0 : o.props.target) === s ? (i = null !==
(r = null === (t = e.moveables[0]) || void 0 === t ? void 0 :
t.state.style.borderRadius) && void 0 !== r ? r : "",
n.borderRadius = i) : (i = getComputedStyle$1(s).borderRadius,
n.borderRadius = i))
}
return i
}
var Roundable = {
name: "roundable",
props: ["roundable", "roundRelative", "minRoundControls",
"maxRoundControls", "roundClickable", "roundPadding",
"isDisplayShadowRoundControls"],
events: ["roundStart", "round", "roundEnd", "roundGroupStart",
"roundGroup", "roundGroupEnd"],
css: [".control.border-radius {\nbackground: #d66;\ncursor: pointer;\
nz-index: 3;\n}", ".control.border-radius.vertical {\nbackground: #d6d;\nz-index:
2;\n}", ".control.border-radius.virtual {\nopacity: 0.5;\nz-index: 1;\n}",
":host.round-line-clickable .line.direction {\ncursor: pointer;\n}"],
className: function(e) {
var t = e.props.roundClickable;
return !0 === t || "line" === t ? prefix$7("round-line-
clickable") : ""
},
requestStyle: function() {
return ["borderRadius"]
},
requestChildStyle: function() {
return ["borderRadius"]
},
render: function(e, t) {
var r = e.getState()
, n = r.target
, i = r.width
, o = r.height
, s = r.allMatrix
, a = r.is3d
, l = r.left
, c = r.top
, u = r.borderRadiusState
, d = e.props
, p = d.minRoundControls
, h = void 0 === p ? [0, 0] : p
, f = d.maxRoundControls
, m = void 0 === f ? [4, 4] : f
, g = d.zoom
, y = d.roundPadding
, v = void 0 === y ? 0 : y
, b = d.isDisplayShadowRoundControls
, x = d.groupable;
if (!n)
return null;
var _ = u || getStyleBorderRadius(e)
, E = a ? 4 : 3
, T = getBorderRadius(_, i, o, h, !0);
if (!T)
return null;
var C = 0
, S = 0
, $ = x ? [0, 0] : [l, c];
return T.map((function(e, r) {
var n = e.horizontal
, i = e.vertical
, o = e.direction || ""
, a = __spreadArray([], __read(e.pos), !1);
S += Math.abs(n),
C += Math.abs(i),
n && o.indexOf("n") > -1 && (a[1] -= v),
i && o.indexOf("w") > -1 && (a[0] -= v),
n && o.indexOf("s") > -1 && (a[1] += v),
i && o.indexOf("e") > -1 && (a[0] += v);
var l = minus$1(calculatePosition(s, a, E), $)
, c = b && "horizontal" !== b
, u = e.vertical ? C <= m[1] && (c || !e.virtual) : S <= m[0]
&& (b || !e.virtual);
return t.createElement("div", {
key: "borderRadiusControl".concat(r),
className: prefix$7("control", "border-radius",
e.vertical ? "vertical" : "", e.virtual ? "virtual" : ""),
"data-radius-index": r,
style: {
display: u ? "block" : "none",
transform: "translate(".concat(l[0], "px,
").concat(l[1], "px) scale(").concat(g, ")")
}
})
}
))
},
dragControlCondition: function(e, t) {
if (!t.inputEvent || t.isRequest)
return !1;
var r = t.inputEvent.target.getAttribute("class") || "";
return r.indexOf("border-radius") > -1 || r.indexOf("moveable-
line") > -1 && r.indexOf("moveable-direction") > -1
},
dragGroupControlCondition: function(e, t) {
return this.dragControlCondition(e, t)
},
dragControlStart: function(e, t) {
var r = t.inputEvent
, n = t.datas
, i = r.target
, o = i.getAttribute("class") || ""
, s = o.indexOf("border-radius") > -1
, a = o.indexOf("moveable-line") > -1 && o.indexOf("moveable-
direction") > -1
, l = s ? parseInt(i.getAttribute("data-radius-index"), 10) : -1
, c = -1;
if (a) {
var u = i.getAttribute("data-line-key") || "";
u && (c = parseInt(u.replace(/render-line-/g, ""), 10),
isNaN(c) && (c = -1))
}
if (!s && !a)
return !1;
var d = fillParams(e, t, {});
if (!1 === triggerEvent(e, "onRoundStart", d))
return !1;
n.lineIndex = c,
n.controlIndex = l,
n.isControl = s,
n.isLine = a,
setDragStart(e, t);
var p = e.props
, h = p.roundRelative
, f = p.minRoundControls
, m = void 0 === f ? [0, 0] : f
, g = e.state
, y = g.width
, v = g.height;
n.isRound = !0,
n.prevDist = [0, 0];
var b = getBorderRadius(getStyleBorderRadius(e) || "", y, v, m, !0)
|| [];
return n.controlPoses = b,
g.borderRadiusState = getRadiusStyles(b, h, y, v).styles.join(" "),
d
},
dragControl: function(e, t) {
var r = t.datas
, n = r.controlPoses;
if (!r.isRound || !r.isControl || !n.length)
return !1;
var i = r.controlIndex
, o = __read(getDragDist(t), 2)
, s = o[0]
, a = o[1]
, l = [s, a]
, c = minus$1(l, r.prevDist)
, u = e.props.maxRoundControls
, d = void 0 === u ? [4, 4] : u
, p = e.state
, h = p.width
, f = p.height
, m = n[i]
, g = m.vertical
, y = m.horizontal
, v = n.map((function(e) {
var t = e.horizontal
, r = e.vertical
, n = [t * y * l[0], r * g * l[1]];
if (t) {
if (1 === d[0])
return n;
if (d[0] < 4 && t !== y)
return n
} else {
if (0 === d[1])
return n[1] = r * y * l[0] / h * f,
n;
if (g) {
if (1 === d[1])
return n;
if (d[1] < 4 && r !== g)
return n
}
}
return [0, 0]
}
));
v[i] = l;
var b = n.map((function(e, t) {
return __assign$2(__assign$2({}, e), {
pos: plus$1(e.pos, v[t])
})
}
));
return i < 4 ? b.slice(0, i + 1).forEach((function(e) {
e.virtual = !1
}
)) : b.slice(4, i + 1).forEach((function(e) {
e.virtual = !1
}
)),
r.prevDist = [s, a],
triggerRoundEvent(e, t, l, c, b)
},
dragControlEnd: function(e, t) {
var r = e.state;
r.borderRadiusState = "";
var n = t.datas
, i = t.isDouble;
if (!n.isRound)
return !1;
var o = n.isControl
, s = n.controlIndex
, a = n.isLine
, l = n.lineIndex
, c = n.controlPoses
, u = c.filter((function(e) {
return e.virtual
}
)).length
, d = e.props.roundClickable
, p = void 0 === d || d;
if (i && p) {
if (!o || !0 !== p && "control" !== p) {
if (a && (!0 === p || "line" === p)) {
var h = __read(calculatePointerDist(e, t), 2);
addBorderRadiusByLine(c, l, h[0], h[1])
}
} else
removeBorderRadius(c, s);
u !== c.filter((function(e) {
return e.virtual
}
)).length && triggerRoundEvent(e, t, [0, 0], [0, 0], c)
}
var f = fillEndParams(e, t, {});
return triggerEvent(e, "onRoundEnd", f),
r.borderRadiusState = "",
f
},
dragGroupControlStart: function(e, t) {
var r = this.dragControlStart(e, t);
if (!r)
return !1;
var n = e.moveables
, i = e.props.targets
, o = fillChildEvents(e, "roundable", t);
return triggerEvent(e, "onRoundGroupStart", __assign$2({
targets: e.props.targets,
events: o.map((function(e, t) {
return __assign$2(__assign$2({}, e), {
target: i[t],
moveable: n[t],
currentTarget: n[t]
})
}
))
}, r)),
r
},
dragGroupControl: function(e, t) {
var r = this.dragControl(e, t);
if (!r)
return !1;
var n = e.moveables
, i = e.props.targets
, o = fillChildEvents(e, "roundable", t)
, s = __assign$2({
targets: e.props.targets,
events: o.map((function(e, t) {
return __assign$2(__assign$2(__assign$2({}, e), {
target: i[t],
moveable: n[t],
currentTarget: n[t]
}), fillCSSObject({
borderRadius: r.borderRadius
}, e))
}
))
}, r);
return triggerEvent(e, "onRoundGroup", s),
s
},
dragGroupControlEnd: function(e, t) {
var r = e.moveables
, n = e.props.targets
, i = fillChildEvents(e, "roundable", t);
catchEvent(e, "onRound", (function(t) {
var o = __assign$2({
targets: e.props.targets,
events: i.map((function(e, i) {
return __assign$2(__assign$2(__assign$2({}, e), {
target: n[i],
moveable: r[i],
currentTarget: r[i]
}), fillCSSObject({
borderRadius: t.borderRadius
}, e))
}
))
}, t);
triggerEvent(e, "onRoundGroup", o)
}
));
var o = this.dragControlEnd(e, t);
if (!o)
return !1;
var s = __assign$2({
targets: e.props.targets,
events: i.map((function(e, t) {
var i;
return __assign$2(__assign$2({}, e), {
target: n[t],
moveable: r[t],
currentTarget: r[t],
lastEvent: null === (i = e.datas) || void 0 === i ?
void 0 : i.lastEvent
})
}
))
}, o);
return triggerEvent(e, "onRoundGroupEnd", s),
s
},
unset: function(e) {
e.state.borderRadiusState = ""
}
};
function isIdentityMatrix(e, t) {
var r = createIdentityMatrix(t ? 4 : 3);
return e === "matrix".concat(t ? "3d" : "", "(").concat(r.join(","),
")") || "matrix(1,0,0,1,0,0)" === e
}
var BeforeRenderable = {
isPinch: !0,
name: "beforeRenderable",
props: [],
events: ["beforeRenderStart", "beforeRender", "beforeRenderEnd",
"beforeRenderGroupStart", "beforeRenderGroup", "beforeRenderGroupEnd"],
dragRelation: "weak",
setTransform: function(e, t) {
var r = e.state
, n = r.is3d
, i = r.targetMatrix
, o = r.inlineTransform
, s = n ? "matrix3d(".concat(i.join(","), ")") :
"matrix(".concat(convertMatrixtoCSS(i, !0), ")")
, a = o && "none" !== o ? o : s;
t.datas.startTransforms = isIdentityMatrix(a, n) ? [] :
splitSpace(a)
},
resetStyle: function(e) {
var t = e.datas;
t.nextStyle = {},
t.nextTransforms = e.datas.startTransforms,
t.nextTransformAppendedIndexes = []
},
fillDragStartParams: function(e, t) {
return fillParams(e, t, {
setTransform: function(e) {
t.datas.startTransforms = isArray$a(e) ? e : splitSpace(e)
},
isPinch: !!t.isPinch
})
},
fillDragParams: function(e, t) {
return fillParams(e, t, {
isPinch: !!t.isPinch
})
},
dragStart: function(e, t) {
this.setTransform(e, t),
this.resetStyle(t),
triggerEvent(e, "onBeforeRenderStart", this.fillDragStartParams(e,
t))
},
drag: function(e, t) {
t.datas.startTransforms || this.setTransform(e, t),
this.resetStyle(t),
triggerEvent(e, "onBeforeRender", fillParams(e, t, {
isPinch: !!t.isPinch
}))
},
dragEnd: function(e, t) {
t.datas.startTransforms || (this.setTransform(e, t),
this.resetStyle(t)),
triggerEvent(e, "onBeforeRenderEnd", fillParams(e, t, {
isPinch: !!t.isPinch,
isDrag: t.isDrag
}))
},
dragGroupStart: function(e, t) {
var r = this;
this.dragStart(e, t);
var n = fillChildEvents(e, "beforeRenderable", t)
, i = e.moveables
, o = n.map((function(e, t) {
var n = i[t];
return r.setTransform(n, e),
r.resetStyle(e),
r.fillDragStartParams(n, e)
}
));
triggerEvent(e, "onBeforeRenderGroupStart", fillParams(e, t, {
isPinch: !!t.isPinch,
targets: e.props.targets,
setTransform: function() {},
events: o
}))
},
dragGroup: function(e, t) {
var r = this;
this.drag(e, t);
var n = fillChildEvents(e, "beforeRenderable", t)
, i = e.moveables
, o = n.map((function(e, t) {
var n = i[t];
return r.resetStyle(e),
r.fillDragParams(n, e)
}
));
triggerEvent(e, "onBeforeRenderGroup", fillParams(e, t, {
isPinch: !!t.isPinch,
targets: e.props.targets,
events: o
}))
},
dragGroupEnd: function(e, t) {
this.dragEnd(e, t),
triggerEvent(e, "onBeforeRenderGroupEnd", fillParams(e, t, {
isPinch: !!t.isPinch,
isDrag: t.isDrag,
targets: e.props.targets
}))
},
dragControlStart: function(e, t) {
return this.dragStart(e, t)
},
dragControl: function(e, t) {
return this.drag(e, t)
},
dragControlEnd: function(e, t) {
return this.dragEnd(e, t)
},
dragGroupControlStart: function(e, t) {
return this.dragGroupStart(e, t)
},
dragGroupControl: function(e, t) {
return this.dragGroup(e, t)
},
dragGroupControlEnd: function(e, t) {
return this.dragGroupEnd(e, t)
}
}
, Renderable = {
name: "renderable",
props: [],
events: ["renderStart", "render", "renderEnd", "renderGroupStart",
"renderGroup", "renderGroupEnd"],
dragRelation: "weak",
dragStart: function(e, t) {
triggerEvent(e, "onRenderStart", fillParams(e, t, {
isPinch: !!t.isPinch
}))
},
drag: function(e, t) {
triggerEvent(e, "onRender", this.fillDragParams(e, t))
},
dragAfter: function(e, t) {
return this.drag(e, t)
},
dragEnd: function(e, t) {
triggerEvent(e, "onRenderEnd", this.fillDragEndParams(e, t))
},
dragGroupStart: function(e, t) {
triggerEvent(e, "onRenderGroupStart", fillParams(e, t, {
isPinch: !!t.isPinch,
targets: e.props.targets
}))
},
dragGroup: function(e, t) {
var r = this
, n = fillChildEvents(e, "beforeRenderable", t)
, i = e.moveables
, o = n.map((function(e, t) {
var n = i[t];
return r.fillDragParams(n, e)
}
));
triggerEvent(e, "onRenderGroup", fillParams(e, t,
__assign$2(__assign$2({
isPinch: !!t.isPinch,
targets: e.props.targets,
transform: getNextTransformText(t),
transformObject: {}
}, fillCSSObject(getNextStyle(t))), {
events: o
})))
},
dragGroupEnd: function(e, t) {
var r = this
, n = fillChildEvents(e, "beforeRenderable", t)
, i = e.moveables
, o = n.map((function(e, t) {
var n = i[t];
return r.fillDragEndParams(n, e)
}
));
triggerEvent(e, "onRenderGroupEnd", fillParams(e, t, __assign$2({
isPinch: !!t.isPinch,
isDrag: t.isDrag,
targets: e.props.targets,
events: o,
transformObject: {},
transform: getNextTransformText(t)
}, fillCSSObject(getNextStyle(t)))))
},
dragControlStart: function(e, t) {
return this.dragStart(e, t)
},
dragControl: function(e, t) {
return this.drag(e, t)
},
dragControlAfter: function(e, t) {
return this.dragAfter(e, t)
},
dragControlEnd: function(e, t) {
return this.dragEnd(e, t)
},
dragGroupControlStart: function(e, t) {
return this.dragGroupStart(e, t)
},
dragGroupControl: function(e, t) {
return this.dragGroup(e, t)
},
dragGroupControlEnd: function(e, t) {
return this.dragGroupEnd(e, t)
},
fillDragParams: function(e, t) {
var r = {};
return parse$1(getNextTransforms(t) || []).forEach((function(e) {
r[e.name] = e.functionValue
}
)),
fillParams(e, t, __assign$2({
isPinch: !!t.isPinch,
transformObject: r,
transform: getNextTransformText(t)
}, fillCSSObject(getNextStyle(t))))
},
fillDragEndParams: function(e, t) {
var r = {};
return parse$1(getNextTransforms(t) || []).forEach((function(e) {
r[e.name] = e.functionValue
}
)),
fillParams(e, t, __assign$2({
isPinch: !!t.isPinch,
isDrag: t.isDrag,
transformObject: r,
transform: getNextTransformText(t)
}, fillCSSObject(getNextStyle(t))))
}
};
function triggerAble(e, t, r, n, i, o, s) {
o.clientDistX = o.distX,
o.clientDistY = o.distY;
var a = "Start" === i
, l = "End" === i
, c = "After" === i
, u = e.state.target
, d = o.isRequest
, p = n.indexOf("Control") > -1;
if (!u || a && p && !d && e.areaElement === o.inputEvent.target)
return !1;
var h = __spreadArray([], __read(t), !1);
if (d) {
var f = o.requestAble;
h.some((function(e) {
return e.name === f
}
)) || h.push.apply(h, __spreadArray([],
__read(e.props.ables.filter((function(e) {
return e.name === f
}
))), !1))
}
if (!h.length || h.every((function(e) {
return e.dragRelation
}
)))
return !1;
var m, g = o.inputEvent;
l && g && (m = document.elementFromPoint(o.clientX, o.clientY) ||
g.target);
var y = !1
, v = function() {
var e;
y = !0,
null === (e = o.stop) || void 0 === e || e.call(o)
}
, b = a && (!e.targetGesto || !e.controlGesto || !
e.targetGesto.isFlag() || !e.controlGesto.isFlag());
b && e.updateRect(i, !0, !1);
var x = o.datas
, _ = p ? "controlGesto" : "targetGesto"
, E = e[_]
, T = function(t, r, n) {
if (!(r in t) || E !== e[_])
return !1;
var i = t.name
, s = x[i] || (x[i] = {});
if (a && (s.isEventStart = !n || !t[n] || t[n](e, o)),
!s.isEventStart)
return !1;
var l = t[r](e, __assign$2(__assign$2({}, o), {
stop: v,
datas: s,
originalDatas: x,
inputTarget: m
}));
return e._emitter.off(),
a && !1 === l && (s.isEventStart = !1),
l
};
b && h.forEach((function(t) {
t.unset && t.unset(e)
}
)),
T(BeforeRenderable, "drag".concat(n).concat(i));
var C = 0
, S = 0;
r.forEach((function(t) {
if (y)
return !1;
var r = "".concat(t).concat(n).concat(i)
, s = "".concat(t).concat(n, "Condition");
"" !== i || d || convertDragDist(e.state, o);
var l = h.filter((function(e) {
return e[r]
}
))
, c = (l = l.filter((function(e, t) {
return e.name && l.indexOf(e) === t
}
))).filter((function(e) {
return T(e, r, s)
}
)).length;
y && ++C,
c && ++S,
!y && a && l.length && !c && (C += l.filter((function(e) {
var t = e.name;
return !!x[t].isEventStart && "strong" !== e.dragRelation
}
)).length ? 1 : 0)
}
)),
c && !S || T(Renderable, "drag".concat(n).concat(i));
var $ = E !== e[_] || C === r.length;
if ((l || y || $) && (e.state.gestos = {},
e.moveables && e.moveables.forEach((function(e) {
e.state.gestos = {}
}
)),
h.forEach((function(t) {
t.unset && t.unset(e)
}
))),
a && !$ && !d && S && e.props.preventDefault && (null == o ||
o.preventDefault()),
e.isUnmounted || $)
return !1;
(!a && S && !s || l) && (e.props.flushSync || defaultSync)((function()
{
e.updateRect(l ? i : "", !0, !1),
e.forceUpdate()
}
));
return a || l || c || !S || s || triggerAble(e, t, r, n, i + "After",
o),
!0
}
function checkMoveableTarget(e) {
return function(t) {
var r, n = t.inputEvent.target, i = e.areaElement, o =
e._dragTarget;
return !(!o || (null === (r = e.controlGesto) || void 0 === r ?
void 0 : r.isFlag())) && (n === o || o.contains(n) || n === i || !
e.isMoveableElement(n) && !e.controlBox.contains(n) || hasClass$1(n, "moveable-
area") || hasClass$1(n, "moveable-padding") || hasClass$1(n, "moveable-
edgeDraggable"))
}
}
function getTargetAbleGesto(e, t, r) {
var n = e.controlBox
, i = []
, o = e.props
, s = o.dragArea
, a = e.state.target
, l = o.dragTarget;
return i.push(n),
s && !l || i.push(t),
!s && l && a && t !== a && o.dragTargetSelf && i.push(a),
getAbleGesto(e, i, "targetAbles", r, {
dragStart: checkMoveableTarget(e),
pinchStart: checkMoveableTarget(e)
})
}
function getAbleGesto(e, t, r, n, i) {
void 0 === i && (i = {});
var o = "targetAbles" === r
, s = e.props
, a = s.pinchOutside
, l = s.pinchThreshold
, c = s.preventClickEventOnDrag
, u = s.preventClickDefault
, d = s.checkInput
, p = s.dragFocusedInput
, h = s.preventDefault
, f = {
preventDefault: void 0 === h || h,
preventRightClick: !0,
preventWheelClick: !0,
container: getRefTarget(s.dragContainer, !0) ||
getWindow$1(e.getControlBoxElement()),
pinchThreshold: l,
pinchOutside: a,
preventClickEventOnDrag: !!o && c,
preventClickEventOnDragStart: !!o && u,
preventClickEventByCondition: o ? null : function(t) {
return e.controlBox.contains(t.target)
}
,
checkInput: !!o && d,
dragFocusedInput: p
}
, m = new Gesto(t,f)
, g = "Control" === n;
return ["drag", "pinch"].forEach((function(t) {
["Start", "", "End"].forEach((function(o) {
m.on("".concat(t).concat(o), (function(s) {
var a, l = s.eventType, c = "drag" === t && s.isPinch;
if (!i[l] || i[l](s)) {
if (!c) {
var u = "drag" === t ? [t] : ["drag", t]
, d = __spreadArray([], __read(e[r]), !1);
triggerAble(e, d, u, n, o, s) ?
(e.props.stopPropagation || "Start" === o && g) && (null === (a = null == s ? void
0 : s.inputEvent) || void 0 === a || a.stopPropagation()) : s.stop()
}
} else
s.stop()
}
))
}
))
}
)),
m
}
var EventManager = function() {
function e(e, t, r) {
var n = this;
this.target = e,
this.moveable = t,
this.eventName = r,
this.ables = [],
this._onEvent = function(e) {
var t = n.eventName
, r = n.moveable;
r.state.disableNativeEvent || n.ables.forEach((function(n) {
n[t](r, {
inputEvent: e
})
}
))
}
,
e.addEventListener(r.toLowerCase(), this._onEvent)
}
return e.prototype.setAbles = function(e) {
this.ables = e
}
,
e.prototype.destroy = function() {
this.target.removeEventListener(this.eventName.toLowerCase(),
this._onEvent),
this.target = null,
this.moveable = null
}
,
e
}();
function calculateMatrixStack(e, t, r, n) {
var i;
void 0 === r && (r = t);
var o = getMatrixStackInfo(e, t)
, s = o.matrixes
, a = o.is3d
, l = o.targetMatrix
, c = o.transformOrigin
, u = o.targetOrigin
, d = o.offsetContainer
, p = o.hasFixed
, h = o.zoom
, f = getCachedMatrixContainerInfo(d, r)
, m = f.matrixes
, g = f.is3d
, y = f.offsetContainer
, v = f.zoom
, b = n || g || a
, x = b ? 4 : 3
, _ = "svg" !== e.tagName.toLowerCase() && "ownerSVGElement"in e
, E = l
, T = createIdentityMatrix(x)
, C = createIdentityMatrix(x)
, S = createIdentityMatrix(x)
, $ = createIdentityMatrix(x)
, w = s.length
, P = m.map((function(e) {
return __assign$2(__assign$2({}, e), {
matrix: e.matrix ? __spreadArray([], __read(e.matrix), !1) :
void 0
})
}
)).reverse();
s.reverse(),
!a && b && (E = convertDimension(E, 3, 4),
convert3DMatrixes(s)),
!g && b && convert3DMatrixes(P),
P.forEach((function(e) {
C = multiply(C, e.matrix, x)
}
));
var R = r || getDocumentBody(e)
, k = (null === (i = P[0]) || void 0 === i ? void 0 : i.target) ||
getOffsetInfo(R, R, !0).offsetParent
, A = P.slice(1).reduce((function(e, t) {
return multiply(e, t.matrix, x)
}
), createIdentityMatrix(x));
s.forEach((function(e, t) {
if (w - 2 === t && (S = T.slice()),
w - 1 === t && ($ = T.slice()),
!e.matrix) {
var r = getSVGOffset(e, s[t + 1], k, x, multiply(A, T, x));
e.matrix = createOriginMatrix(r, x)
}
T = multiply(T, e.matrix, x)
}
));
var I = !_ && a;
E || (E = createIdentityMatrix(I ? 4 : 3));
var O = makeMatrixCSS(_ && 16 === E.length ? convertDimension(E, 4,
3) : E, I)
, D = C;
return C = ignoreDimension(C, x, x),
{
hasZoom: 1 !== h || 1 !== v,
hasFixed: p,
matrixes: s,
rootMatrix: C,
originalRootMatrix: D,
beforeMatrix: S,
offsetMatrix: $,
allMatrix: T,
targetMatrix: E,
targetTransform: O,
inlineTransform: e.style.transform,
transformOrigin: c,
targetOrigin: u,
is3d: b,
offsetContainer: d,
offsetRootContainer: y
}
}
function calculateElementInfo(e, t, r, n) {
void 0 === r && (r = t);
var i = 0
, o = 0
, s = 0
, a = {}
, l = getSize(e);
if (e && (i = l.offsetWidth,
o = l.offsetHeight),
e) {
var c = calculateMatrixStack(e, t, r, n)
, u = calculateElementPosition(c.allMatrix, c.transformOrigin, i,
o);
a = __assign$2(__assign$2({}, c), u);
var d = calculateElementPosition(c.allMatrix, [50, 50], 100, 100);
s = getRotationRad([d.pos1, d.pos2], d.direction)
}
var p = n ? 4 : 3;
return __assign$2(__assign$2(__assign$2({
hasZoom: !1,
width: i,
height: o,
rotation: s
}, l), {
originalRootMatrix: createIdentityMatrix(p),
rootMatrix: createIdentityMatrix(p),
beforeMatrix: createIdentityMatrix(p),
offsetMatrix: createIdentityMatrix(p),
allMatrix: createIdentityMatrix(p),
targetMatrix: createIdentityMatrix(p),
targetTransform: "",
inlineTransform: "",
transformOrigin: [0, 0],
targetOrigin: [0, 0],
is3d: !!n,
left: 0,
top: 0,
right: 0,
bottom: 0,
origin: [0, 0],
pos1: [0, 0],
pos2: [0, 0],
pos3: [0, 0],
pos4: [0, 0],
direction: 1,
hasFixed: !1,
offsetContainer: null,
offsetRootContainer: null,
matrixes: []
}), a)
}
function getMoveableTargetInfo(e, t, r, n, i, o) {
void 0 === o && (o = []);
var s = 1
, a = [0, 0]
, l = resetClientRect()
, c = resetClientRect()
, u = resetClientRect()
, d = resetClientRect()
, p = [0, 0]
, h = {}
, f = calculateElementInfo(t, r, i, !0);
if (t) {
var m = getCachedStyle(t);
o.forEach((function(e) {
h[e] = m(e)
}
));
var g = f.is3d ? 4 : 3
, y = calculateElementPosition(f.offsetMatrix,
plus$1(f.transformOrigin, getOrigin(f.targetMatrix, g)), f.width, f.height);
s = y.direction,
a = plus$1(y.origin, [y.left - f.left, y.top - f.top]),
d = getClientRect$1(f.offsetRootContainer);
var v = getOffsetInfo(n, n, !0).offsetParent ||
f.offsetRootContainer;
if (f.hasZoom) {
var b = calculateElementPosition(multiply(f.originalRootMatrix,
f.allMatrix), f.transformOrigin, f.width, f.height)
, x = calculateElementPosition(f.originalRootMatrix,
getTransformOriginArray(getCachedStyle(v)("transformOrigin")).map((function(e) {
return parseFloat(e)
}
)), v.offsetWidth, v.offsetHeight);
if (l = getClientRectByPosition(b, d),
u = getClientRectByPosition(x, d, v, !0),
e) {
var _ = b.left
, E = b.top;
c = getClientRectByPosition({
left: _,
top: E,
bottom: E,
right: E
}, d)
}
} else {
l = getClientRect$1(t),
u = getCachedClientRect(v),
e && (c = getClientRect$1(e));
var T = u.left
, C = u.top
, S = u.clientLeft
, $ = u.clientTop
, w = [l.left - T, l.top - C];
p = minus$1(calculateInversePosition(f.rootMatrix, w, 4), [S +
f.left, $ + f.top])
}
}
return __assign$2({
targetClientRect: l,
containerClientRect: u,
moveableClientRect: c,
rootContainerClientRect: d,
beforeDirection: s,
beforeOrigin: a,
originalBeforeOrigin: a,
target: t,
style: h,
offsetDelta: p
}, f)
}
function getPersistState(e) {
var t = e.pos1
, r = e.pos2
, n = e.pos3
, i = e.pos4;
if (!(t && r && n && i))
return null;
var o = getMinMaxs([t, r, n, i])
, s = [o.minX, o.minY]
, a = minus$1(e.origin, s);
return t = minus$1(t, s),
r = minus$1(r, s),
n = minus$1(n, s),
i = minus$1(i, s),
__assign$2(__assign$2({}, e), {
left: e.left,
top: e.top,
posDelta: s,
pos1: t,
pos2: r,
pos3: n,
pos4: i,
origin: a,
beforeOrigin: a,
isPersisted: !0
})
}
var MoveableManager = function(e) {
function t() {
var t = null !== e && e.apply(this, arguments) || this;
return t.state = __assign$2({
container: null,
gestos: {},
renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]],
disableNativeEvent: !1,
posDelta: [0, 0]
}, getMoveableTargetInfo(null)),
t.renderState = {},
t.enabledAbles = [],
t.targetAbles = [],
t.controlAbles = [],
t.rotation = 0,
t.scale = [1, 1],
t.isMoveableMounted = !1,
t.isUnmounted = !1,
t.events = {
mouseEnter: null,
mouseLeave: null
},
t._emitter = new EventEmitter$1,
t._prevOriginalDragTarget = null,
t._originalDragTarget = null,
t._prevDragTarget = null,
t._dragTarget = null,
t._prevPropTarget = null,
t._propTarget = null,
t._prevDragArea = !1,
t._isPropTargetChanged = !1,
t._hasFirstTarget = !1,
t._reiszeObserver = null,
t._observerId = 0,
t._mutationObserver = null,
t._rootContainer = null,
t._viewContainer = null,
t._viewClassNames = [],
t._store = {},
t.checkUpdateRect = function() {
if (!t.isDragging()) {
var e = t.props.parentMoveable;
e ? e.checkUpdateRect() :
(cancelAnimationFrame$1(t._observerId),
t._observerId = requestAnimationFrame$1((function() {
t.isDragging() || t.updateRect()
}
)))
}
}
,
t._onPreventClick = function(e) {
e.stopPropagation(),
e.preventDefault()
}
,
t
}
return __extends$2(t, e),
t.prototype.render = function() {
var e = this.props
, t = this.getState()
, r = e.parentPosition
, n = e.className
, i = e.target
, o = e.zoom
, s = e.cspNonce
, a = e.translateZ
, l = e.cssStyled
, c = e.groupable
, u = e.linePadding
, d = e.controlPadding;
this._checkUpdateRootContainer(),
this.checkUpdate(),
this.updateRenderPoses();
var p = __read(r || [0, 0], 2)
, h = p[0]
, f = p[1]
, m = t.left
, g = t.top
, y = t.target
, v = t.direction
, b = t.hasFixed
, x = t.offsetDelta
, _ = e.targets
, E = this.isDragging()
, T = {};
this.getEnabledAbles().forEach((function(e) {
T["data-able-".concat(e.name.toLowerCase())] = !0
}
));
var C = this._getAbleClassName()
, S = _ && _.length && (y || c) || i || !this._hasFirstTarget &&
this.state.isPersisted
, $ = this.controlBox || this.props.firstRenderState ||
this.props.persistData
, w = [m - h, g - f];
!c && e.useAccuratePosition && (w[0] += x[0],
w[1] += x[1]);
var P = {
position: b ? "fixed" : "absolute",
display: S ? "block" : "none",
visibility: $ ? "visible" : "hidden",
transform: "translate3d(".concat(w[0], "px, ").concat(w[1],
"px, ").concat(a, ")"),
"--zoom": o,
"--zoompx": "".concat(o, "px")
};
return u && (P["--moveable-line-padding"] = u),
d && (P["--moveable-control-padding"] = d),
reactExports.createElement(l, __assign$2({
cspNonce: s,
ref: ref(this, "controlBox"),
className: "".concat(prefix$7("control-box", -1 === v ?
"reverse" : "", E ? "dragging" : ""), " ").concat(C, " ").concat(n)
}, T, {
onClick: this._onPreventClick,
style: P
}), this.renderAbles(), this._renderLines())
}
,
t.prototype.componentDidMount = function() {
this.isMoveableMounted = !0,
this.isUnmounted = !1;
var e = this.props
, t = e.parentMoveable
, r = e.container;
this._checkUpdateRootContainer(),
this._checkUpdateViewContainer(),
this._updateTargets(),
this._updateNativeEvents(),
this._updateEvents(),
this.updateCheckInput(),
this._updateObserver(this.props),
r || t || this.state.isPersisted || (this.updateRect("", !1, !1),
this.forceUpdate())
}
,
t.prototype.componentDidUpdate = function(e) {
this._checkUpdateRootContainer(),
this._checkUpdateViewContainer(),
this._updateNativeEvents(),
this._updateTargets(),
this._updateEvents(),
this.updateCheckInput(),
this._updateObserver(e)
}
,
t.prototype.componentWillUnmount = function() {
var e, t;
this.isMoveableMounted = !1,
this.isUnmounted = !0,
this._emitter.off(),
null === (e = this._reiszeObserver) || void 0 === e ||
e.disconnect(),
null === (t = this._mutationObserver) || void 0 === t ||
t.disconnect(),
this._viewContainer && this._changeAbleViewClassNames([]),
unsetGesto(this, !1),
unsetGesto(this, !0);
var r = this.events;
for (var n in r) {
var i = r[n];
i && i.destroy()
}
}
,
t.prototype.getTargets = function() {
var e = this.props.target;
return e ? [e] : []
}
,
t.prototype.getAble = function(e) {
return find$2(this.props.ables || [], (function(t) {
return t.name === e
}
))
}
,
t.prototype.getContainer = function() {
var e = this.props
, t = e.parentMoveable
, r = e.wrapperMoveable;
return e.container || r && r.getContainer() || t &&
t.getContainer() || this.controlBox.parentElement
}
,
t.prototype.getControlBoxElement = function() {
return this.controlBox
}
,
t.prototype.getDragElement = function() {
return this._dragTarget
}
,
t.prototype.isMoveableElement = function(e) {
var t;
return e && ((null === (t = e.getAttribute) || void 0 === t ? void
0 : t.call(e, "class")) || "").indexOf(PREFIX$3) > -1
}
,
t.prototype.dragStart = function(e) {
var t = this.targetGesto
, r = this.controlGesto;
return t && checkMoveableTarget(this)({
inputEvent: e
}) ? t.isFlag() || t.triggerDragStart(e) : r &&
this.isMoveableElement(e.target) && (r.isFlag() || r.triggerDragStart(e)),
this
}
,
t.prototype.hitTest = function(e) {
var t, r = this.state, n = r.target, i = r.pos1, o = r.pos2, s =
r.pos3, a = r.pos4, l = r.targetClientRect;
if (!n)
return 0;
if (isNode$1(e)) {
var c = e.getBoundingClientRect();
t = {
left: c.left,
top: c.top,
width: c.width,
height: c.height
}
} else
t = __assign$2({
width: 0,
height: 0
}, e);
var u = t.left
, d = t.top
, p = t.width
, h = t.height
, f = fitPoints([i, o, a, s], l)
, m = getOverlapSize(f, [[u, d], [u + p, d], [u + p, d + h], [u,
d + h]])
, g = getAreaSize(f);
return m && g ? Math.min(100, m / g * 100) : 0
}
,
t.prototype.isInside = function(e, t) {
var r = this.state
, n = r.target
, i = r.pos1
, o = r.pos2
, s = r.pos3
, a = r.pos4
, l = r.targetClientRect;
return !!n && isInside([e, t], fitPoints([i, o, a, s], l))
}
,
t.prototype.updateRect = function(e, t, r) {
void 0 === r && (r = !0);
var n = this.props
, i = !n.parentPosition && !n.wrapperMoveable;
i && setStoreCache(!0);
var o = n.parentMoveable
, s = this.state.target || n.target
, a = this.getContainer()
, l = o ? o._rootContainer : this._rootContainer
, c = getMoveableTargetInfo(this.controlBox, s, a, a, l || a,
this._getRequestStyles());
if (!s && this._hasFirstTarget && n.persistData) {
var u = getPersistState(n.persistData);
for (var d in u)
c[d] = u[d]
}
i && setStoreCache(),
this.updateState(c, !o && r)
}
,
t.prototype.isDragging = function(e) {
var t, r, n = this.targetGesto, i = this.controlGesto;
return (null == n ? void 0 : n.isFlag()) ? !e || !!(null === (t =
n.getEventData()[e]) || void 0 === t ? void 0 : t.isEventStart) : !!(null == i ?
void 0 : i.isFlag()) && (!e || !!(null === (r = i.getEventData()[e]) || void 0 ===
r ? void 0 : r.isEventStart))
}
,
t.prototype.updateTarget = function(e) {
this.updateRect(e, !0)
}
,
t.prototype.getRect = function() {
var e = this.state
, t = getAbsolutePosesByState(this.state)
, r = __read(t, 4)
, n = r[0]
, i = r[1]
, o = r[2]
, s = r[3]
, a = getRect(t)
, l = e.width
, c = e.height
, u = a.width
, d = a.height
, p = a.left
, h = a.top
, f = [e.left, e.top]
, m = plus$1(f, e.origin);
return {
width: u,
height: d,
left: p,
top: h,
pos1: n,
pos2: i,
pos3: o,
pos4: s,
offsetWidth: l,
offsetHeight: c,
beforeOrigin: plus$1(f, e.beforeOrigin),
origin: m,
transformOrigin: e.transformOrigin,
rotation: this.getRotation()
}
}
,
t.prototype.getManager = function() {
return this
}
,
t.prototype.stopDrag = function(e) {
var t;
e && "target" !== e || (!1 === (null == (t = this.targetGesto) ?
void 0 : t.isIdle()) && unsetAbles(this, !1),
null == t || t.stop());
e && "control" !== e || (!1 === (null == (t = this.controlGesto) ?
void 0 : t.isIdle()) && unsetAbles(this, !0),
null == t || t.stop())
}
,
t.prototype.getRotation = function() {
var e = this.state;
return getAbsoluteRotation(e.pos1, e.pos2, e.direction)
}
,
t.prototype.request = function(e, t, r) {
void 0 === t && (t = {});
var n = this
, i = n.props
, o = i.parentMoveable || i.wrapperMoveable || n
, s = o.props.ables
, a = i.groupable
, l = find$2(s, (function(t) {
return t.name === e
}
));
if (this.isDragging() || !l || !l.request)
return {
request: function() {
return this
},
requestEnd: function() {
return this
}
};
var c = l.request(n)
, u = r || t.isInstant
, d = c.isControl ? "controlAbles" : "targetAbles"
, p = "".concat(a ? "Group" : "").concat(c.isControl ?
"Control" : "")
, h = __spreadArray([], __read(o[d]), !1)
, f = {
request: function(t) {
return triggerAble(n, h, ["drag"], p, "",
__assign$2(__assign$2({}, c.request(t)), {
requestAble: e,
isRequest: !0
}), u),
f
},
requestEnd: function() {
return triggerAble(n, h, ["drag"], p, "End",
__assign$2(__assign$2({}, c.requestEnd()), {
requestAble: e,
isRequest: !0
}), u),
f
}
};
return triggerAble(n, h, ["drag"], p, "Start",
__assign$2(__assign$2({}, c.requestStart(t)), {
requestAble: e,
isRequest: !0
}), u),
u ? f.request(t).requestEnd() : f
}
,
t.prototype.getMoveables = function() {
return [this]
}
,
t.prototype.destroy = function() {
this.componentWillUnmount()
}
,
t.prototype.updateRenderPoses = function() {
var e = this.getState()
, t = this.props
, r = t.padding
, n = e.originalBeforeOrigin
, i = e.transformOrigin
, o = e.allMatrix
, s = e.is3d
, a = e.pos1
, l = e.pos2
, c = e.pos3
, u = e.pos4
, d = e.left
, p = e.top
, h = e.isPersisted;
if (r) {
var f = getPaddingBox(r)
, m = f.left
, g = f.top
, y = f.bottom
, v = f.right
, b = s ? 4 : 3
, x = multiplies(b, createOriginMatrix((h ? i :
this.controlBox && t.groupable ? n : plus$1(n, [d, p])).map((function(e) {
return -e
}
)), b), o, createOriginMatrix(i, b));
e.renderPoses = [calculatePadding(x, a, [-m, -g], b),
calculatePadding(x, l, [v, -g], b), calculatePadding(x, c, [-m, y], b),
calculatePadding(x, u, [v, y], b)]
} else
e.renderPoses = [a, l, c, u]
}
,
t.prototype.checkUpdate = function() {
this._isPropTargetChanged = !1;
var e = this.props
, t = e.target
, r = e.container
, n = e.parentMoveable
, i = this.state
, o = i.target
, s = i.container;
if (o || t) {
this.updateAbles();
var a = !equals(o, t);
if (a || !equals(s, r)) {
var l = r || this.controlBox;
l && this.unsetAbles(),
this.updateState({
target: t,
container: r
}),
!n && l && this.updateRect("End", !1, !1),
this._isPropTargetChanged = a
}
}
}
,
t.prototype.waitToChangeTarget = function() {
return new Promise((function() {}
))
}
,
t.prototype.triggerEvent = function(e, t) {
var r = this.props;
if (this._emitter.trigger(e, t),
r.parentMoveable && t.isRequest && !t.isRequestChild)
return r.parentMoveable.triggerEvent(e, t, !0);
var n = r[e];
return n && n(t)
}
,
t.prototype.useCSS = function(e, t) {
var r = this.props.customStyledMap
, n = e + t;
return r[n] || (r[n] = styled(e, t)),
r[n]
}
,
t.prototype.getState = function() {
var e, t = this.props;
(t.target || (null === (e = t.targets) || void 0 === e ? void 0 :
e.length)) && (this._hasFirstTarget = !0);
var r = this.controlBox
, n = t.persistData
, i = t.firstRenderState;
if (i && !r)
return i;
if (!this._hasFirstTarget && n) {
var o = getPersistState(n);
if (o)
return this.updateState(o, !1),
this.state
}
return this.state.isPersisted = !1,
this.state
}
,
t.prototype.updateSelectors = function() {}
,
t.prototype.unsetAbles = function() {
var e = this;
this.targetAbles.forEach((function(t) {
t.unset && t.unset(e)
}
))
}
,
t.prototype.updateAbles = function(e, t) {
void 0 === e && (e = this.props.ables),
void 0 === t && (t = "");
var r = this.props.triggerAblesSimultaneously
, n = this.getEnabledAbles(e)
, i = "drag".concat(t, "Start")
, o = "pinch".concat(t, "Start")
, s = "drag".concat(t, "ControlStart")
, a = filterAbles(n, [i, o], r)
, l = filterAbles(n, [s], r);
this.enabledAbles = n,
this.targetAbles = a,
this.controlAbles = l
}
,
t.prototype.updateState = function(e, t) {
if (t) {
if (this.isUnmounted)
return;
this.setState(e)
} else {
var r = this.state;
for (var n in e)
r[n] = e[n]
}
}
,
t.prototype.getEnabledAbles = function(e) {
void 0 === e && (e = this.props.ables);
var t = this.props;
return e.filter((function(e) {
return e && (e.always && !1 !== t[e.name] || t[e.name])
}
))
}
,
t.prototype.renderAbles = function() {
var e = this
, t = this.props.triggerAblesSimultaneously
, r = {
createElement: reactExports.createElement
};
return this.renderState = {},
groupByMap(flat(filterAbles(this.getEnabledAbles(), ["render"],
t).map((function(t) {
return (0,
t.render)(e, r) || []
}
))).filter((function(e) {
return e
}
)), (function(e) {
return e.key
}
)).map((function(e) {
return e[0]
}
))
}
,
t.prototype.updateCheckInput = function() {
this.targetGesto && (this.targetGesto.options.checkInput =
this.props.checkInput)
}
,
t.prototype._getRequestStyles = function() {
return this.getEnabledAbles().reduce((function(e, t) {
var r, n, i = null !== (n = null === (r = t.requestStyle) ||
void 0 === r ? void 0 : r.call(t)) && void 0 !== n ? n : [];
return __spreadArray(__spreadArray([], __read(e), !1),
__read(i), !1)
}
), __spreadArray([], __read(this.props.requestStyles || []), !1))
}
,
t.prototype._updateObserver = function(e) {
this._updateResizeObserver(e),
this._updateMutationObserver(e)
}
,
t.prototype._updateEvents = function() {
var e = this.controlBox
, t = this.targetAbles.length
, r = this.controlAbles.length
, n = this._dragTarget;
(!t && this.targetGesto || this._isTargetChanged(!0)) &&
(unsetGesto(this, !1),
this.updateState({
gestos: {}
})),
r || unsetGesto(this, !0),
n && t && !this.targetGesto && (this.targetGesto =
getTargetAbleGesto(this, n, "")),
!this.controlGesto && r && (this.controlGesto = getAbleGesto(this,
e, "controlAbles", "Control"))
}
,
t.prototype._updateTargets = function() {
var e = this.props;
this._prevPropTarget = this._propTarget,
this._prevDragTarget = this._dragTarget,
this._prevOriginalDragTarget = this._originalDragTarget,
this._prevDragArea = e.dragArea,
this._propTarget = e.target,
this._originalDragTarget = e.dragTarget || e.target,
this._dragTarget = getRefTarget(this._originalDragTarget, !0)
}
,
t.prototype._renderLines = function() {
var e = this.props
, t = e.zoom
, r = e.hideDefaultLines
, n = e.hideChildMoveableDefaultLines
, i = e.parentMoveable;
if (r || i && n)
return [];
var o = this.getState().renderPoses
, s = {
createElement: reactExports.createElement
};
return [[0, 1], [1, 3], [3, 2], [2, 0]].map((function(e, r) {
var n = __read(e, 2)
, i = n[0]
, a = n[1];
return renderLine(s, "", o[i], o[a], t, "render-
line-".concat(r))
}
))
}
,
t.prototype._isTargetChanged = function(e) {
var t = this.props
, r = t.dragTarget || t.target
, n = this._prevOriginalDragTarget
, i = this._prevDragArea
, o = t.dragArea;
return !o && n !== r || (e || o) && i !== o || this._prevPropTarget
!= this._propTarget
}
,
t.prototype._updateNativeEvents = function() {
var e = this
, t = this.props.dragArea ? this.areaElement : this.state.target
, r = this.events
, n = getKeys(r);
if (this._isTargetChanged())
for (var i in r) {
var o = r[i];
o && o.destroy(),
r[i] = null
}
if (t) {
var s = this.enabledAbles;
n.forEach((function(n) {
var i = filterAbles(s, [n])
, o = i.length > 0
, a = r[n];
o ? (a || (a = new EventManager(t,e,n),
r[n] = a),
a.setAbles(i)) : a && (a.destroy(),
r[n] = null)
}
))
}
}
,
t.prototype._checkUpdateRootContainer = function() {
var e = this.props.rootContainer;
!this._rootContainer && e && (this._rootContainer = getRefTarget(e,
!0))
}
,
t.prototype._checkUpdateViewContainer = function() {
var e = this.props.viewContainer;
!this._viewContainer && e && (this._viewContainer = getRefTarget(e,
!0)),
this._viewContainer &&
this._changeAbleViewClassNames(__spreadArray(__spreadArray([],
__read(this._getAbleViewClassNames()), !1), [this.isDragging() ? VIEW_DRAGGING :
""], !1))
}
,
t.prototype._changeAbleViewClassNames = function(e) {
var t = this._viewContainer
, r = groupBy(e.filter(Boolean), (function(e) {
return e
}
)).map((function(e) {
return __read(e, 1)[0]
}
))
, n = this._viewClassNames
, i = diff$1(n, r)
, o = i.removed
, s = i.added;
o.forEach((function(e) {
removeClass$1(t, n[e])
}
)),
s.forEach((function(e) {
addClass$1(t, r[e])
}
)),
this._viewClassNames = r
}
,
t.prototype._getAbleViewClassNames = function() {
var e = this;
return (this.getEnabledAbles().map((function(t) {
var r;
return (null === (r = t.viewClassName) || void 0 === r ? void 0
: r.call(t, e)) || ""
}
)).join(" ") + " ".concat(this._getAbleClassName("-
view"))).split(/\s+/g)
}
,
t.prototype._getAbleClassName = function(e) {
var t = this;
void 0 === e && (e = "");
var r = this.getEnabledAbles()
, n = this.targetGesto
, i = this.controlGesto
, o = (null == n ? void 0 : n.isFlag()) ? n.getEventData() : {}
, s = (null == i ? void 0 : i.isFlag()) ? i.getEventData() : {};
return r.map((function(r) {
var n, i, a, l = r.name, c = (null === (n = r.className) ||
void 0 === n ? void 0 : n.call(r, t)) || "";
return ((null === (i = o[l]) || void 0 === i ? void 0 :
i.isEventStart) || (null === (a = s[l]) || void 0 === a ? void 0 : a.isEventStart))
&& (c += " ".concat(prefix$7("".concat(l).concat(e, "-dragging")))),
c.trim()
}
)).filter(Boolean).join(" ")
}
,
t.prototype._updateResizeObserver = function(e) {
var t, r = this.props, n = r.target, i =
getWindow$1(this.getControlBoxElement());
if (i.ResizeObserver && n && r.useResizeObserver) {
if (e.target !== n || !this._reiszeObserver) {
var o = new i.ResizeObserver(this.checkUpdateRect);
o.observe(n, {
box: "border-box"
}),
this._reiszeObserver = o
}
} else
null === (t = this._reiszeObserver) || void 0 === t ||
t.disconnect()
}
,
t.prototype._updateMutationObserver = function(e) {
var t, r = this, n = this.props, i = n.target, o =
getWindow$1(this.getControlBoxElement());
if (o.MutationObserver && i && n.useMutationObserver) {
if (e.target !== i || !this._mutationObserver) {
var s = new o.MutationObserver((function(e) {
var t, n;
try {
for (var i = __values(e), o = i.next(); !o.done; o
= i.next()) {
var s = o.value;
"attributes" === s.type && "style" ===
s.attributeName && r.checkUpdateRect()
}
} catch (a) {
t = {
error: a
}
} finally {
try {
o && !o.done && (n = i.return) && n.call(i)
} finally {
if (t)
throw t.error
}
}
}
));
s.observe(i, {
attributes: !0
}),
this._mutationObserver = s
}
} else
null === (t = this._mutationObserver) || void 0 === t ||
t.disconnect()
}
,
t.defaultProps = {
dragTargetSelf: !1,
target: null,
dragTarget: null,
container: null,
rootContainer: null,
origin: !0,
parentMoveable: null,
wrapperMoveable: null,
isWrapperMounted: !1,
parentPosition: null,
warpSelf: !1,
svgOrigin: "",
dragContainer: null,
useResizeObserver: !1,
useMutationObserver: !1,
preventDefault: !0,
linePadding: 0,
controlPadding: 0,
ables: [],
pinchThreshold: 20,
dragArea: !1,
passDragArea: !1,
transformOrigin: "",
className: "",
zoom: 1,
triggerAblesSimultaneously: !1,
padding: {},
pinchOutside: !0,
checkInput: !1,
dragFocusedInput: !1,
groupable: !1,
hideDefaultLines: !1,
cspNonce: "",
translateZ: 0,
cssStyled: null,
customStyledMap: {},
props: {},
stopPropagation: !1,
preventClickDefault: !1,
preventClickEventOnDrag: !0,
flushSync: defaultSync,
firstRenderState: null,
persistData: null,
viewContainer: null,
requestStyles: [],
useAccuratePosition: !1
},
t
}(reactExports.PureComponent)
, Groupable = {
name: "groupable",
props: ["defaultGroupRotate", "useDefaultGroupRotate",
"defaultGroupOrigin", "groupable", "groupableProps", "targetGroups",
"hideChildMoveableDefaultLines"],
events: [],
render: function(e, t) {
var r, n = e.props, i = n.targets || [], o = e.getState(), s =
o.left, a = o.top, l = o.isPersisted, c = n.zoom || 1, u = e.renderGroupRects, d =
(null === (r = n.persistData) || void 0 === r ? void 0 : r.children) || [];
l ? i = d.map((function() {
return null
}
)) : d = [];
var p = watchValue(e, "parentPosition", [s, a], (function(e) {
return e.join(",")
}
))
, h = watchValue(e, "requestStyles", e.getRequestChildStyles(),
(function(e) {
return e.join(",")
}
));
return e.moveables = e.moveables.slice(0, i.length),
__spreadArray(__spreadArray([], __read(i.map((function(r, i) {
return t.createElement(MoveableManager, {
key: "moveable" + i,
ref: refs(e, "moveables", i),
target: r,
origin: !1,
requestStyles: h,
cssStyled: n.cssStyled,
customStyledMap: n.customStyledMap,
useResizeObserver: n.useResizeObserver,
useMutationObserver: n.useMutationObserver,
hideChildMoveableDefaultLines:
n.hideChildMoveableDefaultLines,
parentMoveable: e,
parentPosition: [s, a],
persistData: d[i],
zoom: c
})
}
))), !1), __read(flat(u.map((function(e, r) {
var n = [e.pos1, e.pos2, e.pos3, e.pos4];
return [[0, 1], [1, 3], [3, 2], [2, 0]].map((function(e, i) {
var o = __read(e, 2)
, s = o[0]
, a = o[1];
return renderLine(t, "", minus$1(n[s], p), minus$1(n[a],
p), c, "group-rect-".concat(r, "-").concat(i))
}
))
}
)))), !1)
}
}
, Clickable = makeAble("clickable", {
props: ["clickable"],
events: ["click", "clickGroup"],
always: !0,
dragRelation: "weak",
dragStart: function() {},
dragControlStart: function() {},
dragGroupStart: function(e, t) {
t.datas.inputTarget = t.inputEvent && t.inputEvent.target
},
dragEnd: function(e, t) {
var r = e.props.target
, n = t.inputEvent
, i = t.inputTarget
, o = !e.isMoveableElement(i) && e.controlBox.contains(i);
if (n && i && !t.isDrag && !e.isMoveableElement(i) && !o) {
var s = r.contains(i);
triggerEvent(e, "onClick", fillParams(e, t, {
isDouble: t.isDouble,
inputTarget: i,
isTarget: r === i,
moveableTarget: e.props.target,
containsTarget: s
}))
}
},
dragGroupEnd: function(e, t) {
var r = t.inputEvent
, n = t.inputTarget;
if (r && n && !t.isDrag && !e.isMoveableElement(n) &&
t.datas.inputTarget !== n) {
var i = e.props.targets
, o = i.indexOf(n)
, s = o > -1
, a = !1;
-1 === o && (a = (o = findIndex$3(i, (function(e) {
return e.contains(n)
}
))) > -1),
triggerEvent(e, "onClickGroup", fillParams(e, t, {
isDouble: t.isDouble,
targets: i,
inputTarget: n,
targetIndex: o,
isTarget: s,
containsTarget: a,
moveableTarget: i[o]
}))
}
},
dragControlEnd: function(e, t) {
this.dragEnd(e, t)
},
dragGroupControlEnd: function(e, t) {
this.dragEnd(e, t)
}
});
function getDraggableEvent(e) {
var t = e.originalDatas.draggable;
return t || (e.originalDatas.draggable = {},
t = e.originalDatas.draggable),
__assign$2(__assign$2({}, e), {
datas: t
})
}
var edgeDraggable = makeAble("edgeDraggable", {
css: [".edge.edgeDraggable.line {\ncursor: move;\n}"],
render: function(e, t) {
var r = e.props
, n = r.edgeDraggable;
return n ? renderEdgeLines(t, "edgeDraggable", n,
e.getState().renderPoses, r.zoom) : []
},
dragCondition: function(e, t) {
var r, n = e.props, i = null === (r = t.inputEvent) || void 0 === r
? void 0 : r.target;
return !(!n.edgeDraggable || !i) && (!n.draggable && hasClass$1(i,
prefix$7("direction")) && hasClass$1(i, prefix$7("edge")) && hasClass$1(i,
prefix$7("edgeDraggable")))
},
dragStart: function(e, t) {
return Draggable.dragStart(e, getDraggableEvent(t))
},
drag: function(e, t) {
return Draggable.drag(e, getDraggableEvent(t))
},
dragEnd: function(e, t) {
return Draggable.dragEnd(e, getDraggableEvent(t))
},
dragGroupCondition: function(e, t) {
var r, n = e.props, i = null === (r = t.inputEvent) || void 0 === r
? void 0 : r.target;
return !(!n.edgeDraggable || !i) && (!n.draggable && hasClass$1(i,
prefix$7("direction")) && hasClass$1(i, prefix$7("line")))
},
dragGroupStart: function(e, t) {
return Draggable.dragGroupStart(e, getDraggableEvent(t))
},
dragGroup: function(e, t) {
return Draggable.dragGroup(e, getDraggableEvent(t))
},
dragGroupEnd: function(e, t) {
return Draggable.dragGroupEnd(e, getDraggableEvent(t))
},
unset: function(e) {
return Draggable.unset(e)
}
})
, IndividualGroupable = {
name: "individualGroupable",
props: ["individualGroupable", "individualGroupableProps"],
events: []
}
, MOVEABLE_ABLES = [BeforeRenderable, Default, Snappable, Pinchable,
Draggable, edgeDraggable, Resizable, Scalable, Warpable, Rotatable, Scrollable,
Padding, Origin, OriginDraggable, Clippable, Roundable, Groupable,
IndividualGroupable, Clickable, DragArea, Renderable];
function solveConstantsDistance(e, t) {
var r = __read(e, 3)
, n = r[0]
, i = r[1]
, o = r[2];
return (n * t[0] + i * t[1] + o) / Math.sqrt(n * n + i * i)
}
function solveC(e, t) {
var r = __read(e, 2)
, n = r[0]
, i = r[1];
return -n * t[0] - i * t[1]
}
function getMaxPos(e, t) {
return Math.max.apply(Math, __spreadArray([], __read(e.map((function(e)
{
var r = __read(e, 4)
, n = r[0]
, i = r[1]
, o = r[2]
, s = r[3];
return Math.max(n[t], i[t], o[t], s[t])
}
))), !1))
}
function getMinPos(e, t) {
return Math.min.apply(Math, __spreadArray([], __read(e.map((function(e)
{
var r = __read(e, 4)
, n = r[0]
, i = r[1]
, o = r[2]
, s = r[3];
return Math.min(n[t], i[t], o[t], s[t])
}
))), !1))
}
function getGroupRect(e, t) {
var r, n, i, o = [0, 0], s = [0, 0], a = [0, 0], l = [0, 0], c = 0, u =
0;
if (!e.length)
return {
pos1: o,
pos2: s,
pos3: a,
pos4: l,
minX: 0,
minY: 0,
maxX: 0,
maxY: 0,
width: c,
height: u,
rotation: t
};
var d = throttle$4(t, TINY_NUM);
if (d % 90) {
var p = d / 180 * Math.PI
, h = Math.tan(p)
, f = -1 / h
, m = [MAX_NUM, MIN_NUM]
, g = [[0, 0], [0, 0]]
, y = [MAX_NUM, MIN_NUM]
, v = [[0, 0], [0, 0]];
e.forEach((function(e) {
e.forEach((function(e) {
var t = solveConstantsDistance([-h, 1, 0], e)
, r = solveConstantsDistance([-f, 1, 0], e);
m[0] > t && (g[0] = e,
m[0] = t),
m[1] < t && (g[1] = e,
m[1] = t),
y[0] > r && (v[0] = e,
y[0] = r),
y[1] < r && (v[1] = e,
y[1] = r)
}
))
}
));
var b = __read(g, 2)
, x = b[0]
, _ = b[1]
, E = __read(v, 2)
, T = E[0]
, C = E[1]
, S = [-h, 1, solveC([-h, 1], x)]
, $ = [-h, 1, solveC([-h, 1], _)]
, w = [-f, 1, solveC([-f, 1], T)]
, P = [-f, 1, solveC([-f, 1], C)];
o = (r = __read([[S, w], [S, P], [$, w], [$, P]].map((function(e) {
var t = __read(e, 2);
return getIntersectionPointsByConstants(t[0], t[1])[0]
}
)), 4))[0],
s = r[1],
a = r[2],
l = r[3],
c = y[1] - y[0],
u = m[1] - m[0]
} else {
var R = getMinPos(e, 0)
, k = getMinPos(e, 1)
, A = getMaxPos(e, 0)
, I = getMaxPos(e, 1);
if (o = [R, k],
s = [A, k],
a = [R, I],
l = [A, I],
c = A - R,
u = I - k,
d % 180)
o = (n = __read([a, o, l, s], 4))[0],
s = n[1],
a = n[2],
l = n[3],
c = I - k,
u = A - R
}
d % 360 > 180 && (o = (i = __read([l, a, s, o], 4))[0],
s = i[1],
a = i[2],
l = i[3]);
var O = getMinMaxs([o, s, a, l]);
return {
pos1: o,
pos2: s,
pos3: a,
pos4: l,
width: c,
height: u,
minX: O.minX,
minY: O.minY,
maxX: O.maxX,
maxY: O.maxY,
rotation: t
}
}
function findMoveableGroups(e, t) {
var r = t.map((function(t) {
if (isArray$a(t)) {
var r = findMoveableGroups(e, t)
, n = r.length;
return n > 1 ? r : 1 === n ? r[0] : null
}
var i = find$2(e, (function(e) {
return e.manager.props.target === t
}
));
return i ? (i.finded = !0,
i.manager) : null
}
)).filter(Boolean);
return 1 === r.length && isArray$a(r[0]) ? r[0] : r
}
var MoveableGroup = function(e) {
function t() {
var t = null !== e && e.apply(this, arguments) || this;
return t.differ = new ChildrenDiffer$1,
t.moveables = [],
t.transformOrigin = "50% 50%",
t.renderGroupRects = [],
t._targetGroups = [],
t._hasFirstTargets = !1,
t
}
return __extends$2(t, e),
t.prototype.componentDidMount = function() {
e.prototype.componentDidMount.call(this)
}
,
t.prototype.checkUpdate = function() {
this._isPropTargetChanged = !1,
this.updateAbles()
}
,
t.prototype.getTargets = function() {
return this.props.targets
}
,
t.prototype.updateRect = function(e, t, r) {
var n;
void 0 === r && (r = !0);
var i = this.state;
if (this.controlBox && !i.isPersisted) {
setStoreCache(!0),
this.moveables.forEach((function(t) {
t.updateRect(e, !1, !1)
}
));
var o = this.props
, s = this.moveables
, a = i.target || o.target
, l = s.map((function(e) {
return {
finded: !1,
manager: e
}
}
))
, c = this.props.targetGroups || []
, u = findMoveableGroups(l, c)
, d = o.useDefaultGroupRotate;
u.push.apply(u, __spreadArray([], __read(l.filter((function(e)
{
return !e.finded
}
)).map((function(e) {
return e.manager
}
))), !1));
var p = []
, h = !t || "" !== e && o.updateGroup
, f = o.defaultGroupRotate || 0;
if (!this._hasFirstTargets) {
var m = null === (n = o.persistData) || void 0 === n ? void
0 : n.rotation;
null != m && (f = m)
}
var g = function e(t, r, n) {
var i = t.map((function(t) {
if (isArray$a(t)) {
var n = e(t, r)
, i = [n.pos1, n.pos2, n.pos3, n.pos4];
return p.push(n),
{
poses: i,
rotation: n.rotation
}
}
return {
poses: getAbsolutePosesByState(t.state),
rotation: t.getRotation()
}
}
))
, o = i.map((function(e) {
return e.rotation
}
))
, s = 0
, a = o[0]
, l = o.every((function(e) {
return Math.abs(a - e) < .1
}
));
return s = h ? !d && l ? a : f : d || n || !l ? r : a,
getGroupRect(i.map((function(e) {
return e.poses
}
)), s)
}(u, this.rotation, !0);
h && (this.rotation = g.rotation,
this.transformOrigin = o.defaultGroupOrigin || "50% 50%",
this.scale = [1, 1]),
this._targetGroups = c,
this.renderGroupRects = p;
var y = this.transformOrigin
, v = this.rotation
, b = this.scale
, x = g.width
, _ = g.height
, E = g.minX
, T = g.minY
, C = getMinMaxs(rotatePosesInfo([[0, 0], [x, 0], [0, _], [x,
_]], convertTransformOriginArray(y, x, _), this.rotation / 180 * Math.PI).result)
, S = C.minX
, $ = C.minY
, w = " rotate(".concat(v, "deg)") + "
scale(".concat(sign(b[0]), ", ").concat(sign(b[1]), ")")
, P = "translate(".concat(-S, "px, ").concat(-$,
"px)").concat(w);
this.controlBox.style.transform = "translate3d(".concat(E, "px,
").concat(T, "px, ").concat(this.props.translateZ || 0, ")"),
a.style.cssText += "left:0px;top:0px;" + "transform-
origin:".concat(y, ";") + "width:".concat(x, "px;height:").concat(_, "px;") +
"transform: ".concat(P),
i.width = x,
i.height = _;
var R = this.getContainer()
, k = getMoveableTargetInfo(this.controlBox, a,
this.controlBox, this.getContainer(), this._rootContainer || R, [])
, A = [k.left, k.top]
, I = __read(getAbsolutePosesByState(k), 4)
, O = I[0]
, D = I[1]
, M = I[2]
, L = I[3]
, j = getMinMaxs([O, D, M, L])
, F = [j.minX, j.minY]
, N = sign(b[0] * b[1]);
k.pos1 = minus$1(O, F),
k.pos2 = minus$1(D, F),
k.pos3 = minus$1(M, F),
k.pos4 = minus$1(L, F),
k.left = E - k.left + F[0],
k.top = T - k.top + F[1],
k.origin = minus$1(plus$1(A, k.origin), F),
k.beforeOrigin = minus$1(plus$1(A, k.beforeOrigin), F),
k.originalBeforeOrigin = plus$1(A, k.originalBeforeOrigin),
k.transformOrigin = minus$1(plus$1(A, k.transformOrigin), F),
a.style.transform = "translate(".concat(-S - F[0], "px,
").concat(-$ - F[1], "px)") + w,
setStoreCache(),
this.updateState(__assign$2(__assign$2({}, k), {
posDelta: F,
direction: N,
beforeDirection: N
}), r)
}
}
,
t.prototype.getRect = function() {
return __assign$2(__assign$2({}, e.prototype.getRect.call(this)), {
children: this.moveables.map((function(e) {
return e.getRect()
}
))
})
}
,
t.prototype.triggerEvent = function(t, r, n) {
if (n || t.indexOf("Group") > -1)
return e.prototype.triggerEvent.call(this, t, r);
this._emitter.trigger(t, r)
}
,
t.prototype.getRequestChildStyles = function() {
return this.getEnabledAbles().reduce((function(e, t) {
var r, n, i = null !== (n = null === (r = t.requestChildStyle)
|| void 0 === r ? void 0 : r.call(t)) && void 0 !== n ? n : [];
return __spreadArray(__spreadArray([], __read(e), !1),
__read(i), !1)
}
), [])
}
,
t.prototype.getMoveables = function() {
return __spreadArray([], __read(this.moveables), !1)
}
,
t.prototype.updateAbles = function() {
e.prototype.updateAbles.call(this, __spreadArray(__spreadArray([],
__read(this.props.ables), !1), [Groupable], !1), "Group")
}
,
t.prototype._updateTargets = function() {
e.prototype._updateTargets.call(this),
this._originalDragTarget = this.props.dragTarget ||
this.areaElement,
this._dragTarget = getRefTarget(this._originalDragTarget, !0)
}
,
t.prototype._updateEvents = function() {
var e = this.state
, t = this.props
, r = this._prevDragTarget
, n = t.dragTarget || this.areaElement
, i = t.targets
, o = this.differ.update(i)
, s = o.added
, a = o.changed
, l = o.removed
, c = s.length || l.length;
(c || this._prevOriginalDragTarget !== this._originalDragTarget) &&
(unsetGesto(this, !1),
unsetGesto(this, !0),
this.updateState({
gestos: {}
})),
r !== n && (e.target = null),
e.target || (e.target = this.areaElement,
this.controlBox.style.display = "block"),
e.target && (this.targetGesto || (this.targetGesto =
getTargetAbleGesto(this, this._dragTarget, "Group")),
this.controlGesto || (this.controlGesto = getAbleGesto(this,
this.controlBox, "controlAbles", "GroupControl")));
var u = !equals(e.container, t.container);
u && (e.container = t.container),
(u || c || this.transformOrigin !== (t.defaultGroupOrigin || "50%
50%") || a.length || i.length && !isDeepArrayEquals(this._targetGroups,
t.targetGroups || [])) && (this.updateRect(),
this._hasFirstTargets = !0),
this._isPropTargetChanged = !!c
}
,
t.prototype._updateObserver = function() {}
,
t.defaultProps = __assign$2(__assign$2({},
MoveableManager.defaultProps), {
transformOrigin: ["50%", "50%"],
groupable: !0,
dragArea: !0,
keepRatio: !0,
targets: [],
defaultGroupRotate: 0,
defaultGroupOrigin: "50% 50%"
}),
t
}(MoveableManager)
, MoveableIndividualGroup = function(e) {
function t() {
var t = null !== e && e.apply(this, arguments) || this;
return t.moveables = [],
t
}
return __extends$2(t, e),
t.prototype.render = function() {
var e, t = this, r = this.props, n = r.cspNonce, i = r.cssStyled, o
= r.persistData, s = r.targets || [], a = s.length, l = this.isUnmounted || !a, c =
null !== (e = null == o ? void 0 : o.children) && void 0 !== e ? e : [];
return l && !a && c.length ? s = c.map((function() {
return null
}
)) : l || (c = []),
reactExports.createElement(i, {
cspNonce: n,
ref: ref(this, "controlBox"),
className: prefix$7("control-box")
}, s.map((function(e, n) {
var i, o, s = null !== (o = null === (i =
r.individualGroupableProps) || void 0 === i ? void 0 : i.call(r, e, n)) && void 0 !
== o ? o : {};
return reactExports.createElement(MoveableManager, __assign$2({
key: "moveable" + n,
ref: refs(t, "moveables", n)
}, r, s, {
target: e,
wrapperMoveable: t,
isWrapperMounted: t.isMoveableMounted,
persistData: c[n]
}))
}
)))
}
,
t.prototype.componentDidMount = function() {}
,
t.prototype.componentDidUpdate = function() {}
,
t.prototype.getTargets = function() {
return this.props.targets
}
,
t.prototype.updateRect = function(e, t, r) {
void 0 === r && (r = !0),
setStoreCache(!0),
this.moveables.forEach((function(n) {
n.updateRect(e, t, r)
}
)),
setStoreCache()
}
,
t.prototype.getRect = function() {
return __assign$2(__assign$2({}, e.prototype.getRect.call(this)), {
children: this.moveables.map((function(e) {
return e.getRect()
}
))
})
}
,
t.prototype.request = function(e, t, r) {
void 0 === t && (t = {});
var n = this.moveables.map((function(r) {
return r.request(e, __assign$2(__assign$2({}, t), {
isInstant: !1
}), !1)
}
))
, i = {
request: function(e) {
return n.forEach((function(t) {
return t.request(e)
}
)),
this
},
requestEnd: function() {
return n.forEach((function(e) {
return e.requestEnd()
}
)),
this
}
};
return r || t.isInstant ? i.request(t).requestEnd() : i
}
,
t.prototype.dragStart = function(e) {
var t = e.target
, r = find$2(this.moveables, (function(e) {
var r = e.getTargets()[0]
, n = e.getControlBoxElement()
, i = e.getDragElement();
return !(!r || !i) && (i === t || i.contains(t) || i !== r && r
=== t || r.contains(t) || n === t || n.contains(t))
}
));
return r && r.dragStart(e),
this
}
,
t.prototype.hitTest = function() {
return 0
}
,
t.prototype.isInside = function() {
return !1
}
,
t.prototype.isDragging = function() {
return !1
}
,
t.prototype.getDragElement = function() {
return null
}
,
t.prototype.getMoveables = function() {
return __spreadArray([], __read(this.moveables), !1)
}
,
t.prototype.updateRenderPoses = function() {}
,
t.prototype.checkUpdate = function() {}
,
t.prototype.triggerEvent = function() {}
,
t.prototype.updateAbles = function() {}
,
t.prototype._updateEvents = function() {}
,
t.prototype._updateObserver = function() {}
,
t
}(MoveableManager);
function getElementTargets(e, t) {
var r = [];
return e.forEach((function(e) {
e && (isString$3(e) ? t[e] && r.push.apply(r, __spreadArray([],
__read(t[e]), !1)) : isArray$a(e) ? r.push.apply(r, __spreadArray([],
__read(getElementTargets(e, t)), !1)) : r.push(e))
}
)),
r
}
function getTargetGroups(e, t) {
var r = [];
return e.forEach((function(e) {
e && (isString$3(e) ? t[e] && r.push.apply(r, __spreadArray([],
__read(t[e]), !1)) : isArray$a(e) ? r.push(getTargetGroups(e, t)) : r.push(e))
}
)),
r
}
function compareRefTargets(e, t) {
return e.length !== t.length || e.some((function(e, r) {
var n = t[r];
return !(!e && !n) && (e != n && (!isArray$a(e) || !isArray$a(n) ||
compareRefTargets(e, n)))
}
))
}
var InitialMoveable = function(e) {
function t() {
var t = null !== e && e.apply(this, arguments) || this;
return t.refTargets = [],
t.selectorMap = {},
t._differ = new ChildrenDiffer$1,
t._elementTargets = [],
t._tmpRefTargets = [],
t._tmpSelectorMap = {},
t._onChangeTargets = null,
t
}
return __extends$2(t, e),
t.makeStyled = function() {
var e = {};
this.getTotalAbles().forEach((function(t) {
var r = t.css;
r && r.forEach((function(t) {
e[t] = !0
}
))
}
));
var t = getKeys(e).join("\n");
this.defaultStyled = styled("div", prefixCSS(PREFIX$3, MOVEABLE_CSS
+ t))
}
,
t.getTotalAbles = function() {
return __spreadArray([Default, Groupable, IndividualGroupable,
DragArea], __read(this.defaultAbles), !1)
}
,
t.prototype.render = function() {
var e, t = this.constructor;
t.defaultStyled || t.makeStyled();
var r = this.props
, n = r.ables
, i = r.props
, o = __rest$$(r, ["ables", "props"])
, s = __read(this._updateRefs(!0), 2)
, a = s[0]
, l = s[1]
, c = getElementTargets(a, l)
, u = c.length > 1
, d = __spreadArray(__spreadArray([],
__read(t.getTotalAbles()), !1), __read(n || []), !1)
, p = __assign$2(__assign$2(__assign$2({}, o), i || {}), {
ables: d,
cssStyled: t.defaultStyled,
customStyledMap: t.customStyledMap
});
this._elementTargets = c;
var h = null
, f = this.moveable
, m = o.persistData;
if ((null == m ? void 0 : m.children) && (u = !0),
o.individualGroupable)
return reactExports.createElement(MoveableIndividualGroup,
__assign$2({
key: "individual-group",
ref: ref(this, "moveable")
}, p, {
target: null,
targets: c
}));
if (u) {
var g = getTargetGroups(a, l);
if (f && !f.props.groupable && !f.props.individualGroupable) {
var y = f.props.target;
y && c.indexOf(y) > -1 && (h = __assign$2({}, f.state))
}
return reactExports.createElement(MoveableGroup, __assign$2({
key: "group",
ref: ref(this, "moveable")
}, p, null !== (e = o.groupableProps) && void 0 !== e ? e : {},
{
target: null,
targets: c,
targetGroups: g,
firstRenderState: h
}))
}
var v = c[0];
if (f && (f.props.groupable || f.props.individualGroupable)) {
var b = find$2(f.moveables || [], (function(e) {
return e.props.target === v
}
));
b && (h = __assign$2({}, b.state))
}
return reactExports.createElement(MoveableManager, __assign$2({
key: "single",
ref: ref(this, "moveable")
}, p, {
target: v,
firstRenderState: h
}))
}
,
t.prototype.componentDidMount = function() {
this._checkChangeTargets()
}
,
t.prototype.componentDidUpdate = function() {
this._checkChangeTargets()
}
,
t.prototype.componentWillUnmount = function() {
this.selectorMap = {},
this.refTargets = []
}
,
t.prototype.getTargets = function() {
var e, t;
return null !== (t = null === (e = this.moveable) || void 0 === e ?
void 0 : e.getTargets()) && void 0 !== t ? t : []
}
,
t.prototype.updateSelectors = function() {
this.selectorMap = {},
this._updateRefs()
}
,
t.prototype.waitToChangeTarget = function() {
var e, t = this;
return this._onChangeTargets = function() {
t._onChangeTargets = null,
e()
}
,
new Promise((function(t) {
e = t
}
))
}
,
t.prototype.waitToChangeTargets = function() {
return this.waitToChangeTarget()
}
,
t.prototype.getManager = function() {
return this.moveable
}
,
t.prototype.getMoveables = function() {
return this.moveable.getMoveables()
}
,
t.prototype.getDragElement = function() {
return this.moveable.getDragElement()
}
,
t.prototype._updateRefs = function(e) {
var t = this.refTargets
, r = getRefTargets(this.props.target || this.props.targets)
, n = "undefined" != typeof document
, i = compareRefTargets(t, r)
, o = this.selectorMap
, s = {};
return this.refTargets.forEach((function e(t) {
isString$3(t) ? o[t] ? s[t] = o[t] : n && (i = !0,
s[t] = [].slice.call(document.querySelectorAll(t))) :
isArray$a(t) && t.forEach(e)
}
)),
this._tmpRefTargets = r,
this._tmpSelectorMap = s,
[r, s, !e && i]
}
,
t.prototype._checkChangeTargets = function() {
var e, t, r;
this.refTargets = this._tmpRefTargets,
this.selectorMap = this._tmpSelectorMap;
var n = this._differ.update(this._elementTargets)
, i = n.added
, o = n.removed;
(i.length || o.length) && (null === (t = (e =
this.props).onChangeTargets) || void 0 === t || t.call(e, {
moveable: this.moveable,
targets: this._elementTargets
}),
null === (r = this._onChangeTargets) || void 0 === r ||
r.call(this));
var s = __read(this._updateRefs(), 3)
, a = s[0]
, l = s[1]
, c = s[2];
this.refTargets = a,
this.selectorMap = l,
c && this.forceUpdate()
}
,
t.defaultAbles = [],
t.customStyledMap = {},
t.defaultStyled = null,
__decorate([withMethods(MOVEABLE_METHODS)], t.prototype, "moveable",
void 0),
t
}(reactExports.PureComponent)
, Moveable = function(e) {
function t() {
return null !== e && e.apply(this, arguments) || this
}
return __extends$2(t, e),
t.defaultAbles = MOVEABLE_ABLES,
t
}(InitialMoveable);
function getSizeFromTarget(e) {
return {
top: Number(e.style.top.replace("px", "")),
left: Number(e.style.left.replace("px", "")),
width: Number(e.style.width.replace("px", "")),
height: Number(e.style.height.replace("px", ""))
}
}
function parseTransform$1(e) {
const t = /(\w+)\(([^\)]+)\)/g
, r = {
translatex: 0,
translatey: 0,
scalex: 1,
scaley: 1,
rotate: 0
};
let n;
for (; n = t.exec(e); ) {
const [,e,t] = n
, i = t.split(/\s*,\s*/).map(parseFloat);
"translate" === e ? (r.translatex = i[0] || 0,
r.translatey = i[1] || 0) : "scale" === e ? (r.scalex = i[0],
r.scaley = i[1] || i[0]) : "rotate" === e && (r.rotate = i[0] || 0)
}
return r
}
const rotateBase64 =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c
6QAAB6NJREFUeF7tm3uMXFUdx7+/
M7tVLA2oQWJDamln7r3Lktpmd+6UCjqNjwgRFRVCNJUCBnUjClSMUURJIfEtbkCJxAWVR5BoSTdpfRBc5LH
MnQ7SNnXm3JlNVposasQSTUrtzpyf3tlume7cx7k7j93avf9tzu/8Hp/zu79zz2/
OEk7xh07x+LEEYCkDTnECXX0F+voG3qqUeDsz1gBijQCvYeA0ECaZ8TcBmoKquVUknq9Ucv/
qxtp0FIBlbVytlNpKhH4wBgGs1gzqFQBjBNqd6FU7DxzI/
1VzXmyxjgBIpdLrBXAViLYCODO2VydOOAJglERie6k0vr9FXU3T2wrAsjIDSqnrCHRdux0F4TAxDVOiOlws
Fl5ql/
62AOhfe0FyOlG9uSOBz42U8CIxDy9foYYLhcJ0qyDaAsA0MrsAvrhVZ2LNJ36+VhNbKpXcn2PNmyPcMgAv7
VnxHl0nGDgIcIlIFAHex0wvEXM/E51NrAZAtBKAoaOPgQNK0RWtQGgdQHIwy0L8IcxhAnaAMTKteO/
ERP5gVHBWcjCrhMgS87tAlA2TbxVCywBM8x0rwNMv+lZ7xoMQGJHSeSIq6KBx08zcAOavh+0mrUBoGYDnuG
nal4P5boDO8v4m0L2kMFKs5J6bb+CN8+rbKpEH4cNB+jwIQtFNpUrud3FstgWAZ3DdunXLjx5elkZPz2Sp9
NxkHCd0Zc1U+hYQbQ+R3wfqvVDKZ/
6tq7NtAHQNtipnpezrmTAcqIfoRilzd+raOekAeIFZqfRWJrovIMhXFPPmcjn/
gg4EbQDeey6l86iO0m7ImKn01SAaCbD1mHSdy3T80AJgGJlbCbxVJKY3F4t/
+ouO4m7IWEb6YQZd6WeLQZ903dwvovyIBGAY9kUEjAEQ3l4uy861UUq7Nd7XN3i+qoknAbzJx+aj0nWuiPI
lEoBlZH7P4PccV0S8Rcr8A1GKuzVumvbtYHzVx94RkeixisVnQzM2FIBl2F9h4I4TlDPKEL1ZKZ+Z6laQYX
YsyzZYwSt4p82VI+D6kuvcFTY/EICVtC9gUU/9ZXMVMPgnrpv/
9GIA4PlgmvaPwfhMkz+Eh6R0PjEvAKZh7wbw/
qDJDL7SdfOPLAYIhjF4MUHs8vGlKF3nvNgATNP+EhjfigiuWK31ZCcmnv37YoBgGvbLfsXwP0ePvnFy8gWv
xeb7NL0CpmkPguupvzwqMALfXXLzn4uS68a4mbIfAKEp3UmpzaXKHi8ePQCGYY8S8AFdp4npY6Vy7le68p2
Ss1KZLzLxd5rrFa5yXefnWgAMw76RgO/HdHLfstcty+7f//
ShmPPaKm4YmS0Ebg6U+WuynL89EsCxI6eXKmfE9oz5h7KcvyH2vDZOCCyEER9vx2uA14VpSh8hvuB3Bvfeq
7myVfDBSqUw0caYAlWtX73+zFd7e3dACECp1+T8ukfMTe8/Md82WxdCP4TMVPoHIGpaWWL+aKmc/
3U3gg2ykUqlPyKI4tcewqiUzgdn9YYCCKwJhM9K6dyzkAA826aR9rpQQzH8mAZhk5TO8SZueAbUW134pU9l
vc11nW/
EMNwR0fPPzZxd7eWnGUhqGSB8WUrnhO+b8LNAYMubdks3d4mW0Q4LWSn740x4UMPME9J13j1XLvI0aBr2YZ
+Dxj+l67xZw2hXREwzPQKmq8OMMfBO13Weig3AMuwnvclNExU2lSrOeFcijDDS17fpbapW3Ru4hTNtl+Xcr
X5qIjPAMuzvMXBTcx2g+103F0q9m3BMM3MNmH/qY3OfdJ0NABr2y4adM8pJK5l5Hwv+rZ8cg9/
ruvnHo3R0a9w07Z1gXNpoj6Eucd093snW94nMgJntxvbSa12TBsaoLL+2p3Yr0CA7hjFgERLF2XGdw5oeAD
OzHcy3+COka6XMBXVnu87ETNk3g/
BtgKZOX1FNFQoFr4gHPloAksnBDQkhvArqd0SWjNqFrlv4R9ejDTBoGPY4wHfqNGy0ANRfg5CfpRhYFB9G8
1kAbQDZbLZnaurwUwRs9C+IJycEbQD1LDAzHwLzY0GkGfiZENhWKjlee+qkeGIBmIEQ2S/
cI5i3Fcv5P7aTwMxNFHXN/84m5wG0S5adpu7PfOzFBnBsW/QOSJeHGDzC4G2um//
RfJxqnJNKbewjUkMEHgJINIxp/fITZX9eADQheBclHoeq3RHWlAxysP55W60OgeAdd0/3k6sp6m/
lfpCnc94AvFugXKvdF3WH55jjk159ALDXdZ0dfsHM3CqtrSUSq5h5FaEe+FtC9/CIjm/
U6rcEYFa5adj3AviUjrETZGZbVTO3wlYBeH1cHSTEua3eRpl3BjQ6q3ORKW5wUfLt+vZoCwDPWZ2LTFFBaY
0zj1GCvlkqOb4HNC0dDUJtAzCr0zDSQ1Q/
PtPauM5EyE8Q0z2lcu677dTbdgCec8nkhrN6kOiHEJ9nQOuqSkBQL4NoJzOPrlz5htGxsbFqO4NvSxGMcmj
mIrUaJKiLCDTAQCa0sgM5BfxGCIxXqzTe6X+c6EgGREFp/
BGmRj2vJhLqULU6feicc8441IlVjgAe5e7/9/iCZMBiQroEYDGtxkL4spQBC0F9MdlcyoDFtBoL4ct/
AcSWvV9Ck7m2AAAAAElFTkSuQmCC";
function Control(e) {
const t = e.store
, r = reactExports.useRef()
, n = reactExports.useRef()
, {rootContainer: i, dragContainer: o, onSelectElements: s} = e
, [a,l] = reactExports.useState(1)
, c = e.scale
, [u,d] = reactExports.useState([])
, [p,h] = reactExports.useState(!1)
, f = reactExports.useRef(!1)
, [m,g] = reactExports.useState(!1)
, y = e => {
if (1 === e.length) {
const [r] = e
, n = t.data.elements.find((e => e.id === E({
target: r
})));
n && n.controlUnKeepRatio ? h(!1) : h(!0)
}
d(e)
}
, v = reactExports.useMemo(( () => {
const e = [];
return document.querySelectorAll("div[data-pixi]").forEach((t => {
t && "1" === t.style.opacity && e.push(t)
}
)),
e
}
), [a])
, b = e => {
const r = E(e);
syncControlToElement(r, t),
t.controlChangeEnd([r])
}
, x = e => {
const r = [];
e.events.forEach((e => {
const n = E(e);
n && (r.push(n),
syncControlToElement(n, t))
}
)),
t.controlChangeEnd(r)
}
, _ = e => {
const r = [];
e.targets ? e.targets.forEach((e => {
const n = E({
target: e
});
n && (r.push(n),
syncControlToElement(n, t))
}
)) : e.target && r.push(E(e)),
t.controlChangeStart(r)
}
;
reactExports.useEffect(( () => {
r.current.moveable.controlBox.style.display = u.length ? "block" :
"none";
const e = u.map((e => E({
target: e
}))).filter((e => e));
return !f.current && s && s(e),
pubsub.subscribe(t.events.VISIBLE_CONTROL, ( (e, t) => {
const n = u.map((e => E({
target: e
}))).filter((e => e))
, [i] = n;
void 0 === i && void 0 === t.elementId ?
r.current.moveable.controlBox.style.display = "none" : i === t.elementId &&
(r.current.moveable.controlBox.style.display = t.visible ? "block" : "none")
}
)),
() => {
pubsub.unsubscribe(t.events.VISIBLE_CONTROL)
}
}
), [u]),
reactExports.useEffect(( () =>
(pubsub.subscribe(t.events.UPDATE_CONTROL_TARGET, ( () => {
r.current.moveable.updateTarget()
}
)),
pubsub.subscribe(t.events.UPDATE_CONTROL_LIST, ( () => {
r.current.moveable.updateSelectors()
}
)),
pubsub.subscribe(t.events.TRIGGER_CONTROL, ( (e, t) => {
f.current = !0,
"string" == typeof t[0] ? y(getTargetByIds(t)) : y(t)
}
)),
pubsub.subscribe(t.events.TRIGGER_CONTROL_NO_CALLBACK, ( (e, t) => {
f.current = !0,
"string" == typeof t[0] ? y(getTargetByIds(t)) : y(t)
}
)),
pubsub.subscribe(t.events.STOP_GROUP_DRAG, ( (e, t) => {
g(t)
}
)),
() => {
pubsub.unsubscribe(t.events.STOP_GROUP_DRAG),
pubsub.unsubscribe(t.events.UPDATE_CONTROL_TARGET),
pubsub.unsubscribe(t.events.UPDATE_CONTROL_LIST),
pubsub.unsubscribe(t.events.TRIGGER_CONTROL),
pubsub.unsubscribe(t.events.TRIGGER_CONTROL_NO_CALLBACK)
}
)), []),
reactExports.useEffect(( () => {
r.current.moveable.updateTarget()
}
), [e.viewSize]);
const E = e => {
var t, r, n, i;
return (null == (r = null == (t = e.target) ? void 0 : t.dataset) ?
void 0 : r.elementid) || (null == (i = null == (n = e.target) ? void 0 : n.dataset)
? void 0 : i.maskid)
}
;
let T = !0;
e.stopControl && (T = !1),
t.cacheControlElementIds = u.map((e => e ? "string" == typeof e ? e :
E({
target: e
}) || "" : "")).filter((e => e));
const C = "#3f99f7"
, [S] = u
, $ = [...t.data.elements, ...t.data.captions].find((e => e.id ===
E({
target: S
})));
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
children: [jsxRuntimeExports.jsx("style", {
dangerouslySetInnerHTML: {
__html: `\n .moveable-control-box .moveable-rotation {
height: calc(25px * var(--zoom));}\n .moveable-control-box .moveable-control {
border: 1px solid ${C}; background: #fff; border-radius: 1000px; }\
n .moveable-control-box .moveable-control[data-direction="s"], .moveable-
control-box .moveable-control[data-direction="n"] { width: 24px; margin-left: -
12px; height: 8px; margin-top: -4px; }\n .moveable-control-box .moveable-
control[data-direction="w"], .moveable-control-box .moveable-control[data-
direction="e"] { height: 24px; margin-top: -12px; width: 8px; margin-left: -4px; }\
n .moveable-control-box .moveable-line { background: ${C}; height: 2px; }\n
.moveable-control-box .moveable-rotation .moveable-rotation-control { border: none;
background-image: url(${rotateBase64}); background-repeat: no-repeat; background-
size: 80%; background-position: center; background-color: #fff; width: 20px;
height: 20px; margin-top: -10px; margin-left: -10px; }\n .moveable-control-box
.moveable-rotation .moveable-rotation-line { transform: scaleX(2)!important;
display: none; }\n `
}
}), jsxRuntimeExports.jsx(Moveable, {
ref: r,
scrollContainer: () => document.body,
rootContainer: document.body,
pinchable: T,
draggable: T,
resizable: T,
keepRatio: p,
rotatable: T,
origin: T,
throttleResize: 1,
padding: {
left: 0,
top: 0,
right: 0,
bottom: 0
},
renderDirections: $ && ["text", "caption"].includes($.type) ?
["nw", "ne", "se", "sw"] : ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
rotationPosition: "bottom",
flushSync: reactDomExports.flushSync,
zoom: 1,
target: u,
snappable: !0,
snapThreshold: 5,
isDisplaySnapDigit: !1,
elementGuidelines: v,
snapGap: !0,
snapDirections: {
top: !0,
right: !0,
bottom: !0,
left: !0,
center: !0,
middle: !0
},
onBeforeRotate: e => {
e.setRotation(throttle$4(e.rotation, 5))
}
,
throttleRotate: 0,
onRenderStart: e => {
t.controlElements = [],
_(e),
l(+new Date)
}
,
onRender: e => {
const r = E(e)
, n = Number(e.target.dataset.scale || 1)
, {left: i, top: o, width: s, height: a} =
getSizeFromTarget(e.target)
, {translatex: l, translatey: u, rotate: d} =
parseTransform$1(e.target.style.transform)
, p = i + l + s / 2
, h = o + u + a / 2
, f = toNum(d * Math.PI / 180, 2);
t.controlElements = [{
elementId: r,
x: p / c,
y: h / c,
width: s / c / n,
height: a / c / n,
rotation: f
}],
syncControlToElement(r, t),
pubsub.publish(t.events.UPDATE_STAGE)
}
,
onDrag: e => {
e.target.style.transform = e.transform
}
,
onResizeStart: e => {
["nw", "ne", "se",
"sw"].includes(e.inputEvent.target.dataset.direction) ? h(!0) : h(!1)
}
,
onResize: e => {
e.target.style.width = `${e.width}px`,
e.target.style.height = `${e.height}px`,
e.target.style.transform = e.drag.transform
}
,
onRotate: e => {
e.target.style.transform = e.drag.transform
}
,
onDragEnd: b,
onRotateEnd: b,
onResizeEnd: b,
onResizeGroup: e => {
e.events.forEach((e => {
e.target.style.width = `${e.width}px`,
e.target.style.height = `${e.height}px`,
e.target.style.transform = e.drag.transform
}
))
}
,
onRotateGroup: e => {
e.events.forEach((e => {
e.target.style.transform = e.drag.transform
}
))
}
,
onDragGroup: e => {
e.events.forEach((e => {
e.target.style.transform = e.transform
}
))
}
,
onScrollGroup: ({scrollContainer: e, direction: t}) => {
e.scrollBy(10 * t[0], 10 * t[1])
}
,
defaultGroupRotate: 0,
defaultGroupOrigin: "50% 50%",
onClickGroup: e => {
n.current.clickTarget(e.inputEvent, e.inputTarget)
}
,
onRenderGroupStart: e => {
_(e),
l(+new Date),
t.controlElements = []
}
,
onRenderGroup: e => {
const r = [];
e.events.forEach((e => {
e.target.style.transform = e.transform;
const t = Number(e.target.dataset.scale || 1)
, n = E(e);
if (n) {
const {left: i, top: o, width: s, height: a} =
getSizeFromTarget(e.target)
, {translatex: l, translatey: u, rotate: d} =
parseTransform$1(e.target.style.transform)
, p = i + l + s / 2
, h = o + u + a / 2
, f = d * Math.PI / 180;
r.push({
elementId: n,
x: p / c,
y: h / c,
width: s / c / t,
height: a / c / t,
rotation: f
})
}
}
)),
t.controlElements = [...r],
t.controlElements.forEach(( ({elementId: e}) => {
syncControlToElement(e, t)
}
)),
pubsub.publish(t.events.UPDATE_STAGE)
}
,
onDragGroupEnd: x,
onRotateGroupEnd: x,
onResizeGroupEnd: x
}), jsxRuntimeExports.jsx(Selecto$1, {
ref: n,
rootContainer: i,
dragContainer: o,
selectableTargets: ["div[data-pixi]"],
hitRate: 0,
ratio: 0,
onDrag: e => {
m && e.stop()
}
,
selectByClick: T,
selectFromInside: !1,
toggleContinueSelect: ["shift"],
onDragStart: n => {
if (e.stopControl)
return void n.stop();
const i = r.current
, o = n.inputEvent.target;
"editMask" !== t.controlModeType ? (i.isMoveableElement(o)
|| u.some((e => e === o || e.contains(o)))) && n.stop() : n.stop()
}
,
onSelectEnd: e => {
const n = r.current;
f.current = !1,
y([...e.selected.filter((e => {
let r = !1;
return e.dataset.elementid && "editElement" ===
t.controlModeType && (r = !0),
e.dataset.maskid && "editMask" === t.controlModeType &&
(r = !0),
r && "1" === e.style.opacity && "none" !==
e.style.display && "none" !== e.style.pointerEvents
}
))]),
e.isDragStart && (e.inputEvent.preventDefault(),
n.waitToChangeTarget().then(( () => {
n.dragStart(e.inputEvent)
}
)))
}
})]
})
}
function limiter(e) {
var t = 0
, r = [];
function n() {
var n;
--t < e && (n = r.shift(),
o.queue = r.length,
n && i(n.fn).then(n.resolve).catch(n.reject))
}
function i(e) {
t++;
try {
return Promise.resolve(e()).then((function(e) {
return n(),
e
}
), (function(e) {
throw n(),
e
}
))
} catch (r) {
return n(),
Promise.reject(r)
}
}
var o = function(n) {
return t >= e ? function(e) {
return new Promise((function(t, n) {
r.push({
fn: e,
resolve: t,
reject: n
}),
o.queue = r.length
}
))
}(n) : i(n)
};
return o
}
function map$2(e, t) {
var r = !1
, n = this;
return Promise.all(e.map((function() {
var e = arguments;
return n((function() {
if (!r)
return t.apply(void 0, e).catch((function(e) {
throw r = !0,
e
}
))
}
))
}
)))
}
function addExtras(e) {
return e.queue = 0,
e.map = map$2,
e
}
var promiseLimit = function(e) {
return addExtras(e ? limiter(e) : function(e) {
return e()
}
)
};
const pLimit = getDefaultExportFromCjs(promiseLimit);
var _dec$2, _dec2$2, _dec3$2, _dec4$2, _dec5$2, _dec6$1, _dec7$1, _dec8$1,
_dec9$1, _dec10$1, _dec11$1, _dec12$1, _dec13$1, _dec14$1, _class$4;
function _applyDecoratedDescriptor$4(e, t, r, n, i) {
var o = {};
return Object.keys(n).forEach((function(e) {
o[e] = n[e]
}
)),
o.enumerable = !!o.enumerable,
o.configurable = !!o.configurable,
("value"in o || o.initializer) && (o.writable = !0),
o = r.slice().reverse().reduce((function(r, n) {
return n(e, t, r) || r
}
), o),
i && void 0 !== o.initializer && (o.value = o.initializer ?
o.initializer.call(i) : void 0,
o.initializer = void 0),
void 0 === o.initializer ? (Object.defineProperty(e, t, o),
null) : o
}
let ResourceManage = (_dec$2 = bindSelf,
_dec2$2 = bindSelf,
_dec3$2 = bindSelf,
_dec4$2 = bindSelf,
_dec5$2 = bindSelf,
_dec6$1 = bindSelf,
_dec7$1 = bindSelf,
_dec8$1 = bindSelf,
_dec9$1 = bindSelf,
_dec10$1 = bindSelf,
_dec11$1 = bindSelf,
_dec12$1 = bindSelf,
_dec13$1 = bindSelf,
_dec14$1 = bindSelf,
_class$4 = class {
set resourceHost(e) {
this._resourceHost = e
}
get resourceHost() {
return this._resourceHost
}
constructor(e) {
this._store = void 0,
this._resourceHost = "",
this.tempData = {},
this._cacheBolbURL = {},
this.medias = {},
this.trackMedias = {},
this.destroy = () => {
this._store = null;
for (const e in this._cacheBolbURL)
URL.revokeObjectURL(this._cacheBolbURL[e]),
delete this._cacheBolbURL[e]
}
,
this._store = e,
this.fetchBlob(config$2.img404)
}
setTempData(e, t) {
this.tempData[e] || (this.tempData[e] = t)
}
getTempData(e) {
return this.tempData[e]
}
removeTempData(e) {
this.tempData[e] && delete this.tempData[e]
}
clearTempData() {
for (let e in this.tempData)
this.tempData[e].destroy && this.tempData[e].destroy(),
delete this.tempData[e]
}
get img404() {
return this._cacheBolbURL[config$2.img404]
}
removeTrackMedias(e, t) {
if (!t)
return !1;
let r = 0;
const n = (i, o) => {
i.forEach((i => {
o || (o = i.trackIndex),
o === e && i.resourceId === t && r++;
const s = i.children;
s && n(s, i.trackIndex)
}
))
}
;
if (n(this._store.data.elements),
r >= 1) {
const r = this.trackMedias[e + "_" + t];
return r.target && (r.target.onwaiting = null,
r.target.oncanplay = null,
r.target.remove()),
delete this.trackMedias[e + "_" + t],
!0
}
return !1
}
removeUnuesdCache() {
const e = this.getUsedResource();
null == e || e.forEach((e => {
this._cacheBolbURL[e.id] ||
(URL.revokeObjectURL(this._cacheBolbURL[e.id]),
delete this._cacheBolbURL[e.id])
}
))
}
getBlobURLBySourceId(e) {
const t = this.getResouceById(e);
return t ? this._cacheBolbURL[t.url] : null
}
getCacheItemBySourceId(e) {
const t = this.getResouceById(e);
return t ? {
resource: t,
bolbURL: this._cacheBolbURL[t.url]
} : null
}
fetchBlob(e, t) {
return new Promise((r => {
const n = this._cacheBolbURL[e];
if (n) {
if ("loading" !== n)
return t && t(1),
r(n)
} else
this._cacheBolbURL[e] = "loading",
fetch(this.resourceHost + e).then((n => {
var i;
if (n.ok) {
const o = Number(n.headers.get("content-length"));
let s = 0;
const a = null == (i = n.body) ? void 0 :
i.getReader()
, l = []
, c = () => {
null == a || a.read().then((async ({done: i,
value: a}) => {
if (i) {
const i = new Blob(l,{
type: n.headers.get("content-type")
})
, o = URL.createObjectURL(i);
return this._cacheBolbURL[e] = o,
t && t(1),
void r(o)
}
s += a.length,
l.push(a);
const u = s / o;
t && u <= 1 && t(u),
c()
}
))
}
;
c()
}
}
)).catch((e => {}
))
}
))
}
async loadUsedResource(e, t, r) {
const n = this.getUsedResource();
if (n) {
const i = pLimit(r || 10)
, o = [];
let s = 0;
e(0),
n.forEach((r => {
let n = !1;
t && (n = !0),
r.mustFetch && (n = !0);
const a = getFileTypeFromFileName(r.url) || "";
n ? o.push(i(( () => this.fetchBlob(r.url, (e => {
var t;
(null == (t = this._store) ? void 0 :
t.onEachSourceProgress) && this._store.onEachSourceProgress({
src: r.url,
p: e,
total: o.length
})
}
)).then((async t => {
if (["video", "audio"].includes(a)) {
const e = await mediaLazy(t, 0, a);
this.medias[r.url] = e
}
return s++,
e(s / o.length),
t
}
)).catch((e => {
window.nodeConsole && window.nodeConsole("资源加载异常", e)
}
))))) : ["video",
"audio"].includes(getFileTypeFromFileName(r.url) || "") && o.push(i(( () =>
mediaLazy(r.url, 0, a).then((t => (this.medias[r.url] = t,
s++,
e(s / o.length),
t))))))
}
)),
await Promise.all(o)
}
}
getResouceById(e) {
var t;
return null == (t = this._store) ? void 0 : t.data.resouces.find((t
=> t.id === e))
}
async getTextureById(e) {
return await Assets.load(e)
}
getCacheBlobURLById(e, t) {
const r = this.getResouceById(e);
if (r) {
if (["video", "audio"].includes(r.type)) {
const e = t + "_" + r.id;
if (!this.trackMedias[e]) {
const n = this.medias[r.url];
if (!n)
return this.trackMedias[e];
const i = n.cloneNode()
, o = () => {}
, s = () => {}
;
i && (i.onwaiting = o,
i.oncanplay = s,
"video" === r.type && (i.className = `_resource_video_$
{this._store.movieId}`,
i.style.width = "1px",
i.style.overflow = "hidden",
i.style.display = "inline-block",
i.style.height = "1px",
i.style.position = "absolute",
i.style.left = "0px",
i.style.top = "0px",
i.style.opacity = "0",
document.body.appendChild(i))),
this.trackMedias[e] = {
target: i,
src: r.url,
trackIndex: t,
waitingFun: o,
canplayFun: s
}
}
return this.trackMedias[e]
}
{
const e = this._cacheBolbURL[r.url];
return e || (null == r ? void 0 : r.url)
}
}
return this.img404
}
getUsedResource() {
let e = [];
if (!this._store.data)
throw new Error("必须在 store 设置 data 之后调用 getUsedResource");
if (this._store.data.elements.forEach((t => {
const {resourceId: r, mask: n} = t;
r && e.push(r),
n && e.push(n.resourceId)
}
)),
0 === e.length)
return null;
e = [...new Set(e)];
const t = [];
return this._store.data.resouces.forEach((r => {
e.find((e => e === r.id)) && t.push(r)
}
)),
t
}
}
,
_applyDecoratedDescriptor$4(_class$4.prototype, "setTempData", [_dec$2],
Object.getOwnPropertyDescriptor(_class$4.prototype, "setTempData"),
_class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "getTempData", [_dec2$2],
Object.getOwnPropertyDescriptor(_class$4.prototype, "getTempData"),
_class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "removeTempData",
[_dec3$2], Object.getOwnPropertyDescriptor(_class$4.prototype, "removeTempData"),
_class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "clearTempData", [_dec4$2],
Object.getOwnPropertyDescriptor(_class$4.prototype, "clearTempData"),
_class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "removeTrackMedias",
[_dec5$2], Object.getOwnPropertyDescriptor(_class$4.prototype,
"removeTrackMedias"), _class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "removeUnuesdCache",
[_dec6$1], Object.getOwnPropertyDescriptor(_class$4.prototype,
"removeUnuesdCache"), _class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "getBlobURLBySourceId",
[_dec7$1], Object.getOwnPropertyDescriptor(_class$4.prototype,
"getBlobURLBySourceId"), _class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "getCacheItemBySourceId",
[_dec8$1], Object.getOwnPropertyDescriptor(_class$4.prototype,
"getCacheItemBySourceId"), _class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "fetchBlob", [_dec9$1],
Object.getOwnPropertyDescriptor(_class$4.prototype, "fetchBlob"),
_class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "loadUsedResource",
[_dec10$1], Object.getOwnPropertyDescriptor(_class$4.prototype,
"loadUsedResource"), _class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "getResouceById",
[_dec11$1], Object.getOwnPropertyDescriptor(_class$4.prototype, "getResouceById"),
_class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "getTextureById",
[_dec12$1], Object.getOwnPropertyDescriptor(_class$4.prototype, "getTextureById"),
_class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "getCacheBlobURLById",
[_dec13$1], Object.getOwnPropertyDescriptor(_class$4.prototype,
"getCacheBlobURLById"), _class$4.prototype),
_applyDecoratedDescriptor$4(_class$4.prototype, "getUsedResource",
[_dec14$1], Object.getOwnPropertyDescriptor(_class$4.prototype, "getUsedResource"),
_class$4.prototype),
_class$4);
class EventsName {
constructor(e) {
this._id = createID(),
e && (this._id = e)
}
get UPDATE_STAGE() {
return "update_stage_" + this._id
}
get VISIBLE_CONTROL() {
return "visible_control_" + this._id
}
get STOP_GROUP_DRAG() {
return "stop_group_drag_" + this._id
}
get SORT_CONTAINER() {
return "sort_container_" + this._id
}
get UPDATE_CONTROL_TARGET() {
return "update_control_target_" + this._id
}
get UPDATE_CONTROL_LIST() {
return "update_control_list_" + this._id
}
get TRIGGER_CONTROL() {
return "trigger_control_" + this._id
}
get TRIGGER_CONTROL_NO_CALLBACK() {
return "trigger_control_no_callback" + this._id
}
get UPDATE_MOVIE() {
return "update_movie_" + this._id
}
get CONTROL_CHANGE_END() {
return "control_change_end" + this._id
}
get CONTROL_CHANGE_START() {
return "control_change_start" + this._id
}
}
var undoRedoManager2 = {
exports: {}
};
!function(e, t) {
self,
e.exports = ( () => {
var e = {
d: (t, r) => {
for (var n in r)
e.o(r, n) && !e.o(t, n) && Object.defineProperty(t, n,
{
enumerable: !0,
get: r[n]
})
}
,
o: (e, t) => Object.prototype.hasOwnProperty.call(e, t),
r: e => {
"undefined" != typeof Symbol && Symbol.toStringTag &&
Object.defineProperty(e, Symbol.toStringTag, {
value: "Module"
}),
Object.defineProperty(e, "__esModule", {
value: !0
})
}
}
, t = {};
function r(e, t) {
for (var r = 0; r < t.length; r++) {
var n = t[r];
n.enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, n.key, n)
}
}
e.r(t),
e.d(t, {
default: () => n
});
var n = function() {
function e(t) {
!function(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a
function")
}(this, e),
this.options = Object.assign({
limit: 50,
onChange: function() {}
}, t || {}),
this._stacks = [],
this._pointer = -1
}
var t;
return (t = [{
key: "current",
get: function() {
return this._stacks[this._pointer]
}
}, {
key: "canUndo",
get: function() {
return this._pointer > 0
}
}, {
key: "canRedo",
get: function() {
return this._pointer < this._stacks.length - 1
}
}, {
key: "count",
get: function() {
return this._stacks.length
}
}, {
key: "stacks",
get: function() {
return this._stacks
}
}, {
key: "destroy",
value: function() {
this._stacks = null,
this.options = null,
this._pointer = null
}
}, {
key: "add",
value: function(e) {
return this._stacks.splice(this._pointer + 1,
this._stacks.length - this._pointer - 1),
this._stacks.length === this.options.limit ?
(this._stacks.shift(),
this._pointer = this.options.limit - 1) :
this._pointer++,
this._stacks.push(e),
this.options.onChange(this),
this.current
}
}, {
key: "undo",
value: function() {
if (this.canUndo)
return this._pointer--,
this.options.onChange(this),
this.current
}
}, {
key: "redo",
value: function() {
if (this.canRedo)
return this._pointer++,
this.options.onChange(this),
this.current
}
}]) && r(e.prototype, t),
e
}();
return t
}
)()
}(undoRedoManager2);
var undoRedoManager2Exports = undoRedoManager2.exports;
const UndoRedoManager = getDefaultExportFromCjs(undoRedoManager2Exports);
function RecordManager(e) {
const t = reactExports.useRef()
, r = e.store;
return reactExports.useEffect(( () => {
t.current = new UndoRedoManager({
limit: 30
});
const n = r => {
t.current.add({
id: createID(),
type: "global",
desc: r.desc,
selecteds: r.selecteds,
mdata: toJS(e.store.data)
})
}
, i = (e, t) => !!e && (e.mdata && objectCopyValue(e.mdata,
r.data),
r.update(),
r.triggerRecordSelectElements &&
r.triggerRecordSelectElements([...e.selecteds || []]),
!0);
return r.record = {
add: n,
redo: () => {
const e = t.current.redo();
i(e)
}
,
undo: () => {
const e = t.current.undo();
i(e)
}
,
debounceAdd: debounce$3(n, 500),
manager: t.current
},
() => {
t.current.destroy()
}
}
), []),
null
}
function filterData(e) {
if (e.version || (e.version = "1.1.0"),
!Array.isArray(e.captions)) {
const {style: t, textStyle: r, texts: n} = e.captions;
n.forEach((e => {
e.textStyle = toJS(r || {}),
e.style = toJS(t || {})
}
)),
e.captions = n
}
return e
}
function Movie(e, t) {
const {env: r, data: n, target: i, currentTime: o, triggerCurrentTime:
s, onSourceProgress: a, onEachSourceProgress: l, triggerRecordSelectElements: c,
fetchSourceBeforeRender: u, onPause: d, scale: p=1, registerId: h, times: f,
workerPath: m="worker/decode.worker.js", movieId: g="movieId", resourceHost: y=""}
= e
, [v,b] = reactExports.useState(0)
, [x,_] = reactExports.useState(!1)
, [E,T] = reactExports.useState(1)
, [,C] = reactExports.useReducer((e => e + 1), 0)
, S = reactExports.useRef();
S.current || (S.current = new Store,
c && (S.current.triggerRecordSelectElements = c),
S.current.movieId = g,
S.current.workerPath = m,
l && (S.current.onEachSourceProgress = l),
S.current.events = new EventsName(S.current.movieId),
S.current.resourceManage = new ResourceManage(S.current));
const $ = S.current;
reactExports.useImperativeHandle(t, ( () => $)),
"export" !== r && ($.currentTime = o || 0),
f && ($.times = f),
$.onPause = d || null,
s && !$.triggerCurrentTime && ($.triggerCurrentTime = s);
const w = reactExports.useCallback((async () => {
filterData(n),
$.data = n,
$.env = r,
e.initSuccess && e.initSuccess(),
e.onControlChangeEnd && ($.onControlChangeEnd =
e.onControlChangeEnd),
y && ($.resourceManage.resourceHost = y),
await $.resourceManage.loadUsedResource((e => {
b(100 * e),
a && a(e)
}
), !!u, 10),
_(!0)
}
), []);
if (reactExports.useEffect(( () => (w(),
pubsub.subscribe($.events.UPDATE_MOVIE, ( () => {
C()
}
)),
pubsub.subscribe($.events.SORT_CONTAINER, ( () => {
T(+new Date)
}
)),
() => {
document.querySelectorAll(`._resource_video_$
{e.movieId}`).forEach((e => {
e.remove()
}
)),
$.pause(),
$.destroy(),
pubsub.unsubscribe($.events.SORT_CONTAINER),
pubsub.unsubscribe($.events.UPDATE_MOVIE)
}
)), [e.movieId]),
!h)
return jsxRuntimeExports.jsx("div", {
style: {
color: "red"
},
children: "必须填写注册 ID,注册 ID 可通过 https://video.h5ds.com 进行申请"
});
if (!x)
return jsxRuntimeExports.jsxs("div", {
style: {
color: "#ccc"
},
children: ["loading ", v.toFixed(1), "%"]
});
const P = {
width: n.width * p,
height: n.height * p
};
$.updateGroup();
const R = n.transitions;
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
children: [jsxRuntimeExports.jsxs(Stage, {
options: {
resizeTo: "export" === r ? void 0 : i || window,
preserveDrawingBuffer: "export" !== r,
resolution: 1
},
store: $,
target: i,
debug: !0,
viewSize: P,
env: r,
callback: e.callback,
children: [jsxRuntimeExports.jsx(ContainerElement, {
trackIndex: 10,
store: $,
scale: p,
hide: !1,
lock: !1,
visible: !0,
name: "caption",
sortableChildren: !0,
env: r,
children: n.captions.map((e => {
const {startTime: t, duration: n} = e
, i = e.id + "_" + e._dirty
, o = $.currentTime >= t && $.currentTime <= n + t
, s = o ? $.currentTime - t : null;
return jsxRuntimeExports.jsx(CaptionText, {
store: $,
scale: p,
hide: !1,
lock: !1,
dirty: e._dirty,
trackIndex: 1,
relativeTime: s,
currentTime: $.currentTime,
visible: o,
env: r,
element: e
}, i)
}
))
}), jsxRuntimeExports.jsx(ContainerElement, {
trackIndex: 20,
hide: !1,
lock: !1,
store: $,
scale: p,
visible: !0,
name: "body",
backgroundColor: n.background.color,
env: r,
sortableChildren: !0,
sortChildrenUpdate: E,
children: $.groups.map((t => {
const n = t[0].trackIndex
, i = $.getHideLock(n) || {
hide: !1,
lock: !1
};
return jsxRuntimeExports.jsx(ContainerElement, {
env: r,
name: "trackIndex_" + t[0].trackIndex,
trackIndex: t[0].trackIndex,
store: $,
hide: i.hide,
lock: i.lock,
placeholderGraphics: ["image",
"video"].includes(t[0].type),
visible: !0,
children: t.map(( (o, s) => {
const {startTime: a, duration: l} = o
, c = o.speed || 1
, u = $.currentTime >= a && $.currentTime < l
/ c + a
, d = u ? ($.currentTime - a) * c : null
, h = $.getFrameStatus(o, d);
$.asyncFrameAnimateStatus(o, h);
const f = t[s + 1];
let m = null
, g = !1;
if (["image", "video"].includes(o.type) && (m =
R.find((e => e.startElementId === o.id)),
m && f && Math.abs(o.startTime + o.duration -
f.startTime) < .01 && (g = !0),
m && f && Math.abs(o.startTime + o.duration -
f.startTime) > .01 || m && !f)) {
const e = R.findIndex((e =>
e.startElementId === o.id));
R.splice(e, 1)
}
const y = o.id + "_" + o._dirty;
switch (o.type) {
case "lottie":
return jsxRuntimeExports.jsx(LottieEl$1, {
hide: i.hide,
lock: i.lock,
store: $,
scale: p,
dirty: o._dirty,
trackIndex: n,
relativeTime: d,
currentTime: $.currentTime,
visible: u,
env: r,
element: o
}, y);
case "image":
return jsxRuntimeExports.jsx(SpriteElement,
{
hide: i.hide,
lock: i.lock,
store: $,
scale: p,
dirty: o._dirty,
trackIndex: n,
relativeTime: d,
currentTime: $.currentTime,
visible: u,
env: r,
hasTransition: g,
nextElement: f,
transitionElement: m,
element: o
}, y);
case "video":
return jsxRuntimeExports.jsx(VElement$1, {
hide: i.hide,
lock: i.lock,
store: $,
scale: p,
dirty: o._dirty,
trackIndex: n,
relativeTime: d,
currentTime: $.currentTime,
visible: u,
env: r,
hasTransition: g,
nextElement: f,
transitionElement: m,
element: o
}, y);
case "audio":
return jsxRuntimeExports.jsx(VElement, {
hide: i.hide,
lock: i.lock,
store: $,
scale: p,
dirty: o._dirty,
trackIndex: n,
relativeTime: d,
currentTime: $.currentTime,
visible: u,
env: r,
element: o
}, y);
case "filter":
return
jsxRuntimeExports.jsx(LutFilterElement, {
hide: i.hide,
lock: i.lock,
store: $,
scale: p,
dirty: o._dirty,
trackIndex: n,
relativeTime: d,
currentTime: $.currentTime,
visible: u,
env: r,
element: o
}, y);
case "text":
return
jsxRuntimeExports.jsx(TaggedTextElement, {
hide: i.hide,
lock: i.lock,
store: $,
scale: p,
dirty: o._dirty,
trackIndex: n,
relativeTime: d,
currentTime: $.currentTime,
visible: u,
env: r,
element: o
}, y);
case "effect":
return jsxRuntimeExports.jsx(Effect$1, {
store: $,
hide: i.hide,
lock: i.lock,
scale: p,
dirty: o._dirty,
trackIndex: n,
relativeTime: d,
currentTime: $.currentTime,
visible: u,
env: r,
element: o
}, y);
default:
if (e.plugins) {
const t = e.plugins.find((e => o.type
=== e.type));
if (t) {
const e = t.Element;
return jsxRuntimeExports.jsx(e, {
hide: i.hide,
lock: i.lock,
store: $,
scale: p,
dirty: o._dirty,
trackIndex: n,
relativeTime: d,
currentTime: $.currentTime,
visible: u,
env: r,
hasTransition: g,
nextElement: f,
transitionElement: m,
element: o
}, y)
}
}
return
jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {})
}
}
))
}, n)
}
))
})]
}), "editor" === r && jsxRuntimeExports.jsx(RecordManager, {
store: $
}), "editor" === r && jsxRuntimeExports.jsx(Control, {
scale: p,
store: $,
stopControl: e.stopControl,
viewSize: P,
onSelectElements: e.onSelectElements,
rootContainer: i,
dragContainer: document.getElementById("h5dsCanvasOuter")
})]
})
}
const Movie$1 = reactExports.forwardRef(Movie);
class ResourceItem {
constructor(e) {
this.id = createID(),
this.name = "",
this.type = "",
this.url = "",
this.originId = void 0,
this.thumb = void 0,
this.styleSize = void 0,
this.fileSize = void 0,
this.wave = void 0,
this.frames = void 0,
this.noAudioTracks = void 0,
this.fileType = "",
this.from = "other",
this.mustFetch = !1,
this.duration = void 0,
this.extend = void 0,
this.attrs = void 0,
Object.assign(this, e)
}
}
const base = "";
function noop$3() {}
var noop_1 = noop$3;
const _noop = getDefaultExportFromCjs(noop_1)
, log = function(e) {
if ("development" === _get(process, "env.NODE_ENV"))
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n
= 1; n < t; n++)
r[n - 1] = arguments[n]
}
, log$1 = log;
class BaseFoundation {
static get cssClasses() {
return {}
}
static get strings() {
return {}
}
static get numbers() {
return {}
}
static get defaultAdapter() {
return {
getProp: _noop,
getProps: _noop,
getState: _noop,
getStates: _noop,
setState: _noop,
getContext: _noop,
getContexts: _noop,
getCache: _noop,
setCache: _noop,
getCaches: _noop,
stopPropagation: _noop,
persistEvent: _noop
}
}
constructor(e) {
this._adapter = Object.assign(Object.assign({},
BaseFoundation.defaultAdapter), e)
}
getProp(e) {
return this._adapter.getProp(e)
}
getProps() {
return this._adapter.getProps()
}
getState(e) {
return this._adapter.getState(e)
}
getStates() {
return this._adapter.getStates()
}
setState(e, t) {
return this._adapter.setState(Object.assign({}, e), t)
}
getContext(e) {
return this._adapter.getContext(e)
}
getContexts() {
return this._adapter.getContexts()
}
getCaches() {
return this._adapter.getCaches()
}
getCache(e) {
return this._adapter.getCache(e)
}
setCache(e, t) {
return e && this._adapter.setCache(e, t)
}
stopPropagation(e) {
this._adapter.stopPropagation(e)
}
_isControlledComponent() {
return (arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : "value")in this.getProps()
}
_isInProps(e) {
return e in this.getProps()
}
init(e) {}
destroy() {}
log(e) {
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n
= 1; n < t; n++)
r[n - 1] = arguments[n];
log$1(e, ...r)
}
_persistEvent(e) {
this._adapter.persistEvent(e)
}
}
const BaseFoundation$1 = BaseFoundation;
function getDataAttr(e) {
return Object.keys(e).reduce(( (t, r) => ("data-" === r.substr(0, 5) &&
(t[r] = e[r]),
t)), {})
}
const {hasOwnProperty: hasOwnProperty$h} = Object.prototype;
class BaseComponent extends reactExports.Component {
constructor(e) {
super(e),
this.isControlled = e => Boolean(e && this.props && "object" ==
typeof this.props && hasOwnProperty$h.call(this.props, e)),
this.setStateAsync = e => new Promise((t => {
this.setState(e, t)
}
)),
this.cache = {},
this.foundation = null
}
componentDidMount() {
this.foundation && "function" == typeof this.foundation.init &&
this.foundation.init()
}
componentWillUnmount() {
this.foundation && "function" == typeof this.foundation.destroy &&
this.foundation.destroy(),
this.cache = {}
}
get adapter() {
return {
getContext: e => {
if (this.context && e)
return this.context[e]
}
,
getContexts: () => this.context,
getProp: e => this.props[e],
getProps: () => this.props,
getState: e => this.state[e],
getStates: () => this.state,
setState: (e, t) => this.setState(Object.assign({}, e), t),
getCache: e => e && this.cache[e],
getCaches: () => this.cache,
setCache: (e, t) => e && (this.cache[e] = t),
stopPropagation: e => {
try {
e.stopPropagation(),
e.nativeEvent &&
e.nativeEvent.stopImmediatePropagation()
} catch (t) {}
}
,
persistEvent: e => {
e && e.persist && "function" == typeof e.persist &&
e.persist()
}
}
}
log(e) {
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n
= 1; n < t; n++)
r[n - 1] = arguments[n];
return log$1(e, ...r)
}
getDataAttr() {
return getDataAttr(arguments.length > 0 && void 0 !==
arguments[0] ? arguments[0] : this.props)
}
}
BaseComponent.propTypes = {},
BaseComponent.defaultProps = {};
var debounce$1 = debounce_1
, isObject$7 = isObject_1
, FUNC_ERROR_TEXT$3 = "Expected a function";
function throttle$2(e, t, r) {
var n = !0
, i = !0;
if ("function" != typeof e)
throw new TypeError(FUNC_ERROR_TEXT$3);
return isObject$7(r) && (n = "leading"in r ? !!r.leading : n,
i = "trailing"in r ? !!r.trailing : i),
debounce$1(e, t, {
leading: n,
maxWait: t,
trailing: i
})
}
var throttle_1 = throttle$2;
const throttle$3 = getDefaultExportFromCjs(throttle_1);
var classnames = {
exports: {}
};
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(e) {
!function() {
var t = {}.hasOwnProperty;
function r() {
for (var e = "", t = 0; t < arguments.length; t++) {
var r = arguments[t];
r && (e = i(e, n(r)))
}
return e
}
function n(e) {
if ("string" == typeof e || "number" == typeof e)
return e;
if ("object" != typeof e)
return "";
if (Array.isArray(e))
return r.apply(null, e);
if (e.toString !== Object.prototype.toString && !
e.toString.toString().includes("[native code]"))
return e.toString();
var n = "";
for (var o in e)
t.call(e, o) && e[o] && (n = i(n, o));
return n
}
function i(e, t) {
return t ? e ? e + " " + t : e + t : e
}
e.exports ? (r.default = r,
e.exports = r) : window.classNames = r
}()
}(classnames);
var classnamesExports = classnames.exports;
const classNames = getDefaultExportFromCjs(classnamesExports)
, BASE_CLASS_PREFIX$1 = "semi"
, VALIDATE_STATUS = ["default", "error", "warning", "success"];
function t$1(e) {
return "object" == typeof e && null != e && 1 === e.nodeType
}
function e$1(e, t) {
return (!t || "hidden" !== e) && "visible" !== e && "clip" !== e
}
function n$2(e, t) {
if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) {
var r = getComputedStyle(e, null);
return e$1(r.overflowY, t) || e$1(r.overflowX, t) || function(e) {
var t = function(e) {
if (!e.ownerDocument || !e.ownerDocument.defaultView)
return null;
try {
return e.ownerDocument.defaultView.frameElement
} catch (t) {
return null
}
}(e);
return !!t && (t.clientHeight < e.scrollHeight || t.clientWidth
< e.scrollWidth)
}(e)
}
return !1
}
function r$1(e, t, r, n, i, o, s, a) {
return o < e && s > t || o > e && s < t ? 0 : o <= e && a <= r || s >=
t && a >= r ? o - e - n : s > t && a < r || o < e && a > r ? s - t + i : 0
}
var i$2 = function(e, t) {
var r = window
, n = t.scrollMode
, i = t.block
, o = t.inline
, s = t.boundary
, a = t.skipOverflowHiddenElements
, l = "function" == typeof s ? s : function(e) {
return e !== s
}
;
if (!t$1(e))
throw new TypeError("Invalid target");
for (var c, u, d = document.scrollingElement ||
document.documentElement, p = [], h = e; t$1(h) && l(h); ) {
if ((h = null == (u = (c = h).parentElement) ? c.getRootNode().host
|| null : u) === d) {
p.push(h);
break
}
null != h && h === document.body && n$2(h) && !
n$2(document.documentElement) || null != h && n$2(h, a) && p.push(h)
}
for (var f = r.visualViewport ? r.visualViewport.width : innerWidth, m
= r.visualViewport ? r.visualViewport.height : innerHeight, g = window.scrollX ||
pageXOffset, y = window.scrollY || pageYOffset, v = e.getBoundingClientRect(), b =
v.height, x = v.width, _ = v.top, E = v.right, T = v.bottom, C = v.left, S =
"start" === i || "nearest" === i ? _ : "end" === i ? T : _ + b / 2, $ = "center"
=== o ? C + x / 2 : "end" === o ? E : C, w = [], P = 0; P < p.length; P++) {
var R = p[P]
, k = R.getBoundingClientRect()
, A = k.height
, I = k.width
, O = k.top
, D = k.right
, M = k.bottom
, L = k.left;
if ("if-needed" === n && _ >= 0 && C >= 0 && T <= m && E <= f && _
>= O && T <= M && C >= L && E <= D)
return w;
var j = getComputedStyle(R)
, F = parseInt(j.borderLeftWidth, 10)
, N = parseInt(j.borderTopWidth, 10)
, B = parseInt(j.borderRightWidth, 10)
, z = parseInt(j.borderBottomWidth, 10)
, U = 0
, V = 0
, H = "offsetWidth"in R ? R.offsetWidth - R.clientWidth - F - B :
0
, G = "offsetHeight"in R ? R.offsetHeight - R.clientHeight - N -
z : 0
, W = "offsetWidth"in R ? 0 === R.offsetWidth ? 0 : I /
R.offsetWidth : 0
, Y = "offsetHeight"in R ? 0 === R.offsetHeight ? 0 : A /
R.offsetHeight : 0;
if (d === R)
U = "start" === i ? S : "end" === i ? S - m : "nearest" === i ?
r$1(y, y + m, m, N, z, y + S, y + S + b, b) : S - m / 2,
V = "start" === o ? $ : "center" === o ? $ - f / 2 : "end" ===
o ? $ - f : r$1(g, g + f, f, F, B, g + $, g + $ + x, x),
U = Math.max(0, U + y),
V = Math.max(0, V + g);
else {
U = "start" === i ? S - O - N : "end" === i ? S - M + z + G :
"nearest" === i ? r$1(O, M, A, N, z + G, S, S + b, b) : S - (O + A / 2) + G / 2,
V = "start" === o ? $ - L - F : "center" === o ? $ - (L + I /
2) + H / 2 : "end" === o ? $ - D + B + H : r$1(L, D, I, F, B + H, $, $ + x, x);
var K = R.scrollLeft
, X = R.scrollTop;
S += X - (U = Math.max(0, Math.min(X + U / Y, R.scrollHeight -
A / Y + G))),
$ += K - (V = Math.max(0, Math.min(K + V / W, R.scrollWidth - I
/ W + H)))
}
w.push({
el: R,
top: U,
left: V
})
}
return w
};
function isOptionsObject(e) {
return e === Object(e) && 0 !== Object.keys(e).length
}
function defaultBehavior(e, t) {
void 0 === t && (t = "auto");
var r = "scrollBehavior"in document.body.style;
e.forEach((function(e) {
var n = e.el
, i = e.top
, o = e.left;
n.scroll && r ? n.scroll({
top: i,
left: o,
behavior: t
}) : (n.scrollTop = i,
n.scrollLeft = o)
}
))
}
function getOptions(e) {
return !1 === e ? {
block: "end",
inline: "nearest"
} : isOptionsObject(e) ? e : {
block: "start",
inline: "nearest"
}
}
function scrollIntoView(e, t) {
var r = e.isConnected || e.ownerDocument.documentElement.contains(e);
if (isOptionsObject(t) && "function" == typeof t.behavior)
return t.behavior(r ? i$2(e, t) : []);
if (r) {
var n = getOptions(t);
return defaultBehavior(i$2(e, n), n.behavior)
}
}
const cssClasses$y = {
PREFIX: `${BASE_CLASS_PREFIX$1}-typography`
}
, strings$u = {
WEIGHT: ["light", "regular", "medium", "semibold", "bold", "default"],
TYPE: ["primary", "secondary", "danger", "warning", "success",
"tertiary", "quaternary"],
SIZE: ["normal", "small", "inherit"],
SPACING: ["normal", "extended"],
HEADING: [1, 2, 3, 4, 5, 6],
RULE: ["text", "numbers", "bytes-decimal", "bytes-binary",
"percentages", "exponential"],
TRUNCATE: ["ceil", "floor", "round"]
}
, typography = "";
var __rest$_ = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$w = cssClasses$y.PREFIX;
let Typography$2 = class extends reactExports.PureComponent {
render() {
const e = this.props
, {component: t, className: r, children: n, forwardRef: i} = e
, o = __rest$_(e, ["component", "className", "children",
"forwardRef"])
, s = t
, a = classNames(prefixCls$w, r);
return React.createElement(s, Object.assign({
className: a,
ref: i
}, o), n)
}
}
;
Typography$2.defaultProps = {
component: "article",
style: {},
className: ""
},
Typography$2.propTypes = {
component: PropTypes.string,
style: PropTypes.object,
className: PropTypes.string
};
const BaseTypography = Typography$2;
function isNull(e) {
return null === e
}
var isNull_1 = isNull;
const _isNull = getDefaultExportFromCjs(isNull_1);
var baseGetTag$6 = _baseGetTag
, isArray$9 = isArray_1
, isObjectLike$7 = isObjectLike_1
, stringTag$2 = "[object String]";
function isString$2(e) {
return "string" == typeof e || !isArray$9(e) && isObjectLike$7(e) &&
baseGetTag$6(e) == stringTag$2
}
var isString_1 = isString$2;
const _isString = getDefaultExportFromCjs(isString_1);
var baseAssignValue$1 = _baseAssignValue
, eq$2 = eq_1;
function assignMergeValue$3(e, t, r) {
(void 0 !== r && !eq$2(e[t], r) || void 0 === r && !(t in e)) &&
baseAssignValue$1(e, t, r)
}
var _assignMergeValue = assignMergeValue$3
, isArrayLike$7 = isArrayLike_1
, isObjectLike$6 = isObjectLike_1;
function isArrayLikeObject$4(e) {
return isObjectLike$6(e) && isArrayLike$7(e)
}
var isArrayLikeObject_1 = isArrayLikeObject$4
, baseGetTag$5 = _baseGetTag
, getPrototype$2 = _getPrototype
, isObjectLike$5 = isObjectLike_1
, objectTag$4 = "[object Object]"
, funcProto$3 = Function.prototype
, objectProto$h = Object.prototype
, funcToString$3 = funcProto$3.toString
, hasOwnProperty$g = objectProto$h.hasOwnProperty
, objectCtorString$1 = funcToString$3.call(Object);
function isPlainObject$4(e) {
if (!isObjectLike$5(e) || baseGetTag$5(e) != objectTag$4)
return !1;
var t = getPrototype$2(e);
if (null === t)
return !0;
var r = hasOwnProperty$g.call(t, "constructor") && t.constructor;
return "function" == typeof r && r instanceof r &&
funcToString$3.call(r) == objectCtorString$1
}
var isPlainObject_1 = isPlainObject$4;
const _isPlainObject = getDefaultExportFromCjs(isPlainObject_1);
function safeGet$3(e, t) {
if (("constructor" !== t || "function" != typeof e[t]) && "__proto__" !
= t)
return e[t]
}
var _safeGet = safeGet$3
, copyObject$3 = _copyObject
, keysIn$2 = keysIn_1;
function toPlainObject$2(e) {
return copyObject$3(e, keysIn$2(e))
}
var toPlainObject_1 = toPlainObject$2
, assignMergeValue$2 = _assignMergeValue
, cloneBuffer$1 = _cloneBufferExports
, cloneTypedArray$1 = _cloneTypedArray
, copyArray$2 = _copyArray
, initCloneObject$1 = _initCloneObject
, isArguments$4 = isArguments_1
, isArray$8 = isArray_1
, isArrayLikeObject$3 = isArrayLikeObject_1
, isBuffer$3 = isBufferExports
, isFunction$3 = isFunction_1
, isObject$6 = isObject_1
, isPlainObject$3 = isPlainObject_1
, isTypedArray$3 = isTypedArray_1
, safeGet$2 = _safeGet
, toPlainObject$1 = toPlainObject_1;
function baseMergeDeep$2(e, t, r, n, i, o, s) {
var a = safeGet$2(e, r)
, l = safeGet$2(t, r)
, c = s.get(l);
if (c)
assignMergeValue$2(e, r, c);
else {
var u = o ? o(a, l, r + "", e, t, s) : void 0
, d = void 0 === u;
if (d) {
var p = isArray$8(l)
, h = !p && isBuffer$3(l)
, f = !p && !h && isTypedArray$3(l);
u = l,
p || h || f ? isArray$8(a) ? u = a : isArrayLikeObject$3(a) ? u
= copyArray$2(a) : h ? (d = !1,
u = cloneBuffer$1(l, !0)) : f ? (d = !1,
u = cloneTypedArray$1(l, !0)) : u = [] : isPlainObject$3(l) ||
isArguments$4(l) ? (u = a,
isArguments$4(a) ? u = toPlainObject$1(a) : isObject$6(a) && !
isFunction$3(a) || (u = initCloneObject$1(l))) : d = !1
}
d && (s.set(l, u),
i(u, l, n, o, s),
s.delete(l)),
assignMergeValue$2(e, r, u)
}
}
var _baseMergeDeep = baseMergeDeep$2
, Stack$1 = _Stack
, assignMergeValue$1 = _assignMergeValue
, baseFor$2 = _baseFor
, baseMergeDeep$1 = _baseMergeDeep
, isObject$5 = isObject_1
, keysIn$1 = keysIn_1
, safeGet$1 = _safeGet;
function baseMerge$2(e, t, r, n, i) {
e !== t && baseFor$2(t, (function(o, s) {
if (i || (i = new Stack$1),
isObject$5(o))
baseMergeDeep$1(e, t, s, r, baseMerge$2, n, i);
else {
var a = n ? n(safeGet$1(e, s), o, s + "", e, t, i) : void 0;
void 0 === a && (a = o),
assignMergeValue$1(e, s, a)
}
}
), keysIn$1)
}
var _baseMerge = baseMerge$2;
function apply$2(e, t, r) {
switch (r.length) {
case 0:
return e.call(t);
case 1:
return e.call(t, r[0]);
case 2:
return e.call(t, r[0], r[1]);
case 3:
return e.call(t, r[0], r[1], r[2])
}
return e.apply(t, r)
}
var _apply = apply$2
, apply$1 = _apply
, nativeMax$4 = Math.max;
function overRest$3(e, t, r) {
return t = nativeMax$4(void 0 === t ? e.length - 1 : t, 0),
function() {
for (var n = arguments, i = -1, o = nativeMax$4(n.length - t, 0), s
= Array(o); ++i < o; )
s[i] = n[t + i];
i = -1;
for (var a = Array(t + 1); ++i < t; )
a[i] = n[i];
return a[t] = r(s),
apply$1(e, this, a)
}
}
var _overRest = overRest$3;
function constant$2(e) {
return function() {
return e
}
}
var constant_1 = constant$2
, constant$1 = constant_1
, defineProperty$3 = _defineProperty$4
, identity$4 = identity_1
, baseSetToString$3 = defineProperty$3 ? function(e, t) {
return defineProperty$3(e, "toString", {
configurable: !0,
enumerable: !1,
value: constant$1(t),
writable: !0
})
}
: identity$4
, _baseSetToString = baseSetToString$3
, HOT_COUNT$1 = 800
, HOT_SPAN$1 = 16
, nativeNow$1 = Date.now;
function shortOut$2(e) {
var t = 0
, r = 0;
return function() {
var n = nativeNow$1()
, i = HOT_SPAN$1 - (n - r);
if (r = n,
i > 0) {
if (++t >= HOT_COUNT$1)
return arguments[0]
} else
t = 0;
return e.apply(void 0, arguments)
}
}
var _shortOut = shortOut$2
, baseSetToString$2 = _baseSetToString
, shortOut$1 = _shortOut
, setToString$4 = shortOut$1(baseSetToString$2)
, _setToString = setToString$4
, identity$3 = identity_1
, overRest$2 = _overRest
, setToString$3 = _setToString;
function baseRest$4(e, t) {
return setToString$3(overRest$2(e, t, identity$3), e + "")
}
var _baseRest = baseRest$4
, eq$1 = eq_1
, isArrayLike$6 = isArrayLike_1
, isIndex$2 = _isIndex
, isObject$4 = isObject_1;
function isIterateeCall$4(e, t, r) {
if (!isObject$4(r))
return !1;
var n = typeof t;
return !!("number" == n ? isArrayLike$6(r) && isIndex$2(t, r.length) :
"string" == n && t in r) && eq$1(r[t], e)
}
var _isIterateeCall = isIterateeCall$4
, baseRest$3 = _baseRest
, isIterateeCall$3 = _isIterateeCall;
function createAssigner$3(e) {
return baseRest$3((function(t, r) {
var n = -1
, i = r.length
, o = i > 1 ? r[i - 1] : void 0
, s = i > 2 ? r[2] : void 0;
for (o = e.length > 3 && "function" == typeof o ? (i--,
o) : void 0,
s && isIterateeCall$3(r[0], r[1], s) && (o = i < 3 ? void 0 : o,
i = 1),
t = Object(t); ++n < i; ) {
var a = r[n];
a && e(t, a, n, o)
}
return t
}
))
}
var _createAssigner = createAssigner$3
, baseMerge$1 = _baseMerge
, createAssigner$2 = _createAssigner
, merge$2 = createAssigner$2((function(e, t, r) {
baseMerge$1(e, t, r)
}
))
, merge_1 = merge$2;
const _merge = getDefaultExportFromCjs(merge_1);
var isPlainObject$2 = isPlainObject_1;
function customOmitClone$1(e) {
return isPlainObject$2(e) ? void 0 : e
}
var _customOmitClone = customOmitClone$1
, Symbol$3 = _Symbol
, isArguments$3 = isArguments_1
, isArray$7 = isArray_1
, spreadableSymbol = Symbol$3 ? Symbol$3.isConcatSpreadable : void 0;
function isFlattenable$1(e) {
return isArray$7(e) || isArguments$3(e) || !!(spreadableSymbol && e &&
e[spreadableSymbol])
}
var _isFlattenable = isFlattenable$1
, arrayPush$1 = _arrayPush
, isFlattenable = _isFlattenable;
function baseFlatten$2(e, t, r, n, i) {
var o = -1
, s = e.length;
for (r || (r = isFlattenable),
i || (i = []); ++o < s; ) {
var a = e[o];
t > 0 && r(a) ? t > 1 ? baseFlatten$2(a, t - 1, r, n, i) :
arrayPush$1(i, a) : n || (i[i.length] = a)
}
return i
}
var _baseFlatten = baseFlatten$2
, baseFlatten$1 = _baseFlatten;
function flatten$2(e) {
return (null == e ? 0 : e.length) ? baseFlatten$1(e, 1) : []
}
var flatten_1 = flatten$2
, flatten$1 = flatten_1
, overRest$1 = _overRest
, setToString$2 = _setToString;
function flatRest$2(e) {
return setToString$2(overRest$1(e, void 0, flatten$1), e + "")
}
var _flatRest = flatRest$2
, arrayMap$4 = _arrayMap
, baseClone$1 = _baseClone
, baseUnset$1 = _baseUnset
, castPath$3 = _castPath
, copyObject$2 = _copyObject
, customOmitClone = _customOmitClone
, flatRest$1 = _flatRest
, getAllKeysIn = _getAllKeysIn
, CLONE_DEEP_FLAG$1 = 1
, CLONE_FLAT_FLAG = 2
, CLONE_SYMBOLS_FLAG$1 = 4
, omit = flatRest$1((function(e, t) {
var r = {};
if (null == e)
return r;
var n = !1;
t = arrayMap$4(t, (function(t) {
return t = castPath$3(t, e),
n || (n = t.length > 1),
t
}
)),
copyObject$2(e, getAllKeysIn(e), r),
n && (r = baseClone$1(r, CLONE_DEEP_FLAG$1 | CLONE_FLAT_FLAG |
CLONE_SYMBOLS_FLAG$1, customOmitClone));
for (var i = t.length; i--; )
baseUnset$1(r, t[i]);
return r
}
))
, omit_1 = omit;
const _omit = getDefaultExportFromCjs(omit_1);
function isUndefined$2(e) {
return void 0 === e
}
var isUndefined_1 = isUndefined$2;
const _isUndefined = getDefaultExportFromCjs(isUndefined_1);
var baseIsEqual$1 = _baseIsEqual;
function isEqual$2(e, t) {
return baseIsEqual$1(e, t)
}
var isEqual_1 = isEqual$2;
const _isEqual = getDefaultExportFromCjs(isEqual_1);
var baseKeys$1 = _baseKeys
, getTag$3 = _getTag
, isArguments$2 = isArguments_1
, isArray$6 = isArray_1
, isArrayLike$5 = isArrayLike_1
, isBuffer$2 = isBufferExports
, isPrototype$2 = _isPrototype
, isTypedArray$2 = isTypedArray_1
, mapTag$3 = "[object Map]"
, setTag$3 = "[object Set]"
, objectProto$g = Object.prototype
, hasOwnProperty$f = objectProto$g.hasOwnProperty;
function isEmpty(e) {
if (null == e)
return !0;
if (isArrayLike$5(e) && (isArray$6(e) || "string" == typeof e ||
"function" == typeof e.splice || isBuffer$2(e) || isTypedArray$2(e) ||
isArguments$2(e)))
return !e.length;
var t = getTag$3(e);
if (t == mapTag$3 || t == setTag$3)
return !e.size;
if (isPrototype$2(e))
return !baseKeys$1(e).length;
for (var r in e)
if (hasOwnProperty$f.call(e, r))
return !1;
return !0
}
var isEmpty_1 = isEmpty;
const _isEmpty = getDefaultExportFromCjs(isEmpty_1);
var identity$2 = identity_1;
function castFunction$4(e) {
return "function" == typeof e ? e : identity$2
}
var _castFunction = castFunction$4
, arrayEach$1 = _arrayEach
, baseEach$3 = _baseEach
, castFunction$3 = _castFunction
, isArray$5 = isArray_1;
function forEach$2(e, t) {
return (isArray$5(e) ? arrayEach$1 : baseEach$3)(e, castFunction$3(t))
}
var forEach_1 = forEach$2
, each = forEach_1;
const _each = getDefaultExportFromCjs(each);
function warning$1(e, t) {}
function isNullOrUndefined(e) {
return null == e
}
let Event$2 = class {
constructor() {
this._eventMap = new Map
}
on(e, t) {
return e && "function" == typeof t && (this._eventMap.has(e) ||
this._eventMap.set(e, []),
this._eventMap.get(e).push(t)),
this
}
once(e, t) {
var r = this;
if (e && "function" == typeof t) {
const n = function() {
t(...arguments),
r.off(e, n)
};
this.on(e, n)
}
}
off(e, t) {
if (e)
if ("function" == typeof t) {
const r = this._eventMap.get(e);
if (Array.isArray(r) && r.length) {
let e = -1;
for (; (e = r.findIndex((e => e === t))) > -1; )
r.splice(e, 1)
}
} else
isNullOrUndefined(t) && this._eventMap.delete(e);
return this
}
emit(e) {
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n
= 1; n < t; n++)
r[n - 1] = arguments[n];
if (!this._eventMap.has(e))
return !1;
return [...this._eventMap.get(e)].forEach((e => e(...r))),
!0
}
}
;
function isElement$1(e) {
try {
return e instanceof HTMLElement
} catch (e2) {
return "object" == typeof e && 1 === e.nodeType && "object" ==
typeof e.style && "object" == typeof e.ownerDocument
}
}
function append(e) {
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n = 1;
n < t; n++)
r[n - 1] = arguments[n];
for (const i of r)
e.appendChild(i);
return e
}
function prepend(e) {
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n = 1;
n < t; n++)
r[n - 1] = arguments[n];
if (e.children && e.children.length) {
const t = e.children[0];
for (const n of r)
e.insertBefore(n, t)
} else
append(e, ...r);
return e
}
function convertDOMRectToObject(e) {
if (e && "object" == typeof e) {
if ("function" == typeof e.toJSON)
return e.toJSON();
return ["left", "top", "right", "bottom", "width",
"height"].reduce(( (t, r) => (t[r] = e[r],
t)), {})
}
}
function handlePrevent(e) {
e.stopPropagation(),
e.preventDefault()
}
function isPrintableCharacter(e) {
return 1 === e.length && e.match(/\S/)
}
function setFocusToItem(e, t) {
for (let r = 0; r < e.length; r++)
e[r] === t ? (e[r].tabIndex = 0,
e[r].focus()) : e[r].tabIndex = -1
}
function setFocusToFirstItem(e) {
e.length > 0 && setFocusToItem(e, e[0])
}
function setFocusToLastItem(e) {
e.length > 0 && setFocusToItem(e, e[e.length - 1])
}
function setFocusToPreviousMenuItem(e, t) {
let r, n;
e.length > 0 && (t === e[0] ? r = e[e.length - 1] : (n = e.indexOf(t),
r = e[n - 1]),
setFocusToItem(e, r))
}
function setFocusToNextMenuitem(e, t) {
let r, n;
e.length > 0 && (t === e[e.length - 1] ? r = e[0] : (n = e.indexOf(t),
r = e[n + 1]),
setFocusToItem(e, r))
}
function findIndexByCharacter(e, t, r, n) {
let i, o;
return !e || !r || !n || n.length > 1 ? -1 : (n = n.toLowerCase(),
i = e.indexOf(t) + 1,
i >= e.length && (i = 0),
o = r.indexOf(n, i),
-1 === o && (o = r.indexOf(n, 0)),
o >= 0 ? o : -1)
}
function getAncestorNodeByRole(e, t) {
if (!e)
return null;
for (; e.parentElement && _get(e.parentElement,
"attributes.role.value", "") !== t; )
e = e.parentElement;
return e.parentElement
}
function getMenuButton(e, t) {
for (let r = 0; r < e.length; r++) {
const n = e[r].attributes["data-popupid"];
if (n && n.value === t)
return e[r]
}
return null
}
const REGS = {
TOP: /top/i,
RIGHT: /right/i,
BOTTOM: /bottom/i,
LEFT: /left/i
}
, defaultRect = {
left: 0,
top: 0,
height: 0,
width: 0,
scrollLeft: 0,
scrollTop: 0
};
let Tooltip$1 = class extends BaseFoundation$1 {
constructor(e) {
var t;
super(Object.assign({}, e)),
t = this,
this.removePortal = () => {
this._adapter.removePortal()
}
,
this.setDisplayNone = (e, t) => {
this._adapter.setDisplayNone(e, t)
}
,
this.updateStateIfCursorOnTrigger = e => {
var t, r;
if (null === (t = null == e ? void 0 : e.matches) || void 0 ===
t ? void 0 : t.call(e, ":hover")) {
const e = this._adapter.getEventName()
, t = this.getState("triggerEventSet");
null === (r = t[e.mouseEnter]) || void 0 === r || r.call(t)
}
}
,
this.onResize = () => {
this.calcPosition()
}
,
this.delayShow = () => {
const e = this.getProp("mouseEnterDelay");
this.clearDelayTimer(),
e > 0 ? this._timer = setTimeout(( () => {
this.show(),
this.clearDelayTimer()
}
), e) : this.show()
}
,
this.show = () => {
const e = this.getProp("content")
, t = this.getProp("trigger")
, r = this.getProp("clickTriggerToHide")
, {visible: n, displayNone: i} = this.getStates();
if (i && this.setDisplayNone(!1),
!n) {
if (this.clearDelayTimer(),
this._adapter.on("portalInserted", ( () => {
this.calcPosition()
}
)),
"hover" === t) {
const e = () => {
var r;
const n = this._adapter.getTriggerDOM();
t && !(null === (r = null == n ? void 0 :
n.matches) || void 0 === r ? void 0 : r.call(n, ":hover")) && this.hide(),
this._adapter.off("portalInserted", e)
}
;
this._adapter.on("portalInserted", e)
}
this._adapter.on("positionUpdated", ( () => {
this._togglePortalVisible(!0)
}
)),
this._adapter.insertPortal(e, {
left: -9999,
top: -9999
}),
"custom" === t &&
this._adapter.registerClickOutsideHandler(( () => {}
)),
("click" === t || r || "contextMenu" === t) &&
this._adapter.registerClickOutsideHandler(this.hide),
this._bindScrollEvent(),
this._bindResizeEvent()
}
}
,
this.calcPosition = function(e, r, n) {
let i = !(arguments.length > 3 && void 0 !== arguments[3]) ||
arguments[3];
e = (_isEmpty(e) ? t._adapter.getTriggerBounding() : e) ||
Object.assign({}, defaultRect),
n = (_isEmpty(n) ? t._adapter.getPopupContainerRect() : n) ||
Object.assign({}, defaultRect),
r = (_isEmpty(r) ? t._adapter.getWrapperBounding() : r) ||
Object.assign({}, defaultRect);
let o = t.calcPosStyle({
triggerRect: e,
wrapperRect: r,
containerRect: n
})
, s = t.getProp("position");
if (t.getProp("autoAdjustOverflow")) {
const {position: i, isHeightOverFlow: a, isWidthOverFlow:
l} = t.adjustPosIfNeed(s, o, e, r, n);
(s !== i || a || l) && (s = i,
o = t.calcPosStyle({
triggerRect: e,
wrapperRect: r,
containerRect: n,
position: s,
spacing: null,
isOverFlow: [a, l]
}))
}
return i && t._mounted &&
t._adapter.setPosition(Object.assign(Object.assign({}, o), {
position: s
})),
o
}
,
this.delayHide = () => {
const e = this.getProp("mouseLeaveDelay");
this.clearDelayTimer(),
e > 0 ? this._timer = setTimeout(( () => {
this.hide(),
this.clearDelayTimer()
}
), e) : this.hide()
}
,
this.hide = () => {
this.clearDelayTimer(),
this._togglePortalVisible(!1),
this._adapter.off("portalInserted"),
this._adapter.off("positionUpdated")
}
,
this.handleContainerKeydown = e => {
const {guardFocus: t, closeOnEsc: r} = this.getProps();
switch (e && e.key) {
case "Escape":
r && this._handleEscKeyDown(e);
break;
case "Tab":
if (t) {
const t = this._adapter.getContainer()
, r = this._adapter.getFocusableElements(t);
r.length && (e.shiftKey ?
this._handleContainerShiftTabKeyDown(r, e) : this._handleContainerTabKeyDown(r, e))
}
}
}
,
this._timer = null
}
init() {
const {wrapperId: e} = this.getProps();
this._mounted = !0,
this._bindEvent(),
this._shouldShow(),
this._initContainerPosition(),
e || this._adapter.setId()
}
destroy() {
this._mounted = !1,
this.unBindEvent()
}
_bindEvent() {
const e = this.getProp("trigger")
, {triggerEventSet: t, portalEventSet: r} =
this._generateEvent(e);
this._bindTriggerEvent(t),
this._bindPortalEvent(r),
this._bindResizeEvent()
}
unBindEvent() {
this._adapter.unregisterClickOutsideHandler(),
this.unBindResizeEvent(),
this.unBindScrollEvent(),
clearTimeout(this._timer)
}
_bindTriggerEvent(e) {
this._adapter.registerTriggerEvent(e)
}
_bindPortalEvent(e) {
this._adapter.registerPortalEvent(e)
}
_bindResizeEvent() {
this._adapter.registerResizeHandler(this.onResize)
}
unBindResizeEvent() {
this._adapter.unregisterResizeHandler(this.onResize)
}
_adjustPos() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : ""
, t = arguments.length > 1 && void 0 !== arguments[1] &&
arguments[1]
, r = arguments.length > 3 ? arguments[3] : void 0;
switch (arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : "reverse") {
case "reverse":
default:
return this._reversePos(e, t);
case "expand":
return this._expandPos(e, r);
case "reduce":
return this._reducePos(e)
}
}
_reversePos() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : "";
if (arguments.length > 1 && void 0 !== arguments[1] &&
arguments[1]) {
if (REGS.TOP.test(e))
return e.replace("top", "bottom").replace("Top", "Bottom");
if (REGS.BOTTOM.test(e))
return e.replace("bottom", "top").replace("Bottom", "Top")
} else {
if (REGS.LEFT.test(e))
return e.replace("left", "right").replace("Left", "Right");
if (REGS.RIGHT.test(e))
return e.replace("right", "left").replace("Right", "Left")
}
return e
}
_expandPos() {
let e = arguments.length > 1 ? arguments[1] : void 0;
return (arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : "").concat(e)
}
_reducePos() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : "";
const t = ["Top", "Bottom", "Left", "Right"].find((t =>
e.endsWith(t)));
return t ? e.replace(t, "") : e
}
clearDelayTimer() {
this._timer && (clearTimeout(this._timer),
this._timer = null)
}
_generateEvent(e) {
const t = this._adapter.getEventName()
, r = {
[t.keydown]: e => {
this._handleTriggerKeydown(e)
}
};
let n = {};
switch (e) {
case "focus":
r[t.focus] = () => {
this.delayShow()
}
,
r[t.blur] = () => {
this.delayHide()
}
,
n = r;
break;
case "click":
r[t.click] = () => {
this.show()
}
,
n = {};
break;
case "hover":
r[t.mouseEnter] = () => {
this.setCache("isClickToHide", !1),
this.delayShow()
}
,
r[t.mouseLeave] = () => {
this.delayHide()
}
,
r[t.focus] = () => {
const {disableFocusListener: e} = this.getProps();
!e && this.delayShow()
}
,
r[t.blur] = () => {
const {disableFocusListener: e} = this.getProps();
!e && this.delayHide()
}
,
n = Object.assign({}, r),
this.getProp("clickToHide") && (n[t.click] = () => {
this.setCache("isClickToHide", !0),
this.hide()
}
,
n[t.mouseEnter] = () => {
this.getCache("isClickToHide") || this.delayShow()
}
);
break;
case "custom":
break;
case "contextMenu":
r[t.contextMenu] = e => {
e.preventDefault(),
this.show()
}
}
return {
triggerEventSet: r,
portalEventSet: n
}
}
_shouldShow() {
this.getProp("visible") && this.show()
}
_togglePortalVisible(e) {
this.getState("visible") !== e &&
this._adapter.togglePortalVisible(e, ( () => {
e && this._adapter.setInitialFocus(),
this._adapter.notifyVisibleChange(e)
}
))
}
_roundPixel(e) {
return "number" == typeof e ? Math.round(e) : e
}
calcTransformOrigin(e, t, r, n) {
if (e && t && null != r && null != n) {
if (this.getProp("transformFromCenter")) {
if (["topLeft", "bottomLeft"].includes(e))
return `${this._roundPixel(t.width / 2)}px ${100 * -n}
%`;
if (["topRight", "bottomRight"].includes(e))
return `calc(100% - ${this._roundPixel(t.width / 2)}px)
${100 * -n}%`;
if (["leftTop", "rightTop"].includes(e))
return `${100 * -r}% ${this._roundPixel(t.height /
2)}px`;
if (["leftBottom", "rightBottom"].includes(e))
return `${100 * -r}% calc(100% - $
{this._roundPixel(t.height / 2)}px)`
}
return `${100 * -r}% ${100 * -n}%`
}
return null
}
calcPosStyle(e) {
var t;
const {spacing: r, isOverFlow: n} = e
, {innerWidth: i} = window
, o = (_isEmpty(e.triggerRect) ? e.triggerRect :
this._adapter.getTriggerBounding()) || Object.assign({}, defaultRect)
, s = (_isEmpty(e.containerRect) ? e.containerRect :
this._adapter.getPopupContainerRect()) || Object.assign({}, defaultRect)
, a = (_isEmpty(e.wrapperRect) ? e.wrapperRect :
this._adapter.getWrapperBounding()) || Object.assign({}, defaultRect)
, l = null != e.position ? e.position : this.getProp("position")
, c = null != r ? r : this.getProp("spacing")
, {arrowPointAtCenter: u, showArrow: d, arrowBounding: p} =
this.getProps()
, h = d && u;
let f = c
, m = 0;
if ("number" != typeof c) {
const e = l.includes("top") || l.includes("bottom");
f = e ? c.y : c.x,
m = e ? c.x : c.y
}
const g = _get(p, "width", 24)
, y = _get(p, "width", 24)
, v = _get(p, "offsetY", 0);
let b, x, _ = 0, E = 0;
const T = o.left + o.width / 2
, C = o.top + o.height / 2
, S = 6 + g / 2
, $ = 6 + y / 2
, w = a.height - s.height
, P = a.width - s.width
, R = w > 0 ? w : 0
, k = P > 0 ? P : 0
, A = n && n[0]
, I = n && n[1]
, O = T - s.left < s.right - T
, D = C - s.top < s.bottom - C
, M = a.width > i
, L = Math.abs((null == a ? void 0 : a.width) - (null === (t =
this._adapter.getContainer()) || void 0 === t ? void 0 : t.clientWidth)) > 1;
switch (L && (f = f * a.width /
this._adapter.getContainer().clientWidth),
l) {
case "top":
b = I ? O ? s.left + a.width / 2 : s.right - a.width / 2 + k :
T + m,
x = A ? s.bottom + R : o.top - f,
_ = -.5,
E = -1;
break;
case "topLeft":
b = I ? M ? s.left : s.right - a.width : h ? T - S + m : o.left
+ m,
x = A ? s.bottom + R : o.top - f,
E = -1;
break;
case "topRight":
b = I ? s.right + k : h ? T + S + m : o.right + m,
x = A ? s.bottom + R : o.top - f,
E = -1,
_ = -1;
break;
case "left":
b = I ? s.right + k - f + S : o.left - f,
x = A ? D ? s.top + a.height / 2 : s.bottom - a.height / 2 +
R : C + m,
_ = -1,
E = -.5;
break;
case "leftTop":
b = I ? s.right + k - f + S : o.left - f,
x = A ? s.top : h ? C - $ + m : o.top + m,
_ = -1;
break;
case "leftBottom":
b = I ? s.right + k - f + S : o.left - f,
x = A ? s.bottom + R : h ? C + $ + m : o.bottom + m,
_ = -1,
E = -1;
break;
case "bottom":
b = I ? O ? s.left + a.width / 2 : s.right - a.width / 2 + k :
T + m,
x = A ? s.top + $ - f : o.top + o.height + f,
_ = -.5;
break;
case "bottomLeft":
b = I ? M ? s.left : s.right - a.width : h ? T - S + m : o.left
+ m,
x = A ? s.top + $ - f : o.top + o.height + f;
break;
case "bottomRight":
b = I ? s.right + k : h ? T + S + m : o.right + m,
x = A ? s.top + $ - f : o.top + o.height + f,
_ = -1;
break;
case "right":
b = I ? s.left - f + S : o.right + f,
x = A ? D ? s.top + a.height / 2 : s.bottom - a.height / 2 +
R : C + m,
E = -.5;
break;
case "rightTop":
b = I ? s.left - f + S : o.right + f,
x = A ? s.top : h ? C - $ + m : o.top + m;
break;
case "rightBottom":
b = I ? s.left - f + S : o.right + f,
x = A ? s.bottom + R : h ? C + $ + m : o.bottom + m,
E = -1;
break;
case "leftTopOver":
b = o.left - f,
x = o.top - f;
break;
case "rightTopOver":
b = o.right + f,
x = o.top - f,
_ = -1;
break;
case "leftBottomOver":
b = o.left - f,
x = o.bottom + f,
E = -1;
break;
case "rightBottomOver":
b = o.right + f,
x = o.bottom + f,
_ = -1,
E = -1
}
const j = this.calcTransformOrigin(l, o, _, E)
, F = this._adapter.containerIsBody();
if (b -= s.left,
x -= s.top,
L && (b /= a.width / this._adapter.getContainer().clientWidth),
L && (x /= a.height / this._adapter.getContainer().clientHeight),
F && !this._adapter.containerIsRelativeOrAbsolute()) {
const e = this._adapter.getDocumentElementBounding();
b += s.left - e.left,
x += s.top - e.top
}
b = F ? b : b + s.scrollLeft,
x = F ? x : x + s.scrollTop;
const N = o.height;
if (this.getProp("showArrow") && !u && N <= 2 * (y / 2 + v)) {
const e = N / 2 - (v + y / 2);
!l.includes("Top") && !l.includes("Bottom") ||
l.includes("Over") || (x = l.includes("Top") ? x + e : x - e)
}
const B = {
left: this._roundPixel(b),
top: this._roundPixel(x)
};
let z = "";
return null != _ && (z += `translateX(${100 * _}%) `,
Object.defineProperty(B, "translateX", {
enumerable: !1,
value: _
})),
null != E && (z += `translateY(${100 * E}%) `,
Object.defineProperty(B, "translateY", {
enumerable: !1,
value: E
})),
null != j && (B.transformOrigin = j),
z && (B.transform = z),
B
}
isLR() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : "";
return e.includes("left") || e.includes("right")
}
isTB() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : "";
return e.includes("top") || e.includes("bottom")
}
isReverse(e, t, r) {
return e < r && t > r
}
isOverFlow(e, t, r) {
return e < r && t < r
}
isHalfOverFlow(e, t, r) {
return e < r || t < r
}
isHalfAllEnough(e, t, r) {
return e >= r || t >= r
}
getReverse(e, t, r, n) {
return e && n || r
}
adjustPosIfNeed(e, t, r, n, i) {
const {innerWidth: o, innerHeight: s} = window
, {margin: a} = this.getProps()
, l = "number" == typeof a ? a : a.marginLeft
, c = "number" == typeof a ? a : a.marginTop
, u = "number" == typeof a ? a : a.marginRight
, d = "number" == typeof a ? a : a.marginBottom;
let p = !1
, h = !1;
const f = this.getProp("spacing");
let m = f
, g = 0;
if ("number" != typeof f) {
const t = e.includes("top") || e.includes("bottom");
m = t ? f.y : f.x,
g = t ? f.x : f.y
}
if (n.width > 0 && n.height > 0) {
const t = r.left
, a = r.right
, f = r.top
, y = r.bottom
, v = o - t
, b = s - f
, x = o - a
, _ = s - y
, E = n.width > r.width
, T = n.height > r.height
, C = f - c < n.height + m && _ - d > n.height + m
, S = t - l < n.width + m && x - u > n.width + m
, $ = _ - d < n.height + m && f - c > n.height + m
, w = x - u < n.width + m && t - l > n.width + m;
b - d < n.height + m && n.height,
y - c < n.height + m && n.height;
const P = b < n.height + g && y > n.height + g
, R = y < n.height + g && b > n.height + g
, k = v < n.width + g && a > n.width + g
, A = a < n.width + g && v > n.width + g
, I = b < n.height + m && y > n.height + m
, O = y < n.height + m && b > n.height + m
, D = v < n.width && a > n.width
, M = a < n.width && v > n.width
, L = f - i.top
, j = t - i.left
, F = L + r.height
, N = j + r.width
, B = i.bottom - y
, z = i.right - a
, U = B + r.height
, V = z + r.width
, H = this.isReverse(L - c, B - d, n.height + m)
, G = this.isReverse(j - l, z - u, n.width + m)
, W = this.isReverse(B - d, L - c, n.height + m)
, Y = this.isReverse(z - u, j - l, n.width + m);
this.isReverse(U - d, F - c, n.height + m),
this.isReverse(F - c, U - d, n.height + m);
const K = this.isReverse(U, F, n.height + g)
, X = this.isReverse(F, U, n.height + g)
, q = this.isReverse(V, N, n.width + g)
, Z = this.isReverse(N, V, n.width + g)
, Q = r.height / 2
, J = r.width / 2
, ee = this.isOverFlow(f - c, _ - d, n.height + m)
, te = this.isOverFlow(t - l, x - u, n.width + m)
, re = this.isOverFlow(y - c, b - d, n.height + m)
, ne = this.isOverFlow(a - l, v - u, n.width + m)
, ie = this.isHalfOverFlow(y - Q, b - Q, (n.height + g) / 2)
, oe = this.isHalfOverFlow(a - J, v - J, (n.width + g) / 2)
, se = this.isHalfAllEnough(y - Q, b - Q, (n.height + g) / 2)
, ae = this.isHalfAllEnough(a - J, v - J, (n.width + g) / 2)
, le = this.isOverFlow(L - c, B - d, n.height + m)
, ce = this.isOverFlow(j - l, z - u, n.width + m)
, ue = this.isOverFlow(F - c, U - d, n.height + m)
, de = this.isOverFlow(N - l, V - u, n.width + m)
, pe = this.isHalfOverFlow(F - Q, U - Q, (n.height + g) / 2)
, he = this.isHalfOverFlow(N - J, V - J, (n.width + g) / 2)
, fe = this.isHalfAllEnough(F - Q, U - Q, (n.height + g) / 2)
, me = this.isHalfAllEnough(N - J, V - J, (n.width + g) / 2)
, ge = this.getReverse(ee, le, C, H)
, ye = this.getReverse(te, ce, S, G)
, ve = this.getReverse(ee, le, $, W)
, be = this.getReverse(te, ce, w, Y)
, xe = this.getReverse(re, ue, P, K)
, _e = this.getReverse(re, ue, R, X)
, Ee = this.getReverse(ne, de, k, q)
, Te = this.getReverse(ne, de, A, Z)
, Ce = ie && pe
, Se = oe && he;
switch (e) {
case "top":
ge && (e = this._adjustPos(e, !0)),
Se && (Ee || Te) && (e = this._adjustPos(e, !0, "expand",
Ee ? "Right" : "Left"));
break;
case "topLeft":
ge && (e = this._adjustPos(e, !0)),
Ee && E && (e = this._adjustPos(e)),
h && (ae || me) && (e = this._adjustPos(e, !0, "reduce"));
break;
case "topRight":
ge && (e = this._adjustPos(e, !0)),
Te && E && (e = this._adjustPos(e)),
h && (ae || me) && (e = this._adjustPos(e, !0, "reduce"));
break;
case "left":
ye && (e = this._adjustPos(e)),
Ce && (xe || _e) && (e = this._adjustPos(e, !1, "expand",
xe ? "Bottom" : "Top"));
break;
case "leftTop":
ye && (e = this._adjustPos(e)),
xe && T && (e = this._adjustPos(e, !0)),
p && (se || fe) && (e = this._adjustPos(e, !1, "reduce"));
break;
case "leftBottom":
ye && (e = this._adjustPos(e)),
_e && T && (e = this._adjustPos(e, !0)),
p && (se || fe) && (e = this._adjustPos(e, !1, "reduce"));
break;
case "bottom":
ve && (e = this._adjustPos(e, !0)),
Se && (Ee || Te) && (e = this._adjustPos(e, !0, "expand",
Ee ? "Right" : "Left"));
break;
case "bottomLeft":
ve && (e = this._adjustPos(e, !0)),
Ee && E && (e = this._adjustPos(e)),
h && (ae || me) && (e = this._adjustPos(e, !0, "reduce"));
break;
case "bottomRight":
ve && (e = this._adjustPos(e, !0)),
Te && E && (e = this._adjustPos(e)),
h && (ae || me) && (e = this._adjustPos(e, !0, "reduce"));
break;
case "right":
be && (e = this._adjustPos(e)),
Ce && (xe || _e) && (e = this._adjustPos(e, !1, "expand",
xe ? "Bottom" : "Top"));
break;
case "rightTop":
be && (e = this._adjustPos(e)),
xe && T && (e = this._adjustPos(e, !0)),
p && (se || fe) && (e = this._adjustPos(e, !1, "reduce"));
break;
case "rightBottom":
be && (e = this._adjustPos(e)),
_e && T && (e = this._adjustPos(e, !0)),
p && (se || fe) && (e = this._adjustPos(e, !1, "reduce"));
break;
case "leftTopOver":
I && (e = this._adjustPos(e, !0)),
D && (e = this._adjustPos(e));
break;
case "leftBottomOver":
O && (e = this._adjustPos(e, !0)),
D && (e = this._adjustPos(e));
break;
case "rightTopOver":
I && (e = this._adjustPos(e, !0)),
M && (e = this._adjustPos(e));
break;
case "rightBottomOver":
O && (e = this._adjustPos(e, !0)),
M && (e = this._adjustPos(e))
}
this.isTB(e) && (p = ee && le,
h = "top" === e || "bottom" === e ? oe && he || a < 0 || x <
0 : ne && de || a < 0 || x < 0),
this.isLR(e) && (h = te && ce,
p = "left" === e || "right" === e ? ie && pe || f < 0 || b <
0 : re && ue || f < 0 || b < 0)
}
return {
position: e,
isHeightOverFlow: p,
isWidthOverFlow: h
}
}
_bindScrollEvent() {
this._adapter.registerScrollHandler(( () => this.calcPosition()))
}
unBindScrollEvent() {
this._adapter.unregisterScrollHandler()
}
_initContainerPosition() {
this._adapter.updateContainerPosition()
}
_handleTriggerKeydown(e) {
const {closeOnEsc: t, disableArrowKeyDown: r} = this.getProps()
, n = this._adapter.getContainer()
, i = this._adapter.getFocusableElements(n)
, o = i.length;
switch (e && e.key) {
case "Escape":
handlePrevent(e),
t && this._handleEscKeyDown(e);
break;
case "ArrowUp":
!r && o && this._handleTriggerArrowUpKeydown(i, e);
break;
case "ArrowDown":
!r && o && this._handleTriggerArrowDownKeydown(i, e)
}
}
focusTrigger() {
const {trigger: e, returnFocusOnClose: t, preventScroll: r} =
this.getProps();
if (t && "custom" !== e) {
const e = this._adapter.getTriggerNode();
e && "focus"in e && e.focus({
preventScroll: r
})
}
}
_handleEscKeyDown(e) {
const {trigger: t} = this.getProps();
"custom" !== t && (this.focusTrigger(),
this.hide()),
this._adapter.notifyEscKeydown(e)
}
_handleContainerTabKeyDown(e, t) {
const {preventScroll: r} = this.getProps()
, n = this._adapter.getActiveElement();
e[e.length - 1] === n && (e[0].focus({
preventScroll: r
}),
t.preventDefault())
}
_handleContainerShiftTabKeyDown(e, t) {
const {preventScroll: r} = this.getProps()
, n = this._adapter.getActiveElement();
e[0] === n && (e[e.length - 1].focus({
preventScroll: r
}),
t.preventDefault())
}
_handleTriggerArrowDownKeydown(e, t) {
const {preventScroll: r} = this.getProps();
e[0].focus({
preventScroll: r
}),
t.preventDefault()
}
_handleTriggerArrowUpKeydown(e, t) {
const {preventScroll: r} = this.getProps();
e[e.length - 1].focus({
preventScroll: r
}),
t.preventDefault()
}
}
;
const cssClasses$x = {
PREFIX: `${BASE_CLASS_PREFIX$1}-tooltip`
}
, strings$t = {
POSITION_SET: ["top", "topLeft", "topRight", "left", "leftTop",
"leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft",
"bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"],
TRIGGER_SET: ["hover", "focus", "click", "custom", "contextMenu"],
STATUS_DISABLED: "disabled",
STATUS_LOADING: "loading"
}
, numbers$b = {
ARROW_BOUNDING: {
offsetX: 0,
offsetY: 2,
width: 24,
height: 7
},
DEFAULT_Z_INDEX: 1060,
MOUSE_ENTER_DELAY: 50,
MOUSE_LEAVE_DELAY: 50,
SPACING: 8,
MARGIN: 0
};
function getUuid(e) {
return `${e}-${(new Date).getTime()}-${Math.random()}`
}
function getUuidv4() {
var e, t;
try {
return null !== (t = null === (e = null === crypto || void 0 ===
crypto ? void 0 : crypto.randomUUID) || void 0 === e ? void 0 : e.call(crypto)) &&
void 0 !== t ? t : String(-99990013e3).replace(/[018]/g, (e => (Number(e) ^
crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> Number(e) / 4).toString(16)))
} catch (r) {
return getUuid("semi")
}
}
function getUuidShort() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {};
const {prefix: t="", length: r=7} = e
, n = "0123456789abcdefghijklmnopqrstuvwxyz";
let i = "";
for (let o = 0; o < r; o++) {
const e = Math.floor(36 * Math.random());
i += n.charAt(e)
}
return t ? `${t}-${i}` : i
}
const tooltip = "";
function isElement(e) {
return React.isValidElement(e)
}
function isEmptyChildren(e) {
return 0 === React.Children.count(e)
}
var assignValue$2 = _assignValue
, castPath$2 = _castPath
, isIndex$1 = _isIndex
, isObject$3 = isObject_1
, toKey$2 = _toKey;
function baseSet$2(e, t, r, n) {
if (!isObject$3(e))
return e;
for (var i = -1, o = (t = castPath$2(t, e)).length, s = o - 1, a = e;
null != a && ++i < o; ) {
var l = toKey$2(t[i])
, c = r;
if ("__proto__" === l || "constructor" === l || "prototype" === l)
return e;
if (i != s) {
var u = a[l];
void 0 === (c = n ? n(u, l, a) : void 0) && (c =
isObject$3(u) ? u : isIndex$1(t[i + 1]) ? [] : {})
}
assignValue$2(a, l, c),
a = a[l]
}
return e
}
var _baseSet = baseSet$2
, baseSet$1 = _baseSet;
function set$2(e, t, r) {
return null == e ? e : baseSet$1(e, t, r)
}
var set_1 = set$2;
const _set = getDefaultExportFromCjs(set_1);
var baseClone = _baseClone
, CLONE_DEEP_FLAG = 1
, CLONE_SYMBOLS_FLAG = 4;
function cloneDeepWith(e, t) {
return baseClone(e, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, t =
"function" == typeof t ? t : void 0)
}
var cloneDeepWith_1 = cloneDeepWith;
const _cloneDeepWith = getDefaultExportFromCjs(cloneDeepWith_1)
, escapeRegExpFn = e => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
"\\$&")
, findChunks = e => {
let {autoEscape: t, caseSensitive: r, searchWords: n, sourceString: i}
= e;
return n.filter((e => e)).reduce(( (e, n) => {
t && (n = escapeRegExpFn(n));
const o = new RegExp(n,r ? "g" : "gi");
let s;
for (; s = o.exec(i); ) {
const t = s.index
, r = o.lastIndex;
r > t && e.push({
highlight: !1,
start: t,
end: r
}),
s.index === o.lastIndex && o.lastIndex++
}
return e
}
), [])
}
, combineChunks = e => {
let {chunks: t} = e;
return t = t.sort(( (e, t) => e.start - t.start)).reduce(( (e, t) => {
if (0 === e.length)
return [t];
{
const r = e.pop();
if (t.start <= r.end) {
const n = Math.max(r.end, t.end);
e.push({
highlight: !1,
start: r.start,
end: n
})
} else
e.push(r, t);
return e
}
}
), []),
t
}
, fillInChunks = e => {
let {chunksToHighlight: t, totalLength: r} = e;
const n = []
, i = (e, t, r) => {
t - e > 0 && n.push({
start: e,
end: t,
highlight: r
})
}
;
if (0 === t.length)
i(0, r, !1);
else {
let e = 0;
t.forEach((t => {
i(e, t.start, !1),
i(t.start, t.end, !0),
e = t.end
}
)),
i(e, r, !1)
}
return n
}
, findAll = e => {
let {autoEscape: t=!0, caseSensitive: r=!1, searchWords: n,
sourceString: i} = e;
_isString(n) && (n = [n]);
const o = findChunks({
autoEscape: t,
caseSensitive: r,
searchWords: n,
sourceString: i
})
, s = combineChunks({
chunks: o
});
return fillInChunks({
chunksToHighlight: s,
totalLength: i ? i.length : 0
})
}
;
class SemiGlobal {
constructor() {
this.config = {}
}
}
const semiGlobal = new SemiGlobal;
var __awaiter$3 = globalThis && globalThis.__awaiter || function(e, t, r,
n) {
return new (r || (r = Promise))((function(i, o) {
function s(e) {
try {
l(n.next(e))
} catch (e2) {
o(e2)
}
}
function a(e) {
try {
l(n.throw(e))
} catch (e2) {
o(e2)
}
}
function l(e) {
var t;
e.done ? i(e.value) : (t = e.value,
t instanceof r ? t : new r((function(e) {
e(t)
}
))).then(s, a)
}
l((n = n.apply(e, t || [])).next())
}
))
}
;
function stopPropagation$1(e, t) {
e && "function" == typeof e.stopPropagation && e.stopPropagation(),
!t && e.nativeEvent && "function" == typeof
e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation()
}
function cloneDeep$1(e, t) {
return _cloneDeepWith(e, (e => {
if ("function" == typeof t)
return t(e);
if ("function" == typeof e || React.isValidElement(e))
return e;
if ("[object Error]" === Object.prototype.toString.call(e))
return e;
if (Array.isArray(e) && 0 === e.length) {
const t = Object.keys(e);
if (t.length) {
const r = [];
t.forEach((t => {
_set(r, t, e[t])
}
));
try {
warning$1("production" !== _get(process,
"env.NODE_ENV"), "[Semi] You may use an out-of-bounds array. In some cases, your
program may not behave as expected.\n The maximum length of an
array is 4294967295.\n Please check whether the array subscript
in your data exceeds the maximum value of the JS array subscript")
} catch (e2) {}
return r
}
} else
;
}
))
}
const getHighLightTextHTML = e => {
let {sourceString: t="", searchWords: r=[], option: n={
autoEscape: !0,
caseSensitive: !1
}} = e;
const i = findAll(Object.assign({
sourceString: t,
searchWords: r
}, n))
, o = n.highlightTag || "mark"
, s = n.highlightClassName || ""
, a = n.highlightStyle || {};
return i.map(( (e, r) => {
const {end: n, start: i, highlight: l} = e
, c = t.substr(i, n - i);
return l ? React.createElement(o, {
style: a,
className: s,
key: c + r
}, c) : c
}
))
}
, registerMediaQuery = (e, t) => {
let {match: r, unmatch: n, callInInit: i=!0} = t;
if ("undefined" != typeof window) {
let t = function(e) {
e.matches ? r && r(e) : n && n(e)
};
const o = window.matchMedia(e);
return i && t(o),
Object.prototype.hasOwnProperty.call(o, "addEventListener") ?
(o.addEventListener("change", t),
() => o.removeEventListener("change", t)) : (o.addListener(t),
() => o.removeListener(t))
}
return () => {}
}
, isSemiIcon = e => React.isValidElement(e) && "Icon" === _get(e.type,
"elementType");
function getActiveElement() {
return document ? document.activeElement : null
}
function getFocusableElements(e) {
if (!isElement$1(e))
return [];
const t = ["input:not([disabled]):not([tabindex='-1'])",
"textarea:not([disabled]):not([tabindex='-1'])",
"button:not([disabled]):not([tabindex='-1'])", "a[href]:not([tabindex='-1'])",
"select:not([disabled]):not([tabindex='-1'])", "area[href]:not([tabindex='-1'])",
"iframe:not([tabindex='-1'])", "object:not([tabindex='-1'])",
"*[tabindex]:not([tabindex='-1'])", "*[contenteditable]:not([tabindex='-
1'])"].join(",");
return Array.from(e.querySelectorAll(t))
}
function runAfterTicks(e, t) {
return __awaiter$3(this, void 0, void 0, (function*() {
return 0 === t ? void (yield e()) : void (yield new Promise((r => {
setTimeout(( () => __awaiter$3(this, void 0, void 0,
(function*() {
yield runAfterTicks(e, t - 1),
r()
}
))), 0)
}
)))
}
))
}
function getScrollbarWidth() {
return globalThis && "[object Window]" ===
Object.prototype.toString.call(globalThis) ? window.innerWidth -
document.documentElement.clientWidth : 0
}
function getDefaultPropsFromGlobalConfig(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : {};
const r = () => {
var t, r;
return (null === (r = null === (t = null == semiGlobal ? void 0 :
semiGlobal.config) || void 0 === t ? void 0 : t.overrideDefaultProps) || void 0 ===
r ? void 0 : r[e]) || {}
}
;
return new Proxy(Object.assign({}, t),{
get(e, t, n) {
const i = r();
return t in i ? i[t] : Reflect.get(e, t, n)
},
set: (e, t, r, n) => Reflect.set(e, t, r, n),
ownKeys() {
const e = r();
return Array.from(new
Set([...Reflect.ownKeys(t), ...Object.keys(e)]))
},
getOwnPropertyDescriptor(e, t) {
const n = r();
return t in n ? Reflect.getOwnPropertyDescriptor(n, t) :
Reflect.getOwnPropertyDescriptor(e, t)
}
})
}
const ConfigContext = React.createContext({})
, ConfigContext$1 = ConfigContext
, portal = ""
, defaultGetContainer$1 = () => document.body;
class Portal extends reactExports.PureComponent {
constructor(e, t) {
var r;
super(e),
r = this,
this.initContainer = function(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] &&
arguments[1];
var n, i;
try {
let t;
if (!r.el || !(null === (n = r.state) || void 0 === n ?
void 0 : n.container) || !Array.from(r.state.container.childNodes).includes(r.el))
{
r.el = document.createElement("div");
const n = (r.props.getPopupContainer ||
e.getPopupContainer || defaultGetContainer$1)();
return n.appendChild(r.el),
r.addStyle(r.props.style),
r.addClass(r.props.prefixCls, e, r.props.className),
t = n,
t
}
} catch (e2) {
if (!t)
throw e2
}
return null === (i = r.state) || void 0 === i ? void 0 :
i.container
}
,
this.addStyle = function() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {};
if (r.el)
for (const t of Object.keys(e))
r.el.style[t] = e[t]
}
,
this.addClass = function(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : r.context;
const {direction: n} = t;
for (var i = arguments.length, o = new Array(i > 2 ? i - 2 :
0), s = 2; s < i; s++)
o[s - 2] = arguments[s];
const a = classNames(e, ...o, {
[`${e}-rtl`]: "rtl" === n
});
r.el && (r.el.className = a)
}
,
this.state = {
container: this.initContainer(t, !0)
}
}
componentDidMount() {
const e = this.initContainer(this.context);
e !== this.state.container && this.setState({
container: e
})
}
componentDidUpdate(e) {
const {didUpdate: t} = this.props;
t && t(e)
}
componentWillUnmount() {
const {container: e} = this.state;
e && e.removeChild(this.el)
}
render() {
const {state: e, props: t} = this;
return e.container ? reactDomExports.createPortal(t.children,
this.el) : null
}
}
Portal.contextType = ConfigContext$1,
Portal.defaultProps = {
prefixCls: `${BASE_CLASS_PREFIX$1}-portal`
},
Portal.propTypes = {
children: PropTypes.node,
prefixCls: PropTypes.string,
getPopupContainer: PropTypes.func,
className: PropTypes.string,
didUpdate: PropTypes.func
};
const Portal$1 = Portal;
var __rest$Z = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const TriangleArrow = e => {
const {className: t, style: r} = e
, n = __rest$Z(e, ["className", "style"]);
return React.createElement("svg", Object.assign({
"aria-hidden": !0,
className: t,
style: r
}, n, {
width: "24",
height: "7",
viewBox: "0 0 24 7",
fill: "currentColor",
xmlns: "http://www.w3.org/2000/svg"
}), React.createElement("path", {
d: "M24 0V1C20 1 18.5 2 16.5 4C14.5 6 14 7 12 7C10 7 9.5 6 7.5
4C5.5 2 4 1 0 1V0H24Z"
}))
}
, TriangleArrow$1 = TriangleArrow;
var __rest$Y = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const TriangleArrowVertical = e => {
const {className: t, style: r} = e
, n = __rest$Y(e, ["className", "style"]);
return React.createElement("svg", Object.assign({
"aria-hidden": !0,
className: t,
style: r
}, n, {
width: "7",
height: "24",
xmlns: "http://www.w3.org/2000/svg",
fill: "currentColor"
}), React.createElement("path", {
d: "M0 0L1 0C1 4, 2 5.5, 4 7.5S7,10 7,12S6 14.5, 4 16.5S1,20 1,24L0
24L0 0z"
}))
}
, TriangleArrowVertical$1 = TriangleArrowVertical
, ArrowBoundingShape = PropTypes.shape({
offsetX: PropTypes.number,
offsetY: PropTypes.number,
width: PropTypes.number,
height: PropTypes.number
});
class CSSAnimation extends React.Component {
constructor(e) {
super(e),
this.handleAnimationStart = () => {
var e, t;
null === (t = (e = this.props).onAnimationStart) || void 0 ===
t || t.call(e)
}
,
this.handleAnimationEnd = () => {
this.setState({
currentClassName: this.props.endClassName,
extraStyle: {
animationFillMode: this.props.fillMode
},
isAnimating: !1
}, ( () => {
var e, t;
null === (t = (e = this.props).onAnimationEnd) || void 0
=== t || t.call(e, !1)
}
))
}
,
this.state = {
currentClassName: this.props.startClassName,
extraStyle: {
animationFillMode: this.props.fillMode
},
isAnimating: !0
}
}
componentDidMount() {
var e, t, r, n;
null === (t = (e = this.props).onAnimationStart) || void 0 === t ||
t.call(e),
this.props.motion || (null === (n = (r =
this.props).onAnimationEnd) || void 0 === n || n.call(r, !1),
this.setState({
isAnimating: !1
}))
}
componentDidUpdate(e, t, r) {
const n = Object.keys(this.props).filter((t => !
_isEqual(this.props[t], e[t])));
n.includes("animationState"),
(n.includes("startClassName") || n.includes("replayKey") ||
n.includes("motion")) && this.setState({
currentClassName: this.props.startClassName,
extraStyle: {
animationFillMode: this.props.fillMode
},
isAnimating: !0
}, ( () => {
var e, t, r, n;
null === (t = (e = this.props).onAnimationStart) || void 0 ===
t || t.call(e),
this.props.motion || (null === (n = (r =
this.props).onAnimationEnd) || void 0 === n || n.call(r, this.state.isAnimating),
this.setState({
isAnimating: !1
}))
}
))
}
render() {
var e;
return this.props.motion ? this.props.children({
animationClassName: null !== (e = this.state.currentClassName)
&& void 0 !== e ? e : "",
animationStyle: this.state.extraStyle,
animationEventsNeedBind: {
onAnimationStart: this.handleAnimationStart,
onAnimationEnd: this.handleAnimationEnd
},
isAnimating: this.state.isAnimating
}) : this.props.children({
animationClassName: "",
animationStyle: {},
animationEventsNeedBind: {},
isAnimating: this.state.isAnimating
})
}
}
CSSAnimation.defaultProps = {
motion: !0,
replayKey: ""
};
const CSSAnimation$1 = CSSAnimation;
var __rest$X = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefix$6 = cssClasses$x.PREFIX
, positionSet$3 = strings$t.POSITION_SET
, triggerSet$2 = strings$t.TRIGGER_SET
, blockDisplays = ["flex", "block", "table", "flow-root", "grid"]
, defaultGetContainer = () => document.body;
class Tooltip extends BaseComponent {
constructor(e) {
super(e),
this.setContainerEl = e => this.containerEl = {
current: e
},
this.isSpecial = e => {
if (isElement$1(e))
return Boolean(e.disabled);
if (reactExports.isValidElement(e)) {
if (_get(e, "props.disabled"))
return strings$t.STATUS_DISABLED;
const t = _get(e, "props.loading")
, r = !(_isEmpty(e) || _isEmpty(e.type) || "Button" !==
_get(e, "type.elementType") && "IconButton" !== _get(e, "type.elementType"));
if (t && r)
return strings$t.STATUS_LOADING
}
return !1
}
,
this.didLeave = () => {
this.props.keepDOM ? this.foundation.setDisplayNone(!0) :
this.foundation.removePortal(),
this.foundation.unBindEvent()
}
,
this.renderIcon = () => {
const {placement: e} = this.state
, {showArrow: t, prefixCls: r, style: n} = this.props;
let i = null;
const o = classNames([`${r}-icon-arrow`])
, s = _get(n, "backgroundColor")
, a = (null == e ? void 0 : e.includes("left")) || (null == e
? void 0 : e.includes("right")) ? React.createElement(TriangleArrowVertical$1,
null) : React.createElement(TriangleArrow$1, null);
return t && (i = reactExports.isValidElement(t) ? t :
React.cloneElement(a, {
className: o,
style: {
color: s,
fill: "currentColor"
}
})),
i
}
,
this.handlePortalInnerClick = e => {
this.props.clickToHide && this.foundation.hide(),
this.props.stopPropagation && stopPropagation$1(e)
}
,
this.handlePortalMouseDown = e => {
this.props.stopPropagation && stopPropagation$1(e)
}
,
this.handlePortalFocus = e => {
this.props.stopPropagation && stopPropagation$1(e)
}
,
this.handlePortalBlur = e => {
this.props.stopPropagation && stopPropagation$1(e)
}
,
this.handlePortalInnerKeyDown = e => {
this.foundation.handleContainerKeydown(e)
}
,
this.renderContentNode = e => {
const t = {
initialFocusRef: this.initialFocusRef
};
return _isFunction(e) ? e(t) : e
}
,
this.renderPortal = () => {
const {containerStyle: e={}, visible: t, portalEventSet: r,
placement: n, displayNone: i, transitionState: o, id: s, isPositionUpdated: a} =
this.state
, {prefixCls: l, content: c, showArrow: u, style: d, motion:
p, role: h, zIndex: f} = this.props
, m = this.renderContentNode(c)
, {className: g} = this.props
, y = this.context.direction
, v = classNames(g, {
[`${l}-wrapper`]: !0,
[`${l}-wrapper-show`]: t,
[`${l}-with-arrow`]: Boolean(u),
[`${l}-rtl`]: "rtl" === y
})
, b = this.renderIcon()
, x = _omit(e, p ? ["transformOrigin"] : void 0)
, _ = _get(e, "transformOrigin")
, E = _get(d, "opacity", null)
, T = E || 1
, C = React.createElement(CSSAnimation$1, {
fillMode: "forwards",
animationState: o,
motion: p && a,
startClassName: "enter" === o ? `${prefix$6}-animation-
show` : `${prefix$6}-animation-hide`,
onAnimationEnd: () => {
var e, t;
"leave" === o && (this.didLeave(),
null === (t = (e = this.props).afterClose) || void 0
=== t || t.call(e))
}
}, (e => {
let {animationStyle: t, animationClassName: o,
animationEventsNeedBind: l} = e;
return React.createElement("div", Object.assign({
className: classNames(v, o),
style:
Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, t), i ? {
display: "none"
} : {}), {
transformOrigin: _
}), d), E ? {
opacity: a ? T : "0"
} : {})
}, r, l, {
role: h,
"x-placement": n,
id: s
}), React.createElement("div", {
className: `${prefix$6}-content`
}, m), b)
}
));
return React.createElement(Portal$1, {
getPopupContainer: this.props.getPopupContainer,
style: {
zIndex: f
}
}, React.createElement("div", {
tabIndex: -1,
className: `${BASE_CLASS_PREFIX$1}-portal-inner`,
style: x,
ref: this.setContainerEl,
onClick: this.handlePortalInnerClick,
onFocus: this.handlePortalFocus,
onBlur: this.handlePortalBlur,
onMouseDown: this.handlePortalMouseDown,
onKeyDown: this.handlePortalInnerKeyDown
}, C))
}
,
this.wrapSpan = e => {
const {wrapperClassName: t} = this.props
, r = _get(e, "props.style.display")
, n = _get(e, "props.block")
, i = {};
return "string" == typeof e || (i.display = "inline-block"),
(n || blockDisplays.includes(r)) && (i.width = "100%"),
React.createElement("span", {
className: t,
style: i
}, e)
}
,
this.mergeEvents = (e, t) => {
const r = {};
return _each(t, ( (t, n) => {
"function" == typeof t && (r[n] = function() {
t(...arguments),
e && "function" == typeof e[n] && e[n](...arguments)
}
)
}
)),
r
}
,
this.getPopupId = () => this.state.id,
this.state = {
visible: !1,
transitionState: "",
triggerEventSet: {},
portalEventSet: {},
containerStyle: {},
isInsert: !1,
placement: e.position || "top",
transitionStyle: {},
isPositionUpdated: !1,
id: e.wrapperId,
displayNone: !1
},
this.foundation = new Tooltip$1(this.adapter),
this.eventManager = new Event$2,
this.triggerEl = React.createRef(),
this.containerEl = React.createRef(),
this.initialFocusRef = React.createRef(),
this.clickOutsideHandler = null,
this.resizeHandler = null,
this.isWrapped = !1,
this.containerPosition = void 0
}
get adapter() {
var e = this;
return Object.assign(Object.assign({}, super.adapter), {
on: function() {
return e.eventManager.on(...arguments)
},
off: function() {
return e.eventManager.off(...arguments)
},
insertPortal: (e, t) => {
var r = __rest$X(t, ["position"]);
this.setState({
isInsert: !0,
transitionState: "enter",
containerStyle: Object.assign(Object.assign({},
this.state.containerStyle), r)
}, ( () => {
setTimeout(( () => {
this.eventManager.emit("portalInserted")
}
), 0)
}
))
}
,
removePortal: () => {
this.setState({
isInsert: !1,
isPositionUpdated: !1
})
}
,
getEventName: () => ({
mouseEnter: "onMouseEnter",
mouseLeave: "onMouseLeave",
mouseOut: "onMouseOut",
mouseOver: "onMouseOver",
click: "onClick",
focus: "onFocus",
blur: "onBlur",
keydown: "onKeyDown",
contextMenu: "onContextMenu"
}),
registerTriggerEvent: e => {
this.setState({
triggerEventSet: e
})
}
,
registerPortalEvent: e => {
this.setState({
portalEventSet: e
})
}
,
getTriggerBounding: () => {
const e = this.adapter.getTriggerNode();
return this.triggerEl.current = e,
e && e.getBoundingClientRect()
}
,
getPopupContainerRect: () => {
const e = this.getPopupContainer();
let t = null;
if (e && isElement$1(e)) {
const r =
convertDOMRectToObject(e.getBoundingClientRect());
t = Object.assign(Object.assign({}, r), {
scrollLeft: e.scrollLeft,
scrollTop: e.scrollTop
})
}
return t
}
,
containerIsBody: () => this.getPopupContainer() ===
document.body,
containerIsRelative: () => {
const e = this.getPopupContainer();
return "relative" ===
window.getComputedStyle(e).getPropertyValue("position")
}
,
containerIsRelativeOrAbsolute: () => ["relative",
"absolute"].includes(this.containerPosition),
getWrapperBounding: () => {
const e = this.containerEl && this.containerEl.current;
return e && e.getBoundingClientRect()
}
,
getDocumentElementBounding: () =>
document.documentElement.getBoundingClientRect(),
setPosition: e => {
var {position: t} = e
, r = __rest$X(e, ["position"]);
this.setState({
containerStyle: Object.assign(Object.assign({},
this.state.containerStyle), r),
placement: t,
isPositionUpdated: !0
}, ( () => {
this.eventManager.emit("positionUpdated")
}
))
}
,
setDisplayNone: (e, t) => {
this.setState({
displayNone: e
}, t)
}
,
updatePlacementAttr: e => {
this.setState({
placement: e
})
}
,
togglePortalVisible: (e, t) => {
const r = {};
r.transitionState = e ? "enter" : "leave",
r.visible = e,
this.mounted && this.setState(r, ( () => {
t()
}
))
}
,
registerClickOutsideHandler: e => {
this.clickOutsideHandler &&
this.adapter.unregisterClickOutsideHandler(),
this.clickOutsideHandler = t => {
if (!this.mounted)
return !1;
let r = this.triggerEl && this.triggerEl.current
, n = this.containerEl && this.containerEl.current;
r = ReactDOM.findDOMNode(r),
n = ReactDOM.findDOMNode(n);
const i = t.target
, o = t.composedPath && t.composedPath() || [i]
, s = !!this.props.clickTriggerToHide && (r &&
r.contains(i) || o.includes(r));
(r && !r.contains(i) && n && !n.contains(i) && !
o.includes(n) && !o.includes(r) || s) && (this.props.onClickOutSide(t),
e())
}
,
window.addEventListener("mousedown",
this.clickOutsideHandler)
}
,
unregisterClickOutsideHandler: () => {
this.clickOutsideHandler &&
(window.removeEventListener("mousedown", this.clickOutsideHandler),
this.clickOutsideHandler = null)
}
,
registerResizeHandler: e => {
this.resizeHandler &&
this.adapter.unregisterResizeHandler(),
this.resizeHandler = throttle$3((t => {
if (!this.mounted)
return !1;
e(t)
}
), 10),
window.addEventListener("resize", this.resizeHandler, !1)
}
,
unregisterResizeHandler: () => {
this.resizeHandler && (window.removeEventListener("resize",
this.resizeHandler, !1),
this.resizeHandler = null)
}
,
notifyVisibleChange: e => {
this.props.onVisibleChange(e)
}
,
registerScrollHandler: e => {
this.scrollHandler &&
this.adapter.unregisterScrollHandler(),
this.scrollHandler = throttle$3((t => {
if (!this.mounted)
return !1;
const r = this.adapter.getTriggerNode();
if (t.target.contains(r)) {
const r = {
x: t.target.scrollLeft,
y: t.target.scrollTop
};
e(r)
}
}
), 10),
window.addEventListener("scroll", this.scrollHandler, !0)
}
,
unregisterScrollHandler: () => {
this.scrollHandler && (window.removeEventListener("scroll",
this.scrollHandler, !0),
this.scrollHandler = null)
}
,
canMotion: () => Boolean(this.props.motion),
updateContainerPosition: () => {
const e = this.getPopupContainer();
if (e && isElement$1(e)) {
const t =
window.getComputedStyle(e).getPropertyValue("position");
this.containerPosition = t
}
}
,
getContainerPosition: () => this.containerPosition,
getContainer: () => this.containerEl &&
this.containerEl.current,
getTriggerNode: () => {
let e = this.triggerEl.current;
return isElement$1(this.triggerEl.current) || (e =
ReactDOM.findDOMNode(this.triggerEl.current)),
e
}
,
getFocusableElements: e => getFocusableElements(e),
getActiveElement: () => getActiveElement(),
setInitialFocus: () => {
const {preventScroll: e} = this.props
, t = _get(this, "initialFocusRef.current");
t && "focus"in t && t.focus({
preventScroll: e
})
}
,
notifyEscKeydown: e => {
this.props.onEscKeyDown(e)
}
,
setId: () => {
this.setState({
id: getUuidShort()
})
}
,
getTriggerDOM: () => this.triggerEl.current ?
ReactDOM.findDOMNode(this.triggerEl.current) : null
})
}
componentDidMount() {
this.mounted = !0,
this.getPopupContainer = this.props.getPopupContainer ||
this.context.getPopupContainer || defaultGetContainer,
this.foundation.init(),
runAfterTicks(( () => {
let e = this.triggerEl.current;
e && (e instanceof HTMLElement || (e =
reactDomExports.findDOMNode(e))),
this.foundation.updateStateIfCursorOnTrigger(e)
}
), 1)
}
componentWillUnmount() {
this.mounted = !1,
this.foundation.destroy()
}
focusTrigger() {
this.foundation.focusTrigger()
}
rePosition() {
return this.foundation.calcPosition()
}
componentDidUpdate(e, t) {
warning$1(this.props.mouseLeaveDelay < this.props.mouseEnterDelay,
"[Semi Tooltip] 'mouseLeaveDelay' cannot be less than 'mouseEnterDelay', which may
cause the dropdown layer to not be hidden."),
e.visible !== this.props.visible && (["hover",
"focus"].includes(this.props.trigger) ? this.props.visible ?
this.foundation.delayShow() : this.foundation.delayHide() : this.props.visible ?
this.foundation.show() : this.foundation.hide()),
_isEqual(e.rePosKey, this.props.rePosKey) || this.rePosition()
}
render() {
const {isInsert: e, triggerEventSet: t, visible: r, id: n} =
this.state
, {wrapWhenSpecial: i, role: o, trigger: s} = this.props;
let {children: a} = this.props;
const l = Object.assign({}, _get(a, "props.style"))
, c = {};
if (i) {
const e = this.isSpecial(a);
e ? (l.pointerEvents = "none",
e === strings$t.STATUS_DISABLED && (c.cursor = "not-allowed"),
a = reactExports.cloneElement(a, {
style: l
}),
"custom" !== s && (a = this.wrapSpan(a)),
this.isWrapped = !0) : reactExports.isValidElement(a) || (a =
this.wrapSpan(a),
this.isWrapped = !0)
}
let u = {};
"dialog" === o ? (u["aria-expanded"] = r ? "true" : "false",
u["aria-haspopup"] = "dialog",
u["aria-controls"] = n) : u["aria-describedby"] = n;
const d = React.cloneElement(a,
Object.assign(Object.assign(Object.assign(Object.assign({}, u), a.props),
this.mergeEvents(a.props, t)), {
style: Object.assign(Object.assign({}, _get(a, "props.style")),
c),
className: classNames(_get(a, "props.className")),
ref: e => {
this.triggerEl.current = e;
const {ref: t} = a;
"function" == typeof t ? t(e) : t && "object" == typeof t
&& (t.current = e)
}
,
tabIndex: a.props.tabIndex || 0,
"data-popupid": n
}));
return React.createElement(React.Fragment, null, e ?
this.renderPortal() : null, d)
}
}
Tooltip.contextType = ConfigContext$1,
Tooltip.propTypes = {
children: PropTypes.node,
motion: PropTypes.bool,
autoAdjustOverflow: PropTypes.bool,
position: PropTypes.oneOf(positionSet$3),
getPopupContainer: PropTypes.func,
mouseEnterDelay: PropTypes.number,
mouseLeaveDelay: PropTypes.number,
trigger: PropTypes.oneOf(triggerSet$2).isRequired,
className: PropTypes.string,
wrapperClassName: PropTypes.string,
clickToHide: PropTypes.bool,
clickTriggerToHide: PropTypes.bool,
visible: PropTypes.bool,
style: PropTypes.object,
content: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
prefixCls: PropTypes.string,
onVisibleChange: PropTypes.func,
onClickOutSide: PropTypes.func,
spacing: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
showArrow: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),
zIndex: PropTypes.number,
rePosKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
arrowBounding: ArrowBoundingShape,
transformFromCenter: PropTypes.bool,
arrowPointAtCenter: PropTypes.bool,
stopPropagation: PropTypes.bool,
role: PropTypes.string,
wrapWhenSpecial: PropTypes.bool,
guardFocus: PropTypes.bool,
returnFocusOnClose: PropTypes.bool,
preventScroll: PropTypes.bool,
keepDOM: PropTypes.bool
},
Tooltip.__SemiComponentName__ = "Tooltip",
Tooltip.defaultProps =
getDefaultPropsFromGlobalConfig(Tooltip.__SemiComponentName__, {
arrowBounding: numbers$b.ARROW_BOUNDING,
autoAdjustOverflow: !0,
arrowPointAtCenter: !0,
trigger: "hover",
transformFromCenter: !0,
position: "top",
prefixCls: prefix$6,
role: "tooltip",
mouseEnterDelay: numbers$b.MOUSE_ENTER_DELAY,
mouseLeaveDelay: numbers$b.MOUSE_LEAVE_DELAY,
motion: !0,
onVisibleChange: _noop,
onClickOutSide: _noop,
spacing: numbers$b.SPACING,
margin: numbers$b.MARGIN,
showArrow: !0,
wrapWhenSpecial: !0,
zIndex: numbers$b.DEFAULT_Z_INDEX,
closeOnEsc: !1,
guardFocus: !1,
returnFocusOnClose: !1,
onEscKeyDown: _noop,
disableFocusListener: !1,
disableArrowKeyDown: !1,
keepDOM: !1
});
var copyTextToClipboard$1 = {
exports: {}
};
const copyTextToClipboard = (e, {target: t=document.body}={}) => {
const r = document.createElement("textarea")
, n = document.activeElement;
r.value = e,
r.setAttribute("readonly", ""),
r.style.contain = "strict",
r.style.position = "absolute",
r.style.left = "-9999px",
r.style.fontSize = "12pt";
const i = document.getSelection();
let o = !1;
i.rangeCount > 0 && (o = i.getRangeAt(0)),
t.append(r),
r.select(),
r.selectionStart = 0,
r.selectionEnd = e.length;
let s = !1;
try {
s = document.execCommand("copy")
} catch (a) {}
return r.remove(),
o && (i.removeAllRanges(),
i.addRange(o)),
n && n.focus(),
s
}
;
copyTextToClipboard$1.exports = copyTextToClipboard,
copyTextToClipboard$1.exports.default = copyTextToClipboard;
var copyTextToClipboardExports = copyTextToClipboard$1.exports;
const copy = getDefaultExportFromCjs(copyTextToClipboardExports);
function noop$2() {}
const LocaleContext = React.createContext(null)
, LocaleContext$1 = LocaleContext;
function buildFormatLongFn$1(e) {
return function() {
var t = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {}
, r = t.width ? String(t.width) : e.defaultWidth;
return e.formats[r] || e.formats[e.defaultWidth]
}
}
function buildLocalizeFn$1(e) {
return function(t, r) {
var n;
if ("formatting" === (null != r && r.context ? String(r.context) :
"standalone") && e.formattingValues) {
var i = e.defaultFormattingWidth || e.defaultWidth
, o = null != r && r.width ? String(r.width) : i;
n = e.formattingValues[o] || e.formattingValues[i]
} else {
var s = e.defaultWidth
, a = null != r && r.width ? String(r.width) :
e.defaultWidth;
n = e.values[a] || e.values[s]
}
return n[e.argumentCallback ? e.argumentCallback(t) : t]
}
}
function buildMatchFn$1(e) {
return function(t) {
var r = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : {}
, n = r.width
, i = n && e.matchPatterns[n] ||
e.matchPatterns[e.defaultMatchWidth]
, o = t.match(i);
if (!o)
return null;
var s, a = o[0], l = n && e.parsePatterns[n] ||
e.parsePatterns[e.defaultParseWidth], c = Array.isArray(l) ? findIndex$2(l,
(function(e) {
return e.test(a)
}
)) : findKey(l, (function(e) {
return e.test(a)
}
));
return s = e.valueCallback ? e.valueCallback(c) : c,
{
value: s = r.valueCallback ? r.valueCallback(s) : s,
rest: t.slice(a.length)
}
}
}
function findKey(e, t) {
for (var r in e)
if (e.hasOwnProperty(r) && t(e[r]))
return r
}
function findIndex$2(e, t) {
for (var r = 0; r < e.length; r++)
if (t(e[r]))
return r
}
function buildMatchPatternFn$1(e) {
return function(t) {
var r = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : {}
, n = t.match(e.matchPattern);
if (!n)
return null;
var i = n[0]
, o = t.match(e.parsePattern);
if (!o)
return null;
var s = e.valueCallback ? e.valueCallback(o[0]) : o[0];
return {
value: s = r.valueCallback ? r.valueCallback(s) : s,
rest: t.slice(i.length)
}
}
}
function _typeof$2(e) {
return (_typeof$2 = "function" == typeof Symbol && "symbol" == typeof
Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol
&& e !== Symbol.prototype ? "symbol" : typeof e
}
)(e)
}
function toInteger$6(e) {
if (null === e || !0 === e || !1 === e)
return NaN;
var t = Number(e);
return isNaN(t) ? t : t < 0 ? Math.ceil(t) : Math.floor(t)
}
function requiredArgs$1(e, t) {
if (t.length < e)
throw new TypeError(e + " argument" + (e > 1 ? "s" : "") + "
required, but only " + t.length + " present")
}
function toDate$2(e) {
requiredArgs$1(1, arguments);
var t = Object.prototype.toString.call(e);
return e instanceof Date || "object" === _typeof$2(e) && "[object
Date]" === t ? new Date(e.getTime()) : "number" == typeof e || "[object Number]"
=== t ? new Date(e) : new Date(NaN)
}
function addMonths(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e)
, n = toInteger$6(t);
if (isNaN(n))
return new Date(NaN);
if (!n)
return r;
var i = r.getDate()
, o = new Date(r.getTime());
return o.setMonth(r.getMonth() + n + 1, 0),
i >= o.getDate() ? o : (r.setFullYear(o.getFullYear(), o.getMonth(),
i),
r)
}
function addMilliseconds$1(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e).getTime()
, n = toInteger$6(t);
return new Date(r + n)
}
var defaultOptions$3 = {};
function getDefaultOptions$1() {
return defaultOptions$3
}
function getTimezoneOffsetInMilliseconds$1(e) {
var t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(),
e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
return t.setUTCFullYear(e.getFullYear()),
e.getTime() - t.getTime()
}
function startOfDay(e) {
requiredArgs$1(1, arguments);
var t = toDate$2(e);
return t.setHours(0, 0, 0, 0),
t
}
function addYears(e, t) {
return requiredArgs$1(2, arguments),
addMonths(e, 12 * toInteger$6(t))
}
var millisecondsInMinute = 6e4
, millisecondsInHour = 36e5
, millisecondsInSecond = 1e3;
function isSameDay$1(e, t) {
requiredArgs$1(2, arguments);
var r = startOfDay(e)
, n = startOfDay(t);
return r.getTime() === n.getTime()
}
function isDate$2(e) {
return requiredArgs$1(1, arguments),
e instanceof Date || "object" === _typeof$2(e) && "[object Date]" ===
Object.prototype.toString.call(e)
}
function isValid$4(e) {
if (requiredArgs$1(1, arguments),
!isDate$2(e) && "number" != typeof e)
return !1;
var t = toDate$2(e);
return !isNaN(Number(t))
}
function differenceInCalendarMonths(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e)
, n = toDate$2(t);
return 12 * (r.getFullYear() - n.getFullYear()) + (r.getMonth() -
n.getMonth())
}
function differenceInCalendarYears(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e)
, n = toDate$2(t);
return r.getFullYear() - n.getFullYear()
}
function startOfMonth(e) {
requiredArgs$1(1, arguments);
var t = toDate$2(e);
return t.setDate(1),
t.setHours(0, 0, 0, 0),
t
}
function subMilliseconds$1(e, t) {
return requiredArgs$1(2, arguments),
addMilliseconds$1(e, -toInteger$6(t))
}
var MILLISECONDS_IN_DAY = 864e5;
function getUTCDayOfYear$1(e) {
requiredArgs$1(1, arguments);
var t = toDate$2(e)
, r = t.getTime();
t.setUTCMonth(0, 1),
t.setUTCHours(0, 0, 0, 0);
var n = r - t.getTime();
return Math.floor(n / MILLISECONDS_IN_DAY) + 1
}
function startOfUTCISOWeek$1(e) {
requiredArgs$1(1, arguments);
var t = toDate$2(e)
, r = t.getUTCDay()
, n = (r < 1 ? 7 : 0) + r - 1;
return t.setUTCDate(t.getUTCDate() - n),
t.setUTCHours(0, 0, 0, 0),
t
}
function getUTCISOWeekYear$1(e) {
requiredArgs$1(1, arguments);
var t = toDate$2(e)
, r = t.getUTCFullYear()
, n = new Date(0);
n.setUTCFullYear(r + 1, 0, 4),
n.setUTCHours(0, 0, 0, 0);
var i = startOfUTCISOWeek$1(n)
, o = new Date(0);
o.setUTCFullYear(r, 0, 4),
o.setUTCHours(0, 0, 0, 0);
var s = startOfUTCISOWeek$1(o);
return t.getTime() >= i.getTime() ? r + 1 : t.getTime() >=
s.getTime() ? r : r - 1
}
function startOfUTCISOWeekYear$1(e) {
requiredArgs$1(1, arguments);
var t = getUTCISOWeekYear$1(e)
, r = new Date(0);
return r.setUTCFullYear(t, 0, 4),
r.setUTCHours(0, 0, 0, 0),
startOfUTCISOWeek$1(r)
}
var MILLISECONDS_IN_WEEK$1 = 6048e5;
function getUTCISOWeek$1(e) {
requiredArgs$1(1, arguments);
var t = toDate$2(e)
, r = startOfUTCISOWeek$1(t).getTime() -
startOfUTCISOWeekYear$1(t).getTime();
return Math.round(r / MILLISECONDS_IN_WEEK$1) + 1
}
function startOfUTCWeek$1(e, t) {
var r, n, i, o, s, a, l, c;
requiredArgs$1(1, arguments);
var u = getDefaultOptions$1()
, d = toInteger$6(null !== (r = null !== (n = null !== (i = null !==
(o = null == t ? void 0 : t.weekStartsOn) && void 0 !== o ? o : null == t || null
=== (s = t.locale) || void 0 === s || null === (a = s.options) || void 0 === a ?
void 0 : a.weekStartsOn) && void 0 !== i ? i : u.weekStartsOn) && void 0 !== n ?
n : null === (l = u.locale) || void 0 === l || null === (c = l.options) || void 0
=== c ? void 0 : c.weekStartsOn) && void 0 !== r ? r : 0);
if (!(d >= 0 && d <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6
inclusively");
var p = toDate$2(e)
, h = p.getUTCDay()
, f = (h < d ? 7 : 0) + h - d;
return p.setUTCDate(p.getUTCDate() - f),
p.setUTCHours(0, 0, 0, 0),
p
}
function getUTCWeekYear$1(e, t) {
var r, n, i, o, s, a, l, c;
requiredArgs$1(1, arguments);
var u = toDate$2(e)
, d = u.getUTCFullYear()
, p = getDefaultOptions$1()
, h = toInteger$6(null !== (r = null !== (n = null !== (i = null !==
(o = null == t ? void 0 : t.firstWeekContainsDate) && void 0 !== o ? o : null == t
|| null === (s = t.locale) || void 0 === s || null === (a = s.options) || void 0
=== a ? void 0 : a.firstWeekContainsDate) && void 0 !== i ? i :
p.firstWeekContainsDate) && void 0 !== n ? n : null === (l = p.locale) || void 0
=== l || null === (c = l.options) || void 0 === c ? void 0 :
c.firstWeekContainsDate) && void 0 !== r ? r : 1);
if (!(h >= 1 && h <= 7))
throw new RangeError("firstWeekContainsDate must be between 1 and 7
inclusively");
var f = new Date(0);
f.setUTCFullYear(d + 1, 0, h),
f.setUTCHours(0, 0, 0, 0);
var m = startOfUTCWeek$1(f, t)
, g = new Date(0);
g.setUTCFullYear(d, 0, h),
g.setUTCHours(0, 0, 0, 0);
var y = startOfUTCWeek$1(g, t);
return u.getTime() >= m.getTime() ? d + 1 : u.getTime() >=
y.getTime() ? d : d - 1
}
function startOfUTCWeekYear$1(e, t) {
var r, n, i, o, s, a, l, c;
requiredArgs$1(1, arguments);
var u = getDefaultOptions$1()
, d = toInteger$6(null !== (r = null !== (n = null !== (i = null !==
(o = null == t ? void 0 : t.firstWeekContainsDate) && void 0 !== o ? o : null == t
|| null === (s = t.locale) || void 0 === s || null === (a = s.options) || void 0
=== a ? void 0 : a.firstWeekContainsDate) && void 0 !== i ? i :
u.firstWeekContainsDate) && void 0 !== n ? n : null === (l = u.locale) || void 0
=== l || null === (c = l.options) || void 0 === c ? void 0 :
c.firstWeekContainsDate) && void 0 !== r ? r : 1)
, p = getUTCWeekYear$1(e, t)
, h = new Date(0);
return h.setUTCFullYear(p, 0, d),
h.setUTCHours(0, 0, 0, 0),
startOfUTCWeek$1(h, t)
}
var MILLISECONDS_IN_WEEK = 6048e5;
function getUTCWeek$1(e, t) {
requiredArgs$1(1, arguments);
var r = toDate$2(e)
, n = startOfUTCWeek$1(r, t).getTime() - startOfUTCWeekYear$1(r,
t).getTime();
return Math.round(n / MILLISECONDS_IN_WEEK) + 1
}
function addLeadingZeros$1(e, t) {
for (var r = e < 0 ? "-" : "", n = Math.abs(e).toString(); n.length <
t; )
n = "0" + n;
return r + n
}
var formatters$4 = {
y: function(e, t) {
var r = e.getUTCFullYear()
, n = r > 0 ? r : 1 - r;
return addLeadingZeros$1("yy" === t ? n % 100 : n, t.length)
},
M: function(e, t) {
var r = e.getUTCMonth();
return "M" === t ? String(r + 1) : addLeadingZeros$1(r + 1, 2)
},
d: function(e, t) {
return addLeadingZeros$1(e.getUTCDate(), t.length)
},
a: function(e, t) {
var r = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
switch (t) {
case "a":
case "aa":
return r.toUpperCase();
case "aaa":
return r;
case "aaaaa":
return r[0];
default:
return "am" === r ? "a.m." : "p.m."
}
},
h: function(e, t) {
return addLeadingZeros$1(e.getUTCHours() % 12 || 12, t.length)
},
H: function(e, t) {
return addLeadingZeros$1(e.getUTCHours(), t.length)
},
m: function(e, t) {
return addLeadingZeros$1(e.getUTCMinutes(), t.length)
},
s: function(e, t) {
return addLeadingZeros$1(e.getUTCSeconds(), t.length)
},
S: function(e, t) {
var r = t.length
, n = e.getUTCMilliseconds();
return addLeadingZeros$1(Math.floor(n * Math.pow(10, r - 3)),
t.length)
}
};
const formatters$5 = formatters$4;
var dayPeriodEnum = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
, formatters$2 = {
G: function(e, t, r) {
var n = e.getUTCFullYear() > 0 ? 1 : 0;
switch (t) {
case "G":
case "GG":
case "GGG":
return r.era(n, {
width: "abbreviated"
});
case "GGGGG":
return r.era(n, {
width: "narrow"
});
default:
return r.era(n, {
width: "wide"
})
}
},
y: function(e, t, r) {
if ("yo" === t) {
var n = e.getUTCFullYear()
, i = n > 0 ? n : 1 - n;
return r.ordinalNumber(i, {
unit: "year"
})
}
return formatters$5.y(e, t)
},
Y: function(e, t, r, n) {
var i = getUTCWeekYear$1(e, n)
, o = i > 0 ? i : 1 - i;
return "YY" === t ? addLeadingZeros$1(o % 100, 2) : "Yo" === t ?
r.ordinalNumber(o, {
unit: "year"
}) : addLeadingZeros$1(o, t.length)
},
R: function(e, t) {
return addLeadingZeros$1(getUTCISOWeekYear$1(e), t.length)
},
u: function(e, t) {
return addLeadingZeros$1(e.getUTCFullYear(), t.length)
},
Q: function(e, t, r) {
var n = Math.ceil((e.getUTCMonth() + 1) / 3);
switch (t) {
case "Q":
return String(n);
case "QQ":
return addLeadingZeros$1(n, 2);
case "Qo":
return r.ordinalNumber(n, {
unit: "quarter"
});
case "QQQ":
return r.quarter(n, {
width: "abbreviated",
context: "formatting"
});
case "QQQQQ":
return r.quarter(n, {
width: "narrow",
context: "formatting"
});
default:
return r.quarter(n, {
width: "wide",
context: "formatting"
})
}
},
q: function(e, t, r) {
var n = Math.ceil((e.getUTCMonth() + 1) / 3);
switch (t) {
case "q":
return String(n);
case "qq":
return addLeadingZeros$1(n, 2);
case "qo":
return r.ordinalNumber(n, {
unit: "quarter"
});
case "qqq":
return r.quarter(n, {
width: "abbreviated",
context: "standalone"
});
case "qqqqq":
return r.quarter(n, {
width: "narrow",
context: "standalone"
});
default:
return r.quarter(n, {
width: "wide",
context: "standalone"
})
}
},
M: function(e, t, r) {
var n = e.getUTCMonth();
switch (t) {
case "M":
case "MM":
return formatters$5.M(e, t);
case "Mo":
return r.ordinalNumber(n + 1, {
unit: "month"
});
case "MMM":
return r.month(n, {
width: "abbreviated",
context: "formatting"
});
case "MMMMM":
return r.month(n, {
width: "narrow",
context: "formatting"
});
default:
return r.month(n, {
width: "wide",
context: "formatting"
})
}
},
L: function(e, t, r) {
var n = e.getUTCMonth();
switch (t) {
case "L":
return String(n + 1);
case "LL":
return addLeadingZeros$1(n + 1, 2);
case "Lo":
return r.ordinalNumber(n + 1, {
unit: "month"
});
case "LLL":
return r.month(n, {
width: "abbreviated",
context: "standalone"
});
case "LLLLL":
return r.month(n, {
width: "narrow",
context: "standalone"
});
default:
return r.month(n, {
width: "wide",
context: "standalone"
})
}
},
w: function(e, t, r, n) {
var i = getUTCWeek$1(e, n);
return "wo" === t ? r.ordinalNumber(i, {
unit: "week"
}) : addLeadingZeros$1(i, t.length)
},
I: function(e, t, r) {
var n = getUTCISOWeek$1(e);
return "Io" === t ? r.ordinalNumber(n, {
unit: "week"
}) : addLeadingZeros$1(n, t.length)
},
d: function(e, t, r) {
return "do" === t ? r.ordinalNumber(e.getUTCDate(), {
unit: "date"
}) : formatters$5.d(e, t)
},
D: function(e, t, r) {
var n = getUTCDayOfYear$1(e);
return "Do" === t ? r.ordinalNumber(n, {
unit: "dayOfYear"
}) : addLeadingZeros$1(n, t.length)
},
E: function(e, t, r) {
var n = e.getUTCDay();
switch (t) {
case "E":
case "EE":
case "EEE":
return r.day(n, {
width: "abbreviated",
context: "formatting"
});
case "EEEEE":
return r.day(n, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return r.day(n, {
width: "short",
context: "formatting"
});
default:
return r.day(n, {
width: "wide",
context: "formatting"
})
}
},
e: function(e, t, r, n) {
var i = e.getUTCDay()
, o = (i - n.weekStartsOn + 8) % 7 || 7;
switch (t) {
case "e":
return String(o);
case "ee":
return addLeadingZeros$1(o, 2);
case "eo":
return r.ordinalNumber(o, {
unit: "day"
});
case "eee":
return r.day(i, {
width: "abbreviated",
context: "formatting"
});
case "eeeee":
return r.day(i, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return r.day(i, {
width: "short",
context: "formatting"
});
default:
return r.day(i, {
width: "wide",
context: "formatting"
})
}
},
c: function(e, t, r, n) {
var i = e.getUTCDay()
, o = (i - n.weekStartsOn + 8) % 7 || 7;
switch (t) {
case "c":
return String(o);
case "cc":
return addLeadingZeros$1(o, t.length);
case "co":
return r.ordinalNumber(o, {
unit: "day"
});
case "ccc":
return r.day(i, {
width: "abbreviated",
context: "standalone"
});
case "ccccc":
return r.day(i, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return r.day(i, {
width: "short",
context: "standalone"
});
default:
return r.day(i, {
width: "wide",
context: "standalone"
})
}
},
i: function(e, t, r) {
var n = e.getUTCDay()
, i = 0 === n ? 7 : n;
switch (t) {
case "i":
return String(i);
case "ii":
return addLeadingZeros$1(i, t.length);
case "io":
return r.ordinalNumber(i, {
unit: "day"
});
case "iii":
return r.day(n, {
width: "abbreviated",
context: "formatting"
});
case "iiiii":
return r.day(n, {
width: "narrow",
context: "formatting"
});
case "iiiiii":
return r.day(n, {
width: "short",
context: "formatting"
});
default:
return r.day(n, {
width: "wide",
context: "formatting"
})
}
},
a: function(e, t, r) {
var n = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
switch (t) {
case "a":
case "aa":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
});
case "aaa":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "aaaaa":
return r.dayPeriod(n, {
width: "narrow",
context: "formatting"
});
default:
return r.dayPeriod(n, {
width: "wide",
context: "formatting"
})
}
},
b: function(e, t, r) {
var n, i = e.getUTCHours();
switch (n = 12 === i ? dayPeriodEnum.noon : 0 === i ?
dayPeriodEnum.midnight : i / 12 >= 1 ? "pm" : "am",
t) {
case "b":
case "bb":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
});
case "bbb":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "bbbbb":
return r.dayPeriod(n, {
width: "narrow",
context: "formatting"
});
default:
return r.dayPeriod(n, {
width: "wide",
context: "formatting"
})
}
},
B: function(e, t, r) {
var n, i = e.getUTCHours();
switch (n = i >= 17 ? dayPeriodEnum.evening : i >= 12 ?
dayPeriodEnum.afternoon : i >= 4 ? dayPeriodEnum.morning : dayPeriodEnum.night,
t) {
case "B":
case "BB":
case "BBB":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
});
case "BBBBB":
return r.dayPeriod(n, {
width: "narrow",
context: "formatting"
});
default:
return r.dayPeriod(n, {
width: "wide",
context: "formatting"
})
}
},
h: function(e, t, r) {
if ("ho" === t) {
var n = e.getUTCHours() % 12;
return 0 === n && (n = 12),
r.ordinalNumber(n, {
unit: "hour"
})
}
return formatters$5.h(e, t)
},
H: function(e, t, r) {
return "Ho" === t ? r.ordinalNumber(e.getUTCHours(), {
unit: "hour"
}) : formatters$5.H(e, t)
},
K: function(e, t, r) {
var n = e.getUTCHours() % 12;
return "Ko" === t ? r.ordinalNumber(n, {
unit: "hour"
}) : addLeadingZeros$1(n, t.length)
},
k: function(e, t, r) {
var n = e.getUTCHours();
return 0 === n && (n = 24),
"ko" === t ? r.ordinalNumber(n, {
unit: "hour"
}) : addLeadingZeros$1(n, t.length)
},
m: function(e, t, r) {
return "mo" === t ? r.ordinalNumber(e.getUTCMinutes(), {
unit: "minute"
}) : formatters$5.m(e, t)
},
s: function(e, t, r) {
return "so" === t ? r.ordinalNumber(e.getUTCSeconds(), {
unit: "second"
}) : formatters$5.s(e, t)
},
S: function(e, t) {
return formatters$5.S(e, t)
},
X: function(e, t, r, n) {
var i = (n._originalDate || e).getTimezoneOffset();
if (0 === i)
return "Z";
switch (t) {
case "X":
return formatTimezoneWithOptionalMinutes(i);
case "XXXX":
case "XX":
return formatTimezone(i);
default:
return formatTimezone(i, ":")
}
},
x: function(e, t, r, n) {
var i = (n._originalDate || e).getTimezoneOffset();
switch (t) {
case "x":
return formatTimezoneWithOptionalMinutes(i);
case "xxxx":
case "xx":
return formatTimezone(i);
default:
return formatTimezone(i, ":")
}
},
O: function(e, t, r, n) {
var i = (n._originalDate || e).getTimezoneOffset();
switch (t) {
case "O":
case "OO":
case "OOO":
return "GMT" + formatTimezoneShort(i, ":");
default:
return "GMT" + formatTimezone(i, ":")
}
},
z: function(e, t, r, n) {
var i = (n._originalDate || e).getTimezoneOffset();
switch (t) {
case "z":
case "zz":
case "zzz":
return "GMT" + formatTimezoneShort(i, ":");
default:
return "GMT" + formatTimezone(i, ":")
}
},
t: function(e, t, r, n) {
var i = n._originalDate || e;
return addLeadingZeros$1(Math.floor(i.getTime() / 1e3), t.length)
},
T: function(e, t, r, n) {
return addLeadingZeros$1((n._originalDate || e).getTime(),
t.length)
}
};
function formatTimezoneShort(e, t) {
var r = e > 0 ? "-" : "+"
, n = Math.abs(e)
, i = Math.floor(n / 60)
, o = n % 60;
if (0 === o)
return r + String(i);
var s = t || "";
return r + String(i) + s + addLeadingZeros$1(o, 2)
}
function formatTimezoneWithOptionalMinutes(e, t) {
return e % 60 == 0 ? (e > 0 ? "-" : "+") +
addLeadingZeros$1(Math.abs(e) / 60, 2) : formatTimezone(e, t)
}
function formatTimezone(e, t) {
var r = t || ""
, n = e > 0 ? "-" : "+"
, i = Math.abs(e);
return n + addLeadingZeros$1(Math.floor(i / 60), 2) + r +
addLeadingZeros$1(i % 60, 2)
}
const formatters$3 = formatters$2;
var dateLongFormatter = function(e, t) {
switch (e) {
case "P":
return t.date({
width: "short"
});
case "PP":
return t.date({
width: "medium"
});
case "PPP":
return t.date({
width: "long"
});
default:
return t.date({
width: "full"
})
}
}
, timeLongFormatter = function(e, t) {
switch (e) {
case "p":
return t.time({
width: "short"
});
case "pp":
return t.time({
width: "medium"
});
case "ppp":
return t.time({
width: "long"
});
default:
return t.time({
width: "full"
})
}
}
, dateTimeLongFormatter = function(e, t) {
var r, n = e.match(/(P+)(p+)?/) || [], i = n[1], o = n[2];
if (!o)
return dateLongFormatter(e, t);
switch (i) {
case "P":
r = t.dateTime({
width: "short"
});
break;
case "PP":
r = t.dateTime({
width: "medium"
});
break;
case "PPP":
r = t.dateTime({
width: "long"
});
break;
default:
r = t.dateTime({
width: "full"
})
}
return r.replace("{{date}}", dateLongFormatter(i,
t)).replace("{{time}}", timeLongFormatter(o, t))
}
, longFormatters$1 = {
p: timeLongFormatter,
P: dateTimeLongFormatter
};
const longFormatters$2 = longFormatters$1;
var protectedDayOfYearTokens$1 = ["D", "DD"]
, protectedWeekYearTokens$1 = ["YY", "YYYY"];
function isProtectedDayOfYearToken$1(e) {
return -1 !== protectedDayOfYearTokens$1.indexOf(e)
}
function isProtectedWeekYearToken$1(e) {
return -1 !== protectedWeekYearTokens$1.indexOf(e)
}
function throwProtectedError$1(e, t, r) {
if ("YYYY" === e)
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,
"`) for formatting years to the input `").concat(r, "`; see:
https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
if ("YY" === e)
throw new RangeError("Use `yy` instead of `YY` (in `".concat(t, "`)
for formatting years to the input `").concat(r, "`; see: https://github.com/date-
fns/date-fns/blob/master/docs/unicodeTokens.md"));
if ("D" === e)
throw new RangeError("Use `d` instead of `D` (in `".concat(t, "`)
for formatting days of the month to the input `").concat(r, "`; see:
https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
if ("DD" === e)
throw new RangeError("Use `dd` instead of `DD` (in `".concat(t, "`)
for formatting days of the month to the input `").concat(r, "`; see:
https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))
}
var formatDistanceLocale$1 = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
}
, formatDistance$3 = function(e, t, r) {
var n, i = formatDistanceLocale$1[e];
return n = "string" == typeof i ? i : 1 === t ? i.one :
i.other.replace("{{count}}", t.toString()),
null != r && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n
: n + " ago" : n
};
const formatDistance$4 = formatDistance$3;
var dateFormats$1 = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy"
}
, timeFormats$1 = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
}
, dateTimeFormats$1 = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
}
, formatLong$3 = {
date: buildFormatLongFn$1({
formats: dateFormats$1,
defaultWidth: "full"
}),
time: buildFormatLongFn$1({
formats: timeFormats$1,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn$1({
formats: dateTimeFormats$1,
defaultWidth: "full"
})
};
const formatLong$4 = formatLong$3;
var formatRelativeLocale$1 = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
}
, formatRelative$3 = function(e, t, r, n) {
return formatRelativeLocale$1[e]
};
const formatRelative$4 = formatRelative$3;
var eraValues$1 = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
}
, quarterValues$1 = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}
, monthValues$1 = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec"],
wide: ["January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"]
}
, dayValues$1 = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday"]
}
, dayPeriodValues$1 = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
}
, formattingDayPeriodValues$1 = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
}
, ordinalNumber$1 = function(e, t) {
var r = Number(e)
, n = r % 100;
if (n > 20 || n < 10)
switch (n % 10) {
case 1:
return r + "st";
case 2:
return r + "nd";
case 3:
return r + "rd"
}
return r + "th"
}
, localize$3 = {
ordinalNumber: ordinalNumber$1,
era: buildLocalizeFn$1({
values: eraValues$1,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn$1({
values: quarterValues$1,
defaultWidth: "wide",
argumentCallback: function(e) {
return e - 1
}
}),
month: buildLocalizeFn$1({
values: monthValues$1,
defaultWidth: "wide"
}),
day: buildLocalizeFn$1({
values: dayValues$1,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn$1({
values: dayPeriodValues$1,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues$1,
defaultFormattingWidth: "wide"
})
};
const localize$4 = localize$3;
var matchOrdinalNumberPattern$1 = /^(\d+)(th|st|nd|rd)?/i
, parseOrdinalNumberPattern$1 = /\d+/i
, matchEraPatterns$1 = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?
e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
}
, parseEraPatterns$1 = {
any: [/^b/i, /^(a|c)/i]
}
, matchQuarterPatterns$1 = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
}
, parseQuarterPatterns$1 = {
any: [/1/i, /2/i, /3/i, /4/i]
}
, matchMonthPatterns$1 = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|
october|november|december)/i
}
, parseMonthPatterns$1 = {
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i,
/^o/i, /^n/i, /^d/i],
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i,
/^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
}
, matchDayPatterns$1 = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}
, parseDayPatterns$1 = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
}
, matchDayPeriodPatterns$1 = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|
evening|night))/i
}
, parseDayPeriodPatterns$1 = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
}
, match$3 = {
ordinalNumber: buildMatchPatternFn$1({
matchPattern: matchOrdinalNumberPattern$1,
parsePattern: parseOrdinalNumberPattern$1,
valueCallback: function(e) {
return parseInt(e, 10)
}
}),
era: buildMatchFn$1({
matchPatterns: matchEraPatterns$1,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns$1,
defaultParseWidth: "any"
}),
quarter: buildMatchFn$1({
matchPatterns: matchQuarterPatterns$1,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns$1,
defaultParseWidth: "any",
valueCallback: function(e) {
return e + 1
}
}),
month: buildMatchFn$1({
matchPatterns: matchMonthPatterns$1,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns$1,
defaultParseWidth: "any"
}),
day: buildMatchFn$1({
matchPatterns: matchDayPatterns$1,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns$1,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn$1({
matchPatterns: matchDayPeriodPatterns$1,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns$1,
defaultParseWidth: "any"
})
};
const match$4 = match$3;
var locale$1 = {
code: "en-US",
formatDistance: formatDistance$4,
formatLong: formatLong$4,
formatRelative: formatRelative$4,
localize: localize$4,
match: match$4,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
const defaultLocale$2 = locale$1;
var formattingTokensRegExp$1 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|
[^'])+('|$)|./g
, longFormattingTokensRegExp$1 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g
, escapedStringRegExp$1 = /^'([^]*?)'?$/
, doubleQuoteRegExp$1 = /''/g
, unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
function format$3(e, t, r) {
var n, i, o, s, a, l, c, u, d, p, h, f, m, g, y, v, b, x;
requiredArgs$1(2, arguments);
var _ = String(t)
, E = getDefaultOptions$1()
, T = null !== (n = null !== (i = null == r ? void 0 : r.locale) &&
void 0 !== i ? i : E.locale) && void 0 !== n ? n : defaultLocale$2
, C = toInteger$6(null !== (o = null !== (s = null !== (a = null !==
(l = null == r ? void 0 : r.firstWeekContainsDate) && void 0 !== l ? l : null == r
|| null === (c = r.locale) || void 0 === c || null === (u = c.options) || void 0
=== u ? void 0 : u.firstWeekContainsDate) && void 0 !== a ? a :
E.firstWeekContainsDate) && void 0 !== s ? s : null === (d = E.locale) || void 0
=== d || null === (p = d.options) || void 0 === p ? void 0 :
p.firstWeekContainsDate) && void 0 !== o ? o : 1);
if (!(C >= 1 && C <= 7))
throw new RangeError("firstWeekContainsDate must be between 1 and 7
inclusively");
var S = toInteger$6(null !== (h = null !== (f = null !== (m = null !==
(g = null == r ? void 0 : r.weekStartsOn) && void 0 !== g ? g : null == r || null
=== (y = r.locale) || void 0 === y || null === (v = y.options) || void 0 === v ?
void 0 : v.weekStartsOn) && void 0 !== m ? m : E.weekStartsOn) && void 0 !== f ?
f : null === (b = E.locale) || void 0 === b || null === (x = b.options) || void 0
=== x ? void 0 : x.weekStartsOn) && void 0 !== h ? h : 0);
if (!(S >= 0 && S <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6
inclusively");
if (!T.localize)
throw new RangeError("locale must contain localize property");
if (!T.formatLong)
throw new RangeError("locale must contain formatLong property");
var $ = toDate$2(e);
if (!isValid$4($))
throw new RangeError("Invalid time value");
var w = subMilliseconds$1($, getTimezoneOffsetInMilliseconds$1($))
, P = {
firstWeekContainsDate: C,
weekStartsOn: S,
locale: T,
_originalDate: $
};
return _.match(longFormattingTokensRegExp$1).map((function(e) {
var t = e[0];
return "p" === t || "P" === t ? (0,
longFormatters$2[t])(e, T.formatLong) : e
}
)).join("").match(formattingTokensRegExp$1).map((function(n) {
if ("''" === n)
return "'";
var i = n[0];
if ("'" === i)
return cleanEscapedString$1(n);
var o = formatters$3[i];
if (o)
return null != r && r.useAdditionalWeekYearTokens || !
isProtectedWeekYearToken$1(n) || throwProtectedError$1(n, t, String(e)),
null != r && r.useAdditionalDayOfYearTokens || !
isProtectedDayOfYearToken$1(n) || throwProtectedError$1(n, t, String(e)),
o(w, n, T.localize, P);
if (i.match(unescapedLatinCharacterRegExp$1))
throw new RangeError("Format string contains an unescaped latin
alphabet character `" + i + "`");
return n
}
)).join("")
}
function cleanEscapedString$1(e) {
var t = e.match(escapedStringRegExp$1);
return t ? t[1].replace(doubleQuoteRegExp$1, "'") : e
}
function assign$4(e, t) {
if (null == e)
throw new TypeError("assign requires that input parameter not be
null or undefined");
for (var r in t)
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
return e
}
function getDaysInMonth(e) {
requiredArgs$1(1, arguments);
var t = toDate$2(e)
, r = t.getFullYear()
, n = t.getMonth()
, i = new Date(0);
return i.setFullYear(r, n + 1, 0),
i.setHours(0, 0, 0, 0),
i.getDate()
}
function getHours(e) {
return requiredArgs$1(1, arguments),
toDate$2(e).getHours()
}
function lastDayOfMonth(e) {
requiredArgs$1(1, arguments);
var t = toDate$2(e)
, r = t.getMonth();
return t.setFullYear(t.getFullYear(), r + 1, 0),
t.setHours(0, 0, 0, 0),
t
}
function isAfter$2(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e)
, n = toDate$2(t);
return r.getTime() > n.getTime()
}
function isBefore$1(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e)
, n = toDate$2(t);
return r.getTime() < n.getTime()
}
function isEqual$1(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e)
, n = toDate$2(t);
return r.getTime() === n.getTime()
}
function _arrayLikeToArray$1(e, t) {
(null == t || t > e.length) && (t = e.length);
for (var r = 0, n = Array(t); r < t; r++)
n[r] = e[r];
return n
}
function _unsupportedIterableToArray$1(e, t) {
if (e) {
if ("string" == typeof e)
return _arrayLikeToArray$1(e, t);
var r = {}.toString.call(e).slice(8, -1);
return "Object" === r && e.constructor && (r = e.constructor.name),
"Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r
|| /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _arrayLikeToArray$1(e, t) :
void 0
}
}
function _createForOfIteratorHelper(e, t) {
var r = "undefined" != typeof Symbol && e[Symbol.iterator] ||
e["@@iterator"];
if (!r) {
if (Array.isArray(e) || (r = _unsupportedIterableToArray$1(e)) || t
&& e && "number" == typeof e.length) {
r && (e = r);
var n = 0
, i = function() {};
return {
s: i,
n: function() {
return n >= e.length ? {
done: !0
} : {
done: !1,
value: e[n++]
}
},
e: function(e) {
throw e
},
f: i
}
}
throw new TypeError("Invalid attempt to iterate non-iterable
instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]
() method.")
}
var o, s = !0, a = !1;
return {
s: function() {
r = r.call(e)
},
n: function() {
var e = r.next();
return s = e.done,
e
},
e: function(e) {
a = !0,
o = e
},
f: function() {
try {
s || null == r.return || r.return()
} finally {
if (a)
throw o
}
}
}
}
function _assertThisInitialized(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super()
hasn't been called");
return e
}
function _inherits$a(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a
function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}),
Object.defineProperty(e, "prototype", {
writable: !1
}),
t && _setPrototypeOf$1(e, t)
}
function _getPrototypeOf$1(e) {
return (_getPrototypeOf$1 = Object.setPrototypeOf ?
Object.getPrototypeOf.bind() : function(e) {
return e.__proto__ || Object.getPrototypeOf(e)
}
)(e)
}
function _isNativeReflectConstruct$1() {
try {
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean,
[], (function() {}
)))
} catch (t) {}
return (_isNativeReflectConstruct$1 = function() {
return !!e
}
)()
}
function _possibleConstructorReturn$a(e, t) {
if (t && ("object" == _typeof$2(t) || "function" == typeof t))
return t;
if (void 0 !== t)
throw new TypeError("Derived constructors may only return object or
undefined");
return _assertThisInitialized(e)
}
function _createSuper(e) {
var t = _isNativeReflectConstruct$1();
return function() {
var r, n = _getPrototypeOf$1(e);
if (t) {
var i = _getPrototypeOf$1(this).constructor;
r = Reflect.construct(n, arguments, i)
} else
r = n.apply(this, arguments);
return _possibleConstructorReturn$a(this, r)
}
}
function _classCallCheck$b(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function toPrimitive(e, t) {
if ("object" != _typeof$2(e) || !e)
return e;
var r = e[Symbol.toPrimitive];
if (void 0 !== r) {
var n = r.call(e, t || "default");
if ("object" != _typeof$2(n))
return n;
throw new TypeError("@@toPrimitive must return a primitive value.")
}
return ("string" === t ? String : Number)(e)
}
function toPropertyKey(e) {
var t = toPrimitive(e, "string");
return "symbol" == _typeof$2(t) ? t : t + ""
}
function _defineProperties$1(e, t) {
for (var r = 0; r < t.length; r++) {
var n = t[r];
n.enumerable = n.enumerable || !1,
n.configurable = !0,
"value"in n && (n.writable = !0),
Object.defineProperty(e, toPropertyKey(n.key), n)
}
}
function _createClass$9(e, t, r) {
return t && _defineProperties$1(e.prototype, t),
r && _defineProperties$1(e, r),
Object.defineProperty(e, "prototype", {
writable: !1
}),
e
}
function _defineProperty$3(e, t, r) {
return (t = toPropertyKey(t))in e ? Object.defineProperty(e, t, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = r,
e
}
var TIMEZONE_UNIT_PRIORITY = 10
, Setter = function() {
function e() {
_classCallCheck$b(this, e),
_defineProperty$3(this, "priority", void 0),
_defineProperty$3(this, "subPriority", 0)
}
return _createClass$9(e, [{
key: "validate",
value: function(e, t) {
return !0
}
}]),
e
}()
, ValueSetter = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r(e, n, i, o, s) {
var a;
return _classCallCheck$b(this, r),
(a = t.call(this)).value = e,
a.validateValue = n,
a.setValue = i,
a.priority = o,
s && (a.subPriority = s),
a
}
return _createClass$9(r, [{
key: "validate",
value: function(e, t) {
return this.validateValue(e, this.value, t)
}
}, {
key: "set",
value: function(e, t, r) {
return this.setValue(e, t, this.value, r)
}
}]),
r
}(Setter)
, DateToSystemTimezoneSetter = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", TIMEZONE_UNIT_PRIORITY),
_defineProperty$3(_assertThisInitialized(e), "subPriority", -1),
e
}
return _createClass$9(r, [{
key: "set",
value: function(e, t) {
if (t.timestampIsSet)
return e;
var r = new Date(0);
return r.setFullYear(e.getUTCFullYear(), e.getUTCMonth(),
e.getUTCDate()),
r.setHours(e.getUTCHours(), e.getUTCMinutes(),
e.getUTCSeconds(), e.getUTCMilliseconds()),
r
}
}]),
r
}(Setter)
, Parser = function() {
function e() {
_classCallCheck$b(this, e),
_defineProperty$3(this, "incompatibleTokens", void 0),
_defineProperty$3(this, "priority", void 0),
_defineProperty$3(this, "subPriority", void 0)
}
return _createClass$9(e, [{
key: "run",
value: function(e, t, r, n) {
var i = this.parse(e, t, r, n);
return i ? {
setter: new
ValueSetter(i.value,this.validate,this.set,this.priority,this.subPriority),
rest: i.rest
} : null
}
}, {
key: "validate",
value: function(e, t, r) {
return !0
}
}]),
e
}()
, EraParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 140),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["R", "u", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "G":
case "GG":
case "GGG":
return r.era(e, {
width: "abbreviated"
}) || r.era(e, {
width: "narrow"
});
case "GGGGG":
return r.era(e, {
width: "narrow"
});
default:
return r.era(e, {
width: "wide"
}) || r.era(e, {
width: "abbreviated"
}) || r.era(e, {
width: "narrow"
})
}
}
}, {
key: "set",
value: function(e, t, r) {
return t.era = r,
e.setUTCFullYear(r, 0, 1),
e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, numericPatterns = {
month: /^(1[0-2]|0?\d)/,
date: /^(3[0-1]|[0-2]?\d)/,
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
week: /^(5[0-3]|[0-4]?\d)/,
hour23h: /^(2[0-3]|[0-1]?\d)/,
hour24h: /^(2[0-4]|[0-1]?\d)/,
hour11h: /^(1[0-1]|0?\d)/,
hour12h: /^(1[0-2]|0?\d)/,
minute: /^[0-5]?\d/,
second: /^[0-5]?\d/,
singleDigit: /^\d/,
twoDigits: /^\d{1,2}/,
threeDigits: /^\d{1,3}/,
fourDigits: /^\d{1,4}/,
anyDigitsSigned: /^-?\d+/,
singleDigitSigned: /^-?\d/,
twoDigitsSigned: /^-?\d{1,2}/,
threeDigitsSigned: /^-?\d{1,3}/,
fourDigitsSigned: /^-?\d{1,4}/
}
, timezonePatterns = {
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
basic: /^([+-])(\d{2})(\d{2})|Z/,
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
extended: /^([+-])(\d{2}):(\d{2})|Z/,
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
};
function mapValue(e, t) {
return e ? {
value: t(e.value),
rest: e.rest
} : e
}
function parseNumericPattern(e, t) {
var r = t.match(e);
return r ? {
value: parseInt(r[0], 10),
rest: t.slice(r[0].length)
} : null
}
function parseTimezonePattern(e, t) {
var r = t.match(e);
if (!r)
return null;
if ("Z" === r[0])
return {
value: 0,
rest: t.slice(1)
};
var n = "+" === r[1] ? 1 : -1
, i = r[2] ? parseInt(r[2], 10) : 0
, o = r[3] ? parseInt(r[3], 10) : 0
, s = r[5] ? parseInt(r[5], 10) : 0;
return {
value: n * (i * millisecondsInHour + o * millisecondsInMinute + s *
millisecondsInSecond),
rest: t.slice(r[0].length)
}
}
function parseAnyDigitsSigned(e) {
return parseNumericPattern(numericPatterns.anyDigitsSigned, e)
}
function parseNDigits(e, t) {
switch (e) {
case 1:
return parseNumericPattern(numericPatterns.singleDigit, t);
case 2:
return parseNumericPattern(numericPatterns.twoDigits, t);
case 3:
return parseNumericPattern(numericPatterns.threeDigits, t);
case 4:
return parseNumericPattern(numericPatterns.fourDigits, t);
default:
return parseNumericPattern(new RegExp("^\\d{1," + e + "}"), t)
}
}
function parseNDigitsSigned(e, t) {
switch (e) {
case 1:
return parseNumericPattern(numericPatterns.singleDigitSigned, t);
case 2:
return parseNumericPattern(numericPatterns.twoDigitsSigned, t);
case 3:
return parseNumericPattern(numericPatterns.threeDigitsSigned, t);
case 4:
return parseNumericPattern(numericPatterns.fourDigitsSigned, t);
default:
return parseNumericPattern(new RegExp("^-?\\d{1," + e + "}"), t)
}
}
function dayPeriodEnumToHours(e) {
switch (e) {
case "morning":
return 4;
case "evening":
return 17;
case "pm":
case "noon":
case "afternoon":
return 12;
default:
return 0
}
}
function normalizeTwoDigitYear(e, t) {
var r, n = t > 0, i = n ? t : 1 - t;
if (i <= 50)
r = e || 100;
else {
var o = i + 50;
r = e + 100 * Math.floor(o / 100) - (e >= o % 100 ? 100 : 0)
}
return n ? r : 1 - r
}
function isLeapYearIndex$1(e) {
return e % 400 == 0 || e % 4 == 0 && e % 100 != 0
}
var YearParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 130),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
var n = function(e) {
return {
year: e,
isTwoDigitYear: "yy" === t
}
};
switch (t) {
case "y":
return mapValue(parseNDigits(4, e), n);
case "yo":
return mapValue(r.ordinalNumber(e, {
unit: "year"
}), n);
default:
return mapValue(parseNDigits(t.length, e), n)
}
}
}, {
key: "validate",
value: function(e, t) {
return t.isTwoDigitYear || t.year > 0
}
}, {
key: "set",
value: function(e, t, r) {
var n = e.getUTCFullYear();
if (r.isTwoDigitYear) {
var i = normalizeTwoDigitYear(r.year, n);
return e.setUTCFullYear(i, 0, 1),
e.setUTCHours(0, 0, 0, 0),
e
}
var o = "era"in t && 1 !== t.era ? 1 - r.year : r.year;
return e.setUTCFullYear(o, 0, 1),
e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, LocalWeekYearParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 130),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
var n = function(e) {
return {
year: e,
isTwoDigitYear: "YY" === t
}
};
switch (t) {
case "Y":
return mapValue(parseNDigits(4, e), n);
case "Yo":
return mapValue(r.ordinalNumber(e, {
unit: "year"
}), n);
default:
return mapValue(parseNDigits(t.length, e), n)
}
}
}, {
key: "validate",
value: function(e, t) {
return t.isTwoDigitYear || t.year > 0
}
}, {
key: "set",
value: function(e, t, r, n) {
var i = getUTCWeekYear$1(e, n);
if (r.isTwoDigitYear) {
var o = normalizeTwoDigitYear(r.year, i);
return e.setUTCFullYear(o, 0, n.firstWeekContainsDate),
e.setUTCHours(0, 0, 0, 0),
startOfUTCWeek$1(e, n)
}
var s = "era"in t && 1 !== t.era ? 1 - r.year : r.year;
return e.setUTCFullYear(s, 0, n.firstWeekContainsDate),
e.setUTCHours(0, 0, 0, 0),
startOfUTCWeek$1(e, n)
}
}]),
r
}(Parser)
, ISOWeekYearParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 130),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t) {
return parseNDigitsSigned("R" === t ? 4 : t.length, e)
}
}, {
key: "set",
value: function(e, t, r) {
var n = new Date(0);
return n.setUTCFullYear(r, 0, 4),
n.setUTCHours(0, 0, 0, 0),
startOfUTCISOWeek$1(n)
}
}]),
r
}(Parser)
, ExtendedYearParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 130),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t) {
return parseNDigitsSigned("u" === t ? 4 : t.length, e)
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCFullYear(r, 0, 1),
e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, QuarterParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 120),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "Q":
case "QQ":
return parseNDigits(t.length, e);
case "Qo":
return r.ordinalNumber(e, {
unit: "quarter"
});
case "QQQ":
return r.quarter(e, {
width: "abbreviated",
context: "formatting"
}) || r.quarter(e, {
width: "narrow",
context: "formatting"
});
case "QQQQQ":
return r.quarter(e, {
width: "narrow",
context: "formatting"
});
default:
return r.quarter(e, {
width: "wide",
context: "formatting"
}) || r.quarter(e, {
width: "abbreviated",
context: "formatting"
}) || r.quarter(e, {
width: "narrow",
context: "formatting"
})
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 1 && t <= 4
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCMonth(3 * (r - 1), 1),
e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, StandAloneQuarterParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 120),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "q":
case "qq":
return parseNDigits(t.length, e);
case "qo":
return r.ordinalNumber(e, {
unit: "quarter"
});
case "qqq":
return r.quarter(e, {
width: "abbreviated",
context: "standalone"
}) || r.quarter(e, {
width: "narrow",
context: "standalone"
});
case "qqqqq":
return r.quarter(e, {
width: "narrow",
context: "standalone"
});
default:
return r.quarter(e, {
width: "wide",
context: "standalone"
}) || r.quarter(e, {
width: "abbreviated",
context: "standalone"
}) || r.quarter(e, {
width: "narrow",
context: "standalone"
})
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 1 && t <= 4
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCMonth(3 * (r - 1), 1),
e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, MonthParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "incompatibleTokens", ["Y", "R", "q", "Q", "L", "w", "I", "D",
"i", "e", "c", "t", "T"]),
_defineProperty$3(_assertThisInitialized(e), "priority", 110),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
var n = function(e) {
return e - 1
};
switch (t) {
case "M":
return mapValue(parseNumericPattern(numericPatterns.month,
e), n);
case "MM":
return mapValue(parseNDigits(2, e), n);
case "Mo":
return mapValue(r.ordinalNumber(e, {
unit: "month"
}), n);
case "MMM":
return r.month(e, {
width: "abbreviated",
context: "formatting"
}) || r.month(e, {
width: "narrow",
context: "formatting"
});
case "MMMMM":
return r.month(e, {
width: "narrow",
context: "formatting"
});
default:
return r.month(e, {
width: "wide",
context: "formatting"
}) || r.month(e, {
width: "abbreviated",
context: "formatting"
}) || r.month(e, {
width: "narrow",
context: "formatting"
})
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 0 && t <= 11
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCMonth(r, 1),
e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, StandAloneMonthParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 110),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
var n = function(e) {
return e - 1
};
switch (t) {
case "L":
return mapValue(parseNumericPattern(numericPatterns.month,
e), n);
case "LL":
return mapValue(parseNDigits(2, e), n);
case "Lo":
return mapValue(r.ordinalNumber(e, {
unit: "month"
}), n);
case "LLL":
return r.month(e, {
width: "abbreviated",
context: "standalone"
}) || r.month(e, {
width: "narrow",
context: "standalone"
});
case "LLLLL":
return r.month(e, {
width: "narrow",
context: "standalone"
});
default:
return r.month(e, {
width: "wide",
context: "standalone"
}) || r.month(e, {
width: "abbreviated",
context: "standalone"
}) || r.month(e, {
width: "narrow",
context: "standalone"
})
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 0 && t <= 11
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCMonth(r, 1),
e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser);
function setUTCWeek(e, t, r) {
requiredArgs$1(2, arguments);
var n = toDate$2(e)
, i = toInteger$6(t)
, o = getUTCWeek$1(n, r) - i;
return n.setUTCDate(n.getUTCDate() - 7 * o),
n
}
var LocalWeekParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 100),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "i", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "w":
return parseNumericPattern(numericPatterns.week, e);
case "wo":
return r.ordinalNumber(e, {
unit: "week"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 1 && t <= 53
}
}, {
key: "set",
value: function(e, t, r, n) {
return startOfUTCWeek$1(setUTCWeek(e, r, n), n)
}
}]),
r
}(Parser);
function setUTCISOWeek(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e)
, n = toInteger$6(t)
, i = getUTCISOWeek$1(r) - n;
return r.setUTCDate(r.getUTCDate() - 7 * i),
r
}
var ISOWeekParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 100),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "I":
return parseNumericPattern(numericPatterns.week, e);
case "Io":
return r.ordinalNumber(e, {
unit: "week"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 1 && t <= 53
}
}, {
key: "set",
value: function(e, t, r) {
return startOfUTCISOWeek$1(setUTCISOWeek(e, r))
}
}]),
r
}(Parser)
, DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
, DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30,
31]
, DateParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 90),
_defineProperty$3(_assertThisInitialized(e), "subPriority", 1),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "d":
return parseNumericPattern(numericPatterns.date, e);
case "do":
return r.ordinalNumber(e, {
unit: "date"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
var r = isLeapYearIndex$1(e.getUTCFullYear())
, n = e.getUTCMonth();
return r ? t >= 1 && t <= DAYS_IN_MONTH_LEAP_YEAR[n] : t >= 1
&& t <= DAYS_IN_MONTH[n]
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCDate(r),
e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, DayOfYearParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 90),
_defineProperty$3(_assertThisInitialized(e), "subpriority", 1),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["Y", "R", "q", "Q", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "D":
case "DD":
return parseNumericPattern(numericPatterns.dayOfYear, e);
case "Do":
return r.ordinalNumber(e, {
unit: "date"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
return isLeapYearIndex$1(e.getUTCFullYear()) ? t >= 1 && t <=
366 : t >= 1 && t <= 365
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCMonth(0, r),
e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser);
function setUTCDay(e, t, r) {
var n, i, o, s, a, l, c, u;
requiredArgs$1(2, arguments);
var d = getDefaultOptions$1()
, p = toInteger$6(null !== (n = null !== (i = null !== (o = null !==
(s = null == r ? void 0 : r.weekStartsOn) && void 0 !== s ? s : null == r || null
=== (a = r.locale) || void 0 === a || null === (l = a.options) || void 0 === l ?
void 0 : l.weekStartsOn) && void 0 !== o ? o : d.weekStartsOn) && void 0 !== i ?
i : null === (c = d.locale) || void 0 === c || null === (u = c.options) || void 0
=== u ? void 0 : u.weekStartsOn) && void 0 !== n ? n : 0);
if (!(p >= 0 && p <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6
inclusively");
var h = toDate$2(e)
, f = toInteger$6(t)
, m = ((f % 7 + 7) % 7 < p ? 7 : 0) + f - h.getUTCDay();
return h.setUTCDate(h.getUTCDate() + m),
h
}
var DayParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 90),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["D", "i", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "E":
case "EE":
case "EEE":
return r.day(e, {
width: "abbreviated",
context: "formatting"
}) || r.day(e, {
width: "short",
context: "formatting"
}) || r.day(e, {
width: "narrow",
context: "formatting"
});
case "EEEEE":
return r.day(e, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return r.day(e, {
width: "short",
context: "formatting"
}) || r.day(e, {
width: "narrow",
context: "formatting"
});
default:
return r.day(e, {
width: "wide",
context: "formatting"
}) || r.day(e, {
width: "abbreviated",
context: "formatting"
}) || r.day(e, {
width: "short",
context: "formatting"
}) || r.day(e, {
width: "narrow",
context: "formatting"
})
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 0 && t <= 6
}
}, {
key: "set",
value: function(e, t, r, n) {
return (e = setUTCDay(e, r, n)).setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, LocalDayParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 90),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r, n) {
var i = function(e) {
var t = 7 * Math.floor((e - 1) / 7);
return (e + n.weekStartsOn + 6) % 7 + t
};
switch (t) {
case "e":
case "ee":
return mapValue(parseNDigits(t.length, e), i);
case "eo":
return mapValue(r.ordinalNumber(e, {
unit: "day"
}), i);
case "eee":
return r.day(e, {
width: "abbreviated",
context: "formatting"
}) || r.day(e, {
width: "short",
context: "formatting"
}) || r.day(e, {
width: "narrow",
context: "formatting"
});
case "eeeee":
return r.day(e, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return r.day(e, {
width: "short",
context: "formatting"
}) || r.day(e, {
width: "narrow",
context: "formatting"
});
default:
return r.day(e, {
width: "wide",
context: "formatting"
}) || r.day(e, {
width: "abbreviated",
context: "formatting"
}) || r.day(e, {
width: "short",
context: "formatting"
}) || r.day(e, {
width: "narrow",
context: "formatting"
})
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 0 && t <= 6
}
}, {
key: "set",
value: function(e, t, r, n) {
return (e = setUTCDay(e, r, n)).setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, StandAloneLocalDayParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 90),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "e", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r, n) {
var i = function(e) {
var t = 7 * Math.floor((e - 1) / 7);
return (e + n.weekStartsOn + 6) % 7 + t
};
switch (t) {
case "c":
case "cc":
return mapValue(parseNDigits(t.length, e), i);
case "co":
return mapValue(r.ordinalNumber(e, {
unit: "day"
}), i);
case "ccc":
return r.day(e, {
width: "abbreviated",
context: "standalone"
}) || r.day(e, {
width: "short",
context: "standalone"
}) || r.day(e, {
width: "narrow",
context: "standalone"
});
case "ccccc":
return r.day(e, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return r.day(e, {
width: "short",
context: "standalone"
}) || r.day(e, {
width: "narrow",
context: "standalone"
});
default:
return r.day(e, {
width: "wide",
context: "standalone"
}) || r.day(e, {
width: "abbreviated",
context: "standalone"
}) || r.day(e, {
width: "short",
context: "standalone"
}) || r.day(e, {
width: "narrow",
context: "standalone"
})
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 0 && t <= 6
}
}, {
key: "set",
value: function(e, t, r, n) {
return (e = setUTCDay(e, r, n)).setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser);
function setUTCISODay(e, t) {
requiredArgs$1(2, arguments);
var r = toInteger$6(t);
r % 7 == 0 && (r -= 7);
var n = toDate$2(e)
, i = ((r % 7 + 7) % 7 < 1 ? 7 : 0) + r - n.getUTCDay();
return n.setUTCDate(n.getUTCDate() + i),
n
}
var ISODayParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 90),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
var n = function(e) {
return 0 === e ? 7 : e
};
switch (t) {
case "i":
case "ii":
return parseNDigits(t.length, e);
case "io":
return r.ordinalNumber(e, {
unit: "day"
});
case "iii":
return mapValue(r.day(e, {
width: "abbreviated",
context: "formatting"
}) || r.day(e, {
width: "short",
context: "formatting"
}) || r.day(e, {
width: "narrow",
context: "formatting"
}), n);
case "iiiii":
return mapValue(r.day(e, {
width: "narrow",
context: "formatting"
}), n);
case "iiiiii":
return mapValue(r.day(e, {
width: "short",
context: "formatting"
}) || r.day(e, {
width: "narrow",
context: "formatting"
}), n);
default:
return mapValue(r.day(e, {
width: "wide",
context: "formatting"
}) || r.day(e, {
width: "abbreviated",
context: "formatting"
}) || r.day(e, {
width: "short",
context: "formatting"
}) || r.day(e, {
width: "narrow",
context: "formatting"
}), n)
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 1 && t <= 7
}
}, {
key: "set",
value: function(e, t, r) {
return (e = setUTCISODay(e, r)).setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, AMPMParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 80),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["b", "B", "H", "k", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "a":
case "aa":
case "aaa":
return r.dayPeriod(e, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(e, {
width: "narrow",
context: "formatting"
});
case "aaaaa":
return r.dayPeriod(e, {
width: "narrow",
context: "formatting"
});
default:
return r.dayPeriod(e, {
width: "wide",
context: "formatting"
}) || r.dayPeriod(e, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(e, {
width: "narrow",
context: "formatting"
})
}
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCHours(dayPeriodEnumToHours(r), 0, 0, 0),
e
}
}]),
r
}(Parser)
, AMPMMidnightParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 80),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["a", "B", "H", "k", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "b":
case "bb":
case "bbb":
return r.dayPeriod(e, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(e, {
width: "narrow",
context: "formatting"
});
case "bbbbb":
return r.dayPeriod(e, {
width: "narrow",
context: "formatting"
});
default:
return r.dayPeriod(e, {
width: "wide",
context: "formatting"
}) || r.dayPeriod(e, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(e, {
width: "narrow",
context: "formatting"
})
}
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCHours(dayPeriodEnumToHours(r), 0, 0, 0),
e
}
}]),
r
}(Parser)
, DayPeriodParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 80),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["a", "b", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "B":
case "BB":
case "BBB":
return r.dayPeriod(e, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(e, {
width: "narrow",
context: "formatting"
});
case "BBBBB":
return r.dayPeriod(e, {
width: "narrow",
context: "formatting"
});
default:
return r.dayPeriod(e, {
width: "wide",
context: "formatting"
}) || r.dayPeriod(e, {
width: "abbreviated",
context: "formatting"
}) || r.dayPeriod(e, {
width: "narrow",
context: "formatting"
})
}
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCHours(dayPeriodEnumToHours(r), 0, 0, 0),
e
}
}]),
r
}(Parser)
, Hour1to12Parser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 70),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["H", "K", "k", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "h":
return parseNumericPattern(numericPatterns.hour12h, e);
case "ho":
return r.ordinalNumber(e, {
unit: "hour"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 1 && t <= 12
}
}, {
key: "set",
value: function(e, t, r) {
var n = e.getUTCHours() >= 12;
return n && r < 12 ? e.setUTCHours(r + 12, 0, 0, 0) : n || 12 !
== r ? e.setUTCHours(r, 0, 0, 0) : e.setUTCHours(0, 0, 0, 0),
e
}
}]),
r
}(Parser)
, Hour0to23Parser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 70),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["a", "b", "h", "K", "k", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "H":
return parseNumericPattern(numericPatterns.hour23h, e);
case "Ho":
return r.ordinalNumber(e, {
unit: "hour"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 0 && t <= 23
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCHours(r, 0, 0, 0),
e
}
}]),
r
}(Parser)
, Hour0To11Parser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 70),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["h", "H", "k", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "K":
return parseNumericPattern(numericPatterns.hour11h, e);
case "Ko":
return r.ordinalNumber(e, {
unit: "hour"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 0 && t <= 11
}
}, {
key: "set",
value: function(e, t, r) {
return e.getUTCHours() >= 12 && r < 12 ? e.setUTCHours(r + 12,
0, 0, 0) : e.setUTCHours(r, 0, 0, 0),
e
}
}]),
r
}(Parser)
, Hour1To24Parser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 70),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["a", "b", "h", "H", "K", "t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "k":
return parseNumericPattern(numericPatterns.hour24h, e);
case "ko":
return r.ordinalNumber(e, {
unit: "hour"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 1 && t <= 24
}
}, {
key: "set",
value: function(e, t, r) {
var n = r <= 24 ? r % 24 : r;
return e.setUTCHours(n, 0, 0, 0),
e
}
}]),
r
}(Parser)
, MinuteParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 60),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "m":
return parseNumericPattern(numericPatterns.minute, e);
case "mo":
return r.ordinalNumber(e, {
unit: "minute"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 0 && t <= 59
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCMinutes(r, 0, 0),
e
}
}]),
r
}(Parser)
, SecondParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 50),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t, r) {
switch (t) {
case "s":
return parseNumericPattern(numericPatterns.second, e);
case "so":
return r.ordinalNumber(e, {
unit: "second"
});
default:
return parseNDigits(t.length, e)
}
}
}, {
key: "validate",
value: function(e, t) {
return t >= 0 && t <= 59
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCSeconds(r, 0),
e
}
}]),
r
}(Parser)
, FractionOfSecondParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 30),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["t", "T"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t) {
return mapValue(parseNDigits(t.length, e), (function(e) {
return Math.floor(e * Math.pow(10, 3 - t.length))
}
))
}
}, {
key: "set",
value: function(e, t, r) {
return e.setUTCMilliseconds(r),
e
}
}]),
r
}(Parser)
, ISOTimezoneWithZParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 10),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["t", "T", "x"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t) {
switch (t) {
case "X":
return
parseTimezonePattern(timezonePatterns.basicOptionalMinutes, e);
case "XX":
return parseTimezonePattern(timezonePatterns.basic, e);
case "XXXX":
return
parseTimezonePattern(timezonePatterns.basicOptionalSeconds, e);
case "XXXXX":
return
parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, e);
default:
return parseTimezonePattern(timezonePatterns.extended, e)
}
}
}, {
key: "set",
value: function(e, t, r) {
return t.timestampIsSet ? e : new Date(e.getTime() - r)
}
}]),
r
}(Parser)
, ISOTimezoneParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 10),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
["t", "T", "X"]),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e, t) {
switch (t) {
case "x":
return
parseTimezonePattern(timezonePatterns.basicOptionalMinutes, e);
case "xx":
return parseTimezonePattern(timezonePatterns.basic, e);
case "xxxx":
return
parseTimezonePattern(timezonePatterns.basicOptionalSeconds, e);
case "xxxxx":
return
parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, e);
default:
return parseTimezonePattern(timezonePatterns.extended, e)
}
}
}, {
key: "set",
value: function(e, t, r) {
return t.timestampIsSet ? e : new Date(e.getTime() - r)
}
}]),
r
}(Parser)
, TimestampSecondsParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 40),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
"*"),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e) {
return parseAnyDigitsSigned(e)
}
}, {
key: "set",
value: function(e, t, r) {
return [new Date(1e3 * r), {
timestampIsSet: !0
}]
}
}]),
r
}(Parser)
, TimestampMillisecondsParser = function(e) {
_inherits$a(r, e);
var t = _createSuper(r);
function r() {
var e;
_classCallCheck$b(this, r);
for (var n = arguments.length, i = new Array(n), o = 0; o < n; o++)
i[o] = arguments[o];
return _defineProperty$3(_assertThisInitialized(e = t.call.apply(t,
[this].concat(i))), "priority", 20),
_defineProperty$3(_assertThisInitialized(e), "incompatibleTokens",
"*"),
e
}
return _createClass$9(r, [{
key: "parse",
value: function(e) {
return parseAnyDigitsSigned(e)
}
}, {
key: "set",
value: function(e, t, r) {
return [new Date(r), {
timestampIsSet: !0
}]
}
}]),
r
}(Parser)
, parsers = {
G: new EraParser,
y: new YearParser,
Y: new LocalWeekYearParser,
R: new ISOWeekYearParser,
u: new ExtendedYearParser,
Q: new QuarterParser,
q: new StandAloneQuarterParser,
M: new MonthParser,
L: new StandAloneMonthParser,
w: new LocalWeekParser,
I: new ISOWeekParser,
d: new DateParser,
D: new DayOfYearParser,
E: new DayParser,
e: new LocalDayParser,
c: new StandAloneLocalDayParser,
i: new ISODayParser,
a: new AMPMParser,
b: new AMPMMidnightParser,
B: new DayPeriodParser,
h: new Hour1to12Parser,
H: new Hour0to23Parser,
K: new Hour0To11Parser,
k: new Hour1To24Parser,
m: new MinuteParser,
s: new SecondParser,
S: new FractionOfSecondParser,
X: new ISOTimezoneWithZParser,
x: new ISOTimezoneParser,
t: new TimestampSecondsParser,
T: new TimestampMillisecondsParser
}
, formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+
('|$)|./g
, longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g
, escapedStringRegExp = /^'([^]*?)'?$/
, doubleQuoteRegExp = /''/g
, notWhitespaceRegExp = /\S/
, unescapedLatinCharacterRegExp = /[a-zA-Z]/;
function parse(e, t, r, n) {
var i, o, s, a, l, c, u, d, p, h, f, m, g, y, v, b, x, _;
requiredArgs$1(3, arguments);
var E = String(e)
, T = String(t)
, C = getDefaultOptions$1()
, S = null !== (i = null !== (o = null == n ? void 0 : n.locale) &&
void 0 !== o ? o : C.locale) && void 0 !== i ? i : defaultLocale$2;
if (!S.match)
throw new RangeError("locale must contain match property");
var $ = toInteger$6(null !== (s = null !== (a = null !== (l = null !==
(c = null == n ? void 0 : n.firstWeekContainsDate) && void 0 !== c ? c : null == n
|| null === (u = n.locale) || void 0 === u || null === (d = u.options) || void 0
=== d ? void 0 : d.firstWeekContainsDate) && void 0 !== l ? l :
C.firstWeekContainsDate) && void 0 !== a ? a : null === (p = C.locale) || void 0
=== p || null === (h = p.options) || void 0 === h ? void 0 :
h.firstWeekContainsDate) && void 0 !== s ? s : 1);
if (!($ >= 1 && $ <= 7))
throw new RangeError("firstWeekContainsDate must be between 1 and 7
inclusively");
var w = toInteger$6(null !== (f = null !== (m = null !== (g = null !==
(y = null == n ? void 0 : n.weekStartsOn) && void 0 !== y ? y : null == n || null
=== (v = n.locale) || void 0 === v || null === (b = v.options) || void 0 === b ?
void 0 : b.weekStartsOn) && void 0 !== g ? g : C.weekStartsOn) && void 0 !== m ?
m : null === (x = C.locale) || void 0 === x || null === (_ = x.options) || void 0
=== _ ? void 0 : _.weekStartsOn) && void 0 !== f ? f : 0);
if (!(w >= 0 && w <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6
inclusively");
if ("" === T)
return "" === E ? toDate$2(r) : new Date(NaN);
var P, R = {
firstWeekContainsDate: $,
weekStartsOn: w,
locale: S
}, k = [new DateToSystemTimezoneSetter], A =
T.match(longFormattingTokensRegExp).map((function(e) {
var t = e[0];
return t in longFormatters$2 ? (0,
longFormatters$2[t])(e, S.formatLong) : e
}
)).join("").match(formattingTokensRegExp), I = [], O =
_createForOfIteratorHelper(A);
try {
var D = function() {
var t = P.value;
null != n && n.useAdditionalWeekYearTokens || !
isProtectedWeekYearToken$1(t) || throwProtectedError$1(t, T, e),
null != n && n.useAdditionalDayOfYearTokens || !
isProtectedDayOfYearToken$1(t) || throwProtectedError$1(t, T, e);
var r = t[0]
, i = parsers[r];
if (i) {
var o = i.incompatibleTokens;
if (Array.isArray(o)) {
var s = I.find((function(e) {
return o.includes(e.token) || e.token === r
}
));
if (s)
throw new RangeError("The format string mustn't
contain `".concat(s.fullToken, "` and `").concat(t, "` at the same time"))
} else if ("*" === i.incompatibleTokens && I.length > 0)
throw new RangeError("The format string mustn't contain
`".concat(t, "` and any other token at the same time"));
I.push({
token: r,
fullToken: t
});
var a = i.run(E, t, S.match, R);
if (!a)
return {
v: new Date(NaN)
};
k.push(a.setter),
E = a.rest
} else {
if (r.match(unescapedLatinCharacterRegExp))
throw new RangeError("Format string contains an
unescaped latin alphabet character `" + r + "`");
if ("''" === t ? t = "'" : "'" === r && (t =
cleanEscapedString(t)),
0 !== E.indexOf(t))
return {
v: new Date(NaN)
};
E = E.slice(t.length)
}
};
for (O.s(); !(P = O.n()).done; ) {
var M = D();
if ("object" === _typeof$2(M))
return M.v
}
} catch (H) {
O.e(H)
} finally {
O.f()
}
if (E.length > 0 && notWhitespaceRegExp.test(E))
return new Date(NaN);
var L = k.map((function(e) {
return e.priority
}
)).sort((function(e, t) {
return t - e
}
)).filter((function(e, t, r) {
return r.indexOf(e) === t
}
)).map((function(e) {
return k.filter((function(t) {
return t.priority === e
}
)).sort((function(e, t) {
return t.subPriority - e.subPriority
}
))
}
)).map((function(e) {
return e[0]
}
))
, j = toDate$2(r);
if (isNaN(j.getTime()))
return new Date(NaN);
var F, N = subMilliseconds$1(j, getTimezoneOffsetInMilliseconds$1(j)),
B = {}, z = _createForOfIteratorHelper(L);
try {
for (z.s(); !(F = z.n()).done; ) {
var U = F.value;
if (!U.validate(N, R))
return new Date(NaN);
var V = U.set(N, B, R);
Array.isArray(V) ? (N = V[0],
assign$4(B, V[1])) : N = V
}
} catch (H) {
z.e(H)
} finally {
z.f()
}
return N
}
function cleanEscapedString(e) {
return e.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'")
}
function startOfSecond(e) {
requiredArgs$1(1, arguments);
var t = toDate$2(e);
return t.setMilliseconds(0),
t
}
function isSameSecond(e, t) {
requiredArgs$1(2, arguments);
var r = startOfSecond(e)
, n = startOfSecond(t);
return r.getTime() === n.getTime()
}
function isWithinInterval(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e).getTime()
, n = toDate$2(t.start).getTime()
, i = toDate$2(t.end).getTime();
if (!(n <= i))
throw new RangeError("Invalid interval");
return r >= n && r <= i
}
function parseISO(e, t) {
var r;
requiredArgs$1(1, arguments);
var n = toInteger$6(null !== (r = null == t ? void 0 :
t.additionalDigits) && void 0 !== r ? r : 2);
if (2 !== n && 1 !== n && 0 !== n)
throw new RangeError("additionalDigits must be 0, 1 or 2");
if ("string" != typeof e && "[object String]" !==
Object.prototype.toString.call(e))
return new Date(NaN);
var i, o = splitDateString(e);
if (o.date) {
var s = parseYear(o.date, n);
i = parseDate(s.restDateString, s.year)
}
if (!i || isNaN(i.getTime()))
return new Date(NaN);
var a, l = i.getTime(), c = 0;
if (o.time && (c = parseTime(o.time),
isNaN(c)))
return new Date(NaN);
if (!o.timezone) {
var u = new Date(l + c)
, d = new Date(0);
return d.setFullYear(u.getUTCFullYear(), u.getUTCMonth(),
u.getUTCDate()),
d.setHours(u.getUTCHours(), u.getUTCMinutes(), u.getUTCSeconds(),
u.getUTCMilliseconds()),
d
}
return a = parseTimezone(o.timezone),
isNaN(a) ? new Date(NaN) : new Date(l + c + a)
}
var patterns = {
dateTimeDelimiter: /[T ]/,
timeZoneDelimiter: /[Z ]/i,
timezone: /([Z+-].*)$/
}
, dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\
d{1}))?|)$/
, timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}
(?:[.,]\d*)?))?$/
, timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
function splitDateString(e) {
var t, r = {}, n = e.split(patterns.dateTimeDelimiter);
if (n.length > 2)
return r;
if (/:/.test(n[0]) ? t = n[0] : (r.date = n[0],
t = n[1],
patterns.timeZoneDelimiter.test(r.date) && (r.date =
e.split(patterns.timeZoneDelimiter)[0],
t = e.substr(r.date.length, e.length))),
t) {
var i = patterns.timezone.exec(t);
i ? (r.time = t.replace(i[1], ""),
r.timezone = i[1]) : r.time = t
}
return r
}
function parseYear(e, t) {
var r = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|
[+-]\\d{" + (2 + t) + "})$)")
, n = e.match(r);
if (!n)
return {
year: NaN,
restDateString: ""
};
var i = n[1] ? parseInt(n[1]) : null
, o = n[2] ? parseInt(n[2]) : null;
return {
year: null === o ? i : 100 * o,
restDateString: e.slice((n[1] || n[2]).length)
}
}
function parseDate(e, t) {
if (null === t)
return new Date(NaN);
var r = e.match(dateRegex);
if (!r)
return new Date(NaN);
var n = !!r[4]
, i = parseDateUnit(r[1])
, o = parseDateUnit(r[2]) - 1
, s = parseDateUnit(r[3])
, a = parseDateUnit(r[4])
, l = parseDateUnit(r[5]) - 1;
if (n)
return validateWeekDate(t, a, l) ? dayOfISOWeekYear(t, a, l) : new
Date(NaN);
var c = new Date(0);
return validateDate(t, o, s) && validateDayOfYearDate(t, i) ?
(c.setUTCFullYear(t, o, Math.max(i, s)),
c) : new Date(NaN)
}
function parseDateUnit(e) {
return e ? parseInt(e) : 1
}
function parseTime(e) {
var t = e.match(timeRegex);
if (!t)
return NaN;
var r = parseTimeUnit(t[1])
, n = parseTimeUnit(t[2])
, i = parseTimeUnit(t[3]);
return validateTime(r, n, i) ? r * millisecondsInHour + n *
millisecondsInMinute + 1e3 * i : NaN
}
function parseTimeUnit(e) {
return e && parseFloat(e.replace(",", ".")) || 0
}
function parseTimezone(e) {
if ("Z" === e)
return 0;
var t = e.match(timezoneRegex);
if (!t)
return 0;
var r = "+" === t[1] ? -1 : 1
, n = parseInt(t[2])
, i = t[3] && parseInt(t[3]) || 0;
return validateTimezone(n, i) ? r * (n * millisecondsInHour + i *
millisecondsInMinute) : NaN
}
function dayOfISOWeekYear(e, t, r) {
var n = new Date(0);
n.setUTCFullYear(e, 0, 4);
var i = 7 * (t - 1) + r + 1 - (n.getUTCDay() || 7);
return n.setUTCDate(n.getUTCDate() + i),
n
}
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function isLeapYearIndex(e) {
return e % 400 == 0 || e % 4 == 0 && e % 100 != 0
}
function validateDate(e, t, r) {
return t >= 0 && t <= 11 && r >= 1 && r <= (daysInMonths[t] ||
(isLeapYearIndex(e) ? 29 : 28))
}
function validateDayOfYearDate(e, t) {
return t >= 1 && t <= (isLeapYearIndex(e) ? 366 : 365)
}
function validateWeekDate(e, t, r) {
return t >= 1 && t <= 53 && r >= 0 && r <= 6
}
function validateTime(e, t, r) {
return 24 === e ? 0 === t && 0 === r : r >= 0 && r < 60 && t >= 0 && t
< 60 && e >= 0 && e < 25
}
function validateTimezone(e, t) {
return t >= 0 && t <= 59
}
function setMonth(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e)
, n = toInteger$6(t)
, i = r.getFullYear()
, o = r.getDate()
, s = new Date(0);
s.setFullYear(i, n, 15),
s.setHours(0, 0, 0, 0);
var a = getDaysInMonth(s);
return r.setMonth(n, Math.min(o, a)),
r
}
function set$1(e, t) {
if (requiredArgs$1(2, arguments),
"object" !== _typeof$2(t) || null === t)
throw new RangeError("values parameter must be an object");
var r = toDate$2(e);
return isNaN(r.getTime()) ? new Date(NaN) : (null != t.year &&
r.setFullYear(t.year),
null != t.month && (r = setMonth(r, t.month)),
null != t.date && r.setDate(toInteger$6(t.date)),
null != t.hours && r.setHours(toInteger$6(t.hours)),
null != t.minutes && r.setMinutes(toInteger$6(t.minutes)),
null != t.seconds && r.setSeconds(toInteger$6(t.seconds)),
null != t.milliseconds &&
r.setMilliseconds(toInteger$6(t.milliseconds)),
r)
}
function setYear(e, t) {
requiredArgs$1(2, arguments);
var r = toDate$2(e)
, n = toInteger$6(t);
return isNaN(r.getTime()) ? new Date(NaN) : (r.setFullYear(n),
r)
}
function subMonths(e, t) {
return requiredArgs$1(2, arguments),
addMonths(e, -toInteger$6(t))
}
function subYears(e, t) {
return requiredArgs$1(2, arguments),
addYears(e, -toInteger$6(t))
}
function isSameUTCWeek(e, t, r) {
requiredArgs$1(2, arguments);
var n = startOfUTCWeek$1(e, r)
, i = startOfUTCWeek$1(t, r);
return n.getTime() === i.getTime()
}
var formatDistanceLocale = {
lessThanXSeconds: {
one: "不到 1 秒",
other: "不到 {{count}} 秒"
},
xSeconds: {
one: "1 秒",
other: "{{count}} 秒"
},
halfAMinute: "半分钟",
lessThanXMinutes: {
one: "不到 1 分钟",
other: "不到 {{count}} 分钟"
},
xMinutes: {
one: "1 分钟",
other: "{{count}} 分钟"
},
xHours: {
one: "1 小时",
other: "{{count}} 小时"
},
aboutXHours: {
one: "大约 1 小时",
other: "大约 {{count}} 小时"
},
xDays: {
one: "1 天",
other: "{{count}} 天"
},
aboutXWeeks: {
one: "大约 1 个星期",
other: "大约 {{count}} 个星期"
},
xWeeks: {
one: "1 个星期",
other: "{{count}} 个星期"
},
aboutXMonths: {
one: "大约 1 个月",
other: "大约 {{count}} 个月"
},
xMonths: {
one: "1 个月",
other: "{{count}} 个月"
},
aboutXYears: {
one: "大约 1 年",
other: "大约 {{count}} 年"
},
xYears: {
one: "1 年",
other: "{{count}} 年"
},
overXYears: {
one: "超过 1 年",
other: "超过 {{count}} 年"
},
almostXYears: {
one: "将近 1 年",
other: "将近 {{count}} 年"
}
}
, formatDistance$1 = function(e, t, r) {
var n, i = formatDistanceLocale[e];
return n = "string" == typeof i ? i : 1 === t ? i.one :
i.other.replace("{{count}}", String(t)),
null != r && r.addSuffix ? r.comparison && r.comparison > 0 ? n + "内" :
n + "前" : n
};
const formatDistance$2 = formatDistance$1;
var dateFormats = {
full: "y'年'M'月'd'日' EEEE",
long: "y'年'M'月'd'日'",
medium: "yyyy-MM-dd",
short: "yy-MM-dd"
}
, timeFormats = {
full: "zzzz a h:mm:ss",
long: "z a h:mm:ss",
medium: "a h:mm:ss",
short: "a h:mm"
}
, dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}"
}
, formatLong$1 = {
date: buildFormatLongFn$1({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn$1({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn$1({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
const formatLong$2 = formatLong$1;
function checkWeek(e, t, r) {
var n = "eeee p";
return isSameUTCWeek(e, t, r) ? n : e.getTime() > t.getTime() ? "'下个'"
+ n : "'上个'" + n
}
var formatRelativeLocale = {
lastWeek: checkWeek,
yesterday: "'昨天' p",
today: "'今天' p",
tomorrow: "'明天' p",
nextWeek: checkWeek,
other: "PP p"
}
, formatRelative$1 = function(e, t, r, n) {
var i = formatRelativeLocale[e];
return "function" == typeof i ? i(t, r, n) : i
};
const formatRelative$2 = formatRelative$1;
var eraValues = {
narrow: ["前", "公元"],
abbreviated: ["前", "公元"],
wide: ["公元前", "公元"]
}
, quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["第一季", "第二季", "第三季", "第四季"],
wide: ["第一季度", "第二季度", "第三季度", "第四季度"]
}
, monthValues = {
narrow: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],
abbreviated: ["1 月", "2 月", "3 月", "4 月", "5 月", "6 月", "7 月", "8 月", "9 月",
"10 月", "11 月", "12 月"],
wide: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一
月", "十二月"]
}
, dayValues = {
narrow: ["日", "一", "二", "三", "四", "五", "六"],
short: ["日", "一", "二", "三", "四", "五", "六"],
abbreviated: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
wide: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
}
, dayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜"
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜间"
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜间"
}
}
, formattingDayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜"
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜间"
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜间"
}
}
, ordinalNumber = function(e, t) {
var r = Number(e);
switch (null == t ? void 0 : t.unit) {
case "date":
return r.toString() + "日";
case "hour":
return r.toString() + "时";
case "minute":
return r.toString() + "分";
case "second":
return r.toString() + "秒";
default:
return "第 " + r.toString()
}
}
, localize$1 = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn$1({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn$1({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function(e) {
return e - 1
}
}),
month: buildLocalizeFn$1({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn$1({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn$1({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
const localize$2 = localize$1;
var matchOrdinalNumberPattern = /^(第\s*)?\d+(日|时|分|秒)?/i
, parseOrdinalNumberPattern = /\d+/i
, matchEraPatterns = {
narrow: /^(前)/i,
abbreviated: /^(前)/i,
wide: /^(公元前|公元)/i
}
, parseEraPatterns = {
any: [/^(前)/i, /^(公元)/i]
}
, matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^第[一二三四]刻/i,
wide: /^第[一二三四]刻钟/i
}
, parseQuarterPatterns = {
any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i]
}
, matchMonthPatterns = {
narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i
}
, parseMonthPatterns = {
narrow: [/^一/i, /^二/i, /^三/i, /^四/i, /^五/i, /^六/i, /^七/i, /^八/i, /^九/i,
/^十(?!(一|二))/i, /^十一/i, /^十二/i],
any: [/^一|1/i, /^二|2/i, /^三|3/i, /^四|4/i, /^五|5/i, /^六|6/i, /^七|7/i, /^
八|8/i, /^九|9/i, /^十(?!(一|二))|10/i, /^十一|11/i, /^十二|12/i]
}
, matchDayPatterns = {
narrow: /^[一二三四五六日]/i,
short: /^[一二三四五六日]/i,
abbreviated: /^周[一二三四五六日]/i,
wide: /^星期[一二三四五六日]/i
}
, parseDayPatterns = {
any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i]
}
, matchDayPeriodPatterns = {
any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i
}
, parseDayPeriodPatterns = {
any: {
am: /^上午?/i,
pm: /^下午?/i,
midnight: /^午夜/i,
noon: /^[中正]午/i,
morning: /^早上/i,
afternoon: /^下午/i,
evening: /^晚上?/i,
night: /^凌晨/i
}
}
, match$1 = {
ordinalNumber: buildMatchPatternFn$1({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function(e) {
return parseInt(e, 10)
}
}),
era: buildMatchFn$1({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn$1({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function(e) {
return e + 1
}
}),
month: buildMatchFn$1({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn$1({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn$1({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
const match$2 = match$1;
var locale = {
code: "zh-CN",
formatDistance: formatDistance$2,
formatLong: formatLong$2,
formatRelative: formatRelative$2,
localize: localize$2,
match: match$2,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
const defaultLocale$1 = locale
, local = {
code: "zh-CN",
dateFnsLocale: defaultLocale$1,
Pagination: {
pageSize: "每页条数:${pageSize}",
total: "总页数:${total}",
jumpTo: "跳至",
page: "页"
},
Modal: {
confirm: "确定",
cancel: "取消"
},
Tabs: {
more: "更多"
},
TimePicker: {
placeholder: {
time: "请选择时间",
timeRange: "请选择时间范围"
},
begin: "开始时间",
end: "结束时间",
hour: "时",
minute: "分",
second: "秒",
AM: "上午",
PM: "下午"
},
DatePicker: {
placeholder: {
date: "请选择日期",
dateTime: "请选择日期及时间",
dateRange: ["开始日期", "结束日期"],
dateTimeRange: ["开始日期", "结束日期"],
monthRange: ["开始月份", "结束月份"]
},
presets: "快捷选择",
footer: {
confirm: "确定",
cancel: "取消"
},
selectDate: "返回选择日期",
selectTime: "选择时间",
year: "年",
month: "月",
day: "日",
monthText: "${year}年 ${month}",
months: {
1: "1 月",
2: "2 月",
3: "3 月",
4: "4 月",
5: "5 月",
6: "6 月",
7: "7 月",
8: "8 月",
9: "9 月",
10: "10 月",
11: "11 月",
12: "12 月"
},
fullMonths: {
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "10",
11: "11",
12: "12"
},
weeks: {
Mon: "一",
Tue: "二",
Wed: "三",
Thu: "四",
Fri: "五",
Sat: "六",
Sun: "日"
},
localeFormatToken: {
FORMAT_SWITCH_DATE: "yyyy-MM-dd"
}
},
Navigation: {
collapseText: "收起侧边栏",
expandText: "展开侧边栏"
},
Popconfirm: {
confirm: "确定",
cancel: "取消"
},
Table: {
emptyText: "暂无数据",
pageText: "显示第 ${currentStart} 条-第 ${currentEnd} 条,共 ${total} 条",
descend: "点击降序",
ascend: "点击升序",
cancelSort: "取消排序"
},
Select: {
emptyText: "暂无数据",
createText: "创建"
},
Cascader: {
emptyText: "暂无数据"
},
Tree: {
emptyText: "暂无数据",
searchPlaceholder: "搜索"
},
List: {
emptyText: "暂无数据"
},
Calendar: {
allDay: "全天",
AM: "上午${time}时",
PM: "下午${time}时",
datestring: "日",
remaining: "还有${remained}项"
},
Upload: {
mainText: "点击上传文件或拖拽文件到这里",
illegalTips: "不支持此类型文件",
legalTips: "松手开始上传",
retry: "重试",
replace: "替换文件",
clear: "清空",
selectedFiles: "已选择文件",
illegalSize: "文件尺寸不合法",
fail: "上传失败"
},
TreeSelect: {
searchPlaceholder: "搜索"
},
Typography: {
copy: "复制",
copied: "复制成功",
expand: "展开",
collapse: "收起"
},
Transfer: {
emptyLeft: "暂无数据",
emptySearch: "无搜索结果",
emptyRight: "暂无内容,可从左侧勾选",
placeholder: "搜索",
clear: "清空",
selectAll: "全选",
clearSelectAll: "取消全选",
total: "总个数:${total}",
selected: "已选个数:${total}"
},
Form: {
optional: "(可选)"
},
Image: {
preview: "预览",
loading: "加载中",
loadError: "加载失败",
prevTip: "上一张",
nextTip: "下一张",
zoomInTip: "放大",
zoomOutTip: "缩小",
rotateTip: "旋转",
downloadTip: "下载",
adaptiveTip: "适应页面",
originTip: "原始尺寸"
},
Chat: {
deleteConfirm: "确认删除该会话吗?",
clearContext: "上下文已清除",
copySuccess: "复制成功",
stop: "停止",
copy: "复制",
copied: "复制成功",
dropAreaText: "将文件放到这里"
}
}
, DefaultLocale = local;
class LocaleConsumer extends reactExports.Component {
renderChildren(e, t) {
const {componentName: r} = this.props;
let n = e;
(null == e ? void 0 : e.code) || (n = DefaultLocale);
const i = _get(DefaultLocale, "dateFnsLocale")
, o = _get(n, "dateFnsLocale", i);
return t(n[r], n.code, o)
}
render() {
const {children: e} = this.props;
return React.createElement(ConfigContext$1.Consumer, null, (t => {
let {locale: r} = t;
return React.createElement(LocaleContext$1.Consumer, null, (t
=> this.renderChildren(r || t, e)))
}
))
}
}
LocaleConsumer.propTypes = {
componentName: PropTypes.string.isRequired,
children: PropTypes.any
},
LocaleConsumer.defaultProps = {
componentName: ""
};
const BASE_CLASS_PREFIX = "semi"
, icons = "";
var __rest$W = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const Icon$1 = React.forwardRef(( (e, t) => {
const {svg: r, spin: n=!1, rotate: i, style: o, className: s,
prefixCls: a=BASE_CLASS_PREFIX, type: l, size: c="default"} = e
, u = __rest$W(e, ["svg", "spin", "rotate", "style", "className",
"prefixCls", "type", "size"])
, d = classNames(`${a}-icon`, {
[`${a}-icon-extra-small`]: "extra-small" === c,
[`${a}-icon-small`]: "small" === c,
[`${a}-icon-default`]: "default" === c,
[`${a}-icon-large`]: "large" === c,
[`${a}-icon-extra-large`]: "extra-large" === c,
[`${a}-icon-spinning`]: !0 === n,
[`${a}-icon-${l}`]: Boolean(l)
}, s)
, p = {};
return Number.isSafeInteger(i) && (p.transform = `rotate(${i}deg)`),
Object.assign(p, o),
React.createElement("span", Object.assign({
role: "img",
ref: t,
"aria-label": l,
className: d,
style: p
}, u), r)
}
));
Icon$1.elementType = "Icon";
const convertIcon = (e, t) => {
const r = React.forwardRef(( (r, n) => React.createElement(Icon$1,
Object.assign({
svg: React.createElement(e),
type: t,
ref: n
}, r))));
return r.elementType = "Icon",
r
}
;
function SvgComponent$C(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1
5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM13.5 17.5C13.5 16.6716 12.8284
16 12 16C11.1716 16 10.5 16.6716 10.5 17.5C10.5 18.3284 11.1716 19 12 19C12.8284 19
13.5 18.3284 13.5 17.5ZM12 5C10.9138 5 10.0507 5.91244 10.1109 6.99692L10.4168
12.5023C10.4635 13.3426 11.1584 14 12 14C12.8416 14 13.5365 13.3426 13.5832
12.5023L13.8891 6.99692C13.9493 5.91244 13.0862 5 12 5Z",
fill: "currentColor"
}))
}
const IconComponent$w = convertIcon(SvgComponent$C, "alert_circle")
, IconAlertCircle = IconComponent$w;
function SvgComponent$B(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M10.2268 2.3986L1.52616 19.0749C0.831449 20.4064 1.79747 22
3.29933 22H20.7007C22.2025 22 23.1686 20.4064 22.4739 19.0749L13.7732
2.3986C13.0254 0.965441 10.9746 0.965442 10.2268 2.3986ZM13.1415 14.0101C13.0603
14.5781 12.5739 15 12.0001 15C11.4263 15 10.9398 14.5781 10.8586 14.0101L10.2829
9.97992C10.1336 8.93495 10.9445 8.00002 12.0001 8.00002C13.0556 8.00002 13.8665
8.93495 13.7172 9.97992L13.1415 14.0101ZM13.5001 18.5C13.5001 19.3284 12.8285 20
12.0001 20C11.1716 20 10.5001 19.3284 10.5001 18.5C10.5001 17.6716 11.1716 17
12.0001 17C12.8285 17 13.5001 17.6716 13.5001 18.5Z",
fill: "currentColor"
}))
}
const IconComponent$v = convertIcon(SvgComponent$B, "alert_triangle")
, IconAlertTriangle = IconComponent$v;
function SvgComponent$A(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22
2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6
10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13
8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6
15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9
15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761
10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5
12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761
10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15
13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18
10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15
12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5
18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z",
fill: "currentColor"
}))
}
const IconComponent$u = convertIcon(SvgComponent$A, "calendar")
, IconCalendar = IconComponent$u;
function SvgComponent$z(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
d: "M2 5V19C2 20.6569 3.34315 22 5 22H12.101C11.5151 21.4259
11.0297 20.7496 10.6736 20H6C4.89543 20 4 19.1046 4 18V8C4 7.44772 4.44772 7 5
7H19C19.5523 7 20 7.44772 20 8V10.6736C20.7496 11.0297 21.4259 11.5151 22
12.101V5C22 3.34315 20.6569 2 19 2H5C3.34315 2 2 3.34315 2 5Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M16 10H17C16.4614 10 15.9369 10.0608 15.4332 10.176C15.5943
10.065 15.7896 10 16 10Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M13.4981 10.9376C13.4659 10.4144 13.0313 10 12.5
10H11.5C10.9477 10 10.5 10.4477 10.5 11V12C10.5 12.4742 10.83 12.8712 11.2729
12.9741C11.857 12.1446 12.6168 11.4478 13.4981 10.9376Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M7 10C6.44772 10 6 10.4477 6 11V12C6 12.5523 6.44772 13 7
13H8C8.55228 13 9 12.5523 9 12V11C9 10.4477 8.55228 10 8 10H7Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M6 16C6 15.4477 6.44772 15 7 15H8C8.55228 15 9 15.4477 9
16V17C9 17.5523 8.55228 18 8 18H7C6.44772 18 6 17.5523 6 17V16Z",
fill: "currentColor"
}), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M22 17C22 19.7614 19.7614 22 17 22C14.2386 22 12 19.7614 12
17C12 14.2386 14.2386 12 17 12C19.7614 12 22 14.2386 22 17ZM18 15C18 14.4477
17.5523 14 17 14C16.4477 14 16 14.4477 16 15V17C16 17.2652 16.1054 17.5196 16.2929
17.7071L17.7929 19.2071C18.1834 19.5976 18.8166 19.5976 19.2071 19.2071C19.5976
18.8166 19.5976 18.1834 19.2071 17.7929L18 16.5858V15Z",
fill: "currentColor"
}))
}
const IconComponent$t = convertIcon(SvgComponent$z, "calendar_clock")
, IconCalendarClock = IconComponent$t;
function SvgComponent$y(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
d: "M5 12.5C5 11.6716 5.67157 11 6.5 11H17.5C18.3284 11 19 11.6716
19 12.5C19 13.3284 18.3284 14 17.5 14H6.5C5.67157 14 5 13.3284 5 12.5Z",
fill: "currentColor"
}))
}
const IconComponent$s = convertIcon(SvgComponent$y,
"checkbox_indeterminate")
, IconCheckboxIndeterminate = IconComponent$s;
function SvgComponent$x(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M17.4111 7.30848C18.0692 7.81171 18.1947 8.75312 17.6915
9.41119L11.1915 17.9112C10.909 18.2806 10.4711 18.4981 10.0061 18.5C9.54105 18.5019
9.10143 18.288 8.81592 17.9209L5.31592 13.4209C4.80731 12.767 4.92512 11.8246
5.57904 11.316C6.23296 10.8074 7.17537 10.9252 7.68398 11.5791L9.98988
14.5438L15.3084 7.58884C15.8116 6.93077 16.7531 6.80525 17.4111 7.30848Z",
fill: "currentColor"
}))
}
const IconComponent$r = convertIcon(SvgComponent$x, "checkbox_tick")
, IconCheckboxTick = IconComponent$r;
function SvgComponent$w(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177
7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368
7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335
17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467
8.18388 4.08045 7.59809Z",
fill: "currentColor"
}))
}
const IconComponent$q = convertIcon(SvgComponent$w, "chevron_down")
, IconChevronDown = IconComponent$q;
function SvgComponent$v(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M16.2782 4.23933C16.864 4.82511 16.864 5.77486 16.2782
6.36065L10.6213 12.0175L16.2782 17.6744C16.864 18.2601 16.864 19.2099 16.2782
19.7957C15.6924 20.3815 14.7426 20.3815 14.1569 19.7957L7.43934 13.0782C6.85355
12.4924 6.85355 11.5426 7.43934 10.9568L14.1569 4.23933C14.7426 3.65354 15.6924
3.65354 16.2782 4.23933Z",
fill: "currentColor"
}))
}
const IconComponent$p = convertIcon(SvgComponent$v, "chevron_left")
, IconChevronLeft = IconComponent$p;
function SvgComponent$u(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M7.43934 19.7957C6.85355 19.2099 6.85355 18.2601 7.43934
17.6744L13.0962 12.0175L7.43934 6.36065C6.85355 5.77486 6.85355 4.82511 7.43934
4.23933C8.02513 3.65354 8.97487 3.65354 9.56066 4.23933L16.2782 10.9568C16.864
11.5426 16.864 12.4924 16.2782 13.0782L9.56066 19.7957C8.97487 20.3815 8.02513
20.3815 7.43934 19.7957Z",
fill: "currentColor"
}))
}
const IconComponent$o = convertIcon(SvgComponent$u, "chevron_right")
, IconChevronRight = IconComponent$o;
function SvgComponent$t(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M19.637 16.4369C19.0513 17.0227 18.1015 17.0227 17.5157
16.4369L11.8589 10.7801L6.20202 16.4369C5.61623 17.0227 4.66648 17.0227 4.0807
16.4369C3.49491 15.8511 3.49491 14.9014 4.0807 14.3156L10.7982 7.59809C11.384
7.01231 12.3337 7.01231 12.9195 7.59809L19.637 14.3156C20.2228 14.9014 20.2228
15.8511 19.637 16.4369Z",
fill: "currentColor"
}))
}
const IconComponent$n = convertIcon(SvgComponent$t, "chevron_up")
, IconChevronUp = IconComponent$n;
function SvgComponent$s(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12
1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17.0352 16.8626C16.4597
17.4585 15.5101 17.4751 14.9142 16.8996L12.0368 14.121L9.25822 16.9984C8.68274
17.5943 7.73314 17.6109 7.13722 17.0354C6.5413 16.4599 6.52472 15.5103 7.1002
14.9144L9.87883 12.037L7.00147 9.2584C6.40555 8.68293 6.38897 7.73332 6.96445
7.1374C7.53992 6.54148 8.48953 6.52491 9.08545 7.10038L11.9628 9.87901L14.7414
7.00165C15.3169 6.40573 16.2665 6.38916 16.8624 6.96463C17.4584 7.54011 17.4749
8.48971 16.8995 9.08563L14.1208 11.963L16.9982 14.7416C17.5941 15.3171 17.6107
16.2667 17.0352 16.8626Z",
fill: "currentColor"
}))
}
const IconComponent$m = convertIcon(SvgComponent$s, "clear")
, IconClear = IconComponent$m;
function SvgComponent$r(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12
1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM13.5 6.5V11.3787L17.0607
14.9393C17.6464 15.5251 17.6464 16.4749 17.0607 17.0607C16.4749 17.6464 15.5251
17.6464 14.9393 17.0607L10.9393 13.0607C10.658 12.7794 10.5 12.3978 10.5
12V6.5C10.5 5.67157 11.1716 5 12 5C12.8284 5 13.5 5.67157 13.5 6.5Z",
fill: "currentColor"
}))
}
const IconComponent$l = convertIcon(SvgComponent$r, "clock")
, IconClock = IconComponent$l;
function SvgComponent$q(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
d: "M17.6568 19.7782C18.2426 20.3639 19.1924 20.3639 19.7782
19.7782C20.3639 19.1924 20.3639 18.2426 19.7782 17.6568L14.1213 12L19.7782
6.34313C20.3639 5.75734 20.3639 4.8076 19.7782 4.22181C19.1924 3.63602 18.2426
3.63602 17.6568 4.22181L12 9.87866L6.34313 4.22181C5.75734 3.63602 4.8076 3.63602
4.22181 4.22181C3.63602 4.8076 3.63602 5.75734 4.22181 6.34313L9.87866 12L4.22181
17.6568C3.63602 18.2426 3.63602 19.1924 4.22181 19.7782C4.8076 20.3639 5.75734
20.3639 6.34313 19.7782L12 14.1213L17.6568 19.7782Z",
fill: "currentColor"
}))
}
const IconComponent$k = convertIcon(SvgComponent$q, "close")
, IconClose = IconComponent$k;
function SvgComponent$p(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
d: "M7 4C7 2.89543 7.89543 2 9 2H20C21.1046 2 22 2.89543 22 4V15C22
16.1046 21.1046 17 20 17H19V8C19 6 18 5 16 5H7V4Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M5 7C3.89543 7 3 7.89543 3 9V19C3 20.1046 3.89543 21 5
21H15C16.1046 21 17 20.1046 17 19V9C17 7.89543 16.1046 7 15 7H5Z",
fill: "currentColor"
}))
}
const IconComponent$j = convertIcon(SvgComponent$p, "copy")
, IconCopy = IconComponent$j;
function SvgComponent$o(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12.6185 4.39653C13.1272 4.92524 13.1272 5.78245 12.6185
6.31116L7.14483 12L12.6185 17.6888C13.1272 18.2176 13.1272 19.0748 12.6185
19.6035C12.1098 20.1322 11.285 20.1322 10.7763 19.6035L4.38153 12.9573C3.87282
12.4286 3.87282 11.5714 4.38153 11.0427L10.7763 4.39653C11.285 3.86782 12.1098
3.86782 12.6185 4.39653Z",
fill: "currentColor"
}), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M19.6185 4.39653C20.1272 4.92524 20.1272 5.78245 19.6185
6.31116L14.1448 12L19.6185 17.6888C20.1272 18.2176 20.1272 19.0748 19.6185
19.6035C19.1098 20.1322 18.285 20.1322 17.7763 19.6035L11.3815 12.9573C10.8728
12.4286 10.8728 11.5714 11.3815 11.0427L17.7763 4.39653C18.285 3.86782 19.1098
3.86782 19.6185 4.39653Z",
fill: "currentColor"
}))
}
const IconComponent$i = convertIcon(SvgComponent$o, "double_chevron_left")
, IconDoubleChevronLeft = IconComponent$i;
function SvgComponent$n(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M4.38153 4.39653C4.89024 3.86782 5.71502 3.86782 6.22373
4.39653L12.6185 11.0427C13.1272 11.5714 13.1272 12.4286 12.6185 12.9573L6.22373
19.6035C5.71502 20.1322 4.89024 20.1322 4.38153 19.6035C3.87282 19.0748 3.87282
18.2176 4.38153 17.6888L9.85517 12L4.38153 6.31116C3.87282 5.78245 3.87282 4.92524
4.38153 4.39653Z",
fill: "currentColor"
}), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M11.3815 4.39653C11.8902 3.86782 12.715 3.86782 13.2237
4.39653L19.6185 11.0427C20.1272 11.5714 20.1272 12.4286 19.6185 12.9573L13.2237
19.6035C12.715 20.1322 11.8902 20.1322 11.3815 19.6035C10.8728 19.0748 10.8728
18.2176 11.3815 17.6888L16.8552 12L11.3815 6.31116C10.8728 5.78245 10.8728 4.92524
11.3815 4.39653Z",
fill: "currentColor"
}))
}
const IconComponent$h = convertIcon(SvgComponent$n, "double_chevron_right")
, IconDoubleChevronRight = IconComponent$h;
function SvgComponent$m(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M21.7071 3.70711C22.0976 3.31658 22.0976 2.68342 21.7071
2.29289C21.3166 1.90237 20.6834 1.90237 20.2929 2.29289L17.3135 5.27233C15.8114
4.50566 14.0321 4 12 4C5 4 1 10 1 12C1 13.1757 2.38219 15.7335 4.94345
17.6423L2.29289 20.2929C1.90237 20.6834 1.90237 21.3166 2.29289 21.7071C2.68342
22.0976 3.31658 22.0976 3.70711 21.7071L21.7071 3.70711ZM7.8284 14.7574L9.29237
13.2934C9.10495 12.9018 9 12.4631 9 12C9 10.3431 10.3431 9 12 9C12.4631 9 12.9018
9.10495 13.2934 9.29237L14.7574 7.8284C13.967 7.30488 13.0191 7 12 7C9.23858 7 7
9.23858 7 12C7 13.0191 7.30488 13.967 7.8284 14.7574Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M12 20C10.7789 20 9.64914 19.8174 8.61594 19.5054L11.1871
16.9342C11.4516 16.9775 11.7232 17 12 17C14.7614 17 17 14.7614 17 12C17 11.7232
16.9775 11.4516 16.9342 11.1871L20.5032 7.61808C22.1342 9.27317 23 11.0695 23 12C23
14 19 20 12 20Z",
fill: "currentColor"
}))
}
const IconComponent$g = convertIcon(SvgComponent$m, "eye_closed_solid")
, IconEyeClosedSolid = IconComponent$g;
function SvgComponent$l(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 4C5 4 1 10 1 12C1 14 5 20 12 20C19 20 23 14 23 12C23 10 19
4 12 4ZM17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858
9.23858 7 12 7C14.7614 7 17 9.23858 17 12ZM12 15C13.6569 15 15 13.6569 15 12C15
10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",
fill: "currentColor"
}))
}
const IconComponent$f = convertIcon(SvgComponent$l, "eye_opened")
, IconEyeOpened = IconComponent$f;
function SvgComponent$k(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 2C12 1.44772 11.5523 1 11 1H6C4.89543 1 4 1.89543 4 3V21C4
22.1046 4.89543 23 6 23H18C19.1046 23 20 22.1046 20 21V10C20 9.44772 19.5523 9 19
9H14C12.8954 9 12 8.10457 12 7V2ZM7 8C7 7.44772 7.44772 7 8 7H9C9.55228 7 10
7.44772 10 8C10 8.55228 9.55228 9 9 9H8C7.44772 9 7 8.55228 7 8ZM7 13C7 12.4477
7.44772 12 8 12H16C16.5523 12 17 12.4477 17 13C17 13.5523 16.5523 14 16
14H8C7.44772 14 7 13.5523 7 13ZM8 17C7.44772 17 7 17.4477 7 18C7 18.5523 7.44772 19
8 19H16C16.5523 19 17 18.5523 17 18C17 17.4477 16.5523 17 16 17H8ZM19.0686
7.49999H14.5C13.9477 7.49999 13.5 7.05228 13.5 6.49999V1.93136C13.5 1.21864 14.3617
0.861707 14.8657 1.36568L19.6343 6.13431C20.1383 6.63828 19.7814 7.49999 19.0686
7.49999Z",
fill: "currentColor"
}))
}
const IconComponent$e = convertIcon(SvgComponent$k, "file")
, IconFile = IconComponent$e;
function SvgComponent$j(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
d: "M5 2C3.34315 2 2 3.34315 2 5V8H22C22 6 21 4 19
4H12.5523C11.8711 4 11.2102 3.76816 10.6783 3.34261L9.54783 2.43826C9.1932 2.15456
8.75258 2 8.29844 2H5Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M22 10H2V19C2 20.6569 3.34315 22 5 22H19C20.6569 22 22 20.6569
22 19V10Z",
fill: "currentColor"
}))
}
const IconComponent$d = convertIcon(SvgComponent$j, "folder")
, IconFolder = IconComponent$d;
function SvgComponent$i(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M2 5C2 3.34315 3.34315 2 5 2H8.29844C8.75258 2 9.1932 2.15456
9.54783 2.43826L10.6783 3.34261C11.2102 3.76816 11.8711 4 12.5523 4H18C20 4 21 6 21
8H7.53361C6.62889 8 5.83683 8.60735 5.6021 9.48109L2.57151 20.7617C2.21202 20.2671
2 19.6583 2 19V5ZM22.1667 10H9.5C8.61111 10 7.82889 10.5867 7.58 11.44L4.87333
20.72C4.68667 21.36 5.16667 22 5.83333 22H18.5C19.3889 22 20.1711 21.4133 20.42
20.56L23.1267 11.28C23.3133 10.64 22.8333 10 22.1667 10Z",
fill: "currentColor"
}))
}
const IconComponent$c = convertIcon(SvgComponent$i, "folder_open")
, IconFolderOpen = IconComponent$c;
function SvgComponent$h(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
d: "M9 7C10.1046 7 11 6.10457 11 5C11 3.89543 10.1046 3 9 3C7.89543
3 7 3.89543 7 5C7 6.10457 7.89543 7 9 7Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M9 14C10.1046 14 11 13.1046 11 12C11 10.8954 10.1046 10 9
10C7.89543 10 7 10.8954 7 12C7 13.1046 7.89543 14 9 14Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M11 19C11 20.1046 10.1046 21 9 21C7.89543 21 7 20.1046 7 19C7
17.8954 7.89543 17 9 17C10.1046 17 11 17.8954 11 19Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M15 7C16.1046 7 17 6.10457 17 5C17 3.89543 16.1046 3 15
3C13.8954 3 13 3.89543 13 5C13 6.10457 13.8954 7 15 7Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M17 12C17 13.1046 16.1046 14 15 14C13.8954 14 13 13.1046 13
12C13 10.8954 13.8954 10 15 10C16.1046 10 17 10.8954 17 12Z",
fill: "currentColor"
}), reactExports.createElement("path", {
d: "M15 21C16.1046 21 17 20.1046 17 19C17 17.8954 16.1046 17 15
17C13.8954 17 13 17.8954 13 19C13 20.1046 13.8954 21 15 21Z",
fill: "currentColor"
}))
}
const IconComponent$b = convertIcon(SvgComponent$h, "handle")
, IconHandle = IconComponent$b;
function SvgComponent$g(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12
1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM11.8281 14.6094C10.9688
14.6094 10.5391 14.0723 10.5391 13.3691C10.5391 12.3242 11.0566 11.6504 12.2676
10.7324C12.2894 10.7158 12.3111 10.6993 12.3326 10.6829C13.1573 10.0555 13.7324
9.61807 13.7324 8.82812C13.7324 7.93945 12.9023 7.42188 11.9746 7.42188C11.2129
7.42188 10.627 7.70508 10.168 8.30078C9.83594 8.64258 9.57227 8.82812 9.12305
8.82812C8.38086 8.82812 8 8.31055 8 7.71484C8 7.10938 8.3418 6.49414 8.87891
6.02539C9.60156 5.40039 10.7539 5 12.2773 5C14.9922 5 16.8965 6.33789 16.8965
8.64258C16.8965 10.3223 15.8906 11.1328 14.709 11.9531C13.9082 12.5391 13.5273
12.8809 13.2246 13.5742L13.2238 13.5756C12.8922 14.1609 12.638 14.6094 11.8281
14.6094ZM11.8086 18.7695C10.8711 18.7695 10.0996 18.1641 10.0996 17.2266C10.0996
16.2891 10.8711 15.6836 11.8086 15.6836C12.7461 15.6836 13.5078 16.2891 13.5078
17.2266C13.5078 18.1641 12.7461 18.7695 11.8086 18.7695Z",
fill: "currentColor"
}))
}
const IconComponent$a = convertIcon(SvgComponent$g, "help_circle")
, IconHelpCircle = IconComponent$a;
function SvgComponent$f(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12
1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM14 7C14 8.10457 13.1046 9 12
9C10.8954 9 10 8.10457 10 7C10 5.89543 10.8954 5 12 5C13.1046 5 14 5.89543 14 7ZM9
10.75C9 10.3358 9.33579 10 9.75 10H12.5C13.0523 10 13.5 10.4477 13.5
11V16.5H14.25C14.6642 16.5 15 16.8358 15 17.25C15 17.6642 14.6642 18 14.25
18H9.75C9.33579 18 9 17.6642 9 17.25C9 16.8358 9.33579 16.5 9.75
16.5H10.5V11.5H9.75C9.33579 11.5 9 11.1642 9 10.75Z",
fill: "currentColor"
}))
}
const IconComponent$9 = convertIcon(SvgComponent$f, "info_circle")
, IconInfoCircle = IconComponent$9;
function SvgComponent$e(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("circle", {
cx: 12,
cy: 12,
r: 5,
fill: "currentColor"
}))
}
const IconComponent$8 = convertIcon(SvgComponent$e, "radio")
, IconRadio = IconComponent$8;
function SvgComponent$d(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M4.49993 11.9998C4.49993 7.85775 7.85775 4.49993 11.9998
4.49993C14.6403 4.49993 16.9645 5.86506 18.3012 7.9305L16.2939 7.52902C15.4815
7.36656 14.6913 7.89337 14.5288 8.7057C14.3664 9.51803 14.8932 10.3083 15.7055
10.4707L20.7055 11.4707C21.4643 11.6225 22.214 11.1721 22.4363 10.4309L23.9363
5.43095C24.1744 4.63747 23.7241 3.80126 22.9307 3.56321C22.1372 3.32517 21.301
3.77543 21.0629 4.56891L20.6287 6.01635C18.7332 3.28781 15.5765 1.49998 11.9998
1.49998C6.20092 1.49998 1.49998 6.20092 1.49998 11.9998C1.49998 17.7987 6.20092
22.4997 11.9998 22.4997C16.5739 22.4997 20.4611 19.5757 21.9018 15.4996C22.1779
14.7186 21.7685 13.8616 20.9874 13.5855C20.2064 13.3095 19.3494 13.7189 19.0733
14.4999C18.0431 17.4149 15.263 19.4997 11.9998 19.4997C7.85775 19.4997 4.49993
16.1419 4.49993 11.9998Z",
fill: "currentColor"
}))
}
const IconComponent$7 = convertIcon(SvgComponent$d, "refresh")
, IconRefresh = IconComponent$7;
function SvgComponent$c(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M10.5 2C5.80558 2 2 5.80558 2 10.5C2 15.1944 5.80558 19 10.5
19C12.3054 19 13.9794 18.4371 15.356 17.4773L19.4393 21.5606C20.0251 22.1464
20.9749 22.1464 21.5606 21.5606C22.1464 20.9749 22.1464 20.0251 21.5606
19.4393L17.4773 15.356C18.4371 13.9794 19 12.3054 19 10.5C19 5.80558 15.1944 2 10.5
2ZM5 10.5C5 7.46243 7.46243 5 10.5 5C13.5376 5 16 7.46243 16 10.5C16 13.5376
13.5376 16 10.5 16C7.46243 16 5 13.5376 5 10.5Z",
fill: "currentColor"
}))
}
const IconComponent$6 = convertIcon(SvgComponent$c, "search")
, IconSearch$1 = IconComponent$6;
function SvgComponent$b(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("g", {
clipPath: "url(#clip_spin)"
}, reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M14.2 3.78966C9.66551 2.57466 5.00465 5.26561 3.78964
9.80007C3.12066 12.2967 3.63433 14.8301 4.99177 16.8102C5.46019 17.4935 5.28601
18.4271 4.60273 18.8955C3.91945 19.364 2.98581 19.1898 2.51739 18.5065C0.685557
15.8344 -0.0134454 12.4023 0.891867 9.02361C2.5357 2.88875 8.84157 -0.751945
14.9764 0.891885C21.1113 2.53572 24.752 8.84159 23.1082 14.9765C22.8937 15.7767
22.0712 16.2515 21.271 16.0371C20.4708 15.8227 19.996 15.0002 20.2104 14.2C21.4254
9.66553 18.7344 5.00467 14.2 3.78966Z",
fill: "url(#paint0_angular)"
})), reactExports.createElement("defs", null,
reactExports.createElement("radialGradient", {
id: "paint0_angular",
cx: 0,
cy: 0,
r: 1,
gradientUnits: "userSpaceOnUse",
gradientTransform: "translate(12 12) rotate(15) scale(9.5 9.51825)"
}, reactExports.createElement("stop", null),
reactExports.createElement("stop", {
offset: .301257,
stopOpacity: 0,
stopColor: "currentColor"
}), reactExports.createElement("stop", {
offset: .466753,
stopOpacity: 1,
stopColor: "currentColor"
})), reactExports.createElement("clipPath", {
id: "clip_spin"
}, reactExports.createElement("rect", {
width: 24,
height: 24,
fill: "currentColor"
}))))
}
const IconComponent$5 = convertIcon(SvgComponent$b, "spin")
, IconSpin = IconComponent$5;
function SvgComponent$a(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
d: "M10.7525 1.90411C11.1451 0.698628 12.8549 0.698631 13.2475
1.90411L15.2395 8.01946H21.6858C22.9565 8.01946 23.4848 9.64143 22.4568
10.3865L17.2417 14.1659L19.2337 20.2813C19.6263 21.4868 18.2431 22.4892 17.2151
21.7442L12 17.9647L6.78489 21.7442C5.75687 22.4892 4.37368 21.4868 4.76635
20.2813L6.75834 14.1659L1.54323 10.3865C0.515206 9.64142 1.04354 8.01946 2.31425
8.01946H8.76048L10.7525 1.90411Z",
fill: "currentColor"
}))
}
const IconComponent$4 = convertIcon(SvgComponent$a, "star")
, IconStar = IconComponent$4;
function SvgComponent$9(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M21.3516 4.2652C22.0336 4.73552 22.2052 5.66964 21.7348
6.35162L11.7348 20.8516C11.4765 21.2262 11.0622 21.4632 10.6084 21.4961C10.1546
21.529 9.71041 21.3541 9.40082 21.0207L2.90082 14.0207C2.33711 13.4136 2.37226
12.4645 2.97933 11.9008C3.5864 11.3371 4.53549 11.3723 5.0992 11.9793L10.3268
17.6091L19.2652 4.64842C19.7355 3.96644 20.6696 3.79487 21.3516 4.2652Z",
fill: "currentColor"
}))
}
const IconComponent$3 = convertIcon(SvgComponent$9, "tick")
, IconTick = IconComponent$3;
function SvgComponent$8(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12
1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17.8831 9.82235L11.6854
17.4112C11.4029 17.7806 10.965 17.9981 10.5 18C10.035 18.0019 9.59533 17.788
9.30982 17.421L5.81604 13.4209C5.30744 12.767 5.42524 11.8246 6.07916
11.316C6.73308 10.8074 7.67549 10.9252 8.1841 11.5791L10.4838 14.0439L15.5
8C16.0032 7.34193 16.9446 7.21641 17.6027 7.71964C18.2608 8.22287 18.3863 9.16428
17.8831 9.82235Z",
fill: "currentColor"
}))
}
const IconComponent$2 = convertIcon(SvgComponent$8, "tick_circle")
, IconTickCircle = IconComponent$2;
function SvgComponent$7(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
d: "M20.5598 9.65618L12.7546 18.6322C12.3559 19.0906 11.644 19.0906
11.2453 18.6322L3.4401 9.65618C2.8773 9.00895 3.33701 8 4.19471 8L19.8052 8C20.6629
8 21.1226 9.00895 20.5598 9.65618Z",
fill: "currentColor"
}))
}
const IconComponent$1 = convertIcon(SvgComponent$7, "tree_triangle_down")
, IconTreeTriangleDown = IconComponent$1;
function SvgComponent$6(e) {
return reactExports.createElement("svg", Object.assign({
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
width: "1em",
height: "1em",
focusable: !1,
"aria-hidden": !0
}, e), reactExports.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M17.8395 8.05827C17.1837 5.16226 14.5944 3 11.5 3C7.91015 3 5
5.91015 5 9.5C5 10.0204 5.06115 10.5264 5.17665 11.0114C2.84229 11.1772 1 13.1234 1
15.5C1 17.9853 3.01469 20 5.49995 20H17C20.3137 20 23 17.3137 23 14C23 10.9712
20.7558 8.46659 17.8395 8.05827ZM12.3201 8.26674C12.1347 8.11222 11.8653 8.11222
11.6799 8.26674L6.53047 12.5579C6.35084 12.7076 6.45669 13 6.69051 13H10V17.5C10
17.7761 10.2239 18 10.5 18H13.5C13.7761 18 14 17.7761 14 17.5V13H17.3095C17.5433 13
17.6492 12.7076 17.4695 12.5579L12.3201 8.26674Z",
fill: "currentColor"
}))
}
const IconComponent = convertIcon(SvgComponent$6, "upload")
, IconUpload = IconComponent
, keyCode = {
MAC_ENTER: 3,
BACKSPACE: 8,
TAB: 9,
NUM_CENTER: 12,
ENTER: 13,
SHIFT: 16,
CTRL: 17,
ALT: 18,
PAUSE: 19,
CAPS_LOCK: 20,
ESC: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
PRINT_SCREEN: 44,
INSERT: 45,
DELETE: 46,
ZERO: 48,
ONE: 49,
TWO: 50,
THREE: 51,
FOUR: 52,
FIVE: 53,
SIX: 54,
SEVEN: 55,
EIGHT: 56,
NINE: 57,
QUESTION_MARK: 63,
A: 65,
B: 66,
C: 67,
D: 68,
E: 69,
F: 70,
G: 71,
H: 72,
I: 73,
J: 74,
K: 75,
L: 76,
M: 77,
N: 78,
O: 79,
P: 80,
Q: 81,
R: 82,
S: 83,
T: 84,
U: 85,
V: 86,
W: 87,
X: 88,
Y: 89,
Z: 90,
META: 91,
WIN_KEY_RIGHT: 92,
CONTEXT_MENU: 93,
NUM_ZERO: 96,
NUM_ONE: 97,
NUM_TWO: 98,
NUM_THREE: 99,
NUM_FOUR: 100,
NUM_FIVE: 101,
NUM_SIX: 102,
NUM_SEVEN: 103,
NUM_EIGHT: 104,
NUM_NINE: 105,
NUM_MULTIPLY: 106,
NUM_PLUS: 107,
NUM_MINUS: 109,
NUM_PERIOD: 110,
NUM_DIVISION: 111,
F1: 112,
F2: 113,
F3: 114,
F4: 115,
F5: 116,
F6: 117,
F7: 118,
F8: 119,
F9: 120,
F10: 121,
F11: 122,
F12: 123,
NUMLOCK: 144,
SEMICOLON: 186,
DASH: 189,
EQUALS: 187,
COMMA: 188,
PERIOD: 190,
SLASH: 191,
APOSTROPHE: 192,
SINGLE_QUOTE: 222,
OPEN_SQUARE_BRACKET: 219,
BACKSLASH: 220,
CLOSE_SQUARE_BRACKET: 221,
WIN_KEY: 224,
MAC_FF_META: 224,
WIN_IME: 229
}
, ENTER_KEY = "Enter"
, ESC_KEY = "Escape"
, KeyCode = keyCode;
function isEnterPress(e) {
return _get(e, "key") === ENTER_KEY
}
const prefixCls$v = cssClasses$y.PREFIX;
class Copyable extends React.PureComponent {
constructor(e) {
super(e),
this.copy = e => {
const {content: t, duration: r, onCopy: n} = this.props
, i = copy(t);
n && n(e, t, i),
this.setCopied(t, r)
}
,
this.setCopied = (e, t) => {
this.setState({
copied: !0,
item: e
}),
this._timeId = setTimeout(( () => {
this.resetCopied()
}
), 1e3 * t)
}
,
this.resetCopied = () => {
this._timeId && (clearTimeout(this._timeId),
this._timeId = null,
this.setState({
copied: !1,
item: ""
}))
}
,
this.renderSuccessTip = () => {
const {successTip: e} = this.props;
return void 0 !== e ? e : React.createElement(LocaleConsumer, {
componentName: "Typography"
}, (e => React.createElement("span", null,
React.createElement(IconTick, null), e.copied)))
}
,
this.renderCopyIcon = () => {
const {icon: e} = this.props
, t = {
role: "button",
tabIndex: 0,
onClick: this.copy,
onKeyPress: e => isEnterPress(e) && this.copy(e)
}
, r = React.createElement("a", {
className: `${prefixCls$v}-action-copy-icon`
}, React.createElement(IconCopy, Object.assign({
onClick: this.copy
}, t)));
return React.isValidElement(e) ? React.cloneElement(e, t) : r
}
,
this.state = {
copied: !1,
item: ""
}
}
componentWillUnmount() {
this._timeId && (clearTimeout(this._timeId),
this._timeId = null)
}
render() {
const {style: e, className: t, forwardRef: r, copyTip: n, render:
i} = this.props
, {copied: o} = this.state
, s = classNames(t, {
[`${prefixCls$v}-action-copy`]: !o,
[`${prefixCls$v}-action-copied`]: o
});
return i ? i(o, this.copy, this.props) :
React.createElement(LocaleConsumer, {
componentName: "Typography"
}, (t => React.createElement("span", {
style: Object.assign({
marginLeft: "4px"
}, e),
className: s,
ref: r
}, o ? this.renderSuccessTip() : React.createElement(Tooltip, {
content: void 0 !== n ? n : t.copy
}, this.renderCopyIcon()))))
}
}
Copyable.propTypes = {
content: PropTypes.string,
onCopy: PropTypes.func,
successTip: PropTypes.node,
copyTip: PropTypes.node,
duration: PropTypes.number,
style: PropTypes.object,
className: PropTypes.string,
icon: PropTypes.node
},
Copyable.defaultProps = {
content: "",
onCopy: noop$2,
duration: 3,
style: {},
className: ""
};
const Copyable$1 = Copyable
, cssClasses$w = {
PREFIX: `${BASE_CLASS_PREFIX$1}-popover`,
ARROW: `${BASE_CLASS_PREFIX$1}-popover-icon-arrow`
}
, strings$s = {
POSITION_SET: ["top", "topLeft", "topRight", "left", "leftTop",
"leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft",
"bottomRight", "leftTopOver", "rightTopOver"],
TRIGGER_SET: ["hover", "focus", "click", "custom", "contextMenu"],
DEFAULT_ARROW_STYLE: {
borderOpacity: "1",
backgroundColor: "var(--semi-color-bg-3)",
borderColor: "var(--semi-color-border)"
}
}
, numbers$a = {
ARROW_BOUNDING: Object.assign(Object.assign({},
numbers$b.ARROW_BOUNDING), {
offsetY: 6,
offsetX: 0,
height: 8
}),
SPACING: 4,
SPACING_WITH_ARROW: 10,
DEFAULT_Z_INDEX: 1030
};
var __rest$V = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const Arrow = function() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {};
const {position: t="", className: r, arrowStyle: n, popStyle: i} = e
, o = __rest$V(e, ["position", "className", "arrowStyle",
"popStyle"])
, s = 0 === t.indexOf("top") || 0 === t.indexOf("bottom")
, a = classNames(r, cssClasses$w.ARROW)
, l = _get(n, "borderOpacity",
strings$s.DEFAULT_ARROW_STYLE.borderOpacity)
, c = _get(n, "backgroundColor", _get(i, "backgroundColor",
strings$s.DEFAULT_ARROW_STYLE.backgroundColor))
, u = _get(n, "borderColor", _get(i, "borderColor",
strings$s.DEFAULT_ARROW_STYLE.borderColor))
, d = Object.assign(Object.assign({}, o), {
width: numbers$a.ARROW_BOUNDING.width,
height: numbers$a.ARROW_BOUNDING.height,
xmlns: "http://www.w3.org/2000/svg",
className: a
});
return s ? React.createElement("svg", Object.assign({}, d),
React.createElement("path", {
d: "M0 0.5L0 1.5C4 1.5, 5.5 3, 7.5 5S10,8 12,8S14.5 7, 16.5
5S20,1.5 24,1.5L24 0.5L0 0.5z",
fill: u,
opacity: l
}), React.createElement("path", {
d: "M0 0L0 1C4 1, 5.5 2, 7.5 4S10,7 12,7S14.5 6, 16.5 4S20,1
24,1L24 0L0 0z",
fill: c
})) : React.createElement("svg", Object.assign({}, d),
React.createElement("path", {
d: "M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5
16.5S1.5,20 1.5,24L0.5 24L0.5 0z",
fill: u,
opacity: l
}), React.createElement("path", {
d: "M0 0L1 0C1 4, 2 5.5, 4 7.5S7,10 7,12S6 14.5, 4 16.5S1,20 1,24L0
24L0 0z",
fill: c
}))
};
Arrow.propTypes = {
position: PropTypes.string,
className: PropTypes.string,
arrowStyle: PropTypes.object,
popStyle: PropTypes.object
};
const Arrow$1 = Arrow
, popover = "";
var __rest$U = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const positionSet$2 = strings$s.POSITION_SET
, triggerSet$1 = strings$s.TRIGGER_SET;
class Popover extends React.PureComponent {
constructor(e) {
super(e),
this.focusTrigger = () => {
var e;
null === (e = this.tooltipRef.current) || void 0 === e ||
e.focusTrigger()
}
,
this.renderPopCard = e => {
let {initialFocusRef: t} = e;
const {content: r, contentClassName: n, prefixCls: i} =
this.props
, {direction: o} = this.context
, s = classNames(i, n, {
[`${i}-rtl`]: "rtl" === o
})
, a = this.renderContentNode({
initialFocusRef: t,
content: r
});
return React.createElement("div", {
className: s
}, React.createElement("div", {
className: `${i}-content`
}, a))
}
,
this.renderContentNode = e => {
const {initialFocusRef: t, content: r} = e
, n = {
initialFocusRef: t
};
return _isFunction(r) ? r(n) : r
}
,
this.tooltipRef = React.createRef()
}
render() {
const e = this.props
, {children: t, prefixCls: r, showArrow: n, arrowStyle: i={},
arrowBounding: o, position: s, style: a, trigger: l} = e
, c = __rest$U(e, ["children", "prefixCls", "showArrow",
"arrowStyle", "arrowBounding", "position", "style", "trigger"]);
let {spacing: u} = this.props;
const d = {
position: s,
className: "",
popStyle: a,
arrowStyle: i
}
, p = !!n && React.createElement(Arrow$1, Object.assign({}, d));
isNullOrUndefined(u) && (u = n ? numbers$a.SPACING_WITH_ARROW :
numbers$a.SPACING);
const h = "click" === l || "custom" === l ? "dialog" : "tooltip";
return React.createElement(Tooltip, Object.assign({
guardFocus: !0,
ref: this.tooltipRef
}, c, {
trigger: l,
position: s,
style: a,
content: this.renderPopCard,
prefixCls: r,
spacing: u,
showArrow: p,
arrowBounding: o,
role: h
}), t)
}
}
Popover.contextType = ConfigContext$1,
Popover.propTypes = {
children: PropTypes.node,
content: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
visible: PropTypes.bool,
autoAdjustOverflow: PropTypes.bool,
motion: PropTypes.bool,
position: PropTypes.oneOf(positionSet$2),
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
mouseEnterDelay: PropTypes.number,
mouseLeaveDelay: PropTypes.number,
trigger: PropTypes.oneOf(triggerSet$1).isRequired,
contentClassName: PropTypes.oneOfType([PropTypes.string,
PropTypes.array]),
onVisibleChange: PropTypes.func,
onClickOutSide: PropTypes.func,
style: PropTypes.object,
spacing: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
zIndex: PropTypes.number,
showArrow: PropTypes.bool,
arrowStyle: PropTypes.shape({
borderColor: PropTypes.string,
backgroundColor: PropTypes.string,
borderOpacity: PropTypes.oneOfType([PropTypes.string,
PropTypes.number])
}),
arrowPointAtCenter: PropTypes.bool,
arrowBounding: PropTypes.object,
prefixCls: PropTypes.string,
guardFocus: PropTypes.bool,
disableArrowKeyDown: PropTypes.bool
},
Popover.__SemiComponentName__ = "Popover",
Popover.defaultProps =
getDefaultPropsFromGlobalConfig(Popover.__SemiComponentName__, {
arrowBounding: numbers$a.ARROW_BOUNDING,
showArrow: !1,
autoAdjustOverflow: !0,
zIndex: numbers$a.DEFAULT_Z_INDEX,
motion: !0,
trigger: "hover",
cancelText: "No",
okText: "Yes",
position: "bottom",
prefixCls: cssClasses$w.PREFIX,
onClickOutSide: _noop,
onEscKeyDown: _noop,
closeOnEsc: !0,
returnFocusOnClose: !0,
guardFocus: !0,
disableFocusListener: !0
});
const Popover$1 = Popover;
let ellipsisContainer;
function pxToNumber(e) {
if (!e)
return 0;
const t = e.match(/^\d*(\.\d*)?/);
return t ? Number(t[0]) : 0
}
function styleToString(e) {
return Array.prototype.slice.apply(e).map((t => `${t}: $
{e.getPropertyValue(t)};`)).join("")
}
const getRenderText = function(e, t) {
let r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : ""
, n = arguments.length > 3 ? arguments[3] : void 0
, i = arguments.length > 4 ? arguments[4] : void 0
, o = arguments.length > 5 ? arguments[5] : void 0
, s = arguments.length > 6 ? arguments[6] : void 0;
if (0 === r.length)
return "";
ellipsisContainer || (ellipsisContainer =
document.createElement("div"),
ellipsisContainer.setAttribute("aria-hidden", "true"),
document.body.appendChild(ellipsisContainer));
const a = window.getComputedStyle(e)
, l = styleToString(a)
, c = pxToNumber(a.lineHeight)
, u = Math.round(c * (t + 1) + pxToNumber(a.paddingTop) +
pxToNumber(a.paddingBottom));
function d() {
const e = ellipsisContainer.scrollWidth <=
ellipsisContainer.offsetWidth
, r = ellipsisContainer.scrollHeight < u;
return 1 === t ? e && r : r
}
ellipsisContainer.setAttribute("style", l),
ellipsisContainer.style.position = "fixed",
ellipsisContainer.style.left = "0",
ellipsisContainer.style.height = "auto",
ellipsisContainer.style.top = "-999999px",
ellipsisContainer.style.zIndex = "-1000",
ellipsisContainer.style.textOverflow = "clip",
ellipsisContainer.style.webkitLineClamp = "none",
ReactDOM.render(React.createElement(React.Fragment, null),
ellipsisContainer);
const p = document.createElement("span")
, h = document.createTextNode(r);
if (p.appendChild(h),
o.length > 0) {
const e = document.createTextNode(o);
p.appendChild(e)
}
function f(e, t) {
const r = e.length;
return t ? "end" === s ? e.slice(0, t) + i : e.slice(0, t) + i +
e.slice(r - t, r) : i
}
ellipsisContainer.appendChild(p),
Object.values(_omit(n, "expand")).map((e => e &&
ellipsisContainer.appendChild(e.cloneNode(!0))));
let m = r;
return d() || (ellipsisContainer.innerHTML = "",
ellipsisContainer.appendChild(p),
Object.values(n).map((e => e &&
ellipsisContainer.appendChild(e.cloneNode(!0)))),
m = function e(t, r) {
let n = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : 0
, o = arguments.length > 3 && void 0 !== arguments[3] ?
arguments[3] : r.length
, s = arguments.length > 4 && void 0 !== arguments[4] ?
arguments[4] : 0;
const a = Math.floor((n + o) / 2)
, l = f(r, a);
if (t.textContent = l,
n >= o - 1 && o > 0)
for (let i = o; i >= n; i -= 1) {
const e = f(r, i);
if (t.textContent = e,
d())
return e
}
else if (0 === o)
return i;
return d() ? e(t, r, a, o, a) : e(t, r, n, a, s)
}(h, r, 0, "middle" === s ? Math.floor(r.length / 2) : r.length)),
ellipsisContainer.innerHTML = "",
m
}
, getRenderText$1 = getRenderText
, SizeContext = React.createContext("normal")
, SizeContext$1 = SizeContext;
var ObserverProperty, ObserverProperty2;
ObserverProperty2 = ObserverProperty || (ObserverProperty = {}),
ObserverProperty2.Width = "width",
ObserverProperty2.Height = "height",
ObserverProperty2.All = "all";
class ReactResizeObserver extends BaseComponent {
constructor(e) {
var t;
super(e),
t = this,
this.formerPropertyValue = new Map,
this.getElement = () => {
try {
return reactDomExports.findDOMNode(this.childNode || this)
} catch (e) {
return null
}
}
,
this.handleResizeEventTriggered = e => {
var t, r, n, i;
if (this.props.observerProperty === ObserverProperty.All)
null === (r = (t = this.props).onResize) || void 0 === r ||
r.call(t, e);
else {
const t = [];
for (const r of e)
this.formerPropertyValue.has(r.target) ?
r.contentRect[this.props.observerProperty] !==
this.formerPropertyValue.get(r.target) && (this.formerPropertyValue.set(r.target,
r.contentRect[this.props.observerProperty]),
t.push(r)) : (this.formerPropertyValue.set(r.target,
r.contentRect[this.props.observerProperty]),
t.push(r));
t.length > 0 && (null === (i = (n = this.props).onResize)
|| void 0 === i || i.call(n, t))
}
}
,
this.observeElement = function() {
let e = arguments.length > 0 && void 0 !== arguments[0] &&
arguments[0];
const r = t.getElement();
t.observer || (t.observer = new
ResizeObserver(t.handleResizeEventTriggered)),
r && r instanceof Element ? (r !== t.element || e) &&
(t.observer.disconnect(),
t.element = r,
t.observer.observe(r),
t.props.observeParent && r.parentNode &&
r.parentNode.ownerDocument && r.parentNode.ownerDocument.defaultView &&
r.parentNode instanceof r.parentNode.ownerDocument.defaultView.HTMLElement &&
(t._parentNode = r.parentNode,
t.observer.observe(t._parentNode))) : t.observer.disconnect()
}
,
this.mergeRef = (e, t) => {
this.childNode = t,
"function" == typeof e ? e(t) : "object" == typeof e && e &&
"current"in e && (e.current = t)
}
,
globalThis.ResizeObserver && (this.observer = new
ResizeObserver(this.handleResizeEventTriggered))
}
componentDidMount() {
var e;
null === (e = this.observeElement) || void 0 === e || e.call(this)
}
componentDidUpdate(e) {
var t;
null === (t = this.observeElement) || void 0 === t || t.call(this,
this.props.observeParent !== e.observeParent)
}
componentWillUnmount() {
this.observer && (this.observer.disconnect(),
this.observer = null,
this.element = null)
}
render() {
const e = React.Children.only(this.props.children)
, {ref: t} = e;
return React.cloneElement(e, {
ref: e => this.mergeRef(t, e)
})
}
}
ReactResizeObserver.propTypes = {
onResize: PropTypes.func,
observeParent: PropTypes.bool,
observerProperty: PropTypes.string,
delayTick: PropTypes.number
},
ReactResizeObserver.defaultProps = {
onResize: () => {}
,
observeParent: !1,
observerProperty: "all",
delayTick: 0
};
var __awaiter$2 = globalThis && globalThis.__awaiter || function(e, t, r,
n) {
return new (r || (r = Promise))((function(i, o) {
function s(e) {
try {
l(n.next(e))
} catch (e2) {
o(e2)
}
}
function a(e) {
try {
l(n.throw(e))
} catch (e2) {
o(e2)
}
}
function l(e) {
var t;
e.done ? i(e.value) : (t = e.value,
t instanceof r ? t : new r((function(e) {
e(t)
}
))).then(s, a)
}
l((n = n.apply(e, t || [])).next())
}
))
}
, __rest$T = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$u = cssClasses$y.PREFIX
, ELLIPSIS_STR = "..."
, wrapperDecorations = (e, t) => {
const {mark: r, code: n, underline: i, strong: o, link: s, disabled: a}
= e;
let l = t;
const c = (e, t) => {
let r = {};
e && ("object" == typeof e && (r = Object.assign({}, e)),
l = React.createElement(t, r, l))
}
;
return c(r, "mark"),
c(n, "code"),
c(i && !s, "u"),
c(o, "strong"),
c(e.delete, "del"),
c(s, a ? "span" : "a"),
l
}
;
class Base extends reactExports.Component {
constructor(e) {
super(e),
this.observerTakingEffect = !1,
this.onResize = e => __awaiter$2(this, void 0, void 0, (function*()
{
return this.rafId && window.cancelAnimationFrame(this.rafId),
new Promise((e => {
this.rafId = window.requestAnimationFrame(( () =>
__awaiter$2(this, void 0, void 0, (function*() {
yield this.getEllipsisState(),
e()
}
))))
}
))
}
)),
this.canUseCSSEllipsis = () => {
const {copyable: e} = this.props
, {expandable: t, expandText: r, pos: n, suffix: i} =
this.getEllipsisOpt();
return !t && _isUndefined(r) && !e && "end" === n && !i.length
}
,
this.shouldTruncated = e => {
if (!e || e < 1)
return !1;
return e <= 1 ? this.compareSingleRow() :
this.wrapperRef.current.scrollHeight > this.wrapperRef.current.offsetHeight
}
,
this.compareSingleRow = () => {
if (!document || !document.createRange)
return !1;
const e = this.wrapperRef.current
, t = e.getBoundingClientRect().width
, r = Array.from(e.childNodes)
, n = document.createRange()
, i = r.reduce(( (e, t) => {
var r;
return n.selectNodeContents(t),
e + (null !== (r = n.getBoundingClientRect().width) && void
0 !== r ? r : 0)
}
), 0);
return n.detach(),
i > t
}
,
this.showTooltip = () => {
var e, t;
const {isOverflowed: r, isTruncated: n, expanded: i} =
this.state
, {showTooltip: o, expandable: s, expandText: a} =
this.getEllipsisOpt()
, l = this.canUseCSSEllipsis()
, c = !i && (l ? r : n)
, u = !s && _isUndefined(a) && c && o;
if (!u)
return u;
const d = {
type: "tooltip"
};
return "object" == typeof o ? o.type && "popover" ===
o.type.toLowerCase() ? _merge({
opts: {
showArrow: !0
}
}, o, {
opts: {
className: classNames({
[`${prefixCls$u}-ellipsis-popover`]: !0,
[null === (e = null == o ? void 0 : o.opts) || void
0 === e ? void 0 : e.className]: Boolean(null === (t = null == o ? void 0 : o.opts)
|| void 0 === t ? void 0 : t.className)
})
}
}) : Object.assign(Object.assign({}, d), o) : d
}
,
this.onHover = () => {
if (this.canUseCSSEllipsis()) {
const {rows: e, suffix: t, pos: r} = this.getEllipsisOpt()
, n = this.shouldTruncated(e);
this.setState({
isOverflowed: n,
isTruncated: !1
})
} else
;
}
,
this.getEllipsisState = () => __awaiter$2(this, void 0, void 0,
(function*() {
const {rows: e, suffix: t, pos: r} = this.getEllipsisOpt()
, {children: n} = this.props;
if (!this.wrapperRef || !this.wrapperRef.current)
return void (yield this.onResize());
const {expanded: i} = this.state;
if (this.canUseCSSEllipsis())
return;
if (_isNull(n))
return new Promise((e => {
this.setState({
isTruncated: !1,
isOverflowed: !1
}, e)
}
));
if (warning$1("children"in this.props && "string" != typeof n,
"[Semi Typography] Only children with pure text could be used with ellipsis at this
moment."),
!e || e < 0 || i)
return;
const o = {
expand: this.expandRef.current,
copy: this.copyRef && this.copyRef.current
}
, s = Array.isArray(n) ? n.join("") : String(n)
, a = getRenderText$1(this.wrapperRef.current, e, s, o,
ELLIPSIS_STR, t, r);
return new Promise((e => {
this.setState({
isOverflowed: !1,
ellipsisContent: a,
isTruncated: s !== a
}, e)
}
))
}
)),
this.toggleOverflow = e => {
const {onExpand: t, expandable: r, collapsible: n} =
this.getEllipsisOpt()
, {expanded: i} = this.state;
t && t(!i, e),
(r && !i || n && i) && this.setState({
expanded: !i
})
}
,
this.getEllipsisOpt = () => {
const {ellipsis: e} = this.props;
if (!e)
return {};
return Object.assign({
rows: 1,
expandable: !1,
pos: "end",
suffix: "",
showTooltip: !1,
collapsible: !1,
expandText: e.expandable ? this.expandStr : void 0,
collapseText: e.collapsible ? this.collapseStr : void 0
}, "object" == typeof e ? e : null)
}
,
this.renderExpandable = () => {
const {expanded: e, isTruncated: t} = this.state;
if (!t)
return null;
const {expandText: r, expandable: n, collapseText: i,
collapsible: o} = this.getEllipsisOpt()
, s = !n && _isUndefined(r)
, a = !o && _isUndefined(i);
let l;
return e || s ? e && !a && (l = i) : l = r,
s && a ? null : React.createElement("a", {
role: "button",
tabIndex: 0,
className: `${prefixCls$u}-ellipsis-expand`,
key: "expand",
ref: this.expandRef,
"aria-label": l,
onClick: this.toggleOverflow,
onKeyPress: e => isEnterPress(e) && this.toggleOverflow(e)
}, l)
}
,
this.getEllipsisStyle = () => {
const {ellipsis: e, component: t} = this.props;
if (!e)
return {
ellipsisCls: "",
ellipsisStyle: {}
};
const {rows: r} = this.getEllipsisOpt()
, {expanded: n} = this.state
, i = !n && this.canUseCSSEllipsis();
return {
ellipsisCls: classNames({
[`${prefixCls$u}-ellipsis`]: !0,
[`${prefixCls$u}-ellipsis-single-line`]: 1 === r,
[`${prefixCls$u}-ellipsis-multiple-line`]: r > 1,
[`${prefixCls$u}-ellipsis-multiple-line-text`]: r > 1
&& "span" === t,
[`${prefixCls$u}-ellipsis-overflow-ellipsis`]: 1 === r
&& i,
[`${prefixCls$u}-ellipsis-overflow-ellipsis-text`]: 1
=== r && i && "span" === t
}),
ellipsisStyle: i && r > 1 ? {
WebkitLineClamp: r
} : {}
}
}
,
this.renderEllipsisText = e => {
const {suffix: t} = e
, {children: r} = this.props
, {isTruncated: n, expanded: i, ellipsisContent: o} =
this.state;
return i || !n ? React.createElement("span", {
onMouseEnter: this.onHover
}, r, t && t.length ? t : null) : React.createElement("span", {
onMouseEnter: this.onHover
}, o, t)
}
,
this.state = {
editable: !1,
copied: !1,
isOverflowed: !1,
ellipsisContent: e.children,
expanded: !1,
isTruncated: !1,
prevChildren: null
},
this.wrapperRef = React.createRef(),
this.expandRef = React.createRef(),
this.copyRef = React.createRef()
}
componentDidMount() {
this.props.ellipsis && this.onResize().then(( () => runAfterTicks((
() => this.observerTakingEffect = !0), 1)))
}
static getDerivedStateFromProps(e, t) {
const {prevChildren: r} = t
, n = {};
return n.prevChildren = e.children,
e.ellipsis && r !== e.children && (n.isOverflowed = !1,
n.ellipsisContent = e.children,
n.expanded = !1,
n.isTruncated = !0),
n
}
componentDidUpdate(e) {
this.props.children !== e.children && (this.forceUpdate(),
this.props.ellipsis && this.onResize())
}
componentWillUnmount() {
this.rafId && window.cancelAnimationFrame(this.rafId)
}
renderOperations() {
return React.createElement(React.Fragment, null,
this.renderExpandable(), this.renderCopy())
}
renderCopy() {
var e;
const {copyable: t, children: r} = this.props;
if (!t)
return null;
const n = null !== (e = null == t ? void 0 : t.content) && void 0 !
== e ? e : r;
let i, o = !1;
Array.isArray(n) ? (i = "",
n.forEach((e => {
"object" == typeof e && (o = !0),
i += String(e)
}
))) : ("object" != typeof n || (o = !0),
i = String(n)),
warning$1(o, "Content to be copied in Typography is a object, it
will case a [object Object] mistake when copy to clipboard.");
const s = Object.assign({
content: i,
duration: 3
}, "object" == typeof t ? t : null);
return React.createElement(Copyable$1, Object.assign({}, s, {
forwardRef: this.copyRef
}))
}
renderIcon() {
const {icon: e, size: t} = this.props
, r = "inherit" === t ? this.context : t;
if (!e)
return null;
const n = "small" === r ? "small" : "default";
return React.createElement("span", {
className: `${prefixCls$u}-icon`,
"x-semi-prop": "icon"
}, isSemiIcon(e) ? React.cloneElement(e, {
size: n
}) : e)
}
renderContent() {
const e = this.props
, {component: t, children: r, className: n, type: i, spacing: o,
disabled: s, style: a, ellipsis: l, icon: c, size: u, link: d, heading: p, weight:
h} = e
, f = __rest$T(e, ["component", "children", "className", "type",
"spacing", "disabled", "style", "ellipsis", "icon", "size", "link", "heading",
"weight"])
, m = _omit(f, ["strong", "editable", "mark", "copyable",
"underline", "code", "delete"])
, g = "inherit" === u ? this.context : u
, y = this.renderIcon()
, v = this.getEllipsisOpt()
, {ellipsisCls: b, ellipsisStyle: x} = this.getEllipsisStyle();
let _ = l ? this.renderEllipsisText(v) : r;
const E = classNames({
[`${prefixCls$u}-link-text`]: d,
[`${prefixCls$u}-link-underline`]: this.props.underline && d
});
_ = wrapperDecorations(this.props,
React.createElement(React.Fragment, null, y, this.props.link ?
React.createElement("span", {
className: E
}, _) : _));
const T = _isString(p) && /^h[1-6]$/.test(p)
, C = classNames(n, b, {
[`${prefixCls$u}-${i}`]: i && !d,
[`${prefixCls$u}-${g}`]: g,
[`${prefixCls$u}-link`]: d,
[`${prefixCls$u}-disabled`]: s,
[`${prefixCls$u}-${o}`]: o,
[`${prefixCls$u}-${p}`]: T,
[`${prefixCls$u}-${p}-weight-${h}`]: T && h && isNaN(Number(h))
})
, S = Object.assign(Object.assign({}, isNaN(Number(h)) ? {} : {
fontWeight: h
}), a);
return React.createElement(BaseTypography, Object.assign({
className: C,
style: Object.assign(Object.assign({}, S), x),
component: t,
forwardRef: this.wrapperRef
}, m), _, this.renderOperations())
}
renderTipWrapper() {
const {children: e} = this.props
, t = this.showTooltip()
, r = this.renderContent();
if (t) {
const {type: n, opts: i, renderTooltip: o} = t;
return _isFunction(o) ? o(e, r) : "popover" === n.toLowerCase()
? React.createElement(Popover$1, Object.assign({
content: e,
position: "top"
}, i), r) : React.createElement(Tooltip, Object.assign({
content: e,
position: "top"
}, i), r)
}
return r
}
render() {
var e = this;
const {size: t} = this.props
, r = "inherit" === t ? this.context : t
, n = React.createElement(SizeContext$1.Provider, {
value: r
}, React.createElement(LocaleConsumer, {
componentName: "Typography"
}, (e => (this.expandStr = e.expand,
this.collapseStr = e.collapse,
this.renderTipWrapper()))));
return this.props.ellipsis ?
React.createElement(ReactResizeObserver, {
onResize: function() {
e.observerTakingEffect && e.onResize(...arguments)
},
observeParent: !0,
observerProperty: ObserverProperty.Width
}, n) : n
}
}
Base.propTypes = {
children: PropTypes.node,
copyable: PropTypes.oneOfType([PropTypes.shape({
text: PropTypes.string,
onCopy: PropTypes.func,
successTip: PropTypes.node,
copyTip: PropTypes.node
}), PropTypes.bool]),
delete: PropTypes.bool,
disabled: PropTypes.bool,
ellipsis: PropTypes.oneOfType([PropTypes.shape({
rows: PropTypes.number,
expandable: PropTypes.bool,
expandText: PropTypes.string,
onExpand: PropTypes.func,
suffix: PropTypes.string,
showTooltip: PropTypes.oneOfType([PropTypes.shape({
type: PropTypes.string,
opts: PropTypes.object
}), PropTypes.bool]),
collapsible: PropTypes.bool,
collapseText: PropTypes.string,
pos: PropTypes.oneOf(["end", "middle"])
}), PropTypes.bool]),
mark: PropTypes.bool,
underline: PropTypes.bool,
link: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
spacing: PropTypes.oneOf(strings$u.SPACING),
strong: PropTypes.bool,
size: PropTypes.oneOf(strings$u.SIZE),
type: PropTypes.oneOf(strings$u.TYPE),
style: PropTypes.object,
className: PropTypes.string,
icon: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
heading: PropTypes.string,
component: PropTypes.string
},
Base.defaultProps = {
children: null,
copyable: !1,
delete: !1,
disabled: !1,
ellipsis: !1,
icon: "",
mark: !1,
underline: !1,
strong: !1,
link: !1,
type: "primary",
spacing: "normal",
size: "normal",
style: {},
className: ""
},
Base.contextType = SizeContext$1;
let Text$3 = class extends reactExports.PureComponent {
render() {
return React.createElement(Base, Object.assign({
component: "span"
}, this.props))
}
}
;
Text$3.propTypes = {
copyable: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
delete: PropTypes.bool,
disabled: PropTypes.bool,
icon: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
ellipsis: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
mark: PropTypes.bool,
underline: PropTypes.bool,
link: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
strong: PropTypes.bool,
type: PropTypes.oneOf(strings$u.TYPE),
size: PropTypes.oneOf(strings$u.SIZE),
style: PropTypes.object,
className: PropTypes.string,
code: PropTypes.bool,
component: PropTypes.string,
weight: PropTypes.number
},
Text$3.defaultProps = {
copyable: !1,
delete: !1,
disabled: !1,
icon: "",
ellipsis: !1,
mark: !1,
underline: !1,
strong: !1,
link: !1,
type: "primary",
style: {},
size: "normal",
className: ""
};
var __rest$S = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class Title extends reactExports.PureComponent {
render() {
const e = this.props
, {heading: t} = e
, r = __rest$S(e, ["heading"])
, n = -1 !== strings$u.HEADING.indexOf(t) ? `h${t}` : "h1";
return React.createElement(Base, Object.assign({
component: n,
heading: n
}, r))
}
}
Title.propTypes = {
copyable: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
delete: PropTypes.bool,
disabled: PropTypes.bool,
ellipsis: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
mark: PropTypes.bool,
link: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
underline: PropTypes.bool,
strong: PropTypes.bool,
type: PropTypes.oneOf(strings$u.TYPE),
heading: PropTypes.oneOf(strings$u.HEADING),
style: PropTypes.object,
className: PropTypes.string,
component: PropTypes.string,
weight: PropTypes.oneOfType([PropTypes.oneOf(strings$u.WEIGHT),
PropTypes.number])
},
Title.defaultProps = {
copyable: !1,
delete: !1,
disabled: !1,
ellipsis: !1,
mark: !1,
underline: !1,
strong: !1,
link: !1,
type: "primary",
heading: 1,
style: {},
className: ""
};
const prefixCls$t = cssClasses$y.PREFIX;
class Paragraph extends reactExports.PureComponent {
render() {
const {className: e} = this.props
, t = classNames(e, `${prefixCls$t}-paragraph`);
return React.createElement(Base, Object.assign({
component: "p"
}, this.props, {
className: t
}))
}
}
Paragraph.propTypes = {
copyable: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
delete: PropTypes.bool,
disabled: PropTypes.bool,
ellipsis: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
mark: PropTypes.bool,
link: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
underline: PropTypes.bool,
strong: PropTypes.bool,
type: PropTypes.oneOf(strings$u.TYPE),
size: PropTypes.oneOf(strings$u.SIZE),
spacing: PropTypes.oneOf(strings$u.SPACING),
style: PropTypes.object,
className: PropTypes.string,
component: PropTypes.string
},
Paragraph.defaultProps = {
copyable: !1,
delete: !1,
disabled: !1,
ellipsis: !1,
mark: !1,
underline: !1,
strong: !1,
link: !1,
type: "primary",
size: "normal",
spacing: "normal",
style: {},
className: ""
};
class FormatNumeral {
constructor(e, t, r, n, i) {
this.ruleMethods = {
"bytes-decimal": e => {
let t = 0;
for (; e >= 1e3; )
e /= 1e3,
t++;
return `${this.truncatePrecision(e)} ${["B", "KB", "MB",
"GB", "TB", "PB", "EB", "ZB", "YB"][t]}`
}
,
"bytes-binary": e => {
let t = 0;
for (; e >= 1024; )
e /= 1024,
t++;
return `${this.truncatePrecision(e)} ${["B", "KiB", "MiB",
"GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"][t]}`
}
,
percentages: e => `${this.truncatePrecision(100 * e)}%`,
exponential: e => {
const t = e.toExponential(this.precision + 2).split("e");
return `${this.truncatePrecision(Number(t[0]))}e${t[1]}`
}
},
this.truncateMethods = {
ceil: Math.ceil,
floor: Math.floor,
round: Math.round
},
this.isDiyParser = void 0 !== i,
this.content = e,
this.rule = t,
this.precision = r,
this.truncate = n,
this.parser = i
}
format() {
return this.isDiyParser ? this.parser(this.content) : "text" ===
this.rule ? extractNumbers(this.content).map((e => checkIsNumeral(e) ?
this.truncatePrecision(e) : e)).join("") : "numbers" === this.rule ?
extractNumbers(this.content).filter((e => checkIsNumeral(e))).map((e =>
this.truncatePrecision(e))).join(",") : extractNumbers(this.content).map((e =>
checkIsNumeral(e) ? this.ruleMethods[this.rule](Number(e)) : e)).join("")
}
truncatePrecision(e) {
const t = this.truncateMethods[this.truncate](Number(e) *
Math.pow(10, this.precision)) / Math.pow(10, this.precision)
, r = t.toString().split(".");
if (1 === r.length)
return t.toFixed(this.precision);
const n = r[1].length;
return n < this.precision ? `${r[0]}.${r[1]}$
{"0".repeat(this.precision - n)}` : t.toString()
}
}
function extractNumbers(e) {
return e.match(/(-?[0-9]*\.?[0-9]+([eE]-?[0-9]+)?)|([^-\d\.]+)/g) || []
}
function checkIsNumeral(e) {
return !(isNaN(Number(e)) || "" === e.replace(/\s+/g, ""))
}
class Numeral extends reactExports.PureComponent {
formatNodeDFS(e) {
return Array.isArray(e) || (e = [e]),
1 === (e = e.map((e => "string" == typeof e || "number" == typeof e
? new
FormatNumeral(String(e),this.props.rule,this.props.precision,this.props.truncate,th
is.props.parser).format() : "function" == typeof e ? this.formatNodeDFS(e()) :
"object" == typeof e && "children"in e.props ? Object.assign(Object.assign({}, e),
{
props: Object.assign(Object.assign({}, e.props), {
children: this.formatNodeDFS(e.props.children)
})
}) : e))).length ? e[0] : e
}
render() {
const e = Object.assign({}, this.props);
return delete e.rule,
delete e.parser,
e.children = this.formatNodeDFS(this.props.children),
React.createElement(Base, Object.assign({
component: "span"
}, e))
}
}
Numeral.propTypes = {
rule: PropTypes.oneOf(strings$u.RULE),
precision: PropTypes.number,
truncate: PropTypes.oneOf(strings$u.TRUNCATE),
parser: PropTypes.func,
copyable: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
delete: PropTypes.bool,
disabled: PropTypes.bool,
icon: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
mark: PropTypes.bool,
underline: PropTypes.bool,
link: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
strong: PropTypes.bool,
type: PropTypes.oneOf(strings$u.TYPE),
size: PropTypes.oneOf(strings$u.SIZE),
style: PropTypes.object,
className: PropTypes.string,
code: PropTypes.bool,
component: PropTypes.string
},
Numeral.defaultProps = {
rule: "text",
precision: 0,
truncate: "round",
parser: void 0,
copyable: !1,
delete: !1,
icon: "",
mark: !1,
underline: !1,
strong: !1,
link: !1,
type: "primary",
style: {},
size: "normal",
className: ""
};
const Typography = BaseTypography;
Typography.Text = Text$3,
Typography.Title = Title,
Typography.Paragraph = Paragraph,
Typography.Numeral = Numeral;
const Typography$1 = Typography
, cssClasses$v = {
PREFIX: `${BASE_CLASS_PREFIX$1}-autocomplete`,
PREFIX_OPTION: `${BASE_CLASS_PREFIX$1}-autoComplete-option`,
PREFIX_GROUP: `${BASE_CLASS_PREFIX$1}-autoComplete-group`
}
, strings$r = {
SIZE: ["small", "large", "default"],
POSITION: strings$t.POSITION_SET,
OPTIONS: ["children", "value"],
STATUS: VALIDATE_STATUS
};
var baseGetTag$4 = _baseGetTag
, isObjectLike$4 = isObjectLike_1
, numberTag$2 = "[object Number]";
function isNumber$3(e) {
return "number" == typeof e || isObjectLike$4(e) && baseGetTag$4(e) ==
numberTag$2
}
var isNumber_1 = isNumber$3;
const _isNumber = getDefaultExportFromCjs(isNumber_1);
class AutoCompleteFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.isPanelOpen = !1
}
init() {
this._setDropdownWidth();
const {defaultOpen: e, data: t, defaultValue: r, value: n} =
this.getProps();
if (t && t.length) {
const e = this._generateList(t);
this._adapter.updateOptionList(e)
}
let i;
e && this.openDropdown(),
void 0 !== r && (i = r),
void 0 !== n && (i = n),
void 0 !== i && this.handleValueChange(i)
}
destroy() {
this._adapter.unregisterClickOutsideHandler()
}
_setDropdownWidth() {
const {style: e, dropdownMatchSelectWidth: t} = this.getProps();
let r;
t && (r = e && _isNumber(e.width) || e && _isString(e.width) && !
e.width.includes("%") ? e.width : this._adapter.getTriggerWidth(),
this._adapter.setOptionWrapperWidth(r))
}
handleInputClick(e) {
this.getStates();
const {disabled: t} = this.getProps();
t || (this.isPanelOpen ? this.closeDropdown() :
this.openDropdown())
}
openDropdown() {
this.isPanelOpen = !0,
this._adapter.toggleListVisible(!0),
this._setDropdownWidth(),
this._adapter.registerClickOutsideHandler((e =>
this.closeDropdown(e))),
this._adapter.notifyDropdownVisibleChange(!0),
this._modifyFocusIndexOnPanelOpen()
}
closeDropdown(e) {
this.isPanelOpen = !1,
this._adapter.toggleListVisible(!1),
this._adapter.unregisterClickOutsideHandler(),
this._adapter.notifyDropdownVisibleChange(!1)
}
_generateList(e) {
const {renderItem: t} = this.getProps()
, r = [];
return e && e.length && e.forEach(( (e, n) => {
const i = String((new Date).getTime()) + n;
let o = {};
_isString(e) || _isNumber(e) ? o = {
value: e,
key: i,
label: e,
show: !0
} : _isObject(e) && !_isUndefined(e.value) && (o =
Object.assign({
show: !0
}, e)),
t && "function" == typeof t && (o.label = t(e)),
r.push(o)
}
)),
r
}
handleSearch(e) {
this._adapter.updateInputValue(e),
this._adapter.notifySearch(e),
this._adapter.notifyChange(e),
this._modifyFocusIndex(e),
this.isPanelOpen || this.openDropdown()
}
handleSelect(e, t) {
const {renderSelectedItem: r} = this.getProps();
let n = "";
r && "function" == typeof r ? (n = r(e),
warning$1("string" != typeof n, "Warning: [Semi AutoComplete]
renderSelectedItem must return string, please check your function return")) : n =
e.value,
this._isControlledComponent() ? (this.closeDropdown(),
this.notifySelect(e)) : (this._adapter.updateInputValue(n),
this.updateSelection(e),
this.notifySelect(e),
this.closeDropdown()),
this._adapter.notifyChange(n),
this._adapter.updateFocusIndex(t)
}
updateSelection(e) {
const t = new Map;
e && t.set(e.label, e),
this._adapter.updateSelection(t)
}
notifySelect(e) {
this._backwardLabelInValue() ? this._adapter.notifySelect(e) :
this._adapter.notifySelect(e.value)
}
_backwardLabelInValue() {
const e = this.getProps();
let {onSelectWithObject: t} = e;
return t
}
handleDataChange(e) {
const t = this._generateList(e);
this._adapter.updateOptionList(t),
this._adapter.rePositionDropdown()
}
handleValueChange(e) {
let {data: t, defaultActiveFirstOption: r} = this.getProps()
, n = "";
n = this._backwardLabelInValue() && "[object Object]" ===
Object.prototype.toString.call(e) ? e.value : e;
let i = this._getRenderSelectedItem();
const o = this._generateList(t);
let s = o.length ? o.filter((e => i(e) === n)) : [];
const a = s.length
, l = o.findIndex((e => i(e) === n));
let c = "";
if (a)
s = s[0],
c = i(s);
else {
const t = this._backwardLabelInValue() ? e : {
label: n,
value: n
};
c = i(t)
}
this._adapter.updateInputValue(c),
this.updateSelection(a ? s : null),
-1 === l && r ? this._adapter.updateFocusIndex(0) :
this._adapter.updateFocusIndex(l)
}
_modifyFocusIndex(e) {
let {focusIndex: t} = this.getStates()
, {data: r, defaultActiveFirstOption: n} = this.getProps()
, i = -1;
if (e) {
let t = this._getRenderSelectedItem();
i = this._generateList(r).findIndex((r => t(r) === e))
}
-1 === i && n ? 0 !== t && this._adapter.updateFocusIndex(0) : i !
== t && this._adapter.updateFocusIndex(i)
}
_modifyFocusIndexOnPanelOpen() {
let {inputValue: e} = this.getStates();
this._modifyFocusIndex(e)
}
_getRenderSelectedItem() {
let {renderSelectedItem: e} = this.getProps();
return void 0 === e && (e = e => null == e ? void 0 : e.value),
e
}
handleClear() {
this._adapter.notifyClear()
}
bindKeyBoardEvent() {
this._keydownHandler = e => {
this._handleKeyDown(e)
}
,
this._adapter.registerKeyDown(this._keydownHandler)
}
_handleKeyDown(e) {
const t = e.keyCode;
switch (this.getStates(),
t) {
case KeyCode.UP:
e.preventDefault(),
this._handleArrowKeyDown(-1);
break;
case KeyCode.DOWN:
e.preventDefault(),
this._handleArrowKeyDown(1);
break;
case KeyCode.ENTER:
e.preventDefault(),
this._handleEnterKeyDown();
break;
case KeyCode.ESC:
case KeyCode.TAB:
this.closeDropdown()
}
this._adapter.notifyKeyDown(e)
}
_getEnableFocusIndex(e) {
const {focusIndex: t, options: r} = this.getStates()
, n = r.filter((e => e.show))
, i = n.length;
let o = t + e;
if (o < 0 && (o = i - 1),
o >= i && (o = 0),
e > 0) {
let e = -1;
for (let t = 0; t < n.length; t++) {
if (!n[t].disabled && (e = t),
e >= o)
break
}
o = e
} else {
let e = n.length;
for (let t = i - 1; t >= 0; t--) {
if (!n[t].disabled && (e = t),
e <= o)
break
}
o = e
}
this._adapter.updateFocusIndex(o)
}
_handleArrowKeyDown(e) {
const {visible: t} = this.getStates();
t ? this._getEnableFocusIndex(e) : this.openDropdown()
}
_handleEnterKeyDown() {
const {visible: e, options: t, focusIndex: r} = this.getStates();
if (e)
if (void 0 !== r && -1 !== r && 0 !== t.length) {
const e = t.filter((e => e.show))[r];
this.handleSelect(e, r)
} else
this.closeDropdown();
else
this.openDropdown()
}
handleOptionMouseEnter(e) {
this._adapter.updateFocusIndex(e)
}
handleFocus(e) {
this.bindKeyBoardEvent(),
this._adapter.notifyFocus(e)
}
handleBlur(e) {
this._persistEvent(e),
this._adapter.notifyBlur(e)
}
}
const AutoCompleteFoundation$1 = AutoCompleteFoundation
, PREFIX$2 = `${BASE_CLASS_PREFIX$1}-spin`
, cssClasses$u = {
PREFIX: PREFIX$2
}
, strings$q = {
SIZE: ["small", "middle", "large"]
};
class SpinFoundation extends BaseFoundation$1 {
static get spinDefaultAdapter() {
return {
getProp: () => {}
,
setLoading: e => {}
}
}
constructor(e) {
super(Object.assign(Object.assign({},
SpinFoundation.spinDefaultAdapter), e))
}
updateLoadingIfNeedDelay() {
const {spinning: e, delay: t} = this._adapter.getProps()
, {delay: r} = this._adapter.getStates();
if (r) {
const r = this;
this._timer = setTimeout(( () => {
r._adapter.setState({
loading: e,
delay: 0
})
}
), t)
}
}
destroy() {
this._timer && (clearTimeout(this._timer),
this._timer = null)
}
}
const SpinFoundation$1 = SpinFoundation;
var __rest$R = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
let _id = -1;
function Icon() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {};
const {id: t, className: r} = e
, n = __rest$R(e, ["id", "className"]);
let i = t;
isNullOrUndefined(i) && (_id++,
i = _id);
const o = `linearGradient-${i}`;
return React.createElement("svg", Object.assign({}, n, {
className: r,
width: "48",
height: "48",
viewBox: "0 0 36 36",
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
"aria-hidden": !0,
"data-icon": "spin"
}), React.createElement("defs", null,
React.createElement("linearGradient", {
x1: "0%",
y1: "100%",
x2: "100%",
y2: "100%",
id: o
}, React.createElement("stop", {
stopColor: "currentColor",
stopOpacity: "0",
offset: "0%"
}), React.createElement("stop", {
stopColor: "currentColor",
stopOpacity: "0.50",
offset: "39.9430698%"
}), React.createElement("stop", {
stopColor: "currentColor",
offset: "100%"
}))), React.createElement("g", {
stroke: "none",
strokeWidth: "1",
fill: "none",
fillRule: "evenodd"
}, React.createElement("rect", {
fillOpacity: "0.01",
fill: "none",
x: "0",
y: "0",
width: "36",
height: "36"
}), React.createElement("path", {
d: "M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2
6.18078805,5.68784135 3.59122325,11.0354951",
stroke: `url(#${o})`,
strokeWidth: "4",
strokeLinecap: "round"
})))
}
const spin$1 = "";
var __rest$Q = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$s = cssClasses$u.PREFIX;
class Spin extends BaseComponent {
constructor(e) {
super(e),
this.foundation = new SpinFoundation$1(this.adapter),
this.state = {
delay: e.delay,
loading: !0
}
}
static getDerivedStateFromProps(e) {
return e.delay ? !1 === e.spinning ? {
delay: 0,
loading: !1
} : {
delay: e.delay
} : {
loading: e.spinning
}
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setLoading: e => {
this.setState({
loading: e
})
}
})
}
componentWillUnmount() {
this.foundation.destroy()
}
renderSpin() {
const {indicator: e, tip: t} = this.props
, {loading: r} = this.state;
return r ? React.createElement("div", {
className: `${prefixCls$s}-wrapper`
}, e ? React.createElement("div", {
className: `${prefixCls$s}-animate`,
"x-semi-prop": "indicator"
}, e) : React.createElement(Icon, null), t ?
React.createElement("div", {
"x-semi-prop": "tip"
}, t) : null) : null
}
render() {
this.foundation.updateLoadingIfNeedDelay();
const e = this.props
, {children: t, style: r, wrapperClassName: n, childStyle: i,
size: o} = e
, s = __rest$Q(e, ["children", "style", "wrapperClassName",
"childStyle", "size"])
, {loading: a} = this.state
, l = classNames(prefixCls$s, n, {
[`${prefixCls$s}-${o}`]: o,
[`${prefixCls$s}-block`]: t,
[`${prefixCls$s}-hidden`]: !a
});
return React.createElement("div", Object.assign({
className: l,
style: r
}, this.getDataAttr(s)), this.renderSpin(),
React.createElement("div", {
className: `${prefixCls$s}-children`,
style: i,
"x-semi-prop": "children"
}, t))
}
}
Spin.propTypes = {
size: PropTypes.oneOf(strings$q.SIZE),
spinning: PropTypes.bool,
children: PropTypes.node,
indicator: PropTypes.node,
delay: PropTypes.number,
tip: PropTypes.node,
wrapperClassName: PropTypes.string,
childStyle: PropTypes.object,
style: PropTypes.object
},
Spin.defaultProps = {
size: "middle",
spinning: !0,
children: null,
indicator: null,
delay: 0
};
const Spin$1 = Spin
, cssClasses$t = {
PREFIX: `${BASE_CLASS_PREFIX$1}-input`
}
, strings$p = {
SIZE: ["small", "large", "default"],
DEFAULT_SIZE: "default",
STATUS: ["default", "error", "warning", "success"],
CLEARBTN_CLICKED_EVENT_FLAG: "__fromClearBtn",
MODE: ["password"]
}
, numbers$9 = {};
function truncateValue(e) {
const {value: t, maxLength: r, getValueLength: n} = e;
if (_isFunction(n)) {
let e = 0
, i = t.length;
for (; e < i; ) {
const o = e + Math.floor((i - e) / 2);
n(t.slice(0, o + 1)) > r ? i = o : e = o + 1
}
return t.slice(0, e)
}
return t.slice(0, r)
}
let InputFoundation$2 = class e extends BaseFoundation$1 {
static get inputDefaultAdapter() {
return {
notifyChange: _noop,
setValue: _noop
}
}
constructor(t) {
super(Object.assign(Object.assign({}, e.inputDefaultAdapter), t))
}
destroy() {
this._timer && (clearTimeout(this._timer),
this._timer = null)
}
setDisable() {}
setValue(e) {
this._adapter.setValue(e)
}
handleChange(e, t) {
const {maxLength: r, minLength: n, getValueLength: i} =
this._adapter.getProps();
let o = e;
r && _isFunction(i) && (o = this.handleVisibleMaxLength(e)),
n && _isFunction(i) && this.handleVisibleMinLength(o),
this._isControlledComponent() || this._adapter.setValue(o),
this._adapter.notifyChange(o, t)
}
handleVisibleMinLength(e) {
const {minLength: t, getValueLength: r} = this._adapter.getProps()
, {minLength: n} = this._adapter.getStates();
if (_isNumber(t) && t >= 0 && _isFunction(r) && _isString(e)) {
const i = r(e);
if (i < t) {
const r = e.length + (t - i);
r !== n && this._adapter.setMinLength(r)
} else
n !== t && this._adapter.setMinLength(t)
}
}
handleVisibleMaxLength(e) {
const {maxLength: t, getValueLength: r} = this._adapter.getProps();
if (_isNumber(t) && t >= 0 && _isFunction(r) && _isString(e)) {
if (r(e) > t) {
return this.handleTruncateValue(e, t)
}
return e
}
return e
}
handleTruncateValue(e, t) {
const {getValueLength: r} = this._adapter.getProps();
return truncateValue({
value: e,
maxLength: t,
getValueLength: r
})
}
handleClear(e) {
let t = e;
this._isControlledComponent("value") ? this._adapter.setState({
isFocus: !1
}) : this._adapter.setState({
value: "",
isFocus: !1
}),
t && "object" == typeof t || (t = {}),
_set(t, strings$p.CLEARBTN_CLICKED_EVENT_FLAG, !0),
this._adapter.notifyChange("", t),
this._adapter.notifyClear(t),
t && this.stopPropagation(t)
}
handleClick(e) {
const {disabled: t} = this._adapter.getProps()
, {isFocus: r} = this._adapter.getStates();
t || r || this._adapter.isEventTarget(e) &&
(this._adapter.focusInput(),
this._adapter.toggleFocusing(!0))
}
handleModeChange(e) {
"password" === e ? this._adapter.setEyeClosed(!0) :
this._adapter.setEyeClosed(!1)
}
handleClickEye(e) {
const t = this._adapter.getState("eyeClosed");
this._adapter.focusInput(),
this._adapter.toggleFocusing(!0),
this._adapter.setEyeClosed(!t)
}
handleInputType(e) {
const t = this._adapter.getProp("mode")
, r = this._adapter.getState("eyeClosed");
return "password" === t ? r ? "password" : "text" : e
}
handleMouseDown(e) {
e.preventDefault()
}
handleMouseUp(e) {
e.preventDefault()
}
handleBlur(e) {
const {value: t} = this.getStates();
this._adapter.toggleFocusing(!1),
this._adapter.notifyBlur(t, e)
}
handleFocus(e) {
const {value: t} = this.getStates();
this._adapter.toggleFocusing(!0),
this._adapter.notifyFocus(t, e)
}
handleInput(e) {
this._adapter.notifyInput(e)
}
handleKeyDown(e) {
this._adapter.notifyKeyDown(e)
}
handleKeyUp(e) {
this._adapter.notifyKeyUp(e)
}
handleKeyPress(e) {
this._adapter.notifyKeyPress(e),
e.key === ENTER_KEY && this._adapter.notifyEnterPress(e)
}
isAllowClear() {
const {value: e, isFocus: t, isHovering: r} =
this._adapter.getStates()
, {showClear: n, disabled: i, showClearIgnoreDisabled: o} =
this._adapter.getProps();
return e && n && (!i || o) && (t || r)
}
handleClickPrefixOrSuffix(e) {
const {disabled: t} = this._adapter.getProps()
, {isFocus: r} = this._adapter.getStates();
t || r || (this._adapter.focusInput(),
this._adapter.toggleFocusing(!0))
}
handlePreventMouseDown(e) {
e && _isFunction(e.preventDefault) && e.preventDefault()
}
handleModeEnterPress(e) {
["Enter", " "].includes(null == e ? void 0 : e.key) &&
(this.handlePreventMouseDown(e),
this.handleClickEye(e))
}
}
;
const InputFoundation$3 = InputFoundation$2
, input = "";
var __rest$P = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$r = cssClasses$t.PREFIX
, sizeSet$3 = strings$p.SIZE
, statusSet$1 = strings$p.STATUS
, modeSet = strings$p.MODE;
class Input extends BaseComponent {
constructor(e) {
super(e),
this.handleClear = e => {
this.foundation.handleClear(e)
}
,
this.handleClick = e => {
this.foundation.handleClick(e)
}
,
this.handleMouseOver = e => {
this.setState({
isHovering: !0
})
}
,
this.handleMouseLeave = e => {
this.setState({
isHovering: !1
})
}
,
this.handleModeChange = e => {
this.foundation.handleModeChange(e)
}
,
this.handleClickEye = e => {
this.foundation.handleClickEye(e)
}
,
this.handleMouseDown = e => {
this.foundation.handleMouseDown(e)
}
,
this.handleMouseUp = e => {
this.foundation.handleMouseUp(e)
}
,
this.handleModeEnterPress = e => {
this.foundation.handleModeEnterPress(e)
}
,
this.handleClickPrefixOrSuffix = e => {
this.foundation.handleClickPrefixOrSuffix(e)
}
,
this.handlePreventMouseDown = e => {
this.foundation.handlePreventMouseDown(e)
}
;
const t = "value"in e ? e.value : e.defaultValue;
this.state = {
value: t,
cachedValue: e.value,
disabled: !1,
props: {},
isFocus: !1,
isHovering: !1,
eyeClosed: "password" === e.mode,
minLength: e.minLength
},
this.inputRef = React.createRef(),
this.prefixRef = React.createRef(),
this.suffixRef = React.createRef(),
this.foundation = new InputFoundation$3(this.adapter)
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setValue: e => this.setState({
value: e
}),
setEyeClosed: e => this.setState({
eyeClosed: e
}),
toggleFocusing: e => {
this.setState({
isFocus: e
})
}
,
focusInput: () => {
const {preventScroll: e} = this.props
, t = this.inputRef && this.inputRef.current;
t && t.focus({
preventScroll: e
})
}
,
toggleHovering: e => this.setState({
isHovering: e
}),
getIfFocusing: () => this.state.isFocus,
notifyChange: (e, t) => this.props.onChange(e, t),
notifyBlur: (e, t) => this.props.onBlur(t),
notifyFocus: (e, t) => this.props.onFocus(t),
notifyInput: e => this.props.onInput(e),
notifyKeyPress: e => this.props.onKeyPress(e),
notifyKeyDown: e => this.props.onKeyDown(e),
notifyKeyUp: e => this.props.onKeyUp(e),
notifyEnterPress: e => this.props.onEnterPress(e),
notifyClear: e => this.props.onClear(e),
setMinLength: e => this.setState({
minLength: e
}),
isEventTarget: e => e && e.target === e.currentTarget
})
}
static getDerivedStateFromProps(e, t) {
const r = {};
return e.value !== t.cachedValue && (r.value = e.value,
r.cachedValue = e.value),
r
}
componentDidUpdate(e) {
const {mode: t} = this.props;
e.mode !== t && this.handleModeChange(t)
}
componentDidMount() {
const {disabled: e, autoFocus: t, preventScroll: r} = this.props;
e || !t && !this.props.autofocus || this.inputRef.current.focus({
preventScroll: r
})
}
renderPrepend() {
const {addonBefore: e} = this.props;
if (e) {
const t = classNames({
[`${prefixCls$r}-prepend`]: !0,
[`${prefixCls$r}-prepend-text`]: e && _isString(e),
[`${prefixCls$r}-prepend-icon`]: isSemiIcon(e)
});
return React.createElement("div", {
className: t,
"x-semi-prop": "addonBefore"
}, e)
}
return null
}
renderAppend() {
const {addonAfter: e} = this.props;
if (e) {
const t = classNames({
[`${prefixCls$r}-append`]: !0,
[`${prefixCls$r}-append-text`]: e && _isString(e),
[`${prefixCls$r}-append-icon`]: isSemiIcon(e)
});
return React.createElement("div", {
className: t,
"x-semi-prop": "addonAfter"
}, e)
}
return null
}
renderClearBtn() {
const e = classNames(`${prefixCls$r}-clearbtn`)
, {clearIcon: t} = this.props;
return this.foundation.isAllowClear() ? React.createElement("div",
{
className: e,
onMouseDown: this.handleClear
}, t || React.createElement(IconClear, null)) : null
}
renderModeBtn() {
const {eyeClosed: e} = this.state
, {mode: t, disabled: r} = this.props
, n = classNames(`${prefixCls$r}-modebtn`)
, i = e ? React.createElement(IconEyeClosedSolid, null) :
React.createElement(IconEyeOpened, null)
, o = e ? "Show password" : "Hidden password";
return "password" === t && !r ? React.createElement("div", {
role: "button",
tabIndex: 0,
"aria-label": o,
className: n,
onClick: this.handleClickEye,
onMouseDown: this.handleMouseDown,
onMouseUp: this.handleMouseUp,
onKeyPress: this.handleModeEnterPress
}, i) : null
}
renderPrefix() {
const {prefix: e, insetLabel: t, insetLabelId: r} = this.props
, n = e || t;
if (!n)
return null;
const i = classNames({
[`${prefixCls$r}-prefix`]: !0,
[`${prefixCls$r}-inset-label`]: t,
[`${prefixCls$r}-prefix-text`]: n && _isString(n),
[`${prefixCls$r}-prefix-icon`]: isSemiIcon(n)
});
return React.createElement("div", {
className: i,
onMouseDown: this.handlePreventMouseDown,
onClick: this.handleClickPrefixOrSuffix,
id: r,
"x-semi-prop": "prefix,insetLabel"
}, n)
}
renderSuffix(e) {
const {suffix: t, hideSuffix: r} = this.props;
if (!t)
return null;
const n = classNames({
[`${prefixCls$r}-suffix`]: !0,
[`${prefixCls$r}-suffix-text`]: t && _isString(t),
[`${prefixCls$r}-suffix-icon`]: isSemiIcon(t),
[`${prefixCls$r}-suffix-hidden`]: e && Boolean(r)
});
return React.createElement("div", {
className: n,
onMouseDown: this.handlePreventMouseDown,
onClick: this.handleClickPrefixOrSuffix,
"x-semi-prop": "suffix"
}, t)
}
getInputRef() {
const {forwardRef: e} = this.props;
if (!_isUndefined(e)) {
if ("function" == typeof e)
return t => {
e(t),
this.inputRef = {
current: t
}
}
;
if ("[object Object]" === Object.prototype.toString.call(e))
return this.inputRef = e,
e
}
return this.inputRef
}
render() {
const e = this.props
, {addonAfter: t, addonBefore: r, autoFocus: n, clearIcon: i,
className: o, disabled: s, defaultValue: a, placeholder: l, prefix: c, mode: u,
insetLabel: d, insetLabelId: p, validateStatus: h, type: f, readonly: m, size: g,
suffix: y, style: v, showClear: b, onEnterPress: x, onClear: _, hideSuffix: E,
inputStyle: T, forwardRef: C, maxLength: S, getValueLength: $, preventScroll: w,
borderless: P, showClearIgnoreDisabled: R, onlyBorder: k} = e
, A = __rest$P(e, ["addonAfter", "addonBefore", "autoFocus",
"clearIcon", "className", "disabled", "defaultValue", "placeholder", "prefix",
"mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size",
"suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix",
"inputStyle", "forwardRef", "maxLength", "getValueLength", "preventScroll",
"borderless", "showClearIgnoreDisabled", "onlyBorder"])
, {value: I, isFocus: O, minLength: D} = this.state
, M = this.foundation.isAllowClear()
, L = isSemiIcon(y)
, j = this.getInputRef()
, F = `${prefixCls$r}-wrapper`
, N = classNames(F, o, {
[`${prefixCls$r}-wrapper__with-prefix`]: c || d,
[`${prefixCls$r}-wrapper__with-suffix`]: y,
[`${prefixCls$r}-wrapper__with-suffix-hidden`]: M &&
Boolean(E),
[`${prefixCls$r}-wrapper__with-suffix-icon`]: L,
[`${prefixCls$r}-wrapper__with-append`]: r,
[`${prefixCls$r}-wrapper__with-prepend`]: t,
[`${prefixCls$r}-wrapper__with-append-only`]: r && !t,
[`${prefixCls$r}-wrapper__with-prepend-only`]: !r && t,
[`${F}-readonly`]: m,
[`${F}-disabled`]: s,
[`${F}-warning`]: "warning" === h,
[`${F}-error`]: "error" === h,
[`${F}-focus`]: O,
[`${F}-clearable`]: b,
[`${F}-modebtn`]: "password" === u,
[`${F}-hidden`]: "hidden" === f,
[`${F}-${g}`]: g,
[`${prefixCls$r}-borderless`]: P,
[`${prefixCls$r}-only_border`]: null != k
})
, B = classNames(prefixCls$r, {
[`${prefixCls$r}-${g}`]: g,
[`${prefixCls$r}-disabled`]: s,
[`${prefixCls$r}-sibling-clearbtn`]:
this.foundation.isAllowClear(),
[`${prefixCls$r}-sibling-modebtn`]: "password" === u
})
, z = null == I ? "" : I
, U = Object.assign(Object.assign({}, A), {
style: T,
className: B,
disabled: s,
readOnly: m,
type: this.foundation.handleInputType(f),
placeholder: l,
onInput: e => this.foundation.handleInput(e),
onChange: e => this.foundation.handleChange(e.target.value, e),
onFocus: e => this.foundation.handleFocus(e),
onBlur: e => this.foundation.handleBlur(e),
onKeyUp: e => this.foundation.handleKeyUp(e),
onKeyDown: e => this.foundation.handleKeyDown(e),
onKeyPress: e => this.foundation.handleKeyPress(e),
value: z
});
_isFunction($) || (U.maxLength = S),
D && (U.minLength = D),
"error" === h && (U["aria-invalid"] = "true");
let V = Object.assign({}, v);
return void 0 !== k && (V = Object.assign({
borderWidth: k
}, v)),
React.createElement("div", {
className: N,
style: V,
onMouseEnter: e => this.handleMouseOver(e),
onMouseLeave: e => this.handleMouseLeave(e),
onClick: e => this.handleClick(e)
}, this.renderPrepend(), this.renderPrefix(),
React.createElement("input", Object.assign({}, U, {
ref: j
})), this.renderClearBtn(), this.renderSuffix(M),
this.renderModeBtn(), this.renderAppend())
}
}
Input.propTypes = {
"aria-label": PropTypes.string,
"aria-labelledby": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-errormessage": PropTypes.string,
"aria-describedby": PropTypes.string,
"aria-required": PropTypes.bool,
addonBefore: PropTypes.node,
addonAfter: PropTypes.node,
clearIcon: PropTypes.node,
prefix: PropTypes.node,
suffix: PropTypes.node,
mode: PropTypes.oneOf(modeSet),
value: PropTypes.any,
defaultValue: PropTypes.any,
disabled: PropTypes.bool,
readonly: PropTypes.bool,
autoFocus: PropTypes.bool,
type: PropTypes.string,
showClear: PropTypes.bool,
hideSuffix: PropTypes.bool,
placeholder: PropTypes.any,
size: PropTypes.oneOf(sizeSet$3),
className: PropTypes.string,
style: PropTypes.object,
validateStatus: PropTypes.oneOf(statusSet$1),
onClear: PropTypes.func,
onChange: PropTypes.func,
onBlur: PropTypes.func,
onFocus: PropTypes.func,
onInput: PropTypes.func,
onKeyDown: PropTypes.func,
onKeyUp: PropTypes.func,
onKeyPress: PropTypes.func,
onEnterPress: PropTypes.func,
insetLabel: PropTypes.node,
insetLabelId: PropTypes.string,
inputStyle: PropTypes.object,
getValueLength: PropTypes.func,
preventScroll: PropTypes.bool,
borderless: PropTypes.bool
},
Input.defaultProps = {
addonBefore: "",
addonAfter: "",
prefix: "",
suffix: "",
readonly: !1,
type: "text",
showClear: !1,
hideSuffix: !1,
placeholder: "",
size: "default",
className: "",
onClear: _noop,
onChange: _noop,
onBlur: _noop,
onFocus: _noop,
onInput: _noop,
onKeyDown: _noop,
onKeyUp: _noop,
onKeyPress: _noop,
onEnterPress: _noop,
validateStatus: "default",
borderless: !1
};
const ForwardInput = React.forwardRef(( (e, t) =>
React.createElement(Input, Object.assign({}, e, {
forwardRef: t
}))))
, Input$1 = ForwardInput;
var __rest$O = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class Trigger extends React.PureComponent {
render() {
const e = this.props
, {triggerRender: t, componentName: r} = e
, n = __rest$O(e, ["triggerRender", "componentName"]);
return t(Object.assign({}, n))
}
}
Trigger.propTypes = {
triggerRender: PropTypes.func.isRequired,
componentName: PropTypes.string,
componentProps: PropTypes.object,
value: PropTypes.any,
inputValue: PropTypes.string,
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
className: PropTypes.string,
style: PropTypes.object
};
const Trigger$1 = Trigger;
var __rest$N = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
let Option$2 = class extends reactExports.PureComponent {
onClick(e, t) {
var {value: r, label: n, children: i} = e
, o = __rest$N(e, ["value", "label", "children"]);
const {props: s} = this;
s.disabled || s.onSelect(Object.assign(Object.assign({}, o), {
value: r,
label: n || i
}), t)
}
renderOptionContent(e) {
let {config: t, children: r, inputValue: n, prefixCls: i} = e;
return _isString(r) && n ? getHighLightTextHTML(t) : r
}
render() {
const e = this.props
, {children: t, disabled: r, value: n, selected: i, label: o,
empty: s, emptyContent: a, onSelect: l, focused: c, showTick: u, className: d,
style: p, onMouseEnter: h, prefixCls: f, renderOptionItem: m, inputValue: g} = e
, y = __rest$N(e, ["children", "disabled", "value", "selected",
"label", "empty", "emptyContent", "onSelect", "focused", "showTick", "className",
"style", "onMouseEnter", "prefixCls", "renderOptionItem", "inputValue"])
, v = classNames(f, {
[`${f}-disabled`]: r,
[`${f}-selected`]: i,
[`${f}-focused`]: c,
[`${f}-empty`]: s,
[d]: d
})
, b = classNames([`${f}-icon`]);
if (s)
return null === a ? null : React.createElement(LocaleConsumer,
{
componentName: "Select"
}, (e => React.createElement("div", {
className: v,
"x-semi-prop": "emptyContent"
}, a || e.emptyText)));
if ("function" == typeof m)
return m(Object.assign({
disabled: r,
focused: c,
selected: i,
style: p,
label: o,
value: n,
inputValue: g,
onMouseEnter: e => h(e),
onClick: e => this.onClick(Object.assign({
value: n,
label: o,
children: t
}, y), e)
}, y));
const x = {
searchWords: g,
sourceString: t,
option: {
highlightClassName: `${f}-keyword`
}
};
return React.createElement("div", {
className: v,
onClick: e => {
this.onClick(Object.assign({
value: n,
label: o,
children: t
}, y), e)
}
,
onMouseEnter: e => h && h(e),
role: "option",
"aria-selected": i ? "true" : "false",
"aria-disabled": r ? "true" : "false",
style: p
}, u ? React.createElement("div", {
className: b
}, React.createElement(IconTick, null)) : null, _isString(t) ?
React.createElement("div", {
className: `${f}-text`
}, this.renderOptionContent({
children: t,
config: x,
inputValue: g,
prefixCls: f
})) : t)
}
}
;
Option$2.isSelectOption = !0,
Option$2.propTypes = {
children: PropTypes.node,
disabled: PropTypes.bool,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
selected: PropTypes.bool,
label: PropTypes.node,
empty: PropTypes.bool,
emptyContent: PropTypes.node,
onSelect: PropTypes.func,
focused: PropTypes.bool,
showTick: PropTypes.bool,
className: PropTypes.string,
style: PropTypes.object,
onMouseEnter: PropTypes.func,
prefixCls: PropTypes.string,
renderOptionItem: PropTypes.func,
inputValue: PropTypes.string
},
Option$2.defaultProps = {
prefixCls: cssClasses$v.PREFIX_OPTION
};
const Option$3 = Option$2
, autoComplete = ""
, prefixCls$q = cssClasses$v.PREFIX
, sizeSet$2 = strings$r.SIZE
, positionSet$1 = strings$r.POSITION
, statusSet = strings$r.STATUS;
class AutoComplete extends BaseComponent {
constructor(e) {
super(e),
this.onSelect = (e, t, r) => {
this.foundation.handleSelect(e, t)
}
,
this.onSearch = e => {
this.foundation.handleSearch(e)
}
,
this.onBlur = e => this.foundation.handleBlur(e),
this.onFocus = e => this.foundation.handleFocus(e),
this.onInputClear = () => this.foundation.handleClear(),
this.handleInputClick = e => this.foundation.handleInputClick(e),
this.foundation = new AutoCompleteFoundation$1(this.adapter);
this.state = {
dropdownMinWidth: null,
inputValue: "",
options: [],
visible: !1,
focusIndex: e.defaultActiveFirstOption ? 0 : -1,
selection: new Map,
rePosKey: 1
},
this.triggerRef = React.createRef(),
this.optionsRef = React.createRef(),
this.clickOutsideHandler = null,
warning$1("triggerRender"in this.props && "function" == typeof
this.props.triggerRender, "[Semi AutoComplete]\n - If you are using the
following props: 'suffix', 'prefix', 'showClear', 'validateStatus', and 'size',\n
please notice that they will be removed in the next major version.\n
Please use 'componentProps' to retrieve these props instead.\n - If you
are using 'onBlur', 'onFocus', please try to avoid using them and look for changes
in the future.")
}
get adapter() {
const e = {
registerKeyDown: e => {
const t = {
onKeyDown: e
};
this.setState({
keyboardEventSet: t
})
}
,
unregisterKeyDown: e => {
this.setState({
keyboardEventSet: {}
})
}
,
updateFocusIndex: e => {
this.setState({
focusIndex: e
})
}
};
return Object.assign(Object.assign(Object.assign({},
super.adapter), e), {
getTriggerWidth: () => {
const e = this.triggerRef.current;
return e && e.getBoundingClientRect().width
}
,
setOptionWrapperWidth: e => {
this.setState({
dropdownMinWidth: e
})
}
,
updateInputValue: e => {
this.setState({
inputValue: e
})
}
,
toggleListVisible: e => {
this.setState({
visible: e
})
}
,
updateOptionList: e => {
this.setState({
options: e
})
}
,
updateSelection: e => {
this.setState({
selection: e
})
}
,
notifySearch: e => {
this.props.onSearch(e)
}
,
notifyChange: e => {
this.props.onChange(e)
}
,
notifySelect: e => {
this.props.onSelect(e)
}
,
notifyDropdownVisibleChange: e => {
this.props.onDropdownVisibleChange(e)
}
,
notifyClear: () => {
this.props.onClear()
}
,
notifyFocus: e => {
this.props.onFocus(e)
}
,
notifyBlur: e => {
this.props.onBlur(e)
}
,
notifyKeyDown: e => {
this.props.onKeyDown(e)
}
,
rePositionDropdown: () => {
let {rePosKey: e} = this.state;
e += 1,
this.setState({
rePosKey: e
})
}
,
registerClickOutsideHandler: e => {
const t = t => {
const r = this.optionsRef && this.optionsRef.current
, n = this.triggerRef && this.triggerRef.current
, i = ReactDOM.findDOMNode(r)
, o = t.target
, s = t.composedPath && t.composedPath() || [o];
!i || i.contains(o) && i.contains(o.parentNode) || !n
|| n.contains(o) || s.includes(n) || s.includes(i) || e(t)
}
;
this.clickOutsideHandler = t,
document.addEventListener("mousedown", t, !1)
}
,
unregisterClickOutsideHandler: () => {
this.clickOutsideHandler &&
document.removeEventListener("mousedown", this.clickOutsideHandler, !1)
}
})
}
componentDidMount() {
this.foundation.init()
}
componentWillUnmount() {
this.foundation.destroy()
}
componentDidUpdate(e, t) {
_isEqual(this.props.data, e.data) ||
this.foundation.handleDataChange(this.props.data),
this.props.value !== e.value &&
this.foundation.handleValueChange(this.props.value)
}
renderInput() {
const {size: e, prefix: t, insetLabel: r, insetLabelId: n, suffix:
i, placeholder: o, style: s, className: a, showClear: l, disabled: c,
triggerRender: u, validateStatus: d, autoFocus: p, value: h, id: f, clearIcon: m} =
this.props
, {inputValue: g, keyboardEventSet: y, selection: v} = this.state
, b = "function" == typeof u
, x = Object.assign(Object.assign(Object.assign({
style: s,
className: b ? classNames(a) : classNames({
[prefixCls$q]: !0,
[`${prefixCls$q}-disabled`]: c
}, a),
onClick: this.handleInputClick,
ref: this.triggerRef,
id: f
}, y), {
tabIndex: -1
}), this.getDataAttr(this.props))
, _ = {
disabled: c,
placeholder: o,
autoFocus: p,
onChange: this.onSearch,
onClear: this.onInputClear,
"aria-label": this.props["aria-label"],
"aria-labelledby": this.props["aria-labelledby"],
"aria-invalid": this.props["aria-invalid"],
"aria-errormessage": this.props["aria-errormessage"],
"aria-describedby": this.props["aria-describedby"],
"aria-required": this.props["aria-required"],
suffix: i,
prefix: t || r,
insetLabelId: n,
showClear: l,
validateStatus: d,
size: e,
onBlur: this.onBlur,
onFocus: this.onFocus,
clearIcon: m
};
return React.createElement("div", Object.assign({}, x), "function"
== typeof u ? React.createElement(Trigger$1, Object.assign({}, _, {
inputValue: void 0 !== h ? h : g,
value: Array.from(v.values()),
triggerRender: u,
componentName: "AutoComplete",
componentProps: Object.assign({}, this.props)
})) : React.createElement(Input$1, Object.assign({}, _, {
value: void 0 !== h ? h : g
})))
}
renderLoading() {
const e = `${prefixCls$q}-loading-wrapper`;
return React.createElement("div", {
className: e
}, React.createElement(Spin$1, null))
}
renderOption(e, t) {
const {focusIndex: r} = this.state
, n = t === r;
return React.createElement(Option$3, Object.assign({
showTick: !1,
onSelect: (e, r) => this.onSelect(e, t, r),
focused: n,
onMouseEnter: () => this.foundation.handleOptionMouseEnter(t),
key: e.key || e.label + e.value + t
}, e), e.label)
}
renderOptionList() {
const {maxHeight: e, dropdownStyle: t, dropdownClassName: r,
loading: n, emptyContent: i} = this.props
, {options: o, dropdownMinWidth: s} = this.state
, a = classNames({
[`${prefixCls$q}-option-list`]: !0
}, r);
let l;
l = 0 === o.length ? i : o.filter((e => e.show)).map(( (e, t) =>
this.renderOption(e, t)));
const c = Object.assign({
maxHeight: e,
minWidth: s
}, t);
return React.createElement("div", {
className: a,
role: "listbox",
style: c
}, n ? this.renderLoading() : l)
}
render() {
const {position: e, motion: t, zIndex: r, mouseEnterDelay: n,
mouseLeaveDelay: i, autoAdjustOverflow: o, stopPropagation: s, getPopupContainer:
a} = this.props
, {visible: l, rePosKey: c} = this.state
, u = this.renderInput()
, d = this.renderOptionList();
return React.createElement(Popover$1, {
mouseEnterDelay: n,
mouseLeaveDelay: i,
autoAdjustOverflow: o,
trigger: "custom",
motion: t,
visible: l,
content: d,
position: e,
ref: this.optionsRef,
zIndex: r,
stopPropagation: s,
getPopupContainer: a,
rePosKey: c
}, u)
}
}
AutoComplete.propTypes = {
"aria-label": PropTypes.string,
"aria-labelledby": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-errormessage": PropTypes.string,
"aria-describedby": PropTypes.string,
"aria-required": PropTypes.bool,
autoFocus: PropTypes.bool,
autoAdjustOverflow: PropTypes.bool,
className: PropTypes.string,
clearIcon: PropTypes.node,
children: PropTypes.node,
data: PropTypes.array,
defaultOpen: PropTypes.bool,
defaultValue: PropTypes.oneOfType([PropTypes.string,
PropTypes.number]),
defaultActiveFirstOption: PropTypes.bool,
disabled: PropTypes.bool,
dropdownMatchSelectWidth: PropTypes.bool,
dropdownClassName: PropTypes.string,
dropdownStyle: PropTypes.object,
emptyContent: PropTypes.node,
id: PropTypes.string,
insetLabel: PropTypes.node,
insetLabelId: PropTypes.string,
onSearch: PropTypes.func,
onSelect: PropTypes.func,
onClear: PropTypes.func,
onBlur: PropTypes.func,
onFocus: PropTypes.func,
onChange: PropTypes.func,
onKeyDown: PropTypes.func,
position: PropTypes.oneOf(positionSet$1),
placeholder: PropTypes.string,
prefix: PropTypes.node,
onChangeWithObject: PropTypes.bool,
onSelectWithObject: PropTypes.bool,
renderItem: PropTypes.func,
renderSelectedItem: PropTypes.func,
suffix: PropTypes.node,
showClear: PropTypes.bool,
size: PropTypes.oneOf(sizeSet$2),
style: PropTypes.object,
stopPropagation: PropTypes.oneOfType([PropTypes.bool,
PropTypes.string]),
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
mouseEnterDelay: PropTypes.number,
mouseLeaveDelay: PropTypes.number,
motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func,
PropTypes.object]),
getPopupContainer: PropTypes.func,
triggerRender: PropTypes.func,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
validateStatus: PropTypes.oneOf(statusSet),
zIndex: PropTypes.number
},
AutoComplete.Option = Option$3,
AutoComplete.__SemiComponentName__ = "AutoComplete",
AutoComplete.defaultProps =
getDefaultPropsFromGlobalConfig(AutoComplete.__SemiComponentName__, {
stopPropagation: !0,
motion: !0,
zIndex: numbers$a.DEFAULT_Z_INDEX,
position: "bottomLeft",
data: [],
showClear: !1,
size: "default",
onFocus: _noop,
onSearch: _noop,
onClear: _noop,
onBlur: _noop,
onSelect: _noop,
onChange: _noop,
onSelectWithObject: !1,
onDropdownVisibleChange: _noop,
defaultActiveFirstOption: !1,
dropdownMatchSelectWidth: !0,
loading: !1,
maxHeight: 300,
validateStatus: "default",
autoFocus: !1,
emptyContent: null,
onKeyDown: _noop
});
const AutoComplete$1 = AutoComplete
, cssClasses$s = {
PREFIX: `${BASE_CLASS_PREFIX$1}-avatar`
}
, strings$o = {
SHAPE: ["circle", "square"],
SIZE: ["extra-extra-small", "extra-small", "small", "default",
"medium", "large", "extra-large"],
COLOR: ["grey", "red", "pink", "purple", "violet", "indigo", "blue",
"light-blue", "cyan", "teal", "green", "light-green", "lime", "yellow", "amber",
"orange", "white"],
OVERLAP_FROM: ["start", "end"]
};
class AvatarFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.handleFocusVisible = e => {
const {target: t} = e;
try {
t.matches(":focus-visible") &&
this._adapter.setFocusVisible(!0)
} catch (r) {
warning$1(!0, "Warning: [Semi Avatar] The current browser
does not support the focus-visible")
}
}
,
this.handleBlur = () => {
this._adapter.setFocusVisible(!1)
}
,
this.changeScale = () => {
const {gap: e} = this.getProps()
, t = this._adapter.getAvatarNode()
, r = null == t ? void 0 : t.firstChild
, [n,i] = [(null == t ? void 0 : t.offsetWidth) || 0, (null
== r ? void 0 : r.offsetWidth) || 0];
if (0 !== n && 0 !== i && 2 * e < n) {
const t = n - 2 * e > i ? 1 : (n - 2 * e) / i;
this._adapter.setScale(t)
}
}
}
init() {
const {children: e} = this.getProps();
"string" == typeof e && this.changeScale()
}
destroy() {}
handleImgLoadError() {
const {onError: e} = this.getProps();
!1 !== (e ? e() : void 0) && this._adapter.notifyImgState(!1)
}
handleEnter(e) {
this._adapter.notifyEnter(e)
}
handleLeave(e) {
this._adapter.notifyLeave(e)
}
}
const avatar = ""
, TopSlotSvg = e => {
let {gradientStart: t, gradientEnd: r} = e;
const n = getUuidShort();
return React.createElement("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "51",
height: "52",
viewBox: "0 0 51 52",
fill: "none"
}, React.createElement("g", {
filter: "url(#filter0_d_6_2)"
}, React.createElement("path", {
d: "M40.4918 46.5592C44.6795 43.176 46.261 34.1333 47.5301
25.6141C49.5854 11.8168 39.6662 1 25.8097 1C11.2857 1 3 11.4279 3 25.3518C3 33.7866
6.29361 43.8947 10.4602 46.5592C12.5868 47.9192 12.5868 47.9051 25.8097
47.9192C38.3651 47.9282 38.5352 48.14 40.4918 46.5592Z",
fill: `url(#${n})`
})), React.createElement("defs", null, React.createElement("filter", {
id: "filter0_d_6_2",
x: "0.789215",
y: "0.447304",
width: "49.2216",
height: "51.3549",
filterUnits: "userSpaceOnUse",
colorInterpolationFilters: "sRGB"
}, React.createElement("feFlood", {
floodOpacity: "0",
result: "BackgroundImageFix"
}), React.createElement("feColorMatrix", {
in: "SourceAlpha",
type: "matrix",
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
result: "hardAlpha"
}), React.createElement("feOffset", {
dy: "1.65809"
}), React.createElement("feGaussianBlur", {
stdDeviation: "1.10539"
}), React.createElement("feColorMatrix", {
type: "matrix",
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"
}), React.createElement("feBlend", {
mode: "normal",
in2: "BackgroundImageFix",
result: "effect1_dropShadow_6_2"
}), React.createElement("feBlend", {
mode: "normal",
in: "SourceGraphic",
in2: "effect1_dropShadow_6_2",
result: "shape"
})), React.createElement("linearGradient", {
id: n,
x1: "17.671",
y1: "31.7392",
x2: "17.671",
y2: "47.9333",
gradientUnits: "userSpaceOnUse"
}, React.createElement("stop", {
stopColor: t
}), React.createElement("stop", {
offset: "1",
stopColor: r
}))))
}
, TopSlotSvg$1 = TopSlotSvg;
var __rest$M = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const sizeSet$1 = strings$o.SIZE
, shapeSet = strings$o.SHAPE
, colorSet = strings$o.COLOR
, prefixCls$p = cssClasses$s.PREFIX;
class Avatar extends BaseComponent {
constructor(e) {
super(e),
this.handleFocusVisible = e => {
this.foundation.handleFocusVisible(e)
}
,
this.handleBlur = e => {
this.foundation.handleBlur()
}
,
this.getContent = () => {
const {children: e, onClick: t, imgAttr: r, src: n, srcSet: i,
alt: o} = this.props
, {isImgExist: s} = this.state;
let a = e;
const l = t !== noop$2
, c = n && s
, u = {
tabIndex: 0,
onKeyDown: this.handleKeyDown,
onFocus: this.handleFocusVisible,
onBlur: this.handleBlur
};
if (c) {
const e = l ? `clickable Avatar: ${o}` : o
, t = Object.assign(Object.assign({
src: n,
srcSet: i,
onError: this.handleError
}, r), {
className: classNames({
[`${prefixCls$p}-no-focus-visible`]: l
})
})
, s = l ? Object.assign(Object.assign({}, t), u) : t;
a = React.createElement("img", Object.assign({
alt: e
}, s))
} else if ("string" == typeof e) {
const t = null != o ? o : e
, r = {
role: "img",
"aria-label": l ? `clickable Avatar: ${t}` : t,
className: classNames(`${prefixCls$p}-label`, {
[`${prefixCls$p}-no-focus-visible`]: l
})
}
, n = l ? Object.assign(Object.assign({}, r), u) : r
, i = {
transform: `scale(${this.state.scale})`
};
a = React.createElement("span", {
className: `${prefixCls$p}-content`,
style: i
}, React.createElement("span", Object.assign({}, n, {
"x-semi-prop": "children"
}), e))
}
return a
}
,
this.renderBottomSlot = () => {
var e, t;
if (!this.props.bottomSlot)
return null;
if (this.props.bottomSlot.render)
return this.props.bottomSlot.render();
const r = null !== (e = this.props.bottomSlot.render) && void 0
!== e ? e : () => {
var e;
const t = {};
return this.props.bottomSlot.bgColor && (t.backgroundColor
= this.props.bottomSlot.bgColor),
this.props.bottomSlot.textColor && (t.color =
this.props.bottomSlot.textColor),
React.createElement("span", {
style: t,
className: classNames(`${prefixCls$p}-bottom_slot-
shape_${this.props.bottomSlot.shape}`, `${prefixCls$p}-bottom_slot-shape_$
{this.props.bottomSlot.shape}-${this.props.size}`, null !== (e =
this.props.bottomSlot.className) && void 0 !== e ? e : "")
}, this.props.bottomSlot.text)
}
;
return React.createElement("div", {
className: classNames([`${prefixCls$p}-bottom_slot`]),
style: null !== (t = this.props.bottomSlot.style) && void 0
!== t ? t : {}
}, r())
}
,
this.renderTopSlot = () => {
var e, t, r, n;
if (!this.props.topSlot)
return null;
if (this.props.topSlot.render)
return this.props.topSlot.render();
const i = {};
return this.props.topSlot.textColor && (i.color =
this.props.topSlot.textColor),
React.createElement("div", {
style: null !== (e = this.props.topSlot.style) && void 0 !
== e ? e : {},
className: classNames([`${prefixCls$p}-top_slot-wrapper`,
null !== (t = this.props.topSlot.className) && void 0 !== t ? t : "", {
[`${prefixCls$p}-animated`]: this.props.contentMotion
}])
}, React.createElement("div", {
className: classNames([`${prefixCls$p}-top_slot-bg`, `$
{prefixCls$p}-top_slot-bg-${this.props.size}`])
}, React.createElement("div", {
className: classNames([`${prefixCls$p}-top_slot-bg-svg`, `$
{prefixCls$p}-top_slot-bg-svg-${this.props.size}`])
}, React.createElement(TopSlotSvg$1, {
gradientStart: null !== (r =
this.props.topSlot.gradientStart) && void 0 !== r ? r : "var(--semi-color-
primary)",
gradientEnd: null !== (n = this.props.topSlot.gradientEnd)
&& void 0 !== n ? n : "var(--semi-color-primary)"
}))), React.createElement("div", {
className: classNames([`${prefixCls$p}-top_slot`])
}, React.createElement("div", {
style: i,
className: classNames([`${prefixCls$p}-top_slot-content`,
`${prefixCls$p}-top_slot-content-${this.props.size}`])
}, this.props.topSlot.text)))
}
,
this.state = {
isImgExist: !0,
hoverContent: "",
focusVisible: !1,
scale: 1
},
this.onEnter = this.onEnter.bind(this),
this.onLeave = this.onLeave.bind(this),
this.handleError = this.handleError.bind(this),
this.handleKeyDown = this.handleKeyDown.bind(this),
this.getContent = this.getContent.bind(this),
this.avatarRef = React.createRef()
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
notifyImgState: e => {
this.setState({
isImgExist: e
})
}
,
notifyEnter: e => {
const {hoverMask: t} = this.props
, r = t;
this.setState({
hoverContent: r
}, ( () => {
const {onMouseEnter: t} = this.props;
t && t(e)
}
))
}
,
notifyLeave: e => {
this.setState({
hoverContent: ""
}, ( () => {
const {onMouseLeave: t} = this.props;
t && t(e)
}
))
}
,
setFocusVisible: e => {
this.setState({
focusVisible: e
})
}
,
setScale: e => {
this.setState({
scale: e
})
}
,
getAvatarNode: () => {
var e;
return null === (e = this.avatarRef) || void 0 === e ? void
0 : e.current
}
})
}
componentDidMount() {
this.foundation = new AvatarFoundation(this.adapter),
this.foundation.init()
}
componentDidUpdate(e) {
if (this.props.src && this.props.src !== e.src) {
const e = new Image(0,0);
e.src = this.props.src,
e.onload = () => {
this.setState({
isImgExist: !0
})
}
,
e.onerror = () => {
this.setState({
isImgExist: !1
})
}
,
e.onabort = () => {
this.setState({
isImgExist: !1
})
}
}
"string" == typeof this.props.children && this.props.children !==
e.children && this.foundation.changeScale()
}
componentWillUnmount() {
this.foundation.destroy()
}
onEnter(e) {
this.foundation.handleEnter(e)
}
onLeave(e) {
this.foundation.handleLeave(e)
}
handleError() {
this.foundation.handleImgLoadError()
}
handleKeyDown(e) {
const {onClick: t} = this.props;
switch (e.key) {
case "Enter":
t(e),
handlePrevent(e);
break;
case "Escape":
e.target.blur()
}
}
render() {
var e;
const t = this.props
, {shape: r, children: n, size: i, color: o, className: s,
hoverMask: a, onClick: l, imgAttr: c, src: u, srcSet: d, style: p, alt: h, gap: f,
bottomSlot: m, topSlot: g, border: y, contentMotion: v} = t
, b = __rest$M(t, ["shape", "children", "size", "color",
"className", "hoverMask", "onClick", "imgAttr", "src", "srcSet", "style", "alt",
"gap", "bottomSlot", "topSlot", "border", "contentMotion"])
, {isImgExist: x, hoverContent: _, focusVisible: E} = this.state;
let T = {};
strings$o.SIZE.includes(i) || (T = {
width: i,
height: i
}),
T = Object.assign(Object.assign({}, T), p);
const C = m || g || y
, S = {
onClick: l,
onMouseEnter: this.onEnter,
onMouseLeave: this.onLeave
}
, $ = u && x
, w = classNames(prefixCls$p, {
[`${prefixCls$p}-${r}`]: r,
[`${prefixCls$p}-${i}`]: i,
[`${prefixCls$p}-${o}`]: o && !$,
[`${prefixCls$p}-img`]: $,
[`${prefixCls$p}-focus`]: E,
[`${prefixCls$p}-animated`]: v
}, s)
, P = _ ? React.createElement("div", {
className: `${prefixCls$p}-hover`,
"x-semi-prop": "hoverContent"
}, _) : null;
let R = React.createElement("span", Object.assign({}, b, {
style: C ? {} : T,
className: w
}, C ? {} : S, {
role: "listitem",
ref: this.avatarRef
}), this.getContent(), P);
if (y) {
const t = {};
"object" == typeof y && (null == y ? void 0 : y.color) &&
(t.borderColor = null == y ? void 0 : y.color),
R = React.createElement("div", {
style: Object.assign({
position: "relative"
}, T)
}, R, React.createElement("span", {
style: t,
className: classNames([`${prefixCls$p}-additionalBorder`,
`${prefixCls$p}-additionalBorder-${i}`, {
[`${prefixCls$p}-${r}`]: r
}])
}), "object" == typeof this.props.border &&
this.props.border.motion && React.createElement("span", {
style: t,
className: classNames([`${prefixCls$p}-additionalBorder`,
`${prefixCls$p}-additionalBorder-${i}`, {
[`${prefixCls$p}-${r}`]: r,
[`${prefixCls$p}-additionalBorder-animated`]: "object"
== typeof this.props.border && (null === (e = this.props.border) || void 0 === e ?
void 0 : e.motion)
}])
}))
}
return C ? React.createElement("span", Object.assign({
className: classNames([`${prefixCls$p}-wrapper`]),
style: T
}, S), R, g && ["extra-small", "small", "default", "medium",
"large", "extra-large"].includes(i) && "circle" === r && this.renderTopSlot(), m &&
["extra-small", "small", "default", "medium", "large", "extra-large"].includes(i)
&& this.renderBottomSlot()) : R
}
}
Avatar.__SemiComponentName__ = "Avatar",
Avatar.defaultProps =
getDefaultPropsFromGlobalConfig(Avatar.__SemiComponentName__, {
size: "medium",
color: "grey",
shape: "circle",
gap: 3,
onClick: noop$2,
onMouseEnter: noop$2,
onMouseLeave: noop$2
}),
Avatar.propTypes = {
children: PropTypes.node,
color: PropTypes.oneOf(colorSet),
shape: PropTypes.oneOf(shapeSet),
size: PropTypes.oneOf(sizeSet$1),
hoverMask: PropTypes.node,
className: PropTypes.string,
style: PropTypes.object,
gap: PropTypes.number,
imgAttr: PropTypes.object,
src: PropTypes.string,
srcSet: PropTypes.string,
alt: PropTypes.string,
onError: PropTypes.func,
onClick: PropTypes.func,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
bottomSlot: PropTypes.shape({
render: PropTypes.func,
shape: PropTypes.oneOf(["circle", "square"]),
text: PropTypes.node,
bgColor: PropTypes.string,
textColor: PropTypes.string,
className: PropTypes.string,
style: PropTypes.object
}),
topSlot: PropTypes.shape({
render: PropTypes.func,
gradientStart: PropTypes.string,
gradientEnd: PropTypes.string,
text: PropTypes.node,
textColor: PropTypes.string,
className: PropTypes.string,
style: PropTypes.object
}),
border: PropTypes.oneOfType([PropTypes.shape({
color: PropTypes.string,
motion: PropTypes.bool
}), PropTypes.bool]),
contentMotion: PropTypes.bool
},
Avatar.elementType = "Avatar";
var NEWTON_ITERATIONS = 4
, NEWTON_MIN_SLOPE = .001
, SUBDIVISION_PRECISION = 1e-7
, SUBDIVISION_MAX_ITERATIONS = 10
, kSplineTableSize = 11
, kSampleStepSize = 1 / (kSplineTableSize - 1)
, float32ArraySupported = "function" == typeof Float32Array;
function A$1(e, t) {
return 1 - 3 * t + 3 * e
}
function B$1(e, t) {
return 3 * t - 6 * e
}
function C$1(e) {
return 3 * e
}
function calcBezier(e, t, r) {
return ((A$1(t, r) * e + B$1(t, r)) * e + C$1(t)) * e
}
function getSlope(e, t, r) {
return 3 * A$1(t, r) * e * e + 2 * B$1(t, r) * e + C$1(t)
}
function binarySubdivide(e, t, r, n, i) {
var o, s, a = 0;
do {
(o = calcBezier(s = t + (r - t) / 2, n, i) - e) > 0 ? r = s : t = s
} while (Math.abs(o) > SUBDIVISION_PRECISION && ++a <
SUBDIVISION_MAX_ITERATIONS);
return s
}
function newtonRaphsonIterate(e, t, r, n) {
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
var o = getSlope(t, r, n);
if (0 === o)
return t;
t -= (calcBezier(t, r, n) - e) / o
}
return t
}
function LinearEasing(e) {
return e
}
var src = function(e, t, r, n) {
if (!(0 <= e && e <= 1 && 0 <= r && r <= 1))
throw new Error("bezier x values must be in [0, 1] range");
if (e === t && r === n)
return LinearEasing;
for (var i = float32ArraySupported ? new Float32Array(kSplineTableSize)
: new Array(kSplineTableSize), o = 0; o < kSplineTableSize; ++o)
i[o] = calcBezier(o * kSampleStepSize, e, r);
return function(o) {
return 0 === o ? 0 : 1 === o ? 1 : calcBezier(function(t) {
for (var n = 0, o = 1, s = kSplineTableSize - 1; o !== s &&
i[o] <= t; ++o)
n += kSampleStepSize;
--o;
var a = n + (t - i[o]) / (i[o + 1] - i[o]) * kSampleStepSize
, l = getSlope(a, e, r);
return l >= NEWTON_MIN_SLOPE ? newtonRaphsonIterate(t, a, e, r)
: 0 === l ? a : binarySubdivide(t, n, n + kSampleStepSize, e, r)
}(o), t, n)
}
};
const bezier = getDefaultExportFromCjs(src);
function minMax(e, t, r) {
return Math.min(Math.max(e, t), r)
}
function parseEasingParameters(e) {
const t = /\(([^)]+)\)/.exec(e);
return t ? t[1].split(",").map((e => parseFloat(e))) : []
}
function elastic() {
let e = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : .5;
const t = minMax(arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : 1, 1, 10)
, r = minMax(e, .1, 2);
return e => 0 === e || 1 === e ? e : -t * Math.pow(2, 10 * (e - 1)) *
Math.sin((e - 1 - r / (2 * Math.PI) * Math.asin(1 / t)) * (2 * Math.PI) / r)
}
const easingMap = ( () => {
const e = ["Quad", "Cubic", "Quart", "Quint", "Sine", "Expo", "Circ",
"Back", "Elastic"]
, t = {
In: [[.55, .085, .68, .53], [.55, .055, .675, .19],
[.895, .03, .685, .22], [.755, .05, .855, .06], [.47, 0, .745, .715],
[.95, .05, .795, .035], [.6, .04, .98, .335], [.6, -.28, .735, .045], elastic],
Out: [[.25, .46, .45, .94], [.215, .61, .355, 1], [.165, .84, .44,
1], [.23, 1, .32, 1], [.39, .575, .565, 1], [.19, 1, .22, 1], [.075, .82, .165, 1],
[.175, .885, .32, 1.275], (e, t) => r => 1 - elastic(e, t)(1 - r)],
InOut: [[.455, .03, .515, .955], [.645, .045, .355, 1], [.77,
0, .175, 1], [.86, 0, .07, 1], [.445, .05, .55, .95], [1, 0, 0, 1],
[.785, .135, .15, .86], [.68, -.55, .265, 1.55], (e, t) => r => r < .5 ? elastic(e,
t)(2 * r) / 2 : 1 - elastic(e, t)(-2 * r + 2) / 2]
}
, r = {
linear: [.25, .25, .75, .75]
};
for (const n of Object.keys(t))
t[n].forEach(( (t, i) => {
r["ease" + n + e[i]] = t
}
));
return r
}
)();
function getEasing(e) {
if ("function" == typeof e)
return e;
let t = (e = e && "string" == typeof e ? e.trim() :
"linear").split("(")[0];
const r = parseEasingParameters(e);
let n;
return "cubic-bezier" === t || "cubicBezier" === t ? bezier(...r.length
? r : easingMap.linear) : ((!t || "string" != typeof t || "string" == typeof t &&
null == easingMap[t]) && (t = "linear"),
n = easingMap[t],
"function" == typeof n ? n(...r) : r.length ? bezier(...r) :
bezier(...n))
}
let Event$1 = class {
constructor() {
this._eventMap = new Map
}
on(e, t) {
return e && "function" == typeof t && (this._eventMap.has(e) ||
this._eventMap.set(e, []),
this._eventMap.get(e).push(t)),
this
}
once(e, t) {
var r = this;
if (e && "function" == typeof t) {
const n = function() {
t(...arguments),
r.off(e, n)
};
this.on(e, n)
}
}
off(e, t) {
if (e)
if ("function" == typeof t) {
const r = this._eventMap.get(e);
if (Array.isArray(r) && r.length) {
let e = -1;
for (; (e = r.findIndex((e => e === t))) > -1; )
r.splice(e, 1)
}
} else
null == t && this._eventMap.delete(e);
return this
}
emit(e) {
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n
= 1; n < t; n++)
r[n - 1] = arguments[n];
return !!this._eventMap.has(e) && (this._eventMap.get(e).forEach((e
=> e(...r))),
!0)
}
}
;
function shouldUseBezier(e) {
return Boolean(e && "object" == typeof e && (e.duration > 0 || "string"
== typeof e.easing || "function" == typeof e.easing))
}
function shouldStopAnimation(e, t, r, n, i) {
for (const o of Object.keys(t)) {
const s = t[o]
, a = "number" == typeof s ? s : s.val;
if ("object" != typeof s || !s.done) {
if (shouldUseBezier(s) && n && i && s.duration) {
if (s.duration + n <= i || a !== e[o])
return !1
} else if ("number" == typeof r[o] && 0 !== r[o])
return !1;
if (e[o] !== a)
return !1
}
}
return !0
}
function stripStyle(e) {
const t = {};
for (const r in e)
Object.prototype.hasOwnProperty.call(e, r) && (t[r] = "number" ==
typeof e[r] ? e[r] : e[r].val);
return t
}
const reusedTuple = [0, 0];
function stepper(e, t, r, n, i, o, s) {
const a = r + (-i * (t - n) + -o * r) * e
, l = t + a * e;
return Math.abs(a) < s && Math.abs(l - n) < s ? (reusedTuple[0] = n,
reusedTuple[1] = 0,
reusedTuple) : (reusedTuple[0] = l,
reusedTuple[1] = a,
reusedTuple)
}
function mapToZero(e) {
const t = {}
, r = e && Object.keys(e) || [];
for (const n of r)
t[n] = 0;
return t
}
const presets = {
default: {
tension: 170,
friction: 26
},
gentle: {
tension: 120,
friction: 14
},
wobbly: {
tension: 180,
friction: 12
},
stiff: {
tension: 210,
friction: 20
},
slow: {
tension: 280,
friction: 60
},
molasses: {
tension: 280,
friction: 120
}
}
, defaultConfig = Object.assign(Object.assign({}, presets.default), {
precision: .01
});
function wrapValue(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : {};
if (shouldUseBezier(t)) {
const e = getEasing(t.easing)
, r = "number" == typeof t.duration && t.duration > 0 ?
t.duration : 1e3;
t = Object.assign(Object.assign({}, t), {
easing: e,
duration: r
})
}
let r = Object.assign(Object.assign(Object.assign({}, defaultConfig),
t), {
done: !1
});
if (e && "object" == typeof e && "val"in e) {
if (shouldUseBezier(e)) {
const r = getEasing(e.easing)
, n = "number" == typeof e.duration && e.duration > 0 ?
e.duration : parseInt(t.duration) || 1e3;
e = Object.assign(Object.assign({}, e), {
easing: r,
duration: n
})
}
r = Object.assign(Object.assign({}, r), e)
} else
r = Object.assign(Object.assign({}, r), {
val: e
});
return r
}
const now$3 = () => Date.now()
, msPerFrame$1 = 1e3 / 60;
let Animation$4 = class extends Event$1 {
constructor() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {}
, t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : {};
super(),
this._props = Object.assign({}, e),
this._config = Object.assign({}, t),
this.initStates()
}
_wrapConfig(e, t) {
t = t && "object" == typeof t ? t : this._config;
const r = {};
for (const n of Object.keys(e))
r[n] = wrapValue(e[n], t);
return r
}
initStates(e, t) {
e = e && "object" == typeof e ? e : this._props,
t = t && "object" == typeof t ? t : this._config;
const {from: r, to: n} = e;
if (this._from = {},
r)
for (const s of Object.keys(r))
this._from[s] = "object" == typeof r[s] && r[s].val ?
r[s].val : r[s];
this._to = this._wrapConfig(n, t),
this._delay = parseInt(t.delay) || 0;
const i = this._from && stripStyle(this._from) ||
stripStyle(this._to)
, o = mapToZero(i);
this._currentStyle = Object.assign({}, i),
this._currentVelocity = Object.assign({}, o),
this._lastIdealStyle = Object.assign({}, i),
this._lastIdealVelocity = Object.assign({}, o),
this.resetPlayStates(),
this._frameCount = 0,
this._prevTime = 0
}
animate() {
null == this._timer && (this._timer = requestAnimationFrame((e => {
const t = now$3();
if (shouldStopAnimation(this._currentStyle, this._to,
this._currentVelocity, this._startedTime || t, t) || this._ended || this._stopped)
return !this._wasAnimating || this._ended || this._stopped
|| (this._timer = setTimeout(( () => {
clearTimeout(this._timer),
this._timer = null,
this._ended = !0,
this.emit("rest", this.getCurrentStates())
}
), msPerFrame$1)),
void this.resetPlayStates();
this._started || (this._started = !0,
this.emit("start", this.getCurrentStates())),
this._stopped = !1,
this._paused = !1,
this._wasAnimating = !0,
0 === this._startedTime && (this._startedTime = t);
const r = t
, n = r - this._prevTime;
this._prevTime = r,
r - this._startedTime < this._delay && (this._timer = null,
this.animate());
const i = {}
, o = {}
, s = {}
, a = {}
, l = this._to && Object.keys(this._to) || [];
for (const c of l) {
const e = this._to[c];
this._accumulatedTime[c] = "number" != typeof
this._accumulatedTime[c] ? n : this._accumulatedTime[c] + n;
const t = null != this._from[c] && "object" == typeof
this._from[c] ? this._from[c].val : this._from[c]
, l = e.val;
if ("number" == typeof e)
s[c] = e,
a[c] = 0,
i[c] = e,
o[c] = 0;
else {
let n = this._lastIdealStyle[c]
, u = this._lastIdealVelocity[c];
if (shouldUseBezier(this._config) ||
shouldUseBezier(e)) {
const {easing: o, duration: a} = e;
n = t + o((r - this._startedTime) / a) * (l - t),
r >= this._startedTime + a && (n = l,
e.done = !0),
i[c] = n,
s[c] = n
} else if (null != l && l === this._currentStyle[c])
s[c] = l,
a[c] = 0,
i[c] = l,
o[c] = 0;
else {
const t = (this._accumulatedTime[c] -
Math.floor(this._accumulatedTime[c] / msPerFrame$1) * msPerFrame$1) / msPerFrame$1
, r = Math.floor(this._accumulatedTime[c] /
msPerFrame$1);
for (let i = 0; i < r; i++)
[n,u] = stepper(msPerFrame$1 / 1e3, n, u,
e.val, e.tension, e.friction, e.precision);
const [l,d] = stepper(msPerFrame$1 / 1e3, n, u,
e.val, e.tension, e.friction, e.precision);
s[c] = n + (l - n) * t,
a[c] = u + (d - u) * t,
i[c] = n,
o[c] = u,
this._accumulatedTime[c] -= r * msPerFrame$1
}
}
}
this._timer = null,
this._currentStyle = Object.assign({}, s),
this._currentVelocity = Object.assign({}, a),
this._lastIdealStyle = Object.assign({}, i),
this._lastIdealVelocity = Object.assign({}, o),
this._destroyed || (this.emit("frame",
this.getCurrentStates()),
this.animate())
}
)))
}
start() {
this._prevTime = now$3(),
this._startedTime = now$3(),
this.animate()
}
end() {
this._ended || (this._ended = !0,
this._currentStyle = this.getFinalStates(),
this.emit("frame", this.getFinalStates()),
this.emit("rest", this.getFinalStates())),
this.destroy()
}
pause() {
this._paused || (this._pausedTime = now$3(),
this._paused = !0,
this.emit("pause", this.getCurrentStates()),
this.destroy(),
this._destroyed = !1)
}
resume() {
if (this._started && this._paused) {
const e = now$3() - this._pausedTime;
this._paused = !1,
this._startedTime += e,
this._prevTime += e,
this._pausedTime = 0,
this.emit("resume", this.getCurrentStates()),
this.animate()
}
}
stop() {
this.destroy(),
this._stopped || (this._stopped = !0,
this.emit("stop", this.getInitialStates()),
this.initStates())
}
destroy() {
cancelAnimationFrame(this._timer),
clearTimeout(this._timer),
this._timer = null,
this._destroyed = !0
}
resetPlayStates() {
this._started = !1,
this._stopped = !1,
this._ended = !1,
this._paused = !1,
this._destroyed = !1,
this._timer = null,
this._wasAnimating = !1,
this._accumulatedTime = {},
this._startedTime = 0,
this._pausedTime = 0
}
reset() {
this.destroy(),
this.initStates()
}
reverse() {
this.destroy();
const e = Object.assign({}, this._props)
, [t,r] = [e.to, e.from];
e.from = t,
e.to = r,
this._props = Object.assign({}, e),
this.initStates()
}
getCurrentStates() {
return Object.assign({}, this._currentStyle)
}
getInitialStates() {
return Object.assign({}, stripStyle(this._props.from))
}
getFinalStates() {
return Object.assign({}, stripStyle(this._props.to))
}
}
;
const cssClasses$r = {
PREFIX: `${BASE_CLASS_PREFIX$1}-button`
}
, strings$n = {
sizes: ["default", "small", "large"],
iconPositions: ["left", "right"],
htmlTypes: ["button", "reset", "submit"],
btnTypes: ["primary", "secondary", "tertiary", "warning", "danger"],
themes: ["solid", "borderless", "light", "outline"],
DEFAULT_ICON_SIZE: "default",
DEFAULT_ICON_POSITION: "left"
}
, strings$m = {
SIZE: ["extra-small", "small", "default", "large", "extra-large",
"custom"],
ICON_PREFIX: "semi-icon-"
}
, button$2 = "";
var __rest$L = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const btnSizes = strings$n.sizes
, {htmlTypes: htmlTypes, btnTypes: btnTypes} = strings$n;
let Button$3 = class extends reactExports.PureComponent {
render() {
const e = this.props
, {children: t, block: r, htmlType: n, loading: i, circle: o,
className: s, style: a, disabled: l, size: c, theme: u, type: d, prefixCls: p,
iconPosition: h} = e
, f = __rest$L(e, ["children", "block", "htmlType", "loading",
"circle", "className", "style", "disabled", "size", "theme", "type", "prefixCls",
"iconPosition"])
, m = Object.assign(Object.assign({
disabled: l
}, _omit(f, ["x-semi-children-alias"])), {
className: classNames(p, {
[`${p}-${d}`]: !l && d,
[`${p}-disabled`]: l,
[`${p}-size-large`]: "large" === c,
[`${p}-size-small`]: "small" === c,
[`${p}-light`]: "light" === u,
[`${p}-block`]: r,
[`${p}-circle`]: o,
[`${p}-borderless`]: "borderless" === u,
[`${p}-outline`]: "outline" === u,
[`${p}-${d}-disabled`]: l && d
}, s),
type: n,
"aria-disabled": l
})
, g = {};
return s && s.includes("-with-icon") || (g["x-semi-prop"] =
this.props["x-semi-children-alias"] || "children"),
React.createElement("button", Object.assign({}, m, {
onClick: this.props.onClick,
onMouseDown: this.props.onMouseDown,
style: a
}), React.createElement("span", Object.assign({
className: classNames(`${p}-content`,
this.props.contentClassName),
onClick: e => l && e.stopPropagation()
}, g), t))
}
}
;
Button$3.defaultProps = {
disabled: !1,
size: "default",
type: "primary",
theme: "light",
block: !1,
htmlType: "button",
onMouseDown: noop$2,
onClick: noop$2,
onMouseEnter: noop$2,
onMouseLeave: noop$2,
prefixCls: cssClasses$r.PREFIX
},
Button$3.propTypes = {
children: PropTypes.node,
disabled: PropTypes.bool,
prefixCls: PropTypes.string,
style: PropTypes.object,
size: PropTypes.oneOf(btnSizes),
type: PropTypes.oneOf(btnTypes),
block: PropTypes.bool,
onClick: PropTypes.func,
onMouseDown: PropTypes.func,
circle: PropTypes.bool,
loading: PropTypes.bool,
htmlType: PropTypes.oneOf(htmlTypes),
theme: PropTypes.oneOf(strings$n.themes),
className: PropTypes.string,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
"aria-label": PropTypes.string,
contentClassName: PropTypes.string
};
const iconButton = "";
var __rest$K = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const iconSizes = strings$m.SIZE;
class IconButton extends reactExports.PureComponent {
render() {
const e = this.props
, {children: t, iconPosition: r, iconSize: n, iconStyle: i,
style: o, icon: s, noHorizontalPadding: a, theme: l, className: c, prefixCls: u,
loading: d} = e
, p = __rest$K(e, ["children", "iconPosition", "iconSize",
"iconStyle", "style", "icon", "noHorizontalPadding", "theme", "className",
"prefixCls", "loading"])
, h = Object.assign({}, o);
Array.isArray(a) ? (a.includes("left") && (h.paddingLeft = 0),
a.includes("right") && (h.paddingRight = 0)) : !0 === a ?
(h.paddingLeft = 0,
h.paddingRight = 0) : "string" == typeof a && ("left" === a &&
(h.paddingLeft = 0),
"right" === a && (h.paddingRight = 0));
let f = null
, m = null;
d && !p.disabled ? m = React.createElement(Icon, null) :
React.isValidElement(s) && (m = s);
const g = classNames({
[`${u}-content-left`]: "right" === r,
[`${u}-content-right`]: "left" === r
})
, y = this.props["x-semi-children-alias"] || "children"
, v = null != t ? React.createElement("span", {
className: g,
"x-semi-prop": y
}, t) : null;
f = "left" === r ? React.createElement(React.Fragment, null, m,
v) : React.createElement(React.Fragment, null, v, m);
const b = classNames(c, `${u}-with-icon`, {
[`${u}-with-icon-only`]: null == v || "" === v,
[`${u}-loading`]: d
});
return React.createElement(Button$3, Object.assign({}, p, {
className: b,
theme: l,
style: h
}), f)
}
}
IconButton.defaultProps = {
iconPosition: strings$n.DEFAULT_ICON_POSITION,
prefixCls: cssClasses$r.PREFIX,
loading: !1,
noHorizontalPadding: !1,
onMouseEnter: _noop,
onMouseLeave: _noop
},
IconButton.elementType = "IconButton",
IconButton.propTypes = {
iconStyle: PropTypes.object,
style: PropTypes.object,
loading: PropTypes.bool,
prefixCls: PropTypes.string,
icon: PropTypes.oneOfType([PropTypes.object, PropTypes.string,
PropTypes.node]),
iconSize: PropTypes.oneOf(iconSizes),
noHorizontalPadding: PropTypes.oneOfType([PropTypes.bool,
PropTypes.string, PropTypes.array]),
children: PropTypes.node,
theme: PropTypes.string,
iconPosition: PropTypes.oneOf(strings$n.iconPositions),
className: PropTypes.string,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func
};
const Button$2 = IconButton;
class Button extends React.PureComponent {
constructor() {
super(arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {})
}
render() {
const e = Object.assign({}, this.props)
, t = Boolean(e.icon)
, r = Boolean(e.loading)
, n = Boolean(e.disabled);
return t || r && !n ? React.createElement(Button$2,
Object.assign({}, e)) : React.createElement(Button$3, Object.assign({}, e))
}
}
Button.__SemiComponentName__ = "Button",
Button.propTypes = Object.assign(Object.assign({}, Button$3.propTypes),
Button$2.propTypes),
Button.defaultProps =
getDefaultPropsFromGlobalConfig(Button.__SemiComponentName__),
Button.elementType = "Button";
const Button$1 = Button
, cssClasses$q = {
PREFIX: `${BASE_CLASS_PREFIX$1}-space`
}
, strings$l = {
ALIGN_SET: ["start", "end", "center", "baseline"],
SPACING_LOOSE: "loose",
SPACING_MEDIUM: "medium",
SPACING_TIGHT: "tight"
}
, space$1 = ""
, REACT_FRAGMENT_TYPE = "Symbol(react.fragment)"
, flatten = e => {
let t = [];
return React.Children.forEach(e, (e => {
null != e && (Array.isArray(e) ? t = t.concat(flatten(e)) :
reactExports.isValidElement(e) && e.type && e.type.toString() ===
REACT_FRAGMENT_TYPE && e.props ? t = t.concat(flatten(e.props.children)) :
t.push(e))
}
)),
t
}
, prefixCls$o = cssClasses$q.PREFIX;
class Space extends reactExports.PureComponent {
render() {
const {children: e=null, style: t, className: r, spacing: n, wrap:
i, align: o, vertical: s} = this.props
, a = (!i || !s) && i
, l = Object.assign({}, t);
let c = ""
, u = "";
_isString(n) ? (c = n,
u = n) : _isNumber(n) ? (l.rowGap = n,
l.columnGap = n) : _isArray(n) && (_isString(n[0]) ? c = n[0] :
_isNumber(n[0]) && (l.columnGap = `${n[0]}px`),
_isString(n[1]) ? u = n[1] : _isNumber(n[1]) && (l.rowGap = `$
{n[1]}px`));
const d = classNames(prefixCls$o, r, {
[`${prefixCls$o}-align-${o}`]: o,
[`${prefixCls$o}-vertical`]: s,
[`${prefixCls$o}-horizontal`]: !s,
[`${prefixCls$o}-wrap`]: a,
[`${prefixCls$o}-tight-horizontal`]: c ===
strings$l.SPACING_TIGHT,
[`${prefixCls$o}-tight-vertical`]: u ===
strings$l.SPACING_TIGHT,
[`${prefixCls$o}-medium-horizontal`]: c ===
strings$l.SPACING_MEDIUM,
[`${prefixCls$o}-medium-vertical`]: u ===
strings$l.SPACING_MEDIUM,
[`${prefixCls$o}-loose-horizontal`]: c ===
strings$l.SPACING_LOOSE,
[`${prefixCls$o}-loose-vertical`]: u ===
strings$l.SPACING_LOOSE
})
, p = flatten(e)
, h = getDataAttr(this.props);
return React.createElement("div", Object.assign({}, h, {
className: d,
style: l,
"x-semi-prop": "children"
}), p)
}
}
Space.propTypes = {
wrap: PropTypes.bool,
align: PropTypes.oneOf(strings$l.ALIGN_SET),
vertical: PropTypes.bool,
spacing: PropTypes.oneOfType([PropTypes.string, PropTypes.number,
PropTypes.array]),
children: PropTypes.node,
style: PropTypes.object,
className: PropTypes.string
},
Space.defaultProps = {
vertical: !1,
wrap: !1,
spacing: "tight",
align: "center"
};
const Space$1 = Space;
function baseFindIndex$2(e, t, r, n) {
for (var i = e.length, o = r + (n ? 1 : -1); n ? o-- : ++o < i; )
if (t(e[o], o, e))
return o;
return -1
}
var _baseFindIndex = baseFindIndex$2;
function baseIsNaN$1(e) {
return e != e
}
var _baseIsNaN = baseIsNaN$1;
function strictIndexOf$1(e, t, r) {
for (var n = r - 1, i = e.length; ++n < i; )
if (e[n] === t)
return n;
return -1
}
var _strictIndexOf = strictIndexOf$1
, baseFindIndex$1 = _baseFindIndex
, baseIsNaN = _baseIsNaN
, strictIndexOf = _strictIndexOf;
function baseIndexOf$2(e, t, r) {
return t == t ? strictIndexOf(e, t, r) : baseFindIndex$1(e, baseIsNaN,
r)
}
var _baseIndexOf = baseIndexOf$2
, toNumber$1 = toNumber_1
, INFINITY$3 = 1 / 0
, MAX_INTEGER = 17976931348623157e292;
function toFinite$1(e) {
return e ? (e = toNumber$1(e)) === INFINITY$3 || e === -INFINITY$3 ? (e
< 0 ? -1 : 1) * MAX_INTEGER : e == e ? e : 0 : 0 === e ? e : 0
}
var toFinite_1 = toFinite$1
, toFinite = toFinite_1;
function toInteger$5(e) {
var t = toFinite(e)
, r = t % 1;
return t == t ? r ? t - r : t : 0
}
var toInteger_1 = toInteger$5
, baseIndexOf$1 = _baseIndexOf
, isArrayLike$4 = isArrayLike_1
, isString$1 = isString_1
, toInteger$4 = toInteger_1
, values = values_1
, nativeMax$3 = Math.max;
function includes(e, t, r, n) {
e = isArrayLike$4(e) ? e : values(e),
r = r && !n ? toInteger$4(r) : 0;
var i = e.length;
return r < 0 && (r = nativeMax$3(i + r, 0)),
isString$1(e) ? r <= i && e.indexOf(t, r) > -1 : !!i &&
baseIndexOf$1(e, t, r) > -1
}
var includes_1 = includes;
const _includes = getDefaultExportFromCjs(includes_1);
var assignValue$1 = _assignValue
, copyObject$1 = _copyObject
, createAssigner$1 = _createAssigner
, isArrayLike$3 = isArrayLike_1
, isPrototype$1 = _isPrototype
, keys$2 = keys_1
, objectProto$f = Object.prototype
, hasOwnProperty$e = objectProto$f.hasOwnProperty
, assign$3 = createAssigner$1((function(e, t) {
if (isPrototype$1(t) || isArrayLike$3(t))
copyObject$1(t, keys$2(t), e);
else
for (var r in t)
hasOwnProperty$e.call(t, r) && assignValue$1(e, r, t[r])
}
))
, assign_1 = assign$3;
const _assign = getDefaultExportFromCjs(assign_1);
var baseIndexOf = _baseIndexOf;
function arrayIncludes$2(e, t) {
return !!(null == e ? 0 : e.length) && baseIndexOf(e, t, 0) > -1
}
var _arrayIncludes = arrayIncludes$2;
function arrayIncludesWith$2(e, t, r) {
for (var n = -1, i = null == e ? 0 : e.length; ++n < i; )
if (r(t, e[n]))
return !0;
return !1
}
var _arrayIncludesWith = arrayIncludesWith$2
, SetCache$2 = _SetCache
, arrayIncludes$1 = _arrayIncludes
, arrayIncludesWith$1 = _arrayIncludesWith
, arrayMap$3 = _arrayMap
, baseUnary$3 = _baseUnary
, cacheHas$2 = _cacheHas
, LARGE_ARRAY_SIZE$2 = 200;
function baseDifference$2(e, t, r, n) {
var i = -1
, o = arrayIncludes$1
, s = !0
, a = e.length
, l = []
, c = t.length;
if (!a)
return l;
r && (t = arrayMap$3(t, baseUnary$3(r))),
n ? (o = arrayIncludesWith$1,
s = !1) : t.length >= LARGE_ARRAY_SIZE$2 && (o = cacheHas$2,
s = !1,
t = new SetCache$2(t));
e: for (; ++i < a; ) {
var u = e[i]
, d = null == r ? u : r(u);
if (u = n || 0 !== u ? u : 0,
s && d == d) {
for (var p = c; p--; )
if (t[p] === d)
continue e;
l.push(u)
} else
o(t, d, n) || l.push(u)
}
return l
}
var _baseDifference = baseDifference$2
, baseDifference$1 = _baseDifference
, baseFlatten = _baseFlatten
, baseRest$2 = _baseRest
, isArrayLikeObject$2 = isArrayLikeObject_1
, difference = baseRest$2((function(e, t) {
return isArrayLikeObject$2(e) ? baseDifference$1(e, baseFlatten(t, 1,
isArrayLikeObject$2, !0)) : []
}
))
, difference_1 = difference;
const _difference = getDefaultExportFromCjs(difference_1);
var baseGet$1 = _baseGet
, baseSet = _baseSet
, castPath$1 = _castPath;
function basePickBy$1(e, t, r) {
for (var n = -1, i = t.length, o = {}; ++n < i; ) {
var s = t[n]
, a = baseGet$1(e, s);
r(a, s) && baseSet(o, castPath$1(s, e), a)
}
return o
}
var _basePickBy = basePickBy$1
, basePickBy = _basePickBy
, hasIn$1 = hasIn_1;
function basePick$1(e, t) {
return basePickBy(e, t, (function(t, r) {
return hasIn$1(e, r)
}
))
}
var _basePick = basePick$1
, basePick = _basePick
, flatRest = _flatRest
, pick = flatRest((function(e, t) {
return null == e ? {} : basePick(e, t)
}
))
, pick_1 = pick;
const _pick = getDefaultExportFromCjs(pick_1);
var isSymbol$2 = isSymbol_1;
function baseExtremum$1(e, t, r) {
for (var n = -1, i = e.length; ++n < i; ) {
var o = e[n]
, s = t(o);
if (null != s && (void 0 === a ? s == s && !isSymbol$2(s) : r(s,
a)))
var a = s
, l = o
}
return l
}
var _baseExtremum = baseExtremum$1;
function baseGt$1(e, t) {
return e > t
}
var _baseGt = baseGt$1
, baseExtremum = _baseExtremum
, baseGt = _baseGt
, identity$1 = identity_1;
function max(e) {
return e && e.length ? baseExtremum(e, identity$1, baseGt) : void 0
}
var max_1 = max;
const _max = getDefaultExportFromCjs(max_1);
var Set$3 = _Set
, noop$1 = noop_1
, setToArray$2 = _setToArray
, INFINITY$2 = 1 / 0
, createSet$1 = Set$3 && 1 / setToArray$2(new Set$3([, -0]))[1] ==
INFINITY$2 ? function(e) {
return new Set$3(e)
}
: noop$1
, _createSet = createSet$1
, SetCache$1 = _SetCache
, arrayIncludes = _arrayIncludes
, arrayIncludesWith = _arrayIncludesWith
, cacheHas$1 = _cacheHas
, createSet = _createSet
, setToArray$1 = _setToArray
, LARGE_ARRAY_SIZE$1 = 200;
function baseUniq$1(e, t, r) {
var n = -1
, i = arrayIncludes
, o = e.length
, s = !0
, a = []
, l = a;
if (r)
s = !1,
i = arrayIncludesWith;
else if (o >= LARGE_ARRAY_SIZE$1) {
var c = t ? null : createSet(e);
if (c)
return setToArray$1(c);
s = !1,
i = cacheHas$1,
l = new SetCache$1
} else
l = t ? [] : a;
e: for (; ++n < o; ) {
var u = e[n]
, d = t ? t(u) : u;
if (u = r || 0 !== u ? u : 0,
s && d == d) {
for (var p = l.length; p--; )
if (l[p] === d)
continue e;
t && l.push(d),
a.push(u)
} else
i(l, d, r) || (l !== a && l.push(d),
a.push(u))
}
return a
}
var _baseUniq = baseUniq$1
, baseUniq = _baseUniq;
function uniq(e) {
return e && e.length ? baseUniq(e) : []
}
var uniq_1 = uniq;
const _uniq = getDefaultExportFromCjs(uniq_1);
function getPosition$1(e, t) {
return `${e}-${t}`
}
function isValid$3(e) {
return !_isNull(e) && !_isUndefined(e)
}
function flattenTreeData(e, t, r) {
let n = arguments.length > 3 && void 0 !== arguments[3] &&
arguments[3];
const i = []
, o = Boolean(n)
, s = _get(r, "key", "key")
, a = _get(r, "children", "children");
return function e(l) {
let c = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : null;
return l.map(( (u, d) => {
const p = getPosition$1(c ? c.pos : "0", d)
, h = u[s]
, f = {};
r && Object.entries(_omit(r, "children")).forEach((e => {
let[t,r] = e;
const n = u[r];
!_isUndefined(n) && (f[t] = n)
}
));
const m = Object.assign(Object.assign(Object.assign({},
_pick(u, ["key", "label", "value", "icon", "disabled", "isLeaf"])), f), {
parent: c,
pos: p,
children: null,
data: u,
_innerDataTag: !0,
isEnd: [...c ? c.isEnd : [], d === l.length - 1]
})
, g = "boolean" == typeof n;
return (!o || !g && n.has(h)) && i.push(m),
t.has(h) && (!o || !g && n.has(h)) ? m.children = e(u[a] || [],
m) : m.children = [],
m
}
))
}(e),
i
}
function traverseDataNodes$1(e, t, r) {
const n = _get(r, "key", "key")
, i = _get(r, "children", "children")
, o = (r, s, a) => {
const l = r ? r[i] : e
, c = r ? getPosition$1(a.pos, s) : "0";
if (r) {
const e = _get(r, n, null)
, i = {
data: Object.assign({}, r),
ind: s,
pos: c,
key: null !== e ? e : c,
parentPos: a.node ? a.pos : null,
level: Number(a.level) + 1
};
t(i)
}
l && l.forEach(( (e, t) => {
o(e, t, {
node: r,
pos: c,
level: a ? Number(a.level) + 1 : -1
})
}
))
}
;
o(null)
}
function convertDataToEntities$1(e, t) {
const r = {}
, n = {}
, i = {}
, o = {
posEntities: r,
keyEntities: n,
valueEntities: i
}
, s = _get(t, "value", "value");
return traverseDataNodes$1(e, (e => {
const {pos: t, key: o, parentPos: a} = e
, l = Object.assign({}, e)
, c = _get(l, `data.${s}`, null);
null !== c && (i[c] = o),
r[t] = l,
n[o] = l,
l.parent = r[a],
l.parent && (l.parent.children = l.parent.children || [],
l.parent.children.push(l))
}
), t),
o
}
function findKeysForValues(e, t) {
let r = arguments.length > 2 && void 0 !== arguments[2] &&
arguments[2];
if (!isValid$3(e))
return [];
if (!r && Array.isArray(e) ? e = e.length ? [e[0]] : [] :
Array.isArray(e) || (e = [e]),
_isEmpty(t))
return e;
const n = [];
return e.forEach((e => {
e in t ? n.push(t[e]) : e && n.push(e)
}
)),
n
}
function findDescendantKeys(e, t) {
let r = !(arguments.length > 2 && void 0 !== arguments[2]) ||
arguments[2];
const n = []
, i = e => {
if (!e)
return;
const {children: r} = e;
isValid$3(r) && r.forEach((e => {
n.push(e.key),
i(t[e.key])
}
))
}
;
return e.forEach((e => {
r && n.push(e),
i(t[e])
}
)),
n
}
function findChildKeys(e, t) {
let r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : [];
const n = [];
return e && e.forEach((e => {
const i = t[e];
i && i.children && i.children.forEach((e => {
r.length && r.includes(e.key) || n.push(e.key)
}
))
}
)),
n
}
function findSiblingKeys(e, t) {
let r = !(arguments.length > 2 && void 0 !== arguments[2]) ||
arguments[2];
const n = [];
e.forEach((e => {
t[e] && t[e].parent && n.push(t[e].parent.key)
}
));
return findChildKeys(_uniq(n), t, r ? [] : e)
}
function findAncestorKeys(e, t) {
let r = !(arguments.length > 2 && void 0 !== arguments[2]) ||
arguments[2];
const n = []
, i = e => {
e.parent && (n.push(e.parent.key),
i(e.parent))
}
;
return e.forEach((e => {
t[e] && i(t[e]),
r && n.push(e)
}
)),
n
}
function getSortedKeyList(e, t) {
const r = {};
return e.forEach((e => {
if (!t[e])
return;
const {level: n} = t[e];
r[n] ? r[n].push(e) : r[n] = [e]
}
)),
r
}
function calcCheckedKeys(e, t) {
const r = Array.isArray(e) ? e : [e]
, n = findDescendantKeys(r, t, !0)
, i = new Set([...n]);
let o = new Set([])
, s = [];
const a = getSortedKeyList(r, t)
, l = e => {
const {key: r, parent: n, level: l} = e;
if (!n || s.includes(r))
return;
const c = findSiblingKeys([r], t);
s = [...s, ...c];
if (c.every((e => i.has(e))))
i.add(n.key),
l - 1 in a && l ? a[l - 1].push(n.key) : a[l - 1] = [n.key];
else {
const e = findAncestorKeys([r], t, !1);
o = new Set([...o, ...e])
}
}
;
for (; !_isEmpty(a); ) {
const e = _max(Object.keys(a).map((e => Number(e))));
a[e].forEach((e => l(t[e]))),
delete a[e]
}
return {
checkedKeys: i,
halfCheckedKeys: o
}
}
function calcExpandedKeys() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : []
, t = arguments.length > 1 ? arguments[1] : void 0
, r = !(arguments.length > 2 && void 0 !== arguments[2]) ||
arguments[2];
if (Array.isArray(e) || (e = [e]),
r) {
const r = findAncestorKeys(e, t, !0);
return new Set(r)
}
return new Set(e)
}
function calcExpandedKeysForValues(e, t, r, n) {
const i = findKeysForValues(e, n, r);
return new Set(findAncestorKeys(i, t, !1))
}
function calcMotionKeys(e, t, r) {
let n = "show";
const i = [...e]
, o = [...t];
if (1 !== Math.abs(i.length - o.length))
return {
motionType: n,
motionKeys: []
};
let s = [];
return i.length > o.length ? (n = "hide",
s = _difference(i, o)) : s = _difference(o, i),
{
motionType: 1 === s.length ? n : "show",
motionKeys: 1 === s.length ? findDescendantKeys(s, r, !1) : []
}
}
function filter$2(e, t, r, n) {
if (!r)
return !0;
let i = r
, o = t;
return "boolean" == typeof r && (i = (e, t) => {
const r = e.toLowerCase();
return t.toString().toLowerCase().includes(r)
}
),
n && (o = t[n]),
i(e, o, t)
}
function normalizeKeyList(e, t) {
let r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]
, n = arguments.length > 3 ? arguments[3] : void 0;
const i = []
, o = new Set(e);
return r ? e.forEach((e => {
t[e] && !isValid$3(t[e].children) && i.push(e),
!t[e] && n && i.push(e)
}
)) : e.forEach((e => {
if (!t[e])
return void (n && i.push(e));
const {parent: r} = t[e];
r && o.has(r.key) || i.push(e)
}
)),
i
}
function getMotionKeys(e, t, r) {
const n = []
, i = e => {
r[e].children && r[e].children.forEach((e => {
const {key: r} = e;
n.push(r),
t.has(r) && i(r)
}
))
}
;
return i(e),
n
}
function calcCheckedKeysForChecked(e, t, r, n) {
const i = findDescendantKeys([e], t, !0)
, o = t[e];
r = new Set([...r, e]);
const s = e => {
if (!e.parent)
return;
const {key: i} = e;
if (findSiblingKeys([i], t).every((e => r.has(e)))) {
const t = e.parent;
r.add(t.key),
s(t)
} else {
const e = findAncestorKeys([i], t, !1);
n = new Set([...n, ...e])
}
}
;
return s(o),
{
checkedKeys: new Set([...r, ...i]),
halfCheckedKeys: n
}
}
function calcCheckedKeysForUnchecked(e, t, r, n) {
const i = findDescendantKeys([e], t, !0)
, o = t[e];
i.forEach((e => {
r.has(e) && r.delete(e),
n.has(e) && n.delete(e)
}
));
const s = e => {
const i = e.parent;
if (!i)
return;
if (!r.has(i.key) && !n.has(i.key))
return;
const {key: o} = e
, a = findSiblingKeys([o], t).some((e => r.has(e) || n.has(e)))
, l = findAncestorKeys([o], t, !1);
a ? l.forEach((e => {
r.has(e) && (r.delete(e),
n.add(e))
}
)) : (r.has(i.key) && r.delete(i.key),
n.has(i.key) && n.delete(i.key),
s(i))
}
;
return o && s(o),
{
checkedKeys: r,
halfCheckedKeys: n
}
}
function filterTreeData(e) {
const {showFilteredOnly: t, keyEntities: r, inputValue: n, treeData: i,
filterTreeNode: o, filterProps: s, prevExpandedKeys: a, keyMaps: l} = e;
let c = [];
c = Object.values(r).filter((e => filter$2(n, e.data, o, s))).map((e =>
e.key));
let u = findAncestorKeys(c, r, !1);
if (a.length) {
const e = a.filter((e => Boolean(r[e])));
u = u.concat(e)
}
const d = findDescendantKeys(c, r, !0)
, p = new Set([...d, ...u]);
return {
flattenNodes: flattenTreeData(i, new Set(u), l, t && p),
filteredKeys: new Set(c),
filteredExpandedKeys: new Set(u),
filteredShownKeys: p
}
}
function getValueOrKey(e, t) {
const r = _get(t, "value", "value")
, n = _get(t, "key", "key");
return Array.isArray(e) ? e.map((e => _get(e, r, e[n]))) : _get(e, r,
e[n])
}
function normalizeValue(e, t, r) {
return t && isValid$3(e) ? getValueOrKey(e, r) : e
}
function updateKeys(e, t) {
return [...e].filter((e => e in t))
}
function calcDisabledKeys(e, t) {
const r = _get(t, "disabled", "disabled")
, n = Object.keys(e).filter((t => e[t].data[r]))
, {checkedKeys: i} = calcCheckedKeys(n, e);
return i
}
const cssClasses$p = {
PREFIX: `${BASE_CLASS_PREFIX$1}-cascader`,
PREFIX_OPTION: `${BASE_CLASS_PREFIX$1}-cascader-option`
}
, strings$k = {
SIZE_SET: ["small", "large", "default"],
VALIDATE_STATUS: ["success", "default", "error", "warning"],
IS_KEY: "isKey",
IS_VALUE: "isValue",
SHOW_NEXT_BY_CLICK: "click",
SHOW_NEXT_BY_HOVER: "hover",
LEAF_ONLY_MERGE_TYPE: "leafOnly",
AUTO_MERGE_VALUE_MERGE_TYPE: "autoMergeValue",
NONE_MERGE_TYPE: "none",
SEARCH_POSITION_TRIGGER: "trigger",
SEARCH_POSITION_CUSTOM: "custom"
}
, VALUE_SPLIT = "_SEMI_CASCADER_SPLIT_";
function getPosition(e, t) {
return `${e}-${t}`
}
function isValid$2(e) {
return !_isNull(e) && !_isUndefined(e)
}
function normalizedArr(e) {
return Array.isArray(e) ? e : [e]
}
function filter$1(e, t, r, n) {
if (!r)
return !0;
let i, o = r;
return "boolean" == typeof r ? (o = (e, t) => {
const r = e.toLowerCase();
return t.toLowerCase().includes(r)
}
,
i = n.join("")) : i = n.join(),
o(e, i, t)
}
function traverseDataNodes(e, t) {
const r = (n, i, o) => {
const s = n ? n.children : e;
let a = null;
if (n) {
const e = o ? `${o.key}${VALUE_SPLIT}${n.value}` : `${n.value}`
, r = o ? getPosition(o.pos, i) : `${i}`;
a = {
data: Object.assign({}, n),
ind: i,
key: e,
pos: r,
level: o ? o.level + 1 : 0,
parentKey: o ? o.key : null,
path: o ? [...o.path, e] : [e],
valuePath: o ? [...o.valuePath, n.value] : [n.value]
},
t(a)
}
s && s.forEach(( (e, t) => {
r(e, t, a)
}
))
}
;
r(null)
}
function getKeysByValuePath(e) {
return (null == e ? void 0 : e.length) ? Array.isArray(e[0]) ? e.map((e
=> getKeyByValuePath(e))) : [getKeyByValuePath(e)] : []
}
function getKeyByValuePath(e) {
return e.join(VALUE_SPLIT)
}
function getKeyByPos(e, t) {
const r = e.split("-").map((e => Number(e)));
let n = t
, i = [];
return r.forEach(( (e, t) => {
var r;
n = 0 === t ? n[e] : null === (r = null == n ? void 0 : n.children)
|| void 0 === r ? void 0 : r[e],
i.push(null == n ? void 0 : n.value)
}
)),
getKeyByValuePath(i)
}
function convertDataToEntities(e) {
const t = {};
return traverseDataNodes(e, (e => {
const {key: r, parentKey: n} = e
, i = Object.assign({}, e);
t[r] = i,
i.parent = t[n],
i.parent && (i.parent.children = i.parent.children || [],
i.parent.children.push(i))
}
)),
t
}
function calcMergeType(e, t) {
let r;
return r = t ? strings$k.LEAF_ONLY_MERGE_TYPE : e ?
strings$k.AUTO_MERGE_VALUE_MERGE_TYPE : strings$k.NONE_MERGE_TYPE,
r
}
class CascaderFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.handleKeyDown = e => {
if (e.key === ESC_KEY) {
this.getState("isOpen") && this.close(e)
}
}
,
this.updateSearching = e => {
this._adapter.updateStates({
isSearching: !1
})
}
,
this.handleTagRemoveByKey = e => {
var t, r;
const {keyEntities: n} = this.getStates()
, {disabled: i} = this.getProps();
if (i)
return;
const o = null !== (t = n[e]) && void 0 !== t ? t : {};
!(null === (r = null == o ? void 0 : o.data) || void 0 === r ?
void 0 : r.disable) && this._handleMultipleSelect(o),
this._adapter.rePositionDropdown()
}
,
this.handleTagRemoveInTrigger = e => {
const {treeData: t} = this.getStates()
, r = getKeyByPos(e, t);
this.handleTagRemoveByKey(r)
}
}
init() {
const e = this.getProp("open") || this.getProp("defaultOpen");
this.collectOptions(!0),
this._adapter.updateLoadingKeyRefValue(new Set),
this._adapter.updateLoadedKeyRefValue(new Set),
e && !this._isDisabled() && this.open()
}
destroy() {
this._adapter.unregisterClickOutsideHandler()
}
_isDisabled() {
return this.getProp("disabled")
}
_isFilterable() {
return Boolean(this.getProp("filterTreeNode"))
}
_notifyChange(e) {
const {onChangeWithObject: t, multiple: r} = this.getProps()
, n = t ? [] : "value";
if (r) {
const t = [];
e.forEach((e => {
const r = this.getItemPropPath(e, n);
t.push(r)
}
)),
this._adapter.notifyChange(t)
} else {
const t = _isUndefined(e) || !("key"in e) ? [] :
this.getItemPropPath(e.key, n);
this._adapter.notifyChange(t)
}
}
_isLeaf(e) {
return this.getProp("loadData") ? Boolean(e.isLeaf) : !e.children
|| !e.children.length
}
_clearInput() {
this._adapter.updateInputValue("")
}
_notifyBlur(e) {
this._adapter.notifyBlur(e)
}
_notifyFocus(e) {
this._adapter.notifyFocus(e)
}
_isOptionDisabled(e, t) {
return findAncestorKeys([e], t, !0).some((e => t[e].data.disabled))
}
getItemPropPath(e, t, r) {
const n = r || this.getState("keyEntities")
, i = n[e];
let o = [];
if (i)
if (i._notExist)
o = i.path;
else {
const e = i.path;
o = Array.isArray(t) ? e.map((e => n[e].data)) : e.map((e
=> n[e].data[t]))
}
else
;return o
}
_getCacheValue(e) {
const {selectedKeys: t} = this.getStates()
, r = Array.from(t)[0];
let n;
if (_isEmpty(e[r]))
if (_includes(r, "not-exist-")) {
const t = r.match(/not-exist-(\S*)/)[1];
n = _isEmpty(e[t]) ? t : e[t].valuePath
} else
n = r;
else
n = e[r].valuePath;
return n
}
collectOptions() {
let e = arguments.length > 0 && void 0 !== arguments[0] &&
arguments[0];
const {treeData: t, value: r, defaultValue: n} = this.getProps()
, i = convertDataToEntities(t);
let o;
this._adapter.rePositionDropdown(),
e ? o = n : _isEmpty(i) || (o = this._getCacheValue(i));
const s = this._isControlledComponent() ? _isUndefined(r) ? [] :
r : o;
isValid$2(s) ? this.updateSelectedKey(s, i) :
this._adapter.updateStates({
keyEntities: i
})
}
handleValueChange(e) {
const {keyEntities: t} = this.getStates();
this.updateSelectedKey(e, t)
}
_getClearSelectedKey(e) {
const t = {}
, {searchPlaceholder: r, placeholder: n, multiple: i} =
this.getProps();
return t.selectedKeys = new Set([]),
t.activeKeys = new Set([]),
t.filteredKeys = new Set([]),
e && !i && (t.inputPlaceHolder = r || n || "",
t.inputValue = ""),
t
}
updateSelectedKey(e, t) {
const {changeOnSelect: r, onChangeWithObject: n, multiple: i} =
this.getProps()
, {activeKeys: o, loading: s, keyEntities: a, selectedKeys: l} =
this.getStates()
, c = this._adapter.getLoadingKeyRefValue()
, u = this._isFilterable()
, d = [...o].filter((e => c.has(e)))
, p = normalizedArr(e)
, h = n && _isObject(p[0]) ? p.map((e => e.value)) : p
, f = getKeysByValuePath(h);
let m = {};
const g = f.length > 0 ? f[0] : void 0
, y = g ? t[g] : void 0;
if (y)
if (r || this._isLeaf(y.data)) {
if (m.selectedKeys = new Set([g]),
d.length || (m.activeKeys = new Set(y.path)),
u && !i) {
const e = this.renderDisplayText(g, t);
m.inputPlaceHolder = e
}
} else
_isEqual(f, Array.from(l)) && (m =
this._getClearSelectedKey(u));
else if (e && e.length) {
const e = h[h.length - 1]
, r = `not-exist-${e}`
, n = {
data: {
label: e,
value: e
},
key: r,
path: h,
_notExist: !0
};
if (m.selectedKeys = new Set([r]),
u && !i) {
const e = this._defaultRenderText(h);
m.inputPlaceHolder = e
}
t[r] = n
} else {
if (s)
return m.keyEntities = _assign(a, t),
void this._adapter.updateStates(m);
m = this._getClearSelectedKey(u)
}
m.keyEntities = t,
this._adapter.updateStates(m)
}
open() {
const e = this._isFilterable()
, {multiple: t} = this.getProps();
this._adapter.openMenu(),
e && (this._clearInput(),
!t && this.toggle2SearchInput(!0)),
this._isControlledComponent() && this.reCalcActiveKeys(),
this._adapter.notifyDropdownVisibleChange(!0),
this._adapter.registerClickOutsideHandler((e => this.close(e)))
}
reCalcActiveKeys() {
const {selectedKeys: e, activeKeys: t, keyEntities: r} =
this.getStates()
, n = r[[...e][0]];
if (!n)
return;
const i = new Set(n.path);
_isEqual(i, t) || this._adapter.updateStates({
activeKeys: i
})
}
close(e, t) {
const {multiple: r} = this.getProps();
if (this._adapter.closeMenu(),
this._adapter.notifyDropdownVisibleChange(!1),
this._adapter.unregisterClickOutsideHandler(),
this._isFilterable()) {
const {selectedKeys: e, isSearching: n} = this.getStates();
let i = "";
t && !r ? i = this.renderDisplayText(t) : e.size && !r && (i =
this.renderDisplayText([...e][0])),
this._adapter.updateStates({
inputValue: i
}),
!r && this.toggle2SearchInput(!1),
!r && this._adapter.updateFocusState(!1)
}
this._notifyBlur(e)
}
focus() {
const {filterTreeNode: e} = this.getProps();
e && this._adapter.focusInput(),
this._adapter.updateFocusState(!0)
}
blur() {
const {filterTreeNode: e} = this.getProps();
e && this._adapter.blurInput(),
this._adapter.updateFocusState(!1)
}
toggle2SearchInput(e) {
e ? this._adapter.toggleInputShow(e, ( () => this.focus())) :
this._adapter.toggleInputShow(e, ( () => {}
))
}
handleItemClick(e, t) {
this._isDisabled() || (this.handleSingleSelect(e, t),
this._adapter.rePositionDropdown())
}
handleItemHover(e, t) {
this._isDisabled() || this.handleShowNextByHover(t)
}
handleShowNextByHover(e) {
const {keyEntities: t} = this.getStates()
, {data: r, key: n} = e
, i = this._isLeaf(r)
, o = t[n].path;
this._adapter.updateStates({
activeKeys: new Set(o)
}),
i || this.notifyIfLoadData(e)
}
onItemCheckboxClick(e) {
this._isDisabled() || (this._handleMultipleSelect(e),
this._adapter.rePositionDropdown())
}
handleClick(e) {
const t = this._isDisabled()
, r = this._isFilterable()
, {isOpen: n} = this.getStates();
t || (n ? n && !r && this.close(e) : (this.open(),
this._notifyFocus(e)))
}
handleSelectionEnterPress(e) {
isEnterPress(e) && this.handleClick(e)
}
toggleHoverState(e) {
this._adapter.toggleHovering(e)
}
_defaultRenderText(e, t) {
const r = this.getProp("separator");
return t && "function" == typeof t ? t(e) : e.join(r)
}
renderDisplayText(e, t) {
const r = this.getProp("displayRender")
, n = this.getProp("displayProp")
, i = this.getItemPropPath(e, n, t);
return this._defaultRenderText(i, r)
}
handleNodeLoad(e) {
const {data: t, key: r} = e
, n = new Set(this._adapter.getLoadingKeyRefValue())
, i = new Set(this._adapter.getLoadedKeyRefValue()).add(r)
, o = new Set([...n]);
o.delete(r),
this._adapter.notifyOnLoad(i, t),
this._adapter.updateLoadingKeyRefValue(o),
this._adapter.updateLoadedKeyRefValue(i),
this._adapter.updateStates({
loadingKeys: o,
loadedKeys: i
})
}
notifyIfLoadData(e) {
const {data: t, key: r} = e;
if (this._adapter.updateStates({
loading: !1
}),
!t.isLeaf && !t.children && this.getProp("loadData")) {
const t = this._adapter.getLoadedKeyRefValue()
, n = new Set(this._adapter.getLoadingKeyRefValue());
if (t.has(r) || n.has(r))
return;
this._adapter.updateStates({
loading: !0
});
const {keyEntities: i} = this.getStates()
, o = this.getItemPropPath(r, [], i)
, s = n.add(r);
this._adapter.updateLoadingKeyRefValue(s),
this._adapter.updateStates({
loadingKeys: s
}),
this._adapter.notifyLoadData(o, this.handleNodeLoad.bind(this,
e))
}
}
handleSingleSelect(e, t) {
const {changeOnSelect: r, filterLeafOnly: n, multiple: i,
enableLeafClick: o} = this.getProps()
, {keyEntities: s, selectedKeys: a, isSearching: l} =
this.getStates()
, c = this._isFilterable()
, {data: u, key: d} = t
, p = this._isLeaf(u)
, h = s[d].path
, f = [d]
, m = d !== [...a][0];
if (!p && !r && !l)
return this._adapter.updateStates({
activeKeys: new Set(h)
}),
void this.notifyIfLoadData(t);
if (i)
this._adapter.updateStates({
activeKeys: new Set(h)
}),
p && o && this.onItemCheckboxClick(t);
else if (this._adapter.notifySelect(u.value),
m) {
if (this._notifyChange(t),
this.notifyIfLoadData(t),
this._isControlledComponent())
return this._adapter.updateStates({
activeKeys: new Set(h)
}),
void (p && this.close(e));
this._adapter.updateStates({
activeKeys: new Set(h),
selectedKeys: new Set(f)
});
const r = this.renderDisplayText(d);
c && this._adapter.updateInputPlaceHolder(r),
(p || !n && l) && this.close(e, d)
} else
this.close(e)
}
_handleMultipleSelect(e) {
const {key: t} = e
, {checkedKeys: r, keyEntities: n, resolvedCheckedKeys: i} =
this.getStates()
, {autoMergeValue: o, max: s, disableStrictly: a, leafOnly: l} =
this.getProps()
, c = r.has(t)
, u = a ? this.calcCheckedStatus(!c, t) : !c
, {checkedKeys: d, halfCheckedKeys: p} = a ?
this.calcNonDisabledCheckedKeys(t, u) : this.calcCheckedKeys(t, u)
, h = calcMergeType(o, l)
, f = h === strings$k.LEAF_ONLY_MERGE_TYPE
, m = h === strings$k.NONE_MERGE_TYPE
, g = new Set(normalizeKeyList(d, n, f))
, y = m ? d : g;
if (_isNumber(s))
if (m) {
if (r.size < d.size && d.size > s) {
const e = [];
return d.forEach((t => {
e.push(n[t])
}
)),
void this._adapter.notifyOnExceed(e)
}
} else if (i.size < g.size && g.size > s) {
const e = [];
return g.forEach((t => {
e.push(n[t])
}
)),
void this._adapter.notifyOnExceed(e)
}
this._isControlledComponent() || this._adapter.updateStates({
checkedKeys: d,
halfCheckedKeys: p,
resolvedCheckedKeys: g
}),
this._notifyChange(y),
u && this._notifySelect(y),
this._adapter.updateStates({
inputValue: ""
})
}
calcNonDisabledCheckedKeys(e, t) {
const {keyEntities: r, disabledKeys: n} = this.getStates()
, i = new Set(this.getState("checkedKeys"))
, o = normalizeKeyList(findDescendantKeys([e], r, !1), r, !0);
if (!o.some((e => n.has(e))))
return this.calcCheckedKeys(e, t);
const s = o.filter((e => !n.has(e)));
return calcCheckedKeys(t ? [...s, ...i] :
_difference(normalizeKeyList([...i], r, !0), s), r)
}
calcCheckedStatus(e, t) {
if (!e)
return e;
const {checkedKeys: r, keyEntities: n, disabledKeys: i} =
this.getStates()
, o = normalizeKeyList(findDescendantKeys([t], n, !1), n, !0);
if (!o.some((e => i.has(e))))
return e;
return !o.filter((e => !i.has(e))).every((e => r.has(e)))
}
_notifySelect(e) {
const {keyEntities: t} = this.getStates()
, r = [];
e.forEach((e => {
var n, i;
const o = null === (i = null === (n = t[e]) || void 0 === n ?
void 0 : n.data) || void 0 === i ? void 0 : i.value;
void 0 !== o && r.push(o)
}
));
const n = 1 === r.length ? r[0] : r;
this._adapter.notifySelect(n)
}
calcCheckedKeys(e, t) {
const {keyEntities: r} = this.getStates()
, n = new Set(this.getState("checkedKeys"))
, i = new Set(this.getState("halfCheckedKeys"));
return t ? calcCheckedKeysForChecked(e, r, n, i) :
calcCheckedKeysForUnchecked(e, r, n, i)
}
handleInputChange(e) {
this._adapter.updateInputValue(e);
const {keyEntities: t} = this.getStates()
, {treeNodeFilterProp: r, filterTreeNode: n, filterLeafOnly: i} =
this.getProps();
let o = [];
e && (o = Object.values(t).filter((t => {
const {key: i, _notExist: o, data: s} = t;
if (o)
return !1;
const a = this.getItemPropPath(i, r);
return filter$1(e, s, n, a)
}
)).filter((e => n && !i || this._isLeaf(e))).map((e => e.key))),
this._adapter.updateStates({
isSearching: Boolean(e),
filteredKeys: new Set(o)
}),
this._adapter.notifyOnSearch(e),
this._adapter.rePositionDropdown()
}
handleClear() {
const {isSearching: e} = this.getStates()
, {searchPlaceholder: t, placeholder: r, multiple: n} =
this.getProps()
, i = this._isFilterable()
, o = this._isControlledComponent()
, s = {};
n ? (s.isSearching = !1,
this._adapter.updateInputValue(""),
this._adapter.notifyOnSearch(""),
s.checkedKeys = new Set([]),
s.halfCheckedKeys = new Set([]),
s.selectedKeys = new Set([]),
s.activeKeys = new Set([]),
s.resolvedCheckedKeys = new Set([]),
this._adapter.notifyChange([])) : i && e ? (s.isSearching = !1,
this._adapter.updateInputValue(""),
this._adapter.notifyOnSearch("")) : (i && (s.inputValue = "",
s.inputPlaceHolder = t || r || "",
this._adapter.updateInputValue(""),
this._adapter.notifyOnSearch("")),
o || (s.selectedKeys = new Set([])),
s.activeKeys = new Set([]),
s.filteredKeys = new Set([]),
this._adapter.notifyChange([])),
this._adapter.updateStates(s),
this._adapter.notifyClear(),
this._adapter.rePositionDropdown()
}
handleClearEnterPress(e) {
isEnterPress(e) && this.handleClear()
}
getRenderData() {
const {keyEntities: e, isSearching: t} = this.getStates()
, r = this._isFilterable();
return t && r ? this.getFilteredData() : Object.values(e).filter((e
=> null === e.parentKey && !e._notExist)).sort(( (e, t) => parseInt(e.ind, 10) -
parseInt(t.ind, 10)))
}
getFilteredData() {
const {treeNodeFilterProp: e, filterSorter: t} = this.getProps()
, {filteredKeys: r, keyEntities: n, inputValue: i} =
this.getStates()
, o = [];
return [...r].forEach((t => {
const r = n[t];
if (!r)
return;
const i = this.getItemPropPath(t, [])
, s = i.map((t => t[e]))
, a = this._isOptionDisabled(t, n);
o.push({
data: r.data,
pathData: i,
key: t,
disabled: a,
searchText: s
})
}
)),
_isFunction(t) && o.sort(( (e, r) => t(e.pathData, r.pathData,
i))),
o
}
handleListScroll(e, t) {
const {activeKeys: r, keyEntities: n} = this.getStates()
, i = [...r][r.size - 1]
, o = i ? _get(n, [i, "data"], null) : null;
this._adapter.notifyListScroll(e, {
panelIndex: t,
activeNode: o
})
}
}
const cascader = "";
var baseGetTag$3 = _baseGetTag
, isObjectLike$3 = isObjectLike_1
, boolTag$2 = "[object Boolean]";
function isBoolean(e) {
return !0 === e || !1 === e || isObjectLike$3(e) && baseGetTag$3(e) ==
boolTag$2
}
var isBoolean_1 = isBoolean;
const _isBoolean = getDefaultExportFromCjs(isBoolean_1)
, checkboxClasses = {
PREFIX: `${BASE_CLASS_PREFIX$1}-checkbox`,
INNER: `${BASE_CLASS_PREFIX$1}-checkbox-inner`,
TEXT: `${BASE_CLASS_PREFIX$1}-checkbox-text`,
INPUT: `${BASE_CLASS_PREFIX$1}-checkbox-input`,
CHECKED: `${BASE_CLASS_PREFIX$1}-checkbox-checked`,
DISABLED: `${BASE_CLASS_PREFIX$1}-checkbox-disabled`,
BUTTON: `${BASE_CLASS_PREFIX$1}-checkbox-button`,
WRAPPER: ""
}
, checkboxGroupClasses = {
PREFIX: `${BASE_CLASS_PREFIX$1}-checkboxGroup`,
INNER: `${BASE_CLASS_PREFIX$1}-checkboxGroup-inner`,
TEXT: `${BASE_CLASS_PREFIX$1}-checkboxGroup-text`,
INPUT: `${BASE_CLASS_PREFIX$1}-checkboxGroup-input`,
CHECKED: `${BASE_CLASS_PREFIX$1}-checkboxGroup-checked`,
DISABLED: `${BASE_CLASS_PREFIX$1}-checkboxGroup-disabled`
}
, strings$j = {
DIRECTION_SET: ["horizontal", "vertical"],
TYPE_DEFAULT: "default",
TYPE_CARD: "card",
TYPE_PURECARD: "pureCard",
DEFAULT_DIRECTION: "vertical"
};
class CheckboxFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.clickState = !1,
this.handleFocusVisible = e => {
const {target: t} = e;
try {
if (this.clickState)
return void (this.clickState = !1);
t.matches(":focus-visible") &&
this._adapter.setFocusVisible(!0)
} catch (r) {
warning$1(!0, "Warning: [Semi Checkbox] The current browser
does not support the focus-visible")
}
}
,
this.handleBlur = () => {
this.clickState = !1,
this._adapter.setFocusVisible(!1)
}
}
init() {
const {children: e, extra: t, extraId: r, addonId: n} =
this.getProps();
e && !n && this._adapter.setAddonId(),
t && !r && this._adapter.setExtraId()
}
notifyChange(e, t) {
const r = this._adapter.generateEvent(e, t);
this._adapter.notifyChange(r)
}
handleChange(e) {
if (this.getProp("disabled"))
return;
"click" === (null == e ? void 0 : e.type) && (this.clickState = !
0),
this._adapter.focusCheckboxEntity();
if (this._adapter.getIsInGroup()) {
return void (this._adapter.getGroupDisabled() ||
this.handleChangeInGroup(e))
}
const t = !this.getState("checked");
this._isControlledComponent("checked") || this.setChecked(t),
this.notifyChange(t, e)
}
handleChangeInGroup(e) {
const {value: t} = this.getProps()
, r = !this._adapter.getGroupValue().includes(t)
, n = this._adapter.generateEvent(r, e);
this._adapter.notifyChange(n),
this._adapter.notifyGroupChange(n)
}
handleEnterPress(e) {
isEnterPress(e) && this.handleChange(e)
}
setChecked(e) {
this._adapter.setNativeControlChecked(e)
}
destroy() {}
}
const CheckboxFoundation$1 = CheckboxFoundation
, Context$3 = React.createContext({});
class CheckboxInner extends reactExports.PureComponent {
blur() {
this.inputEntity.blur()
}
focus() {
const {preventScroll: e} = this.props;
this.inputEntity.focus({
preventScroll: e
})
}
render() {
const {indeterminate: e, checked: t, disabled: r, prefixCls: n,
name: i, isPureCardType: o, addonId: s, extraId: a, focusInner: l, onInputFocus: c,
onInputBlur: u} = this.props
, d = n || checkboxClasses.PREFIX
, p = classNames({
[`${d}-inner`]: !0,
[`${d}-inner-checked`]: Boolean(t),
[`${d}-inner-pureCardType`]: o
}, checkboxClasses.WRAPPER)
, h = classNames({
[`${d}-inner-display`]: !0,
[`${d}-focus`]: l,
[`${d}-focus-border`]: l && !t
})
, f = t ? React.createElement(IconCheckboxTick, null) : e ?
React.createElement(IconCheckboxIndeterminate, null) : null
, m = {
type: "checkbox",
"aria-label": this.props["aria-label"],
"aria-disabled": r,
"aria-checked": t,
"aria-labelledby": s,
"aria-describedby": a || this.props["aria-describedby"],
"aria-invalid": this.props["aria-invalid"],
"aria-errormessage": this.props["aria-errormessage"],
"aria-required": this.props["aria-required"],
className: checkboxClasses.INPUT,
onChange: _noop,
checked: t,
disabled: r,
onFocus: c,
onBlur: u
};
return i && (m.name = i),
React.createElement("span", {
className: p
}, React.createElement("input", Object.assign({}, m, {
ref: e => {
this.inputEntity = e
}
})), React.createElement("span", {
className: h
}, f))
}
}
CheckboxInner.contextType = Context$3,
CheckboxInner.propTypes = {
"aria-describedby": PropTypes.string,
"aria-errormessage": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-labelledby": PropTypes.string,
"aria-required": PropTypes.bool,
checked: PropTypes.bool,
disabled: PropTypes.bool,
onChange: PropTypes.func,
children: PropTypes.node,
grouped: PropTypes.bool,
value: PropTypes.any,
isPureCardType: PropTypes.bool,
addonId: PropTypes.string,
extraId: PropTypes.string,
focusInner: PropTypes.bool,
onInputFocus: PropTypes.func,
onInputBlur: PropTypes.func,
preventScroll: PropTypes.bool
},
CheckboxInner.defaultProps = {
onChange: _noop
};
const CheckboxInner$1 = CheckboxInner
, checkbox$2 = "";
let Checkbox$1 = class extends BaseComponent {
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setNativeControlChecked: e => {
this.setState({
checked: e
})
}
,
notifyChange: e => {
const {onChange: t} = this.props;
t && t(e)
}
,
generateEvent: (e, t) => {
const {props: r} = this;
return {
target: Object.assign(Object.assign({}, r), {
checked: e
}),
stopPropagation: () => {
t.stopPropagation()
}
,
preventDefault: () => {
t.preventDefault()
}
,
nativeEvent: {
stopImmediatePropagation: () => {
t.nativeEvent && "function" == typeof
t.nativeEvent.stopImmediatePropagation && t.nativeEvent.stopImmediatePropagation()
}
}
}
}
,
getIsInGroup: () => this.isInGroup(),
getGroupValue: () => this.context &&
this.context.checkboxGroup.value || [],
notifyGroupChange: e => {
this.context.checkboxGroup.onChange(e)
}
,
getGroupDisabled: () => this.context &&
this.context.checkboxGroup.disabled,
setAddonId: () => {
this.setState({
addonId: getUuidShort({
prefix: "addon"
})
})
}
,
setExtraId: () => {
this.setState({
extraId: getUuidShort({
prefix: "extra"
})
})
}
,
setFocusVisible: e => {
this.setState({
focusVisible: e
})
}
,
focusCheckboxEntity: () => {
this.focus()
}
})
}
constructor(e) {
super(e),
this.handleChange = e => this.foundation.handleChange(e),
this.handleEnterPress = e => this.foundation.handleEnterPress(e),
this.handleFocusVisible = e => {
this.foundation.handleFocusVisible(e)
}
,
this.handleBlur = e => {
this.foundation.handleBlur()
}
;
this.state = {
checked: e.checked || e.defaultChecked || !1,
addonId: e.addonId,
extraId: e.extraId,
focusVisible: !1
},
this.checkboxEntity = null,
this.foundation = new CheckboxFoundation$1(this.adapter)
}
componentDidUpdate(e) {
this.props.checked !== e.checked &&
(_isUndefined(this.props.checked) ? this.foundation.setChecked(!1) :
_isBoolean(this.props.checked) && this.foundation.setChecked(this.props.checked))
}
isInGroup() {
return Boolean(this.context && this.context.checkboxGroup &&
"value"in this.props)
}
focus() {
this.checkboxEntity && this.checkboxEntity.focus()
}
blur() {
this.checkboxEntity && this.checkboxEntity.blur()
}
render() {
const {disabled: e, style: t, prefixCls: r, className: n,
indeterminate: i, children: o, onMouseEnter: s, onMouseLeave: a, extra: l, value:
c, role: u, tabIndex: d, id: p, type: h} = this.props
, {checked: f, addonId: m, extraId: g, focusVisible: y} =
this.state
, v = {
checked: f,
disabled: e
}
, b = this.isInGroup();
if (b) {
if (this.context.checkboxGroup.value) {
const e = (this.context.checkboxGroup.value ||
[]).includes(c);
v.checked = e
}
this.context.checkboxGroup.disabled && (v.disabled =
this.context.checkboxGroup.disabled || this.props.disabled);
const {isCardType: e, isPureCardType: t} =
this.context.checkboxGroup;
v.isCardType = e,
v.isPureCardType = t,
v.name = this.context.checkboxGroup.name
} else
v.isPureCardType = h === strings$j.TYPE_PURECARD,
v.isCardType = h === strings$j.TYPE_CARD || v.isPureCardType;
const x = r || checkboxClasses.PREFIX
, _ = v.isCardType || v.isPureCardType
, E = classNames(x, {
[`${x}-disabled`]: v.disabled,
[`${x}-indeterminate`]: i,
[`${x}-checked`]: v.checked,
[`${x}-unChecked`]: !v.checked,
[`${x}-cardType`]: v.isCardType,
[`${x}-cardType_disabled`]: v.disabled && v.isCardType,
[`${x}-cardType_unDisabled`]: !(v.disabled && v.isCardType),
[`${x}-cardType_checked`]: v.isCardType && v.checked && !
v.disabled,
[`${x}-cardType_checked_disabled`]: v.isCardType && v.checked
&& v.disabled,
[n]: Boolean(n),
[`${x}-focus`]: y && _
})
, T = classNames(`${x}-extra`, {
[`${x}-cardType_extra_noChildren`]: v.isCardType && !o
});
b && this.context.checkboxGroup.name;
const C = this.props["x-semi-children-alias"] || "children";
return React.createElement("span", Object.assign({
role: u,
tabIndex: d,
style: t,
className: E,
id: p,
onMouseEnter: s,
onMouseLeave: a,
onClick: this.handleChange,
onKeyPress: this.handleEnterPress,
"aria-labelledby": this.props["aria-labelledby"]
}, this.getDataAttr(this.props)),
React.createElement(CheckboxInner$1, Object.assign({}, this.props, v, {
addonId: o && m,
extraId: l && g,
isPureCardType: v.isPureCardType,
ref: e => {
this.checkboxEntity = e
}
,
focusInner: y && !_,
onInputFocus: this.handleFocusVisible,
onInputBlur: this.handleBlur
})), o || l ? React.createElement("div", {
className: `${x}-content`
}, o ? React.createElement("span", {
id: m,
className: `${x}-addon`,
"x-semi-prop": C
}, o) : null, l ? React.createElement("div", {
id: g,
className: T,
"x-semi-prop": "extra"
}, l) : null) : null)
}
}
;
Checkbox$1.contextType = Context$3,
Checkbox$1.propTypes = {
"aria-describedby": PropTypes.string,
"aria-errormessage": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-labelledby": PropTypes.string,
"aria-required": PropTypes.bool,
checked: PropTypes.bool,
defaultChecked: PropTypes.bool,
disabled: PropTypes.bool,
indeterminate: PropTypes.bool,
onChange: PropTypes.func,
value: PropTypes.any,
style: PropTypes.object,
className: PropTypes.string,
prefixCls: PropTypes.string,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
extra: PropTypes.node,
index: PropTypes.number,
"aria-label": PropTypes.string,
tabIndex: PropTypes.number,
preventScroll: PropTypes.bool,
type: PropTypes.string
},
Checkbox$1.defaultProps = {
defaultChecked: !1,
indeterminate: !1,
onChange: _noop,
onMouseEnter: _noop,
onMouseLeave: _noop,
type: "default"
},
Checkbox$1.elementType = "Checkbox";
const Checkbox$2 = Checkbox$1;
class CheckboxGroupFoundation extends BaseFoundation$1 {
static get checkboxGroupDefaultAdapter() {
return {}
}
constructor(e) {
super(Object.assign(Object.assign({},
CheckboxGroupFoundation.checkboxGroupDefaultAdapter), e))
}
init() {
const {defaultValue: e, value: t} = this.getProps();
void 0 === e || Array.isArray(e) || warning$1(!0, "Warning: [Semi
CheckboxGroup] defaultValue should be an Array"),
void 0 === t || Array.isArray(t) || warning$1(!0, "Warning: [Semi
CheckboxGroup] value should be an Array")
}
notifyChange(e) {
this._adapter.notifyChange(e)
}
handleChange(e) {
const t = this.getState("value");
let r = [];
Array.isArray(t) || (r = [t]),
r = e.target.checked ? [...t, e.target.value] : t.filter(( (t, r)
=> t !== e.target.value));
"value"in this.getProps() || this._adapter.updateGroupValue(r),
this.notifyChange(r)
}
getFormatName() {
return this.getProp("name") || "default"
}
handlePropValueChange(e) {
Array.isArray(e) ? this._adapter.updateGroupValue(e) : (void 0 ===
e && this._adapter.updateGroupValue([]),
warning$1(!0, "Warning: [Semi CheckboxGroup] value should be an
Array"))
}
destroy() {}
}
const CheckboxGroupFoundation$1 = CheckboxGroupFoundation;
class CheckboxGroup extends BaseComponent {
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
updateGroupValue: e => {
this.setState({
value: e
})
}
,
notifyChange: e => {
this.props.onChange && this.props.onChange(e)
}
})
}
constructor(e) {
super(e),
this.state = {
value: e.value || e.defaultValue
},
this.foundation = new CheckboxGroupFoundation$1(this.adapter),
this.onChange = this.onChange.bind(this)
}
componentDidMount() {
this.foundation.init()
}
componentDidUpdate(e) {
_isEqual(e.value, this.props.value) ||
this.foundation.handlePropValueChange(this.props.value)
}
componentWillUnmount() {
this.foundation.destroy()
}
onChange(e) {
this.foundation.handleChange(e)
}
render() {
const {children: e, options: t, prefixCls: r, direction: n,
className: i, id: o, style: s, type: a, disabled: l} = this.props
, c = a === strings$j.TYPE_PURECARD
, u = a === strings$j.TYPE_CARD || c
, d = r || checkboxGroupClasses.PREFIX
, p = classNames({
[d]: !0,
[`${d}-wrapper`]: !0,
[`${d}-${n}`]: n,
[`${d}-${n}-cardType`]: n && u,
[`${d}-${n}-pureCardType`]: n && c
}, i)
, h = this.state.value.slice();
let f;
return t ? f = (t || []).map(( (e, t) => "string" == typeof e ?
React.createElement(Checkbox$2, {
role: "listitem",
key: t,
disabled: this.props.disabled,
value: e,
prefixCls: r
}, e) : React.createElement(Checkbox$2, {
role: "listitem",
key: t,
disabled: e.disabled || this.props.disabled,
value: e.value,
prefixCls: r,
extra: e.extra,
className: e.className,
style: e.style,
onChange: e.onChange
}, e.label))) : e && (f = React.Children.toArray(e).map(( (e, t) =>
React.cloneElement(e, {
key: t,
role: "listitem"
})))),
React.createElement("div", Object.assign({
id: o,
role: "list",
"aria-label": this.props["aria-label"],
className: p,
style: s,
"aria-labelledby": this.props["aria-labelledby"],
"aria-describedby": this.props["aria-describedby"]
}, this.getDataAttr(this.props)),
React.createElement(Context$3.Provider, {
value: {
checkboxGroup: {
onChange: this.onChange,
value: h,
disabled: this.props.disabled,
name: this.foundation.getFormatName(),
isCardType: u,
isPureCardType: c
}
}
}, f))
}
}
CheckboxGroup.propTypes = {
"aria-describedby": PropTypes.string,
"aria-errormessage": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-labelledby": PropTypes.string,
"aria-required": PropTypes.bool,
defaultValue: PropTypes.array,
disabled: PropTypes.bool,
name: PropTypes.string,
options: PropTypes.array,
value: PropTypes.array,
onChange: PropTypes.func,
children: PropTypes.node,
prefixCls: PropTypes.string,
direction: PropTypes.oneOf(strings$j.DIRECTION_SET),
className: PropTypes.string,
type: PropTypes.oneOf([strings$j.TYPE_DEFAULT, strings$j.TYPE_CARD,
strings$j.TYPE_PURECARD]),
style: PropTypes.object
},
CheckboxGroup.defaultProps = {
disabled: !1,
onChange: () => {}
,
type: strings$j.TYPE_DEFAULT,
defaultValue: [],
direction: strings$j.DEFAULT_DIRECTION
};
const CheckboxGroup$1 = CheckboxGroup;
class CheckboxWithGroup extends Checkbox$2 {
}
CheckboxWithGroup.Group = CheckboxGroup$1;
const Checkbox = CheckboxWithGroup;
var safeIsNaN = Number.isNaN || function(e) {
return "number" == typeof e && e != e
}
;
function isEqual(e, t) {
return e === t || !(!safeIsNaN(e) || !safeIsNaN(t))
}
function areInputsEqual(e, t) {
if (e.length !== t.length)
return !1;
for (var r = 0; r < e.length; r++)
if (!isEqual(e[r], t[r]))
return !1;
return !0
}
function memoizeOne(e, t) {
var r;
void 0 === t && (t = areInputsEqual);
var n, i = [], o = !1;
return function() {
for (var s = [], a = 0; a < arguments.length; a++)
s[a] = arguments[a];
return o && r === this && t(s, i) || (n = e.apply(this, s),
o = !0,
r = this,
i = s),
n
}
}
var hasNativePerformanceNow = "object" == typeof performance && "function"
== typeof performance.now
, now$2 = hasNativePerformanceNow ? function() {
return performance.now()
}
: function() {
return Date.now()
}
;
function cancelTimeout(e) {
cancelAnimationFrame(e.id)
}
function requestTimeout(e, t) {
var r = now$2();
var n = {
id: requestAnimationFrame((function i() {
now$2() - r >= t ? e.call(null) : n.id =
requestAnimationFrame(i)
}
))
};
return n
}
var size$1 = -1;
function getScrollbarSize(e) {
if (void 0 === e && (e = !1),
-1 === size$1 || e) {
var t = document.createElement("div")
, r = t.style;
r.width = "50px",
r.height = "50px",
r.overflow = "scroll",
document.body.appendChild(t),
size$1 = t.offsetWidth - t.clientWidth,
document.body.removeChild(t)
}
return size$1
}
var cachedRTLResult = null;
function getRTLOffsetType(e) {
if (void 0 === e && (e = !1),
null === cachedRTLResult || e) {
var t = document.createElement("div")
, r = t.style;
r.width = "50px",
r.height = "50px",
r.overflow = "scroll",
r.direction = "rtl";
var n = document.createElement("div")
, i = n.style;
return i.width = "100px",
i.height = "100px",
t.appendChild(n),
document.body.appendChild(t),
t.scrollLeft > 0 ? cachedRTLResult = "positive-descending" :
(t.scrollLeft = 1,
cachedRTLResult = 0 === t.scrollLeft ? "negative" : "positive-
ascending"),
document.body.removeChild(t),
cachedRTLResult
}
return cachedRTLResult
}
var IS_SCROLLING_DEBOUNCE_INTERVAL$1 = 150
, defaultItemKey$1 = function(e, t) {
return e
};
function createListComponent(e) {
var t, r = e.getItemOffset, n = e.getEstimatedTotalSize, i =
e.getItemSize, o = e.getOffsetForIndexAndAlignment, s = e.getStartIndexForOffset, a
= e.getStopIndexForStartIndex, l = e.initInstanceProps, c =
e.shouldResetStyleCacheOnItemSizeChange, u = e.validateProps;
return (t = function(e) {
function t(t) {
var n;
return (n = e.call(this, t) || this)._instanceProps =
l(n.props, _assertThisInitialized(n)),
n._outerRef = void 0,
n._resetIsScrollingTimeoutId = null,
n.state = {
instance: _assertThisInitialized(n),
isScrolling: !1,
scrollDirection: "forward",
scrollOffset: "number" == typeof
n.props.initialScrollOffset ? n.props.initialScrollOffset : 0,
scrollUpdateWasRequested: !1
},
n._callOnItemsRendered = void 0,
n._callOnItemsRendered = memoizeOne((function(e, t, r, i) {
return n.props.onItemsRendered({
overscanStartIndex: e,
overscanStopIndex: t,
visibleStartIndex: r,
visibleStopIndex: i
})
}
)),
n._callOnScroll = void 0,
n._callOnScroll = memoizeOne((function(e, t, r) {
return n.props.onScroll({
scrollDirection: e,
scrollOffset: t,
scrollUpdateWasRequested: r
})
}
)),
n._getItemStyle = void 0,
n._getItemStyle = function(e) {
var t, o = n.props, s = o.direction, a = o.itemSize, l =
o.layout, u = n._getItemStyleCache(c && a, c && l, c && s);
if (u.hasOwnProperty(e))
t = u[e];
else {
var d = r(n.props, e, n._instanceProps)
, p = i(n.props, e, n._instanceProps)
, h = "horizontal" === s || "horizontal" === l
, f = "rtl" === s
, m = h ? d : 0;
u[e] = t = {
position: "absolute",
left: f ? void 0 : m,
right: f ? m : void 0,
top: h ? 0 : d,
height: h ? "100%" : p,
width: h ? p : "100%"
}
}
return t
}
,
n._getItemStyleCache = void 0,
n._getItemStyleCache = memoizeOne((function(e, t, r) {
return {}
}
)),
n._onScrollHorizontal = function(e) {
var t = e.currentTarget
, r = t.clientWidth
, i = t.scrollLeft
, o = t.scrollWidth;
n.setState((function(e) {
if (e.scrollOffset === i)
return null;
var t = n.props.direction
, s = i;
if ("rtl" === t)
switch (getRTLOffsetType()) {
case "negative":
s = -i;
break;
case "positive-descending":
s = o - r - i
}
return s = Math.max(0, Math.min(s, o - r)),
{
isScrolling: !0,
scrollDirection: e.scrollOffset < s ? "forward" :
"backward",
scrollOffset: s,
scrollUpdateWasRequested: !1
}
}
), n._resetIsScrollingDebounced)
}
,
n._onScrollVertical = function(e) {
var t = e.currentTarget
, r = t.clientHeight
, i = t.scrollHeight
, o = t.scrollTop;
n.setState((function(e) {
if (e.scrollOffset === o)
return null;
var t = Math.max(0, Math.min(o, i - r));
return {
isScrolling: !0,
scrollDirection: e.scrollOffset < t ? "forward" :
"backward",
scrollOffset: t,
scrollUpdateWasRequested: !1
}
}
), n._resetIsScrollingDebounced)
}
,
n._outerRefSetter = function(e) {
var t = n.props.outerRef;
n._outerRef = e,
"function" == typeof t ? t(e) : null != t && "object" ==
typeof t && t.hasOwnProperty("current") && (t.current = e)
}
,
n._resetIsScrollingDebounced = function() {
null !== n._resetIsScrollingTimeoutId &&
cancelTimeout(n._resetIsScrollingTimeoutId),
n._resetIsScrollingTimeoutId =
requestTimeout(n._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1)
}
,
n._resetIsScrolling = function() {
n._resetIsScrollingTimeoutId = null,
n.setState({
isScrolling: !1
}, (function() {
n._getItemStyleCache(-1, null)
}
))
}
,
n
}
_inheritsLoose$1(t, e),
t.getDerivedStateFromProps = function(e, t) {
return validateSharedProps$1(e, t),
u(e),
null
}
;
var d = t.prototype;
return d.scrollTo = function(e) {
e = Math.max(0, e),
this.setState((function(t) {
return t.scrollOffset === e ? null : {
scrollDirection: t.scrollOffset < e ? "forward" :
"backward",
scrollOffset: e,
scrollUpdateWasRequested: !0
}
}
), this._resetIsScrollingDebounced)
}
,
d.scrollToItem = function(e, t) {
void 0 === t && (t = "auto");
var r = this.props
, n = r.itemCount
, i = r.layout
, s = this.state.scrollOffset;
e = Math.max(0, Math.min(e, n - 1));
var a = 0;
if (this._outerRef) {
var l = this._outerRef;
a = "vertical" === i ? l.scrollWidth > l.clientWidth ?
getScrollbarSize() : 0 : l.scrollHeight > l.clientHeight ? getScrollbarSize() : 0
}
this.scrollTo(o(this.props, e, t, s, this._instanceProps, a))
}
,
d.componentDidMount = function() {
var e = this.props
, t = e.direction
, r = e.initialScrollOffset
, n = e.layout;
if ("number" == typeof r && null != this._outerRef) {
var i = this._outerRef;
"horizontal" === t || "horizontal" === n ? i.scrollLeft = r
: i.scrollTop = r
}
this._callPropsCallbacks()
}
,
d.componentDidUpdate = function() {
var e = this.props
, t = e.direction
, r = e.layout
, n = this.state
, i = n.scrollOffset;
if (n.scrollUpdateWasRequested && null != this._outerRef) {
var o = this._outerRef;
if ("horizontal" === t || "horizontal" === r)
if ("rtl" === t)
switch (getRTLOffsetType()) {
case "negative":
o.scrollLeft = -i;
break;
case "positive-ascending":
o.scrollLeft = i;
break;
default:
var s = o.clientWidth
, a = o.scrollWidth;
o.scrollLeft = a - s - i
}
else
o.scrollLeft = i;
else
o.scrollTop = i
}
this._callPropsCallbacks()
}
,
d.componentWillUnmount = function() {
null !== this._resetIsScrollingTimeoutId &&
cancelTimeout(this._resetIsScrollingTimeoutId)
}
,
d.render = function() {
var e = this.props
, t = e.children
, r = e.className
, i = e.direction
, o = e.height
, s = e.innerRef
, a = e.innerElementType
, l = e.innerTagName
, c = e.itemCount
, u = e.itemData
, d = e.itemKey
, p = void 0 === d ? defaultItemKey$1 : d
, h = e.layout
, f = e.outerElementType
, m = e.outerTagName
, g = e.style
, y = e.useIsScrolling
, v = e.width
, b = this.state.isScrolling
, x = "horizontal" === i || "horizontal" === h
, _ = x ? this._onScrollHorizontal : this._onScrollVertical
, E = this._getRangeToRender()
, T = E[0]
, C = E[1]
, S = [];
if (c > 0)
for (var $ = T; $ <= C; $++)
S.push(reactExports.createElement(t, {
data: u,
key: p($, u),
index: $,
isScrolling: y ? b : void 0,
style: this._getItemStyle($)
}));
var w = n(this.props, this._instanceProps);
return reactExports.createElement(f || m || "div", {
className: r,
onScroll: _,
ref: this._outerRefSetter,
style: _extends$h({
position: "relative",
height: o,
width: v,
overflow: "auto",
WebkitOverflowScrolling: "touch",
willChange: "transform",
direction: i
}, g)
}, reactExports.createElement(a || l || "div", {
children: S,
ref: s,
style: {
height: x ? "100%" : w,
pointerEvents: b ? "none" : void 0,
width: x ? w : "100%"
}
}))
}
,
d._callPropsCallbacks = function() {
if ("function" == typeof this.props.onItemsRendered &&
this.props.itemCount > 0) {
var e = this._getRangeToRender()
, t = e[0]
, r = e[1]
, n = e[2]
, i = e[3];
this._callOnItemsRendered(t, r, n, i)
}
if ("function" == typeof this.props.onScroll) {
var o = this.state
, s = o.scrollDirection
, a = o.scrollOffset
, l = o.scrollUpdateWasRequested;
this._callOnScroll(s, a, l)
}
}
,
d._getRangeToRender = function() {
var e = this.props
, t = e.itemCount
, r = e.overscanCount
, n = this.state
, i = n.isScrolling
, o = n.scrollDirection
, l = n.scrollOffset;
if (0 === t)
return [0, 0, 0, 0];
var c = s(this.props, l, this._instanceProps)
, u = a(this.props, c, l, this._instanceProps)
, d = i && "backward" !== o ? 1 : Math.max(1, r)
, p = i && "forward" !== o ? 1 : Math.max(1, r);
return [Math.max(0, c - d), Math.max(0, Math.min(t - 1, u +
p)), c, u]
}
,
t
}(reactExports.PureComponent)).defaultProps = {
direction: "ltr",
itemData: void 0,
layout: "vertical",
overscanCount: 2,
useIsScrolling: !1
},
t
}
var validateSharedProps$1 = function(e, t) {
e.children,
e.direction,
e.height,
e.layout,
e.innerTagName,
e.outerTagName,
e.width,
t.instance
}
, FixedSizeList = createListComponent({
getItemOffset: function(e, t) {
return t * e.itemSize
},
getItemSize: function(e, t) {
return e.itemSize
},
getEstimatedTotalSize: function(e) {
var t = e.itemCount;
return e.itemSize * t
},
getOffsetForIndexAndAlignment: function(e, t, r, n, i, o) {
var s = e.direction
, a = e.height
, l = e.itemCount
, c = e.itemSize
, u = e.layout
, d = e.width
, p = "horizontal" === s || "horizontal" === u ? d : a
, h = Math.max(0, l * c - p)
, f = Math.min(h, t * c)
, m = Math.max(0, t * c - p + c + o);
switch ("smart" === r && (r = n >= m - p && n <= f + p ? "auto" :
"center"),
r) {
case "start":
return f;
case "end":
return m;
case "center":
var g = Math.round(m + (f - m) / 2);
return g < Math.ceil(p / 2) ? 0 : g > h + Math.floor(p / 2) ? h
: g;
default:
return n >= m && n <= f ? n : n < m ? m : f
}
},
getStartIndexForOffset: function(e, t) {
var r = e.itemCount
, n = e.itemSize;
return Math.max(0, Math.min(r - 1, Math.floor(t / n)))
},
getStopIndexForStartIndex: function(e, t, r) {
var n = e.direction
, i = e.height
, o = e.itemCount
, s = e.itemSize
, a = e.layout
, l = e.width
, c = t * s
, u = "horizontal" === n || "horizontal" === a ? l : i
, d = Math.ceil((u + r - c) / s);
return Math.max(0, Math.min(o - 1, t + d - 1))
},
initInstanceProps: function(e) {},
shouldResetStyleCacheOnItemSizeChange: !0,
validateProps: function(e) {
e.itemSize
}
});
const VirtualRow$2 = e => {
let {index: t, data: r, style: n} = e;
const {visibleOptions: i, renderOption: o} = r;
return o(i[t], t, n)
}
, VirtualRow$3 = VirtualRow$2
, prefixcls$5 = cssClasses$p.PREFIX_OPTION;
let Item$3 = class extends reactExports.PureComponent {
constructor() {
super(...arguments),
this.onClick = (e, t) => {
const {onItemClick: r} = this.props;
t.data.disabled || "disabled"in t && t.disabled || r(e, t)
}
,
this.handleItemEnterPress = (e, t) => {
isEnterPress(e) && this.onClick(e, t)
}
,
this.onHover = (e, t) => {
const {showNext: r, onItemHover: n} = this.props;
t.data.disabled || r === strings$k.SHOW_NEXT_BY_HOVER && n(e,
t)
}
,
this.onCheckboxChange = (e, t) => {
const {onItemCheckboxClick: r} = this.props;
e.stopPropagation(),
e.nativeEvent && "function" == typeof
e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation(),
r(t)
}
,
this.getItemStatus = e => {
const {activeKeys: t, selectedKeys: r, loadedKeys: n,
loadingKeys: i} = this.props
, o = {
active: !1,
selected: !1,
loading: !1
};
return t.has(e) && (o.active = !0),
r.has(e) && (o.selected = !0),
i.has(e) && !n.has(e) && (o.loading = !0),
o
}
,
this.renderIcon = function(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] &&
arguments[1];
const r = e => e + (t ? ` ${prefixcls$5}-icon-left` : "");
switch (e) {
case "child":
return React.createElement(IconChevronRight, {
className: r(`${prefixcls$5}-icon ${prefixcls$5}-icon-
expand`)
});
case "tick":
return React.createElement(IconTick, {
className: r(`${prefixcls$5}-icon ${prefixcls$5}-icon-
active`)
});
case "loading":
return React.createElement(Spin$1, {
wrapperClassName: r(`${prefixcls$5}-spin-icon`)
});
case "empty":
return React.createElement("span", {
"aria-hidden": !0,
className: r(`${prefixcls$5}-icon ${prefixcls$5}-icon-
empty`)
});
default:
return null
}
}
,
this.highlight = e => {
const t = []
, {keyword: r, separator: n} = this.props;
return e.forEach(( (i, o) => {
"string" == typeof i && _includes(i, r) ?
i.split(r).forEach(( (e, n) => {
n > 0 && t.push(React.createElement("span", {
className: `${prefixcls$5}-label-highlight`,
key: `${n}-${o}`
}, r)),
t.push(e)
}
)) : t.push(i),
o !== e.length - 1 && t.push(n)
}
)),
t
}
,
this.renderFlattenOptionItem = (e, t, r) => {
var n;
const {multiple: i, selectedKeys: o, checkedKeys: s,
halfCheckedKeys: a, keyword: l, filterRender: c, virtualize: u} = this.props
, {searchText: d, key: p, disabled: h, pathData: f} = e
, m = o.has(p)
, g = classNames(prefixcls$5, {
[`${prefixcls$5}-flatten`]: !c,
[`${prefixcls$5}-disabled`]: h,
[`${prefixcls$5}-select`]: m && !i
})
, y = t => {
this.onClick(t, e)
}
, v = t => this.onCheckboxChange(t, e);
if (c) {
const t = c({
className: g,
inputValue: l,
disabled: h,
data: f,
checkStatus: {
checked: s.has(e.key),
halfChecked: a.has(e.key)
},
selected: m,
onClick: y,
onCheck: v
})
, i = u ? {
key: p,
style: Object.assign(Object.assign({}, null !== (n =
t.props.style) && void 0 !== n ? n : {}), r)
} : {
key: p
};
return React.cloneElement(t, i)
}
return React.createElement("li", {
role: "menuitem",
className: g,
style: r,
key: p,
onClick: y,
onKeyPress: t => this.handleItemEnterPress(t, e)
}, React.createElement("span", {
className: `${prefixcls$5}-label`
}, !i && this.renderIcon("empty"), i &&
React.createElement(Checkbox, {
onChange: v,
disabled: h,
indeterminate: a.has(e.key),
checked: s.has(e.key),
className: `${prefixcls$5}-label-checkbox`
}), this.highlight(d)))
}
,
this.renderFlattenOption = e => {
const {virtualize: t} = this.props;
return React.createElement("ul", {
className: `${prefixcls$5}-list`,
key: "flatten-list"
}, t ? this.renderVirtualizeList(e) : e.map((e =>
this.renderFlattenOptionItem(e))))
}
,
this.renderVirtualizeList = e => {
var t;
const {direction: r} = this.context
, {virtualize: n} = this.props;
return React.createElement(FixedSizeList, {
height: n.height,
itemCount: e.length,
itemSize: n.itemSize,
itemData: {
visibleOptions: e,
renderOption: this.renderFlattenOptionItem
},
width: null !== (t = n.width) && void 0 !== t ? t : "100%",
style: {
direction: r
}
}, VirtualRow$3)
}
}
renderItem(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : [];
const {multiple: r, checkedKeys: n, halfCheckedKeys: i} =
this.props;
let o;
const s = t.length;
return t.push(React.createElement("ul", {
role: "menu",
className: `${prefixcls$5}-list`,
key: e[0].key,
onScroll: e => this.props.onListScroll(e, s)
}, e.map((e => {
const {data: t, key: s, parentKey: a} = e
, {children: l, label: c, disabled: u, isLeaf: d} = t
, {active: p, selected: h, loading: f} =
this.getItemStatus(s)
, m = Boolean(l) && l.length
, g = m || this.props.loadData && !d;
p && m && (o = e);
const y = classNames(prefixcls$5, {
[`${prefixcls$5}-active`]: p && !h,
[`${prefixcls$5}-select`]: h && !r,
[`${prefixcls$5}-disabled`]: u
})
, v = a ? {
"aria-owns": `cascaderItem-${a}`
} : {};
return React.createElement("li", Object.assign({
role: "menuitem",
id: `cascaderItem-${s}`,
"aria-expanded": p,
"aria-haspopup": Boolean(g),
"aria-disabled": u
}, v, {
className: y,
key: s,
onClick: t => {
this.onClick(t, e)
}
,
onKeyPress: t => this.handleItemEnterPress(t, e),
onMouseEnter: t => {
this.onHover(t, e)
}
}), React.createElement("span", {
className: `${prefixcls$5}-label`
}, h && !r && this.renderIcon("tick"), !h && !r &&
this.renderIcon("empty"), r && React.createElement(Checkbox, {
onChange: t => this.onCheckboxChange(t, e),
disabled: u,
indeterminate: i.has(e.key),
checked: n.has(e.key),
className: `${prefixcls$5}-label-checkbox`
}), React.createElement("span", null, c)), g ?
this.renderIcon(f ? "loading" : "child", !0) : null)
}
)))),
o && t.concat(this.renderItem(o.children, t)),
t
}
renderEmpty() {
const {emptyContent: e} = this.props;
return React.createElement(LocaleConsumer, {
componentName: "Cascader"
}, (t => React.createElement("ul", {
className: `${prefixcls$5} ${prefixcls$5}-empty`,
key: "empty-list"
}, React.createElement("span", {
className: `${prefixcls$5}-label`,
"x-semi-prop": "emptyContent"
}, e || t.emptyText))))
}
render() {
const {data: e, searchable: t} = this.props
, {direction: r} = this.context
, n = !e || !e.length;
let i;
const o = classNames({
[`${prefixcls$5}-lists`]: !0,
[`${prefixcls$5}-lists-rtl`]: "rtl" === r,
[`${prefixcls$5}-lists-empty`]: n
});
return i = n ? this.renderEmpty() : t ? this.renderFlattenOption(e)
: this.renderItem(e),
React.createElement("div", {
className: o
}, i)
}
}
;
Item$3.contextType = ConfigContext$1,
Item$3.propTypes = {
data: PropTypes.array,
emptyContent: PropTypes.node,
searchable: PropTypes.bool,
onItemClick: PropTypes.func,
onItemHover: PropTypes.func,
multiple: PropTypes.bool,
showNext: PropTypes.oneOf([strings$k.SHOW_NEXT_BY_CLICK,
strings$k.SHOW_NEXT_BY_HOVER]),
checkedKeys: PropTypes.object,
halfCheckedKeys: PropTypes.object,
onItemCheckboxClick: PropTypes.func,
separator: PropTypes.string,
keyword: PropTypes.string,
virtualize: PropTypes.object
},
Item$3.defaultProps = {
empty: !1
};
const cssClasses$o = {
PREFIX: `${BASE_CLASS_PREFIX$1}-tag`
}
, strings$i = {
TAG_SIZE: ["default", "small", "large"],
TAG_COLOR: ["grey", "red", "pink", "purple", "violet", "indigo",
"blue", "light-blue", "cyan", "teal", "green", "light-green", "lime", "yellow",
"amber", "orange", "white"],
TAG_TYPE: ["light", "solid", "ghost"],
AVATAR_SHAPE: ["square", "circle"]
}
, tag = "";
var __rest$J = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$n = cssClasses$o.PREFIX
, tagColors = strings$i.TAG_COLOR
, tagSize$1 = strings$i.TAG_SIZE
, tagType = strings$i.TAG_TYPE
, avatarShapeSet$1 = strings$i.AVATAR_SHAPE;
class Tag extends reactExports.Component {
constructor(e) {
super(e),
this.state = {
visible: !0
},
this.close = this.close.bind(this),
this.handleKeyDown = this.handleKeyDown.bind(this)
}
static getDerivedStateFromProps(e) {
return "visible"in e ? {
visible: e.visible
} : null
}
setVisible(e) {
"visible"in this.props || this.setState({
visible: e
})
}
close(e, t, r) {
const {onClose: n} = this.props;
e.stopPropagation(),
e.nativeEvent.stopImmediatePropagation(),
n && n(t, e, r),
e.defaultPrevented || this.setVisible(!1)
}
handleKeyDown(e) {
const {closable: t, onClick: r, onKeyDown: n} = this.props;
switch (e.key) {
case "Backspace":
case "Delete":
t && this.close(e, this.props.children, this.props.tagKey),
handlePrevent(e);
break;
case "Enter":
r(e),
handlePrevent(e);
break;
case "Escape":
e.target.blur()
}
n && n(e)
}
renderAvatar() {
const {avatarShape: e, avatarSrc: t} = this.props;
return React.createElement(Avatar, {
src: t,
shape: e
})
}
render() {
const e = this.props
, {tagKey: t, children: r, size: n, color: i, closable: o,
visible: s, onClose: a, onClick: l, className: c, type: u, shape: d, avatarSrc: p,
avatarShape: h, tabIndex: f, prefixIcon: m, suffixIcon: g} = e
, y = __rest$J(e, ["tagKey", "children", "size", "color",
"closable", "visible", "onClose", "onClick", "className", "type", "shape",
"avatarSrc", "avatarShape", "tabIndex", "prefixIcon", "suffixIcon"])
, {visible: v} = this.state
, b = l !== Tag.defaultProps.onClick || o
, x = {
role: "button",
tabIndex: f || 0,
onKeyDown: this.handleKeyDown
}
, _ = Object.assign(Object.assign({}, y), {
onClick: l,
tabIndex: f,
className: classNames(prefixCls$n, {
[`${prefixCls$n}-default`]: "default" === n,
[`${prefixCls$n}-small`]: "small" === n,
[`${prefixCls$n}-large`]: "large" === n,
[`${prefixCls$n}-square`]: "square" === d,
[`${prefixCls$n}-circle`]: "circle" === d,
[`${prefixCls$n}-${u}`]: u,
[`${prefixCls$n}-${i}-${u}`]: i && u,
[`${prefixCls$n}-closable`]: o,
[`${prefixCls$n}-invisible`]: !v,
[`${prefixCls$n}-avatar-${h}`]: p
}, c)
})
, E = b ? Object.assign(Object.assign({}, _), x) : _
, T = o ? React.createElement("div", {
className: `${prefixCls$n}-close`,
onClick: e => this.close(e, r, t)
}, React.createElement(IconClose, {
size: "small"
})) : null
, C = _isString(r)
, S = classNames(`${prefixCls$n}-content`, `${prefixCls$n}-
content-${C ? "ellipsis" : "center"}`);
return React.createElement("div", Object.assign({
"aria-label": this.props["aria-label"] || C ? `${o ? "Closable
" : ""}Tag: ${r}` : ""
}, E), m ? React.createElement("div", {
className: `${prefixCls$n}-prefix-icon`
}, m) : null, p ? this.renderAvatar() : null,
React.createElement("div", {
className: S
}, r), g ? React.createElement("div", {
className: `${prefixCls$n}-suffix-icon`
}, g) : null, T)
}
}
Tag.defaultProps = {
size: tagSize$1[0],
color: tagColors[0],
closable: !1,
type: tagType[0],
onClose: () => {}
,
onClick: () => {}
,
onMouseEnter: () => {}
,
style: {},
className: "",
shape: "square",
avatarShape: "square",
prefixIcon: null,
suffixIcon: null
},
Tag.propTypes = {
children: PropTypes.node,
tagKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
size: PropTypes.oneOf(tagSize$1),
color: PropTypes.oneOf(tagColors),
type: PropTypes.oneOf(tagType),
closable: PropTypes.bool,
visible: PropTypes.bool,
onClose: PropTypes.func,
onClick: PropTypes.func,
prefixIcon: PropTypes.node,
suffixIcon: PropTypes.node,
style: PropTypes.object,
className: PropTypes.string,
avatarSrc: PropTypes.string,
avatarShape: PropTypes.oneOf(avatarShapeSet$1),
"aria-label": PropTypes.string
};
const cssClasses$n = {
PREFIX: `${BASE_CLASS_PREFIX$1}-tagInput`
}
, strings$h = {
SIZE_SET: ["large", "default", "small"],
STATUS: ["success", "default", "error", "warning"]
}
, tagInput = ""
, getSplitedArray = (e, t) => {
let r = [];
if (_isString(t) || _isNumber(t))
r = e.split(t);
else if (_isArray(t)) {
const n = t[0];
r = e;
for (let e = 1; e < t.length; e++)
r = r.split(t[e]).join(n);
r = r.split(n)
} else
r.push(e);
return r
}
, getSplitedArray$1 = getSplitedArray;
function arrayMove$1(e, t, r) {
const n = e.slice();
return n.splice(r < 0 ? n.length + r : r, 0, n.splice(t, 1)[0]),
n
}
class TagInputFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.handleInputChange = e => {
const {value: t} = e.target
, {entering: r} = this.getStates();
(r || this._checkInputChangeValid(t)) && this._onInputChange(t,
e)
}
,
this.handleInputCompositionStart = e => {
const {maxLength: t} = this.getProps();
_isNumber(t) && this._adapter.setEntering(!0)
}
,
this.handleInputCompositionEnd = e => {
const {value: t} = e.target
, {maxLength: r, onInputExceed: n, separator: i} =
this.getProps();
if (!_isNumber(r))
return;
this._adapter.setEntering(!1);
let o = !0;
const s = getSplitedArray$1(t, i);
let a = 0;
for (; a < s.length; a++)
if (s[a].length > r) {
o = !1,
_isFunction(n) && n(t);
break
}
if (o)
this._adapter.setInputValue(t);
else {
const e = s.slice(0, a);
a < s.length && e.push(s[a].slice(0, r)),
this._adapter.setInputValue(e.join(i))
}
}
,
this._checkInputChangeValid = e => {
const {maxLength: t, onInputExceed: r, separator: n} =
this._adapter.getProps()
, {inputValue: i} = this._adapter.getStates();
let o = !0;
if (_isNumber(t)) {
const s = getSplitedArray$1(e, n)
, a = getSplitedArray$1(i, n)
, l = Math.max(s.length, a.length);
for (let n = 0; n < l; n++)
if (!_isUndefined(s[n]) && (_isUndefined(a[n]) ||
s[n].length > a[n].length) && s[n].length > t) {
o = !1,
_isFunction(r) && r(e);
break
}
}
return o
}
,
this.handleKeyDown = e => {
const {inputValue: t, tagsArray: r} = this._adapter.getStates()
, n = e.keyCode;
n === KeyCode.ENTER && (e.preventDefault(),
"" !== t && this._handleAddTags(e));
const {length: i} = r;
if (n === KeyCode.BACKSPACE && "" === t && i > 0) {
const e = r.slice(0, i - 1)
, t = r[i - 1];
this._onRemove(e, t, i - 1)
}
this._adapter.notifyKeyDown(e)
}
}
_handleAddTags(e) {
const {separator: t, max: r, onExceed: n, allowDuplicates: i} =
this._adapter.getProps()
, {inputValue: o, tagsArray: s} = this._adapter.getStates();
let a = getSplitedArray$1(o, t);
a = a.filter(( (e, t) => !(!i && (s.includes(e) || a.indexOf(e) !==
t)) && (_isString(e) && "" !== e.trim())));
let l = s.concat(a);
_isNumber(r) && l.length > r && (_isFunction(n) && n(l),
l = l.slice(0, r),
a = a.slice(0, r - s.length)),
a.length > 0 && this._onAdd(l, a),
this._onInputChange("", e)
}
handleInputBlur(e) {
const {addOnBlur: t} = this._adapter.getProps();
!0 === t && this._handleAddTags(e),
this._adapter.setFocusing(!1),
this._adapter.notifyBlur(e)
}
handleInputFocus(e) {
this._adapter.setFocusing(!0),
this._adapter.notifyFocus(e)
}
handleClearEnterPress(e) {
isEnterPress(e) && this.handleClearBtn(e)
}
handleClearBtn(e) {
const {inputValue: t, tagsArray: r} = this._adapter.getStates();
r.length > 0 && (this._adapter.setTagsArray([]),
this._adapter.notifyTagChange([])),
t.length > 0 && this._onInputChange("", e),
e.stopPropagation()
}
handleTagClose(e) {
const {tagsArray: t} = this._adapter.getStates()
, r = [...t];
r.splice(e, 1);
const n = t[e];
this._onRemove(r, n, e)
}
handleInputMouseEnter() {
this._adapter.setHovering(!0)
}
handleInputMouseLeave() {
this._adapter.setHovering(!1)
}
handleClick(e) {
const {disabled: t} = this.getProps();
if (t)
return;
this._adapter.getClickOutsideHandler() ||
(this._adapter.setActive(!0),
this._adapter.registerClickOutsideHandler((e =>
this.clickOutsideCallBack())))
}
clickOutsideCallBack() {
this._adapter.unregisterClickOutsideHandler(),
this._adapter.setActive(!1)
}
handleClickPrefixOrSuffix(e) {
const {disabled: t} = this._adapter.getProps()
, {isFocus: r} = this._adapter.getStates();
t || r || this._adapter.toggleFocusing(!0)
}
handlePreventMouseDown(e) {
e && _isFunction(e.preventDefault) && e.preventDefault()
}
_onRemove(e, t, r) {
this._isControlledComponent() || this._adapter.setTagsArray(e),
this._adapter.notifyTagChange(e),
this._adapter.notifyTagRemove(t, r)
}
_onAdd(e, t) {
this._isControlledComponent() || this._adapter.setTagsArray(e),
this._adapter.notifyTagChange(e),
this._adapter.notifyTagAdd(t)
}
_onInputChange(e, t) {
this._adapter.setInputValue(e),
this._adapter.notifyInputChange(e, t)
}
handleSortEnd(e) {
const {oldIndex: t, newIndex: r} = e
, {tagsArray: n} = this.getStates()
, i = arrayMove$1(n, t, r);
this._isControlledComponent() || this._adapter.setTagsArray(i),
this._adapter.notifyTagChange(i)
}
}
const TagInputFoundation$1 = TagInputFoundation;
function useCombinedRefs() {
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
t[r] = arguments[r];
return reactExports.useMemo(( () => e => {
t.forEach((t => t(e)))
}
), t)
}
const canUseDOM = "undefined" != typeof window && void 0 !==
window.document && void 0 !== window.document.createElement;
function isWindow(e) {
const t = Object.prototype.toString.call(e);
return "[object Window]" === t || "[object global]" === t
}
function isNode(e) {
return "nodeType"in e
}
function getWindow(e) {
var t, r;
return e ? isWindow(e) ? e : isNode(e) && null != (t = null == (r =
e.ownerDocument) ? void 0 : r.defaultView) ? t : window : window
}
function isDocument(e) {
const {Document: t} = getWindow(e);
return e instanceof t
}
function isHTMLElement(e) {
return !isWindow(e) && e instanceof getWindow(e).HTMLElement
}
function isSVGElement(e) {
return e instanceof getWindow(e).SVGElement
}
function getOwnerDocument(e) {
return e ? isWindow(e) ? e.document : isNode(e) ? isDocument(e) ? e :
isHTMLElement(e) || isSVGElement(e) ? e.ownerDocument : document : document :
document
}
const useIsomorphicLayoutEffect = canUseDOM ?
reactExports.useLayoutEffect : reactExports.useEffect;
function useEvent(e) {
const t = reactExports.useRef(e);
return useIsomorphicLayoutEffect(( () => {
t.current = e
}
)),
reactExports.useCallback((function() {
for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++)
r[n] = arguments[n];
return null == t.current ? void 0 : t.current(...r)
}
), [])
}
function useInterval() {
const e = reactExports.useRef(null);
return [reactExports.useCallback(( (t, r) => {
e.current = setInterval(t, r)
}
), []), reactExports.useCallback(( () => {
null !== e.current && (clearInterval(e.current),
e.current = null)
}
), [])]
}
function useLatestValue(e, t) {
void 0 === t && (t = [e]);
const r = reactExports.useRef(e);
return useIsomorphicLayoutEffect(( () => {
r.current !== e && (r.current = e)
}
), t),
r
}
function useLazyMemo(e, t) {
const r = reactExports.useRef();
return reactExports.useMemo(( () => {
const t = e(r.current);
return r.current = t,
t
}
), [...t])
}
function useNodeRef(e) {
const t = useEvent(e)
, r = reactExports.useRef(null)
, n = reactExports.useCallback((e => {
e !== r.current && (null == t || t(e, r.current)),
r.current = e
}
), []);
return [r, n]
}
function usePrevious(e) {
const t = reactExports.useRef();
return reactExports.useEffect(( () => {
t.current = e
}
), [e]),
t.current
}
let ids = {};
function useUniqueId(e, t) {
return reactExports.useMemo(( () => {
if (t)
return t;
const r = null == ids[e] ? 0 : ids[e] + 1;
return ids[e] = r,
e + "-" + r
}
), [e, t])
}
function createAdjustmentFn(e) {
return function(t) {
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), i
= 1; i < r; i++)
n[i - 1] = arguments[i];
return n.reduce(( (t, r) => {
const n = Object.entries(r);
for (const [i,o] of n) {
const r = t[i];
null != r && (t[i] = r + e * o)
}
return t
}
), {
...t
})
}
}
const add$2 = createAdjustmentFn(1)
, subtract = createAdjustmentFn(-1);
function hasViewportRelativeCoordinates(e) {
return "clientX"in e && "clientY"in e
}
function isKeyboardEvent(e) {
if (!e)
return !1;
const {KeyboardEvent: t} = getWindow(e.target);
return t && e instanceof t
}
function isTouchEvent(e) {
if (!e)
return !1;
const {TouchEvent: t} = getWindow(e.target);
return t && e instanceof t
}
function getEventCoordinates(e) {
if (isTouchEvent(e)) {
if (e.touches && e.touches.length) {
const {clientX: t, clientY: r} = e.touches[0];
return {
x: t,
y: r
}
}
if (e.changedTouches && e.changedTouches.length) {
const {clientX: t, clientY: r} = e.changedTouches[0];
return {
x: t,
y: r
}
}
}
return hasViewportRelativeCoordinates(e) ? {
x: e.clientX,
y: e.clientY
} : null
}
const CSS = Object.freeze({
Translate: {
toString(e) {
if (!e)
return;
const {x: t, y: r} = e;
return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (r ?
Math.round(r) : 0) + "px, 0)"
}
},
Scale: {
toString(e) {
if (!e)
return;
const {scaleX: t, scaleY: r} = e;
return "scaleX(" + t + ") scaleY(" + r + ")"
}
},
Transform: {
toString(e) {
if (e)
return [CSS.Translate.toString(e),
CSS.Scale.toString(e)].join(" ")
}
},
Transition: {
toString(e) {
let {property: t, duration: r, easing: n} = e;
return t + " " + r + "ms " + n
}
}
})
, SELECTOR =
"a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),texta
rea:not(:disabled),button:not(:disabled),*[tabindex]";
function findFirstFocusableNode(e) {
return e.matches(SELECTOR) ? e : e.querySelector(SELECTOR)
}
const hiddenStyles = {
display: "none"
};
function HiddenText(e) {
let {id: t, value: r} = e;
return React.createElement("div", {
id: t,
style: hiddenStyles
}, r)
}
function LiveRegion(e) {
let {id: t, announcement: r, ariaLiveType: n="assertive"} = e;
return React.createElement("div", {
id: t,
style: {
position: "fixed",
width: 1,
height: 1,
margin: -1,
border: 0,
padding: 0,
overflow: "hidden",
clip: "rect(0 0 0 0)",
clipPath: "inset(100%)",
whiteSpace: "nowrap"
},
role: "status",
"aria-live": n,
"aria-atomic": !0
}, r)
}
function useAnnouncement() {
const [e,t] = reactExports.useState("");
return {
announce: reactExports.useCallback((e => {
null != e && t(e)
}
), []),
announcement: e
}
}
const DndMonitorContext = reactExports.createContext(null);
function useDndMonitor(e) {
const t = reactExports.useContext(DndMonitorContext);
reactExports.useEffect(( () => {
if (!t)
throw new Error("useDndMonitor must be used within a children
of <DndContext>");
return t(e)
}
), [e, t])
}
function useDndMonitorProvider() {
const [e] = reactExports.useState(( () => new Set))
, t = reactExports.useCallback((t => (e.add(t),
() => e.delete(t))), [e]);
return [reactExports.useCallback((t => {
let {type: r, event: n} = t;
e.forEach((e => {
var t;
return null == (t = e[r]) ? void 0 : t.call(e, n)
}
))
}
), [e]), t]
}
const defaultScreenReaderInstructions = {
draggable: "\n To pick up a draggable item, press the space bar.\n
While dragging, use the arrow keys to move the item.\n Press space again to drop
the item in its new position, or press escape to cancel.\n "
}
, defaultAnnouncements = {
onDragStart(e) {
let {active: t} = e;
return "Picked up draggable item " + t.id + "."
},
onDragOver(e) {
let {active: t, over: r} = e;
return r ? "Draggable item " + t.id + " was moved over droppable
area " + r.id + "." : "Draggable item " + t.id + " is no longer over a droppable
area."
},
onDragEnd(e) {
let {active: t, over: r} = e;
return r ? "Draggable item " + t.id + " was dropped over droppable
area " + r.id : "Draggable item " + t.id + " was dropped."
},
onDragCancel(e) {
let {active: t} = e;
return "Dragging was cancelled. Draggable item " + t.id + " was
dropped."
}
};
function Accessibility(e) {
let {announcements: t=defaultAnnouncements, container: r,
hiddenTextDescribedById: n, screenReaderInstructions:
i=defaultScreenReaderInstructions} = e;
const {announce: o, announcement: s} = useAnnouncement()
, a = useUniqueId("DndLiveRegion")
, [l,c] = reactExports.useState(!1);
if (reactExports.useEffect(( () => {
c(!0)
}
), []),
useDndMonitor(reactExports.useMemo(( () => ({
onDragStart(e) {
let {active: r} = e;
o(t.onDragStart({
active: r
}))
},
onDragMove(e) {
let {active: r, over: n} = e;
t.onDragMove && o(t.onDragMove({
active: r,
over: n
}))
},
onDragOver(e) {
let {active: r, over: n} = e;
o(t.onDragOver({
active: r,
over: n
}))
},
onDragEnd(e) {
let {active: r, over: n} = e;
o(t.onDragEnd({
active: r,
over: n
}))
},
onDragCancel(e) {
let {active: r, over: n} = e;
o(t.onDragCancel({
active: r,
over: n
}))
}
})), [o, t])),
!l)
return null;
const u = React.createElement(React.Fragment, null,
React.createElement(HiddenText, {
id: n,
value: i.draggable
}), React.createElement(LiveRegion, {
id: a,
announcement: s
}));
return r ? reactDomExports.createPortal(u, r) : u
}
var Action, Action2;
function noop() {}
function useSensor(e, t) {
return reactExports.useMemo(( () => ({
sensor: e,
options: null != t ? t : {}
})), [e, t])
}
function useSensors() {
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
t[r] = arguments[r];
return reactExports.useMemo(( () => [...t].filter((e => null != e))),
[...t])
}
Action2 = Action || (Action = {}),
Action2.DragStart = "dragStart",
Action2.DragMove = "dragMove",
Action2.DragEnd = "dragEnd",
Action2.DragCancel = "dragCancel",
Action2.DragOver = "dragOver",
Action2.RegisterDroppable = "registerDroppable",
Action2.SetDroppableDisabled = "setDroppableDisabled",
Action2.UnregisterDroppable = "unregisterDroppable";
const defaultCoordinates = Object.freeze({
x: 0,
y: 0
});
function distanceBetween(e, t) {
return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2))
}
function getRelativeTransformOrigin(e, t) {
const r = getEventCoordinates(e);
if (!r)
return "0 0";
return (r.x - t.left) / t.width * 100 + "% " + (r.y - t.top) / t.height
* 100 + "%"
}
function sortCollisionsAsc(e, t) {
let {data: {value: r}} = e
, {data: {value: n}} = t;
return r - n
}
function sortCollisionsDesc(e, t) {
let {data: {value: r}} = e
, {data: {value: n}} = t;
return n - r
}
function cornersOfRectangle(e) {
let {left: t, top: r, height: n, width: i} = e;
return [{
x: t,
y: r
}, {
x: t + i,
y: r
}, {
x: t,
y: r + n
}, {
x: t + i,
y: r + n
}]
}
function getFirstCollision(e, t) {
if (!e || 0 === e.length)
return null;
const [r] = e;
return t ? r[t] : r
}
function centerOfRectangle(e, t, r) {
return void 0 === t && (t = e.left),
void 0 === r && (r = e.top),
{
x: t + .5 * e.width,
y: r + .5 * e.height
}
}
const closestCenter = e => {
let {collisionRect: t, droppableRects: r, droppableContainers: n} = e;
const i = centerOfRectangle(t, t.left, t.top)
, o = [];
for (const s of n) {
const {id: e} = s
, t = r.get(e);
if (t) {
const r = distanceBetween(centerOfRectangle(t), i);
o.push({
id: e,
data: {
droppableContainer: s,
value: r
}
})
}
}
return o.sort(sortCollisionsAsc)
}
, closestCorners = e => {
let {collisionRect: t, droppableRects: r, droppableContainers: n} = e;
const i = cornersOfRectangle(t)
, o = [];
for (const s of n) {
const {id: e} = s
, t = r.get(e);
if (t) {
const r = cornersOfRectangle(t)
, n = i.reduce(( (e, t, n) => e + distanceBetween(r[n], t)),
0)
, a = Number((n / 4).toFixed(4));
o.push({
id: e,
data: {
droppableContainer: s,
value: a
}
})
}
}
return o.sort(sortCollisionsAsc)
}
;
function getIntersectionRatio(e, t) {
const r = Math.max(t.top, e.top)
, n = Math.max(t.left, e.left)
, i = Math.min(t.left + t.width, e.left + e.width)
, o = Math.min(t.top + t.height, e.top + e.height)
, s = i - n
, a = o - r;
if (n < i && r < o) {
const r = t.width * t.height
, n = e.width * e.height
, i = s * a;
return Number((i / (r + n - i)).toFixed(4))
}
return 0
}
const rectIntersection = e => {
let {collisionRect: t, droppableRects: r, droppableContainers: n} = e;
const i = [];
for (const o of n) {
const {id: e} = o
, n = r.get(e);
if (n) {
const r = getIntersectionRatio(n, t);
r > 0 && i.push({
id: e,
data: {
droppableContainer: o,
value: r
}
})
}
}
return i.sort(sortCollisionsDesc)
}
;
function adjustScale(e, t, r) {
return {
...e,
scaleX: t && r ? t.width / r.width : 1,
scaleY: t && r ? t.height / r.height : 1
}
}
function getRectDelta(e, t) {
return e && t ? {
x: e.left - t.left,
y: e.top - t.top
} : defaultCoordinates
}
function createRectAdjustmentFn(e) {
return function(t) {
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), i
= 1; i < r; i++)
n[i - 1] = arguments[i];
return n.reduce(( (t, r) => ({
...t,
top: t.top + e * r.y,
bottom: t.bottom + e * r.y,
left: t.left + e * r.x,
right: t.right + e * r.x
})), {
...t
})
}
}
const getAdjustedRect = createRectAdjustmentFn(1);
function parseTransform(e) {
if (e.startsWith("matrix3d(")) {
const t = e.slice(9, -1).split(/, /);
return {
x: +t[12],
y: +t[13],
scaleX: +t[0],
scaleY: +t[5]
}
}
if (e.startsWith("matrix(")) {
const t = e.slice(7, -1).split(/, /);
return {
x: +t[4],
y: +t[5],
scaleX: +t[0],
scaleY: +t[3]
}
}
return null
}
function inverseTransform(e, t, r) {
const n = parseTransform(t);
if (!n)
return e;
const {scaleX: i, scaleY: o, x: s, y: a} = n
, l = e.left - s - (1 - i) * parseFloat(r)
, c = e.top - a - (1 - o) * parseFloat(r.slice(r.indexOf(" ") + 1))
, u = i ? e.width / i : e.width
, d = o ? e.height / o : e.height;
return {
width: u,
height: d,
top: c,
right: l + u,
bottom: c + d,
left: l
}
}
const defaultOptions$2 = {
ignoreTransform: !1
};
function getClientRect(e, t) {
void 0 === t && (t = defaultOptions$2);
let r = e.getBoundingClientRect();
if (t.ignoreTransform) {
const {transform: t, transformOrigin: n} =
getWindow(e).getComputedStyle(e);
t && (r = inverseTransform(r, t, n))
}
const {top: n, left: i, width: o, height: s, bottom: a, right: l} = r;
return {
top: n,
left: i,
width: o,
height: s,
bottom: a,
right: l
}
}
function getTransformAgnosticClientRect(e) {
return getClientRect(e, {
ignoreTransform: !0
})
}
function getWindowClientRect(e) {
const t = e.innerWidth
, r = e.innerHeight;
return {
top: 0,
left: 0,
right: t,
bottom: r,
width: t,
height: r
}
}
function isFixed(e, t) {
return void 0 === t && (t = getWindow(e).getComputedStyle(e)),
"fixed" === t.position
}
function isScrollable(e, t) {
void 0 === t && (t = getWindow(e).getComputedStyle(e));
const r = /(auto|scroll|overlay)/;
return ["overflow", "overflowX", "overflowY"].some((e => {
const n = t[e];
return "string" == typeof n && r.test(n)
}
))
}
function getScrollableAncestors(e, t) {
const r = [];
return e ? function n(i) {
if (null != t && r.length >= t)
return r;
if (!i)
return r;
if (isDocument(i) && null != i.scrollingElement && !
r.includes(i.scrollingElement))
return r.push(i.scrollingElement),
r;
if (!isHTMLElement(i) || isSVGElement(i))
return r;
if (r.includes(i))
return r;
const o = getWindow(e).getComputedStyle(i);
return i !== e && isScrollable(i, o) && r.push(i),
isFixed(i, o) ? r : n(i.parentNode)
}(e) : r
}
function getFirstScrollableAncestor(e) {
const [t] = getScrollableAncestors(e, 1);
return null != t ? t : null
}
function getScrollableElement(e) {
return canUseDOM && e ? isWindow(e) ? e : isNode(e) ? isDocument(e) ||
e === getOwnerDocument(e).scrollingElement ? window : isHTMLElement(e) ? e : null :
null : null
}
function getScrollXCoordinate(e) {
return isWindow(e) ? e.scrollX : e.scrollLeft
}
function getScrollYCoordinate(e) {
return isWindow(e) ? e.scrollY : e.scrollTop
}
function getScrollCoordinates(e) {
return {
x: getScrollXCoordinate(e),
y: getScrollYCoordinate(e)
}
}
var Direction, Direction2;
function isDocumentScrollingElement(e) {
return !(!canUseDOM || !e) && e === document.scrollingElement
}
function getScrollPosition(e) {
const t = {
x: 0,
y: 0
}
, r = isDocumentScrollingElement(e) ? {
height: window.innerHeight,
width: window.innerWidth
} : {
height: e.clientHeight,
width: e.clientWidth
}
, n = {
x: e.scrollWidth - r.width,
y: e.scrollHeight - r.height
};
return {
isTop: e.scrollTop <= t.y,
isLeft: e.scrollLeft <= t.x,
isBottom: e.scrollTop >= n.y,
isRight: e.scrollLeft >= n.x,
maxScroll: n,
minScroll: t
}
}
Direction2 = Direction || (Direction = {}),
Direction2[Direction2.Forward = 1] = "Forward",
Direction2[Direction2.Backward = -1] = "Backward";
const defaultThreshold$1 = {
x: .2,
y: .2
};
function getScrollDirectionAndSpeed(e, t, r, n, i) {
let {top: o, left: s, right: a, bottom: l} = r;
void 0 === n && (n = 10),
void 0 === i && (i = defaultThreshold$1);
const {isTop: c, isBottom: u, isLeft: d, isRight: p} =
getScrollPosition(e)
, h = {
x: 0,
y: 0
}
, f = {
x: 0,
y: 0
}
, m = t.height * i.y
, g = t.width * i.x;
return !c && o <= t.top + m ? (h.y = Direction.Backward,
f.y = n * Math.abs((t.top + m - o) / m)) : !u && l >= t.bottom - m &&
(h.y = Direction.Forward,
f.y = n * Math.abs((t.bottom - m - l) / m)),
!p && a >= t.right - g ? (h.x = Direction.Forward,
f.x = n * Math.abs((t.right - g - a) / g)) : !d && s <= t.left + g &&
(h.x = Direction.Backward,
f.x = n * Math.abs((t.left + g - s) / g)),
{
direction: h,
speed: f
}
}
function getScrollElementRect(e) {
if (e === document.scrollingElement) {
const {innerWidth: e, innerHeight: t} = window;
return {
top: 0,
left: 0,
right: e,
bottom: t,
width: e,
height: t
}
}
const {top: t, left: r, right: n, bottom: i} =
e.getBoundingClientRect();
return {
top: t,
left: r,
right: n,
bottom: i,
width: e.clientWidth,
height: e.clientHeight
}
}
function getScrollOffsets(e) {
return e.reduce(( (e, t) => add$2(e, getScrollCoordinates(t))),
defaultCoordinates)
}
function getScrollXOffset(e) {
return e.reduce(( (e, t) => e + getScrollXCoordinate(t)), 0)
}
function getScrollYOffset(e) {
return e.reduce(( (e, t) => e + getScrollYCoordinate(t)), 0)
}
function scrollIntoViewIfNeeded(e, t) {
if (void 0 === t && (t = getClientRect),
!e)
return;
const {top: r, left: n, bottom: i, right: o} = t(e);
getFirstScrollableAncestor(e) && (i <= 0 || o <= 0 || r >=
window.innerHeight || n >= window.innerWidth) && e.scrollIntoView({
block: "center",
inline: "center"
})
}
const properties = [["x", ["left", "right"], getScrollXOffset], ["y",
["top", "bottom"], getScrollYOffset]];
class Rect {
constructor(e, t) {
this.rect = void 0,
this.width = void 0,
this.height = void 0,
this.top = void 0,
this.bottom = void 0,
this.right = void 0,
this.left = void 0;
const r = getScrollableAncestors(t)
, n = getScrollOffsets(r);
this.rect = {
...e
},
this.width = e.width,
this.height = e.height;
for (const [i,o,s] of properties)
for (const e of o)
Object.defineProperty(this, e, {
get: () => {
const t = s(r)
, o = n[i] - t;
return this.rect[e] + o
}
,
enumerable: !0
});
Object.defineProperty(this, "rect", {
enumerable: !1
})
}
}
class Listeners {
constructor(e) {
this.target = void 0,
this.listeners = [],
this.removeAll = () => {
this.listeners.forEach((e => {
var t;
return null == (t = this.target) ? void 0 :
t.removeEventListener(...e)
}
))
}
,
this.target = e
}
add(e, t, r) {
var n;
null == (n = this.target) || n.addEventListener(e, t, r),
this.listeners.push([e, t, r])
}
}
function getEventListenerTarget(e) {
const {EventTarget: t} = getWindow(e);
return e instanceof t ? e : getOwnerDocument(e)
}
function hasExceededDistance(e, t) {
const r = Math.abs(e.x)
, n = Math.abs(e.y);
return "number" == typeof t ? Math.sqrt(r ** 2 + n ** 2) > t : "x"in t
&& "y"in t ? r > t.x && n > t.y : "x"in t ? r > t.x : "y"in t && n > t.y
}
var EventName, EventName2, KeyboardCode, KeyboardCode2;
function preventDefault(e) {
e.preventDefault()
}
function stopPropagation(e) {
e.stopPropagation()
}
EventName2 = EventName || (EventName = {}),
EventName2.Click = "click",
EventName2.DragStart = "dragstart",
EventName2.Keydown = "keydown",
EventName2.ContextMenu = "contextmenu",
EventName2.Resize = "resize",
EventName2.SelectionChange = "selectionchange",
EventName2.VisibilityChange = "visibilitychange",
KeyboardCode2 = KeyboardCode || (KeyboardCode = {}),
KeyboardCode2.Space = "Space",
KeyboardCode2.Down = "ArrowDown",
KeyboardCode2.Right = "ArrowRight",
KeyboardCode2.Left = "ArrowLeft",
KeyboardCode2.Up = "ArrowUp",
KeyboardCode2.Esc = "Escape",
KeyboardCode2.Enter = "Enter";
const defaultKeyboardCodes = {
start: [KeyboardCode.Space, KeyboardCode.Enter],
cancel: [KeyboardCode.Esc],
end: [KeyboardCode.Space, KeyboardCode.Enter]
}
, defaultKeyboardCoordinateGetter = (e, t) => {
let {currentCoordinates: r} = t;
switch (e.code) {
case KeyboardCode.Right:
return {
...r,
x: r.x + 25
};
case KeyboardCode.Left:
return {
...r,
x: r.x - 25
};
case KeyboardCode.Down:
return {
...r,
y: r.y + 25
};
case KeyboardCode.Up:
return {
...r,
y: r.y - 25
}
}
}
;
class KeyboardSensor {
constructor(e) {
this.props = void 0,
this.autoScrollEnabled = !1,
this.referenceCoordinates = void 0,
this.listeners = void 0,
this.windowListeners = void 0,
this.props = e;
const {event: {target: t}} = e;
this.props = e,
this.listeners = new Listeners(getOwnerDocument(t)),
this.windowListeners = new Listeners(getWindow(t)),
this.handleKeyDown = this.handleKeyDown.bind(this),
this.handleCancel = this.handleCancel.bind(this),
this.attach()
}
attach() {
this.handleStart(),
this.windowListeners.add(EventName.Resize, this.handleCancel),
this.windowListeners.add(EventName.VisibilityChange,
this.handleCancel),
setTimeout(( () => this.listeners.add(EventName.Keydown,
this.handleKeyDown)))
}
handleStart() {
const {activeNode: e, onStart: t} = this.props
, r = e.node.current;
r && scrollIntoViewIfNeeded(r),
t(defaultCoordinates)
}
handleKeyDown(e) {
if (isKeyboardEvent(e)) {
const {active: t, context: r, options: n} = this.props
, {keyboardCodes: i=defaultKeyboardCodes, coordinateGetter:
o=defaultKeyboardCoordinateGetter, scrollBehavior: s="smooth"} = n
, {code: a} = e;
if (i.end.includes(a))
return void this.handleEnd(e);
if (i.cancel.includes(a))
return void this.handleCancel(e);
const {collisionRect: l} = r.current
, c = l ? {
x: l.left,
y: l.top
} : defaultCoordinates;
this.referenceCoordinates || (this.referenceCoordinates = c);
const u = o(e, {
active: t,
context: r.current,
currentCoordinates: c
});
if (u) {
const t = subtract(u, c)
, n = {
x: 0,
y: 0
}
, {scrollableAncestors: i} = r.current;
for (const r of i) {
const i = e.code
, {isTop: o, isRight: a, isLeft: l, isBottom: c,
maxScroll: d, minScroll: p} = getScrollPosition(r)
, h = getScrollElementRect(r)
, f = {
x: Math.min(i === KeyboardCode.Right ? h.right -
h.width / 2 : h.right, Math.max(i === KeyboardCode.Right ? h.left : h.left +
h.width / 2, u.x)),
y: Math.min(i === KeyboardCode.Down ? h.bottom -
h.height / 2 : h.bottom, Math.max(i === KeyboardCode.Down ? h.top : h.top +
h.height / 2, u.y))
}
, m = i === KeyboardCode.Right && !a || i ===
KeyboardCode.Left && !l
, g = i === KeyboardCode.Down && !c || i ===
KeyboardCode.Up && !o;
if (m && f.x !== u.x) {
const e = r.scrollLeft + t.x
, o = i === KeyboardCode.Right && e <= d.x || i
=== KeyboardCode.Left && e >= p.x;
if (o && !t.y)
return void r.scrollTo({
left: e,
behavior: s
});
n.x = o ? r.scrollLeft - e : i ===
KeyboardCode.Right ? r.scrollLeft - d.x : r.scrollLeft - p.x,
n.x && r.scrollBy({
left: -n.x,
behavior: s
});
break
}
if (g && f.y !== u.y) {
const e = r.scrollTop + t.y
, o = i === KeyboardCode.Down && e <= d.y || i
=== KeyboardCode.Up && e >= p.y;
if (o && !t.x)
return void r.scrollTo({
top: e,
behavior: s
});
n.y = o ? r.scrollTop - e : i === KeyboardCode.Down
? r.scrollTop - d.y : r.scrollTop - p.y,
n.y && r.scrollBy({
top: -n.y,
behavior: s
});
break
}
}
this.handleMove(e, add$2(subtract(u,
this.referenceCoordinates), n))
}
}
}
handleMove(e, t) {
const {onMove: r} = this.props;
e.preventDefault(),
r(t)
}
handleEnd(e) {
const {onEnd: t} = this.props;
e.preventDefault(),
this.detach(),
t()
}
handleCancel(e) {
const {onCancel: t} = this.props;
e.preventDefault(),
this.detach(),
t()
}
detach() {
this.listeners.removeAll(),
this.windowListeners.removeAll()
}
}
function isDistanceConstraint(e) {
return Boolean(e && "distance"in e)
}
function isDelayConstraint(e) {
return Boolean(e && "delay"in e)
}
KeyboardSensor.activators = [{
eventName: "onKeyDown",
handler: (e, t, r) => {
let {keyboardCodes: n=defaultKeyboardCodes, onActivation: i} = t
, {active: o} = r;
const {code: s} = e.nativeEvent;
if (n.start.includes(s)) {
const t = o.activatorNode.current;
return (!t || e.target === t) && (e.preventDefault(),
null == i || i({
event: e.nativeEvent
}),
!0)
}
return !1
}
}];
class AbstractPointerSensor {
constructor(e, t, r) {
var n;
void 0 === r && (r = getEventListenerTarget(e.event.target)),
this.props = void 0,
this.events = void 0,
this.autoScrollEnabled = !0,
this.document = void 0,
this.activated = !1,
this.initialCoordinates = void 0,
this.timeoutId = null,
this.listeners = void 0,
this.documentListeners = void 0,
this.windowListeners = void 0,
this.props = e,
this.events = t;
const {event: i} = e
, {target: o} = i;
this.props = e,
this.events = t,
this.document = getOwnerDocument(o),
this.documentListeners = new Listeners(this.document),
this.listeners = new Listeners(r),
this.windowListeners = new Listeners(getWindow(o)),
this.initialCoordinates = null != (n = getEventCoordinates(i)) ?
n : defaultCoordinates,
this.handleStart = this.handleStart.bind(this),
this.handleMove = this.handleMove.bind(this),
this.handleEnd = this.handleEnd.bind(this),
this.handleCancel = this.handleCancel.bind(this),
this.handleKeydown = this.handleKeydown.bind(this),
this.removeTextSelection = this.removeTextSelection.bind(this),
this.attach()
}
attach() {
const {events: e, props: {options: {activationConstraint: t,
bypassActivationConstraint: r}}} = this;
if (this.listeners.add(e.move.name, this.handleMove, {
passive: !1
}),
this.listeners.add(e.end.name, this.handleEnd),
this.windowListeners.add(EventName.Resize, this.handleCancel),
this.windowListeners.add(EventName.DragStart, preventDefault),
this.windowListeners.add(EventName.VisibilityChange,
this.handleCancel),
this.windowListeners.add(EventName.ContextMenu, preventDefault),
this.documentListeners.add(EventName.Keydown, this.handleKeydown),
t) {
if (null != r && r({
event: this.props.event,
activeNode: this.props.activeNode,
options: this.props.options
}))
return this.handleStart();
if (isDelayConstraint(t))
return void (this.timeoutId = setTimeout(this.handleStart,
t.delay));
if (isDistanceConstraint(t))
return
}
this.handleStart()
}
detach() {
this.listeners.removeAll(),
this.windowListeners.removeAll(),
setTimeout(this.documentListeners.removeAll, 50),
null !== this.timeoutId && (clearTimeout(this.timeoutId),
this.timeoutId = null)
}
handleStart() {
const {initialCoordinates: e} = this
, {onStart: t} = this.props;
e && (this.activated = !0,
this.documentListeners.add(EventName.Click, stopPropagation, {
capture: !0
}),
this.removeTextSelection(),
this.documentListeners.add(EventName.SelectionChange,
this.removeTextSelection),
t(e))
}
handleMove(e) {
var t;
const {activated: r, initialCoordinates: n, props: i} = this
, {onMove: o, options: {activationConstraint: s}} = i;
if (!n)
return;
const a = null != (t = getEventCoordinates(e)) ? t :
defaultCoordinates
, l = subtract(n, a);
if (!r && s) {
if (isDistanceConstraint(s)) {
if (null != s.tolerance && hasExceededDistance(l,
s.tolerance))
return this.handleCancel();
if (hasExceededDistance(l, s.distance))
return this.handleStart()
}
return isDelayConstraint(s) && hasExceededDistance(l,
s.tolerance) ? this.handleCancel() : void 0
}
e.cancelable && e.preventDefault(),
o(a)
}
handleEnd() {
const {onEnd: e} = this.props;
this.detach(),
e()
}
handleCancel() {
const {onCancel: e} = this.props;
this.detach(),
e()
}
handleKeydown(e) {
e.code === KeyboardCode.Esc && this.handleCancel()
}
removeTextSelection() {
var e;
null == (e = this.document.getSelection()) || e.removeAllRanges()
}
}
const events$1 = {
move: {
name: "pointermove"
},
end: {
name: "pointerup"
}
};
class PointerSensor extends AbstractPointerSensor {
constructor(e) {
const {event: t} = e
, r = getOwnerDocument(t.target);
super(e, events$1, r)
}
}
PointerSensor.activators = [{
eventName: "onPointerDown",
handler: (e, t) => {
let {nativeEvent: r} = e
, {onActivation: n} = t;
return !(!r.isPrimary || 0 !== r.button) && (null == n || n({
event: r
}),
!0)
}
}];
const events$1$1 = {
move: {
name: "mousemove"
},
end: {
name: "mouseup"
}
};
var MouseButton, MouseButton2;
MouseButton2 = MouseButton || (MouseButton = {}),
MouseButton2[MouseButton2.RightClick = 2] = "RightClick";
class MouseSensor extends AbstractPointerSensor {
constructor(e) {
super(e, events$1$1, getOwnerDocument(e.event.target))
}
}
MouseSensor.activators = [{
eventName: "onMouseDown",
handler: (e, t) => {
let {nativeEvent: r} = e
, {onActivation: n} = t;
return r.button !== MouseButton.RightClick && (null == n || n({
event: r
}),
!0)
}
}];
const events$2 = {
move: {
name: "touchmove"
},
end: {
name: "touchend"
}
};
class TouchSensor extends AbstractPointerSensor {
constructor(e) {
super(e, events$2)
}
static setup() {
return window.addEventListener(events$2.move.name, e, {
capture: !1,
passive: !1
}),
function() {
window.removeEventListener(events$2.move.name, e)
}
;
function e() {}
}
}
var AutoScrollActivator, AutoScrollActivator2, TraversalOrder,
TraversalOrder2;
function useAutoScroller(e) {
let {acceleration: t, activator: r=AutoScrollActivator.Pointer,
canScroll: n, draggingRect: i, enabled: o, interval: s=5, order:
a=TraversalOrder.TreeOrder, pointerCoordinates: l, scrollableAncestors: c,
scrollableAncestorRects: u, delta: d, threshold: p} = e;
const h = useScrollIntent({
delta: d,
disabled: !o
})
, [f,m] = useInterval()
, g = reactExports.useRef({
x: 0,
y: 0
})
, y = reactExports.useRef({
x: 0,
y: 0
})
, v = reactExports.useMemo(( () => {
switch (r) {
case AutoScrollActivator.Pointer:
return l ? {
top: l.y,
bottom: l.y,
left: l.x,
right: l.x
} : null;
case AutoScrollActivator.DraggableRect:
return i
}
}
), [r, i, l])
, b = reactExports.useRef(null)
, x = reactExports.useCallback(( () => {
const e = b.current;
if (!e)
return;
const t = g.current.x * y.current.x
, r = g.current.y * y.current.y;
e.scrollBy(t, r)
}
), [])
, _ = reactExports.useMemo(( () => a === TraversalOrder.TreeOrder ?
[...c].reverse() : c), [a, c]);
reactExports.useEffect(( () => {
if (o && c.length && v) {
for (const e of _) {
if (!1 === (null == n ? void 0 : n(e)))
continue;
const r = c.indexOf(e)
, i = u[r];
if (!i)
continue;
const {direction: o, speed: a} =
getScrollDirectionAndSpeed(e, i, v, t, p);
for (const e of ["x", "y"])
h[e][o[e]] || (a[e] = 0,
o[e] = 0);
if (a.x > 0 || a.y > 0)
return m(),
b.current = e,
f(x, s),
g.current = a,
void (y.current = o)
}
g.current = {
x: 0,
y: 0
},
y.current = {
x: 0,
y: 0
},
m()
} else
m()
}
), [t, x, n, m, o, s, JSON.stringify(v), JSON.stringify(h), f, c, _, u,
JSON.stringify(p)])
}
TouchSensor.activators = [{
eventName: "onTouchStart",
handler: (e, t) => {
let {nativeEvent: r} = e
, {onActivation: n} = t;
const {touches: i} = r;
return !(i.length > 1) && (null == n || n({
event: r
}),
!0)
}
}],
AutoScrollActivator2 = AutoScrollActivator || (AutoScrollActivator = {}),
AutoScrollActivator2[AutoScrollActivator2.Pointer = 0] = "Pointer",
AutoScrollActivator2[AutoScrollActivator2.DraggableRect = 1] =
"DraggableRect",
TraversalOrder2 = TraversalOrder || (TraversalOrder = {}),
TraversalOrder2[TraversalOrder2.TreeOrder = 0] = "TreeOrder",
TraversalOrder2[TraversalOrder2.ReversedTreeOrder = 1] =
"ReversedTreeOrder";
const defaultScrollIntent = {
x: {
[Direction.Backward]: !1,
[Direction.Forward]: !1
},
y: {
[Direction.Backward]: !1,
[Direction.Forward]: !1
}
};
function useScrollIntent(e) {
let {delta: t, disabled: r} = e;
const n = usePrevious(t);
return useLazyMemo((e => {
if (r || !n || !e)
return defaultScrollIntent;
const i = Math.sign(t.x - n.x)
, o = Math.sign(t.y - n.y);
return {
x: {
[Direction.Backward]: e.x[Direction.Backward] || -1 === i,
[Direction.Forward]: e.x[Direction.Forward] || 1 === i
},
y: {
[Direction.Backward]: e.y[Direction.Backward] || -1 === o,
[Direction.Forward]: e.y[Direction.Forward] || 1 === o
}
}
}
), [r, t, n])
}
function useCachedNode(e, t) {
const r = null !== t ? e.get(t) : void 0
, n = r ? r.node.current : null;
return useLazyMemo((e => {
var r;
return null === t ? null : null != (r = null != n ? n : e) ? r :
null
}
), [n, t])
}
function useCombineActivators(e, t) {
return reactExports.useMemo(( () => e.reduce(( (e, r) => {
const {sensor: n} = r;
return [...e, ...n.activators.map((e => ({
eventName: e.eventName,
handler: t(e.handler, r)
})))]
}
), [])), [e, t])
}
var MeasuringStrategy, MeasuringStrategy2, MeasuringFrequency,
MeasuringFrequency2;
MeasuringStrategy2 = MeasuringStrategy || (MeasuringStrategy = {}),
MeasuringStrategy2[MeasuringStrategy2.Always = 0] = "Always",
MeasuringStrategy2[MeasuringStrategy2.BeforeDragging = 1] =
"BeforeDragging",
MeasuringStrategy2[MeasuringStrategy2.WhileDragging = 2] = "WhileDragging",
MeasuringFrequency2 = MeasuringFrequency || (MeasuringFrequency = {}),
MeasuringFrequency2.Optimized = "optimized";
const defaultValue = new Map;
function useDroppableMeasuring(e, t) {
let {dragging: r, dependencies: n, config: i} = t;
const [o,s] = reactExports.useState(null)
, {frequency: a, measure: l, strategy: c} = i
, u = reactExports.useRef(e)
, d = function() {
switch (c) {
case MeasuringStrategy.Always:
return !1;
case MeasuringStrategy.BeforeDragging:
return r;
default:
return !r
}
}()
, p = useLatestValue(d)
, h = reactExports.useCallback((function(e) {
void 0 === e && (e = []),
p.current || s((t => null === t ? e : t.concat(e.filter((e => !
t.includes(e))))))
}
), [p])
, f = reactExports.useRef(null)
, m = useLazyMemo((t => {
if (d && !r)
return defaultValue;
if (!t || t === defaultValue || u.current !== e || null != o) {
const t = new Map;
for (let r of e) {
if (!r)
continue;
if (o && o.length > 0 && !o.includes(r.id) &&
r.rect.current) {
t.set(r.id, r.rect.current);
continue
}
const e = r.node.current
, n = e ? new Rect(l(e),e) : null;
r.rect.current = n,
n && t.set(r.id, n)
}
return t
}
return t
}
), [e, o, r, d, l]);
return reactExports.useEffect(( () => {
u.current = e
}
), [e]),
reactExports.useEffect(( () => {
d || h()
}
), [r, d]),
reactExports.useEffect(( () => {
o && o.length > 0 && s(null)
}
), [JSON.stringify(o)]),
reactExports.useEffect(( () => {
d || "number" != typeof a || null !== f.current || (f.current =
setTimeout(( () => {
h(),
f.current = null
}
), a))
}
), [a, d, h, ...n]),
{
droppableRects: m,
measureDroppableContainers: h,
measuringScheduled: null != o
}
}
function useInitialValue(e, t) {
return useLazyMemo((r => e ? r || ("function" == typeof t ? t(e) : e) :
null), [t, e])
}
function useInitialRect(e, t) {
return useInitialValue(e, t)
}
function useMutationObserver(e) {
let {callback: t, disabled: r} = e;
const n = useEvent(t)
, i = reactExports.useMemo(( () => {
if (r || "undefined" == typeof window || void 0 ===
window.MutationObserver)
return;
const {MutationObserver: e} = window;
return new e(n)
}
), [n, r]);
return reactExports.useEffect(( () => () => null == i ? void 0 :
i.disconnect()), [i]),
i
}
function useResizeObserver(e) {
let {callback: t, disabled: r} = e;
const n = useEvent(t)
, i = reactExports.useMemo(( () => {
if (r || "undefined" == typeof window || void 0 ===
window.ResizeObserver)
return;
const {ResizeObserver: e} = window;
return new e(n)
}
), [r]);
return reactExports.useEffect(( () => () => null == i ? void 0 :
i.disconnect()), [i]),
i
}
function defaultMeasure(e) {
return new Rect(getClientRect(e),e)
}
function useRect(e, t, r) {
void 0 === t && (t = defaultMeasure);
const [n,i] = reactExports.useReducer((function(n) {
if (!e)
return null;
var i;
if (!1 === e.isConnected)
return null != (i = null != n ? n : r) ? i : null;
const o = t(e);
if (JSON.stringify(n) === JSON.stringify(o))
return n;
return o
}
), null)
, o = useMutationObserver({
callback(t) {
if (e)
for (const r of t) {
const {type: t, target: n} = r;
if ("childList" === t && n instanceof HTMLElement &&
n.contains(e)) {
i();
break
}
}
}
})
, s = useResizeObserver({
callback: i
});
return useIsomorphicLayoutEffect(( () => {
i(),
e ? (null == s || s.observe(e),
null == o || o.observe(document.body, {
childList: !0,
subtree: !0
})) : (null == s || s.disconnect(),
null == o || o.disconnect())
}
), [e]),
n
}
function useRectDelta(e) {
return getRectDelta(e, useInitialValue(e))
}
const defaultValue$1 = [];
function useScrollableAncestors(e) {
const t = reactExports.useRef(e)
, r = useLazyMemo((r => e ? r && r !== defaultValue$1 && e &&
t.current && e.parentNode === t.current.parentNode ? r :
getScrollableAncestors(e) : defaultValue$1), [e]);
return reactExports.useEffect(( () => {
t.current = e
}
), [e]),
r
}
function useScrollOffsets(e) {
const [t,r] = reactExports.useState(null)
, n = reactExports.useRef(e)
, i = reactExports.useCallback((e => {
const t = getScrollableElement(e.target);
t && r((e => e ? (e.set(t, getScrollCoordinates(t)),
new Map(e)) : null))
}
), []);
return reactExports.useEffect(( () => {
const t = n.current;
if (e !== t) {
o(t);
const s = e.map((e => {
const t = getScrollableElement(e);
return t ? (t.addEventListener("scroll", i, {
passive: !0
}),
[t, getScrollCoordinates(t)]) : null
}
)).filter((e => null != e));
r(s.length ? new Map(s) : null),
n.current = e
}
return () => {
o(e),
o(t)
}
;
function o(e) {
e.forEach((e => {
const t = getScrollableElement(e);
null == t || t.removeEventListener("scroll", i)
}
))
}
}
), [i, e]),
reactExports.useMemo(( () => e.length ? t ?
Array.from(t.values()).reduce(( (e, t) => add$2(e, t)), defaultCoordinates) :
getScrollOffsets(e) : defaultCoordinates), [e, t])
}
function useScrollOffsetsDelta(e, t) {
void 0 === t && (t = []);
const r = reactExports.useRef(null);
return reactExports.useEffect(( () => {
r.current = null
}
), t),
reactExports.useEffect(( () => {
const t = e !== defaultCoordinates;
t && !r.current && (r.current = e),
!t && r.current && (r.current = null)
}
), [e]),
r.current ? subtract(e, r.current) : defaultCoordinates
}
function useSensorSetup(e) {
reactExports.useEffect(( () => {
if (!canUseDOM)
return;
const t = e.map((e => {
let {sensor: t} = e;
return null == t.setup ? void 0 : t.setup()
}
));
return () => {
for (const e of t)
null == e || e()
}
}
), e.map((e => {
let {sensor: t} = e;
return t
}
)))
}
function useSyntheticListeners(e, t) {
return reactExports.useMemo(( () => e.reduce(( (e, r) => {
let {eventName: n, handler: i} = r;
return e[n] = e => {
i(e, t)
}
,
e
}
), {})), [e, t])
}
function useWindowRect(e) {
return reactExports.useMemo(( () => e ? getWindowClientRect(e) : null),
[e])
}
const defaultValue$2 = [];
function useRects(e, t) {
void 0 === t && (t = getClientRect);
const [r] = e
, n = useWindowRect(r ? getWindow(r) : null)
, [i,o] = reactExports.useReducer((function() {
if (!e.length)
return defaultValue$2;
return e.map((e => isDocumentScrollingElement(e) ? n : new
Rect(t(e),e)))
}
), defaultValue$2)
, s = useResizeObserver({
callback: o
});
return e.length > 0 && i === defaultValue$2 && o(),
useIsomorphicLayoutEffect(( () => {
e.length ? e.forEach((e => null == s ? void 0 : s.observe(e))) :
(null == s || s.disconnect(),
o())
}
), [e]),
i
}
function getMeasurableNode(e) {
if (!e)
return null;
if (e.children.length > 1)
return e;
const t = e.children[0];
return isHTMLElement(t) ? t : e
}
function useDragOverlayMeasuring(e) {
let {measure: t} = e;
const [r,n] = reactExports.useState(null)
, i = useResizeObserver({
callback: reactExports.useCallback((e => {
for (const {target: r} of e)
if (isHTMLElement(r)) {
n((e => {
const n = t(r);
return e ? {
...e,
width: n.width,
height: n.height
} : n
}
));
break
}
}
), [t])
})
, o = reactExports.useCallback((e => {
const r = getMeasurableNode(e);
null == i || i.disconnect(),
r && (null == i || i.observe(r)),
n(r ? t(r) : null)
}
), [t, i])
, [s,a] = useNodeRef(o);
return reactExports.useMemo(( () => ({
nodeRef: s,
rect: r,
setRef: a
})), [r, s, a])
}
const defaultSensors = [{
sensor: PointerSensor,
options: {}
}, {
sensor: KeyboardSensor,
options: {}
}]
, defaultData = {
current: {}
}
, defaultMeasuringConfiguration = {
draggable: {
measure: getTransformAgnosticClientRect
},
droppable: {
measure: getTransformAgnosticClientRect,
strategy: MeasuringStrategy.WhileDragging,
frequency: MeasuringFrequency.Optimized
},
dragOverlay: {
measure: getClientRect
}
};
class DroppableContainersMap extends Map {
get(e) {
var t;
return null != e && null != (t = super.get(e)) ? t : void 0
}
toArray() {
return Array.from(this.values())
}
getEnabled() {
return this.toArray().filter((e => {
let {disabled: t} = e;
return !t
}
))
}
getNodeFor(e) {
var t, r;
return null != (t = null == (r = this.get(e)) ? void 0 :
r.node.current) ? t : void 0
}
}
const defaultPublicContext = {
activatorEvent: null,
active: null,
activeNode: null,
activeNodeRect: null,
collisions: null,
containerNodeRect: null,
draggableNodes: new Map,
droppableRects: new Map,
droppableContainers: new DroppableContainersMap,
over: null,
dragOverlay: {
nodeRef: {
current: null
},
rect: null,
setRef: noop
},
scrollableAncestors: [],
scrollableAncestorRects: [],
measuringConfiguration: defaultMeasuringConfiguration,
measureDroppableContainers: noop,
windowRect: null,
measuringScheduled: !1
}
, defaultInternalContext = {
activatorEvent: null,
activators: [],
active: null,
activeNodeRect: null,
ariaDescribedById: {
draggable: ""
},
dispatch: noop,
draggableNodes: new Map,
over: null,
measureDroppableContainers: noop
}
, InternalContext = reactExports.createContext(defaultInternalContext)
, PublicContext = reactExports.createContext(defaultPublicContext);
function getInitialState() {
return {
draggable: {
active: null,
initialCoordinates: {
x: 0,
y: 0
},
nodes: new Map,
translate: {
x: 0,
y: 0
}
},
droppable: {
containers: new DroppableContainersMap
}
}
}
function reducer(e, t) {
switch (t.type) {
case Action.DragStart:
return {
...e,
draggable: {
...e.draggable,
initialCoordinates: t.initialCoordinates,
active: t.active
}
};
case Action.DragMove:
return e.draggable.active ? {
...e,
draggable: {
...e.draggable,
translate: {
x: t.coordinates.x - e.draggable.initialCoordinates.x,
y: t.coordinates.y - e.draggable.initialCoordinates.y
}
}
} : e;
case Action.DragEnd:
case Action.DragCancel:
return {
...e,
draggable: {
...e.draggable,
active: null,
initialCoordinates: {
x: 0,
y: 0
},
translate: {
x: 0,
y: 0
}
}
};
case Action.RegisterDroppable:
{
const {element: r} = t
, {id: n} = r
, i = new DroppableContainersMap(e.droppable.containers);
return i.set(n, r),
{
...e,
droppable: {
...e.droppable,
containers: i
}
}
}
case Action.SetDroppableDisabled:
{
const {id: r, key: n, disabled: i} = t
, o = e.droppable.containers.get(r);
if (!o || n !== o.key)
return e;
const s = new DroppableContainersMap(e.droppable.containers);
return s.set(r, {
...o,
disabled: i
}),
{
...e,
droppable: {
...e.droppable,
containers: s
}
}
}
case Action.UnregisterDroppable:
{
const {id: r, key: n} = t
, i = e.droppable.containers.get(r);
if (!i || n !== i.key)
return e;
const o = new DroppableContainersMap(e.droppable.containers);
return o.delete(r),
{
...e,
droppable: {
...e.droppable,
containers: o
}
}
}
default:
return e
}
}
function RestoreFocus(e) {
let {disabled: t} = e;
const {active: r, activatorEvent: n, draggableNodes: i} =
reactExports.useContext(InternalContext)
, o = usePrevious(n)
, s = usePrevious(null == r ? void 0 : r.id);
return reactExports.useEffect(( () => {
if (!t && !n && o && null != s) {
if (!isKeyboardEvent(o))
return;
if (document.activeElement === o.target)
return;
const e = i.get(s);
if (!e)
return;
const {activatorNode: t, node: r} = e;
if (!t.current && !r.current)
return;
requestAnimationFrame(( () => {
for (const e of [t.current, r.current]) {
if (!e)
continue;
const t = findFirstFocusableNode(e);
if (t) {
t.focus();
break
}
}
}
))
}
}
), [n, t, i, s, o]),
null
}
function applyModifiers(e, t) {
let {transform: r, ...n} = t;
return null != e && e.length ? e.reduce(( (e, t) => t({
transform: e,
...n
})), r) : r
}
function useMeasuringConfiguration(e) {
return reactExports.useMemo(( () => ({
draggable: {
...defaultMeasuringConfiguration.draggable,
...null == e ? void 0 : e.draggable
},
droppable: {
...defaultMeasuringConfiguration.droppable,
...null == e ? void 0 : e.droppable
},
dragOverlay: {
...defaultMeasuringConfiguration.dragOverlay,
...null == e ? void 0 : e.dragOverlay
}
})), [null == e ? void 0 : e.draggable, null == e ? void 0 :
e.droppable, null == e ? void 0 : e.dragOverlay])
}
function useLayoutShiftScrollCompensation(e) {
let {activeNode: t, measure: r, initialRect: n, config: i=!0} = e;
const o = reactExports.useRef(!1)
, {x: s, y: a} = "boolean" == typeof i ? {
x: i,
y: i
} : i;
useIsomorphicLayoutEffect(( () => {
if (!s && !a || !t)
return void (o.current = !1);
if (o.current || !n)
return;
const e = null == t ? void 0 : t.node.current;
if (!e || !1 === e.isConnected)
return;
const i = getRectDelta(r(e), n);
if (s || (i.x = 0),
a || (i.y = 0),
o.current = !0,
Math.abs(i.x) > 0 || Math.abs(i.y) > 0) {
const t = getFirstScrollableAncestor(e);
t && t.scrollBy({
top: i.y,
left: i.x
})
}
}
), [t, s, a, n, r])
}
const ActiveDraggableContext = reactExports.createContext({
...defaultCoordinates,
scaleX: 1,
scaleY: 1
});
var Status, Status2;
Status2 = Status || (Status = {}),
Status2[Status2.Uninitialized = 0] = "Uninitialized",
Status2[Status2.Initializing = 1] = "Initializing",
Status2[Status2.Initialized = 2] = "Initialized";
const DndContext = reactExports.memo((function(e) {
var t, r, n, i;
let {id: o, accessibility: s, autoScroll: a=!0, children: l, sensors:
c=defaultSensors, collisionDetection: u=rectIntersection, measuring: d, modifiers:
p, ...h} = e;
const f = reactExports.useReducer(reducer, void 0, getInitialState)
, [m,g] = f
, [y,v] = useDndMonitorProvider()
, [b,x] = reactExports.useState(Status.Uninitialized)
, _ = b === Status.Initialized
, {draggable: {active: E, nodes: T, translate: C}, droppable:
{containers: S}} = m
, $ = E ? T.get(E) : null
, w = reactExports.useRef({
initial: null,
translated: null
})
, P = reactExports.useMemo(( () => {
var e;
return null != E ? {
id: E,
data: null != (e = null == $ ? void 0 : $.data) ? e :
defaultData,
rect: w
} : null
}
), [E, $])
, R = reactExports.useRef(null)
, [k,A] = reactExports.useState(null)
, [I,O] = reactExports.useState(null)
, D = useLatestValue(h, Object.values(h))
, M = useUniqueId("DndDescribedBy", o)
, L = reactExports.useMemo(( () => S.getEnabled()), [S])
, j = useMeasuringConfiguration(d)
, {droppableRects: F, measureDroppableContainers: N,
measuringScheduled: B} = useDroppableMeasuring(L, {
dragging: _,
dependencies: [C.x, C.y],
config: j.droppable
})
, z = useCachedNode(T, E)
, U = reactExports.useMemo(( () => I ? getEventCoordinates(I) :
null), [I])
, V = function() {
const e = !1 === (null == k ? void 0 : k.autoScrollEnabled)
, t = "object" == typeof a ? !1 === a.enabled : !1 === a
, r = _ && !e && !t;
if ("object" == typeof a)
return {
...a,
enabled: r
};
return {
enabled: r
}
}()
, H = useInitialRect(z, j.draggable.measure);
useLayoutShiftScrollCompensation({
activeNode: E ? T.get(E) : null,
config: V.layoutShiftCompensation,
initialRect: H,
measure: j.draggable.measure
});
const G = useRect(z, j.draggable.measure, H)
, W = useRect(z ? z.parentElement : null)
, Y = reactExports.useRef({
activatorEvent: null,
active: null,
activeNode: z,
collisionRect: null,
collisions: null,
droppableRects: F,
draggableNodes: T,
draggingNode: null,
draggingNodeRect: null,
droppableContainers: S,
over: null,
scrollableAncestors: [],
scrollAdjustedTranslate: null
})
, K = S.getNodeFor(null == (t = Y.current.over) ? void 0 : t.id)
, X = useDragOverlayMeasuring({
measure: j.dragOverlay.measure
})
, q = null != (r = X.nodeRef.current) ? r : z
, Z = _ ? null != (n = X.rect) ? n : G : null
, Q = Boolean(X.nodeRef.current && X.rect)
, J = useRectDelta(Q ? null : G)
, ee = useWindowRect(q ? getWindow(q) : null)
, te = useScrollableAncestors(_ ? null != K ? K : z : null)
, re = useRects(te)
, ne = applyModifiers(p, {
transform: {
x: C.x - J.x,
y: C.y - J.y,
scaleX: 1,
scaleY: 1
},
activatorEvent: I,
active: P,
activeNodeRect: G,
containerNodeRect: W,
draggingNodeRect: Z,
over: Y.current.over,
overlayNodeRect: X.rect,
scrollableAncestors: te,
scrollableAncestorRects: re,
windowRect: ee
})
, ie = U ? add$2(U, C) : null
, oe = useScrollOffsets(te)
, se = useScrollOffsetsDelta(oe)
, ae = useScrollOffsetsDelta(oe, [G])
, le = add$2(ne, se)
, ce = Z ? getAdjustedRect(Z, ne) : null
, ue = P && ce ? u({
active: P,
collisionRect: ce,
droppableRects: F,
droppableContainers: L,
pointerCoordinates: ie
}) : null
, de = getFirstCollision(ue, "id")
, [pe,he] = reactExports.useState(null)
, fe = adjustScale(Q ? ne : add$2(ne, ae), null != (i = null == pe ?
void 0 : pe.rect) ? i : null, G)
, me = reactExports.useCallback(( (e, t) => {
let {sensor: r, options: n} = t;
if (null == R.current)
return;
const i = T.get(R.current);
if (!i)
return;
const o = e.nativeEvent
, s = new r({
active: R.current,
activeNode: i,
event: o,
options: n,
context: Y,
onStart(e) {
const t = R.current;
if (null == t)
return;
const r = T.get(t);
if (!r)
return;
const {onDragStart: n} = D.current
, i = {
active: {
id: t,
data: r.data,
rect: w
}
};
reactDomExports.unstable_batchedUpdates(( () => {
null == n || n(i),
x(Status.Initializing),
g({
type: Action.DragStart,
initialCoordinates: e,
active: t
}),
y({
type: "onDragStart",
event: i
})
}
))
},
onMove(e) {
g({
type: Action.DragMove,
coordinates: e
})
},
onEnd: a(Action.DragEnd),
onCancel: a(Action.DragCancel)
});
function a(e) {
return async function() {
const {active: t, collisions: r, over: n,
scrollAdjustedTranslate: i} = Y.current;
let s = null;
if (t && i) {
const {cancelDrop: a} = D.current;
if (s = {
activatorEvent: o,
active: t,
collisions: r,
delta: i,
over: n
},
e === Action.DragEnd && "function" == typeof a) {
await Promise.resolve(a(s)) && (e =
Action.DragCancel)
}
}
R.current = null,
reactDomExports.unstable_batchedUpdates(( () => {
g({
type: e
}),
x(Status.Uninitialized),
he(null),
A(null),
O(null);
const t = e === Action.DragEnd ? "onDragEnd" :
"onDragCancel";
if (s) {
const e = D.current[t];
null == e || e(s),
y({
type: t,
event: s
})
}
}
))
}
}
reactDomExports.unstable_batchedUpdates(( () => {
A(s),
O(e.nativeEvent)
}
))
}
), [T])
, ge = useCombineActivators(c, reactExports.useCallback(( (e, t) =>
(r, n) => {
const i = r.nativeEvent
, o = T.get(n);
if (null !== R.current || !o || i.dndKit || i.defaultPrevented)
return;
const s = {
active: o
};
!0 === e(r, t.options, s) && (i.dndKit = {
capturedBy: t.sensor
},
R.current = n,
me(r, t))
}
), [T, me]));
useSensorSetup(c),
useIsomorphicLayoutEffect(( () => {
G && b === Status.Initializing && x(Status.Initialized)
}
), [G, b]),
reactExports.useEffect(( () => {
const {onDragMove: e} = D.current
, {active: t, activatorEvent: r, collisions: n, over: i} =
Y.current;
if (!t || !r)
return;
const o = {
active: t,
activatorEvent: r,
collisions: n,
delta: {
x: le.x,
y: le.y
},
over: i
};
reactDomExports.unstable_batchedUpdates(( () => {
null == e || e(o),
y({
type: "onDragMove",
event: o
})
}
))
}
), [le.x, le.y]),
reactExports.useEffect(( () => {
const {active: e, activatorEvent: t, collisions: r,
droppableContainers: n, scrollAdjustedTranslate: i} = Y.current;
if (!e || null == R.current || !t || !i)
return;
const {onDragOver: o} = D.current
, s = n.get(de)
, a = s && s.rect.current ? {
id: s.id,
rect: s.rect.current,
data: s.data,
disabled: s.disabled
} : null
, l = {
active: e,
activatorEvent: t,
collisions: r,
delta: {
x: i.x,
y: i.y
},
over: a
};
reactDomExports.unstable_batchedUpdates(( () => {
he(a),
null == o || o(l),
y({
type: "onDragOver",
event: l
})
}
))
}
), [de]),
useIsomorphicLayoutEffect(( () => {
Y.current = {
activatorEvent: I,
active: P,
activeNode: z,
collisionRect: ce,
collisions: ue,
droppableRects: F,
draggableNodes: T,
draggingNode: q,
draggingNodeRect: Z,
droppableContainers: S,
over: pe,
scrollableAncestors: te,
scrollAdjustedTranslate: le
},
w.current = {
initial: Z,
translated: ce
}
}
), [P, z, ue, ce, T, q, Z, F, S, pe, te, le]),
useAutoScroller({
...V,
delta: C,
draggingRect: ce,
pointerCoordinates: ie,
scrollableAncestors: te,
scrollableAncestorRects: re
});
const ye = reactExports.useMemo(( () => ({
active: P,
activeNode: z,
activeNodeRect: G,
activatorEvent: I,
collisions: ue,
containerNodeRect: W,
dragOverlay: X,
draggableNodes: T,
droppableContainers: S,
droppableRects: F,
over: pe,
measureDroppableContainers: N,
scrollableAncestors: te,
scrollableAncestorRects: re,
measuringConfiguration: j,
measuringScheduled: B,
windowRect: ee
})), [P, z, G, I, ue, W, X, T, S, F, pe, N, te, re, j, B, ee])
, ve = reactExports.useMemo(( () => ({
activatorEvent: I,
activators: ge,
active: P,
activeNodeRect: G,
ariaDescribedById: {
draggable: M
},
dispatch: g,
draggableNodes: T,
over: pe,
measureDroppableContainers: N
})), [I, ge, P, G, g, M, T, pe, N]);
return React.createElement(DndMonitorContext.Provider, {
value: v
}, React.createElement(InternalContext.Provider, {
value: ve
}, React.createElement(PublicContext.Provider, {
value: ye
}, React.createElement(ActiveDraggableContext.Provider, {
value: fe
}, l)), React.createElement(RestoreFocus, {
disabled: !1 === (null == s ? void 0 : s.restoreFocus)
})), React.createElement(Accessibility, {
...s,
hiddenTextDescribedById: M
}))
}
))
, NullContext = reactExports.createContext(null)
, defaultRole = "button"
, ID_PREFIX$1 = "Droppable";
function useDraggable(e) {
let {id: t, data: r, disabled: n=!1, attributes: i} = e;
const o = useUniqueId(ID_PREFIX$1)
, {activators: s, activatorEvent: a, active: l, activeNodeRect: c,
ariaDescribedById: u, draggableNodes: d, over: p} =
reactExports.useContext(InternalContext)
, {role: h=defaultRole, roleDescription: f="draggable", tabIndex:
m=0} = null != i ? i : {}
, g = (null == l ? void 0 : l.id) === t
, y = reactExports.useContext(g ? ActiveDraggableContext :
NullContext)
, [v,b] = useNodeRef()
, [x,_] = useNodeRef()
, E = useSyntheticListeners(s, t)
, T = useLatestValue(r);
useIsomorphicLayoutEffect(( () => (d.set(t, {
id: t,
key: o,
node: v,
activatorNode: x,
data: T
}),
() => {
const e = d.get(t);
e && e.key === o && d.delete(t)
}
)), [d, t]);
return {
active: l,
activatorEvent: a,
activeNodeRect: c,
attributes: reactExports.useMemo(( () => ({
role: h,
tabIndex: m,
"aria-disabled": n,
"aria-pressed": !(!g || h !== defaultRole) || void 0,
"aria-roledescription": f,
"aria-describedby": u.draggable
})), [n, h, m, g, f, u.draggable]),
isDragging: g,
listeners: n ? void 0 : E,
node: v,
over: p,
setNodeRef: b,
setActivatorNodeRef: _,
transform: y
}
}
function useDndContext() {
return reactExports.useContext(PublicContext)
}
const ID_PREFIX$1$1 = "Droppable"
, defaultResizeObserverConfig = {
timeout: 25
};
function useDroppable(e) {
let {data: t, disabled: r=!1, id: n, resizeObserverConfig: i} = e;
const o = useUniqueId(ID_PREFIX$1$1)
, {active: s, dispatch: a, over: l, measureDroppableContainers: c} =
reactExports.useContext(InternalContext)
, u = reactExports.useRef({
disabled: r
})
, d = reactExports.useRef(!1)
, p = reactExports.useRef(null)
, h = reactExports.useRef(null)
, {disabled: f, updateMeasurementsFor: m, timeout: g} = {
...defaultResizeObserverConfig,
...i
}
, y = useLatestValue(null != m ? m : n)
, v = useResizeObserver({
callback: reactExports.useCallback(( () => {
d.current ? (null != h.current && clearTimeout(h.current),
h.current = setTimeout(( () => {
c(Array.isArray(y.current) ? y.current : [y.current]),
h.current = null
}
), g)) : d.current = !0
}
), [g]),
disabled: f || !s
})
, b = reactExports.useCallback(( (e, t) => {
v && (t && (v.unobserve(t),
d.current = !1),
e && v.observe(e))
}
), [v])
, [x,_] = useNodeRef(b)
, E = useLatestValue(t);
return reactExports.useEffect(( () => {
v && x.current && (v.disconnect(),
d.current = !1,
v.observe(x.current))
}
), [x, v]),
useIsomorphicLayoutEffect(( () => (a({
type: Action.RegisterDroppable,
element: {
id: n,
key: o,
disabled: r,
node: x,
rect: p,
data: E
}
}),
() => a({
type: Action.UnregisterDroppable,
key: o,
id: n
}))), [n]),
reactExports.useEffect(( () => {
r !== u.current.disabled && (a({
type: Action.SetDroppableDisabled,
id: n,
key: o,
disabled: r
}),
u.current.disabled = r)
}
), [n, o, r, a]),
{
active: s,
rect: p,
isOver: (null == l ? void 0 : l.id) === n,
node: x,
over: l,
setNodeRef: _
}
}
function AnimationManager(e) {
let {animation: t, children: r} = e;
const [n,i] = reactExports.useState(null)
, [o,s] = reactExports.useState(null)
, a = usePrevious(r);
return r || n || !a || i(a),
useIsomorphicLayoutEffect(( () => {
if (!o)
return;
const e = null == n ? void 0 : n.key
, r = null == n ? void 0 : n.props.id;
null != e && null != r ? Promise.resolve(t(r, o)).then(( () => {
i(null)
}
)) : i(null)
}
), [t, n, o]),
React.createElement(React.Fragment, null, r, n ?
reactExports.cloneElement(n, {
ref: s
}) : null)
}
const defaultTransform = {
x: 0,
y: 0,
scaleX: 1,
scaleY: 1
};
function NullifiedContextProvider(e) {
let {children: t} = e;
return React.createElement(InternalContext.Provider, {
value: defaultInternalContext
}, React.createElement(ActiveDraggableContext.Provider, {
value: defaultTransform
}, t))
}
const baseStyles = {
position: "fixed",
touchAction: "none"
}
, defaultTransition$1 = e => isKeyboardEvent(e) ? "transform 250ms
ease" : void 0
, PositionedOverlay = reactExports.forwardRef(( (e, t) => {
let {as: r, activatorEvent: n, adjustScale: i, children: o, className:
s, rect: a, style: l, transform: c, transition: u=defaultTransition$1} = e;
if (!a)
return null;
const d = i ? c : {
...c,
scaleX: 1,
scaleY: 1
}
, p = {
...baseStyles,
width: a.width,
height: a.height,
top: a.top,
left: a.left,
transform: CSS.Transform.toString(d),
transformOrigin: i && n ? getRelativeTransformOrigin(n, a) : void
0,
transition: "function" == typeof u ? u(n) : u,
...l
};
return React.createElement(r, {
className: s,
style: p,
ref: t
}, o)
}
))
, defaultDropAnimationSideEffects = e => t => {
let {active: r, dragOverlay: n} = t;
const i = {}
, {styles: o, className: s} = e;
if (null != o && o.active)
for (const [e,a] of Object.entries(o.active))
void 0 !== a && (i[e] = r.node.style.getPropertyValue(e),
r.node.style.setProperty(e, a));
if (null != o && o.dragOverlay)
for (const [e,a] of Object.entries(o.dragOverlay))
void 0 !== a && n.node.style.setProperty(e, a);
return null != s && s.active && r.node.classList.add(s.active),
null != s && s.dragOverlay && n.node.classList.add(s.dragOverlay),
function() {
for (const [e,t] of Object.entries(i))
r.node.style.setProperty(e, t);
null != s && s.active && r.node.classList.remove(s.active)
}
}
, defaultKeyframeResolver = e => {
let {transform: {initial: t, final: r}} = e;
return [{
transform: CSS.Transform.toString(t)
}, {
transform: CSS.Transform.toString(r)
}]
}
, defaultDropAnimationConfiguration = {
duration: 250,
easing: "ease",
keyframes: defaultKeyframeResolver,
sideEffects: defaultDropAnimationSideEffects({
styles: {
active: {
opacity: "0"
}
}
})
};
function useDropAnimation(e) {
let {config: t, draggableNodes: r, droppableContainers: n,
measuringConfiguration: i} = e;
return useEvent(( (e, o) => {
if (null === t)
return;
const s = r.get(e);
if (!s)
return;
const a = s.node.current;
if (!a)
return;
const l = getMeasurableNode(o);
if (!l)
return;
const {transform: c} = getWindow(o).getComputedStyle(o)
, u = parseTransform(c);
if (!u)
return;
const d = "function" == typeof t ? t :
createDefaultDropAnimation(t);
return scrollIntoViewIfNeeded(a, i.draggable.measure),
d({
active: {
id: e,
data: s.data,
node: a,
rect: i.draggable.measure(a)
},
draggableNodes: r,
dragOverlay: {
node: o,
rect: i.dragOverlay.measure(l)
},
droppableContainers: n,
measuringConfiguration: i,
transform: u
})
}
))
}
function createDefaultDropAnimation(e) {
const {duration: t, easing: r, sideEffects: n, keyframes: i} = {
...defaultDropAnimationConfiguration,
...e
};
return e => {
let {active: o, dragOverlay: s, transform: a, ...l} = e;
if (!t)
return;
const c = s.rect.left - o.rect.left
, u = s.rect.top - o.rect.top
, d = {
scaleX: 1 !== a.scaleX ? o.rect.width * a.scaleX / s.rect.width
: 1,
scaleY: 1 !== a.scaleY ? o.rect.height * a.scaleY /
s.rect.height : 1
}
, p = {
x: a.x - c,
y: a.y - u,
...d
}
, h = i({
...l,
active: o,
dragOverlay: s,
transform: {
initial: a,
final: p
}
})
, [f] = h
, m = h[h.length - 1];
if (JSON.stringify(f) === JSON.stringify(m))
return;
const g = null == n ? void 0 : n({
active: o,
dragOverlay: s,
...l
})
, y = s.node.animate(h, {
duration: t,
easing: r,
fill: "forwards"
});
return new Promise((e => {
y.onfinish = () => {
null == g || g(),
e()
}
}
))
}
}
let key$2 = 0;
function useKey(e) {
return reactExports.useMemo(( () => {
if (null != e)
return key$2++,
key$2
}
), [e])
}
const DragOverlay = React.memo((e => {
let {adjustScale: t=!1, children: r, dropAnimation: n, style: i,
transition: o, modifiers: s, wrapperElement: a="div", className: l, zIndex: c=999}
= e;
const {activatorEvent: u, active: d, activeNodeRect: p,
containerNodeRect: h, draggableNodes: f, droppableContainers: m, dragOverlay: g,
over: y, measuringConfiguration: v, scrollableAncestors: b,
scrollableAncestorRects: x, windowRect: _} = useDndContext()
, E = reactExports.useContext(ActiveDraggableContext)
, T = useKey(null == d ? void 0 : d.id)
, C = applyModifiers(s, {
activatorEvent: u,
active: d,
activeNodeRect: p,
containerNodeRect: h,
draggingNodeRect: g.rect,
over: y,
overlayNodeRect: g.rect,
scrollableAncestors: b,
scrollableAncestorRects: x,
transform: E,
windowRect: _
})
, S = useInitialValue(p)
, $ = useDropAnimation({
config: n,
draggableNodes: f,
droppableContainers: m,
measuringConfiguration: v
})
, w = S ? g.setRef : void 0;
return React.createElement(NullifiedContextProvider, null,
React.createElement(AnimationManager, {
animation: $
}, d && T ? React.createElement(PositionedOverlay, {
key: T,
id: d.id,
ref: w,
as: a,
activatorEvent: u,
adjustScale: t,
className: l,
transition: o,
rect: S,
style: {
zIndex: c,
...i
},
transform: C
}, r) : null))
}
));
function arrayMove(e, t, r) {
const n = e.slice();
return n.splice(r < 0 ? n.length + r : r, 0, n.splice(t, 1)[0]),
n
}
function getSortedRects(e, t) {
return e.reduce(( (e, r, n) => {
const i = t.get(r);
return i && (e[n] = i),
e
}
), Array(e.length))
}
function isValidIndex(e) {
return null !== e && e >= 0
}
function itemsEqual(e, t) {
if (e === t)
return !0;
if (e.length !== t.length)
return !1;
for (let r = 0; r < e.length; r++)
if (e[r] !== t[r])
return !1;
return !0
}
function normalizeDisabled(e) {
return "boolean" == typeof e ? {
draggable: e,
droppable: e
} : e
}
const rectSortingStrategy = e => {
let {rects: t, activeIndex: r, overIndex: n, index: i} = e;
const o = arrayMove(t, n, r)
, s = t[i]
, a = o[i];
return a && s ? {
x: a.left - s.left,
y: a.top - s.top,
scaleX: a.width / s.width,
scaleY: a.height / s.height
} : null
}
, ID_PREFIX = "Sortable"
, Context$2 = React.createContext({
activeIndex: -1,
containerId: ID_PREFIX,
disableTransforms: !1,
items: [],
overIndex: -1,
useDragOverlay: !1,
sortedRects: [],
strategy: rectSortingStrategy,
disabled: {
draggable: !1,
droppable: !1
}
});
function SortableContext(e) {
let {children: t, id: r, items: n, strategy: i=rectSortingStrategy,
disabled: o=!1} = e;
const {active: s, dragOverlay: a, droppableRects: l, over: c,
measureDroppableContainers: u} = useDndContext()
, d = useUniqueId(ID_PREFIX, r)
, p = Boolean(null !== a.rect)
, h = reactExports.useMemo(( () => n.map((e => "object" == typeof e
&& "id"in e ? e.id : e))), [n])
, f = null != s
, m = s ? h.indexOf(s.id) : -1
, g = c ? h.indexOf(c.id) : -1
, y = reactExports.useRef(h)
, v = !itemsEqual(h, y.current)
, b = -1 !== g && -1 === m || v
, x = normalizeDisabled(o);
useIsomorphicLayoutEffect(( () => {
v && f && u(h)
}
), [v, h, f, u]),
reactExports.useEffect(( () => {
y.current = h
}
), [h]);
const _ = reactExports.useMemo(( () => ({
activeIndex: m,
containerId: d,
disabled: x,
disableTransforms: b,
items: h,
overIndex: g,
useDragOverlay: p,
sortedRects: getSortedRects(h, l),
strategy: i
})), [m, d, x.draggable, x.droppable, b, h, g, l, p, i]);
return React.createElement(Context$2.Provider, {
value: _
}, t)
}
const defaultNewIndexGetter = e => {
let {id: t, items: r, activeIndex: n, overIndex: i} = e;
return arrayMove(r, n, i).indexOf(t)
}
, defaultAnimateLayoutChanges = e => {
let {containerId: t, isSorting: r, wasDragging: n, index: i, items: o,
newIndex: s, previousItems: a, previousContainerId: l, transition: c} = e;
return !(!c || !n) && ((a === o || i !== s) && (!!r || s !== i && t ===
l))
}
, defaultTransition = {
duration: 200,
easing: "ease"
}
, transitionProperty = "transform"
, disabledTransition = CSS.Transition.toString({
property: transitionProperty,
duration: 0,
easing: "linear"
})
, defaultAttributes = {
roleDescription: "sortable"
};
function useDerivedTransform(e) {
let {disabled: t, index: r, node: n, rect: i} = e;
const [o,s] = reactExports.useState(null)
, a = reactExports.useRef(r);
return useIsomorphicLayoutEffect(( () => {
if (!t && r !== a.current && n.current) {
const e = i.current;
if (e) {
const t = getClientRect(n.current, {
ignoreTransform: !0
})
, r = {
x: e.left - t.left,
y: e.top - t.top,
scaleX: e.width / t.width,
scaleY: e.height / t.height
};
(r.x || r.y) && s(r)
}
}
r !== a.current && (a.current = r)
}
), [t, r, n, i]),
reactExports.useEffect(( () => {
o && s(null)
}
), [o]),
o
}
function useSortable(e) {
let {animateLayoutChanges: t=defaultAnimateLayoutChanges, attributes:
r, disabled: n, data: i, getNewIndex: o=defaultNewIndexGetter, id: s, strategy: a,
resizeObserverConfig: l, transition: c=defaultTransition} = e;
const {items: u, containerId: d, activeIndex: p, disabled: h,
disableTransforms: f, sortedRects: m, overIndex: g, useDragOverlay: y, strategy: v}
= reactExports.useContext(Context$2)
, b = normalizeLocalDisabled(n, h)
, x = u.indexOf(s)
, _ = reactExports.useMemo(( () => ({
sortable: {
containerId: d,
index: x,
items: u
},
...i
})), [d, i, x, u])
, E = reactExports.useMemo(( () => u.slice(u.indexOf(s))), [u, s])
, {rect: T, node: C, isOver: S, setNodeRef: $} = useDroppable({
id: s,
data: _,
disabled: b.droppable,
resizeObserverConfig: {
updateMeasurementsFor: E,
...l
}
})
, {active: w, activatorEvent: P, activeNodeRect: R, attributes: k,
setNodeRef: A, listeners: I, isDragging: O, over: D, setActivatorNodeRef: M,
transform: L} = useDraggable({
id: s,
data: _,
attributes: {
...defaultAttributes,
...r
},
disabled: b.draggable
})
, j = useCombinedRefs($, A)
, F = Boolean(w)
, N = F && !f && isValidIndex(p) && isValidIndex(g)
, B = !y && O
, z = B && N ? L : null
, U = N ? null != z ? z : (null != a ? a : v)({
rects: m,
activeNodeRect: R,
activeIndex: p,
overIndex: g,
index: x
}) : null
, V = isValidIndex(p) && isValidIndex(g) ? o({
id: s,
items: u,
activeIndex: p,
overIndex: g
}) : x
, H = null == w ? void 0 : w.id
, G = reactExports.useRef({
activeId: H,
items: u,
newIndex: V,
containerId: d
})
, W = u !== G.current.items
, Y = t({
active: w,
containerId: d,
isDragging: O,
isSorting: F,
id: s,
index: x,
items: u,
newIndex: G.current.newIndex,
previousItems: G.current.items,
previousContainerId: G.current.containerId,
transition: c,
wasDragging: null != G.current.activeId
})
, K = useDerivedTransform({
disabled: !Y,
index: x,
node: C,
rect: T
});
return reactExports.useEffect(( () => {
F && G.current.newIndex !== V && (G.current.newIndex = V),
d !== G.current.containerId && (G.current.containerId = d),
u !== G.current.items && (G.current.items = u)
}
), [F, V, d, u]),
reactExports.useEffect(( () => {
if (H === G.current.activeId)
return;
if (H && !G.current.activeId)
return void (G.current.activeId = H);
const e = setTimeout(( () => {
G.current.activeId = H
}
), 50);
return () => clearTimeout(e)
}
), [H]),
{
active: w,
activeIndex: p,
attributes: k,
data: _,
rect: T,
index: x,
newIndex: V,
items: u,
isOver: S,
isSorting: F,
isDragging: O,
listeners: I,
node: C,
overIndex: g,
over: D,
setNodeRef: j,
setActivatorNodeRef: M,
setDroppableNodeRef: $,
setDraggableNodeRef: A,
transform: null != K ? K : U,
transition: function() {
if (K || W && G.current.newIndex === x)
return disabledTransition;
if (B && !isKeyboardEvent(P) || !c)
return;
if (F || Y)
return CSS.Transition.toString({
...c,
property: transitionProperty
});
return
}()
}
}
function normalizeLocalDisabled(e, t) {
var r, n;
return "boolean" == typeof e ? {
draggable: e,
droppable: !1
} : {
draggable: null != (r = null == e ? void 0 : e.draggable) ? r :
t.draggable,
droppable: null != (n = null == e ? void 0 : e.droppable) ? n :
t.droppable
}
}
function hasSortableData(e) {
if (!e)
return !1;
const t = e.data.current;
return !!(t && "sortable"in t && "object" == typeof t.sortable &&
"containerId"in t.sortable && "items"in t.sortable && "index"in t.sortable)
}
const directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up,
KeyboardCode.Left]
, sortableKeyboardCoordinates = (e, t) => {
let {context: {active: r, collisionRect: n, droppableRects: i,
droppableContainers: o, over: s, scrollableAncestors: a}} = t;
if (directions.includes(e.code)) {
if (e.preventDefault(),
!r || !n)
return;
const t = [];
o.getEnabled().forEach((r => {
if (!r || null != r && r.disabled)
return;
const o = i.get(r.id);
if (o)
switch (e.code) {
case KeyboardCode.Down:
n.top < o.top && t.push(r);
break;
case KeyboardCode.Up:
n.top > o.top && t.push(r);
break;
case KeyboardCode.Left:
n.left > o.left && t.push(r);
break;
case KeyboardCode.Right:
n.left < o.left && t.push(r)
}
}
));
const l = closestCorners({
active: r,
collisionRect: n,
droppableRects: i,
droppableContainers: t,
pointerCoordinates: null
});
let c = getFirstCollision(l, "id");
if (c === (null == s ? void 0 : s.id) && l.length > 1 && (c =
l[1].id),
null != c) {
const e = o.get(r.id)
, t = o.get(c)
, s = t ? i.get(t.id) : null
, l = null == t ? void 0 : t.node.current;
if (l && s && e && t) {
const r = getScrollableAncestors(l).some(( (e, t) => a[t] !
== e))
, i = isSameContainer(e, t)
, o = isAfter$1(e, t)
, c = r || !i ? {
x: 0,
y: 0
} : {
x: o ? n.width - s.width : 0,
y: o ? n.height - s.height : 0
}
, u = {
x: s.left,
y: s.top
};
return c.x && c.y ? u : subtract(u, c)
}
}
}
}
;
function isSameContainer(e, t) {
return !(!hasSortableData(e) || !hasSortableData(t)) &&
e.data.current.sortable.containerId === t.data.current.sortable.containerId
}
function isAfter$1(e, t) {
return !(!hasSortableData(e) || !hasSortableData(t)) && (!!
isSameContainer(e, t) && e.data.current.sortable.index <
t.data.current.sortable.index)
}
const defaultPrefix = "semi-sortable";
function DefaultContainer(e) {
return React.createElement("div", Object.assign({
style: {
overflow: "auto"
}
}, e))
}
const defaultKeyBoardOptions = {
coordinateGetter: sortableKeyboardCoordinates
};
function Sortable(e) {
let {items: t, onSortEnd: r, adjustScale: n, renderItem: i, transition:
o, collisionDetection: s=closestCenter, strategy: a=rectSortingStrategy,
useDragOverlay: l=!0, dragOverlayCls: c, container: u=DefaultContainer, prefix:
d=defaultPrefix} = e;
const [p,h] = reactExports.useState(null)
, f = useSensors(useSensor(MouseSensor), useSensor(TouchSensor),
useSensor(KeyboardSensor, defaultKeyBoardOptions))
, m = reactExports.useCallback((e => t.indexOf(e)), [t])
, g = reactExports.useMemo(( () => p ? m(p) : -1), [m, p])
, y = reactExports.useCallback((e => {
let {active: t} = e;
t && h(t.id)
}
), [])
, v = reactExports.useCallback((e => {
let {over: t} = e;
if (h(null),
t) {
const e = m(t.id);
g !== e && r({
oldIndex: g,
newIndex: e
})
}
}
), [g, m, r])
, b = reactExports.useCallback(( () => {
h(null)
}
), []);
return React.createElement(DndContext, {
sensors: f,
collisionDetection: s,
onDragStart: y,
onDragEnd: v,
onDragCancel: b,
autoScroll: {
order: TraversalOrder.ReversedTreeOrder
}
}, React.createElement(SortableContext, {
items: t,
strategy: a
}, React.createElement(u, null, t.map(( (e, t) =>
React.createElement(SortableItem, {
key: e,
id: e,
index: t,
renderItem: i,
useDragOverlay: l,
prefix: d,
transition: o
}))))), l ?
reactDomExports.createPortal(React.createElement(DragOverlay, {
adjustScale: n,
style: {
zIndex: void 0
},
className: c
}, p ? i({
id: p,
sortableHandle: e => e
}) : null), document.body) : null)
}
function SortableItem(e) {
let {animateLayoutChanges: t, id: r, renderItem: n, prefix: i,
transition: o} = e;
const {listeners: s, setNodeRef: a, transform: l, transition: c,
active: u, isOver: d, attributes: p} = useSortable({
id: r,
animateLayoutChanges: t,
transition: o
})
, h = reactExports.useCallback((e => () =>
React.createElement("span", Object.assign({}, s, {
style: {
lineHeight: 0
},
onMouseDown: e => {
s.onMouseDown(e),
e.preventDefault(),
e.stopPropagation()
}
}), React.createElement(e, null))), [s])
, f = classNames(`${i}-sortable-item`, {
[`${i}-sortable-item-over`]: d,
[`${i}-sortable-item-active`]: (null == u ? void 0 : u.id) === r
})
, m = reactExports.useMemo(( () => _isNull(o) ? void 0 : {
transform: CSS.Transform.toString(Object.assign(Object.assign({},
l), {
scaleX: 1,
scaleY: 1
})),
transition: c
}), [o, l, c]);
return React.createElement("div", Object.assign({
ref: a,
style: m,
className: f
}, p), n({
id: r,
sortableHandle: h
}))
}
var __rest$I = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$m = cssClasses$n.PREFIX;
function SortContainer(e) {
return React.createElement("div", Object.assign({
className: `${prefixCls$m}-sortable-list`
}, e))
}
class TagInput extends BaseComponent {
constructor(e) {
super(e),
this.handleInputChange = e => {
this.foundation.handleInputChange(e)
}
,
this.handleKeyDown = e => {
this.foundation.handleKeyDown(e)
}
,
this.handleInputFocus = e => {
this.foundation.handleInputFocus(e)
}
,
this.handleInputBlur = e => {
this.foundation.handleInputBlur(e)
}
,
this.handleClearBtn = e => {
this.foundation.handleClearBtn(e)
}
,
this.handleClearEnterPress = e => {
this.foundation.handleClearEnterPress(e)
}
,
this.handleTagClose = e => {
this.foundation.handleTagClose(e)
}
,
this.handleInputMouseLeave = e => {
this.foundation.handleInputMouseLeave()
}
,
this.handleClick = e => {
this.foundation.handleClick(e)
}
,
this.handleInputMouseEnter = e => {
this.foundation.handleInputMouseEnter()
}
,
this.handleClickPrefixOrSuffix = e => {
this.foundation.handleClickPrefixOrSuffix(e)
}
,
this.handlePreventMouseDown = e => {
this.foundation.handlePreventMouseDown(e)
}
,
this.getAllTags = () => {
const {tagsArray: e} = this.state;
return e.map(( (e, t) => this.renderTag(e, t)))
}
,
this.renderTag = (e, t, r) => {
const {size: n, disabled: i, renderTagItem: o,
showContentTooltip: s, draggable: a} = this.props
, {active: l} = this.state
, c = l && a
, u = classNames(`${prefixCls$m}-wrapper-tag`, {
[`${prefixCls$m}-wrapper-tag-size-${n}`]: n,
[`${prefixCls$m}-wrapper-tag-icon`]: c
})
, d = classNames(`${prefixCls$m}-wrapper-typo`, {
[`${prefixCls$m}-wrapper-typo-disabled`]: i
})
, p = classNames({
[`${prefixCls$m}-drag-item`]: c,
[`${prefixCls$m}-wrapper-tag-icon`]: c
})
, h = r && r(( () => React.createElement(IconHandle, {
className: `${prefixCls$m}-drag-handler`
})))
, f = c ? e : `${t}${e}`
, m = () => {
!i && this.handleTagClose(t)
}
;
return _isFunction(o) ? React.createElement("div", {
className: p,
key: f
}, c && r ? React.createElement(h, null) : null, o(e, t, m)) :
React.createElement(Tag, {
className: u,
color: "white",
size: "small" === n ? "small" : "large",
type: "light",
onClose: m,
closable: !i,
key: f,
visible: !0,
"aria-label": `${i ? "" : "Closable "}Tag: ${e}`
}, c && r ? React.createElement(h, null) : null,
React.createElement(Paragraph, {
className: d,
ellipsis: {
showTooltip: s,
rows: 1
}
}, e))
}
,
this.renderSortTag = e => {
const {id: t, sortableHandle: r} = e
, {tagsArray: n} = this.state
, i = n.indexOf(t);
return this.renderTag(t, i, r)
}
,
this.onSortEnd = e => {
this.foundation.handleSortEnd(e)
}
,
this.handleInputCompositionStart = e => {
this.foundation.handleInputCompositionStart(e)
}
,
this.handleInputCompositionEnd = e => {
this.foundation.handleInputCompositionEnd(e)
}
,
this.foundation = new TagInputFoundation$1(this.adapter),
this.state = {
tagsArray: e.defaultValue || [],
inputValue: "",
focusing: !1,
hovering: !1,
active: !1,
entering: !1
},
this.inputRef = React.createRef(),
this.tagInputRef = React.createRef(),
this.clickOutsideHandler = null
}
static getDerivedStateFromProps(e, t) {
const {value: r, inputValue: n} = e
, {tagsArray: i} = t;
let o;
return o = _isArray(r) ? r : "value"in e && !r ? [] : i,
{
tagsArray: o,
inputValue: _isString(n) ? n : t.inputValue
}
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setInputValue: e => {
this.setState({
inputValue: e
})
}
,
setTagsArray: e => {
this.setState({
tagsArray: e
})
}
,
setFocusing: e => {
this.setState({
focusing: e
})
}
,
toggleFocusing: e => {
const {preventScroll: t} = this.props
, r = this.inputRef && this.inputRef.current;
e ? r && r.focus({
preventScroll: t
}) : r && r.blur(),
this.setState({
focusing: e
})
}
,
setHovering: e => {
this.setState({
hovering: e
})
}
,
setActive: e => {
this.setState({
active: e
})
}
,
setEntering: e => {
this.setState({
entering: e
})
}
,
getClickOutsideHandler: () => this.clickOutsideHandler,
notifyBlur: e => {
this.props.onBlur(e)
}
,
notifyFocus: e => {
this.props.onFocus(e)
}
,
notifyInputChange: (e, t) => {
this.props.onInputChange(e, t)
}
,
notifyTagChange: e => {
this.props.onChange(e)
}
,
notifyTagAdd: e => {
this.props.onAdd(e)
}
,
notifyTagRemove: (e, t) => {
this.props.onRemove(e, t)
}
,
notifyKeyDown: e => {
this.props.onKeyDown(e)
}
,
registerClickOutsideHandler: e => {
const t = t => {
const r = this.tagInputRef && this.tagInputRef.current
, n = t.target
, i = t.composedPath && t.composedPath() || [n];
!r || r.contains(n) || i.includes(r) || e(t)
}
;
this.clickOutsideHandler = t,
document.addEventListener("click", t, !1)
}
,
unregisterClickOutsideHandler: () => {
document.removeEventListener("click",
this.clickOutsideHandler, !1),
this.clickOutsideHandler = null
}
})
}
componentDidMount() {
const {disabled: e, autoFocus: t, preventScroll: r} = this.props;
!e && t && (this.inputRef.current.focus({
preventScroll: r
}),
this.foundation.handleClick()),
this.foundation.init()
}
renderClearBtn() {
const {hovering: e, tagsArray: t, inputValue: r} = this.state
, {showClear: n, disabled: i, clearIcon: o} = this.props
, s = classNames(`${prefixCls$m}-clearBtn`, {
[`${prefixCls$m}-clearBtn-invisible`]: !e || "" === r && 0 ===
t.length || i
});
return n ? React.createElement("div", {
role: "button",
tabIndex: 0,
"aria-label": "Clear TagInput value",
className: s,
onClick: e => this.handleClearBtn(e),
onKeyPress: e => this.handleClearEnterPress(e)
}, o || React.createElement(IconClear, null)) : null
}
renderPrefix() {
const {prefix: e, insetLabel: t, insetLabelId: r} = this.props
, n = e || t;
if (_isNull(n) || _isUndefined(n))
return null;
const i = classNames(`${prefixCls$m}-prefix`, {
[`${prefixCls$m}-inset-label`]: t,
[`${prefixCls$m}-prefix-text`]: n && _isString(n),
[`${prefixCls$m}-prefix-icon`]: isSemiIcon(n)
});
return React.createElement("div", {
className: i,
onMouseDown: this.handlePreventMouseDown,
onClick: this.handleClickPrefixOrSuffix,
id: r,
"x-semi-prop": "prefix"
}, n)
}
renderSuffix() {
const {suffix: e} = this.props;
if (_isNull(e) || _isUndefined(e))
return null;
const t = classNames(`${prefixCls$m}-suffix`, {
[`${prefixCls$m}-suffix-text`]: e && _isString(e),
[`${prefixCls$m}-suffix-icon`]: isSemiIcon(e)
});
return React.createElement("div", {
className: t,
onMouseDown: this.handlePreventMouseDown,
onClick: this.handleClickPrefixOrSuffix,
"x-semi-prop": "suffix"
}, e)
}
renderTags() {
const {disabled: e, maxTagCount: t, showRestTagsPopover: r,
restTagsPopoverProps: n={}, draggable: i, expandRestTagsOnClick: o} = this.props
, {tagsArray: s, active: a} = this.state
, l = classNames(`${prefixCls$m}-wrapper-n`, {
[`${prefixCls$m}-wrapper-n-disabled`]: e
})
, c = this.getAllTags();
let u = []
, d = [...c];
(!a || !o) && t && t < c.length && (d = c.slice(0, t),
u = c.slice(t));
const p = React.createElement("span", {
className: l
}, "+", s.length - t)
, h = c.map(( (e, t) => ({
item: e,
key: s[t]
})));
return a && i && h.length > 0 ? React.createElement(Sortable, {
items: s,
onSortEnd: this.onSortEnd,
renderItem: this.renderSortTag,
container: SortContainer,
prefix: prefixCls$m,
transition: null,
dragOverlayCls: `${prefixCls$m}-right-item-drag-item-move`
}) : React.createElement(React.Fragment, null, d, u.length > 0 &&
(r ? React.createElement(Popover$1, Object.assign({
content: u,
showArrow: !0,
trigger: "hover",
position: "top",
autoAdjustOverflow: !0
}, n), p) : p))
}
blur() {
this.inputRef.current.blur(),
this.foundation.clickOutsideCallBack()
}
focus() {
const {preventScroll: e, disabled: t} = this.props;
this.inputRef.current.focus({
preventScroll: e
}),
t || this.foundation.handleClick()
}
render() {
const e = this.props
, {size: t, style: r, className: n, disabled: i, placeholder: o,
validateStatus: s, prefix: a, insetLabel: l, suffix: c} = e
, u = __rest$I(e, ["size", "style", "className", "disabled",
"placeholder", "validateStatus", "prefix", "insetLabel", "suffix"])
, {focusing: d, hovering: p, tagsArray: h, inputValue: f, active:
m} = this.state
, g = classNames(prefixCls$m, n, {
[`${prefixCls$m}-focus`]: d || m,
[`${prefixCls$m}-disabled`]: i,
[`${prefixCls$m}-hover`]: p && !i,
[`${prefixCls$m}-error`]: "error" === s,
[`${prefixCls$m}-warning`]: "warning" === s,
[`${prefixCls$m}-small`]: "small" === t,
[`${prefixCls$m}-large`]: "large" === t,
[`${prefixCls$m}-with-prefix`]: !!a || !!l,
[`${prefixCls$m}-with-suffix`]: !!c
})
, y = classNames(`${prefixCls$m}-wrapper-input`, `${prefixCls$m}-
wrapper-input-${t}`)
, v = classNames(`${prefixCls$m}-wrapper`);
return React.createElement("div", Object.assign({
ref: this.tagInputRef,
style: r,
className: g,
"aria-disabled": i,
"aria-label": this.props["aria-label"],
"aria-invalid": "error" === s,
onMouseEnter: e => {
this.handleInputMouseEnter(e)
}
,
onMouseLeave: e => {
this.handleInputMouseLeave(e)
}
,
onClick: e => {
this.handleClick(e)
}
}, this.getDataAttr(u)), this.renderPrefix(),
React.createElement("div", {
className: v
}, this.renderTags(), React.createElement(Input$1, {
"aria-label": "input value",
ref: this.inputRef,
className: y,
disabled: i,
value: f,
size: t,
placeholder: 0 === h.length ? o : "",
onKeyDown: e => {
this.handleKeyDown(e)
}
,
onChange: (e, t) => {
this.handleInputChange(t)
}
,
onBlur: e => {
this.handleInputBlur(e)
}
,
onFocus: e => {
this.handleInputFocus(e)
}
,
onCompositionStart: this.handleInputCompositionStart,
onCompositionEnd: this.handleInputCompositionEnd
})), this.renderClearBtn(), this.renderSuffix())
}
}
TagInput.propTypes = {
children: PropTypes.node,
clearIcon: PropTypes.node,
style: PropTypes.object,
className: PropTypes.string,
disabled: PropTypes.bool,
allowDuplicates: PropTypes.bool,
max: PropTypes.number,
maxTagCount: PropTypes.number,
maxLength: PropTypes.number,
showRestTagsPopover: PropTypes.bool,
restTagsPopoverProps: PropTypes.object,
showContentTooltip: PropTypes.oneOfType([PropTypes.shape({
type: PropTypes.string,
opts: PropTypes.object
}), PropTypes.bool]),
defaultValue: PropTypes.array,
value: PropTypes.array,
inputValue: PropTypes.string,
placeholder: PropTypes.string,
separator: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
showClear: PropTypes.bool,
addOnBlur: PropTypes.bool,
draggable: PropTypes.bool,
expandRestTagsOnClick: PropTypes.bool,
autoFocus: PropTypes.bool,
renderTagItem: PropTypes.func,
onBlur: PropTypes.func,
onFocus: PropTypes.func,
onChange: PropTypes.func,
onInputChange: PropTypes.func,
onExceed: PropTypes.func,
onInputExceed: PropTypes.func,
onAdd: PropTypes.func,
onRemove: PropTypes.func,
onKeyDown: PropTypes.func,
size: PropTypes.oneOf(strings$h.SIZE_SET),
validateStatus: PropTypes.oneOf(strings$h.STATUS),
prefix: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
suffix: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
"aria-label": PropTypes.string,
preventScroll: PropTypes.bool
},
TagInput.defaultProps = {
showClear: !1,
addOnBlur: !1,
allowDuplicates: !0,
showRestTagsPopover: !0,
autoFocus: !1,
draggable: !1,
expandRestTagsOnClick: !0,
showContentTooltip: !0,
separator: ",",
size: "default",
validateStatus: "default",
onBlur: _noop,
onFocus: _noop,
onChange: _noop,
onInputChange: _noop,
onExceed: _noop,
onInputExceed: _noop,
onAdd: _noop,
onRemove: _noop,
onKeyDown: _noop
};
const TagInput$1 = TagInput
, prefixcls$4 = cssClasses$p.PREFIX
, resetkey = 0;
class Cascader extends BaseComponent {
constructor(e) {
super(e),
this.search = e => {
this.handleInputChange(e)
}
,
this.handleInputChange = e => {
this.foundation.handleInputChange(e)
}
,
this.handleTagRemoveInTrigger = e => {
this.foundation.handleTagRemoveInTrigger(e)
}
,
this.handleTagClose = (e, t, r) => {
t.preventDefault(),
this.foundation.handleTagRemoveByKey(r)
}
,
this.renderTagItem = (e, t) => {
const {keyEntities: r, disabledKeys: n} = this.state
, {size: i, disabled: o, displayProp: s, displayRender: a,
disableStrictly: l} = this.props;
if (r[e]) {
const c = o || r[e].data.disabled || l && n.has(e)
, u = classNames(`${prefixcls$4}-selection-tag`, {
[`${prefixcls$4}-selection-tag-disabled`]: c
});
return _isFunction(a) ? a(r[e], t) :
React.createElement(Tag, {
size: "default" === i ? "large" : i,
key: `tag-${e}-${t}`,
color: "white",
tagKey: e,
className: u,
closable: !0,
onClose: this.handleTagClose
}, r[e].data[s])
}
return null
}
,
this.onRemoveInTagInput = e => {
this.foundation.handleTagRemoveByKey(e)
}
,
this.handleItemClick = (e, t) => {
this.foundation.handleItemClick(e, t)
}
,
this.handleItemHover = (e, t) => {
this.foundation.handleItemHover(e, t)
}
,
this.onItemCheckboxClick = e => {
this.foundation.onItemCheckboxClick(e)
}
,
this.handleListScroll = (e, t) => {
this.foundation.handleListScroll(e, t)
}
,
this.renderContent = () => {
const {inputValue: e, isSearching: t, activeKeys: r,
selectedKeys: n, checkedKeys: i, halfCheckedKeys: o, loadedKeys: s, loadingKeys: a}
= this.state
, {filterTreeNode: l, dropdownClassName: c, dropdownStyle: u,
loadData: d, emptyContent: p, separator: h, topSlot: f, bottomSlot: m, showNext: g,
multiple: y, filterRender: v, virtualizeInSearch: b} = this.props
, x = Boolean(l) && t
, _ = classNames(c, `${prefixcls$4}-popover`)
, E = this.foundation.getRenderData();
return React.createElement("div", {
className: _,
role: "listbox",
style: u,
onKeyDown: this.foundation.handleKeyDown
}, f, React.createElement(Item$3, {
activeKeys: r,
selectedKeys: n,
separator: h,
loadedKeys: s,
loadingKeys: a,
onItemClick: this.handleItemClick,
onItemHover: this.handleItemHover,
showNext: g,
onItemCheckboxClick: this.onItemCheckboxClick,
onListScroll: this.handleListScroll,
searchable: x,
keyword: e,
emptyContent: p,
loadData: d,
data: E,
multiple: y,
checkedKeys: i,
halfCheckedKeys: o,
filterRender: v,
virtualize: b
}), m)
}
,
this.renderPlusN = e => {
const {disabled: t, showRestTagsPopover: r,
restTagsPopoverProps: n} = this.props
, i = classNames(`${prefixcls$4}-selection-n`, {
[`${prefixcls$4}-selection-n-disabled`]: t
})
, o = React.createElement("span", {
className: i
}, "+", e.length);
return r ? React.createElement(Popover$1, Object.assign({
content: e,
showArrow: !0,
trigger: "hover",
position: "top",
autoAdjustOverflow: !0
}, n), o) : o
}
,
this.renderMultipleTags = () => {
const {autoMergeValue: e, maxTagCount: t} = this.props
, {checkedKeys: r, resolvedCheckedKeys: n} = this.state
, i = this.mergeType === strings$k.NONE_MERGE_TYPE ? r : n
, o = []
, s = [];
return [...i].forEach(( (e, r) => {
const n = !_isNumber(t) || t >= r + 1
, i = this.renderTagItem(e, r);
n ? o.push(i) : s.push(i)
}
)),
React.createElement(React.Fragment, null, o, !_isEmpty(s) &&
this.renderPlusN(s))
}
,
this.renderDisplayText = () => {
const {displayProp: e, separator: t, displayRender: r} =
this.props
, {selectedKeys: n} = this.state;
let i = "";
if (n.size) {
const o = this.foundation.getItemPropPath([...n][0], e);
i = r && "function" == typeof r ? r(o) : o.map(( (e, r) =>
React.createElement(reactExports.Fragment, {
key: `${e}-${r}`
}, r < o.length - 1 ? React.createElement(React.Fragment,
null, e, t) : e)))
}
return i
}
,
this.renderSelectContent = () => {
const {placeholder: e, filterTreeNode: t, multiple: r,
searchPosition: n} = this.props
, {checkedKeys: i} = this.state;
if (!(Boolean(t) && n === strings$k.SEARCH_POSITION_TRIGGER)) {
if (r)
return 0 === i.size ? React.createElement("span", {
className: `${prefixcls$4}-selection-placeholder`
}, e) : this.renderMultipleTags();
{
const t = this.renderDisplayText()
, r = classNames({
[`${prefixcls$4}-selection-placeholder`]: !t
});
return React.createElement("span", {
className: r
}, t || e)
}
}
return r ? this.renderTagInput() : this.renderInput()
}
,
this.renderSuffix = () => {
const {suffix: e} = this.props
, t = classNames({
[`${prefixcls$4}-suffix`]: !0,
[`${prefixcls$4}-suffix-text`]: e && _isString(e),
[`${prefixcls$4}-suffix-icon`]: isSemiIcon(e)
});
return React.createElement("div", {
className: t,
"x-semi-prop": "suffix"
}, e)
}
,
this.renderPrefix = () => {
const {prefix: e, insetLabel: t, insetLabelId: r} = this.props
, n = e || t
, i = classNames({
[`${prefixcls$4}-prefix`]: !0,
[`${prefixcls$4}-inset-label`]: t,
[`${prefixcls$4}-prefix-text`]: n && _isString(n),
[`${prefixcls$4}-prefix-icon`]: isSemiIcon(n)
});
return React.createElement("div", {
className: i,
id: r,
"x-semi-prop": "prefix,insetLabel"
}, n)
}
,
this.renderCustomTrigger = () => {
var e;
const {disabled: t, triggerRender: r, multiple: n} = this.props
, {selectedKeys: i, inputValue: o, inputPlaceHolder: s,
resolvedCheckedKeys: a, checkedKeys: l, keyEntities: c} = this.state;
let u;
return n ? this.mergeType === strings$k.NONE_MERGE_TYPE ? (u =
new Set,
l.forEach((e => {
var t;
u.add(null === (t = c[e]) || void 0 === t ? void 0 : t.pos)
}
))) : (u = new Set,
a.forEach((e => {
var t;
u.add(null === (t = c[e]) || void 0 === t ? void 0 : t.pos)
}
))) : u = null === (e = c[[...i][0]]) || void 0 === e ? void
0 : e.pos,
React.createElement(Trigger$1, {
value: u,
inputValue: o,
onChange: this.handleInputChange,
onClear: this.handleClear,
placeholder: s,
disabled: t,
triggerRender: r,
componentName: "Cascader",
componentProps: Object.assign({}, this.props),
onSearch: this.handleInputChange,
onRemove: this.handleTagRemoveInTrigger
})
}
,
this.handleMouseOver = () => {
this.foundation.toggleHoverState(!0)
}
,
this.handleMouseLeave = () => {
this.foundation.toggleHoverState(!1)
}
,
this.handleClear = e => {
e && e.stopPropagation(),
this.foundation.handleClear()
}
,
this.handleClearEnterPress = e => {
e && e.stopPropagation(),
this.foundation.handleClearEnterPress(e)
}
,
this.showClearBtn = () => {
const {showClear: e, disabled: t, multiple: r} = this.props
, {selectedKeys: n, isOpen: i, isHovering: o, checkedKeys: s,
inputValue: a} = this.state
, l = n.size
, c = r && s.size;
return e && (a || l || c) && !t && (i || o)
}
,
this.renderClearBtn = () => {
const e = classNames(`${prefixcls$4}-clearbtn`)
, {clearIcon: t} = this.props;
return this.showClearBtn() ? React.createElement("div", {
className: e,
onClick: this.handleClear,
onKeyPress: this.handleClearEnterPress,
role: "button",
tabIndex: 0
}, t || React.createElement(IconClear, null)) : null
}
,
this.renderArrow = () => {
const {arrowIcon: e} = this.props;
return this.showClearBtn() ? null : e ?
React.createElement("div", {
className: classNames(`${prefixcls$4}-arrow`),
"x-semi-prop": "arrowIcon"
}, e) : null
}
,
this.renderSelection = () => {
const {disabled: e, multiple: t, filterTreeNode: r, style: n,
size: i, className: o, validateStatus: s, prefix: a, suffix: l, insetLabel: c,
triggerRender: u, showClear: d, id: p, borderless: h} = this.props
, {isOpen: f, isFocus: m, isInput: g, checkedKeys: y} =
this.state
, v = Boolean(r)
, b = "function" == typeof u
, x = b ? classNames(o) : classNames(prefixcls$4, o, {
[`${prefixcls$4}-borderless`]: h,
[`${prefixcls$4}-focus`]: m || f && !g,
[`${prefixcls$4}-disabled`]: e,
[`${prefixcls$4}-single`]: !0,
[`${prefixcls$4}-filterable`]: v,
[`${prefixcls$4}-error`]: "error" === s,
[`${prefixcls$4}-warning`]: "warning" === s,
[`${prefixcls$4}-small`]: "small" === i,
[`${prefixcls$4}-large`]: "large" === i,
[`${prefixcls$4}-with-prefix`]: a || c,
[`${prefixcls$4}-with-suffix`]: l
})
, _ = d ? {
onMouseEnter: () => this.handleMouseOver(),
onMouseLeave: () => this.handleMouseLeave()
} : {}
, E = classNames(`${prefixcls$4}-selection`, {
[`${prefixcls$4}-selection-multiple`]: t && !_isEmpty(y)
})
, T = b ? this.renderCustomTrigger() :
[React.createElement(reactExports.Fragment, {
key: "prefix"
}, a || c ? this.renderPrefix() : null),
React.createElement(reactExports.Fragment, {
key: "selection"
}, React.createElement("div", {
className: E
}, this.renderSelectContent())),
React.createElement(reactExports.Fragment, {
key: "clearbtn"
}, this.renderClearBtn()),
React.createElement(reactExports.Fragment, {
key: "suffix"
}, l ? this.renderSuffix() : null),
React.createElement(reactExports.Fragment, {
key: "arrow"
}, this.renderArrow())];
return React.createElement("div", Object.assign({
className: x,
style: n,
ref: this.triggerRef,
onClick: e => this.foundation.handleClick(e),
onKeyPress: e =>
this.foundation.handleSelectionEnterPress(e),
"aria-invalid": this.props["aria-invalid"],
"aria-errormessage": this.props["aria-errormessage"],
"aria-label": this.props["aria-label"],
"aria-labelledby": this.props["aria-labelledby"],
"aria-describedby": this.props["aria-describedby"],
"aria-required": this.props["aria-required"],
id: p,
onKeyDown: this.foundation.handleKeyDown
}, _, {
role: "combobox",
tabIndex: 0
}, this.getDataAttr(this.props)), T)
}
,
this.state = {
disabledKeys: new Set,
isOpen: e.defaultOpen,
rePosKey: resetkey,
keyEntities: {},
selectedKeys: new Set([]),
activeKeys: new Set([]),
filteredKeys: new Set([]),
inputValue: "",
isSearching: !1,
inputPlaceHolder: e.searchPlaceholder || e.placeholder,
prevProps: {},
isHovering: !1,
checkedKeys: new Set([]),
halfCheckedKeys: new Set([]),
resolvedCheckedKeys: new Set([]),
loadedKeys: new Set,
loadingKeys: new Set,
loading: !1,
showInput: !1
},
this.options = {},
this.isEmpty = !1,
this.mergeType = calcMergeType(e.autoMergeValue, e.leafOnly),
this.inputRef = React.createRef(),
this.triggerRef = React.createRef(),
this.optionsRef = React.createRef(),
this.clickOutsideHandler = null,
this.foundation = new CascaderFoundation(this.adapter),
this.loadingKeysRef = React.createRef(),
this.loadedKeysRef = React.createRef()
}
get adapter() {
var e = this;
const t = {
updateInputValue: e => {
this.setState({
inputValue: e
})
}
,
updateInputPlaceHolder: e => {
this.setState({
inputPlaceHolder: e
})
}
,
focusInput: () => {
const {preventScroll: e} = this.props;
this.inputRef && this.inputRef.current &&
this.inputRef.current.focus({
preventScroll: e
})
}
,
blurInput: () => {
this.inputRef && this.inputRef.current &&
this.inputRef.current.blur()
}
}
, r = {
registerClickOutsideHandler: e => {
const t = t => {
const r = this.optionsRef && this.optionsRef.current
, n = this.triggerRef && this.triggerRef.current
, i = ReactDOM.findDOMNode(r)
, o = t.target
, s = t.composedPath && t.composedPath() || [o];
!i || i.contains(o) && i.contains(o.parentNode) || !n
|| n.contains(o) || s.includes(n) || s.includes(i) || e(t)
}
;
this.clickOutsideHandler = t,
document.addEventListener("mousedown", t, !1)
}
,
unregisterClickOutsideHandler: () => {
document.removeEventListener("mousedown",
this.clickOutsideHandler, !1)
}
,
rePositionDropdown: () => {
let {rePosKey: e} = this.state;
e += 1,
this.setState({
rePosKey: e
})
}
};
return Object.assign(Object.assign(Object.assign(Object.assign({},
super.adapter), t), r), {
updateStates: e => {
this.setState(Object.assign({}, e))
}
,
openMenu: () => {
this.setState({
isOpen: !0
})
}
,
closeMenu: e => {
this.setState({
isOpen: !1
}, ( () => {
e && e()
}
))
}
,
updateSelection: e => this.setState({
selectedKeys: e
}),
notifyChange: e => {
this.props.onChange && this.props.onChange(e)
}
,
notifySelect: e => {
this.props.onSelect && this.props.onSelect(e)
}
,
notifyOnSearch: e => {
this.props.onSearch && this.props.onSearch(e)
}
,
notifyFocus: function() {
e.props.onFocus && e.props.onFocus(...arguments)
},
notifyBlur: function() {
e.props.onBlur && e.props.onBlur(...arguments)
},
notifyDropdownVisibleChange: e => {
this.props.onDropdownVisibleChange(e)
}
,
toggleHovering: e => {
this.setState({
isHovering: e
})
}
,
notifyLoadData: (e, t) => {
const {loadData: r} = this.props;
r && new Promise((n => {
r(e).then(( () => {
t(),
this.setState({
loading: !1
}),
n()
}
))
}
))
}
,
notifyOnLoad: (e, t) => {
const {onLoad: r} = this.props;
r && r(e, t)
}
,
notifyListScroll: (e, t) => {
let {panelIndex: r, activeNode: n} = t;
this.props.onListScroll(e, {
panelIndex: r,
activeNode: n
})
}
,
notifyOnExceed: e => this.props.onExceed(e),
notifyClear: () => this.props.onClear(),
toggleInputShow: (e, t) => {
this.setState({
showInput: e
}, ( () => {
t()
}
))
}
,
updateFocusState: e => {
this.setState({
isFocus: e
})
}
,
updateLoadingKeyRefValue: e => {
this.loadingKeysRef.current = e
}
,
getLoadingKeyRefValue: () => this.loadingKeysRef.current,
updateLoadedKeyRefValue: e => {
this.loadedKeysRef.current = e
}
,
getLoadedKeyRefValue: () => this.loadedKeysRef.current
})
}
static getDerivedStateFromProps(e, t) {
const {multiple: r, value: n, defaultValue: i, onChangeWithObject:
o, leafOnly: s, autoMergeValue: a} = e
, {prevProps: l} = t;
let c = t.keyEntities || {};
const u = {}
, d = t => {
const r = _isEmpty(l) && t in e
, n = l && !_isEqual(l[t], e[t]);
return r || n
}
, p = (e, t) => {
let r = [];
Array.isArray(e) ? r = Array.isArray(e[0]) ? e : [e] : void 0 !
== e && (r = [[e]]);
const n = [];
r.forEach((e => {
const t = o && _isObject(e[0]) ? e.map((e => null == e ?
void 0 : e.value)) : e;
t.length > 0 && n.push(t)
}
));
return n.reduce(( (e, r) => {
const n = getKeyByValuePath(r);
return t[n] && e.push(n),
e
}
), [])
}
;
if (r) {
const r = d("treeData") || ( () => {
const t = !l && "treeData"in e
, r = l && l.treeData !== e.treeData;
return t || r
}
)()
, o = d("value") || _isEmpty(l) && i;
if (r || o) {
r && (u.treeData = e.treeData,
c = convertDataToEntities(e.treeData),
u.keyEntities = c);
let l = t.checkedKeys;
if (o) {
l = p(d("value") ? n : i, c)
} else if (r && "value"in e) {
l = p(n, c)
}
_isSet(l) && (l = [...l]);
const h = calcCheckedKeys(l, c)
, f = new Set(h.checkedKeys)
, m = new Set(h.halfCheckedKeys);
e.disableStrictly && (u.disabledKeys =
calcDisabledKeys(c));
const g = calcMergeType(a, s) ===
strings$k.LEAF_ONLY_MERGE_TYPE;
u.prevProps = e,
u.checkedKeys = f,
u.halfCheckedKeys = m,
u.resolvedCheckedKeys = new Set(normalizeKeyList(f, c, g))
}
}
return u
}
componentDidMount() {
this.foundation.init()
}
componentWillUnmount() {
this.foundation.destroy()
}
componentDidUpdate(e) {
if (this.props.multiple)
return;
let t = !1;
_isEqual(e.treeData, this.props.treeData) || (t = !0,
this.foundation.collectOptions()),
e.value === this.props.value || t ||
this.foundation.handleValueChange(this.props.value)
}
renderTagInput() {
const {size: e, disabled: t, placeholder: r, maxTagCount: n,
showRestTagsPopover: i, restTagsPopoverProps: o} = this.props
, {inputValue: s, checkedKeys: a, keyEntities: l,
resolvedCheckedKeys: c} = this.state
, u = classNames(`${prefixcls$4}-tagInput-wrapper`)
, d = this.mergeType === strings$k.NONE_MERGE_TYPE ? a : c;
return React.createElement(TagInput$1, {
className: u,
ref: this.inputRef,
disabled: t,
size: e,
value: [...d],
showRestTagsPopover: i,
restTagsPopoverProps: o,
maxTagCount: n,
renderTagItem: this.renderTagItem,
inputValue: s,
onInputChange: this.handleInputChange,
onRemove: this.onRemoveInTagInput,
placeholder: r,
expandRestTagsOnClick: !1
})
}
renderInput() {
const {size: e, disabled: t} = this.props
, r = classNames(`${prefixcls$4}-input`)
, {inputValue: n, inputPlaceHolder: i, showInput: o} = this.state
, s = {
disabled: t,
value: n,
className: r,
onChange: this.handleInputChange
}
, a = classNames({
[`${prefixcls$4}-search-wrapper`]: !0,
[`${prefixcls$4}-search-wrapper-${e}`]: "default" !== e
})
, l = this.renderDisplayText()
, c = classNames({
[`${prefixcls$4}-selection-placeholder`]: !l,
[`${prefixcls$4}-selection-text-hide`]: o && n,
[`${prefixcls$4}-selection-text-inactive`]: o && !n
});
return React.createElement("div", {
className: a
}, React.createElement("span", {
className: c
}, l || i), o && React.createElement(Input$1, Object.assign({
ref: this.inputRef,
size: e
}, s)))
}
close() {
this.foundation.close()
}
open() {
this.foundation.open()
}
focus() {
this.foundation.focus()
}
blur() {
this.foundation.blur()
}
render() {
const {zIndex: e, getPopupContainer: t, autoAdjustOverflow: r,
stopPropagation: n, mouseLeaveDelay: i, mouseEnterDelay: o, position: s, motion: a,
dropdownMargin: l} = this.props
, {isOpen: c, rePosKey: u} = this.state
, {direction: d} = this.context
, p = this.renderContent()
, h = this.renderSelection()
, f = null != s ? s : "rtl" === d ? "bottomRight" : "bottomLeft";
return React.createElement(Popover$1, {
getPopupContainer: t,
zIndex: e,
motion: a,
margin: l,
ref: this.optionsRef,
content: p,
visible: c,
trigger: "custom",
rePosKey: u,
position: f,
autoAdjustOverflow: r,
stopPropagation: n,
mouseLeaveDelay: i,
mouseEnterDelay: o,
afterClose: () => this.foundation.updateSearching(!1)
}, h)
}
}
Cascader.__SemiComponentName__ = "Cascader",
Cascader.contextType = ConfigContext$1,
Cascader.propTypes = {
"aria-labelledby": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-errormessage": PropTypes.string,
"aria-describedby": PropTypes.string,
"aria-required": PropTypes.bool,
"aria-label": PropTypes.string,
arrowIcon: PropTypes.node,
borderless: PropTypes.bool,
clearIcon: PropTypes.node,
changeOnSelect: PropTypes.bool,
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
disabled: PropTypes.bool,
dropdownClassName: PropTypes.string,
dropdownStyle: PropTypes.object,
dropdownMargin: PropTypes.oneOfType([PropTypes.number,
PropTypes.object]),
emptyContent: PropTypes.node,
motion: PropTypes.bool,
filterTreeNode: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
filterLeafOnly: PropTypes.bool,
placeholder: PropTypes.string,
searchPlaceholder: PropTypes.string,
size: PropTypes.oneOf(strings$k.SIZE_SET),
style: PropTypes.object,
className: PropTypes.string,
treeData: PropTypes.arrayOf(PropTypes.shape({
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
label: PropTypes.any
})),
treeNodeFilterProp: PropTypes.string,
suffix: PropTypes.node,
prefix: PropTypes.node,
insetLabel: PropTypes.node,
insetLabelId: PropTypes.string,
id: PropTypes.string,
displayProp: PropTypes.string,
displayRender: PropTypes.func,
onChange: PropTypes.func,
onSearch: PropTypes.func,
onSelect: PropTypes.func,
onBlur: PropTypes.func,
onFocus: PropTypes.func,
children: PropTypes.node,
getPopupContainer: PropTypes.func,
zIndex: PropTypes.number,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number,
PropTypes.array]),
validateStatus: PropTypes.oneOf(strings$k.VALIDATE_STATUS),
showNext: PropTypes.oneOf([strings$k.SHOW_NEXT_BY_CLICK,
strings$k.SHOW_NEXT_BY_HOVER]),
stopPropagation: PropTypes.oneOfType([PropTypes.bool,
PropTypes.string]),
showClear: PropTypes.bool,
defaultOpen: PropTypes.bool,
autoAdjustOverflow: PropTypes.bool,
onDropdownVisibleChange: PropTypes.func,
triggerRender: PropTypes.func,
onListScroll: PropTypes.func,
onChangeWithObject: PropTypes.bool,
bottomSlot: PropTypes.node,
topSlot: PropTypes.node,
multiple: PropTypes.bool,
autoMergeValue: PropTypes.bool,
maxTagCount: PropTypes.number,
showRestTagsPopover: PropTypes.bool,
restTagsPopoverProps: PropTypes.object,
max: PropTypes.number,
separator: PropTypes.string,
onExceed: PropTypes.func,
onClear: PropTypes.func,
loadData: PropTypes.func,
onLoad: PropTypes.func,
loadedKeys: PropTypes.array,
disableStrictly: PropTypes.bool,
leafOnly: PropTypes.bool,
enableLeafClick: PropTypes.bool,
preventScroll: PropTypes.bool,
position: PropTypes.string,
searchPosition: PropTypes.string
},
Cascader.defaultProps =
getDefaultPropsFromGlobalConfig(Cascader.__SemiComponentName__, {
borderless: !1,
leafOnly: !1,
arrowIcon: React.createElement(IconChevronDown, null),
stopPropagation: !0,
motion: !0,
defaultOpen: !1,
zIndex: numbers$a.DEFAULT_Z_INDEX,
showClear: !1,
autoClearSearchValue: !0,
changeOnSelect: !1,
disableStrictly: !1,
autoMergeValue: !0,
multiple: !1,
filterTreeNode: !1,
filterLeafOnly: !0,
showRestTagsPopover: !1,
restTagsPopoverProps: {},
separator: " / ",
size: "default",
treeNodeFilterProp: "label",
displayProp: "label",
treeData: [],
showNext: strings$k.SHOW_NEXT_BY_CLICK,
onExceed: _noop,
onClear: _noop,
onDropdownVisibleChange: _noop,
onListScroll: _noop,
enableLeafClick: !1,
"aria-label": "Cascader",
searchPosition: strings$k.SEARCH_POSITION_TRIGGER
});
const Cascader$1 = Cascader;
class CollapsibleFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.updateDOMInRenderTree = e => {
this._adapter.setDOMInRenderTree(e)
}
,
this.updateDOMHeight = e => {
this._adapter.setDOMHeight(e)
}
,
this.updateVisible = e => {
this._adapter.setVisible(e)
}
,
this.updateIsTransitioning = e => {
this._adapter.setIsTransitioning(e)
}
}
}
const CollapsibleFoundation$1 = CollapsibleFoundation
, cssClasses$m = {
PREFIX: `${BASE_CLASS_PREFIX$1}-collapsible`
}
, collapsible = "";
class Collapsible extends BaseComponent {
constructor(e) {
super(e),
this.domRef = React.createRef(),
this.hasBeenRendered = !1,
this.handleResize = e => {
const t = e[0];
if (t) {
const e = Collapsible.getEntryInfo(t);
this.foundation.updateDOMHeight(e.height),
this.foundation.updateDOMInRenderTree(e.isShown)
}
}
,
this.isChildrenInRenderTree = () => !!this.domRef.current &&
this.domRef.current.offsetHeight > 0,
this.state = {
domInRenderTree: !1,
domHeight: 0,
visible: this.props.isOpen,
isTransitioning: !1
},
this.foundation = new CollapsibleFoundation$1(this.adapter)
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setDOMInRenderTree: e => {
this.state.domInRenderTree !== e && this.setState({
domInRenderTree: e
})
}
,
setDOMHeight: e => {
this.state.domHeight !== e && this.setState({
domHeight: e
})
}
,
setVisible: e => {
this.state.visible !== e && this.setState({
visible: e
})
}
,
setIsTransitioning: e => {
this.state.isTransitioning !== e && this.setState({
isTransitioning: e
})
}
})
}
componentDidMount() {
super.componentDidMount(),
this.resizeObserver = new ResizeObserver(this.handleResize),
this.resizeObserver.observe(this.domRef.current);
const e = this.isChildrenInRenderTree();
this.foundation.updateDOMInRenderTree(e),
e &&
this.foundation.updateDOMHeight(this.domRef.current.scrollHeight)
}
componentDidUpdate(e, t, r) {
const n = Object.keys(this.props).filter((t => !
_isEqual(this.props[t], e[t])))
, i = Object.keys(this.state).filter((e => !
_isEqual(this.state[e], t[e])));
n.includes("reCalcKey") &&
this.foundation.updateDOMHeight(this.domRef.current.scrollHeight),
i.includes("domInRenderTree") && this.state.domInRenderTree &&
this.foundation.updateDOMHeight(this.domRef.current.scrollHeight),
n.includes("isOpen") && (!this.props.isOpen && this.props.motion ||
this.foundation.updateVisible(this.props.isOpen)),
this.props.motion && e.isOpen !== this.props.isOpen &&
this.foundation.updateIsTransitioning(!0)
}
componentWillUnmount() {
super.componentWillUnmount(),
this.resizeObserver.disconnect()
}
render() {
const e = Object.assign({
overflow: "hidden",
height: this.props.isOpen ? this.state.domHeight :
this.props.collapseHeight,
opacity: this.props.isOpen || !this.props.fade || 0 !==
this.props.collapseHeight ? 1 : 0,
transitionDuration: `${this.props.motion &&
this.state.isTransitioning ? this.props.duration : 0}ms`
}, this.props.style)
, t = classNames(`${cssClasses$m.PREFIX}-wrapper`, {
[`${cssClasses$m.PREFIX}-transition`]: this.props.motion &&
this.state.isTransitioning
}, this.props.className)
, r = this.props.keepDOM && (!this.props.lazyRender ||
this.hasBeenRendered) || 0 !== this.props.collapseHeight || this.state.visible ||
this.props.isOpen;
return r && !this.hasBeenRendered && (this.hasBeenRendered = !0),
React.createElement("div", Object.assign({
className: t,
style: e,
onTransitionEnd: () => {
var e, t;
this.props.isOpen || this.foundation.updateVisible(!1),
this.foundation.updateIsTransitioning(!1),
null === (t = (e = this.props).onMotionEnd) || void 0 === t
|| t.call(e)
}
}, this.getDataAttr(this.props)), React.createElement("div", {
"x-semi-prop": "children",
ref: this.domRef,
style: {
overflow: "hidden"
},
id: this.props.id
}, r && this.props.children))
}
}
Collapsible.__SemiComponentName__ = "Collapsible",
Collapsible.defaultProps =
getDefaultPropsFromGlobalConfig(Collapsible.__SemiComponentName__, {
isOpen: !1,
duration: 250,
motion: !0,
keepDOM: !1,
lazyRender: !1,
collapseHeight: 0,
fade: !1
}),
Collapsible.getEntryInfo = e => {
let t;
t = e.borderBoxSize ? !(0 === e.borderBoxSize[0].blockSize && 0 ===
e.borderBoxSize[0].inlineSize) : !(0 === e.contentRect.height && 0 ===
e.contentRect.width);
let r = 0;
if (e.borderBoxSize)
r = Math.ceil(e.borderBoxSize[0].blockSize);
else {
r = e.target.clientHeight
}
return {
isShown: t,
height: r
}
}
,
Collapsible.propTypes = {
motion: PropTypes.bool,
children: PropTypes.node,
isOpen: PropTypes.bool,
duration: PropTypes.number,
keepDOM: PropTypes.bool,
collapseHeight: PropTypes.number,
style: PropTypes.object,
className: PropTypes.string,
reCalcKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
};
const Collapsible$1 = Collapsible;
var baseUnset = _baseUnset;
function unset(e, t) {
return null == e || baseUnset(e, t)
}
var unset_1 = unset;
const _unset = getDefaultExportFromCjs(unset_1);
var arrayMap$2 = _arrayMap
, copyArray$1 = _copyArray
, isArray$4 = isArray_1
, isSymbol$1 = isSymbol_1
, stringToPath$2 = _stringToPath
, toKey$1 = _toKey
, toString$2 = toString_1;
function toPath(e) {
return isArray$4(e) ? arrayMap$2(e, toKey$1) : isSymbol$1(e) ? [e] :
copyArray$1(stringToPath$2(toString$2(e)))
}
var toPath_1 = toPath;
const _toPath = getDefaultExportFromCjs(toPath_1)
, pathToArrayElem = e => {
const t = _toPath(e);
return !(_isNumber(e) && 1 === t.length) &&
Number.isInteger(+t[t.length - 1])
}
;
function isEmptyObject(e) {
if (_isObject(e)) {
const t = _values(e);
return !t.length || t.every((e => void 0 === e))
}
return !1
}
function cleanup(e, t) {
if (0 === t.length)
return;
const r = _get(e, t);
(Array.isArray(r) && r.every((e => null == e)) || isEmptyObject(r)) &&
_unset(e, t),
cleanup(e, t.slice(0, t.length - 1))
}
function empty$4(e) {
return 0 === _values(e).length
}
function get$2(e, t) {
return _get(e, t)
}
function remove(e, t) {
_unset(e, t);
let r = _toPath(t);
r = r.slice(0, r.length - 1),
cleanup(e, r)
}
function set(e, t, r, n) {
if (n)
return _set(e, t, r);
if (void 0 !== r)
return _set(e, t, r);
if (pathToArrayElem(t) && void 0 !== get$2(e, t)) {
_set(e, t, void 0);
let r = _toPath(t);
r = r.slice(0, r.length - 1),
cleanup(e, r)
} else
pathToArrayElem(t) || void 0 === get$2(e, t) || remove(e, t)
}
function forwardStatics(e, t) {
return !e || "function" != typeof e && "object" != typeof e || !t ||
"function" != typeof t && "object" != typeof t || Object.entries(t).forEach((t => {
let[r,n] = t;
e[r] = n
}
)),
e
}
const dayItemClasses = {
DAY_TODAY: `${BASE_CLASS_PREFIX$1}-datepicker-day-today`,
DAY_IN_RANGE: `${BASE_CLASS_PREFIX$1}-datepicker-day-inrange`,
DAY_HOVER: `${BASE_CLASS_PREFIX$1}-datepicker-day-inhover`,
DAY_SELECTED: `${BASE_CLASS_PREFIX$1}-datepicker-day-selected`,
DAY_SELECTED_START: `${BASE_CLASS_PREFIX$1}-datepicker-day-selected-
start`,
DAY_SELECTED_END: `${BASE_CLASS_PREFIX$1}-datepicker-day-selected-end`,
DAY_DISABLED: `${BASE_CLASS_PREFIX$1}-datepicker-day-disabled`,
DAY_HOVER_DAY: `${BASE_CLASS_PREFIX$1}-datepicker-day-hoverday`,
DAY_HOVER_DAY_OFFSET: `${BASE_CLASS_PREFIX$1}-datepicker-day-hoverday-
offset`,
DAY_IN_OFFSET_RANGE: `${BASE_CLASS_PREFIX$1}-datepicker-day-
inoffsetrange`,
DAY_SELECTED_RANGE_HOVER: `${BASE_CLASS_PREFIX$1}-datepicker-day-
selectedrange-hover`,
DAY_OFFSET_RANGE_START: `${BASE_CLASS_PREFIX$1}-datepicker-day-
offsetrange-start`,
DAY_OFFSET_RANGE_END: `${BASE_CLASS_PREFIX$1}-datepicker-day-
offsetrange-end`,
DAY_SELECTED_START_AFTER_HOVER: `${BASE_CLASS_PREFIX$1}-datepicker-day-
selected-start-afterhover`,
DAY_SELECTED_END_BEFORE_HOVER: `${BASE_CLASS_PREFIX$1}-datepicker-day-
selected-end-beforehover`,
DAY_HOVER_DAY_BEFORE_RANGE: `${BASE_CLASS_PREFIX$1}-datepicker-day-
hoverday-beforerange`,
DAY_HOVER_DAY_AFTER_RANGE: `${BASE_CLASS_PREFIX$1}-datepicker-day-
hoverday-afterrange`,
DAY_HOVER_DAY_IN_RANGE: `${BASE_CLASS_PREFIX$1}-datepicker-day-
hoverday-inrange`,
DAY_HOVER_DAY_AROUND_SINGLE_SELECTED: `${BASE_CLASS_PREFIX$1}-
datepicker-day-hoverday-around-singleselected`
}
, cssClasses$l = Object.assign({
PREFIX: `${BASE_CLASS_PREFIX$1}-datepicker`,
NAVIGATION: `${BASE_CLASS_PREFIX$1}-datepicker-navigation`,
PANEL_YAM: `${BASE_CLASS_PREFIX$1}-datepicker-panel-yam`,
MONTH: `${BASE_CLASS_PREFIX$1}-datepicker-month`,
WEEKDAY: `${BASE_CLASS_PREFIX$1}-datepicker-weekday`,
WEEKS: `${BASE_CLASS_PREFIX$1}-datepicker-weeks`,
WEEK: `${BASE_CLASS_PREFIX$1}-datepicker-week`,
DAY: `${BASE_CLASS_PREFIX$1}-datepicker-day`
}, dayItemClasses)
, formatToken = {
FORMAT_FULL_DATE: "yyyy-MM-dd",
FORMAT_TIME_PICKER: "HH:mm:ss",
FORMAT_DATE_TIME: "yyyy-MM-dd HH:mm:ss",
FORMAT_YEAR_MONTH: "yyyy-MM"
}
, strings$g = Object.assign({
DEFAULT_SEPARATOR_MULTIPLE: ",",
DEFAULT_SEPARATOR_RANGE: " ~ ",
SIZE_SET: ["small", "default", "large"],
TYPE_SET: ["date", "dateRange", "year", "month", "monthRange",
"dateTime", "dateTimeRange"],
PRESET_POSITION_SET: ["left", "right", "top", "bottom"],
DENSITY_SET: ["default", "compact"],
PANEL_TYPE_LEFT: "left",
PANEL_TYPE_RIGHT: "right",
STATUS: VALIDATE_STATUS,
POSITION_SET: strings$s.POSITION_SET,
POSITION_INLINE_INPUT: "leftTopOver"
}, formatToken)
, numbers$8 = {
WEEK_START_ON: 0,
WEEK_HEIGHT: 36,
SPACING: numbers$a.SPACING,
SPACING_INSET_INPUT: 1
};
var baseGetTag$2 = _baseGetTag
, isObjectLike$2 = isObjectLike_1
, dateTag$2 = "[object Date]";
function baseIsDate$1(e) {
return isObjectLike$2(e) && baseGetTag$2(e) == dateTag$2
}
var _baseIsDate = baseIsDate$1
, baseIsDate = _baseIsDate
, baseUnary$2 = _baseUnary
, nodeUtil$3 = _nodeUtilExports
, nodeIsDate = nodeUtil$3 && nodeUtil$3.isDate
, isDate$1 = nodeIsDate ? baseUnary$2(nodeIsDate) : baseIsDate
, isDate_1 = isDate$1;
const _isDate = getDefaultExportFromCjs(isDate_1);
function isString(e) {
return "string" == typeof e
}
function isAfter(e, t) {
return isAfter$2(isString(e) ? parseISO(e) : e, isString(t) ?
parseISO(t) : t)
}
function isBefore(e, t) {
return isBefore$1(isString(e) ? parseISO(e) : e, isString(t) ?
parseISO(t) : t)
}
function isBetween(e, t) {
let {start: r, end: n} = t;
const i = isString(e) ? parseISO(e) : e
, o = isString(r) ? parseISO(r) : r
, s = isString(n) ? parseISO(n) : n;
return isBefore$1(o, s) && isWithinInterval(i, {
start: o,
end: s
}) && !isEqual$1(i, o) && !isEqual$1(i, s)
}
function isSameDay(e, t) {
return isSameDay$1(isString(e) ? parseISO(e) : e, isString(t) ?
parseISO(t) : t)
}
function isValidDate(e) {
return e && "[object Date]" === Object.prototype.toString.call(e) && !
isNaN(e)
}
function isNumber$2(e) {
return "number" == typeof e || "[object Number]" ===
Object.prototype.toString.call(e)
}
function isTimestamp(e) {
return isNumber$2(e) && isValidDate(new Date(e))
}
const defaultFormatTokens = {
date: strings$g.FORMAT_FULL_DATE,
dateTime: strings$g.FORMAT_DATE_TIME,
dateRange: strings$g.FORMAT_FULL_DATE,
dateTimeRange: strings$g.FORMAT_DATE_TIME,
month: strings$g.FORMAT_YEAR_MONTH,
monthRange: strings$g.FORMAT_YEAR_MONTH
}
, getDefaultFormatToken = e => defaultFormatTokens;
function getDefaultFormatTokenByType(e) {
return e && defaultFormatTokens[e]
}
const getDefaultFormatToken$1 = getDefaultFormatToken
, getYears = (e, t) => {
const r = (new Date).getFullYear();
let n = "number" == typeof e ? e : r - 100
, i = "number" == typeof t ? t : r + 100;
return i < n && ([n,i] = [i, n]),
Array.from({
length: i - n + 1
}, ( (e, t) => n + t))
}
, getYears$1 = getYears
, getFullDateOffset = (e, t) => {
if (!t)
return "";
const r = new Date(t)
, n = _isFunction(e) ? e(r) : r;
return format$3(new Date(n), strings$g.FORMAT_FULL_DATE)
}
, getFullDateOffset$1 = getFullDateOffset;
var format$2 = {
exports: {}
}
, format$1 = {
exports: {}
}
, interopRequireDefault = {
exports: {}
};
!function(e) {
e.exports = function(e) {
return e && e.__esModule ? e : {
default: e
}
}
,
e.exports.__esModule = !0,
e.exports.default = e.exports
}(interopRequireDefault);
var interopRequireDefaultExports = interopRequireDefault.exports
, isValid$1 = {
exports: {}
}
, isDate = {
exports: {}
}
, _typeof$1 = {
exports: {}
};
!function(e) {
function t(r) {
return e.exports = t = "function" == typeof Symbol && "symbol" ==
typeof Symbol.iterator ? function(e) {
return typeof e
}
: function(e) {
return e && "function" == typeof Symbol && e.constructor ===
Symbol && e !== Symbol.prototype ? "symbol" : typeof e
}
,
e.exports.__esModule = !0,
e.exports.default = e.exports,
t(r)
}
e.exports = t,
e.exports.__esModule = !0,
e.exports.default = e.exports
}(_typeof$1);
var _typeofExports = _typeof$1.exports
, requiredArgs = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
if (t.length < e)
throw new TypeError(e + " argument" + (e > 1 ? "s" : "") + "
required, but only " + t.length + " present")
}
,
e.exports = t.default
}(requiredArgs, requiredArgs.exports);
var requiredArgsExports = requiredArgs.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
return (0,
i.default)(1, arguments),
e instanceof Date || "object" === (0,
n.default)(e) && "[object Date]" ===
Object.prototype.toString.call(e)
}
;
var n = r(_typeofExports)
, i = r(requiredArgsExports);
e.exports = t.default
}(isDate, isDate.exports);
var isDateExports = isDate.exports
, toDate$1 = {
exports: {}
};
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
(0,
i.default)(1, arguments);
var t = Object.prototype.toString.call(e);
return e instanceof Date || "object" === (0,
n.default)(e) && "[object Date]" === t ? new Date(e.getTime()) :
"number" == typeof e || "[object Number]" === t ? new Date(e) : new Date(NaN)
}
;
var n = r(_typeofExports)
, i = r(requiredArgsExports);
e.exports = t.default
}(toDate$1, toDate$1.exports);
var toDateExports$1 = toDate$1.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
if ((0,
o.default)(1, arguments),
!(0,
n.default)(e) && "number" != typeof e)
return !1;
var t = (0,
i.default)(e);
return !isNaN(Number(t))
}
;
var n = r(isDateExports)
, i = r(toDateExports$1)
, o = r(requiredArgsExports);
e.exports = t.default
}(isValid$1, isValid$1.exports);
var isValidExports = isValid$1.exports
, subMilliseconds = {
exports: {}
}
, addMilliseconds = {
exports: {}
}
, toInteger$3 = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
if (null === e || !0 === e || !1 === e)
return NaN;
var t = Number(e);
if (isNaN(t))
return t;
return t < 0 ? Math.ceil(t) : Math.floor(t)
}
,
e.exports = t.default
}(toInteger$3, toInteger$3.exports);
var toIntegerExports = toInteger$3.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
(0,
o.default)(2, arguments);
var r = (0,
i.default)(e).getTime()
, s = (0,
n.default)(t);
return new Date(r + s)
}
;
var n = r(toIntegerExports)
, i = r(toDateExports$1)
, o = r(requiredArgsExports);
e.exports = t.default
}(addMilliseconds, addMilliseconds.exports);
var addMillisecondsExports = addMilliseconds.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
(0,
i.default)(2, arguments);
var r = (0,
o.default)(t);
return (0,
n.default)(e, -r)
}
;
var n = r(addMillisecondsExports)
, i = r(requiredArgsExports)
, o = r(toIntegerExports);
e.exports = t.default
}(subMilliseconds, subMilliseconds.exports);
var subMillisecondsExports = subMilliseconds.exports
, formatters$1 = {
exports: {}
}
, getUTCDayOfYear = {
exports: {}
};
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
(0,
i.default)(1, arguments);
var t = (0,
n.default)(e)
, r = t.getTime();
t.setUTCMonth(0, 1),
t.setUTCHours(0, 0, 0, 0);
var s = t.getTime()
, a = r - s;
return Math.floor(a / o) + 1
}
;
var n = r(toDateExports$1)
, i = r(requiredArgsExports)
, o = 864e5;
e.exports = t.default
}(getUTCDayOfYear, getUTCDayOfYear.exports);
var getUTCDayOfYearExports = getUTCDayOfYear.exports
, getUTCISOWeek = {
exports: {}
}
, startOfUTCISOWeek = {
exports: {}
};
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
(0,
i.default)(1, arguments);
var t = (0,
n.default)(e)
, r = t.getUTCDay()
, o = (r < 1 ? 7 : 0) + r - 1;
return t.setUTCDate(t.getUTCDate() - o),
t.setUTCHours(0, 0, 0, 0),
t
}
;
var n = r(toDateExports$1)
, i = r(requiredArgsExports);
e.exports = t.default
}(startOfUTCISOWeek, startOfUTCISOWeek.exports);
var startOfUTCISOWeekExports = startOfUTCISOWeek.exports
, startOfUTCISOWeekYear = {
exports: {}
}
, getUTCISOWeekYear = {
exports: {}
};
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
(0,
i.default)(1, arguments);
var t = (0,
n.default)(e)
, r = t.getUTCFullYear()
, s = new Date(0);
s.setUTCFullYear(r + 1, 0, 4),
s.setUTCHours(0, 0, 0, 0);
var a = (0,
o.default)(s)
, l = new Date(0);
l.setUTCFullYear(r, 0, 4),
l.setUTCHours(0, 0, 0, 0);
var c = (0,
o.default)(l);
return t.getTime() >= a.getTime() ? r + 1 : t.getTime() >=
c.getTime() ? r : r - 1
}
;
var n = r(toDateExports$1)
, i = r(requiredArgsExports)
, o = r(startOfUTCISOWeekExports);
e.exports = t.default
}(getUTCISOWeekYear, getUTCISOWeekYear.exports);
var getUTCISOWeekYearExports = getUTCISOWeekYear.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
(0,
o.default)(1, arguments);
var t = (0,
n.default)(e)
, r = new Date(0);
return r.setUTCFullYear(t, 0, 4),
r.setUTCHours(0, 0, 0, 0),
(0,
i.default)(r)
}
;
var n = r(getUTCISOWeekYearExports)
, i = r(startOfUTCISOWeekExports)
, o = r(requiredArgsExports);
e.exports = t.default
}(startOfUTCISOWeekYear, startOfUTCISOWeekYear.exports);
var startOfUTCISOWeekYearExports = startOfUTCISOWeekYear.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
(0,
s.default)(1, arguments);
var t = (0,
n.default)(e)
, r = (0,
i.default)(t).getTime() - (0,
o.default)(t).getTime();
return Math.round(r / a) + 1
}
;
var n = r(toDateExports$1)
, i = r(startOfUTCISOWeekExports)
, o = r(startOfUTCISOWeekYearExports)
, s = r(requiredArgsExports)
, a = 6048e5;
e.exports = t.default
}(getUTCISOWeek, getUTCISOWeek.exports);
var getUTCISOWeekExports = getUTCISOWeek.exports
, getUTCWeek = {
exports: {}
}
, startOfUTCWeek = {
exports: {}
}
, defaultOptions$1 = {};
Object.defineProperty(defaultOptions$1, "__esModule", {
value: !0
}),
defaultOptions$1.getDefaultOptions = getDefaultOptions,
defaultOptions$1.setDefaultOptions = setDefaultOptions;
var defaultOptions = {};
function getDefaultOptions() {
return defaultOptions
}
function setDefaultOptions(e) {
defaultOptions = e
}
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
var r, a, l, c, u, d, p, h;
(0,
i.default)(1, arguments);
var f = (0,
s.getDefaultOptions)()
, m = (0,
o.default)(null !== (r = null !== (a = null !== (l = null !== (c =
null == t ? void 0 : t.weekStartsOn) && void 0 !== c ? c : null == t || null === (u
= t.locale) || void 0 === u || null === (d = u.options) || void 0 === d ? void 0 :
d.weekStartsOn) && void 0 !== l ? l : f.weekStartsOn) && void 0 !== a ? a : null
=== (p = f.locale) || void 0 === p || null === (h = p.options) || void 0 === h ?
void 0 : h.weekStartsOn) && void 0 !== r ? r : 0);
if (!(m >= 0 && m <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6
inclusively");
var g = (0,
n.default)(e)
, y = g.getUTCDay()
, v = (y < m ? 7 : 0) + y - m;
return g.setUTCDate(g.getUTCDate() - v),
g.setUTCHours(0, 0, 0, 0),
g
}
;
var n = r(toDateExports$1)
, i = r(requiredArgsExports)
, o = r(toIntegerExports)
, s = defaultOptions$1;
e.exports = t.default
}(startOfUTCWeek, startOfUTCWeek.exports);
var startOfUTCWeekExports = startOfUTCWeek.exports
, startOfUTCWeekYear = {
exports: {}
}
, getUTCWeekYear = {
exports: {}
};
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
var r, l, c, u, d, p, h, f;
(0,
i.default)(1, arguments);
var m = (0,
n.default)(e)
, g = m.getUTCFullYear()
, y = (0,
a.getDefaultOptions)()
, v = (0,
s.default)(null !== (r = null !== (l = null !== (c = null !== (u =
null == t ? void 0 : t.firstWeekContainsDate) && void 0 !== u ? u : null == t ||
null === (d = t.locale) || void 0 === d || null === (p = d.options) || void 0 === p
? void 0 : p.firstWeekContainsDate) && void 0 !== c ? c : y.firstWeekContainsDate)
&& void 0 !== l ? l : null === (h = y.locale) || void 0 === h || null === (f =
h.options) || void 0 === f ? void 0 : f.firstWeekContainsDate) && void 0 !== r ?
r : 1);
if (!(v >= 1 && v <= 7))
throw new RangeError("firstWeekContainsDate must be between 1
and 7 inclusively");
var b = new Date(0);
b.setUTCFullYear(g + 1, 0, v),
b.setUTCHours(0, 0, 0, 0);
var x = (0,
o.default)(b, t)
, _ = new Date(0);
_.setUTCFullYear(g, 0, v),
_.setUTCHours(0, 0, 0, 0);
var E = (0,
o.default)(_, t);
return m.getTime() >= x.getTime() ? g + 1 : m.getTime() >=
E.getTime() ? g : g - 1
}
;
var n = r(toDateExports$1)
, i = r(requiredArgsExports)
, o = r(startOfUTCWeekExports)
, s = r(toIntegerExports)
, a = defaultOptions$1;
e.exports = t.default
}(getUTCWeekYear, getUTCWeekYear.exports);
var getUTCWeekYearExports = getUTCWeekYear.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
var r, l, c, u, d, p, h, f;
(0,
i.default)(1, arguments);
var m = (0,
a.getDefaultOptions)()
, g = (0,
s.default)(null !== (r = null !== (l = null !== (c = null !== (u =
null == t ? void 0 : t.firstWeekContainsDate) && void 0 !== u ? u : null == t ||
null === (d = t.locale) || void 0 === d || null === (p = d.options) || void 0 === p
? void 0 : p.firstWeekContainsDate) && void 0 !== c ? c : m.firstWeekContainsDate)
&& void 0 !== l ? l : null === (h = m.locale) || void 0 === h || null === (f =
h.options) || void 0 === f ? void 0 : f.firstWeekContainsDate) && void 0 !== r ?
r : 1)
, y = (0,
n.default)(e, t)
, v = new Date(0);
return v.setUTCFullYear(y, 0, g),
v.setUTCHours(0, 0, 0, 0),
(0,
o.default)(v, t)
}
;
var n = r(getUTCWeekYearExports)
, i = r(requiredArgsExports)
, o = r(startOfUTCWeekExports)
, s = r(toIntegerExports)
, a = defaultOptions$1;
e.exports = t.default
}(startOfUTCWeekYear, startOfUTCWeekYear.exports);
var startOfUTCWeekYearExports = startOfUTCWeekYear.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
(0,
s.default)(1, arguments);
var r = (0,
n.default)(e)
, l = (0,
i.default)(r, t).getTime() - (0,
o.default)(r, t).getTime();
return Math.round(l / a) + 1
}
;
var n = r(toDateExports$1)
, i = r(startOfUTCWeekExports)
, o = r(startOfUTCWeekYearExports)
, s = r(requiredArgsExports)
, a = 6048e5;
e.exports = t.default
}(getUTCWeek, getUTCWeek.exports);
var getUTCWeekExports = getUTCWeek.exports
, addLeadingZeros = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
var r = e < 0 ? "-" : ""
, n = Math.abs(e).toString();
for (; n.length < t; )
n = "0" + n;
return r + n
}
,
e.exports = t.default
}(addLeadingZeros, addLeadingZeros.exports);
var addLeadingZerosExports = addLeadingZeros.exports
, lightFormatters = {
exports: {}
};
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var n = r(addLeadingZerosExports)
, i = {
y: function(e, t) {
var r = e.getUTCFullYear()
, i = r > 0 ? r : 1 - r;
return (0,
n.default)("yy" === t ? i % 100 : i, t.length)
},
M: function(e, t) {
var r = e.getUTCMonth();
return "M" === t ? String(r + 1) : (0,
n.default)(r + 1, 2)
},
d: function(e, t) {
return (0,
n.default)(e.getUTCDate(), t.length)
},
a: function(e, t) {
var r = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
switch (t) {
case "a":
case "aa":
return r.toUpperCase();
case "aaa":
return r;
case "aaaaa":
return r[0];
default:
return "am" === r ? "a.m." : "p.m."
}
},
h: function(e, t) {
return (0,
n.default)(e.getUTCHours() % 12 || 12, t.length)
},
H: function(e, t) {
return (0,
n.default)(e.getUTCHours(), t.length)
},
m: function(e, t) {
return (0,
n.default)(e.getUTCMinutes(), t.length)
},
s: function(e, t) {
return (0,
n.default)(e.getUTCSeconds(), t.length)
},
S: function(e, t) {
var r = t.length
, i = e.getUTCMilliseconds()
, o = Math.floor(i * Math.pow(10, r - 3));
return (0,
n.default)(o, t.length)
}
};
t.default = i,
e.exports = t.default
}(lightFormatters, lightFormatters.exports);
var lightFormattersExports = lightFormatters.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var n = r(getUTCDayOfYearExports)
, i = r(getUTCISOWeekExports)
, o = r(getUTCISOWeekYearExports)
, s = r(getUTCWeekExports)
, a = r(getUTCWeekYearExports)
, l = r(addLeadingZerosExports)
, c = r(lightFormattersExports)
, u = "midnight"
, d = "noon"
, p = "morning"
, h = "afternoon"
, f = "evening"
, m = "night";
function g(e, t) {
var r = e > 0 ? "-" : "+"
, n = Math.abs(e)
, i = Math.floor(n / 60)
, o = n % 60;
if (0 === o)
return r + String(i);
var s = t || "";
return r + String(i) + s + (0,
l.default)(o, 2)
}
function y(e, t) {
return e % 60 == 0 ? (e > 0 ? "-" : "+") + (0,
l.default)(Math.abs(e) / 60, 2) : v(e, t)
}
function v(e, t) {
var r = t || ""
, n = e > 0 ? "-" : "+"
, i = Math.abs(e);
return n + (0,
l.default)(Math.floor(i / 60), 2) + r + (0,
l.default)(i % 60, 2)
}
var b = {
G: function(e, t, r) {
var n = e.getUTCFullYear() > 0 ? 1 : 0;
switch (t) {
case "G":
case "GG":
case "GGG":
return r.era(n, {
width: "abbreviated"
});
case "GGGGG":
return r.era(n, {
width: "narrow"
});
default:
return r.era(n, {
width: "wide"
})
}
},
y: function(e, t, r) {
if ("yo" === t) {
var n = e.getUTCFullYear()
, i = n > 0 ? n : 1 - n;
return r.ordinalNumber(i, {
unit: "year"
})
}
return c.default.y(e, t)
},
Y: function(e, t, r, n) {
var i = (0,
a.default)(e, n)
, o = i > 0 ? i : 1 - i;
if ("YY" === t) {
var s = o % 100;
return (0,
l.default)(s, 2)
}
return "Yo" === t ? r.ordinalNumber(o, {
unit: "year"
}) : (0,
l.default)(o, t.length)
},
R: function(e, t) {
var r = (0,
o.default)(e);
return (0,
l.default)(r, t.length)
},
u: function(e, t) {
var r = e.getUTCFullYear();
return (0,
l.default)(r, t.length)
},
Q: function(e, t, r) {
var n = Math.ceil((e.getUTCMonth() + 1) / 3);
switch (t) {
case "Q":
return String(n);
case "QQ":
return (0,
l.default)(n, 2);
case "Qo":
return r.ordinalNumber(n, {
unit: "quarter"
});
case "QQQ":
return r.quarter(n, {
width: "abbreviated",
context: "formatting"
});
case "QQQQQ":
return r.quarter(n, {
width: "narrow",
context: "formatting"
});
default:
return r.quarter(n, {
width: "wide",
context: "formatting"
})
}
},
q: function(e, t, r) {
var n = Math.ceil((e.getUTCMonth() + 1) / 3);
switch (t) {
case "q":
return String(n);
case "qq":
return (0,
l.default)(n, 2);
case "qo":
return r.ordinalNumber(n, {
unit: "quarter"
});
case "qqq":
return r.quarter(n, {
width: "abbreviated",
context: "standalone"
});
case "qqqqq":
return r.quarter(n, {
width: "narrow",
context: "standalone"
});
default:
return r.quarter(n, {
width: "wide",
context: "standalone"
})
}
},
M: function(e, t, r) {
var n = e.getUTCMonth();
switch (t) {
case "M":
case "MM":
return c.default.M(e, t);
case "Mo":
return r.ordinalNumber(n + 1, {
unit: "month"
});
case "MMM":
return r.month(n, {
width: "abbreviated",
context: "formatting"
});
case "MMMMM":
return r.month(n, {
width: "narrow",
context: "formatting"
});
default:
return r.month(n, {
width: "wide",
context: "formatting"
})
}
},
L: function(e, t, r) {
var n = e.getUTCMonth();
switch (t) {
case "L":
return String(n + 1);
case "LL":
return (0,
l.default)(n + 1, 2);
case "Lo":
return r.ordinalNumber(n + 1, {
unit: "month"
});
case "LLL":
return r.month(n, {
width: "abbreviated",
context: "standalone"
});
case "LLLLL":
return r.month(n, {
width: "narrow",
context: "standalone"
});
default:
return r.month(n, {
width: "wide",
context: "standalone"
})
}
},
w: function(e, t, r, n) {
var i = (0,
s.default)(e, n);
return "wo" === t ? r.ordinalNumber(i, {
unit: "week"
}) : (0,
l.default)(i, t.length)
},
I: function(e, t, r) {
var n = (0,
i.default)(e);
return "Io" === t ? r.ordinalNumber(n, {
unit: "week"
}) : (0,
l.default)(n, t.length)
},
d: function(e, t, r) {
return "do" === t ? r.ordinalNumber(e.getUTCDate(), {
unit: "date"
}) : c.default.d(e, t)
},
D: function(e, t, r) {
var i = (0,
n.default)(e);
return "Do" === t ? r.ordinalNumber(i, {
unit: "dayOfYear"
}) : (0,
l.default)(i, t.length)
},
E: function(e, t, r) {
var n = e.getUTCDay();
switch (t) {
case "E":
case "EE":
case "EEE":
return r.day(n, {
width: "abbreviated",
context: "formatting"
});
case "EEEEE":
return r.day(n, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return r.day(n, {
width: "short",
context: "formatting"
});
default:
return r.day(n, {
width: "wide",
context: "formatting"
})
}
},
e: function(e, t, r, n) {
var i = e.getUTCDay()
, o = (i - n.weekStartsOn + 8) % 7 || 7;
switch (t) {
case "e":
return String(o);
case "ee":
return (0,
l.default)(o, 2);
case "eo":
return r.ordinalNumber(o, {
unit: "day"
});
case "eee":
return r.day(i, {
width: "abbreviated",
context: "formatting"
});
case "eeeee":
return r.day(i, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return r.day(i, {
width: "short",
context: "formatting"
});
default:
return r.day(i, {
width: "wide",
context: "formatting"
})
}
},
c: function(e, t, r, n) {
var i = e.getUTCDay()
, o = (i - n.weekStartsOn + 8) % 7 || 7;
switch (t) {
case "c":
return String(o);
case "cc":
return (0,
l.default)(o, t.length);
case "co":
return r.ordinalNumber(o, {
unit: "day"
});
case "ccc":
return r.day(i, {
width: "abbreviated",
context: "standalone"
});
case "ccccc":
return r.day(i, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return r.day(i, {
width: "short",
context: "standalone"
});
default:
return r.day(i, {
width: "wide",
context: "standalone"
})
}
},
i: function(e, t, r) {
var n = e.getUTCDay()
, i = 0 === n ? 7 : n;
switch (t) {
case "i":
return String(i);
case "ii":
return (0,
l.default)(i, t.length);
case "io":
return r.ordinalNumber(i, {
unit: "day"
});
case "iii":
return r.day(n, {
width: "abbreviated",
context: "formatting"
});
case "iiiii":
return r.day(n, {
width: "narrow",
context: "formatting"
});
case "iiiiii":
return r.day(n, {
width: "short",
context: "formatting"
});
default:
return r.day(n, {
width: "wide",
context: "formatting"
})
}
},
a: function(e, t, r) {
var n = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
switch (t) {
case "a":
case "aa":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
});
case "aaa":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "aaaaa":
return r.dayPeriod(n, {
width: "narrow",
context: "formatting"
});
default:
return r.dayPeriod(n, {
width: "wide",
context: "formatting"
})
}
},
b: function(e, t, r) {
var n, i = e.getUTCHours();
switch (n = 12 === i ? d : 0 === i ? u : i / 12 >= 1 ? "pm" :
"am",
t) {
case "b":
case "bb":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
});
case "bbb":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "bbbbb":
return r.dayPeriod(n, {
width: "narrow",
context: "formatting"
});
default:
return r.dayPeriod(n, {
width: "wide",
context: "formatting"
})
}
},
B: function(e, t, r) {
var n, i = e.getUTCHours();
switch (n = i >= 17 ? f : i >= 12 ? h : i >= 4 ? p : m,
t) {
case "B":
case "BB":
case "BBB":
return r.dayPeriod(n, {
width: "abbreviated",
context: "formatting"
});
case "BBBBB":
return r.dayPeriod(n, {
width: "narrow",
context: "formatting"
});
default:
return r.dayPeriod(n, {
width: "wide",
context: "formatting"
})
}
},
h: function(e, t, r) {
if ("ho" === t) {
var n = e.getUTCHours() % 12;
return 0 === n && (n = 12),
r.ordinalNumber(n, {
unit: "hour"
})
}
return c.default.h(e, t)
},
H: function(e, t, r) {
return "Ho" === t ? r.ordinalNumber(e.getUTCHours(), {
unit: "hour"
}) : c.default.H(e, t)
},
K: function(e, t, r) {
var n = e.getUTCHours() % 12;
return "Ko" === t ? r.ordinalNumber(n, {
unit: "hour"
}) : (0,
l.default)(n, t.length)
},
k: function(e, t, r) {
var n = e.getUTCHours();
return 0 === n && (n = 24),
"ko" === t ? r.ordinalNumber(n, {
unit: "hour"
}) : (0,
l.default)(n, t.length)
},
m: function(e, t, r) {
return "mo" === t ? r.ordinalNumber(e.getUTCMinutes(), {
unit: "minute"
}) : c.default.m(e, t)
},
s: function(e, t, r) {
return "so" === t ? r.ordinalNumber(e.getUTCSeconds(), {
unit: "second"
}) : c.default.s(e, t)
},
S: function(e, t) {
return c.default.S(e, t)
},
X: function(e, t, r, n) {
var i = (n._originalDate || e).getTimezoneOffset();
if (0 === i)
return "Z";
switch (t) {
case "X":
return y(i);
case "XXXX":
case "XX":
return v(i);
default:
return v(i, ":")
}
},
x: function(e, t, r, n) {
var i = (n._originalDate || e).getTimezoneOffset();
switch (t) {
case "x":
return y(i);
case "xxxx":
case "xx":
return v(i);
default:
return v(i, ":")
}
},
O: function(e, t, r, n) {
var i = (n._originalDate || e).getTimezoneOffset();
switch (t) {
case "O":
case "OO":
case "OOO":
return "GMT" + g(i, ":");
default:
return "GMT" + v(i, ":")
}
},
z: function(e, t, r, n) {
var i = (n._originalDate || e).getTimezoneOffset();
switch (t) {
case "z":
case "zz":
case "zzz":
return "GMT" + g(i, ":");
default:
return "GMT" + v(i, ":")
}
},
t: function(e, t, r, n) {
var i = n._originalDate || e
, o = Math.floor(i.getTime() / 1e3);
return (0,
l.default)(o, t.length)
},
T: function(e, t, r, n) {
var i = (n._originalDate || e).getTime();
return (0,
l.default)(i, t.length)
}
};
t.default = b,
e.exports = t.default
}(formatters$1, formatters$1.exports);
var formattersExports$1 = formatters$1.exports
, longFormatters = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var r = function(e, t) {
switch (e) {
case "P":
return t.date({
width: "short"
});
case "PP":
return t.date({
width: "medium"
});
case "PPP":
return t.date({
width: "long"
});
default:
return t.date({
width: "full"
})
}
}
, n = function(e, t) {
switch (e) {
case "p":
return t.time({
width: "short"
});
case "pp":
return t.time({
width: "medium"
});
case "ppp":
return t.time({
width: "long"
});
default:
return t.time({
width: "full"
})
}
}
, i = {
p: n,
P: function(e, t) {
var i, o = e.match(/(P+)(p+)?/) || [], s = o[1], a = o[2];
if (!a)
return r(e, t);
switch (s) {
case "P":
i = t.dateTime({
width: "short"
});
break;
case "PP":
i = t.dateTime({
width: "medium"
});
break;
case "PPP":
i = t.dateTime({
width: "long"
});
break;
default:
i = t.dateTime({
width: "full"
})
}
return i.replace("{{date}}", r(s, t)).replace("{{time}}", n(a,
t))
}
};
t.default = i,
e.exports = t.default
}(longFormatters, longFormatters.exports);
var longFormattersExports = longFormatters.exports
, getTimezoneOffsetInMilliseconds = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
var t = new Date(Date.UTC(e.getFullYear(), e.getMonth(),
e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
return t.setUTCFullYear(e.getFullYear()),
e.getTime() - t.getTime()
}
,
e.exports = t.default
}(getTimezoneOffsetInMilliseconds,
getTimezoneOffsetInMilliseconds.exports);
var getTimezoneOffsetInMillisecondsExports =
getTimezoneOffsetInMilliseconds.exports
, protectedTokens = {};
Object.defineProperty(protectedTokens, "__esModule", {
value: !0
}),
protectedTokens.isProtectedDayOfYearToken = isProtectedDayOfYearToken,
protectedTokens.isProtectedWeekYearToken = isProtectedWeekYearToken,
protectedTokens.throwProtectedError = throwProtectedError;
var protectedDayOfYearTokens = ["D", "DD"]
, protectedWeekYearTokens = ["YY", "YYYY"];
function isProtectedDayOfYearToken(e) {
return -1 !== protectedDayOfYearTokens.indexOf(e)
}
function isProtectedWeekYearToken(e) {
return -1 !== protectedWeekYearTokens.indexOf(e)
}
function throwProtectedError(e, t, r) {
if ("YYYY" === e)
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,
"`) for formatting years to the input `").concat(r, "`; see:
https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
if ("YY" === e)
throw new RangeError("Use `yy` instead of `YY` (in `".concat(t, "`)
for formatting years to the input `").concat(r, "`; see: https://github.com/date-
fns/date-fns/blob/master/docs/unicodeTokens.md"));
if ("D" === e)
throw new RangeError("Use `d` instead of `D` (in `".concat(t, "`)
for formatting days of the month to the input `").concat(r, "`; see:
https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
if ("DD" === e)
throw new RangeError("Use `dd` instead of `DD` (in `".concat(t, "`)
for formatting days of the month to the input `").concat(r, "`; see:
https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))
}
var defaultLocale = {
exports: {}
}
, enUS$1 = {
exports: {}
}
, formatDistance = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var r = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
}
, n = function(e, t, n) {
var i, o = r[e];
return i = "string" == typeof o ? o : 1 === t ? o.one :
o.other.replace("{{count}}", t.toString()),
null != n && n.addSuffix ? n.comparison && n.comparison > 0 ? "in "
+ i : i + " ago" : i
};
t.default = n,
e.exports = t.default
}(formatDistance, formatDistance.exports);
var formatDistanceExports = formatDistance.exports
, formatLong = {
exports: {}
}
, buildFormatLongFn = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
return function() {
var t = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {}
, r = t.width ? String(t.width) : e.defaultWidth;
return e.formats[r] || e.formats[e.defaultWidth]
}
}
,
e.exports = t.default
}(buildFormatLongFn, buildFormatLongFn.exports);
var buildFormatLongFnExports = buildFormatLongFn.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var n = r(buildFormatLongFnExports)
, i = {
date: (0,
n.default)({
formats: {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy"
},
defaultWidth: "full"
}),
time: (0,
n.default)({
formats: {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
},
defaultWidth: "full"
}),
dateTime: (0,
n.default)({
formats: {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
},
defaultWidth: "full"
})
};
t.default = i,
e.exports = t.default
}(formatLong, formatLong.exports);
var formatLongExports = formatLong.exports
, formatRelative = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var r = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
}
, n = function(e, t, n, i) {
return r[e]
};
t.default = n,
e.exports = t.default
}(formatRelative, formatRelative.exports);
var formatRelativeExports = formatRelative.exports
, localize = {
exports: {}
}
, buildLocalizeFn = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
return function(t, r) {
var n;
if ("formatting" === (null != r && r.context ?
String(r.context) : "standalone") && e.formattingValues) {
var i = e.defaultFormattingWidth || e.defaultWidth
, o = null != r && r.width ? String(r.width) : i;
n = e.formattingValues[o] || e.formattingValues[i]
} else {
var s = e.defaultWidth
, a = null != r && r.width ? String(r.width) :
e.defaultWidth;
n = e.values[a] || e.values[s]
}
return n[e.argumentCallback ? e.argumentCallback(t) : t]
}
}
,
e.exports = t.default
}(buildLocalizeFn, buildLocalizeFn.exports);
var buildLocalizeFnExports = buildLocalizeFn.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var n = r(buildLocalizeFnExports)
, i = {
ordinalNumber: function(e, t) {
var r = Number(e)
, n = r % 100;
if (n > 20 || n < 10)
switch (n % 10) {
case 1:
return r + "st";
case 2:
return r + "nd";
case 3:
return r + "rd"
}
return r + "th"
},
era: (0,
n.default)({
values: {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
},
defaultWidth: "wide"
}),
quarter: (0,
n.default)({
values: {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th
quarter"]
},
defaultWidth: "wide",
argumentCallback: function(e) {
return e - 1
}
}),
month: (0,
n.default)({
values: {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O",
"N", "D"],
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
wide: ["January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November", "December"]
},
defaultWidth: "wide"
}),
day: (0,
n.default)({
values: {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
"Sat"],
wide: ["Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"]
},
defaultWidth: "wide"
}),
dayPeriod: (0,
n.default)({
values: {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
},
defaultWidth: "wide",
formattingValues: {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
},
defaultFormattingWidth: "wide"
})
};
t.default = i,
e.exports = t.default
}(localize, localize.exports);
var localizeExports = localize.exports
, match = {
exports: {}
}
, buildMatchFn = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
return function(t) {
var r = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : {}
, n = r.width
, i = n && e.matchPatterns[n] ||
e.matchPatterns[e.defaultMatchWidth]
, o = t.match(i);
if (!o)
return null;
var s, a = o[0], l = n && e.parsePatterns[n] ||
e.parsePatterns[e.defaultParseWidth], c = Array.isArray(l) ? function(e, t) {
for (var r = 0; r < e.length; r++)
if (t(e[r]))
return r;
return
}(l, (function(e) {
return e.test(a)
}
)) : function(e, t) {
for (var r in e)
if (e.hasOwnProperty(r) && t(e[r]))
return r;
return
}(l, (function(e) {
return e.test(a)
}
));
return s = e.valueCallback ? e.valueCallback(c) : c,
{
value: s = r.valueCallback ? r.valueCallback(s) : s,
rest: t.slice(a.length)
}
}
}
,
e.exports = t.default
}(buildMatchFn, buildMatchFn.exports);
var buildMatchFnExports = buildMatchFn.exports
, buildMatchPatternFn = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
return function(t) {
var r = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : {}
, n = t.match(e.matchPattern);
if (!n)
return null;
var i = n[0]
, o = t.match(e.parsePattern);
if (!o)
return null;
var s = e.valueCallback ? e.valueCallback(o[0]) : o[0];
return {
value: s = r.valueCallback ? r.valueCallback(s) : s,
rest: t.slice(i.length)
}
}
}
,
e.exports = t.default
}(buildMatchPatternFn, buildMatchPatternFn.exports);
var buildMatchPatternFnExports = buildMatchPatternFn.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var n = r(buildMatchFnExports)
, i = {
ordinalNumber: (0,
r(buildMatchPatternFnExports).default)({
matchPattern: /^(\d+)(th|st|nd|rd)?/i,
parsePattern: /\d+/i,
valueCallback: function(e) {
return parseInt(e, 10)
}
}),
era: (0,
n.default)({
matchPatterns: {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|
c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common
era)/i
},
defaultMatchWidth: "wide",
parsePatterns: {
any: [/^b/i, /^(a|c)/i]
},
defaultParseWidth: "any"
}),
quarter: (0,
n.default)({
matchPatterns: {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
},
defaultMatchWidth: "wide",
parsePatterns: {
any: [/1/i, /2/i, /3/i, /4/i]
},
defaultParseWidth: "any",
valueCallback: function(e) {
return e + 1
}
}),
month: (0,
n.default)({
matchPatterns: {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|
nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|
september|october|november|december)/i
},
defaultMatchWidth: "wide",
parsePatterns: {
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i,
/^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i,
/^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
},
defaultParseWidth: "any"
}),
day: (0,
n.default)({
matchPatterns: {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|
saturday)/i
},
defaultMatchWidth: "wide",
parsePatterns: {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
},
defaultParseWidth: "any"
}),
dayPeriod: (0,
n.default)({
matchPatterns: {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|
night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|
afternoon|evening|night))/i
},
defaultMatchWidth: "any",
parsePatterns: {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
},
defaultParseWidth: "any"
})
};
t.default = i,
e.exports = t.default
}(match, match.exports);
var matchExports = match.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var n = r(formatDistanceExports)
, i = r(formatLongExports)
, o = r(formatRelativeExports)
, s = r(localizeExports)
, a = r(matchExports)
, l = {
code: "en-US",
formatDistance: n.default,
formatLong: i.default,
formatRelative: o.default,
localize: s.default,
match: a.default,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
t.default = l,
e.exports = t.default
}(enUS$1, enUS$1.exports);
var enUSExports = enUS$1.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var n = r(enUSExports).default;
t.default = n,
e.exports = t.default
}(defaultLocale, defaultLocale.exports);
var defaultLocaleExports = defaultLocale.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t, r) {
var b, x, _, E, T, C, S, $, w, P, R, k, A, I, O, D, M, L;
(0,
d.default)(2, arguments);
var j = String(t)
, F = (0,
p.getDefaultOptions)()
, N = null !== (b = null !== (x = null == r ? void 0 : r.locale)
&& void 0 !== x ? x : F.locale) && void 0 !== b ? b : h.default
, B = (0,
u.default)(null !== (_ = null !== (E = null !== (T = null !== (C =
null == r ? void 0 : r.firstWeekContainsDate) && void 0 !== C ? C : null == r ||
null === (S = r.locale) || void 0 === S || null === ($ = S.options) || void 0 === $
? void 0 : $.firstWeekContainsDate) && void 0 !== T ? T : F.firstWeekContainsDate)
&& void 0 !== E ? E : null === (w = F.locale) || void 0 === w || null === (P =
w.options) || void 0 === P ? void 0 : P.firstWeekContainsDate) && void 0 !== _ ?
_ : 1);
if (!(B >= 1 && B <= 7))
throw new RangeError("firstWeekContainsDate must be between 1
and 7 inclusively");
var z = (0,
u.default)(null !== (R = null !== (k = null !== (A = null !== (I =
null == r ? void 0 : r.weekStartsOn) && void 0 !== I ? I : null == r || null === (O
= r.locale) || void 0 === O || null === (D = O.options) || void 0 === D ? void 0 :
D.weekStartsOn) && void 0 !== A ? A : F.weekStartsOn) && void 0 !== k ? k : null
=== (M = F.locale) || void 0 === M || null === (L = M.options) || void 0 === L ?
void 0 : L.weekStartsOn) && void 0 !== R ? R : 0);
if (!(z >= 0 && z <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6
inclusively");
if (!N.localize)
throw new RangeError("locale must contain localize property");
if (!N.formatLong)
throw new RangeError("locale must contain formatLong
property");
var U = (0,
o.default)(e);
if (!(0,
n.default)(U))
throw new RangeError("Invalid time value");
var V = (0,
l.default)(U)
, H = (0,
i.default)(U, V)
, G = {
firstWeekContainsDate: B,
weekStartsOn: z,
locale: N,
_originalDate: U
};
return j.match(m).map((function(e) {
var t = e[0];
return "p" === t || "P" === t ? (0,
a.default[t])(e, N.formatLong) : e
}
)).join("").match(f).map((function(n) {
if ("''" === n)
return "'";
var i = n[0];
if ("'" === i)
return function(e) {
var t = e.match(g);
if (!t)
return e;
return t[1].replace(y, "'")
}(n);
var o = s.default[i];
if (o)
return null != r && r.useAdditionalWeekYearTokens || !(0,
c.isProtectedWeekYearToken)(n) || (0,
c.throwProtectedError)(n, t, String(e)),
null != r && r.useAdditionalDayOfYearTokens || !(0,
c.isProtectedDayOfYearToken)(n) || (0,
c.throwProtectedError)(n, t, String(e)),
o(H, n, N.localize, G);
if (i.match(v))
throw new RangeError("Format string contains an unescaped
latin alphabet character `" + i + "`");
return n
}
)).join("")
}
;
var n = r(isValidExports)
, i = r(subMillisecondsExports)
, o = r(toDateExports$1)
, s = r(formattersExports$1)
, a = r(longFormattersExports)
, l = r(getTimezoneOffsetInMillisecondsExports)
, c = protectedTokens
, u = r(toIntegerExports)
, d = r(requiredArgsExports)
, p = defaultOptions$1
, h = r(defaultLocaleExports)
, f = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g
, m = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g
, g = /^'([^]*?)'?$/
, y = /''/g
, v = /[a-zA-Z]/;
e.exports = t.default
}(format$1, format$1.exports);
var formatExports$1 = format$1.exports
, formatters = {
exports: {}
}
, tzIntlTimeZoneName = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t, r) {
var n = function(e, t, r) {
if (r && !r.code)
throw new Error("date-fns-tz error: Please set a language
code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");
return new Intl.DateTimeFormat(r ? [r.code, "en-US"] : void 0,{
timeZone: t,
timeZoneName: e
})
}(e, r.timeZone, r.locale);
return n.formatToParts ? function(e, t) {
for (var r = e.formatToParts(t), n = r.length - 1; n >= 0; --n)
if ("timeZoneName" === r[n].type)
return r[n].value
}(n, t) : function(e, t) {
var r = e.format(t).replace(/\u200E/g, "")
, n = / [\w-+ ]+$/.exec(r);
return n ? n[0].substr(1) : ""
}(n, t)
}
,
e.exports = t.default
}(tzIntlTimeZoneName, tzIntlTimeZoneName.exports);
var tzIntlTimeZoneNameExports = tzIntlTimeZoneName.exports
, tzParseTimezone = {
exports: {}
}
, tzTokenizeDate = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
var i = function(e) {
if (!n[e]) {
var t = new Intl.DateTimeFormat("en-US",{
hour12: !1,
timeZone: "America/New_York",
year: "numeric",
month: "numeric",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
}).format(new Date("2014-06-25T04:00:00.123Z"))
, r = "06/25/2014, 00:00:00" === t || "06/25/2014
00:00:00" === t;
n[e] = r ? new Intl.DateTimeFormat("en-US",{
hour12: !1,
timeZone: e,
year: "numeric",
month: "numeric",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
}) : new Intl.DateTimeFormat("en-US",{
hourCycle: "h23",
timeZone: e,
year: "numeric",
month: "numeric",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
})
}
return n[e]
}(t);
return i.formatToParts ? function(e, t) {
try {
for (var n = e.formatToParts(t), i = [], o = 0; o <
n.length; o++) {
var s = r[n[o].type];
s >= 0 && (i[s] = parseInt(n[o].value, 10))
}
return i
} catch (a) {
if (a instanceof RangeError)
return [NaN];
throw a
}
}(i, e) : function(e, t) {
var r = e.format(t).replace(/\u200E/g, "")
, n = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);
return [n[3], n[1], n[2], n[4], n[5], n[6]]
}(i, e)
}
;
var r = {
year: 0,
month: 1,
day: 2,
hour: 3,
minute: 4,
second: 5
};
var n = {};
e.exports = t.default
}(tzTokenizeDate, tzTokenizeDate.exports);
var tzTokenizeDateExports = tzTokenizeDate.exports
, newDateUTC = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t, r, n, i, o, s) {
var a = new Date(0);
return a.setUTCFullYear(e, t, r),
a.setUTCHours(n, i, o, s),
a
}
,
e.exports = t.default
}(newDateUTC, newDateUTC.exports);
var newDateUTCExports = newDateUTC.exports;
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t, r) {
var i, d, p;
if (!e)
return 0;
if (i = a.timezoneZ.exec(e))
return 0;
if (i = a.timezoneHH.exec(e))
return c(p = parseInt(i[1], 10)) ? -p * o : NaN;
if (i = a.timezoneHHMM.exec(e)) {
p = parseInt(i[1], 10);
var h = parseInt(i[2], 10);
return c(p, h) ? (d = Math.abs(p) * o + h * s,
p > 0 ? -d : d) : NaN
}
if (function(e) {
if (u[e])
return !0;
try {
return new Intl.DateTimeFormat(void 0,{
timeZone: e
}),
u[e] = !0,
!0
} catch (t) {
return !1
}
}(e)) {
t = new Date(t || Date.now());
var f = r ? t : function(e) {
return (0,
n.default)(e.getFullYear(), e.getMonth(), e.getDate(),
e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())
}(t)
, m = l(f, e)
, g = r ? m : function(e, t, r) {
var n = e.getTime()
, i = n - t
, o = l(new Date(i), r);
if (t === o)
return t;
i -= o - t;
var s = l(new Date(i), r);
if (o === s)
return o;
return Math.max(o, s)
}(t, m, e);
return -g
}
return NaN
}
;
var r = i(tzTokenizeDateExports)
, n = i(newDateUTCExports);
function i(e) {
return e && e.__esModule ? e : {
default: e
}
}
var o = 36e5
, s = 6e4
, a = {
timezone: /([Z+-].*)$/,
timezoneZ: /^(Z)$/,
timezoneHH: /^([+-]\d{2})$/,
timezoneHHMM: /^([+-]\d{2}):?(\d{2})$/
};
function l(e, t) {
var i = (0,
r.default)(e, t)
, o = (0,
n.default)(i[0], i[1] - 1, i[2], i[3] % 24, i[4], i[5],
0).getTime()
, s = e.getTime()
, a = s % 1e3;
return o - (s -= a >= 0 ? a : 1e3 + a)
}
function c(e, t) {
return -23 <= e && e <= 23 && (null == t || 0 <= t && t <= 59)
}
var u = {};
e.exports = t.default
}(tzParseTimezone, tzParseTimezone.exports);
var tzParseTimezoneExports = tzParseTimezone.exports;
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var r = i(tzIntlTimeZoneNameExports)
, n = i(tzParseTimezoneExports);
function i(e) {
return e && e.__esModule ? e : {
default: e
}
}
function o(e, t) {
var r = e ? (0,
n.default)(e, t, !0) / 6e4 : t.getTimezoneOffset();
if (Number.isNaN(r))
throw new RangeError("Invalid time zone specified: " + e);
return r
}
function s(e, t) {
for (var r = e < 0 ? "-" : "", n = Math.abs(e).toString(); n.length
< t; )
n = "0" + n;
return r + n
}
function a(e, t) {
var r = t || ""
, n = e > 0 ? "-" : "+"
, i = Math.abs(e);
return n + s(Math.floor(i / 60), 2) + r + s(Math.floor(i % 60), 2)
}
function l(e, t) {
return e % 60 == 0 ? (e > 0 ? "-" : "+") + s(Math.abs(e) / 60, 2) :
a(e, t)
}
var c = {
X: function(e, t, r, n) {
var i = o(n.timeZone, n._originalDate || e);
if (0 === i)
return "Z";
switch (t) {
case "X":
return l(i);
case "XXXX":
case "XX":
return a(i);
default:
return a(i, ":")
}
},
x: function(e, t, r, n) {
var i = o(n.timeZone, n._originalDate || e);
switch (t) {
case "x":
return l(i);
case "xxxx":
case "xx":
return a(i);
default:
return a(i, ":")
}
},
O: function(e, t, r, n) {
var i = o(n.timeZone, n._originalDate || e);
switch (t) {
case "O":
case "OO":
case "OOO":
return "GMT" + function(e, t) {
var r = e > 0 ? "-" : "+"
, n = Math.abs(e)
, i = Math.floor(n / 60)
, o = n % 60;
if (0 === o)
return r + String(i);
var a = t || "";
return r + String(i) + a + s(o, 2)
}(i, ":");
default:
return "GMT" + a(i, ":")
}
},
z: function(e, t, n, i) {
var o = i._originalDate || e;
switch (t) {
case "z":
case "zz":
case "zzz":
return (0,
r.default)("short", o, i);
default:
return (0,
r.default)("long", o, i)
}
}
};
t.default = c,
e.exports = t.default
}(formatters, formatters.exports);
var formattersExports = formatters.exports
, toDate = {
exports: {}
}
, tzPattern = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = void 0;
var r = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-
zA-Z_]+)?)$/;
t.default = r,
e.exports = t.default
}(tzPattern, tzPattern.exports);
var tzPatternExports = tzPattern.exports;
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
if (arguments.length < 1)
throw new TypeError("1 argument required, but only " +
arguments.length + " present");
if (null === e)
return new Date(NaN);
var o = t || {}
, s = null == o.additionalDigits ? c : (0,
r.default)(o.additionalDigits);
if (2 !== s && 1 !== s && 0 !== s)
throw new RangeError("additionalDigits must be 0, 1 or 2");
if (e instanceof Date || "object" == typeof e && "[object Date]"
=== Object.prototype.toString.call(e))
return new Date(e.getTime());
if ("number" == typeof e || "[object Number]" ===
Object.prototype.toString.call(e))
return new Date(e);
if ("string" != typeof e && "[object String]" !==
Object.prototype.toString.call(e))
return new Date(NaN);
var p = function(e) {
var t, r = {}, n = u.dateTimePattern.exec(e);
n ? (r.date = n[1],
t = n[3]) : (n = u.datePattern.exec(e)) ? (r.date = n[1],
t = n[2]) : (r.date = null,
t = e);
if (t) {
var i = u.timeZone.exec(t);
i ? (r.time = t.replace(i[1], ""),
r.timeZone = i[1].trim()) : r.time = t
}
return r
}(e)
, h = function(e, t) {
var r, n = u.YYY[t], i = u.YYYYY[t];
if (r = u.YYYY.exec(e) || i.exec(e)) {
var o = r[1];
return {
year: parseInt(o, 10),
restDateString: e.slice(o.length)
}
}
if (r = u.YY.exec(e) || n.exec(e)) {
var s = r[1];
return {
year: 100 * parseInt(s, 10),
restDateString: e.slice(s.length)
}
}
return {
year: null
}
}(p.date, s)
, v = h.year
, b = function(e, t) {
if (null === t)
return null;
var r, n, i, o;
if (0 === e.length)
return (n = new Date(0)).setUTCFullYear(t),
n;
if (r = u.MM.exec(e))
return n = new Date(0),
m(t, i = parseInt(r[1], 10) - 1) ? (n.setUTCFullYear(t, i),
n) : new Date(NaN);
if (r = u.DDD.exec(e)) {
n = new Date(0);
var s = parseInt(r[1], 10);
return function(e, t) {
if (t < 1)
return !1;
var r = f(e);
if (r && t > 366)
return !1;
if (!r && t > 365)
return !1;
return !0
}(t, s) ? (n.setUTCFullYear(t, 0, s),
n) : new Date(NaN)
}
if (r = u.MMDD.exec(e)) {
n = new Date(0),
i = parseInt(r[1], 10) - 1;
var a = parseInt(r[2], 10);
return m(t, i, a) ? (n.setUTCFullYear(t, i, a),
n) : new Date(NaN)
}
if (r = u.Www.exec(e))
return g(t, o = parseInt(r[1], 10) - 1) ? d(t, o) : new
Date(NaN);
if (r = u.WwwD.exec(e)) {
o = parseInt(r[1], 10) - 1;
var l = parseInt(r[2], 10) - 1;
return g(t, o, l) ? d(t, o, l) : new Date(NaN)
}
return null
}(h.restDateString, v);
if (isNaN(b))
return new Date(NaN);
if (b) {
var x, _ = b.getTime(), E = 0;
if (p.time && (E = function(e) {
var t, r, n;
if (t = u.HH.exec(e))
return y(r = parseFloat(t[1].replace(",", "."))) ? r %
24 * a : NaN;
if (t = u.HHMM.exec(e))
return y(r = parseInt(t[1], 10), n =
parseFloat(t[2].replace(",", "."))) ? r % 24 * a + n * l : NaN;
if (t = u.HHMMSS.exec(e)) {
r = parseInt(t[1], 10),
n = parseInt(t[2], 10);
var i = parseFloat(t[3].replace(",", "."));
return y(r, n, i) ? r % 24 * a + n * l + 1e3 * i : NaN
}
return null
}(p.time),
isNaN(E)))
return new Date(NaN);
if (p.timeZone || o.timeZone) {
if (x = (0,
i.default)(p.timeZone || o.timeZone, new Date(_ + E)),
isNaN(x))
return new Date(NaN)
} else
x = (0,
n.default)(new Date(_ + E)),
x = (0,
n.default)(new Date(_ + E + x));
return new Date(_ + E + x)
}
return new Date(NaN)
}
;
var r = s(toIntegerExports)
, n = s(getTimezoneOffsetInMillisecondsExports)
, i = s(tzParseTimezoneExports)
, o = s(tzPatternExports);
function s(e) {
return e && e.__esModule ? e : {
default: e
}
}
var a = 36e5
, l = 6e4
, c = 2
, u = {
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
datePattern: /^([0-9W+-]+)(.*)/,
plainTime: /:/,
YY: /^(\d{2})$/,
YYY: [/^([+-]\d{2})$/, /^([+-]\d{3})$/, /^([+-]\d{4})$/],
YYYY: /^(\d{4})/,
YYYYY: [/^([+-]\d{4})/, /^([+-]\d{5})/, /^([+-]\d{6})/],
MM: /^-(\d{2})$/,
DDD: /^-?(\d{3})$/,
MMDD: /^-?(\d{2})-?(\d{2})$/,
Www: /^-?W(\d{2})$/,
WwwD: /^-?W(\d{2})-?(\d{1})$/,
HH: /^(\d{2}([.,]\d*)?)$/,
HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
timeZone: o.default
};
function d(e, t, r) {
t = t || 0,
r = r || 0;
var n = new Date(0);
n.setUTCFullYear(e, 0, 4);
var i = 7 * t + r + 1 - (n.getUTCDay() || 7);
return n.setUTCDate(n.getUTCDate() + i),
n
}
var p = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
, h = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function f(e) {
return e % 400 == 0 || e % 4 == 0 && e % 100 != 0
}
function m(e, t, r) {
if (t < 0 || t > 11)
return !1;
if (null != r) {
if (r < 1)
return !1;
var n = f(e);
if (n && r > h[t])
return !1;
if (!n && r > p[t])
return !1
}
return !0
}
function g(e, t, r) {
return !(t < 0 || t > 52) && (null == r || !(r < 0 || r > 6))
}
function y(e, t, r) {
return (null == e || !(e < 0 || e >= 25)) && ((null == t || !(t < 0
|| t >= 60)) && (null == r || !(r < 0 || r >= 60)))
}
e.exports = t.default
}(toDate, toDate.exports);
var toDateExports = toDate.exports;
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t, o) {
var a = String(t)
, l = o || {}
, c = a.match(s);
if (c) {
var u = (0,
i.default)(e, l);
a = c.reduce((function(e, t) {
if ("'" === t[0])
return e;
var r = e.indexOf(t)
, i = "'" === e[r - 1]
, o = e.replace(t, "'" + n.default[t[0]](u, t, null, l) +
"'");
return i ? o.substring(0, r - 1) + o.substring(r + 1) : o
}
), a)
}
return (0,
r.default)(e, a, l)
}
;
var r = o(formatExports$1)
, n = o(formattersExports)
, i = o(toDateExports);
function o(e) {
return e && e.__esModule ? e : {
default: e
}
}
var s = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
e.exports = t.default
}(format$2, format$2.exports);
var formatExports = format$2.exports
, formatInTimeZone = {
exports: {}
}
, cloneObject = {
exports: {}
}
, assign$2 = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
if (null == e)
throw new TypeError("assign requires that input parameter not
be null or undefined");
for (var r in t)
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
return e
}
,
e.exports = t.default
}(assign$2, assign$2.exports);
var assignExports = assign$2.exports;
!function(e, t) {
var r = interopRequireDefaultExports.default;
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e) {
return (0,
n.default)({}, e)
}
;
var n = r(assignExports);
e.exports = t.default
}(cloneObject, cloneObject.exports);
var cloneObjectExports = cloneObject.exports
, utcToZonedTime$1 = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t, i) {
var o = (0,
n.default)(e, i)
, s = (0,
r.default)(t, o, !0)
, a = new Date(o.getTime() - s)
, l = new Date(0);
return l.setFullYear(a.getUTCFullYear(), a.getUTCMonth(),
a.getUTCDate()),
l.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(),
a.getUTCMilliseconds()),
l
}
;
var r = i(tzParseTimezoneExports)
, n = i(toDateExports);
function i(e) {
return e && e.__esModule ? e : {
default: e
}
}
e.exports = t.default
}(utcToZonedTime$1, utcToZonedTime$1.exports);
var utcToZonedTimeExports = utcToZonedTime$1.exports;
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t, o, s) {
var a = (0,
r.default)(s);
return a.timeZone = t,
(0,
n.default)((0,
i.default)(e, t), o, a)
}
;
var r = o(cloneObjectExports)
, n = o(formatExports)
, i = o(utcToZonedTimeExports);
function o(e) {
return e && e.__esModule ? e : {
default: e
}
}
e.exports = t.default
}(formatInTimeZone, formatInTimeZone.exports);
var formatInTimeZoneExports = formatInTimeZone.exports
, getTimezoneOffset = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t) {
return -(0,
n.default)(e, t)
}
;
var r, n = (r = tzParseTimezoneExports) && r.__esModule ? r : {
default: r
};
e.exports = t.default
}(getTimezoneOffset, getTimezoneOffset.exports);
var getTimezoneOffsetExports = getTimezoneOffset.exports
, zonedTimeToUtc$1 = {
exports: {}
};
!function(e, t) {
Object.defineProperty(t, "__esModule", {
value: !0
}),
t.default = function(e, t, a) {
if ("string" == typeof e && !e.match(i.default)) {
var l = (0,
r.default)(a);
return l.timeZone = t,
(0,
n.default)(e, l)
}
var c = (0,
n.default)(e, a)
, u = (0,
s.default)(c.getFullYear(), c.getMonth(), c.getDate(),
c.getHours(), c.getMinutes(), c.getSeconds(), c.getMilliseconds()).getTime()
, d = (0,
o.default)(t, new Date(u));
return new Date(u + d)
}
;
var r = a(cloneObjectExports)
, n = a(toDateExports)
, i = a(tzPatternExports)
, o = a(tzParseTimezoneExports)
, s = a(newDateUTCExports);
function a(e) {
return e && e.__esModule ? e : {
default: e
}
}
e.exports = t.default
}(zonedTimeToUtc$1, zonedTimeToUtc$1.exports);
var zonedTimeToUtcExports = zonedTimeToUtc$1.exports
, dateFnsTz = {
format: formatExports,
formatInTimeZone: formatInTimeZoneExports,
getTimezoneOffset: getTimezoneOffsetExports,
toDate: toDateExports,
utcToZonedTime: utcToZonedTimeExports,
zonedTimeToUtc: zonedTimeToUtcExports
};
const IANAOffsetMap = [[-11, ["Pacific/Midway"]], [-10,
["Pacific/Honolulu"]], [-9.5, ["Pacific/Marquesas"]], [-9, ["Pacific/Gambier"]], [-
8, ["Pacific/Pitcairn"]], [-7, ["America/Phoenix"]], [-6, ["America/Tegucigalpa"]],
[-5, ["America/Bogota"]], [-4, ["America/Puerto_Rico"]], [-3.5,
["America/St_Johns"]], [-3, ["America/Montevideo"]], [-2,
["Atlantic/South_Georgia"]], [-1, ["Atlantic/Cape_Verde"]], [0, ["Africa/Accra"]],
[1, ["Africa/Bangui"]], [2, ["Africa/Cairo"]], [3, ["Asia/Bahrain",
"Indian/Antananarivo"]], [3.5, ["Asia/Tehran"]], [4, ["Asia/Dubai",
"Asia/Muscat"]], [4.5, ["Asia/Kabul"]], [5, ["Asia/Samarkand", "Asia/Karachi"]],
[5.5, ["Asia/Kolkata"]], [5.75, ["Asia/Kathmandu"]], [6, ["Asia/Dhaka"]], [6.5,
["Asia/Rangoon", "Asia/Rangoon"]], [7, ["Asia/Jakarta", "Asia/Phnom_Penh",
"Asia/Bangkok"]], [8, ["Asia/Shanghai", "Asia/Singapore"]], [8.75,
["Australia/Eucla"]], [9, ["Asia/Tokyo", "Asia/Seoul", "Asia/Pyongyang"]], [9.5,
["Australia/Darwin"]], [10, ["Pacific/Guam"]], [10.5, ["Australia/Adelaide"]], [11,
["Pacific/Guadalcanal"]], [12, ["Pacific/Funafuti"]], [13, ["Pacific/Enderbury"]],
[13.75, ["Pacific/Chatham"]], [14, ["Pacific/Kiritimati"]]]
, IANAEtcGMTOffsetMap = {
0: "Etc/GMT",
1: "Etc/GMT-1",
2: "Etc/GMT-2",
3: "Etc/GMT-3",
4: "Etc/GMT-4",
5: "Etc/GMT-5",
6: "Etc/GMT-6",
7: "Etc/GMT-7",
8: "Etc/GMT-8",
9: "Etc/GMT-9",
10: "Etc/GMT-10",
11: "Etc/GMT-11",
12: "Etc/GMT-12",
13: "Etc/GMT-13",
14: "Etc/GMT-14",
"-1": "Etc/GMT+1",
"-2": "Etc/GMT+2",
"-3": "Etc/GMT+3",
"-4": "Etc/GMT+4",
"-5": "Etc/GMT+5",
"-6": "Etc/GMT+6",
"-7": "Etc/GMT+7",
"-8": "Etc/GMT+8",
"-9": "Etc/GMT+9",
"-10": "Etc/GMT+10",
"-11": "Etc/GMT+11",
"-12": "Etc/GMT+12"
}
, GMTStringReg = /([\-\+]{1})(\d{2})\:(\d{2})/
, toIANA = e => {
let t = null;
if ("string" == typeof e) {
if (t = e.match(GMTStringReg),
!t)
return e;
const r = parseInt(t[1] + 1, 10)
, n = parseInt(t[2], 10)
, i = parseInt(t[3], 10);
e = r * (n + i / 60)
}
if ("number" == typeof e) {
if (e in IANAEtcGMTOffsetMap) {
const t = IANAEtcGMTOffsetMap[e];
if (isValidTimezoneIANAString(t))
return t
}
const t = IANAOffsetMap.find((t => t[0] === e));
return t && t[1][0]
}
}
, validIANATimezoneCache = {};
function isValidTimezoneIANAString(e) {
if (validIANATimezoneCache[e])
return !0;
try {
return new Intl.DateTimeFormat(void 0,{
timeZone: e
}),
validIANATimezoneCache[e] = !0,
!0
} catch (t) {
return !1
}
}
const utcToZonedTime = (e, t, r) => dateFnsTz.utcToZonedTime(e, toIANA(t),
r)
, zonedTimeToUtc = (e, t, r) => dateFnsTz.zonedTimeToUtc(e, toIANA(t),
r);
function compatibleParse(e, t, r, n) {
let i = null;
if (e) {
t && (i = parse(e, t, r = r || new Date, {
locale: n
})),
isValid$4(i) || (i = parseISO(e)),
isValid$4(i) || (i = new Date(Date.parse(e)));
const o = isValid$4(i) && String(i.getFullYear()).length > 4;
isValid$4(i) && !o || (i = null)
}
return i
}
function getInsetInputFormatToken(e) {
const {format: t, type: r} = e
, n = /([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4})/i
, i = /([yMd]{0,4}[^a-z\s]*[yMd]{0,4}[^a-z\s]*[yMd]{0,4}) (H{0,2}[^a-
z\s]*m{0,2}[^a-z\s]*s{0,2})/i
, o = getDefaultFormatTokenByType(r);
let s;
switch (r) {
case "dateTime":
case "dateTimeRange":
const e = i.exec(t);
s = e && e[1] && e[2] ? `${e[1]} ${e[2]}` : o;
break;
default:
const r = n.exec(t);
s = r && r[1] || o
}
return s
}
function getInsetInputValueFromInsetInputStr(e) {
const {inputValue: t="", rangeSeparator: r, type: n} = e;
let i, o, s, a;
const l = {
monthLeft: {
dateInput: "",
timeInput: ""
},
monthRight: {
dateInput: "",
timeInput: ""
}
};
switch (n) {
case "date":
case "month":
case "monthRange":
l.monthLeft.dateInput = t;
break;
case "dateRange":
[i="",s=""] = t.split(r),
l.monthLeft.dateInput = i,
l.monthRight.dateInput = s;
break;
case "dateTime":
[i="",o=""] = t.split(" "),
l.monthLeft.dateInput = i,
l.monthLeft.timeInput = o;
break;
case "dateTimeRange":
const [e="",n=""] = t.split(r);
[i="",o=""] = e.split(" "),
[s="",a=""] = n.split(" "),
l.monthLeft.dateInput = i,
l.monthLeft.timeInput = o,
l.monthRight.dateInput = s,
l.monthRight.timeInput = a
}
return l
}
function isValidTimeZone(e) {
return ["string", "number"].includes(typeof e) && "" !== e
}
class DatePickerFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.clearRangeInputFocus = () => {
const {type: e} = this._adapter.getProps()
, {rangeInputFocus: t} = this._adapter.getStates();
"dateTimeRange" === e && t &&
this._adapter.setRangeInputFocus(!1)
}
,
this._isRangeType = () => {
const e = this._adapter.getProp("type");
return /range/i.test(e)
}
,
this._isRangeValueComplete = e => {
let t = !1;
return Array.isArray(e) && (t = !e.some((e =>
isNullOrUndefined(e)))),
t
}
}
init() {
const e = this.getProp("timeZone");
this._isControlledComponent() ? this.initFromProps({
timeZone: e,
value: this.getProp("value")
}) : this._isInProps("defaultValue") && this.initFromProps({
timeZone: e,
value: this.getProp("defaultValue")
}),
this.initPanelOpenStatus(this.getProp("defaultOpen"))
}
initFromProps(e) {
let {value: t, timeZone: r, prevTimeZone: n} = e;
const i = (Array.isArray(t) ? [...t] : (t || 0 === t) && [t]) || []
, o = this.parseWithTimezone(i, r, n);
this._adapter.updatePrevTimezone(n),
this.clearInputValue(),
this._adapter.updateValue(o),
this.resetCachedSelectedValue(o),
this.initRangeInputFocus(o),
this._adapter.needConfirm() &&
this._adapter.updateCachedSelectedValue(o)
}
initRangeInputFocus(e) {
const {triggerRender: t} = this.getProps();
this._isRangeType() && _isFunction(t) && 0 === e.length &&
this._adapter.setRangeInputFocus("rangeStart")
}
parseWithTimezone(e, t, r) {
const n = [];
if (Array.isArray(e) && e.length)
for (const i of e) {
let e = (i || 0 === i) && this._parseValue(i);
e ? (isValidTimeZone(r) && (e = zonedTimeToUtc(e, r)),
n.push(isValidTimeZone(t) ? utcToZonedTime(e, t) : e)) :
warning$1(!0, `[Semi DatePicker] value cannot be parsed, value: ${String(i)}`)
}
return n
}
_isMultiple() {
return Boolean(this.getProp("multiple"))
}
_parseValue(e) {
const t = this._adapter.getProp("dateFnsLocale");
let r;
if (!e && 0 !== e)
return new Date;
if (isValidDate(e))
r = e;
else if (_isString(e))
r = compatibleParse(e, this.getProp("format"), void 0, t);
else {
if (!isTimestamp(e))
throw new TypeError("defaultValue should be valid Date
object/timestamp or string");
r = new Date(e)
}
return r
}
destroy() {
this._adapter.togglePanel(!1),
this._adapter.unregisterClickOutSide()
}
initPanelOpenStatus(e) {
!this.getProp("open") && !e || this.getProp("disabled") ?
(this._adapter.togglePanel(!1),
this._adapter.unregisterClickOutSide()) :
(this._adapter.togglePanel(!0),
this._adapter.registerClickOutSide())
}
openPanel() {
this.getProp("disabled") || (this._isControlledComponent("open") ||
this.open(),
this._adapter.notifyOpenChange(!0))
}
clearInsetInputValue() {
const {insetInput: e} = this._adapter.getProps();
e && this._adapter.updateInsetInputValue(null)
}
resetCachedSelectedValue(e) {
const {value: t, cachedSelectedValue: r} =
this._adapter.getStates()
, n = Array.isArray(e) ? e : t;
_isEqual(n, r) || this._adapter.updateCachedSelectedValue(n)
}
closePanel(e) {
let t = arguments.length > 2 ? arguments[2] : void 0;
const {value: r} = this._adapter.getStates()
, n = isNullOrUndefined(t) ? r : t;
this._isControlledComponent("open") ?
this.resetInnerSelectedStates(n) : this.close(),
this._adapter.notifyOpenChange(!1)
}
open() {
this._adapter.togglePanel(!0),
this._adapter.registerClickOutSide()
}
close() {
this._adapter.togglePanel(!1, ( () =>
this.resetInnerSelectedStates())),
this._adapter.unregisterClickOutSide()
}
focus(e) {
if (this._isRangeType()) {
const t = null != e ? e : "rangeStart";
this._adapter.setRangeInputFocus(t)
} else
this._adapter.setInputFocus()
}
blur() {
this._isRangeType() ? this._adapter.setRangeInputBlur() :
this._adapter.setInputBlur()
}
resetInnerSelectedStates(e) {
const {value: t} = this._adapter.getStates();
(isNullOrUndefined(e) || !this.isCachedSelectedValueValid(e) ||
this._adapter.needConfirm() && !this.clickConfirmButton) &&
this.resetCachedSelectedValue(t),
this.resetFocus(),
this.clearInputValue(),
this.clickConfirmButton = !1
}
resetFocus(e) {
this._adapter.setRangeInputFocus(!1),
this._adapter.notifyBlur(e)
}
isCachedSelectedValueValid(e) {
const t = e || this._adapter.getState("cachedSelectedValue")
, {type: r} = this._adapter.getProps();
let n = !0;
switch (!0) {
case "dateRange" === r:
case "dateTimeRange" === r:
this._isRangeValueComplete(t) || (n = !1);
break;
default:
const e = null == t ? void 0 : t.filter((e => e));
Array.isArray(e) && e.length || (n = !1)
}
return n
}
clearInputValue() {
this._adapter.updateInputValue(null),
this._adapter.updateInsetInputValue(null)
}
handleInputChange(e, t) {
const r = this._isMultiple() ? this.parseMultipleInput(e) :
this.parseInput(e)
, {value: n} = this.getStates();
if (this._updateCachedSelectedValueFromInput(e),
r && r.length || "" === e) {
if (_get(t, strings$p.CLEARBTN_CLICKED_EVENT_FLAG) &&
this._isControlledComponent("value"))
return void this._notifyChange(r);
this._updateValueAndInput(r, "" === e, e);
const i = this._getChangedDates(r);
this._someDateDisabled(i, r) || _isEqual(r, n) ||
this._notifyChange(r)
} else
this._adapter.updateInputValue(e)
}
handleInsetInputChange(e) {
const {insetInputStr: t, format: r, insetInputValue: n} = e
, i = this._isMultiple()
, o = i ? this.parseMultipleInput(t, r) : this.parseInput(t, r)
, {value: s} = this.getStates();
if (this._updateCachedSelectedValueFromInput(t),
o && o.length) {
const e = this._getChangedDates(o);
if (!this._someDateDisabled(e, o)) {
_isEqual(o, s) || (this._isControlledComponent() ||
this._adapter.needConfirm() || this._adapter.updateValue(o),
this._notifyChange(o));
const e = i ? this.formatMultipleDates(o) :
this.formatDates(o);
this._adapter.updateInputValue(e)
}
}
this._adapter.updateInsetInputValue(n)
}
_updateCachedSelectedValueFromInput(e) {
const t = this.getLooseDateFromInput(e)
, r = this._getChangedDates(t);
this._someDateDisabled(r, t) || this.resetCachedSelectedValue(t)
}
handleInputBlur() {}
handleRangeEndTabPress(e) {
this._adapter.setRangeInputFocus(!1)
}
handleInputFocus(e, t) {
const r = this._adapter.getState("rangeInputFocus");
t && this._adapter.setRangeInputFocus(t),
t && ["rangeStart", "rangeEnd"].includes(r) ||
this._adapter.notifyFocus(e, t)
}
handleSetRangeFocus(e) {
this._adapter.setRangeInputFocus(e)
}
handleInputClear(e) {
this._adapter.notifyClear(e)
}
handleRangeInputClear(e) {
const t = [];
this._isControlledComponent("value") ||
(this._updateValueAndInput(t, !0, ""),
this._adapter.updateInsetInputValue(null),
this.resetCachedSelectedValue(t)),
this._notifyChange(t),
this._adapter.setRangeInputFocus(!1),
this._adapter.notifyClear(e)
}
handleRangeInputBlur(e, t) {}
handleInputComplete() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : ""
, t = e ? this._isMultiple() ? this.parseMultipleInput(e, ",", !
0) : this.parseInput(e) : [];
if (t = t && t.length ? t : this.getState("value"),
!t || !t.length) {
const e = new Date;
t = this._isRangeType() ? [e, e] : [e]
}
this._updateValueAndInput(t);
const {value: r} = this.getStates()
, n = this._getChangedDates(t);
this._someDateDisabled(n, t) || _isEqual(t, r) ||
this._notifyChange(t)
}
parseInput() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : ""
, t = arguments.length > 1 ? arguments[1] : void 0
, r = [];
const {dateFnsLocale: n, rangeSeparator: i} = this.getProps();
if (e && e.length) {
const o = this.getProp("type")
, s = t || this.getProp("format") ||
getDefaultFormatTokenByType(o);
let a, l;
const c = new Date;
switch (o) {
case "date":
case "dateTime":
case "month":
a = e ? compatibleParse(e, s, c, n) : "",
l = a && isValid$4(a) && this.localeFormat(a, s),
a && l === e && (r = [a]);
break;
case "dateRange":
case "dateTimeRange":
case "monthRange":
const t = i
, o = e.split(t);
a = o && o.reduce(( (e, t) => {
const r = t && compatibleParse(t, s, c, n);
return r && e.push(r),
e
}
), []),
l = a && a.map((e => e && isValid$4(e) &&
this.localeFormat(e, s))).join(t),
a && l === e && (a.sort(( (e, t) => e.getTime() -
t.getTime())),
r = a)
}
}
return r
}
getLooseDateFromInput(e) {
return this._isMultiple() ? this.parseMultipleInputLoose(e) :
this.parseInputLoose(e)
}
parseInputLoose() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : ""
, t = [];
const {dateFnsLocale: r, rangeSeparator: n, type: i, format: o} =
this.getProps();
if (e && e.length) {
const s = o || getDefaultFormatTokenByType(i);
let a, l;
const c = new Date;
switch (i) {
case "date":
case "dateTime":
case "month":
const i = compatibleParse(e, s, c, r);
isValidDate(i) ? (l = this.localeFormat(i, s),
l === e && (a = i)) : a = null,
t = [a];
break;
case "dateRange":
case "dateTimeRange":
const o = n
, u = e.split(o);
a = u && u.reduce(( (e, t) => {
let n = null;
const i = compatibleParse(t, s, c, r);
return isValidDate(i) && (l = this.localeFormat(i, s),
l === t && (n = i)),
e.push(n),
e
}
), []),
Array.isArray(a) && a.every((e => isValid$4(e))) &&
a.sort(( (e, t) => e.getTime() - t.getTime())),
t = a
}
}
return t
}
parseMultipleInputLoose() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : ""
, t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : strings$g.DEFAULT_SEPARATOR_MULTIPLE
, r = arguments.length > 2 && void 0 !== arguments[2] &&
arguments[2];
const n = this.getProp("max")
, i = e.split(t)
, o = [];
for (const s of i) {
let e = s && this.parseInputLoose(s);
if (e = Array.isArray(e) ? e : e && [e],
!e || !e.length)
return [];
if (r ? !o.filter((t => Boolean(e.find((e => isSameSecond(t,
e)))))) && o.push(...e) : o.push(...e),
n && n > 0 && o.length > n)
return []
}
return o
}
parseMultipleInput() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : ""
, t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : strings$g.DEFAULT_SEPARATOR_MULTIPLE
, r = arguments.length > 2 && void 0 !== arguments[2] &&
arguments[2];
const n = this.getProp("max")
, i = e.split(t)
, o = [];
for (const s of i) {
let e = s && this.parseInput(s);
if (e = Array.isArray(e) ? e : e && [e],
!e || !e.length)
return [];
if (r ? !o.filter((t => Boolean(e.find((e => isSameSecond(t,
e)))))) && o.push(...e) : o.push(...e),
n && n > 0 && o.length > n)
return []
}
return o
}
formatDates() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : []
, t = arguments.length > 1 ? arguments[1] : void 0
, r = "";
const n = this.getProp("rangeSeparator");
if (Array.isArray(e) && e.length) {
const i = this.getProp("type")
, o = t || this.getProp("format") ||
getDefaultFormatTokenByType(i);
switch (i) {
case "date":
case "dateTime":
case "month":
r = this.localeFormat(e[0], o);
break;
case "dateRange":
case "dateTimeRange":
case "monthRange":
const t = !isNullOrUndefined(e[0])
, i = !isNullOrUndefined(e[1]);
t && i ? r = `${this.localeFormat(e[0], o)}${n}$
{this.localeFormat(e[1], o)}` : t ? r = `${this.localeFormat(e[0], o)}${n}` : i &&
(r = `${n}${this.localeFormat(e[1], o)}`)
}
}
return r
}
formatMultipleDates() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : []
, t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : strings$g.DEFAULT_SEPARATOR_MULTIPLE
, r = arguments.length > 2 ? arguments[2] : void 0;
const n = [];
if (Array.isArray(e) && e.length) {
switch (this.getProp("type")) {
case "date":
case "dateTime":
case "month":
e.forEach((e => n.push(this.formatDates([e], r))));
break;
case "dateRange":
case "dateTimeRange":
case "monthRange":
for (let t = 0; t < e.length; t += 2)
n.push(this.formatDates(e.slice(t, t + 2), r))
}
}
return n.join(t)
}
_updateValueAndInput(e, t, r) {
let n;
if (t || e) {
n = Array.isArray(e) ? e : e ? [e] : [];
const t = this._getChangedDates(n);
this._isControlledComponent() || this._someDateDisabled(t, n)
|| this._adapter.needConfirm() || this._adapter.updateValue(n)
}
this._adapter.updateInputValue(r)
}
handleSelectedChange(e, t) {
const {type: r, format: n, rangeSeparator: i, insetInput: o} =
this._adapter.getProps()
, {value: s} = this.getStates()
, a = this._isControlledComponent()
, l = _isObject(t) ? t.fromPreset : t
, c = _get(t, "closePanel", !0)
, u = _get(t, "needCheckFocusRecord", !0)
, d = Array.isArray(e) ? [...e] : e ? [e] : []
, p = this._getChangedDates(d);
let h, f;
if (!this._someDateDisabled(p, d)) {
if (this.resetCachedSelectedValue(d),
h = this._isMultiple() ? this.formatMultipleDates(d) :
this.formatDates(d),
o) {
const e = getInsetInputFormatToken({
format: n,
type: r
});
f = getInsetInputValueFromInsetInputStr({
inputValue: this._isMultiple() ?
this.formatMultipleDates(d, void 0, e) : this.formatDates(d, e),
type: r,
rangeSeparator: i
})
}
if (this._isRangeType() && !this._isRangeValueComplete(d))
return this._adapter.updateInputValue(h),
void this._adapter.updateInsetInputValue(f);
a && !l || (this._updateValueAndInput(d, !0, h),
this._adapter.updateInsetInputValue(f)),
_isEqual(e, s) || this._notifyChange(e)
}
const m = !u || u && this._adapter.couldPanelClosed();
("date" === r && !this._isMultiple() && c || "dateRange" === r &&
this._isRangeValueComplete(d) && c && m) && this.closePanel(void 0, h, d)
}
handleYMSelectedChange() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {};
const {currentMonth: t, currentYear: r} = e
, {type: n} = this.getProps();
if ("month" === n) {
const e = new Date(r.left,t.left - 1);
this.handleSelectedChange([e])
} else {
const e = new Date(r.left,t.left - 1)
, n = new Date(r.right,t.right - 1);
this.handleSelectedChange([e, n])
}
}
handleConfirm() {
this.clickConfirmButton = !0;
const {cachedSelectedValue: e, value: t} =
this._adapter.getStates()
, r = this._isRangeValueComplete(e)
, n = r ? e : t;
if (this._adapter.needConfirm() && !this._isControlledComponent()
&& this._adapter.updateValue(n),
this.closePanel(void 0, void 0, n),
r) {
const {notifyValue: t, notifyDate: r} =
this.disposeCallbackArgs(e);
this._adapter.notifyConfirm(r, t)
}
}
handleCancel() {
this.closePanel();
const e = this.getState("value")
, {notifyValue: t, notifyDate: r} = this.disposeCallbackArgs(e);
this._adapter.notifyCancel(r, t)
}
handlePresetClick(e, t) {
const {type: r, timeZone: n} = this.getProps()
, i = this.getState("prevTimezone")
, o = "function" == typeof e.start ? e.start() : e.start
, s = "function" == typeof e.end ? e.end() : e.end;
let a;
switch (r) {
case "month":
case "dateTime":
case "date":
a = this.parseWithTimezone([o], n, i),
this.handleSelectedChange(a);
break;
case "dateTimeRange":
case "dateRange":
a = this.parseWithTimezone([o, s], n, i),
this.handleSelectedChange(a, {
needCheckFocusRecord: !1
})
}
this._adapter.notifyPresetsClick(e, t)
}
disposeCallbackArgs(e) {
let t = Array.isArray(e) ? e : e && [e] || [];
const r = this.getProp("timeZone");
isValidTimeZone(r) && (t = t.map((e => zonedTimeToUtc(e, r))));
const n = this.getProp("type")
, i = this.getProp("format") || getDefaultFormatTokenByType(n);
let o, s;
switch (n) {
case "date":
case "dateTime":
case "month":
this._isMultiple() ? (o = t.map((e => e && this.localeFormat(e,
i))),
s = [...t]) : (o = t[0] && this.localeFormat(t[0], i),
[s] = t);
break;
case "dateRange":
case "dateTimeRange":
case "monthRange":
o = t.map((e => e && this.localeFormat(e, i))),
s = [...t]
}
return {
notifyValue: o,
notifyDate: s
}
}
_notifyChange(e) {
if (this._isRangeType() && !this._isRangeValueComplete(e))
return;
const {onChangeWithDateFirst: t} = this.getProps()
, {notifyValue: r, notifyDate: n} = this.disposeCallbackArgs(e);
t ? this._adapter.notifyChange(n, r) :
this._adapter.notifyChange(r, n)
}
_getChangedDates(e) {
const t = this._adapter.getProp("type")
, {cachedSelectedValue: r} = this._adapter.getStates()
, n = [];
switch (t) {
case "dateRange":
case "dateTimeRange":
const [t,i] = r
, [o,s] = e;
isEqual$1(o, t) || n.push(o),
isEqual$1(s, i) || n.push(s);
break;
default:
const a = new Set;
r.forEach((e => a.add(isDate$2(e) && e.valueOf())));
for (const r of e)
a.has(isDate$2(r) && r.valueOf()) || n.push(r)
}
return n
}
_someDateDisabled(e, t) {
const {rangeInputFocus: r} = this.getStates()
, n = {
rangeStart: "",
rangeEnd: "",
rangeInputFocus: r
};
if (this._isRangeType() && Array.isArray(t)) {
if (isValid$4(t[0])) {
const e = format$3(t[0], "yyyy-MM-dd");
n.rangeStart = e
}
if (isValid$4(t[1])) {
const e = format$3(t[1], "yyyy-MM-dd");
n.rangeEnd = e
}
}
let i = !1;
for (const o of e)
if (!isNullOrUndefined(o) && this.disabledDisposeDate(o, n)) {
i = !0;
break
}
return i
}
localeFormat(e, t) {
return format$3(e, t, {
locale: this._adapter.getProp("dateFnsLocale")
})
}
disposeDateFn(e, t) {
const {notifyDate: r} = this.disposeCallbackArgs(t)
, n = Array.isArray(t);
let i;
i = n === Array.isArray(r) ? r : n ? [r] : r[0];
for (var o = arguments.length, s = new Array(o > 2 ? o - 2 : 0), a
= 2; a < o; a++)
s[a - 2] = arguments[a];
return e(i, ...s)
}
disabledDisposeDate(e) {
const {disabledDate: t} = this.getProps();
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), i
= 1; i < r; i++)
n[i - 1] = arguments[i];
return this.disposeDateFn(t, e, ...n)
}
disabledDisposeTime(e) {
const {disabledTime: t} = this.getProps();
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), i
= 1; i < r; i++)
n[i - 1] = arguments[i];
return this.disposeDateFn(t, e, ...n)
}
handleTriggerWrapperClick(e) {
const {disabled: t, triggerRender: r} = this._adapter.getProps()
, {rangeInputFocus: n} = this._adapter.getStates();
t || (this._isRangeType() && !n ? (this._adapter.isEventTarget(e) ?
setTimeout(( () => {
this.handleInputFocus(e, "rangeStart")
}
), 0) : _isFunction(r) &&
this._adapter.setRangeInputFocus("rangeStart"),
this.openPanel()) : this.openPanel())
}
handlePanelVisibleChange(e) {
e ? (this._adapter.setInsetInputFocus(),
setTimeout(( () => {
this._adapter.setTriggerDisabled(!0)
}
), 0)) : this._adapter.setTriggerDisabled(!1)
}
}
function formatDateValues(e, t) {
let {groupInnerSeparator: r=strings$g.DEFAULT_SEPARATOR_RANGE,
groupSize: n=1, groupSeparator: i=strings$g.DEFAULT_SEPARATOR_MULTIPLE} =
arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}
, o = arguments.length > 3 ? arguments[3] : void 0
, s = "";
if ((n <= 0 || "number" != typeof n) && (n = 1),
Array.isArray(e) && e.length) {
const a = []
, {length: l} = e;
for (let t = 0; t < l; t++) {
t % n == 0 && a.push([]);
a[Math.floor(t / n)].push(e[t])
}
s = a.map((e => e.map((e => e ? format$3(e, t, {
locale: o
}) : "")).join(r))).join(i)
}
return s
}
function getDefaultPickerDate(e) {
const {defaultPickerValue: t, format: r, dateFnsLocale: n} = e;
let i = Array.isArray(t) ? t[0] : t
, o = Array.isArray(t) ? t[1] : void 0;
switch (!0) {
case isValidDate(i):
break;
case isTimestamp(i):
i = new Date(i);
break;
case "string" == typeof i:
i = compatibleParse(i, r, void 0, n);
break;
default:
i = new Date
}
switch (!0) {
case isValidDate(o):
break;
case isTimestamp(o):
o = new Date(o);
break;
case "string" == typeof o:
o = compatibleParse(o, r, void 0, n);
break;
default:
o = addMonths(i, 1)
}
return {
nowDate: i,
nextDate: o
}
}
var toStringFunction = Function.prototype.toString
, create = Object.create
, toStringObject = Object.prototype.toString
, LegacyCache = function() {
function e() {
this._keys = [],
this._values = []
}
return e.prototype.has = function(e) {
return !!~this._keys.indexOf(e)
}
,
e.prototype.get = function(e) {
return this._values[this._keys.indexOf(e)]
}
,
e.prototype.set = function(e, t) {
this._keys.push(e),
this._values.push(t)
}
,
e
}();
function createCacheLegacy() {
return new LegacyCache
}
function createCacheModern() {
return new WeakMap
}
var createCache = "undefined" != typeof WeakMap ? createCacheModern :
createCacheLegacy;
function getCleanClone(e) {
if (!e)
return create(null);
var t = e.constructor;
if (t === Object)
return e === Object.prototype ? {} : create(e);
if (t && ~toStringFunction.call(t).indexOf("[native code]"))
try {
return new t
} catch (r) {}
return create(e)
}
function getRegExpFlagsLegacy(e) {
var t = "";
return e.global && (t += "g"),
e.ignoreCase && (t += "i"),
e.multiline && (t += "m"),
e.unicode && (t += "u"),
e.sticky && (t += "y"),
t
}
function getRegExpFlagsModern(e) {
return e.flags
}
var getRegExpFlags = "g" === /test/g.flags ? getRegExpFlagsModern :
getRegExpFlagsLegacy;
function getTagLegacy(e) {
var t = toStringObject.call(e);
return t.substring(8, t.length - 1)
}
function getTagModern(e) {
return e[Symbol.toStringTag] || getTagLegacy(e)
}
var getTag$2 = "undefined" != typeof Symbol ? getTagModern : getTagLegacy
, defineProperty$2 = Object.defineProperty
, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor
, getOwnPropertyNames = Object.getOwnPropertyNames
, getOwnPropertySymbols = Object.getOwnPropertySymbols
, _a$1 = Object.prototype
, hasOwnProperty$d = _a$1.hasOwnProperty
, propertyIsEnumerable$2 = _a$1.propertyIsEnumerable
, SUPPORTS_SYMBOL = "function" == typeof getOwnPropertySymbols;
function getStrictPropertiesModern(e) {
return getOwnPropertyNames(e).concat(getOwnPropertySymbols(e))
}
var getStrictProperties = SUPPORTS_SYMBOL ? getStrictPropertiesModern :
getOwnPropertyNames;
function copyOwnPropertiesStrict(e, t, r) {
for (var n = getStrictProperties(e), i = 0, o = n.length, s = void 0, a
= void 0; i < o; ++i)
if ("callee" !== (s = n[i]) && "caller" !== s)
if (a = getOwnPropertyDescriptor(e, s)) {
a.get || a.set || (a.value = r.copier(a.value, r));
try {
defineProperty$2(t, s, a)
} catch (l) {
t[s] = a.value
}
} else
t[s] = r.copier(e[s], r);
return t
}
function copyArrayLoose(e, t) {
var r = new t.Constructor;
t.cache.set(e, r);
for (var n = 0, i = e.length; n < i; ++n)
r[n] = t.copier(e[n], t);
return r
}
function copyArrayStrict(e, t) {
var r = new t.Constructor;
return t.cache.set(e, r),
copyOwnPropertiesStrict(e, r, t)
}
function copyArrayBuffer(e, t) {
return e.slice(0)
}
function copyBlob(e, t) {
return e.slice(0, e.size, e.type)
}
function copyDataView(e, t) {
return new t.Constructor(copyArrayBuffer(e.buffer))
}
function copyDate(e, t) {
return new t.Constructor(e.getTime())
}
function copyMapLoose(e, t) {
var r = new t.Constructor;
return t.cache.set(e, r),
e.forEach((function(e, n) {
r.set(n, t.copier(e, t))
}
)),
r
}
function copyMapStrict(e, t) {
return copyOwnPropertiesStrict(e, copyMapLoose(e, t), t)
}
function copyObjectLooseLegacy(e, t) {
var r = getCleanClone(t.prototype);
for (var n in t.cache.set(e, r),
e)
hasOwnProperty$d.call(e, n) && (r[n] = t.copier(e[n], t));
return r
}
function copyObjectLooseModern(e, t) {
var r = getCleanClone(t.prototype);
for (var n in t.cache.set(e, r),
e)
hasOwnProperty$d.call(e, n) && (r[n] = t.copier(e[n], t));
for (var i = getOwnPropertySymbols(e), o = 0, s = i.length, a = void 0;
o < s; ++o)
a = i[o],
propertyIsEnumerable$2.call(e, a) && (r[a] = t.copier(e[a], t));
return r
}
var copyObjectLoose = SUPPORTS_SYMBOL ? copyObjectLooseModern :
copyObjectLooseLegacy;
function copyObjectStrict(e, t) {
var r = getCleanClone(t.prototype);
return t.cache.set(e, r),
copyOwnPropertiesStrict(e, r, t)
}
function copyPrimitiveWrapper(e, t) {
return new t.Constructor(e.valueOf())
}
function copyRegExp(e, t) {
var r = new t.Constructor(e.source,getRegExpFlags(e));
return r.lastIndex = e.lastIndex,
r
}
function copySelf(e, t) {
return e
}
function copySetLoose(e, t) {
var r = new t.Constructor;
return t.cache.set(e, r),
e.forEach((function(e) {
r.add(t.copier(e, t))
}
)),
r
}
function copySetStrict(e, t) {
return copyOwnPropertiesStrict(e, copySetLoose(e, t), t)
}
var isArray$3 = Array.isArray
, assign$1 = Object.assign
, getPrototypeOf = Object.getPrototypeOf || function(e) {
return e.__proto__
}
, DEFAULT_LOOSE_OPTIONS = {
array: copyArrayLoose,
arrayBuffer: copyArrayBuffer,
blob: copyBlob,
dataView: copyDataView,
date: copyDate,
error: copySelf,
map: copyMapLoose,
object: copyObjectLoose,
regExp: copyRegExp,
set: copySetLoose
}
, DEFAULT_STRICT_OPTIONS = assign$1({}, DEFAULT_LOOSE_OPTIONS, {
array: copyArrayStrict,
map: copyMapStrict,
object: copyObjectStrict,
set: copySetStrict
});
function getTagSpecificCopiers(e) {
return {
Arguments: e.object,
Array: e.array,
ArrayBuffer: e.arrayBuffer,
Blob: e.blob,
Boolean: copyPrimitiveWrapper,
DataView: e.dataView,
Date: e.date,
Error: e.error,
Float32Array: e.arrayBuffer,
Float64Array: e.arrayBuffer,
Int8Array: e.arrayBuffer,
Int16Array: e.arrayBuffer,
Int32Array: e.arrayBuffer,
Map: e.map,
Number: copyPrimitiveWrapper,
Object: e.object,
Promise: copySelf,
RegExp: e.regExp,
Set: e.set,
String: copyPrimitiveWrapper,
WeakMap: copySelf,
WeakSet: copySelf,
Uint8Array: e.arrayBuffer,
Uint8ClampedArray: e.arrayBuffer,
Uint16Array: e.arrayBuffer,
Uint32Array: e.arrayBuffer,
Uint64Array: e.arrayBuffer
}
}
function createCopier(e) {
var t = getTagSpecificCopiers(assign$1({}, DEFAULT_LOOSE_OPTIONS, e))
, r = t.Array
, n = t.Object;
function i(e, i) {
if (i.prototype = i.Constructor = void 0,
!e || "object" != typeof e)
return e;
if (i.cache.has(e))
return i.cache.get(e);
if (i.prototype = getPrototypeOf(e),
i.Constructor = i.prototype && i.prototype.constructor,
!i.Constructor || i.Constructor === Object)
return n(e, i);
if (isArray$3(e))
return r(e, i);
var o = t[getTag$2(e)];
return o ? o(e, i) : "function" == typeof e.then ? e : n(e, i)
}
return function(e) {
return i(e, {
Constructor: void 0,
cache: createCache(),
copier: i,
prototype: void 0
})
}
}
function createStrictCopier(e) {
return createCopier(assign$1({}, DEFAULT_STRICT_OPTIONS, e))
}
createStrictCopier({});
var index$2 = createCopier({});
const KEY_CODE_ENTER = "Enter"
, KEY_CODE_TAB = "Tab";
let InputFoundation$1 = class extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e))
}
init() {}
destroy() {}
handleClick(e) {
this._adapter.notifyClick(e)
}
handleChange(e, t) {
this._adapter.notifyChange(e, t)
}
handleInputComplete(e) {
e.key === KEY_CODE_ENTER &&
this._adapter.notifyEnter(e.target.value)
}
handleInputClear(e) {
this._adapter.notifyClear(e)
}
handleRangeInputClear(e) {
this.stopPropagation(e),
this._adapter.notifyRangeInputClear(e)
}
handleRangeInputEnterPress(e, t) {
e.key === KEY_CODE_ENTER && this._adapter.notifyEnter(t)
}
handleRangeInputEndKeyPress(e) {
e.key === KEY_CODE_TAB && this._adapter.notifyTabPress(e)
}
handleRangeInputFocus(e, t) {
this._adapter.notifyRangeInputFocus(e, t)
}
formatShowText(e, t) {
const {type: r, dateFnsLocale: n, format: i, rangeSeparator: o} =
this._adapter.getProps()
, s = t || i || getDefaultFormatTokenByType(r);
let a = "";
switch (r) {
case "date":
case "dateTime":
case "month":
a = formatDateValues(e, s, void 0, n);
break;
case "dateRange":
case "dateTimeRange":
case "monthRange":
a = formatDateValues(e, s, {
groupSize: 2,
groupInnerSeparator: o
}, n)
}
return a
}
handleInsetInputChange(e) {
const {value: t, valuePath: r, insetInputValue: n} = e
, {format: i, type: o, rangeSeparator: s} =
this._adapter.getProps()
, a = getInsetInputFormatToken({
type: o,
format: i
})
, l = _set(index$2(n), r, t)
, c = getInsetInputValueFromInsetInputStr({
inputValue: this.concatInsetInputValue({
insetInputValue: l
}),
type: o,
rangeSeparator: s
})
, u = this._autoFillTimeToInsetInputValue({
insetInputValue: c,
valuePath: r,
format: a
})
, d = this.concatInsetInputValue({
insetInputValue: u
});
this._adapter.notifyInsetInputChange({
insetInputValue: u,
format: a,
insetInputStr: d
})
}
_autoFillTimeToInsetInputValue(e) {
const {valuePath: t, insetInputValue: r, format: n} = e
, {type: i, defaultPickerValue: o, dateFnsLocale: s} =
this._adapter.getProps()
, a = index$2(r)
, {nowDate: l, nextDate: c} = getDefaultPickerDate({
defaultPickerValue: o,
format: n,
dateFnsLocale: s
});
if (i.includes("Time")) {
let e = "";
const r = _get(n.split(" "), "0", strings$g.FORMAT_FULL_DATE)
, i = _get(n.split(" "), "1", strings$g.FORMAT_TIME_PICKER);
switch (t) {
case "monthLeft.dateInput":
const t = a.monthLeft.dateInput;
if (!a.monthLeft.timeInput && t.length === r.length) {
isValidDate(compatibleParse(a.monthLeft.dateInput, r))
&& (e = format$3(l, i),
a.monthLeft.timeInput = e)
}
break;
case "monthRight.dateInput":
const n = a.monthRight.dateInput;
if (!a.monthRight.timeInput && n.length === r.length) {
isValidDate(compatibleParse(n, r)) && (e = format$3(c,
i),
a.monthRight.timeInput = e)
}
}
}
return a
}
getInsetInputPlaceholder() {
const {type: e, format: t, rangeSeparator: r} =
this._adapter.getProps()
, n = getInsetInputFormatToken({
type: e,
format: t
});
let i, o;
switch (e) {
case "date":
case "month":
case "dateRange":
i = n;
break;
case "dateTime":
case "dateTimeRange":
[i,o] = n.split(" ");
break;
case "monthRange":
i = n + r + n
}
return {
datePlaceholder: i,
timePlaceholder: o
}
}
getInsetInputValue(e) {
let {value: t, insetInputValue: r} = e;
const {type: n, rangeSeparator: i, format: o} =
this._adapter.getProps();
let s = "";
if (_isObject(r))
s = this.concatInsetInputValue({
insetInputValue: r
});
else {
const e = getInsetInputFormatToken({
format: o,
type: n
});
s = this.formatShowText(t, e)
}
return getInsetInputValueFromInsetInputStr({
inputValue: s,
type: n,
rangeSeparator: i
})
}
concatInsetDateAndTime(e) {
let {date: t, time: r} = e;
return `${t} ${r}`
}
concatInsetDateRange(e) {
let {rangeStart: t, rangeEnd: r} = e;
const {rangeSeparator: n} = this._adapter.getProps();
return `${t}${n}${r}`
}
concatInsetInputValue(e) {
let {insetInputValue: t} = e;
const {type: r} = this._adapter.getProps();
let n = "";
switch (r) {
case "date":
case "month":
case "monthRange":
n = t.monthLeft.dateInput;
break;
case "dateRange":
n = this.concatInsetDateRange({
rangeStart: t.monthLeft.dateInput,
rangeEnd: t.monthRight.dateInput
});
break;
case "dateTime":
n = this.concatInsetDateAndTime({
date: t.monthLeft.dateInput,
time: t.monthLeft.timeInput
});
break;
case "dateTimeRange":
const e = this.concatInsetDateAndTime({
date: t.monthLeft.dateInput,
time: t.monthLeft.timeInput
})
, r = this.concatInsetDateAndTime({
date: t.monthRight.dateInput,
time: t.monthRight.timeInput
});
n = this.concatInsetDateRange({
rangeStart: e,
rangeEnd: r
})
}
return n
}
}
;
function InsetDateInput(e) {
const {insetInputValue: t, valuePath: r, onFocus: n, onChange: i,
placeholder: o, forwardRef: s} = e
, a = _get(t, r);
return React.createElement(Input$1, {
value: a,
onChange: (e, n) => {
i({
value: e,
event: n,
insetInputValue: t,
valuePath: r
})
}
,
onFocus: n,
placeholder: o,
ref: s
})
}
function InsetTimeInput(e) {
const {insetInputValue: t, valuePath: r, type: n, onFocus: i, onChange:
o, placeholder: s, disabled: a} = e;
if (!n.includes("Time"))
return null;
const l = _get(t, r);
return React.createElement(Input$1, {
value: l,
onChange: (e, n) => {
o({
value: e,
event: n,
insetInputValue: t,
valuePath: r
})
}
,
onFocus: i,
placeholder: s,
disabled: a
})
}
var __rest$H = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class DateInput extends BaseComponent {
constructor(e) {
super(e),
this.handleChange = (e, t) => this.foundation.handleChange(e, t),
this.handleEnterPress = e =>
this.foundation.handleInputComplete(e),
this.handleInputClear = e => this.foundation.handleInputClear(e),
this.handleRangeInputChange = (e, t, r) => {
const n = this.getRangeInputValue(e, t);
this.foundation.handleChange(n, r)
}
,
this.handleRangeInputClear = e => {
this.foundation.handleRangeInputClear(e)
}
,
this.handleRangeInputEnterPress = (e, t, r) => {
const n = this.getRangeInputValue(t, r);
this.foundation.handleRangeInputEnterPress(e, n)
}
,
this.handleRangeInputEndKeyPress = e => {
this.foundation.handleRangeInputEndKeyPress(e)
}
,
this.handleRangeInputFocus = (e, t) => {
this.foundation.handleRangeInputFocus(e, t)
}
,
this.handleRangeStartFocus = e => {
this.handleRangeInputFocus(e, "rangeStart")
}
,
this.handleInsetInputChange = e => {
this.foundation.handleInsetInputChange(e)
}
,
this.getRangeInputValue = (e, t) => {
const {rangeSeparator: r} = this.props;
return `${e}${r}${t}`
}
,
this.foundation = new InputFoundation$1(this.adapter)
}
get adapter() {
var e = this;
return Object.assign(Object.assign({}, super.adapter), {
updateIsFocusing: e => this.setState({
isFocusing: e
}),
notifyClick: function() {
return e.props.onClick(...arguments)
},
notifyChange: function() {
return e.props.onChange(...arguments)
},
notifyEnter: function() {
return e.props.onEnterPress(...arguments)
},
notifyBlur: function() {
return e.props.onBlur(...arguments)
},
notifyClear: function() {
return e.props.onClear(...arguments)
},
notifyFocus: function() {
return e.props.onFocus(...arguments)
},
notifyRangeInputClear: function() {
return e.props.onRangeClear(...arguments)
},
notifyRangeInputFocus: function() {
return e.props.onFocus(...arguments)
},
notifyTabPress: function() {
return e.props.onRangeEndTabPress(...arguments)
},
notifyInsetInputChange: e => this.props.onInsetInputChange(e)
})
}
componentDidMount() {
this.foundation.init()
}
componentWillUnmount() {
this.foundation.destroy()
}
formatText(e) {
return e && e.length ? this.foundation.formatShowText(e) : ""
}
renderRangePrefix() {
const {prefix: e, insetLabel: t, prefixCls: r, disabled: n,
rangeInputFocus: i} = this.props
, o = e || t;
return o ? React.createElement("div", {
className: `${r}-range-input-prefix`,
onClick: e => !n && !i && this.handleRangeStartFocus(e),
"x-semi-prop": "prefix,insetLabel"
}, o) : null
}
renderRangeSeparator(e, t) {
const {disabled: r, rangeSeparator: n} = this.props
, i = classNames({
[`${cssClasses$l.PREFIX}-range-input-separator`]: !0,
[`${cssClasses$l.PREFIX}-range-input-separator-active`]: (e ||
t) && !r
});
return React.createElement("span", {
onClick: e => !r && this.handleRangeStartFocus(e),
className: i
}, n)
}
renderRangeClearBtn(e, t) {
const {showClear: r, prefixCls: n, disabled: i, clearIcon: o,
showClearIgnoreDisabled: s} = this.props;
return (e || t) && r && !(i && !s) ? React.createElement("div", {
role: "button",
tabIndex: 0,
"aria-label": "Clear range input value",
className: `${n}-range-input-clearbtn`,
onMouseDown: e => this.handleRangeInputClear(e)
}, o || React.createElement(IconClear, {
"aria-hidden": !0
})) : null
}
renderRangeSuffix(e) {
const {prefixCls: t, disabled: r, rangeInputFocus: n} = this.props
, i = e ? React.createElement("div", {
className: `${t}-range-input-suffix`,
onClick: e => !r && !n && this.handleRangeStartFocus(e)
}, e) : null;
return i
}
renderRangeInput(e) {
const {placeholder: t, inputStyle: r, disabled: n, inputReadOnly:
i, autofocus: o, size: s, text: a, suffix: l, inputCls: c, rangeInputStartRef: u,
rangeInputEndRef: d, rangeInputFocus: p, prefixCls: h, rangeSeparator: f,
borderless: m} = e
, [g,y=""] = a.split(f) || []
, v = "large" === s ? "default" : "small"
, b = Array.isArray(t) ? t : [t, t]
, [x,_] = b
, E = classNames(`${h}-range-input-wrapper-start`, `${h}-range-
input-wrapper`, {
[`${h}-range-input-wrapper-active`]: "rangeStart" === p && !n,
[`${h}-range-input-wrapper-start-with-prefix`]:
this.props.prefix || this.props.insetLabel,
[`${h}-borderless`]: m
})
, T = classNames(`${h}-range-input-wrapper-end`, `${h}-range-
input-wrapper`, {
[`${h}-range-input-wrapper-active`]: "rangeEnd" === p && !n,
[`${h}-borderless`]: m
});
return React.createElement(React.Fragment, null,
this.renderRangePrefix(), React.createElement("div", {
onClick: e => !n && this.handleRangeInputFocus(e,
"rangeStart"),
className: `${c} ${E}`
}, React.createElement(Input$1, {
borderless: m,
size: v,
style: r,
disabled: n,
readonly: i,
placeholder: x,
value: g,
onChange: (e, t) => this.handleRangeInputChange(e, y, t),
onEnterPress: e => this.handleRangeInputEnterPress(e, g, y),
onFocus: e => this.handleRangeInputFocus(e, "rangeStart"),
autoFocus: o,
ref: u
})), this.renderRangeSeparator(g, y), React.createElement("div", {
className: `${c} ${T}`,
onClick: e => !n && this.handleRangeInputFocus(e, "rangeEnd")
}, React.createElement(Input$1, {
borderless: m,
size: v,
style: r,
disabled: n,
readonly: i,
placeholder: _,
value: y,
onChange: (e, t) => this.handleRangeInputChange(g, e, t),
onEnterPress: e => this.handleRangeInputEnterPress(e, g, y),
onFocus: e => this.handleRangeInputFocus(e, "rangeEnd"),
onKeyDown: this.handleRangeInputEndKeyPress,
ref: d
})), this.renderRangeClearBtn(g, y), this.renderRangeSuffix(l))
}
isRenderMultipleInputs() {
const {type: e} = this.props;
return e.includes("Range") && "monthRange" !== e
}
renderInputInset() {
const {type: e, handleInsetDateFocus: t, handleInsetTimeFocus: r,
value: n, insetInputValue: i, prefixCls: o, rangeInputStartRef: s,
rangeInputEndRef: a, density: l, insetInput: c} = this.props
, u = this.foundation.getInsetInputValue({
value: n,
insetInputValue: i
})
, {dateStart: d, dateEnd: p, timeStart: h, timeEnd: f} = _get(c,
"placeholder", {})
, {datePlaceholder: m, timePlaceholder: g} =
this.foundation.getInsetInputPlaceholder()
, y = `${o}-inset-input-wrapper`
, v = `${o}-inset-input-separator`;
return React.createElement("div", {
className: y,
"x-type": e
}, React.createElement(InsetDateInput, {
forwardRef: s,
insetInputValue: u,
placeholder: null != d ? d : m,
valuePath: "monthLeft.dateInput",
onChange: this.handleInsetInputChange,
onFocus: e => t(e, "rangeStart")
}), React.createElement(InsetTimeInput, {
disabled: !u.monthLeft.dateInput,
insetInputValue: u,
placeholder: null != h ? h : g,
type: e,
valuePath: "monthLeft.timeInput",
onChange: this.handleInsetInputChange,
onFocus: r
}), this.isRenderMultipleInputs() &&
React.createElement(React.Fragment, null, React.createElement("div", {
className: v
}, "compact" === l ? null : "-"),
React.createElement(InsetDateInput, {
forwardRef: a,
insetInputValue: u,
placeholder: null != p ? p : m,
valuePath: "monthRight.dateInput",
onChange: this.handleInsetInputChange,
onFocus: e => t(e, "rangeEnd")
}), React.createElement(InsetTimeInput, {
disabled: !u.monthRight.dateInput,
insetInputValue: u,
placeholder: null != f ? f : g,
type: e,
valuePath: "monthRight.timeInput",
onChange: this.handleInsetInputChange,
onFocus: r
})))
}
renderTriggerInput() {
const e = this.props
, {placeholder: t, type: r, value: n, inputValue: i, inputStyle:
o, disabled: s, showClear: a, inputReadOnly: l, insetLabel: c, validateStatus: u,
block: d, prefixCls: p, multiple: h, dateFnsLocale: f, onBlur: m, onClear: g,
onFocus: y, prefix: v, autofocus: b, size: x, inputRef: _, rangeInputStartRef: E,
rangeInputEndRef: T, onRangeClear: C, onRangeBlur: S, onRangeEndTabPress: $,
rangeInputFocus: w, rangeSeparator: P, insetInput: R, insetInputValue: k,
defaultPickerValue: A, showClearIgnoreDisabled: I} = e
, O = __rest$H(e, ["placeholder", "type", "value", "inputValue",
"inputStyle", "disabled", "showClear", "inputReadOnly", "insetLabel",
"validateStatus", "block", "prefixCls", "multiple", "dateFnsLocale", "onBlur",
"onClear", "onFocus", "prefix", "autofocus", "size", "inputRef",
"rangeInputStartRef", "rangeInputEndRef", "onRangeClear", "onRangeBlur",
"onRangeEndTabPress", "rangeInputFocus", "rangeSeparator", "insetInput",
"insetInputValue", "defaultPickerValue", "showClearIgnoreDisabled"])
, D = React.createElement(IconCalendar, {
"aria-hidden": !0
})
, M = React.createElement(IconCalendarClock, {
"aria-hidden": !0
})
, L = r.includes("Time") ? M : D;
let j = "";
isNullOrUndefined(i) ? n && (j = this.formatText(n)) : j = i;
const F = classNames({
[`${p}-input-readonly`]: l,
[`${p}-monthRange-input`]: "monthRange" === r
})
, N = Object.assign(Object.assign({}, this.props), {
text: j,
suffix: L,
inputCls: F
});
return this.isRenderMultipleInputs() ? this.renderRangeInput(N) :
React.createElement(Input$1, Object.assign({}, O, {
ref: _,
insetLabel: c,
disabled: s,
showClearIgnoreDisabled: I,
readonly: l,
className: F,
style: o,
hideSuffix: a,
placeholder: "monthRange" === r && Array.isArray(t) ? t[0] + P
+ t[1] : t,
onEnterPress: this.handleEnterPress,
onChange: this.handleChange,
onClear: this.handleInputClear,
suffix: L,
showClear: a,
value: j,
validateStatus: u,
prefix: v,
autoFocus: b,
size: x,
onBlur: m,
onFocus: y
}))
}
render() {
const {insetInput: e} = this.props;
return e ? this.renderInputInset() : this.renderTriggerInput()
}
}
function formatFullDate() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : ""
, t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : ""
, r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : ""
, n = "";
const i = "number" == typeof t && t < 10 ? `0${t}` : t.toString()
, o = "number" == typeof r && r < 10 ? `0${r}` : r.toString();
return n = `${String(e)}-${i}-${o}`,
n
}
function getWeeks(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : 0;
const r = {
dayNumber: "",
dateNumberFull: "",
fullDate: ""
}
, n = getDaysInMonth(e)
, i = format$3(e, "yyyy")
, o = format$3(e, "MM")
, s = lastDayOfMonth(e)
, a = startOfMonth(e)
, l = Number(format$3(a, "e", {
weekStartsOn: t
}))
, c = [];
let u = [];
for (let d = 1; d < l; d++)
u.push(r);
for (let d = 0; d < n; d++) {
const e = d + 1
, t = e < 10 ? `0${e}` : e.toString()
, r = formatFullDate(i, o, e);
u.push({
dayNumber: e,
dayNumberFull: t,
fullDate: r
}),
(7 === u.length || r === format$3(s, "yyyy-MM-dd")) && (c.push(u),
u = [])
}
return c
}
DateInput.propTypes = {
borderless: PropTypes.bool,
onClick: PropTypes.func,
onChange: PropTypes.func,
onEnterPress: PropTypes.func,
onBlur: PropTypes.func,
onClear: PropTypes.func,
onFocus: PropTypes.func,
value: PropTypes.array,
disabled: PropTypes.bool,
type: PropTypes.oneOf(strings$g.TYPE_SET),
showClear: PropTypes.bool,
format: PropTypes.string,
inputStyle: PropTypes.object,
inputReadOnly: PropTypes.bool,
insetLabel: PropTypes.node,
validateStatus: PropTypes.string,
prefix: PropTypes.node,
prefixCls: PropTypes.string,
dateFnsLocale: PropTypes.object.isRequired,
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
rangeInputFocus: PropTypes.oneOfType([PropTypes.string,
PropTypes.bool]),
rangeInputStartRef: PropTypes.object,
rangeInputEndRef: PropTypes.object,
rangeSeparator: PropTypes.string,
insetInput: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
insetInputValue: PropTypes.object,
defaultPickerValue: PropTypes.oneOfType([PropTypes.string,
PropTypes.number, PropTypes.object, PropTypes.array])
},
DateInput.defaultProps = {
borderless: !1,
showClear: !0,
onClick: noop$2,
onChange: noop$2,
onEnterPress: noop$2,
onBlur: noop$2,
onClear: noop$2,
onFocus: noop$2,
type: "date",
inputStyle: {},
inputReadOnly: !1,
prefixCls: cssClasses$l.PREFIX,
rangeSeparator: strings$g.DEFAULT_SEPARATOR_RANGE
};
const getMonthTable = (e, t) => {
const r = getWeeks(e, t);
return {
monthText: format$3(e, "yyyy-MM"),
weeks: r,
month: e
}
}
, getMonthTable$1 = getMonthTable
, dateDiffFns = {
month: differenceInCalendarMonths,
year: differenceInCalendarYears
}
, dateCalcFns = {
prevMonth: subMonths,
nextMonth: addMonths,
prevYear: subYears,
nextYear: addYears
};
class MonthsGridFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.newBiMonthPanelDate = [this.getState("monthLeft").pickerDate,
this.getState("monthRight").pickerDate]
}
init() {
const e = this.getProp("defaultValue");
this.initDefaultPickerValue(),
this.updateSelectedFromProps(e)
}
initDefaultPickerValue() {
const e = compatibleParse(this.getProp("defaultPickerValue"));
e && isValidDate(e) &&
(this._updatePanelDetail(strings$g.PANEL_TYPE_LEFT, {
pickerDate: e
}),
this._updatePanelDetail(strings$g.PANEL_TYPE_RIGHT, {
pickerDate: addMonths(e, 1)
}))
}
updateSelectedFromProps(e) {
let t = !(arguments.length > 1 && void 0 !== arguments[1]) ||
arguments[1];
const r = this.getProp("type")
, {selected: n, rangeStart: i, rangeEnd: o} = this.getStates();
if (e && (null == e ? void 0 : e.length))
switch (r) {
case "date":
this._initDatePickerFromValue(e, t);
break;
case "dateRange":
this._initDateRangePickerFromValue(e);
break;
case "dateTime":
this._initDateTimePickerFromValue(e);
break;
case "dateTimeRange":
this._initDateTimeRangePickerFormValue(e)
}
else
(Array.isArray(e) && !e.length || !e) && (_isSet(n) && n.size
&& this._adapter.updateDaySelected(new Set),
i && this._adapter.setRangeStart(""),
o && this._adapter.setRangeEnd(""))
}
calcDisabledTime(e) {
const {disabledTime: t, type: r} = this.getProps();
if ("function" == typeof t && e && ["dateTime",
"dateTimeRange"].includes(r)) {
const {rangeStart: n, rangeEnd: i, monthLeft: o} =
this.getStates()
, s = [];
"dateTimeRange" === r ? (n && s.push(n),
n && i && s.push(i)) : o && o.showDate && s.push(o.showDate);
const a = s.map((e => e instanceof Date ? e : parseISO(e)));
return t("dateTimeRange" === r ? a : a[0], e)
}
}
_initDatePickerFromValue(e) {
let t = !(arguments.length > 1 && void 0 !== arguments[1]) ||
arguments[1];
const {monthLeft: r} = this._adapter.getStates()
, n = Object.assign({}, r);
this._adapter.updateMonthOnLeft(n);
const i = new Set
, o = this._isMultiple();
if (o ? e.forEach((e => {
e && i.add(format$3(e, strings$g.FORMAT_FULL_DATE))
}
)) : e[0] && i.add(format$3(e[0], strings$g.FORMAT_FULL_DATE)),
t)
if (o) {
!(null == e ? void 0 : e.some((e => e && 0 ===
differenceInCalendarMonths(e, r.pickerDate)))) &&
this.handleShowDateAndTime(strings$g.PANEL_TYPE_LEFT, e[0] || n.pickerDate)
} else
this.handleShowDateAndTime(strings$g.PANEL_TYPE_LEFT, e[0]
|| n.pickerDate);
else
this.handleShowDateAndTime(strings$g.PANEL_TYPE_LEFT,
n.pickerDate);
this._adapter.updateDaySelected(i)
}
_initDateRangePickerFromValue(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] &&
arguments[1];
const r = this.getState("monthLeft")
, n = this.getState("monthRight")
, i = this._autoAdjustMonth(Object.assign(Object.assign({}, r), {
pickerDate: e[0] || r.pickerDate
}), Object.assign(Object.assign({}, n), {
pickerDate: e[1] || n.pickerDate
}));
if (Array.isArray(e) && e.filter((e => e)).length > 1)
this.handleShowDateAndTime(strings$g.PANEL_TYPE_LEFT,
i.monthLeft.pickerDate),
this.handleShowDateAndTime(strings$g.PANEL_TYPE_RIGHT,
i.monthRight.pickerDate);
else {
const t = e.find((e => e));
if (t) {
const e = Math.abs(differenceInCalendarMonths(t,
r.pickerDate)) > 0
, o = Math.abs(differenceInCalendarMonths(t,
n.pickerDate)) > 0;
e && o &&
(this.handleShowDateAndTime(strings$g.PANEL_TYPE_LEFT, i.monthLeft.pickerDate),
this.handleShowDateAndTime(strings$g.PANEL_TYPE_RIGHT,
i.monthRight.pickerDate))
}
}
const o = t ? strings$g.FORMAT_DATE_TIME :
strings$g.FORMAT_FULL_DATE;
let s = e[0] && format$3(e[0], o)
, a = e[1] && format$3(e[1], o);
this._isNeedSwap(s, a) && ([s,a] = [a, s]),
this._adapter.setRangeStart(s),
this._adapter.setRangeEnd(a),
this._adapter.setHoverDay(a)
}
_initDateTimePickerFromValue(e) {
this._initDatePickerFromValue(e)
}
_initDateTimeRangePickerFormValue(e) {
this._initDateRangePickerFromValue(e, !0)
}
destroy() {}
handleSyncChangeMonths(e) {
const {panelType: t, target: r} = e
, {type: n} = this._adapter.getProps()
, {monthLeft: i, monthRight: o} = this._adapter.getStates();
this.isRangeType(n) && ("right" === t && 0 ===
differenceInCalendarMonths(r, i.pickerDate) ?
this.handleYearOrMonthChange("prevMonth", "left", 1, !0) : "left" === t && 0 ===
differenceInCalendarMonths(o.pickerDate, r) &&
this.handleYearOrMonthChange("nextMonth", "right", 1, !0))
}
getTargetChangeDate(e) {
const {panelType: t, switchType: r} = e
, {monthRight: n, monthLeft: i} = this._adapter.getStates()
, o = "left" === t ? i.pickerDate : n.pickerDate;
let s;
switch (r) {
case "prevMonth":
s = addMonths(o, -1);
break;
case "nextMonth":
s = addMonths(o, 1);
break;
case "prevYear":
s = addYears(o, -1);
break;
case "nextYear":
s = addYears(o, 1)
}
return s
}
toMonth(e, t) {
const {type: r} = this._adapter.getProps()
, n = this._getDiff("month", t, e);
this.handleYearOrMonthChange(n < 0 ? "prevMonth" : "nextMonth", e,
Math.abs(n), !1),
this.isRangeType(r) && this.handleSyncChangeMonths({
panelType: e,
target: t
})
}
toYear(e, t) {
const r = this._getDiff("year", t, e);
this.handleYearOrMonthChange(r < 0 ? "prevYear" : "nextYear", e,
Math.abs(r), !1)
}
toYearMonth(e, t) {
this.toYear(e, t),
this.toMonth(e, t)
}
isRangeType(e) {
const {type: t} = this.getProps()
, r = e || t;
return "string" == typeof r && /range/i.test(r)
}
handleSwitchMonthOrYear(e, t) {
const {type: r, syncSwitchMonth: n} = this.getProps()
, i = this.isRangeType(r);
if (i && n)
this.handleYearOrMonthChange(e, "left", 1, !0),
this.handleYearOrMonthChange(e, "right", 1, !0);
else if (this.handleYearOrMonthChange(e, t),
i) {
const r = this.getTargetChangeDate({
panelType: t,
switchType: e
});
this.handleSyncChangeMonths({
panelType: t,
target: r
})
}
}
prevMonth(e) {
this.handleSwitchMonthOrYear("prevMonth", e)
}
nextMonth(e) {
this.handleSwitchMonthOrYear("nextMonth", e)
}
prevYear(e) {
this.handleSwitchMonthOrYear("prevYear", e)
}
nextYear(e) {
this.handleSwitchMonthOrYear("nextYear", e)
}
_getDiff(e, t, r) {
const n = this._getPanelDetail(r);
return dateDiffFns[e] && dateDiffFns[e](t, n.pickerDate)
}
_getPanelDetail(e) {
return e === strings$g.PANEL_TYPE_RIGHT ?
this.getState("monthRight") : this.getState("monthLeft")
}
localeFormat(e, t) {
return format$3(e, t, {
locale: this._adapter.getProp("dateFnsLocale")
})
}
disposeCallbackArgs(e) {
let t = Array.isArray(e) ? e : e && [e] || [];
const r = this.getProp("timeZone");
isValidTimeZone(r) && (t = t.map((e => zonedTimeToUtc(e, r))));
const n = this.getProp("type")
, i = this.getProp("format") || getDefaultFormatTokenByType(n);
let o, s;
switch (n) {
case "date":
case "dateTime":
case "month":
this._isMultiple() ? (o = t.map((e => e && this.localeFormat(e,
i))),
s = [...t]) : (o = t[0] && this.localeFormat(t[0], i),
[s] = t);
break;
case "dateRange":
case "dateTimeRange":
o = t.map((e => e && this.localeFormat(e, i))),
s = [...t]
}
return {
notifyValue: o,
notifyDate: s
}
}
handleYearOrMonthChange(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : strings$g.PANEL_TYPE_LEFT
, r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : 1
, n = arguments.length > 3 && void 0 !== arguments[3] &&
arguments[3];
const {autoSwitchDate: i, type: o} = this.getProps()
, {monthLeft: s, monthRight: a} = this.getStates()
, l = this.isRangeType(o)
, c = l && t === strings$g.PANEL_TYPE_LEFT
, u = this._getPanelDetail(t)
, {pickerDate: d} = u
, p = (0,
dateCalcFns[e])(d, r)
, h = t === strings$g.PANEL_TYPE_LEFT && !_isEqual(p,
s.pickerDate) || t === strings$g.PANEL_TYPE_RIGHT && !_isEqual(p, a.pickerDate);
if (this._updatePanelDetail(t, {
pickerDate: p
}),
h)
if (l) {
if (c ? this.newBiMonthPanelDate[0] = p :
this.newBiMonthPanelDate[1] = p,
!c || !n) {
const {notifyValue: e, notifyDate: t} =
this.disposeCallbackArgs(this.newBiMonthPanelDate);
this._adapter.notifyPanelChange(t, e)
}
} else {
const {notifyValue: e, notifyDate: t} =
this.disposeCallbackArgs(p);
this._adapter.notifyPanelChange(t, e)
}
i && this.updateDateAfterChangeYM(e, p)
}
updateDateAfterChangeYM(e, t) {
const {multiple: r, disabledDate: n, type: i} = this.getProps()
, {selected: o, rangeStart: s, rangeEnd: a, monthLeft: l} =
this.getStates()
, c = ["dateRange", "dateTimeRange"].includes(e)
, u = {
closePanel: !1
};
if (!r && !c && o.size) {
const e = Array.from(o)[0];
let r = set$1(new Date(e), {
year: t.getFullYear(),
month: t.getMonth()
});
if ("dateTime" === i && (r = this._mergeDateAndTime(r,
l.pickerDate)),
n(r, {
rangeStart: s,
rangeEnd: a
}))
return;
this._adapter.notifySelectedChange([r], u)
}
}
_isMultiple() {
return Boolean(this.getProp("multiple")) && "date" ===
this.getProp("type")
}
_isRange() {}
handleDayClick(e, t) {
const r = this.getProp("type");
switch (!0) {
case "date" === r || "dateTime" === r:
this.handleDateSelected(e, t);
break;
case "dateRange" === r || "dateTimeRange" === r:
this.handleRangeSelected(e)
}
}
handleDateSelected(e, t) {
const {max: r, type: n, isControlledComponent: i, dateFnsLocale: o}
= this.getProps()
, s = this._isMultiple()
, {selected: a} = this.getStates()
, l = this._getPanelDetail(t)
, c = new Set(s ? [...a] : [])
, {fullDate: u} = e
, d = l.pickerDate
, p = u;
s ? c.has(p) ? c.delete(p) : r && c.size === r ?
this._adapter.notifyMaxLimit() : c.add(p) : c.add(p);
const h = [...c].map((e => "dateTime" === n ?
this._mergeDateAndTime(e, d) : compatibleParse(e, strings$g.FORMAT_FULL_DATE, void
0, o)));
this.handleShowDateAndTime(t, d),
i || this._adapter.updateDaySelected(c),
this._adapter.notifySelectedChange(h)
}
handleShowDateAndTime(e, t, r) {
const n = r || t;
this._updatePanelDetail(e, {
showDate: n,
pickerDate: t
})
}
_mergeDateAndTime(e, t) {
const r = this._adapter.getProp("dateFnsLocale")
, n = format$3(isValidDate(e) ? e : compatibleParse(e,
strings$g.FORMAT_FULL_DATE, void 0, r), strings$g.FORMAT_FULL_DATE)
, i = format$3(isValidDate(t) ? t : compatibleParse(t,
strings$g.FORMAT_TIME_PICKER, void 0, r), strings$g.FORMAT_TIME_PICKER);
return compatibleParse(`${n} ${i}`, this.getValidTimeFormat(), void
0, r)
}
handleRangeSelected(e) {
let {rangeStart: t, rangeEnd: r} = this.getStates();
const {startDateOffset: n, endDateOffset: i, type: o,
dateFnsLocale: s, rangeInputFocus: a, triggerRender: l} = this._adapter.getProps()
, {fullDate: c} = e;
let u = !1
, d = !1;
const p = (n || i) && "dateRange" === o;
p ? (t = getFullDateOffset$1(n, c),
r = getFullDateOffset$1(i, c)) : "rangeEnd" === a ? (r = c,
t && r && isBefore(r, t.trim().split(/\s+/)[0]) && (t = null,
u = !0)) : "rangeStart" !== a && a || (t = c,
t && r && isBefore(r.trim().split(/\s+/)[0], t) && (r = null,
d = !0));
/range/i.test(o) && (p ? (this._adapter.setRangeStart(t),
this._adapter.setRangeEnd(r)) : "rangeEnd" === a ?
(this._adapter.setRangeEnd(r),
u && this._adapter.setRangeStart(t),
this._adapter.isAnotherPanelHasOpened("rangeEnd") && t ||
this._adapter.setRangeInputFocus("rangeStart")) : "rangeStart" !== a && a ||
(this._adapter.setRangeStart(t),
d && this._adapter.setRangeEnd(r),
this._adapter.isAnotherPanelHasOpened("rangeStart") && r ||
this._adapter.setRangeInputFocus("rangeEnd")));
const h = this.getValidDateFormat();
if (t || r) {
const [e,n] = [compatibleParse(t, h, void 0, s),
compatibleParse(r, h, void 0, s)];
let i = [e, n];
if ("dateTimeRange" === o) {
const o = this.getState("monthLeft").pickerDate
, s = this.getState("monthRight").pickerDate
, a = t ? this._mergeDateAndTime(t, o) : null
, l = r ? this._mergeDateAndTime(r, s) : null;
i = isSameDay$1(e, n) && isBefore(l, a) ? [a, a] : [a, l]
}
const a = !("dateRange" === o && p);
this._adapter.notifySelectedChange(i, {
needCheckFocusRecord: a
})
}
}
_isNeedSwap(e, t) {
return e && t && isBefore(t, e)
}
handleDayHover() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {
fullDate: ""
};
const {fullDate: t} = e
, {startDateOffset: r, endDateOffset: n, type: i} =
this.getProps();
if (this._adapter.setHoverDay(t),
(r || n) && "dateRange" === i) {
const e = getFullDateOffset$1(r, t)
, i = getFullDateOffset$1(n, t);
this._adapter.setOffsetRangeStart(e),
this._adapter.setOffsetRangeEnd(i)
}
}
_autoAdjustMonth(e, t) {
let r = e
, n = t;
const i = differenceInCalendarMonths(e.pickerDate, t.pickerDate);
return i > 0 ? (r = Object.assign({}, t),
n = Object.assign({}, e)) : 0 === i && (r = e,
n = Object.assign(Object.assign({}, t), {
pickerDate: addMonths(t.pickerDate, 1)
})),
{
monthLeft: r,
monthRight: n
}
}
getValidTimeFormat() {
const e = this.getProp("format") || strings$g.FORMAT_TIME_PICKER
, t = [];
return (_includes(e, "h") || _includes(e, "H")) && t.push("HH"),
_includes(e, "m") && t.push("mm"),
_includes(e, "s") && t.push("ss"),
t.join(":")
}
getValidDateFormat() {
return this.getProp("format") ||
getDefaultFormatToken$1(this.getProp("type"))
}
handleTimeChange(e, t) {
const {rangeEnd: r, rangeStart: n} = this.getStates()
, i = this.getProp("dateFnsLocale")
, o = e.timeStampValue
, s = this.getProp("type")
, a = this._getPanelDetail(t)
, {showDate: l} = a
, c = new Date(o)
, u = this.getValidDateFormat()
, d = t === strings$g.PANEL_TYPE_RIGHT ? r : n;
let p, h, f;
if ("dateTimeRange" === s && d) {
const e = compatibleParse(d, u, void 0, i);
p = e.getFullYear(),
h = e.getMonth(),
f = e.getDate()
} else
p = l.getFullYear(),
h = l.getMonth(),
f = l.getDate();
const m = c.getHours()
, g = c.getMinutes()
, y = c.getSeconds()
, v = c.getMilliseconds()
, b = new Date(...[p, h, f, m, g, y, v]);
if ("dateTimeRange" === s)
this.handleShowDateAndTime(t, b, l),
this._updateTimeInDateRange(t, b);
else {
const e = formatFullDate(p, h + 1, f);
this.handleDateSelected({
fullDate: e,
fullValidDate: b
}, t),
this.handleShowDateAndTime(t, b),
this._adapter.notifySelectedChange([b])
}
}
_updateTimeInDateRange(e, t) {
const {isControlledComponent: r, dateFnsLocale: n} =
this.getProps();
let i = this.getState("rangeStart")
, o = this.getState("rangeEnd");
const s = this.getValidDateFormat();
if (i && o) {
let a = compatibleParse(i, s, void 0, n)
, l = compatibleParse(o, s, void 0, n);
e === strings$g.PANEL_TYPE_RIGHT ? (l =
this._mergeDateAndTime(t, t),
o = format$3(l, strings$g.FORMAT_DATE_TIME),
this._isNeedSwap(i, o) && ([i,o] = [o, i],
[a,l] = [l, a]),
r || this._adapter.setRangeEnd(o)) : (a =
this._mergeDateAndTime(t, t),
i = format$3(a, strings$g.FORMAT_DATE_TIME),
this._isNeedSwap(i, o) && ([i,o] = [o, i],
[a,l] = [l, a]),
r || this._adapter.setRangeStart(i)),
this._adapter.notifySelectedChange([a, l])
}
}
_updatePanelDetail(e, t) {
const {monthLeft: r, monthRight: n} = this.getStates();
e === strings$g.PANEL_TYPE_RIGHT ?
this._adapter.updateMonthOnRight(Object.assign(Object.assign({}, n), t)) :
this._adapter.updateMonthOnLeft(Object.assign(Object.assign({}, r), t))
}
showYearPicker(e) {
this._updatePanelDetail(e, {
isTimePickerOpen: !1,
isYearPickerOpen: !0
})
}
showTimePicker(e, t) {
this.getProp("disabledTimePicker") || this._updatePanelDetail(e, {
isTimePickerOpen: !0,
isYearPickerOpen: !1
})
}
showDatePanel(e) {
this._updatePanelDetail(e, {
isTimePickerOpen: !1,
isYearPickerOpen: !1
})
}
getYAMOpenType() {
const {monthLeft: e, monthRight: t} = this._adapter.getStates()
, r = e.isYearPickerOpen
, n = t.isYearPickerOpen;
return r && n ? "both" : r ? "left" : n ? "right" : "none"
}
}
const prefixCls$l = cssClasses$l.NAVIGATION;
class Navigation extends reactExports.PureComponent {
constructor(e) {
super(e),
this.navRef = React.createRef()
}
render() {
const {forwardRef: e, monthText: t, onMonthClick: r, onNextMonth:
n, onPrevMonth: i, onPrevYear: o, onNextYear: s, density: a, shouldBimonthSwitch:
l, panelType: c} = this.props
, u = "borderless"
, d = "compact" === a ? "default" : "large"
, p = !0
, h = "compact" === a ? "small" : "default"
, f = c === strings$g.PANEL_TYPE_LEFT
, m = c === strings$g.PANEL_TYPE_RIGHT
, g = l && f
, y = {}
, v = {};
l && m && (y.visibility = "hidden"),
g && (v.visibility = "hidden");
const b = e || this.navRef;
return React.createElement("div", {
className: prefixCls$l,
ref: b
}, React.createElement(Button$2, {
key: "double-chevron-left",
"aria-label": "Previous year",
icon: React.createElement(IconDoubleChevronLeft, {
"aria-hidden": !0,
size: d
}),
size: h,
theme: u,
noHorizontalPadding: p,
onClick: o,
style: y
}), React.createElement(Button$2, {
key: "chevron-left",
"aria-label": "Previous month",
icon: React.createElement(IconChevronLeft, {
"aria-hidden": !0,
size: d
}),
size: h,
onClick: i,
theme: u,
noHorizontalPadding: p,
style: y
}), React.createElement("div", {
className: `${prefixCls$l}-month`
}, React.createElement(Button$1, {
onClick: r,
theme: u,
size: h
}, React.createElement("span", null, t))),
React.createElement(Button$2, {
key: "chevron-right",
"aria-label": "Next month",
icon: React.createElement(IconChevronRight, {
"aria-hidden": !0,
size: d
}),
size: h,
onClick: n,
theme: u,
noHorizontalPadding: p,
style: v
}), React.createElement(Button$2, {
key: "double-chevron-right",
"aria-label": "Next year",
icon: React.createElement(IconDoubleChevronRight, {
"aria-hidden": !0,
size: d
}),
size: h,
theme: u,
noHorizontalPadding: p,
onClick: s,
style: v
}))
}
}
Navigation.propTypes = {
monthText: PropTypes.string,
density: PropTypes.string,
onMonthClick: PropTypes.func,
onNextMonth: PropTypes.func,
onPrevMonth: PropTypes.func,
onNextYear: PropTypes.func,
onPrevYear: PropTypes.func,
navPrev: PropTypes.node,
navNext: PropTypes.node,
shouldBimonthSwitch: PropTypes.bool,
panelType: PropTypes.oneOf([strings$g.PANEL_TYPE_LEFT,
strings$g.PANEL_TYPE_RIGHT])
},
Navigation.defaultProps = {
monthText: "",
onMonthClick: _noop,
onNextMonth: _noop,
onPrevMonth: _noop,
onNextYear: _noop,
onPrevYear: _noop
};
const getDayofWeek = e => {
let {weekStartsOn: t=0} = e;
const r = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
for (let n = 0; n < t; n++)
r.push(r.shift());
return r
}
, getDayOfWeek = getDayofWeek;
class CalendarMonthFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e))
}
init() {
this._getToday(),
this.getMonthTable()
}
_getToday() {
const e = format$3(new Date, "yyyy-MM-dd");
this._adapter.updateToday(e)
}
getMonthTable() {
const e = this._adapter.getProp("month")
, t = this.getState("weeksRowNum");
if (e) {
this.updateWeekDays();
const r = this._adapter.getProp("weekStartsOn")
, n = getMonthTable$1(e, r)
, {weeks: i} = n;
this._adapter.updateMonthTable(n),
isNullOrUndefined(t) ? this._adapter.setWeeksRowNum(i.length) :
Array.isArray(i) && i.length !== t && this._adapter.setWeeksRowNum(i.length, ( ()
=> {
this._adapter.notifyWeeksRowNumChange(i.length)
}
))
}
}
updateWeekDays() {
const e = this._adapter.getProp("weekStartsOn")
, t = getDayOfWeek({
weekStartsOn: e
});
this._adapter.setWeekDays(t)
}
destroy() {}
handleClick(e) {
this._adapter.notifyDayClick(e)
}
handleHover(e) {
this._adapter.notifyDayHover(e)
}
}
const prefixCls$k = cssClasses$l.PREFIX;
class Month extends BaseComponent {
constructor(e) {
super(e),
this.state = {
weekdays: [],
month: {
weeks: [],
monthText: ""
},
todayText: "",
weeksRowNum: e.weeksRowNum
},
this.monthRef = React.createRef()
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
updateToday: e => this.setState({
todayText: e
}),
setWeekDays: e => this.setState({
weekdays: e
}),
setWeeksRowNum: (e, t) => this.setState({
weeksRowNum: e
}, t),
updateMonthTable: e => this.setState({
month: e
}),
notifyDayClick: e => this.props.onDayClick(e),
notifyDayHover: e => this.props.onDayHover(e),
notifyWeeksRowNumChange: e => this.props.onWeeksRowNumChange(e)
})
}
componentDidMount() {
this.foundation = new CalendarMonthFoundation(this.adapter),
this.foundation.init()
}
componentWillUnmount() {
this.foundation.destroy()
}
componentDidUpdate(e, t) {
e.month !== this.props.month && this.foundation.getMonthTable()
}
getSingleDayStatus(e) {
const {rangeInputFocus: t} = this.props
, {fullDate: r, todayText: n, selected: i, disabledDate: o,
rangeStart: s, rangeEnd: a} = e
, l = {
rangeStart: s,
rangeEnd: a,
rangeInputFocus: t
}
, c = r === n
, u = i.has(r);
let d = o && o(parseISO(r), l);
return !d && "rangeStart" === this.props.rangeInputFocus && a &&
this.props.focusRecordsRef && this.props.focusRecordsRef.current.rangeEnd && (d =
isAfter(r, a.trim().split(/\s+/)[0])),
!d && "rangeEnd" === this.props.rangeInputFocus && s &&
this.props.focusRecordsRef && this.props.focusRecordsRef.current.rangeStart && (d =
isBefore(r, s.trim().split(/\s+/)[0])),
{
isToday: c,
isSelected: u,
isDisabled: d
}
}
getDateRangeStatus(e) {
const {rangeStart: t, rangeEnd: r, fullDate: n, hoverDay: i,
offsetRangeStart: o, offsetRangeEnd: s, rangeInputFocus: a} = e
, l = Boolean(t || r)
, c = Boolean(t && r)
, u = o || s;
if (!l)
return {};
const d = isSameDay(i, n);
let p, h, f, m, g, y, v, b, x, _, E, T;
return t && (f = isSameDay(n, t),
"rangeEnd" === a && (p = isBetween(n, {
start: t,
end: i
}))),
r && (m = isSameDay(n, r),
"rangeStart" === a && (h = isBetween(n, {
start: i,
end: r
}))),
!c && l && (g = d),
u || (y = p || h || d),
c && (v = isBetween(n, {
start: t,
end: r
}),
u || (b = f && isAfter(t, i),
x = m && isBefore(r, i),
_ = d && "rangeStart" === a,
E = d && "rangeEnd" === a,
T = d && isBetween(i, {
start: t,
end: r
}))),
{
isHoverDay: d,
isSelectedStart: f,
isSelectedEnd: m,
isInRange: v,
isHover: y,
isSelectedStartAfterHover: b,
isSelectedEndBeforeHover: x,
isHoverDayInRange: T,
isHoverDayInStartSelection: _,
isHoverDayInEndSelection: E,
isHoverDayAroundOneSelected: g
}
}
getOffsetDateStatus(e) {
const {offsetRangeStart: t, offsetRangeEnd: r, rangeStart: n,
rangeEnd: i, fullDate: o, hoverDay: s} = e;
if (!(t || r))
return {};
const a = isBetween(o, {
start: n,
end: i
})
, l = isSameDay(s, o)
, c = n && isSameDay(o, n)
, u = i && isSameDay(o, i)
, d = Boolean(n && i)
, p = isSameDay(o, t)
, h = isSameDay(o, r)
, f = l;
let m, g;
d && (m = a && l);
return Boolean(t && r) && (g = c || isBetween(o, {
start: t,
end: r
}) || u),
{
isOffsetRangeStart: p,
isOffsetRangeEnd: h,
isHoverInOffsetRange: m,
isHoverDayOffset: f,
isInOffsetRange: g
}
}
getDayStatus(e, t) {
const {fullDate: r} = e
, {hoverDay: n, rangeStart: i, rangeEnd: o, todayText: s,
offsetRangeStart: a, offsetRangeEnd: l, disabledDate: c, selected: u,
rangeInputFocus: d} = t
, p = this.getSingleDayStatus({
fullDate: r,
todayText: s,
hoverDay: n,
selected: u,
disabledDate: c,
rangeStart: i,
rangeEnd: o
})
, h = this.getDateRangeStatus(Object.assign({
fullDate: r,
rangeStart: i,
rangeEnd: o,
hoverDay: n,
offsetRangeStart: a,
offsetRangeEnd: l,
rangeInputFocus: d
}, p))
, f = this.getOffsetDateStatus(Object.assign(Object.assign({
offsetRangeStart: a,
offsetRangeEnd: l,
rangeStart: i,
rangeEnd: o,
fullDate: r,
hoverDay: n
}, p), h));
return Object.assign(Object.assign(Object.assign({}, p), h), f)
}
renderDayOfWeek() {
const {locale: e} = this.props
, t = classNames(cssClasses$l.WEEKDAY)
, r = classNames(`${prefixCls$k}-weekday-item`)
, {weekdays: n} = this.state
, i = n.map((t => e.weeks[t]));
return React.createElement("div", {
role: "row",
className: t
}, i.map(( (e, t) => React.createElement("div", {
role: "columnheader",
key: e + t,
className: r
}, e))))
}
renderWeeks() {
const {month: e} = this.state
, {weeks: t} = e
, {weeksRowNum: r} = this.props;
let n = {};
if (r) {
n = {
height: r * numbers$8.WEEK_HEIGHT
}
}
const i = classNames(cssClasses$l.WEEKS);
return React.createElement("div", {
className: i,
style: n
}, t.map(( (e, t) => this.renderWeek(e, t))))
}
renderWeek(e, t) {
const r = cssClasses$l.WEEK;
return React.createElement("div", {
role: "row",
className: r,
key: t
}, e.map(( (e, t) => this.renderDay(e, t))))
}
renderDay(e, t) {
const {todayText: r} = this.state
, {renderFullDate: n, renderDate: i} = this.props
, {fullDate: o, dayNumber: s} = e;
if (!o)
return React.createElement("div", {
role: "gridcell",
tabIndex: -1,
key: s + t,
className: cssClasses$l.DAY
}, React.createElement("span", null));
const a = this.getDayStatus(e, Object.assign({
todayText: r
}, this.props))
, l = classNames(cssClasses$l.DAY, {
[cssClasses$l.DAY_TODAY]: a.isToday,
[cssClasses$l.DAY_IN_RANGE]: a.isInRange,
[cssClasses$l.DAY_HOVER]: a.isHover,
[cssClasses$l.DAY_SELECTED]: a.isSelected,
[cssClasses$l.DAY_SELECTED_START]: a.isSelectedStart,
[cssClasses$l.DAY_SELECTED_END]: a.isSelectedEnd,
[cssClasses$l.DAY_DISABLED]: a.isDisabled,
[cssClasses$l.DAY_HOVER_DAY]: a.isHoverDayOffset,
[cssClasses$l.DAY_IN_OFFSET_RANGE]: a.isInOffsetRange,
[cssClasses$l.DAY_SELECTED_RANGE_HOVER]:
a.isHoverInOffsetRange,
[cssClasses$l.DAY_OFFSET_RANGE_START]: a.isOffsetRangeStart,
[cssClasses$l.DAY_OFFSET_RANGE_END]: a.isOffsetRangeEnd,
[cssClasses$l.DAY_SELECTED_START_AFTER_HOVER]:
a.isSelectedStartAfterHover,
[cssClasses$l.DAY_SELECTED_END_BEFORE_HOVER]:
a.isSelectedEndBeforeHover,
[cssClasses$l.DAY_HOVER_DAY_BEFORE_RANGE]:
a.isHoverDayInStartSelection,
[cssClasses$l.DAY_HOVER_DAY_AFTER_RANGE]:
a.isHoverDayInEndSelection,
[cssClasses$l.DAY_HOVER_DAY_AROUND_SINGLE_SELECTED]:
a.isHoverDayAroundOneSelected
})
, c = classNames({
[`${cssClasses$l.DAY}-main`]: !0
})
, u = [s, o, a]
, d = _isFunction(n);
return React.createElement("div", {
role: "gridcell",
tabIndex: a.isDisabled ? -1 : 0,
"aria-disabled": a.isDisabled,
"aria-selected": a.isSelected,
"aria-label": o,
className: d ? cssClasses$l.DAY : l,
title: o,
key: s + t,
onClick: t => !a.isDisabled && this.foundation.handleClick(e),
onMouseEnter: () => this.foundation.handleHover(e),
onMouseLeave: () => this.foundation.handleHover()
}, d ? n(...u) : React.createElement("div", {
className: c
}, _isFunction(i) ? i(s, o) : React.createElement("span", null,
s)))
}
render() {
const {forwardRef: e, multiple: t} = this.props
, r = this.renderDayOfWeek()
, n = this.renderWeeks()
, i = classNames(cssClasses$l.MONTH)
, o = e || this.monthRef;
return React.createElement("div", {
role: "grid",
"aria-multiselectable": t,
ref: o,
className: i
}, r, n)
}
}
Month.propTypes = {
month: PropTypes.object,
selected: PropTypes.object,
rangeStart: PropTypes.string,
rangeEnd: PropTypes.string,
offsetRangeStart: PropTypes.string,
offsetRangeEnd: PropTypes.string,
onDayClick: PropTypes.func,
onDayHover: PropTypes.func,
weekStartsOn: PropTypes.number,
disabledDate: PropTypes.func,
weeksRowNum: PropTypes.number,
onWeeksRowNumChange: PropTypes.func,
renderDate: PropTypes.func,
renderFullDate: PropTypes.func,
hoverDay: PropTypes.string,
startDateOffset: PropTypes.func,
endDateOffset: PropTypes.func,
rangeInputFocus: PropTypes.oneOfType([PropTypes.string,
PropTypes.bool]),
focusRecordsRef: PropTypes.object,
multiple: PropTypes.bool
},
Month.defaultProps = {
month: new Date,
selected: new Set,
rangeStart: "",
rangeEnd: "",
onDayClick: _noop,
onDayHover: _noop,
onWeeksRowNumChange: _noop,
weekStartsOn: numbers$8.WEEK_START_ON,
disabledDate: _stubFalse,
weeksRowNum: 0
};
const TYPE_TIME_PICKER = "time"
, TYPE_TIME_RANGE_PICKER = "timeRange"
, DEFAULT_RANGE_SEPARATOR = " ~ "
, DEFAULT_MULTIPLE_SEPARATOR = ","
, cssClasses$k = {
PREFIX: `${BASE_CLASS_PREFIX$1}-timepicker`,
RANGE_PICKER: `${BASE_CLASS_PREFIX$1}-timepicker-range-panel`,
RANGE_PANEL_LISTS: `${BASE_CLASS_PREFIX$1}-timepicker-lists`
}
, strings$f = {
TYPES: [TYPE_TIME_PICKER, TYPE_TIME_RANGE_PICKER],
TYPE_TIME_PICKER: TYPE_TIME_PICKER,
TYPE_TIME_RANGE_PICKER: TYPE_TIME_RANGE_PICKER,
DEFAULT_TYPE: TYPE_TIME_PICKER,
DEFAULT_RANGE_SEPARATOR: DEFAULT_RANGE_SEPARATOR,
DEFAULT_MULTIPLE_SEPARATOR: DEFAULT_MULTIPLE_SEPARATOR,
SIZE: strings$p.SIZE,
DEFAULT_FORMAT: "HH:mm:ss",
DEFAULT_FORMAT_A: "a h:mm:ss",
STATUS: VALIDATE_STATUS,
DEFAULT_POSITION: {
[TYPE_TIME_PICKER]: "bottomLeft",
[TYPE_TIME_RANGE_PICKER]: "bottomLeft"
}
}
, cssClasses$j = {
PREFIX: `${BASE_CLASS_PREFIX$1}-scrolllist`,
SELECTED: `${BASE_CLASS_PREFIX$1}-scrolllist-item-selected`
}
, strings$e = {
MODE: ["normal", "wheel"]
}
, numbers$7 = {
DEFAULT_ITEM_HEIGHT: 36,
DEFAULT_SCROLL_DURATION: 120
};
var baseTimes$1 = _baseTimes
, castFunction$2 = _castFunction
, toInteger$2 = toInteger_1
, MAX_SAFE_INTEGER$2 = 9007199254740991
, MAX_ARRAY_LENGTH$1 = 4294967295
, nativeMin$1 = Math.min;
function times$3(e, t) {
if ((e = toInteger$2(e)) < 1 || e > MAX_SAFE_INTEGER$2)
return [];
var r = MAX_ARRAY_LENGTH$1
, n = nativeMin$1(e, MAX_ARRAY_LENGTH$1);
t = castFunction$2(t),
e -= MAX_ARRAY_LENGTH$1;
for (var i = baseTimes$1(n, t); ++r < e; )
t(r);
return i
}
var times_1 = times$3;
const _times = getDefaultExportFromCjs(times_1);
var baseFindIndex = _baseFindIndex
, baseIteratee$3 = _baseIteratee
, toInteger$1 = toInteger_1
, nativeMax$2 = Math.max;
function findIndex$1(e, t, r) {
var n = null == e ? 0 : e.length;
if (!n)
return -1;
var i = null == r ? 0 : toInteger$1(r);
return i < 0 && (i = nativeMax$2(n + i, 0)),
baseFindIndex(e, baseIteratee$3(t), i)
}
var findIndex_1 = findIndex$1;
const _findIndex = getDefaultExportFromCjs(findIndex_1);
var baseEach$2 = _baseEach
, isArrayLike$2 = isArrayLike_1;
function baseMap$2(e, t) {
var r = -1
, n = isArrayLike$2(e) ? Array(e.length) : [];
return baseEach$2(e, (function(e, i, o) {
n[++r] = t(e, i, o)
}
)),
n
}
var _baseMap = baseMap$2
, arrayMap$1 = _arrayMap
, baseIteratee$2 = _baseIteratee
, baseMap$1 = _baseMap
, isArray$2 = isArray_1;
function map$1(e, t) {
return (isArray$2(e) ? arrayMap$1 : baseMap$1)(e, baseIteratee$2(t))
}
var map_1 = map$1;
const _map = getDefaultExportFromCjs(map_1);
var baseIteratee$1 = _baseIteratee
, isArrayLike$1 = isArrayLike_1
, keys$1 = keys_1;
function createFind$1(e) {
return function(t, r, n) {
var i = Object(t);
if (!isArrayLike$1(t)) {
var o = baseIteratee$1(r);
t = keys$1(t),
r = function(e) {
return o(i[e], e, i)
}
}
var s = e(t, r, n);
return s > -1 ? i[o ? t[s] : s] : void 0
}
}
var _createFind = createFind$1
, createFind = _createFind
, findIndex = findIndex_1
, find = createFind(findIndex)
, find_1 = find;
const _find = getDefaultExportFromCjs(find_1);
var baseSlice$1 = _baseSlice
, isIterateeCall$2 = _isIterateeCall
, toInteger = toInteger_1;
function slice$1(e, t, r) {
var n = null == e ? 0 : e.length;
return n ? (r && "number" != typeof r && isIterateeCall$2(e, t, r) ? (t
= 0,
r = n) : (t = null == t ? 0 : toInteger(t),
r = void 0 === r ? n : toInteger(r)),
baseSlice$1(e, t, r)) : []
}
var slice_1 = slice$1;
const _slice = getDefaultExportFromCjs(slice_1);
class ItemFoundation extends BaseFoundation$1 {
constructor() {
super(...arguments),
this._cachedSelectedNode = null
}
selectIndex(e, t) {
const {type: r, list: n} = this.getProps();
if (e > -1 && Array.isArray(n) && n.length && isElement$1(t)) {
const i = e % n.length
, o = n[i]
, s = t.children[e];
this._adapter.setSelectedNode(s),
this._adapter.notifySelectItem(Object.assign(Object.assign({},
o), {
value: o.value,
type: r,
index: i
}))
}
}
selectNode(e, t) {
const {type: r, list: n} = this.getProps();
if (isElement$1(e) && isElement$1(t)) {
const i = _findIndex(t.children, (t => t === e)) % n.length
, o = _findIndex(t.children, (e => e ===
this._cachedSelectedNode)) % n.length
, s = n[i];
this._adapter.setSelectedNode(e),
this._adapter.scrollToCenter(e),
this._cachedSelectedNode !== e && (this._cachedSelectedNode =
e,
o !== i &&
this._adapter.notifySelectItem(Object.assign(Object.assign({}, s), {
value: s.value,
type: r,
index: i
})))
}
}
shouldAppend(e, t) {
let r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : 2;
if (isElement$1(e) && isElement$1(t)) {
const n = e.querySelectorAll("li")
, i = n[n.length - 1]
, {list: o} = this.getProps();
if (i) {
const e = t.getBoundingClientRect()
, n = i.getBoundingClientRect()
, s = n.height * o.length;
let a = n.top
, l = 0;
for (; a <= e.top + e.height * r; )
l += 1,
a += s;
return l
}
}
return !1
}
shouldPrepend(e, t) {
let r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : 2;
if (isElement$1(e) && isElement$1(t)) {
const n = e.querySelectorAll("li")[0]
, {list: i} = this.getProps();
if (n) {
const e = t.getBoundingClientRect()
, o = n.getBoundingClientRect()
, s = o.height * i.length;
let a = o.top
, l = 0;
for (; a + o.height >= e.top - e.height * r; )
l += 1,
a -= s;
return l
}
}
return 0
}
initWheelList(e, t, r) {
const {list: n} = this.getProps();
if (isElement$1(t) && isElement$1(e) && n && n.length) {
const i = e.children;
_slice(i, 0, n.length);
const o = this.shouldPrepend(e, t)
, s = this.shouldAppend(e, t);
this._adapter.setState({
prependCount: o,
appendCount: s
}, r)
}
}
adjustInfiniteList(e, t, r) {
const {list: n} = this.getProps();
if (isElement$1(t) && isElement$1(e) && n && n.length) {
const r = e.querySelectorAll("li")
, i = r.length
, o = 1
, s = this.shouldPrepend(e, t, o)
, a = this.shouldAppend(e, t, o);
if (s)
for (let t = 0; t < s; t++) {
prepend(e, ..._slice(r, i - n.length * (t + 1), i -
n.length * t))
}
if (a)
for (let t = 0; t < a; t++) {
append(e, ..._slice(r, t * n.length, (t + 1) *
n.length))
}
}
}
getNearestNodeInfo(e, t) {
if (isElement$1(e) && isElement$1(t)) {
const r = t.getBoundingClientRect().top
, n = e.querySelectorAll("li");
let i = null
, o = -1
, s = 1 / 0;
return Array.from(n).map(( (e, t) => {
const n = e.getBoundingClientRect().top
, a = Math.abs(n - r);
a < s && !this._adapter.isDisabledIndex(t) && (s = a,
i = e,
o = t)
}
)),
{
nearestNode: i,
nearestIndex: o
}
}
}
getTargetNode(e, t) {
if (e && isElement$1(t)) {
const r = "li"
, n = e.target
, i = t.querySelectorAll(r)
, o = this.getProp("list")
, s = Array.isArray(o) ? o.length : 0;
let a = -1
, l = -1
, c = null;
const u = _find(i, ( (e, t) => {
if (e === n || e.contains(n))
return a = t,
s > 0 && (l = t % s),
!0
}
));
return l > -1 && (c = o[l]),
{
targetNode: u,
targetIndex: a,
indexInList: l,
infoInList: c
}
}
return null
}
}
const scrollTo = (e, t, r) => {
const n = new Animation$4({
from: {
scrollTop: e.scrollTop
},
to: {
scrollTop: t
}
},{
duration: r
});
return n.on("frame", (t => {
let {scrollTop: r} = t;
e.scrollTop = r
}
)),
n
}
, animatedScrollTo = scrollTo
, msPerFrame = 1e3 / 60
, blankReg = /^\s*$/
, wheelMode = "wheel";
class ScrollItem extends BaseComponent {
constructor() {
var e;
super(arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {}),
e = this,
this._cacheNode = (e, t) => e && t &&
Object.prototype.hasOwnProperty.call(this, e) && (this[e] = t),
this._cacheSelectedNode = e => this._cacheNode("selectedNode", e),
this._cacheWillSelectNode = e => this._cacheNode("willSelectNode",
e),
this._cacheListNode = e => this._cacheNode("list", e),
this._cacheSelectorNode = e => this._cacheNode("selector", e),
this._cacheWrapperNode = e => this._cacheNode("wrapper", e),
this._isFirst = e => {
const {list: t} = this;
if (isElement$1(e) && isElement$1(t)) {
const r = t.children;
return 0 === _findIndex(r, e)
}
return !1
}
,
this._isLast = e => {
const {list: t} = this;
if (isElement$1(e) && isElement$1(t)) {
const {children: r} = t;
return _findIndex(r, e) === r.length - 1
}
return !1
}
,
this.indexIsSame = (e, t) => {
const {list: r} = this.props;
if (r.length)
return e % r.length == t % r.length
}
,
this.isDisabledIndex = e => {
const {list: t} = this.props;
if (Array.isArray(t) && t.length && e > -1) {
const r = e % t.length;
return this.isDisabledData(t[r])
}
return !1
}
,
this.isDisabledNode = e => {
const t = this.list;
if (isElement$1(e) && isElement$1(t)) {
const r = _findIndex(t.children, (t => t === e));
return this.isDisabledIndex(r)
}
return !1
}
,
this.isDisabledData = e => e && "object" == typeof e && e.disabled,
this.isWheelMode = () => this.props.mode === wheelMode,
this.addClassToNode = function(t) {
let r = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : cssClasses$j.SELECTED;
const {list: n} = e;
if (isElement$1(t = t || e.selectedNode) && isElement$1(n)) {
const {children: e} = n
, i = new RegExp(`\\s*${r}\\s*`,"g");
_map(e, (e => {
e.className = e.className && e.className.replace(i, "
"),
blankReg.test(e.className) && (e.className = "")
}
)),
t.className && !blankReg.test(t.className) ? t.className +=
` ${r}` : t.className = r
}
}
,
this.getIndexByNode = e => _findIndex(this.list.children, e),
this.getNodeByIndex = e => {
if (e > -1)
return _find(this.list.children, ( (t, r) => r === e));
return _find(this.list.children, (e => !
this.isDisabledNode(e)))
}
,
this.scrollToIndex = (e, t) => {
t = "number" == typeof t ? t :
numbers$7.DEFAULT_SCROLL_DURATION,
e = null == e ? this.props.selectedIndex : e,
this.scrollToNode(this.selectedNode, t)
}
,
this.scrollToNode = (e, t) => {
const {wrapper: r} = this
, n = r.offsetHeight
, i = this.getItmHeight(e)
, o = (e.offsetTop || this.list.children.length * i / 2) - (n
- i) / 2;
this.scrollToPos(o, t)
}
,
this.scrollToPos = function(t) {
let r = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : numbers$7.DEFAULT_SCROLL_DURATION;
const {wrapper: n} = e;
if (r && e.props.motion)
if (e.scrollAnimation && (e.scrollAnimation.destroy(),
e.scrolling = !1),
n.scrollTop === t) {
if (e.isWheelMode()) {
const t = e.foundation.getNearestNodeInfo(e.list,
e.selector);
e.addClassToNode(t.nearestNode)
}
} else
e.scrollAnimation = animatedScrollTo(n, t, r),
e.scrollAnimation.on("rest", ( () => {
if (e.isWheelMode()) {
const t =
e.foundation.getNearestNodeInfo(e.list, e.selector);
e.addClassToNode(t.nearestNode)
}
}
)),
e.scrollAnimation.start();
else
n.scrollTop = t
}
,
this.scrollToSelectItem = e => {
const {nearestNode: t} =
this.foundation.getNearestNodeInfo(this.list, this.selector);
this.props.cycled && this.throttledAdjustList(e, t),
this.debouncedSelect(e, t)
}
,
this.scrollToCenter = (e, t, r) => {
if (e = e || this.selectedNode,
t = t || this.wrapper,
isElement$1(e) && isElement$1(t)) {
const n = t.getBoundingClientRect()
, i = e.getBoundingClientRect()
, o = t.scrollTop + (i.top - (n.top + n.height / 2 -
i.height / 2));
this.scrollToPos(o, "number" == typeof r ? r :
numbers$7.DEFAULT_SCROLL_DURATION)
}
}
,
this.clickToSelectItem = e => {
e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
const {targetNode: t, infoInList: r} =
this.foundation.getTargetNode(e, this.list);
t && r && !r.disabled && this.debouncedSelect(null, t)
}
,
this.getItmHeight = e => e && e.offsetHeight ||
numbers$7.DEFAULT_ITEM_HEIGHT,
this.renderItemList = function() {
let t = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : "";
const {selectedIndex: r, mode: n, transform: i, list: o} =
e.props;
return o.map(( (o, s) => {
const {transform: a} = o
, l = "function" == typeof a ? a : i
, c = r === s
, u = classNames({
[`${cssClasses$j.PREFIX}-item-sel`]: c && n !==
wheelMode,
[`${cssClasses$j.PREFIX}-item-disabled`]:
Boolean(o.disabled)
});
let d = "";
d = c && "function" == typeof l ? l(o.value, o.text) : null
== o.text ? o.value : o.text;
const p = {};
return e.isWheelMode() || o.disabled || (p.onClick = () =>
e.foundation.selectIndex(s, e.list)),
React.createElement("li", Object.assign({
key: t + s
}, p, {
className: u,
role: "option",
"aria-selected": c,
"aria-disabled": o.disabled
}), d)
}
))
}
,
this.renderNormalList = () => {
const {list: e, className: t, style: r} = this.props
, n = this.renderItemList()
, i = classNames(`${cssClasses$j.PREFIX}-item`, t);
return React.createElement("div", {
style: r,
className: i,
ref: this._cacheWrapperNode
}, React.createElement("ul", {
role: "listbox",
"aria-multiselectable": !1,
"aria-label": this.props["aria-label"],
ref: this._cacheListNode
}, n))
}
,
this.renderInfiniteList = () => {
const {list: e, cycled: t, className: r, style: n} = this.props
, {prependCount: i, appendCount: o} = this.state
, s = _times(i).reduce(( (e, t) => {
const r = this.renderItemList(`pre_${t}_`);
return e.unshift(...r),
e
}
), [])
, a = _times(o).reduce(( (e, t) => {
const r = this.renderItemList(`app_${t}_`);
return e.push(...r),
e
}
), [])
, l = this.renderItemList()
, c = classNames(`${cssClasses$j.PREFIX}-list-outer`, {
[`${cssClasses$j.PREFIX}-list-outer-nocycle`]: !t
})
, u = classNames(`${cssClasses$j.PREFIX}-item-wheel`, r)
, d = classNames(`${cssClasses$j.PREFIX}-selector`)
, p = classNames(`${cssClasses$j.PREFIX}-shade`, `$
{cssClasses$j.PREFIX}-shade-pre`)
, h = classNames(`${cssClasses$j.PREFIX}-shade`, `$
{cssClasses$j.PREFIX}-shade-post`);
return React.createElement("div", {
className: u,
style: n
}, React.createElement("div", {
className: p
}), React.createElement("div", {
className: d,
ref: this._cacheSelectorNode
}), React.createElement("div", {
className: h
}), React.createElement("div", {
className: c,
ref: this._cacheWrapperNode,
onScroll: this.scrollToSelectItem
}, React.createElement("ul", {
role: "listbox",
"aria-label": this.props["aria-label"],
"aria-multiselectable": !1,
ref: this._cacheListNode,
onClick: this.clickToSelectItem
}, s, l, a)))
}
,
this.state = {
prependCount: 0,
appendCount: 0
},
this.selectedNode = null,
this.willSelectNode = null,
this.list = null,
this.wrapper = null,
this.selector = null,
this.scrollAnimation = null,
this.foundation = new ItemFoundation(this.adapter),
this.throttledAdjustList = throttle$3(( (e, t) => {
this.foundation.adjustInfiniteList(this.list, this.wrapper, t)
}
), msPerFrame),
this.debouncedSelect = debounce$3(( (e, t) => {
this._cacheSelectedNode(t),
this.foundation.selectNode(t, this.list)
}
), 2 * msPerFrame)
}
get adapter() {
var e = this;
return Object.assign(Object.assign({}, super.adapter), {
setState: (e, t) => this.setState(Object.assign({}, e), t),
setPrependCount: e => this.setState({
prependCount: e
}),
setAppendCount: e => this.setState({
appendCount: e
}),
isDisabledIndex: this.isDisabledIndex,
setSelectedNode: e => this._cacheWillSelectNode(e),
notifySelectItem: function() {
return e.props.onSelect(...arguments)
},
scrollToCenter: this.scrollToCenter
})
}
componentWillUnmount() {
this.props.cycled && (this.throttledAdjustList.cancel(),
this.debouncedSelect.cancel())
}
componentDidMount() {
this.foundation.init();
const {mode: e, cycled: t, selectedIndex: r, list: n} = this.props
, i = this.getNodeByIndex("number" == typeof r && r > -1 ? r :
0);
this._cacheSelectedNode(i),
this._cacheWillSelectNode(i),
e === wheelMode && t ? this.foundation.initWheelList(this.list,
this.wrapper, ( () => {
this.scrollToNode(i, 0)
}
)) : this.scrollToNode(i, 0)
}
componentDidUpdate(e) {
const {selectedIndex: t} = this.props;
if (e.selectedIndex !== t) {
const r = this.getIndexByNode(this.willSelectNode);
if (!this.indexIsSame(r, t)) {
const r = this.getNodeByOffset(this.selectedNode, t -
e.selectedIndex, this.list);
this._cacheWillSelectNode(r)
}
this._cacheSelectedNode(this.willSelectNode),
this.scrollToIndex(t)
}
}
getNodeByOffset(e, t, r) {
const {list: n} = this.props;
if (isElement$1(e) && isElement$1(r) && "number" == typeof t &&
Array.isArray(n) && n.length) {
t %= n.length;
let r = this.getIndexByNode(e) + t;
for (; r < 0; )
r += n.length;
if (t)
return this.getNodeByIndex(r)
}
return e
}
render() {
return this.isWheelMode() ? this.renderInfiniteList() :
this.renderNormalList()
}
}
ScrollItem.propTypes = {
mode: PropTypes.oneOf(strings$e.MODE),
cycled: PropTypes.bool,
list: PropTypes.array,
selectedIndex: PropTypes.number,
onSelect: PropTypes.func,
transform: PropTypes.func,
className: PropTypes.string,
style: PropTypes.object,
motion: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
type: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
},
ScrollItem.defaultProps = {
selectedIndex: 0,
motion: !0,
list: [],
onSelect: _noop,
cycled: !1,
mode: wheelMode
};
class ScrollListFoundation extends BaseFoundation$1 {
}
const scrollList = "";
var __rest$G = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class ScrollList extends BaseComponent {
constructor(e) {
super(e),
this.foundation = new ScrollListFoundation(this.adapter)
}
render() {
const e = this.props
, {children: t, header: r, footer: n, prefixCls: i, bodyHeight:
o, className: s, style: a} = e
, l = __rest$G(e, ["children", "header", "footer", "prefixCls",
"bodyHeight", "className", "style"])
, c = classNames(s, {
[i || cssClasses$j.PREFIX]: !0
})
, u = classNames({
[`${i || cssClasses$j.PREFIX}-header`]: !0
});
return React.createElement("div", Object.assign({
className: c,
style: a
}, this.getDataAttr(l)), r ? React.createElement("div", {
className: u
}, React.createElement("div", {
className: `${u}-title`,
"x-semi-prop": this.props["x-semi-header-alias"] || "header"
}, r), React.createElement("div", {
className: `${c}-line`
})) : null, React.createElement("div", {
className: `${c}-body`,
style: {
height: o || ""
},
"x-semi-prop": "children"
}, t), n ? React.createElement("div", {
className: `${c}-footer`,
"x-semi-prop": this.props["x-semi-footer-alias"] || "footer"
}, n) : null)
}
}
ScrollList.Item = ScrollItem,
ScrollList.propTypes = {
className: PropTypes.string,
header: PropTypes.node,
footer: PropTypes.node,
children: PropTypes.node,
bodyHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
};
const ScrollList$1 = ScrollList
, HOUR = 36e5
, DAY = 24 * HOUR
, formatOption = (e, t) => {
let r = `${e}`;
e < 10 && (r = `0${e}`);
let n = !1;
return t && t.indexOf(e) >= 0 && (n = !0),
{
value: r,
disabled: n
}
}
;
function generateOptions(e, t, r) {
let n = arguments.length > 3 && void 0 !== arguments[3] ?
arguments[3] : 1;
const i = [];
for (let o = 0; o < e; o += n)
(!t || t.indexOf(o) < 0 || !r) && i.push(o);
return i
}
class ComboboxFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e))
}
isAM() {
return this.getProp("isAM")
}
initData() {
const {timeStampValue: e, hourStep: t, disabledMinutes: r,
disabledSeconds: n, hideDisabledOptions: i, minuteStep: o, secondStep: s} =
this.getProps()
, a = this.getValidFormat()
, l = this.getDisplayDateFromTimeStamp(e)
, c = this.disabledHours()
, u = r(l ? l.getHours() : null)
, d = n(l ? l.getHours() : null, l ? l.getMinutes() : null)
, p = generateOptions(24, c, i, t)
, h = generateOptions(60, u, i, o)
, f = generateOptions(60, d, i, s);
return {
showHour: Boolean(a.match(/HH|hh|H|h/g)),
showMinute: Boolean(a.match(/mm/g)),
showSecond: Boolean(a.match(/ss/g)),
hourOptions: p,
minuteOptions: h,
secondOptions: f
}
}
getPosition() {
const e = this.getProp("position")
, t = this.getProp("type") || strings$f.DEFAULT_TYPE;
return e || strings$f.DEFAULT_POSITION[t]
}
getDefaultFormatIfNeed() {
return this._isInProps("format") ? this.getProp("format") :
this.getProp("use12Hours") ? strings$f.DEFAULT_FORMAT_A : strings$f.DEFAULT_FORMAT
}
disabledHours() {
const {use12Hours: e, disabledHours: t} = this.getProps();
let r = t && t();
return e && Array.isArray(r) && (r = this.isAM() ? r.filter((e => e
< 12)).map((e => 0 === e ? 12 : e)) : r.map((e => 12 === e ? 12 : e - 12))),
r
}
getValidFormat(e) {
let t = isNullOrUndefined(e) ? this.getProp("format") : e;
return t = this.getDefaultFormatIfNeed(),
t = "string" == typeof t ? t : strings$f.DEFAULT_FORMAT,
t
}
getDisplayDateFromTimeStamp(e) {
let t;
return e && (t = new Date(e)),
e && isValidDate(t) ? t : this.createDateDefault()
}
createDateDefault() {
return new Date(parseInt(String(Date.now() / DAY), 10) * DAY - 8 *
HOUR)
}
}
const ComboboxFoundation$1 = ComboboxFoundation;
class Combobox extends BaseComponent {
constructor(e) {
super(e),
this.cacheRefCurrent = (e, t) => {
e && "string" == typeof e && this.adapter.setCache(e, t)
}
,
this.reselect = () => {
["ampm", "hour", "minute", "second"].forEach((e => {
const t = this.adapter.getCache(e);
t && t.scrollToIndex && t.scrollToIndex()
}
))
}
,
this.onItemChange = e => {
let {type: t, value: r, disabled: n} = e
, {onChange: i, use12Hours: o, isAM: s, format: a,
timeStampValue: l} = this.props;
const c = this.foundation.getDisplayDateFromTimeStamp(l);
if ("hour" === t)
o ? s ? c.setHours(Number(r) % 12) : c.setHours(Number(r) %
12 + 12) : c.setHours(Number(r));
else if ("minute" === t)
c.setMinutes(Number(r));
else if ("ampm" === t) {
const e = r.toUpperCase();
o && ("PM" === e && (s = !1,
c.getHours() < 12 && c.setHours(c.getHours() % 12 + 12)),
"AM" === e && (s = !0,
c.getHours() >= 12 && c.setHours(c.getHours() - 12)))
} else
c.setSeconds(Number(r));
i && i({
isAM: s,
value: format$3(c, a && a.replace(/(\s+)A/g, "$1a")),
timeStampValue: Number(c)
})
}
,
this.onEnterSelectPanel = e => {
const {onCurrentSelectPanelChange: t} = this.props;
t(e)
}
,
this.getDisplayDateFromTimeStamp = e =>
this.foundation.getDisplayDateFromTimeStamp(e),
this.foundation = new ComboboxFoundation$1(this.adapter),
this.state = Object.assign({}, this.foundation.initData())
}
componentDidUpdate(e, t) {
e.timeStampValue === this.props.timeStampValue && e.format ===
this.props.format || this.setState(Object.assign({}, this.foundation.initData()))
}
componentWillUnmount() {}
componentDidMount() {}
renderHourSelect(e, t) {
const {prefixCls: r, disabledHours: n, use12Hours: i,
scrollItemProps: o} = this.props
, {showHour: s, hourOptions: a} = this.state;
if (!s)
return null;
const l = n();
let c, u;
i ? (c = [12].concat(a.filter((e => e < 12 && e > 0))),
u = e % 12 || 12) : (c = a,
u = e);
const d = `${r}-list-hour`;
return React.createElement(ScrollItem, Object.assign({
ref: e => this.cacheRefCurrent("hour", e),
mode: "normal",
transform: e => e + t.hour,
className: d,
list: c.map((e => formatOption(e, l))),
selectedIndex: c.indexOf(u),
type: "hour",
onSelect: this.onItemChange
}, o))
}
renderMinuteSelect(e, t) {
const {prefixCls: r, disabledMinutes: n, timeStampValue: i,
scrollItemProps: o} = this.props
, {showMinute: s, minuteOptions: a} = this.state;
if (!s)
return null;
const l = new Date(i)
, c = n && n(l.getHours())
, u = `${r}-list-minute`;
return React.createElement(ScrollItem, Object.assign({
ref: e => this.cacheRefCurrent("minute", e),
mode: "normal",
transform: e => e + t.minute,
list: a.map((e => formatOption(e, c))),
selectedIndex: a.indexOf(e),
type: "minute",
onSelect: this.onItemChange,
className: u
}, o))
}
renderSecondSelect(e, t) {
const {prefixCls: r, disabledSeconds: n, timeStampValue: i,
scrollItemProps: o} = this.props
, {showSecond: s, secondOptions: a} = this.state;
if (!s)
return null;
const l = new Date(i)
, c = n && n(l.getHours(), l.getMinutes())
, u = `${r}-list-second`;
return React.createElement(ScrollItem, Object.assign({
ref: e => this.cacheRefCurrent("second", e),
mode: "normal",
transform: e => String(e) + t.second,
list: a.map((e => formatOption(e, c))),
selectedIndex: a.indexOf(e),
className: u,
type: "second",
onSelect: this.onItemChange
}, o))
}
renderAMPMSelect(e, t) {
const {prefixCls: r, use12Hours: n, isAM: i, scrollItemProps: o} =
this.props;
if (!n)
return null;
const s = [{
value: "AM",
text: e.AM || "上午"
}, {
value: "PM",
text: e.PM || "下午"
}]
, a = i ? 0 : 1
, l = `${r}-list-ampm`;
return React.createElement(ScrollItem, Object.assign({
ref: e => this.cacheRefCurrent("ampm", e),
mode: "normal",
className: l,
list: s,
selectedIndex: a,
type: "ampm",
onSelect: this.onItemChange
}, o))
}
render() {
const {timeStampValue: e, panelHeader: t, panelFooter: r} =
this.props
, n = this.getDisplayDateFromTimeStamp(e);
return React.createElement(LocaleConsumer, {
componentName: "TimePicker"
}, ( (e, i) => React.createElement(ScrollList$1, {
header: t,
footer: r,
"x-semi-header-alias": "panelHeader",
"x-semi-footer-alias": "panelFooter"
}, this.renderAMPMSelect(e, i), this.renderHourSelect(n.getHours(),
e), this.renderMinuteSelect(n.getMinutes(), e),
this.renderSecondSelect(n.getSeconds(), e))))
}
}
Combobox.propTypes = {
format: PropTypes.string,
defaultOpenValue: PropTypes.object,
prefixCls: PropTypes.string,
onChange: PropTypes.func,
showHour: PropTypes.bool,
showMinute: PropTypes.bool,
showSecond: PropTypes.bool,
disabledHours: PropTypes.func,
disabledMinutes: PropTypes.func,
disabledSeconds: PropTypes.func,
hideDisabledOptions: PropTypes.bool,
onCurrentSelectPanelChange: PropTypes.func,
use12Hours: PropTypes.bool,
isAM: PropTypes.bool,
timeStampValue: PropTypes.any,
scrollItemProps: PropTypes.object
},
Combobox.defaultProps = {
disabledHours: _noop,
disabledMinutes: _noop,
disabledSeconds: _noop,
format: strings$f.DEFAULT_FORMAT
};
const Combobox$1 = Combobox;
class YearAndMonthFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e))
}
init() {}
destroy() {}
selectYear(e, t) {
const {currentYear: r, currentMonth: n} = this.getStates()
, {type: i} = this.getProps()
, o = strings$g.PANEL_TYPE_LEFT
, s = strings$g.PANEL_TYPE_RIGHT
, a = index$2(r);
if (a[t] = e.value,
"monthRange" === i) {
const r = a[o] === a[s] && n[o] > n[s];
t === o && e.value > a[s] || t === o && r ? a[s] = e.value +
1 : t === s && r && (a[o] = e.value - 1)
}
this._adapter.setCurrentYear(a, ( () => this.autoSelectMonth(e, t,
a))),
this._adapter.notifySelectYear(a)
}
selectMonth(e, t) {
const {currentMonth: r, currentYear: n} = this.getStates()
, {type: i} = this.getProps()
, o = strings$g.PANEL_TYPE_LEFT
, s = strings$g.PANEL_TYPE_RIGHT
, a = index$2(r);
a[t] = e.month,
"monthRange" === i && t === o && n[o] === n[s] && e.value > a[s] &&
(a[s] = e.month + 1),
this._adapter.setCurrentMonth(a),
this._adapter.notifySelectMonth(a)
}
autoSelectMonth(e, t, r) {
const {disabledDate: n, locale: i} = this._adapter.getProps()
, {months: o, currentMonth: s} = this._adapter.getStates()
, a = setYear(Date.now(), e.year);
if (n(setMonth(a, s[t] - 1))) {
const e = o.findIndex((e => {
let {month: r} = e;
return r === s[t]
}
));
let i;
if (i = o.slice(e).find((e => {
let {month: t} = e;
return !n(setMonth(a, t - 1))
}
)),
i || (i = o.slice(0, e).find((e => {
let {month: t} = e;
return !n(setMonth(a, t - 1))
}
))),
i) {
const e = index$2(s);
e[t] = i.month,
this._adapter.setCurrentYearAndMonth(r, e),
this._adapter.notifySelectYearAndMonth(r, e)
}
}
}
backToMain() {
this._adapter.notifyBackToMain()
}
}
const prefixCls$j = `${BASE_CLASS_PREFIX$1}-datepicker`;
class YearAndMonth extends BaseComponent {
constructor(e) {
super(e),
this.selectYear = (e, t) => {
this.foundation.selectYear(e, t)
}
,
this.selectMonth = (e, t) => {
this.foundation.selectMonth(e, t)
}
,
this.reselect = () => {
["yearRef", "monthRef"].forEach((e => {
const t = this[e];
t && t.current && t.current.scrollToIndex &&
t.current.scrollToIndex()
}
))
}
,
this.backToMain = e => {
e.nativeEvent.stopImmediatePropagation(),
this.foundation.backToMain()
}
;
const t = new Date;
let {currentYear: r, currentMonth: n} = e;
this.state = {
years: getYears$1(e.startYear, e.endYear).map((e => ({
value: e,
year: e
}))),
months: Array(12).fill(0).map(( (e, t) => ({
value: t + 1,
month: t + 1
}))),
currentYear: {
left: r.left || t.getFullYear(),
right: r.right || t.getFullYear()
},
currentMonth: {
left: n.left || t.getMonth() + 1,
right: n.right || t.getMonth() + 2
}
},
this.yearRef = React.createRef(),
this.monthRef = React.createRef(),
this.foundation = new YearAndMonthFoundation(this.adapter)
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setCurrentYear: (e, t) => this.setState({
currentYear: e
}, t),
setCurrentMonth: e => this.setState({
currentMonth: e
}),
setCurrentYearAndMonth: (e, t) => this.setState({
currentYear: e,
currentMonth: t
}),
notifySelectYear: e => this.props.onSelect({
currentMonth: this.state.currentMonth,
currentYear: e
}),
notifySelectMonth: e => this.props.onSelect({
currentYear: this.state.currentYear,
currentMonth: e
}),
notifySelectYearAndMonth: (e, t) => this.props.onSelect({
currentYear: e,
currentMonth: t
}),
notifyBackToMain: () => this.props.onBackToMain()
})
}
static getDerivedStateFromProps(e, t) {
const r = {};
if (!_isEqual(e.currentYear, t.currentYear)) {
const t = (new Date).getFullYear();
r.currentYear = {
left: e.currentYear.left || t,
right: e.currentYear.right || t
}
}
if (!_isEqual(e.currentMonth, t.currentMonth)) {
const t = (new Date).getMonth();
r.currentMonth = {
left: e.currentMonth.left || t + 1,
right: e.currentMonth.right || t + 2
}
}
return r
}
renderColYear(e) {
const {years: t, currentYear: r, currentMonth: n, months: i} =
this.state
, {disabledDate: o, localeCode: s, yearCycled: a,
yearAndMonthOpts: l} = this.props
, c = setMonth(Date.now(), n[e] - 1)
, u = strings$g.PANEL_TYPE_LEFT
, d = strings$g.PANEL_TYPE_RIGHT
, p = t.map((t => {
let {value: n, year: s} = t;
const a = i.every((e => {
let {month: t} = e;
return o(set$1(c, {
year: s,
month: t - 1
}))
}
))
, l = (t => !(e !== d || !r[u]) && r[u] > t)(s);
return {
year: s,
value: n,
disabled: a || l
}
}
));
let h = e => e;
return "zh-CN" !== s && "zh-TW" !== s || (h = e => `${e}年`),
React.createElement(ScrollItem, Object.assign({
ref: this.yearRef,
cycled: a,
list: p,
transform: h,
selectedIndex: t.findIndex((t => t.value === r[e])),
type: "year",
onSelect: t => this.selectYear(t, e),
mode: "normal"
}, l))
}
renderColMonth(e) {
const {months: t, currentMonth: r, currentYear: n} = this.state
, {locale: i, localeCode: o, monthCycled: s, disabledDate: a,
yearAndMonthOpts: l} = this.props;
let c = e => e;
const u = setYear(Date.now(), n[e])
, d = strings$g.PANEL_TYPE_LEFT
, p = strings$g.PANEL_TYPE_RIGHT;
"zh-CN" !== o && "zh-TW" !== o || (c = e => `${e}月`);
const h = t.map((t => {
let {value: o, month: s} = t;
const l = e === p && r[d] && n[d] === n[p] && r[d] > s;
return {
month: s,
disabled: a(setMonth(u, s - 1)) || l,
value: i.fullMonths[o]
}
}
))
, f = h.findIndex((t => t.month === r[e]));
return React.createElement(ScrollItem, Object.assign({
ref: this.monthRef,
cycled: s,
list: h,
transform: c,
selectedIndex: f,
type: "month",
onSelect: t => this.selectMonth(t, e),
mode: "normal"
}, l))
}
renderPanel(e) {
return React.createElement(React.Fragment, null,
React.createElement(ScrollList$1, null, this.renderColYear(e),
this.renderColMonth(e)))
}
render() {
const {locale: e, noBackBtn: t, density: r, presetPosition: n,
renderQuickControls: i, renderDateInput: o, type: s} = this.props
, a = `${prefixCls$j}-yearmonth-header`
, l = `${prefixCls$j}-yearmonth-body`
, c = e.selectDate
, u = "compact" === r ? "default" : "large"
, d = "compact" === r ? "small" : "default"
, p = strings$g.PANEL_TYPE_LEFT
, h = strings$g.PANEL_TYPE_RIGHT;
let f = null;
return f = "month" === s ? this.renderPanel(p) :
React.createElement("div", {
className: l
}, this.renderPanel(p), this.renderPanel(h)),
React.createElement(React.Fragment, null, t ? null :
React.createElement("div", {
className: a
}, React.createElement(Button$2, {
noHorizontalPadding: !1,
icon: React.createElement(IconChevronLeft, {
"aria-hidden": !0,
size: u
}),
size: d,
onClick: this.backToMain
}, React.createElement("span", null, c))), n ?
React.createElement("div", {
style: {
display: "flex"
}
}, "left" === n && "monthRange" !== s && i,
React.createElement("div", null, o, f), "right" === n && "monthRange" !== s && i) :
React.createElement(React.Fragment, null, o, f))
}
}
YearAndMonth.propTypes = {
currentYear: PropTypes.object,
currentMonth: PropTypes.object,
onSelect: PropTypes.func,
locale: PropTypes.object,
localeCode: PropTypes.string,
monthCycled: PropTypes.bool,
yearCycled: PropTypes.bool,
noBackBtn: PropTypes.bool,
disabledDate: PropTypes.func,
density: PropTypes.string,
presetPosition: PropTypes.oneOf(strings$g.PRESET_POSITION_SET),
renderQuickControls: PropTypes.node,
renderDateInput: PropTypes.node,
type: PropTypes.oneOf(strings$g.TYPE_SET),
startYear: PropTypes.number,
endYear: PropTypes.number
},
YearAndMonth.defaultProps = {
disabledDate: _stubFalse,
monthCycled: !1,
yearCycled: !1,
noBackBtn: !1,
onSelect: _noop,
type: "month"
};
const YearAndMonth$1 = YearAndMonth
, prefixCls$i = cssClasses$l.PREFIX;
class MonthsGrid extends BaseComponent {
constructor(e) {
super(e),
this.cacheRefCurrent = (e, t) => {
"string" == typeof e && e.length && this.adapter.setCache(e, t)
}
,
this.leftIsYearOrTime = e => {
const {monthLeft: t} = e || this.state;
return !(!t || !t.isTimePickerOpen && !t.isYearPickerOpen)
}
,
this.rightIsYearOrTime = e => {
const {monthRight: t} = e || this.state;
return !(!t || !t.isTimePickerOpen && !t.isYearPickerOpen)
}
,
this.calcScrollListHeight = () => {
const e = this.adapter.getCache(`wrap-$
{strings$g.PANEL_TYPE_LEFT}`)
, t = this.adapter.getCache(`wrap-$
{strings$g.PANEL_TYPE_RIGHT}`)
, r = this.adapter.getCache(`switch-$
{strings$g.PANEL_TYPE_LEFT}`)
, n = this.adapter.getCache(`switch-$
{strings$g.PANEL_TYPE_RIGHT}`)
, i = e && e.getBoundingClientRect()
, o = t && t.getBoundingClientRect();
let s = i && i.height || 0
, a = o && o.height || 0;
return r && (s += r.getBoundingClientRect().height),
n && (a += n.getBoundingClientRect().height),
Math.max(s, a)
}
,
this.handleWeeksRowNumChange = (e, t) => {
const r = t === strings$g.PANEL_TYPE_RIGHT
, n = t === strings$g.PANEL_TYPE_RIGHT
, i = this.leftIsYearOrTime() && this.rightIsYearOrTime();
if (this.foundation.isRangeType() && !i) {
const t = {
weeksRowNum: e,
currentPanelHeight: this.calcScrollListHeight()
};
this.setState(t, ( () => {
(this.leftIsYearOrTime() && n ||
this.rightIsYearOrTime() && r) && this.reselect()
}
))
}
}
,
this.reselect = () => {
[`timepicker-${strings$g.PANEL_TYPE_LEFT}`, `timepicker-$
{strings$g.PANEL_TYPE_RIGHT}`, `yam-${strings$g.PANEL_TYPE_LEFT}`, `yam-$
{strings$g.PANEL_TYPE_RIGHT}`].forEach((e => {
const t = this.adapter.getCache(e);
t && "function" == typeof t.reselect && t.reselect()
}
))
}
,
this.getYAMOpenType = () => this.foundation.getYAMOpenType();
const t = e.format || getDefaultFormatTokenByType(e.type)
, {nowDate: r, nextDate: n} = getDefaultPickerDate({
defaultPickerValue: e.defaultPickerValue,
format: t,
dateFnsLocale: e.dateFnsLocale
})
, i = {
selected: new Set
}
, o = {
monthLeft: {
pickerDate: r,
showDate: r,
isTimePickerOpen: !1,
isYearPickerOpen: !1
},
monthRight: {
pickerDate: n,
showDate: n,
isTimePickerOpen: !1,
isYearPickerOpen: !1
},
maxWeekNum: 0,
hoverDay: "",
rangeStart: e.rangeStart,
rangeEnd: "",
currentPanelHeight: 0,
offsetRangeStart: "",
offsetRangeEnd: ""
};
this.state = Object.assign(Object.assign({}, i), o),
this.foundation = new MonthsGridFoundation(this.adapter)
}
get dateAdapter() {
return {
updateDaySelected: e => this.setState({
selected: e
})
}
}
get rangeAdapter() {
return {
setRangeStart: e => this.setState({
rangeStart: e
}),
setRangeEnd: e => this.setState({
rangeEnd: e
}),
setHoverDay: e => this.setState({
hoverDay: e
}),
setWeeksHeight: e => this.setState({
maxWeekNum: e
}),
setOffsetRangeStart: e => this.setState({
offsetRangeStart: e
}),
setOffsetRangeEnd: e => this.setState({
offsetRangeEnd: e
})
}
}
get adapter() {
return Object.assign(Object.assign(Object.assign(Object.assign({},
super.adapter), this.dateAdapter), this.rangeAdapter), {
updateMonthOnLeft: e => this.setState({
monthLeft: e
}),
updateMonthOnRight: e => this.setState({
monthRight: e
}),
notifySelectedChange: (e, t) => this.props.onChange(e, t),
notifyMaxLimit: e => this.props.onMaxSelect(e),
notifyPanelChange: (e, t) => this.props.onPanelChange(e, t),
setRangeInputFocus: e => this.props.setRangeInputFocus(e),
isAnotherPanelHasOpened: e =>
this.props.isAnotherPanelHasOpened(e)
})
}
componentDidMount() {
super.componentDidMount()
}
componentDidUpdate(e, t) {
const {defaultValue: r, defaultPickerValue: n} = this.props;
e.defaultValue !== r && this.foundation.updateSelectedFromProps(r),
e.defaultPickerValue !== n &&
this.foundation.initDefaultPickerValue();
if (this.foundation.isRangeType()) {
const e = this.leftIsYearOrTime(t) && this.rightIsYearOrTime(t)
, r = this.leftIsYearOrTime(t) && !this.rightIsYearOrTime(t)
|| !this.leftIsYearOrTime(t) && this.rightIsYearOrTime(t)
, n = this.leftIsYearOrTime() && this.rightIsYearOrTime()
, i = this.leftIsYearOrTime() && !this.rightIsYearOrTime() ||
!this.leftIsYearOrTime() && this.rightIsYearOrTime()
, o = e && i;
r && n ? this.setState({
currentPanelHeight: this.calcScrollListHeight()
}, this.reselect) : o && this.reselect()
}
}
renderPanel(e, t) {
let r = classNames(`${prefixCls$i}-month-grid-${t}`);
const {monthLeft: n, monthRight: i, currentPanelHeight: o} =
this.state
,{insetInput: s} = this.props
,a = t === strings$g.PANEL_TYPE_RIGHT ? i : n
,{isTimePickerOpen: l, isYearPickerOpen: c} = a
,u = this.renderMonth(e, t)
,d = c ? React.createElement("div", {
className: `${prefixCls$i}-yam`
}, this.renderYearAndMonth(t, a)) : null
, p = l ? React.createElement("div", {
className: `${prefixCls$i}-tpk`
}, this.renderTimePicker(t, a)) : null
, h = {}
, f = this.adapter.getCache(`wrap-${strings$g.PANEL_TYPE_LEFT}`)
, m = this.adapter.getCache(`wrap-${strings$g.PANEL_TYPE_RIGHT}`)
, g = t === strings$g.PANEL_TYPE_RIGHT ? m : f;
this.foundation.isRangeType() ? ((c || l) && (h.minWidth =
g.getBoundingClientRect().width),
this.leftIsYearOrTime() && this.rightIsYearOrTime() && !s &&
(h.minHeight = o || this.calcScrollListHeight())) : "year" !== this.props.type &&
"month" !== this.props.type && (l || c) && (r = classNames(r, `${prefixCls$i}-yam-
showing`));
const y = !(c || l) ? "date" : c ? "year" : "time";
return React.createElement("div", {
className: r,
key: t,
style: h,
"x-open-type": y
}, d, p, this.foundation.isRangeType() ? u : c || l ? null : u,
this.renderSwitch(t))
}
showYearPicker(e, t) {
t.nativeEvent.stopImmediatePropagation(),
this.foundation.showYearPicker(e)
}
renderMonth(e, t) {
const {selected: r, rangeStart: n, rangeEnd: i, hoverDay: o,
maxWeekNum: s, offsetRangeStart: a, offsetRangeEnd: l} = this.state
, {weekStartsOn: c, disabledDate: u, locale: d, localeCode: p,
renderDate: h, renderFullDate: f, startDateOffset: m, endDateOffset: g, density: y,
rangeInputFocus: v, syncSwitchMonth: b, multiple: x} = this.props;
let _ = "";
if (e) {
const t = e ? format$3(e, "yyyy") : ""
, r = e ? format$3(e, "L") : ""
, n = d.months[r];
_ = d.monthText.replace("${year}", t).replace("${month}", n)
}
let E = {};
const T = t === strings$g.PANEL_TYPE_RIGHT ?
this.state.monthRight : this.state.monthLeft
, C = this.foundation.isRangeType()
, S = C && b;
return C && T && (T.isYearPickerOpen || T.isTimePickerOpen) && (E =
{
visibility: "hidden",
position: "absolute",
pointerEvents: "none"
}),
React.createElement("div", {
ref: e => this.cacheRefCurrent(`wrap-${t}`, e),
style: E
}, React.createElement(Navigation, {
forwardRef: e => this.cacheRefCurrent(`nav-${t}`, e),
monthText: _,
density: y,
onMonthClick: e => this.showYearPicker(t, e),
onPrevMonth: () => this.foundation.prevMonth(t),
onNextMonth: () => this.foundation.nextMonth(t),
onNextYear: () => this.foundation.nextYear(t),
onPrevYear: () => this.foundation.prevYear(t),
shouldBimonthSwitch: S,
panelType: t
}), React.createElement(Month, {
locale: d,
localeCode: p,
forwardRef: e => this.cacheRefCurrent(`month-${t}`, e),
disabledDate: u,
weekStartsOn: c,
month: e,
selected: r,
rangeStart: n,
rangeEnd: i,
rangeInputFocus: v,
offsetRangeStart: a,
offsetRangeEnd: l,
hoverDay: o,
weeksRowNum: s,
renderDate: h,
renderFullDate: f,
onDayClick: e => this.foundation.handleDayClick(e, t),
onDayHover: e => this.foundation.handleDayHover(e, t),
onWeeksRowNumChange: e => this.handleWeeksRowNumChange(e, t),
startDateOffset: m,
endDateOffset: g,
focusRecordsRef: this.props.focusRecordsRef,
multiple: x
}))
}
renderTimePicker(e, t) {
const {type: r, locale: n, format: i, hideDisabledOptions: o,
timePickerOpts: s, dateFnsLocale: a} = this.props
, {pickerDate: l} = t
, c = classNames(`${prefixCls$i}-time`)
, u = Object.assign(Object.assign({}, s), {
hideDisabledOptions: o
})
, d = this.foundation.calcDisabledTime(e);
d && ["disabledHours", "disabledMinutes",
"disabledSeconds"].forEach((e => {
d[e] && (u[e] = d[e])
}
));
const {rangeStart: p, rangeEnd: h} = this.state
, f = this.foundation.getValidDateFormat();
let m, g;
"dateTimeRange" === r && p && h && isSameDay$1(m =
compatibleParse(p, f, void 0, a), g = compatibleParse(h, f, void 0, a)) && (e ===
strings$g.PANEL_TYPE_RIGHT ? p && (u.startDate = m) : h && (u.endDate = g));
const y = n.selectTime;
return React.createElement("div", {
className: c
}, React.createElement(Combobox$1, Object.assign({
ref: t => this.cacheRefCurrent(`timepicker-${e}`, t),
panelHeader: y,
format: i || strings$g.FORMAT_TIME_PICKER,
timeStampValue: l,
onChange: t => this.foundation.handleTimeChange(t, e)
}, u)))
}
renderYearAndMonth(e, t) {
const {pickerDate: r} = t
, {locale: n, localeCode: i, density: o, yearAndMonthOpts: s,
startYear: a, endYear: l} = this.props
, c = r.getFullYear()
, u = r.getMonth() + 1;
return React.createElement(YearAndMonth$1, {
ref: t => this.cacheRefCurrent(`yam-${e}`, t),
locale: n,
localeCode: i,
currentYear: {
left: c,
right: 0
},
currentMonth: {
left: u,
right: 0
},
onSelect: t => this.foundation.toYearMonth(e, new
Date(t.currentYear.left,t.currentMonth.left - 1)),
onBackToMain: () => {
this.foundation.showDatePanel(e);
const t = this.adapter.getCache(`wrap-${e}`);
t && (t.style.height = "auto")
}
,
density: o,
yearAndMonthOpts: s,
startYear: a,
endYear: l
})
}
renderSwitch(e) {
const {rangeStart: t, rangeEnd: r, monthLeft: n, monthRight: i} =
this.state
, {type: o, locale: s, disabledTimePicker: a, density: l,
dateFnsLocale: c, insetInput: u} = this.props;
if (!o.includes("Time") || u)
return null;
let d, p;
const {FORMAT_SWITCH_DATE: h} = s.localeFormatToken
, f = this.foundation.getValidTimeFormat()
, m = this.foundation.getValidDateFormat();
e === strings$g.PANEL_TYPE_LEFT ? (d = n,
p = t ? format$3(compatibleParse(t, m, void 0, c), h) : "") : (d =
i,
p = r ? format$3(compatibleParse(r, m, void 0, c), h) : "");
const {isTimePickerOpen: g, showDate: y} = d
, v = y ? format$3(y, h) : ""
, b = y ? format$3(y, f) : ""
, x = ["default"].includes(l)
, _ = classNames(`${prefixCls$i}-switch`)
, E = classNames({
[`${prefixCls$i}-switch-date`]: !0,
[`${prefixCls$i}-switch-date-active`]: !g
})
, T = classNames({
[`${prefixCls$i}-switch-time`]: !0,
[`${prefixCls$i}-switch-time-disabled`]: a,
[`${prefixCls$i}-switch-date-active`]: g
})
, C = classNames(`${prefixCls$i}-switch-text`);
return React.createElement("div", {
className: _,
ref: t => this.adapter.setCache(`switch-${e}`, t)
}, React.createElement("div", {
role: "button",
"aria-label": "Switch to date panel",
className: E,
onClick: t => this.foundation.showDatePanel(e)
}, x && React.createElement(IconCalendar, {
"aria-hidden": !0
}), React.createElement("span", {
className: C
}, p || v)), React.createElement("div", {
role: "button",
"aria-label": "Switch to time panel",
className: T,
onClick: t => this.foundation.showTimePicker(e, !0)
}, x && React.createElement(IconClock, {
"aria-hidden": !0
}), React.createElement("span", {
className: C
}, b)))
}
render() {
const {monthLeft: e, monthRight: t} = this.state
, {type: r, insetInput: n, presetPosition: i,
renderQuickControls: o, renderDateInput: s} = this.props
, a = classNames({
[`${prefixCls$i}-month-grid`]: !0
})
, l = strings$g.PANEL_TYPE_LEFT
, c = strings$g.PANEL_TYPE_RIGHT;
let u = null;
"date" === r || "dateTime" === r ? u =
this.renderPanel(e.pickerDate, l) : "dateRange" === r || "dateTimeRange" === r ? u
= [this.renderPanel(e.pickerDate, l), this.renderPanel(t.pickerDate, c)] : "year" !
== r && "month" !== r || (u = "year month");
const d = this.getYAMOpenType();
return React.createElement("div", {
style: {
display: "flex"
}
}, "left" === i && o, React.createElement("div", null, s,
React.createElement("div", {
className: a,
"x-type": r,
"x-panel-yearandmonth-open-type": d,
"x-insetinput": n ? "true" : "false",
"x-preset-position": null === o ? "null" : i,
ref: e => this.cacheRefCurrent("monthGrid", e)
}, u)), "right" === i && o)
}
}
MonthsGrid.propTypes = {
type: PropTypes.oneOf(strings$g.TYPE_SET),
defaultValue: PropTypes.array,
defaultPickerValue: PropTypes.oneOfType([PropTypes.string,
PropTypes.number, PropTypes.object, PropTypes.array]),
multiple: PropTypes.bool,
max: PropTypes.number,
weekStartsOn: PropTypes.number,
disabledDate: PropTypes.func,
disabledTime: PropTypes.func,
disabledTimePicker: PropTypes.bool,
hideDisabledOptions: PropTypes.bool,
navPrev: PropTypes.node,
navNext: PropTypes.node,
onMaxSelect: PropTypes.func,
timePickerOpts: PropTypes.object,
isControlledComponent: PropTypes.bool,
rangeStart: PropTypes.oneOfType([PropTypes.string]),
rangeInputFocus: PropTypes.oneOfType([PropTypes.bool,
PropTypes.string]),
locale: PropTypes.object,
localeCode: PropTypes.string,
format: PropTypes.string,
renderDate: PropTypes.func,
renderFullDate: PropTypes.func,
startDateOffset: PropTypes.func,
endDateOffset: PropTypes.func,
autoSwitchDate: PropTypes.bool,
density: PropTypes.string,
dateFnsLocale: PropTypes.object.isRequired,
timeZone: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
syncSwitchMonth: PropTypes.bool,
onPanelChange: PropTypes.func,
focusRecordsRef: PropTypes.object,
triggerRender: PropTypes.func,
presetPosition: PropTypes.oneOf(strings$g.PRESET_POSITION_SET),
renderQuickControls: PropTypes.node,
renderDateInput: PropTypes.node
},
MonthsGrid.defaultProps = {
type: "date",
rangeStart: "",
multiple: !1,
weekStartsOn: numbers$8.WEEK_START_ON,
disabledDate: _stubFalse,
onMaxSelect: _noop,
locale: {}
};
const prefixCls$h = cssClasses$l.PREFIX
, {Text: Text$2} = Typography$1;
class QuickControl extends reactExports.PureComponent {
render() {
const {presets: e, onPresetClick: t, type: r, presetPosition: n,
insetInput: i, locale: o} = this.props
, s = "top" === n || "bottom" === n
, a = s && ("dateRange" === r || "dateTimeRange" === r)
, l = s && "month" === r
, c = classNames(`${prefixCls$h}-quick-control`, {
[`${prefixCls$h}-quick-control-${r}`]: r,
[`${prefixCls$h}-quick-control-${n}`]: !0
})
, u = classNames({
[`${prefixCls$h}-quick-control-header`]: !0
})
, d = classNames({
[`${prefixCls$h}-quick-control-${n}-content-wrapper`]: !0
})
, p = classNames({
[`${prefixCls$h}-quick-control-${n}-content`]: !a && !l,
[`${prefixCls$h}-quick-control-${n}-range-content`]: a,
[`${prefixCls$h}-quick-control-${n}-month-content`]: l
})
, h = classNames({
[`${prefixCls$h}-quick-control-${n}-content-item`]: !a && !l,
[`${prefixCls$h}-quick-control-${n}-range-content-item`]: a,
[`${prefixCls$h}-quick-control-${n}-month-content-item`]: l
})
, f = classNames({
[`${prefixCls$h}-quick-control-${n}-content-item-ellipsis`]: !a
&& !l,
[`${prefixCls$h}-quick-control-${n}-range-content-item-
ellipsis`]: a,
[`${prefixCls$h}-quick-control-${n}-month-content-item-
ellipsis`]: l
});
return e.length ? React.createElement("div", {
className: c,
"x-insetinput": i ? "true" : "false"
}, !s && React.createElement("div", {
className: u
}, o.presets), React.createElement("div", {
className: d
}, React.createElement("div", {
className: p
}, e.map(( (e, r) => {
const n = "function" == typeof e ? e() : e;
return React.createElement(Button$1, {
size: "small",
type: "primary",
onClick: e => t(n, e),
key: r
}, React.createElement("div", {
className: h
}, React.createElement(Text$2, {
ellipsis: {
showTooltip: !0
},
className: f
}, n.text)))
}
))))) : null
}
}
QuickControl.propTypes = {
presets: PropTypes.array,
presetPosition: PropTypes.oneOf(strings$g.PRESET_POSITION_SET),
onPresetClick: PropTypes.func,
type: PropTypes.string,
insetInput: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
locale: PropTypes.object
},
QuickControl.defaultProps = {
presets: [],
presetPosition: "bottom",
onPresetClick: noop$2
};
const QuickControl$1 = QuickControl;
function Footer() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {};
const {prefixCls: t, locale: r, onCancelClick: n, onConfirmClick: i} =
e
, o = classNames(`${t}-footer`);
return React.createElement("div", {
className: o
}, React.createElement(Button$1, {
theme: "borderless",
onClick: n
}, _get(r, "footer.cancel", "")), React.createElement(Button$1, {
theme: "solid",
onClick: i
}, _get(r, "footer.confirm", "")))
}
const datePicker = "";
var __rest$F = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
let DatePicker$1 = class extends BaseComponent {
constructor(e) {
var t;
super(e),
t = this,
this.setTriggerRef = e => this.triggerElRef.current = e,
this.handleSelectedChange = (e, t) =>
this.foundation.handleSelectedChange(e, t),
this.handleYMSelectedChange = e =>
this.foundation.handleYMSelectedChange(e),
this.disabledDisposeDate = function(e) {
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 :
0), i = 1; i < r; i++)
n[i - 1] = arguments[i];
return t.foundation.disabledDisposeDate(e, ...n)
}
,
this.disabledDisposeTime = function(e) {
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 :
0), i = 1; i < r; i++)
n[i - 1] = arguments[i];
return t.foundation.disabledDisposeTime(e, ...n)
}
,
this.handleOpenPanel = () => this.foundation.openPanel(),
this.handleInputChange = function() {
return t.foundation.handleInputChange(...arguments)
}
,
this.handleInsetInputChange = e =>
this.foundation.handleInsetInputChange(e),
this.handleInputComplete = e =>
this.foundation.handleInputComplete(e),
this.handleInputBlur = e => this.foundation.handleInputBlur(_get(e,
"nativeEvent.target.value"), e),
this.handleInputFocus = function() {
return t.foundation.handleInputFocus(...arguments)
}
,
this.handleInputClear = e => this.foundation.handleInputClear(e),
this.handleTriggerWrapperClick = e =>
this.foundation.handleTriggerWrapperClick(e),
this.handleSetRangeFocus = e =>
this.foundation.handleSetRangeFocus(e),
this.handleRangeInputBlur = (e, t) =>
this.foundation.handleRangeInputBlur(e, t),
this.handleRangeInputClear = e =>
this.foundation.handleRangeInputClear(e),
this.handleRangeEndTabPress = e =>
this.foundation.handleRangeEndTabPress(e),
this.isAnotherPanelHasOpened = e => "rangeStart" === e ?
this.focusRecordsRef.current.rangeEnd : this.focusRecordsRef.current.rangeStart,
this.handleInsetDateFocus = (e, t) => {
const r = _get(this, "monthGrid.current.foundation");
r && (r.showDatePanel(strings$g.PANEL_TYPE_LEFT),
r.showDatePanel(strings$g.PANEL_TYPE_RIGHT)),
this.handleInputFocus(e, t)
}
,
this.handleInsetTimeFocus = () => {
const e = _get(this, "monthGrid.current.foundation");
e && (e.showTimePicker(strings$g.PANEL_TYPE_LEFT),
e.showTimePicker(strings$g.PANEL_TYPE_RIGHT))
}
,
this.handlePanelVisibleChange = e => {
this.foundation.handlePanelVisibleChange(e)
}
,
this.handleConfirm = e => this.foundation.handleConfirm(),
this.handleCancel = e => this.foundation.handleCancel(),
this.renderFooter = (e, t) => this.adapter.needConfirm() ?
React.createElement(Footer, Object.assign({}, this.props, {
locale: e,
localeCode: t,
onConfirmClick: this.handleConfirm,
onCancelClick: this.handleCancel
})) : null,
this.renderPanel = (e, t, r) => {
const {dropdownClassName: n, dropdownStyle: i, density: o,
topSlot: s, bottomSlot: a, presetPosition: l, type: c, leftSlot: u, rightSlot: d} =
this.props
, p = classNames(cssClasses$l.PREFIX, {
[cssClasses$l.PANEL_YAM]: this.adapter.typeIsYearOrMonth(),
[`${cssClasses$l.PREFIX}-compact`]: "compact" === o
}, n);
return React.createElement("div", {
ref: this.panelRef,
className: p,
style: i,
"x-type": c
}, React.createElement("div", {
className: `${cssClasses$l.PREFIX}-container`
}, u && React.createElement("div", {
className: `${cssClasses$l.PREFIX}-leftSlot`,
"x-semi-prop": "leftSlot"
}, u), React.createElement("div", null, s &&
React.createElement("div", {
className: `${cssClasses$l.PREFIX}-topSlot`,
"x-semi-prop": "topSlot"
}, s), "top" === l && "monthRange" !== c &&
this.renderQuickControls(), this.adapter.typeIsYearOrMonth() ?
this.renderYearMonthPanel(e, t) : this.renderMonthGrid(e, t, r), "bottom" === l &&
"monthRange" !== c && this.renderQuickControls(), a && React.createElement("div", {
className: `${cssClasses$l.PREFIX}-bottomSlot`,
"x-semi-prop": "bottomSlot"
}, a)), d && React.createElement("div", {
className: `${cssClasses$l.PREFIX}-rightSlot`,
"x-semi-prop": "rightSlot"
}, d)), this.renderFooter(e, t))
}
,
this.renderYearMonthPanel = (e, t) => {
const {density: r, presetPosition: n, yearAndMonthOpts: i,
type: o, startYear: s, endYear: a} = this.props
, l = this.state.value[0]
, c = {
left: 0,
right: 0
}
, u = {
left: 0,
right: 0
};
if (_isDate(l) && (c.left = l.getFullYear(),
u.left = l.getMonth() + 1),
"monthRange" === o) {
const e = this.state.value[1];
_isDate(e) && (c.right = e.getFullYear(),
u.right = e.getMonth() + 1)
}
return React.createElement(YearAndMonth$1, {
locale: e,
localeCode: t,
disabledDate: this.disabledDisposeDate,
noBackBtn: !0,
monthCycled: !0,
onSelect: this.handleYMSelectedChange,
currentYear: c,
currentMonth: u,
density: r,
presetPosition: n,
renderQuickControls: this.renderQuickControls(),
renderDateInput: this.renderDateInput(),
type: o,
yearAndMonthOpts: i,
startYear: s,
endYear: a
})
}
,
this.wrapPopover = e => {
const {panelShow: t} = this.state
, {direction: r} = this.context
, n = "rtl" === r ? "bottomRight" : "bottomLeft"
, {motion: i, zIndex: o, position: s=n, getPopupContainer: a,
locale: l, localeCode: c, dateFnsLocale: u, stopPropagation: d, autoAdjustOverflow:
p, spacing: h, dropdownMargin: f} = this.props;
return React.createElement(Popover$1, {
getPopupContainer: a,
autoAdjustOverflow: p,
zIndex: o,
motion: i,
margin: f,
content: this.renderPanel(l, c, u),
trigger: "custom",
position: s,
visible: t,
stopPropagation: d,
spacing: h,
onVisibleChange: this.handlePanelVisibleChange
}, e)
}
,
this.state = {
panelShow: e.open || e.defaultOpen,
isRange: !1,
inputValue: null,
value: [],
cachedSelectedValue: [],
prevTimeZone: null,
rangeInputFocus: void 0,
autofocus: e.autoFocus || this.isRangeType(e.type,
e.triggerRender) && (e.open || e.defaultOpen),
insetInputValue: null,
triggerDisabled: void 0
},
this.triggerElRef = React.createRef(),
this.panelRef = React.createRef(),
this.monthGrid = React.createRef(),
this.inputRef = React.createRef(),
this.rangeInputStartRef = React.createRef(),
this.rangeInputEndRef = React.createRef(),
this.focusRecordsRef = React.createRef(),
this.focusRecordsRef.current = {
rangeStart: !1,
rangeEnd: !1
},
this.foundation = new DatePickerFoundation(this.adapter)
}
get adapter() {
var e = this;
return Object.assign(Object.assign({}, super.adapter), {
togglePanel: (e, t) => {
this.setState({
panelShow: e
}, t),
e || (this.focusRecordsRef.current.rangeEnd = !1,
this.focusRecordsRef.current.rangeStart = !1)
}
,
registerClickOutSide: () => {
this.clickOutSideHandler &&
(this.adapter.unregisterClickOutSide(),
this.clickOutSideHandler = null),
this.clickOutSideHandler = e => {
const t = this.triggerElRef &&
this.triggerElRef.current
, r = this.panelRef && this.panelRef.current
, n = e.target
, i = e.composedPath && e.composedPath() || [n];
t && t.contains(n) || r && r.contains(n) ||
i.includes(t) || i.includes(r) || (this.props.onClickOutSide(),
this.adapter.needConfirm() ||
this.foundation.closePanel(e))
}
,
document.addEventListener("mousedown",
this.clickOutSideHandler)
}
,
unregisterClickOutSide: () => {
document.removeEventListener("mousedown",
this.clickOutSideHandler)
}
,
notifyBlur: function() {
return e.props.onBlur(...arguments)
},
notifyFocus: function() {
return e.props.onFocus(...arguments)
},
notifyClear: function() {
return e.props.onClear(...arguments)
},
notifyChange: function() {
return e.props.onChange(...arguments)
},
notifyCancel: function() {
return e.props.onCancel(...arguments)
},
notifyConfirm: function() {
return e.props.onConfirm(...arguments)
},
notifyOpenChange: function() {
return e.props.onOpenChange(...arguments)
},
notifyPresetsClick: function() {
return e.props.onPresetClick(...arguments)
},
updateValue: e => this.setState({
value: e
}),
updatePrevTimezone: e => this.setState({
prevTimeZone: e
}),
updateCachedSelectedValue: e => {
let t = e;
e && !Array.isArray(e) && (t = [...e]),
this.setState({
cachedSelectedValue: t
})
}
,
updateInputValue: e => {
this.setState({
inputValue: e
})
}
,
updateInsetInputValue: e => {
const {insetInput: t} = this.props;
t && !_isEqual(e, this.state.insetInputValue) &&
this.setState({
insetInputValue: e
})
}
,
needConfirm: () => ["dateTime",
"dateTimeRange"].includes(this.props.type) && !0 === this.props.needConfirm,
typeIsYearOrMonth: () => ["month", "year",
"monthRange"].includes(this.props.type),
setRangeInputFocus: e => {
const {preventScroll: t} = this.props;
switch (e !== this.state.rangeInputFocus && this.setState({
rangeInputFocus: e
}),
e) {
case "rangeStart":
const e = _get(this, "rangeInputStartRef.current");
e && e.focus({
preventScroll: t
}),
setTimeout(( () => {
this.focusRecordsRef.current.rangeStart = !0
}
), 0);
break;
case "rangeEnd":
const r = _get(this, "rangeInputEndRef.current");
r && r.focus({
preventScroll: t
}),
setTimeout(( () => {
this.focusRecordsRef.current.rangeEnd = !0
}
), 0);
break;
default:
return
}
}
,
couldPanelClosed: () => this.focusRecordsRef.current.rangeStart
&& this.focusRecordsRef.current.rangeEnd,
isEventTarget: e => e && e.target === e.currentTarget,
setInsetInputFocus: () => {
const {preventScroll: e} = this.props
, {rangeInputFocus: t} = this.state;
if ("rangeEnd" === t) {
if (document.activeElement !==
this.rangeInputEndRef.current) {
const t = _get(this, "rangeInputEndRef.current");
t && t.focus({
preventScroll: e
})
}
} else if (document.activeElement !==
this.rangeInputStartRef.current) {
const t = _get(this, "rangeInputStartRef.current");
t && t.focus({
preventScroll: e
})
}
}
,
setInputFocus: () => {
const {preventScroll: e} = this.props
, t = _get(this, "inputRef.current");
t && t.focus({
preventScroll: e
})
}
,
setInputBlur: () => {
const e = _get(this, "inputRef.current");
e && e.blur()
}
,
setRangeInputBlur: () => {
const {rangeInputFocus: e} = this.state;
if ("rangeStart" === e) {
const e = _get(this, "rangeInputStartRef.current");
e && e.blur()
} else if ("rangeEnd" === e) {
const e = _get(this, "rangeInputEndRef.current");
e && e.blur()
}
this.adapter.setRangeInputFocus(!1)
}
,
setTriggerDisabled: e => {
this.setState({
triggerDisabled: e
})
}
})
}
isRangeType(e, t) {
return /range/i.test(e) && !_isFunction(t)
}
componentDidUpdate(e) {
_isEqual(e.value, this.props.value) ? this.props.timeZone !==
e.timeZone && this.foundation.initFromProps({
value: this.state.value,
timeZone: this.props.timeZone,
prevTimeZone: e.timeZone
}) : this.foundation.initFromProps(Object.assign({}, this.props)),
e.open !== this.props.open &&
(this.foundation.initPanelOpenStatus(),
this.props.open || this.foundation.clearRangeInputFocus())
}
componentDidMount() {
this._mounted = !0,
super.componentDidMount()
}
componentWillUnmount() {
this._mounted = !1,
super.componentWillUnmount()
}
open() {
this.foundation.open()
}
close() {
this.foundation.close()
}
focus(e) {
this.foundation.focus(e)
}
blur() {
this.foundation.blur()
}
renderMonthGrid(e, t, r) {
const {type: n, multiple: i, max: o, weekStartsOn: s,
timePickerOpts: a, defaultPickerValue: l, format: c, hideDisabledOptions: u,
disabledTimePicker: d, renderDate: p, renderFullDate: h, startDateOffset: f,
endDateOffset: m, autoSwitchDate: g, density: y, syncSwitchMonth: v, onPanelChange:
b, timeZone: x, triggerRender: _, insetInput: E, presetPosition: T,
yearAndMonthOpts: C, startYear: S, endYear: $} = this.props
, {cachedSelectedValue: w, rangeInputFocus: P} = this.state
, R = w;
return React.createElement(MonthsGrid, {
ref: this.monthGrid,
locale: e,
localeCode: t,
dateFnsLocale: r,
weekStartsOn: s,
type: n,
multiple: i,
max: o,
format: c,
disabledDate: this.disabledDisposeDate,
hideDisabledOptions: u,
disabledTimePicker: d,
disabledTime: this.disabledDisposeTime,
defaultValue: R,
defaultPickerValue: l,
timePickerOpts: a,
isControlledComponent: !this.adapter.needConfirm() &&
this.isControlled("value"),
onChange: this.handleSelectedChange,
renderDate: p,
renderFullDate: h,
startDateOffset: f,
endDateOffset: m,
autoSwitchDate: g,
density: y,
rangeInputFocus: P,
setRangeInputFocus: this.handleSetRangeFocus,
isAnotherPanelHasOpened: this.isAnotherPanelHasOpened,
syncSwitchMonth: v,
onPanelChange: b,
timeZone: x,
focusRecordsRef: this.focusRecordsRef,
triggerRender: _,
insetInput: E,
presetPosition: T,
renderQuickControls: this.renderQuickControls(),
renderDateInput: this.renderDateInput(),
yearAndMonthOpts: C,
startYear: S,
endYear: $
})
}
renderQuickControls() {
const {presets: e, type: t, presetPosition: r, insetInput: n,
locale: i} = this.props;
return React.createElement(QuickControl$1, {
type: t,
presets: e,
insetInput: n,
presetPosition: r,
onPresetClick: (e, t) => this.foundation.handlePresetClick(e,
t),
locale: i
})
}
renderDateInput() {
const {insetInput: e, dateFnsLocale: t, density: r, type: n,
format: i, rangeSeparator: o, defaultPickerValue: s} = this.props
, {insetInputValue: a, value: l} = this.state
, c = {
dateFnsLocale: t,
format: i,
insetInputValue: a,
rangeSeparator: o,
type: n,
value: l,
handleInsetDateFocus: this.handleInsetDateFocus,
handleInsetTimeFocus: this.handleInsetTimeFocus,
onInsetInputChange: this.handleInsetInputChange,
rangeInputStartRef: this.rangeInputStartRef,
rangeInputEndRef: this.rangeInputEndRef,
density: r,
defaultPickerValue: s
};
return e ? React.createElement(DateInput, Object.assign({}, c, {
insetInput: e
})) : null
}
renderInner(e) {
const {clearIcon: t, type: r, format: n, multiple: i, disabled: o,
showClear: s, insetLabel: a, insetLabelId: l, placeholder: c, validateStatus: u,
inputStyle: d, prefix: p, locale: h, dateFnsLocale: f, triggerRender: m, size: g,
inputReadOnly: y, rangeSeparator: v, insetInput: b, defaultPickerValue: x,
borderless: _} = this.props
, {value: E, inputValue: T, rangeInputFocus: C, triggerDisabled:
S} = this.state
, $ = this.isRangeType(r, m)
, w = o || b && S
, P = classNames(`${cssClasses$l.PREFIX}-input`, {
[`${cssClasses$l.PREFIX}-range-input`]: $,
[`${cssClasses$l.PREFIX}-range-input-${g}`]: $ && g,
[`${cssClasses$l.PREFIX}-range-input-active`]: $ && C && !w,
[`${cssClasses$l.PREFIX}-range-input-disabled`]: $ && w,
[`${cssClasses$l.PREFIX}-range-input-${u}`]: $ && u,
[`${cssClasses$l.PREFIX}-borderless`]: _
})
, R = c || h.placeholder[r]
, k = Object.assign(Object.assign({}, e), {
showClearIgnoreDisabled: Boolean(b),
placeholder: R,
clearIcon: t,
disabled: w,
inputValue: T,
value: E,
defaultPickerValue: x,
onChange: this.handleInputChange,
onEnterPress: this.handleInputComplete,
block: !0,
inputStyle: d,
showClear: s,
insetLabel: a,
insetLabelId: l,
type: r,
format: n,
multiple: i,
validateStatus: u,
inputReadOnly: y || Boolean(b),
onBlur: this.handleInputBlur,
onFocus: this.handleInputFocus,
onClear: this.handleInputClear,
prefix: p,
size: g,
autofocus: this.state.autofocus,
dateFnsLocale: f,
rangeInputFocus: C,
rangeSeparator: v,
onRangeBlur: this.handleRangeInputBlur,
onRangeClear: this.handleRangeInputClear,
onRangeEndTabPress: this.handleRangeEndTabPress,
rangeInputStartRef: b ? null : this.rangeInputStartRef,
rangeInputEndRef: b ? null : this.rangeInputEndRef,
inputRef: this.inputRef
});
return React.createElement("div", {
role: "combobox",
"aria-label": Array.isArray(E) && E.length ? "Change date" :
"Choose date",
"aria-disabled": o,
onClick: this.handleTriggerWrapperClick,
className: P
}, "function" == typeof m ? React.createElement(Trigger$1,
Object.assign({}, k, {
triggerRender: m,
componentName: "DatePicker",
componentProps: Object.assign({}, this.props)
})) : React.createElement(DateInput, Object.assign({}, k)))
}
render() {
const e = this.props
, {style: t, className: r, prefixCls: n, type: i} = e
, o = __rest$F(e, ["style", "className", "prefixCls", "type"])
, s = Object.assign({
style: t,
className: classNames(r, {
[n]: !0
}),
ref: this.setTriggerRef,
"aria-invalid": this.props["aria-invalid"],
"aria-errormessage": this.props["aria-errormessage"],
"aria-labelledby": this.props["aria-labelledby"],
"aria-describedby": this.props["aria-describedby"],
"aria-required": this.props["aria-required"]
}, this.getDataAttr(o))
, a = [];
i.toLowerCase().includes("range") || a.push("borderless");
const l = this.renderInner(_pick(this.props, a))
, c = this.wrapPopover(l);
return React.createElement("div", Object.assign({}, s), c)
}
}
;
DatePicker$1.contextType = ConfigContext$1,
DatePicker$1.propTypes = {
"aria-describedby": PropTypes.string,
"aria-errormessage": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-labelledby": PropTypes.string,
"aria-required": PropTypes.bool,
borderless: PropTypes.bool,
type: PropTypes.oneOf(strings$g.TYPE_SET),
size: PropTypes.oneOf(strings$g.SIZE_SET),
clearIcon: PropTypes.node,
density: PropTypes.oneOf(strings$g.DENSITY_SET),
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number,
PropTypes.object, PropTypes.array]),
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number,
PropTypes.object, PropTypes.array]),
defaultPickerValue: PropTypes.oneOfType([PropTypes.string,
PropTypes.number, PropTypes.object, PropTypes.array]),
disabledTime: PropTypes.func,
disabledTimePicker: PropTypes.bool,
hideDisabledOptions: PropTypes.bool,
format: PropTypes.string,
disabled: PropTypes.bool,
multiple: PropTypes.bool,
max: PropTypes.number,
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
presets: PropTypes.array,
presetPosition: PropTypes.oneOf(strings$g.PRESET_POSITION_SET),
onChange: PropTypes.func,
onChangeWithDateFirst: PropTypes.bool,
weekStartsOn: PropTypes.number,
disabledDate: PropTypes.func,
timePickerOpts: PropTypes.object,
showClear: PropTypes.bool,
onOpenChange: PropTypes.func,
open: PropTypes.bool,
defaultOpen: PropTypes.bool,
motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func,
PropTypes.object]),
className: PropTypes.string,
prefixCls: PropTypes.string,
prefix: PropTypes.node,
insetLabel: PropTypes.node,
insetLabelId: PropTypes.string,
zIndex: PropTypes.number,
position: PropTypes.oneOf(strings$s.POSITION_SET),
getPopupContainer: PropTypes.func,
onCancel: PropTypes.func,
onConfirm: PropTypes.func,
needConfirm: PropTypes.bool,
inputStyle: PropTypes.object,
timeZone: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
triggerRender: PropTypes.func,
stopPropagation: PropTypes.oneOfType([PropTypes.bool,
PropTypes.string]),
autoAdjustOverflow: PropTypes.bool,
onBlur: PropTypes.func,
onFocus: PropTypes.func,
onClear: PropTypes.func,
style: PropTypes.object,
autoFocus: PropTypes.bool,
inputReadOnly: PropTypes.bool,
validateStatus: PropTypes.oneOf(strings$g.STATUS),
renderDate: PropTypes.func,
renderFullDate: PropTypes.func,
spacing: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
startDateOffset: PropTypes.func,
endDateOffset: PropTypes.func,
autoSwitchDate: PropTypes.bool,
dropdownClassName: PropTypes.string,
dropdownStyle: PropTypes.object,
dropdownMargin: PropTypes.oneOfType([PropTypes.number,
PropTypes.object]),
topSlot: PropTypes.node,
bottomSlot: PropTypes.node,
dateFnsLocale: PropTypes.object,
syncSwitchMonth: PropTypes.bool,
onPanelChange: PropTypes.func,
rangeSeparator: PropTypes.string,
preventScroll: PropTypes.bool,
yearAndMonthOpts: PropTypes.object,
onClickOutSide: PropTypes.func
},
DatePicker$1.__SemiComponentName__ = "DatePicker",
DatePicker$1.defaultProps =
getDefaultPropsFromGlobalConfig(DatePicker$1.__SemiComponentName__, {
onChangeWithDateFirst: !0,
borderless: !1,
autoAdjustOverflow: !0,
stopPropagation: !0,
motion: !0,
prefixCls: cssClasses$l.PREFIX,
presetPosition: "bottom",
zIndex: numbers$a.DEFAULT_Z_INDEX,
type: "date",
size: "default",
density: "default",
multiple: !1,
defaultOpen: !1,
disabledHours: _noop,
disabledMinutes: _noop,
disabledSeconds: _noop,
hideDisabledOptions: !1,
onBlur: _noop,
onFocus: _noop,
onClear: _noop,
onCancel: _noop,
onConfirm: _noop,
onChange: _noop,
onOpenChange: _noop,
onPanelChange: _noop,
onPresetClick: _noop,
weekStartsOn: numbers$8.WEEK_START_ON,
disabledDate: _stubFalse,
disabledTime: _stubFalse,
inputReadOnly: !1,
spacing: numbers$8.SPACING,
autoSwitchDate: !0,
syncSwitchMonth: !1,
rangeSeparator: strings$g.DEFAULT_SEPARATOR_RANGE,
insetInput: !1,
onClickOutSide: _noop
});
const DatePicker = forwardStatics(React.forwardRef(( (e, t) => {
const r = Object.assign({}, e)
, {type: n, format: i, rangeSeparator: o} = r;
return "string" == typeof i && i && (/[Hhms]+/.test(i) || ("dateTime"
=== n ? r.type = "date" : "dateTimeRange" === n && (r.type = "dateRange"))),
o && "string" == typeof o && (r.rangeSeparator = ` ${o.trim()} `),
r.insetInput && (r.position || (r.position =
strings$g.POSITION_INLINE_INPUT),
r.position.includes("Over") && !r.spacing && (r.spacing =
numbers$8.SPACING_INSET_INPUT)),
React.createElement(ConfigContext$1.Consumer, null, (e => {
let {timeZone: n} = e;
return React.createElement(LocaleConsumer, {
componentName: "DatePicker"
}, ( (e, i, o) => React.createElement(DatePicker$1, Object.assign({
timeZone: n,
localeCode: i,
locale: e,
dateFnsLocale: o
}, r, {
ref: t
}))))
}
))
}
)), DatePicker$1)
, cssClasses$i = {
PREFIX: `${BASE_CLASS_PREFIX$1}`
}
, divider = "";
var __rest$E = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$g = cssClasses$i.PREFIX
, Divider = e => {
const {layout: t="horizontal", dashed: r, align: n="center", className:
i, margin: o, style: s, children: a} = e
, l = __rest$E(e, ["layout", "dashed", "align", "className",
"margin", "style", "children"])
, c = classNames(`${prefixCls$g}-divider`, i, {
[`${prefixCls$g}-divider-horizontal`]: "horizontal" === t,
[`${prefixCls$g}-divider-vertical`]: "vertical" === t,
[`${prefixCls$g}-divider-dashed`]: !!r,
[`${prefixCls$g}-divider-with-text`]: a && "horizontal" === t,
[`${prefixCls$g}-divider-with-text-${n}`]: a && "horizontal" === t
});
let u = {};
return void 0 !== o && ("vertical" === t ? u = {
marginLeft: o,
marginRight: o
} : "horizontal" === t && (u = {
marginTop: o,
marginBottom: o
})),
React.createElement("div", Object.assign({}, l, {
className: c,
style: Object.assign(Object.assign({}, u), s)
}), a && "horizontal" === t ? "string" == typeof a ?
React.createElement("span", {
className: `${prefixCls$g}-divider_inner-text`,
"x-semi-prop": "children"
}, a) : a : null)
}
, Divider$1 = Divider
, cssClasses$h = {
PREFIX: `${BASE_CLASS_PREFIX$1}-empty`
}
, empty$3 = "";
var __rest$D = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$f = cssClasses$h.PREFIX;
class Empty extends BaseComponent {
constructor(e) {
super(e),
this.observe = e => {
for (const t of e)
"attributes" === t.type && "theme-mode" === t.attributeName
&& this.updateMode()
}
,
this.updateMode = () => {
const e = this.body.getAttribute("theme-mode");
e !== this.state.mode && this.setState({
mode: e
})
}
,
this.state = {
mode: null
}
}
componentDidMount() {
if (this.props.darkModeImage) {
this.body = window.document.body,
this.updateMode();
const e = {
attributes: !0,
childList: !1,
subtree: !1
};
this.observer = new MutationObserver(this.observe),
this.observer.observe(this.body, e)
}
}
componentWillUnmount() {
this.observer && this.observer.disconnect()
}
render() {
const e = this.props
, {className: t, image: r, description: n, style: i, title: o,
imageStyle: s, children: a, layout: l, darkModeImage: c} = e
, u = __rest$D(e, ["className", "image", "description", "style",
"title", "imageStyle", "children", "layout", "darkModeImage"])
, d = "string" == typeof n ? n : "empty"
, p = "dark" === this.state.mode && c ? c : r;
let h = null;
h = "string" == typeof p ? React.createElement("img", {
alt: d,
src: p
}) : p && "id"in p ? React.createElement("svg", {
"aria-hidden": "true"
}, React.createElement("use", {
xlinkHref: `#${p.id}`
})) : p;
const f = classNames(t, prefixCls$f, {
[`${prefixCls$f}-${l}`]: l
})
, m = h ? {
heading: 4
} : {
heading: 6,
style: {
fontWeight: 400
}
};
return React.createElement("div", Object.assign({
className: f,
style: i
}, this.getDataAttr(u)), React.createElement("div", {
className: `${prefixCls$f}-image`,
style: s,
"x-semi-prop": "image,darkModeImage"
}, h), React.createElement("div", {
className: `${prefixCls$f}-content`
}, o ? React.createElement(Typography$1.Title, Object.assign({}, m,
{
className: `${prefixCls$f}-title`,
"x-semi-prop": "title"
}), o) : null, n ? React.createElement("div", {
className: `${prefixCls$f}-description`,
"x-semi-prop": "description"
}, n) : null, a ? React.createElement("div", {
className: `${prefixCls$f}-footer`,
"x-semi-prop": "children"
}, a) : null))
}
}
Empty.defaultProps = {
layout: "vertical"
};
const modal = ""
, cssClasses$g = {
DIALOG: `${BASE_CLASS_PREFIX$1}-modal`
}
, strings$d = {
cancelKey: "cancel",
confirmKey: "confirm",
SIZE: ["small", "medium", "large", "full-width"],
directions: ["ltr", "rtl"]
};
function isObject$2(e) {
return null !== e && "object" == typeof e
}
function isPromise(e) {
return isObject$2(e) && "function" == typeof e.then
}
class ModalFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.toggleDisplayNone = (e, t) => {
this._adapter.toggleDisplayNone(e, t)
}
}
destroy() {
this.afterHide()
}
handleCancel(e) {
var t;
const r = this._adapter.notifyCancel(e);
isPromise(r) && (this._adapter.setState({
onCancelReturnPromiseStatus: "pending"
}),
null === (t = null == r ? void 0 : r.then(( () => {
this._adapter.setState({
onCancelReturnPromiseStatus: "fulfilled"
})
}
))) || void 0 === t || t.catch((e => {
throw this._adapter.setState({
onCancelReturnPromiseStatus: "rejected"
}),
e
}
)))
}
handleOk(e) {
var t;
const r = this._adapter.notifyOk(e);
isPromise(r) && (this._adapter.setState({
onOKReturnPromiseStatus: "pending"
}),
null === (t = null == r ? void 0 : r.then(( () => {
this._adapter.setState({
onOKReturnPromiseStatus: "fulfilled"
})
}
))) || void 0 === t || t.catch((e => {
throw this._adapter.setState({
onOKReturnPromiseStatus: "rejected"
}),
e
}
)))
}
beforeShow() {
this._adapter.disabledBodyScroll()
}
afterHide() {
this._adapter.enabledBodyScroll(),
this._adapter.notifyClose()
}
enabledBodyScroll() {
this._adapter.enabledBodyScroll()
}
}
class ModalContentFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign(Object.assign({},
ModalContentFoundation.defaultAdapter), e)),
this.handleKeyDown = e => {
const {closeOnEsc: t} = this.getProps();
if (t && e.keyCode === KeyCode.ESC)
return e.stopPropagation(),
void this.close(e)
}
}
destroy() {
this.handleKeyDownEventListenerUnmount(),
this.modalDialogBlur(),
this.prevFocusElementReFocus()
}
handleDialogMouseDown() {
this._adapter.notifyDialogMouseDown()
}
handleMaskMouseUp() {
this._adapter.notifyDialogMouseUp()
}
handleKeyDownEventListenerMount() {
this._adapter.addKeyDownEventListener()
}
handleKeyDownEventListenerUnmount() {
this._adapter.removeKeyDownEventListener()
}
getMouseState() {
this._adapter.getMouseState()
}
handleMaskClick(e) {
const {dialogMouseDown: t} = this.getStates();
e.target !== e.currentTarget || t || this.close(e)
}
close(e) {
this._adapter.notifyClose(e)
}
modalDialogFocus() {
this._adapter.modalDialogFocus()
}
modalDialogBlur() {
this._adapter.modalDialogBlur()
}
prevFocusElementReFocus() {
this._adapter.prevFocusElementReFocus()
}
}
var baseDifference = _baseDifference
, baseRest$1 = _baseRest
, isArrayLikeObject$1 = isArrayLikeObject_1
, without = baseRest$1((function(e, t) {
return isArrayLikeObject$1(e) ? baseDifference(e, t) : []
}
))
, without_1 = without;
const _without = getDefaultExportFromCjs(without_1);
class FocusTrapHandle {
constructor(e, t) {
var r;
this.addFocusRedirectListener = e =>
(this.focusRedirectListenerList.push(e),
() => this.removeFocusRedirectListener(e)),
this.removeFocusRedirectListener = e => {
this.focusRedirectListenerList =
_without(this.focusRedirectListenerList, e)
}
,
this.destroy = () => {
var e;
null === (e = this.container) || void 0 === e ||
e.removeEventListener("keydown", this.onKeyPress)
}
,
this.shouldFocusRedirect = e => {
if (!this.enable)
return !1;
for (const t of this.focusRedirectListenerList) {
if (!t(e))
return !1
}
return !0
}
,
this.focusElement = (e, t) => {
const {preventScroll: r} = this.options;
null == e || e.focus({
preventScroll: r
}),
t.preventDefault()
}
,
this.onKeyPress = e => {
if (e && "Tab" === e.key) {
const t =
FocusTrapHandle.getFocusableElements(this.container);
t.length && (e.shiftKey ?
this.handleContainerShiftTabKeyDown(t, e) : this.handleContainerTabKeyDown(t, e))
}
}
,
this.handleContainerTabKeyDown = (e, t) => {
const r = FocusTrapHandle.getActiveElement()
, n = e[e.length - 1] === r
, i = e[0];
n && this.shouldFocusRedirect(i) && this.focusElement(i, t)
}
,
this.handleContainerShiftTabKeyDown = (e, t) => {
const r = FocusTrapHandle.getActiveElement()
, n = e[0] === r
, i = e[e.length - 1];
n && this.shouldFocusRedirect(i) && this.focusElement(i, t)
}
,
Object.freeze(t),
this.container = e,
this.options = t,
this.enable = null === (r = null == t ? void 0 : t.enable) || void
0 === r || r,
this.focusRedirectListenerList = (null == t ? void 0 :
t.onFocusRedirectListener) ? Array.isArray(t.onFocusRedirectListener) ?
[...t.onFocusRedirectListener] : [t.onFocusRedirectListener] : [],
this.container.addEventListener("keydown", this.onKeyPress)
}
get enable() {
return this._enable
}
set enable(e) {
this._enable = e
}
static getFocusableElements(e) {
if (!isElement$1(e))
return [];
const t = ["input:not([disabled]):not([tabindex='-1'])",
"textarea:not([disabled]):not([tabindex='-1'])",
"button:not([disabled]):not([tabindex='-1'])", "a[href]:not([tabindex='-1'])",
"select:not([disabled]):not([tabindex='-1'])", "area[href]:not([tabindex='-1'])",
"iframe:not([tabindex='-1'])", "object:not([tabindex='-1'])",
"*[tabindex]:not([tabindex='-1'])", "*[contenteditable]:not([tabindex='-
1'])"].join(",");
return Array.from(e.querySelectorAll(t))
}
static getActiveElement() {
return document ? document.activeElement : null
}
}
const FocusTrapHandle$1 = FocusTrapHandle;
var __rest$C = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
let uuid$1 = 0;
class ModalContent extends BaseComponent {
constructor(e) {
super(e),
this.onKeyDown = e => {
this.foundation.handleKeyDown(e)
}
,
this.onDialogMouseDown = () => {
this.foundation.handleDialogMouseDown()
}
,
this.onMaskMouseUp = () => {
this.foundation.handleMaskMouseUp()
}
,
this.onMaskClick = e => {
this.foundation.handleMaskClick(e)
}
,
this.close = e => {
this.foundation.close(e)
}
,
this.getMaskElement = () => {
const e = __rest$C(this.props, [])
, {mask: t, maskClassName: r} = e;
if (t) {
const t = classNames(`${cssClasses$g.DIALOG}-mask`, {});
return React.createElement("div", Object.assign({
key: "mask"
}, this.props.maskExtraProps, {
className: classNames(t, r),
style: e.maskStyle
}))
}
return null
}
,
this.renderCloseBtn = () => {
const {closable: e, closeIcon: t} = this.props;
let r;
if (e) {
const e = t || React.createElement(IconClose, {
"x-semi-prop": "closeIcon"
});
r = React.createElement(Button$2, {
"aria-label": "close",
className: `${cssClasses$g.DIALOG}-close`,
key: "close-btn",
onClick: this.close,
type: "tertiary",
icon: e,
theme: "borderless",
size: "small"
})
}
return r
}
,
this.renderIcon = () => {
const {icon: e} = this.props;
return e ? React.createElement("span", {
className: `${cssClasses$g.DIALOG}-icon-wrapper`,
"x-semi-prop": "icon"
}, e) : null
}
,
this.renderHeader = () => {
if ("header"in this.props)
return this.props.header;
const {title: e} = this.props
, t = this.renderCloseBtn()
, r = this.renderIcon();
return null == e ? null : React.createElement("div", {
className: `${cssClasses$g.DIALOG}-header`
}, r, React.createElement(Typography$1.Title, {
heading: 5,
className: `${cssClasses$g.DIALOG}-title`,
id: `${cssClasses$g.DIALOG}-title`,
"x-semi-prop": "title"
}, e), t)
}
,
this.renderBody = () => {
const {bodyStyle: e, children: t, title: r} = this.props
, n = classNames(`${cssClasses$g.DIALOG}-body`, {
[`${cssClasses$g.DIALOG}-withIcon`]: this.props.icon
})
, i = this.renderCloseBtn()
, o = this.renderIcon();
return null != r || "header"in this.props ?
React.createElement("div", {
className: n,
id: `${cssClasses$g.DIALOG}-body`,
style: e,
"x-semi-prop": "children"
}, t) : React.createElement("div", {
className: `${cssClasses$g.DIALOG}-body-wrapper`
}, o, React.createElement("div", {
className: n,
style: e,
"x-semi-prop": "children"
}, t), i)
}
,
this.getDialogElement = () => {
const e = __rest$C(this.props, [])
, t = {}
, r = classNames(`${cssClasses$g.DIALOG}`, {
[`${cssClasses$g.DIALOG}-centered`]: e.centered,
[`${cssClasses$g.DIALOG}-${e.size}`]: e.size
});
e.width && (t.width = e.width),
e.height && (t.height = e.height),
e.isFullScreen && (t.width = "100%",
t.height = "100%",
t.margin = "unset");
const n = this.renderBody()
, i = this.renderHeader()
, o = e.footer ? React.createElement("div", {
className: `${cssClasses$g.DIALOG}-footer`,
"x-semi-prop": "footer"
}, e.footer) : null;
return React.createElement("div", {
key: "dialog-element",
className: r,
onMouseDown: this.onDialogMouseDown,
style: Object.assign(Object.assign({}, e.style), t),
id: this.dialogId
}, React.createElement("div", {
role: "dialog",
ref: this.modalDialogRef,
"aria-modal": "true",
"aria-labelledby": `${cssClasses$g.DIALOG}-title`,
"aria-describedby": `${cssClasses$g.DIALOG}-body`,
onAnimationEnd: e.onAnimationEnd,
className: classNames([`${cssClasses$g.DIALOG}-content`,
e.contentClassName, {
[`${cssClasses$g.DIALOG}-content-fullScreen`]:
e.isFullScreen
}])
}, i, n, o))
}
,
this.state = {
dialogMouseDown: !1,
prevFocusElement: FocusTrapHandle$1.getActiveElement()
},
this.foundation = new ModalContentFoundation(this.adapter),
this.dialogId = "dialog-" + uuid$1++,
this.modalDialogRef = React.createRef()
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
notifyClose: e => {
this.props.onClose(e)
}
,
notifyDialogMouseDown: () => {
this.setState({
dialogMouseDown: !0
})
}
,
notifyDialogMouseUp: () => {
this.state.dialogMouseDown && (this.timeoutId =
setTimeout(( () => {
this.setState({
dialogMouseDown: !1
})
}
), 0))
}
,
addKeyDownEventListener: () => {
this.props.closeOnEsc &&
document.addEventListener("keydown", this.foundation.handleKeyDown)
}
,
removeKeyDownEventListener: () => {
this.props.closeOnEsc &&
document.removeEventListener("keydown", this.foundation.handleKeyDown)
}
,
getMouseState: () => this.state.dialogMouseDown,
modalDialogFocus: () => {
var e, t, r;
const {preventScroll: n} = this.props;
let i;
if (this.modalDialogRef) {
const t = FocusTrapHandle$1.getActiveElement();
i = this.modalDialogRef.current.contains(t),
null === (e = this.focusTrapHandle) || void 0 === e ||
e.destroy(),
this.focusTrapHandle = new
FocusTrapHandle$1(this.modalDialogRef.current,{
preventScroll: n
})
}
i || null === (r = null === (t = this.modalDialogRef) ||
void 0 === t ? void 0 : t.current) || void 0 === r || r.focus({
preventScroll: n
})
}
,
modalDialogBlur: () => {
var e, t;
null === (e = this.modalDialogRef) || void 0 === e ||
e.current.blur(),
null === (t = this.focusTrapHandle) || void 0 === t ||
t.destroy()
}
,
prevFocusElementReFocus: () => {
const {prevFocusElement: e} = this.state
, {preventScroll: t} = this.props
, r = _get(e, "focus");
_isFunction(r) && e.focus({
preventScroll: t
})
}
})
}
componentDidMount() {
var e;
this.foundation.handleKeyDownEventListenerMount(),
this.foundation.modalDialogFocus();
const t =
FocusTrapHandle$1.getFocusableElements(this.modalDialogRef.current);
this.modalDialogRef.current.contains(document.activeElement) ||
null === (e = t[0]) || void 0 === e || e.focus()
}
componentWillUnmount() {
clearTimeout(this.timeoutId),
this.foundation.destroy()
}
render() {
var e;
const t = this.props
, {maskClosable: r, className: n, getPopupContainer: i,
maskFixed: o, getContainerContext: s} = t
, a = __rest$C(t, ["maskClosable", "className",
"getPopupContainer", "maskFixed", "getContainerContext"])
, {direction: l} = this.context
, c = classNames(n, {
[`${cssClasses$g.DIALOG}-popup`]: i && i() !== (null === (e =
null === globalThis || void 0 === globalThis ? void 0 : globalThis.document) ||
void 0 === e ? void 0 : e.body) && !o,
[`${cssClasses$g.DIALOG}-fixed`]: o,
[`${cssClasses$g.DIALOG}-rtl`]: "rtl" === l
})
, u = s()
, d = this.getDataAttr(a)
, p = React.createElement("div", Object.assign({
className: c
}, d), this.getMaskElement(), React.createElement("div",
Object.assign({
role: "none",
className: classNames({
[`${cssClasses$g.DIALOG}-wrap`]: !0,
[`${cssClasses$g.DIALOG}-wrap-center`]: this.props.centered
}),
onClick: r ? this.onMaskClick : null,
onMouseUp: r ? this.onMaskMouseUp : null
}, this.props.contentExtraProps), this.getDialogElement()));
return u && u.Provider ? React.createElement(u.Provider, {
value: u.value
}, p) : p
}
}
ModalContent.contextType = ConfigContext$1,
ModalContent.propTypes = {
close: PropTypes.func,
getContainerContext: PropTypes.func,
contentClassName: PropTypes.string,
maskClassName: PropTypes.string,
onAnimationEnd: PropTypes.func,
preventScroll: PropTypes.bool
},
ModalContent.defaultProps = {
close: _noop,
getContainerContext: _noop,
contentClassName: "",
maskClassName: ""
};
var __rest$B = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const ConfirmModal = e => {
const [t,r] = reactExports.useState(!0)
, [n,i] = reactExports.useState()
, [o,s] = reactExports.useState()
, {direction: a} = e
, {title: l, content: c, icon: u, type: d, onCancel: p, onOk: h,
className: f} = e
, m = __rest$B(e, ["title", "content", "icon", "type", "onCancel",
"onOk", "className"])
, g = reactExports.useCallback((e => {
const t = h && h(e);
t && t.then ? (i(!0),
t.then((function() {
r(!1),
i(!1)
}
), (e => {
i(!1)
}
))) : r(!1)
}
), [h])
, y = reactExports.useCallback((e => {
const t = p && p(e);
t && t.then ? (s(!0),
t.then((function() {
r(!1),
s(!1)
}
), (e => {
s(!1)
}
))) : r(!1)
}
), [p])
, v = `${cssClasses$g.DIALOG}-confirm`
, b = classNames(f, v, {
[`${v}-rtl`]: "rtl" === a
})
, x = classNames(`${cssClasses$g.DIALOG}-${d}`)
, _ = isSemiIcon(u) ? React.cloneElement(u, {
className: `${v}-icon ${x}-icon`,
size: "extra-large"
}) : u
, E = null == l ? null : React.createElement("span", {
className: `${v}-title-text`
}, l)
, T = classNames(`${v}-content`, {
[`${v}-content-withIcon`]: e.icon
});
return React.createElement(Modal$1, Object.assign({
className: b,
title: E,
confirmLoading: n,
cancelLoading: o,
onOk: g,
onCancel: y,
icon: _,
visible: t
}, m), React.createElement("div", {
className: T,
"x-semi-prop": "content"
}, c))
}
, ConfirmModal$1 = ConfirmModal;
function confirm(e) {
const t = document.createElement("div");
document.body.appendChild(t);
let r = Object.assign({}, e);
const n = () => {
ReactDOM.unmountComponentAtNode(t) && t.parentNode &&
t.parentNode.removeChild(t);
for (let e = 0; e < destroyFns.length; e++) {
if (destroyFns[e] === o) {
destroyFns.splice(e, 1);
break
}
}
}
;
function i(r) {
const {afterClose: i} = r;
ReactDOM.render(React.createElement(ConfirmModal$1,
Object.assign({}, r, {
afterClose: function() {
null == i || i(...arguments),
n()
},
motion: e.motion
})), t)
}
function o() {
r = Object.assign(Object.assign({}, r), {
visible: !1
}),
i(r)
}
return i(r),
destroyFns.push(o),
{
destroy: o,
update: function(e) {
r = Object.assign(Object.assign({}, r), e),
i(r)
}
}
}
function withInfo(e) {
return Object.assign({
type: "info",
icon: React.createElement(IconInfoCircle, null)
}, e)
}
function withSuccess(e) {
return Object.assign({
type: "success",
icon: React.createElement(IconTickCircle, null)
}, e)
}
function withWarning(e) {
return Object.assign({
type: "warning",
icon: React.createElement(IconAlertTriangle, null)
}, e)
}
function withError(e) {
return Object.assign({
type: "error",
icon: React.createElement(IconAlertCircle, null),
okButtonProps: Object.assign({
type: "danger"
}, e.okButtonProps)
}, _omit(e, ["okButtonProps"]))
}
function withConfirm(e) {
return Object.assign({
type: "confirm",
icon: React.createElement(IconHelpCircle, null)
}, e)
}
var __rest$A = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const HookModal = (e, t) => {
var {afterClose: r, config: n} = e;
__rest$A(e, ["afterClose", "config"]);
const [i,o] = React.useState(n);
React.useImperativeHandle(t, ( () => ({
destroy: () => {
o((e => Object.assign(Object.assign({}, e), {
visible: !1
})))
}
,
update: e => {
o((t => Object.assign(Object.assign({}, t), e)))
}
})));
return React.createElement(ConfirmModal$1, Object.assign({}, i, {
afterClose: () => {
var e;
null === (e = null == n ? void 0 : n.afterClose) || void 0 ===
e || e.call(n),
r()
}
}))
}
, HookModal$1 = React.forwardRef(HookModal);
let uuid = 0;
function usePatchElement$1() {
const [e,t] = React.useState([]);
return [e, function(e) {
return t((t => [...t, e])),
() => {
t((t => t.filter((t => t !== e))))
}
}
]
}
function useModal() {
const [e,t] = usePatchElement$1();
function r(e) {
return function(r) {
uuid += 1;
const n = React.createRef();
let i;
const o = React.createElement(HookModal$1, {
key: `semi-modal-${uuid}`,
config: e(r),
ref: n,
afterClose: () => {
i()
}
});
return i = t(o),
{
destroy: () => {
n.current && n.current.destroy()
}
,
update: e => {
n.current && n.current.update(e)
}
}
}
}
return [{
info: r(withInfo),
success: r(withSuccess),
error: r(withError),
warning: r(withWarning),
confirm: r(withConfirm)
}, React.createElement(React.Fragment, null, e)]
}
var __rest$z = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
let destroyFns = [];
class Modal extends BaseComponent {
constructor(e) {
super(e),
this.bodyOverflow = null,
this.handleCancel = e => {
this.foundation.handleCancel(e)
}
,
this.handleOk = e => {
this.foundation.handleOk(e)
}
,
this.updateState = () => {
const {visible: e} = this.props;
this.foundation.toggleDisplayNone(!e)
}
,
this.renderFooter = () => {
const {okText: e, okType: t, cancelText: r, confirmLoading: n,
cancelLoading: i, hasCancel: o, footerFill: s} = this.props
, a = e => {
var t;
return o ? React.createElement(Button$1, Object.assign({
"aria-label": "cancel",
onClick: this.handleCancel,
loading: void 0 === i ? "pending" ===
this.state.onCancelReturnPromiseStatus : i,
type: "tertiary",
block: s,
autoFocus: !0
}, this.props.cancelButtonProps, {
style: Object.assign(Object.assign({}, s ? {
marginLeft: "unset"
} : {}), null === (t = this.props.cancelButtonProps) ||
void 0 === t ? void 0 : t.style),
"x-semi-children-alias": "cancelText"
}), r || e.cancel) : null
}
;
return React.createElement(LocaleConsumer, {
componentName: "Modal"
}, ( (r, i) => React.createElement("div", {
className: classNames({
[`${cssClasses$g.DIALOG}-footerfill`]: s
})
}, a(r), React.createElement(Button$1, Object.assign({
"aria-label": "confirm",
type: t,
theme: "solid",
block: s,
loading: void 0 === n ? "pending" ===
this.state.onOKReturnPromiseStatus : n,
onClick: this.handleOk
}, this.props.okButtonProps, {
"x-semi-children-alias": "okText"
}), e || r.confirm))))
}
,
this.renderDialog = () => {
var e;
let t = this.props
, {footer: r, className: n, motion: i, maskStyle: o, keepDOM:
s, style: a, zIndex: l, getPopupContainer: c, visible: u, modalContentClass: d} = t
, p = __rest$z(t, ["footer", "className", "motion",
"maskStyle", "keepDOM", "style", "zIndex", "getPopupContainer", "visible",
"modalContentClass"])
, h = a;
const f = o
, m = "footer"in this.props ? r : this.renderFooter();
let g = {
zIndex: l
};
c && c() !== (null === (e = null === globalThis || void 0 ===
globalThis ? void 0 : globalThis.document) || void 0 === e ? void 0 : e.body) && (g
= {
zIndex: l,
position: "static"
});
const y = classNames(n, {
[`${cssClasses$g.DIALOG}-displayNone`]: s &&
this.state.displayNone
})
, v = this.props.visible || this.props.keepDOM && (!
this.props.lazyRender || this._haveRendered) || this.props.motion && !
this.state.displayNone;
return v && (this._haveRendered = !0),
React.createElement(CSSAnimation$1, {
motion: this.props.motion,
animationState: u ? "enter" : "leave",
startClassName: u ? `${cssClasses$g.DIALOG}-content-
animate-show` : `${cssClasses$g.DIALOG}-content-animate-hide`,
onAnimationEnd: () => {
this.updateState()
}
}, (e => {
let {animationClassName: t, animationEventsNeedBind: r} =
e;
return React.createElement(CSSAnimation$1, {
motion: this.props.motion,
animationState: u ? "enter" : "leave",
startClassName: u ? `${cssClasses$g.DIALOG}-mask-
animate-show` : `${cssClasses$g.DIALOG}-mask-animate-hide`,
onAnimationEnd: () => {
this.updateState()
}
}, (e => {
let {animationClassName: n, animationEventsNeedBind: i}
= e;
return v ? React.createElement(Portal$1, {
style: g,
getPopupContainer: c
}, " ", React.createElement(ModalContent,
Object.assign({}, p, {
contentExtraProps: r,
maskExtraProps: i,
isFullScreen: this.state.isFullScreen,
contentClassName: `${t} ${d}`,
maskClassName: n,
className: y,
getPopupContainer: c,
maskStyle: f,
style: h,
ref: this.modalRef,
footer: m,
onClose: this.handleCancel
}))) : React.createElement(React.Fragment, null)
}
))
}
))
}
,
this.state = {
displayNone: !e.visible,
isFullScreen: e.fullScreen
},
this.foundation = new ModalFoundation(this.adapter),
this.modalRef = React.createRef(),
this.scrollBarWidth = 0,
this.originBodyWidth = "100%"
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
getProps: () => this.props,
disabledBodyScroll: () => {
var e;
const {getPopupContainer: t} = this.props;
this.bodyOverflow = document.body.style.overflow || "",
t && t() !== (null === (e = null === globalThis || void 0
=== globalThis ? void 0 : globalThis.document) || void 0 === e ? void 0 : e.body)
|| "hidden" === this.bodyOverflow || (document.body.style.overflow = "hidden",
document.body.style.width = `calc(${this.originBodyWidth ||
"100%"} - ${this.scrollBarWidth}px)`)
}
,
enabledBodyScroll: () => {
var e;
const {getPopupContainer: t} = this.props;
t && t() !== (null === (e = null === globalThis || void 0
=== globalThis ? void 0 : globalThis.document) || void 0 === e ? void 0 : e.body)
|| null === this.bodyOverflow || "hidden" === this.bodyOverflow ||
(document.body.style.overflow = this.bodyOverflow,
document.body.style.width = this.originBodyWidth)
}
,
notifyCancel: e => this.props.onCancel(e),
notifyOk: e => this.props.onOk(e),
notifyClose: () => {
this.props.afterClose()
}
,
toggleDisplayNone: (e, t) => {
e !== this.state.displayNone && this.setState({
displayNone: e
}, t || _noop)
}
,
notifyFullScreen: e => {
e !== this.state.isFullScreen && this.setState({
isFullScreen: e
})
}
})
}
static getDerivedStateFromProps(e, t) {
const r = {};
return e.fullScreen !== t.isFullScreen && (r.isFullScreen =
e.fullScreen),
e.visible && t.displayNone && (r.displayNone = !1),
r
}
componentDidMount() {
this.scrollBarWidth = getScrollbarWidth(),
this.originBodyWidth = document.body.style.width,
this.props.visible && this.foundation.beforeShow()
}
componentDidUpdate(e, t, r) {
!e.visible && this.props.visible && this.foundation.beforeShow(),
!t.displayNone && this.state.displayNone &&
this.foundation.afterHide()
}
componentWillUnmount() {
this.props.visible ? this.foundation.destroy() :
this.foundation.enabledBodyScroll()
}
render() {
return this.props,
this.renderDialog()
}
}
Modal.propTypes = {
mask: PropTypes.bool,
closable: PropTypes.bool,
centered: PropTypes.bool,
visible: PropTypes.bool,
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
confirmLoading: PropTypes.bool,
cancelLoading: PropTypes.bool,
okText: PropTypes.string,
okType: PropTypes.string,
cancelText: PropTypes.string,
maskClosable: PropTypes.bool,
onCancel: PropTypes.func,
onOk: PropTypes.func,
afterClose: PropTypes.func,
okButtonProps: PropTypes.object,
cancelButtonProps: PropTypes.object,
style: PropTypes.object,
className: PropTypes.string,
maskStyle: PropTypes.object,
bodyStyle: PropTypes.object,
zIndex: PropTypes.number,
title: PropTypes.node,
icon: PropTypes.node,
header: PropTypes.node,
footer: PropTypes.node,
hasCancel: PropTypes.bool,
motion: PropTypes.bool,
children: PropTypes.node,
getPopupContainer: PropTypes.func,
getContainerContext: PropTypes.func,
maskFixed: PropTypes.bool,
closeIcon: PropTypes.node,
closeOnEsc: PropTypes.bool,
size: PropTypes.oneOf(strings$d.SIZE),
keepDOM: PropTypes.bool,
lazyRender: PropTypes.bool,
direction: PropTypes.oneOf(strings$d.directions),
fullScreen: PropTypes.bool,
footerFill: PropTypes.bool
},
Modal.__SemiComponentName__ = "Modal",
Modal.defaultProps =
getDefaultPropsFromGlobalConfig(Modal.__SemiComponentName__, {
zIndex: 1e3,
motion: !0,
mask: !0,
centered: !1,
closable: !0,
visible: !1,
okType: "primary",
maskClosable: !0,
hasCancel: !0,
onCancel: _noop,
onOk: _noop,
afterClose: _noop,
maskFixed: !1,
closeOnEsc: !0,
size: "small",
keepDOM: !1,
lazyRender: !0,
fullScreen: !1
}),
Modal.useModal = useModal,
Modal.info = function(e) {
return confirm(withInfo(e))
}
,
Modal.success = function(e) {
return confirm(withSuccess(e))
}
,
Modal.error = function(e) {
return confirm(withError(e))
}
,
Modal.warning = function(e) {
return confirm(withWarning(e))
}
,
Modal.confirm = function(e) {
return confirm(withConfirm(e))
}
,
Modal.destroyAll = function() {
for (let e = 0, t = destroyFns.length; e < t; e++) {
const t = destroyFns[e];
t && t()
}
destroyFns = []
}
;
const Modal$1 = Modal
, cssClasses$f = {
PREFIX: `${BASE_CLASS_PREFIX$1}-dropdown`,
SELECTED: `${BASE_CLASS_PREFIX$1}-dropdown-item-selected`,
DISABLED: `${BASE_CLASS_PREFIX$1}-dropdown-item-disabled`
}
, strings$c = {
POSITION_SET: strings$t.POSITION_SET,
TRIGGER_SET: ["hover", "focus", "click", "custom", "contextMenu"],
DEFAULT_LEAVE_DELAY: 100,
ITEM_TYPE: ["primary", "secondary", "tertiary", "warning", "danger"]
}
, numbers$6 = {
SPACING: 4,
NESTED_SPACING: 2
};
class DropdownFoundation extends BaseFoundation$1 {
handleVisibleChange(e) {
this._adapter.setPopVisible(e),
this._adapter.notifyVisibleChange(e);
const {trigger: t} = this.getProps();
if (e && "click" === t) {
const e = this._adapter.getPopupId();
this.setFocusToFirstMenuItem(e)
}
}
getMenuItemNodes(e) {
const t = document.getElementById(e);
return t ? Array.from(t.getElementsByTagName("li")).filter((e =>
"false" === e.ariaDisabled)) : null
}
setFocusToFirstMenuItem(e) {
const t = this.getMenuItemNodes(e);
t && setFocusToFirstItem(t)
}
setFocusToLastMenuItem(e) {
const t = this.getMenuItemNodes(e);
t && setFocusToLastItem(t)
}
handleKeyDown(e) {
var t, r;
const n = null === (r = null === (t = e.target) || void 0 === t ?
void 0 : t.attributes["data-popupid"]) || void 0 === r ? void 0 : r.value
, {visible: i} = this._adapter.getStates();
switch (e.key) {
case " ":
case "Enter":
e.target.click();
break;
case "ArrowDown":
this.setFocusToFirstMenuItem(n),
i && handlePrevent(e);
break;
case "ArrowUp":
this.setFocusToLastMenuItem(n),
i && handlePrevent(e)
}
}
}
class DropdownMenuFoundation extends BaseFoundation$1 {
constructor() {
super(...arguments),
this.menuItemNodes = null,
this.firstChars = []
}
handleEscape(e) {
if ("custom" === this._adapter.getContext("trigger")) {
(e && getMenuButton(document.querySelectorAll("[data-
popupid]"), e.id)).focus()
}
}
setFocusByFirstCharacter(e, t) {
const r = findIndexByCharacter(this.menuItemNodes, e,
this.firstChars, t);
r >= 0 && setFocusToItem(this.menuItemNodes, this.menuItemNodes[r])
}
onMenuKeydown(e) {
const t = getAncestorNodeByRole(e.target, "tooltip");
this.menuItemNodes || (this.menuItemNodes =
[...e.target.parentNode.getElementsByTagName("li")].filter((e => "true" !==
e.ariaDisabled))),
0 === this.firstChars.length && this.menuItemNodes.forEach((e => {
var t;
this.firstChars.push(null === (t = e.textContent.trim()[0]) ||
void 0 === t ? void 0 : t.toLowerCase())
}
));
const r = this.menuItemNodes.find((e => 0 === e.tabIndex));
switch (e.key) {
case " ":
case "Enter":
e.target.click();
break;
case "Escape":
this.handleEscape(t);
break;
case "ArrowUp":
setFocusToPreviousMenuItem(this.menuItemNodes, r),
handlePrevent(e);
break;
case "ArrowDown":
setFocusToNextMenuitem(this.menuItemNodes, r),
handlePrevent(e);
break;
default:
isPrintableCharacter(e.key) && this.setFocusByFirstCharacter(r,
e.key)
}
}
}
const DropdownContext = React.createContext({
level: 0
})
, DropdownContext$1 = DropdownContext;
var __rest$y = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$e = cssClasses$f.PREFIX;
class DropdownMenu extends BaseComponent {
constructor(e) {
super(e),
this.foundation = new DropdownMenuFoundation(this.adapter)
}
get adapter() {
return Object.assign({}, super.adapter)
}
render() {
const e = this.props
, {children: t, className: r, style: n} = e
, i = __rest$y(e, ["children", "className", "style"]);
return React.createElement("ul", Object.assign({
role: "menu",
"aria-orientation": "vertical"
}, i, {
className: classNames(`${prefixCls$e}-menu`, r),
style: n,
onKeyDown: e => this.foundation.onMenuKeydown(e)
}), t)
}
}
DropdownMenu.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
style: PropTypes.object
},
DropdownMenu.contextType = DropdownContext$1;
const DropdownMenu$1 = DropdownMenu
, prefixCls$d = cssClasses$f.PREFIX;
class DropdownItem extends BaseComponent {
render() {
const {children: e, disabled: t, className: r, forwardRef: n,
style: i, type: o, active: s, icon: a, onKeyDown: l, showTick: c, hover: u} =
this.props
, {showTick: d} = this.context
, p = null != d ? d : c
, h = classNames(r, {
[`${prefixCls$d}-item`]: !0,
[`${prefixCls$d}-item-disabled`]: t,
[`${prefixCls$d}-item-hover`]: u,
[`${prefixCls$d}-item-withTick`]: p,
[`${prefixCls$d}-item-${o}`]: o,
[`${prefixCls$d}-item-active`]: s
})
, f = {};
t || ["onClick", "onMouseEnter", "onMouseLeave",
"onContextMenu"].forEach((e => {
1 !== this.context.level && "onClick" === e ? f.onMouseDown = t
=> {
var r, n;
0 === t.button && (null === (n = (r = this.props)[e]) ||
void 0 === n || n.call(r, t))
}
: f[e] = this.props[e]
}
));
let m = null;
switch (!0) {
case p && s:
m = React.createElement(IconTick, null);
break;
case p && !s:
m = React.createElement(IconTick, {
style: {
color: "transparent"
}
});
break;
default:
m = null
}
let g = null;
return a && (g = React.createElement("div", {
className: `${prefixCls$d}-item-icon`
}, a)),
React.createElement("li", Object.assign({
role: "menuitem",
tabIndex: -1,
"aria-disabled": t
}, f, {
onKeyDown: l,
ref: e => n(e),
className: h,
style: i
}, this.getDataAttr(this.props)), m, g, e)
}
}
DropdownItem.propTypes = {
children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
name: PropTypes.string,
disabled: PropTypes.bool,
selected: PropTypes.bool,
onClick: PropTypes.func,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
onContextMenu: PropTypes.func,
className: PropTypes.string,
style: PropTypes.object,
forwardRef: PropTypes.func,
type: PropTypes.oneOf(strings$c.ITEM_TYPE),
active: PropTypes.bool,
icon: PropTypes.node
},
DropdownItem.contextType = DropdownContext$1,
DropdownItem.defaultProps = {
disabled: !1,
divided: !1,
selected: !1,
onMouseEnter: _noop,
onMouseLeave: _noop,
forwardRef: _noop
},
DropdownItem.elementType = "Dropdown.Item";
const DropdownItem$1 = DropdownItem
, prefixCls$c = cssClasses$f.PREFIX
, DropdownDivider = function() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {};
const {style: t, className: r} = e;
return React.createElement("div", {
className: classNames(`${prefixCls$c}-divider`, r),
style: t
})
};
DropdownDivider.propTypes = {
style: PropTypes.object,
className: PropTypes.string
};
const DropdownDivider$1 = DropdownDivider
, prefixCls$b = cssClasses$f.PREFIX;
class DropdownTitle extends reactExports.PureComponent {
render() {
const {className: e, style: t, children: r} = this.props
, {showTick: n} = this.context
, i = classNames({
[`${prefixCls$b}-title`]: !0,
[`${prefixCls$b}-title-withTick`]: n
}, e);
return React.createElement("div", {
className: i,
style: t
}, r)
}
}
DropdownTitle.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
style: PropTypes.object
},
DropdownTitle.contextType = DropdownContext$1;
const DropdownTitle$1 = DropdownTitle
, dropdown = "";
var __rest$x = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const positionSet = strings$c.POSITION_SET
, triggerSet = strings$c.TRIGGER_SET;
class Dropdown extends BaseComponent {
constructor(e) {
super(e),
this.handleVisibleChange = e =>
this.foundation.handleVisibleChange(e),
this.state = {
popVisible: e.visible
},
this.foundation = new DropdownFoundation(this.adapter),
this.tooltipRef = React.createRef()
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setPopVisible: e => this.setState({
popVisible: e
}),
notifyVisibleChange: e => this.props.onVisibleChange(e),
getPopupId: () => this.tooltipRef.current.getPopupId()
})
}
renderContent() {
const {render: e, menu: t, contentClassName: r, style: n, showTick:
i, prefixCls: o, trigger: s} = this.props
, a = classNames(o, r)
, {level: l=0} = this.context
, c = {
showTick: i,
level: l + 1,
trigger: s
};
let u = null;
return React.isValidElement(e) ? u = e : Array.isArray(t) && (u =
this.renderMenu()),
React.createElement(DropdownContext$1.Provider, {
value: c
}, React.createElement("div", {
className: a,
style: n
}, React.createElement("div", {
className: `${o}-content`,
"x-semi-prop": "render"
}, u)))
}
renderMenu() {
const {menu: e} = this.props
, t = e.map(( (e, t) => {
switch (e.node) {
case "title":
{
const {name: r, node: n} = e
, i = __rest$x(e, ["name", "node"]);
return React.createElement(Dropdown.Title,
Object.assign({}, i, {
key: n + r + t
}), r)
}
case "item":
{
const {node: r, name: n} = e
, i = __rest$x(e, ["node", "name"]);
return React.createElement(Dropdown.Item,
Object.assign({}, i, {
key: r + n + t
}), n)
}
case "divider":
return React.createElement(Dropdown.Divider, {
key: e.node + t
});
default:
return null
}
}
));
return React.createElement(Dropdown.Menu, null, t)
}
renderPopCard() {
const {render: e, contentClassName: t, style: r, showTick: n,
prefixCls: i} = this.props
, o = classNames(i, t)
, {level: s=0} = this.context
, a = {
showTick: n,
level: s + 1
};
return React.createElement(DropdownContext$1.Provider, {
value: a
}, React.createElement("div", {
className: o,
style: r
}, React.createElement("div", {
className: `${i}-content`
}, e)))
}
render() {
const e = this.props
, {children: t, position: r, trigger: n, onVisibleChange: i,
zIndex: o, className: s, motion: a, margin: l, style: c, prefixCls: u} = e
, d = __rest$x(e, ["children", "position", "trigger",
"onVisibleChange", "zIndex", "className", "motion", "margin", "style",
"prefixCls"]);
let {spacing: p} = this.props;
const {level: h} = this.context
, {popVisible: f} = this.state
, m = this.renderContent();
return h > 0 ? p = "number" == typeof p ? p :
numbers$6.NESTED_SPACING : null == p && (p = numbers$6.SPACING),
React.createElement(Tooltip, Object.assign({
zIndex: o,
motion: a,
margin: l,
content: m,
className: s,
prefixCls: u,
spacing: p,
position: r,
trigger: n,
onVisibleChange: this.handleVisibleChange,
showArrow: !1,
returnFocusOnClose: !0,
ref: this.tooltipRef
}, d), React.isValidElement(t) ? React.cloneElement(t, {
className: classNames(_get(t, "props.className"), {
[`${u}-showing`]: f
}),
"aria-haspopup": !0,
"aria-expanded": f,
onKeyDown: e => {
this.foundation.handleKeyDown(e);
const r = _get(t, "props.onKeyDown");
r && r(e)
}
}) : t)
}
}
Dropdown.Menu = DropdownMenu$1,
Dropdown.Item = DropdownItem$1,
Dropdown.Divider = DropdownDivider$1,
Dropdown.Title = DropdownTitle$1,
Dropdown.contextType = DropdownContext$1,
Dropdown.propTypes = {
children: PropTypes.node,
contentClassName: PropTypes.oneOfType([PropTypes.string,
PropTypes.array]),
className: PropTypes.string,
getPopupContainer: PropTypes.func,
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
mouseEnterDelay: PropTypes.number,
mouseLeaveDelay: PropTypes.number,
menu: PropTypes.array,
motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func,
PropTypes.object]),
onVisibleChange: PropTypes.func,
prefixCls: PropTypes.string,
position: PropTypes.oneOf(positionSet),
rePosKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
render: PropTypes.node,
spacing: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
showTick: PropTypes.bool,
style: PropTypes.object,
trigger: PropTypes.oneOf(triggerSet),
visible: PropTypes.bool,
zIndex: PropTypes.number
},
Dropdown.__SemiComponentName__ = "Dropdown",
Dropdown.defaultProps =
getDefaultPropsFromGlobalConfig(Dropdown.__SemiComponentName__, {
onVisibleChange: _noop,
prefixCls: cssClasses$f.PREFIX,
zIndex: numbers$b.DEFAULT_Z_INDEX,
motion: !0,
trigger: "hover",
position: "bottom",
mouseLeaveDelay: strings$c.DEFAULT_LEAVE_DELAY,
showTick: !1,
closeOnEsc: !0,
onEscKeyDown: _noop
});
const Dropdown$1 = Dropdown
, cssClasses$e = {
PREFIX: `${BASE_CLASS_PREFIX$1}`
}
, grid = "";
var __rest$w = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const responsiveArray = ["xxl", "xl", "lg", "md", "sm", "xs"]
, RowContext = React.createContext(null)
, responsiveMap = {
xs: "(max-width: 575px)",
sm: "(min-width: 576px)",
md: "(min-width: 768px)",
lg: "(min-width: 992px)",
xl: "(min-width: 1200px)",
xxl: "(min-width: 1600px)"
};
class Row extends React.Component {
constructor() {
super(...arguments),
this.state = {
screens: {
xs: !0,
sm: !0,
md: !0,
lg: !0,
xl: !0,
xxl: !0
}
},
this.unRegisters = []
}
componentDidMount() {
this.unRegisters = Object.keys(responsiveMap).map((e =>
registerMediaQuery(responsiveMap[e], {
match: () => {
"object" == typeof this.props.gutter && this.setState((t =>
({
screens: Object.assign(Object.assign({}, t.screens), {
[e]: !0
})
})))
}
,
unmatch: () => {
"object" == typeof this.props.gutter && this.setState((t =>
({
screens: Object.assign(Object.assign({}, t.screens), {
[e]: !1
})
})))
}
})))
}
componentWillUnmount() {
this.unRegisters.forEach((e => e()))
}
getGutter() {
const {gutter: e=0} = this.props
, t = [0, 0];
return (Array.isArray(e) ? e.slice(0, 2) : [e, 0]).forEach(( (e, r)
=> {
if ("object" == typeof e)
for (let n = 0; n < responsiveArray.length; n++) {
const i = responsiveArray[n];
if (this.state.screens[i] && void 0 !== e[i]) {
t[r] = e[i];
break
}
}
else
t[r] = e || 0
}
)),
t
}
render() {
const e = this.props
, {prefixCls: t, type: r, justify: n, align: i, className: o,
style: s, children: a} = e
, l = __rest$w(e, ["prefixCls", "type", "justify", "align",
"className", "style", "children"])
, c = this.getGutter()
, u = `${t}-row`
, d = classNames({
[u]: "flex" !== r,
[`${u}-${r}`]: r,
[`${u}-${r}-${n}`]: r && n,
[`${u}-${r}-${i}`]: r && i
}, o)
, p = Object.assign(Object.assign(Object.assign({}, c[0] > 0 ? {
marginLeft: c[0] / -2,
marginRight: c[0] / -2
} : {}), c[1] > 0 ? {
marginTop: c[1] / -2,
marginBottom: c[1] / -2
} : {}), s)
, h = Object.assign({}, l);
return delete h.gutter,
React.createElement(RowContext.Provider, {
value: {
gutters: c
}
}, React.createElement("div", Object.assign({}, h, {
className: d,
style: p,
"x-semi-prop": "children"
}), a))
}
}
Row.propTypes = {
type: PropTypes.oneOf(["flex"]),
align: PropTypes.oneOf(["top", "middle", "bottom"]),
justify: PropTypes.oneOf(["start", "end", "center", "space-around",
"space-between"]),
className: PropTypes.string,
style: PropTypes.object,
children: PropTypes.node,
gutter: PropTypes.oneOfType([PropTypes.object, PropTypes.number,
PropTypes.array]),
prefixCls: PropTypes.string
},
Row.defaultProps = {
prefixCls: cssClasses$e.PREFIX
},
Row.RowContext = {
gutters: PropTypes.any
};
const Row$1 = Row;
var __rest$v = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const objectOrNumber = PropTypes.oneOfType([PropTypes.object,
PropTypes.number]);
class Col extends React.Component {
render() {
const {props: e} = this
, {prefixCls: t, span: r, order: n, offset: i, push: o, pull: s,
className: a, children: l} = e
, c = __rest$v(e, ["prefixCls", "span", "order", "offset",
"push", "pull", "className", "children"]);
let u = {};
const d = `${t}-col`;
["xs", "sm", "md", "lg", "xl", "xxl"].forEach((t => {
let r = {};
"number" == typeof e[t] ? r.span = e[t] : "object" == typeof
e[t] && (r = e[t] || {}),
delete c[t],
u = Object.assign(Object.assign({}, u), {
[`${d}-${t}-${r.span}`]: void 0 !== r.span,
[`${d}-${t}-order-${r.order}`]: r.order || 0 === r.order,
[`${d}-${t}-offset-${r.offset}`]: r.offset || 0 ===
r.offset,
[`${d}-${t}-push-${r.push}`]: r.push || 0 === r.push,
[`${d}-${t}-pull-${r.pull}`]: r.pull || 0 === r.pull
})
}
));
const p = classNames(d, {
[`${d}-${r}`]: void 0 !== r,
[`${d}-order-${n}`]: n,
[`${d}-offset-${i}`]: i,
[`${d}-push-${o}`]: o,
[`${d}-pull-${s}`]: s
}, a, u);
let h, {style: f} = c;
try {
h = this.context.gutters
} catch (m) {
throw new Error("please make sure <Col> inside <Row>")
}
return f = Object.assign(Object.assign(Object.assign({}, h[0] > 0 ?
{
paddingLeft: h[0] / 2,
paddingRight: h[0] / 2
} : {}), h[1] > 0 ? {
paddingTop: h[1] / 2,
paddingBottom: h[1] / 2
} : {}), f),
React.createElement("div", Object.assign({}, c, {
style: f,
className: p,
"x-semi-prop": "children"
}), l)
}
}
Col.contextType = RowContext,
Col.propTypes = {
span: PropTypes.number,
order: PropTypes.number,
offset: PropTypes.number,
push: PropTypes.number,
pull: PropTypes.number,
className: PropTypes.string,
children: PropTypes.node,
xs: objectOrNumber,
sm: objectOrNumber,
md: objectOrNumber,
lg: objectOrNumber,
xl: objectOrNumber,
xxl: objectOrNumber,
prefixCls: PropTypes.string
},
Col.defaultProps = {
prefixCls: cssClasses$e.PREFIX
};
const Col$1 = Col
, cssClasses$d = {
PREFIX: `${BASE_CLASS_PREFIX$1}-form`
}
, strings$b = {
LAYOUT: ["horizontal", "vertical"],
LABEL_POS: ["left", "top", "inset"],
LABEL_ALIGN: ["left", "right"],
EXTRA_POS: ["middle", "bottom"],
DEFAULT_TRIGGER: "change"
}
, prefixCls$a = cssClasses$d.PREFIX;
class Label extends reactExports.PureComponent {
render() {
const {children: e, required: t, text: r, disabled: n, name: i,
width: o, align: s, style: a, className: l, extra: c, id: u, optional: d} =
this.props
, p = classNames(l, {
[`${prefixCls$a}-field-label`]: !0,
[`${prefixCls$a}-field-label-left`]: "left" === s,
[`${prefixCls$a}-field-label-right`]: "right" === s,
[`${prefixCls$a}-field-label-required`]: t,
[`${prefixCls$a}-field-label-disabled`]: n,
[`${prefixCls$a}-field-label-with-extra`]: c
})
, h = a || {};
o && (h.width = o);
const f = React.createElement(LocaleConsumer, {
componentName: "Form"
}, (e => React.createElement("span", {
className: `${prefixCls$a}-field-label-optional-text`
}, e.optional)))
, m = React.createElement("div", {
className: `${prefixCls$a}-field-label-text`,
"x-semi-prop": "label"
}, void 0 !== r ? r : e, d ? f : null)
, g = React.createElement(React.Fragment, null, m,
React.createElement("div", {
className: `${prefixCls$a}-field-label-extra`
}, c));
return React.createElement("label", {
className: p,
htmlFor: i,
style: h,
id: u
}, c ? g : m)
}
}
Label.defaultProps = {
required: !1,
name: "",
align: "left",
className: "",
optional: !1
},
Label.propTypes = {
id: PropTypes.string,
children: PropTypes.node,
required: PropTypes.bool,
text: PropTypes.node,
disabled: PropTypes.bool,
name: PropTypes.string,
align: PropTypes.string,
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
style: PropTypes.object,
className: PropTypes.string,
extra: PropTypes.node,
optional: PropTypes.bool
};
var __rest$u = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$9 = cssClasses$t.PREFIX
, sizeSet = strings$p.SIZE;
class inputGroup extends BaseComponent {
renderGroupWithLabel(e) {
const t = this.props
, {size: r, className: n, label: i, labelPosition: o} = t;
__rest$u(t, ["size", "className", "label", "labelPosition"]);
const s = classNames({
[`${prefixCls$9}-group-wrapper`]: !0,
[`${prefixCls$9}-group-wrapper-with-top-label`]: "top" === o,
[`${prefixCls$9}-group-wrapper-with-left-label`]: "left" === o
})
, a = classNames(`${prefixCls$9}-group`, n, {
[`${prefixCls$9}-${r}`]: "default" !== r
})
, l = "input-group";
return React.createElement("div", {
className: s
}, i && i.text ? React.createElement(Label, Object.assign({
name: l
}, i)) : null, React.createElement("span", {
role: "group",
"aria-disabled": this.props.disabled,
id: i && i.name || l,
className: a,
style: this.props.style,
onFocus: this.props.onFocus,
onBlur: this.props.onBlur
}, e))
}
render() {
const e = this.props
, {size: t, style: r, className: n, children: i, label: o,
onBlur: s, onFocus: a, disabled: l} = e
, c = __rest$u(e, ["size", "style", "className", "children",
"label", "onBlur", "onFocus", "disabled"])
, u = classNames(`${prefixCls$9}-group`, {
[`${prefixCls$9}-${t}`]: "default" !== t
}, n);
let d;
return i && (d = (Array.isArray(i) ? i : [i]).map(( (e, r) => {
if (e) {
const {onBlur: n, onFocus: i, disabled: o} = e.props
, u = _isFunction(n) && "noop" !== _get(n, "name") ? n :
s
, d = _isFunction(i) && "noop" !== _get(i, "name") ? i :
a
, p = "boolean" == typeof o ? o : l;
return React.cloneElement(e, Object.assign(Object.assign({
key: r
}, c), {
size: t,
onBlur: u,
onFocus: d,
disabled: p
}))
}
return null
}
))),
o && o.text ? this.renderGroupWithLabel(d) :
React.createElement("span", {
role: "group",
"aria-label": "Input group",
"aria-disabled": this.props.disabled,
className: u,
style: r,
onFocus: this.props.onFocus,
onBlur: this.props.onBlur
}, d)
}
}
inputGroup.propTypes = {
className: PropTypes.string,
children: PropTypes.node,
size: PropTypes.oneOf(sizeSet),
style: PropTypes.object,
onBlur: PropTypes.func,
onFocus: PropTypes.func,
label: PropTypes.object,
labelPosition: PropTypes.string
},
inputGroup.defaultProps = {
size: "default",
className: "",
onBlur: noop$2,
onFocus: noop$2
};
let hiddenTextarea = null;
const HIDDEN_TEXTAREA_STYLE = {
"min-height": "0",
"max-height": "none",
height: "0",
visibility: "hidden",
overflow: "hidden",
position: "absolute",
"z-index": "-1000",
top: "0",
right: "0"
}
, forceHiddenStyles = e => {
Object.keys(HIDDEN_TEXTAREA_STYLE).forEach((t => {
e.style.setProperty(t, HIDDEN_TEXTAREA_STYLE[t], "important")
}
))
}
, getContentHeight = (e, t) => {
const r = e.scrollHeight;
return "border-box" === t.sizingStyle.boxSizing ? r + t.borderSize : r
- t.paddingSize
}
;
function calculateNodeHeight(e, t) {
let r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : 1
, n = arguments.length > 3 && void 0 !== arguments[3] ?
arguments[3] : 1 / 0;
hiddenTextarea || (hiddenTextarea = document.createElement("textarea"),
hiddenTextarea.setAttribute("tab-index", "-1"),
hiddenTextarea.setAttribute("aria-hidden", "true"),
forceHiddenStyles(hiddenTextarea)),
null === hiddenTextarea.parentNode &&
document.body.appendChild(hiddenTextarea);
const {paddingSize: i, borderSize: o, sizingStyle: s} = e
, {boxSizing: a} = s;
Object.keys(s).forEach((e => {
hiddenTextarea.style[e] = s[e]
}
)),
forceHiddenStyles(hiddenTextarea),
hiddenTextarea.value = t;
let l = getContentHeight(hiddenTextarea, e);
hiddenTextarea.value = "x";
const c = getContentHeight(hiddenTextarea, e) - i - o;
let u = c * r;
"border-box" === a && (u = u + i + o),
l = Math.max(u, l);
let d = c * n;
return "border-box" === a && (d = d + i + o),
l = Math.min(d, l),
l
}
const SIZING_STYLE = ["borderBottomWidth", "borderLeftWidth",
"borderRightWidth", "borderTopWidth", "boxSizing", "fontFamily", "fontSize",
"fontStyle", "fontWeight", "letterSpacing", "lineHeight", "paddingBottom",
"paddingLeft", "paddingRight", "paddingTop", "tabSize", "textIndent",
"textRendering", "textTransform", "width"]
, getSizingData = e => {
const t = window.getComputedStyle(e);
if (null === t)
return null;
const r = _pick(t, SIZING_STYLE)
, {boxSizing: n} = r;
if ("" === n)
return null;
return {
sizingStyle: r,
paddingSize: parseFloat(r.paddingBottom) +
parseFloat(r.paddingTop),
borderSize: parseFloat(r.borderBottomWidth) +
parseFloat(r.borderTopWidth)
}
}
, getSizingData$1 = getSizingData;
class TextAreaFoundation extends BaseFoundation$1 {
static get textAreaDefaultAdapter() {
return {
notifyChange: _noop,
setValue: _noop,
toggleFocusing: _noop,
toggleHovering: _noop,
notifyFocus: _noop,
notifyBlur: _noop,
notifyKeyDown: _noop,
notifyEnterPress: _noop
}
}
constructor(e) {
super(Object.assign(Object.assign({},
TextAreaFoundation.textAreaDefaultAdapter), e)),
this.resizeTextarea = () => {
var e;
const {height: t} = this.getStates()
, {rows: r, autosize: n} = this.getProps()
, i = this._adapter.getRef()
, o = getSizingData$1(i);
if (!o)
return;
const [s,a] = null !== n && "object" == typeof n ? [null !== (e
= null == n ? void 0 : n.minRows) && void 0 !== e ? e : r, null == n ? void 0 :
n.maxRows] : [r]
, l = calculateNodeHeight(o, i.value || i.placeholder || "x",
s, a);
return t !== l ? (this._adapter.notifyHeightUpdate(l),
void (i.style.height = `${l}px`)) : void 0
}
}
destroy() {}
handleValueChange(e) {
this._adapter.setValue(e)
}
handleChange(e, t) {
const {maxLength: r, minLength: n, getValueLength: i} =
this._adapter.getProps();
let o = e;
r && _isFunction(i) && (o = this.handleVisibleMaxLength(e)),
n && _isFunction(i) && this.handleVisibleMinLength(o),
this._isControlledComponent() || this._adapter.setValue(o),
this._adapter.notifyChange(o, t)
}
handleVisibleMinLength(e) {
const {minLength: t, getValueLength: r} = this._adapter.getProps()
, {minLength: n} = this._adapter.getStates();
if (_isNumber(t) && t >= 0 && _isFunction(r) && _isString(e)) {
const i = r(e);
if (i < t) {
const r = e.length + (t - i);
r !== n && this._adapter.setMinLength(r)
} else
n !== t && this._adapter.setMinLength(t)
}
}
handleVisibleMaxLength(e) {
const {maxLength: t, getValueLength: r} = this._adapter.getProps();
if (_isNumber(t) && t >= 0 && _isString(e)) {
if (_isFunction(r)) {
if (r(e) > t) {
return this.handleTruncateValue(e, t)
}
} else if (e.length > t)
return e.slice(0, t);
return e
}
}
handleTruncateValue(e, t) {
const {getValueLength: r} = this._adapter.getProps();
return truncateValue({
value: e,
maxLength: t,
getValueLength: r
})
}
handleFocus(e) {
const {value: t} = this.getStates();
this._adapter.toggleFocusing(!0),
this._adapter.notifyFocus(t, e)
}
handleBlur(e) {
const {value: t} = this.getStates()
, {maxLength: r} = this.getProps();
let n = t;
r && (n = this.handleVisibleMaxLength(t),
n !== t && (this._isControlledComponent() ||
this._adapter.setValue(n),
this._adapter.notifyChange(n, e))),
this._adapter.toggleFocusing(!1),
this._adapter.notifyBlur(n, e)
}
handleKeyDown(e) {
const {disabledEnterStartNewLine: t} = this.getProps();
t && "Enter" === e.key && !e.shiftKey && e.preventDefault(),
this._adapter.notifyKeyDown(e),
13 === e.keyCode && this._adapter.notifyPressEnter(e)
}
handleMouseEnter(e) {
this._adapter.toggleHovering(!0)
}
handleMouseLeave(e) {
this._adapter.toggleHovering(!1)
}
isAllowClear() {
const {value: e, isFocus: t, isHover: r} =
this._adapter.getStates()
, {showClear: n, disabled: i, readonly: o} =
this._adapter.getProps();
return e && n && !i && (t || r) && !o
}
handleClear(e) {
const {isFocus: t} = this.getStates();
this._isControlledComponent("value") ? this._adapter.setState({
isFocus: !1
}) : this._adapter.setState({
value: "",
isFocus: !1
}),
t && this._adapter.notifyBlur("", e),
this._adapter.notifyChange("", e),
this._adapter.notifyClear(e),
this.stopPropagation(e)
}
}
const textarea$2 = "";
var __rest$t = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$8 = cssClasses$t.PREFIX;
class TextArea extends BaseComponent {
constructor(e) {
super(e),
this.handleClear = e => {
this.foundation.handleClear(e)
}
,
this.setRef = e => {
this.libRef.current = e;
const {forwardRef: t} = this.props;
"function" == typeof t ? t(e) : t && "object" == typeof t &&
(t.current = e)
}
;
const t = "value"in e ? e.value : e.defaultValue;
this.state = {
value: t,
isFocus: !1,
isHover: !1,
height: 0,
minLength: e.minLength,
cachedValue: e.value
},
this.focusing = !1,
this.foundation = new TextAreaFoundation(this.adapter),
this.libRef = React.createRef(),
this.throttledResizeTextarea =
throttle$3(this.foundation.resizeTextarea, 10)
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setValue: e => this.setState({
value: e
}, ( () => {
this.props.autosize && this.foundation.resizeTextarea()
}
)),
getRef: () => this.libRef.current,
toggleFocusing: e => this.setState({
isFocus: e
}),
toggleHovering: e => this.setState({
isHover: e
}),
notifyChange: (e, t) => {
this.props.onChange(e, t)
}
,
notifyClear: e => this.props.onClear(e),
notifyBlur: (e, t) => this.props.onBlur(t),
notifyFocus: (e, t) => this.props.onFocus(t),
notifyKeyDown: e => {
this.props.onKeyDown(e)
}
,
notifyHeightUpdate: e => {
this.setState({
height: e
}),
this.props.onResize({
height: e
})
}
,
notifyPressEnter: e => {
this.props.onEnterPress && this.props.onEnterPress(e)
}
,
setMinLength: e => this.setState({
minLength: e
})
})
}
static getDerivedStateFromProps(e, t) {
const r = {};
return e.value !== t.cachedValue && (r.value = e.value,
r.cachedValue = e.value),
r
}
componentWillUnmount() {
var e, t;
this.throttledResizeTextarea && (null === (t = null === (e =
this.throttledResizeTextarea) || void 0 === e ? void 0 : e.cancel) || void 0 === t
|| t.call(e),
this.throttledResizeTextarea = null)
}
componentDidUpdate(e, t) {
this.props.value === e.value && this.props.placeholder ===
e.placeholder || !this.props.autosize || this.foundation.resizeTextarea()
}
renderClearBtn() {
const {showClear: e} = this.props
, t = this.foundation.isAllowClear()
, r = classNames(`${prefixCls$8}-clearbtn`, {
[`${prefixCls$8}-clearbtn-hidden`]: !t
});
return e ? React.createElement("div", {
className: r,
onClick: this.handleClear
}, React.createElement(IconClear, null)) : null
}
renderCounter() {
let e, t, r, n;
const {showCounter: i, maxCount: o, getValueLength: s} =
this.props;
if (i || o) {
const {value: i} = this.state;
t = i ? _isFunction(s) ? s(i) : i.length : 0,
r = o || null,
n = classNames(`${prefixCls$8}-textarea-counter`, {
[`${prefixCls$8}-textarea-counter-exceed`]: t > r
}),
e = React.createElement("div", {
className: n
}, t, r ? "/" : null, r)
} else
e = null;
return e
}
render() {
const e = this.props
, {autosize: t, placeholder: r, onEnterPress: n, onResize: i,
disabled: o, readonly: s, className: a, showCounter: l, validateStatus: c,
maxCount: u, defaultValue: d, style: p, forwardRef: h, getValueLength: f,
maxLength: m, minLength: g, showClear: y, borderless: v, autoFocus: b} = e
, x = __rest$t(e, ["autosize", "placeholder", "onEnterPress",
"onResize", "disabled", "readonly", "className", "showCounter", "validateStatus",
"maxCount", "defaultValue", "style", "forwardRef", "getValueLength", "maxLength",
"minLength", "showClear", "borderless", "autoFocus"])
, {isFocus: _, value: E, minLength: T} = this.state
, C = classNames(a, `${prefixCls$8}-textarea-wrapper`, {
[`${prefixCls$8}-textarea-borderless`]: v,
[`${prefixCls$8}-textarea-wrapper-disabled`]: o,
[`${prefixCls$8}-textarea-wrapper-readonly`]: s,
[`${prefixCls$8}-textarea-wrapper-${c}`]: Boolean(c),
[`${prefixCls$8}-textarea-wrapper-focus`]: _
})
, S = classNames(`${prefixCls$8}-textarea`, {
[`${prefixCls$8}-textarea-disabled`]: o,
[`${prefixCls$8}-textarea-readonly`]: s,
[`${prefixCls$8}-textarea-autosize`]: _isObject(t) ?
_isUndefined(null == t ? void 0 : t.maxRows) : t,
[`${prefixCls$8}-textarea-showClear`]: y
})
, $ = Object.assign(Object.assign({}, _omit(x, "insetLabel",
"insetLabelId", "getValueLength", "onClear", "showClear",
"disabledEnterStartNewLine")), {
autoFocus: b || this.props.autofocus,
className: S,
disabled: o,
readOnly: s,
placeholder: r || null,
onChange: e => this.foundation.handleChange(e.target.value, e),
onFocus: e => this.foundation.handleFocus(e),
onBlur: e => this.foundation.handleBlur(e.nativeEvent),
onKeyDown: e => this.foundation.handleKeyDown(e),
value: null == E ? "" : E
});
return _isFunction(f) || ($.maxLength = m),
T && ($.minLength = T),
React.createElement("div", {
className: C,
style: p,
onMouseEnter: e => this.foundation.handleMouseEnter(e),
onMouseLeave: e => this.foundation.handleMouseLeave(e)
}, t ? React.createElement(ReactResizeObserver, {
onResize: this.throttledResizeTextarea
}, React.createElement("textarea", Object.assign({}, $, {
ref: this.setRef
}))) : React.createElement("textarea", Object.assign({}, $, {
ref: this.setRef
})), this.renderClearBtn(), this.renderCounter())
}
}
TextArea.propTypes = {
autosize: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
borderless: PropTypes.bool,
placeholder: PropTypes.string,
value: PropTypes.string,
rows: PropTypes.number,
cols: PropTypes.number,
maxCount: PropTypes.number,
onEnterPress: PropTypes.func,
validateStatus: PropTypes.string,
className: PropTypes.string,
style: PropTypes.object,
showClear: PropTypes.bool,
onClear: PropTypes.func,
onResize: PropTypes.func,
getValueLength: PropTypes.func,
disabledEnterStartNewLine: PropTypes.bool
},
TextArea.defaultProps = {
autosize: !1,
borderless: !1,
rows: 4,
cols: 20,
showCounter: !1,
showClear: !1,
onEnterPress: _noop,
onChange: _noop,
onBlur: _noop,
onFocus: _noop,
onKeyDown: _noop,
onResize: _noop,
onClear: _noop
};
const ForwardTextarea = React.forwardRef(( (e, t) =>
React.createElement(TextArea, Object.assign({}, e, {
forwardRef: t
}))))
, TextArea$1 = ForwardTextarea;
var isNumber$1 = isNumber_1;
function isNaN$2(e) {
return isNumber$1(e) && e != +e
}
var _isNaN = isNaN$2;
const _isNaN$1 = getDefaultExportFromCjs(_isNaN)
, isBothNaN = (e, t) => {
const {isNaN: r} = Number;
return r(e) && r(t)
}
, isBothNaN$1 = isBothNaN
, cssClasses$c = Object.assign({}, cssClasses$t)
, numbers$5 = Object.assign(Object.assign({}, numbers$9), {
DEFAULT_STEP: 1,
DEFAULT_SHIFT_STEP: 10,
DEFAULT_PRESS_TIMEOUT: 250,
DEFAULT_PRESS_INTERVAL: 0,
MOUSE_BUTTON_LEFT: 0
})
, strings$a = Object.assign({}, strings$p);
function plus(e, t) {
const r = (e.toString().split(".")[1] || "").length
, n = (t.toString().split(".")[1] || "").length
, i = Math.pow(10, Math.max(r, n));
return (e * i + t * i) / i
}
function minus(e, t) {
return plus(e, -t)
}
class InputNumberFoundation extends BaseFoundation$1 {
init() {
this._setInitValue()
}
destroy() {
this._unregisterInterval(),
this._unregisterTimer(),
this._adapter.unregisterGlobalEvent("mouseup")
}
isControlled() {
return this._isControlledComponent("value")
}
_doInput() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : ""
, t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : null
, r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : null
, n = e
, i = e
, o = !0;
const s = this.isControlled();
"number" != typeof e && (i = this.doParse(e, !1),
o = !isNaN(i)),
o && (n = i,
s || this._adapter.setNumber(i)),
s || this._adapter.setValue(e, r),
this.getProp("keepFocus") && this._adapter.setFocusing(!0, ( () =>
{
this._adapter.setClickUpOrDown(!0)
}
)),
this.notifyChange(n, t)
}
_registerInterval(e) {
const t = this.getProp("pressInterval") ||
numbers$5.DEFAULT_PRESS_INTERVAL;
this._intervalHasRegistered = !0,
this._interval = setInterval(( () => {
"function" == typeof e && this._intervalHasRegistered && e()
}
), t)
}
_unregisterInterval() {
this._interval && (this._intervalHasRegistered = !1,
clearInterval(this._interval),
this._interval = null)
}
_registerTimer(e) {
const t = this.getProp("pressTimeout") ||
numbers$5.DEFAULT_PRESS_TIMEOUT;
this._timerHasRegistered = !0,
this._timer = setTimeout(( () => {
this._timerHasRegistered && "function" == typeof e && e()
}
), t)
}
_unregisterTimer() {
this._timer && (this._timerHasRegistered = !1,
clearTimeout(this._timer),
this._timer = null)
}
handleInputFocus(e) {
this.getState("value"),
this._adapter.recordCursorPosition(),
this._adapter.setFocusing(!0, null),
this._adapter.setClickUpOrDown(!1),
this._adapter.notifyFocus(e)
}
handleInputChange(e, t) {
const r = this.doParse(e, !0, !0, !0)
, n = this.doParse(e, !1, !1, !1)
, i = this.afterParser(e);
let o;
this._adapter.recordCursorPosition();
let s = n
, a = e;
if ("" === e)
this.isControlled() || (s = null);
else if (this.isValidNumber(n) && this.isValidNumber(r))
o = n,
a = this.doFormat(n, !1);
else {
if ("number" != typeof n || isNaN(n))
a = this.doFormat(i, !1);
else {
a = this.doFormat(n, !1);
const e = i.lastIndexOf(".")
, t = i.length - 1 - e
, r = this._getPrecLen(n);
if (r) {
if (r < t)
for (let n = 0; n < t - r; n++)
a += "0"
} else {
a += e > -1 ? i.slice(e) : ""
}
s = n
}
o = i
}
this.isControlled() || null !== s && ("number" != typeof s ||
isNaN(s)) || this._adapter.setNumber(s),
this._adapter.setValue(this.isControlled() ? a : this.doFormat(i, !
1), ( () => {
this._adapter.restoreCursor()
}
)),
this.notifyChange(o, t)
}
handleInputKeyDown(e) {
const t = e.keyCode;
if (t === KeyCode.UP || t === KeyCode.DOWN) {
this._adapter.setClickUpOrDown(!0),
this._adapter.recordCursorPosition();
const r = t === KeyCode.UP ? this.add(null, e) :
this.minus(null, e);
this._doInput(r, e, ( () => {
this._adapter.restoreCursor()
}
)),
e.preventDefault()
}
this._adapter.notifyKeyDown(e)
}
handleInputBlur(e) {
const t = _toString(this.getState("value"));
let r = this.getState("number");
if (null != r || null != t && "" !== t) {
const n = this.doParse(t, !1, !0, !0);
let i, o, s = !1, a = !1;
this.isValidNumber(n) && r !== n && (i = n,
this.isControlled() || (r = i),
s = !0);
const l = this.doFormat(r, !0);
if (l !== t && (o = l,
a = !0),
a || s) {
const t = null != o ? o : i;
null != o && this._adapter.setValue(o),
null != i && (this._isControlledComponent("value") ||
this._adapter.setNumber(i)),
this.notifyChange(t, e)
}
}
this._adapter.setFocusing(!1),
this._adapter.notifyBlur(e)
}
handleInputMouseEnter(e) {
this._adapter.setHovering(!0)
}
handleInputMouseLeave(e) {
this._adapter.setHovering(!1)
}
handleInputMouseMove(e) {
this._adapter.setHovering(!0)
}
handleMouseUp(e) {
this._unregisterInterval(),
this._unregisterTimer(),
this._adapter.unregisterGlobalEvent("mouseup")
}
handleUpClick(e) {
const {readonly: t} = this.getProps();
this._isMouseButtonLeft(e) && !t &&
(this._adapter.setClickUpOrDown(!0),
e && (this._persistEvent(e),
e.stopPropagation(),
this._preventDefault(e)),
this.upClick(e),
this._registerTimer(( () => {
this._registerInterval(( () => {
this.upClick(e)
}
))
}
)))
}
handleDownClick(e) {
const {readonly: t} = this.getProps();
this._isMouseButtonLeft(e) && !t &&
(this._adapter.setClickUpOrDown(!0),
e && (this._persistEvent(e),
e.stopPropagation(),
this._preventDefault(e)),
this.downClick(e),
this._registerTimer(( () => {
this._registerInterval(( () => {
this.downClick(e)
}
))
}
)))
}
_isMouseButtonLeft(e) {
return _get(e, "button") === numbers$5.MOUSE_BUTTON_LEFT
}
_preventDefault(e) {
const t = this._adapter.getProp("keepFocus")
, r = this._adapter.getProp("innerButtons");
(t || r) && e.preventDefault()
}
handleMouseLeave(e) {
this._adapter.registerGlobalEvent("mouseup", ( () => {
this.handleMouseUp(e)
}
))
}
upClick(e) {
const t = this.add(null, e);
this._doInput(t, e),
this._adapter.notifyUpClick(t, e)
}
downClick(e) {
const t = this.minus(null, e);
this._doInput(t, e),
this._adapter.notifyDownClick(t, e)
}
_setInitValue() {
const {defaultValue: e, value: t} = this.getProps()
, r = this._isControlledComponent("value") ? t : e
, n = this.doParse(_toString(r), !1, !0, !0);
let i = null;
"number" != typeof n || isNaN(n) || (i = n);
const o = "number" == typeof i ? this.doFormat(i, !0) : "";
this._adapter.setNumber(i),
this._adapter.setValue(o),
_isString(o) && o !== String(null != r ? r : "") &&
this.notifyChange(o, null)
}
add(e, t) {
const r = t && t.shiftKey ? this.getProp("shiftStep") :
this.getProp("step");
e = null == e ? r : Number(e);
const n = Math.abs(_toNumber(e))
, i = this.getState("number");
let o = this.toNumber(i) || 0;
const s = this.getProp("min")
, a = this.getProp("max")
, l = this._getPrecLen(s)
, c = this._getPrecLen(a)
, u = this._getPrecLen(o)
, d = this._getPrecLen(e)
, p = Math.pow(10, Math.max(l, c, u, d));
return e < 0 ? Math.abs(minus(s, o)) >= n && (o = (o * p + e * p) /
p) : e > 0 && Math.abs(minus(a, o)) >= n && (o = (o * p + e * p) / p),
"number" == typeof s && s > o && (o = s),
"number" == typeof a && a < o && (o = a),
this.doFormat(o, !0)
}
minus(e, t) {
const r = t && t.shiftKey ? this.getProp("shiftStep") :
this.getProp("step");
return e = null == e ? r : Number(e),
this.add(-e, t)
}
_getPrecLen(e) {
"string" != typeof e && (e = String(Math.abs(Number(e || ""))));
const t = e.indexOf(".") + 1;
return t ? e.length - t : 0
}
_adjustPrec(e) {
const t = this.getProp("precision");
return "number" != typeof t || "" === e || null === e ||
Number.isNaN(Number(e)) || (e = Number(e).toFixed(t)),
_toString(e)
}
doFormat() {
let e, t = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : 0, r = !(arguments.length > 1 && void 0 !== arguments[1]) ||
arguments[1];
const n = this.getProp("formatter");
return e = r ? this._adjustPrec(t) : _toString(t),
"function" == typeof n && (e = n(e)),
e
}
fetchMinOrMax(e) {
const {min: t, max: r} = this.getProps();
return e < t ? t : e > r ? r : e
}
doParse(e) {
let t = !(arguments.length > 1 && void 0 !== arguments[1]) ||
arguments[1]
, r = arguments.length > 2 && void 0 !== arguments[2] &&
arguments[2]
, n = arguments.length > 3 && void 0 !== arguments[3] &&
arguments[3];
if ("number" == typeof e)
return n && (e = this.fetchMinOrMax(e)),
r && (e = this._adjustPrec(e)),
_toNumber(e);
const i = this.getProp("parser");
if ("function" == typeof i && (e = i(e)),
t && "string" == typeof e) {
const t = -1 === e.indexOf(".") || e.indexOf(".") > -1 && ("0"
=== e || e.lastIndexOf("0") < e.length - 1)
, r = e.lastIndexOf(".") < e.length - 1 &&
e.split("").filter((e => "." === e)).length < 2;
if (!t || !r)
return NaN
}
return r && (e = this._adjustPrec(e)),
"string" == typeof e && e.length ? n ?
this.fetchMinOrMax(_toNumber(e)) : _toNumber(e) : NaN
}
afterParser(e) {
const t = this.getProp("parser");
return _toString("string" == typeof e && "function" == typeof t ?
t(e) : e)
}
toNumber(e) {
let t = !(arguments.length > 1 && void 0 !== arguments[1]) ||
arguments[1];
if ("number" == typeof e)
return e;
if ("string" == typeof e) {
const r = this.getProp("parser");
"function" == typeof r && (e = r(e)),
t && (e = this._adjustPrec(e))
}
return _toNumber(e)
}
isValidNumber(e) {
let t = !(arguments.length > 1 && void 0 !== arguments[1]) ||
arguments[1];
if ("number" == typeof e && !isNaN(e)) {
const {min: r, max: n, precision: i} = this.getProps()
, o = this._getPrecLen(e);
if (e >= r && e <= n && (!t || ("number" == typeof i && o <= i
|| "number" != typeof i)))
return !0
}
return !1
}
isValidString(e) {
if ("string" == typeof e && e.length) {
const t = this.doParse(e);
return this.isValidNumber(t)
}
return !1
}
notifyChange(e, t) {
if (null == e || "" === e)
this._adapter.notifyChange("", t);
else {
const r = this.toNumber(e, !0);
"number" != typeof r || isNaN(r) ?
this._adapter.notifyChange(this.afterParser(e), t) : (this._adapter.notifyChange(r,
t),
this.notifyNumberChange(r, t))
}
}
notifyNumberChange(e, t) {
const {number: r} = this.getStates();
this.isValidNumber(e) && e !== r &&
this._adapter.notifyNumberChange(e, t)
}
updateStates(e, t) {
this._adapter.updateStates(e, t)
}
}
const InputNumberFoundation$1 = InputNumberFoundation
, inputNumber = "";
var __rest$s = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class InputNumber extends BaseComponent {
get adapter() {
var e = this;
return Object.assign(Object.assign({}, super.adapter), {
setValue: (e, t) => this.setState({
value: e
}, t),
setNumber: (e, t) => this.setState({
number: e
}, t),
setFocusing: (e, t) => this.setState({
focusing: e
}, t),
setHovering: e => this.setState({
hovering: e
}),
notifyChange: function() {
return e.props.onChange(...arguments)
},
notifyNumberChange: function() {
return e.props.onNumberChange(...arguments)
},
notifyBlur: e => this.props.onBlur(e),
notifyFocus: e => this.props.onFocus(e),
notifyUpClick: (e, t) => this.props.onUpClick(e, t),
notifyDownClick: (e, t) => this.props.onDownClick(e, t),
notifyKeyDown: e => this.props.onKeyDown(e),
registerGlobalEvent: (e, t) => {
e && "function" == typeof t &&
(this.adapter.unregisterGlobalEvent(e),
this.adapter.setCache(e, t),
document.addEventListener(e, t))
}
,
unregisterGlobalEvent: e => {
if (e) {
const t = this.adapter.getCache(e);
document.removeEventListener(e, t),
this.adapter.setCache(e, null)
}
}
,
recordCursorPosition: () => {
try {
this.inputNode && (this.cursorStart =
this.inputNode.selectionStart,
this.cursorEnd = this.inputNode.selectionEnd,
this.currentValue = this.inputNode.value,
this.cursorBefore = this.inputNode.value.substring(0,
this.cursorStart),
this.cursorAfter =
this.inputNode.value.substring(this.cursorEnd))
} catch (e2) {}
}
,
restoreByAfter: e => {
if (isNullOrUndefined(e))
return !1;
const t = this.inputNode.value
, r = t.lastIndexOf(e);
return -1 !== r && (r + e.length === t.length &&
(this.adapter.fixCaret(r, r),
!0))
}
,
restoreCursor: function() {
let t = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : e.cursorAfter;
return !isNullOrUndefined(t) &&
Array.prototype.some.call(t, ( (r, n) => {
const i = t.substring(n);
return e.adapter.restoreByAfter(i)
}
))
},
fixCaret: (e, t) => {
if (void 0 !== e && void 0 !== t && this.inputNode &&
this.inputNode.value)
try {
const r = this.inputNode.selectionStart
, n = this.inputNode.selectionEnd;
e === r && t === n ||
this.inputNode.setSelectionRange(e, t)
} catch (e2) {}
}
,
setClickUpOrDown: e => {
this.clickUpOrDown = e
}
,
updateStates: (e, t) => {
this.setState(e, t)
}
})
}
constructor(e) {
super(e),
this.setInputRef = e => {
const {forwardedRef: t} = this.props;
this.inputNode = e,
t && "object" == typeof t ? t.current = e : "function" ==
typeof t && t(e)
}
,
this.handleInputFocus = e => this.foundation.handleInputFocus(e),
this.handleInputChange = (e, t) =>
this.foundation.handleInputChange(e, t),
this.handleInputBlur = e => this.foundation.handleInputBlur(e),
this.handleInputKeyDown = e =>
this.foundation.handleInputKeyDown(e),
this.handleInputMouseEnter = e =>
this.foundation.handleInputMouseEnter(e),
this.handleInputMouseLeave = e =>
this.foundation.handleInputMouseLeave(e),
this.handleInputMouseMove = e =>
this.foundation.handleInputMouseMove(e),
this.handleUpClick = e => this.foundation.handleUpClick(e),
this.handleDownClick = e => this.foundation.handleDownClick(e),
this.handleMouseUp = e => this.foundation.handleMouseUp(e),
this.handleMouseLeave = e => this.foundation.handleMouseLeave(e),
this.renderButtons = () => {
const {prefixCls: e, disabled: t, innerButtons: r, max: n, min:
i} = this.props
, {hovering: o, focusing: s, number: a} = this.state
, l = t || a === n
, c = t || a === i
, u = classNames(`${e}-number-suffix-btns`, {
[`${e}-number-suffix-btns-inner`]: r,
[`${e}-number-suffix-btns-inner-hover`]: r && o && !s
})
, d = classNames(`${e}-number-button`, `${e}-number-button-
up`, {
[`${e}-number-button-up-disabled`]: t,
[`${e}-number-button-up-not-allowed`]: l
})
, p = classNames(`${e}-number-button`, `${e}-number-button-
down`, {
[`${e}-number-button-down-disabled`]: t,
[`${e}-number-button-down-not-allowed`]: c
});
return React.createElement("div", {
className: u
}, React.createElement("span", {
className: d,
onMouseDown: l ? _noop : this.handleUpClick,
onMouseUp: this.handleMouseUp,
onMouseLeave: this.handleMouseLeave
}, React.createElement(IconChevronUp, {
size: "extra-small"
})), React.createElement("span", {
className: p,
onMouseDown: c ? _noop : this.handleDownClick,
onMouseUp: this.handleMouseUp,
onMouseLeave: this.handleMouseLeave
}, React.createElement(IconChevronDown, {
size: "extra-small"
})))
}
,
this.renderSuffix = () => {
const {innerButtons: e, suffix: t} = this.props
, {hovering: r, focusing: n} = this.state;
if (e && (r || n)) {
return this.renderButtons()
}
return t
}
,
this.state = {
value: "",
number: null,
focusing: Boolean(e.autofocus) || !1,
hovering: !1
},
this.inputNode = null,
this.foundation = new InputNumberFoundation$1(this.adapter),
this.clickUpOrDown = !1
}
componentDidUpdate(e) {
const {value: t, preventScroll: r} = this.props
, {focusing: n} = this.state;
let i;
if (t !== e.value && !isBothNaN$1(t, e.value)) {
if (isNullOrUndefined(t) || "" === t)
i = "",
this.foundation.updateStates({
value: i,
number: null
});
else {
let e = t;
"number" == typeof t && (e = this.foundation.doFormat(t));
const r = this.foundation.doParse(e, !1, !0, !0)
, o = "number" == typeof t ? t :
this.foundation.doParse(e, !1, !1, !1);
if (n)
if (this.foundation.isValidNumber(r) && r !==
this.state.number) {
const e = {
number: r
};
this.clickUpOrDown && (e.value =
this.foundation.doFormat(e.number, !0),
i = e.value),
this.foundation.updateStates(e, ( () =>
this.adapter.restoreCursor()))
} else
_isNaN$1(o) ? this.foundation.updateStates({
value: e
}) : (i = this.foundation.doFormat(o, !1),
this.foundation.updateStates({
value: i
}));
else
this.foundation.isValidNumber(r) ? (i =
this.foundation.doFormat(r),
this.foundation.updateStates({
number: r,
value: i
})) : (i = "",
this.foundation.updateStates({
number: null,
value: i
}))
}
i && _isString(i) && i !== String(this.props.value) &&
this.foundation.notifyChange(i, null)
}
this.clickUpOrDown && this.props.keepFocus && this.state.focusing
&& document.activeElement !== this.inputNode && this.inputNode.focus({
preventScroll: r
})
}
render() {
const e = this.props
, {disabled: t, className: r, prefixCls: n, min: i, max: o, step:
s, shiftStep: a, precision: l, formatter: c, parser: u, forwardedRef: d, onUpClick:
p, onDownClick: h, pressInterval: f, pressTimeout: m, suffix: g, size: y,
hideButtons: v, innerButtons: b, style: x, onNumberChange: _, keepFocus: E,
defaultValue: T} = e
, C = __rest$s(e, ["disabled", "className", "prefixCls", "min",
"max", "step", "shiftStep", "precision", "formatter", "parser", "forwardedRef",
"onUpClick", "onDownClick", "pressInterval", "pressTimeout", "suffix", "size",
"hideButtons", "innerButtons", "style", "onNumberChange", "keepFocus",
"defaultValue"])
, {value: S, number: $} = this.state
, w = classNames(r, `${n}-number`, {
[`${n}-number-size-${y}`]: y
})
, P = this.renderButtons()
, R = {
"aria-disabled": t,
step: s
};
$ && (R["aria-valuenow"] = $),
o !== 1 / 0 && (R["aria-valuemax"] = o),
i !== -1 / 0 && (R["aria-valuemin"] = i);
const k = React.createElement("div", {
className: w,
style: x,
onMouseMove: e => this.handleInputMouseMove(e),
onMouseEnter: e => this.handleInputMouseEnter(e),
onMouseLeave: e => this.handleInputMouseLeave(e)
}, React.createElement(Input$1, Object.assign({
role: "spinbutton"
}, R, C, {
size: y,
disabled: t,
ref: this.setInputRef,
value: S,
onFocus: this.handleInputFocus,
onChange: this.handleInputChange,
onBlur: this.handleInputBlur,
onKeyDown: this.handleInputKeyDown,
suffix: this.renderSuffix()
})), v || b ? null : P);
return k
}
}
InputNumber.propTypes = {
"aria-label": PropTypes.string,
"aria-labelledby": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-errormessage": PropTypes.string,
"aria-describedby": PropTypes.string,
"aria-required": PropTypes.bool,
autofocus: PropTypes.bool,
clearIcon: PropTypes.node,
className: PropTypes.string,
defaultValue: PropTypes.oneOfType([PropTypes.number,
PropTypes.string]),
disabled: PropTypes.bool,
formatter: PropTypes.func,
forwardedRef: PropTypes.any,
hideButtons: PropTypes.bool,
innerButtons: PropTypes.bool,
insetLabel: PropTypes.node,
insetLabelId: PropTypes.string,
keepFocus: PropTypes.bool,
max: PropTypes.number,
min: PropTypes.number,
parser: PropTypes.func,
precision: PropTypes.number,
prefixCls: PropTypes.string,
pressInterval: PropTypes.number,
pressTimeout: PropTypes.number,
preventScroll: PropTypes.bool,
shiftStep: PropTypes.number,
step: PropTypes.number,
style: PropTypes.object,
suffix: PropTypes.any,
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
onBlur: PropTypes.func,
onChange: PropTypes.func,
onDownClick: PropTypes.func,
onKeyDown: PropTypes.func,
onNumberChange: PropTypes.func,
onUpClick: PropTypes.func
},
InputNumber.defaultProps = {
forwardedRef: _noop,
innerButtons: !1,
keepFocus: !1,
max: 1 / 0,
min: -1 / 0,
prefixCls: cssClasses$c.PREFIX,
pressInterval: numbers$5.DEFAULT_PRESS_TIMEOUT,
pressTimeout: numbers$5.DEFAULT_PRESS_TIMEOUT,
shiftStep: numbers$5.DEFAULT_SHIFT_STEP,
size: strings$a.DEFAULT_SIZE,
step: numbers$5.DEFAULT_STEP,
onBlur: _noop,
onChange: _noop,
onDownClick: _noop,
onFocus: _noop,
onKeyDown: _noop,
onNumberChange: _noop,
onUpClick: _noop
};
const InputNumber$1 = forwardStatics(React.forwardRef((function(e, t) {
return React.createElement(InputNumber, Object.assign({}, e, {
forwardedRef: t
}))
}
)), InputNumber)
, cssClasses$b = {
PREFIX: BASE_CLASS_PREFIX$1 + "-overflow-list"
}
, MODE_MAP = {
COLLAPSE: "collapse",
SCROLL: "scroll"
}
, BOUNDARY_MAP = {
START: "start",
END: "end"
}
, OVERFLOW_DIR = {
NONE: 0,
GROW: 1,
SHRINK: 2
}
, strings$9 = {
BOUNDARY_SET: Object.values(BOUNDARY_MAP),
POSITION_SET: ["vertical", "horizontal"],
MODE_SET: Object.values(MODE_MAP),
MODE_MAP: MODE_MAP,
BOUNDARY_MAP: BOUNDARY_MAP,
OVERFLOW_DIR: OVERFLOW_DIR
}
, numbers$4 = {
MINIMUM_HTML_ELEMENT_WIDTH: 4
};
class ReactIntersectionObserver extends React.PureComponent {
componentDidMount() {
const {items: e} = this.props;
this.cachedKeys = Object.keys(e);
const {root: t, threshold: r, rootMargin: n, option: i,
onIntersect: o} = this.props;
this.observer = new IntersectionObserver(o,Object.assign({
root: t,
threshold: r,
rootMargin: n
}, i)),
this.observeElement()
}
componentDidUpdate() {
const {items: e} = this.props
, t = Object.keys(e);
_isEqual(this.cachedKeys, t) || (this.observeElement(!0),
this.cachedKeys = t)
}
componentWillUnmount() {
this.observer && (this.observer.disconnect(),
this.observer = null)
}
observeElement() {
let e = arguments.length > 0 && void 0 !== arguments[0] &&
arguments[0];
const {items: t} = this.props;
_isEmpty(t) ? this.observer.disconnect() : (e &&
this.observer.disconnect(),
Object.keys(t).forEach((e => {
const r = t[e];
r && isElement$1(r) && this.observer.observe(r)
}
)))
}
render() {
const {children: e} = this.props;
return e
}
}
ReactIntersectionObserver.propTypes = {
onIntersect: PropTypes.func,
option: PropTypes.object,
root: PropTypes.any,
threshold: PropTypes.number,
rootMargin: PropTypes.string,
items: PropTypes.object
},
ReactIntersectionObserver.defaultProps = {
onIntersect: () => {}
,
threshold: .75,
rootMargin: "0px",
option: {},
items: {}
};
const Boundary$1 = strings$9.BOUNDARY_MAP;
class OverflowListFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.previousY = void 0,
this.isScrollMode = () => {
const {renderMode: e} = this.getProps();
return "scroll" === e
}
,
this.getReversedItems = () => {
const {items: e} = this.getProps();
return index$2(e).reverse()
}
}
getOverflowItem() {
const {items: e} = this.getProps()
, {visibleState: t, overflow: r} = this.getStates();
if (!this.isScrollMode())
return r;
const n = index$2(e)
, i = n.map((e => {
let {key: r} = e;
return Boolean(t.get(r))
}
))
, o = i.indexOf(!0)
, s = i.lastIndexOf(!0)
, a = [];
return a[0] = o >= 0 ? n.slice(0, o) : [],
a[1] = s >= 0 ? n.slice(s + 1, n.length) : n,
a
}
handleIntersect(e) {
const t = index$2(this.getState("visibleState"))
, r = {};
e.forEach((e => {
const n = _get(e, "target.dataset.scrollkey")
, i = e.isIntersecting;
r[n] = e,
t.set(n, i)
}
));
let n = !1;
for (const a of t.values())
if (a) {
n = !0;
break
}
const i = n
, [o] = e
, s = o.boundingClientRect.y;
i || void 0 === this.previousY || s === this.previousY ?
(this.previousY = s,
this._adapter.updateVisibleState(t),
this._adapter.notifyIntersect(r)) : this.previousY = s
}
handleCollapseOverflow() {
const {minVisibleItems: e, collapseFrom: t} = this.getProps()
, {overflowWidth: r, containerWidth: n, pivot: i, overflowStatus:
o} = this.getStates()
, {items: s, onOverflow: a} = this.getProps();
let l = r
, c = 0
, u = !1;
for (const d of this._adapter.getItemSizeMap().values()) {
if (l += d,
l > n) {
u = !0;
break
}
if (c === s.length - 1) {
this._adapter.updateStates({
overflowStatus: "normal",
pivot: s.length - 1,
visible: s,
overflow: []
});
break
}
c++
}
if (u) {
const r = Math.max(e, c)
, n = t === Boundary$1.START
, o = n ? this.getReversedItems().slice(0, r).reverse() :
s.slice(0, r)
, l = n ? this.getReversedItems().slice(r).reverse() :
s.slice(r);
return this._adapter.updateStates({
overflowStatus: "overflowed",
pivot: r,
visible: o,
overflow: l
}),
void (i !== r && a(l))
}
}
}
const OverflowListFoundation$1 = OverflowListFoundation
, overflowList = ""
, prefixCls$7 = cssClasses$b.PREFIX
, Boundary = strings$9.BOUNDARY_MAP
, OverflowDirection = strings$9.OVERFLOW_DIR
, RenderMode = strings$9.MODE_MAP;
class OverflowList extends BaseComponent {
constructor(e) {
var t;
super(e),
t = this,
this.scroller = null,
this.spacer = null,
this.isScrollMode = () => {
const {renderMode: e} = this.props;
return e === RenderMode.SCROLL
}
,
this.resize = function() {
var e;
const r = null === (e = (arguments.length > 0 && void 0 !==
arguments[0] ? arguments[0] : [])[0]) || void 0 === e ? void 0 :
e.target.clientWidth;
t.setState({
containerWidth: r,
overflowStatus: "calculating"
})
}
,
this.reintersect = e => {
this.foundation.handleIntersect(e)
}
,
this.mergeRef = (e, t, r) => {
this.itemRefs[r] = t,
"function" == typeof e ? e(t) : "object" == typeof e && e &&
"current"in e && (e.current = t)
}
,
this.renderOverflow = () => {
const e = this.foundation.getOverflowItem();
return this.props.overflowRenderer(e)
}
,
this.getItemKey = (e, t) => {
const {itemKey: r} = this.props;
return _isFunction(r) ? r(e) : _get(e, r || "key", t)
}
,
this.renderItemList = () => {
const {className: e, wrapperClassName: t, wrapperStyle: r,
style: n, visibleItemRenderer: i, renderMode: o, collapseFrom: s} = this.props
, {visible: a, overflowStatus: l} = this.state;
let c = this.renderOverflow();
if (!this.isScrollMode() && (Array.isArray(c) && (c =
React.createElement(React.Fragment, null, c)),
React.isValidElement(c))) {
const e = React.cloneElement(c);
c = React.createElement(ReactResizeObserver, {
onResize: e => {
let[t] = e;
this.setState({
overflowWidth: t.target.clientWidth,
overflowStatus: "calculating"
})
}
}, React.createElement("div", {
className: `${prefixCls$7}-overflow`
}, e))
}
const u = o === RenderMode.SCROLL ? ( () => {
const e = [React.createElement("div", {
className: classNames(t, `${prefixCls$7}-scroll-
wrapper`),
ref: e => {
this.scroller = e
}
,
style: Object.assign({}, r),
key: `${prefixCls$7}-scroll-wrapper`
}, a.map(i).map((e => {
const {forwardRef: t, key: r} = e;
return React.cloneElement(e, {
ref: e => this.mergeRef(t, e, r),
"data-scrollkey": `${r}`,
key: r
})
}
)))];
return "both" === this.props.overflowRenderDirection ?
(e.unshift(c[0]),
e.push(c[1])) : "start" ===
this.props.overflowRenderDirection ? (e.unshift(c[1]),
e.unshift(c[0])) : (e.push(c[0]),
e.push(c[1])),
e
}
)() : [s === Boundary.START ? c : null, a.map(( (e, t) => {
const {key: r} = e
, n = i(e, t)
, o = React.cloneElement(n);
return React.createElement(ReactResizeObserver, {
key: null != r ? r : t,
onResize: r => {
let[n] = r;
return this.onItemResize(n, e, t)
}
}, React.createElement("div", {
key: null != r ? r : t,
className: `${prefixCls$7}-item`
}, o))
}
)), s === Boundary.END ? c : null];
return React.createElement("div", {
className: classNames(`${prefixCls$7}`, e),
style: Object.assign(Object.assign({}, n), o ===
RenderMode.COLLAPSE ? {
maxWidth: "100%",
visibility: "calculating" === l ? "hidden" : "visible"
} : null)
}, ...u)
}
,
this.onItemResize = (e, t, r) => {
const n = this.getItemKey(t, r)
, i = this.itemSizeMap.get(n);
i ? i !== e.target.clientWidth && (this.itemSizeMap.set(n,
e.target.clientWidth),
this.setState({
overflowStatus: "calculating"
})) : this.itemSizeMap.set(n, e.target.clientWidth);
const {maxCount: o} = this.state;
this.itemSizeMap.size === o && this.setState({
overflowStatus: "calculating"
})
}
,
this.state = {
direction: OverflowDirection.GROW,
lastOverflowCount: 0,
overflow: [],
visible: [],
containerWidth: 0,
visibleState: new Map,
itemSizeMap: new Map,
overflowStatus: "calculating",
pivot: -1,
overflowWidth: 0,
maxCount: 0
},
this.foundation = new OverflowListFoundation$1(this.adapter),
this.previousWidths = new Map,
this.itemRefs = {},
this.itemSizeMap = new Map
}
static getDerivedStateFromProps(e, t) {
const {prevProps: r} = t
, n = {};
n.prevProps = e;
const i = t => !r && t in e || r && !_isEqual(r[t], e[t]);
if (i("items") || i("style")) {
if (n.direction = OverflowDirection.GROW,
n.lastOverflowCount = 0,
n.maxCount = 0,
e.renderMode === RenderMode.SCROLL)
n.visible = e.items,
n.overflow = [];
else {
let r = e.items.length;
0 !== Math.floor(t.containerWidth /
numbers$4.MINIMUM_HTML_ELEMENT_WIDTH) && (r = Math.min(r,
Math.floor(t.containerWidth / numbers$4.MINIMUM_HTML_ELEMENT_WIDTH)));
const i = e.collapseFrom === Boundary.START
, o = i ? index$2(e.items).reverse().slice(0, r) :
e.items.slice(0, r)
, s = i ? index$2(e.items).reverse().slice(r) :
e.items.slice(r);
n.visible = o,
n.overflow = s,
n.maxCount = r
}
n.pivot = -1,
n.overflowStatus = "calculating"
}
return n
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
updateVisibleState: e => {
this.setState({
visibleState: e
}, ( () => {
var t, r;
null === (r = (t = this.props).onVisibleStateChange) ||
void 0 === r || r.call(t, e)
}
))
}
,
updateStates: e => {
this.setState(Object.assign({}, e))
}
,
notifyIntersect: e => {
this.props.onIntersect && this.props.onIntersect(e)
}
,
getItemSizeMap: () => this.itemSizeMap
})
}
componentDidUpdate(e, t) {
const r = e.items.map((e => e.key))
, n = this.props.items.map((e => e.key));
_isEqual(r, n) || (this.itemRefs = {},
this.setState({
visibleState: new Map
}));
const {overflow: i, containerWidth: o, visible: s, overflowStatus:
a} = this.state;
this.isScrollMode() || "calculating" !== a ||
this.foundation.handleCollapseOverflow()
}
render() {
const e = this.renderItemList()
, {renderMode: t} = this.props;
return t === RenderMode.SCROLL ?
React.createElement(ReactIntersectionObserver, {
onIntersect: this.reintersect,
root: this.scroller,
threshold: this.props.threshold,
items: this.itemRefs
}, e) : React.createElement(ReactResizeObserver, {
onResize: this.resize
}, e)
}
}
OverflowList.__SemiComponentName__ = "OverflowList",
OverflowList.defaultProps =
getDefaultPropsFromGlobalConfig(OverflowList.__SemiComponentName__, {
collapseFrom: "end",
minVisibleItems: 0,
overflowRenderer: () => null,
renderMode: "collapse",
threshold: .75,
visibleItemRenderer: () => null,
onOverflow: () => null,
overflowRenderDirection: "both"
}),
OverflowList.propTypes = {
className: PropTypes.string,
collapseFrom: PropTypes.oneOf(strings$9.BOUNDARY_SET),
direction: PropTypes.oneOf(strings$9.POSITION_SET),
items: PropTypes.array,
minVisibleItems: PropTypes.number,
onIntersect: PropTypes.func,
onOverflow: PropTypes.func,
overflowRenderer: PropTypes.func,
renderMode: PropTypes.oneOf(strings$9.MODE_SET),
style: PropTypes.object,
threshold: PropTypes.number,
visibleItemRenderer: PropTypes.func,
wrapperClassName: PropTypes.string,
wrapperStyle: PropTypes.object,
collapseMask: PropTypes.object,
overflowRenderDirection: PropTypes.string
};
const OverflowList$1 = OverflowList
, cssClasses$a = {
PREFIX: `${BASE_CLASS_PREFIX$1}-select`,
PREFIX_OPTION: `${BASE_CLASS_PREFIX$1}-select-option`,
PREFIX_GROUP: `${BASE_CLASS_PREFIX$1}-select-group`
}
, strings$8 = {
SIZE_SET: ["small", "large", "default"],
POSITION_SET: strings$t.POSITION_SET,
MODE_SELECT: "select",
MODE_AUTOCOMPLETE: "autoComplete",
STATUS: VALIDATE_STATUS,
SEARCH_POSITION_TRIGGER: "trigger",
SEARCH_POSITION_DROPDOWN: "dropdown"
}
, numbers$3 = {
LIST_HEIGHT: 270
};
var __rest$r = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class SelectFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this._keydownHandler = null
}
init() {
this._setDropdownWidth();
const e = this.getProp("defaultOpen")
, t = this.getProp("open")
, r = this._collectOptions();
this._setDefaultSelection(r),
(e || t) && this.open(void 0, r);
this.getProp("autoFocus") && this.focus()
}
focus() {
const e = this._isFilterable()
, t = this._isMultiple();
this._adapter.updateFocusState(!0),
this._adapter.setIsFocusInContainer(!1),
e && t ? this.focusInput() : e && !t ? this.toggle2SearchInput(!
0) : this._focusTrigger()
}
_focusTrigger() {
this._adapter.focusTrigger()
}
destroy() {
this._adapter.unregisterClickOutsideHandler()
}
_setDropdownWidth() {
const {style: e, dropdownMatchSelectWidth: t} = this.getProps();
let r;
t && (r = e && _isNumber(e.width) || e && _isString(e.width) && !
e.width.includes("%") ? e.width : this._adapter.getTriggerWidth(),
this._adapter.setOptionWrapperWidth(r))
}
_collectOptions() {
const e = this._adapter.getOptionsFromChildren();
return this._adapter.updateOptions(e),
this._adapter.rePositionDropdown(),
e
}
_setDefaultSelection(e) {
let {value: t} = this.getProps();
const {defaultValue: r} = this.getProps();
this._isControlledComponent() || (t = r),
this._update(t, e)
}
handleOptionListChange() {
const e = this._collectOptions()
, {selections: t} = this.getStates();
this.updateOptionsActiveStatus(t, e);
const {defaultActiveFirstOption: r} = this.getProps();
r && this._adapter.updateFocusIndex(0)
}
handleOptionListChangeHadDefaultValue() {
const e = this.getState("selections");
let t;
const {onChangeWithObject: r} = this.getProps()
, n = this._isMultiple();
switch (!0) {
case n && Boolean(e.size):
try {
t = [...e].map((e => r ? e[1] : e[1].value))
} catch (o) {
t = []
}
break;
case n && !e.size:
t = [];
break;
case !n && Boolean(e.size):
try {
t = r ? [...e][0][1] : [...e][0][1].value
} catch (o) {}
case !n && !e.size:
}
const i = this._adapter.getOptionsFromChildren();
this._update(t, i)
}
handleValueChange(e) {
const {allowCreate: t, autoClearSearchValue: r, remote: n} =
this.getProps()
, {inputValue: i} = this.getStates();
let o;
t && this._isControlledComponent() ? (o = this.getState("options"),
o.forEach((e => e._show = !0))) : o =
this._adapter.getOptionsFromChildren(),
this._adapter.rePositionDropdown(),
this._isFilterable() && !r && i && !n && (o = this._filterOption(o,
i)),
this._update(e, o)
}
_update(e, t) {
let r;
this._isMultiple() ? (r = this._updateMultiple(e, t),
this.updateOverflowItemCount(r.size)) : r = this._updateSingle(e,
t),
this._adapter.updateSelection(r),
this.updateOptionsActiveStatus(r, t)
}
_updateSingle(e, t) {
const r = new Map
, {onChangeWithObject: n} = this.getProps()
, i = n && void 0 !== e ? e.value : e
, o = t.filter((e => e.value === i))
, s = !o.length && null != i;
if (o.length) {
const e = o[0]
, t = Object.assign({}, e);
r.set(t.label, t)
} else if (s) {
let t = {
value: e,
label: e,
_notExist: !0,
_scrollIndex: -1
};
n && (t = Object.assign(Object.assign({}, e), {
_notExist: !0,
_scrollIndex: -1
})),
r.set(t.label, t)
}
return r
}
_updateMultiple(e, t) {
const r = this.getState("selections");
let n = [];
const i = Array.isArray(e);
this.checkMultipleProps(),
r.size && (n = [...r].map((e => e[1])));
const o = new Map;
let s = e;
const {onChangeWithObject: a} = this.getProps();
return a && i && (s = e.map((e => e.value))),
i && s.length && s.forEach(( (r, i) => {
const s = t.findIndex((e => e.value === r));
if (-1 !== s)
o.set(t[s].label, t[s]);
else {
const t = n.findIndex((e => e.value === r));
if (-1 !== t) {
const r = n[t];
if (a) {
const t = Object.assign({}, e[i]);
_isEqual(t, r) ? o.set(r.label, r) : o.set(t.label,
t)
} else
o.set(r.label, r)
} else {
let t = {
value: r,
label: r,
_notExist: !0
};
a && (t = Object.assign(Object.assign({}, e[i]), {
_notExist: !0
})),
o.set(t.label, Object.assign(Object.assign({}, t), {
_scrollIndex: -1
}))
}
}
}
)),
o
}
_isMultiple() {
return this.getProp("multiple")
}
_isDisabled() {
return this.getProp("disabled")
}
_isFilterable() {
return Boolean(this.getProp("filter"))
}
handleClick(e) {
const {clickToHide: t} = this.getProps()
, {isOpen: r} = this.getStates();
this._isDisabled() || (r ? r && t ? this.close({
event: e
}) : r && !t && this.focusInput() : (this.open(),
this._notifyFocus(e)))
}
open(e, t) {
const r = this._isFilterable()
, n = t || this.getState("options");
if (r) {
const e = ""
, t = this._filterOption(n, e).filter((e => !
e._inputCreateOnly));
this._adapter.updateOptions(t),
this.toggle2SearchInput(!0)
} else
this._adapter.updateFocusState(!0);
this._adapter.openMenu(( () => {
const {searchPosition: e, autoFocus: t} = this.getProps();
t && e === strings$8.SEARCH_POSITION_DROPDOWN &&
this._adapter.focusDropdownInput()
}
)),
this._setDropdownWidth(),
this._adapter.notifyDropdownVisibleChange(!0),
this.bindKeyBoardEvent(),
this._adapter.registerClickOutsideHandler((e => {
this.close({
event: e
}),
this._notifyBlur(e),
this._adapter.updateFocusState(!1)
}
))
}
toggle2SearchInput(e) {
e ? this._adapter.toggleInputShow(e, ( () => this.focusInput())) :
this._adapter.toggleInputShow(e, ( () => {}
))
}
close(e) {
const {event: t, closeCb: r, notToggleInput: n} = e || {};
this._adapter.closeMenu(),
this._adapter.notifyDropdownVisibleChange(!1),
this._adapter.setIsFocusInContainer(!1),
this._adapter.unregisterClickOutsideHandler();
const i = this._isFilterable();
i && !n && this.toggle2SearchInput(!1),
this._adapter.once("popoverClose", ( () => {
i && this.clearInput(t),
r && r()
}
))
}
onSelect(e, t, r) {
if (this._isDisabled())
return;
e._inputCreateOnly && this._adapter.notifyCreate(e);
this._isMultiple() ? this._handleMultipleSelect(e, r) :
(this._handleSingleSelect(e, r),
this._focusTrigger()),
this._adapter.updateFocusIndex(t)
}
_handleSingleSelect(e, t) {
var {value: r, label: n} = e
, i = __rest$r(e, ["value", "label"]);
const o = (new Map).set(n, Object.assign({
value: r,
label: n
}, i));
this._notifySelect(r, Object.assign({
value: r,
label: n
}, i));
const s = this._isFilterable();
this._isControlledComponent() ? this.close({
event: t,
notToggleInput: !0,
closeCb: () => {
this._notifyChange(o),
s && this.toggle2SearchInput(!1)
}
}) : (this._adapter.updateSelection(o),
this._notifyChange(o),
this.close({
event: t,
closeCb: () => {
this.updateOptionsActiveStatus(o)
}
}))
}
_handleMultipleSelect(e, t) {
var {value: r, label: n} = e
, i = __rest$r(e, ["value", "label"]);
const o = this._adapter.getMaxLimit()
, s = this._adapter.getSelections()
, {autoClearSearchValue: a} = this.getProps();
if (s.has(n))
this._notifyDeselect(r, Object.assign({
value: r,
label: n
}, i)),
s.delete(n);
else {
if (o && s.size === o)
return void this._adapter.notifyMaxLimit(Object.assign({
value: r,
label: n
}, _omit(i, "_scrollIndex")));
this._notifySelect(r, Object.assign({
value: r,
label: n
}, i)),
s.set(n, Object.assign({
value: r,
label: n
}, i))
}
if (this._isControlledComponent())
this._notifyChange(s),
this._isFilterable() && (a && this.clearInput(t),
this.focusInput());
else {
this._adapter.updateSelection(s),
this.updateOverflowItemCount(s.size),
this._adapter.rePositionDropdown();
let {options: e} = this.getStates();
if (this._isFilterable()) {
if (a) {
this.clearInput(t);
const r = "";
e = this._filterOption(e, r)
}
this.focusInput()
}
this.updateOptionsActiveStatus(s, e),
this._notifyChange(s)
}
}
clearSelected() {
const e = new Map;
this._isControlledComponent() ? (this._notifyChange(e),
this._adapter.notifyClear()) : (this._adapter.updateSelection(e),
this.updateOptionsActiveStatus(e),
this._notifyChange(e),
this._adapter.notifyClear());
const {isOpen: t} = this.getStates();
t && this._adapter.rePositionDropdown()
}
updateOptionsActiveStatus(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : this.getState("options");
const {allowCreate: r} = this.getProps()
, n = t.map((t => (e.has(t.label) ? (t._selected = !0,
r && delete t._inputCreateOnly) : (t._inputCreateOnly && (t._show =
!1),
t._selected = !1),
t)));
this._adapter.updateOptions(n)
}
removeTag(e) {
const t = this._adapter.getSelections();
t.delete(e.label),
this._isControlledComponent() ? (this._notifyDeselect(e.value, e),
this._notifyChange(t)) : (this._notifyDeselect(e.value, e),
this._adapter.updateSelection(t),
this.updateOverflowItemCount(t.size),
this.updateOptionsActiveStatus(t),
this._adapter.rePositionDropdown(),
this._notifyChange(t))
}
clearInput(e) {
const {inputValue: t} = this.getStates();
if ("" !== t) {
this._adapter.updateInputValue(""),
this._adapter.notifySearch("", e);
const {options: t} = this.getStates()
, {remote: r} = this.getProps();
let n = t;
r || (n = this._filterOption(t, "")),
this._adapter.updateOptions(n)
}
}
focusInput() {
this._adapter.focusInput(),
this._adapter.updateFocusState(!0),
this._adapter.setIsFocusInContainer(!1)
}
handleInputChange(e, t) {
this._adapter.updateInputValue(e);
const {options: r, isOpen: n} = this.getStates()
, {allowCreate: i, remote: o} = this.getProps();
let s = r;
o || (s = this._filterOption(r, e)),
s = this._createOptionByInput(i, s, e),
this._adapter.updateOptions(s),
this._adapter.notifySearch(e, t),
this._isMultiple() && this._adapter.rePositionDropdown()
}
_filterOption(e, t) {
const r = this.getProp("filter");
if (!r)
return e;
if ("boolean" == typeof r && r) {
const r = t.toLowerCase();
return e.map((e => {
const t = e.label.toString().toLowerCase()
, n = e._parentGroup && e._parentGroup.label
, i = t.includes(r)
, o = _isString(n) && n.toLowerCase().includes(r);
return e._show = !(!i && !o),
e
}
))
}
return "function" == typeof r ? e.map((e => (r(t, e) ? e._show = !0
: e._show = !1,
e))) : void 0
}
_createOptionByInput(e, t, r) {
if (e)
if (r) {
const e = {
_show: !0,
_selected: !1,
value: r,
label: r,
_inputCreateOnly: !0
};
let n = -1
, i = -1;
t.forEach(( (e, t) => {
(e._show || e._inputCreateOnly) && (e.label === r && (i
= t),
e._inputCreateOnly && (n = t,
e.value = r,
e.label = r,
e._show = !0))
}
)),
-1 === n && -1 === i && t.push(e),
-1 !== i && (t = t.filter((e => !e._inputCreateOnly)))
} else
t = t.filter((e => !e._inputCreateOnly));
return t
}
bindKeyBoardEvent() {
this._keydownHandler = e => {
this._handleKeyDown(e)
}
,
this._adapter.registerKeyDown(this._keydownHandler)
}
unBindKeyBoardEvent() {
this._keydownHandler && this._adapter.unregisterKeyDown()
}
_handleKeyDown(e) {
const t = e.keyCode
, {loading: r, filter: n, multiple: i, disabled: o} =
this.getProps()
, {isOpen: s} = this.getStates();
if (!r && !o)
switch (t) {
case KeyCode.UP:
e.preventDefault(),
this._handleArrowKeyDown(-1);
break;
case KeyCode.DOWN:
e.preventDefault(),
this._handleArrowKeyDown(1);
break;
case KeyCode.BACKSPACE:
this._handleBackspaceKeyDown();
break;
case KeyCode.ENTER:
handlePrevent(e),
this._handleEnterKeyDown(e);
break;
case KeyCode.ESC:
s && this.close({
event: e
}),
n && !i && this._focusTrigger();
break;
case KeyCode.TAB:
this._handleTabKeyDown(e)
}
}
handleContainerKeyDown(e) {
const t = e.keyCode
, {isOpen: r} = this.getStates();
if (t === KeyCode.TAB)
r && this._handleTabKeyDown(e)
}
_getEnableFocusIndex(e) {
const {focusIndex: t, options: r} = this.getStates()
, n = r.filter((e => e._show))
, i = n.length;
let o = t + e;
if (o < 0 && (o = i - 1),
o >= i && (o = 0),
e > 0) {
let e = -1;
for (let t = 0; t < n.length; t++) {
if (!n[t].disabled && (e = t),
e >= o)
break
}
o = e
} else {
let e = n.length;
for (let t = i - 1; t >= 0; t--) {
if (!n[t].disabled && (e = t),
e <= o)
break
}
o = e
}
this._adapter.updateFocusIndex(o),
this._adapter.updateScrollTop(o)
}
_handleArrowKeyDown(e) {
const {isOpen: t} = this.getStates();
t ? this._getEnableFocusIndex(e) : this.open()
}
_handleTabKeyDown(e) {
const {isOpen: t} = this.getStates();
if (this._adapter.updateFocusState(!1),
t) {
const t = this._adapter.getContainer()
, r = this._adapter.getFocusableElements(t);
r.length > 0 ? e.shiftKey ?
this._handlePanelOpenShiftTabKeyDown(r, e) : this._handlePanelOpenTabKeyDown(r,
e) : (this.close({
event: e
}),
this._notifyBlur(e))
} else
this._notifyBlur(e)
}
_handlePanelOpenTabKeyDown(e, t) {
const r = this._adapter.getActiveElement();
this._adapter.getIsFocusInContainer() ? r === e[e.length - 1] &&
(this._focusTrigger(),
this.close({
event: t
}),
handlePrevent(t)) : (e[0].focus(),
this._adapter.setIsFocusInContainer(!0),
handlePrevent(t))
}
_handlePanelOpenShiftTabKeyDown(e, t) {
const r = this._adapter.getActiveElement();
this._adapter.getIsFocusInContainer() ? r === e[0] &&
(this._focusTrigger(),
this._adapter.setIsFocusInContainer(!1),
handlePrevent(t)) : (this.close({
event: t
}),
this._notifyBlur(t))
}
_handleEnterKeyDown(e) {
const {isOpen: t, options: r, focusIndex: n} = this.getStates();
if (t)
if (-1 !== n) {
const t = r.filter((e => e._show))
, {length: i} = t;
if (i <= n)
return;
if (t && i) {
const r = t[n];
if (r.disabled)
return;
this.onSelect(r, n, e)
}
} else
this.close({
event: e
});
else
this.open()
}
_handleBackspaceKeyDown() {
if (this._isMultiple()) {
const e = this._adapter.getSelections()
, {inputValue: t} = this.getStates()
, r = e.size;
if (r && !t) {
const t = [...e.keys()];
let n = r - 1
, i = t[n]
, o = e.get(i)
, s = !1;
if (o.disabled && 0 === n)
return;
for (; o.disabled && 0 !== n; )
n -= 1,
i = t[n],
o = e.get(i),
0 == n && o.disabled && (s = !0);
s || this.removeTag(o)
}
}
}
_notifyChange(e) {
const {onChangeWithObject: t} = this.getProps()
, r = this.getState("selections");
let n;
const i = [...e.values()]
, o = this._isMultiple();
if (this._diffSelections(e, r, o))
switch (!0) {
case t:
this._notifyChangeWithObject(e);
break;
case !t && !o:
n = i.length ? i[0].value : void 0,
this._adapter.notifyChange(n);
break;
case !t && o:
n = i.length ? i.map((e => e.value)) : [],
this._adapter.notifyChange(n)
}
}
_removeInternalKey(e) {
let t = Object.assign({}, e);
return delete t._parentGroup,
delete t._show,
delete t._selected,
delete t._scrollIndex,
delete t._keyInJsx,
"_keyInOptionList"in t && (t.key = t._keyInOptionList,
delete t._keyInOptionList),
t
}
_notifySelect(e, t) {
const r = this._removeInternalKey(t);
this._adapter.notifySelect(e, r)
}
_notifyDeselect(e, t) {
const r = this._removeInternalKey(t);
this._adapter.notifyDeselect(e, r)
}
_diffSelections(e, t, r) {
let n = !0
, i = !0;
if (!r) {
const r = [...e.values()]
, o = [...t.values()]
, s = r[0] ? r[0].value : r[0]
, a = o[0] ? o[0].value : o[0];
i = !_isEqual(s, a);
const l = r[0] ? r[0].label : r[0]
, c = o[0] ? o[0].label : o[0];
n = !_isEqual(l, c)
}
return i || n
}
_notifyChangeWithObject(e) {
this.getState("selections");
const t = [];
for (const r of e.entries()) {
let e = Object.assign({
label: r[0]
}, r[1]);
e = this._removeInternalKey(e),
t.push(e)
}
this._isMultiple() ? this._adapter.notifyChange(t) :
this._adapter.notifyChange(t[0])
}
_notifyBlur(e) {
this._adapter.notifyBlur(e)
}
_notifyFocus(e) {
this._adapter.notifyFocus(e)
}
handleMouseEnter(e) {
this._adapter.updateHovering(!0),
this._adapter.notifyMouseEnter(e)
}
handleMouseLeave(e) {
this._adapter.updateHovering(!1),
this._adapter.notifyMouseLeave(e)
}
handleClearClick(e) {
const {filter: t, searchPosition: r} = this.getProps();
t && r === strings$8.SEARCH_POSITION_TRIGGER && this.clearInput(e),
this.focus(),
this.clearSelected(),
e.stopPropagation()
}
handleKeyPress(e) {
e && e.key === ENTER_KEY && this.handleClick(e)
}
handleClearBtnEnterPress(e) {
isEnterPress(e) && this.handleClearClick(e)
}
handleOptionMouseEnter(e) {
this._adapter.updateFocusIndex(e)
}
handleListScroll(e) {
this._adapter.notifyListScroll(e)
}
handleTriggerFocus(e) {
this.bindKeyBoardEvent(),
this._adapter.setIsFocusInContainer(!1)
}
handleTriggerBlur(e) {
this.getProps();
const {isOpen: t, isFocus: r} = this.getStates();
r && !t && (this._notifyBlur(e),
this._adapter.updateFocusState(!1))
}
handleInputBlur(e) {
const {filter: t, autoFocus: r} = this.getProps()
, n = this._isMultiple();
r && t && !n && this.toggle2SearchInput(!1)
}
selectAll() {
const {options: e} = this.getStates()
, {onChangeWithObject: t} = this.getProps();
let r = [];
this._isMultiple() && (r = t ? e : e.map((e => e.value)),
this.handleValueChange(r),
this._adapter.notifyChange(r))
}
checkMultipleProps(e) {
if (this._isMultiple()) {
const t = e || this.getProps()
, {defaultValue: r, value: n} = t
, i = n || r;
isNullOrUndefined(i) || Array.isArray(i) || warning$1(!0,
"[Semi Select] defaultValue/value should be array type in multiple mode")
}
}
updateScrollTop() {
this._adapter.updateScrollTop()
}
updateOverflowItemCount(e, t) {
const {maxTagCount: r, ellipsisTrigger: n} = this.getProps();
n && (t ? this._adapter.updateOverflowItemCount(t) : "number" ==
typeof r && (e - r > 0 ? this._adapter.updateOverflowItemCount(e - r) :
this._adapter.updateOverflowItemCount(0)))
}
updateIsFullTags() {
const {isFullTags: e} = this.getStates();
e || this._adapter.setState({
isFullTags: !0
})
}
handlePopoverClose() {
this._adapter.emit("popoverClose")
}
handleSlotMouseEnter() {
this._adapter.updateFocusIndex(-1)
}
}
const prefixCls$6 = cssClasses$o.PREFIX
, tagSize = strings$i.TAG_SIZE
, avatarShapeSet = strings$i.AVATAR_SHAPE;
class TagGroup extends reactExports.PureComponent {
renderNTag(e, t) {
const {size: r, showPopover: n, popoverProps: i, onPlusNMouseEnter:
o} = this.props;
let s = React.createElement(Tag, {
closable: !1,
size: r,
color: "grey",
style: {
backgroundColor: "transparent"
},
key: "_+n",
onMouseEnter: o
}, "+", e);
return n && (s = React.createElement(Popover$1, Object.assign({
showArrow: !0,
content: t,
trigger: "hover",
position: "top",
autoAdjustOverflow: !0,
className: `${prefixCls$6}-rest-group-popover`
}, i, {
key: "_+n_Popover"
}), s)),
s
}
renderMergeTags(e) {
const {maxTagCount: t, tagList: r, restCount: n} = this.props
, i = n || r.length - t;
let o = e;
const s = e.slice(0, t)
, a = e.slice(t);
let l = null;
return i > 0 && (l = this.renderNTag(i, a),
s.push(l),
o = s),
o
}
renderAllTags() {
const {tagList: e, size: t, mode: r, avatarShape: n, onTagClose: i}
= this.props
, o = e.map((e => {
if ("custom" === r)
return e;
const o = Object.assign({}, e);
return o.size || (o.size = t),
o.avatarShape || (o.avatarShape = n),
o.tagKey || ("string" == typeof o.children || "number" ==
typeof o.children ? o.tagKey = o.children : o.tagKey = Math.random()),
React.createElement(Tag, Object.assign({}, o, {
key: o.tagKey,
onClose: (e, t, r) => {
o.onClose && o.onClose(e, t, r),
i && i(e, t, r)
}
}))
}
));
return o
}
render() {
const {style: e, className: t, maxTagCount: r, size: n} =
this.props
, i = classNames({
[`${prefixCls$6}-group`]: !0,
[`${prefixCls$6}-group-max`]: r,
[`${prefixCls$6}-group-small`]: "small" === n,
[`${prefixCls$6}-group-large`]: "large" === n
}, t)
, o = this.renderAllTags()
, s = void 0 === r ? o : this.renderMergeTags(o);
return React.createElement("div", {
style: e,
className: i
}, s)
}
}
TagGroup.defaultProps = {
style: {},
className: "",
size: tagSize[0],
avatarShape: "square",
onTagClose: () => {}
,
onPlusNMouseEnter: () => {}
},
TagGroup.propTypes = {
children: PropTypes.node,
style: PropTypes.object,
className: PropTypes.string,
maxTagCount: PropTypes.number,
restCount: PropTypes.number,
tagList: PropTypes.array,
size: PropTypes.oneOf(tagSize),
mode: PropTypes.string,
onTagClose: PropTypes.func,
showPopover: PropTypes.bool,
popoverProps: PropTypes.object,
avatarShape: PropTypes.oneOf(avatarShapeSet)
};
var __rest$q = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const generateOption = (e, t, r, n) => {
const i = e.props;
if (!e || !i)
return null;
const o = Object.assign(Object.assign({
value: i.value,
label: i.label || i.children || i.value,
_show: !0,
_selected: !1,
_scrollIndex: r
}, i), {
_parentGroup: t
});
return o._keyInJsx = n || e.key,
o
}
, getOptionsFromGroup = e => {
let t = []
, r = [];
const n = {
label: "",
children: [],
_show: !1
};
let i = React.Children.toArray(e);
i = i.filter((e => e && e.props));
let o = ""
, s = -1;
return i.forEach((e => {
if (e.type.isSelectOption) {
o = "option",
s++;
const t = generateOption(e, void 0, s);
n.children.push(t),
r.push(t)
} else if (e.type.isSelectOptionGroup) {
o = "group";
let n = e.props
, {children: i} = n
, a = __rest$q(n, ["children"])
, l = [];
Array.isArray(i) ? l = i.map((e => e.key)) : l.push(i.key),
i = React.Children.toArray(i);
const c = i.map(( (t, r) => {
let n = t.key;
return null === l[r] && (n = e.key + "" + t.key),
s++,
generateOption(t, a, s, n)
}
))
, u = Object.assign(Object.assign({}, e.props), {
children: c,
key: e.key
});
t.push(u),
r = r.concat(c)
} else
warning$1(!0, "[Semi Select] The children of `Select` should be
`Select.Option` or `Select.OptionGroup`")
}
)),
"option" === o && (t = [n]),
{
optionGroups: t,
options: r
}
}
, VirtualRow = e => {
let {index: t, data: r, style: n} = e;
const {visibleOptions: i, renderOption: o} = r;
return o(i[t], t, n)
}
, VirtualRow$1 = VirtualRow;
var __rest$p = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class Option extends reactExports.PureComponent {
onClick(e, t) {
var {value: r, label: n, children: i} = e
, o = __rest$p(e, ["value", "label", "children"]);
const {props: s} = this;
s.disabled || s.onSelect(Object.assign(Object.assign({}, o), {
value: r,
label: n || i
}), t)
}
renderOptionContent(e) {
let {config: t, children: r, inputValue: n, prefixCls: i} = e;
return _isString(r) && n ? getHighLightTextHTML(t) : r
}
render() {
const e = this.props
, {children: t, disabled: r, value: n, selected: i, label: o,
empty: s, emptyContent: a, onSelect: l, focused: c, showTick: u, className: d,
style: p, onMouseEnter: h, prefixCls: f, renderOptionItem: m, inputValue: g,
semiOptionId: y} = e
, v = __rest$p(e, ["children", "disabled", "value", "selected",
"label", "empty", "emptyContent", "onSelect", "focused", "showTick", "className",
"style", "onMouseEnter", "prefixCls", "renderOptionItem", "inputValue",
"semiOptionId"])
, b = classNames(f, {
[`${f}-disabled`]: r,
[`${f}-selected`]: i,
[`${f}-focused`]: c,
[`${f}-empty`]: s,
[d]: d
})
, x = classNames([`${f}-icon`]);
if (s)
return null === a ? null : React.createElement(LocaleConsumer,
{
componentName: "Select"
}, (e => React.createElement("div", {
className: b,
"x-semi-prop": "emptyContent"
}, a || e.emptyText)));
if ("function" == typeof m)
return m(Object.assign({
disabled: r,
focused: c,
selected: i,
style: p,
label: o,
value: n,
inputValue: g,
onMouseEnter: e => h(e),
onClick: e => this.onClick(Object.assign({
value: n,
label: o,
children: t
}, v), e),
className: d
}, v));
const _ = {
searchWords: g,
sourceString: t,
option: {
highlightClassName: `${f}-keyword`
}
};
return React.createElement("div", Object.assign({
className: b,
onClick: e => {
this.onClick(Object.assign({
value: n,
label: o,
children: t
}, v), e)
}
,
onMouseEnter: e => h && h(e),
role: "option",
id: y,
"aria-selected": i ? "true" : "false",
"aria-disabled": r ? "true" : "false",
style: p
}, getDataAttr(v)), u ? React.createElement("div", {
className: x
}, React.createElement(IconTick, null)) : null, _isString(t) ?
React.createElement("div", {
className: `${f}-text`
}, this.renderOptionContent({
children: t,
config: _,
inputValue: g,
prefixCls: f
})) : t)
}
}
Option.isSelectOption = !0,
Option.propTypes = {
children: PropTypes.node,
disabled: PropTypes.bool,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
selected: PropTypes.bool,
label: PropTypes.node,
empty: PropTypes.bool,
emptyContent: PropTypes.node,
onSelect: PropTypes.func,
focused: PropTypes.bool,
showTick: PropTypes.bool,
className: PropTypes.string,
style: PropTypes.object,
onMouseEnter: PropTypes.func,
prefixCls: PropTypes.string,
renderOptionItem: PropTypes.func,
inputValue: PropTypes.string
},
Option.defaultProps = {
prefixCls: cssClasses$a.PREFIX_OPTION
};
const Option$1 = Option;
var __rest$o = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$5 = cssClasses$a.PREFIX_GROUP;
class OptionGroup extends BaseComponent {
render() {
const e = this.props
, {label: t, className: r, style: n} = e
, i = __rest$o(e, ["label", "className", "style"])
, o = classNames(r, {
[prefixCls$5]: !0
});
return t || "number" == typeof t ? React.createElement("div",
Object.assign({
className: o,
style: n
}, this.getDataAttr(i)), t) : null
}
}
OptionGroup.isSelectOptionGroup = !0,
OptionGroup.propTypes = {
children: PropTypes.oneOfType([PropTypes.array, PropTypes.node]),
label: PropTypes.node,
className: PropTypes.string,
style: PropTypes.object
};
const OptionGroup$1 = OptionGroup
, select = "";
var __rest$n = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixcls$3 = cssClasses$a.PREFIX
, key$1 = 0;
class Select extends BaseComponent {
constructor(e) {
super(e),
this.setOptionContainerEl = e => this.optionContainerEl = {
current: e
},
this.handleInputChange = (e, t) =>
this.foundation.handleInputChange(e, t),
this.getTagItem = (e, t, r) => {
const {size: n, disabled: i} = this.props
, o = e[0]
, {value: s} = e[1]
, a = e[1].disabled || i
, l = (e, t) => {
t && "function" == typeof t.preventDefault &&
t.preventDefault(),
this.foundation.removeTag({
label: o,
value: s
})
}
, {content: c, isRenderInTag: u} = r(e[1], {
index: t,
disabled: a,
onClose: l
})
, d = {
disabled: a,
closable: !a,
onClose: l
};
return u ? React.createElement(Tag, Object.assign({}, d, {
color: "white",
size: n || "large",
key: s,
tabIndex: -1
}), c) : React.createElement(reactExports.Fragment, {
key: s
}, c)
}
,
this.state = {
isOpen: !1,
isFocus: !1,
options: [],
selections: new Map,
dropdownMinWidth: null,
optionKey: key$1,
inputValue: "",
showInput: !1,
focusIndex: e.defaultActiveFirstOption ? 0 : -1,
keyboardEventSet: {},
optionGroups: [],
isHovering: !1,
isFocusInContainer: !1,
isFullTags: !1,
overflowItemCount: 0
},
this.selectOptionListID = "",
this.selectID = "",
this.virtualizeListRef = React.createRef(),
this.inputRef = React.createRef(),
this.dropdownInputRef = React.createRef(),
this.triggerRef = React.createRef(),
this.optionsRef = React.createRef(),
this.optionContainerEl = React.createRef(),
this.clickOutsideHandler = null,
this.onSelect = this.onSelect.bind(this),
this.onClear = this.onClear.bind(this),
this.onMouseEnter = this.onMouseEnter.bind(this),
this.onMouseLeave = this.onMouseLeave.bind(this),
this.renderOption = this.renderOption.bind(this),
this.onKeyPress = this.onKeyPress.bind(this),
this.eventManager = new Event$2,
this.foundation = new SelectFoundation(this.adapter)
}
get adapter() {
var e = this;
const t = {
registerKeyDown: e => {
const t = {
onKeyDown: e
};
this.setState({
keyboardEventSet: t
})
}
,
unregisterKeyDown: () => {
this.setState({
keyboardEventSet: {}
})
}
,
updateFocusIndex: e => {
this.setState({
focusIndex: e
})
}
,
scrollToFocusOption: () => {}
}
, r = {
updateInputValue: e => {
this.setState({
inputValue: e
})
}
,
toggleInputShow: (e, t) => {
this.setState({
showInput: e
}, ( () => {
t()
}
))
}
,
focusInput: () => {
const {preventScroll: e} = this.props;
this.inputRef && this.inputRef.current &&
this.inputRef.current.focus({
preventScroll: e
})
}
,
focusDropdownInput: () => {
const {preventScroll: e} = this.props;
this.dropdownInputRef && this.dropdownInputRef.current &&
this.dropdownInputRef.current.focus({
preventScroll: e
})
}
}
, n = {
notifyMaxLimit: e => this.props.onExceed(e),
getMaxLimit: () => this.props.max,
registerClickOutsideHandler: e => {
const t = t => {
const r = this.optionsRef && this.optionsRef.current
, n = this.triggerRef && this.triggerRef.current
, i = ReactDOM.findDOMNode(r)
, o = t.target
, s = t.composedPath && t.composedPath() || [o];
i && i.contains(o) || n && n.contains(o) ||
s.includes(n) || s.includes(i) || e(t)
}
;
this.clickOutsideHandler = t,
document.addEventListener("mousedown", t, !1)
}
,
unregisterClickOutsideHandler: () => {
this.clickOutsideHandler &&
(document.removeEventListener("mousedown", this.clickOutsideHandler, !1),
this.clickOutsideHandler = null)
}
,
rePositionDropdown: () => {
let {optionKey: e} = this.state;
e += 1,
this.setState({
optionKey: e
})
}
,
notifyDeselect: (e, t) => {
delete t._parentGroup,
this.props.onDeselect(e, t)
}
};
return
Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},
super.adapter), t), r), n), {
on: (e, t) => this.eventManager.on(e, t),
off: e => this.eventManager.off(e),
once: (e, t) => this.eventManager.once(e, t),
emit: e => this.eventManager.emit(e),
getOptionsFromChildren: function() {
let t = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : e.props.children
, r = []
, n = [];
const {optionList: i} = e.props;
if (i && i.length)
n = i.map(( (e, t) => Object.assign({
_show: !0,
_selected: !1,
_scrollIndex: t
}, e))),
r[0] = {
children: n,
label: ""
};
else {
const e = getOptionsFromGroup(t);
r = e.optionGroups,
n = e.options
}
return e.setState({
optionGroups: r
}),
n
},
updateOptions: e => {
this.setState({
options: e
})
}
,
openMenu: e => {
this.setState({
isOpen: !0
}, ( () => {
null == e || e()
}
))
}
,
closeMenu: () => {
this.setState({
isOpen: !1
})
}
,
getTriggerWidth: () => {
const e = this.triggerRef.current;
return e && e.getBoundingClientRect().width
}
,
setOptionWrapperWidth: e => {
this.setState({
dropdownMinWidth: e
})
}
,
updateSelection: e => {
this.setState({
selections: e
})
}
,
getSelections: () => new Map(this.state.selections),
notifyChange: e => {
this.props.onChange(e)
}
,
notifySelect: (e, t) => {
delete t._parentGroup,
this.props.onSelect(e, t)
}
,
notifyDropdownVisibleChange: e => {
this.props.onDropdownVisibleChange(e)
}
,
notifySearch: (e, t) => {
this.props.onSearch(e, t)
}
,
notifyCreate: e => {
this.props.onCreate(e)
}
,
notifyMouseEnter: e => {
this.props.onMouseEnter(e)
}
,
notifyMouseLeave: e => {
this.props.onMouseLeave(e)
}
,
notifyFocus: e => {
this.props.onFocus(e)
}
,
notifyBlur: e => {
this.props.onBlur(e)
}
,
notifyClear: () => {
this.props.onClear()
}
,
notifyListScroll: e => {
this.props.onListScroll(e)
}
,
updateHovering: e => {
this.setState({
isHovering: e
})
}
,
updateFocusState: e => {
this.setState({
isFocus: e
})
}
,
updateOverflowItemCount: e => {
this.setState({
overflowItemCount: e
})
}
,
focusTrigger: () => {
try {
const {preventScroll: e} = this.props;
this.triggerRef.current.focus({
preventScroll: e
})
} catch (e) {}
}
,
getContainer: () => this.optionContainerEl &&
this.optionContainerEl.current,
getFocusableElements: e => getFocusableElements(e),
getActiveElement: () => getActiveElement(),
setIsFocusInContainer: e => {
this.setState({
isFocusInContainer: e
})
}
,
getIsFocusInContainer: () => this.state.isFocusInContainer,
updateScrollTop: e => {
let t = `.${prefixcls$3}-option-selected`;
void 0 !== e && (t = `.${prefixcls$3}-option:nth-child($
{e})`);
let r = document.querySelector(`#${prefixcls$3}-$
{this.selectOptionListID} ${t}`);
if (Array.isArray(r) && (r = r[0]),
r) {
const e = r.parentNode;
e.scrollTop = r.offsetTop - e.offsetTop -
e.clientHeight / 2 + r.clientHeight / 2
}
}
})
}
componentDidMount() {
this.foundation.init(),
this.selectOptionListID = getUuidShort(),
this.selectID = this.props.id || getUuidShort()
}
componentWillUnmount() {
this.foundation.destroy()
}
componentDidUpdate(e, t) {
const r = React.Children.toArray(e.children).map((e => e.key))
, n = React.Children.toArray(this.props.children).map((e =>
e.key));
let i = !1;
_isEqual(r, n) && _isEqual(e.optionList, this.props.optionList) ||
(i = !0,
this.foundation.handleOptionListChange()),
_isEqual(this.props.value, e.value) && !i || ("value"in
this.props ? this.foundation.handleValueChange(this.props.value) :
this.foundation.handleOptionListChangeHadDefaultValue())
}
renderTriggerInput() {
const {size: e, multiple: t, disabled: r, inputProps: n, filter: i}
= this.props
, o = _get(n, "className")
, s = classNames(`${prefixcls$3}-input`, {
[`${prefixcls$3}-input-single`]: !t,
[`${prefixcls$3}-input-multiple`]: t
}, o)
, {inputValue: a, focusIndex: l} = this.state
, c = Object.assign({
value: a,
disabled: r,
className: s,
onChange: this.handleInputChange
}, n);
let u = {};
return t && (u = {
width: a ? 16 * a.length + "px" : "2px"
},
c.style = u),
React.createElement(Input$1, Object.assign({
ref: this.inputRef,
size: e,
"aria-activedescendant": -1 !== l ? `${this.selectID}-option-$
{l}` : "",
onFocus: e => {
t && Boolean(i) && this.setState({
isFocus: !0
}),
e.stopPropagation()
}
,
onBlur: e => this.foundation.handleInputBlur(e)
}, c))
}
renderDropdownInput() {
const {size: e, multiple: t, disabled: r, inputProps: n, filter: i,
searchPosition: o, searchPlaceholder: s} = this.props
, {inputValue: a, focusIndex: l} = this.state
, c = classNames(`${prefixcls$3}-dropdown-search-wrapper`, {})
, u = _get(n, "className")
, d = classNames(`${prefixcls$3}-dropdown-input`, {
[`${prefixcls$3}-dropdown-input-single`]: !t,
[`${prefixcls$3}-dropdown-input-multiple`]: t
}, u)
, p = Object.assign(Object.assign({
value: a,
disabled: r,
className: d,
onChange: this.handleInputChange,
placeholder: s,
showClear: !0
}, n), {
onKeyDown: e => this.foundation._handleKeyDown(e)
});
return React.createElement("div", {
className: c
}, React.createElement(Input$1, Object.assign({
ref: this.dropdownInputRef,
prefix: React.createElement(IconSearch$1, null),
"aria-activedescendant": -1 !== l ? `${this.selectID}-option-$
{l}` : ""
}, p)))
}
close() {
this.foundation.close()
}
open() {
this.foundation.open()
}
clearInput() {
this.foundation.clearInput()
}
selectAll() {
this.foundation.selectAll()
}
deselectAll() {
this.foundation.clearSelected()
}
focus() {
this.foundation.focus()
}
onSelect(e, t, r) {
this.foundation.onSelect(e, t, r)
}
onClear(e) {
e.nativeEvent.stopImmediatePropagation(),
this.foundation.handleClearClick(e)
}
search(e, t) {
this.handleInputChange(e, t)
}
renderEmpty() {
return React.createElement(Option$1, {
empty: !0,
emptyContent: this.props.emptyContent
})
}
renderLoading() {
const e = `${prefixcls$3}-loading-wrapper`;
return React.createElement("div", {
className: e
}, React.createElement(Spin$1, null))
}
renderOption(e, t, r) {
const {focusIndex: n, inputValue: i} = this.state
, {renderOptionItem: o} = this.props;
let s;
const a = t === n;
let l = r || {};
return e.style && (l = Object.assign(Object.assign({}, l),
e.style)),
e._inputCreateOnly ? s = this.renderCreateOption(e, a, t, r) :
("key"in e && (e._keyInOptionList = e.key),
s = React.createElement(Option$1, Object.assign({
showTick: !0
}, e, {
selected: e._selected,
onSelect: (e, r) => this.onSelect(e, t, r),
focused: a,
onMouseEnter: () => this.onOptionHover(t),
style: l,
key: e._keyInOptionList || e._keyInJsx || e.label + e.value +
t,
renderOptionItem: o,
inputValue: i,
semiOptionId: `${this.selectID}-option-${t}`
}), e.label)),
s
}
renderCreateOption(e, t, r, n) {
const {renderCreateItem: i} = this.props;
if (void 0 === i) {
const i = React.createElement(Option$1, Object.assign({
key: e.key || e.label + e.value,
onSelect: (e, t) => this.onSelect(e, r, t),
onMouseEnter: () => this.onOptionHover(r),
showTick: !0
}, e, {
focused: t,
style: n
}), React.createElement(LocaleConsumer, {
componentName: "Select"
}, (t => React.createElement(React.Fragment, null,
React.createElement("span", {
className: `${prefixcls$3}-create-tips`
}, t.createText), e.value))));
return i
}
const o = i(e.value, t, n);
return React.createElement("div", {
role: "button",
"aria-label": "Use the input box to create an optional item",
onClick: t => this.onSelect(e, r, t),
key: e.key || e.label
}, o)
}
onOptionHover(e) {
this.foundation.handleOptionMouseEnter(e)
}
renderWithGroup(e) {
const t = []
, r = new Map;
return e.forEach(( (e, n) => {
const i = e._parentGroup
, o = this.renderOption(e, n);
if (i && !r.has(i.label)) {
const e = React.createElement(OptionGroup$1,
Object.assign({}, i, {
key: i.label
}));
r.set(i.label, !0),
t.push(e)
}
t.push(o)
}
)),
t
}
renderVirtualizeList(e) {
const {virtualize: t} = this.props
, {direction: r} = this.context
, {height: n, width: i, itemSize: o} = t;
return React.createElement(FixedSizeList, {
ref: this.virtualizeListRef,
height: n || numbers$3.LIST_HEIGHT,
itemCount: e.length,
itemSize: o,
itemData: {
visibleOptions: e,
renderOption: this.renderOption
},
width: i || "100%",
style: {
direction: r
}
}, VirtualRow$1)
}
renderOptions(e) {
const {dropdownMinWidth: t, options: r, selections: n} = this.state
, {maxHeight: i, dropdownClassName: o, dropdownStyle: s,
outerTopSlot: a, innerTopSlot: l, outerBottomSlot: c, innerBottomSlot: u, loading:
d, virtualize: p, multiple: h, emptyContent: f, searchPosition: m, filter: g} =
this.props
, y = r.filter((e => e._show));
let v = this.renderWithGroup(y);
p && (v = this.renderVirtualizeList(y));
const b = Object.assign({
minWidth: t
}, s)
, x = classNames({
[`${prefixcls$3}-option-list`]: !0,
[`${prefixcls$3}-option-list-chosen`]: n.size
})
, _ = !r.length || !r.some((e => e._show));
return React.createElement("div", {
id: `${prefixcls$3}-${this.selectOptionListID}`,
className: classNames({
[`${prefixcls$3}-option-list-wrapper`]: !(_ && null === f)
}, o),
style: b,
ref: this.setOptionContainerEl,
onKeyDown: e => this.foundation.handleContainerKeyDown(e)
}, a ? React.createElement("div", {
className: `${prefixcls$3}-option-list-outer-top-slot`,
onMouseEnter: () => this.foundation.handleSlotMouseEnter()
}, a) : null, m === strings$8.SEARCH_POSITION_DROPDOWN && g ?
this.renderDropdownInput() : null, React.createElement("div", {
style: {
maxHeight: `${i}px`
},
className: x,
role: "listbox",
"aria-multiselectable": h,
onScroll: e => this.foundation.handleListScroll(e)
}, l ? React.createElement("div", {
className: `${prefixcls$3}-option-list-inner-top-slot`,
onMouseEnter: () => this.foundation.handleSlotMouseEnter()
}, l) : null, d ? this.renderLoading() : _ ? this.renderEmpty() :
v, u ? React.createElement("div", {
className: `${prefixcls$3}-option-list-inner-bottom-slot`,
onMouseEnter: () => this.foundation.handleSlotMouseEnter()
}, u) : null), c ? React.createElement("div", {
className: `${prefixcls$3}-option-list-outer-bottom-slot`,
onMouseEnter: () => this.foundation.handleSlotMouseEnter()
}, c) : null)
}
renderSingleSelection(e, t) {
let {renderSelectedItem: r, searchPosition: n} = this.props;
const {placeholder: i} = this.props
, {showInput: o, inputValue: s} = this.state;
let a = "";
const l = [...e];
if (void 0 === r && (r = e => e.label),
l.length) {
a = r(l[0][1])
}
const c = n === strings$8.SEARCH_POSITION_TRIGGER
, u = classNames({
[`${prefixcls$3}-selection-text`]: !0,
[`${prefixcls$3}-selection-placeholder`]: !a && 0 !== a,
[`${prefixcls$3}-selection-text-hide`]: s && o && c,
[`${prefixcls$3}-selection-text-inactive`]: !s && o && c
})
, d = `${prefixcls$3}-content-wrapper`;
return React.createElement(React.Fragment, null,
React.createElement("div", {
className: d
}, React.createElement("span", {
className: u,
"x-semi-prop": "placeholder"
}, a || 0 === a ? a : i), t && o && c ? this.renderTriggerInput() :
null))
}
renderTag(e, t, r) {
const {size: n, disabled: i} = this.props;
let {renderSelectedItem: o} = this.props;
const s = e[0]
, {value: a} = e[1]
, l = e[1].disabled || i
, c = (e, t) => {
t && "function" == typeof t.preventDefault &&
t.preventDefault(),
this.foundation.removeTag({
label: s,
value: a
})
}
;
void 0 === o && (o = e => ({
isRenderInTag: !0,
content: e.label
}));
const {content: u, isRenderInTag: d} = o(e[1], {
index: t,
disabled: l,
onClose: c
})
, p = {
disabled: l,
closable: !l,
onClose: c
}
, h = r && !_isFunction(this.props.renderSelectedItem) ?
React.createElement(Text$3, {
size: "small",
ellipsis: {
rows: 1,
showTooltip: {
type: "popover",
opts: {
style: {
width: "auto",
fontSize: 12
}
}
}
}
}, u) : u;
return d ? React.createElement(Tag, Object.assign({}, p, {
color: "white",
size: n || "large",
key: a,
style: {
maxWidth: "100%"
}
}), h) : React.createElement(reactExports.Fragment, {
key: a
}, h)
}
renderNTag(e, t) {
const {size: r, showRestTagsPopover: n, restTagsPopoverProps: i} =
this.props;
let o = React.createElement(Tag, {
closable: !1,
size: r || "large",
color: "grey",
className: `${prefixcls$3}-content-wrapper-collapse-tag`,
key: `_+${e}`,
style: {
marginRight: 0,
flexShrink: 0
}
}, "+", e);
return n && (o = React.createElement(Popover$1, Object.assign({
showArrow: !0,
content: React.createElement(Space$1, {
spacing: 2,
wrap: !0,
style: {
maxWidth: "400px"
}
}, t.map(( (e, t) => this.renderTag(e, t)))),
trigger: "hover",
position: "top",
autoAdjustOverflow: !0
}, i, {
key: `_+${e}_Popover`
}), o)),
o
}
renderOverflow(e, t) {
return e.length && e[0] ? this.renderTag(e[0], t, !0) : null
}
handleOverflow(e) {
const {overflowItemCount: t, selections: r} = this.state
, {maxTagCount: n} = this.props
, i = r.size - n > 0 ? r.size - n + e.length - 1 : e.length - 1;
t !== i && this.foundation.updateOverflowItemCount(r.size, i)
}
renderCollapsedTags(e, t) {
const {overflowItemCount: r} = this.state
, n = "number" == typeof t ? e.slice(0, t) : e;
return React.createElement("div", {
className: `${prefixcls$3}-content-wrapper-collapse`
}, React.createElement(OverflowList$1, {
items: n,
key: String(e.length),
overflowRenderer: e => this.renderOverflow(e, t - 1),
onOverflow: e => this.handleOverflow(e),
visibleItemRenderer: (e, t) => this.renderTag(e, t)
}), r > 0 && this.renderNTag(r, e.slice(e.length - r)))
}
renderOneLineTags(e, t) {
let {renderSelectedItem: r} = this.props;
const {showRestTagsPopover: n, restTagsPopoverProps: i,
maxTagCount: o} = this.props
, {isFullTags: s} = this.state;
let a;
if (void 0 === r && (r = e => ({
isRenderInTag: !0,
content: e.label
})),
n) {
const l = (s ? e : e.slice(0, o)).map(( (e, t) =>
this.getTagItem(e, t, r)));
a = React.createElement(TagGroup, {
tagList: l,
maxTagCount: t,
restCount: s ? void 0 : e.length - o,
size: "large",
mode: "custom",
showPopover: n,
popoverProps: i,
onPlusNMouseEnter: () => {
this.foundation.updateIsFullTags()
}
})
} else {
const n = e.slice(0, o).map(( (e, t) => this.getTagItem(e, t,
r)));
a = React.createElement(TagGroup, {
tagList: n,
maxTagCount: t,
restCount: e.length - o,
size: "large",
mode: "custom"
})
}
return a
}
renderMultipleSelection(e, t) {
let {renderSelectedItem: r, searchPosition: n} = this.props;
const {placeholder: i, maxTagCount: o, expandRestTagsOnClick: s,
ellipsisTrigger: a} = this.props
, {inputValue: l, isOpen: c} = this.state
, u = [...e];
void 0 === r && (r = e => ({
isRenderInTag: !0,
content: e.label
}));
const d = classNames({
[`${prefixcls$3}-content-wrapper`]: !0,
[`${prefixcls$3}-content-wrapper-one-line`]: o && !c,
[`${prefixcls$3}-content-wrapper-empty`]: !u.length
})
, p = classNames({
[`${prefixcls$3}-selection-text`]: !0,
[`${prefixcls$3}-selection-placeholder`]: !u.length,
[`${prefixcls$3}-selection-text-hide`]: u && u.length
})
, h = i && !l ? React.createElement("span", {
className: p
}, i) : null
, f = u.length > o ? o : void 0
, m = !o
, g = a ? this.renderCollapsedTags(u, f) :
this.renderOneLineTags(u, f)
, y = m || s && c ? u.map(( (e, t) => this.renderTag(e, t))) : g
, v = t && n === strings$8.SEARCH_POSITION_TRIGGER;
return React.createElement(React.Fragment, null,
React.createElement("div", {
className: d
}, u && u.length ? y : h, v ? this.renderTriggerInput() : null))
}
onMouseEnter(e) {
this.foundation.handleMouseEnter(e)
}
onMouseLeave(e) {
this.foundation.handleMouseLeave(e)
}
onKeyPress(e) {
this.foundation.handleKeyPress(e)
}
handlePopoverVisibleChange(e) {
const {virtualize: t} = this.props
, {selections: r} = this.state;
if (e)
if (t) {
let e = -1;
if (r.forEach((t => {
const r = _get(t, "_scrollIndex");
_isNumber(r) && r >= 0 && (e = -1 !== e && e < r ? e :
r)
}
)),
-1 !== e)
try {
this.virtualizeListRef.current.scrollToItem(e,
"center")
} catch (n) {}
} else
this.foundation.updateScrollTop()
}
renderSuffix() {
const {suffix: e} = this.props
, t = classNames({
[`${prefixcls$3}-suffix`]: !0,
[`${prefixcls$3}-suffix-text`]: e && _isString(e),
[`${prefixcls$3}-suffix-icon`]: isSemiIcon(e)
});
return React.createElement("div", {
className: t,
"x-semi-prop": "suffix"
}, e)
}
renderPrefix() {
const {prefix: e, insetLabel: t, insetLabelId: r} = this.props
, n = e || t
, i = classNames({
[`${prefixcls$3}-prefix`]: !0,
[`${prefixcls$3}-inset-label`]: t,
[`${prefixcls$3}-prefix-text`]: n && _isString(n),
[`${prefixcls$3}-prefix-icon`]: isSemiIcon(n)
});
return React.createElement("div", {
className: i,
id: r,
"x-semi-prop": "prefix,insetLabel"
}, n)
}
renderSelection() {
const e = this.props
, {disabled: t, multiple: r, filter: n, style: i, id: o, size: s,
className: a, validateStatus: l, showArrow: c, suffix: u, prefix: d, insetLabel: p,
placeholder: h, triggerRender: f, arrowIcon: m, clearIcon: g, borderless: y} = e
, v = __rest$n(e, ["disabled", "multiple", "filter", "style",
"id", "size", "className", "validateStatus", "showArrow", "suffix", "prefix",
"insetLabel", "placeholder", "triggerRender", "arrowIcon", "clearIcon",
"borderless"])
, {selections: b, isOpen: x, keyboardEventSet: _, inputValue: E,
isHovering: T, isFocus: C, showInput: S, focusIndex: $} = this.state
, w = "function" == typeof f
, P = Boolean(n)
, R = w ? classNames(a) : classNames(prefixcls$3, a, {
[`${prefixcls$3}-borderless`]: y,
[`${prefixcls$3}-open`]: x,
[`${prefixcls$3}-focus`]: C,
[`${prefixcls$3}-disabled`]: t,
[`${prefixcls$3}-single`]: !r,
[`${prefixcls$3}-multiple`]: r,
[`${prefixcls$3}-filterable`]: P,
[`${prefixcls$3}-small`]: "small" === s,
[`${prefixcls$3}-large`]: "large" === s,
[`${prefixcls$3}-error`]: "error" === l,
[`${prefixcls$3}-warning`]: "warning" === l,
[`${prefixcls$3}-no-arrow`]: !c,
[`${prefixcls$3}-with-prefix`]: d || p,
[`${prefixcls$3}-with-suffix`]: u
})
, k = this.props.showClear && (b.size || E) && !t && (T || x)
, A = c ? React.createElement("div", {
className: `${prefixcls$3}-arrow`,
"x-semi-prop": "arrowIcon"
}, m) : React.createElement("div", {
className: `${prefixcls$3}-arrow-empty`
})
, I = g || React.createElement(IconClear, null)
, O = w ? React.createElement(Trigger$1, {
value: Array.from(b.values()),
inputValue: E,
onChange: this.handleInputChange,
onSearch: this.handleInputChange,
onRemove: e => this.foundation.removeTag(e),
onClear: this.onClear,
disabled: t,
triggerRender: f,
placeholder: h,
componentName: "Select",
componentProps: Object.assign({}, this.props)
}) : [React.createElement(reactExports.Fragment, {
key: "prefix"
}, d || p ? this.renderPrefix() : null),
React.createElement(reactExports.Fragment, {
key: "selection"
}, React.createElement("div", {
className: classNames(`${prefixcls$3}-selection`)
}, r ? this.renderMultipleSelection(b, P) :
this.renderSingleSelection(b, P))), React.createElement(reactExports.Fragment, {
key: "clearicon"
}, k ? React.createElement("div", {
className: classNames(`${prefixcls$3}-clear`),
onClick: this.onClear
}, I) : A), React.createElement(reactExports.Fragment, {
key: "suffix"
}, u ? this.renderSuffix() : null)]
, D = t || P && S || P && r ? -1 : 0;
return React.createElement("div", Object.assign({
role: "combobox",
"aria-disabled": t,
"aria-expanded": x,
"aria-controls": `${prefixcls$3}-${this.selectOptionListID}`,
"aria-haspopup": "listbox",
"aria-label": b.size ? "selected" : "",
"aria-invalid": this.props["aria-invalid"],
"aria-errormessage": this.props["aria-errormessage"],
"aria-labelledby": this.props["aria-labelledby"],
"aria-describedby": this.props["aria-describedby"],
"aria-required": this.props["aria-required"],
className: R,
ref: e => this.triggerRef.current = e,
onClick: e => this.foundation.handleClick(e),
style: i,
id: this.selectID,
tabIndex: D,
"aria-activedescendant": -1 !== $ ? `${this.selectID}-option-$
{$}` : "",
onMouseEnter: this.onMouseEnter,
onMouseLeave: this.onMouseLeave,
onFocus: e => this.foundation.handleTriggerFocus(e),
onBlur: e => this.foundation.handleTriggerBlur(e),
onKeyPress: this.onKeyPress
}, _, this.getDataAttr(v)), O)
}
render() {
const {direction: e} = this.context
, t = "rtl" === e ? "bottomRight" : "bottomLeft"
, {children: r, position: n=t, zIndex: i, getPopupContainer: o,
motion: s, autoAdjustOverflow: a, mouseLeaveDelay: l, mouseEnterDelay: c, spacing:
u, stopPropagation: d, dropdownMargin: p} = this.props
, {isOpen: h, optionKey: f} = this.state
, m = this.renderOptions(r)
, g = this.renderSelection();
return React.createElement(Popover$1, {
getPopupContainer: o,
motion: s,
margin: p,
autoAdjustOverflow: a,
mouseLeaveDelay: l,
mouseEnterDelay: c,
zIndex: i,
ref: this.optionsRef,
content: m,
visible: h,
trigger: "custom",
rePosKey: f,
position: n,
spacing: u,
stopPropagation: d,
disableArrowKeyDown: !0,
onVisibleChange: e => this.handlePopoverVisibleChange(e),
afterClose: () => this.foundation.handlePopoverClose()
}, g)
}
}
Select.contextType = ConfigContext$1,
Select.Option = Option$1,
Select.OptGroup = OptionGroup$1,
Select.propTypes = {
"aria-describedby": PropTypes.string,
"aria-errormessage": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-labelledby": PropTypes.string,
"aria-required": PropTypes.bool,
autoFocus: PropTypes.bool,
autoClearSearchValue: PropTypes.bool,
borderless: PropTypes.bool,
children: PropTypes.node,
clearIcon: PropTypes.node,
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number,
PropTypes.array, PropTypes.object]),
ellipsisTrigger: PropTypes.bool,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number,
PropTypes.array, PropTypes.object]),
placeholder: PropTypes.node,
onChange: PropTypes.func,
multiple: PropTypes.bool,
filter: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
max: PropTypes.number,
maxTagCount: PropTypes.number,
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
style: PropTypes.object,
className: PropTypes.string,
size: PropTypes.oneOf(strings$8.SIZE_SET),
disabled: PropTypes.bool,
emptyContent: PropTypes.node,
expandRestTagsOnClick: PropTypes.bool,
onDropdownVisibleChange: PropTypes.func,
zIndex: PropTypes.number,
position: PropTypes.oneOf(strings$8.POSITION_SET),
onSearch: PropTypes.func,
getPopupContainer: PropTypes.func,
dropdownClassName: PropTypes.string,
dropdownStyle: PropTypes.object,
dropdownMargin: PropTypes.oneOfType([PropTypes.number,
PropTypes.object]),
outerTopSlot: PropTypes.node,
innerTopSlot: PropTypes.node,
inputProps: PropTypes.object,
outerBottomSlot: PropTypes.node,
innerBottomSlot: PropTypes.node,
optionList: PropTypes.array,
dropdownMatchSelectWidth: PropTypes.bool,
loading: PropTypes.bool,
defaultOpen: PropTypes.bool,
validateStatus: PropTypes.oneOf(strings$8.STATUS),
defaultActiveFirstOption: PropTypes.bool,
triggerRender: PropTypes.func,
stopPropagation: PropTypes.bool,
searchPosition: PropTypes.string,
motion: PropTypes.bool,
onChangeWithObject: PropTypes.bool,
suffix: PropTypes.node,
prefix: PropTypes.node,
insetLabel: PropTypes.node,
insetLabelId: PropTypes.string,
showClear: PropTypes.bool,
showArrow: PropTypes.bool,
renderSelectedItem: PropTypes.func,
allowCreate: PropTypes.bool,
renderCreateItem: PropTypes.func,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
clickToHide: PropTypes.bool,
onExceed: PropTypes.func,
onCreate: PropTypes.func,
remote: PropTypes.bool,
onDeselect: PropTypes.func,
onSelect: PropTypes.func,
autoAdjustOverflow: PropTypes.bool,
mouseEnterDelay: PropTypes.number,
mouseLeaveDelay: PropTypes.number,
spacing: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
onBlur: PropTypes.func,
onFocus: PropTypes.func,
onClear: PropTypes.func,
virtualize: PropTypes.object,
renderOptionItem: PropTypes.func,
onListScroll: PropTypes.func,
arrowIcon: PropTypes.node,
preventScroll: PropTypes.bool
},
Select.__SemiComponentName__ = "Select",
Select.defaultProps =
getDefaultPropsFromGlobalConfig(Select.__SemiComponentName__, {
stopPropagation: !0,
motion: !0,
borderless: !1,
zIndex: numbers$a.DEFAULT_Z_INDEX,
filter: !1,
multiple: !1,
disabled: !1,
defaultOpen: !1,
allowCreate: !1,
placeholder: "",
onDropdownVisibleChange: _noop,
onChangeWithObject: !1,
onChange: _noop,
onSearch: _noop,
onMouseEnter: _noop,
onMouseLeave: _noop,
onDeselect: _noop,
onSelect: _noop,
onCreate: _noop,
onExceed: _noop,
onFocus: _noop,
onBlur: _noop,
onClear: _noop,
onListScroll: _noop,
maxHeight: numbers$3.LIST_HEIGHT,
dropdownMatchSelectWidth: !0,
defaultActiveFirstOption: !0,
showArrow: !0,
showClear: !1,
searchPosition: strings$8.SEARCH_POSITION_TRIGGER,
remote: !1,
autoAdjustOverflow: !0,
autoClearSearchValue: !0,
arrowIcon: React.createElement(IconChevronDown, {
"aria-label": ""
}),
showRestTagsPopover: !1,
restTagsPopoverProps: {},
expandRestTagsOnClick: !1,
ellipsisTrigger: !1
});
const Select$1 = Select
, cssClasses$9 = {
PREFIX: `${BASE_CLASS_PREFIX$1}-popconfirm`,
POPOVER: `${BASE_CLASS_PREFIX$1}-popconfirm-popover`
}
, numbers$2 = {
SPACING: 4,
DEFAULT_Z_INDEX: 1030
};
class PopConfirmFoundation extends BaseFoundation$1 {
init() {}
destroy() {}
handleCancel(e) {
const t = this._adapter.notifyCancel(e);
isPromise(t) ? (this._adapter.updateCancelLoading(!0),
t.then((e => {
this.handleVisibleChange(!1),
this._adapter.updateCancelLoading(!1)
}
), (e => {
this._adapter.updateCancelLoading(!1)
}
))) : this.handleVisibleChange(!1)
}
handleConfirm(e) {
const t = this._adapter.notifyConfirm(e);
isPromise(t) ? (this._adapter.updateConfirmLoading(!0),
t.then((e => {
this._adapter.updateConfirmLoading(!1),
this.handleVisibleChange(!1)
}
), (e => {
this._adapter.updateConfirmLoading(!1)
}
))) : this.handleVisibleChange(!1)
}
handleClickOutSide(e) {
this._adapter.notifyClickOutSide(e)
}
handleVisibleChange(e) {
this._isControlledComponent("visible") ||
this._adapter.setVisible(e),
e ? this.handleFocusOperateButton() :
this._adapter.focusPrevFocusElement(),
this._adapter.notifyVisibleChange(e)
}
handleFocusOperateButton() {
const {cancelButtonProps: e, okButtonProps: t} =
this._adapter.getProps();
_get(e, "autoFocus") && !_get(e, "disabled") ?
this._adapter.focusCancelButton() : _get(t, "autoFocus") && !_get(t, "disabled") &&
this._adapter.focusOkButton()
}
}
const popconfirm = "";
var __rest$m = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class Popconfirm extends BaseComponent {
constructor(e) {
super(e),
this.handleCancel = e => this.foundation.handleCancel(e &&
e.nativeEvent),
this.handleConfirm = e => this.foundation.handleConfirm(e &&
e.nativeEvent),
this.handleVisibleChange = e =>
this.foundation.handleVisibleChange(e),
this.handleClickOutSide = e =>
this.foundation.handleClickOutSide(e),
this.stopImmediatePropagation = e => e && e.nativeEvent &&
e.nativeEvent.stopImmediatePropagation(),
this.renderConfirmPopCard = e => {
let {initialFocusRef: t} = e;
const {content: r, title: n, className: i, style: o,
cancelType: s, icon: a, prefixCls: l, showCloseIcon: c} = this.props
, {direction: u} = this.context
, d = classNames(l, i, {
[`${l}-rtl`]: "rtl" === u
})
, p = null != n
, h = !(null == r)
, f = React.isValidElement(a)
, m = classNames({
[`${l}-body`]: !0,
[`${l}-body-withIcon`]: f
});
return React.createElement("div", {
className: d,
onClick: this.stopImmediatePropagation,
style: o
}, React.createElement("div", {
className: `${l}-inner`
}, React.createElement("div", {
className: `${l}-header`
}, f ? React.createElement("i", {
className: `${l}-header-icon`,
"x-semi-prop": "icon"
}, a) : null, React.createElement("div", {
className: `${l}-header-body`
}, p ? React.createElement("div", {
className: `${l}-header-title`,
"x-semi-prop": "title"
}, n) : null), c ? React.createElement(Button$1, {
className: `${l}-btn-close`,
icon: React.createElement(IconClose, null),
size: "small",
theme: "borderless",
type: s,
onClick: this.handleCancel
}) : null), h ? React.createElement("div", {
className: m,
"x-semi-prop": "content"
}, _isFunction(r) ? r({
initialFocusRef: t
}) : r) : null, React.createElement("div", {
className: `${l}-footer`,
ref: this.footerRef
}, this.renderControls())))
}
,
this.state = {
cancelLoading: !1,
confirmLoading: !1,
visible: e.defaultVisible || !1
},
this.foundation = new PopConfirmFoundation(this.adapter),
this.footerRef = React.createRef(),
this.popoverRef = React.createRef()
}
static getDerivedStateFromProps(e, t) {
const r = {}
, {hasOwnProperty: n} = Object.prototype;
return n.call(e, "visible") && (r.visible = e.visible),
r
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setVisible: e => this.setState({
visible: e
}),
updateConfirmLoading: e => this.setState({
confirmLoading: e
}),
updateCancelLoading: e => this.setState({
cancelLoading: e
}),
notifyConfirm: e => this.props.onConfirm(e),
notifyCancel: e => this.props.onCancel(e),
notifyVisibleChange: e => this.props.onVisibleChange(e),
notifyClickOutSide: e => this.props.onClickOutSide(e),
focusCancelButton: () => {
var e, t;
const r = null === (t = null === (e = this.footerRef) ||
void 0 === e ? void 0 : e.current) || void 0 === t ? void 0 :
t.querySelector("[data-type=cancel]");
null == r || r.focus({
preventScroll: !0
})
}
,
focusOkButton: () => {
var e, t;
const r = null === (t = null === (e = this.footerRef) ||
void 0 === e ? void 0 : e.current) || void 0 === t ? void 0 :
t.querySelector("[data-type=ok]");
null == r || r.focus({
preventScroll: !0
})
}
,
focusPrevFocusElement: () => {
var e;
null === (e = this.popoverRef.current) || void 0 === e ||
e.focusTrigger()
}
})
}
renderControls() {
const {okText: e, cancelText: t, okType: r, cancelType: n,
cancelButtonProps: i, okButtonProps: o} = this.props
, {cancelLoading: s, confirmLoading: a} = this.state;
return React.createElement(LocaleConsumer, {
componentName: "Popconfirm"
}, ( (l, c) => React.createElement(React.Fragment, null,
React.createElement(Button$1, Object.assign({
"data-type": "cancel",
type: n,
onClick: this.handleCancel,
loading: s
}, _omit(i, "autoFocus")), t || _get(l, "cancel")),
React.createElement(Button$1, Object.assign({
"data-type": "ok",
type: r,
theme: "solid",
onClick: this.handleConfirm,
loading: a
}, _omit(o, "autoFocus")), e || _get(l, "confirm")))))
}
render() {
const {direction: e} = this.context
, t = "rtl" === e ? "bottomRight" : "bottomLeft"
, r = this.props
, {className: n, prefixCls: i, disabled: o, children: s, style:
a, position: l=t} = r
, c = __rest$m(r, ["className", "prefixCls", "disabled",
"children", "style", "position"]);
if (o)
return s;
const {visible: u} = this.state
, d = {
onVisibleChange: this.handleVisibleChange,
className: cssClasses$9.POPOVER,
onClickOutSide: this.handleClickOutSide
};
return this.isControlled("visible") && (d.trigger = "custom"),
React.createElement(Popover$1, Object.assign({
ref: this.popoverRef
}, c, {
content: e => {
let {initialFocusRef: t} = e;
return this.renderConfirmPopCard({
initialFocusRef: t
})
}
,
visible: u,
position: l
}, d), s)
}
}
Popconfirm.contextType = ConfigContext$1,
Popconfirm.propTypes = {
motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func,
PropTypes.object]),
disabled: PropTypes.bool,
content: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
title: PropTypes.any,
prefixCls: PropTypes.string,
className: PropTypes.string,
style: PropTypes.object,
icon: PropTypes.node,
okText: PropTypes.string,
okType: PropTypes.string,
cancelText: PropTypes.string,
cancelType: PropTypes.string,
onCancel: PropTypes.func,
onConfirm: PropTypes.func,
onClickOutSide: PropTypes.func,
onVisibleChange: PropTypes.func,
visible: PropTypes.bool,
defaultVisible: PropTypes.bool,
okButtonProps: PropTypes.object,
cancelButtonProps: PropTypes.object,
stopPropagation: PropTypes.oneOfType([PropTypes.bool,
PropTypes.string]),
showCloseIcon: PropTypes.bool,
zIndex: PropTypes.number,
trigger: PropTypes.string,
position: PropTypes.string
},
Popconfirm.__SemiComponentName__ = "Popconfirm",
Popconfirm.defaultProps =
getDefaultPropsFromGlobalConfig(Popconfirm.__SemiComponentName__, {
stopPropagation: !0,
trigger: "click",
onVisibleChange: _noop,
disabled: !1,
icon: React.createElement(IconAlertTriangle, {
size: "extra-large"
}),
okType: "primary",
cancelType: "tertiary",
prefixCls: cssClasses$9.PREFIX,
zIndex: numbers$2.DEFAULT_Z_INDEX,
showCloseIcon: !0,
onCancel: _noop,
onConfirm: _noop,
onClickOutSide: _noop
});
const cssClasses$8 = {
PREFIX: `${BASE_CLASS_PREFIX$1}-progress`
}
, strings$7 = {
types: ["line", "circle"],
DEFAULT_TYPE: "line",
STROKE_DEFAULT: "var(--semi-color-success)",
strokeLineCap: ["square", "round"],
DEFAULT_LINECAP: "round",
sizes: ["default", "small", "large"],
DEFAULT_SIZE: "default",
directions: ["vertical", "horizontal"],
DEFAULT_DIRECTION: "horizontal"
}
, progress$4 = "";
function generateColor(e, t, r) {
try {
const n = generate(e, t, r);
if (0 !== n.length)
return n
} catch (e2) {
return
}
}
function generate(e, t, r) {
if (e.sort(( (e, t) => e.percent - t.percent)),
e[0].percent > t)
return strings$7.STROKE_DEFAULT;
const n = e[e.length - 1];
if (n.percent < t)
return formatToHex(n.color);
for (const [i,o] of e.entries()) {
if (o.percent === t)
return formatToHex(o.color);
if (t > o.percent)
continue;
const n = e[i - 1];
return r ? generateGradients({
startColor: formatToHex(n.color),
endColor: formatToHex(o.color),
size: o.percent - n.percent - 1
}, t - n.percent - 1) : formatToHex(n.color)
}
}
function generateGradients(e, t) {
const {startColor: r, endColor: n, size: i} = e
, o = r.split("")
, s = n.split("")
, a = [parseInt(`${o[1]}${o[2]}`, 16), parseInt(`${s[1]}${s[2]}`,
16)]
, l = [parseInt(`${o[3]}${o[4]}`, 16), parseInt(`${s[3]}${s[4]}`,
16)]
, c = [parseInt(`${o[5]}${o[6]}`, 16), parseInt(`${s[5]}${s[6]}`,
16)]
, u = [parseInt(`${o[7]}${o[8]}`, 16), parseInt(`${s[7]}${s[8]}`,
16)]
, d = (a[0] - a[1]) / (i + 1)
, p = (l[0] - l[1]) / (i + 1)
, h = (c[0] - c[1]) / (i + 1)
, f = (u[0] - u[1]) / (i + 1);
function m(e) {
const t = Math.round(a[0] - d * (e + 1)).toString(16)
, r = Math.round(l[0] - p * (e + 1)).toString(16)
, n = Math.round(c[0] - h * (e + 1)).toString(16)
, i = `${g(t)}${g(r)}${g(n)}`
, o = Math.floor(f * (e + 1) + u[1]).toString(16);
return toHex.Hex(`#${i}`, o)
}
function g(e) {
return 1 === e.length ? `0${e}` : 0 === e.length ? "00" : e
}
if (void 0 === t) {
const e = [r];
for (let t = 0; t < i; t += 1)
e.push(m(t));
return e
}
return m(t)
}
function formatToHex(e) {
return e = e.trim().toLowerCase(),
REG_S.hex.test(e) ? toHex.Hex(e, void 0) : REG_S.hslA.test(e) ?
toHex.Hex(toHex.HslA(e), void 0) : REG_S.rgbA.test(e) ? toHex.Hex(toHex.RgbA(e),
void 0) : REG_S.semiDesignTokens.test(e) ? -1 !==
SEMI_DESIGN_TOKENS.ALONG.indexOf(e) ? toHex.SemiDesignToken(e) : -1 !==
SEMI_DESIGN_TOKENS.SEQUENCE.indexOf(e) ? toHex.SemiDesignToken(`${e}-5`) :
toHex.SemiDesignToken(`${e}`) : void 0
}
const toHex = {
Hex: (e, t) => 8 === (e = e.replace("#", "")).length ? `#${e}` : (6 ===
e.length || 3 === e.length && (e = e.split("").map((e => e + e)).join("")),
`#${e}${t || "ff"}`),
SemiDesignToken(e) {
if ("undefined" == typeof window)
return;
const t = getComputedStyle(document.body).getPropertyValue(`--semi-
${e}`);
if ("" === t)
return;
const r = `rgba(${t}, 1)`;
return toHex.RgbA(r)
},
HslA(e) {
const t = REG_S.hslA.exec(e)
, r = parseInt(t[2])
, n = parseInt(t[3]) / 100
, i = parseInt(t[4]) / 100
, o = t[5]
, s = (1 - Math.abs(2 * i - 1)) * n
, a = s * (1 - Math.abs(r / 60 % 2 - 1))
, l = i - s / 2;
let c = 0
, u = 0
, d = 0;
return 0 <= r && r < 60 ? (c = s,
u = a,
d = 0) : 60 <= r && r < 120 ? (c = a,
u = s,
d = 0) : 120 <= r && r < 180 ? (c = 0,
u = s,
d = a) : 180 <= r && r < 240 ? (c = 0,
u = a,
d = s) : 240 <= r && r < 300 ? (c = a,
u = 0,
d = s) : 300 <= r && r < 360 && (c = s,
u = 0,
d = a),
c = Math.round(255 * (c + l)).toString(16),
u = Math.round(255 * (u + l)).toString(16),
d = Math.round(255 * (d + l)).toString(16),
toHex.utils.pAL(c, u, d, o)
},
RgbA(e) {
const t = REG_S.rgbA.exec(e)
, r = parseInt(t[2], 10).toString(16)
, n = parseInt(t[3], 10).toString(16)
, i = parseInt(t[4], 10).toString(16)
, o = t[5];
return toHex.utils.pAL(r, n, i, o)
},
utils: {
pAL: (e, t, r, n) => (1 == e.length && (e = "0" + e),
1 == t.length && (t = "0" + t),
1 == r.length && (r = "0" + r),
void 0 !== n ? (1 == (n = Math.round(255 *
parseInt(n)).toString(16)).length && (n = "0" + n),
"#" + e + t + r + n) : "#" + e + t + r)
}
}
, REG_S = {
hex: /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,
hslA: /(hsl)a?\(\s*?(\d+),?\s*?(\d+)%,?\s*?(\d+)%,?\s*?\/?(\s*?[\d.]
+)?\s*?\)/,
rgbA: /(rgb)a?\(\s*?(\d+),?\s*?(\d+),?\s*?(\d+),?\s*?\/?(\s*?[\d.]+)?\
s*?\)/,
semiDesignTokens: /(\w+)?-?(\w+)-?(\d)?/
}
, SEMI_DESIGN_TOKENS = {
ALONG: ["black", "white"],
SEQUENCE: ["amber", "blue", "cyan", "green", "grey", "indigo", "light-
blue", "light-green", "lime", "orange", "pink", "purple", "red", "teal", "violet",
"yellow"]
};
var __rest$l = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$4 = cssClasses$8.PREFIX;
class Progress extends reactExports.Component {
constructor(e) {
super(e),
this._mounted = !0,
this._mounted = !0,
this.state = {
percentNumber: this.props.percent
}
}
componentDidUpdate(e) {
if (isNaN(this.props.percent) || isNaN(e.percent))
throw new Error("[Semi Progress]:percent can not be NaN");
if (e.percent !== this.props.percent) {
if (!this.props.motion)
return void this.setState({
percentNumber: this.props.percent
});
this.animation && this.animation.destroy &&
this.animation.destroy(),
this.animation = new Animation$4({
from: {
value: e.percent
},
to: {
value: this.props.percent
}
},{
easing: "linear",
duration: 300
}),
this.animation.on("frame", (e => {
if (!1 === this._mounted)
return;
const t = parseInt(e.value);
this.setState({
percentNumber: t
})
}
)),
this.animation.on("rest", ( () => {
!1 !== this._mounted && this.setState({
percentNumber: this.props.percent
})
}
)),
this.animation.start()
}
}
componentWillUnmount() {
this.animation && this.animation.destroy(),
this._mounted = !1
}
renderCircleProgress() {
const e = this.props
, {strokeLinecap: t, style: r, className: n, strokeWidth: i,
format: o, size: s, stroke: a, strokeGradient: l, showInfo: c, percent: u,
orbitStroke: d, id: p} = e
, h = __rest$l(e, ["strokeLinecap", "style", "className",
"strokeWidth", "format", "size", "stroke", "strokeGradient", "showInfo", "percent",
"orbitStroke", "id"])
, f = this.props["aria-label"]
, m = this.props["aria-labelledby"]
, g = this.props["aria-valuetext"]
, {percentNumber: y} = this.state
, v = {
wrapper: classNames(`${prefixCls$4}-circle`, n),
svg: classNames(`${prefixCls$4}-circle-ring`),
circle: classNames(`${prefixCls$4}-circle-ring-inner`)
}
, b = this.calcPercent(u)
, x = this.calcPercent(y);
let _;
_ = this.props.width ? this.props.width : s ===
strings$7.DEFAULT_SIZE ? 72 : 24;
const E = this.selectStroke(a, u, l)
, T = _ / 2
, C = _ / 2
, S = (_ - i) / 2
, $ = 2 * S * Math.PI
, w = (1 - b / 100) * $
, P = `${$} ${$}`
, R = o(x);
return React.createElement("div", Object.assign({
id: p,
className: v.wrapper,
style: r,
role: "progressbar",
"aria-valuemin": 0,
"aria-valuemax": 100,
"aria-valuenow": x,
"aria-labelledby": m,
"aria-label": f,
"aria-valuetext": g
}, getDataAttr(h)), React.createElement("svg", {
key: s,
className: v.svg,
height: _,
width: _,
"aria-hidden": !0
}, React.createElement("circle", {
strokeDashoffset: 0,
strokeWidth: i,
strokeDasharray: P,
strokeLinecap: t,
fill: "transparent",
stroke: d,
r: S,
cx: C,
cy: T,
"aria-hidden": !0
}), React.createElement("circle", {
className: v.circle,
strokeDashoffset: w,
strokeWidth: i,
strokeDasharray: P,
strokeLinecap: t,
fill: "transparent",
stroke: E,
r: S,
cx: C,
cy: T,
"aria-hidden": !0
})), c && "small" !== s ? React.createElement("span", {
className: `${prefixCls$4}-circle-text`
}, R) : null)
}
calcPercent(e) {
let t;
return t = e > 100 ? 100 : e < 0 ? 0 : e,
t
}
selectStroke(e, t, r) {
if ("string" == typeof e)
return e;
const n = generateColor(e, t, r);
return void 0 !== n ? n : strings$7.STROKE_DEFAULT
}
renderLineProgress() {
const e = this.props
, {className: t, style: r, stroke: n, strokeGradient: i,
direction: o, format: s, showInfo: a, size: l, percent: c, orbitStroke: u, id: d} =
e
, p = __rest$l(e, ["className", "style", "stroke",
"strokeGradient", "direction", "format", "showInfo", "size", "percent",
"orbitStroke", "id"])
, h = this.props["aria-label"]
, f = this.props["aria-labelledby"]
, m = this.props["aria-valuetext"]
, {percentNumber: g} = this.state
, y = classNames(prefixCls$4, t, {
[`${prefixCls$4}-horizontal`]: o ===
strings$7.DEFAULT_DIRECTION,
[`${prefixCls$4}-vertical`]: o !== strings$7.DEFAULT_DIRECTION,
[`${prefixCls$4}-large`]: "large" === l
})
, v = classNames({
[`${prefixCls$4}-track`]: !0
})
, b = classNames(`${prefixCls$4}-track-inner`)
, x = this.calcPercent(c)
, _ = this.calcPercent(g)
, E = {
background: this.selectStroke(n, c, i)
};
o === strings$7.DEFAULT_DIRECTION ? E.width = `${x}%` : E.height =
`${x}%`;
const T = s(_);
return React.createElement("div", Object.assign({
id: d,
className: y,
style: r,
role: "progressbar",
"aria-valuemin": 0,
"aria-valuemax": 100,
"aria-valuenow": x,
"aria-labelledby": f,
"aria-label": h,
"aria-valuetext": m
}, getDataAttr(p)), React.createElement("div", {
className: v,
style: u ? {
backgroundColor: u
} : {},
"aria-hidden": !0
}, React.createElement("div", {
className: b,
style: E,
"aria-hidden": !0
})), a ? React.createElement("div", {
className: `${prefixCls$4}-line-text`
}, T) : null)
}
render() {
const {type: e} = this.props;
return "line" === e ? this.renderLineProgress() :
this.renderCircleProgress()
}
}
Progress.propTypes = {
"aria-label": PropTypes.string,
"aria-labelledby": PropTypes.string,
"aria-valuetext": PropTypes.string,
className: PropTypes.string,
direction: PropTypes.oneOf(strings$7.directions),
format: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
id: PropTypes.string,
motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func,
PropTypes.object]),
orbitStroke: PropTypes.string,
percent: PropTypes.number,
scale: PropTypes.number,
showInfo: PropTypes.bool,
size: PropTypes.oneOf(strings$7.sizes),
stroke: PropTypes.oneOfType([PropTypes.string,
PropTypes.arrayOf(PropTypes.shape({
percent: PropTypes.number,
color: PropTypes.string
}))]),
strokeGradient: PropTypes.bool,
strokeLinecap: PropTypes.oneOf(strings$7.strokeLineCap),
strokeWidth: PropTypes.number,
style: PropTypes.object,
type: PropTypes.oneOf(strings$7.types),
width: PropTypes.number
},
Progress.defaultProps = {
className: "",
direction: strings$7.DEFAULT_DIRECTION,
format: e => `${e}%`,
motion: !0,
orbitStroke: "var(--semi-color-fill-0)",
percent: 0,
showInfo: !1,
size: strings$7.DEFAULT_SIZE,
stroke: strings$7.STROKE_DEFAULT,
strokeGradient: !1,
strokeLinecap: strings$7.DEFAULT_LINECAP,
strokeWidth: 4,
style: {},
type: strings$7.DEFAULT_TYPE
};
const Progress$1 = Progress
, radioClasses = {
PREFIX: `${BASE_CLASS_PREFIX$1}-radio`,
INNER: `${BASE_CLASS_PREFIX$1}-radio-inner`,
TEXT: `${BASE_CLASS_PREFIX$1}-radio-text`,
INPUT: `${BASE_CLASS_PREFIX$1}-radio-input`,
CHECKED: `${BASE_CLASS_PREFIX$1}-radio-checked`,
DISABLED: `${BASE_CLASS_PREFIX$1}-radio-disabled`,
BUTTON: `${BASE_CLASS_PREFIX$1}-radio-button`
}
, radioGroupClasses = {
PREFIX: `${BASE_CLASS_PREFIX$1}-radioGroup`,
INNER: `${BASE_CLASS_PREFIX$1}-radioGroup-inner`,
TEXT: `${BASE_CLASS_PREFIX$1}-radioGroup-text`,
INPUT: `${BASE_CLASS_PREFIX$1}-radioGroup-input`,
CHECKED: `${BASE_CLASS_PREFIX$1}-radioGroup-checked`,
DISABLED: `${BASE_CLASS_PREFIX$1}-radioGroup-disabled`
}
, strings$6 = {
DIRECTION_SET: ["horizontal", "vertical"],
DEFAULT_DIRECTION: "horizontal",
MODE: ["advanced", ""],
TYPE_DEFAULT: "default",
TYPE_BUTTON: "button",
TYPE_CARD: "card",
TYPE_PURECARD: "pureCard",
BUTTON_SIZE: ["middle", "small", "large"]
};
class RadioGroupFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e))
}
init() {
const e = this._getDisplayValue();
this._setValue(e)
}
_getDisplayValue() {
const {value: e, defaultValue: t} = this.getProps();
let r;
return "value"in this.getProps() ? r = e : "defaultValue"in
this.getProps() && (r = t),
r
}
handleChange(e) {
const t = this.getProp("mode")
, r = this.getState("value")
, {checked: n, value: i} = e.target
, o = this._adapter.isInProps("value")
, s = Object.assign(Object.assign({}, e), {
target: Object.assign(Object.assign({}, e.target), {
value: i
})
});
"advanced" !== t || n || (s.target.value = void 0),
o || ("advanced" !== t || n ? this._setValue(i) :
this._setValue(void 0)),
"advanced" !== t && r === i || this._adapter.notifyChange(s)
}
handlePropValueChange(e) {
this._setValue(e)
}
_setValue(e) {
this._adapter.setValue(e)
}
destroy() {}
}
class RadioFoundation extends BaseFoundation$1 {
constructor() {
super(...arguments),
this.handleFocusVisible = e => {
const {target: t} = e;
try {
t.matches(":focus-visible") &&
this._adapter.setFocusVisible(!0)
} catch (r) {
warning$1(!0, "Warning: [Semi Radio] The current browser
does not support the focus-visible")
}
}
,
this.handleBlur = () => {
this._adapter.setFocusVisible(!1)
}
}
init() {
const {children: e, extra: t, extraId: r, addonId: n} =
this._adapter.getProps();
e && !n && this._adapter.setAddonId(),
t && !r && this._adapter.setExtraId()
}
setHover(e) {
this._adapter.setHover(e)
}
setChecked(e) {
this._adapter.setChecked(e)
}
}
const radio = "";
class RadioInnerFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e))
}
init() {
const e = this._adapter.getProp("checked")
, t = this._adapter.getProp("defaultChecked");
this.setChecked(e || t)
}
setChecked(e) {
this._adapter.setNativeControlChecked(e)
}
getChecked() {
return this._adapter.getProp("checked")
}
handleChange(e) {
const t = "checked"in this.getProps()
, {checked: r} = e.target
, n = {
target: Object.assign(Object.assign({}, this.getProps()), {
checked: r
}),
stopPropagation: () => {
e.stopPropagation()
}
,
preventDefault: () => {
e.preventDefault()
}
};
t || this.setChecked(r),
this._adapter.notifyChange(n)
}
destroy() {}
}
const Context = React.createContext(null)
, Context$1 = Context;
class RadioInner extends BaseComponent {
constructor(e) {
super(e),
this.state = {
checked: !1
},
this.foundation = new RadioInnerFoundation(this.adapter),
this.onChange = this.onChange.bind(this)
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setNativeControlChecked: e => {
this.setState({
checked: e
})
}
,
notifyChange: e => {
this.props.onChange(e)
}
})
}
componentDidMount() {
this.foundation.init()
}
componentDidUpdate(e) {
e.checked !== this.props.checked &&
this.foundation.setChecked(this.props.checked)
}
componentWillUnmount() {
this.foundation.destroy()
}
blur() {
this.inputEntity.blur()
}
focus() {
const {preventScroll: e} = this.props;
this.inputEntity.focus({
preventScroll: e
})
}
onChange(e) {
this.foundation.handleChange(e)
}
render() {
const {disabled: e, mode: t, autoFocus: r, name: n, isButtonRadio:
i, isPureCardRadioGroup: o, addonId: s, extraId: a, "aria-label": l, focusInner: c,
onInputFocus: u, onInputBlur: d} = this.props
, {checked: p} = this.state
, h = this.props.prefixCls || radioClasses.PREFIX
, f = classNames({
[`${h}-inner`]: !0,
[`${h}-inner-checked`]: Boolean(p),
[`${h}-inner-buttonRadio`]: i,
[`${h}-inner-pureCardRadio`]: o
})
, m = classNames({
[`${h}-focus`]: c,
[`${h}-focus-border`]: c && !p,
[`${h}-inner-display`]: !i
});
return React.createElement("span", {
className: f
}, React.createElement("input", {
ref: e => {
this.inputEntity = e
}
,
autoFocus: r,
type: "advanced" === t ? "checkbox" : "radio",
checked: Boolean(p),
disabled: e,
onChange: this.onChange,
name: n,
"aria-label": l,
"aria-labelledby": s,
"aria-describedby": a,
onFocus: u,
onBlur: d
}), React.createElement("span", {
className: m
}, p ? React.createElement(IconRadio, null) : null))
}
}
RadioInner.contextType = Context$1,
RadioInner.propTypes = {
checked: PropTypes.bool,
disabled: PropTypes.bool,
isButtonRadio: PropTypes.bool,
onChange: PropTypes.func,
mode: PropTypes.oneOf(["advanced", ""]),
"aria-label": PropTypes.string,
focusInner: PropTypes.bool,
onInputFocus: PropTypes.func,
onInputBlur: PropTypes.func,
preventScroll: PropTypes.bool
},
RadioInner.defaultProps = {
onChange: _noop,
isButtonRadio: !1
};
const RadioInner$1 = RadioInner;
var __rest$k = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
let Radio$1 = class extends BaseComponent {
constructor(e) {
super(e),
this.onChange = e => {
const {onChange: t} = this.props;
if (this.isInGroup()) {
const {radioGroup: t} = this.context;
t.onChange && t.onChange(e)
}
!("checked"in this.props) &&
this.foundation.setChecked(e.target.checked),
t && t(e)
}
,
this.handleMouseEnter = e => {
this.props.onMouseEnter(e),
this.foundation.setHover(!0)
}
,
this.handleMouseLeave = e => {
this.props.onMouseLeave(e),
this.foundation.setHover(!1)
}
,
this.handleFocusVisible = e => {
this.foundation.handleFocusVisible(e)
}
,
this.handleBlur = e => {
this.foundation.handleBlur()
}
,
this.state = {
hover: !1,
addonId: e.addonId,
extraId: e.extraId,
checked: e.checked || e.defaultChecked || !1
},
this.foundation = new RadioFoundation(this.adapter),
this.radioEntity = null
}
componentDidUpdate(e) {
this.props.checked !== e.checked &&
(_isUndefined(this.props.checked) ? this.foundation.setChecked(!1) :
_isBoolean(this.props.checked) && this.foundation.setChecked(this.props.checked))
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setHover: e => {
this.setState({
hover: e
})
}
,
setAddonId: () => {
this.setState({
addonId: getUuidShort({
prefix: "addon"
})
})
}
,
setChecked: e => {
this.setState({
checked: e
})
}
,
setExtraId: () => {
this.setState({
extraId: getUuidShort({
prefix: "extra"
})
})
}
,
setFocusVisible: e => {
this.setState({
focusVisible: e
})
}
})
}
isInGroup() {
return this.context && this.context.radioGroup
}
focus() {
this.radioEntity.focus()
}
blur() {
this.radioEntity.blur()
}
render() {
const e = this.props
, {addonClassName: t, addonStyle: r, disabled: n, style: i,
className: o, prefixCls: s, displayMode: a, children: l, extra: c, mode: u, type:
d, value: p, name: h} = e
, f = __rest$k(e, ["addonClassName", "addonStyle", "disabled",
"style", "className", "prefixCls", "displayMode", "children", "extra", "mode",
"type", "value", "name"]);
let m, g, y, v, b, x, _, E, T;
const {hover: C, addonId: S, extraId: $, focusVisible: w, checked:
P} = this.state
, R = {
checked: P,
disabled: n
};
this.isInGroup() ? (m = this.context.radioGroup.value === p,
g = n || this.context.radioGroup.disabled,
y = this.context.mode,
v = this.context.radioGroup.isButtonRadio,
b = this.context.radioGroup.isCardRadio,
x = this.context.radioGroup.isPureCardRadio,
E = this.context.radioGroup.buttonSize,
T = s || this.context.radioGroup.prefixCls,
R.checked = m,
R.disabled = g) : (m = P,
g = n,
y = u,
_ = "button" === d,
T = s,
v = d === strings$6.TYPE_BUTTON,
x = d === strings$6.TYPE_PURECARD,
b = d === strings$6.TYPE_CARD || x);
const k = void 0 === v ? _ : v
, A = T || radioClasses.PREFIX
, I = b || x || k
, O = classNames(A, {
[`${A}-disabled`]: g,
[`${A}-checked`]: m,
[`${A}-${a}`]: Boolean(a),
[`${A}-buttonRadioComponent`]: _,
[`${A}-buttonRadioGroup`]: v,
[`${A}-buttonRadioGroup-${E}`]: v && E,
[`${A}-cardRadioGroup`]: b,
[`${A}-cardRadioGroup_disabled`]: g && b,
[`${A}-cardRadioGroup_checked`]: b && m && !g,
[`${A}-cardRadioGroup_checked_disabled`]: b && m && g,
[`${A}-cardRadioGroup_hover`]: b && !m && C && !g,
[o]: Boolean(o),
[`${A}-focus`]: w && (b || x)
})
, D = this.isInGroup() && this.context.radioGroup.name
, M = classNames({
[`${A}-addon`]: !k,
[`${A}-addon-buttonRadio`]: k,
[`${A}-addon-buttonRadio-checked`]: k && m,
[`${A}-addon-buttonRadio-disabled`]: k && g,
[`${A}-addon-buttonRadio-hover`]: k && !m && !g && C,
[`${A}-addon-buttonRadio-${E}`]: k && E,
[`${A}-focus`]: w && k
}, t);
return React.createElement("label", Object.assign({
style: i,
className: O,
onMouseEnter: this.handleMouseEnter,
onMouseLeave: this.handleMouseLeave
}, this.getDataAttr(f)), React.createElement(RadioInner$1,
Object.assign({}, this.props, R, {
mode: y,
name: null != h ? h : D,
isButtonRadio: k,
isPureCardRadioGroup: x,
onChange: this.onChange,
ref: e => {
this.radioEntity = e
}
,
addonId: l && S,
extraId: c && $,
focusInner: w && !I,
onInputFocus: this.handleFocusVisible,
onInputBlur: this.handleBlur
})), l || c ? React.createElement("div", {
className: classNames([`${A}-content`, {
[`${A}-isCardRadioGroup_content`]: b
}])
}, l ? React.createElement("span", {
className: M,
style: r,
id: S,
"x-semi-prop": "children"
}, l) : null, c && !k ? React.createElement("div", {
className: `${A}-extra`,
id: $,
"x-semi-prop": "extra"
}, c) : null) : null)
}
}
;
Radio$1.contextType = Context$1,
Radio$1.propTypes = {
autoFocus: PropTypes.bool,
checked: PropTypes.bool,
defaultChecked: PropTypes.bool,
value: PropTypes.any,
style: PropTypes.object,
className: PropTypes.string,
disabled: PropTypes.bool,
prefixCls: PropTypes.string,
displayMode: PropTypes.oneOf(["vertical", ""]),
onChange: PropTypes.func,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
mode: PropTypes.oneOf(strings$6.MODE),
extra: PropTypes.node,
addonStyle: PropTypes.object,
addonClassName: PropTypes.string,
type: PropTypes.oneOf([strings$6.TYPE_DEFAULT, strings$6.TYPE_BUTTON,
strings$6.TYPE_CARD, strings$6.TYPE_PURECARD]),
"aria-label": PropTypes.string,
preventScroll: PropTypes.bool
},
Radio$1.defaultProps = {
autoFocus: !1,
defaultChecked: !1,
value: void 0,
style: void 0,
onMouseEnter: _noop,
onMouseLeave: _noop,
mode: "",
type: "default"
},
Radio$1.elementType = "Radio";
const Radio$2 = Radio$1;
var __rest$j = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class RadioGroup extends BaseComponent {
constructor(e) {
super(e),
this.onChange = e => {
this.foundation.handleChange(e)
}
,
this.getFormatName = () => this.props.name || "default",
this.state = {
value: e.value || e.defaultValue
},
this.foundation = new RadioGroupFoundation(this.adapter)
}
componentDidMount() {
this.foundation.init()
}
componentDidUpdate(e) {
"number" == typeof e.value && isNaN(e.value) && "number" == typeof
this.props.value && isNaN(this.props.value) || e.value !== this.props.value &&
this.foundation.handlePropValueChange(this.props.value)
}
componentWillUnmount() {
this.foundation.destroy()
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setValue: e => {
this.setState({
value: e
})
}
,
getProps: () => this.props,
isInProps: e => Boolean(e in this.props),
notifyChange: e => {
this.props.onChange && this.props.onChange(e)
}
})
}
render() {
const e = this.props
, {children: t, options: r, mode: n, prefixCls: i, className: o,
style: s, direction: a, type: l, buttonSize: c, id: u} = e
, d = __rest$j(e, ["children", "options", "mode", "prefixCls",
"className", "style", "direction", "type", "buttonSize", "id"])
, p = l === strings$6.TYPE_BUTTON
, h = l === strings$6.TYPE_PURECARD
, f = l === strings$6.TYPE_CARD || h
, m = l === strings$6.TYPE_DEFAULT
, g = i || radioGroupClasses.PREFIX
, y = classNames(o, {
[g]: !0,
[`${g}-wrapper`]: !0,
[`${g}-${a}`]: a && !p,
[`${g}-${a}-default`]: a && m,
[`${g}-${a}-card`]: a && f,
[`${g}-buttonRadio`]: p
})
, v = this.state.value;
let b;
return r ? b = (r || []).map(( (e, t) => "string" == typeof e ?
React.createElement(Radio$2, {
key: t,
disabled: this.props.disabled,
value: e
}, e) : React.createElement(Radio$2, {
key: t,
disabled: e.disabled || this.props.disabled,
value: e.value,
extra: e.extra,
className: e.className,
style: e.style
}, e.label))) : t && (b = React.Children.map(t, ( (e, t) =>
React.isValidElement(e) ? React.cloneElement(e, {
key: t
}) : null))),
React.createElement("div", Object.assign({
className: y,
style: s,
id: u,
"aria-label": this.props["aria-label"],
"aria-invalid": this.props["aria-invalid"],
"aria-errormessage": this.props["aria-errormessage"],
"aria-labelledby": this.props["aria-labelledby"],
"aria-describedby": this.props["aria-describedby"],
"aria-required": this.props["aria-required"]
}, this.getDataAttr(d)), React.createElement(Context$1.Provider, {
value: {
radioGroup: {
onChange: this.onChange,
value: v,
disabled: this.props.disabled,
name: this.getFormatName(),
isButtonRadio: p,
isCardRadio: f,
isPureCardRadio: h,
buttonSize: c,
prefixCls: i
},
mode: n
}
}, b))
}
}
RadioGroup.propTypes = {
defaultValue: PropTypes.any,
disabled: PropTypes.bool,
name: PropTypes.string,
options: PropTypes.array,
buttonSize: PropTypes.oneOf(strings$6.BUTTON_SIZE),
type: PropTypes.oneOf([strings$6.TYPE_DEFAULT, strings$6.TYPE_BUTTON,
strings$6.TYPE_CARD, strings$6.TYPE_PURECARD]),
value: PropTypes.any,
onChange: PropTypes.func,
children: PropTypes.node,
prefixCls: PropTypes.string,
className: PropTypes.string,
style: PropTypes.object,
direction: PropTypes.oneOf(strings$6.DIRECTION_SET),
mode: PropTypes.oneOf(strings$6.MODE),
"aria-label": PropTypes.string,
"aria-describedby": PropTypes.string,
"aria-errormessage": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-labelledby": PropTypes.string,
"aria-required": PropTypes.bool,
id: PropTypes.string
},
RadioGroup.defaultProps = {
disabled: !1,
onChange: _noop,
direction: strings$6.DEFAULT_DIRECTION,
mode: "",
type: strings$6.TYPE_DEFAULT,
buttonSize: "middle"
};
const RadioGroup$1 = RadioGroup;
class RadioWithGroup extends Radio$2 {
}
RadioWithGroup.Group = RadioGroup$1;
const Radio = RadioWithGroup
, cssClasses$7 = {
PREFIX: `${BASE_CLASS_PREFIX$1}-rating`
}
, strings$5 = {
SIZE_SET: ["default", "small"]
}
, rating = "";
class RatingFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign(Object.assign({},
RatingFoundation.defaultAdapter), e)),
this.handleStarFocusVisible = e => {
const {target: t} = e;
this.getProps();
try {
t.matches(":focus-visible") &&
this._adapter.setEmptyStarFocusVisible(!0)
} catch (r) {
warning$1(!0, "Warning: [Semi Rating] The current browser
does not support the focus-visible")
}
}
,
this.handleStarBlur = e => {
const {emptyStarFocusVisible: t} = this.getStates();
t && this._adapter.setEmptyStarFocusVisible(!1)
}
}
init() {
const {autoFocus: e, disabled: t} = this.getProps();
e && !t && this._adapter.focus()
}
_getScroll(e, t) {
let r = t ? e.pageYOffset : e.pageXOffset;
const n = t ? "scrollTop" : "scrollLeft";
if ("number" != typeof r) {
const t = e.document;
r = t.documentElement[n],
"number" != typeof r && (r = t.body[n])
}
return r
}
_getClientPosition(e) {
let t, r;
const n = e.ownerDocument
, {body: i} = n
, o = n && n.documentElement
, s = e.getBoundingClientRect();
return t = s.left,
r = s.top,
t -= o.clientLeft || i.clientLeft || 0,
r -= o.clientTop || i.clientTop || 0,
{
left: t,
top: r
}
}
_getOffsetLeft(e) {
const t = this._getClientPosition(e)
, r = e.ownerDocument
, n = r.defaultView || r.parentWindow;
return t.left += this._getScroll(n),
t.left
}
getStarValue(e, t) {
const {allowHalf: r} = this.getProps()
, n = "rtl" === this._adapter.getContext("direction");
let i = e + 1;
if (r) {
const r = this._adapter.getStarDOM(e)
, o = this._getOffsetLeft(r)
, s = r.clientWidth;
(n && t - o > s / 2 || !n && t - o < s / 2) && (i -= .5)
}
return i
}
handleHover(e, t) {
const r = this.getStarValue(t, e.pageX)
, {clearedValue: n, hoverValue: i} = this.getStates();
r !== i && r !== n && this._adapter.notifyHoverChange(r, null)
}
handleMouseLeave() {
this._adapter.notifyHoverChange(void 0, null)
}
handleClick(e, t) {
const {allowClear: r} = this.getProps()
, {value: n} = this.getStates()
, i = this.getStarValue(t, e.pageX)
, o = !!r && i === n;
this._adapter.updateValue(o ? 0 : i),
o ? this._adapter.notifyHoverChange(void 0, i) :
this._adapter.clearValue(null)
}
handleFocus(e) {
this._adapter.notifyFocus(e)
}
handleBlur(e) {
this._adapter.notifyBlur(e)
}
handleKeyDown(e, t) {
const {key: r} = e
, {count: n, allowHalf: i} = this.getProps()
, o = "rtl" === this._adapter.getContext("direction")
, s = i ? .5 : 1;
let a, l;
"ArrowRight" === r || "ArrowUp" === r ? a = t + (o ? -s : s) :
"ArrowLeft" !== r && "ArrowDown" !== r || (a = t + (o ? s : -s)),
l = a > n ? 0 : a < 0 ? n : a,
["ArrowRight", "ArrowUp", "ArrowLeft", "ArrowDown"].includes(r) &&
(this._adapter.notifyKeyDown(e),
this._adapter.updateValue(l),
this.changeFocusStar(l, e),
e.preventDefault(),
this._adapter.notifyHoverChange(void 0, null))
}
changeFocusStar(e, t) {
const {count: r, allowHalf: n, preventScroll: i} = this.getProps()
, o = Math.ceil(e) - 1
, s = [...t.currentTarget.childNodes].map((e =>
e.childNodes[0].childNodes));
o < 0 ? s[r][0].focus({
preventScroll: i
}) : s[o][n ? 10 * e % 10 == 5 ? 0 : 1 : 0].focus({
preventScroll: i
})
}
}
class RatingItemFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign(Object.assign({},
RatingItemFoundation.defaultAdapter), e)),
this.handleFocusVisible = (e, t) => {
const {target: r} = e;
try {
r.matches(":focus-visible") && ("first" === t ?
this._adapter.setFirstStarFocus(!0) : this._adapter.setSecondStarFocus(!0))
} catch (n) {
warning$1(!0, "Warning: [Semi Rating] The current browser
does not support the focus-visible")
}
}
,
this.handleBlur = (e, t) => {
const {firstStarFocus: r, secondStarFocus: n} =
this.getStates();
"first" === t ? r && this._adapter.setFirstStarFocus(!1) : n &&
this._adapter.setSecondStarFocus(!1)
}
}
}
let Item$2 = class extends BaseComponent {
constructor(e) {
super(e),
this.firstStar = null,
this.secondStar = null,
this.onHover = e => {
const {onHover: t, index: r} = this.props;
t(e, r)
}
,
this.onClick = e => {
const {onClick: t, index: r} = this.props;
t(e, r)
}
,
this.onFocus = (e, t) => {
const {onFocus: r} = this.props;
r && r(e),
this.foundation.handleFocusVisible(e, t)
}
,
this.onBlur = (e, t) => {
const {onBlur: r} = this.props;
r && r(e),
this.foundation.handleBlur(e, t)
}
,
this.onKeyDown = e => {
const {onClick: t, index: r} = this.props;
13 === e.keyCode && t(e, r)
}
,
this.starFocus = () => {
const {value: e, index: t, preventScroll: r} = this.props;
e - t == .5 ? this.firstStar.focus({
preventScroll: r
}) : this.secondStar.focus({
preventScroll: r
})
}
,
this.saveFirstStar = e => {
this.firstStar = e
}
,
this.saveSecondStar = e => {
this.secondStar = e
}
,
this.state = {
firstStarFocus: !1,
secondStarFocus: !1
},
this.foundation = new RatingItemFoundation(this.adapter)
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setFirstStarFocus: e => {
this.setState({
firstStarFocus: e
})
}
,
setSecondStarFocus: e => {
this.setState({
secondStarFocus: e
})
}
})
}
render() {
const {index: e, prefixCls: t, character: r, count: n, value: i,
disabled: o, allowHalf: s, focused: a, size: l, ariaLabelPrefix: c} = this.props
, {firstStarFocus: u, secondStarFocus: d} = this.state
, p = e + 1
, h = p - i
, f = s && h < 1 && h > 0
, m = 1 - h
, g = p <= i
, y = "number" == typeof l
, v = classNames(t, {
[`${t}-half`]: f,
[`${t}-full`]: g,
[`${t}-${l}`]: !y
})
, b = y ? {
width: l,
height: l,
fontSize: l
} : {}
, x = y ? "inherit" : "small" === l ? "default" : "extra-large"
, _ = r || React.createElement(IconStar, {
size: x,
style: {
display: "block"
}
})
, E = e === n
, T = classNames(`${t}-wrapper`, {
[`${t}-disabled`]: o,
[`${cssClasses$7.PREFIX}-focus`]: (u || d) && 0 !== i
})
, C = {
onClick: o ? null : this.onClick,
onKeyDown: o ? null : this.onKeyDown,
onMouseMove: o ? null : this.onHover,
className: T
}
, S = s ? 2 * n + 1 : n + 1
, $ = {
ref: this.saveFirstStar,
role: "radio",
"aria-checked": i === e + .5,
"aria-posinset": 2 * e + 1,
"aria-setsize": S,
"aria-disabled": o,
"aria-label": `${e + .5} ${c}s`,
"aria-labelledby": this.props["aria-describedby"],
"aria-describedby": this.props["aria-describedby"],
className: classNames(`${t}-first`, `${cssClasses$7.PREFIX}-no-
focus`),
tabIndex: o || i !== e + .5 ? -1 : 0,
onFocus: e => {
this.onFocus(e, "first")
}
,
onBlur: e => {
this.onBlur(e, "first")
}
}
, w = !o && (i === e + 1 || E && 0 === i) ? 0 : -1
, P = {
ref: this.saveSecondStar,
role: "radio",
"aria-checked": E ? 0 === i : i === e + 1,
"aria-posinset": s ? 2 * (e + 1) : e + 1,
"aria-setsize": S,
"aria-disabled": o,
"aria-label": `${E ? 0 : e + 1} ${c}${0 === e ? "" : "s"}`,
"aria-labelledby": this.props["aria-describedby"],
"aria-describedby": this.props["aria-describedby"],
className: classNames(`${t}-second`, `${cssClasses$7.PREFIX}-
no-focus`),
tabIndex: w,
onFocus: e => {
this.onFocus(e, "second")
}
,
onBlur: e => {
this.onBlur(e, "second")
}
};
return React.createElement("li", {
className: v,
style: Object.assign({}, b),
key: e
}, React.createElement("div", Object.assign({}, C), s && !E &&
React.createElement("div", Object.assign({}, $, {
style: {
width: 100 * m + "%"
}
}), _), React.createElement("div", Object.assign({}, P, {
"x-semi-prop": "character"
}), _)))
}
}
;
Item$2.propTypes = {
value: PropTypes.number,
index: PropTypes.number,
prefixCls: PropTypes.string,
allowHalf: PropTypes.bool,
onHover: PropTypes.func,
onClick: PropTypes.func,
character: PropTypes.node,
focused: PropTypes.bool,
disabled: PropTypes.bool,
count: PropTypes.number,
ariaLabelPrefix: PropTypes.string,
size: PropTypes.oneOfType([PropTypes.oneOf(strings$5.SIZE_SET),
PropTypes.number]),
"aria-describedby": PropTypes.string,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
preventScroll: PropTypes.bool
};
var __rest$i = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class Rating extends BaseComponent {
constructor(e) {
super(e),
this.rate = null,
this.onHover = (e, t) => {
this.foundation.handleHover(e, t)
}
,
this.onMouseLeave = () => {
this.foundation.handleMouseLeave()
}
,
this.onClick = (e, t) => {
this.foundation.handleClick(e, t)
}
,
this.onFocus = e => {
this.foundation.handleFocus(e)
}
,
this.onBlur = e => {
this.foundation.handleBlur(e)
}
,
this.onKeyDown = e => {
const {value: t} = this.state;
this.foundation.handleKeyDown(e, t)
}
,
this.focus = () => {
const {disabled: e, preventScroll: t} = this.props;
e || this.rate.focus({
preventScroll: t
})
}
,
this.blur = () => {
const {disabled: e} = this.props;
e || this.rate.blur()
}
,
this.saveRef = e => t => {
this.stars[e] = t
}
,
this.saveRate = e => {
this.rate = e
}
,
this.handleStarFocusVisible = e => {
this.foundation.handleStarFocusVisible(e)
}
,
this.handleStarBlur = e => {
this.foundation.handleStarBlur(e)
}
,
this.getAriaLabelPrefix = () => {
if (this.props["aria-label"])
return this.props["aria-label"];
let e = "star";
const {character: t} = this.props;
return "string" == typeof t && (e = t),
e
}
,
this.getItemList = e => {
const {count: t, allowHalf: r, prefixCls: n, disabled: i,
character: o, size: s, tooltips: a} = this.props
, {value: l, hoverValue: c, focused: u} = this.state;
return [...Array(t + 1).keys()].map((d => {
const p = React.createElement(Item$2, {
ref: this.saveRef(d),
index: d,
count: t,
prefixCls: `${n}-star`,
allowHalf: r,
value: void 0 === c ? l : c,
onClick: i ? noop$2 : this.onClick,
onHover: i ? noop$2 : this.onHover,
key: d,
disabled: i,
character: o,
focused: u,
size: d === t ? 0 : s,
ariaLabelPrefix: e,
onFocus: i || t !== d ? noop$2 :
this.handleStarFocusVisible,
onBlur: i || t !== d ? noop$2 : this.handleStarBlur
});
if (a) {
const e = a[d] ? a[d] : ""
, t = c - 1 === d;
return React.createElement(Tooltip, {
visible: t,
trigger: "custom",
content: e,
key: `${d}-${t}`
}, p)
}
return p
}
))
}
;
const t = void 0 === e.value ? e.defaultValue : e.value;
this.stars = {},
this.state = {
value: t,
focused: !1,
hoverValue: void 0,
clearedValue: null,
emptyStarFocusVisible: !1
},
this.foundation = new RatingFoundation(this.adapter)
}
static getDerivedStateFromProps(e, t) {
return "value"in e && void 0 !== e.value ?
Object.assign(Object.assign({}, t), {
value: e.value
}) : t
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
focus: () => {
const {disabled: e, count: t} = this.props
, {value: r} = this.state;
if (!e) {
const e = Math.ceil(r) - 1;
this.stars[e < 0 ? t : e].starFocus()
}
}
,
getStarDOM: e => {
const t = this.stars && this.stars[e];
return ReactDOM.findDOMNode(t)
}
,
notifyHoverChange: (e, t) => {
const {onHoverChange: r} = this.props;
this.setState({
hoverValue: e,
clearedValue: t
}),
r(e)
}
,
updateValue: e => {
const {onChange: t} = this.props;
"value"in this.props || this.setState({
value: e
}),
t(e)
}
,
clearValue: e => {
this.setState({
clearedValue: e
})
}
,
notifyFocus: e => {
const {onFocus: t} = this.props;
this.setState({
focused: !0
}),
t && t(e)
}
,
notifyBlur: e => {
const {onBlur: t} = this.props;
this.setState({
focused: !1
}),
t && t(e)
}
,
notifyKeyDown: e => {
const {onKeyDown: t} = this.props;
this.setState({
focused: !1
}),
t && t(e)
}
,
setEmptyStarFocusVisible: e => {
this.setState({
emptyStarFocusVisible: e
})
}
})
}
componentDidMount() {
this.foundation.init()
}
componentWillUnmount() {
this.foundation.destroy()
}
render() {
const e = this.props
, {style: t, prefixCls: r, disabled: n, className: i, id: o,
count: s, tabIndex: a} = e
, l = __rest$i(e, ["style", "prefixCls", "disabled", "className",
"id", "count", "tabIndex"])
, {value: c, emptyStarFocusVisible: u} = this.state
, d = this.getAriaLabelPrefix()
, p = `Rating: ${c} of ${s} ${d}${1 === c ? "" : "s"},`
, h = this.getItemList(d)
, f = classNames(r, {
[`${r}-disabled`]: n,
[`${r}-focus`]: u
}, i);
return React.createElement("ul", Object.assign({
"aria-label": p,
"aria-labelledby": this.props["aria-labelledby"],
"aria-describedby": this.props["aria-describedby"],
className: f,
style: t,
onMouseLeave: n ? noop$2 : this.onMouseLeave,
tabIndex: n ? -1 : a,
onFocus: n ? noop$2 : this.onFocus,
onBlur: n ? noop$2 : this.onBlur,
onKeyDown: n ? noop$2 : this.onKeyDown,
ref: this.saveRate,
id: o
}, this.getDataAttr(l)), h)
}
}
Rating.contextType = ConfigContext$1,
Rating.propTypes = {
"aria-describedby": PropTypes.string,
"aria-errormessage": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-label": PropTypes.string,
"aria-labelledby": PropTypes.string,
"aria-required": PropTypes.bool,
disabled: PropTypes.bool,
value: PropTypes.number,
defaultValue: PropTypes.number,
count: PropTypes.number,
allowHalf: PropTypes.bool,
allowClear: PropTypes.bool,
style: PropTypes.object,
prefixCls: PropTypes.string,
onChange: PropTypes.func,
onHoverChange: PropTypes.func,
className: PropTypes.string,
character: PropTypes.node,
tabIndex: PropTypes.number,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
onKeyDown: PropTypes.func,
autoFocus: PropTypes.bool,
size: PropTypes.oneOfType([PropTypes.oneOf(strings$5.SIZE_SET),
PropTypes.number]),
tooltips: PropTypes.arrayOf(PropTypes.string),
id: PropTypes.string,
preventScroll: PropTypes.bool
},
Rating.defaultProps = {
defaultValue: 0,
count: 5,
allowHalf: !1,
allowClear: !0,
style: {},
prefixCls: cssClasses$7.PREFIX,
onChange: noop$2,
onHoverChange: noop$2,
tabIndex: -1,
size: "default"
};
const cssClasses$6 = {
PREFIX: `${BASE_CLASS_PREFIX$1}-slider`,
DISABLED: `${BASE_CLASS_PREFIX$1}-slider-disabled`,
VERTICAL: `${BASE_CLASS_PREFIX$1}-slider-vertical`,
TRACK: `${BASE_CLASS_PREFIX$1}-slider-track`,
DOTS: `${BASE_CLASS_PREFIX$1}-slider-dots`,
MARKS: `${BASE_CLASS_PREFIX$1}-slider-marks`,
HANDLE: `${BASE_CLASS_PREFIX$1}-slider-handle`,
HANDLE_DOT: `${BASE_CLASS_PREFIX$1}-slider-handle-dot`
}
, touchEventPolyfill = (e, t) => {
if (!(globalThis.Touch && e instanceof Touch))
return e;
return ["stopPropagation", "preventDefault"].forEach((r => {
let n = t[r];
n && ("function" == typeof n && (n = function() {
return t[r](...arguments)
}
),
e[r] ? warning$1(!0, `"The key ${r}" exist in Touch.`) : e[r] = n)
}
)),
e
}
, touchEventPolyfill$1 = touchEventPolyfill;
class SliderFoundation extends BaseFoundation$1 {
constructor(e) {
var t;
super(Object.assign(Object.assign({},
SliderFoundation.defaultAdapter), e)),
t = this,
this.getMinAndMaxPercent = e => {
const {range: t, min: r, max: n} = this._adapter.getProps()
, i = t ? (e[0] - r) / (n - r) : (e - r) / (n - r)
, o = t ? (e[1] - r) / (n - r) : 1;
return {
min: this._checkValidity(i),
max: this._checkValidity(o)
}
}
,
this._checkValidity = function(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : 0
, r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : 1;
return e > r ? r : e < t ? t : e
}
,
this.computeHandleVisibleVal = (e, t, r) => {
const {focusPos: n, currentValue: i} =
this._adapter.getStates()
, o = {
min: !1,
max: !1
};
let s;
s = t ? {
min: t(r ? this.outPutValue(i[0]) : this.outPutValue(i)),
max: r ? t(this.outPutValue(i[1])) : null
} : {
min: r ? this.outPutValue(i[0]) : this.outPutValue(i),
max: r ? this.outPutValue(i[1]) : null
},
e ? (o.min = !0,
o.max = !0) : void 0 === e && t && ("min" === n ? o.min = !0 :
"max" === n && (o.max = !0));
return {
tipVisible: o,
tipChildren: s
}
}
,
this.valueFormatIsCorrect = e => Array.isArray(e) ? "number" ==
typeof e[0] && "number" == typeof e[0] : "number" == typeof e,
this.handleMousePos = (e, t) => {
const r = this._adapter.getParentRect()
, n = this._adapter.getScrollParentVal()
, i = r ? r.left : 0
, o = r ? r.top : 0;
return {
x: e - i + n.scrollLeft,
y: t - o + n.scrollTop
}
}
,
this.getScrollParent = e => {
const t = /(auto|scroll)/
, r = (e, t) => window.getComputedStyle(e,
null).getPropertyValue(t)
, n = e => e && e !== document.body && e instanceof Element ?
(e => t.test(r(e, "overflow") + r(e, "overflow-y") + r(e, "overflow-x")))(e) ? e :
n(e.parentNode) : document.body;
return n(e)
}
,
this.checkMeetMinMax = e => {
const {vertical: t, verticalReverse: r, range: n} =
this._adapter.getProps()
, i = this._adapter.getState("currentValue");
this.transValueToPos(i);
const {sliderX: o, sliderY: s, sliderWidth: a, sliderHeight: l}
= this._adapter.getSliderLengths();
this._adapter.getStates();
let c, u;
return c = t && r ? s + (t ? l : a) : t ? s : o,
u = t && r ? s : t ? s + l : o + a,
t && r ? e >= c ? e = c : e <= u && (e = u) : e <= c ? e = c :
e >= u && (e = u),
e
}
,
this.transPosToValue = (e, t) => {
const r = this.checkMeetMinMax(e)
, {min: n, max: i, currentValue: o} =
this._adapter.getStates()
, {range: s, vertical: a, step: l, verticalReverse: c} =
this._adapter.getProps()
, {sliderX: u, sliderY: d, sliderWidth: p, sliderHeight: h} =
this._adapter.getSliderLengths()
, f = a ? d : u
, m = a ? h : p;
let g, y;
return g = a && c ? (f + m - r) / m * (i - n) + n : (r - f) / m
* (i - n) + n,
y = s ? t ? o[0] : o[1] : o,
1 !== l && (g = Math.round(g / l) * l),
s && g !== y ? t ? [g, o[1]] : [o[0], g] : !s && g !== y && g
}
,
this.transValueToPos = e => {
const {min: t, max: r} = this._adapter.getStates()
, {vertical: n, range: i, verticalReverse: o} =
this._adapter.getProps()
, {sliderX: s, sliderY: a, sliderWidth: l, sliderHeight: c} =
this._adapter.getSliderLengths()
, u = n ? a : s
, d = n ? c : l;
return i ? [(e[0] - t) * d / (r - t) + u, (e[1] - t) * d / (r -
t) + u] : (e - t) * d / (r - t) + u
}
,
this.isMarkActive = e => {
const {min: t, max: r, range: n, included: i} =
this._adapter.getProps()
, o = this._adapter.getState("currentValue");
return "number" == typeof (e / 1) && e >= t && e <= r && (n ?
(e > o[1] || e < o[0]) && i ? "unActive" : "active" : e <= o && i ? "active" :
"unActive")
}
,
this.outPutValue = e => {
const t = this._adapter.getProp("step")
, r = ( () => {
const e = (r = t,
/^\d+(\.\d+)?$/.test(String(r)) && null !== (i = null ===
(n = r.toString().split(".")[1]) || void 0 === n ? void 0 : n.length) && void 0 !==
i ? i : 0);
var r, n, i;
const o = Math.pow(10, e);
return e => Math.round(e * o) / o
}
)();
if (Array.isArray(e)) {
const t = r(e[0])
, n = r(e[1]);
return t > n ? "min" === this.getState("focusPos") ? [n, n]
: [t, t] : [t, n]
}
return r(e)
}
,
this.handleDisabledChange = e => {
this._adapter.updateDisabled(e)
}
,
this.checkAndUpdateIsInRenderTreeState = () =>
this._adapter.checkAndUpdateIsInRenderTreeState(),
this.calculateOutputValue = (e, t) => {
const r = this.transPosToValue(e, t);
if (!1 !== r)
return this.outPutValue(r)
}
,
this.handleValueChange = (e, t) => {
const {min: r, max: n} = this._adapter.getStates();
let i = null;
const o = {};
this.valueFormatIsCorrect(t) ? (Array.isArray(e) &&
Array.isArray(t) && (t = [t[0] < r ? r : t[0], t[1] > n ? n : t[1]],
i = Object.assign(o, {
currentValue: t
})),
"number" == typeof e && "number" == typeof t && (t = t > n ?
n : t < r ? r : t,
i = Object.assign(o, {
currentValue: t
}))) : i = o,
i && this._adapter.transNewPropsToState(i)
}
,
this.onHandleDown = (e, t) => {
this._adapter.onHandleDown(e);
const r = this._adapter.getState("disabled")
, {vertical: n} = this._adapter.getProps()
, {dragging: i} = this._adapter.getOverallVars();
if (r)
return !1;
this._adapter.setStateVal("isDrag", !0),
this._adapter.setStateVal("chooseMovePos", t),
"min" === t ? this._adapter.setDragging([!0, i[1]]) :
this._adapter.setDragging([i[0], !0]);
const o = this.handleMousePos(e.clientX, e.clientY);
let s = n ? o.y : o.x;
if (this._adapter.isEventFromHandle(e)) {
const t = this._getHandleCenterPosition(n, e.target);
this._dragOffset = s - t,
s = t
} else
this._dragOffset = 0;
return !0
}
,
this.onHandleMove = e => {
this._adapter.setEventDefault(e);
const {disabled: t, chooseMovePos: r} =
this._adapter.getStates()
, {vertical: n} = this._adapter.getProps()
, {dragging: i} = this._adapter.getOverallVars();
if (t)
return !1;
this.onHandleEnter(r);
const o = this.handleMousePos(e.clientX, e.clientY);
let s = n ? o.y : o.x;
if (s -= this._dragOffset,
"min" === r && i[0] || "max" === r && i[1]) {
const e = this.calculateOutputValue(s, "min" === r);
if (void 0 === e)
return !1;
this._adapter.notifyChange(e),
this._adapter.onHandleMove(s, "min" === r, void 0, !1, e)
}
return !0
}
,
this.onHandleTouchStart = (e, t) => {
const r = this._adapter.getMinHandleEl()
, n = this._adapter.getMaxHandleEl();
if (e.target === r || e.target === n) {
handlePrevent(e);
const r = touchEventPolyfill$1(e.touches[0], e);
this.onHandleDown(r, t)
}
}
,
this.onHandleTouchMove = e => {
const t = this._adapter.getMinHandleEl()
, r = this._adapter.getMaxHandleEl();
if (e.target === t || e.target === r) {
const t = touchEventPolyfill$1(e.touches[0], e);
this.onHandleMove(t)
}
}
,
this.onHandleEnter = e => {
const {disabled: t, focusPos: r} = this._adapter.getStates();
t || r || e === r || this._adapter.onHandleEnter(e)
}
,
this.onHandleLeave = () => {
const e = this._adapter.getState("disabled")
, t = this._adapter.getState("isDrag");
e || t || this._adapter.onHandleLeave()
}
,
this.onHandleUp = e => {
this._adapter.onHandleUpBefore(e);
const {disabled: t, chooseMovePos: r} =
this._adapter.getStates()
, {dragging: n} = this._adapter.getOverallVars();
return !t && ("min" === r ? this._adapter.setDragging([!1,
n[1]]) : this._adapter.setDragging([n[0], !1]),
this._adapter.setStateVal("isDrag", !1),
this._adapter.onHandleLeave(),
this._adapter.onHandleUpAfter(),
!0)
}
,
this._handleValueDecreaseWithKeyBoard = (e, t) => {
const {min: r, currentValue: n} = this.getStates()
, {range: i} = this.getProps();
if ("min" === t) {
if (i) {
let t = n[0] - e;
return t = t < r ? r : t,
[t, n[1]]
}
{
let t = n - e;
return t = t < r ? r : t,
t
}
}
{
let t = n[1] - e;
return t = t < n[0] ? n[0] : t,
[n[0], t]
}
}
,
this._handleValueIncreaseWithKeyBoard = (e, t) => {
const {max: r, currentValue: n} = this.getStates()
, {range: i} = this.getProps();
if ("min" === t) {
if (i) {
let t = n[0] + e;
return t = t > n[1] ? n[1] : t,
[t, n[1]]
}
{
let t = n + e;
return t = t > r ? r : t,
t
}
}
{
let t = n[1] + e;
return t = t > r ? r : t,
[n[0], t]
}
}
,
this._handleHomeKey = e => {
const {min: t, currentValue: r} = this.getStates()
, {range: n} = this.getProps();
return "min" === e ? n ? [t, r[1]] : t : [r[0], r[0]]
}
,
this._handleEndKey = e => {
const {max: t, currentValue: r} = this.getStates()
, {range: n} = this.getProps();
return "min" === e ? n ? [r[1], r[1]] : t : [r[0], t]
}
,
this.handleKeyDown = (e, t) => {
const {min: r, max: n, currentValue: i} = this.getStates()
, {step: o, range: s} = this.getProps();
let a;
switch (e.key) {
case "ArrowLeft":
case "ArrowDown":
a = this._handleValueDecreaseWithKeyBoard(o, t);
break;
case "ArrowRight":
case "ArrowUp":
a = this._handleValueIncreaseWithKeyBoard(o, t);
break;
case "PageUp":
a = this._handleValueIncreaseWithKeyBoard(10 * o, t);
break;
case "PageDown":
a = this._handleValueDecreaseWithKeyBoard(10 * o, t);
break;
case "Home":
a = this._handleHomeKey(t);
break;
case "End":
a = this._handleEndKey(t)
}
if (["ArrowLeft", "ArrowDown", "ArrowRight", "ArrowUp",
"PageUp", "PageDown", "Home", "End"].includes(e.key)) {
let t = !0;
t = Array.isArray(i) ? !(i[0] === a[0] && i[1] === a[1]) :
i !== a,
t && (this._adapter.updateCurrentValue(a),
this._adapter.notifyChange(a)),
handlePrevent(e)
}
}
,
this._noTooltip = () => {
const {tipFormatter: e, tooltipVisible: t} = this.getProps();
return null === e || !1 === t
}
,
this.onFocus = (e, t) => {
if (this._noTooltip())
return;
handlePrevent(e);
const {target: r} = e;
try {
r.matches(":focus-visible") && ("min" === t ?
this._adapter.setStateVal("firstDotFocusVisible", !0) :
this._adapter.setStateVal("secondDotFocusVisible", !0))
} catch (n) {
warning$1(!0, "Warning: [Semi Slider] The current browser
does not support the focus-visible")
}
}
,
this.onBlur = (e, t) => {
if (this._noTooltip())
return;
const {firstDotFocusVisible: r, secondDotFocusVisible: n} =
this.getStates();
"min" === t ? r &&
this._adapter.setStateVal("firstDotFocusVisible", !1) : n &&
this._adapter.setStateVal("secondDotFocusVisible", !1)
}
,
this.handleWrapClick = e => {
const {disabled: t, isDrag: r} = this._adapter.getStates();
if (r || t || this._adapter.isEventFromHandle(e))
return;
const {vertical: n} = this.getProps()
, i = this.handleMousePos(e.clientX, e.clientY)
, o = n ? i.y : i.x
, s = this.checkWhichHandle(o)
, a = this.calculateOutputValue(o, s);
void 0 !== a && (this._adapter.notifyChange(a),
this._isControlledComponent() || this.setHandlePos(o, s, !0,
a))
}
,
this.setHandlePos = function(e, r) {
let n = arguments.length > 2 && void 0 !== arguments[2] &&
arguments[2]
, i = arguments.length > 3 ? arguments[3] : void 0;
t._adapter.onHandleMove(e, r, ( () =>
t._adapter.onHandleUpAfter()), n, i)
}
,
this.checkWhichHandle = e => {
const {vertical: t, verticalReverse: r} = this.getProps()
, {currentValue: n} = this._adapter.getStates()
, i = this.transValueToPos(n);
let o = !0;
return Array.isArray(i) && (e > i[1] || Math.abs(e - i[0]) >
Math.abs(e - i[1])) && (o = !1),
t && r && (o = !o),
o
}
,
this.handleWrapperEnter = () => {
this._adapter.setStateVal("showBoundary", !0)
}
,
this.handleWrapperLeave = () => {
this._adapter.setStateVal("showBoundary", !1)
}
}
init() {
this._checkCurrentValue(),
this._dragOffset = 0
}
_checkCurrentValue() {
const {currentValue: e, min: t, max: r} = this.getStates();
let n;
Array.isArray(e) ? (n = [],
n[0] = this._checkValidity(e[0], t, r),
n[1] = this._checkValidity(e[1], t, r)) : n =
this._checkValidity(e, t, r),
this._adapter.updateCurrentValue(n)
}
destroy() {
this._adapter.unSubscribeEventListener()
}
_getHandleCenterPosition(e, t) {
const r = t.getBoundingClientRect()
, {x: n, y: i} = this.handleMousePos(r.left + .5 * r.width, r.top
+ .5 * r.height);
return e ? i : n
}
}
const slider$1 = "";
var __rest$h = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixCls$3 = cssClasses$6.PREFIX;
function domIsInRenderTree(e) {
return !!e && Boolean(e.offsetWidth || e.offsetHeight ||
e.getClientRects().length)
}
let Slider$1 = class extends BaseComponent {
constructor(e) {
super(e),
this.renderHandle = () => {
var e, t, r, n, i;
const {vertical: o, range: s, tooltipVisible: a, tipFormatter:
l, "aria-label": c, "aria-labelledby": u, "aria-valuetext": d, getAriaValueText: p,
disabled: h} = this.props
, {chooseMovePos: f, isDrag: m, isInRenderTree: g,
firstDotFocusVisible: y, secondDotFocusVisible: v} = this.state
, b = o ? "top" : "left"
, x =
this.foundation.getMinAndMaxPercent(this.state.currentValue)
, _ = x.min
, E = x.max
, {tipVisible: T, tipChildren: C} =
this.foundation.computeHandleVisibleVal(a && g, l, s)
, S = classNames(cssClasses$6.HANDLE, {
[`${cssClasses$6.HANDLE}-clicked`]: "min" === f && m
})
, $ = classNames(cssClasses$6.HANDLE, {
[`${cssClasses$6.HANDLE}-clicked`]: "max" === f && m
})
, {min: w, max: P, currentValue: R} = this.state
, k = {
"aria-label": null != c ? c : h ? "Disabled Slider" : void
0,
"aria-labelledby": u,
"aria-disabled": h
};
o && Object.assign(k, {
"aria-orientation": "vertical"
});
const A = this.props.handleDot
, I = s ? React.createElement(React.Fragment, null,
React.createElement(Tooltip, {
content: C.min,
position: "top",
trigger: "custom",
rePosKey: _,
visible: g && (T.min || y),
className: `${cssClasses$6.HANDLE}-tooltip`
}, React.createElement("span", Object.assign({
ref: this.minHanleEl,
className: S,
style: {
[b]: 100 * _ + "%",
zIndex: "min" === f ? 2 : 1
},
onMouseDown: e => {
this.foundation.onHandleDown(e, "min")
}
,
onMouseEnter: () => {
this.foundation.onHandleEnter("min")
}
,
onTouchStart: e => {
this.foundation.onHandleTouchStart(e, "min")
}
,
onMouseLeave: () => {
this.foundation.onHandleLeave()
}
,
onKeyUp: e => {
this.foundation.onHandleUp(e)
}
,
onTouchEnd: e => {
this.foundation.onHandleUp(e)
}
,
onKeyDown: e => {
this.foundation.handleKeyDown(e, "min")
}
,
onFocus: e => {
this.foundation.onFocus(e, "min")
}
,
onBlur: e => {
this.foundation.onBlur(e, "min")
}
,
role: "slider",
tabIndex: h ? -1 : 0
}, k, {
"aria-valuetext": p ? p(R[0], 0) : d,
"aria-valuenow": R[0],
"aria-valuemax": R[1],
"aria-valuemin": w
}), (null == A ? void 0 : A[0]) && React.createElement("div", {
className: cssClasses$6.HANDLE_DOT,
style: Object.assign(Object.assign({}, (null === (e = A[0])
|| void 0 === e ? void 0 : e.size) ? {
width: A[0].size,
height: A[0].size
} : {}), (null === (t = A[0]) || void 0 === t ? void 0 :
t.color) ? {
backgroundColor: A[0].color
} : {})
}))), React.createElement(Tooltip, {
content: C.max,
position: "top",
trigger: "custom",
rePosKey: E,
visible: g && (T.max || v),
className: `${cssClasses$6.HANDLE}-tooltip`
}, React.createElement("span", Object.assign({
ref: this.maxHanleEl,
className: $,
style: {
[b]: 100 * E + "%",
zIndex: "max" === f ? 2 : 1
},
onMouseDown: e => {
this.foundation.onHandleDown(e, "max")
}
,
onMouseEnter: () => {
this.foundation.onHandleEnter("max")
}
,
onMouseLeave: () => {
this.foundation.onHandleLeave()
}
,
onKeyUp: e => {
this.foundation.onHandleUp(e)
}
,
onTouchStart: e => {
this.foundation.onHandleTouchStart(e, "max")
}
,
onTouchEnd: e => {
this.foundation.onHandleUp(e)
}
,
onKeyDown: e => {
this.foundation.handleKeyDown(e, "max")
}
,
onFocus: e => {
this.foundation.onFocus(e, "max")
}
,
onBlur: e => {
this.foundation.onBlur(e, "max")
}
,
role: "slider",
tabIndex: h ? -1 : 0
}, k, {
"aria-valuetext": p ? p(R[1], 1) : d,
"aria-valuenow": R[1],
"aria-valuemax": P,
"aria-valuemin": R[0]
}), (null === (r = this.props.handleDot) || void 0 === r ? void
0 : r[1]) && React.createElement("div", {
className: cssClasses$6.HANDLE_DOT,
style: Object.assign(Object.assign({}, (null === (n =
this.props.handleDot[1]) || void 0 === n ? void 0 : n.size) ? {
width: this.props.handleDot[1].size,
height: this.props.handleDot[1].size
} : {}), (null === (i = this.props.handleDot[1]) || void 0
=== i ? void 0 : i.color) ? {
backgroundColor: this.props.handleDot[1].color
} : {})
})))) : React.createElement(Tooltip, {
content: C.min,
showArrow: this.props.showArrow,
position: "top",
trigger: "custom",
rePosKey: _,
visible: g && (T.min || y),
className: `${cssClasses$6.HANDLE}-tooltip`
}, React.createElement("span", Object.assign({
onMouseOver:
this.foundation.checkAndUpdateIsInRenderTreeState,
ref: this.minHanleEl,
className: S,
style: {
[b]: 100 * _ + "%",
zIndex: "min" === f && m ? 2 : 1
},
onMouseDown: e => {
this.foundation.onHandleDown(e, "min")
}
,
onMouseEnter: () => {
this.foundation.onHandleEnter("min")
}
,
onTouchStart: e => {
this.foundation.onHandleTouchStart(e, "min")
}
,
onMouseLeave: () => {
this.foundation.onHandleLeave()
}
,
onKeyUp: e => {
this.foundation.onHandleUp(e)
}
,
onTouchEnd: e => {
this.foundation.onHandleUp(e)
}
,
onKeyDown: e => {
this.foundation.handleKeyDown(e, "min")
}
,
onFocus: e => {
this.foundation.onFocus(e, "min")
}
,
onBlur: e => {
this.foundation.onBlur(e, "min")
}
,
role: "slider",
"aria-valuetext": p ? p(R, 0) : d,
tabIndex: h ? -1 : 0
}, k, {
"aria-valuenow": R,
"aria-valuemax": P,
"aria-valuemin": w
}), A && React.createElement("div", {
className: cssClasses$6.HANDLE_DOT,
style: Object.assign(Object.assign({}, (null == A ? void
0 : A.size) ? {
width: A.size,
height: A.size
} : {}), (null == A ? void 0 : A.color) ? {
backgroundColor: A.color
} : {})
})));
return I
}
,
this.renderTrack = () => {
const {range: e, included: t, vertical: r} = this.props
, n =
this.foundation.getMinAndMaxPercent(this.state.currentValue)
, i = n.min
, o = n.max;
let s = r ? {
height: e ? 100 * Math.abs(o - i) + "%" : 100 * i + "%",
top: e ? 100 * Math.min(i, o) + "%" : 0
} : {
width: e ? 100 * Math.abs(o - i) + "%" : 100 * i + "%",
left: e ? 100 * Math.min(i, o) + "%" : 0
};
return s = t ? s : {},
React.createElement("div", {
className: cssClasses$6.TRACK,
style: s,
onClick: this.foundation.handleWrapClick
})
}
,
this.renderStepDot = () => {
const {min: e, max: t, vertical: r, marks: n} = this.props
, i = r ? "top" : "left";
return n && Object.keys(n).length > 0 ?
React.createElement("div", {
className: cssClasses$6.DOTS
}, Object.keys(n).map((r => {
const o = this.foundation.isMarkActive(Number(r))
, s = classNames(`${prefixCls$3}-dot`, {
[`${prefixCls$3}-dot-active`]: "active" ===
this.foundation.isMarkActive(Number(r))
})
, a = (Number(r) - e) / (t - e)
, l = React.createElement("span", {
key: r,
onClick: this.foundation.handleWrapClick,
className: s,
style: {
[i]: `calc(${100 * a}% - 2px)`
}
});
return o ? this.props.tooltipOnMark ?
React.createElement(Tooltip, {
content: n[r]
}, l) : l : null
}
))) : null
}
,
this.renderLabel = () => {
if (!this.props.showMarkLabel)
return null;
const {min: e, max: t, vertical: r, marks: n, verticalReverse:
i} = this.props
, o = r ? "top" : "left";
return n && Object.keys(n).length > 0 ?
React.createElement("div", {
className: cssClasses$6.MARKS + (r && i ? "-reverse" : "")
}, Object.keys(n).map((s => {
const a = this.foundation.isMarkActive(Number(s))
, l = (Number(s) - e) / (t - e);
return a ? React.createElement("span", {
key: s,
className: classNames(`${prefixCls$3}-mark${r && i ? "-
reverse" : ""}`),
style: {
[o]: 100 * l + "%"
},
onClick: this.foundation.handleWrapClick
}, n[s]) : null
}
))) : null
}
,
this._getAriaValueText = (e, t) => {
const {getAriaValueText: r} = this.props;
return r ? r(e, t) : e
}
;
let {value: t} = this.props;
t || (t = this.props.defaultValue),
this.state = {
currentValue: t || (this.props.range ? [0, 0] : 0),
min: this.props.min || 0,
max: this.props.max || 0,
focusPos: "",
onChange: this.props.onChange,
disabled: this.props.disabled || !1,
chooseMovePos: "",
isDrag: !1,
clickValue: 0,
showBoundary: !1,
isInRenderTree: !0,
firstDotFocusVisible: !1,
secondDotFocusVisible: !1
},
this.sliderEl = React.createRef(),
this.minHanleEl = React.createRef(),
this.maxHanleEl = React.createRef(),
this.dragging = [!1, !1],
this.foundation = new SliderFoundation(this.adapter),
this.eventListenerSet = new Set,
this.handleDownEventListenerSet = new Set
}
get adapter() {
var e = this;
return Object.assign(Object.assign({}, super.adapter), {
getSliderLengths: () => {
var e;
if (this.sliderEl && this.sliderEl.current) {
const t = this.sliderEl.current.getBoundingClientRect()
, r = null === (e =
this.sliderEl.current.offsetParent) || void 0 === e ? void 0 :
e.getBoundingClientRect()
, n = {
x: r ? t.left - r.left :
this.sliderEl.current.offsetLeft,
y: r ? t.top - r.top :
this.sliderEl.current.offsetTop
};
return {
sliderX: n.x,
sliderY: n.y,
sliderWidth: t.width,
sliderHeight: t.height
}
}
return {
sliderX: 0,
sliderY: 0,
sliderWidth: 0,
sliderHeight: 0
}
}
,
getParentRect: () => {
const e = this.sliderEl && this.sliderEl.current &&
this.sliderEl.current.offsetParent;
if (e)
return e.getBoundingClientRect()
}
,
getScrollParentVal: () => {
const e =
this.foundation.getScrollParent(this.sliderEl.current);
return {
scrollTop: e.scrollTop,
scrollLeft: e.scrollLeft
}
}
,
isEventFromHandle: e => {
const t = [this.minHanleEl, this.maxHanleEl];
let r = !1;
return t.forEach((t => {
if (!t)
return;
const n = t && t.current
, i = ReactDOM.findDOMNode(n);
i && i.contains(e.target) && (r = !0)
}
)),
r
}
,
getOverallVars: () => ({
dragging: this.dragging
}),
updateDisabled: e => {
this.setState({
disabled: e
})
}
,
transNewPropsToState(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : _noop;
this.setState(e, t)
},
notifyChange: e => {
this.props.onChange(Array.isArray(e) ? [...e].sort(( (e, t)
=> e - t)) : e)
}
,
setDragging: e => {
this.dragging = e
}
,
updateCurrentValue: e => {
const {currentValue: t} = this.state;
e !== t && this.setState({
currentValue: e
})
}
,
setOverallVars: (e, t) => {
this[e] = t
}
,
getMinHandleEl: () => this.minHanleEl.current,
getMaxHandleEl: () => this.maxHanleEl.current,
onHandleDown: e => {
this.handleDownEventListenerSet.add(this._addEventListener(document.body,
"mousemove", this.foundation.onHandleMove, !1)),
this.handleDownEventListenerSet.add(this._addEventListener(window, "mouseup",
this.foundation.onHandleUp, !1)),
this.handleDownEventListenerSet.add(this._addEventListener(document.body,
"touchmove", this.foundation.onHandleTouchMove, !1))
}
,
onHandleMove: function(t, r) {
let n = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : _noop
, i = arguments.length > 3 && void 0 !== arguments[3] &&
arguments[3]
, o = arguments.length > 4 ? arguments[4] : void 0;
if (!e.foundation.checkAndUpdateIsInRenderTreeState())
return;
const {value: s} = e.props;
let a = o;
if (void 0 === a) {
const n = e.foundation.transPosToValue(t, r);
if (!1 === n)
return;
a = e.foundation.outPutValue(n)
}
const {currentValue: l} = e.state;
if (!_isEqual(e.foundation.outPutValue(l), a)) {
if (!i && e.foundation.valueFormatIsCorrect(s))
return !1;
e.setState({
currentValue: a
}, n)
}
},
setEventDefault: e => {
e.stopPropagation(),
e.preventDefault()
}
,
setStateVal: (e, t) => {
this.setState({
[e]: t
})
}
,
checkAndUpdateIsInRenderTreeState: () => {
const e = domIsInRenderTree(this.sliderEl.current);
return e !== this.state.isInRenderTree && this.setState({
isInRenderTree: e
}),
e
}
,
onHandleEnter: e => {
this.setState({
focusPos: e
})
}
,
onHandleLeave: () => {
this.setState({
focusPos: ""
})
}
,
onHandleUpBefore: e => {
var t, r;
null === (r = (t = this.props).onMouseUp) || void 0 === r
|| r.call(t, e),
e.stopPropagation(),
e.preventDefault(),
Array.from(this.handleDownEventListenerSet).forEach((e =>
e())),
this.handleDownEventListenerSet.clear()
}
,
onHandleUpAfter: () => {
const {currentValue: e} = this.state
, t = this.foundation.outPutValue(e);
this.props.onAfterChange(t)
}
,
unSubscribeEventListener: () => {
Array.from(this.eventListenerSet).forEach((e => e()))
}
})
}
componentDidMount() {
this.foundation.init()
}
componentDidUpdate(e, t) {
const r = !_isEqual(this.props.value, e.value);
if (this.props.disabled !== e.disabled &&
this.foundation.handleDisabledChange(this.props.disabled),
r) {
const e = this.props.value
, t = this.state.currentValue;
this.foundation.handleValueChange(t, e),
this.props.onAfterChange(this.props.value)
}
}
componentWillUnmount() {
this.foundation.destroy()
}
render() {
const {disabled: e, currentValue: t, min: r, max: n} = this.state
, i = this.props
, {vertical: o, verticalReverse: s, style: a, railStyle: l,
range: c, className: u} = i
, d = __rest$h(i, ["vertical", "verticalReverse", "style",
"railStyle", "range", "className"])
, p = classNames(`${prefixCls$3}-wrapper`, {
[`${prefixCls$3}-disabled`]: e,
[`${cssClasses$6.VERTICAL}-wrapper`]: o,
[`${prefixCls$3}-reverse`]: o && s
}, u)
, h = classNames(`${prefixCls$3}-boundary`, {
[`${prefixCls$3}-boundary-show`]: this.props.showBoundary &&
this.state.showBoundary
})
, f = classNames({
[`${prefixCls$3}`]: !o,
[cssClasses$6.VERTICAL]: o
})
, m = Array.isArray(t) ? [...t].sort() : t
, g = c ? `Range: ${this._getAriaValueText(m[0], 0)} to $
{this._getAriaValueText(m[1], 1)}` : void 0
, y = React.createElement("div", Object.assign({
className: p,
style: a,
ref: this.sliderEl,
"aria-label": g,
onMouseEnter: () => this.foundation.handleWrapperEnter(),
onMouseLeave: () => this.foundation.handleWrapperLeave()
}, this.getDataAttr(d)), React.createElement("div", {
className: `${prefixCls$3}-rail`,
onClick: this.foundation.handleWrapClick,
style: l
}), this.renderTrack(), this.renderStepDot(),
React.createElement("div", null, this.renderHandle()), this.renderLabel(),
React.createElement("div", {
className: h
}, React.createElement("span", {
className: `${prefixCls$3}-boundary-min`
}, r), React.createElement("span", {
className: `${prefixCls$3}-boundary-max`
}, n)));
return o ? y : React.createElement("div", {
className: f
}, y)
}
_addEventListener(e, t, r) {
if (e.addEventListener) {
for (var n = arguments.length, i = new Array(n > 3 ? n - 3 :
0), o = 3; o < n; o++)
i[o - 3] = arguments[o];
e.addEventListener(t, r, ...i);
const s = () => {
null == e || e.removeEventListener(t, r),
Promise.resolve().then(( () => {
this.eventListenerSet.delete(s)
}
))
}
;
return this.eventListenerSet.add(s),
s
}
return _noop
}
}
;
Slider$1.propTypes = {
defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),
disabled: PropTypes.bool,
showMarkLabel: PropTypes.bool,
included: PropTypes.bool,
marks: PropTypes.object,
max: PropTypes.number,
min: PropTypes.number,
range: PropTypes.bool,
step: PropTypes.number,
tipFormatter: PropTypes.func,
value: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),
vertical: PropTypes.bool,
onAfterChange: PropTypes.func,
onChange: PropTypes.func,
onMouseUp: PropTypes.func,
tooltipOnMark: PropTypes.bool,
tooltipVisible: PropTypes.bool,
showArrow: PropTypes.bool,
style: PropTypes.object,
className: PropTypes.string,
showBoundary: PropTypes.bool,
railStyle: PropTypes.object,
verticalReverse: PropTypes.bool,
getAriaValueText: PropTypes.func,
handleDot: PropTypes.oneOfType([PropTypes.shape({
size: PropTypes.string,
color: PropTypes.string
}), PropTypes.arrayOf(PropTypes.shape({
size: PropTypes.string,
color: PropTypes.string
}))])
},
Slider$1.defaultProps = {
disabled: !1,
showMarkLabel: !0,
tooltipOnMark: !1,
included: !0,
max: 100,
min: 0,
range: !1,
showArrow: !0,
step: 1,
tipFormatter: e => e,
vertical: !1,
showBoundary: !1,
onAfterChange: e => {}
,
onChange: e => {}
,
verticalReverse: !1
};
class SwitchFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.handleFocusVisible = e => {
const {target: t} = e;
try {
t.matches(":focus-visible") &&
this._adapter.setFocusVisible(!0)
} catch (r) {
warning$1(!0, "Warning: [Semi Switch] The current browser
does not support the focus-visible")
}
}
,
this.handleBlur = () => {
this._adapter.setFocusVisible(!1)
}
}
init() {
const {disabled: e} = this.getProps();
this.setDisabled(e)
}
setChecked(e) {
this._adapter.setNativeControlChecked(e)
}
setDisabled(e) {
this._adapter.setNativeControlDisabled(e)
}
handleChange(e, t) {
void 0 !== this.getProps().checked ||
this._adapter.setNativeControlChecked(e),
this._adapter.notifyChange(e, t)
}
destroy() {}
}
const cssClasses$5 = {
PREFIX: `${BASE_CLASS_PREFIX$1}-switch`,
FOCUS: `${BASE_CLASS_PREFIX$1}-switch-focus`,
LARGE: `${BASE_CLASS_PREFIX$1}-switch-large`,
SMALL: `${BASE_CLASS_PREFIX$1}-switch-small`,
CHECKED: `${BASE_CLASS_PREFIX$1}-switch-checked`,
DISABLED: `${BASE_CLASS_PREFIX$1}-switch-disabled`,
ACTIVE: `${BASE_CLASS_PREFIX$1}-switch-active`,
KNOB: `${BASE_CLASS_PREFIX$1}-switch-knob`,
NATIVE_CONTROL: `${BASE_CLASS_PREFIX$1}-switch-native-control`,
CHECKED_TEXT: `${BASE_CLASS_PREFIX$1}-switch-checked-text`,
UNCHECKED_TEXT: `${BASE_CLASS_PREFIX$1}-switch-unchecked-text`,
LOADING_SPIN: `${BASE_CLASS_PREFIX$1}-switch-loading-spin`,
LOADING: `${BASE_CLASS_PREFIX$1}-switch-loading`
}
, strings$4 = {
SIZE_MAP: ["default", "small", "large"]
}
, _switch = "";
var __rest$g = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class Switch extends BaseComponent {
constructor(e) {
super(e),
this.handleFocusVisible = e => {
this.foundation.handleFocusVisible(e)
}
,
this.handleBlur = e => {
this.foundation.handleBlur()
}
,
this.state = {
nativeControlChecked: e.defaultChecked || e.checked,
nativeControlDisabled: !1,
focusVisible: !1
},
this.switchRef = React.createRef(),
this.foundation = new SwitchFoundation(this.adapter)
}
componentDidMount() {
this.foundation.init()
}
componentDidUpdate(e) {
this.props.checked !== e.checked &&
this.foundation.setChecked(this.props.checked),
this.props.disabled !== e.disabled &&
this.foundation.setDisabled(this.props.disabled)
}
componentWillUnmount() {
this.foundation.destroy()
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
setNativeControlChecked: e => {
this.setState({
nativeControlChecked: e
})
}
,
setNativeControlDisabled: e => {
this.setState({
nativeControlDisabled: e
})
}
,
setFocusVisible: e => {
this.setState({
focusVisible: e
})
}
,
notifyChange: (e, t) => {
this.props.onChange(e, t)
}
})
}
render() {
const {nativeControlChecked: e, nativeControlDisabled: t,
focusVisible: r} = this.state
, n = this.props
, {className: i, style: o, onMouseEnter: s, onMouseLeave: a,
size: l, checkedText: c, uncheckedText: u, loading: d, id: p} = n
, h = __rest$g(n, ["className", "style", "onMouseEnter",
"onMouseLeave", "size", "checkedText", "uncheckedText", "loading", "id"])
, f = classNames(i, {
[cssClasses$5.PREFIX]: !0,
[cssClasses$5.CHECKED]: e,
[cssClasses$5.DISABLED]: t,
[cssClasses$5.LARGE]: "large" === l,
[cssClasses$5.SMALL]: "small" === l,
[cssClasses$5.LOADING]: d,
[cssClasses$5.FOCUS]: r
})
, m = {
type: "checkbox",
className: cssClasses$5.NATIVE_CONTROL,
disabled: t || d,
checked: e || !1
}
, g = c && e && "small" !== l
, y = u && !e && "small" !== l;
return React.createElement("div", Object.assign({
className: f,
style: o,
onMouseEnter: s,
onMouseLeave: a
}, this.getDataAttr(h)), d ? React.createElement(Spin$1, {
wrapperClassName: cssClasses$5.LOADING_SPIN,
size: "default" === l ? "middle" : l
}) : React.createElement("div", {
className: cssClasses$5.KNOB,
"aria-hidden": !0
}), g ? React.createElement("div", {
className: cssClasses$5.CHECKED_TEXT,
"x-semi-prop": "checkedText"
}, c) : null, y ? React.createElement("div", {
className: cssClasses$5.UNCHECKED_TEXT,
"x-semi-prop": "uncheckedText"
}, u) : null, React.createElement("input", Object.assign({}, m, {
ref: this.switchRef,
id: p,
role: "switch",
"aria-checked": e,
"aria-invalid": this.props["aria-invalid"],
"aria-errormessage": this.props["aria-errormessage"],
"aria-label": this.props["aria-label"],
"aria-labelledby": this.props["aria-labelledby"],
"aria-describedby": this.props["aria-describedby"],
"aria-disabled": this.props.disabled,
onChange: e => this.foundation.handleChange(e.target.checked,
e),
onFocus: e => this.handleFocusVisible(e),
onBlur: e => this.handleBlur(e)
})))
}
}
Switch.propTypes = {
"aria-label": PropTypes.string,
"aria-labelledby": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-errormessage": PropTypes.string,
"aria-describedby": PropTypes.string,
className: PropTypes.string,
checked: PropTypes.bool,
checkedText: PropTypes.node,
defaultChecked: PropTypes.bool,
disabled: PropTypes.bool,
loading: PropTypes.bool,
onChange: PropTypes.func,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
style: PropTypes.object,
size: PropTypes.oneOf(strings$4.SIZE_MAP),
uncheckedText: PropTypes.node,
id: PropTypes.string
},
Switch.defaultProps = {
disabled: !1,
className: "",
onChange: _noop,
loading: !1,
onMouseEnter: _noop,
onMouseLeave: _noop,
size: "default"
};
const Switch$1 = Switch;
var rsAstralRange$1 = "\\ud800-\\udfff"
, rsComboMarksRange$1 = "\\u0300-\\u036f"
, reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f"
, rsComboSymbolsRange$1 = "\\u20d0-\\u20ff"
, rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 +
rsComboSymbolsRange$1
, rsVarRange$1 = "\\ufe0e\\ufe0f"
, rsZWJ$1 = "\\u200d"
, reHasUnicode = RegExp("[" + rsZWJ$1 + rsAstralRange$1 + rsComboRange$1
+ rsVarRange$1 + "]");
function hasUnicode$2(e) {
return reHasUnicode.test(e)
}
var _hasUnicode = hasUnicode$2
, baseSlice = _baseSlice;
function castSlice$1(e, t, r) {
var n = e.length;
return r = void 0 === r ? n : r,
!t && r >= n ? e : baseSlice(e, t, r)
}
var _castSlice = castSlice$1
, baseGetTag$1 = _baseGetTag
, isObjectLike$1 = isObjectLike_1
, regexpTag$2 = "[object RegExp]";
function baseIsRegExp$1(e) {
return isObjectLike$1(e) && baseGetTag$1(e) == regexpTag$2
}
var _baseIsRegExp = baseIsRegExp$1
, baseIsRegExp = _baseIsRegExp
, baseUnary$1 = _baseUnary
, nodeUtil$2 = _nodeUtilExports
, nodeIsRegExp = nodeUtil$2 && nodeUtil$2.isRegExp
, isRegExp$1 = nodeIsRegExp ? baseUnary$1(nodeIsRegExp) : baseIsRegExp
, isRegExp_1 = isRegExp$1;
function asciiToArray$1(e) {
return e.split("")
}
var _asciiToArray = asciiToArray$1
, rsAstralRange = "\\ud800-\\udfff"
, rsComboMarksRange = "\\u0300-\\u036f"
, reComboHalfMarksRange = "\\ufe20-\\ufe2f"
, rsComboSymbolsRange = "\\u20d0-\\u20ff"
, rsComboRange = rsComboMarksRange + reComboHalfMarksRange +
rsComboSymbolsRange
, rsVarRange = "\\ufe0e\\ufe0f"
, rsAstral = "[" + rsAstralRange + "]"
, rsCombo = "[" + rsComboRange + "]"
, rsFitz = "\\ud83c[\\udffb-\\udfff]"
, rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")"
, rsNonAstral = "[^" + rsAstralRange + "]"
, rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}"
, rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]"
, rsZWJ = "\\u200d"
, reOptMod = rsModifier + "?"
, rsOptVar = "[" + rsVarRange + "]?"
, rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional,
rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*"
, rsSeq = rsOptVar + reOptMod + rsOptJoin
, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional,
rsSurrPair, rsAstral].join("|") + ")"
, reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq,
"g");
function unicodeToArray$1(e) {
return e.match(reUnicode) || []
}
var _unicodeToArray = unicodeToArray$1
, asciiToArray = _asciiToArray
, hasUnicode$1 = _hasUnicode
, unicodeToArray = _unicodeToArray;
function stringToArray$1(e) {
return hasUnicode$1(e) ? unicodeToArray(e) : asciiToArray(e)
}
var _stringToArray = stringToArray$1
, baseToString$1 = _baseToString
, castSlice = _castSlice
, hasUnicode = _hasUnicode
, isIterateeCall$1 = _isIterateeCall
, isRegExp = isRegExp_1
, stringToArray = _stringToArray
, toString$1 = toString_1
, MAX_ARRAY_LENGTH = 4294967295;
function split(e, t, r) {
return r && "number" != typeof r && isIterateeCall$1(e, t, r) && (t = r
= void 0),
(r = void 0 === r ? MAX_ARRAY_LENGTH : r >>> 0) ? (e = toString$1(e))
&& ("string" == typeof t || null != t && !isRegExp(t)) && !(t = baseToString$1(t))
&& hasUnicode(e) ? castSlice(stringToArray(e), 0, r) : e.split(t, r) : []
}
var split_1 = split;
const _split = getDefaultExportFromCjs(split_1)
, cssClasses$4 = {
TABS: `${BASE_CLASS_PREFIX$1}-tabs`,
TABS_BAR: `${BASE_CLASS_PREFIX$1}-tabs-bar`,
TABS_BAR_LINE: `${BASE_CLASS_PREFIX$1}-tabs-bar-line`,
TABS_BAR_CARD: `${BASE_CLASS_PREFIX$1}-tabs-bar-card`,
TABS_BAR_BUTTON: `${BASE_CLASS_PREFIX$1}-tabs-bar-button`,
TABS_BAR_EXTRA: `${BASE_CLASS_PREFIX$1}-tabs-bar-extra`,
TABS_TAB: `${BASE_CLASS_PREFIX$1}-tabs-tab`,
TABS_TAB_ACTIVE: `${BASE_CLASS_PREFIX$1}-tabs-tab-active`,
TABS_TAB_DISABLED: `${BASE_CLASS_PREFIX$1}-tabs-tab-disabled`,
TABS_CONTENT: `${BASE_CLASS_PREFIX$1}-tabs-content`,
TABS_CONTENT_ANIMATED: `${BASE_CLASS_PREFIX$1}-tabs-content-animated`,
TABS_CONTENT_NO_ANIMATED: `${BASE_CLASS_PREFIX$1}-tabs-content-no-
animated`,
TABS_PANE: `${BASE_CLASS_PREFIX$1}-tabs-pane`,
TABS_PANE_INACTIVE: `${BASE_CLASS_PREFIX$1}-tabs-pane-inactive`,
TABS_PANE_ACTIVE: `${BASE_CLASS_PREFIX$1}-tabs-pane-active`,
TABS_PANE_MOTION_OVERLAY: `${BASE_CLASS_PREFIX$1}-tabs-pane-motion-
overlay`,
TABS_PANE_ANIMATING: `${BASE_CLASS_PREFIX$1}-tabs-pane-animating`,
TABS_PANE_ANIMATE_LEFT_SHOW: `${BASE_CLASS_PREFIX$1}-tabs-pane-animate-
leftShow`,
TABS_PANE_ANIMATE_RIGHT_SHOW: `${BASE_CLASS_PREFIX$1}-tabs-pane-
animate-rightShow`,
TABS_PANE_ANIMATE_TOP_SHOW: `${BASE_CLASS_PREFIX$1}-tabs-pane-animate-
topShow`,
TABS_PANE_ANIMATE_BOTTOM_SHOW: `${BASE_CLASS_PREFIX$1}-tabs-pane-
animate-bottomShow`
}
, strings$3 = {
TYPE_MAP: ["line", "card", "button"],
SIZE: ["small", "medium", "large"],
POSITION_MAP: ["top", "left"]
};
class TabsFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.destroy = _noop,
this.handlePrevent = e => {
e.stopPropagation(),
e.preventDefault()
}
,
this.handleKeyDown = (e, t, r) => {
const {preventScroll: n} = this.getProps()
, i = [...e.target.parentNode.childNodes].filter((e =>
_get(e, "attributes.data-tabkey.value", "").includes("semiTab") && "true" !==
_get(e, "attributes.aria-disabled.value", "")));
switch (e.key) {
case "ArrowLeft":
case "ArrowRight":
case "ArrowUp":
case "ArrowDown":
this.determineOrientation(e, i);
break;
case "Backspace":
case "Delete":
this.handleDeleteKeyDown(e, i, t, r);
break;
case "Enter":
case " ":
this.handleTabClick(t, e),
this.handlePrevent(e);
break;
case "Home":
i[0].focus({
preventScroll: n
}),
this.handlePrevent(e);
break;
case "End":
i[i.length - 1].focus({
preventScroll: n
}),
this.handlePrevent(e)
}
}
}
init() {
this._adapter.collectPane()
}
_notifyChange(e) {
const {activeKey: t} = this.getStates();
t !== e && this._adapter.notifyChange(e)
}
handleTabClick(e, t) {
this._isInProps("activeKey") ? this._notifyChange(e) :
(this._notifyChange(e),
this.handleNewActiveKey(e)),
this._adapter.notifyTabClick(e, t)
}
handleNewActiveKey(e) {
const {activeKey: t} = this.getStates();
t !== e && this._adapter.setNewActiveKey(e)
}
getDefaultActiveKey() {
let e;
const t = this.getProps();
return e = "activeKey"in t ? t.activeKey : "defaultActiveKey"in t ?
t.defaultActiveKey : this._adapter.getDefaultActiveKeyFromChildren(),
e
}
handleTabListChange() {
this._adapter.collectPane()
}
handleTabPanesChange() {
this._adapter.collectPane(),
this._adapter.collectActiveKey()
}
handleTabDelete(e) {
this._adapter.notifyTabDelete(e)
}
determineOrientation(e, t) {
const {tabPosition: r} = this.getProps();
"left" === r ? "ArrowUp" !== e.key && "ArrowDown" !== e.key ||
(this.switchTabOnArrowPress(e, t),
this.handlePrevent(e)) : "ArrowLeft" !== e.key && "ArrowRight" !==
e.key || (this.switchTabOnArrowPress(e, t),
this.handlePrevent(e))
}
handleDeleteKeyDown(e, t, r, n) {
const {preventScroll: i} = this.getProps();
if (n) {
this.handleTabDelete(r);
const n = t.indexOf(e.target);
1 !== t.length && t[n + 1 >= t.length ? n - 1 : n + 1].focus({
preventScroll: i
})
}
}
switchTabOnArrowPress(e, t) {
const {preventScroll: r} = this.getProps()
, n = t.indexOf(e.target)
, i = {
ArrowLeft: -1,
ArrowUp: -1,
ArrowRight: 1,
ArrowDown: 1
};
i[e.key] && void 0 !== n && (t[n + i[e.key]] ? t[n +
i[e.key]].focus({
preventScroll: r
}) : "ArrowLeft" === e.key || "ArrowUp" === e.key ? t[t.length -
1].focus({
preventScroll: r
}) : "ArrowRight" !== e.key && "ArrowDown" != e.key || t[0].focus({
preventScroll: r
}))
}
}
const TabsFoundation$1 = TabsFoundation
, tabs$1 = "";
var __rest$f = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const TabItem = (e, t) => {
const {tab: r, size: n, type: i, icon: o, selected: s, closable: a,
disabled: l, itemKey: c, deleteTabItem: u, tabPosition: d, handleKeyDown: p,
onClick: h} = e
, f = __rest$f(e, ["tab", "size", "type", "icon", "selected",
"closable", "disabled", "itemKey", "deleteTabItem", "tabPosition", "handleKeyDown",
"onClick"])
, m = reactExports.useMemo(( () => "card" === i && a ?
React.createElement(IconClose, {
"aria-label": "Close",
role: "button",
className: `${cssClasses$4.TABS_TAB}-icon-close`,
onClick: e => u(c, e)
}) : null), [i, a, u, c])
, g = reactExports.useCallback((e => React.createElement("span", {
className: `${cssClasses$4.TABS_BAR}-icon`
}, e)), [])
, y = reactExports.useCallback((e => {
p && p(e, c, a)
}
), [p, c, a])
, v = reactExports.useCallback((e => {
!l && h && h(c, e)
}
), [c, l, h])
, b = o ? g(o) : null
, x = classNames(cssClasses$4.TABS_TAB, `${cssClasses$4.TABS_TAB}-$
{i}`, `${cssClasses$4.TABS_TAB}-${d}`, `${cssClasses$4.TABS_TAB}-single`, {
[cssClasses$4.TABS_TAB_ACTIVE]: s,
[cssClasses$4.TABS_TAB_DISABLED]: l,
[`${cssClasses$4.TABS_TAB}-small`]: "small" === n,
[`${cssClasses$4.TABS_TAB}-medium`]: "medium" === n
});
return React.createElement("div", Object.assign({
role: "tab",
id: `semiTab${c}`,
"data-tabkey": `semiTab${c}`,
"aria-controls": `semiTabPanel${c}`,
"aria-disabled": l ? "true" : "false",
"aria-selected": s ? "true" : "false",
tabIndex: s ? 0 : -1,
onKeyDown: y,
onClick: v,
className: x
}, f, {
ref: t
}), b, r, m)
}
, ForwardTabItem = reactExports.forwardRef(TabItem);
ForwardTabItem.elementType = "Tabs.TabItem";
const TabItem$1 = ForwardTabItem;
var __rest$e = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class TabBar extends React.Component {
constructor(e) {
var t;
super(e),
t = this,
this.handleItemClick = (e, t) => {
this.props.onTabClick(e, t)
}
,
this.handleKeyDown = (e, t, r) => {
this.props.handleKeyDown(e, t, r)
}
,
this.renderTabItem = e => {
const {size: t, type: r, deleteTabItem: n, handleKeyDown: i,
tabPosition: o} = this.props
, s = this._isActive(e.itemKey);
return React.createElement(TabItem$1, Object.assign({},
_pick(e, ["disabled", "icon", "itemKey", "tab", "closable"]), {
key: this._getBarItemKeyByItemKey(e.itemKey),
selected: s,
size: t,
type: r,
tabPosition: o,
handleKeyDown: i,
deleteTabItem: n,
onClick: this.handleItemClick
}))
}
,
this.scrollTabItemIntoViewByKey = function(e) {
let r = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : "nearest";
const n = document.querySelector(`[data-uuid="${t.state.uuid}"]
.${cssClasses$4.TABS_TAB}[data-scrollkey="${e}"]`);
null == n || n.scrollIntoView({
behavior: "smooth",
block: r,
inline: r
})
}
,
this.scrollActiveTabItemIntoView = e => {
const t = this._getBarItemKeyByItemKey(this.props.activeKey);
this.scrollTabItemIntoViewByKey(t, e)
}
,
this.renderTabComponents = e => e.map((e =>
this.renderTabItem(e))),
this.handleArrowClick = (e, t) => {
const r = "start" === t ? e.pop() : e.shift();
if (!r)
return;
const n = this._getBarItemKeyByItemKey(r.itemKey);
this.scrollTabItemIntoViewByKey(n)
}
,
this.renderCollapse = (e, t, r) => {
const n = classNames({
[`${cssClasses$4.TABS_BAR}-arrow-${r}`]: r,
[`${cssClasses$4.TABS_BAR}-arrow`]: !0
});
if (_isEmpty(e))
return React.createElement("div", {
role: "presentation",
className: n
}, React.createElement(Button$1, {
disabled: !0,
icon: t,
theme: "borderless"
}));
const {dropdownClassName: i, dropdownStyle: o,
showRestInDropdown: s} = this.props
, {rePosKey: a} = this.state
, l = !e.length
, c = React.createElement(Dropdown$1.Menu, null, e.map((e =>
{
const {icon: t, tab: r, itemKey: n} = e
, i = t ? this.renderIcon(e.icon) : null;
return React.createElement(Dropdown$1.Item, {
key: n,
onClick: e => this.handleItemClick(n, e),
active: this._isActive(n)
}, i, r)
}
)))
, u = React.createElement("div", {
role: "presentation",
className: n,
onClick: t => this.handleArrowClick(e, r)
}, React.createElement(Button$1, {
disabled: l,
icon: t,
theme: "borderless"
}))
, d = classNames(i, {
[`${cssClasses$4.TABS_BAR}-dropdown`]: !0
});
return React.createElement(React.Fragment, null, s ?
React.createElement(Dropdown$1, {
className: d,
clickToHide: !0,
clickTriggerToHide: !0,
key: `${a}-${r}`,
position: "start" === r ? "bottomLeft" : "bottomRight",
render: l ? null : c,
showTick: !0,
style: o,
trigger: "hover",
disableFocusListener: !0
}, u) : u)
}
,
this.renderOverflow = e => e.map(( (e, t) => {
const r = 0 === t ? "start" : "end";
if (this.props.renderArrow)
return this.props.renderArrow(e, r, ( () =>
this.handleArrowClick(e, r)));
const n = 0 === t ? React.createElement(IconChevronLeft,
null) : React.createElement(IconChevronRight, null);
return this.renderCollapse(e, n, r)
}
)),
this.renderCollapsedTab = () => {
const {list: e} = this.props
, t = e.map((e => {
const {itemKey: t} = e;
return Object.assign({
key: this._getBarItemKeyByItemKey(t),
active: this._isActive(t)
}, e)
}
));
return React.createElement(OverflowList$1, {
items: t,
overflowRenderDirection: this.props.arrowPosition,
wrapperStyle: this.props.visibleTabsStyle,
overflowRenderer: this.renderOverflow,
renderMode: "scroll",
className: `${cssClasses$4.TABS_BAR}-overflow-list`,
visibleItemRenderer: this.renderTabItem,
onVisibleStateChange: e => {
var t, r;
const n = new Map;
e.forEach(( (e, t) => {
n.set(this._getItemKeyByBarItemKey(t), e)
}
)),
null === (r = (t = this.props).onVisibleTabsChange) ||
void 0 === r || r.call(t, n)
}
})
}
,
this.renderWithMoreTrigger = () => {
const {list: e, more: t} = this.props;
let r, n = [], i = React.createElement("div", {
className: classNames({
[`${cssClasses$4.TABS_BAR}-more-trigger`]: !0,
[`${cssClasses$4.TABS_BAR}-more-trigger-$
{this.props.type}`]: !0
})
}, React.createElement(LocaleConsumer, {
componentName: "Tabs"
}, ( (e, t) => React.createElement("div", {
className: `${cssClasses$4.TABS_BAR}-more-trigger-content`
}, React.createElement("div", null, e.more),
React.createElement(IconChevronDown, {
className: `${cssClasses$4.TABS_BAR}-more-trigger-content-
icon`
})))));
if ("number" == typeof t)
r = e.length - Math.min(t, e.length),
n = e.slice(0, r).map((e => this.renderTabItem(e)));
else if ("object" == typeof t)
r = e.length - Math.min(t.count, e.length),
n = e.slice(0, r).map((e => this.renderTabItem(e))),
t.render && (i = t.render());
else if (void 0 !== t)
throw new Error("[Semi Tabs]: invalid tab props format:
more");
return React.createElement(React.Fragment, null, n,
this.renderMoreDropdown(e.slice(r), null == t ? void 0 : t.dropdownProps, i))
}
,
this.renderMoreDropdown = (e, t, r) =>
React.createElement(Dropdown$1, Object.assign({
trigger: "hover",
showTick: !0,
position: "bottomLeft",
className: `${cssClasses$4.TABS_BAR}-more-dropdown-$
{this.props.type}`,
clickToHide: !0,
menu: e.map((e => ({
node: "item",
name: e.tab,
icon: e.icon,
onClick: t => this.props.onTabClick(e.itemKey, t),
active: this.props.activeKey === e.itemKey
})))
}, t), r),
this._isActive = e => e === this.props.activeKey,
this._getBarItemKeyByItemKey = e => `${e}-bar`,
this._getItemKeyByBarItemKey = e => e.replace(/-bar$/, ""),
this.state = {
endInd: e.list.length,
rePosKey: 0,
startInd: 0,
uuid: "",
currentVisibleItems: []
}
}
componentDidMount() {
this.setState({
uuid: getUuidv4()
})
}
componentDidUpdate(e) {
e.activeKey !== this.props.activeKey && this.props.collapsible &&
this.scrollActiveTabItemIntoView()
}
renderIcon(e) {
return React.createElement("span", null, e)
}
renderExtra() {
const {tabBarExtraContent: e, type: t, size: r} = this.props
, n = {
float: "right"
}
, i = e && e.props ? e.props.style : {}
, o = classNames(cssClasses$4.TABS_BAR_EXTRA, {
[`${cssClasses$4.TABS_BAR}-${t}-extra`]: t,
[`${cssClasses$4.TABS_BAR}-${t}-extra-${r}`]: r
});
if (e) {
const t = Object.assign(Object.assign({}, n), i);
return React.createElement("div", {
className: o,
style: t,
"x-semi-prop": "tabBarExtraContent"
}, e)
}
return null
}
render() {
const e = this.props
, {type: t, style: r, className: n, list: i, tabPosition: o,
more: s, collapsible: a} = e
, l = __rest$e(e, ["type", "style", "className", "list",
"tabPosition", "more", "collapsible"])
, c = classNames(n, {
[cssClasses$4.TABS_BAR]: !0,
[cssClasses$4.TABS_BAR_LINE]: "line" === t,
[cssClasses$4.TABS_BAR_CARD]: "card" === t,
[cssClasses$4.TABS_BAR_BUTTON]: "button" === t,
[`${cssClasses$4.TABS_BAR}-${o}`]: o,
[`${cssClasses$4.TABS_BAR}-collapse`]: a
})
, u = this.renderExtra()
, d = a ? this.renderCollapsedTab() : s ?
this.renderWithMoreTrigger() : this.renderTabComponents(i);
return React.createElement("div", Object.assign({
role: "tablist",
"aria-orientation": "left" === o ? "vertical" : "horizontal",
className: c,
style: r
}, getDataAttr(l), {
"data-uuid": this.state.uuid
}), d, u)
}
}
TabBar.propTypes = {
activeKey: PropTypes.string,
className: PropTypes.string,
collapsible: PropTypes.bool,
list: PropTypes.array,
onTabClick: PropTypes.func,
size: PropTypes.oneOf(strings$3.SIZE),
style: PropTypes.object,
tabBarExtraContent: PropTypes.node,
tabPosition: PropTypes.oneOf(strings$3.POSITION_MAP),
type: PropTypes.oneOf(strings$3.TYPE_MAP),
closable: PropTypes.bool,
deleteTabItem: PropTypes.func,
more: PropTypes.oneOfType([PropTypes.number, PropTypes.object])
};
const TabBar$1 = TabBar
, TabsContext = React.createContext({})
, TabsContext$1 = TabsContext;
var __rest$d = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class TabPane extends reactExports.PureComponent {
constructor() {
super(...arguments),
this.ref = reactExports.createRef(),
this.getDirection = (e, t, r, n) => {
if (null !== t && null !== e && Array.isArray(r) && r.length) {
const i = r.findIndex((t => t.itemKey === e))
, o = r.findIndex((e => e.itemKey === t))
, s = r.findIndex((e => e.itemKey === n));
return i === o ? s > i : o < i
}
return !1
}
,
this.shouldRender = () => {
const {itemKey: e} = this.props
, {activeKey: t, lazyRender: r} = this.context
, n = t === e;
return this._active = this._active || n,
!r || this._active
}
}
render() {
const {tabPaneMotion: e, tabPosition: t, prevActiveKey: r} =
this.context
, n = this.props
, {className: i, style: o, children: s, itemKey: a, tabIndex: l}
= n
, c = __rest$d(n, ["className", "style", "children", "itemKey",
"tabIndex"])
, u = this.context.activeKey === a
, d = classNames(i, {
[cssClasses$4.TABS_PANE_INACTIVE]: !u,
[cssClasses$4.TABS_PANE_ACTIVE]: u,
[cssClasses$4.TABS_PANE]: !0
})
, p = this.shouldRender()
, h = ( () => {
const e = this.getDirection(this.context.activeKey, a,
this.context.panes, r);
return "top" === t ? e ?
cssClasses$4.TABS_PANE_ANIMATE_RIGHT_SHOW :
cssClasses$4.TABS_PANE_ANIMATE_LEFT_SHOW : e ?
cssClasses$4.TABS_PANE_ANIMATE_BOTTOM_SHOW :
cssClasses$4.TABS_PANE_ANIMATE_TOP_SHOW
}
)()
, f = !this.context.panes.find((e => e.itemKey === r))
, m = e && u && !f && !this.context.forceDisableMotion;
return React.createElement("div", Object.assign({
ref: this.ref,
role: "tabpanel",
id: `semiTabPanel${a}`,
"aria-labelledby": `semiTab${a}`,
className: d,
style: o,
"aria-hidden": u ? "false" : "true",
tabIndex: l || 0
}, getDataAttr(c), {
"x-semi-prop": "children"
}), React.createElement(CSSAnimation$1, {
motion: m,
animationState: u ? "enter" : "leave",
startClassName: h
}, (e => {
let {animationClassName: t, animationEventsNeedBind: r} = e;
return React.createElement("div", Object.assign({
className:
classNames(cssClasses$4.TABS_PANE_MOTION_OVERLAY, t),
"x-semi-prop": "children"
}, r), p ? s : null)
}
)))
}
}
TabPane.isTabPane = !0,
TabPane.contextType = TabsContext$1,
TabPane.propTypes = {
className: PropTypes.string,
style: PropTypes.object,
children: PropTypes.node,
disabled: PropTypes.bool,
itemKey: PropTypes.string,
tab: PropTypes.node,
icon: PropTypes.node,
closable: PropTypes.bool
};
const TabPane$1 = TabPane;
var __rest$c = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const panePickKeys = ["className", "style", "disabled", "itemKey", "tab",
"icon"];
class Tabs extends BaseComponent {
constructor(e) {
super(e),
this.setContentRef = e => {
this.contentRef = {
current: e
}
}
,
this.getPanes = () => {
const {tabList: e, children: t} = this.props;
return Array.isArray(e) && e.length ? e : React.Children.map(t,
(e => {
if (e) {
const {tab: t, icon: r, disabled: n, itemKey: i,
closable: o} = e.props;
return {
tab: t,
icon: r,
disabled: n,
itemKey: i,
closable: o
}
}
}
))
}
,
this.onTabClick = (e, t) => {
this.foundation.handleTabClick(e, t)
}
,
this.rePosChildren = (e, t) => {
const r = []
, n = React.Children.toArray(e);
return e.length && (r.push(...n.filter((e => e.props &&
e.props.itemKey === t))),
r.push(...n.filter((e => e.props && e.props.itemKey !== t)))),
r
}
,
this.getActiveItem = () => {
const {activeKey: e} = this.state
, {children: t, tabList: r} = this.props;
return r || !Array.isArray(t) ? t :
React.Children.toArray(t).filter((t => !(reactExports.isValidElement(t) && t.type
&& t.type.isTabPane) || t.props.itemKey === e))
}
,
this.deleteTabItem = (e, t) => {
t.stopPropagation(),
this.foundation.handleTabDelete(e)
}
,
this.foundation = new TabsFoundation$1(this.adapter),
this.state = {
activeKey: this.foundation.getDefaultActiveKey(),
panes: this.getPanes(),
prevActiveKey: null,
forceDisableMotion: !1
},
this.contentRef = reactExports.createRef(),
this.contentHeight = "auto"
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
collectPane: () => {
const e = this.getPanes();
this.setState({
panes: e
})
}
,
collectActiveKey: () => {
const {tabList: e, children: t, activeKey: r} = this.props;
if (void 0 !== r)
return;
const {activeKey: n} = this.state
, i = this.getPanes();
-1 === i.findIndex((e => e.itemKey === n)) && (i.length > 0
? this.setState({
activeKey: i[0].itemKey
}) : this.setState({
activeKey: ""
}))
}
,
notifyTabClick: (e, t) => {
this.props.onTabClick(e, t)
}
,
notifyChange: e => {
this.props.onChange(e)
}
,
setNewActiveKey: e => {
this.setState({
activeKey: e
})
}
,
getDefaultActiveKeyFromChildren: () => {
const {tabList: e, children: t} = this.props;
let r = "";
return (e || React.Children.toArray(t).map((e =>
reactExports.isValidElement(e) ? e.props : null))).forEach((e => {
!e || r || e.disabled || (r = e.itemKey)
}
)),
r
}
,
notifyTabDelete: e => {
this.props.onTabClose && this.props.onTabClose(e)
}
})
}
static getDerivedStateFromProps(e, t) {
const r = {};
return isNullOrUndefined(e.activeKey) || e.activeKey ===
t.activeKey || (t.prevActiveKey = t.activeKey,
r.activeKey = e.activeKey),
r
}
componentDidUpdate(e, t) {
const r = React.Children.toArray(e.children).map((e =>
_pick(reactExports.isValidElement(e) ? e.props : null, panePickKeys)))
, n = React.Children.toArray(this.props.children).map((e =>
_pick(reactExports.isValidElement(e) ? e.props : null, panePickKeys)))
, i = this.props.tabList || e.tabList;
if (_isEqual(this.props.tabList, e.tabList) ||
this.foundation.handleTabListChange(),
t.activeKey !== this.state.activeKey && t.activeKey !==
this.state.prevActiveKey && this.setState({
prevActiveKey: t.activeKey
}),
e.activeKey !== this.props.activeKey) {
const e = ( () => {
const e = new Set(r.map((e => e.itemKey)));
return n.map((e => e.itemKey)).filter((t => !e.has(t)))
}
)();
this.setState({
forceDisableMotion: e.includes(this.props.activeKey)
})
}
_isEqual(r, n) || i || this.foundation.handleTabPanesChange()
}
render() {
const e = this.props
, {children: t, className: r, collapsible: n, contentStyle: i,
keepDOM: o, lazyRender: s, renderTabBar: a, showRestInDropdown: l, size: c, style:
u, tabBarClassName: d, tabBarExtraContent: p, tabBarStyle: h, tabPaneMotion: f,
tabPosition: m, type: g, more: y, onVisibleTabsChange: v, visibleTabsStyle: b,
arrowPosition: x, renderArrow: _} = e
, E = __rest$c(e, ["children", "className", "collapsible",
"contentStyle", "keepDOM", "lazyRender", "renderTabBar", "showRestInDropdown",
"size", "style", "tabBarClassName", "tabBarExtraContent", "tabBarStyle",
"tabPaneMotion", "tabPosition", "type", "more", "onVisibleTabsChange",
"visibleTabsStyle", "arrowPosition", "renderArrow"])
, {panes: T, activeKey: C} = this.state
, S = classNames(r, {
[cssClasses$4.TABS]: !0,
[`${cssClasses$4.TABS}-${m}`]: m
})
, $ = classNames({
[cssClasses$4.TABS_CONTENT]: !0,
[`${cssClasses$4.TABS_CONTENT}-${m}`]: m
})
, w = {
activeKey: C,
className: d,
collapsible: n,
list: T,
onTabClick: this.onTabClick,
showRestInDropdown: l,
size: c,
style: h,
tabBarExtraContent: p,
tabPosition: m,
type: g,
deleteTabItem: this.deleteTabItem,
handleKeyDown: this.foundation.handleKeyDown,
more: y,
onVisibleTabsChange: v,
visibleTabsStyle: b,
arrowPosition: x,
renderArrow: _
}
, P = a ? a(w, TabBar$1) : React.createElement(TabBar$1,
Object.assign({}, w))
, R = o ? t : this.getActiveItem();
return React.createElement("div", Object.assign({
className: S,
style: u
}, this.getDataAttr(E)), P,
React.createElement(TabsContext$1.Provider, {
value: {
activeKey: C,
lazyRender: s,
panes: T,
tabPaneMotion: f,
tabPosition: m,
prevActiveKey: this.state.prevActiveKey,
forceDisableMotion: this.state.forceDisableMotion
}
}, React.createElement("div", {
ref: this.setContentRef,
className: $,
style: Object.assign({}, i)
}, R)))
}
}
Tabs.TabPane = TabPane$1,
Tabs.TabItem = TabItem$1,
Tabs.propTypes = {
activeKey: PropTypes.string,
className: PropTypes.string,
collapsible: PropTypes.bool,
contentStyle: PropTypes.oneOfType([PropTypes.object]),
defaultActiveKey: PropTypes.string,
keepDOM: PropTypes.bool,
lazyRender: PropTypes.bool,
onChange: PropTypes.func,
onTabClick: PropTypes.func,
renderTabBar: PropTypes.func,
showRestInDropdown: PropTypes.bool,
size: PropTypes.oneOf(strings$3.SIZE),
style: PropTypes.object,
tabBarClassName: PropTypes.string,
tabBarExtraContent: PropTypes.node,
tabBarStyle: PropTypes.object,
tabList: PropTypes.array,
tabPaneMotion: PropTypes.bool,
tabPosition: PropTypes.oneOf(strings$3.POSITION_MAP),
type: PropTypes.oneOf(strings$3.TYPE_MAP),
onTabClose: PropTypes.func,
preventScroll: PropTypes.bool,
more: PropTypes.oneOfType([PropTypes.number, PropTypes.object]),
arrowPosition: PropTypes.string,
renderArrow: PropTypes.func
},
Tabs.__SemiComponentName__ = "Tabs",
Tabs.defaultProps =
getDefaultPropsFromGlobalConfig(Tabs.__SemiComponentName__, {
children: [],
collapsible: !1,
keepDOM: !0,
lazyRender: !1,
onChange: () => {}
,
onTabClick: () => {}
,
size: "large",
tabPaneMotion: !0,
tabPosition: "top",
type: "line",
onTabClose: () => {}
,
showRestInDropdown: !0,
arrowPosition: "both"
});
const Tabs$1 = Tabs
, parseToDate = function(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : strings$f.DEFAULT_FORMAT
, r = arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : defaultLocale$1;
if (e instanceof Date)
return e;
if ("number" == typeof e)
return new Date(_toNumber(e));
if ("string" == typeof e) {
if ("" === e)
return;
let n = new Date;
return n = parse(e, t, n, {
locale: r
}),
n
}
return void 0 !== e ? new Date : void 0
}
, formatToString = function(e) {
return format$3(e, arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : strings$f.DEFAULT_FORMAT, {
locale: arguments.length > 2 && void 0 !== arguments[2] ?
arguments[2] : defaultLocale$1
})
}
, hourIsDisabled = (e, t) => {
if ("function" == typeof e) {
const r = e();
if (Array.isArray(r) && !isNullOrUndefined(t) && r.some((e =>
_toNumber(e) === _toNumber(t))))
return !0
}
return !1
}
, minuteIsDisabled = (e, t, r) => {
if ("function" == typeof e) {
const n = e(t);
if (Array.isArray(n) && !isNullOrUndefined(t) && !
isNullOrUndefined(r) && n.some((e => _toNumber(e) === _toNumber(r))))
return !0
}
return !1
}
, secondIsDisabled = (e, t, r, n) => {
if ("function" == typeof e) {
const i = e(t, r);
if (Array.isArray(i) && !isNullOrUndefined(t) && !
isNullOrUndefined(r) && !isNullOrUndefined(n) && i.some((e => _toNumber(e) ===
_toNumber(n))))
return !0
}
return !1
}
, transformToArray = e => Array.isArray(e) ? [...e] : []
, isTimeFormatLike = (e, t) => {
let r = !0;
const n = "BDEGHKLMOPQRSTXYabcehimopqstuwxyz"
, i = new RegExp(`[${n}]`,"g")
, o = new RegExp(`[^${n}]`,"g")
, s = /[H|m|s]{1,2}/
, a = t.split(o)
, l = t.replace(i, "")
, c = new RegExp(`[${l}]`,"g")
, u = e.split(c);
if (a.length !== u.length)
r = !1;
else
for (let d = 0, p = u.length; d < p; d++) {
const e = a[d]
, t = u[d];
if (s.test(e) && t.length < e.length) {
r = !1;
break
}
}
return r
}
;
let TimePickerFoundation$1 = class extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e))
}
init() {
this.initDataFromDefaultValue();
(this._isControlledComponent("open") ? this.getProp("open") :
this.getProp("defaultOpen")) && !this._isControlledComponent("open") &&
this._adapter.registerClickOutSide()
}
getPosition() {
const e = this.getProp("position")
, t = this.getProp("type") || strings$f.DEFAULT_TYPE
, r = this.getContext("direction");
return e || ("rtl" === r ? "bottomRight" : "") ||
strings$f.DEFAULT_POSITION[t]
}
isDisabledHMS(e) {
let {hours: t, minutes: r, seconds: n} = e;
const {disabledHours: i, disabledMinutes: o, disabledSeconds: s} =
this.getProps()
, a = !isNullOrUndefined(t) && hourIsDisabled(i, t)
, l = !isNullOrUndefined(t) && !isNullOrUndefined(r) &&
minuteIsDisabled(o, t, r)
, c = !isNullOrUndefined(t) && !isNullOrUndefined(r) && !
isNullOrUndefined(n) && secondIsDisabled(s, t, r, n);
return a || l || c
}
isValidTimeZone(e) {
return ["string", "number"].includes(typeof e) && "" !== e
}
getDefaultFormatIfNeed() {
return this._isInProps("format") ? this.getProp("format") :
this.getProp("use12Hours") ? strings$f.DEFAULT_FORMAT_A : strings$f.DEFAULT_FORMAT
}
initDataFromDefaultValue() {
const e = this.getProp("defaultValue");
let t = this.getProp("value");
const r = this.getProp("timeZone")
, n = this.getValidFormat()
, {rangeSeparator: i, dateFnsLocale: o} = this.getProps();
t = t || e,
Array.isArray(t) || (t = t ? [t] : []);
const s = [];
let a = !1;
t.forEach((e => {
const t = parseToDate(e, n, o);
isNaN(t.getTime()) || s.push(this.isValidTimeZone(r) ?
utcToZonedTime(t, r) : t)
}
));
const l = [!0, !1];
s.map(( (e, t) => {
l[t] = getHours(e) < 12
}
)),
s.length === t.length ? t = s : (t = [],
t.length && (a = !0));
let c = "";
a || (c = t.map((e => formatToString(e, n, o))).join(i)),
this.setState({
isAM: l,
value: t,
inputValue: c,
invalid: a
})
}
getValidFormat(e) {
let t = e;
return isNullOrUndefined(t) && (t = this.getDefaultFormatIfNeed()),
"string" != typeof t && (t = strings$f.DEFAULT_FORMAT),
t
}
handlePanelChange(e) {
let t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : 0;
const r = this.getValidFormat()
, n = this.getProp("dateFnsLocale")
, i = this.getState("value");
let o = this.getState("isAM");
const s = transformToArray(i);
if (o = transformToArray(o),
e) {
const a = Boolean(e.isAM)
, l = parseToDate(e.timeStampValue, r, n);
s[t] = l,
o[t] = a;
const c = this.formatValue(s);
if (this.getState("isAM")[t] !== e.isAM && this.setState({
isAM: o
}),
!this._isControlledComponent("value")) {
const e = this.validateDates(s);
this.setState({
isAM: o,
value: s,
inputValue: c,
invalid: e
})
}
this._hasChanged(s, i) && this._notifyChange(s, c)
}
}
refreshProps() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {};
const {value: t, timeZone: r, __prevTimeZone: n} = e;
let i = this.parseValue(t)
, o = i.some((e => isNaN(Number(e))));
o || (this.isValidTimeZone(r) && (i = i.map((e =>
utcToZonedTime(this.isValidTimeZone(n) ? zonedTimeToUtc(e, n) : e, r)))),
o = i.some((e => this.isDisabledHMS({
hours: e.getHours(),
minutes: e.getMinutes(),
seconds: e.getSeconds()
}))));
const s = this.formatValue(i);
this.setState({
value: i,
invalid: o,
inputValue: s
})
}
handleFocus(e) {
this.getState("open") || this.handlePanelOpen(),
this._adapter.notifyFocus(e)
}
setPanel(e) {
this._adapter.togglePanel(e)
}
destroy() {
this._adapter.unregisterClickOutSide()
}
handlePanelOpen() {
this._isControlledComponent("open") ||
(this._adapter.registerClickOutSide(),
this.setPanel(!0)),
this._adapter.notifyOpenChange(!0)
}
handlePanelClose(e, t) {
this._isControlledComponent("open") ||
(this._adapter.unregisterClickOutSide(),
this.setPanel(!1)),
this._adapter.notifyOpenChange(!1),
this._adapter.notifyBlur(t)
}
handleVisibleChange(e) {
this._isControlledComponent("open") ||
this._adapter.togglePanel(e),
this._adapter.notifyOpenChange(e)
}
handleInputChange(e) {
this._adapter.setInputValue(e);
const t = this.getProp("rangeSeparator")
, r = _split(e, t)
, n = this.getValidFormat();
if ("" !== e && r.some((e => !isTimeFormatLike(e, n))))
return;
const i = this.parseInput(e)
, o = this.validateDates(i)
, s = {
invalid: o
}
, a = this.getState("value");
let l = transformToArray(a);
o || (s.value = i,
l = [...i]),
this._isControlledComponent("value") || this.setState(s),
this._hasChanged(l, a) && this._notifyChange(l, e)
}
doValidate(e) {
return "string" == typeof e ? this.validateStr(e) :
Array.isArray(e) ? this.validateDates(e) : void 0
}
validateStr() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : "";
const t = this.parseInput(e);
return this.validateDates(t)
}
validateDates() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : []
, t = e.some((e => isNaN(Number(e))));
return t || (t = e.some((e => this.isDisabledHMS({
hours: e.getHours(),
minutes: e.getMinutes(),
seconds: e.getSeconds()
})))),
t
}
handleInputBlur(e) {
const t = this.getState("invalid")
, r = this.getState("inputValue")
, n = this.getState("value");
r ? t ? this.setState({
inputValue: this.formatValue(n),
invalid: !1
}) : this.setState({
inputValue: this.formatValue(n)
}) : this.setState({
inputValue: "",
value: [],
invalid: !1
})
}
formatValue(e) {
const t = this.getValidFormat()
, r = this.getProp("rangeSeparator")
, n = this.getProp("dateFnsLocale");
let i = e;
if (i && !Array.isArray(i) && (i = i[i]),
i && Array.isArray(i)) {
return i.map((e => {
let r;
return r = _isUndefined(e) ? "" : formatToString(e, t, n),
r
}
)).join(r)
}
}
parseInput(e) {
const t = this.getValidFormat()
, r = this.getProp("rangeSeparator")
, n = this.getProp("dateFnsLocale");
return e && "string" == typeof e ? _split(e, r).map((e =>
parseToDate(e, t, n))) : []
}
parseValue() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : [];
const t = this.getValidFormat()
, r = this.getProp("dateFnsLocale");
let n = e;
return Array.isArray(n) || (n = n ? [n] : []),
Array.isArray(n) ? n.map((e => parseToDate(e, t, r))) : []
}
_notifyChange(e, t) {
let r = t
, n = e;
const i = this.getProp("timeZone");
if (this._adapter.isRangePicker()) {
const e = this.getProp("rangeSeparator");
r = _split(t, e)
} else
n = Array.isArray(n) ? n[0] : n;
if (this.isValidTimeZone(i) && n) {
const e = this.getValidFormat();
Array.isArray(n) ? (n = n.map((e => zonedTimeToUtc(e, i))),
r = n.map((t => format$3(t, e)))) : (n = zonedTimeToUtc(n, i),
r = format$3(n, e))
}
this.getProp("onChangeWithDateFirst") ?
this._adapter.notifyChange(n, r) : this._adapter.notifyChange(r, n)
}
_hasChanged() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : []
, t = arguments.length > 1 && void 0 !== arguments[1] ?
arguments[1] : [];
const r = this.getValidFormat()
, n = this.getProp("dateFnsLocale");
return e.length !== t.length || e.some(( (e, i) => {
const o = t[i];
return !isValid$4(e) || !isValid$4(o) || formatToString(e, r,
n) !== formatToString(o, r, n)
}
))
}
}
;
const TimePickerFoundation$2 = TimePickerFoundation$1;
class TimePickerFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e))
}
init() {}
destroy() {}
handleFocus(e) {
this.storeCursor(),
this._adapter.notifyFocus(e)
}
handleChange(e) {
this.storeCursor(),
this._adapter.notifyChange(e)
}
handleBlur(e) {
this.clearCursor(),
this._adapter.notifyBlur(e)
}
storeCursor() {
const e = this.getCache("inputNode");
if (e) {
const {selectionStart: t} = e;
this.setCache("cursorIndex", t)
}
}
restoreCursor() {
const e = this.getCache("inputNode")
, t = this.getCache("cursorIndex");
e && !isNullOrUndefined(t) && (e.selectionStart = t,
e.selectionEnd = t)
}
clearCursor() {
this.setCache("cursorIndex", null),
this.setCache("beforeStr", null),
this.setCache("afterStr", null)
}
}
const InputFoundation = TimePickerFoundation;
var __rest$b = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class TimeInput extends BaseComponent {
constructor(e) {
super(e),
this.setRef = e => this.adapter.setCache("inputNode", e),
this.handleClick = e => this.props.onClick(e),
this.handleFocus = e => this.foundation.handleFocus(e),
this.handleBlur = e => this.foundation.handleBlur(e),
this.handleChange = e => this.foundation.handleChange(e),
this.foundation = new InputFoundation(this.adapter),
this.state = {}
}
componentDidMount() {
super.componentDidMount();
const {focusOnOpen: e, preventScroll: t} = this.props;
if (e) {
(window.requestAnimationFrame || window.setTimeout)(( () => {
const e = this.adapter.getCache("inputNode");
e && (e.focus({
preventScroll: t
}),
e.select())
}
))
}
}
componentDidUpdate(e) {
const {timeStampValue: t} = this.props;
this.isControlled("timeStampValue") && t !==
this.state.timeStampValue && this.foundation.restoreCursor(),
this.props.value !== e.value && this.foundation.restoreCursor()
}
get adapter() {
var e = this;
return Object.assign(Object.assign({}, super.adapter), {
notifyChange: function() {
return e.props.onChange(...arguments)
},
notifyFocus: function() {
return e.props.onFocus(...arguments)
},
notifyBlur: function() {
return e.props.onBlur(...arguments)
}
})
}
getInput() {
const e = this.props
, {prefixCls: t, placeholder: r, inputReadOnly: n, onFocus: i,
disabled: o, type: s, locale: a, localeCode: l, insetLabel: c, validateStatus: u,
value: d, onChange: p, invalid: h, format: f, clearText: m, disabledHours: g,
disabledMinutes: y, disabledSeconds: v, onEsc: b, defaultOpenValue: x,
currentSelectPanel: _, focusOnOpen: E, timeStampValue: T, timeZone: C, defaultOpen:
S, dateFnsLocale: $} = e
, w = __rest$b(e, ["prefixCls", "placeholder", "inputReadOnly",
"onFocus", "disabled", "type", "locale", "localeCode", "insetLabel",
"validateStatus", "value", "onChange", "invalid", "format", "clearText",
"disabledHours", "disabledMinutes", "disabledSeconds", "onEsc", "defaultOpenValue",
"currentSelectPanel", "focusOnOpen", "timeStampValue", "timeZone", "defaultOpen",
"dateFnsLocale"])
, P = classNames(`${t}-input`, {
[`${t}-input-invalid`]: h,
[`${t}-input-readonly`]: n
})
, R = h ? "error" : u;
return React.createElement(Input$1, Object.assign({}, w, {
hideSuffix: !0,
className: P,
ref: this.setRef,
value: d,
placeholder: r || a.placeholder[s],
readonly: Boolean(n),
onChange: this.handleChange,
onFocus: this.handleFocus,
onBlur: this.handleBlur,
suffix: React.createElement(IconClock, {
onClick: this.handleClick
}),
validateStatus: R,
disabled: o,
insetLabel: c
}))
}
render() {
const {prefixCls: e} = this.props;
return React.createElement("div", {
className: `${e}-input-wrap`
}, this.getInput())
}
}
TimeInput.propTypes = {
borderless: PropTypes.bool,
format: PropTypes.string,
prefixCls: PropTypes.string,
placeholder: PropTypes.string,
clearText: PropTypes.string,
inputReadOnly: PropTypes.bool,
hourOptions: PropTypes.array,
minuteOptions: PropTypes.array,
secondOptions: PropTypes.array,
disabledHours: PropTypes.func,
disabledMinutes: PropTypes.func,
disabledSeconds: PropTypes.func,
onChange: PropTypes.func,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
onEsc: PropTypes.func,
onClick: PropTypes.func,
defaultOpenValue: PropTypes.object,
currentSelectPanel: PropTypes.string,
focusOnOpen: PropTypes.bool,
timeStampValue: PropTypes.any,
locale: PropTypes.object,
localeCode: PropTypes.string,
insetLabel: PropTypes.node,
validateStatus: PropTypes.string,
preventScroll: PropTypes.bool
},
TimeInput.defaultProps = {
borderless: !1,
inputReadOnly: !1,
onChange: _noop,
onBlur: _noop,
onFocus: _noop,
onClick: _noop,
disabledHours: _noop,
disabledMinutes: _noop,
disabledSeconds: _noop,
format: strings$f.DEFAULT_FORMAT
};
const TimeInput$1 = TimeInput
, PanelShape = {
panelHeader: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
panelFooter: PropTypes.oneOfType([PropTypes.node, PropTypes.string])
}
, PanelShapeDefaults = {}
, PlainTimeShape = [PropTypes.string, PropTypes.number,
PropTypes.instanceOf(Date)]
, TimeShape = PropTypes.oneOfType([...PlainTimeShape,
PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number),
PropTypes.arrayOf(PropTypes.instanceOf(Date))])
, timePicker = "";
var __rest$a = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
class TimePicker extends BaseComponent {
constructor(e) {
var t;
super(e),
t = this,
this.onCurrentSelectPanelChange = e => {
this.setState({
currentSelectPanel: e
})
}
,
this.handlePanelChange = (e, t) =>
this.foundation.handlePanelChange(e, t),
this.handleInput = e => this.foundation.handleInputChange(e),
this.createPanelProps = function() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : 0;
const {panels: r, panelFooter: n, panelHeader: i, locale: o} =
t.props
, s = {
panelHeader: i,
panelFooter: n
};
if (t.adapter.isRangePicker()) {
const t = {
0: o.begin,
1: o.end
};
s.panelHeader = _get(r, e, isNullOrUndefined(i) ? _get(t,
e, null) : Array.isArray(i) ? i[e] : i),
s.panelFooter = _get(r, e, Array.isArray(n) ? n[e] : n)
}
return s
}
,
this.handlePanelVisibleChange = e =>
this.foundation.handleVisibleChange(e),
this.openPanel = () => {
this.foundation.handlePanelOpen()
}
,
this.handleFocus = e => {
this.foundation.handleFocus(e)
}
,
this.handleBlur = e => this.foundation.handleInputBlur(e),
this.setTimePickerRef = e => this.timePickerRef.current = e;
const {format: r=strings$f.DEFAULT_FORMAT} = e;
this.state = {
open: e.open || e.defaultOpen || !1,
value: [],
inputValue: "",
currentSelectPanel: 0,
isAM: [!0, !1],
showHour: Boolean(r.match(/HH|hh|H|h/g)),
showMinute: Boolean(r.match(/mm/g)),
showSecond: Boolean(r.match(/ss/g)),
invalid: void 0
},
this.foundation = new TimePickerFoundation$2(this.adapter),
this.timePickerRef = React.createRef(),
this.savePanelRef = React.createRef(),
this.useCustomTrigger = "function" == typeof
this.props.triggerRender
}
get adapter() {
var e = this;
return Object.assign(Object.assign({}, super.adapter), {
togglePanel: e => {
this.setState({
open: e
})
}
,
registerClickOutSide: () => {
this.clickOutSideHandler &&
this.adapter.unregisterClickOutSide(),
this.clickOutSideHandler = e => {
const t = this.savePanelRef &&
this.savePanelRef.current
, r = this.timePickerRef &&
this.timePickerRef.current
, n = e.target
, i = e.composedPath && e.composedPath() || [n];
t && t.contains(n) || r && r.contains(n) ||
i.includes(r) || i.includes(t) || this.foundation.handlePanelClose(!0, e)
}
,
document.addEventListener("mousedown",
this.clickOutSideHandler)
}
,
setInputValue: (e, t) => this.setState({
inputValue: e
}, t),
unregisterClickOutSide: () => {
this.clickOutSideHandler &&
(document.removeEventListener("mousedown", this.clickOutSideHandler),
this.clickOutSideHandler = null)
}
,
notifyOpenChange: function() {
return e.props.onOpenChange(...arguments)
},
notifyChange: (e, t) => this.props.onChange &&
this.props.onChange(e, t),
notifyFocus: function() {
return e.props.onFocus && e.props.onFocus(...arguments)
},
notifyBlur: function() {
return e.props.onBlur && e.props.onBlur(...arguments)
},
isRangePicker: () => this.props.type ===
strings$f.TYPE_TIME_RANGE_PICKER
})
}
static getDerivedStateFromProps(e, t) {
return "open"in e && e.open !== t.open ? {
open: e.open
} : null
}
componentDidUpdate(e) {
this.isControlled("value") && this.props.value !== e.value ?
this.foundation.refreshProps(Object.assign({}, this.props)) : this.props.timeZone !
== e.timeZone && this.foundation.refreshProps({
timeZone: this.props.timeZone,
__prevTimeZone: e.timeZone,
value: this.state.value
})
}
getPanelElement() {
const {prefixCls: e, type: t} = this.props
, {isAM: r, value: n} = this.state
, i = this.foundation.getDefaultFormatIfNeed()
, o = [React.createElement(Combobox$1, Object.assign({},
this.props, {
key: 0,
format: i,
isAM: r[0],
timeStampValue: n[0],
prefixCls: `${e}-panel`,
onChange: e => this.handlePanelChange(e, 0),
onCurrentSelectPanelChange: this.onCurrentSelectPanelChange
}, this.createPanelProps(0)))];
t === strings$f.TYPE_TIME_RANGE_PICKER &&
o.push(React.createElement(Combobox$1, Object.assign({}, this.props, {
key: 1,
format: i,
isAM: r[1],
timeStampValue: n[1],
prefixCls: `${e}-panel`,
onChange: e => this.handlePanelChange(e, 1),
onCurrentSelectPanelChange: this.onCurrentSelectPanelChange
}, this.createPanelProps(1))));
const s = classNames({
[cssClasses$k.RANGE_PANEL_LISTS]: this.adapter.isRangePicker()
});
return React.createElement("div", {
ref: this.savePanelRef,
className: s
}, o.map((e => e)))
}
getPopupClassName() {
const {use12Hours: e, prefixCls: t, popupClassName: r} = this.props
, {showHour: n, showMinute: i, showSecond: o} = this.state;
let s = 0;
return n && (s += 1),
i && (s += 1),
o && (s += 1),
e && (s += 1),
classNames(`${t}-panel`, r, {
[`${t}-panel-narrow`]: !(n && i && o || e),
[cssClasses$k.RANGE_PICKER]: this.adapter.isRangePicker()
}, `${t}-panel-column-${s}`)
}
focus() {}
blur() {}
render() {
const e = this.props
, {prefixCls: t, placeholder: r, disabled: n, defaultValue: i,
dropdownMargin: o, className: s, popupStyle: a, size: l, style: c, locale: u,
localeCode: d, zIndex: p, getPopupContainer: h, insetLabel: f, insetLabelId: m,
inputStyle: g, showClear: y, panelHeader: v, panelFooter: b, rangeSeparator: x,
onOpenChange: _, onChangeWithDateFirst: E, popupClassName: T, hideDisabledOptions:
C, use12Hours: S, minuteStep: $, hourStep: w, secondStep: P, scrollItemProps: R,
triggerRender: k, motion: A, autoAdjustOverflow: I, stopPropagation: O} = e
, D = __rest$a(e, ["prefixCls", "placeholder", "disabled",
"defaultValue", "dropdownMargin", "className", "popupStyle", "size", "style",
"locale", "localeCode", "zIndex", "getPopupContainer", "insetLabel",
"insetLabelId", "inputStyle", "showClear", "panelHeader", "panelFooter",
"rangeSeparator", "onOpenChange", "onChangeWithDateFirst", "popupClassName",
"hideDisabledOptions", "use12Hours", "minuteStep", "hourStep", "secondStep",
"scrollItemProps", "triggerRender", "motion", "autoAdjustOverflow",
"stopPropagation"])
, M = this.foundation.getDefaultFormatIfNeed()
, L = this.foundation.getPosition()
, {open: j, inputValue: F, invalid: N, value: B} = this.state
, z = this.getPopupClassName()
, U = classNames({
[`${t}-header`]: !0
})
, V = classNames({
[`${t}-panel`]: !0,
[`${t}-panel-${l}`]: l
})
, H = Object.assign(Object.assign({}, D), {
disabled: n,
prefixCls: t,
size: l,
showClear: !n && y,
style: g,
value: F,
onFocus: this.handleFocus,
insetLabel: f,
insetLabelId: m,
format: M,
locale: u,
localeCode: d,
invalid: N,
placeholder: r,
onChange: this.handleInput,
onBlur: this.handleBlur
})
, G = {};
return this.useCustomTrigger && (G.onClick = this.openPanel),
React.createElement("div", Object.assign({
ref: this.setTimePickerRef,
className: classNames({
[t]: !0
}, s),
style: c
}, G), React.createElement(Popover$1, {
getPopupContainer: h,
zIndex: p,
prefixCls: V,
contentClassName: z,
style: a,
content: this.getPanelElement(),
trigger: "custom",
position: L,
visible: !n && Boolean(j),
motion: A,
margin: o,
autoAdjustOverflow: I,
stopPropagation: O
}, this.useCustomTrigger ? React.createElement(Trigger$1, {
triggerRender: k,
disabled: n,
value: B,
inputValue: F,
onChange: this.handleInput,
placeholder: r,
componentName: "TimePicker",
componentProps: Object.assign({}, this.props)
}) : React.createElement("span", {
className: U
}, React.createElement(TimeInput$1, Object.assign({}, H)))))
}
}
TimePicker.contextType = ConfigContext$1,
TimePicker.propTypes = Object.assign(Object.assign({
"aria-labelledby": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-errormessage": PropTypes.string,
"aria-describedby": PropTypes.string,
"aria-required": PropTypes.bool,
prefixCls: PropTypes.string,
borderless: PropTypes.bool,
clearText: PropTypes.string,
clearIcon: PropTypes.node,
value: TimeShape,
inputReadOnly: PropTypes.bool,
disabled: PropTypes.bool,
showClear: PropTypes.bool,
defaultValue: TimeShape,
open: PropTypes.bool,
defaultOpen: PropTypes.bool,
onOpenChange: PropTypes.func,
position: PropTypes.any,
getPopupContainer: PropTypes.func,
placeholder: PropTypes.string,
format: PropTypes.string,
style: PropTypes.object,
className: PropTypes.string,
popupClassName: PropTypes.string,
popupStyle: PropTypes.object,
disabledHours: PropTypes.func,
disabledMinutes: PropTypes.func,
disabledSeconds: PropTypes.func,
dropdownMargin: PropTypes.oneOfType([PropTypes.number,
PropTypes.object]),
hideDisabledOptions: PropTypes.bool,
onChange: PropTypes.func,
use12Hours: PropTypes.bool,
hourStep: PropTypes.number,
minuteStep: PropTypes.number,
secondStep: PropTypes.number,
focusOnOpen: PropTypes.bool,
autoFocus: PropTypes.bool,
size: PropTypes.oneOf(strings$f.SIZE),
stopPropagation: PropTypes.bool,
panels: PropTypes.arrayOf(PropTypes.shape(PanelShape)),
onFocus: PropTypes.func,
onBlur: PropTypes.func,
locale: PropTypes.object,
localeCode: PropTypes.string,
dateFnsLocale: PropTypes.object,
zIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
insetLabel: PropTypes.node,
insetLabelId: PropTypes.string,
validateStatus: PropTypes.oneOf(strings$f.STATUS),
type: PropTypes.oneOf(strings$f.TYPES),
rangeSeparator: PropTypes.string,
triggerRender: PropTypes.func,
timeZone: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
scrollItemProps: PropTypes.object,
motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func,
PropTypes.object]),
autoAdjustOverflow: PropTypes.bool
}, PanelShape), {
inputStyle: PropTypes.object,
preventScroll: PropTypes.bool
}),
TimePicker.defaultProps = Object.assign({
autoAdjustOverflow: !0,
borderless: !1,
getPopupContainer: () => document.body,
showClear: !0,
zIndex: numbers$a.DEFAULT_Z_INDEX,
rangeSeparator: strings$f.DEFAULT_RANGE_SEPARATOR,
onOpenChange: _noop,
clearText: "clear",
prefixCls: cssClasses$k.PREFIX,
inputReadOnly: !1,
style: {},
stopPropagation: !0,
className: "",
popupClassName: "",
popupStyle: {
left: "0px",
top: "0px"
},
disabledHours: () => [],
disabledMinutes: () => [],
disabledSeconds: () => [],
hideDisabledOptions: !1,
onFocus: _noop,
onBlur: _noop,
onChange: _noop,
onChangeWithDateFirst: !0,
use12Hours: !1,
focusOnOpen: !1,
onKeyDown: _noop,
size: "default",
type: strings$f.DEFAULT_TYPE,
motion: !0
}, PanelShapeDefaults);
class LocaleTimePicker extends React.PureComponent {
render() {
const {type: e} = this.props;
return React.createElement(ConfigContext$1.Consumer, null, (t => {
let {timeZone: r} = t;
return React.createElement(LocaleConsumer, {
componentName: "TimePicker"
}, ( (t, n, i) => React.createElement(TimePicker,
Object.assign({
timeZone: r,
placeholder: _get(t, ["placeholder", e])
}, this.props, {
locale: t,
localeCode: n,
dateFnsLocale: i
}))))
}
))
}
}
LocaleTimePicker.propTypes = TimePicker.propTypes,
LocaleTimePicker.__SemiComponentName__ = "TimePicker",
LocaleTimePicker.defaultProps =
getDefaultPropsFromGlobalConfig(LocaleTimePicker.__SemiComponentName__,
TimePicker.defaultProps);
class ToastListFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign(Object.assign({},
ToastListFoundation.defaultAdapter), e)),
this.handleMouseInSideChange = e => {
this._adapter.handleMouseInSideChange(e)
}
,
this.getInputWrapperRect = () =>
this._adapter.getInputWrapperRect()
}
hasToast(e) {
return this._adapter.getState("list").map((e => {
let {id: t} = e;
return t
}
)).includes(e)
}
addToast(e) {
const t = this._adapter.getState("list");
t.push(e),
this._adapter.updateToast(t, [], [])
}
updateToast(e, t) {
let r = this._adapter.getState("list");
r = r.map((r => r.id === e ? Object.assign(Object.assign({}, r), t)
: r));
const n = r.filter((t => t.id === e));
this._adapter.updateToast(r, [], n)
}
removeToast(e) {
let t = this._adapter.getState("list");
const r = [];
t = t.filter((t => t.id !== e || (r.push(t),
!1))),
this._adapter.updateToast(t, r, [])
}
destroyAll() {
const e = this._adapter.getState("list");
e.length > 0 && this._adapter.updateToast([], e, [])
}
}
const PREFIX$1 = `${BASE_CLASS_PREFIX$1}-toast`
, cssClasses$3 = {
PREFIX: PREFIX$1,
WRAPPER: `${PREFIX$1}-wrapper`,
LIST: `${PREFIX$1}-list`
}
, strings$2 = {
types: ["warning", "success", "info", "error", "default"],
themes: ["normal", "light"],
directions: ["ltr", "rtl"]
}
, numbers$1 = {
duration: 3
};
class ToastFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign(Object.assign({},
ToastFoundation.defaultAdapter), e)),
this._timer = null,
this._id = null
}
init() {
this.startCloseTimer_(),
this._id = this._adapter.getProp("id")
}
destroy() {
this.clearCloseTimer_()
}
startCloseTimer_() {
const e = this._adapter.getProp("duration");
e && _isNumber(e) && (this._timer = setTimeout(( () => {
this.close()
}
), 1e3 * e))
}
close(e) {
e && e.stopPropagation(),
this._adapter.notifyWrapperToRemove(this._id),
this._adapter.notifyClose()
}
clearCloseTimer_() {
this._timer && (clearTimeout(this._timer),
this._timer = null)
}
restartCloseTimer() {
this.clearCloseTimer_(),
this.startCloseTimer_()
}
}
const prefixCls$2 = cssClasses$3.PREFIX;
let Toast$1 = class extends BaseComponent {
constructor(e) {
super(e),
this.toastEle = React.createRef(),
this.clearCloseTimer = () => {
this.foundation.clearCloseTimer_()
}
,
this.startCloseTimer = () => {
this.foundation.startCloseTimer_()
}
,
this.restartCloseTimer = () => {
this.foundation.restartCloseTimer()
}
,
this.state = {},
this.foundation = new ToastFoundation(this.adapter)
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
notifyWrapperToRemove: e => {
this.props.close(e)
}
,
notifyClose: () => {
this.props.onClose()
}
})
}
componentDidMount() {
this.foundation.init()
}
componentWillUnmount() {
this.foundation.destroy()
}
close(e) {
this.foundation.close(e)
}
renderIcon() {
const {type: e, icon: t} = this.props
, r = {
warning: React.createElement(IconAlertTriangle, null),
success: React.createElement(IconTickCircle, null),
info: React.createElement(IconInfoCircle, null),
error: React.createElement(IconAlertCircle, null)
}[e]
, n = "large"
, i = classNames(`${prefixCls$2}-icon`, `${prefixCls$2}-icon-$
{e}`);
return t ? isSemiIcon(t) ? React.cloneElement(t, {
size: n,
className: `${prefixCls$2}-icon`
}) : t : e && r ? React.cloneElement(r, {
size: n,
className: i
}) : null
}
render() {
const {content: e, type: t, theme: r, showClose: n, textMaxWidth:
i, className: o, style: s} = this.props
, a = this.props.direction || this.context.direction
, l = classNames(prefixCls$2, o, {
[`${prefixCls$2}-${t}`]: !0,
[`${prefixCls$2}-${r}`]: "light" === r,
[`${prefixCls$2}-rtl`]: "rtl" === a
})
, c = {};
c.maxWidth = i;
const u = this.props.positionInList ?
this.props.positionInList.length - this.props.positionInList.index - 1 : 0
, d = React.createElement("div", {
ref: this.toastEle,
role: "alert",
"aria-label": `${t || "default"} type`,
className: l,
style: Object.assign(Object.assign({}, s), {
transform: `translate3d(0,0,${-10 * u}px)`
}),
onMouseEnter: this.clearCloseTimer,
onMouseLeave: this.startCloseTimer,
onAnimationStart: this.props.onAnimationStart,
onAnimationEnd: this.props.onAnimationEnd
}, React.createElement("div", {
className: `${prefixCls$2}-content`
}, this.renderIcon(), React.createElement("span", {
className: `${prefixCls$2}-content-text`,
style: c,
"x-semi-prop": "content"
}, e), n && React.createElement("div", {
className: `${prefixCls$2}-close-button`
}, React.createElement(Button$2, {
onClick: e => this.close(e),
type: "tertiary",
icon: React.createElement(IconClose, {
"x-semi-prop": "icon"
}),
theme: "borderless",
size: "small"
}))));
if (this.props.stack) {
const e = this.props.stackExpanded && this.toastEle.current &&
getComputedStyle(this.toastEle.current).height || 0;
return React.createElement("div", {
className: `${prefixCls$2}-zero-height-wrapper`,
style: {
height: e
}
}, d)
}
return d
}
}
;
Toast$1.contextType = ConfigContext$1,
Toast$1.propTypes = {
onClose: PropTypes.func,
content: PropTypes.node,
close: PropTypes.func,
duration: PropTypes.number,
theme: PropTypes.oneOf(strings$2.themes),
type: PropTypes.oneOf(strings$2.types),
textMaxWidth: PropTypes.oneOfType([PropTypes.string,
PropTypes.number]),
style: PropTypes.object,
className: PropTypes.string,
showClose: PropTypes.bool,
stack: PropTypes.bool,
stackExpanded: PropTypes.bool,
icon: PropTypes.node,
direction: PropTypes.oneOf(strings$2.directions)
},
Toast$1.__SemiComponentName__ = "Toast",
Toast$1.defaultProps =
getDefaultPropsFromGlobalConfig(Toast$1.__SemiComponentName__, {
onClose: _noop,
content: "",
close: _noop,
duration: numbers$1.duration,
textMaxWidth: 450,
showClose: !0,
stack: !1,
stackExpanded: !1,
theme: "normal"
});
const Toast$2 = Toast$1
, toast = "";
var __rest$9 = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const HookToast = (e, t) => {
var {afterClose: r} = e
, n = __rest$9(e, ["afterClose"]);
const [i,o] = reactExports.useState(!0);
return React.useImperativeHandle(t, ( () => ({
close: () => {
o(!1)
}
}))),
reactExports.useEffect(( () => {
i || r(n.id)
}
), [i]),
i ? React.createElement(Toast$2, Object.assign({}, n, {
close: () => {
o(!1)
}
})) : null
}
, HookToast$1 = React.forwardRef(HookToast)
, defaultOpts = {
motion: !0,
zIndex: 1010,
duration: 3
};
function usePatchElement() {
const [e,t] = React.useState([]);
return [e, function(e, r) {
return t((t => [{
element: e,
config: r
}, ...t])),
e => {
t((t => t.filter((t => {
let {config: r} = t;
return r.id !== e
}
))))
}
}
]
}
function useToast() {
const [e,t] = usePatchElement()
, r = reactExports.useRef(new Map)
, n = e => {
const n = getUuid("semi_toast_")
, i = Object.assign(Object.assign({}, e), {
id: n
});
let o;
const s = React.createElement(HookToast$1, Object.assign({}, i, {
key: n,
afterClose: e => o(e),
ref: e => {
var t;
r.current.set(n, {
close: null !== (t = null == e ? void 0 : e.close) &&
void 0 !== t ? t : _noop
})
}
}));
return o = t(s, Object.assign({}, i)),
n
}
;
return [{
success: e => n(Object.assign(Object.assign(Object.assign({},
defaultOpts), e), {
type: "success"
})),
info: e => n(Object.assign(Object.assign(Object.assign({},
defaultOpts), e), {
type: "info"
})),
error: e => n(Object.assign(Object.assign(Object.assign({},
defaultOpts), e), {
type: "error"
})),
warning: e => n(Object.assign(Object.assign(Object.assign({},
defaultOpts), e), {
type: "warning"
})),
open: e => n(Object.assign(Object.assign(Object.assign({},
defaultOpts), e), {
type: "default"
})),
close: e => (e => {
var t;
const {close: n} = null !== (t = r.current.get(e)) && void 0 !
== t ? t : {};
null == n || n()
}
)(e)
}, React.createElement(React.Fragment, null, Array.isArray(e) &&
e.length ? React.createElement(React.Fragment, null, e.map((e => e.element))) :
null)]
}
const createBaseToast = () => {
var e;
return (e = class e extends BaseComponent {
constructor(e) {
super(e),
this.stack = !1,
this.innerWrapperRef = React.createRef(),
this.handleMouseEnter = e => {
this.stack && this.foundation.handleMouseInSideChange(!0)
}
,
this.handleMouseLeave = e => {
var t;
if (this.stack) {
(null === (t = this.foundation.getInputWrapperRect())
|| void 0 === t ? void 0 : t.height) && this.foundation.handleMouseInSideChange(!1)
}
}
,
this.state = {
list: [],
removedItems: [],
updatedItems: [],
mouseInSide: !1
},
this.foundation = new ToastListFoundation(this.adapter)
}
get adapter() {
return Object.assign(Object.assign({}, super.adapter), {
updateToast: (e, t, r) => {
this.setState({
list: e,
removedItems: t,
updatedItems: r
})
}
,
handleMouseInSideChange: e => {
this.setState({
mouseInSide: e
})
}
,
getInputWrapperRect: () => {
var e;
return null === (e = this.innerWrapperRef.current) ||
void 0 === e ? void 0 : e.getBoundingClientRect()
}
})
}
static create(t) {
var r;
const n = null !== (r = t.id) && void 0 !== r ? r :
getUuid("toast");
if (e.ref) {
const r = document.querySelector(`#${this.wrapperId}`);
["top", "left", "bottom", "right"].map((e => {
e in t && (r.style[e] = "number" == typeof t[e] ? `$
{t[e]}px` : t[e])
}
)),
Boolean(t.stack) !== e.ref.stack && (e.ref.stack =
Boolean(t.stack)),
e.ref.has(n) ? e.ref.update(n,
Object.assign(Object.assign({}, t), {
id: n
})) : e.ref.add(Object.assign(Object.assign({}, t), {
id: n
}))
} else {
const r = document.createElement("div");
if (this.wrapperId || (this.wrapperId = getUuid("toast-
wrapper").slice(0, 26)),
r.className = cssClasses$3.WRAPPER,
r.id = this.wrapperId,
r.style.zIndex = String("number" == typeof t.zIndex ?
t.zIndex : e.defaultOpts.zIndex),
["top", "left", "bottom", "right"].map((n => {
if (n in e.defaultOpts || n in t) {
const i = t[n] ? t[n] : e.defaultOpts[n];
r.style[n] = "number" == typeof i ? `${i}px` : i
}
}
)),
e.defaultOpts.getPopupContainer) {
e.defaultOpts.getPopupContainer().appendChild(r)
} else
document.body.appendChild(r);
ReactDOM.render(React.createElement(e, {
ref: t => e.ref = t
}), r, ( () => {
e.ref.add(Object.assign(Object.assign({}, t), {
id: n
})),
e.ref.stack = Boolean(t.stack)
}
))
}
return n
}
static close(t) {
e.ref && e.ref.remove(t)
}
static destroyAll() {
if (e.ref) {
e.ref.destroyAll();
const t = document.querySelector(`#${this.wrapperId}`);
ReactDOM.unmountComponentAtNode(t),
t && t.parentNode.removeChild(t),
e.ref = null,
this.wrapperId = null
}
}
static getWrapperId() {
return this.wrapperId
}
static info(t) {
return "string" == typeof t && (t = {
content: t
}),
this.create(Object.assign(Object.assign(Object.assign({},
e.defaultOpts), t), {
type: "info"
}))
}
static warning(t) {
return "string" == typeof t && (t = {
content: t
}),
this.create(Object.assign(Object.assign(Object.assign({},
e.defaultOpts), t), {
type: "warning"
}))
}
static error(t) {
return "string" == typeof t && (t = {
content: t
}),
this.create(Object.assign(Object.assign(Object.assign({},
e.defaultOpts), t), {
type: "error"
}))
}
static success(t) {
return "string" == typeof t && (t = {
content: t
}),
this.create(Object.assign(Object.assign(Object.assign({},
e.defaultOpts), t), {
type: "success"
}))
}
static config(t) {
["top", "left", "bottom", "right"].forEach((r => {
r in t && (e.defaultOpts[r] = t[r])
}
)),
"string" == typeof t.theme &&
strings$2.themes.includes(t.theme) && (e.defaultOpts.theme = t.theme),
"number" == typeof t.zIndex && (e.defaultOpts.zIndex =
t.zIndex),
"number" == typeof t.duration && (e.defaultOpts.duration =
t.duration),
"function" == typeof t.getPopupContainer &&
(e.defaultOpts.getPopupContainer = t.getPopupContainer)
}
has(e) {
return this.foundation.hasToast(e)
}
add(e) {
return this.foundation.addToast(e)
}
update(e, t) {
return this.foundation.updateToast(e, t)
}
remove(e) {
return this.foundation.removeToast(e)
}
destroyAll() {
return this.foundation.destroyAll()
}
render() {
let {list: e} = this.state;
const {removedItems: t, updatedItems: r} = this.state;
e = Array.from(new Set([...e, ...t]));
const n = r.map((e => {
let {id: t} = e;
return t
}
))
, i = e => {
var t;
(null === (t = null == e ? void 0 : e.foundation) || void 0
=== t ? void 0 : t._id) && n.includes(e.foundation._id) &&
e.foundation.restartCloseTimer()
}
;
return React.createElement(React.Fragment, null,
React.createElement("div", {
className: classNames({
[`${cssClasses$3.PREFIX}-innerWrapper`]: !0,
[`${cssClasses$3.PREFIX}-innerWrapper-hover`]:
this.state.mouseInSide
}),
ref: this.innerWrapperRef,
onMouseEnter: this.handleMouseEnter,
onMouseLeave: this.handleMouseLeave
}, e.map(( (r, n) => {
const o = void 0 !== t.find((e => e.id === r.id));
return React.createElement(CSSAnimation$1, {
key: r.id,
motion: r.motion,
animationState: o ? "leave" : "enter",
startClassName: o ? `${cssClasses$3.PREFIX}-animation-
hide` : `${cssClasses$3.PREFIX}-animation-show`
}, (t => {
let {animationClassName: s, animationEventsNeedBind: a,
isAnimating: l} = t;
return o && !l ? null : React.createElement(Toast$2,
Object.assign({}, r, {
stack: this.stack,
stackExpanded: this.state.mouseInSide,
positionInList: {
length: e.length,
index: n
},
className: classNames({
[r.className]: Boolean(r.className),
[s]: !0
})
}, a, {
style: Object.assign({}, r.style),
close: e => this.remove(e),
ref: i
}))
}
))
}
))))
}
}
).defaultOpts = {
motion: !0,
zIndex: 1010,
content: ""
},
e.propTypes = {
content: PropTypes.node,
duration: PropTypes.number,
onClose: PropTypes.func,
icon: PropTypes.node,
direction: PropTypes.oneOf(strings$2.directions),
stack: PropTypes.bool
},
e.defaultProps = {},
e
}
;
class ToastFactory {
static create(e) {
const t = createBaseToast();
return t.useToast = useToast,
e && t.config(e),
t
}
}
const Toast = ToastFactory.create()
, cssClasses$2 = {
PREFIX: `${BASE_CLASS_PREFIX$1}-tree`,
PREFIX_OPTION: `${BASE_CLASS_PREFIX$1}-tree-option`
};
function cloneDeep(e) {
return _cloneDeepWith(e, (e => _isPlainObject(e) && !e._innerDataTag ||
React.isValidElement(e) ? e : void 0))
}
const prefixcls$2 = cssClasses$2.PREFIX;
class AutoSizer extends reactExports.PureComponent {
constructor(e) {
super(e),
this._onResize = e => {
const t = e && e[1] && e[1].target;
if (t) {
const e = _get(t, "offsetHeight") || 0
, r = window.getComputedStyle(t) || {}
, n = parseInt(_get(r, "paddingTop"), 10) || 0
, i = parseInt(_get(r, "paddingBottom"), 10) || 0
, o = e - n - i;
this.state.height !== o && this.setState({
height: e - n - i
})
}
}
,
this.state = {
height: this.props.defaultHeight || 0
}
}
componentDidMount() {
const {height: e} = this.state
}
render() {
const {children: e, defaultWidth: t, defaultHeight: r} = this.props
, {height: n} = this.state;
let i = !1;
return 0 !== n && "number" == typeof n || (i = !0),
React.createElement(ReactResizeObserver, {
observeParent: !0,
onResize: this._onResize
}, React.createElement("div", {
style: {
height: r,
overflow: "visible"
},
className: `${prefixcls$2}-auto-wrapper`
}, !i && e({
height: n,
width: t
})))
}
}
AutoSizer.propTypes = {
defaultHeight: PropTypes.oneOfType([PropTypes.number,
PropTypes.string]),
defaultWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
},
AutoSizer.defaultProps = {
defaultHeight: "100%",
defaultWidth: "100%"
};
const TreeContext = React.createContext(null)
, TreeContext$1 = TreeContext
, Indent = e => {
let {prefixcls: t, level: r, isEnd: n, showLine: i} = e;
const o = `${t}-indent-unit`
, s = [];
for (let a = 0; a < r; a += 1)
s.push(reactExports.createElement("span", {
key: a,
className: classNames(o, {
[`${o}-end`]: n[a]
})
}));
return reactExports.createElement("span", {
"aria-hidden": "true",
className: classNames(`${t}-indent`, {
[`${t}-indent-show-line`]: i
})
}, s)
}
, Indent$1 = reactExports.memo(Indent);
var __rest$8 = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixcls$1 = cssClasses$2.PREFIX_OPTION;
class TreeNode extends reactExports.PureComponent {
constructor(e) {
super(e),
this.onSelect = e => {
const {onNodeSelect: t} = this.context;
t(e, this.props)
}
,
this.onExpand = e => {
const {onNodeExpand: t} = this.context;
e && e.stopPropagation(),
e.nativeEvent.stopImmediatePropagation(),
t(e, this.props)
}
,
this.onCheck = e => {
var t, r;
if (this.isDisabled())
return;
const {onNodeCheck: n} = this.context;
e.stopPropagation(),
null === (r = null === (t = e.nativeEvent) || void 0 === t ?
void 0 : t.stopImmediatePropagation) || void 0 === r || r.call(t),
n(e, this.props)
}
,
this.handleCheckEnterPress = e => {
isEnterPress(e) && this.onCheck(e)
}
,
this.onContextMenu = e => {
const {onNodeRightClick: t} = this.context;
t(e, this.props)
}
,
this.onClick = e => {
const {expandAction: t} = this.context;
"doubleClick" !== t ? (this.onSelect(e),
"click" === t && this.onExpand(e)) : this.debounceSelect(e)
}
,
this.handleliEnterPress = e => {
isEnterPress(e) && this.onClick(e)
}
,
this.onDoubleClick = e => {
const {expandAction: t, onNodeDoubleClick: r} = this.context;
e.stopPropagation(),
e.nativeEvent.stopImmediatePropagation(),
_isFunction(r) && r(e, this.props),
"doubleClick" === t && this.onExpand(e)
}
,
this.onDragStart = e => {
const {onNodeDragStart: t} = this.context;
e.stopPropagation(),
t(e, Object.assign(Object.assign({}, this.props), {
nodeInstance: this.refNode
}));
try {
e.dataTransfer.setData("text/plain", "")
} catch (r) {}
}
,
this.onDragEnter = e => {
const {onNodeDragEnter: t} = this.context;
e.preventDefault(),
e.stopPropagation(),
t(e, Object.assign(Object.assign({}, this.props), {
nodeInstance: this.refNode
}))
}
,
this.onDragOver = e => {
const {onNodeDragOver: t} = this.context;
e.preventDefault(),
e.stopPropagation(),
t(e, Object.assign(Object.assign({}, this.props), {
nodeInstance: this.refNode
}))
}
,
this.onDragLeave = e => {
const {onNodeDragLeave: t} = this.context;
e.stopPropagation(),
t(e, Object.assign(Object.assign({}, this.props), {
nodeInstance: this.refNode
}))
}
,
this.onDragEnd = e => {
const {onNodeDragEnd: t} = this.context;
e.stopPropagation(),
t(e, Object.assign(Object.assign({}, this.props), {
nodeInstance: this.refNode
}))
}
,
this.onDrop = e => {
const {onNodeDrop: t} = this.context;
e.preventDefault(),
e.stopPropagation(),
t(e, Object.assign(Object.assign({}, this.props), {
nodeInstance: this.refNode
}))
}
,
this.getNodeChildren = () => {
const {children: e} = this.props;
return e || []
}
,
this.isLeaf = () => {
const {isLeaf: e, loaded: t} = this.props
, {loadData: r} = this.context
, n = 0 !== this.getNodeChildren().length;
return !1 !== e && (e || !r && !n || r && t && !n)
}
,
this.isDisabled = () => {
const {disabled: e} = this.props
, {treeDisabled: t} = this.context;
return !1 !== e && Boolean(t || e)
}
,
this.renderSwitcher = () => this.isLeaf() ?
React.createElement("span", {
className: classNames(`${prefixcls$1}-switcher`)
}, React.createElement("span", {
className: `${prefixcls$1}-switcher-leaf-line`
})) : null,
this.renderRealLabel = () => {
const {renderLabel: e} = this.context
, {label: t, keyword: r, data: n, filtered: i,
treeNodeFilterProp: o} = this.props;
return _isFunction(e) ? e(t, n, r) : _isString(t) && i && r ?
getHighLightTextHTML({
sourceString: t,
searchWords: [r],
option: {
highlightTag: "span",
highlightClassName: `${prefixcls$1}-highlight`
}
}) : t
}
,
this.setRef = e => {
this.refNode = e
}
,
this.state = {},
this.debounceSelect = debounce$3(this.onSelect, 500, {
leading: !0,
trailing: !1
})
}
renderArrow() {
const e = !this.isLeaf()
, {loading: t, expanded: r, showLine: n} = this.props;
return t ? React.createElement(Spin$1, {
wrapperClassName: `${prefixcls$1}-spin-icon`
}) : e ? React.createElement(IconTreeTriangleDown, {
role: "button",
"aria-label": (r ? "Expand" : "Collapse") + " the tree item",
className: `${prefixcls$1}-expand-icon`,
size: "small",
onClick: this.onExpand
}) : n ? this.renderSwitcher() : React.createElement("span", {
className: `${prefixcls$1}-empty-icon`
})
}
renderCheckbox() {
const {checked: e, halfChecked: t, eventKey: r} = this.props
, n = this.isDisabled();
return React.createElement("div", {
role: "none",
onClick: this.onCheck,
onKeyPress: this.handleCheckEnterPress
}, React.createElement(Checkbox$2, {
"aria-label": "Toggle the checked state of checkbox",
value: r,
indeterminate: t,
checked: e,
disabled: Boolean(n)
}))
}
renderIcon() {
const {directory: e, treeIcon: t} = this.context
, {expanded: r, icon: n, data: i} = this.props;
if (n)
return n;
if (t)
return "function" == typeof t ? t(this.props) : t;
if (e) {
return !this.isLeaf() ? r ? React.createElement(IconFolderOpen,
{
className: `${prefixcls$1}-item-icon`
}) : React.createElement(IconFolder, {
className: `${prefixcls$1}-item-icon`
}) : React.createElement(IconFile, {
className: `${prefixcls$1}-item-icon`
})
}
return null
}
renderEmptyNode() {
const {emptyContent: e} = this.props
, t = classNames(prefixcls$1, {
[`${prefixcls$1}-empty`]: !0
});
return React.createElement("ul", {
className: t
}, React.createElement("li", {
className: `${prefixcls$1}-label ${prefixcls$1}-label-empty`,
"x-semi-prop": "emptyContent"
}, e))
}
render() {
const e = this.props
, {eventKey: t, expanded: r, selected: n, checked: i,
halfChecked: o, loading: s, active: a, level: l, empty: c, filtered: u,
treeNodeFilterProp: d, display: p, style: h, isEnd: f, showLine: m} = e
, g = __rest$8(e, ["eventKey", "expanded", "selected", "checked",
"halfChecked", "loading", "active", "level", "empty", "filtered",
"treeNodeFilterProp", "display", "style", "isEnd", "showLine"]);
if (c)
return this.renderEmptyNode();
const {multiple: y, draggable: v, renderFullLabel: b,
dragOverNodeKey: x, dropPosition: _, labelEllipsis: E} = this.context
, T = f[f.length - 1]
, C = this.isDisabled()
, S = x === t && 0 === _
, $ = x === t && -1 === _
, w = x === t && 1 === _
, P = classNames(prefixcls$1, {
[`${prefixcls$1}-level-${l + 1}`]: !0,
[`${prefixcls$1}-fullLabel-level-${l + 1}`]: b,
[`${prefixcls$1}-collapsed`]: !r,
[`${prefixcls$1}-disabled`]: Boolean(C),
[`${prefixcls$1}-selected`]: n,
[`${prefixcls$1}-active`]: !y && a,
[`${prefixcls$1}-ellipsis`]: E,
[`${prefixcls$1}-drag-over`]: !C && S,
[`${prefixcls$1}-draggable`]: !C && v && !b,
[`${prefixcls$1}-fullLabel-draggable`]: !C && v && b,
[`${prefixcls$1}-fullLabel-drag-over-gap-top`]: !C && $ && b,
[`${prefixcls$1}-fullLabel-drag-over-gap-bottom`]: !C && w &&
b,
[`${prefixcls$1}-tree-node-last-leaf`]: T
})
, R = {
onClick: this.onClick,
onContextMenu: this.onContextMenu,
onDoubleClick: this.onDoubleClick,
className: P,
onExpand: this.onExpand,
data: g.data,
level: l,
onCheck: this.onCheck,
style: h,
expandIcon: this.renderArrow(),
checkStatus: {
checked: i,
halfChecked: o
},
expandStatus: {
expanded: r,
loading: s
},
filtered: u,
searchWord: g.keyword
}
, k = {
onDoubleClick: this.onDoubleClick,
onDragStart: v ? this.onDragStart : void 0,
onDragEnter: v ? this.onDragEnter : void 0,
onDragOver: v ? this.onDragOver : void 0,
onDragLeave: v ? this.onDragLeave : void 0,
onDrop: v ? this.onDrop : void 0,
onDragEnd: v ? this.onDragEnd : void 0,
draggable: !C && v || void 0
};
if (b) {
const e = b(Object.assign({}, R));
return v ? React.cloneElement(e, Object.assign({
ref: this.setRef
}, k)) : _isEmpty(h) ? e : React.cloneElement(e, {
style: Object.assign(Object.assign({}, _get(e, ["props",
"style"])), h)
})
}
const A = classNames(`${prefixcls$1}-label`, {
[`${prefixcls$1}-drag-over-gap-top`]: !C && $,
[`${prefixcls$1}-drag-over-gap-bottom`]: !C && w
})
, I = _get(g, ["data", "children", "length"])
, O = _isString(g.pos) ? Number(g.pos.split("-")[l + 1]) + 1 : 1;
return React.createElement("li", Object.assign({
className: P,
role: "treeitem",
"aria-disabled": C,
"aria-checked": i,
"aria-selected": n,
"aria-setsize": I,
"aria-posinset": O,
"aria-expanded": r,
"aria-level": l + 1,
"data-key": t,
onClick: this.onClick,
onKeyPress: this.handleliEnterPress,
onContextMenu: this.onContextMenu,
onDoubleClick: this.onDoubleClick,
ref: this.setRef,
style: h
}, k), React.createElement(Indent$1, {
showLine: m,
prefixcls: prefixcls$1,
level: l,
isEnd: f
}), this.renderArrow(), React.createElement("span", {
className: A
}, y ? this.renderCheckbox() : null, this.renderIcon(),
React.createElement("span", {
className: `${prefixcls$1}-label-text`
}, this.renderRealLabel())))
}
}
TreeNode.contextType = TreeContext$1,
TreeNode.propTypes = {
expanded: PropTypes.bool,
selected: PropTypes.bool,
checked: PropTypes.bool,
halfChecked: PropTypes.bool,
active: PropTypes.bool,
disabled: PropTypes.bool,
loaded: PropTypes.bool,
loading: PropTypes.bool,
isLeaf: PropTypes.bool,
pos: PropTypes.string,
children: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
icon: PropTypes.node,
directory: PropTypes.bool,
keyword: PropTypes.string,
treeNodeFilterProp: PropTypes.string,
selectedKey: PropTypes.string,
motionKey: PropTypes.oneOfType([PropTypes.string,
PropTypes.arrayOf(PropTypes.string)]),
isEnd: PropTypes.arrayOf(PropTypes.bool),
showLine: PropTypes.bool
},
TreeNode.defaultProps = {
selectedKey: "",
motionKey: ""
};
var __rest$7 = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
function NodeCollapsible(e) {
const {open: t, children: r} = e
, n = __rest$7(e, ["open", "children"])
, [i,o] = reactExports.useState(e.open);
return reactExports.useEffect(( () => {
setTimeout(( () => {
o(!e.open)
}
), 0)
}
), []),
React.createElement(Collapsible$1, Object.assign({}, n, {
isOpen: i
}), r)
}
const getTreeNodeKey = e => e.key;
class NodeList extends reactExports.PureComponent {
constructor(e) {
super(e),
this.onMotionEnd = () => {
"function" == typeof this.props.onMotionEnd &&
this.props.onMotionEnd(),
this.setState({
transitionNodes: []
})
}
,
this.state = {
transitionNodes: []
}
}
static getDerivedStateFromProps(e, t) {
const {flattenNodes: r=[], motionKeys: n, motionType: i,
flattenList: o=[]} = e
, s = !_isEqual(t.cachedMotionKeys, n) || !
_isEqual(t.cachedData.map((e => e.key)), r.map((e => e.key)))
, a = [...n];
if (!s || !a.length)
return null;
const l = []
, c = [];
let u = 0
, d = {};
return ("hide" === i && o ? o : r).forEach(( (e, t) => {
const r = getTreeNodeKey(e);
n.has(r) ? (c.push(e),
r === a[0] && (u = t)) : l.push(e)
}
)),
l.splice(u, 0, c),
d = {
transitionNodes: l,
cachedData: r,
cachedMotionKeys: n,
cachedMotionType: i
},
d
}
render() {
const {flattenNodes: e, motionType: t, searchTargetIsDeep: r,
renderTreeNode: n} = this.props
, {transitionNodes: i} = this.state;
return (i.length && !r ? i : e).map((e => {
const r = Array.isArray(e);
if (r && !e.length)
return null;
if (r && e.length) {
const r = getTreeNodeKey(e[0]);
return React.createElement(NodeCollapsible, {
open: "hide" === t,
duration: 200,
motion: Boolean(t),
key: `motion-${r}`,
onMotionEnd: this.onMotionEnd
}, e.map((e => n(e))))
}
return n(e)
}
))
}
}
NodeList.contextType = TreeContext$1;
const tree = ""
, cssClasses$1 = {
PREFIX: `${BASE_CLASS_PREFIX$1}-tree-select`,
PREFIX_TREE: `${BASE_CLASS_PREFIX$1}-tree`,
PREFIX_OPTION: `${BASE_CLASS_PREFIX$1}-tree-select-option`
}
, strings$1 = {
SIZE_SET: ["small", "large", "default"],
SEARCH_POSITION_DROPDOWN: "dropdown",
SEARCH_POSITION_TRIGGER: "trigger",
STATUS: VALIDATE_STATUS
};
class TreeSelectFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.handleKeyDown = e => {
if (e.key === ESC_KEY) {
this.getState("isOpen") && this.close(e)
}
}
,
this._registerClickOutsideHandler = () => {
this._adapter.registerClickOutsideHandler((e => {
this.handlerTriggerBlur(e),
this.close(e)
}
))
}
,
this.clearInputValue = () => {
const {inputValue: e} = this.getStates();
e && this._adapter.updateInputValue("")
}
,
this.onClickSingleTriggerSearchItem = e => {
this.focusInput(!0)
}
}
init() {
const {searchAutoFocus: e, searchPosition: t, filterTreeNode: r} =
this.getProps()
, n = t === strings$1.SEARCH_POSITION_TRIGGER && r
, i = e && n;
this._setDropdownWidth();
const o = !this._isDisabled();
(this.getProp("defaultOpen") || i) && o && (this.open(),
this._registerClickOutsideHandler()),
i && o && this.handleTriggerFocus(null)
}
destroy() {
this._adapter.unregisterClickOutsideHandler()
}
_setDropdownWidth() {
const {style: e, dropdownMatchSelectWidth: t} = this.getProps();
let r;
t && (r = e && _isNumber(e.width) || e && _isString(e.width) && !
e.width.includes("%") ? e.width : this._adapter.getTriggerWidth(),
this._adapter.setOptionWrapperWidth(r))
}
_isMultiple() {
return this.getProp("multiple")
}
_isAnimated() {
return this.getProp("motionExpand")
}
_isDisabled() {
let e = arguments.length > 0 && void 0 !== arguments[0] ?
arguments[0] : {};
return this.getProp("disabled") || e.disabled
}
_isExpandControlled() {
return this.getProp("expandedKeys")
}
_isSelectToClose() {
return !this.getProp("expandAction")
}
_isLoadControlled() {
return this.getProp("loadedKeys")
}
_showFilteredOnly() {
const {inputValue: e} = this.getStates()
, {showFilteredOnly: t} = this.getProps();
return Boolean(e) && t
}
findDataForValue(e) {
const {value: t, defaultValue: r, keyMaps: n} = this.getProps()
, i = _get(n, "value", "value")
, o = _get(n, "key", "key");
let s = [];
return t ? s = Array.isArray(t) ? t : [t] : r && (s =
Array.isArray(r) ? r : [r]),
s.find((t => t[i] === e || t[o] === e))
}
constructDataForValue(e) {
const {treeNodeLabelProp: t, keyMaps: r} = this.getProps()
, n = _get(r, "key", "key")
, i = _get(r, "label", t);
return {
[n]: e,
[i]: e
}
}
getDataForKeyNotInKeyEntities(e) {
const {onChangeWithObject: t} = this.getProps();
return t ? this.findDataForValue(e) : this.constructDataForValue(e)
}
getTreeNodeProps(e) {
const {expandedKeys: t=new Set([]), selectedKeys: r=[],
checkedKeys: n=new Set([]), halfCheckedKeys: i=new Set([]), realCheckedKeys: o=new
Set([]), keyEntities: s={}, filteredKeys: a=new Set([]), inputValue: l="",
loadedKeys: c, loadingKeys: u, filteredExpandedKeys: d=new Set([]), disabledKeys:
p=new Set([])} = this.getStates()
, {treeNodeFilterProp: h, checkRelation: f} = this.getProps()
, m = s[e];
if (!m)
return null;
let g = !1
, y = !1;
"related" === f ? (g = n.has(e),
y = i.has(e)) : "unRelated" === f && (g = o.has(e),
y = !1);
const v = {
eventKey: e,
expanded: Boolean(l) ? d.has(e) : t.has(e),
selected: r.includes(e),
checked: g,
halfChecked: y,
pos: String(m ? m.pos : ""),
level: m.level,
filtered: a.has(e),
keyword: l,
treeNodeFilterProp: h,
loading: u.has(e) && !c.has(e),
loaded: c.has(e)
};
return this.getProp("disableStrictly") && p.has(e) && (v.disabled =
!0),
v
}
handleNodeLoad(e, t, r, n) {
const {loadData: i} = this.getProps()
, {key: o} = r;
return !i || e.has(o) || t.has(o) ? {} : (i(r).then(( () => {
const e = new Set(this.getState("loadedKeys"))
, t = new Set(this.getState("loadingKeys"))
, i = e.add(o)
, s = new Set([...t]);
s.delete(o),
this._adapter.notifyLoad(i, r),
this._isLoadControlled() || this._adapter.updateState({
loadedKeys: i
}),
this._adapter.setState({
loadingKeys: s
}),
n()
}
)),
{
loadingKeys: t.add(o)
})
}
focusInput(e) {
this._adapter.updateInputFocus(e)
}
_notifyMultipleChange(e, t) {
const {keyEntities: r} = this.getStates()
, {leafOnly: n, checkRelation: i, keyMaps: o, autoMergeValue: s}
= this.getProps();
let a = [];
"related" === i ? a = s ? normalizeKeyList(e, r, n, !0) : e :
"unRelated" === i && (a = e);
const l = a.map((e => r[e] && r[e].key === e ? r[e].data :
this.getDataForKeyNotInKeyEntities(e)));
if (this.getProp("onChangeWithObject"))
this._adapter.notifyChangeWithObject(l, t);
else {
const e = getValueOrKey(l, o);
this._adapter.notifyChange(e, l, t)
}
}
_notifyChange(e, t) {
const {keyEntities: r} = this.getStates()
, {keyMaps: n} = this.getProps();
if (this._isMultiple() && Array.isArray(e))
this._notifyMultipleChange(e, t);
else {
const i = _isUndefined(e) ? e : r[e].data
, o = _isUndefined(e) ? e : getValueOrKey(i, n);
this.getProp("onChangeWithObject") ?
this._adapter.notifyChangeWithObject(i, t) : this._adapter.notifyChange(o, i, t)
}
}
_notifyFocus(e) {
this._adapter.notifyFocus(e)
}
handleTriggerFocus(e) {
this._adapter.updateIsFocus(!0),
this._notifyFocus(e),
this._registerClickOutsideHandler()
}
_notifyBlur(e) {
this._adapter.notifyBlur(e)
}
handlerTriggerBlur(e) {
this.getState("isFocus") && (this._adapter.updateIsFocus(!1),
this._notifyBlur(e),
this._adapter.unregisterClickOutsideHandler())
}
toggleHoverState(e) {
this._adapter.toggleHovering(e)
}
open() {
this._adapter.openMenu(),
this._setDropdownWidth()
}
close(e) {
this._adapter.closeMenu(),
this.getProp("motionExpand") && this._adapter.updateState({
motionKeys: new Set([])
})
}
handleClick(e) {
const t = this._isDisabled()
, {isOpen: r, inputValue: n, isFocus: i} = this.getStates()
, {searchPosition: o, clickTriggerToHide: s} = this.getProps();
if (!t)
if (i || this.handleTriggerFocus(e),
r) {
if ("trigger" === o && n)
return;
s && this.close(e)
} else
this.open()
}
handleSelectionEnterPress(e) {
isEnterPress(e) && this.handleClick(e)
}
handleClear(e) {
const {searchPosition: t, filterTreeNode: r} = this.getProps()
, {inputValue: n, selectedKeys: i} = this.getStates()
, o = this._isMultiple()
, s = this._isControlledComponent()
, a = o ? [] : void 0;
this._notifyChange(a, e),
s || (this._adapter.rePositionDropdown(),
this._adapter.updateState({
selectedKeys: [],
checkedKeys: new Set,
halfCheckedKeys: new Set,
realCheckedKeys: new Set([])
})),
r && t === strings$1.SEARCH_POSITION_TRIGGER && "" !== n &&
(_isEmpty(i) ? this.handleInputChange("") : this.clearInput()),
this._adapter.notifyClear(e)
}
handleClearEnterPress(e) {
isEnterPress(e) && this.handleClear(e)
}
removeTag(e) {
const {disableStrictly: t, checkRelation: r, keyMaps: n} =
this.getProps()
, {keyEntities: i, disabledKeys: o, realCheckedKeys: s} =
this.getStates()
, a = i[e] && i[e].key === e ? i[e].data :
this.getDataForKeyNotInKeyEntities(e);
if (!(a[_get(n, "disabled", "disabled")] || t && o.has(e))) {
if ("unRelated" === r) {
const t = new Set(s);
t.delete(e),
this._notifyChange([...t], null),
this._isControlledComponent() ||
(this._adapter.updateState({
realCheckedKeys: t
}),
this._adapter.rePositionDropdown())
} else if ("related" === r) {
const {checkedKeys: t, halfCheckedKeys: r} =
this.calcCheckedKeys(e, !1);
this._notifyChange([...t], null),
this._isControlledComponent() ||
(this._adapter.updateState({
checkedKeys: t,
halfCheckedKeys: r
}),
this._adapter.rePositionDropdown())
}
this._adapter.notifySelect(e, !1, a),
this._adapter.rePositionDropdown()
}
}
clearInput() {
const {flattenNodes: e, expandedKeys: t, selectedKeys: r,
keyEntities: n, treeData: i} = this.getStates()
, {keyMaps: o} = this.getProps()
, s = new Set(t);
this._isExpandControlled();
const a = findAncestorKeys(r, n, !1);
a.forEach((e => s.add(e)));
const l = flattenTreeData(i, s, o);
this._adapter.updateState({
expandedKeys: s,
flattenNodes: l,
inputValue: "",
motionKeys: new Set([]),
filteredKeys: new Set([]),
filteredExpandedKeys: new Set(a),
filteredShownKeys: new Set([])
}),
this._adapter.rePositionDropdown()
}
handleInputChange(e) {
this._adapter.updateInputValue(e);
const {flattenNodes: t, expandedKeys: r, selectedKeys: n,
keyEntities: i, treeData: o} = this.getStates()
, {showFilteredOnly: s, filterTreeNode: a, treeNodeFilterProp: l,
keyMaps: c} = this.getProps()
, u = "label" !== l ? l : _get(c, "label", "label")
, d = new Set(r);
let p = []
, h = []
, f = []
, m = []
, g = new Set([]);
if (e) {
const t = Object.values(i).filter((t => {
const {data: r} = t;
return filter$2(e, r, a, u)
}
));
p = t.map((e => e.data)),
h = t.map((e => e.key)),
f = findAncestorKeys(h, i, !1);
const r = findDescendantKeys(h, i, !0);
g = new Set([...r, ...f]),
m = flattenTreeData(o, new Set(f), c, s && g)
} else
f = findAncestorKeys(n, i, !1),
f.forEach((e => d.add(e))),
m = flattenTreeData(o, d, c);
const y = new Set(f);
this._adapter.notifySearch(e, Array.from(y), p),
this._adapter.updateState({
expandedKeys: d,
flattenNodes: m,
motionKeys: new Set([]),
filteredKeys: new Set(h),
filteredExpandedKeys: y,
filteredShownKeys: g
}),
this._adapter.rePositionDropdown()
}
handleNodeSelect(e, t) {
this._isDisabled(t) || (this._isMultiple() ?
this.handleMultipleSelect(e, t) : this.handleSingleSelect(e, t))
}
handleSingleSelect(e, t) {
let r = [...this.getState("selectedKeys")];
const {clickToHide: n} = this.getProps()
, {selected: i, eventKey: o, data: s} = t;
this._adapter.notifySelect(o, !0, s),
r.includes(o) || i || (r = [o],
this._notifyChange(o, e),
this._isControlledComponent() || this._adapter.updateState({
selectedKeys: r
})),
!n || !this._isSelectToClose() && s.children || (this.close(e),
this.handlerTriggerBlur(e))
}
calcCheckedKeys(e, t) {
const {keyEntities: r} = this.getStates()
, n = new Set(this.getState("checkedKeys"))
, i = new Set(this.getState("halfCheckedKeys"));
return t ? calcCheckedKeysForChecked(e, r, n, i) :
calcCheckedKeysForUnchecked(e, r, n, i)
}
handleMultipleSelect(e, t) {
const {searchPosition: r, disableStrictly: n, checkRelation: i} =
this.getProps()
, {inputValue: o, realCheckedKeys: s} = this.getStates()
, {checked: a, eventKey: l, data: c} = t;
if ("related" === i) {
const t = n ? this.calcCheckedStatus(!a, l) : !a
, {checkedKeys: r, halfCheckedKeys: i} = n ?
this.calcNonDisabledCheckedKeys(l, t) : this.calcCheckedKeys(l, t);
this._adapter.notifySelect(l, t, c),
this._notifyChange([...r], e),
this._isControlledComponent() || (this._adapter.updateState({
checkedKeys: r,
halfCheckedKeys: i
}),
this._adapter.rePositionDropdown())
} else if ("unRelated" === i) {
const t = new Set(s);
let r;
s.has(l) ? (t.delete(l),
r = !1) : (t.add(l),
r = !0),
this._adapter.notifySelect(l, r, c),
this._notifyChange([...t], e),
this._isControlledComponent() || (this._adapter.updateState({
realCheckedKeys: t
}),
this._adapter.rePositionDropdown())
}
r === strings$1.SEARCH_POSITION_TRIGGER && "" !== o &&
this._adapter.updateState({
inputValue: ""
})
}
calcNonDisabledCheckedKeys(e, t) {
const {keyEntities: r, disabledKeys: n} = this.getStates()
, i = new Set(this.getState("checkedKeys"))
, o = normalizeKeyList(findDescendantKeys([e], r, !1), r, !0);
if (!o.some((e => n.has(e))))
return this.calcCheckedKeys(e, t);
const s = o.filter((e => !n.has(e)));
return calcCheckedKeys(t ? [...s, ...i] :
_difference(normalizeKeyList([...i], r, !0, !0), s), r)
}
calcCheckedStatus(e, t) {
if (!e)
return e;
const {checkedKeys: r, keyEntities: n, disabledKeys: i} =
this.getStates()
, o = normalizeKeyList(findDescendantKeys([t], n, !1), n, !0);
if (!o.some((e => i.has(e))))
return e;
return !o.filter((e => !i.has(e))).every((e => r.has(e)))
}
handleNodeExpandInSearch(e, t) {
const {treeData: r, filteredShownKeys: n, keyEntities: i, keyMaps:
o} = this.getStates()
, s = this._showFilteredOnly()
, a = new Set(this.getState("filteredExpandedKeys"));
let l = "show";
const {eventKey: c, expanded: u, data: d} = t;
if (u ? a.has(c) && (a.delete(c),
l = "hide") : a.add(c),
this._adapter.cacheFlattenNodes("hide" === l &&
this._isAnimated()),
!this._isExpandControlled()) {
const e = flattenTreeData(r, a, o, s && n)
, t = this._isAnimated() ? getMotionKeys(c, a, i) : []
, u = {
filteredExpandedKeys: a,
flattenNodes: e,
motionKeys: new Set(t),
motionType: l
};
this._adapter.updateState(u)
}
this._adapter.notifyExpand(a, {
expanded: !u,
node: d
})
}
handleNodeExpand(e, t) {
const {loadData: r, keyMaps: n} = this.getProps()
, {inputValue: i, keyEntities: o} = this.getStates()
, s = Boolean(i);
if (!(r || t.children && t.children.length))
return;
const a = this._isExpandControlled();
if (s)
return void this.handleNodeExpandInSearch(e, t);
const {treeData: l} = this.getStates()
, c = new Set(this.getState("expandedKeys"));
let u = "show";
const {eventKey: d, expanded: p, data: h} = t;
if (p ? c.has(d) && (c.delete(d),
u = "hide") : c.add(d),
this._adapter.cacheFlattenNodes("hide" === u &&
this._isAnimated()),
!a) {
const e = flattenTreeData(l, c, n)
, t = this._isAnimated() ? getMotionKeys(d, c, o) : []
, r = {
expandedKeys: c,
flattenNodes: e,
motionKeys: new Set(t),
motionType: u
};
this._adapter.updateState(r)
}
this._adapter.notifyExpand(c, {
expanded: !p,
node: h
})
}
getRenderTextInSingle() {
const {renderSelectedItem: e, treeNodeLabelProp: t, keyMaps: r} =
this.getProps()
, {selectedKeys: n, keyEntities: i} = this.getStates()
, o = _get(r, "label", t)
, s = _isFunction(e) ? e : e => _get(e, o, null);
let a;
if (n.length) {
const e = n[0];
a = i[e] && i[e].key === e ? i[e].data :
this.getDataForKeyNotInKeyEntities(e)
}
return a ? s(a) : null
}
handleInputTriggerBlur() {
this._adapter.updateState({
inputTriggerFocus: !1
})
}
handleInputTriggerFocus() {
this.clearInput(),
this._adapter.updateState({
inputTriggerFocus: !0
})
}
setLoadKeys(e, t) {
this._adapter.updateLoadKeys(e, t)
}
handlePopoverVisibleChange(e) {
const {filterTreeNode: t, searchAutoFocus: r, searchPosition: n} =
this.getProps();
!1 === e && t && this.clearInputValue(),
t && n === strings$1.SEARCH_POSITION_DROPDOWN && e && r &&
this.focusInput(!0)
}
handleAfterClose() {
const {filterTreeNode: e} = this.getProps();
e && this.clearInput()
}
}
const treeSelect = "";
var __rest$6 = globalThis && globalThis.__rest || function(e, t) {
var r = {};
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 &&
(r[n] = e[n]);
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
var i = 0;
for (n = Object.getOwnPropertySymbols(e); i < n.length; i++)
t.indexOf(n[i]) < 0 &&
Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]])
}
return r
}
;
const prefixcls = cssClasses$1.PREFIX
, prefixTree = cssClasses$1.PREFIX_TREE
, key = 0;
class TreeSelect extends BaseComponent {
constructor(e) {
super(e),
this.renderSuffix = () => {
const {suffix: e} = this.props
, t = classNames({
[`${prefixcls}-suffix`]: !0,
[`${prefixcls}-suffix-text`]: e && _isString(e),
[`${prefixcls}-suffix-icon`]: isSemiIcon(e)
});
return React.createElement("div", {
className: t,
"x-semi-prop": "suffix"
}, e)
}
,
this.renderPrefix = () => {
const {prefix: e, insetLabel: t, insetLabelId: r} = this.props
, n = e || t
, i = classNames({
[`${prefixcls}-prefix`]: !0,
[`${prefixcls}-inset-label`]: t,
[`${prefixcls}-prefix-text`]: n && _isString(n),
[`${prefixcls}-prefix-icon`]: isSemiIcon(n)
});
return React.createElement("div", {
className: i,
id: r,
"x-semi-prop": "prefix,insetLabel"
}, n)
}
,
this.renderContent = () => {
const {dropdownMinWidth: e} = this.state
, {dropdownStyle: t, dropdownClassName: r} = this.props
, n = Object.assign({
minWidth: e
}, t)
, i = classNames(r, `${prefixcls}-popover`);
return React.createElement("div", {
className: i,
style: n,
onKeyDown: this.foundation.handleKeyDown
}, this.renderTree())
}
,
this.removeTag = e => {
this.foundation.removeTag(e)
}
,
this.handleClick = e => {
this.foundation.handleClick(e)
}
,
this.getDataForKeyNotInKeyEntities = e =>
this.foundation.getDataForKeyNotInKeyEntities(e),
this.handleSelectionEnterPress = e => {
this.foundation.handleSelectionEnterPress(e)
}
,
this.hasValue = () => {
const {multiple: e, checkRelation: t} = this.props
, {realCheckedKeys: r, checkedKeys: n, selectedKeys: i} =
this.state;
let o = !1;
return e ? "related" === t ? o = Boolean(n.size) : "unRelated"
=== t && (o = Boolean(r.size)) : o = Boolean(i.length),
o
}
,
this.showClearBtn = () => {
const {showClear: e, disabled: t, searchPosition: r} =
this.props
, {inputValue: n, isOpen: i, isHovering: o} = this.state
, s = r === strings$1.SEARCH_POSITION_TRIGGER && n;
return e && (this.hasValue() || s) && !t && (i || o)
}
,
this.renderTagList = e => {
const {keyEntities: t, disabledKeys: r} = this.state
, {treeNodeLabelProp: n, leafOnly: i, disabled: o,
disableStrictly: s, size: a, renderSelectedItem: l, keyMaps: c} = this.props
, u = _get(c, "label", n)
, d = _isFunction(l) ? l : e => ({
isRenderInTag: !0,
content: _get(e, u, null)
})
, p = [];
return e.forEach(( (e, n) => {
const i = t[e] && t[e].key === e ? t[e].data :
this.getDataForKeyNotInKeyEntities(e)
, l = (t, r) => {
r && "function" == typeof r.preventDefault &&
r.preventDefault(),
this.removeTag(e)
}
, {content: c, isRenderInTag: u} = i ? d(i, {
index: n,
onClose: l
}) : {};
if (_isNull(c) || _isUndefined(c))
return;
const h = {
closable: !(o || i.disabled || s && r.has(i.key)),
color: "white",
visible: !0,
onClose: l,
key: `tag-${e}-${n}`,
size: "small" === a ? "small" : "large"
};
u ? p.push(React.createElement(Tag, Object.assign({}, h),
c)) : p.push(c)
}
)),
p
}
,
this.renderSingleTriggerSearchItem = () => {
const {placeholder: e, disabled: t} = this.props
, {inputTriggerFocus: r} = this.state
, n = this.foundation.getRenderTextInSingle()
, i = classNames(`${prefixcls}-selection-TriggerSearchItem`,
{
[`${prefixcls}-selection-TriggerSearchItem-placeholder`]:
(r || !n) && !t,
[`${prefixcls}-selection-TriggerSearchItem-disabled`]: t
});
return React.createElement("span", {
className: i,
onClick: this.foundation.onClickSingleTriggerSearchItem
}, n || e)
}
,
this.renderSingleTriggerSearch = () => {
const {inputValue: e} = this.state;
return React.createElement(React.Fragment, null,
this.renderInput(), !e && this.renderSingleTriggerSearchItem())
}
,
this.renderSelectContent = e => {
const {multiple: t, placeholder: r, maxTagCount: n,
searchPosition: i, filterTreeNode: o, showRestTagsPopover: s, restTagsPopoverProps:
a} = this.props;
if (o && i === strings$1.SEARCH_POSITION_TRIGGER)
return t ? this.renderTagInput(e) :
this.renderSingleTriggerSearch();
if (!t || !this.hasValue()) {
const e = this.foundation.getRenderTextInSingle()
, t = classNames(`${prefixcls}-selection-content`, {
[`${prefixcls}-selection-placeholder`]: !e
});
return React.createElement("span", {
className: t
}, e || r)
}
const l = this.renderTagList(e);
return React.createElement(TagGroup, {
maxTagCount: n,
tagList: l,
size: "large",
mode: "custom",
showPopover: s,
popoverProps: a
})
}
,
this.handleClear = e => {
e && e.stopPropagation(),
this.foundation.handleClear(e)
}
,
this.handleClearEnterPress = e => {
e && e.stopPropagation(),
this.foundation.handleClearEnterPress(e)
}
,
this.handleMouseOver = e => {
this.foundation.toggleHoverState(!0)
}
,
this.handleMouseLeave = e => {
this.foundation.toggleHoverState(!1)
}
,
this.search = e => {
const {isOpen: t} = this.state;
t || this.foundation.open(),
this.foundation.handleInputChange(e)
}
,
this.close = () => {
this.foundation.close(null)
}
,
this.renderArrow = () => {
const e = this.showClearBtn()
, {arrowIcon: t} = this.props;
return e ? null : t ? React.createElement("div", {
className: classNames(`${prefixcls}-arrow`),
"x-semi-prop": "arrowIcon"
}, t) : null
}
,
this.renderClearBtn = () => {
const e = this.showClearBtn()
, {clearIcon: t} = this.props
, r = classNames(`${prefixcls}-clearbtn`);
return e ? React.createElement("div", {
role: "button",
tabIndex: 0,
"aria-label": "Clear TreeSelect value",
className: r,
onClick: this.handleClear,
onKeyPress: this.handleClearEnterPress
}, t || React.createElement(IconClear, null)) : null
}
,
this.renderSelection = () => {
const e = this.props
, {disabled: t, multiple: r, filterTreeNode: n,
validateStatus: i, prefix: o, suffix: s, style: a, size: l, insetLabel: c,
className: u, placeholder: d, showClear: p, leafOnly: h, searchPosition: f,
triggerRender: m, borderless: g, autoMergeValue: y, checkRelation: v} = e
, b = __rest$6(e, ["disabled", "multiple", "filterTreeNode",
"validateStatus", "prefix", "suffix", "style", "size", "insetLabel", "className",
"placeholder", "showClear", "leafOnly", "searchPosition", "triggerRender",
"borderless", "autoMergeValue", "checkRelation"])
, {inputValue: x, selectedKeys: _, checkedKeys: E,
keyEntities: T, isFocus: C, realCheckedKeys: S} = this.state
, $ = Boolean(n)
, w = "function" == typeof m
, P = p ? {
onMouseEnter: e => this.handleMouseOver(e),
onMouseLeave: e => this.handleMouseLeave(e)
} : {}
, R = f === strings$1.SEARCH_POSITION_TRIGGER && $
, k = R && _isEmpty(E)
, A = R && !_isEmpty(E)
, I = w ? classNames(u) : classNames(prefixcls, {
[`${prefixcls}-borderless`]: g,
[`${prefixcls}-focus`]: C,
[`${prefixcls}-disabled`]: t,
[`${prefixcls}-single`]: !r,
[`${prefixcls}-multiple`]: r,
[`${prefixcls}-multiple-tagInput-empty`]: r && k,
[`${prefixcls}-multiple-tagInput-notEmpty`]: r && A,
[`${prefixcls}-filterable`]: $,
[`${prefixcls}-error`]: "error" === i,
[`${prefixcls}-warning`]: "warning" === i,
[`${prefixcls}-small`]: "small" === l,
[`${prefixcls}-large`]: "large" === l,
[`${prefixcls}-with-prefix`]: o || c,
[`${prefixcls}-with-suffix`]: s,
[`${prefixcls}-with-suffix`]: s
}, u);
let O, D = [];
r ? y ? "related" === v ? D = normalizeKeyList([...E], T, h, !
0) : "unRelated" === v && (D = [...S]) : D = [...E] : D = _,
O = w ? React.createElement(Trigger$1, {
inputValue: x,
value: D.map((e => _get(T, [e, "data"]))),
disabled: t,
placeholder: d,
onClear: this.handleClear,
componentName: "TreeSelect",
triggerRender: m,
componentProps: Object.assign({}, this.props),
onSearch: this.search,
onRemove: this.removeTag
}) : [React.createElement(reactExports.Fragment, {
key: "prefix"
}, o || c ? this.renderPrefix() : null),
React.createElement(reactExports.Fragment, {
key: "selection"
}, React.createElement("div", {
className: `${prefixcls}-selection`
}, this.renderSelectContent(D))),
React.createElement(reactExports.Fragment, {
key: "suffix"
}, s ? this.renderSuffix() : null),
React.createElement(reactExports.Fragment, {
key: "clearBtn"
}, p || R && x ? this.renderClearBtn() : null),
React.createElement(reactExports.Fragment, {
key: "arrow"
}, this.renderArrow())];
const M = t ? null : 0;
return React.createElement("div", Object.assign({
role: "combobox",
"aria-disabled": t,
"aria-haspopup": "tree",
tabIndex: M,
className: I,
style: a,
ref: this.triggerRef,
onClick: this.handleClick,
onKeyPress: this.handleSelectionEnterPress,
onKeyDown: this.foundation.handleKeyDown,
"aria-invalid": this.props["aria-invalid"],
"aria-errormessage": this.props["aria-errormessage"],
"aria-label": this.props["aria-label"],
"aria-labelledby": this.props["aria-labelledby"],
"aria-describedby": this.props["aria-describedby"],
"aria-required": this.props["aria-required"]
}, P, this.getDataAttr(b)), O)
}
,
this.renderTagItem = (e, t) => {
const {keyEntities: r, disabledKeys: n} = this.state
, {size: i, leafOnly: o, disabled: s, disableStrictly: a,
renderSelectedItem: l, treeNodeLabelProp: c, keyMaps: u} = this.props
, d = _get(u, "label", c)
, p = normalizeKeyList([e], r, o, !0).map((t => r[e] &&
r[e].key === e ? r[e].data : this.getDataForKeyNotInKeyEntities(e)))
, h = getValueOrKey(p, u)
, f = classNames(`${prefixcls}-selection-tag`, {
[`${prefixcls}-selection-tag-disabled`]: s
})
, m = !_isEmpty(p) && !_isEmpty(p[0])
, g = a && m && n.has(p[0].key)
, y = (t, r) => {
r.preventDefault(),
this.removeTag(e)
}
, v = {
size: "small" === i ? "small" : "large",
key: `tag-${h}-${t}`,
color: "white",
className: f,
closable: m && !p[0].disabled && !s && !g,
onClose: y
}
, b = p[0]
, x = _isFunction(l) ? l : e => ({
isRenderInTag: !0,
content: _get(e, d, null)
});
if (_isFunction(x)) {
const {content: e, isRenderInTag: r} = b ? x(b, {
index: t,
onClose: y
}) : {};
return r ? React.createElement(Tag, Object.assign({}, v),
e) : e
}
return React.createElement(Tag, Object.assign({}, v), h)
}
,
this.renderTagInput = e => {
const {disabled: t, size: r, searchAutoFocus: n, placeholder:
i, maxTagCount: o, showRestTagsPopover: s, restTagsPopoverProps: a, searchPosition:
l, filterTreeNode: c, preventScroll: u} = this.props
, {inputValue: d} = this.state
, p = c && l === strings$1.SEARCH_POSITION_TRIGGER ? n : void
0;
return React.createElement(TagInput$1, {
maxTagCount: o,
disabled: t,
onInputChange: e => this.search(e),
ref: this.tagInputRef,
placeholder: i,
value: e,
inputValue: d,
size: r,
showRestTagsPopover: s,
restTagsPopoverProps: a,
autoFocus: p,
renderTagItem: (e, t) => this.renderTagItem(e, t),
onRemove: e => this.removeTag(e),
expandRestTagsOnClick: !1,
preventScroll: u
})
}
,
this.renderInput = () => {
const {searchPlaceholder: e, searchRender: t, showSearchClear:
r, searchPosition: n, searchAutoFocus: i, multiple: o, disabled: s, preventScroll:
a} = this.props
, l = n === strings$1.SEARCH_POSITION_DROPDOWN
, c = classNames({
[`${prefixTree}-input`]: l,
[`${prefixcls}-inputTrigger`]: !l
})
, {inputValue: u} = this.state
, d = {
value: u,
className: c,
preventScroll: a,
onChange: e => this.search(e)
}
, p = l ? {
showClear: r,
prefix: React.createElement(IconSearch$1, null)
} : {
autofocus: i,
onFocus: e => this.foundation.handleInputTriggerFocus(),
onBlur: e => this.foundation.handleInputTriggerBlur(),
disabled: s
}
, h = classNames({
[`${prefixTree}-search-wrapper`]: l,
[`${prefixcls}-triggerSingleSearch-wrapper`]: !l && !o
})
, f = "function" == typeof t || "boolean" == typeof t;
return f && !t ? null : React.createElement("div", {
className: h
}, React.createElement(LocaleConsumer, {
componentName: "TreeSelect"
}, (r => {
const n = l ? e || r.searchPlaceholder : "";
return f ? t(Object.assign(Object.assign(Object.assign({},
p), d), {
placeholder: n
})) : React.createElement(Input$1, Object.assign({
"aria-label": "Filter TreeSelect item",
ref: this.inputRef,
placeholder: n
}, d, p))
}
)))
}
,
this.renderEmpty = () => {
const {emptyContent: e} = this.props;
return e ? React.createElement(TreeNode, {
empty: !0,
emptyContent: this.props.emptyContent
}) : React.createElement(LocaleConsumer, {
componentName: "Tree"
}, (e => React.createElement(TreeNode, {
empty: !0,
emptyContent: e.emptyText
})))
}
,
this.onNodeLoad = e => new Promise((t =>
this.foundation.setLoadKeys(e, t))),
this.onNodeSelect = (e, t) => {
this.foundation.handleNodeSelect(e, t)
}
,
this.onNodeCheck = (e, t) => {
this.foundation.handleNodeSelect(e, t)
}
,
this.onNodeExpand = (e, t) => {
this.foundation.handleNodeExpand(e, t)
}
,
this.getTreeNodeRequiredProps = () => {
const {expandedKeys: e, selectedKeys: t, checkedKeys: r,
halfCheckedKeys: n, keyEntities: i, filteredKeys: o} = this.state;
return {
expandedKeys: e || new Set,
selectedKeys: t || [],
checkedKeys: r || new Set,
halfCheckedKeys: n || new Set,
filteredKeys: o || new Set,
keyEntities: i
}
}
,
this.getTreeNodeKey = e => {
const {data: t} = e
, {key: r} = t;
return r
}
,
this.handlePopoverVisibleChange = e => {
this.foundation.handlePopoverVisibleChange(e)
}
,
this.afterClose = () => {
this.foundation.handleAfterClose()
}
,
this.renderTreeNode = (e, t, r) => {
const {data: n, key: i} = e
, o = this.foundation.getTreeNodeProps(i)
, {showLine: s} = this.props;
if (!o)
return null;
const a = _pick(e, ["key", "label", "disabled", "isLeaf",
"icon", "isEnd"])
, {keyMaps: l} = this.props
, c = n[_get(l, "children", "children")];
return !_isUndefined(c) && (a.children = c),
React.createElement(TreeNode, Object.assign({}, o, n, a, {
data: n,
style: r,
showLine: s
}))
}
,
this.itemKey = (e, t) => {
const {visibleOptions: r} = t;
return r[e].key
}
,
this.renderNodeList = () => {
const {flattenNodes: e, cachedFlattenNodes: t, motionKeys: r,
motionType: n, filteredKeys: i} = this.state
, {direction: o} = this.context
, {virtualize: s, motionExpand: a} = this.props
, l = "expandedKeys"in this.props;
if (!s || _isEmpty(s))
return React.createElement(NodeList, {
flattenNodes: e,
flattenList: t,
motionKeys: a ? r : new Set([]),
motionType: n,
searchTargetIsDeep: l && a && _isEmpty(r) && !
_isEmpty(i),
onMotionEnd: this.onMotionEnd,
renderTreeNode: this.renderTreeNode
});
const c = {
visibleOptions: e,
renderOption: this.renderTreeNode
};
return React.createElement(AutoSizer, {
defaultHeight: s.height,
defaultWidth: s.width
}, (t => {
let {height: r, width: n} = t;
return React.createElement(FixedSizeList, {
itemCount: e.length,
itemSize: s.itemSize,
height: r,
width: n,
itemKey: this.itemKey,
itemData: c,
className: `${prefixTree}-virtual-list`,
style: {
direction: o
}
}, VirtualRow$1)
}
))
}
,
this.renderTree = () => {
const {keyEntities: e, motionKeys: t, motionType: r,
inputValue: n, filteredKeys: i, flattenNodes: o, checkedKeys: s, realCheckedKeys:
a} = this.state
, {loadData: l, filterTreeNode: c, disabled: u, multiple: d,
showFilteredOnly: p, motionExpand: h, outerBottomSlot: f, outerTopSlot: m,
expandAction: g, labelEllipsis: y, virtualize: v, optionListStyle: b,
searchPosition: x, renderLabel: _, renderFullLabel: E, checkRelation: T} =
this.props
, C = classNames(`${prefixTree}-wrapper`)
, S = classNames(`${prefixTree}-option-list`, {
[`${prefixTree}-option-list-block`]: !0
})
, $ = Boolean(n) && !i.size
, w = _isEmpty(o) || p && $
, P = x === strings$1.SEARCH_POSITION_DROPDOWN;
return React.createElement(TreeContext$1.Provider, {
value: {
loadData: l,
treeDisabled: u,
motion: h,
motionKeys: t,
motionType: r,
expandAction: g,
filterTreeNode: c,
keyEntities: e,
onNodeClick: this.onNodeClick,
onNodeDoubleClick: this.onNodeDoubleClick,
onNodeRightClick: _noop,
onNodeExpand: this.onNodeExpand,
onNodeSelect: this.onNodeSelect,
onNodeCheck: this.onNodeCheck,
renderTreeNode: this.renderTreeNode,
multiple: d,
showFilteredOnly: p,
isSearching: Boolean(n),
renderLabel: _,
renderFullLabel: E,
labelEllipsis: void 0 === y ? v : y
}
}, React.createElement("div", {
className: C
}, m, !m && c && P && this.renderInput(),
React.createElement("div", {
className: S,
role: "tree",
"aria-multiselectable": !!d,
style: b
}, w ? this.renderEmpty() : d ?
React.createElement(CheckboxGroup$1, {
value: Array.from("related" === T ? s : a)
}, this.renderNodeList()) : this.renderNodeList()), f))
}
,
this.state = {
inputTriggerFocus: !1,
isOpen: !1,
isFocus: !1,
rePosKey: key,
dropdownMinWidth: null,
inputValue: "",
keyEntities: {},
treeData: [],
flattenNodes: [],
cachedFlattenNodes: void 0,
selectedKeys: [],
checkedKeys: new Set,
halfCheckedKeys: new Set,
realCheckedKeys: new Set([]),
disabledKeys: new Set,
motionKeys: new Set([]),
motionType: "hide",
expandedKeys: new Set(e.expandedKeys),
filteredKeys: new Set,
filteredExpandedKeys: new Set,
filteredShownKeys: new Set,
prevProps: null,
isHovering: !1,
cachedKeyValuePairs: {},
loadedKeys: new Set,
loadingKeys: new Set
},
this.inputRef = React.createRef(),
this.tagInputRef = React.createRef(),
this.triggerRef = React.createRef(),
this.optionsRef = React.createRef(),
this.clickOutsideHandler = null,
this.foundation = new TreeSelectFoundation(this.adapter),
this.treeSelectID = Math.random().toString(36).slice(2),
this.onMotionEnd = () => {
this.adapter.rePositionDropdown()
}
}
static getDerivedStateFromProps(e, t) {
const {prevProps: r, rePosKey: n} = t
, {keyMaps: i} = e
, o = t => !r && t in e || r && !_isEqual(r[t], e[t]);
let s;
const a = e.onChangeWithObject;
let l = t.keyEntities || {}
, c = t.cachedKeyValuePairs || {};
const u = {
prevProps: e
}
, d = o("treeData")
, p = o("expandedKeys")
, h = Boolean(e.filterTreeNode && t.inputValue &&
t.inputValue.length);
if (d) {
s = e.treeData,
u.treeData = s;
const t = convertDataToEntities$1(s, i);
u.keyEntities = Object.assign({}, t.keyEntities),
l = u.keyEntities,
u.cachedKeyValuePairs = Object.assign({}, t.valueEntities),
c = u.cachedKeyValuePairs
}
s && e.motion && !_isEqual(Object.keys(u.keyEntities),
Object.keys(t.keyEntities)) && r && e.motion && (u.motionKeys = new Set([]),
u.motionType = null);
const f = d && e.expandAll;
if (h) {
let n;
if (s && (n = filterTreeData({
treeData: s,
inputValue: t.inputValue,
filterTreeNode: e.filterTreeNode,
filterProps: e.treeNodeFilterProp,
showFilteredOnly: e.showFilteredOnly,
keyEntities: u.keyEntities,
prevExpandedKeys: [...t.filteredExpandedKeys],
keyMaps: i
}),
u.flattenNodes = n.flattenNodes,
u.motionKeys = new Set([]),
u.filteredKeys = n.filteredKeys,
u.filteredShownKeys = n.filteredShownKeys,
u.filteredExpandedKeys = n.filteredExpandedKeys),
e.expandedKeys) {
if (u.filteredExpandedKeys =
calcExpandedKeys(e.expandedKeys, l, e.autoExpandParent || !r),
r && e.motion) {
const r = t ? t.filteredExpandedKeys : new Set([]);
if (!s) {
const n = calcMotionKeys(r, u.filteredExpandedKeys,
l);
let {motionKeys: i} = n;
const {motionType: o} = n;
e.showFilteredOnly && (i = i.filter((e =>
t.filteredShownKeys.has(e)))),
"hide" === o && (u.cachedFlattenNodes =
cloneDeep(t.flattenNodes)),
u.motionKeys = new Set(i),
u.motionType = o
}
}
u.flattenNodes = flattenTreeData(s || t.treeData,
u.filteredExpandedKeys || t.filteredExpandedKeys, i, e.showFilteredOnly &&
t.filteredShownKeys)
}
} else {
if (p || r && o("autoExpandParent")) {
if (u.expandedKeys = calcExpandedKeys(e.expandedKeys, l,
e.autoExpandParent || !r),
r && e.motion && !s) {
const {motionKeys: e, motionType: r} =
calcMotionKeys(t.expandedKeys, u.expandedKeys, l);
u.motionKeys = new Set(e),
u.motionType = r,
"hide" === r && (u.cachedFlattenNodes =
cloneDeep(t.flattenNodes))
}
} else
!r && (e.defaultExpandAll || e.expandAll) || f ?
u.expandedKeys = new Set(Object.keys(l)) : !r && e.defaultExpandedKeys ?
u.expandedKeys = calcExpandedKeys(e.defaultExpandedKeys, l) : !r &&
e.defaultValue ? u.expandedKeys =
calcExpandedKeysForValues(normalizeValue(e.defaultValue, a, i), l, e.multiple, c) :
!r && e.value && (u.expandedKeys =
calcExpandedKeysForValues(normalizeValue(e.value, a, i), l, e.multiple, c));
if (u.expandedKeys || delete u.expandedKeys,
s || u.expandedKeys) {
const e = flattenTreeData(s || t.treeData, u.expandedKeys
|| t.expandedKeys, i);
u.flattenNodes = e
}
}
const m = e.multiple;
if (m) {
let n;
if (o("value") ? n = findKeysForValues(normalizeValue(e.value,
a, i), c, m) : !r && e.defaultValue ? n =
findKeysForValues(normalizeValue(e.defaultValue, a, i), c, m) : s && (n = e.value ?
findKeysForValues(normalizeValue(e.value, a, i) || [], c, m) : updateKeys("related"
=== e.checkRelation ? t.checkedKeys : t.realCheckedKeys, l)),
n)
if ("unRelated" === e.checkRelation)
u.realCheckedKeys = new Set(n);
else if ("related" === e.checkRelation) {
const {checkedKeys: e, halfCheckedKeys: t} =
calcCheckedKeys(n, l);
u.checkedKeys = e,
u.halfCheckedKeys = t
}
} else
o("value") ? u.selectedKeys =
findKeysForValues(normalizeValue(e.value, a, i), c, m) : !r && e.defaultValue ?
u.selectedKeys = findKeysForValues(normalizeValue(e.defaultValue, a, i), c, m) : s
&& (e.value ? u.selectedKeys = findKeysForValues(normalizeValue(e.value, a, i) ||
"", c, m) : u.selectedKeys = updateKeys(t.selectedKeys, l));
return o("loadedKeys") && (u.loadedKeys = new Set(e.loadedKeys)),
(d || o("value")) && (u.rePosKey = n + 1),
s && e.disableStrictly && "related" === e.checkRelation &&
(u.disabledKeys = calcDisabledKeys(l, i)),
u
}
get adapter() {
var e = this;
const t = {
updateInputValue: e => {
this.setState({
inputValue: e
})
}
}
, r = {
registerClickOutsideHandler: e => {
this.adapter.unregisterClickOutsideHandler();
const t = t => {
const r = this.optionsRef && this.optionsRef.current
, n = this.triggerRef && this.triggerRef.current
, i = ReactDOM.findDOMNode(r)
, o = t.target
, s = t.composedPath && t.composedPath() || [o];
!i || i.contains(o) && i.contains(o.parentNode) || !n
|| n.contains(o) || s.includes(n) || s.includes(i) || e(t)
}
;
this.clickOutsideHandler = t,
document.addEventListener("mousedown", t, !1)
}
,
unregisterClickOutsideHandler: () => {
this.clickOutsideHandler &&
(document.removeEventListener("mousedown", this.clickOutsideHandler, !1),
this.clickOutsideHandler = null)
}
,
rePositionDropdown: () => {
let {rePosKey: e} = this.state;
e += 1,
this.setState({
rePosKey: e
})
}
}
, n = {
updateState: e => {
this.setState(Object.assign({}, e))
}
,
notifySelect: (e, t, r) => {
this.props.onSelect && this.props.onSelect(e, t, r)
}
,
notifySearch: (e, t, r) => {
this.props.onSearch && this.props.onSearch(e, t, r)
}
,
cacheFlattenNodes: e => {
this.setState({
cachedFlattenNodes: e ?
cloneDeep(this.state.flattenNodes) : void 0
})
}
,
notifyLoad: (e, t) => {
const {onLoad: r} = this.props;
_isFunction(r) && r(e, t)
}
,
notifyClear: e => {
this.props.onClear && this.props.onClear(e)
}
};
return
Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},
super.adapter), t), r), n), {
updateLoadKeys: (e, t) => {
this.setState((r => {
let {loadedKeys: n, loadingKeys: i} = r;
return this.foundation.handleNodeLoad(n, i, e, t)
}
))
}
,
updateState: e => {
this.setState(Object.assign({}, e))
}
,
openMenu: () => {
this.setState({
isOpen: !0
}, ( () => {
this.props.onVisibleChange(!0)
}
))
}
,
closeMenu: e => {
this.setState({
isOpen: !1
}, ( () => {
e && e(),
this.props.onVisibleChange(!1)
}
))
}
,
getTriggerWidth: () => {
const e = this.triggerRef.current;
return e && e.getBoundingClientRect().width
}
,
setOptionWrapperWidth: e => {
this.setState({
dropdownMinWidth: e
})
}
,
notifyChange: (e, t, r) => {
this.props.onChange && this.props.onChange(e, t, r)
}
,
notifyChangeWithObject: (e, t) => {
this.props.onChange && this.props.onChange(e, t)
}
,
notifyExpand: (e, t) => {
let {expanded: r, node: n} = t;
this.props.onExpand && this.props.onExpand([...e], {
expanded: r,
node: n
}),
r && this.props.loadData && this.onNodeLoad(n)
}
,
notifyFocus: function() {
e.props.onFocus && e.props.onFocus(...arguments)
},
notifyBlur: function() {
e.props.onBlur && e.props.onBlur(...arguments)
},
toggleHovering: e => {
this.setState({
isHovering: e
})
}
,
updateInputFocus: e => {
if (e) {
if (this.inputRef && this.inputRef.current) {
const {preventScroll: e} = this.props;
this.inputRef.current.focus({
preventScroll: e
})
}
this.tagInputRef && this.tagInputRef.current &&
this.tagInputRef.current.focus()
} else
this.inputRef && this.inputRef.current &&
this.inputRef.current.blur(),
this.tagInputRef && this.tagInputRef.current &&
this.tagInputRef.current.blur()
}
,
updateIsFocus: e => {
this.setState({
isFocus: e
})
}
})
}
componentDidMount() {
this.foundation.init()
}
componentWillUnmount() {
this.foundation.destroy()
}
render() {
const e = this.renderContent()
, {motion: t, zIndex: r, mouseLeaveDelay: n, mouseEnterDelay: i,
autoAdjustOverflow: o, stopPropagation: s, getPopupContainer: a, dropdownMargin: l,
position: c} = this.props
, {isOpen: u, rePosKey: d} = this.state
, p = this.renderSelection()
, h = c || "bottomLeft";
return React.createElement(Popover$1, {
stopPropagation: s,
getPopupContainer: a,
zIndex: r,
motion: t,
margin: l,
ref: this.optionsRef,
content: e,
visible: u,
trigger: "custom",
rePosKey: d,
position: h,
autoAdjustOverflow: o,
mouseLeaveDelay: n,
mouseEnterDelay: i,
onVisibleChange: this.handlePopoverVisibleChange,
afterClose: this.afterClose
}, p)
}
}
TreeSelect.contextType = ConfigContext$1,
TreeSelect.propTypes = {
"aria-describedby": PropTypes.string,
"aria-errormessage": PropTypes.string,
"aria-invalid": PropTypes.bool,
"aria-labelledby": PropTypes.string,
"aria-required": PropTypes.bool,
borderless: PropTypes.bool,
loadedKeys: PropTypes.arrayOf(PropTypes.string),
loadData: PropTypes.func,
onLoad: PropTypes.func,
arrowIcon: PropTypes.node,
clearIcon: PropTypes.node,
defaultOpen: PropTypes.bool,
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.array,
PropTypes.object]),
defaultExpandAll: PropTypes.bool,
defaultExpandedKeys: PropTypes.array,
expandAll: PropTypes.bool,
disabled: PropTypes.bool,
disableStrictly: PropTypes.bool,
filterTreeNode: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
multiple: PropTypes.bool,
searchPlaceholder: PropTypes.string,
searchAutoFocus: PropTypes.bool,
virtualize: PropTypes.object,
treeNodeFilterProp: PropTypes.string,
onChange: PropTypes.func,
onClear: PropTypes.func,
onSearch: PropTypes.func,
onSelect: PropTypes.func,
onExpand: PropTypes.func,
onChangeWithObject: PropTypes.bool,
onBlur: PropTypes.func,
onFocus: PropTypes.func,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number,
PropTypes.array, PropTypes.object]),
expandedKeys: PropTypes.array,
autoExpandParent: PropTypes.bool,
showClear: PropTypes.bool,
showSearchClear: PropTypes.bool,
autoAdjustOverflow: PropTypes.bool,
showFilteredOnly: PropTypes.bool,
showLine: PropTypes.bool,
motionExpand: PropTypes.bool,
emptyContent: PropTypes.node,
keyMaps: PropTypes.object,
leafOnly: PropTypes.bool,
treeData: PropTypes.arrayOf(PropTypes.shape({
key: PropTypes.string,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
label: PropTypes.any
})),
dropdownClassName: PropTypes.string,
dropdownStyle: PropTypes.object,
dropdownMargin: PropTypes.oneOfType([PropTypes.number,
PropTypes.object]),
motion: PropTypes.bool,
placeholder: PropTypes.string,
maxTagCount: PropTypes.number,
size: PropTypes.oneOf(strings$1.SIZE_SET),
className: PropTypes.string,
style: PropTypes.object,
treeNodeLabelProp: PropTypes.string,
suffix: PropTypes.node,
prefix: PropTypes.node,
insetLabel: PropTypes.node,
insetLabelId: PropTypes.string,
zIndex: PropTypes.number,
getPopupContainer: PropTypes.func,
dropdownMatchSelectWidth: PropTypes.bool,
validateStatus: PropTypes.oneOf(strings$1.STATUS),
mouseEnterDelay: PropTypes.number,
mouseLeaveDelay: PropTypes.number,
triggerRender: PropTypes.func,
stopPropagation: PropTypes.oneOfType([PropTypes.bool,
PropTypes.string]),
outerBottomSlot: PropTypes.node,
outerTopSlot: PropTypes.node,
onVisibleChange: PropTypes.func,
expandAction: PropTypes.oneOf(["click", "doubleClick", !1]),
searchPosition: PropTypes.oneOf([strings$1.SEARCH_POSITION_DROPDOWN,
strings$1.SEARCH_POSITION_TRIGGER]),
clickToHide: PropTypes.bool,
renderLabel: PropTypes.func,
renderFullLabel: PropTypes.func,
labelEllipsis: PropTypes.bool,
optionListStyle: PropTypes.object,
searchRender: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
renderSelectedItem: PropTypes.func,
checkRelation: PropTypes.string,
"aria-label": PropTypes.string,
showRestTagsPopover: PropTypes.bool,
restTagsPopoverProps: PropTypes.object,
preventScroll: PropTypes.bool,
clickTriggerToHide: PropTypes.bool,
autoMergeValue: PropTypes.bool
},
TreeSelect.defaultProps = {
borderless: !1,
searchPosition: strings$1.SEARCH_POSITION_DROPDOWN,
arrowIcon: React.createElement(IconChevronDown, null),
autoExpandParent: !1,
autoAdjustOverflow: !0,
stopPropagation: !0,
motion: !0,
motionExpand: !0,
expandAll: !1,
zIndex: numbers$a.DEFAULT_Z_INDEX,
disableStrictly: !1,
multiple: !1,
filterTreeNode: !1,
size: "default",
treeNodeFilterProp: "label",
onChangeWithObject: !1,
treeNodeLabelProp: "label",
dropdownMatchSelectWidth: !0,
defaultOpen: !1,
showSearchClear: !0,
showClear: !1,
onVisibleChange: _noop,
expandAction: !1,
clickToHide: !0,
searchAutoFocus: !1,
checkRelation: "related",
"aria-label": "TreeSelect",
showRestTagsPopover: !1,
restTagsPopoverProps: {},
clickTriggerToHide: !0,
autoMergeValue: !0
};
const TreeSelect$1 = TreeSelect
, PREFIX = `${BASE_CLASS_PREFIX$1}-upload`
, FILE_LIST_PIC = "picture"
, FILE_LIST_DEFAULT = "list"
, PROGRESS_COEFFICIENT = .95
, cssClasses = {
PREFIX: PREFIX,
LIST: `${PREFIX}-list`
}
, TRIGGER_AUTO$1 = "auto"
, TRIGGER_CUSTOM = "custom"
, strings = {
FILE_STATUS_UPLOADING: "uploading",
FILE_STATUS_SUCCESS: "success",
FILE_STATUS_UPLOAD_FAIL: "uploadFail",
FILE_STATUS_VALIDATING: "validating",
FILE_STATUS_VALID_FAIL: "validateFail",
FILE_STATUS_WAIT_UPLOAD: "wait",
FILE_LIST_PIC: FILE_LIST_PIC,
FILE_LIST_DEFAULT: FILE_LIST_DEFAULT,
LIST_TYPE: [FILE_LIST_PIC, FILE_LIST_DEFAULT],
imageTypes: ["image", "webp", "png", "svg", "gif", "jpg", "jpeg",
"bmp", "dpg"],
DRAG_AREA_DEFAULT: "default",
DRAG_AREA_LEGAL: "legal",
DRAG_AREA_ILLEGAL: "illegal",
TRIGGER_AUTO: TRIGGER_AUTO$1,
TRIGGER_CUSTOM: TRIGGER_CUSTOM,
UPLOAD_TRIGGER: [TRIGGER_AUTO$1, TRIGGER_CUSTOM],
VALIDATE_STATUS: VALIDATE_STATUS,
PROMPT_POSITION: ["left", "right", "bottom"]
}
, numbers = {
PROGRESS_COEFFICIENT: PROGRESS_COEFFICIENT
};
var __awaiter$1 = globalThis && globalThis.__awaiter || function(e, t, r,
n) {
return new (r || (r = Promise))((function(i, o) {
function s(e) {
try {
l(n.next(e))
} catch (e2) {
o(e2)
}
}
function a(e) {
try {
l(n.throw(e))
} catch (e2) {
o(e2)
}
}
function l(e) {
var t;
e.done ? i(e.value) : (t = e.value,
t instanceof r ? t : new r((function(e) {
e(t)
}
))).then(s, a)
}
l((n = n.apply(e, t || [])).next())
}
))
}
;
const byteKB = 1024
, byteMB = 1048576;
function getFileSize(e) {
return e < byteKB ? `${(e / byteKB).toFixed(2)}KB` : e >= byteKB && e <
byteMB ? `${(e / byteKB).toFixed(1)}KB` : e >= byteMB ? `${(e /
byteMB).toFixed(1)}MB` : void 0
}
function endsWith(e, t) {
return -1 !== e.indexOf(t, e.length - t.length)
}
function loopFiles(e) {
return __awaiter$1(this, void 0, void 0, (function*() {
return new Promise(( (t, r) => {
const n = e.createReader();
let i = [];
!function e() {
n.readEntries((r => {
const n = Array.prototype.slice.apply(r);
i = i.concat(n);
!n.length ? t(i) : e()
}
), r)
}()
}
))
}
))
}
function mapFileTree(e) {
return __awaiter$1(this, void 0, void 0, (function*() {
const t = []
, r = (e, n) => __awaiter$1(this, void 0, void 0, (function*() {
if (n = n || "",
e.path = n,
e.isFile)
t.push(new Promise(( (t, r) => {
e.file((r => {
e.fullPath && !r.webkitRelativePath &&
(Object.defineProperties(r, {
webkitRelativePath: {
writable: !0
}
}),
r.webkitRelativePath = e.fullPath.replace(/^\//,
""),
Object.defineProperties(r, {
webkitRelativePath: {
writable: !1
}
})),
t(r)
}
), r)
}
)));
else if (e.isDirectory) {
const t = yield loopFiles(e);
for (let i = 0; i < t.length; i++) {
const o = t[i];
yield r(o, `${n}${e.name}/`)
}
}
}
));
try {
const n = e.map((e => r(e.webkitGetAsEntry())));
yield Promise.all(n);
return yield Promise.all(t)
} catch (n) {
return []
}
}
))
}
var __awaiter = globalThis && globalThis.__awaiter || function(e, t, r, n)
{
return new (r || (r = Promise))((function(i, o) {
function s(e) {
try {
l(n.next(e))
} catch (e2) {
o(e2)
}
}
function a(e) {
try {
l(n.throw(e))
} catch (e2) {
o(e2)
}
}
function l(e) {
var t;
e.done ? i(e.value) : (t = e.value,
t instanceof r ? t : new r((function(e) {
e(t)
}
))).then(s, a)
}
l((n = n.apply(e, t || [])).next())
}
))
}
;
const {FILE_STATUS_UPLOADING: FILE_STATUS_UPLOADING, FILE_STATUS_SUCCESS:
FILE_STATUS_SUCCESS, FILE_STATUS_UPLOAD_FAIL: FILE_STATUS_UPLOAD_FAIL,
FILE_STATUS_VALID_FAIL: FILE_STATUS_VALID_FAIL, FILE_STATUS_WAIT_UPLOAD:
FILE_STATUS_WAIT_UPLOAD, DRAG_AREA_DEFAULT: DRAG_AREA_DEFAULT, DRAG_AREA_LEGAL:
DRAG_AREA_LEGAL, TRIGGER_AUTO: TRIGGER_AUTO} = strings;
class UploadFoundation extends BaseFoundation$1 {
constructor(e) {
super(Object.assign({}, e)),
this.destroyState = !1
}
init() {
const {disabled: e, addOnPasting: t} = this.getProps();
t && !e && this.bindPastingHandler()
}
destroy() {
const {disabled: e, addOnPasting: t} = this.getProps();
this.releaseMemory(),
e || this.unbindPastingHandler(),
this.destroyState = !0
}
getError(e) {
let {action: t, xhr: r, message: n, fileName: i} = e;
const o = r ? r.status : 0
, s = new Error(n || `cannot post ${i} to ${t}, xhr status: $
{o}'`);
return s.status = o,
s.method = "post",
s.url = t,
s
}
getBody(e) {
if (!e)
return;
const t = e.responseText || e.response;
if (!t)
return t;
try {
return JSON.parse(t)
} catch (r) {
return t
}
}
checkFileSize(e) {
const {size: t} = e
, {maxSize: r, minSize: n} = this.getProps();
let i = !1;
return (t > r * byteKB || t < n * byteKB) && (i = !0),
i
}
handleChange(e) {
const t = []
, {limit: r, transformFile: n, accept: i} = this.getProps()
, {fileList: o} = this.getStates();
let s = Array.from(e);
if (void 0 !== i && (s = s.filter((e => {
const r = this.checkFileFormat(i, e);
return r || t.push(e),
r
}
)),
0 !== t.length && this._adapter.notifyAcceptInvalid(t),
0 === s.length))
return;
s = s.map((e => (n && (e = n(e)),
e.uid || (e.uid = getUuidv4()),
this.checkFileSize(e) && (e._sizeInvalid = !0,
e.status = FILE_STATUS_VALID_FAIL,
this._adapter.notifySizeError(e, o)),
e)));
const a = o.length + s.length;
if (void 0 !== r && a > r) {
if (this._adapter.notifyExceed(s),
1 === r)
return s = s.slice(-1),
this._adapter.notifyFileSelect(s),
this._adapter.resetInput(),
void this.replaceFileList(s);
const e = r - o.length;
s = s.slice(0, e)
}
this._adapter.notifyFileSelect(s),
this._adapter.resetInput(),
this.addFilesToList(s)
}
handleReplaceChange(e) {
if (0 === e.length)
return;
const {transformFile: t, uploadTrigger: r, accept: n} =
this.getProps()
, {replaceIdx: i, fileList: o} = this.getStates();
let s = Array.from(e).pop();
if (void 0 !== n && !this.checkFileFormat(n, s))
return void this._adapter.notifyAcceptInvalid([s]);
t && (s = t(s)),
s.uid || (s.uid = getUuidv4()),
this.checkFileSize(s) && (s._sizeInvalid = !0,
s.status = FILE_STATUS_VALID_FAIL,
this._adapter.notifySizeError(s, o)),
this._adapter.notifyFileSelect([s]);
const a = this.buildFileItem(s, r)
, l = [...o];
l.splice(i, 1, a),
this._adapter.notifyChange({
currentFile: a,
fileList: l
}),
this._adapter.updateFileList(l, ( () => {
this._adapter.resetReplaceInput(),
a._sizeInvalid || this.upload(a)
}
))
}
buildFileItem(e, t) {
const {_sizeInvalid: r, status: n} = e;
try {
delete e._sizeInvalid,
delete e.status
} catch (o) {}
const i = {
status: n || (t === TRIGGER_AUTO ? FILE_STATUS_UPLOADING :
FILE_STATUS_WAIT_UPLOAD),
name: e.name,
size: getFileSize(e.size),
uid: e.uid,
percent: 0,
fileInstance: e,
url: this._createURL(e)
};
return r && (i._sizeInvalid = !0),
this.isImage(e) && (i.preview = !0),
i
}
replaceFileList(e) {
const {uploadTrigger: t} = this.getProps()
, r = e.map((e => this.buildFileItem(e, t)));
this._adapter.notifyChange({
fileList: r,
currentFile: r[0]
}),
this._adapter.updateFileList(r, ( () => {
t === TRIGGER_AUTO && this.startUpload(r)
}
))
}
addFilesToList(e) {
const t = this.getState("fileList").slice()
, {uploadTrigger: r} = this.getProps()
, n = e.map((e => this.buildFileItem(e, r)));
n.forEach((e => {
const r = t.findIndex((t => t.uid === e.uid));
-1 !== r ? t[r] = e : (t.push(e),
this._adapter.notifyChange({
fileList: t,
currentFile: e
}))
}
)),
this._adapter.updateFileList(t, ( () => {
r === TRIGGER_AUTO && this.startUpload(n)
}
))
}
insertFileToList(e, t) {
const {limit: r, transformFile: n, accept: i, uploadTrigger: o} =
this.getProps()
, {fileList: s} = this.getStates()
, a = [];
let l = Array.from(e);
if (void 0 !== i && (l = l.filter((e => {
const t = this.checkFileFormat(i, e);
return t || a.push(e),
t
}
)),
0 !== a.length && this._adapter.notifyAcceptInvalid(a),
0 === l.length))
return;
l = l.map((e => (e.uid || (e.uid = getUuidv4()),
this.checkFileSize(e) && (e._sizeInvalid = !0,
e.status = FILE_STATUS_VALID_FAIL,
this._adapter.notifySizeError(e, s)),
n && (e = n(e)),
e)));
const c = s.length + l.length;
if (void 0 !== r && c > r) {
if (1 === r)
return l = l.slice(-1),
this._adapter.notifyFileSelect(l),
this._adapter.resetInput(),
void this.replaceFileList(l);
const e = r - s.length;
l = l.slice(0, e),
this._adapter.notifyExceed(l)
}
const u = l.map((e => this.buildFileItem(e, o)))
, d = s.slice();
void 0 !== t ? d.splice(t, 0, ...u) : d.push(...u),
this._adapter.notifyFileSelect(l),
this._adapter.notifyChange({
fileList: d,
currentFile: null
}),
this._adapter.updateFileList(d, ( () => {
o === TRIGGER_AUTO && this.startUpload(u)
}
))
}
manualUpload() {
const e = this.getState("fileList").filter((e => e.status ===
FILE_STATUS_WAIT_UPLOAD));
this.startUpload(e)
}
startUpload(e) {
e.forEach((e => {
e._sizeInvalid || this.upload(e)
}
))
}
upload(e) {
const {beforeUpload: t} = this.getProps();
if (void 0 !== t) {
if ("function" == typeof t) {
const {fileList: t} = this.getStates()
, r = this._adapter.notifyBeforeUpload({
file: e,
fileList: t
});
switch (!0) {
case !0 === r:
this.post(e);
break;
case !1 === r:
{