mango-ui-v3/components/charting_library/bundles/context-menu-renderer.bbf3b...

1830 lines
61 KiB
JavaScript

(window.webpackJsonp = window.webpackJsonp || []).push([
['context-menu-renderer'],
{
'+EG+': function (e, t, n) {
'use strict';
n.d(t, 'a', function () {
return i;
}),
n.d(t, 'b', function () {
return s;
});
var o = n('mrSG'),
r = n('q1tI'),
i = (function (e) {
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
return (
Object(o.__extends)(t, e),
(t.prototype.shouldComponentUpdate = function () {
return !1;
}),
(t.prototype.render = function () {
return r.createElement('div', {
style: { position: 'fixed', zIndex: 150, left: 0, top: 0 },
ref: this.props.reference,
});
}),
t
);
})(r.Component),
s = r.createContext(null);
},
'/KDZ': function (e, t, n) {
'use strict';
n.d(t, 'a', function () {
return i;
});
var o = n('mrSG'),
r = n('q1tI'),
i = (function (e) {
function t(t) {
var n = e.call(this, t) || this;
return (
(n._handleChange = function () {
n.forceUpdate();
}),
(n.state = { query: window.matchMedia(n.props.rule) }),
n
);
}
return (
Object(o.__extends)(t, e),
(t.prototype.componentDidMount = function () {
this._subscribe(this.state.query);
}),
(t.prototype.componentDidUpdate = function (e, t) {
this.state.query !== t.query &&
(this._unsubscribe(t.query), this._subscribe(this.state.query));
}),
(t.prototype.componentWillUnmount = function () {
this._unsubscribe(this.state.query);
}),
(t.prototype.render = function () {
return this.props.children(this.state.query.matches);
}),
(t.getDerivedStateFromProps = function (e, t) {
return e.rule !== t.query.media
? { query: window.matchMedia(e.rule) }
: null;
}),
(t.prototype._subscribe = function (e) {
e.addListener(this._handleChange);
}),
(t.prototype._unsubscribe = function (e) {
e.removeListener(this._handleChange);
}),
t
);
})(r.PureComponent);
},
'20PO': function (e, t) {
e.exports =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.7 9l4.65-4.65-.7-.7L9 8.29 4.35 3.65l-.7.7L8.29 9l-4.64 4.65.7.7L9 9.71l4.65 4.64.7-.7L9.71 9z"/></svg>';
},
'38fQ': function (e, t, n) {
e.exports = { separator: 'separator-3SZSQm0_' };
},
'6KyJ': function (e, t, n) {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
n('mrSG').__exportStar(n('COH4'), t);
},
'8Rai': function (e, t, n) {
'use strict';
var o = n('q1tI'),
r = function (e, t) {
var n = void 0 === t ? {} : t,
o = n.bubbles,
r = void 0 !== o && o,
i = n.cancelable,
s = void 0 !== i && i,
a = n.detail,
c = void 0 === a ? null : a;
try {
return new window.CustomEvent(e, {
bubbles: r,
cancelable: s,
detail: c,
});
} catch (l) {
var u = document.createEvent('CustomEvent');
return u.initCustomEvent(e, r, s, c), u;
}
},
i = n('R5JZ');
function s(e) {
var t = e.click,
n = e.mouseDown,
s = e.touchEnd,
a = e.touchStart,
c = e.handler,
u = e.reference,
l = e.ownerDocument,
d = void 0 === l ? document : l,
p = Object(o.useRef)(null),
h = Object(o.useRef)(new r('timestamp').timeStamp);
return (
Object(o.useLayoutEffect)(
function () {
var e = { click: t, mouseDown: n, touchEnd: s, touchStart: a },
o = u ? u.current : p.current;
return Object(i.a)(h.current, o, c, d, e);
},
[t, n, s, a, c],
),
u || p
);
}
n.d(t, 'a', function () {
return s;
});
},
AiMB: function (e, t, n) {
'use strict';
n.d(t, 'a', function () {
return u;
}),
n.d(t, 'b', function () {
return l;
});
var o = n('mrSG'),
r = n('q1tI'),
i = n('i8i4'),
s = n('0waE'),
a = n('jAh7'),
c = n('+EG+'),
u = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (t._uuid = Object(s.guid)()), t;
}
return (
Object(o.__extends)(t, e),
(t.prototype.componentWillUnmount = function () {
this._manager().removeWindow(this._uuid);
}),
(t.prototype.render = function () {
var e = this._manager().ensureWindow(
this._uuid,
this.props.layerOptions,
);
return (
(e.style.top = this.props.top || ''),
(e.style.bottom = this.props.bottom || ''),
(e.style.left = this.props.left || ''),
(e.style.right = this.props.right || ''),
(e.style.pointerEvents = this.props.pointerEvents || null),
i.createPortal(
r.createElement(
l.Provider,
{ value: this },
this.props.children,
),
e,
)
);
}),
(t.prototype.moveToTop = function () {
this._manager().moveToTop(this._uuid);
}),
(t.prototype._manager = function () {
return null === this.context
? Object(a.getRootOverlapManager)()
: this.context;
}),
(t.contextType = c.b),
t
);
})(r.PureComponent),
l = r.createContext(null);
},
COH4: function (e, t, n) {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 });
var o,
r = n('mrSG'),
i = n('q1tI'),
s = n('TSYQ'),
a = n('K9GE'),
c = n('YZ9j');
n('O7m7'),
(function (e) {
(e[(e.Initial = 0)] = 'Initial'),
(e[(e.Appear = 1)] = 'Appear'),
(e[(e.Active = 2)] = 'Active');
})(o || (o = {}));
var u = (function (e) {
function t(t) {
var n = e.call(this, t) || this;
return (
(n._stateChangeTimeout = null), (n.state = { state: o.Initial }), n
);
}
return (
r.__extends(t, e),
(t.prototype.render = function () {
var e,
t = this.props,
n = t.className,
o = t.color,
r = void 0 === o ? 'black' : o,
a = s(c.item, (((e = {})[c[r]] = Boolean(r)), e));
return i.createElement(
'span',
{ className: s(c.loader, n, this._getStateClass()) },
i.createElement('span', { className: a }),
i.createElement('span', { className: a }),
i.createElement('span', { className: a }),
);
}),
(t.prototype.componentDidMount = function () {
var e = this;
this.setState({ state: o.Appear }),
(this._stateChangeTimeout = setTimeout(function () {
e.setState({ state: o.Active });
}, 2 * a.dur));
}),
(t.prototype.componentWillUnmount = function () {
this._stateChangeTimeout &&
(clearTimeout(this._stateChangeTimeout),
(this._stateChangeTimeout = null));
}),
(t.prototype._getStateClass = function () {
switch (this.state.state) {
case o.Initial:
return c['loader-initial'];
case o.Appear:
return c['loader-appear'];
default:
return '';
}
}),
t
);
})(i.PureComponent);
t.Loader = u;
},
Gpmm: function (e, t, n) {
e.exports = {
row: 'row-1Gn06tA2',
line: 'line-c_e_alAN',
hint: 'hint-18i4fysm',
};
},
Iivm: function (e, t, n) {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
n('mrSG').__exportStar(n('swCq'), t);
},
O7m7: function (e, t, n) {},
R5JZ: function (e, t, n) {
'use strict';
function o(e, t, n, o, r) {
function i(r) {
if (!(e > r.timeStamp)) {
var i = r.target;
void 0 !== n &&
null !== t &&
null !== i &&
i.ownerDocument === o &&
(t.contains(i) || n(r));
}
}
return (
r.click && o.addEventListener('click', i, !1),
r.mouseDown && o.addEventListener('mousedown', i, !1),
r.touchEnd && o.addEventListener('touchend', i, !1),
r.touchStart && o.addEventListener('touchstart', i, !1),
function () {
o.removeEventListener('click', i, !1),
o.removeEventListener('mousedown', i, !1),
o.removeEventListener('touchend', i, !1),
o.removeEventListener('touchstart', i, !1);
}
);
}
n.d(t, 'a', function () {
return o;
});
},
RgaO: function (e, t, n) {
'use strict';
n.d(t, 'a', function () {
return i;
});
var o = n('mrSG'),
r = n('8Rai');
function i(e) {
var t = e.children,
n = Object(o.__rest)(e, ['children']);
return t(Object(r.a)(n));
}
},
Sn4D: function (e, t, n) {
'use strict';
n.d(t, 'a', function () {
return m;
});
var o = n('q1tI'),
r = n.n(o),
i = n('Eyy1'),
s = n('TSYQ'),
a = n('x0D+'),
c = n('33OQ'),
u = n('AiMB'),
l = n('mkWe'),
d = n('qFKp'),
p = n('tWVy'),
h = n('sHQ4');
function m(e) {
var t = e.position,
n = e.onClose,
m = e.children,
f = e.className,
v = Object(i.ensureNotNull)(Object(o.useContext)(l.a)),
_ = Object(o.useState)(0),
b = _[0],
y = _[1],
w = Object(o.useRef)(null);
return (
Object(o.useEffect)(function () {
var e;
return (
null === (e = w.current) ||
void 0 === e ||
e.focus({ preventScroll: !0 }),
p.a.subscribe(v, n),
Object(c.setFixedBodyState)(!0),
d.CheckMobile.iOS() &&
Object(a.disableBodyScroll)(Object(i.ensureNotNull)(w.current)),
y(v.addDrawer()),
function () {
p.a.unsubscribe(v, n);
var e = v.removeDrawer();
d.CheckMobile.iOS() &&
Object(a.enableBodyScroll)(
Object(i.ensureNotNull)(w.current),
),
0 === e && Object(c.setFixedBodyState)(!1);
}
);
}, []),
r.a.createElement(
u.a,
null,
r.a.createElement(
'div',
{ className: s(h.wrap, h['position' + t]) },
b === v.currentDrawer &&
r.a.createElement('div', { className: h.backdrop, onClick: n }),
r.a.createElement(
'div',
{
className: s(h.drawer, h['position' + t], f),
ref: function (e) {
w.current = e;
},
tabIndex: -1,
},
m,
),
),
)
);
}
},
To8B: function (e, t) {
e.exports =
'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path fill="currentColor" d="M9.707 9l4.647-4.646-.707-.708L9 8.293 4.354 3.646l-.708.708L8.293 9l-4.647 4.646.708.708L9 9.707l4.646 4.647.708-.707L9.707 9z"/></svg>';
},
X64X: function (e, t, n) {
e.exports = {
loaderWrap: 'loaderWrap-18NjkayD',
loader: 'loader-Cgjcl0qz',
};
},
XXQ5: function (e, t, n) {
e.exports = {
item: 'item-3uG--HK9',
loading: 'loading-cNheEKQv',
disabled: 'disabled-3ilLPdQ4',
interactive: 'interactive-2W_Hkhdy',
hovered: 'hovered-D1oc5kww',
icon: 'icon-1Mb1FjSX',
label: 'label-3O4C0UM-',
title: 'title-22oXfKpQ',
nested: 'nested-1ZM4Mhrc',
shortcut: 'shortcut-3ZjqDeQg',
remove: 'remove-3gWfSy1e',
};
},
Xy1d: function (e, t) {
e.exports =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7 15l5 5L23 9"/></svg>';
},
Xzy5: function (e, t) {
e.exports =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M8 5l3.5 3.5L8 12"/></svg>';
},
YZ9j: function (e) {
e.exports = JSON.parse(
'{"loader":"loader-8x1ZxRwP","item":"item-2-89r_cd","tv-button-loader":"tv-button-loader-23vqS1uY","black":"black-20Ytsf0V","white":"white-1ucCcc2I","gray":"gray-XDhHSS-T","loader-initial":"loader-initial-1deQDeio","loader-appear":"loader-appear-2krFtMrd"}',
);
},
cbq4: function (e, t, n) {
'use strict';
n.r(t);
var o = n('mrSG'),
r = n('q1tI'),
i = n.n(r),
s = n('i8i4'),
a = n('DTHj'),
c = n('RgaO'),
u = n('ycI/'),
l = n('TSYQ'),
d = n('zRdu'),
p = n('Gpmm');
function h(e) {
return r.createElement(
'tr',
{ className: p.row },
r.createElement(
'td',
null,
r.createElement('div', { className: p.line }),
),
r.createElement(
'td',
null,
r.createElement('div', { className: p.line }),
e.hint
? r.createElement('div', { className: p.hint }, e.hint)
: null,
),
);
}
var m = n('ycgn'),
f = n('euMy'),
v = n('hn2c');
n('bf9a');
function _(e) {
var t = e.sourceCapabilities,
n = t && t.firesTouchEvents;
return void 0 === n && (n = Modernizr.touch), n;
}
var b = n('L/Ed'),
y = n('i/MG'),
w = n('qFKp'),
g = n('w+Rv'),
E = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (
(t._handleMouseOver = function (e) {
_(e.nativeEvent) ||
(t.props.onMouseOver && t.props.onMouseOver());
}),
(t._handleClickToolbox = function (e) {
e.stopPropagation(),
t.props.onClickToolbox && t.props.onClickToolbox();
}),
t
);
}
return (
Object(o.__extends)(t, e),
(t.prototype.render = function () {
var e = this.props,
t = e.hasSubItems,
n = e.shortcutHint,
o = e.hint;
return r.createElement(
r.Fragment,
null,
r.createElement(
'tr',
{
className: l(
m.item,
!this.props.noInteractive && m.interactive,
this.props.hovered && m.hovered,
this.props.disabled && m.disabled,
this.props.active && m.active,
),
onClick: this.props.onClick,
onMouseOver: this._handleMouseOver,
ref: this.props.reference,
'data-action-name': this.props.actionName,
},
r.createElement(
'td',
{ className: l(m.iconCell), 'data-icon-cell': !0 },
this._icon(),
),
r.createElement(
'td',
null,
r.createElement(
'div',
{ className: m.content },
r.createElement(
'span',
{
className: l(
m.label,
this.props.checked && m.checked,
),
'data-label': !0,
},
this.props.label,
),
this._toolbox(),
t &&
r.createElement('span', {
className: m.arrowIcon,
dangerouslySetInnerHTML: { __html: v },
'data-submenu-arrow': !0,
}),
!t &&
n &&
!w.CheckMobile.any() &&
r.createElement(g.a, { text: n }),
!t && !n && o && r.createElement(g.a, { text: o }),
),
),
),
r.createElement(
'tr',
{ className: m.subMenu },
r.createElement('td', null, this.props.children),
),
);
}),
(t.prototype._icon = function () {
if (this.props.checkable) {
if (this.props.checked) {
var e = !this.props.icon && !this.props.iconChecked,
t = this.props.iconChecked || this.props.icon || f;
return r.createElement('span', {
className: l(m.icon, e && m.checkmark),
dangerouslySetInnerHTML: { __html: t },
'data-icon-checkmark': e,
});
}
return this.props.icon
? r.createElement('span', {
className: m.icon,
dangerouslySetInnerHTML: { __html: this.props.icon },
})
: r.createElement('span', { className: m.icon });
}
return this.props.icon
? r.createElement('span', {
className: m.icon,
dangerouslySetInnerHTML: { __html: this.props.icon },
})
: null;
}),
(t.prototype._toolbox = function () {
return this.props.toolbox
? r.createElement(
'span',
{
className: l(
m.toolbox,
this.props.showToolboxOnHover && m.showToolboxOnHover,
),
onClick: this._handleClickToolbox,
'data-toolbox': !0,
},
this._renderToolboxContent(),
)
: null;
}),
(t.prototype._renderToolboxContent = function () {
if (this.props.toolbox)
switch (this.props.toolbox.type) {
case b.ToolboxType.Delete:
return r.createElement(y.a, {
onClick: this.props.toolbox.action,
});
}
return null;
}),
t
);
})(r.PureComponent),
S = n('tWVy'),
O = n('PC8g'),
C = n('Ialn');
var x = n('dxYz'),
k = n('Eyy1'),
M = (function (e) {
function t(t) {
var n = e.call(this, t) || this;
return (
(n._itemRef = null),
(n._menuElementRef = r.createRef()),
(n._menuRef = null),
(n._handleClick = function (e) {
e.isDefaultPrevented() ||
n.state.disabled ||
(n._hasSubItems()
? n._showSubMenu()
: (n.state.doNotCloseOnClick || Object(S.b)(),
n.props.action.execute(),
n._trackEvent()));
}),
(n._handleClickToolbox = function () {
Object(S.b)();
}),
(n._handleItemMouseOver = function () {
n._showSubMenu(), n._setCurrentContextValue();
}),
(n._handleMenuMouseOver = function () {
n._setCurrentContextValue();
}),
(n._showSubMenu = function () {
n.props.onShowSubMenu(n.props.action);
}),
(n._calcSubMenuPos = function (e) {
return (function (e, t, n) {
if ((void 0 === n && (n = { x: 0, y: 10 }), t)) {
var o = t.getBoundingClientRect(),
r = o.left,
i = o.right,
s = o.top,
a = document.documentElement.clientWidth,
c = { x: r - e, y: s },
u = { x: i, y: s };
return Object(C.isRtl)()
? r <= e
? u
: c
: a - i >= e
? u
: c;
}
return n;
})(e, n._itemRef);
}),
(n._updateState = function (e) {
n.setState(e.getState());
}),
(n._setItemRef = function (e) {
n._itemRef = e;
}),
(n._handleMenuRef = function (e) {
n._menuRef = e;
}),
(n.state = Object(o.__assign)({}, n.props.action.getState())),
n
);
}
return (
Object(o.__extends)(t, e),
(t.prototype.componentDidMount = function () {
var e,
t = this;
this.props.action.onUpdate().subscribe(this, this._updateState),
this.state.subItems.length &&
(this._unsubscribe =
null === (e = this.context) || void 0 === e
? void 0
: e.registerSubmenu(this.props.action.id, function (e) {
return (
Object(k.ensureNotNull)(t._itemRef).contains(e) ||
(null !== t._menuElementRef.current &&
t._menuElementRef.current.contains(e))
);
}));
}),
(t.prototype.componentDidUpdate = function (e, t) {
t.subItems !== this.state.subItems &&
null !== this._menuRef &&
this._menuRef.update();
}),
(t.prototype.componentWillUnmount = function () {
this.props.action.onUpdate().unsubscribe(this, this._updateState),
this._unsubscribe && this._unsubscribe();
}),
(t.prototype.render = function () {
var e,
t = (
null === (e = this.context) || void 0 === e
? void 0
: e.current
)
? this.context.current === this.props.action.id
: this.props.isSubMenuOpened;
return r.createElement(
E,
Object(o.__assign)(
{
reference: this._setItemRef,
onClick: this._handleClick,
onClickToolbox: this._handleClickToolbox,
onMouseOver: this._handleItemMouseOver,
hovered: t,
hasSubItems: this._hasSubItems(),
actionName: this.state.name,
},
this.state,
),
r.createElement(K, {
isOpened: t,
items: this.state.subItems,
position: this._calcSubMenuPos,
menuStatName: this.props.menuStatName,
parentStatName: this._getStatName(),
menuElementReference: this._menuElementRef,
onMouseOver: this.state.subItems.length
? this._handleMenuMouseOver
: void 0,
ref: this._handleMenuRef,
}),
);
}),
(t.prototype._setCurrentContextValue = function () {
var e;
this.state.subItems.length &&
(null === (e = this.context) ||
void 0 === e ||
e.setCurrent(this.props.action.id));
}),
(t.prototype._hasSubItems = function () {
return this.state.subItems.length > 0;
}),
(t.prototype._trackEvent = function () {
var e = this._getStatName();
Object(O.trackEvent)(
'ContextMenuClick',
this.props.menuStatName || '',
e,
);
}),
(t.prototype._getStatName = function () {
return [this.props.parentStatName, this.state.statName]
.filter(function (e) {
return Boolean(e);
})
.join('.');
}),
(t.contextType = x.a),
t
);
})(r.PureComponent),
N = n('6KyJ'),
I = n('X64X');
function j(e) {
return r.createElement(E, {
label: r.createElement(
'div',
{ className: I.loaderWrap },
r.createElement(N.Loader, { className: I.loader, color: 'gray' }),
),
noInteractive: !0,
onMouseOver: e.onMouseOver,
});
}
function D(e) {
return r.createElement(E, {
label: e.label,
noInteractive: !0,
disabled: !0,
onMouseOver: e.onMouseOver,
});
}
var T = n('4O8T'),
L = n.n(T),
R = (function (e) {
function t(t) {
var n = e.call(this, t) || this;
return (
(n._loadEmitter = new L.a()),
(n._onDone = function () {
n.setState({ loaded: !0, failed: !1 }, n._updateMenu);
}),
(n._onFail = function (e) {
n.setState({ failed: !0, error: e }, n._updateMenu);
}),
(n._updateMenu = function () {
n.props.menu && n.props.menu.update();
}),
(n._handleMouseOver = function () {
n.props.onShowSubMenu(n.props.action);
}),
(n.state = {
loaded: n.props.action.isLoaded(),
failed: !1,
error: '',
}),
n
);
}
return (
Object(o.__extends)(t, e),
(t.prototype.componentDidMount = function () {
this._loadEmitter.on('done', this._onDone),
this._loadEmitter.on('fail', this._onFail),
this._load();
}),
(t.prototype.componentWillUnmount = function () {
this._loadEmitter.removeEvent('done'),
this._loadEmitter.removeEvent('fail');
}),
(t.prototype.render = function () {
return this.state.failed
? r.createElement(D, {
label: this.state.error,
onMouseOver: this._handleMouseOver,
})
: this.state.loaded
? r.createElement(M, Object(o.__assign)({}, this.props))
: r.createElement(j, { onMouseOver: this._handleMouseOver });
}),
(t.prototype._load = function () {
var e = this;
this.props.action
.loadOptions()
.then(function () {
e._loadEmitter.emit('done');
})
.catch(function (t) {
e._loadEmitter.emit('fail', t);
});
}),
t
);
})(r.PureComponent),
B = n('PN6A'),
P = (function (e) {
function t(t) {
var n = e.call(this, t) || this;
return (
(n._handleShowSubMenu = function (e) {
var t = e.getState();
n.setState({ showSubMenuOf: t.subItems.length ? e : void 0 });
}),
(n.state = {}),
n
);
}
return (
Object(o.__extends)(t, e),
(t.prototype.render = function () {
var e = this;
return r.createElement(
'table',
null,
r.createElement(
'tbody',
null,
this.props.items.map(function (t) {
return e._item(t);
}),
),
);
}),
(t.getDerivedStateFromProps = function (e, t) {
return !e.parentIsOpened && t.showSubMenuOf
? { showSubMenuOf: void 0 }
: null;
}),
(t.prototype._item = function (e) {
var t = this;
switch (e.type) {
case d.a.Separator:
return r.createElement(h, { key: e.id, hint: e.getHint() });
case d.a.Action:
return r.createElement(M, {
key: e.id,
action: e,
onShowSubMenu: this._handleShowSubMenu,
isSubMenuOpened: this.state.showSubMenuOf === e,
menuStatName: this.props.menuStatName,
parentStatName: this.props.parentStatName,
});
case d.a.ActionAsync:
return r.createElement(
B.a.Consumer,
{ key: e.id },
function (n) {
return r.createElement(R, {
action: e,
onShowSubMenu: t._handleShowSubMenu,
isSubMenuOpened: t.state.showSubMenuOf === e,
menuStatName: t.props.menuStatName,
parentStatName: t.props.parentStatName,
menu: n,
});
},
);
default:
return null;
}
}),
t
);
})(r.PureComponent),
A = n('mkWe'),
W = n('/KDZ'),
q = n('38fQ');
function G(e) {
return i.a.createElement('li', { className: q.separator });
}
var H = n('l4ku'),
X = n('Sn4D');
function Q(e) {
var t = e.action,
n = e.isLoading,
s = Object(r.useState)(t.getState()),
a = s[0],
c = s[1],
u = Object(r.useState)(!1),
l = u[0],
d = u[1],
p = function () {
return c(t.getState());
},
h = !!a.subItems.length,
m = h && l;
return (
Object(r.useEffect)(
function () {
n || c(t.getState());
},
[n],
),
Object(r.useEffect)(function () {
return (
t.onUpdate().subscribe(null, p),
function () {
t.onUpdate().unsubscribe(null, p);
}
);
}, []),
i.a.createElement(
H.a,
Object(o.__assign)({}, a, {
onClick: function (e) {
if (a.disabled || e.defaultPrevented) return;
if (h) return void d(!0);
a.doNotCloseOnClick || Object(S.b)();
t.execute();
},
isLoading: n,
isHovered: m,
}),
m &&
i.a.createElement(
X.a,
{ onClose: f, position: 'Bottom' },
i.a.createElement(z, {
items: a.subItems,
parentAction: t,
closeNested: f,
}),
),
)
);
function f(e) {
e && e.preventDefault(), d(!1);
}
}
function U(e) {
var t = e.action,
n = Object(r.useState)(t.isLoaded()),
o = n[0],
s = n[1],
a = Object(r.useState)(!1),
c = a[0],
u = a[1],
l = (function () {
var e = Object(r.useRef)(!1);
return (
Object(r.useEffect)(function () {
return (
(e.current = !0),
function () {
e.current = !1;
}
);
}, []),
e
);
})();
return (
Object(r.useEffect)(function () {
t.loadOptions()
.then(function () {
l.current && (s(!0), u(!1));
})
.catch(function () {
l.current && u(!0);
});
}, []),
i.a.createElement(Q, { isLoading: !o || c, action: t })
);
}
var Y = n('fwrW');
function z(e) {
var t = e.items,
n = e.parentAction,
o = e.closeNested;
return i.a.createElement(
'ul',
null,
n &&
i.a.createElement(
i.a.Fragment,
null,
i.a.createElement(H.a, {
label: n.getState().label,
isTitle: !0,
active: !1,
disabled: !1,
subItems: [],
checkable: !1,
checked: !1,
doNotCloseOnClick: !1,
icon: Y,
onClick: o,
}),
i.a.createElement(G, null),
),
t.map(function (e) {
switch (e.type) {
case d.a.Action:
return i.a.createElement(Q, { key: e.id, action: e });
case d.a.Separator:
return i.a.createElement(G, { key: e.id });
case d.a.ActionAsync:
return i.a.createElement(U, { key: e.id, action: e });
default:
return null;
}
}),
);
}
var F = n('t3rk'),
K = (function (e) {
function t(t) {
var n = e.call(this, t) || this;
return (
(n._menuRef = r.createRef()),
(n._handleClose = function () {
n.props.onClose && n.props.onClose();
}),
(n._handleOutsideClickClose = function (e) {
var t = n.props,
o = t.doNotCloseOn,
r = t.onClose;
!r || (void 0 !== o && o.contains(e.target)) || r();
}),
(n.state = {}),
n
);
}
return (
Object(o.__extends)(t, e),
(t.prototype.render = function () {
var e = this,
t = this.props,
n = t.isOpened,
i = (t.onClose, t.items),
s = (t.doNotCloseOn, t.menuStatName),
d = t.parentStatName,
p = Object(o.__rest)(t, [
'isOpened',
'onClose',
'items',
'doNotCloseOn',
'menuStatName',
'parentStatName',
]);
return n
? r.createElement(
r.Fragment,
null,
r.createElement(u.a, {
keyCode: 27,
eventType: 'keyup',
handler: this._handleClose,
}),
r.createElement(
A.b,
null,
r.createElement(
W.a,
{ rule: 'screen and (max-width: 419px)' },
function (t) {
return t
? r.createElement(
X.a,
{ onClose: e._handleClose, position: 'Bottom' },
r.createElement(z, { items: i }),
)
: r.createElement(
c.a,
{
handler: e._handleOutsideClickClose,
mouseDown: !0,
touchStart: !0,
reference: e.props.menuElementReference,
},
function (t) {
return r.createElement(
a.a,
Object(o.__assign)({}, p, {
reference: t,
isOpened: e.props.isOpened,
className: l(F.menu, 'context-menu'),
onClose: e._handleClose,
noMomentumBasedScroll: !0,
ref: e._menuRef,
}),
r.createElement(P, {
items: i,
menuStatName: s,
parentStatName: d,
parentIsOpened: n,
}),
);
},
);
},
),
),
)
: null;
}),
(t.prototype.update = function () {
this._menuRef.current && this._menuRef.current.update();
}),
t
);
})(r.PureComponent);
n.d(t, 'ContextMenuRenderer', function () {
return Z;
});
var Z = (function () {
function e(e, t, n, o) {
(this._root = null),
(this._isShown = !1),
(this._props = {
isOpened: !1,
items: e,
position: { x: 0, y: 0 },
menuStatName: t.statName,
}),
(this._onDestroy = n),
(this._onShow = o);
}
return (
(e.prototype.show = function (e, t, n) {
var r = this;
this._onShow && this._onShow(),
(this._isShown = !0),
this._render(
Object(o.__assign)(Object(o.__assign)({}, this._props), {
position: function (t, o) {
return (
'function' == typeof e && (e = e(t, o)),
e.touches &&
e.touches.length > 0 &&
(e = {
clientX: e.touches[0].clientX,
clientY: e.touches[0].clientY,
}),
{
x: !n && Object(C.isRtl)() ? e.clientX - t : e.clientX,
y: e.clientY,
overrideHeight: e.overrideHeight,
}
);
},
isOpened: !0,
onClose: function () {
r.hide(), r.destroy();
},
doNotCloseOn: t,
}),
);
}),
(e.prototype.hide = function () {
(this._isShown = !1),
this._render(
Object(o.__assign)(Object(o.__assign)({}, this._props), {
isOpened: !1,
}),
);
}),
(e.prototype.isShown = function () {
return this._isShown;
}),
(e.prototype.destroy = function () {
(this._isShown = !1),
this._root &&
(s.unmountComponentAtNode(this._root),
document.body.removeChild(this._root),
(this._root = null)),
this._onDestroy && this._onDestroy();
}),
(e.prototype._render = function (e) {
this._root ||
((this._root = document.createElement('span')),
(this._root.className = 'context-menu-wrapper'),
document.body.appendChild(this._root)),
s.render(r.createElement(K, e), this._root);
}),
e
);
})();
},
euMy: function (e, t) {
e.exports =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 14" width="18" height="14"><path fill="currentColor" d="M6 11.17l-4.17-4.17-1.42 1.41 5.59 5.59 12-12-1.41-1.41-10.59 10.58z"/></svg>';
},
fwrW: function (e, t) {
e.exports =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16.5 20L11 14.5 16.5 9"/></svg>';
},
hn2c: function (e, t) {
e.exports =
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 16" width="10" height="16"><path d="M.6 1.4l1.4-1.4 8 8-8 8-1.4-1.4 6.389-6.532-6.389-6.668z"/></svg>';
},
'i/MG': function (e, t, n) {
'use strict';
n.d(t, 'a', function () {
return l;
});
var o = n('mrSG'),
r = (n('YFKU'), n('q1tI')),
i = n('TSYQ'),
s = n('Iivm'),
a = n('To8B'),
c = n('kXJy'),
u = { remove: window.t('Remove') };
function l(e) {
var t = e.className,
n = e.isActive,
l = e.onClick,
d = e.title,
p = e.hidden,
h = e['data-name'],
m = void 0 === h ? 'remove-button' : h,
f = Object(o.__rest)(e, [
'className',
'isActive',
'onClick',
'title',
'hidden',
'data-name',
]);
return r.createElement(
s.Icon,
Object(o.__assign)({}, f, {
'data-name': m,
className: i(
c.button,
'apply-common-tooltip',
n && c.active,
p && c.hidden,
t,
),
icon: a,
onClick: l,
title: d || u.remove,
}),
);
}
},
jAh7: function (e, t, n) {
'use strict';
n.r(t),
n.d(t, 'OverlapManager', function () {
return i;
}),
n.d(t, 'getRootOverlapManager', function () {
return a;
});
var o = n('Eyy1'),
r = (function () {
function e() {
this._storage = [];
}
return (
(e.prototype.add = function (e) {
this._storage.push(e);
}),
(e.prototype.remove = function (e) {
this._storage = this._storage.filter(function (t) {
return e !== t;
});
}),
(e.prototype.has = function (e) {
return this._storage.includes(e);
}),
(e.prototype.getItems = function () {
return this._storage;
}),
e
);
})(),
i = (function () {
function e(e) {
void 0 === e && (e = document),
(this._storage = new r()),
(this._windows = new Map()),
(this._index = 0),
(this._document = e),
(this._container = e.createDocumentFragment());
}
return (
(e.prototype.setContainer = function (e) {
var t = this._container,
n = null === e ? this._document.createDocumentFragment() : e;
!(function (e, t) {
Array.from(e.childNodes).forEach(function (e) {
e.nodeType === Node.ELEMENT_NODE && t.appendChild(e);
});
})(t, n),
(this._container = n);
}),
(e.prototype.registerWindow = function (e) {
this._storage.has(e) || this._storage.add(e);
}),
(e.prototype.ensureWindow = function (e, t) {
void 0 === t && (t = { position: 'fixed', direction: 'normal' });
var n = this._windows.get(e);
if (void 0 !== n) return n;
this.registerWindow(e);
var o = this._document.createElement('div');
if (
((o.style.position = t.position),
(o.style.zIndex = this._index.toString()),
(o.dataset.id = e),
void 0 !== t.index)
) {
var r = this._container.childNodes.length;
if (t.index >= r) this._container.appendChild(o);
else if (t.index <= 0)
this._container.insertBefore(o, this._container.firstChild);
else {
var i = this._container.childNodes[t.index];
this._container.insertBefore(o, i);
}
} else
'reverse' === t.direction
? this._container.insertBefore(o, this._container.firstChild)
: this._container.appendChild(o);
return this._windows.set(e, o), ++this._index, o;
}),
(e.prototype.unregisterWindow = function (e) {
this._storage.remove(e);
var t = this._windows.get(e);
void 0 !== t &&
(null !== t.parentElement && t.parentElement.removeChild(t),
this._windows.delete(e));
}),
(e.prototype.getZindex = function (e) {
var t = this.ensureWindow(e);
return parseInt(t.style.zIndex || '0');
}),
(e.prototype.moveToTop = function (e) {
this.getZindex(e) !== this._index &&
(this.ensureWindow(e).style.zIndex = (++this
._index).toString());
}),
(e.prototype.removeWindow = function (e) {
this.unregisterWindow(e);
}),
e
);
})(),
s = new WeakMap();
function a(e) {
void 0 === e && (e = document);
var t = e.getElementById('overlap-manager-root');
if (null !== t) return Object(o.ensureDefined)(s.get(t));
var n = new i(e),
r = (function (e) {
var t = e.createElement('div');
return (
(t.style.position = 'absolute'),
(t.style.zIndex = (150).toString()),
(t.style.top = '0px'),
(t.style.left = '0px'),
(t.id = 'overlap-manager-root'),
t
);
})(e);
return s.set(r, n), n.setContainer(r), e.body.appendChild(r), n;
}
},
kXJy: function (e, t, n) {
e.exports = {
button: 'button-1scLo53s',
active: 'active-2T0ofIIp',
hidden: 'hidden-2GRQzIQ1',
};
},
l4ku: function (e, t, n) {
'use strict';
n.d(t, 'a', function () {
return h;
});
var o = n('q1tI'),
r = n.n(o),
i = n('TSYQ'),
s = n('w+Rv'),
a = n('Iivm'),
c = n('6KyJ'),
u = n('Xy1d'),
l = n('Xzy5'),
d = n('20PO'),
p = n('XXQ5');
function h(e) {
var t = e.isTitle,
n = e.isLoading,
o = e.isHovered,
h = e.active,
m = e.checkable,
f = e.disabled,
v = e.checked,
_ = e.icon,
b = e.iconChecked,
y = e.hint,
w = e.subItems,
g = e.label,
E = e.onClick,
S = e.children,
O = e.toolbox,
C = !!w.length;
return n
? r.a.createElement(
'li',
{ className: i(p.item, p.loading) },
r.a.createElement(c.Loader, { color: 'gray' }),
)
: r.a.createElement(
'li',
{
className: i(
p.item,
p.interactive,
t && p.title,
f && p.disabled,
o && p.hovered,
h && p.active,
),
onClick: E,
},
r.a.createElement(a.Icon, {
className: i(p.icon),
icon: (function () {
if (m && v) return b || _ || u;
return _;
})(),
}),
r.a.createElement('span', { className: p.label }, g),
!!O &&
r.a.createElement(a.Icon, {
onClick: function () {
O && O.action();
},
className: p.remove,
icon: d,
}),
!C &&
y &&
r.a.createElement(s.a, { className: p.shortcut, text: y }),
C && r.a.createElement(a.Icon, { className: p.nested, icon: l }),
S,
);
}
},
mkWe: function (e, t, n) {
'use strict';
n.d(t, 'b', function () {
return s;
}),
n.d(t, 'a', function () {
return a;
});
var o = n('mrSG'),
r = n('q1tI'),
i = n.n(r),
s = (function (e) {
function t(t) {
var n = e.call(this, t) || this;
return (
(n._addDrawer = function () {
var e = n.state.currentDrawer + 1;
return n.setState({ currentDrawer: e }), e;
}),
(n._removeDrawer = function () {
var e = n.state.currentDrawer - 1;
return n.setState({ currentDrawer: e }), e;
}),
(n.state = { currentDrawer: 0 }),
n
);
}
return (
Object(o.__extends)(t, e),
(t.prototype.render = function () {
return i.a.createElement(
a.Provider,
{
value: {
addDrawer: this._addDrawer,
removeDrawer: this._removeDrawer,
currentDrawer: this.state.currentDrawer,
},
},
this.props.children,
);
}),
t
);
})(i.a.PureComponent),
a = i.a.createContext(null);
},
sHQ4: function (e, t, n) {
e.exports = {
wrap: 'wrap-3vvdSnDX',
backdrop: 'backdrop-1knaw_yl',
positionBottom: 'positionBottom-3zJf6Byh',
drawer: 'drawer-1_nJUEiM',
positionLeft: 'positionLeft-2wxVhi9G',
};
},
swCq: function (e, t, n) {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 });
var o = n('mrSG'),
r = n('q1tI');
t.Icon = r.forwardRef(function (e, t) {
var n = e.icon,
i = void 0 === n ? '' : n,
s = o.__rest(e, ['icon']);
return r.createElement(
'span',
o.__assign({}, s, { ref: t, dangerouslySetInnerHTML: { __html: i } }),
);
});
},
t3rk: function (e, t, n) {
e.exports = { menu: 'menu-1y0eDKzl' };
},
'w+Rv': function (e, t, n) {
'use strict';
n.d(t, 'a', function () {
return a;
});
var o = n('q1tI'),
r = n('TSYQ'),
i = n.n(r),
s = n('ycgn');
function a(e) {
var t = e.text,
n = void 0 === t ? '' : t,
r = e.className;
return o.createElement('span', { className: i()(s.shortcut, r) }, n);
}
},
'x0D+': function (e, t, n) {
var o, r, i;
(r = [t]),
void 0 ===
(i =
'function' ==
typeof (o = function (e) {
'use strict';
function t(e) {
if (Array.isArray(e)) {
for (var t = 0, n = Array(e.length); t < e.length; t++)
n[t] = e[t];
return n;
}
return Array.from(e);
}
Object.defineProperty(e, '__esModule', { value: !0 });
var n = !1;
if ('undefined' != typeof window) {
var o = {
get passive() {
n = !0;
},
};
window.addEventListener('testPassive', null, o),
window.removeEventListener('testPassive', null, o);
}
var r =
'undefined' != typeof window &&
window.navigator &&
window.navigator.platform &&
/iP(ad|hone|od)/.test(window.navigator.platform),
i = [],
s = !1,
a = -1,
c = void 0,
u = void 0,
l = function (e) {
return i.some(function (t) {
return !(
!t.options.allowTouchMove || !t.options.allowTouchMove(e)
);
});
},
d = function (e) {
var t = e || window.event;
return (
!!l(t.target) ||
1 < t.touches.length ||
(t.preventDefault && t.preventDefault(), !1)
);
},
p = function () {
setTimeout(function () {
void 0 !== u &&
((document.body.style.paddingRight = u), (u = void 0)),
void 0 !== c &&
((document.body.style.overflow = c), (c = void 0));
});
};
(e.disableBodyScroll = function (e, o) {
if (r) {
if (!e)
return void console.error(
'disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.',
);
if (
e &&
!i.some(function (t) {
return t.targetElement === e;
})
) {
var p = { targetElement: e, options: o || {} };
(i = [].concat(t(i), [p])),
(e.ontouchstart = function (e) {
1 === e.targetTouches.length &&
(a = e.targetTouches[0].clientY);
}),
(e.ontouchmove = function (t) {
var n, o, r, i;
1 === t.targetTouches.length &&
((o = e),
(i = (n = t).targetTouches[0].clientY - a),
!l(n.target) &&
((o && 0 === o.scrollTop && 0 < i) ||
((r = o) &&
r.scrollHeight - r.scrollTop <= r.clientHeight &&
i < 0)
? d(n)
: n.stopPropagation()));
}),
s ||
(document.addEventListener(
'touchmove',
d,
n ? { passive: !1 } : void 0,
),
(s = !0));
}
} else {
(m = o),
setTimeout(function () {
if (void 0 === u) {
var e = !!m && !0 === m.reserveScrollBarGap,
t =
window.innerWidth -
document.documentElement.clientWidth;
e &&
0 < t &&
((u = document.body.style.paddingRight),
(document.body.style.paddingRight = t + 'px'));
}
void 0 === c &&
((c = document.body.style.overflow),
(document.body.style.overflow = 'hidden'));
});
var h = { targetElement: e, options: o || {} };
i = [].concat(t(i), [h]);
}
var m;
}),
(e.clearAllBodyScrollLocks = function () {
r
? (i.forEach(function (e) {
(e.targetElement.ontouchstart = null),
(e.targetElement.ontouchmove = null);
}),
s &&
(document.removeEventListener(
'touchmove',
d,
n ? { passive: !1 } : void 0,
),
(s = !1)),
(i = []),
(a = -1))
: (p(), (i = []));
}),
(e.enableBodyScroll = function (e) {
if (r) {
if (!e)
return void console.error(
'enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.',
);
(e.ontouchstart = null),
(e.ontouchmove = null),
(i = i.filter(function (t) {
return t.targetElement !== e;
})),
s &&
0 === i.length &&
(document.removeEventListener(
'touchmove',
d,
n ? { passive: !1 } : void 0,
),
(s = !1));
} else
1 === i.length && i[0].targetElement === e
? (p(), (i = []))
: (i = i.filter(function (t) {
return t.targetElement !== e;
}));
});
})
? o.apply(t, r)
: o) || (e.exports = i);
},
'ycI/': function (e, t, n) {
'use strict';
n.d(t, 'a', function () {
return i;
});
var o = n('mrSG'),
r = n('q1tI'),
i = (function (e) {
function t() {
var t = (null !== e && e.apply(this, arguments)) || this;
return (
(t._handleKeyDown = function (e) {
e.keyCode === t.props.keyCode && t.props.handler(e);
}),
t
);
}
return (
Object(o.__extends)(t, e),
(t.prototype.componentDidMount = function () {
document.addEventListener(
this.props.eventType || 'keydown',
this._handleKeyDown,
!1,
);
}),
(t.prototype.componentWillUnmount = function () {
document.removeEventListener(
this.props.eventType || 'keydown',
this._handleKeyDown,
!1,
);
}),
(t.prototype.render = function () {
return null;
}),
t
);
})(r.PureComponent);
},
ycgn: function (e, t, n) {
e.exports = {
item: 'item-stVdeCwG',
interactive: 'interactive-3E0jwVyG',
hovered: 'hovered-2HCCgw6c',
disabled: 'disabled-2K7FyUI3',
active: 'active-muW4lycL',
shortcut: 'shortcut-2P38AivB',
iconCell: 'iconCell-OhwVvlgA',
icon: 'icon-3DDcYD-t',
checkmark: 'checkmark-2UE1siCn',
content: 'content-1GXgstZ5',
label: 'label-1If3beUH',
checked: 'checked-5eQn8630',
toolbox: 'toolbox-2XX2mSNw',
showToolboxOnHover: 'showToolboxOnHover-iCrUIcOG',
arrowIcon: 'arrowIcon-2FMesq_x',
subMenu: 'subMenu-QM4GIDtY',
};
},
},
]);