Files
ai/charting_library/bundles/blackfriday-dialog-impl.376e62a20f73b99b196d.js
2023-02-02 13:31:14 +00:00

8 lines
22 KiB
JavaScript

(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7713,9725,4002],{41632:(e,t,o)=>{e.exports=o.p+"14a6b7583a58202c653c5ddbb6c9dca5.jpeg"},55266:(e,t,o)=>{e.exports=o.p+"cec10b6e9e7839abaff324919dae8402.webp"},42829:(e,t,o)=>{e.exports=o.p+"c9fe6a08de1ec5ba4f5ab0f80ce4d761.jpeg"},19385:(e,t,o)=>{e.exports=o.p+"bdb5b8a0770dc62f8db3d518656ad60f.webp"},52164:(e,t,o)=>{e.exports=o.p+"5ca11f2dcd2b23a00d19e2160797c25d.jpeg"},97918:(e,t,o)=>{e.exports=o.p+"98d0d092bc4bf410d77c985fe872f359.webp"},60017:(e,t,o)=>{e.exports=o.p+"fa0f0ffdb522cb20d692df5233f45074.jpeg"},12668:(e,t,o)=>{e.exports=o.p+"d716b83b8ba7ad3cbabcf91275c88711.webp"},47917:(e,t,o)=>{e.exports=o.p+"db0cca97f734763ceccce1e1c3c88430.jpeg"},45318:(e,t,o)=>{e.exports=o.p+"8a93b4ee0b50a4c92979c153ece2bcbd.webp"},24738:(e,t,o)=>{e.exports=o.p+"3b2b883e642979810780b787f4769e95.jpeg"},49990:(e,t,o)=>{e.exports=o.p+"9b07bb7dc3737b56b1b93989582dfcae.webp"},14523:(e,t,o)=>{e.exports=o.p+"7c1bfcd1b31737c6e9ec505673a6b3c7.jpeg"},33868:(e,t,o)=>{e.exports=o.p+"673445ed0114e00b2249801cf1fa2810.webp"},37309:(e,t,o)=>{e.exports=o.p+"eb8399f5df28ee8b30713ca340c7dd8e.jpeg"},62643:(e,t,o)=>{e.exports=o.p+"72c3a3b432d2ad933ee80184f0524e7c.webp"},29558:(e,t,o)=>{e.exports=o.p+"5212daa031fa87a8a8ff5860132af72a.jpeg"},50075:(e,t,o)=>{e.exports=o.p+"5097be3164fb04ace2889628055b01cb.webp"},70176:(e,t,o)=>{e.exports=o.p+"1e9f070f7e9ad9001725ada71182816b.jpeg"},86139:(e,t,o)=>{e.exports=o.p+"d6d0f38ab696185b41d6421c65541584.webp"},6539:e=>{e.exports={button:"button-YKkCvwjV",content:"content-YKkCvwjV","icon-only":"icon-only-YKkCvwjV","color-brand":"color-brand-YKkCvwjV","variant-primary":"variant-primary-YKkCvwjV","variant-secondary":"variant-secondary-YKkCvwjV","color-gray":"color-gray-YKkCvwjV","color-green":"color-green-YKkCvwjV","color-red":"color-red-YKkCvwjV","size-xsmall":"size-xsmall-YKkCvwjV","size-small":"size-small-YKkCvwjV","size-medium":"size-medium-YKkCvwjV","size-large":"size-large-YKkCvwjV","size-xlarge":"size-xlarge-YKkCvwjV","with-start-icon":"with-start-icon-YKkCvwjV","with-end-icon":"with-end-icon-YKkCvwjV","start-icon-wrap":"start-icon-wrap-YKkCvwjV","end-icon-wrap":"end-icon-wrap-YKkCvwjV",animated:"animated-YKkCvwjV",stretch:"stretch-YKkCvwjV",grouped:"grouped-YKkCvwjV","adjust-position":"adjust-position-YKkCvwjV","first-row":"first-row-YKkCvwjV","first-col":"first-col-YKkCvwjV","no-corner-top-left":"no-corner-top-left-YKkCvwjV","no-corner-top-right":"no-corner-top-right-YKkCvwjV","no-corner-bottom-right":"no-corner-bottom-right-YKkCvwjV","no-corner-bottom-left":"no-corner-bottom-left-YKkCvwjV"}},27471:e=>{e.exports={background:"background-19guwtkm",page:"page-19guwtkm",picture:"picture-19guwtkm","background-img":"background-img-19guwtkm","vertical-stretch":"vertical-stretch-19guwtkm",center:"center-19guwtkm",bottom:"bottom-19guwtkm",source:"source-19guwtkm",gradient:"gradient-19guwtkm","banner-main":"banner-main-19guwtkm",banner:"banner-19guwtkm",dialog:"dialog-19guwtkm"}},8981:e=>{e.exports={"css-value-cybermonday-button":"#00e5ff",
"css-value-cybermonday-button-hover":"#00B8D4","css-value-cybermonday-button-focus-outline":"rgba(0, 229, 255, 0.8)","cyber-monday-button":"cyber-monday-button-YrzjxNPj","variant-primary":"variant-primary-YrzjxNPj","variant-secondary":"variant-secondary-YrzjxNPj"}},99323:e=>{e.exports={countdown:"countdown-MqLubNEz","offer-ends":"offer-ends-MqLubNEz"}},76880:e=>{e.exports={"css-value-blackfriday-attention":"#F23645","css-value-cybermonday-attention":"#00e5ff","up-to":"up-to-v4RmmzYp",off:"off-v4RmmzYp","free-month":"free-month-v4RmmzYp",cyber_monday:"cyber_monday-v4RmmzYp"}},8013:e=>{e.exports={"css-value-blackfriday-attention":"#F23645","css-value-cybermonday-attention":"#00e5ff",title:"title-sE9E93fC",cyber_monday:"cyber_monday-sE9E93fC",offer:"offer-sE9E93fC"}},21314:e=>{e.exports={banner:"banner-VFW2MkIn","in-dialog":"in-dialog-VFW2MkIn",container:"container-VFW2MkIn","title-group":"title-group-VFW2MkIn","actions-wrapper":"actions-wrapper-VFW2MkIn","learn-more":"learn-more-VFW2MkIn"}},41600:()=>{},83131:e=>{e.exports={"dialog-close":"dialog-close-VulYnFJT",close:"close-VulYnFJT","tv-dialog":"tv-dialog-VulYnFJT","tv-blackfriday-popup":"tv-blackfriday-popup-VulYnFJT","modal-body":"modal-body-VulYnFJT",banner:"banner-VulYnFJT"}},71036:(e,t,o)=>{"use strict";o.d(t,{SquareAnchorButton:()=>f,SquareButton:()=>u});var i=o(59496),s=o(97754),n=o(95604),a=o(9745),r=o(6539),l=o.n(r);function c(e){const{color:t="brand",size:o="medium",variant:i="primary",stretch:a=!1,icon:r,startIcon:c,endIcon:d,iconOnly:h=!1,className:p,isGrouped:m,cellState:u,disablePositionAdjustment:g=!1}=e,f=function(e){let t="";return 0!==e&&(1&e&&(t=s(t,l()["no-corner-top-left"])),2&e&&(t=s(t,l()["no-corner-top-right"])),4&e&&(t=s(t,l()["no-corner-bottom-right"])),8&e&&(t=s(t,l()["no-corner-bottom-left"]))),t}((0,n.getGroupCellRemoveRoundBorders)(u));return s(p,l().button,l()["size-"+o],l()["color-"+t],l()["variant-"+i],a&&l().stretch,(r||c)&&l()["with-start-icon"],d&&l()["with-end-icon"],h&&l()["icon-only"],f,m&&l().grouped,m&&!g&&l()["adjust-position"],m&&u.isTop&&l()["first-row"],m&&u.isLeft&&l()["first-col"])}function d(e){const{size:t,startIcon:o,icon:s,iconOnly:n,children:r,endIcon:c}=e,d=null!=o?o:s;return i.createElement(i.Fragment,null,d&&"xsmall"!==t&&i.createElement(a.Icon,{icon:d,className:l()["start-icon-wrap"]}),r&&i.createElement("span",{className:l().content},r),c&&!n&&"xsmall"!==t&&i.createElement(a.Icon,{icon:c,className:l()["end-icon-wrap"]}))}var h=o(86332),p=o(90186);function m(e){const{className:t,color:o,variant:i,size:s,stretch:n,animated:a,icon:r,iconOnly:l,startIcon:c,endIcon:d,...h}=e;return{...h,...(0,p.filterDataProps)(e),...(0,p.filterAriaProps)(e)}}function u(e){const{reference:t,...o}=e,{isGrouped:s,cellState:n,disablePositionAdjustment:a}=(0,i.useContext)(h.ControlGroupContext),r=c({...o,isGrouped:s,cellState:n,disablePositionAdjustment:a});return i.createElement("button",{...m(o),className:r,ref:t},i.createElement(d,{...o}))}function g(e){
const{className:t,color:o,variant:i,size:s,stretch:n,animated:a,icon:r,iconOnly:l,startIcon:c,endIcon:d,...h}=e;return{...h,...(0,p.filterDataProps)(e),...(0,p.filterAriaProps)(e)}}function f(e){const{reference:t}=e,{isGrouped:o,cellState:s,disablePositionAdjustment:n}=(0,i.useContext)(h.ControlGroupContext),a=c({...e,isGrouped:o,cellState:s,disablePositionAdjustment:n});return i.createElement("a",{...g(e),className:a,ref:t},i.createElement(d,{...e}))}},86332:(e,t,o)=>{"use strict";o.d(t,{ControlGroupContext:()=>i});const i=o(59496).createContext({isGrouped:!1,cellState:{isTop:!0,isRight:!0,isBottom:!0,isLeft:!0}})},95604:(e,t,o)=>{"use strict";function i(e){let t=0;return e.isTop&&e.isLeft||(t+=1),e.isTop&&e.isRight||(t+=2),e.isBottom&&e.isLeft||(t+=8),e.isBottom&&e.isRight||(t+=4),t}o.d(t,{getGroupCellRemoveRoundBorders:()=>i})},15784:(e,t,o)=>{"use strict";o.r(t),o.d(t,{showBlackFridayDialog:()=>re});var i=o(59496),s=o(87995),n=o(89725),a=o(51768),r=o(97754),l=o.n(r),c=o(28353),d=o(93299),h=o(71036),p=o(8981);function m(e){const{offerType:t,variant:o="primary"}=e;return t===d.OFFERS.cyber_monday?r(p["cyber-monday-button"],p["variant-"+o]):void 0}function u(e){const{offerType:t,children:o,onClick:s,href:n,stretch:a,variant:l="primary",className:c}=e;return i.createElement(h.SquareAnchorButton,{color:t===d.OFFERS.cyber_monday?"brand":"red",className:r(c,m(e)),stretch:a,onClick:s,variant:l,href:n,size:"xlarge","aria-label":e["aria-label"],animated:!0},o)}var g=o(8013);function f(e){const{offerType:t,className:o}=e,s=t===d.OFFERS.cyber_monday?c.t("Cyber Monday"):c.t("Black Friday"),n=c.t("{offer} sale").split(/{offer}/);return i.createElement("h1",{className:r(g.title,o,g[t])},n[0],i.createElement("span",{className:g.offer},s),n[1])}var b=o(76880);function v(e){return i.createElement("div",{className:r(e.className,b[e.offerType])},i.createElement(f,{offerType:e.offerType}),i.createElement("div",{className:b["up-to"]},(0,c.t)("Up to")),i.createElement("div",{className:b.off},(0,c.t)("60% OFF")),i.createElement("div",{className:b["free-month"]},(0,c.t)("+1 free month")))}var w,y=o(53746),k=o(82760),C=o(99323);function x(e){var t;return i.createElement("div",{className:r(C["countdown-group"],e.className)},i.createElement("div",{className:C["offer-ends"]},null!==(t=e.title)&&void 0!==t?t:(0,c.t)("Offer ends in")),i.createElement("div",{className:C.countdown},i.createElement(y.OfferCountdown,{expiration:e.expiration,size:"s",theme:e.offerType===d.OFFERS.cyber_monday?k.CountdownTheme.CyberMonday:k.CountdownTheme.BlackFriday})))}!function(e){e.Page="page",e.Banner="banner",e.Dialog="dialog",e.BannerMain="banner-main"}(w||(w={}));var j=o(86240),_=o(12668),$=o(60017),E=o(45318),S=o(47917),T=o(19385),F=o(42829),O=o(55266),z=o(41632),V=o(97918),N=o(52164);const B=[{jpeg:F,webp:T,media:j["media-mf-laptop"]},{jpeg:S,webp:E,media:j["media-mf-tablet-vertical"]},{jpeg:$,webp:_}],D=[{jpeg:z,webp:O}],Y=[{jpeg:z,webp:O}],I=[{jpeg:N,webp:V}],W={[w.Page]:B,[w.Banner]:D,[w.Dialog]:Y,[w.BannerMain]:I}
;var R=o(50075),K=o(29558),P=o(86139),M=o(70176),A=o(33868),L=o(14523),G=o(49990),q=o(24738),J=o(62643),H=o(37309);const U=[{jpeg:L,webp:A,media:j["media-mf-laptop"]},{jpeg:M,webp:P,media:j["media-mf-tablet-vertical"]},{jpeg:K,webp:R}],Q=[{jpeg:q,webp:G}],X=[{jpeg:q,webp:G}],Z=[{jpeg:H,webp:J}],ee={[w.Page]:U,[w.Banner]:Q,[w.Dialog]:X,[w.BannerMain]:Z};var te=o(27471);const oe=i.memo((function(e){const{offerType:t,theme:o=w.Page,verticalAlign:s="top",verticalStretch:n=!1}=e,a=t===d.OFFERS.cyber_monday?ee[o]:W[o];return i.createElement("div",{className:r(te.background,te[t],te[o],te[s],n&&te["vertical-stretch"])},i.createElement("picture",{className:te.picture,role:"presentation"},a.map((e,t)=>{var o;return i.createElement(i.Fragment,{key:`${null!==(o=e.media)&&void 0!==o?o:""}_${t}`},i.createElement("source",{media:e.media,srcSet:e.webp,type:"image/webp",className:te.source}),i.createElement("source",{media:e.media,srcSet:e.jpeg,type:"image/jpeg",className:te.source}))}),i.createElement("img",{src:a[a.length-1].jpeg,alt:"Background image",className:te["background-img"]})),i.createElement("div",{className:te.gradient}))}));o(41600);var ie=o(21314);const se=i.memo((function(e){const{inDialog:t,availableOffers:o,className:s,onLearnMore:n}=e,a=d.OFFERS.cyber_monday in o?d.OFFERS.cyber_monday:d.OFFERS.black_friday,l=d.OFFERS.cyber_monday in o?o[d.OFFERS.cyber_monday]:o[d.OFFERS.black_friday];if(!l)return i.createElement(i.Fragment,null);const h=r(ie.banner,s,e.inDialog&&ie["in-dialog"]);return i.createElement("div",{className:h},i.createElement(oe,{offerType:a,theme:t?w.Dialog:w.Banner,verticalAlign:"bottom"}),i.createElement("div",{className:ie.container},i.createElement(v,{offerType:a,className:ie["title-group"]}),i.createElement("div",{className:ie["actions-wrapper"]},i.createElement(x,{offerType:a,expiration:l.date_end}),i.createElement(u,{href:"/black-friday/",offerType:a,onClick:n,"aria-label":c.t("Learn more"),className:ie["learn-more"]},c.t("Explore offers")))))}));var ne=o(9481),ae=o(83131);function re(){const e=(0,n.createDialog)({type:"modal",width:920,destroyOnClose:!0,closeOnOutsideClick:!1,containerTemplate:`<div class="tv-dialog__modal-wrap"><div class="tv-dialog__modal-container"><div class="${l()("tv-dialog__modal-body",ae["modal-body"])}"></div></div></div>`,contentWrapTemplate:"<div></div>",closeButtonTemplate:`<div class="tv-dialog__close ${l()(ae.close,ae["dialog-close"])} js-dialog__close">${o(12565)}</div>`});return e.on("beforeOpen",e=>{const t=t=>{t.preventDefault(),(0,a.trackEvent)("Black Friday","BF pop-up Buy now"),window.open("/black-friday/","_blank"),e.destroy()};s.render(i.createElement("div",null,i.createElement(ne.KeyboardDocumentListener,{keyCode:13,handler:t}),i.createElement(se,{availableOffers:window.user.available_offers,className:ae.banner,onLearnMore:t,inDialog:!0})),e.$content.get(0))}),e.on("beforeClose",e=>{s.unmountComponentAtNode(e.$content.get(0))}),e.on("afterClose",()=>{(0,a.trackEvent)("Black Friday","BF pop-up close")}),e.open(),e}},89725:(e,t,o)=>{"use strict";o.r(t),
o.d(t,{createDialog:()=>n});var i=o(976),s=o(77544);function n(e){const t=e.type||"popup";return delete e.type,"modal"===t?new i.TVModal(e):new s.TVPopup(e)}},976:(e,t,o)=>{"use strict";o.d(t,{TVModal:()=>g});var i=o(28353),s=o(68587),n=o(49483),a=o(43989),r=o(51536),l=o(4185),c=o(85739),d=o(25760),h=o(23127),p=o(25977);let m=[];const u={ajax:{},closingDuration:s.dur/2,fixBodyState:!0,overlayTemplate:'<div class="tv-dialog__overlay"></div>',containerTemplate:'<div class="tv-dialog__modal-wrap"><div class="tv-dialog__modal-container"><div class="tv-dialog__modal-body"></div></div></div>',ajaxErrorTemplate:`<div class="tv-dialog__error js-dialog__close">${(0,i.t)("Error")}</div>`};class g extends r.TVDialogAbstract{constructor(e={}){if(super({...u,...e}),this.$overlay=h(this.options.overlayTemplate),this.$modalWrap=h(this.options.containerTemplate),this.$body=this.$modalWrap.find(".tv-dialog__modal-body").append(this.$el),this.options.closeOnOutsideClick&&this.$overlay.add(this.$modalWrap).click(e=>{this.isEventOut(e)&&this.close()}),this.on("change:zIndex",()=>{this.$overlay.css("z-index",this.zIndex),this.$modalWrap.css("z-index",this.zIndex)}),this.on("destroy",()=>{const e=()=>{this.$overlay.remove(),this.$modalWrap.remove()};this.opened?(this.close(),setTimeout(e,this.options.closingDuration)):e()}),this.on("beforeOpen",()=>{m.push(this)}),this.options.ajax.url){const e=this.options.ajax.beforeSend||h.noop,t=this.options.ajax.success||!1,o=this.options.ajax.error||h.noop;h.extend(this.options.ajax,{beforeSend:()=>{this.trigger("beforeLoading",[this]),this.startSpinner(),e(this)},success:e=>{this.trigger("afterLoading",[this]),this.renderContent(t?t(this,e):e).showContent(),this.trigger("afterLoadingShow",[this])},error:()=>{this.renderContent(this.options.ajaxErrorTemplate),o(this),this.trigger("errorLoading",[this])}})}this.on("error",(e,t)=>{this.$modalWrap[0].getBoundingClientRect().height<this.$content[0].getBoundingClientRect().height&&t.addClass("i-fixed").css({width:this.$el.width()})}),this._keyboardBinderLockId=null}open(){if(this.opened)return;this.opened=!0,this._keyboardBinderLockId=c.disable(),this.options.fixBodyState&&(0,a.setFixedBodyState)(!0),this._hotkeys||(this._hotkeys=d.createGroup({desc:"Modal Dialog",isDisabled:()=>!this.opened,modal:!0}),this.options.closeOnEsc&&this._hotkeys.add({desc:"close",hotkey:27,handler:()=>this.close()}));const e=()=>{this.focus(),this.toTop(),this.trigger("beforeOpen",[this]),h(this.$wrap).append(this.$overlay.addClass("i-hidden i-closed").css("z-index",this.zIndex)).append(this.$modalWrap.addClass("i-hidden i-closed").css("z-index",this.zIndex)),this.$overlay.removeClass("i-hidden"),setTimeout(()=>{this.$overlay.removeClass("i-closed")},20),this.options.ajax.url?this.ajaxRequest=h.ajax(this.options.ajax):this.showContent()};return n.isSafari?setTimeout(()=>e(),50):e(),this}close(){if(this.opened)return this.opened=!1,this._keyboardBinderLockId&&c.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(()=>{this.$modalWrap.addClass("i-hidden").detach(),this.$overlay.addClass("i-hidden").detach(),m=p.without(m,this),this.options.fixBodyState&&(0,a.setFixedBodyState)(!1),this.trigger("afterClose",[this]),this.unfocus(),m.length>0&&m[m.length-1].focus(),this.options.destroyOnClose&&this.destroy()},this.options.closingDuration),this}showContent(){return this.$modalWrap.removeClass("i-hidden"),setTimeout(()=>{this.$modalWrap.removeClass("i-closed")},20),setTimeout(()=>{this.trigger("afterOpen",[this]),this.spinner&&this.stopSpinner()},.75*s.dur+20),this}hideContent(){if(this.$el)return this.$modalWrap.addClass("i-closed"),this.unfocus(),this}startSpinner(){return this.spinner=new l.Spinner("large"),this.spinner.spin(this.$overlay[0]),this}stopSpinner(){if(this.spinner)return this.spinner.stop(),delete this.spinner,this}}},77544:(e,t,o)=>{"use strict";o.d(t,{TVPopup:()=>m});var i=o(68587),s=o(52150),n=o(51536),a=o(30812),r=o(35190),l=o(25760),c=o(23127);const d=c("body"),h=c(window),p={closeOnClickAtOtherDialogs:!0,draggable:!0,scrollWrap:'<div class="tv-dialog__scroll-wrap">',scrollWrapInner:'<div class="tv-dialog__scroll-wrap-inner">',withScroll:!0};class m extends n.TVDialogAbstract{constructor(e={}){super({...p,...e}),this.$scrollWrap=this.$content.hasClass("js-dialog__scroll-wrap")?this.$content:this.$content.find(".js-dialog__scroll-wrap"),this.$scrollWrap.length?this.$scrollWrapInner=this.$scrollWrap.children().first():(this.$scrollWrap=this.$content.wrap(c(this.options.scrollWrap)).parent(),this.$scrollWrapInner=this.$content.wrap(c(this.options.scrollWrapInner)).parent()),this.$actions&&this.$scrollWrap.addClass("i-with-actions"),this.options.withScroll&&(this.scroll=new a.SidebarCustomScroll(this.$scrollWrap[0],this.$scrollWrapInner[0]),this.scroll.scrolled.subscribe(null,()=>this.trigger("scroll"))),this.$scrollWrap.css("overflow","");const t=this.getDialogId();this.$el.addClass("tv-dialog--popup i-closed i-hidden"),this.options.width&&this.$el.css({width:"calc(100% - 20px)","max-width":this.options.width}),this._hotkeys=l.createGroup({desc:"Dialog",isDisabled:()=>!this.opened,modal:!1}),this.options.closeOnEsc&&this._hotkeys.add({desc:"Close",hotkey:27,handler:()=>this.close()}),this.$el.on("mousedown touchstart",this.toTop.bind(this)),this.options.closeOnOutsideClick&&(this._preventClick=!0,this.on("beforeOpen",()=>{setTimeout(()=>{this.opened&&(c(document).on("mousedown touchstart",()=>{this._preventClick=!1}),c(document).on("click.tv-popup-"+t,e=>{if(this._preventClick)return;const t=c(e.target).closest(".js-dialog");(this.options.closeOnClickAtOtherDialogs||0===t.length)&&this.isEventOut(e)&&this.close()}))},0)}),this.on("beforeClose",()=>c(document).off("click.tv-popup-"+t))),this.on("change:zIndex",()=>{this.$el.css("z-index",this.zIndex)}),this.on("destroy",()=>{const e=()=>{this.$el.remove(),this._hotkeys.destroy()}
;this.opened?(this.close(),setTimeout(e,i.dur/2)):e()})}open(){return this.opened||(this.opened=!0,this.trigger("beforeOpen",[this]),this.$el.appendTo(this.$wrap).removeClass("i-hidden").css((()=>{this.calcHeight();const e=h.height(),t=h.width(),o=this.$el.height(),i=this.$el.width();let s=this.options.position;return s||(s={top:e/2-o/2,left:t/2-i/2}),s.top>e-o&&(s.top=e-o),s.left>t-i&&(s.left=t-i),s.top<10&&(s.top=10),s.left<10&&(s.left=10),s})()),this.focus(),this.toTop(),this._doOpenAnimation().then(()=>{this.opened&&(this.$el.removeClass("i-closed"),this.options.draggable&&((0,r.lazyJqueryUI)(this.$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:(e,t)=>{this.trigger("dragEnd",[this])}}),this.$el.find(".js-dialog__drag").addClass("tv-dialog__grab")),this.trigger("afterOpen",[this]))}),h.on("resize.tv-popup-"+this.getDialogId(),()=>{this.calcHeight(),this.fixPos()})),this}close(){if(this.opened)return this.trigger("beforeClose",[this]),this.$el.addClass("i-closed"),this.opened=!1,this._doCloseAnimation().then(()=>{this.opened||((0,r.lazyJqueryUI)(this.$el).draggable("instance").then(e=>{e&&e.destroy()}),this.$el.addClass("i-hidden").detach(),d.css("cursor","auto"),this.trigger("afterClose",[this]),this.options.destroyOnClose&&this.destroy())}),h.off("resize.tv-popup-"+this.getDialogId()),this}hide(){this.$el.addClass("i-hidden")}show(){this.$el.removeClass("i-hidden")}fixPos(){const e=this.$el[0].getBoundingClientRect(),t={};e.bottom>s.mediaState.height-10&&(t.top=s.mediaState.height-10-e.height,t.top<10&&(t.top=10)),e.right>s.mediaState.width-10&&(t.left=s.mediaState.width-10-e.width,t.left<10&&(t.left=10)),(t.top||t.left)&&this.$el.css(t)}calcHeight(){const e=this.$el[0].getBoundingClientRect(),t=this.$scrollWrapInner[0].getBoundingClientRect(),o=this.$scrollWrap[0].getBoundingClientRect();let i=this.options.height&&this.options.height<s.mediaState.height-20?this.options.height:s.mediaState.height-20;this.$scrollWrap.css({height:""}).removeClass("i-scrollable");const n=this.$el[0].getBoundingClientRect();(this.options.height||n.height>i)&&(i-=e.height-o.height,i<60&&(i=60),this.$scrollWrap.css({height:i})),this.options.withScroll&&this.scroll.resize();const a=i<t.height;a||this.$scrollWrapInner.css("top",0),this.$scrollWrap.toggleClass("i-scrollable",a),this.$actions&&this.$actions.toggleClass("tv-dialog__section--actions_with-border",a)}updateScroll(){this.scroll&&(this.scroll.updateScroll(),this.scroll.updateScrollBar())}scrollToStart(){this.scroll&&this.scroll.scrollToStart()}_doOpenAnimation(){return Promise.resolve()}_doCloseAnimation(){return Promise.resolve()}}},52150:(e,t,o)=>{"use strict";o.d(t,{mediaState:()=>c});var i=o(85459),s=o.n(i),n=o(69677),a=o(74664),r=o(68722);class l extends(s()){constructor(){super(),this.width=0,this.height=0,this.device=null,this.breakpoints=a.breakpoints,this._checkDevice(),window.addEventListener("resize",this._checkDevice),
Object.entries(a.breakpoints).sort(([e,t],[o,i])=>t-i).forEach(([e,t],o,i)=>{let s;if(0!==o){const[,e]=i[o-1];s=e+1}else s=0;const n=(0,r.matchMediaMinMax)(s,t);n.matches&&this._setNewDevice(e),n.addListener(t=>{t.matches&&(this._checkDevice(),this._setNewDevice(e))})}),(0,n.whenDocumentReady)(this._checkDevice.bind(this)),this.isPhoneSizeDevice.bind(this)}isPhoneSizeDevice(){return"phone"===this.device||"phone-vertical"===this.device}_checkDevice(){this.width=window.innerWidth,this.height=window.innerHeight}_setNewDevice(e){const t=this.device;this.device=e,this.trigger("changeDevice",[e,t])}}const c=new l},86240:e=>{"use strict";e.exports=JSON.parse('{"size-header-height":"64px","media-phone":"screen and (max-width: 767px)","media-mf-phone-landscape":"screen and (min-width: 568px)","media-mf-tablet-vertical":"screen and (min-width: 768px)","media-mf-tablet-landscape":"screen and (min-width: 1024px)","media-mf-laptop":"screen and (min-width: 1280px)"}')}}]);