(window.webpackJsonp = window.webpackJsonp || []).push([
['dialogs-core'],
{
'6aJD': function (t, e, o) {
'use strict';
var n = o('APlX');
o.d(e, 'a', function () {
return n.TVModal;
});
},
APlX: function (t, e, o) {
'use strict';
(function (t) {
Object.defineProperty(e, '__esModule', { value: !0 }),
(e.TVModal = void 0);
var n =
Object.assign ||
function (t) {
for (var e = 1; e < arguments.length; e++) {
var o = arguments[e];
for (var n in o)
Object.prototype.hasOwnProperty.call(o, n) && (t[n] = o[n]);
}
return t;
},
i = (function () {
function t(t, e) {
for (var o = 0; o < e.length; o++) {
var n = e[o];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
'value' in n && (n.writable = !0),
Object.defineProperty(t, n.key, n);
}
}
return function (e, o, n) {
return o && t(e.prototype, o), n && t(e, n), e;
};
})();
e.isOpenedModals = function () {
return 0 !== g.length;
};
var s,
r = h(o('j1f4')),
a = o('33OQ'),
l = (s = a) && s.__esModule ? s : { default: s },
c = o('KHon'),
u = o('c2JX'),
d = h(o('6et/')),
p = h(o('lxNp'));
function h(t) {
if (t && t.__esModule) return t;
var e = {};
if (null != t)
for (var o in t)
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return (e.default = t), e;
}
function f(t, e) {
if (!(t instanceof e))
throw new TypeError('Cannot call a class as a function');
}
function v(t, e) {
if (!t)
throw new ReferenceError(
"this hasn't been initialised - super() hasn't been called",
);
return !e || ('object' != typeof e && 'function' != typeof e) ? t : e;
}
var g = [],
b = {
ajax: {},
closingDuration: r.dur / 2,
fixBodyState: !0,
overlayTemplate: '
',
containerTemplate:
'
',
ajaxErrorTemplate:
'
' +
window.t('Error') +
'
',
};
e.TVModal = (function (e) {
function o() {
var t =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: {};
f(this, o);
var e = v(
this,
(o.__proto__ || Object.getPrototypeOf(o)).call(this, n({}, b, t)),
);
if (
((e.$overlay = $(e.options.overlayTemplate)),
(e.$modalWrap = $(e.options.containerTemplate)),
(e.$body = e.$modalWrap
.find('.tv-dialog__modal-body')
.append(e.$el)),
e.options.closeOnOutsideClick &&
e.$overlay.add(e.$modalWrap).click(function (t) {
e.isEventOut(t) && e.close();
}),
e.on('change:zIndex', function () {
e.$overlay.css('z-index', e.zIndex),
e.$modalWrap.css('z-index', e.zIndex);
}),
e.on('destroy', function () {
var t = function () {
e.$overlay.remove(), e.$modalWrap.remove();
};
e.opened
? (e.close(), setTimeout(t, e.options.closingDuration))
: t();
}),
e.on('beforeOpen', function () {
g.push(e);
}),
e.options.ajax.url)
) {
var i = e.options.ajax.beforeSend || $.noop,
s = e.options.ajax.success || !1,
r = e.options.ajax.error || $.noop;
$.extend(e.options.ajax, {
beforeSend: function () {
e.trigger('beforeLoading', [e]), e.startSpinner(), i(e);
},
success: function (t) {
e.trigger('afterLoading', [e]),
e.renderContent(s ? s(e, t) : t).showContent(),
e.trigger('afterLoadingShow', [e]);
},
error: function () {
e.renderContent(e.options.ajaxErrorTemplate),
r(e),
e.trigger('errorLoading', [e]);
},
});
}
return (
e.on('error', function (t, o) {
e.$modalWrap[0].getBoundingClientRect().height <
e.$content[0].getBoundingClientRect().height &&
o.addClass('i-fixed').css({ width: e.$el.width() });
}),
(e._keyboardBinderLockId = null),
e
);
}
return (
(function (t, e) {
if ('function' != typeof e && null !== e)
throw new TypeError(
'Super expression must either be null or a function, not ' +
typeof e,
);
(t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
enumerable: !1,
writable: !0,
configurable: !0,
},
})),
e &&
(Object.setPrototypeOf
? Object.setPrototypeOf(t, e)
: (t.__proto__ = e));
})(o, e),
i(o, [
{
key: 'open',
value: function () {
var t = this;
if (!this.opened) {
(this.opened = !0),
(this._keyboardBinderLockId = d.disable()),
this.options.fixBodyState &&
l.default.setFixedBodyState(!0),
this._hotkeys ||
((this._hotkeys = p.createGroup({
desc: 'Modal Dialog',
isDisabled: function () {
return !t.opened;
},
modal: !0,
})),
this.options.closeOnEsc &&
this._hotkeys.add({
desc: 'close',
hotkey: 27,
handler: function () {
return t.close();
},
}));
var e = function () {
t.focus(),
t.toTop(),
t.trigger('beforeOpen', [t]),
$(t.$wrap)
.append(
t.$overlay
.addClass('i-hidden i-closed')
.css('z-index', t.zIndex),
)
.append(
t.$modalWrap
.addClass('i-hidden i-closed')
.css('z-index', t.zIndex),
),
t.$overlay.removeClass('i-hidden'),
setTimeout(function () {
t.$overlay.removeClass('i-closed');
}, 20),
t.options.ajax.url
? (t.ajaxRequest = $.ajax(t.options.ajax))
: t.showContent();
};
return (
l.default.isSafari
? setTimeout(function () {
return e();
}, 50)
: e(),
this
);
}
},
},
{
key: 'close',
value: function () {
var e = this;
if (this.opened)
return (
(this.opened = !1),
this._keyboardBinderLockId &&
d.enable(this._keyboardBinderLockId),
this._hotkeys &&
(this._hotkeys.destroy(), (this._hotkeys = null)),
this.trigger('beforeClose', [this]),
this.ajaxRequest &&
(this.ajaxRequest.abort(), delete this.ajaxRequest),
this.hideContent(),
this.$overlay.addClass('i-closed'),
setTimeout(function () {
e.$modalWrap.addClass('i-hidden').detach(),
e.$overlay.addClass('i-hidden').detach(),
(g = t.without(g, e)),
e.options.fixBodyState &&
l.default.setFixedBodyState(!1),
e.trigger('afterClose', [e]),
e.unfocus(),
g.length > 0 && g[g.length - 1].focus(),
e.options.destroyOnClose && e.destroy();
}, this.options.closingDuration),
this
);
},
},
{
key: 'showContent',
value: function () {
var t = this;
return (
this.$modalWrap.removeClass('i-hidden'),
setTimeout(function () {
t.$modalWrap.removeClass('i-closed');
}, 20),
setTimeout(function () {
t.trigger('afterOpen', [t]), t.spinner && t.stopSpinner();
}, 0.75 * r.dur + 20),
this
);
},
},
{
key: 'hideContent',
value: function () {
if (this.$el)
return (
this.$modalWrap.addClass('i-closed'), this.unfocus(), this
);
},
},
{
key: 'startSpinner',
value: function () {
return (
(this.spinner = new u.Spinner('large')),
this.spinner.spin(this.$overlay[0]),
this
);
},
},
{
key: 'stopSpinner',
value: function () {
if (this.spinner)
return this.spinner.stop(), delete this.spinner, this;
},
},
]),
o
);
})(c.TVDialogAbstract);
}.call(this, o('F/us')));
},
KHon: function (t, e, o) {
'use strict';
o.r(e);
var n = o('v2PZ');
o.d(e, 'TVDialogAbstract', function () {
return n.TVDialogAbstract;
}),
o.d(e, 'closeAllDialogs', function () {
return n.closeAllDialogs;
});
},
nZrM: function (t, e, o) {},
nbyR: function (t, e, o) {
'use strict';
Object.defineProperty(e, '__esModule', { value: !0 }),
(e.TVPopup = void 0);
var n,
i =
Object.assign ||
function (t) {
for (var e = 1; e < arguments.length; e++) {
var o = arguments[e];
for (var n in o)
Object.prototype.hasOwnProperty.call(o, n) && (t[n] = o[n]);
}
return t;
},
s = (function () {
function t(t, e) {
for (var o = 0; o < e.length; o++) {
var n = e[o];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
'value' in n && (n.writable = !0),
Object.defineProperty(t, n.key, n);
}
}
return function (e, o, n) {
return o && t(e.prototype, o), n && t(e, n), e;
};
})(),
r = h(o('j1f4')),
a = o('33OQ'),
l = (n = a) && n.__esModule ? n : { default: n },
c = o('KHon'),
u = o('sFgq'),
d = o('5qpw'),
p = h(o('lxNp'));
function h(t) {
if (t && t.__esModule) return t;
var e = {};
if (null != t)
for (var o in t)
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return (e.default = t), e;
}
function f(t, e) {
if (!(t instanceof e))
throw new TypeError('Cannot call a class as a function');
}
function v(t, e) {
if (!t)
throw new ReferenceError(
"this hasn't been initialised - super() hasn't been called",
);
return !e || ('object' != typeof e && 'function' != typeof e) ? t : e;
}
var g = $('body'),
b = $(window),
y = {
closeOnClickAtOtherDialogs: !0,
draggable: !0,
scrollWrap: '
',
scrollWrapInner: '
',
withScroll: !0,
};
e.TVPopup = (function (t) {
function e() {
var t =
arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
f(this, e);
var o = v(
this,
(e.__proto__ || Object.getPrototypeOf(e)).call(this, i({}, y, t)),
);
(o.$scrollWrap = o.$content.hasClass('js-dialog__scroll-wrap')
? o.$content
: o.$content.find('.js-dialog__scroll-wrap')),
o.$scrollWrap.length
? (o.$scrollWrapInner = o.$scrollWrap.children().first())
: ((o.$scrollWrap = o.$content
.wrap($(o.options.scrollWrap))
.parent()),
(o.$scrollWrapInner = o.$content
.wrap($(o.options.scrollWrapInner))
.parent())),
o.$actions && o.$scrollWrap.addClass('i-with-actions'),
o.options.withScroll &&
((o.scroll = new u.SidebarCustomScroll(
o.$scrollWrap,
o.$scrollWrapInner,
)),
o.scroll.scrolled.subscribe(null, function () {
return o.trigger('scroll');
})),
o.$scrollWrap.css('overflow', '');
var n = o.getDialogId();
return (
o.$el.addClass('tv-dialog--popup i-closed i-hidden'),
o.options.width &&
o.$el.css({
width: 'calc(100% - 20px)',
'max-width': o.options.width,
}),
(o._hotkeys = p.createGroup({
desc: 'Dialog',
isDisabled: function () {
return !o.opened;
},
modal: !1,
})),
o.options.closeOnEsc &&
o._hotkeys.add({
desc: 'Close',
hotkey: 27,
handler: function () {
return o.close();
},
}),
o.$el.on('mousedown touchstart', o.toTop.bind(o)),
o.options.closeOnOutsideClick &&
((o._preventClick = !0),
o.on('beforeOpen', function () {
setTimeout(function () {
o.opened &&
($(document).on('mousedown touchstart', function () {
o._preventClick = !1;
}),
$(document).on('click.tv-popup-' + n, function (t) {
if (!o._preventClick) {
var e = $(t.target).closest('.js-dialog');
(o.options.closeOnClickAtOtherDialogs ||
0 === e.length) &&
o.isEventOut(t) &&
o.close();
}
}));
}, 0);
}),
o.on('beforeClose', function () {
return $(document).off('click.tv-popup-' + n);
})),
o.on('change:zIndex', function () {
o.$el.css('z-index', o.zIndex);
}),
o.on('destroy', function () {
var t = function () {
o.$el.remove(), o._hotkeys.destroy();
};
o.opened ? (o.close(), setTimeout(t, r.dur / 2)) : t();
}),
o
);
}
return (
(function (t, e) {
if ('function' != typeof e && null !== e)
throw new TypeError(
'Super expression must either be null or a function, not ' +
typeof e,
);
(t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
enumerable: !1,
writable: !0,
configurable: !0,
},
})),
e &&
(Object.setPrototypeOf
? Object.setPrototypeOf(t, e)
: (t.__proto__ = e));
})(e, t),
s(e, [
{
key: 'open',
value: function () {
var t = this;
return (
this.opened ||
((this.opened = !0),
this.trigger('beforeOpen', [this]),
this.$el
.appendTo(this.$wrap)
.removeClass('i-hidden')
.css(
(function () {
t.calcHeight();
var e = b.height(),
o = b.width(),
n = t.$el.height(),
i = t.$el.width(),
s = t.options.position;
return (
s ||
(s = { top: e / 2 - n / 2, left: o / 2 - i / 2 }),
s.top > e - n && (s.top = e - n),
s.left > o - i && (s.left = o - i),
s.top < 10 && (s.top = 10),
s.left < 10 && (s.left = 10),
s
);
})(),
),
this.focus(),
this.toTop(),
this._doOpenAnimation().then(function () {
t.opened &&
(t.$el.removeClass('i-closed'),
t.options.draggable &&
((0, d.lazyJqueryUI)(t.$el).draggable({
handle: '.js-dialog__drag',
cancel:
'input, textarea, button, select, option, .js-dialog__no-drag, .js-dialog__close',
containment: 'window',
cursor: '-webkit-grabbing',
stop: function (e, o) {
t.trigger('dragEnd', [t]);
},
}),
t.$el
.find('.js-dialog__drag')
.addClass('tv-dialog__grab')),
t.trigger('afterOpen', [t]));
}),
b.on('resize.tv-popup-' + this.getDialogId(), function () {
t.calcHeight(), t.fixPos();
})),
this
);
},
},
{
key: 'close',
value: function () {
var t = this;
if (this.opened)
return (
this.trigger('beforeClose', [this]),
this.$el.addClass('i-closed'),
(this.opened = !1),
this._doCloseAnimation().then(function () {
t.opened ||
((0, d.lazyJqueryUI)(t.$el)
.draggable('instance')
.then(function (t) {
t && t.destroy();
}),
t.$el.addClass('i-hidden').detach(),
g.css('cursor', 'auto'),
t.trigger('afterClose', [t]),
t.options.destroyOnClose && t.destroy());
}),
b.off('resize.tv-popup-' + this.getDialogId()),
this
);
},
},
{
key: 'hide',
value: function () {
this.$el.addClass('i-hidden');
},
},
{
key: 'show',
value: function () {
this.$el.removeClass('i-hidden');
},
},
{
key: 'fixPos',
value: function () {
var t = this.$el[0].getBoundingClientRect(),
e = {};
t.bottom > l.default.height - 10 &&
((e.top = l.default.height - 10 - t.height),
e.top < 10 && (e.top = 10)),
t.right > l.default.width - 10 &&
((e.left = l.default.width - 10 - t.width),
e.left < 10 && (e.left = 10)),
(e.top || e.left) && this.$el.css(e);
},
},
{
key: 'calcHeight',
value: function () {
var t = this.$el[0].getBoundingClientRect(),
e = this.$scrollWrapInner[0].getBoundingClientRect(),
o = this.$scrollWrap[0].getBoundingClientRect(),
n =
this.options.height &&
this.options.height < l.default.height - 20
? this.options.height
: l.default.height - 20;
this.$scrollWrap
.css({ height: '' })
.removeClass('i-scrollable');
var i = this.$el[0].getBoundingClientRect();
(this.options.height || i.height > n) &&
((n -= t.height - o.height) < 60 && (n = 60),
this.$scrollWrap.css({ height: n })),
this.options.withScroll && this.scroll.resize();
var s = n < e.height;
s || this.$scrollWrapInner.css('top', 0),
this.$scrollWrap.toggleClass('i-scrollable', s),
this.$actions &&
this.$actions.toggleClass(
'tv-dialog__section--actions_with-border',
s,
);
},
},
{
key: 'updateScroll',
value: function () {
this.scroll &&
(this.scroll.updateScroll(), this.scroll.updateScrollBar());
},
},
{
key: 'scrollToStart',
value: function () {
this.scroll && this.scroll.scrollToStart();
},
},
{
key: '_doOpenAnimation',
value: function () {
return Promise.resolve();
},
},
{
key: '_doCloseAnimation',
value: function () {
return Promise.resolve();
},
},
]),
e
);
})(c.TVDialogAbstract);
},
qNVo: function (t, e, o) {
'use strict';
Object.defineProperty(e, '__esModule', { value: !0 }),
(e.ButtonLoader = void 0);
var n = (function () {
function t(t, e) {
for (var o = 0; o < e.length; o++) {
var n = e[o];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
'value' in n && (n.writable = !0),
Object.defineProperty(t, n.key, n);
}
}
return function (e, o, n) {
return o && t(e.prototype, o), n && t(e, n), e;
};
})();
o('IwoD');
var i = o('29gu'),
s = (function (t) {
if (t && t.__esModule) return t;
var e = {};
if (null != t)
for (var o in t)
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return (e.default = t), e;
})(o('j1f4'));
$.fn.tvButtonLoader = (0, i.createTvBlockWithInstance)(
'tv-button-loader',
function (t, e) {
return new r(t, e);
},
);
var r = (e.ButtonLoader = (function () {
function t(e, o) {
!(function (t, e) {
if (!(t instanceof e))
throw new TypeError('Cannot call a class as a function');
})(this, t),
(this.$btn = $(e).addClass('tv-button--loader')),
0 === this.$btn.find('.tv-button__loader').length &&
this.$btn.html(
'' +
this.$btn.html() +
'',
),
(this.loading = this.$btn.hasClass('i-loading'));
}
return (
n(t, [
{
key: '_start',
value: function () {
var t = this;
(this.starting = !0),
this.$btn.addClass('i-start-load'),
this.$btn.trigger('tv-button-loader:start'),
setTimeout(function () {
(t.loading = !0),
(t.starting = !1),
(t._startPromise = !1),
t.$btn.addClass('i-loading'),
t.$btn.removeClass('i-start-load'),
t._stopPromise && t._stop();
}, 2 * s.dur);
},
},
{
key: 'start',
value: function () {
this.starting ||
(this.stopping ? (this._startPromise = !0) : this._start());
},
},
{
key: '_stop',
value: function () {
var t = this;
(this.stopping = !0),
this.$btn.addClass('i-stop-load'),
this.$btn.trigger('tv-button-loader:stop'),
setTimeout(function () {
(t.loading = !1),
(t.stopping = !1),
(t._stopPromise = !1),
t.$btn.removeClass('i-loading i-start-load i-stop-load'),
t._startPromise && t._start();
}, s.dur);
},
},
{
key: 'stop',
value: function () {
this.stopping ||
(this.starting ? (this._stopPromise = !0) : this._stop());
},
},
{
key: 'toggle',
value: function () {
this.loading ? this.stop() : this.start();
},
},
{
key: 'contentHtml',
value: function (t) {
return t
? (this.$btn.find('.tv-button__text').html(t), t)
: this.$btn.find('.tv-button__text').html();
},
},
{
key: 'contentNojQuery',
value: function () {
return this.$btn.get(0);
},
},
{
key: 'disable',
value: function () {
this.stop(), this.$btn.addClass('i-disabled');
},
},
{
key: 'enable',
value: function () {
this.$btn.removeClass('i-disabled');
},
},
]),
t
);
})());
},
tKRU: function (t, e, o) {
'use strict';
var n = o('nbyR');
o.d(e, 'a', function () {
return n.TVPopup;
});
},
v2PZ: function (t, e, o) {
'use strict';
(function (t, n) {
Object.defineProperty(e, '__esModule', { value: !0 }),
(e.TVDialogAbstract = void 0);
var i = function (t, e) {
if (Array.isArray(t)) return t;
if (Symbol.iterator in Object(t))
return (function (t, e) {
var o = [],
n = !0,
i = !1,
s = void 0;
try {
for (
var r, a = t[Symbol.iterator]();
!(n = (r = a.next()).done) &&
(o.push(r.value), !e || o.length !== e);
n = !0
);
} catch (l) {
(i = !0), (s = l);
} finally {
try {
!n && a.return && a.return();
} finally {
if (i) throw s;
}
}
return o;
})(t, e);
throw new TypeError(
'Invalid attempt to destructure non-iterable instance',
);
},
s =
Object.assign ||
function (t) {
for (var e = 1; e < arguments.length; e++) {
var o = arguments[e];
for (var n in o)
Object.prototype.hasOwnProperty.call(o, n) && (t[n] = o[n]);
}
return t;
},
r = (function () {
function t(t, e) {
for (var o = 0; o < e.length; o++) {
var n = e[o];
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
'value' in n && (n.writable = !0),
Object.defineProperty(t, n.key, n);
}
}
return function (e, o, n) {
return o && t(e.prototype, o), n && t(e, n), e;
};
})();
e.closeAllDialogs = function () {
v.forEach(function (t) {
return t.close();
});
};
var a = (function (t) {
if (t && t.__esModule) return t;
var e = {};
if (null != t)
for (var o in t)
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return (e.default = t), e;
})(o('j1f4'));
o('qNVo');
var l = d(o('QwKQ'));
o('nZrM'), o('nec0'), o('IwoD');
var c = d(o('4O8T')),
u = o('jAh7');
function d(t) {
return t && t.__esModule ? t : { default: t };
}
function p(t, e) {
if (!(t instanceof e))
throw new TypeError('Cannot call a class as a function');
}
function h(t, e) {
if (!t)
throw new ReferenceError(
"this hasn't been initialised - super() hasn't been called",
);
return !e || ('object' != typeof e && 'function' != typeof e) ? t : e;
}
var f = 0,
v = [],
g = void 0,
b = $(document),
y = {
closeOnEsc: !0,
closeButton: !0,
focusFirstControl: !0,
closeOnOutsideClick: !0,
closeButtonAddClass: '',
focusClass: 'i-focused',
template: '